Moved code from card to poker

This commit is contained in:
2021-05-16 21:01:36 -07:00
parent 06464c260a
commit 4dbd5acab9
36 changed files with 9 additions and 9 deletions

80
src/poker/action/action.c Normal file
View File

@ -0,0 +1,80 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "action.h"
void holdemActionInit() {
// Free up all actions
memset(HOLDEM_GAME_STATE.actionQueue, (int32_t)NULL,
sizeof(holdemaction_t) * HOLDEM_GAME_ACTION_QUEUE_SIZE
);
// Free up all data
memset(HOLDEM_GAME_STATE.actionData, (int32_t)NULL, sizeof(void *) *
HOLDEM_GAME_ACTION_DATA_SIZE * HOLDEM_GAME_ACTION_QUEUE_SIZE
);
}
int32_t holdemActionAdd(holdemaction_t action) {
int32_t i = -1;
int32_t j = -1;
for(i = 0; i < HOLDEM_GAME_ACTION_QUEUE_SIZE; i++) {
if(HOLDEM_GAME_STATE.actionQueue[i].init != NULL) continue;
j = i;
break;
}
if(j == -1) return j;
HOLDEM_GAME_STATE.actionQueue[j] = action;
HOLDEM_GAME_STATE.actionInitState[j] = false;
return j;
}
void holdemActionRemove(int32_t index) {
if(HOLDEM_GAME_STATE.actionQueue[index].dispose != NULL) {
HOLDEM_GAME_STATE.actionQueue[index].dispose(
index, HOLDEM_GAME_STATE.actionData + index
);
}
memset(HOLDEM_GAME_STATE.actionQueue+index, (int32_t)NULL,
sizeof(holdemaction_t)
);
memset(HOLDEM_GAME_STATE.actionData+index, (int32_t)NULL,
sizeof(void *) * HOLDEM_GAME_ACTION_DATA_SIZE
);
}
void holdemActionUpdate() {
int32_t i;
void **data;
holdemaction_t *action;
for(i = 0; i < HOLDEM_GAME_ACTION_QUEUE_SIZE; i++) {
action = HOLDEM_GAME_STATE.actionQueue + i;
data = HOLDEM_GAME_STATE.actionData + i;
if(action->init != NULL && !HOLDEM_GAME_STATE.actionInitState[i]) {
HOLDEM_GAME_STATE.actionInitState[i] = true;
action->init(i, data);
}
if(action->update != NULL) {
action->update(i, data);
}
}
}
void holdemActionDispose() {
int32_t i;
for(i = 0; i < HOLDEM_GAME_ACTION_QUEUE_SIZE; i++) {
if(HOLDEM_GAME_STATE.actionQueue[i].dispose == NULL) continue;
HOLDEM_GAME_STATE.actionQueue[i].dispose(i, HOLDEM_GAME_STATE.actionData+i);
}
}

40
src/poker/action/action.h Normal file
View File

@ -0,0 +1,40 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include <dawn/dawn.h>
/**
* Initializes the action manager.
*/
void holdemActionInit();
/**
* Adds an action to the action queue.
*
* @param action Action to add to the queue.
* @returns The index of the action within the queue, or -1 if failure occured.
*/
int32_t holdemActionAdd(holdemaction_t action);
/**
* Removes an action from the action queue.
*
* @param index Action to remove (by index in the queue).
*/
void holdemActionRemove(int32_t index);
/**
* Updates the action manager, which (in turn) updates all actions that are
* currently running.
*/
void holdemActionUpdate();
/**
* Cleans up the action manager and all actions.
*/
void holdemActionDispose();

39
src/poker/action/ai.c Normal file
View File

@ -0,0 +1,39 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "ai.h"
holdemaction_t actionAi() {
return (holdemaction_t){
.init = &actionAiInit,
.update = &actionAiUpdate,
.dispose = &actionAiDispose
};
}
void actionAiInit(int32_t index, void *data) {
logText("AI Round start");
/*
Current theory for the AI code will be;
1 - Determine weight of my cards+flop as %
2 - Determine current bet, compare against [something] and then determine if
worth the risk. I may need history of the game to make informed decision
*/
holdemActionRemove(index);
}
void actionAiUpdate(int32_t index, void *data) {
}
void actionAiDispose(int32_t index, void *data) {
// Do we need to do a flop?
if(HOLDEM_GAME_STATE.cardsFacing < HOLDEM_DEALER_HAND) {
holdemActionAdd(actionFlop());
}
}

18
src/poker/action/ai.h Normal file
View File

