home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 March / Gamestar_82_2006-03_dvd.iso / DVDStar / Editace / quake4_sdkv10.exe / source / idlib / precompiled.h < prev    next >
C/C++ Source or Header  |  2005-11-14  |  9KB  |  379 lines

  1.  
  2. #ifndef __PRECOMPILED_H__
  3. #define __PRECOMPILED_H__
  4.  
  5. #ifdef __cplusplus
  6.  
  7. // RAVEN BEGIN
  8. // nrausch: conditional cvar archive flag so that the pc build will archive certain cvars
  9. #ifdef _XENON
  10.  
  11. #ifdef _FINAL
  12. #define _XENFINAL
  13. #endif
  14.  
  15. #undef _WINDOWS
  16. #define PC_CVAR_ARCHIVE CVAR_NOCHEAT //so it doesn't clobber
  17. #else
  18. #define PC_CVAR_ARCHIVE CVAR_ARCHIVE
  19. #endif
  20. // RAVEN END
  21. class ThreadedAlloc;        // class that is only used to expand the AutoCrit template to tag allocs/frees called from inside the R_AddModelSurfaces call graph
  22.  
  23.  
  24. //-----------------------------------------------------
  25. // RAVEN BEGIN
  26. // jscott: set up conditional compiles
  27. #ifdef _DEBUG_MEMORY
  28. #define ID_REDIRECT_NEWDELETE                // Doesn't work with Radiant
  29. #define ID_DEBUG_MEMORY
  30. #endif
  31.  
  32. #if defined( _FINAL ) && !defined( _MPBETA )
  33.     #define ID_CONSOLE_LOCK
  34. #endif
  35.  
  36. #ifdef _WINDOWS
  37.  
  38.     // _WIN32 always defined
  39.     // _WIN64 also defined for x64 target
  40.     #if !defined( _WIN64 )
  41.         #define ID_WIN_X86_ASM
  42.         #define ID_WIN_X86_MMX
  43.         #define ID_WIN_X86_SSE
  44.         //#define ID_WIN_X86_SSE2
  45.     #endif
  46.  
  47.     // we should never rely on this define in our code. this is here so dodgy external libraries don't get confused
  48.     #ifndef WIN32
  49.         #define WIN32
  50.     #endif
  51.  
  52.     #undef _XBOX
  53.     #undef _CONSOLE                                // Used to comment out code that can't be used on a console
  54.     #define _OPENGL
  55.     #define _LITTLE_ENDIAN
  56.     #undef _CASE_SENSITIVE_FILESYSTEM
  57.     #define _USE_OPENAL
  58.     #ifdef _USE_OPENAL
  59. //        #define _USE_VOICECHAT
  60.     #endif
  61.     #define __WITH_PB__
  62.     //#define _RV_MEM_SYS_SUPPORT
  63.     // when using the PC to make Xenon builds, enable _MD5R_SUPPORT / _MD5R_WRITE_SUPPORT and run with fs_game q4baseXenon
  64.     #ifdef Q4SDK
  65.         // the SDK can't be compiled with _MD5R_SUPPORT, but since the PC version is we need to maintain ABI
  66.         // to make things worse, only the windows version was compiled with _MD5R enabled, the Linux and Mac builds didn't
  67.         #define Q4SDK_MD5R
  68.     #else    // Q4SDK
  69.         #define _MD5R_SUPPORT
  70.         #define _MD5R_WRITE_SUPPORT
  71.     #endif    // !Q4SDK
  72.     #define _GLVAS_SUPPPORT
  73.     //#define RV_BINARYDECLS
  74.     #define RV_SINGLE_DECL_FILE
  75.     // this can't be used with _RV_MEM_SYS_SUPPORT and actually shouldn't be used at all on the Xenon at present
  76.     #if !defined(_RV_MEM_SYS_SUPPORT) && !defined(ID_REDIRECT_NEWDELETE)
  77.         #define RV_UNIFIED_ALLOCATOR
  78.     #endif
  79.  
  80.     // SMP support for running the backend on a 2nd thread
  81.     //#define ENABLE_INTEL_SMP
  82.  
  83.     // Empty define for Xbox 360 compatibility
  84.     #define RESTRICT
  85.     #define TIME_THIS_SCOPE(x)
  86.  
  87.     #define NEWLINE                "\r\n"
  88.  
  89.     #pragma warning( disable : 4100 )            // unreferenced formal parameter
  90.     #pragma warning( disable : 4127 )            // conditional expression is constant
  91.     #pragma warning( disable : 4201 )            // non standard extension nameless struct or union
  92.     #pragma warning( disable : 4244 )            // conversion to smaller type, possible loss of data
  93.     #pragma warning( disable : 4245 )            // signed/unsigned mismatch
  94.     #pragma warning( disable : 4389 )            // signed/unsigned mismatch
  95.     #pragma warning( disable : 4714 )            // function marked as __forceinline not inlined
  96.     #pragma warning( disable : 4800 )            // forcing value to bool 'true' or 'false' (performance warning)
  97.  
  98.     class AlignmentChecker
  99.     {
  100.     public:
  101.         static void UpdateCount(void const * const ptr) {}
  102.         static void ClearCount() {}
  103.         static void Print() {}
  104.     };
  105.  
  106. #endif // _WINDOWS
  107.  
  108. #ifdef __linux__
  109.  
  110. // for offsetof
  111. #include <stddef.h>
  112. // FLT_MAX and such
  113. #include <limits.h>
  114. #include <float.h>
  115.  
  116.     #define __WITH_PB__
  117.     #undef WIN32
  118.     #undef _XBOX
  119.     #undef _CONSOLE
  120.     #define _OPENGL
  121.     #define _LITTLE_ENDIAN
  122.     #define _CASE_SENSITIVE_FILESYSTEM
  123.  
  124.     #define NEWLINE                "\n"
  125.  
  126.     #define _GLVAS_SUPPPORT
  127.  
  128.     class AlignmentChecker
  129.     {
  130.     public:
  131.         static void UpdateCount(void const * const ptr) {}
  132.         static void ClearCount() {}
  133.         static void Print() {}
  134.     };
  135.  
  136.     #define RESTRICT
  137.     #define TIME_THIS_SCOPE(x)
  138. #endif
  139.  
  140. #ifdef MACOS_X
  141.  
  142. // for offsetof
  143. #include <stddef.h>
  144.  
  145. #include <ppc_intrinsics.h>        // for square root estimate instruction
  146. #include <limits.h>
  147. #include <float.h>                // for FLT_MIN
  148.  
  149. // TMP
  150. //    #define __WITH_PB__
  151.     #undef WIN32
  152.     #undef _XBOX
  153.     #undef _CONSOLE
  154.     #define _OPENGL
  155.     #undef _LITTLE_ENDIAN
  156.     #define _CASE_SENSITIVE_FILESYSTEM
  157.  
  158.     #define NEWLINE                "\n"
  159.  
  160.     #define _GLVAS_SUPPPORT
  161.  
  162.     class AlignmentChecker
  163.     {
  164.     public:
  165.         static void UpdateCount(void const * const ptr) {}
  166.         static void ClearCount() {}
  167.         static void Print() {}
  168.     };
  169.  
  170.     #define RESTRICT
  171.     #define TIME_THIS_SCOPE(x)
  172. #endif
  173.  
  174. #ifdef _WINDOWS
  175.  
  176. #ifndef Q4SDK
  177.  
  178. #if !defined( GAME_DLL ) && !defined( GAME_MONO )
  179.  
  180. #define _WIN32_WINNT        0x501
  181. #define WINVER                0x501
  182.  
  183. #ifdef    ID_DEDICATED
  184. // dedicated sets windows version here
  185. #define    WIN32_LEAN_AND_MEAN
  186. #else
  187. #ifdef TOOL_DLL
  188. // non-dedicated includes MFC and sets windows verion here
  189. #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS    // prevent auto literal to string conversion
  190. #include "../tools/comafx/StdAfx.h"
  191. #endif // TOOL_DLL
  192. #endif // ID_DEDICATED
  193.  
  194. #include <winsock2.h>
  195. #include <mmsystem.h>
  196. #include <mmreg.h>
  197.  
  198. #define DIRECTINPUT_VERSION  0x0700
  199. #define DIRECTSOUND_VERSION  0x0800
  200.  
  201. #include "../mssdk/include/dsound.h"
  202. #include "../mssdk/include/dinput.h"
  203. #include "../mssdk/include/dxerr8.h"
  204.  
  205. #endif // GAME_DLL
  206. #endif // !Q4SDK
  207.  
  208. #include <malloc.h>                            // no malloc.h on mac or unix
  209. #include <windows.h>                        // for qgl.h
  210.  
  211. // RAVEN BEGIN
  212. // bdube: for dual monitor support in tools
  213. #ifndef GET_X_LPARAM
  214. #define GET_X_LPARAM(lParam)    ((int)(short)LOWORD(lParam))
  215. #endif
  216. #ifndef GET_Y_LPARAM
  217. #define GET_Y_LPARAM(lParam)    ((int)(short)HIWORD(lParam))
  218. #endif
  219. // RAVEN END
  220.  
  221. #undef FindText                                // stupid namespace poluting Microsoft monkeys
  222.  
  223. #endif // _WINDOWS
  224.  
  225. //-----------------------------------------------------
  226.  
  227. #if !defined( _DEBUG ) && !defined( NDEBUG )
  228.     // don't generate asserts
  229.     #define NDEBUG
  230. #endif
  231.  
  232. #include <stdio.h>
  233. #include <stdlib.h>
  234. #include <stdarg.h>
  235. #include <string.h>
  236. #include <assert.h>
  237. #include <time.h>
  238. #include <ctype.h>
  239. #include <typeinfo>
  240. #include <errno.h>
  241. #include <math.h>
  242.  
  243. //-----------------------------------------------------
  244.  
  245. // non-portable system services
  246. #include "../sys/sys_public.h"
  247.  
  248. // id lib
  249. #include "../idlib/Lib.h"
  250.  
  251. #if !defined( Q4SDK ) && defined( __WITH_PB__ )
  252.     #include "../punkbuster/pbcommon.h"
  253. #endif
  254.  
  255. // RAVEN BEGIN
  256. // jsinger: added to allow support for serialization/deserialization of binary decls
  257. #ifdef RV_BINARYDECLS
  258. // jsinger: Serializable class support
  259. #include "../serialization/Serializable.h"
  260. #endif
  261. // RAVEN END
  262.  
  263. // framework
  264. #include "../framework/BuildVersion.h"
  265. #include "../framework/BuildDefines.h"
  266. #include "../framework/licensee.h"
  267. #include "../framework/CmdSystem.h"
  268. #include "../framework/CVarSystem.h"
  269. #include "../framework/Common.h"
  270. #include "../framework/File.h"
  271. #include "../framework/FileSystem.h"
  272. #include "../framework/UsercmdGen.h"
  273.  
  274. // decls
  275. #include "../framework/declManager.h"
  276. #include "../framework/declTable.h"
  277. #include "../framework/declSkin.h"
  278. #include "../framework/declEntityDef.h"
  279. // RAVEN BEGIN
  280. // jscott: not using
  281. //#include "../framework/DeclFX.h"
  282. //#include "../framework/DeclParticle.h"
  283. // RAVEN END
  284. #include "../framework/declAF.h"
  285. #include "../framework/DeclPDA.h"
  286. // RAVEN BEGIN
  287. // jscott: new decl types
  288. #include "../framework/declMatType.h"
  289. #include "../framework/declLipSync.h"
  290. #include "../framework/declPlayback.h"
  291. // RAVEN END
  292.  
  293. // We have expression parsing and evaluation code in multiple places:
  294. // materials, sound shaders, and guis. We should unify them.
  295. const int MAX_EXPRESSION_OPS = 4096;
  296. const int MAX_EXPRESSION_REGISTERS = 4096;
  297.  
  298. // Sanity check for any axis in bounds
  299. const float MAX_BOUND_SIZE = 65536.0f;
  300.  
  301. // renderer
  302. #include "../renderer/qgl.h"
  303. #include "../renderer/Cinematic.h"
  304. #include "../renderer/Material.h"
  305. #include "../renderer/Model.h"
  306. #include "../renderer/ModelManager.h"
  307. #include "../renderer/RenderSystem.h"
  308. #include "../renderer/RenderWorld.h"
  309.  
  310. // sound engine
  311. #include "../sound/sound.h"
  312.  
  313. // RAVEN BEGIN
  314. // jscott: Effects system interface
  315. #include "../bse/BSEInterface.h"
  316. // RAVEN END
  317.  
  318. // asynchronous networking
  319. #include "../framework/async/NetworkSystem.h"
  320.  
  321. // user interfaces
  322. #include "../ui/ListGUI.h"
  323. #include "../ui/UserInterface.h"
  324.  
  325. // collision detection system
  326. #include "../cm/CollisionModel.h"
  327.  
  328. // AAS files and manager
  329. #include "../aas/AASFile.h"
  330. #include "../aas/AASFileManager.h"
  331.  
  332. // game
  333. #include "../game/Game.h"
  334.  
  335. //-----------------------------------------------------
  336.  
  337. #if defined( Q4SDK ) || defined( GAME_DLL ) || defined( GAME_MONO )
  338.  
  339. #include "../game/Game_local.h"
  340.  
  341. #else
  342.  
  343. #include "../framework/DemoChecksum.h"
  344.  
  345. // framework
  346. #include "../framework/Compressor.h"
  347. #include "../framework/EventLoop.h"
  348. #include "../framework/KeyInput.h"
  349. #include "../framework/EditField.h"
  350. #include "../framework/Console.h"
  351. #include "../framework/DemoFile.h"
  352. #include "../framework/Session.h"
  353.  
  354. // asynchronous networking
  355. #include "../framework/async/AsyncNetwork.h"
  356.  
  357. // RAVEN BEGIN
  358. #include "../tools/Tools.h"
  359. // RAVEN END
  360.  
  361. #endif /* !GAME_DLL */
  362.  
  363. // RAVEN BEGIN
  364. // jsinger: add AutoPtr and text-to-binary compiler support
  365. #include "AutoPtr.h"
  366. #include "LexerFactory.h"
  367. #include "TextCompiler.h"
  368. // jsinger: AutoCrit.h contains classes which aid in code synchronization
  369. //          AutoAcquire.h contains a class that aids in thread acquisition of the direct3D device for xenon
  370. //          Both compile out completely if the #define's above are not present
  371. #include "threads/AutoCrit.h"
  372. // RAVEN END
  373.  
  374. //-----------------------------------------------------
  375.  
  376. #endif    /* __cplusplus */
  377.  
  378. #endif /* !__PRECOMPILED_H__ */
  379.