Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor SR prep #56

Merged
merged 8 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions include/effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -2678,8 +2678,6 @@ EffectInstance* create_effect_instance(EffectBlueprint* effectBp);
void remove_effect(EffectInstance*);
s32 load_effect(s32 effectIndex);

void fx_sun_undeclared(s32, s32, s32, s32, s32, s32);

#include "effects/effect_defs.h"

#endif
7 changes: 4 additions & 3 deletions include/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,10 @@
#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_CC_TEX_COMBINE_3A 0, 0, 0, 0, TEXEL0, TEXEL1, SHADE, 0
#define PM_CC_TEX_COMBINE_3B 0, 0, 0, SHADE, 0, 0, 0, COMBINED
#define PM_CC_TEX_COMBINE_3C 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
Expand Down
2 changes: 2 additions & 0 deletions src/77480.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ HitID player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* out
ret = hitID;
}

// @bug duplicate test -- same as first one. should be +/-?
x = inputX + cosTemp;
y = inputY;
z = inputZ + sinTemp;
Expand All @@ -142,6 +143,7 @@ HitID player_raycast_below(f32 yaw, f32 diameter, f32* outX, f32* outY, f32* out
ret = hitID;
}

// @bug duplicate test -- same as second one. should be -/+?
x = inputX - cosTemp;
y = inputY;
z = inputZ - sinTemp;
Expand Down
1 change: 0 additions & 1 deletion src/battle/common/stage/area_flo/flo_03.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ EvtScript N(EVS_AnimateVines) = {
EndLoop
Set(LVar0, 0)
Set(LVar1, 0)
Label(0)
Label(0)
Add(LVar0, -140)
IfLt(LVar0, 0)
Expand Down
2 changes: 1 addition & 1 deletion src/battle/common/stage/area_hos/hos_01.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ s32 N(ForegroundModels)[] = {
};

Stage NAMESPACE = {
.texture = "hos_tex\0",
.texture = "hos_tex",
.shape = "hos_bt01_shape",
.hit = "hos_bt01_hit",
.bg = "hos_bg",
Expand Down
20 changes: 10 additions & 10 deletions src/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,11 @@ Gfx SolidCombineModes[][5] = {

// shaded color multiplied main/aux textures for alpha
[TEX_COMBINE_3] {
[TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_26, PM_CC_27),
[TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_26, PM_CC_27),
[TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_26, PM_CC_27),
[TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_26, PM_CC_27),
[TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_26, PM_CC_28),
[TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_TEX_COMBINE_3A, PM_CC_TEX_COMBINE_3B),
[TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_TEX_COMBINE_3A, PM_CC_TEX_COMBINE_3B),
[TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_TEX_COMBINE_3A, PM_CC_TEX_COMBINE_3B),
[TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_TEX_COMBINE_3A, PM_CC_TEX_COMBINE_3B),
[TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_TEX_COMBINE_3A, PM_CC_TEX_COMBINE_3C),
},
// lerp between main/aux textures with shade alpha
[TEX_COMBINE_4] {
Expand Down Expand Up @@ -505,11 +505,11 @@ Gfx AlphaTestCombineModes[][5] = {
},

[TEX_COMBINE_3] {
[TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_26, PM_CC_27),
[TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_26, PM_CC_27),
[TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_26, PM_CC_27),
[TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_26, PM_CC_27),
[TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_26, PM_CC_28),
[TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_TEX_COMBINE_3A, PM_CC_TEX_COMBINE_3B),
[TINT_COMBINE_FOG] gsDPSetCombineMode(PM_CC_TEX_COMBINE_3A, PM_CC_TEX_COMBINE_3B),
[TINT_COMBINE_SHROUD] gsDPSetCombineMode(PM_CC_TEX_COMBINE_3A, PM_CC_TEX_COMBINE_3B),
[TINT_COMBINE_DEPTH] gsDPSetCombineMode(PM_CC_TEX_COMBINE_3A, PM_CC_TEX_COMBINE_3B),
[TINT_COMBINE_REMAP] gsDPSetCombineMode(PM_CC_TEX_COMBINE_3A, PM_CC_TEX_COMBINE_3C),
},
[TEX_COMBINE_4] {
[TINT_COMBINE_NONE] gsDPSetCombineMode(PM_CC_22, G_CC_PASS2),
Expand Down
2 changes: 1 addition & 1 deletion src/world/area_flo/flo_00/flo_00_2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "../common/FlowerSpawnRegion.inc.c"

API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_LEFT, 0, 0, 0, 0, 0);
fx_sun(FX_SUN_FROM_LEFT, 0.0f, 0.0f, 0.0f, 0.0f, 0);
return ApiStatus_DONE2;
}

Expand Down
2 changes: 1 addition & 1 deletion src/world/area_flo/flo_03/flo_03_2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "../common/FlowerSpawnRegion.inc.c"

API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_RIGHT, 0, 0, 0, 0, 0);
fx_sun(FX_SUN_FROM_RIGHT, 0.0f, 0.0f, 0.0f, 0.0f, 0);
return ApiStatus_DONE2;
}

Expand Down
2 changes: 1 addition & 1 deletion src/world/area_flo/flo_08/flo_08_3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "world/common/atomic/TexturePan.inc.c"

API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_RIGHT, 0, 0, 0, 0, 0);
fx_sun(FX_SUN_FROM_RIGHT, 0.0f, 0.0f, 0.0f, 0.0f, 0);
return ApiStatus_DONE2;
}

