Corrected final font issues.

This commit is contained in:
2021-05-26 06:17:13 -07:00
parent 5ad7ee233e
commit b81c4ca604
7 changed files with 54 additions and 55 deletions

View File

@ -15,11 +15,8 @@
/** How many characters (after the first char) to generate */
#define FONT_NUM_CHARS 96
/** Passed to STBTT for scaling the font nicely */
#define FONT_TEXTURE_SIZE 24
/** Width of the loaded font texture */
#define FONT_TEXTURE_WIDTH 512
#define FONT_TEXTURE_WIDTH 1024
/** Height of the loaded font texture */
#define FONT_TEXTURE_HEIGHT FONT_TEXTURE_WIDTH
@ -27,6 +24,9 @@
/** Refer to STBTT docs for OpenGL Fill Mode v d3d Fill Modes */
#define FONT_FILL_MODE 1
/** Passed to STBTT for scaling the font nicely, essentially the font size. */
#define FONT_TEXTURE_SIZE 96
// Chars
#define FONT_NEWLINE '\n'
#define FONT_SPACE ' '
@ -35,7 +35,6 @@
#define FONT_LINE_HEIGHT FONT_TEXTURE_SIZE*0.75
#define FONT_INITIAL_LINE FONT_LINE_HEIGHT*0.75
#define FONT_SPACE_SIZE FONT_TEXTURE_SIZE*0.45
#define FONT_SCALE_ADJUST 0.03
/** Representation of a font that can be used to render text */
typedef struct {

View File

@ -46,7 +46,14 @@
#define POKER_BLIND_BIG_DEFAULT 600
#define POKER_BLIND_SMALL_DEFAULT (POKER_BLIND_BIG_DEFAULT/2)
/** GUI Height fix (To keep gui scaling nicely we use a fixed height) */
#define POKER_GUI_HEIGHT 2160
typedef struct {
//////////////////////////////////////////////////////////////////////////////
// Poker Logic Variables
//////////////////////////////////////////////////////////////////////////////
/** Current Card Deck */
card_t deck[CARD_DECK_SIZE];
uint8_t deckSize;
@ -77,19 +84,29 @@ typedef struct {
/** The current buy-in bet size. */
uint32_t roundBet;
/** Rendering Assets */
framebuffer_t frameWorld;
framebuffer_t frameGui;
//////////////////////////////////////////////////////////////////////////////
// Rendering Assets
//////////////////////////////////////////////////////////////////////////////
/** Frames to hold the world and GUI render outputs */
framebuffer_t frameWorld, frameGui;
/** Game's Font */
font_t font;
/** Game's Shader */
shader_t shader;
camera_t cameraWorld;
camera_t cameraGui;
/** Camera for the world and the GUI */
camera_t cameraWorld, cameraGui;
/** Talk related */
float lastWidth, lastHeight;
/** Refer to POKER_GUI_HEIGHT */
float guiWidth;
/** Last frame's GUI width, used to track font wrapping */
float textLastWidth;
/** Primitive to hold talking text */
primitive_t talkPrimitive;
/** Current spoken text, tracked in-case of re-render */
char *talkText;
/** Information about the current rendered text */
fonttextinfo_t *talkTextInfo;
texture_t dealerTexture;