forked from Ports/goldeneye-pc-port
Draw order
This commit is contained in:
1 parent
fd7800cf80
commit
6c183d9434
3 files changed
+41
No files matched your search
@@ -764,6 +764,22 @@ Gfx *sub_GAME_7F0B3C8C(Gfx *gdl)
|
||||
{
|
||||
if (i == dword_CODE_bss_8007FFA0[j].unk1)
|
||||
{
|
||||
#ifdef PORT
|
||||
/* Tinted glass stands in a window opening at the far side of
|
||||
* the room, yet it is a prop and so was drawn after the room's
|
||||
* translucent geometry. Railing balusters in front of it are
|
||||
* such geometry (an XLU quad that writes no depth), so the
|
||||
* glass painted over them (Facility main hall). Draw the room's
|
||||
* tinted glass before its translucent geometry instead. */
|
||||
if (get_debug_do_draw_obj() && sub_GAME_7F0BD8F0())
|
||||
{
|
||||
gSPMatrix(gdl++, osVirtualToPhysical((void*)currentPlayerGetProjectionMatrix()), (G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION));
|
||||
gdl = fogRenderClearFogMode(gdl);
|
||||
g_PortXluGlassPhase = 1;
|
||||
gdl = chrpropsRenderPass(gdl, dword_CODE_bss_8007FFA0[j].roomid, 1);
|
||||
}
|
||||
g_PortXluGlassPhase = 2;
|
||||
#endif
|
||||
gSPMatrix(gdl++, osVirtualToPhysical((void*)get_BONDdata_field_10E0()), (G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION));
|
||||
gdl = fogSetRenderFogColor(
|
||||
bgScissorCurrentPlayerViewF(
|
||||
@@ -792,6 +808,9 @@ Gfx *sub_GAME_7F0B3C8C(Gfx *gdl)
|
||||
gdl = chrpropsRenderPass(gdl, dword_CODE_bss_8007FFA0[j].roomid, 1);
|
||||
}
|
||||
}
|
||||
#ifdef PORT
|
||||
g_PortXluGlassPhase = 0;
|
||||
#endif
|
||||
|
||||
if (1);
|
||||
}
|
||||
|
||||
@@ -334,6 +334,11 @@ s32 chrpropTestPointInPolygon(coord3d *point, struct rect4f *poly
|
||||
void roomGetProps(s32 *roomids);
|
||||
ObjectRecord *scan_position_data_table_for_normal_object_at_preset(s32 arg0);
|
||||
Gfx *chrpropsRenderPass(Gfx *arg0, s32 roomid, s32 arg2);
|
||||
#ifdef PORT
|
||||
/* Translucent prop pass filter: 0 = all props, 1 = tinted glass only,
|
||||
* 2 = all but tinted glass (see bg.c). */
|
||||
extern s32 g_PortXluGlassPhase;
|
||||
#endif
|
||||
PropRecord *chrpropGetActiveTail(void);
|
||||
void propsDefragRoomProps(void);
|
||||
void chraiGetPropRoomIds(PropRecord *self, s32 *roomids);
|
||||
|
||||
@@ -466,6 +466,15 @@ Gfx *chrpropRender(Gfx * gdl, PropRecord *prop, s32 withalpha)
|
||||
/**
|
||||
* Address: 7F03A6F4
|
||||
*/
|
||||
#ifdef PORT
|
||||
s32 g_PortXluGlassPhase = 0;
|
||||
|
||||
static bool chrpropIsTintedGlass(PropRecord *prop)
|
||||
{
|
||||
return prop->type == PROP_TYPE_OBJ && prop->obj != NULL && prop->obj->type == PROPDEF_TINTED_GLASS;
|
||||
}
|
||||
#endif
|
||||
|
||||
Gfx *chrpropsRenderPass(Gfx *gdl, s32 roomid, s32 renderpass)
|
||||
{
|
||||
s32 flag;
|
||||
@@ -542,6 +551,14 @@ Gfx *chrpropsRenderPass(Gfx *gdl, s32 roomid, s32 renderpass)
|
||||
{
|
||||
prop = *pp;
|
||||
|
||||
#ifdef PORT
|
||||
if (prop != NULL && g_PortXluGlassPhase != 0
|
||||
&& chrpropIsTintedGlass(prop) != (g_PortXluGlassPhase == 1))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (prop != NULL)
|
||||
{
|
||||
flag = 0;
|
||||
|
||||
Reference in new issue
Block a user