Refactoring structs Part 1
This commit is contained in:
@ -5,72 +5,22 @@
|
||||
|
||||
#pragma once
|
||||
#include "../libs.h"
|
||||
#include "../display/shader.h"
|
||||
#include "../display/camera.h"
|
||||
#include "../poker/card.h"
|
||||
#include "../poker/player.h"
|
||||
#include "../poker/render.h"
|
||||
#include "../poker/action.h"
|
||||
#include "../display/render.h"
|
||||
#include "../display/spritebatch.h"
|
||||
#include "../display/texture.h"
|
||||
#include "../display/tileset.h"
|
||||
#include "../display/framebuffer.h"
|
||||
#include "../engine/engine.h"
|
||||
#include "../poker/poker.h"
|
||||
|
||||
/** Name of the current game */
|
||||
#define GAME_NAME "Dawn"
|
||||
|
||||
|
||||
/** Describes the current game */
|
||||
typedef struct {
|
||||
char *name;
|
||||
|
||||
/** Current Card Deck */
|
||||
card_t deck[CARD_DECK_SIZE];
|
||||
uint8_t deckSize;
|
||||
|
||||
/** Dealer Money */
|
||||
uint32_t blindSmall;
|
||||
uint32_t blindBig;
|
||||
uint32_t pot;
|
||||
/** Engine for the game */
|
||||
engine_t engine;
|
||||
|
||||
/** Dealer Hand */
|
||||
card_t cards[HOLDEM_DEALER_HAND];
|
||||
uint8_t cardsFacing;
|
||||
|
||||
/** Player States */
|
||||
pokerplayer_t players[POKER_PLAYER_COUNT];
|
||||
|
||||
/** Action Queue */
|
||||
pokeraction_t actionQueue[POKER_ACTION_QUEUE_SIZE];
|
||||
void *actionData[POKER_ACTION_DATA_SIZE*POKER_ACTION_QUEUE_SIZE];
|
||||
bool actionInitState[POKER_ACTION_DATA_SIZE];
|
||||
|
||||
/** Rendering Assets */
|
||||
texture_t *kagamiTexture;
|
||||
tileset_t *kagamiTileset;
|
||||
primitive_t *kagamiQuad;
|
||||
|
||||
primitive_t *chipPrimitive;
|
||||
texture_t *chipTexture;
|
||||
primitive_t *tablePrimitive;
|
||||
texture_t *tableTexture;
|
||||
|
||||
texture_t *cardTexture;
|
||||
tileset_t *cardTileset;
|
||||
primitive_t *cardPrimitive;
|
||||
|
||||
texture_t *fontTexture;
|
||||
tileset_t *fontTileset;
|
||||
spritebatch_t *fontBatch;
|
||||
|
||||
shader_t *shaderWorld;
|
||||
framebuffer_t *frameLeft;
|
||||
framebuffer_t *frameRight;
|
||||
primitive_t *quadLeft;
|
||||
primitive_t *quadRight;
|
||||
camera_t cameraMain;
|
||||
camera_t cameraLeft;
|
||||
camera_t cameraRight;
|
||||
/** Poker Game State */
|
||||
poker_t poker;
|
||||
} game_t;
|
||||
|
||||
/** The current running game state. */
|
||||
|
@ -1,44 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define GAMETIME_FIXED_STEP 0.016
|
||||
#define GAMETIME_SMALLEST_STEP 0.001
|
||||
|
||||
|
||||
typedef struct {
|
||||
/**
|
||||
* Current time (as a float of seconds since game start).
|
||||
*
|
||||
* When time is initialized this will start at a fixed value of 2/60ths of a
|
||||
* second, regardless of what engine the game is running.
|
||||
*
|
||||
* This is to avoid any divide by zero errors.
|
||||
*/
|
||||
float current;
|
||||
|
||||
/**
|
||||
* Last Time (as a float of seconds since the game start).
|
||||
*
|
||||
* This value will start at 1/60th of a second regardless of engine the game
|
||||
* is running on to avoid divide by zero errors.
|
||||
*/
|
||||
float last;
|
||||
|
||||
/**
|
||||
* Varying timestep that occured since the last frame.
|
||||
*/
|
||||
float delta;
|
||||
|
||||
/**
|
||||
* Fixed timestep that is not affected by framerate but remains consistent.
|
||||
*/
|
||||
float fixedDelta;
|
||||
} gametime_t;
|
||||
|
||||
extern gametime_t TIME_STATE;
|
Reference in New Issue
Block a user