![]() |
Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
|
#include <ultra64.h>
#include "sm64.h"
#include "engine/math_util.h"
#include "area.h"
#include "engine/geo_layout.h"
#include "engine/graph_node.h"
#include "object_helpers.h"
#include "engine/behavior_script.h"
#include "engine/surface_collision.h"
#include "audio/external.h"
#include "level_update.h"
#include "spawn_object.h"
#include "object_list_processor.h"
Data Structures | |
struct | LinkedList |
An unused linked list struct that seems to have been replaced by ObjectNode. More... | |
Functions | |
static void | unused_init_free_list (struct LinkedList *usedList, struct LinkedList **pFreeList, struct LinkedList *pool, s32 itemSize, s32 poolLength) |
Clear the doubly linked usedList. More... | |
static struct LinkedList * | unused_try_allocate (struct LinkedList *destList, struct LinkedList *freeList) |
Attempt to allocate a node from freeList (singly linked) and append it to the end of destList (doubly linked). More... | |
static struct Object * | try_allocate_object (struct ObjectNode *destList, struct ObjectNode *freeList) |
Attempt to allocate an object from freeList (singly linked) and append it to the end of destList (doubly linked). More... | |
static void | unused_deallocate (struct LinkedList *freeList, struct LinkedList *node) |
Remove the node from the doubly linked list it's in, and place it in the singly linked freeList. More... | |
static void | deallocate_object (struct ObjectNode *freeList, struct ObjectNode *obj) |
Remove the given object from the object list that it's currently in, and insert it at the beginning of the free list (singly linked). More... | |
void | init_free_object_list (void) |
Add every object in the pool to the free object list. More... | |
void | clear_object_lists (struct ObjectNode *objLists) |
Clear each object list, without adding the objects back to the free list. More... | |
static void | unused_delete_leaf_nodes (struct Object *obj) |
This function looks broken, but it appears to attempt to delete the leaf graph nodes under obj and obj's siblings. More... | |
void | unload_object (struct Object *obj) |
Free the given object. More... | |
static struct Object * | allocate_object (struct ObjectNode *objList) |
Attempt to allocate a new object slot into the given object list, freeing an unimportant object if necessary. More... | |
static void | snap_object_to_floor (struct Object *obj) |
If the object is close to being on the floor, move it to be exactly on the floor. More... | |
struct Object * | create_object (u32 *behScript) |
Spawn an object at the origin with the behavior script at virtual address behScript. More... | |
void | mark_obj_for_deletion (struct Object *obj) |
Mark an object to be unloaded at the end of the frame. More... | |
|
static |
Attempt to allocate a new object slot into the given object list, freeing an unimportant object if necessary.
If this is not possible, hang using an infinite loop.
Uh oh, the unimportant object was in the middle of
void clear_object_lists | ( | struct ObjectNode * | objLists | ) |
Clear each object list, without adding the objects back to the free list.
Spawn an object at the origin with the behavior script at virtual address behScript.
They intended to snap certain objects to the floor when they spawn.
|
static |
Remove the given object from the object list that it's currently in, and insert it at the beginning of the free list (singly linked).
Mark an object to be unloaded at the end of the frame.
Same issue as mark_object_for_deletion
If the object is close to being on the floor, move it to be exactly on the floor.
|
static |
Attempt to allocate an object from freeList (singly linked) and append it to the end of destList (doubly linked).
Return the object, or NULL if freeList is empty.
|
static |
Remove the node from the doubly linked list it's in, and place it in the singly linked freeList.
This function seems to have been replaced by deallocate_object.
This function looks broken, but it appears to attempt to delete the leaf graph nodes under obj and obj's siblings.
|
static |
Clear the doubly linked usedList.
Singly link each item in the pool into a list, and return this list in pFreeList. Appears to have been replaced by init_free_object_list.
|
static |
Attempt to allocate a node from freeList (singly linked) and append it to the end of destList (doubly linked).
Return the object, or NULL if freeList is empty. Appears to have been replaced by try_allocate_object.