diff options
-rw-r--r-- | gameDetector.cpp | 49 | ||||
-rw-r--r-- | gameDetector.h | 24 | ||||
-rw-r--r-- | sdl.cpp | 42 | ||||
-rw-r--r-- | v3/resource_v3.cpp | 22 | ||||
-rw-r--r-- | v4/resource_v4.cpp | 22 |
5 files changed, 123 insertions, 36 deletions
diff --git a/gameDetector.cpp b/gameDetector.cpp index 914ba0f937..ad174502de 100644 --- a/gameDetector.cpp +++ b/gameDetector.cpp @@ -1,3 +1,26 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + + #include "stdafx.h" #include "scumm.h" #include "gameDetector.h" @@ -20,7 +43,7 @@ "\tf - fullscreen mode\n" \ "\tg - graphics mode. 1 for 2xSai anti-aliasing\n" -void GameDetecter::parseCommandLine(int argc, char **argv) { +void GameDetector::parseCommandLine(int argc, char **argv) { #if !defined(__APPLE__CW) int i; char *s; @@ -176,14 +199,14 @@ static const VersionSettings version_settings[] = { /* Scumm Version 7 */ {"ft", "Full Throttle", GID_FT, 7, 3, 0, GF_NEW_OPCODES|GF_AFTER_V6|GF_AFTER_V7}, - {"dig", "The Dig", GID_DIG, 7, 5, 0, GF_NEW_OPCODES|GF_AFTER_V6|GF_AFTER_V7}, + {"dig", "The Dig", GID_DIG, 7, 5, 0, GF_NEW_OPCODES|GF_AFTER_V6|GF_AFTER_V7}, - /* Scumm Version 8 */ -// {"curse", "The Curse of Monkey Island", GID_CMI, 8, 1, 0,}, + /* Scumm Version 8 */ +// {"curse", "The Curse of Monkey Island", GID_CMI, 8, 1, 0,}, {NULL,NULL} }; -bool GameDetecter::detectGame() { +bool GameDetector::detectGame() { const VersionSettings *gnl = version_settings; _gameId = 0; @@ -191,10 +214,8 @@ bool GameDetecter::detectGame() { do { if (!scumm_stricmp(_exe_name, gnl->filename)) { _gameId = gnl->id; - _scummVersion = gnl->major; -// _majorScummVersion = gnl->major; -// _middleScummVersion = gnl->middle; -// _minorScummVersion = gnl->minor; + _scummVersion = gnl->major; + _features = gnl->features; _gameText = gnl->gamename; debug(1, "Detected game '%s', version %d.%d.%d", @@ -208,7 +229,7 @@ bool GameDetecter::detectGame() { return true; } -char *GameDetecter::getGameName() { +char *GameDetector::getGameName() { if (_gameText==NULL) { char buf[256]; sprintf(buf, "Unknown game: \"%s\"", _exe_name); @@ -217,12 +238,12 @@ char *GameDetecter::getGameName() { return strdup(_gameText); } -int GameDetecter::detectMain(int argc, char **argv) +int GameDetector::detectMain(int argc, char **argv) { - _debugMode = 0; // off by default... + _debugMode = 0; // off by default... - _noSubtitles = 0; // use by default - should this depend on soundtrack? - _scale = 2; // double size by default + _noSubtitles = 0; // use by default - should this depend on soundtrack? + _scale = 2; // double size by default _gameDataPath = NULL; _gameTempo = 0; diff --git a/gameDetector.h b/gameDetector.h index 613ae4c371..2566848048 100644 --- a/gameDetector.h +++ b/gameDetector.h @@ -1,4 +1,26 @@ -class GameDetecter { +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + +class GameDetector { public: int detectMain(int argc, char **argv); void parseCommandLine(int argc, char **argv); @@ -36,7 +36,7 @@ Scumm *scumm; ScummDebugger debugger; Gui gui; OSystem _system; -GameDetecter detecter; +GameDetector detector; SoundEngine sound; SOUND_DRIVER_TYPE snd_driv; @@ -789,7 +789,7 @@ void initGraphics(Scumm *s, bool fullScreen, unsigned int scaleFactor) { char buf[512], *gameName; - sprintf(buf, "ScummVM - %s", gameName = detecter.getGameName()); + sprintf(buf, "ScummVM - %s", gameName = detector.getGameName()); free(gameName); desired.freq = SAMPLES_PER_SEC; @@ -851,7 +851,7 @@ void initGraphics(Scumm *s, bool fullScreen, unsigned int scaleFactor) { void setWindowName(Scumm *s) { char buf[512], *gameName; - sprintf(buf, "ScummVM - %s", gameName = detecter.getGameName()); + sprintf(buf, "ScummVM - %s", gameName = detector.getGameName()); free(gameName); SDL_WM_SetCaption(buf,buf); } @@ -922,19 +922,19 @@ int main(int argc, char* argv[]) { long i; - if(detecter.detectMain(argc, argv)) + if(detector.detectMain(argc, argv)) return(-1); - if(detecter._features & GF_OLD256) + if(detector._features & GF_OLD256) scumm = new Scumm_v3; else - if(detecter._features & GF_SMALL_HEADER) // this force loomCD as v4 + if(detector._features & GF_SMALL_HEADER) // this force loomCD as v4 scumm = new Scumm_v4; else - if(detecter._features & GF_AFTER_V7) + if(detector._features & GF_AFTER_V7) scumm = new Scumm_v7; else - if(detecter._features & GF_AFTER_V6) // this force SamnmaxCD as v6 + if(detector._features & GF_AFTER_V6) // this force SamnmaxCD as v6 scumm = new Scumm_v6; else scumm = new Scumm_v5; @@ -1073,19 +1073,19 @@ int main(int argc, char* argv[]) { /* */ - scumm->_fullScreen = detecter._fullScreen; - scumm->_debugMode = detecter._debugMode; - scumm->_bootParam = detecter._bootParam; - scumm->_scale = detecter._scale; - scumm->_gameDataPath = detecter._gameDataPath; - scumm->_gameTempo = detecter._gameTempo; - scumm->_soundEngine = detecter._soundEngine; - scumm->_videoMode = detecter._videoMode; - scumm->_exe_name = detecter._exe_name; - scumm->_gameId = detecter._gameId; - scumm->_gameText = detecter._gameText; - scumm->_features = detecter._features; - scumm->_soundCardType = detecter._soundCardType; + scumm->_fullScreen = detector._fullScreen; + scumm->_debugMode = detector._debugMode; + scumm->_bootParam = detector._bootParam; + scumm->_scale = detector._scale; + scumm->_gameDataPath = detector._gameDataPath; + scumm->_gameTempo = detector._gameTempo; + scumm->_soundEngine = detector._soundEngine; + scumm->_videoMode = detector._videoMode; + scumm->_exe_name = detector._exe_name; + scumm->_gameId = detector._gameId; + scumm->_gameText = detector._gameText; + scumm->_features = detector._features; + scumm->_soundCardType = detector._soundCardType; scumm->_gui = &gui; diff --git a/v3/resource_v3.cpp b/v3/resource_v3.cpp index ebda7cf836..8dc6e7b0bb 100644 --- a/v3/resource_v3.cpp +++ b/v3/resource_v3.cpp @@ -1,3 +1,25 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + #include "stdafx.h" #include "scumm.h" diff --git a/v4/resource_v4.cpp b/v4/resource_v4.cpp index 20b1adc3a2..f4d41895d5 100644 --- a/v4/resource_v4.cpp +++ b/v4/resource_v4.cpp @@ -1,3 +1,25 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001 Ludvig Strigeus + * Copyright (C) 2001/2002 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Header$ + * + */ + #include "stdafx.h" #include "scumm.h" |