diff --git a/src/dusk/rpg/entity/entityanim.h b/src/dusk/rpg/entity/entityanim.h index cb040070..9fb8d9ea 100644 --- a/src/dusk/rpg/entity/entityanim.h +++ b/src/dusk/rpg/entity/entityanim.h @@ -11,6 +11,8 @@ #define ENTITY_ANIM_TURN_DURATION 0.06f #define ENTITY_ANIM_WALK_DURATION 0.1f +typedef struct entity_s entity_t; + typedef enum { ENTITY_ANIM_IDLE, ENTITY_ANIM_TURN, diff --git a/src/dusk/rpg/entity/entitydir.c b/src/dusk/rpg/entity/entitydir.c index e272877a..bf75e7c7 100644 --- a/src/dusk/rpg/entity/entitydir.c +++ b/src/dusk/rpg/entity/entitydir.c @@ -30,7 +30,7 @@ void entityDirGetRelative( switch(from) { case ENTITY_DIR_NORTH: *outX = 0; - *outY = -1; + *outY = 1; break; case ENTITY_DIR_EAST: @@ -40,7 +40,7 @@ void entityDirGetRelative( case ENTITY_DIR_SOUTH: *outX = 0; - *outY = 1; + *outY = -1; break; case ENTITY_DIR_WEST: diff --git a/src/dusk/rpg/overworld/worldpos.h b/src/dusk/rpg/overworld/worldpos.h index 829a1a67..ca5711f2 100644 --- a/src/dusk/rpg/overworld/worldpos.h +++ b/src/dusk/rpg/overworld/worldpos.h @@ -8,6 +8,9 @@ #pragma once #include "dusk.h" +#define TILE_POS_MIN -128 +#define TILE_POS_MAX 127 + #define CHUNK_WIDTH 16 #define CHUNK_HEIGHT CHUNK_WIDTH #define CHUNK_DEPTH 8 @@ -39,6 +42,10 @@ typedef struct chunkpos_t { chunkunit_t x, y, z; } chunkpos_t; +typedef struct tilepos_s { + tileunit_t x, y, z; +} tilepos_t; + /** * Compares two world positions for equality. * diff --git a/src/dusk/scene/overworld/sceneoverworld.c b/src/dusk/scene/overworld/sceneoverworld.c index 05a42237..6ec815c9 100644 --- a/src/dusk/scene/overworld/sceneoverworld.c +++ b/src/dusk/scene/overworld/sceneoverworld.c @@ -62,7 +62,7 @@ errorret_t sceneOverworldRender(scenedata_t *sceneData) { float_t worldH = (float)SCREEN.height / pixelsPerUnit; float_t z = (worldH * 0.5f) / tanf(fov * 0.5f); worldpos_t worldPos = rpgCameraGetPosition(); - float_t offset = 16.0f; + float_t offset = -16.0f; vec3 worldPosVec = { worldPos.x, @@ -78,7 +78,7 @@ errorret_t sceneOverworldRender(scenedata_t *sceneData) { worldPosVec[2] + z }, worldPosVec, - (vec3){ 0, -1, 0 }, // up + (vec3){ 0, 1, 0 }, // up eye ); errorChain(shaderSetMatrix(&SHADER_UNLIT, SHADER_UNLIT_VIEW, eye));