@@ -78,70 +78,68 @@ struct BlockParse
7878};
7979static const BlockParse theTypeTable[] =
8080{
81- { " AIData" , INI ::parseAIDataDefinition },
82- { " Animation" , INI ::parseAnim2DDefinition },
83- { " Armor" , INI ::parseArmorDefinition },
84- { " AudioEvent" , INI ::parseAudioEventDefinition },
85- { " AudioSettings" , INI ::parseAudioSettingsDefinition },
86- { " Bridge" , INI ::parseTerrainBridgeDefinition },
87- { " Campaign" , INI ::parseCampaignDefinition },
88- { " ChallengeGenerals" , INI ::parseChallengeModeDefinition },
89- { " CommandButton" , INI ::parseCommandButtonDefinition },
90- { " CommandMap" , INI ::parseMetaMapDefinition },
91- { " CommandSet" , INI ::parseCommandSetDefinition },
92- { " ControlBarScheme" , INI ::parseControlBarSchemeDefinition },
93- { " ControlBarResizer" , INI ::parseControlBarResizerDefinition },
94- { " CrateData" , INI ::parseCrateTemplateDefinition },
95- { " Credits" , INI ::parseCredits},
96- { " WindowTransition" , INI ::parseWindowTransitions},
97- { " DamageFX" , INI ::parseDamageFXDefinition },
98- { " DialogEvent" , INI ::parseDialogDefinition },
99- { " DrawGroupInfo" , INI ::parseDrawGroupNumberDefinition },
100- { " EvaEvent" , INI ::parseEvaEvent },
101- { " FXList" , INI ::parseFXListDefinition },
102- { " GameData" , INI ::parseGameDataDefinition },
103- { " InGameUI" , INI ::parseInGameUIDefinition },
104- { " Locomotor" , INI ::parseLocomotorTemplateDefinition },
105- { " Language" , INI ::parseLanguageDefinition },
106- { " MapCache" , INI ::parseMapCacheDefinition },
107- { " MapData" , INI ::parseMapDataDefinition },
108- { " MappedImage" , INI ::parseMappedImageDefinition },
109- { " MiscAudio" , INI ::parseMiscAudio},
110- { " Mouse" , INI ::parseMouseDefinition },
111- { " MouseCursor" , INI ::parseMouseCursorDefinition },
112- { " MultiplayerColor" , INI ::parseMultiplayerColorDefinition },
113- { " MultiplayerStartingMoneyChoice" , INI ::parseMultiplayerStartingMoneyChoiceDefinition },
114- { " OnlineChatColors" , INI ::parseOnlineChatColorDefinition },
115- { " MultiplayerSettings" ,INI ::parseMultiplayerSettingsDefinition },
116- { " MusicTrack" , INI ::parseMusicTrackDefinition },
117- { " Object" , INI ::parseObjectDefinition },
118- { " ObjectCreationList" , INI ::parseObjectCreationListDefinition },
119- { " ObjectReskin" , INI ::parseObjectReskinDefinition },
120- { " ParticleSystem" , INI ::parseParticleSystemDefinition },
121- { " PlayerTemplate" , INI ::parsePlayerTemplateDefinition },
122- { " Road" , INI ::parseTerrainRoadDefinition },
123- { " Science" , INI ::parseScienceDefinition },
124- { " Rank" , INI ::parseRankDefinition },
125- { " SpecialPower" , INI ::parseSpecialPowerDefinition },
126- { " ShellMenuScheme" , INI ::parseShellMenuSchemeDefinition },
127- { " Terrain" , INI ::parseTerrainDefinition },
128- { " Upgrade" , INI ::parseUpgradeDefinition },
129- { " Video" , INI ::parseVideoDefinition },
130- { " WaterSet" , INI ::parseWaterSettingDefinition },
131- { " WaterTransparency" , INI ::parseWaterTransparencyDefinition},
132- { " Weather" , INI ::parseWeatherDefinition},
133- { " Weapon" , INI ::parseWeaponTemplateDefinition },
134- { " WebpageURL" , INI ::parseWebpageURLDefinition },
135- { " HeaderTemplate" , INI ::parseHeaderTemplateDefinition },
136- { " StaticGameLOD" , INI ::parseStaticGameLODDefinition },
137- { " DynamicGameLOD" , INI ::parseDynamicGameLODDefinition },
138- { " LODPreset" , INI ::parseLODPreset },
139- { " BenchProfile" , INI ::parseBenchProfile },
140- { " ReallyLowMHz" , parseReallyLowMHz },
141- { " ScriptAction" , ScriptEngine::parseScriptAction },
142- { " ScriptCondition" , ScriptEngine::parseScriptCondition },
143-
144- { nullptr , nullptr },
81+ { " AIData" , INI ::parseAIDataDefinition },
82+ { " Animation" , INI ::parseAnim2DDefinition },
83+ { " Armor" , INI ::parseArmorDefinition },
84+ { " AudioEvent" , INI ::parseAudioEventDefinition },
85+ { " AudioSettings" , INI ::parseAudioSettingsDefinition },
86+ { " BenchProfile" , INI ::parseBenchProfile },
87+ { " Bridge" , INI ::parseTerrainBridgeDefinition },
88+ { " Campaign" , INI ::parseCampaignDefinition },
89+ { " ChallengeGenerals" , INI ::parseChallengeModeDefinition },
90+ { " CommandButton" , INI ::parseCommandButtonDefinition },
91+ { " CommandMap" , INI ::parseMetaMapDefinition },
92+ { " CommandSet" , INI ::parseCommandSetDefinition },
93+ { " ControlBarResizer" , INI ::parseControlBarResizerDefinition },
94+ { " ControlBarScheme" , INI ::parseControlBarSchemeDefinition },
95+ { " CrateData" , INI ::parseCrateTemplateDefinition },
96+ { " Credits" , INI ::parseCredits },
97+ { " DamageFX" , INI ::parseDamageFXDefinition },
98+ { " DialogEvent" , INI ::parseDialogDefinition },
99+ { " DrawGroupInfo" , INI ::parseDrawGroupNumberDefinition },
100+ { " DynamicGameLOD" , INI ::parseDynamicGameLODDefinition },
101+ { " EvaEvent" , INI ::parseEvaEvent },
102+ { " FXList" , INI ::parseFXListDefinition },
103+ { " GameData" , INI ::parseGameDataDefinition },
104+ { " HeaderTemplate" , INI ::parseHeaderTemplateDefinition },
105+ { " InGameUI" , INI ::parseInGameUIDefinition },
106+ { " LODPreset" , INI ::parseLODPreset },
107+ { " Language" , INI ::parseLanguageDefinition },
108+ { " Locomotor" , INI ::parseLocomotorTemplateDefinition },
109+ { " MapCache" , INI ::parseMapCacheDefinition },
110+ { " MapData" , INI ::parseMapDataDefinition },
111+ { " MappedImage" , INI ::parseMappedImageDefinition },
112+ { " MiscAudio" , INI ::parseMiscAudio },
113+ { " Mouse" , INI ::parseMouseDefinition },
114+ { " MouseCursor" , INI ::parseMouseCursorDefinition },
115+ { " MultiplayerColor" , INI ::parseMultiplayerColorDefinition },
116+ { " MultiplayerSettings" , INI ::parseMultiplayerSettingsDefinition },
117+ { " MultiplayerStartingMoneyChoice" , INI ::parseMultiplayerStartingMoneyChoiceDefinition },
118+ { " MusicTrack" , INI ::parseMusicTrackDefinition },
119+ { " Object" , INI ::parseObjectDefinition },
120+ { " ObjectCreationList" , INI ::parseObjectCreationListDefinition },
121+ { " ObjectReskin" , INI ::parseObjectReskinDefinition },
122+ { " OnlineChatColors" , INI ::parseOnlineChatColorDefinition },
123+ { " ParticleSystem" , INI ::parseParticleSystemDefinition },
124+ { " PlayerTemplate" , INI ::parsePlayerTemplateDefinition },
125+ { " Rank" , INI ::parseRankDefinition },
126+ { " ReallyLowMHz" , parseReallyLowMHz },
127+ { " Road" , INI ::parseTerrainRoadDefinition },
128+ { " Science" , INI ::parseScienceDefinition },
129+ { " ScriptAction" , ScriptEngine::parseScriptAction },
130+ { " ScriptCondition" , ScriptEngine::parseScriptCondition },
131+ { " ShellMenuScheme" , INI ::parseShellMenuSchemeDefinition },
132+ { " SpecialPower" , INI ::parseSpecialPowerDefinition },
133+ { " StaticGameLOD" , INI ::parseStaticGameLODDefinition },
134+ { " Terrain" , INI ::parseTerrainDefinition },
135+ { " Upgrade" , INI ::parseUpgradeDefinition },
136+ { " Video" , INI ::parseVideoDefinition },
137+ { " WaterSet" , INI ::parseWaterSettingDefinition },
138+ { " WaterTransparency" , INI ::parseWaterTransparencyDefinition },
139+ { " Weapon" , INI ::parseWeaponTemplateDefinition },
140+ { " Weather" , INI ::parseWeatherDefinition },
141+ { " WebpageURL" , INI ::parseWebpageURLDefinition },
142+ { " WindowTransition" , INI ::parseWindowTransitions },
145143};
146144
147145
@@ -350,13 +348,14 @@ void INI::unPrepFile()
350348// -------------------------------------------------------------------------------------------------
351349static INIBlockParse findBlockParse (const char * token)
352350{
353- for (const BlockParse* parse = theTypeTable; parse-> token ; ++parse )
351+ for (size_t i = 0 ; i < ARRAY_SIZE (theTypeTable) ; ++i )
354352 {
355- if (strcmp ( parse-> token , token ) == 0 )
353+ if (strcmp (theTypeTable[i]. token , token) == 0 )
356354 {
357- return parse-> parse ;
355+ return theTypeTable[i]. parse ;
358356 }
359357 }
358+
360359 return nullptr ;
361360}
362361
0 commit comments