@ -0,0 +1,18 @@
/**
* 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 "action.h"
#include "flop.h"
#include "../../debug/log.h"
holdemaction_t actionAi();
void actionAiInit(int32_t index, void *data);
void actionAiUpdate(int32_t index, void *data);
void actionAiDispose(int32_t index, void *data);

45
src/poker/action/deal.c Normal file
View File

@ -0,0 +1,45 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "deal.h"
holdemaction_t actionDeal() {
return (holdemaction_t){
.init = &actionDealInit,
.update = &actionDealUpdate,
.dispose = &actionDealDispose
};
}
void actionDealInit(int32_t index, void *data) {
uint8_t i, j;
holdemplayer_t *player;
logText("Dealing Cards");
for(i = 0; i < 2; i++) {
for(j = 0; j < HOLDEM_PLAYER_COUNT; j++) {
player = HOLDEM_GAME_STATE.players + j;
cardDeal(HOLDEM_GAME_STATE.deck,
player->cards,
HOLDEM_GAME_STATE.deckSize,
player->cardCount
);
HOLDEM_GAME_STATE.deckSize--;
player->cardCount++;
}
}
holdemActionRemove(index);
}
void actionDealUpdate(int32_t i, void *data) {
}
void actionDealDispose(int32_t i, void *data) {
int32_t newI = holdemActionAdd(actionAi());
}

18
src/poker/action/deal.h Normal file
View File

@ -0,0 +1,18 @@
/**
* 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 "../../debug/log.h"
#include "action.h"
#include "ai.h"
holdemaction_t actionDeal();
void actionDealInit(int32_t i, void *data);
void actionDealUpdate(int32_t i, void *data);
void actionDealDispose(int32_t i, void *data);

51
src/poker/action/flop.c Normal file
View File

@ -0,0 +1,51 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "flop.h"
holdemaction_t actionFlop() {
return (holdemaction_t){
.init = &actionFlopInit,
.update = &actionFlopUpdate,
.dispose = &actionFlopDispose
};
}
void actionFlopInit(int32_t index, void *data) {
uint8_t i, count;
logText("Flop");
// Look at the dealer
holdemRenderLookHand(&HOLDEM_GAME_STATE.cameraLeft, HOLDEM_GAME_SEAT_DEALER);
// Do the flop
// if(match->cardsFacing >= HOLDEM_DEALER_HAND) return;
// Burn the card off the top
HOLDEM_GAME_STATE.deckSize -= 1;
// Change count depending on facing
count = HOLDEM_GAME_STATE.cardsFacing == 0 ? 0x03 : 0x01;
// Deal
for(i = 0; i < count; i++) {
cardDeal(HOLDEM_GAME_STATE.deck, HOLDEM_GAME_STATE.cards, HOLDEM_GAME_STATE.deckSize, HOLDEM_GAME_STATE.cardsFacing);
HOLDEM_GAME_STATE.deckSize -= 1;
HOLDEM_GAME_STATE.cardsFacing += 1;
}
// Next action
holdemActionRemove(index);
}
void actionFlopUpdate(int32_t index, void *data) {
}
void actionFlopDispose(int32_t index, void *data) {
holdemActionAdd(actionAi());
}

19
src/poker/action/flop.h Normal file
View File

@ -0,0 +1,19 @@
/**
* 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 "../../debug/log.h"
#include "../render/look.h"
#include "action.h"
#include "ai.h"
holdemaction_t actionFlop();
void actionFlopInit(int32_t index, void *data);
void actionFlopUpdate(int32_t index, void *data);
void actionFlopDispose(int32_t index, void *data);

63
src/poker/action/round.c Normal file
View File

@ -0,0 +1,63 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "round.h"
holdemaction_t actionRound() {
return (holdemaction_t){
.init = &actionRoundInit,
.update = &actionRoundUpdate,
.dispose = &actionRoundDispose
};
}
void actionRoundInit(int32_t index, void *data) {
uint8_t i;
holdemplayer_t *player;
logText("Round Start");
// Look at the dealer.
holdemRenderLookHand(&HOLDEM_GAME_STATE.cameraLeft, HOLDEM_GAME_SEAT_DEALER);
// Init the round and shuffle the deck
cardDeckFill(HOLDEM_GAME_STATE.deck);
HOLDEM_GAME_STATE.deckSize = CARD_DECK_SIZE;
HOLDEM_GAME_STATE.pot = 0;
HOLDEM_GAME_STATE.cardsFacing = 0;
// Reset the players
for(i = 0; i < HOLDEM_PLAYER_COUNT; i++) {
player = HOLDEM_GAME_STATE.players + i;
// Clear Round State(s)
player->state &= ~(
HOLDEM_STATE_FOLDED |
HOLDEM_STATE_SHOWING
);
player->cardCount = 0;
player->currentBet = 0;
}
// Next action
holdemActionRemove(index);
}
void actionRoundUpdate(int32_t index, void *data) {
}
void actionRoundAfterShuffle() {
logText("Shuffle Done");
int32_t i = holdemActionAdd(actionDeal());
}
void actionRoundDispose(int32_t index, void *data) {
int32_t newI = holdemActionAdd(actionShuffle());
shuffledata_t *newData=(shuffledata_t *)(HOLDEM_GAME_STATE.actionData + newI);
newData->done = &actionRoundAfterShuffle;
}

23
src/poker/action/round.h Normal file
View 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 "../render/look.h"
#include "../../debug/log.h"
#include "action.h"
#include "ai.h"
#include "shuffle.h"
#include "deal.h"
holdemaction_t actionRound();
void actionRoundInit(int32_t index, void *data);
void actionRoundUpdate(int32_t index, void *data);
void actionRoundDispose(int32_t index, void *data);
void actionRoundAfterShuffle();

View File

@ -0,0 +1,30 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "shuffle.h"
holdemaction_t actionShuffle() {
return (holdemaction_t){
.init = &actionShuffleInit,
.update = &actionShuffleUpdate,
.dispose = &actionShuffleDispose
};
}
void actionShuffleInit(int32_t index, void *data) {
logText("Shuffle Deck");
cardShuffle(HOLDEM_GAME_STATE.deck, HOLDEM_GAME_STATE.deckSize);
holdemActionRemove(index);
}
void actionShuffleUpdate(int32_t index, void *data) {
}
void actionShuffleDispose(int32_t index, void *data) {
if(((shuffledata_t *)data) != NULL) ((shuffledata_t *)data)->done();
}

View 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 "action.h"
#include "../../debug/log.h"
typedef struct {
void (*done)();
} shuffledata_t;
holdemaction_t actionShuffle();
void actionShuffleInit(int32_t index, void *data);
void actionShuffleUpdate(int32_t index, void *data);
void actionShuffleDispose(int32_t index, void *data);

46
src/poker/action/start.c Normal file
View File

@ -0,0 +1,46 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "start.h"
holdemaction_t actionStart() {
holdemaction_t action = {
.init = &actionStartInit,
.update = &actionStartUpdate,
.dispose = &actionStartDispose
};
return action;
}
void actionStartInit(int32_t index, void *data) {
uint8_t i;
holdemplayer_t *player;
logText("Holdem Starting");
// Prepare the match
HOLDEM_GAME_STATE.blindBig = 0;
HOLDEM_GAME_STATE.blindSmall = 0;
HOLDEM_GAME_STATE.pot = 0;
// Reset the players
for(i = 0; i < HOLDEM_PLAYER_COUNT; i++) {
player = HOLDEM_GAME_STATE.players + i;
player->state = 0x00;
player->chips = 0;
}
holdemActionRemove(index);
}
void actionStartUpdate(int32_t index, void *data) {
}
void actionStartDispose(int32_t index, void *data) {
// Begin the first round
holdemActionAdd(actionRound());
}

18
src/poker/action/start.h Normal file
View File

@ -0,0 +1,18 @@
/**
* 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 "action.h"
#include "round.h"
#include "../../debug/log.h"
holdemaction_t actionStart();
void actionStartInit(int32_t index, void *data);
void actionStartUpdate(int32_t index, void *data);
void actionStartDispose(int32_t index, void *data);

34
src/poker/card.c Normal file
View File

@ -0,0 +1,34 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "card.h"
void cardDeckFill(card_t *deck) {
uint8_t i;
for(i = 0; i < CARD_DECK_SIZE; i++) {
deck[i] = i;
}
}
void cardShuffle(card_t *hand, uint8_t cardCount) {
uint8_t i, j;
card_t temporary;
for(i = 0; i < cardCount - 1; i++) {
// Select random element from remaining elements.
j = u8randRange(i, cardCount);
temporary = hand[j];// Take out other card
hand[j] = hand[i];// Move my card there
hand[i] = temporary;// Put other card here.
}
}
void cardDeal(card_t *deck, card_t *hand, uint8_t deckSize, uint8_t handSize) {
card_t card;
card = deck[deckSize-1];
deck[deckSize-1] = 0x00;
hand[handSize] = card;
}

34
src/poker/card.h Normal file
View File

@ -0,0 +1,34 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include <dawn/dawn.h>
/**
* Fills a deck with a standard set of cards (unshuffled)
*
* @param deck Deck to fill. Must be at least 52 elements.
*/
void cardDeckFill(card_t *deck);
/**
* Shuffles the given hand or deck.
*
* @param hand The hand/deck to shuffle.
* @param cardCount The amount of cards that are in that deck/hand.
*/
void cardShuffle(card_t *hand, uint8_t cardCount);
/**
* Deals a card of the top of the deck into the given hand.
*
* @param deck Deck to take from.
* @param hand Hand to put into.
* @param deckSize Size of the current deck.
* @param handSize Size of the current hand.
*/
void cardDeal(card_t *deck, card_t *hand, uint8_t deckSize, uint8_t handSize);

53
src/poker/holdemgame.c Normal file
View File

@ -0,0 +1,53 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "holdemgame.h"
holdemgame_t HOLDEM_GAME_STATE;
void holdemGameInit() {
// Font
HOLDEM_GAME_STATE.fontTexture = assetTextureLoad("font.png");
HOLDEM_GAME_STATE.fontTileset = tilesetCreate(20, 20,
HOLDEM_GAME_STATE.fontTexture->width,
HOLDEM_GAME_STATE.fontTexture->height,
1, 1, 1, 1
);
HOLDEM_GAME_STATE.fontBatch = spriteBatchCreate(1024);
// Prepare the renderer.
holdemRenderFrameInit();
holdemRenderSceneInit();
holdemRenderPlayerInit();
holdemRenderCardInit();
// Prepare the action manager
holdemActionInit();
// Start the first action
holdemActionAdd(actionStart());
}
void holdemGameUpdate() {
// Update the frame buffers and action queue
holdemRenderFrameUpdate();
holdemActionUpdate();
// Render things on the left frame buffer
holdemRenderFrameUseLeft();
holdemRenderWorld();
// Render things on the right frame buffer
holdemRenderFrameUseRight();
holdemRenderWorld();
// Finally, render the frame buffers to the back buffer.
holdemRenderFrameBack();
}
void holdemGameDispose() {
holdemActionDispose();
}

35
src/poker/holdemgame.h Normal file
View File

@ -0,0 +1,35 @@
/**
* 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 "../file/asset.h"
#include "../display/gui/font.h"
#include "card.h"
#include "action/action.h"
#include "action/start.h"
#include "render/player.h"
#include "render/card.h"
#include "render/frame.h"
#include "render/look.h"
#include "render/scene.h"
#include "render/world.h"
/**
* Initializes the Texas Hold'em game
*/
void holdemGameInit();
/**
* Update the Texas Hold'em game.
*/
void holdemGameUpdate();
/**
* Dispose the Texas Hold'em game.
*/
void holdemGameDispose();

View File

