diff --git a/src/Ending.cpp b/src/Ending.cpp index 173a0f08..0c92b428 100644 --- a/src/Ending.cpp +++ b/src/Ending.cpp @@ -242,13 +242,23 @@ BOOL StartCreditScript() return TRUE; } -// Get number from text (4 digit) -int GetScriptNumber(const char *text) +// Update credits +void ActionCredit() { - return (text[0] - '0') * 1000 + - (text[1] - '0') * 100 + - (text[2] - '0') * 10 + - text[3] - '0'; + if (Credit.offset >= Credit.size) + return; + + // Update script, or if waiting, decrement the wait value + switch (Credit.mode) + { + case 1: + ActionCredit_Read(); + break; + + case 2: + if (--Credit.wait <= 0) + Credit.mode = 1; + } } // Parse credits @@ -401,25 +411,16 @@ void ActionCredit_Read() } } -// Update credits -void ActionCredit() +// Get number from text (4 digit) +int GetScriptNumber(const char *text) { - if (Credit.offset >= Credit.size) - return; - - // Update script, or if waiting, decrement the wait value - switch (Credit.mode) - { - case 1: - ActionCredit_Read(); - break; - - case 2: - if (--Credit.wait <= 0) - Credit.mode = 1; - } + return (text[0] - '0') * 1000 + + (text[1] - '0') * 100 + + (text[2] - '0') * 10 + + text[3] - '0'; } + // Change illustration void SetCreditIllust(int a) { diff --git a/src/Ending.h b/src/Ending.h index cbbcc1e7..54d2b73a 100644 --- a/src/Ending.h +++ b/src/Ending.h @@ -48,6 +48,8 @@ void InitCreditScript(); void ReleaseCreditScript(); BOOL StartCreditScript(); void ActionCredit(); +void ActionCredit_Read(); +int GetScriptNumber(const char *text); void SetCreditIllust(int a); void CutCreditIllust(); int Scene_DownIsland(HWND hWnd, int mode);