diff --git a/levels/castle_inside/areas/1/geo.inc.c b/levels/castle_inside/areas/1/geo.inc.c index 39e863ba4..ae7904549 100644 --- a/levels/castle_inside/areas/1/geo.inc.c +++ b/levels/castle_inside/areas/1/geo.inc.c @@ -89,8 +89,8 @@ const GeoLayout castle_geo_001088[] = { GEO_OPEN_NODE(), GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_0703A6C8), GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_0703A808), - GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_070234C0), - GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07023520), + GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_ccm_fake_painting_1), + GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_ccm_fake_painting_2), GEO_ASM( 0, geo_painting_update), GEO_ASM(PAINTING_ID(1, 1), geo_painting_draw), GEO_CLOSE_NODE(), @@ -231,8 +231,8 @@ const GeoLayout castle_geo_001348[] = { GEO_ASM( 0, geo_exec_inside_castle_light), GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_0703A6C8), GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_0703A808), - GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_070234C0), - GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07023520), + GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_ccm_fake_painting_1), + GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_ccm_fake_painting_2), GEO_ASM( 0, geo_painting_update), GEO_ASM(PAINTING_ID(1, 1), geo_painting_draw), GEO_CLOSE_NODE(), diff --git a/levels/castle_inside/header.h b/levels/castle_inside/header.h index 891fee827..682c926eb 100644 --- a/levels/castle_inside/header.h +++ b/levels/castle_inside/header.h @@ -55,10 +55,8 @@ extern const GeoLayout castle_geo_001BB0[]; extern const GeoLayout castle_geo_001C10[]; // leveldata -extern const Gfx inside_castle_seg7_dl_070225D8[]; -extern const Gfx inside_castle_seg7_dl_07022610[]; -extern const Gfx inside_castle_seg7_dl_070234C0[]; -extern const Gfx inside_castle_seg7_dl_07023520[]; +extern const Gfx inside_castle_seg7_dl_ccm_fake_painting_1[]; +extern const Gfx inside_castle_seg7_dl_ccm_fake_painting_2[]; extern struct Painting bob_painting; extern struct Painting ccm_painting; extern struct Painting wf_painting; diff --git a/levels/castle_inside/painting.inc.c b/levels/castle_inside/painting.inc.c index d668820f1..061b29737 100644 --- a/levels/castle_inside/painting.inc.c +++ b/levels/castle_inside/painting.inc.c @@ -1,13 +1,13 @@ #include "game/paintings.h" // 0x07021800 - 0x07021818 -static const Lights1 inside_castle_seg7_lights_07021800 = gdSPDefLights1( +static const Lights1 inside_castle_seg7_lights_textured = gdSPDefLights1( 0x50, 0x50, 0x50, 0xff, 0xff, 0xff, 0x32, 0x32, 0x32 ); // 0x07021818 - 0x07021898 -static const Vtx inside_castle_seg7_vertex_07021818[] = { +static const Vtx inside_castle_seg7_vertex_painting_textured[] = { {{{ 0, 0, 0}, 0, { -32, 992}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ 614, 0, 0}, 0, { 2012, 992}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ 614, 307, 0}, 0, { 2012, 0}, {0x00, 0x00, 0x7f, 0xff}}}, @@ -19,7 +19,7 @@ static const Vtx inside_castle_seg7_vertex_07021818[] = { }; // 0x07021898 - 0x07021918 -static const Vtx inside_castle_seg7_vertex_07021898[] = { +static const Vtx inside_castle_seg7_vertex_painting_sl[] = { {{{ 0, 0, 0}, 0, { -32, 992}, {0xdd, 0xdd, 0xdd, 0xff}}}, {{{ 614, 0, 0}, 0, { 2012, 992}, {0xdd, 0xdd, 0xdd, 0xff}}}, {{{ 614, 307, 0}, 0, { 2012, 0}, {0xdd, 0xdd, 0xdd, 0xff}}}, @@ -31,7 +31,7 @@ static const Vtx inside_castle_seg7_vertex_07021898[] = { }; // 0x07021918 - 0x07021998 -static const Vtx inside_castle_seg7_vertex_07021918[] = { +static const Vtx inside_castle_seg7_vertex_painting_ccm_fake_1[] = { {{{ -3046, -307, -3724}, 0, { -32, 992}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ -2742, -307, -4258}, 0, { 2012, 992}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ -2742, 0, -4258}, 0, { 2012, 0}, {0x00, 0x00, 0x7f, 0xff}}}, @@ -43,7 +43,7 @@ static const Vtx inside_castle_seg7_vertex_07021918[] = { }; // 0x07021998 - 0x07021A18 -static const Vtx inside_castle_seg7_vertex_07021998[] = { +static const Vtx inside_castle_seg7_vertex_painting_ccm_fake_2[] = { {{{ -1866, -307, -4258}, 0, { -32, 992}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ -1562, -307, -3724}, 0, { 2012, 992}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ -1562, 0, -3724}, 0, { 2012, 0}, {0x00, 0x00, 0x7f, 0xff}}}, @@ -55,24 +55,24 @@ static const Vtx inside_castle_seg7_vertex_07021998[] = { }; // 0x07021A18 - 0x07021A30 -static const Gfx inside_castle_seg7_dl_07021A18[] = { +static const Gfx inside_castle_seg7_sub_dl_painting_bottom[] = { gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSPEndDisplayList(), }; // 0x07021A30 - 0x07021A48 -static const Gfx inside_castle_seg7_dl_07021A30[] = { +static const Gfx inside_castle_seg7_sub_dl_painting_top[] = { gsSP2Triangles( 4, 5, 6, 0x0, 4, 6, 7, 0x0), gsSPEndDisplayList(), }; // 0x07021A48 - 0x07021AA0 -static const Gfx inside_castle_seg7_dl_07021A48[] = { +static const Gfx inside_castle_seg7_dl_painting_texture_begin[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_LIGHTING | G_SHADING_SMOOTH), gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_MODULATERGB), - gsSPLight(&inside_castle_seg7_lights_07021800.l, 1), - gsSPLight(&inside_castle_seg7_lights_07021800.a, 2), + gsSPLight(&inside_castle_seg7_lights_textured.l, 1), + gsSPLight(&inside_castle_seg7_lights_textured.a, 2), 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), gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 6, G_TX_NOLOD), @@ -82,7 +82,7 @@ static const Gfx inside_castle_seg7_dl_07021A48[] = { }; // 0x07021AA0 - 0x07021AC0 -static const Gfx inside_castle_seg7_dl_07021AA0[] = { +static const Gfx inside_castle_seg7_dl_painting_texture_end[] = { gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), gsDPPipeSync(), gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), @@ -90,7 +90,7 @@ static const Gfx inside_castle_seg7_dl_07021AA0[] = { }; // 0x07021AC0 - 0x07021AE0 -static const Gfx inside_castle_seg7_painting_dl_07021AC0[] = { +static const Gfx inside_castle_seg7_painting_dl_image_ripple[] = { gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 6, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (64 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), @@ -564,60 +564,22 @@ static const PaintingData *const inside_castle_seg7_painting_texture_maps_070225 UNUSED static const u64 castle_inside_unused_0 = 0x0; -// 0x07022528 - 0x07022540 -static const Lights1 inside_castle_seg7_lights_07022528 = gdSPDefLights1( - 0x50, 0x50, 0x50, - 0xff, 0xff, 0xff, 0x32, 0x32, 0x32 +// 0x07022540 - 0x07022558 +static const Lights1 inside_castle_seg7_lights_hmc = gdSPDefLights1( + 0x40, 0x40, 0x80, + 0x64, 0x64, 0xff, 0x28, 0x28, 0x28 ); -// 0x07022540 - 0x07022558 -// No gdSPDefLights1 macro defined because of odd different light value (0xff and 0xfa) -static const Lights1 inside_castle_seg7_lights_07022540 = { - {{ {0x40, 0x40, 0x80}, 0, {0x40, 0x40, 0x80}, 0} }, - {{{ {0x64, 0x64, 0xff}, 0, {0x64, 0x64, 0xfa}, 0, {0x28, 0x28, 0x28},0} }} -}; - -// 0x07022558 - 0x07022598 -static const Vtx inside_castle_seg7_vertex_07022558[] = { - {{{ 0, 0, 0}, 0, { -32, 990}, {0x00, 0x00, 0x7f, 0xff}}}, - {{{ 614, 0, 0}, 0, { 6100, 990}, {0x00, 0x00, 0x7f, 0xff}}}, - {{{ 614, 614, 0}, 0, { 6100, -5142}, {0x00, 0x00, 0x7f, 0xff}}}, - {{{ 0, 614, 0}, 0, { -32, -5142}, {0x00, 0x00, 0x7f, 0xff}}}, -}; - // 0x07022598 - 0x070225D8 -static const Vtx inside_castle_seg7_vertex_07022598[] = { +static const Vtx inside_castle_seg7_vertex_hmc[] = { {{{ 0, 0, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ 614, 0, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ 614, 614, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ 0, 614, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}}, }; -// TODO: this is unused -// 0x070225D8 - 0x07022610 -const Gfx inside_castle_seg7_dl_070225D8[] = { - gsDPPipeSync(), - gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_MODULATERGB), - gsSPLight(&inside_castle_seg7_lights_07022528.l, 1), - gsSPLight(&inside_castle_seg7_lights_07022528.a, 2), - gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), - gsSPVertex(inside_castle_seg7_vertex_07022558, 4, 0), - gsSPEndDisplayList(), -}; - -// TODO: this is unused -// 0x07022610 - 0x07022640 -const Gfx inside_castle_seg7_dl_07022610[] = { - gsSP1Triangle( 0, 1, 2, 0x0), - gsSP1Triangle( 0, 2, 3, 0x0), - gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), - gsDPPipeSync(), - gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), - gsSPEndDisplayList(), -}; - // 0x07022640 - 0x07022660 -static const Gfx inside_castle_seg7_painting_dl_07022640[] = { +static const Gfx inside_castle_seg7_painting_dl_env_map_ripple[] = { gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), @@ -1067,167 +1029,167 @@ UNUSED static const u64 castle_inside_unused_1 = 0x0; // 0x07023050 - 0x070230B0 -static const Gfx inside_castle_seg7_painting_dl_07023050[] = { - gsSPDisplayList(inside_castle_seg7_dl_07021A48), - gsSPVertex(inside_castle_seg7_vertex_07021818, 8, 0), +static const Gfx inside_castle_seg7_painting_dl_bob[] = { + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_begin), + gsSPVertex(inside_castle_seg7_vertex_painting_textured, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0700B800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0700A800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), - gsSPDisplayList(inside_castle_seg7_dl_07021AA0), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_end), gsSPEndDisplayList(), }; // 0x070230B0 - 0x07023110 -static const Gfx inside_castle_seg7_painting_dl_070230B0[] = { - gsSPDisplayList(inside_castle_seg7_dl_07021A48), - gsSPVertex(inside_castle_seg7_vertex_07021818, 8, 0), +static const Gfx inside_castle_seg7_painting_dl_ccm[] = { + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_begin), + gsSPVertex(inside_castle_seg7_vertex_painting_textured, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0700D800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0700C800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), - gsSPDisplayList(inside_castle_seg7_dl_07021AA0), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_end), gsSPEndDisplayList(), }; // 0x07023110 - 0x07023170 -static const Gfx inside_castle_seg7_painting_dl_07023110[] = { - gsSPDisplayList(inside_castle_seg7_dl_07021A48), - gsSPVertex(inside_castle_seg7_vertex_07021818, 8, 0), +static const Gfx inside_castle_seg7_painting_dl_wf[] = { + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_begin), + gsSPVertex(inside_castle_seg7_vertex_painting_textured, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0700F800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0700E800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), - gsSPDisplayList(inside_castle_seg7_dl_07021AA0), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_end), gsSPEndDisplayList(), }; // 0x07023170 - 0x070231D0 -static const Gfx inside_castle_seg7_painting_dl_07023170[] = { - gsSPDisplayList(inside_castle_seg7_dl_07021A48), - gsSPVertex(inside_castle_seg7_vertex_07021818, 8, 0), +static const Gfx inside_castle_seg7_painting_dl_jrb[] = { + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_begin), + gsSPVertex(inside_castle_seg7_vertex_painting_textured, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_07011800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_07010800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), - gsSPDisplayList(inside_castle_seg7_dl_07021AA0), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_end), gsSPEndDisplayList(), }; // 0x070231D0 - 0x07023230 -static const Gfx inside_castle_seg7_painting_dl_070231D0[] = { - gsSPDisplayList(inside_castle_seg7_dl_07021A48), - gsSPVertex(inside_castle_seg7_vertex_07021818, 8, 0), +static const Gfx inside_castle_seg7_painting_dl_lll[] = { + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_begin), + gsSPVertex(inside_castle_seg7_vertex_painting_textured, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_07012800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_07013800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), - gsSPDisplayList(inside_castle_seg7_dl_07021AA0), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_end), gsSPEndDisplayList(), }; // 0x07023230 - 0x07023290 -static const Gfx inside_castle_seg7_painting_dl_07023230[] = { - gsSPDisplayList(inside_castle_seg7_dl_07021A48), - gsSPVertex(inside_castle_seg7_vertex_07021818, 8, 0), +static const Gfx inside_castle_seg7_painting_dl_ssl[] = { + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_begin), + gsSPVertex(inside_castle_seg7_vertex_painting_textured, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_07015800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_07014800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), - gsSPDisplayList(inside_castle_seg7_dl_07021AA0), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_end), gsSPEndDisplayList(), }; // 0x07023290 - 0x070232F0 -static const Gfx inside_castle_seg7_painting_dl_07023290[] = { - gsSPDisplayList(inside_castle_seg7_dl_07021A48), - gsSPVertex(inside_castle_seg7_vertex_07021818, 8, 0), +static const Gfx inside_castle_seg7_painting_dl_wdw[] = { + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_begin), + gsSPVertex(inside_castle_seg7_vertex_painting_textured, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_07018800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_07017800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), - gsSPDisplayList(inside_castle_seg7_dl_07021AA0), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_end), gsSPEndDisplayList(), }; // 0x070232F0 - 0x07023350 -static const Gfx inside_castle_seg7_painting_dl_070232F0[] = { - gsSPDisplayList(inside_castle_seg7_dl_07021A48), - gsSPVertex(inside_castle_seg7_vertex_07021818, 8, 0), +static const Gfx inside_castle_seg7_painting_dl_thi[] = { + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_begin), + gsSPVertex(inside_castle_seg7_vertex_painting_textured, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0701A800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_07019800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), - gsSPDisplayList(inside_castle_seg7_dl_07021AA0), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_end), gsSPEndDisplayList(), }; // 0x07023350 - 0x070233B0 -static const Gfx inside_castle_seg7_painting_dl_07023350[] = { - gsSPDisplayList(inside_castle_seg7_dl_07021A48), - gsSPVertex(inside_castle_seg7_vertex_07021818, 8, 0), +static const Gfx inside_castle_seg7_painting_dl_ttm[] = { + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_begin), + gsSPVertex(inside_castle_seg7_vertex_painting_textured, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0701C800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0701B800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), - gsSPDisplayList(inside_castle_seg7_dl_07021AA0), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_end), gsSPEndDisplayList(), }; // 0x070233B0 - 0x07023410 -static const Gfx inside_castle_seg7_painting_dl_070233B0[] = { - gsSPDisplayList(inside_castle_seg7_dl_07021A48), - gsSPVertex(inside_castle_seg7_vertex_07021818, 8, 0), +static const Gfx inside_castle_seg7_painting_dl_ttc[] = { + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_begin), + gsSPVertex(inside_castle_seg7_vertex_painting_textured, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0701E800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0701D800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), - gsSPDisplayList(inside_castle_seg7_dl_07021AA0), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_end), gsSPEndDisplayList(), }; // 0x07023410 - 0x070234C0 -static const Gfx inside_castle_seg7_painting_dl_07023410[] = { +static const Gfx inside_castle_seg7_painting_dl_sl[] = { gsDPPipeSync(), gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_MODULATERGB), gsSPClearGeometryMode(G_LIGHTING), @@ -1236,15 +1198,15 @@ static const Gfx inside_castle_seg7_painting_dl_07023410[] = { gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 6, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (64 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), - gsSPVertex(inside_castle_seg7_vertex_07021898, 8, 0), + gsSPVertex(inside_castle_seg7_vertex_painting_sl, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_07020800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0701F800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), gsDPPipeSync(), gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), @@ -1253,102 +1215,102 @@ static const Gfx inside_castle_seg7_painting_dl_07023410[] = { }; // 0x070234C0 - 0x07023520 -const Gfx inside_castle_seg7_dl_070234C0[] = { - gsSPDisplayList(inside_castle_seg7_dl_07021A48), - gsSPVertex(inside_castle_seg7_vertex_07021918, 8, 0), +const Gfx inside_castle_seg7_dl_ccm_fake_painting_1[] = { + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_begin), + gsSPVertex(inside_castle_seg7_vertex_painting_ccm_fake_1, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0700D800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0700C800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), - gsSPDisplayList(inside_castle_seg7_dl_07021AA0), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_end), gsSPEndDisplayList(), }; // 0x07023520 - 0x07023580 -const Gfx inside_castle_seg7_dl_07023520[] = { - gsSPDisplayList(inside_castle_seg7_dl_07021A48), - gsSPVertex(inside_castle_seg7_vertex_07021998, 8, 0), +const Gfx inside_castle_seg7_dl_ccm_fake_painting_2[] = { + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_begin), + gsSPVertex(inside_castle_seg7_vertex_painting_ccm_fake_2, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0700D800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A18), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, inside_castle_seg7_texture_0700C800), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(inside_castle_seg7_dl_07021A30), - gsSPDisplayList(inside_castle_seg7_dl_07021AA0), + gsSPDisplayList(inside_castle_seg7_sub_dl_painting_top), + gsSPDisplayList(inside_castle_seg7_dl_painting_texture_end), gsSPEndDisplayList(), }; // 0x07023580 - 0x070235B8 -static const Gfx inside_castle_seg7_painting_dl_07023580[] = { +static const Gfx inside_castle_seg7_painting_dl_hmc[] = { gsDPPipeSync(), - gsSPLight(&inside_castle_seg7_lights_07022540.l, 1), - gsSPLight(&inside_castle_seg7_lights_07022540.a, 2), - gsSPVertex(inside_castle_seg7_vertex_07022598, 4, 0), + gsSPLight(&inside_castle_seg7_lights_hmc.l, 1), + gsSPLight(&inside_castle_seg7_lights_hmc.a, 2), + gsSPVertex(inside_castle_seg7_vertex_hmc, 4, 0), gsSP1Triangle( 0, 1, 2, 0x0), gsSP1Triangle( 0, 2, 3, 0x0), gsSPEndDisplayList(), }; // 0x070235B8 - 0x070235C0 -static const Gfx inside_castle_seg7_painting_dl_070235B8[] = { - gsSPBranchList(inside_castle_seg7_painting_dl_07023580), +static const Gfx inside_castle_seg7_painting_dl_ddd[] = { + gsSPBranchList(inside_castle_seg7_painting_dl_hmc), }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_070235C0[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_bob[] = { inside_castle_seg7_texture_0700B800, inside_castle_seg7_texture_0700A800, }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_070235C8[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_ccm[] = { inside_castle_seg7_texture_0700D800, inside_castle_seg7_texture_0700C800, }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_070235D0[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_wf[] = { inside_castle_seg7_texture_0700F800, inside_castle_seg7_texture_0700E800, }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_070235D8[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_jrb[] = { inside_castle_seg7_texture_07011800, inside_castle_seg7_texture_07010800, }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_070235E0[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_lll[] = { inside_castle_seg7_texture_07012800, inside_castle_seg7_texture_07013800, }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_070235E8[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_ssl[] = { inside_castle_seg7_texture_07015800, inside_castle_seg7_texture_07014800, }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_070235F0[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_hmc_env[] = { inside_castle_seg7_texture_07016800, }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_070235F4[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_ddd_env[] = { inside_castle_seg7_texture_07017000, }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_070235F8[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_wdw[] = { inside_castle_seg7_texture_07018800, inside_castle_seg7_texture_07017800, }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_07023600[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_thi[] = { inside_castle_seg7_texture_0701A800, inside_castle_seg7_texture_07019800, }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_07023608[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_ttm[] = { inside_castle_seg7_texture_0701C800, inside_castle_seg7_texture_0701B800, }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_07023610[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_ttc[] = { inside_castle_seg7_texture_0701E800, inside_castle_seg7_texture_0701D800, }; -ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_07023618[] = { +ALIGNED8 static const Texture *const inside_castle_seg7_painting_textures_sl[] = { inside_castle_seg7_texture_07020800, inside_castle_seg7_texture_0701F800, }; @@ -1368,11 +1330,11 @@ struct Painting bob_painting = { /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_07023050, + /* Normal DList */ inside_castle_seg7_painting_dl_bob, /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518, - /* Textures */ inside_castle_seg7_painting_textures_070235C0, + /* Textures */ inside_castle_seg7_painting_textures_bob, /* Texture w, h */ 64, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0, + /* Ripple DList */ inside_castle_seg7_painting_dl_image_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1395,11 +1357,11 @@ struct Painting ccm_painting = { /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_070230B0, + /* Normal DList */ inside_castle_seg7_painting_dl_ccm, /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518, - /* Textures */ inside_castle_seg7_painting_textures_070235C8, + /* Textures */ inside_castle_seg7_painting_textures_ccm, /* Texture w, h */ 64, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0, + /* Ripple DList */ inside_castle_seg7_painting_dl_image_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1422,11 +1384,11 @@ struct Painting wf_painting = { /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_07023110, + /* Normal DList */ inside_castle_seg7_painting_dl_wf, /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518, - /* Textures */ inside_castle_seg7_painting_textures_070235D0, + /* Textures */ inside_castle_seg7_painting_textures_wf, /* Texture w, h */ 64, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0, + /* Ripple DList */ inside_castle_seg7_painting_dl_image_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1449,11 +1411,11 @@ struct Painting jrb_painting = { /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_07023170, + /* Normal DList */ inside_castle_seg7_painting_dl_jrb, /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518, - /* Textures */ inside_castle_seg7_painting_textures_070235D8, + /* Textures */ inside_castle_seg7_painting_textures_jrb, /* Texture w, h */ 64, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0, + /* Ripple DList */ inside_castle_seg7_painting_dl_image_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1476,11 +1438,11 @@ struct Painting lll_painting = { /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_070231D0, + /* Normal DList */ inside_castle_seg7_painting_dl_lll, /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518, - /* Textures */ inside_castle_seg7_painting_textures_070235E0, + /* Textures */ inside_castle_seg7_painting_textures_lll, /* Texture w, h */ 64, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0, + /* Ripple DList */ inside_castle_seg7_painting_dl_image_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1503,11 +1465,11 @@ struct Painting ssl_painting = { /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_07023230, + /* Normal DList */ inside_castle_seg7_painting_dl_ssl, /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518, - /* Textures */ inside_castle_seg7_painting_textures_070235E8, + /* Textures */ inside_castle_seg7_painting_textures_ssl, /* Texture w, h */ 64, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0, + /* Ripple DList */ inside_castle_seg7_painting_dl_image_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1530,11 +1492,11 @@ struct Painting hmc_painting = { /* Ripple Dispersion */ 0.0f, 15.0f, 15.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_07023580, + /* Normal DList */ inside_castle_seg7_painting_dl_hmc, /* Texture Maps */ inside_castle_seg7_painting_env_map_texture_maps_07023044, - /* Textures */ inside_castle_seg7_painting_textures_070235F0, + /* Textures */ inside_castle_seg7_painting_textures_hmc_env, /* Texture w, h */ 32, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07022640, + /* Ripple DList */ inside_castle_seg7_painting_dl_env_map_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_CONTINUOUS, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1557,11 +1519,11 @@ struct Painting ddd_painting = { /* Ripple Dispersion */ 0.0f, 15.0f, 15.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_070235B8, + /* Normal DList */ inside_castle_seg7_painting_dl_ddd, /* Texture Maps */ inside_castle_seg7_painting_env_map_texture_maps_07023044, - /* Textures */ inside_castle_seg7_painting_textures_070235F4, + /* Textures */ inside_castle_seg7_painting_textures_ddd_env, /* Texture w, h */ 32, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07022640, + /* Ripple DList */ inside_castle_seg7_painting_dl_env_map_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_CONTINUOUS, /* Alpha */ 0xB4, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1584,11 +1546,11 @@ struct Painting wdw_painting = { /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_07023290, + /* Normal DList */ inside_castle_seg7_painting_dl_wdw, /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518, - /* Textures */ inside_castle_seg7_painting_textures_070235F8, + /* Textures */ inside_castle_seg7_painting_textures_wdw, /* Texture w, h */ 64, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0, + /* Ripple DList */ inside_castle_seg7_painting_dl_image_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1611,11 +1573,11 @@ struct Painting thi_tiny_painting = { /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_070232F0, + /* Normal DList */ inside_castle_seg7_painting_dl_thi, /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518, - /* Textures */ inside_castle_seg7_painting_textures_07023600, + /* Textures */ inside_castle_seg7_painting_textures_thi, /* Texture w, h */ 64, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0, + /* Ripple DList */ inside_castle_seg7_painting_dl_image_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1638,11 +1600,11 @@ struct Painting ttm_painting = { /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_07023350, + /* Normal DList */ inside_castle_seg7_painting_dl_ttm, /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518, - /* Textures */ inside_castle_seg7_painting_textures_07023608, + /* Textures */ inside_castle_seg7_painting_textures_ttm, /* Texture w, h */ 64, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0, + /* Ripple DList */ inside_castle_seg7_painting_dl_image_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1665,11 +1627,11 @@ struct Painting ttc_painting = { /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_070233B0, + /* Normal DList */ inside_castle_seg7_painting_dl_ttc, /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518, - /* Textures */ inside_castle_seg7_painting_textures_07023610, + /* Textures */ inside_castle_seg7_painting_textures_ttc, /* Texture w, h */ 64, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0, + /* Ripple DList */ inside_castle_seg7_painting_dl_image_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1692,11 +1654,11 @@ struct Painting sl_painting = { /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_07023410, + /* Normal DList */ inside_castle_seg7_painting_dl_sl, /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518, - /* Textures */ inside_castle_seg7_painting_textures_07023618, + /* Textures */ inside_castle_seg7_painting_textures_sl, /* Texture w, h */ 64, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0, + /* Ripple DList */ inside_castle_seg7_painting_dl_image_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ @@ -1719,11 +1681,11 @@ struct Painting thi_huge_painting = { /* Ripple Dispersion */ 0.0f, 80.0f, 60.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ inside_castle_seg7_painting_dl_070232F0, + /* Normal DList */ inside_castle_seg7_painting_dl_thi, /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518, - /* Textures */ inside_castle_seg7_painting_textures_07023600, + /* Textures */ inside_castle_seg7_painting_textures_thi, /* Texture w, h */ 64, 32, - /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0, + /* Ripple DList */ inside_castle_seg7_painting_dl_image_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ diff --git a/levels/hmc/areas/1/painting.inc.c b/levels/hmc/areas/1/painting.inc.c index da95de863..81e3da8ab 100644 --- a/levels/hmc/areas/1/painting.inc.c +++ b/levels/hmc/areas/1/painting.inc.c @@ -1,59 +1,21 @@ #include "game/paintings.h" -// 0x070241B8 - 0x070241D0 -static const Lights1 hmc_seg7_lights_070241B8 = gdSPDefLights1( - 0x50, 0x50, 0x50, - 0xff, 0xff, 0xff, 0x32, 0x32, 0x32 +// 0x070241D0 - 0x070241E8 +static const Lights1 hmc_seg7_lights_cotmc_pool = gdSPDefLights1( + 0x40, 0x40, 0x80, + 0x64, 0x64, 0xff, 0x28, 0x28, 0x28 ); -// 0x070241D0 - 0x070241E8 -// No gdSPDefLights1 macro defined because of odd different light value (0xff and 0xfa) -static const Lights1 hmc_seg7_lights_070241D0 = { - {{ {0x40, 0x40, 0x80}, 0, {0x40, 0x40, 0x80}, 0} }, - {{{ {0x64, 0x64, 0xff}, 0, {0x64, 0x64, 0xfa}, 0, {0x28, 0x28, 0x28},0} }} -}; - -// Appears to lock 4 of the sides when shimmering and in use. Unused. -// 0x070241E8 - 0x07024228 -static const Vtx hmc_seg7_vertex_070241E8[] = { - {{{ 0, 0, 0}, 0, { -32, 990}, {0x00, 0x00, 0x7f, 0xff}}}, - {{{ 614, 0, 0}, 0, { 6100, 990}, {0x00, 0x00, 0x7f, 0xff}}}, - {{{ 614, 614, 0}, 0, { 6100, -5142}, {0x00, 0x00, 0x7f, 0xff}}}, - {{{ 0, 614, 0}, 0, { -32, -5142}, {0x00, 0x00, 0x7f, 0xff}}}, -}; - // 0x07024228 - 0x07024268 -static const Vtx hmc_seg7_vertex_07024228[] = { +static const Vtx hmc_seg7_vertex_cotmc_pool[] = { {{{ 0, 0, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ 614, 0, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ 614, 614, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ 0, 614, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}}, }; -// Unused -// 0x07024268 - 0x070242A0 -const Gfx hmc_seg7_dl_07024268[] = { - gsDPPipeSync(), - gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_MODULATERGB), - gsSPLight(&hmc_seg7_lights_070241B8.l, 1), - gsSPLight(&hmc_seg7_lights_070241B8.a, 2), - gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), - gsSPVertex(hmc_seg7_vertex_070241E8, 4, 0), - gsSPEndDisplayList(), -}; - -// Unused -// 0x070242A0 - 0x070242D0 -const Gfx hmc_seg7_dl_070242A0[] = { - 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), - gsSPEndDisplayList(), -}; - // 0x070242D0 - 0x070242F0 -static const Gfx hmc_seg7_painting_dl_070242D0[] = { +static const Gfx hmc_seg7_painting_dl_cotmc_normal_ripple[] = { gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), @@ -61,7 +23,7 @@ static const Gfx hmc_seg7_painting_dl_070242D0[] = { }; // 0x070242F0 - 0x07024CD2 -static const PaintingData hmc_seg7_pool_texture_map_070242F0[] = { +static const PaintingData hmc_seg7_pool_texture_map_cotmc[] = { 157, // num mappings // Format: // mesh vtx ID, texture X, texture Y @@ -493,28 +455,28 @@ static const PaintingData hmc_seg7_pool_texture_map_070242F0[] = { }; // 0x07024CD4 -static const PaintingData *const hmc_seg7_painting_texture_maps_07024CD4[] = { - hmc_seg7_pool_texture_map_070242F0, +static const PaintingData *const hmc_seg7_painting_texture_maps_cotmc[] = { + hmc_seg7_pool_texture_map_cotmc, }; // 0x07024CE0 - 0x070254E0 -ALIGNED8 static const Texture hmc_seg7_texture_07024CE0[] = { +ALIGNED8 static const Texture hmc_seg7_texture_cotmc_pool_env[] = { #include "levels/hmc/7.rgba16.inc.c" }; // 0x070254E0 - 0x07025518 -static const Gfx hmc_seg7_painting_dl_070254E0[] = { +static const Gfx hmc_seg7_painting_dl_cotmc_normal[] = { gsDPPipeSync(), - gsSPLight(&hmc_seg7_lights_070241D0.l, 1), - gsSPLight(&hmc_seg7_lights_070241D0.a, 2), - gsSPVertex(hmc_seg7_vertex_07024228, 4, 0), + gsSPLight(&hmc_seg7_lights_cotmc_pool.l, 1), + gsSPLight(&hmc_seg7_lights_cotmc_pool.a, 2), + gsSPVertex(hmc_seg7_vertex_cotmc_pool, 4, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSPEndDisplayList(), }; // 0x07025518 - 0x07025594 -const Texture *const hmc_seg7_painting_textures_07025518[] = { - hmc_seg7_texture_07024CE0, +const Texture *const hmc_seg7_painting_textures_cotmc[] = { + hmc_seg7_texture_cotmc_pool_env, }; // 0x0702551C (PaintingData) @@ -533,11 +495,11 @@ struct Painting cotmc_painting = { /* Ripple Dispersion */ 0.0f, 15.0f, 15.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ hmc_seg7_painting_dl_070254E0, - /* Texture Maps */ hmc_seg7_painting_texture_maps_07024CD4, - /* Textures */ hmc_seg7_painting_textures_07025518, + /* Normal DList */ hmc_seg7_painting_dl_cotmc_normal, + /* Texture Maps */ hmc_seg7_painting_texture_maps_cotmc, + /* Textures */ hmc_seg7_painting_textures_cotmc, /* Texture w, h */ 32, 32, - /* Ripple DList */ hmc_seg7_painting_dl_070242D0, + /* Ripple DList */ hmc_seg7_painting_dl_cotmc_normal_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_CONTINUOUS, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ diff --git a/levels/hmc/header.h b/levels/hmc/header.h index 9ff10e5f3..980998397 100644 --- a/levels/hmc/header.h +++ b/levels/hmc/header.h @@ -72,9 +72,7 @@ extern const Gfx hmc_seg7_dl_07023090[]; extern const Gfx hmc_seg7_dl_07023BC8[]; extern const Gfx hmc_seg7_dl_07023E10[]; extern const Gfx hmc_seg7_dl_07024110[]; -extern const Gfx hmc_seg7_dl_07024268[]; -extern const Gfx hmc_seg7_dl_070242A0[]; -extern const Texture *const hmc_seg7_painting_textures_07025518[]; +extern const Texture *const hmc_seg7_painting_textures_cotmc[]; extern struct Painting cotmc_painting; extern const Collision hmc_seg7_collision_level[]; extern const MacroObject hmc_seg7_macro_objs[]; diff --git a/levels/ttm/areas/1/painting.inc.c b/levels/ttm/areas/1/painting.inc.c index 2477f6547..a67ef8851 100644 --- a/levels/ttm/areas/1/painting.inc.c +++ b/levels/ttm/areas/1/painting.inc.c @@ -1,13 +1,13 @@ #include "game/paintings.h" // 0x070122F0 - 0x07012308 -static const Lights1 ttm_seg7_lights_070122F0 = gdSPDefLights1( +static const Lights1 ttm_seg7_lights_slide_painting = gdSPDefLights1( 0x50, 0x50, 0x50, 0xff, 0xff, 0xff, 0x32, 0x32, 0x32 ); // 0x07012308 - 0x07012388 -static const Vtx ttm_seg7_vertex_07012308[] = { +static const Vtx ttm_seg7_vertex_slide_painting[] = { {{{ 0, 0, 0}, 0, { -32, 992}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ 614, 0, 0}, 0, { 2012, 992}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ 614, 307, 0}, 0, { 2012, 0}, {0x00, 0x00, 0x7f, 0xff}}}, @@ -19,24 +19,24 @@ static const Vtx ttm_seg7_vertex_07012308[] = { }; // 0x07012388 - 0x070123A0 -const Gfx ttm_seg7_dl_07012388[] = { +const Gfx ttm_seg7_sub_dl_slide_painting_bottom[] = { gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSPEndDisplayList(), }; // 0x070123A0 - 0x070123B8 -const Gfx ttm_seg7_dl_070123A0[] = { +const Gfx ttm_seg7_sub_dl_slide_painting_top[] = { gsSP2Triangles( 4, 5, 6, 0x0, 4, 6, 7, 0x0), gsSPEndDisplayList(), }; // 0x070123B8 - 0x07012410 -const Gfx ttm_seg7_dl_070123B8[] = { +const Gfx ttm_seg7_sub_dl_slide_painting_normal_begin[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_LIGHTING | G_SHADING_SMOOTH), gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_MODULATERGB), - gsSPLight(&ttm_seg7_lights_070122F0.l, 1), - gsSPLight(&ttm_seg7_lights_070122F0.a, 2), + gsSPLight(&ttm_seg7_lights_slide_painting.l, 1), + gsSPLight(&ttm_seg7_lights_slide_painting.a, 2), 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), gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 6, G_TX_NOLOD), @@ -46,7 +46,7 @@ const Gfx ttm_seg7_dl_070123B8[] = { }; // 0x07012410 - 0x07012430 -const Gfx ttm_seg7_dl_07012410[] = { +const Gfx ttm_seg7_sub_dl_slide_painting_normal_end[] = { gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), gsDPPipeSync(), gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), @@ -54,7 +54,7 @@ const Gfx ttm_seg7_dl_07012410[] = { }; // 0x07012430 - 0x07012450 -static const Gfx ttm_seg7_painting_dl_07012430[] = { +static const Gfx ttm_seg7_painting_dl_slide_normal_ripple[] = { gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 6, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (64 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), @@ -529,23 +529,23 @@ UNUSED static const u64 ttm_unused_0 = 0x0; // 0x07012E98 - 0x07012EF8 -static const Gfx ttm_seg7_painting_dl_07012E98[] = { - gsSPDisplayList(ttm_seg7_dl_070123B8), - gsSPVertex(ttm_seg7_vertex_07012308, 8, 0), +static const Gfx ttm_seg7_painting_dl_slide_normal[] = { + gsSPDisplayList(ttm_seg7_sub_dl_slide_painting_normal_begin), + gsSPVertex(ttm_seg7_vertex_slide_painting, 8, 0), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, ttm_seg7_texture_07004000), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(ttm_seg7_dl_07012388), + gsSPDisplayList(ttm_seg7_sub_dl_slide_painting_bottom), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, ttm_seg7_texture_07003000), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 64 * 32 - 1, CALC_DXT(64, G_IM_SIZ_16b_BYTES)), - gsSPDisplayList(ttm_seg7_dl_070123A0), - gsSPDisplayList(ttm_seg7_dl_07012410), + gsSPDisplayList(ttm_seg7_sub_dl_slide_painting_top), + gsSPDisplayList(ttm_seg7_sub_dl_slide_painting_normal_end), gsSPEndDisplayList(), }; // 0x07012EF8 - 0x07012F78 -ALIGNED8 static const Texture *const ttm_seg7_painting_textures_07012EF8[] = { +ALIGNED8 static const Texture *const ttm_seg7_painting_textures_slide[] = { ttm_seg7_texture_07004000, ttm_seg7_texture_07003000, }; @@ -565,11 +565,11 @@ struct Painting ttm_slide_painting = { /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f, /* Curr Ripple Timer */ 0.0f, /* Curr Ripple x, y */ 0.0f, 0.0f, - /* Normal DList */ ttm_seg7_painting_dl_07012E98, + /* Normal DList */ ttm_seg7_painting_dl_slide_normal, /* Texture Maps */ ttm_seg7_painting_texture_maps_07012E88, - /* Textures */ ttm_seg7_painting_textures_07012EF8, + /* Textures */ ttm_seg7_painting_textures_slide, /* Texture w, h */ 64, 32, - /* Ripple DList */ ttm_seg7_painting_dl_07012430, + /* Ripple DList */ ttm_seg7_painting_dl_slide_normal_ripple, /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY, /* Alpha */ 0xFF, /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */ diff --git a/levels/ttm/header.h b/levels/ttm/header.h index 3c0605263..a05f33910 100644 --- a/levels/ttm/header.h +++ b/levels/ttm/header.h @@ -67,10 +67,10 @@ extern const Gfx ttm_seg7_dl_07011608[]; extern const Gfx ttm_seg7_dl_07011C78[]; extern const Gfx ttm_seg7_dl_07011D78[]; extern const Gfx ttm_seg7_dl_07012270[]; -extern const Gfx ttm_seg7_dl_07012388[]; -extern const Gfx ttm_seg7_dl_070123A0[]; -extern const Gfx ttm_seg7_dl_070123B8[]; -extern const Gfx ttm_seg7_dl_07012410[]; +extern const Gfx ttm_seg7_sub_dl_slide_painting_bottom[]; +extern const Gfx ttm_seg7_sub_dl_slide_painting_top[]; +extern const Gfx ttm_seg7_sub_dl_slide_painting_normal_begin[]; +extern const Gfx ttm_seg7_sub_dl_slide_painting_normal_end[]; extern struct Painting ttm_slide_painting; extern const Gfx ttm_seg7_dl_07013430[]; extern const Gfx ttm_seg7_dl_07013608[]; diff --git a/src/game/camera.c b/src/game/camera.c index c72ae9efb..b5d11b88c 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -9577,31 +9577,27 @@ void cutscene_enter_painting(struct Camera *c) { struct Surface *floor, *highFloor; Vec3f paintingPos, focus, focusOffset; Vec3s paintingAngle; - f32 floorHeight; - cutscene_event(cutscene_enter_painting_stub, c, 0, 0); // Zoom in set_fov_function(CAM_FOV_APP_20); sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; if (gRipplingPainting != NULL) { paintingAngle[0] = 0; - paintingAngle[1] = (s32)((gRipplingPainting->yaw / 360.f) * 65536.f); // convert degrees to IAU + paintingAngle[1] = (s32)((gRipplingPainting->yaw / 360.0f) * 65536.0f); // convert degrees to IAU paintingAngle[2] = 0; - focusOffset[0] = gRipplingPainting->size / 2; + focusOffset[0] = gRipplingPainting->size * 0.5f; focusOffset[1] = focusOffset[0]; focusOffset[2] = 0; - paintingPos[0] = gRipplingPainting->posX; - paintingPos[1] = gRipplingPainting->posY; - paintingPos[2] = gRipplingPainting->posZ; + vec3f_copy(paintingPos, gRipplingPainting->pos); offset_rotated(focus, paintingPos, focusOffset, paintingAngle); approach_vec3f_asymptotic(c->focus, focus, 0.1f, 0.1f, 0.1f); - focusOffset[2] = -(((gRipplingPainting->size * 1000.f) / 2) / 307.f); + focusOffset[2] = -(((gRipplingPainting->size * 1000.0f) / 2) / 307.0f); offset_rotated(focus, paintingPos, focusOffset, paintingAngle); - floorHeight = find_floor(focus[0], focus[1] + 500.f, focus[2], &highFloor) + 125.f; + f32 floorHeight = find_floor(focus[0], focus[1] + 500.0f, focus[2], &highFloor) + 125.0f; if (focus[1] < floorHeight) { focus[1] = floorHeight; @@ -9613,10 +9609,11 @@ void cutscene_enter_painting(struct Camera *c) { approach_vec3f_asymptotic(c->pos, focus, 0.9f, 0.9f, 0.9f); } - find_floor(sMarioCamState->pos[0], sMarioCamState->pos[1] + 50.f, sMarioCamState->pos[2], &floor); + find_floor(sMarioCamState->pos[0], sMarioCamState->pos[1] + 50.0f, sMarioCamState->pos[2], &floor); - if ((floor->type < SURFACE_PAINTING_WOBBLE_A6) || (floor->type > SURFACE_PAINTING_WARP_F9)) { - c->cutscene = 0; + if ((floor->type < SURFACE_PAINTING_WOBBLE_A6) + || (floor->type > SURFACE_PAINTING_WARP_F9)) { + c->cutscene = CUTSCENE_NONE; gCutsceneTimer = CUTSCENE_STOP; sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; } diff --git a/src/game/paintings.c b/src/game/paintings.c index 31d78a61f..3617a5254 100644 --- a/src/game/paintings.c +++ b/src/game/paintings.c @@ -62,35 +62,21 @@ * enough. */ -/** - * Triggers a passive ripple on the left side of the painting. - */ -#define RIPPLE_LEFT 0x20 - -/** - * Triggers a passive ripple in the middle the painting. - */ -#define RIPPLE_MIDDLE 0x10 - -/** - * Triggers a passive ripple on the right side of the painting. - */ -#define RIPPLE_RIGHT 0x8 - -/** - * Triggers an entry ripple on the left side of the painting. - */ -#define ENTER_LEFT 0x4 - -/** - * Triggers an entry ripple in the middle of the painting. - */ -#define ENTER_MIDDLE 0x2 - -/** - * Triggers an entry ripple on the right side of the painting. - */ -#define ENTER_RIGHT 0x1 +enum PaintingRippleFlags { + RIPPLE_FLAGS_NONE = (0 << 0), // 0x00 + // Triggers an entry ripple on the right side of the painting. + RIPPLE_FLAG_ENTER_RIGHT = (1 << 0), // 0x01 + // Triggers an entry ripple in the middle of the painting. + RIPPLE_FLAG_ENTER_MIDDLE = (1 << 1), // 0x02 + // Triggers an entry ripple on the left side of the painting. + RIPPLE_FLAG_ENTER_LEFT = (1 << 2), // 0x04 + // Triggers a passive ripple on the right side of the painting. + RIPPLE_FLAG_RIPPLE_RIGHT = (1 << 3), // 0x08 + // Triggers a passive ripple in the middle the painting. + RIPPLE_FLAG_RIPPLE_MIDDLE = (1 << 4), // 0x10 + // Triggers a passive ripple on the left side of the painting. + RIPPLE_FLAG_RIPPLE_LEFT = (1 << 5), // 0x20 +}; /** * Use the 1/4th part of the painting that is nearest to Mario's current floor. @@ -136,12 +122,8 @@ */ #define RESET_TIMER 100 -/// A copy of the type of floor Mario is standing on. -s16 gPaintingMarioFloorType; // A copy of Mario's position -f32 gPaintingMarioXPos; -f32 gPaintingMarioYPos; -f32 gPaintingMarioZPos; +Vec3f gPaintingMarioPos; /** * When a painting is rippling, this mesh is generated each frame using the Painting's parameters. @@ -195,10 +177,9 @@ s16 gLastPaintingUpdateCounter = 0; * Stop paintings in paintingGroup from rippling if their id is different from *idptr. */ void stop_other_paintings(s16 *idptr, struct Painting *paintingGroup[]) { - s16 index; s16 id = *idptr; + s16 index = 0; - index = 0; while (paintingGroup[index] != NULL) { struct Painting *painting = segmented_to_virtual(paintingGroup[index]); @@ -215,7 +196,7 @@ void stop_other_paintings(s16 *idptr, struct Painting *paintingGroup[]) { */ f32 painting_mario_y(struct Painting *painting) { // Add 50 to make the ripple closer to Mario's center of mass. - f32 relY = gPaintingMarioYPos - painting->posY + 50.0f; + f32 relY = (gPaintingMarioPos[1] - painting->pos[1]) + 50.0f; if (relY < 0.0f) { relY = 0.0f; @@ -229,7 +210,7 @@ f32 painting_mario_y(struct Painting *painting) { * @return Mario's z position inside the painting (bounded). */ f32 painting_mario_z(struct Painting *painting) { - f32 relZ = painting->posZ - gPaintingMarioZPos; + f32 relZ = painting->pos[2] - gPaintingMarioPos[2]; if (relZ < 0.0f) { relZ = 0.0f; @@ -252,7 +233,7 @@ f32 painting_ripple_y(struct Painting *painting, s8 ySource) { return painting_mario_z(painting); // floor paintings use X and Z break; case MIDDLE_Y: - return painting->size / 2.0; // some concentric ripples don't care about Mario + return (painting->size * 0.5f); // some concentric ripples don't care about Mario break; } return 0.0f; @@ -262,26 +243,25 @@ f32 painting_ripple_y(struct Painting *painting, s8 ySource) { * Return the quarter of the painting that is closest to the floor Mario entered. */ f32 painting_nearest_4th(struct Painting *painting) { - f32 firstQuarter = painting->size / 4.0; // 1/4 of the way across the painting - f32 secondQuarter = painting->size / 2.0; // 1/2 of the way across the painting - f32 thirdQuarter = painting->size * 3.0 / 4.0; // 3/4 of the way across the painting + f32 firstQuarter = (painting->size * 0.25f); // 1/4 of the way across the painting + f32 secondQuarter = (painting->size * 0.50f); // 1/2 of the way across the painting + f32 thirdQuarter = (painting->size * 0.75f); // 3/4 of the way across the painting - if (painting->floorEntered & RIPPLE_LEFT) { + if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_LEFT) { return firstQuarter; - } else if (painting->floorEntered & RIPPLE_MIDDLE) { + } else if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_MIDDLE) { return secondQuarter; - } else if (painting->floorEntered & RIPPLE_RIGHT) { + } else if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_RIGHT) { return thirdQuarter; // Same as ripple floors. - } else if (painting->floorEntered & ENTER_LEFT) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_LEFT) { return firstQuarter; - } else if (painting->floorEntered & ENTER_MIDDLE) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_MIDDLE) { return secondQuarter; - } else if (painting->floorEntered & ENTER_RIGHT) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_RIGHT) { return thirdQuarter; } - return 0.0f; } @@ -289,7 +269,7 @@ f32 painting_nearest_4th(struct Painting *painting) { * @return Mario's x position inside the painting (bounded). */ f32 painting_mario_x(struct Painting *painting) { - f32 relX = gPaintingMarioXPos - painting->posX; + f32 relX = gPaintingMarioPos[0] - painting->pos[0]; if (relX < 0.0f) { relX = 0.0f; @@ -311,7 +291,7 @@ f32 painting_ripple_x(struct Painting *painting, s8 xSource) { return painting_mario_x(painting); break; case MIDDLE_X: // concentric rippling may not care about Mario - return painting->size / 2.0f; + return painting->size * 0.5f; break; } @@ -350,7 +330,7 @@ void painting_state(s8 state, struct Painting *painting, struct Painting *painti painting->state = state; painting->rippleX = painting_ripple_x(painting, xSource); painting->rippleY = painting_ripple_y(painting, ySource); - gPaintingMarioYEntry = gPaintingMarioYPos; + gPaintingMarioYEntry = gPaintingMarioPos[1]; // Because true or false would be too simple... if (resetTimer == RESET_TIMER) { @@ -364,19 +344,19 @@ void painting_state(s8 state, struct Painting *painting, struct Painting *painti */ void wall_painting_proximity_idle(struct Painting *painting, struct Painting *paintingGroup[]) { // Check for Mario triggering a ripple - if (painting->floorEntered & RIPPLE_LEFT) { + if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_LEFT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); - } else if (painting->floorEntered & RIPPLE_MIDDLE) { + } else if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_MIDDLE) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); - } else if (painting->floorEntered & RIPPLE_RIGHT) { + } else if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_RIGHT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); // Check for Mario entering - } else if (painting->floorEntered & ENTER_LEFT) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); - } else if (painting->floorEntered & ENTER_MIDDLE) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_MIDDLE) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); - } else if (painting->floorEntered & ENTER_RIGHT) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_RIGHT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); } } @@ -385,11 +365,11 @@ void wall_painting_proximity_idle(struct Painting *painting, struct Painting *pa * Rippling update function for wall paintings that use RIPPLE_TRIGGER_PROXIMITY. */ void wall_painting_proximity_rippling(struct Painting *painting, struct Painting *paintingGroup[]) { - if (painting->floorEntered & ENTER_LEFT) { + if (painting->floorEntered & RIPPLE_FLAG_ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); - } else if (painting->floorEntered & ENTER_MIDDLE) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_MIDDLE) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); - } else if (painting->floorEntered & ENTER_RIGHT) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_RIGHT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); } } @@ -399,19 +379,19 @@ void wall_painting_proximity_rippling(struct Painting *painting, struct Painting */ void wall_painting_continuous_idle(struct Painting *painting, struct Painting *paintingGroup[]) { // Check for Mario triggering a ripple - if (painting->floorEntered & RIPPLE_LEFT) { + if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_LEFT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER); - } else if (painting->floorEntered & RIPPLE_MIDDLE) { + } else if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_MIDDLE) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER); - } else if (painting->floorEntered & RIPPLE_RIGHT) { + } else if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_RIGHT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER); // Check for Mario entering - } else if (painting->floorEntered & ENTER_LEFT) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); - } else if (painting->floorEntered & ENTER_MIDDLE) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_MIDDLE) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); - } else if (painting->floorEntered & ENTER_RIGHT) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_RIGHT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); } } @@ -420,11 +400,11 @@ void wall_painting_continuous_idle(struct Painting *painting, struct Painting *p * Rippling update function for wall paintings that use RIPPLE_TRIGGER_CONTINUOUS. */ void wall_painting_continuous_rippling(struct Painting *painting, struct Painting *paintingGroup[]) { - if (painting->floorEntered & ENTER_LEFT) { + if (painting->floorEntered & RIPPLE_FLAG_ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, DONT_RESET); - } else if (painting->floorEntered & ENTER_MIDDLE) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_MIDDLE) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, DONT_RESET); - } else if (painting->floorEntered & ENTER_RIGHT) { + } else if (painting->floorEntered & RIPPLE_FLAG_ENTER_RIGHT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, DONT_RESET); } } @@ -436,20 +416,20 @@ void wall_painting_continuous_rippling(struct Painting *painting, struct Paintin */ void floor_painting_proximity_idle(struct Painting *painting, struct Painting *paintingGroup[]) { // Check for Mario triggering a ripple - if (painting->floorEntered & RIPPLE_LEFT) { + if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_LEFT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); - } else if (painting->floorEntered & RIPPLE_MIDDLE) { + } else if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_MIDDLE) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); - } else if (painting->floorEntered & RIPPLE_RIGHT) { + } else if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_RIGHT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); // Only check for Mario entering if he jumped below the surface } else if (painting->marioWentUnder) { - if (painting->currFloor & ENTER_LEFT) { + if (painting->currFloor & RIPPLE_FLAG_ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); - } else if (painting->currFloor & ENTER_MIDDLE) { + } else if (painting->currFloor & RIPPLE_FLAG_ENTER_MIDDLE) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); - } else if (painting->currFloor & ENTER_RIGHT) { + } else if (painting->currFloor & RIPPLE_FLAG_ENTER_RIGHT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); } } @@ -462,11 +442,11 @@ void floor_painting_proximity_idle(struct Painting *painting, struct Painting *p */ void floor_painting_proximity_rippling(struct Painting *painting, struct Painting *paintingGroup[]) { if (painting->marioWentUnder) { - if (painting->currFloor & ENTER_LEFT) { + if (painting->currFloor & RIPPLE_FLAG_ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); - } else if (painting->currFloor & ENTER_MIDDLE) { + } else if (painting->currFloor & RIPPLE_FLAG_ENTER_MIDDLE) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); - } else if (painting->currFloor & ENTER_RIGHT) { + } else if (painting->currFloor & RIPPLE_FLAG_ENTER_RIGHT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); } } @@ -476,24 +456,24 @@ void floor_painting_proximity_rippling(struct Painting *painting, struct Paintin * Idle update function for floor paintings that use RIPPLE_TRIGGER_CONTINUOUS. * * Both floor paintings (HMC and CotMC) are hidden behind a door, which hides the ripple's start up. - * The floor just inside the doorway is RIPPLE_LEFT, so the painting starts rippling as soon as Mario + * The floor just inside the doorway is RIPPLE_FLAG_RIPPLE_LEFT, so the painting starts rippling as soon as Mario * enters the room. */ void floor_painting_continuous_idle(struct Painting *painting, struct Painting *paintingGroup[]) { // Check for Mario triggering a ripple - if (painting->floorEntered & RIPPLE_LEFT) { + if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_LEFT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER); - } else if (painting->floorEntered & RIPPLE_MIDDLE) { + } else if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_MIDDLE) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER); - } else if (painting->floorEntered & RIPPLE_RIGHT) { + } else if (painting->floorEntered & RIPPLE_FLAG_RIPPLE_RIGHT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER); // Check for Mario entering - } else if (painting->currFloor & ENTER_LEFT) { + } else if (painting->currFloor & RIPPLE_FLAG_ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); - } else if (painting->currFloor & ENTER_MIDDLE) { + } else if (painting->currFloor & RIPPLE_FLAG_ENTER_MIDDLE) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); - } else if (painting->currFloor & ENTER_RIGHT) { + } else if (painting->currFloor & RIPPLE_FLAG_ENTER_RIGHT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); } } @@ -503,11 +483,11 @@ void floor_painting_continuous_idle(struct Painting *painting, struct Painting * */ void floor_painting_continuous_rippling(struct Painting *painting, struct Painting *paintingGroup[]) { if (painting->marioWentUnder) { - if (painting->currFloor & ENTER_LEFT) { + if (painting->currFloor & RIPPLE_FLAG_ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, DONT_RESET); - } else if (painting->currFloor & ENTER_MIDDLE) { + } else if (painting->currFloor & RIPPLE_FLAG_ENTER_MIDDLE) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, DONT_RESET); - } else if (painting->currFloor & ENTER_RIGHT) { + } else if (painting->currFloor & RIPPLE_FLAG_ENTER_RIGHT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, DONT_RESET); } } @@ -517,13 +497,11 @@ void floor_painting_continuous_rippling(struct Painting *painting, struct Painti * Check for Mario entering one of the special floors associated with the painting. */ void painting_update_floors(struct Painting *painting) { - s16 paintingId = painting->id; - s8 rippleLeft = 0; - s8 rippleMiddle = 0; - s8 rippleRight = 0; - s8 enterLeft = 0; - s8 enterMiddle = 0; - s8 enterRight = 0; + s32 paintingId3 = (painting->id * 3); + s8 rippleFlags = RIPPLE_FLAGS_NONE; + s16 marioFloorType = SURFACE_DEFAULT; + + if (gMarioState->floor != NULL) marioFloorType = gMarioState->floor->type; /* The area in front of every painting in the game (except HMC and CotMC, which *\ |* act a little differently) is made up of 3 special floor triangles with special *| @@ -531,43 +509,27 @@ void painting_update_floors(struct Painting *painting) { \* and sets a bitfield accordingly. */ // check if Mario's current floor is one of the special floors - if (gPaintingMarioFloorType == paintingId * 3 + SURFACE_PAINTING_WOBBLE_A6) { - rippleLeft = RIPPLE_LEFT; - } - if (gPaintingMarioFloorType == paintingId * 3 + SURFACE_PAINTING_WOBBLE_A7) { - rippleMiddle = RIPPLE_MIDDLE; - } - if (gPaintingMarioFloorType == paintingId * 3 + SURFACE_PAINTING_WOBBLE_A8) { - rippleRight = RIPPLE_RIGHT; - } - if (gPaintingMarioFloorType == paintingId * 3 + SURFACE_PAINTING_WARP_D3) { - enterLeft = ENTER_LEFT; - } - if (gPaintingMarioFloorType == paintingId * 3 + SURFACE_PAINTING_WARP_D4) { - enterMiddle = ENTER_MIDDLE; - } - if (gPaintingMarioFloorType == paintingId * 3 + SURFACE_PAINTING_WARP_D5) { - enterRight = ENTER_RIGHT; - } + if (marioFloorType == (paintingId3 + SURFACE_PAINTING_WOBBLE_A6)) rippleFlags |= RIPPLE_FLAG_RIPPLE_LEFT; + if (marioFloorType == (paintingId3 + SURFACE_PAINTING_WOBBLE_A7)) rippleFlags |= RIPPLE_FLAG_RIPPLE_MIDDLE; + if (marioFloorType == (paintingId3 + SURFACE_PAINTING_WOBBLE_A8)) rippleFlags |= RIPPLE_FLAG_RIPPLE_RIGHT; + if (marioFloorType == (paintingId3 + SURFACE_PAINTING_WARP_D3 )) rippleFlags |= RIPPLE_FLAG_ENTER_LEFT; + if (marioFloorType == (paintingId3 + SURFACE_PAINTING_WARP_D4 )) rippleFlags |= RIPPLE_FLAG_ENTER_MIDDLE; + if (marioFloorType == (paintingId3 + SURFACE_PAINTING_WARP_D5 )) rippleFlags |= RIPPLE_FLAG_ENTER_RIGHT; painting->lastFloor = painting->currFloor; // at most 1 of these will be nonzero; - painting->currFloor = rippleLeft + rippleMiddle + rippleRight + enterLeft + enterMiddle + enterRight; + painting->currFloor = rippleFlags; // floorEntered is true iff currFloor is true and lastFloor is false // (Mario just entered the floor on this frame) - painting->floorEntered = (painting->lastFloor ^ painting->currFloor) & painting->currFloor; + painting->floorEntered = ((painting->lastFloor ^ painting->currFloor) & painting->currFloor); painting->marioWasUnder = painting->marioIsUnder; // Check if Mario has fallen below the painting (used for floor paintings) - if (gPaintingMarioYPos < painting->posY) { - painting->marioIsUnder = TRUE; - } else { - painting->marioIsUnder = FALSE; - } + painting->marioIsUnder = (gPaintingMarioPos[1] < painting->pos[1]); // Mario "went under" if he was not under last frame, but is under now - painting->marioWentUnder = (painting->marioWasUnder ^ painting->marioIsUnder) & painting->marioIsUnder; + painting->marioWentUnder = ((painting->marioWasUnder ^ painting->marioIsUnder) & painting->marioIsUnder); } /** @@ -596,12 +558,11 @@ void painting_update_ripple_state(struct Painting *painting) { // if the painting is doing the entry ripple but the ripples are as small as those from the // passive ripple, make it do a passive ripple // If Mario goes below the surface but doesn't warp, the painting will eventually reset. - if (painting->state == PAINTING_ENTERED && painting->currRippleMag <= painting->passiveRippleMag) { - + if ((painting->state == PAINTING_ENTERED) && (painting->currRippleMag <= painting->passiveRippleMag)) { painting->state = PAINTING_RIPPLE; - painting->currRippleMag = painting->passiveRippleMag; - painting->rippleDecay = painting->passiveRippleDecay; - painting->currRippleRate = painting->passiveRippleRate; + painting->currRippleMag = painting->passiveRippleMag; + painting->rippleDecay = painting->passiveRippleDecay; + painting->currRippleRate = painting->passiveRippleRate; painting->dispersionFactor = painting->passiveDispersionFactor; } } @@ -611,7 +572,7 @@ void painting_update_ripple_state(struct Painting *painting) { * @return the ripple function at posX, posY * note that posX and posY correspond to a point on the face of the painting, not actual axes */ -s16 calculate_ripple_at_point(struct Painting *painting, f32 posX, f32 posY) { +s32 calculate_ripple_at_point(struct Painting *painting, f32 posX, f32 posY) { /// Controls the peaks of the ripple. f32 rippleMag = painting->currRippleMag; /// Controls the ripple's frequency @@ -624,24 +585,23 @@ s16 calculate_ripple_at_point(struct Painting *painting, f32 posX, f32 posY) { f32 rippleX = painting->rippleX; f32 rippleY = painting->rippleY; - f32 distanceToOrigin; - f32 rippleDistance; + f32 size = (painting->size / PAINTING_SIZE); - posX *= painting->size / PAINTING_SIZE; - posY *= painting->size / PAINTING_SIZE; - distanceToOrigin = sqrtf((posX - rippleX) * (posX - rippleX) + (posY - rippleY) * (posY - rippleY)); + posX *= size; + posY *= size; + f32 dx = (posX - rippleX); + f32 dy = (posY - rippleY); + f32 distanceToOrigin = sqrtf(sqr(dx) + sqr(dy)); // A larger dispersionFactor makes the ripple spread slower - rippleDistance = distanceToOrigin / dispersionFactor; + f32 rippleDistance = distanceToOrigin / dispersionFactor; if (rippleTimer < rippleDistance) { // if the ripple hasn't reached the point yet, make the point magnitude 0 return 0; } else { // use a cosine wave to make the ripple go up and down, // scaled by the painting's ripple magnitude - f32 rippleZ = rippleMag * cosf(rippleRate * (2 * M_PI) * (rippleTimer - rippleDistance)); - // round it to an int and return it - return round_float(rippleZ); + return roundf(rippleMag * coss((s16)((rippleRate * (rippleTimer - rippleDistance)) * 0x10000))); } } @@ -649,13 +609,11 @@ s16 calculate_ripple_at_point(struct Painting *painting, f32 posX, f32 posY) { * If movable, return the ripple function at (posX, posY) * else return 0 */ -s16 ripple_if_movable(struct Painting *painting, s16 movable, s16 posX, s16 posY) { - s16 rippleZ = 0; - +s32 ripple_if_movable(struct Painting *painting, s16 movable, s16 posX, s16 posY) { if (movable) { - rippleZ = calculate_ripple_at_point(painting, posX, posY); + return calculate_ripple_at_point(painting, posX, posY); } - return rippleZ; + return 0; } /** @@ -684,12 +642,12 @@ void painting_generate_mesh(struct Painting *painting, s16 *mesh, s16 numTris) { // accesses are off by 1 since the first entry is the number of vertices for (i = 0; i < numTris; i++) { - gPaintingMesh[i].pos[0] = mesh[i * 3 + 1]; - gPaintingMesh[i].pos[1] = mesh[i * 3 + 2]; + gPaintingMesh[i].pos[0] = mesh[(i * 3) + 1]; + gPaintingMesh[i].pos[1] = mesh[(i * 3) + 2]; // The "z coordinate" of each vertex in the mesh is either 1 or 0. Instead of being an // actual coordinate, it just determines whether the vertex moves - gPaintingMesh[i].pos[2] = ripple_if_movable(painting, mesh[i * 3 + 3], - gPaintingMesh[i].pos[0], gPaintingMesh[i].pos[1]); + gPaintingMesh[i].pos[2] = ripple_if_movable(painting, mesh[(i * 3) + 3], gPaintingMesh[i].pos[0], + gPaintingMesh[i].pos[1]); } } @@ -710,31 +668,17 @@ void painting_generate_mesh(struct Painting *painting, s16 *mesh, s16 numTris) { */ void painting_calculate_triangle_normals(PaintingData *mesh, PaintingData numVtx, PaintingData numTris) { s16 i; - - gPaintingTriNorms = mem_pool_alloc(gEffectsMemoryPool, numTris * sizeof(Vec3f)); - + Vec3s v; + Vec3f vp0, vp1, vp2; + gPaintingTriNorms = mem_pool_alloc(gEffectsMemoryPool, (numTris * sizeof(Vec3f))); for (i = 0; i < numTris; i++) { - s16 tri = numVtx * 3 + i * 3 + 2; // Add 2 because of the 2 length entries preceding the list - s16 v0 = mesh[tri]; - s16 v1 = mesh[tri + 1]; - s16 v2 = mesh[tri + 2]; - - f32 x0 = gPaintingMesh[v0].pos[0]; - f32 y0 = gPaintingMesh[v0].pos[1]; - f32 z0 = gPaintingMesh[v0].pos[2]; - - f32 x1 = gPaintingMesh[v1].pos[0]; - f32 y1 = gPaintingMesh[v1].pos[1]; - f32 z1 = gPaintingMesh[v1].pos[2]; - - f32 x2 = gPaintingMesh[v2].pos[0]; - f32 y2 = gPaintingMesh[v2].pos[1]; - f32 z2 = gPaintingMesh[v2].pos[2]; - + PaintingData tri = ((numVtx * 3) + (i * 3) + 2); // Add 2 because of the 2 length entries preceding the list + vec3s_copy(v, &mesh[tri]); + vec3s_to_vec3f(vp0, gPaintingMesh[v[0]].pos); + vec3s_to_vec3f(vp1, gPaintingMesh[v[1]].pos); + vec3s_to_vec3f(vp2, gPaintingMesh[v[2]].pos); // Cross product to find each triangle's normal vector - gPaintingTriNorms[i][0] = (y1 - y0) * (z2 - z1) - (z1 - z0) * (y2 - y1); - gPaintingTriNorms[i][1] = (z1 - z0) * (x2 - x1) - (x1 - x0) * (z2 - z1); - gPaintingTriNorms[i][2] = (x1 - x0) * (y2 - y1) - (y1 - y0) * (x2 - x1); + find_vector_perpendicular_to_plane(gPaintingTriNorms[i], vp0, vp1, vp2); } } @@ -742,15 +686,14 @@ void painting_calculate_triangle_normals(PaintingData *mesh, PaintingData numVtx * Rounds a floating-point component of a normal vector to an s8 by multiplying it by 127 or 128 and * rounding away from 0. */ -s8 normalize_component(f32 comp) { +s32 normalize_component(f32 comp) { s8 rounded; - - if (comp > 0.0) { - rounded = comp * 127.0 + 0.5; // round up - } else if (comp < 0.0) { - rounded = comp * 128.0 - 0.5; // round down + if (comp > 0.0f) { + rounded = comp * 127.0f + 0.5f; // round up + } else if (comp < 0.0f) { + rounded = comp * 128.0f - 0.5f; // round down } else { - rounded = 0; // don't round 0 + rounded = 0; // don't round 0 } return rounded; } @@ -771,43 +714,34 @@ s8 normalize_component(f32 comp) { * The table used in game, seg2_painting_mesh_neighbor_tris, is in bin/segment2.c. */ void painting_average_vertex_normals(PaintingData *neighborTris, PaintingData numVtx) { - s16 tri; - s16 i; - s16 j; - s16 neighbors; - s16 entry = 0; + PaintingData tri; + PaintingData i, j; + PaintingData neighbors; + PaintingData entry = 0; for (i = 0; i < numVtx; i++) { - f32 nx = 0.0f; - f32 ny = 0.0f; - f32 nz = 0.0f; - f32 nlen; + Vec3f n = { 0.0f, 0.0f, 0.0f }; // The first number of each entry is the number of adjacent tris neighbors = neighborTris[entry]; for (j = 0; j < neighbors; j++) { tri = neighborTris[entry + j + 1]; - nx += gPaintingTriNorms[tri][0]; - ny += gPaintingTriNorms[tri][1]; - nz += gPaintingTriNorms[tri][2]; + vec3f_add(n, gPaintingTriNorms[tri]); } // Move to the next vertex's entry entry += neighbors + 1; // average the surface normals from each neighboring tri - nx /= neighbors; - ny /= neighbors; - nz /= neighbors; - nlen = sqrtf(nx * nx + ny * ny + nz * nz); + vec3_div_val(n, neighbors); + f32 nlen = vec3_sumsq(n); if (nlen == 0.0f) { - gPaintingMesh[i].norm[0] = 0; - gPaintingMesh[i].norm[1] = 0; - gPaintingMesh[i].norm[2] = 0; + vec3_zero(gPaintingMesh[i].norm); } else { - gPaintingMesh[i].norm[0] = normalize_component(nx / nlen); - gPaintingMesh[i].norm[1] = normalize_component(ny / nlen); - gPaintingMesh[i].norm[2] = normalize_component(nz / nlen); + nlen = sqrtf(nlen); + gPaintingMesh[i].norm[0] = normalize_component(n[0] / nlen); + gPaintingMesh[i].norm[1] = normalize_component(n[1] / nlen); + gPaintingMesh[i].norm[2] = normalize_component(n[2] / nlen); } } } @@ -819,22 +753,21 @@ void painting_average_vertex_normals(PaintingData *neighborTris, PaintingData nu * If the textureMap doesn't describe the whole mesh, then multiple calls are needed to draw the whole * painting. */ -Gfx *render_painting(u8 *img, s16 tWidth, s16 tHeight, s16 *textureMap, s16 mapVerts, s16 mapTris, u8 alpha) { - s16 group; - s16 map; - s16 triGroup; - s16 mapping; - s16 meshVtx; - s16 tx; - s16 ty; +Gfx *render_painting(Texture *img, PaintingData tWidth, PaintingData tHeight, PaintingData *textureMap, PaintingData mapVerts, PaintingData mapTris, Alpha alpha) { + PaintingData group, groupM; + PaintingData map; + PaintingData triGroup; + PaintingData meshVtx; + PaintingData tx, ty; + s32 mapping3; // We can fit 15 (16 / 3) vertices in the RSP's vertex buffer. // Group triangles by 5, with one remainder group. - s16 triGroups = mapTris / 5; - s16 remGroupTris = mapTris % 5; - s16 numVtx = mapTris * 3; + PaintingData triGroups = mapTris / 5; + PaintingData remGroupTris = mapTris % 5; + PaintingData numVtx = mapTris * 3; - s16 commands = triGroups * 2 + remGroupTris + 7; + PaintingData commands = triGroups * 2 + remGroupTris + 7; Vtx *verts = alloc_display_list(numVtx * sizeof(Vtx)); Gfx *dlist = alloc_display_list(commands * sizeof(Gfx)); Gfx *gfx = dlist; @@ -843,50 +776,67 @@ Gfx *render_painting(u8 *img, s16 tWidth, s16 tHeight, s16 *textureMap, s16 mapV // Draw the groups of 5 first for (group = 0; group < triGroups; group++) { + groupM = (group * 15); // The triangle groups are the second part of the texture map. // Each group is a list of 15 mappings - triGroup = mapVerts * 3 + group * 15 + 2; + triGroup = (mapVerts * 3) + groupM + 2; for (map = 0; map < 15; map++) { + // The mapping is just an index into the earlier part of the textureMap // Some mappings are repeated, for example, when multiple triangles share a vertex - mapping = textureMap[triGroup + map]; + mapping3 = textureMap[triGroup + map] * 3; // The first entry is the ID of the vertex in the mesh - meshVtx = textureMap[mapping * 3 + 1]; + meshVtx = textureMap[mapping3 + 1]; // The next two are the texture coordinates for that vertex - tx = textureMap[mapping * 3 + 2]; - ty = textureMap[mapping * 3 + 3]; + tx = textureMap[mapping3 + 2]; + ty = textureMap[mapping3 + 3]; // Map the texture and place it in the verts array - make_vertex(verts, group * 15 + map, gPaintingMesh[meshVtx].pos[0], gPaintingMesh[meshVtx].pos[1], - gPaintingMesh[meshVtx].pos[2], tx, ty, gPaintingMesh[meshVtx].norm[0], - gPaintingMesh[meshVtx].norm[1], gPaintingMesh[meshVtx].norm[2], alpha); + make_vertex(verts, (groupM + map), gPaintingMesh[meshVtx].pos[0], + gPaintingMesh[meshVtx].pos[1], + gPaintingMesh[meshVtx].pos[2], + tx, ty, + gPaintingMesh[meshVtx].norm[0], + gPaintingMesh[meshVtx].norm[1], + gPaintingMesh[meshVtx].norm[2], + alpha); } // Load the vertices and draw the 5 triangles - gSPVertex(gfx++, VIRTUAL_TO_PHYSICAL(verts + group * 15), 15, 0); + gSPVertex(gfx++, VIRTUAL_TO_PHYSICAL(verts + groupM), 15, 0); gSPDisplayList(gfx++, dl_paintings_draw_ripples); } + groupM = (triGroups * 15); + // One group left with < 5 triangles - triGroup = mapVerts * 3 + triGroups * 15 + 2; + triGroup = (mapVerts * 3) + groupM + 2; // Map the texture to the triangles for (map = 0; map < remGroupTris * 3; map++) { - mapping = textureMap[triGroup + map]; - meshVtx = textureMap[mapping * 3 + 1]; - tx = textureMap[mapping * 3 + 2]; - ty = textureMap[mapping * 3 + 3]; - make_vertex(verts, triGroups * 15 + map, gPaintingMesh[meshVtx].pos[0], gPaintingMesh[meshVtx].pos[1], - gPaintingMesh[meshVtx].pos[2], tx, ty, gPaintingMesh[meshVtx].norm[0], - gPaintingMesh[meshVtx].norm[1], gPaintingMesh[meshVtx].norm[2], alpha); + mapping3 = textureMap[triGroup + map] * 3; + meshVtx = textureMap[mapping3 + 1]; + tx = textureMap[mapping3 + 2]; + ty = textureMap[mapping3 + 3]; + make_vertex(verts, (groupM + map), gPaintingMesh[meshVtx].pos[0], + gPaintingMesh[meshVtx].pos[1], + gPaintingMesh[meshVtx].pos[2], + tx, ty, + gPaintingMesh[meshVtx].norm[0], + gPaintingMesh[meshVtx].norm[1], + gPaintingMesh[meshVtx].norm[2], + alpha); } // Draw the triangles individually gSPVertex(gfx++, VIRTUAL_TO_PHYSICAL(verts + triGroups * 15), remGroupTris * 3, 0); for (group = 0; group < remGroupTris; group++) { - gSP1Triangle(gfx++, group * 3, group * 3 + 1, group * 3 + 2, 0); + groupM = (group * 3); + gSP1Triangle(gfx++, groupM + 0, + groupM + 1, + groupM + 2, 0); } gSPEndDisplayList(gfx); @@ -905,15 +855,15 @@ Gfx *painting_model_view_transform(struct Painting *painting) { Gfx *dlist = alloc_display_list(5 * sizeof(Gfx)); Gfx *gfx = dlist; - guTranslate(translate, painting->posX, painting->posY, painting->posZ); + guTranslate(translate, painting->pos[0], painting->pos[1], painting->pos[2]); guRotate(rotX, painting->pitch, 1.0f, 0.0f, 0.0f); guRotate(rotY, painting->yaw, 0.0f, 1.0f, 0.0f); guScale(scale, sizeRatio, sizeRatio, sizeRatio); - gSPMatrix(gfx++, translate, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH); - gSPMatrix(gfx++, rotX, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH); - gSPMatrix(gfx++, rotY, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH); - gSPMatrix(gfx++, scale, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH); + gSPMatrix(gfx++, translate, (G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH )); + gSPMatrix(gfx++, rotX, (G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH)); + gSPMatrix(gfx++, rotY, (G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH)); + gSPMatrix(gfx++, scale, (G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH)); gSPEndDisplayList(gfx); return dlist; @@ -947,7 +897,7 @@ Gfx *painting_ripple_image(struct Painting *painting) { for (i = 0; i < imageCount; i++) { textureMap = segmented_to_virtual(textureMaps[i]); meshVerts = textureMap[0]; - meshTris = textureMap[meshVerts * 3 + 1]; + meshTris = textureMap[(meshVerts * 3) + 1]; gSPDisplayList(gfx++, render_painting(textures[i], tWidth, tHeight, textureMap, meshVerts, meshTris, painting->alpha)); } @@ -964,13 +914,10 @@ Gfx *painting_ripple_image(struct Painting *painting) { * Ripple a painting that has 1 "environment map" texture. */ Gfx *painting_ripple_env_mapped(struct Painting *painting) { - s16 meshVerts; - s16 meshTris; - s16 *textureMap; - s16 tWidth = painting->textureWidth; - s16 tHeight = painting->textureHeight; - s16 **textureMaps = segmented_to_virtual(painting->textureMaps); - u8 **tArray = segmented_to_virtual(painting->textureArray); + PaintingData tWidth = painting->textureWidth; + PaintingData tHeight = painting->textureHeight; + PaintingData **textureMaps = segmented_to_virtual(painting->textureMaps); + Texture **tArray = segmented_to_virtual(painting->textureArray); Gfx *dlist = alloc_display_list(7 * sizeof(Gfx)); Gfx *gfx = dlist; @@ -983,9 +930,9 @@ Gfx *painting_ripple_env_mapped(struct Painting *painting) { gSPDisplayList(gfx++, painting->rippleDisplayList); // Map the image to the mesh's vertices - textureMap = segmented_to_virtual(textureMaps[0]); - meshVerts = textureMap[0]; - meshTris = textureMap[meshVerts * 3 + 1]; + PaintingData *textureMap = segmented_to_virtual(textureMaps[0]); + PaintingData meshVerts = textureMap[0]; + PaintingData meshTris = textureMap[(meshVerts * 3) + 1]; gSPDisplayList(gfx++, render_painting(tArray[0], tWidth, tHeight, textureMap, meshVerts, meshTris, painting->alpha)); // Update the ripple, may automatically reset the painting's state. @@ -1002,10 +949,10 @@ Gfx *painting_ripple_env_mapped(struct Painting *painting) { * The mesh and vertex normals are regenerated and freed every frame. */ Gfx *display_painting_rippling(struct Painting *painting) { - s16 *mesh = segmented_to_virtual(seg2_painting_triangle_mesh); - s16 *neighborTris = segmented_to_virtual(seg2_painting_mesh_neighbor_tris); - s16 numVtx = mesh[0]; - s16 numTris = mesh[numVtx * 3 + 1]; + PaintingData *mesh = segmented_to_virtual(seg2_painting_triangle_mesh); + PaintingData *neighborTris = segmented_to_virtual(seg2_painting_mesh_neighbor_tris); + PaintingData numVtx = mesh[0]; + PaintingData numTris = mesh[(numVtx * 3) + 1]; Gfx *dlist = NULL; // Generate the mesh and its lighting data @@ -1050,12 +997,12 @@ Gfx *display_painting_not_rippling(struct Painting *painting) { * Clear Mario-related state and clear gRipplingPainting. */ void reset_painting(struct Painting *painting) { - painting->lastFloor = 0; - painting->currFloor = 0; - painting->floorEntered = 0; - painting->marioWasUnder = 0; - painting->marioIsUnder = 0; - painting->marioWentUnder = 0; + painting->lastFloor = RIPPLE_FLAGS_NONE; + painting->currFloor = RIPPLE_FLAGS_NONE; + painting->floorEntered = RIPPLE_FLAGS_NONE; + painting->marioWasUnder = FALSE; + painting->marioIsUnder = FALSE; + painting->marioWentUnder = FALSE; gRipplingPainting = NULL; @@ -1074,7 +1021,7 @@ void reset_painting(struct Painting *painting) { if (painting == &ddd_painting) { // Move DDD painting to initial position, in case the animation // that moves the painting stops during level unload. - painting->posX = 3456.0f; + painting->pos[0] = 3456.0f; } #endif } @@ -1096,37 +1043,33 @@ void reset_painting(struct Painting *painting) { */ #ifdef UNLOCK_ALL void move_ddd_painting(struct Painting *painting, UNUSED f32 frontPos, f32 backPos, UNUSED f32 speed) { - painting->posX = backPos; + painting->pos[0] = backPos; gDddPaintingStatus = (DDD_FLAG_BOWSERS_SUB_BEATEN | DDD_FLAG_BACK); } #else void move_ddd_painting(struct Painting *painting, f32 frontPos, f32 backPos, f32 speed) { - // Obtain the DDD star flags - u32 dddFlags = save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(COURSE_DDD)); - // Get the other save file flags - u32 saveFileFlags = save_file_get_flags(); // Find out whether Board Bowser's Sub was collected - u32 bowsersSubBeaten = dddFlags & BOARD_BOWSERS_SUB; - // Check whether DDD has already moved back - u32 dddBack = saveFileFlags & SAVE_FLAG_DDD_MOVED_BACK; + u32 bowsersSubBeaten = (save_file_get_star_flags((gCurrSaveFileNum - 1), COURSE_NUM_TO_INDEX(COURSE_DDD)) & BOARD_BOWSERS_SUB); + // Get the other save file flags and check whether DDD has already moved back + u32 dddBack = (save_file_get_flags() & SAVE_FLAG_DDD_MOVED_BACK); if (!bowsersSubBeaten && !dddBack) { // If we haven't collected the star or moved the painting, put the painting at the front - painting->posX = frontPos; + painting->pos[0] = frontPos; gDddPaintingStatus = DDD_FLAGS_NONE; } else if (bowsersSubBeaten && !dddBack) { // If we've collected the star but not moved the painting back, // Each frame, move the painting by a certain speed towards the back area. - painting->posX += speed; + painting->pos[0] += speed; gDddPaintingStatus = DDD_FLAG_BOWSERS_SUB_BEATEN; - if (painting->posX >= backPos) { - painting->posX = backPos; + if (painting->pos[0] >= backPos) { + painting->pos[0] = backPos; // Tell the save file that we've moved DDD back. save_file_set_flags(SAVE_FLAG_DDD_MOVED_BACK); } } else if (bowsersSubBeaten && dddBack) { // If the painting has already moved back, place it in the back position. - painting->posX = backPos; + painting->pos[0] = backPos; gDddPaintingStatus = (DDD_FLAG_BOWSERS_SUB_BEATEN | DDD_FLAG_BACK); } } @@ -1217,8 +1160,8 @@ void floor_painting_update(struct Painting *painting, struct Painting *paintingG */ Gfx *geo_painting_draw(s32 callContext, struct GraphNode *node, UNUSED void *context) { struct GraphNodeGenerated *gen = (struct GraphNodeGenerated *) node; - s32 group = (gen->parameter >> 8) & 0xFF; - s32 id = gen->parameter & 0xFF; + s32 group = ((gen->parameter >> 8) & 0xFF); + s32 id = (gen->parameter & 0xFF); Gfx *paintingDlist = NULL; struct Painting **paintingGroup = sPaintingGroups[group]; struct Painting *painting = segmented_to_virtual(paintingGroup[id]); @@ -1254,8 +1197,6 @@ Gfx *geo_painting_draw(s32 callContext, struct GraphNode *node, UNUSED void *con * Update the painting system's local copy of Mario's current floor and position. */ Gfx *geo_painting_update(s32 callContext, UNUSED struct GraphNode *node, UNUSED Mat4 mtx) { - struct Surface *surface; - // Reset the update counter if (callContext != GEO_CONTEXT_RENDER) { gLastPaintingUpdateCounter = gAreaUpdateCounter - 1; @@ -1265,11 +1206,7 @@ Gfx *geo_painting_update(s32 callContext, UNUSED struct GraphNode *node, UNUSED gPaintingUpdateCounter = gAreaUpdateCounter; // Store Mario's position - find_floor(gMarioObject->oPosX, gMarioObject->oPosY, gMarioObject->oPosZ, &surface); - gPaintingMarioFloorType = surface->type; - gPaintingMarioXPos = gMarioObject->oPosX; - gPaintingMarioYPos = gMarioObject->oPosY; - gPaintingMarioZPos = gMarioObject->oPosZ; + vec3f_copy(gPaintingMarioPos, &gMarioObject->oPosVec); } return NULL; } diff --git a/src/game/paintings.h b/src/game/paintings.h index eaae28d89..b508bbc1e 100644 --- a/src/game/paintings.h +++ b/src/game/paintings.h @@ -63,9 +63,7 @@ struct Painting { f32 yaw; /// The painting's position - f32 posX; - f32 posY; - f32 posZ; + Vec3f pos; /// Controls how high the peaks of the ripple are. f32 currRippleMag; @@ -114,11 +112,11 @@ struct Painting { Alpha alpha; /// True if Mario was under the painting's y coordinate last frame - s8 marioWasUnder; + u8 marioWasUnder : 1; /// True if Mario is currently under the painting's y coordinate - s8 marioIsUnder; + u8 marioIsUnder : 1; /// True if Mario just went under the painting's y coordinate on this frame - s8 marioWentUnder; + u8 marioWentUnder : 1; /// Uniformly scales the painting to a multiple of PAINTING_SIZE. /// By default a painting is 614.0 x 614.0