model rendering doc (#1128)

* all over the place

* model roundup

* missing reset_tiles for jp/ique splat

* fix pal

* fix ique

---------

Co-authored-by: HailSanta <Hail2Santa@gmail.com>
This commit is contained in:
HailSanta 2023-11-23 23:06:58 -05:00 committed by GitHub
parent 2b88651f79
commit c2ade571fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
172 changed files with 1801 additions and 1541 deletions

View File

@ -997,8 +997,8 @@ typedef struct TextureHeader {
/* 0x26 */ u16 mainH; /* 0x26 */ u16 mainH;
/* 0x28 */ u8 isVariant; /* 0x28 */ u8 isVariant;
/* 0x29 */ u8 extraTiles; // 0 - none, 1 - mipmap, 2 - ?, 3 - use aux tile /* 0x29 */ u8 extraTiles; // 0 - none, 1 - mipmap, 2 - ?, 3 - use aux tile
/* 0x2A */ u8 colorCombineType : 6; /* 0x2A */ u8 auxCombineType : 6;
/* 0x2A */ u8 colorCombineSubType : 2; /* 0x2A */ u8 auxCombineSubType : 2;
/* 0x2B */ u8 auxFmt : 4; /* 0x2B */ u8 auxFmt : 4;
/* 0x2B */ u8 mainFmt : 4; /* 0x2B */ u8 mainFmt : 4;
/* 0x2C */ u8 auxBitDepth : 4; /* 0x2C */ u8 auxBitDepth : 4;
@ -1399,9 +1399,9 @@ typedef struct GameStatus {
/* 0x07B */ char unk_7B; /* 0x07B */ char unk_7B;
/* 0x07C */ b8 healthBarsEnabled; /* 0x07C */ b8 healthBarsEnabled;
/* 0x07D */ b8 keepUsingPartnerOnMapChange; /* 0x07D */ b8 keepUsingPartnerOnMapChange;
/* 0x07E */ u8 peachFlags; /* (1 = isPeach, 2 = isTransformed, 4 = hasUmbrella) */ /* 0x07E */ u8 peachFlags; // see PeachFlags enum
/* 0x07F */ s8 peachDisguise; /* (1 = koopatrol, 2 = hammer bros, 3 = clubba) */ /* 0x07F */ s8 peachDisguise; // see PeachDisguises enum
/* 0x080 */ u8 peachBakingIngredient; ///< @see enum PeachBakingItems /* 0x080 */ u8 peachBakingIngredient; ///< @see PeachBakingItems enum
/* 0x081 */ b8 multiplayerEnabled; /* 0x081 */ b8 multiplayerEnabled;
/* 0x082 */ Vec2b altViewportOffset; /* 0x082 */ Vec2b altViewportOffset;
/* 0x084 */ s8 playerSpriteSet; /* 0x084 */ s8 playerSpriteSet;

View File

@ -35,7 +35,7 @@ void shim_draw_box(
); );
void shim_draw_msg(s32, s32, s32, s32, s32, s32); void shim_draw_msg(s32, s32, s32, s32, s32, s32);
s32 shim_get_msg_width(s32, u16); s32 shim_get_msg_width(s32, u16);
void shim_get_background_color_blend(u8* r, u8* g, u8* b, u8* a); void shim_mdl_get_shroud_tint_params(u8* r, u8* g, u8* b, u8* a);
void shim_sfx_play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY, f32 posZ); void shim_sfx_play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY, f32 posZ);
#define guRotateF shim_guRotateF #define guRotateF shim_guRotateF
@ -68,7 +68,7 @@ void shim_sfx_play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY
#define draw_box shim_draw_box #define draw_box shim_draw_box
#define draw_msg shim_draw_msg #define draw_msg shim_draw_msg
#define get_msg_width shim_get_msg_width #define get_msg_width shim_get_msg_width
#define get_background_color_blend shim_get_background_color_blend #define mdl_get_shroud_tint_params shim_mdl_get_shroud_tint_params
#define sfx_play_sound_at_position shim_sfx_play_sound_at_position #define sfx_play_sound_at_position shim_sfx_play_sound_at_position
#endif #endif

View File