@ -0,0 +1,697 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "pokertable.h"
primitive_t * pokerTableCreate() {
vertice_t vertices[POKER_TABLE_VERTICE_COUNT] = {
{ .x = 0.12437210000000001, .y = 0, .z = -0.30026090000000005, .u = 0.836914, .v = 0.265625 },
{ .x = 0.29349590000000003, .y = 0.0176777, .z = -0.12157000000000001, .u = 0.853516, .v = 0.06445299999999998 },
{ .x = 0.3002608, .y = 0, .z = -0.12437210000000001, .u = 0.836914, .v = 0.06445299999999998 },
{ .x = 0.10804000000000001, .y = 0.0176777, .z = -0.2608318, .u = 0.426758, .v = 0.009766000000000052 },
{ .x = 0.2540669, .y = 0, .z = -0.10523800000000001, .u = 0.411133, .v = 0.18261700000000003 },
{ .x = 0.2608318, .y = 0.0176777, .z = -0.1080401, .u = 0.426758, .v = 0.18261700000000003 },
{ .x = 0.114805, .y = -0.025, .z = -0.2771639, .u = 0.9375, .v = 0.43359400000000003 },
{ .x = 0.29349590000000003, .y = -0.0176777, .z = -0.12157000000000001, .u = 0.952148, .v = 0.23828099999999997 },
{ .x = 0.2771638, .y = -0.025, .z = -0.1148051, .u = 0.9375, .v = 0.23828099999999997 },
{ .x = 0.12156990000000001, .y = -0.0176777, .z = -0.29349590000000003, .u = 0.920898, .v = 1 },
{ .x = 0.3002608, .y = 0, .z = -0.12437210000000001, .u = 0.936523, .v = 0.800781 },
{ .x = 0.29349590000000003, .y = -0.0176777, .z = -0.12157000000000001, .u = 0.920898, .v = 0.800781 },
{ .x = -0.12437210000000001, .y = 0, .z = -0.3002608, .u = 0.473633, .v = 0.23828099999999997 },
{ .x = 0.12156990000000001, .y = 0.0176777, .z = -0.29349590000000003, .u = 0.489258, .v = 0.03808599999999995 },
{ .x = 0.12437210000000001, .y = 0, .z = -0.30026090000000005, .u = 0.473633, .v = 0.03808599999999995 },
{ .x = 0.10804000000000001, .y = 0.0176777, .z = -0.2608318, .u = 0.984375, .v = 0.765625 },
{ .x = -0.1052379, .y = 0, .z = -0.2540669, .u = 0.96875, .v = 0.592773 },
{ .x = 0.1052379, .y = 0, .z = -0.2540669, .u = 0.96875, .v = 0.765625 },
{ .x = 0.114805, .y = -0.025, .z = -0.2771639, .u = 0.914062, .v = 0.030272999999999994 },
{ .x = -0.12157000000000001, .y = -0.0176777, .z = -0.29349590000000003, .u = 0.928711, .v = 0.22558599999999995 },
{ .x = 0.12156990000000001, .y = -0.0176777, .z = -0.29349590000000003, .u = 0.928711, .v = 0.030272999999999994 },
{ .x = -0.12157000000000001, .y = -0.0176777, .z = -0.29349590000000003, .u = 0.936523, .v = 0.592773 },
{ .x = 0.12437210000000001, .y = 0, .z = -0.30026090000000005, .u = 0.920898, .v = 0.791992 },
{ .x = 0.12156990000000001, .y = -0.0176777, .z = -0.29349590000000003, .u = 0.936523, .v = 0.791992 },
{ .x = -0.12437210000000001, .y = 0, .z = -0.3002608, .u = 0.914062, .v = 0.233398 },
{ .x = -0.29349590000000003, .y = 0.0176777, .z = -0.12156990000000001, .u = 0.929688, .v = 0.43359400000000003 },
{ .x = -0.12157000000000001, .y = 0.0176777, .z = -0.29349590000000003, .u = 0.929688, .v = 0.233398 },
{ .x = -0.2608319, .y = 0.0176777, .z = -0.10804000000000001, .u = 0.960938, .v = 0.592773 },
{ .x = -0.1052379, .y = 0, .z = -0.2540669, .u = 0.944336, .v = 0.765625 },
{ .x = -0.1080401, .y = 0.0176777, .z = -0.2608318, .u = 0.960938, .v = 0.765625 },
{ .x = -0.2771639, .y = -0.025, .z = -0.11480490000000002, .u = 0.615234, .v = 0.23828099999999997 },
{ .x = -0.12157000000000001, .y = -0.0176777, .z = -0.29349590000000003, .u = 0.630859, .v = 0.042969000000000035 },
{ .x = -0.114805, .y = -0.025, .z = -0.2771638, .u = 0.615234, .v = 0.042969000000000035 },
{ .x = -0.29349590000000003, .y = -0.0176777, .z = -0.12156990000000001, .u = 0.861328, .v = 0.264648 },
{ .x = -0.12437210000000001, .y = 0, .z = -0.3002608, .u = 0.876953, .v = 0.06445299999999998 },
{ .x = -0.12157000000000001, .y = -0.0176777, .z = -0.29349590000000003, .u = 0.861328, .v = 0.06445299999999998 },
{ .x = -0.30026090000000005, .y = 0, .z = -0.124372, .u = 0.544922, .v = 0.03808599999999995 },
{ .x = -0.29349590000000003, .y = 0.0176777, .z = 0.12157000000000001, .u = 0.560547, .v = 0.23828099999999997 },
{ .x = -0.29349590000000003, .y = 0.0176777, .z = -0.12156990000000001, .u = 0.560547, .v = 0.03808599999999995 },
{ .x = -0.2608319, .y = 0.0176777, .z = -0.10804000000000001, .u = 0.967773, .v = 0.826172 },
{ .x = -0.2540669, .y = 0, .z = 0.1052379, .u = 0.983398, .v = 1 },
{ .x = -0.2540669, .y = 0, .z = -0.1052379, .u = 0.983398, .v = 0.826172 },
{ .x = -0.2771638, .y = -0.025, .z = 0.114805, .u = 0.9375, .v = 0.22949200000000003 },
{ .x = -0.29349590000000003, .y = -0.0176777, .z = -0.12156990000000001, .u = 0.953125, .v = 0.03320299999999998 },
{ .x = -0.2771639, .y = -0.025, .z = -0.11480490000000002, .u = 0.9375, .v = 0.03320299999999998 },
{ .x = -0.29349590000000003, .y = -0.0176777, .z = 0.12157000000000001, .u = 0.49707, .v = 0.23828099999999997 },
{ .x = -0.30026090000000005, .y = 0, .z = -0.124372, .u = 0.512695, .v = 0.03808599999999995 },
{ .x = -0.29349590000000003, .y = -0.0176777, .z = -0.12156990000000001, .u = 0.49707, .v = 0.03808599999999995 },
{ .x = -0.1243722, .y = 0, .z = 0.3002608, .u = 0.805664, .v = 0.06445299999999998 },
{ .x = -0.29349590000000003, .y = 0.0176777, .z = 0.12157000000000001, .u = 0.790039, .v = 0.264648 },
{ .x = -0.3002608, .y = 0, .z = 0.12437210000000001, .u = 0.805664, .v = 0.264648 },
{ .x = -0.2608318, .y = 0.0176777, .z = 0.1080401, .u = 0.43457, .v = 0.009766000000000052 },
{ .x = -0.10523800000000001, .y = 0, .z = 0.25406680000000004, .u = 0.450195, .v = 0.18261700000000003 },
{ .x = -0.2540669, .y = 0, .z = 0.1052379, .u = 0.450195, .v = 0.009766000000000052 },
{ .x = -0.1148051, .y = -0.025, .z = 0.2771638, .u = 0.944336, .v = 1 },
{ .x = -0.29349590000000003, .y = -0.0176777, .z = 0.12157000000000001, .u = 0.959961, .v = 0.804688 },
{ .x = -0.2771638, .y = -0.025, .z = 0.114805, .u = 0.944336, .v = 0.804688 },
{ .x = -0.12157000000000001, .y = -0.0176777, .z = 0.29349590000000003, .u = 0.813477, .v = 0.264648 },
{ .x = -0.3002608, .y = 0, .z = 0.12437210000000001, .u = 0.829102, .v = 0.06445299999999998 },
{ .x = -0.29349590000000003, .y = -0.0176777, .z = 0.12157000000000001, .u = 0.813477, .v = 0.06445299999999998 },
{ .x = 0.1243722, .y = 0, .z = 0.3002608, .u = 0.757812, .v = 0.06445299999999998 },
{ .x = -0.12157000000000001, .y = 0.0176777, .z = 0.29349590000000003, .u = 0.742188, .v = 0.263672 },
{ .x = -0.1243722, .y = 0, .z = 0.3002608, .u = 0.757812, .v = 0.263672 },
{ .x = 0.1080401, .y = 0.0176777, .z = 0.2608318, .u = 0.960938, .v = 0.251953 },
{ .x = -0.10523800000000001, .y = 0, .z = 0.25406680000000004, .u = 0.976562, .v = 0.078125 },
{ .x = -0.1080401, .y = 0.0176777, .z = 0.2608318, .u = 0.960938, .v = 0.078125 },
{ .x = -0.1148051, .y = -0.025, .z = 0.2771638, .u = 0.638672, .v = 0.042969000000000035 },
{ .x = 0.12157000000000001, .y = -0.0176777, .z = 0.29349590000000003, .u = 0.654297, .v = 0.23828099999999997 },
{ .x = -0.12157000000000001, .y = -0.0176777, .z = 0.29349590000000003, .u = 0.654297, .v = 0.042969000000000035 },
{ .x = 0.12157000000000001, .y = -0.0176777, .z = 0.29349590000000003, .u = 0.765625, .v = 0.264648 },
{ .x = -0.1243722, .y = 0, .z = 0.3002608, .u = 0.78125, .v = 0.06445299999999998 },
{ .x = -0.12157000000000001, .y = -0.0176777, .z = 0.29349590000000003, .u = 0.765625, .v = 0.06445299999999998 },
{ .x = 0.1243722, .y = 0, .z = 0.3002608, .u = 0.520508, .v = 0.03808599999999995 },
{ .x = 0.29349580000000003, .y = 0.0176777, .z = 0.1215701, .u = 0.536133, .v = 0.23828099999999997 },
{ .x = 0.12157000000000001, .y = 0.0176777, .z = 0.29349590000000003, .u = 0.536133, .v = 0.03808599999999995 },
{ .x = -0.1080401, .y = 0.0176777, .z = 0.2608318, .u = 0.026367, .v = 0.851562 },
{ .x = 0.12157000000000001, .y = 0.0176777, .z = 0.29349590000000003, .u = 0.136719, .v = 1 },
{ .x = 0.1080401, .y = 0.0176777, .z = 0.2608318, .u = 0.146484, .v = 0.97168 },
{ .x = 0.2608318, .y = 0.0176777, .z = 0.10804020000000002, .u = 1, .v = 0.25976600000000005 },
{ .x = 0.10523800000000001, .y = 0, .z = 0.2540669, .u = 0.984375, .v = 0.43359400000000003 },
{ .x = 0.1080401, .y = 0.0176777, .z = 0.2608318, .u = 1, .v = 0.43359400000000003 },
{ .x = 0.2771638, .y = -0.025, .z = 0.11480520000000001, .u = 0.889648, .v = 0.22558599999999995 },
{ .x = 0.12157000000000001, .y = -0.0176777, .z = 0.29349590000000003, .u = 0.905273, .v = 0.030272999999999994 },
{ .x = 0.1148051, .y = -0.025, .z = 0.2771638, .u = 0.889648, .v = 0.030272999999999994 },
{ .x = 0.29349580000000003, .y = -0.0176777, .z = 0.1215701, .u = 0.568359, .v = 0.23828099999999997 },
{ .x = 0.1243722, .y = 0, .z = 0.3002608, .u = 0.583984, .v = 0.03808599999999995 },
{ .x = 0.12157000000000001, .y = -0.0176777, .z = 0.29349590000000003, .u = 0.568359, .v = 0.03808599999999995 },
{ .x = 0.3002608, .y = 0, .z = -0.12437210000000001, .u = 0.889648, .v = 0.43457 },
{ .x = 0.29349580000000003, .y = 0.0176777, .z = 0.1215701, .u = 0.90625, .v = 0.233398 },
{ .x = 0.3002608, .y = 0, .z = 0.1243722, .u = 0.889648, .v = 0.233398 },
{ .x = 0.2608318, .y = 0.0176777, .z = 0.10804020000000002, .u = 0.976562, .v = 0.43359400000000003 },
{ .x = 0.2540669, .y = 0, .z = -0.10523800000000001, .u = 0.960938, .v = 0.25976600000000005 },
{ .x = 0.25406680000000004, .y = 0, .z = 0.1052381, .u = 0.960938, .v = 0.43359400000000003 },
{ .x = 0.2771638, .y = -0.025, .z = 0.11480520000000001, .u = 0.592773, .v = 0.042969000000000035 },
{ .x = 0.29349590000000003, .y = -0.0176777, .z = -0.12157000000000001, .u = 0.608398, .v = 0.23828099999999997 },
{ .x = 0.29349580000000003, .y = -0.0176777, .z = 0.1215701, .u = 0.608398, .v = 0.042969000000000035 },
{ .x = 0.29349590000000003, .y = -0.0176777, .z = -0.12157000000000001, .u = 0.734375, .v = 0.06445299999999998 },
{ .x = 0.3002608, .y = 0, .z = 0.1243722, .u = 0.717773, .v = 0.264648 },
{ .x = 0.29349580000000003, .y = -0.0176777, .z = 0.1215701, .u = 0.734375, .v = 0.264648 },
{ .x = -0.29349590000000003, .y = 0.0176777, .z = 0.12157000000000001, .u = 0, .v = 0.6660159999999999 },
{ .x = -0.12157000000000001, .y = 0.0176777, .z = 0.29349590000000003, .u = 0, .v = 0.863281 },
{ .x = -0.2608318, .y = 0.0176777, .z = 0.1080401, .u = 0.026367, .v = 0.676758 },
{ .x = -0.29349590000000003, .y = 0.0176777, .z = -0.12156990000000001, .u = 0.136719, .v = 0.529297 },
{ .x = -0.1080401, .y = 0.0176777, .z = -0.2608318, .u = 0.318359, .v = 0.5566409999999999 },
{ .x = -0.12157000000000001, .y = 0.0176777, .z = -0.29349590000000003, .u = 0.328125, .v = 0.529297 },
{ .x = 0.12156990000000001, .y = 0.0176777, .z = -0.29349590000000003, .u = 0.46582, .v = 0.666992 },
{ .x = 0.10804000000000001, .y = 0.0176777, .z = -0.2608318, .u = 0.438477, .v = 0.676758 },
{ .x = 0.29349590000000003, .y = 0.0176777, .z = -0.12157000000000001, .u = 0.46582, .v = 0.862305 },
{ .x = 0.2608318, .y = 0.0176777, .z = 0.10804020000000002, .u = 0.318359, .v = 0.97168 },
{ .x = 0.29349580000000003, .y = 0.0176777, .z = 0.1215701, .u = 0.328125, .v = 1 },
{ .x = -0.10523800000000001, .y = 0, .z = 0.25406680000000004, .u = 0.40222, .v = 0.23327200000000003 },
{ .x = -0.2540669, .y = 0, .z = -0.1052379, .u = 0.119141, .v = 0.11425799999999997 },
{ .x = 0.1052379, .y = 0, .z = -0.2540669, .u = 0, .v = 0.40136700000000003 },
{ .x = -0.114805, .y = -0.025, .z = -0.2771638, .u = 0.472656, .v = 0.685547 },
{ .x = 0.114805, .y = -0.025, .z = -0.2771639, .u = 0.472656, .v = 0.8691409999999999 },
{ .x = -0.1148051, .y = -0.025, .z = 0.2771638, .u = 0.916016, .v = 0.685547 },
{ .x = 0, .y = -0.025, .z = -0.05625, .u = 0.881836, .v = 0.27246099999999995 },
{ .x = 0.0397748, .y = -0.225, .z = -0.0397748, .u = 0.84668, .v = 0.43359400000000003 },
{ .x = 0, .y = -0.225, .z = -0.05625, .u = 0.881836, .v = 0.43359400000000003 },
{ .x = 0.0397748, .y = -0.025, .z = -0.0397748, .u = 0.75293, .v = 0.27246099999999995 },
{ .x = 0.05625, .y = -0.225, .z = 0, .u = 0.717773, .v = 0.43359400000000003 },
{ .x = 0.0397748, .y = -0.225, .z = -0.0397748, .u = 0.75293, .v = 0.43359400000000003 },
{ .x = 0.05625, .y = -0.025, .z = 0, .u = 0.709961, .v = 0.10351600000000005 },
{ .x = 0.0397748, .y = -0.225, .z = 0.0397748, .u = 0.674805, .v = 0.264648 },
{ .x = 0.05625, .y = -0.225, .z = 0, .u = 0.709961, .v = 0.264648 },
{ .x = 0.0397748, .y = -0.025, .z = 0.0397748, .u = 0.709961, .v = 0.27246099999999995 },
{ .x = 0, .y = -0.225, .z = 0.05625, .u = 0.674805, .v = 0.43359400000000003 },
{ .x = 0.0397748, .y = -0.225, .z = 0.0397748, .u = 0.709961, .v = 0.43359400000000003 },
{ .x = 0, .y = -0.025, .z = 0.05625, .u = 0.795898, .v = 0.27246099999999995 },
{ .x = -0.0397748, .y = -0.225, .z = 0.0397748, .u = 0.760742, .v = 0.43359400000000003 },
{ .x = 0, .y = -0.225, .z = 0.05625, .u = 0.795898, .v = 0.43359400000000003 },
{ .x = -0.0397748, .y = -0.025, .z = 0.0397748, .u = 0.445312, .v = 0.19140599999999997 },
{ .x = -0.05625, .y = -0.225, .z = 0, .u = 0.410156, .v = 0.35253900000000005 },
{ .x = -0.0397748, .y = -0.225, .z = 0.0397748, .u = 0.445312, .v = 0.35253900000000005 },
{ .x = -0.05625, .y = -0.025, .z = 0, .u = 0.838867, .v = 0.27246099999999995 },
{ .x = -0.0397748, .y = -0.225, .z = -0.0397748, .u = 0.803711, .v = 0.43359400000000003 },
{ .x = -0.05625, .y = -0.225, .z = 0, .u = 0.838867, .v = 0.43359400000000003 },
{ .x = -0.0397748, .y = -0.025, .z = -0.0397748, .u = 0.445312, .v = 0.360352 },
{ .x = 0, .y = -0.225, .z = -0.05625, .u = 0.410156, .v = 0.5214840000000001 },
{ .x = -0.0397748, .y = -0.225, .z = -0.0397748, .u = 0.445312, .v = 0.5214840000000001 },
{ .x = -0.1875, .y = -0.225, .z = 0.05625, .u = 0.028691, .v = 0.015013999999999972 },
{ .x = -0.1875, .y = -0.25, .z = -0.05625, .u = 0.048481, .v = 0.10509500000000005 },
{ .x = -0.1875, .y = -0.25, .z = 0.05625, .u = 0.048481, .v = 0.015013999999999972 },
{ .x = -0.05625, .y = -0.225, .z = 0.1875, .u = 0.801758, .v = 0.44140599999999997 },
{ .x = -0.05625, .y = -0.25, .z = 0.05625, .u = 0.822266, .v = 0.547852 },
{ .x = -0.05625, .y = -0.25, .z = 0.1875, .u = 0.822266, .v = 0.44140599999999997 },
{ .x = 0.1875, .y = -0.225, .z = -0.05625, .u = 0.057383, .v = 0.015013999999999972 },
{ .x = 0.1875, .y = -0.25, .z = 0.05625, .u = 0.077172, .v = 0.10509500000000005 },
{ .x = 0.1875, .y = -0.25, .z = -0.05625, .u = 0.077172, .v = 0.015013999999999972 },
{ .x = 0.05625, .y = -0.225, .z = 0.1875, .u = 0.114766, .v = 0.015013999999999972 },
{ .x = -0.05625, .y = -0.25, .z = 0.1875, .u = 0.134555, .v = 0.10509500000000005 },
{ .x = 0.05625, .y = -0.25, .z = 0.1875, .u = 0.134555, .v = 0.015013999999999972 },
{ .x = -0.05625, .y = -0.225, .z = -0.1875, .u = 0.086074, .v = 0.015013999999999972 },
{ .x = 0.05625, .y = -0.25, .z = -0.1875, .u = 0.105863, .v = 0.10509500000000005 },
{ .x = -0.05625, .y = -0.25, .z = -0.1875, .u = 0.105863, .v = 0.015013999999999972 },
{ .x = -0.05625, .y = -0.25, .z = -0.1875, .u = 0.879883, .v = 0.547852 },
{ .x = -0.05625, .y = -0.225, .z = -0.05625, .u = 0.858398, .v = 0.44140599999999997 },
{ .x = -0.05625, .y = -0.225, .z = -0.1875, .u = 0.858398, .v = 0.547852 },
{ .x = 0.1875, .y = -0.225, .z = -0.05625, .u = 0.830078, .v = 0.547852 },
{ .x = 0.05625, .y = -0.25, .z = -0.05625, .u = 0.850586, .v = 0.44140599999999997 },
{ .x = 0.05625, .y = -0.225, .z = -0.05625, .u = 0.830078, .v = 0.44140599999999997 },
{ .x = 0.1875, .y = -0.25, .z = 0.05625, .u = 0.9375, .v = 0.44140599999999997 },
{ .x = 0.05625, .y = -0.225, .z = 0.05625, .u = 0.916016, .v = 0.547852 },
{ .x = 0.05625, .y = -0.25, .z = 0.05625, .u = 0.9375, .v = 0.547852 },
{ .x = -0.1875, .y = -0.225, .z = -0.05625, .u = 0.945312, .v = 0.44140599999999997 },
{ .x = -0.05625, .y = -0.25, .z = -0.05625, .u = 0.96582, .v = 0.547852 },
{ .x = -0.1875, .y = -0.25, .z = -0.05625, .u = 0.96582, .v = 0.44140599999999997 },
{ .x = -0.1875, .y = -0.25, .z = 0.05625, .u = 0.020508, .v = 0.10449200000000003 },
{ .x = -0.05625, .y = -0.225, .z = 0.05625, .u = 0, .v = 0 },
{ .x = -0.1875, .y = -0.225, .z = 0.05625, .u = 0, .v = 0.10449200000000003 },
{ .x = 0.05625, .y = -0.25, .z = 0.1875, .u = 0.793945, .v = 0.547852 },
{ .x = 0.05625, .y = -0.225, .z = 0.05625, .u = 0.772461, .v = 0.44140599999999997 },
{ .x = 0.05625, .y = -0.225, .z = 0.1875, .u = 0.772461, .v = 0.547852 },
{ .x = 0.05625, .y = -0.225, .z = -0.1875, .u = 0.887695, .v = 0.44140599999999997 },
{ .x = 0.05625, .y = -0.25, .z = -0.05625, .u = 0.908203, .v = 0.547852 },
{ .x = 0.05625, .y = -0.25, .z = -0.1875, .u = 0.908203, .v = 0.44140599999999997 },
{ .x = -0.05625, .y = -0.225, .z = 0.05625, .u = 0.674805, .v = 0.547852 },
{ .x = -0.1875, .y = -0.225, .z = -0.05625, .u = 0.764648, .v = 0.44140599999999997 },
{ .x = -0.1875, .y = -0.225, .z = 0.05625, .u = 0.674805, .v = 0.44140599999999997 },
{ .x = 0.05625, .y = -0.225, .z = -0.05625, .u = 0.577148, .v = 0.44238299999999997 },
{ .x = -0.05625, .y = -0.225, .z = -0.1875, .u = 0.666487, .v = 0.547131 },
{ .x = -0.05625, .y = -0.225, .z = 0.1875, .u = 0.666992, .v = 0.24609400000000003 },
{ .x = 0.1875, .y = -0.225, .z = 0.05625, .u = 0.472656, .v = 0.35156200000000004 },
{ .x = 0.1875, .y = -0.225, .z = -0.05625, .u = 0.472656, .v = 0.44238299999999997 },
{ .x = 0.12156990000000001, .y = 0.0176777, .z = -0.29349590000000003, .u = 0.853516, .v = 0.265625 },
{ .x = 0.1052379, .y = 0, .z = -0.2540669, .u = 0.411133, .v = 0.009766000000000052 },
{ .x = 0.12156990000000001, .y = -0.0176777, .z = -0.29349590000000003, .u = 0.952148, .v = 0.43359400000000003 },
{ .x = 0.12437210000000001, .y = 0, .z = -0.30026090000000005, .u = 0.936523, .v = 1 },
{ .x = -0.12157000000000001, .y = 0.0176777, .z = -0.29349590000000003, .u = 0.489258, .v = 0.23828099999999997 },
{ .x = -0.1080401, .y = 0.0176777, .z = -0.2608318, .u = 0.984375, .v = 0.592773 },
{ .x = -0.114805, .y = -0.025, .z = -0.2771638, .u = 0.914062, .v = 0.22558599999999995 },
{ .x = -0.12437210000000001, .y = 0, .z = -0.3002608, .u = 0.920898, .v = 0.592773 },
{ .x = -0.30026090000000005, .y = 0, .z = -0.124372, .u = 0.914062, .v = 0.43359400000000003 },
{ .x = -0.2540669, .y = 0, .z = -0.1052379, .u = 0.944336, .v = 0.592773 },
{ .x = -0.29349590000000003, .y = -0.0176777, .z = -0.12156990000000001, .u = 0.630859, .v = 0.23828099999999997 },
{ .x = -0.30026090000000005, .y = 0, .z = -0.124372, .u = 0.876953, .v = 0.264648 },
{ .x = -0.3002608, .y = 0, .z = 0.12437210000000001, .u = 0.544922, .v = 0.23828099999999997 },
{ .x = -0.2608318, .y = 0.0176777, .z = 0.1080401, .u = 0.967773, .v = 1 },
{ .x = -0.29349590000000003, .y = -0.0176777, .z = 0.12157000000000001, .u = 0.953125, .v = 0.22949200000000003 },
{ .x = -0.3002608, .y = 0, .z = 0.12437210000000001, .u = 0.512695, .v = 0.23828099999999997 },
{ .x = -0.12157000000000001, .y = 0.0176777, .z = 0.29349590000000003, .u = 0.790039, .v = 0.06445299999999998 },
{ .x = -0.1080401, .y = 0.0176777, .z = 0.2608318, .u = 0.43457, .v = 0.18261700000000003 },
{ .x = -0.12157000000000001, .y = -0.0176777, .z = 0.29349590000000003, .u = 0.959961, .v = 1 },
{ .x = -0.1243722, .y = 0, .z = 0.3002608, .u = 0.829102, .v = 0.264648 },
{ .x = 0.12157000000000001, .y = 0.0176777, .z = 0.29349590000000003, .u = 0.742188, .v = 0.06445299999999998 },
{ .x = 0.10523800000000001, .y = 0, .z = 0.2540669, .u = 0.976562, .v = 0.251953 },
{ .x = 0.1148051, .y = -0.025, .z = 0.2771638, .u = 0.638672, .v = 0.23828099999999997 },
{ .x = 0.1243722, .y = 0, .z = 0.3002608, .u = 0.78125, .v = 0.264648 },
{ .x = 0.3002608, .y = 0, .z = 0.1243722, .u = 0.520508, .v = 0.23828099999999997 },
{ .x = 0.25406680000000004, .y = 0, .z = 0.1052381, .u = 0.984375, .v = 0.25976600000000005 },
{ .x = 0.29349580000000003, .y = -0.0176777, .z = 0.1215701, .u = 0.905273, .v = 0.22558599999999995 },
{ .x = 0.3002608, .y = 0, .z = 0.1243722, .u = 0.583984, .v = 0.23828099999999997 },
{ .x = 0.29349590000000003, .y = 0.0176777, .z = -0.12157000000000001, .u = 0.90625, .v = 0.43457 },
{ .x = 0.2608318, .y = 0.0176777, .z = -0.1080401, .u = 0.976562, .v = 0.25976600000000005 },
{ .x = 0.2771638, .y = -0.025, .z = -0.1148051, .u = 0.592773, .v = 0.23828099999999997 },
{ .x = 0.3002608, .y = 0, .z = -0.12437210000000001, .u = 0.717773, .v = 0.06445299999999998 },
{ .x = -0.2608319, .y = 0.0176777, .z = -0.10804000000000001, .u = 0.146484, .v = 0.5566409999999999 },
{ .x = 0.2608318, .y = 0.0176777, .z = -0.1080401, .u = 0.438477, .v = 0.851562 },
{ .x = 0.2540669, .y = 0, .z = -0.10523800000000001, .u = 0.119141, .v = 0.520508 },
{ .x = 0.25406680000000004, .y = 0, .z = 0.1052381, .u = 0.283203, .v = 0.520508 },
{ .x = 0.10523800000000001, .y = 0, .z = 0.2540669, .u = 0.402344, .v = 0.40136700000000003 },
{ .x = -0.2540669, .y = 0, .z = 0.1052379, .u = 0.283203, .v = 0.11425799999999997 },
{ .x = -0.1052379, .y = 0, .z = -0.2540669, .u = 0, .v = 0.233398 },
{ .x = 0.2771638, .y = -0.025, .z = -0.1148051, .u = 0.602539, .v = 0.999023 },
{ .x = 0.2771638, .y = -0.025, .z = 0.11480520000000001, .u = 0.786133, .v = 0.999023 },
{ .x = 0.1148051, .y = -0.025, .z = 0.2771638, .u = 0.916016, .v = 0.8691409999999999 },
{ .x = -0.2771638, .y = -0.025, .z = 0.114805, .u = 0.786133, .v = 0.5556639999999999 },
{ .x = -0.2771639, .y = -0.025, .z = -0.11480490000000002, .u = 0.602539, .v = 0.5556639999999999 },
{ .x = 0.0397748, .y = -0.025, .z = -0.0397748, .u = 0.84668, .v = 0.27246099999999995 },
{ .x = 0.05625, .y = -0.025, .z = 0, .u = 0.717773, .v = 0.27246099999999995 },
{ .x = 0.0397748, .y = -0.025, .z = 0.0397748, .u = 0.674805, .v = 0.10351600000000005 },
{ .x = 0, .y = -0.025, .z = 0.05625, .u = 0.674805, .v = 0.27246099999999995 },
{ .x = -0.0397748, .y = -0.025, .z = 0.0397748, .u = 0.760742, .v = 0.27246099999999995 },
{ .x = -0.05625, .y = -0.025, .z = 0, .u = 0.410156, .v = 0.19140599999999997 },
{ .x = -0.0397748, .y = -0.025, .z = -0.0397748, .u = 0.803711, .v = 0.27246099999999995 },
{ .x = 0, .y = -0.025, .z = -0.05625, .u = 0.410156, .v = 0.360352 },
{ .x = -0.1875, .y = -0.225, .z = -0.05625, .u = 0.028691, .v = 0.10509500000000005 },
{ .x = -0.05625, .y = -0.225, .z = 0.05625, .u = 0.801758, .v = 0.547852 },
{ .x = 0.1875, .y = -0.225, .z = 0.05625, .u = 0.057383, .v = 0.10509500000000005 },
{ .x = -0.05625, .y = -0.225, .z = 0.1875, .u = 0.114766, .v = 0.10509500000000005 },
{ .x = 0.05625, .y = -0.225, .z = -0.1875, .u = 0.086074, .v = 0.10509500000000005 },
{ .x = -0.05625, .y = -0.25, .z = -0.05625, .u = 0.879883, .v = 0.44140599999999997 },
{ .x = 0.1875, .y = -0.25, .z = -0.05625, .u = 0.850586, .v = 0.547852 },
{ .x = 0.1875, .y = -0.225, .z = 0.05625, .u = 0.916016, .v = 0.44140599999999997 },
{ .x = -0.05625, .y = -0.225, .z = -0.05625, .u = 0.945312, .v = 0.547852 },
{ .x = -0.05625, .y = -0.25, .z = 0.05625, .u = 0.020508, .v = 0 },
{ .x = 0.05625, .y = -0.25, .z = 0.05625, .u = 0.793945, .v = 0.44140599999999997 },
{ .x = 0.05625, .y = -0.225, .z = -0.05625, .u = 0.887695, .v = 0.547852 },
{ .x = -0.05625, .y = -0.225, .z = -0.05625, .u = 0.764648, .v = 0.547852 },
{ .x = 0.05625, .y = -0.225, .z = 0.1875, .u = 0.577148, .v = 0.24609400000000003 },
{ .x = 0.05625, .y = -0.225, .z = 0.05625, .u = 0.577148, .v = 0.35156200000000004 },
{ .x = 0.05625, .y = -0.225, .z = -0.1875, .u = 0.577436, .v = 0.547131 }
};
indice_t indices[POKER_TABLE_INDICE_COUNT] = {
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
75,
99,
100,
101,
102,
99,
102,
103,
104,
103,
105,
104,
106,
107,
105,
107,
108,
109,
77,
109,
108,
110,
111,
112,
113,
114,
115,
116,
117,
118,
119,
120,
121,
122,
123,
124,
125,
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
147,
148,
149,
150,
151,
152,
153,
154,
155,
156,
157,
158,
159,
160,
161,
162,
163,
164,
165,
166,
167,
168,
169,
170,
171,
172,
173,
174,
175,
176,
177,
178,
179,
180,
181,
179,
182,
183,
0,
184,
1,
3,
185,
4,
6,
186,
7,
9,
187,
10,
12,
188,
13,
15,
189,
16,
18,
190,
19,
21,
191,
22,
24,
192,
25,
27,
193,
28,
30,
194,
31,
33,
195,
34,
36,
196,
37,
39,
197,
40,
42,
198,
43,
45,
199,
46,
48,
200,
49,
51,
201,
52,
54,
202,
55,
57,
203,
58,
60,
204,
61,
63,
205,
64,
66,
206,
67,
69,
207,
70,
72,
208,
73,
75,
100,
76,
78,
209,
79,
81,
210,
82,
84,
211,
85,
87,
212,
88,
90,
213,
91,
93,
214,
94,
96,
215,
97,
75,
101,
99,
101,
216,
102,
102,
216,
103,
103,
106,
105,
106,
217,
107,
107,
217,
108,
77,
76,
109,
112,
218,
110,
218,
219,
110,
219,
220,
110,
110,
221,
111,
111,
222,
112,
114,
223,
224,
224,
225,
114,
225,
115,
114,
115,
226,
227,
227,
113,
115,
116,
228,
117,
119,
229,
120,
122,
230,
123,
125,
231,
126,
128,
232,
129,
131,
233,
132,
134,
234,
135,
137,
235,
138,
140,
236,
141,
143,
237,
144,
146,
238,
147,
149,
239,
150,
152,
240,
153,
155,
241,
156,
158,
242,
159,
161,
243,
162,
164,
244,
165,
167,
245,
168,
170,
246,
171,
173,
247,
174,
176,
248,
177,
181,
249,
250,
179,
251,
180,
181,
250,
179,
179,
250,
182
};
primitive_t *primitive = primitiveCreate(
POKER_TABLE_VERTICE_COUNT,
POKER_TABLE_INDICE_COUNT
);
primitiveBufferVertices(primitive, 0, POKER_TABLE_VERTICE_COUNT, vertices);
primitiveBufferIndices(primitive, 0, POKER_TABLE_INDICE_COUNT, indices);
return primitive;
}

