sm64

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

geo_layout.h (2896B)


      1 #ifndef GEO_LAYOUT_H
      2 #define GEO_LAYOUT_H
      3 
      4 #include <PR/ultratypes.h>
      5 
      6 #include "game/memory.h"
      7 #include "macros.h"
      8 #include "types.h"
      9 
     10 #define GEO_CMD_FLAGS_RESET 0
     11 #define GEO_CMD_FLAGS_SET   1
     12 #define GEO_CMD_FLAGS_CLEAR 2
     13 
     14 #define CMD_SIZE_SHIFT (sizeof(void *) >> 3)
     15 #define CMD_PROCESS_OFFSET(offset) (((offset) & 3) | (((offset) & ~3) << CMD_SIZE_SHIFT))
     16 
     17 #define cur_geo_cmd_u8(offset) \
     18     (gGeoLayoutCommand[CMD_PROCESS_OFFSET(offset)])
     19 
     20 #define cur_geo_cmd_s16(offset) \
     21     (*(s16 *) &gGeoLayoutCommand[CMD_PROCESS_OFFSET(offset)])
     22 
     23 #define cur_geo_cmd_s32(offset) \
     24     (*(s32 *) &gGeoLayoutCommand[CMD_PROCESS_OFFSET(offset)])
     25 
     26 #define cur_geo_cmd_u32(offset) \
     27     (*(u32 *) &gGeoLayoutCommand[CMD_PROCESS_OFFSET(offset)])
     28 
     29 #define cur_geo_cmd_ptr(offset) \
     30     (*(void **) &gGeoLayoutCommand[CMD_PROCESS_OFFSET(offset)])
     31 
     32 extern struct AllocOnlyPool *gGraphNodePool;
     33 extern struct GraphNode *gCurRootGraphNode;
     34 extern UNUSED s32 D_8038BCA8;
     35 extern struct GraphNode **gGeoViews;
     36 extern u16 gGeoNumViews;
     37 extern uintptr_t gGeoLayoutStack[];
     38 extern struct GraphNode *gCurGraphNodeList[];
     39 extern s16 gCurGraphNodeIndex;
     40 extern s16 gGeoLayoutStackIndex;
     41 extern UNUSED s16 D_8038BD7C;
     42 extern s16 gGeoLayoutReturnIndex;
     43 extern u8 *gGeoLayoutCommand;
     44 extern struct GraphNode gObjParentGraphNode;
     45 
     46 extern struct AllocOnlyPool *D_8038BCA0;
     47 extern struct GraphNode *D_8038BCA4;
     48 extern s16 D_8038BD78;
     49 extern struct GraphNode *D_8038BCF8[];
     50 
     51 void geo_layout_cmd_branch_and_link(void);
     52 void geo_layout_cmd_end(void);
     53 void geo_layout_cmd_branch(void);
     54 void geo_layout_cmd_return(void);
     55 void geo_layout_cmd_open_node(void);
     56 void geo_layout_cmd_close_node(void);
     57 void geo_layout_cmd_assign_as_view(void);
     58 void geo_layout_cmd_update_node_flags(void);
     59 void geo_layout_cmd_node_root(void);
     60 void geo_layout_cmd_node_ortho_projection(void);
     61 void geo_layout_cmd_node_perspective(void);
     62 void geo_layout_cmd_node_start(void);
     63 void geo_layout_cmd_nop3(void);
     64 void geo_layout_cmd_node_master_list(void);
     65 void geo_layout_cmd_node_level_of_detail(void);
     66 void geo_layout_cmd_node_switch_case(void);
     67 void geo_layout_cmd_node_camera(void);
     68 void geo_layout_cmd_node_translation_rotation(void);
     69 void geo_layout_cmd_node_translation(void);
     70 void geo_layout_cmd_node_rotation(void);
     71 void geo_layout_cmd_node_scale(void);
     72 void geo_layout_cmd_nop2(void);
     73 void geo_layout_cmd_node_animated_part(void);
     74 void geo_layout_cmd_node_billboard(void);
     75 void geo_layout_cmd_node_display_list(void);
     76 void geo_layout_cmd_node_shadow(void);
     77 void geo_layout_cmd_node_object_parent(void);
     78 void geo_layout_cmd_node_generated(void);
     79 void geo_layout_cmd_node_background(void);
     80 void geo_layout_cmd_nop(void);
     81 void geo_layout_cmd_copy_view(void);
     82 void geo_layout_cmd_node_held_obj(void);
     83 void geo_layout_cmd_node_culling_radius(void);
     84 
     85 struct GraphNode *process_geo_layout(struct AllocOnlyPool *a0, void *segptr);
     86 
     87 #endif // GEO_LAYOUT_H