@ -1410,7 +1410,7 @@ typedef struct MerlinHouseStarsFXData {
/* 0x0C */ f32 unk_0C; /* 0x0C */ f32 unk_0C;
/* 0x10 */ f32 unk_10; /* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14; /* 0x14 */ f32 unk_14;
/* 0x18 */ s32 unk_18; /* 0x18 */ s32 alpha;
/* 0x1C */ f32 unk_1C; /* 0x1C */ f32 unk_1C;
/* 0x20 */ f32 unk_20; /* 0x20 */ f32 unk_20;
/* 0x24 */ f32 unk_24; /* 0x24 */ f32 unk_24;

View File

@ -2487,12 +2487,12 @@ enum LandOnSwitchSubstate {
LANDING_ON_SWITCH_SUBSTATE_2 = 2, LANDING_ON_SWITCH_SUBSTATE_2 = 2,
}; };
enum PeachStatusFlags { enum PeachFlags {
PEACH_STATUS_FLAG_IS_PEACH = 0x01, PEACH_FLAG_IS_PEACH = 0x01,
PEACH_STATUS_FLAG_DISGUISED = 0x02, PEACH_FLAG_DISGUISED = 0x02,
PEACH_STATUS_FLAG_HAS_PARASOL = 0x04, PEACH_FLAG_HAS_PARASOL = 0x04,
PEACH_STATUS_FLAG_8 = 0x08, PEACH_FLAG_BLOCK_NEXT_DISGUISE = 0x08, // next attempt to copy an NPC with parasol will fail
PEACH_STATUS_FLAG_DEPRESSED = 0x10 PEACH_FLAG_DEPRESSED = 0x10
}; };
enum PeachBakingItems { enum PeachBakingItems {
@ -3192,6 +3192,7 @@ enum WindowPriority {
}; };
enum RenderModeIndex { enum RenderModeIndex {
// RM1 modes
RENDER_MODE_IDX_00 = 0x00, RENDER_MODE_IDX_00 = 0x00,
RENDER_MODE_IDX_01 = 0x01, RENDER_MODE_IDX_01 = 0x01,
RENDER_MODE_IDX_02 = 0x02, RENDER_MODE_IDX_02 = 0x02,
@ -3208,6 +3209,7 @@ enum RenderModeIndex {
RENDER_MODE_IDX_0D = 0x0D, RENDER_MODE_IDX_0D = 0x0D,
RENDER_MODE_IDX_0E = 0x0E, RENDER_MODE_IDX_0E = 0x0E,
RENDER_MODE_IDX_0F = 0x0F, RENDER_MODE_IDX_0F = 0x0F,
// RM2 modes
RENDER_MODE_IDX_10 = 0x10, RENDER_MODE_IDX_10 = 0x10,
RENDER_MODE_IDX_11 = 0x11, RENDER_MODE_IDX_11 = 0x11,
RENDER_MODE_IDX_12 = 0x12, RENDER_MODE_IDX_12 = 0x12,
@ -3223,6 +3225,7 @@ enum RenderModeIndex {
RENDER_MODE_IDX_1C = 0x1C, RENDER_MODE_IDX_1C = 0x1C,
RENDER_MODE_IDX_1D = 0x1D, RENDER_MODE_IDX_1D = 0x1D,
RENDER_MODE_IDX_1E = 0x1E, RENDER_MODE_IDX_1E = 0x1E,
// RM3 modes
RENDER_MODE_IDX_1F = 0x1F, RENDER_MODE_IDX_1F = 0x1F,
RENDER_MODE_IDX_20 = 0x20, RENDER_MODE_IDX_20 = 0x20,
RENDER_MODE_IDX_21 = 0x21, RENDER_MODE_IDX_21 = 0x21,
@ -3247,6 +3250,7 @@ enum RenderModeIndex {
RENDER_MODE_IDX_34 = 0x34, RENDER_MODE_IDX_34 = 0x34,
RENDER_MODE_IDX_35 = 0x35, RENDER_MODE_IDX_35 = 0x35,
RENDER_MODE_IDX_36 = 0x36, RENDER_MODE_IDX_36 = 0x36,
// cloud render modes
RENDER_MODE_IDX_37 = 0x37, RENDER_MODE_IDX_37 = 0x37,
RENDER_MODE_IDX_38 = 0x38, RENDER_MODE_IDX_38 = 0x38,
RENDER_MODE_IDX_39 = 0x39, RENDER_MODE_IDX_39 = 0x39,
@ -3255,56 +3259,61 @@ enum RenderModeIndex {
RENDER_MODE_IDX_3C = 0x3C, RENDER_MODE_IDX_3C = 0x3C,
}; };
/// not really // predefined configurations for RDP geometry and render modes
// though these are called "render modes", they do not strictly correspond to the RDP render modes (as supplied to gDPSetRenderMode)
enum RenderMode { enum RenderMode {
RENDER_MODE_SURF_SOLID_AA_ZB_LAYER0 = 0x00000000, // opaque render modes
RENDER_MODE_SURFACE_OPA = 0x00000001, RENDER_MODE_SURF_SOLID_AA_ZB_LAYER0 = 0x00,
RENDER_MODE_02_UNUSED = 0x00000002, RENDER_MODE_SURFACE_OPA = 0x01,
RENDER_MODE_SURFACE_OPA_NO_AA = 0x00000003, RENDER_MODE_02_UNUSED = 0x02,
RENDER_MODE_SURFACE_OPA_NO_ZB = 0x00000004, RENDER_MODE_SURFACE_OPA_NO_AA = 0x03,
RENDER_MODE_DECAL_OPA = 0x00000005, RENDER_MODE_SURFACE_OPA_NO_ZB = 0x04,
RENDER_MODE_06_UNUSED = 0x00000006, RENDER_MODE_DECAL_OPA = 0x05,
RENDER_MODE_DECAL_OPA_NO_AA = 0x00000007, RENDER_MODE_06_UNUSED = 0x06,
RENDER_MODE_08_UNUSED = 0x00000008, RENDER_MODE_DECAL_OPA_NO_AA = 0x07,
RENDER_MODE_INTERSECTING_OPA = 0x00000009, RENDER_MODE_08_UNUSED = 0x08,
RENDER_MODE_0A_UNUSED = 0x0000000A, RENDER_MODE_INTERSECTING_OPA = 0x09,
RENDER_MODE_0B_UNUSED = 0x0000000B, RENDER_MODE_0A_UNUSED = 0x0A,
RENDER_MODE_0C_UNUSED = 0x0000000C, RENDER_MODE_0B_UNUSED = 0x0B,
RENDER_MODE_ALPHATEST = 0x0000000D, RENDER_MODE_0C_UNUSED = 0x0C,
RENDER_MODE_0E_UNUSED = 0x0000000E, RENDER_MODE_ALPHATEST = 0x0D,
RENDER_MODE_ALPHATEST_ONESIDED = 0x0000000F, RENDER_MODE_0E_UNUSED = 0x0E,
RENDER_MODE_ALPHATEST_NO_ZB = 0x00000010, RENDER_MODE_ALPHATEST_ONESIDED = 0x0F,
RENDER_MODE_SURFACE_XLU_LAYER1 = 0x00000011, RENDER_MODE_ALPHATEST_NO_ZB = 0x10,
RENDER_MODE_12_UNUSED = 0x00000012, RENDER_MODES_LAST_OPAQUE = RENDER_MODE_ALPHATEST_NO_ZB,
RENDER_MODE_SURFACE_XLU_NO_AA = 0x00000013, // translucent render modes
RENDER_MODE_SURFACE_XLU_NO_ZB = 0x00000014, RENDER_MODE_SURFACE_XLU_LAYER1 = 0x11,
RENDER_MODE_SURFACE_XLU_ZB_ZUPD = 0x00000015, RENDER_MODE_12_UNUSED = 0x12,
RENDER_MODE_SURFACE_XLU_LAYER2 = 0x00000016, RENDER_MODE_SURFACE_XLU_NO_AA = 0x13,
RENDER_MODE_17_UNUSED = 0x00000017, RENDER_MODE_SURFACE_XLU_NO_ZB = 0x14,
RENDER_MODE_18_UNUSED = 0x00000018, RENDER_MODE_SURFACE_XLU_ZB_ZUPD = 0x15,
RENDER_MODE_19_UNUSED = 0x00000019, RENDER_MODE_SURFACE_XLU_LAYER2 = 0x16,
RENDER_MODE_DECAL_XLU = 0x0000001A, RENDER_MODE_17_UNUSED = 0x17,
RENDER_MODE_1B_UNUSED = 0x0000001B, RENDER_MODE_18_UNUSED = 0x18,
RENDER_MODE_DECAL_XLU_NO_AA = 0x0000001C, RENDER_MODE_19_UNUSED = 0x19,
RENDER_MODE_1D_UNUSED = 0x0000001D, RENDER_MODE_DECAL_XLU = 0x1A,
RENDER_MODE_DECAL_XLU_AHEAD = 0x0000001E, // special case RENDER_MODE_DECAL_XLU for rendering in front of others RENDER_MODE_1B_UNUSED = 0x1B,
RENDER_MODE_1F_UNUSED = 0x0000001F, RENDER_MODE_DECAL_XLU_NO_AA = 0x1C,
RENDER_MODE_SHADOW = 0x00000020, RENDER_MODE_1D_UNUSED = 0x1D,
RENDER_MODE_21_UNUSED = 0x00000021, RENDER_MODE_DECAL_XLU_AHEAD = 0x1E, // special case RENDER_MODE_DECAL_XLU for rendering in front of others
RENDER_MODE_SURFACE_XLU_LAYER3 = 0x00000022, RENDER_MODE_1F_UNUSED = 0x1F,
RENDER_MODE_23_UNUSED = 0x00000023, RENDER_MODE_SHADOW = 0x20,
RENDER_MODE_24_UNUSED = 0x00000024, RENDER_MODE_21_UNUSED = 0x21,
RENDER_MODE_25_UNUSED = 0x00000025, RENDER_MODE_SURFACE_XLU_LAYER3 = 0x22,
RENDER_MODE_INTERSECTING_XLU = 0x00000026, RENDER_MODE_23_UNUSED = 0x23,
RENDER_MODE_27_UNUSED = 0x00000027, RENDER_MODE_24_UNUSED = 0x24,
RENDER_MODE_PASS_THROUGH = 0x00000028, // no render mode is set, only geometry modes are initialized RENDER_MODE_25_UNUSED = 0x25,
RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD = 0x00000029, RENDER_MODE_INTERSECTING_XLU = 0x26,
RENDER_MODE_SURFACE_OPA_NO_ZB_BEHIND = 0x0000002A, RENDER_MODE_27_UNUSED = 0x27,
RENDER_MODE_ALPHATEST_NO_ZB_BEHIND = 0x0000002B, // unusual render modes
RENDER_MODE_SURFACE_XLU_NO_ZB_BEHIND = 0x0000002C, RENDER_MODE_PASS_THROUGH = 0x28, // no render mode is set, only geometry modes are initialized
RENDER_MODE_CLOUD_NO_ZCMP = 0x0000002D, RENDER_MODE_SURFACE_XLU_AA_ZB_ZUPD = 0x29,
RENDER_MODE_CLOUD = 0x0000002E, RENDER_MODE_SURFACE_OPA_NO_ZB_BEHIND = 0x2A,
RENDER_MODE_CLOUD_NO_ZB = 0x0000002F, RENDER_MODE_ALPHATEST_NO_ZB_BEHIND = 0x2B,
RENDER_MODE_SURFACE_XLU_NO_ZB_BEHIND = 0x2C,
RENDER_MODE_CLOUD_NO_ZCMP = 0x2D,
RENDER_MODE_CLOUD = 0x2E,
RENDER_MODE_CLOUD_NO_ZB = 0x2F,
}; };
enum RenderTaskFlags { enum RenderTaskFlags {
@ -4304,7 +4313,7 @@ enum GlobalOverrides {
#define MODEL_FLAGS_MASK_FFF0 (\ #define MODEL_FLAGS_MASK_FFF0 (\
MODEL_FLAG_USES_CUSTOM_GFX \ MODEL_FLAG_USES_CUSTOM_GFX \
| MODEL_FLAG_20 \ | MODEL_FLAG_20 \
| MODEL_FLAG_40 \ | MODEL_FLAG_IGNORE_FOG \
| MODEL_FLAG_HAS_LOCAL_VERTEX_COPY \ | MODEL_FLAG_HAS_LOCAL_VERTEX_COPY \
| MODEL_FLAG_USE_CAMERA_UNK_MATRIX \ | MODEL_FLAG_USE_CAMERA_UNK_MATRIX \
| MODEL_FLAG_DO_BOUNDS_CULLING \ | MODEL_FLAG_DO_BOUNDS_CULLING \
@ -4312,8 +4321,8 @@ enum GlobalOverrides {
| MODEL_FLAG_HAS_TEX_PANNER \ | MODEL_FLAG_HAS_TEX_PANNER \
| MODEL_FLAG_MATRIX_DIRTY \ | MODEL_FLAG_MATRIX_DIRTY \
| MODEL_FLAG_IGNORE_MATRIX \ | MODEL_FLAG_IGNORE_MATRIX \
| MODEL_FLAG_4000 \ | MODEL_FLAG_UNUSED_4000 \
| MODEL_FLAG_8000) | MODEL_FLAG_UNUSED_8000)
enum ModelFlags { enum ModelFlags {
MODEL_FLAG_VALID = 0x0001, MODEL_FLAG_VALID = 0x0001,
@ -4322,7 +4331,7 @@ enum ModelFlags {
MODEL_FLAG_TRANSFORM_GROUP_MEMBER = 0x0008, MODEL_FLAG_TRANSFORM_GROUP_MEMBER = 0x0008,
MODEL_FLAG_USES_CUSTOM_GFX = 0x0010, MODEL_FLAG_USES_CUSTOM_GFX = 0x0010,
MODEL_FLAG_20 = 0x0020, MODEL_FLAG_20 = 0x0020,
MODEL_FLAG_40 = 0x0040, MODEL_FLAG_IGNORE_FOG = 0x0040,
MODEL_FLAG_HAS_LOCAL_VERTEX_COPY = 0x0080, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY = 0x0080,
MODEL_FLAG_USE_CAMERA_UNK_MATRIX = 0x0100, MODEL_FLAG_USE_CAMERA_UNK_MATRIX = 0x0100,
MODEL_FLAG_DO_BOUNDS_CULLING = 0x0200, MODEL_FLAG_DO_BOUNDS_CULLING = 0x0200,
@ -4330,8 +4339,8 @@ enum ModelFlags {
MODEL_FLAG_HAS_TEX_PANNER = 0x0800, MODEL_FLAG_HAS_TEX_PANNER = 0x0800,
MODEL_FLAG_MATRIX_DIRTY = 0x1000, // transform matrix changed and combined matrix needs to be recalculated MODEL_FLAG_MATRIX_DIRTY = 0x1000, // transform matrix changed and combined matrix needs to be recalculated
MODEL_FLAG_IGNORE_MATRIX = 0x2000, // set until dirty combined matrix has been recalculated MODEL_FLAG_IGNORE_MATRIX = 0x2000, // set until dirty combined matrix has been recalculated
MODEL_FLAG_4000 = 0x4000, MODEL_FLAG_UNUSED_4000 = 0x4000,
MODEL_FLAG_8000 = 0x8000, MODEL_FLAG_UNUSED_8000 = 0x8000,
}; };
enum ModelGroupVisibility { enum ModelGroupVisibility {
@ -4341,6 +4350,20 @@ enum ModelGroupVisibility {
MODEL_GROUP_OTHERS_VISIBLE = 3, MODEL_GROUP_OTHERS_VISIBLE = 3,
}; };
enum TintMode {
ENV_TINT_UNCHANGED = -1,
// no additional tint is applied (model is still be affected by world fog)
ENV_TINT_NONE = 0,
// additional fog which 'shrouds' the world during certain scenes
ENV_TINT_SHROUD = 1,
// adds depth-based tint using fog, overriding the world fog for affected models
ENV_TINT_DEPTH = 2,
// this mode remaps each color channel range from [0, 255] -> [min, max],
// setting a new white point and black point for the scene.
// the new max values are stored in PRIMITIVE and the new min values in ENV
ENV_TINT_REMAP = 3,
};
enum TexPanner { enum TexPanner {
//select pan unit //select pan unit
TEX_PANNER_0 = 0x0, TEX_PANNER_0 = 0x0,
@ -5853,14 +5876,6 @@ enum BackgroundFlags {
BACKGROUND_RENDER_STATE_MASK = 0xF0, BACKGROUND_RENDER_STATE_MASK = 0xF0,
}; };
enum FogModes {
FOG_MODE_UNCHANGED = -1,
FOG_MODE_0 = 0,
FOG_MODE_1 = 1,
FOG_MODE_2 = 2,
FOG_MODE_3 = 3,
};
enum EncounterStates { enum EncounterStates {
ENCOUNTER_STATE_NONE = 0, ENCOUNTER_STATE_NONE = 0,
ENCOUNTER_STATE_CREATE = 1, ENCOUNTER_STATE_CREATE = 1,

View File

@ -444,7 +444,7 @@ void set_peach_shadow_scale(Shadow* shadow, f32 scale);
s32 is_block_on_ground(Entity* block); s32 is_block_on_ground(Entity* block);
void set_actor_anim(s32 actorID, s32 partID, AnimID animID); void set_actor_anim(s32 actorID, s32 partID, AnimID animID);
void set_actor_anim_rate(s32 actorID, s32 partID, f32 rate); void set_actor_anim_rate(s32 actorID, s32 partID, f32 rate);
void set_model_group_visibility(u16, s32, s32); void mdl_group_set_visibility(u16, s32, s32);
void init_enter_world_shared(void); void init_enter_world_shared(void);
s16 update_enter_map_screen_overlay(s16* progress); s16 update_enter_map_screen_overlay(s16* progress);
s16 update_exit_map_screen_overlay(s16* progress); s16 update_exit_map_screen_overlay(s16* progress);
@ -820,7 +820,7 @@ void set_screen_overlay_center_worldpos(s32 idx, s32 posIdx, s32 x, s32 y, s32 z
void* mdl_get_next_texture_address(s32); void* mdl_get_next_texture_address(s32);
s32 cancel_current_message(void); s32 cancel_current_message(void);
void draw_msg(s32 msgID, s32 posX, s32 posY, s32 opacity, s32 palette, u8 style); void draw_msg(s32 msgID, s32 posX, s32 posY, s32 opacity, s32 palette, u8 style);
void get_background_color_blend(u8* r, u8* g, u8* b, u8* a); void mdl_get_shroud_tint_params(u8* r, u8* g, u8* b, u8* a);
s32 entity_base_block_idle(Entity* entity); s32 entity_base_block_idle(Entity* entity);
void add_star_power(s32 amt); void add_star_power(s32 amt);
@ -882,7 +882,7 @@ void btl_cam_use_preset_immediately(s32);
s32 inflict_status(Actor*, s32, s32); s32 inflict_status(Actor*, s32, s32);
s32 try_inflict_status(Actor*, s32, s32); s32 try_inflict_status(Actor*, s32, s32);
s32 inflict_status_set_duration(Actor* actor, s32 statusTypeKey, s32 statusDurationKey, s32 duration); s32 inflict_status_set_duration(Actor* actor, s32 statusTypeKey, s32 statusDurationKey, s32 duration);
void mdl_set_all_fog_mode(s32); void mdl_set_all_tint_type(s32);
void load_model_animator_tree(s32, StaticAnimatorNode**); void load_model_animator_tree(s32, StaticAnimatorNode**);
s32 inflict_partner_ko(Actor* target, s32 statusTypeKey, s32 duration); s32 inflict_partner_ko(Actor* target, s32 statusTypeKey, s32 duration);
@ -1014,7 +1014,7 @@ void status_bar_start_blinking_sp_bars(s32 numBarsToBlink);
void status_bar_draw_number(s32 iconID, s32 x, s32 y, s32 value, s32 numDigits); void status_bar_draw_number(s32 iconID, s32 x, s32 y, s32 value, s32 numDigits);
void status_bar_draw_stat(s32 id, s32 x, s32 y, s32, s32); void status_bar_draw_stat(s32 id, s32 x, s32 y, s32, s32);
void set_background_size(s16, s16, s16, s16); void set_background_size(s16, s16, s16, s16);
void read_background_size(BackgroundHeader*); void set_background(BackgroundHeader*);
void set_max_star_power(s8); void set_max_star_power(s8);
void sync_status_bar(void); void sync_status_bar(void);
void create_cameras_a(void); void create_cameras_a(void);
@ -1080,7 +1080,7 @@ void partner_kill_ability_script(void);
void func_800EF3D4(s32); void func_800EF3D4(s32);
void mdl_update_transform_matrices(void); void mdl_update_transform_matrices(void);
void func_8011B950(u16, s32, s32, s32); void mdl_group_set_custom_gfx(u16, s32, s32, b32);
void backup_map_collision_data(void); void backup_map_collision_data(void);
void reset_status_bar(void); void reset_status_bar(void);

View File

@ -285,8 +285,8 @@
#define PM_CC_05 TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0 #define PM_CC_05 TEXEL0, 0, SHADE, 0, TEXEL0, 0, PRIMITIVE, 0
#define PM_CC_06 COMBINED, 0, PRIMITIVE_ALPHA, 0, 0, 0, 0, COMBINED #define PM_CC_06 COMBINED, 0, PRIMITIVE_ALPHA, 0, 0, 0, 0, COMBINED
#define PM_CC_07 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0 #define PM_CC_07 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0
#define PM_CC_08 0, 0, 0, PRIMITIVE, 0, 0, 0, 1 #define PM_CC_PRIM_FULL_ALPHA 0, 0, 0, PRIMITIVE, 0, 0, 0, 1
#define PM_CC_09 0, 0, 0, PRIMITIVE, 0, 0, 0, 0 #define PM_CC_PRIM_NO_ALPHA 0, 0, 0, PRIMITIVE, 0, 0, 0, 0
#define PM_CC_0A 0, 0, 0, 0, ENVIRONMENT, 0, TEXEL0, 0 #define PM_CC_0A 0, 0, 0, 0, ENVIRONMENT, 0, TEXEL0, 0
#define PM_CC_0B 0, 0, 0, 0, ENVIRONMENT, 0, TEXEL1, 0 #define PM_CC_0B 0, 0, 0, 0, ENVIRONMENT, 0, TEXEL1, 0
#define PM_CC_0C 0, 0, 0, 0, 0, 0, 0, COMBINED #define PM_CC_0C 0, 0, 0, 0, 0, 0, 0, COMBINED
@ -302,13 +302,97 @@
#define PM_CC_15 PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1 #define PM_CC_15 PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1
#define PM_CC_16 COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED #define PM_CC_16 COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED
// (COMB * PRIM) + ENV
#define PM_CC_17 COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED #define PM_CC_17 COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED
#define PM_CC_18 COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED #define PM_CC_18 COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED
#define PM_CC_19 COMBINED, 0, SHADE, PRIMITIVE, 0, 0, 0, COMBINED #define PM_CC_19 COMBINED, 0, SHADE, PRIMITIVE, 0, 0, 0, COMBINED
#define PM_CC_1A COMBINED, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED #define PM_CC_1B COMBINED, 0, PRIMITIVE, ENVIRONMENT, COMBINED, 0, SHADE, 0
#define PM_CC_ALT_TRILERP TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0 #define PM_CC_NOISE NOISE, 0, SHADE_ALPHA, 0, 0, 0, 0, 1
#define PM_CC_1A TEXEL0, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, TEXEL0
// implements ENV_TINT_DEPTH for untextured models
// applies just the base color; depth-based fog color will be added during RPD blend step
// color = SHADE * PRIM_ALPHA + PRIM
// alpha = SHADE
#define PM_CC_NOTEX_TINT_FOG \
SHADE, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, SHADE
// implements ENV_TINT_REMAP for untextured models
// color = SHADE * PRIM + ENV
// alpha = SHADE
#define PM_CC_NOTEX_TINT_REMAP \
SHADE, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, SHADE
#define PM_CC_20 COMBINED, PRIMITIVE, PRIMITIVE_ALPHA, COMBINED, 0, 0, 0, COMBINED
#define PM_CC_21 COMBINED, 0, PRIMITIVE_ALPHA, PRIMITIVE, 0, 0, 0, COMBINED
#define PM_CC_22 TEXEL0, TEXEL1, SHADE_ALPHA, TEXEL1, 0, 0, 0, TEXEL0
#define PM_CC_23 1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, TEXEL0
#define PM_CC1_24 1, TEXEL0, PRIMITIVE, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0
#define PM_CC2_24 1, TEXEL1, TEXEL0, COMBINED, 0, 0, 0, COMBINED
#define PM_CC_26 0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0
#define PM_CC_27 0, 0, 0, SHADE, 0, 0, 0, COMBINED
#define PM_CC_28 SHADE, 0, PRIMITIVE, ENVIRONMENT, 0, 0, 0, COMBINED
#define PM_CC1_29 TEXEL0, SHADE, TEXEL0, TEXEL0, 1, TEXEL1, TEXEL0, TEXEL1
#define PM_CC2_29 TEXEL0, COMBINED, TEXEL0_ALPHA, TEXEL0, 1, TEXEL0, TEXEL1, TEXEL0
#define PM_CC_ALT_INTERFERENCE TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0
#define PM_CC_2B PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, TEXEL1
#define PM_CC_2C PRIMITIVE, 0, TEXEL1, 0, TEXEL1, 0, PRIMITIVE, 0
#define PM_CC_2D PRIMITIVE, 0, TEXEL0, 0, 0, 0, 0, TEXEL0
#define PM_CC_2E 0, 0, 0, TEXEL0, TEXEL1, 0, PRIMITIVE, 0
#define PM_CC_2F PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0
#define PM_CC_32 PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0
#define PM_CC_33 ENVIRONMENT, PRIMITIVE, COMBINED, PRIMITIVE, COMBINED, 0, PRIMITIVE, 0
#define PM_CC_34 TEXEL0, CENTER, SCALE, ENVIRONMENT, 0, 0, 0, TEXEL0
#define PM_CC_35 0, PRIMITIVE, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED
#define PM_CC_36 TEXEL0, TEXEL1, TEXEL0, TEXEL1, 1, TEXEL0, TEXEL1, 1
#define PM_CC_37 0, 0, 0, COMBINED, COMBINED, TEXEL1, TEXEL1, TEXEL1
#define PM_CC_38 TEXEL1, K4, PRIMITIVE_ALPHA, TEXEL0, TEXEL0, TEXEL1, ENVIRONMENT, ENVIRONMENT
#define PM_CC_39 TEXEL1, K4, COMBINED_ALPHA, COMBINED, 0, 0, 0, 1
#define PM_CC_3A 0, 0, 0, PRIMITIVE, 1, TEXEL0, PRIMITIVE, TEXEL0
#define PM_CC_3B 0, 0, 0, SHADE, 1, 0, PRIMITIVE, 0
#define PM_CC_3C 0, 0, 0, PRIMITIVE, SHADE, 0, PRIMITIVE, 0
#define PM_CC_3D SHADE, ENVIRONMENT, TEXEL0, TEXEL0, PRIMITIVE, 0, TEXEL0, 0
#define PM_CC_3E 0, 0, 0, COMBINED, 0, 0, 0, PRIMITIVE
#define PM_CC_3F TEXEL0, 0, SHADE, 0, SHADE, 0, PRIMITIVE, 0
// animated tiles spreading over the screen when the game is reset
// color = pure black
// alpha = texture
#define PM_CC_RESET_TILES 0, 0, 0, 0, 0, 0, 0, TEXEL0
// light with animated alpha surrounding the flower gate in mac_01 as it appears
// color = pure white
// alpha = SHADE * PRIM
#define PM_CC_FLOWER_GATE_GLOW 0, 0, 0, 1, SHADE, 0, PRIMITIVE, 0
// light with animated alpha pouring through the opening in kkj_27 as the secret wall rotates
// color = TEXEL0 * SHADE
// alpha = PRIM
#define PM_CC_KKJ_SPILL_LIGHT TEXEL0, 0, SHADE, 0, 0, 0, 0, PRIMITIVE
// color = SHADE + PRIM
// alpha = PRIMITIVE * TEXEL0
#define PM_CC_DAMAGE_INDICATOR 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0
// custom combine modes for shadows
#define PM_CC1_SHADOW 0, 0, 0, 0, PRIMITIVE, 0, TEXEL0, 0
#define PM_CC2_SHADOW 0, 0, 0, 0, TEXEL0, 0, PRIMITIVE, 0
// custom cycle1 modes for window styles // custom cycle1 modes for window styles
#define PM_CC_WINDOW_2 PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, TEXEL1 #define PM_CC_WINDOW_2 PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, TEXEL1
@ -337,6 +421,51 @@
#define PM_CC_BOX1_CYC2 TEXEL0, ENVIRONMENT, ENV_ALPHA, COMBINED, 0, 0, 0, COMBINED #define PM_CC_BOX1_CYC2 TEXEL0, ENVIRONMENT, ENV_ALPHA, COMBINED, 0, 0, 0, COMBINED
#define PM_CC_BOX2_CYC2 PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED #define PM_CC_BOX2_CYC2 PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED
#define PM_CC_30 1, 0, TEXEL1, 0, 0, 0, 0, TEXEL1
#define PM_CC_31 1, 0, TEXEL1, 0, TEXEL1, 0, PRIMITIVE, 0
#define PM_CC_42 TEXEL0, 0, SHADE, 0, TEXEL0, 0, 0, TEXEL0
#define PM_CC_43 PRIMITIVE, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, 1
#define PM_CC_44 PRIMITIVE, TEXEL1, PRIMITIVE_ALPHA, TEXEL1, 0, 0, 0, 1
#define PM_CC_45 TEXEL0, 0, PRIMITIVE, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0
#define PM_CC_46 TEXEL0, ENVIRONMENT, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0
#define PM_CC_47 TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0
#define PM_CC_48 PRIMITIVE, 0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, SHADE
#define PM_CC_49 TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0
#define PM_CC_4A TEXEL1, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL1, TEXEL0, ENVIRONMENT, TEXEL0
#define PM_CC_4B PRIMITIVE, CENTER, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED
#define PM_CC_4C 1, COMBINED, PRIMITIVE, COMBINED, 0, 0, 0, COMBINED
#define PM_CC_4D ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0
#define PM_CC_4E SHADE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, SHADE, 0
#define PM_CC_4F 0, 0, 0, COMBINED, COMBINED, 0, PRIMITIVE, 0
#define PM_CC_50 TEXEL0, 0, TEXEL1, 0, 0, 0, 0, TEXEL1
#define PM_CC_51 TEXEL0, 0, TEXEL1, 0, PRIMITIVE, 0, TEXEL1, 0
#define PM_CC_52 SHADE, ENVIRONMENT, COMBINED, COMBINED, 0, 0, 0, COMBINED
#define PM_CC_53 TEXEL1, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0
#define PM_CC_54 COMBINED, TEXEL0, COMBINED_ALPHA, TEXEL0, PRIMITIVE, 0, TEXEL0, 0
#define PM_CC_55 PRIMITIVE, ENVIRONMENT, TEXEL0_ALPHA, ENVIRONMENT, 0, 0, 0, 1
#define PM_CC_56 0, 0, 0, 0, PRIMITIVE, TEXEL0, PRIMITIVE, 0
#define PM_CC_57 1, TEXEL0, PRIMITIVE, 0, TEXEL0, 0, ENVIRONMENT, PRIMITIVE
#define PM_CC_58 0, 0, 0, 0, 1, 0, ENVIRONMENT, PRIMITIVE
#define PM_CC_59 0, 0, 0, 0, SHADE, 0, TEXEL0, 0
#define PM_CC_5A SHADE, ENVIRONMENT, TEXEL0, TEXEL0, 0, 0, 0, TEXEL0
#define PM_CC_5B 1, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0
#define PM_CC_5C 1, 0, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0
#define PM_CC_5D 1, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0
#define PM_CC_5E 1, SHADE, TEXEL0, SHADE, TEXEL0, 0, SHADE, 0
#define PM_CC_HOS_BG_SHADE 0, 0, 0, SHADE, SHADE, 0, PRIMITIVE, 0
#define PM_CC_CONST_ALPHA_1 0, 0, 0, 0, 0, 0, 0, 1 #define PM_CC_CONST_ALPHA_1 0, 0, 0, 0, 0, 0, 0, 1
#define PM_CC_CONST_0 0, 0, 0, 0, 0, 0, 0, 0 #define PM_CC_CONST_0 0, 0, 0, 0, 0, 0, 0, 0
#define PM_CC_CONST_1 0, 0, 0, 1, 0, 0, 0, 1 #define PM_CC_CONST_1 0, 0, 0, 1, 0, 0, 0, 1

View File

@ -161,11 +161,11 @@ typedef enum GroupTypes {
} GroupTypes; } GroupTypes;
typedef enum ExtraTileTypes { typedef enum ExtraTileTypes {
EXTRA_TILE_NONE = 0, EXTRA_TILE_NONE = 0, // texture contains only a single tile
EXTRA_TILE_MIPMAPS = 1, EXTRA_TILE_MIPMAPS = 1, // texture contais mipmaps
EXTRA_TILE_AUX_SAME_AS_MAIN = 2, EXTRA_TILE_AUX_SAME_AS_MAIN = 2, // texture contains main and aux images with identical fmt and size
EXTRA_TILE_AUX_INDEPENDENT = 3, EXTRA_TILE_AUX_INDEPENDENT = 3, // texture contains main and aux images with independent fmt and size
EXTRA_TILE_4 = 4, EXTRA_TILE_4 = 4, // only use-case may be a mistake? unused and mostly unimplemented
} ExtraTileTypes; } ExtraTileTypes;
#define SHAPE_SIZE_LIMIT 0x8000 #define SHAPE_SIZE_LIMIT 0x8000
@ -181,16 +181,16 @@ typedef struct ShapeFileHeader {
typedef struct ShapeFile { typedef struct ShapeFile {
/* 0x00 */ ShapeFileHeader header; /* 0x00 */ ShapeFileHeader header;
/* 0x20 */ u8 data[SHAPE_SIZE_LIMIT - 0x20]; /* 0x20 */ u8 data[SHAPE_SIZE_LIMIT - sizeof(ShapeFileHeader)];
} ShapeFile; // size = variable } ShapeFile; // size = variable
typedef ModelTreeInfo ModelTreeInfoList[0x200]; typedef ModelTreeInfo ModelTreeInfoList[0x200];
extern ModelTreeInfoList* gCurrentModelTreeNodeInfo; extern ModelTreeInfoList* gCurrentModelTreeNodeInfo;
extern ModelList* gCurrentModels; extern ModelList* gCurrentModels;
void set_model_fog_color_parameters(u8 primR, u8 primG, u8 primB, u8 primA, u8 fogR, u8 fogG, u8 fogB, s32 fogStart, s32 fogEnd); void mdl_set_depth_tint_params(u8 primR, u8 primG, u8 primB, u8 primA, u8 fogR, u8 fogG, u8 fogB, s32 fogStart, s32 fogEnd);
void set_model_env_color_parameters(u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB); void mdl_set_remap_tint_params(u8 primR, u8 primG, u8 primB, u8 envR, u8 envG, u8 envB);
void get_model_env_color_parameters(u8* primR, u8* primG, u8* primB, u8* envR, u8* envG, u8* envB); void mdl_get_remap_tint_params(u8* primR, u8* primG, u8* primB, u8* envR, u8* envG, u8* envB);
void init_model_data(void); void init_model_data(void);
void update_model_animator(s32); void update_model_animator(s32);
@ -221,6 +221,6 @@ void set_custom_gfx_builders(s32 customGfxIndex, ModelCustomGfxBuilderFunc pre,
void mdl_make_local_vertex_copy(s32 arg0, u16 treeIdx, s32); void mdl_make_local_vertex_copy(s32 arg0, u16 treeIdx, s32);
void play_model_animation_starting_from(s32 index, s16* animPos, s32 framesToSkip); void play_model_animation_starting_from(s32 index, s16* animPos, s32 framesToSkip);
void set_background_color_blend(u8 r, u8 g, u8 b, u8 a); void mdl_set_shroud_tint_params(u8 r, u8 g, u8 b, u8 a);
#endif #endif

View File

@ -32,7 +32,7 @@ extern CollisionData gCollisionData;
extern f32 GravityParamsStartFall[]; extern f32 GravityParamsStartFall[];
extern s16 FootstepSoundSelector; extern s16 FootstepSoundSelector;
extern u8* gBackgroundFogModePtr; extern u8* gBackgroundTintModePtr;
extern s32 gEntityHideMode; extern s32 gEntityHideMode;
extern s32 D_8010C92C; extern s32 D_8010C92C;

View File

@ -10,7 +10,7 @@ void* effectFuncs[] = {
cos_deg, atan2, npc_raycast_down_sides, load_effect, sqrtf, mdl_draw_hidden_panel_surface, is_point_visible, cos_deg, atan2, npc_raycast_down_sides, load_effect, sqrtf, mdl_draw_hidden_panel_surface, is_point_visible,
guPerspectiveF, guMtxIdentF, transform_point, guLookAtHiliteF, set_screen_overlay_params_back, guPerspectiveF, guMtxIdentF, transform_point, guLookAtHiliteF, set_screen_overlay_params_back,
set_screen_overlay_center, set_screen_overlay_center_worldpos, mdl_get_next_texture_address, guPositionF, guOrthoF, set_screen_overlay_center, set_screen_overlay_center_worldpos, mdl_get_next_texture_address, guPositionF, guOrthoF,
guFrustumF, draw_prev_frame_buffer_at_screen_pos, draw_box, draw_msg, get_msg_width, get_background_color_blend, sfx_play_sound_at_position guFrustumF, draw_prev_frame_buffer_at_screen_pos, draw_box, draw_msg, get_msg_width, mdl_get_shroud_tint_params, sfx_play_sound_at_position
}; };
s32 SimpleRandLUT[128] = { s32 SimpleRandLUT[128] = {

View File

@ -784,7 +784,7 @@ void appendGfx_startup_prim_rect(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u16
if (a == 255) { if (a == 255) {
gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08); gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_FULL_ALPHA, PM_CC_PRIM_FULL_ALPHA);
} else { } else {
gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2); gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);

View File

@ -1730,7 +1730,7 @@ void update_player_shadow(void) {
shadow->pos.y = y; shadow->pos.y = y;
shadow->alpha = (f64)playerStatus->curAlpha / 2; shadow->alpha = (f64)playerStatus->curAlpha / 2;
if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH)) { if (!(gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH)) {
set_standard_shadow_scale(shadow, shadowScale); set_standard_shadow_scale(shadow, shadowScale);
} else { } else {
set_peach_shadow_scale(shadow, shadowScale); set_peach_shadow_scale(shadow, shadowScale);

View File

@ -69,17 +69,17 @@ void reset_player_status(void) {
playerStatus->curAlpha = 255; playerStatus->curAlpha = 255;
playerStatus->prevAlpha = 255; playerStatus->prevAlpha = 255;
gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_8; gGameStatusPtr->peachFlags &= ~PEACH_FLAG_BLOCK_NEXT_DISGUISE;
gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_DEPRESSED; gGameStatusPtr->peachFlags &= ~PEACH_FLAG_DEPRESSED;
one = 1.0f; one = 1.0f;
if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) { if (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH) {
playerStatus->colliderHeight = 55; playerStatus->colliderHeight = 55;
playerStatus->colliderDiameter = 38; playerStatus->colliderDiameter = 38;
playerStatus->animFlags |= PA_FLAG_USING_PEACH_PHYSICS; playerStatus->animFlags |= PA_FLAG_USING_PEACH_PHYSICS;
if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DISGUISED) { if (gGameStatusPtr->peachFlags & PEACH_FLAG_DISGUISED) {
D_8010C92C = 2; D_8010C92C = 2;
playerStatus->peachDisguise = gGameStatusPtr->peachDisguise; playerStatus->peachDisguise = gGameStatusPtr->peachDisguise;
} }

View File

@ -564,7 +564,7 @@ void peach_force_disguise_action(s32 useParasol) {
set_action_state(ACTION_STATE_USE_SNEAKY_PARASOL); set_action_state(ACTION_STATE_USE_SNEAKY_PARASOL);
} else { } else {
playerStatus->animFlags &= ~PA_FLAG_INVISIBLE; playerStatus->animFlags &= ~PA_FLAG_INVISIBLE;
gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_DISGUISED; gGameStatusPtr->peachFlags &= ~PEACH_FLAG_DISGUISED;
playerStatus->peachDisguise = PEACH_DISGUISE_NONE; playerStatus->peachDisguise = PEACH_DISGUISE_NONE;
free_npc_by_index(PeachDisguiseNpcIndex); free_npc_by_index(PeachDisguiseNpcIndex);
set_action_state(ACTION_STATE_IDLE); set_action_state(ACTION_STATE_IDLE);
@ -582,9 +582,9 @@ void peach_check_for_parasol_input(void) {
if (D_8010C92C != 0) { if (D_8010C92C != 0) {
D_8010C92C--; D_8010C92C--;
if (D_8010C92C == 0) { if (D_8010C92C == 0) {
if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DISGUISED) { if (gGameStatusPtr->peachFlags & PEACH_FLAG_DISGUISED) {
playerStatus->animFlags |= PA_FLAG_INVISIBLE; playerStatus->animFlags |= PA_FLAG_INVISIBLE;
gGameStatusPtr->peachFlags |= PEACH_STATUS_FLAG_DISGUISED; gGameStatusPtr->peachFlags |= PEACH_FLAG_DISGUISED;
disguiseNpc = peach_make_disguise_npc(gGameStatusPtr->peachDisguise); disguiseNpc = peach_make_disguise_npc(gGameStatusPtr->peachDisguise);
if (disguiseNpc != NULL) { if (disguiseNpc != NULL) {
@ -592,7 +592,7 @@ void peach_check_for_parasol_input(void) {
} }
} }
} }
} else if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_HAS_PARASOL && playerStatus->pressedButtons & BUTTON_B) { } else if (gGameStatusPtr->peachFlags & PEACH_FLAG_HAS_PARASOL && playerStatus->pressedButtons & BUTTON_B) {
set_action_state(ACTION_STATE_USE_SNEAKY_PARASOL); set_action_state(ACTION_STATE_USE_SNEAKY_PARASOL);
} }
} }

View File

@ -874,7 +874,7 @@ void appendGfx_animator_node(ModelAnimator* animator, AnimatorNode* node, Matrix
if (!gAnimModelFogEnabled) { if (!gAnimModelFogEnabled) {
gDPSetCombineMode(gMainGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA); gDPSetCombineMode(gMainGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA);
} else { } else {
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, 0, TEXEL0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED); gDPSetCombineMode(gMainGfxPos++, PM_CC_42, PM_CC_18);
} }
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);

View File

@ -37,7 +37,7 @@ void reset_background_settings(void) {
gGameStatusPtr->backgroundFlags &= BACKGROUND_RENDER_STATE_MASK; gGameStatusPtr->backgroundFlags &= BACKGROUND_RENDER_STATE_MASK;
} }
void read_background_size(BackgroundHeader* bg) { void set_background(BackgroundHeader* bg) {
gGameStatusPtr->backgroundMaxX = bg->width; gGameStatusPtr->backgroundMaxX = bg->width;
gGameStatusPtr->backgroundMaxY = bg->height; gGameStatusPtr->backgroundMaxY = bg->height;
gGameStatusPtr->backgroundMinX = bg->startX; gGameStatusPtr->backgroundMinX = bg->startX;
@ -83,66 +83,75 @@ void appendGfx_background_texture(void) {
u8* newvar; u8* newvar;
enum {
BG_BLEND_NONE = 0,
BG_BLEND_HAS_FOG = 1,
BG_BLEND_SHOULD_LERP = 2,
BG_BLEND_SHOULD_BLEND = 4,
};
if (is_world_fog_enabled()) { if (is_world_fog_enabled()) {
get_world_fog_color(&fogR, &fogG, &fogB, &fogA); get_world_fog_color(&fogR, &fogG, &fogB, &fogA);
flags = 1; flags = BG_BLEND_HAS_FOG;
fogA = gGameStatusPtr->backgroundDarkness; fogA = gGameStatusPtr->backgroundDarkness;
} }
switch (*gBackgroundFogModePtr) { switch (*gBackgroundTintModePtr) {
case FOG_MODE_0: case ENV_TINT_NONE:
case FOG_MODE_1: case ENV_TINT_SHROUD:
get_background_color_blend(&r1, &g1, &b1, &a1); mdl_get_shroud_tint_params(&r1, &g1, &b1, &a1);
if (a1 != 0) { if (a1 != 0) {
flags |= 2; flags |= BG_BLEND_SHOULD_LERP;
} }
break; break;
case FOG_MODE_2: case ENV_TINT_DEPTH:
case FOG_MODE_3: case ENV_TINT_REMAP:
default: default:
get_model_env_color_parameters(&r1, &g1, &b1, &r2, &g2, &b2); mdl_get_remap_tint_params(&r1, &g1, &b1, &r2, &g2, &b2);
if (!(r1 == 255 && g1 == 255 && b1 == 255 && r2 == 0 && g2 == 0 && b2 == 0)) { if (!(r1 == 255 && g1 == 255 && b1 == 255 && r2 == 0 && g2 == 0 && b2 == 0)) {
flags |= 4; flags |= BG_BLEND_SHOULD_BLEND;
} }
break; break;
} }
switch (flags) { switch (flags) {
case 0: case BG_BLEND_NONE:
gGameStatusPtr->backgroundFlags &= ~BACKGROUND_FLAG_FOG; gGameStatusPtr->backgroundFlags &= ~BACKGROUND_FLAG_FOG;
break; break;
case 1: case BG_BLEND_HAS_FOG:
gGameStatusPtr->backgroundFlags |= BACKGROUND_FLAG_FOG; gGameStatusPtr->backgroundFlags |= BACKGROUND_FLAG_FOG;
break; break;
case 2: case BG_BLEND_SHOULD_LERP:
gGameStatusPtr->backgroundFlags |= BACKGROUND_FLAG_FOG; gGameStatusPtr->backgroundFlags |= BACKGROUND_FLAG_FOG;
fogR = r1; fogR = r1;
fogG = g1; fogG = g1;
fogB = b1; fogB = b1;
fogA = a1; fogA = a1;
break; break;
case 3: case BG_BLEND_HAS_FOG | BG_BLEND_SHOULD_LERP:
gGameStatusPtr->backgroundFlags |= BACKGROUND_FLAG_FOG; gGameStatusPtr->backgroundFlags |= BACKGROUND_FLAG_FOG;
fogR = (fogR * (255 - a1) + r1 * a1) / 255; fogR = (fogR * (255 - a1) + r1 * a1) / 255;
fogG = (fogG * (255 - a1) + g1 * a1) / 255; fogG = (fogG * (255 - a1) + g1 * a1) / 255;
fogB = (fogB * (255 - a1) + b1 * a1) / 255; fogB = (fogB * (255 - a1) + b1 * a1) / 255;
fogA = (fogA * (255 - a1) + a1 * a1) / 255; fogA = (fogA * (255 - a1) + a1 * a1) / 255;
break; break;
case 4: case BG_BLEND_SHOULD_BLEND:
gGameStatusPtr->backgroundFlags |= BACKGROUND_FLAG_FOG; gGameStatusPtr->backgroundFlags |= BACKGROUND_FLAG_FOG;
break; break;
} }
if (gGameStatusPtr->backgroundFlags & BACKGROUND_FLAG_FOG) { if (gGameStatusPtr->backgroundFlags & BACKGROUND_FLAG_FOG) {
switch (*gBackgroundFogModePtr) { switch (*gBackgroundTintModePtr) {
case FOG_MODE_0: case ENV_TINT_NONE:
case FOG_MODE_1: case ENV_TINT_SHROUD:
if (fogA == 255) { if (fogA == 255) {
for (i = 0; i < ARRAY_COUNT(gBackgroundPalette); i++) { for (i = 0; i < ARRAY_COUNT(gBackgroundPalette); i++) {
gBackgroundPalette[i] = 1; gBackgroundPalette[i] = 1;
} }
} else { } else {
// lerp from background palette color to fog color based on fog alpha
for (i = 0; i < ARRAY_COUNT(gBackgroundPalette); i++) { for (i = 0; i < ARRAY_COUNT(gBackgroundPalette); i++) {
// NOTE: values after UNPACK range from [0,31], so we need to shift fog color into that range
u16 palColor = gGameStatusPtr->backgroundPalette[i]; u16 palColor = gGameStatusPtr->backgroundPalette[i];
blendedB = blend_background_channel(UNPACK_PAL_B(palColor), fogB >> 3, fogA); blendedB = blend_background_channel(UNPACK_PAL_B(palColor), fogB >> 3, fogA);
blendedG = blend_background_channel(UNPACK_PAL_G(palColor), fogG >> 3, fogA); blendedG = blend_background_channel(UNPACK_PAL_G(palColor), fogG >> 3, fogA);
@ -151,14 +160,16 @@ void appendGfx_background_texture(void) {
} }
} }
break; break;
case FOG_MODE_2: case ENV_TINT_DEPTH:
case FOG_MODE_3: case ENV_TINT_REMAP:
default: default:
// the background color channels are remapped from [0,255] -> [min,max]
for (i = 0; i < ARRAY_COUNT(gBackgroundPalette); i++) { for (i = 0; i < ARRAY_COUNT(gBackgroundPalette); i++) {
// NOTE: values after UNPACK range from [0,31], so we need to shift other colors into that range
u16 palColor = gGameStatusPtr->backgroundPalette[i]; u16 palColor = gGameStatusPtr->backgroundPalette[i];
blendedB = (b2 >> 3) + ((UNPACK_PAL_B(palColor) * b1) >> 8); blendedB = (b2 >> 3) + ((UNPACK_PAL_B(palColor) * b1 >> 3) >> 5);
blendedG = (g2 >> 3) + ((UNPACK_PAL_G(palColor) * g1) >> 8); blendedG = (g2 >> 3) + ((UNPACK_PAL_G(palColor) * g1 >> 3) >> 5);
blendedR = (r2 >> 3) + ((UNPACK_PAL_R(palColor) * r1) >> 8); blendedR = (r2 >> 3) + ((UNPACK_PAL_R(palColor) * r1 >> 3) >> 5);
if (blendedB > 0x1F) { if (blendedB > 0x1F) {
blendedB = 0x1F; blendedB = 0x1F;
@ -295,9 +306,6 @@ void appendGfx_background_texture(void) {
} }
} }
// TODO figure out why it is needed
static const f32 rodata_padding[] = { 0.0f, 0.0f };
void enable_background_wave(void) { void enable_background_wave(void) {
gBackroundWaveEnabled = TRUE; gBackroundWaveEnabled = TRUE;
} }
@ -305,3 +313,6 @@ void enable_background_wave(void) {
void disable_background_wave(void) { void disable_background_wave(void) {
gBackroundWaveEnabled = FALSE; gBackroundWaveEnabled = FALSE;
} }
// TODO figure out why it is needed
static const f32 rodata_padding[] = { 0.0f, 0.0f };

View File

@ -363,7 +363,7 @@ void gfx_draw_background(void) {
// @bug In 1-cycle mode, the two combiner cycles should be identical. Using Texel1 here in the second cycle, // @bug In 1-cycle mode, the two combiner cycles should be identical. Using Texel1 here in the second cycle,
// which is the actual cycle of the combiner used on hardware in 1-cycle mode, actually samples the next // which is the actual cycle of the combiner used on hardware in 1-cycle mode, actually samples the next
// pixel's texel value instead of the current pixel's. This results in a one-pixel offset. // pixel's texel value instead of the current pixel's. This results in a one-pixel offset.
gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, 1, PRIMITIVE, TEXEL1, PRIMITIVE_ALPHA, TEXEL1, 0, 0, 0, 1); gDPSetCombineMode(gMainGfxPos++, PM_CC_43, PM_CC_44);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 40, 40, 40, gPauseBackgroundFade); gDPSetPrimColor(gMainGfxPos++, 0, 0, 40, 40, 40, gPauseBackgroundFade);
gDPSetTextureFilter(gMainGfxPos++, G_TF_POINT); gDPSetTextureFilter(gMainGfxPos++, G_TF_POINT);

View File

@ -190,7 +190,7 @@ void initialize_battle(void) {
battleStatus->tattleFlags[i] = 0; battleStatus->tattleFlags[i] = 0;
} }
if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) { if (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH) {
gBattleStatus.flags2 |= BS_FLAGS2_PEACH_BATTLE; gBattleStatus.flags2 |= BS_FLAGS2_PEACH_BATTLE;
increment_status_bar_disabled(); increment_status_bar_disabled();
} else { } else {
@ -737,7 +737,7 @@ void tattle_cam_pre_render(Camera* camera) {
fogEnabled = TRUE; fogEnabled = TRUE;
get_world_fog_color(&fogR, &fogG, &fogB, &fogA); get_world_fog_color(&fogR, &fogG, &fogB, &fogA);
fogA = gGameStatusPtr->backgroundDarkness; fogA = gGameStatusPtr->backgroundDarkness;
get_background_color_blend(&r1, &g1, &b1, &a1); mdl_get_shroud_tint_params(&r1, &g1, &b1, &a1);
if (fogA == 255) { if (fogA == 255) {
for (i = 0; i < ARRAY_COUNT(gTattleBgPalette); i++) { for (i = 0; i < ARRAY_COUNT(gTattleBgPalette); i++) {
gTattleBgPalette[i] = 1; gTattleBgPalette[i] = 1;

View File

@ -991,7 +991,7 @@ s32 count_power_plus(s32 damageType) {
s32 count; s32 count;
s32 i; s32 i;
if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) { if (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH) {
return 0; return 0;
} }
@ -2998,7 +2998,7 @@ void btl_appendGfx_prim_quad(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u16 righ
if (a == 255) { if (a == 255) {
gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08); gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_FULL_ALPHA, PM_CC_PRIM_FULL_ALPHA);
} else { } else {
gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2); gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);

View File

@ -69,7 +69,7 @@ enum N(AnimState) {
#include "common/StartRumbleWithParams.inc.c" #include "common/StartRumbleWithParams.inc.c"
#include "world/common/atomic/UnkFunc27.inc.c" #include "world/common/atomic/ApplyTint.inc.c"
s32 N(BowserDefense)[] = { s32 N(BowserDefense)[] = {
ELEMENT_NORMAL, 1, ELEMENT_NORMAL, 1,
@ -1217,51 +1217,51 @@ EvtScript N(EVS_FakeBowser_Idle) = {
EVT_CALL(RotateGroup, MODEL_atama, LVar0, 1, 0, 0) EVT_CALL(RotateGroup, MODEL_atama, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_atama, LVar1, 0, 1, 0) EVT_CALL(RotateGroup, MODEL_atama, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_atama, LVar2, 0, 0, 1) EVT_CALL(RotateGroup, MODEL_atama, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_k1, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_k1, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_k2, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_k2, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_k3, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_k3, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_k4, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_k4, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_k5, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_k5, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_k6, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_k6, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_k7, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_k7, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_k8, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_k8, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_k9, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_k9, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_BODY, LVar0, LVar1, LVar2) EVT_CALL(GetPartPos, ACTOR_SELF, PRT_BODY, LVar0, LVar1, LVar2)
EVT_CALL(TranslateGroup, MODEL_dou, LVar0, LVar1, LVar2) EVT_CALL(TranslateGroup, MODEL_dou, LVar0, LVar1, LVar2)
EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_BODY, LVar0, LVar1, LVar2) EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_BODY, LVar0, LVar1, LVar2)
EVT_CALL(RotateGroup, MODEL_dou, LVar0, 1, 0, 0) EVT_CALL(RotateGroup, MODEL_dou, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_dou, LVar1, 0, 1, 0) EVT_CALL(RotateGroup, MODEL_dou, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_dou, LVar2, 0, 0, 1) EVT_CALL(RotateGroup, MODEL_dou, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_d1, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_d1, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_d2, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_d2, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_d3, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_d3, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_SHELL, LVar0, LVar1, LVar2) EVT_CALL(GetPartPos, ACTOR_SELF, PRT_SHELL, LVar0, LVar1, LVar2)
EVT_CALL(TranslateGroup, MODEL_koura, LVar0, LVar1, LVar2) EVT_CALL(TranslateGroup, MODEL_koura, LVar0, LVar1, LVar2)
EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_SHELL, LVar0, LVar1, LVar2) EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_SHELL, LVar0, LVar1, LVar2)
EVT_CALL(RotateGroup, MODEL_koura, LVar0, 1, 0, 0) EVT_CALL(RotateGroup, MODEL_koura, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_koura, LVar1, 0, 1, 0) EVT_CALL(RotateGroup, MODEL_koura, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_koura, LVar2, 0, 0, 1) EVT_CALL(RotateGroup, MODEL_koura, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_s1, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_s1, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_s2, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_s2, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_s3, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_s3, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_s4, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_s4, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_s5, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_s5, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_LEFT_ARM, LVar0, LVar1, LVar2) EVT_CALL(GetPartPos, ACTOR_SELF, PRT_LEFT_ARM, LVar0, LVar1, LVar2)
EVT_CALL(TranslateGroup, MODEL_left_arm, LVar0, LVar1, LVar2) EVT_CALL(TranslateGroup, MODEL_left_arm, LVar0, LVar1, LVar2)
EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_LEFT_ARM, LVar0, LVar1, LVar2) EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_LEFT_ARM, LVar0, LVar1, LVar2)
EVT_CALL(RotateGroup, MODEL_left_arm, LVar0, 1, 0, 0) EVT_CALL(RotateGroup, MODEL_left_arm, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_left_arm, LVar1, 0, 1, 0) EVT_CALL(RotateGroup, MODEL_left_arm, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_left_arm, LVar2, 0, 0, 1) EVT_CALL(RotateGroup, MODEL_left_arm, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_u1, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_u1, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_u2, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_u2, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_u3, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_u3, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_TAIL, LVar0, LVar1, LVar2) EVT_CALL(GetPartPos, ACTOR_SELF, PRT_TAIL, LVar0, LVar1, LVar2)
EVT_CALL(TranslateGroup, MODEL_shippo, LVar0, LVar1, LVar2) EVT_CALL(TranslateGroup, MODEL_shippo, LVar0, LVar1, LVar2)
EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_TAIL, LVar0, LVar1, LVar2) EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_TAIL, LVar0, LVar1, LVar2)
EVT_CALL(RotateGroup, MODEL_shippo, LVar0, 1, 0, 0) EVT_CALL(RotateGroup, MODEL_shippo, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_shippo, LVar1, 0, 1, 0) EVT_CALL(RotateGroup, MODEL_shippo, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_shippo, LVar2, 0, 0, 1) EVT_CALL(RotateGroup, MODEL_shippo, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_p1, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_p1, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_SET(LVar0, ArrayVar(0)) EVT_SET(LVar0, ArrayVar(0))
EVT_IF_EQ(LVar0, ANIM_DOING_DEATH) EVT_IF_EQ(LVar0, ANIM_DOING_DEATH)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_FRONT_WHEELS, LVar0, LVar1, LVar2) EVT_CALL(GetPartPos, ACTOR_SELF, PRT_FRONT_WHEELS, LVar0, LVar1, LVar2)
@ -1275,7 +1275,7 @@ EvtScript N(EVS_FakeBowser_Idle) = {
EVT_CALL(RotateGroup, MODEL_koma1, LVar0, 1, 0, 0) EVT_CALL(RotateGroup, MODEL_koma1, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_koma1, LVar1, 0, 1, 0) EVT_CALL(RotateGroup, MODEL_koma1, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_koma1, LVar2, 0, 0, 1) EVT_CALL(RotateGroup, MODEL_koma1, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_km1, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_km1, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_SET(LVar0, ArrayVar(0)) EVT_SET(LVar0, ArrayVar(0))
EVT_IF_EQ(LVar0, ANIM_DOING_DEATH) EVT_IF_EQ(LVar0, ANIM_DOING_DEATH)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_BACK_WHEELS, LVar0, LVar1, LVar2) EVT_CALL(GetPartPos, ACTOR_SELF, PRT_BACK_WHEELS, LVar0, LVar1, LVar2)
@ -1289,25 +1289,25 @@ EvtScript N(EVS_FakeBowser_Idle) = {
EVT_CALL(RotateGroup, MODEL_koma2, LVar0, 1, 0, 0) EVT_CALL(RotateGroup, MODEL_koma2, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_koma2, LVar1, 0, 1, 0) EVT_CALL(RotateGroup, MODEL_koma2, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_koma2, LVar2, 0, 0, 1) EVT_CALL(RotateGroup, MODEL_koma2, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_km2, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_km2, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_RIGHT_ARM, LVar0, LVar1, LVar2) EVT_CALL(GetPartPos, ACTOR_SELF, PRT_RIGHT_ARM, LVar0, LVar1, LVar2)
EVT_CALL(TranslateGroup, MODEL_right_arm, LVar0, LVar1, LVar2) EVT_CALL(TranslateGroup, MODEL_right_arm, LVar0, LVar1, LVar2)
EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_RIGHT_ARM, LVar0, LVar1, LVar2) EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_RIGHT_ARM, LVar0, LVar1, LVar2)
EVT_CALL(RotateGroup, MODEL_right_arm, LVar0, 1, 0, 0) EVT_CALL(RotateGroup, MODEL_right_arm, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_right_arm, LVar1, 0, 1, 0) EVT_CALL(RotateGroup, MODEL_right_arm, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_right_arm, LVar2, 0, 0, 1) EVT_CALL(RotateGroup, MODEL_right_arm, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_o171, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_o171, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_o172, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_o172, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_o183, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_o183, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(GetPartPos, ACTOR_SELF, PRT_FEET, LVar0, LVar1, LVar2) EVT_CALL(GetPartPos, ACTOR_SELF, PRT_FEET, LVar0, LVar1, LVar2)
EVT_CALL(TranslateGroup, MODEL_ashi, LVar0, LVar1, LVar2) EVT_CALL(TranslateGroup, MODEL_ashi, LVar0, LVar1, LVar2)
EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_FEET, LVar0, LVar1, LVar2) EVT_CALL(GetPartRotation, ACTOR_SELF, PRT_FEET, LVar0, LVar1, LVar2)
EVT_CALL(RotateGroup, MODEL_ashi, LVar0, 1, 0, 0) EVT_CALL(RotateGroup, MODEL_ashi, LVar0, 1, 0, 0)
EVT_CALL(RotateGroup, MODEL_ashi, LVar1, 0, 1, 0) EVT_CALL(RotateGroup, MODEL_ashi, LVar1, 0, 1, 0)
EVT_CALL(RotateGroup, MODEL_ashi, LVar2, 0, 0, 1) EVT_CALL(RotateGroup, MODEL_ashi, LVar2, 0, 0, 1)
EVT_CALL(SetModelFlags, MODEL_o118, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_o118, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_o120, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_o120, MODEL_FLAG_IGNORE_FOG, TRUE)
EVT_CALL(SetModelFlags, MODEL_o165, MODEL_FLAG_40, TRUE) EVT_CALL(SetModelFlags, MODEL_o165, MODEL_FLAG_IGNORE_FOG, TRUE)
// spawn puffs of smoke if health is low enough // spawn puffs of smoke if health is low enough
// written to have different effects at every quintile, but every case in the final // written to have different effects at every quintile, but every case in the final
// version just executes the same script // version just executes the same script
@ -1409,13 +1409,13 @@ EvtScript N(EVS_FakeBowser_HandleEvent) = {
EVT_CASE_OR_EQ(EVENT_BURN_DEATH) EVT_CASE_OR_EQ(EVENT_BURN_DEATH)
EVT_CALL(HideHealthBar, ACTOR_SELF) EVT_CALL(HideHealthBar, ACTOR_SELF)
EVT_IF_EQ(LVar0, EVENT_BURN_DEATH) EVT_IF_EQ(LVar0, EVENT_BURN_DEATH)
EVT_CALL(N(UnkFunc27), 0, EVT_PTR(N(BowserModels)), FOG_MODE_3) EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, EVT_PTR(N(BowserModels)), ENV_TINT_REMAP)
EVT_CALL(N(UnkFunc26), 3, 35, 35, 35, 0, 0, 0, 0, 0, 0) EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 35, 35, 35, 0, 0, 0, 0, 0, 0)
EVT_END_IF EVT_END_IF
EVT_SET(ArrayVar(0), ANIM_BEGIN_HURT) EVT_SET(ArrayVar(0), ANIM_BEGIN_HURT)
EVT_WAIT(20) EVT_WAIT(20)
EVT_IF_EQ(LVar0, EVENT_BURN_DEATH) EVT_IF_EQ(LVar0, EVENT_BURN_DEATH)
EVT_CALL(N(UnkFunc27), 0, EVT_PTR(N(BowserModels)), FOG_MODE_0) EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, EVT_PTR(N(BowserModels)), ENV_TINT_NONE)
EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4) EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4)
EVT_DIVF(LVar3, EVT_FLOAT(2.0)) EVT_DIVF(LVar3, EVT_FLOAT(2.0))
@ -1443,12 +1443,12 @@ EvtScript N(EVS_FakeBowser_HandleEvent) = {
EVT_END_CASE_GROUP EVT_END_CASE_GROUP
EVT_CASE_OR_EQ(EVENT_BURN_CONTACT) EVT_CASE_OR_EQ(EVENT_BURN_CONTACT)
EVT_CASE_OR_EQ(EVENT_BURN_HIT) EVT_CASE_OR_EQ(EVENT_BURN_HIT)
EVT_CALL(N(UnkFunc27), 0, EVT_PTR(N(BowserModels)), FOG_MODE_3) EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, EVT_PTR(N(BowserModels)), ENV_TINT_REMAP)
EVT_CALL(N(UnkFunc26), 3, 35, 35, 35, 0, 0, 0, 0, 0, 0) EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 35, 35, 35, 0, 0, 0, 0, 0, 0)
EVT_SET(ArrayVar(0), ANIM_BEGIN_HURT) EVT_SET(ArrayVar(0), ANIM_BEGIN_HURT)
EVT_WAIT(20) EVT_WAIT(20)
EVT_SET(ArrayVar(0), ANIM_BEGIN_IDLE) EVT_SET(ArrayVar(0), ANIM_BEGIN_IDLE)
EVT_CALL(N(UnkFunc27), 0, EVT_PTR(N(BowserModels)), FOG_MODE_0) EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, EVT_PTR(N(BowserModels)), ENV_TINT_NONE)
EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) EVT_CALL(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4) EVT_CALL(GetActorSize, ACTOR_SELF, LVar3, LVar4)
EVT_DIVF(LVar3, EVT_FLOAT(2.0)) EVT_DIVF(LVar3, EVT_FLOAT(2.0))

View File

@ -236,7 +236,7 @@ void btl_state_update_normal_start(void) {
if (stage->bg != NULL) { if (stage->bg != NULL) {
load_map_bg(stage->bg); load_map_bg(stage->bg);
read_background_size(&gBackgroundImage); set_background(&gBackgroundImage);
} }
if (gGameStatusPtr->demoBattleFlags & DEMO_BTL_FLAG_ENABLED) { if (gGameStatusPtr->demoBattleFlags & DEMO_BTL_FLAG_ENABLED) {

View File

@ -520,11 +520,11 @@ API_CALLABLE(N(unkStarBeamBgFunc)) {
script->functionTemp[0] = 230; script->functionTemp[0] = 230;
} }
set_background_color_blend(0, 0, 0, script->functionTemp[0]); mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]);
script->functionTemp[0] -= 5; script->functionTemp[0] -= 5;
if (script->functionTemp[0] <= 200) { if (script->functionTemp[0] <= 200) {
set_background_color_blend(0, 0, 0, 200); mdl_set_shroud_tint_params(0, 0, 0, 200);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -48,17 +48,17 @@ API_CALLABLE(N(SpawnStarSpiritDepartFX)) {
API_CALLABLE(N(FadeBackgroundDarkenForBeam)) { API_CALLABLE(N(FadeBackgroundDarkenForBeam)) {
if (isInitialCall) { if (isInitialCall) {
mdl_set_all_fog_mode(FOG_MODE_1); mdl_set_all_tint_type(ENV_TINT_SHROUD);
*gBackgroundFogModePtr = FOG_MODE_1; *gBackgroundTintModePtr = ENV_TINT_SHROUD;
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
} }
set_background_color_blend(0, 0, 0, script->functionTemp[0]); mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]);
script->functionTemp[0] += 10; script->functionTemp[0] += 10;
if (script->functionTemp[0] >= 230) { if (script->functionTemp[0] >= 230) {
set_background_color_blend(0, 0, 0, 230); mdl_set_shroud_tint_params(0, 0, 0, 230);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -107,52 +107,52 @@ EvtScript N(EVS_PreBattle) = {
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o345, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o345, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(build_gfx_yellow_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(build_gfx_yellow_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o345, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o345, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o345, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o345, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_o338, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_o338, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(build_gfx_yellow_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(build_gfx_yellow_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o338, CUSTOM_GFX_2, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o338, CUSTOM_GFX_2, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o338, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o338, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_2, MODEL_o344, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_2, MODEL_o344, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_3, EVT_PTR(N(build_gfx_yellow_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_3, EVT_PTR(N(build_gfx_yellow_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o344, CUSTOM_GFX_3, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o344, CUSTOM_GFX_3, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o344, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o344, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_3, MODEL_o354, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_3, MODEL_o354, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_4, EVT_PTR(N(build_gfx_yellow_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_4, EVT_PTR(N(build_gfx_yellow_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o354, CUSTOM_GFX_4, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o354, CUSTOM_GFX_4, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o354, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o354, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_4, MODEL_o341, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_4, MODEL_o341, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_5, EVT_PTR(N(build_gfx_yellow_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_5, EVT_PTR(N(build_gfx_yellow_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o341, CUSTOM_GFX_5, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o341, CUSTOM_GFX_5, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o341, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o341, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_5, MODEL_o352, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_5, MODEL_o352, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_6, EVT_PTR(N(build_gfx_blue_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_6, EVT_PTR(N(build_gfx_blue_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o352, CUSTOM_GFX_6, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o352, CUSTOM_GFX_6, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o352, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o352, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_6, MODEL_o346, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_6, MODEL_o346, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_7, EVT_PTR(N(build_gfx_blue_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_7, EVT_PTR(N(build_gfx_blue_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o346, CUSTOM_GFX_7, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o346, CUSTOM_GFX_7, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o346, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o346, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_7, MODEL_o349, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_7, MODEL_o349, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_8, EVT_PTR(N(build_gfx_green_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_8, EVT_PTR(N(build_gfx_green_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o349, CUSTOM_GFX_8, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o349, CUSTOM_GFX_8, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o349, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o349, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_8, MODEL_o353, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_8, MODEL_o353, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_9, EVT_PTR(N(build_gfx_green_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_9, EVT_PTR(N(build_gfx_green_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o353, CUSTOM_GFX_9, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o353, CUSTOM_GFX_9, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o353, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o353, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_9, MODEL_o347, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_9, MODEL_o347, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_A, EVT_PTR(N(build_gfx_pink_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_A, EVT_PTR(N(build_gfx_pink_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o347, CUSTOM_GFX_A, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o347, CUSTOM_GFX_A, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o347, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o347, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_THREAD EVT_THREAD

View File

@ -625,9 +625,9 @@ void btl_state_update_celebration(void) {
LevelUpScriptID = LevelUpScriptPtr->id; LevelUpScriptID = LevelUpScriptPtr->id;
CelebrateSubstateTime = 25; CelebrateSubstateTime = 25;
gBattleSubState = BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CREATE_HUD; gBattleSubState = BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CREATE_HUD;
mdl_set_all_fog_mode(FOG_MODE_1); mdl_set_all_tint_type(ENV_TINT_SHROUD);
*gBackgroundFogModePtr = FOG_MODE_1; *gBackgroundTintModePtr = ENV_TINT_SHROUD;
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
break; break;
case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CREATE_HUD: case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CREATE_HUD:
if (CelebrateSubstateTime == 18) { if (CelebrateSubstateTime == 18) {
@ -647,7 +647,7 @@ void btl_state_update_celebration(void) {
if (CelebrateSubstateTime != 0) { if (CelebrateSubstateTime != 0) {
CelebrateSubstateTime--; CelebrateSubstateTime--;
if (CelebrateSubstateTime < 10) { if (CelebrateSubstateTime < 10) {
set_background_color_blend(0, 0, 0, ((10 - CelebrateSubstateTime) * 16) & 0xF0); mdl_set_shroud_tint_params(0, 0, 0, ((10 - CelebrateSubstateTime) * 16) & 0xF0);
} }
} else { } else {
id = hud_element_create(&HES_level_up_heart); id = hud_element_create(&HES_level_up_heart);
@ -1115,7 +1115,7 @@ void btl_state_update_celebration(void) {
} }
hud_element_free(LevelUpSelectTextID); hud_element_free(LevelUpSelectTextID);
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
btl_set_state(BATTLE_STATE_END_BATTLE); btl_set_state(BATTLE_STATE_END_BATTLE);
gBattleSubState = BTL_SUBSTATE_END_BATTLE_EXEC_STAGE_SCRIPT; gBattleSubState = BTL_SUBSTATE_END_BATTLE_EXEC_STAGE_SCRIPT;
break; break;

View File

@ -42,13 +42,13 @@ API_CALLABLE(N(SpawnDamageStarsFX)) {
API_CALLABLE(N(CustomFadeBackgroundDarken)) { API_CALLABLE(N(CustomFadeBackgroundDarken)) {
if (isInitialCall) { if (isInitialCall) {
mdl_set_all_fog_mode(FOG_MODE_1); mdl_set_all_tint_type(ENV_TINT_SHROUD);
*gBackgroundFogModePtr = FOG_MODE_1; *gBackgroundTintModePtr = ENV_TINT_SHROUD;
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
script->functionTemp[0] = 10; script->functionTemp[0] = 10;
} }
set_background_color_blend(0, 0, 0, ((10 - script->functionTemp[0]) * 16) & 240); mdl_set_shroud_tint_params(0, 0, 0, ((10 - script->functionTemp[0]) * 16) & 240);
script->functionTemp[0]--; script->functionTemp[0]--;
if (script->functionTemp[0] == 0) { if (script->functionTemp[0] == 0) {
@ -62,11 +62,11 @@ API_CALLABLE(N(CustomFadeBackgroundLighten)) {
if (isInitialCall) { if (isInitialCall) {
script->functionTemp[0] = 10; script->functionTemp[0] = 10;
} }
set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 16) & 240); mdl_set_shroud_tint_params(0, 0, 0, (script->functionTemp[0] * 16) & 240);
script->functionTemp[0]--; script->functionTemp[0]--;
if (script->functionTemp[0] == 0) { if (script->functionTemp[0] == 0) {
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
return ApiStatus_BLOCK; return ApiStatus_BLOCK;

View File

@ -13,17 +13,17 @@ extern EntityModelScript EMS_StarIcon;
API_CALLABLE(N(DarkenBackground)) { API_CALLABLE(N(DarkenBackground)) {
if (isInitialCall) { if (isInitialCall) {
mdl_set_all_fog_mode(FOG_MODE_1); mdl_set_all_tint_type(ENV_TINT_SHROUD);
*gBackgroundFogModePtr = FOG_MODE_1; *gBackgroundTintModePtr = ENV_TINT_SHROUD;
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
script->functionTemp[0] = 200; script->functionTemp[0] = 200;
} }
set_background_color_blend(0, 0, 0, script->functionTemp[0]); mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]);
script->functionTemp[0] += 2; script->functionTemp[0] += 2;
if (script->functionTemp[0] >= 254) { if (script->functionTemp[0] >= 254) {
set_background_color_blend(0, 0, 0, 254); mdl_set_shroud_tint_params(0, 0, 0, 254);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -35,11 +35,11 @@ API_CALLABLE(N(RestoreBackground)) {
script->functionTemp[0] = 254; script->functionTemp[0] = 254;
} }
set_background_color_blend(0, 0, 0, script->functionTemp[0]); mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]);
script->functionTemp[0] -= 5; script->functionTemp[0] -= 5;
if (script->functionTemp[0] <= 200) { if (script->functionTemp[0] <= 200) {
set_background_color_blend(0, 0, 0, 200); mdl_set_shroud_tint_params(0, 0, 0, 200);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -228,13 +228,13 @@ API_CALLABLE(GiveRefundCleanup) {
API_CALLABLE(LifeShroomShroudWorld) { API_CALLABLE(LifeShroomShroudWorld) {
if (isInitialCall) { if (isInitialCall) {
mdl_set_all_fog_mode(FOG_MODE_1); mdl_set_all_tint_type(ENV_TINT_SHROUD);
*gBackgroundFogModePtr = FOG_MODE_1; *gBackgroundTintModePtr = ENV_TINT_SHROUD;
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
script->functionTemp[0] = 20; script->functionTemp[0] = 20;
} }
set_background_color_blend(0, 0, 0, ((20 - script->functionTemp[0]) * 12) & 0xFC); mdl_set_shroud_tint_params(0, 0, 0, ((20 - script->functionTemp[0]) * 12) & 0xFC);
script->functionTemp[0] -= 1; script->functionTemp[0] -= 1;
@ -251,11 +251,11 @@ API_CALLABLE(LifeShroomRevealWorld) {
btl_cam_unfreeze(); btl_cam_unfreeze();
} }
set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 12) & 0xFC); mdl_set_shroud_tint_params(0, 0, 0, (script->functionTemp[0] * 12) & 0xFC);
script->functionTemp[0] -= 1; script->functionTemp[0] -= 1;
if (script->functionTemp[0] == 0) { if (script->functionTemp[0] == 0) {
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -343,13 +343,13 @@ API_CALLABLE(PlayBattleMerleeOrbFX) {
API_CALLABLE(BattleMerleeFadeStageToBlack) { API_CALLABLE(BattleMerleeFadeStageToBlack) {
if (isInitialCall) { if (isInitialCall) {
mdl_set_all_fog_mode(FOG_MODE_1); mdl_set_all_tint_type(ENV_TINT_SHROUD);
*gBackgroundFogModePtr = FOG_MODE_1; *gBackgroundTintModePtr = ENV_TINT_SHROUD;
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
script->functionTemp[0] = 25; script->functionTemp[0] = 25;
} }
set_background_color_blend(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 254); mdl_set_shroud_tint_params(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 254);
script->functionTemp[0]--; script->functionTemp[0]--;
if (script->functionTemp[0] == 0) { if (script->functionTemp[0] == 0) {
@ -364,11 +364,11 @@ API_CALLABLE(BattleMerleeFadeStageFromBlack) {
script->functionTemp[0] = 25; script->functionTemp[0] = 25;
} }
set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 0xFF); mdl_set_shroud_tint_params(0, 0, 0, (script->functionTemp[0] * 10) & 0xFF);
script->functionTemp[0] -= 5; script->functionTemp[0] -= 5;
if (script->functionTemp[0] == 0) { if (script->functionTemp[0] == 0) {
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -404,7 +404,7 @@ void btl_bonk_update(void* data) {
if (message->unk_24 != 0) { if (message->unk_24 != 0) {
message->unk_24--; message->unk_24--;
if (message->unk_24 == 0) { if (message->unk_24 == 0) {
clear_entity_model_flags(modelIdx, MODEL_FLAG_20); clear_entity_model_flags(modelIdx, ENTITY_MODEL_FLAG_HIDDEN);
} }
exec_entity_model_commandlist(modelIdx); exec_entity_model_commandlist(modelIdx);
break; break;

View File

@ -4,13 +4,13 @@
API_CALLABLE(N(FadeBackgroundDarken)) { API_CALLABLE(N(FadeBackgroundDarken)) {
if (isInitialCall) { if (isInitialCall) {
mdl_set_all_fog_mode(FOG_MODE_1); mdl_set_all_tint_type(ENV_TINT_SHROUD);
*gBackgroundFogModePtr = FOG_MODE_1; *gBackgroundTintModePtr = ENV_TINT_SHROUD;
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
script->functionTemp[0] = 20; script->functionTemp[0] = 20;
} }
set_background_color_blend(0, 0, 0, ((20 - script->functionTemp[0]) * 10) & 254); mdl_set_shroud_tint_params(0, 0, 0, ((20 - script->functionTemp[0]) * 10) & 254);
script->functionTemp[0]--; script->functionTemp[0]--;
if (script->functionTemp[0] == 0) { if (script->functionTemp[0] == 0) {

View File

@ -7,11 +7,11 @@ API_CALLABLE(N(FadeBackgroundLighten)) {
script->functionTemp[0] = 20; script->functionTemp[0] = 20;
} }
set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 254); mdl_set_shroud_tint_params(0, 0, 0, (script->functionTemp[0] * 10) & 254);
script->functionTemp[0]--; script->functionTemp[0]--;
if (script->functionTemp[0] == 0) { if (script->functionTemp[0] == 0) {
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
return ApiStatus_BLOCK; return ApiStatus_BLOCK;

View File

@ -4,6 +4,6 @@
API_CALLABLE(N(SetBackgroundAlpha)) { API_CALLABLE(N(SetBackgroundAlpha)) {
Bytecode* args = script->ptrReadPos; Bytecode* args = script->ptrReadPos;
set_background_color_blend(0, 0, 0, evt_get_variable(script, *args++)); mdl_set_shroud_tint_params(0, 0, 0, evt_get_variable(script, *args++));
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -2,8 +2,8 @@
#include "model.h" #include "model.h"
API_CALLABLE(N(UnkBackgroundFunc3)) { API_CALLABLE(N(UnkBackgroundFunc3)) {
mdl_set_all_fog_mode(FOG_MODE_1); mdl_set_all_tint_type(ENV_TINT_SHROUD);
*gBackgroundFogModePtr = FOG_MODE_1; *gBackgroundTintModePtr = ENV_TINT_SHROUD;
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -61,7 +61,7 @@ Gfx TheaterWallShadowsGfx[] = {
Gfx TheaterCurtainGfx[] = { Gfx TheaterCurtainGfx[] = {
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetRenderMode(G_RM_PASS, G_RM_XLU_SURF2), gsDPSetRenderMode(G_RM_PASS, G_RM_XLU_SURF2),
gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED), gsDPSetCombineMode(G_CC_MODULATEIDECALA, PM_CC_16),
gsSPDisplayList(D_80075730), gsSPDisplayList(D_80075730),
gsSPVertex(theater_curtain_vtx, 31, 0), gsSPVertex(theater_curtain_vtx, 31, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
@ -80,7 +80,7 @@ Gfx TheaterCurtainGfx[] = {
Gfx TheaterInsetShadowsGfx[] = { Gfx TheaterInsetShadowsGfx[] = {
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetRenderMode(G_RM_PASS, G_RM_XLU_SURF2), gsDPSetRenderMode(G_RM_PASS, G_RM_XLU_SURF2),
gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, SHADE, COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED), gsDPSetCombineMode(G_CC_SHADE, PM_CC_16),
gsSPTexture(0x0080, 0x0080, 0, G_TX_RENDERTILE, G_OFF), gsSPTexture(0x0080, 0x0080, 0, G_TX_RENDERTILE, G_OFF),
gsSPVertex(theater_left_inset_shadow_vtx, 4, 0), gsSPVertex(theater_left_inset_shadow_vtx, 4, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),

View File

@ -436,7 +436,7 @@ s32 draw_box(s32 flags, WindowStyle windowStyle, s32 posX, s32 posY, s32 posZ, s
gDPSetCycleType(gMainGfxPos++, G_CYC_2CYCLE); gDPSetCycleType(gMainGfxPos++, G_CYC_2CYCLE);
gDPSetBlendColor(gMainGfxPos++, 0, 0, 0, 0); gDPSetBlendColor(gMainGfxPos++, 0, 0, 0, 0);
gDPSetFogColor(gMainGfxPos++, 0, 0, 0, darkening); gDPSetFogColor(gMainGfxPos++, 0, 0, 0, darkening);
gDPSetRenderMode(gMainGfxPos++, GBL_c1(G_BL_CLR_BL, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA), G_RM_XLU_SURF2); gDPSetRenderMode(gMainGfxPos++, PM_RM_TILEMODE_B, G_RM_XLU_SURF2);
if (!(flags & DRAW_FLAG_NO_CLIP)) { if (!(flags & DRAW_FLAG_NO_CLIP)) {
gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
} }

View File

@ -36,5 +36,5 @@
- shim_draw_box - shim_draw_box
- shim_draw_msg - shim_draw_msg
- shim_get_msg_width - shim_get_msg_width
- shim_get_background_color_blend - shim_mdl_get_shroud_tint_params
- shim_sfx_play_sound_at_position - shim_sfx_play_sound_at_position

View File

@ -290,13 +290,13 @@ void confetti_appendGfx(void* effect) {
switch ((unk_24 + i) % 3) { switch ((unk_24 + i) % 3) {
case 0: case 0:
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, PRIMITIVE, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, ENVIRONMENT, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_45, PM_CC_46);
break; break;
case 1: case 1:
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, PRIMITIVE, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_45, PM_CC_45);
break; break;
case 2: case 2:
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, PRIMITIVE, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_45, PM_CC_47);
break; break;
} }
uly = ((i + D_E0088D00[unk_24 % 6]) & 0xF) * 16; uly = ((i + D_E0088D00[unk_24 % 6]) & 0xF) * 16;

View File

@ -217,10 +217,10 @@ void damage_indicator_render_impl(EffectInstance* effect) {
if (part->alpha == 255) { if (part->alpha == 255) {
gDPSetRenderMode(gMainGfxPos++, G_RM_AA_TEX_EDGE, G_RM_AA_TEX_EDGE2); gDPSetRenderMode(gMainGfxPos++, G_RM_AA_TEX_EDGE, G_RM_AA_TEX_EDGE2);
gDPSetCombineLERP(gMainGfxPos++, 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0, 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_DAMAGE_INDICATOR, PM_CC_DAMAGE_INDICATOR);
} else { } else {
gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2); gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
gDPSetCombineLERP(gMainGfxPos++, 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0, 1, 0, SHADE, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_DAMAGE_INDICATOR, PM_CC_DAMAGE_INDICATOR);
} }
for(i = 1; i < effect->numParts; i++, part--) { for(i = 1; i < effect->numParts; i++, part--) {

View File

@ -248,7 +248,7 @@ void func_E00826C4(DisableXFXData* data) {
gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
} else { } else {
gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2); gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_49, PM_CC_49);
} }
} }

View File

@ -1,7 +1,8 @@
#include "common.h" #include "common.h"
#include "effects_internal.h" #include "effects_internal.h"
#define MAX_POINTS (30) #define MAX_POINTS 30
#define VTX_BUF_SIZE 2 * MAX_POINTS * sizeof(Vtx) / sizeof(Gfx)
void effect_65_init(EffectInstance* effect); void effect_65_init(EffectInstance* effect);
void effect_65_update(EffectInstance* effect); void effect_65_update(EffectInstance* effect);
@ -256,17 +257,20 @@ void effect_65_appendGfx(void* effect) {
gSPDisplayList(gMainGfxPos++, D_E00CACB0[variation]); gSPDisplayList(gMainGfxPos++, D_E00CACB0[variation]);
if (variation >= 2) { if (variation >= 2) {
gDPSetCombineLERP(gMainGfxPos++, SHADE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, COMBINED, COMBINED, 0, PRIMITIVE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_4E, PM_CC_4F);
} }
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primR, data->primG, data->primB, primAlpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primR, data->primG, data->primB, primAlpha);
gDPSetEnvColor(gMainGfxPos++, data->envR, data->envG, data->envB, 0); gDPSetEnvColor(gMainGfxPos++, data->envR, data->envG, data->envB, 0);
gSPBranchList(gMainGfxPos, gMainGfxPos + 0x79); gSPBranchList(gMainGfxPos, gMainGfxPos + 1 + VTX_BUF_SIZE);
gMainGfxPos++;
// reserve space in the display list for the vertices
vtxBuffer = (Vtx_t*)gMainGfxPos;
gMainGfxPos += VTX_BUF_SIZE;
vtxBuffer = (Vtx_t*) (gMainGfxPos + 1);
firstPointIdx = -1; firstPointIdx = -1;
baseTexOffset = (lifeTime & 0x3F) << 5; baseTexOffset = (lifeTime & 0x3F) << 5;
gMainGfxPos += 0x79;
numPoints = 0; numPoints = 0;
for (i = 0; i < MAX_POINTS; i++) { for (i = 0; i < MAX_POINTS; i++) {
@ -381,6 +385,7 @@ void effect_65_appendGfx(void* effect) {
phase += 180; phase += 180;
} }
// gSPBranchList jumps to here (after the vertex array)
for (i = firstPointIdx; i < MAX_POINTS - 1; i++) { for (i = firstPointIdx; i < MAX_POINTS - 1; i++) {
gSPVertex(gMainGfxPos++, &vtxBuffer[i * 2], 4, 0); gSPVertex(gMainGfxPos++, &vtxBuffer[i * 2], 4, 0);
gSP2Triangles(gMainGfxPos++, 0, 2, 1, 0, 1, 2, 3, 0); gSP2Triangles(gMainGfxPos++, 0, 2, 1, 0, 1, 2, 3, 0);

View File

@ -157,8 +157,8 @@ void floating_flower_appendGfx(void* effect) {
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
if (*gBackgroundFogModePtr == FOG_MODE_1) { if (*gBackgroundTintModePtr == ENV_TINT_SHROUD) {
get_background_color_blend(&rgb, &rgb, &rgb, &a); mdl_get_shroud_tint_params(&rgb, &rgb, &rgb, &a);
alpha -= a; alpha -= a;
} }

View File

@ -22,7 +22,7 @@ Gfx D_09000800_3543B0[] = {
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),
gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_CLD_SURF2), gsDPSetRenderMode(G_RM_PASS, G_RM_ZB_CLD_SURF2),
gsDPLoadTextureTile(OS_K0_TO_PHYSICAL(&D_800B32E0), G_IM_FMT_I, G_IM_SIZ_8b, 32, 0, 0, 0, 31, 63, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 5, 6, G_TX_NOLOD, G_TX_NOLOD), gsDPLoadTextureTile(OS_K0_TO_PHYSICAL(&D_800B32E0), G_IM_FMT_I, G_IM_SIZ_8b, 32, 0, 0, 0, 31, 63, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 5, 6, G_TX_NOLOD, G_TX_NOLOD),
gsDPSetCombineLERP(TEXEL0, CENTER, SCALE, ENVIRONMENT, 0, 0, 0, TEXEL0, 0, PRIMITIVE, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED), gsDPSetCombineMode(PM_CC_34, PM_CC_35),
gsSPClearGeometryMode(G_CULL_BOTH | G_LIGHTING), gsSPClearGeometryMode(G_CULL_BOTH | G_LIGHTING),
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH), gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(), gsSPEndDisplayList(),
@ -41,14 +41,14 @@ Gfx D_090009E0_354590[] = {
gsDPSetCombineMode(PM_CC_CONST_ALPHA_1, PM_CC_CONST_ALPHA_1), gsDPSetCombineMode(PM_CC_CONST_ALPHA_1, PM_CC_CONST_ALPHA_1),
gsSPTextureRectangle(0, 0, 0x0080, 0x0100, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400), gsSPTextureRectangle(0, 0, 0x0080, 0x0100, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400),
gsDPPipeSync(), gsDPPipeSync(),
gsDPSetCombineLERP(TEXEL0, TEXEL1, TEXEL0, TEXEL1, 1, TEXEL0, TEXEL1, 1, 0, 0, 0, COMBINED, COMBINED, TEXEL1, TEXEL1, TEXEL1), gsDPSetCombineMode(PM_CC_36, PM_CC_37),
gsSPTextureRectangle(0, 0, 0x0080, 0x0100, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400), gsSPTextureRectangle(0, 0, 0x0080, 0x0100, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400),
gsDPPipeSync(), gsDPPipeSync(),
gsDPLoadTextureTile(OS_K0_TO_PHYSICAL(&D_800B3AE0), G_IM_FMT_I, G_IM_SIZ_8b, 32, 0, 0, 0, 31, 63, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 5, 6, G_TX_NOLOD, G_TX_NOLOD), gsDPLoadTextureTile(OS_K0_TO_PHYSICAL(&D_800B3AE0), G_IM_FMT_I, G_IM_SIZ_8b, 32, 0, 0, 0, 31, 63, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 5, 6, G_TX_NOLOD, G_TX_NOLOD),
gsDPSetColorImage(G_IM_FMT_I, G_IM_SIZ_8b, 32, OS_K0_TO_PHYSICAL(&D_800B32E0)), gsDPSetColorImage(G_IM_FMT_I, G_IM_SIZ_8b, 32, OS_K0_TO_PHYSICAL(&D_800B32E0)),
gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2), gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2),
gsDPSetTextureFilter(G_TF_POINT), gsDPSetTextureFilter(G_TF_POINT),
gsDPSetCombineLERP(TEXEL1, K4, PRIMITIVE_ALPHA, TEXEL0, TEXEL0, TEXEL1, ENVIRONMENT, ENVIRONMENT, TEXEL1, K4, COMBINED_ALPHA, COMBINED, 0, 0, 0, 1), gsDPSetCombineMode(PM_CC_38, PM_CC_39),
gsDPSetConvert(0, 0, 0, 0, 92, 0), gsDPSetConvert(0, 0, 0, 0, 92, 0),
gsDPSetPrimColor(0, 0, 0x00, 0x00, 0x00, 0x78), gsDPSetPrimColor(0, 0, 0x00, 0x00, 0x00, 0x78),
gsDPSetEnvColor(0x00, 0x00, 0x00, 0xA4), gsDPSetEnvColor(0x00, 0x00, 0x00, 0xA4),

View File

@ -172,7 +172,7 @@ void ice_shard_appendGfx(void* effect) {
if (type % 2 == 1 && (s32) (data->animFrame * 4.0f) == 3) { if (type % 2 == 1 && (s32) (data->animFrame * 4.0f) == 3) {
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primCol.r, data->primCol.g, data->primCol.b, alpha * envAlpha / 255); gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primCol.r, data->primCol.g, data->primCol.b, alpha * envAlpha / 255);
gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, PRIMITIVE, SHADE, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, SHADE, 0, PRIMITIVE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_3C, PM_CC_3C);
gSPDisplayList(gMainGfxPos++, D_09001168_3F9E28); gSPDisplayList(gMainGfxPos++, D_09001168_3F9E28);
} }

View File

@ -29,7 +29,7 @@ EffectInstance* merlin_house_stars_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3)
data->unk_04 = 100; data->unk_04 = 100;
data->unk_00 = arg0; data->unk_00 = arg0;
data->unk_18 = 255; data->alpha = 255;
data->unk_0C = arg1; data->unk_0C = arg1;
data->unk_10 = arg2; data->unk_10 = arg2;
data->unk_14 = arg3; data->unk_14 = arg3;
@ -75,11 +75,11 @@ void merlin_house_stars_update(EffectInstance* effect) {
unk_04 = data->unk_04; unk_04 = data->unk_04;
if (data->unk_08 < 17) { if (data->unk_08 < 17) {
data->unk_18 = data->unk_08 * 16 - 1; data->alpha = data->unk_08 * 16 - 1;
} }
if (unk_04 < 16) { if (unk_04 < 16) {
data->unk_18 = unk_04 * 16; data->alpha = unk_04 * 16;
} }
if (data->unk_1C < 0.0f) { if (data->unk_1C < 0.0f) {
@ -126,9 +126,12 @@ void merlin_house_stars_render(EffectInstance* effect) {
void func_E00A639C(void) { void func_E00A639C(void) {
} }
#define PM_CC1_MERLIN_STARS 0, 0, 0, 1, TEXEL1, 0, PRIMITIVE, TEXEL0
#define PM_CC2_MERLIN_STARS 0, 0, 0, COMBINED, COMBINED, 0, ENVIRONMENT, 0
void merlin_house_stars_appendGfx(void* effect) { void merlin_house_stars_appendGfx(void* effect) {
MerlinHouseStarsFXData* data = ((EffectInstance*)effect)->data.merlinHouseStars; MerlinHouseStarsFXData* data = ((EffectInstance*)effect)->data.merlinHouseStars;
s32 unk_18 = data->unk_18; s32 envAlpha = data->alpha;
Matrix4f sp10; Matrix4f sp10;
Matrix4f sp50; Matrix4f sp50;
s32 uls; s32 uls;
@ -144,8 +147,8 @@ void merlin_house_stars_appendGfx(void* effect) {
gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 127); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 127);
gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, unk_18); gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, envAlpha);
gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 1, TEXEL1, 0, PRIMITIVE, TEXEL0, 0, 0, 0, COMBINED, COMBINED, 0, ENVIRONMENT, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC1_MERLIN_STARS, PM_CC2_MERLIN_STARS);
gSPDisplayList(gMainGfxPos++, D_09001000_3A6BE0); gSPDisplayList(gMainGfxPos++, D_09001000_3A6BE0);
uls = data->unk_1C * 4.0f; uls = data->unk_1C * 4.0f;

View File

@ -193,7 +193,7 @@ void radiating_energy_orb_appendGfx(void* effect) {
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 0, 255, (part->unk_14 * unk_14) >> 9); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 0, 255, (part->unk_14 * unk_14) >> 9);
gDPSetEnvColor(gMainGfxPos++, 255, 128, 255, 0); gDPSetEnvColor(gMainGfxPos++, 255, 128, 255, 0);
gDPSetCombineLERP(gMainGfxPos++, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_4D, PM_CC_4D);
guRotateF(sp18, part->unk_20 + 14.0f, 0.0f, 0.0f, 1.0f); guRotateF(sp18, part->unk_20 + 14.0f, 0.0f, 0.0f, 1.0f);
guRotateF(sp58, (i * 10) % 45 + unk_1C, 0.0f, 1.0f, 0.0f); guRotateF(sp58, (i * 10) % 45 + unk_1C, 0.0f, 1.0f, 0.0f);

View File

@ -196,7 +196,7 @@ void func_E0080448(EffectInstance* effect) {
gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
} else { } else {
gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2); gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_49, PM_CC_49);
} }
gSPDisplayList(gMainGfxPos++, (type == 0 || type == 2) ? gSPDisplayList(gMainGfxPos++, (type == 0 || type == 2) ?

View File

@ -119,9 +119,9 @@ void ring_blast_appendGfx(void* effect) {
gDPSetEnvColor(gMainGfxPos++, var_f4 * 255.0f, var_f4 * 53.0f, var_f4 * 24.0f, envAlpha); gDPSetEnvColor(gMainGfxPos++, var_f4 * 255.0f, var_f4 * 53.0f, var_f4 * 24.0f, envAlpha);
gDPSetKeyR(gMainGfxPos++, var_f4 * 211.0f, 0, 0); gDPSetKeyR(gMainGfxPos++, var_f4 * 211.0f, 0, 0);
gDPSetKeyGB(gMainGfxPos++, var_f4 * 255.0f, 0, 0, var_f4 * 216.0f, 0, 0); gDPSetKeyGB(gMainGfxPos++, var_f4 * 255.0f, 0, 0, var_f4 * 216.0f, 0, 0);
gDPSetCombineLERP(gMainGfxPos++, TEXEL1, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL1, TEXEL0, ENVIRONMENT, TEXEL0, PRIMITIVE, CENTER, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED); gDPSetCombineMode(gMainGfxPos++, PM_CC_4A, PM_CC_4B);
} else { } else {
gDPSetCombineLERP(gMainGfxPos++, TEXEL1, TEXEL0, ENV_ALPHA, TEXEL0, TEXEL1, TEXEL0, ENVIRONMENT, TEXEL0, 1, COMBINED, PRIMITIVE, COMBINED, 0, 0, 0, COMBINED); gDPSetCombineMode(gMainGfxPos++, PM_CC_4A, PM_CC_4C);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 40, 127); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 40, 127);
gDPSetEnvColor(gMainGfxPos++, 255, 255, 139, envAlpha); gDPSetEnvColor(gMainGfxPos++, 255, 255, 139, envAlpha);
} }

View File

@ -177,8 +177,8 @@ void snowfall_appendGfx(void* effect) {
bgAlpha = 255; bgAlpha = 255;
unk_2C = data->unk_2C; unk_2C = data->unk_2C;
dlist = D_E008AA50[data->unk_04]; dlist = D_E008AA50[data->unk_04];
if (*gBackgroundFogModePtr == 1) { if (*gBackgroundTintModePtr == ENV_TINT_SHROUD) {
get_background_color_blend(&bgRGB, &bgRGB, &bgRGB, &bgAlpha); mdl_get_shroud_tint_params(&bgRGB, &bgRGB, &bgRGB, &bgAlpha);
unk_28 = 255 - bgAlpha; unk_28 = 255 - bgAlpha;
} }

View File

@ -255,7 +255,7 @@ void func_E00AC2A4(EffectInstance* effect) {
gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA);
} else { } else {
gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2); gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_49, PM_CC_49);
} }
guTranslateF(sp20, 0.0f, data->unk_40, 0.0f); guTranslateF(sp20, 0.0f, data->unk_40, 0.0f);

View File

@ -187,7 +187,7 @@ void underwater_appendGfx(void* effect) {
gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, nuGfxCfb_ptr); gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, nuGfxCfb_ptr);
gDPSetPrimColor(gMainGfxPos++, 0, 0, data->waterColor.r, data->waterColor.g, data->waterColor.b, alpha >> 1); gDPSetPrimColor(gMainGfxPos++, 0, 0, data->waterColor.r, data->waterColor.g, data->waterColor.b, alpha >> 1);
gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE); gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, 0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, SHADE, PRIMITIVE, 0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, SHADE); gDPSetCombineMode(gMainGfxPos++, PM_CC_48, PM_CC_48);
gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, OS_K0_TO_PHYSICAL(nuGfxZBuffer)); gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, OS_K0_TO_PHYSICAL(nuGfxZBuffer));
gDPSetRenderMode(gMainGfxPos++, CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | G_RM_PASS, CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)); gDPSetRenderMode(gMainGfxPos++, CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | G_RM_PASS, CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1));
gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP); gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP);

View File

@ -242,13 +242,13 @@ ApiStatus ShowMerleeRanOutMessage(Evt* script, s32 isInitialCall) {
ApiStatus FadeBackgroundDarken(Evt* script, s32 isInitialCall) { ApiStatus FadeBackgroundDarken(Evt* script, s32 isInitialCall) {
if (isInitialCall) { if (isInitialCall) {
mdl_set_all_fog_mode(FOG_MODE_1); mdl_set_all_tint_type(ENV_TINT_SHROUD);
*gBackgroundFogModePtr = FOG_MODE_1; *gBackgroundTintModePtr = ENV_TINT_SHROUD;
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
script->functionTemp[0] = 25; script->functionTemp[0] = 25;
} }
set_background_color_blend(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 254); mdl_set_shroud_tint_params(0, 0, 0, ((25 - script->functionTemp[0]) * 10) & 254);
script->functionTemp[0]--; script->functionTemp[0]--;
if (script->functionTemp[0] == 0) { if (script->functionTemp[0] == 0) {
@ -263,11 +263,11 @@ ApiStatus FadeBackgroundLighten(Evt* script, s32 isInitialCall) {
script->functionTemp[0] = 25; script->functionTemp[0] = 25;
} }
set_background_color_blend(0, 0, 0, (script->functionTemp[0] * 10) & 254); mdl_set_shroud_tint_params(0, 0, 0, (script->functionTemp[0] * 10) & 254);
script->functionTemp[0] -= 5; script->functionTemp[0] -= 5;
if (script->functionTemp[0] == 0) { if (script->functionTemp[0] == 0) {
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} else { } else {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;

View File

@ -323,7 +323,7 @@ void func_8010FE44(void* arg0) {
void entity_model_set_shadow_color(void* data) { void entity_model_set_shadow_color(void* data) {
s32 alpha = (s32)data; s32 alpha = (s32)data;
gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 0, PRIMITIVE, 0, TEXEL0, 0, 0, 0, 0, 0, TEXEL0, 0, PRIMITIVE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC1_SHADOW, PM_CC2_SHADOW);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha);
} }

View File

@ -10,7 +10,7 @@
Gfx Entity_Tweester_LoadTextures[] = { Gfx Entity_Tweester_LoadTextures[] = {
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineLERP(TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0), gsDPSetCombineMode(PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2),
gsDPSetTextureDetail(G_TD_CLAMP), gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE), gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureImage(G_IM_FMT_I, G_IM_SIZ_8b, 32, D_0A000BF0_E57A50), gsDPSetTextureImage(G_IM_FMT_I, G_IM_SIZ_8b, 32, D_0A000BF0_E57A50),

View File

@ -82,7 +82,7 @@ void entity_Tweester_setupGfx(s32 entityIndex) {
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gDPSetTextureLUT(gMainGfxPos++, G_TT_NONE); gDPSetTextureLUT(gMainGfxPos++, G_TT_NONE);
gSPTexture(gMainGfxPos++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPTexture(gMainGfxPos++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gDPSetCombineLERP(gMainGfxPos++, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2);
gDPSetTextureDetail(gMainGfxPos++, G_TD_CLAMP); gDPSetTextureDetail(gMainGfxPos++, G_TD_CLAMP);
gDPSetTextureLOD(gMainGfxPos++, G_TL_TILE); gDPSetTextureLOD(gMainGfxPos++, G_TL_TILE);
gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_I, G_IM_SIZ_8b, 32, D_0A000BF0_E57A50); gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_I, G_IM_SIZ_8b, 32, D_0A000BF0_E57A50);

View File

@ -346,7 +346,7 @@ void appendGfx_entity_model(EntityModel* model) {
if (!entity_fog_enabled || (model->flags & ENTITY_MODEL_FLAG_FOG_DISABLED)) { if (!entity_fog_enabled || (model->flags & ENTITY_MODEL_FLAG_FOG_DISABLED)) {
gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA); gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA);
} else { } else {
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, 0, TEXEL0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED); gDPSetCombineMode(gMainGfxPos++, PM_CC_42, PM_CC_18);
} }
} }
if (model->vertexArray != NULL) { if (model->vertexArray != NULL) {
@ -660,7 +660,7 @@ void draw_entity_model_E(s32 modelIdx, Mtx* transformMtx) {
if (!entity_fog_enabled || (model->flags & ENTITY_MODEL_FLAG_FOG_DISABLED)) { if (!entity_fog_enabled || (model->flags & ENTITY_MODEL_FLAG_FOG_DISABLED)) {
gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA); gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA);
} else { } else {
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, TEXEL0, 0, 0, TEXEL0, COMBINED, 0, SHADE, 0, 0, 0, 0, COMBINED); gDPSetCombineMode(gMainGfxPos++, PM_CC_42, PM_CC_18);
} }
if (model->vertexArray != NULL) { if (model->vertexArray != NULL) {
gSPSegment(gMainGfxPos++, D_80154374, VIRTUAL_TO_PHYSICAL(model->vertexArray)); gSPSegment(gMainGfxPos++, D_80154374, VIRTUAL_TO_PHYSICAL(model->vertexArray));

View File

@ -215,7 +215,7 @@ ApiStatus SetGroupVisibility(Evt* script, s32 isInitialCall) {
Bytecode groupModelID = evt_get_variable(script, *args++); Bytecode groupModelID = evt_get_variable(script, *args++);
Bytecode enabled = evt_get_variable(script, *args++); Bytecode enabled = evt_get_variable(script, *args++);
set_model_group_visibility(groupModelID, MODEL_FLAG_HIDDEN, enabled); mdl_group_set_visibility(groupModelID, MODEL_FLAG_HIDDEN, enabled);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -11,7 +11,7 @@ void virtual_entity_appendGfx_quad(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u1
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
if (a == 0xFF) { if (a == 0xFF) {
gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08); gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_FULL_ALPHA, PM_CC_PRIM_FULL_ALPHA);
} else { } else {
gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2); gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);

View File

@ -15,7 +15,7 @@ Gfx filemenu_dl_copyarrow[] = {
gsDPSetTextureFilter(G_TF_BILERP), gsDPSetTextureFilter(G_TF_BILERP),
gsDPSetTextureConvert(G_TC_FILT), gsDPSetTextureConvert(G_TC_FILT),
gsDPSetRenderMode(G_RM_PASS, G_RM_CLD_SURF2), gsDPSetRenderMode(G_RM_PASS, G_RM_CLD_SURF2),
gsDPSetCombineLERP(0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, ENVIRONMENT, PRIMITIVE, COMBINED, PRIMITIVE, COMBINED, 0, PRIMITIVE, 0), gsDPSetCombineMode(G_CC_DECALRGBA, PM_CC_33),
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),
gsDPLoadTextureTile_4b(D_8024A200, G_IM_FMT_IA, 64, 16, 0, 0, 63, 15, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_MIRROR | G_TX_WRAP, 6, 4, G_TX_NOLOD, G_TX_NOLOD), gsDPLoadTextureTile_4b(D_8024A200, G_IM_FMT_IA, 64, 16, 0, 0, 63, 15, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_MIRROR | G_TX_WRAP, 6, 4, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH | G_CLIPPING | 0x0040F9FA), gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH | G_CLIPPING | 0x0040F9FA),

View File

@ -499,9 +499,9 @@ void hud_element_draw_rect(HudElement* hudElement, s16 texSizeX, s16 texSizeY, s
case 1: case 1:
if (!dropShadow) { if (!dropShadow) {
if (hudElement->flags & HUD_ELEMENT_FLAG_TRANSPARENT) { if (hudElement->flags & HUD_ELEMENT_FLAG_TRANSPARENT) {
gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_2F, PM_CC_32);
} else { } else {
gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_2F, PM_CC_32);
} }
if (hudElement->flags & HUD_ELEMENT_FLAG_TRANSPARENT) { if (hudElement->flags & HUD_ELEMENT_FLAG_TRANSPARENT) {
@ -545,7 +545,7 @@ void hud_element_draw_rect(HudElement* hudElement, s16 texSizeX, s16 texSizeY, s
} }
break; break;
case 2: case 2:
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_47, PM_CC_47);
gDPSetPrimColor(gMainGfxPos++, 0, 0, hudElement->tint.r, hudElement->tint.g, hudElement->tint.b, hudElement->opacity); gDPSetPrimColor(gMainGfxPos++, 0, 0, hudElement->tint.r, hudElement->tint.g, hudElement->tint.b, hudElement->opacity);
if (!flipX && !flipY) { if (!flipX && !flipY) {
@ -1579,7 +1579,7 @@ void render_hud_element(HudElement* hudElement) {
vtx[3].v.tc[1] = 0; vtx[3].v.tc[1] = 0;
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_47, PM_CC_47);
gDPSetPrimColor(gMainGfxPos++, 0, 0, gDPSetPrimColor(gMainGfxPos++, 0, 0,
hudElement->tint.r, hudElement->tint.g, hudElement->tint.b, hudElement->opacity); hudElement->tint.r, hudElement->tint.g, hudElement->tint.b, hudElement->opacity);

View File

@ -910,9 +910,7 @@ void imgfx_appendGfx_mesh(ImgFXState* state, Matrix4f mtx) {
case IMGFX_RENDER_MODULATE_PRIM_RGB: case IMGFX_RENDER_MODULATE_PRIM_RGB:
// color: lerp from prim color to 1 based on texture intensity // color: lerp from prim color to 1 based on texture intensity
// alpha: texture // alpha: texture
gDPSetCombineLERP(gMainGfxPos++, gDPSetCombineMode(gMainGfxPos++, PM_CC_5B, PM_CC_5B);
1, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0,
1, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0);
gDPSetPrimColor(gMainGfxPos++, 0, 0, state->ints.color.r, state->ints.color.g, gDPSetPrimColor(gMainGfxPos++, 0, 0, state->ints.color.r, state->ints.color.g,
state->ints.color.b, 0); state->ints.color.b, 0);
break; break;
@ -922,9 +920,7 @@ void imgfx_appendGfx_mesh(ImgFXState* state, Matrix4f mtx) {
if (primAlpha <= 0) { if (primAlpha <= 0) {
return; return;
} }
gDPSetCombineLERP(gMainGfxPos++, gDPSetCombineMode(gMainGfxPos++, PM_CC_5C, PM_CC_5C);
1, 0, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0,
1, 0, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(gMainGfxPos++, 0, 0, state->ints.color.r, state->ints.color.g, gDPSetPrimColor(gMainGfxPos++, 0, 0, state->ints.color.r, state->ints.color.g,
state->ints.color.b, primAlpha); state->ints.color.b, primAlpha);
break; break;
@ -938,16 +934,14 @@ void imgfx_appendGfx_mesh(ImgFXState* state, Matrix4f mtx) {
case IMGFX_RENDER_MODULATE_SHADE_RGB: case IMGFX_RENDER_MODULATE_SHADE_RGB:
// color: lerp from vtx color to 1 based on texture intensity // color: lerp from vtx color to 1 based on texture intensity
// alpha: texture // alpha: texture
gDPSetCombineLERP(gMainGfxPos++, gDPSetCombineMode(gMainGfxPos++, PM_CC_5D, PM_CC_5D);
1, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0,
1, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0);
gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH); gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH);
gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING); gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING);
break; break;
case IMGFX_RENDER_MULTIPLY_SHADE_ALPHA: case IMGFX_RENDER_MULTIPLY_SHADE_ALPHA:
// color: texture // color: texture
// alpha: texture * vtx color // alpha: texture * vtx color
gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, TEXEL0, TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, SHADE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_12, PM_CC_12);
gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH); gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH);
gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING); gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING);
break; break;
@ -961,9 +955,7 @@ void imgfx_appendGfx_mesh(ImgFXState* state, Matrix4f mtx) {
case IMGFX_RENDER_MODULATE_SHADE_RGBA: case IMGFX_RENDER_MODULATE_SHADE_RGBA:
// color: lerp from vtx color to 1 based on texture intensity // color: lerp from vtx color to 1 based on texture intensity
// alpha: vtx color * texture // alpha: vtx color * texture
gDPSetCombineLERP(gMainGfxPos++, gDPSetCombineMode(gMainGfxPos++, PM_CC_5E, PM_CC_5E);
1, SHADE, TEXEL0, SHADE, TEXEL0, 0, SHADE, 0,
1, SHADE, TEXEL0, SHADE, TEXEL0, 0, SHADE, 0);
gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH); gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_SHADING_SMOOTH);
gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING); gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING);
break; break;
@ -1586,7 +1578,7 @@ void imgfx_appendGfx_mesh_basic(ImgFXState* state, Matrix4f mtx) {
} }
if (alpha2 == -1) { if (alpha2 == -1) {
gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 0, SHADE, 0, TEXEL0, 0, 0, 0, 0, 0, SHADE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_59, PM_CC_59);
} else { } else {
gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, alpha2); gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, alpha2);
gDPSetCombineMode(gMainGfxPos++, PM_CC_0A, PM_CC_0A); gDPSetCombineMode(gMainGfxPos++, PM_CC_0A, PM_CC_0A);
@ -1604,7 +1596,7 @@ void imgfx_appendGfx_mesh_basic(ImgFXState* state, Matrix4f mtx) {
gDPSetEnvColor(gMainGfxPos++, 100, 100, 100, 255); gDPSetEnvColor(gMainGfxPos++, 100, 100, 100, 255);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha2); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha2);
gDPSetCombineLERP(gMainGfxPos++, SHADE, ENVIRONMENT, TEXEL0, TEXEL0, 0, 0, 0, TEXEL0, SHADE, ENVIRONMENT, TEXEL0, TEXEL0, 0, 0, 0, TEXEL0); gDPSetCombineMode(gMainGfxPos++, PM_CC_5A, PM_CC_5A);
gDPSetColorDither(gMainGfxPos++, G_CD_MAGICSQ); gDPSetColorDither(gMainGfxPos++, G_CD_MAGICSQ);
} }
} }

View File

@ -575,7 +575,7 @@ void update_status_bar(void) {
if (gGameStatusPtr->introPart >= INTRO_PART_0 if (gGameStatusPtr->introPart >= INTRO_PART_0
|| gGameStatusPtr->demoState != DEMO_STATE_NONE || gGameStatusPtr->demoState != DEMO_STATE_NONE
|| (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) || (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH)
|| evt_get_variable(NULL, GB_StoryProgress) >= STORY_EPILOGUE || evt_get_variable(NULL, GB_StoryProgress) >= STORY_EPILOGUE
) { ) {
return; return;
@ -1583,7 +1583,7 @@ s32 is_ability_active(s32 ability) {
attackFXArray[i] = 0; attackFXArray[i] = 0;
} }
if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) { if (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH) {
return 0; return 0;
} }

View File

@ -910,7 +910,7 @@ void appendGfx_item_entity(void* data) {
if (item->flags & ITEM_ENTITY_FLAG_HIDING) { if (item->flags & ITEM_ENTITY_FLAG_HIDING) {
u8 r, g, b, a; u8 r, g, b, a;
get_background_color_blend(&r, &g, &b, &a); mdl_get_shroud_tint_params(&r, &g, &b, &a);
alpha = (alpha * (255 - a)) / 255; alpha = (alpha * (255 - a)) / 255;
} }
} }
@ -958,7 +958,7 @@ void appendGfx_item_entity(void* data) {
GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA),
AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL |
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)); GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_2F, PM_CC_32);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, alpha);
} }
} }
@ -1161,7 +1161,7 @@ void render_item_entities(void) {
alpha = item->alpha * alpha / 255; alpha = item->alpha * alpha / 255;
} }
if (item->flags & ITEM_ENTITY_FLAG_HIDING) { if (item->flags & ITEM_ENTITY_FLAG_HIDING) {
get_background_color_blend(&r1, &g1, &b1, &a1); mdl_get_shroud_tint_params(&r1, &g1, &b1, &a1);
alpha = alpha * (255 - a1) / 255; alpha = alpha * (255 - a1) / 255;
} }
if (item->flags & (ITEM_ENTITY_FLAG_TRANSPARENT | ITEM_ENTITY_FLAG_HIDING)) { if (item->flags & (ITEM_ENTITY_FLAG_TRANSPARENT | ITEM_ENTITY_FLAG_HIDING)) {
@ -1171,7 +1171,7 @@ void render_item_entities(void) {
} else { } else {
gDPSetRenderMode(gMainGfxPos++, AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), gDPSetRenderMode(gMainGfxPos++, AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA),
AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)); AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, TEXEL0, 0, PRIMITIVE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_2F, PM_CC_32);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, alpha);
} }
} }

View File

@ -94,7 +94,7 @@ s16 D_80074010 = 8; // might be an array, could be size 1-8
void gfxRetrace_Callback(s32); void gfxRetrace_Callback(s32);
void gfxPreNMI_Callback(void); void gfxPreNMI_Callback(void);
void gfx_task_main(void); void appendGfx_reset_tile_pattern(void);
void gfx_draw_frame(void); void gfx_draw_frame(void);
void gfx_init_state(void); void gfx_init_state(void);
@ -102,18 +102,25 @@ void gfx_init_state(void);
void create_audio_system(void); void create_audio_system(void);
void load_engine_data(void); void load_engine_data(void);
extern s32 D_80073E00; enum {
extern u16* D_80073E04; RESET_STATE_NONE = 0,
RESET_STATE_INIT = 1,
RESET_STATE_FADE = 2,
};
// TODO try uniting these two split files
extern s32 ResetGameState;
extern u16* ResetSavedFrameImg;
extern s16 D_80073E08; extern s16 D_80073E08;
extern s16 D_80073E0A; extern s16 D_80073E0A;
extern s32 D_80073E10[]; extern IMG_BIN ResetTilesImg[];
#ifdef SHIFT #ifdef SHIFT
#define shim_create_audio_system_obfuscated create_audio_system #define shim_create_audio_system_obfuscated create_audio_system
#define shim_load_engine_data_obfuscated load_engine_data #define shim_load_engine_data_obfuscated load_engine_data
#endif #endif
SHIFT_BSS u16* D_8009A680; SHIFT_BSS u16* ResetFrameBufferArray;
SHIFT_BSS u16* nuGfxZBuffer; SHIFT_BSS u16* nuGfxZBuffer;
void boot_main(void* data) { void boot_main(void* data) {
@ -164,25 +171,25 @@ void boot_main(void* data) {
while (TRUE) {} while (TRUE) {}
} }
void gfxRetrace_Callback(s32 arg0) { void gfxRetrace_Callback(s32 gfxTaskNum) {
if (D_80073E00 != 0) { if (ResetGameState != RESET_STATE_NONE) {
if (D_80073E00 == 1) { if (ResetGameState == RESET_STATE_INIT) {
nuGfxTaskAllEndWait(); nuGfxTaskAllEndWait();
if (arg0 == 0) { if (gfxTaskNum == 0) {
u16* fb = (u16*) osViGetCurrentFramebuffer(); u16* fb = (u16*) osViGetCurrentFramebuffer();
u16** temp_8009A680 = &D_8009A680; u16** bufferSet = &ResetFrameBufferArray;
temp_8009A680[2] = fb; bufferSet[2] = fb;
temp_8009A680[1] = fb; bufferSet[1] = fb;
temp_8009A680[0] = fb; bufferSet[0] = fb;
D_80073E04 = fb; ResetSavedFrameImg = fb;
nuGfxSetCfb(&D_8009A680, 3); nuGfxSetCfb(&ResetFrameBufferArray, 3);
osViSwapBuffer(D_8009A680); osViSwapBuffer(ResetFrameBufferArray);
D_80073E00 = 2; ResetGameState = RESET_STATE_FADE;
} }
} }
if (D_80073E00 == 2) { if (ResetGameState == RESET_STATE_FADE) {
gfx_task_main(); appendGfx_reset_tile_pattern();
} }
} else { } else {
D_80073E0A ^= 1; D_80073E0A ^= 1;
@ -190,7 +197,7 @@ void gfxRetrace_Callback(s32 arg0) {
step_game_loop(); step_game_loop();
D_80073E08 = 1; D_80073E08 = 1;
if (arg0 < 3) { if (gfxTaskNum < 3) {
D_80073E08 = 0; D_80073E08 = 0;
gfx_task_background(); gfx_task_background();
gfx_draw_frame(); gfx_draw_frame();
@ -199,20 +206,21 @@ void gfxRetrace_Callback(s32 arg0) {
} }
} }
void gfx_task_main(void) { // on reset, draw a series of animated triangular black tiles emanating from the center of the screen
void appendGfx_reset_tile_pattern(void) {
s16 t; s16 t;
s16 i; s16 i;
s16 j; s16 j;
u16* temp; u16* frozenFrame;
gMatrixListPos = 0; gMatrixListPos = 0;
gDisplayContext = &D_80164000[gCurrentDisplayContextIndex]; gDisplayContext = &D_80164000[gCurrentDisplayContextIndex];
gMainGfxPos = gDisplayContext->mainGfx; gMainGfxPos = gDisplayContext->mainGfx;
temp = D_80073E04; frozenFrame = ResetSavedFrameImg;
gfx_init_state(); gfx_init_state();
gDPSetDepthImage(gMainGfxPos++, OS_K0_TO_PHYSICAL(nuGfxZBuffer)); gDPSetDepthImage(gMainGfxPos++, OS_K0_TO_PHYSICAL(nuGfxZBuffer));
gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(temp)); gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(frozenFrame));
gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON); gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE); gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
@ -220,10 +228,10 @@ void gfx_task_main(void) {
gDPSetTextureLUT(gMainGfxPos++, G_TT_NONE); gDPSetTextureLUT(gMainGfxPos++, G_TT_NONE);
gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2); gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
gDPSetTextureFilter(gMainGfxPos++, G_TF_POINT); gDPSetTextureFilter(gMainGfxPos++, G_TF_POINT);
gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 0, 0, 0, 0, TEXEL0, 0, 0, 0, 0, 0, 0, 0, TEXEL0); gDPSetCombineMode(gMainGfxPos++, PM_CC_RESET_TILES, PM_CC_RESET_TILES);
gDPSetAlphaCompare(gMainGfxPos++, G_AC_THRESHOLD); gDPSetAlphaCompare(gMainGfxPos++, G_AC_THRESHOLD);
gDPSetBlendColor(gMainGfxPos++, 0, 0, 0, 127); gDPSetBlendColor(gMainGfxPos++, 0, 0, 0, 127);
gDPLoadTextureTile_4b(gMainGfxPos++, D_80073E10, G_IM_FMT_I, 128, 8, 0, 0, 127, 7, 0, G_TX_NOMIRROR | G_TX_WRAP, gDPLoadTextureTile_4b(gMainGfxPos++, ResetTilesImg, G_IM_FMT_I, 128, 8, 0, 0, 127, 7, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
for (i = 0; i < 20; i++) { for (i = 0; i < 20; i++) {
@ -275,6 +283,6 @@ NOP_FIX
#endif #endif
void gfxPreNMI_Callback(void) { void gfxPreNMI_Callback(void) {
D_80073E00 = 1; ResetGameState = RESET_STATE_INIT;
nuContRmbForceStop(); nuContRmbForceStop();
} }

View File

@ -1,26 +1,10 @@
#include "PR/ultratypes.h" #include "PR/ultratypes.h"
s32 D_80073E00 = 0; s32 ResetGameState = 0;
s32 D_80073E04 = NULL; u16* ResetSavedFrameImg = NULL;
s16 D_80073E08 = 0; s16 D_80073E08 = 0;
s16 D_80073E0A = 0; s16 D_80073E0A = 0;
s32 D_80073E0C = 0; // unused? s32 D_80073E0C = 0; // unused?
s32 D_80073E10[] = { #include "reset_tiles.png.inc.c"
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF,
0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, 0x00000FFF, 0x000000FF, 0x0000000F, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF,
0x00000FFF, 0x000000FF, 0x0000000F, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, 0x00000FFF, 0x000000FF, 0x0000000F,
0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF,
0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, 0x00000FFF, 0x000000FF, 0x0000000F, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF,
0x00000FFF, 0x000000FF, 0x0000000F, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF,
0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF, 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, 0x00000FFF, 0x000000FF, 0x0000000F,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0x0FFFFFFF,
0x00FFFFFF, 0x000FFFFF, 0x0000FFFF, 0x00000FFF, 0x000000FF, 0x0000000F, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, 0x0FFFFFFF, 0x00FFFFFF, 0x000FFFFF, 0x0000FFFF,
0x00000FFF, 0x000000FF, 0x0000000F, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000,
};

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
#include "model_clear_render_tasks.h" #include "model_clear_render_tasks.h"
BSS RenderTask mdl_clearRenderTasks[NUM_RENDER_TASK_LISTS][NUM_RENDER_TASKS_IN_LIST]; BSS RenderTask ClearRenderTaskLists[NUM_RENDER_TASK_LISTS][NUM_RENDER_TASKS_IN_LIST];

View File

@ -3,4 +3,4 @@
#define NUM_RENDER_TASK_LISTS 3 #define NUM_RENDER_TASK_LISTS 3
#define NUM_RENDER_TASKS_IN_LIST 0x100 #define NUM_RENDER_TASKS_IN_LIST 0x100
extern RenderTask mdl_clearRenderTasks[NUM_RENDER_TASK_LISTS][NUM_RENDER_TASKS_IN_LIST]; extern RenderTask ClearRenderTaskLists[NUM_RENDER_TASK_LISTS][NUM_RENDER_TASKS_IN_LIST];

View File

@ -3844,7 +3844,7 @@ void appendGfx_msg_prim_rect(u8 r, u8 g, u8 b, u8 a, u16 ulX, u16 ulY, u16 lrX,
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
if (a == 255) { if (a == 255) {
gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08); gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_FULL_ALPHA, PM_CC_PRIM_FULL_ALPHA);
} else { } else {
gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2); gDPSetRenderMode(gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);

View File

@ -990,7 +990,7 @@ void render_npcs(void) {
if (npc->flags & NPC_FLAG_HIDING) { if (npc->flags & NPC_FLAG_HIDING) {
u8 r, g, b, a; u8 r, g, b, a;
get_background_color_blend(&r, &g, &b, &a); mdl_get_shroud_tint_params(&r, &g, &b, &a);
npc->hideAlpha = 255 - a; npc->hideAlpha = 255 - a;
} else { } else {
npc->hideAlpha = 255; npc->hideAlpha = 255;

View File

@ -232,7 +232,7 @@ Gfx PauseGfxPathPoints[] = {
gsDPSetTextureFilter(G_TF_POINT), gsDPSetTextureFilter(G_TF_POINT),
gsDPSetTextureConvert(G_TC_FILT), gsDPSetTextureConvert(G_TC_FILT),
gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2), gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2),
gsDPSetCombineLERP(PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0), gsDPSetCombineMode(PM_CC_2F, PM_CC_2F),
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),
gsDPLoadTextureTile(pause_map_location_png, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 16, 0, 0, 15, 15, 0, G_TX_CLAMP, G_TX_CLAMP, 4, 4, G_TX_NOLOD, G_TX_NOLOD), gsDPLoadTextureTile(pause_map_location_png, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 16, 0, 0, 15, 15, 0, G_TX_CLAMP, G_TX_CLAMP, 4, 4, G_TX_NOLOD, G_TX_NOLOD),
gsDPSetTextureLUT(G_TT_NONE), gsDPSetTextureLUT(G_TT_NONE),

View File

@ -34,7 +34,7 @@ Gfx Gfx_LoadStencilTex_CommonParams[] = {
gsDPSetTexturePersp(G_TP_NONE), gsDPSetTexturePersp(G_TP_NONE),
gsDPSetColorDither(G_CD_MAGICSQ), gsDPSetColorDither(G_CD_MAGICSQ),
gsDPSetAlphaDither(G_AD_PATTERN), gsDPSetAlphaDither(G_AD_PATTERN),
gsDPSetCombineLERP(0, 0, 0, PRIMITIVE, 1, TEXEL0, PRIMITIVE, TEXEL0, 0, 0, 0, PRIMITIVE, 1, TEXEL0, PRIMITIVE, TEXEL0), gsDPSetCombineMode(PM_CC_3A, PM_CC_3A),
gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2), gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2),
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH | G_CLIPPING | 0x0040F9FA), gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH | G_CLIPPING | 0x0040F9FA),
gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH), gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH),
@ -87,7 +87,7 @@ Gfx D_8014E8F0[] = {
gsDPSetDepthSource(G_ZS_PRIM), gsDPSetDepthSource(G_ZS_PRIM),
gsDPSetPrimDepth(0, 0), gsDPSetPrimDepth(0, 0),
gsDPSetRenderMode(Z_UPD | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_MEM, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), Z_UPD | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_MEM, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)), gsDPSetRenderMode(Z_UPD | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_MEM, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), Z_UPD | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_MEM, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)),
gsDPSetCombineLERP(0, 0, 0, SHADE, 1, 0, PRIMITIVE, 0, 0, 0, 0, SHADE, 1, 0, PRIMITIVE, 0), gsDPSetCombineMode(PM_CC_3B, PM_CC_3B),
gsDPSetTexturePersp(G_TP_PERSP), gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP), gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE), gsDPSetTextureLOD(G_TL_TILE),
@ -111,7 +111,7 @@ Gfx D_8014E9A8[] = {
gsDPSetDepthSource(G_ZS_PRIM), gsDPSetDepthSource(G_ZS_PRIM),
gsDPSetPrimDepth(20, 0), gsDPSetPrimDepth(20, 0),
gsDPSetRenderMode(G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2), gsDPSetRenderMode(G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2),
gsDPSetCombineLERP(0, 0, 0, SHADE, 1, 0, PRIMITIVE, 0, 0, 0, 0, SHADE, 1, 0, PRIMITIVE, 0), gsDPSetCombineMode(PM_CC_3B, PM_CC_3B),
gsSPClearGeometryMode(G_CULL_BOTH | G_LIGHTING | G_SHADING_SMOOTH), gsSPClearGeometryMode(G_CULL_BOTH | G_LIGHTING | G_SHADING_SMOOTH),
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE), gsSPSetGeometryMode(G_ZBUFFER | G_SHADE),
gsDPSetColorDither(G_CD_MAGICSQ), gsDPSetColorDither(G_CD_MAGICSQ),

View File

@ -158,7 +158,7 @@ void appendGfx_darkness_stencil(b32 isWorld, s32 posX, s32 posY, f32 alpha, f32
gSPDisplayList(gMainGfxPos++, Gfx_DarknessStencilQuad); gSPDisplayList(gMainGfxPos++, Gfx_DarknessStencilQuad);
gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 0, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, 0, 0, PRIMITIVE, TEXEL0, PRIMITIVE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_56, PM_CC_56);
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
f32 f20; f32 f20;
@ -218,9 +218,9 @@ void appendGfx_darkness_stencil(b32 isWorld, s32 posX, s32 posY, f32 alpha, f32
gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2); gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
if (alpha != 255.0f || isWorld == 1) { if (alpha != 255.0f || isWorld == 1) {
gDPSetCombineLERP(gMainGfxPos++, 1, TEXEL0, PRIMITIVE, 0, TEXEL0, 0, ENVIRONMENT, PRIMITIVE, 1, TEXEL0, PRIMITIVE, 0, TEXEL0, 0, ENVIRONMENT, PRIMITIVE); gDPSetCombineMode(gMainGfxPos++, PM_CC_57, PM_CC_57);
} else { } else {
gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, 0, 1, 0, ENVIRONMENT, PRIMITIVE, 0, 0, 0, 0, 1, 0, ENVIRONMENT, PRIMITIVE); gDPSetCombineMode(gMainGfxPos++, PM_CC_58, PM_CC_58);
} }
alpha *= 0.5f; alpha *= 0.5f;
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha * 0.5f * progress / 255.0f); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha * 0.5f * progress / 255.0f);
@ -269,7 +269,7 @@ void appendGfx_screen_transition_stencil(s32 arg0, s32 arg1, f32 progress, s32 p
gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, x1, y1, x2, y2); gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, x1, y1, x2, y2);
if (progress == 255.0f) { if (progress == 255.0f) {
gDPSetCombineMode(gMainGfxPos++, PM_CC_08, PM_CC_08); gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_FULL_ALPHA, PM_CC_PRIM_FULL_ALPHA);
} }
gDPSetPrimColor(gMainGfxPos++, 0, 0, primR, primG, primB, primA); gDPSetPrimColor(gMainGfxPos++, 0, 0, primR, primG, primB, primA);
texScale = (255.0f - progress) * 10.5f / 255.0f + 0.09; // range from texScale = (255.0f - progress) * 10.5f / 255.0f + 0.09; // range from

View File

@ -294,7 +294,7 @@ void spr_appendGfx_component_flat(
gDPSetEnvColor(gMainGfxPos++, 100, 100, 100, 255); gDPSetEnvColor(gMainGfxPos++, 100, 100, 100, 255);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha);
gDPSetCombineLERP(gMainGfxPos++, SHADE, ENVIRONMENT, TEXEL0, TEXEL0, PRIMITIVE, 0, TEXEL0, 0, SHADE, ENVIRONMENT, TEXEL0, TEXEL0, PRIMITIVE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_3D, PM_CC_3D);
gDPSetColorDither(gMainGfxPos++, G_CD_MAGICSQ); gDPSetColorDither(gMainGfxPos++, G_CD_MAGICSQ);
} }
} }
@ -782,7 +782,7 @@ void spr_init_sprites(s32 playerSpriteSet) {
spr_playerMaxComponents = 0; spr_playerMaxComponents = 0;
if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH) { if (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH) {
playerSpriteSet = PLAYER_SPRITES_PEACH_WORLD; playerSpriteSet = PLAYER_SPRITES_PEACH_WORLD;
} }

View File

@ -384,7 +384,7 @@ void appendGfx_shading_palette(
} }
gDPSetPrimColor(gMainGfxPos++, 0, 0, shadowR, shadowG, shadowB, alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, shadowR, shadowG, shadowB, alpha);
gDPSetCombineLERP(gMainGfxPos++, TEXEL1, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, COMBINED, TEXEL0, COMBINED_ALPHA, TEXEL0, PRIMITIVE, 0, TEXEL0, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_53, PM_CC_54);
gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, SpriteShadingPalette); gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, SpriteShadingPalette);
gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, 16, 1); gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, 16, 1);
@ -396,7 +396,7 @@ void appendGfx_shading_palette(
gDPSetPrimColor(gMainGfxPos++, 0, 0, shadowR, shadowG, shadowB, alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, shadowR, shadowG, shadowB, alpha);
gDPSetEnvColor(gMainGfxPos++, highlightR, highlightG, highlightB, 0); gDPSetEnvColor(gMainGfxPos++, highlightR, highlightG, highlightB, 0);
gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, ENVIRONMENT, TEXEL0_ALPHA, ENVIRONMENT, 0, 0, 0, 1, PRIMITIVE, ENVIRONMENT, TEXEL0_ALPHA, ENVIRONMENT, 0, 0, 0, 1); gDPSetCombineMode(gMainGfxPos++, PM_CC_55, PM_CC_55);
gSPTextureRectangle(gMainGfxPos++, 0, 0, 16 << 2, 1 << 2, 2, 0, 0, 4 << 10, 1 << 10); gSPTextureRectangle(gMainGfxPos++, 0, 0, 16 << 2, 1 << 2, 2, 0, 0, 4 << 10, 1 << 10);
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);
gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxCfb_ptr)); gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxCfb_ptr));
@ -419,9 +419,9 @@ void appendGfx_shading_palette(
gDPSetEnvColor(gMainGfxPos++, 100, 100, 100, 255); gDPSetEnvColor(gMainGfxPos++, 100, 100, 100, 255);
if (alpha == 255) { if (alpha == 255) {
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, TEXEL1, 0, 0, 0, 0, TEXEL1, SHADE, ENVIRONMENT, COMBINED, COMBINED, 0, 0, 0, COMBINED); gDPSetCombineMode(gMainGfxPos++, PM_CC_50, PM_CC_52);
} else { } else {
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, TEXEL1, 0, PRIMITIVE, 0, TEXEL1, 0, SHADE, ENVIRONMENT, COMBINED, COMBINED, 0, 0, 0, COMBINED); gDPSetCombineMode(gMainGfxPos++, PM_CC_51, PM_CC_52);
} }
offsetX = offsetXComp * facingDir; offsetX = offsetXComp * facingDir;

View File

@ -72,9 +72,9 @@ void state_step_battle(void) {
currentBattleSelection = UNPACK_BTL_AREA(gCurrentBattleID); currentBattleSelection = UNPACK_BTL_AREA(gCurrentBattleID);
currentBattleIndex = UNPACK_BTL_INDEX(gCurrentBattleID); currentBattleIndex = UNPACK_BTL_INDEX(gCurrentBattleID);
if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH || if (gGameStatusPtr->peachFlags & PEACH_FLAG_IS_PEACH ||
(currentBattleSelection == BTL_AREA_KKJ && currentBattleIndex == 0)) { (currentBattleSelection == BTL_AREA_KKJ && currentBattleIndex == 0)) {
gGameStatusPtr->peachFlags |= PEACH_STATUS_FLAG_IS_PEACH; gGameStatusPtr->peachFlags |= PEACH_FLAG_IS_PEACH;
spr_init_sprites(PLAYER_SPRITES_PEACH_BATTLE); spr_init_sprites(PLAYER_SPRITES_PEACH_BATTLE);
} else { } else {
spr_init_sprites(PLAYER_SPRITES_MARIO_BATTLE); spr_init_sprites(PLAYER_SPRITES_MARIO_BATTLE);
@ -152,7 +152,7 @@ void state_step_end_battle(void) {
func_8005AF84(); func_8005AF84();
func_8002ACDC(); func_8002ACDC();
sfx_clear_env_sounds(1); sfx_clear_env_sounds(1);
gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_IS_PEACH; gGameStatusPtr->peachFlags &= ~PEACH_FLAG_IS_PEACH;
battle_heap_create(); battle_heap_create();
spr_init_sprites(gGameStatusPtr->playerSpriteSet); spr_init_sprites(gGameStatusPtr->playerSpriteSet);
init_model_data(); init_model_data();
@ -190,7 +190,7 @@ void state_step_end_battle(void) {
load_map_bg(mapConfig->bgName); load_map_bg(mapConfig->bgName);
if (mapSettings->background != NULL) { if (mapSettings->background != NULL) {
read_background_size(mapSettings->background); set_background(mapSettings->background);
} else { } else {
set_background_size(296, 200, 12, 20); set_background_size(296, 200, 12, 20);
} }

View File

@ -247,7 +247,7 @@ void state_step_demo(void) {
gGameStatusPtr->areaID = areaID; gGameStatusPtr->areaID = areaID;
gGameStatusPtr->mapID = mapID; gGameStatusPtr->mapID = mapID;
gGameStatusPtr->entryID = demoSceneData->index; gGameStatusPtr->entryID = demoSceneData->index;
gGameStatusPtr->peachFlags = PEACH_STATUS_FLAG_IS_PEACH; gGameStatusPtr->peachFlags = PEACH_FLAG_IS_PEACH;
playerData->curPartner = demoSceneData->partnerID; playerData->curPartner = demoSceneData->partnerID;
set_cam_viewport(CAM_DEFAULT, 29, 20, -262, 177); set_cam_viewport(CAM_DEFAULT, 29, 20, -262, 177);
evt_set_variable(NULL, GB_StoryProgress, demoSceneData->storyProgress); evt_set_variable(NULL, GB_StoryProgress, demoSceneData->storyProgress);

View File

@ -323,7 +323,7 @@ void state_step_exit_language_select(void) {
bgHeader = mapSettings->background; bgHeader = mapSettings->background;
if (bgHeader != NULL) { if (bgHeader != NULL) {
read_background_size(bgHeader); set_background(bgHeader);
} else { } else {
set_background_size(296, 200, 12, 20); set_background_size(296, 200, 12, 20);
} }

View File

@ -197,7 +197,7 @@ void state_step_unpause(void) {
load_map_bg(mapConfig->bgName); load_map_bg(mapConfig->bgName);
if (mapSettings->background != NULL) { if (mapSettings->background != NULL) {
read_background_size(mapSettings->background); set_background(mapSettings->background);
} else { } else {
set_background_size(296, 200, 12, 20); set_background_size(296, 200, 12, 20);
} }

View File

@ -184,7 +184,7 @@ void state_init_title_screen(void) {
gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME; gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME;
game_mode_set_fpDrawAuxUI(0, appendGfx_title_screen); game_mode_set_fpDrawAuxUI(0, appendGfx_title_screen);
load_map_bg("title_bg"); load_map_bg("title_bg");
read_background_size(&gBackgroundImage); set_background(&gBackgroundImage);
bgm_set_song(0, SONG_MAIN_THEME, 0, 500, 8); bgm_set_song(0, SONG_MAIN_THEME, 0, 500, 8);
TitleScreen_TimeLeft = 480; TitleScreen_TimeLeft = 480;
} }

View File

@ -1,6 +1,6 @@
#include "common.h" #include "common.h"
#define MAP_TEXTURE_MEMORY_SIZE 0x20000 #define WORLD_TEXTURE_MEMORY_SIZE 0x20000
#define BTL_TEXTURE_MEMORY_SIZE 0x8000 #define BATTLE_TEXTURE_MEMORY_SIZE 0x8000
BSS u8 MapTextureMemory[MAP_TEXTURE_MEMORY_SIZE + BTL_TEXTURE_MEMORY_SIZE]; BSS u8 TextureHeap[WORLD_TEXTURE_MEMORY_SIZE + BATTLE_TEXTURE_MEMORY_SIZE];

View File

@ -115,7 +115,7 @@ void action_update_idle_peach(void) {
playerStatus->flags &= ~PS_FLAG_AIRBORNE; playerStatus->flags &= ~PS_FLAG_AIRBORNE;
if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) { if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) {
if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DEPRESSED)) { if (!(gGameStatusPtr->peachFlags & PEACH_FLAG_DEPRESSED)) {
suggest_player_anim_allow_backward(IdlePeachAnims[gGameStatusPtr->peachBakingIngredient]); suggest_player_anim_allow_backward(IdlePeachAnims[gGameStatusPtr->peachBakingIngredient]);
} else { } else {
suggest_player_anim_allow_backward(ANIM_Peach2_SadStill); suggest_player_anim_allow_backward(ANIM_Peach2_SadStill);

View File

@ -48,17 +48,17 @@ Npc* parasol_get_npc(void) {
Npc* ret = NULL; Npc* ret = NULL;
do { // TODO fix this do...while do { // TODO fix this do...while
if (playerStatus->availableDisguiseType != PEACH_DISGUISE_NONE) { if (playerStatus->availableDisguiseType != PEACH_DISGUISE_NONE) {
if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_8) { if (gGameStatusPtr->peachFlags & PEACH_FLAG_BLOCK_NEXT_DISGUISE) {
gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_8; gGameStatusPtr->peachFlags &= ~PEACH_FLAG_BLOCK_NEXT_DISGUISE;
} else { } else {
ret = npc_find_closest(playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z, 100.0f); ret = npc_find_closest(playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z, 100.0f);
if (ret != 0) { if (ret != 0) {
if (fabs(ret->pos.y - playerStatus->pos.y) - 1.0 > 0.0) { if (fabs(ret->pos.y - playerStatus->pos.y) - 1.0 > 0.0) {
ret = 0; ret = NULL;
} else { } else {
angle = clamp_angle(atan2(playerStatus->pos.x, playerStatus->pos.z, ret->pos.x, ret->pos.z)); angle = clamp_angle(atan2(playerStatus->pos.x, playerStatus->pos.z, ret->pos.x, ret->pos.z));
if (fabs(angle - func_800E5348()) > 30.0) { if (fabs(angle - func_800E5348()) > 30.0) {
ret = 0; ret = NULL;
} }
} }
} }
@ -189,7 +189,7 @@ void action_update_parasol(void) {
case SUBSTATE_DISGUISE_MAKE_NPC: case SUBSTATE_DISGUISE_MAKE_NPC:
gameStatus = gGameStatusPtr; gameStatus = gGameStatusPtr;
playerStatus->animFlags |= PA_FLAG_INVISIBLE; playerStatus->animFlags |= PA_FLAG_INVISIBLE;
gameStatus->peachFlags |= PEACH_STATUS_FLAG_DISGUISED; gameStatus->peachFlags |= PEACH_FLAG_DISGUISED;
playerStatus->actionSubstate++; // SUBSTATE_DISGUISE_SPIN_DOWN playerStatus->actionSubstate++; // SUBSTATE_DISGUISE_SPIN_DOWN
case SUBSTATE_DISGUISE_SPIN_DOWN: case SUBSTATE_DISGUISE_SPIN_DOWN:
if (--playerStatus->curStateTime == 0) { if (--playerStatus->curStateTime == 0) {
@ -265,7 +265,7 @@ void action_update_parasol(void) {
playerStatus->actionSubstate++; // SUBSTATE_SPIN_DOWN playerStatus->actionSubstate++; // SUBSTATE_SPIN_DOWN
gameStatus2 = gGameStatusPtr; gameStatus2 = gGameStatusPtr;
playerStatus->animFlags &= ~PA_FLAG_INVISIBLE; playerStatus->animFlags &= ~PA_FLAG_INVISIBLE;
gameStatus2->peachFlags &= ~PEACH_STATUS_FLAG_DISGUISED; gameStatus2->peachFlags &= ~PEACH_FLAG_DISGUISED;
playerStatus->peachDisguise = 0; playerStatus->peachDisguise = 0;
free_npc_by_index(PeachDisguiseNpcIndex); free_npc_by_index(PeachDisguiseNpcIndex);
playerStatus->colliderHeight = 55; playerStatus->colliderHeight = 55;

View File

@ -78,7 +78,7 @@ void action_update_step_up(void) {
void func_802B6198_E24768(void) { void func_802B6198_E24768(void) {
if (!(gPlayerStatus.animFlags & PA_FLAG_INVISIBLE)) { if (!(gPlayerStatus.animFlags & PA_FLAG_INVISIBLE)) {
if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DEPRESSED)) { if (!(gGameStatusPtr->peachFlags & PEACH_FLAG_DEPRESSED)) {
suggest_player_anim_allow_backward(StepUpPeachAnims[gGameStatusPtr->peachBakingIngredient]); suggest_player_anim_allow_backward(StepUpPeachAnims[gGameStatusPtr->peachBakingIngredient]);
} else { } else {
suggest_player_anim_allow_backward(ANIM_Peach3_WalkSad); suggest_player_anim_allow_backward(ANIM_Peach3_WalkSad);

View File

@ -200,7 +200,7 @@ void action_update_run(void) {
void func_802B6550_E23C30(void) { void func_802B6550_E23C30(void) {
if (!(gPlayerStatus.animFlags & PA_FLAG_INVISIBLE)) { if (!(gPlayerStatus.animFlags & PA_FLAG_INVISIBLE)) {
if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_DEPRESSED)) { if (!(gGameStatusPtr->peachFlags & PEACH_FLAG_DEPRESSED)) {
suggest_player_anim_allow_backward(WalkPeachAnims[gGameStatusPtr->peachBakingIngredient]); suggest_player_anim_allow_backward(WalkPeachAnims[gGameStatusPtr->peachBakingIngredient]);
return; return;
} }
@ -263,7 +263,7 @@ static void action_update_run_peach(void) {
if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) { if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) {
gameStatus = gGameStatusPtr; gameStatus = gGameStatusPtr;
if (!(gameStatus->peachFlags & PEACH_STATUS_FLAG_DEPRESSED)) { if (!(gameStatus->peachFlags & PEACH_FLAG_DEPRESSED)) {
if (!gameStatus->peachBakingIngredient) { if (!gameStatus->peachBakingIngredient) {
suggest_player_anim_allow_backward(ANIM_Peach1_Run); suggest_player_anim_allow_backward(ANIM_Peach1_Run);
} else { } else {

View File

@ -2,7 +2,7 @@
#include "world/common/entity/Pipe.inc.c" #include "world/common/entity/Pipe.inc.c"
#include "world/common/atomic/UnkFunc27.inc.c" #include "world/common/atomic/ApplyTint.inc.c"
EvtScript N(EVS_ExitWalk_sbk_36_1) = { EvtScript N(EVS_ExitWalk_sbk_36_1) = {
EVT_SET_GROUP(EVT_GROUP_1B) EVT_SET_GROUP(EVT_GROUP_1B)
@ -30,9 +30,9 @@ EvtScript N(EVS_Scene_RuinsRising) = {
EVT_CALL(SetPanTarget, CAM_DEFAULT, 175, 0, -201) EVT_CALL(SetPanTarget, CAM_DEFAULT, 175, 0, -201)
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(N(UnkFunc27), 2, 0, FOG_MODE_3) EVT_CALL(N(SetModelTintMode), APPLY_TINT_BG, NULL, ENV_TINT_REMAP)
EVT_CALL(N(UnkFunc27), 1, -1, FOG_MODE_3) EVT_CALL(N(SetModelTintMode), APPLY_TINT_GROUPS, -1, ENV_TINT_REMAP)
EVT_CALL(N(UnkFunc26), 3, 44, 32, 177, 0, 0, 0, 0, 0, 0) EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 44, 32, 177, 0, 0, 0, 0, 0, 0)
EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(DisablePlayerInput, TRUE)
EVT_THREAD EVT_THREAD
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 300, EVT_FLOAT(0.2)) EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 300, EVT_FLOAT(0.2))

View File

@ -1,6 +1,6 @@
#include "dro_02.h" #include "dro_02.h"
#include "world/common/atomic/UnkFunc27.inc.c" #include "world/common/atomic/ApplyTint.inc.c"
EvtScript N(EVS_ExitWalk_dro_01_1) = EVT_EXIT_WALK(60, dro_02_ENTRY_0, "dro_01", dro_01_ENTRY_1); EvtScript N(EVS_ExitWalk_dro_01_1) = EVT_EXIT_WALK(60, dro_02_ENTRY_0, "dro_01", dro_01_ENTRY_1);
@ -26,9 +26,9 @@ EvtScript N(EVS_EnterScene) = {
EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(13.0), EVT_FLOAT(-10.0)) EVT_CALL(SetCamPitch, CAM_DEFAULT, EVT_FLOAT(13.0), EVT_FLOAT(-10.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0)) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(90.0))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)
EVT_CALL(N(UnkFunc27), 2, 0, FOG_MODE_3) EVT_CALL(N(SetModelTintMode), APPLY_TINT_BG, NULL, ENV_TINT_REMAP)
EVT_CALL(N(UnkFunc27), 1, -1, FOG_MODE_3) EVT_CALL(N(SetModelTintMode), APPLY_TINT_GROUPS, -1, ENV_TINT_REMAP)
EVT_CALL(N(UnkFunc26), 3, 44, 32, 177, 0, 0, 0, 0, 0, 0) EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 44, 32, 177, 0, 0, 0, 0, 0, 0)
EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(DisablePlayerInput, TRUE)
EVT_THREAD EVT_THREAD
EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 300, EVT_FLOAT(0.2)) EVT_CALL(ShakeCam, CAM_DEFAULT, 0, 300, EVT_FLOAT(0.2))

View File

@ -115,9 +115,9 @@ API_CALLABLE(N(DarkenWorld)) {
s32 i; s32 i;
if (isInitialCall) { if (isInitialCall) {
mdl_set_all_fog_mode(FOG_MODE_1); mdl_set_all_tint_type(ENV_TINT_SHROUD);
*gBackgroundFogModePtr = FOG_MODE_1; *gBackgroundTintModePtr = ENV_TINT_SHROUD;
set_background_color_blend(0, 0, 0, 0); mdl_set_shroud_tint_params(0, 0, 0, 0);
for (i = 0; i < MAX_NPCS; i++) { for (i = 0; i < MAX_NPCS; i++) {
Npc* npc = get_npc_by_index(i); Npc* npc = get_npc_by_index(i);
@ -132,7 +132,7 @@ API_CALLABLE(N(DarkenWorld)) {
if (script->functionTemp[0] > 255) { if (script->functionTemp[0] > 255) {
script->functionTemp[0] = 255; script->functionTemp[0] = 255;
} }
set_background_color_blend(0, 0, 0, script->functionTemp[0]); mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]);
return (script->functionTemp[0] == 255) * ApiStatus_DONE2; return (script->functionTemp[0] == 255) * ApiStatus_DONE2;
} }
@ -141,7 +141,7 @@ API_CALLABLE(N(UndarkenWorld)) {
s32 i; s32 i;
if (isInitialCall) { if (isInitialCall) {
set_background_color_blend(0, 0, 0, 255); mdl_set_shroud_tint_params(0, 0, 0, 255);
script->functionTemp[0] = 255; script->functionTemp[0] = 255;
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
} }
@ -149,13 +149,13 @@ API_CALLABLE(N(UndarkenWorld)) {
if (script->functionTemp[0] < 0) { if (script->functionTemp[0] < 0) {
script->functionTemp[0] = 0; script->functionTemp[0] = 0;
} }
set_background_color_blend(0, 0, 0, script->functionTemp[0]); mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]);
if (script->functionTemp[0] == 0 && script->functionTemp[1] == 0) { if (script->functionTemp[0] == 0 && script->functionTemp[1] == 0) {
script->functionTemp[1] = 1; script->functionTemp[1] = 1;
} else if (script->functionTemp[1] == 1) { } else if (script->functionTemp[1] == 1) {
mdl_set_all_fog_mode(FOG_MODE_0); mdl_set_all_tint_type(ENV_TINT_NONE);
*gBackgroundFogModePtr = FOG_MODE_0; *gBackgroundTintModePtr = ENV_TINT_NONE;
for (i = 0; i < MAX_NPCS; i++) { for (i = 0; i < MAX_NPCS; i++) {
Npc* npc = get_npc_by_index(i); Npc* npc = get_npc_by_index(i);

View File

@ -5,8 +5,8 @@
extern s32 N(SpotlightsAlpha); extern s32 N(SpotlightsAlpha);
API_CALLABLE(N(SetWorldDark)) { API_CALLABLE(N(SetWorldDark)) {
func_8011B950(MODEL_Root, CUSTOM_GFX_NONE, FOG_MODE_1, 0); mdl_group_set_custom_gfx(MODEL_Root, CUSTOM_GFX_NONE, ENV_TINT_SHROUD, FALSE);
set_background_color_blend(0, 0, 0, 255); mdl_set_shroud_tint_params(0, 0, 0, 255);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -20,10 +20,10 @@ API_CALLABLE(N(FadeInWorld)) {
script->functionTemp[1] = 0; script->functionTemp[1] = 0;
} }
set_background_color_blend(0, 0, 0, script->functionTemp[1]); mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[1]);
if (script->functionTemp[1] == 0) { if (script->functionTemp[1] == 0) {
func_8011B950(MODEL_Root, CUSTOM_GFX_NONE, FOG_MODE_0, 0); mdl_group_set_custom_gfx(MODEL_Root, CUSTOM_GFX_NONE, ENV_TINT_NONE, FALSE);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} else { } else {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
@ -111,7 +111,7 @@ API_CALLABLE(N(SetSpotlightsAlpha)) {
} }
void N(gfx_build_set_spotlight_alpha)(void) { void N(gfx_build_set_spotlight_alpha)(void) {
gDPSetCombineLERP(gMainGfxPos++, TEXEL0, 0, SHADE, 0, SHADE, 0, PRIMITIVE, 0, TEXEL0, 0, SHADE, 0, SHADE, 0, PRIMITIVE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_3F, PM_CC_3F);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, N(SpotlightsAlpha)); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, N(SpotlightsAlpha));
} }

View File

@ -1,6 +1,6 @@
#include "end_01.h" #include "end_01.h"
#include "world/common/atomic/UnkFunc27.inc.c" #include "world/common/atomic/ApplyTint.inc.c"
EvtScript N(EVS_TexPan_ShyGuyFloat_Sides) = { EvtScript N(EVS_TexPan_ShyGuyFloat_Sides) = {
EVT_CALL(EnableTexPanning, MODEL_omo1, TRUE) EVT_CALL(EnableTexPanning, MODEL_omo1, TRUE)
@ -32,7 +32,7 @@ EvtScript N(EVS_TexPan_ShyGuyFloat_Top) = {
s32 N(ShyGuyFloat_InteriorModels)[] = { s32 N(ShyGuyFloat_InteriorModels)[] = {
MODEL_omo7, MODEL_omo9, MODEL_omo10, MODEL_omo11, MODEL_omo7, MODEL_omo9, MODEL_omo10, MODEL_omo11,
MODEL_omo12, MODEL_omo13, MODEL_omo14, 0x0000FFFF MODEL_omo12, MODEL_omo13, MODEL_omo14, 0xFFFF
}; };
EvtScript N(EVS_ShyGuyFloat_Open) = { EvtScript N(EVS_ShyGuyFloat_Open) = {
@ -58,10 +58,10 @@ EvtScript N(EVS_ShyGuyFloat_Open) = {
EVT_END_IF EVT_END_IF
EVT_END_LOOP EVT_END_LOOP
EVT_END_THREAD EVT_END_THREAD
EVT_CALL(N(UnkFunc27), 0, EVT_PTR(N(ShyGuyFloat_InteriorModels)), FOG_MODE_3) EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, EVT_PTR(N(ShyGuyFloat_InteriorModels)), ENV_TINT_REMAP)
EVT_CALL(N(UnkFunc26), 3, 255, 255, 255, 120, 120, 80, 0, 0, 0) EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 255, 255, 255, 120, 120, 80, 0, 0, 0)
EVT_WAIT(30) EVT_WAIT(30)
EVT_CALL(N(UnkFunc26), 3, 255, 255, 255, 0, 0, 0, 0, 0, 0) EVT_CALL(N(SetModelTintParams), ENV_TINT_REMAP, 255, 255, 255, 0, 0, 0, 0, 0, 0)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };

View File

@ -230,7 +230,7 @@ void N(UnkModelFunc001)(void) {
gDPSetRenderMode(gMainGfxPos++, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | G_RM_PASS, gDPSetRenderMode(gMainGfxPos++, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | G_RM_PASS,
Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)); Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1));
gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxZBuffer)); gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxZBuffer));
gDPSetCombineMode(gMainGfxPos++, PM_CC_09, PM_CC_09); gDPSetCombineMode(gMainGfxPos++, PM_CC_PRIM_NO_ALPHA, PM_CC_PRIM_NO_ALPHA);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 248, 240, 240, 0); gDPSetPrimColor(gMainGfxPos++, 0, 0, 248, 240, 240, 0);
gDPPipeSync(gMainGfxPos++); gDPPipeSync(gMainGfxPos++);

View File

@ -10,12 +10,12 @@ void N(setup_gfx_background_shade)(void) {
alpha = 216; alpha = 216;
} }
gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE); gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
gDPSetCombineLERP(gMainGfxPos++, 0, 0, 0, SHADE, SHADE, 0, PRIMITIVE, 0, 0, 0, 0, SHADE, SHADE, 0, PRIMITIVE, 0); gDPSetCombineMode(gMainGfxPos++, PM_CC_HOS_BG_SHADE, PM_CC_HOS_BG_SHADE);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha);
} }
EvtScript N(EVS_SetupBackgroundShade) = { EvtScript N(EVS_SetupBackgroundShade) = {
EVT_CALL(SetModelCustomGfx, MODEL_g107, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_g107, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_background_shade)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_background_shade)), NULL)
EVT_RETURN EVT_RETURN
EVT_END EVT_END

View File

@ -144,16 +144,16 @@ EvtScript N(EVS_SetupModelFX) = {
EVT_CALL(SetRenderMode, MODEL_5, RENDER_MODE_SURFACE_XLU_LAYER2) EVT_CALL(SetRenderMode, MODEL_5, RENDER_MODE_SURFACE_XLU_LAYER2)
EVT_CALL(SetRenderMode, MODEL_6, RENDER_MODE_SURFACE_XLU_LAYER2) EVT_CALL(SetRenderMode, MODEL_6, RENDER_MODE_SURFACE_XLU_LAYER2)
EVT_CALL(SetRenderMode, MODEL_7, RENDER_MODE_SURFACE_XLU_LAYER2) EVT_CALL(SetRenderMode, MODEL_7, RENDER_MODE_SURFACE_XLU_LAYER2)
EVT_CALL(SetModelCustomGfx, MODEL_1, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_1, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_2, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_2, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_3, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_3, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_4, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_4, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_5, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_5, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_6, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_6, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_7, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_7, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_glowing_star)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_glowing_star)), NULL)
EVT_CALL(TranslateModel, MODEL_power, 0, 2, 0) EVT_CALL(TranslateModel, MODEL_power, 0, 2, 0)
EVT_CALL(SetModelCustomGfx, MODEL_power, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_power, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_giving_power)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_giving_power)), NULL)
EVT_THREAD EVT_THREAD
EVT_LOOP(0) EVT_LOOP(0)

View File

@ -158,12 +158,12 @@ EvtScript N(EVS_SetupModelFX) = {
EVT_EXEC(N(EVS_UpdateTexturePan)) EVT_EXEC(N(EVS_UpdateTexturePan))
EVT_END_THREAD EVT_END_THREAD
// custom gfx for lantern glow halos, flags for the entire lamp posts // custom gfx for lantern glow halos, flags for the entire lamp posts
EVT_CALL(SetModelCustomGfx, MODEL_o414, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o414, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o415, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o415, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o399, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o399, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o398, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o398, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o347, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o347, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o348, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o348, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(build_gfx_lamp_halos)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(build_gfx_lamp_halos)), NULL)
EVT_CALL(SetModelFlags, MODEL_o414, MODEL_FLAG_USE_CAMERA_UNK_MATRIX, TRUE) EVT_CALL(SetModelFlags, MODEL_o414, MODEL_FLAG_USE_CAMERA_UNK_MATRIX, TRUE)
EVT_CALL(SetModelFlags, MODEL_o415, MODEL_FLAG_USE_CAMERA_UNK_MATRIX, TRUE) EVT_CALL(SetModelFlags, MODEL_o415, MODEL_FLAG_USE_CAMERA_UNK_MATRIX, TRUE)
@ -183,17 +183,17 @@ EvtScript N(EVS_SetupModelFX) = {
// yellow stars // yellow stars
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o466, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o466, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(build_gfx_yellow_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(build_gfx_yellow_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o466, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o466, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o467, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o467, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o468, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o468, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o469, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o469, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o470, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o470, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o471, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o471, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o472, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o472, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o541, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o541, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o542, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o542, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o545, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o545, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o548, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o548, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o466, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o466, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(SetModelFlags, MODEL_o467, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o467, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(SetModelFlags, MODEL_o468, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o468, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
@ -208,22 +208,22 @@ EvtScript N(EVS_SetupModelFX) = {
// blue stars // blue stars
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_o466, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_1, MODEL_o466, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(build_gfx_blue_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_2, EVT_PTR(N(build_gfx_blue_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o543, CUSTOM_GFX_2, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o543, CUSTOM_GFX_2, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o539, CUSTOM_GFX_2, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o539, CUSTOM_GFX_2, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o543, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o543, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(SetModelFlags, MODEL_o539, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o539, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
// green stars // green stars
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_2, MODEL_o466, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_2, MODEL_o466, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_3, EVT_PTR(N(build_gfx_green_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_3, EVT_PTR(N(build_gfx_green_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o546, CUSTOM_GFX_3, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o546, CUSTOM_GFX_3, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o540, CUSTOM_GFX_3, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o540, CUSTOM_GFX_3, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o546, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o546, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(SetModelFlags, MODEL_o540, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o540, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
// pink stars // pink stars
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_3, MODEL_o466, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_3, MODEL_o466, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_4, EVT_PTR(N(build_gfx_pink_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_4, EVT_PTR(N(build_gfx_pink_stars)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o544, CUSTOM_GFX_4, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o544, CUSTOM_GFX_4, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o547, CUSTOM_GFX_4, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o547, CUSTOM_GFX_4, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelFlags, MODEL_o544, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o544, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_CALL(SetModelFlags, MODEL_o547, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE) EVT_CALL(SetModelFlags, MODEL_o547, MODEL_FLAG_HAS_LOCAL_VERTEX_COPY, TRUE)
EVT_THREAD EVT_THREAD

View File

@ -154,7 +154,7 @@ EvtScript N(EVS_SetupAurora) = {
EVT_CALL(SetTexPanner, MODEL_o160, TEX_PANNER_7) EVT_CALL(SetTexPanner, MODEL_o160, TEX_PANNER_7)
EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o76, TRUE) EVT_CALL(MakeLocalVertexCopy, VTX_COPY_0, MODEL_o76, TRUE)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(build_gfx_aurora)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(build_gfx_aurora)), NULL)
EVT_CALL(SetModelCustomGfx, MODEL_o76, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o76, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_RETURN EVT_RETURN
EVT_END EVT_END
}; };

View File

@ -40,10 +40,10 @@ EvtScript N(EVS_SetupFountains) = {
EVT_CALL(EnableTexPanning, MODEL_o438, TRUE) EVT_CALL(EnableTexPanning, MODEL_o438, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o462, TRUE) EVT_CALL(EnableTexPanning, MODEL_o462, TRUE)
EVT_CALL(EnableTexPanning, MODEL_o469, TRUE) EVT_CALL(EnableTexPanning, MODEL_o469, TRUE)
EVT_CALL(SetModelCustomGfx, MODEL_o469, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o469, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o462, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o462, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o465, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o465, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetModelCustomGfx, MODEL_o461, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o461, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_fountain_water)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_fountain_water)), NULL)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_fountain_stars)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_fountain_stars)), NULL)
EVT_RETURN EVT_RETURN

View File

@ -1,6 +1,6 @@
#include "hos_05.h" #include "hos_05.h"
#include "world/common/atomic/UnkFunc27.inc.c" #include "world/common/atomic/ApplyTint.inc.c"
#include "world/common/atomic/TexturePan.inc.c" #include "world/common/atomic/TexturePan.inc.c"

View File

@ -217,7 +217,7 @@ API_CALLABLE(N(SetWorldFogParams)) {
s32 fogStart = evt_get_variable(script, *args++); s32 fogStart = evt_get_variable(script, *args++);
s32 fogEnd = evt_get_variable(script, *args++); s32 fogEnd = evt_get_variable(script, *args++);
set_model_fog_color_parameters(primR, primG, primB, primA, fogR, fogG, fogB, fogStart, fogEnd); mdl_set_depth_tint_params(primR, primG, primB, primA, fogR, fogG, fogB, fogStart, fogEnd);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -231,7 +231,7 @@ API_CALLABLE(N(SetWorldColorParams)) {
args = script->ptrReadPos; args = script->ptrReadPos;
if (isInitialCall) { if (isInitialCall) {
get_model_env_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); mdl_get_remap_tint_params(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB);
newPrimR = evt_get_variable(script, *args++); newPrimR = evt_get_variable(script, *args++);
newPrimG = evt_get_variable(script, *args++); newPrimG = evt_get_variable(script, *args++);
newPrimB = evt_get_variable(script, *args++); newPrimB = evt_get_variable(script, *args++);
@ -247,7 +247,7 @@ API_CALLABLE(N(SetWorldColorParams)) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
time++; time++;
set_model_env_color_parameters( mdl_set_remap_tint_params(
(oldPrimR + ((newPrimR - oldPrimR) * time) / duration), (oldPrimR + ((newPrimR - oldPrimR) * time) / duration),
(oldPrimG + ((newPrimG - oldPrimG) * time) / duration), (oldPrimG + ((newPrimG - oldPrimG) * time) / duration),
(oldPrimB + ((newPrimB - oldPrimB) * time) / duration), (oldPrimB + ((newPrimB - oldPrimB) * time) / duration),
@ -258,7 +258,7 @@ API_CALLABLE(N(SetWorldColorParams)) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
} else { } else {
set_model_env_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); mdl_set_remap_tint_params(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
@ -287,8 +287,8 @@ API_CALLABLE(N(ResumeIntro)) {
return ApiStatus_DONE1; return ApiStatus_DONE1;
} }
API_CALLABLE(N(InitWorldFogMode)) { API_CALLABLE(N(InitWorldTintMode)) {
mdl_set_all_fog_mode(FOG_MODE_3); mdl_set_all_tint_type(ENV_TINT_REMAP);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -1442,7 +1442,7 @@ void N(worker_draw_story_graphics)(void) {
} }
get_screen_overlay_params(SCREEN_LAYER_BACK, &overlayType, &overlayAlpha); get_screen_overlay_params(SCREEN_LAYER_BACK, &overlayType, &overlayAlpha);
if (overlayAlpha != 0.0f) { if (overlayAlpha != 0.0f) {
gDPSetCombineLERP(gMainGfxPos++, PRIMITIVE, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, 1, PRIMITIVE, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, 0, 0, 0, 1); gDPSetCombineMode(gMainGfxPos++, PM_CC_43, PM_CC_43);
gDPSetPrimColor(gMainGfxPos++, 0, 0, 208, 208, 208, (s32) overlayAlpha); gDPSetPrimColor(gMainGfxPos++, 0, 0, 208, 208, 208, (s32) overlayAlpha);
} }
@ -1882,7 +1882,7 @@ EvtScript N(EVS_Intro_Main) = {
EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePlayerPhysics, TRUE) EVT_CALL(DisablePlayerPhysics, TRUE)
EVT_CALL(N(SetWorldFogParams), 0, 0, 0, 0, 0, 0, 0, 995, 1000) EVT_CALL(N(SetWorldFogParams), 0, 0, 0, 0, 0, 0, 0, 995, 1000)
EVT_CALL(N(InitWorldFogMode)) EVT_CALL(N(InitWorldTintMode))
EVT_CALL(N(SetWorldColorParams), 255, 255, 255, 0, 0, 0, 0) EVT_CALL(N(SetWorldColorParams), 255, 255, 255, 0, 0, 0, 0)
EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE) EVT_CALL(SetCamLeadPlayer, CAM_DEFAULT, FALSE)
EVT_CALL(N(AdjustCamVfov), 0, 62) EVT_CALL(N(AdjustCamVfov), 0, 62)

View File

@ -7,7 +7,7 @@ extern u16 StarShrineLightBeamAlpha;
MAP_RODATA_PAD(1,unk); MAP_RODATA_PAD(1,unk);
#define NAME_SUFFIX _Starship #define NAME_SUFFIX _Starship
#include "world/common/atomic/UnkFunc27.inc.c" #include "world/common/atomic/ApplyTint.inc.c"
#include "world/common/atomic/TexturePan.inc.c" #include "world/common/atomic/TexturePan.inc.c"
API_CALLABLE(N(SetWorldColorParams)) { API_CALLABLE(N(SetWorldColorParams)) {
@ -20,7 +20,7 @@ API_CALLABLE(N(SetWorldColorParams)) {
args = script->ptrReadPos; args = script->ptrReadPos;
if (isInitialCall) { if (isInitialCall) {
get_model_env_color_parameters(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB); mdl_get_remap_tint_params(&oldPrimR, &oldPrimG, &oldPrimB, &oldEnvR, &oldEnvG, &oldEnvB);
newPrimR = evt_get_variable(script, *args++); newPrimR = evt_get_variable(script, *args++);
newPrimG = evt_get_variable(script, *args++); newPrimG = evt_get_variable(script, *args++);
newPrimB = evt_get_variable(script, *args++); newPrimB = evt_get_variable(script, *args++);
@ -33,7 +33,7 @@ API_CALLABLE(N(SetWorldColorParams)) {
if (duration > 0) { if (duration > 0) {
time++; time++;
set_model_env_color_parameters( mdl_set_remap_tint_params(
oldPrimR + ((newPrimR - oldPrimR) * time) / duration, oldPrimR + ((newPrimR - oldPrimR) * time) / duration,
oldPrimG + ((newPrimG - oldPrimG) * time) / duration, oldPrimG + ((newPrimG - oldPrimG) * time) / duration,
oldPrimB + ((newPrimB - oldPrimB) * time) / duration, oldPrimB + ((newPrimB - oldPrimB) * time) / duration,
@ -44,7 +44,7 @@ API_CALLABLE(N(SetWorldColorParams)) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
} else { } else {
set_model_env_color_parameters(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB); mdl_set_remap_tint_params(newPrimR, newPrimG, newPrimB, newEnvR, newEnvG, newEnvB);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
@ -165,7 +165,7 @@ EvtScript N(EVS_SetupLightBeam) = {
EVT_IF_LT(GB_StoryProgress, STORY_CH8_STAR_SHIP_ACTIVATED) EVT_IF_LT(GB_StoryProgress, STORY_CH8_STAR_SHIP_ACTIVATED)
EVT_CALL(EnableModel, MODEL_o8, FALSE) EVT_CALL(EnableModel, MODEL_o8, FALSE)
EVT_ELSE EVT_ELSE
EVT_CALL(SetModelCustomGfx, MODEL_o8, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o8, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_light_beam)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_light_beam)), NULL)
EVT_CALL(EnableModel, MODEL_o8, TRUE) EVT_CALL(EnableModel, MODEL_o8, TRUE)
EVT_CALL(N(SetLightBeamAlpha), 127) EVT_CALL(N(SetLightBeamAlpha), 127)
@ -183,8 +183,8 @@ EvtScript N(EVS_SetupLightBeam) = {
EvtScript N(EVS_Starship_Summon) = { EvtScript N(EVS_Starship_Summon) = {
EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(DisablePlayerInput, TRUE)
EVT_THREAD EVT_THREAD
EVT_CALL(N(UnkFunc27_Starship), 2, NULL, FOG_MODE_3) EVT_CALL(N(SetModelTintMode_Starship), 2, NULL, ENV_TINT_REMAP)
EVT_CALL(N(UnkFunc27_Starship), 1, EVT_PTR(N(MostSolidGeometry)), FOG_MODE_3) EVT_CALL(N(SetModelTintMode_Starship), 1, EVT_PTR(N(MostSolidGeometry)), ENV_TINT_REMAP)
EVT_CALL(N(SetWorldColorParams_Starship), 255, 255, 255, 0, 0, 0, 0) EVT_CALL(N(SetWorldColorParams_Starship), 255, 255, 255, 0, 0, 0, 0)
EVT_WAIT(1) EVT_WAIT(1)
EVT_CALL(N(SetWorldColorParams_Starship), 102, 102, 102, 0, 0, 0, 60) EVT_CALL(N(SetWorldColorParams_Starship), 102, 102, 102, 0, 0, 0, 60)
@ -204,7 +204,7 @@ EvtScript N(EVS_Starship_Summon) = {
EVT_CALL(PlaySoundAt, SOUND_STARSHIP_APPEARS, SOUND_SPACE_DEFAULT, 0, 250, 0) EVT_CALL(PlaySoundAt, SOUND_STARSHIP_APPEARS, SOUND_SPACE_DEFAULT, 0, 250, 0)
EVT_PLAY_EFFECT(EFFECT_LIGHT_RAYS, 2, 0, 250, 0, 10, LVar9) EVT_PLAY_EFFECT(EFFECT_LIGHT_RAYS, 2, 0, 250, 0, 10, LVar9)
EVT_WAIT(20) EVT_WAIT(20)
EVT_CALL(SetModelCustomGfx, MODEL_o646, CUSTOM_GFX_1, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o646, CUSTOM_GFX_1, ENV_TINT_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_starship_shimmer)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_1, EVT_PTR(N(setup_gfx_starship_shimmer)), NULL)
EVT_CALL(EnableGroup, MODEL_g279, TRUE) EVT_CALL(EnableGroup, MODEL_g279, TRUE)
EVT_THREAD EVT_THREAD
@ -219,7 +219,7 @@ EvtScript N(EVS_Starship_Summon) = {
EVT_END_LOOP EVT_END_LOOP
EVT_END_THREAD EVT_END_THREAD
EVT_WAIT(60) EVT_WAIT(60)
EVT_CALL(SetModelCustomGfx, MODEL_o8, CUSTOM_GFX_0, FOG_MODE_UNCHANGED) EVT_CALL(SetModelCustomGfx, MODEL_o8, CUSTOM_GFX_0, ENV_TINT_UNCHANGED)
EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_light_beam)), NULL) EVT_CALL(SetCustomGfxBuilders, CUSTOM_GFX_0, EVT_PTR(N(setup_gfx_light_beam)), NULL)
EVT_CALL(EnableModel, MODEL_o8, TRUE) EVT_CALL(EnableModel, MODEL_o8, TRUE)
EVT_CALL(MakeLerp, 0, 127, 60, EASING_COS_IN_OUT) EVT_CALL(MakeLerp, 0, 127, 60, EASING_COS_IN_OUT)

View File

@ -418,14 +418,14 @@ API_CALLABLE(N(RefundHintCoins)) {
API_CALLABLE(N(func_802418E8_A3ADC8)) { API_CALLABLE(N(func_802418E8_A3ADC8)) {
if (isInitialCall) { if (isInitialCall) {
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o98)), -1, FOG_MODE_3); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o98)), CUSTOM_GFX_NONE, ENV_TINT_REMAP);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o76)), -1, FOG_MODE_3); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o76)), CUSTOM_GFX_NONE, ENV_TINT_REMAP);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o84)), -1, FOG_MODE_3); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o84)), CUSTOM_GFX_NONE, ENV_TINT_REMAP);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o85)), -1, FOG_MODE_3); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o85)), CUSTOM_GFX_NONE, ENV_TINT_REMAP);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o89)), -1, FOG_MODE_3); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o89)), CUSTOM_GFX_NONE, ENV_TINT_REMAP);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o104)), -1, FOG_MODE_3); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o104)), CUSTOM_GFX_NONE, ENV_TINT_REMAP);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o78)), -1, FOG_MODE_3); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o78)), CUSTOM_GFX_NONE, ENV_TINT_REMAP);
set_model_env_color_parameters(255, 255, 255, 0, 0, 0); mdl_set_remap_tint_params(255, 255, 255, 0, 0, 0);
script->functionTemp[0] = 255; script->functionTemp[0] = 255;
} }
@ -433,7 +433,7 @@ API_CALLABLE(N(func_802418E8_A3ADC8)) {
if (script->functionTemp[0] < 64) { if (script->functionTemp[0] < 64) {
script->functionTemp[0] = 64; script->functionTemp[0] = 64;
} }
set_model_env_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); mdl_set_remap_tint_params(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0);
if (script->functionTemp[0] == 64) { if (script->functionTemp[0] == 64) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -468,7 +468,7 @@ API_CALLABLE(N(func_80241A58_A3AF38)) {
script->functionTemp[2] = 0; script->functionTemp[2] = 0;
} }
} }
set_model_env_color_parameters( mdl_set_remap_tint_params(
script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], script->functionTemp[0],
script->functionTemp[2], script->functionTemp[2], script->functionTemp[2] script->functionTemp[2], script->functionTemp[2], script->functionTemp[2]
); );
@ -487,16 +487,16 @@ API_CALLABLE(N(func_80241B74_A3B054)) {
if (script->functionTemp[0] > 255) { if (script->functionTemp[0] > 255) {
script->functionTemp[0] = 255; script->functionTemp[0] = 255;
} }
set_model_env_color_parameters(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0); mdl_set_remap_tint_params(script->functionTemp[0], script->functionTemp[0], script->functionTemp[0], 0, 0, 0);
if (script->functionTemp[0] == 255) { if (script->functionTemp[0] == 255) {
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o98)), -1, FOG_MODE_0); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o98)), CUSTOM_GFX_NONE, ENV_TINT_NONE);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o76)), -1, FOG_MODE_0); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o76)), CUSTOM_GFX_NONE, ENV_TINT_NONE);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o84)), -1, FOG_MODE_0); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o84)), CUSTOM_GFX_NONE, ENV_TINT_NONE);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o85)), -1, FOG_MODE_0); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o85)), CUSTOM_GFX_NONE, ENV_TINT_NONE);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o89)), -1, FOG_MODE_0); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o89)), CUSTOM_GFX_NONE, ENV_TINT_NONE);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o104)), -1, FOG_MODE_0); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o104)), CUSTOM_GFX_NONE, ENV_TINT_NONE);
set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o78)), -1, FOG_MODE_0); set_mdl_custom_gfx_set(get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_o78)), CUSTOM_GFX_NONE, ENV_TINT_NONE);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
return ApiStatus_BLOCK; return ApiStatus_BLOCK;

