Added True Type fonts

This commit is contained in:
2021-05-23 10:53:00 -07:00
parent 98814982de
commit b0dce455f0
26 changed files with 575 additions and 167 deletions

View File

@ -8,8 +8,6 @@
#include "poker.h"
void pokerInit(poker_t *poker) {
uint8_t x;
// Load the main shader
assetShaderLoad(&poker->shader,
"shaders/textured.vert", "shaders/textured.frag"
@ -20,28 +18,22 @@ void pokerInit(poker_t *poker) {
pokerCardInit(poker);
pokerPlayerInit(poker);
// Reset the main game state. This does not init the round.
poker->blindBig = POKER_BLIND_BIG_DEFAULT;
poker->blindSmall = POKER_BLIND_SMALL_DEFAULT;
poker->roundDealer = 0x00;
for(x = 0; x < POKER_PLAYER_COUNT; x++) {
poker->players[x].state = 0x00;
poker->players[x].chips = POKER_PLAYER_CHIPS_DEFAULT;
}
// Hand over to the deal for the first time.
pokerDealInit(poker);
pokerMatchInit(poker);
}
void pokerUpdate(poker_t *poker, render_t *render) {
// Game Logic
// TEMP
switch(poker->round) {
case POKER_ROUND_MATCH:
pokerMatchUpdate(poker);
break;
default:
break;
}
// Rendering
cameraPerspective(&poker->camera, 20,render->width/render->height,0.001,1000);
pokerLookAtPlayer(&poker->camera, pokerPlayerGetSeatForPlayer(0x00));
// Render Logic
shaderUse(&poker->shader);
shaderUseCamera(&poker->shader, &poker->camera);

View File

@ -7,14 +7,13 @@
#pragma once
#include <dawn/dawn.h>
#include "round/deal.h"
#include "round/match.h"
#include "render/world.h"
#include "render/card.h"
#include "render/player.h"
#include "render/look.h"
#include "../file/asset.h"
#include "../display/shader.h"
#include "../display/camera.h"
/**

13
src/poker/round/blinds.c Normal file
View File

@ -0,0 +1,13 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "blinds.h"
void pokerBlindsInit(poker_t *poker) {
poker->round = POKER_ROUND_BLINDS;
}

14
src/poker/round/blinds.h Normal file
View File

@ -0,0 +1,14 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include <dawn/dawn.h>
/**
* Initializes the blinds round.
* @param poker The poker game conetxt.
*/
void pokerBlindsInit(poker_t *poker);

View File

@ -32,6 +32,7 @@ void pokerDealInit(poker_t *poker) {
}
// Hard look at the dealer
pokerLookAtPlayer(&poker->camera, POKER_SEAT_DEALER);
// Shuffle the deck
for(x = 0; x < CARD_DECK_SIZE - 1; x++) {

View File

@ -7,6 +7,8 @@
#pragma once
#include <dawn/dawn.h>
#include "blinds.h"
#include "../render/look.h"
/**
* Resets a poker game for the new round.

24
src/poker/round/match.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 "match.h"
void pokerMatchInit(poker_t *poker) {
uint8_t x;
// Reset the main game state. This does not init the round.
poker->blindBig = POKER_BLIND_BIG_DEFAULT;
poker->blindSmall = POKER_BLIND_SMALL_DEFAULT;
poker->roundDealer = 0x00;
for(x = 0; x < POKER_PLAYER_COUNT; x++) {
poker->players[x].state = 0x00;
poker->players[x].chips = POKER_PLAYER_CHIPS_DEFAULT;
}
}
void pokerMatchUpdate(poker_t *poker) {
}

22
src/poker/round/match.h Normal file
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 "deal.h"
/**
* Init the poker match round.
* @param poker The poker game context.
*/
void pokerMatchInit(poker_t *poker);
/**
* Update the poker match round.
* @param poker The poker match to update for.
*/
void pokerMatchUpdate(poker_t *poker);