#ifdef _WIN32#pragma warning(disable : 4244) // C4244 conversion from 'type1' to 'type2', possible loss of data#pragma warning(disable : 4100) // C4100 unreferenced formal parameter#if _MSC_VER > 1500#pragma warning(disable : 4996) // disable warnings from VS 2010 about deprecated CRT functions (_CRT_SECURE_NO_WARNINGS).#endif#endif
//QW// Here's where I finally get smart and add some debugging stuff to the game.// Don't forget to add null definitions for stuff not useable in Linux.#ifdef _WIN32#define WIN32_LEAN_AND_MEAN //non-MFC#include <windows.h>#define CRTDBG_MAP_ALLOC#include <stdlib.h>#include <crtdbg.h>_CrtMemState startup1; // memory diagnostics#else#define OutputDebugString //not doing Windows#endif
void ShutdownGame (void){ gi.dprintf ("==== ShutdownGame ====\n"); gi.FreeTags (TAG_LEVEL); gi.FreeTags (TAG_GAME);#ifdef _WIN32 OutputDebugString("ShutdownGame() was called.\n"); _CrtMemDumpAllObjectsSince(&startup1); _CrtMemDumpStatistics (&startup1); _CrtDumpMemoryLeaks();#endif}
Thought that I'd start a thread for beginners who want to get started with the quake 2 source. For right now I'm going to link to the original source and then include the clean code base later. I'm not as familiar with compiling clean code so once I get time to take a look I'll revise this.