Fixed PSP rendering

This commit is contained in:
2025-11-09 14:54:33 -06:00
parent 587d716aae
commit aaa8622956
11 changed files with 30 additions and 8 deletions

View File

@@ -10,6 +10,13 @@
#include "assettype.h"
#if ASSET_TYPE == wad
#if PSP
typedef struct {
uint8_t signature[4];
uint16_t version[2];
unsigned int offset[8];
} assetpbp_t;
#endif
#else
#error "Unsupported ASSET_TYPE"
#endif

View File

@@ -52,6 +52,11 @@ void cameraPushMatrix(camera_t *camera) {
switch(camera->projType) {
case CAMERA_PROJECTION_TYPE_ORTHOGRAPHIC:
assertTrue(
camera->orthographic.right != camera->orthographic.left &&
camera->orthographic.top != camera->orthographic.bottom,
"Invalid orthographic projection parameters"
);
glm_ortho(
camera->orthographic.left,
camera->orthographic.right,
@@ -117,7 +122,6 @@ void cameraPushMatrix(camera_t *camera) {
glm_vec3_copy(camera->lookatPixelPerfect.target, position);
glm_vec3_add(position, camera->lookatPixelPerfect.offset, position);
position[2] += z;
glm_lookat(
position,
camera->lookatPixelPerfect.target,

View File

@@ -41,6 +41,9 @@ void screenInit() {
SCREEN.frameBufferMeshVertices
);
#endif
// Init screen to backbuffer mode by default
screenBind();
}
void screenBind() {

View File

@@ -170,6 +170,7 @@ void textureBind(const texture_t *texture) {
#if DISPLAY_SDL2
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture->id);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
#endif
TEXTURE_BOUND = texture;
}

View File

@@ -52,10 +52,10 @@ void inputInit(void) {
inputBind(inputButtonGetByName("right"), INPUT_ACTION_RIGHT);
inputBind(inputButtonGetByName("circle"), INPUT_ACTION_CANCEL);
inputBind(inputButtonGetByName("cross"), INPUT_ACTION_ACCEPT);
inputBind(inputButtonGetByName("lstick_negative_y"), INPUT_ACTION_UP);
inputBind(inputButtonGetByName("lstick_positive_y"), INPUT_ACTION_DOWN);
inputBind(inputButtonGetByName("lstick_negative_x"), INPUT_ACTION_LEFT);
inputBind(inputButtonGetByName("lstick_positive_x"), INPUT_ACTION_RIGHT);
// inputBind(inputButtonGetByName("lstick_negative_y"), INPUT_ACTION_UP);
// inputBind(inputButtonGetByName("lstick_positive_y"), INPUT_ACTION_DOWN);
// inputBind(inputButtonGetByName("lstick_negative_x"), INPUT_ACTION_LEFT);
// inputBind(inputButtonGetByName("lstick_positive_x"), INPUT_ACTION_RIGHT);
#endif
#endif
#endif

View File

@@ -11,6 +11,12 @@
#include "input/input.h"
int main(int argc, char **argv) {
// Write out launch args
printf("Launching Dusk with %d args:\n", argc);
for(int i = 0; i < argc; i++) {
printf(" Arg %d: %s\n", i, argv[i]);
}
errorret_t ret;
// Init engine

View File

@@ -44,7 +44,6 @@ void uiRender(void) {
uiFPSRender(UI.fontTileset, &UI.fontTexture);
uiTextboxRender();
}
cameraPopMatrix();
}