screen mode

This commit is contained in:
2025-10-06 16:18:53 -05:00
parent 12c31ba9d1
commit 6e5c5f61db
3 changed files with 9 additions and 11 deletions

View File

@@ -217,7 +217,7 @@ void screenRender() {
fbWidth = frameBufferGetWidth(&SCREEN.framebuffer); fbWidth = frameBufferGetWidth(&SCREEN.framebuffer);
fbHeight = frameBufferGetHeight(&SCREEN.framebuffer); fbHeight = frameBufferGetHeight(&SCREEN.framebuffer);
fbAspect = fbWidth / fbHeight; fbAspect = fbWidth / fbHeight;
if(backBufferAspect > fbAspect) { if(backBufferAspect > fbAspect) {
fbHeight = bbHeight; fbHeight = bbHeight;
fbWidth = fbHeight * fbAspect; fbWidth = fbHeight * fbAspect;

View File

@@ -20,15 +20,15 @@ typedef enum {
#endif #endif
} screenmode_t; } screenmode_t;
typedef enum { // typedef enum {
SCREEN_SCALE_MODE_FILL, // SCREEN_SCALE_MODE_FILL,
SCREEN_SCALE_MODE_INTEGER, // SCREEN_SCALE_MODE_INTEGER,
SCREEN_SCALE_MODE_INEGER_OVERFLOW // SCREEN_SCALE_MODE_INEGER_OVERFLOW
} screenscalemode_t; // } screenscalemode_t;
typedef struct { typedef struct {
screenmode_t mode; screenmode_t mode;
screenscalemode_t scaleMode; // screenscalemode_t scaleMode;
// Calculated dimensions of the viewport, to be used by the camera // Calculated dimensions of the viewport, to be used by the camera
int32_t width; int32_t width;

View File

@@ -14,10 +14,8 @@
errorret_t gameInit(void) { errorret_t gameInit(void) {
// Setup screen // Setup screen
// SCREEN.mode = SCREEN_MODE_FIXED_HEIGHT; SCREEN.mode = SCREEN_MODE_FIXED_HEIGHT;
// SCREEN.fixedHeight.height = 270; SCREEN.fixedHeight.height = 270;
SCREEN.mode = SCREEN_MODE_ASPECT_RATIO;
SCREEN.aspectRatio.ratio = 16.0f / 9.0f;
errorChain(uiInit()); errorChain(uiInit());