Update render, spritebatch and input stuffs.

This commit is contained in:
2026-05-21 09:51:56 -05:00
parent a9e6f2b2a5
commit 6502822583
13 changed files with 394 additions and 214 deletions
+11
View File
@@ -0,0 +1,11 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "input/inputpsp.h"
#define inputInitPlatform inputInitPSP
+20
View File
@@ -36,6 +36,26 @@ inputbuttondata_t INPUT_BUTTON_DATA[] = {
{ .name = NULL }
};
errorret_t inputInitPSP(void) {
#define X(buttonName, buttonAction) \
inputBind(inputButtonGetByName(buttonName), buttonAction);
X("up", INPUT_ACTION_UP);
X("down", INPUT_ACTION_DOWN);
X("left", INPUT_ACTION_LEFT);
X("right", INPUT_ACTION_RIGHT);
X("accept", INPUT_ACTION_ACCEPT);
X("cancel", INPUT_ACTION_CANCEL);
X("triangle", INPUT_ACTION_CONSOLE);
X("select", INPUT_ACTION_RAGEQUIT);
X("lstick_up", INPUT_ACTION_UP);
X("lstick_down", INPUT_ACTION_DOWN);
X("lstick_left", INPUT_ACTION_LEFT);
X("lstick_right", INPUT_ACTION_RIGHT);
#undef X
errorOk();
}
float_t inputGetDeadzoneSDL2(const inputbutton_t button) {
return 0.2f;
}
+17
View File
@@ -0,0 +1,17 @@
/**
* Copyright (c) 2026 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "error/error.h"
#include "input/inputsdl2.h"
/**
* Initializes the input system on PSP.
*
* @return An error code indicating success or failure.
*/
errorret_t inputInitPSP(void);