sm64

A Super Mario 64 decompilation
Log | Files | Refs | README | LICENSE

object_list_processor.h (4513B)


      1 #ifndef OBJECT_LIST_PROCESSOR_H
      2 #define OBJECT_LIST_PROCESSOR_H
      3 
      4 #include <PR/ultratypes.h>
      5 
      6 #include "area.h"
      7 #include "macros.h"
      8 #include "types.h"
      9 
     10 /**
     11  * Flags for gTimeStopState. These control which objects are processed each frame
     12  * and also track some miscellaneous info.
     13  */
     14 #define TIME_STOP_UNKNOWN_0         (1 << 0)
     15 #define TIME_STOP_ENABLED           (1 << 1)
     16 #define TIME_STOP_DIALOG            (1 << 2)
     17 #define TIME_STOP_MARIO_AND_DOORS   (1 << 3)
     18 #define TIME_STOP_ALL_OBJECTS       (1 << 4)
     19 #define TIME_STOP_MARIO_OPENED_DOOR (1 << 5)
     20 #define TIME_STOP_ACTIVE            (1 << 6)
     21 
     22 
     23 /**
     24  * The maximum number of objects that can be loaded at once.
     25  */
     26 #define OBJECT_POOL_CAPACITY 240
     27 
     28 /**
     29  * Every object is categorized into an object list, which controls the order
     30  * they are processed and which objects they can collide with.
     31  */
     32 enum ObjectList {
     33     OBJ_LIST_PLAYER,      //  (0) Mario
     34     OBJ_LIST_UNUSED_1,    //  (1) (unused)
     35     OBJ_LIST_DESTRUCTIVE, //  (2) things that can be used to destroy other objects, like
     36                           //      bob-ombs and corkboxes
     37     OBJ_LIST_UNUSED_3,    //  (3) (unused)
     38     OBJ_LIST_GENACTOR,    //  (4) general actors. most normal 'enemies' or actors are
     39                           //      on this list. (MIPS, bullet bill, bully, etc)
     40     OBJ_LIST_PUSHABLE,    //  (5) pushable actors. This is a group of objects which
     41                           //      can push each other around as well as their parent
     42                           //      objects. (goombas, koopas, spinies)
     43     OBJ_LIST_LEVEL,       //  (6) level objects. general level objects such as heart, star
     44     OBJ_LIST_UNUSED_7,    //  (7) (unused)
     45     OBJ_LIST_DEFAULT,     //  (8) default objects. objects that didnt start with a 00
     46                           //      command are put here, so this is treated as a default.
     47     OBJ_LIST_SURFACE,     //  (9) surface objects. objects that specifically have surface
     48                           //      collision and not object collision. (thwomp, whomp, etc)
     49     OBJ_LIST_POLELIKE,    // (10) polelike objects. objects that attract or otherwise
     50                           //      "cling" Mario similar to a pole action. (hoot,
     51                           //      whirlpool, trees/poles, etc)
     52     OBJ_LIST_SPAWNER,     // (11) spawners
     53     OBJ_LIST_UNIMPORTANT, // (12) unimportant objects. objects that will not load
     54                           //      if there are not enough object slots: they will also
     55                           //      be manually unloaded to make room for slots if the list
     56                           //      gets exhausted.
     57     NUM_OBJ_LISTS
     58 };
     59 
     60 
     61 extern struct ObjectNode gObjectListArray[];
     62 
     63 extern s32 gDebugInfoFlags;
     64 extern s32 gNumFindFloorMisses;
     65 extern UNUSED s32 unused_8033BEF8;
     66 extern s32 gUnknownWallCount;
     67 extern u32 gObjectCounter;
     68 
     69 struct NumTimesCalled {
     70     /*0x00*/ s16 floor;
     71     /*0x02*/ s16 ceil;
     72     /*0x04*/ s16 wall;
     73 };
     74 
     75 extern struct NumTimesCalled gNumCalls;
     76 
     77 extern s16 gDebugInfo[][8];
     78 extern s16 gDebugInfoOverwrite[][8];
     79 
     80 extern u32 gTimeStopState;
     81 extern struct Object gObjectPool[];
     82 extern struct Object gMacroObjectDefaultParent;
     83 extern struct ObjectNode *gObjectLists;
     84 extern struct ObjectNode gFreeObjectList;
     85 
     86 extern struct Object *gMarioObject;
     87 extern struct Object *gLuigiObject;
     88 extern struct Object *gCurrentObject;
     89 
     90 extern const BehaviorScript *gCurBhvCommand;
     91 extern s16 gPrevFrameObjectCount;
     92 
     93 extern s32 gSurfaceNodesAllocated;
     94 extern s32 gSurfacesAllocated;
     95 extern s32 gNumStaticSurfaceNodes;
     96 extern s32 gNumStaticSurfaces;
     97 
     98 extern struct MemoryPool *gObjectMemoryPool;
     99 
    100 extern s16 gCheckingSurfaceCollisionsForCamera;
    101 extern s16 gFindFloorIncludeSurfaceIntangible;
    102 extern TerrainData *gEnvironmentRegions;
    103 extern s32 gEnvironmentLevels[20];
    104 extern RoomData gDoorAdjacentRooms[60][2];
    105 extern s16 gMarioCurrentRoom;
    106 extern s16 D_8035FEE2;
    107 extern s16 D_8035FEE4;
    108 extern s16 gTHIWaterDrained;
    109 extern s16 gTTCSpeedSetting;
    110 extern s16 gMarioShotFromCannon;
    111 extern s16 gCCMEnteredSlide;
    112 extern s16 gNumRoomedObjectsInMarioRoom;
    113 extern s16 gNumRoomedObjectsNotInMarioRoom;
    114 extern s16 gWDWWaterLevelChanging;
    115 extern s16 gMarioOnMerryGoRound;
    116 
    117 
    118 void bhv_mario_update(void);
    119 void set_object_respawn_info_bits(struct Object *obj, u8 bits);
    120 void unload_objects_from_area(UNUSED s32 unused, s32 areaIndex);
    121 void spawn_objects_from_info(UNUSED s32 unused, struct SpawnInfo *spawnInfo);
    122 void clear_objects(void);
    123 void update_objects(UNUSED s32 unused);
    124 
    125 
    126 #endif // OBJECT_LIST_PROCESSOR_H