mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-16 01:55:21 +03:00
chore(gx): clean up screen stock initialization
This commit is contained in:
parent
21c2484809
commit
fad901796c
@ -6,13 +6,14 @@
|
|||||||
#include "gx/Gx.hpp"
|
#include "gx/Gx.hpp"
|
||||||
#include "gx/Transform.hpp"
|
#include "gx/Transform.hpp"
|
||||||
#include "util/Filesystem.hpp"
|
#include "util/Filesystem.hpp"
|
||||||
|
#include <storm/String.hpp>
|
||||||
#include <tempest/Matrix.hpp>
|
#include <tempest/Matrix.hpp>
|
||||||
|
|
||||||
int32_t Screen::s_captureScreen = 0;
|
int32_t Screen::s_captureScreen = 0;
|
||||||
float Screen::s_elapsedSec = 0.0f;
|
float Screen::s_elapsedSec = 0.0f;
|
||||||
int32_t Screen::s_presentDisable = 0;
|
int32_t Screen::s_presentDisable = 0;
|
||||||
HOBJECT Screen::s_stockObjects[];
|
static HOBJECT s_stockObjects[SCRNSTOCKOBJECTS];
|
||||||
float Screen::s_stockObjectHeights[] = { 0.01953125f, 0.01953125f };
|
static float s_stockObjectHeights[SCRNSTOCKOBJECTS] = { 0.01953125f, 0.01953125f };
|
||||||
static STORM_EXPLICIT_LIST(CILayer, zorderlink) s_zOrderList;
|
static STORM_EXPLICIT_LIST(CILayer, zorderlink) s_zOrderList;
|
||||||
|
|
||||||
int32_t OnIdle(const EVENT_DATA_IDLE* data, void* a2) {
|
int32_t OnIdle(const EVENT_DATA_IDLE* data, void* a2) {
|
||||||
@ -152,9 +153,8 @@ void ILayerInitialize() {
|
|||||||
void IStockInitialize() {
|
void IStockInitialize() {
|
||||||
GxuFontInitialize();
|
GxuFontInitialize();
|
||||||
|
|
||||||
char fontFile[260];
|
char fontFile[STORM_MAX_PATH];
|
||||||
|
OsBuildFontFilePath("FRIZQT__.TTF", fontFile, sizeof(fontFile));
|
||||||
OsBuildFontFilePath("FRIZQT__.TTF", fontFile, 260);
|
|
||||||
|
|
||||||
if (*fontFile) {
|
if (*fontFile) {
|
||||||
ScrnSetStockFont(STOCK_SYSFONT, fontFile);
|
ScrnSetStockFont(STOCK_SYSFONT, fontFile);
|
||||||
@ -209,11 +209,11 @@ void ScrnLayerCreate(const RECTF* rect, float zOrder, uint32_t flags, void* para
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScrnSetStockFont(SCRNSTOCK stockID, const char* fontTexturePath) {
|
void ScrnSetStockFont(SCRNSTOCK stockID, const char* fontTexturePath) {
|
||||||
if (Screen::s_stockObjects[stockID]) {
|
if (s_stockObjects[stockID]) {
|
||||||
HandleClose(Screen::s_stockObjects[stockID]);
|
HandleClose(s_stockObjects[stockID]);
|
||||||
}
|
}
|
||||||
|
|
||||||
float fontHeight = NDCToDDCHeight(Screen::s_stockObjectHeights[stockID]);
|
float fontHeight = NDCToDDCHeight(s_stockObjectHeights[stockID]);
|
||||||
HTEXTFONT font = TextBlockGenerateFont(fontTexturePath, 0, fontHeight);
|
HTEXTFONT font = TextBlockGenerateFont(fontTexturePath, 0, fontHeight);
|
||||||
Screen::s_stockObjects[stockID] = font;
|
s_stockObjects[stockID] = font;
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,6 @@ namespace Screen {
|
|||||||
extern int32_t s_captureScreen;
|
extern int32_t s_captureScreen;
|
||||||
extern float s_elapsedSec;
|
extern float s_elapsedSec;
|
||||||
extern int32_t s_presentDisable;
|
extern int32_t s_presentDisable;
|
||||||
extern HOBJECT s_stockObjects[SCRNSTOCKOBJECTS];
|
|
||||||
extern float s_stockObjectHeights[SCRNSTOCKOBJECTS];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ILayerInitialize();
|
void ILayerInitialize();
|
||||||
|
Loading…
Reference in New Issue
Block a user