Expand Down
2 changes: 1 addition & 1 deletion src/world/area_flo/flo_09/flo_09_2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "../common/FlowerSpawnRegion.inc.c"

API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_RIGHT, 0, 0, 0, 0, 0);
fx_sun(FX_SUN_FROM_RIGHT, 0.0f, 0.0f, 0.0f, 0.0f, 0);
return ApiStatus_DONE2;
}

Expand Down
2 changes: 1 addition & 1 deletion src/world/area_flo/flo_10/flo_10_3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "../common/FlowerSpawnRegion.inc.c"

API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_RIGHT, 0, 0, 0, 0, 0);
fx_sun(FX_SUN_FROM_RIGHT, 0.0f, 0.0f, 0.0f, 0.0f, 0);
return ApiStatus_DONE2;
}

Expand Down
20 changes: 13 additions & 7 deletions src/world/area_flo/flo_10/flo_10_4_fountain.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ EvtScript N(EVS_GrowFountain) = {
};

EvtScript N(EVS_TexPan_Rainbow) = {
Call(EnableTexPanning, MODEL_o73, TRUE)
Call(SetTexPanner, MODEL_o73, TEX_PANNER_A)
Thread
TEX_PAN_PARAMS_ID(TEX_PANNER_A)
TEX_PAN_PARAMS_STEP( -150, 0, 0, 0)
Expand Down Expand Up @@ -259,47 +259,53 @@ EvtScript N(EVS_SetupFountain) = {
Call(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o86, COLLIDER_FLAGS_UPPER_MASK)
Call(ModifyColliderFlags, MODIFY_COLLIDER_FLAGS_SET_BITS, COLLIDER_o87, COLLIDER_FLAGS_UPPER_MASK)
EndIf
Call(EnableTexPanning, MODEL_o25, TRUE)
Call(EnableTexPanning, MODEL_o40, TRUE)
Call(EnableTexPanning, MODEL_o78, TRUE)
Call(EnableTexPanning, MODEL_o77, TRUE)
Call(EnableTexPanning, MODEL_o118, TRUE)
Call(EnableTexPanning, MODEL_o119, TRUE)
// fountain
Call(SetTexPanner, MODEL_o25, TEX_PANNER_1)
Thread
TEX_PAN_PARAMS_ID(TEX_PANNER_1)
TEX_PAN_PARAMS_STEP( 0,-2000, 0, 0)
TEX_PAN_PARAMS_FREQ( 0, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
Exec(N(EVS_UpdateTexturePan))
EndThread
// water edge
Call(SetTexPanner, MODEL_o40, TEX_PANNER_3)
Thread
TEX_PAN_PARAMS_ID(TEX_PANNER_3)
TEX_PAN_PARAMS_STEP( -100, 80, 0, 0)
TEX_PAN_PARAMS_FREQ( 1, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
Exec(N(EVS_UpdateTexturePan))
EndThread
// fountain mist
Call(SetTexPanner, MODEL_o78, TEX_PANNER_5)
Thread
TEX_PAN_PARAMS_ID(TEX_PANNER_5)
TEX_PAN_PARAMS_STEP(-1000, 2000, 0, 0)
TEX_PAN_PARAMS_FREQ( 1, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
Exec(N(EVS_UpdateTexturePan))
EndThread
// surface spread
Call(SetTexPanner, MODEL_o77, TEX_PANNER_6)
Thread
TEX_PAN_PARAMS_ID(TEX_PANNER_6)
TEX_PAN_PARAMS_STEP( 0,-2000, 0, 0)
TEX_PAN_PARAMS_FREQ( 0, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
Exec(N(EVS_UpdateTexturePan))
EndThread
// small fountain
Call(SetTexPanner, MODEL_o118, TEX_PANNER_8)
Thread
TEX_PAN_PARAMS_ID(TEX_PANNER_8)
TEX_PAN_PARAMS_STEP( 0,-1500, 0, 0)
TEX_PAN_PARAMS_FREQ( 0, 1, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
Exec(N(EVS_UpdateTexturePan))
EndThread
// surface spread
Call(SetTexPanner, MODEL_o119, TEX_PANNER_9)
z64a marked this conversation as resolved.
Show resolved Hide resolved
Thread
TEX_PAN_PARAMS_ID(TEX_PANNER_9)
TEX_PAN_PARAMS_STEP( 0,-1000, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion src/world/area_flo/flo_11/flo_11_2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "world/common/entity/Pipe.inc.c"

API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_LEFT, 0, 0, 0, 0, 0);
fx_sun(FX_SUN_FROM_LEFT, 0.0f, 0.0f, 0.0f, 0.0f, 0);
return ApiStatus_DONE2;
}

Expand Down
2 changes: 1 addition & 1 deletion src/world/area_flo/flo_12/flo_12_2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "../common/FlowerSpawnRegion.inc.c"

API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_LEFT, 0, 0, 0, 0, 0);
fx_sun(FX_SUN_FROM_LEFT, 0.0f, 0.0f, 0.0f, 0.0f, 0);
return ApiStatus_DONE2;
}

Expand Down
2 changes: 1 addition & 1 deletion src/world/area_flo/flo_13/flo_13_3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "../common/FlowerSpawnRegion.inc.c"

API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_LEFT, 0, 0, 0, 0, 0);
fx_sun(FX_SUN_FROM_LEFT, 0.0f, 0.0f, 0.0f, 0.0f, 0);
return ApiStatus_DONE2;
}

Expand Down
54 changes: 28 additions & 26 deletions src/world/area_flo/flo_14/flo_14_2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "world/common/atomic/TexturePan.inc.c"

API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_LEFT, 0, 0, 0, 0, 0);
fx_sun(FX_SUN_FROM_LEFT, 0.0f, 0.0f, 0.0f, 0.0f, 0);
return ApiStatus_DONE2;
}

