ref: 4be2ef394279c6cd607d235a1f9ecc1b42540ec5
parent: e7ad5271a4d5d0862dce9ca529b012fcef18a1e9
parent: bb065aa6973313e481b12f94ba9bda466508c24e
author: Cucky <44537737+cuckydev@users.noreply.github.com>
date: Tue Feb 19 14:43:10 EST 2019
Merge pull request #69 from Clownacy/master A bugfix, and made the project C++98-compatible
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@
LIBS += -lkernel32
endif
-CXXFLAGS += `sdl2-config --cflags` `pkg-config freetype2 --cflags` -MMD -MP -MF $@.d
+CXXFLAGS += -std=c++98 `sdl2-config --cflags` `pkg-config freetype2 --cflags` -MMD -MP -MF $@.d
LIBS += `sdl2-config --static-libs` `pkg-config freetype2 --libs`
ifeq ($(STATIC), 1)
@@ -110,11 +110,11 @@
PixTone \
Profile \
Resource \
+ SelStage \
Shoot \
Sound \
Stage \
Star \
- SelStage \
TextScr \
Triangle \
ValueView
--- a/src/BossAlmo1.cpp
+++ b/src/BossAlmo1.cpp
@@ -13,13 +13,13 @@
static void ActBossChar_Core_Face(NPCHAR *npc)
{- RECT rect[4];
+ RECT rect[4] = {+ {0, 0, 72, 112},+ {0, 112, 72, 224},+ {160, 0, 232, 112},+ {0, 0, 0, 0},+ };
- rect[0] = {0, 0, 72, 112};- rect[1] = {0, 112, 72, 224};- rect[2] = {160, 0, 232, 112};- rect[3] = {0, 0, 0, 0};-
switch (npc->act_no)
{case 10:
@@ -62,12 +62,12 @@
static void ActBossChar_Core_Tail(NPCHAR *npc)
{- RECT rect[3];
+ RECT rect[3] = {+ {72, 0, 160, 112},+ {72, 112, 160, 224},+ {0, 0, 0, 0},+ };
- rect[0] = {72, 0, 160, 112};- rect[1] = {72, 112, 160, 224};- rect[2] = {0, 0, 0, 0};-
switch (npc->act_no)
{case 10:
@@ -110,11 +110,11 @@
static void ActBossChar_Core_Mini(NPCHAR *npc)
{- RECT rect[3];
-
- rect[0] = {256, 0, 320, 40};- rect[1] = {256, 40, 320, 80};- rect[2] = {256, 80, 320, 120};+ RECT rect[3] = {+ {256, 0, 320, 40},+ {256, 40, 320, 80},+ {256, 80, 320, 120},+ };
npc->life = 1000;
--- a/src/BossAlmo2.cpp
+++ b/src/BossAlmo2.cpp
@@ -14,13 +14,13 @@
static void ActBossCharA_Head(NPCHAR *npc)
{- RECT rect[4];
+ RECT rect[4] = {+ {0, 0, 72, 112},+ {0, 112, 72, 224},+ {160, 0, 232, 112},+ {0, 0, 0, 0},+ };
- rect[0] = {0, 0, 72, 112};- rect[1] = {0, 112, 72, 224};- rect[2] = {160, 0, 232, 112};- rect[3] = {0, 0, 0, 0};-
switch (npc->act_no)
{case 10:
@@ -61,12 +61,12 @@
static void ActBossCharA_Tail(NPCHAR *npc)
{- RECT rect[3];
+ RECT rect[3] = {+ {72, 0, 160, 112},+ {72, 112, 160, 224},+ {0, 0, 0, 0},+ };
- rect[0] = {72, 0, 160, 112};- rect[1] = {72, 112, 160, 224};- rect[2] = {0, 0, 0, 0};-
switch (npc->act_no)
{case 10:
@@ -107,14 +107,14 @@
static void ActBossCharA_Face(NPCHAR *npc)
{- RECT rect[5];
+ RECT rect[5] = {+ {0, 0, 0, 0},+ {160, 112, 232, 152},+ {160, 152, 232, 192},+ {160, 192, 232, 232},+ {248, 160, 320, 200},+ };
- rect[0] = {0, 0, 0, 0};- rect[1] = {160, 112, 232, 152};- rect[2] = {160, 152, 232, 192};- rect[3] = {160, 192, 232, 232};- rect[4] = {248, 160, 320, 200};-
switch (npc->act_no)
{case 0:
@@ -172,11 +172,11 @@
static void ActBossCharA_Mini(NPCHAR *npc)
{- RECT rect[3];
-
- rect[0] = {256, 0, 320, 40};- rect[1] = {256, 40, 320, 80};- rect[2] = {256, 80, 320, 120};+ RECT rect[3] = {+ {256, 0, 320, 40},+ {256, 40, 320, 80},+ {256, 80, 320, 120},+ };
if (npc->cond)
{--- a/src/BossBallos.cpp
+++ b/src/BossBallos.cpp
@@ -13,21 +13,22 @@
static void ActBossChar_Eye(NPCHAR *npc)
{- RECT rcLeft[5];
- RECT rcRight[5];
+ RECT rcLeft[5] = {+ {272, 0, 296, 16},+ {272, 16, 296, 32},+ {272, 32, 296, 48},+ {0, 0, 0, 0},+ {240, 16, 264, 32},+ };
- rcLeft[0] = {272, 0, 296, 16};- rcLeft[1] = {272, 16, 296, 32};- rcLeft[2] = {272, 32, 296, 48};- rcLeft[3] = {0, 0, 0, 0};- rcLeft[4] = {240, 16, 264, 32};+ RECT rcRight[5] = {+ {296, 0, 320, 16},+ {296, 16, 320, 32},+ {296, 32, 320, 48},+ {0, 0, 0, 0},+ {240, 32, 264, 48},+ };
- rcRight[0] = {296, 0, 320, 16};- rcRight[1] = {296, 16, 320, 32};- rcRight[2] = {296, 32, 320, 48};- rcRight[3] = {0, 0, 0, 0};- rcRight[4] = {240, 32, 264, 48};-
switch (npc->act_no)
{case 100:
@@ -103,12 +104,12 @@
static void ActBossChar_Body(NPCHAR *npc)
{- RECT rc[4];
-
- rc[0] = {0, 0, 120, 120};- rc[1] = {120, 0, 240, 120};- rc[2] = {0, 120, 120, 240};- rc[3] = {120, 120, 240, 240};+ RECT rc[4] = {+ {0, 0, 120, 120},+ {120, 0, 240, 120},+ {0, 120, 120, 240},+ {120, 120, 240, 240},+ };
npc->x = gBoss[0].x;
npc->y = gBoss[0].y;
--- a/src/BossFrog.cpp
+++ b/src/BossFrog.cpp
@@ -78,28 +78,29 @@
void ActBossChar_Frog(void)
{- RECT rcLeft[9];
- RECT rcRight[9];
+ RECT rcLeft[9] = {+ {0, 0, 0, 0},+ {0, 48, 80, 112},+ {0, 112, 80, 176},+ {0, 176, 80, 240},+ {160, 48, 240, 112},+ {160, 112, 240, 200},+ {200, 0, 240, 24},+ {80, 0, 120, 24},+ {120, 0, 160, 24},+ };
- rcLeft[0] = {0, 0, 0, 0};- rcLeft[1] = {0, 48, 80, 112};- rcLeft[2] = {0, 112, 80, 176};- rcLeft[3] = {0, 176, 80, 240};- rcLeft[4] = {160, 48, 240, 112};- rcLeft[5] = {160, 112, 240, 200};- rcLeft[6] = {200, 0, 240, 24};- rcLeft[7] = {80, 0, 120, 24};- rcLeft[8] = {120, 0, 160, 24};-
- rcRight[0] = {0, 0, 0, 0};- rcRight[1] = {80, 48, 160, 112};- rcRight[2] = {80, 112, 160, 176};- rcRight[3] = {80, 176, 160, 240};- rcRight[4] = {240, 48, 320, 112};- rcRight[5] = {240, 112, 320, 200};- rcRight[6] = {200, 24, 240, 48};- rcRight[7] = {80, 24, 120, 48};- rcRight[8] = {120, 24, 160, 48};+ RECT rcRight[9] = {+ {0, 0, 0, 0},+ {80, 48, 160, 112},+ {80, 112, 160, 176},+ {80, 176, 160, 240},+ {240, 48, 320, 112},+ {240, 112, 320, 200},+ {200, 24, 240, 48},+ {80, 24, 120, 48},+ {120, 24, 160, 48},+ };
switch (gBoss[0].act_no)
{--- a/src/BossIronH.cpp
+++ b/src/BossIronH.cpp
@@ -169,28 +169,29 @@
break;
}
- RECT rc[9];
- RECT rcDamage[9];
+ RECT rc[9] = {+ {0, 0, 64, 24},+ {64, 0, 128, 24},+ {128, 0, 192, 24},+ {64, 0, 128, 24},+ {0, 0, 64, 24},+ {192, 0, 256, 24},+ {256, 0, 320, 24},+ {192, 0, 256, 24},+ {256, 48, 320, 72},+ };
- rc[0] = {0, 0, 64, 24};- rc[1] = {64, 0, 128, 24};- rc[2] = {128, 0, 192, 24};- rc[3] = {64, 0, 128, 24};- rc[4] = {0, 0, 64, 24};- rc[5] = {192, 0, 256, 24};- rc[6] = {256, 0, 320, 24};- rc[7] = {192, 0, 256, 24};- rc[8] = {256, 48, 320, 72};-
- rcDamage[0] = {0, 24, 64, 48};- rcDamage[1] = {64, 24, 128, 48};- rcDamage[2] = {128, 24, 192, 48};- rcDamage[3] = {64, 24, 128, 48};- rcDamage[4] = {0, 24, 64, 48};- rcDamage[5] = {192, 24, 256, 48};- rcDamage[6] = {256, 24, 320, 48};- rcDamage[7] = {192, 24, 256, 48};- rcDamage[8] = {256, 48, 320, 72};+ RECT rcDamage[9] = {+ {0, 24, 64, 48},+ {64, 24, 128, 48},+ {128, 24, 192, 48},+ {64, 24, 128, 48},+ {0, 24, 64, 48},+ {192, 24, 256, 48},+ {256, 24, 320, 48},+ {192, 24, 256, 48},+ {256, 48, 320, 72},+ };
if (gBoss[0].shock)
{--- a/src/BossOhm.cpp
+++ b/src/BossOhm.cpp
@@ -15,10 +15,8 @@
void ActBoss01_12()
{- RECT rcLeft[1];
- RECT rcRight[1];
- rcLeft[0] = {80, 56, 104, 72};- rcRight[0] = {104, 56, 128, 72};+ RECT rcLeft[1] = {80, 56, 104, 72};+ RECT rcRight[1] = {104, 56, 128, 72};for (int i = 1; i <= 2; i++)
{@@ -39,13 +37,15 @@
void ActBoss01_34()
{- RECT rcRight[2];
- RECT rcLeft[2];
+ RECT rcLeft[2] = {+ {0, 56, 40, 88},+ {40, 56, 80, 88},+ };
- rcLeft[0] = { 0, 56, 40, 88 };- rcLeft[1] = { 40, 56, 80, 88 };- rcRight[0] = { 0, 88, 40, 120 };- rcRight[1] = { 40, 88, 80, 120 };+ RECT rcRight[2] = {+ { 0, 88, 40, 120 },+ { 40, 88, 80, 120 },+ };
for (int i = 3; i <= 4; i++)
{@@ -79,19 +79,24 @@
gBoss[i].count2 = !((gBoss[i].flag & 8) && gBoss[i].y > gBoss[i].tgt_y);
- if (gBoss[i].direct)
- gBoss[i].rect = rcRight[gBoss[i].count2];
- else
+ if (gBoss[i].direct == 0)
gBoss[i].rect = rcLeft[gBoss[i].count2];
+ else
+ gBoss[i].rect = rcRight[gBoss[i].count2];
}
}
void ActBoss01_5()
{- if (!gBoss[5].act_no)
+ if (gBoss[5].act_no == 0)
{gBoss[5].bits |= npc_solidSoft | npc_ignoreSolid;
- gBoss[5].hit = { 0x2800, 0x4800, 0x2800, 0x2000 };+
+ gBoss[5].hit.front = 0x2800;
+ gBoss[5].hit.top = 0x4800;
+ gBoss[5].hit.back = 0x2800;
+ gBoss[5].hit.bottom = 0x2000;
+
gBoss[5].act_no = 1;
}
@@ -110,7 +115,10 @@
gBoss[0].x = 0x1B6000;
gBoss[0].y = 0x20000;
- gBoss[0].view = { 0x5000, 0x5000, 0x5000, 0x2000 };+ gBoss[0].view.front = 0x5000;
+ gBoss[0].view.top = 0x5000;
+ gBoss[0].view.back = 0x5000;
+ gBoss[0].view.bottom = 0x2000;
gBoss[0].tgt_x = 0x1B6000;
gBoss[0].tgt_y = 0x20000;
@@ -117,7 +125,10 @@
gBoss[0].hit_voice = 52;
- gBoss[0].hit = { 0x1000, 0x3000, 0x1000, 0x2000 };+ gBoss[0].hit.front = 0x1000;
+ gBoss[0].hit.top = 0x3000;
+ gBoss[0].hit.back = 0x1000;
+ gBoss[0].hit.bottom = 0x2000;
gBoss[0].bits = (npc_ignoreSolid | npc_eventDie | npc_showDamage);
gBoss[0].size = 3;
@@ -126,7 +137,12 @@
gBoss[0].life = 400;
gBoss[1].cond = 0x80;
- gBoss[1].view = { 0x1800, 0x1000, 0x1800, 0x1000 };+
+ gBoss[1].view.front = 0x1800;
+ gBoss[1].view.top = 0x1000;
+ gBoss[1].view.back = 0x1800;
+ gBoss[1].view.bottom = 0x1000;
+
gBoss[1].bits = npc_ignoreSolid;
memcpy(&gBoss[2], &gBoss[1], sizeof(gBoss[2]));
@@ -135,9 +151,19 @@
gBoss[2].direct = 2;
gBoss[3].cond = 0x80;
- gBoss[3].view = { 0x3000, 0x2000, 0x2000, 0x2000 };+
+ gBoss[3].view.front = 0x3000;
+ gBoss[3].view.top = 0x2000;
+ gBoss[3].view.back = 0x2000;
+ gBoss[3].view.bottom = 0x2000;
+
gBoss[3].hit_voice = 52;
- gBoss[3].hit = { 0x1000, 0x1000, 0x1000, 0x1000 };+
+ gBoss[3].hit.front = 0x1000;
+ gBoss[3].hit.top = 0x1000;
+ gBoss[3].hit.back = 0x1000;
+ gBoss[3].hit.bottom = 0x1000;
+
gBoss[3].bits = npc_ignoreSolid;
gBoss[3].y = gBoss[0].y;
@@ -205,8 +231,8 @@
gBoss[0].act_no = 60;
gBoss[0].act_wait = 0;
gBoss[0].bits |= npc_shootable;
- gBoss[0].hit.left = 0x2000;
- gBoss[0].hit.right = 0x2000;
+ gBoss[0].hit.front = 0x2000;
+ gBoss[0].hit.back = 0x2000;
}
break;
@@ -249,8 +275,8 @@
gBoss[0].bits &= ~npc_shootable;
- gBoss[0].hit.left = 0x3000;
- gBoss[0].hit.right = 0x3000;
+ gBoss[0].hit.front = 0x3000;
+ gBoss[0].hit.back = 0x3000;
gBoss[5].hit.top = 0x4800;
gBoss[0].damage = 0;
@@ -301,8 +327,8 @@
{gBoss[0].act_no = 120;
gBoss[0].act_wait = 0;
- gBoss[0].hit.left = 0x2000;
- gBoss[0].hit.right = 0x2000;
+ gBoss[0].hit.front = 0x2000;
+ gBoss[0].hit.back = 0x2000;
}
break;
@@ -337,8 +363,8 @@
gBoss[0].act_no = 140;
gBoss[0].bits |= npc_shootable;
- gBoss[0].hit.left = 0x2000;
- gBoss[0].hit.right = 0x2000;
+ gBoss[0].hit.front = 0x2000;
+ gBoss[0].hit.back = 0x2000;
gBoss[0].ym = -0x5FF;
@@ -420,24 +446,12 @@
break;
}
- RECT rect[4];
-
- rect[0].left = 0;
- rect[0].top = 0;
- rect[0].right = 80;
- rect[0].bottom = 56;
- rect[1].left = 80;
- rect[1].top = 0;
- rect[1].right = 160;
- rect[1].bottom = 56;
- rect[2].left = 160;
- rect[2].top = 0;
- rect[2].right = 240;
- rect[2].bottom = 56;
- rect[3].left = 80;
- rect[3].top = 0;
- rect[3].right = 160;
- rect[3].bottom = 56;
+ RECT rect[4] = {+ {0, 0, 80, 56},+ {80, 0, 160, 56},+ {160, 0, 240, 56},+ {80, 0, 160, 56},+ };
gBoss[0].rect = rect[gBoss[0].count2];
--- a/src/BossPress.cpp
+++ b/src/BossPress.cpp
@@ -196,22 +196,23 @@
gBoss[3].x = gBoss[0].x;
gBoss[3].y = gBoss[0].y + 0x5000;
- RECT rc[3];
- RECT rcDamage[3];
+ RECT rc[3] = {+ {0, 0, 80, 120},+ {80, 0, 160, 120},+ {160, 0, 240, 120},+ };
- rc[0] = {0, 0, 80, 120};- rc[1] = {80, 0, 160, 120};- rc[2] = {160, 0, 240, 120};+ RECT rcDamage[3] = {+ {0, 120, 80, 240},+ {80, 120, 160, 240},+ {160, 120, 240, 240},+ };
- rcDamage[0] = {0, 120, 80, 240};- rcDamage[1] = {80, 120, 160, 240};- rcDamage[2] = {160, 120, 240, 240};-
if (gBoss[0].shock)
{static unsigned char flash;
- if ((++flash >> 1) & 1)
+ if ((++flash / 2) % 2)
gBoss[0].rect = rc[gBoss[0].ani_no];
else
gBoss[0].rect = rcDamage[gBoss[0].ani_no];
--- a/src/BossTwinD.cpp
+++ b/src/BossTwinD.cpp
@@ -12,17 +12,18 @@
static void ActBossCharT_DragonBody(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {0, 0, 40, 40},+ {40, 0, 80, 40},+ {80, 0, 120, 40},+ };
- rcLeft[0] = {0, 0, 40, 40};- rcLeft[1] = {40, 0, 80, 40};- rcLeft[2] = {80, 0, 120, 40};+ RECT rcRight[3] = {+ {0, 40, 40, 80},+ {40, 40, 80, 80},+ {80, 40, 120, 80},+ };
- rcRight[0] = {0, 40, 40, 80};- rcRight[1] = {40, 40, 80, 80};- rcRight[2] = {80, 40, 120, 80};-
unsigned char deg;
switch (npc->act_no)
{@@ -90,18 +91,19 @@
static void ActBossCharT_DragonHead(NPCHAR *npc)
{- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {0, 80, 40, 112},+ {40, 80, 80, 112},+ {80, 80, 120, 112},+ {120, 80, 160, 112},+ };
- rcLeft[0] = {0, 80, 40, 112};- rcLeft[1] = {40, 80, 80, 112};- rcLeft[2] = {80, 80, 120, 112};- rcLeft[3] = {120, 80, 160, 112};-
- rcRight[0] = {0, 112, 40, 144};- rcRight[1] = {40, 112, 80, 144};- rcRight[2] = {80, 112, 120, 144};- rcRight[3] = {120, 112, 160, 144};+ RECT rcRight[4] = {+ {0, 112, 40, 144},+ {40, 112, 80, 144},+ {80, 112, 120, 144},+ {120, 112, 160, 144},+ };
switch (npc->act_no)
{--- a/src/BossX.cpp
+++ b/src/BossX.cpp
@@ -13,23 +13,24 @@
static void ActBossChar03_01(NPCHAR *npc)
{- RECT rcUp[6];
- RECT rcDown[6];
+ RECT rcUp[6] = {+ {0, 0, 72, 32},+ {0, 32, 72, 64},+ {72, 0, 144, 32},+ {144, 0, 216, 32},+ {72, 32, 144, 64},+ {144, 32, 216, 64},+ };
- rcUp[0] = {0, 0, 72, 32};- rcUp[1] = {0, 32, 72, 64};- rcUp[2] = {72, 0, 144, 32};- rcUp[3] = {144, 0, 216, 32};- rcUp[4] = {72, 32, 144, 64};- rcUp[5] = {144, 32, 216, 64};+ RECT rcDown[6] = {+ {0, 64, 72, 96},+ {0, 96, 72, 128},+ {72, 64, 144, 96},+ {144, 64, 216, 96},+ {72, 96, 144, 128},+ {144, 96, 216, 128},+ };
- rcDown[0] = {0, 64, 72, 96};- rcDown[1] = {0, 96, 72, 128};- rcDown[2] = {72, 64, 144, 96};- rcDown[3] = {144, 64, 216, 96};- rcDown[4] = {72, 96, 144, 128};- rcDown[5] = {144, 96, 216, 128};-
switch (npc->act_no)
{case 10:
@@ -211,13 +212,13 @@
static void ActBossChar03_02(NPCHAR *npc)
{- RECT rect[4];
+ RECT rect[4] = {+ {0, 128, 72, 160},+ {72, 128, 144, 160},+ {0, 160, 72, 192},+ {72, 160, 144, 192},+ };
- rect[0] = {0, 128, 72, 160};- rect[1] = {72, 128, 144, 160};- rect[2] = {0, 160, 72, 192};- rect[3] = {72, 160, 144, 192};-
switch (npc->act_no)
{case 10:
@@ -360,17 +361,17 @@
static void ActBossChar03_04(NPCHAR *npc)
{- RECT rect[8];
+ RECT rect[8] = {+ {0, 192, 16, 208},+ {16, 192, 32, 208},+ {32, 192, 48, 208},+ {48, 192, 64, 208},+ {0, 208, 16, 224},+ {16, 208, 32, 224},+ {32, 208, 48, 224},+ {48, 208, 64, 224},+ };
- rect[0] = {0, 192, 16, 208};- rect[1] = {16, 192, 32, 208};- rect[2] = {32, 192, 48, 208};- rect[3] = {48, 192, 64, 208};- rect[4] = {0, 208, 16, 224};- rect[5] = {16, 208, 32, 224};- rect[6] = {32, 208, 48, 224};- rect[7] = {48, 208, 64, 224};-
switch (npc->act_no)
{case 0:
@@ -428,11 +429,11 @@
static void ActBossChar03_face(NPCHAR *npc)
{- RECT rect[3];
-
- rect[0] = {216, 0, 320, 48};- rect[1] = {216, 48, 320, 96};- rect[2] = {216, 144, 320, 192};+ RECT rect[3] = {+ {216, 0, 320, 48},+ {216, 48, 320, 96},+ {216, 144, 320, 192},+ };
switch (npc->act_no)
{--- a/src/Bullet.cpp
+++ b/src/Bullet.cpp
@@ -217,19 +217,20 @@
if (bul->ani_no > 3)
bul->ani_no = 0;
- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {136, 80, 152, 80},+ {120, 80, 136, 96},+ {136, 64, 152, 80},+ {120, 64, 136, 80},+ };
- rcLeft[0] = {136, 80, 152, 80};- rcLeft[1] = {120, 80, 136, 96};- rcLeft[2] = {136, 64, 152, 80};- rcLeft[3] = {120, 64, 136, 80};+ RECT rcRight[4] = {+ {120, 64, 136, 80},+ {136, 64, 152, 80},+ {120, 80, 136, 96},+ {136, 80, 152, 80},+ };
- rcRight[0] = {120, 64, 136, 80};- rcRight[1] = {136, 64, 152, 80};- rcRight[2] = {120, 80, 136, 96};- rcRight[3] = {136, 80, 152, 80};-
if (bul->direct == 0)
bul->rect = rcLeft[bul->ani_no];
else
@@ -349,12 +350,12 @@
if ( bul->ani_no > 2 )
bul->ani_no = 0;
- RECT rect[3];
+ RECT rect[3] = {+ {192, 16, 208, 32},+ {208, 16, 224, 32},+ {224, 16, 240, 32},+ };
- rect[0] = {192, 16, 208, 32};- rect[1] = {208, 16, 224, 32};- rect[2] = {224, 16, 240, 32};-
bul->rect = rect[bul->ani_no];
if (level == 2)
@@ -438,21 +439,52 @@
{case 1:
if (bul->direct != 1 && bul->direct != 3)
- bul->rect = {128, 32, 144, 48};+ {+ bul->rect.left = 128;
+ bul->rect.top = 32;
+ bul->rect.right = 144;
+ bul->rect.bottom = 48;
+ }
else
- bul->rect = {144, 32, 160, 48};+ {+ bul->rect.left = 144;
+ bul->rect.top = 32;
+ bul->rect.right = 160;
+ bul->rect.bottom = 48;
+ }
break;
case 2:
if (bul->direct != 1 && bul->direct != 3)
- bul->rect = {160, 32, 176, 48};+ {+ bul->rect.left = 160;
+ bul->rect.top = 32;
+ bul->rect.right = 176;
+ bul->rect.bottom = 48;
+ }
else
- bul->rect = {176, 32, 192, 48};+ {+ bul->rect.left = 176;
+ bul->rect.top = 32;
+ bul->rect.right = 192;
+ bul->rect.bottom = 48;
+
+ }
break;
case 3:
if (bul->direct != 1 && bul->direct != 3)
- bul->rect = {128, 48, 144, 64};+ {+ bul->rect.left = 128;
+ bul->rect.top = 48;
+ bul->rect.right = 144;
+ bul->rect.bottom = 64;
+ }
else
- bul->rect = {144, 48, 160, 64};+ {+ bul->rect.left = 144;
+ bul->rect.top = 48;
+ bul->rect.right = 160;
+ bul->rect.bottom = 64;
+ }
break;
}
}
@@ -544,24 +576,31 @@
}
}
- RECT rect_left1[4];
- RECT rect_right1[4];
- RECT rect_left2[3];
- RECT rect_right2[3];
- rect_left1[0] = {128, 0, 144, 16};- rect_left1[1] = {144, 0, 160, 16};- rect_left1[2] = {160, 0, 176, 16};- rect_left1[3] = {176, 0, 192, 16};- rect_right1[0] = {128, 16, 144, 32};- rect_right1[1] = {144, 16, 160, 32};- rect_right1[2] = {160, 16, 176, 32};- rect_right1[3] = {176, 16, 192, 32};- rect_left2[0] = {192, 16, 208, 32};- rect_left2[1] = {208, 16, 224, 32};- rect_left2[2] = {224, 16, 240, 32};- rect_right2[0] = {224, 16, 240, 32};- rect_right2[1] = {208, 16, 224, 32};- rect_right2[2] = {192, 16, 208, 32};+ RECT rect_left1[4] = {+ {128, 0, 144, 16},+ {144, 0, 160, 16},+ {160, 0, 176, 16},+ {176, 0, 192, 16},+ };
+
+ RECT rect_right1[4] = {+ {128, 16, 144, 32},+ {144, 16, 160, 32},+ {160, 16, 176, 32},+ {176, 16, 192, 32},+ };
+
+ RECT rect_left2[3] = {+ {192, 16, 208, 32},+ {208, 16, 224, 32},+ {224, 16, 240, 32},+ };
+
+ RECT rect_right2[3] = {+ {224, 16, 240, 32},+ {208, 16, 224, 32},+ {192, 16, 208, 32},+ };
bul->ani_no++;
@@ -601,25 +640,34 @@
void ActBullet_MachineGun(BULLET *bul, int level)
{- RECT rect1[4];
- RECT rect2[4];
- RECT rect3[4];
-
- rect1[0] = {64, 0, 80, 16};- rect1[1] = {80, 0, 96, 16};- rect1[2] = {96, 0, 112, 16};- rect1[3] = {112, 0, 128, 16};- rect2[0] = {64, 16, 80, 32};- rect2[1] = {80, 16, 96, 32};- rect2[2] = {96, 16, 112, 32};- rect2[3] = {112, 16, 128, 32};- rect3[0] = {64, 32, 80, 48};- rect3[1] = {80, 32, 96, 48};- rect3[2] = {96, 32, 112, 48};- rect3[3] = {112, 32, 128, 48};-
- if (++bul->count1 <= bul->life_count)
+ RECT rect1[4] = {+ {64, 0, 80, 16},+ {80, 0, 96, 16},+ {96, 0, 112, 16},+ {112, 0, 128, 16},+ };
+
+ RECT rect2[4] = {+ {64, 16, 80, 32},+ {80, 16, 96, 32},+ {96, 16, 112, 32},+ {112, 16, 128, 32},+ };
+
+ RECT rect3[4] = {+ {64, 32, 80, 48},+ {80, 32, 96, 48},+ {96, 32, 112, 48},+ {112, 32, 128, 48},+ };
+
+ if (++bul->count1 > bul->life_count)
{+ bul->cond = 0;
+ SetCaret(bul->x, bul->y, 3, 0);
+ }
+ else
+ {if (bul->act_no)
{bul->x += bul->xm;
@@ -682,11 +730,6 @@
}
}
}
- else
- {- bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
- }
}
void ActBullet_Missile(BULLET *bul, int level)
@@ -864,25 +907,27 @@
}
}
- RECT rect1[4];
- RECT rect2[4];
- RECT rect3[4];
+ RECT rect1[4] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ {32, 0, 48, 16},+ {48, 0, 64, 16},+ };
- rect1[0] = {0, 0, 16, 16};- rect1[1] = {16, 0, 32, 16};- rect1[2] = {32, 0, 48, 16};- rect1[3] = {48, 0, 64, 16};+ RECT rect2[4] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ {32, 16, 48, 32},+ {48, 16, 64, 32},+ };
- rect2[0] = {0, 16, 16, 32};- rect2[1] = {16, 16, 32, 32};- rect2[2] = {32, 16, 48, 32};- rect2[3] = {48, 16, 64, 32};+ RECT rect3[4] = {+ {0, 32, 16, 48},+ {16, 32, 32, 48},+ {32, 32, 48, 48},+ {48, 32, 64, 48},+ };
- rect3[0] = {0, 32, 16, 48};- rect3[1] = {16, 32, 32, 48};- rect3[2] = {32, 32, 48, 48};- rect3[3] = {48, 32, 64, 48};-
switch (level)
{case 1:
@@ -1016,13 +1061,13 @@
SetCaret(bul->x, bul->y, 15, 0);
}
- RECT rect[4];
+ RECT rect[4] = {+ {192, 0, 200, 8},+ {200, 0, 208, 8},+ {208, 0, 216, 8},+ {216, 0, 224, 8},+ };
- rect[0] = {192, 0, 200, 8};- rect[1] = {200, 0, 208, 8};- rect[2] = {208, 0, 216, 8};- rect[3] = {216, 0, 224, 8};-
if (++bul->ani_wait > 3)
{bul->ani_wait = 0;
@@ -1106,13 +1151,13 @@
SetCaret(bul->x, bul->y, 15, 0);
}
- RECT rect[4];
+ RECT rect[4] = {+ {192, 8, 200, 16},+ {200, 8, 208, 16},+ {208, 8, 216, 16},+ {216, 8, 224, 16},+ };
- rect[0] = {192, 8, 200, 16};- rect[1] = {200, 8, 208, 16};- rect[2] = {208, 8, 216, 16};- rect[3] = {216, 8, 224, 16};-
if (++bul->ani_wait > 3)
{bul->ani_wait = 0;
@@ -1178,13 +1223,13 @@
bul->x += bul->xm;
bul->y += bul->ym;
- RECT rect[4];
+ RECT rect[4] = {+ {240, 16, 248, 24},+ {248, 16, 256, 24},+ {240, 24, 248, 32},+ {248, 24, 256, 32},+ };
- rect[0] = {240, 16, 248, 24};- rect[1] = {248, 16, 256, 24};- rect[2] = {240, 24, 248, 32};- rect[3] = {248, 24, 256, 32};-
if (++bul->ani_wait > 3)
{bul->ani_wait = 0;
@@ -1255,19 +1300,21 @@
if (bul->ani_no > 1)
bul->ani_no = 0;
- RECT rcLeft[2];
- RECT rcRight[2];
- RECT rcDown[2];
+ RECT rcLeft[2] = {+ {224, 0, 232, 8},+ {232, 0, 240, 8},+ };
- rcLeft[0] = {224, 0, 232, 8};- rcLeft[1] = {232, 0, 240, 8};+ RECT rcRight[2] = {+ {224, 0, 232, 8},+ {232, 0, 240, 8},+ };
- rcRight[0] = {224, 0, 232, 8};- rcRight[1] = {232, 0, 240, 8};+ RECT rcDown[2] = {+ {224, 8, 232, 16},+ {232, 8, 240, 16},+ };
- rcDown[0] = {224, 8, 232, 16};- rcDown[1] = {232, 8, 240, 16};-
switch (bul->direct)
{case 0:
@@ -1327,19 +1374,20 @@
}
}
- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {0, 48, 16, 64},+ {16, 48, 32, 64},+ {32, 48, 48, 64},+ {48, 48, 64, 64},+ };
- rcLeft[0] = {0, 48, 16, 64};- rcLeft[1] = {16, 48, 32, 64};- rcLeft[2] = {32, 48, 48, 64};- rcLeft[3] = {48, 48, 64, 64};+ RECT rcRight[4] = {+ {64, 48, 80, 64},+ {80, 48, 96, 64},+ {96, 48, 112, 64},+ {112, 48, 128, 64},+ };
- rcRight[0] = {64, 48, 80, 64};- rcRight[1] = {80, 48, 96, 64};- rcRight[2] = {96, 48, 112, 64};- rcRight[3] = {112, 48, 128, 64};-
if (++bul->ani_wait > 1)
{bul->ani_wait = 0;
@@ -1397,19 +1445,20 @@
}
}
- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {160, 48, 184, 72},+ {184, 48, 208, 72},+ {208, 48, 232, 72},+ {232, 48, 256, 72},+ };
- rcLeft[0] = {160, 48, 184, 72};- rcLeft[1] = {184, 48, 208, 72};- rcLeft[2] = {208, 48, 232, 72};- rcLeft[3] = {232, 48, 256, 72};+ RECT rcRight[4] = {+ {160, 72, 184, 96},+ {184, 72, 208, 96},+ {208, 72, 232, 96},+ {232, 72, 256, 96},+ };
- rcRight[0] = {160, 72, 184, 96};- rcRight[1] = {184, 72, 208, 96};- rcRight[2] = {208, 72, 232, 96};- rcRight[3] = {232, 72, 256, 96};-
if (++bul->ani_wait > 1)
{bul->ani_wait = 0;
@@ -1428,23 +1477,26 @@
void ActBullet_Sword3(BULLET *bul)
{- RECT rcLeft[2];
- RECT rcUp[2];
- RECT rcDown[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {272, 0, 296, 24},+ {296, 0, 320, 24},+ };
- rcLeft[0] = {272, 0, 296, 24};- rcLeft[1] = {296, 0, 320, 24};+ RECT rcUp[2] = {+ {272, 48, 296, 72},+ {296, 0, 320, 24},+ };
- rcUp[0] = {272, 48, 296, 72};- rcUp[1] = {296, 0, 320, 24};+ RECT rcRight[2] = {+ {272, 24, 296, 48},+ {296, 24, 320, 48},+ };
- rcRight[0] = {272, 24, 296, 48};- rcRight[1] = {296, 24, 320, 48};+ RECT rcDown[2] = {+ {296, 48, 320, 72},+ {296, 24, 320, 48},+ };
- rcDown[0] = {296, 48, 320, 72};- rcDown[1] = {296, 24, 320, 48};-
switch (bul->act_no)
{case 0:
@@ -1543,9 +1595,6 @@
void ActBullet_Edge(BULLET *bul)
{- RECT rcLeft[5];
- RECT rcRight[5];
-
switch (bul->act_no)
{case 0:
@@ -1582,17 +1631,21 @@
break;
}
- rcLeft[0] = {0, 64, 24, 88};- rcLeft[1] = {24, 64, 48, 88};- rcLeft[2] = {48, 64, 72, 88};- rcLeft[3] = {72, 64, 96, 88};- rcLeft[4] = {96, 64, 120, 88};+ RECT rcLeft[5] = {+ {0, 64, 24, 88},+ {24, 64, 48, 88},+ {48, 64, 72, 88},+ {72, 64, 96, 88},+ {96, 64, 120, 88},+ };
- rcRight[0] = {0, 88, 24, 112};- rcRight[1] = {24, 88, 48, 112};- rcRight[2] = {48, 88, 72, 112};- rcRight[3] = {72, 88, 96, 112};- rcRight[4] = {96, 88, 120, 112};+ RECT rcRight[5] = {+ {0, 88, 24, 112},+ {24, 88, 48, 112},+ {48, 88, 72, 112},+ {72, 88, 96, 112},+ {96, 88, 120, 112},+ };
if (bul->direct == 0)
bul->rect = rcLeft[bul->ani_no];
@@ -1602,10 +1655,8 @@
void ActBullet_Drop(BULLET *bul)
{- RECT rc[1];
+ RECT rc[1] = {0, 0, 0, 0};- rc[0] = {0, 0, 0, 0};-
if (++bul->act_wait > 2)
bul->cond = 0;
@@ -1792,19 +1843,20 @@
}
}
- RECT rect1[4];
- RECT rect2[4];
+ RECT rect1[4] = {+ {120, 96, 136, 112},+ {136, 96, 152, 112},+ {152, 96, 168, 112},+ {168, 96, 184, 112},+ };
- rect1[0] = {120, 96, 136, 112};- rect1[1] = {136, 96, 152, 112};- rect1[2] = {152, 96, 168, 112};- rect1[3] = {168, 96, 184, 112};+ RECT rect2[4] = {+ {184, 96, 200, 112},+ {200, 96, 216, 112},+ {216, 96, 232, 112},+ {232, 96, 248, 112},+ };
- rect2[0] = {184, 96, 200, 112};- rect2[1] = {200, 96, 216, 112};- rect2[2] = {216, 96, 232, 112};- rect2[3] = {232, 96, 248, 112};-
switch (level)
{case 1:
@@ -1929,23 +1981,26 @@
if (++bul->ani_no > 1)
bul->ani_no = 0;
- RECT rcL[2];
- RECT rcU[2];
- RECT rcR[2];
- RECT rcD[2];
+ RECT rcL[2] = {+ {0, 112, 32, 128},+ {0, 128, 32, 144},+ };
- rcL[0] = {0, 112, 32, 128};- rcL[1] = {0, 128, 32, 144};+ RECT rcU[2] = {+ {32, 112, 48, 144},+ {48, 112, 64, 144},+ };
- rcU[0] = {32, 112, 48, 144};- rcU[1] = {48, 112, 64, 144};+ RECT rcR[2] = {+ {64, 112, 96, 128},+ {64, 128, 96, 144},+ };
- rcR[0] = {64, 112, 96, 128};- rcR[1] = {64, 128, 96, 144};+ RECT rcD[2] = {+ {96, 112, 112, 144},+ {112, 112, 128, 144},+ };
- rcD[0] = {96, 112, 112, 144};- rcD[1] = {112, 112, 128, 144};-
switch (bul->direct)
{case 0:
@@ -2044,19 +2099,21 @@
}
}
- RECT rect1[2];
- RECT rect2[2];
- RECT rect3[2];
+ RECT rect1[2] = {+ {128, 32, 144, 48},+ {144, 32, 160, 48},+ };
- rect1[0] = {128, 32, 144, 48};- rect1[1] = {144, 32, 160, 48};+ RECT rect2[2] = {+ {160, 32, 176, 48},+ {176, 32, 192, 48},+ };
- rect2[0] = {160, 32, 176, 48};- rect2[1] = {176, 32, 192, 48};+ RECT rect3[2] = {+ {128, 48, 144, 64},+ {144, 48, 160, 64},+ };
- rect3[0] = {128, 48, 144, 64};- rect3[1] = {144, 48, 160, 64};-
bul->damage = bul->life;
switch (level)
@@ -2099,36 +2156,41 @@
if ( bul->damage && bul->life != 100 )
bul->damage = 0;
- RECT rc_h_lv1[3];
- RECT rc_v_lv1[3];
- RECT rc_h_lv2[3];
- RECT rc_v_lv2[3];
- RECT rc_h_lv3[3];
- RECT rc_v_lv3[3];
+ RECT rc_h_lv1[3] = {+ {192, 32, 200, 40},+ {200, 32, 208, 40},+ {208, 32, 216, 40},+ };
- rc_h_lv1[0] = {192, 32, 200, 40};- rc_h_lv1[1] = {200, 32, 208, 40};- rc_h_lv1[2] = {208, 32, 216, 40};+ RECT rc_v_lv1[3] = {+ {192, 40, 200, 48},+ {200, 40, 208, 48},+ {208, 40, 216, 48},+ };
- rc_v_lv1[0] = {192, 40, 200, 48};- rc_v_lv1[1] = {200, 40, 208, 48};- rc_v_lv1[2] = {208, 40, 216, 48};+ RECT rc_h_lv2[3] = {+ {216, 32, 224, 40},+ {224, 32, 232, 40},+ {232, 32, 240, 40},+ };
- rc_h_lv2[0] = {216, 32, 224, 40};- rc_h_lv2[1] = {224, 32, 232, 40};- rc_h_lv2[2] = {232, 32, 240, 40};+ RECT rc_v_lv2[3] = {+ {216, 40, 224, 48},+ {224, 40, 232, 48},+ {232, 40, 240, 48},+ };
- rc_v_lv2[0] = {216, 40, 224, 48};- rc_v_lv2[1] = {224, 40, 232, 48};- rc_v_lv2[2] = {232, 40, 240, 48};+ RECT rc_h_lv3[3] = {+ {240, 32, 248, 40},+ {248, 32, 256, 40},+ {256, 32, 264, 40},+ };
- rc_h_lv3[0] = {240, 32, 248, 40};- rc_h_lv3[1] = {248, 32, 256, 40};- rc_h_lv3[2] = {256, 32, 264, 40};-
- rc_v_lv3[0] = {240, 32, 248, 40};- rc_v_lv3[1] = {248, 32, 256, 40};- rc_v_lv3[2] = {256, 32, 264, 40};+ RECT rc_v_lv3[3] = {+ {240, 32, 248, 40},+ {248, 32, 256, 40},+ {256, 32, 264, 40},+ };
switch (level)
{--- a/src/Caret.cpp
+++ b/src/Caret.cpp
@@ -23,19 +23,20 @@
void ActCaret01(CARET *crt)
{- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {0, 64, 8, 72},+ {8, 64, 16, 72},+ {16, 64, 24, 72},+ {24, 64, 32, 72},+ };
+
+ RECT rcRight[4] = {+ {64, 24, 72, 32},+ {72, 24, 80, 32},+ {80, 24, 88, 32},+ {88, 24, 92, 32},+ };
- rcLeft[0] = {0, 64, 8, 72};- rcLeft[1] = {8, 64, 16, 72};- rcLeft[2] = {16, 64, 24, 72};- rcLeft[3] = {24, 64, 32, 72};-
- rcRight[0] = {64, 24, 72, 32};- rcRight[1] = {72, 24, 80, 32};- rcRight[2] = {80, 24, 88, 32};- rcRight[3] = {88, 24, 92, 32};-
if (!crt->act_no)
{crt->act_no = 1;
@@ -62,54 +63,26 @@
void ActCaret02(CARET *crt)
{- RECT rect_right[4];
- RECT rect_left[4];
- RECT rect_up[3];
- rect_left[0].left = 0;
- rect_left[0].top = 32;
- rect_left[0].right = 16;
- rect_left[0].bottom = 48;
- rect_left[1].left = 16;
- rect_left[1].top = 32;
- rect_left[1].right = 32;
- rect_left[1].bottom = 48;
- rect_left[2].left = 32;
- rect_left[2].top = 32;
- rect_left[2].right = 48;
- rect_left[2].bottom = 48;
- rect_left[3].left = 48;
- rect_left[3].top = 32;
- rect_left[3].right = 64;
- rect_left[3].bottom = 48;
- rect_right[0].left = 176;
- rect_right[0].top = 0;
- rect_right[0].right = 192;
- rect_right[0].bottom = 16;
- rect_right[1].left = 192;
- rect_right[1].top = 0;
- rect_right[1].right = 208;
- rect_right[1].bottom = 16;
- rect_right[2].left = 208;
- rect_right[2].top = 0;
- rect_right[2].right = 224;
- rect_right[2].bottom = 16;
- rect_right[3].left = 224;
- rect_right[3].top = 0;
- rect_right[3].right = 240;
- rect_right[3].bottom = 16;
- rect_up[0].left = 0;
- rect_up[0].top = 32;
- rect_up[0].right = 16;
- rect_up[0].bottom = 48;
- rect_up[1].left = 32;
- rect_up[1].top = 32;
- rect_up[1].right = 48;
- rect_up[1].bottom = 48;
- rect_up[2].left = 16;
- rect_up[2].top = 32;
- rect_up[2].right = 32;
- rect_up[2].bottom = 48;
+ RECT rect_left[4] = {+ {0, 32, 16, 48},+ {16, 32, 32, 48},+ {32, 32, 48, 48},+ {48, 32, 64, 48},+ };
+ RECT rect_right[4] = {+ {176, 0, 192, 16},+ {192, 0, 208, 16},+ {208, 0, 224, 16},+ {224, 0, 240, 16},+ };
+
+ RECT rect_up[3] = {+ {0, 32, 16, 48},+ {32, 32, 48, 48},+ {16, 32, 32, 48},+ };
+
switch (crt->direct)
{case 0:
@@ -146,11 +119,12 @@
void ActCaret03(CARET *crt)
{- RECT rect[4];
- rect[0] = {0, 48, 16, 64};- rect[1] = {16, 48, 32, 64};- rect[2] = {32, 48, 48, 64};- rect[3] = {48, 48, 64, 64};+ RECT rect[4] = {+ {0, 48, 16, 64},+ {16, 48, 32, 64},+ {32, 48, 48, 64},+ {48, 48, 64, 64},+ };
if (++crt->ani_wait > 2)
{@@ -164,18 +138,18 @@
void ActCaret04(CARET *crt)
{- RECT rect[9];
+ RECT rect[9] = {+ {64, 32, 80, 48},+ {80, 32, 96, 48},+ {96, 32, 112, 48},+ {64, 48, 80, 64},+ {80, 48, 96, 64},+ {96, 48, 112, 64},+ {64, 64, 80, 80},+ {80, 64, 96, 80},+ {96, 64, 112, 80},+ };
- rect[0] = {64, 32, 80, 48};- rect[1] = {80, 32, 96, 48};- rect[2] = {96, 32, 112, 48};- rect[3] = {64, 48, 80, 64};- rect[4] = {80, 48, 96, 64};- rect[5] = {96, 48, 112, 64};- rect[6] = {64, 64, 80, 80};- rect[7] = {80, 64, 96, 80};- rect[8] = {96, 64, 112, 80};-
if (++crt->ani_wait > 1)
{crt->ani_wait = 0;
@@ -189,16 +163,16 @@
void ActCaret05(CARET *crt)
{- RECT rect[7];
+ RECT rect[7] = {+ {32, 64, 40, 72},+ {32, 72, 40, 80},+ {40, 64, 48, 72},+ {40, 72, 48, 80},+ {40, 64, 48, 72},+ {40, 72, 48, 80},+ {40, 64, 48, 72},+ };
- rect[0] = {32, 64, 40, 72};- rect[1] = {32, 72, 40, 80};- rect[2] = {40, 64, 48, 72};- rect[3] = {40, 72, 48, 80};- rect[4] = {40, 64, 48, 72};- rect[5] = {40, 72, 48, 80};- rect[6] = {40, 64, 48, 72};-
if (++crt->ani_wait > 4)
{crt->ani_wait = 0;
@@ -216,16 +190,16 @@
void ActCaret07(CARET *crt)
{- RECT rcLeft[7];
+ RECT rcLeft[7] = {+ {56, 0, 64, 8},+ {64, 0, 72, 8},+ {72, 0, 80, 8},+ {80, 0, 88, 8},+ {88, 0, 96, 8},+ {96, 0, 104, 8},+ {104, 0, 112, 8},+ };
- rcLeft[0] = {56, 0, 64, 8};- rcLeft[1] = {64, 0, 72, 8};- rcLeft[2] = {72, 0, 80, 8};- rcLeft[3] = {80, 0, 88, 8};- rcLeft[4] = {88, 0, 96, 8};- rcLeft[5] = {96, 0, 104, 8};- rcLeft[6] = {104, 0, 112, 8};-
if (++crt->ani_wait > 1)
{crt->ani_wait = 0;
@@ -282,13 +256,16 @@
void ActCaret10(CARET *crt)
{- RECT rcLeft[2];
- RECT rcRight[2];
- rcLeft[0] = {0, 0, 56, 16};- rcLeft[1] = {0, 16, 56, 32};- rcRight[0] = {0, 96, 56, 112};- rcRight[1] = {0, 112, 56, 128};-
+ RECT rcLeft[2] = {+ {0, 0, 56, 16},+ {0, 16, 56, 32},+ };
+
+ RECT rcRight[2] = {+ {0, 96, 56, 112},+ {0, 112, 56, 128},+ };
+
++crt->ani_wait;
if (crt->direct)
@@ -325,14 +302,15 @@
crt->x += crt->xm;
crt->y += crt->ym;
- RECT rcRight[7];
- rcRight[0] = {56, 8, 64, 16};- rcRight[1] = {64, 8, 72, 16};- rcRight[2] = {72, 8, 80, 16};- rcRight[3] = {80, 8, 88, 16};- rcRight[4] = {88, 8, 96, 16};- rcRight[5] = {96, 8, 104, 16};- rcRight[6] = {104, 8, 112, 16};+ RECT rcRight[7] = {+ {56, 8, 64, 16},+ {64, 8, 72, 16},+ {72, 8, 80, 16},+ {80, 8, 88, 16},+ {88, 8, 96, 16},+ {96, 8, 104, 16},+ {104, 8, 112, 16},+ };
if (++crt->ani_wait > 2)
{@@ -346,9 +324,10 @@
void ActCaret12(CARET *crt)
{- RECT rcLeft[2];
- rcLeft[0] = {112, 0, 144, 32};- rcLeft[1] = {144, 0, 176, 32};+ RECT rcLeft[2] = {+ {112, 0, 144, 32},+ {144, 0, 176, 32},+ };
if (++crt->ani_wait > 2)
{@@ -362,9 +341,10 @@
void ActCaret13(CARET *crt)
{- RECT rcLeft[2];
- rcLeft[0] = {56, 24, 64, 32};- rcLeft[1] = {0, 0, 0, 0};+ RECT rcLeft[2] = {+ {56, 24, 64, 32},+ {0, 0, 0, 0},+ };
if (!crt->act_no)
{@@ -403,14 +383,14 @@
void ActCaret14(CARET *crt)
{- RECT rect[5];
+ RECT rect[5] = {+ {0, 96, 40, 136},+ {40, 96, 80, 136},+ {80, 96, 120, 136},+ {120, 96, 160, 136},+ {160, 96, 200, 136},+ };
- rect[0] = {0, 96, 40, 136};- rect[1] = {40, 96, 80, 136};- rect[2] = {80, 96, 120, 136};- rect[3] = {120, 96, 160, 136};- rect[4] = {160, 96, 200, 136};-
if (++crt->ani_wait > 1)
{crt->ani_wait = 0;
@@ -424,13 +404,13 @@
void ActCaret15(CARET *crt)
{- RECT rcLeft[4];
+ RECT rcLeft[4] = {+ {0, 72, 8, 80},+ {8, 72, 16, 80},+ {16, 72, 24, 80},+ {24, 72, 32, 80},+ };
- rcLeft[0] = {0, 72, 8, 80};- rcLeft[1] = {8, 72, 16, 80};- rcLeft[2] = {16, 72, 24, 80};- rcLeft[3] = {24, 72, 32, 80};-
if (++crt->ani_wait > 2)
{crt->ani_wait = 0;
@@ -444,11 +424,11 @@
void ActCaret16(CARET *crt)
{- RECT rcLeft[2];
+ RECT rcLeft[2] = {+ {104, 96, 144, 104},+ {104, 104, 144, 112},+ };
- rcLeft[0] = {104, 96, 144, 104};- rcLeft[1] = {104, 104, 144, 112};-
if (++crt->ani_wait < 10)
crt->y -= 0x400;
@@ -460,10 +440,10 @@
void ActCaret17(CARET *crt)
{- RECT rcLeft[2];
-
- rcLeft[0] = {0, 144, 144, 152};- rcLeft[1] = {0, 0, 0, 0};+ RECT rcLeft[2] = {+ {0, 144, 144, 152},+ {0, 0, 0, 0},+ };
if (++crt->ani_wait >= 40)
crt->ani_wait = 0;
--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -80,11 +80,15 @@
BOOL StartDirectDraw(int lMagnification, int lColourDepth)
{+ (void)lColourDepth;
+
//Initialize rendering
SDL_InitSubSystem(SDL_INIT_VIDEO);
//Create renderer
- if (gRenderer = SDL_CreateRenderer(gWindow, -1, SDL_RENDERER_ACCELERATED))
+ gRenderer = SDL_CreateRenderer(gWindow, -1, SDL_RENDERER_ACCELERATED);
+
+ if (gRenderer != NULL)
{switch (lMagnification)
{@@ -270,15 +274,20 @@
const unsigned char *src_row = (unsigned char*)converted_surface->pixels + h * converted_surface->pitch;
unsigned char *dst_row = (unsigned char*)surf[surf_no].surface->pixels + h * surf[surf_no].surface->pitch * magnification;
- const unsigned long *src_ptr = (unsigned long*)src_row;
- unsigned long *dst_ptr = (unsigned long*)dst_row;
+ const unsigned char *src_ptr = src_row;
+ unsigned char *dst_ptr = dst_row;
for (int w = 0; w < converted_surface->w; ++w)
{- const unsigned long src_pixel = *src_ptr++;
-
for (int i = 0; i < magnification; ++i)
- *dst_ptr++ = src_pixel;
+ {+ *dst_ptr++ = src_ptr[0];
+ *dst_ptr++ = src_ptr[1];
+ *dst_ptr++ = src_ptr[2];
+ *dst_ptr++ = src_ptr[3];
+ }
+
+ src_ptr += 4;
}
for (int i = 1; i < magnification; ++i)
@@ -375,7 +384,7 @@
return LoadBitmap_Resource(res, surf_no, false);
}
-SDL_Rect RectToSDLRect(RECT *rect)
+static SDL_Rect RectToSDLRect(RECT *rect)
{ SDL_Rect SDLRect = {rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top};if (SDLRect.w < 0)
@@ -385,6 +394,16 @@
return SDLRect;
}
+static SDL_Rect RectToSDLRectScaled(RECT *rect)
+{+ SDL_Rect SDLRect = RectToSDLRect(rect);
+ SDLRect.x *= magnification;
+ SDLRect.y *= magnification;
+ SDLRect.w *= magnification;
+ SDLRect.h *= magnification;
+ return SDLRect;
+}
+
void BackupSurface(Surface_Ids surf_no, RECT *rect)
{//Get renderer size
@@ -397,8 +416,7 @@
SDL_RenderReadPixels(gRenderer, NULL, SDL_PIXELFORMAT_RGBA32, surface->pixels, surface->pitch);
//Get rects
- SDL_Rect frameRect = RectToSDLRect(rect);
- frameRect = {frameRect.x * magnification, frameRect.y * magnification, frameRect.w * magnification, frameRect.h * magnification};+ SDL_Rect frameRect = RectToSDLRectScaled(rect);
SDL_BlitSurface(surface, &frameRect, surf[surf_no].surface, &frameRect);
surf[surf_no].needs_updating = true;
@@ -416,16 +434,14 @@
}
//Get SDL_Rects
- SDL_Rect clipRect = RectToSDLRect(rcView);
+ SDL_Rect clipRect = RectToSDLRectScaled(rcView);
+
+ SDL_Rect frameRect = RectToSDLRectScaled(rect);
- SDL_Rect frameRect = RectToSDLRect(rect);
- frameRect = {frameRect.x * magnification, frameRect.y * magnification, frameRect.w * magnification, frameRect.h * magnification};-
//Get dest rect
SDL_Rect destRect = {x * magnification, y * magnification, frameRect.w, frameRect.h};//Set cliprect
- clipRect = {clipRect.x * magnification, clipRect.y * magnification, clipRect.w * magnification, clipRect.h * magnification};SDL_RenderSetClipRect(gRenderer, &clipRect);
SDL_SetTextureBlendMode(surf[surf_no].texture, transparent ? SDL_BLENDMODE_BLEND : SDL_BLENDMODE_NONE);
@@ -452,8 +468,7 @@
{//Get rects
SDL_Rect rcSet = {x * magnification, y * magnification, (rect->right - rect->left) * magnification, (rect->bottom - rect->top) * magnification};- SDL_Rect frameRect = RectToSDLRect(rect);
- frameRect = {frameRect.x * magnification, frameRect.y * magnification, frameRect.w * magnification, frameRect.h * magnification};+ SDL_Rect frameRect = RectToSDLRectScaled(rect);
SDL_BlitSurface(surf[from].surface, &frameRect, surf[to].surface, &rcSet);
surf[to].needs_updating = true;
@@ -462,8 +477,7 @@
void CortBox(RECT *rect, uint32_t col)
{//Get rect
- SDL_Rect destRect = RectToSDLRect(rect);
- destRect = {destRect.x * magnification, destRect.y * magnification, destRect.w * magnification, destRect.h * magnification};+ SDL_Rect destRect = RectToSDLRectScaled(rect);
//Set colour and draw
SDL_SetRenderDrawColor(gRenderer, (col & 0xFF0000) >> 16, (col & 0x00FF00) >> 8, col & 0x0000FF, 0xFF);
@@ -473,8 +487,7 @@
void CortBox2(RECT *rect, uint32_t col, Surface_Ids surf_no)
{//Get rect
- SDL_Rect destRect = RectToSDLRect(rect);
- destRect = {destRect.x * magnification, destRect.y * magnification, destRect.w * magnification, destRect.h * magnification};+ SDL_Rect destRect = RectToSDLRectScaled(rect);
const unsigned char col_red = (col & 0xFF0000) >> 16;
const unsigned char col_green = (col & 0x00FF00) >> 8;
@@ -602,5 +615,5 @@
{//Destroy font
UnloadFont(gFont);
- gFont = nullptr;
+ gFont = NULL;
}
--- a/src/Font.cpp
+++ b/src/Font.cpp
@@ -223,7 +223,7 @@
const int letter_x = x + pen_x + face->glyph->bitmap_left;
const int letter_y = y + ((FT_MulFix(face->ascender, face->size->metrics.y_scale) - face->glyph->metrics.horiBearingY + (64 / 2)) / 64);
- for (int iy = MAX(-letter_y, 0); letter_y + iy < MIN(letter_y + converted.rows, (unsigned int)surface->h); ++iy)
+ for (int iy = MAX(-letter_y, 0); letter_y + iy < MIN(letter_y + (int)converted.rows, surface->h); ++iy)
{if (face->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_LCD)
{--- a/src/Game.cpp
+++ b/src/Game.cpp
@@ -60,17 +60,18 @@
//Define rects
RECT rcClient = grcFull;
- RECT rect[10];
- rect[0] = {0, 56, 8, 64};- rect[1] = {8, 56, 16, 64};- rect[2] = {16, 56, 24, 64};- rect[3] = {24, 56, 32, 64};- rect[4] = {32, 56, 40, 64};- rect[5] = {40, 56, 48, 64};- rect[6] = {48, 56, 56, 64};- rect[7] = {56, 56, 64, 64};- rect[8] = {64, 56, 72, 64};- rect[9] = {72, 56, 80, 64};+ RECT rect[10] = {+ {0, 56, 8, 64},+ {8, 56, 16, 64},+ {16, 56, 24, 64},+ {24, 56, 32, 64},+ {32, 56, 40, 64},+ {40, 56, 48, 64},+ {48, 56, 56, 64},+ {56, 56, 64, 64},+ {64, 56, 72, 64},+ {72, 56, 80, 64},+ };
//Digits
int tbl[4] = {1000, 100, 10, 1};@@ -117,7 +118,12 @@
SetFadeMask();
//Reset cliprect and flags
- grcGame = {0, 0, WINDOW_WIDTH, WINDOW_HEIGHT};+ grcGame.left = 0;
+ //Non-vanilla: these three lines are widescreen-related(?)
+ grcGame.top = 0;
+ grcGame.right = WINDOW_WIDTH;
+ grcGame.bottom = WINDOW_HEIGHT;
+
g_GameFlags = 3;
CutNoise();
@@ -216,36 +222,40 @@
RECT rcPeriod = {152, 88, 208, 96};//Character rects
- RECT rcMyChar[4];
- RECT rcCurly[4];
- RECT rcToroko[4];
- RECT rcKing[4];
- RECT rcSu[4];
-
- rcMyChar[0] = {0, 16, 16, 32};- rcMyChar[1] = {16, 16, 32, 32};- rcMyChar[2] = {0, 16, 16, 32};- rcMyChar[3] = {32, 16, 48, 32};+ RECT rcMyChar[4] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ {0, 16, 16, 32},+ {32, 16, 48, 32},+ };
- rcCurly[0] = {0, 112, 16, 128};- rcCurly[1] = {16, 112, 32, 128};- rcCurly[2] = {0, 112, 16, 128};- rcCurly[3] = {32, 112, 48, 128};+ RECT rcCurly[4] = {+ {0, 112, 16, 128},+ {16, 112, 32, 128},+ {0, 112, 16, 128},+ {32, 112, 48, 128},+ };
- rcToroko[0] = {64, 80, 80, 96};- rcToroko[1] = {80, 80, 96, 96};- rcToroko[2] = {64, 80, 80, 96};- rcToroko[3] = {96, 80, 112, 96};+ RECT rcToroko[4] = {+ {64, 80, 80, 96},+ {80, 80, 96, 96},+ {64, 80, 80, 96},+ {96, 80, 112, 96},+ };
- rcKing[0] = {224, 48, 240, 64};- rcKing[1] = {288, 48, 304, 64};- rcKing[2] = {224, 48, 240, 64};- rcKing[3] = {304, 48, 320, 64};+ RECT rcKing[4] = {+ {224, 48, 240, 64},+ {288, 48, 304, 64},+ {224, 48, 240, 64},+ {304, 48, 320, 64},+ };
- rcSu[0] = {0, 16, 16, 32};- rcSu[1] = {32, 16, 48, 32};- rcSu[2] = {0, 16, 16, 32};- rcSu[3] = {48, 16, 64, 32};+ RECT rcSu[4] = {+ {0, 16, 16, 32},+ {32, 16, 48, 32},+ {0, 16, 16, 32},+ {48, 16, 64, 32},+ };
//Reset everything
InitCaret();
@@ -293,7 +303,12 @@
}
//Reset cliprect, flags, and give the player the nikumaru counter
- grcGame = {0, 0, WINDOW_WIDTH, WINDOW_HEIGHT};+ grcGame.left = 0;
+ //Non-vanilla: these three lines are widescreen-related(?)
+ grcGame.top = 0;
+ grcGame.right = WINDOW_WIDTH;
+ grcGame.bottom = WINDOW_HEIGHT;
+
g_GameFlags = 0;
gMC.equip |= 0x100;
--- a/src/Input.cpp
+++ b/src/Input.cpp
@@ -1,5 +1,6 @@
#include "Input.h"
+#include <stddef.h>
#include <stdint.h>
#include <SDL.h>
@@ -21,7 +22,7 @@
{SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
SDL_JoystickClose(joystick);
- joystick = nullptr;
+ joystick = NULL;
}
}
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -445,7 +445,7 @@
//Handle window events
bool focusGained = true;
- while (SDL_PollEvent(nullptr) || !focusGained)
+ while (SDL_PollEvent(NULL) || !focusGained)
{
SDL_Event event;
SDL_WaitEvent(&event);
@@ -549,6 +549,9 @@
case SDL_SCANCODE_F5:
gbUseJoystick = false;
+ break;
+
+ default:
break;
}
break;
--- a/src/MiniMap.cpp
+++ b/src/MiniMap.cpp
@@ -20,11 +20,12 @@
void WriteMiniMapLine(int line)
{- RECT rcLevel[4];
- rcLevel[0] = {240, 24, 241, 25};- rcLevel[1] = {241, 24, 242, 25};- rcLevel[2] = {242, 24, 243, 25};- rcLevel[3] = {243, 24, 244, 25};+ RECT rcLevel[4] = {+ {240, 24, 241, 25},+ {241, 24, 242, 25},+ {242, 24, 243, 25},+ {243, 24, 244, 25},+ };
for (int x = 0; x < gMap.width; x++)
{@@ -105,7 +106,11 @@
PutBitmap4(&grcGame, 0, 0, &grcGame, SURFACE_ID_SCREEN_GRAB);
- rcView = {(WINDOW_WIDTH / 2) - f * gMap.width / 16, (WINDOW_HEIGHT / 2) - f * gMap.length / 16, (WINDOW_WIDTH / 2) + f * gMap.width / 16, (WINDOW_HEIGHT / 2) + f * gMap.length / 16};+ rcView.left = (WINDOW_WIDTH / 2) - f * gMap.width / 16;
+ rcView.right = (WINDOW_WIDTH / 2) + f * gMap.width / 16;
+ rcView.top = (WINDOW_HEIGHT / 2) - f * gMap.length / 16;
+ rcView.bottom = (WINDOW_HEIGHT / 2) + f * gMap.length / 16;
+
PutMapName(true);
CortBox(&rcView, 0);
@@ -174,7 +179,12 @@
}
PutBitmap4(&grcGame, 0, 0, &grcGame, SURFACE_ID_SCREEN_GRAB);
- rcView = {(WINDOW_WIDTH / 2) - f * gMap.width / 16, (WINDOW_HEIGHT / 2) - f * gMap.length / 16, (WINDOW_WIDTH / 2) + f * gMap.width / 16, (WINDOW_HEIGHT / 2) + f * gMap.length / 16};+
+ rcView.left = (WINDOW_WIDTH / 2) - f * gMap.width / 16;
+ rcView.right = (WINDOW_WIDTH / 2) + f * gMap.width / 16;
+ rcView.top = (WINDOW_HEIGHT / 2) - f * gMap.length / 16;
+ rcView.bottom = (WINDOW_HEIGHT / 2) + f * gMap.length / 16;
+
PutMapName(true);
CortBox(&rcView, 0);
--- a/src/MyChar.cpp
+++ b/src/MyChar.cpp
@@ -28,8 +28,17 @@
memset(&gMC, 0, sizeof(MYCHAR));
gMC.cond = 0x80;
gMC.direct = 2;
- gMC.view = {0x1000, 0x1000, 0x1000, 0x1000};- gMC.hit = {0xA00, 0x1000, 0xA00, 0x1000};+
+ gMC.view.back = 0x1000;
+ gMC.view.top = 0x1000;
+ gMC.view.front = 0x1000;
+ gMC.view.bottom = 0x1000;
+
+ gMC.hit.back = 0xA00;
+ gMC.hit.top = 0x1000;
+ gMC.hit.front = 0xA00;
+ gMC.hit.bottom = 0x1000;
+
gMC.life = 3;
gMC.max_life = 3;
gMC.unit = 0;
@@ -37,35 +46,36 @@
void AnimationMyChar(bool bKey)
{- RECT rcLeft[12];
- RECT rcRight[12];
-
- rcLeft[0] = {0, 0, 16, 16};- rcLeft[1] = {16, 0, 32, 16};- rcLeft[2] = {0, 0, 16, 16};- rcLeft[3] = {32, 0, 48, 16};- rcLeft[4] = {0, 0, 16, 16};- rcLeft[5] = {48, 0, 64, 16};- rcLeft[6] = {64, 0, 80, 16};- rcLeft[7] = {48, 0, 64, 16};- rcLeft[8] = {80, 0, 96, 16};- rcLeft[9] = {48, 0, 64, 16};- rcLeft[10] = {96, 0, 112, 16};- rcLeft[11] = {112, 0, 128, 16};+ RECT rcLeft[12] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ {0, 0, 16, 16},+ {32, 0, 48, 16},+ {0, 0, 16, 16},+ {48, 0, 64, 16},+ {64, 0, 80, 16},+ {48, 0, 64, 16},+ {80, 0, 96, 16},+ {48, 0, 64, 16},+ {96, 0, 112, 16},+ {112, 0, 128, 16},+ };
- rcRight[0] = {0, 16, 16, 32};- rcRight[1] = {16, 16, 32, 32};- rcRight[2] = {0, 16, 16, 32};- rcRight[3] = {32, 16, 48, 32};- rcRight[4] = {0, 16, 16, 32};- rcRight[5] = {48, 16, 64, 32};- rcRight[6] = {64, 16, 80, 32};- rcRight[7] = {48, 16, 64, 32};- rcRight[8] = {80, 16, 96, 32};- rcRight[9] = {48, 16, 64, 32};- rcRight[10] = {96, 16, 112, 32};- rcRight[11] = {112, 16, 128, 32};-
+ RECT rcRight[12] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ {0, 16, 16, 32},+ {32, 16, 48, 32},+ {0, 16, 16, 32},+ {48, 16, 64, 32},+ {64, 16, 80, 32},+ {48, 16, 64, 32},+ {80, 16, 96, 32},+ {48, 16, 64, 32},+ {96, 16, 112, 32},+ {112, 16, 128, 32},+ };
+
if (!(gMC.cond & 2))
{if (gMC.flag & 8)
@@ -216,9 +226,10 @@
PutBitmap3(&grcGame, (gMC.x - gMC.view.left) / 0x200 - fx / 0x200, (gMC.y - gMC.view.top) / 0x200 - fy / 0x200, &rect, SURFACE_ID_MY_CHAR);
//Draw airtank
- RECT rcBubble[2];
- rcBubble[0] = {56, 96, 80, 120};- rcBubble[1] = {80, 96, 104, 120};+ RECT rcBubble[2] = {+ {56, 96, 80, 120},+ {80, 96, 104, 120},+ };
++gMC.bubble;
if (gMC.equip & 0x10 && gMC.flag & 0x100)
--- a/src/MycParam.cpp
+++ b/src/MycParam.cpp
@@ -331,10 +331,11 @@
void PutMyAir(int x, int y)
{- RECT rcAir[2];
- rcAir[0] = {112, 72, 144, 80};- rcAir[1] = {112, 80, 144, 88};-
+ RECT rcAir[2] = {+ {112, 72, 144, 80},+ {112, 80, 144, 88},+ };
+
if (!(gMC.equip & 0x10) && gMC.air_get)
{//Draw how much air is left
@@ -351,11 +352,12 @@
void PutTimeCounter(int x, int y)
{- RECT rcTime[3];
- rcTime[0] = {112, 104, 120, 112};- rcTime[1] = {120, 104, 128, 112};- rcTime[2] = {128, 104, 160, 112};-
+ RECT rcTime[3] = {+ {112, 104, 120, 112},+ {120, 104, 128, 112},+ {128, 104, 160, 112},+ };
+
if (gMC.equip & 0x100)
{//Draw clock and increase time
--- a/src/NpcAct020.cpp
+++ b/src/NpcAct020.cpp
@@ -14,15 +14,14 @@
//Computer
void ActNpc020(NPCHAR *npc)
{- RECT rcLeft[1];
- RECT rcRight[3];
+ RECT rcLeft[1] = {288, 16, 320, 40};- rcLeft[0] = {288, 16, 320, 40};+ RECT rcRight[3] = {+ {288, 40, 320, 64},+ {288, 40, 320, 64},+ {288, 64, 320, 88},+ };
- rcRight[0] = {288, 40, 320, 64};- rcRight[1] = {288, 40, 320, 64};- rcRight[2] = {288, 64, 320, 88};-
if (++npc->ani_wait > 3)
{npc->ani_wait = 0;
@@ -52,10 +51,8 @@
break;
}
- RECT rect[1];
+ RECT rect[1] = {224, 40, 240, 48};- rect[0] = {224, 40, 240, 48};-
npc->rect = rect[0];
}
@@ -62,11 +59,11 @@
//Teleporter
void ActNpc022(NPCHAR *npc)
{- RECT rect[2];
+ RECT rect[2] = {+ {240, 16, 264, 48},+ {248, 152, 272, 184},+ };
- rect[0] = {240, 16, 264, 48};- rect[1] = {248, 152, 272, 184};-
switch (npc->act_no)
{case 0:
@@ -86,17 +83,17 @@
//Teleporter lights
void ActNpc023(NPCHAR *npc)
{- RECT rect[8];
+ RECT rect[8] = {+ {264, 16, 288, 20},+ {264, 20, 288, 24},+ {264, 24, 288, 28},+ {264, 28, 288, 32},+ {264, 32, 288, 36},+ {264, 36, 288, 40},+ {264, 40, 288, 44},+ {264, 44, 288, 48},+ };
- rect[0] = {264, 16, 288, 20};- rect[1] = {264, 20, 288, 24};- rect[2] = {264, 24, 288, 28};- rect[3] = {264, 28, 288, 32};- rect[4] = {264, 32, 288, 36};- rect[5] = {264, 36, 288, 40};- rect[6] = {264, 40, 288, 44};- rect[7] = {264, 44, 288, 48};-
if (++npc->ani_wait > 1)
{npc->ani_wait = 0;
@@ -112,23 +109,24 @@
//Power Critter
void ActNpc024(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {0, 0, 24, 24},+ {24, 0, 48, 24},+ {48, 0, 72, 24},+ {72, 0, 96, 24},+ {96, 0, 120, 24},+ {120, 0, 144, 24},+ };
- rcLeft[0] = {0, 0, 24, 24};- rcLeft[1] = {24, 0, 48, 24};- rcLeft[2] = {48, 0, 72, 24};- rcLeft[3] = {72, 0, 96, 24};- rcLeft[4] = {96, 0, 120, 24};- rcLeft[5] = {120, 0, 144, 24};+ RECT rcRight[6] = {+ {0, 24, 24, 48},+ {24, 24, 48, 48},+ {48, 24, 72, 48},+ {72, 24, 96, 48},+ {96, 24, 120, 48},+ {120, 24, 144, 48},+ };
- rcRight[0] = {0, 24, 24, 48};- rcRight[1] = {24, 24, 48, 48};- rcRight[2] = {48, 24, 72, 48};- rcRight[3] = {72, 24, 96, 48};- rcRight[4] = {96, 24, 120, 48};- rcRight[5] = {120, 24, 144, 48};-
switch (npc->act_no)
{case 0:
@@ -290,11 +288,11 @@
// Egg Corridor lift
void ActNpc025(NPCHAR *npc)
{- RECT rcLeft[2];
+ RECT rcLeft[2] = {+ {256, 64, 288, 80},+ {256, 80, 288, 96},+ };
- rcLeft[0] = {256, 64, 288, 80};- rcLeft[1] = {256, 80, 288, 96};-
switch (npc->act_no)
{case 0:
@@ -493,19 +491,20 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rect_left[4];
- RECT rect_right[4];
+ RECT rect_left[4] = {+ {32, 80, 48, 96},+ {48, 80, 64, 96},+ {64, 80, 80, 96},+ {80, 80, 96, 96},+ };
- rect_left[0] = {32, 80, 48, 96};- rect_left[1] = {48, 80, 64, 96};- rect_left[2] = {64, 80, 80, 96};- rect_left[3] = {80, 80, 96, 96};+ RECT rect_right[4] = {+ {32, 96, 48, 112},+ {48, 96, 64, 112},+ {64, 96, 80, 112},+ {80, 96, 96, 112},+ };
- rect_right[0] = {32, 96, 48, 112};- rect_right[1] = {48, 96, 64, 112};- rect_right[2] = {64, 96, 80, 112};- rect_right[3] = {80, 96, 96, 112};-
if (npc->act_no == 3)
{npc->ani_no = 3;
@@ -531,10 +530,8 @@
//Death trap
void ActNpc027(NPCHAR *npc)
{- RECT rcLeft[1];
+ RECT rcLeft[1] = {96, 64, 128, 88};- rcLeft[0] = {96, 64, 128, 88};-
npc->rect = rcLeft[npc->ani_no];
}
@@ -541,23 +538,24 @@
//Flying Critter (Grasstown)
void ActNpc028(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {0, 48, 16, 64},+ {16, 48, 32, 64},+ {32, 48, 48, 64},+ {48, 48, 64, 64},+ {64, 48, 80, 64},+ {80, 48, 96, 64},+ };
- rcLeft[0] = {0, 48, 16, 64};- rcLeft[1] = {16, 48, 32, 64};- rcLeft[2] = {32, 48, 48, 64};- rcLeft[3] = {48, 48, 64, 64};- rcLeft[4] = {64, 48, 80, 64};- rcLeft[5] = {80, 48, 96, 64};+ RECT rcRight[6] = {+ {0, 64, 16, 80},+ {16, 64, 32, 80},+ {32, 64, 48, 80},+ {48, 64, 64, 80},+ {64, 64, 80, 80},+ {80, 64, 96, 80},+ };
- rcRight[0] = {0, 64, 16, 80};- rcRight[1] = {16, 64, 32, 80};- rcRight[2] = {32, 64, 48, 80};- rcRight[3] = {48, 64, 64, 80};- rcRight[4] = {64, 64, 80, 80};- rcRight[5] = {80, 64, 96, 80};-
switch (npc->act_no)
{case 0:
@@ -721,15 +719,16 @@
//Cthulhu
void ActNpc029(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {0, 192, 16, 216},+ {16, 192, 32, 216},+ };
- rcLeft[0] = {0, 192, 16, 216};- rcLeft[1] = {16, 192, 32, 216};+ RECT rcRight[2] = {+ {0, 216, 16, 240},+ {16, 216, 32, 240},+ };
- rcRight[0] = {0, 216, 16, 240};- rcRight[1] = {16, 216, 32, 240};-
switch (npc->act_no)
{case 0:
@@ -755,12 +754,12 @@
//Gunsmith
void ActNpc030(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {48, 0, 64, 16},+ {48, 16, 64, 32},+ {0, 32, 16, 48},+ };
- rc[0] = {48, 0, 64, 16};- rc[1] = {48, 16, 64, 32};- rc[2] = {0, 32, 16, 48};-
if (npc->direct != 0)
{switch (npc->act_no)
@@ -815,21 +814,22 @@
//Bat (Grasstown, hanging)
void ActNpc031(NPCHAR *npc)
{- RECT rcLeft[5];
- RECT rcRight[5];
+ RECT rcLeft[5] = {+ {0, 80, 16, 96},+ {16, 80, 32, 96},+ {32, 80, 48, 96},+ {48, 80, 64, 96},+ {64, 80, 80, 96},+ };
- rcLeft[0] = {0, 80, 16, 96};- rcLeft[1] = {16, 80, 32, 96};- rcLeft[2] = {32, 80, 48, 96};- rcLeft[3] = {48, 80, 64, 96};- rcLeft[4] = {64, 80, 80, 96};+ RECT rcRight[5] = {+ {0, 96, 16, 112},+ {16, 96, 32, 112},+ {32, 96, 48, 112},+ {48, 96, 64, 112},+ {64, 96, 80, 112},+ };
- rcRight[0] = {0, 96, 16, 112};- rcRight[1] = {16, 96, 32, 112};- rcRight[2] = {32, 96, 48, 112};- rcRight[3] = {48, 96, 64, 112};- rcRight[4] = {64, 96, 80, 112};-
switch (npc->act_no)
{case 0:
@@ -946,11 +946,11 @@
//Life capsule
void ActNpc032(NPCHAR *npc)
{- RECT rect[2];
+ RECT rect[2] = {+ {32, 96, 48, 112},+ {48, 96, 64, 112},+ };
- rect[0] = {32, 96, 48, 112};- rect[1] = {48, 96, 64, 112};-
if (++npc->ani_wait > 2)
{npc->ani_wait = 0;
@@ -981,11 +981,11 @@
npc->y += npc->ym;
npc->x += npc->xm;
- RECT rect_left[2];
+ RECT rect_left[2] = {+ {240, 64, 256, 80},+ {240, 80, 256, 96},+ };
- rect_left[0] = {240, 64, 256, 80};- rect_left[1] = {240, 80, 256, 96};-
if (++npc->ani_wait > 2)
{npc->ani_wait = 0;
@@ -1006,12 +1006,9 @@
//Bed
void ActNpc034(NPCHAR *npc)
{- RECT rcLeft[1];
- RECT rcRight[1];
+ RECT rcLeft[1] = {192, 48, 224, 64};+ RECT rcRight[1] = {192, 184, 224, 200};- rcLeft[0] = {192, 48, 224, 64};- rcRight[0] = {192, 184, 224, 200};-
if (npc->direct == 0)
npc->rect = rcLeft[0];
else
@@ -1074,19 +1071,20 @@
break;
}
- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {96, 64, 120, 96},+ {120, 64, 144, 96},+ {144, 64, 168, 96},+ {168, 64, 192, 96},+ };
- rcLeft[0] = {96, 64, 120, 96};- rcLeft[1] = {120, 64, 144, 96};- rcLeft[2] = {144, 64, 168, 96};- rcLeft[3] = {168, 64, 192, 96};+ RECT rcRight[4] = {+ {96, 96, 120, 128},+ {120, 96, 144, 128},+ {144, 96, 168, 128},+ {168, 96, 192, 128},+ };
- rcRight[0] = {96, 96, 120, 128};- rcRight[1] = {120, 96, 144, 128};- rcRight[2] = {144, 96, 168, 128};- rcRight[3] = {168, 96, 192, 128};-
if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
else
@@ -1249,23 +1247,24 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rect_left[6];
- RECT rect_right[6];
+ RECT rect_left[6] = {+ {0, 0, 40, 24},+ {40, 0, 80, 24},+ {80, 0, 120, 24},+ {120, 0, 160, 24},+ {160, 48, 200, 72},+ {200, 48, 240, 72},+ };
- rect_left[0] = {0, 0, 40, 24};- rect_left[1] = {40, 0, 80, 24};- rect_left[2] = {80, 0, 120, 24};- rect_left[3] = {120, 0, 160, 24};- rect_left[4] = {160, 48, 200, 72};- rect_left[5] = {200, 48, 240, 72};+ RECT rect_right[6] = {+ {0, 24, 40, 48},+ {40, 24, 80, 48},+ {80, 24, 120, 48},+ {120, 24, 160, 48},+ {160, 72, 200, 96},+ {200, 72, 240, 96},+ };
- rect_right[0] = {0, 24, 40, 48};- rect_right[1] = {40, 24, 80, 48};- rect_right[2] = {80, 24, 120, 48};- rect_right[3] = {120, 24, 160, 48};- rect_right[4] = {160, 72, 200, 96};- rect_right[5] = {200, 72, 240, 96};-
if (npc->direct == 0)
npc->rect = rect_left[npc->ani_no];
else
@@ -1275,11 +1274,11 @@
//Signpost
void ActNpc037(NPCHAR *npc)
{- RECT rect[2];
+ RECT rect[2] = {+ {192, 64, 208, 80},+ {208, 64, 224, 80},+ };
- rect[0] = {192, 64, 208, 80};- rect[1] = {208, 64, 224, 80};-
if (++npc->ani_wait > 1)
{npc->ani_wait = 0;
@@ -1295,13 +1294,13 @@
//Fireplace
void ActNpc038(NPCHAR *npc)
{- RECT rect[4];
+ RECT rect[4] = {+ {128, 64, 144, 80},+ {144, 64, 160, 80},+ {160, 64, 176, 80},+ {176, 64, 192, 80},+ };
- rect[0] = {128, 64, 144, 80};- rect[1] = {144, 64, 160, 80};- rect[2] = {160, 64, 176, 80};- rect[3] = {176, 64, 192, 80};-
switch (npc->act_no)
{case 0:
@@ -1331,10 +1330,10 @@
//Save sign
void ActNpc039(NPCHAR *npc)
{- RECT rect[2];
-
- rect[0] = {224, 64, 240, 80};- rect[1] = {240, 64, 256, 80};+ RECT rect[2] = {+ {224, 64, 240, 80},+ {240, 64, 256, 80},+ };
if (npc->direct == 0)
npc->ani_no = 0;
--- a/src/NpcAct040.cpp
+++ b/src/NpcAct040.cpp
@@ -14,25 +14,26 @@
//Santa
void ActNpc040(NPCHAR *npc)
{- RECT rcLeft[7];
- RECT rcRight[7];
-
- rcLeft[0] = {0, 32, 16, 48};- rcLeft[1] = {16, 32, 32, 48};- rcLeft[2] = {32, 32, 48, 48};- rcLeft[3] = {0, 32, 16, 48};- rcLeft[4] = {48, 32, 64, 48};- rcLeft[5] = {0, 32, 16, 48};- rcLeft[6] = {64, 32, 80, 48};-
- rcRight[0] = {0, 48, 16, 64};- rcRight[1] = {16, 48, 32, 64};- rcRight[2] = {32, 48, 48, 64};- rcRight[3] = {0, 48, 16, 64};- rcRight[4] = {48, 48, 64, 64};- rcRight[5] = {0, 48, 16, 64};- rcRight[6] = {64, 48, 80, 64};-
+ RECT rcLeft[7] = {+ {0, 32, 16, 48},+ {16, 32, 32, 48},+ {32, 32, 48, 48},+ {0, 32, 16, 48},+ {48, 32, 64, 48},+ {0, 32, 16, 48},+ {64, 32, 80, 48},+ };
+
+ RECT rcRight[7] = {+ {0, 48, 16, 64},+ {16, 48, 32, 64},+ {32, 48, 48, 64},+ {0, 48, 16, 64},+ {48, 48, 64, 64},+ {0, 48, 16, 64},+ {64, 48, 80, 64},+ };
+
switch ( npc->act_no )
{case 0:
@@ -87,19 +88,17 @@
break;
}
- if (npc->direct)
- npc->rect = rcRight[npc->ani_no];
- else
+ if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
+ else
+ npc->rect = rcRight[npc->ani_no];
}
//Busted Door
void ActNpc041(NPCHAR *npc)
{- RECT rect[1];
+ RECT rect[1] = {0, 80, 48, 112};- rect[0] = {0, 80, 48, 112};-
if (npc->act_no == 0)
{++npc->act_no;
@@ -112,37 +111,38 @@
//Sue
void ActNpc042(NPCHAR *npc)
{- RECT rcLeft[13];
- RECT rcRight[13];
+ RECT rcLeft[13] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ {32, 0, 48, 16},+ {0, 0, 16, 16},+ {48, 0, 64, 16},+ {0, 0, 16, 16},+ {64, 0, 80, 16},+ {80, 32, 96, 48},+ {96, 32, 112, 48},+ {128, 32, 144, 48},+ {0, 0, 16, 16},+ {112, 32, 128, 48},+ {160, 32, 176, 48},+ };
- rcLeft[0] = {0, 0, 16, 16};- rcLeft[1] = {16, 0, 32, 16};- rcLeft[2] = {32, 0, 48, 16};- rcLeft[3] = {0, 0, 16, 16};- rcLeft[4] = {48, 0, 64, 16};- rcLeft[5] = {0, 0, 16, 16};- rcLeft[6] = {64, 0, 80, 16};- rcLeft[7] = {80, 32, 96, 48};- rcLeft[8] = {96, 32, 112, 48};- rcLeft[9] = {128, 32, 144, 48};- rcLeft[10] = {0, 0, 16, 16};- rcLeft[11] = {112, 32, 128, 48};- rcLeft[12] = {160, 32, 176, 48};+ RECT rcRight[13] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ {32, 16, 48, 32},+ {0, 16, 16, 32},+ {48, 16, 64, 32},+ {0, 16, 16, 32},+ {64, 16, 80, 32},+ {80, 48, 96, 64},+ {96, 48, 112, 64},+ {128, 48, 144, 64},+ {0, 16, 16, 32},+ {112, 48, 128, 64},+ {160, 48, 176, 64},+ };
- rcRight[0] = {0, 16, 16, 32};- rcRight[1] = {16, 16, 32, 32};- rcRight[2] = {32, 16, 48, 32};- rcRight[3] = {0, 16, 16, 32};- rcRight[4] = {48, 16, 64, 32};- rcRight[5] = {0, 16, 16, 32};- rcRight[6] = {64, 16, 80, 32};- rcRight[7] = {80, 48, 96, 64};- rcRight[8] = {96, 48, 112, 64};- rcRight[9] = {128, 48, 144, 64};- rcRight[10] = {0, 16, 16, 32};- rcRight[11] = {112, 48, 128, 64};- rcRight[12] = {160, 48, 176, 64};-
switch (npc->act_no)
{case 0:
@@ -397,12 +397,9 @@
//Chalkboard
void ActNpc043(NPCHAR *npc)
{- RECT rcLeft[1];
- RECT rcRight[1];
+ RECT rcLeft = {128, 80, 168, 112};+ RECT rcRight = {168, 80, 208, 112};- rcLeft[0] = {128, 80, 168, 112};- rcRight[0] = {168, 80, 208, 112};-
if (npc->act_no == 0)
{npc->act_no = 1;
@@ -410,25 +407,27 @@
}
if (npc->direct == 0)
- npc->rect = rcLeft[0];
+ npc->rect = rcLeft;
else
- npc->rect = rcRight[0];
+ npc->rect = rcRight;
}
//Polish
void ActNpc044(NPCHAR *npc)
{- RECT rcRight[3];
- RECT rcLeft[3];
+ // Yeah, Pixel defined these backwards for some reason.
+ RECT rcRight[3] = {+ {0, 0, 32, 32},+ {32, 0, 64, 32},+ {64, 0, 96, 32},+ };
- rcRight[0] = {0, 0, 32, 32};- rcRight[1] = {32, 0, 64, 32};- rcRight[2] = {64, 0, 96, 32};+ RECT rcLeft[3] = {+ {0, 0, 32, 32},+ {96, 0, 128, 32},+ {128, 0, 160, 32},+ };
- rcLeft[0] = {0, 0, 32, 32};- rcLeft[1] = {96, 0, 128, 32};- rcLeft[2] = {128, 0, 160, 32};-
switch (npc->act_no)
{case 0:
@@ -598,12 +597,12 @@
//Baby
void ActNpc045(NPCHAR *npc)
{- RECT rect[3];
+ RECT rect[3] = {+ {0, 32, 16, 48},+ {16, 32, 32, 48},+ {32, 32, 48, 48},+ };
- rect[0] = {0, 32, 16, 48};- rect[1] = {16, 32, 32, 48};- rect[2] = {32, 32, 48, 48};-
switch (npc->act_no)
{case 0:
@@ -667,8 +666,7 @@
//H/V Trigger
void ActNpc046(NPCHAR *npc)
{- RECT rect[1];
- rect[0] = {0, 0, 16, 16};+ RECT rect = {0, 0, 16, 16};npc->bits |= 0x100;
@@ -687,7 +685,7 @@
npc->y += 0x5FF;
}
- npc->rect = rect[0];
+ npc->rect = rect;
}
//Sandcroc
@@ -782,14 +780,14 @@
break;
}
- RECT rect[5];
+ RECT rect[5] = {+ {0, 48, 48, 80},+ {48, 48, 96, 80},+ {96, 48, 144, 80},+ {144, 48, 192, 80},+ {192, 48, 240, 80},+ };
- rect[0] = {0, 48, 48, 80};- rect[1] = {48, 48, 96, 80};- rect[2] = {96, 48, 144, 80};- rect[3] = {144, 48, 192, 80};- rect[4] = {192, 48, 240, 80};-
npc->rect = rect[npc->ani_no];
}
@@ -827,13 +825,16 @@
npc->y += npc->ym;
npc->x += npc->xm;
- RECT rcLeft[2];
- RECT rcRight[2];
- rcLeft[0] = {288, 88, 304, 104};- rcLeft[1] = {304, 88, 320, 104};- rcRight[0] = {288, 104, 304, 120};- rcRight[1] = {304, 104, 320, 120};-
+ RECT rcLeft[2] = {+ {288, 88, 304, 104},+ {304, 88, 320, 104},+ };
+
+ RECT rcRight[2] = {+ {288, 104, 304, 120},+ {304, 104, 320, 120},+ };
+
if (++npc->ani_wait > 2)
{npc->ani_wait = 0;
@@ -977,17 +978,18 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {0, 80, 32, 104},+ {32, 80, 64, 104},+ {64, 80, 96, 104},+ };
- rcLeft[0] = {0, 80, 32, 104};- rcLeft[1] = {32, 80, 64, 104};- rcLeft[2] = {64, 80, 96, 104};+ RECT rcRight[3] = {+ {0, 104, 32, 128},+ {32, 104, 64, 128},+ {64, 104, 96, 128},+ };
- rcRight[0] = {0, 104, 32, 128};- rcRight[1] = {32, 104, 64, 128};- rcRight[2] = {64, 104, 96, 128};-
if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
else
@@ -1062,13 +1064,13 @@
if (npc->ym < -0x5FF)
npc->ym = -0x5FF;
- RECT rect[4];
+ RECT rect[4] = {+ {48, 32, 64, 48},+ {64, 32, 80, 48},+ {80, 32, 96, 48},+ {96, 32, 112, 48},+ };
- rect[0] = {48, 32, 64, 48};- rect[1] = {64, 32, 80, 48};- rect[2] = {80, 32, 96, 48};- rect[3] = {96, 32, 112, 48};-
if (npc->direct == 0)
{if (++npc->ani_wait > 1)
@@ -1194,21 +1196,22 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rect_left[5];
- RECT rect_right[5];
+ RECT rect_left[5] = {+ {96, 80, 128, 112},+ {128, 80, 160, 112},+ {160, 80, 192, 112},+ {192, 80, 224, 112},+ {224, 80, 256, 112},+ };
- rect_left[0] = {96, 80, 128, 112};- rect_left[1] = {128, 80, 160, 112};- rect_left[2] = {160, 80, 192, 112};- rect_left[3] = {192, 80, 224, 112};- rect_left[4] = {224, 80, 256, 112};+ RECT rect_right[5] = {+ {96, 112, 128, 144},+ {128, 112, 160, 144},+ {160, 112, 192, 144},+ {192, 112, 224, 144},+ {224, 112, 256, 144},+ };
- rect_right[0] = {96, 112, 128, 144};- rect_right[1] = {128, 112, 160, 144};- rect_right[2] = {160, 112, 192, 144};- rect_right[3] = {192, 112, 224, 144};- rect_right[4] = {224, 112, 256, 144};-
if (npc->shock)
{npc->ani_no = 4;
@@ -1241,25 +1244,24 @@
//Bliue robot (sitting)
void ActNpc052(NPCHAR *npc)
{- RECT rect[1];
+ RECT rect = {240, 96, 256, 112};- rect[0] = {240, 96, 256, 112};-
- npc->rect = rect[0];
+ npc->rect = rect;
}
//Skullstep leg
void ActNpc053(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {0, 128, 24, 144},+ {24, 128, 48, 144},+ };
- rcLeft[0] = {0, 128, 24, 144};- rcLeft[1] = {24, 128, 48, 144};+ RECT rcRight[2] = {+ {48, 128, 72, 144},+ {72, 128, 96, 144},+ };
- rcRight[0] = {48, 128, 72, 144};- rcRight[1] = {72, 128, 96, 144};-
if (npc->pNpc->code_char == 3)
{VanishNpChar(npc);
@@ -1317,17 +1319,18 @@
//Skullstep
void ActNpc054(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {0, 80, 32, 104},+ {32, 80, 64, 104},+ {64, 80, 96, 104},+ };
- rcLeft[0] = {0, 80, 32, 104};- rcLeft[1] = {32, 80, 64, 104};- rcLeft[2] = {64, 80, 96, 104};+ RECT rcRight[3] = {+ {0, 104, 32, 128},+ {32, 104, 64, 128},+ {64, 104, 96, 128},+ };
- rcRight[0] = {0, 104, 32, 128};- rcRight[1] = {32, 104, 64, 128};- rcRight[2] = {64, 104, 96, 128};-
unsigned char deg;
switch (npc->act_no)
{@@ -1420,26 +1423,27 @@
npc->rect = rcRight[npc->ani_no];
}
-//Cairn
+//Kazuka
void ActNpc055(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {192, 192, 208, 216},+ {208, 192, 224, 216},+ {192, 192, 208, 216},+ {224, 192, 240, 216},+ {192, 192, 208, 216},+ {240, 192, 256, 216},+ };
- rcLeft[0] = {192, 192, 208, 216};- rcLeft[1] = {208, 192, 224, 216};- rcLeft[2] = {192, 192, 208, 216};- rcLeft[3] = {224, 192, 240, 216};- rcLeft[4] = {192, 192, 208, 216};- rcLeft[5] = {240, 192, 256, 216};+ RECT rcRight[6] = {+ {192, 216, 208, 240},+ {208, 216, 224, 240},+ {192, 216, 208, 240},+ {224, 216, 240, 240},+ {192, 216, 208, 240},+ {240, 216, 256, 240},+ };
- rcRight[0] = {192, 216, 208, 240};- rcRight[1] = {208, 216, 224, 240};- rcRight[2] = {192, 216, 208, 240};- rcRight[3] = {224, 216, 240, 240};- rcRight[4] = {192, 216, 208, 240};- rcRight[5] = {240, 216, 256, 240};-
switch (npc->act_no)
{case 0:
@@ -1490,17 +1494,18 @@
//Beetle (Sand Zone)
void ActNpc056(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {0, 144, 16, 160},+ {16, 144, 32, 160},+ {32, 144, 48, 160},+ };
- rcLeft[0] = {0, 144, 16, 160};- rcLeft[1] = {16, 144, 32, 160};- rcLeft[2] = {32, 144, 48, 160};+ RECT rcRight[3] = {+ {0, 160, 16, 176},+ {16, 160, 32, 176},+ {32, 160, 48, 176},+ };
- rcRight[0] = {0, 160, 16, 176};- rcRight[1] = {16, 160, 32, 176};- rcRight[2] = {32, 160, 48, 176};-
switch (npc->act_no)
{case 0:
@@ -1721,21 +1726,22 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rect_left[5];
- RECT rect_right[5];
+ RECT rect_left[5] = {+ {96, 80, 128, 112},+ {128, 80, 160, 112},+ {160, 80, 192, 112},+ {192, 80, 224, 112},+ {224, 80, 256, 112},+ };
- rect_left[0] = {96, 80, 128, 112};- rect_left[1] = {128, 80, 160, 112};- rect_left[2] = {160, 80, 192, 112};- rect_left[3] = {192, 80, 224, 112};- rect_left[4] = {224, 80, 256, 112};+ RECT rect_right[5] = {+ {96, 112, 128, 144},+ {128, 112, 160, 144},+ {160, 112, 192, 144},+ {192, 112, 224, 144},+ {224, 112, 256, 144},+ };
- rect_right[0] = {96, 112, 128, 144};- rect_right[1] = {128, 112, 160, 144};- rect_right[2] = {160, 112, 192, 144};- rect_right[3] = {192, 112, 224, 144};- rect_right[4] = {224, 112, 256, 144};-
if (npc->shock)
{npc->ani_no = 4;
@@ -1761,17 +1767,18 @@
//Basu (Egg Corridor)
void ActNpc058(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {192, 0, 216, 24},+ {216, 0, 240, 24},+ {240, 0, 264, 24},+ };
- rcLeft[0] = {192, 0, 216, 24};- rcLeft[1] = {216, 0, 240, 24};- rcLeft[2] = {240, 0, 264, 24};+ RECT rcRight[3] = {+ {192, 24, 216, 48},+ {216, 24, 240, 48},+ {240, 24, 264, 48},+ };
- rcRight[0] = {192, 24, 216, 48};- rcRight[1] = {216, 24, 240, 48};- rcRight[2] = {240, 24, 264, 48};-
switch (npc->act_no)
{case 0:
@@ -1915,12 +1922,12 @@
//Eye door
void ActNpc059(NPCHAR *npc)
{- RECT rcLeft[4];
-
- rcLeft[0] = {224, 16, 240, 40};- rcLeft[1] = {208, 80, 224, 104};- rcLeft[2] = {224, 80, 240, 104};- rcLeft[3] = {240, 80, 256, 104};+ RECT rcLeft[4] = {+ {224, 16, 240, 40},+ {208, 80, 224, 104},+ {224, 80, 240, 104},+ {240, 80, 256, 104},+ };
switch (npc->act_no)
{--- a/src/NpcAct060.cpp
+++ b/src/NpcAct060.cpp
@@ -17,28 +17,29 @@
//Toroko
void ActNpc060(NPCHAR *npc)
{- RECT rcLeft[8];
- RECT rcRight[8];
+ RECT rcLeft[8] = {+ {0, 64, 16, 80},+ {16, 64, 32, 80},+ {32, 64, 48, 80},+ {16, 64, 32, 80},+ {48, 64, 64, 80},+ {16, 64, 32, 80},+ {112, 64, 128, 80},+ {128, 64, 144, 80},+ };
- rcLeft[0] = {0, 64, 16, 80};- rcLeft[1] = {16, 64, 32, 80};- rcLeft[2] = {32, 64, 48, 80};- rcLeft[3] = {16, 64, 32, 80};- rcLeft[4] = {48, 64, 64, 80};- rcLeft[5] = {16, 64, 32, 80};- rcLeft[6] = {112, 64, 128, 80};- rcLeft[7] = {128, 64, 144, 80};+ RECT rcRight[8] = {+ {0, 80, 16, 96},+ {16, 80, 32, 96},+ {32, 80, 48, 96},+ {16, 80, 32, 96},+ {48, 80, 64, 96},+ {16, 80, 32, 96},+ {112, 80, 128, 96},+ {128, 80, 144, 96},+ };
- rcRight[0] = {0, 80, 16, 96};- rcRight[1] = {16, 80, 32, 96};- rcRight[2] = {32, 80, 48, 96};- rcRight[3] = {16, 80, 32, 96};- rcRight[4] = {48, 80, 64, 96};- rcRight[5] = {16, 80, 32, 96};- rcRight[6] = {112, 80, 128, 96};- rcRight[7] = {128, 80, 144, 96};-
- switch ( npc->act_no )
+ switch (npc->act_no)
{case 0:
npc->act_no = 1;
@@ -196,33 +197,34 @@
//King
void ActNpc061(NPCHAR *npc)
{- RECT rcLeft[11];
- RECT rcRight[11];
+ RECT rcLeft[11] = {+ {224, 32, 240, 48},+ {240, 32, 256, 48},+ {256, 32, 272, 48},+ {272, 32, 288, 48},+ {288, 32, 304, 48},+ {224, 32, 240, 48},+ {304, 32, 320, 48},+ {224, 32, 240, 48},+ {272, 32, 288, 48},+ {0, 0, 0, 0},+ {112, 32, 128, 48},+ };
- rcLeft[0] = {224, 32, 240, 48};- rcLeft[1] = {240, 32, 256, 48};- rcLeft[2] = {256, 32, 272, 48};- rcLeft[3] = {272, 32, 288, 48};- rcLeft[4] = {288, 32, 304, 48};- rcLeft[5] = {224, 32, 240, 48};- rcLeft[6] = {304, 32, 320, 48};- rcLeft[7] = {224, 32, 240, 48};- rcLeft[8] = {272, 32, 288, 48};- rcLeft[9] = {0, 0, 0, 0};- rcLeft[10] = {112, 32, 128, 48};+ RECT rcRight[11] = {+ {224, 48, 240, 64},+ {240, 48, 256, 64},+ {256, 48, 272, 64},+ {272, 48, 288, 64},+ {288, 48, 304, 64},+ {224, 48, 240, 64},+ {304, 48, 320, 64},+ {224, 48, 240, 64},+ {272, 48, 288, 64},+ {0, 0, 0, 0},+ {112, 32, 128, 48},+ };
- rcRight[0] = {224, 48, 240, 64};- rcRight[1] = {240, 48, 256, 64};- rcRight[2] = {256, 48, 272, 64};- rcRight[3] = {272, 48, 288, 64};- rcRight[4] = {288, 48, 304, 64};- rcRight[5] = {224, 48, 240, 64};- rcRight[6] = {304, 48, 320, 64};- rcRight[7] = {224, 48, 240, 64};- rcRight[8] = {272, 48, 288, 64};- rcRight[9] = {0, 0, 0, 0};- rcRight[10] = {112, 32, 128, 48};-
switch (npc->act_no)
{case 0:
@@ -264,10 +266,10 @@
case 7:
npc->ani_no = 2;
- if (npc->direct)
- npc->xm = 0x200;
- else
+ if (npc->direct == 0)
npc->xm = -0x200;
+ else
+ npc->xm = 0x200;
if (npc->act_wait++ && npc->flag & 8)
npc->act_no = 5;
@@ -419,12 +421,12 @@
//Kazuma at computer
void ActNpc062(NPCHAR *npc)
{- RECT rcLeft[3];
+ RECT rcLeft[3] = {+ {272, 192, 288, 216},+ {288, 192, 304, 216},+ {304, 192, 320, 216},+ };
- rcLeft[0] = {272, 192, 288, 216};- rcLeft[1] = {288, 192, 304, 216};- rcLeft[2] = {304, 192, 320, 216};-
switch ( npc->act_no )
{case 0:
@@ -487,23 +489,24 @@
//Toroko with stick
void ActNpc063(NPCHAR *npc)
{- RECT rcLeft[8];
- RECT rcRight[6];
+ RECT rcLeft[8] = {+ {64, 64, 80, 80},+ {80, 64, 96, 80},+ {64, 64, 80, 80},+ {96, 64, 112, 80},+ {112, 64, 128, 80},+ {128, 64, 144, 80},+ };
- rcLeft[0] = {64, 64, 80, 80};- rcLeft[1] = {80, 64, 96, 80};- rcLeft[2] = {64, 64, 80, 80};- rcLeft[3] = {96, 64, 112, 80};- rcLeft[4] = {112, 64, 128, 80};- rcLeft[5] = {128, 64, 144, 80};+ RECT rcRight[6] = {+ {64, 80, 80, 96},+ {80, 80, 96, 96},+ {64, 80, 80, 96},+ {96, 80, 112, 96},+ {112, 80, 128, 96},+ {128, 80, 144, 96},+ };
- rcRight[0] = {64, 80, 80, 96};- rcRight[1] = {80, 80, 96, 96};- rcRight[2] = {64, 80, 80, 96};- rcRight[3] = {96, 80, 112, 96};- rcRight[4] = {112, 80, 128, 96};- rcRight[5] = {128, 80, 144, 96};-
switch (npc->act_no)
{case 0:
@@ -623,17 +626,18 @@
//First Cave Critter
void ActNpc064(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ {32, 0, 48, 16},+ };
- rcLeft[0] = {0, 0, 16, 16};- rcLeft[1] = {16, 0, 32, 16};- rcLeft[2] = {32, 0, 48, 16};+ RECT rcRight[3] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ {32, 16, 48, 32},+ };
- rcRight[0] = {0, 16, 16, 32};- rcRight[1] = {16, 16, 32, 32};- rcRight[2] = {32, 16, 48, 32};-
switch (npc->act_no)
{case 0: //Init
@@ -771,19 +775,20 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rect_left[4];
- RECT rect_right[4];
+ RECT rect_left[4] = {+ {32, 32, 48, 48},+ {48, 32, 64, 48},+ {64, 32, 80, 48},+ {80, 32, 96, 48},+ };
- rect_left[0] = {32, 32, 48, 48};- rect_left[1] = {48, 32, 64, 48};- rect_left[2] = {64, 32, 80, 48};- rect_left[3] = {80, 32, 96, 48};+ RECT rect_right[4] = {+ {32, 48, 48, 64},+ {48, 48, 64, 64},+ {64, 48, 80, 64},+ {80, 48, 96, 64},+ };
- rect_right[0] = {32, 48, 48, 64};- rect_right[1] = {48, 48, 64, 64};- rect_right[2] = {64, 48, 80, 64};- rect_right[3] = {80, 48, 96, 64};-
if (++npc->ani_wait > 1)
{npc->ani_wait = 0;
@@ -802,13 +807,13 @@
//Misery bubble
void ActNpc066(NPCHAR *npc)
{- RECT rect[4];
+ RECT rect[4] = {+ {32, 192, 56, 216},+ {56, 192, 80, 216},+ {32, 216, 56, 240},+ {56, 216, 80, 240},+ };
- rect[0] = {32, 192, 56, 216};- rect[1] = {56, 192, 80, 216};- rect[2] = {32, 216, 56, 240};- rect[3] = {56, 216, 80, 240};-
switch (npc->act_no)
{case 0:
@@ -996,27 +1001,28 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rcLeft[8];
- RECT rcRight[8];
+ RECT rcLeft[8] = {+ {80, 0, 96, 16},+ {96, 0, 112, 16},+ {112, 0, 128, 16},+ {128, 0, 144, 16},+ {144, 0, 160, 16},+ {160, 0, 176, 16},+ {176, 0, 192, 16},+ {144, 0, 160, 16},+ };
- rcLeft[0] = {80, 0, 96, 16};- rcLeft[1] = {96, 0, 112, 16};- rcLeft[2] = {112, 0, 128, 16};- rcLeft[3] = {128, 0, 144, 16};- rcLeft[4] = {144, 0, 160, 16};- rcLeft[5] = {160, 0, 176, 16};- rcLeft[6] = {176, 0, 192, 16};- rcLeft[7] = {144, 0, 160, 16};+ RECT rcRight[8] = {+ {80, 16, 96, 32},+ {96, 16, 112, 32},+ {112, 16, 128, 32},+ {128, 16, 144, 32},+ {144, 16, 160, 32},+ {160, 16, 176, 32},+ {176, 16, 192, 32},+ {144, 16, 160, 32},+ };
- rcRight[0] = {80, 16, 96, 32};- rcRight[1] = {96, 16, 112, 32};- rcRight[2] = {112, 16, 128, 32};- rcRight[3] = {128, 16, 144, 32};- rcRight[4] = {144, 16, 160, 32};- rcRight[5] = {160, 16, 176, 32};- rcRight[6] = {176, 16, 192, 32};- rcRight[7] = {144, 16, 160, 32};-
if (npc->act_no == 11)
{if (npc->ani_wait)
@@ -1239,29 +1245,30 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rect_left[9];
- RECT rect_right[9];
+ RECT rect_left[9] = {+ {0, 0, 40, 24},+ {0, 48, 40, 72},+ {0, 0, 40, 24},+ {40, 48, 80, 72},+ {0, 0, 40, 24},+ {80, 48, 120, 72},+ {120, 48, 160, 72},+ {120, 0, 160, 24},+ {80, 0, 120, 24},+ };
- rect_left[0] = {0, 0, 40, 24};- rect_left[1] = {0, 48, 40, 72};- rect_left[2] = {0, 0, 40, 24};- rect_left[3] = {40, 48, 80, 72};- rect_left[4] = {0, 0, 40, 24};- rect_left[5] = {80, 48, 120, 72};- rect_left[6] = {120, 48, 160, 72};- rect_left[7] = {120, 0, 160, 24};- rect_left[8] = {80, 0, 120, 24};+ RECT rect_right[9] = {+ {0, 24, 40, 48},+ {0, 72, 40, 96},+ {0, 24, 40, 48},+ {40, 72, 80, 96},+ {0, 24, 40, 48},+ {80, 72, 120, 96},+ {120, 72, 160, 96},+ {120, 24, 160, 48},+ {80, 24, 120, 48},+ };
- rect_right[0] = {0, 24, 40, 48};- rect_right[1] = {0, 72, 40, 96};- rect_right[2] = {0, 24, 40, 48};- rect_right[3] = {40, 72, 80, 96};- rect_right[4] = {0, 24, 40, 48};- rect_right[5] = {80, 72, 120, 96};- rect_right[6] = {120, 72, 160, 96};- rect_right[7] = {120, 24, 160, 48};- rect_right[8] = {80, 24, 120, 48};-
if (npc->direct == 0)
npc->rect = rect_left[npc->ani_no];
else
@@ -1271,23 +1278,24 @@
//Sparkle
void ActNpc069(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {48, 0, 64, 16},+ {64, 0, 80, 16},+ {80, 0, 96, 16},+ {96, 0, 112, 16},+ {48, 0, 64, 16},+ {112, 0, 128, 16},+ };
- rcLeft[0] = {48, 0, 64, 16};- rcLeft[1] = {64, 0, 80, 16};- rcLeft[2] = {80, 0, 96, 16};- rcLeft[3] = {96, 0, 112, 16};- rcLeft[4] = {48, 0, 64, 16};- rcLeft[5] = {112, 0, 128, 16};+ RECT rcRight[6] = {+ {48, 16, 64, 32},+ {64, 16, 80, 32},+ {80, 16, 96, 32},+ {96, 16, 112, 32},+ {48, 16, 64, 32},+ {112, 16, 128, 32},+ };
- rcRight[0] = {48, 16, 64, 32};- rcRight[1] = {64, 16, 80, 32};- rcRight[2] = {80, 16, 96, 32};- rcRight[3] = {96, 16, 112, 32};- rcRight[4] = {48, 16, 64, 32};- rcRight[5] = {112, 16, 128, 32};-
switch (npc->act_no)
{case 0:
@@ -1407,13 +1415,13 @@
//Sparkle
void ActNpc070(NPCHAR *npc)
{- RECT rect[4];
+ RECT rect[4] = {+ {96, 48, 112, 64},+ {112, 48, 128, 64},+ {128, 48, 144, 64},+ {144, 48, 160, 64},+ };
- rect[0] = {96, 48, 112, 64};- rect[1] = {112, 48, 128, 64};- rect[2] = {128, 48, 144, 64};- rect[3] = {144, 48, 160, 64};-
if (++npc->ani_wait > 3)
{npc->ani_wait = 0;
@@ -1454,35 +1462,18 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {64, 32, 80, 48},+ {80, 32, 96, 48},+ {96, 32, 112, 48},+ };
- rcLeft[0].left = 64;
- rcLeft[0].top = 32;
- rcLeft[0].right = 80;
- rcLeft[0].bottom = 48;
- rcLeft[1].left = 80;
- rcLeft[1].top = 32;
- rcLeft[1].right = 96;
- rcLeft[1].bottom = 48;
- rcLeft[2].left = 96;
- rcLeft[2].top = 32;
- rcLeft[2].right = 112;
- rcLeft[2].bottom = 48;
+ RECT rcRight[3] = {+ {64, 48, 80, 64},+ {80, 48, 96, 64},+ {96, 48, 112, 64},+ };
- rcRight[0].left = 64;
- rcRight[0].top = 48;
- rcRight[0].right = 80;
- rcRight[0].bottom = 64;
- rcRight[1].left = 80;
- rcRight[1].top = 48;
- rcRight[1].right = 96;
- rcRight[1].bottom = 64;
- rcRight[2].left = 96;
- rcRight[2].top = 48;
- rcRight[2].right = 112;
- rcRight[2].bottom = 64;
-
if (++npc->ani_wait > 4)
{npc->ani_wait = 0;
@@ -1527,11 +1518,11 @@
}
}
- RECT rect[2];
+ RECT rect[2] = {+ {224, 48, 240, 64},+ {240, 48, 256, 64},+ };
- rect[0] = {224, 48, 240, 64};- rect[1] = {240, 48, 256, 64};-
npc->rect = rect[npc->ani_no];
}
@@ -1538,14 +1529,14 @@
//Water droplet
void ActNpc073(NPCHAR *npc)
{- RECT rect[5];
+ RECT rect[5] = {+ {72, 16, 74, 18},+ {74, 16, 76, 18},+ {76, 16, 78, 18},+ {78, 16, 80, 18},+ {80, 16, 82, 18},+ };
- rect[0] = {72, 16, 74, 18};- rect[1] = {74, 16, 76, 18};- rect[2] = {76, 16, 78, 18};- rect[3] = {78, 16, 80, 18};- rect[4] = {80, 16, 82, 18};-
npc->ym += 0x20;
npc->ani_no = Random(0, 4);
@@ -1582,23 +1573,24 @@
// Jack
void ActNpc074(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {64, 0, 80, 16},+ {80, 0, 96, 16},+ {96, 0, 112, 16},+ {64, 0, 80, 16},+ {112, 0, 128, 16},+ {64, 0, 80, 16},+ };
- rcLeft[0] = {64, 0, 80, 16};- rcLeft[1] = {80, 0, 96, 16};- rcLeft[2] = {96, 0, 112, 16};- rcLeft[3] = {64, 0, 80, 16};- rcLeft[4] = {112, 0, 128, 16};- rcLeft[5] = {64, 0, 80, 16};+ RECT rcRight[6] = {+ {64, 16, 80, 32},+ {80, 16, 96, 32},+ {96, 16, 112, 32},+ {64, 16, 80, 32},+ {112, 16, 128, 32},+ {64, 16, 80, 32},+ };
- rcRight[0] = {64, 16, 80, 32};- rcRight[1] = {80, 16, 96, 32};- rcRight[2] = {96, 16, 112, 32};- rcRight[3] = {64, 16, 80, 32};- rcRight[4] = {112, 16, 128, 32};- rcRight[5] = {64, 16, 80, 32};-
switch (npc->act_no)
{case 0:
@@ -1671,17 +1663,11 @@
// Kanpachi (fishing)
void ActNpc075(NPCHAR *npc)
{- RECT rcLeft[2];
+ RECT rcLeft[2] = {+ {272, 32, 296, 56},+ {296, 32, 320, 56},+ };
- rcLeft[0].left = 272;
- rcLeft[0].top = 32;
- rcLeft[0].right = 296;
- rcLeft[0].bottom = 56;
- rcLeft[1].left = 296;
- rcLeft[1].top = 32;
- rcLeft[1].right = 320;
- rcLeft[1].bottom = 56;
-
switch (npc->act_no)
{case 0:
@@ -1704,18 +1690,21 @@
//Flowers
void ActNpc076(NPCHAR *npc)
{- npc->rect = {16 * npc->code_event, 0, npc->rect.left + 16, 16};+ npc->rect.left = 16 * npc->code_event;
+ npc->rect.top = 0;
+ npc->rect.right = npc->rect.left + 16;
+ npc->rect.bottom = 16;
}
//Yamashita
void ActNpc077(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {0, 16, 48, 48},+ {48, 16, 96, 48},+ {96, 16, 144, 48},+ };
- rc[0] = {0, 16, 48, 48};- rc[1] = {48, 16, 96, 48};- rc[2] = {96, 16, 144, 48};-
switch (npc->act_no)
{case 0:
@@ -1752,11 +1741,11 @@
// Pot
void ActNpc078(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {160, 48, 176, 64},+ {176, 48, 192, 64},+ };
- rc[0] = {160, 48, 176, 64};- rc[1] = {176, 48, 192, 64};-
if (npc->direct == 0)
npc->rect = rc[0];
else
@@ -1766,16 +1755,17 @@
// Mahin the sex god
void ActNpc079(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ {32, 0, 48, 16},+ };
- rcLeft[0] = {0, 0, 16, 16};- rcLeft[1] = {16, 0, 32, 16};- rcLeft[2] = {32, 0, 48, 16};-
- rcRight[0] = {0, 16, 16, 32};- rcRight[1] = {16, 16, 32, 32};- rcRight[2] = {32, 16, 48, 32};+ RECT rcRight[3] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ {32, 16, 48, 32},+ };
switch (npc->act_no)
{--- a/src/NpcAct080.cpp
+++ b/src/NpcAct080.cpp
@@ -16,25 +16,26 @@
//Gravekeeper
void ActNpc080(NPCHAR *npc)
{- RECT rcLeft[7];
- RECT rcRight[7];
+ RECT rcLeft[7] = {+ {0, 64, 24, 88},+ {24, 64, 48, 88},+ {0, 64, 24, 88},+ {48, 64, 72, 88},+ {72, 64, 96, 88},+ {96, 64, 120, 88},+ {120, 64, 144, 88},+ };
- rcLeft[0] = {0, 64, 24, 88};- rcLeft[1] = {24, 64, 48, 88};- rcLeft[2] = {0, 64, 24, 88};- rcLeft[3] = {48, 64, 72, 88};- rcLeft[4] = {72, 64, 96, 88};- rcLeft[5] = {96, 64, 120, 88};- rcLeft[6] = {120, 64, 144, 88};+ RECT rcRight[7] = {+ {0, 88, 24, 112},+ {24, 88, 48, 112},+ {0, 88, 24, 112},+ {48, 88, 72, 112},+ {72, 88, 96, 112},+ {96, 88, 120, 112},+ {120, 88, 144, 112},+ };
- rcRight[0] = {0, 88, 24, 112};- rcRight[1] = {24, 88, 48, 112};- rcRight[2] = {0, 88, 24, 112};- rcRight[3] = {48, 88, 72, 112};- rcRight[4] = {72, 88, 96, 112};- rcRight[5] = {96, 88, 120, 112};- rcRight[6] = {120, 88, 144, 112};-
switch (npc->act_no)
{case 0:
@@ -174,23 +175,24 @@
//Giant pignon
void ActNpc081(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {144, 64, 168, 88},+ {168, 64, 192, 88},+ {192, 64, 216, 88},+ {216, 64, 240, 88},+ {144, 64, 168, 88},+ {240, 64, 264, 88},+ };
- rcLeft[0] = {144, 64, 168, 88};- rcLeft[1] = {168, 64, 192, 88};- rcLeft[2] = {192, 64, 216, 88};- rcLeft[3] = {216, 64, 240, 88};- rcLeft[4] = {144, 64, 168, 88};- rcLeft[5] = {240, 64, 264, 88};+ RECT rcRight[6] = {+ {144, 88, 168, 112},+ {168, 88, 192, 112},+ {192, 88, 216, 112},+ {216, 88, 240, 112},+ {144, 88, 168, 112},+ {240, 88, 264, 112},+ };
- rcRight[0] = {144, 88, 168, 112};- rcRight[1] = {168, 88, 192, 112};- rcRight[2] = {192, 88, 216, 112};- rcRight[3] = {216, 88, 240, 112};- rcRight[4] = {144, 88, 168, 112};- rcRight[5] = {240, 88, 264, 112};-
switch (npc->act_no)
{case 0:
@@ -454,29 +456,30 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rcLeft[9];
- RECT rcRight[9];
+ RECT rcLeft[9] = {+ {80, 0, 96, 16},+ {96, 0, 112, 16},+ {112, 0, 128, 16},+ {128, 0, 144, 16},+ {144, 0, 160, 16},+ {160, 0, 176, 16},+ {176, 0, 192, 16},+ {144, 0, 160, 16},+ {208, 64, 224, 80},+ };
- rcLeft[0] = {80, 0, 96, 16};- rcLeft[1] = {96, 0, 112, 16};- rcLeft[2] = {112, 0, 128, 16};- rcLeft[3] = {128, 0, 144, 16};- rcLeft[4] = {144, 0, 160, 16};- rcLeft[5] = {160, 0, 176, 16};- rcLeft[6] = {176, 0, 192, 16};- rcLeft[7] = {144, 0, 160, 16};- rcLeft[8] = {208, 64, 224, 80};+ RECT rcRight[9] = {+ {80, 16, 96, 32},+ {96, 16, 112, 32},+ {112, 16, 128, 32},+ {128, 16, 144, 32},+ {144, 16, 160, 32},+ {160, 16, 176, 32},+ {176, 16, 192, 32},+ {144, 16, 160, 32},+ {208, 80, 224, 96},+ };
- rcRight[0] = {80, 16, 96, 32};- rcRight[1] = {96, 16, 112, 32};- rcRight[2] = {112, 16, 128, 32};- rcRight[3] = {128, 16, 144, 32};- rcRight[4] = {144, 16, 160, 32};- rcRight[5] = {160, 16, 176, 32};- rcRight[6] = {176, 16, 192, 32};- rcRight[7] = {144, 16, 160, 32};- rcRight[8] = {208, 80, 224, 96};-
if (npc->act_no == 11)
{if (npc->ani_wait)
@@ -518,27 +521,28 @@
//Igor (cutscene)
void ActNpc083(NPCHAR *npc)
{- RECT rcLeft[8];
- RECT rcRight[8];
+ RECT rcLeft[8] = {+ {0, 0, 40, 40},+ {40, 0, 80, 40},+ {80, 0, 120, 40},+ {0, 0, 40, 40},+ {120, 0, 160, 40},+ {0, 0, 40, 40},+ {160, 0, 200, 40},+ {200, 0, 240, 40},+ };
- rcLeft[0] = {0, 0, 40, 40};- rcLeft[1] = {40, 0, 80, 40};- rcLeft[2] = {80, 0, 120, 40};- rcLeft[3] = {0, 0, 40, 40};- rcLeft[4] = {120, 0, 160, 40};- rcLeft[5] = {0, 0, 40, 40};- rcLeft[6] = {160, 0, 200, 40};- rcLeft[7] = {200, 0, 240, 40};+ RECT rcRight[8] = {+ {0, 40, 40, 80},+ {40, 40, 80, 80},+ {80, 40, 120, 80},+ {0, 40, 40, 80},+ {120, 40, 160, 80},+ {0, 40, 40, 80},+ {160, 40, 200, 80},+ {200, 40, 240, 80},+ };
- rcRight[0] = {0, 40, 40, 80};- rcRight[1] = {40, 40, 80, 80};- rcRight[2] = {80, 40, 120, 80};- rcRight[3] = {0, 40, 40, 80};- rcRight[4] = {120, 40, 160, 80};- rcRight[5] = {0, 40, 40, 80};- rcRight[6] = {160, 40, 200, 80};- rcRight[7] = {200, 40, 240, 80};-
switch (npc->act_no)
{case 0:
@@ -637,13 +641,13 @@
npc->y += npc->ym;
npc->x += npc->xm;
- RECT rect_left[4];
+ RECT rect_left[4] = {+ {48, 48, 64, 64},+ {64, 48, 80, 64},+ {48, 64, 64, 80},+ {64, 64, 80, 80},+ };
- rect_left[0] = {48, 48, 64, 64};- rect_left[1] = {64, 48, 80, 64};- rect_left[2] = {48, 64, 64, 80};- rect_left[3] = {64, 64, 80, 80};-
if (++npc->ani_wait > 2)
{npc->ani_wait = 0;
@@ -665,17 +669,18 @@
// Terminal
void ActNpc085(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {256, 96, 272, 120},+ {256, 96, 272, 120},+ {272, 96, 288, 120},+ };
- rcLeft[0] = {256, 96, 272, 120};- rcLeft[1] = {256, 96, 272, 120};- rcLeft[2] = {272, 96, 288, 120};+ RECT rcRight[3] = {+ {256, 96, 272, 120},+ {288, 96, 304, 120},+ {304, 96, 320, 120},+ };
- rcRight[0] = {256, 96, 272, 120};- rcRight[1] = {288, 96, 304, 120};- rcRight[2] = {304, 96, 320, 120};-
switch(npc->act_no)
{case 0:
@@ -705,18 +710,18 @@
// Missile
void ActNpc086(NPCHAR *npc)
{- RECT rect1[2];
- RECT rect3[2];
- RECT rcLast[1];
+ RECT rect1[2] = {+ {0, 80, 16, 96},+ {16, 80, 32, 96},+ };
- rect1[0] = {0, 80, 16, 96};- rect1[1] = {16, 80, 32, 96};+ RECT rect3[2] = {+ {0, 112, 16, 128},+ {16, 112, 32, 128},+ };
- rect3[0] = {0, 112, 16, 128};- rect3[1] = {16, 112, 32, 128};+ RECT rcLast = {16, 0, 32, 16};- rcLast[0] = {16, 0, 32, 16};-
if (npc->direct == 0)
{if (++npc->ani_wait > 2)
@@ -780,24 +785,24 @@
npc->rect.right = 0;
if (npc->count1 > 547)
- npc->rect = rcLast[0];;
+ npc->rect = rcLast;
}
// Heart
void ActNpc087(NPCHAR *npc)
{- RECT rect2[5];
- RECT rect6[2];
- RECT rcLast[1];
+ RECT rect2[2] = {+ {32, 80, 48, 96},+ {48, 80, 64, 96},+ };
- rect2[0] = {32, 80, 48, 96};- rect2[1] = {48, 80, 64, 96};+ RECT rect6[2] = {+ {64, 80, 80, 96},+ {80, 80, 96, 96},+ };
- rect6[0] = {64, 80, 80, 96};- rect6[1] = {80, 80, 96, 96};+ RECT rcLast = {16, 0, 32, 16};- rcLast[0] = {16, 0, 32, 16};-
if (npc->direct == 0)
{if (++npc->ani_wait > 2)
@@ -861,41 +866,42 @@
npc->rect.right = 0;
if (npc->count1 > 547)
- npc->rect = rcLast[0];
+ npc->rect = rcLast;
}
// Igor (boss)
void ActNpc088(NPCHAR *npc)
{- RECT rcLeft[12];
- RECT rcRight[12];
+ RECT rcLeft[12] = {+ {0, 0, 40, 40},+ {40, 0, 80, 40},+ {80, 0, 120, 40},+ {0, 0, 40, 40},+ {120, 0, 160, 40},+ {0, 0, 40, 40},+ {160, 0, 200, 40},+ {200, 0, 240, 40},+ {0, 80, 40, 120},+ {40, 80, 80, 120},+ {240, 0, 280, 40},+ {280, 0, 320, 40},+ };
- rcLeft[0] = {0, 0, 40, 40};- rcLeft[1] = {40, 0, 80, 40};- rcLeft[2] = {80, 0, 120, 40};- rcLeft[3] = {0, 0, 40, 40};- rcLeft[4] = {120, 0, 160, 40};- rcLeft[5] = {0, 0, 40, 40};- rcLeft[6] = {160, 0, 200, 40};- rcLeft[7] = {200, 0, 240, 40};- rcLeft[8] = {0, 80, 40, 120};- rcLeft[9] = {40, 80, 80, 120};- rcLeft[10] = {240, 0, 280, 40};- rcLeft[11] = {280, 0, 320, 40};+ RECT rcRight[12] = {+ {0, 40, 40, 80},+ {40, 40, 80, 80},+ {80, 40, 120, 80},+ {0, 40, 40, 80},+ {120, 40, 160, 80},+ {0, 40, 40, 80},+ {160, 40, 200, 80},+ {200, 40, 240, 80},+ {120, 80, 160, 120},+ {160, 80, 200, 120},+ {240, 40, 280, 80},+ {280, 40, 320, 80},+ };
- rcRight[0] = {0, 40, 40, 80};- rcRight[1] = {40, 40, 80, 80};- rcRight[2] = {80, 40, 120, 80};- rcRight[3] = {0, 40, 40, 80};- rcRight[4] = {120, 40, 160, 80};- rcRight[5] = {0, 40, 40, 80};- rcRight[6] = {160, 40, 200, 80};- rcRight[7] = {200, 40, 240, 80};- rcRight[8] = {120, 80, 160, 120};- rcRight[9] = {160, 80, 200, 120};- rcRight[10] = {240, 40, 280, 80};- rcRight[11] = {280, 40, 320, 80};-
switch (npc->act_no)
{case 0:
@@ -1112,19 +1118,20 @@
// Igor (defeated)
void ActNpc089(NPCHAR *npc)
{- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {80, 80, 120, 120},+ {240, 80, 264, 104},+ {264, 80, 288, 104},+ {288, 80, 312, 104},+ };
- rcLeft[0] = {80, 80, 120, 120};- rcLeft[1] = {240, 80, 264, 104};- rcLeft[2] = {264, 80, 288, 104};- rcLeft[3] = {288, 80, 312, 104};+ RECT rcRight[4] = {+ {200, 80, 240, 120},+ {240, 104, 264, 128},+ {264, 104, 288, 128},+ {288, 104, 312, 128},+ };
- rcRight[0] = {200, 80, 240, 120};- rcRight[1] = {240, 104, 264, 128};- rcRight[2] = {264, 104, 288, 128};- rcRight[3] = {288, 104, 312, 128};-
switch (npc->act_no)
{case 0:
@@ -1222,20 +1229,16 @@
// Unknown
void ActNpc090(NPCHAR *npc)
{- RECT rect[1];
+ RECT rect = {280, 80, 296, 104};- rect[0] = {280, 80, 296, 104};-
- npc->rect = rect[0];
+ npc->rect = rect;
}
// Cage
void ActNpc091(NPCHAR *npc)
{- RECT rect[1];
+ RECT rect = {96, 88, 128, 112};- rect[0] = {96, 88, 128, 112};-
if (npc->act_no == 0)
{++npc->act_no;
@@ -1242,18 +1245,18 @@
npc->y += 0x10 * 0x200;
}
- npc->rect = rect[0];
+ npc->rect = rect;
}
// Sue at PC
void ActNpc092(NPCHAR *npc)
{- RECT rcLeft[3];
+ RECT rcLeft[3] = {+ {272, 216, 288, 240},+ {288, 216, 304, 240},+ {304, 216, 320, 240},+ };
- rcLeft[0] = {272, 216, 288, 240};- rcLeft[1] = {288, 216, 304, 240};- rcLeft[2] = {304, 216, 320, 240};-
switch (npc->act_no)
{case 0:
@@ -1315,25 +1318,26 @@
//Chaco
void ActNpc093(NPCHAR *npc)
{- RECT rcLeft[7];
- RECT rcRight[7];
+ RECT rcLeft[7] = {+ {128, 0, 144, 16},+ {144, 0, 160, 16},+ {160, 0, 176, 16},+ {128, 0, 144, 16},+ {176, 0, 192, 16},+ {128, 0, 144, 16},+ {32, 32, 48, 48},+ };
- rcLeft[0] = {128, 0, 144, 16};- rcLeft[1] = {144, 0, 160, 16};- rcLeft[2] = {160, 0, 176, 16};- rcLeft[3] = {128, 0, 144, 16};- rcLeft[4] = {176, 0, 192, 16};- rcLeft[5] = {128, 0, 144, 16};- rcLeft[6] = {32, 32, 48, 48};+ RECT rcRight[7] = {+ {128, 16, 144, 32},+ {144, 16, 160, 32},+ {160, 16, 176, 32},+ {128, 16, 144, 32},+ {176, 16, 192, 32},+ {128, 16, 144, 32},+ {32, 32, 48, 48},+ };
- rcRight[0] = {128, 16, 144, 32};- rcRight[1] = {144, 16, 160, 32};- rcRight[2] = {160, 16, 176, 32};- rcRight[3] = {128, 16, 144, 32};- rcRight[4] = {176, 16, 192, 32};- rcRight[5] = {128, 16, 144, 32};- rcRight[6] = {32, 32, 48, 48};-
switch (npc->act_no)
{case 0:
@@ -1411,14 +1415,14 @@
//Kulala
void ActNpc094(NPCHAR *npc)
{- RECT rect[5];
+ RECT rect[5] = {+ {272, 0, 320, 24},+ {272, 24, 320, 48},+ {272, 48, 320, 72},+ {272, 72, 320, 96},+ {272, 96, 320, 120},+ };
- rect[0] = {272, 0, 320, 24};- rect[1] = {272, 24, 320, 48};- rect[2] = {272, 48, 320, 72};- rect[3] = {272, 72, 320, 96};- rect[4] = {272, 96, 320, 120};-
switch (npc->act_no)
{case 0:
@@ -1560,19 +1564,20 @@
//Jelly
void ActNpc095(NPCHAR *npc)
{- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {208, 64, 224, 80},+ {224, 64, 240, 80},+ {240, 64, 256, 80},+ {256, 64, 272, 80},+ };
- rcLeft[0] = {208, 64, 224, 80};- rcLeft[1] = {224, 64, 240, 80};- rcLeft[2] = {240, 64, 256, 80};- rcLeft[3] = {256, 64, 272, 80};+ RECT rcRight[4] = {+ {208, 80, 224, 96},+ {224, 80, 240, 96},+ {240, 80, 256, 96},+ {256, 80, 272, 96},+ };
- rcRight[0] = {208, 80, 224, 96};- rcRight[1] = {224, 80, 240, 96};- rcRight[2] = {240, 80, 256, 96};- rcRight[3] = {256, 80, 272, 96};-
switch (npc->act_no)
{case 0:
@@ -1692,12 +1697,12 @@
//Fan (left)
void ActNpc096(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {272, 120, 288, 136},+ {288, 120, 304, 136},+ {304, 120, 320, 136},+ };
- rc[0] = {272, 120, 288, 136};- rc[1] = {288, 120, 304, 136};- rc[2] = {304, 120, 320, 136};-
switch (npc->act_no)
{case 0:
@@ -1742,12 +1747,12 @@
//Fan (up)
void ActNpc097(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {272, 136, 288, 152},+ {288, 136, 304, 152},+ {304, 136, 320, 152},+ };
- rc[0] = {272, 136, 288, 152};- rc[1] = {288, 136, 304, 152};- rc[2] = {304, 136, 320, 152};-
switch (npc->act_no)
{case 0:
@@ -1789,12 +1794,12 @@
//Fan (right)
void ActNpc098(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {272, 152, 288, 168},+ {288, 152, 304, 168},+ {304, 152, 320, 168},+ };
- rc[0] = {272, 152, 288, 168};- rc[1] = {288, 152, 304, 168};- rc[2] = {304, 152, 320, 168};-
switch (npc->act_no)
{case 0:
@@ -1839,11 +1844,11 @@
//Fan (down)
void ActNpc099(NPCHAR *npc)
{- RECT rc[3];
-
- rc[0] = {272, 168, 288, 184};- rc[1] = {288, 168, 304, 184};- rc[2] = {304, 168, 320, 184};+ RECT rc[3] = {+ {272, 168, 288, 184},+ {288, 168, 304, 184},+ {304, 168, 320, 184},+ };
switch (npc->act_no)
{--- a/src/NpcAct100.cpp
+++ b/src/NpcAct100.cpp
@@ -15,11 +15,11 @@
//Grate
void ActNpc100(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {272, 48, 288, 64},+ {272, 48, 288, 64},+ };
- rc[0] = {272, 48, 288, 64};- rc[1] = {272, 48, 288, 64};-
if (npc->act_no == 0)
{npc->y += 0x2000;
@@ -35,12 +35,12 @@
//Malco computer screen
void ActNpc101(NPCHAR *npc)
{- RECT rect[3];
+ RECT rect[3] = {+ {240, 136, 256, 152},+ {240, 136, 256, 152},+ {256, 136, 272, 152},+ };
- rect[0] = {240, 136, 256, 152};- rect[1] = {240, 136, 256, 152};- rect[2] = {256, 136, 272, 152};-
if (++npc->ani_wait > 3)
{npc->ani_wait = 0;
@@ -56,13 +56,13 @@
//Malco computer wave
void ActNpc102(NPCHAR *npc)
{- RECT rect[4];
+ RECT rect[4] = {+ {208, 120, 224, 136},+ {224, 120, 240, 136},+ {240, 120, 256, 136},+ {256, 120, 272, 136},+ };
- rect[0] = {208, 120, 224, 136};- rect[1] = {224, 120, 240, 136};- rect[2] = {240, 120, 256, 136};- rect[3] = {256, 120, 272, 136};-
if (npc->act_no == 0)
{npc->act_no = 1;
@@ -84,17 +84,18 @@
//Mannan projectile
void ActNpc103(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {192, 96, 208, 120},+ {208, 96, 224, 120},+ {224, 96, 240, 120},+ };
- rcLeft[0] = {192, 96, 208, 120};- rcLeft[1] = {208, 96, 224, 120};- rcLeft[2] = {224, 96, 240, 120};+ RECT rcRight[3] = {+ {192, 120, 208, 144},+ {208, 120, 224, 144},+ {224, 120, 240, 144},+ };
- rcRight[0] = {192, 120, 208, 144};- rcRight[1] = {208, 120, 224, 144};- rcRight[2] = {224, 120, 240, 144};-
switch (npc->act_no)
{case 0:
@@ -135,17 +136,18 @@
//Frog
void ActNpc104(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {0, 112, 32, 144},+ {32, 112, 64, 144},+ {64, 112, 96, 144},+ };
- rcLeft[0] = {0, 112, 32, 144};- rcLeft[1] = {32, 112, 64, 144};- rcLeft[2] = {64, 112, 96, 144};+ RECT rcRight[3] = {+ {0, 144, 32, 176},+ {32, 144, 64, 176},+ {64, 144, 96, 176},+ };
- rcRight[0] = {0, 144, 32, 176};- rcRight[1] = {32, 144, 64, 176};- rcRight[2] = {64, 144, 96, 176};-
switch (npc->act_no)
{case 0:
@@ -156,7 +158,7 @@
if (npc->direct == 4)
{- if (Random(0, 1) != 0)
+ if (Random(0, 1))
npc->direct = 0;
else
npc->direct = 2;
@@ -293,11 +295,11 @@
//'HEY!' speech bubble (low)
void ActNpc105(NPCHAR *npc)
{- RECT rect[2];
+ RECT rect[2] = {+ {128, 32, 144, 48},+ {128, 32, 128, 32},+ };
- rect[0] = {128, 32, 144, 48};- rect[1] = {128, 32, 128, 32};-
if (++npc->act_wait > 30)
npc->cond = 0;
@@ -465,19 +467,19 @@
break;
}
- RECT rcPoweron[10];
+ RECT rcPoweron[10] = {+ {144, 0, 160, 24},+ {160, 0, 176, 24},+ {176, 0, 192, 24},+ {192, 0, 208, 24},+ {208, 0, 224, 24},+ {224, 0, 240, 24},+ {176, 0, 192, 24},+ {192, 0, 208, 24},+ {208, 0, 224, 24},+ {192, 0, 208, 24},+ };
- rcPoweron[0] = {144, 0, 160, 24};- rcPoweron[1] = {160, 0, 176, 24};- rcPoweron[2] = {176, 0, 192, 24};- rcPoweron[3] = {192, 0, 208, 24};- rcPoweron[4] = {208, 0, 224, 24};- rcPoweron[5] = {224, 0, 240, 24};- rcPoweron[6] = {176, 0, 192, 24};- rcPoweron[7] = {192, 0, 208, 24};- rcPoweron[8] = {208, 0, 224, 24};- rcPoweron[9] = {192, 0, 208, 24};-
npc->rect = rcPoweron[npc->ani_no];
}
@@ -493,12 +495,12 @@
npc->y += npc->ym;
npc->x += npc->xm;
- RECT rect_left[3];
+ RECT rect_left[3] = {+ {96, 48, 112, 64},+ {112, 48, 128, 64},+ {128, 48, 144, 64},+ };
- rect_left[0] = {96, 48, 112, 64};- rect_left[1] = {112, 48, 128, 64};- rect_left[2] = {128, 48, 144, 64};-
if (++npc->ani_wait > 1)
{npc->ani_wait = 0;
@@ -520,15 +522,16 @@
//Malco (broken)
void ActNpc109(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {240, 0, 256, 24},+ {256, 0, 272, 24},+ };
- rcLeft[0] = {240, 0, 256, 24};- rcLeft[1] = {256, 0, 272, 24};+ RECT rcRight[2] = {+ {240, 24, 256, 48},+ {256, 24, 272, 48},+ };
- rcRight[0] = {240, 24, 256, 48};- rcRight[1] = {256, 24, 272, 48};-
switch (npc->act_no)
{case 0:
@@ -590,17 +593,18 @@
//Puchi
void ActNpc110(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {96, 128, 112, 144},+ {112, 128, 128, 144},+ {128, 128, 144, 144},+ };
- rcLeft[0] = {96, 128, 112, 144};- rcLeft[1] = {112, 128, 128, 144};- rcLeft[2] = {128, 128, 144, 144};+ RECT rcRight[3] = {+ {96, 144, 112, 160},+ {112, 144, 128, 160},+ {128, 144, 144, 160},+ };
- rcRight[0] = {96, 144, 112, 160};- rcRight[1] = {112, 144, 128, 160};- rcRight[2] = {128, 144, 144, 160};-
switch (npc->act_no)
{case 0:
@@ -747,16 +751,17 @@
//Quote (teleport out)
void ActNpc111(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ };
- rcLeft[0] = {0, 0, 16, 16};- rcLeft[1] = {16, 0, 32, 16};+ RECT rcRight[2] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ };
- rcRight[0] = {0, 16, 16, 32};- rcRight[1] = {16, 16, 32, 32};-
- switch ( npc->act_no )
+ switch (npc->act_no)
{case 0:
npc->act_no = 1;
@@ -834,15 +839,16 @@
//Quote (teleport in)
void ActNpc112(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ };
- rcLeft[0] = {0, 0, 16, 16};- rcLeft[1] = {16, 0, 32, 16};+ RECT rcRight[2] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ };
- rcRight[0] = {0, 16, 16, 32};- rcRight[1] = {16, 16, 32, 32};-
switch (npc->act_no)
{case 0:
@@ -909,25 +915,26 @@
//Professor Booster
void ActNpc113(NPCHAR *npc)
{- RECT rcLeft[7];
- RECT rcRight[7];
+ RECT rcLeft[7] = {+ {224, 0, 240, 16},+ {240, 0, 256, 16},+ {256, 0, 272, 16},+ {224, 0, 240, 16},+ {272, 0, 288, 16},+ {224, 0, 240, 16},+ {288, 0, 304, 16},+ };
- rcLeft[0] = {224, 0, 240, 16};- rcLeft[1] = {240, 0, 256, 16};- rcLeft[2] = {256, 0, 272, 16};- rcLeft[3] = {224, 0, 240, 16};- rcLeft[4] = {272, 0, 288, 16};- rcLeft[5] = {224, 0, 240, 16};- rcLeft[6] = {288, 0, 304, 16};+ RECT rcRight[7] = {+ {224, 16, 240, 32},+ {240, 16, 256, 32},+ {256, 16, 272, 32},+ {224, 16, 240, 32},+ {272, 16, 288, 32},+ {224, 16, 240, 32},+ {288, 16, 304, 32},+ };
- rcRight[0] = {224, 16, 240, 32};- rcRight[1] = {240, 16, 256, 32};- rcRight[2] = {256, 16, 272, 32};- rcRight[3] = {224, 16, 240, 32};- rcRight[4] = {272, 16, 288, 32};- rcRight[5] = {224, 16, 240, 32};- rcRight[6] = {288, 16, 304, 32};-
switch (npc->act_no)
{case 0:
@@ -1039,12 +1046,12 @@
//Press
void ActNpc114(NPCHAR *npc)
{- RECT rcLeft[3];
+ RECT rcLeft[3] = {+ {144, 112, 160, 136},+ {160, 112, 176, 136},+ {176, 112, 192, 136},+ };
- rcLeft[0] = {144, 112, 160, 136};- rcLeft[1] = {160, 112, 176, 136};- rcLeft[2] = {176, 112, 192, 136};-
switch (npc->act_no)
{case 0:
@@ -1111,23 +1118,24 @@
//Ravil
void ActNpc115(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {0, 120, 24, 144},+ {24, 120, 48, 144},+ {48, 120, 72, 144},+ {72, 120, 96, 144},+ {96, 120, 120, 144},+ {120, 120, 144, 144},+ };
- rcLeft[0] = {0, 120, 24, 144};- rcLeft[1] = {24, 120, 48, 144};- rcLeft[2] = {48, 120, 72, 144};- rcLeft[3] = {72, 120, 96, 144};- rcLeft[4] = {96, 120, 120, 144};- rcLeft[5] = {120, 120, 144, 144};+ RECT rcRight[6] = {+ {0, 144, 24, 168},+ {24, 144, 48, 168},+ {48, 144, 72, 168},+ {72, 144, 96, 168},+ {96, 144, 120, 168},+ {120, 144, 144, 168},+ };
- rcRight[0] = {0, 144, 24, 168};- rcRight[1] = {24, 144, 48, 168};- rcRight[2] = {48, 144, 72, 168};- rcRight[3] = {72, 144, 96, 168};- rcRight[4] = {96, 144, 120, 168};- rcRight[5] = {120, 144, 144, 168};-
switch (npc->act_no)
{case 0:
@@ -1267,41 +1275,40 @@
//Red petals
void ActNpc116(NPCHAR *npc)
{- RECT rc[1];
+ RECT rc = {272, 184, 320, 200};- rc[0] = {272, 184, 320, 200};-
- npc->rect = rc[0];
+ npc->rect = rc;
}
//Curly
void ActNpc117(NPCHAR *npc)
{- RECT rcLeft[10];
- RECT rcRight[10];
+ RECT rcLeft[10] = {+ {0, 96, 16, 112},+ {16, 96, 32, 112},+ {0, 96, 16, 112},+ {32, 96, 48, 112},+ {0, 96, 16, 112},+ {176, 96, 192, 112},+ {112, 96, 128, 112},+ {160, 96, 176, 112},+ {144, 96, 160, 112},+ {48, 96, 64, 112},+ };
- rcLeft[0] = {0, 96, 16, 112};- rcLeft[1] = {16, 96, 32, 112};- rcLeft[2] = {0, 96, 16, 112};- rcLeft[3] = {32, 96, 48, 112};- rcLeft[4] = {0, 96, 16, 112};- rcLeft[5] = {176, 96, 192, 112};- rcLeft[6] = {112, 96, 128, 112};- rcLeft[7] = {160, 96, 176, 112};- rcLeft[8] = {144, 96, 160, 112};- rcLeft[9] = {48, 96, 64, 112};+ RECT rcRight[10] = {+ {0, 112, 16, 128},+ {16, 112, 32, 128},+ {0, 112, 16, 128},+ {32, 112, 48, 128},+ {0, 112, 16, 128},+ {176, 112, 192, 128},+ {112, 112, 128, 128},+ {160, 112, 176, 128},+ {144, 112, 160, 128},+ {48, 112, 64, 128},+ };
- rcRight[0] = {0, 112, 16, 128};- rcRight[1] = {16, 112, 32, 128};- rcRight[2] = {0, 112, 16, 128};- rcRight[3] = {32, 112, 48, 128};- rcRight[4] = {0, 112, 16, 128};- rcRight[5] = {176, 112, 192, 128};- rcRight[6] = {112, 112, 128, 128};- rcRight[7] = {160, 112, 176, 128};- rcRight[8] = {144, 112, 160, 128};- rcRight[9] = {48, 112, 64, 128};-
switch (npc->act_no)
{case 0:
@@ -1400,7 +1407,7 @@
case 30:
npc->act_no = 31;
npc->act_wait = 0;
- npc->ym = -0x400u;
+ npc->ym = -0x400;
// Fallthrough
case 31:
npc->ani_no = 7;
@@ -1408,7 +1415,7 @@
if (npc->direct == 0)
npc->xm = 0x200;
else
- npc->xm = -0x200u;
+ npc->xm = -0x200;
npc->ym += 0x40;
@@ -1462,29 +1469,30 @@
//Curly (boss)
void ActNpc118(NPCHAR *npc)
{- RECT rcLeft[9];
- RECT rcRight[9];
+ RECT rcLeft[9] = {+ {0, 32, 32, 56},+ {32, 32, 64, 56},+ {64, 32, 96, 56},+ {96, 32, 128, 56},+ {0, 32, 32, 56},+ {128, 32, 160, 56},+ {0, 32, 32, 56},+ {0, 32, 32, 56},+ {160, 32, 192, 56},+ };
- rcLeft[0] = {0, 32, 32, 56};- rcLeft[1] = {32, 32, 64, 56};- rcLeft[2] = {64, 32, 96, 56};- rcLeft[3] = {96, 32, 128, 56};- rcLeft[4] = {0, 32, 32, 56};- rcLeft[5] = {128, 32, 160, 56};- rcLeft[6] = {0, 32, 32, 56};- rcLeft[7] = {0, 32, 32, 56};- rcLeft[8] = {160, 32, 192, 56};+ RECT rcRight[9] = {+ {0, 56, 32, 80},+ {32, 56, 64, 80},+ {64, 56, 96, 80},+ {96, 56, 128, 80},+ {0, 56, 32, 80},+ {128, 56, 160, 80},+ {0, 56, 32, 80},+ {0, 56, 32, 80},+ {160, 56, 192, 80},+ };
- rcRight[0] = {0, 56, 32, 80};- rcRight[1] = {32, 56, 64, 80};- rcRight[2] = {64, 56, 96, 80};- rcRight[3] = {96, 56, 128, 80};- rcRight[4] = {0, 56, 32, 80};- rcRight[5] = {128, 56, 160, 80};- rcRight[6] = {0, 56, 32, 80};- rcRight[7] = {0, 56, 32, 80};- rcRight[8] = {160, 56, 192, 80};-
bool bUpper = false;
if (npc->direct == 0 && gMC.x > npc->x)
@@ -1510,8 +1518,8 @@
else
npc->direct = 2;
- npc->bits |= 0x20u;
- npc->bits &= ~4u;
+ npc->bits |= 0x20;
+ npc->bits &= ~4;
// Fallthrough
case 11:
if (npc->act_wait)
@@ -1552,7 +1560,7 @@
}
else
{- npc->bits |= 0x20u;
+ npc->bits |= 0x20;
npc->act_no = 20;
npc->act_wait = 0;
PlaySoundObject(103, 1);
@@ -1662,9 +1670,7 @@
//Table and chair
void ActNpc119(NPCHAR *npc)
{- RECT rc[1];
+ RECT rc = {248, 184, 272, 200};- rc[0] = {248, 184, 272, 200};-
- npc->rect = rc[0];
+ npc->rect = rc;
}
--- a/src/NpcAct120.cpp
+++ b/src/NpcAct120.cpp
@@ -16,11 +16,11 @@
//Colon (1)
void ActNpc120(NPCHAR *npc)
{- RECT rect[2];
+ RECT rect[2] = {+ {64, 0, 80, 16},+ {64, 16, 80, 32},+ };
- rect[0] = {64, 0, 80, 16};- rect[1] = {64, 16, 80, 32};-
if (npc->direct == 0)
npc->rect = rect[0];
else
@@ -30,12 +30,12 @@
//Colon (2)
void ActNpc121(NPCHAR *npc)
{- RECT rect[3];
+ RECT rect[3] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ {112, 0, 128, 16},+ };
- rect[0] = {0, 0, 16, 16};- rect[1] = {16, 0, 32, 16};- rect[2] = {112, 0, 128, 16};-
if (npc->direct == 0)
{switch (npc->act_no)
@@ -81,31 +81,32 @@
//Colon (attacking)
void ActNpc122(NPCHAR *npc)
{- RECT rcLeft[10];
- RECT rcRight[10];
+ RECT rcLeft[10] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ {32, 0, 48, 16},+ {0, 0, 16, 16},+ {48, 0, 64, 16},+ {0, 0, 16, 16},+ {80, 0, 96, 16},+ {96, 0, 112, 16},+ {112, 0, 128, 16},+ {128, 0, 144, 16},+ };
- rcLeft[0] = {0, 0, 16, 16};- rcLeft[1] = {16, 0, 32, 16};- rcLeft[2] = {32, 0, 48, 16};- rcLeft[3] = {0, 0, 16, 16};- rcLeft[4] = {48, 0, 64, 16};- rcLeft[5] = {0, 0, 16, 16};- rcLeft[6] = {80, 0, 96, 16};- rcLeft[7] = {96, 0, 112, 16};- rcLeft[8] = {112, 0, 128, 16};- rcLeft[9] = {128, 0, 144, 16};+ RECT rcRight[10] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ {32, 16, 48, 32},+ {0, 16, 16, 32},+ {48, 16, 64, 32},+ {0, 16, 16, 32},+ {80, 16, 96, 32},+ {96, 16, 112, 32},+ {112, 16, 128, 32},+ {128, 16, 144, 32},+ };
- rcRight[0] = {0, 16, 16, 32};- rcRight[1] = {16, 16, 32, 32};- rcRight[2] = {32, 16, 48, 32};- rcRight[3] = {0, 16, 16, 32};- rcRight[4] = {48, 16, 64, 32};- rcRight[5] = {0, 16, 16, 32};- rcRight[6] = {80, 16, 96, 32};- rcRight[7] = {96, 16, 112, 32};- rcRight[8] = {112, 16, 128, 32};- rcRight[9] = {128, 16, 144, 32};-
switch (npc->act_no)
{case 0:
@@ -269,13 +270,13 @@
//Curly boss projectile
void ActNpc123(NPCHAR *npc)
{- RECT rect[4];
+ RECT rect[4] = {+ {192, 0, 208, 16},+ {208, 0, 224, 16},+ {224, 0, 240, 16},+ {240, 0, 256, 16},+ };
- rect[0] = {192, 0, 208, 16};- rect[1] = {208, 0, 224, 16};- rect[2] = {224, 0, 240, 16};- rect[3] = {240, 0, 256, 16};-
bool bBreak = false;
switch (npc->act_no)
@@ -347,11 +348,11 @@
//Sunstone
void ActNpc124(NPCHAR *npc)
{- RECT rect[2];
+ RECT rect[2] = {+ {160, 0, 192, 32},+ {192, 0, 224, 32},+ };
- rect[0] = {160, 0, 192, 32};- rect[1] = {192, 0, 224, 32};-
switch (npc->act_no)
{case 0:
@@ -412,11 +413,11 @@
npc->cond = 0;
}
- RECT rc[2];
+ RECT rc[2] = {+ {0, 96, 16, 112},+ {16, 96, 32, 112},+ };
- rc[0] = {0, 96, 16, 112};- rc[1] = {16, 96, 32, 112};-
if (npc->direct == 0)
npc->rect = rc[0];
else
@@ -426,23 +427,24 @@
//Puppy (running)
void ActNpc126(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {48, 144, 64, 160},+ {64, 144, 80, 160},+ {48, 144, 64, 160},+ {80, 144, 96, 160},+ {96, 144, 112, 160},+ {112, 144, 128, 160},+ };
- rcLeft[0] = {48, 144, 64, 160};- rcLeft[1] = {64, 144, 80, 160};- rcLeft[2] = {48, 144, 64, 160};- rcLeft[3] = {80, 144, 96, 160};- rcLeft[4] = {96, 144, 112, 160};- rcLeft[5] = {112, 144, 128, 160};+ RECT rcRight[6] = {+ {48, 160, 64, 176},+ {64, 160, 80, 176},+ {48, 160, 64, 176},+ {80, 160, 96, 176},+ {96, 160, 112, 176},+ {112, 160, 128, 176},+ };
- rcRight[0] = {48, 160, 64, 176};- rcRight[1] = {64, 160, 80, 176};- rcRight[2] = {48, 160, 64, 176};- rcRight[3] = {80, 160, 96, 176};- rcRight[4] = {96, 160, 112, 176};- rcRight[5] = {112, 160, 128, 176};-
switch (npc->act_no)
{case 0:
@@ -557,15 +559,18 @@
//Machine gun trail (Level 2)
void ActNpc127(NPCHAR *npc)
{- RECT rcV[3];
- RECT rcH[3];
- rcV[0] = {112, 48, 128, 64};- rcV[1] = {112, 64, 128, 80};- rcV[2] = {112, 80, 128, 96};- rcH[0] = {64, 80, 80, 96};- rcH[1] = {80, 80, 96, 96};- rcH[2] = {96, 80, 112, 96};-
+ RECT rcV[3] = {+ {112, 48, 128, 64},+ {112, 64, 128, 80},+ {112, 80, 128, 96},+ };
+
+ RECT rcH[3] = {+ {64, 80, 80, 96},+ {80, 80, 96, 96},+ {96, 80, 112, 96},+ };
+
if (++npc->ani_wait > 0)
{npc->ani_wait = 0;
@@ -582,33 +587,39 @@
//Machine gun trail (Level 3)
void ActNpc128(NPCHAR *npc)
{- RECT rcLeft[5];
- RECT rcRight[5];
- RECT rcUp[5];
- RECT rcDown[5];
+ RECT rcLeft[5] = {+ {0, 0, 0, 0},+ {176, 16, 184, 32},+ {184, 16, 192, 32},+ {192, 16, 200, 32},+ {200, 16, 208, 32},+ };
- rcLeft[0] = {0, 0, 0, 0};- rcLeft[1] = {176, 16, 184, 32};- rcLeft[2] = {184, 16, 192, 32};- rcLeft[3] = {192, 16, 200, 32};- rcLeft[4] = {200, 16, 208, 32};- rcRight[0] = {0, 0, 0, 0};- rcRight[1] = {232, 16, 240, 32};- rcRight[2] = {224, 16, 232, 32};- rcRight[3] = {216, 16, 224, 32};- rcRight[4] = {208, 16, 216, 32};- rcUp[0] = {0, 0, 0, 0};- rcUp[1] = {176, 32, 192, 40};- rcUp[2] = {176, 40, 192, 48};- rcUp[3] = {192, 32, 208, 40};- rcUp[4] = {192, 40, 208, 48};- rcDown[0] = {0, 0, 0, 0};- rcDown[1] = {208, 32, 224, 40};- rcDown[2] = {208, 40, 224, 48};- rcDown[3] = {224, 32, 232, 40};- rcDown[4] = {224, 40, 232, 48};+ RECT rcRight[5] = {+ {0, 0, 0, 0},+ {232, 16, 240, 32},+ {224, 16, 232, 32},+ {216, 16, 224, 32},+ {208, 16, 216, 32},+ };
+
+ RECT rcUp[5] = {+ {0, 0, 0, 0},+ {176, 32, 192, 40},+ {176, 40, 192, 48},+ {192, 32, 208, 40},+ {192, 40, 208, 48},+ };
+
+ RECT rcDown[5] = {+ {0, 0, 0, 0},+ {208, 32, 224, 40},+ {208, 40, 224, 48},+ {224, 32, 232, 40},+ {224, 40, 232, 48},+ };
- if (!npc->act_no)
+ if (npc->act_no == 0)
{npc->act_no = 1;
@@ -647,25 +658,26 @@
//Fireball trail (Level 2 & 3)
void ActNpc129(NPCHAR *npc)
{- RECT rect[18];
- rect[0] = {0x80, 0x30, 0x90, 0x40};- rect[1] = {0x90, 0x30, 0xA0, 0x40};- rect[2] = {0xA0, 0x30, 0xB0, 0x40};- rect[3] = {0x80, 0x40, 0x90, 0x50};- rect[4] = {0x90, 0x40, 0xA0, 0x50};- rect[5] = {0xA0, 0x40, 0xB0, 0x50};- rect[6] = {0x80, 0x50, 0x90, 0x60};- rect[7] = {0x90, 0x50, 0xA0, 0x60};- rect[8] = {0xA0, 0x50, 0xB0, 0x60};- rect[9] = {0xB0, 0x30, 0xC0, 0x40};- rect[10] = {0xC0, 0x30, 0xD0, 0x40};- rect[11] = {0xD0, 0x30, 0xE0, 0x40};- rect[12] = {0xB0, 0x40, 0xC0, 0x50};- rect[13] = {0xC0, 0x40, 0xD0, 0x50};- rect[14] = {0xD0, 0x40, 0xE0, 0x50};- rect[15] = {0xB0, 0x50, 0xC0, 0x60};- rect[16] = {0xC0, 0x50, 0xD0, 0x60};- rect[17] = {0xD0, 0x50, 0xE0, 0x60};+ RECT rect[18] = {+ {0x80, 0x30, 0x90, 0x40},+ {0x90, 0x30, 0xA0, 0x40},+ {0xA0, 0x30, 0xB0, 0x40},+ {0x80, 0x40, 0x90, 0x50},+ {0x90, 0x40, 0xA0, 0x50},+ {0xA0, 0x40, 0xB0, 0x50},+ {0x80, 0x50, 0x90, 0x60},+ {0x90, 0x50, 0xA0, 0x60},+ {0xA0, 0x50, 0xB0, 0x60},+ {0xB0, 0x30, 0xC0, 0x40},+ {0xC0, 0x30, 0xD0, 0x40},+ {0xD0, 0x30, 0xE0, 0x40},+ {0xB0, 0x40, 0xC0, 0x50},+ {0xC0, 0x40, 0xD0, 0x50},+ {0xD0, 0x40, 0xE0, 0x50},+ {0xB0, 0x50, 0xC0, 0x60},+ {0xC0, 0x50, 0xD0, 0x60},+ {0xD0, 0x50, 0xE0, 0x60},+ };
if (++npc->ani_wait > 1)
{@@ -682,19 +694,20 @@
//Puppy (sitting, wagging tail)
void ActNpc130(NPCHAR *npc)
{- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {48, 144, 64, 160},+ {64, 144, 80, 160},+ {48, 144, 64, 160},+ {80, 144, 96, 160},+ };
- rcLeft[0] = {48, 144, 64, 160};- rcLeft[1] = {64, 144, 80, 160};- rcLeft[2] = {48, 144, 64, 160};- rcLeft[3] = {80, 144, 96, 160};+ RECT rcRight[4] = {+ {48, 160, 64, 176},+ {64, 160, 80, 176},+ {48, 160, 64, 176},+ {80, 160, 96, 176},+ };
- rcRight[0] = {48, 160, 64, 176};- rcRight[1] = {64, 160, 80, 176};- rcRight[2] = {48, 160, 64, 176};- rcRight[3] = {80, 160, 96, 176};-
switch (npc->act_no)
{case 0:
@@ -759,12 +772,9 @@
//Puppy (sleeping)
void ActNpc131(NPCHAR *npc)
{- RECT rcLeft[1];
- RECT rcRight[1];
+ RECT rcLeft[1] = {144, 144, 160, 160};+ RECT rcRight[1] = {144, 160, 160, 176};- rcLeft[0] = {144, 144, 160, 160};- rcRight[0] = {144, 160, 160, 176};-
if (++npc->act_wait > 100)
{npc->act_wait = 0;
@@ -780,21 +790,22 @@
//Puppy (barking)
void ActNpc132(NPCHAR *npc)
{- RECT rcLeft[5];
- RECT rcRight[5];
+ RECT rcLeft[5] = {+ {48, 144, 64, 160},+ {64, 144, 80, 160},+ {96, 144, 112, 160},+ {96, 144, 112, 160},+ {128, 144, 144, 160},+ };
- rcLeft[0] = {48, 144, 64, 160};- rcLeft[1] = {64, 144, 80, 160};- rcLeft[2] = {96, 144, 112, 160};- rcLeft[3] = {96, 144, 112, 160};- rcLeft[4] = {128, 144, 144, 160};+ RECT rcRight[5] = {+ {48, 160, 64, 176},+ {64, 160, 80, 176},+ {96, 160, 112, 176},+ {96, 160, 112, 176},+ {128, 160, 144, 176},+ };
- rcRight[0] = {48, 160, 64, 176};- rcRight[1] = {64, 160, 80, 176};- rcRight[2] = {96, 160, 112, 176};- rcRight[3] = {96, 160, 112, 176};- rcRight[4] = {128, 160, 144, 176};-
if (npc->act_no < 100)
{if (gMC.x < npc->x)
@@ -924,15 +935,16 @@
//Jenka
void ActNpc133(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {176, 32, 192, 48},+ {192, 32, 208, 48},+ };
- rcLeft[0] = {176, 32, 192, 48};- rcLeft[1] = {192, 32, 208, 48};+ RECT rcRight[2] = {+ {176, 48, 192, 64},+ {192, 48, 208, 64},+ };
- rcRight[0] = {176, 48, 192, 64};- rcRight[1] = {192, 48, 208, 64};-
switch (npc->act_no)
{case 0:
@@ -969,17 +981,18 @@
//Armadillo
void ActNpc134(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {224, 0, 256, 16},+ {256, 0, 288, 16},+ {288, 0, 320, 16},+ };
- rcLeft[0] = {224, 0, 256, 16};- rcLeft[1] = {256, 0, 288, 16};- rcLeft[2] = {288, 0, 320, 16};+ RECT rcRight[3] = {+ {224, 16, 256, 32},+ {256, 16, 288, 32},+ {288, 16, 320, 32},+ };
- rcRight[0] = {224, 16, 256, 32};- rcRight[1] = {256, 16, 288, 32};- rcRight[2] = {288, 16, 320, 32};-
switch (npc->act_no)
{case 0:
@@ -1057,15 +1070,16 @@
//Skeleton
void ActNpc135(NPCHAR *npc)
{- RECT rcRight[2];
- RECT rcLeft[2];
+ RECT rcLeft[2] = {+ {256, 32, 288, 64},+ {288, 32, 320, 64},+ };
- rcLeft[0] = {256, 32, 288, 64};- rcLeft[1] = {288, 32, 320, 64};+ RECT rcRight[2] = {+ {256, 64, 288, 96},+ {288, 64, 320, 96},+ };
- rcRight[0] = {256, 64, 288, 96};- rcRight[1] = {288, 64, 320, 96};-
if (gMC.x < npc->x - 0x2C000 || gMC.x > npc->x + 0x2C000 || gMC.y < npc->y - 0x14000 || gMC.y > npc->y + 0x8000)
npc->act_no = 0;
@@ -1165,15 +1179,16 @@
//Puppy (carried)
void ActNpc136(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {48, 144, 64, 160},+ {64, 144, 80, 160},+ };
- rcLeft[0] = {48, 144, 64, 160};- rcLeft[1] = {64, 144, 80, 160};+ RECT rcRight[2] = {+ {48, 160, 64, 176},+ {64, 160, 80, 176},+ };
- rcRight[0] = {48, 160, 64, 176};- rcRight[1] = {64, 160, 80, 176};-
switch (npc->act_no)
{case 0:
@@ -1227,22 +1242,17 @@
//Large door (frame)
void ActNpc137(NPCHAR *npc)
{- RECT rc[1];
+ RECT rc = {96, 136, 128, 188};- rc[0] = {96, 136, 128, 188};-
- npc->rect = rc[0];
+ npc->rect = rc;
}
//Large door (door)
void ActNpc138(NPCHAR *npc)
{- RECT rcLeft[1];
- RECT rcRight[1];
+ RECT rcLeft = {96, 112, 112, 136};+ RECT rcRight = {112, 112, 128, 136};- rcLeft[0] = {96, 112, 112, 136};- rcRight[0] = {112, 112, 128, 136};-
switch (npc->act_no)
{case 0:
@@ -1250,12 +1260,12 @@
if (npc->direct == 0)
{- npc->rect = rcLeft[0];
+ npc->rect = rcLeft;
npc->x += 0x1000;
}
else
{- npc->rect = rcRight[0];
+ npc->rect = rcRight;
npc->x -= 0x1000;
}
@@ -1274,13 +1284,13 @@
if (npc->direct == 0)
{- npc->rect = rcLeft[0];
+ npc->rect = rcLeft;
npc->rect.left += npc->act_wait / 8;
}
else
{npc->x = npc->tgt_x + ((npc->act_wait / 8) * 0x200);
- npc->rect = rcRight[0];
+ npc->rect = rcRight;
npc->rect.right -= npc->act_wait / 8;
}
@@ -1294,16 +1304,17 @@
//Doctor
void ActNpc139(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {0, 128, 24, 160},+ {24, 128, 48, 160},+ {48, 128, 72, 160},+ };
- rcLeft[0] = {0, 128, 24, 160};- rcLeft[1] = {24, 128, 48, 160};- rcLeft[2] = {48, 128, 72, 160};-
- rcRight[0] = {0, 160, 24, 192};- rcRight[1] = {24, 160, 48, 192};- rcRight[2] = {48, 160, 72, 192};+ RECT rcRight[3] = {+ {0, 160, 24, 192},+ {24, 160, 48, 192},+ {48, 160, 72, 192},+ };
switch (npc->act_no)
{--- a/src/NpcAct140.cpp
+++ b/src/NpcAct140.cpp
@@ -17,39 +17,40 @@
//Toroko (frenzied)
void ActNpc140(NPCHAR *npc)
{- RECT rcLeft[14];
- RECT rcRight[14];
+ RECT rcLeft[14] = {+ {0, 0, 32, 32},+ {32, 0, 64, 32},+ {64, 0, 96, 32},+ {96, 0, 128, 32},+ {128, 0, 160, 32},+ {160, 0, 192, 32},+ {192, 0, 224, 32},+ {224, 0, 256, 32},+ {0, 64, 32, 96},+ {32, 64, 64, 96},+ {64, 64, 96, 96},+ {96, 64, 128, 96},+ {128, 64, 160, 96},+ {0, 0, 0, 0},+ };
- rcLeft[0] = {0, 0, 32, 32};- rcLeft[1] = {32, 0, 64, 32};- rcLeft[2] = {64, 0, 96, 32};- rcLeft[3] = {96, 0, 128, 32};- rcLeft[4] = {128, 0, 160, 32};- rcLeft[5] = {160, 0, 192, 32};- rcLeft[6] = {192, 0, 224, 32};- rcLeft[7] = {224, 0, 256, 32};- rcLeft[8] = {0, 64, 32, 96};- rcLeft[9] = {32, 64, 64, 96};- rcLeft[10] = {64, 64, 96, 96};- rcLeft[11] = {96, 64, 128, 96};- rcLeft[12] = {128, 64, 160, 96};- rcLeft[13] = {0, 0, 0, 0};+ RECT rcRight[14] = {+ {0, 32, 32, 64},+ {32, 32, 64, 64},+ {64, 32, 96, 64},+ {96, 32, 128, 64},+ {128, 32, 160, 64},+ {160, 32, 192, 64},+ {192, 32, 224, 64},+ {224, 32, 256, 64},+ {0, 96, 32, 128},+ {32, 96, 64, 128},+ {64, 96, 96, 128},+ {96, 96, 128, 128},+ {128, 96, 160, 128},+ {0, 0, 0, 0},+ };
- rcRight[0] = {0, 32, 32, 64};- rcRight[1] = {32, 32, 64, 64};- rcRight[2] = {64, 32, 96, 64};- rcRight[3] = {96, 32, 128, 64};- rcRight[4] = {128, 32, 160, 64};- rcRight[5] = {160, 32, 192, 64};- rcRight[6] = {192, 32, 224, 64};- rcRight[7] = {224, 32, 256, 64};- rcRight[8] = {0, 96, 32, 128};- rcRight[9] = {32, 96, 64, 128};- rcRight[10] = {64, 96, 96, 128};- rcRight[11] = {96, 96, 128, 128};- rcRight[12] = {128, 96, 160, 128};- rcRight[13] = {0, 0, 0, 0};-
switch (npc->act_no)
{case 0:
@@ -362,11 +363,11 @@
// Toroko block projectile
void ActNpc141(NPCHAR *npc)
{- RECT rect[2]; // [sp+8h] [bp-24h]@1
+ RECT rect[2] = {+ {288, 32, 304, 48},+ {304, 32, 320, 48},+ };
- rect[0] = {288, 32, 304, 48};- rect[1] = {304, 32, 320, 48};-
switch (npc->act_no)
{case 0:
@@ -450,14 +451,14 @@
// Flower Cub
void ActNpc142(NPCHAR *npc)
{- RECT rect[5];
+ RECT rect[5] = {+ {0, 128, 16, 144},+ {16, 128, 32, 144},+ {32, 128, 48, 144},+ {48, 128, 64, 144},+ {64, 128, 80, 144},+ };
- rect[0] = {0, 128, 16, 144};- rect[1] = {16, 128, 32, 144};- rect[2] = {32, 128, 48, 144};- rect[3] = {48, 128, 64, 144};- rect[4] = {64, 128, 80, 144};-
switch (npc->act_no)
{case 10:
@@ -538,13 +539,9 @@
// Jenka (collapsed)
void ActNpc143(NPCHAR *npc)
{- RECT rcLeft[1];
- RECT rcRight[1];
+ RECT rcLeft[1] = {208, 32, 224, 48};+ RECT rcRight[1] = {208, 48, 224, 64};- rcLeft[0] = {208, 32, 224, 48};-
- rcRight[0] = {208, 48, 224, 64};-
if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
else
@@ -554,21 +551,22 @@
//Toroko (teleporting in)
void ActNpc144(NPCHAR *npc)
{- RECT rcLeft[5];
- RECT rcRight[5];
+ RECT rcLeft[5] = {+ {0, 64, 16, 80},+ {16, 64, 32, 80},+ {32, 64, 48, 80},+ {16, 64, 32, 80},+ {128, 64, 144, 80},+ };
- rcLeft[0] = {0, 64, 16, 80};- rcLeft[1] = {16, 64, 32, 80};- rcLeft[2] = {32, 64, 48, 80};- rcLeft[3] = {16, 64, 32, 80};- rcLeft[4] = {128, 64, 144, 80};+ RECT rcRight[5] = {+ {0, 80, 16, 96},+ {16, 80, 32, 96},+ {32, 80, 48, 96},+ {16, 80, 32, 96},+ {128, 80, 144, 96},+ };
- rcRight[0] = {0, 80, 16, 96};- rcRight[1] = {16, 80, 32, 96};- rcRight[2] = {32, 80, 48, 96};- rcRight[3] = {16, 80, 32, 96};- rcRight[4] = {128, 80, 144, 96};-
switch (npc->act_no)
{case 0:
@@ -660,12 +658,9 @@
//King's sword
void ActNpc145(NPCHAR *npc)
{- RECT rcLeft[1];
- RECT rcRight[1];
+ RECT rcLeft[1] = {96, 32, 112, 48};+ RECT rcRight[1] = {112, 32, 128, 48};- rcLeft[0] = {96, 32, 112, 48};- rcRight[0] = {112, 32, 128, 48};-
if (npc->act_no == 0)
{if (npc->pNpc->count2 == 0)
@@ -700,14 +695,14 @@
//Lightning
void ActNpc146(NPCHAR *npc)
{- RECT rect[5];
+ RECT rect[5] = {+ {0, 0, 0, 0},+ {256, 0, 272, 240},+ {272, 0, 288, 240},+ {288, 0, 304, 240},+ {304, 0, 320, 240},+ };
- rect[0] = {0, 0, 0, 0};- rect[1] = {256, 0, 272, 240};- rect[2] = {272, 0, 288, 240};- rect[3] = {288, 0, 304, 240};- rect[4] = {304, 0, 320, 240};-
switch (npc->act_no)
{case 0:
@@ -750,23 +745,24 @@
//Critter (purple)
void ActNpc147(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {0, 96, 16, 112},+ {16, 96, 32, 112},+ {32, 96, 48, 112},+ {48, 96, 64, 112},+ {64, 96, 80, 112},+ {80, 96, 96, 112},+ };
- rcLeft[0] = {0, 96, 16, 112};- rcLeft[1] = {16, 96, 32, 112};- rcLeft[2] = {32, 96, 48, 112};- rcLeft[3] = {48, 96, 64, 112};- rcLeft[4] = {64, 96, 80, 112};- rcLeft[5] = {80, 96, 96, 112};+ RECT rcRight[6] = {+ {0, 112, 16, 128},+ {16, 112, 32, 128},+ {32, 112, 48, 128},+ {48, 112, 64, 128},+ {64, 112, 80, 128},+ {80, 112, 96, 128},+ };
- rcRight[0] = {0, 112, 16, 128};- rcRight[1] = {16, 112, 32, 128};- rcRight[2] = {32, 112, 48, 128};- rcRight[3] = {48, 112, 64, 128};- rcRight[4] = {64, 112, 80, 128};- rcRight[5] = {80, 112, 96, 128};-
switch (npc->act_no)
{case 0:
@@ -937,11 +933,11 @@
npc->y += npc->ym;
npc->x += npc->xm;
- RECT rect_left[2];
+ RECT rect_left[2] = {+ {96, 96, 104, 104},+ {104, 96, 112, 104},+ };
- rect_left[0] = {96, 96, 104, 104};- rect_left[1] = {104, 96, 112, 104};-
if (++npc->ani_no > 1)
npc->ani_no = 0;
@@ -1072,39 +1068,37 @@
npc->x += npc->xm;
- RECT rect[1];
-
- rect[0] = {16, 0, 48, 32};-
- npc->rect = rect[0];
+ RECT rect = {16, 0, 48, 32};+ npc->rect = rect;
}
//Quote
void ActNpc150(NPCHAR *npc)
{- RECT rcLeft[9];
- RECT rcRight[9];
+ RECT rcLeft[9] = {+ {0, 0, 16, 16},+ {48, 0, 64, 16},+ {144, 0, 160, 16},+ {16, 0, 32, 16},+ {0, 0, 16, 16},+ {32, 0, 48, 16},+ {0, 0, 16, 16},+ {160, 0, 176, 16},+ {112, 0, 128, 16},+ };
+
+ RECT rcRight[9] = {+ {0, 16, 16, 32},+ {48, 16, 64, 32},+ {144, 16, 160, 32},+ {16, 16, 32, 32},+ {0, 16, 16, 32},+ {32, 16, 48, 32},+ {0, 16, 16, 32},+ {160, 16, 176, 32},+ {112, 16, 128, 32},+ };
- rcLeft[0] = {0, 0, 16, 16};- rcLeft[1] = {48, 0, 64, 16};- rcLeft[2] = {144, 0, 160, 16};- rcLeft[3] = {16, 0, 32, 16};- rcLeft[4] = {0, 0, 16, 16};- rcLeft[5] = {32, 0, 48, 16};- rcLeft[6] = {0, 0, 16, 16};- rcLeft[7] = {160, 0, 176, 16};- rcLeft[8] = {112, 0, 128, 16};-
- rcRight[0] = {0, 16, 16, 32};- rcRight[1] = {48, 16, 64, 32};- rcRight[2] = {144, 16, 160, 32};- rcRight[3] = {16, 16, 32, 32};- rcRight[4] = {0, 16, 16, 32};- rcRight[5] = {32, 16, 48, 32};- rcRight[6] = {0, 16, 16, 32};- rcRight[7] = {160, 16, 176, 32};- rcRight[8] = {112, 16, 128, 32};-
switch (npc->act_no)
{case 0:
@@ -1218,19 +1212,17 @@
if (npc->ani_no > 6)
npc->ani_no = 3;
break;
- default:
- break;
}
- if (npc->direct)
- npc->rect = rcRight[npc->ani_no];
- else
+ if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
+ else
+ npc->rect = rcRight[npc->ani_no];
if (npc->act_no == 21)
{npc->rect.bottom = npc->act_wait / 4 + npc->rect.top;
- if (npc->act_wait / 2 & 1)
+ if (npc->act_wait / 2 % 2)
++npc->rect.left;
}
@@ -1244,15 +1236,16 @@
//Blue robot (standing)
void ActNpc151(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {192, 0, 208, 16},+ {208, 0, 224, 16},+ };
- rcLeft[0] = {192, 0, 208, 16};- rcLeft[1] = {208, 0, 224, 16};+ RECT rcRight[2] = {+ {192, 16, 208, 32},+ {208, 16, 224, 32},+ };
- rcRight[0] = {192, 16, 208, 32};- rcRight[1] = {208, 16, 224, 32};-
switch (npc->act_no)
{case 0:
@@ -1290,13 +1283,17 @@
//Shutter stuck
void ActNpc152(NPCHAR *npc)
{- if (!npc->act_no)
+ RECT rc = {0, 0, 0, 0};+
+ if (npc->act_no == 0)
{if (npc->direct == 2)
npc->y += 0x2000;
+
npc->act_no = 1;
}
- npc->rect = {0, 0, 0, 0};+
+ npc->rect = rc;
}
static const RECT grcKitL[21] = {@@ -1681,8 +1678,6 @@
//Gaudi projectile
void ActNpc156(NPCHAR *npc)
{- RECT rect_left[3];
-
if (npc->flag & 0xFF)
{SetCaret(npc->x, npc->y, 2, 0);
@@ -1692,9 +1687,11 @@
npc->y += npc->ym;
npc->x += npc->xm;
- rect_left[0] = {96, 112, 112, 128};- rect_left[1] = {112, 112, 128, 128};- rect_left[2] = {128, 112, 144, 128};+ RECT rect_left[3] = {+ {96, 112, 112, 128},+ {112, 112, 128, 128},+ {128, 112, 144, 128},+ };
if (++npc->ani_no > 2)
npc->ani_no = 0;
@@ -1825,27 +1822,24 @@
npc->y += npc->ym;
- RECT rect[1];
-
- rect[0] = {16, 0, 48, 32};-
- npc->rect = rect[0];
+ RECT rect = {16, 0, 48, 32};+ npc->rect = rect;
}
//Fish Missile
void ActNpc158(NPCHAR *npc)
{- RECT rect[8];
+ RECT rect[8] = {+ {0, 224, 16, 240},+ {16, 224, 32, 240},+ {32, 224, 48, 240},+ {48, 224, 64, 240},+ {64, 224, 80, 240},+ {80, 224, 96, 240},+ {96, 224, 112, 240},+ {112, 224, 128, 240},+ };
- rect[0] = {0, 224, 16, 240};- rect[1] = {16, 224, 32, 240};- rect[2] = {32, 224, 48, 240};- rect[3] = {48, 224, 64, 240};- rect[4] = {64, 224, 80, 240};- rect[5] = {80, 224, 96, 240};- rect[6] = {96, 224, 112, 240};- rect[7] = {112, 224, 128, 240};-
switch (npc->act_no)
{case 0:
@@ -1914,10 +1908,8 @@
//Monster X (defeated)
void ActNpc159(NPCHAR *npc)
{- RECT rect[1];
+ RECT rect = {144, 128, 192, 200};- rect[0] = {144, 128, 192, 200};-
switch (npc->act_no)
{case 0:
@@ -1953,7 +1945,7 @@
npc->y += npc->ym;
npc->x += npc->xm;
- npc->rect = rect[0];
+ npc->rect = rect;
if (npc->act_wait % 8 == 1)
SetNpChar(4, npc->x + (Random(-16, 16) * 0x200), npc->y + (Random(-16, 16) * 0x200), Random(-341, 341), Random(-341, 341), 0, 0, 0x100);
--- a/src/NpcAct160.cpp
+++ b/src/NpcAct160.cpp
@@ -152,19 +152,20 @@
break;
}
- RECT rect_left[4];
- RECT rect_right[4];
+ RECT rect_left[4] = {+ {0, 0, 40, 24},+ {40, 0, 80, 24},+ {80, 0, 120, 24},+ {120, 0, 160, 24},+ };
- rect_left[0] = {0, 0, 40, 24};- rect_left[1] = {40, 0, 80, 24};- rect_left[2] = {80, 0, 120, 24};- rect_left[3] = {120, 0, 160, 24};+ RECT rect_right[4] = {+ {0, 24, 40, 48},+ {40, 24, 80, 48},+ {80, 24, 120, 48},+ {120, 24, 160, 48},+ };
- rect_right[0] = {0, 24, 40, 48};- rect_right[1] = {40, 24, 80, 48};- rect_right[2] = {80, 24, 120, 48};- rect_right[3] = {120, 24, 160, 48};-
if (npc->direct == 0)
npc->rect = rect_left[npc->ani_no];
else
@@ -174,8 +175,6 @@
//Puu Black projectile
void ActNpc161(NPCHAR *npc)
{- RECT rect[3];
-
npc->exp = 0;
if (gSuperXpos > npc->x)
@@ -217,9 +216,11 @@
npc->ani_no = 1;
}
- rect[0] = {0, 48, 16, 64};- rect[1] = {16, 48, 32, 64};- rect[2] = {32, 48, 48, 64};+ RECT rect[3] = {+ {0, 48, 16, 64},+ {16, 48, 32, 64},+ {32, 48, 48, 64},+ };
npc->rect = rect[npc->ani_no];
}
@@ -314,15 +315,16 @@
//Dr Gero
void ActNpc163(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {192, 0, 208, 16},+ {208, 0, 224, 16},+ };
- rcLeft[0] = {192, 0, 208, 16};- rcLeft[1] = {208, 0, 224, 16};+ RECT rcRight[2] = {+ {192, 16, 208, 32},+ {208, 16, 224, 32},+ };
- rcRight[0] = {192, 16, 208, 32};- rcRight[1] = {208, 16, 224, 32};-
switch (npc->act_no)
{case 0:
@@ -359,15 +361,16 @@
//Nurse Hasumi
void ActNpc164(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {224, 0, 240, 16},+ {240, 0, 256, 16},+ };
- rcLeft[0] = {224, 0, 240, 16};- rcLeft[1] = {240, 0, 256, 16};+ RECT rcRight[2] = {+ {224, 16, 240, 32},+ {240, 16, 256, 32},+ };
- rcRight[0] = {224, 16, 240, 32};- rcRight[1] = {240, 16, 256, 32};-
switch (npc->act_no)
{case 0:
@@ -404,14 +407,13 @@
//Curly (collapsed)
void ActNpc165(NPCHAR *npc)
{- RECT rcRight[2];
- RECT rcLeft[1];
+ RECT rcRight[2] = {+ {192, 96, 208, 112},+ {208, 96, 224, 112},+ };
- rcRight[0] = {192, 96, 208, 112};- rcRight[1] = {208, 96, 224, 112};+ RECT rcLeft = {144, 96, 160, 112};- rcLeft[0] = {144, 96, 160, 112};-
switch (npc->act_no)
{case 0:
@@ -428,7 +430,7 @@
}
if (npc->direct == 0)
- npc->rect = rcLeft[0];
+ npc->rect = rcLeft;
else
npc->rect = rcRight[npc->ani_no];
}
@@ -436,11 +438,11 @@
//Chaba
void ActNpc166(NPCHAR *npc)
{- RECT rcLeft[2];
+ RECT rcLeft[2] = {+ {144, 104, 184, 128},+ {184, 104, 224, 128},+ };
- rcLeft[0] = {144, 104, 184, 128};- rcLeft[1] = {184, 104, 224, 128};-
switch (npc->act_no)
{case 0:
@@ -474,12 +476,12 @@
//Professor Booster (falling)
void ActNpc167(NPCHAR *npc)
{- RECT rect[3];
+ RECT rect[3] = {+ {304, 0, 320, 16},+ {304, 16, 320, 32},+ {0, 0, 0, 0},+ };
- rect[0] = {304, 0, 320, 16};- rect[1] = {304, 16, 320, 32};- rect[2] = {0, 0, 0, 0};-
switch (npc->act_no)
{case 0:
@@ -522,10 +524,8 @@
//Boulder
void ActNpc168(NPCHAR *npc)
{- RECT rect[1];
+ RECT rect = {264, 56, 320, 96};- rect[0] = {264, 56, 320, 96};-
switch (npc->act_no)
{case 0:
@@ -572,7 +572,7 @@
break;
}
- npc->rect = rect[0];
+ npc->rect = rect;
}
//Balrog (missile)
@@ -791,29 +791,30 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rect_left[9];
- RECT rect_right[9];
+ RECT rect_left[9] = {+ {0, 0, 40, 24},+ {0, 48, 40, 72},+ {0, 0, 40, 24},+ {40, 48, 80, 72},+ {0, 0, 40, 24},+ {80, 48, 120, 72},+ {120, 48, 160, 72},+ {120, 0, 160, 24},+ {80, 0, 120, 24},+ };
- rect_left[0] = {0, 0, 40, 24};- rect_left[1] = {0, 48, 40, 72};- rect_left[2] = {0, 0, 40, 24};- rect_left[3] = {40, 48, 80, 72};- rect_left[4] = {0, 0, 40, 24};- rect_left[5] = {80, 48, 120, 72};- rect_left[6] = {120, 48, 160, 72};- rect_left[7] = {120, 0, 160, 24};- rect_left[8] = {80, 0, 120, 24};+ RECT rect_right[9] = {+ {0, 24, 40, 48},+ {0, 72, 40, 96},+ {0, 24, 40, 48},+ {40, 72, 80, 96},+ {0, 24, 40, 48},+ {80, 72, 120, 96},+ {120, 72, 160, 96},+ {120, 24, 160, 48},+ {80, 24, 120, 48},+ };
- rect_right[0] = {0, 24, 40, 48};- rect_right[1] = {0, 72, 40, 96};- rect_right[2] = {0, 24, 40, 48};- rect_right[3] = {40, 72, 80, 96};- rect_right[4] = {0, 24, 40, 48};- rect_right[5] = {80, 72, 120, 96};- rect_right[6] = {120, 72, 160, 96};- rect_right[7] = {120, 24, 160, 48};- rect_right[8] = {80, 24, 120, 48};-
if (npc->direct == 0)
npc->rect = rect_left[npc->ani_no];
else
@@ -823,15 +824,16 @@
//Balrog missile
void ActNpc170(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {112, 96, 128, 104},+ {128, 96, 144, 104},+ };
- rcLeft[0] = {112, 96, 128, 104};- rcLeft[1] = {128, 96, 144, 104};+ RECT rcRight[2] = {+ {112, 104, 128, 112},+ {128, 104, 144, 112},+ };
- rcRight[0] = {112, 104, 128, 112};- rcRight[1] = {128, 104, 144, 112};-
bool bHit = false;
if (npc->direct == 0 && npc->flag & 1)
@@ -912,15 +914,16 @@
//Fire Whirrr
void ActNpc171(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {120, 48, 152, 80},+ {152, 48, 184, 80},+ };
- rcLeft[0] = {120, 48, 152, 80};- rcLeft[1] = {152, 48, 184, 80};+ RECT rcRight[2] = {+ {184, 48, 216, 80},+ {216, 48, 248, 80},+ };
- rcRight[0] = {184, 48, 216, 80};- rcRight[1] = {216, 48, 248, 80};-
if (gMC.x < npc->x)
npc->direct = 0;
else
@@ -998,12 +1001,12 @@
//Fire Whirr projectile
void ActNpc172(NPCHAR *npc)
{- RECT rect[3];
+ RECT rect[3] = {+ {248, 48, 264, 80},+ {264, 48, 280, 80},+ {280, 48, 296, 80},+ };
- rect[0] = {248, 48, 264, 80};- rect[1] = {264, 48, 280, 80};- rect[2] = {280, 48, 296, 80};-
switch (npc->act_no)
{case 0:
@@ -1040,19 +1043,20 @@
//Gaudi (armoured)
void ActNpc173(NPCHAR *npc)
{- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {0, 128, 24, 152},+ {24, 128, 48, 152},+ {48, 128, 72, 152},+ {72, 128, 96, 152},+ };
- rcLeft[0] = {0, 128, 24, 152};- rcLeft[1] = {24, 128, 48, 152};- rcLeft[2] = {48, 128, 72, 152};- rcLeft[3] = {72, 128, 96, 152};+ RECT rcRight[4] = {+ {0, 152, 24, 176},+ {24, 152, 48, 176},+ {48, 152, 72, 176},+ {72, 152, 96, 176},+ };
- rcRight[0] = {0, 152, 24, 176};- rcRight[1] = {24, 152, 48, 176};- rcRight[2] = {48, 152, 72, 176};- rcRight[3] = {72, 152, 96, 176};-
if (npc->x <= gMC.x + (WINDOW_WIDTH * 0x200) && npc->x >= gMC.x - (WINDOW_WIDTH * 0x200) && npc->y <= gMC.y + (WINDOW_HEIGHT * 0x200) && npc->y >= gMC.y - (WINDOW_HEIGHT * 0x200))
{switch (npc->act_no)
@@ -1201,8 +1205,6 @@
//Armoured-Gaudi projectile
void ActNpc174(NPCHAR *npc)
{- RECT rect_left[3];
-
bool bHit;
switch (npc->act_no)
{@@ -1272,9 +1274,11 @@
if (npc->ym < -0x5FF)
npc->ym = -0x5FF;
- rect_left[0] = {120, 80, 136, 96};- rect_left[1] = {136, 80, 152, 96};- rect_left[2] = {152, 80, 168, 96};+ RECT rect_left[3] = {+ {120, 80, 136, 96},+ {136, 80, 152, 96},+ {152, 80, 168, 96},+ };
if (++npc->ani_no > 2)
npc->ani_no = 0;
@@ -1285,15 +1289,16 @@
//Gaudi egg
void ActNpc175(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {168, 80, 192, 104},+ {192, 80, 216, 104},+ };
- rcLeft[0] = {168, 80, 192, 104};- rcLeft[1] = {192, 80, 216, 104};+ RECT rcRight[2] = {+ {216, 80, 240, 104},+ {240, 80, 264, 104},+ };
- rcRight[0] = {216, 80, 240, 104};- rcRight[1] = {240, 80, 264, 104};-
if (npc->act_no < 3 && npc->life < 90)
{LoseNpChar(npc, 0);
@@ -1330,17 +1335,18 @@
//BuyoBuyo Base
void ActNpc176(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {96, 128, 128, 144},+ {128, 128, 160, 144},+ {160, 128, 192, 144},+ };
- rcLeft[0] = {96, 128, 128, 144};- rcLeft[1] = {128, 128, 160, 144};- rcLeft[2] = {160, 128, 192, 144};+ RECT rcRight[3] = {+ {96, 144, 128, 160},+ {128, 144, 160, 160},+ {160, 144, 192, 160},+ };
- rcRight[0] = {96, 144, 128, 160};- rcRight[1] = {128, 144, 160, 160};- rcRight[2] = {160, 144, 192, 160};-
if (npc->act_no < 3 && npc->life < 940)
{LoseNpChar(npc, 0);
@@ -1426,11 +1432,11 @@
//BuyoBuyo
void ActNpc177(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {192, 128, 208, 144},+ {208, 128, 224, 144},+ };
- rc[0] = {192, 128, 208, 144};- rc[1] = {208, 128, 224, 144};-
if (npc->flag & 0xFF)
{SetCaret(npc->x, npc->y, 3, 0);
@@ -1538,12 +1544,12 @@
npc->x += npc->xm;
}
- RECT rect_left[3];
+ RECT rect_left[3] = {+ {0, 224, 16, 240},+ {16, 224, 32, 240},+ {32, 224, 48, 240},+ };
- rect_left[0] = {0, 224, 16, 240};- rect_left[1] = {16, 224, 32, 240};- rect_left[2] = {32, 224, 48, 240};-
if (++npc->ani_wait > 1)
{npc->ani_wait = 0;
@@ -1580,11 +1586,11 @@
npc->y += npc->ym;
npc->x += npc->xm;
- RECT rect_left[3];
-
- rect_left[0] = {48, 224, 72, 240};- rect_left[1] = {72, 224, 96, 240};- rect_left[2] = {96, 224, 120, 240};+ RECT rect_left[3] = {+ {48, 224, 72, 240},+ {72, 224, 96, 240},+ {96, 224, 120, 240},+ };
if (++npc->ani_wait > 1)
{--- a/src/NpcAct180.cpp
+++ b/src/NpcAct180.cpp
@@ -17,33 +17,34 @@
//Curly AI
void ActNpc180(NPCHAR *npc)
{- RECT rcLeft[11];
- RECT rcRight[11];
+ RECT rcLeft[11] = {+ {0, 96, 16, 112},+ {16, 96, 32, 112},+ {0, 96, 16, 112},+ {32, 96, 48, 112},+ {0, 96, 16, 112},+ {48, 96, 64, 112},+ {64, 96, 80, 112},+ {48, 96, 64, 112},+ {80, 96, 96, 112},+ {48, 96, 64, 112},+ {144, 96, 160, 112},+ };
- rcLeft[0] = {0, 96, 16, 112};- rcLeft[1] = {16, 96, 32, 112};- rcLeft[2] = {0, 96, 16, 112};- rcLeft[3] = {32, 96, 48, 112};- rcLeft[4] = {0, 96, 16, 112};- rcLeft[5] = {48, 96, 64, 112};- rcLeft[6] = {64, 96, 80, 112};- rcLeft[7] = {48, 96, 64, 112};- rcLeft[8] = {80, 96, 96, 112};- rcLeft[9] = {48, 96, 64, 112};- rcLeft[10] = {144, 96, 160, 112};+ RECT rcRight[11] = {+ {0, 112, 16, 128},+ {16, 112, 32, 128},+ {0, 112, 16, 128},+ {32, 112, 48, 128},+ {0, 112, 16, 128},+ {48, 112, 64, 128},+ {64, 112, 80, 128},+ {48, 112, 64, 128},+ {80, 112, 96, 128},+ {48, 112, 64, 128},+ {144, 112, 160, 128},+ };
- rcRight[0] = {0, 112, 16, 128};- rcRight[1] = {16, 112, 32, 128};- rcRight[2] = {0, 112, 16, 128};- rcRight[3] = {32, 112, 48, 128};- rcRight[4] = {0, 112, 16, 128};- rcRight[5] = {48, 112, 64, 128};- rcRight[6] = {64, 112, 80, 128};- rcRight[7] = {48, 112, 64, 128};- rcRight[8] = {80, 112, 96, 128};- rcRight[9] = {48, 112, 64, 128};- rcRight[10] = {144, 112, 160, 128};-
if (npc->y < gMC.y - 0x14000)
{if ( npc->y >= 0x20000 )
@@ -269,7 +270,7 @@
if (npc->xm > 0x300)
npc->xm = 0x300;
if (npc->xm < -0x300)
- npc->xm = -0x300u;
+ npc->xm = -0x300;
if (npc->ym > 0x5FF)
npc->ym = 0x5FF;
@@ -294,15 +295,16 @@
//Curly AI Machine Gun
void ActNpc181(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {216, 152, 232, 168},+ {232, 152, 248, 168},+ };
- rcLeft[0] = {216, 152, 232, 168};- rcLeft[1] = {232, 152, 248, 168};+ RECT rcRight[2] = {+ {216, 168, 232, 184},+ {232, 168, 248, 184},+ };
- rcRight[0] = {216, 168, 232, 184};- rcRight[1] = {232, 168, 248, 184};-
if (npc->pNpc)
{if (npc->pNpc->ani_no < 5)
@@ -400,15 +402,16 @@
//Curly AI Polar Star
void ActNpc182(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {184, 152, 200, 168},+ {200, 152, 216, 168},+ };
- rcLeft[0] = {184, 152, 200, 168};- rcLeft[1] = {200, 152, 216, 168};+ RECT rcRight[2] = {+ {184, 168, 200, 184},+ {200, 168, 216, 184},+ };
- rcRight[0] = {184, 168, 200, 184};- rcRight[1] = {200, 168, 216, 184};-
if (npc->pNpc)
{if (npc->pNpc->ani_no < 5)
@@ -506,11 +509,11 @@
//Curly Air Tank Bubble
void ActNpc183(NPCHAR *npc)
{- RECT rect[2];
+ RECT rect[2] = {+ {56, 96, 80, 120},+ {80, 96, 104, 120},+ };
- rect[0] = {56, 96, 80, 120};- rect[1] = {80, 96, 104, 120};-
if (npc->pNpc)
{if (npc->act_no == 0)
@@ -546,11 +549,12 @@
//Shutter Big
void ActNpc184(NPCHAR *npc)
{- RECT rc[4];
- rc[0] = {0, 64, 32, 96};- rc[1] = {32, 64, 64, 96};- rc[2] = {64, 64, 96, 96};- rc[3] = {32, 64, 64, 96};+ RECT rc[4] = {+ {0, 64, 32, 96},+ {32, 64, 64, 96},+ {64, 64, 96, 96},+ {32, 64, 64, 96},+ };
switch (npc->act_no)
{@@ -609,6 +613,8 @@
//Shutter Small
void ActNpc185(NPCHAR *npc)
{+ RECT rc = {96, 64, 112, 96};+
switch (npc->act_no)
{case 0:
@@ -639,27 +645,24 @@
}
++npc->act_wait;
break;
- case 0x14:
+ case 20:
npc->y -= 0x3000;
npc->act_no = 1;
break;
- default:
- break;
}
- npc->rect.left = 96;
- npc->rect.top = 64;
- npc->rect.right = 112;
- npc->rect.bottom = 96;
+
+ npc->rect = rc;
}
//Lift block
void ActNpc186(NPCHAR *npc)
{- RECT rc[4];
- rc[0] = {48, 48, 64, 64};- rc[1] = {64, 48, 80, 64};- rc[2] = {80, 48, 96, 64};- rc[3] = {64, 48, 80, 64};+ RECT rc[4] = {+ {48, 48, 64, 64},+ {64, 48, 80, 64},+ {80, 48, 96, 64},+ {64, 48, 80, 64},+ };
switch (npc->act_no)
{@@ -755,15 +758,16 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rect_left[2];
- RECT rect_right[2];
+ RECT rect_left[2] = {+ {224, 104, 256, 136},+ {256, 104, 288, 136},+ };
- rect_left[0] = {224, 104, 256, 136};- rect_left[1] = {256, 104, 288, 136};+ RECT rect_right[2] = {+ {224, 136, 256, 168},+ {256, 136, 288, 168},+ };
- rect_right[0] = {224, 136, 256, 168};- rect_right[1] = {256, 136, 288, 168};-
if (++npc->ani_wait > 2)
{npc->ani_wait = 0;
@@ -782,9 +786,6 @@
//Fuzz
void ActNpc188(NPCHAR *npc)
{- RECT rect_left[2];
- RECT rect_right[2];
-
switch (npc->act_no)
{case 0:
@@ -848,11 +849,15 @@
if (npc->ani_no > 1)
npc->ani_no = 0;
- rect_left[0] = {288, 104, 304, 120};- rect_left[1] = {304, 104, 320, 120};+ RECT rect_left[2] = {+ {288, 104, 304, 120},+ {304, 104, 320, 120},+ };
- rect_right[0] = {288, 120, 304, 136};- rect_right[1] = {304, 120, 320, 136};+ RECT rect_right[2] = {+ {288, 120, 304, 136},+ {304, 120, 320, 136},+ };
if (npc->direct == 0)
npc->rect = rect_left[npc->ani_no];
@@ -917,12 +922,12 @@
if (npc->ani_no > 2)
npc->ani_no = 0;
- RECT rect[3];
+ RECT rect[3] = {+ {224, 184, 232, 200},+ {232, 184, 240, 200},+ {240, 184, 248, 200},+ };
- rect[0] = {224, 184, 232, 200};- rect[1] = {232, 184, 240, 200};- rect[2] = {240, 184, 248, 200};-
npc->rect = rect[npc->ani_no];
}
@@ -929,9 +934,10 @@
//Broken robot
void ActNpc190(NPCHAR *npc)
{- RECT rect[2];
- rect[0] = {192, 32, 208, 48};- rect[1] = {208, 32, 224, 48};+ RECT rect[2] = {+ {192, 32, 208, 48},+ {208, 32, 224, 48},+ };
switch (npc->act_no)
{@@ -1119,15 +1125,16 @@
SetCaret(npc->x - 5120, npc->y + 5120, 7, 0);
}
- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {224, 64, 256, 80},+ {256, 64, 288, 96},+ };
- rcLeft[0] = {224, 64, 256, 80};- rcLeft[1] = {256, 64, 288, 96};+ RECT rcRight[2] = {+ {224, 80, 256, 96},+ {288, 64, 320, 96},+ };
- rcRight[0] = {224, 80, 256, 96};- rcRight[1] = {288, 64, 320, 96};-
if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
else
@@ -1137,10 +1144,8 @@
//Scooter (broken)
void ActNpc193(NPCHAR *npc)
{- RECT rc[1];
+ RECT rc = {256, 96, 320, 112};- rc[0] = {256, 96, 320, 112};-
if (npc->act_no == 0)
{npc->act_no = 1;
@@ -1148,16 +1153,14 @@
npc->x += 0x3000;
}
- npc->rect = rc[0];
+ npc->rect = rc;
}
//Blue robot (broken)
void ActNpc194(NPCHAR *npc)
{- RECT rc[1];
+ RECT rc = {192, 120, 224, 128};- rc[0] = {192, 120, 224, 128};-
if (npc->act_no == 0)
{npc->act_no = 1;
@@ -1164,7 +1167,7 @@
npc->y += 0x800;
}
- npc->rect = rc[0];
+ npc->rect = rc;
}
//Grate
@@ -1194,13 +1197,13 @@
//Porcupine Fish
void ActNpc197(NPCHAR *npc)
{- RECT rc[4];
+ RECT rc[4] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ {32, 0, 48, 16},+ {48, 0, 64, 16},+ };
- rc[0] = {0, 0, 16, 16};- rc[1] = {16, 0, 32, 16};- rc[2] = {32, 0, 48, 16};- rc[3] = {48, 0, 64, 16};-
switch (npc->act_no)
{case 0:
@@ -1264,12 +1267,12 @@
//Ironhead projectile
void ActNpc198(NPCHAR *npc)
{- RECT rcRight[3];
+ RECT rcRight[3] = {+ {208, 48, 224, 72},+ {224, 48, 240, 72},+ {240, 48, 256, 72},+ };
- rcRight[0] = {208, 48, 224, 72};- rcRight[1] = {224, 48, 240, 72};- rcRight[2] = {240, 48, 256, 72};-
switch (npc->act_no)
{case 0:
@@ -1312,13 +1315,13 @@
//Water/wind particles
void ActNpc199(NPCHAR *npc)
{- RECT rect[5];
-
- rect[0] = {72, 16, 74, 18};- rect[1] = {74, 16, 76, 18};- rect[2] = {76, 16, 78, 18};- rect[3] = {78, 16, 80, 18};- rect[4] = {80, 16, 82, 18};+ RECT rect[5] = {+ {72, 16, 74, 18},+ {74, 16, 76, 18},+ {76, 16, 78, 18},+ {78, 16, 80, 18},+ {80, 16, 82, 18},+ };
if (npc->act_no == 0)
{--- a/src/NpcAct200.cpp
+++ b/src/NpcAct200.cpp
@@ -15,23 +15,24 @@
//Dragon Zombie
void ActNpc200(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {0, 0, 40, 40},+ {40, 0, 80, 40},+ {80, 0, 120, 40},+ {120, 0, 160, 40},+ {160, 0, 200, 40},+ {200, 0, 240, 40},+ };
- rcLeft[0] = {0, 0, 40, 40};- rcLeft[1] = {40, 0, 80, 40};- rcLeft[2] = {80, 0, 120, 40};- rcLeft[3] = {120, 0, 160, 40};- rcLeft[4] = {160, 0, 200, 40};- rcLeft[5] = {200, 0, 240, 40};+ RECT rcRight[6] = {+ {0, 40, 40, 80},+ {40, 40, 80, 80},+ {80, 40, 120, 80},+ {120, 40, 160, 80},+ {160, 40, 200, 80},+ {200, 40, 240, 80},+ };
- rcRight[0] = {0, 40, 40, 80};- rcRight[1] = {40, 40, 80, 80};- rcRight[2] = {80, 40, 120, 80};- rcRight[3] = {120, 40, 160, 80};- rcRight[4] = {160, 40, 200, 80};- rcRight[5] = {200, 40, 240, 80};-
if (npc->act_no < 100 && npc->life < 950)
{PlaySoundObject(72, 1);
@@ -132,12 +133,9 @@
//Dragon Zombie (dead)
void ActNpc201(NPCHAR *npc)
{- RECT rcLeft[1];
- RECT rcRight[1];
+ RECT rcLeft[1] = {200, 0, 240, 40};+ RECT rcRight[1] = {200, 40, 240, 80};- rcLeft[0] = {200, 0, 240, 40};- rcRight[0] = {200, 40, 240, 80};-
if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
else
@@ -147,8 +145,6 @@
//Dragon Zombie projectile
void ActNpc202(NPCHAR *npc)
{- RECT rect_left[3];
-
if (npc->flag & 0xFF)
{npc->cond = 0;
@@ -158,9 +154,11 @@
npc->y += npc->ym;
npc->x += npc->xm;
- rect_left[0] = {184, 216, 200, 240};- rect_left[1] = {200, 216, 216, 240};- rect_left[2] = {216, 216, 232, 240};+ RECT rect_left[3] = {+ {184, 216, 200, 240},+ {200, 216, 216, 240},+ {216, 216, 232, 240},+ };
if (++npc->ani_wait > 1)
{@@ -183,17 +181,18 @@
//Critter (destroyed Egg Corridor)
void ActNpc203(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {0, 80, 16, 96},+ {16, 80, 32, 96},+ {32, 80, 48, 96},+ };
- rcLeft[0] = {0, 80, 16, 96};- rcLeft[1] = {16, 80, 32, 96};- rcLeft[2] = {32, 80, 48, 96};+ RECT rcRight[3] = {+ {0, 96, 16, 112},+ {16, 96, 32, 112},+ {32, 96, 48, 112},+ };
- rcRight[0] = {0, 96, 16, 112};- rcRight[1] = {16, 96, 32, 112};- rcRight[2] = {32, 96, 48, 112};-
switch (npc->act_no)
{case 0:
@@ -282,11 +281,11 @@
//Falling spike (small)
void ActNpc204(NPCHAR *npc)
{- RECT rc[2]; // [sp+4h] [bp-20h]@1
+ RECT rc[2] = {+ {240, 80, 256, 96},+ {240, 144, 256, 160},+ };
- rc[0] = {240, 80, 256, 96};- rc[1] = {240, 144, 256, 160};-
switch (npc->act_no)
{case 0:
@@ -338,11 +337,11 @@
//Falling spike (large)
void ActNpc205(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {112, 80, 128, 112},+ {128, 80, 144, 112},+ };
- rc[0] = {112, 80, 128, 112};- rc[1] = {128, 80, 144, 112};-
switch (npc->act_no)
{case 0:
@@ -421,8 +420,6 @@
//Counter Bomb
void ActNpc206(NPCHAR *npc)
{- RECT rect_left[3];
-
switch (npc->act_no)
{case 0:
@@ -513,9 +510,11 @@
npc->x += npc->xm;
npc->y += npc->ym;
- rect_left[0] = {80, 80, 120, 120};- rect_left[1] = {120, 80, 160, 120};- rect_left[2] = {160, 80, 200, 120};+ RECT rect_left[3] = {+ {80, 80, 120, 120},+ {120, 80, 160, 120},+ {160, 80, 200, 120},+ };
if (++npc->ani_wait > 4)
{@@ -532,14 +531,14 @@
//Counter Bomb's countdown
void ActNpc207(NPCHAR *npc)
{- RECT rc[5];
+ RECT rc[5] = {+ {0, 144, 16, 160},+ {16, 144, 32, 160},+ {32, 144, 48, 160},+ {48, 144, 64, 160},+ {64, 144, 80, 160},+ };
- rc[0] = {0, 144, 16, 160};- rc[1] = {16, 144, 32, 160};- rc[2] = {32, 144, 48, 160};- rc[3] = {48, 144, 64, 160};- rc[4] = {64, 144, 80, 160};-
switch (npc->act_no)
{case 0:
@@ -574,17 +573,18 @@
//Basu (destroyed Egg Corridor)
void ActNpc208(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {248, 80, 272, 104},+ {272, 80, 296, 104},+ {296, 80, 320, 104},+ };
- rcLeft[0] = {248, 80, 272, 104};- rcLeft[1] = {272, 80, 296, 104};- rcLeft[2] = {296, 80, 320, 104};+ RECT rcRight[3] = {+ {248, 104, 272, 128},+ {272, 104, 296, 128},+ {296, 104, 320, 128},+ };
- rcRight[0] = {248, 104, 272, 128};- rcRight[1] = {272, 104, 296, 128};- rcRight[2] = {296, 104, 320, 128};-
switch (npc->act_no)
{case 0:
@@ -733,13 +733,13 @@
npc->y += npc->ym;
npc->x += npc->xm;
- RECT rect_left[4];
+ RECT rect_left[4] = {+ {232, 96, 248, 112},+ {200, 112, 216, 128},+ {216, 112, 232, 128},+ {232, 112, 248, 128},+ };
- rect_left[0] = {232, 96, 248, 112};- rect_left[1] = {200, 112, 216, 128};- rect_left[2] = {216, 112, 232, 128};- rect_left[3] = {232, 112, 248, 128};-
if (++npc->ani_wait > 2)
{npc->ani_wait = 0;
@@ -761,15 +761,16 @@
//Beetle (destroyed Egg Corridor)
void ActNpc210(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {0, 112, 16, 128},+ {16, 112, 32, 128},+ };
- rcLeft[0] = {0, 112, 16, 128};- rcLeft[1] = {16, 112, 32, 128};+ RECT rcRight[2] = {+ {32, 112, 48, 128},+ {48, 112, 64, 128},+ };
- rcRight[0] = {32, 112, 48, 128};- rcRight[1] = {48, 112, 64, 128};-
switch (npc->act_no)
{case 0:
@@ -861,13 +862,13 @@
//Spikes (small)
void ActNpc211(NPCHAR *npc)
{- RECT rects[4];
+ RECT rects[4] = {+ {256, 200, 272, 216},+ {272, 200, 288, 216},+ {288, 200, 304, 216},+ {304, 200, 320, 216},+ };
- rects[0] = {256, 200, 272, 216};- rects[1] = {272, 200, 288, 216};- rects[2] = {288, 200, 304, 216};- rects[3] = {304, 200, 320, 216};-
npc->rect = rects[npc->code_event];
}
@@ -874,13 +875,13 @@
//Sky Dragon
void ActNpc212(NPCHAR *npc)
{- RECT rcRight[4];
+ RECT rcRight[4] = {+ {160, 152, 200, 192},+ {200, 152, 240, 192},+ {240, 112, 280, 152},+ {280, 112, 320, 152},+ };
- rcRight[0] = {160, 152, 200, 192};- rcRight[1] = {200, 152, 240, 192};- rcRight[2] = {240, 112, 280, 152};- rcRight[3] = {280, 112, 320, 152};-
switch (npc->act_no)
{case 0:
@@ -985,19 +986,19 @@
//Night Spirit
void ActNpc213(NPCHAR *npc)
{- RECT rect[10];
+ RECT rect[10] = {+ {0, 0, 0, 0},+ {0, 0, 48, 48},+ {48, 0, 96, 48},+ {96, 0, 144, 48},+ {144, 0, 192, 48},+ {192, 0, 240, 48},+ {240, 0, 288, 48},+ {0, 48, 48, 96},+ {48, 48, 96, 96},+ {96, 48, 144, 96},+ };
- rect[0] = {0, 0, 0, 0};- rect[1] = {0, 0, 48, 48};- rect[2] = {48, 0, 96, 48};- rect[3] = {96, 0, 144, 48};- rect[4] = {144, 0, 192, 48};- rect[5] = {192, 0, 240, 48};- rect[6] = {240, 0, 288, 48};- rect[7] = {0, 48, 48, 96};- rect[8] = {48, 48, 96, 96};- rect[9] = {96, 48, 144, 96};-
switch (npc->act_no)
{case 0:
@@ -1151,12 +1152,12 @@
//Night Spirit projectile
void ActNpc214(NPCHAR *npc)
{- RECT rect[3];
+ RECT rect[3] = {+ {144, 48, 176, 64},+ {176, 48, 208, 64},+ {208, 48, 240, 64},+ };
- rect[0] = {144, 48, 176, 64};- rect[1] = {176, 48, 208, 64};- rect[2] = {208, 48, 240, 64};-
switch (npc->act_no)
{case 0:
@@ -1288,14 +1289,14 @@
break;
}
- RECT rect[5];
+ RECT rect[5] = {+ {0, 0, 0, 0},+ {0, 96, 48, 128},+ {48, 96, 96, 128},+ {96, 96, 144, 128},+ {144, 96, 192, 128},+ };
- rect[0] = {0, 0, 0, 0};- rect[1] = {0, 96, 48, 128};- rect[2] = {48, 96, 96, 128};- rect[3] = {96, 96, 144, 128};- rect[4] = {144, 96, 192, 128};-
npc->rect = rect[npc->ani_no];
}
@@ -1310,17 +1311,17 @@
//Itoh
void ActNpc217(NPCHAR *npc)
{- RECT rect[8];
+ RECT rect[8] = {+ {144, 64, 160, 80},+ {160, 64, 176, 80},+ {176, 64, 192, 80},+ {192, 64, 208, 80},+ {144, 80, 160, 96},+ {160, 80, 176, 96},+ {144, 80, 160, 96},+ {176, 80, 192, 96},+ };
- rect[0] = {144, 64, 160, 80};- rect[1] = {160, 64, 176, 80};- rect[2] = {176, 64, 192, 80};- rect[3] = {192, 64, 208, 80};- rect[4] = {144, 80, 160, 96};- rect[5] = {160, 80, 176, 96};- rect[6] = {144, 80, 160, 96};- rect[7] = {176, 80, 192, 96};-
switch (npc->act_no)
{case 0:
@@ -1436,11 +1437,11 @@
// Core giant energy ball projectile
void ActNpc218(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {256, 120, 288, 152},+ {288, 120, 320, 152},+ };
- rc[0] = {256, 120, 288, 152};- rc[1] = {288, 120, 320, 152};-
npc->x += npc->xm;
npc->y += npc->ym;
@@ -1462,14 +1463,12 @@
//Smoke generator
void ActNpc219(NPCHAR *npc)
{- RECT rc[1];
+ RECT rc = {0, 0, 0, 0};- rc[0] = {0, 0, 0, 0};-
- if ( npc->direct )
+ if (npc->direct)
SetNpChar(199, npc->x + (Random(-0xA0, 0xA0) * 0x200), npc->y + (Random(-0x80, 0x80) * 0x200), 0, 0, 2, 0, 0x100);
else if (Random(0, 40) == 1)
SetNpChar(4, npc->x + (Random(-20, 20) * 0x200), npc->y, 0, -0x200, 0, 0, 0x100);
- npc->rect = rc[0];
+ npc->rect = rc;
}
--- a/src/NpcAct220.cpp
+++ b/src/NpcAct220.cpp
@@ -15,15 +15,16 @@
//Shovel Brigade
void ActNpc220(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {0, 64, 16, 80},+ {16, 64, 32, 80},+ };
- rcLeft[0] = {0, 64, 16, 80};- rcLeft[1] = {16, 64, 32, 80};+ RECT rcRight[2] = {+ {0, 80, 16, 96},+ {16, 80, 32, 96},+ };
- rcRight[0] = {0, 80, 16, 96};- rcRight[1] = {16, 80, 32, 96};-
switch (npc->act_no)
{case 0:
@@ -60,23 +61,24 @@
//Shovel Brigade (walking)
void ActNpc221(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {0, 64, 16, 80},+ {16, 64, 32, 80},+ {32, 64, 48, 80},+ {0, 64, 16, 80},+ {48, 64, 64, 80},+ {0, 64, 16, 80},+ };
- rcLeft[0] = {0, 64, 16, 80};- rcLeft[1] = {16, 64, 32, 80};- rcLeft[2] = {32, 64, 48, 80};- rcLeft[3] = {0, 64, 16, 80};- rcLeft[4] = {48, 64, 64, 80};- rcLeft[5] = {0, 64, 16, 80};+ RECT rcRight[6] = {+ {0, 80, 16, 96},+ {16, 80, 32, 96},+ {32, 80, 48, 96},+ {0, 80, 16, 96},+ {48, 80, 64, 96},+ {0, 80, 16, 96},+ };
- rcRight[0] = {0, 80, 16, 96};- rcRight[1] = {16, 80, 32, 96};- rcRight[2] = {32, 80, 48, 96};- rcRight[3] = {0, 80, 16, 96};- rcRight[4] = {48, 80, 64, 96};- rcRight[5] = {0, 80, 16, 96};-
switch (npc->act_no)
{case 0:
@@ -178,17 +180,18 @@
//Momorin
void ActNpc223(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {80, 192, 96, 216},+ {96, 192, 112, 216},+ {112, 192, 128, 216},+ };
- rcLeft[0] = {80, 192, 96, 216};- rcLeft[1] = {96, 192, 112, 216};- rcLeft[2] = {112, 192, 128, 216};+ RECT rcRight[3] = {+ {80, 216, 96, 240},+ {96, 216, 112, 240},+ {112, 216, 128, 240},+ };
- rcRight[0] = {80, 216, 96, 240};- rcRight[1] = {96, 216, 112, 240};- rcRight[2] = {112, 216, 128, 240};-
switch (npc->act_no)
{case 0:
@@ -237,15 +240,16 @@
//Chie
void ActNpc224(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {112, 32, 128, 48},+ {128, 32, 144, 48},+ };
- rcLeft[0] = {112, 32, 128, 48};- rcLeft[1] = {128, 32, 144, 48};+ RECT rcRight[2] = {+ {112, 48, 128, 64},+ {128, 48, 144, 64},+ };
- rcRight[0] = {112, 48, 128, 64};- rcRight[1] = {128, 48, 144, 64};-
switch (npc->act_no)
{case 0:
@@ -290,15 +294,16 @@
//Megane
void ActNpc225(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {64, 64, 80, 80},+ {80, 64, 96, 80},+ };
- rcLeft[0] = {64, 64, 80, 80};- rcLeft[1] = {80, 64, 96, 80};+ RECT rcRight[2] = {+ {64, 80, 80, 96},+ {80, 80, 96, 96},+ };
- rcRight[0] = {64, 80, 80, 96};- rcRight[1] = {80, 80, 96, 96};-
switch (npc->act_no)
{case 0:
@@ -335,16 +340,16 @@
//Kanpachi
void ActNpc226(NPCHAR *npc)
{- RECT rcRight[7];
+ RECT rcRight[7] = {+ {256, 56, 272, 80},+ {272, 56, 288, 80},+ {288, 56, 304, 80},+ {256, 56, 272, 80},+ {304, 56, 320, 80},+ {256, 56, 272, 80},+ {240, 56, 256, 80},+ };
- rcRight[0] = {256, 56, 272, 80};- rcRight[1] = {272, 56, 288, 80};- rcRight[2] = {288, 56, 304, 80};- rcRight[3] = {256, 56, 272, 80};- rcRight[4] = {304, 56, 320, 80};- rcRight[5] = {256, 56, 272, 80};- rcRight[6] = {240, 56, 256, 80};-
switch (npc->act_no)
{case 0:
@@ -418,19 +423,20 @@
//Droll (guard)
void ActNpc228(NPCHAR *npc)
{- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {0, 0, 32, 40},+ {32, 0, 64, 40},+ {64, 0, 96, 40},+ {96, 0, 128, 40},+ };
- rcLeft[0] = {0, 0, 32, 40};- rcLeft[1] = {32, 0, 64, 40};- rcLeft[2] = {64, 0, 96, 40};- rcLeft[3] = {96, 0, 128, 40};+ RECT rcRight[4] = {+ {0, 40, 32, 80},+ {32, 40, 64, 80},+ {64, 40, 96, 80},+ {96, 40, 128, 80},+ };
- rcRight[0] = {0, 40, 32, 80};- rcRight[1] = {32, 40, 64, 80};- rcRight[2] = {64, 40, 96, 80};- rcRight[3] = {96, 40, 128, 80};-
switch (npc->act_no)
{case 0:
@@ -514,11 +520,11 @@
//Red Flowers (sprouts)
void ActNpc229(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {0, 96, 48, 112},+ {0, 112, 48, 128},+ };
- rc[0] = {0, 96, 48, 112};- rc[1] = {0, 112, 48, 128};-
if (npc->act_no == 0)
{npc->act_no = 1;
@@ -534,11 +540,11 @@
//Red Flowers (blooming)
void ActNpc230(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {48, 96, 96, 128},+ {96, 96, 144, 128},+ };
- rc[0] = {48, 96, 96, 128};- rc[1] = {96, 96, 144, 128};-
if (npc->act_no == 0)
{npc->act_no = 1;
@@ -555,11 +561,11 @@
//Rocket
void ActNpc231(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {176, 32, 208, 48},+ {176, 48, 208, 64},+ };
- rc[0] = {176, 32, 208, 48};- rc[1] = {176, 48, 208, 64};-
switch (npc->act_no)
{case 0:
@@ -712,17 +718,18 @@
npc->y += npc->ym;
npc->x += npc->xm;
- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {128, 0, 160, 32},+ {160, 0, 192, 32},+ {192, 0, 224, 32},+ };
- rcLeft[0] = {128, 0, 160, 32};- rcLeft[1] = {160, 0, 192, 32};- rcLeft[2] = {192, 0, 224, 32};+ RECT rcRight[3] = {+ {128, 32, 160, 64},+ {160, 32, 192, 64},+ {192, 32, 224, 64},+ };
- rcRight[0] = {128, 32, 160, 64};- rcRight[1] = {160, 32, 192, 64};- rcRight[2] = {192, 32, 224, 64};-
if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
else
@@ -810,19 +817,20 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {256, 0, 272, 16},+ {272, 0, 288, 16},+ {288, 0, 304, 16},+ {304, 0, 320, 16},+ };
- rcLeft[0] = {256, 0, 272, 16};- rcLeft[1] = {272, 0, 288, 16};- rcLeft[2] = {288, 0, 304, 16};- rcLeft[3] = {304, 0, 320, 16};+ RECT rcRight[4] = {+ {256, 16, 272, 32},+ {272, 16, 288, 32},+ {288, 16, 304, 32},+ {304, 16, 320, 32},+ };
- rcRight[0] = {256, 16, 272, 32};- rcRight[1] = {272, 16, 288, 32};- rcRight[2] = {288, 16, 304, 32};- rcRight[3] = {304, 16, 320, 32};-
if (npc->act_no == 3)
{npc->ani_no = 3;
@@ -839,7 +847,7 @@
npc->ani_no = 0;
}
- if ( npc->direct == 0)
+ if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
else
npc->rect = rcRight[npc->ani_no];
@@ -848,11 +856,11 @@
//Red Flowers (picked)
void ActNpc234(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {144, 96, 192, 112},+ {144, 112, 192, 128},+ };
- rc[0] = {144, 96, 192, 112};- rc[1] = {144, 112, 192, 128};-
if (npc->act_no == 0)
{npc->act_no = 1;
@@ -868,19 +876,20 @@
//Midorin
void ActNpc235(NPCHAR *npc)
{- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {192, 96, 208, 112},+ {208, 96, 224, 112},+ {224, 96, 240, 112},+ {192, 96, 208, 112},+ };
- rcLeft[0] = {192, 96, 208, 112};- rcLeft[1] = {208, 96, 224, 112};- rcLeft[2] = {224, 96, 240, 112};- rcLeft[3] = {192, 96, 208, 112};+ RECT rcRight[4] = {+ {192, 112, 208, 128},+ {208, 112, 224, 128},+ {224, 112, 240, 128},+ {192, 112, 208, 128},+ };
- rcRight[0] = {192, 112, 208, 128};- rcRight[1] = {208, 112, 224, 128};- rcRight[2] = {224, 112, 240, 128};- rcRight[3] = {192, 112, 208, 128};-
switch (npc->act_no)
{case 0:
@@ -973,23 +982,24 @@
//Gunfish
void ActNpc236(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {128, 64, 152, 88},+ {152, 64, 176, 88},+ {176, 64, 200, 88},+ {200, 64, 224, 88},+ {224, 64, 248, 88},+ {248, 64, 272, 88},+ };
- rcLeft[0] = {128, 64, 152, 88};- rcLeft[1] = {152, 64, 176, 88};- rcLeft[2] = {176, 64, 200, 88};- rcLeft[3] = {200, 64, 224, 88};- rcLeft[4] = {224, 64, 248, 88};- rcLeft[5] = {248, 64, 272, 88};+ RECT rcRight[6] = {+ {128, 88, 152, 112},+ {152, 88, 176, 112},+ {176, 88, 200, 112},+ {200, 88, 224, 112},+ {224, 88, 248, 112},+ {248, 88, 272, 112},+ };
- rcRight[0] = {128, 88, 152, 112};- rcRight[1] = {152, 88, 176, 112};- rcRight[2] = {176, 88, 200, 112};- rcRight[3] = {200, 88, 224, 112};- rcRight[4] = {224, 88, 248, 112};- rcRight[5] = {248, 88, 272, 112};-
switch (npc->act_no)
{case 0:
@@ -1147,11 +1157,11 @@
// Press (sideways)
void ActNpc238(NPCHAR *npc)
{- RECT rc[3];
-
- rc[0] = {184, 200, 208, 216};- rc[1] = {208, 200, 232, 216};- rc[2] = {232, 200, 256, 216};+ RECT rc[3] = {+ {184, 200, 208, 216},+ {208, 200, 232, 216},+ {232, 200, 256, 216},+ };
switch (npc->act_no)
{--- a/src/NpcAct240.cpp
+++ b/src/NpcAct240.cpp
@@ -15,23 +15,24 @@
//Mimiga (jailed)
void ActNpc240(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {160, 64, 176, 80},+ {176, 64, 192, 80},+ {192, 64, 208, 80},+ {160, 64, 176, 80},+ {208, 64, 224, 80},+ {160, 64, 176, 80},+ };
- rcLeft[0] = {160, 64, 176, 80};- rcLeft[1] = {176, 64, 192, 80};- rcLeft[2] = {192, 64, 208, 80};- rcLeft[3] = {160, 64, 176, 80};- rcLeft[4] = {208, 64, 224, 80};- rcLeft[5] = {160, 64, 176, 80};+ RECT rcRight[6] = {+ {160, 80, 176, 96},+ {176, 80, 192, 96},+ {192, 80, 208, 96},+ {160, 80, 176, 96},+ {208, 80, 224, 96},+ {160, 80, 176, 96},+ };
- rcRight[0] = {160, 80, 176, 96};- rcRight[1] = {176, 80, 192, 96};- rcRight[2] = {192, 80, 208, 96};- rcRight[3] = {160, 80, 176, 96};- rcRight[4] = {208, 80, 224, 96};- rcRight[5] = {160, 80, 176, 96};-
switch (npc->act_no)
{case 0:
@@ -119,17 +120,18 @@
//Critter (Last Cave)
void ActNpc241(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ {32, 0, 48, 16},+ };
- rcLeft[0] = {0, 0, 16, 16};- rcLeft[1] = {16, 0, 32, 16};- rcLeft[2] = {32, 0, 48, 16};+ RECT rcRight[3] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ {32, 16, 48, 32},+ };
- rcRight[0] = {0, 16, 16, 32};- rcRight[1] = {16, 16, 32, 32};- rcRight[2] = {32, 16, 48, 32};-
switch (npc->act_no)
{case 0:
@@ -261,19 +263,20 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rect_left[4];
- RECT rect_right[4];
+ RECT rect_left[4] = {+ {32, 32, 48, 48},+ {48, 32, 64, 48},+ {64, 32, 80, 48},+ {80, 32, 96, 48},+ };
- rect_left[0] = {32, 32, 48, 48};- rect_left[1] = {48, 32, 64, 48};- rect_left[2] = {64, 32, 80, 48};- rect_left[3] = {80, 32, 96, 48};+ RECT rect_right[4] = {+ {32, 48, 48, 64},+ {48, 48, 64, 64},+ {64, 48, 80, 64},+ {80, 48, 96, 64},+ };
- rect_right[0] = {32, 48, 48, 64};- rect_right[1] = {48, 48, 64, 64};- rect_right[2] = {64, 48, 80, 64};- rect_right[3] = {80, 48, 96, 64};-
if (++npc->ani_wait > 1)
{npc->ani_wait = 0;
@@ -350,13 +353,13 @@
//Lava drop generator
void ActNpc245(NPCHAR *npc)
{- RECT rc[4];
+ RECT rc[4] = {+ {0, 0, 0, 0},+ {104, 0, 112, 16},+ {112, 0, 120, 16},+ {120, 0, 128, 16},+ };
- rc[0] = {0, 0, 0, 0};- rc[1] = {104, 0, 112, 16};- rc[2] = {112, 0, 120, 16};- rc[3] = {120, 0, 128, 16};-
switch (npc->act_no)
{case 0:
@@ -406,12 +409,12 @@
//Press (proximity)
void ActNpc246(NPCHAR *npc)
{- RECT rcLeft[3];
+ RECT rcLeft[3] = {+ {144, 112, 160, 136},+ {160, 112, 176, 136},+ {176, 112, 192, 136},+ };
- rcLeft[0] = {144, 112, 160, 136};- rcLeft[1] = {160, 112, 176, 136};- rcLeft[2] = {176, 112, 192, 136};-
switch (npc->act_no)
{case 0:
@@ -491,29 +494,30 @@
//Misery (boss)
void ActNpc247(NPCHAR *npc)
{- RECT rcLeft[9];
- RECT rcRight[9];
+ RECT rcLeft[9] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ {32, 0, 48, 16},+ {48, 0, 64, 16},+ {64, 0, 80, 16},+ {80, 0, 96, 16},+ {96, 0, 112, 16},+ {0, 0, 0, 0},+ {112, 0, 128, 16},+ };
- rcLeft[0] = {0, 0, 16, 16};- rcLeft[1] = {16, 0, 32, 16};- rcLeft[2] = {32, 0, 48, 16};- rcLeft[3] = {48, 0, 64, 16};- rcLeft[4] = {64, 0, 80, 16};- rcLeft[5] = {80, 0, 96, 16};- rcLeft[6] = {96, 0, 112, 16};- rcLeft[7] = {0, 0, 0, 0};- rcLeft[8] = {112, 0, 128, 16};+ RECT rcRight[9] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ {32, 16, 48, 32},+ {48, 16, 64, 32},+ {64, 16, 80, 32},+ {80, 16, 96, 32},+ {96, 16, 112, 32},+ {0, 0, 0, 0},+ {112, 16, 128, 32},+ };
- rcRight[0] = {0, 16, 16, 32};- rcRight[1] = {16, 16, 32, 32};- rcRight[2] = {32, 16, 48, 32};- rcRight[3] = {48, 16, 64, 32};- rcRight[4] = {64, 16, 80, 32};- rcRight[5] = {80, 16, 96, 32};- rcRight[6] = {96, 16, 112, 32};- rcRight[7] = {0, 0, 0, 0};- rcRight[8] = {112, 16, 128, 32};-
switch (npc->act_no)
{case 0:
@@ -805,12 +809,12 @@
npc->y += npc->ym;
npc->x += npc->xm;
- RECT rect_left[3];
+ RECT rect_left[3] = {+ {0, 48, 16, 64},+ {16, 48, 32, 64},+ {32, 48, 48, 64},+ };
- rect_left[0] = {0, 48, 16, 64};- rect_left[1] = {16, 48, 32, 64};- rect_left[2] = {32, 48, 48, 64};-
if (++npc->ani_wait > 1)
{npc->ani_wait = 0;
@@ -831,11 +835,11 @@
//Boss Misery energy shot
void ActNpc249(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {48, 48, 64, 64},+ {64, 48, 80, 64},+ };
- rc[0] = {48, 48, 64, 64};- rc[1] = {64, 48, 80, 64};-
if (++npc->act_wait > 8)
npc->cond = 0;
@@ -854,12 +858,12 @@
//Boss Misery lightning ball
void ActNpc250(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {0, 32, 16, 48},+ {16, 32, 32, 48},+ {32, 32, 48, 48},+ };
- rc[0] = {0, 32, 16, 48};- rc[1] = {16, 32, 32, 48};- rc[2] = {32, 32, 48, 48};-
switch (npc->act_no)
{case 0:
@@ -931,11 +935,11 @@
//Boss Misery lightning
void ActNpc251(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {80, 32, 96, 64},+ {96, 32, 112, 64},+ };
- rc[0] = {80, 32, 96, 64};- rc[1] = {96, 32, 112, 64};-
switch (npc->act_no)
{case 0:
@@ -962,19 +966,20 @@
//Boss Misery bats
void ActNpc252(NPCHAR *npc)
{- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {48, 32, 64, 48},+ {112, 32, 128, 48},+ {128, 32, 144, 48},+ {144, 32, 160, 48},+ };
- rcLeft[0] = {48, 32, 64, 48};- rcLeft[1] = {112, 32, 128, 48};- rcLeft[2] = {128, 32, 144, 48};- rcLeft[3] = {144, 32, 160, 48};+ RECT rcRight[4] = {+ {48, 32, 64, 48},+ {112, 48, 128, 64},+ {128, 48, 144, 64},+ {144, 48, 160, 64},+ };
- rcRight[0] = {48, 32, 64, 48};- rcRight[1] = {112, 48, 128, 64};- rcRight[2] = {128, 48, 144, 64};- rcRight[3] = {144, 48, 160, 64};-
unsigned char deg;
switch (npc->act_no)
@@ -1082,11 +1087,11 @@
npc->cond = 0;
}
- RECT rc[2];
+ RECT rc[2] = {+ {0, 64, 16, 80},+ {16, 64, 32, 80},+ };
- rc[0] = {0, 64, 16, 80};- rc[1] = {16, 64, 32, 80};-
npc->rect = rc[npc->ani_no];
}
@@ -1093,11 +1098,11 @@
//Helicopter
void ActNpc254(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {0, 0, 128, 64},+ {0, 64, 128, 128},+ };
- rc[0] = {0, 0, 128, 64};- rc[1] = {0, 64, 128, 128};-
switch (npc->act_no)
{case 0:
@@ -1131,19 +1136,20 @@
//Helicopter blades
void ActNpc255(NPCHAR *npc)
{- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {128, 0, 240, 16},+ {128, 16, 240, 32},+ {128, 32, 240, 48},+ {128, 16, 240, 32},+ };
- rcLeft[0] = {128, 0, 240, 16};- rcLeft[1] = {128, 16, 240, 32};- rcLeft[2] = {128, 32, 240, 48};- rcLeft[3] = {128, 16, 240, 32};+ RECT rcRight[4] = {+ {240, 0, 320, 16},+ {240, 16, 320, 32},+ {240, 32, 320, 48},+ {240, 16, 320, 32},+ };
- rcRight[0] = {240, 0, 320, 16};- rcRight[1] = {240, 16, 320, 32};- rcRight[2] = {240, 32, 320, 48};- rcRight[3] = {240, 16, 320, 32};-
switch (npc->act_no)
{case 0:
@@ -1196,15 +1202,15 @@
//Doctor (facing away)
void ActNpc256(NPCHAR *npc)
{- RECT rcLeft[6];
+ RECT rcLeft[6] = {+ {48, 160, 72, 192},+ {72, 160, 96, 192},+ {0, 128, 24, 160},+ {24, 128, 48, 160},+ {0, 160, 24, 192},+ {24, 160, 48, 192},+ };
- rcLeft[0] = {48, 160, 72, 192};- rcLeft[1] = {72, 160, 96, 192};- rcLeft[2] = {0, 128, 24, 160};- rcLeft[3] = {24, 128, 48, 160};- rcLeft[4] = {0, 160, 24, 192};- rcLeft[5] = {24, 160, 48, 192};-
switch ( npc->act_no )
{case 0:
@@ -1287,11 +1293,11 @@
//Red crystal
void ActNpc257(NPCHAR *npc)
{- RECT rc[3];
-
- rc[0] = {176, 32, 184, 48};- rc[1] = {184, 32, 192, 48};- rc[2] = {0, 0, 0, 0};+ RECT rc[3] = {+ {176, 32, 184, 48},+ {184, 32, 192, 48},+ {0, 0, 0, 0},+ };
switch (npc->act_no)
{--- a/src/NpcAct260.cpp
+++ b/src/NpcAct260.cpp
@@ -16,17 +16,18 @@
//Shovel Brigade (caged)
void ActNpc260(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {128, 64, 144, 80},+ {144, 64, 160, 80},+ {224, 64, 240, 80},+ };
- rcLeft[0] = {128, 64, 144, 80};- rcLeft[1] = {144, 64, 160, 80};- rcLeft[2] = {224, 64, 240, 80};+ RECT rcRight[3] = {+ {128, 80, 144, 96},+ {144, 80, 160, 96},+ {224, 80, 240, 96},+ };
- rcRight[0] = {128, 80, 144, 96};- rcRight[1] = {144, 80, 160, 96};- rcRight[2] = {224, 80, 240, 96};-
switch (npc->act_no)
{case 0:
@@ -77,15 +78,16 @@
//Chie (caged)
void ActNpc261(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {112, 32, 128, 48},+ {128, 32, 144, 48},+ };
- rcLeft[0] = {112, 32, 128, 48};- rcLeft[1] = {128, 32, 144, 48};+ RECT rcRight[2] = {+ {112, 48, 128, 64},+ {128, 48, 144, 64},+ };
- rcRight[0] = {112, 48, 128, 64};- rcRight[1] = {128, 48, 144, 64};-
switch (npc->act_no)
{case 0:
@@ -129,15 +131,16 @@
//Chaco (caged)
void ActNpc262(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {128, 0, 144, 16},+ {144, 0, 160, 16},+ };
- rcLeft[0] = {128, 0, 144, 16};- rcLeft[1] = {144, 0, 160, 16};+ RECT rcRight[2] = {+ {128, 16, 144, 32},+ {144, 16, 160, 32},+ };
- rcRight[0] = {128, 16, 144, 32};- rcRight[1] = {144, 16, 160, 32};-
switch (npc->act_no)
{case 0:
@@ -181,29 +184,30 @@
//Doctor (boss)
void ActNpc263(NPCHAR *npc)
{- RECT rcLeft[9];
- RECT rcRight[9];
+ RECT rcLeft[9] = {+ {0, 0, 24, 32},+ {24, 0, 48, 32},+ {48, 0, 72, 32},+ {0, 0, 0, 0},+ {72, 0, 96, 32},+ {96, 0, 120, 32},+ {120, 0, 144, 32},+ {144, 0, 168, 32},+ {264, 0, 288, 32},+ };
- rcLeft[0] = {0, 0, 24, 32};- rcLeft[1] = {24, 0, 48, 32};- rcLeft[2] = {48, 0, 72, 32};- rcLeft[3] = {0, 0, 0, 0};- rcLeft[4] = {72, 0, 96, 32};- rcLeft[5] = {96, 0, 120, 32};- rcLeft[6] = {120, 0, 144, 32};- rcLeft[7] = {144, 0, 168, 32};- rcLeft[8] = {264, 0, 288, 32};+ RECT rcRight[9] = {+ {0, 32, 24, 64},+ {24, 32, 48, 64},+ {48, 32, 72, 64},+ {0, 0, 0, 0},+ {72, 32, 96, 64},+ {96, 32, 120, 64},+ {120, 32, 144, 64},+ {144, 32, 168, 64},+ {264, 32, 288, 64},+ };
- rcRight[0] = {0, 32, 24, 64};- rcRight[1] = {24, 32, 48, 64};- rcRight[2] = {48, 32, 72, 64};- rcRight[3] = {0, 0, 0, 0};- rcRight[4] = {72, 32, 96, 64};- rcRight[5] = {96, 32, 120, 64};- rcRight[6] = {120, 32, 144, 64};- rcRight[7] = {144, 32, 168, 64};- rcRight[8] = {264, 32, 288, 64};-
switch (npc->act_no)
{case 0:
@@ -506,12 +510,12 @@
//Doctor red ball projectile
void ActNpc265(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {288, 16, 304, 32},+ {288, 32, 304, 48},+ {288, 48, 304, 64},+ };
- rc[0] = {288, 16, 304, 32};- rc[1] = {288, 32, 304, 48};- rc[2] = {288, 48, 304, 64};-
if (++npc->ani_wait > 3)
{npc->ani_wait = 0;
@@ -527,11 +531,11 @@
//Doctor red ball projectile (bouncing)
void ActNpc266(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {304, 16, 320, 32},+ {304, 32, 320, 48},+ };
- rc[0] = {304, 16, 320, 32};- rc[1] = {304, 32, 320, 48};-
if (npc->flag & 1)
npc->xm = -npc->xm;
if (npc->flag & 4)
@@ -560,31 +564,32 @@
//Muscle Doctor
void ActNpc267(NPCHAR *npc)
{- RECT rcLeft[10];
- RECT rcRight[10];
+ RECT rcLeft[10] = {+ {0, 0, 0, 0},+ {0, 64, 40, 112},+ {40, 64, 80, 112},+ {80, 64, 120, 112},+ {120, 64, 160, 112},+ {160, 64, 200, 112},+ {200, 64, 240, 112},+ {240, 64, 280, 112},+ {280, 64, 320, 112},+ {0, 160, 40, 208},+ };
- rcLeft[0] = {0, 0, 0, 0};- rcLeft[1] = {0, 64, 40, 112};- rcLeft[2] = {40, 64, 80, 112};- rcLeft[3] = {80, 64, 120, 112};- rcLeft[4] = {120, 64, 160, 112};- rcLeft[5] = {160, 64, 200, 112};- rcLeft[6] = {200, 64, 240, 112};- rcLeft[7] = {240, 64, 280, 112};- rcLeft[8] = {280, 64, 320, 112};- rcLeft[9] = {0, 160, 40, 208};+ RECT rcRight[10] = {+ {0, 0, 0, 0},+ {0, 112, 40, 160},+ {40, 112, 80, 160},+ {80, 112, 120, 160},+ {120, 112, 160, 160},+ {160, 112, 200, 160},+ {200, 112, 240, 160},+ {240, 112, 280, 160},+ {280, 112, 320, 160},+ {40, 160, 80, 208},+ };
- rcRight[0] = {0, 0, 0, 0};- rcRight[1] = {0, 112, 40, 160};- rcRight[2] = {40, 112, 80, 160};- rcRight[3] = {80, 112, 120, 160};- rcRight[4] = {120, 112, 160, 160};- rcRight[5] = {160, 112, 200, 160};- rcRight[6] = {200, 112, 240, 160};- rcRight[7] = {240, 112, 280, 160};- rcRight[8] = {280, 112, 320, 160};- rcRight[9] = {40, 160, 80, 208};-
switch (npc->act_no)
{case 0:
@@ -1107,31 +1112,32 @@
//Igor (enemy)
void ActNpc268(NPCHAR *npc)
{- RECT rcLeft[10];
- RECT rcRight[10];
+ RECT rcLeft[10] = {+ {0, 0, 40, 40},+ {40, 0, 80, 40},+ {80, 0, 120, 40},+ {0, 0, 40, 40},+ {120, 0, 160, 40},+ {0, 0, 40, 40},+ {40, 80, 80, 120},+ {0, 80, 40, 120},+ {240, 0, 280, 40},+ {280, 0, 320, 40},+ };
- rcLeft[0] = {0, 0, 40, 40};- rcLeft[1] = {40, 0, 80, 40};- rcLeft[2] = {80, 0, 120, 40};- rcLeft[3] = {0, 0, 40, 40};- rcLeft[4] = {120, 0, 160, 40};- rcLeft[5] = {0, 0, 40, 40};- rcLeft[6] = {40, 80, 80, 120};- rcLeft[7] = {0, 80, 40, 120};- rcLeft[8] = {240, 0, 280, 40};- rcLeft[9] = {280, 0, 320, 40};+ RECT rcRight[10] = {+ {0, 40, 40, 80},+ {40, 40, 80, 80},+ {80, 40, 120, 80},+ {0, 40, 40, 80},+ {120, 40, 160, 80},+ {0, 40, 40, 80},+ {160, 80, 200, 120},+ {120, 80, 160, 120},+ {240, 40, 280, 80},+ {280, 40, 320, 80},+ };
- rcRight[0] = {0, 40, 40, 80};- rcRight[1] = {40, 40, 80, 80};- rcRight[2] = {80, 40, 120, 80};- rcRight[3] = {0, 40, 40, 80};- rcRight[4] = {120, 40, 160, 80};- rcRight[5] = {0, 40, 40, 80};- rcRight[6] = {160, 80, 200, 120};- rcRight[7] = {120, 80, 160, 120};- rcRight[8] = {240, 40, 280, 80};- rcRight[9] = {280, 40, 320, 80};-
if (npc->x < gMC.x - 0x28000 || npc->x > gMC.x + 0x28000 || npc->y < gMC.y - 0x1E000 || npc->y > gMC.y + 0x1E000)
npc->act_no = 1;
@@ -1306,17 +1312,18 @@
//Red Bat (bouncing)
void ActNpc269(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {232, 0, 248, 16},+ {248, 0, 264, 16},+ {248, 16, 264, 32},+ };
- rcLeft[0] = {232, 0, 248, 16};- rcLeft[1] = {248, 0, 264, 16};- rcLeft[2] = {248, 16, 264, 32};+ RECT rcRight[3] = {+ {232, 32, 248, 48},+ {248, 32, 264, 48},+ {248, 48, 264, 64},+ };
- rcRight[0] = {232, 32, 248, 48};- rcRight[1] = {248, 32, 264, 48};- rcRight[2] = {248, 48, 264, 64};-
switch (npc->act_no)
{case 0:
@@ -1368,11 +1375,11 @@
//Doctor's blood (or """"red energy"""")
void ActNpc270(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {170, 34, 174, 38},+ {170, 42, 174, 46},+ };
- rc[0] = {170, 34, 174, 38};- rc[1] = {170, 42, 174, 46};-
if (npc->direct == 3 || npc->direct == 1)
{if (npc->direct == 3)
@@ -1461,10 +1468,12 @@
npc->rect.right = 0x20;
npc->rect.top = 0x40;
npc->rect.bottom = 0x60;
+
npc->view.front = 0x2000;
npc->view.back = 0x2000;
npc->view.top = 0x2000;
npc->view.bottom = 0x2000;
+
npc->hit.front = 0x1800;
npc->hit.back = 0x1800;
npc->hit.top = 0x1800;
@@ -1533,12 +1542,12 @@
//Droll projectile
void ActNpc273(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {248, 40, 272, 64},+ {272, 40, 296, 64},+ {296, 40, 320, 64},+ };
- rc[0] = {248, 40, 272, 64};- rc[1] = {272, 40, 296, 64};- rc[2] = {296, 40, 320, 64};-
switch (npc->act_no)
{case 0:
@@ -1572,23 +1581,24 @@
//Droll
void ActNpc274(NPCHAR *npc)
{- RECT rcLeft[6];
- RECT rcRight[6];
+ RECT rcLeft[6] = {+ {0, 0, 32, 40},+ {32, 0, 64, 40},+ {64, 0, 96, 40},+ {64, 80, 96, 120},+ {96, 80, 128, 120},+ {96, 0, 128, 40},+ };
- rcLeft[0] = {0, 0, 32, 40};- rcLeft[1] = {32, 0, 64, 40};- rcLeft[2] = {64, 0, 96, 40};- rcLeft[3] = {64, 80, 96, 120};- rcLeft[4] = {96, 80, 128, 120};- rcLeft[5] = {96, 0, 128, 40};+ RECT rcRight[6] = {+ {0, 40, 32, 80},+ {32, 40, 64, 80},+ {64, 40, 96, 80},+ {64, 120, 96, 160},+ {96, 120, 128, 160},+ {96, 40, 128, 80},+ };
- rcRight[0] = {0, 40, 32, 80};- rcRight[1] = {32, 40, 64, 80};- rcRight[2] = {64, 40, 96, 80};- rcRight[3] = {64, 120, 96, 160};- rcRight[4] = {96, 120, 128, 160};- rcRight[5] = {96, 40, 128, 80};-
switch (npc->act_no)
{case 0:
@@ -1631,7 +1641,7 @@
{npc->act_no = 12;
npc->ani_no = 3;
- npc->ym = -0x600u;
+ npc->ym = -0x600;
npc->count1 = 0;
if (npc->tgt_x > npc->x)
@@ -1696,13 +1706,13 @@
//Puppy (plantation)
void ActNpc275(NPCHAR *npc)
{- RECT rcRight[4];
+ RECT rcRight[4] = {+ {272, 80, 288, 96},+ {288, 80, 304, 96},+ {272, 80, 288, 96},+ {304, 80, 320, 96},+ };
- rcRight[0] = {272, 80, 288, 96};- rcRight[1] = {288, 80, 304, 96};- rcRight[2] = {272, 80, 288, 96};- rcRight[3] = {304, 80, 320, 96};-
switch (npc->act_no)
{case 0:
@@ -1755,29 +1765,30 @@
//Red Demon
void ActNpc276(NPCHAR *npc)
{- RECT rcLeft[9];
- RECT rcRight[9];
+ RECT rcLeft[9] = {+ {0, 64, 32, 104},+ {32, 64, 64, 104},+ {64, 64, 96, 104},+ {96, 64, 128, 104},+ {128, 64, 160, 104},+ {160, 64, 192, 104},+ {192, 64, 224, 104},+ {224, 64, 256, 104},+ {256, 64, 288, 104},+ };
- rcLeft[0] = {0, 64, 32, 104};- rcLeft[1] = {32, 64, 64, 104};- rcLeft[2] = {64, 64, 96, 104};- rcLeft[3] = {96, 64, 128, 104};- rcLeft[4] = {128, 64, 160, 104};- rcLeft[5] = {160, 64, 192, 104};- rcLeft[6] = {192, 64, 224, 104};- rcLeft[7] = {224, 64, 256, 104};- rcLeft[8] = {256, 64, 288, 104};+ RECT rcRight[9] = {+ {0, 104, 32, 144},+ {32, 104, 64, 144},+ {64, 104, 96, 144},+ {96, 104, 128, 144},+ {128, 104, 160, 144},+ {160, 104, 192, 144},+ {192, 104, 224, 144},+ {224, 104, 256, 144},+ {256, 104, 288, 144},+ };
- rcRight[0] = {0, 104, 32, 144};- rcRight[1] = {32, 104, 64, 144};- rcRight[2] = {64, 104, 96, 144};- rcRight[3] = {96, 104, 128, 144};- rcRight[4] = {128, 104, 160, 144};- rcRight[5] = {160, 104, 192, 144};- rcRight[6] = {192, 104, 224, 144};- rcRight[7] = {224, 104, 256, 144};- rcRight[8] = {256, 104, 288, 144};-
switch (npc->act_no)
{case 0:
@@ -1813,7 +1824,7 @@
npc->act_no = 11;
npc->act_wait = 0;
npc->ani_no = 3;
- npc->bits |= 0x20u;
+ npc->bits |= 0x20;
// Fallthrough
case 11:
switch (++npc->act_wait)
@@ -1954,12 +1965,12 @@
//Red Demon projectile
void ActNpc277(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {128, 0, 152, 24},+ {152, 0, 176, 24},+ {176, 0, 200, 24},+ };
- rc[0] = {128, 0, 152, 24};- rc[1] = {152, 0, 176, 24};- rc[2] = {176, 0, 200, 24};-
switch (npc->act_no)
{case 0:
@@ -1993,19 +2004,21 @@
//Little family
void ActNpc278(NPCHAR *npc)
{- RECT rcMama[2];
- RECT rcPapa[2];
- RECT rcKodomo[2];
+ RECT rcPapa[2] = {+ {0, 120, 8, 128},+ {8, 120, 16, 128},+ };
- rcPapa[0] = {0, 120, 8, 128};- rcPapa[1] = {8, 120, 16, 128};+ RECT rcMama[2] = {+ {16, 120, 24, 128},+ {24, 120, 32, 128},+ };
- rcMama[0] = {16, 120, 24, 128};- rcMama[1] = {24, 120, 32, 128};+ RECT rcKodomo[2] = {+ {32, 120, 40, 128},+ {40, 120, 48, 128},+ };
- rcKodomo[0] = {32, 120, 40, 128};- rcKodomo[1] = {40, 120, 48, 128};-
switch (npc->act_no)
{case 0:
@@ -2105,10 +2118,10 @@
//Falling block (large)
void ActNpc279(NPCHAR *npc)
{- RECT rc[2];
-
- rc[0] = {0, 16, 32, 48};- rc[1] = {16, 0, 32, 16};+ RECT rc[2] = {+ {0, 16, 32, 48},+ {16, 0, 32, 16},+ };
switch (npc->act_no)
{--- a/src/NpcAct280.cpp
+++ b/src/NpcAct280.cpp
@@ -15,15 +15,16 @@
//Sue (being teleported by Misery)
void ActNpc280(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {112, 32, 128, 48},+ {144, 32, 160, 48},+ };
- rcLeft[0] = {112, 32, 128, 48};- rcLeft[1] = {144, 32, 160, 48};+ RECT rcRight[2] = {+ {112, 48, 128, 64},+ {144, 48, 160, 64},+ };
- rcRight[0] = {112, 48, 128, 64};- rcRight[1] = {144, 48, 160, 64};-
switch (npc->act_no)
{case 0:
@@ -127,12 +128,12 @@
//Mini Undead Core (active)
void ActNpc282(NPCHAR *npc)
{- RECT tc[3];
+ RECT tc[3] = {+ {256, 80, 320, 120},+ {256, 0, 320, 40},+ {256, 120, 320, 160},+ };
- tc[0] = {256, 80, 320, 120};- tc[1] = {256, 0, 320, 40};- tc[2] = {256, 120, 320, 160};-
switch (npc->act_no)
{case 0:
@@ -201,33 +202,34 @@
//Misery (transformed)
void ActNpc283(NPCHAR *npc)
{- RECT rcLeft[11];
- RECT rcRight[11];
+ RECT rcLeft[11] = {+ {0, 64, 32, 96},+ {32, 64, 64, 96},+ {64, 64, 96, 96},+ {96, 64, 128, 96},+ {128, 64, 160, 96},+ {160, 64, 192, 96},+ {192, 64, 224, 96},+ {224, 64, 256, 96},+ {0, 0, 0, 0},+ {256, 64, 288, 96},+ {288, 64, 320, 96},+ };
- rcLeft[0] = {0, 64, 32, 96};- rcLeft[1] = {32, 64, 64, 96};- rcLeft[2] = {64, 64, 96, 96};- rcLeft[3] = {96, 64, 128, 96};- rcLeft[4] = {128, 64, 160, 96};- rcLeft[5] = {160, 64, 192, 96};- rcLeft[6] = {192, 64, 224, 96};- rcLeft[7] = {224, 64, 256, 96};- rcLeft[8] = {0, 0, 0, 0};- rcLeft[9] = {256, 64, 288, 96};- rcLeft[10] = {288, 64, 320, 96};+ RECT rcRight[11] = {+ {0, 96, 32, 128},+ {32, 96, 64, 128},+ {64, 96, 96, 128},+ {96, 96, 128, 128},+ {128, 96, 160, 128},+ {160, 96, 192, 128},+ {192, 96, 224, 128},+ {224, 96, 256, 128},+ {0, 0, 0, 0},+ {256, 96, 288, 128},+ {288, 96, 320, 128},+ };
- rcRight[0] = {0, 96, 32, 128};- rcRight[1] = {32, 96, 64, 128};- rcRight[2] = {64, 96, 96, 128};- rcRight[3] = {96, 96, 128, 128};- rcRight[4] = {128, 96, 160, 128};- rcRight[5] = {160, 96, 192, 128};- rcRight[6] = {192, 96, 224, 128};- rcRight[7] = {224, 96, 256, 128};- rcRight[8] = {0, 0, 0, 0};- rcRight[9] = {256, 96, 288, 128};- rcRight[10] = {288, 96, 320, 128};-
if (npc->act_no < 100 && (gBoss[0].cond == 0 || npc->life < 400))
npc->act_no = 100;
@@ -601,37 +603,38 @@
//Sue (transformed)
void ActNpc284(NPCHAR *npc)
{- RECT rcLeft[13];
- RECT rcRight[13];
+ RECT rcLeft[13] = {+ {0, 128, 32, 160},+ {32, 128, 64, 160},+ {64, 128, 96, 160},+ {96, 128, 128, 160},+ {128, 128, 160, 160},+ {160, 128, 192, 160},+ {192, 128, 224, 160},+ {224, 128, 256, 160},+ {0, 0, 0, 0},+ {256, 128, 288, 160},+ {288, 128, 320, 160},+ {224, 64, 256, 96},+ {208, 32, 224, 48},+ };
- rcLeft[0] = {0, 128, 32, 160};- rcLeft[1] = {32, 128, 64, 160};- rcLeft[2] = {64, 128, 96, 160};- rcLeft[3] = {96, 128, 128, 160};- rcLeft[4] = {128, 128, 160, 160};- rcLeft[5] = {160, 128, 192, 160};- rcLeft[6] = {192, 128, 224, 160};- rcLeft[7] = {224, 128, 256, 160};- rcLeft[8] = {0, 0, 0, 0};- rcLeft[9] = {256, 128, 288, 160};- rcLeft[10] = {288, 128, 320, 160};- rcLeft[11] = {224, 64, 256, 96};- rcLeft[12] = {208, 32, 224, 48};+ RECT rcRight[13] = {+ {0, 160, 32, 192},+ {32, 160, 64, 192},+ {64, 160, 96, 192},+ {96, 160, 128, 192},+ {128, 160, 160, 192},+ {160, 160, 192, 192},+ {192, 160, 224, 192},+ {224, 160, 256, 192},+ {0, 0, 0, 0},+ {256, 160, 288, 192},+ {288, 160, 320, 192},+ {224, 96, 256, 128},+ {208, 48, 224, 64},+ };
- rcRight[0] = {0, 160, 32, 192};- rcRight[1] = {32, 160, 64, 192};- rcRight[2] = {64, 160, 96, 192};- rcRight[3] = {96, 160, 128, 192};- rcRight[4] = {128, 160, 160, 192};- rcRight[5] = {160, 160, 192, 192};- rcRight[6] = {192, 160, 224, 192};- rcRight[7] = {224, 160, 256, 192};- rcRight[8] = {0, 0, 0, 0};- rcRight[9] = {256, 160, 288, 192};- rcRight[10] = {288, 160, 320, 192};- rcRight[11] = {224, 96, 256, 128};- rcRight[12] = {208, 48, 224, 64};-
if (npc->act_no < 100 && (gBoss[0].cond == 0|| npc->life < 500))
npc->act_no = 100;
@@ -996,12 +999,12 @@
//Undead Core spiral shot trail
void ActNpc286(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {232, 120, 248, 136},+ {232, 136, 248, 152},+ {232, 152, 248, 168},+ };
- rc[0] = {232, 120, 248, 136};- rc[1] = {232, 136, 248, 152};- rc[2] = {232, 152, 248, 168};-
if (++npc->ani_wait > 0)
{npc->ani_wait = 0;
@@ -1017,16 +1020,16 @@
//Orange smoke
void ActNpc287(NPCHAR *npc)
{- RECT rcLeft[7];
+ RECT rcLeft[7] = {+ {0, 224, 16, 240},+ {16, 224, 32, 240},+ {32, 224, 48, 240},+ {48, 224, 64, 240},+ {64, 224, 80, 240},+ {80, 224, 96, 240},+ {96, 224, 112, 240},+ };
- rcLeft[0] = {0, 224, 16, 240};- rcLeft[1] = {16, 224, 32, 240};- rcLeft[2] = {32, 224, 48, 240};- rcLeft[3] = {48, 224, 64, 240};- rcLeft[4] = {64, 224, 80, 240};- rcLeft[5] = {80, 224, 96, 240};- rcLeft[6] = {96, 224, 112, 240};-
if (npc->act_no == 0)
{npc->xm = Random(-4, 4) * 0x200;
@@ -1056,14 +1059,14 @@
//Undead Core exploding rock
void ActNpc288(NPCHAR *npc)
{- RECT rc[5];
+ RECT rc[5] = {+ {232, 72, 248, 88},+ {232, 88, 248, 104},+ {232, 0, 256, 24},+ {232, 24, 256, 48},+ {232, 48, 256, 72},+ };
- rc[0] = {232, 72, 248, 88};- rc[1] = {232, 88, 248, 104};- rc[2] = {232, 0, 256, 24};- rc[3] = {232, 24, 256, 48};- rc[4] = {232, 48, 256, 72};-
switch (npc->act_no)
{case 0:
@@ -1145,17 +1148,18 @@
//Critter (orange, Misery)
void ActNpc289(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {160, 32, 176, 48},+ {176, 32, 192, 48},+ {192, 32, 208, 48},+ };
- rcLeft[0] = {160, 32, 176, 48};- rcLeft[1] = {176, 32, 192, 48};- rcLeft[2] = {192, 32, 208, 48};+ RECT rcRight[3] = {+ {160, 48, 176, 64},+ {176, 48, 192, 64},+ {192, 48, 208, 64},+ };
- rcRight[0] = {160, 48, 176, 64};- rcRight[1] = {176, 48, 192, 64};- rcRight[2] = {192, 48, 208, 64};-
switch (npc->act_no)
{case 0:
@@ -1251,17 +1255,18 @@
//Bat (Misery)
void ActNpc290(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {112, 32, 128, 48},+ {128, 32, 144, 48},+ {144, 32, 160, 48},+ };
- rcLeft[0] = {112, 32, 128, 48};- rcLeft[1] = {128, 32, 144, 48};- rcLeft[2] = {144, 32, 160, 48};+ RECT rcRight[3] = {+ {112, 48, 128, 64},+ {128, 48, 144, 64},+ {144, 48, 160, 64},+ };
- rcRight[0] = {112, 48, 128, 64};- rcRight[1] = {128, 48, 144, 64};- rcRight[2] = {144, 48, 160, 64};-
switch (npc->act_no)
{case 0:
@@ -1336,11 +1341,11 @@
//Mini Undead Core (inactive)
void ActNpc291(NPCHAR *npc)
{- RECT tc[2];
+ RECT tc[2] = {+ {256, 80, 320, 120},+ {256, 0, 320, 40},+ };
- tc[0] = {256, 80, 320, 120};- tc[1] = {256, 0, 320, 40};-
if (npc->act_no == 0)
{npc->act_no = 20;
@@ -1366,11 +1371,11 @@
//Undead Core giant energy shot
void ActNpc293(NPCHAR *npc)
{- RECT rect[2];
+ RECT rect[2] = {+ {240, 200, 280, 240},+ {280, 200, 320, 240},+ };
- rect[0] = {240, 200, 280, 240};- rect[1] = {280, 200, 320, 240};-
switch (npc->act_no)
{case 0:
@@ -1454,11 +1459,12 @@
//Cloud
void ActNpc295(NPCHAR *npc)
{- RECT rc[4];
- rc[0] = {0, 0, 208, 64};- rc[1] = {32, 64, 144, 96};- rc[2] = {32, 96, 104, 0x80};- rc[3] = {104, 96, 144, 0x80};+ RECT rc[4] = {+ {0, 0, 208, 64},+ {32, 64, 144, 96},+ {32, 96, 104, 0x80},+ {104, 96, 144, 0x80},+ };
switch (npc->act_no)
{@@ -1579,25 +1585,28 @@
//Sue in dragon's mouth
void ActNpc297(NPCHAR *npc)
{+ RECT rc = {112, 48, 0x80, 64};+
npc->x = npc->pNpc->x + 0x2000;
npc->y = npc->pNpc->y + 0x1000;
- npc->rect = {112, 48, 0x80, 64};+
+ npc->rect = rc;
}
//Doctor (opening)
void ActNpc298(NPCHAR *npc)
{- RECT rc[8];
+ RECT rc[8] = {+ {72, 0x80, 88, 160},+ {88, 0x80, 104, 160},+ {104, 0x80, 120, 160},+ {72, 0x80, 88, 160},+ {120, 0x80, 136, 160},+ {72, 0x80, 88, 160},+ {104, 160, 120, 192},+ {120, 160, 136, 192},+ };
- rc[0] = {72, 0x80, 88, 160};- rc[1] = {88, 0x80, 104, 160};- rc[2] = {104, 0x80, 120, 160};- rc[3] = {72, 0x80, 88, 160};- rc[4] = {120, 0x80, 136, 160};- rc[5] = {72, 0x80, 88, 160};- rc[6] = {104, 160, 120, 192};- rc[7] = {120, 160, 136, 192};-
switch (npc->act_no)
{case 0:
@@ -1694,10 +1703,10 @@
//Balrog/Misery (opening)
void ActNpc299(NPCHAR *npc)
{- RECT rc[2];
-
- rc[0] = {0, 0, 48, 48};- rc[1] = {48, 0, 96, 48};+ RECT rc[2] = {+ {0, 0, 48, 48},+ {48, 0, 96, 48},+ };
switch (npc->act_no)
{--- a/src/NpcAct300.cpp
+++ b/src/NpcAct300.cpp
@@ -17,10 +17,8 @@
//Demon crown (opening)
void ActNpc300(NPCHAR *npc)
{- RECT rc[1];
+ RECT rc = {192, 80, 208, 96};- rc[0] = {192, 80, 208, 96};-
switch (npc->act_no)
{case 0:
@@ -32,23 +30,23 @@
if (++npc->ani_wait % 8 == 1)
SetCaret(npc->x + (Random(-8, 8) * 0x200), npc->y + 0x1000, 13, 1);
- npc->rect = rc[0];
+ npc->rect = rc;
}
//Fish missile (Misery)
void ActNpc301(NPCHAR *npc)
{- RECT rect[8];
+ RECT rect[8] = {+ {144, 0, 160, 16},+ {160, 0, 176, 16},+ {176, 0, 192, 16},+ {192, 0, 208, 16},+ {144, 16, 160, 32},+ {160, 16, 176, 32},+ {176, 16, 192, 32},+ {192, 16, 208, 32},+ };
- rect[0] = {144, 0, 160, 16};- rect[1] = {160, 0, 176, 16};- rect[2] = {176, 0, 192, 16};- rect[3] = {192, 0, 208, 16};- rect[4] = {144, 16, 160, 32};- rect[5] = {160, 16, 176, 32};- rect[6] = {176, 16, 192, 32};- rect[7] = {192, 16, 208, 32};-
int dir;
switch (npc->act_no)
@@ -174,13 +172,15 @@
//Curly's machine gun
void ActNpc303(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {216, 152, 232, 168},+ {232, 152, 248, 168},+ };
- rcLeft[0] = {216, 152, 232, 168};- rcLeft[1] = {232, 152, 248, 168};- rcRight[0] = {216, 168, 232, 184};- rcRight[1] = {232, 168, 248, 184};+ RECT rcRight[2] = {+ {216, 168, 232, 184},+ {232, 168, 248, 184},+ };
if (npc->pNpc)
{@@ -213,11 +213,12 @@
//Gaudi in hospital
void ActNpc304(NPCHAR *npc)
{- RECT rc[4];
- rc[0] = {0, 176, 24, 192};- rc[1] = {24, 176, 48, 192};- rc[2] = {48, 176, 72, 192};- rc[3] = {72, 176, 96, 192};+ RECT rc[4] = {+ {0, 176, 24, 192},+ {24, 176, 48, 192},+ {48, 176, 72, 192},+ {72, 176, 96, 192},+ };
switch (npc->act_no)
{@@ -255,13 +256,15 @@
//Small puppy
void ActNpc305(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {160, 144, 176, 160},+ {176, 144, 192, 160},+ };
- rcLeft[0] = {160, 144, 176, 160};- rcLeft[1] = {176, 144, 192, 160};- rcRight[0] = {160, 160, 176, 176};- rcRight[1] = {176, 160, 192, 176};+ RECT rcRight[2] = {+ {160, 160, 176, 176},+ {176, 160, 192, 176},+ };
switch (npc->act_no)
{@@ -292,12 +295,15 @@
//Balrog (nurse)
void ActNpc306(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
- rcLeft[0] = {240, 96, 280, 128};- rcLeft[1] = {280, 96, 320, 128};- rcRight[0] = {160, 152, 200, 184};- rcRight[1] = {200, 152, 240, 184};+ RECT rcLeft[2] = {+ {240, 96, 280, 128},+ {280, 96, 320, 128},+ };
+
+ RECT rcRight[2] = {+ {160, 152, 200, 184},+ {200, 152, 240, 184},+ };
switch (npc->act_no)
{@@ -324,21 +330,24 @@
break;
}
- if (npc->direct)
- npc->rect = rcRight[npc->ani_no];
- else
+ if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
+ else
+ npc->rect = rcRight[npc->ani_no];
}
//Caged Santa
void ActNpc307(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
- rcLeft[0] = {0, 32, 16, 48};- rcLeft[1] = {16, 32, 32, 48};- rcRight[0] = {0, 48, 16, 64};- rcRight[1] = {16, 48, 32, 64};+ RECT rcLeft[2] = {+ {0, 32, 16, 48},+ {16, 32, 32, 48},+ };
+
+ RECT rcRight[2] = {+ {0, 48, 16, 64},+ {16, 48, 32, 64},+ };
switch (npc->act_no)
{@@ -366,29 +375,30 @@
break;
}
- if (gMC.x >= npc->x)
- npc->direct = 2;
- else
+ if (gMC.x < npc->x)
npc->direct = 0;
-
- if (npc->direct)
- npc->rect = rcRight[npc->ani_no];
else
+ npc->direct = 2;
+
+ if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
+ else
+ npc->rect = rcRight[npc->ani_no];
}
//Stumpy
void ActNpc308(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {128, 112, 144, 128},+ {144, 112, 160, 128},+ };
- rcLeft[0] = {128, 112, 144, 128};- rcLeft[1] = {144, 112, 160, 128};+ RECT rcRight[2] = {+ {128, 128, 144, 144},+ {144, 128, 160, 144},+ };
- rcRight[0] = {128, 128, 144, 144};- rcRight[1] = {144, 128, 160, 144};-
unsigned char deg;
switch (npc->act_no)
@@ -487,15 +497,16 @@
//Bute
void ActNpc309(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {0, 0, 16, 16},+ {16, 0, 32, 16},+ };
- rcLeft[0] = {0, 0, 16, 16};- rcLeft[1] = {16, 0, 32, 16};+ RECT rcRight[2] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ };
- rcRight[0] = {0, 16, 16, 32};- rcRight[1] = {16, 16, 32, 32};-
switch (npc->act_no)
{case 0:
@@ -590,21 +601,22 @@
//Bute (with sword)
void ActNpc310(NPCHAR *npc)
{- RECT rcLeft[5];
- RECT rcRight[5];
+ RECT rcLeft[5] = {+ {32, 0, 56, 16},+ {56, 0, 80, 16},+ {80, 0, 104, 16},+ {104, 0, 128, 16},+ {128, 0, 152, 16},+ };
- rcLeft[0] = {32, 0, 56, 16};- rcLeft[1] = {56, 0, 80, 16};- rcLeft[2] = {80, 0, 104, 16};- rcLeft[3] = {104, 0, 128, 16};- rcLeft[4] = {128, 0, 152, 16};+ RECT rcRight[5] = {+ {32, 16, 56, 32},+ {56, 16, 80, 32},+ {80, 16, 104, 32},+ {104, 16, 128, 32},+ {128, 16, 152, 32},+ };
- rcRight[0] = {32, 16, 56, 32};- rcRight[1] = {56, 16, 80, 32};- rcRight[2] = {80, 16, 104, 32};- rcRight[3] = {104, 16, 128, 32};- rcRight[4] = {128, 16, 152, 32};-
switch (npc->act_no)
{case 0:
@@ -740,25 +752,26 @@
//Bute archer
void ActNpc311(NPCHAR *npc)
{- RECT rcLeft[7];
- RECT rcRight[7];
+ RECT rcLeft[7] = {+ {0, 32, 24, 56},+ {24, 32, 48, 56},+ {48, 32, 72, 56},+ {72, 32, 96, 56},+ {96, 32, 120, 56},+ {120, 32, 144, 56},+ {144, 32, 168, 56},+ };
- rcLeft[0] = {0, 32, 24, 56};- rcLeft[1] = {24, 32, 48, 56};- rcLeft[2] = {48, 32, 72, 56};- rcLeft[3] = {72, 32, 96, 56};- rcLeft[4] = {96, 32, 120, 56};- rcLeft[5] = {120, 32, 144, 56};- rcLeft[6] = {144, 32, 168, 56};+ RECT rcRight[7] = {+ {0, 56, 24, 80},+ {24, 56, 48, 80},+ {48, 56, 72, 80},+ {72, 56, 96, 80},+ {96, 56, 120, 80},+ {120, 56, 144, 80},+ {144, 56, 168, 80},+ };
- rcRight[0] = {0, 56, 24, 80};- rcRight[1] = {24, 56, 48, 80};- rcRight[2] = {48, 56, 72, 80};- rcRight[3] = {72, 56, 96, 80};- rcRight[4] = {96, 56, 120, 80};- rcRight[5] = {120, 56, 144, 80};- rcRight[6] = {144, 56, 168, 80};-
switch (npc->act_no)
{case 0:
@@ -886,21 +899,22 @@
//Bute arrow projectile
void ActNpc312(NPCHAR *npc)
{- RECT rcLeft[5];
- RECT rcRight[5];
+ RECT rcLeft[5] = {+ {0, 160, 16, 176},+ {16, 160, 32, 176},+ {32, 160, 48, 176},+ {48, 160, 64, 176},+ {64, 160, 80, 176},+ };
- rcLeft[0] = {0, 160, 16, 176};- rcLeft[1] = {16, 160, 32, 176};- rcLeft[2] = {32, 160, 48, 176};- rcLeft[3] = {48, 160, 64, 176};- rcLeft[4] = {64, 160, 80, 176};+ RECT rcRight[5] = {+ {0, 176, 16, 192},+ {16, 176, 32, 192},+ {32, 176, 48, 192},+ {48, 176, 64, 192},+ {64, 176, 80, 192},+ };
- rcRight[0] = {0, 176, 16, 192};- rcRight[1] = {16, 176, 32, 192};- rcRight[2] = {32, 176, 48, 192};- rcRight[3] = {48, 176, 64, 192};- rcRight[4] = {64, 176, 80, 192};-
if (npc->act_no > 0 && npc->act_no < 20 && npc->flag & 0xFF)
npc->act_no = 20;
@@ -999,39 +1013,40 @@
//Ma Pignon
void ActNpc313(NPCHAR *npc)
{- RECT rcLeft[14];
- RECT rcRight[14];
+ RECT rcLeft[14] = {+ {128, 0, 144, 16},+ {144, 0, 160, 16},+ {160, 0, 176, 16},+ {176, 0, 192, 16},+ {192, 0, 208, 16},+ {208, 0, 224, 16},+ {224, 0, 240, 16},+ {240, 0, 256, 16},+ {256, 0, 272, 16},+ {272, 0, 288, 16},+ {288, 0, 304, 16},+ {128, 0, 144, 16},+ {176, 0, 192, 16},+ {304, 0, 320, 16},+ };
- rcLeft[0] = {128, 0, 144, 16};- rcLeft[1] = {144, 0, 160, 16};- rcLeft[2] = {160, 0, 176, 16};- rcLeft[3] = {176, 0, 192, 16};- rcLeft[4] = {192, 0, 208, 16};- rcLeft[5] = {208, 0, 224, 16};- rcLeft[6] = {224, 0, 240, 16};- rcLeft[7] = {240, 0, 256, 16};- rcLeft[8] = {256, 0, 272, 16};- rcLeft[9] = {272, 0, 288, 16};- rcLeft[10] = {288, 0, 304, 16};- rcLeft[11] = {128, 0, 144, 16};- rcLeft[12] = {176, 0, 192, 16};- rcLeft[13] = {304, 0, 320, 16};+ RECT rcRight[14] = {+ {128, 16, 144, 32},+ {144, 16, 160, 32},+ {160, 16, 176, 32},+ {176, 16, 192, 32},+ {192, 16, 208, 32},+ {208, 16, 224, 32},+ {224, 16, 240, 32},+ {240, 16, 256, 32},+ {256, 16, 272, 32},+ {272, 16, 288, 32},+ {288, 16, 304, 32},+ {128, 16, 144, 32},+ {176, 16, 192, 32},+ {304, 16, 320, 32},+ };
- rcRight[0] = {128, 16, 144, 32};- rcRight[1] = {144, 16, 160, 32};- rcRight[2] = {160, 16, 176, 32};- rcRight[3] = {176, 16, 192, 32};- rcRight[4] = {192, 16, 208, 32};- rcRight[5] = {208, 16, 224, 32};- rcRight[6] = {224, 16, 240, 32};- rcRight[7] = {240, 16, 256, 32};- rcRight[8] = {256, 16, 272, 32};- rcRight[9] = {272, 16, 288, 32};- rcRight[10] = {288, 16, 304, 32};- rcRight[11] = {128, 16, 144, 32};- rcRight[12] = {176, 16, 192, 32};- rcRight[13] = {304, 16, 320, 32};-
switch (npc->act_no)
{case 0:
@@ -1348,12 +1363,12 @@
//Ma Pignon rock
void ActNpc314(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {64, 64, 80, 80},+ {80, 64, 96, 80},+ {96, 64, 112, 80},+ };
- rc[0] = {64, 64, 80, 80};- rc[1] = {80, 64, 96, 80};- rc[2] = {96, 64, 112, 80};-
switch (npc->act_no)
{case 0:
@@ -1419,19 +1434,20 @@
//Ma Pignon clone
void ActNpc315(NPCHAR *npc)
{- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {128, 0, 144, 16},+ {160, 0, 176, 16},+ {176, 0, 192, 16},+ {192, 0, 208, 16},+ };
- rcLeft[0] = {128, 0, 144, 16};- rcLeft[1] = {160, 0, 176, 16};- rcLeft[2] = {176, 0, 192, 16};- rcLeft[3] = {192, 0, 208, 16};+ RECT rcRight[4] = {+ {128, 16, 144, 32},+ {160, 16, 176, 32},+ {176, 16, 192, 32},+ {192, 16, 208, 32},+ };
- rcRight[0] = {128, 16, 144, 32};- rcRight[1] = {160, 16, 176, 32};- rcRight[2] = {176, 16, 192, 32};- rcRight[3] = {192, 16, 208, 32};-
switch (npc->act_no)
{case 0:
@@ -1560,17 +1576,18 @@
//Bute (dead)
void ActNpc316(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {248, 32, 272, 56},+ {272, 32, 296, 56},+ {296, 32, 320, 56},+ };
- rcLeft[0] = {248, 32, 272, 56};- rcLeft[1] = {272, 32, 296, 56};- rcLeft[2] = {296, 32, 320, 56};+ RECT rcRight[3] = {+ {248, 56, 272, 80},+ {272, 56, 296, 80},+ {296, 56, 320, 80},+ };
- rcRight[0] = {248, 56, 272, 80};- rcRight[1] = {272, 56, 296, 80};- rcRight[2] = {296, 56, 320, 80};-
switch (npc->act_no)
{case 0:
@@ -1638,19 +1655,20 @@
//Mesa
void ActNpc317(NPCHAR *npc)
{- RECT rcLeft[4];
- RECT rcRight[4];
+ RECT rcLeft[4] = {+ {0, 80, 32, 120},+ {32, 80, 64, 120},+ {64, 80, 96, 120},+ {96, 80, 128, 120},+ };
- rcLeft[0] = {0, 80, 32, 120};- rcLeft[1] = {32, 80, 64, 120};- rcLeft[2] = {64, 80, 96, 120};- rcLeft[3] = {96, 80, 128, 120};+ RECT rcRight[4] = {+ {0, 120, 32, 160},+ {32, 120, 64, 160},+ {64, 120, 96, 160},+ {96, 120, 128, 160},+ };
- rcRight[0] = {0, 120, 32, 160};- rcRight[1] = {32, 120, 64, 160};- rcRight[2] = {64, 120, 96, 160};- rcRight[3] = {96, 120, 128, 160};-
switch (npc->act_no)
{case 0:
@@ -1732,17 +1750,18 @@
//Mesa (dead)
void ActNpc318(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {224, 80, 256, 120},+ {256, 80, 288, 120},+ {288, 80, 320, 120},+ };
- rcLeft[0] = {224, 80, 256, 120};- rcLeft[1] = {256, 80, 288, 120};- rcLeft[2] = {288, 80, 320, 120};+ RECT rcRight[3] = {+ {224, 120, 256, 160},+ {256, 120, 288, 160},+ {288, 120, 320, 160},+ };
- rcRight[0] = {224, 120, 256, 160};- rcRight[1] = {256, 120, 288, 160};- rcRight[2] = {288, 120, 320, 160};-
switch (npc->act_no)
{case 0:
@@ -1807,11 +1826,11 @@
//Mesa block
void ActNpc319(NPCHAR *npc)
{- RECT rc[3];
-
- rc[0] = {16, 0, 32, 16};- rc[1] = {16, 0, 32, 16};- rc[2] = {96, 80, 112, 96};+ RECT rc[3] = {+ {16, 0, 32, 16},+ {16, 0, 32, 16},+ {96, 80, 112, 96},+ };
switch (npc->act_no)
{--- a/src/NpcAct320.cpp
+++ b/src/NpcAct320.cpp
@@ -17,17 +17,18 @@
//Curly (carried, shooting)
void ActNpc320(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {16, 96, 32, 112},+ {48, 96, 64, 112},+ {96, 96, 112, 112},+ };
- rcLeft[0] = {16, 96, 32, 112};- rcLeft[1] = {48, 96, 64, 112};- rcLeft[2] = {96, 96, 112, 112};+ RECT rcRight[3] = {+ {16, 112, 32, 128},+ {48, 112, 64, 128},+ {96, 112, 112, 128},+ };
- rcRight[0] = {16, 112, 32, 128};- rcRight[1] = {48, 112, 64, 128};- rcRight[2] = {96, 112, 112, 128};-
if (npc->act_no == 0)
{npc->act_no = 1;
@@ -106,17 +107,18 @@
//Curly's Nemesis
void ActNpc321(NPCHAR *npc)
{- RECT rcLeft[3];
- RECT rcRight[3];
+ RECT rcLeft[3] = {+ {136, 152, 152, 168},+ {152, 152, 168, 168},+ {168, 152, 184, 168},+ };
- rcLeft[0] = {136, 152, 152, 168};- rcLeft[1] = {152, 152, 168, 168};- rcLeft[2] = {168, 152, 184, 168};+ RECT rcRight[3] = {+ {136, 168, 152, 184},+ {152, 168, 168, 184},+ {168, 168, 184, 184},+ };
- rcRight[0] = {136, 168, 152, 184};- rcRight[1] = {152, 168, 168, 184};- rcRight[2] = {168, 168, 184, 184};-
char direct;
if (npc->pNpc)
@@ -170,12 +172,12 @@
//Deleet
void ActNpc322(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {272, 216, 296, 240},+ {296, 216, 320, 240},+ {160, 216, 184, 240},+ };
- rc[0] = {272, 216, 296, 240};- rc[1] = {296, 216, 320, 240};- rc[2] = {160, 216, 184, 240};-
if (npc->act_no < 2 && npc->life <= 968)
{npc->act_no = 2;
@@ -258,13 +260,13 @@
//Bute (spinning)
void ActNpc323(NPCHAR *npc)
{- RECT rc[4];
+ RECT rc[4] = {+ {216, 32, 232, 56},+ {232, 32, 248, 56},+ {216, 56, 232, 80},+ {232, 56, 248, 80},+ };
- rc[0] = {216, 32, 232, 56};- rc[1] = {232, 32, 248, 56};- rc[2] = {216, 56, 232, 80};- rc[3] = {232, 56, 248, 80};-
if (++npc->ani_wait > 3)
{npc->ani_wait = 0;
@@ -367,16 +369,16 @@
//Heavy Press lightning
void ActNpc325(NPCHAR *npc)
{- RECT rc[7];
+ RECT rc[7] = {+ {240, 96, 272, 128},+ {272, 96, 304, 128},+ {240, 128, 272, 160},+ {240, 0, 256, 96},+ {256, 0, 272, 96},+ {272, 0, 288, 96},+ {288, 0, 304, 96},+ };
- rc[0] = {240, 96, 272, 128};- rc[1] = {272, 96, 304, 128};- rc[2] = {240, 128, 272, 160};- rc[3] = {240, 0, 256, 96};- rc[4] = {256, 0, 272, 96};- rc[5] = {272, 0, 288, 96};- rc[6] = {288, 0, 304, 96};-
switch (npc->act_no)
{case 0:
@@ -526,37 +528,41 @@
break;
}
- RECT rcSu[8];
- RECT rcItoh[8];
- rcItoh[0] = {0, 128, 16, 152};- rcItoh[1] = {16, 128, 32, 152};- rcItoh[2] = {32, 128, 48, 152};- rcItoh[3] = {48, 128, 64, 152};- rcItoh[4] = {64, 128, 80, 152};- rcItoh[5] = {80, 128, 96, 152};- rcItoh[6] = {96, 128, 112, 152};- rcItoh[7] = {112, 128, 128, 152};- rcSu[0] = {128, 128, 144, 152};- rcSu[1] = {144, 128, 160, 152};- rcSu[2] = {160, 128, 176, 152};- rcSu[3] = {176, 128, 192, 152};- rcSu[4] = {192, 128, 208, 152};- rcSu[5] = {208, 128, 224, 152};- rcSu[6] = {224, 128, 240, 152};- rcSu[7] = {32, 152, 48, 176};+ RECT rcItoh[8] = {+ {0, 128, 16, 152},+ {16, 128, 32, 152},+ {32, 128, 48, 152},+ {48, 128, 64, 152},+ {64, 128, 80, 152},+ {80, 128, 96, 152},+ {96, 128, 112, 152},+ {112, 128, 128, 152},+ };
+
+ RECT rcSu[8] = {+ {128, 128, 144, 152},+ {144, 128, 160, 152},+ {160, 128, 176, 152},+ {176, 128, 192, 152},+ {192, 128, 208, 152},+ {208, 128, 224, 152},+ {224, 128, 240, 152},+ {32, 152, 48, 176},+ };
- if (npc->direct)
- npc->rect = rcSu[npc->ani_no];
- else
+ if (npc->direct == 0)
npc->rect = rcItoh[npc->ani_no];
+ else
+ npc->rect = rcSu[npc->ani_no];
}
//Sneeze
void ActNpc327(NPCHAR *npc)
{- RECT rc[2];
- rc[0] = {240, 80, 256, 96};- rc[1] = {256, 80, 272, 96};+ RECT rc[2] = {+ {240, 80, 256, 96},+ {256, 80, 272, 96},+ };
++npc->act_wait;
@@ -598,27 +604,33 @@
//Thingy that turns Sue and Itoh into humans for 4 seconds
void ActNpc328(NPCHAR *npc)
{- npc->rect = {96, 0, 128, 48};+ RECT rc = {96, 0, 128, 48};+ npc->rect = rc;
}
//Laboratory fan
void ActNpc329(NPCHAR *npc)
{- if (++npc->ani_wait / 2 & 1)
- npc->rect = {48, 0, 64, 16};+ RECT rc[2] = {+ {48, 0, 64, 16},+ {64, 0, 80, 16},+ };
+
+ if (++npc->ani_wait / 2 % 2)
+ npc->rect = rc[0];
else
- npc->rect = {64, 0, 80, 16};+ npc->rect = rc[1];
}
//Rolling
void ActNpc330(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {144, 136, 160, 152},+ {160, 136, 176, 152},+ {176, 136, 192, 152},+ };
- rc[0] = {144, 136, 160, 152};- rc[1] = {160, 136, 176, 152};- rc[2] = {176, 136, 192, 152};-
switch (npc->act_no)
{case 0:
@@ -696,13 +708,13 @@
//Ballos bone projectile
void ActNpc331(NPCHAR *npc)
{- RECT rc[4];
+ RECT rc[4] = {+ {288, 80, 304, 96},+ {304, 80, 320, 96},+ {288, 96, 304, 112},+ {304, 96, 320, 112},+ };
- rc[0] = {288, 80, 304, 96};- rc[1] = {304, 80, 320, 96};- rc[2] = {288, 96, 304, 112};- rc[3] = {304, 96, 320, 112};-
switch (npc->act_no)
{case 0:
@@ -755,12 +767,12 @@
//Ballos shockwave
void ActNpc332(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {144, 96, 168, 120},+ {168, 96, 192, 120},+ {192, 96, 216, 120},+ };
- rc[0] = {144, 96, 168, 120};- rc[1] = {168, 96, 192, 120};- rc[2] = {192, 96, 216, 120};-
switch (npc->act_no)
{case 0:
@@ -813,11 +825,11 @@
//Ballos lightning
void ActNpc333(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {80, 120, 104, 144},+ {104, 120, 128, 144},+ };
- rc[0] = {80, 120, 104, 144};- rc[1] = {104, 120, 128, 144};-
switch (npc->act_no)
{case 0:
@@ -849,15 +861,16 @@
//Sweat
void ActNpc334(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {160, 184, 168, 200},+ {168, 184, 176, 200},+ };
- rcLeft[0] = {160, 184, 168, 200};- rcLeft[1] = {168, 184, 176, 200};+ RECT rcRight[2] = {+ {176, 184, 184, 200},+ {184, 184, 192, 200},+ };
- rcRight[0] = {176, 184, 184, 200};- rcRight[1] = {184, 184, 192, 200};-
switch (npc->act_no)
{case 0:
@@ -895,12 +908,12 @@
//Ikachan
void ActNpc335(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {0, 16, 16, 32},+ {16, 16, 32, 32},+ {32, 16, 48, 32},+ };
- rc[0] = {0, 16, 16, 32};- rc[1] = {16, 16, 32, 32};- rc[2] = {32, 16, 48, 32};-
switch (npc->act_no)
{case 0:
@@ -970,11 +983,11 @@
//Numhachi
void ActNpc337(NPCHAR *npc)
{- RECT rcLeft[2];
+ RECT rcLeft[2] = {+ {256, 112, 288, 152},+ {288, 112, 320, 152},+ };
- rcLeft[0] = {256, 112, 288, 152};- rcLeft[1] = {288, 112, 320, 152};-
switch (npc->act_no)
{case 0:
@@ -1012,14 +1025,15 @@
//Green Devil
void ActNpc338(NPCHAR *npc)
{- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rcLeft[2] = {+ {288, 0, 304, 16},+ {304, 0, 320, 16},+ };
- rcLeft[0] = {288, 0, 304, 16};- rcLeft[1] = {304, 0, 320, 16};-
- rcRight[0] = {288, 16, 304, 32};- rcRight[1] = {304, 16, 320, 32};+ RECT rcRight[2] = {+ {288, 16, 304, 32},+ {304, 16, 320, 32},+ };
switch (npc->act_no)
{--- a/src/NpcAct340.cpp
+++ b/src/NpcAct340.cpp
@@ -521,33 +521,34 @@
npc->x += npc->xm;
npc->y += npc->ym;
- RECT rcLeft[11];
- RECT rcRight[11];
+ RECT rcLeft[11] = {+ {0, 0, 48, 40},+ {48, 0, 96, 40},+ {96, 0, 144, 40},+ {144, 0, 192, 40},+ {192, 0, 240, 40},+ {240, 0, 288, 40},+ {0, 80, 48, 120},+ {48, 80, 96, 120},+ {96, 80, 144, 120},+ {144, 80, 192, 120},+ {192, 80, 240, 120},+ };
- rcLeft[0] = {0, 0, 48, 40};- rcLeft[1] = {48, 0, 96, 40};- rcLeft[2] = {96, 0, 144, 40};- rcLeft[3] = {144, 0, 192, 40};- rcLeft[4] = {192, 0, 240, 40};- rcLeft[5] = {240, 0, 288, 40};- rcLeft[6] = {0, 80, 48, 120};- rcLeft[7] = {48, 80, 96, 120};- rcLeft[8] = {96, 80, 144, 120};- rcLeft[9] = {144, 80, 192, 120};- rcLeft[10] = {192, 80, 240, 120};+ RECT rcRight[11] = {+ {0, 40, 48, 80},+ {48, 40, 96, 80},+ {96, 40, 144, 80},+ {144, 40, 192, 80},+ {192, 40, 240, 80},+ {240, 40, 288, 80},+ {0, 120, 48, 160},+ {48, 120, 96, 160},+ {96, 120, 144, 160},+ {144, 120, 192, 160},+ {192, 120, 240, 160},+ };
- rcRight[0] = {0, 40, 48, 80};- rcRight[1] = {48, 40, 96, 80};- rcRight[2] = {96, 40, 144, 80};- rcRight[3] = {144, 40, 192, 80};- rcRight[4] = {192, 40, 240, 80};- rcRight[5] = {240, 40, 288, 80};- rcRight[6] = {0, 120, 48, 160};- rcRight[7] = {48, 120, 96, 160};- rcRight[8] = {96, 120, 144, 160};- rcRight[9] = {144, 120, 192, 160};- rcRight[10] = {192, 120, 240, 160};-
if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
else
@@ -557,12 +558,12 @@
//Ballos 1 head
void ActNpc341(NPCHAR *npc)
{- RECT rc[3];
+ RECT rc[3] = {+ {288, 32, 320, 48},+ {288, 48, 320, 64},+ {288, 64, 320, 80},+ };
- rc[0] = {288, 32, 320, 48};- rc[1] = {288, 48, 320, 64};- rc[2] = {288, 64, 320, 80};-
if (npc->pNpc->act_no == 11 && npc->pNpc->act_wait > 50)
++npc->ani_wait;
@@ -585,12 +586,12 @@
{static int flash;
- RECT rc[3];
+ RECT rc[3] = {+ {240, 48, 280, 88},+ {240, 88, 280, 128},+ {280, 48, 320, 88},+ };
- rc[0] = {240, 48, 280, 88};- rc[1] = {240, 88, 280, 128};- rc[2] = {280, 48, 320, 88};-
if (npc->act_no < 1000 && npc->pNpc->act_no >= 1000)
npc->act_no = 1000;
@@ -865,11 +866,11 @@
//Ballos 2 eyes
void ActNpc344(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {272, 0, 296, 16},+ {296, 0, 320, 16},+ };
- rc[0] = {272, 0, 296, 16};- rc[1] = {296, 0, 320, 16};-
if (npc->direct == 0)
{npc->rect = rc[0];
@@ -890,13 +891,13 @@
//Ballos skull projectile
void ActNpc345(NPCHAR *npc)
{- RECT rc[4];
+ RECT rc[4] = {+ {128, 176, 144, 192},+ {144, 176, 160, 192},+ {160, 176, 176, 192},+ {176, 176, 192, 192},+ };
- rc[0] = {128, 176, 144, 192};- rc[1] = {144, 176, 160, 192};- rc[2] = {160, 176, 176, 192};- rc[3] = {176, 176, 192, 192};-
switch (npc->act_no)
{case 0:
@@ -1161,13 +1162,13 @@
break;
}
- RECT rc[4];
+ RECT rc[4] = {+ {256, 48, 272, 64},+ {272, 48, 288, 64},+ {288, 48, 304, 64},+ {304, 48, 320, 64},+ };
- rc[0] = {256, 48, 272, 64};- rc[1] = {272, 48, 288, 64};- rc[2] = {288, 48, 304, 64};- rc[3] = {304, 48, 320, 64};-
npc->rect = rc[npc->ani_no];
}
@@ -1174,11 +1175,11 @@
//Ballos 4 spikes
void ActNpc348(NPCHAR *npc)
{- RECT rc[2];
+ RECT rc[2] = {+ {128, 152, 160, 176},+ {160, 152, 192, 176},+ };
- rc[0] = {128, 152, 160, 176};- rc[1] = {160, 152, 192, 176};-
switch (npc->act_no)
{case 0:
@@ -1228,25 +1229,26 @@
//Flying Bute archer
void ActNpc350(NPCHAR *npc)
{- RECT rcLeft[7];
- RECT rcRight[7];
+ RECT rcLeft[7] = {+ {0, 160, 24, 184},+ {24, 160, 48, 184},+ {48, 160, 72, 184},+ {72, 160, 96, 184},+ {96, 160, 120, 184},+ {120, 160, 144, 184},+ {144, 160, 168, 184},+ };
- rcLeft[0] = {0, 160, 24, 184};- rcLeft[1] = {24, 160, 48, 184};- rcLeft[2] = {48, 160, 72, 184};- rcLeft[3] = {72, 160, 96, 184};- rcLeft[4] = {96, 160, 120, 184};- rcLeft[5] = {120, 160, 144, 184};- rcLeft[6] = {144, 160, 168, 184};+ RECT rcRight[7] = {+ {0, 184, 24, 208},+ {24, 184, 48, 208},+ {48, 184, 72, 208},+ {72, 184, 96, 208},+ {96, 184, 120, 208},+ {120, 184, 144, 208},+ {144, 184, 168, 208},+ };
- rcRight[0] = {0, 184, 24, 208};- rcRight[1] = {24, 184, 48, 208};- rcRight[2] = {48, 184, 72, 208};- rcRight[3] = {72, 184, 96, 208};- rcRight[4] = {96, 184, 120, 208};- rcRight[5] = {120, 184, 144, 208};- rcRight[6] = {144, 184, 168, 208};-
switch (npc->act_no)
{case 0:
@@ -1409,18 +1411,18 @@
//Statue (shootable)
void ActNpc351(NPCHAR *npc)
{- RECT rc[9];
+ RECT rc[9] = {+ {0, 96, 32, 136},+ {32, 96, 64, 136},+ {64, 96, 96, 136},+ {96, 96, 128, 136},+ {128, 96, 160, 136},+ {0, 176, 32, 216},+ {32, 176, 64, 216},+ {64, 176, 96, 216},+ {96, 176, 128, 216},+ };
- rc[0] = {0, 96, 32, 136};- rc[1] = {32, 96, 64, 136};- rc[2] = {64, 96, 96, 136};- rc[3] = {96, 96, 128, 136};- rc[4] = {128, 96, 160, 136};- rc[5] = {0, 176, 32, 216};- rc[6] = {32, 176, 64, 216};- rc[7] = {64, 176, 96, 216};- rc[8] = {96, 176, 128, 216};-
switch (npc->act_no)
{case 0:
@@ -1525,7 +1527,7 @@
break;
}
- static RECT rc[28] = {+ RECT rc[28] = { {304, 48, 320, 64}, {224, 48, 240, 64}, {32, 80, 48, 96},@@ -1562,21 +1564,23 @@
//Bute with sword (flying)
void ActNpc353(NPCHAR *npc)
{- RECT rc[4];
- RECT rcLeft[2];
- RECT rcRight[2];
+ RECT rc[4] = {+ {168, 160, 184, 184},+ {184, 160, 200, 184},+ {168, 184, 184, 208},+ {184, 184, 200, 208},+ };
- rc[0] = {168, 160, 184, 184};- rc[1] = {184, 160, 200, 184};- rc[2] = {168, 184, 184, 208};- rc[3] = {184, 184, 200, 208};+ RECT rcLeft[2] = {+ {200, 160, 216, 176},+ {216, 160, 232, 176},+ };
- rcLeft[0] = {200, 160, 216, 176};- rcLeft[1] = {216, 160, 232, 176};+ RECT rcRight[2] = {+ {200, 176, 216, 192},+ {216, 176, 232, 192},+ };
- rcRight[0] = {200, 176, 216, 192};- rcRight[1] = {216, 176, 232, 192};-
switch (npc->act_no)
{case 0:
@@ -1735,13 +1739,13 @@
//Quote and Curly on Balrog's back
void ActNpc355(NPCHAR *npc)
{- RECT rc[4];
+ RECT rc[4] = {+ {80, 16, 96, 32},+ {80, 96, 96, 112},+ {128, 16, 144, 32},+ {208, 96, 224, 112},+ };
- rc[0] = {80, 16, 96, 32};- rc[1] = {80, 96, 96, 112};- rc[2] = {128, 16, 144, 32};- rc[3] = {208, 96, 224, 112};-
if (npc->act_no == 0)
{switch (npc->direct)
@@ -1782,11 +1786,11 @@
//Balrog rescue
void ActNpc356(NPCHAR *npc)
{- RECT rcRight[2];
+ RECT rcRight[2] = {+ {240, 128, 280, 152},+ {240, 152, 280, 176},+ };
- rcRight[0] = {240, 128, 280, 152};- rcRight[1] = {240, 152, 280, 176};-
switch (npc->act_no)
{case 0:
@@ -1886,14 +1890,14 @@
//Misery (stood in the wind during the credits)
void ActNpc358(NPCHAR *npc)
{- RECT rc[5];
+ RECT rc[5] = {+ {208, 8, 224, 32},+ {224, 8, 240, 32},+ {240, 8, 256, 32},+ {256, 8, 272, 32},+ {272, 8, 288, 32},+ };
- rc[0] = {208, 8, 224, 32};- rc[1] = {224, 8, 240, 32};- rc[2] = {240, 8, 256, 32};- rc[3] = {256, 8, 272, 32};- rc[4] = {272, 8, 288, 32};-
switch (npc->act_no)
{case 0:
@@ -1934,7 +1938,9 @@
//Thank you
void ActNpc360(NPCHAR *npc)
{- if (!npc->act_no)
+ RECT rc = {0, 176, 48, 184};+
+ if (npc->act_no == 0)
{++npc->act_no;
npc->x -= 0x1000;
@@ -1941,5 +1947,5 @@
npc->y -= 0x1000;
}
- npc->rect = {0, 176, 48, 184};+ npc->rect = rc;
}
--- a/src/Organya.cpp
+++ b/src/Organya.cpp
@@ -1,5 +1,6 @@
#include "Organya.h"
+#include <stddef.h>
#include <stdint.h>
#include <SDL_rwops.h>
@@ -470,7 +471,7 @@
for (int j = 0; j < 16; j++) {//The first note from is NULL
if (info.tdata[j].note_num == 0) {- info.tdata[j].note_list = nullptr;
+ info.tdata[j].note_list = NULL;
continue;
}
@@ -477,7 +478,7 @@
//Make note list
np = info.tdata[j].note_p;
info.tdata[j].note_list = info.tdata[j].note_p;
- np->from = nullptr;
+ np->from = NULL;
np->to = (np + 1);
np++;
@@ -489,7 +490,7 @@
//The last note to is NULL
np--;
- np->to = nullptr;
+ np->to = NULL;
//Set note properties
np = info.tdata[j].note_p; //X position
@@ -585,7 +586,7 @@
}
//Org timer
-SDL_Thread *OrganyaTimer = nullptr;
+SDL_Thread *OrganyaTimer = NULL;
bool bEndTimer = false;
int OrganyaPlayTimer(void *ptr)
@@ -631,7 +632,7 @@
{bEndTimer = true; //Tell thread to end
SDL_WaitThread(OrganyaTimer, NULL); //Wait for thread to end
- OrganyaTimer = nullptr;
+ OrganyaTimer = NULL;
}
//Start and end organya
--- a/src/SelStage.cpp
+++ b/src/SelStage.cpp
@@ -94,14 +94,14 @@
{static unsigned int flash;
- RECT rcView;
- RECT rcCur[2];
- RECT rcTitle1;
+ RECT rcView = {0, 0, WINDOW_WIDTH, WINDOW_HEIGHT};- rcView = {0, 0, WINDOW_WIDTH, WINDOW_HEIGHT};- rcCur[0] = {80, 88, 112, 104};- rcCur[1] = {80, 104, 112, 120};- rcTitle1 = {80, 64, 144, 72};+ RECT rcCur[2] = {+ {80, 88, 112, 104},+ {80, 104, 112, 120},+ };
+
+ RECT rcTitle1 = {80, 64, 144, 72};if (gStageSelectTitleY > (WINDOW_HEIGHT / 2) - 74)
--gStageSelectTitleY;
--- a/src/Sound.cpp
+++ b/src/Sound.cpp
@@ -62,7 +62,7 @@
delete[] data;
//Remove from buffer list
- for (SOUNDBUFFER **soundBuffer = &soundBuffers; *soundBuffer != nullptr; soundBuffer = &(*soundBuffer)->next)
+ for (SOUNDBUFFER **soundBuffer = &soundBuffers; *soundBuffer != NULL; soundBuffer = &(*soundBuffer)->next)
{if (*soundBuffer == this)
{@@ -85,10 +85,10 @@
{SDL_LockAudioDevice(audioDevice);
- if (outBuffer != nullptr)
+ if (outBuffer != NULL)
*outBuffer = data;
- if (outSize != nullptr)
+ if (outSize != NULL)
*outSize = size;
}
@@ -114,7 +114,7 @@
float MillibelToVolume(int32_t lVolume)
{//Volume is in hundredths of decibels, from 0 to -10000
- lVolume = clamp(lVolume, (decltype(lVolume))-10000, (decltype(lVolume))0);
+ lVolume = clamp(lVolume, (int32_t)-10000, (int32_t)0);
return pow(10.0, lVolume / 2000.0);
}
@@ -209,7 +209,7 @@
}
//Mix sounds to primary buffer
- for (SOUNDBUFFER *sound = soundBuffers; sound != nullptr; sound = sound->next)
+ for (SOUNDBUFFER *sound = soundBuffers; sound != NULL; sound = sound->next)
sound->Mix(buffer, samples);
}
--- a/src/Star.cpp
+++ b/src/Star.cpp
@@ -112,10 +112,11 @@
void PutStar(int fx, int fy)
{- RECT rc[3];
- rc[0] = {192, 0, 200, 8};- rc[1] = {192, 8, 200, 16};- rc[2] = {192, 16, 200, 24};+ RECT rc[3] = {+ {192, 0, 200, 8},+ {192, 8, 200, 16},+ {192, 16, 200, 24},+ };
if (!(gMC.cond & 2) && (gMC.equip & 0x80))
{--- a/src/ValueView.cpp
+++ b/src/ValueView.cpp
@@ -85,27 +85,28 @@
gVV[index].rect.right = 40;
gVV[index].rect.bottom = 8 * (index + 1);
- RECT rect[20];
- rect[0] = {0, 56, 8, 64};- rect[1] = {8, 56, 16, 64};- rect[2] = {16, 56, 24, 64};- rect[3] = {24, 56, 32, 64};- rect[4] = {32, 56, 40, 64};- rect[5] = {40, 56, 48, 64};- rect[6] = {48, 56, 56, 64};- rect[7] = {56, 56, 64, 64};- rect[8] = {64, 56, 72, 64};- rect[9] = {72, 56, 80, 64};- rect[10] = {0, 64, 8, 72};- rect[11] = {8, 64, 16, 72};- rect[12] = {16, 64, 24, 72};- rect[13] = {24, 64, 32, 72};- rect[14] = {32, 64, 40, 72};- rect[15] = {40, 64, 48, 72};- rect[16] = {48, 64, 56, 72};- rect[17] = {56, 64, 64, 72};- rect[18] = {64, 64, 72, 72};- rect[19] = {72, 64, 80, 72};+ RECT rect[20] = {+ {0, 56, 8, 64},+ {8, 56, 16, 64},+ {16, 56, 24, 64},+ {24, 56, 32, 64},+ {32, 56, 40, 64},+ {40, 56, 48, 64},+ {48, 56, 56, 64},+ {56, 56, 64, 64},+ {64, 56, 72, 64},+ {72, 56, 80, 64},+ {0, 64, 8, 72},+ {8, 64, 16, 72},+ {16, 64, 24, 72},+ {24, 64, 32, 72},+ {32, 64, 40, 72},+ {40, 64, 48, 72},+ {48, 64, 56, 72},+ {56, 64, 64, 72},+ {64, 64, 72, 72},+ {72, 64, 80, 72},+ };
//Get digits
int dig[4];
--
⑨