Document Culling (#2318)

* document culling

* format

* depth -> distance

* format

* var name

* new graph link

* rephrase actor flags

* tharo's comments + some more tweaks

* is this causing the problem?

* change wording

* cant scope the temp

* format

* dragorn review

* bad merge

* player -> camera in descriptions

* more its

* cadmic review

* goddamn it why do i have that habit

* projected
This commit is contained in:
fig02
2024-12-13 08:12:52 -05:00
committed by GitHub
parent a897017af5
commit 016aef482b
371 changed files with 1015 additions and 850 deletions

View File

@@ -130,14 +130,25 @@ typedef struct ActorShape {
// What actually matters is the presence or lack of `ACTOR_FLAG_HOSTILE`.
#define ACTOR_FLAG_FRIENDLY (1 << 3)
//
#define ACTOR_FLAG_4 (1 << 4)
// Culling of the actor's update process is disabled.
// In other words, the actor will keep updating even if the actor is outside its own culling volume.
// See `Actor_CullingCheck` for more information about culling.
// See `Actor_CullingVolumeTest` for more information on the test used to determine if an actor should be culled.
#define ACTOR_FLAG_UPDATE_CULLING_DISABLED (1 << 4)
//
#define ACTOR_FLAG_5 (1 << 5)
// Culling of the actor's draw process is disabled.
// In other words, the actor will keep drawing even if the actor is outside its own culling volume.
// See `Actor_CullingCheck` for more information about culling.
// See `Actor_CullingVolumeTest` for more information on the test used to determine if an actor should be culled.
// (The original name for this flag is `NO_CULL_DRAW`, known from the Majora's Mask Debug ROM)
#define ACTOR_FLAG_DRAW_CULLING_DISABLED (1 << 5)
//
#define ACTOR_FLAG_6 (1 << 6)
// Set if the actor is currently within the bounds of its culling volume.
// In most cases, this flag can be used to determine whether or not an actor is currently culled.
// However this flag still updates even if `ACTOR_FLAG_UPDATE_CULLING_DISABLED` or `ACTOR_FLAG_DRAW_CULLING_DISABLED`
// are set. Meaning, the flag can still have a value of "false" even if it is not actually culled.
// (The original name for this flag is `NO_CULL_FLAG`, known from the Majora's Mask Debug ROM)
#define ACTOR_FLAG_INSIDE_CULLING_VOLUME (1 << 6)
// hidden or revealed by Lens of Truth (depending on room lensMode)
#define ACTOR_FLAG_REACT_TO_LENS (1 << 7)
@@ -277,9 +288,9 @@ typedef struct Actor {
/* 0x0B4 */ ActorShape shape; // Variables related to the physical shape of the actor
/* 0x0E4 */ Vec3f projectedPos; // Position of the actor in projected space
/* 0x0F0 */ f32 projectedW; // w component of the projected actor position
/* 0x0F4 */ f32 uncullZoneForward; // Amount to increase the uncull zone forward by (in projected space)
/* 0x0F8 */ f32 uncullZoneScale; // Amount to increase the uncull zone scale by (in projected space)
/* 0x0FC */ f32 uncullZoneDownward; // Amount to increase uncull zone downward by (in projected space)
/* 0x0F4 */ f32 cullingVolumeDistance; // Forward distance of the culling volume (in projected space). See `Actor_CullingCheck` and `Actor_CullingVolumeTest` for more information.
/* 0x0F8 */ f32 cullingVolumeScale; // Scale of the culling volume (in projected space). See `Actor_CullingCheck` and `Actor_CullingVolumeTest` for more information.
/* 0x0FC */ f32 cullingVolumeDownward; // Downward height of the culling volume (in projected space). See `Actor_CullingCheck` and `Actor_CullingVolumeTest` for more information.
/* 0x100 */ Vec3f prevPos; // World position from the previous update cycle
/* 0x10C */ u8 isLockedOn; // Set to true if the actor is currently locked-on by Player
/* 0x10D */ u8 attentionPriority; // Lower values have higher priority. Resets to 0 when lock-on is released.
@@ -886,7 +897,7 @@ s32 func_8002F9EC(struct PlayState* play, Actor* actor, struct CollisionPoly* po
void Actor_DisableLens(struct PlayState* play);
void Actor_InitContext(struct PlayState* play, ActorContext* actorCtx, struct ActorEntry* playerEntry);
void Actor_UpdateAll(struct PlayState* play, ActorContext* actorCtx);
s32 func_800314D4(struct PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3);
s32 Actor_CullingVolumeTest(struct PlayState* play, Actor* actor, Vec3f* projPos, f32 projW);
void func_800315AC(struct PlayState* play, ActorContext* actorCtx);
void Actor_KillAllWithMissingObject(struct PlayState* play, ActorContext* actorCtx);
void func_80031B14(struct PlayState* play, ActorContext* actorCtx);

View File

@@ -896,9 +896,9 @@ void Actor_Init(Actor* actor, PlayState* play) {
actor->minVelocityY = -20.0f;
actor->xyzDistToPlayerSq = MAXFLOAT;
actor->naviEnemyId = NAVI_ENEMY_NONE;
actor->uncullZoneForward = 1000.0f;
actor->uncullZoneScale = 350.0f;
actor->uncullZoneDownward = 700.0f;
actor->cullingVolumeDistance = 1000.0f;
actor->cullingVolumeScale = 350.0f;
actor->cullingVolumeDownward = 700.0f;
CollisionCheck_InitInfo(&actor->colChkInfo);
actor->floorBgId = BGCHECK_SCENE;
ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f);
@@ -2438,7 +2438,8 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
actor->yawTowardsPlayer = Actor_WorldYawTowardActor(actor, &player->actor);
actor->flags &= ~ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
if ((DECR(actor->freezeTimer) == 0) && (actor->flags & (ACTOR_FLAG_4 | ACTOR_FLAG_6))) {
if ((DECR(actor->freezeTimer) == 0) &&
(actor->flags & (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_INSIDE_CULLING_VOLUME))) {
if (actor == player->focusActor) {
actor->isLockedOn = true;
} else {
@@ -2708,19 +2709,92 @@ void Actor_DrawLensActors(PlayState* play, s32 numInvisibleActors, Actor** invis
CLOSE_DISPS(gfxCtx, "../z_actor.c", 6284);
}
s32 func_800314B0(PlayState* play, Actor* actor) {
return func_800314D4(play, actor, &actor->projectedPos, actor->projectedW);
/**
* Checks if an actor should be culled or not, by seeing if it is contained within its own culling volume.
* For more details on the culling test, see `Actor_CullingVolumeTest`.
*
* Returns true if the actor is inside its culling volume. In other words, it should not cull.
*
* "Culling" in this context refers to the removal of something for the sake of improving performance.
* For actors, being culled means that their Update and Draw processes are halted.
* While halted, an Actor's update state is frozen and it will not draw, making it invisible.
*
* Actors that are within the bounds of their culling volume may update and draw, while actors that are
* out of bounds of its culling volume may be excluded from updating and drawing until they are within bounds.
*
* It is possible for actors to opt out of update culling or draw culling.
* This is set per-actor with `ACTOR_FLAG_UPDATE_CULLING_DISABLED` and `ACTOR_FLAG_DRAW_CULLING_DISABLED`.
*
* Note: Even if either `ACTOR_FLAG_UPDATE_CULLING_DISABLED` or `ACTOR_FLAG_DRAW_CULLING_DISABLED` are set, the actor
* will still undergo the culling test and set `ACTOR_FLAG_INSIDE_CULLING_VOLUME` accordingly.
* So, `ACTOR_FLAG_INSIDE_CULLING_VOLUME` cannot be used on it own to determine if an actor is actually culled.
* It simply says whether or not they are physically located within the bounds of the culling volume.
*/
s32 Actor_CullingCheck(PlayState* play, Actor* actor) {
return Actor_CullingVolumeTest(play, actor, &actor->projectedPos, actor->projectedW);
}
s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3) {
f32 var;
/**
* Tests if an actor is currently within the bounds of its own culling volume.
*
* The culling volume is a 3D shape composed of a frustum with a box attached to the end of it. The frustum sits at the
* camera's position and projects forward, encompassing the player's current view; the box extrudes behind the camera,
* allowing actors in the immediate vicinity behind and to the sides of the camera to be detected.
*
* This function returns true if the actor is within bounds, false if not.
* The comparison is done in projected space against the actor's projected position as the viewing frustum
* in world space transforms to a box in projected space, making the calculation easy.
*
* Every actor can set properties for their own culling volume, changing its dimensions to suit the needs of
* it and its environment. These properties are in units of projected space (i.e. compared to the actor's position
* after perspective projection is applied) are therefore not directly comparable to world units.
* These depend on the current view parameters (fov, aspect, scale, znear, zfar).
* The default parameters considered are (60 degrees, 4/3, 1.0, 10, 12800).
*
* cullingVolumeDistance: Configures how far forward the far plane of the frustum should extend.
* This along with cullingVolumeScale determines the maximum distance from
* the camera eye that the actor can be detected at. This quantity is related
* to world units by a factor of
* (znear - zfar) / ((znear + zfar) * scale).
* For default view parameters, increasing this property by 1 increases the
* distance by ~0.995 world units.
*
* cullingVolumeScale: Scales the entire culling volume in all directions except the downward
* direction. Both the frustum and the box will scale in size. This quantity is
* related to world units by different factors based on direction:
* - For the forward and backward directions, they are related in the same way
* as above. For default view parameters, increasing this property by 1 increases
* the forward and backward scales by ~0.995 world units.
* - For the sideways directions, the relation to world units is
* (aspect / scale) * tan(0.5 * fov)
* For default view parameters, increasing this property by 1 increases the
* sideways scales by ~0.77 world units.
* - For the upward direction, the relation to world units is
* (1 / scale) * tan(0.5 * fov)
* For default view parameters, increasing this property by 1 increases the
* scale by ~0.58 world units.
*
* cullingVolumeDownward: Sets the height of the culling volume in the downward direction. Increasing
* this value will make actors below the camera more easily detected. This
* quantity is related to world units by the same factor as the upward scale.
* For default view parameters, increasing this property by 1 increases the
* downward height by ~0.58 world units.
*
* This interactive 3D graph visualizes the shape of the culling volume and has sliders for the 3 properties mentioned
* above: https://www.desmos.com/3d/4ztkxqky2a.
*/
s32 Actor_CullingVolumeTest(PlayState* play, Actor* actor, Vec3f* projPos, f32 projW) {
f32 invW;
if ((arg2->z > -actor->uncullZoneScale) && (arg2->z < (actor->uncullZoneForward + actor->uncullZoneScale))) {
var = (arg3 < 1.0f) ? 1.0f : 1.0f / arg3;
if ((projPos->z > -actor->cullingVolumeScale) &&
(projPos->z < (actor->cullingVolumeDistance + actor->cullingVolumeScale))) {
// Clamping `projW` affects points behind the camera, so that the culling volume has
// a frustum shape in front of the camera and a box shape behind the camera.
invW = (projW < 1.0f) ? 1.0f : 1.0f / projW;
if ((((fabsf(arg2->x) - actor->uncullZoneScale) * var) < 1.0f) &&
(((arg2->y + actor->uncullZoneDownward) * var) > -1.0f) &&
(((arg2->y - actor->uncullZoneScale) * var) < 1.0f)) {
if ((((fabsf(projPos->x) - actor->cullingVolumeScale) * invW) < 1.0f) &&
(((projPos->y + actor->cullingVolumeDownward) * invW) > -1.0f) &&
(((projPos->y - actor->cullingVolumeScale) * invW) < 1.0f)) {
return true;
}
}
@@ -2767,17 +2841,18 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) {
}
if (!DEBUG_FEATURES || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(70) == 0)) {
if (func_800314B0(play, actor)) {
actor->flags |= ACTOR_FLAG_6;
if (Actor_CullingCheck(play, actor)) {
actor->flags |= ACTOR_FLAG_INSIDE_CULLING_VOLUME;
} else {
actor->flags &= ~ACTOR_FLAG_6;
actor->flags &= ~ACTOR_FLAG_INSIDE_CULLING_VOLUME;
}
}
actor->isDrawn = false;
if (!DEBUG_FEATURES || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(71) == 0)) {
if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & (ACTOR_FLAG_5 | ACTOR_FLAG_6))) {
if ((actor->init == NULL) && (actor->draw != NULL) &&
(actor->flags & (ACTOR_FLAG_DRAW_CULLING_DISABLED | ACTOR_FLAG_INSIDE_CULLING_VOLUME))) {
if ((actor->flags & ACTOR_FLAG_REACT_TO_LENS) &&
((play->roomCtx.curRoom.lensMode == LENS_MODE_SHOW_ACTORS) || play->actorCtx.lensActive ||
(actor->room != play->roomCtx.curRoom.num))) {

View File

@@ -2,7 +2,7 @@
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_d_hsblock/object_d_hsblock.h"
#define FLAGS ACTOR_FLAG_4
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
void EnAObj_Init(Actor* thisx, PlayState* play);
void EnAObj_Destroy(Actor* thisx, PlayState* play);
@@ -114,8 +114,8 @@ void EnAObj_Init(Actor* thisx, PlayState* play) {
this->dyna.bgId = BGACTOR_NEG_ONE;
this->dyna.interactFlags = 0;
this->dyna.transformFlags = 0;
thisx->uncullZoneDownward = 1200.0f;
thisx->uncullZoneScale = 200.0f;
thisx->cullingVolumeDownward = 1200.0f;
thisx->cullingVolumeScale = 200.0f;
switch (thisx->params) {
case A_OBJ_BLOCK_LARGE:
@@ -288,8 +288,8 @@ void EnAObj_BoulderFragment(EnAObj* this, PlayState* play) {
}
void EnAObj_SetupBlock(EnAObj* this, s16 type) {
this->dyna.actor.uncullZoneDownward = 1200.0f;
this->dyna.actor.uncullZoneScale = 720.0f;
this->dyna.actor.cullingVolumeDownward = 1200.0f;
this->dyna.actor.cullingVolumeScale = 720.0f;
EnAObj_SetupAction(this, EnAObj_Block);
}

View File

@@ -980,7 +980,7 @@ EnItem00* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, s16 params) {
(spawnedActor->actor.params != ITEM00_HEART_CONTAINER)) {
spawnedActor->actor.room = -1;
}
spawnedActor->actor.flags |= ACTOR_FLAG_4;
spawnedActor->actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED;
}
}
}
@@ -1012,7 +1012,7 @@ EnItem00* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s16 params) {
spawnedActor->actor.speed = 0.0f;
spawnedActor->actor.gravity = param4000 ? 0.0f : -0.9f;
spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f);
spawnedActor->actor.flags |= ACTOR_FLAG_4;
spawnedActor->actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED;
}
}
}
@@ -1126,7 +1126,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP
spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f;
Actor_SetScale(&spawnedActor->actor, 0.0f);
EnItem00_SetupAction(spawnedActor, func_8001E304);
spawnedActor->actor.flags |= ACTOR_FLAG_4;
spawnedActor->actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED;
if ((spawnedActor->actor.params != ITEM00_SMALL_KEY) &&
(spawnedActor->actor.params != ITEM00_HEART_PIECE) &&
(spawnedActor->actor.params != ITEM00_HEART_CONTAINER)) {

View File

@@ -1,8 +1,8 @@
#include "global.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5 | \
ACTOR_FLAG_UPDATE_DURING_OCARINA | ACTOR_FLAG_CAN_PRESS_SWITCHES)
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
ACTOR_FLAG_DRAW_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA | ACTOR_FLAG_CAN_PRESS_SWITCHES)
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:128 pal-1.1:128"

View File

@@ -1,7 +1,7 @@
#include "z_arms_hook.h"
#include "assets/objects/object_link_boy/object_link_boy.h"
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5)
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
void ArmsHook_Init(Actor* thisx, PlayState* play);
void ArmsHook_Destroy(Actor* thisx, PlayState* play);

View File

@@ -7,7 +7,7 @@
#include "z_arrow_fire.h"
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_UPDATE_DURING_OCARINA)
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
void ArrowFire_Init(Actor* thisx, PlayState* play);
void ArrowFire_Destroy(Actor* thisx, PlayState* play);
@@ -33,7 +33,7 @@ ActorProfile Arrow_Fire_Profile = {
};
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_STOP),
ICHAIN_F32(cullingVolumeDistance, 2000, ICHAIN_STOP),
};
void ArrowFire_SetupAction(ArrowFire* this, ArrowFireActionFunc actionFunc) {

View File

@@ -8,7 +8,7 @@
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_UPDATE_DURING_OCARINA)
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
void ArrowIce_Init(Actor* thisx, PlayState* play);
void ArrowIce_Destroy(Actor* thisx, PlayState* play);
@@ -34,7 +34,7 @@ ActorProfile Arrow_Ice_Profile = {
};
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_STOP),
ICHAIN_F32(cullingVolumeDistance, 2000, ICHAIN_STOP),
};
void ArrowIce_SetupAction(ArrowIce* this, ArrowIceActionFunc actionFunc) {

View File

@@ -8,7 +8,7 @@
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_UPDATE_DURING_OCARINA)
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
void ArrowLight_Init(Actor* thisx, PlayState* play);
void ArrowLight_Destroy(Actor* thisx, PlayState* play);
@@ -34,7 +34,7 @@ ActorProfile Arrow_Light_Profile = {
};
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_STOP),
ICHAIN_F32(cullingVolumeDistance, 2000, ICHAIN_STOP),
};
void ArrowLight_SetupAction(ArrowLight* this, ArrowLightActionFunc actionFunc) {

View File

@@ -8,7 +8,7 @@
#include "quake.h"
#include "assets/objects/object_bdan_objects/object_bdan_objects.h"
#define FLAGS ACTOR_FLAG_4
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
typedef enum BgBdanObjectsPropertyGetter {
JABU_OBJECTS_GET_PROP_CAM_SETTING_NORMAL0 = 0,
@@ -126,7 +126,7 @@ void BgBdanObjects_Init(Actor* thisx, PlayState* play) {
this->var.switchFlag = PARAMS_GET_U(thisx->params, 8, 6);
thisx->params &= 0xFF;
if (thisx->params == JABU_OBJECTS_TYPE_WATERBOX_HEIGHT_CHANGER) {
thisx->flags |= ACTOR_FLAG_4 | ACTOR_FLAG_5;
thisx->flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED;
play->colCtx.colHeader->waterBoxes[7].ySurface = thisx->world.pos.y;
this->actionFunc = BgBdanObjects_WaitForSwitch;
return;

View File

@@ -7,7 +7,7 @@
#include "z_bg_bdan_switch.h"
#include "assets/objects/object_bdan_objects/object_bdan_objects.h"
#define FLAGS ACTOR_FLAG_4
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
void BgBdanSwitch_Init(Actor* thisx, PlayState* play);
void BgBdanSwitch_Destroy(Actor* thisx, PlayState* play);
@@ -82,9 +82,9 @@ static ColliderJntSphInit sJntSphInit = {
};
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 1400, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 500, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1200, ICHAIN_STOP),
ICHAIN_F32(cullingVolumeDistance, 1400, ICHAIN_CONTINUE),
ICHAIN_F32(cullingVolumeScale, 500, ICHAIN_CONTINUE),
ICHAIN_F32(cullingVolumeDownward, 1200, ICHAIN_STOP),
};
static Vec3f D_8086E0E0 = { 0.0f, 140.0f, 0.0f };

View File

@@ -9,7 +9,7 @@
#include "assets/objects/object_bowl/object_bowl.h"
#include "terminal.h"
#define FLAGS ACTOR_FLAG_4
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
void BgBomGuard_Init(Actor* thisx, PlayState* play);
void BgBomGuard_Destroy(Actor* thisx, PlayState* play);

View File

@@ -104,9 +104,9 @@ void BgBombwall_RotateVec(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3) {
}
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 1800, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 300, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
ICHAIN_F32(cullingVolumeDistance, 1800, ICHAIN_CONTINUE),
ICHAIN_F32(cullingVolumeScale, 300, ICHAIN_CONTINUE),
ICHAIN_F32(cullingVolumeDownward, 1000, ICHAIN_STOP),
};
void BgBombwall_Init(Actor* thisx, PlayState* play) {

View File

@@ -11,7 +11,7 @@
#include "quake.h"
#include "terminal.h"
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5)
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
void BgBowlWall_Init(Actor* thisx, PlayState* play);
void BgBowlWall_Destroy(Actor* thisx, PlayState* play);

View File

@@ -9,7 +9,7 @@
#include "assets/objects/object_bwall/object_bwall.h"
#include "assets/objects/object_kingdodongo/object_kingdodongo.h"
#define FLAGS ACTOR_FLAG_4
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
typedef struct BombableWallInfo {
/* 0x00 */ CollisionHeader* colHeader;
@@ -67,9 +67,9 @@ static BombableWallInfo sBombableWallInfo[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 400, ICHAIN_STOP),
ICHAIN_F32(cullingVolumeDistance, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(cullingVolumeScale, 400, ICHAIN_CONTINUE),
ICHAIN_F32(cullingVolumeDownward, 400, ICHAIN_STOP),
};
void BgBreakwall_SetupAction(BgBreakwall* this, BgBreakwallActionFunc actionFunc) {
@@ -207,7 +207,7 @@ void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play) {
this->dyna.actor.objectSlot = this->requiredObjectSlot;
Actor_SetObjectDependency(play, &this->dyna.actor);
this->dyna.actor.flags &= ~ACTOR_FLAG_4;
this->dyna.actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED;
this->dyna.actor.draw = BgBreakwall_Draw;
CollisionHeader_GetVirtual(sBombableWallInfo[wallType].colHeader, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);

View File

@@ -7,7 +7,7 @@
#include "z_bg_ddan_jd.h"
#include "assets/objects/object_ddan_objects/object_ddan_objects.h"
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5)
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
void BgDdanJd_Init(Actor* thisx, PlayState* play);
void BgDdanJd_Destroy(Actor* thisx, PlayState* play);

View File

@@ -7,7 +7,7 @@
#include "z_bg_ddan_kd.h"
#include "assets/objects/object_ddan_objects/object_ddan_objects.h"
#define FLAGS ACTOR_FLAG_4
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
void BgDdanKd_Init(Actor* thisx, PlayState* play);
void BgDdanKd_Destroy(Actor* thisx, PlayState* play);
@@ -52,9 +52,9 @@ static ColliderCylinderInit sCylinderInit = {
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 32767, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 32767, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 32767, ICHAIN_STOP),
ICHAIN_F32(cullingVolumeScale, 32767, ICHAIN_CONTINUE),
ICHAIN_F32(cullingVolumeDownward, 32767, ICHAIN_CONTINUE),
ICHAIN_F32(cullingVolumeDistance, 32767, ICHAIN_STOP),
};
void BgDdanKd_SetupAction(BgDdanKd* this, BgDdanKdActionFunc actionFunc) {

View File

@@ -102,9 +102,9 @@ void BgDodoago_SpawnSparkles(Vec3f* meanPos, PlayState* play) {
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 5000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 800, ICHAIN_STOP),
ICHAIN_F32(cullingVolumeDistance, 5000, ICHAIN_CONTINUE),
ICHAIN_F32(cullingVolumeScale, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(cullingVolumeDownward, 800, ICHAIN_STOP),
};
void BgDodoago_Init(Actor* thisx, PlayState* play) {

View File

@@ -13,9 +13,9 @@
#include "assets/scenes/indoors/daiyousei_izumi/daiyousei_izumi_scene.h"
#if OOT_VERSION < NTSC_1_1
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5)
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
#else
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_UPDATE_DURING_OCARINA)
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA)
#endif
typedef enum BgDyYoseizoRewardType {

View File

@@ -8,7 +8,7 @@
#include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h"
#include "terminal.h"
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5)
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
typedef enum FlashState {
/* 0x00 */ FLASH_NONE,

Some files were not shown because too many files have changed in this diff Show More