Nuked the holdem remderer

This commit is contained in:
2021-05-16 18:38:58 -07:00
parent 3aa6a220b1
commit c0e66c34cd
7 changed files with 56 additions and 76 deletions

View File

@ -7,7 +7,7 @@
#pragma once
#include <dawn/dawn.h>
#include "../render/holdemrender.h"
#include "../render/look.h"
#include "../../debug/log.h"
#include "../holdem.h"
#include "action.h"

View File

@ -9,8 +9,20 @@
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.
holdemRenderInit();
holdemRenderFrameInit();
holdemRenderSceneInit();
holdemRenderPlayerInit();
holdemRenderCardInit();
// Prepare the action manager
holdemActionInit();
@ -20,8 +32,20 @@ void holdemGameInit() {
}
void holdemGameUpdate() {
// Update the frame buffers and action queue
holdemRenderFrameUpdate();
holdemActionUpdate();
holdemRender();
// 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() {

View File

@ -7,13 +7,18 @@
#pragma once
#include <dawn/dawn.h>
#include "holdem.h"
#include "render/holdemrender.h"
#include "card.h"
#include "../file/asset.h"
#include "../display/gui/font.h"
#include "holdem.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

View File

@ -1,37 +0,0 @@
/**
* 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/spritebatch.h"
#include "../../display/gui/font.h"
#include "../../display/framebuffer.h"
#include "../../display/camera.h"
#include "../../display/primitives/cube.h"
#include "../../display/tileset.h"
#include "../model/pokertable.h"
#include "player.h"
#include "card.h"
#include "frame.h"
#include "look.h"
#include "scene.h"
/**
* Prepare the Hold'em Game Renderer.
*/
void holdemRenderInit();
/**
* Render the Texas Hold'em Game.
*/
void holdemRender();
void holdemRenderWorld();

View File

@ -7,8 +7,10 @@
#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"
/**

View File

@ -5,38 +5,7 @@
* https://opensource.org/licenses/MIT
*/
#include "holdemrender.h"
void holdemRenderInit() {
// 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);
holdemRenderFrameInit();
holdemRenderSceneInit();
holdemRenderPlayerInit();
holdemRenderCardInit();
}
void holdemRender() {
holdemRenderFrameUpdate();
// 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();
}
#include "world.h"
void holdemRenderWorld() {
uint8_t i, j;
@ -67,4 +36,4 @@ void holdemRenderWorld() {
holdemRenderCardForSeat(seat, player->cards[j], HOLDEM_GAME_CARD_SLOT_HAND0+j);
}
}
}
}

17
src/card/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();