Dawn/src/game/poker/pokergame.c

64 lines
1.9 KiB
C

/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "pokergame.h"
label_t label;
bool pokerGameInit(game_t *game) {
pokergame_t *pokerGame = &game->pokerGame;
// Init the game
game->name = POKER_GAME_NAME;
// Load the Assets
pokerGameAssetsInit(&pokerGame->assets);
// Prep the VN Conversation Engine.
vnSceneInit(&pokerGame->scene, &pokerGame->assets.font);
pokerGameActionStartAdd(pokerGame);
labelInit(&label);
label.y = 32;
label.fontSize = 8.0;
labelSetText(&label, &pokerGame->assets.font, "Hello World");
// pokerActionMatchAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// pokerActionMatchAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// pokerActionRoundAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// pokerActionBlindsAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// pokerActionDealAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// vnConversationTalk(&pokerGame->scene.conversation, "Betting Round", NULL);
// pokerActionFlopAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// Begin the VN conversation queue.
queueNext(&pokerGame->scene.conversation.actionQueue);
return true;
}
void pokerGameUpdate(game_t *game) {
pokergame_t *pokerGame;
pokerGame = &game->pokerGame;
// Update the scene
vnSceneUpdate(&pokerGame->scene, &game->engine);
// Bind the shader.
shaderUse(&pokerGame->assets.shader);
// Render the visual novel scene
vnSceneRenderWorld(&pokerGame->scene, &game->engine, &pokerGame->assets.shader);
vnSceneRenderGui(&pokerGame->scene, &game->engine, &pokerGame->assets.shader);
labelRender(&label, &pokerGame->assets.shader);
}
void pokerGameDispose(game_t *game) {
vnSceneDispose(&game->pokerGame.scene);
pokerGameAssetsDispose(&game->pokerGame.assets);
}