Let's get this rendering on PSP and Dolphin.

This commit is contained in:
2026-03-08 15:46:38 -05:00
parent 5dd22fad6c
commit 4bf26dc818
9 changed files with 90 additions and 91 deletions

View File

@@ -17,9 +17,9 @@ errorret_t screenInit() {
SCREEN.background = COLOR_CORNFLOWER_BLUE;
#if DISPLAY_SIZE_DYNAMIC == 1
#ifdef DUSK_DISPLAY_SIZE_DYNAMIC
SCREEN.mode = SCREEN_MODE_FIXED_VIEWPORT_HEIGHT;
SCREEN.fixedHeight.height = DISPLAY_SCREEN_HEIGHT_DEFAULT;
SCREEN.fixedHeight.height = DUSK_DISPLAY_SCREEN_HEIGHT;
cameraInitOrthographic(&SCREEN.framebufferCamera);
SCREEN.framebufferCamera.viewType = CAMERA_VIEW_TYPE_2D;
@@ -27,14 +27,14 @@ errorret_t screenInit() {
SCREEN.framebufferCamera._2d.position[1] = 0;
SCREEN.framebufferCamera._2d.zoom = 1.0f;
errorChain(quadBuffer(
quadBuffer(
SCREEN.frameBufferMeshVertices,
0.0f, 0.0f,
1.0f, 1.0f,
COLOR_WHITE,
0.0f, 0.0f,
1.0f, 1.0f
));
);
errorChain(meshInit(
&SCREEN.frameBufferMesh,
QUAD_PRIMITIVE_TYPE,
@@ -57,7 +57,7 @@ void screenBind() {
SCREEN.height = frameBufferGetHeight(FRAMEBUFFER_BOUND);
// No needd for a framebuffer.
#if DISPLAY_SIZE_DYNAMIC == 1
#ifdef DUSK_DISPLAY_SIZE_DYNAMIC
if(SCREEN.framebufferReady) {
frameBufferDispose(&SCREEN.framebuffer);
SCREEN.framebufferReady = false;
@@ -66,7 +66,7 @@ void screenBind() {
break;
}
#if DISPLAY_SIZE_DYNAMIC == 1
#ifdef DUSK_DISPLAY_SIZE_DYNAMIC
case SCREEN_MODE_FIXED_SIZE: {
SCREEN.width = SCREEN.fixedSize.width;
SCREEN.height = SCREEN.fixedSize.height;
@@ -270,7 +270,7 @@ void screenUnbind() {
case SCREEN_MODE_BACKBUFFER:
break;
#if DISPLAY_SIZE_DYNAMIC == 1
#ifdef DUSK_DISPLAY_SIZE_DYNAMIC
case SCREEN_MODE_ASPECT_RATIO:
case SCREEN_MODE_FIXED_HEIGHT:
case SCREEN_MODE_FIXED_SIZE:
@@ -293,7 +293,7 @@ void screenRender() {
return;
}
#if DISPLAY_SIZE_DYNAMIC == 1
#ifdef DUSK_DISPLAY_SIZE_DYNAMIC
if(SCREEN.mode == SCREEN_MODE_FIXED_VIEWPORT_HEIGHT) {
glViewport(0, 0, SCREEN.width, SCREEN.height);
return;
@@ -369,7 +369,7 @@ void screenRender() {
}
void screenDispose() {
#if DISPLAY_SIZE_DYNAMIC == 1
#ifdef DUSK_DISPLAY_SIZE_DYNAMIC
if(SCREEN.framebufferReady) {
frameBufferDispose(&SCREEN.framebuffer);
SCREEN.framebufferReady = false;

View File

@@ -12,7 +12,7 @@
#include "display/mesh/quad.h"
#include "display/color.h"
#if DUSK_DISPLAY_SIZE_DYNAMIC == 1
#ifdef DUSK_DISPLAY_SIZE_DYNAMIC
#ifndef DUSK_DISPLAY_SCREEN_HEIGHT
#error "DUSK_DISPLAY_SCREEN_HEIGHT must be defined"
#endif
@@ -47,7 +47,7 @@ typedef struct {
float_t aspect;
color_t background;
#if DISPLAY_SIZE_DYNAMIC == 1
#ifdef DUSK_DISPLAY_SIZE_DYNAMIC
framebuffer_t framebuffer;
bool_t framebufferReady;
camera_t framebufferCamera;

View File

@@ -14,7 +14,7 @@ typedef struct {
float_t lastValue;
float_t currentValue;
#if TIME_FIXED == 0
#ifdef DUSK_TIME_DYNAMIC
float_t lastDynamicValue;
float_t currentDynamicValue;
#endif

View File

@@ -168,8 +168,8 @@ errorret_t mapPositionSet(const chunkpos_t newPos) {
}
void mapUpdate() {
#if TIME_FIXED == 0
if(!TIME.dynamicUpdate) return;
#ifdef DUSK_TIME_DYNAMIC
if(!TIME.dynamicUpdate) return;
#endif
}

View File

@@ -21,10 +21,10 @@ errorret_t sceneInit(void) {
}
errorret_t sceneUpdate(void) {
#if TIME_FIXED == 0
if(!TIME.dynamicUpdate) {
errorOk();
}
#ifdef DUSK_TIME_DYNAMIC
if(!TIME.dynamicUpdate) {
errorOk();
}
#endif
lua_getglobal(SCENE.scriptContext.luaState, "sceneUpdate");

View File

@@ -18,25 +18,18 @@ void moduleInput(scriptcontext_t *context) {
// Input values.
scriptContextExec(context,
#if INPUT_KEYBOARD == 1
""
#ifdef DUSK_INPUT_KEYBOARD
"INPUT_KEYBOARD = true\n"
#else
""
#endif
#if INPUT_GAMEPAD == 1
#ifdef DUSK_INPUT_GAMEPAD
"INPUT_GAMEPAD = true\n"
#else
""
#endif
#if INPUT_POINTER == 1
#ifdef DUSK_INPUT_POINTER
"INPUT_POINTER = true\n"
#else
""
#endif
#if INPUT_SDL2 == 1
"INPUT_SDL2 = true\n"
#else
""
#ifdef DUSK_INPUT_TOUCH
"INPUT_TOUCH = true\n"
#endif
);

View File

@@ -15,7 +15,7 @@ typedef framebuffergl_t framebufferplatform_t;
#define frameBufferPlatformBind frameBufferGLBind
#define frameBufferPlatformClear frameBufferGLClear
#if DUSK_DISPLAY_SIZE_DYNAMIC
#ifdef DUSK_DISPLAY_SIZE_DYNAMIC
#define frameBufferPlatformInit frameBufferGLInit
#define frameBufferPlatformDispose frameBufferGLDispose
#endif