Win32GameEngine.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: Win32GameEngine.h ////////////////////////////////////////////////////////////////////////
  24. // Author: Colin Day, April 2001
  25. // Description:
  26. // Device implementation of the game engine ... this is, of course, the
  27. // highest level of the game that creates the necessary interfaces to the
  28. // devices we need
  29. ///////////////////////////////////////////////////////////////////////////////////////////////////
  30. #pragma once
  31. #ifndef __WIN32GAMEENGINE_H_
  32. #define __WIN32GAMEENGINE_H_
  33. #include "Common/GameEngine.h"
  34. #include "GameLogic/GameLogic.h"
  35. #include "GameNetwork/NetworkInterface.h"
  36. #include "MilesAudioDevice/MilesAudioManager.h"
  37. #include "Win32Device/Common/Win32BIGFileSystem.h"
  38. #include "Win32Device/Common/Win32LocalFileSystem.h"
  39. #include "W3DDevice/Common/W3DModuleFactory.h"
  40. #include "W3DDevice/GameLogic/W3DGameLogic.h"
  41. #include "W3DDevice/GameClient/W3DGameClient.h"
  42. #include "W3DDevice/GameClient/W3DWebBrowser.h"
  43. #include "W3DDevice/Common/W3DFunctionLexicon.h"
  44. #include "W3DDevice/Common/W3DRadar.h"
  45. #include "W3DDevice/Common/W3DFunctionLexicon.h"
  46. #include "W3DDevice/Common/W3DThingFactory.h"
  47. //-------------------------------------------------------------------------------------------------
  48. /** Class declaration for the Win32 game engine */
  49. //-------------------------------------------------------------------------------------------------
  50. class Win32GameEngine : public GameEngine
  51. {
  52. public:
  53. Win32GameEngine();
  54. virtual ~Win32GameEngine();
  55. virtual void init( void ); ///< initialization
  56. virtual void reset( void ); ///< reset engine
  57. virtual void update( void ); ///< update the game engine
  58. virtual void serviceWindowsOS( void ); ///< allow windows maintenance in background
  59. protected:
  60. virtual GameLogic *createGameLogic( void ); ///< factory for game logic
  61. virtual GameClient *createGameClient( void ); ///< factory for game client
  62. virtual ModuleFactory *createModuleFactory( void ); ///< factory for creating modules
  63. virtual ThingFactory *createThingFactory( void ); ///< factory for the thing factory
  64. virtual FunctionLexicon *createFunctionLexicon( void ); ///< factory for function lexicon
  65. virtual LocalFileSystem *createLocalFileSystem( void ); ///< factory for local file system
  66. virtual ArchiveFileSystem *createArchiveFileSystem( void ); ///< factory for archive file system
  67. virtual NetworkInterface *createNetwork( void ); ///< Factory for the network
  68. virtual Radar *createRadar( void ); ///< Factory for radar
  69. virtual WebBrowser *createWebBrowser( void ); ///< Factory for embedded browser
  70. virtual AudioManager *createAudioManager( void ); ///< Factory for audio device
  71. virtual ParticleSystemManager* createParticleSystemManager( void );
  72. protected:
  73. UINT m_previousErrorMode;
  74. }; // end Win32GameEngine
  75. // INLINE -----------------------------------------------------------------------------------------
  76. inline GameLogic *Win32GameEngine::createGameLogic( void ) { return NEW W3DGameLogic; }
  77. inline GameClient *Win32GameEngine::createGameClient( void ) { return NEW W3DGameClient; }
  78. inline ModuleFactory *Win32GameEngine::createModuleFactory( void ) { return NEW W3DModuleFactory; }
  79. inline ThingFactory *Win32GameEngine::createThingFactory( void ) { return NEW W3DThingFactory; }
  80. inline FunctionLexicon *Win32GameEngine::createFunctionLexicon( void ) { return NEW W3DFunctionLexicon; }
  81. inline LocalFileSystem *Win32GameEngine::createLocalFileSystem( void ) { return NEW Win32LocalFileSystem; }
  82. inline ArchiveFileSystem *Win32GameEngine::createArchiveFileSystem( void ) { return NEW Win32BIGFileSystem; }
  83. inline ParticleSystemManager* Win32GameEngine::createParticleSystemManager( void ) { return NEW W3DParticleSystemManager; }
  84. inline NetworkInterface *Win32GameEngine::createNetwork( void ) { return NetworkInterface::createNetwork(); }
  85. inline Radar *Win32GameEngine::createRadar( void ) { return NEW W3DRadar; }
  86. inline WebBrowser *Win32GameEngine::createWebBrowser( void ) { return NEW CComObject<W3DWebBrowser>; }
  87. inline AudioManager *Win32GameEngine::createAudioManager( void ) { return NEW MilesAudioManager; }
  88. #endif // end __WIN32GAMEENGINE_H_