review eventfade

This commit is contained in:
MokhaLeee 2024-07-23 13:20:51 +08:00
parent fda61a755e
commit 2babae45ec
3 changed files with 30 additions and 31 deletions

View File

@ -68,8 +68,8 @@ struct EventFadeSt {
} BITPACKED;
void EventFadefx_Loop(struct ProcEventFade * proc);
void sub_80127C4(void);
void sub_8012824(void);
void EventStartFade(void);
void EventEndFade(void);
void NewEventFadefx(u16 speed, u32 mask, u16 r, u16 g, u16 b, ProcPtr parent);
void StartEventWarpAnim_ret(ProcPtr parent, s16 x, s16 y, s8 kind, s8 flag);
s8 EventWarpAnimExists_ret(void);

View File

@ -37,7 +37,7 @@ void EventFadefx_Loop(struct ProcEventFade * proc)
}
}
void sub_80127C4(void)
void EventStartFade(void)
{
u8 i;
struct EventFadeSt * st;
@ -54,7 +54,7 @@ void sub_80127C4(void)
}
}
void sub_8012824(void)
void EventEndFade(void)
{
u8 i;
struct EventFadeSt * st;

View File

@ -756,39 +756,38 @@ u8 Event18_ColorFade(struct EventEngineProc * proc)
u16 g = proc->pEventCurrent[4];
u16 b = proc->pEventCurrent[5];
switch (subcode)
switch (subcode) {
case EVSUBCMD_STARTFADE:
EventStartFade();
return EVC_ADVANCE_YIELD;
case EVSUBCMD_ENDFADE:
EventEndFade();
return EVC_ADVANCE_YIELD;
case EVSUBCMD_FADECOLORS:
{
case 0:
sub_80127C4();
return EVC_ADVANCE_YIELD;
s8 i;
case 1:
sub_8012824();
return EVC_ADVANCE_YIELD;
if (EVENT_IS_SKIPPING(proc) || (proc->evStateBits & EV_STATE_FADEDIN))
speed = 0;
case 2:
mask = 0;
for (i = size; i > 0; --i)
{
s8 i;
if (EVENT_IS_SKIPPING(proc) || (proc->evStateBits & EV_STATE_FADEDIN))
speed = 0;
mask = 0;
for (i = size; i > 0; --i)
{
s8 tmp = start;
mask = mask | (1 << tmp);
start = tmp + 1;
}
NewEventFadefx(speed, mask, r, g, b, proc);
return EVC_ADVANCE_YIELD;
s8 tmp = start;
mask = mask | (1 << tmp);
start = tmp + 1;
}
default:
return EVC_ERROR;
NewEventFadefx(speed, mask, r, g, b, proc);
return EVC_ADVANCE_YIELD;
}
default:
return EVC_ERROR;
} // switch (subcode)
}