Skip to content

Commit

Permalink
review eventfade
Browse files Browse the repository at this point in the history
  • Loading branch information
MokhaLeee committed Jul 23, 2024
1 parent fda61a7 commit 2babae4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 29 deletions.
4 changes: 2 additions & 2 deletions include/bmfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/eventfx-fade.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void EventFadefx_Loop(struct ProcEventFade * proc)
}
}

void sub_80127C4(void)
void EventStartFade(void)
{
u8 i;
struct EventFadeSt * st;
Expand All @@ -54,7 +54,7 @@ void sub_80127C4(void)
}
}

void sub_8012824(void)
void EventEndFade(void)
{
u8 i;
struct EventFadeSt * st;
Expand Down
49 changes: 24 additions & 25 deletions src/eventscr.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,39 +756,38 @@ u8 Event18_ColorFade(struct EventEngineProc * proc)
u16 g = proc->pEventCurrent[4];
u16 b = proc->pEventCurrent[5];

switch (subcode)
{
case 0:
sub_80127C4();
return EVC_ADVANCE_YIELD;
switch (subcode) {
case EVSUBCMD_STARTFADE:
EventStartFade();
return EVC_ADVANCE_YIELD;

case 1:
sub_8012824();
return EVC_ADVANCE_YIELD;
case EVSUBCMD_ENDFADE:
EventEndFade();
return EVC_ADVANCE_YIELD;

case 2:
{
s8 i;
case EVSUBCMD_FADECOLORS:
{
s8 i;

if (EVENT_IS_SKIPPING(proc) || (proc->evStateBits & EV_STATE_FADEDIN))
speed = 0;
if (EVENT_IS_SKIPPING(proc) || (proc->evStateBits & EV_STATE_FADEDIN))
speed = 0;

mask = 0;
mask = 0;

for (i = size; i > 0; --i)
{
s8 tmp = start;
mask = mask | (1 << tmp);
start = tmp + 1;
}
for (i = size; i > 0; --i)
{
s8 tmp = start;
mask = mask | (1 << tmp);
start = tmp + 1;
}

NewEventFadefx(speed, mask, r, g, b, proc);
NewEventFadefx(speed, mask, r, g, b, proc);

return EVC_ADVANCE_YIELD;
}
return EVC_ADVANCE_YIELD;
}

default:
return EVC_ERROR;
default:
return EVC_ERROR;

} // switch (subcode)
}
Expand Down

0 comments on commit 2babae4

Please sign in to comment.