chips
This commit is contained in:
BIN
assets/models/Chip Single/Single Chip.blend
Normal file
BIN
assets/models/Chip Single/Single Chip.blend
Normal file
Binary file not shown.
BIN
assets/models/Chip Single/Single Chip.blend1
Normal file
BIN
assets/models/Chip Single/Single Chip.blend1
Normal file
Binary file not shown.
208
assets/models/Chip Single/Single Chip.obj
Normal file
208
assets/models/Chip Single/Single Chip.obj
Normal file
@ -0,0 +1,208 @@
|
||||
# Blender v2.92.0 OBJ File: 'Single Chip.blend'
|
||||
# www.blender.org
|
||||
o Cylinder_Cylinder.002
|
||||
v 0.000000 -0.150000 -1.000000
|
||||
v 0.000000 0.150000 -1.000000
|
||||
v 0.309017 -0.150000 -0.951057
|
||||
v 0.309017 0.150000 -0.951057
|
||||
v 0.587785 -0.150000 -0.809017
|
||||
v 0.587785 0.150000 -0.809017
|
||||
v 0.809017 -0.150000 -0.587785
|
||||
v 0.809017 0.150000 -0.587785
|
||||
v 0.951057 -0.150000 -0.309017
|
||||
v 0.951057 0.150000 -0.309017
|
||||
v 1.000000 -0.150000 0.000000
|
||||
v 1.000000 0.150000 0.000000
|
||||
v 0.951056 -0.150000 0.309017
|
||||
v 0.951056 0.150000 0.309017
|
||||
v 0.809017 -0.150000 0.587785
|
||||
v 0.809017 0.150000 0.587785
|
||||
v 0.587785 -0.150000 0.809017
|
||||
v 0.587785 0.150000 0.809017
|
||||
v 0.309017 -0.150000 0.951057
|
||||
v 0.309017 0.150000 0.951057
|
||||
v -0.000000 -0.150000 1.000000
|
||||
v -0.000000 0.150000 1.000000
|
||||
v -0.309017 -0.150000 0.951056
|
||||
v -0.309017 0.150000 0.951056
|
||||
v -0.587786 -0.150000 0.809017
|
||||
v -0.587786 0.150000 0.809017
|
||||
v -0.809017 -0.150000 0.587785
|
||||
v -0.809017 0.150000 0.587785
|
||||
v -0.951057 -0.150000 0.309016
|
||||
v -0.951057 0.150000 0.309016
|
||||
v -1.000000 -0.150000 -0.000001
|
||||
v -1.000000 0.150000 -0.000001
|
||||
v -0.951056 -0.150000 -0.309018
|
||||
v -0.951056 0.150000 -0.309018
|
||||
v -0.809016 -0.150000 -0.587786
|
||||
v -0.809016 0.150000 -0.587786
|
||||
v -0.587784 -0.150000 -0.809018
|
||||
v -0.587784 0.150000 -0.809018
|
||||
v -0.309016 -0.150000 -0.951057
|
||||
v -0.309016 0.150000 -0.951057
|
||||
vt 0.351562 0.718750
|
||||
vt 0.273438 0.789062
|
||||
vt 0.273438 0.718750
|
||||
vt 0.351562 0.789062
|
||||
vt 0.273438 0.859375
|
||||
vt 0.265625 0.507812
|
||||
vt 0.187500 0.578125
|
||||
vt 0.187500 0.507812
|
||||
vt 0.265625 0.578125
|
||||
vt 0.187500 0.648438
|
||||
vt 0.265625 0.648438
|
||||
vt 0.187500 0.718750
|
||||
vt 0.265625 0.718750
|
||||
vt 0.187500 0.789062
|
||||
vt 0.265625 0.789062
|
||||
vt 0.187500 0.859375
|
||||
vt 0.085938 0.507812
|
||||
vt 0.007812 0.578125
|
||||
vt 0.007812 0.507812
|
||||
vt 0.085938 0.578125
|
||||
vt 0.007812 0.648438
|
||||
vt 0.085938 0.648438
|
||||
vt 0.007812 0.718750
|
||||
vt 0.085938 0.718750
|
||||
vt 0.007812 0.789062
|
||||
vt 0.085938 0.789062
|
||||
vt 0.007812 0.859375
|
||||
vt 0.171875 0.507812
|
||||
vt 0.093750 0.578125
|
||||
vt 0.093750 0.507812
|
||||
vt 0.171875 0.578125
|
||||
vt 0.093750 0.648438
|
||||
vt 0.171875 0.648438
|
||||
vt 0.093750 0.718750
|
||||
vt 0.171875 0.718750
|
||||
vt 0.093750 0.789062
|
||||
vt 0.171875 0.789062
|
||||
vt 0.093750 0.859375
|
||||
vt 0.351562 0.507812
|
||||
vt 0.273438 0.578125
|
||||
vt 0.273438 0.507812
|
||||
vt 0.421875 0.070312
|
||||
vt 0.468750 0.359375
|
||||
vt 0.210938 0.492188
|
||||
vt 0.351562 0.578125
|
||||
vt 0.273438 0.648438
|
||||
vt 0.351562 0.648438
|
||||
vt 0.789062 0.007812
|
||||
vt 0.859375 0.468750
|
||||
vt 0.578125 0.421875
|
||||
vt 0.351562 0.859375
|
||||
vt 0.265625 0.859375
|
||||
vt 0.085938 0.859375
|
||||
vt 0.171875 0.859375
|
||||
vt 0.007812 0.289062
|
||||
vt 0.007812 0.210938
|
||||
vt 0.031250 0.132812
|
||||
vt 0.078125 0.078125
|
||||
vt 0.140625 0.031250
|
||||
vt 0.210938 0.007812
|
||||
vt 0.289062 0.007812
|
||||
vt 0.359375 0.031250
|
||||
vt 0.468750 0.132812
|
||||
vt 0.492188 0.210938
|
||||
vt 0.492188 0.289062
|
||||
vt 0.429688 0.421875
|
||||
vt 0.359375 0.468750
|
||||
vt 0.289062 0.492188
|
||||
vt 0.140625 0.468750
|
||||
vt 0.078125 0.421875
|
||||
vt 0.031250 0.359375
|
||||
vt 0.531250 0.359375
|
||||
vt 0.507812 0.289062
|
||||
vt 0.507812 0.210938
|
||||
vt 0.531716 0.138779
|
||||
vt 0.570312 0.078125
|
||||
vt 0.632812 0.031250
|
||||
vt 0.710938 0.007812
|
||||
vt 0.867188 0.031250
|
||||
vt 0.929688 0.078125
|
||||
vt 0.968284 0.138779
|
||||
vt 0.992188 0.210938
|
||||
vt 0.992188 0.289062
|
||||
vt 0.968284 0.361221
|
||||
vt 0.929688 0.421875
|
||||
vt 0.789062 0.492188
|
||||
vt 0.710938 0.492188
|
||||
vt 0.640625 0.468750
|
||||
s off
|
||||
f 2/1 3/2 1/3
|
||||
f 4/4 5/5 3/2
|
||||
f 6/6 7/7 5/8
|
||||
f 8/9 9/10 7/7
|
||||
f 10/11 11/12 9/10
|
||||
f 12/13 13/14 11/12
|
||||
f 14/15 15/16 13/14
|
||||
f 16/17 17/18 15/19
|
||||
f 18/20 19/21 17/18
|
||||
f 20/22 21/23 19/21
|
||||
f 22/24 23/25 21/23
|
||||
f 24/26 25/27 23/25
|
||||
f 26/28 27/29 25/30
|
||||
f 28/31 29/32 27/29
|
||||
f 30/33 31/34 29/32
|
||||
f 32/35 33/36 31/34
|
||||
f 34/37 35/38 33/36
|
||||
f 36/39 37/40 35/41
|
||||
f 30/42 22/43 14/44
|
||||
f 38/45 39/46 37/40
|
||||
f 40/47 1/3 39/46
|
||||
f 15/48 31/49 39/50
|
||||
f 2/1 4/4 3/2
|
||||
f 4/4 6/51 5/5
|
||||
f 6/6 8/9 7/7
|
||||
f 8/9 10/11 9/10
|
||||
f 10/11 12/13 11/12
|
||||
f 12/13 14/15 13/14
|
||||
f 14/15 16/52 15/16
|
||||
f 16/17 18/20 17/18
|
||||
f 18/20 20/22 19/21
|
||||
f 20/22 22/24 21/23
|
||||
f 22/24 24/26 23/25
|
||||
f 24/26 26/53 25/27
|
||||
f 26/28 28/31 27/29
|
||||
f 28/31 30/33 29/32
|
||||
f 30/33 32/35 31/34
|
||||
f 32/35 34/37 33/36
|
||||
f 34/37 36/54 35/38
|
||||
f 36/39 38/45 37/40
|
||||
f 6/55 4/56 2/57
|
||||
f 2/57 40/58 38/59
|
||||
f 38/59 36/60 34/61
|
||||
f 34/61 32/62 30/42
|
||||
f 30/42 28/63 26/64
|
||||
f 26/64 24/65 30/42
|
||||
f 24/65 22/43 30/42
|
||||
f 22/43 20/66 14/44
|
||||
f 20/66 18/67 14/44
|
||||
f 18/67 16/68 14/44
|
||||
f 14/44 12/69 10/70
|
||||
f 10/70 8/71 14/44
|
||||
f 8/71 6/55 14/44
|
||||
f 6/55 2/57 38/59
|
||||
f 38/59 34/61 30/42
|
||||
f 6/55 38/59 14/44
|
||||
f 38/59 30/42 14/44
|
||||
f 38/45 40/47 39/46
|
||||
f 40/47 2/1 1/3
|
||||
f 39/50 1/72 3/73
|
||||
f 3/73 5/74 39/50
|
||||
f 5/74 7/75 39/50
|
||||
f 7/75 9/76 15/48
|
||||
f 9/76 11/77 15/48
|
||||
f 11/77 13/78 15/48
|
||||
f 15/48 17/79 19/80
|
||||
f 19/80 21/81 23/82
|
||||
f 23/82 25/83 27/84
|
||||
f 27/84 29/85 31/49
|
||||
f 31/49 33/86 35/87
|
||||
f 35/87 37/88 39/50
|
||||
f 15/48 19/80 23/82
|
||||
f 23/82 27/84 31/49
|
||||
f 31/49 35/87 39/50
|
||||
f 39/50 7/75 15/48
|
||||
f 15/48 23/82 31/49
|
BIN
assets/models/Chip Single/Texture.pdn
Normal file
BIN
assets/models/Chip Single/Texture.pdn
Normal file
Binary file not shown.
BIN
assets/models/Chip Single/Texture.png
Normal file
BIN
assets/models/Chip Single/Texture.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 747 B |
BIN
assets/models/Chip Single/UV Wrap.png
Normal file
BIN
assets/models/Chip Single/UV Wrap.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
BIN
assets/models/Poker Table/Poker Table.fbx
Normal file
BIN
assets/models/Poker Table/Poker Table.fbx
Normal file
Binary file not shown.
BIN
assets/pokerchip.png
Normal file
BIN
assets/pokerchip.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 747 B |
@ -50,6 +50,8 @@ typedef struct {
|
||||
tileset_t *kagamiTileset;
|
||||
primitive_t *kagamiQuad;
|
||||
|
||||
primitive_t *chipPrimitive;
|
||||
texture_t *chipTexture;
|
||||
primitive_t *tablePrimitive;
|
||||
texture_t *tableTexture;
|
||||
|
||||
|
341
src/assets/models/pokerchip.c
Normal file
341
src/assets/models/pokerchip.c
Normal file
@ -0,0 +1,341 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "pokerchip.h"
|
||||
|
||||
primitive_t * pokerChipCreate() {
|
||||
vertice_t vertices[POKER_CHIP_VERTICE_COUNT] = {
|
||||
{ .x = 0, .y = 0.015, .z = -0.1, .u = 0.351562, .v = 0.28125 },
|
||||
{ .x = 0.0309017, .y = -0.015, .z = -0.09510570000000002, .u = 0.273438, .v = 0.21093799999999996 },
|
||||
{ .x = 0, .y = -0.015, .z = -0.1, .u = 0.273438, .v = 0.28125 },
|
||||
{ .x = 0.0309017, .y = 0.015, .z = -0.09510570000000002, .u = 0.351562, .v = 0.21093799999999996 },
|
||||
{ .x = 0.058778500000000004, .y = -0.015, .z = -0.08090170000000001, .u = 0.273438, .v = 0.140625 },
|
||||
{ .x = 0.058778500000000004, .y = 0.015, .z = -0.08090170000000001, .u = 0.265625, .v = 0.49218799999999996 },
|
||||
{ .x = 0.08090170000000001, .y = -0.015, .z = -0.058778500000000004, .u = 0.1875, .v = 0.421875 },
|
||||
{ .x = 0.058778500000000004, .y = -0.015, .z = -0.08090170000000001, .u = 0.1875, .v = 0.49218799999999996 },
|
||||
{ .x = 0.08090170000000001, .y = 0.015, .z = -0.058778500000000004, .u = 0.265625, .v = 0.421875 },
|
||||
{ .x = 0.09510570000000002, .y = -0.015, .z = -0.0309017, .u = 0.1875, .v = 0.35156200000000004 },
|
||||
{ .x = 0.09510570000000002, .y = 0.015, .z = -0.0309017, .u = 0.265625, .v = 0.35156200000000004 },
|
||||
{ .x = 0.1, .y = -0.015, .z = 0, .u = 0.1875, .v = 0.28125 },
|
||||
{ .x = 0.1, .y = 0.015, .z = 0, .u = 0.265625, .v = 0.28125 },
|
||||
{ .x = 0.09510560000000001, .y = -0.015, .z = 0.0309017, .u = 0.1875, .v = 0.21093799999999996 },
|
||||
{ .x = 0.09510560000000001, .y = 0.015, .z = 0.0309017, .u = 0.265625, .v = 0.21093799999999996 },
|
||||
{ .x = 0.08090170000000001, .y = -0.015, .z = 0.058778500000000004, .u = 0.1875, .v = 0.140625 },
|
||||
{ .x = 0.08090170000000001, .y = 0.015, .z = 0.058778500000000004, .u = 0.085938, .v = 0.49218799999999996 },
|
||||
{ .x = 0.058778500000000004, .y = -0.015, .z = 0.08090170000000001, .u = 0.007812, .v = 0.421875 },
|
||||
{ .x = 0.08090170000000001, .y = -0.015, .z = 0.058778500000000004, .u = 0.007812, .v = 0.49218799999999996 },
|
||||
{ .x = 0.058778500000000004, .y = 0.015, .z = 0.08090170000000001, .u = 0.085938, .v = 0.421875 },
|
||||
{ .x = 0.0309017, .y = -0.015, .z = 0.09510570000000002, .u = 0.007812, .v = 0.35156200000000004 },
|
||||
{ .x = 0.0309017, .y = 0.015, .z = 0.09510570000000002, .u = 0.085938, .v = 0.35156200000000004 },
|
||||
{ .x = 0, .y = -0.015, .z = 0.1, .u = 0.007812, .v = 0.28125 },
|
||||
{ .x = 0, .y = 0.015, .z = 0.1, .u = 0.085938, .v = 0.28125 },
|
||||
{ .x = -0.0309017, .y = -0.015, .z = 0.09510560000000001, .u = 0.007812, .v = 0.21093799999999996 },
|
||||
{ .x = -0.0309017, .y = 0.015, .z = 0.09510560000000001, .u = 0.085938, .v = 0.21093799999999996 },
|
||||
{ .x = -0.05877860000000001, .y = -0.015, .z = 0.08090170000000001, .u = 0.007812, .v = 0.140625 },
|
||||
{ .x = -0.05877860000000001, .y = 0.015, .z = 0.08090170000000001, .u = 0.171875, .v = 0.49218799999999996 },
|
||||
{ .x = -0.08090170000000001, .y = -0.015, .z = 0.058778500000000004, .u = 0.09375, .v = 0.421875 },
|
||||
{ .x = -0.05877860000000001, .y = -0.015, .z = 0.08090170000000001, .u = 0.09375, .v = 0.49218799999999996 },
|
||||
{ .x = -0.08090170000000001, .y = 0.015, .z = 0.058778500000000004, .u = 0.171875, .v = 0.421875 },
|
||||
{ .x = -0.09510570000000002, .y = -0.015, .z = 0.0309016, .u = 0.09375, .v = 0.35156200000000004 },
|
||||
{ .x = -0.09510570000000002, .y = 0.015, .z = 0.0309016, .u = 0.171875, .v = 0.35156200000000004 },
|
||||
{ .x = -0.1, .y = -0.015, .z = -1e-7, .u = 0.09375, .v = 0.28125 },
|
||||
{ .x = -0.1, .y = 0.015, .z = -1e-7, .u = 0.171875, .v = 0.28125 },
|
||||
{ .x = -0.09510560000000001, .y = -0.015, .z = -0.030901800000000004, .u = 0.09375, .v = 0.21093799999999996 },
|
||||
{ .x = -0.09510560000000001, .y = 0.015, .z = -0.030901800000000004, .u = 0.171875, .v = 0.21093799999999996 },
|
||||
{ .x = -0.0809016, .y = -0.015, .z = -0.05877860000000001, .u = 0.09375, .v = 0.140625 },
|
||||
{ .x = -0.0809016, .y = 0.015, .z = -0.05877860000000001, .u = 0.351562, .v = 0.49218799999999996 },
|
||||
{ .x = -0.0587784, .y = -0.015, .z = -0.08090180000000001, .u = 0.273438, .v = 0.421875 },
|
||||
{ .x = -0.0809016, .y = -0.015, .z = -0.05877860000000001, .u = 0.273438, .v = 0.49218799999999996 },
|
||||
{ .x = -0.09510570000000002, .y = 0.015, .z = 0.0309016, .u = 0.421875, .v = 0.929688 },
|
||||
{ .x = 0, .y = 0.015, .z = 0.1, .u = 0.46875, .v = 0.640625 },
|
||||
{ .x = 0.09510560000000001, .y = 0.015, .z = 0.0309017, .u = 0.210938, .v = 0.5078119999999999 },
|
||||
{ .x = -0.0587784, .y = 0.015, .z = -0.08090180000000001, .u = 0.351562, .v = 0.421875 },
|
||||
{ .x = -0.0309016, .y = -0.015, .z = -0.09510570000000002, .u = 0.273438, .v = 0.35156200000000004 },
|
||||
{ .x = -0.0309016, .y = 0.015, .z = -0.09510570000000002, .u = 0.351562, .v = 0.35156200000000004 },
|
||||
{ .x = 0.08090170000000001, .y = -0.015, .z = 0.058778500000000004, .u = 0.789062, .v = 0.992188 },
|
||||
{ .x = -0.1, .y = -0.015, .z = -1e-7, .u = 0.859375, .v = 0.53125 },
|
||||
{ .x = -0.0309016, .y = -0.015, .z = -0.09510570000000002, .u = 0.578125, .v = 0.578125 },
|
||||
{ .x = 0.058778500000000004, .y = 0.015, .z = -0.08090170000000001, .u = 0.351562, .v = 0.140625 },
|
||||
{ .x = 0.08090170000000001, .y = 0.015, .z = 0.058778500000000004, .u = 0.265625, .v = 0.140625 },
|
||||
{ .x = -0.05877860000000001, .y = 0.015, .z = 0.08090170000000001, .u = 0.085938, .v = 0.140625 },
|
||||
{ .x = -0.0809016, .y = 0.015, .z = -0.05877860000000001, .u = 0.171875, .v = 0.140625 },
|
||||
{ .x = 0.058778500000000004, .y = 0.015, .z = -0.08090170000000001, .u = 0.007812, .v = 0.7109380000000001 },
|
||||
{ .x = 0.0309017, .y = 0.015, .z = -0.09510570000000002, .u = 0.007812, .v = 0.789062 },
|
||||
{ .x = 0, .y = 0.015, .z = -0.1, .u = 0.03125, .v = 0.867188 },
|
||||
{ .x = -0.0309016, .y = 0.015, .z = -0.09510570000000002, .u = 0.078125, .v = 0.921875 },
|
||||
{ .x = -0.0587784, .y = 0.015, .z = -0.08090180000000001, .u = 0.140625, .v = 0.96875 },
|
||||
{ .x = -0.0809016, .y = 0.015, .z = -0.05877860000000001, .u = 0.210938, .v = 0.992188 },
|
||||
{ .x = -0.09510560000000001, .y = 0.015, .z = -0.030901800000000004, .u = 0.289062, .v = 0.992188 },
|
||||
{ .x = -0.1, .y = 0.015, .z = -1e-7, .u = 0.359375, .v = 0.96875 },
|
||||
{ .x = -0.08090170000000001, .y = 0.015, .z = 0.058778500000000004, .u = 0.46875, .v = 0.867188 },
|
||||
{ .x = -0.05877860000000001, .y = 0.015, .z = 0.08090170000000001, .u = 0.492188, .v = 0.789062 },
|
||||
{ .x = -0.0309017, .y = 0.015, .z = 0.09510560000000001, .u = 0.492188, .v = 0.7109380000000001 },
|
||||
{ .x = 0.0309017, .y = 0.015, .z = 0.09510570000000002, .u = 0.429688, .v = 0.578125 },
|
||||
{ .x = 0.058778500000000004, .y = 0.015, .z = 0.08090170000000001, .u = 0.359375, .v = 0.53125 },
|
||||
{ .x = 0.08090170000000001, .y = 0.015, .z = 0.058778500000000004, .u = 0.289062, .v = 0.5078119999999999 },
|
||||
{ .x = 0.1, .y = 0.015, .z = 0, .u = 0.140625, .v = 0.53125 },
|
||||
{ .x = 0.09510570000000002, .y = 0.015, .z = -0.0309017, .u = 0.078125, .v = 0.578125 },
|
||||
{ .x = 0.08090170000000001, .y = 0.015, .z = -0.058778500000000004, .u = 0.03125, .v = 0.640625 },
|
||||
{ .x = 0, .y = -0.015, .z = -0.1, .u = 0.53125, .v = 0.640625 },
|
||||
{ .x = 0.0309017, .y = -0.015, .z = -0.09510570000000002, .u = 0.507812, .v = 0.7109380000000001 },
|
||||
{ .x = 0.058778500000000004, .y = -0.015, .z = -0.08090170000000001, .u = 0.507812, .v = 0.789062 },
|
||||
{ .x = 0.08090170000000001, .y = -0.015, .z = -0.058778500000000004, .u = 0.531716, .v = 0.861221 },
|
||||
{ .x = 0.09510570000000002, .y = -0.015, .z = -0.0309017, .u = 0.570312, .v = 0.921875 },
|
||||
{ .x = 0.1, .y = -0.015, .z = 0, .u = 0.632812, .v = 0.96875 },
|
||||
{ .x = 0.09510560000000001, .y = -0.015, .z = 0.0309017, .u = 0.710938, .v = 0.992188 },
|
||||
{ .x = 0.058778500000000004, .y = -0.015, .z = 0.08090170000000001, .u = 0.867188, .v = 0.96875 },
|
||||
{ .x = 0.0309017, .y = -0.015, .z = 0.09510570000000002, .u = 0.929688, .v = 0.921875 },
|
||||
{ .x = 0, .y = -0.015, .z = 0.1, .u = 0.968284, .v = 0.861221 },
|
||||
{ .x = -0.0309017, .y = -0.015, .z = 0.09510560000000001, .u = 0.992188, .v = 0.789062 },
|
||||
{ .x = -0.05877860000000001, .y = -0.015, .z = 0.08090170000000001, .u = 0.992188, .v = 0.7109380000000001 },
|
||||
{ .x = -0.08090170000000001, .y = -0.015, .z = 0.058778500000000004, .u = 0.968284, .v = 0.638779 },
|
||||
{ .x = -0.09510570000000002, .y = -0.015, .z = 0.0309016, .u = 0.929688, .v = 0.578125 },
|
||||
{ .x = -0.09510560000000001, .y = -0.015, .z = -0.030901800000000004, .u = 0.789062, .v = 0.5078119999999999 },
|
||||
{ .x = -0.0809016, .y = -0.015, .z = -0.05877860000000001, .u = 0.710938, .v = 0.5078119999999999 },
|
||||
{ .x = -0.0587784, .y = -0.015, .z = -0.08090180000000001, .u = 0.640625, .v = 0.53125 }
|
||||
};
|
||||
|
||||
indice_t indices[POKER_CHIP_INDICE_COUNT] = {
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
1,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
6,
|
||||
10,
|
||||
11,
|
||||
9,
|
||||
12,
|
||||
13,
|
||||
11,
|
||||
14,
|
||||
15,
|
||||
13,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
17,
|
||||
21,
|
||||
22,
|
||||
20,
|
||||
23,
|
||||
24,
|
||||
22,
|
||||
25,
|
||||
26,
|
||||
24,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
31,
|
||||
28,
|
||||
32,
|
||||
33,
|
||||
31,
|
||||
34,
|
||||
35,
|
||||
33,
|
||||
36,
|
||||
37,
|
||||
35,
|
||||
38,
|
||||
39,
|
||||
40,
|
||||
41,
|
||||
42,
|
||||
43,
|
||||
44,
|
||||
45,
|
||||
39,
|
||||
46,
|
||||
2,
|
||||
45,
|
||||
47,
|
||||
48,
|
||||
49,
|
||||
0,
|
||||
3,
|
||||
1,
|
||||
3,
|
||||
50,
|
||||
4,
|
||||
5,
|
||||
8,
|
||||
6,
|
||||
8,
|
||||
10,
|
||||
9,
|
||||
10,
|
||||
12,
|
||||
11,
|
||||
12,
|
||||
14,
|
||||
13,
|
||||
14,
|
||||
51,
|
||||
15,
|
||||
16,
|
||||
19,
|
||||
17,
|
||||
19,
|
||||
21,
|
||||
20,
|
||||
21,
|
||||
23,
|
||||
22,
|
||||
23,
|
||||
25,
|
||||
24,
|
||||
25,
|
||||
52,
|
||||
26,
|
||||
27,
|
||||
30,
|
||||
28,
|
||||
30,
|
||||
32,
|
||||
31,
|
||||
32,
|
||||
34,
|
||||
33,
|
||||
34,
|
||||
36,
|
||||
35,
|
||||
36,
|
||||
53,
|
||||
37,
|
||||
38,
|
||||
44,
|
||||
39,
|
||||
54,
|
||||
55,
|
||||
56,
|
||||
56,
|
||||
57,
|
||||
58,
|
||||
58,
|
||||
59,
|
||||
60,
|
||||
60,
|
||||
61,
|
||||
41,
|
||||
41,
|
||||
62,
|
||||
63,
|
||||
63,
|
||||
64,
|
||||
41,
|
||||
64,
|
||||
42,
|
||||
41,
|
||||
42,
|
||||
65,
|
||||
43,
|
||||
65,
|
||||
66,
|
||||
43,
|
||||
66,
|
||||
67,
|
||||
43,
|
||||
43,
|
||||
68,
|
||||
69,
|
||||
69,
|
||||
70,
|
||||
43,
|
||||
70,
|
||||
54,
|
||||
43,
|
||||
54,
|
||||
56,
|
||||
58,
|
||||
58,
|
||||
60,
|
||||
41,
|
||||
54,
|
||||
58,
|
||||
43,
|
||||
58,
|
||||
41,
|
||||
43,
|
||||
44,
|
||||
46,
|
||||
45,
|
||||
46,
|
||||
0,
|
||||
2,
|
||||
49,
|
||||
71,
|
||||
72,
|
||||
72,
|
||||
73,
|
||||
49,
|
||||
73,
|
||||
74,
|
||||
49,
|
||||
74,
|
||||
75,
|
||||
47,
|
||||
75,
|
||||
76,
|
||||
47,
|
||||
76,
|
||||
77,
|
||||
47,
|
||||
47,
|
||||
78,
|
||||
79,
|
||||
79,
|
||||
80,
|
||||
81,
|
||||
81,
|
||||
82,
|
||||
83,
|
||||
83,
|
||||
84,
|
||||
48,
|
||||
48,
|
||||
85,
|
||||
86,
|
||||
86,
|
||||
87,
|
||||
49,
|
||||
47,
|
||||
79,
|
||||
81,
|
||||
81,
|
||||
83,
|
||||
48,
|
||||
48,
|
||||
86,
|
||||
49,
|
||||
49,
|
||||
74,
|
||||
47,
|
||||
47,
|
||||
81,
|
||||
48
|
||||
};
|
||||
|
||||
primitive_t *primitive = primitiveCreate(
|
||||
POKER_CHIP_VERTICE_COUNT,
|
||||
POKER_CHIP_INDICE_COUNT
|
||||
);
|
||||
|
||||
primitiveBufferVertices(primitive, 0, POKER_CHIP_VERTICE_COUNT, vertices);
|
||||
primitiveBufferIndices(primitive, 0, POKER_CHIP_INDICE_COUNT, indices);
|
||||
return primitive;
|
||||
}
|
22
src/assets/models/pokerchip.h
Normal file
22
src/assets/models/pokerchip.h
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <dawn/dawn.h>
|
||||
#include "../../display/primitive.h"
|
||||
|
||||
#define POKER_CHIP_NAME "Poker Chip"
|
||||
#define POKER_CHIP_VERTICE_COUNT 88
|
||||
#define POKER_CHIP_INDICE_COUNT 228
|
||||
#define POKER_CHIP_TRIANGLE_COUNT 76
|
||||
|
||||
/**
|
||||
* Generated Model Poker Chip
|
||||
* Generated at Wed, 19 May 2021 14:20:06 GMT
|
||||
* @returns Poker Chip as a primitive.
|
||||
*/
|
||||
primitive_t * pokerChipCreate();
|
@ -40,6 +40,7 @@ bool gameInit() {
|
||||
holdemRenderWorldInit();
|
||||
holdemRenderPlayerInit();
|
||||
holdemRenderCardInit();
|
||||
holdemRenderChipInit();
|
||||
|
||||
// Prepare the action manager
|
||||
pokerActionInit();
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "../poker/action/start.h"
|
||||
#include "../poker/render/player.h"
|
||||
#include "../poker/render/card.h"
|
||||
#include "../poker/render/chip.h"
|
||||
#include "../poker/render/frame.h"
|
||||
#include "../poker/render/look.h"
|
||||
#include "../poker/render/world.h"
|
||||
|
@ -42,6 +42,9 @@ void actionRoundInit(int32_t index, void *data) {
|
||||
|
||||
player->cardCount = 0;
|
||||
player->currentBet = 0;
|
||||
|
||||
player->chips = 1000;
|
||||
player->currentBet = 1000;
|
||||
}
|
||||
|
||||
// Next action
|
||||
|
23
src/poker/render/chip.c
Normal file
23
src/poker/render/chip.c
Normal file
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
void holdemRenderChipInit() {
|
||||
GAME_STATE.chipPrimitive = pokerChipCreate();
|
||||
GAME_STATE.chipTexture = assetTextureLoad("pokerchip.png");
|
||||
}
|
||||
|
||||
void holdemRenderChip() {
|
||||
shaderUsePositionAndScale(GAME_STATE.shaderWorld,
|
||||
0, 0.05, -0.6,
|
||||
0, 0, 0,
|
||||
0.2, 0.2, 0.2
|
||||
);
|
||||
shaderUseTexture(GAME_STATE.shaderWorld, GAME_STATE.chipTexture);
|
||||
primitiveDraw(GAME_STATE.chipPrimitive, 0, -1);
|
||||
}
|
23
src/poker/render/chip.h
Normal file
23
src/poker/render/chip.h
Normal file
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <dawn/dawn.h>
|
||||
#include "../../assets/models/pokerchip.h"
|
||||
#include "../../file/asset.h"
|
||||
#include "../../display/shader.h"
|
||||
#include "../../display/texture.h"
|
||||
|
||||
/**
|
||||
* Init the poker chips renderer for each player.
|
||||
*/
|
||||
void holdemRenderChipInit();
|
||||
|
||||
/**
|
||||
* Render the poker chips.
|
||||
*/
|
||||
void holdemRenderChip();
|
@ -61,13 +61,24 @@ void holdemRenderFrameUseLeft() {
|
||||
void holdemRenderFrameUseRight() {
|
||||
glClearColor(0.3, 0.3, 0, 1);
|
||||
frameBufferUse(GAME_STATE.frameRight, true);
|
||||
cameraPerspective(&GAME_STATE.cameraRight, 45,
|
||||
// cameraPerspective(&GAME_STATE.cameraRight, 45,
|
||||
// (
|
||||
// (float)GAME_STATE.frameRight->texture->width /
|
||||
// (float)GAME_STATE.frameRight->texture->height
|
||||
// ), 0.2f, 1000.0f
|
||||
// );
|
||||
// cameraLookAt(&GAME_STATE.cameraRight, 0, 3, 3, 0, 0, 0);
|
||||
|
||||
|
||||
|
||||
cameraPerspective(&GAME_STATE.cameraRight, 15,
|
||||
(
|
||||
(float)GAME_STATE.frameRight->texture->width /
|
||||
(float)GAME_STATE.frameRight->texture->height
|
||||
), 0.2f, 1000.0f
|
||||
);
|
||||
cameraLookAt(&GAME_STATE.cameraRight, 0, 3, 3, 0, 0, 0);
|
||||
cameraLookAt(&GAME_STATE.cameraRight, 0, 1, -8, 0, 0, 0);
|
||||
|
||||
shaderUseCamera(GAME_STATE.shaderWorld, &GAME_STATE.cameraRight);
|
||||
}
|
||||
|
||||
|
@ -48,4 +48,6 @@ void holdemRenderWorld() {
|
||||
holdemRenderCardForSeat(seat, player->cards[j], HOLDEM_GAME_CARD_SLOT_HAND0+j);
|
||||
}
|
||||
}
|
||||
|
||||
holdemRenderChip();
|
||||
}
|
@ -9,6 +9,7 @@
|
||||
#include <dawn/dawn.h>
|
||||
#include "player.h"
|
||||
#include "card.h"
|
||||
#include "chip.h"
|
||||
#include "../../assets/models/pokertable.h"
|
||||
|
||||
/**
|
||||
|
@ -6,13 +6,13 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const MODEL_NAME = 'Poker Table';
|
||||
const MODEL_NAME = 'Poker Chip';
|
||||
const FLIP_TEXTURE_Y = true;
|
||||
|
||||
let rawVertices = [];
|
||||
let faces = [];
|
||||
let coordinates = [];
|
||||
const filePath = path.join(__dirname, 'model.obj');
|
||||
const filePath = path.join(__dirname, '..', '..', 'assets', 'models', 'Chip Single', 'Single Chip.obj');
|
||||
const data = fs.readFileSync(filePath, 'utf-8');
|
||||
|
||||
const scale = 0.1;
|
||||
|
Reference in New Issue
Block a user