View 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_TABLE_NAME "Poker Table"
#define POKER_TABLE_VERTICE_COUNT 252
#define POKER_TABLE_INDICE_COUNT 420
#define POKER_TABLE_TRIANGLE_COUNT 140
/**
* Generated Model Poker Table
* Generated at Sun, 09 May 2021 21:15:45 GMT
* @returns Poker Table as a primitive.
*/
primitive_t * pokerTableCreate();

94
src/poker/render/card.c Normal file
View File

@ -0,0 +1,94 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "card.h"
void holdemRenderCardInit() {
tilesetdiv_t *cardBack;
// Load Cards Texture
HOLDEM_GAME_STATE.cardTexture = assetTextureLoad("cards_normal.png");
HOLDEM_GAME_STATE.cardTileset = tilesetCreate(CARD_COUNT_PER_SUIT, 6,
HOLDEM_GAME_STATE.cardTexture->width, HOLDEM_GAME_STATE.cardTexture->height,
0, 0, 0, 0
);
// Cards Primitive
cardBack = HOLDEM_GAME_STATE.cardTileset->divisions+(
HOLDEM_GAME_STATE.cardTileset->columns * 4
);
HOLDEM_GAME_STATE.cardPrimitive = primitiveCreate(
QUAD_VERTICE_COUNT * 2, QUAD_INDICE_COUNT * 2
);
quadBuffer(HOLDEM_GAME_STATE.cardPrimitive, -HOLDEM_GAME_CARD_DEPTH,
-HOLDEM_GAME_CARD_WIDTH, -HOLDEM_GAME_CARD_HEIGHT,
cardBack->x0, cardBack->y1,
HOLDEM_GAME_CARD_WIDTH, HOLDEM_GAME_CARD_HEIGHT,
cardBack->x1, cardBack->y0,
QUAD_VERTICE_COUNT, QUAD_INDICE_COUNT
);
}
holdemrenderposition_t holdemRenderCardGetPosition(uint8_t seat, uint8_t slot) {
holdemrenderposition_t position;
float t, t2;
position.yaw = HOLDEM_GAME_SEAT_ANGLE(seat);
position.x = sin(position.yaw) * -0.75;
position.z = cos(position.yaw) * -0.75;
t = position.yaw + mathDeg2Rad(90);
switch (slot) {
case HOLDEM_GAME_CARD_SLOT_HAND0:
case HOLDEM_GAME_CARD_SLOT_HAND1:
t2 = HOLDEM_GAME_CARD_WIDTH+HOLDEM_GAME_CARD_PADDING;
if(slot == HOLDEM_GAME_CARD_SLOT_HAND0) t2 = -t2;
break;
case HOLDEM_GAME_CARD_SLOT_FLOP0:
case HOLDEM_GAME_CARD_SLOT_FLOP1:
case HOLDEM_GAME_CARD_SLOT_FLOP2:
case HOLDEM_GAME_CARD_SLOT_FLOP3:
case HOLDEM_GAME_CARD_SLOT_FLOP4:
t2 = HOLDEM_GAME_CARD_WIDTH*2+HOLDEM_GAME_CARD_PADDING;
t2 = (
-t2 * ( HOLDEM_GAME_CARD_SLOT_FLOP4-HOLDEM_GAME_CARD_SLOT_FLOP0)
)/2 + t2*(slot-HOLDEM_GAME_CARD_SLOT_FLOP0);
break;
default:
break;
}
position.x += t2 * sin(t);
position.z += t2 * cos(t);
return position;
}
void holdemRenderCard(card_t card, float x, float y, float z,
float pitch, float yaw, float roll
) {
tilesetdiv_t *cardFront = HOLDEM_GAME_STATE.cardTileset->divisions + card;
quadBuffer(HOLDEM_GAME_STATE.cardPrimitive, HOLDEM_GAME_CARD_DEPTH,
-HOLDEM_GAME_CARD_WIDTH, -HOLDEM_GAME_CARD_HEIGHT,
cardFront->x0, cardFront->y1,
HOLDEM_GAME_CARD_WIDTH, HOLDEM_GAME_CARD_HEIGHT,
cardFront->x1, cardFront->y0,
0, 0
);
shaderUseTexture(GAME_STATE.shaderWorld, HOLDEM_GAME_STATE.cardTexture);
shaderUsePosition(GAME_STATE.shaderWorld, x,y,z, pitch,yaw,roll);
primitiveDraw(HOLDEM_GAME_STATE.cardPrimitive, 0, -1);
}
void holdemRenderCardForSeat(uint8_t seat, card_t card, uint8_t slot) {
holdemrenderposition_t position = holdemRenderCardGetPosition(seat, slot);
holdemRenderCard(card, position.x, 0, position.z, mathDeg2Rad(-90), position.yaw, 0);
}

