Overworld render test.

This commit is contained in:
2025-09-11 23:33:24 -05:00
parent b4d94c2cbe
commit 964a9f64f2
32 changed files with 249 additions and 1219 deletions

View File

@@ -108,6 +108,13 @@ bool_t inputReleased(const inputaction_t action) {
return !inputIsDown(action) && inputWasDown(action);
}
float_t inputAxis(const inputaction_t neg, const inputaction_t pos) {
assertTrue(neg < INPUT_ACTION_COUNT, "Negative input action out of bounds");
assertTrue(pos < INPUT_ACTION_COUNT, "Positive input action out of bounds");
return inputGetCurrentValue(pos) - inputGetCurrentValue(neg);
}
void inputBind(const inputbutton_t button, const char_t *action) {
assertNotNull(action, "Input action is null");
assertStrLenMin(action, 1, "Input action is empty");

View File

@@ -80,6 +80,16 @@ bool_t inputPressed(const inputaction_t action);
*/
bool_t inputReleased(const inputaction_t action);
/**
* Gets the value of an input axis, defined by two actions (negative and
* positive).
*
* @param neg The action representing the negative direction of the axis.
* @param pos The action representing the positive direction of the axis.
* @return The current value of the axis (-1.0f to 1.0f).
*/
float_t inputAxis(const inputaction_t neg, const inputaction_t pos);
/**
* Binds an input button to an action. Will first check if a matching action
* exists, otherwise it will be treated as a command.
@@ -87,4 +97,4 @@ bool_t inputReleased(const inputaction_t action);
* @param button The input button to bind.
* @param action The name of the input action or command to bind the button to.
*/
void inputBind(const inputbutton_t data, const char_t *action);
void inputBind(const inputbutton_t data, const char_t *action);