mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-23 05:49:50 +00:00
Rename RoomBehaviorType1 to RoomType (#2271)
* Rename RoomBehaviorType1 to RoomType * suggestions * Update include/z64scene.h --------- Co-authored-by: fig02 <fig02srl@gmail.com>
This commit is contained in:
parent
d0b4725869
commit
2f54db142e
@ -152,14 +152,14 @@ typedef union RoomShape {
|
|||||||
RoomShapeCullable cullable;
|
RoomShapeCullable cullable;
|
||||||
} RoomShape; // "Ground Shape"
|
} RoomShape; // "Ground Shape"
|
||||||
|
|
||||||
typedef enum RoomBehaviorType1 {
|
typedef enum RoomType {
|
||||||
/* 0 */ ROOM_BEHAVIOR_TYPE1_0,
|
/* 0 */ ROOM_TYPE_NORMAL,
|
||||||
/* 1 */ ROOM_BEHAVIOR_TYPE1_1,
|
/* 1 */ ROOM_TYPE_DUNGEON, // Blocks Sun's Song's time advance effect. Not exclusively used by typical dungeon rooms.
|
||||||
/* 2 */ ROOM_BEHAVIOR_TYPE1_2,
|
/* 2 */ ROOM_TYPE_INDOORS, // Reduces player run speed and blocks player from attacking or jumping.
|
||||||
/* 3 */ ROOM_BEHAVIOR_TYPE1_3, // unused
|
/* 3 */ ROOM_TYPE_3, // Unused. Color dithering is turned off when drawing the room and other things.
|
||||||
/* 4 */ ROOM_BEHAVIOR_TYPE1_4, // unused
|
/* 4 */ ROOM_TYPE_4, // Unused. Prevents switching to CAM_SET_HORSE when mounting a horse.
|
||||||
/* 5 */ ROOM_BEHAVIOR_TYPE1_5
|
/* 5 */ ROOM_TYPE_BOSS // Disables Environment_AdjustLights
|
||||||
} RoomBehaviorType1;
|
} RoomType;
|
||||||
|
|
||||||
typedef enum RoomEnvironmentType {
|
typedef enum RoomEnvironmentType {
|
||||||
/* 0 */ ROOM_ENV_DEFAULT,
|
/* 0 */ ROOM_ENV_DEFAULT,
|
||||||
@ -175,7 +175,7 @@ typedef struct Room {
|
|||||||
/* 0x00 */ s8 num; // -1 is invalid room
|
/* 0x00 */ s8 num; // -1 is invalid room
|
||||||
/* 0x01 */ u8 unk_01;
|
/* 0x01 */ u8 unk_01;
|
||||||
/* 0x02 */ u8 environmentType;
|
/* 0x02 */ u8 environmentType;
|
||||||
/* 0x03 */ u8 behaviorType1;
|
/* 0x03 */ u8 type;
|
||||||
/* 0x04 */ s8 echo;
|
/* 0x04 */ s8 echo;
|
||||||
/* 0x05 */ u8 lensMode;
|
/* 0x05 */ u8 lensMode;
|
||||||
/* 0x08 */ RoomShape* roomShape; // original name: "ground_shape"
|
/* 0x08 */ RoomShape* roomShape; // original name: "ground_shape"
|
||||||
@ -605,9 +605,9 @@ typedef enum SceneCommandTypeID {
|
|||||||
#define SCENE_CMD_SPECIAL_FILES(naviQuestHintFileId, keepObjectId) \
|
#define SCENE_CMD_SPECIAL_FILES(naviQuestHintFileId, keepObjectId) \
|
||||||
{ SCENE_CMD_ID_SPECIAL_FILES, naviQuestHintFileId, CMD_W(keepObjectId) }
|
{ SCENE_CMD_ID_SPECIAL_FILES, naviQuestHintFileId, CMD_W(keepObjectId) }
|
||||||
|
|
||||||
#define SCENE_CMD_ROOM_BEHAVIOR(curRoomUnk3, curRoomUnk2, showInvisActors, disableWarpSongs) \
|
#define SCENE_CMD_ROOM_BEHAVIOR(type, environment, showInvisActors, disableWarpSongs) \
|
||||||
{ SCENE_CMD_ID_ROOM_BEHAVIOR, curRoomUnk3, \
|
{ SCENE_CMD_ID_ROOM_BEHAVIOR, type, \
|
||||||
curRoomUnk2 | _SHIFTL(showInvisActors, 8, 1) | _SHIFTL(disableWarpSongs, 10, 1) }
|
environment | _SHIFTL(showInvisActors, 8, 1) | _SHIFTL(disableWarpSongs, 10, 1) }
|
||||||
|
|
||||||
#define SCENE_CMD_UNK_09() \
|
#define SCENE_CMD_UNK_09() \
|
||||||
{ SCENE_CMD_ID_UNDEFINED_9, 0, CMD_W(0) }
|
{ SCENE_CMD_ID_UNDEFINED_9, 0, CMD_W(0) }
|
||||||
|
@ -1131,7 +1131,7 @@ void func_8002DE04(PlayState* play, Actor* actorA, Actor* actorB) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void func_8002DE74(PlayState* play, Player* player) {
|
void func_8002DE74(PlayState* play, Player* player) {
|
||||||
if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_4) && Play_CamIsNotFixed(play)) {
|
if ((play->roomCtx.curRoom.type != ROOM_TYPE_4) && Play_CamIsNotFixed(play)) {
|
||||||
Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_HORSE);
|
Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_HORSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7540,18 +7540,18 @@ void func_80057FC4(Camera* camera) {
|
|||||||
camera->prevSetting = camera->setting = CAM_SET_FREE0;
|
camera->prevSetting = camera->setting = CAM_SET_FREE0;
|
||||||
camera->stateFlags &= ~CAM_STATE_CHECK_BG;
|
camera->stateFlags &= ~CAM_STATE_CHECK_BG;
|
||||||
} else if (camera->play->roomCtx.curRoom.roomShape->base.type != ROOM_SHAPE_TYPE_IMAGE) {
|
} else if (camera->play->roomCtx.curRoom.roomShape->base.type != ROOM_SHAPE_TYPE_IMAGE) {
|
||||||
switch (camera->play->roomCtx.curRoom.behaviorType1) {
|
switch (camera->play->roomCtx.curRoom.type) {
|
||||||
case ROOM_BEHAVIOR_TYPE1_1:
|
case ROOM_TYPE_DUNGEON:
|
||||||
Camera_ChangeDoorCam(camera, NULL, -99, 0, 0, 18, 10);
|
Camera_ChangeDoorCam(camera, NULL, -99, 0, 0, 18, 10);
|
||||||
camera->prevSetting = camera->setting = CAM_SET_DUNGEON0;
|
camera->prevSetting = camera->setting = CAM_SET_DUNGEON0;
|
||||||
break;
|
break;
|
||||||
case ROOM_BEHAVIOR_TYPE1_0:
|
case ROOM_TYPE_NORMAL:
|
||||||
PRINTF("camera: room type: default set field\n");
|
PRINTF("camera: room type: default set field\n");
|
||||||
Camera_ChangeDoorCam(camera, NULL, -99, 0, 0, 18, 10);
|
Camera_ChangeDoorCam(camera, NULL, -99, 0, 0, 18, 10);
|
||||||
camera->prevSetting = camera->setting = CAM_SET_NORMAL0;
|
camera->prevSetting = camera->setting = CAM_SET_NORMAL0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
PRINTF("camera: room type: default set etc (%d)\n", camera->play->roomCtx.curRoom.behaviorType1);
|
PRINTF("camera: room type: default set etc (%d)\n", camera->play->roomCtx.curRoom.type);
|
||||||
Camera_ChangeDoorCam(camera, NULL, -99, 0, 0, 18, 10);
|
Camera_ChangeDoorCam(camera, NULL, -99, 0, 0, 18, 10);
|
||||||
camera->prevSetting = camera->setting = CAM_SET_NORMAL0;
|
camera->prevSetting = camera->setting = CAM_SET_NORMAL0;
|
||||||
camera->stateFlags |= CAM_STATE_CHECK_BG;
|
camera->stateFlags |= CAM_STATE_CHECK_BG;
|
||||||
@ -8466,7 +8466,7 @@ s32 Camera_RequestModeImpl(Camera* camera, s16 requestedMode, u8 forceModeChange
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CAM_REQUEST_MODE_SFX_ATTENTION:
|
case CAM_REQUEST_MODE_SFX_ATTENTION:
|
||||||
if (camera->play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_1) {
|
if (camera->play->roomCtx.curRoom.type == ROOM_TYPE_DUNGEON) {
|
||||||
Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_URGENCY);
|
Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_URGENCY);
|
||||||
} else {
|
} else {
|
||||||
Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_ON);
|
Sfx_PlaySfxCentered(NA_SE_SY_ATTENTION_ON);
|
||||||
|
@ -2531,7 +2531,7 @@ void Environment_AdjustLights(PlayState* play, f32 arg1, f32 arg2, f32 arg3, f32
|
|||||||
f32 temp;
|
f32 temp;
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
if (play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_5 && Play_CamIsNotFixed(play)) {
|
if (play->roomCtx.curRoom.type != ROOM_TYPE_BOSS && Play_CamIsNotFixed(play)) {
|
||||||
arg1 = CLAMP_MIN(arg1, 0.0f);
|
arg1 = CLAMP_MIN(arg1, 0.0f);
|
||||||
arg1 = CLAMP_MAX(arg1, 1.0f);
|
arg1 = CLAMP_MAX(arg1, 1.0f);
|
||||||
|
|
||||||
|
@ -632,7 +632,7 @@ void Interface_UpdateHudAlphas(PlayState* play, s16 dimmingAlpha) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_1) && (interfaceCtx->minimapAlpha >= 255)) {
|
if ((play->roomCtx.curRoom.type == ROOM_TYPE_DUNGEON) && (interfaceCtx->minimapAlpha >= 255)) {
|
||||||
interfaceCtx->minimapAlpha = 255;
|
interfaceCtx->minimapAlpha = 255;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4368,8 +4368,7 @@ void Interface_Update(PlayState* play) {
|
|||||||
gTimeSpeed = sPrevTimeSpeed;
|
gTimeSpeed = sPrevTimeSpeed;
|
||||||
play->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
play->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||||
}
|
}
|
||||||
} else if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_1) &&
|
} else if ((play->roomCtx.curRoom.type != ROOM_TYPE_DUNGEON) && (interfaceCtx->restrictions.sunsSong != 3)) {
|
||||||
(interfaceCtx->restrictions.sunsSong != 3)) {
|
|
||||||
if ((gSaveContext.save.dayTime >= CLOCK_TIME(6, 30)) &&
|
if ((gSaveContext.save.dayTime >= CLOCK_TIME(6, 30)) &&
|
||||||
(gSaveContext.save.dayTime < CLOCK_TIME(18, 0) + 1)) {
|
(gSaveContext.save.dayTime < CLOCK_TIME(18, 0) + 1)) {
|
||||||
gSaveContext.nextDayTime = NEXT_TIME_NIGHT;
|
gSaveContext.nextDayTime = NEXT_TIME_NIGHT;
|
||||||
|
@ -599,7 +599,7 @@ void Player_SetBootData(PlayState* play, Player* this) {
|
|||||||
IREG(69) = bootRegs[15];
|
IREG(69) = bootRegs[15];
|
||||||
MREG(95) = bootRegs[16];
|
MREG(95) = bootRegs[16];
|
||||||
|
|
||||||
if (play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_2) {
|
if (play->roomCtx.curRoom.type == ROOM_TYPE_INDOORS) {
|
||||||
R_RUN_SPEED_LIMIT = 500;
|
R_RUN_SPEED_LIMIT = 500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1012,7 +1012,7 @@ void func_80093C80(PlayState* play) {
|
|||||||
|
|
||||||
Gfx_SetupDL_25Opa(gfxCtx);
|
Gfx_SetupDL_25Opa(gfxCtx);
|
||||||
|
|
||||||
if (play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_3) {
|
if (play->roomCtx.curRoom.type == ROOM_TYPE_3) {
|
||||||
OPEN_DISPS(gfxCtx, "../z_rcp.c", 1460);
|
OPEN_DISPS(gfxCtx, "../z_rcp.c", 1460);
|
||||||
|
|
||||||
gDPSetColorDither(POLY_OPA_DISP++, G_CD_DISABLE);
|
gDPSetColorDither(POLY_OPA_DISP++, G_CD_DISABLE);
|
||||||
|
@ -261,7 +261,7 @@ BAD_RETURN(s32) Scene_CommandSpecialFiles(PlayState* play, SceneCmd* cmd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BAD_RETURN(s32) Scene_CommandRoomBehavior(PlayState* play, SceneCmd* cmd) {
|
BAD_RETURN(s32) Scene_CommandRoomBehavior(PlayState* play, SceneCmd* cmd) {
|
||||||
play->roomCtx.curRoom.behaviorType1 = cmd->roomBehavior.gpFlag1;
|
play->roomCtx.curRoom.type = cmd->roomBehavior.gpFlag1;
|
||||||
play->roomCtx.curRoom.environmentType = cmd->roomBehavior.gpFlag2 & 0xFF;
|
play->roomCtx.curRoom.environmentType = cmd->roomBehavior.gpFlag2 & 0xFF;
|
||||||
play->roomCtx.curRoom.lensMode = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
|
play->roomCtx.curRoom.lensMode = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
|
||||||
play->msgCtx.disableWarpSongs = (cmd->roomBehavior.gpFlag2 >> 0xA) & 1;
|
play->msgCtx.disableWarpSongs = (cmd->roomBehavior.gpFlag2 >> 0xA) & 1;
|
||||||
|
@ -144,7 +144,7 @@ void MagicDark_DimLighting(PlayState* play, f32 intensity) {
|
|||||||
f32 colorScale;
|
f32 colorScale;
|
||||||
f32 fogScale;
|
f32 fogScale;
|
||||||
|
|
||||||
if (play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_5) {
|
if (play->roomCtx.curRoom.type != ROOM_TYPE_BOSS) {
|
||||||
intensity = CLAMP_MIN(intensity, 0.0f);
|
intensity = CLAMP_MIN(intensity, 0.0f);
|
||||||
intensity = CLAMP_MAX(intensity, 1.0f);
|
intensity = CLAMP_MAX(intensity, 1.0f);
|
||||||
fogScale = intensity - 0.2f;
|
fogScale = intensity - 0.2f;
|
||||||
|
@ -6359,8 +6359,8 @@ void func_8083BCD0(Player* this, PlayState* play, s32 controlStickDirection) {
|
|||||||
s32 Player_ActionHandler_10(Player* this, PlayState* play) {
|
s32 Player_ActionHandler_10(Player* this, PlayState* play) {
|
||||||
s32 controlStickDirection;
|
s32 controlStickDirection;
|
||||||
|
|
||||||
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) &&
|
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && (play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) &&
|
||||||
(play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) && (sFloorType != FLOOR_TYPE_7) &&
|
(sFloorType != FLOOR_TYPE_7) &&
|
||||||
(SurfaceType_GetFloorEffect(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) != FLOOR_EFFECT_1)) {
|
(SurfaceType_GetFloorEffect(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) != FLOOR_EFFECT_1)) {
|
||||||
controlStickDirection = this->controlStickDirections[this->controlStickDataIndex];
|
controlStickDirection = this->controlStickDirections[this->controlStickDataIndex];
|
||||||
|
|
||||||
@ -6562,8 +6562,8 @@ s32 Player_ActionHandler_8(Player* this, PlayState* play) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s32 func_8083C61C(PlayState* play, Player* this) {
|
s32 func_8083C61C(PlayState* play, Player* this) {
|
||||||
if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) &&
|
if ((play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
|
||||||
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (AMMO(ITEM_DEKU_NUT) != 0)) {
|
(AMMO(ITEM_DEKU_NUT) != 0)) {
|
||||||
Player_SetupAction(play, this, Player_Action_8084E604, 0);
|
Player_SetupAction(play, this, Player_Action_8084E604, 0);
|
||||||
Player_AnimPlayOnce(play, this, &gPlayerAnim_link_normal_light_bom);
|
Player_AnimPlayOnce(play, this, &gPlayerAnim_link_normal_light_bom);
|
||||||
this->unk_6AD = 0;
|
this->unk_6AD = 0;
|
||||||
@ -10920,14 +10920,13 @@ void Player_UpdateInterface(PlayState* play, Player* this) {
|
|||||||
if ((!(this->stateFlags1 & PLAYER_STATE1_14) &&
|
if ((!(this->stateFlags1 & PLAYER_STATE1_14) &&
|
||||||
(controlStickDirection <= PLAYER_STICK_DIR_FORWARD) &&
|
(controlStickDirection <= PLAYER_STICK_DIR_FORWARD) &&
|
||||||
(Player_CheckHostileLockOn(this) ||
|
(Player_CheckHostileLockOn(this) ||
|
||||||
((sFloorType != FLOOR_TYPE_7) &&
|
((sFloorType != FLOOR_TYPE_7) && (Player_FriendlyLockOnOrParallel(this) ||
|
||||||
(Player_FriendlyLockOnOrParallel(this) ||
|
((play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) &&
|
||||||
((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) &&
|
|
||||||
!(this->stateFlags1 & PLAYER_STATE1_22) &&
|
!(this->stateFlags1 & PLAYER_STATE1_22) &&
|
||||||
(controlStickDirection == PLAYER_STICK_DIR_FORWARD))))))) {
|
(controlStickDirection == PLAYER_STICK_DIR_FORWARD))))))) {
|
||||||
doAction = DO_ACTION_ATTACK;
|
doAction = DO_ACTION_ATTACK;
|
||||||
} else if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) &&
|
} else if ((play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) && Player_IsZTargeting(this) &&
|
||||||
Player_IsZTargeting(this) && (controlStickDirection >= PLAYER_STICK_DIR_LEFT)) {
|
(controlStickDirection >= PLAYER_STICK_DIR_LEFT)) {
|
||||||
doAction = DO_ACTION_JUMP;
|
doAction = DO_ACTION_JUMP;
|
||||||
} else if ((this->heldItemAction >= PLAYER_IA_SWORD_MASTER) ||
|
} else if ((this->heldItemAction >= PLAYER_IA_SWORD_MASTER) ||
|
||||||
((this->stateFlags2 & PLAYER_STATE2_NAVI_ACTIVE) &&
|
((this->stateFlags2 & PLAYER_STATE2_NAVI_ACTIVE) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user