53
src/poker/render/card.h Normal file
View File

@ -0,0 +1,53 @@
/**
* 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 "../../file/asset.h"
#include "../../display/shader.h"
#include "../../display/primitive.h"
#include "../../display/primitives/quad.h"
#include "../../display/tileset.h"
/**
* Initializes the Card Renderer.
*/
void holdemRenderCardInit();
/**
* Returns the position a card "naturally" sits at for a given seat and slot.
*
* @param seat Seat that the card belongs to
* @param slot Slot within the player/dealers' hand that the card belongs to.
* @return A struct containing X, Z and YAW properties.
*/
holdemrenderposition_t holdemRenderCardGetPosition(uint8_t seat, uint8_t slot);
/**
* Render's a given card at the specified coordinates. Card is a reused quad
* and is re-buffered to for every draw call.
*
* @param card Card to render.
* @param x X Position (world space).
* @param y Y Position (world space).
* @param z Z Position (world space).
* @param pitch Pitch angle.
* @param yaw Yaw angle.
* @param roll Roll angle.
*/
void holdemRenderCard(card_t card, float x, float y, float z,
float pitch, float yaw, float roll
);
/**
* Render's a card at a given seat and slot.
*
* @param seat Seat the card is for.
* @param card Card to render.
* @param slot Slot the card is for.
*/
void holdemRenderCardForSeat(uint8_t seat, card_t card, uint8_t slot);

