Fixed PSP rendering
This commit is contained in:
@@ -115,6 +115,7 @@ if(DUSK_TARGET_SYSTEM STREQUAL "psp")
|
||||
BACKGROUND_PATH NULL
|
||||
PREVIEW_PATH NULL
|
||||
TITLE "${DUSK_TARGET_NAME}"
|
||||
PSAR_PATH ${DUSK_BUILD_DIR}/dusk.dsk
|
||||
VERSION 01.00
|
||||
)
|
||||
endif()
|
||||
@@ -3,4 +3,4 @@
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
add_asset(TILESET minogram.png type=ALPHA tileWidth=6 tileHeight=10 columns=16 rows=6)
|
||||
add_asset(TILESET minogram.png type=PALETTIZED tileWidth=6 tileHeight=10 columns=16 rows=6)# Fixes PSP rendering
|
||||
@@ -31,7 +31,7 @@ if(NOT TARGET pspsdk)
|
||||
if(NOT PSPSDK_PSP_GCC)
|
||||
message(STATUS "psp-gcc not found in system paths. Downloading PSPSDK tarball...")
|
||||
file(DOWNLOAD
|
||||
"https://github.com/pspdev/pspdev/releases/tag/v20251101/download/pspdev-ubuntu-latest-x86_64.tar.gz"
|
||||
"https://github.com/pspdev/pspdev/releases/download/v20251101/pspdev-ubuntu-latest-x86_64.tar.gz"
|
||||
"${CMAKE_BINARY_DIR}/pspsdk.tar.gz"
|
||||
EXPECTED_HASH SHA256=8f8abc2a3008ec1e97c6ba706152a45e4f031c8d10db2102c3c68ce24fa6fcaf
|
||||
SHOW_PROGRESS
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -41,6 +41,9 @@ void screenInit() {
|
||||
SCREEN.frameBufferMeshVertices
|
||||
);
|
||||
#endif
|
||||
|
||||
// Init screen to backbuffer mode by default
|
||||
screenBind();
|
||||
}
|
||||
|
||||
void screenBind() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -44,7 +44,6 @@ void uiRender(void) {
|
||||
uiFPSRender(UI.fontTileset, &UI.fontTexture);
|
||||
uiTextboxRender();
|
||||
}
|
||||
|
||||
cameraPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user