This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)
Revisión | 3595708f1b65533026852ea9994bd7ea753920f8 (tree) |
---|---|
Tiempo | 2022-10-06 11:52:09 |
Autor | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Did some cosmetic cleanup of functions that parse the GAMEMODE lump.
@@ -2902,7 +2902,7 @@ | ||
2902 | 2902 | CAMPAIGN_ParseCampaignInfo( ); |
2903 | 2903 | |
2904 | 2904 | // [BB] Parse the GAMEMODE lump. |
2905 | - GAMEMODE_ParseGamemodeInfo( ); | |
2905 | + GAMEMODE_ParseGameModeInfo( ); | |
2906 | 2906 | |
2907 | 2907 | // [RH] Initialize localizable strings. |
2908 | 2908 | GStrings.LoadStrings (false); |
@@ -121,54 +121,55 @@ | ||
121 | 121 | |
122 | 122 | //***************************************************************************** |
123 | 123 | // |
124 | -void GAMEMODE_ParseGameModeBlock ( FScanner &sc, const GAMEMODE_e GameMode ) | |
124 | +void GAMEMODE_ParseGameModeBlock( FScanner &sc, const GAMEMODE_e GameMode ) | |
125 | 125 | { |
126 | - sc.MustGetStringName("{"); | |
127 | - while (!sc.CheckString("}")) | |
126 | + sc.MustGetStringName( "{" ); | |
127 | + | |
128 | + while ( !sc.CheckString( "}" )) | |
128 | 129 | { |
129 | - sc.MustGetString(); | |
130 | + sc.MustGetString( ); | |
130 | 131 | |
131 | - if (0 == stricmp (sc.String, "removeflag")) | |
132 | + if ( stricmp( sc.String, "removeflag" ) == 0 ) | |
132 | 133 | { |
133 | 134 | g_GameModes[GameMode].ulFlags &= ~sc.MustGetEnumName( "flag", "GMF_", GetValueGMF ); |
134 | 135 | } |
135 | - else if (0 == stricmp (sc.String, "addflag")) | |
136 | + else if ( stricmp( sc.String, "addflag" ) == 0 ) | |
136 | 137 | { |
137 | 138 | g_GameModes[GameMode].ulFlags |= sc.MustGetEnumName( "flag", "GMF_", GetValueGMF ); |
138 | 139 | } |
139 | - else if (0 == stricmp (sc.String, "name")) | |
140 | + else if ( stricmp( sc.String, "name" ) == 0 ) | |
140 | 141 | { |
141 | - sc.MustGetString(); | |
142 | + sc.MustGetString( ); | |
142 | 143 | g_GameModes[GameMode].Name = sc.String; |
143 | 144 | } |
144 | - else if (0 == stricmp (sc.String, "shortname")) | |
145 | + else if ( stricmp( sc.String, "shortname" ) == 0 ) | |
145 | 146 | { |
146 | - sc.MustGetString(); | |
147 | + sc.MustGetString( ); | |
147 | 148 | g_GameModes[GameMode].ShortName = sc.String; |
148 | 149 | |
149 | 150 | // [AK] Limit the short name to only 8 characters. |
150 | 151 | g_GameModes[GameMode].ShortName.Truncate( 8 ); |
151 | 152 | } |
152 | - else if (0 == stricmp (sc.String, "f1texture")) | |
153 | + else if ( stricmp( sc.String, "f1texture" ) == 0 ) | |
153 | 154 | { |
154 | - sc.MustGetString(); | |
155 | + sc.MustGetString( ); | |
155 | 156 | g_GameModes[GameMode].F1Texture = sc.String; |
156 | 157 | |
157 | 158 | // [AK] The F1 texture cannot exceed more than 8 characters. |
158 | 159 | g_GameModes[GameMode].F1Texture.Truncate( 8 ); |
159 | 160 | } |
160 | - else if (0 == stricmp (sc.String, "welcomesound")) | |
161 | + else if ( stricmp( sc.String, "welcomesound" ) == 0 ) | |
161 | 162 | { |
162 | - sc.MustGetString(); | |
163 | + sc.MustGetString( ); | |
163 | 164 | g_GameModes[GameMode].WelcomeSound = sc.String; |
164 | 165 | } |
165 | - else if ((0 == stricmp (sc.String, "gamesettings")) || (0 == stricmp (sc.String, "lockedgamesettings"))) | |
166 | + else if (( stricmp( sc.String, "gamesettings" ) == 0 ) || ( stricmp( sc.String, "lockedgamesettings" ) == 0 )) | |
166 | 167 | { |
167 | 168 | GAMEMODE_ParseGameSettingBlock( sc, GameMode, !stricmp( sc.String, "lockedgamesettings" )); |
168 | 169 | } |
169 | - else if (0 == stricmp (sc.String, "removegamesetting")) | |
170 | + else if ( stricmp( sc.String, "removegamesetting" ) == 0 ) | |
170 | 171 | { |
171 | - sc.MustGetString(); | |
172 | + sc.MustGetString( ); | |
172 | 173 | FBaseCVar *pCVar = FindCVar( sc.String, NULL ); |
173 | 174 | |
174 | 175 | // [AK] Make sure that this CVar exists. |
@@ -185,13 +186,15 @@ | ||
185 | 186 | } |
186 | 187 | } |
187 | 188 | else |
188 | - sc.ScriptError ( "Unknown option '%s', on line %d in GAMEMODE.", sc.String, sc.Line ); | |
189 | + { | |
190 | + sc.ScriptError( "Unknown option '%s', on line %d in GAMEMODE.", sc.String, sc.Line ); | |
191 | + } | |
189 | 192 | } |
190 | 193 | } |
191 | 194 | |
192 | 195 | //***************************************************************************** |
193 | 196 | // |
194 | -void GAMEMODE_ParseGameSettingBlock ( FScanner &sc, const GAMEMODE_e GameMode, bool bLockCVars, bool bResetCVars ) | |
197 | +void GAMEMODE_ParseGameSettingBlock( FScanner &sc, const GAMEMODE_e GameMode, bool bLockCVars, bool bResetCVars ) | |
195 | 198 | { |
196 | 199 | sc.MustGetStringName( "{" ); |
197 | 200 |
@@ -304,40 +307,40 @@ | ||
304 | 307 | |
305 | 308 | //***************************************************************************** |
306 | 309 | // |
307 | -void GAMEMODE_ParseGamemodeInfo( void ) | |
310 | +void GAMEMODE_ParseGameModeInfo( void ) | |
308 | 311 | { |
309 | 312 | int lastlump = 0, lump; |
310 | 313 | |
311 | - while ((lump = Wads.FindLump ("GAMEMODE", &lastlump)) != -1) | |
314 | + while (( lump = Wads.FindLump( "GAMEMODE", &lastlump )) != -1 ) | |
312 | 315 | { |
313 | - FScanner sc(lump); | |
316 | + FScanner sc( lump ); | |
314 | 317 | bool bParsedDefGameSettings = false; |
315 | 318 | bool bParsedDefLockedSettings = false; |
316 | 319 | |
317 | - while (sc.GetString ()) | |
320 | + while ( sc.GetString( )) | |
318 | 321 | { |
319 | - if (stricmp(sc.String, "defaultgamesettings") == 0) | |
322 | + if ( stricmp( sc.String, "defaultgamesettings" ) == 0 ) | |
320 | 323 | { |
321 | 324 | // [AK] Don't allow more than one "defaultgamesettings" block in the same lump. |
322 | 325 | if ( bParsedDefGameSettings ) |
323 | 326 | sc.ScriptError( "There is already a \"DefaultGameSettings\" block defined in this lump." ); |
324 | 327 | |
325 | - GAMEMODE_ParseGameSettingBlock( sc, NUM_GAMEMODES, false, !( bParsedDefGameSettings || bParsedDefLockedSettings ) ); | |
328 | + GAMEMODE_ParseGameSettingBlock( sc, NUM_GAMEMODES, false, !( bParsedDefGameSettings || bParsedDefLockedSettings )); | |
326 | 329 | bParsedDefGameSettings = true; |
327 | 330 | } |
328 | - else if (stricmp(sc.String, "defaultlockedgamesettings") == 0) | |
331 | + else if ( stricmp( sc.String, "defaultlockedgamesettings" ) == 0 ) | |
329 | 332 | { |
330 | 333 | // [AK] Don't allow more than one "defaultlockedgamesettings" block in the same lump. |
331 | 334 | if ( bParsedDefLockedSettings ) |
332 | 335 | sc.ScriptError( "There is already a \"DefaultLockedGameSettings\" block defined in this lump." ); |
333 | 336 | |
334 | - GAMEMODE_ParseGameSettingBlock( sc, NUM_GAMEMODES, true, !( bParsedDefGameSettings || bParsedDefLockedSettings ) ); | |
337 | + GAMEMODE_ParseGameSettingBlock( sc, NUM_GAMEMODES, true, !( bParsedDefGameSettings || bParsedDefLockedSettings )); | |
335 | 338 | bParsedDefLockedSettings = true; |
336 | 339 | } |
337 | 340 | else |
338 | 341 | { |
339 | 342 | GAMEMODE_e GameMode = static_cast<GAMEMODE_e>( sc.MustGetEnumName( "gamemode", "GAMEMODE_", GetValueGAMEMODE_e, true )); |
340 | - GAMEMODE_ParseGameModeBlock ( sc, GameMode ); | |
343 | + GAMEMODE_ParseGameModeBlock( sc, GameMode ); | |
341 | 344 | } |
342 | 345 | } |
343 | 346 | } |
@@ -180,7 +180,7 @@ | ||
180 | 180 | void GAMEMODE_Tick( void ); |
181 | 181 | void GAMEMODE_ParseGameModeBlock ( FScanner &sc, const GAMEMODE_e GameMode ); |
182 | 182 | void GAMEMODE_ParseGameSettingBlock ( FScanner &sc, const GAMEMODE_e GameMode, bool bLockCVars, bool bResetCVars = false ); |
183 | -void GAMEMODE_ParseGamemodeInfo( void ); | |
183 | +void GAMEMODE_ParseGameModeInfo( void ); | |
184 | 184 | ULONG GAMEMODE_GetFlags( GAMEMODE_e GameMode ); |
185 | 185 | ULONG GAMEMODE_GetCurrentFlags( void ); |
186 | 186 | const char *GAMEMODE_GetShortName( GAMEMODE_e GameMode ); |