Moved some more code around
This commit is contained in:
@ -35,7 +35,6 @@
|
||||
#include "poker/action.h"
|
||||
#include "poker/card.h"
|
||||
#include "poker/player.h"
|
||||
#include "poker/poker.h"
|
||||
#include "poker/render.h"
|
||||
|
||||
// Utility Objects
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "../libs.h"
|
||||
#include "../display/shader.h"
|
||||
#include "../display/camera.h"
|
||||
#include "../poker/poker.h"
|
||||
#include "../poker/card.h"
|
||||
#include "../poker/player.h"
|
||||
#include "../poker/render.h"
|
||||
@ -32,9 +31,6 @@ typedef struct {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** Current Card Deck */
|
||||
card_t deck[CARD_DECK_SIZE];
|
||||
|
@ -8,6 +8,9 @@
|
||||
#pragma once
|
||||
#include "../libs.h"
|
||||
|
||||
/** How many cards the dealer can hold in their hand */
|
||||
#define HOLDEM_DEALER_HAND 5
|
||||
|
||||
/** How many cards a player can hold in their hand */
|
||||
#define POKER_PLAYER_HAND 2
|
||||
|
||||
@ -15,10 +18,18 @@
|
||||
#define POKER_PLAYER_COUNT 5
|
||||
|
||||
/** State for whether or not a player has folded */
|
||||
#define GAME_STATE_FOLDED 0x01
|
||||
#define POKER_PLAYER_STATE_FOLDED 0x01
|
||||
|
||||
/** State for whether or not a player is showing their hand */
|
||||
#define GAME_STATE_SHOWING 0x02
|
||||
#define POKER_PLAYER_STATE_SHOWING 0x02
|
||||
|
||||
/** Various seats at the table that people can sit */
|
||||
#define HOLDEM_GAME_SEAT_DEALER 0x00
|
||||
#define HOLDEM_GAME_SEAT_PLAYER0 0x04
|
||||
#define HOLDEM_GAME_SEAT_PLAYER1 0x06
|
||||
#define HOLDEM_GAME_SEAT_PLAYER2 0x05
|
||||
#define HOLDEM_GAME_SEAT_PLAYER3 0x03
|
||||
#define HOLDEM_GAME_SEAT_PLAYER4 0x02
|
||||
|
||||
/** Poker Player State */
|
||||
typedef struct {
|
||||
|
@ -1,39 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "card.h"
|
||||
#include "player.h"
|
||||
#include "render.h"
|
||||
#include "action.h"
|
||||
#include "../display/render.h"
|
||||
#include "../display/spritebatch.h"
|
||||
#include "../display/texture.h"
|
||||
#include "../display/tileset.h"
|
||||
#include "../display/framebuffer.h"
|
||||
|
||||
/** How many cards the dealer can hold in their hand */
|
||||
#define HOLDEM_DEALER_HAND 5
|
||||
|
||||
/** Various seats at the table that people can sit */
|
||||
#define HOLDEM_GAME_SEAT_DEALER 0x00
|
||||
#define HOLDEM_GAME_SEAT_PLAYER0 0x04
|
||||
#define HOLDEM_GAME_SEAT_PLAYER1 0x06
|
||||
#define HOLDEM_GAME_SEAT_PLAYER2 0x05
|
||||
#define HOLDEM_GAME_SEAT_PLAYER3 0x03
|
||||
#define HOLDEM_GAME_SEAT_PLAYER4 0x02
|
||||
|
||||
/** Macro for the angle (Yaw) that the seat has */
|
||||
#define HOLDEM_GAME_SEAT_ANGLE(seat) mathDeg2Rad(-45 * seat)
|
||||
|
||||
#define HOLDEM_GAME_CARD_SLOT_HAND0 0x00
|
||||
#define HOLDEM_GAME_CARD_SLOT_HAND1 0x01
|
||||
#define HOLDEM_GAME_CARD_SLOT_FLOP0 0x02
|
||||
#define HOLDEM_GAME_CARD_SLOT_FLOP1 0x03
|
||||
#define HOLDEM_GAME_CARD_SLOT_FLOP2 0x04
|
||||
#define HOLDEM_GAME_CARD_SLOT_FLOP3 0x05
|
||||
#define HOLDEM_GAME_CARD_SLOT_FLOP4 0x06
|
@ -21,6 +21,17 @@
|
||||
RENDER_STATE.width - HOLDEM_GAME_FRAME_LEFT_WIDTH - 1\
|
||||
)
|
||||
|
||||
/** Macro for the angle (Yaw) that the seat has */
|
||||
#define HOLDEM_GAME_SEAT_ANGLE(seat) mathDeg2Rad(-45 * seat)
|
||||
|
||||
#define HOLDEM_GAME_CARD_SLOT_HAND0 0x00
|
||||
#define HOLDEM_GAME_CARD_SLOT_HAND1 0x01
|
||||
#define HOLDEM_GAME_CARD_SLOT_FLOP0 0x02
|
||||
#define HOLDEM_GAME_CARD_SLOT_FLOP1 0x03
|
||||
#define HOLDEM_GAME_CARD_SLOT_FLOP2 0x04
|
||||
#define HOLDEM_GAME_CARD_SLOT_FLOP3 0x05
|
||||
#define HOLDEM_GAME_CARD_SLOT_FLOP4 0x06
|
||||
|
||||
typedef struct {
|
||||
float x, z;
|
||||
float yaw;
|
||||
|
@ -36,8 +36,8 @@ void actionRoundInit(int32_t index, void *data) {
|
||||
|
||||
// Clear Round State(s)
|
||||
player->state &= ~(
|
||||
GAME_STATE_FOLDED |
|
||||
GAME_STATE_SHOWING
|
||||
POKER_PLAYER_STATE_FOLDED |
|
||||
POKER_PLAYER_STATE_SHOWING
|
||||
);
|
||||
|
||||
player->cardCount = 0;
|
||||
|
@ -42,7 +42,7 @@ void holdemRenderWorld() {
|
||||
seat = holdemRenderPlayerGetSeatForPlayer(i);
|
||||
holdemRenderPlayer(seat);
|
||||
|
||||
if(player->state & GAME_STATE_FOLDED) continue;
|
||||
if(player->state & POKER_PLAYER_STATE_SHOWING) continue;
|
||||
|
||||
for(j = 0x00; j < player->cardCount; j++) {
|
||||
holdemRenderCardForSeat(seat, player->cards[j], HOLDEM_GAME_CARD_SLOT_HAND0+j);
|
||||
|
Reference in New Issue
Block a user