93
src/poker/render/frame.c Normal file
View File

@ -0,0 +1,93 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "frame.h"
void holdemRenderFrameInit() {
int32_t lWidth, rWidth, height;
// Prepare the two frame buffers.
lWidth = HOLDEM_GAME_FRAME_LEFT_WIDTH, rWidth = HOLDEM_GAME_FRAME_RIGHT_WIDTH;
height = HOLDEM_GAME_FRAME_HEIGHT;
HOLDEM_GAME_STATE.frameLeft = frameBufferCreate(lWidth, height);
HOLDEM_GAME_STATE.frameRight = frameBufferCreate(rWidth, height);
HOLDEM_GAME_STATE.quadLeft = quadCreate(0, 0, 0, 0, 0, lWidth, height, 1, 1);
HOLDEM_GAME_STATE.quadRight = quadCreate(0, 0, 0, 0, 0, rWidth, height, 1, 1);
}
void holdemRenderFrameUpdate() {
int32_t lWidth, rWidth, height;
lWidth = HOLDEM_GAME_FRAME_LEFT_WIDTH, rWidth = HOLDEM_GAME_FRAME_RIGHT_WIDTH;
height = HOLDEM_GAME_FRAME_HEIGHT;
if((
HOLDEM_GAME_STATE.frameLeft->texture->width == lWidth &&
HOLDEM_GAME_STATE.frameLeft->texture->height == height
)) return;
// Recreate frame buffers.
frameBufferDispose(HOLDEM_GAME_STATE.frameLeft);
frameBufferDispose(HOLDEM_GAME_STATE.frameRight);
HOLDEM_GAME_STATE.frameLeft = frameBufferCreate(lWidth, height);
HOLDEM_GAME_STATE.frameRight = frameBufferCreate(rWidth, height);
quadBuffer(HOLDEM_GAME_STATE.quadLeft, 0,
0, 0, 0, 1,
lWidth, height, 1, 0,
0, 0
);
quadBuffer(HOLDEM_GAME_STATE.quadRight, 0,
0, 0, 0, 1,
rWidth, height, 1, 0,
0, 0
);
}
void holdemRenderFrameUseLeft() {
glClearColor(0.3, 0, 0, 1);
frameBufferUse(HOLDEM_GAME_STATE.frameLeft, true);
cameraPerspective(&HOLDEM_GAME_STATE.cameraLeft, 35,
(
(float)HOLDEM_GAME_STATE.frameLeft->texture->width /
(float)HOLDEM_GAME_STATE.frameLeft->texture->height
), 0.2f, 1000.0f
);
shaderUseCamera(GAME_STATE.shaderWorld, &HOLDEM_GAME_STATE.cameraLeft);
}
void holdemRenderFrameUseRight() {
glClearColor(0.3, 0.3, 0, 1);
frameBufferUse(HOLDEM_GAME_STATE.frameRight, true);
cameraPerspective(&HOLDEM_GAME_STATE.cameraRight, 45,
(
(float)HOLDEM_GAME_STATE.frameRight->texture->width /
(float)HOLDEM_GAME_STATE.frameRight->texture->height
), 0.2f, 1000.0f
);
cameraLookAt(&HOLDEM_GAME_STATE.cameraRight, 0, 3, 3, 0, 0, 0);
shaderUseCamera(GAME_STATE.shaderWorld, &HOLDEM_GAME_STATE.cameraRight);
}
void holdemRenderFrameBack() {
glClearColor(0, 0, 0, 1);
frameBufferUse(NULL, true);
cameraOrtho(&GAME_STATE.cameraWorld, 0,
RENDER_STATE.width, RENDER_STATE.height, 1, 0, 1
);
cameraLookAt(&GAME_STATE.cameraWorld, 0, 0, 0.5f, 0, 0, 0);
shaderUseCamera(GAME_STATE.shaderWorld, &GAME_STATE.cameraWorld);
shaderUsePosition(GAME_STATE.shaderWorld,
0, 0, 0, 0, 0, 0
);
shaderUseTexture(GAME_STATE.shaderWorld, HOLDEM_GAME_STATE.frameLeft->texture);
primitiveDraw(HOLDEM_GAME_STATE.quadLeft, 0, -1);
shaderUsePosition(GAME_STATE.shaderWorld,
RENDER_STATE.width - HOLDEM_GAME_STATE.frameRight->texture->width,
0, 0, 0, 0, 0
);
shaderUseTexture(GAME_STATE.shaderWorld, HOLDEM_GAME_STATE.frameRight->texture);
primitiveDraw(HOLDEM_GAME_STATE.quadRight, 0, -1);
}

