aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-03-30 08:23:15 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-03-30 08:23:15 +0200
commit638dbd0af112aa730c04af776fbd15dffee43337 (patch)
treef696eb3b3d01faed650368e4cedce3bddff2210c /src
parente9d69f90837c4cc688fc90b783db508e2dcc9f6f (diff)
downloadrts-638dbd0af112aa730c04af776fbd15dffee43337.tar.gz
Rename MAP_{X|Y} to MAP_{W|H}
Diffstat (limited to 'src')
-rw-r--r--src/camera/src/camera.c8
-rw-r--r--src/camera/src/pad.c4
-rw-r--r--src/terrain/inc/terrain.h4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/camera/src/camera.c b/src/camera/src/camera.c
index 4cc164c..0b96629 100644
--- a/src/camera/src/camera.c
+++ b/src/camera/src/camera.c
@@ -78,8 +78,8 @@ void camera_update_pos(struct camera *const cam)
if (cam->x > 0)
cam->x = 0;
- else if (cam->x < -MAP_X)
- cam->x = -MAP_X;
+ else if (cam->x < -MAP_W)
+ cam->x = -MAP_W;
const int y = cam->y + cam->y_speed;
@@ -87,8 +87,8 @@ void camera_update_pos(struct camera *const cam)
if (cam->y > 0)
cam->y = 0;
- else if (cam->y < -MAP_Y)
- cam->y = -MAP_Y;
+ else if (cam->y < -MAP_H)
+ cam->y = -MAP_H;
}
bool camera_translate(const struct camera *const cam, const struct util_rect *const dim,
diff --git a/src/camera/src/pad.c b/src/camera/src/pad.c
index b445e53..79c05ff 100644
--- a/src/camera/src/pad.c
+++ b/src/camera/src/pad.c
@@ -20,7 +20,7 @@ static void cursor_update(struct camera *const cam, const struct pad *const p)
c->x -= STEP;
else if (pad_pressed(p, PAD_KEY_RIGHT)
&& (c->x + STEP < screen_w)
- && (c->x != c->x_init || cam->x <= -MAP_X))
+ && (c->x != c->x_init || cam->x <= -MAP_W))
c->x += STEP;
if (pad_pressed(p, PAD_KEY_UP)
@@ -29,7 +29,7 @@ static void cursor_update(struct camera *const cam, const struct pad *const p)
c->y -= STEP;
else if (pad_pressed(p, PAD_KEY_DOWN)
&& (c->y + STEP < screen_h)
- && (c->y != c->y_init || cam->y <= -MAP_Y))
+ && (c->y != c->y_init || cam->y <= -MAP_H))
c->y += STEP;
c->state = pad_pressed(p, PAD_KEY_A) || pad_pressed(p, PAD_KEY_B) ?
diff --git a/src/terrain/inc/terrain.h b/src/terrain/inc/terrain.h
index d5f4e12..508fe25 100644
--- a/src/terrain/inc/terrain.h
+++ b/src/terrain/inc/terrain.h
@@ -14,8 +14,8 @@ enum
{
MAP_TILES = 64,
TERRAIN_SZ = 32,
- MAP_X = MAP_TILES * TERRAIN_SZ,
- MAP_Y = MAP_TILES * TERRAIN_SZ
+ MAP_W = MAP_TILES * TERRAIN_SZ,
+ MAP_H = MAP_TILES * TERRAIN_SZ
};
enum terrain_type