GlobalData.cpp 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  1. /*
  2. ** Command & Conquer Generals(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: GlobalData.cpp ///////////////////////////////////////////////////////////////////////////
  24. // The GameLogicData object
  25. // Author: trolfs, Michael Booth, Colin Day, April 2001
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. //#pragma once
  28. // INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
  29. #include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
  30. #define DEFINE_TERRAIN_LOD_NAMES
  31. #define DEFINE_TIME_OF_DAY_NAMES
  32. #define DEFINE_WEATHER_NAMES
  33. #define DEFINE_BODYDAMAGETYPE_NAMES
  34. #define DEFINE_PANNING_NAMES
  35. #include "Common/CRC.h"
  36. #include "Common/File.h"
  37. #include "Common/FileSystem.h"
  38. #include "Common/GameAudio.h"
  39. #include "Common/INI.h"
  40. #include "Common/UserPreferences.h"
  41. #include "Common/Version.h"
  42. #include "GameLogic/AI.h"
  43. #include "GameLogic/Weapon.h"
  44. #include "GameLogic/Module/BodyModule.h"
  45. #include "GameClient/Color.h"
  46. #include "GameClient/TerrainVisual.h"
  47. #include "GameNetwork/FirewallHelper.h"
  48. // PUBLIC DATA ////////////////////////////////////////////////////////////////////////////////////
  49. GlobalData* TheWritableGlobalData = NULL; ///< The global data singleton
  50. //-------------------------------------------------------------------------------------------------
  51. GlobalData* GlobalData::m_theOriginal = NULL;
  52. ///////////////////////////////////////////////////////////////////////////////////////////////////
  53. // PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
  54. ///////////////////////////////////////////////////////////////////////////////////////////////////
  55. /*static*/ const FieldParse GlobalData::s_GlobalDataFieldParseTable[] =
  56. {
  57. #if !defined(_PLAYTEST)
  58. { "Windowed", INI::parseBool, NULL, offsetof( GlobalData, m_windowed ) },
  59. { "XResolution", INI::parseInt, NULL, offsetof( GlobalData, m_xResolution ) },
  60. { "YResolution", INI::parseInt, NULL, offsetof( GlobalData, m_yResolution ) },
  61. #endif
  62. { "MapName", INI::parseAsciiString,NULL, offsetof( GlobalData, m_mapName ) },
  63. { "MoveHintName", INI::parseAsciiString,NULL, offsetof( GlobalData, m_moveHintName ) },
  64. { "UseTrees", INI::parseBool, NULL, offsetof( GlobalData, m_useTrees ) },
  65. { "UseFPSLimit", INI::parseBool, NULL, offsetof( GlobalData, m_useFpsLimit ) },
  66. { "DumpAssetUsage", INI::parseBool, NULL, offsetof( GlobalData, m_dumpAssetUsage ) },
  67. { "FramesPerSecondLimit", INI::parseInt, NULL, offsetof( GlobalData, m_framesPerSecondLimit ) },
  68. { "ChipsetType", INI::parseInt, NULL, offsetof( GlobalData, m_chipSetType ) },
  69. { "MaxShellScreens", INI::parseInt, NULL, offsetof( GlobalData, m_maxShellScreens ) },
  70. { "UseCloudMap", INI::parseBool, NULL, offsetof( GlobalData, m_useCloudMap ) },
  71. { "UseLightMap", INI::parseBool, NULL, offsetof( GlobalData, m_useLightMap ) },
  72. { "BilinearTerrainTex", INI::parseBool, NULL, offsetof( GlobalData, m_bilinearTerrainTex ) },
  73. { "TrilinearTerrainTex", INI::parseBool, NULL, offsetof( GlobalData, m_trilinearTerrainTex ) },
  74. { "MultiPassTerrain", INI::parseBool, NULL, offsetof( GlobalData, m_multiPassTerrain ) },
  75. { "AdjustCliffTextures", INI::parseBool, NULL, offsetof( GlobalData, m_adjustCliffTextures ) },
  76. { "Use3WayTerrainBlends", INI::parseInt, NULL, offsetof( GlobalData, m_use3WayTerrainBlends ) },
  77. { "StretchTerrain", INI::parseBool, NULL, offsetof( GlobalData, m_stretchTerrain ) },
  78. { "UseHalfHeightMap", INI::parseBool, NULL, offsetof( GlobalData, m_useHalfHeightMap ) },
  79. { "UserDataLeafName", INI::parseQuotedAsciiString, NULL, offsetof( GlobalData, m_userDataLeafName ) },
  80. { "DrawEntireTerrain", INI::parseBool, NULL, offsetof( GlobalData, m_drawEntireTerrain ) },
  81. { "TerrainLOD", INI::parseIndexList, TerrainLODNames, offsetof( GlobalData, m_terrainLOD ) },
  82. { "TerrainLODTargetTimeMS", INI::parseInt, NULL, offsetof( GlobalData, m_terrainLODTargetTimeMS ) },
  83. { "RightMouseAlwaysScrolls", INI::parseBool, NULL, offsetof( GlobalData, m_rightMouseAlwaysScrolls ) },
  84. { "UseWaterPlane", INI::parseBool, NULL, offsetof( GlobalData, m_useWaterPlane ) },
  85. { "UseCloudPlane", INI::parseBool, NULL, offsetof( GlobalData, m_useCloudPlane ) },
  86. { "DownwindAngle", INI::parseReal, NULL, offsetof( GlobalData, m_downwindAngle ) },
  87. { "UseShadowVolumes", INI::parseBool, NULL, offsetof( GlobalData, m_useShadowVolumes ) },
  88. { "UseShadowDecals", INI::parseBool, NULL, offsetof( GlobalData, m_useShadowDecals ) },
  89. { "TextureReductionFactor", INI::parseInt, NULL, offsetof( GlobalData, m_textureReductionFactor ) },
  90. { "UseBehindBuildingMarker", INI::parseBool, NULL, offsetof( GlobalData, m_enableBehindBuildingMarkers ) },
  91. { "WaterPositionX", INI::parseReal, NULL, offsetof( GlobalData, m_waterPositionX ) },
  92. { "WaterPositionY", INI::parseReal, NULL, offsetof( GlobalData, m_waterPositionY ) },
  93. { "WaterPositionZ", INI::parseReal, NULL, offsetof( GlobalData, m_waterPositionZ ) },
  94. { "WaterExtentX", INI::parseReal, NULL, offsetof( GlobalData, m_waterExtentX ) },
  95. { "WaterExtentY", INI::parseReal, NULL, offsetof( GlobalData, m_waterExtentY ) },
  96. { "WaterType", INI::parseInt, NULL, offsetof( GlobalData, m_waterType ) },
  97. { "FeatherWater", INI::parseInt, NULL, offsetof( GlobalData, m_featherWater ) },
  98. { "ShowSoftWaterEdge", INI::parseBool, NULL, offsetof( GlobalData, m_showSoftWaterEdge ) },
  99. // nasty ick, we need to save this data with a map and not hard code INI values
  100. { "VertexWaterAvailableMaps1", INI::parseAsciiString, NULL, offsetof( GlobalData, m_vertexWaterAvailableMaps[ 0 ] ) },
  101. { "VertexWaterHeightClampLow1", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterHeightClampLow[ 0 ] ) },
  102. { "VertexWaterHeightClampHi1", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterHeightClampHi[ 0 ] ) },
  103. { "VertexWaterAngle1", INI::parseAngleReal, NULL, offsetof( GlobalData, m_vertexWaterAngle[ 0 ] ) },
  104. { "VertexWaterXPosition1", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterXPosition[ 0 ] ) },
  105. { "VertexWaterYPosition1", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterYPosition[ 0 ] ) },
  106. { "VertexWaterZPosition1", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterZPosition[ 0 ] ) },
  107. { "VertexWaterXGridCells1", INI::parseInt, NULL, offsetof( GlobalData, m_vertexWaterXGridCells[ 0 ] ) },
  108. { "VertexWaterYGridCells1", INI::parseInt, NULL, offsetof( GlobalData, m_vertexWaterYGridCells[ 0 ] ) },
  109. { "VertexWaterGridSize1", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterGridSize[ 0 ] ) },
  110. { "VertexWaterAttenuationA1", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationA[ 0 ] ) },
  111. { "VertexWaterAttenuationB1", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationB[ 0 ] ) },
  112. { "VertexWaterAttenuationC1", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationC[ 0 ] ) },
  113. { "VertexWaterAttenuationRange1", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationRange[ 0 ] ) },
  114. // nasty ick, we need to save this data with a map and not hard code INI values
  115. { "VertexWaterAvailableMaps2", INI::parseAsciiString, NULL, offsetof( GlobalData, m_vertexWaterAvailableMaps[ 1 ] ) },
  116. { "VertexWaterHeightClampLow2", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterHeightClampLow[ 1 ] ) },
  117. { "VertexWaterHeightClampHi2", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterHeightClampHi[ 1 ] ) },
  118. { "VertexWaterAngle2", INI::parseAngleReal, NULL, offsetof( GlobalData, m_vertexWaterAngle[ 1 ] ) },
  119. { "VertexWaterXPosition2", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterXPosition[ 1 ] ) },
  120. { "VertexWaterYPosition2", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterYPosition[ 1 ] ) },
  121. { "VertexWaterZPosition2", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterZPosition[ 1 ] ) },
  122. { "VertexWaterXGridCells2", INI::parseInt, NULL, offsetof( GlobalData, m_vertexWaterXGridCells[ 1 ] ) },
  123. { "VertexWaterYGridCells2", INI::parseInt, NULL, offsetof( GlobalData, m_vertexWaterYGridCells[ 1 ] ) },
  124. { "VertexWaterGridSize2", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterGridSize[ 1 ] ) },
  125. { "VertexWaterAttenuationA2", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationA[ 1 ] ) },
  126. { "VertexWaterAttenuationB2", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationB[ 1 ] ) },
  127. { "VertexWaterAttenuationC2", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationC[ 1 ] ) },
  128. { "VertexWaterAttenuationRange2", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationRange[ 1 ] ) },
  129. // nasty ick, we need to save this data with a map and not hard code INI values
  130. { "VertexWaterAvailableMaps3", INI::parseAsciiString, NULL, offsetof( GlobalData, m_vertexWaterAvailableMaps[ 2 ] ) },
  131. { "VertexWaterHeightClampLow3", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterHeightClampLow[ 2 ] ) },
  132. { "VertexWaterHeightClampHi3", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterHeightClampHi[ 2 ] ) },
  133. { "VertexWaterAngle3", INI::parseAngleReal, NULL, offsetof( GlobalData, m_vertexWaterAngle[ 2 ] ) },
  134. { "VertexWaterXPosition3", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterXPosition[ 2 ] ) },
  135. { "VertexWaterYPosition3", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterYPosition[ 2 ] ) },
  136. { "VertexWaterZPosition3", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterZPosition[ 2 ] ) },
  137. { "VertexWaterXGridCells3", INI::parseInt, NULL, offsetof( GlobalData, m_vertexWaterXGridCells[ 2 ] ) },
  138. { "VertexWaterYGridCells3", INI::parseInt, NULL, offsetof( GlobalData, m_vertexWaterYGridCells[ 2 ] ) },
  139. { "VertexWaterGridSize3", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterGridSize[ 2 ] ) },
  140. { "VertexWaterAttenuationA3", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationA[ 2 ] ) },
  141. { "VertexWaterAttenuationB3", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationB[ 2 ] ) },
  142. { "VertexWaterAttenuationC3", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationC[ 2 ] ) },
  143. { "VertexWaterAttenuationRange3", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationRange[ 2 ] ) },
  144. // nasty ick, we need to save this data with a map and not hard code INI values
  145. { "VertexWaterAvailableMaps4", INI::parseAsciiString, NULL, offsetof( GlobalData, m_vertexWaterAvailableMaps[ 3 ] ) },
  146. { "VertexWaterHeightClampLow4", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterHeightClampLow[ 3 ] ) },
  147. { "VertexWaterHeightClampHi4", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterHeightClampHi[ 3 ] ) },
  148. { "VertexWaterAngle4", INI::parseAngleReal, NULL, offsetof( GlobalData, m_vertexWaterAngle[ 3 ] ) },
  149. { "VertexWaterXPosition4", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterXPosition[ 3 ] ) },
  150. { "VertexWaterYPosition4", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterYPosition[ 3 ] ) },
  151. { "VertexWaterZPosition4", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterZPosition[ 3 ] ) },
  152. { "VertexWaterXGridCells4", INI::parseInt, NULL, offsetof( GlobalData, m_vertexWaterXGridCells[ 3 ] ) },
  153. { "VertexWaterYGridCells4", INI::parseInt, NULL, offsetof( GlobalData, m_vertexWaterYGridCells[ 3 ] ) },
  154. { "VertexWaterGridSize4", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterGridSize[ 3 ] ) },
  155. { "VertexWaterAttenuationA4", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationA[ 3 ] ) },
  156. { "VertexWaterAttenuationB4", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationB[ 3 ] ) },
  157. { "VertexWaterAttenuationC4", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationC[ 3 ] ) },
  158. { "VertexWaterAttenuationRange4", INI::parseReal, NULL, offsetof( GlobalData, m_vertexWaterAttenuationRange[ 3 ] ) },
  159. { "SkyBoxPositionZ", INI::parseReal, NULL, offsetof( GlobalData, m_skyBoxPositionZ ) },
  160. { "SkyBoxScale", INI::parseReal, NULL, offsetof( GlobalData, m_skyBoxScale ) },
  161. { "DrawSkyBox", INI::parseBool, NULL, offsetof( GlobalData, m_drawSkyBox ) },
  162. { "CameraPitch", INI::parseReal, NULL, offsetof( GlobalData, m_cameraPitch ) },
  163. { "CameraYaw", INI::parseReal, NULL, offsetof( GlobalData, m_cameraYaw ) },
  164. { "CameraHeight", INI::parseReal, NULL, offsetof( GlobalData, m_cameraHeight ) },
  165. { "MaxCameraHeight", INI::parseReal, NULL, offsetof( GlobalData, m_maxCameraHeight ) },
  166. { "MinCameraHeight", INI::parseReal, NULL, offsetof( GlobalData, m_minCameraHeight ) },
  167. { "TerrainHeightAtEdgeOfMap", INI::parseReal, NULL, offsetof( GlobalData, m_terrainHeightAtEdgeOfMap ) },
  168. { "UnitDamagedThreshold", INI::parseReal, NULL, offsetof( GlobalData, m_unitDamagedThresh ) },
  169. { "UnitReallyDamagedThreshold", INI::parseReal, NULL, offsetof( GlobalData, m_unitReallyDamagedThresh ) },
  170. { "GroundStiffness", INI::parseReal, NULL, offsetof( GlobalData, m_groundStiffness ) },
  171. { "StructureStiffness", INI::parseReal, NULL, offsetof( GlobalData, m_structureStiffness ) },
  172. { "Gravity", INI::parseAccelerationReal, NULL, offsetof( GlobalData, m_gravity ) },
  173. { "StealthFriendlyOpacity", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_stealthFriendlyOpacity ) },
  174. { "DefaultOcclusionDelay", INI::parseDurationUnsignedInt, NULL, offsetof( GlobalData, m_defaultOcclusionDelay ) },
  175. { "PartitionCellSize", INI::parseReal, NULL, offsetof( GlobalData, m_partitionCellSize ) },
  176. { "AmmoPipScaleFactor", INI::parseReal, NULL, offsetof( GlobalData, m_ammoPipScaleFactor ) },
  177. { "ContainerPipScaleFactor", INI::parseReal, NULL, offsetof( GlobalData, m_containerPipScaleFactor ) },
  178. { "AmmoPipWorldOffset", INI::parseCoord3D, NULL, offsetof( GlobalData, m_ammoPipWorldOffset ) },
  179. { "ContainerPipWorldOffset", INI::parseCoord3D, NULL, offsetof( GlobalData, m_containerPipWorldOffset ) },
  180. { "AmmoPipScreenOffset", INI::parseCoord2D, NULL, offsetof( GlobalData, m_ammoPipScreenOffset ) },
  181. { "ContainerPipScreenOffset", INI::parseCoord2D, NULL, offsetof( GlobalData, m_containerPipScreenOffset ) },
  182. { "HistoricDamageLimit", INI::parseDurationUnsignedInt, NULL, offsetof( GlobalData, m_historicDamageLimit ) },
  183. { "MaxTerrainTracks", INI::parseInt, NULL, offsetof( GlobalData, m_maxTerrainTracks ) },
  184. { "TimeOfDay", INI::parseIndexList, TimeOfDayNames, offsetof( GlobalData, m_timeOfDay ) },
  185. { "Weather", INI::parseIndexList, WeatherNames, offsetof( GlobalData, m_weather ) },
  186. { "MakeTrackMarks", INI::parseBool, NULL, offsetof( GlobalData, m_makeTrackMarks ) },
  187. { "HideGarrisonFlags", INI::parseBool, NULL, offsetof( GlobalData, m_hideGarrisonFlags ) },
  188. { "ForceModelsToFollowTimeOfDay", INI::parseBool, NULL, offsetof( GlobalData, m_forceModelsToFollowTimeOfDay ) },
  189. { "ForceModelsToFollowWeather", INI::parseBool, NULL, offsetof( GlobalData, m_forceModelsToFollowWeather ) },
  190. { "LevelGainAnimationName", INI::parseAsciiString, NULL, offsetof( GlobalData, m_levelGainAnimationName ) },
  191. { "LevelGainAnimationTime", INI::parseReal, NULL, offsetof( GlobalData, m_levelGainAnimationDisplayTimeInSeconds ) },
  192. { "LevelGainAnimationZRise", INI::parseReal, NULL, offsetof( GlobalData, m_levelGainAnimationZRisePerSecond ) },
  193. { "GetHealedAnimationName", INI::parseAsciiString, NULL, offsetof( GlobalData, m_getHealedAnimationName ) },
  194. { "GetHealedAnimationTime", INI::parseReal, NULL, offsetof( GlobalData, m_getHealedAnimationDisplayTimeInSeconds ) },
  195. { "GetHealedAnimationZRise", INI::parseReal, NULL, offsetof( GlobalData, m_getHealedAnimationZRisePerSecond ) },
  196. { "TerrainLightingMorningAmbient", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_MORNING ][0].ambient ) },
  197. { "TerrainLightingMorningDiffuse", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_MORNING ][0].diffuse ) },
  198. { "TerrainLightingMorningLightPos", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_MORNING ][0].lightPos ) },
  199. { "TerrainLightingAfternoonAmbient", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_AFTERNOON ][0].ambient ) },
  200. { "TerrainLightingAfternoonDiffuse", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_AFTERNOON ][0].diffuse ) },
  201. { "TerrainLightingAfternoonLightPos", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_AFTERNOON ][0].lightPos ) },
  202. { "TerrainLightingEveningAmbient", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_EVENING ][0].ambient ) },
  203. { "TerrainLightingEveningDiffuse", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_EVENING ][0].diffuse ) },
  204. { "TerrainLightingEveningLightPos", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_EVENING ][0].lightPos ) },
  205. { "TerrainLightingNightAmbient", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_NIGHT ][0].ambient ) },
  206. { "TerrainLightingNightDiffuse", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_NIGHT ][0].diffuse ) },
  207. { "TerrainLightingNightLightPos", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_NIGHT ][0].lightPos ) },
  208. { "TerrainObjectsLightingMorningAmbient", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_MORNING ][0].ambient ) },
  209. { "TerrainObjectsLightingMorningDiffuse", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_MORNING ][0].diffuse ) },
  210. { "TerrainObjectsLightingMorningLightPos", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_MORNING ][0].lightPos ) },
  211. { "TerrainObjectsLightingAfternoonAmbient", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_AFTERNOON ][0].ambient ) },
  212. { "TerrainObjectsLightingAfternoonDiffuse", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_AFTERNOON ][0].diffuse ) },
  213. { "TerrainObjectsLightingAfternoonLightPos", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_AFTERNOON ][0].lightPos ) },
  214. { "TerrainObjectsLightingEveningAmbient", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_EVENING ][0].ambient ) },
  215. { "TerrainObjectsLightingEveningDiffuse", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_EVENING ][0].diffuse ) },
  216. { "TerrainObjectsLightingEveningLightPos", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_EVENING ][0].lightPos ) },
  217. { "TerrainObjectsLightingNightAmbient", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_NIGHT ][0].ambient ) },
  218. { "TerrainObjectsLightingNightDiffuse", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_NIGHT ][0].diffuse ) },
  219. { "TerrainObjectsLightingNightLightPos", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_NIGHT ][0].lightPos ) },
  220. //Secondary global light
  221. { "TerrainLightingMorningAmbient2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_MORNING ][1].ambient ) },
  222. { "TerrainLightingMorningDiffuse2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_MORNING ][1].diffuse ) },
  223. { "TerrainLightingMorningLightPos2", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_MORNING ][1].lightPos ) },
  224. { "TerrainLightingAfternoonAmbient2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_AFTERNOON ][1].ambient ) },
  225. { "TerrainLightingAfternoonDiffuse2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_AFTERNOON ][1].diffuse ) },
  226. { "TerrainLightingAfternoonLightPos2", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_AFTERNOON ][1].lightPos ) },
  227. { "TerrainLightingEveningAmbient2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_EVENING ][1].ambient ) },
  228. { "TerrainLightingEveningDiffuse2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_EVENING ][1].diffuse ) },
  229. { "TerrainLightingEveningLightPos2", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_EVENING ][1].lightPos ) },
  230. { "TerrainLightingNightAmbient2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_NIGHT ][1].ambient ) },
  231. { "TerrainLightingNightDiffuse2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_NIGHT ][1].diffuse ) },
  232. { "TerrainLightingNightLightPos2", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_NIGHT ][1].lightPos ) },
  233. { "TerrainObjectsLightingMorningAmbient2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_MORNING ][1].ambient ) },
  234. { "TerrainObjectsLightingMorningDiffuse2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_MORNING ][1].diffuse ) },
  235. { "TerrainObjectsLightingMorningLightPos2", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_MORNING ][1].lightPos ) },
  236. { "TerrainObjectsLightingAfternoonAmbient2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_AFTERNOON ][1].ambient ) },
  237. { "TerrainObjectsLightingAfternoonDiffuse2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_AFTERNOON ][1].diffuse ) },
  238. { "TerrainObjectsLightingAfternoonLightPos2", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_AFTERNOON ][1].lightPos ) },
  239. { "TerrainObjectsLightingEveningAmbient2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_EVENING ][1].ambient ) },
  240. { "TerrainObjectsLightingEveningDiffuse2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_EVENING ][1].diffuse ) },
  241. { "TerrainObjectsLightingEveningLightPos2", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_EVENING ][1].lightPos ) },
  242. { "TerrainObjectsLightingNightAmbient2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_NIGHT ][1].ambient ) },
  243. { "TerrainObjectsLightingNightDiffuse2", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_NIGHT ][1].diffuse ) },
  244. { "TerrainObjectsLightingNightLightPos2", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_NIGHT ][1].lightPos ) },
  245. //Third global light
  246. { "TerrainLightingMorningAmbient3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_MORNING ][2].ambient ) },
  247. { "TerrainLightingMorningDiffuse3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_MORNING ][2].diffuse ) },
  248. { "TerrainLightingMorningLightPos3", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_MORNING ][2].lightPos ) },
  249. { "TerrainLightingAfternoonAmbient3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_AFTERNOON ][2].ambient ) },
  250. { "TerrainLightingAfternoonDiffuse3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_AFTERNOON ][2].diffuse ) },
  251. { "TerrainLightingAfternoonLightPos3", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_AFTERNOON ][2].lightPos ) },
  252. { "TerrainLightingEveningAmbient3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_EVENING ][2].ambient ) },
  253. { "TerrainLightingEveningDiffuse3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_EVENING ][2].diffuse ) },
  254. { "TerrainLightingEveningLightPos3", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_EVENING ][2].lightPos ) },
  255. { "TerrainLightingNightAmbient3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_NIGHT ][2].ambient ) },
  256. { "TerrainLightingNightDiffuse3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_NIGHT ][2].diffuse ) },
  257. { "TerrainLightingNightLightPos3", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLighting[ TIME_OF_DAY_NIGHT ][2].lightPos ) },
  258. { "TerrainObjectsLightingMorningAmbient3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_MORNING ][2].ambient ) },
  259. { "TerrainObjectsLightingMorningDiffuse3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_MORNING ][2].diffuse ) },
  260. { "TerrainObjectsLightingMorningLightPos3", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_MORNING ][2].lightPos ) },
  261. { "TerrainObjectsLightingAfternoonAmbient3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_AFTERNOON ][2].ambient ) },
  262. { "TerrainObjectsLightingAfternoonDiffuse3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_AFTERNOON ][2].diffuse ) },
  263. { "TerrainObjectsLightingAfternoonLightPos3", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_AFTERNOON ][2].lightPos ) },
  264. { "TerrainObjectsLightingEveningAmbient3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_EVENING ][2].ambient ) },
  265. { "TerrainObjectsLightingEveningDiffuse3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_EVENING ][2].diffuse ) },
  266. { "TerrainObjectsLightingEveningLightPos3", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_EVENING ][2].lightPos ) },
  267. { "TerrainObjectsLightingNightAmbient3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_NIGHT ][2].ambient ) },
  268. { "TerrainObjectsLightingNightDiffuse3", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_NIGHT ][2].diffuse ) },
  269. { "TerrainObjectsLightingNightLightPos3", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainObjectsLighting[ TIME_OF_DAY_NIGHT ][2].lightPos ) },
  270. { "NumberGlobalLights", INI::parseInt, NULL, offsetof( GlobalData, m_numGlobalLights)},
  271. { "InfantryLightMorningScale", INI::parseReal, NULL, offsetof( GlobalData, m_infantryLightScale[TIME_OF_DAY_MORNING] ) },
  272. { "InfantryLightAfternoonScale", INI::parseReal, NULL, offsetof( GlobalData, m_infantryLightScale[TIME_OF_DAY_AFTERNOON] ) },
  273. { "InfantryLightEveningScale", INI::parseReal, NULL, offsetof( GlobalData, m_infantryLightScale[TIME_OF_DAY_EVENING] ) },
  274. { "InfantryLightNightScale", INI::parseReal, NULL, offsetof( GlobalData, m_infantryLightScale[TIME_OF_DAY_NIGHT] ) },
  275. { "MaxTranslucentObjects", INI::parseInt, NULL, offsetof( GlobalData, m_maxVisibleTranslucentObjects) },
  276. { "OccludedColorLuminanceScale", INI::parseReal, NULL, offsetof( GlobalData, m_occludedLuminanceScale) },
  277. /* These are internal use only, they do not need file definitons
  278. { "TerrainAmbientRGB", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainAmbient ) },
  279. { "TerrainDiffuseRGB", INI::parseRGBColor, NULL, offsetof( GlobalData, m_terrainDiffuse ) },
  280. { "TerrainLightPos", INI::parseCoord3D, NULL, offsetof( GlobalData, m_terrainLightPos ) },
  281. */
  282. { "MaxRoadSegments", INI::parseInt, NULL, offsetof( GlobalData, m_maxRoadSegments ) },
  283. { "MaxRoadVertex", INI::parseInt, NULL, offsetof( GlobalData, m_maxRoadVertex ) },
  284. { "MaxRoadIndex", INI::parseInt, NULL, offsetof( GlobalData, m_maxRoadIndex ) },
  285. { "MaxRoadTypes", INI::parseInt, NULL, offsetof( GlobalData, m_maxRoadTypes ) },
  286. { "ValuePerSupplyBox", INI::parseInt, NULL, offsetof( GlobalData, m_baseValuePerSupplyBox ) },
  287. { "AudioOn", INI::parseBool, NULL, offsetof( GlobalData, m_audioOn ) },
  288. { "MusicOn", INI::parseBool, NULL, offsetof( GlobalData, m_musicOn ) },
  289. { "SoundsOn", INI::parseBool, NULL, offsetof( GlobalData, m_soundsOn ) },
  290. { "Sounds3DOn", INI::parseBool, NULL, offsetof( GlobalData, m_sounds3DOn ) },
  291. { "SpeechOn", INI::parseBool, NULL, offsetof( GlobalData, m_speechOn ) },
  292. { "VideoOn", INI::parseBool, NULL, offsetof( GlobalData, m_videoOn ) },
  293. { "DisableCameraMovements", INI::parseBool, NULL, offsetof( GlobalData, m_disableCameraMovement ) },
  294. /* These are internal use only, they do not need file definitons
  295. /// @todo remove this hack
  296. { "InGame", INI::parseBool, NULL, offsetof( GlobalData, m_inGame ) },
  297. */
  298. { "DebugAI", INI::parseBool, NULL, offsetof( GlobalData, m_debugAI ) },
  299. { "DebugAIObstacles", INI::parseBool, NULL, offsetof( GlobalData, m_debugAIObstacles ) },
  300. { "ShowClientPhysics", INI::parseBool, NULL, offsetof( GlobalData, m_showClientPhysics ) },
  301. { "ShowTerrainNormals", INI::parseBool, NULL, offsetof( GlobalData, m_showTerrainNormals ) },
  302. { "ShowObjectHealth", INI::parseBool, NULL, offsetof( GlobalData, m_showObjectHealth ) },
  303. { "ParticleScale", INI::parseReal, NULL, offsetof( GlobalData, m_particleScale ) },
  304. { "AutoFireParticleSmallPrefix", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoFireParticleSmallPrefix ) },
  305. { "AutoFireParticleSmallSystem", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoFireParticleSmallSystem ) },
  306. { "AutoFireParticleSmallMax", INI::parseInt, NULL, offsetof( GlobalData, m_autoFireParticleSmallMax ) },
  307. { "AutoFireParticleMediumPrefix", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoFireParticleMediumPrefix ) },
  308. { "AutoFireParticleMediumSystem", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoFireParticleMediumSystem ) },
  309. { "AutoFireParticleMediumMax", INI::parseInt, NULL, offsetof( GlobalData, m_autoFireParticleMediumMax ) },
  310. { "AutoFireParticleLargePrefix", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoFireParticleLargePrefix ) },
  311. { "AutoFireParticleLargeSystem", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoFireParticleLargeSystem ) },
  312. { "AutoFireParticleLargeMax", INI::parseInt, NULL, offsetof( GlobalData, m_autoFireParticleLargeMax ) },
  313. { "AutoSmokeParticleSmallPrefix", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoSmokeParticleSmallPrefix ) },
  314. { "AutoSmokeParticleSmallSystem", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoSmokeParticleSmallSystem ) },
  315. { "AutoSmokeParticleSmallMax", INI::parseInt, NULL, offsetof( GlobalData, m_autoSmokeParticleSmallMax ) },
  316. { "AutoSmokeParticleMediumPrefix", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoSmokeParticleMediumPrefix ) },
  317. { "AutoSmokeParticleMediumSystem", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoSmokeParticleMediumSystem ) },
  318. { "AutoSmokeParticleMediumMax", INI::parseInt, NULL, offsetof( GlobalData, m_autoSmokeParticleMediumMax ) },
  319. { "AutoSmokeParticleLargePrefix", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoSmokeParticleLargePrefix ) },
  320. { "AutoSmokeParticleLargeSystem", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoSmokeParticleLargeSystem ) },
  321. { "AutoSmokeParticleLargeMax", INI::parseInt, NULL, offsetof( GlobalData, m_autoSmokeParticleLargeMax ) },
  322. { "AutoAflameParticlePrefix", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoAflameParticlePrefix ) },
  323. { "AutoAflameParticleSystem", INI::parseAsciiString, NULL, offsetof( GlobalData, m_autoAflameParticleSystem ) },
  324. { "AutoAflameParticleMax", INI::parseInt, NULL, offsetof( GlobalData, m_autoAflameParticleMax ) },
  325. /* These are internal use only, they do not need file definitons
  326. { "LatencyAverage", INI::parseInt, NULL, offsetof( GlobalData, m_latencyAverage ) },
  327. { "LatencyAmplitude", INI::parseInt, NULL, offsetof( GlobalData, m_latencyAmplitude ) },
  328. { "LatencyPeriod", INI::parseInt, NULL, offsetof( GlobalData, m_latencyPeriod ) },
  329. { "LatencyNoise", INI::parseInt, NULL, offsetof( GlobalData, m_latencyNoise ) },
  330. { "PacketLoss", INI::parseInt, NULL, offsetof( GlobalData, m_packetLoss ) },
  331. */
  332. { "BuildSpeed", INI::parseReal, NULL, offsetof( GlobalData, m_BuildSpeed ) },
  333. { "MinDistFromEdgeOfMapForBuild", INI::parseReal, NULL, offsetof( GlobalData, m_MinDistFromEdgeOfMapForBuild ) },
  334. { "SupplyBuildBorder", INI::parseReal, NULL, offsetof( GlobalData, m_SupplyBuildBorder ) },
  335. { "AllowedHeightVariationForBuilding", INI::parseReal,NULL, offsetof( GlobalData, m_allowedHeightVariationForBuilding ) },
  336. { "MinLowEnergyProductionSpeed",INI::parseReal, NULL, offsetof( GlobalData, m_MinLowEnergyProductionSpeed ) },
  337. { "MaxLowEnergyProductionSpeed",INI::parseReal, NULL, offsetof( GlobalData, m_MaxLowEnergyProductionSpeed ) },
  338. { "LowEnergyPenaltyModifier", INI::parseReal, NULL, offsetof( GlobalData, m_LowEnergyPenaltyModifier ) },
  339. { "MultipleFactory", INI::parseReal, NULL, offsetof( GlobalData, m_MultipleFactory ) },
  340. { "RefundPercent", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_RefundPercent ) },
  341. { "CommandCenterHealRange", INI::parseReal, NULL, offsetof( GlobalData, m_commandCenterHealRange ) },
  342. { "CommandCenterHealAmount", INI::parseReal, NULL, offsetof( GlobalData, m_commandCenterHealAmount ) },
  343. { "StandardMinefieldDensity", INI::parseReal, NULL, offsetof( GlobalData, m_standardMinefieldDensity ) },
  344. { "StandardMinefieldDistance", INI::parseReal, NULL, offsetof( GlobalData, m_standardMinefieldDistance ) },
  345. { "MaxLineBuildObjects", INI::parseInt, NULL, offsetof( GlobalData, m_maxLineBuildObjects ) },
  346. { "MaxTunnelCapacity", INI::parseInt, NULL, offsetof( GlobalData, m_maxTunnelCapacity ) },
  347. { "MaxParticleCount", INI::parseInt, NULL, offsetof( GlobalData, m_maxParticleCount ) },
  348. { "MaxFieldParticleCount", INI::parseInt, NULL, offsetof( GlobalData, m_maxFieldParticleCount ) },
  349. { "HorizontalScrollSpeedFactor",INI::parseReal, NULL, offsetof( GlobalData, m_horizontalScrollSpeedFactor ) },
  350. { "VerticalScrollSpeedFactor", INI::parseReal, NULL, offsetof( GlobalData, m_verticalScrollSpeedFactor ) },
  351. { "ScrollAmountCutoff", INI::parseReal, NULL, offsetof( GlobalData, m_scrollAmountCutoff ) },
  352. { "CameraAdjustSpeed", INI::parseReal, NULL, offsetof( GlobalData, m_cameraAdjustSpeed ) },
  353. { "EnforceMaxCameraHeight", INI::parseBool, NULL, offsetof( GlobalData, m_enforceMaxCameraHeight ) },
  354. { "KeyboardScrollSpeedFactor", INI::parseReal, NULL, offsetof( GlobalData, m_keyboardScrollFactor ) },
  355. { "KeyboardDefaultScrollSpeedFactor", INI::parseReal, NULL, offsetof( GlobalData, m_keyboardDefaultScrollFactor ) },
  356. { "MovementPenaltyDamageState", INI::parseIndexList, TheBodyDamageTypeNames, offsetof( GlobalData, m_movementPenaltyDamageState ) },
  357. // you cannot set this; it always has a value of 100%.
  358. //{ "HealthBonus_Regular", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_healthBonus[LEVEL_REGULAR]) },
  359. { "HealthBonus_Veteran", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_healthBonus[LEVEL_VETERAN]) },
  360. { "HealthBonus_Elite", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_healthBonus[LEVEL_ELITE]) },
  361. { "HealthBonus_Heroic", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_healthBonus[LEVEL_HEROIC]) },
  362. { "HumanSoloPlayerHealthBonus_Easy", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_soloPlayerHealthBonusForDifficulty[PLAYER_HUMAN][DIFFICULTY_EASY] ) },
  363. { "HumanSoloPlayerHealthBonus_Normal", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_soloPlayerHealthBonusForDifficulty[PLAYER_HUMAN][DIFFICULTY_NORMAL] ) },
  364. { "HumanSoloPlayerHealthBonus_Hard", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_soloPlayerHealthBonusForDifficulty[PLAYER_HUMAN][DIFFICULTY_HARD] ) },
  365. { "AISoloPlayerHealthBonus_Easy", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_soloPlayerHealthBonusForDifficulty[PLAYER_COMPUTER][DIFFICULTY_EASY] ) },
  366. { "AISoloPlayerHealthBonus_Normal", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_soloPlayerHealthBonusForDifficulty[PLAYER_COMPUTER][DIFFICULTY_NORMAL] ) },
  367. { "AISoloPlayerHealthBonus_Hard", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_soloPlayerHealthBonusForDifficulty[PLAYER_COMPUTER][DIFFICULTY_HARD] ) },
  368. { "WeaponBonus", WeaponBonusSet::parseWeaponBonusSetPtr, NULL, offsetof( GlobalData, m_weaponBonusSet ) },
  369. { "DefaultStructureRubbleHeight", INI::parseReal, NULL, offsetof( GlobalData, m_defaultStructureRubbleHeight ) },
  370. { "FixedSeed", INI::parseInt, NULL, offsetof( GlobalData, m_fixedSeed ) },
  371. { "ShellMapName", INI::parseAsciiString,NULL, offsetof( GlobalData, m_shellMapName ) },
  372. { "ShellMapOn", INI::parseBool, NULL, offsetof( GlobalData, m_shellMapOn ) },
  373. { "PlayIntro", INI::parseBool, NULL, offsetof( GlobalData, m_playIntro ) },
  374. { "FirewallBehavior", INI::parseInt, NULL, offsetof( GlobalData, m_firewallBehavior ) },
  375. { "FirewallPortOverride", INI::parseInt, NULL, offsetof( GlobalData, m_firewallPortOverride ) },
  376. { "FirewallPortAllocationDelta",INI::parseInt, NULL, offsetof( GlobalData, m_firewallPortAllocationDelta) },
  377. { "GroupSelectMinSelectSize", INI::parseInt, NULL, offsetof( GlobalData, m_groupSelectMinSelectSize ) },
  378. { "GroupSelectVolumeBase", INI::parseReal, NULL, offsetof( GlobalData, m_groupSelectVolumeBase ) },
  379. { "GroupSelectVolumeIncrement", INI::parseReal, NULL, offsetof( GlobalData, m_groupSelectVolumeIncrement ) },
  380. { "MaxUnitSelectSounds", INI::parseInt, NULL, offsetof( GlobalData, m_maxUnitSelectSounds ) },
  381. { "SelectionFlashSaturationFactor", INI::parseReal, NULL, offsetof( GlobalData, m_selectionFlashSaturationFactor ) },
  382. { "SelectionFlashHouseColor", INI::parseBool, NULL, offsetof( GlobalData, m_selectionFlashHouseColor ) },
  383. { "CameraAudibleRadius", INI::parseReal, NULL, offsetof( GlobalData, m_cameraAudibleRadius ) },
  384. { "GroupMoveClickToGatherAreaFactor", INI::parseReal, NULL, offsetof( GlobalData, m_groupMoveClickToGatherFactor ) },
  385. { "ShakeSubtleIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_shakeSubtleIntensity ) },
  386. { "ShakeNormalIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_shakeNormalIntensity ) },
  387. { "ShakeStrongIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_shakeStrongIntensity ) },
  388. { "ShakeSevereIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_shakeSevereIntensity ) },
  389. { "ShakeCineExtremeIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_shakeCineExtremeIntensity ) },
  390. { "ShakeCineInsaneIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_shakeCineInsaneIntensity ) },
  391. { "MaxShakeIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_maxShakeIntensity ) },
  392. { "MaxShakeRange", INI::parseReal, NULL, offsetof( GlobalData, m_maxShakeRange) },
  393. { "SellPercentage", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_sellPercentage ) },
  394. { "BaseRegenHealthPercentPerSecond", INI::parsePercentToReal, NULL, offsetof( GlobalData, m_baseRegenHealthPercentPerSecond ) },
  395. { "BaseRegenDelay", INI::parseDurationUnsignedInt, NULL,offsetof( GlobalData, m_baseRegenDelay ) },
  396. #ifdef ALLOW_SURRENDER
  397. { "PrisonBountyMultiplier", INI::parseReal, NULL, offsetof( GlobalData, m_prisonBountyMultiplier ) },
  398. { "PrisonBountyTextColor", INI::parseColorInt, NULL, offsetof( GlobalData, m_prisonBountyTextColor ) },
  399. #endif
  400. { "SpecialPowerViewObject", INI::parseAsciiString, NULL, offsetof( GlobalData, m_specialPowerViewObjectName ) },
  401. { "StandardPublicBone", INI::parseAsciiStringVectorAppend, NULL, offsetof(GlobalData, m_standardPublicBones) },
  402. { "ShowMetrics", INI::parseBool, NULL, offsetof( GlobalData, m_showMetrics ) },
  403. { "DefaultStartingCash", INI::parseUnsignedInt, NULL, offsetof( GlobalData, m_defaultStartingCash ) },
  404. // NOTE: m_doubleClickTimeMS is still in use, but we disallow setting it from the GameData.ini file. It is now set in the constructor according to the windows parameter.
  405. // { "DoubleClickTimeMS", INI::parseUnsignedInt, NULL, offsetof( GlobalData, m_doubleClickTimeMS ) },
  406. { "ShroudColor", INI::parseRGBColor, NULL, offsetof( GlobalData, m_shroudColor) },
  407. { "ClearAlpha", INI::parseUnsignedByte, NULL, offsetof( GlobalData, m_clearAlpha) },
  408. { "FogAlpha", INI::parseUnsignedByte, NULL, offsetof( GlobalData, m_fogAlpha) },
  409. { "ShroudAlpha", INI::parseUnsignedByte, NULL, offsetof( GlobalData, m_shroudAlpha) },
  410. { "HotKeyTextColor", INI::parseColorInt, NULL, offsetof( GlobalData, m_hotKeyTextColor ) },
  411. { "PowerBarBase", INI::parseInt, NULL, offsetof( GlobalData, m_powerBarBase) },
  412. { "PowerBarIntervals", INI::parseReal, NULL, offsetof( GlobalData, m_powerBarIntervals) },
  413. { "PowerBarYellowRange", INI::parseInt, NULL, offsetof( GlobalData, m_powerBarYellowRange) },
  414. { "UnlookPersistDuration", INI::parseDurationUnsignedInt, NULL, offsetof( GlobalData, m_unlookPersistDuration) },
  415. { "NetworkFPSHistoryLength", INI::parseInt, NULL, offsetof(GlobalData, m_networkFPSHistoryLength) },
  416. { "NetworkLatencyHistoryLength", INI::parseInt, NULL, offsetof(GlobalData, m_networkLatencyHistoryLength) },
  417. { "NetworkRunAheadMetricsTime", INI::parseInt, NULL, offsetof(GlobalData, m_networkRunAheadMetricsTime) },
  418. { "NetworkCushionHistoryLength", INI::parseInt, NULL, offsetof(GlobalData, m_networkCushionHistoryLength) },
  419. { "NetworkRunAheadSlack", INI::parseInt, NULL, offsetof(GlobalData, m_networkRunAheadSlack) },
  420. { "NetworkKeepAliveDelay", INI::parseInt, NULL, offsetof(GlobalData, m_networkKeepAliveDelay) },
  421. { "NetworkDisconnectTime", INI::parseInt, NULL, offsetof(GlobalData, m_networkDisconnectTime) },
  422. { "NetworkPlayerTimeoutTime", INI::parseInt, NULL, offsetof(GlobalData, m_networkPlayerTimeoutTime) },
  423. { "NetworkDisconnectScreenNotifyTime", INI::parseInt, NULL, offsetof(GlobalData, m_networkDisconnectScreenNotifyTime) },
  424. { "KeyboardCameraRotateSpeed", INI::parseReal, NULL, offsetof( GlobalData, m_keyboardCameraRotateSpeed ) },
  425. { "PlayStats", INI::parseInt, NULL, offsetof( GlobalData, m_playStats ) },
  426. #if defined(_DEBUG) || defined(_INTERNAL)
  427. { "DisableCameraFade", INI::parseBool, NULL, offsetof( GlobalData, m_disableCameraFade ) },
  428. { "DisableScriptedInputDisabling", INI::parseBool, NULL, offsetof( GlobalData, m_disableScriptedInputDisabling ) },
  429. { "DisableMilitaryCaption", INI::parseBool, NULL, offsetof( GlobalData, m_disableMilitaryCaption ) },
  430. { "BenchmarkTimer", INI::parseInt, NULL, offsetof( GlobalData, m_benchmarkTimer ) },
  431. { "CheckMemoryLeaks", INI::parseBool, NULL, offsetof(GlobalData, m_checkForLeaks) },
  432. { "Wireframe", INI::parseBool, NULL, offsetof( GlobalData, m_wireframe ) },
  433. { "StateMachineDebug", INI::parseBool, NULL, offsetof( GlobalData, m_stateMachineDebug ) },
  434. { "UseCameraConstraints", INI::parseBool, NULL, offsetof( GlobalData, m_useCameraConstraints ) },
  435. { "ShroudOn", INI::parseBool, NULL, offsetof( GlobalData, m_shroudOn ) },
  436. { "FogOfWarOn", INI::parseBool, NULL, offsetof( GlobalData, m_fogOfWarOn ) },
  437. { "ShowCollisionExtents", INI::parseBool, NULL, offsetof( GlobalData, m_showCollisionExtents ) },
  438. { "DebugProjectileTileWidth", INI::parseReal, NULL, offsetof( GlobalData, m_debugProjectileTileWidth) },
  439. { "DebugProjectileTileDuration",INI::parseInt, NULL, offsetof( GlobalData, m_debugProjectileTileDuration) },
  440. { "DebugProjectileTileColor", INI::parseRGBColor, NULL, offsetof( GlobalData, m_debugProjectileTileColor) },
  441. { "DebugVisibilityTileCount", INI::parseInt, NULL, offsetof( GlobalData, m_debugVisibilityTileCount) },
  442. { "DebugVisibilityTileWidth", INI::parseReal, NULL, offsetof( GlobalData, m_debugVisibilityTileWidth) },
  443. { "DebugVisibilityTileDuration",INI::parseInt, NULL, offsetof( GlobalData, m_debugVisibilityTileDuration) },
  444. { "DebugVisibilityTileTargettableColor",INI::parseRGBColor, NULL, offsetof( GlobalData, m_debugVisibilityTargettableColor) },
  445. { "DebugVisibilityTileDeshroudColor", INI::parseRGBColor, NULL, offsetof( GlobalData, m_debugVisibilityDeshroudColor) },
  446. { "DebugVisibilityTileGapColor", INI::parseRGBColor, NULL, offsetof( GlobalData, m_debugVisibilityGapColor) },
  447. { "DebugThreatMapTileDuration", INI::parseInt, NULL, offsetof( GlobalData, m_debugThreatMapTileDuration) },
  448. { "MaxDebugThreatMapValue", INI::parseUnsignedInt, NULL, offsetof( GlobalData, m_maxDebugThreat) },
  449. { "DebugCashValueMapTileDuration", INI::parseInt, NULL, offsetof( GlobalData, m_debugCashValueMapTileDuration) },
  450. { "MaxDebugCashValueMapValue", INI::parseUnsignedInt, NULL, offsetof( GlobalData, m_maxDebugValue) },
  451. { "VTune", INI::parseBool, NULL, offsetof( GlobalData, m_vTune ) },
  452. { "SaveStats", INI::parseBool, NULL, offsetof( GlobalData, m_saveStats ) },
  453. { "UseLocalMOTD", INI::parseBool, NULL, offsetof( GlobalData, m_useLocalMOTD ) },
  454. { "BaseStatsDir", INI::parseAsciiString,NULL, offsetof( GlobalData, m_baseStatsDir ) },
  455. { "LocalMOTDPath", INI::parseAsciiString,NULL, offsetof( GlobalData, m_MOTDPath ) },
  456. #endif
  457. { NULL, NULL, NULL, 0 } // keep this last
  458. };
  459. //-------------------------------------------------------------------------------------------------
  460. //-------------------------------------------------------------------------------------------------
  461. GlobalData::GlobalData()
  462. {
  463. Int i, j;
  464. //
  465. // we have now instanced a global data instance, if theOriginal is NULL, this is
  466. // *the* very first instance and it shall be recorded. This way, when we load
  467. // overrides of the global data, we can revert to the common, original data
  468. // in m_theOriginal
  469. //
  470. if( m_theOriginal == NULL )
  471. m_theOriginal = this;
  472. m_next = NULL;
  473. #if defined(_DEBUG) || defined(_INTERNAL)
  474. m_wireframe = 0;
  475. m_stateMachineDebug = FALSE;
  476. m_useCameraConstraints = TRUE;
  477. m_shroudOn = TRUE;
  478. m_fogOfWarOn = FALSE;
  479. m_jabberOn = FALSE;
  480. m_munkeeOn = FALSE;
  481. m_showCollisionExtents = FALSE;
  482. m_debugCamera = FALSE;
  483. m_specialPowerUsesDelay = TRUE;
  484. m_debugVisibility = FALSE;
  485. m_debugVisibilityTileCount = 32; // default to 32.
  486. m_debugVisibilityTileDuration = LOGICFRAMES_PER_SECOND;
  487. m_debugProjectilePath = FALSE;
  488. m_debugProjectileTileWidth = 10;
  489. m_debugProjectileTileDuration = LOGICFRAMES_PER_SECOND; // Changed By Sadullah Nader
  490. m_debugThreatMap = FALSE;
  491. m_maxDebugThreat = 5000;
  492. m_debugThreatMapTileDuration = LOGICFRAMES_PER_SECOND; // Changed By Sadullah Nader
  493. m_debugCashValueMap = FALSE;
  494. m_maxDebugValue = 10000;
  495. m_debugCashValueMapTileDuration = LOGICFRAMES_PER_SECOND; // Changed By Sadullah Nader
  496. m_debugIgnoreAsserts = FALSE;
  497. m_debugIgnoreStackTrace = FALSE;
  498. m_vTune = false;
  499. m_checkForLeaks = TRUE;
  500. m_benchmarkTimer = -1;
  501. m_allowUnselectableSelection = FALSE;
  502. m_disableCameraFade = false;
  503. m_disableScriptedInputDisabling = false;
  504. m_disableMilitaryCaption = false;
  505. m_latencyAverage = 0;
  506. m_latencyAmplitude = 0;
  507. m_latencyPeriod = 0;
  508. m_latencyNoise = 0;
  509. m_packetLoss = 0;
  510. m_saveStats = FALSE;
  511. m_saveAllStats = FALSE;
  512. m_useLocalMOTD = FALSE;
  513. m_baseStatsDir = ".\\";
  514. m_MOTDPath = "MOTD.txt";
  515. #endif
  516. m_playStats = -1;
  517. m_incrementalAGPBuf = FALSE;
  518. m_mapName.clear();
  519. m_moveHintName.clear();
  520. m_useTrees = 0;
  521. m_useTreeSway = TRUE;
  522. m_useDrawModuleLOD = FALSE;
  523. m_useFpsLimit = FALSE;
  524. m_dumpAssetUsage = FALSE;
  525. m_framesPerSecondLimit = 0;
  526. m_chipSetType = 0;
  527. m_windowed = 0;
  528. m_xResolution = 800;
  529. m_yResolution = 600;
  530. m_maxShellScreens = 0;
  531. m_useCloudMap = FALSE;
  532. m_use3WayTerrainBlends = 1;
  533. m_useLightMap = FALSE;
  534. m_bilinearTerrainTex = FALSE;
  535. m_trilinearTerrainTex = FALSE;
  536. m_multiPassTerrain = FALSE;
  537. m_adjustCliffTextures = FALSE;
  538. m_stretchTerrain = FALSE;
  539. m_useHalfHeightMap = FALSE;
  540. m_terrainLOD = TERRAIN_LOD_AUTOMATIC;
  541. m_terrainLODTargetTimeMS = 0;
  542. m_enableDynamicLOD = TRUE;
  543. m_enableStaticLOD = TRUE;
  544. m_rightMouseAlwaysScrolls = FALSE;
  545. m_useWaterPlane = FALSE;
  546. m_useCloudPlane = FALSE;
  547. m_downwindAngle = ( -0.785f );//Northeast!
  548. m_useShadowVolumes = FALSE;
  549. m_useShadowDecals = FALSE;
  550. m_textureReductionFactor = -1;
  551. m_enableBehindBuildingMarkers = TRUE;
  552. m_scriptDebug = FALSE;
  553. m_particleEdit = FALSE;
  554. m_displayDebug = FALSE;
  555. m_winCursors = TRUE;
  556. m_constantDebugUpdate = FALSE;
  557. m_showTeamDot = FALSE;
  558. m_fixedSeed = -1; // disabled
  559. m_horizontalScrollSpeedFactor = 1.0;
  560. m_verticalScrollSpeedFactor = 1.0;
  561. m_waterPositionX = 0.0f;
  562. m_waterPositionY = 0.0f;
  563. m_waterPositionZ = 0.0f;
  564. m_waterExtentX = 0.0f;
  565. m_waterExtentY = 0.0f;
  566. m_waterType = 0;
  567. m_featherWater = FALSE;
  568. m_showSoftWaterEdge = TRUE; //display soft water edge
  569. m_usingWaterTrackEditor = FALSE;
  570. m_showMetrics = false;
  571. for( i = 0; i < MAX_WATER_GRID_SETTINGS; i++ )
  572. {
  573. m_vertexWaterHeightClampLow[ i ] = 0.0f;
  574. m_vertexWaterHeightClampHi[ i ] = 0.0f;
  575. m_vertexWaterAngle[ i ] = 0.0f;
  576. m_vertexWaterXPosition[ i ] = 0.0f;
  577. m_vertexWaterYPosition[ i ] = 0.0f;
  578. m_vertexWaterZPosition[ i ] = 0.0f;
  579. m_vertexWaterXGridCells[ i ] = 0;
  580. m_vertexWaterYGridCells[ i ] = 0;
  581. m_vertexWaterGridSize[ i ] = 0.0f;
  582. m_vertexWaterAttenuationA[ i ] = 0.0f;
  583. m_vertexWaterAttenuationB[ i ] = 0.0f;
  584. m_vertexWaterAttenuationC[ i ] = 0.0f;
  585. m_vertexWaterAttenuationRange[ i ] = 0.0f;
  586. //Added By Sadullah Nader
  587. //Initializations missing and needed
  588. m_vertexWaterAvailableMaps[i].clear();
  589. } // end for i
  590. m_skyBoxPositionZ = 0.0f;
  591. m_drawSkyBox = FALSE;
  592. m_skyBoxScale = 4.5f;
  593. m_historicDamageLimit = 0;
  594. m_maxTerrainTracks = 0;
  595. m_levelGainAnimationDisplayTimeInSeconds = 0.0f;
  596. m_levelGainAnimationZRisePerSecond = 0.0f;
  597. m_getHealedAnimationDisplayTimeInSeconds = 0.0f;
  598. m_getHealedAnimationZRisePerSecond = 0.0f;
  599. m_maxTankTrackEdges=100;
  600. m_maxTankTrackOpaqueEdges=25;
  601. m_maxTankTrackFadeDelay=300000;
  602. m_timeOfDay = TIME_OF_DAY_AFTERNOON;
  603. m_weather = WEATHER_NORMAL;
  604. m_makeTrackMarks = FALSE;
  605. m_hideGarrisonFlags = FALSE;
  606. m_forceModelsToFollowTimeOfDay = true;
  607. m_forceModelsToFollowWeather = true;
  608. m_partitionCellSize = 0.0f;
  609. m_ammoPipScaleFactor = 1.0f;
  610. m_containerPipScaleFactor = 1.0f;
  611. m_ammoPipWorldOffset.zero();
  612. m_containerPipWorldOffset.zero();
  613. m_ammoPipScreenOffset.x = m_ammoPipScreenOffset.y = 0;
  614. m_containerPipScreenOffset.x = m_containerPipScreenOffset.y = 0;
  615. for (i=0; i<MAX_GLOBAL_LIGHTS; i++)
  616. {
  617. m_terrainAmbient[i].red = 0.0f;
  618. m_terrainAmbient[i].green = 0.0f;
  619. m_terrainAmbient[i].blue = 0.0f;
  620. m_terrainDiffuse[i].red = 0.0f;
  621. m_terrainDiffuse[i].green = 0.0f;
  622. m_terrainDiffuse[i].blue = 0.0f;
  623. m_terrainLightPos[i].x = 0.0f;
  624. m_terrainLightPos[i].y = 0.0f;
  625. m_terrainLightPos[i].z = -1.0f;
  626. for (j=0; j<TIME_OF_DAY_COUNT; j++)
  627. { m_terrainLighting[ j ][i].ambient.red=0;
  628. m_terrainLighting[ j ][i].ambient.green=0;
  629. m_terrainLighting[ j ][i].ambient.blue=0;
  630. m_terrainLighting[ j ][i].diffuse.red=0;
  631. m_terrainLighting[ j ][i].diffuse.green=0;
  632. m_terrainLighting[ j ][i].diffuse.blue=0;
  633. m_terrainLighting[ j ][i].lightPos.x=0;
  634. m_terrainLighting[ j ][i].lightPos.y=0;
  635. m_terrainLighting[ j ][i].lightPos.z=-1.0f;
  636. m_terrainObjectsLighting[ j ][i].ambient.red=0;
  637. m_terrainObjectsLighting[ j ][i].ambient.green=0;
  638. m_terrainObjectsLighting[ j ][i].ambient.blue=0;
  639. m_terrainObjectsLighting[ j ][i].diffuse.red=0;
  640. m_terrainObjectsLighting[ j ][i].diffuse.green=0;
  641. m_terrainObjectsLighting[ j ][i].diffuse.blue=0;
  642. m_terrainObjectsLighting[ j ][i].lightPos.x=0;
  643. m_terrainObjectsLighting[ j ][i].lightPos.y=0;
  644. m_terrainObjectsLighting[ j ][i].lightPos.z=-1.0f;
  645. }
  646. }
  647. for (j=TIME_OF_DAY_FIRST; j<TIME_OF_DAY_COUNT; j++)
  648. m_infantryLightScale[j] = 1.5f;
  649. m_scriptOverrideInfantryLightScale = -1.0f;
  650. m_numGlobalLights = 3;
  651. m_maxRoadSegments = 0;
  652. m_maxRoadVertex = 0;
  653. m_maxRoadIndex = 0;
  654. m_maxRoadTypes = 0;
  655. m_baseValuePerSupplyBox = 100;
  656. m_audioOn = TRUE;
  657. m_musicOn = TRUE;
  658. m_soundsOn = TRUE;
  659. m_sounds3DOn = TRUE;
  660. m_speechOn = TRUE;
  661. m_videoOn = TRUE;
  662. m_disableCameraMovement = FALSE;
  663. m_maxVisibleTranslucentObjects = 512;
  664. m_maxVisibleOccluderObjects = 512;
  665. m_maxVisibleOccludeeObjects = 512;
  666. m_maxVisibleNonOccluderOrOccludeeObjects = 512;
  667. m_occludedLuminanceScale = 0.5f;
  668. m_useFX = TRUE;
  669. // m_inGame = FALSE;
  670. m_noDraw = 0;
  671. m_particleScale = 1.0f;
  672. m_autoFireParticleSmallMax = 0;
  673. m_autoFireParticleMediumMax = 0;
  674. m_autoFireParticleLargeMax = 0;
  675. m_autoSmokeParticleSmallMax = 0;
  676. m_autoSmokeParticleMediumMax = 0;
  677. m_autoSmokeParticleLargeMax = 0;
  678. m_autoAflameParticleMax = 0;
  679. // Added By Sadullah Nader
  680. // Initializations missing and needed
  681. m_autoFireParticleSmallPrefix.clear();
  682. m_autoFireParticleMediumPrefix.clear();
  683. m_autoFireParticleLargePrefix.clear();
  684. m_autoSmokeParticleSmallPrefix.clear();
  685. m_autoSmokeParticleMediumPrefix.clear();
  686. m_autoSmokeParticleLargePrefix.clear();
  687. m_autoAflameParticlePrefix.clear();
  688. m_autoFireParticleSmallSystem.clear();
  689. m_autoFireParticleMediumSystem.clear();
  690. m_autoFireParticleLargeSystem.clear();
  691. m_autoSmokeParticleSmallSystem.clear();
  692. m_autoSmokeParticleMediumSystem.clear();
  693. m_autoSmokeParticleLargeSystem.clear();
  694. m_autoAflameParticleSystem.clear();
  695. m_levelGainAnimationName.clear();
  696. m_getHealedAnimationName.clear();
  697. m_specialPowerViewObjectName.clear();
  698. m_drawEntireTerrain = FALSE;
  699. m_maxParticleCount = 0;
  700. m_maxFieldParticleCount = 30;
  701. // End Add
  702. m_debugAI = AI_DEBUG_NONE;
  703. m_debugAIObstacles = FALSE;
  704. m_showClientPhysics = TRUE;
  705. m_showTerrainNormals = FALSE;
  706. m_showObjectHealth = FALSE;
  707. m_particleEdit = FALSE;
  708. m_cameraPitch = 0.0f;
  709. m_cameraYaw = 0.0f;
  710. m_cameraHeight = 0.0f;
  711. m_minCameraHeight = 100.0f;
  712. m_maxCameraHeight = 300.0f;
  713. m_terrainHeightAtEdgeOfMap = 0.0f;
  714. m_unitDamagedThresh = 0.5f;
  715. m_unitReallyDamagedThresh = 0.1f;
  716. m_groundStiffness = 0.5f;
  717. m_structureStiffness = 0.5f;
  718. m_gravity = -1.0f;
  719. m_stealthFriendlyOpacity = 0.5f;
  720. m_defaultOcclusionDelay = LOGICFRAMES_PER_SECOND * 3; //default to 3 seconds
  721. m_preloadAssets = FALSE;
  722. m_preloadEverything = FALSE;
  723. m_preloadReport = FALSE;
  724. m_netMinPlayers = 1; // allowing sandbox mode
  725. m_defaultIP = 0;
  726. m_BuildSpeed = 0.0f;
  727. m_MinDistFromEdgeOfMapForBuild = 0.0f;
  728. m_SupplyBuildBorder = 0.0f;
  729. m_allowedHeightVariationForBuilding = 0.0f;
  730. m_MinLowEnergyProductionSpeed = 0.0f;
  731. m_MaxLowEnergyProductionSpeed = 0.0f;
  732. m_LowEnergyPenaltyModifier = 0.0f;
  733. m_MultipleFactory = 0.0f;
  734. m_RefundPercent = 0.0f;
  735. m_commandCenterHealRange = 0.0f;
  736. m_commandCenterHealAmount = 0.0f;
  737. m_maxTunnelCapacity = 0;
  738. m_maxLineBuildObjects = 0;
  739. m_standardMinefieldDensity = 0.01f;
  740. m_standardMinefieldDistance = 40.0f;
  741. m_groupSelectMinSelectSize = 5;
  742. m_groupSelectVolumeBase = 0.5f;
  743. m_groupSelectVolumeIncrement = 0.02f;
  744. m_maxUnitSelectSounds = 8;
  745. m_selectionFlashSaturationFactor = 0.5f; /// how colorful should the selection flash be? 0-4
  746. m_selectionFlashHouseColor = FALSE; /// skip the house color and just use white.
  747. m_cameraAudibleRadius = 500.0;
  748. m_groupMoveClickToGatherFactor = 1.0f;
  749. m_shakeSubtleIntensity = 0.5f;
  750. m_shakeNormalIntensity = 1.0f;
  751. m_shakeStrongIntensity = 2.5f;
  752. m_shakeSevereIntensity = 5.0f;
  753. m_shakeCineExtremeIntensity = 8.0f;
  754. m_shakeCineInsaneIntensity = 12.0f;
  755. m_maxShakeIntensity = 10.0f;
  756. m_maxShakeRange = 150.f;
  757. m_sellPercentage = 1.0f;
  758. m_baseRegenHealthPercentPerSecond = 0.0f;
  759. m_baseRegenDelay = 0;
  760. #ifdef ALLOW_SURRENDER
  761. m_prisonBountyMultiplier = 1.0f;
  762. m_prisonBountyTextColor = GameMakeColor( 255, 255, 255, 255 );
  763. #endif
  764. m_hotKeyTextColor = GameMakeColor(255,255,0,255);
  765. m_shroudColor.setFromInt( 0x00FFFFFF ) ;
  766. m_clearAlpha = 255;
  767. m_fogAlpha = 127;
  768. m_shroudAlpha = 0;
  769. m_powerBarBase = 7;
  770. m_powerBarIntervals = 3;
  771. m_powerBarYellowRange = 5;
  772. m_displayGamma = 1.0f; //ramp that does nothing
  773. m_standardPublicBones.clear();
  774. m_antiAliasBoxValue = 0;
  775. // m_languageFilterPref = false;
  776. m_languageFilterPref = true;
  777. m_firewallBehavior = FirewallHelperClass::FIREWALL_TYPE_UNKNOWN;
  778. m_firewallSendDelay = FALSE;
  779. m_firewallPortOverride = 0;
  780. m_firewallPortAllocationDelta = 0;
  781. m_loadScreenDemo = FALSE;
  782. m_disableRender = false;
  783. m_saveCameraInReplay = FALSE;
  784. m_useCameraInReplay = FALSE;
  785. m_debugShowGraphicalFramerate = FALSE;
  786. // By default, show all asserts.
  787. m_unlookPersistDuration = 30;
  788. //-----------------------------------------------------------------------------------------------
  789. // network timing values. Having these default to 0 would be bad. - BGC
  790. m_networkFPSHistoryLength = 30;
  791. m_networkLatencyHistoryLength = 200;
  792. m_networkRunAheadMetricsTime = 500;
  793. m_networkCushionHistoryLength = 10;
  794. m_networkRunAheadSlack = 10;
  795. m_networkKeepAliveDelay = 20;
  796. m_networkDisconnectTime = 5000;
  797. m_networkPlayerTimeoutTime = 60000;
  798. m_networkDisconnectScreenNotifyTime = 15000;
  799. m_isBreakableMovie = FALSE;
  800. m_breakTheMovie = FALSE;
  801. setTimeOfDay( m_timeOfDay );
  802. m_buildMapCache = FALSE;
  803. m_initialFile.clear();
  804. m_pendingFile.clear();
  805. for (i = LEVEL_FIRST; i <= LEVEL_LAST; ++i)
  806. m_healthBonus[i] = 1.0f;
  807. for (i = 0; i < PLAYERTYPE_COUNT; ++i)
  808. {
  809. for (j = 0; j < DIFFICULTY_COUNT; ++j)
  810. {
  811. m_soloPlayerHealthBonusForDifficulty[i][j] = 1.0f;
  812. }
  813. }
  814. m_defaultStructureRubbleHeight = 1.0f;
  815. m_weaponBonusSet = newInstance(WeaponBonusSet);
  816. m_shellMapName.set("Maps\\ShellMap1\\ShellMap1.map");
  817. m_shellMapOn =TRUE;
  818. m_playIntro = TRUE;
  819. m_afterIntro = FALSE;
  820. m_allowExitOutOfMovies = FALSE;
  821. m_loadScreenRender = FALSE;
  822. m_musicVolumeFactor = 0.5f;
  823. m_SFXVolumeFactor = 0.5f;
  824. m_voiceVolumeFactor = 0.5f;
  825. m_3DSoundPref = false;
  826. m_keyboardDefaultScrollFactor = m_keyboardScrollFactor = 0.5f;
  827. m_scrollAmountCutoff = 10.0f;
  828. m_cameraAdjustSpeed = 0.1f;
  829. m_enforceMaxCameraHeight = TRUE;
  830. m_animateWindows = TRUE;
  831. m_iniCRC = 0;
  832. m_exeCRC = 0;
  833. // lets CRC the executable! Whee!
  834. const Int blockSize = 65536;
  835. Char buffer[ _MAX_PATH ];
  836. CRC exeCRC;
  837. GetModuleFileName( NULL, buffer, sizeof( buffer ) );
  838. File *fp = TheFileSystem->openFile(buffer, File::READ | File::BINARY);
  839. if (fp != NULL) {
  840. unsigned char crcBlock[blockSize];
  841. Int amtRead = 0;
  842. while ( (amtRead=fp->read(crcBlock, blockSize)) > 0 )
  843. {
  844. exeCRC.computeCRC(crcBlock, amtRead);
  845. }
  846. fp->close();
  847. fp = NULL;
  848. }
  849. if (TheVersion)
  850. {
  851. UnsignedInt version = TheVersion->getVersionNumber();
  852. exeCRC.computeCRC( &version, sizeof(UnsignedInt) );
  853. }
  854. // Add in MP scripts to the EXE CRC, since the game will go out of sync if they change
  855. fp = TheFileSystem->openFile("Data\\Scripts\\SkirmishScripts.scb", File::READ | File::BINARY);
  856. if (fp != NULL) {
  857. unsigned char crcBlock[blockSize];
  858. Int amtRead = 0;
  859. while ( (amtRead=fp->read(crcBlock, blockSize)) > 0 )
  860. {
  861. exeCRC.computeCRC(crcBlock, amtRead);
  862. }
  863. fp->close();
  864. fp = NULL;
  865. }
  866. fp = TheFileSystem->openFile("Data\\Scripts\\MultiplayerScripts.scb", File::READ | File::BINARY);
  867. if (fp != NULL) {
  868. unsigned char crcBlock[blockSize];
  869. Int amtRead = 0;
  870. while ( (amtRead=fp->read(crcBlock, blockSize)) > 0 )
  871. {
  872. exeCRC.computeCRC(crcBlock, amtRead);
  873. }
  874. fp->close();
  875. fp = NULL;
  876. }
  877. m_exeCRC = exeCRC.get();
  878. DEBUG_LOG(("EXE CRC: 0x%8.8X\n", m_exeCRC));
  879. m_movementPenaltyDamageState = BODY_REALLYDAMAGED;
  880. m_shouldUpdateTGAToDDS = FALSE;
  881. // Default DoubleClickTime to System double click time.
  882. m_doubleClickTimeMS = GetDoubleClickTime(); // Note: This is actual MS, not frames.
  883. #ifdef DUMP_PERF_STATS
  884. m_dumpPerformanceStatistics = FALSE;
  885. #endif
  886. m_forceBenchmark = FALSE; ///<forces running of CPU detection benchmark, even on known cpu's.
  887. m_keyboardCameraRotateSpeed = 0.1f;
  888. } // end GlobalData
  889. //-------------------------------------------------------------------------------------------------
  890. AsciiString GlobalData::getPath_UserData() const
  891. {
  892. return m_userDataDir;
  893. }
  894. //-------------------------------------------------------------------------------------------------
  895. //-------------------------------------------------------------------------------------------------
  896. GlobalData::~GlobalData( void )
  897. {
  898. DEBUG_ASSERTCRASH( TheWritableGlobalData->m_next == NULL, ("~GlobalData: theOriginal is not original\n") );
  899. if (m_weaponBonusSet)
  900. m_weaponBonusSet->deleteInstance();
  901. if( m_theOriginal == this )
  902. m_theOriginal = NULL;
  903. } // end ~GlobalData
  904. //-------------------------------------------------------------------------------------------------
  905. //-------------------------------------------------------------------------------------------------
  906. Bool GlobalData::setTimeOfDay( TimeOfDay tod )
  907. {
  908. if( tod >= TIME_OF_DAY_COUNT || tod < TIME_OF_DAY_FIRST )
  909. {
  910. return FALSE;
  911. }
  912. m_timeOfDay = tod;
  913. for (Int i=0; i<MAX_GLOBAL_LIGHTS; i++)
  914. { m_terrainAmbient[i] = m_terrainLighting[ tod ][i].ambient;
  915. m_terrainDiffuse[i] = m_terrainLighting[ tod ][i].diffuse;
  916. m_terrainLightPos[i] = m_terrainLighting[ tod ][i].lightPos;
  917. }
  918. return TRUE;
  919. }
  920. //-------------------------------------------------------------------------------------------------
  921. /** Create a new global data instance to override the existing data set. The
  922. * initial values of the newly created instance will be a copy of the current
  923. * data (or the most recently created override) */
  924. //-------------------------------------------------------------------------------------------------
  925. GlobalData *GlobalData::newOverride( void )
  926. {
  927. GlobalData *override = NEW GlobalData;
  928. // copy the data from the latest override (TheWritableGlobalData) to the newly created instance
  929. DEBUG_ASSERTCRASH( TheWritableGlobalData, ("GlobalData::newOverride() - no existing data\n") );
  930. *override = *TheWritableGlobalData;
  931. //
  932. // link the override to the previously created one, the link order is important here
  933. // for the reset function, if you change the way things are linked
  934. // for overrides make sure you update the reset function
  935. //
  936. override->m_next = TheWritableGlobalData;
  937. // set this new instance as the 'most current override' where we will access all data from
  938. TheWritableGlobalData = override;
  939. return override;
  940. } // end newOveride
  941. //-------------------------------------------------------------------------------------------------
  942. void GlobalData::init( void )
  943. {
  944. // nothing
  945. }
  946. //-------------------------------------------------------------------------------------------------
  947. /** Reset, remove any override data instances and return to just the initial one
  948. */
  949. //-------------------------------------------------------------------------------------------------
  950. void GlobalData::reset( void )
  951. {
  952. DEBUG_ASSERTCRASH(this == TheWritableGlobalData, ("calling reset on wrong GlobalData"));
  953. //
  954. // delete any data instances that were loaded as an override and set the original
  955. // global data instance as the singleton TheWritableGlobalData once again
  956. //
  957. while (TheWritableGlobalData != GlobalData::m_theOriginal)
  958. {
  959. // get next instance
  960. GlobalData* next = TheWritableGlobalData->m_next;
  961. // delete the head of the global data list (the latest override)
  962. delete TheWritableGlobalData;
  963. // set next as top
  964. TheWritableGlobalData = next;
  965. } // end while
  966. //
  967. // we now have the one single global data in TheWritableGlobalData singleton, lets sanity check
  968. // some of all that
  969. //
  970. DEBUG_ASSERTCRASH( TheWritableGlobalData->m_next == NULL, ("ResetGlobalData: theOriginal is not original\n") );
  971. DEBUG_ASSERTCRASH( TheWritableGlobalData == GlobalData::m_theOriginal, ("ResetGlobalData: oops\n") );
  972. } // end ResetGlobalData
  973. //-------------------------------------------------------------------------------------------------
  974. /** Parse GameData entry */
  975. //-------------------------------------------------------------------------------------------------
  976. void GlobalData::parseGameDataDefinition( INI* ini )
  977. {
  978. if( TheWritableGlobalData && ini->getLoadType() != INI_LOAD_MULTIFILE)
  979. {
  980. //
  981. // if the type of loading we're doing creates override data, we need to
  982. // be loading into a new override item
  983. //
  984. if( ini->getLoadType() == INI_LOAD_CREATE_OVERRIDES )
  985. TheWritableGlobalData->newOverride();
  986. } // end if
  987. else if (!TheWritableGlobalData)
  988. {
  989. // we don't have any global data instance at all yet, create one
  990. TheWritableGlobalData = NEW GlobalData;
  991. } // end else
  992. // If we're multifile, then continue loading stuff into the Global Data as normal.
  993. // parse the ini weapon definition
  994. ini->initFromINI( TheWritableGlobalData, s_GlobalDataFieldParseTable );
  995. TheWritableGlobalData->m_userDataDir.clear();
  996. char temp[_MAX_PATH];
  997. if (::SHGetSpecialFolderPath(NULL, temp, CSIDL_PERSONAL, true))
  998. {
  999. if (temp[strlen(temp)-1] != '\\')
  1000. strcat(temp, "\\");
  1001. strcat(temp, TheWritableGlobalData->m_userDataLeafName.str());
  1002. strcat(temp, "\\");
  1003. CreateDirectory(temp, NULL);
  1004. TheWritableGlobalData->m_userDataDir = temp;
  1005. }
  1006. // override INI values with user preferences
  1007. OptionPreferences optionPref;
  1008. TheWritableGlobalData->m_useAlternateMouse = optionPref.getAlternateMouseModeEnabled();
  1009. TheWritableGlobalData->m_keyboardScrollFactor = optionPref.getScrollFactor();
  1010. TheWritableGlobalData->m_defaultIP = optionPref.getLANIPAddress();
  1011. TheWritableGlobalData->m_firewallSendDelay = optionPref.getSendDelay();
  1012. TheWritableGlobalData->m_firewallBehavior = optionPref.getFirewallBehavior();
  1013. TheWritableGlobalData->m_firewallPortAllocationDelta = optionPref.getFirewallPortAllocationDelta();
  1014. TheWritableGlobalData->m_firewallPortOverride = optionPref.getFirewallPortOverride();
  1015. TheWritableGlobalData->m_saveCameraInReplay = optionPref.saveCameraInReplays();
  1016. TheWritableGlobalData->m_useCameraInReplay = optionPref.useCameraInReplays();
  1017. Int val=optionPref.getGammaValue();
  1018. //generate a value between 0.6 and 2.0.
  1019. if (val < 50)
  1020. { //darker gamma
  1021. if (val <= 0)
  1022. TheWritableGlobalData->m_displayGamma = 0.6f;
  1023. else
  1024. TheWritableGlobalData->m_displayGamma=1.0f-(0.4f) * (Real)(50-val)/50.0f;
  1025. }
  1026. else
  1027. if (val > 50)
  1028. TheWritableGlobalData->m_displayGamma=1.0f+(1.0f) * (Real)(val-50)/50.0f;
  1029. Int xres,yres;
  1030. optionPref.getResolution(&xres, &yres);
  1031. TheWritableGlobalData->m_xResolution = xres;
  1032. TheWritableGlobalData->m_yResolution = yres;
  1033. }