41
src/poker/render/frame.h Normal file
View File

@ -0,0 +1,41 @@
/**
* 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/shader.h"
#include "../../display/primitive.h"
#include "../../display/primitives/quad.h"
#include "../../display/framebuffer.h"
#include "../../display/camera.h"
/**
* Initializes the frame buffers to be rendered to later.
*/
void holdemRenderFrameInit();
/**
* Update the frame buffers at the start of a rendering cycle.
*/
void holdemRenderFrameUpdate();
/**
* Binds the left frame buffer, clears it, and corrects its camera's
* perspective.
*/
void holdemRenderFrameUseLeft();
/**
* Binds the right frame buffer, clears it, and corrects its camera's
* perspective.
*/
void holdemRenderFrameUseRight();
/**
* Renders both the left and right frames to the backbuffer.
*/
void holdemRenderFrameBack();

30
src/poker/render/look.c Normal file
View File

@ -0,0 +1,30 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "look.h"
void holdemRenderLookSeat(camera_t *camera, uint8_t seat) {
float x, z, angle;
angle = HOLDEM_GAME_SEAT_ANGLE(seat);
x = sin(angle);
z = cos(angle);
cameraLookAt(&HOLDEM_GAME_STATE.cameraLeft,
x, 0.2, z,
-x, 0.2, -z
);
}
void holdemRenderLookHand(camera_t *camera, uint8_t seat) {
float x, z, angle;
angle = HOLDEM_GAME_SEAT_ANGLE(seat);
x = sin(angle);
z = cos(angle);
cameraLookAt(&HOLDEM_GAME_STATE.cameraLeft,
x*0.1, 0.8, z*0.1,
-x*0.5, 0.2, -z*0.5
);
}

