summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2026-03-30 02:10:42 -0700
committerGitHub <noreply@github.com>2026-03-30 02:10:42 -0700
commit5685fa58c619245cc21eb9a78d2b9e6ab4cc67aa (patch)
tree1e38843572ddb5664d8b9895385a65e8adf39294 /src
parentcb6ee4b21e25cb40a08c0f1effeebda79896a7e5 (diff)
Z2Audio player debug work / fix actor method returns (#3140)
* Z2Audio player debug work * fix actor method returns * wii build fix
Diffstat (limited to 'src')
-rw-r--r--src/Z2AudioCS/Z2AudioCS.cpp6
-rw-r--r--src/Z2AudioLib/Z2SeView.cpp0
-rw-r--r--src/Z2AudioLib/Z2SoundPlayer.cpp480
-rw-r--r--src/Z2AudioLib/Z2TrackView.cpp0
-rw-r--r--src/Z2AudioLib/Z2WaveArcLoader.cpp335
-rw-r--r--src/d/actor/d_a_e_fz.cpp953
-rw-r--r--src/d/actor/d_a_e_oc.cpp20
-rw-r--r--src/d/actor/d_a_e_zs.cpp6
-rw-r--r--src/d/actor/d_a_myna.cpp6
-rw-r--r--src/d/actor/d_a_npc_sola.cpp13
-rw-r--r--src/d/actor/d_a_obj_Y_taihou.cpp16
-rw-r--r--src/d/actor/d_a_obj_fan.cpp4
-rw-r--r--src/d/actor/d_a_obj_inobone.cpp6
-rw-r--r--src/d/actor/d_a_obj_stick.cpp18
-rw-r--r--src/d/actor/d_a_peru.cpp76
-rw-r--r--src/d/actor/d_a_tag_magne.cpp8
-rw-r--r--src/d/d_cursor_mng.cpp4
17 files changed, 1330 insertions, 621 deletions
diff --git a/src/Z2AudioCS/Z2AudioCS.cpp b/src/Z2AudioCS/Z2AudioCS.cpp
index e619876537..c21c1a898c 100644
--- a/src/Z2AudioCS/Z2AudioCS.cpp
+++ b/src/Z2AudioCS/Z2AudioCS.cpp
@@ -127,12 +127,12 @@ SpkSoundHandle* Z2AudioCS::startLevel(s32 id, s32 chan) {
return handle;
}
-s32 Z2AudioCS::getName(s32 num) {
+const char* Z2AudioCS::getName(s32 num) {
if (JASGlobalInstance<SpkSystem>::getInstance() == NULL) {
- return 0;
+ return NULL;
}
if (JASGlobalInstance<SpkSystem>::getInstance()->getData() == NULL) {
- return 0;
+ return NULL;
}
return JASGlobalInstance<SpkSystem>::getInstance()->getData()->getTableMgr().getName(num);
diff --git a/src/Z2AudioLib/Z2SeView.cpp b/src/Z2AudioLib/Z2SeView.cpp
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/Z2AudioLib/Z2SeView.cpp
diff --git a/src/Z2AudioLib/Z2SoundPlayer.cpp b/src/Z2AudioLib/Z2SoundPlayer.cpp
index d2d6fdecf3..1302d07674 100644
--- a/src/Z2AudioLib/Z2SoundPlayer.cpp
+++ b/src/Z2AudioLib/Z2SoundPlayer.cpp
@@ -1,46 +1,55 @@
#include "Z2AudioLib/Z2SoundPlayer.h"
-#include "Z2AudioLib/Z2SeqMgr.h"
-
-Z2SoundPlayer::Z2SoundPlayer(const char* param_1) : JAWWindow("Player for JAudio2", 500, 140), field_0x48c(field_0x46c, 8) {
- field_0x3ed = 0;
- field_0x3ee = 0;
- field_0x3ef = 0;
- field_0x3f0 = 0;
- field_0x3f4 = param_1;
+#include "Z2AudioLib/Z2AudioMgr.h"
+#include "Z2AudioCS/Z2AudioCS.h"
+#include "JSystem/JUtility/JUTGamePad.h"
+
+Z2SoundPlayer::Z2SoundPlayer(const char* projectName)
+ : JAWWindow("Player for JAudio2", 500, 140),
+ field_0x48c(field_0x46c, 8)
+{
+ field_0x3ed = false;
+ field_0x3ee = false;
+ field_0x3ef = false;
+ field_0x3f0 = false;
+
+ m_name = projectName;
field_0x3f8 = 0;
field_0x3fc = 0;
field_0x3fa = 0;
field_0x3fe = 0;
field_0x400 = 0;
- field_0x402 = 0;
- field_0x444 = 0;
+ m_portNum = 0;
+ m_portVal = 0;
field_0x446 = 0;
- field_0x404 = "CMD_PORT";
- field_0x408 = "END_PORT";
- field_0x40c = "STA_PORT";
- field_0x410 = "WAIT_PORT";
- field_0x414 = "NUM_PORT";
- field_0x418 = "PORT_5";
- field_0x41c = "MAP_PORT";
- field_0x420 = "NOTE_PORT";
- field_0x424 = "SE_SELECT_PORT";
- field_0x428 = "BGM_STATUS_PORT";
- field_0x42c = "BGM_PORT2";
- field_0x430 = "BGM_PORT3";
- field_0x434 = "PORT12";
- field_0x438 = "PORT13";
- field_0x43c = "FILTER_PORT";
- field_0x440 = "FX_PORT";
+
+ m_portNames[0] = "CMD_PORT";
+ m_portNames[1] = "END_PORT";
+ m_portNames[2] = "STA_PORT";
+ m_portNames[3] = "WAIT_PORT";
+ m_portNames[4] = "NUM_PORT";
+ m_portNames[5] = "PORT_5";
+ m_portNames[6] = "MAP_PORT";
+ m_portNames[7] = "NOTE_PORT";
+ m_portNames[8] = "SE_SELECT_PORT";
+ m_portNames[9] = "BGM_STATUS_PORT";
+ m_portNames[10] = "BGM_PORT2";
+ m_portNames[11] = "BGM_PORT3";
+ m_portNames[12] = "PORT12";
+ m_portNames[13] = "PORT13";
+ m_portNames[14] = "FILTER_PORT";
+ m_portNames[15] = "FX_PORT";
+
u8 r30 = 0;
field_0x448[r30++] = &field_0x3f8;
field_0x448[r30++] = &field_0x3fa;
field_0x448[r30++] = &field_0x3fc;
field_0x448[r30++] = &field_0x3fe;
field_0x448[r30++] = &field_0x400;
- field_0x448[r30++] = &field_0x402;
- field_0x448[r30] = &field_0x444;
- field_0x464 = 0;
- field_0x468 = 7;
+ field_0x448[r30++] = &m_portNum;
+ field_0x448[r30] = &m_portVal;
+
+ m_cursorY = 0;
+ m_cursorMax = 7;
field_0x4a0 = 0;
field_0x4a4 = 1.0f;
field_0x4a8 = 0.5f;
@@ -48,65 +57,446 @@ Z2SoundPlayer::Z2SoundPlayer(const char* param_1) : JAWWindow("Player for JAudio
field_0x4b0 = 0.0f;
field_0x4b4 = 0.0f;
field_0x4b8 = 1.0f;
- field_0x498 = Z2GetSeqMgr()->getSubBgmHandle();
+
+ mp_subBgmHandle = Z2GetSeqMgr()->getSubBgmHandle();
}
-void Z2SoundPlayer::onDraw(JAWGraphContext*) {
+void Z2SoundPlayer::onDraw(JAWGraphContext* graf) {
+ JAUSoundNameTable* soundTable = JASGlobalInstance<JAUSoundNameTable>::getInstance();
+
+ int var_r27 = 0;
+ if (field_0x3ed) {
+ var_r27 = 2;
+ }
+
+ u8 cursorY = 0;
+
+ graf->color(JUtility::TColor(0, 0x7F, 0xFF, 0xFF), JUtility::TColor(0, 0xFF, 0x7F, 0xFF));
+ graf->print(1, cursorY++, "Project: %s", m_name);
+
+ graf->color(0xFF >> (u8)var_r27, 0xFF >> (u8)var_r27, 0xFF >> (u8)var_r27, 0xFF);
+ graf->print(0, m_cursorY + 1, ">");
+
+ JUtility::TColor sp28(0xFF >> (u8)var_r27, 0xFF >> (u8)var_r27, 0xFF >> (u8)var_r27, 0xFF);
+ JUtility::TColor sp24(0, 0xFF >> (u8)var_r27, 0, 0xFF);
+ onDrawSoundItem(graf, soundTable, cursorY++,
+ sp28,
+ sp24,
+ "SEQ NUM ",
+ 1, 0, field_0x3f8
+ );
+
+ graf->color(sp28);
+ const char* cateName;
+ if (soundTable != NULL) {
+ cateName = soundTable->getGroupName(JAISoundID(0, field_0x3fa & 0xFF, 0));
+ } else {
+ cateName = "";
+ }
+ graf->print(1, cursorY++, "SE CATE %03x %s", field_0x3fa, cateName);
+
+ onDrawSoundItem(graf, soundTable, cursorY++,
+ sp28,
+ sp24,
+ "SE NUM ",
+ 0, field_0x3fa & 0xFF, field_0x3fc
+ );
+ onDrawSoundItem(graf, soundTable, cursorY++,
+ sp28,
+ sp24,
+ "STRM NUM",
+ 2, 0, field_0x3fe
+ );
+
+ graf->color(sp28);
+ graf->print(1, cursorY++, "CORE_SPK %03x %s", field_0x400, Z2AudioCS::getName(field_0x400));
+
+ graf->color(field_0x446 + 0xC0, 0xC0, 0xC0, 0xFF);
+ graf->print(1, cursorY++, "PORT NUM %03x %s", m_portNum, m_portNames[m_portNum]);
+ graf->print(1, cursorY++, "PORT VAL %03x", m_portVal);
+
+ graf->color(0, 0x50, 0xC8, 0xFF);
+ if (field_0x3ee) {
+ graf->print(1, cursorY, "DOLBY ON\n");
+ }
+
+ graf->color(0xC8, 0x50, 0, 0xFF);
+ if (field_0x3f0) {
+ graf->print(10, cursorY, "LEVEL SE CALL");
+ }
+
+ graf->color(0xFF, 0, 0, 0xFF);
+ graf->print(0x16, cursorY, "%s", field_0x3ed ? "PAUSE ON" : "");
+
+ graf->color(0, 0xC8, (field_0x4a0 * 200) / 30, 0xFF);
+ if (field_0x3ef) {
+ graf->print(0x16, cursorY, "RESET %d\n", field_0x4a0);
+ }
}
-void Z2SoundPlayer::onTrigA(const JUTGamePad&) {
+void Z2SoundPlayer::onTrigA(const JUTGamePad& pad) {
+ switch (m_cursorY) {
+ case 0: {
+ JAISoundID sp24(1, 0, (u16)field_0x3f8);
+ switch (sp24) {
+ case 0x100000a:
+ case 0x100000b:
+ case 0x100000f:
+ case 0x1000012:
+ case 0x1000014:
+ case 0x100001b:
+ case 0x100001c:
+ case 0x1000024:
+ Z2GetSoundMgr()->startSound(sp24, mp_subBgmHandle, NULL);
+ break;
+ default:
+ Z2GetSoundMgr()->startSound(sp24, &field_0x494, NULL);
+ break;
+ }
+ break;
+ }
+ case 1:
+ case 2:
+ if (!field_0x3f0) {
+ JAISoundHandle* handle = field_0x48c.getFreeHandle();
+ JAISoundID sp20(0, field_0x3fa & 0xFF, (u16)field_0x3fc);
+ if (handle != NULL) {
+ Z2GetSoundStarter()->startSound(sp20, handle, NULL);
+ if (*handle) {
+ Z2GetSoundStarter()->setPortData(handle, m_portNum, m_portVal, -1);
+ }
+ }
+ }
+ break;
+ case 3:
+ Z2GetSoundMgr()->startSound(JAISoundID(2, 0, (u16)field_0x3fe), &field_0x49c, NULL);
+ break;
+ case 4:
+ if (!field_0x3f0) {
+ Z2AudioCS::start(field_0x400, 0);
+ }
+ break;
+ case 5:
+ case 6:
+ field_0x446 = 64;
+ if (m_portNum < 9) {
+ JAISoundHandle* handle = field_0x48c.getFreeHandle();
+ JAISoundID sp1C(0, field_0x3fa & 0xFF, (u16)field_0x3fc);
+ if (handle != NULL) {
+ Z2GetSoundStarter()->startSound(sp1C, handle, NULL);
+ if (*handle) {
+ Z2GetSoundStarter()->setPortData(handle, m_portNum, m_portVal, -1);
+ }
+ }
+ } else {
+ if (field_0x494) {
+ Z2GetSoundStarter()->setPortData(&field_0x494, m_portNum, m_portVal, -1);
+ }
+ if (mp_subBgmHandle->isSoundAttached()) {
+ Z2GetSoundStarter()->setPortData(mp_subBgmHandle, m_portNum, m_portVal, -1);
+ }
+ }
+ break;
+ }
}
-void Z2SoundPlayer::onTrigB(const JUTGamePad&) {
+void Z2SoundPlayer::onTrigB(const JUTGamePad& pad) {
+ switch (m_cursorY) {
+ case 0: {
+ if (field_0x494) {
+ field_0x494->stop(0);
+ }
+
+ field_0x494.releaseSound();
+ if (mp_subBgmHandle->isSoundAttached()) {
+ (*mp_subBgmHandle)->stop();
+ }
+ break;
+ }
+ case 1:
+ case 2: {
+ JAISoundHandle* handle = field_0x48c.getHandleSoundID(JAISoundID(0, field_0x3fa & 0xFF, (u16)field_0x3fc));
+ if (handle) {
+ (*handle)->stop();
+ handle->releaseSound();
+ }
+ break;
+ }
+ case 3:
+ if (field_0x49c) {
+ field_0x49c->stop();
+ }
+
+ field_0x49c.releaseSound();
+ break;
+ case 4:
+ Z2AudioCS::stop(0);
+ break;
+ case 5:
+ case 6:
+ m_portVal = 0;
+ field_0x446 = 0;
+
+ if (field_0x494) {
+ Z2GetSoundStarter()->setPortData(&field_0x494, m_portNum, m_portVal, -1);
+ }
+
+ if (mp_subBgmHandle->isSoundAttached()) {
+ Z2GetSoundStarter()->setPortData(mp_subBgmHandle, m_portNum, m_portVal, -1);
+ }
+ break;
+ }
}
void Z2SoundPlayer::frameWork() {
+ switch (m_cursorY) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ break;
+ }
+ if (field_0x3ef) {
+ field_0x4a0++;
+
+ if (Z2GetAudioMgr()->hasReset()) {
+ Z2GetAudioMgr()->resetRecover();
+ field_0x3ef = false;
+ OS_REPORT("RESET END \n");
+ }
+ }
}
-void Z2SoundPlayer::onPadProc(const JUTGamePad&) {
+void Z2SoundPlayer::onPadProc(const JUTGamePad& pad) {
+ if (field_0x3f0 && pad.testButton(PAD_BUTTON_A)) {
+ switch (m_cursorY) {
+ case 2: {
+ JAISoundID sp14(0, field_0x3fa & 0xFF, (u16)field_0x3fc);
+ JAISoundHandle* handle = field_0x48c.getHandleSoundID(sp14);
+ if (handle == NULL) {
+ handle = field_0x48c.getFreeHandle();
+ }
+
+ if (handle != NULL) {
+ Z2GetAudioMgr()->startLevelSound(sp14, handle, NULL);
+ }
+ if (*handle) {
+ Z2GetSoundStarter()->setPortData(handle, m_portNum, m_portVal, -1);
+ }
+ break;
+ }
+ case 4:
+ Z2AudioCS::startLevel(field_0x400, 0);
+ break;
+ }
+ }
}
-void Z2SoundPlayer::onTrigX(const JUTGamePad&) {
+void Z2SoundPlayer::onTrigX(const JUTGamePad& pad) {
+ switch (m_cursorY) {
+ case 0: {
+ if (field_0x494) {
+ field_0x494->pause(!field_0x494->isPaused());
+ }
+ if (mp_subBgmHandle->isSoundAttached()) {
+ (*mp_subBgmHandle)->pause(!(*mp_subBgmHandle)->isPaused());
+ }
+ break;
+ }
+ case 1:
+ case 2: {
+ JAISoundHandle* handle = field_0x48c.getHandleSoundID(JAISoundID(0, field_0x3fa & 0xFF, (u16)field_0x3fc));
+ if (handle) {
+ (*handle)->pause(!(*handle)->isPaused());
+ }
+ break;
+ }
+ case 3:
+ if (field_0x49c) {
+ (field_0x49c)->pause(!(field_0x49c)->isPaused());
+ }
+ break;
+ case 4:
+ Z2AudioCS::stop(0);
+ break;
+ }
}
-void Z2SoundPlayer::onTrigY(const JUTGamePad&) {
+void Z2SoundPlayer::onTrigY(const JUTGamePad& pad) {
+ if (!field_0x3ef) {
+ Z2GetAudioMgr()->resetProcess(30, false);
+ field_0x3ef = true;
+ field_0x4a0 = 0;
+ }
+}
+
+void Z2SoundPlayer::onTrigZ(const JUTGamePad& pad) {
+ bool* pvar = &field_0x3f0;
+ bool newValue = *pvar ^ 1;
+ *pvar = newValue;
+}
+void Z2SoundPlayer::onTrigL(const JUTGamePad& pad) {
+ bool* pvar = &field_0x3ee;
+ bool newValue = *pvar ^ 1;
+ *pvar = newValue;
+ if (field_0x3ee) {
+ Z2GetAudioMgr()->setOutputMode(2);
+ } else {
+ Z2GetAudioMgr()->setOutputMode(1);
+ }
}
-void Z2SoundPlayer::onTrigZ(const JUTGamePad&) {
+void Z2SoundPlayer::onKeyLeft(const JUTGamePad& pad) {
+ int moveMax = getCursorMoveMax(pad);
+ int menuMax = getMenuNumberMax();
+
+ if (moveMax >= menuMax) {
+ moveMax = 1;
+ }
+ if (*field_0x448[m_cursorY] > moveMax - 1) {
+ *field_0x448[m_cursorY] -= (s16)moveMax;
+ } else {
+ *field_0x448[m_cursorY] = (*field_0x448[m_cursorY] + menuMax) - moveMax;
+ }
+
+ if (m_cursorY == 1) {
+ correctSeNumber();
+ }
}
-void Z2SoundPlayer::onTrigL(const JUTGamePad&) {
+void Z2SoundPlayer::onKeyRight(const JUTGamePad& pad) {
+ int moveMax = getCursorMoveMax(pad);
+ int menuMax = getMenuNumberMax();
+
+ if (moveMax >= menuMax) {
+ moveMax = 1;
+ }
+
+ if (*field_0x448[m_cursorY] < menuMax - moveMax) {
+ *field_0x448[m_cursorY] += (s16)moveMax;
+ } else {
+ *field_0x448[m_cursorY] = (*field_0x448[m_cursorY] + moveMax) - menuMax;
+ }
+
+ if (m_cursorY == 1) {
+ correctSeNumber();
+ }
}
-void Z2SoundPlayer::onKeyLeft(const JUTGamePad&) {
+void Z2SoundPlayer::onKeyUp(const JUTGamePad& pad) {
+ if (m_cursorY != 0) {
+ m_cursorY--;
+ } else {
+ m_cursorY = m_cursorMax - 1;
+ }
+}
+void Z2SoundPlayer::onKeyDown(const JUTGamePad& pad) {
+ if (m_cursorY < m_cursorMax - 1) {
+ m_cursorY++;
+ } else {
+ m_cursorY = 0;
+ }
}
-void Z2SoundPlayer::onKeyRight(const JUTGamePad&) {
+void Z2SoundPlayer::onKeyMenu(const JUTGamePad& pad) {
+ bool* pvar = &field_0x3ed;
+ bool newValue = *pvar ^ 1;
+ *pvar = newValue;
+ Z2GetSoundMgr()->pauseAllGameSound(field_0x3ed);
}
-void Z2SoundPlayer::onKeyUp(const JUTGamePad&) {
+u32 Z2SoundPlayer::getCursorMoveMax(const JUTGamePad& pad) {
+ u32 num = 1;
+ if (pad.testButton(PAD_TRIGGER_Z) && pad.testButton(PAD_BUTTON_X)) {
+ num = 128;
+ } else if (pad.testButton(PAD_TRIGGER_Z)) {
+ num = 16;
+ } else if (pad.testButton(PAD_BUTTON_X)) {
+ num = 8;
+ }
+
+ return num;
}
-void Z2SoundPlayer::onKeyDown(const JUTGamePad&) {
+int Z2SoundPlayer::getMenuNumberMax() {
+ JAUSoundTable* soundTable = JASGlobalInstance<JAUSoundTable>::getInstance();
+ JUT_ASSERT(550, soundTable);
+
+ int num = 0;
+ switch (m_cursorY) {
+ case 0:
+ num = soundTable->getNumItems_inGroup(1, 0);
+ break;
+ case 1:
+ num = soundTable->getNumGroups_inSection(0);
+ break;
+ case 2:
+ num = soundTable->getNumItems_inGroup(0, field_0x3fa);
+ break;
+ case 3:
+ num = soundTable->getNumItems_inGroup(2, 0);
+ break;
+ case 4:
+ num = Z2AudioCS::getNumOfSound();
+ break;
+ case 5:
+ num = 16;
+ break;
+ case 6:
+ num = 128;
+ break;
+ }
+ return num;
}
-void Z2SoundPlayer::onKeyMenu(const JUTGamePad&) {
+void Z2SoundPlayer::correctSeNumber() {
+ JAUSoundTable* soundTable = JASGlobalInstance<JAUSoundTable>::getInstance();
+ JUT_ASSERT(594, soundTable);
+ int num = soundTable->getNumItems_inGroup(0, field_0x3fa);
+ if (num == 0) {
+ field_0x3fc = 0;
+ } else if (field_0x3fc >= num) {
+ field_0x3fc = num - 1;
+ }
}
-u32 Z2SoundPlayer::getCursorMoveMax(const JUTGamePad&) {
+void Z2SoundPlayer::onDrawSoundItem(JAWGraphContext* graf, JAUSoundNameTable* nameTable, int cursorY,
+ const JUtility::TColor& color0, const JUtility::TColor& color1,
+ const char* label, u32 sectionID, u32 groupID, u32 waveID)
+{
+ static const char szNoEntry[] = "(NO ENTRY)";
+
+ const char* soundName = "";
+ if (nameTable != NULL) {
+ soundName = nameTable->getName(JAISoundID(sectionID, groupID, waveID));
+ if (*soundName == 0) {
+ soundName = szNoEntry;
+ }
+ } else {
+ soundName = "";
+ }
+
+ // !@bug comparing strings directly instead of using strcmp
+ if (soundName == szNoEntry) {
+ graf->color(color1);
+ } else {
+ graf->color(color0);
+ }
+ graf->print(1, cursorY, "%s %03x %s", label, waveID, soundName);
}
diff --git a/src/Z2AudioLib/Z2TrackView.cpp b/src/Z2AudioLib/Z2TrackView.cpp
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/Z2AudioLib/Z2TrackView.cpp
diff --git a/src/Z2AudioLib/Z2WaveArcLoader.cpp b/src/Z2AudioLib/Z2WaveArcLoader.cpp
new file mode 100644
index 0000000000..2522f4a877
--- /dev/null
+++ b/src/Z2AudioLib/Z2WaveArcLoader.cpp
@@ -0,0 +1,335 @@
+#include "Z2AudioLib/Z2WaveArcLoader.h"
+#include "JSystem/JAudio2/JAUSectionHeap.h"
+#include "JSystem/JAudio2/JASWaveInfo.h"
+
+#include <bitset>
+
+static f32 cStatusBar_X1 = 8.0f;
+static f32 cStatusBar_X2 = 16.0f;
+static f32 cWaveBar_X1 = 30.0f;
+static f32 cWaveBar_X2 = 80.0f;
+static f32 cBar_Y = 5.0f;
+static f32 cBarHeight = 310.0f;
+
+static u8 lbl_8074A738 = 10;
+static u8 lbl_8074A739 = 23;
+
+static u32 cWaveArcListSize = 10;
+
+Z2WaveArcLoader::Z2WaveArcLoader() :
+ JAWWindow("Z2WaveArcLoader", 420, 365)
+{
+ setWindowColor(0, 0, 0x50, 0xFF);
+
+ mpWaveBank = NULL;
+ mpWaveArc = NULL;
+ mWaveUsedSize = 0;
+ mTotalUsedSize = 0;
+ mBankNo = 0;
+ mArcCount = 0;
+ field_0x408 = 0;
+ field_0x40c = 0;
+ field_0x410 = 0;
+ field_0x414 = 0;
+ mIsLoadTail = false;
+
+ checkWaveBank();
+ checkWaveArc();
+}
+
+Z2WaveArcLoader::~Z2WaveArcLoader() {}
+
+// nonmatching with tree iterator stuff
+void Z2WaveArcLoader::onDraw(JAWGraphContext* graf) {
+ int cursorX = 8;
+ JASHeap* rootheap = JASWaveArcLoader::getRootHeap();
+ u32 aramsize = JASKernel::getAramSize();
+
+ mWaveUsedSize = 0;
+
+ for (u32 i = 0; i < 255; i++) {
+ JASWaveBank* bank = JASGlobalInstance<JAUSectionHeap>::getInstance()->getWaveBankTable().getWaveBank(i);
+ if (bank != NULL) {
+ u32 arcCount = bank->getArcCount();
+ for (int j = 0; j < arcCount; j++) {
+ JASWaveArc* arc = bank->getWaveArc(j);
+ if (arc != NULL && arc->getStatus() == 2) {
+ mWaveUsedSize += arc->getFileSize();
+ }
+ }
+ }
+ }
+
+ u32 otherUsedSize = mTotalUsedSize - mWaveUsedSize;
+ u32 totalFree = rootheap->getTotalFreeSize();
+ u32 linearFreeSize = rootheap->getFreeSize();
+ u32 sp54 = totalFree - linearFreeSize;
+
+ graf->color(JUtility::TColor(0x32, 0x96, 0xFF, 0xFF), JUtility::TColor(0xC8, 0xC8, 0xFF, 0xFF));
+ graf->print(cursorX, 0, "ARAM STATUS\n");
+
+ graf->color(0xFF, 0xFF, 0xFF, 0xFF);
+ graf->print(cursorX, 1, " total used : %8d\n", mTotalUsedSize);
+
+ graf->color(0xFF, 0x40, 0x40, 0xFF);
+ graf->print(cursorX, 2, " wave used : %8d\n", mWaveUsedSize);
+
+ graf->color(0xFF, 0xFF, 0x40, 0xFF);
+ graf->print(cursorX, 3, " other used : %8d\n", otherUsedSize);
+
+ graf->color(0x40, 0xFF, 0x40, 0xFF);
+ graf->print(cursorX, 4, " linear free : %8d\n", linearFreeSize);
+
+ graf->color(0xFF, 0xFF, 0xFF, 0xFF);
+ graf->print(cursorX, 5, " total free : %8d\n", totalFree);
+ graf->print(cursorX, 6, " ------------------------\n");
+ graf->print(cursorX, 7, " aram size : %8d\n", aramsize);
+
+ graf->color(0xFF, 0xFF, 0x20, 0xFF);
+ f32 var_f30 = cBar_Y;
+ f32 var_f31 = var_f30 + (((f32)otherUsedSize / (f32)aramsize) * cBarHeight);
+ graf->fillBox(JGeometry::TBox2<f32>(cStatusBar_X1, var_f30, cStatusBar_X2, var_f31));
+
+ graf->color(0xFF, 0x20, 0x20, 0xFF);
+ var_f30 = var_f31;
+ var_f31 += ((f32)mWaveUsedSize / (f32)aramsize) * cBarHeight;
+ graf->fillBox(JGeometry::TBox2<f32>(cStatusBar_X1, var_f30, cStatusBar_X2, var_f31));
+
+ graf->color(0x20, 0xFF, 0x20, 0xFF);
+ var_f30 = var_f31;
+ var_f31 += ((f32)linearFreeSize / (f32)aramsize) * cBarHeight;
+ graf->fillBox(JGeometry::TBox2<f32>(cStatusBar_X1, var_f30, cStatusBar_X2, var_f31));
+
+ graf->color(0x20, 0x20, 0xFF, 0xFF);
+ var_f30 = var_f31;
+ var_f31 += ((f32)sp54 / (f32)aramsize) * cBarHeight;
+ graf->fillBox(JGeometry::TBox2<f32>(cStatusBar_X1, var_f30, cStatusBar_X2, var_f31));
+
+ graf->color(0x40, 0x40, 0xFF, 0xFF);
+ graf->fillBox(JGeometry::TBox2<f32>(cWaveBar_X1, cBar_Y, cWaveBar_X2, cBar_Y + cBarHeight));
+
+ void* pbase = rootheap->getBase();
+ u32 heapSize = rootheap->getSize();
+ int sp48 = 0;
+
+ mTotalUsedSize = 0;
+
+ for (JSUTreeIterator<JASHeap> i = rootheap->getFirstChild(); (int)i != (int)rootheap->getEndChild(); ++i) {
+ intptr_t sp40 = (char*)i->getBase() - (char*)pbase;
+ u32 sp3C = i->getSize();
+ mTotalUsedSize += sp3C;
+
+ int sp38 = (sp40 * cBarHeight) / heapSize;
+ int sp34 = (sp3C * cBarHeight) / heapSize;
+ JGeometry::TBox2<f32> spD0(cWaveBar_X1, cBar_Y + (f32)sp38, cWaveBar_X2, (f32)sp34 + (cBar_Y + (f32)sp38));
+ u8 sp9 = 0xFF;
+ sp9 = sp48 % 2 ? (u8)0xC0 : (u8)0x80;
+ graf->color(0xFF, sp9, 0x40, 0xFF);
+ graf->fillBox(spD0);
+
+ if (mpWaveArc != NULL) {
+ if (mpWaveArc->getHeap() == i.getObject()) {
+ graf->color(0xFF, 0xFF, 0xFF, 0xFF);
+ graf->lineWidth(15);
+ graf->drawFrame(spD0);
+ }
+ }
+
+ sp48++;
+ }
+
+ graf->color(JUtility::TColor(0xC8, 0xC8, 0xFF, 0xFF), JUtility::TColor(0x32, 0x96, 0xFF, 0xFF));
+ if (mIsLoadTail) {
+ graf->print(cursorX, 9, "WAVE BANK LOAD:Tail");
+ } else {
+ graf->print(cursorX, 9, "WAVE BANK LOAD:Linear");
+ }
+
+ int var_r26 = lbl_8074A738;
+
+ if (mpWaveBank == NULL) {
+ graf->color(0x64, 0x64, 0x64, 0xFF);
+ graf->print(cursorX, var_r26, " ws:%3d Not Registerd", mBankNo);
+
+ graf->color(0xFF, 0xFF, 0xFF, 0xFF);
+ graf->print(cursorX, var_r26, ">");
+ } else {
+ graf->color(0xFF, 0xFF, 0xFF, 0xFF);
+ if (field_0x414 < 2) {
+ graf->print(cursorX, field_0x414 + var_r26, ">");
+ } else {
+ graf->print(cursorX, field_0x414 + (var_r26 + 1), ">");
+ }
+
+ graf->print(cursorX, var_r26++, " ws:%3d", mBankNo);
+ graf->print(cursorX, var_r26++, " aw:%3d-%3d /%3d", field_0x40c, field_0x410, mArcCount - 1);
+
+ graf->color(0xFF, 0xA0, 0x64, 0xFF);
+ graf->print(cursorX, var_r26++, " aw_status aw_size");
+
+ graf->color(0xFF, 0xFF, 0xFF, 0xFF);
+
+ for (int i = field_0x40c; i < field_0x410 + 1; i++) {
+ JASWaveArc* arc = mpWaveBank->getWaveArc(i);
+ if (arc == NULL) {
+ break;
+ }
+
+ switch (arc->getStatus()) {
+ case 0:
+ graf->color(0x64, 0x64, 0x64, 0xFF);
+ graf->print(cursorX, var_r26, "%3d: NOT_LOAD %8d", i, arc->getFileSize());
+ break;
+ case 1:
+ graf->color(0xFF, 0x64, 0x64, 0xFF);
+ graf->print(cursorX, var_r26, "%3d: WAIT_LOAD %8d", i, arc->getFileSize());
+ break;
+ case 2:
+ graf->color(0xFF, 0xFF, 0xC8, 0xFF);
+ graf->print(cursorX, var_r26, "%3d: LOAD %8d", i, arc->getFileSize());
+ break;
+ }
+
+ var_r26++;
+ }
+ }
+
+ var_r26 = lbl_8074A739;
+ graf->color(0x96, 0x96, 0xE1, 0xFF);
+ graf->print(cursorX, var_r26++, "-----------------");
+ graf->print(cursorX, var_r26++, " A -> LOAD WAVE");
+ graf->print(cursorX, var_r26++, " B -> ERASE WAVE");
+ graf->print(cursorX, var_r26++, "-----------------");
+}
+
+void Z2WaveArcLoader::checkWaveBank() {
+ JAUSectionHeap* sectionHeap = JASGlobalInstance<JAUSectionHeap>::getInstance();
+ const JAUSectionHeap::TSectionHeapData& heapData = sectionHeap->getSectionHeapData();
+ const JAUSection::TSectionData& sectionData = sectionHeap->getSectionData();
+
+ if (sectionData.registeredWaveBankTables.test(mBankNo)) {
+ mpWaveBank = heapData.waveBankTable.getWaveBank(mBankNo);
+ mArcCount = mpWaveBank->getArcCount();
+ } else {
+ mpWaveBank = NULL;
+ mArcCount = 0;
+ }
+
+ if (mBankNo == 1) {
+ mIsLoadTail = true;
+ } else {
+ mIsLoadTail = false;
+ }
+}
+
+void Z2WaveArcLoader::checkWaveArc() {
+ field_0x40c = field_0x408 * cWaveArcListSize;
+ if (field_0x40c > mArcCount - 1) {
+ field_0x408--;
+ field_0x40c = field_0x408 * cWaveArcListSize;
+ }
+
+ field_0x410 = (field_0x408 + 1) * cWaveArcListSize - 1;
+
+ if (field_0x410 > mArcCount - 1) {
+ field_0x410 = mArcCount - 1;
+ }
+
+ if (field_0x414 > 1) {
+ if ((field_0x40c + field_0x414) - 2 > field_0x410) {
+ field_0x414 = (field_0x410 - field_0x40c) + 2;
+ }
+
+ mpWaveArc = mpWaveBank->getWaveArc(field_0x40c + field_0x414 - 2);
+ } else {
+ mpWaveArc = NULL;
+ }
+}
+
+void Z2WaveArcLoader::onKeyUp(const JUTGamePad&) {
+ if (mpWaveBank == NULL) {
+ field_0x414 = 0;
+ } else {
+ if (field_0x414 != 0) {
+ field_0x414--;
+ } else {
+ field_0x414 = 11;
+ }
+
+ checkWaveArc();
+ }
+}
+
+void Z2WaveArcLoader::onKeyDown(const JUTGamePad&) {
+ if (mpWaveBank == NULL) {
+ field_0x414 = 0;
+ } else {
+ if (field_0x414 < 11) {
+ field_0x414++;
+ } else {
+ field_0x414 = 0;
+ }
+
+ checkWaveArc();
+ }
+}
+
+void Z2WaveArcLoader::onKeyLeft(const JUTGamePad&) {
+ if (field_0x414 == 0) {
+ if (mBankNo != 0) {
+ mBankNo--;
+ } else {
+ mBankNo = 0;
+ }
+
+ checkWaveBank();
+ } else if (mpWaveBank != NULL) {
+ if (field_0x408 != 0) {
+ field_0x408--;
+ } else {
+ field_0x408 = 0;
+ }
+
+ checkWaveArc();
+ }
+}
+
+void Z2WaveArcLoader::onKeyRight(const JUTGamePad&) {
+ if (field_0x414 == 0) {
+ if (mBankNo < 255) {
+ mBankNo++;
+ } else {
+ mBankNo = 255;
+ }
+
+ checkWaveBank();
+ } else if (mpWaveBank != NULL) {
+ if (field_0x408 < 255) {
+ field_0x408++;
+ } else {
+ field_0x408 = 255;
+ }
+
+ checkWaveArc();
+ }
+}
+
+void Z2WaveArcLoader::onTrigA(const JUTGamePad&) {
+ if (mpWaveArc != NULL && mpWaveArc->getStatus() == 0) {
+ if (mIsLoadTail) {
+ mpWaveArc->loadTail(NULL);
+ } else {
+ mpWaveArc->load(NULL);
+ }
+ }
+}
+
+void Z2WaveArcLoader::onTrigB(const JUTGamePad&) {
+ if (mpWaveArc != NULL && mpWaveArc->getStatus() == 2) {
+ mpWaveArc->erase();
+ }
+}
+
+void Z2WaveArcLoader::onTrigZ(const JUTGamePad&) {
+ mIsLoadTail = !mIsLoadTail;
+}
diff --git a/src/d/actor/d_a_e_fz.cpp b/src/d/actor/d_a_e_fz.cpp
index cefe6237cd..a48c4df8f0 100644
--- a/src/d/actor/d_a_e_fz.cpp
+++ b/src/d/actor/d_a_e_fz.cpp
@@ -3,16 +3,17 @@
* @brief Enemy - Mini Freezard
*/
-#include "d/dolzel_rel.h" // IWYU pragma: keep
+#include "d/dolzel_rel.h" // IWYU pragma: keep
+#include "SSystem/SComponent/c_math.h"
+#include "SSystem/SComponent/c_xyz.h"
+#include "d/actor/d_a_b_yo.h"
#include "d/actor/d_a_e_fz.h"
-#include "f_op/f_op_actor_enemy.h"
#include "d/actor/d_a_mirror.h"
-#include "d/actor/d_a_b_yo.h"
#include "d/d_com_inf_game.h"
#include "d/d_item.h"
-#include "SSystem/SComponent/c_math.h"
-#include "SSystem/SComponent/c_xyz.h"
+#include "f_op/f_op_actor_enemy.h"
+
class daE_FZ_HIO_c {
public:
@@ -42,26 +43,26 @@ namespace {
static dCcD_SrcSph cc_fz_src = {
{
- {0x0, {{0x100, 0x1, 0x0}, {0xd0fbfdff, 0x43}, 0x65}}, // mObj
- {dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
- {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x6}, // mGObjTg
- {0x0}, // mGObjCo
- }, // mObjInf
+ {0x0, {{0x100, 0x1, 0x0}, {0xd0fbfdff, 0x43}, 0x65}}, // mObj
+ {dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
+ {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x6}, // mGObjTg
+ {0x0}, // mGObjCo
+ }, // mObjInf
{
- {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph
- } // mSphAttr
+ {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph
+ } // mSphAttr
};
static dCcD_SrcSph cc_fz_at_src = {
{
- {0x0, {{0x100, 0x1, 0x1d}, {0x0, 0x0}, 0x0}}, // mObj
- {dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
- {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg
- {0x0}, // mGObjCo
- }, // mObjInf
+ {0x0, {{0x100, 0x1, 0x1d}, {0x0, 0x0}, 0x0}}, // mObj
+ {dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
+ {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg
+ {0x0}, // mGObjCo
+ }, // mObjInf
{
- {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph
- } // mSphAttr
+ {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph
+ } // mSphAttr
};
} // namespace
@@ -84,7 +85,7 @@ daE_FZ_HIO_c::daE_FZ_HIO_c() {
}
s32 daE_FZ_c::draw() {
- if (field_0x714 == 2 && !checkItemGet(dItemNo_IRONBALL_e,1)) {
+ if (field_0x714 == 2 && !checkItemGet(dItemNo_IRONBALL_e, 1)) {
return 1;
}
@@ -100,13 +101,13 @@ s32 daE_FZ_c::draw() {
pos.set(current.pos.x, current.pos.y + 10.0f, current.pos.z);
field_0x70c = dComIfGd_setShadow(field_0x70c, 1, model, &pos, 300.0f, 0.0f, current.pos.y,
- mObjAcch.GetGroundH(), mObjAcch.m_gnd, &tevStr,
- 0, 1.0f, &dDlst_shadowControl_c::mSimpleTexObj);
+ mObjAcch.GetGroundH(), mObjAcch.m_gnd, &tevStr, 0, 1.0f,
+ &dDlst_shadowControl_c::mSimpleTexObj);
return 1;
}
-static void daE_FZ_Draw(daE_FZ_c* i_this) {
- i_this->draw();
+static int daE_FZ_Draw(daE_FZ_c* i_this) {
+ return i_this->draw();
}
void daE_FZ_c::setActionMode(int i_actionMode, int i_actionPhase) {
@@ -136,7 +137,7 @@ void daE_FZ_c::mBoundSoundset() {
if (speed < 1)
speed = 1;
- mCreature.startCreatureSound(Z2SE_EN_FZ_BOUND,speed,-1);
+ mCreature.startCreatureSound(Z2SE_EN_FZ_BOUND, speed, -1);
}
void daE_FZ_c::deadnextSet(bool param_0) {
@@ -150,7 +151,7 @@ void daE_FZ_c::deadnextSet(bool param_0) {
}
mTgCoSph.ClrTgHit();
- fopAcM_OffStatus(this,0);
+ fopAcM_OffStatus(this, 0);
attention_info.flags &= ~fopAc_AttnFlag_BATTLE_e;
mAtSph.OffAtSetBit();
@@ -160,7 +161,7 @@ void daE_FZ_c::deadnextSet(bool param_0) {
speedF = 0.0f;
field_0x6fc = 0;
- setActionMode(ACT_DAMAGE,0);
+ setActionMode(ACT_DAMAGE, 0);
}
static u8 data_806C1BA0;
@@ -168,178 +169,186 @@ static u8 data_806C1BA0;
static daE_FZ_HIO_c l_HIO;
void daE_FZ_c::damage_check() {
- csXyz s_pos;
- cXyz pos;
- cXyz pos2;
- cXyz pos3;
-
- if (1 < health) {
- scale.set(l_HIO.field_0x0c, l_HIO.field_0x0c, l_HIO.field_0x0c);
- setMidnaBindEffect(this, &mCreature, &current.pos, &scale);
-
- if (field_0x712 == 0) {
- pos.set(dComIfGp_getPlayer(0)->current.pos);
- mStts.Move();
-
- if (field_0x714 == 3) {
- if (mTgCoSph.ChkTgHit()) {
- mAtInfo.mpCollider = mTgCoSph.GetTgHitObj();
-
- if (mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_IRON_BALL)) {
- deadnextSet(false);
- }
- }
- } else {
- if (mTgCoSph.ChkTgHit()) {
- mAtInfo.mpCollider = mTgCoSph.GetTgHitObj();
-
- if (mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_40) || mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_BOOMERANG)) {
- current.angle.y = fopAcM_searchPlayerAngleY(this) + 32768;
- f32 tmp_l_hio = l_HIO.field_0x28;
- speedF = tmp_l_hio;
- field_0x6fc = tmp_l_hio;
- mBoundSoundset();
- setActionMode(ACT_DAMAGE,1);
- return;
- }
-
- pos2 = current.pos - *mTgCoSph.GetTgHitPosP();
- pos3.set(*mTgCoSph.GetTgHitPosP());
-
- s_pos.x = 0;
- s_pos.y = pos2.atan2sX_Z();
- s_pos.z = 0;
+ csXyz s_pos;
+ cXyz pos;
+ cXyz pos2;
+ cXyz pos3;
- if (mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_SPINNER) || mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_ARROW)) {
- current.angle.y = fopAcM_searchPlayerAngleY(this) + 32768;
- f32 tmp_l_hio = l_HIO.field_0x28;
- speedF = tmp_l_hio;
- field_0x6fc = tmp_l_hio;
- mBoundSoundset();
- dComIfGp_setHitMark(2,this,&pos3,&s_pos,0,AT_TYPE_0);
- setActionMode(ACT_DAMAGE,1);
- return;
- }
+ if (1 < health) {
+ scale.set(l_HIO.field_0x0c, l_HIO.field_0x0c, l_HIO.field_0x0c);
+ setMidnaBindEffect(this, &mCreature, &current.pos, &scale);
- cXyz cStack_54(l_HIO.field_0x0c, l_HIO.field_0x0c, l_HIO.field_0x0c);
- dComIfGp_particle_set(0x85ba, &current.pos, &shape_angle, &cStack_54);
+ if (field_0x712 == 0) {
+ pos.set(dComIfGp_getPlayer(0)->current.pos);
+ mStts.Move();
- if (mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_HOOKSHOT)) {
- health -= 20;
+ if (field_0x714 == 3) {
+ if (mTgCoSph.ChkTgHit()) {
+ mAtInfo.mpCollider = mTgCoSph.GetTgHitObj();
- if (1 < health) {
- current.angle.y = fopAcM_searchPlayerAngleY(this) + 32768;
+ if (mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_IRON_BALL)) {
+ deadnextSet(false);
+ }
+ }
+ } else {
+ if (mTgCoSph.ChkTgHit()) {
+ mAtInfo.mpCollider = mTgCoSph.GetTgHitObj();
+
+ if (mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_40) ||
+ mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_BOOMERANG))
+ {
+ current.angle.y = fopAcM_searchPlayerAngleY(this) + 32768;
+ f32 tmp_l_hio = l_HIO.field_0x28;
+ speedF = tmp_l_hio;
+ field_0x6fc = tmp_l_hio;
+ mBoundSoundset();
+ setActionMode(ACT_DAMAGE, 1);
+ return;
+ }
- f32 tmp_l_hio = l_HIO.field_0x28;
- speedF = tmp_l_hio;
- field_0x6fc = tmp_l_hio;
- mCreature.startCreatureSound(Z2SE_EN_FZ_DAMAGE,0,-1);
+ pos2 = current.pos - *mTgCoSph.GetTgHitPosP();
+ pos3.set(*mTgCoSph.GetTgHitPosP());
+
+ s_pos.x = 0;
+ s_pos.y = pos2.atan2sX_Z();
+ s_pos.z = 0;
+
+ if (mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_SPINNER) ||
+ mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_ARROW))
+ {
+ current.angle.y = fopAcM_searchPlayerAngleY(this) + 32768;
+ f32 tmp_l_hio = l_HIO.field_0x28;
+ speedF = tmp_l_hio;
+ field_0x6fc = tmp_l_hio;
+ mBoundSoundset();
+ dComIfGp_setHitMark(2, this, &pos3, &s_pos, 0, AT_TYPE_0);
+ setActionMode(ACT_DAMAGE, 1);
+ return;
+ }
- f32 tmp_l_hio2 = l_HIO.field_0x28;
- speedF = tmp_l_hio2;
- field_0x6fc = tmp_l_hio2;
- setActionMode(ACT_DAMAGE,1);
- dComIfGp_setHitMark(3,this,&pos3,&s_pos,0,AT_TYPE_0);
- return;
- }
+ cXyz cStack_54(l_HIO.field_0x0c, l_HIO.field_0x0c, l_HIO.field_0x0c);
+ dComIfGp_particle_set(0x85ba, &current.pos, &shape_angle, &cStack_54);
- deadnextSet(true);
- dComIfGp_setHitMark(1,this,&pos3,&s_pos,0,AT_TYPE_0);
- return;
- }
+ if (mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_HOOKSHOT)) {
+ health -= 20;
- if (mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_IRON_BALL)) {
- deadnextSet(false);
- mTgCoSph.ClrTgHit();
- dComIfGp_setHitMark(3,this,&pos3,&s_pos,0,AT_TYPE_0);
- return;
- }
-
- cc_at_check(this,&mAtInfo);
-
- if (mAtInfo.mHitStatus == 0) {
- dComIfGp_setHitMark(1,this,&pos3,&s_pos,0,AT_TYPE_0);
- } else {
- dComIfGp_setHitMark(3,this,&pos3,&s_pos,0,AT_TYPE_0);
- }
-
- mLastWallHitAngle = mAtInfo.mHitDirection.y;
- setReflectAngle();
- current.angle.y += -32768;
- field_0x712 = 10;
-
- if (1 < health) {
- mCreature.startCreatureSound(Z2SE_EN_FZ_DAMAGE,0,-1);
- f32 tmp_l_hio = l_HIO.field_0x28;
- speedF = tmp_l_hio;
- field_0x6fc = tmp_l_hio;
- setActionMode(ACT_DAMAGE,1);
- return;
- }
+ if (1 < health) {
+ current.angle.y = fopAcM_searchPlayerAngleY(this) + 32768;
- deadnextSet(true);
- return;
- } else {
- if (mObjAcch.ChkGroundHit() && mTgCoSph.ChkCoHit()) {
- fopAc_ac_c* co_hit_actor = mTgCoSph.GetCoHitAc();
+ f32 tmp_l_hio = l_HIO.field_0x28;
+ speedF = tmp_l_hio;
+ field_0x6fc = tmp_l_hio;
+ mCreature.startCreatureSound(Z2SE_EN_FZ_DAMAGE, 0, -1);
- if (fopAcM_IsActor(co_hit_actor) && fopAcM_GetName(co_hit_actor) == fpcNm_E_FZ_e) {
- pos = current.pos - mTgCoSph.GetCoHitAc()->current.pos;
- mTgCoSph.ClrCoHit();
- f32 co_hit_actor_speed = co_hit_actor->speedF;
+ f32 tmp_l_hio2 = l_HIO.field_0x28;
+ speedF = tmp_l_hio2;
+ field_0x6fc = tmp_l_hio2;
+ setActionMode(ACT_DAMAGE, 1);
+ dComIfGp_setHitMark(3, this, &pos3, &s_pos, 0, AT_TYPE_0);
+ return;
+ }
- if (co_hit_actor_speed > l_HIO.field_0x28 * 0.2f || speedF > l_HIO.field_0x28 * 0.2f) {
- pos = current.pos - co_hit_actor->current.pos;
- mLastWallHitAngle = pos.atan2sX_Z();
- setReflectAngle();
+ deadnextSet(true);
+ dComIfGp_setHitMark(1, this, &pos3, &s_pos, 0, AT_TYPE_0);
+ return;
+ }
- f32 tmp2 = speedF;
- f32 tmp = co_hit_actor->speedF;
+ if (mTgCoSph.GetTgHitObj()->ChkAtType(AT_TYPE_IRON_BALL)) {
+ deadnextSet(false);
+ mTgCoSph.ClrTgHit();
+ dComIfGp_setHitMark(3, this, &pos3, &s_pos, 0, AT_TYPE_0);
+ return;
+ }
- if (speedF > tmp) {
- co_hit_actor->speedF = tmp2;
- static_cast<daE_FZ_c*>(co_hit_actor)->field_0x6fc = tmp2;
- } else {
- speedF = tmp;
- field_0x6fc = tmp;
- }
+ cc_at_check(this, &mAtInfo);
- mBoundSoundset();
- setActionMode(ACT_DAMAGE,5);
- return;
- }
- }
- }
+ if (mAtInfo.mHitStatus == 0) {
+ dComIfGp_setHitMark(1, this, &pos3, &s_pos, 0, AT_TYPE_0);
+ } else {
+ dComIfGp_setHitMark(3, this, &pos3, &s_pos, 0, AT_TYPE_0);
+ }
- if (mAtSph.ChkAtHit()) {
- fopAc_ac_c* player = dComIfGp_getPlayer(0);
- fopAc_ac_c* at_hit_actor = mAtSph.GetAtHitAc();
+ mLastWallHitAngle = mAtInfo.mHitDirection.y;
+ setReflectAngle();
+ current.angle.y += -32768;
+ field_0x712 = 10;
+
+ if (1 < health) {
+ mCreature.startCreatureSound(Z2SE_EN_FZ_DAMAGE, 0, -1);
+ f32 tmp_l_hio = l_HIO.field_0x28;
+ speedF = tmp_l_hio;
+ field_0x6fc = tmp_l_hio;
+ setActionMode(ACT_DAMAGE, 1);
+ return;
+ }
- current.angle.y = fopAcM_searchPlayerAngleY(this) + 32768;
+ deadnextSet(true);
+ return;
+ } else {
+ if (mObjAcch.ChkGroundHit() && mTgCoSph.ChkCoHit()) {
+ fopAc_ac_c* co_hit_actor = mTgCoSph.GetCoHitAc();
+
+ if (fopAcM_IsActor(co_hit_actor) &&
+ fopAcM_GetName(co_hit_actor) == fpcNm_E_FZ_e)
+ {
+ pos = current.pos - mTgCoSph.GetCoHitAc()->current.pos;
+ mTgCoSph.ClrCoHit();
+ f32 co_hit_actor_speed = co_hit_actor->speedF;
+
+ if (co_hit_actor_speed > l_HIO.field_0x28 * 0.2f ||
+ speedF > l_HIO.field_0x28 * 0.2f)
+ {
+ pos = current.pos - co_hit_actor->current.pos;
+ mLastWallHitAngle = pos.atan2sX_Z();
+ setReflectAngle();
+
+ f32 tmp2 = speedF;
+ f32 tmp = co_hit_actor->speedF;
+
+ if (speedF > tmp) {
+ co_hit_actor->speedF = tmp2;
+ static_cast<daE_FZ_c*>(co_hit_actor)->field_0x6fc = tmp2;
+ } else {
+ speedF = tmp;
+ field_0x6fc = tmp;
+ }
+
+ mBoundSoundset();
+ setActionMode(ACT_DAMAGE, 5);
+ return;
+ }
+ }
+ }
- if (player != at_hit_actor) {
- mAtSph.ClrAtHit();
- } else {
- if (mAtSph.ChkAtShieldHit()) {
- f32 l_hio_28 = l_HIO.field_0x28;
- speedF = l_hio_28;
- field_0x6fc = l_hio_28;
- setActionMode(ACT_DAMAGE,1);
-
- } else {
- if (mActionMode != ACT_DAMAGE) {
- field_0x712 = 10;
- setActionMode(ACT_DAMAGE,3);
+ if (mAtSph.ChkAtHit()) {
+ fopAc_ac_c* player = dComIfGp_getPlayer(0);
+ fopAc_ac_c* at_hit_actor = mAtSph.GetAtHitAc();
+
+ current.angle.y = fopAcM_searchPlayerAngleY(this) + 32768;
+
+ if (player != at_hit_actor) {
+ mAtSph.ClrAtHit();
+ } else {
+ if (mAtSph.ChkAtShieldHit()) {
+ f32 l_hio_28 = l_HIO.field_0x28;
+ speedF = l_hio_28;
+ field_0x6fc = l_hio_28;
+ setActionMode(ACT_DAMAGE, 1);
+
+ } else {
+ if (mActionMode != ACT_DAMAGE) {
+ field_0x712 = 10;
+ setActionMode(ACT_DAMAGE, 3);
+ }
+ }
+ mBoundSoundset();
+ mAtSph.ClrAtHit();
+ }
+ }
}
- }
- mBoundSoundset();
- mAtSph.ClrAtHit();
}
- }
}
- }
}
- }
}
bool daE_FZ_c::way_gake_check() {
@@ -350,13 +359,13 @@ bool daE_FZ_c::way_gake_check() {
return false;
}
- cMtx_YrotS((MtxP)calc_mtx,current.angle.y);
+ cMtx_YrotS((MtxP)calc_mtx, current.angle.y);
pos.x = 0.0f;
pos.y = 300.0f;
pos.z = 70.0f;
- MtxPosition(&pos,&field_0x6dc);
+ MtxPosition(&pos, &field_0x6dc);
field_0x6dc += current.pos;
field_0x6e8.set(field_0x6dc);
@@ -374,234 +383,231 @@ bool daE_FZ_c::way_gake_check() {
}
void daE_FZ_c::executeWait() {
- cXyz pos;
- cXyz pos2;
- s16 angle;
- f32 tmp = l_HIO.field_0x14;
-
- switch (mActionPhase) {
- case 0:
- if (fopAcM_wayBgCheck(this,200.0f,50.0f)) {
- angle = cM_rndFX(10000.0f) + 32768.0f;
- } else {
+ cXyz pos;
+ cXyz pos2;
+ s16 angle;
+ f32 tmp = l_HIO.field_0x14;
- pos2.x = home.pos.x + cM_rndFX(l_HIO.field_0x10);
- pos2.y = home.pos.y;
- pos2.z = home.pos.z + cM_rndFX(l_HIO.field_0x10);
+ switch (mActionPhase) {
+ case 0:
+ if (fopAcM_wayBgCheck(this, 200.0f, 50.0f)) {
+ angle = cM_rndFX(10000.0f) + 32768.0f;
+ } else {
+ pos2.x = home.pos.x + cM_rndFX(l_HIO.field_0x10);
+ pos2.y = home.pos.y;
+ pos2.z = home.pos.z + cM_rndFX(l_HIO.field_0x10);
- pos = pos2 - current.pos;
+ pos = pos2 - current.pos;
- angle = pos.atan2sX_Z() - current.angle.y;
+ angle = pos.atan2sX_Z() - current.angle.y;
- if (angle > 12288) {
- angle = 12288;
- }
- else {
- if (angle < -12288)
- angle = -12288;
- }
- }
+ if (angle > 12288) {
+ angle = 12288;
+ } else {
+ if (angle < -12288)
+ angle = -12288;
+ }
+ }
- mAngleFromPlayer = current.angle.y + angle;
- field_0x710 = l_HIO.field_0x06 + cM_rndFX(l_HIO.field_0x30);
- mActionPhase = 1;
- case 1:
- if (way_gake_check()) {
- pos2 = current.pos - home.pos;
- angle = pos2.atan2sX_Z();
- mAngleFromPlayer = angle;
- current.angle.y = angle;
- }
+ mAngleFromPlayer = current.angle.y + angle;
+ field_0x710 = l_HIO.field_0x06 + cM_rndFX(l_HIO.field_0x30);
+ mActionPhase = 1;
+ case 1:
+ if (way_gake_check()) {
+ pos2 = current.pos - home.pos;
+ angle = pos2.atan2sX_Z();
+ mAngleFromPlayer = angle;
+ current.angle.y = angle;
+ }
- if (field_0x714 == 4) {
- field_0x710 = 10;
- speedF = 0.0f;
- angle = fopAcM_searchPlayerAngleY(this);
- mAngleFromPlayer = angle;
- current.angle.y = angle;
- tmp = l_HIO.field_0x18;
- }
+ if (field_0x714 == 4) {
+ field_0x710 = 10;
+ speedF = 0.0f;
+ angle = fopAcM_searchPlayerAngleY(this);
+ mAngleFromPlayer = angle;
+ current.angle.y = angle;
+ tmp = l_HIO.field_0x18;
+ }
- if (mObjAcch.ChkGroundHit() && dComIfG_Bgsp().GetPolyAtt0(mObjAcch.m_gnd) == 8) {
- angle = shape_angle.y - mAngleFromPlayer;
+ if (mObjAcch.ChkGroundHit() && dComIfG_Bgsp().GetPolyAtt0(mObjAcch.m_gnd) == 8) {
+ angle = shape_angle.y - mAngleFromPlayer;
- if (abs(angle) < 512 && field_0x710 == 0) {
- cLib_addCalc0(&speedF, 0.1f, 0.1f);
+ if (abs(angle) < 512 && field_0x710 == 0) {
+ cLib_addCalc0(&speedF, 0.1f, 0.1f);
+ }
+ } else {
+ cLib_addCalc0(&speedF, 0.1f, l_HIO.field_0x2c);
}
- } else {
- cLib_addCalc0(&speedF,0.1f,l_HIO.field_0x2c);
- }
- if (field_0x710 == 0 && speedF < 0.2f) {
- angle = shape_angle.y - mAngleFromPlayer;
+ if (field_0x710 == 0 && speedF < 0.2f) {
+ angle = shape_angle.y - mAngleFromPlayer;
- if (abs(angle) < 512) {
- current.angle.y = shape_angle.y;
- setActionMode(ACT_MOVE,0);
- }
+ if (abs(angle) < 512) {
+ current.angle.y = shape_angle.y;
+ setActionMode(ACT_MOVE, 0);
+ }
+ }
}
- }
- cLib_addCalcAngleS2(&shape_angle.y,mAngleFromPlayer,8,1280);
+ cLib_addCalcAngleS2(&shape_angle.y, mAngleFromPlayer, 8, 1280);
- if (fopAcM_searchPlayerDistance(this) <= tmp && !way_gake_check()) {
- if (!fopAcM_otherBgCheck(this,dComIfGp_getPlayer(0))) {
- current.angle.y = shape_angle.y;
- setActionMode(ACT_ATTACK,0);
+ if (fopAcM_searchPlayerDistance(this) <= tmp && !way_gake_check()) {
+ if (!fopAcM_otherBgCheck(this, dComIfGp_getPlayer(0))) {
+ current.angle.y = shape_angle.y;
+ setActionMode(ACT_ATTACK, 0);
+ }
}
- }
}
void daE_FZ_c::executeMove() {
switch (mActionPhase) {
- case 0:
- field_0x710 = l_HIO.field_0x08 + cM_rndFX(l_HIO.field_0x34);
- mActionPhase = 1;
- case 1:
- cLib_addCalcAngleS2(&current.angle.y,mAngleFromPlayer,8,256);
- cLib_addCalc2(&speedF,l_HIO.field_0x1c,1.0f,3.0f);
-
- if (fopAcM_wayBgCheck(this, 200.0f,50.0f) != 0 || field_0x710 == 0) {
- setActionMode(ACT_WAIT,0);
- }
- default:
- if (way_gake_check()) {
- speedF = 0;
- setActionMode(ACT_WAIT,0);
- } else {
- shape_angle.y = current.angle.y;
+ case 0:
+ field_0x710 = l_HIO.field_0x08 + cM_rndFX(l_HIO.field_0x34);
+ mActionPhase = 1;
+ case 1:
+ cLib_addCalcAngleS2(&current.angle.y, mAngleFromPlayer, 8, 256);
+ cLib_addCalc2(&speedF, l_HIO.field_0x1c, 1.0f, 3.0f);
- if (fopAcM_searchPlayerDistance(this) <= l_HIO.field_0x14) {
- setActionMode(ACT_ATTACK,0);
- }
+ if (fopAcM_wayBgCheck(this, 200.0f, 50.0f) != 0 || field_0x710 == 0) {
+ setActionMode(ACT_WAIT, 0);
+ }
+ default:
+ if (way_gake_check()) {
+ speedF = 0;
+ setActionMode(ACT_WAIT, 0);
+ } else {
+ shape_angle.y = current.angle.y;
+
+ if (fopAcM_searchPlayerDistance(this) <= l_HIO.field_0x14) {
+ setActionMode(ACT_ATTACK, 0);
}
+ }
}
}
void daE_FZ_c::executeAttack() {
switch (mActionPhase) {
case 0:
- cLib_addCalcAngleS2(&current.angle.y,fopAcM_searchPlayerAngleY(this),8,0x300);
+ cLib_addCalcAngleS2(&current.angle.y, fopAcM_searchPlayerAngleY(this), 8, 0x300);
if (way_gake_check() == 0) {
- cLib_addCalc2(&speedF,l_HIO.field_0x20,0.7f,1.0f);
+ cLib_addCalc2(&speedF, l_HIO.field_0x20, 0.7f, 1.0f);
} else {
speedF = 0.0f;
}
default:
shape_angle.y = current.angle.y;
if (!(fopAcM_searchPlayerDistance(this) >= l_HIO.field_0x10)) {
- if (fopAcM_otherBgCheck(this,dComIfGp_getPlayer(0)) == 0) {
+ if (fopAcM_otherBgCheck(this, dComIfGp_getPlayer(0)) == 0) {
return;
}
}
}
- setActionMode(ACT_WAIT,0);
+ setActionMode(ACT_WAIT, 0);
}
void daE_FZ_c::executeDamage() {
- cXyz pos;
- pos.set(l_HIO.field_0x0c, l_HIO.field_0x0c, l_HIO.field_0x0c);
- f32 tmp;
-
- switch(mActionPhase) {
- case 0:
- dComIfGp_particle_set(0x85b8,&current.pos,&shape_angle,&pos);
- dComIfGp_particle_set(0x85b9,&current.pos,&shape_angle,&pos);
-
- if (field_0x714 != 3) {
- field_0x564 = 25;
- fopAcM_createItemFromEnemyID(field_0x564,&current.pos,-1,-1,0,0,0,0);
- } else {
- if (cM_rnd() < 0.2f) {
- fopAcM_createItem(&current.pos,0,-1,-1,0,0,0);
- }
- }
- fopAcM_delete(this);
- break;
- case 1:
- tmp = l_HIO.field_0x28;
- speedF = tmp;
- field_0x6fc = tmp;
- case 5:
- mStts.SetWeight(118);
- current.angle.y < 0 ? field_0x704 = 0 : field_0x704 = 1;
- mActionPhase = 2;
- case 2:
- if (mObjAcch.ChkGroundHit() && dComIfG_Bgsp().GetPolyAtt0(mObjAcch.m_gnd) == 8) {
- tmp = 0.2f;
- } else {
- tmp = 1.0f;
- }
+ cXyz pos;
+ pos.set(l_HIO.field_0x0c, l_HIO.field_0x0c, l_HIO.field_0x0c);
+ f32 tmp;
- cLib_addCalc0(&speedF,0.1f,tmp);
+ switch (mActionPhase) {
+ case 0:
+ dComIfGp_particle_set(0x85b8, &current.pos, &shape_angle, &pos);
+ dComIfGp_particle_set(0x85b9, &current.pos, &shape_angle, &pos);
- if (field_0x704 == 0) {
- s16 value = 4096.0f - (4096.0f / field_0x6fc) * (field_0x6fc - speedF);
- shape_angle.y -= value;
- } else {
- s16 value = 4096.0f - (4096.0f / field_0x6fc) * (field_0x6fc - speedF);
- shape_angle.y += value;
- }
+ if (field_0x714 != 3) {
+ field_0x564 = 25;
+ fopAcM_createItemFromEnemyID(field_0x564, &current.pos, -1, -1, 0, 0, 0, 0);
+ } else {
+ if (cM_rnd() < 0.2f) {
+ fopAcM_createItem(&current.pos, 0, -1, -1, 0, 0, 0);
+ }
+ }
+ fopAcM_delete(this);
+ break;
+ case 1:
+ tmp = l_HIO.field_0x28;
+ speedF = tmp;
+ field_0x6fc = tmp;
+ case 5:
+ mStts.SetWeight(118);
+ current.angle.y < 0 ? field_0x704 = 0 : field_0x704 = 1;
+ mActionPhase = 2;
+ case 2:
+ if (mObjAcch.ChkGroundHit() && dComIfG_Bgsp().GetPolyAtt0(mObjAcch.m_gnd) == 8) {
+ tmp = 0.2f;
+ } else {
+ tmp = 1.0f;
+ }
- if (mObjAcch.ChkWallHit()) {
- mLastWallHitAngle = mAcchCir.GetWallAngleY();
- setReflectAngle();
- mBoundSoundset();
- }
+ cLib_addCalc0(&speedF, 0.1f, tmp);
- if (speedF < 0.3f) {
- current.angle.y = shape_angle.y;
- mStts.SetWeight(100);
- setActionMode(ACT_WAIT,0);
- }
- break;
- case 3:
- mAngleFromPlayer = fopAcM_searchPlayerAngleY(this);
- if (current.angle.y < 0) {
- field_0x704 = 0;
- }
- else {
- field_0x704 = 1;
- }
- tmp = l_HIO.field_0x24;
- speedF = tmp;
- field_0x6fc = tmp;
- mActionPhase = 4;
- case 4:
- if (field_0x704 == 0) {
- s16 value = 4096.0f - (4096.0f / field_0x6fc) * (field_0x6fc - speedF);
- shape_angle.y -= value;
- }
- else {
- s16 value = 4096.0f - (4096.0f / field_0x6fc) * (field_0x6fc - speedF);
- shape_angle.y += value;
- }
+ if (field_0x704 == 0) {
+ s16 value = 4096.0f - (4096.0f / field_0x6fc) * (field_0x6fc - speedF);
+ shape_angle.y -= value;
+ } else {
+ s16 value = 4096.0f - (4096.0f / field_0x6fc) * (field_0x6fc - speedF);
+ shape_angle.y += value;
+ }
- cLib_addCalcAngleS2(&current.angle.y,mAngleFromPlayer,1,512);
- cLib_addCalc0(&speedF,0.1f,0.1f);
+ if (mObjAcch.ChkWallHit()) {
+ mLastWallHitAngle = mAcchCir.GetWallAngleY();
+ setReflectAngle();
+ mBoundSoundset();
+ }
- if (mObjAcch.ChkWallHit()) {
- mLastWallHitAngle = mAcchCir.GetWallAngleY();
- setReflectAngle();
- mBoundSoundset();
- }
+ if (speedF < 0.3f) {
+ current.angle.y = shape_angle.y;
+ mStts.SetWeight(100);
+ setActionMode(ACT_WAIT, 0);
+ }
+ break;
+ case 3:
+ mAngleFromPlayer = fopAcM_searchPlayerAngleY(this);
+ if (current.angle.y < 0) {
+ field_0x704 = 0;
+ } else {
+ field_0x704 = 1;
+ }
+ tmp = l_HIO.field_0x24;
+ speedF = tmp;
+ field_0x6fc = tmp;
+ mActionPhase = 4;
+ case 4:
+ if (field_0x704 == 0) {
+ s16 value = 4096.0f - (4096.0f / field_0x6fc) * (field_0x6fc - speedF);
+ shape_angle.y -= value;
+ } else {
+ s16 value = 4096.0f - (4096.0f / field_0x6fc) * (field_0x6fc - speedF);
+ shape_angle.y += value;
+ }
- if (speedF < 0.2f) {
- current.angle.y = shape_angle.y;
- setActionMode(ACT_ATTACK,0);
- }
- break;
- case 6:
- health = 0;
- if (field_0x710 == 1 || mObjAcch.ChkGroundHit()) {
- mActionPhase = 0;
+ cLib_addCalcAngleS2(&current.angle.y, mAngleFromPlayer, 1, 512);
+ cLib_addCalc0(&speedF, 0.1f, 0.1f);
+
+ if (mObjAcch.ChkWallHit()) {
+ mLastWallHitAngle = mAcchCir.GetWallAngleY();
+ setReflectAngle();
+ mBoundSoundset();
+ }
+
+ if (speedF < 0.2f) {
+ current.angle.y = shape_angle.y;
+ setActionMode(ACT_ATTACK, 0);
+ }
+ break;
+ case 6:
+ health = 0;
+ if (field_0x710 == 1 || mObjAcch.ChkGroundHit()) {
+ mActionPhase = 0;
+ }
}
- }
}
void daE_FZ_c::executeRollMove() {
- if (fopAcM_SearchByID(fopAcM_GetLinkId(this),&mpBlizzetaActor) == 0 || !mpBlizzetaActor) return;
+ if (fopAcM_SearchByID(fopAcM_GetLinkId(this), &mpBlizzetaActor) == 0 || !mpBlizzetaActor)
+ return;
u32 model_no = static_cast<daB_YO_c*>(mpBlizzetaActor)->getModelNo();
if (model_no < 4 || 6 < model_no) {
@@ -625,10 +631,10 @@ void daE_FZ_c::executeRollMove() {
field_0x710 = (20 - field_0x715) * 2;
case 1:
if (field_0x710 == 0) {
- cLib_chaseF(&mRadiusBase,1.0f,0.03f);
+ cLib_chaseF(&mRadiusBase, 1.0f, 0.03f);
}
- cLib_chaseAngleS(&field_0x704,1024,16);
+ cLib_chaseAngleS(&field_0x704, 1024, 16);
pos = mpBlizzetaActor->current.pos;
pos.x += (f32)(mode_rarius * cM_ssin(roll_angle + field_0x715 * 0xccc));
@@ -639,23 +645,24 @@ void daE_FZ_c::executeRollMove() {
if (static_cast<daB_YO_c*>(mpBlizzetaActor)->getFrizadAttack() == 3) {
mActionPhase = 2;
speedF = 60.0f;
- current.angle.y = cLib_targetAngleY(&static_cast<daB_YO_c*>(mpBlizzetaActor)->current.pos,&current.pos);
+ current.angle.y = cLib_targetAngleY(
+ &static_cast<daB_YO_c*>(mpBlizzetaActor)->current.pos, &current.pos);
}
break;
case 2:
- cLib_chaseF(&mRadiusBase,1.0,0.1);
- cLib_chaseAngleS(&field_0x704,512,16);
+ cLib_chaseF(&mRadiusBase, 1.0, 0.1);
+ cLib_chaseAngleS(&field_0x704, 512, 16);
if (mObjAcch.ChkWallHit() || !mObjAcch.ChkGroundHit()) {
- setActionMode(ACT_DAMAGE,0);
- mCreature.startCreatureSound(Z2SE_EN_FZ_DEATH,0,-1);
+ setActionMode(ACT_DAMAGE, 0);
+ mCreature.startCreatureSound(Z2SE_EN_FZ_DEATH, 0, -1);
return;
}
if (mAtSph.ChkAtHit()) {
fopAc_ac_c* at_hit_actor = mAtSph.GetAtHitAc();
if ((fopAcM_GetName(at_hit_actor) == fpcNm_ALINK_e) || mAtSph.ChkAtShieldHit()) {
- setActionMode(ACT_DAMAGE,0);
+ setActionMode(ACT_DAMAGE, 0);
return;
}
}
@@ -787,26 +794,26 @@ void daE_FZ_c::action() {
}
void daE_FZ_c::mtx_set() {
- mDoMtx_stack_c::transS(current.pos.x,current.pos.y,current.pos.z);
- mDoMtx_stack_c::ZXYrotM(shape_angle);
- mDoMtx_stack_c::scaleM(l_HIO.field_0x0c,l_HIO.field_0x0c,l_HIO.field_0x0c);
- mDoMtx_stack_c::scaleM(mRadiusBase,mRadiusBase,mRadiusBase);
- mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
+ mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
+ mDoMtx_stack_c::ZXYrotM(shape_angle);
+ mDoMtx_stack_c::scaleM(l_HIO.field_0x0c, l_HIO.field_0x0c, l_HIO.field_0x0c);
+ mDoMtx_stack_c::scaleM(mRadiusBase, mRadiusBase, mRadiusBase);
+ mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
}
void daE_FZ_c::cc_set() {
cXyz pos;
cXyz pos2;
- pos.set(0.0f,60.0f,0.0f);
- mDoMtx_stack_c::multVec(&pos,&eyePos);
+ pos.set(0.0f, 60.0f, 0.0f);
+ mDoMtx_stack_c::multVec(&pos, &eyePos);
attention_info.position = eyePos;
attention_info.position.y += 25.0f;
mDoMtx_stack_c::copy(mpModel->getBaseTRMtx());
- pos.set(0.0f,40.0f,0.0f);
- mDoMtx_stack_c::multVec(&pos,&pos2);
+ pos.set(0.0f, 40.0f, 0.0f);
+ mDoMtx_stack_c::multVec(&pos, &pos2);
mTgCoSph.SetC(pos2);
mTgCoSph.SetR(mRadiusBase * 60.0f);
@@ -815,8 +822,8 @@ void daE_FZ_c::cc_set() {
mDoMtx_stack_c::copy(mpModel->getBaseTRMtx());
- pos.set(0.0f,25.0f,0.0f);
- mDoMtx_stack_c::multVec(&pos,&pos2);
+ pos.set(0.0f, 25.0f, 0.0f);
+ mDoMtx_stack_c::multVec(&pos, &pos2);
mAtSph.SetC(pos2);
mAtSph.SetR(mRadiusBase * 40.0f);
@@ -826,16 +833,16 @@ void daE_FZ_c::cc_set() {
s32 daE_FZ_c::execute() {
if (field_0x714 == 2) {
- if (checkItemGet(dItemNo_IRONBALL_e,1) == 0) {
+ if (checkItemGet(dItemNo_IRONBALL_e, 1) == 0) {
return 1;
}
if (attention_info.distances[fopAc_attn_BATTLE_e] == 0) {
attention_info.distances[fopAc_attn_BATTLE_e] = 69;
- fopAcM_SetGroup(this,2);
- #if DEBUG
- fopAcM_OnStatus(this,0);
- #endif
+ fopAcM_SetGroup(this, 2);
+#if DEBUG
+ fopAcM_OnStatus(this, 0);
+#endif
attention_info.flags |= fopAc_AttnFlag_BATTLE_e;
}
}
@@ -849,9 +856,9 @@ s32 daE_FZ_c::execute() {
if (field_0x712 != 0)
field_0x712 -= 1;
- action(); // set current action
- mtx_set(); // update model matrix
- cc_set(); // update sphere colliders
+ action(); // set current action
+ mtx_set(); // update model matrix
+ cc_set(); // update sphere colliders
mCreature.framework(0, dComIfGp_getReverb(fopAcM_GetRoomNo(this)));
@@ -875,8 +882,8 @@ s32 daE_FZ_c::execute() {
return 1;
}
-static void daE_FZ_Execute(daE_FZ_c* i_this) {
- i_this->execute();
+static int daE_FZ_Execute(daE_FZ_c* i_this) {
+ return i_this->execute();
}
void daE_FZ_c::demoDelete() {
@@ -887,12 +894,12 @@ void daE_FZ_c::demoDelete() {
fopAcM_delete(this);
}
-static bool daE_FZ_IsDelete(daE_FZ_c* i_this) {
- return true;
+static int daE_FZ_IsDelete(daE_FZ_c* i_this) {
+ return 1;
}
s32 daE_FZ_c::_delete() {
- dComIfG_resDelete(&mPhaseReq,"E_FZ");
+ dComIfG_resDelete(&mPhaseReq, "E_FZ");
if (field_0xc21 != 0) {
data_806C1BA0 = 0;
@@ -905,8 +912,8 @@ s32 daE_FZ_c::_delete() {
return 1;
}
-static void daE_FZ_Delete(daE_FZ_c* i_this) {
- i_this->_delete();
+static int daE_FZ_Delete(daE_FZ_c* i_this) {
+ return i_this->_delete();
}
s32 daE_FZ_c::CreateHeap() {
@@ -921,122 +928,120 @@ s32 daE_FZ_c::CreateHeap() {
}
static int useHeapInit(fopAc_ac_c* i_this) {
- return static_cast<daE_FZ_c*>(i_this)->CreateHeap();
+ return static_cast<daE_FZ_c*>(i_this)->CreateHeap();
}
s32 daE_FZ_c::create() {
- fopAcM_ct(this,daE_FZ_c);
+ fopAcM_ct(this, daE_FZ_c);
- s32 phase = dComIfG_resLoad(&mPhaseReq,"E_FZ");
- if (phase == cPhs_COMPLEATE_e) {
- if (!fopAcM_entrySolidHeap(this,useHeapInit,6480)) {
- return cPhs_ERROR_e;
- }
- if (data_806C1BA0 == 0) {
- data_806C1BA0 = 1;
- field_0xc21 = 1;
- l_HIO.field_0x04 = -1;
- }
+ s32 phase = dComIfG_resLoad(&mPhaseReq, "E_FZ");
+ if (phase == cPhs_COMPLEATE_e) {
+ if (!fopAcM_entrySolidHeap(this, useHeapInit, 6480)) {
+ return cPhs_ERROR_e;
+ }
+ if (data_806C1BA0 == 0) {
+ data_806C1BA0 = 1;
+ field_0xc21 = 1;
+ l_HIO.field_0x04 = -1;
+ }
- attention_info.flags = fopAc_AttnFlag_BATTLE_e;
- attention_info.distances[fopAc_attn_BATTLE_e] = 69;
+ attention_info.flags = fopAc_AttnFlag_BATTLE_e;
+ attention_info.distances[fopAc_attn_BATTLE_e] = 69;
- fopAcM_SetMtx(this,mpModel->getBaseTRMtx());
- fopAcM_SetMin(this,-200.0f,-200.0f,-200.0f);
- fopAcM_SetMax(this,200.0f,200.0f,200.0f);
+ fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
+ fopAcM_SetMin(this, -200.0f, -200.0f, -200.0f);
+ fopAcM_SetMax(this, 200.0f, 200.0f, 200.0f);
- mStts.Init(100,0,this);
- health = 80;
- field_0x560 = 80;
+ mStts.Init(100, 0, this);
+ health = 80;
+ field_0x560 = 80;
- field_0x714 = fopAcM_GetParam(this);
- field_0x715 = fopAcM_GetParam(this) >> 8;
+ field_0x714 = fopAcM_GetParam(this);
+ field_0x715 = fopAcM_GetParam(this) >> 8;
- if (field_0x714 == 255)
- field_0x714 = 0;
+ if (field_0x714 == 255)
+ field_0x714 = 0;
- if (field_0x714 == 1 || field_0x714 == 3) {
- speed.y = cM_rndFX(10.0f) + 30.0f;
- f32 rng = cM_rndFX(1.0f);
- speedF = rng + 4.0f;
- field_0x6fc = rng + 4.0f;
- if (field_0x714 == 1) {
- fopAcM_OnStatus(this,fopAcStts_UNK_0x4000_e);
- }
- }
+ if (field_0x714 == 1 || field_0x714 == 3) {
+ speed.y = cM_rndFX(10.0f) + 30.0f;
+ f32 rng = cM_rndFX(1.0f);
+ speedF = rng + 4.0f;
+ field_0x6fc = rng + 4.0f;
+ if (field_0x714 == 1) {
+ fopAcM_OnStatus(this, fopAcStts_UNK_0x4000_e);
+ }
+ }
- mObjAcch.Set(fopAcM_GetPosition_p(this),fopAcM_GetOldPosition_p(this), this, 1, &mAcchCir, fopAcM_GetSpeed_p(this), 0, 0);
+ mObjAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, &mAcchCir,
+ fopAcM_GetSpeed_p(this), 0, 0);
- if (field_0x714 == 3) {
- mAcchCir.SetWall(35.0f,70.0f);
- }
- else {
- mAcchCir.SetWall(20.0f,60.0f);
- }
+ if (field_0x714 == 3) {
+ mAcchCir.SetWall(35.0f, 70.0f);
+ } else {
+ mAcchCir.SetWall(20.0f, 60.0f);
+ }
- mObjAcch.CrrPos(dComIfG_Bgsp());
+ mObjAcch.CrrPos(dComIfG_Bgsp());
- mTgCoSph.Set(cc_fz_src);
- mTgCoSph.SetStts(&mStts);
+ mTgCoSph.Set(cc_fz_src);
+ mTgCoSph.SetStts(&mStts);
- mAtSph.Set(cc_fz_at_src);
- mAtSph.SetStts(&mStts);
+ mAtSph.Set(cc_fz_at_src);
+ mAtSph.SetStts(&mStts);
- mCreature.init(&current.pos,&eyePos,3,1);
- mCreature.setEnemyName("E_fz");
+ mCreature.init(&current.pos, &eyePos, 3, 1);
+ mCreature.setEnemyName("E_fz");
- mAtInfo.mpSound = &mCreature;
- mAtInfo.mPowerType = 1;
+ mAtInfo.mpSound = &mCreature;
+ mAtInfo.mPowerType = 1;
- gravity = -5.0f;
+ gravity = -5.0f;
- shape_angle.z = 0;
- shape_angle.x = 0;
+ shape_angle.z = 0;
+ shape_angle.x = 0;
- s16 random = cM_rndFX(10000.0f);
- shape_angle.y = random;
- current.angle.y = random;
+ s16 random = cM_rndFX(10000.0f);
+ shape_angle.y = random;
+ current.angle.y = random;
- field_0x670.set(current.pos);
+ field_0x670.set(current.pos);
- for (int i = 0; i < 4; i++) {
- field_0x67c[i].set(current.pos);
- }
+ for (int i = 0; i < 4; i++) {
+ field_0x67c[i].set(current.pos);
+ }
- if (field_0x714 == 2 && !checkItemGet(dItemNo_IRONBALL_e,1)) {
- attention_info.distances[fopAc_attn_BATTLE_e] = 0;
- fopAcM_SetGroup(this,0);
- fopAcM_OffStatus(this,0);
- attention_info.flags &= ~fopAc_AttnFlag_BATTLE_e;
- }
+ if (field_0x714 == 2 && !checkItemGet(dItemNo_IRONBALL_e, 1)) {
+ attention_info.distances[fopAc_attn_BATTLE_e] = 0;
+ fopAcM_SetGroup(this, 0);
+ fopAcM_OffStatus(this, 0);
+ attention_info.flags &= ~fopAc_AttnFlag_BATTLE_e;
+ }
- if (field_0x714 == 3) {
- mRadiusBase = 0.0f;
- attention_info.flags &= ~fopAc_AttnFlag_BATTLE_e;
- mAtSph.SetAtType(AT_TYPE_CSTATUE_SWING);
- mAtSph.SetAtSpl(dCcG_At_Spl_UNK_1);
- setActionMode(ACT_ROLLMOVE,0);
- } else {
- mAtSph.SetAtMtrl(dCcD_MTRL_ICE);
- mRadiusBase = 1.0f;
- cM_rnd() < 0.5f ? setActionMode(ACT_WAIT,0) : setActionMode(ACT_MOVE,0);
- }
+ if (field_0x714 == 3) {
+ mRadiusBase = 0.0f;
+ attention_info.flags &= ~fopAc_AttnFlag_BATTLE_e;
+ mAtSph.SetAtType(AT_TYPE_CSTATUE_SWING);
+ mAtSph.SetAtSpl(dCcG_At_Spl_UNK_1);
+ setActionMode(ACT_ROLLMOVE, 0);
+ } else {
+ mAtSph.SetAtMtrl(dCcD_MTRL_ICE);
+ mRadiusBase = 1.0f;
+ cM_rnd() < 0.5f ? setActionMode(ACT_WAIT, 0) : setActionMode(ACT_MOVE, 0);
+ }
- mtx_set();
- }
+ mtx_set();
+ }
- return phase;
+ return phase;
}
-static void daE_FZ_Create(daE_FZ_c* i_this) {
- i_this->create();
+static int daE_FZ_Create(daE_FZ_c* i_this) {
+ return i_this->create();
}
static actor_method_class l_daE_FZ_Method = {
- (process_method_func)daE_FZ_Create,
- (process_method_func)daE_FZ_Delete,
- (process_method_func)daE_FZ_Execute,
- (process_method_func)daE_FZ_IsDelete,
+ (process_method_func)daE_FZ_Create, (process_method_func)daE_FZ_Delete,
+ (process_method_func)daE_FZ_Execute, (process_method_func)daE_FZ_IsDelete,
(process_method_func)daE_FZ_Draw,
};
diff --git a/src/d/actor/d_a_e_oc.cpp b/src/d/actor/d_a_e_oc.cpp
index bac4901f68..2a81709609 100644
--- a/src/d/actor/d_a_e_oc.cpp
+++ b/src/d/actor/d_a_e_oc.cpp
@@ -189,8 +189,8 @@ int daE_OC_c::draw() {
return 1;
}
-static void daE_OC_Draw(daE_OC_c* i_this) {
- i_this->draw();
+static int daE_OC_Draw(daE_OC_c* i_this) {
+ return i_this->draw();
}
daE_OC_c* E_OC_n::m_battle_oc;
@@ -2639,12 +2639,12 @@ int daE_OC_c::execute() {
return 1;
}
-static void daE_OC_Execute(daE_OC_c* i_this) {
- i_this->execute();
+static int daE_OC_Execute(daE_OC_c* i_this) {
+ return i_this->execute();
}
-static bool daE_OC_IsDelete(daE_OC_c* param_0) {
- return true;
+static int daE_OC_IsDelete(daE_OC_c* param_0) {
+ return 1;
}
int daE_OC_c::_delete() {
@@ -2662,9 +2662,9 @@ int daE_OC_c::_delete() {
return 1;
}
-static void daE_OC_Delete(daE_OC_c* i_this) {
+static int daE_OC_Delete(daE_OC_c* i_this) {
fopAcM_RegisterDeleteID(i_this, "E_OC");
- i_this->_delete();
+ return i_this->_delete();
}
int daE_OC_c::CreateHeap() {
@@ -2833,8 +2833,8 @@ cPhs_Step daE_OC_c::create() {
return phase;
}
-static void daE_OC_Create(daE_OC_c* i_this) {
- i_this->create();
+static int daE_OC_Create(daE_OC_c* i_this) {
+ return i_this->create();
}
static actor_method_class l_daE_OC_Method = {
diff --git a/src/d/actor/d_a_e_zs.cpp b/src/d/actor/d_a_e_zs.cpp
index fea09e166a..b17ca8f438 100644
--- a/src/d/actor/d_a_e_zs.cpp
+++ b/src/d/actor/d_a_e_zs.cpp
@@ -495,8 +495,8 @@ int daE_ZS_c::CreateHeap() {
return 1;
}
-static void useHeapInit(fopAc_ac_c* i_this) {
- static_cast<daE_ZS_c*>(i_this)->CreateHeap();
+static int useHeapInit(fopAc_ac_c* i_this) {
+ return static_cast<daE_ZS_c*>(i_this)->CreateHeap();
}
int daE_ZS_c::create() {
@@ -504,7 +504,7 @@ int daE_ZS_c::create() {
int phase = dComIfG_resLoad(&mPhase, "E_ZS");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_ZS PARAM %x\n", fopAcM_GetParam(this));
- if (!fopAcM_entrySolidHeap(this, (heapCallbackFunc)useHeapInit, 0xFC0)) {
+ if (!fopAcM_entrySolidHeap(this, useHeapInit, 0xFC0)) {
return cPhs_ERROR_e;
}
diff --git a/src/d/actor/d_a_myna.cpp b/src/d/actor/d_a_myna.cpp
index 064096cd1b..3833fe2034 100644
--- a/src/d/actor/d_a_myna.cpp
+++ b/src/d/actor/d_a_myna.cpp
@@ -74,9 +74,9 @@ static char* l_bckFileNameTBL[] = {
static char* l_btpFileNameTBL[] = {"MYNA.btp"};
-static void createHeapCallBack(fopAc_ac_c* i_this) {
+static int createHeapCallBack(fopAc_ac_c* i_this) {
daMyna_c* a_this = static_cast<daMyna_c*>(i_this);
- a_this->createHeap();
+ return a_this->createHeap();
}
static int jntNodeCallBack(J3DJoint* i_jnt, int param_1) {
@@ -339,7 +339,7 @@ int daMyna_c::create() {
return phase;
}
- if (!fopAcM_entrySolidHeap(this, (heapCallbackFunc)&createHeapCallBack, 0x21F0)) {
+ if (!fopAcM_entrySolidHeap(this, createHeapCallBack, 0x21F0)) {
return cPhs_ERROR_e;
}
diff --git a/src/d/actor/d_a_npc_sola.cpp b/src/d/actor/d_a_npc_sola.cpp
index a70746c4f1..0bac7e4fb6 100644
--- a/src/d/actor/d_a_npc_sola.cpp
+++ b/src/d/actor/d_a_npc_sola.cpp
@@ -194,14 +194,13 @@ int daNpc_solA_c::Execute() {
return execute();
}
-void daNpc_solA_c::Draw() {
+int daNpc_solA_c::Draw() {
if (mpMatAnm[0] != NULL) {
J3DModelData* mdlData_p = mpMorf[0]->getModel()->getModelData();
mdlData_p->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm[0]);
}
- draw(FALSE, FALSE, mpHIO->m.common.real_shadow_size, NULL, 100.0f, FALSE, FALSE,
- FALSE);
- return;
+
+ return draw(FALSE, FALSE, mpHIO->m.common.real_shadow_size, NULL, 100.0f, FALSE, FALSE, FALSE);
}
BOOL daNpc_solA_c::createHeapCallBack(fopAc_ac_c* a_this) {
@@ -481,12 +480,12 @@ static int daNpc_solA_Execute(void* param_0) {
return static_cast<daNpc_solA_c*>(param_0)->Execute();
}
-static void daNpc_solA_Draw(void* param_0) {
+static int daNpc_solA_Draw(void* param_0) {
return static_cast<daNpc_solA_c*>(param_0)->Draw();
}
-static bool daNpc_solA_IsDelete(void* param_0) {
- return true;
+static int daNpc_solA_IsDelete(void* param_0) {
+ return 1;
}
static actor_method_class daNpc_solA_MethodTable = {
diff --git a/src/d/actor/d_a_obj_Y_taihou.cpp b/src/d/actor/d_a_obj_Y_taihou.cpp
index ab9d2bf4cf..61f96a12ab 100644
--- a/src/d/actor/d_a_obj_Y_taihou.cpp
+++ b/src/d/actor/d_a_obj_Y_taihou.cpp
@@ -356,21 +356,21 @@ int daObjYtaihou_c::Delete() {
return 1;
}
-static void daObjYtaihou_create1st(daObjYtaihou_c* i_this) {
+static int daObjYtaihou_create1st(daObjYtaihou_c* i_this) {
fopAcM_ct(i_this, daObjYtaihou_c);
- i_this->create1st();
+ return i_this->create1st();
}
-static void daObjYtaihou_MoveBGDelete(daObjYtaihou_c* i_this) {
- i_this->MoveBGDelete();
+static int daObjYtaihou_MoveBGDelete(daObjYtaihou_c* i_this) {
+ return i_this->MoveBGDelete();
}
-static void daObjYtaihou_MoveBGExecute(daObjYtaihou_c* i_this) {
- i_this->MoveBGExecute();
+static int daObjYtaihou_MoveBGExecute(daObjYtaihou_c* i_this) {
+ return i_this->MoveBGExecute();
}
-static void daObjYtaihou_MoveBGDraw(daObjYtaihou_c* i_this) {
- i_this->Draw();
+static int daObjYtaihou_MoveBGDraw(daObjYtaihou_c* i_this) {
+ return i_this->Draw();
}
static actor_method_class daObjYtaihou_METHODS = {
diff --git a/src/d/actor/d_a_obj_fan.cpp b/src/d/actor/d_a_obj_fan.cpp
index 40d196706e..a3eb23a200 100644
--- a/src/d/actor/d_a_obj_fan.cpp
+++ b/src/d/actor/d_a_obj_fan.cpp
@@ -310,9 +310,9 @@ int daObjFan_c::Delete() {
return 1;
}
-static void daObjFan_create1st(daObjFan_c* param_0) {
+static int daObjFan_create1st(daObjFan_c* param_0) {
fopAcM_ct(param_0, daObjFan_c);
- param_0->create1st();
+ return param_0->create1st();
}
static int daObjFan_MoveBGDelete(daObjFan_c* param_0) {
diff --git a/src/d/actor/d_a_obj_inobone.cpp b/src/d/actor/d_a_obj_inobone.cpp
index d73c5e5f9f..2076405828 100644
--- a/src/d/actor/d_a_obj_inobone.cpp
+++ b/src/d/actor/d_a_obj_inobone.cpp
@@ -89,8 +89,8 @@ static void* s_boar_sub(void* i_actor, void* i_data) {
return NULL;
}
-static void CheckCreateHeap(fopAc_ac_c* i_this) {
- static_cast<daObjIBone_c*>(i_this)->CreateHeap();
+static int CheckCreateHeap(fopAc_ac_c* i_this) {
+ return static_cast<daObjIBone_c*>(i_this)->CreateHeap();
}
void daObjIBone_c::initBaseMtx() {
@@ -150,7 +150,7 @@ int daObjIBone_c::create() {
int result = dComIfG_resLoad(&mPhase, l_arcName);
if (result == cPhs_COMPLEATE_e) {
- if (!fopAcM_entrySolidHeap(this, (heapCallbackFunc)CheckCreateHeap, 0x860)) {
+ if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x860)) {
return cPhs_ERROR_e;
} else if (!Create()) {
return cPhs_ERROR_e;
diff --git a/src/d/actor/d_a_obj_stick.cpp b/src/d/actor/d_a_obj_stick.cpp
index 69878c10c5..d6aa8d1e22 100644
--- a/src/d/actor/d_a_obj_stick.cpp
+++ b/src/d/actor/d_a_obj_stick.cpp
@@ -198,24 +198,24 @@ void daObj_Stick_c::setMtx() {
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
}
-static u32 daObj_Stick_Create(void* i_this) {
+static int daObj_Stick_Create(void* i_this) {
return static_cast<daObj_Stick_c*>(i_this)->create();
}
-static void daObj_Stick_Delete(void* param_0) {
- static_cast<daObj_Stick_c*>(param_0)->Delete();
+static int daObj_Stick_Delete(void* param_0) {
+ return static_cast<daObj_Stick_c*>(param_0)->Delete();
}
-static void daObj_Stick_Execute(void* param_0) {
- static_cast<daObj_Stick_c*>(param_0)->Execute();
+static int daObj_Stick_Execute(void* param_0) {
+ return static_cast<daObj_Stick_c*>(param_0)->Execute();
}
-static void daObj_Stick_Draw(void* param_0) {
- static_cast<daObj_Stick_c*>(param_0)->Draw();
+static int daObj_Stick_Draw(void* param_0) {
+ return static_cast<daObj_Stick_c*>(param_0)->Draw();
}
-static bool daObj_Stick_IsDelete(void* param_0) {
- return true;
+static int daObj_Stick_IsDelete(void* param_0) {
+ return 1;
}
static actor_method_class daObj_Stick_MethodTable = {
diff --git a/src/d/actor/d_a_peru.cpp b/src/d/actor/d_a_peru.cpp
index 51a1c7ba75..add706d4d7 100644
--- a/src/d/actor/d_a_peru.cpp
+++ b/src/d/actor/d_a_peru.cpp
@@ -34,60 +34,40 @@ static s8* l_loadResPtrnList[3] = {
l_loadResPtrn0,
};
-static u8 l_faceMotionAnmData[140] = {
- 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E,
- 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x02,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1F,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[5] = {
+ {-1, 0, 0, 30, 2, 1, 1},
+ {10, 0, 1, 30, 2, 1, 1},
+ {8, 2, 1, 32, 2, 1, 0},
+ {9, 0, 1, 33, 0, 1, 0},
+ {7, 0, 1, 31, 0, 1, 0},
};
-static u8 l_motionAnmData[308] = {
- 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1B,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11,
- 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x02,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1B,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
- 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1B,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x01, 0x00, 0x00,
+static daNpcT_motionAnmData_c l_motionAnmData[11] = {
+ {20, 2, 1, 27, 0, 1, 1, 0},
+ {17, 2, 1, 27, 0, 1, 1, 0},
+ {18, 2, 1, 27, 0, 1, 1, 0},
+ {21, 2, 1, 27, 0, 1, 1, 0},
+ {16, 2, 1, 27, 0, 1, 1, 0},
+ {15, 2, 1, 27, 0, 1, 1, 0},
+ {19, 0, 1, 27, 0, 1, 1, 0},
+ {13, 0, 1, 27, 0, 1, 1, 0},
+ {14, 2, 1, 27, 0, 1, 1, 0},
+ {12, 0, 1, 27, 0, 1, 1, 0},
+ {11, 0, 1, 27, 0, 1, 1, 0},
};
-static u8 l_faceMotionSequenceData[80] = {
- 0x00, 0x01, 0xFF, 0x01, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x02, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x03, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x04, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
+static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = {
+ {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
+ {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
+ {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
};
-static u8 l_motionSequenceData[160] = {
- 0x00, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x01, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x02, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x05, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x06, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x07, 0xFF, 0x00, 0x00, 0x08, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x09, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x0A, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x03, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
- 0x00, 0x04, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
+static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[40] = {
+ {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
+ {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
+ {6, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 0}, {8, -1, 0}, {-1, 0, 0}, {-1, 0, 0},
+ {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {10, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
+ {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
};
const char* daPeru_c::mCutNameList[3] = {
diff --git a/src/d/actor/d_a_tag_magne.cpp b/src/d/actor/d_a_tag_magne.cpp
index 8b47511eeb..ca74c0655a 100644
--- a/src/d/actor/d_a_tag_magne.cpp
+++ b/src/d/actor/d_a_tag_magne.cpp
@@ -44,15 +44,15 @@ int daTagMagne_c::_delete() {
return 1;
}
-static void daTagMagne_Delete(daTagMagne_c* i_this) {
+static int daTagMagne_Delete(daTagMagne_c* i_this) {
int id = fopAcM_GetID(i_this);
- i_this->_delete();
+ return i_this->_delete();
}
-static void daTagMagne_Create(fopAc_ac_c* i_this) {
+static int daTagMagne_Create(fopAc_ac_c* i_this) {
daTagMagne_c* magne = static_cast<daTagMagne_c*>(i_this);
int id = fopAcM_GetID(i_this);
- magne->create();
+ return magne->create();
}
static actor_method_class l_daTagMagne_Method = {
diff --git a/src/d/d_cursor_mng.cpp b/src/d/d_cursor_mng.cpp
index 223d01bffc..d5586091d1 100644
--- a/src/d/d_cursor_mng.cpp
+++ b/src/d/d_cursor_mng.cpp
@@ -315,7 +315,7 @@ void dCsr_mng_c::bloObj_c::calcPaneObjNum(J2DPane* i_pane) {
}
JSUTreeIterator<J2DPane> iter = i_pane->getPaneTree()->getFirstChild();
- while (iter != NULL) {
+ while (iter) {
calcPaneObjNum(*iter);
++iter;
}
@@ -331,7 +331,7 @@ void dCsr_mng_c::bloObj_c::createPaneObj(paneObj_c** i_panes, J2DPane* i_pane) {
}
JSUTreeIterator<J2DPane> iter = i_pane->getPaneTree()->getFirstChild();
- while (iter != NULL) {
+ while (iter) {
createPaneObj(i_panes, *iter);
++iter;
}