Fix crash

This commit is contained in:
jsalmon3 2004-08-29 18:08:34 +00:00
parent 84bccd0c44
commit c77a0d4236

View file

@ -1186,7 +1186,7 @@ static int GameStatsDrawFunc(int frame)
void ShowStats(void)
{
EventCallback callbacks;
Graphic** g;
Graphic* g;
int done;
int old_video_sync;
int frame;
@ -1209,16 +1209,16 @@ void ShowStats(void)
g = NULL;
if (GameResult == GameVictory) {
if (TheUI.VictoryBackgroundG) {
g = &TheUI.VictoryBackgroundG;
g = TheUI.VictoryBackgroundG;
}
} else {
if (TheUI.DefeatBackgroundG) {
g = &TheUI.DefeatBackgroundG;
g = TheUI.DefeatBackgroundG;
}
}
if (g && *g) {
LoadGraphic(*g);
ResizeGraphic(*g, VideoWidth, VideoHeight);
if (g) {
LoadGraphic(g);
ResizeGraphic(g, VideoWidth, VideoHeight);
}
UseContinueButton = 1;
@ -1230,11 +1230,11 @@ void ShowStats(void)
IntroNoEvent = 1;
IntroButtonPressed = 0;
while (1) {
if (g && *g) {
VideoDrawSubClip(*g, 0, 0,
(*g)->Width, (*g)->Height,
(VideoWidth - (*g)->Width) / 2,
(VideoHeight - (*g)->Height) / 2);
if (g) {
VideoDrawSubClip(g, 0, 0,
g->Width, g->Height,
(VideoWidth - g->Width) / 2,
(VideoHeight - g->Height) / 2);
}
GameStatsDrawFunc(frame);
DrawContinueButton();
@ -1251,9 +1251,6 @@ void ShowStats(void)
++frame;
}
FreeGraphic(*g);
*g = NULL;
VideoSyncSpeed = old_video_sync;
SetVideoSync();
}