Expand Down Expand Up @@ -43,38 +43,40 @@ EvtScript N(EVS_Main) = {
Thread
Call(ResetFromLava, Ref(N(SafeFloorColliders)))
EndThread
Call(EnableTexPanning, MODEL_o39, TRUE)
Call(EnableTexPanning, MODEL_o41, TRUE)
Call(EnableTexPanning, MODEL_o43, TRUE)
Call(EnableTexPanning, MODEL_o49, TRUE)
Call(EnableTexPanning, MODEL_o51, TRUE)
Call(EnableTexPanning, MODEL_o55, TRUE)
Call(EnableTexPanning, MODEL_o123, TRUE)
Call(EnableTexPanning, MODEL_o125, TRUE)
Call(EnableTexPanning, MODEL_o127, TRUE)
Call(EnableTexPanning, MODEL_o129, TRUE)
Call(EnableTexPanning, MODEL_o131, TRUE)
Call(EnableTexPanning, MODEL_o133, TRUE)
Call(EnableTexPanning, MODEL_o135, TRUE)
Call(EnableTexPanning, MODEL_o40, TRUE)
Call(EnableTexPanning, MODEL_o44, TRUE)
Call(EnableTexPanning, MODEL_o48, TRUE)
Call(EnableTexPanning, MODEL_o52, TRUE)
Call(EnableTexPanning, MODEL_o54, TRUE)
Call(EnableTexPanning, MODEL_o124, TRUE)
Call(EnableTexPanning, MODEL_o126, TRUE)
Call(EnableTexPanning, MODEL_o128, TRUE)
Call(EnableTexPanning, MODEL_o130, TRUE)
Call(EnableTexPanning, MODEL_o132, TRUE)
Call(EnableTexPanning, MODEL_o134, TRUE)
Call(EnableTexPanning, MODEL_o136, TRUE)
// vines scrolling left
Call(SetTexPanner, MODEL_o39, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o41, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o43, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o49, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o51, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o55, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o123, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o125, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o127, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o129, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o131, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o133, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o135, TEX_PANNER_1)
Thread
TEX_PAN_PARAMS_ID(TEX_PANNER_1)
TEX_PAN_PARAMS_STEP( 140, 0, 0, 0)
TEX_PAN_PARAMS_FREQ( 1, 0, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
Exec(N(EVS_UpdateTexturePan))
EndThread
// vines scrolling right
Call(SetTexPanner, MODEL_o40, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o44, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o48, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o52, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o54, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o124, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o126, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o128, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o130, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o132, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o134, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o136, TEX_PANNER_2)
Thread
TEX_PAN_PARAMS_ID(TEX_PANNER_2)
TEX_PAN_PARAMS_STEP( -200, 0, 0, 0)
Expand Down
26 changes: 15 additions & 11 deletions src/world/area_flo/flo_16/flo_16_2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "world/common/atomic/TexturePan.inc.c"

API_CALLABLE(N(SpawnSunEffect)) {
fx_sun_undeclared(FX_SUN_FROM_RIGHT, 0, 0, 0, 0, 0);
fx_sun(FX_SUN_FROM_RIGHT, 0.0f, 0.0f, 0.0f, 0.0f, 0);
return ApiStatus_DONE2;
}

Expand Down Expand Up @@ -35,22 +35,26 @@ EvtScript N(EVS_Main) = {
Thread
Call(ResetFromLava, Ref(N(SafeFloorColliders)))
EndThread
Call(EnableTexPanning, MODEL_o59, TRUE)
Call(EnableTexPanning, MODEL_o142, TRUE)
Call(EnableTexPanning, MODEL_o58, TRUE)
Call(EnableTexPanning, MODEL_o136, TRUE)
Call(EnableTexPanning, MODEL_o146, TRUE)
Call(EnableTexPanning, MODEL_o143, TRUE)
Call(EnableTexPanning, MODEL_o135, TRUE)
Call(EnableTexPanning, MODEL_o138, TRUE)
Call(EnableTexPanning, MODEL_o139, TRUE)
Call(EnableTexPanning, MODEL_o140, TRUE)
// vines scrolling left
Call(SetTexPanner, MODEL_o59, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o142, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o58, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o136, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o146, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o139, TEX_PANNER_1)
Call(SetTexPanner, MODEL_o143, TEX_PANNER_1)
Thread
TEX_PAN_PARAMS_ID(TEX_PANNER_1)
TEX_PAN_PARAMS_STEP( 140, 0, 0, 0)
TEX_PAN_PARAMS_FREQ( 1, 0, 0, 0)
TEX_PAN_PARAMS_INIT( 0, 0, 0, 0)
Exec(N(EVS_UpdateTexturePan))
EndThread
// vines scrolling right
Call(SetTexPanner, MODEL_o135, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o138, TEX_PANNER_2)
Call(SetTexPanner, MODEL_o140, TEX_PANNER_2)
Thread
TEX_PAN_PARAMS_ID(TEX_PANNER_2)
TEX_PAN_PARAMS_STEP( -200, 0, 0, 0)
TEX_PAN_PARAMS_FREQ( 1, 0, 0, 0)
Expand Down
Loading
Loading