Fix PSP Deadzones
This commit is contained in:
@@ -10,8 +10,8 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
|
|||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
|
||||||
|
|
||||||
if(NOT DEFINED DUSK_TARGET_SYSTEM)
|
if(NOT DEFINED DUSK_TARGET_SYSTEM)
|
||||||
set(DUSK_TARGET_SYSTEM "linux")
|
#set(DUSK_TARGET_SYSTEM "linux")
|
||||||
# set(DUSK_TARGET_SYSTEM "psp")
|
set(DUSK_TARGET_SYSTEM "psp")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Prep cache
|
# Prep cache
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ void inputInit(void) {
|
|||||||
INPUT.actions[i].currentValue = 0.0f;
|
INPUT.actions[i].currentValue = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
INPUT.deadzone = 0.1f;
|
INPUT.deadzone = 0.2f;
|
||||||
|
|
||||||
// Setup Default Binds
|
// Setup Default Binds
|
||||||
#if INPUT_SDL2 == 1
|
#if INPUT_SDL2 == 1
|
||||||
@@ -52,10 +52,10 @@ void inputInit(void) {
|
|||||||
inputBind(inputButtonGetByName("right"), INPUT_ACTION_RIGHT);
|
inputBind(inputButtonGetByName("right"), INPUT_ACTION_RIGHT);
|
||||||
inputBind(inputButtonGetByName("circle"), INPUT_ACTION_CANCEL);
|
inputBind(inputButtonGetByName("circle"), INPUT_ACTION_CANCEL);
|
||||||
inputBind(inputButtonGetByName("cross"), INPUT_ACTION_ACCEPT);
|
inputBind(inputButtonGetByName("cross"), INPUT_ACTION_ACCEPT);
|
||||||
// inputBind(inputButtonGetByName("lstick_negative_y"), INPUT_ACTION_UP);
|
inputBind(inputButtonGetByName("lstick_negative_y"), INPUT_ACTION_UP);
|
||||||
// inputBind(inputButtonGetByName("lstick_positive_y"), INPUT_ACTION_DOWN);
|
inputBind(inputButtonGetByName("lstick_positive_y"), INPUT_ACTION_DOWN);
|
||||||
// inputBind(inputButtonGetByName("lstick_negative_x"), INPUT_ACTION_LEFT);
|
inputBind(inputButtonGetByName("lstick_negative_x"), INPUT_ACTION_LEFT);
|
||||||
// inputBind(inputButtonGetByName("lstick_positive_x"), INPUT_ACTION_RIGHT);
|
inputBind(inputButtonGetByName("lstick_positive_x"), INPUT_ACTION_RIGHT);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -81,21 +81,15 @@ void entityWalk(entity_t *entity, const entitydir_t direction) {
|
|||||||
// TODO: Map bounds in way?
|
// TODO: Map bounds in way?
|
||||||
|
|
||||||
// Entity in way?
|
// Entity in way?
|
||||||
entity_t *start = ENTITIES;
|
entity_t *other = ENTITIES;
|
||||||
do {
|
do {
|
||||||
if(
|
if(other == entity) continue;
|
||||||
start == entity ||
|
if(other->type == ENTITY_TYPE_NULL) continue;
|
||||||
entity->type == ENTITY_TYPE_NULL ||
|
if(other->position.x != newX) continue;
|
||||||
start->position.x != newX ||
|
if(other->position.y != newY) continue;
|
||||||
start->position.y != newY ||
|
if(other->position.z != entity->position.z) continue;
|
||||||
start->position.z != entity->position.z
|
|
||||||
) {
|
|
||||||
start++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;// Blocked
|
return;// Blocked
|
||||||
} while(start < &ENTITIES[ENTITY_COUNT]);
|
} while(++other, other < &ENTITIES[ENTITY_COUNT]);
|
||||||
|
|
||||||
// Move.
|
// Move.
|
||||||
entity->position.x = newX;
|
entity->position.x = newX;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "npc.h"
|
#include "npc.h"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ENTITY_TYPE_NULL,
|
ENTITY_TYPE_NULL = 0,
|
||||||
|
|
||||||
ENTITY_TYPE_PLAYER,
|
ENTITY_TYPE_PLAYER,
|
||||||
ENTITY_TYPE_NPC,
|
ENTITY_TYPE_NPC,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "dusk.h"
|
#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
|
#ifndef TIME_FIXED
|
||||||
#define TIME_FIXED 0
|
#define TIME_FIXED 0
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ void uiDebugRender(const tileset_t *tileset, texture_t *texture) {
|
|||||||
snprintf(
|
snprintf(
|
||||||
buffer,
|
buffer,
|
||||||
sizeof(buffer),
|
sizeof(buffer),
|
||||||
"Player: (%d, %d) Dir:%d Anim:%d",
|
"%d,%d/%d/%d",
|
||||||
player->position.x,
|
player->position.x,
|
||||||
player->position.y,
|
player->position.y,
|
||||||
(int32_t)player->direction,
|
(int32_t)player->direction,
|
||||||
|
|||||||
Reference in New Issue
Block a user