projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20091023-1-src
[rocksndiamonds.git]
/
src
/
game_sp
/
MainGameLoop.c
diff --git
a/src/game_sp/MainGameLoop.c
b/src/game_sp/MainGameLoop.c
index fd3fa85999f92441c50eeb10ffec323e3a5ac608..eddb4cdd3ec60bab33f71b12d9cd2eb4d4104130 100644
(file)
--- a/
src/game_sp/MainGameLoop.c
+++ b/
src/game_sp/MainGameLoop.c
@@
-82,7
+82,7
@@
int subMainGameLoop_Init()
return subMainGameLoop;
}
return subMainGameLoop;
}
-int subMainGameLoop_Main()
+int subMainGameLoop_Main(
byte action, boolean warp_mode
)
{
int subMainGameLoop;
int bx;
{
int subMainGameLoop;
int bx;
@@
-91,7
+91,9
@@
int subMainGameLoop_Main()
// --------------------- START OF GAME-BUSY LOOP ------------------------------
// ----------------------------------------------------------------------------
// --------------------- START OF GAME-BUSY LOOP ------------------------------
// ----------------------------------------------------------------------------
+#if 0
locRepeatMainGameLoop: // start repeating game loop
locRepeatMainGameLoop: // start repeating game loop
+#endif
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// FS synchronization
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// FS synchronization
@@
-120,8
+122,19
@@
locRepeatMainGameLoop: // start repeating game loop
// FS end of synchronization
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// FS end of synchronization
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+#if 1
if (EndFlag)
if (EndFlag)
+ {
+ // (should never happen)
+
+ // printf("::: EndFlag == True\n");
+
goto locExitMainGameLoop;
goto locExitMainGameLoop;
+ }
+#else
+ if (EndFlag)
+ goto locExitMainGameLoop;
+#endif
// If DemoFlag = 0 Then Call subCheckJoystick ' check joystick
// bx = subCheckRightMouseButton() ' check (right) mouse button
// If DemoFlag = 0 Then Call subCheckJoystick ' check joystick
// bx = subCheckRightMouseButton() ' check (right) mouse button
@@
-142,7
+155,7
@@
locRepeatMainGameLoop: // start repeating game loop
// loc_g_186F:
// loc_g_186F:
- subProcessKeyboardInput(
);
// Check keyboard, act on keys
+ subProcessKeyboardInput(
action);
// Check keyboard, act on keys
// 'HACK:
// TimerVar = TimerVar + 1
// 'HACK:
// TimerVar = TimerVar + 1
@@
-190,8
+203,19
@@
locRepeatMainGameLoop: // start repeating game loop
ScrollTowards(ScreenScrollXPos, ScreenScrollYPos);
}
ScrollTowards(ScreenScrollXPos, ScreenScrollYPos);
}
+#if 1
+ if (ForcedExitFlag != 0) // Forced Exit?' yes--exit!
+ {
+ // (should never happen)
+
+ // printf("::: ForcedExitFlag == True\n");
+
+ goto locExitMainGameLoop;
+ }
+#else
if (ForcedExitFlag != 0) // Forced Exit?' yes--exit!
goto locExitMainGameLoop;
if (ForcedExitFlag != 0) // Forced Exit?' yes--exit!
goto locExitMainGameLoop;
+#endif
TimerVar = TimerVar + 1;
TimerVar = TimerVar + 1;
@@
-207,8
+231,23
@@
locRepeatMainGameLoop: // start repeating game loop
// End With
// End If
// End With
// End If
+#if 1
+ if (ExitToMenuFlag == 1)
+ {
+ // happens when demo ends or when Murphy enters exit (to be checked)
+
+#if 0
+ printf("::: ExitToMenuFlag == True\n");
+#endif
+
+#if 0
+ goto locExitMainGameLoop;
+#endif
+ }
+#else
if (ExitToMenuFlag == 1)
goto locExitMainGameLoop;
if (ExitToMenuFlag == 1)
goto locExitMainGameLoop;
+#endif
#if 1
if (LeadOutCounter == 0) // no lead-out: game busy
#if 1
if (LeadOutCounter == 0) // no lead-out: game busy
@@
-222,13
+261,36
@@
locRepeatMainGameLoop: // start repeating game loop
// ---------------------- END OF GAME-BUSY LOOP -------------------------------
// ----------------------------------------------------------------------------
LeadOutCounter = LeadOutCounter - 1; // do more lead-out after quit
// ---------------------- END OF GAME-BUSY LOOP -------------------------------
// ----------------------------------------------------------------------------
LeadOutCounter = LeadOutCounter - 1; // do more lead-out after quit
+
+#if 0
+ printf("::: LeadOutCounter == %d\n", LeadOutCounter);
+#endif
+
+#if 1
+ if (LeadOutCounter != 0) // lead-out not ready: more
+ return subMainGameLoop;
+#else
if (LeadOutCounter != 0) // lead-out not ready: more
goto locRepeatMainGameLoop;
if (LeadOutCounter != 0) // lead-out not ready: more
goto locRepeatMainGameLoop;
+#endif
// lead-out done: exit now
// ---------------------- END OF GAME-BUSY LOOP (including lead-out) ----------
locExitMainGameLoop:
// lead-out done: exit now
// ---------------------- END OF GAME-BUSY LOOP (including lead-out) ----------
locExitMainGameLoop:
+
+#if 1
+ printf("::: locExitMainGameLoop reached [%d]\n", LeadOutCounter);
+#endif
+
+
+
+#if 1
+ return subMainGameLoop;
+#endif
+
+
+
do
{
DoEvents(); // user may klick on menus or move the window here ...
do
{
DoEvents(); // user may klick on menus or move the window here ...
@@
-261,10
+323,11
@@
locExitMainGameLoop:
if (UpdatedFlag == 0) // update playing time
subUpdatePlayingTime();
if (UpdatedFlag == 0) // update playing time
subUpdatePlayingTime();
-
return subMainGameLoop;
} // subMainGameLoop
return subMainGameLoop;
} // subMainGameLoop
+#if 0
+
int subMainGameLoop()
{
int subMainGameLoop;
int subMainGameLoop()
{
int subMainGameLoop;
@@
-494,6
+557,8
@@
locExitMainGameLoop:
return subMainGameLoop;
} // subMainGameLoop
return subMainGameLoop;
} // subMainGameLoop
+#endif
+
void subUpdatePlayingTime()
{
}
void subUpdatePlayingTime()
{
}