main.c: switched to using atexit instead of calling SDL_Quit directly.
npcsetup.cpp: removed old todo msg
This commit is contained in:
parent
ec12e751c0
commit
47d9cc1b2c
2 changed files with 9 additions and 7 deletions
|
@ -13,8 +13,6 @@
|
||||||
#include "avp_menus.h"
|
#include "avp_menus.h"
|
||||||
|
|
||||||
|
|
||||||
/* TODO: dir separator */
|
|
||||||
|
|
||||||
#if ALIEN_DEMO
|
#if ALIEN_DEMO
|
||||||
#define DIRECTORY_FOR_RIFS "alienavp_huds/"
|
#define DIRECTORY_FOR_RIFS "alienavp_huds/"
|
||||||
#else
|
#else
|
||||||
|
@ -321,10 +319,9 @@ void InitNPCs(RIFFHANDLE h)
|
||||||
DefaultGeneratorEnemy=HNPC_Marine;
|
DefaultGeneratorEnemy=HNPC_Marine;
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
|
DefaultGeneratorEnemy=HNPC_Marine;
|
||||||
GLOBALASSERT("Invalid enemy type"==0);
|
GLOBALASSERT("Invalid enemy type"==0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
11
src/main.c
11
src/main.c
|
@ -305,6 +305,8 @@ int InitSDL()
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
atexit(SDL_Quit);
|
||||||
|
|
||||||
SDL_AvailableVideoModes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_OPENGL);
|
SDL_AvailableVideoModes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_OPENGL);
|
||||||
if (SDL_AvailableVideoModes == NULL)
|
if (SDL_AvailableVideoModes == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -393,7 +395,7 @@ int SetSoftVideoMode(int Width, int Height, int Depth)
|
||||||
|
|
||||||
if ((surface = SDL_SetVideoMode(Width, Height, Depth, flags)) == NULL) {
|
if ((surface = SDL_SetVideoMode(Width, Height, Depth, flags)) == NULL) {
|
||||||
fprintf(stderr, "(Software) SDL SetVideoMode failed: %s\n", SDL_GetError());
|
fprintf(stderr, "(Software) SDL SetVideoMode failed: %s\n", SDL_GetError());
|
||||||
SDL_Quit();
|
/* SDL_Quit(); */
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,7 +456,7 @@ int SetOGLVideoMode(int Width, int Height)
|
||||||
|
|
||||||
if ((surface = SDL_SetVideoMode(Width, Height, 0, flags)) == NULL) {
|
if ((surface = SDL_SetVideoMode(Width, Height, 0, flags)) == NULL) {
|
||||||
fprintf(stderr, "(OpenGL) SDL SetVideoMode failed: %s\n", SDL_GetError());
|
fprintf(stderr, "(OpenGL) SDL SetVideoMode failed: %s\n", SDL_GetError());
|
||||||
SDL_Quit();
|
/* SDL_Quit(); */
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,7 +549,10 @@ int ExitWindowsSystem()
|
||||||
SDL_JoystickClose(joy);
|
SDL_JoystickClose(joy);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SDL_Quit();
|
/* SDL_Quit(); */
|
||||||
|
if (surface)
|
||||||
|
SDL_FreeSurface(surface);
|
||||||
|
surface = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue