diff --git a/README.md b/README.md index a89c2237..12817f23 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin - haveyourcake, also known as cake screen fix. Made by Wiseguy and ported/PR'd by Cheezepin - Tree particle fix (Whether a tree uses snow particles or not is decided via the model IDs instead of the course number) - Removed the ifdef hell in `file_select.c` and `ingame_menu.c` +- Added blake's custom function for object model stuff: `obj_set_model` and `obj_has_model` - Coordinate overflow fix by falcobuster. Your levels will render correctly on console and LLE emulators even when using 2x or 4x bounds, while not hurting anything on HLE plugins. **This is automatic now, you don't have to set WORLD_SCALE manually.** It also uncringes the way that apply_patch.sh works, and removes the black border. diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index d0891f03..0e4fc295 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -2889,3 +2889,14 @@ void cur_obj_spawn_star_at_y_offset(f32 targetX, f32 targetY, f32 targetZ, f32 o o->oPosY = objectPosY; } #endif + +// Extra functions for ultrasm64-extbounds +void obj_set_model(struct Object *obj, s32 modelID) { + obj->header.gfx.sharedChild = gLoadedGraphNodes[modelID]; +} + +s32 obj_has_model(struct Object *obj, u16 modelID) { + return (obj->header.gfx.sharedChild == gLoadedGraphNodes[modelID]); +} +// End of ultrasm64-extbounds stuff + diff --git a/src/game/object_helpers.h b/src/game/object_helpers.h index fb2d5ae2..cea3c071 100644 --- a/src/game/object_helpers.h +++ b/src/game/object_helpers.h @@ -298,4 +298,9 @@ void cur_obj_spawn_loot_blue_coin(void); void cur_obj_spawn_star_at_y_offset(f32 targetX, f32 targetY, f32 targetZ, f32 offsetY); #endif +// Extra functions for ultrasm64-extbounds +void obj_set_model(struct Object *obj, s32 modelID); +s32 obj_has_model(struct Object *obj, u16 modelID); +// End of ultrasm64-extbounds stuff + #endif // OBJECT_HELPERS_H