View File

@ -1,14 +1,14 @@
#include "isk_16.h" #include "isk_16.h"
#include "sprite/player.h" #include "sprite/player.h"
#include "world/common/atomic/UnkFunc27.inc.c" #include "world/common/atomic/ApplyTint.inc.c"
EvtScript N(EVS_Scene_TutankoopaAppears) = { EvtScript N(EVS_Scene_TutankoopaAppears) = {
EVT_CALL(DisablePlayerInput, TRUE) EVT_CALL(DisablePlayerInput, TRUE)
EVT_CALL(DisablePartnerAI, 0) EVT_CALL(DisablePartnerAI, 0)
EVT_CALL(N(UnkFunc27), 0, -1, FOG_MODE_1) EVT_CALL(N(SetModelTintMode), APPLY_TINT_MODELS, -1, ENV_TINT_SHROUD)
EVT_CALL(N(UnkFunc27), 2, 0, FOG_MODE_1) EVT_CALL(N(SetModelTintMode), APPLY_TINT_BG, NULL, ENV_TINT_SHROUD)
EVT_CALL(N(UnkFunc26), 1, 0, 0, 0, 255, 0, 0, 0, 0, 0) EVT_CALL(N(SetModelTintParams), ENV_TINT_SHROUD, 0, 0, 0, 255, 0, 0, 0, 0, 0)
EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 410, -910, 410) EVT_CALL(UseSettingsFrom, CAM_DEFAULT, 410, -910, 410)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(300.0)) EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(300.0))
EVT_CALL(SetPanTarget, CAM_DEFAULT, 336, -910, 467) EVT_CALL(SetPanTarget, CAM_DEFAULT, 336, -910, 467)
@ -69,10 +69,10 @@ EvtScript N(EVS_Scene_TutankoopaAppears) = {
#else #else
EVT_ADD(LVar0, -4) EVT_ADD(LVar0, -4)
#endif #endif
EVT_CALL(N(UnkFunc26), 1, 0, 0, 0, LVar0, 0, 0, 0, 0, 0) EVT_CALL(N(SetModelTintParams), ENV_TINT_SHROUD, 0, 0, 0, LVar0, 0, 0, 0, 0, 0)
EVT_WAIT(1) EVT_WAIT(1)
EVT_END_LOOP EVT_END_LOOP
EVT_CALL(N(UnkFunc26), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0) EVT_CALL(N(SetModelTintParams), ENV_TINT_SHROUD, 0, 0, 0, 0, 0, 0, 0, 0, 0)
EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(530.0)) EVT_CALL(SetCamDistance, CAM_DEFAULT, EVT_FLOAT(530.0))
EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.5 / DT)) EVT_CALL(SetCamSpeed, CAM_DEFAULT, EVT_FLOAT(0.5 / DT))
EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1) EVT_CALL(PanToTarget, CAM_DEFAULT, 0, 1)

