diff options
| author | Steven Fuller <relnev@icculus.org> | 2002-01-13 16:06:33 +0000 |
|---|---|---|
| committer | Patryk Obara <dreamer.tan@gmail.com> | 2019-08-20 02:22:37 +0200 |
| commit | 47d9cc1b2c85ca67375a507d273aae082427b46f (patch) | |
| tree | d279b74d9c6d93db7a0a933027d3f96beff8a0ef /src | |
| parent | ec12e751c0b90cc8d6e78c1c2b0d985ba4778d4f (diff) | |
main.c: switched to using atexit instead of calling SDL_Quit directly.
npcsetup.cpp: removed old todo msg
Diffstat (limited to 'src')
| -rw-r--r-- | src/avp/win95/npcsetup.cpp | 5 | ||||
| -rw-r--r-- | src/main.c | 11 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/avp/win95/npcsetup.cpp b/src/avp/win95/npcsetup.cpp index f61c9d9..61083e3 100644 --- a/src/avp/win95/npcsetup.cpp +++ b/src/avp/win95/npcsetup.cpp @@ -13,8 +13,6 @@ #include "avp_menus.h" -/* TODO: dir separator */ - #if ALIEN_DEMO #define DIRECTORY_FOR_RIFS "alienavp_huds/" #else @@ -321,10 +319,9 @@ void InitNPCs(RIFFHANDLE h) DefaultGeneratorEnemy=HNPC_Marine; break; default : + DefaultGeneratorEnemy=HNPC_Marine; GLOBALASSERT("Invalid enemy type"==0); - } - } else { @@ -305,6 +305,8 @@ int InitSDL() exit(EXIT_FAILURE); } + atexit(SDL_Quit); + SDL_AvailableVideoModes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_OPENGL); if (SDL_AvailableVideoModes == NULL) return -1; @@ -393,7 +395,7 @@ int SetSoftVideoMode(int Width, int Height, int Depth) if ((surface = SDL_SetVideoMode(Width, Height, Depth, flags)) == NULL) { fprintf(stderr, "(Software) SDL SetVideoMode failed: %s\n", SDL_GetError()); - SDL_Quit(); + /* SDL_Quit(); */ exit(EXIT_FAILURE); } @@ -454,7 +456,7 @@ int SetOGLVideoMode(int Width, int Height) if ((surface = SDL_SetVideoMode(Width, Height, 0, flags)) == NULL) { fprintf(stderr, "(OpenGL) SDL SetVideoMode failed: %s\n", SDL_GetError()); - SDL_Quit(); + /* SDL_Quit(); */ exit(EXIT_FAILURE); } @@ -547,7 +549,10 @@ int ExitWindowsSystem() SDL_JoystickClose(joy); } #endif - SDL_Quit(); + /* SDL_Quit(); */ + if (surface) + SDL_FreeSurface(surface); + surface = NULL; return 0; } |
