Fixed lockup in 'save failed' alert box (bug #397), from ghakko

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1074 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2003-07-20 22:39:41 +00:00
parent f6fbce650d
commit e450085a0b
4 changed files with 13 additions and 56 deletions
+1
View File
@@ -1,4 +1,5 @@
Changes towards version 0.3:
- Fixed lockup in 'save failed' alert box (bug #397), from ghakko
- Fixed glitch in Pkunk animation (bug #354), from Paxtez
- Fixed Kohr-Ah final defeat message repeating (bug #426) -Mika
- Fix for picking up talking pet after Umgah genocide - from Paxtez
+2 -4
View File
@@ -26,7 +26,7 @@
//Added by Chris
BOOLEAN SaveProblem (void);
void SaveProblem (void);
//End Added by Chris
@@ -1046,7 +1046,6 @@ Restart:
pSD = &((SUMMARY_DESC *)pMS->CurString)[pMS->CurState];
if (pMS->delta_item == SAVE_GAME || pSD->year_index)
{
RetrySave:
SetSemaphore (GraphicsSem);
if (pMS->delta_item == SAVE_GAME)
{
@@ -1068,8 +1067,7 @@ RetrySave:
DestroyDrawable (ReleaseDrawable (MsgStamp.frame));
ClearSemaphore (GraphicsSem);
if (SaveProblem ())
goto RetrySave;
SaveProblem ();
pMS->Initialized = FALSE;
NewState = pMS->CurState;
+2 -4
View File
@@ -31,7 +31,7 @@
void ConfirmSaveLoad (STAMP *MsgStamp);
BOOLEAN SaveProblem (void);
void SaveProblem (void);
void DoShipSpin (COUNT index, MUSIC_REF hMusic);
@@ -1075,7 +1075,6 @@ DoSaveTeam (PMELEE_STATE pMS)
sprintf (file, "%s.mle", pMS->TeamImage[pMS->side].TeamName);
RetrySave:
SetSemaphore (GraphicsSem);
OldContext = SetContext (ScreenContext);
ConfirmSaveLoad (&MsgStamp);
@@ -1100,8 +1099,7 @@ RetrySave:
ClearSemaphore (GraphicsSem);
DeleteResFile (meleeDir, file);
if (SaveProblem ())
goto RetrySave;
SaveProblem ();
}
LoadTeamList (pMS, file);
+8 -48
View File
@@ -203,75 +203,35 @@ SaveProblemMessage (STAMP *MsgStamp)
UnbatchGraphics ();
}
BOOLEAN
void
SaveProblem (void)
{
BOOLEAN manage;
STAMP s;
CONTEXT OldContext;
BOOLEAN cont;
SetSemaphore (GraphicsSem);
OldContext = SetContext (SpaceContext);
SaveProblemMessage (&s);
GLOBAL (CurrentActivity) |= CHECK_ABORT;
FlushGraphics ();
ClearSemaphore (GraphicsSem);
while (AnyButtonPress (FALSE));
do
{
cont = FALSE;
TaskSwitch ();
UpdateInputState ();
if (CurrentMenuState.select)
manage = TRUE;
else if (CurrentMenuState.special)
manage = FALSE;
else
cont = TRUE;
} while (cont);
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
} while (!(CurrentMenuState.select || CurrentMenuState.special ||
(GLOBAL (CurrentActivity) & CHECK_ABORT)));
SetSemaphore (GraphicsSem);
BatchGraphics ();
DrawStamp (&s);
UnbatchGraphics ();
SetContext (OldContext);
DestroyDrawable (ReleaseDrawable (s.frame));
ClearSemaphore (GraphicsSem);
if (manage)
{
BYTE clut_buf[1];
SetSemaphore (GraphicsSem);
SetFlashRect (NULL_PTR, (FRAME)0);
ClearSemaphore (GraphicsSem);
clut_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 2));
FlushColorXForms ();
#if 0
SuspendTasking (); // just in case
ManageNVRAM ();
ResumeTasking ();
#endif
clut_buf[0] = FadeAllToColor;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 2));
FlushColorXForms ();
}
else
{
#if 0
CleanNVRAM ();
#endif
SleepThreadUntil (GetTimeCounter () + (ONE_SECOND / 4));
}
return (manage);
return;
}
BOOLEAN