Added obj_set_model and obj_has_model functions

This commit is contained in:
Reonu
2021-06-28 22:37:47 +01:00
parent 63f7aacf62
commit dfa33a2a84
3 changed files with 17 additions and 0 deletions

View File

@@ -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.

View File

@@ -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

View File

@@ -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