View File

@ -15,12 +15,12 @@ API_CALLABLE(N(ManageBigPalmTreeVisibility)) {
if (N(PrevPalmTreeVisibility) != 0) { if (N(PrevPalmTreeVisibility) != 0) {
if (currentFloor == COLLIDER_o327 || currentFloor == COLLIDER_o330) { if (currentFloor == COLLIDER_o327 || currentFloor == COLLIDER_o330) {
set_model_group_visibility(MODEL_g70, MODEL_FLAG_HIDDEN, MODEL_GROUP_HIDDEN); mdl_group_set_visibility(MODEL_g70, MODEL_FLAG_HIDDEN, MODEL_GROUP_HIDDEN);
N(PrevPalmTreeVisibility) = FALSE; N(PrevPalmTreeVisibility) = FALSE;
} }
} else { } else {
if (currentFloor == COLLIDER_o319 || currentFloor == COLLIDER_o316) { if (currentFloor == COLLIDER_o319 || currentFloor == COLLIDER_o316) {
set_model_group_visibility(MODEL_g70, MODEL_FLAG_HIDDEN, MODEL_GROUP_VISIBLE); mdl_group_set_visibility(MODEL_g70, MODEL_FLAG_HIDDEN, MODEL_GROUP_VISIBLE);
N(PrevPalmTreeVisibility) = TRUE; N(PrevPalmTreeVisibility) = TRUE;
} }
} }

Some files were not shown because too many files have changed in this diff Show More