Fix PSP Deadzones
This commit is contained in:
@@ -23,7 +23,7 @@ void inputInit(void) {
|
||||
INPUT.actions[i].currentValue = 0.0f;
|
||||
}
|
||||
|
||||
INPUT.deadzone = 0.1f;
|
||||
INPUT.deadzone = 0.2f;
|
||||
|
||||
// Setup Default Binds
|
||||
#if INPUT_SDL2 == 1
|
||||
@@ -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
|
||||
|
||||
@@ -81,21 +81,15 @@ void entityWalk(entity_t *entity, const entitydir_t direction) {
|
||||
// TODO: Map bounds in way?
|
||||
|
||||
// Entity in way?
|
||||
entity_t *start = ENTITIES;
|
||||
entity_t *other = ENTITIES;
|
||||
do {
|
||||
if(
|
||||
start == entity ||
|
||||
entity->type == ENTITY_TYPE_NULL ||
|
||||
start->position.x != newX ||
|
||||
start->position.y != newY ||
|
||||
start->position.z != entity->position.z
|
||||
) {
|
||||
start++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(other == entity) continue;
|
||||
if(other->type == ENTITY_TYPE_NULL) continue;
|
||||
if(other->position.x != newX) continue;
|
||||
if(other->position.y != newY) continue;
|
||||
if(other->position.z != entity->position.z) continue;
|
||||
return;// Blocked
|
||||
} while(start < &ENTITIES[ENTITY_COUNT]);
|
||||
} while(++other, other < &ENTITIES[ENTITY_COUNT]);
|
||||
|
||||
// Move.
|
||||
entity->position.x = newX;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "npc.h"
|
||||
|
||||
typedef enum {
|
||||
ENTITY_TYPE_NULL,
|
||||
ENTITY_TYPE_NULL = 0,
|
||||
|
||||
ENTITY_TYPE_PLAYER,
|
||||
ENTITY_TYPE_NPC,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#pragma once
|
||||
#include "dusk.h"
|
||||
|
||||
#define TIME_STEP (1.0f / 144.0f) // 60 Ticks per second.
|
||||
#define TIME_STEP (1.0f / 60.0f) // 60 Ticks per second (what we are aiming for)
|
||||
|
||||
#ifndef TIME_FIXED
|
||||
#define TIME_FIXED 0
|
||||
|
||||
@@ -77,7 +77,7 @@ void uiDebugRender(const tileset_t *tileset, texture_t *texture) {
|
||||
snprintf(
|
||||
buffer,
|
||||
sizeof(buffer),
|
||||
"Player: (%d, %d) Dir:%d Anim:%d",
|
||||
"%d,%d/%d/%d",
|
||||
player->position.x,
|
||||
player->position.y,
|
||||
(int32_t)player->direction,
|
||||
|
||||
Reference in New Issue
Block a user