25
src/poker/render/look.h Normal file
View File

@ -0,0 +1,25 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include <dawn/dawn.h>
#include "../../display/camera.h"
/**
* Look at a specific seat
*
* @param camera Camera to adjust.
* @param seat Seat to look at.
*/
void holdemRenderLookSeat(camera_t *camera, uint8_t seat);
/**
* Look at a specific seats hand.
*
* @param camera Camera to adjust.
* @param seat Seats hand to look at.
*/
void holdemRenderLookHand(camera_t *camera, uint8_t seat);

69
src/poker/render/player.c Normal file
View File

@ -0,0 +1,69 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "player.h"
void holdemRenderPlayerInit() {
HOLDEM_GAME_STATE.kagamiTexture = assetTextureLoad("kagami.png");
HOLDEM_GAME_STATE.kagamiTileset = tilesetCreate(3, 2,
HOLDEM_GAME_STATE.kagamiTexture->width,
HOLDEM_GAME_STATE.kagamiTexture->height,
0, 0, 0, 0
);
HOLDEM_GAME_STATE.kagamiQuad = quadCreate(0, 0, 0, 0, 0, 1, 1, 1, 1);
}
uint8_t holdemRenderPlayerGetSeatForPlayer(uint8_t player) {
switch(player) {
case 0x01:
return HOLDEM_GAME_SEAT_PLAYER1;
case 0x02:
return HOLDEM_GAME_SEAT_PLAYER2;
case 0x03:
return HOLDEM_GAME_SEAT_PLAYER3;
case 0x04:
return HOLDEM_GAME_SEAT_PLAYER4;
default:
return HOLDEM_GAME_SEAT_PLAYER0;
}
}
void holdemRenderPlayer(uint8_t seat) {
float x, z, angle;
// Determine position
angle = HOLDEM_GAME_SEAT_ANGLE(seat);
x = sin(angle) * -1;
z = cos(angle) * -1;
// Determine size
float w, h;
w = 0.6, h = (
(float)HOLDEM_GAME_STATE.kagamiTileset->divY /
(float)HOLDEM_GAME_STATE.kagamiTileset->divX
) * w;
// Animation
int i = (int32_t)(TIME_STATE.current*10)%HOLDEM_GAME_STATE.kagamiTileset->count;
quadBuffer(HOLDEM_GAME_STATE.kagamiQuad, 0,
-w/2, -h/2,
HOLDEM_GAME_STATE.kagamiTileset->divisions[i].x0,
HOLDEM_GAME_STATE.kagamiTileset->divisions[i].y1,
w/2, h/2,
HOLDEM_GAME_STATE.kagamiTileset->divisions[i].x1,
HOLDEM_GAME_STATE.kagamiTileset->divisions[i].y0,
0, 0
);
// Render
shaderUseTexture(GAME_STATE.shaderWorld, HOLDEM_GAME_STATE.kagamiTexture);
shaderUsePosition(GAME_STATE.shaderWorld,
x, 0.34, z,
0, angle, 0
);
primitiveDraw(HOLDEM_GAME_STATE.kagamiQuad, 0, -1);
}

34
src/poker/render/player.h Normal file
View File

@ -0,0 +1,34 @@
/**
* 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 "../../file/asset.h"
#include "../../display/shader.h"
#include "../../display/primitive.h"
#include "../../display/tileset.h"
#include "../../display/primitives/quad.h"
/**
* Initializes the player renderer.
*/
void holdemRenderPlayerInit();
/**
* Returns the seat index for a given player.
*
* @param player Player to get the seat for.
* @return Seat ID for the given player.
*/
uint8_t holdemRenderPlayerGetSeatForPlayer(uint8_t player);
/**
* Render's a player at a seat.
*
* @param seat Seat to render the player at.
*/
void holdemRenderPlayer(uint8_t seat);

24
src/poker/render/scene.c Normal file
View File

@ -0,0 +1,24 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "scene.h"
void holdemRenderSceneInit() {
HOLDEM_GAME_STATE.tablePrimitive = pokerTableCreate();
HOLDEM_GAME_STATE.tableTexture = assetTextureLoad("pokertable.png");
}
void holdemRenderScene() {
// Poker Table
shaderUsePositionAndScale(GAME_STATE.shaderWorld,
0, -0.01, 0,
0, 0, 0,
3.4, 3.4, 3.4
);
shaderUseTexture(GAME_STATE.shaderWorld, HOLDEM_GAME_STATE.tableTexture);
primitiveDraw(HOLDEM_GAME_STATE.tablePrimitive, 0, -1);
}

23
src/poker/render/scene.h Normal file
View 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 "../../display/shader.h"
#include "../../display/primitive.h"
#include "../../file/asset.h"
#include "../model/pokertable.h"
/**
* Initializes the scene renderer.
*/
void holdemRenderSceneInit();
/**
* Renders the scene for the holdem game (including table, chairs, etc.)
*/
void holdemRenderScene();

39
src/poker/render/world.c Normal file
View File

@ -0,0 +1,39 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "world.h"
void holdemRenderWorld() {
uint8_t i, j;
holdemplayer_t *player;
uint8_t seat;
holdemRenderScene();
// Render the dealer and her hand
holdemRenderPlayer(HOLDEM_GAME_SEAT_DEALER);
for(i = 0x00; i < HOLDEM_GAME_STATE.cardsFacing; i++) {
holdemRenderCardForSeat(
HOLDEM_GAME_SEAT_DEALER,
HOLDEM_GAME_STATE.cards[i],
HOLDEM_GAME_CARD_SLOT_FLOP0 + i
);
}
// Test
for(i = 0x00; i < HOLDEM_PLAYER_COUNT; i++) {
player = HOLDEM_GAME_STATE.players + i;
seat = holdemRenderPlayerGetSeatForPlayer(i);
holdemRenderPlayer(seat);
if(player->state & HOLDEM_STATE_FOLDED) continue;
for(j = 0x00; j < player->cardCount; j++) {
holdemRenderCardForSeat(seat, player->cards[j], HOLDEM_GAME_CARD_SLOT_HAND0+j);
}
}
}

17
src/poker/render/world.h Normal file
View File

@ -0,0 +1,17 @@
/**
* 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 "player.h"
#include "scene.h"
#include "card.h"
/**
* Renders the world.
*/
void holdemRenderWorld();