Compare commits

...

3 Commits

Author SHA1 Message Date
Mr-Wiseguy
5382e57a44 Implemented a function table to optimize geo_process_node_and_siblings 2022-03-22 15:23:29 -04:00
Arceveti
8cfd9af4ee Uncomment the last gSPPopMatrix in render_hud_cannon_reticle (#351) 2022-03-15 17:38:38 -04:00
tuxlovesyou
33b2a07759 Added LOAD_MIO0_TEXTURE alias for backwards-compatibility (#349)
Sometimes tools like Fast64 will export script.c files with
LOAD_MIO0_TEXTURE() macro "calls" even when you have "YAY0" toggled
under the export menu.  To keep this from being a roadblock for
compilation, LOAD_MIO0_TEXTURE() is defined in this commit as an alias
to the LOAD_YAY0_TEXTURE() macro! :-)
2022-03-11 22:10:46 -05:00
4 changed files with 40 additions and 1 deletions

View File

@@ -29,6 +29,7 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
- **CrashOveride**: creating the [ultrasm64](https://github.com/CrashOveride95/ultrasm64) repo
- **falcobuster**: Original coordinate overflow fix (world scale), ASM version of extended bounds
- **anonymous_moose**: porting falco's extended bounds to decomp
- **tuxlovesyou**: `LOAD_MIO0_TEXTURE` macro and moral support
Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff

View File

@@ -310,6 +310,9 @@ enum GoddardScene {
CMD_PTR(romEnd)
#endif
#undef LOAD_MIO0_TEXTURE
#define LOAD_MIO0_TEXTURE(a,b,c) LOAD_YAY0_TEXTURE(a,b,c)
#define CHANGE_AREA_SKYBOX(area, segStart, segEnd) \
CMD_BBH(LEVEL_CMD_CHANGE_AREA_SKYBOX, 0x0C, area), \
CMD_PTR(segStart), \

View File

@@ -1448,7 +1448,7 @@ void render_hud_cannon_reticle(void) {
gSPDisplayList(gDisplayListHead++, dl_draw_triangle);
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
// gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
}
void reset_red_coins_collected(void) {

View File

@@ -1180,6 +1180,32 @@ void geo_try_process_children(struct GraphNode *node) {
}
}
void (*geoFunctionTable[])() = {
geo_process_ortho_projection, // GRAPH_NODE_TYPE_ORTHO_PROJECTION,
geo_process_perspective, // GRAPH_NODE_TYPE_PERSPECTIVE,
geo_process_master_list, // GRAPH_NODE_TYPE_MASTER_LIST,
geo_process_level_of_detail, // GRAPH_NODE_TYPE_LEVEL_OF_DETAIL,
geo_process_switch, // GRAPH_NODE_TYPE_SWITCH_CASE,
geo_process_camera, // GRAPH_NODE_TYPE_CAMERA,
geo_process_translation_rotation, // GRAPH_NODE_TYPE_TRANSLATION_ROTATION,
geo_process_translation, // GRAPH_NODE_TYPE_TRANSLATION,
geo_process_rotation, // GRAPH_NODE_TYPE_ROTATION,
geo_process_object, // GRAPH_NODE_TYPE_OBJECT,
geo_process_animated_part, // GRAPH_NODE_TYPE_ANIMATED_PART,
geo_process_bone, // GRAPH_NODE_TYPE_BONE,
geo_process_billboard, // GRAPH_NODE_TYPE_BILLBOARD,
geo_process_display_list, // GRAPH_NODE_TYPE_DISPLAY_LIST,
geo_process_scale, // GRAPH_NODE_TYPE_SCALE,
geo_process_shadow, // GRAPH_NODE_TYPE_SHADOW,
geo_process_object_parent, // GRAPH_NODE_TYPE_OBJECT_PARENT,
geo_process_generated_list, // GRAPH_NODE_TYPE_GENERATED_LIST,
geo_process_background, // GRAPH_NODE_TYPE_BACKGROUND,
geo_process_held_object, // GRAPH_NODE_TYPE_HELD_OBJ,
geo_try_process_children, // GRAPH_NODE_TYPE_CULLING_RADIUS,
geo_try_process_children, // GRAPH_NODE_TYPE_ROOT,
geo_try_process_children // GRAPH_NODE_TYPE_START,
};
/**
* Process a generic geo node and its siblings.
* The first argument is the start node, and all its siblings will
@@ -1201,6 +1227,14 @@ void geo_process_node_and_siblings(struct GraphNode *firstNode) {
if (curGraphNode->flags & GRAPH_RENDER_CHILDREN_FIRST) {
geo_try_process_children(curGraphNode);
} else {
#ifdef DISABLE_GRAPH_NODE_TYPE_FUNCTIONAL
u32 curGraphNodeType = curGraphNode->type;
if (curGraphNodeType < ARRAY_COUNT(geoFunctionTable)) {
geoFunctionTable[curGraphNodeType](curGraphNode);
} else {
geo_try_process_children(curGraphNode);
}
#else
switch (curGraphNode->type) {
case GRAPH_NODE_TYPE_ORTHO_PROJECTION: geo_process_ortho_projection ((struct GraphNodeOrthoProjection *) curGraphNode); break;
case GRAPH_NODE_TYPE_PERSPECTIVE: geo_process_perspective ((struct GraphNodePerspective *) curGraphNode); break;
@@ -1224,6 +1258,7 @@ void geo_process_node_and_siblings(struct GraphNode *firstNode) {
case GRAPH_NODE_TYPE_BONE: geo_process_bone ((struct GraphNodeBone *) curGraphNode); break;
default: geo_try_process_children ((struct GraphNode *) curGraphNode); break;
}
#endif
}
} else {
if (curGraphNode->type == GRAPH_NODE_TYPE_OBJECT) {