ref: a305151302c38ca50aaf208ad72cca8e4c8c3c12
parent: a3692d1c40568de767d06a47b85490b8e3e89af2
author: Clownacy <Clownacy@users.noreply.github.com>
date: Wed Aug 5 17:47:50 EDT 2020
Apply some direction macros
--- a/src/Caret.cpp
+++ b/src/Caret.cpp
@@ -111,7 +111,7 @@
}
}
- if (crt->direct == 0)
+ if (crt->direct == DIR_LEFT)
crt->rect = rcLeft[crt->ani_no];
else
crt->rect = rcRight[crt->ani_no];
@@ -142,7 +142,7 @@
switch (crt->direct)
{
- case 0:
+ case DIR_LEFT:
crt->ym -= 0x10;
crt->y += crt->ym;
@@ -163,7 +163,7 @@
crt->rect = rect_left[crt->ani_no];
break;
- case 2:
+ case DIR_RIGHT:
if (++crt->ani_wait > 2)
{
crt->ani_wait = 0;
@@ -181,7 +181,7 @@
crt->rect = rect_right[crt->ani_no];
break;
- case 1:
+ case DIR_UP:
crt->rect = rect_up[++crt->ani_wait / 2 % 3];
if (crt->ani_wait > 24)
@@ -316,16 +316,16 @@
switch (crt->direct)
{
- case 0:
+ case DIR_LEFT:
crt->x -= 2 * 0x200;
break;
- case 1:
+ case DIR_UP:
crt->y -= 2 * 0x200;
break;
- case 2:
+ case DIR_RIGHT:
crt->x += 2 * 0x200;
break;
- case 3:
+ case DIR_DOWN:
crt->y += 2 * 0x200;
break;
}
@@ -337,7 +337,7 @@
RECT rcLeft = {16, 80, 32, 96};
RECT rcRight = {32, 80, 48, 96};
- if (crt->direct == 0)
+ if (crt->direct == DIR_LEFT)
crt->rect = rcLeft;
else
crt->rect = rcRight;
@@ -355,7 +355,7 @@
if (crt->ani_wait == 32)
crt->cond = 0;
- if (crt->direct == 0)
+ if (crt->direct == DIR_LEFT)
crt->rect = rcLeft;
else
crt->rect = rcRight;
@@ -376,7 +376,7 @@
++crt->ani_wait;
- if (crt->direct == 0)
+ if (crt->direct == DIR_LEFT)
{
if (crt->ani_wait < 20)
crt->y -= 2 * 0x200;
@@ -393,7 +393,7 @@
crt->cond = 0;
}
- if (crt->direct == 0)
+ if (crt->direct == DIR_LEFT)
crt->rect = rcLeft[crt->ani_wait / 2 % 2];
else
crt->rect = rcRight[crt->ani_wait / 2 % 2];