ref: adb09e19b7cbb4f2fc8c9766d96e0ebcd9cb5ee6
parent: 1733b58b3a8147e1a242f72f1d127169ee329a02
parent: f7a8a260a416c8d0d07ba77e7faafda867741a43
author: Clownacy <Clownacy@users.noreply.github.com>
date: Wed Jul 8 15:42:28 EDT 2020
Merge branch 'accurate' into portable
--- a/src/ArmsItem.cpp
+++ b/src/ArmsItem.cpp
@@ -281,7 +281,7 @@
if (gCampActive == FALSE)
{
// Switch to a weapon
- PlaySoundObject(SND_SWITCH_WEAPON, 1);
+ PlaySoundObject(SND_SWITCH_WEAPON, SOUND_MODE_PLAY);
if (arms_num != 0)
StartTextScript(1000 + gArmsData[gSelectedArms].code);
@@ -291,7 +291,7 @@
else
{
// Switch to an item
- PlaySoundObject(SND_YES_NO_CHANGE_CHOICE, 1);
+ PlaySoundObject(SND_YES_NO_CHANGE_CHOICE, SOUND_MODE_PLAY);
if (item_num != 0)
StartTextScript(5000 + gItemData[gSelectedItem].code);
@@ -592,7 +592,7 @@
gSelectedArms = 0;
gArmsEnergyX = 32;
- PlaySoundObject(SND_SWITCH_WEAPON, 1);
+ PlaySoundObject(SND_SWITCH_WEAPON, SOUND_MODE_PLAY);
return gArmsData[gSelectedArms].code;
}
@@ -624,7 +624,7 @@
}
gArmsEnergyX = 0;
- PlaySoundObject(SND_SWITCH_WEAPON, 1);
+ PlaySoundObject(SND_SWITCH_WEAPON, SOUND_MODE_PLAY);
return gArmsData[gSelectedArms].code;
}
@@ -633,5 +633,5 @@
{
gSelectedArms = 0;
gArmsEnergyX = 32;
- PlaySoundObject(SND_SWITCH_WEAPON, 1);
+ PlaySoundObject(SND_SWITCH_WEAPON, SOUND_MODE_PLAY);
}
--- a/src/Boss.cpp
+++ b/src/Boss.cpp
@@ -136,7 +136,7 @@
}
else
{
- PlaySoundObject(gBoss[bos_].destroy_voice, 1);
+ PlaySoundObject(gBoss[bos_].destroy_voice, SOUND_MODE_PLAY);
switch (gBoss[bos_].size)
{
@@ -161,7 +161,7 @@
SetCaret(gBul[bul].x, gBul[bul].y, 11, 0);
SetCaret(gBul[bul].x, gBul[bul].y, 11, 0);
SetCaret(gBul[bul].x, gBul[bul].y, 11, 0);
- PlaySoundObject(gBoss[bos_].hit_voice, 1);
+ PlaySoundObject(gBoss[bos_].hit_voice, SOUND_MODE_PLAY);
}
gBoss[bos].shock = 8;
@@ -188,7 +188,7 @@
if (!(gBul[bul].bbits & 0x10))
{
SetCaret(gBul[bul].x, gBul[bul].y, 2, 2);
- PlaySoundObject(31, 1);
+ PlaySoundObject(31, SOUND_MODE_PLAY);
gBul[bul].cond = 0;
continue;
}
--- a/src/BossAlmo1.cpp
+++ b/src/BossAlmo1.cpp
@@ -196,7 +196,7 @@
ym = GetSin(deg) * 2;
xm = GetCos(deg) * 2;
SetNpChar(178, npc->x, npc->y, xm, ym, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
}
break;
@@ -360,7 +360,7 @@
if (npc->act_wait > 400)
{
++npc->count1;
- PlaySoundObject(115, 1);
+ PlaySoundObject(115, SOUND_MODE_PLAY);
if (npc->count1 > 3)
{
@@ -471,7 +471,7 @@
ym = GetSin(deg) * 3;
xm = GetCos(deg) * 3;
SetNpChar(218, npc->x - (40 * 0x200), npc->y, xm, ym, 0, NULL, 0x100);
- PlaySoundObject(101, 1);
+ PlaySoundObject(101, SOUND_MODE_PLAY);
}
if (npc->act_wait > 400)
@@ -561,7 +561,7 @@
gBoss[6].act_no = 100;
gBoss[7].act_no = 100;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
for (i = 0; i < 8; ++i)
SetNpChar(4, gBoss[4].x + (Random(-32, 16) * 0x200), gBoss[4].y, Random(-0x200, 0x200), Random(-0x100, 0x100), 0, NULL, 0x100);
--- a/src/BossAlmo2.cpp
+++ b/src/BossAlmo2.cpp
@@ -147,16 +147,16 @@
npc->act_wait = 0;
if (npc->act_wait > 250 && npc->act_wait % 0x10 == 1)
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
if (npc->act_wait > 250 && npc->act_wait % 0x10 == 7)
{
SetNpChar(293, npc->x, npc->y, 0, 0, 0, NULL, 0x80);
- PlaySoundObject(101, 1);
+ PlaySoundObject(101, SOUND_MODE_PLAY);
}
if (npc->act_wait == 200)
- PlaySoundObject(116, 1);
+ PlaySoundObject(116, SOUND_MODE_PLAY);
if (npc->act_wait > 200 && npc->act_wait % 2 != 0)
npc->ani_no = 4;
@@ -414,7 +414,7 @@
if (npc->act_wait > 200)
{
++npc->count1;
- PlaySoundObject(115, 1);
+ PlaySoundObject(115, SOUND_MODE_PLAY);
if (npc->life < 200)
{
@@ -519,7 +519,7 @@
break;
}
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
SetNpChar(285, x - (16 * 0x200), y, 0, 0, 0, NULL, 0x100);
SetNpChar(285, x - (16 * 0x200), y, 0, 0, 0x400, NULL, 0x100);
}
@@ -553,7 +553,7 @@
gBoss[10].bits |= NPC_INVULNERABLE;
gBoss[11].bits |= NPC_SHOOTABLE;
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
SetNpChar(285, gBoss[3].x - (16 * 0x200), gBoss[3].y, 0, 0, 0, NULL, 0x100);
SetNpChar(285, gBoss[3].x - (16 * 0x200), gBoss[3].y, 0, 0, 0x400, NULL, 0x100);
@@ -641,7 +641,7 @@
++gBoss[0].act_wait;
if (gBoss[0].act_wait % 8 == 0)
- PlaySoundObject(44, 1);
+ PlaySoundObject(44, SOUND_MODE_PLAY);
SetDestroyNpChar(gBoss[0].x + (Random(-72, 72) * 0x200), gBoss[0].y + (Random(-64, 64) * 0x200), 1, 1);
@@ -650,7 +650,7 @@
gBoss[0].act_wait = 0;
gBoss[0].act_no = 1001;
SetFlash(gBoss[0].x, gBoss[0].y, 1);
- PlaySoundObject(35, 1);
+ PlaySoundObject(35, SOUND_MODE_PLAY);
}
break;
@@ -685,7 +685,7 @@
if (npc->act_no == 231)
gBoss[1].act_no = gBoss[2].act_no = gBoss[6].act_no = gBoss[7].act_no = 30;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
for (i = 0; i < 8; ++i)
SetNpChar(4, gBoss[4].x + (Random(-32, 16) * 0x200), gBoss[4].y, Random(-0x200, 0x200), Random(-0x100, 0x100), 0, NULL, 0x100);
@@ -695,7 +695,7 @@
{
if (npc->x < 192 * 0x200)
npc->direct = 2;
- if (npc->x > (gMap.width - 4) * 0x2000) // Pixel is inconsistent: the assembly code indicates he really used '0x2000' instead of '0x200 * 0x10', which he usually uses
+ if (npc->x > (gMap.width - 4) * (0x200 * 0x10))
npc->direct = 0;
if (npc->direct == 0)
@@ -715,11 +715,11 @@
if (npc->count2 == 150)
{
npc->count2 = 0;
- SetNpChar(282, (gMap.width * 0x200 * 0x10) + 0x40, (Random(-1, 3) + 10) * 0x2000, 0, 0, 0, NULL, 0x30);
+ SetNpChar(282, (gMap.width * 0x200 * 0x10) + 0x40, (Random(-1, 3) + 10) * (0x200 * 0x10), 0, 0, 0, NULL, 0x30);
}
else if (npc->count2 == 75)
{
- SetNpChar(282, (gMap.width * 0x200 * 0x10) + 0x40, (Random(-3, 0) + 3) * 0x2000, 0, 0, 0, NULL, 0x30);
+ SetNpChar(282, (gMap.width * 0x200 * 0x10) + 0x40, (Random(-3, 0) + 3) * (0x200 * 0x10), 0, 0, 0, NULL, 0x30);
}
break;
--- a/src/BossBallos.cpp
+++ b/src/BossBallos.cpp
@@ -237,7 +237,7 @@
npc->act_no = 103;
npc->act_wait = 0;
SetQuake2(30);
- PlaySoundObject(44, 1);
+ PlaySoundObject(44, SOUND_MODE_PLAY);
if (gMC.y > npc->y + (48 * 0x200) && gMC.x < npc->x + (24 * 0x200) && gMC.x > npc->x - (24 * 0x200))
DamageMyChar(16);
@@ -325,10 +325,10 @@
gMC.ym = -0x200;
SetQuake2(30);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetNpChar(332, npc->x - (12 * 0x200), npc->y + (52 * 0x200), 0, 0, 0, NULL, 0x100);
SetNpChar(332, npc->x + (12 * 0x200), npc->y + (52 * 0x200), 0, 0, 2, NULL, 0x100);
- PlaySoundObject(44, 1);
+ PlaySoundObject(44, SOUND_MODE_PLAY);
for (i = 0; i < 0x10; ++i)
{
@@ -363,7 +363,7 @@
npc->act_no = 222;
npc->act_wait = 0;
SetQuake2(30);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
for (i = 0; i < 0x10; ++i)
{
@@ -514,7 +514,7 @@
}
if (npc->act_wait / 3 % 2)
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
if (npc->act_wait > 540)
npc->act_no = 420;
@@ -526,7 +526,7 @@
npc->act_wait = 0;
npc->ani_wait = 0;
SetQuake2(30);
- PlaySoundObject(35, 1);
+ PlaySoundObject(35, SOUND_MODE_PLAY);
gBoss[1].act_no = 102;
gBoss[2].act_no = 102;
@@ -648,7 +648,7 @@
++gBoss[0].act_wait;
if (gBoss[0].act_wait % 12 == 0)
- PlaySoundObject(44, 1);
+ PlaySoundObject(44, SOUND_MODE_PLAY);
SetDestroyNpChar(gBoss[0].x + (Random(-60, 60) * 0x200), gBoss[0].y + (Random(-60, 60) * 0x200), 1, 1);
@@ -657,7 +657,7 @@
gBoss[0].act_wait = 0;
gBoss[0].act_no = 1002;
SetFlash(gBoss[0].x, gBoss[0].y, 1);
- PlaySoundObject(35, 1);
+ PlaySoundObject(35, SOUND_MODE_PLAY);
}
break;
@@ -718,7 +718,7 @@
if (npc->act_wait == 270 || npc->act_wait == 280 || npc->act_wait == 290)
{
SetNpChar(353, npc->x, npc->y - (52 * 0x200), 0, 0, 1, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
for (i = 0; i < 4; ++i)
SetNpChar(4, npc->x, npc->y - (52 * 0x200), 0, 0, 0, NULL, 0x100);
--- a/src/BossFrog.cpp
+++ b/src/BossFrog.cpp
@@ -73,33 +73,33 @@
{
case BALFROG_SPRITE_NOTHING:
boss->hit_voice = SND_BEHEMOTH_LARGE_HURT;
- boss->hit.front = PIXELS_TO_UNITS(16);
- boss->hit.top = PIXELS_TO_UNITS(16);
- boss->hit.back = PIXELS_TO_UNITS(16);
- boss->hit.bottom = PIXELS_TO_UNITS(16);
+ boss->hit.front = 16 * 0x200;
+ boss->hit.top = 16 * 0x200;
+ boss->hit.back = 16 * 0x200;
+ boss->hit.bottom = 16 * 0x200;
boss->size = 3;
boss->bits = NPC_INVULNERABLE;
break;
case BALFROG_SPRITE_STANDING_STILL:
- boss->x = gBoss[0].x + PIXELS_TO_UNITS(-24) * minus;
- boss->y = gBoss[0].y - PIXELS_TO_UNITS(24);
+ boss->x = gBoss[0].x + -24 * 0x200 * minus;
+ boss->y = gBoss[0].y - 24 * 0x200;
break;
case BALFROG_SPRITE_MOUTH_BARELY_OPEN_CROUCHING:
- boss->x = gBoss[0].x + PIXELS_TO_UNITS(-24) * minus;
- boss->y = gBoss[0].y - PIXELS_TO_UNITS(20);
+ boss->x = gBoss[0].x + -24 * 0x200 * minus;
+ boss->y = gBoss[0].y - 20 * 0x200;
break;
case BALFROG_SPRITE_MOUTH_OPEN_CROUCHING:
case BALFROG_SPRITE_MOUTH_OPEN_CROUCHING_FLASHING:
- boss->x = gBoss[0].x + PIXELS_TO_UNITS(-24) * minus;
- boss->y = gBoss[0].y - PIXELS_TO_UNITS(16);
+ boss->x = gBoss[0].x + -24 * 0x200 * minus;
+ boss->y = gBoss[0].y - 16 * 0x200;
break;
case BALFROG_SPRITE_JUMPING:
- boss->x = gBoss[0].x + PIXELS_TO_UNITS(-24) * minus;
- boss->y = gBoss[0].y - PIXELS_TO_UNITS(43);
+ boss->x = gBoss[0].x + -24 * 0x200 * minus;
+ boss->y = gBoss[0].y - 43 * 0x200;
break;
}
}
@@ -112,10 +112,10 @@
{
case BALFROG_SPRITE_NOTHING:
boss->hit_voice = SND_BEHEMOTH_LARGE_HURT;
- boss->hit.front = PIXELS_TO_UNITS(24);
- boss->hit.top = PIXELS_TO_UNITS(16);
- boss->hit.back = PIXELS_TO_UNITS(24);
- boss->hit.bottom = PIXELS_TO_UNITS(16);
+ boss->hit.front = 24 * 0x200;
+ boss->hit.top = 16 * 0x200;
+ boss->hit.back = 24 * 0x200;
+ boss->hit.bottom = 16 * 0x200;
boss->size = 3;
boss->bits = NPC_INVULNERABLE;
break;
@@ -169,18 +169,18 @@
switch (boss->act_no)
{
case BALFROG_INITIALIZE:
- boss->x = TILES_TO_UNITS(6);
- boss->y = TILES_TO_UNITS(12.5);
+ boss->x = 6 * (0x200 * 0x10);
+ boss->y = 12 * (0x200 * 0x10) + 8 * 0x200;
boss->direct = DIR_RIGHT;
- boss->view.front = PIXELS_TO_UNITS(48);
- boss->view.top = PIXELS_TO_UNITS(48);
- boss->view.back = PIXELS_TO_UNITS(32);
- boss->view.bottom = PIXELS_TO_UNITS(16);
+ boss->view.front = 48 * 0x200;
+ boss->view.top = 48 * 0x200;
+ boss->view.back = 32 * 0x200;
+ boss->view.bottom = 16 * 0x200;
boss->hit_voice = SND_BEHEMOTH_LARGE_HURT;
- boss->hit.front = PIXELS_TO_UNITS(24);
- boss->hit.top = PIXELS_TO_UNITS(16);
- boss->hit.back = PIXELS_TO_UNITS(24);
- boss->hit.bottom = PIXELS_TO_UNITS(16);
+ boss->hit.front = 24 * 0x200;
+ boss->hit.top = 16 * 0x200;
+ boss->hit.back = 24 * 0x200;
+ boss->hit.bottom = 16 * 0x200;
boss->size = 3;
boss->exp = 1;
boss->code_event = 1000;
@@ -202,7 +202,7 @@
gBoss[2].damage = 5;
for (i = 0; i < 8; ++i)
- SetNpChar(NPC_SMOKE, boss->x + PIXELS_TO_UNITS(Random(-12, 12)), boss->y + PIXELS_TO_UNITS(Random(-12, 12)), Random(-341, 341), Random(PIXELS_TO_UNITS(-3), 0), DIR_LEFT, NULL, 0x100);
+ SetNpChar(NPC_SMOKE, boss->x + Random(-12, 12) * 0x200, boss->y + Random(-12, 12) * 0x200, Random(-341, 341), Random(-3 * 0x200, 0), DIR_LEFT, NULL, 0x100);
break;
@@ -257,16 +257,16 @@
{
boss->act_no = BALFROG_MIDAIR;
boss->ani_no = BALFROG_SPRITE_JUMPING;
- boss->ym = PIXELS_TO_UNITS(-2);
- PlaySoundObject(25, 1);
+ boss->ym = -2 * 0x200;
+ PlaySoundObject(25, SOUND_MODE_PLAY);
if (boss->direct == DIR_LEFT)
- boss->xm = PIXELS_TO_UNITS(-1);
+ boss->xm = -1 * 0x200;
else
- boss->xm = PIXELS_TO_UNITS(1);
+ boss->xm = 1 * 0x200;
- boss->view.top = PIXELS_TO_UNITS(64);
- boss->view.bottom = PIXELS_TO_UNITS(24);
+ boss->view.top = 64 * 0x200;
+ boss->view.bottom = 24 * 0x200;
}
break;
@@ -275,23 +275,23 @@
if (boss->direct == DIR_LEFT && boss->flag & COLL_LEFT_WALL)
{
boss->direct = DIR_RIGHT;
- boss->xm = PIXELS_TO_UNITS(1);
+ boss->xm = 1 * 0x200;
}
if (boss->direct == DIR_RIGHT && boss->flag & COLL_RIGHT_WALL)
{
boss->direct = DIR_LEFT;
- boss->xm = PIXELS_TO_UNITS(-1);
+ boss->xm = -1 * 0x200;
}
if (boss->flag & COLL_GROUND)
{
- PlaySoundObject(SND_LARGE_OBJECT_HIT_GROUND, 1);
+ PlaySoundObject(SND_LARGE_OBJECT_HIT_GROUND, SOUND_MODE_PLAY);
SetQuake(30);
boss->act_no = BALFROG_WAIT;
boss->ani_no = BALFROG_SPRITE_STANDING_STILL;
- boss->view.top = PIXELS_TO_UNITS(48);
- boss->view.bottom = PIXELS_TO_UNITS(16);
+ boss->view.top = 48 * 0x200;
+ boss->view.bottom = 16 * 0x200;
if (boss->direct == DIR_LEFT && boss->x < gMC.x)
{
@@ -305,10 +305,10 @@
boss->act_no = BALFROG_INITIALIZE_LAND;
}
- SetNpChar(110, TILES_TO_UNITS(Random(4, 16)), TILES_TO_UNITS(Random(0, 4)), 0, 0, DIR_AUTO, NULL, 0x80);
+ SetNpChar(110, Random(4, 16) * (0x200 * 0x10), Random(0, 4) * (0x200 * 0x10), 0, 0, DIR_AUTO, NULL, 0x80);
for (i = 0; i < 4; ++i)
- SetNpChar(NPC_SMOKE, boss->x + PIXELS_TO_UNITS(Random(-12, 12)), boss->y + boss->hit.bottom, Random(-341, 341), Random(PIXELS_TO_UNITS(-3), 0), DIR_LEFT, NULL, 0x100);
+ SetNpChar(NPC_SMOKE, boss->x + Random(-12, 12) * 0x200, boss->y + boss->hit.bottom, Random(-341, 341), Random(-3 * 0x200, 0), DIR_LEFT, NULL, 0x100);
}
break;
@@ -371,9 +371,9 @@
--boss->count1;
if (boss->direct == DIR_LEFT)
- deg = GetArktan(boss->x - TILES_TO_UNITS(2) - gMC.x, boss->y - PIXELS_TO_UNITS(8) - gMC.y);
+ deg = GetArktan(boss->x - 2 * (0x200 * 0x10) - gMC.x, boss->y - 8 * 0x200 - gMC.y);
else
- deg = GetArktan(boss->x + TILES_TO_UNITS(2) - gMC.x, boss->y - PIXELS_TO_UNITS(8) - gMC.y);
+ deg = GetArktan(boss->x + 2 * (0x200 * 0x10) - gMC.x, boss->y - 8 * 0x200 - gMC.y);
deg += (unsigned char)Random(-0x10, 0x10);
@@ -381,11 +381,11 @@
xm = GetCos(deg);
if (boss->direct == DIR_LEFT)
- SetNpChar(NPC_PROJECTILE_BALFROG_SPITBALL, boss->x - TILES_TO_UNITS(2), boss->y - PIXELS_TO_UNITS(8), xm, ym, DIR_LEFT, NULL, 0x100);
+ SetNpChar(NPC_PROJECTILE_BALFROG_SPITBALL, boss->x - 2 * (0x200 * 0x10), boss->y - 8 * 0x200, xm, ym, DIR_LEFT, NULL, 0x100);
else
- SetNpChar(NPC_PROJECTILE_BALFROG_SPITBALL, boss->x + TILES_TO_UNITS(2), boss->y - PIXELS_TO_UNITS(8), xm, ym, DIR_LEFT, NULL, 0x100);
+ SetNpChar(NPC_PROJECTILE_BALFROG_SPITBALL, boss->x + 2 * (0x200 * 0x10), boss->y - 8 * 0x200, xm, ym, DIR_LEFT, NULL, 0x100);
- PlaySoundObject(SND_ENEMY_SHOOT_PROJETILE, 1);
+ PlaySoundObject(SND_ENEMY_SHOOT_PROJETILE, SOUND_MODE_PLAY);
if (boss->count1 == 0 || boss->life < boss->tgt_x - 90)
{
@@ -457,10 +457,10 @@
{
boss->act_no = BALFROG_LEAP_MIDAIR;
boss->ani_no = BALFROG_SPRITE_JUMPING;
- boss->ym = PIXELS_TO_UNITS(-5);
- boss->view.top = PIXELS_TO_UNITS(64);
- boss->view.bottom = PIXELS_TO_UNITS(24);
- PlaySoundObject(SND_SILLY_EXPLOSION, 1);
+ boss->ym = -5 * 0x200;
+ boss->view.top = 64 * 0x200;
+ boss->view.bottom = 24 * 0x200;
+ PlaySoundObject(SND_SILLY_EXPLOSION, SOUND_MODE_PLAY);
}
break;
@@ -468,21 +468,21 @@
case BALFROG_LEAP_MIDAIR:
if (boss->flag & COLL_GROUND)
{
- PlaySoundObject(SND_LARGE_OBJECT_HIT_GROUND, 1);
+ PlaySoundObject(SND_LARGE_OBJECT_HIT_GROUND, SOUND_MODE_PLAY);
SetQuake(60);
boss->act_no = BALFROG_WAIT;
boss->ani_no = BALFROG_SPRITE_STANDING_STILL;
- boss->view.top = PIXELS_TO_UNITS(48);
- boss->view.bottom = PIXELS_TO_UNITS(16);
+ boss->view.top = 48 * 0x200;
+ boss->view.bottom = 16 * 0x200;
for (i = 0; i < 2; ++i)
- SetNpChar(NPC_ENEMY_FROG, TILES_TO_UNITS(Random(4, 16)), TILES_TO_UNITS(Random(0, 4)), 0, 0, DIR_AUTO, NULL, 0x80);
+ SetNpChar(NPC_ENEMY_FROG, Random(4, 16) * (0x200 * 0x10), Random(0, 4) * (0x200 * 0x10), 0, 0, DIR_AUTO, NULL, 0x80);
for (i = 0; i < 6; ++i)
- SetNpChar(NPC_ENEMY_PUCHI, TILES_TO_UNITS(Random(4, 16)), TILES_TO_UNITS(Random(0, 4)), 0, 0, DIR_AUTO, NULL, 0x80);
+ SetNpChar(NPC_ENEMY_PUCHI, Random(4, 16) * (0x200 * 0x10), Random(0, 4) * (0x200 * 0x10), 0, 0, DIR_AUTO, NULL, 0x80);
for (i = 0; i < 8; ++i)
- SetNpChar(NPC_SMOKE, boss->x + PIXELS_TO_UNITS(Random(-12, 12)), boss->y + boss->hit.bottom, Random(-341, 341), Random(PIXELS_TO_UNITS(-3), 0), DIR_LEFT, NULL, 0x100);
+ SetNpChar(NPC_SMOKE, boss->x + Random(-12, 12) * 0x200, boss->y + boss->hit.bottom, Random(-341, 341), Random(-3 * 0x200, 0), DIR_LEFT, NULL, 0x100);
if (boss->direct == DIR_LEFT && boss->x < gMC.x)
{
@@ -504,10 +504,10 @@
boss->ani_no = BALFROG_SPRITE_MOUTH_OPEN_CROUCHING;
boss->act_wait = 0;
boss->xm = 0;
- PlaySoundObject(SND_EXPLOSION, 1);
+ PlaySoundObject(SND_EXPLOSION, SOUND_MODE_PLAY);
for (i = 0; i < 8; ++i)
- SetNpChar(NPC_SMOKE, boss->x + PIXELS_TO_UNITS(Random(-12, 12)), boss->y + PIXELS_TO_UNITS(Random(-12, 12)), Random(-341, 341), Random(PIXELS_TO_UNITS(-3), 0), DIR_LEFT, NULL, 0x100);
+ SetNpChar(NPC_SMOKE, boss->x + Random(-12, 12) * 0x200, boss->y + Random(-12, 12) * 0x200, Random(-341, 341), Random(-3 * 0x200, 0), DIR_LEFT, NULL, 0x100);
gBoss[1].cond = 0;
gBoss[2].cond = 0;
@@ -516,12 +516,12 @@
++boss->act_wait;
if (boss->act_wait % 5 == 0)
- SetNpChar(NPC_SMOKE, boss->x + PIXELS_TO_UNITS(Random(-12, 12)), boss->y + PIXELS_TO_UNITS(Random(-12, 12)), Random(-341, 341), Random(PIXELS_TO_UNITS(-3), 0), DIR_LEFT, NULL, 0x100);
+ SetNpChar(NPC_SMOKE, boss->x + Random(-12, 12) * 0x200, boss->y + Random(-12, 12) * 0x200, Random(-341, 341), Random(-3 * 0x200, 0), DIR_LEFT, NULL, 0x100);
if (boss->act_wait / 2 % 2)
- boss->x -= PIXELS_TO_UNITS(1);
+ boss->x -= 1 * 0x200;
else
- boss->x += PIXELS_TO_UNITS(1);
+ boss->x += 1 * 0x200;
if (boss->act_wait > 100)
{
@@ -536,28 +536,28 @@
if (boss->act_wait / 2 % 2)
{
- boss->view.front = PIXELS_TO_UNITS(20);
- boss->view.top = PIXELS_TO_UNITS(12);
- boss->view.back = PIXELS_TO_UNITS(20);
- boss->view.bottom = PIXELS_TO_UNITS(12);
+ boss->view.front = 20 * 0x200;
+ boss->view.top = 12 * 0x200;
+ boss->view.back = 20 * 0x200;
+ boss->view.bottom = 12 * 0x200;
boss->ani_no = BALFROG_SPRITE_BALROG_WHITE;
}
else
{
- boss->view.front = PIXELS_TO_UNITS(48);
- boss->view.top = PIXELS_TO_UNITS(48);
- boss->view.back = PIXELS_TO_UNITS(32);
- boss->view.bottom = PIXELS_TO_UNITS(16);
+ boss->view.front = 48 * 0x200;
+ boss->view.top = 48 * 0x200;
+ boss->view.back = 32 * 0x200;
+ boss->view.bottom = 16 * 0x200;
boss->ani_no = BALFROG_SPRITE_MOUTH_OPEN_CROUCHING;
}
if (boss->act_wait % 9 == 0)
- SetNpChar(NPC_SMOKE, boss->x + PIXELS_TO_UNITS(Random(-12, 12)), boss->y + PIXELS_TO_UNITS(Random(-12, 12)), Random(-341, 341), Random(PIXELS_TO_UNITS(-3), 0), DIR_LEFT, NULL, 0x100);
+ SetNpChar(NPC_SMOKE, boss->x + Random(-12, 12) * 0x200, boss->y + Random(-12, 12) * 0x200, Random(-341, 341), Random(-3 * 0x200, 0), DIR_LEFT, NULL, 0x100);
if (boss->act_wait > 150)
{
boss->act_no = BALFROG_NOP_START;
- boss->hit.bottom = PIXELS_TO_UNITS(12);
+ boss->hit.bottom = 12 * 0x200;
}
break;
@@ -581,7 +581,7 @@
if (boss->act_wait > 30)
{
boss->ani_no = BALFROG_SPRITE_BALROG_JUMPING;
- boss->ym = PIXELS_TO_UNITS(-5);
+ boss->ym = -5 * 0x200;
boss->bits |= NPC_IGNORE_SOLIDITY;
boss->act_no = BALFROG_GONE_INTO_CEILING;
}
@@ -589,12 +589,12 @@
break;
case BALFROG_GONE_INTO_CEILING:
- boss->ym = PIXELS_TO_UNITS(-5);
+ boss->ym = -5 * 0x200;
if (boss->y < 0)
{
boss->cond = 0;
- PlaySoundObject(SND_LARGE_OBJECT_HIT_GROUND, 1);
+ PlaySoundObject(SND_LARGE_OBJECT_HIT_GROUND, SOUND_MODE_PLAY);
SetQuake(30);
}
--- a/src/BossIronH.cpp
+++ b/src/BossIronH.cpp
@@ -139,7 +139,7 @@
if (npc->act_wait == 300 || npc->act_wait == 310 || npc->act_wait == 320)
{
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
SetNpChar(198, npc->x + (10 * 0x200), npc->y + (1 * 0x200), Random(-3, 0) * 0x200, Random(-3, 3) * 0x200, 2, NULL, 0x100);
}
}
--- a/src/BossOhm.cpp
+++ b/src/BossOhm.cpp
@@ -198,7 +198,7 @@
gBoss[0].y -= 1 * 0x200;
if (++gBoss[0].act_wait % 4 == 0)
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
if (gBoss[0].act_wait == 48)
{
@@ -231,7 +231,7 @@
gBoss[0].act_no = 50;
gBoss[0].count1 = 0;
gBoss[5].hit.top = 16 * 0x200;
- PlaySoundObject(102, 1);
+ PlaySoundObject(102, SOUND_MODE_PLAY);
}
break;
@@ -266,7 +266,7 @@
else
SetNpChar(48, gBoss[0].x, gBoss[0].y - (16 * 0x200), Random(-0x100, 0x100), -0x333, 2, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
}
if (gBoss[0].act_wait == 200 || CountArmsBullet(6))
@@ -273,7 +273,7 @@
{
gBoss[0].count1 = 0;
gBoss[0].act_no = 70;
- PlaySoundObject(102, 1);
+ PlaySoundObject(102, SOUND_MODE_PLAY);
}
break;
@@ -292,8 +292,8 @@
if (gBoss[0].count2 == 0)
{
- PlaySoundObject(102, 0);
- PlaySoundObject(12, 1);
+ PlaySoundObject(102, SOUND_MODE_STOP);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
gBoss[0].act_no = 80;
gBoss[0].act_wait = 0;
@@ -327,7 +327,7 @@
++gBoss[0].act_wait;
if (gBoss[0].act_wait % 4 == 0)
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
if (gBoss[0].act_wait == 48)
{
@@ -376,7 +376,7 @@
if (gBoss[0].act_wait == 50 || CountArmsBullet(6))
{
gBoss[0].act_no = 130;
- PlaySoundObject(102, 1);
+ PlaySoundObject(102, SOUND_MODE_PLAY);
gBoss[0].act_wait = 0;
gBoss[0].count1 = 0;
}
@@ -384,7 +384,7 @@
if (gBoss[0].act_wait < 30 && gBoss[0].act_wait % 5 == 0)
{
SetNpChar(48, gBoss[0].x, gBoss[0].y - (16 * 0x200), Random(-341, 341), -0x333, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
}
break;
@@ -411,9 +411,9 @@
gBoss[0].ym = -0x5FF;
- PlaySoundObject(102, 0);
- PlaySoundObject(12, 1);
- PlaySoundObject(25, 1);
+ PlaySoundObject(102, SOUND_MODE_STOP);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
if (gBoss[0].x < gMC.x)
gBoss[0].xm = 0x100;
@@ -448,8 +448,8 @@
gBoss[5].hit.top = 16 * 0x200;
gBoss[5].damage = 0;
- PlaySoundObject(26, 1);
- PlaySoundObject(12, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
SetQuake(30);
}
@@ -462,7 +462,7 @@
++gBoss[0].act_wait;
if (gBoss[0].act_wait % 12 == 0)
- PlaySoundObject(52, 1);
+ PlaySoundObject(52, SOUND_MODE_PLAY);
SetDestroyNpChar(gBoss[0].x + (Random(-0x30, 0x30) * 0x200), gBoss[0].y + (Random(-0x30, 0x18) * 0x200), 1, 1);
@@ -471,7 +471,7 @@
gBoss[0].act_wait = 0;
gBoss[0].act_no = 160;
SetFlash(gBoss[0].x, gBoss[0].y, 1);
- PlaySoundObject(35, 1);
+ PlaySoundObject(35, SOUND_MODE_PLAY);
}
break;
--- a/src/BossPress.cpp
+++ b/src/BossPress.cpp
@@ -85,7 +85,7 @@
npc->y = 413 * 0x200;
npc->ani_no = 0;
npc->act_no = 20;
- PlaySoundObject(44, 1);
+ PlaySoundObject(44, SOUND_MODE_PLAY);
for (i = 0; i < 5; ++i)
{
@@ -129,7 +129,7 @@
{
ChangeMapParts(i + 8, npc->count2, 0);
SetDestroyNpChar((i + 8) * 0x200 * 0x10, npc->count2 * 0x200 * 0x10, 0, 4);
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
}
}
@@ -160,7 +160,7 @@
case 501:
if (++npc->act_wait % 0x10 == 0)
{
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x + (Random(-40, 40) * 0x200), npc->y + (Random(-60, 60) * 0x200), 1, 1);
}
@@ -189,7 +189,7 @@
{
ChangeMapParts(i + 7, 14, 0);
SetDestroyNpChar((i + 7) * 0x200 * 0x10, 224 * 0x200, 0, 0);
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
}
}
--- a/src/BossTwinD.cpp
+++ b/src/BossTwinD.cpp
@@ -168,7 +168,7 @@
if (npc->count2 > 10)
{
- PlaySoundObject(51, 1);
+ PlaySoundObject(51, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x, npc->y, npc->view.back, 4);
npc->act_no = 300;
npc->act_wait = 0;
@@ -193,7 +193,7 @@
else
SetNpChar(202, npc->x + (8 * 0x200), npc->y, xm, ym, 0, NULL, 0x100);
- PlaySoundObject(33, 1);
+ PlaySoundObject(33, SOUND_MODE_PLAY);
}
if (npc->act_wait > 50)
@@ -242,7 +242,7 @@
else
SetNpChar(202, npc->x + (8 * 0x200), npc->y, xm, ym, 0, NULL, 0x100);
- PlaySoundObject(33, 1);
+ PlaySoundObject(33, SOUND_MODE_PLAY);
}
break;
@@ -518,7 +518,7 @@
npc->act_no = 1020;
npc->act_wait = 0;
SetFlash(gBoss[0].x, gBoss[0].y, 1);
- PlaySoundObject(35, 1);
+ PlaySoundObject(35, SOUND_MODE_PLAY);
}
break;
--- a/src/BossX.cpp
+++ b/src/BossX.cpp
@@ -183,10 +183,10 @@
}
if ((npc->act_no == 101 || npc->act_no == 201 || npc->act_no == 301 || npc->act_no == 401) && npc->act_wait % 2 == 1)
- PlaySoundObject(112, 1);
+ PlaySoundObject(112, SOUND_MODE_PLAY);
if ((npc->act_no == 103 || npc->act_no == 203) && npc->act_wait % 4 == 1)
- PlaySoundObject(111, 1);
+ PlaySoundObject(111, SOUND_MODE_PLAY);
if (npc->act_no >= 100 && gMC.y < npc->y + (4 * 0x200) && gMC.y > npc->y - (4 * 0x200))
{
@@ -262,7 +262,7 @@
}
SetNpChar(158, npc->x + x, npc->y + y, 0, 0, direct, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
npc->act_wait = 120;
break;
@@ -404,7 +404,7 @@
xm = GetCos(deg) * 3;
SetNpChar(156, npc->x, npc->y, xm, ym, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
npc->act_wait = 40;
break;
@@ -836,7 +836,7 @@
SetQuake(2);
if (++npc->act_wait % 8 == 0)
- PlaySoundObject(52, 1);
+ PlaySoundObject(52, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x + (Random(-72, 72) * 0x200), npc->y + (Random(-64, 64) * 0x200), 1, 1);
@@ -845,7 +845,7 @@
npc->act_wait = 0;
npc->act_no = 1001;
SetFlash(npc->x, npc->y, 1);
- PlaySoundObject(35, 1);
+ PlaySoundObject(35, SOUND_MODE_PLAY);
}
break;
--- a/src/BulHit.cpp
+++ b/src/BulHit.cpp
@@ -14,7 +14,7 @@
static void Vanish(BULLET *bul)
{
if (bul->code_bullet != 37 && bul->code_bullet != 38 && bul->code_bullet != 39)
- PlaySoundObject(28, 1);
+ PlaySoundObject(28, SOUND_MODE_PLAY);
else
SetCaret(bul->x, bul->y, 2, 1);
@@ -38,7 +38,7 @@
bul->cond = 0;
SetCaret(bul->x, bul->y, 2, 0);
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
for (i = 0; i < 4; ++i)
SetNpChar(4, x * 0x200 * 0x10, y * 0x200 * 0x10, Random(-0x200, 0x200), Random(-0x200, 0x200), 0, NULL, 0x100);
--- a/src/Bullet.cpp
+++ b/src/Bullet.cpp
@@ -537,7 +537,7 @@
{
bul->cond = 0;
SetCaret(bul->x, bul->y, 2, 0);
- PlaySoundObject(28, 1);
+ PlaySoundObject(28, SOUND_MODE_PLAY);
return;
}
@@ -601,7 +601,7 @@
bul->y += bul->ym;
if (bul->flag & 0xD)
- PlaySoundObject(34, 1);
+ PlaySoundObject(34, SOUND_MODE_PLAY);
}
RECT rect_left1[4] = {
@@ -989,7 +989,7 @@
break;
}
- PlaySoundObject(44, 1);
+ PlaySoundObject(44, SOUND_MODE_PLAY);
// Fallthrough
case 1:
switch (level)
@@ -1192,7 +1192,7 @@
{
bul->cond = 0;
SetCaret(bul->x, bul->y, 2, 0);
- PlaySoundObject(100, 1);
+ PlaySoundObject(100, SOUND_MODE_PLAY);
if (gMC.up)
SetBullet(22, bul->x, bul->y, 1);
@@ -1363,7 +1363,7 @@
bul->bbits &= ~4;
if (bul->count1 % 5 == 1)
- PlaySoundObject(34, 1);
+ PlaySoundObject(34, SOUND_MODE_PLAY);
if (bul->act_no == 0)
{
@@ -1433,7 +1433,7 @@
bul->bbits &= ~4;
if (bul->count1 % 7 == 1)
- PlaySoundObject(106, 1);
+ PlaySoundObject(106, SOUND_MODE_PLAY);
if (bul->act_no == 0)
{
@@ -1546,7 +1546,7 @@
if (++bul->act_wait % 4 == 1)
{
- PlaySoundObject(106, 1);
+ PlaySoundObject(106, SOUND_MODE_PLAY);
if (++bul->count1 % 2)
SetBullet(23, bul->x, bul->y, 0);
@@ -1573,7 +1573,7 @@
if (Random(-1, 1) == 0)
{
- PlaySoundObject(106, 1);
+ PlaySoundObject(106, SOUND_MODE_PLAY);
if (Random(0, 1) % 2)
SetBullet(23, bul->x + (Random(-0x40, 0x40) * 0x200), bul->y + (Random(-0x40, 0x40) * 0x200), 0);
@@ -1913,7 +1913,7 @@
break;
}
- PlaySoundObject(44, 1);
+ PlaySoundObject(44, SOUND_MODE_PLAY);
// Fallthrough
case 1:
switch (level)
--- a/src/Bullet.h
+++ b/src/Bullet.h
@@ -2,6 +2,8 @@
#include "WindowsWrapper.h"
+#include "CommonDefines.h"
+
#define BULLET_MAX 0x40
typedef struct BULLET
@@ -31,13 +33,7 @@
int enemyYL;
int blockXL;
int blockYL;
- struct
- {
- int front;
- int top;
- int back;
- int bottom;
- } view;
+ OTHER_RECT view;
} BULLET;
typedef struct BULLET_TABLE
@@ -50,13 +46,7 @@
int enemyYL;
int blockXL;
int blockYL;
- struct
- {
- int front;
- int top;
- int back;
- int bottom;
- } view;
+ OTHER_RECT view;
} BULLET_TABLE;
extern BULLET gBul[BULLET_MAX];
--- a/src/CommonDefines.h
+++ b/src/CommonDefines.h
@@ -3,13 +3,6 @@
#define WINDOW_WIDTH 320
#define WINDOW_HEIGHT 240
-#define TILES_TO_PIXELS(x) ((int)((x) * 0x10))
-#define PIXELS_TO_TILES(x) ((int)((x) / 0x10))
-#define PIXELS_TO_UNITS(x) ((int)((x) * 0x200))
-#define UNITS_TO_PIXELS(x) ((int)((x) / 0x200))
-#define TILES_TO_UNITS(x) ((int)((x) * (0x200 * 0x10)))
-#define UNITS_TO_TILES(x) ((int)((x) / (0x200 * 0x10)))
-
enum Collisions
{
COLL_LEFT_WALL = 1, // Touching a left wall
@@ -26,4 +19,12 @@
DIR_RIGHT = 2,
DIR_DOWN = 3,
DIR_AUTO = 4
+};
+
+struct OTHER_RECT // The original name for this struct is unknown
+{
+ int front;
+ int top;
+ int back;
+ int bottom;
};
--- a/src/Game.cpp
+++ b/src/Game.cpp
@@ -355,7 +355,7 @@
{
if (gKeyTrg & gKeyOk)
{
- PlaySoundObject(18, 1);
+ PlaySoundObject(18, SOUND_MODE_PLAY);
break;
}
}
@@ -375,7 +375,7 @@
// Move cursor
if (gKeyTrg & (gKeyUp | gKeyDown))
{
- PlaySoundObject(1, 1);
+ PlaySoundObject(1, SOUND_MODE_PLAY);
if (bContinue)
bContinue = FALSE;
@@ -698,7 +698,7 @@
return FALSE;
}
- PlaySoundObject(7, -1);
+ PlaySoundObject(7, SOUND_MODE_PLAY_LOOP);
std::string path = gDataPath + "/npc.tbl";
@@ -729,7 +729,7 @@
mode = ModeAction();
}
- PlaySoundObject(7, 0);
+ PlaySoundObject(7, SOUND_MODE_STOP);
EndMapData();
EndTextScript();
--- a/src/Generic.cpp
+++ b/src/Generic.cpp
@@ -74,14 +74,17 @@
BOOL IsKeyFile(const char *name)
{
- std::string path = gModulePath + '/' + name;
+ std::string path;
+ FILE *fp;
- FILE *file = fopen(path.c_str(), "rb");
+ path = gModulePath + '/' + name;
- if (file == NULL)
+ fp = fopen(path.c_str(), "rb");
+
+ if (fp == NULL)
return FALSE;
- fclose(file);
+ fclose(fp);
return TRUE;
}
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -363,7 +363,7 @@
SleepNoise();
}
- PlaySoundObject(7, 0);
+ PlaySoundObject(7, SOUND_MODE_STOP);
}
void ActiveWindow(void)
@@ -376,7 +376,7 @@
ResetNoise();
}
- PlaySoundObject(7, -1);
+ PlaySoundObject(7, SOUND_MODE_PLAY_LOOP);
}
void JoystickProc(void);
--- a/src/MyChar.cpp
+++ b/src/MyChar.cpp
@@ -91,7 +91,7 @@
gMC.ani_wait = 0;
if (++gMC.ani_no == 7 || gMC.ani_no == 9)
- PlaySoundObject(24, 1);
+ PlaySoundObject(24, SOUND_MODE_PLAY);
}
if (gMC.ani_no > 9 || gMC.ani_no < 6)
@@ -106,7 +106,7 @@
gMC.ani_wait = 0;
if (++gMC.ani_no == 2 || gMC.ani_no == 4)
- PlaySoundObject(24, 1);
+ PlaySoundObject(24, SOUND_MODE_PLAY);
}
if (gMC.ani_no > 4 || gMC.ani_no < 1)
@@ -115,7 +115,7 @@
else if (gKey & gKeyUp && bKey)
{
if (gMC.cond & 4)
- PlaySoundObject(24, 1);
+ PlaySoundObject(24, SOUND_MODE_PLAY);
gMC.cond &= ~4;
gMC.ani_no = 5;
@@ -123,7 +123,7 @@
else
{
if (gMC.cond & 4)
- PlaySoundObject(24, 1);
+ PlaySoundObject(24, SOUND_MODE_PLAY);
gMC.cond &= ~4;
gMC.ani_no = 0;
@@ -452,7 +452,7 @@
else
{
gMC.ym = -jump;
- PlaySoundObject(15, 1);
+ PlaySoundObject(15, SOUND_MODE_PLAY);
}
}
}
@@ -498,7 +498,7 @@
if (gMC.direct == 2)
SetCaret(gMC.x - (2 * 0x200), gMC.y + (2 * 0x200), 7, 0);
- PlaySoundObject(113, 1);
+ PlaySoundObject(113, SOUND_MODE_PLAY);
}
}
else if (gMC.boost_sw == 2)
@@ -510,7 +510,7 @@
if (gKeyTrg & gKeyJump || gMC.boost_cnt % 3 == 1)
{
SetCaret(gMC.x, gMC.y + (6 * 0x200), 7, 3);
- PlaySoundObject(113, 1);
+ PlaySoundObject(113, SOUND_MODE_PLAY);
}
}
else if (gMC.boost_sw == 3 && (gKeyTrg & gKeyJump || gMC.boost_cnt % 3 == 1))
@@ -517,7 +517,7 @@
{
// Boost particles (and sound)
SetCaret(gMC.x, gMC.y - (6 * 0x200), 7, 1);
- PlaySoundObject(113, 1);
+ PlaySoundObject(113, SOUND_MODE_PLAY);
}
}
// Upwards wind/current
@@ -534,7 +534,7 @@
if (gMC.boost_cnt % 3 == 0)
{
SetCaret(gMC.x, gMC.y + (gMC.hit.bottom / 2), 7, 3);
- PlaySoundObject(113, 1);
+ PlaySoundObject(113, SOUND_MODE_PLAY);
}
// Bounce off of ceiling
@@ -616,7 +616,7 @@
SetNpChar(73, x, gMC.y, gMC.xm + Random(-0x200, 0x200), Random(-0x200, 0x80) - (gMC.ym / 2), dir, NULL, 0);
}
- PlaySoundObject(56, 1);
+ PlaySoundObject(56, SOUND_MODE_PLAY);
}
else
{
@@ -628,7 +628,7 @@
SetNpChar(73, x, gMC.y, gMC.xm + Random(-0x200, 0x200), Random(-0x200, 0x80), dir, NULL, 0);
}
- PlaySoundObject(56, 1);
+ PlaySoundObject(56, SOUND_MODE_PLAY);
}
}
@@ -1000,12 +1000,12 @@
case 1:
ChangeSoundFrequency(40, noise_freq);
ChangeSoundFrequency(41, noise_freq + 100);
- PlaySoundObject(40, -1);
- PlaySoundObject(41, -1);
+ PlaySoundObject(40, SOUND_MODE_PLAY_LOOP);
+ PlaySoundObject(41, SOUND_MODE_PLAY_LOOP);
break;
case 2:
- PlaySoundObject(58, -1);
+ PlaySoundObject(58, SOUND_MODE_PLAY_LOOP);
break;
}
}
@@ -1013,9 +1013,9 @@
void CutNoise(void)
{
noise_no = 0;
- PlaySoundObject(40, 0);
- PlaySoundObject(41, 0);
- PlaySoundObject(58, 0);
+ PlaySoundObject(40, SOUND_MODE_STOP);
+ PlaySoundObject(41, SOUND_MODE_STOP);
+ PlaySoundObject(58, SOUND_MODE_STOP);
}
void ResetNoise(void)
@@ -1025,12 +1025,12 @@
case 1:
ChangeSoundFrequency(40, noise_freq);
ChangeSoundFrequency(41, noise_freq + 100);
- PlaySoundObject(40, -1);
- PlaySoundObject(41, -1);
+ PlaySoundObject(40, SOUND_MODE_PLAY_LOOP);
+ PlaySoundObject(41, SOUND_MODE_PLAY_LOOP);
break;
case 2:
- PlaySoundObject(58, -1);
+ PlaySoundObject(58, SOUND_MODE_PLAY_LOOP);
break;
}
}
@@ -1037,7 +1037,7 @@
void SleepNoise(void)
{
- PlaySoundObject(40, 0);
- PlaySoundObject(41, 0);
- PlaySoundObject(58, 0);
+ PlaySoundObject(40, SOUND_MODE_STOP);
+ PlaySoundObject(41, SOUND_MODE_STOP);
+ PlaySoundObject(58, SOUND_MODE_STOP);
}
--- a/src/MyChar.h
+++ b/src/MyChar.h
@@ -2,6 +2,8 @@
#include "WindowsWrapper.h"
+#include "CommonDefines.h"
+
// TODO - When I add bitmask constants for gMC.flags...
// 0x100 is a 'player is underwater' flag
@@ -38,20 +40,8 @@
int ym;
int ani_wait;
int ani_no;
- struct
- {
- int front;
- int top;
- int back;
- int bottom;
- } hit;
- struct
- {
- int front;
- int top;
- int back;
- int bottom;
- } view;
+ OTHER_RECT hit;
+ OTHER_RECT view;
RECT rect;
RECT rect_arms;
int level;
--- a/src/MycHit.cpp
+++ b/src/MycHit.cpp
@@ -23,7 +23,7 @@
{
if (!(gMC.cond & 2) && gMC.ym < -0x200)
{
- PlaySoundObject(3, 1);
+ PlaySoundObject(3, SOUND_MODE_PLAY);
SetCaret(gMC.x, gMC.y - gMC.hit.top, 13, 0);
SetCaret(gMC.x, gMC.y - gMC.hit.top, 13, 0);
}
@@ -101,7 +101,7 @@
// Halt momentum
if (gMC.ym > 0x400)
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
if (gMC.ym > 0)
gMC.ym = 0;
@@ -228,7 +228,7 @@
// Halt momentum
if (gMC.ym > 0x400)
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
if (gMC.ym > 0)
gMC.ym = 0;
@@ -255,7 +255,7 @@
// Halt momentum
if (gMC.ym > 0x400)
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
if (gMC.ym > 0)
gMC.ym = 0;
@@ -282,7 +282,7 @@
// Halt momentum
if (gMC.ym > 0x400)
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
if (gMC.ym > 0)
gMC.ym = 0;
@@ -309,7 +309,7 @@
// Halt momentum
if (gMC.ym > 0x400)
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
if (gMC.ym > 0)
gMC.ym = 0;
@@ -715,7 +715,7 @@
if (gMC.y + gMC.hit.bottom > npc->y - npc->hit.top && gMC.hit.bottom + gMC.y < npc->y + (3 * 0x200))
{
if (gMC.ym - npc->ym > 2 * 0x200)
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
if (gMC.unit == 1)
{
@@ -799,7 +799,7 @@
// Special NPCs (pickups)
if (hit != 0 && gNPC[i].code_char == 1)
{
- PlaySoundObject(14, 1);
+ PlaySoundObject(14, SOUND_MODE_PLAY);
AddExpMyChar(gNPC[i].exp);
gNPC[i].cond = 0;
}
@@ -806,7 +806,7 @@
if (hit != 0 && gNPC[i].code_char == 86)
{
- PlaySoundObject(42, 1);
+ PlaySoundObject(42, SOUND_MODE_PLAY);
AddBulletMyChar(gNPC[i].code_event, gNPC[i].exp);
gNPC[i].cond = 0;
}
@@ -813,7 +813,7 @@
if (hit != 0 && gNPC[i].code_char == 87)
{
- PlaySoundObject(20, 1);
+ PlaySoundObject(20, SOUND_MODE_PLAY);
AddLifeMyChar(gNPC[i].exp);
gNPC[i].cond = 0;
}
--- a/src/MycParam.cpp
+++ b/src/MycParam.cpp
@@ -68,7 +68,7 @@
if (gArmsData[gSelectedArms].code != 13)
{
- PlaySoundObject(27, 1);
+ PlaySoundObject(27, SOUND_MODE_PLAY);
SetCaret(gMC.x, gMC.y, 10, 0);
}
}
@@ -121,7 +121,7 @@
return;
// Damage player
- PlaySoundObject(16, 1);
+ PlaySoundObject(16, SOUND_MODE_PLAY);
gMC.cond &= ~1;
gMC.shock = 128;
@@ -173,7 +173,7 @@
// Death
if (gMC.life <= 0)
{
- PlaySoundObject(17, 1);
+ PlaySoundObject(17, SOUND_MODE_PLAY);
gMC.cond = 0;
SetDestroyNpChar(gMC.x, gMC.y, 0x1400, 0x40);
StartTextScript(40);
--- a/src/NpChar.cpp
+++ b/src/NpChar.cpp
@@ -618,7 +618,7 @@
if (bSmoke)
{
- PlaySoundObject(gNPC[n].destroy_voice, 1);
+ PlaySoundObject(gNPC[n].destroy_voice, SOUND_MODE_PLAY);
switch (gNPC[n].size)
{
--- a/src/NpChar.h
+++ b/src/NpChar.h
@@ -2,6 +2,7 @@
#include "WindowsWrapper.h"
+#include "CommonDefines.h"
#include "Draw.h"
#define NPC_MAX 0x200
@@ -81,20 +82,8 @@
int count2;
int act_no;
int act_wait;
- struct
- {
- int front;
- int top;
- int back;
- int bottom;
- } hit;
- struct
- {
- int front;
- int top;
- int back;
- int bottom;
- } view;
+ OTHER_RECT hit;
+ OTHER_RECT view;
unsigned char shock;
int damage_view;
int damage;
--- a/src/NpcAct000.cpp
+++ b/src/NpcAct000.cpp
@@ -110,7 +110,7 @@
// Bounce off floor
if (npc->flag & 8)
{
- PlaySoundObject(45, 1);
+ PlaySoundObject(45, SOUND_MODE_PLAY);
npc->ym = -0x280;
npc->xm = 2 * npc->xm / 3;
}
@@ -118,7 +118,7 @@
// Play bounce song (and try to clip out of floor if stuck)
if (npc->flag & 0xD)
{
- PlaySoundObject(45, 1);
+ PlaySoundObject(45, SOUND_MODE_PLAY);
if (++npc->count2 > 2)
npc->y -= 1 * 0x200;
}
@@ -309,7 +309,7 @@
npc->ani_no = 5;
// These three lines are missing in the Linux port, because it's based on v1.0.0.4:
// https://www.cavestory.org/forums/threads/version-1-0-0-5-really-different-than-1-0-0-6.102/#post-3231
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetNpChar(4, npc->x, npc->y + (3 * 0x200), 0, 0, 0, NULL, 0x100);
SetQuake(8);
}
@@ -487,7 +487,7 @@
// Jump
npc->ym = -0x5FF;
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
// Jump in facing direction
if (npc->direct == 0)
@@ -506,7 +506,7 @@
npc->act_wait = 0;
npc->ani_no = 0;
npc->act_no = 1;
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
break;
@@ -870,7 +870,7 @@
npc->act_no = 2;
npc->ani_no = 1;
npc->act_wait = 0;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(30);
}
@@ -947,7 +947,7 @@
xm = GetCos(deg);
SetNpChar(11, npc->x, npc->y + (4 * 0x200), xm, ym, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
if (npc->count1 == 0)
{
@@ -984,7 +984,7 @@
npc->act_no = 5;
npc->act_wait = 0;
npc->ani_no = 2;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(30);
npc->damage = 0;
}
@@ -1142,7 +1142,7 @@
if (npc->y < 0)
{
npc->code_char = 0;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(30);
}
@@ -1165,7 +1165,7 @@
for (i = 0; i < 4; ++i)
SetNpChar(4, npc->x + (Random(-12, 12) * 0x200), npc->y + (Random(-12, 12) * 0x200), Random(-341, 341), Random(-0x600, 0), 0, NULL, 0x100);
- PlaySoundObject(72, 1);
+ PlaySoundObject(72, SOUND_MODE_PLAY);
// Fallthrough
case 21:
npc->tgt_x = 1;
@@ -1260,7 +1260,7 @@
npc->ani_wait = 0;
if (++npc->ani_no == 10 || npc->ani_no == 11)
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
if (npc->ani_no > 12)
@@ -1276,7 +1276,7 @@
case 70:
npc->act_no = 71;
npc->act_wait = 64;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
npc->ani_no = 13;
// Fallthrough
case 71:
@@ -1331,7 +1331,7 @@
{
ChangeMapParts(x - 1, y, 0);
ChangeMapParts(x + 1, y, 0);
- PlaySoundObject(44, 1);
+ PlaySoundObject(44, SOUND_MODE_PLAY);
SetQuake2(10);
}
@@ -1704,8 +1704,8 @@
npc->act_no = 1;
npc->ani_no = 3;
npc->ym = -0x100;
- PlaySoundObject(12, 1);
- PlaySoundObject(26, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(30);
// Fallthrough
case 1:
@@ -1716,7 +1716,7 @@
npc->act_no = 2;
npc->ani_no = 2;
npc->act_wait = 0;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(30);
}
--- a/src/NpcAct020.cpp
+++ b/src/NpcAct020.cpp
@@ -171,7 +171,7 @@
npc->act_no = 3;
npc->ani_no = 2;
npc->ym = -0x5FF;
- PlaySoundObject(108, 1);
+ PlaySoundObject(108, SOUND_MODE_PLAY);
if (npc->x > gMC.x)
npc->direct = 0;
@@ -216,7 +216,7 @@
}
if (npc->act_wait % 4 == 1)
- PlaySoundObject(110, 1);
+ PlaySoundObject(110, SOUND_MODE_PLAY);
if (++npc->ani_wait > 0)
{
@@ -237,7 +237,7 @@
npc->act_wait = 0;
npc->ani_no = 0;
npc->act_no = 1;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(30);
}
@@ -604,7 +604,7 @@
npc->act_no = 3;
npc->ani_no = 2;
npc->ym = -0x4CC;
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
if (npc->x > gMC.x)
npc->direct = 0;
@@ -649,7 +649,7 @@
}
if (npc->act_wait % 4 == 1)
- PlaySoundObject(109, 1);
+ PlaySoundObject(109, SOUND_MODE_PLAY);
if (npc->flag & 8)
npc->ym = -0x200;
@@ -673,7 +673,7 @@
npc->act_wait = 0;
npc->ani_no = 0;
npc->act_no = 1;
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
break;
@@ -1022,7 +1022,7 @@
{
if (npc->act_no < 3 && npc->life < 90)
{
- PlaySoundObject(71, 1);
+ PlaySoundObject(71, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x, npc->y, npc->view.back, 8);
SetExpObjects(npc->x, npc->y, npc->exp);
npc->act_no = 3;
@@ -1128,7 +1128,7 @@
xm = GetCos(deg);
SetNpChar(11, npc->x, npc->y + 0x800, xm, ym, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
if (npc->count1 == 0)
{
@@ -1180,7 +1180,7 @@
if (npc->ani_no > 5)
{
npc->ani_no = 4;
- PlaySoundObject(47, 1);
+ PlaySoundObject(47, SOUND_MODE_PLAY);
}
if (++npc->act_wait > 100)
@@ -1212,8 +1212,8 @@
npc->act_no = 7;
npc->act_wait = 0;
npc->ani_no = 2;
- PlaySoundObject(26, 1);
- PlaySoundObject(25, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
SetQuake(30);
npc->damage = 0;
--- a/src/NpcAct040.cpp
+++ b/src/NpcAct040.cpp
@@ -207,7 +207,7 @@
break;
case 6:
- PlaySoundObject(50, 1);
+ PlaySoundObject(50, SOUND_MODE_PLAY);
npc->act_wait = 0;
npc->act_no = 7;
npc->ani_no = 7;
@@ -219,7 +219,7 @@
break;
case 8:
- PlaySoundObject(50, 1);
+ PlaySoundObject(50, SOUND_MODE_PLAY);
npc->act_wait = 0;
npc->act_no = 9;
npc->ani_no = 7;
@@ -572,7 +572,7 @@
SetNpChar(45, npc->x, npc->y, 0, 0, 0, NULL, 0x100);
SetDestroyNpChar(npc->x, npc->y, npc->view.back, 8);
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
npc->cond = 0;
}
@@ -720,7 +720,7 @@
{
npc->act_no = 2;
npc->act_wait = 0;
- PlaySoundObject(102, 1);
+ PlaySoundObject(102, SOUND_MODE_PLAY);
}
if (npc->x < gMC.x)
@@ -965,7 +965,7 @@
ym = GetSin(deg) * 2;
xm = GetCos(deg) * 2;
SetNpChar(50, npc->x, npc->y, xm, ym, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
}
if (npc->act_wait > 50)
@@ -1424,7 +1424,7 @@
{
VanishNpChar(npc);
SetDestroyNpChar(npc->x, npc->y, npc->view.back, 8);
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
}
break;
@@ -1923,7 +1923,7 @@
ym = GetSin(deg) * 2;
xm = GetCos(deg) * 2;
SetNpChar(84, npc->x, npc->y, xm, ym, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
}
if (npc->count2 > 8)
--- a/src/NpcAct060.cpp
+++ b/src/NpcAct060.cpp
@@ -153,7 +153,7 @@
npc->act_no = 11;
npc->ani_no = 6;
npc->ym = -0x400;
- PlaySoundObject(50, 1);
+ PlaySoundObject(50, SOUND_MODE_PLAY);
if (npc->direct == 0)
npc->xm = -0x100;
@@ -358,7 +358,7 @@
npc->ani_wait = 0;
npc->ym = -0x400;
npc->xm = 0x200;
- PlaySoundObject(71, 1);
+ PlaySoundObject(71, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x, npc->y, 0x800, 4);
}
@@ -368,7 +368,7 @@
npc->act_no = 42;
npc->act_wait = 0;
npc->ani_no = 8;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 42:
if (++npc->ani_no > 9)
@@ -704,7 +704,7 @@
// Jump
npc->ym = -0x5FF;
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
// Jump in facing direction
if (npc->direct == 0)
@@ -722,7 +722,7 @@
npc->act_wait = 0;
npc->ani_no = 0;
npc->act_no = 1;
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
break;
}
@@ -864,7 +864,7 @@
npc->act_no = 2;
npc->ani_no = 2;
gNPC[npc->count1].cond = 0;
- PlaySoundObject(21, 1);
+ PlaySoundObject(21, SOUND_MODE_PLAY);
}
break;
@@ -909,7 +909,7 @@
npc->tgt_x = npc->x;
npc->tgt_y = npc->y;
npc->ani_no = 0;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 1:
npc->x = npc->tgt_x + (Random(-1, 1) * 0x200);
@@ -948,7 +948,7 @@
if (npc->flag & 8)
{
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
npc->ym = 0;
npc->act_no = 14;
npc->bits |= NPC_IGNORE_SOLIDITY;
@@ -965,7 +965,7 @@
case 16:
if (++npc->act_wait == 30)
{
- PlaySoundObject(21, 1);
+ PlaySoundObject(21, SOUND_MODE_PLAY);
SetNpChar(66, npc->x, npc->y - (16 * 0x200), 0, 0, 0, npc, 0);
}
@@ -1000,7 +1000,7 @@
if (++npc->act_wait == 30)
{
- PlaySoundObject(101, 1);
+ PlaySoundObject(101, SOUND_MODE_PLAY);
SetFlash(0, 0, 2);
npc->act_no = 27;
npc->ani_no = 7;
@@ -1117,7 +1117,7 @@
npc->ani_wait = 0;
if (++npc->ani_no == 2 || npc->ani_no == 4)
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
if (npc->ani_no > 4)
@@ -1162,7 +1162,7 @@
npc->act_no = 9;
npc->ani_no = 8;
SetQuake(30);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
if (npc->act_wait >= 8 && npc->x - (12 * 0x200) < gMC.x && npc->x + (12 * 0x200) > gMC.x && npc->y - (12 * 0x200) < gMC.y && npc->y + (8 * 0x200) > gMC.y)
@@ -1220,7 +1220,7 @@
break;
case 20:
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
gMC.cond &= ~2;
if (npc->direct == 0)
--- a/src/NpcAct080.cpp
+++ b/src/NpcAct080.cpp
@@ -86,7 +86,7 @@
npc->act_wait = 0;
npc->act_no = 3;
npc->bits |= NPC_SHOOTABLE;
- PlaySoundObject(34, 1);
+ PlaySoundObject(34, SOUND_MODE_PLAY);
if (npc->direct == 0)
npc->xm = -0x400;
@@ -114,7 +114,7 @@
{
npc->act_wait = 0;
npc->act_no = 4;
- PlaySoundObject(106, 1);
+ PlaySoundObject(106, SOUND_MODE_PLAY);
}
npc->ani_no = 4;
@@ -353,7 +353,7 @@
case 16:
if (++npc->act_wait == 30)
{
- PlaySoundObject(21, 1);
+ PlaySoundObject(21, SOUND_MODE_PLAY);
SetNpChar(66, npc->x, npc->y - (16 * 0x200), 0, 0, 0, npc, 0);
}
@@ -388,7 +388,7 @@
if (++npc->act_wait == 30)
{
- PlaySoundObject(101, 1);
+ PlaySoundObject(101, SOUND_MODE_PLAY);
SetFlash(0, 0, 2);
npc->act_no = 27;
npc->ani_no = 7;
@@ -442,7 +442,7 @@
case 40:
case 50:
SetNpChar(11, npc->x + (8 * 0x200), npc->y - (8 * 0x200), 0x600, Random(-0x200, 0), 0, NULL, 0x100);
- PlaySoundObject(33, 1);
+ PlaySoundObject(33, SOUND_MODE_PLAY);
break;
}
@@ -600,7 +600,7 @@
npc->act_wait = 0;
npc->act_no = 6;
npc->ani_no = 7;
- PlaySoundObject(70, 1);
+ PlaySoundObject(70, SOUND_MODE_PLAY);
}
break;
@@ -691,7 +691,7 @@
if (npc->x - (8 * 0x200) < gMC.x && npc->x + (8 * 0x200) > gMC.x && npc->y - (16 * 0x200) < gMC.y && npc->y + (8 * 0x200) > gMC.y)
{
- PlaySoundObject(43, 1);
+ PlaySoundObject(43, SOUND_MODE_PLAY);
npc->act_no = 1;
}
@@ -1022,7 +1022,7 @@
npc->act_wait = 0;
npc->act_no = 6;
npc->ani_no = 7;
- PlaySoundObject(70, 1);
+ PlaySoundObject(70, SOUND_MODE_PLAY);
npc->damage = 5;
npc->hit.front = 24 * 0x200;
npc->hit.top = 1;
@@ -1047,7 +1047,7 @@
{
npc->act_no = 8;
npc->ani_no = 9;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(30);
npc->damage = 0;
@@ -1092,7 +1092,7 @@
xm = GetCos(deg) * 3;
SetNpChar(11, npc->x, npc->y + (4 * 0x200), xm, ym, 0, NULL, 0x100);
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
}
if (npc->act_wait > 50 && npc->act_wait / 2 % 2)
@@ -1145,7 +1145,7 @@
switch (npc->act_no)
{
case 0:
- PlaySoundObject(72, 1);
+ PlaySoundObject(72, SOUND_MODE_PLAY);
if (npc->x > gMC.x)
npc->direct = 0;
--- a/src/NpcAct100.cpp
+++ b/src/NpcAct100.cpp
@@ -132,7 +132,7 @@
npc->cond = 0;
if (npc->count1 % 4 == 1)
- PlaySoundObject(46, 1);
+ PlaySoundObject(46, SOUND_MODE_PLAY);
}
// Frog
@@ -279,7 +279,7 @@
npc->ym = -0x5FF;
if (!(gMC.cond & 2))
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
if (npc->direct == 0)
npc->xm = -0x200;
@@ -356,7 +356,7 @@
case 11:
if (++npc->ani_wait > 1)
{
- PlaySoundObject(43, 1);
+ PlaySoundObject(43, SOUND_MODE_PLAY);
npc->ani_wait = 0;
++npc->ani_no;
}
@@ -388,7 +388,7 @@
if (npc->act_wait / 2 % 2)
{
npc->x += 1 * 0x200;
- PlaySoundObject(11, 1);
+ PlaySoundObject(11, SOUND_MODE_PLAY);
}
else
{
@@ -404,7 +404,7 @@
npc->act_no = 17;
npc->act_wait = 0;
npc->ani_no = 2;
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
for (i = 0; i < 8; ++i)
SetNpChar(4, npc->x, npc->y, Random(-341, 341), Random(-0x600, 0), 0, NULL, 0x100);
@@ -431,7 +431,7 @@
if (npc->ani_no > 4)
{
- PlaySoundObject(11, 1);
+ PlaySoundObject(11, SOUND_MODE_PLAY);
npc->ani_no = 3;
}
@@ -438,7 +438,7 @@
if (++npc->act_wait > 100)
{
npc->act_no = 20;
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
for (i = 0; i < 4; ++i)
SetNpChar(4, npc->x, npc->y, Random(-341, 341), Random(-0x600, 0), 0, NULL, 0x100);
@@ -453,7 +453,7 @@
case 21:
npc->act_no = 22;
npc->ani_no = 5;
- PlaySoundObject(51, 1);
+ PlaySoundObject(51, SOUND_MODE_PLAY);
break;
case 100:
@@ -584,7 +584,7 @@
case 10:
npc->act_no = 0;
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
for (i = 0; i < 8; ++i)
SetNpChar(4, npc->x, npc->y, Random(-341, 341), Random(-0x600, 0), 0, NULL, 0x100);
@@ -747,7 +747,7 @@
npc->act_no = 10;
npc->ani_no = 2;
npc->ym = -0x2FF;
- PlaySoundObject(6, 1);
+ PlaySoundObject(6, SOUND_MODE_PLAY);
if (npc->direct == 0)
npc->xm = -0x100;
@@ -818,7 +818,7 @@
{
npc->act_no = 4;
npc->act_wait = 64;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
}
break;
@@ -878,7 +878,7 @@
npc->ani_wait = 0;
npc->x += 16 * 0x200;
npc->y += 8 * 0x200;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 1:
if (++npc->act_wait == 64)
@@ -1016,7 +1016,7 @@
npc->hit.bottom = 16 * 0x200;
npc->x -= 16 * 0x200;
npc->y += 8 * 0x200;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 31:
if (++npc->act_wait == 64)
@@ -1124,7 +1124,7 @@
for (i = 0; i < 4; ++i)
SetNpChar(4, npc->x, npc->y, Random(-341, 341), Random(-0x600, 0), 0, NULL, 0x100);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(10);
}
@@ -1232,13 +1232,13 @@
npc->ym = -0x400;
npc->xm *= 2;
npc->damage = 5;
- PlaySoundObject(102, 1);
+ PlaySoundObject(102, SOUND_MODE_PLAY);
}
else
{
npc->act_no = 21;
npc->ym = -0x400;
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
}
}
@@ -1247,7 +1247,7 @@
case 21:
if (npc->flag & 8)
{
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
npc->act_no = 20;
npc->ani_no = 1;
npc->ani_wait = 0;
@@ -1274,12 +1274,12 @@
npc->damage = 0;
npc->ym = -0x200;
npc->bits &= ~(NPC_SOLID_SOFT | NPC_SHOOTABLE);
- PlaySoundObject(51, 1);
+ PlaySoundObject(51, SOUND_MODE_PLAY);
// Fallthrough
case 51:
if (npc->flag & 8)
{
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
npc->act_no = 52;
npc->ani_no = 5;
npc->xm = 0;
@@ -1617,7 +1617,7 @@
npc->bits |= NPC_SHOOTABLE;
npc->act_no = 20;
npc->act_wait = 0;
- PlaySoundObject(103, 1);
+ PlaySoundObject(103, SOUND_MODE_PLAY);
}
break;
--- a/src/NpcAct120.cpp
+++ b/src/NpcAct120.cpp
@@ -286,7 +286,7 @@
case 0:
npc->act_no = 1;
SetCaret(npc->x, npc->y, 3, 0);
- PlaySoundObject(32, 1);
+ PlaySoundObject(32, SOUND_MODE_PLAY);
switch (npc->direct)
{
@@ -346,7 +346,7 @@
if (bBreak)
{
SetCaret(npc->x, npc->y, 2, 2);
- PlaySoundObject(28, 1);
+ PlaySoundObject(28, SOUND_MODE_PLAY);
npc->cond = 0;
}
@@ -399,7 +399,7 @@
break;
}
if (++npc->act_wait % 8 == 0)
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(20);
break;
@@ -414,7 +414,7 @@
if (npc->life < 990)
{
SetDestroyNpChar(npc->x, npc->y, npc->view.back, 8);
- PlaySoundObject(70, 1);
+ PlaySoundObject(70, SOUND_MODE_PLAY);
if (npc->direct == 0)
SetNpChar(87, npc->x, npc->y, 0, 0, 2, NULL, 0);
@@ -684,29 +684,29 @@
void ActNpc129(NPCHAR *npc)
{
RECT rect[18] = {
- {0x80, 0x30, 0x90, 0x40},
- {0x90, 0x30, 0xA0, 0x40},
- {0xA0, 0x30, 0xB0, 0x40},
+ {128, 48, 144, 64},
+ {144, 48, 160, 64},
+ {160, 48, 176, 64},
- {0x80, 0x40, 0x90, 0x50},
- {0x90, 0x40, 0xA0, 0x50},
- {0xA0, 0x40, 0xB0, 0x50},
+ {128, 64, 144, 80},
+ {144, 64, 160, 80},
+ {160, 64, 176, 80},
- {0x80, 0x50, 0x90, 0x60},
- {0x90, 0x50, 0xA0, 0x60},
- {0xA0, 0x50, 0xB0, 0x60},
+ {128, 80, 144, 96},
+ {144, 80, 160, 96},
+ {160, 80, 176, 96},
- {0xB0, 0x30, 0xC0, 0x40},
- {0xC0, 0x30, 0xD0, 0x40},
- {0xD0, 0x30, 0xE0, 0x40},
+ {176, 48, 192, 64},
+ {192, 48, 208, 64},
+ {208, 48, 224, 64},
- {0xB0, 0x40, 0xC0, 0x50},
- {0xC0, 0x40, 0xD0, 0x50},
- {0xD0, 0x40, 0xE0, 0x50},
+ {176, 64, 192, 80},
+ {192, 64, 208, 80},
+ {208, 64, 224, 80},
- {0xB0, 0x50, 0xC0, 0x60},
- {0xC0, 0x50, 0xD0, 0x60},
- {0xD0, 0x50, 0xE0, 0x60},
+ {176, 80, 192, 96},
+ {192, 80, 208, 96},
+ {208, 80, 224, 96},
};
if (++npc->ani_wait > 1)
@@ -882,7 +882,7 @@
npc->ani_no = 2;
if (npc->ani_no == 4 && npc->ani_wait == 0)
- PlaySoundObject(105, 1);
+ PlaySoundObject(105, SOUND_MODE_PLAY);
}
else
{
@@ -951,7 +951,7 @@
}
if (npc->ani_no == 4 && npc->ani_wait == 0)
- PlaySoundObject(105, 1);
+ PlaySoundObject(105, SOUND_MODE_PLAY);
break;
@@ -1182,7 +1182,7 @@
ym = GetSin(deg) * 2;
xm = GetCos(deg) * 2;
SetNpChar(50, npc->x, npc->y, xm, ym, 0, NULL, 0x180);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
}
if (npc->flag & 8)
@@ -1324,7 +1324,7 @@
// Fallthrough
case 11:
if (++npc->act_wait % 8 == 0)
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
if (npc->direct == 0)
{
@@ -1428,7 +1428,7 @@
npc->xm = 0;
npc->ym = 0;
npc->act_wait = (npc->rect.bottom - npc->rect.top) * 2;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 31:
--npc->act_wait;
@@ -1444,7 +1444,7 @@
npc->act_wait = 0;
npc->xm = 0;
npc->ym = 0;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 41:
npc->ani_no = 2;
--- a/src/NpcAct140.cpp
+++ b/src/NpcAct140.cpp
@@ -196,7 +196,7 @@
npc->act_no = 26;
npc->act_wait = 0;
npc->ani_no = 2;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(20);
}
@@ -260,7 +260,7 @@
npc->act_no = 102;
npc->act_wait = 0;
npc->ani_no = 2;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(20);
}
@@ -327,7 +327,7 @@
npc->act_no = 141;
npc->act_wait = 0;
npc->ani_no = 12;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 141:
if (++npc->ani_no > 13)
@@ -403,7 +403,7 @@
npc->ym = GetSin(deg) * 4;
npc->xm = GetCos(deg) * 4;
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
}
break;
@@ -414,7 +414,7 @@
npc->act_no = 20;
npc->act_wait = 0;
SetCaret(npc->x, npc->y, 2, 0);
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
for (i = 0; i < 4; ++i)
SetNpChar(4, npc->x, npc->y, Random(-0x200, 0x200), Random(-0x200, 0x200), 0, NULL, 0x100);
@@ -514,7 +514,7 @@
npc->act_no = 21;
npc->act_wait = 0;
npc->xm = 0;
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
break;
@@ -585,7 +585,7 @@
npc->ani_no = 0;
npc->ani_wait = 0;
npc->tgt_x = npc->x;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 1:
if (++npc->act_wait == 64)
@@ -611,7 +611,7 @@
npc->act_no = 4;
npc->act_wait = 0;
npc->ani_no = 4;
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
break;
@@ -734,7 +734,7 @@
if (++npc->act_wait > 10)
{
npc->act_no = 2;
- PlaySoundObject(101, 1);
+ PlaySoundObject(101, SOUND_MODE_PLAY);
}
break;
@@ -834,7 +834,7 @@
npc->act_no = 3;
npc->ani_no = 2;
npc->ym = -0x5FF;
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
if (npc->x > gMC.x)
npc->direct = 0;
@@ -873,7 +873,7 @@
}
if (npc->act_wait % 4 == 1)
- PlaySoundObject(109, 1);
+ PlaySoundObject(109, SOUND_MODE_PLAY);
if (npc->flag & 8)
npc->ym = -0x200;
@@ -886,7 +886,7 @@
xm = GetCos(deg) * 3;
SetNpChar(148, npc->x, npc->y, xm, ym, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
}
if (++npc->ani_wait > 0)
@@ -908,7 +908,7 @@
npc->act_wait = 0;
npc->ani_no = 0;
npc->act_no = 1;
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
break;
@@ -1012,7 +1012,7 @@
case 11:
if (++npc->act_wait % 10 == 6)
- PlaySoundObject(107, 1);
+ PlaySoundObject(107, SOUND_MODE_PLAY);
if (npc->flag & 1)
{
@@ -1020,7 +1020,7 @@
npc->direct = 2;
npc->act_no = 20;
SetQuake(10);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
for (i = 0; i < 4; ++i)
SetNpChar(4, npc->x - (16 * 0x200), npc->y + (Random(-12, 12) * 0x200), Random(-341, 341), Random(-0x600, 0), 0, NULL, 0x100);
@@ -1057,7 +1057,7 @@
case 21:
if (++npc->act_wait % 10 == 6)
- PlaySoundObject(107, 1);
+ PlaySoundObject(107, SOUND_MODE_PLAY);
if (npc->flag & 4)
{
@@ -1065,7 +1065,7 @@
npc->direct = 0;
npc->act_no = 10;
SetQuake(10);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
for (i = 0; i < 4; ++i)
SetNpChar(4, npc->x + (16 * 0x200), npc->y + (Random(-12, 12) * 0x200), Random(-341, 341), Random(-0x600, 0), 0, NULL, 0x100);
@@ -1153,7 +1153,7 @@
for (i = 0; i < 4; ++i)
SetNpChar(4, npc->x, npc->y, Random(-0x155, 0x155), Random(-0x600, 0), 0, NULL, 0x100);
- PlaySoundObject(71, 1);
+ PlaySoundObject(71, SOUND_MODE_PLAY);
// Fallthrough
case 11:
npc->ani_no = 2;
@@ -1162,7 +1162,7 @@
case 20:
npc->act_no = 21;
npc->act_wait = 64;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 21:
if (--npc->act_wait == 0)
@@ -1482,7 +1482,7 @@
npc->act_no = 20;
if (!(gMC.cond & 2))
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
}
else if (npc->direct == 2 && npc->flag & 4)
{
@@ -1491,7 +1491,7 @@
npc->act_no = 20;
if (!(gMC.cond & 2))
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
}
break;
@@ -1525,7 +1525,7 @@
npc->xm = 0;
if (!(gMC.cond & 2))
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
break;
@@ -1577,7 +1577,7 @@
else
npc->xm = -0x100;
- PlaySoundObject(53, 1);
+ PlaySoundObject(53, SOUND_MODE_PLAY);
break;
case 1:
@@ -1678,7 +1678,7 @@
SetNpChar(156, npc->x, npc->y, xm, ym, 0, NULL, 0x100);
if (!(gMC.cond & 2))
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
npc->act_no = 1;
npc->act_wait = Random(70, 150);
@@ -1795,7 +1795,7 @@
case 11:
if (++npc->act_wait % 10 == 6)
- PlaySoundObject(107, 1);
+ PlaySoundObject(107, SOUND_MODE_PLAY);
if (npc->flag & 2)
{
@@ -1803,7 +1803,7 @@
npc->direct = 2;
npc->act_no = 20;
SetQuake(10);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
for (i = 0; i < 4; ++i)
SetNpChar(4, npc->x + (Random(-12, 12) * 0x200), npc->y - (16 * 0x200), Random(-341, 341), Random(-0x600, 0), 0, NULL, 0x100);
@@ -1840,7 +1840,7 @@
case 21:
if (++npc->act_wait % 10 == 6)
- PlaySoundObject(107, 1);
+ PlaySoundObject(107, SOUND_MODE_PLAY);
if (npc->flag & 8)
{
@@ -1848,7 +1848,7 @@
npc->direct = 0;
npc->act_no = 10;
SetQuake(10);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
for (i = 0; i < 4; ++i)
SetNpChar(4, npc->x + (Random(-12, 12) * 0x200), npc->y + (16 * 0x200), Random(-341, 341), Random(-0x600, 0), 0, NULL, 0x100);
--- a/src/NpcAct160.cpp
+++ b/src/NpcAct160.cpp
@@ -59,8 +59,8 @@
npc->act_no = 3;
npc->act_wait = 0;
SetQuake(30);
- PlaySoundObject(26, 1);
- PlaySoundObject(72, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
+ PlaySoundObject(72, SOUND_MODE_PLAY);
}
if (npc->y < gMC.y && gMC.flag & 8)
@@ -246,7 +246,7 @@
{
case 0:
DeleteNpCharCode(161, TRUE);
- PlaySoundObject(72, 1);
+ PlaySoundObject(72, SOUND_MODE_PLAY);
for (i = 0; i < 10; ++i)
SetNpChar(4, npc->x + (Random(-12, 12) * 0x200), npc->y + (Random(-12, 12) * 0x200), Random(-0x600, 0x600), Random(-0x600, 0x600), 0, NULL, 0x100);
@@ -307,7 +307,7 @@
SetNpChar(161, npc->x + (Random(-12, 12) * 0x200), npc->y - (12 * 0x200), Random(-0x200, 0x200), 0x100, 0, NULL, 0x100);
if (npc->count1 % 4 == 2)
- PlaySoundObject(21, 1);
+ PlaySoundObject(21, SOUND_MODE_PLAY);
break;
@@ -519,7 +519,7 @@
npc->act_no = 21;
npc->act_wait = 0;
npc->ani_no = 0;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 21:
if (++npc->ani_no > 2)
@@ -569,7 +569,7 @@
npc->act_wait = 0;
npc->ym = -0x400;
npc->xm = 0x100;
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
// Fallthrough
case 21:
npc->ym += 0x10;
@@ -579,7 +579,7 @@
if (npc->act_wait && npc->flag & 8)
{
- PlaySoundObject(35, 1);
+ PlaySoundObject(35, SOUND_MODE_PLAY);
SetQuake(40);
npc->act_no = 0;
}
@@ -631,7 +631,7 @@
++npc->ani_no;
if (npc->ani_no == 2 || npc->ani_no == 4)
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
if (npc->ani_no > 4)
@@ -700,7 +700,7 @@
if (npc->act_wait < 30 && npc->act_wait % 6 == 1)
{
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
SetNpChar(170, npc->x, npc->y, 0, 0, npc->direct, NULL, 0x100);
}
@@ -709,7 +709,7 @@
npc->act_no = 9;
npc->ani_no = 8;
SetQuake(30);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
if (npc->act_wait >= 8 && npc->x - (12 * 0x200) < gMC.x && npc->x + (12 * 0x200) > gMC.x && npc->y - (12 * 0x200) < gMC.y && npc->y + (8 * 0x200) > gMC.y)
@@ -769,7 +769,7 @@
break;
case 20:
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
gMC.cond &= ~2;
if (npc->direct == 0)
@@ -870,7 +870,7 @@
if (bHit)
{
- PlaySoundObject(44, 1);
+ PlaySoundObject(44, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x, npc->y, 0, 3);
VanishNpChar(npc);
return;
@@ -1121,7 +1121,7 @@
{
if (++npc->count1 == 3)
{
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
npc->count1 = 0;
npc->act_no = 25;
npc->act_wait = 0;
@@ -1135,7 +1135,7 @@
}
else
{
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
npc->act_no = 20;
npc->ani_no = 2;
npc->ym = -0x200;
@@ -1154,7 +1154,7 @@
if (npc->flag & 8)
{
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
npc->ani_no = 1;
npc->act_no = 30;
npc->act_wait = 0;
@@ -1172,7 +1172,7 @@
SetNpChar(174, npc->x, npc->y, xm, ym, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
npc->ani_no = 3;
gCurlyShoot_wait = Random(80, 100);
@@ -1185,7 +1185,7 @@
if (npc->flag & 8)
{
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
npc->ani_no = 1;
npc->act_no = 30;
npc->act_wait = 0;
@@ -1279,7 +1279,7 @@
{
npc->act_no = 2;
++npc->count1;
- PlaySoundObject(31, 1);
+ PlaySoundObject(31, SOUND_MODE_PLAY);
}
break;
@@ -1445,7 +1445,7 @@
else
SetNpChar(177, npc->x, npc->y + (8 * 0x200), 0, 0, 2, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
npc->act_no = 0;
npc->ani_no = 0;
--- a/src/NpcAct180.cpp
+++ b/src/NpcAct180.cpp
@@ -197,7 +197,7 @@
npc->count1 = 0;
npc->ym = -0x600;
npc->ani_no = 1;
- PlaySoundObject(15, 1);
+ PlaySoundObject(15, SOUND_MODE_PLAY);
if (npc->x > npc->tgt_x)
npc->act_no = 210;
@@ -251,7 +251,7 @@
npc->ym = -0x600;
npc->act_no += 10;
npc->ani_no = 1;
- PlaySoundObject(15, 1);
+ PlaySoundObject(15, SOUND_MODE_PLAY);
}
}
else
@@ -613,7 +613,7 @@
}
if ((++npc->act_wait % 8) == 0)
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(20);
break;
@@ -991,7 +991,7 @@
break;
case 10:
- PlaySoundObject(72, 1);
+ PlaySoundObject(72, SOUND_MODE_PLAY);
for (i = 0; i < 8; ++i)
SetNpChar(4, npc->x, npc->y + (Random(-8, 8) * 0x200), Random(-8, -2) * 0x200, Random(-3, 3) * 0x200, 0, NULL, 0x100);
@@ -1144,7 +1144,7 @@
npc->xm = -0x800;
npc->x = npc->tgt_x;
npc->y = npc->tgt_y;
- PlaySoundObject(44, 1);
+ PlaySoundObject(44, SOUND_MODE_PLAY);
// Fallthrough
case 31:
npc->xm += 0x20;
@@ -1181,7 +1181,7 @@
if (npc->act_wait % 4 == 0 && npc->act_no >= 20)
{
- PlaySoundObject(34, 1);
+ PlaySoundObject(34, SOUND_MODE_PLAY);
if (npc->direct == 0)
SetCaret(npc->x + (10 * 0x200), npc->y + (10 * 0x200), 7, 2);
@@ -1375,7 +1375,7 @@
npc->cond = 0;
if (npc->count1 % 4 == 1)
- PlaySoundObject(46, 1);
+ PlaySoundObject(46, SOUND_MODE_PLAY);
}
// Water/wind particles
--- a/src/NpcAct200.cpp
+++ b/src/NpcAct200.cpp
@@ -39,7 +39,7 @@
if (npc->act_no < 100 && npc->life < 950)
{
- PlaySoundObject(72, 1);
+ PlaySoundObject(72, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x, npc->y, npc->view.back, 8);
SetExpObjects(npc->x, npc->y, npc->exp);
npc->act_no = 100;
@@ -117,7 +117,7 @@
SetNpChar(202, npc->x + (14 * 0x200), npc->y, xm, ym, 0, NULL, 0x100);
if (!(gMC.cond & 2))
- PlaySoundObject(33, 1);
+ PlaySoundObject(33, SOUND_MODE_PLAY);
}
if (npc->act_wait > 60)
@@ -256,7 +256,7 @@
npc->ym = -0x5FF;
if (!(gMC.cond & 2))
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
if (npc->direct == 0)
npc->xm = -0x100;
@@ -275,7 +275,7 @@
npc->act_no = 1;
if (!(gMC.cond & 2))
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
break;
@@ -334,7 +334,7 @@
if (npc->flag & 0xFF)
{
if (!(gMC.cond & 2))
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x, npc->y, npc->view.back, 4);
npc->cond = 0;
@@ -409,7 +409,7 @@
npc->act_wait = 0;
npc->ym = 0;
npc->damage = 0;
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x, npc->y, npc->view.back, 4);
SetBullet(24, npc->x, npc->y, 0);
return;
@@ -502,7 +502,7 @@
npc->hit.top = 100 * 0x200;
npc->hit.bottom = 100 * 0x200;
npc->damage = 30;
- PlaySoundObject(35, 1);
+ PlaySoundObject(35, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x, npc->y, 0x10000, 100);
SetQuake(20);
npc->cond |= 8;
@@ -563,7 +563,7 @@
case 0:
npc->act_no = 1;
npc->ani_no = npc->direct;
- PlaySoundObject(43, 1);
+ PlaySoundObject(43, SOUND_MODE_PLAY);
// Fallthrough
case 1:
npc->x += 1 * 0x200;
@@ -715,7 +715,7 @@
ym = GetSin(deg) * 3;
xm = GetCos(deg) * 3;
SetNpChar(209, npc->x, npc->y, xm, ym, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
}
if (npc->count2 > 16)
@@ -1100,7 +1100,7 @@
if (++npc->act_wait % 5 == 1)
{
SetNpChar(214, npc->x, npc->y, (Random(2, 12) * 0x200) / 4, Random(-0x200, 0x200), 0, NULL, 0x100);
- PlaySoundObject(21, 1);
+ PlaySoundObject(21, SOUND_MODE_PLAY);
}
if (npc->act_wait > 50)
@@ -1212,7 +1212,7 @@
if (npc->flag & 0xFF)
{
SetDestroyNpChar(npc->x, npc->y, npc->view.back, 4);
- PlaySoundObject(28, 1);
+ PlaySoundObject(28, SOUND_MODE_PLAY);
npc->cond = 0;
}
@@ -1249,7 +1249,7 @@
case 15:
if (++npc->act_wait > 10)
{
- PlaySoundObject(102, 1);
+ PlaySoundObject(102, SOUND_MODE_PLAY);
npc->act_no = 20;
}
--- a/src/NpcAct220.cpp
+++ b/src/NpcAct220.cpp
@@ -608,7 +608,7 @@
for (i = 0; i < 10; ++i)
{
SetNpChar(4, npc->x + (Random(-16, 16) * 0x200), npc->y + (Random(-8, 8) * 0x200), 0, 0, 0, NULL, 0x100);
- PlaySoundObject(12, 1); // Wait, it does this in a loop?
+ PlaySoundObject(12, SOUND_MODE_PLAY); // Wait, it does this in a loop?
}
// Fallthrough
case 13:
@@ -622,7 +622,7 @@
SetCaret(npc->x + (10 * 0x200), npc->y + (8 * 0x200), 7, 3);
if (npc->act_wait % 4 == 1)
- PlaySoundObject(34, 1);
+ PlaySoundObject(34, SOUND_MODE_PLAY);
if (npc->flag & 2 || gMC.flag & 2 || npc->act_wait > 450)
{
@@ -634,7 +634,7 @@
for (i = 0; i < 6; ++i)
{
SetNpChar(4, npc->x + (Random(-16, 16) * 0x200), npc->y + (Random(-8, 8) * 0x200), 0, 0, 0, NULL, 0x100);
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY); // Here it does it again...
}
}
@@ -653,7 +653,7 @@
SetCaret(npc->x + (10 * 0x200), npc->y + (8 * 0x200), 7, 3);
if (npc->act_wait % 16 == 1)
- PlaySoundObject(34, 1);
+ PlaySoundObject(34, SOUND_MODE_PLAY);
}
if (npc->flag & 8)
@@ -1088,7 +1088,7 @@
if (npc->act_wait % 10 == 3)
{
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
if (npc->direct == 0)
SetNpChar(237, npc->x - (8 * 0x200), npc->y - (8 * 0x200), -0x400, -0x400, 0, NULL, 0x100);
@@ -1155,7 +1155,7 @@
for (i = 0; i < 5; ++i)
SetCaret(npc->x, npc->y, 1, 0);
- PlaySoundObject(21, 1);
+ PlaySoundObject(21, SOUND_MODE_PLAY);
npc->cond = 0;
return;
}
@@ -1226,7 +1226,7 @@
for (i = 0; i < 4; ++i)
{
SetNpChar(4, npc->x + (Random(-16, 16) * 0x200), npc->y + (Random(-8, 8) * 0x200), 0, 0, 0, NULL, 0x100);
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
}
}
--- a/src/NpcAct240.cpp
+++ b/src/NpcAct240.cpp
@@ -179,7 +179,7 @@
npc->act_no = 3;
npc->ani_no = 2;
npc->ym = -0x5FF;
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
if (npc->direct == 0)
npc->xm = -0x200;
@@ -196,7 +196,7 @@
npc->act_wait = 0;
npc->ani_no = 0;
npc->act_no = 1;
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
break;
@@ -341,7 +341,7 @@
SetCaret(npc->x, npc->y + (4 * 0x200), 1, 2);
if (npc->x > gMC.x - (256 * 0x200) && npc->x < gMC.x + (256 * 0x200) && npc->y > gMC.y - (160 * 0x200) && npc->y < gMC.y + (160 * 0x200))
- PlaySoundObject(21, 1);
+ PlaySoundObject(21, SOUND_MODE_PLAY);
npc->cond = 0;
}
@@ -478,7 +478,7 @@
for (i = 0; i < 4; ++i)
SetNpChar(4, npc->x, npc->y, Random(-341, 341), Random(-0x600, 0), 0, NULL, 0x100);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(10);
}
@@ -659,7 +659,7 @@
xm = GetCos(deg) * 4;
SetNpChar(248, npc->x, npc->y + (4 * 0x200), xm, ym, 0, NULL, 0x100);
- PlaySoundObject(34, 1);
+ PlaySoundObject(34, SOUND_MODE_PLAY);
}
if (npc->act_wait > 30)
@@ -696,7 +696,7 @@
npc->tgt_x = Random(9, 31) * 0x200 * 0x10;
npc->tgt_y = Random(5, 7) * 0x200 * 0x10;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 151:
if (++npc->act_wait == 42)
@@ -757,7 +757,7 @@
if (++npc->act_wait % 24 == 0)
{
SetNpChar(250, npc->x, npc->y + (4 * 0x200), 0, 0, 0, NULL, 0x100);
- PlaySoundObject(34, 1);
+ PlaySoundObject(34, SOUND_MODE_PLAY);
}
if (npc->act_wait > 72)
@@ -946,7 +946,7 @@
if (++npc->act_wait > 10)
{
SetNpChar(251, npc->x, npc->y, 0, 0, 0, NULL, 0x100);
- PlaySoundObject(101, 1);
+ PlaySoundObject(101, SOUND_MODE_PLAY);
npc->cond = 0;
return;
}
@@ -1111,7 +1111,7 @@
{
SetExpObjects(npc->x, npc->y, npc->code_flag);
SetDestroyNpChar(npc->x, npc->y, npc->view.back, 8);
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
npc->cond = 0;
}
--- a/src/NpcAct260.cpp
+++ b/src/NpcAct260.cpp
@@ -268,7 +268,7 @@
if (npc->act_wait == 80)
{
npc->ani_no = 5;
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
if (npc->direct == 0)
{
@@ -314,7 +314,7 @@
npc->act_no = 32;
npc->act_wait = 0;
npc->ani_no = 7;
- PlaySoundObject(101, 1);
+ PlaySoundObject(101, SOUND_MODE_PLAY);
for (deg = 8; deg < 0x100; deg += 0x10)
{
@@ -337,7 +337,7 @@
npc->bits &= ~NPC_SHOOTABLE;
npc->damage = 0;
npc->act_wait = 0;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 101:
npc->act_wait += 2;
@@ -684,7 +684,7 @@
npc->ani_no = 6;
DamageMyChar(5);
SetQuake(10);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
gMC.ym = -0x400;
if (npc->x > gMC.x)
@@ -797,7 +797,7 @@
npc->act_no = 18;
npc->act_wait = 0;
SetQuake(10);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
// Fallthrough
case 18:
npc->ani_no = 3;
@@ -829,7 +829,7 @@
else
SetNpChar(269, npc->x + 0x1000, npc->y - 0x800, xm, ym, 2, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
}
if (npc->act_wait > 90)
@@ -853,7 +853,7 @@
npc->ani_no = 7;
npc->bits |= NPC_REAR_AND_TOP_DONT_HURT;
npc->damage = 10;
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
if (npc->direct == 0)
npc->xm = -0x5FF;
@@ -945,7 +945,7 @@
npc->act_wait = 0;
npc->bits &= ~(NPC_INVULNERABLE | NPC_SHOOTABLE);
npc->damage = 0;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 101:
npc->act_wait += 2;
@@ -1045,7 +1045,7 @@
SetQuake(2);
if (++npc->act_wait % 6 == 3)
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
if (npc->act_wait / 2 % 2)
npc->x = npc->tgt_x;
@@ -1250,7 +1250,7 @@
else
npc->xm = 0x200;
- PlaySoundObject(108, 1);
+ PlaySoundObject(108, SOUND_MODE_PLAY);
}
break;
@@ -1263,7 +1263,7 @@
npc->act_no = 40;
npc->act_wait = 0;
SetQuake(20);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
break;
@@ -1298,7 +1298,7 @@
ym = GetSin(deg) * 5;
xm = GetCos(deg) * 5;
SetNpChar(11, npc->x, npc->y + (4 * 0x200), xm, ym, 0, NULL, 0x100);
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
}
if (npc->act_wait < 50 && npc->act_wait / 2 % 2)
@@ -1594,7 +1594,7 @@
}
if (++npc->act_wait % 5 == 0)
- PlaySoundObject(110, 1);
+ PlaySoundObject(110, SOUND_MODE_PLAY);
if (++npc->ani_no > 2)
npc->ani_no = 0;
@@ -1694,7 +1694,7 @@
ym = GetSin(deg) * 4;
xm = GetCos(deg) * 4;
SetNpChar(273, npc->x, npc->y - (10 * 0x200), xm, ym, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
}
}
@@ -1872,7 +1872,7 @@
xm = GetCos(deg) * 4;
SetNpChar(277, npc->x, npc->y, xm, ym, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
break;
@@ -1921,7 +1921,7 @@
xm = GetCos(deg) * 4;
SetNpChar(277, npc->x, npc->y - (10 * 0x200), xm, ym, 0, NULL, 0x100);
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
break;
@@ -1940,7 +1940,7 @@
npc->act_wait = 0;
npc->ani_no = 2;
SetQuake(10);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
break;
@@ -1964,7 +1964,7 @@
SetQuake(10);
SetExpObjects(npc->x, npc->y, 19);
SetDestroyNpChar(npc->x, npc->y, npc->view.back, 8);
- PlaySoundObject(72, 1);
+ PlaySoundObject(72, SOUND_MODE_PLAY);
}
break;
@@ -2024,7 +2024,7 @@
}
if (++npc->act_wait % 5 == 0)
- PlaySoundObject(110, 1);
+ PlaySoundObject(110, SOUND_MODE_PLAY);
if (++npc->ani_no > 2)
npc->ani_no = 0;
@@ -2224,7 +2224,7 @@
npc->ym = -0x200;
npc->act_no = 110;
npc->bits |= NPC_IGNORE_SOLIDITY;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetQuake(10);
for (i = 0; i < 4; ++i)
--- a/src/NpcAct280.cpp
+++ b/src/NpcAct280.cpp
@@ -34,7 +34,7 @@
npc->ani_wait = 0;
npc->x += 6 * 0x200;
npc->tgt_x = npc->x;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 1:
if (++npc->act_wait == 64)
@@ -53,7 +53,7 @@
npc->act_no = 4;
npc->act_wait = 0;
npc->ani_no = 1;
- PlaySoundObject(23, 1);
+ PlaySoundObject(23, SOUND_MODE_PLAY);
}
break;
@@ -242,7 +242,7 @@
case 0:
npc->act_no = 1;
npc->y -= 8 * 0x200;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 1:
if (++npc->act_wait / 2 % 2)
@@ -353,7 +353,7 @@
else
npc->direct = 2;
- PlaySoundObject(103, 1);
+ PlaySoundObject(103, SOUND_MODE_PLAY);
if (gMC.y < 160 * 0x200)
npc->count2 = 290;
@@ -389,7 +389,7 @@
if (y > (gMap.length - 2) * 0x200 * 0x10)
y = (gMap.length - 2) * 0x200 * 0x10;
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
SetNpChar(npc->count2, x, y, 0, 0, 0, NULL, 0x100);
}
@@ -435,7 +435,7 @@
else
npc->direct = 2;
- PlaySoundObject(103, 1);
+ PlaySoundObject(103, SOUND_MODE_PLAY);
// Fallthrough
case 51:
if (++npc->act_wait / 2 % 2)
@@ -496,7 +496,7 @@
}
}
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
SetNpChar(301, x, y, 0, 0, direct, NULL, 0x100);
}
}
@@ -551,7 +551,7 @@
}
}
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
SetNpChar(301, x, y, 0, 0, direct, NULL, 0x100);
}
@@ -659,7 +659,7 @@
case 0:
npc->act_no = 1;
npc->y -= 4 * 0x200;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
npc->count2 = npc->life;
// Fallthrough
case 1:
@@ -860,7 +860,7 @@
npc->ani_no = 4;
if (npc->act_wait % 5 == 1)
- PlaySoundObject(109, 1);
+ PlaySoundObject(109, SOUND_MODE_PLAY);
break;
@@ -1118,7 +1118,7 @@
break;
case 2:
- PlaySoundObject(44, 1);
+ PlaySoundObject(44, SOUND_MODE_PLAY);
npc->act_no = 3;
npc->act_wait = 0;
npc->bits |= NPC_IGNORE_SOLIDITY;
@@ -1220,7 +1220,7 @@
else
npc->act_no = 10;
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
npc->ym = -0x600;
if (npc->direct == 0)
--- a/src/NpcAct300.cpp
+++ b/src/NpcAct300.cpp
@@ -704,7 +704,7 @@
npc->xm /= 2;
npc->ani_no = 2;
npc->act_no = 30;
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
}
break;
@@ -1141,7 +1141,7 @@
npc->ani_no = 3;
npc->xm = 2 * Random(-0x200, 0x200);
npc->ym = -0x800;
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
++npc->count1;
}
@@ -1209,7 +1209,7 @@
else
npc->xm = 0x5FF;
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
npc->bits &= ~NPC_SHOOTABLE;
npc->bits |= NPC_INVULNERABLE;
npc->damage = 10;
@@ -1232,7 +1232,7 @@
npc->act_no = 221;
npc->act_wait = 0;
SetQuake(16);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
npc->damage = 4;
// Fallthrough
case 221:
@@ -1289,7 +1289,7 @@
npc->act_no = 320;
npc->ani_no = 12;
npc->ym = -0x800;
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
npc->bits |= NPC_IGNORE_SOLIDITY;
npc->bits &= ~NPC_SHOOTABLE;
npc->bits |= NPC_INVULNERABLE;
@@ -1312,7 +1312,7 @@
npc->act_no = 331;
npc->act_wait = 0;
SetQuake(16);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
// Fallthrough
case 331:
if (++npc->ani_no > 13)
@@ -1411,7 +1411,7 @@
npc->ym = -0x200;
npc->act_no = 110;
npc->bits |= NPC_IGNORE_SOLIDITY;
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
SetQuake(10);
for (i = 0; i < 2; ++i)
@@ -1513,7 +1513,7 @@
npc->ani_no = 3;
npc->xm = 2 * Random(-0x200, 0x200);
npc->ym = -0x800;
- PlaySoundObject(30, 1);
+ PlaySoundObject(30, SOUND_MODE_PLAY);
}
break;
@@ -1626,7 +1626,7 @@
else
npc->xm = -0x100;
- PlaySoundObject(50, 1);
+ PlaySoundObject(50, SOUND_MODE_PLAY);
break;
@@ -1734,7 +1734,7 @@
npc->act_wait = 0;
npc->act_no = 12;
npc->ani_no = 3;
- PlaySoundObject(39, 1);
+ PlaySoundObject(39, SOUND_MODE_PLAY);
}
break;
@@ -1796,7 +1796,7 @@
else
npc->xm = -0x40;
- PlaySoundObject(54, 1);
+ PlaySoundObject(54, SOUND_MODE_PLAY);
break;
case 1:
@@ -1895,7 +1895,7 @@
if (npc->flag & 8)
{
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x, npc->y, 0, 3);
npc->cond = 0;
}
--- a/src/NpcAct320.cpp
+++ b/src/NpcAct320.cpp
@@ -168,7 +168,7 @@
{
SetBullet(43, npc->pNpc->x, npc->pNpc->y, direct);
SetCaret(npc->pNpc->x, npc->pNpc->y, 3, 0);
- PlaySoundObject(117, 1);
+ PlaySoundObject(117, SOUND_MODE_PLAY);
}
if (gMC.direct == 0)
@@ -192,7 +192,7 @@
npc->act_wait = 0;
npc->bits &= ~NPC_SHOOTABLE;
npc->bits |= NPC_INVULNERABLE;
- PlaySoundObject(22, 1);
+ PlaySoundObject(22, SOUND_MODE_PLAY);
}
switch (npc->act_no)
@@ -247,7 +247,7 @@
npc->hit.top = 48 * 0x200;
npc->hit.bottom = 48 * 0x200;
npc->damage = 12;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x, npc->y, 0x6000, 40);
SetQuake(10);
@@ -404,7 +404,7 @@
{
case 0:
npc->act_no = 1;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 1:
if (++npc->ani_wait > 0)
@@ -424,7 +424,7 @@
npc->damage = 10;
npc->view.front = 8 * 0x200;
npc->view.top = 12 * 0x200;
- PlaySoundObject(101, 1);
+ PlaySoundObject(101, SOUND_MODE_PLAY);
SetDestroyNpChar(npc->x, npc->y + (84 * 0x200), 0, 3);
}
@@ -812,7 +812,7 @@
switch (npc->act_no)
{
case 0:
- PlaySoundObject(44, 1);
+ PlaySoundObject(44, SOUND_MODE_PLAY);
npc->act_no = 1;
if (npc->direct == 0)
@@ -838,7 +838,7 @@
SetNpChar(331, npc->x, npc->y, xm, -0x400, 0, 0, 0x100);
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
}
break;
@@ -868,7 +868,7 @@
npc->act_no = 1;
npc->tgt_x = npc->x;
npc->tgt_y = npc->y;
- PlaySoundObject(103, 1);
+ PlaySoundObject(103, SOUND_MODE_PLAY);
npc->y = gMC.y;
// Fallthrough
case 1:
--- a/src/NpcAct340.cpp
+++ b/src/NpcAct340.cpp
@@ -152,7 +152,7 @@
else
npc->direct = 2;
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
// Fallthrough
case 211:
if (npc->direct == 0)
@@ -171,7 +171,7 @@
npc->act_wait = 0;
npc->damage = 3;
SetQuake2(10);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
if (npc->direct == 2 && npc->flag & 4)
@@ -180,7 +180,7 @@
npc->act_wait = 0;
npc->damage = 3;
SetQuake2(10);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
if (npc->count1 < 4 && gMC.x > npc->x - (16 * 0x200) && gMC.x < npc->x + (16 * 0x200))
@@ -211,7 +211,7 @@
npc->xm = 0;
npc->damage = 10;
npc->direct = 0;
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
// Fallthrough
case 221:
npc->ym = -0x800;
@@ -238,7 +238,7 @@
SetNpChar(332, npc->x - (12 * 0x200), npc->y - (12 * 0x200), 0, 0, 0, NULL, 0x100);
SetNpChar(332, npc->x + (12 * 0x200), npc->y - (12 * 0x200), 0, 0, 2, NULL, 0x100);
SetQuake2(10);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
if (npc->count1 < 4 && gMC.y > npc->y - (16 * 0x200) && gMC.y < npc->y + (16 * 0x200))
@@ -269,7 +269,7 @@
npc->xm = 0;
npc->damage = 10;
npc->direct = 2;
- PlaySoundObject(25, 1);
+ PlaySoundObject(25, SOUND_MODE_PLAY);
// Fallthrough
case 231:
npc->ym = 0x800;
@@ -299,7 +299,7 @@
SetNpChar(332, npc->x - (12 * 0x200), npc->y + (12 * 0x200), 0, 0, 0, NULL, 0x100);
SetNpChar(332, npc->x + (12 * 0x200), npc->y + (12 * 0x200), 0, 0, 2, NULL, 0x100);
SetQuake2(10);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
if (npc->count1 < 4 && gMC.y > npc->y - (16 * 0x200) && gMC.y < npc->y + (16 * 0x200))
@@ -458,7 +458,7 @@
npc->xm = 0;
npc->bits &= ~NPC_SHOOTABLE;
SetDestroyNpChar(npc->x, npc->y, 0x10, 0x10);
- PlaySoundObject(72, 1);
+ PlaySoundObject(72, SOUND_MODE_PLAY);
// Fallthrough
case 1001:
npc->ym += 0x20;
@@ -514,7 +514,7 @@
npc->act_no = 1005;
npc->act_wait = 0;
SetFlash(0, 0, 2);
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
}
if (++npc->act_wait / 2 % 2)
@@ -663,7 +663,7 @@
npc->act_no = 22;
npc->bits &= ~NPC_SHOOTABLE;
SetDestroyNpChar(npc->x, npc->y, 0x2000, 0x20);
- PlaySoundObject(71, 1);
+ PlaySoundObject(71, SOUND_MODE_PLAY);
}
npc->pNpc->count1 = 4;
@@ -746,7 +746,7 @@
npc->damage = 5;
npc->bits &= ~(NPC_IGNORE_SOLIDITY | NPC_SHOOTABLE);
SetDestroyNpChar(npc->x, npc->y, 0x2000, 0x20);
- PlaySoundObject(71, 1);
+ PlaySoundObject(71, SOUND_MODE_PLAY);
// Fallthrough
case 41:
if (npc->flag & 1)
@@ -766,7 +766,7 @@
}
npc->ym = -0x800;
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
npc->ym += 0x20;
@@ -796,7 +796,7 @@
else
{
SetDestroyNpChar(npc->x, npc->y, 0x2000, 0x20);
- PlaySoundObject(71, 1);
+ PlaySoundObject(71, SOUND_MODE_PLAY);
VanishNpChar(npc);
return;
}
@@ -813,7 +813,7 @@
{
SetNpChar(4, npc->x + (8 * 0x200), npc->y + 0x1800, 0, 0, 0, NULL, 0x100);
SetNpChar(4, npc->x - (8 * 0x200), npc->y + 0x1800, 0, 0, 0, NULL, 0x100);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
break;
@@ -822,7 +822,7 @@
{
SetNpChar(4, npc->x - (12 * 0x200), npc->y + (8 * 0x200), 0, 0, 0, NULL, 0x100);
SetNpChar(4, npc->x - (12 * 0x200), npc->y - (8 * 0x200), 0, 0, 0, NULL, 0x100);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
break;
@@ -832,7 +832,7 @@
SetNpChar(4, npc->x + (8 * 0x200), npc->y - (12 * 0x200), 0, 0, 0, NULL, 0x100);
SetNpChar(4, npc->x - (8 * 0x200), npc->y - (12 * 0x200), 0, 0, 0, NULL, 0x100);
SetNpChar(345, npc->x - (8 * 0x200), npc->y - (12 * 0x200), 0, 0, 0, NULL, 0x100);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
break;
@@ -841,7 +841,7 @@
{
SetNpChar(4, npc->x + (12 * 0x200), npc->y + (8 * 0x200), 0, 0, 0, NULL, 0x100);
SetNpChar(4, npc->x + (12 * 0x200), npc->y - (8 * 0x200), 0, 0, 0, NULL, 0x100);
- PlaySoundObject(26, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
}
break;
}
@@ -937,7 +937,7 @@
npc->ym = -0x200;
npc->act_no = 110;
npc->bits |= NPC_IGNORE_SOLIDITY;
- PlaySoundObject(12, 1);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
SetQuake(10);
for (i = 0; i < 4; ++i)
@@ -1135,7 +1135,7 @@
{
npc->act_no = 12;
npc->xm = 0x700;
- PlaySoundObject(6, 1);
+ PlaySoundObject(6, SOUND_MODE_PLAY);
npc->ani_no = 3;
}
@@ -1746,8 +1746,8 @@
{
npc->act_wait = 0;
SetQuake(20);
- PlaySoundObject(26, 1);
- PlaySoundObject(12, 1);
+ PlaySoundObject(26, SOUND_MODE_PLAY);
+ PlaySoundObject(12, SOUND_MODE_PLAY);
if (npc->direct == 0)
npc->x -= 16 * 0x200;
@@ -1901,7 +1901,7 @@
case 10:
npc->act_wait = 0;
npc->act_no = 11;
- PlaySoundObject(29, 1);
+ PlaySoundObject(29, SOUND_MODE_PLAY);
// Fallthrough
case 11:
++npc->act_wait;
--- a/src/NpcHit.cpp
+++ b/src/NpcHit.cpp
@@ -463,7 +463,7 @@
int val;
// Play death sound
- PlaySoundObject(npc->destroy_voice, 1);
+ PlaySoundObject(npc->destroy_voice, SOUND_MODE_PLAY);
// Create smoke
switch (npc->size)
@@ -594,7 +594,7 @@
SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, 11, 0);
SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, 11, 0);
SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, 11, 0);
- PlaySoundObject(gNPC[n].hit_voice, 1);
+ PlaySoundObject(gNPC[n].hit_voice, SOUND_MODE_PLAY);
gNPC[n].shock = 16;
}
@@ -615,7 +615,7 @@
{
// Hit invulnerable NPC
SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, 2, 2);
- PlaySoundObject(31, 1);
+ PlaySoundObject(31, SOUND_MODE_PLAY);
gBul[b].life = 0;
continue;
}
--- a/src/SelStage.cpp
+++ b/src/SelStage.cpp
@@ -101,7 +101,7 @@
StartTextScript(gPermitStage[gSelectedStage].index + 1000);
if (gKeyTrg & (gKeyLeft | gKeyRight))
- PlaySoundObject(1, 1);
+ PlaySoundObject(1, SOUND_MODE_PLAY);
}
void PutStageSelectObject(void)
--- a/src/Shoot.cpp
+++ b/src/Shoot.cpp
@@ -82,7 +82,7 @@
}
}
- PlaySoundObject(33, 1);
+ PlaySoundObject(33, SOUND_MODE_PLAY);
}
}
}
@@ -113,7 +113,7 @@
{
if (!UseArmsEnergy(1))
{
- PlaySoundObject(37, 1);
+ PlaySoundObject(37, SOUND_MODE_PLAY);
}
else
{
@@ -158,9 +158,9 @@
}
if (level == 3)
- PlaySoundObject(49, 1);
+ PlaySoundObject(49, SOUND_MODE_PLAY);
else
- PlaySoundObject(32, 1);
+ PlaySoundObject(32, SOUND_MODE_PLAY);
}
}
}
@@ -241,7 +241,7 @@
}
}
- PlaySoundObject(34, 1);
+ PlaySoundObject(34, SOUND_MODE_PLAY);
}
}
}
@@ -281,7 +281,7 @@
if (!UseArmsEnergy(1))
{
- PlaySoundObject(37, 1);
+ PlaySoundObject(37, SOUND_MODE_PLAY);
if (empty == 0)
{
@@ -349,9 +349,9 @@
}
if (level == 3)
- PlaySoundObject(49, 1);
+ PlaySoundObject(49, SOUND_MODE_PLAY);
else
- PlaySoundObject(32, 1);
+ PlaySoundObject(32, SOUND_MODE_PLAY);
}
else
{
@@ -482,7 +482,7 @@
{
if (!UseArmsEnergy(1))
{
- PlaySoundObject(37, 1);
+ PlaySoundObject(37, SOUND_MODE_PLAY);
if (empty == 0)
{
@@ -537,7 +537,7 @@
{
if (!UseArmsEnergy(1))
{
- PlaySoundObject(37, 1);
+ PlaySoundObject(37, SOUND_MODE_PLAY);
if (empty == 0)
{
@@ -601,7 +601,7 @@
}
}
- PlaySoundObject(32, 1);
+ PlaySoundObject(32, SOUND_MODE_PLAY);
}
}
@@ -616,7 +616,7 @@
{
if (!UseArmsEnergy(1))
{
- PlaySoundObject(37, 1);
+ PlaySoundObject(37, SOUND_MODE_PLAY);
if (empty == 0)
{
@@ -667,7 +667,7 @@
}
}
- PlaySoundObject(48, 1);
+ PlaySoundObject(48, SOUND_MODE_PLAY);
}
else if (++wait > 20)
{
@@ -697,7 +697,7 @@
if (!UseArmsEnergy(1))
{
- PlaySoundObject(37, 1);
+ PlaySoundObject(37, SOUND_MODE_PLAY);
if (empty == 0)
{
@@ -748,7 +748,7 @@
}
}
- PlaySoundObject(48, 1);
+ PlaySoundObject(48, SOUND_MODE_PLAY);
}
else if (++wait > 1)
{
@@ -803,7 +803,7 @@
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y - (3 * 0x200), 2);
}
- PlaySoundObject(34, 1);
+ PlaySoundObject(34, SOUND_MODE_PLAY);
}
}
@@ -833,7 +833,7 @@
{
if (!UseArmsEnergy(1))
{
- PlaySoundObject(37, 1);
+ PlaySoundObject(37, SOUND_MODE_PLAY);
}
else
{
@@ -880,15 +880,15 @@
switch (level)
{
case 1:
- PlaySoundObject(117, 1);
+ PlaySoundObject(117, SOUND_MODE_PLAY);
break;
case 2:
- PlaySoundObject(49, 1);
+ PlaySoundObject(49, SOUND_MODE_PLAY);
break;
case 3:
- PlaySoundObject(60, 1);
+ PlaySoundObject(60, SOUND_MODE_PLAY);
break;
}
}
@@ -925,16 +925,16 @@
switch (level)
{
case 1:
- PlaySoundObject(59, 1);
+ PlaySoundObject(59, SOUND_MODE_PLAY);
break;
case 2:
- PlaySoundObject(60, 1);
+ PlaySoundObject(60, SOUND_MODE_PLAY);
break;
case 3:
if (!IsMaxExpMyChar())
- PlaySoundObject(61, 1);
+ PlaySoundObject(61, SOUND_MODE_PLAY);
break;
}
@@ -953,7 +953,7 @@
if (!bMax)
{
bMax = TRUE;
- PlaySoundObject(65, 1);
+ PlaySoundObject(65, SOUND_MODE_PLAY);
}
}
else
@@ -991,7 +991,7 @@
{
if (!UseArmsEnergy(1))
{
- PlaySoundObject(37, 1);
+ PlaySoundObject(37, SOUND_MODE_PLAY);
}
else
{
@@ -1038,19 +1038,19 @@
switch (bul_no)
{
case 6:
- PlaySoundObject(49, 1);
+ PlaySoundObject(49, SOUND_MODE_PLAY);
break;
case 37:
- PlaySoundObject(62, 1);
+ PlaySoundObject(62, SOUND_MODE_PLAY);
break;
case 38:
- PlaySoundObject(63, 1);
+ PlaySoundObject(63, SOUND_MODE_PLAY);
break;
case 39:
- PlaySoundObject(64, 1);
+ PlaySoundObject(64, SOUND_MODE_PLAY);
break;
}
}
--- a/src/Sound.cpp
+++ b/src/Sound.cpp
@@ -219,7 +219,7 @@
return TRUE;
}
-void PlaySoundObject(int no, int mode)
+void PlaySoundObject(int no, SoundMode mode)
{
if (!audio_backend_initialised)
return;
@@ -228,17 +228,17 @@
{
switch (mode)
{
- case 0: // 停止 (Stop)
+ case SOUND_MODE_STOP: // 停止 (Stop)
AudioBackend_StopSound(lpSECONDARYBUFFER[no]);
break;
- case 1: // 再生 (Playback)
+ case SOUND_MODE_PLAY: // 再生 (Playback)
AudioBackend_StopSound(lpSECONDARYBUFFER[no]);
AudioBackend_RewindSound(lpSECONDARYBUFFER[no]);
AudioBackend_PlaySound(lpSECONDARYBUFFER[no], FALSE);
break;
- case -1:// ループ再生 (Loop playback)
+ case SOUND_MODE_PLAY_LOOP:// ループ再生 (Loop playback)
AudioBackend_PlaySound(lpSECONDARYBUFFER[no], TRUE);
break;
}
--- a/src/Sound.h
+++ b/src/Sound.h
@@ -26,6 +26,13 @@
// To be continued
};
+enum SoundMode
+{
+ SOUND_MODE_PLAY_LOOP = -1,
+ SOUND_MODE_STOP = 0,
+ SOUND_MODE_PLAY = 1
+};
+
extern BOOL audio_backend_initialised;
extern AudioBackend_Sound *lpSECONDARYBUFFER[SE_MAX];
@@ -33,7 +40,7 @@
void EndDirectSound(void);
BOOL InitSoundObject(const char *resname, int no);
BOOL LoadSoundObject(const char *file_name, int no);
-void PlaySoundObject(int no, int mode);
+void PlaySoundObject(int no, SoundMode mode);
void ChangeSoundFrequency(int no, unsigned long rate);
void ChangeSoundVolume(int no, long volume);
void ChangeSoundPan(int no, long pan);
--- a/src/TextScr.cpp
+++ b/src/TextScr.cpp
@@ -418,7 +418,7 @@
strcat(text[gTS.line % 4], str);
// Play sound and reset blinking cursor
- PlaySoundObject(2, 1);
+ PlaySoundObject(2, SOUND_MODE_PLAY);
gTS.wait_beam = 0;
// Check if should move to next line (prevent a memory overflow, come on guys, this isn't a leftover of pixel trying to make text wrapping)
@@ -652,7 +652,7 @@
else if (IS_COMMAND('I','T','+'))
{
x = GetTextScriptNo(gTS.p_read + 4);
- PlaySoundObject(38, 1);
+ PlaySoundObject(38, SOUND_MODE_PLAY);
AddItemData(x);
gTS.p_read += 8;
}
@@ -685,7 +685,7 @@
gNumberTextScript[1] = z;
#endif
- PlaySoundObject(38, 1);
+ PlaySoundObject(38, SOUND_MODE_PLAY);
AddArmsData(w, x);
gTS.p_read += 13;
}
@@ -895,7 +895,7 @@
gTS.next_event = GetTextScriptNo(gTS.p_read + 4);
gTS.p_read += 8;
gTS.mode = 6;
- PlaySoundObject(5, 1);
+ PlaySoundObject(5, SOUND_MODE_PLAY);
gTS.wait = 0;
gTS.select = 0;
bExit = TRUE;
@@ -1056,7 +1056,7 @@
else if (IS_COMMAND('S','O','U'))
{
z = GetTextScriptNo(gTS.p_read + 4);
- PlaySoundObject(z, 1);
+ PlaySoundObject(z, SOUND_MODE_PLAY);
gTS.p_read += 8;
}
else if (IS_COMMAND('C','M','U'))
@@ -1385,7 +1385,7 @@
}
strcat(text[gTS.line % 4], c);
- PlaySoundObject(2, 1);
+ PlaySoundObject(2, SOUND_MODE_PLAY);
gTS.wait_beam = 0;
// Offset read and write positions
@@ -1472,7 +1472,7 @@
// Select option
if (gKeyTrg & gKeyOk)
{
- PlaySoundObject(18, 1);
+ PlaySoundObject(18, SOUND_MODE_PLAY);
if (gTS.select == 1)
{
@@ -1488,13 +1488,13 @@
else if (gKeyTrg & gKeyLeft)
{
gTS.select = 0;
- PlaySoundObject(1, 1);
+ PlaySoundObject(1, SOUND_MODE_PLAY);
}
// No
else if (gKeyTrg & gKeyRight)
{
gTS.select = 1;
- PlaySoundObject(1, 1);
+ PlaySoundObject(1, SOUND_MODE_PLAY);
}
}
break;