Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/d/d_stage.h
Original file line number Diff line number Diff line change
Expand Up @@ -1189,9 +1189,9 @@ class dStage_nextStage_c : public dStage_startStage_c {

// unknown name
struct dStage_objectNameInf {
char mName[8];
s16 mProcName;
s8 mSubtype;
/* 0x00 */ char name[8];
/* 0x08 */ s16 procname;
/* 0x0A */ s8 argument;
}; // Size: 0xC

class dStage_KeepDoorInfo {
Expand Down Expand Up @@ -1273,7 +1273,7 @@ void dStage_dt_c_roomLoader(void* i_data, dStage_dt_c* stageDt, int param_2);
dStage_KeepDoorInfo* dStage_GetKeepDoorInfo();
dStage_KeepDoorInfo* dStage_GetRoomKeepDoorInfo();
void dStage_dt_c_fieldMapLoader(void* i_data, dStage_dt_c* i_stage);
const char* dStage_getName(s16 procName, s8 subtype);
const char* dStage_getName(s16 procName, s8 argument);

#if VERSION == VERSION_WII_USA_R0
void dStage_escapeRestart();
Expand Down
22 changes: 11 additions & 11 deletions include/f_op/f_op_actor_mng.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct fopAcM_prm_class {
/* 0x00 */ fopAcM_prmBase_class base;
/* 0x18 */ fopAcM_prmScale_class scale;
/* 0x1C */ fpc_ProcID parent_id;
/* 0x20 */ s8 subtype;
/* 0x20 */ s8 argument;
/* 0x21 */ s8 room_no;
};

Expand All @@ -70,20 +70,20 @@ struct fopAcM_search4ev_prm {
name[0] = 0;
event_id = -1;
procname = PROC_PLAY_SCENE;
subtype = 0;
argument = 0;
}

/* 0x00 */ char name[30];
/* 0x1E */ s16 event_id;
/* 0x20 */ s16 procname;
/* 0x22 */ s8 subtype;
/* 0x22 */ s8 argument;
};

struct fopAcM_search_prm {
/* 0x00 */ u32 prm0;
/* 0x04 */ u32 prm1;
/* 0x08 */ s16 procname;
/* 0x0A */ s8 subtype;
/* 0x0A */ s8 argument;
};

struct fOpAcm_HIO_entry_c : public mDoHIO_entry_c {
Expand Down Expand Up @@ -502,7 +502,7 @@ s32 fopAcM_SearchByName(s16 i_procName, fopAc_ac_c** i_outActor);
fopAcM_prm_class* fopAcM_CreateAppend();

fopAcM_prm_class* createAppend(u16 i_setId, u32 i_parameters, const cXyz* i_pos, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, s8 i_subtype,
const csXyz* i_angle, const cXyz* i_scale, s8 i_argument,
fpc_ProcID i_parentId);

void fopAcM_Log(fopAc_ac_c const* i_actor, char const* i_message);
Expand All @@ -512,11 +512,11 @@ s32 fopAcM_delete(fopAc_ac_c* i_actor);
s32 fopAcM_delete(fpc_ProcID i_actorID);

fpc_ProcID fopAcM_create(s16 i_procName, u16 i_setId, u32 i_parameters, const cXyz* i_pos,
int i_roomNo, const csXyz* i_angle, const cXyz* i_scale, s8 i_subtype,
int i_roomNo, const csXyz* i_angle, const cXyz* i_scale, s8 i_argument,
createFunc i_createFunc);

fpc_ProcID fopAcM_create(s16 i_procName, u32 i_parameters, const cXyz* i_pos, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, s8 i_subtype);
const csXyz* i_angle, const cXyz* i_scale, s8 i_argument);

inline fpc_ProcID fopAcM_create(s16 i_procName, createFunc i_createFunc, void* params) {
return fpcM_Create(i_procName, i_createFunc, params);
Expand All @@ -527,7 +527,7 @@ inline fpc_ProcID fopAcM_Create(s16 i_procName, createFunc i_createFunc, void* p
}

fopAc_ac_c* fopAcM_fastCreate(s16 i_procName, u32 i_parameters, const cXyz* i_pos, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, s8 i_subtype,
const csXyz* i_angle, const cXyz* i_scale, s8 i_argument,
createFunc i_createFunc, void* i_createFuncData);

fopAc_ac_c* fopAcM_fastCreate(const char* i_actorname, u32 i_parameters, const cXyz* i_pos,
Expand All @@ -536,11 +536,11 @@ fopAc_ac_c* fopAcM_fastCreate(const char* i_actorname, u32 i_parameters, const c

fpc_ProcID fopAcM_createChild(s16 i_procName, fpc_ProcID i_parentID, u32 i_parameters,
const cXyz* i_pos, int i_roomNo, const csXyz* i_angle,
const cXyz* i_scale, s8 i_subtype, createFunc i_createFunc);
const cXyz* i_scale, s8 i_argument, createFunc i_createFunc);

fpc_ProcID fopAcM_createChildFromOffset(s16 i_procName, fpc_ProcID i_parentID, u32 i_parameters,
const cXyz* i_pos, int i_roomNo, const csXyz* i_angle,
const cXyz* i_scale, s8 i_subtype, createFunc i_createFunc);
const cXyz* i_scale, s8 i_argument, createFunc i_createFunc);

void fopAcM_DeleteHeap(fopAc_ac_c* i_actor);

Expand Down Expand Up @@ -805,7 +805,7 @@ inline void fopAcM_setWarningMessage_f(const fopAc_ac_c* i_actor, const char* i_

char buf[64];
snprintf(buf, sizeof(buf), "<%s> %s", dStage_getName(fopAcM_GetProfName(i_actor),
i_actor->subtype), i_msg); setWarningMessage_f_va(JUTAssertion::getSDevice(), i_filename,
i_actor->argument), i_msg); setWarningMessage_f_va(JUTAssertion::getSDevice(), i_filename,
i_line, buf, args);

va_end(args); */
Expand Down
43 changes: 28 additions & 15 deletions src/d/d_event_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ void dEvDtStaff_c::specialProcLight() {
f32* hourP;

switch (*(int*)nowCutName) {
case 'CHAN':
case 'CHAN': {
hourP = dComIfGp_evmng_getMyFloatP(staffId, "Hour");
if (hourP != NULL) {
dKy_instant_timechg(*hourP * 15.0f);
Expand All @@ -403,6 +403,7 @@ void dEvDtStaff_c::specialProcLight() {
}
}
break;
}
case 'ADD_':
hourP = dComIfGp_evmng_getMyFloatP(staffId, "Hour");
if (hourP != NULL) {
Expand Down Expand Up @@ -452,7 +453,7 @@ void dEvDtStaff_c::specialProcMessage() {
case 'FINI':
work->mLMsg->mode = 0x10;
break;
case 'CONT':
case 'CONT': {
work->mLMsg->mode = 0xF;
int* ptr = dComIfGp_evmng_getMyIntegerP(staffId, "msgNo");
if (ptr == NULL) {
Expand All @@ -461,15 +462,17 @@ void dEvDtStaff_c::specialProcMessage() {
work->mMsgNo = *ptr;
fopMsgM_messageSet(work->mMsgNo, 1000);
break;
case 'SAVE':
}
case 'SAVE': {
work->mMsgNo = 1;
int* typeP = dComIfGp_evmng_getMyIntegerP(staffId, "Type");
if (typeP != NULL && *typeP == 1) {
work->mMsgNo = 2;
}
work->_0 = d_GameOver_Create(work->mMsgNo);
break;
case 'TELO':
}
case 'TELO': {
int* forStartP = dComIfGp_evmng_getMyIntegerP(staffId, "ForStart");

if (forStartP != NULL && *forStartP != 0) {
Expand All @@ -491,6 +494,7 @@ void dEvDtStaff_c::specialProcMessage() {
work->_0 = fopMsgM_messageSetDemo(work->mMsgNo);
}
}
}
}

switch (*(int*)nowCutName) {
Expand Down Expand Up @@ -624,20 +628,22 @@ void dEvDtStaff_c::specialProcSound() {
case 'NOMS':
specialProc_WaitStart(staffId);
break;
case 'RIDD':
case 'RIDD': {
int* typeP = dComIfGp_evmng_getMyIntegerP(staffId, "Type");
if (typeP != NULL && *typeP == 1) {
mDoAud_seStart(Z2SE_READ_RIDDLE_A, NULL, 0, 0);
} else {
mDoAud_seStart(Z2SE_READ_RIDDLE_B, NULL, 0, 0);
}
break;
case 'BGMS':
}
case 'BGMS': {
int* timerP = dComIfGp_evmng_getMyIntegerP(staffId, "Timer");
if (timerP != NULL) {
mDoAud_bgmStop(*timerP);
}
}
}
}

switch (*(int*)nowCutName) {
Expand Down Expand Up @@ -707,8 +713,8 @@ void dEvDtStaff_c::specialProcCreate() {
scale = *scaleP;
}

fopAcM_create(objNameInf->mProcName, arg, &pos, dComIfGp_roomControl_getStayNo(),
&angle, &scale, objNameInf->mSubtype);
fopAcM_create(objNameInf->procname, arg, &pos, dComIfGp_roomControl_getStayNo(),
&angle, &scale, objNameInf->argument);
break;
}
}
Expand Down Expand Up @@ -779,7 +785,7 @@ void dEvDtStaff_c::specialProcDirector() {
case 'NEXT':
dEvDt_Next_Stage(staffId, 0xD);
break;
case 'SKIP':
case 'SKIP': {
char* zev = dComIfGp_evmng_getMyStringP(staffId, "Zev");
// cast needed to match
void* pt = (void*)evtControl.getPt1();
Expand All @@ -793,7 +799,8 @@ void dEvDtStaff_c::specialProcDirector() {
evtControl.setSkipProc(pt, dEv_defaultSkipProc, 0);
}
break;
case 'FADE':
}
case 'FADE': {
f32* rateP = dComIfGp_evmng_getMyFloatP(staffId, "Rate");
int* colorP = dComIfGp_evmng_getMyIntegerP(staffId, "Color");

Expand All @@ -811,13 +818,15 @@ void dEvDtStaff_c::specialProcDirector() {
mDoGph_gInf_c::fadeOut(*rateP);
}
break;
case 'VIBR':
}
case 'VIBR': {
specialProc_WaitStart(staffId);
int* patternP = dComIfGp_evmng_getMyIntegerP(staffId, "Pattern");
int* typeP = dComIfGp_evmng_getMyIntegerP(staffId, "Type");
dComIfGp_getVibration().StartQuake((u8*)patternP, 0, *typeP, cXyz(0, 1, 0));
break;
case 'WIPE':
}
case 'WIPE': {
f32* wipeRateP = dComIfGp_evmng_getMyFloatP(staffId, "Rate");
dDlst_list_c::wipeIn(-*wipeRateP);
if (*wipeRateP > 0) {
Expand All @@ -834,7 +843,8 @@ void dEvDtStaff_c::specialProcDirector() {
}
}
break;
case 'MAPT':
}
case 'MAPT': {
int* idP = dComIfGp_evmng_getMyIntegerP(staffId, "ID");
data->unk = *idP;
dStage_MapEvent_dt_c* mapEvent = dEvt_control_c::searchMapEventData(data->unk);
Expand All @@ -848,7 +858,8 @@ void dEvDtStaff_c::specialProcDirector() {
data->unk2 = 0;
}
break;
case 'CAST':
}
case 'CAST': {
char* pt2Name = dComIfGp_evmng_getMyStringP(staffId, "Pt2");
if (pt2Name != NULL) {
fopAc_ac_c* pt2 = fopAcM_searchFromName4Event(pt2Name, -1);
Expand Down Expand Up @@ -881,6 +892,7 @@ void dEvDtStaff_c::specialProcDirector() {
}
}
break;
}
case 'SPEC':
int* specTypeP = dComIfGp_evmng_getMyIntegerP(staffId, "Type");
if (specTypeP != NULL) {
Expand Down Expand Up @@ -1002,7 +1014,7 @@ void dEvDtStaff_c::specialProcPackage() {
case 'WAIT':
specialProc_WaitProc(staffId);
break;
case 'PLAY':
case 'PLAY': {
dEvt_control_c& evtControl = dComIfGp_getEvent();
if (dDemo_c::getMode() == 2) {
dStage_MapEvent_dt_c* event = evtControl.getStageEventDt();
Expand All @@ -1018,6 +1030,7 @@ void dEvDtStaff_c::specialProcPackage() {
dComIfGp_evmng_cutEnd(staffId);
}
break;
}
default:
dComIfGp_evmng_cutEnd(staffId);
break;
Expand Down
26 changes: 13 additions & 13 deletions src/d/d_stage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ dStage_objectNameInf* dStage_searchName(char const* objName) {
dStage_objectNameInf* obj = l_objectName;

for (u32 i = 0; i < ARRAY_SIZEU(l_objectName); i++) {
if (!strcmp(obj->mName, objName)) {
if (!strcmp(obj->name, objName)) {
return obj;
}
obj++;
Expand All @@ -1511,33 +1511,33 @@ dStage_objectNameInf* dStage_searchName(char const* objName) {
return NULL;
}

const char* dStage_getName(s16 procName, s8 subtype) {
const char* dStage_getName(s16 procName, s8 argument) {
static char tmp_name[8];

dStage_objectNameInf* obj = l_objectName;
char* tmp = NULL;

for (int i = 0; i < ARRAY_SIZEU(l_objectName); i++) {
if (obj->mProcName == procName) {
if (obj->mSubtype == subtype) {
return obj->mName;
if (obj->procname == procName) {
if (obj->argument == argument) {
return obj->name;
}
if (tmp == NULL) {
tmp = obj->mName;
tmp = obj->name;
}
}
obj++;
}

if (tmp == NULL) {
snprintf(tmp_name, 8, "%d%+0d", procName, subtype);
snprintf(tmp_name, 8, "%d%+0d", procName, argument);
tmp = tmp_name;
}
return tmp;
}

const char* dStage_getName2(s16 procName, s8 subtype) {
return dStage_getName(procName, subtype);
const char* dStage_getName2(s16 procName, s8 argument) {
return dStage_getName(procName, argument);
}

/* 80450D60-80450D64 000260 0004+00 1/1 3/3 1/1 .sbss mProcID__20dStage_roomControl_c */
Expand Down Expand Up @@ -1577,17 +1577,17 @@ static void dStage_actorCreate(stage_actor_data_class* i_actorData, fopAcM_prm_c
OS_REPORT("\x1B""[43;30mStage Actor Name Nothing !! <%s>\n\x1B[m", i_actorData->name);
JKRFree(i_actorPrm);
} else {
i_actorPrm->subtype = actorInf->mSubtype;
if (actorInf->mProcName == PROC_SUSPEND) {
fopAc_ac_c* actor = (fopAc_ac_c*)fopAcM_FastCreate(actorInf->mProcName, NULL, NULL, i_actorPrm);
i_actorPrm->argument = actorInf->argument;
if (actorInf->procname == PROC_SUSPEND) {
fopAc_ac_c* actor = (fopAc_ac_c*)fopAcM_FastCreate(actorInf->procname, NULL, NULL, i_actorPrm);

if (actor != NULL) {
fopAcM_delete(actor);
}
return;
}

fopAcM_create(actorInf->mProcName, NULL, i_actorPrm);
fopAcM_create(actorInf->procname, NULL, i_actorPrm);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/f_op/f_op_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static int fopAc_Create(void* i_this) {
a_this->home.angle = append->base.angle;
a_this->shape_angle = append->base.angle;
a_this->parentActorID = append->parent_id;
a_this->argument = append->subtype;
a_this->argument = append->argument;
a_this->scale.set(append->scale.x * 0.1f, append->scale.y * 0.1f,
append->scale.z * 0.1f);
a_this->setID = append->base.setID;
Expand Down
Loading