Small improvements to object loading within rooms (#580)
* Small improvements to object loading within rooms * Only check if Mario is in the same room as the object once * Implement object render distance within rooms (from thecozies) * Remove sLevelsWithRooms (also from thecozies) Honestly surprised this wasn't already in Hacker * Remove comment for sLevelsWithRooms in config_game * Make compatible with the painting objects PR Move room detection to get_room_at_pos (from Arceveti) * address enum comment
This commit is contained in:
1 parent
337dac828f
commit
be753ae220
6 files changed
+54
-33
No files matched your search
@@ -820,11 +820,11 @@ void cur_obj_update(void) {
|
||||
BhvCommandProc bhvCmdProc;
|
||||
s32 bhvProcResult;
|
||||
|
||||
s32 inRoom = is_mario_in_room();
|
||||
|
||||
if (!(objFlags & OBJ_FLAG_PROCESS_OUTSIDE_ROOM)) {
|
||||
if (o->oRoom != -1 && gMarioCurrentRoom != 0 && !is_room_loaded()) {
|
||||
cur_obj_disable_rendering();
|
||||
o->activeFlags |= ACTIVE_FLAG_IN_DIFFERENT_ROOM;
|
||||
gNumRoomedObjectsNotInMarioRoom++;
|
||||
if (inRoom == MARIO_OUTSIDE_ROOM) {
|
||||
cur_obj_enable_disable_room_rendering(MARIO_OUTSIDE_ROOM);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -928,7 +928,16 @@ void cur_obj_update(void) {
|
||||
// Handle visibility of object
|
||||
if (o->oRoom != -1) {
|
||||
// If the object is in a room, only show it when Mario is in the room.
|
||||
cur_obj_enable_rendering_if_mario_in_room();
|
||||
if (
|
||||
(objFlags & OBJ_FLAG_ACTIVE_FROM_AFAR)
|
||||
|| distanceFromMario < o->oDrawingDistance
|
||||
) {
|
||||
cur_obj_enable_disable_room_rendering(inRoom);
|
||||
o->activeFlags &= ~ACTIVE_FLAG_FAR_AWAY;
|
||||
} else {
|
||||
o->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
|
||||
o->activeFlags |= ACTIVE_FLAG_FAR_AWAY;
|
||||
}
|
||||
} else if (
|
||||
o->collisionData == NULL
|
||||
&& (objFlags & OBJ_FLAG_COMPUTE_DIST_TO_MARIO)
|
||||
|
||||
Reference in new issue
Block a user