While cleaning the code I discovered that quitting is almost
implemented, only setting the variable was missing. I don't know if
that's what you wanted, it just quits immediately without asking for
confirmation or anything.
--
"Whom are you?" said he, for he had been to night school.
-- George Ade
Tue Oct 3 15:20:24 CEST 2006 [EMAIL PROTECTED]
* Process SDL_QUIT message
diff -rN -u -ud old-wz/lib/framework/frame.c new-wz/lib/framework/frame.c
--- old-wz/lib/framework/frame.c 2006-10-03 20:45:50.842746816 +0200
+++ new-wz/lib/framework/frame.c 2006-10-03 20:45:51.247685256 +0200
@@ -78,9 +78,6 @@
SDL_Cursor *aCursors[MAX_CURSORS];
-/* Stores whether a windows quit message has been received */
-static BOOL winQuit=FALSE;
-
typedef enum _focus_state
{
FOCUS_OUT, // Window does not have the focus
@@ -291,7 +288,6 @@
SDL_WM_SetCaption(pWindowName, NULL);
- winQuit = FALSE;
focusState = FOCUS_IN;
focusLast = FOCUS_IN;
@@ -350,6 +346,7 @@
{
SDL_Event event;
FRAME_STATUS retVal;
+ BOOL wzQuit = FALSE;
/* Tell the input system about the start of another frame */
inputNewFrame();
@@ -358,15 +355,14 @@
while ( SDL_PollEvent( &event ) != 0)
{
if (event.type == SDL_QUIT)
- {
- break;
- }
- processEvent(&event);
+ wzQuit = TRUE;
+ else
+ processEvent(&event);
}
/* Now figure out what to return */
retVal = FRAME_OK;
- if (winQuit)
+ if (wzQuit)
{
retVal = FRAME_QUIT;
}
@@ -396,7 +392,7 @@
}
/* If things are running normally update the framerate */
- if ((!winQuit) && (focusState == FOCUS_IN))
+ if ((!wzQuit) && (focusState == FOCUS_IN))
{
/* Update the frame rate stuff */
MaintainFrameStuff();
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev