Renders on PSP again

This commit is contained in:
2025-09-12 00:25:17 -05:00
parent 964a9f64f2
commit 46a94ecacd
17 changed files with 105 additions and 31 deletions

View File

@@ -18,8 +18,8 @@ display_t DISPLAY;
errorret_t displayInit(void) {
#if DISPLAY_SDL2
uint32_t flags = SDL_INIT_VIDEO;
#if INPUT_SUPPORT_GAMEPAD
flags |= SDL_INIT_GAMECONTROLLER;
#if INPUT_GAMEPAD == 1
flags |= SDL_INIT_GAMECONTROLLER | SDL_INIT_JOYSTICK;
#endif
if(SDL_Init(flags) != 0) {
errorThrow("SDL Failed to Initialize: %s", SDL_GetError());

View File

@@ -63,8 +63,8 @@ void sceneOverworldRenderMap(const map_t *map) {
// Draw base layer
// Draw entities
entity_t *start = &map->entities[0];
entity_t *end = &map->entities[map->entityCount];
const entity_t *start = &map->entities[0];
const entity_t *end = &map->entities[map->entityCount];
while(start < end) {
// Render entity here.
sceneOverworldRenderEntity(start);

View File

@@ -54,7 +54,7 @@ void uiRender(void) {
cameraPushMatrix(&UI.camera);
uiConsoleRender();
uiFPSRender();
// uiFPSRender();
spriteBatchFlush();
cameraPopMatrix();

View File

@@ -11,16 +11,17 @@
void uiConsoleRender(void) {
if(!CONSOLE.visible) return;
consolePrint("Test\n");
int32_t i = 0;
int32_t i = CONSOLE_HISTORY_MAX - 1;
char_t *line;
do {
line = CONSOLE.line[i];
if(line[0] == '\0') {
i++;
i--;
continue;
}
uiTextDraw(0, i * UI_TEXT_TILE_HEIGHT, line, COLOR_WHITE);
i++;
} while(i < CONSOLE_HISTORY_MAX);
i--;
} while(i > 0);
}

View File

@@ -12,16 +12,15 @@
#include "util/string.h"
void uiFPSInit(void) {
consoleRegVar("fps", "1", NULL);
consoleRegVar("fps", "0", NULL);
}
void uiFPSRender(void) {
float_t fps = TIME.delta > 0.0f ? (1.0f / TIME.delta) : 0.0f;
if(stringCompare(consoleVarGet("fps")->value, "0") == 0) {
return;
}
float_t fps = TIME.delta > 0.0f ? (1.0f / TIME.delta) : 0.0f;
char_t buffer[64];
snprintf(
buffer,