• R/O
  • SSH

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)


Commit MetaInfo

Révision3595708f1b65533026852ea9994bd7ea753920f8 (tree)
l'heure2022-10-06 11:52:09
AuteurAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Message de Log

Did some cosmetic cleanup of functions that parse the GAMEMODE lump.

Change Summary

Modification

diff -r 7b881b0e3831 -r 3595708f1b65 src/d_main.cpp
--- a/src/d_main.cpp Wed Oct 05 22:42:41 2022 -0400
+++ b/src/d_main.cpp Wed Oct 05 22:52:09 2022 -0400
@@ -2902,7 +2902,7 @@
29022902 CAMPAIGN_ParseCampaignInfo( );
29032903
29042904 // [BB] Parse the GAMEMODE lump.
2905- GAMEMODE_ParseGamemodeInfo( );
2905+ GAMEMODE_ParseGameModeInfo( );
29062906
29072907 // [RH] Initialize localizable strings.
29082908 GStrings.LoadStrings (false);
diff -r 7b881b0e3831 -r 3595708f1b65 src/gamemode.cpp
--- a/src/gamemode.cpp Wed Oct 05 22:42:41 2022 -0400
+++ b/src/gamemode.cpp Wed Oct 05 22:52:09 2022 -0400
@@ -121,54 +121,55 @@
121121
122122 //*****************************************************************************
123123 //
124-void GAMEMODE_ParseGameModeBlock ( FScanner &sc, const GAMEMODE_e GameMode )
124+void GAMEMODE_ParseGameModeBlock( FScanner &sc, const GAMEMODE_e GameMode )
125125 {
126- sc.MustGetStringName("{");
127- while (!sc.CheckString("}"))
126+ sc.MustGetStringName( "{" );
127+
128+ while ( !sc.CheckString( "}" ))
128129 {
129- sc.MustGetString();
130+ sc.MustGetString( );
130131
131- if (0 == stricmp (sc.String, "removeflag"))
132+ if ( stricmp( sc.String, "removeflag" ) == 0 )
132133 {
133134 g_GameModes[GameMode].ulFlags &= ~sc.MustGetEnumName( "flag", "GMF_", GetValueGMF );
134135 }
135- else if (0 == stricmp (sc.String, "addflag"))
136+ else if ( stricmp( sc.String, "addflag" ) == 0 )
136137 {
137138 g_GameModes[GameMode].ulFlags |= sc.MustGetEnumName( "flag", "GMF_", GetValueGMF );
138139 }
139- else if (0 == stricmp (sc.String, "name"))
140+ else if ( stricmp( sc.String, "name" ) == 0 )
140141 {
141- sc.MustGetString();
142+ sc.MustGetString( );
142143 g_GameModes[GameMode].Name = sc.String;
143144 }
144- else if (0 == stricmp (sc.String, "shortname"))
145+ else if ( stricmp( sc.String, "shortname" ) == 0 )
145146 {
146- sc.MustGetString();
147+ sc.MustGetString( );
147148 g_GameModes[GameMode].ShortName = sc.String;
148149
149150 // [AK] Limit the short name to only 8 characters.
150151 g_GameModes[GameMode].ShortName.Truncate( 8 );
151152 }
152- else if (0 == stricmp (sc.String, "f1texture"))
153+ else if ( stricmp( sc.String, "f1texture" ) == 0 )
153154 {
154- sc.MustGetString();
155+ sc.MustGetString( );
155156 g_GameModes[GameMode].F1Texture = sc.String;
156157
157158 // [AK] The F1 texture cannot exceed more than 8 characters.
158159 g_GameModes[GameMode].F1Texture.Truncate( 8 );
159160 }
160- else if (0 == stricmp (sc.String, "welcomesound"))
161+ else if ( stricmp( sc.String, "welcomesound" ) == 0 )
161162 {
162- sc.MustGetString();
163+ sc.MustGetString( );
163164 g_GameModes[GameMode].WelcomeSound = sc.String;
164165 }
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 ))
166167 {
167168 GAMEMODE_ParseGameSettingBlock( sc, GameMode, !stricmp( sc.String, "lockedgamesettings" ));
168169 }
169- else if (0 == stricmp (sc.String, "removegamesetting"))
170+ else if ( stricmp( sc.String, "removegamesetting" ) == 0 )
170171 {
171- sc.MustGetString();
172+ sc.MustGetString( );
172173 FBaseCVar *pCVar = FindCVar( sc.String, NULL );
173174
174175 // [AK] Make sure that this CVar exists.
@@ -185,13 +186,15 @@
185186 }
186187 }
187188 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+ }
189192 }
190193 }
191194
192195 //*****************************************************************************
193196 //
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 )
195198 {
196199 sc.MustGetStringName( "{" );
197200
@@ -304,40 +307,40 @@
304307
305308 //*****************************************************************************
306309 //
307-void GAMEMODE_ParseGamemodeInfo( void )
310+void GAMEMODE_ParseGameModeInfo( void )
308311 {
309312 int lastlump = 0, lump;
310313
311- while ((lump = Wads.FindLump ("GAMEMODE", &lastlump)) != -1)
314+ while (( lump = Wads.FindLump( "GAMEMODE", &lastlump )) != -1 )
312315 {
313- FScanner sc(lump);
316+ FScanner sc( lump );
314317 bool bParsedDefGameSettings = false;
315318 bool bParsedDefLockedSettings = false;
316319
317- while (sc.GetString ())
320+ while ( sc.GetString( ))
318321 {
319- if (stricmp(sc.String, "defaultgamesettings") == 0)
322+ if ( stricmp( sc.String, "defaultgamesettings" ) == 0 )
320323 {
321324 // [AK] Don't allow more than one "defaultgamesettings" block in the same lump.
322325 if ( bParsedDefGameSettings )
323326 sc.ScriptError( "There is already a \"DefaultGameSettings\" block defined in this lump." );
324327
325- GAMEMODE_ParseGameSettingBlock( sc, NUM_GAMEMODES, false, !( bParsedDefGameSettings || bParsedDefLockedSettings ) );
328+ GAMEMODE_ParseGameSettingBlock( sc, NUM_GAMEMODES, false, !( bParsedDefGameSettings || bParsedDefLockedSettings ));
326329 bParsedDefGameSettings = true;
327330 }
328- else if (stricmp(sc.String, "defaultlockedgamesettings") == 0)
331+ else if ( stricmp( sc.String, "defaultlockedgamesettings" ) == 0 )
329332 {
330333 // [AK] Don't allow more than one "defaultlockedgamesettings" block in the same lump.
331334 if ( bParsedDefLockedSettings )
332335 sc.ScriptError( "There is already a \"DefaultLockedGameSettings\" block defined in this lump." );
333336
334- GAMEMODE_ParseGameSettingBlock( sc, NUM_GAMEMODES, true, !( bParsedDefGameSettings || bParsedDefLockedSettings ) );
337+ GAMEMODE_ParseGameSettingBlock( sc, NUM_GAMEMODES, true, !( bParsedDefGameSettings || bParsedDefLockedSettings ));
335338 bParsedDefLockedSettings = true;
336339 }
337340 else
338341 {
339342 GAMEMODE_e GameMode = static_cast<GAMEMODE_e>( sc.MustGetEnumName( "gamemode", "GAMEMODE_", GetValueGAMEMODE_e, true ));
340- GAMEMODE_ParseGameModeBlock ( sc, GameMode );
343+ GAMEMODE_ParseGameModeBlock( sc, GameMode );
341344 }
342345 }
343346 }
diff -r 7b881b0e3831 -r 3595708f1b65 src/gamemode.h
--- a/src/gamemode.h Wed Oct 05 22:42:41 2022 -0400
+++ b/src/gamemode.h Wed Oct 05 22:52:09 2022 -0400
@@ -180,7 +180,7 @@
180180 void GAMEMODE_Tick( void );
181181 void GAMEMODE_ParseGameModeBlock ( FScanner &sc, const GAMEMODE_e GameMode );
182182 void GAMEMODE_ParseGameSettingBlock ( FScanner &sc, const GAMEMODE_e GameMode, bool bLockCVars, bool bResetCVars = false );
183-void GAMEMODE_ParseGamemodeInfo( void );
183+void GAMEMODE_ParseGameModeInfo( void );
184184 ULONG GAMEMODE_GetFlags( GAMEMODE_e GameMode );
185185 ULONG GAMEMODE_GetCurrentFlags( void );
186186 const char *GAMEMODE_GetShortName( GAMEMODE_e GameMode );