Fixed PSP compiling
This commit is contained in:
@@ -21,4 +21,13 @@ if(DUSK_TARGET_SYSTEM STREQUAL "linux")
|
||||
DISPLAY_WINDOW_WIDTH_DEFAULT=960
|
||||
DISPLAY_WINDOW_HEIGHT_DEFAULT=720
|
||||
)
|
||||
elseif(DUSK_TARGET_SYSTEM STREQUAL "psp")
|
||||
target_compile_definitions(${DUSK_TARGET_NAME}
|
||||
PRIVATE
|
||||
DUSK_DISPLAY_SDL2=1
|
||||
DISPLAY_WINDOW_WIDTH_DEFAULT=480
|
||||
DISPLAY_WINDOW_HEIGHT_DEFAULT=272
|
||||
DISPLAY_WIDTH=480
|
||||
DISPLAY_HEIGHT=272
|
||||
)
|
||||
endif()
|
@@ -75,7 +75,7 @@ errorret_t displayUpdate(void) {
|
||||
|
||||
// Set viewport size.
|
||||
int32_t windowWidth, windowHeight;
|
||||
SDL_GetWindowSize(DISPLAY.window, &windowWidth, &windowHeight);
|
||||
// SDL_GetWindowSize(DISPLAY.window, &windowWidth, &windowHeight);
|
||||
glViewport(0, 0, windowWidth, windowHeight);
|
||||
#endif
|
||||
|
||||
|
@@ -19,9 +19,11 @@ typedef enum {
|
||||
#define MESH_VERTEX_POS_SIZE 3
|
||||
|
||||
typedef struct {
|
||||
GLubyte color[MESH_VERTEX_COLOR_SIZE];
|
||||
GLfloat uv[MESH_VERTEX_UV_SIZE];
|
||||
GLfloat pos[MESH_VERTEX_POS_SIZE];
|
||||
#if DUSK_DISPLAY_SDL2
|
||||
GLubyte color[MESH_VERTEX_COLOR_SIZE];
|
||||
GLfloat uv[MESH_VERTEX_UV_SIZE];
|
||||
GLfloat pos[MESH_VERTEX_POS_SIZE];
|
||||
#endif
|
||||
} meshvertex_t;
|
||||
|
||||
typedef struct {
|
||||
|
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "meshrenderer.h"
|
||||
#include "scene/node.h"
|
||||
|
||||
meshrenderer_t MESH_RENDERER_DATA[ECS_ENTITY_COUNT_MAX] = { 0 };
|
||||
ecscomponent_t MESH_RENDERER_COMPONENT = ecsComponentInit(
|
||||
@@ -22,5 +23,9 @@ void meshRendererDraw(const ecsid_t id) {
|
||||
|
||||
meshrenderer_t *renderer = &MESH_RENDERER_DATA[id];
|
||||
if(!renderer->mesh) return;
|
||||
|
||||
node_t *node = nodeGet(id);
|
||||
nodeMatrixUpdate(id);
|
||||
|
||||
meshDraw(renderer->mesh, 0, -1);
|
||||
}
|
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "renderer.h"
|
||||
#include "display/mesh/meshrenderer.h"
|
||||
#include "scene/node.h"
|
||||
|
||||
void rendererRender(const ecsid_t camera) {
|
||||
if(camera == -1) return;
|
||||
@@ -14,11 +15,14 @@ void rendererRender(const ecsid_t camera) {
|
||||
// Get the meshes.
|
||||
uint32_t meshCount;
|
||||
ecsid_t meshes[ECS_ENTITY_COUNT_MAX];
|
||||
ecsid_t id;
|
||||
meshCount = meshRendererGetAll(meshes);
|
||||
|
||||
cameraPush(camera);
|
||||
for(uint32_t i = 0; i < meshCount; i++) {
|
||||
meshRendererDraw(meshes[i]);
|
||||
id = meshes[i];
|
||||
nodeMatrixPush(id);
|
||||
meshRendererDraw(id);
|
||||
}
|
||||
cameraPop();
|
||||
}
|
Reference in New Issue
Block a user