Add ability to increase the amount of graph node flags

This commit is contained in:
Arceveti
2021-09-22 16:58:21 -07:00
parent 49571ff93b
commit e7fb56dc50
16 changed files with 71 additions and 75 deletions

View File

@@ -1595,9 +1595,9 @@ index 0000000..97cba2a
+ if (gCurGraphNodeHeldObject != 0)
+ sp24 = gCurGraphNodeHeldObject->objNode;
+ if (sp24->oOpacity == 0xFF)
+ sp20->fnNode.node.flags = (sp20->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | GRAPH_NODE_TYPE_FUNCTIONAL;
+ SET_GRAPH_NODE_LAYER(sp20->fnNode.node.flags, LAYER_OPAQUE);
+ else
+ sp20->fnNode.node.flags = (sp20->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (GRAPH_NODE_TYPE_FUNCTIONAL | GRAPH_NODE_TYPE_400);
+ SET_GRAPH_NODE_LAYER(sp20->fnNode.node.flags, LAYER_TRANSPARENT);
+ sp28 = sp2C = alloc_display_list(2 * sizeof(Gfx));
+
+ if (sp24->oBowserUnk1B2 != 0) {

View File

@@ -8,6 +8,9 @@
#include "macros.h"
#include "config.h"
#define BIT(i) (1 << (i))
#define BITMASK(size) ((BIT(size)) - 1)
struct Config
{
f32 audioFrequency;

View File

@@ -226,7 +226,7 @@ init_graph_node_translation_rotation(struct AllocOnlyPool *pool,
vec3s_copy(graphNode->translation, translation);
vec3s_copy(graphNode->rotation, rotation);
graphNode->node.flags = (drawingLayer << 8) | (graphNode->node.flags & GRAPH_NODE_TYPES_MASK);
SET_GRAPH_NODE_LAYER(graphNode->node.flags, drawingLayer);
graphNode->displayList = displayList;
}
@@ -248,7 +248,7 @@ struct GraphNodeTranslation *init_graph_node_translation(struct AllocOnlyPool *p
init_scene_graph_node_links(&graphNode->node, GRAPH_NODE_TYPE_TRANSLATION);
vec3s_copy(graphNode->translation, translation);
graphNode->node.flags = (drawingLayer << 8) | (graphNode->node.flags & GRAPH_NODE_TYPES_MASK);
SET_GRAPH_NODE_LAYER(graphNode->node.flags, drawingLayer);
graphNode->displayList = displayList;
}
@@ -269,7 +269,7 @@ struct GraphNodeRotation *init_graph_node_rotation(struct AllocOnlyPool *pool,
if (graphNode != NULL) {
init_scene_graph_node_links(&graphNode->node, GRAPH_NODE_TYPE_ROTATION);
vec3s_copy(graphNode->rotation, rotation);
graphNode->node.flags = (drawingLayer << 8) | (graphNode->node.flags & GRAPH_NODE_TYPES_MASK);
SET_GRAPH_NODE_LAYER(graphNode->node.flags, drawingLayer);
graphNode->displayList = displayList;
}
@@ -288,7 +288,7 @@ struct GraphNodeScale *init_graph_node_scale(struct AllocOnlyPool *pool,
if (graphNode != NULL) {
init_scene_graph_node_links(&graphNode->node, GRAPH_NODE_TYPE_SCALE);
graphNode->node.flags = (drawingLayer << 8) | (graphNode->node.flags & GRAPH_NODE_TYPES_MASK);
SET_GRAPH_NODE_LAYER(graphNode->node.flags, drawingLayer);
graphNode->scale = scale;
graphNode->displayList = displayList;
}
@@ -358,7 +358,7 @@ struct GraphNodeAnimatedPart *init_graph_node_animated_part(struct AllocOnlyPool
if (graphNode != NULL) {
init_scene_graph_node_links(&graphNode->node, GRAPH_NODE_TYPE_ANIMATED_PART);
vec3s_copy(graphNode->translation, translation);
graphNode->node.flags = (drawingLayer << 8) | (graphNode->node.flags & GRAPH_NODE_TYPES_MASK);
SET_GRAPH_NODE_LAYER(graphNode->node.flags, drawingLayer);
graphNode->displayList = displayList;
}
@@ -380,7 +380,7 @@ struct GraphNodeBone *init_graph_node_bone(struct AllocOnlyPool *pool,
init_scene_graph_node_links(&graphNode->node, GRAPH_NODE_TYPE_BONE);
vec3s_copy(graphNode->translation, translation);
vec3s_copy(graphNode->rotation, rotation);
graphNode->node.flags = (drawingLayer << 8) | (graphNode->node.flags & GRAPH_NODE_TYPES_MASK);
SET_GRAPH_NODE_LAYER(graphNode->node.flags, drawingLayer);
graphNode->displayList = displayList;
}
@@ -401,7 +401,7 @@ struct GraphNodeBillboard *init_graph_node_billboard(struct AllocOnlyPool *pool,
if (graphNode != NULL) {
init_scene_graph_node_links(&graphNode->node, GRAPH_NODE_TYPE_BILLBOARD);
vec3s_copy(graphNode->translation, translation);
graphNode->node.flags = (drawingLayer << 8) | (graphNode->node.flags & GRAPH_NODE_TYPES_MASK);
SET_GRAPH_NODE_LAYER(graphNode->node.flags, drawingLayer);
graphNode->displayList = displayList;
}
@@ -420,7 +420,7 @@ struct GraphNodeDisplayList *init_graph_node_display_list(struct AllocOnlyPool *
if (graphNode != NULL) {
init_scene_graph_node_links(&graphNode->node, GRAPH_NODE_TYPE_DISPLAY_LIST);
graphNode->node.flags = (drawingLayer << 8) | (graphNode->node.flags & GRAPH_NODE_TYPES_MASK);
SET_GRAPH_NODE_LAYER(graphNode->node.flags, drawingLayer);
graphNode->displayList = displayList;
}

View File

@@ -9,14 +9,24 @@
#include "geo_commands.h"
#include "game/memory.h"
#define GRAPH_RENDER_ACTIVE (1 << 0)
#define GRAPH_RENDER_CHILDREN_FIRST (1 << 1)
#define GRAPH_RENDER_BILLBOARD (1 << 2)
#define GRAPH_RENDER_Z_BUFFER (1 << 3)
#define GRAPH_RENDER_INVISIBLE (1 << 4)
#define GRAPH_RENDER_HAS_ANIMATION (1 << 5)
#define GRAPH_RENDER_UCODE_REJ (1 << 6)
#define GRAPH_RENDER_SILHOUETTE (1 << 7)
#define GRAPH_RENDER_ACTIVE (1 << 0) // 0x0001
#define GRAPH_RENDER_CHILDREN_FIRST (1 << 1) // 0x0002
#define GRAPH_RENDER_BILLBOARD (1 << 2) // 0x0004
#define GRAPH_RENDER_Z_BUFFER (1 << 3) // 0x0008
#define GRAPH_RENDER_INVISIBLE (1 << 4) // 0x0010
#define GRAPH_RENDER_HAS_ANIMATION (1 << 5) // 0x0020
#define GRAPH_RENDER_UCODE_REJ (1 << 6) // 0x0040
#define GRAPH_RENDER_SILHOUETTE (1 << 7) // 0x0080
// The amount of bits to use for the above flags out of a s16 variable.
// The remaining bits to the left are used for the render layers.
// The vanilla value is 8, allowing for 8 flags and 255 layers.
#define GRAPH_RENDER_FLAGS_SIZE 8
#define GRAPH_RENDER_LAYERS_MASK (BITMASK(16 - GRAPH_RENDER_FLAGS_SIZE) << GRAPH_RENDER_FLAGS_SIZE)
#define GRAPH_RENDER_FLAGS_MASK BITMASK(GRAPH_RENDER_FLAGS_SIZE)
#define SET_GRAPH_NODE_LAYER(flags, layer) ((flags) = ((flags) & GRAPH_RENDER_FLAGS_MASK) | (((layer) << GRAPH_RENDER_FLAGS_SIZE) & GRAPH_RENDER_LAYERS_MASK))
#define GET_GRAPH_NODE_LAYER(flags ) ((flags & GRAPH_RENDER_LAYERS_MASK) >> GRAPH_RENDER_FLAGS_SIZE)
// Whether the node type has a function pointer of type GraphNodeFunc
#define GRAPH_NODE_TYPE_FUNCTIONAL 0x100
@@ -46,7 +56,7 @@
#define GRAPH_NODE_TYPE_HELD_OBJ (0x02E | GRAPH_NODE_TYPE_FUNCTIONAL)
#define GRAPH_NODE_TYPE_CULLING_RADIUS 0x02F
#define GRAPH_NODE_TYPES_MASK 0xFF
#define GRAPH_NODE_TYPES_MASK 0x0FF
// The number of master lists. A master list determines the order and render
// mode with which display lists are drawn.

View File

@@ -6,9 +6,6 @@
#include "types.h"
#define BIT(i) (1 << (i))
#define BITMASK(size) ((BIT(size)) - 1)
/*
* The sine and cosine tables overlap, but "#define gCosineTable (gSineTable +
* 0x400)" doesn't give expected codegen; gSineTable and gCosineTable need to

View File

@@ -1912,9 +1912,9 @@ Gfx *geo_bits_bowser_coloring(s32 callContext, struct GraphNode *node, UNUSED s3
}
// Set layers if object is transparent or not
if (obj->oOpacity == 0xFF) {
graphNode->fnNode.node.flags = (graphNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OPAQUE << 8);
SET_GRAPH_NODE_LAYER(graphNode->fnNode.node.flags, LAYER_OPAQUE);
} else {
graphNode->fnNode.node.flags = (graphNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_TRANSPARENT << 8);
SET_GRAPH_NODE_LAYER(graphNode->fnNode.node.flags, LAYER_TRANSPARENT);
}
gfx = gfxHead = alloc_display_list(2 * sizeof(Gfx));
// If TRUE, clear lighting to give rainbow color

View File

@@ -96,7 +96,7 @@ Gfx *geo_exec_inside_castle_light(s32 callContext, struct GraphNode *node, UNUSE
}
generatedNode = (struct GraphNodeGenerated *) node;
generatedNode->fnNode.node.flags = (generatedNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_TRANSPARENT << 8);
SET_GRAPH_NODE_LAYER(generatedNode->fnNode.node.flags, LAYER_TRANSPARENT);
gSPDisplayList(displayListHead++, dl_castle_lobby_wing_cap_light);
gSPEndDisplayList(displayListHead);
@@ -148,8 +148,7 @@ Gfx *geo_exec_flying_carpet_create(s32 callContext, struct GraphNode *node, UNUS
if (verts == NULL || displayList == NULL) {
return NULL;
}
generatedNode->fnNode.node.flags = (generatedNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OPAQUE << 8);
SET_GRAPH_NODE_LAYER(generatedNode->fnNode.node.flags, LAYER_OPAQUE);
for (n = 0; n <= 20; n++) {
row = n / 3;
@@ -201,8 +200,7 @@ Gfx *geo_exec_cake_end_screen(s32 callContext, struct GraphNode *node, UNUSED Ma
if (callContext == GEO_CONTEXT_RENDER) {
displayList = alloc_display_list(3 * sizeof(*displayList));
displayListHead = displayList;
generatedNode->fnNode.node.flags = (generatedNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OPAQUE << 8);
SET_GRAPH_NODE_LAYER(generatedNode->fnNode.node.flags, LAYER_OPAQUE);
#ifdef VERSION_EU
gSPDisplayList(displayListHead++, dl_cake_end_screen);
#else

View File

@@ -26,7 +26,6 @@ Gfx *geo_envfx_main(s32 callContext, struct GraphNode *node, Mat4 mtxf) {
// casting to a local struct as necessary.
if (GET_HIGH_U16_OF_32(*params) != gAreaUpdateCounter) {
UNUSED struct Camera *sp2C = gCurGraphNodeCamera->config.camera;
s32 snowMode = GET_LOW_U16_OF_32(*params);
vec3f_to_vec3s(camTo, gCurGraphNodeCamera->focus);
@@ -40,7 +39,7 @@ Gfx *geo_envfx_main(s32 callContext, struct GraphNode *node, Mat4 mtxf) {
mtxf_to_mtx(mtx, mtxf);
gSPMatrix(&gfx[0], VIRTUAL_TO_PHYSICAL(mtx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gSPBranchList(&gfx[1], VIRTUAL_TO_PHYSICAL(particleList));
execNode->fnNode.node.flags = (execNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OCCLUDE_SILHOUETTE_ALPHA << 8);
SET_GRAPH_NODE_LAYER(execNode->fnNode.node.flags, LAYER_OCCLUDE_SILHOUETTE_ALPHA);
}
SET_HIGH_U16_OF_32(*params, gAreaUpdateCounter);
}

View File

@@ -308,11 +308,11 @@ static Gfx *make_gfx_mario_alpha(struct GraphNodeGenerated *node, s16 alpha) {
Gfx *gfxHead = NULL;
if (alpha == 255) {
node->fnNode.node.flags = (node->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OPAQUE << 8);
SET_GRAPH_NODE_LAYER(node->fnNode.node.flags, LAYER_OPAQUE);
gfxHead = alloc_display_list(2 * sizeof(*gfxHead));
gfx = gfxHead;
} else {
node->fnNode.node.flags = (node->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_TRANSPARENT << 8);
SET_GRAPH_NODE_LAYER(node->fnNode.node.flags, LAYER_TRANSPARENT);
gfxHead = alloc_display_list(3 * sizeof(*gfxHead));
gfx = gfxHead;
if (gMarioState->flags & MARIO_VANISH_CAP) {
@@ -655,7 +655,7 @@ Gfx *geo_mirror_mario_backface_culling(s32 callContext, struct GraphNode *node,
gSPSetGeometryMode(&gfx[1], G_CULL_BACK);
gSPEndDisplayList(&gfx[2]);
}
asGenerated->fnNode.node.flags = (asGenerated->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OPAQUE << 8);
SET_GRAPH_NODE_LAYER(asGenerated->fnNode.node.flags, LAYER_OPAQUE);
}
return gfx;
}

View File

@@ -659,9 +659,7 @@ Gfx *geo_movtex_draw_water_regions(s32 callContext, struct GraphNode *node, UNUS
if (quadCollection == NULL) {
return NULL;
}
asGenerated->fnNode.node.flags =
(asGenerated->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_TRANSPARENT_INTER << 8);
SET_GRAPH_NODE_LAYER(asGenerated->fnNode.node.flags, LAYER_TRANSPARENT_INTER);
movtex_change_texture_format(asGenerated->parameter, &gfx);
gMovetexLastTextureId = -1;
@@ -840,8 +838,7 @@ Gfx *geo_movtex_draw_nocolor(s32 callContext, struct GraphNode *node, UNUSED Mat
asGenerated = (struct GraphNodeGenerated *) node;
while (gMovtexNonColored[i].movtexVerts != 0) {
if (gMovtexNonColored[i].geoId == asGenerated->parameter) {
asGenerated->fnNode.node.flags =
(asGenerated->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (gMovtexNonColored[i].layer << 8);
SET_GRAPH_NODE_LAYER(asGenerated->fnNode.node.flags, gMovtexNonColored[i].layer);
movtexVerts = segmented_to_virtual(gMovtexNonColored[i].movtexVerts);
update_moving_texture_offset(movtexVerts, MOVTEX_ATTR_NOCOLOR_S);
gfx = movtex_gen_list(movtexVerts, &gMovtexNonColored[i],
@@ -868,8 +865,7 @@ Gfx *geo_movtex_draw_colored(s32 callContext, struct GraphNode *node, UNUSED Mat
asGenerated = (struct GraphNodeGenerated *) node;
while (gMovtexColored[i].movtexVerts != 0) {
if (gMovtexColored[i].geoId == asGenerated->parameter) {
asGenerated->fnNode.node.flags =
(asGenerated->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (gMovtexColored[i].layer << 8);
SET_GRAPH_NODE_LAYER(asGenerated->fnNode.node.flags, gMovtexColored[i].layer);
movtexVerts = segmented_to_virtual(gMovtexColored[i].movtexVerts);
update_moving_texture_offset(movtexVerts, MOVTEX_ATTR_COLORED_S);
gfx = movtex_gen_list(movtexVerts, &gMovtexColored[i], MOVTEX_LAYOUT_COLORED);
@@ -899,8 +895,7 @@ Gfx *geo_movtex_draw_colored_no_update(s32 callContext, struct GraphNode *node,
asGenerated = (struct GraphNodeGenerated *) node;
while (gMovtexColored[i].movtexVerts != 0) {
if (gMovtexColored[i].geoId == asGenerated->parameter) {
asGenerated->fnNode.node.flags =
(asGenerated->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (gMovtexColored[i].layer << 8);
SET_GRAPH_NODE_LAYER(asGenerated->fnNode.node.flags, gMovtexColored[i].layer);
movtexVerts = segmented_to_virtual(gMovtexColored[i].movtexVerts);
gfx = movtex_gen_list(movtexVerts, &gMovtexColored[i], MOVTEX_LAYOUT_COLORED);
break;
@@ -926,8 +921,7 @@ Gfx *geo_movtex_draw_colored_2_no_update(s32 callContext, struct GraphNode *node
asGenerated = (struct GraphNodeGenerated *) node;
while (gMovtexColored2[i].movtexVerts != 0) {
if (gMovtexColored2[i].geoId == asGenerated->parameter) {
asGenerated->fnNode.node.flags =
(asGenerated->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (gMovtexColored2[i].layer << 8);
SET_GRAPH_NODE_LAYER(asGenerated->fnNode.node.flags, gMovtexColored2[i].layer);
movtexVerts = segmented_to_virtual(gMovtexColored2[i].movtexVerts);
gfx = movtex_gen_list(movtexVerts, &gMovtexColored2[i], MOVTEX_LAYOUT_COLORED);
break;

View File

@@ -107,8 +107,7 @@ Gfx UNUSED *geo_obj_transparency_something(s32 callContext, struct GraphNode *no
gfxHead = alloc_display_list(3 * sizeof(Gfx));
gfx = gfxHead;
obj->header.gfx.node.flags =
(obj->header.gfx.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_TRANSPARENT << 8);
SET_GRAPH_NODE_LAYER(obj->header.gfx.node.flags, LAYER_TRANSPARENT);
gDPSetEnvColor(gfx++, 255, 255, 255, heldObject->oOpacity);

View File

@@ -73,21 +73,17 @@ Gfx *geo_update_layer_transparency(s32 callContext, struct GraphNode *node, UNUS
if (objectOpacity == 0xFF) {
if (currentGraphNode->parameter == 20) {
currentGraphNode->fnNode.node.flags =
(LAYER_TRANSPARENT_DECAL << 8) | (currentGraphNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK);
SET_GRAPH_NODE_LAYER(currentGraphNode->fnNode.node.flags, LAYER_TRANSPARENT_DECAL);
} else {
currentGraphNode->fnNode.node.flags =
(LAYER_OPAQUE << 8) | (currentGraphNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK);
SET_GRAPH_NODE_LAYER(currentGraphNode->fnNode.node.flags, LAYER_OPAQUE);
}
objectGraphNode->oAnimState = 0;
} else {
if (currentGraphNode->parameter == 20) {
currentGraphNode->fnNode.node.flags =
(LAYER_TRANSPARENT_DECAL << 8) | (currentGraphNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK);
SET_GRAPH_NODE_LAYER(currentGraphNode->fnNode.node.flags, LAYER_TRANSPARENT_DECAL);
} else {
currentGraphNode->fnNode.node.flags =
(LAYER_TRANSPARENT << 8) | (currentGraphNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK);
SET_GRAPH_NODE_LAYER(currentGraphNode->fnNode.node.flags, LAYER_TRANSPARENT);
}
objectGraphNode->oAnimState = 1;

View File

@@ -1138,10 +1138,10 @@ void move_ddd_painting(struct Painting *painting, f32 frontPos, f32 backPos, f32
void set_painting_layer(struct GraphNodeGenerated *gen, struct Painting *painting) {
switch (painting->alpha) {
case 0xFF: // Opaque
gen->fnNode.node.flags = (gen->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OPAQUE << 8);
SET_GRAPH_NODE_LAYER(gen->fnNode.node.flags, LAYER_OPAQUE);
break;
default:
gen->fnNode.node.flags = (gen->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_TRANSPARENT << 8);
SET_GRAPH_NODE_LAYER(gen->fnNode.node.flags, LAYER_TRANSPARENT);
break;
}
}

View File

@@ -573,7 +573,7 @@ static void geo_process_translation_rotation(struct GraphNodeTranslationRotation
mtxf_to_mtx(mtx, gMatStack[gMatStackIndex]);
gMatStackFixed[gMatStackIndex] = mtx;
if (node->displayList != NULL) {
geo_append_display_list(node->displayList, node->node.flags >> 8);
geo_append_display_list(node->displayList, GET_GRAPH_NODE_LAYER(node->node.flags));
}
if (node->node.children != NULL) {
geo_process_node_and_siblings(node->node.children);
@@ -598,7 +598,7 @@ static void geo_process_translation(struct GraphNodeTranslation *node) {
mtxf_to_mtx(mtx, gMatStack[gMatStackIndex]);
gMatStackFixed[gMatStackIndex] = mtx;
if (node->displayList != NULL) {
geo_append_display_list(node->displayList, node->node.flags >> 8);
geo_append_display_list(node->displayList, GET_GRAPH_NODE_LAYER(node->node.flags));
}
if (node->node.children != NULL) {
geo_process_node_and_siblings(node->node.children);
@@ -621,7 +621,7 @@ static void geo_process_rotation(struct GraphNodeRotation *node) {
mtxf_to_mtx(mtx, gMatStack[gMatStackIndex]);
gMatStackFixed[gMatStackIndex] = mtx;
if (node->displayList != NULL) {
geo_append_display_list(node->displayList, node->node.flags >> 8);
geo_append_display_list(node->displayList, GET_GRAPH_NODE_LAYER(node->node.flags));
}
if (node->node.children != NULL) {
geo_process_node_and_siblings(node->node.children);
@@ -645,7 +645,7 @@ static void geo_process_scale(struct GraphNodeScale *node) {
mtxf_to_mtx(mtx, gMatStack[gMatStackIndex]);
gMatStackFixed[gMatStackIndex] = mtx;
if (node->displayList != NULL) {
geo_append_display_list(node->displayList, node->node.flags >> 8);
geo_append_display_list(node->displayList, GET_GRAPH_NODE_LAYER(node->node.flags));
}
if (node->node.children != NULL) {
geo_process_node_and_siblings(node->node.children);
@@ -678,7 +678,7 @@ static void geo_process_billboard(struct GraphNodeBillboard *node) {
mtxf_to_mtx(mtx, gMatStack[gMatStackIndex]);
gMatStackFixed[gMatStackIndex] = mtx;
if (node->displayList != NULL) {
geo_append_display_list(node->displayList, node->node.flags >> 8);
geo_append_display_list(node->displayList, GET_GRAPH_NODE_LAYER(node->node.flags));
}
if (node->node.children != NULL) {
geo_process_node_and_siblings(node->node.children);
@@ -693,7 +693,7 @@ static void geo_process_billboard(struct GraphNodeBillboard *node) {
*/
static void geo_process_display_list(struct GraphNodeDisplayList *node) {
if (node->displayList != NULL) {
geo_append_display_list(node->displayList, node->node.flags >> 8);
geo_append_display_list(node->displayList, GET_GRAPH_NODE_LAYER(node->node.flags));
}
if (node->node.children != NULL) {
geo_process_node_and_siblings(node->node.children);
@@ -710,7 +710,7 @@ static void geo_process_generated_list(struct GraphNodeGenerated *node) {
(struct AllocOnlyPool *) gMatStack[gMatStackIndex]);
if (list != NULL) {
geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(list), node->fnNode.node.flags >> 8);
geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(list), GET_GRAPH_NODE_LAYER(node->fnNode.node.flags));
}
}
if (node->fnNode.node.children != NULL) {
@@ -731,7 +731,7 @@ static void geo_process_background(struct GraphNodeBackground *node) {
(struct AllocOnlyPool *) gMatStack[gMatStackIndex]);
}
if (list != NULL) {
geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(list), node->fnNode.node.flags >> 8);
geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(list), GET_GRAPH_NODE_LAYER(node->fnNode.node.flags));
} else if (gCurGraphNodeMasterList != NULL) {
#ifndef F3DEX_GBI_2E
Gfx *gfxStart = alloc_display_list(sizeof(Gfx) * 7);
@@ -812,7 +812,7 @@ static void geo_process_animated_part(struct GraphNodeAnimatedPart *node) {
mtxf_to_mtx(matrixPtr, gMatStack[gMatStackIndex]);
gMatStackFixed[gMatStackIndex] = matrixPtr;
if (node->displayList != NULL) {
geo_append_display_list(node->displayList, node->node.flags >> 8);
geo_append_display_list(node->displayList, GET_GRAPH_NODE_LAYER(node->node.flags));
}
if (node->node.children != NULL) {
geo_process_node_and_siblings(node->node.children);
@@ -876,7 +876,7 @@ static void geo_process_bone(struct GraphNodeBone *node) {
mtxf_to_mtx(matrixPtr, gMatStack[gMatStackIndex]);
gMatStackFixed[gMatStackIndex] = matrixPtr;
if (node->displayList != NULL) {
geo_append_display_list(node->displayList, node->node.flags >> 8);
geo_append_display_list(node->displayList, GET_GRAPH_NODE_LAYER(node->node.flags));
}
if (node->node.children != NULL) {
geo_process_node_and_siblings(node->node.children);

View File

@@ -295,7 +295,7 @@ Gfx *geo_cannon_circle_base(s32 callContext, struct GraphNode *node, UNUSED Mat4
if (callContext == GEO_CONTEXT_RENDER && gCurrentArea != NULL
&& gCurrentArea->camera->mode == CAMERA_MODE_INSIDE_CANNON) {
graphNode->fnNode.node.flags = (graphNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_TRANSPARENT << 8);
SET_GRAPH_NODE_LAYER(graphNode->fnNode.node.flags, LAYER_TRANSPARENT);
#ifndef L3DEX2_ALONE
dlist = render_cannon_circle_base();
#endif

View File

@@ -53,7 +53,7 @@ Gfx *geo_intro_super_mario_64_logo(s32 state, struct GraphNode *node, UNUSED voi
if (state != 1) {
sIntroFrameCounter = 0;
} else if (state == 1) {
graphNode->flags = (graphNode->flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OPAQUE << 8);
SET_GRAPH_NODE_LAYER(graphNode->flags, LAYER_OPAQUE);
scaleMat = alloc_display_list(sizeof(*scaleMat));
dl = alloc_display_list(4 * sizeof(*dl));
dlIter = dl;
@@ -109,11 +109,11 @@ Gfx *geo_intro_tm_copyright(s32 state, struct GraphNode *node, UNUSED void *cont
gDPSetEnvColor(dlIter++, 255, 255, 255, sTmCopyrightAlpha);
switch (sTmCopyrightAlpha) {
case 255: // opaque
graphNode->flags = (graphNode->flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OPAQUE << 8);
SET_GRAPH_NODE_LAYER(graphNode->flags, LAYER_OPAQUE);
gDPSetRenderMode(dlIter++, G_RM_AA_OPA_SURF, G_RM_AA_OPA_SURF2);
break;
default: // blend
graphNode->flags = (graphNode->flags & GRAPH_NODE_TYPES_MASK) | (LAYER_TRANSPARENT << 8);
SET_GRAPH_NODE_LAYER(graphNode->flags, LAYER_TRANSPARENT);
gDPSetRenderMode(dlIter++, G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2);
break;
}
@@ -202,7 +202,7 @@ Gfx *geo_intro_regular_backdrop(s32 state, struct GraphNode *node, UNUSED void *
if (state == 1) { // draw
dl = alloc_display_list(16 * sizeof(*dl));
dlIter = dl;
graphNode->node.flags = (graphNode->node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OPAQUE << 8);
SET_GRAPH_NODE_LAYER(graphNode->node.flags, LAYER_OPAQUE);
gSPDisplayList(dlIter++, &dl_proj_mtx_fullscreen);
gSPDisplayList(dlIter++, &title_screen_bg_dl_0A000100);
for (i = 0; i < 12; ++i) {
@@ -258,7 +258,7 @@ Gfx *geo_intro_gameover_backdrop(s32 state, struct GraphNode *node, UNUSED void
if (sGameOverTableIndex != 11) {
sGameOverFrameCounter++;
}
graphNode->flags = (graphNode->flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OPAQUE << 8);
SET_GRAPH_NODE_LAYER(graphNode->flags, LAYER_OPAQUE);
// draw all the tiles
gSPDisplayList(dlIter++, &dl_proj_mtx_fullscreen);
@@ -424,7 +424,7 @@ Gfx *geo_intro_face_easter_egg(s32 state, struct GraphNode *node, UNUSED void *c
if (sFaceVisible[0] == 1 || sFaceVisible[17] == 1) {
image = intro_sample_frame_buffer(40, 40, 2, 2);
if (image != NULL) {
genNode->fnNode.node.flags = (genNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OPAQUE << 8);
SET_GRAPH_NODE_LAYER(genNode->fnNode.node.flags, LAYER_OPAQUE);
dl = intro_draw_face(image, 40, 40);
}
}
@@ -443,7 +443,7 @@ Gfx *geo_intro_rumble_pak_graphic(s32 state, struct GraphNode *node, UNUSED void
if (state != 1) {
dl = NULL;
} else if (state == 1) {
genNode->fnNode.node.flags = (genNode->fnNode.node.flags & GRAPH_NODE_TYPES_MASK) | (LAYER_OPAQUE << 8);
SET_GRAPH_NODE_LAYER(genNode->fnNode.node.flags, LAYER_OPAQUE);
introContext = genNode->parameter & 0xFF;
if (introContext == 0) {
backgroundTileSix = introBackgroundIndexTable[6];