You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Add OBJ_FLAG_OPACITY_FROM_CAMERA_DIST
This commit is contained in:
@@ -213,15 +213,13 @@ extern const Gfx transparent_star_seg3_dl_0302C620[];
|
||||
extern const GeoLayout bubbly_tree_geo[];
|
||||
extern const GeoLayout spiky_tree_geo[];
|
||||
extern const GeoLayout snow_tree_geo[];
|
||||
extern const GeoLayout spiky_tree1_geo[];
|
||||
extern const GeoLayout palm_tree_geo[];
|
||||
extern const Gfx tree_seg3_dl_0302FE88[];
|
||||
extern const Gfx tree_seg3_dl_0302FEB8[];
|
||||
extern const Gfx tree_seg3_dl_0302FEE8[];
|
||||
extern const Gfx tree_seg3_dl_03030FA0[];
|
||||
extern const Gfx tree_seg3_dl_03032088[];
|
||||
extern const Gfx tree_seg3_dl_03032170[];
|
||||
extern const Gfx tree_seg3_dl_03033258[];
|
||||
extern const Gfx tree_seg3_sub_dl_bubbly_left_side[];
|
||||
extern const Gfx tree_seg3_sub_dl_bubbly_right_side[];
|
||||
extern const Gfx tree_seg3_dl_bubbly[];
|
||||
extern const Gfx tree_seg3_dl_spiky[];
|
||||
extern const Gfx tree_seg3_dl_snowy_pine[];
|
||||
extern const Gfx tree_seg3_dl_palm[];
|
||||
|
||||
// warp_collision
|
||||
extern const Collision door_seg3_collision_0301CE78[];
|
||||
|
||||
@@ -2,7 +2,16 @@
|
||||
const GeoLayout bubbly_tree_geo[] = {
|
||||
GEO_CULLING_RADIUS(800),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_DISPLAY_LIST(LAYER_ALPHA, tree_seg3_dl_0302FEE8),
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
GEO_ASM(0, geo_update_layer_transparency),
|
||||
GEO_SWITCH_CASE(2, geo_switch_anim_state),
|
||||
GEO_OPEN_NODE(),
|
||||
#endif
|
||||
GEO_DISPLAY_LIST(LAYER_ALPHA, tree_seg3_dl_bubbly),
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, tree_seg3_dl_bubbly),
|
||||
GEO_CLOSE_NODE(),
|
||||
#endif
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_END(),
|
||||
};
|
||||
@@ -11,7 +20,16 @@ const GeoLayout bubbly_tree_geo[] = {
|
||||
const GeoLayout spiky_tree_geo[] = {
|
||||
GEO_CULLING_RADIUS(800),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_DISPLAY_LIST(LAYER_ALPHA, tree_seg3_dl_03030FA0),
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
GEO_ASM(0, geo_update_layer_transparency),
|
||||
GEO_SWITCH_CASE(2, geo_switch_anim_state),
|
||||
GEO_OPEN_NODE(),
|
||||
#endif
|
||||
GEO_DISPLAY_LIST(LAYER_ALPHA, tree_seg3_dl_spiky),
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, tree_seg3_dl_spiky),
|
||||
GEO_CLOSE_NODE(),
|
||||
#endif
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_END(),
|
||||
};
|
||||
@@ -20,16 +38,16 @@ const GeoLayout spiky_tree_geo[] = {
|
||||
const GeoLayout snow_tree_geo[] = {
|
||||
GEO_CULLING_RADIUS(800),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_DISPLAY_LIST(LAYER_ALPHA, tree_seg3_dl_03032088),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_END(),
|
||||
};
|
||||
|
||||
// 0x16001030
|
||||
const GeoLayout spiky_tree1_geo[] = {
|
||||
GEO_CULLING_RADIUS(800),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_DISPLAY_LIST(LAYER_ALPHA, tree_seg3_dl_03032170),
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
GEO_ASM(0, geo_update_layer_transparency),
|
||||
GEO_SWITCH_CASE(2, geo_switch_anim_state),
|
||||
GEO_OPEN_NODE(),
|
||||
#endif
|
||||
GEO_DISPLAY_LIST(LAYER_ALPHA, tree_seg3_dl_snowy_pine),
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, tree_seg3_dl_snowy_pine),
|
||||
GEO_CLOSE_NODE(),
|
||||
#endif
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_END(),
|
||||
};
|
||||
@@ -38,7 +56,16 @@ const GeoLayout spiky_tree1_geo[] = {
|
||||
const GeoLayout palm_tree_geo[] = {
|
||||
GEO_CULLING_RADIUS(800),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_DISPLAY_LIST(LAYER_ALPHA, tree_seg3_dl_03033258),
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
GEO_ASM(0, geo_update_layer_transparency),
|
||||
GEO_SWITCH_CASE(2, geo_switch_anim_state),
|
||||
GEO_OPEN_NODE(),
|
||||
#endif
|
||||
GEO_DISPLAY_LIST(LAYER_ALPHA, tree_seg3_dl_palm),
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, tree_seg3_dl_palm),
|
||||
GEO_CLOSE_NODE(),
|
||||
#endif
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_END(),
|
||||
};
|
||||
|
||||
@@ -7,61 +7,65 @@ static const Lights1 tree_seg3_lights_0302DE10 = gdSPDefLights1(
|
||||
);
|
||||
|
||||
// 0x0302DE28
|
||||
ALIGNED8 static const Texture tree_seg3_texture_0302DE28[] = {
|
||||
ALIGNED8 static const Texture tree_seg3_texture_bubbly_left_side[] = {
|
||||
#include "actors/tree/tree_left_side.rgba16.inc.c"
|
||||
};
|
||||
|
||||
// 0x0302EE28
|
||||
ALIGNED8 static const Texture tree_seg3_texture_0302EE28[] = {
|
||||
ALIGNED8 static const Texture tree_seg3_texture_bubbly_right_side[] = {
|
||||
#include "actors/tree/tree_right_side.rgba16.inc.c"
|
||||
};
|
||||
|
||||
// 0x0302FE28
|
||||
static const Vtx tree_seg3_vertex_0302FE28[] = {
|
||||
static const Vtx tree_seg3_vertex_bubbly_left_side[] = {
|
||||
{{{ -356, -9, 0}, 0, { -796, 2012}, {0xff, 0xff, 0xff, 0xff}}},
|
||||
{{{ 0, -9, 0}, 0, { 990, 2012}, {0xff, 0xff, 0xff, 0xff}}},
|
||||
{{{ 0, 800, 0}, 0, { 990, -712}, {0xff, 0xff, 0xff, 0xff}}},
|
||||
};
|
||||
|
||||
// 0x0302FE58
|
||||
static const Vtx tree_seg3_vertex_0302FE58[] = {
|
||||
static const Vtx tree_seg3_vertex_bubbly_right_side[] = {
|
||||
{{{ 0, -9, 0}, 0, { 0, 2012}, {0xff, 0xff, 0xff, 0xff}}},
|
||||
{{{ 358, -9, 0}, 0, { 1756, 2012}, {0xff, 0xff, 0xff, 0xff}}},
|
||||
{{{ 0, 800, 0}, 0, { 0, -712}, {0xff, 0xff, 0xff, 0xff}}},
|
||||
};
|
||||
|
||||
// 0x0302FE88 - 0x0302FEB8
|
||||
const Gfx tree_seg3_dl_0302FE88[] = {
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, tree_seg3_texture_0302DE28),
|
||||
const Gfx tree_seg3_sub_dl_bubbly_left_side[] = {
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, tree_seg3_texture_bubbly_left_side),
|
||||
gsDPLoadSync(),
|
||||
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
|
||||
gsSPVertex(tree_seg3_vertex_0302FE28, 3, 0),
|
||||
gsSPVertex(tree_seg3_vertex_bubbly_left_side, 3, 0),
|
||||
gsSP1Triangle( 0, 1, 2, 0x0),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
// 0x0302FEB8 - 0x0302FEE8
|
||||
const Gfx tree_seg3_dl_0302FEB8[] = {
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, tree_seg3_texture_0302EE28),
|
||||
const Gfx tree_seg3_sub_dl_bubbly_right_side[] = {
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, tree_seg3_texture_bubbly_right_side),
|
||||
gsDPLoadSync(),
|
||||
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
|
||||
gsSPVertex(tree_seg3_vertex_0302FE58, 3, 0),
|
||||
gsSPVertex(tree_seg3_vertex_bubbly_right_side, 3, 0),
|
||||
gsSP1Triangle( 0, 1, 2, 0x0),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
// 0x0302FEE8 - 0x0302FF60
|
||||
const Gfx tree_seg3_dl_0302FEE8[] = {
|
||||
const Gfx tree_seg3_dl_bubbly[] = {
|
||||
gsDPPipeSync(),
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
gsDPSetCombineMode(G_CC_DECALFADEA, G_CC_DECALFADEA),
|
||||
#else
|
||||
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
|
||||
#endif
|
||||
gsSPClearGeometryMode(G_LIGHTING),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 6, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
|
||||
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (64 - 1) << G_TEXTURE_IMAGE_FRAC),
|
||||
gsSPDisplayList(tree_seg3_dl_0302FE88),
|
||||
gsSPDisplayList(tree_seg3_dl_0302FEB8),
|
||||
gsSPDisplayList(tree_seg3_sub_dl_bubbly_left_side),
|
||||
gsSPDisplayList(tree_seg3_sub_dl_bubbly_right_side),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
|
||||
gsDPPipeSync(),
|
||||
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
|
||||
@@ -70,12 +74,12 @@ const Gfx tree_seg3_dl_0302FEE8[] = {
|
||||
};
|
||||
|
||||
// 0x0302FF60
|
||||
ALIGNED8 static const Texture tree_seg3_texture_0302FF60[] = {
|
||||
ALIGNED8 static const Texture tree_seg3_texture_pine[] = {
|
||||
#include "actors/tree/pine_tree.rgba16.inc.c"
|
||||
};
|
||||
|
||||
// 0x03030F60
|
||||
static const Vtx tree_seg3_vertex_03030F60[] = {
|
||||
static const Vtx tree_seg3_vertex_spiky[] = {
|
||||
{{{ 128, 512, 0}, 0, { 990, 0}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
{{{ -127, 512, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
{{{ -127, 0, 0}, 0, { 0, 2012}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
@@ -83,21 +87,25 @@ static const Vtx tree_seg3_vertex_03030F60[] = {
|
||||
};
|
||||
|
||||
// 0x03030FA0 - 0x03031048
|
||||
const Gfx tree_seg3_dl_03030FA0[] = {
|
||||
const Gfx tree_seg3_dl_spiky[] = {
|
||||
gsDPPipeSync(),
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
gsDPSetCombineMode(G_CC_DECALFADEA, G_CC_DECALFADEA),
|
||||
#else
|
||||
gsDPSetCombineMode(G_CC_MODULATERGBA, G_CC_MODULATERGBA),
|
||||
#endif
|
||||
gsSPClearGeometryMode(G_SHADING_SMOOTH),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 6, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
|
||||
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (64 - 1) << G_TEXTURE_IMAGE_FRAC),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, tree_seg3_texture_0302FF60),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, tree_seg3_texture_pine),
|
||||
gsDPLoadSync(),
|
||||
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
|
||||
gsSPLight(&tree_seg3_lights_0302DE10.l, 1),
|
||||
gsSPLight(&tree_seg3_lights_0302DE10.a, 2),
|
||||
gsSPVertex(tree_seg3_vertex_03030F60, 4, 0),
|
||||
gsSPVertex(tree_seg3_vertex_spiky, 4, 0),
|
||||
gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
|
||||
gsDPPipeSync(),
|
||||
@@ -107,66 +115,30 @@ const Gfx tree_seg3_dl_03030FA0[] = {
|
||||
};
|
||||
|
||||
// 0x03031048
|
||||
ALIGNED8 static const Texture tree_seg3_texture_03031048[] = {
|
||||
ALIGNED8 static const Texture tree_seg3_texture_snowy_pine[] = {
|
||||
#include "actors/tree/snowy_pine_tree.rgba16.inc.c"
|
||||
};
|
||||
|
||||
// 0x03032048
|
||||
static const Vtx tree_seg3_vertex_03032048[] = {
|
||||
{{{ 128, 512, 0}, 0, { 990, 0}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
{{{ -127, 512, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
{{{ -127, 0, 0}, 0, { 0, 2012}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
{{{ 128, 0, 0}, 0, { 990, 2012}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
};
|
||||
|
||||
// 0x03032088 - 0x03032130
|
||||
const Gfx tree_seg3_dl_03032088[] = {
|
||||
const Gfx tree_seg3_dl_snowy_pine[] = {
|
||||
gsDPPipeSync(),
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
gsDPSetCombineMode(G_CC_DECALFADEA, G_CC_DECALFADEA),
|
||||
#else
|
||||
gsDPSetCombineMode(G_CC_MODULATERGBA, G_CC_MODULATERGBA),
|
||||
#endif
|
||||
gsSPClearGeometryMode(G_SHADING_SMOOTH),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 6, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
|
||||
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (64 - 1) << G_TEXTURE_IMAGE_FRAC),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, tree_seg3_texture_03031048),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, tree_seg3_texture_snowy_pine),
|
||||
gsDPLoadSync(),
|
||||
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
|
||||
gsSPLight(&tree_seg3_lights_0302DE10.l, 1),
|
||||
gsSPLight(&tree_seg3_lights_0302DE10.a, 2),
|
||||
gsSPVertex(tree_seg3_vertex_03032048, 4, 0),
|
||||
gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
|
||||
gsDPPipeSync(),
|
||||
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
|
||||
gsSPSetGeometryMode(G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
// 0x03032130
|
||||
static const Vtx tree_seg3_vertex_03032130[] = {
|
||||
{{{ 128, 512, 0}, 0, { 990, 0}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
{{{ -127, 512, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
{{{ -127, 0, 0}, 0, { 0, 2012}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
{{{ 128, 0, 0}, 0, { 990, 2012}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
};
|
||||
|
||||
// 0x03032170 - 0x03032218
|
||||
const Gfx tree_seg3_dl_03032170[] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetCombineMode(G_CC_MODULATERGBA, G_CC_MODULATERGBA),
|
||||
gsSPClearGeometryMode(G_SHADING_SMOOTH),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 6, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
|
||||
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (64 - 1) << G_TEXTURE_IMAGE_FRAC),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, tree_seg3_texture_0302FF60),
|
||||
gsDPLoadSync(),
|
||||
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
|
||||
gsSPLight(&tree_seg3_lights_0302DE10.l, 1),
|
||||
gsSPLight(&tree_seg3_lights_0302DE10.a, 2),
|
||||
gsSPVertex(tree_seg3_vertex_03032130, 4, 0),
|
||||
gsSPVertex(tree_seg3_vertex_spiky, 4, 0),
|
||||
gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
|
||||
gsDPPipeSync(),
|
||||
@@ -176,12 +148,12 @@ const Gfx tree_seg3_dl_03032170[] = {
|
||||
};
|
||||
|
||||
// 0x03032218
|
||||
ALIGNED8 static const Texture tree_seg3_texture_03032218[] = {
|
||||
ALIGNED8 static const Texture tree_seg3_texture_palm[] = {
|
||||
#include "actors/tree/palm_tree.rgba16.inc.c"
|
||||
};
|
||||
|
||||
// 0x03033218
|
||||
static const Vtx tree_seg3_vertex_03033218[] = {
|
||||
static const Vtx tree_seg3_vertex_palm[] = {
|
||||
{{{ 170, 512, 0}, 0, { 990, 0}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
{{{ -169, 512, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
{{{ -169, 0, 0}, 0, { 0, 2012}, {0x00, 0x00, 0x7f, 0xff}}},
|
||||
@@ -189,21 +161,25 @@ static const Vtx tree_seg3_vertex_03033218[] = {
|
||||
};
|
||||
|
||||
// 0x03033258 - 0x03033300
|
||||
const Gfx tree_seg3_dl_03033258[] = {
|
||||
const Gfx tree_seg3_dl_palm[] = {
|
||||
gsDPPipeSync(),
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
gsDPSetCombineMode(G_CC_DECALFADEA, G_CC_DECALFADEA),
|
||||
#else
|
||||
gsDPSetCombineMode(G_CC_MODULATERGBA, G_CC_MODULATERGBA),
|
||||
#endif
|
||||
gsSPClearGeometryMode(G_SHADING_SMOOTH),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 6, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
|
||||
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (64 - 1) << G_TEXTURE_IMAGE_FRAC),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, tree_seg3_texture_03032218),
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, tree_seg3_texture_palm),
|
||||
gsDPLoadSync(),
|
||||
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
|
||||
gsSPLight(&tree_seg3_lights_0302DE10.l, 1),
|
||||
gsSPLight(&tree_seg3_lights_0302DE10.a, 2),
|
||||
gsSPVertex(tree_seg3_vertex_03033218, 4, 0),
|
||||
gsSPVertex(tree_seg3_vertex_palm, 4, 0),
|
||||
gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
|
||||
gsDPPipeSync(),
|
||||
|
||||
@@ -3127,7 +3127,7 @@ const BehaviorScript bhvFloorTrapInCastle[] = {
|
||||
const BehaviorScript bhvTree[] = {
|
||||
BEGIN(OBJ_LIST_POLELIKE),
|
||||
BILLBOARD(),
|
||||
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
|
||||
OR_LONG(oFlags, (OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE | OBJ_FLAG_OPACITY_FROM_CAMERA_DIST)),
|
||||
SET_INT(oInteractType, INTERACT_POLE),
|
||||
SET_HITBOX(/*Radius*/ 80, /*Height*/ 500),
|
||||
SET_INT(oIntangibleTimer, 0),
|
||||
|
||||
@@ -156,6 +156,8 @@
|
||||
// NOTE: The overlap between Mario's model parts is visible on certain HLE plugins.
|
||||
// Also, this also disables anti-aliasing on Mario.
|
||||
#define SILHOUETTE 127
|
||||
// Makes certain objects (mainly trees) transparent when the camera gets close
|
||||
#define OBJ_OPACITY_BY_CAM_DIST
|
||||
// Fixes the game reading the ia8 burn smoke texture as an rgba16
|
||||
#define BURN_SMOKE_FIX
|
||||
// Disable the fix to Koopa's unshelled model
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#define OBJ_FLAG_EMIT_LIGHT (1 << 17) // 0x00020000
|
||||
#define OBJ_FLAG_UCODE_LARGE (1 << 18) // 0x00040000
|
||||
#define OBJ_FLAG_SILHOUETTE (1 << 19) // 0x00080000
|
||||
#define OBJ_FLAG_OPACITY_FROM_CAMERA_DIST (1 << 20) // 0x00100000
|
||||
#define OBJ_FLAG_HITBOX_WAS_SET (1 << 30) // 0x40000000
|
||||
|
||||
/* oHeldState */
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "game/obj_behaviors_2.h"
|
||||
#include "game/object_helpers.h"
|
||||
#include "game/object_list_processor.h"
|
||||
#include "math_util.h"
|
||||
#include "graph_node.h"
|
||||
#include "surface_collision.h"
|
||||
#include "game/puppylights.h"
|
||||
@@ -982,6 +983,30 @@ void cur_obj_update(void) {
|
||||
gCurrentObject->header.gfx.node.flags &= ~GRAPH_RENDER_SILHOUETTE;
|
||||
}
|
||||
|
||||
#ifdef OBJ_OPACITY_BY_CAM_DIST
|
||||
if (objFlags & OBJ_FLAG_OPACITY_FROM_CAMERA_DIST) {
|
||||
f32 dist;
|
||||
Vec3f d;
|
||||
if (gCurrentObject->header.gfx.node.flags & GRAPH_RENDER_BILLBOARD) {
|
||||
d[0] = gCurrentObject->oPosX - gCamera->pos[0];
|
||||
d[2] = gCurrentObject->oPosZ - gCamera->pos[2];
|
||||
dist = sqrtf(sqr(d[0]) + sqr(d[2]));
|
||||
} else {
|
||||
vec3_diff(d, &gCurrentObject->oPosVec, gCamera->pos);
|
||||
dist = sqrtf(sqr(d[0]) + sqr(d[1]) + sqr(d[2]));
|
||||
}
|
||||
if (dist > 0.0f) {
|
||||
gCurrentObject->header.gfx.node.flags &= ~GRAPH_RENDER_UCODE_REJ;
|
||||
}
|
||||
#ifdef PUPPYCAM
|
||||
s32 opacityDist = ((gPuppyCam.zoom > 0) ? ((dist / gPuppyCam.zoom) * 255.0f) : 255);
|
||||
#else
|
||||
s32 opacityDist = (dist * (255.0f / 1024.0f));
|
||||
#endif
|
||||
gCurrentObject->oOpacity = CLAMP(opacityDist, 0x00, 0xFF);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PUPPYLIGHTS
|
||||
puppylights_object_emit(gCurrentObject);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user