Skip to content

Commit

Permalink
Merge pull request #671 from minirop/small-cleanups
Browse files Browse the repository at this point in the history
Small cleanups in Talk_OnIdle, GetStrTalkLen, BmBgfx_Loop, and StartGmapRm
  • Loading branch information
RevoSucks authored Sep 22, 2024
2 parents 67758de + f667e6d commit 7897d2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 30 deletions.
11 changes: 2 additions & 9 deletions src/scene.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,26 +565,21 @@ void Talk_OnIdle(ProcPtr proc) {
Proc_Break(proc);
return;

case 1:
goto _08006CD0;

case 2:
if (sTalkState->instantScroll || sTalkState->printDelay <= 0) {
break;
goto _08006CC2;
}

return;

case 3:
_08006CC2:
sTalkState->printClock = sTalkState->printDelay;
sTalkState->instantScroll = 0;

return;

case 1:
default:
_08006CD0:
if (!(CheckTalkFlag(TALK_FLAG_SPRITE))) {
if (TalkPrepNextChar(proc) == 1) {
return;
Expand Down Expand Up @@ -2285,9 +2280,7 @@ int GetStrTalkLen(const char* str, s8 isBubbleOpen) {
continue;

case 0x10:
str++;
str++;
str++;
str += 3;

continue;
}
Expand Down
12 changes: 0 additions & 12 deletions src/sysutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -1385,23 +1385,11 @@ void BmBgfx_Loop(struct ProcBmBgfx * proc)
if (conf->type == BMFX_CONFT_BLOCKING)
break;

#if NONMATCHING
switch (conf->type) {
case BMFX_CONFT_BREAK:
case BMFX_CONFT_END:
Proc_Break(proc);
return;

default:
break;
}
#else
if (conf->type < 11 && conf->type > 8)
{
Proc_Break(proc);
break;
}
#endif

if (proc->timer == 0)
{
Expand Down
11 changes: 2 additions & 9 deletions src/worldmap_rm.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,8 @@ ProcPtr StartGmapRm(int x, int y, u32 mask, ProcPtr parent)
else
proc = Proc_Start(ProcScr_GmapRM, PROC_TREE_3);

#if NONMATCHING
proc->flag = mask & (~GMAPRM_FLAG_UNBLOCK);
#else
{
u8 * flag_it = &proc->flag;
u8 _mask = ~GMAPRM_FLAG_UNBLOCK;
*flag_it = _mask & mask;
}
#endif
proc->flag = (~GMAPRM_FLAG_UNBLOCK);
proc->flag &= mask;

proc->x = x;
proc->y = y;
Expand Down

0 comments on commit 7897d2e

Please sign in to comment.