Ticket #8432: cd-warning.diff
File cd-warning.diff, 2.9 KB (added by , 19 years ago) |
---|
-
base/engine.cpp
diff -ur --exclude=CVS --exclude=Makefile ScummVM/base/engine.cpp ScummVM+hack/base/engine.cpp
old new 30 30 #include "common/savefile.h" 31 31 #include "common/system.h" 32 32 #include "sound/mixer.h" 33 #include "gui/message.h" 33 34 34 35 /* FIXME - BIG HACK for MidiEmu */ 35 36 Engine *g_engine = 0; … … 84 85 _system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen")); 85 86 } 86 87 88 void Engine::checkCD() { 89 #ifdef WIN32 90 // It is a known bug under Windows that games that play CD audio cause 91 // ScummVM to crash if the data files are read from the same CD. Check 92 // if this appears to be the case and issue a warning. 93 94 // If we can find a compressed audio track, then it should be ok even 95 // if it's running from CD. 96 97 #ifdef USE_VORBIS 98 if (Common::File::exists("track1.ogg")) 99 return; 100 #endif 101 #ifdef USE_FLAC 102 if (Common::File::exists("track1.fla") || Common::File::exists("track1.flac")) 103 return; 104 #endif 105 #ifdef USE_MAD 106 if (Common::File::exists("track1.mp3")) 107 return; 108 #endif 109 110 char buffer[MAXPATHLEN]; 111 int i; 112 113 if (strlen(getGameDataPath()) == 0) { 114 // That's it! I give up! 115 if (getcwd(buffer, MAXPATHLEN) == NULL) 116 return; 117 } else 118 strncpy(buffer, getGameDataPath(), MAXPATHLEN); 119 120 for (i = 0; i < MAXPATHLEN - 1; i++) { 121 if (buffer[i] == '\\') 122 break; 123 } 124 125 buffer[i + 1] = 0; 126 127 if (GetDriveType(buffer) == DRIVE_CDROM) { 128 GUI::MessageDialog dialog( 129 "You appear to be playing this game directly\n" 130 "from the CD. This is known to cause problems,\n" 131 "and it's therefore recommended that you copy\n" 132 "the data files to your hard disk instead.\n" 133 "See the README file for details.", "OK"); 134 dialog.runModal(); 135 } 136 #endif 137 } 138 87 139 const char *Engine::getGameDataPath() const { 88 140 return _gameDataPath.c_str(); 89 141 } -
base/engine.h
diff -ur --exclude=CVS --exclude=Makefile ScummVM/base/engine.h ScummVM+hack/base/engine.h
old new 69 69 virtual void errorString(const char *buf_input, char *buf_output) = 0; 70 70 71 71 void initCommonGFX(GameDetector &detector); 72 73 /** On some systems, check if the game appears to be run from CD. */ 74 void checkCD(); 72 75 }; 73 76 74 77 extern Engine *g_engine; -
scumm/scumm.cpp
diff -ur --exclude=CVS --exclude=Makefile ScummVM/scumm/scumm.cpp ScummVM+hack/scumm/scumm.cpp
old new 1450 1450 1451 1451 _system->endGFXTransaction(); 1452 1452 1453 // On some systems it's not safe to run CD audio games from the CD. 1454 if (_features & GF_AUDIOTRACKS) 1455 checkCD(); 1456 1453 1457 int cd_num = ConfMan.getInt("cdrom"); 1454 1458 if (cd_num >= 0 && (_features & GF_AUDIOTRACKS)) 1455 1459 _system->openCD(cd_num);