Initialization.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #pragma once
  2. //========================================================================
  3. // Initialization.h : Defines utility functions for game initialization
  4. //
  5. //
  6. // Part of the GameCode4 Application
  7. //
  8. // GameCode4 is the sample application that encapsulates much of the source code
  9. // discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David
  10. // "Rez" Graham, published by Charles River Media.
  11. // ISBN-10: 1133776574 | ISBN-13: 978-1133776574
  12. //
  13. // If this source code has found it's way to you, and you think it has helped you
  14. // in any way, do the authors a favor and buy a new copy of the book - there are
  15. // detailed explanations in it that compliment this code well. Buy a copy at Amazon.com
  16. // by clicking here:
  17. // http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller=
  18. //
  19. // There's a companion web site at http://www.mcshaffry.com/GameCode/
  20. //
  21. // The source code is managed and maintained through Google Code:
  22. // http://code.google.com/p/gamecode4/
  23. //
  24. // (c) Copyright 2012 Michael L. McShaffry and David Graham
  25. //
  26. // This program is free software; you can redistribute it and/or
  27. // modify it under the terms of the GNU Lesser GPL v3
  28. // as published by the Free Software Foundation.
  29. //
  30. // This program is distributed in the hope that it will be useful,
  31. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  33. // http://www.gnu.org/licenses/lgpl-3.0.txt for more details.
  34. //
  35. // You should have received a copy of the GNU Lesser GPL v3
  36. // along with this program; if not, write to the Free Software
  37. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  38. //
  39. //========================================================================
  40. #include "../Unix/GameCodeStd.h"
  41. #include "../Utilities/types.h"
  42. #include <string>
  43. #include <tinyxml.h>
  44. extern bool CheckStorage(const size_t diskSpaceNeeded);
  45. extern unsigned int ReadCPUSpeed();
  46. extern bool CheckMemory(const size_t physicalRAMNeeded, const size_t virtualRAMNeeded);
  47. // extern bool IsOnlyInstance(LPCTSTR gameTitle);
  48. // extern const TCHAR *GetSaveGameDirectory(HWND hWnd, const TCHAR *gameAppDirectory);
  49. // extern bool CheckForJoystick(HWND hWnd);
  50. struct GameOptions
  51. {
  52. // Level option
  53. std::string m_Level;
  54. // Rendering options
  55. std::string m_Renderer;
  56. bool m_runFullSpeed;
  57. Point m_ScreenSize;
  58. // Sound options
  59. float m_soundEffectsVolume;
  60. float m_musicVolume;
  61. // Multiplayer options
  62. int m_expectedPlayers;
  63. int m_listenPort;
  64. std::string m_gameHost;
  65. int m_numAIs;
  66. int m_maxAIs;
  67. int m_maxPlayers;
  68. // resource cache options
  69. bool m_useDevelopmentDirectories;
  70. // TiXmlElement - look at this to find other options added by the developer
  71. TiXmlDocument *m_pDoc;
  72. GameOptions();
  73. ~GameOptions() { SAFE_DELETE(m_pDoc); }
  74. void Init(const char* xmlFilePath);
  75. };