Merge branch 'accurate' into portable

This commit is contained in:
Clownacy 2020-01-06 19:39:36 +00:00
commit df9dc3e22d
8 changed files with 104 additions and 78 deletions

View file

@ -446,10 +446,11 @@ int CampLoop(void)
{
switch (Call_Escape())
{
case 0:
return 0; // Quit game
case 2:
return 2; // Go to game intro
case enum_ESCRETURN_exit:
return enum_ESCRETURN_exit; // Quit game
case enum_ESCRETURN_restart:
return enum_ESCRETURN_restart; // Go to game intro
}
}
@ -458,10 +459,11 @@ int CampLoop(void)
switch (TextScriptProc())
{
case 0:
return 0; // Quit game
case 2:
return 2; // Go to game intro
case enum_ESCRETURN_exit:
return enum_ESCRETURN_exit; // Quit game
case enum_ESCRETURN_restart:
return enum_ESCRETURN_restart; // Go to game intro
}
// Get currently displayed image
@ -489,13 +491,13 @@ int CampLoop(void)
}
if (!Flip_SystemTask())
return 0; // Quit game
return enum_ESCRETURN_exit; // Quit game
}
// Resume original script
LoadTextScript_Stage(old_script_path);
gArmsEnergyX = 32; // Displays weapon rotation animation in case the weapon was changed
return 1; // Go to game
return enum_ESCRETURN_continue; // Go to game
}
BOOL CheckItem(long a)

View file

@ -466,10 +466,11 @@ int Scene_DownIsland(int mode)
{
switch (Call_Escape())
{
case 0:
return 0;
case 2:
return 2;
case enum_ESCRETURN_exit:
return enum_ESCRETURN_exit;
case enum_ESCRETURN_restart:
return enum_ESCRETURN_restart;
}
}
@ -515,8 +516,8 @@ int Scene_DownIsland(int mode)
// Draw window
PutFramePerSecound();
if (!Flip_SystemTask())
return 0;
return enum_ESCRETURN_exit;
}
return 1;
return enum_ESCRETURN_continue;
}

View file

@ -19,17 +19,17 @@ int Call_Escape(void)
if (gKeyTrg & KEY_ESCAPE) // Escape is pressed, quit game
{
gKeyTrg = 0;
return 0;
return enum_ESCRETURN_exit;
}
if (gKeyTrg & KEY_F1) // F1 is pressed, continue
{
gKeyTrg = 0;
return 1;
return enum_ESCRETURN_continue;
}
if (gKeyTrg & KEY_F2) // F2 is pressed, reset
{
gKeyTrg = 0;
return 2;
return enum_ESCRETURN_restart;
}
// Draw screen
@ -41,9 +41,9 @@ int Call_Escape(void)
{
// Quit if window is closed
gKeyTrg = 0;
return 0;
return enum_ESCRETURN_exit;
}
}
return 0;
return enum_ESCRETURN_exit;
}

View file

@ -1,3 +1,10 @@
#pragma once
enum enum_ESCRETURN
{
enum_ESCRETURN_exit,
enum_ESCRETURN_continue,
enum_ESCRETURN_restart
};
int Call_Escape(void);

View file

@ -155,9 +155,10 @@ int ModeOpening()
{
switch (Call_Escape())
{
case 0:
case enum_ESCRETURN_exit:
return 0;
case 2:
case enum_ESCRETURN_restart:
return 1;
}
}
@ -198,9 +199,10 @@ int ModeOpening()
// Update Text Script
switch (TextScriptProc())
{
case 0:
case enum_ESCRETURN_exit:
return 0;
case 2:
case enum_ESCRETURN_restart:
return 1;
}
@ -365,9 +367,10 @@ int ModeTitle(void)
{
switch (Call_Escape())
{
case 0:
case enum_ESCRETURN_exit:
return 0;
case 2:
case enum_ESCRETURN_restart:
return 1;
}
}
@ -528,9 +531,10 @@ int ModeAction(void)
{
switch (Call_Escape())
{
case 0:
case enum_ESCRETURN_exit:
return 0;
case 2:
case enum_ESCRETURN_restart:
return 1;
}
}
@ -608,9 +612,10 @@ int ModeAction(void)
switch (CampLoop())
{
case 0:
case enum_ESCRETURN_exit:
return 0;
case 2:
case enum_ESCRETURN_restart:
return 1;
}
@ -622,9 +627,10 @@ int ModeAction(void)
switch (MiniMapLoop())
{
case 0:
case enum_ESCRETURN_exit:
return 0;
case 2:
case enum_ESCRETURN_restart:
return 1;
}
}
@ -642,9 +648,10 @@ int ModeAction(void)
{
switch (TextScriptProc())
{
case 0:
case enum_ESCRETURN_exit:
return 0;
case 2:
case enum_ESCRETURN_restart:
return 1;
}
}

View file

