Quit confirmation fixes, phase 2:

lander reports, conversation summaries, outtakes, end credits
bugs #454, #465, #466


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1211 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2003-09-08 21:50:19 +00:00
parent 9fd9791d45
commit 0d411167af
6 changed files with 75 additions and 68 deletions
+10 -16
View File
@@ -1705,7 +1705,8 @@ DoCommunication (PENCOUNTER_STATE pES)
{ {
temp = curr->tag.data; temp = curr->tag.data;
// fprintf (stderr, "%s\n", temp); // fprintf (stderr, "%s\n", temp);
while (wstrlen (temp) > (unsigned int) SUMMARY_CHARS) while (wstrlen (temp) > (unsigned int) SUMMARY_CHARS
&& !(GLOBAL (CurrentActivity) & CHECK_ABORT))
{ {
int space_index; int space_index;
// find last space before it goes over the max chars per line // find last space before it goes over the max chars per line
@@ -1742,11 +1743,8 @@ DoCommunication (PENCOUNTER_STATE pES)
t.baseline.x = SAFE_X + 2; t.baseline.x = SAFE_X + 2;
t.align = ALIGN_LEFT; t.align = ALIGN_LEFT;
t.baseline.y = SAFE_Y + DELTA_Y_SUMMARY; t.baseline.y = SAFE_Y + DELTA_Y_SUMMARY;
while (AnyButtonPress (TRUE))
TaskSwitch (); WaitAnyButtonOrQuit (TRUE);
while (!AnyButtonPress (TRUE))
TaskSwitch ();
SetSemaphore (GraphicsSem); SetSemaphore (GraphicsSem);
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x05, 0x00), 0x6E)); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x05, 0x00), 0x6E));
@@ -1755,6 +1753,9 @@ DoCommunication (PENCOUNTER_STATE pES)
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x10, 0x00), 0x6B)); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x10, 0x00), 0x6B));
} }
} }
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
break;
t.pStr = temp; t.pStr = temp;
SetSemaphore (GraphicsSem); SetSemaphore (GraphicsSem);
@@ -1776,11 +1777,8 @@ DoCommunication (PENCOUNTER_STATE pES)
t.baseline.x = SAFE_X + 2; t.baseline.x = SAFE_X + 2;
t.align = ALIGN_LEFT; t.align = ALIGN_LEFT;
t.baseline.y = SAFE_Y + DELTA_Y_SUMMARY; t.baseline.y = SAFE_Y + DELTA_Y_SUMMARY;
while (AnyButtonPress (TRUE))
TaskSwitch (); WaitAnyButtonOrQuit (TRUE);
while (!AnyButtonPress (TRUE))
TaskSwitch ();
SetSemaphore (GraphicsSem); SetSemaphore (GraphicsSem);
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x05, 0x00), 0x6E)); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x05, 0x00), 0x6E));
@@ -1790,11 +1788,7 @@ DoCommunication (PENCOUNTER_STATE pES)
} }
} }
while (AnyButtonPress (TRUE)) WaitAnyButtonOrQuit (TRUE);
TaskSwitch ();
while (!AnyButtonPress (TRUE))
TaskSwitch ();
SetSemaphore (GraphicsSem); SetSemaphore (GraphicsSem);
SetContextFont (fLast); SetContextFont (fLast);
+49 -42
View File
@@ -22,22 +22,6 @@
#include "oscill.h" #include "oscill.h"
#include "options.h" #include "options.h"
//Added by Chris
void FreeSC2Data (void);
void FreeLanderData (void);
void FreeIPData (void);
void FreeMasterShipList (void);
void UninitSpace (void);
void FreeHyperData (void);
//End Added by Chris
void void
Credits (void) Credits (void)
{ {
@@ -52,11 +36,10 @@ Credits (void)
DWORD TimeIn; DWORD TimeIn;
MUSIC_REF hMusic; MUSIC_REF hMusic;
BYTE fade_buf[1]; BYTE fade_buf[1];
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
return;
FreeSC2Data ();
FreeLanderData ();
FreeIPData ();
FreeHyperData ();
rt = GET_TYPE (CREDIT00_ANIM); rt = GET_TYPE (CREDIT00_ANIM);
ri = GET_INSTANCE (CREDIT00_ANIM); ri = GET_INSTANCE (CREDIT00_ANIM);
rp = GET_PACKAGE (CREDIT00_ANIM); rp = GET_PACKAGE (CREDIT00_ANIM);
@@ -85,7 +68,8 @@ FreeHyperData ();
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)fade_buf, ONE_SECOND / 2)); SleepThreadUntil (XFormColorMap ((COLORMAPPTR)fade_buf, ONE_SECOND / 2));
TimeIn = GetTimeCounter (); TimeIn = GetTimeCounter ();
for (i = 1; i < NUM_CREDITS; ++i) for (i = 1; (i < NUM_CREDITS) &&
!(GLOBAL (CurrentActivity) & CHECK_ABORT); ++i)
{ {
SetTransitionSource (&r); SetTransitionSource (&r);
BatchGraphics (); BatchGraphics ();
@@ -97,15 +81,21 @@ FreeHyperData ();
UnbatchGraphics (); UnbatchGraphics ();
DestroyDrawable (ReleaseDrawable (f[i])); DestroyDrawable (ReleaseDrawable (f[i]));
SleepThreadUntil (TimeIn + ONE_SECOND * 5); ClearSemaphore (GraphicsSem);
while ((GetTimeCounter () - TimeIn < ONE_SECOND * 5) &&
!(GLOBAL (CurrentActivity) & CHECK_ABORT))
{
UpdateInputState ();
SleepThreadUntil (ONE_SECOND / 20);
}
SetSemaphore (GraphicsSem);
TimeIn = GetTimeCounter (); TimeIn = GetTimeCounter ();
} }
DestroyDrawable (ReleaseDrawable (f[0])); DestroyDrawable (ReleaseDrawable (f[0]));
ClearSemaphore (GraphicsSem); ClearSemaphore (GraphicsSem);
while (!AnyButtonPress (FALSE)); WaitAnyButtonOrQuit (FALSE);
while (AnyButtonPress (FALSE));
fade_buf[0] = FadeAllToBlack; fade_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)fade_buf, ONE_SECOND / 2)); SleepThreadUntil (XFormColorMap ((COLORMAPPTR)fade_buf, ONE_SECOND / 2));
@@ -121,40 +111,57 @@ FreeHyperData ();
void void
OutTakes (void) OutTakes (void)
{ {
#define NUM_OUTTAKES 15
static long outtake_list[NUM_OUTTAKES] =
{
ZOQFOTPIK_CONVERSATION,
TALKING_PET_CONVERSATION,
ORZ_CONVERSATION,
UTWIG_CONVERSATION,
THRADD_CONVERSATION,
SUPOX_CONVERSATION,
SYREEN_CONVERSATION,
SHOFIXTI_CONVERSATION,
PKUNK_CONVERSATION,
YEHAT_CONVERSATION,
DRUUGE_CONVERSATION,
URQUAN_CONVERSATION,
VUX_CONVERSATION,
BLACKURQ_CONVERSATION,
ARILOU_CONVERSATION
};
RECT r; RECT r;
float oldvolume = speechVolumeScale;
BOOLEAN oldsubtitles = optSubtitles; BOOLEAN oldsubtitles = optSubtitles;
int i = 0;
BYTE fade_buf[1];
speechVolumeScale = 0.0f;
optSubtitles = TRUE; optSubtitles = TRUE;
sliderDisabled = TRUE; sliderDisabled = TRUE;
SetSemaphore (GraphicsSem); SetSemaphore (GraphicsSem);
SetContext (ScreenContext); SetContext (ScreenContext);
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x0, 0x0, 0x0), 0x00)); SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x0, 0x0, 0x0), 0x00));
fade_buf[0] = FadeAllToColor;
XFormColorMap ((COLORMAPPTR)fade_buf, 0);
r.corner.x = r.corner.y = 0; r.corner.x = r.corner.y = 0;
r.extent.width = SCREEN_WIDTH; r.extent.width = SCREEN_WIDTH;
r.extent.height = SCREEN_HEIGHT; r.extent.height = SCREEN_HEIGHT;
DrawFilledRectangle (&r); DrawFilledRectangle (&r);
ClearSemaphore (GraphicsSem); ClearSemaphore (GraphicsSem);
InitCommunication (ZOQFOTPIK_CONVERSATION); for (i = 0; (i < NUM_OUTTAKES) &&
InitCommunication (TALKING_PET_CONVERSATION); !(GLOBAL (CurrentActivity) & CHECK_ABORT); i++)
InitCommunication (ORZ_CONVERSATION); {
InitCommunication (UTWIG_CONVERSATION); InitCommunication (outtake_list[i]);
InitCommunication (THRADD_CONVERSATION); }
InitCommunication (SUPOX_CONVERSATION);
InitCommunication (SYREEN_CONVERSATION); SetContext (ScreenContext);
InitCommunication (SHOFIXTI_CONVERSATION); fade_buf[0] = FadeAllToBlack;
InitCommunication (PKUNK_CONVERSATION); SleepThreadUntil (XFormColorMap ((COLORMAPPTR)fade_buf, ONE_SECOND / 2));
InitCommunication (YEHAT_CONVERSATION); FlushColorXForms ();
InitCommunication (DRUUGE_CONVERSATION);
InitCommunication (URQUAN_CONVERSATION);
InitCommunication (VUX_CONVERSATION);
InitCommunication (BLACKURQ_CONVERSATION);
InitCommunication (ARILOU_CONVERSATION);
speechVolumeScale = oldvolume;
optSubtitles = oldsubtitles; optSubtitles = oldsubtitles;
sliderDisabled = FALSE; sliderDisabled = FALSE;
} }
+2
View File
@@ -15,3 +15,5 @@
*/ */
void OutTakes (void); void OutTakes (void);
void Victory (void);
void Credits (void);
+1 -4
View File
@@ -87,11 +87,10 @@ Introduction (void)
DestroyDrawable (ReleaseDrawable (s.frame)); DestroyDrawable (ReleaseDrawable (s.frame));
ClearSemaphore (GraphicsSem); ClearSemaphore (GraphicsSem);
FlushInput ();
xform_buf[0] = FadeAllToColor; xform_buf[0] = FadeAllToColor;
TimeOut = XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2); TimeOut = XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2);
LoadMasterShipList (); LoadMasterShipList ();
FlushInput ();
InitGameKernel (); InitGameKernel ();
while ((GetTimeCounter () <= TimeOut) && while ((GetTimeCounter () <= TimeOut) &&
!(GLOBAL (CurrentActivity) & CHECK_ABORT)) !(GLOBAL (CurrentActivity) & CHECK_ABORT))
@@ -152,8 +151,6 @@ Victory (void)
xform_buf[0] = FadeAllToBlack; xform_buf[0] = FadeAllToBlack;
XFormColorMap ((COLORMAPPTR)xform_buf, 0); XFormColorMap ((COLORMAPPTR)xform_buf, 0);
InitGameKernel ();
} }
void void
+13 -4
View File
@@ -19,15 +19,12 @@
#include "starcon.h" #include "starcon.h"
#include "uqmversion.h" #include "uqmversion.h"
#include "controls.h" #include "controls.h"
#include "credits.h"
//Added by Chris //Added by Chris
void Melee (void); void Melee (void);
void Victory (void);
void Credits (void);
void FreeHyperData (void); void FreeHyperData (void);
void FreeIPData (void); void FreeIPData (void);
@@ -36,6 +33,8 @@ void FreeSC2Data (void);
void FreeLanderData (void); void FreeLanderData (void);
BOOLEAN InitGameKernel (void);
//End Added by Chris //End Added by Chris
enum enum
@@ -246,9 +245,19 @@ LastActivity = WON_LAST_BATTLE;
#endif /* NOTYET */ #endif /* NOTYET */
if (LOBYTE (LastActivity) == WON_LAST_BATTLE) if (LOBYTE (LastActivity) == WON_LAST_BATTLE)
{ {
GLOBAL (CurrentActivity) = WON_LAST_BATTLE;
Victory (); Victory ();
InitGameKernel ();
OutTakes ();
Credits (); Credits ();
FreeSC2Data ();
FreeLanderData ();
FreeIPData ();
FreeHyperData ();
TimeOut = ONE_SECOND / 2; TimeOut = ONE_SECOND / 2;
GLOBAL (CurrentActivity) = CHECK_ABORT;
} }
} }
-2
View File
@@ -994,8 +994,6 @@ sc = _simple_count;
if (GET_GAME_STATE (KOHR_AH_KILLED_ALL)) if (GET_GAME_STATE (KOHR_AH_KILLED_ALL))
InitCommunication (BLACKURQ_CONVERSATION); InitCommunication (BLACKURQ_CONVERSATION);
//surrendered to Ur-Quan //surrendered to Ur-Quan
else if (LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
OutTakes ();
else if (GLOBAL (CurrentActivity) & CHECK_RESTART) else if (GLOBAL (CurrentActivity) & CHECK_RESTART)
GLOBAL (CurrentActivity) &= ~CHECK_RESTART; GLOBAL (CurrentActivity) &= ~CHECK_RESTART;
break; break;