mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-02 16:26:42 -04:00
Merge pull request #548 from Jcw87/other_compilers
Improve compatibility with other compilers
This commit is contained in:
@@ -390,7 +390,7 @@ bool daArrow_c::check_water_in() {
|
||||
waterHitPos = (next.pos * weight) + (current.pos * (1.0f - weight));
|
||||
}
|
||||
|
||||
mCurrProcFunc = &procWater;
|
||||
mCurrProcFunc = &daArrow_c::procWater;
|
||||
fopAcM_SetParam(this, 4);
|
||||
|
||||
if (mArrowType == TYPE_FIRE) {
|
||||
@@ -620,7 +620,7 @@ BOOL daArrow_c::procWait() {
|
||||
checkRestMp();
|
||||
}
|
||||
|
||||
mCurrProcFunc = &procMove;
|
||||
mCurrProcFunc = &daArrow_c::procMove;
|
||||
arrowShooting();
|
||||
}
|
||||
|
||||
@@ -678,7 +678,7 @@ BOOL daArrow_c::procMove() {
|
||||
dKy_arrowcol_chg_on(¤t.pos, 2);
|
||||
}
|
||||
|
||||
mCurrProcFunc = &procStop_BG;
|
||||
mCurrProcFunc = &daArrow_c::procStop_BG;
|
||||
fopAcM_OnStatus(this, fopAcStts_UNK4000_e);
|
||||
fopAcM_SetParam(this, 2);
|
||||
field_0x604 = 0x28;
|
||||
@@ -729,7 +729,7 @@ BOOL daArrow_c::procMove() {
|
||||
|
||||
if (hitType == 1) { // Blocked hit
|
||||
fopAcM_SetParam(this, 3);
|
||||
mCurrProcFunc = &procReturn;
|
||||
mCurrProcFunc = &daArrow_c::procReturn;
|
||||
speed *= -0.1f;
|
||||
speed.y += speed.absXZ();
|
||||
current.pos = next.pos;
|
||||
@@ -740,7 +740,7 @@ BOOL daArrow_c::procMove() {
|
||||
fopAcM_seStartCurrent(this, JA_SE_LK_ARROW_REBOUND, 0x20);
|
||||
} else if (hitType == 2) { // Hit a joint
|
||||
fpcM_SetParam(this, 2);
|
||||
mCurrProcFunc = &procStop_Actor;
|
||||
mCurrProcFunc = &daArrow_c::procStop_Actor;
|
||||
|
||||
if (mArrowType == TYPE_FIRE) {
|
||||
fopAcM_seStartCurrent(this, JA_SE_OBJ_FIRE_ARW_EFF, 0);
|
||||
@@ -779,7 +779,7 @@ BOOL daArrow_c::procMove() {
|
||||
dKy_arrowcol_chg_on(¤t.pos, temp8);
|
||||
}
|
||||
|
||||
mCurrProcFunc = &procStop_BG;
|
||||
mCurrProcFunc = &daArrow_c::procStop_BG;
|
||||
fopAcM_OnStatus(this, fopAcStts_UNK4000_e);
|
||||
fopAcM_SetParam(this, 2);
|
||||
field_0x604 = 0x28;
|
||||
@@ -828,7 +828,7 @@ BOOL daArrow_c::procMove() {
|
||||
attribCode == dBgS_Attr_DAMAGE_e ||
|
||||
attribCode == dBgS_Attr_FREEZE_e
|
||||
)) {
|
||||
mCurrProcFunc = &procReturn;
|
||||
mCurrProcFunc = &daArrow_c::procReturn;
|
||||
fopAcM_SetParam(this, 3);
|
||||
speed *= -0.1f;
|
||||
speed.y += speed.absXZ();
|
||||
@@ -848,7 +848,7 @@ BOOL daArrow_c::procMove() {
|
||||
// There was probably some code here that got commented out.
|
||||
}
|
||||
|
||||
if (mCurrProcFunc == &procWater) {
|
||||
if (mCurrProcFunc == &daArrow_c::procWater) {
|
||||
mDoMtx_stack_c::transS(current.pos);
|
||||
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, 0);
|
||||
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
|
||||
@@ -1061,7 +1061,7 @@ BOOL daArrow_c::createInit() {
|
||||
mpBtk = daPy_getPlayerLinkActorClass()->getIceArrowBtk();
|
||||
}
|
||||
|
||||
mCurrProcFunc = &procWait;
|
||||
mCurrProcFunc = &daArrow_c::procWait;
|
||||
|
||||
setKeepMatrix();
|
||||
mCullMtx = mpModel->getBaseTRMtx();
|
||||
|
||||
@@ -313,9 +313,9 @@ bool daBomb_c::checkExplodeCc() {
|
||||
if(0 < mRestTime) {
|
||||
typedef bool(daBomb_c::*checkFunc)();
|
||||
static checkFunc proc[] = {
|
||||
&checkExplodeCc_norm,
|
||||
&checkExplodeCc_nut,
|
||||
&checkExplodeCc_cannon
|
||||
&daBomb_c::checkExplodeCc_norm,
|
||||
&daBomb_c::checkExplodeCc_nut,
|
||||
&daBomb_c::checkExplodeCc_cannon
|
||||
};
|
||||
|
||||
return (this->*proc[mType])();
|
||||
@@ -432,9 +432,9 @@ bool daBomb_c::checkExplodeBg_cannon() {
|
||||
bool daBomb_c::checkExplodeBg() {
|
||||
typedef bool(daBomb_c::*checkFunc)();
|
||||
static checkFunc proc[] = {
|
||||
&checkExplodeBg_norm,
|
||||
&checkExplodeBg_nut,
|
||||
&checkExplodeBg_cannon
|
||||
&daBomb_c::checkExplodeBg_norm,
|
||||
&daBomb_c::checkExplodeBg_nut,
|
||||
&daBomb_c::checkExplodeBg_cannon
|
||||
};
|
||||
|
||||
return (this->*proc[mType])();
|
||||
@@ -757,7 +757,7 @@ int daBomb_c::procExplode_init() {
|
||||
|
||||
field_0x774 = 0;
|
||||
field_0x778 = 0.0f;
|
||||
mFunc = &procExplode;
|
||||
mFunc = &daBomb_c::procExplode;
|
||||
speedF = 0.0f;
|
||||
speed = cXyz::Zero;
|
||||
mGravity = 0.0f;
|
||||
@@ -869,7 +869,7 @@ bool daBomb_c::procCarry_init() {
|
||||
setFuseEffect();
|
||||
}
|
||||
|
||||
mFunc = &procCarry;
|
||||
mFunc = &daBomb_c::procCarry;
|
||||
change_state(STATE_2);
|
||||
speedF = 0.0f;
|
||||
speed.set(cXyz::Zero);
|
||||
@@ -903,7 +903,7 @@ bool daBomb_c::procCarry() {
|
||||
}
|
||||
|
||||
bool daBomb_c::procWait_init() {
|
||||
mFunc = &procWait;
|
||||
mFunc = &daBomb_c::procWait;
|
||||
if(chk_attrState(this, ATTR_STATE_80)) {
|
||||
change_state(STATE_1);
|
||||
}
|
||||
|
||||
+11
-11
@@ -260,9 +260,9 @@ namespace daBomb2 {
|
||||
void Act_c::start_proc_call() {
|
||||
typedef void(Act_c::*procFunc)();
|
||||
static procFunc start_proc[] = {
|
||||
&start_explode_instant,
|
||||
&start_explode_interval,
|
||||
&start_carry
|
||||
&Act_c::start_explode_instant,
|
||||
&Act_c::start_explode_interval,
|
||||
&Act_c::start_carry
|
||||
};
|
||||
|
||||
int proc = daObj::PrmAbstract(this, PRM_2_W, PRM_2_S);
|
||||
@@ -851,10 +851,10 @@ namespace daBomb2 {
|
||||
void Act_c::mode_proc_call() {
|
||||
typedef void(Act_c::*procFunc)();
|
||||
static procFunc mode_proc[] = {
|
||||
&mode_wait,
|
||||
&mode_carry,
|
||||
&mode_explode,
|
||||
&mode_sink,
|
||||
&Act_c::mode_wait,
|
||||
&Act_c::mode_carry,
|
||||
&Act_c::mode_explode,
|
||||
&Act_c::mode_sink,
|
||||
};
|
||||
|
||||
if(fopAcM_checkCarryNow(this) && field_0x694 != 1) {
|
||||
@@ -951,10 +951,10 @@ namespace daBomb2 {
|
||||
void Act_c::tensor_proc_call() {
|
||||
typedef void(Act_c::*procFunc)();
|
||||
static procFunc tensor_proc[] = {
|
||||
&tensor_wait,
|
||||
&tensor_carry,
|
||||
&tensor_explode,
|
||||
&tensor_sink,
|
||||
&Act_c::tensor_wait,
|
||||
&Act_c::tensor_carry,
|
||||
&Act_c::tensor_explode,
|
||||
&Act_c::tensor_sink,
|
||||
};
|
||||
|
||||
if(!daObj::PrmAbstract(this, PRM_1_W, PRM_1_S)) {
|
||||
|
||||
@@ -10,12 +10,13 @@
|
||||
#include "SSystem/SComponent/c_counter.h"
|
||||
#include "d/actor/d_a_player_main.h"
|
||||
#include "d/d_procname.h"
|
||||
#include "global.h"
|
||||
|
||||
// Needed for the .data section to match.
|
||||
static Vec dummy_2100 = {1.0f, 1.0f, 1.0f};
|
||||
static Vec dummy_2080 = {1.0f, 1.0f, 1.0f};
|
||||
|
||||
static u8 l_chainS3TCTEX[] __attribute__((aligned(32))) = {
|
||||
static u8 l_chainS3TCTEX[] ALIGN_DECL(32) = {
|
||||
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -82,7 +83,7 @@ static cXy l_texCoord[0xC] = {
|
||||
{0.961538, 0.983522},
|
||||
};
|
||||
|
||||
static u8 l_chainDL[] __attribute__((aligned(32))) = {
|
||||
static u8 l_chainDL[] ALIGN_DECL(32) = {
|
||||
0x98, 0x00, 0x06, 0x01, 0x0A, 0x07, 0x0B, 0x09, 0x08, 0x0B, 0x09, 0x02, 0x08, 0x08, 0x09,
|
||||
0x98, 0x00, 0x06, 0x0B, 0x07, 0x07, 0x06, 0x0A, 0x04, 0x04, 0x05, 0x09, 0x07, 0x01, 0x06,
|
||||
0x98, 0x00, 0x06, 0x08, 0x03, 0x0B, 0x02, 0x05, 0x00, 0x0A, 0x01, 0x02, 0x03, 0x09, 0x02,
|
||||
@@ -96,7 +97,7 @@ static u8 l_chainDL[] __attribute__((aligned(32))) = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static u8 l_matDL[] __attribute__((aligned(32))) = {
|
||||
static u8 l_matDL[] ALIGN_DECL(32) = {
|
||||
0x61, 0x80, 0x00, 0x01, 0x3A,
|
||||
0x61, 0x84, 0x00, 0x00, 0x00,
|
||||
0x61, 0x88, 0xE0, 0x7C, 0x1F,
|
||||
@@ -203,7 +204,7 @@ void daHookshot_rockLineCallback(fopAc_ac_c* hookshot_actor, dCcD_GObjInf* objIn
|
||||
BOOL daHookshot_c::procWait_init(int param_1) {
|
||||
daPy_lk_c* link = daPy_getPlayerLinkActorClass();
|
||||
fopAcM_SetParam(this, 0);
|
||||
mCurrProcFunc = &procWait;
|
||||
mCurrProcFunc = &daHookshot_c::procWait;
|
||||
mChainCnt = 0;
|
||||
current.pos = link->getHookshotRootPos();
|
||||
m518 = -1;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "d/actor/d_a_item.h"
|
||||
#include "d/d_item.h"
|
||||
#include "d/d_item_data.h"
|
||||
#include "global.h"
|
||||
#include "m_Do/m_Do_mtx.h"
|
||||
|
||||
// Needed for the .data section to match.
|
||||
@@ -191,8 +192,8 @@ BOOL daIball_c::dead() {
|
||||
/* 800F3A48-800F3E78 .text checkGeo__9daIball_cFv */
|
||||
void daIball_c::checkGeo() {
|
||||
static ModeFunc mode_proc[] = {
|
||||
&mode_wait,
|
||||
&mode_water,
|
||||
&daIball_c::mode_wait,
|
||||
&daIball_c::mode_water,
|
||||
};
|
||||
|
||||
mPrevSpeedY = speed.y;
|
||||
@@ -321,10 +322,7 @@ void daIball_c::set_mtx() {
|
||||
}
|
||||
|
||||
// TODO: This is a hack. I have no idea why this one variable needs to go in .data instead of .sdata.
|
||||
#ifndef __INTELLISENSE__
|
||||
__declspec(section ".data")
|
||||
#endif
|
||||
char daIball_c::m_arcname[] = "Always";
|
||||
SECTION_DATA char daIball_c::m_arcname[] = "Always";
|
||||
|
||||
dCcD_SrcCyl daIball_c::m_cyl_src = {
|
||||
// dCcD_SrcGObjInf
|
||||
|
||||
@@ -307,9 +307,9 @@ BOOL daItem_c::_daItem_execute() {
|
||||
/* 800F5834-800F59CC .text mode_proc_call__8daItem_cFv */
|
||||
void daItem_c::mode_proc_call() {
|
||||
static ModeFunc mode_proc[] = {
|
||||
&mode_wait,
|
||||
&mode_wait,
|
||||
&mode_water,
|
||||
&daItem_c::mode_wait,
|
||||
&daItem_c::mode_wait,
|
||||
&daItem_c::mode_water,
|
||||
};
|
||||
|
||||
if (mType == 1) {
|
||||
|
||||
@@ -173,7 +173,7 @@ BOOL daNh_c::init() {
|
||||
void daNh_c::action(void* arg) {
|
||||
if (mCurrActionFunc == NULL) {
|
||||
speedF = 0.0f;
|
||||
setAction(&waitAction, NULL);
|
||||
setAction(&daNh_c::waitAction, NULL);
|
||||
}
|
||||
(this->*mCurrActionFunc)(arg);
|
||||
}
|
||||
@@ -218,7 +218,7 @@ BOOL daNh_c::checkBinCatch() {
|
||||
/* 800F9F3C-800FA108 .text searchPlayer__6daNh_cFv */
|
||||
BOOL daNh_c::searchPlayer() {
|
||||
if (isTypeBottle()) {
|
||||
setAction(&escapeAction, NULL);
|
||||
setAction(&daNh_c::escapeAction, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ BOOL daNh_c::searchPlayer() {
|
||||
mPlayerDist = playerDist;
|
||||
if (playerDelta.absXZ() > 0.001f && playerDist < 600.0f && playerDistDelta > l_HIO.prm.mMinFrightenSpeed) {
|
||||
// Player is nearby and moving closer. The Forest Firefly becomes frightened and tries to escape.
|
||||
setAction(&escapeAction, NULL);
|
||||
setAction(&daNh_c::escapeAction, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ BOOL daNh_c::waitAction(void*) {
|
||||
} else if (mActionStatus != ACTION_ENDING) {
|
||||
cLib_addCalc(&speedF, 0.0f, 0.1f, 10.0f, 1.0f);
|
||||
if (getHomeDistance() > 50.0f) {
|
||||
setAction(&returnAction, NULL);
|
||||
setAction(&daNh_c::returnAction, NULL);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
@@ -310,11 +310,11 @@ BOOL daNh_c::checkEscapeEnd() {
|
||||
cXyz homeDelta = orig.pos - current.pos;
|
||||
if (!isTypeBottle()) {
|
||||
if (cLib_calcTimer(&mEscapeTimer) == 0) {
|
||||
setAction(&waitAction, NULL);
|
||||
setAction(&daNh_c::waitAction, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
if (homeDelta.abs2XZ() > l_HIO.prm.mMaxHomeDist*l_HIO.prm.mMaxHomeDist) {
|
||||
setAction(&returnAction, NULL);
|
||||
setAction(&daNh_c::returnAction, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -353,7 +353,7 @@ BOOL daNh_c::returnAction(void*) {
|
||||
mEscapeTimer = 5*30;
|
||||
} else if (mActionStatus != ACTION_ENDING) {
|
||||
if (getHomeDistance() < 50.0f) {
|
||||
setAction(&waitAction, NULL);
|
||||
setAction(&daNh_c::waitAction, NULL);
|
||||
} else {
|
||||
s16 targetAngle = cLib_targetAngleY(¤t.pos, &orig.pos);
|
||||
cXyz homeDelta = orig.pos - current.pos;
|
||||
|
||||
+17
-16
@@ -7,25 +7,26 @@
|
||||
#include "d/actor/d_a_player_main.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_procname.h"
|
||||
#include "global.h"
|
||||
|
||||
static Vec bss_3569;
|
||||
// Not sure what these are, but they have size 1, and alignment 1 in the debug maps, but alignment 4 in the non-debug maps.
|
||||
static u8 bss_1036 __attribute__((aligned(4)));
|
||||
static u8 bss_1034 __attribute__((aligned(4)));
|
||||
static u8 bss_1032 __attribute__((aligned(4)));
|
||||
static u8 bss_1031 __attribute__((aligned(4)));
|
||||
static u8 bss_1026 __attribute__((aligned(4)));
|
||||
static u8 bss_1024 __attribute__((aligned(4)));
|
||||
static u8 bss_1022 __attribute__((aligned(4)));
|
||||
static u8 bss_1021 __attribute__((aligned(4)));
|
||||
static u8 bss_984 __attribute__((aligned(4)));;
|
||||
static u8 bss_982 __attribute__((aligned(4)));;
|
||||
static u8 bss_980 __attribute__((aligned(4)));;
|
||||
static u8 bss_979 __attribute__((aligned(4)));;
|
||||
static u8 bss_941 __attribute__((aligned(4)));;
|
||||
static u8 bss_939 __attribute__((aligned(4)));;
|
||||
static u8 bss_937 __attribute__((aligned(4)));;
|
||||
static u8 bss_936 __attribute__((aligned(4)));;
|
||||
static u8 bss_1036 ALIGN_DECL(4);
|
||||
static u8 bss_1034 ALIGN_DECL(4);
|
||||
static u8 bss_1032 ALIGN_DECL(4);
|
||||
static u8 bss_1031 ALIGN_DECL(4);
|
||||
static u8 bss_1026 ALIGN_DECL(4);
|
||||
static u8 bss_1024 ALIGN_DECL(4);
|
||||
static u8 bss_1022 ALIGN_DECL(4);
|
||||
static u8 bss_1021 ALIGN_DECL(4);
|
||||
static u8 bss_984 ALIGN_DECL(4);
|
||||
static u8 bss_982 ALIGN_DECL(4);
|
||||
static u8 bss_980 ALIGN_DECL(4);
|
||||
static u8 bss_979 ALIGN_DECL(4);
|
||||
static u8 bss_941 ALIGN_DECL(4);
|
||||
static u8 bss_939 ALIGN_DECL(4);
|
||||
static u8 bss_937 ALIGN_DECL(4);
|
||||
static u8 bss_936 ALIGN_DECL(4);
|
||||
static u32 l_msgId;
|
||||
static msg_class* l_msg;
|
||||
static u8 msg_mode;
|
||||
|
||||
Reference in New Issue
Block a user