Merge pull request #75 from wabberz/master

adding option to disable draw distance
This commit is contained in:
Vinícius R. Miguel 2020-05-14 14:44:00 -03:00 committed by GitHub
commit 5798f0ce8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 103 additions and 1 deletions

View file

@ -27,6 +27,8 @@ COMPILER ?= ido
# Disable better camera by default # Disable better camera by default
BETTERCAMERA ?= 0 BETTERCAMERA ?= 0
# Disable no drawing distance by default
NODRAWINGDISTANCE ?= 0
# Build for Emscripten/WebGL # Build for Emscripten/WebGL
TARGET_WEB ?= 0 TARGET_WEB ?= 0
@ -450,6 +452,12 @@ CC_CHECK += -DBETTERCAMERA
CFLAGS += -DBETTERCAMERA CFLAGS += -DBETTERCAMERA
endif endif
# Check for no drawing distance option
ifeq ($(NODRAWINGDISTANCE),1)
CC_CHECK += -DNODRAWINGDISTANCE
CFLAGS += -DNODRAWINGDISTANCE
endif
ASFLAGS := -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS) ASFLAGS := -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS)
ifeq ($(TARGET_WEB),1) ifeq ($(TARGET_WEB),1)

View file

@ -987,11 +987,15 @@ void cur_obj_update(void) {
} else if ((objFlags & OBJ_FLAG_COMPUTE_DIST_TO_MARIO) && gCurrentObject->collisionData == NULL) { } else if ((objFlags & OBJ_FLAG_COMPUTE_DIST_TO_MARIO) && gCurrentObject->collisionData == NULL) {
if (!(objFlags & OBJ_FLAG_ACTIVE_FROM_AFAR)) { if (!(objFlags & OBJ_FLAG_ACTIVE_FROM_AFAR)) {
// If the object has a render distance, check if it should be shown. // If the object has a render distance, check if it should be shown.
#ifndef NODRAWINGDISTANCE
if (distanceFromMario > gCurrentObject->oDrawingDistance) { if (distanceFromMario > gCurrentObject->oDrawingDistance) {
// Out of render distance, hide the object. // Out of render distance, hide the object.
gCurrentObject->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; gCurrentObject->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
gCurrentObject->activeFlags |= ACTIVE_FLAG_FAR_AWAY; gCurrentObject->activeFlags |= ACTIVE_FLAG_FAR_AWAY;
} else if (gCurrentObject->oHeldState == HELD_FREE) { } else if (gCurrentObject->oHeldState == HELD_FREE) {
#else
if (distanceFromMario <= gCurrentObject->oDrawingDistance && gCurrentObject->oHeldState == HELD_FREE) {
#endif
// In render distance (and not being held), show the object. // In render distance (and not being held), show the object.
gCurrentObject->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE; gCurrentObject->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
gCurrentObject->activeFlags &= ~ACTIVE_FLAG_FAR_AWAY; gCurrentObject->activeFlags &= ~ACTIVE_FLAG_FAR_AWAY;

View file

@ -789,9 +789,13 @@ void load_object_collision_model(void) {
} }
} }
#ifndef NODRAWINGDISTANCE
if (marioDist < gCurrentObject->oDrawingDistance) { if (marioDist < gCurrentObject->oDrawingDistance) {
#endif
gCurrentObject->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE; gCurrentObject->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
#ifndef NODRAWINGDISTANCE
} else { } else {
gCurrentObject->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; gCurrentObject->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
} }
#endif
} }

View file

@ -8,11 +8,15 @@
void bub_spawner_act_0(void) { void bub_spawner_act_0(void) {
s32 i; s32 i;
s32 sp18 = o->oBirdChirpChirpUnkF4; s32 sp18 = o->oBirdChirpChirpUnkF4;
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < 1500.0f) { if (o->oDistanceToMario < 1500.0f) {
#endif
for (i = 0; i < sp18; i++) for (i = 0; i < sp18; i++)
spawn_object(o, MODEL_BUB, bhvBub); spawn_object(o, MODEL_BUB, bhvBub);
o->oAction = 1; o->oAction = 1;
#ifndef NODRAWINGDISTANCE
} }
#endif
} }
void bub_spawner_act_1(void) { void bub_spawner_act_1(void) {

View file

@ -53,7 +53,9 @@ static void chain_chomp_act_uninitialized(void) {
struct ChainSegment *segments; struct ChainSegment *segments;
s32 i; s32 i;
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < 3000.0f) { if (o->oDistanceToMario < 3000.0f) {
#endif
segments = mem_pool_alloc(gObjectMemoryPool, 5 * sizeof(struct ChainSegment)); segments = mem_pool_alloc(gObjectMemoryPool, 5 * sizeof(struct ChainSegment));
if (segments != NULL) { if (segments != NULL) {
// Each segment represents the offset of a chain part to the pivot. // Each segment represents the offset of a chain part to the pivot.
@ -81,7 +83,9 @@ static void chain_chomp_act_uninitialized(void) {
cur_obj_unhide(); cur_obj_unhide();
} }
} }
#ifndef NODRAWINGDISTANCE
} }
#endif
} }
/** /**
@ -359,10 +363,12 @@ static void chain_chomp_act_move(void) {
f32 maxDistToPivot; f32 maxDistToPivot;
// Unload chain if mario is far enough // Unload chain if mario is far enough
#ifndef NODRAWINGDISTANCE
if (o->oChainChompReleaseStatus == CHAIN_CHOMP_NOT_RELEASED && o->oDistanceToMario > 4000.0f) { if (o->oChainChompReleaseStatus == CHAIN_CHOMP_NOT_RELEASED && o->oDistanceToMario > 4000.0f) {
o->oAction = CHAIN_CHOMP_ACT_UNLOAD_CHAIN; o->oAction = CHAIN_CHOMP_ACT_UNLOAD_CHAIN;
o->oForwardVel = o->oVelY = 0.0f; o->oForwardVel = o->oVelY = 0.0f;
} else { } else {
#endif
cur_obj_update_floor_and_walls(); cur_obj_update_floor_and_walls();
switch (o->oChainChompReleaseStatus) { switch (o->oChainChompReleaseStatus) {
@ -446,7 +452,9 @@ static void chain_chomp_act_move(void) {
o->oGravity = -4.0f; o->oGravity = -4.0f;
o->oChainChompTargetPitch = -0x3000; o->oChainChompTargetPitch = -0x3000;
} }
#ifndef NODRAWINGDISTANCE
} }
#endif
} }
/** /**

View file

@ -47,10 +47,14 @@ static void cloud_act_spawn_parts(void) {
* Wait for mario to approach, then unhide and enter the spawn parts action. * Wait for mario to approach, then unhide and enter the spawn parts action.
*/ */
static void cloud_act_fwoosh_hidden(void) { static void cloud_act_fwoosh_hidden(void) {
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < 2000.0f) { if (o->oDistanceToMario < 2000.0f) {
#endif
cur_obj_unhide(); cur_obj_unhide();
o->oAction = CLOUD_ACT_SPAWN_PARTS; o->oAction = CLOUD_ACT_SPAWN_PARTS;
#ifndef NODRAWINGDISTANCE
} }
#endif
} }
/** /**
@ -58,9 +62,11 @@ static void cloud_act_fwoosh_hidden(void) {
* long enough, blow wind at him. * long enough, blow wind at him.
*/ */
static void cloud_fwoosh_update(void) { static void cloud_fwoosh_update(void) {
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario > 2500.0f) { if (o->oDistanceToMario > 2500.0f) {
o->oAction = CLOUD_ACT_UNLOAD; o->oAction = CLOUD_ACT_UNLOAD;
} else { } else {
#endif
if (o->oCloudBlowing) { if (o->oCloudBlowing) {
o->header.gfx.scale[0] += o->oCloudGrowSpeed; o->header.gfx.scale[0] += o->oCloudGrowSpeed;
@ -95,7 +101,9 @@ static void cloud_fwoosh_update(void) {
} }
cur_obj_scale(o->header.gfx.scale[0]); cur_obj_scale(o->header.gfx.scale[0]);
#ifndef NODRAWINGDISTANCE
} }
#endif
} }
/** /**

View file

@ -184,17 +184,23 @@ void bhv_coin_formation_loop(void) {
s32 bitIndex; s32 bitIndex;
switch (o->oAction) { switch (o->oAction) {
case 0: case 0:
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < 2000.0f) { if (o->oDistanceToMario < 2000.0f) {
#endif
for (bitIndex = 0; bitIndex < 8; bitIndex++) { for (bitIndex = 0; bitIndex < 8; bitIndex++) {
if (!(o->oCoinUnkF4 & (1 << bitIndex))) if (!(o->oCoinUnkF4 & (1 << bitIndex)))
spawn_coin_in_formation(bitIndex, o->oBehParams2ndByte); spawn_coin_in_formation(bitIndex, o->oBehParams2ndByte);
} }
o->oAction++; o->oAction++;
#ifndef NODRAWINGDISTANCE
} }
#endif
break; break;
case 1: case 1:
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario > 2100.0f) if (o->oDistanceToMario > 2100.0f)
o->oAction++; o->oAction++;
#endif
break; break;
case 2: case 2:
o->oAction = 0; o->oAction = 0;

View file

@ -24,12 +24,16 @@ static struct ObjectHitbox sEnemyLakituHitbox = {
* Wait for mario to approach, then spawn the cloud and become visible. * Wait for mario to approach, then spawn the cloud and become visible.
*/ */
static void enemy_lakitu_act_uninitialized(void) { static void enemy_lakitu_act_uninitialized(void) {
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < 2000.0f) { if (o->oDistanceToMario < 2000.0f) {
#endif
spawn_object_relative_with_scale(CLOUD_BP_LAKITU_CLOUD, 0, 0, 0, 2.0f, o, MODEL_MIST, bhvCloud); spawn_object_relative_with_scale(CLOUD_BP_LAKITU_CLOUD, 0, 0, 0, 2.0f, o, MODEL_MIST, bhvCloud);
cur_obj_unhide(); cur_obj_unhide();
o->oAction = ENEMY_LAKITU_ACT_MAIN; o->oAction = ENEMY_LAKITU_ACT_MAIN;
#ifndef NODRAWINGDISTANCE
} }
#endif
} }
/** /**

View file

@ -42,7 +42,9 @@ void fish_act_spawn(void) {
* If the current level is Secret Aquarium, ignore this requirement. * If the current level is Secret Aquarium, ignore this requirement.
* Fish moves at random with a max-range of 700.0f. * Fish moves at random with a max-range of 700.0f.
*/ */
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < minDistToMario || gCurrLevelNum == LEVEL_SA) { if (o->oDistanceToMario < minDistToMario || gCurrLevelNum == LEVEL_SA) {
#endif
for (i = 0; i < schoolQuantity; i++) { for (i = 0; i < schoolQuantity; i++) {
fishObject = spawn_object(o, model, bhvFish); fishObject = spawn_object(o, model, bhvFish);
fishObject->oBehParams2ndByte = o->oBehParams2ndByte; fishObject->oBehParams2ndByte = o->oBehParams2ndByte;
@ -50,7 +52,9 @@ void fish_act_spawn(void) {
obj_translate_xyz_random(fishObject, 700.0f); obj_translate_xyz_random(fishObject, 700.0f);
} }
o->oAction = FISH_ACT_ACTIVE; o->oAction = FISH_ACT_ACTIVE;
#ifndef NODRAWINGDISTANCE
} }
#endif
} }
/** /**

View file

@ -78,7 +78,9 @@ void bhv_goomba_triplet_spawner_update(void) {
// If mario is close enough and the goombas aren't currently loaded, then // If mario is close enough and the goombas aren't currently loaded, then
// spawn them // spawn them
if (o->oAction == GOOMBA_TRIPLET_SPAWNER_ACT_UNLOADED) { if (o->oAction == GOOMBA_TRIPLET_SPAWNER_ACT_UNLOADED) {
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < 3000.0f) { if (o->oDistanceToMario < 3000.0f) {
#endif
// The spawner is capable of spawning more than 3 goombas, but this // The spawner is capable of spawning more than 3 goombas, but this
// is not used in the game // is not used in the game
dAngle = dAngle =
@ -98,11 +100,13 @@ void bhv_goomba_triplet_spawner_update(void) {
} }
o->oAction += 1; o->oAction += 1;
#ifndef NODRAWINGDISTANCE
} }
} else if (o->oDistanceToMario > 4000.0f) { } else if (o->oDistanceToMario > 4000.0f) {
// If mario is too far away, enter the unloaded action. The goombas // If mario is too far away, enter the unloaded action. The goombas
// will detect this and unload themselves // will detect this and unload themselves
o->oAction = GOOMBA_TRIPLET_SPAWNER_ACT_UNLOADED; o->oAction = GOOMBA_TRIPLET_SPAWNER_ACT_UNLOADED;
#endif
} }
} }

View file

@ -72,8 +72,12 @@ void heave_ho_act_3(void) {
} }
void heave_ho_act_0(void) { void heave_ho_act_0(void) {
cur_obj_set_pos_to_home(); #ifndef NODRAWINGDISTANCE
if (find_water_level(o->oPosX, o->oPosZ) < o->oPosY && o->oDistanceToMario < 4000.0f) { if (find_water_level(o->oPosX, o->oPosZ) < o->oPosY && o->oDistanceToMario < 4000.0f) {
#else
if (find_water_level(o->oPosX, o->oPosZ) < (o->oPosY - 50.0f)) {
#endif
cur_obj_set_pos_to_home();
cur_obj_become_tangible(); cur_obj_become_tangible();
cur_obj_unhide(); cur_obj_unhide();
o->oAction = 1; o->oAction = 1;

View file

@ -295,10 +295,14 @@ void king_bobomb_move(void) {
cur_obj_move_using_fvel_and_gravity(); cur_obj_move_using_fvel_and_gravity();
cur_obj_call_action_function(sKingBobombActions); cur_obj_call_action_function(sKingBobombActions);
exec_anim_sound_state(sKingBobombSoundStates); exec_anim_sound_state(sKingBobombSoundStates);
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < 5000.0f) if (o->oDistanceToMario < 5000.0f)
#endif
cur_obj_enable_rendering(); cur_obj_enable_rendering();
#ifndef NODRAWINGDISTANCE
else else
cur_obj_disable_rendering(); cur_obj_disable_rendering();
#endif
} }
void bhv_king_bobomb_loop(void) { void bhv_king_bobomb_loop(void) {

View file

@ -14,18 +14,24 @@ void bhv_lll_floating_wood_bridge_loop(void) {
s32 i; s32 i;
switch (o->oAction) { switch (o->oAction) {
case 0: case 0:
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < 2500.0f) { if (o->oDistanceToMario < 2500.0f) {
#endif
for (i = 1; i < 4; i++) { for (i = 1; i < 4; i++) {
sp3C = spawn_object_relative(0, (i - 2) * 300, 0, 0, o, MODEL_LLL_WOOD_BRIDGE, sp3C = spawn_object_relative(0, (i - 2) * 300, 0, 0, o, MODEL_LLL_WOOD_BRIDGE,
bhvLllWoodPiece); bhvLllWoodPiece);
sp3C->oLllWoodPieceUnkF4 = i * 4096; sp3C->oLllWoodPieceUnkF4 = i * 4096;
} }
o->oAction = 1; o->oAction = 1;
#ifndef NODRAWINGDISTANCE
} }
#endif
break; break;
case 1: case 1:
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario > 2600.0f) if (o->oDistanceToMario > 2600.0f)
o->oAction = 2; o->oAction = 2;
#endif
break; break;
case 2: case 2:
o->oAction = 0; o->oAction = 0;

View file

@ -30,7 +30,9 @@ void fire_bar_spawn_flames(s16 a0) {
} }
void fire_bar_act_0(void) { void fire_bar_act_0(void) {
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < 3000.0f) if (o->oDistanceToMario < 3000.0f)
#endif
o->oAction = 1; o->oAction = 1;
} }
@ -45,8 +47,10 @@ void fire_bar_act_1(void) {
void fire_bar_act_2(void) { void fire_bar_act_2(void) {
o->oAngleVelYaw = -0x100; o->oAngleVelYaw = -0x100;
o->oMoveAngleYaw += o->oAngleVelYaw; o->oMoveAngleYaw += o->oAngleVelYaw;
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario > 3200.0f) if (o->oDistanceToMario > 3200.0f)
o->oAction = 3; o->oAction = 3;
#endif
} }
void fire_bar_act_3(void) { void fire_bar_act_3(void) {

View file

@ -151,7 +151,9 @@ static void pokey_act_uninitialized(void) {
s32 i; s32 i;
s16 partModel; s16 partModel;
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < 2000.0f) { if (o->oDistanceToMario < 2000.0f) {
#endif
partModel = MODEL_POKEY_HEAD; partModel = MODEL_POKEY_HEAD;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
@ -170,7 +172,9 @@ static void pokey_act_uninitialized(void) {
o->oPokeyNumAliveBodyParts = 5; o->oPokeyNumAliveBodyParts = 5;
o->oPokeyBottomBodyPartSize = 1.0f; o->oPokeyBottomBodyPartSize = 1.0f;
o->oAction = POKEY_ACT_WANDER; o->oAction = POKEY_ACT_WANDER;
#ifndef NODRAWINGDISTANCE
} }
#endif
} }
/** /**
@ -185,9 +189,11 @@ static void pokey_act_wander(void) {
if (o->oPokeyNumAliveBodyParts == 0) { if (o->oPokeyNumAliveBodyParts == 0) {
obj_mark_for_deletion(o); obj_mark_for_deletion(o);
#ifndef NODRAWINGDISTANCE
} else if (o->oDistanceToMario > 2500.0f) { } else if (o->oDistanceToMario > 2500.0f) {
o->oAction = POKEY_ACT_UNLOAD_PARTS; o->oAction = POKEY_ACT_UNLOAD_PARTS;
o->oForwardVel = 0.0f; o->oForwardVel = 0.0f;
#endif
} else { } else {
treat_far_home_as_mario(1000.0f); treat_far_home_as_mario(1000.0f);
cur_obj_update_floor_and_walls(); cur_obj_update_floor_and_walls();

View file

@ -180,7 +180,11 @@ void bhv_snufit_loop(void) {
void bhv_snufit_balls_loop(void) { void bhv_snufit_balls_loop(void) {
// If far from Mario or in a different room, despawn. // If far from Mario or in a different room, despawn.
if ((o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM) if ((o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)
#ifndef NODRAWINGDISTANCE
|| (o->oTimer != 0 && o->oDistanceToMario > 1500.0f)) { || (o->oTimer != 0 && o->oDistanceToMario > 1500.0f)) {
#else
|| (o->oTimer != 0)) {
#endif
obj_mark_for_deletion(o); obj_mark_for_deletion(o);
} }

View file

@ -54,9 +54,11 @@ static void triplet_butterfly_act_init(void) {
} }
static void triplet_butterfly_act_wander(void) { static void triplet_butterfly_act_wander(void) {
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario > 1500.0f) { if (o->oDistanceToMario > 1500.0f) {
obj_mark_for_deletion(o); obj_mark_for_deletion(o);
} else { } else {
#endif
approach_f32_ptr(&o->oTripletButterflySpeed, 8.0f, 0.5f); approach_f32_ptr(&o->oTripletButterflySpeed, 8.0f, 0.5f);
if (o->oTimer < 60) { if (o->oTimer < 60) {
o->oTripletButterflyTargetYaw = cur_obj_angle_to_home(); o->oTripletButterflyTargetYaw = cur_obj_angle_to_home();
@ -82,7 +84,9 @@ static void triplet_butterfly_act_wander(void) {
obj_move_pitch_approach(o->oTripletButterflyTargetPitch, 400); obj_move_pitch_approach(o->oTripletButterflyTargetPitch, 400);
cur_obj_rotate_yaw_toward(o->oTripletButterflyTargetYaw, random_linear_offset(400, 800)); cur_obj_rotate_yaw_toward(o->oTripletButterflyTargetYaw, random_linear_offset(400, 800));
#ifndef NODRAWINGDISTANCE
} }
#endif
} }
static void triplet_butterfly_act_activate(void) { static void triplet_butterfly_act_activate(void) {

View file

@ -38,19 +38,27 @@ void bhv_bubble_cannon_barrel_loop(void) {
} }
void water_bomb_cannon_act_0(void) { void water_bomb_cannon_act_0(void) {
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < 2000.0f) { if (o->oDistanceToMario < 2000.0f) {
#endif
spawn_object(o, MODEL_CANNON_BARREL, bhvCannonBarrelBubbles); spawn_object(o, MODEL_CANNON_BARREL, bhvCannonBarrelBubbles);
cur_obj_unhide(); cur_obj_unhide();
o->oAction = 1; o->oAction = 1;
o->oMoveAnglePitch = o->oWaterCannonUnkFC = 0x1C00; o->oMoveAnglePitch = o->oWaterCannonUnkFC = 0x1C00;
#ifndef NODRAWINGDISTANCE
} }
#endif
} }
void water_bomb_cannon_act_1(void) { void water_bomb_cannon_act_1(void) {
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario > 2500.0f) { if (o->oDistanceToMario > 2500.0f) {
o->oAction = 2; o->oAction = 2;
} else if (o->oBehParams2ndByte == 0) { } else if (o->oBehParams2ndByte == 0) {
#else
if (o->oBehParams2ndByte == 0) {
#endif
if (o->oWaterCannonUnkF4 != 0) { if (o->oWaterCannonUnkF4 != 0) {
o->oWaterCannonUnkF4 -= 1; o->oWaterCannonUnkF4 -= 1;
} else { } else {

View file

@ -35,7 +35,9 @@ void whirpool_orient_graph(void) {
} }
void bhv_whirlpool_loop(void) { void bhv_whirlpool_loop(void) {
#ifndef NODRAWINGDISTANCE
if (o->oDistanceToMario < 5000.0f) { if (o->oDistanceToMario < 5000.0f) {
#endif
o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE;
// not sure if actually an array // not sure if actually an array
@ -52,10 +54,12 @@ void bhv_whirlpool_loop(void) {
whirpool_orient_graph(); whirpool_orient_graph();
o->oFaceAngleYaw += 0x1F40; o->oFaceAngleYaw += 0x1F40;
#ifndef NODRAWINGDISTANCE
} else { } else {
o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE; o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE;
gEnvFxBubbleConfig[ENVFX_STATE_PARTICLECOUNT] = 0; gEnvFxBubbleConfig[ENVFX_STATE_PARTICLECOUNT] = 0;
} }
#endif
cur_obj_play_sound_1(SOUND_ENV_WATER); cur_obj_play_sound_1(SOUND_ENV_WATER);

View file

@ -527,11 +527,15 @@ void set_object_visibility(struct Object *obj, s32 dist) {
f32 objY = obj->oPosY; f32 objY = obj->oPosY;
f32 objZ = obj->oPosZ; f32 objZ = obj->oPosZ;
#ifndef NODRAWINGDISTANCE
if (is_point_within_radius_of_mario(objX, objY, objZ, dist) == TRUE) { if (is_point_within_radius_of_mario(objX, objY, objZ, dist) == TRUE) {
#endif
obj->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; obj->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE;
#ifndef NODRAWINGDISTANCE
} else { } else {
obj->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE; obj->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE;
} }
#endif
} }
/** /**