/* the main program */ int main( int argc, char *argv[]) { Credits( stdout); argv++; argc--; /* read command line options */ ParseCommandLineOptions( argc, argv); /* load the Wad files */ OpenMainWad( MainWad); if (PatchWads) while (PatchWads[ 0]) { OpenPatchWad( PatchWads[ 0]); PatchWads++; } /* sanity check */ CloseUnusedWadFiles(); /* all systems go! */ MainLoop(); /* that's all, folks! */ CloseWadFiles(); exit( 0); }
/* terminate the program reporting an error */ void ProgError( char *errstr, ...) { va_list args; va_start( args, errstr); printf( "\nProgram Error: *** "); vprintf( errstr, args); printf( " ***\n"); va_end( args); /* clean up & free space */ ForgetLevelData(); CloseWadFiles(); exit( 1); }
/* Windeu cleanup routine */ void CleanupWindeu () { // Cleanup graphics data (GDI pen cache, ...) // CleanupGfxData(); ForgetLevelData(); Level = NULL; ForgetWTextureInfo(); ForgetFTextureInfo(); // that's all, folks! CloseWadFiles(); // Disabled 7/04 ARK // UnloadKodObjects(); // UnloadKodRooms(); // SaveEntrances(EntranceData); // CloseEntrances(); LogMessage( ": The end!\n\n\n"); CloseLog(); }