@ -96,10 +96,11 @@ int MiniMapLoop(void)
{
switch (Call_Escape())
{
case 0:
return 0;
case 2:
return 2;
case enum_ESCRETURN_exit:
return enum_ESCRETURN_exit;
case enum_ESCRETURN_restart:
return enum_ESCRETURN_restart;
}
}
@ -115,7 +116,7 @@ int MiniMapLoop(void)
PutFramePerSecound();
if (!Flip_SystemTask())
return 0;
return enum_ESCRETURN_exit;
}
rcMiniMap.left = 0;
@ -140,10 +141,11 @@ int MiniMapLoop(void)
{
switch (Call_Escape())
{
case 0:
return 0;
case 2:
return 2;
case enum_ESCRETURN_exit:
return enum_ESCRETURN_exit;
case enum_ESCRETURN_restart:
return enum_ESCRETURN_restart;
}
}
@ -172,7 +174,7 @@ int MiniMapLoop(void)
PutFramePerSecound();
if (!Flip_SystemTask())
return 0;
return enum_ESCRETURN_exit;
}
for (f = 8; f >= -1; --f)
@ -183,10 +185,11 @@ int MiniMapLoop(void)
{
switch (Call_Escape())
{
case 0:
return 0;
case 2:
return 2;
case enum_ESCRETURN_exit:
return enum_ESCRETURN_exit;
case enum_ESCRETURN_restart:
return enum_ESCRETURN_restart;
}
}
@ -202,10 +205,10 @@ int MiniMapLoop(void)
PutFramePerSecound();
if (!Flip_SystemTask())
return 0;
return enum_ESCRETURN_exit;
}
return 1;
return enum_ESCRETURN_continue;
}
BOOL IsMapping(void)

View file

@ -174,10 +174,11 @@ int StageSelectLoop(int *p_event)
{
switch (Call_Escape())
{
case 0:
return 0;
case 2:
return 2;
case enum_ESCRETURN_exit:
return enum_ESCRETURN_exit;
case enum_ESCRETURN_restart:
return enum_ESCRETURN_restart;
}
}
@ -185,10 +186,11 @@ int StageSelectLoop(int *p_event)
switch (TextScriptProc())
{
case 0:
return 0;
case 2:
return 2;
case enum_ESCRETURN_exit:
return enum_ESCRETURN_exit;
case enum_ESCRETURN_restart:
return enum_ESCRETURN_restart;
}
#ifdef FIX_BUGS
@ -210,16 +212,16 @@ int StageSelectLoop(int *p_event)
StopTextScript();
LoadTextScript_Stage(old_script_path);
*p_event = 0;
return 1;
return enum_ESCRETURN_continue;
}
PutFramePerSecound();
if (!Flip_SystemTask())
return 0;
return enum_ESCRETURN_exit;
}
LoadTextScript_Stage(old_script_path);
*p_event = gPermitStage[gSelectedStage].event;
return 1;
return enum_ESCRETURN_continue;
}

View file

@ -12,6 +12,7 @@
#include "CommonDefines.h"
#include "Draw.h"
#include "Ending.h"
#include "Escape.h"
#include "Fade.h"
#include "Flags.h"
#include "Flash.h"
@ -724,7 +725,7 @@ int TextScriptProc(void)
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Failed to load stage", NULL);
#endif
return 0;
return enum_ESCRETURN_exit;
}
}
else if (IS_COMMAND('M','O','V'))
@ -1059,10 +1060,11 @@ int TextScriptProc(void)
switch (MiniMapLoop())
{
case 0:
return 0;
case 2:
return 2;
case enum_ESCRETURN_exit:
return enum_ESCRETURN_exit;
case enum_ESCRETURN_restart:
return enum_ESCRETURN_restart;
}
}
else if (IS_COMMAND('S','L','P'))
@ -1071,10 +1073,11 @@ int TextScriptProc(void)
switch (StageSelectLoop(&z))
{
case 0:
return 0;
case 2:
return 2;
case enum_ESCRETURN_exit:
return enum_ESCRETURN_exit;
case enum_ESCRETURN_restart:
return enum_ESCRETURN_restart;
}
JumpTextScript(z);
@ -1256,17 +1259,18 @@ int TextScriptProc(void)
switch (Scene_DownIsland(z))
{
case 0:
return 0;
case 2:
return 2;
case enum_ESCRETURN_exit:
return enum_ESCRETURN_exit;
case enum_ESCRETURN_restart:
return enum_ESCRETURN_restart;
}
gTS.p_read += 8;
}
else if (IS_COMMAND('E','S','C'))
{
return 2;
return enum_ESCRETURN_restart;
}
else
{
@ -1279,7 +1283,7 @@ int TextScriptProc(void)
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", str_0, NULL);
#endif
return 0;
return enum_ESCRETURN_exit;
}
}
else
@ -1479,7 +1483,7 @@ int TextScriptProc(void)
else
g_GameFlags |= 4;
return 1;
return enum_ESCRETURN_continue;
}
void RestoreTextScript(void)