Maelstrom: Added a classic mode option (doesn't have UI yet)

https://github.com/libsdl-org/Maelstrom/commit/b9c9ce58e679e34e317d57c3b00f7527b43ee103

From b9c9ce58e679e34e317d57c3b00f7527b43ee103 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 2 Oct 2012 09:36:13 -0700
Subject: [PATCH] Added a classic mode option (doesn't have UI yet)

---
 game/Maelstrom_Globals.h |  8 ++------
 game/init.cpp            | 13 +++++++++++++
 game/main.cpp            |  6 ++++--
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/game/Maelstrom_Globals.h b/game/Maelstrom_Globals.h
index 66d83c61..1fa49957 100644
--- a/game/Maelstrom_Globals.h
+++ b/game/Maelstrom_Globals.h
@@ -44,6 +44,7 @@
 #include "gameinfo.h"
 
 // Preferences keys
+#define PREFERENCES_CLASSIC "Classic"
 #define PREFERENCES_RESOLUTION "Resolution"
 #define PREFERENCES_HANDLE "Handle"
 #define PREFERENCES_DEATHMATCH "Network.Deathmatch"
@@ -75,12 +76,6 @@ extern UIManager *ui;
 
 /* Boolean type */
 typedef Uint8 Bool;
-#ifndef true
-#define true	1
-#endif
-#ifndef false
-#define false	0
-#endif
 
 // Functions from main.cpp
 extern void   PrintUsage(void);
@@ -98,6 +93,7 @@ extern Bool	gUpdateBuffer;
 extern Bool	gRunning;
 
 // in init.cpp : 
+extern Bool	gClassic;
 struct Resolution {
 	int w, h;
 	char path_suffix[32];
diff --git a/game/init.cpp b/game/init.cpp
index 497fa7fa..05d32324 100644
--- a/game/init.cpp
+++ b/game/init.cpp
@@ -50,6 +50,7 @@ MFont    *fonts[NUM_FONTS];
 FrameBuf *screen = NULL;
 UIManager *ui = NULL;
 
+Bool	gClassic;
 array<Resolution> gResolutions;
 int	gResolutionIndex;
 char   *gReplayFile;
@@ -156,6 +157,18 @@ static bool InitResolutions(int &w, int &h)
 	}
 	delete[] buffer;
 
+	if (prefs->GetBool(PREFERENCES_CLASSIC)) {
+		gClassic = true;
+	}
+	if (gClassic) {
+		w = GAME_WIDTH;
+		h = GAME_HEIGHT;
+		gResolutionIndex = FindResolution(w, h);
+		if (gResolutionIndex >= 0) {
+			return true;
+		}
+	}
+		
 	// See if the user wants something specific
 	const char *desired = prefs->GetString(PREFERENCES_RESOLUTION);
 	if (desired) {
diff --git a/game/main.cpp b/game/main.cpp
index d00d6244..1b2dd207 100644
--- a/game/main.cpp
+++ b/game/main.cpp
@@ -254,6 +254,7 @@ void PrintUsage(void)
 	error("Where <options> can be any of:\n\n"
 "	-fullscreen		# Run Maelstrom in full-screen mode\n"
 "	-windowed		# Run Maelstrom in windowed mode\n"
+"	-classic		# Run Maelstrom in 640x480 classic mode\n"
 	);
 	error("\n");
 	exit(1);
@@ -360,9 +361,10 @@ int MaelstromMain(int argc, char *argv[])
 	for ( progname=argv[0]; --argc; ++argv ) {
 		if ( strcmp(argv[1], "-fullscreen") == 0 ) {
 			window_flags |= SDL_WINDOW_FULLSCREEN;
-		} else
-		if ( strcmp(argv[1], "-windowed") == 0 ) {
+		} else if ( strcmp(argv[1], "-windowed") == 0 ) {
 			window_flags &= ~SDL_WINDOW_FULLSCREEN;
+		} else if ( strcmp(argv[1], "-classic") == 0 ) {
+			gClassic = true;
 		} else if ( strcmp(argv[1], "-version") == 0 ) {
 			error("%s", Version);
 			exit(0);