mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
sanitize object display lists
This commit is contained in:
parent
0876d161e0
commit
8570cfd4fc
1 changed files with 17 additions and 0 deletions
|
|
@ -69,6 +69,15 @@ Mtx sPrevCamTranf, sCurrCamTranf = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static Gfx obj_sanitize_gfx[] = {
|
||||||
|
gsSPClearGeometryMode(G_TEXTURE_GEN),
|
||||||
|
gsSPSetGeometryMode(G_LIGHTING),
|
||||||
|
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
|
||||||
|
gsSPTexture(0xFFFF, 0xFFFF, 0, 0, G_OFF),
|
||||||
|
gsDPSetAlphaCompare(G_AC_NONE),
|
||||||
|
gsSPEndDisplayList(),
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Animation nodes have state in global variables, so this struct captures
|
* Animation nodes have state in global variables, so this struct captures
|
||||||
* the animation state so a 'context switch' can be made when rendering the
|
* the animation state so a 'context switch' can be made when rendering the
|
||||||
|
|
@ -1197,6 +1206,12 @@ static s32 obj_is_in_view(struct GraphNodeObject *node, Mat4 matrix) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void geo_sanitize_object_gfx() {
|
||||||
|
geo_append_display_list(obj_sanitize_gfx, LAYER_OPAQUE);
|
||||||
|
geo_append_display_list(obj_sanitize_gfx, LAYER_ALPHA);
|
||||||
|
geo_append_display_list(obj_sanitize_gfx, LAYER_TRANSPARENT);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process an object node.
|
* Process an object node.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1353,6 +1368,7 @@ static void geo_process_object(struct Object *node) {
|
||||||
if (node->header.gfx.sharedChild != NULL) {
|
if (node->header.gfx.sharedChild != NULL) {
|
||||||
gCurGraphNodeObject = (struct GraphNodeObject *) node;
|
gCurGraphNodeObject = (struct GraphNodeObject *) node;
|
||||||
node->header.gfx.sharedChild->parent = &node->header.gfx.node;
|
node->header.gfx.sharedChild->parent = &node->header.gfx.node;
|
||||||
|
geo_sanitize_object_gfx();
|
||||||
geo_process_node_and_siblings(node->header.gfx.sharedChild);
|
geo_process_node_and_siblings(node->header.gfx.sharedChild);
|
||||||
node->header.gfx.sharedChild->parent = NULL;
|
node->header.gfx.sharedChild->parent = NULL;
|
||||||
gCurGraphNodeObject = NULL;
|
gCurGraphNodeObject = NULL;
|
||||||
|
|
@ -1464,6 +1480,7 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) {
|
||||||
dynos_gfx_swap_animations(node->objNode);
|
dynos_gfx_swap_animations(node->objNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
geo_sanitize_object_gfx();
|
||||||
geo_process_node_and_siblings(node->objNode->header.gfx.sharedChild);
|
geo_process_node_and_siblings(node->objNode->header.gfx.sharedChild);
|
||||||
gCurGraphNodeHeldObject = NULL;
|
gCurGraphNodeHeldObject = NULL;
|
||||||
gCurAnimType = gGeoTempState.type;
|
gCurAnimType = gGeoTempState.type;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue