2 Copyright (C) 2004-2011 Parallel Realities
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 printf("Blob Wars, Episode I - Metal Blob Solid (Version %.2f, Release %d)\n", VERSION, RELEASE);
29 printf("Copyright (C) 2004-2011 Parallel Realities\n");
30 printf("Licensed under the GNU General Public License (GPL)\n\n");
32 printf("The Metal Blob Solid gameplay manual can be found in,\n");
33 printf("\t%s\n\n", GAMEPLAYMANUAL);
35 printf("Replay Commands\n");
36 printf("\t-map <filename> Play the specified map (use -listmaps to see maps)\n");
37 printf("\t-record <filename> Record a game and output to the specified file\n");
38 printf("\t-playback <filename> Playback the specified recording\n");
39 printf("\t-listmaps List the available maps for playing\n\n");
41 printf("Replay Examples\n");
42 printf("\tblobwars -map data/grasslands1 -record replay.dat\n");
43 printf("\tblobwars -playback replay.dat\n\n");
45 printf("Additional Commands\n");
46 printf("\t-fullscreen Start the game in Full Screen mode\n");
47 printf("\t-mono Use mono sound output instead of stereo\n");
48 printf("\t-noaudio Disables audio\n");
49 printf("\t-version Display version number\n");
50 printf("\t--help This help\n\n");
58 printf("Blob Wars, Episode I - Metal Blob Solid (Version %.2f, Release %d)\n", VERSION, RELEASE);
59 printf("Copyright (C) 2004-2011 Parallel Realities\n");
60 printf("Licensed under the GNU General Public License (GPL)\n\n");
62 printf("Available Maps\n");
63 printf("\tdata/arcticWastes\n");
64 printf("\tdata/assimilator\n");
65 printf("\tdata/caves1\n");
66 printf("\tdata/caves2\n");
67 printf("\tdata/caves3\n");
68 printf("\tdata/caves4\n");
69 printf("\tdata/comm\n");
70 printf("\tdata/finalBattle\n");
71 printf("\tdata/floodedTunnel1\n");
72 printf("\tdata/floodedTunnel2\n");
73 printf("\tdata/floodedTunnel3\n");
74 printf("\tdata/floodedTunnel4\n");
75 printf("\tdata/grasslands1\n");
76 printf("\tdata/grasslands2\n");
77 printf("\tdata/grasslands3\n");
78 printf("\tdata/hq\n");
79 printf("\tdata/icecave1\n");
80 printf("\tdata/icecave2\n");
81 printf("\tdata/spaceStation\n");
82 printf("\tdata/supply\n");
83 printf("\tdata/tomb1\n");
84 printf("\tdata/tomb2\n");
85 printf("\tdata/tomb3\n");
86 printf("\tdata/tomb4\n\n");
94 printf("Blob Wars, Episode I - Metal Blob Solid (Version %.2f, Release %d)\n", VERSION, RELEASE);
95 printf("Copyright (C) 2004-2011 Parallel Realities\n");
96 printf("Licensed under the GNU General Public License (GPL)\n\n");
100 int main(int argc, char *argv[])
103 debug(("Not Using PAK...\n"));
107 if (chdir(PAKLOCATION))
109 perror("Could not chdir to " PAKLOCATION ":");
114 config.engine = &engine;
118 bindtextdomain("blobwars", LOCALEDIR);
119 setlocale(LC_ALL, "");
120 textdomain("blobwars");
124 bool showSprites = false;
127 int recordMode = REPLAY_MODE::NONE;
128 int requiredSection = SECTION_INTRO;
130 for (int i = 1 ; i < argc ; i++)
132 if (strcmp(argv[i], "-fullscreen") == 0) engine.fullScreen = true;
133 else if (strcmp(argv[i], "-noaudio") == 0) engine.useAudio = 0;
134 else if (strcmp(argv[i], "-mono") == 0) engine.useAudio = 1;
135 else if (strcmp(argv[i], "-version") == 0) showVersion();
136 else if (strcmp(argv[i], "--help") == 0) showHelp();
137 else if (strcmp(argv[i], "-record") == 0) {recordMode = REPLAY_MODE::RECORD; strlcpy(replayData.filename, argv[++i], sizeof replayData.filename);}
138 else if (strcmp(argv[i], "-playback") == 0) {recordMode = REPLAY_MODE::PLAYBACK; strlcpy(replayData.filename, argv[++i], sizeof replayData.filename);}
139 else if (strcmp(argv[i], "-map") == 0) {game.setMapName(argv[++i]); requiredSection = SECTION_GAME;}
140 else if (strcmp(argv[i], "-listmaps") == 0) listMaps();
141 else if (strcmp(argv[i], "-credits") == 0) requiredSection = SECTION_CREDITS;
144 else if (strcmp(argv[i], "-showsprites") == 0) showSprites = true;
145 else if (strcmp(argv[i], "-hub") == 0) hub = true;
146 else if (strcmp(argv[i], "-randomscreens") == 0) graphics.takeRandomScreenShots = true;
147 else if (strcmp(argv[i], "-nomonsters") == 0) engine.devNoMonsters = true;
153 case REPLAY_MODE::NONE:
157 case REPLAY_MODE::RECORD:
158 requiredSection = SECTION_GAME;
159 strlcpy(replayData.header.map, game.mapName, sizeof replayData.header.map);
160 replayData.header.skill = game.skill = 3;
161 replayData.setMode(REPLAY_MODE::RECORD);
164 case REPLAY_MODE::PLAYBACK:
165 requiredSection = SECTION_GAME;
166 replayData.setMode(REPLAY_MODE::PLAYBACK);
167 replayData.header.time = 0;
168 game.setMapName(replayData.header.map);
169 game.skill = replayData.header.skill;
175 // seed the random using the one generated
176 // via the replay data
177 Math::pSeed = replayData.header.randomSeed;
179 player.setName("Player");
183 engine.allowQuit = true;
187 requiredSection = SECTION_HUB;
194 game.hasAquaLung = game.hasJetPack = true;
204 switch (requiredSection)
207 requiredSection = doIntro();
211 requiredSection = title();
215 requiredSection = doHub();
219 if (!game.continueFromCheckPoint)
221 checkStartCutscene();
224 requiredSection = doGame();
227 case SECTION_GAMEOVER:
228 requiredSection = gameover();
231 case SECTION_EASYOVER:
235 requiredSection = SECTION_TITLE;
238 case SECTION_CREDITS:
240 requiredSection = SECTION_TITLE;