Ticket #8693: TEST5.patch
File TEST5.patch, 23.8 KB (added by , 17 years ago) |
---|
-
backends/events/default/default-events.cpp
27 27 28 28 #include "common/stdafx.h" 29 29 #include "common/system.h" 30 #include "common/config-manager.h" 30 31 #include "backends/events/default/default-events.h" 31 32 33 #define RECORD_SIGNATURE 0x54455354 34 #define RECORD_VERSION 1 35 36 void readRecord(Common::InSaveFile *inFile, uint32 &diff, Common::Event &event) { 37 diff = inFile->readUint32LE(); 38 39 inFile->read(&event.type, sizeof(event.type)); 40 41 switch(event.type) { 42 case Common::EVENT_KEYDOWN: 43 case Common::EVENT_KEYUP: 44 inFile->read(&event.kbd, sizeof(event.kbd)); 45 break; 46 case Common::EVENT_MOUSEMOVE: 47 case Common::EVENT_LBUTTONDOWN: 48 case Common::EVENT_LBUTTONUP: 49 case Common::EVENT_RBUTTONDOWN: 50 case Common::EVENT_RBUTTONUP: 51 case Common::EVENT_WHEELUP: 52 case Common::EVENT_WHEELDOWN: 53 inFile->read(&event.mouse, sizeof(event.mouse)); 54 break; 55 } 56 } 57 58 void writeRecord(Common::OutSaveFile *outFile, uint32 diff, Common::Event &event) { 59 outFile->writeUint32LE(diff); 60 61 outFile->write(&event.type, sizeof(event.type)); 62 63 switch(event.type) { 64 case Common::EVENT_KEYDOWN: 65 case Common::EVENT_KEYUP: 66 outFile->write(&event.kbd, sizeof(event.kbd)); 67 break; 68 case Common::EVENT_MOUSEMOVE: 69 case Common::EVENT_LBUTTONDOWN: 70 case Common::EVENT_LBUTTONUP: 71 case Common::EVENT_RBUTTONDOWN: 72 case Common::EVENT_RBUTTONUP: 73 case Common::EVENT_WHEELUP: 74 case Common::EVENT_WHEELDOWN: 75 outFile->write(&event.mouse, sizeof(event.mouse)); 76 break; 77 } 78 } 79 32 80 DefaultEventManager::DefaultEventManager(OSystem *boss) : 33 81 _boss(boss), 34 82 _buttonState(0), … … 37 85 38 86 assert(_boss); 39 87 88 _recordFile = NULL; 89 _recordTimeFile = NULL; 90 _playbackFile = NULL; 91 _playbackTimeFile = NULL; 92 _timeMutex = _boss->createMutex(); 93 94 _eventCount = 0; 95 _lastEventCount = 0; 96 _lastMillis = 0; 97 98 Common::String recordModeString = ConfMan.get("record_mode"); 99 if (recordModeString.compareToIgnoreCase("record") == 0) { 100 _recordMode = kRecorderRecord; 101 } else { 102 if (recordModeString.compareToIgnoreCase("playback") == 0) { 103 _recordMode = kRecorderPlayback; 104 } else { 105 _recordMode = kPassthrough; 106 } 107 } 108 109 _recordFileName = ConfMan.get("record_file_name"); 110 if (_recordFileName.empty()) { 111 _recordFileName = "record.bin"; 112 } 113 _recordTempFileName = ConfMan.get("record_temp_file_name"); 114 if (_recordTempFileName.empty()) { 115 _recordTempFileName = "record.tmp"; 116 } 117 _recordTimeFileName = ConfMan.get("record_time_file_name"); 118 if (_recordTimeFileName.empty()) { 119 _recordTimeFileName = "record.time"; 120 } 121 40 122 // Reset key repeat 41 123 _currentKeyDown.keycode = 0; 124 125 // recorder stuff 126 if (_recordMode == kRecorderRecord) { 127 _recordCount = 0; 128 _recordTimeCount = 0; 129 _recordFile = _boss->getSavefileManager()->openForSaving(_recordTempFileName.c_str()); 130 _recordTimeFile = _boss->getSavefileManager()->openForSaving(_recordTimeFileName.c_str()); 131 _recordSubtitles = ConfMan.getBool("subtitles"); 132 } 133 134 uint32 sign; 135 uint32 version; 136 uint32 randomSourceCount; 137 if (_recordMode == kRecorderPlayback) { 138 _playbackCount = 0; 139 _playbackTimeCount = 0; 140 _playbackFile = _boss->getSavefileManager()->openForLoading(_recordFileName.c_str()); 141 _playbackTimeFile = _boss->getSavefileManager()->openForLoading(_recordTimeFileName.c_str()); 142 sign = _playbackFile->readUint32LE(); 143 if (sign != RECORD_SIGNATURE) { 144 error("Unknown record file signature"); 145 } 146 version = _playbackFile->readUint32LE(); 147 148 // conf vars 149 ConfMan.setBool("subtitles", _playbackFile->readByte() != 0); 150 151 _recordCount = _playbackFile->readUint32LE(); 152 _recordTimeCount = _playbackFile->readUint32LE(); 153 randomSourceCount = _playbackFile->readUint32LE(); 154 for (uint i = 0; i < randomSourceCount; ++i) { 155 RandomSourceRecord rec; 156 rec.name = ""; 157 uint32 sLen = _playbackFile->readUint32LE(); 158 for (uint j = 0; j < sLen; ++j) { 159 char c = _playbackFile->readSByte(); 160 rec.name += c; 161 } 162 rec.seed = _playbackFile->readUint32LE(); 163 _randomSourceRecords.push_back(rec); 164 } 165 166 _hasPlaybackEvent = false; 167 } 42 168 } 43 169 170 DefaultEventManager::~DefaultEventManager() { 171 _boss->lockMutex(_timeMutex); 172 _recordMode = kPassthrough; 173 _boss->unlockMutex(_timeMutex); 174 175 if (_playbackFile != NULL) { 176 delete _playbackFile; 177 } 178 if (_playbackTimeFile != NULL) { 179 delete _playbackTimeFile; 180 } 181 182 if (_recordFile != NULL) { 183 _recordFile->finalize(); 184 delete _recordFile; 185 _recordTimeFile->finalize(); 186 delete _recordTimeFile; 187 188 _playbackFile = _boss->getSavefileManager()->openForLoading(_recordTempFileName.c_str()); 189 190 _recordFile = _boss->getSavefileManager()->openForSaving(_recordFileName.c_str()); 191 _recordFile->writeUint32LE(RECORD_SIGNATURE); 192 _recordFile->writeUint32LE(RECORD_VERSION); 193 194 // conf vars 195 _recordFile->writeByte(_recordSubtitles ? 1 : 0); 196 197 _recordFile->writeUint32LE(_recordCount); 198 _recordFile->writeUint32LE(_recordTimeCount); 199 200 _recordFile->writeUint32LE(_randomSourceRecords.size()); 201 for (uint i = 0; i < _randomSourceRecords.size(); ++i) { 202 _recordFile->writeUint32LE(_randomSourceRecords[i].name.size()); 203 _recordFile->writeString(_randomSourceRecords[i].name); 204 _recordFile->writeUint32LE(_randomSourceRecords[i].seed); 205 } 206 207 for (uint i = 0; i < _recordCount; ++i) { 208 uint32 tempDiff; 209 Common::Event tempEvent; 210 readRecord(_playbackFile, tempDiff, tempEvent); 211 writeRecord(_recordFile, tempDiff, tempEvent); 212 } 213 214 _recordFile->finalize(); 215 delete _recordFile; 216 delete _playbackFile; 217 218 //TODO: remove recordTempFileName'ed file 219 } 220 _boss->deleteMutex(_timeMutex); 221 } 222 223 bool DefaultEventManager::playback(Common::Event &event) { 224 225 if (!_hasPlaybackEvent) { 226 if (_recordCount > _playbackCount) { 227 readRecord(_playbackFile, _playbackDiff, _playbackEvent); 228 _playbackCount++; 229 _hasPlaybackEvent = true; 230 } 231 } 232 233 if (_hasPlaybackEvent) { 234 if (_playbackDiff <= (_eventCount - _lastEventCount)) { 235 switch(_playbackEvent.type) { 236 case Common::EVENT_MOUSEMOVE: 237 case Common::EVENT_LBUTTONDOWN: 238 case Common::EVENT_LBUTTONUP: 239 case Common::EVENT_RBUTTONDOWN: 240 case Common::EVENT_RBUTTONUP: 241 case Common::EVENT_WHEELUP: 242 case Common::EVENT_WHEELDOWN: 243 _boss->warpMouse(_playbackEvent.mouse.x, _playbackEvent.mouse.y); 244 break; 245 } 246 event = _playbackEvent; 247 _hasPlaybackEvent = false; 248 _lastEventCount = _eventCount; 249 return true; 250 } 251 } 252 253 return false; 254 } 255 256 void DefaultEventManager::record(Common::Event &event) { 257 writeRecord(_recordFile, _eventCount - _lastEventCount, event); 258 259 _recordCount++; 260 _lastEventCount = _eventCount; 261 } 262 263 void DefaultEventManager::registerRandomSource(Common::RandomSource &rnd, const char *name) { 264 265 if (_recordMode == kRecorderRecord) { 266 RandomSourceRecord rec; 267 rec.name = name; 268 rec.seed = rnd.getSeed(); 269 _randomSourceRecords.push_back(rec); 270 } 271 272 if (_recordMode == kRecorderPlayback) { 273 for (uint i = 0; i < _randomSourceRecords.size(); ++i) { 274 if (_randomSourceRecords[i].name == name) { 275 rnd.setSeed(_randomSourceRecords[i].seed); 276 _randomSourceRecords.remove_at(i); 277 break; 278 } 279 } 280 } 281 } 282 283 void DefaultEventManager::processMillis(uint32 &millis) { 284 uint32 d; 285 if (_recordMode == kPassthrough) { 286 return; 287 } 288 289 _boss->lockMutex(_timeMutex); 290 if (_recordMode == kRecorderRecord) { 291 //Simple RLE compression 292 d = millis - _lastMillis; 293 if (d >= 0xff) { 294 _recordTimeFile->writeByte(0xff); 295 _recordTimeFile->writeUint32LE(d); 296 } else { 297 _recordTimeFile->writeByte(d); 298 } 299 _recordTimeCount++; 300 } 301 302 if (_recordMode == kRecorderPlayback) { 303 if (_recordTimeCount > _playbackTimeCount) { 304 d = _playbackTimeFile->readByte(); 305 if (d == 0xff) { 306 d = _playbackTimeFile->readUint32LE(); 307 } 308 millis = _lastMillis + d; 309 _playbackTimeCount++; 310 } 311 } 312 _lastMillis = millis; 313 _boss->unlockMutex(_timeMutex); 314 } 315 44 316 bool DefaultEventManager::pollEvent(Common::Event &event) { 45 317 uint32 time = _boss->getMillis(); 46 318 bool result; 47 319 320 _eventCount++; 321 48 322 result = _boss->pollEvent(event); 49 323 324 if ((_recordMode == kRecorderPlayback) && (event.type != Common::EVENT_QUIT)) { 325 result = playback(event); 326 } else { 327 328 if (_recordMode == kRecorderRecord) { 329 if (result) { 330 record(event); 331 } 332 } 333 } 334 50 335 if (result) { 51 336 event.synthetic = false; 52 337 switch (event.type) { -
backends/events/default/default-events.h
28 28 29 29 #include "common/stdafx.h" 30 30 #include "common/events.h" 31 #include "common/savefile.h" 31 32 32 33 /* 33 34 At some point we will remove pollEvent from OSystem and change … … 48 49 int _buttonState; 49 50 int _modifierState; 50 51 bool _shouldQuit; 52 53 class RandomSourceRecord { 54 public: 55 Common::String name; 56 uint32 seed; 57 }; 58 Common::Array<RandomSourceRecord> _randomSourceRecords; 51 59 60 bool _recordSubtitles; 61 uint32 _recordCount; 62 uint32 _lastRecordEvent; 63 uint32 _recordTimeCount; 64 Common::OutSaveFile *_recordFile; 65 Common::OutSaveFile *_recordTimeFile; 66 Common::MutexRef _timeMutex; 67 uint32 _lastMillis; 68 69 uint32 _playbackCount; 70 uint32 _playbackDiff; 71 bool _hasPlaybackEvent; 72 uint32 _playbackTimeCount; 73 Common::Event _playbackEvent; 74 Common::InSaveFile *_playbackFile; 75 Common::InSaveFile *_playbackTimeFile; 76 77 uint32 _eventCount; 78 uint32 _lastEventCount; 79 80 enum RecordMode { 81 kPassthrough = 0, 82 kRecorderRecord = 1, 83 kRecorderPlayback = 2 84 }; 85 RecordMode _recordMode; 86 Common::String _recordFileName; 87 Common::String _recordTempFileName; 88 Common::String _recordTimeFileName; 89 52 90 // for continuous events (keyDown) 53 91 enum { 54 92 kKeyRepeatInitialDelay = 400, … … 62 100 } _currentKeyDown; 63 101 uint32 _keyRepeatTime; 64 102 103 void record(Common::Event &event); 104 bool playback(Common::Event &event); 65 105 public: 66 106 DefaultEventManager(OSystem *boss); 107 ~DefaultEventManager(); 67 108 68 109 virtual bool pollEvent(Common::Event &event); 110 virtual void registerRandomSource(Common::RandomSource &rnd, const char *name); 111 virtual void processMillis(uint32 &millis); 69 112 70 113 virtual Common::Point getMousePos() const { return _mousePos; } 71 114 virtual int getButtonState() const { return _buttonState; } -
backends/platform/sdl/sdl.cpp
33 33 #include "backends/plugins/sdl/sdl-provider.h" 34 34 #include "common/config-manager.h" 35 35 #include "common/util.h" 36 #include "common/events.h" 36 37 #include "base/main.h" 37 38 38 39 #include "backends/saves/default/default-saves.h" … … 273 274 } 274 275 275 276 uint32 OSystem_SDL::getMillis() { 276 return SDL_GetTicks(); 277 uint32 millis = SDL_GetTicks(); 278 getEventManager()->processMillis(millis); 279 return millis; 277 280 } 278 281 279 282 void OSystem_SDL::delayMillis(uint msecs) { … … 354 357 SDL_ShowCursor(SDL_ENABLE); 355 358 SDL_Quit(); 356 359 360 delete getEventManager(); 357 361 exit(0); 358 362 } 359 363 -
common/events.h
167 167 */ 168 168 virtual bool pollEvent(Common::Event &event) = 0; 169 169 170 170 /** Register random source so it can be serialized in game test purposes **/ 171 virtual void registerRandomSource(Common::RandomSource &rnd, const char *name) = 0; 172 173 virtual void processMillis(uint32 &millis) = 0; 174 171 175 /** Return the current key state */ 172 176 virtual Common::Point getMousePos() const = 0; 173 177 -
common/util.h
72 72 public: 73 73 RandomSource(); 74 74 void setSeed(uint32 seed); 75 76 uint32 getSeed() { 77 return _randSeed; 78 } 75 79 76 80 /** 77 81 * Generates a random unsigned integer in the interval [0, max]. -
engines/agi/agi.cpp
546 546 _gameId = g->id; 547 547 548 548 _rnd = new Common::RandomSource(); 549 syst->getEventManager()->registerRandomSource(*_rnd, "agi"); 549 550 550 551 Common::addSpecialDebugLevel(kDebugLevelMain, "Main", "Generic debug level"); 551 552 Common::addSpecialDebugLevel(kDebugLevelResources, "Resources", "Resources debugging"); -
engines/agos/agos.cpp
28 28 #include "common/config-manager.h" 29 29 #include "common/file.h" 30 30 #include "common/system.h" 31 #include "common/events.h" 31 32 32 33 #include "agos/debugger.h" 33 34 #include "agos/intern.h" … … 534 535 File::addDefaultDirectory(_gameDataPath + "SFX"); 535 536 File::addDefaultDirectory(_gameDataPath + "speech"); 536 537 File::addDefaultDirectory(_gameDataPath + "SPEECH"); 538 539 syst->getEventManager()->registerRandomSource(_rnd, "agos"); 537 540 } 538 541 539 542 int AGOSEngine::init() { -
engines/cine/main_loop.cpp
125 125 } 126 126 break; 127 127 case 291: // F10 128 if (!disableSystemMenu && !inMenu) { 128 disableSystemMenu = false; 129 //if (!disableSystemMenu && !inMenu) { 129 130 g_cine->makeSystemMenu(); 130 }131 //} 131 132 break; 132 133 default: 133 134 lastKeyStroke = event.kbd.keycode; -
engines/gob/gob.cpp
25 25 26 26 #include "common/stdafx.h" 27 27 #include "common/endian.h" 28 #include "common/events.h" 28 29 29 30 #include "base/plugins.h" 30 31 #include "common/config-manager.h" … … 88 89 Common::addSpecialDebugLevel(kDebugFileIO, "FileIO", "File Input/Output debug level"); 89 90 Common::addSpecialDebugLevel(kDebugGraphics, "Graphics", "Graphics debug level"); 90 91 Common::addSpecialDebugLevel(kDebugCollisions, "Collisions", "Collisions debug level"); 92 syst->getEventManager()->registerRandomSource(_rnd, "gob"); 91 93 } 92 94 93 95 GobEngine::~GobEngine() { -
engines/kyra/kyra.cpp
121 121 Common::addSpecialDebugLevel(kDebugLevelGUI, "GUI", "GUI debug level"); 122 122 Common::addSpecialDebugLevel(kDebugLevelSequence, "Sequence", "Sequence debug level"); 123 123 Common::addSpecialDebugLevel(kDebugLevelMovie, "Movie", "Movie debug level"); 124 system->getEventManager()->registerRandomSource(_rnd, "kyra"); 124 125 } 125 126 126 127 int KyraEngine::init() { -
engines/kyra/sprites.cpp
28 28 #include "common/stream.h" 29 29 #include "common/util.h" 30 30 #include "common/system.h" 31 #include "common/events.h" 31 32 #include "kyra/screen.h" 32 33 #include "kyra/kyra.h" 33 34 #include "kyra/sprites.h" … … 47 48 _spriteDefStart = 0; 48 49 memset(_drawLayerTable, 0, sizeof(_drawLayerTable)); 49 50 _sceneAnimatorBeaconFlag = 0; 51 system->getEventManager()->registerRandomSource(_rnd, "kyraSprites"); 50 52 } 51 53 52 54 Sprites::~Sprites() { -
engines/lure/hotspots.cpp
542 542 Common::RandomSource rnd; 543 543 int16 xp, yp; 544 544 545 g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots"); 546 545 547 if (_currentActions.isEmpty()) 546 548 _currentActions.addFront(START_WALKING, roomNumber()); 547 549 else … … 2835 2837 Common::RandomSource rnd; 2836 2838 RandomActionType actionType; 2837 2839 uint16 scheduleId; 2840 g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots"); 2841 2838 2842 int actionIndex = rnd.getRandomNumber(set->numActions() - 1); 2839 2843 set->getEntry(actionIndex, actionType, scheduleId); 2840 2844 … … 3023 3027 ValueTableData &fields = Resources::getReference().fieldList(); 3024 3028 Common::RandomSource rnd; 3025 3029 3030 g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots"); 3031 3026 3032 h.handleTalkDialog(); 3027 3033 if (h.frameCtr() > 0) { 3028 3034 h.setFrameCtr(h.frameCtr() - 1); … … 3063 3069 if (h.executeScript()) { 3064 3070 // Script is done - set new script to one of two alternates randomly 3065 3071 Common::RandomSource rnd; 3072 g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots"); 3073 3066 3074 h.setHotspotScript(rnd.getRandomNumber(100) >= 50 ? 0x54 : 0); 3067 3075 h.setFrameCtr(20 + rnd.getRandomNumber(63)); 3068 3076 } … … 3319 3327 Common::RandomSource rnd; 3320 3328 static bool ewanXOffset = false; 3321 3329 3330 g_system->getEventManager()->registerRandomSource(rnd, "lureHotspots"); 3331 3322 3332 h.handleTalkDialog(); 3323 3333 if (h.delayCtr() > 0) { 3324 3334 h.setDelayCtr(h.delayCtr() - 1); -
engines/lure/res.cpp
28 28 #include "lure/scripts.h" 29 29 #include "lure/screen.h" 30 30 #include "common/endian.h" 31 #include "common/events.h" 31 32 32 33 namespace Lure { 33 34 … … 40 41 } 41 42 42 43 Resources::Resources() { 44 g_system->getEventManager()->registerRandomSource(_rnd, "lureResources"); 43 45 int_resources = this; 44 46 reloadData(); 45 47 } -
engines/lure/scripts.cpp
566 566 567 567 void Script::randomToGeneral(uint16 maxVal, uint16 minVal, uint16 v3) { 568 568 Common::RandomSource rnd; 569 g_system->getEventManager()->registerRandomSource(rnd, "lureScripts"); 569 570 uint16 v = minVal + rnd.getRandomNumber(maxVal - minVal); 570 571 Resources::getReference().fieldList().setField(GENERAL, v); 571 572 } -
engines/queen/display.cpp
25 25 26 26 #include "common/stdafx.h" 27 27 #include "common/system.h" 28 #include "common/events.h" 28 29 29 30 #include "graphics/cursorman.h" 30 31 … … 81 82 memset(&_dynalum, 0, sizeof(_dynalum)); 82 83 83 84 setupInkColors(); 85 system->getEventManager()->registerRandomSource(_rnd, "queenDisplay"); 84 86 } 85 87 86 88 Display::~Display() { -
engines/queen/music.cpp
24 24 */ 25 25 26 26 #include "common/stdafx.h" 27 #include "common/system.h" 28 #include "common/events.h" 27 29 #include "queen/music.h" 28 30 #include "queen/queen.h" 29 31 #include "queen/resource.h" … … 48 50 this->open(); 49 51 50 52 _tune = vm->resource()->isDemo() ? Sound::_tuneDemo : Sound::_tune; 53 vm->_system->getEventManager()->registerRandomSource(_rnd, "queenMusic"); 51 54 } 52 55 53 56 MidiMusic::~MidiMusic() { -
engines/queen/queen.cpp
32 32 #include "common/fs.h" 33 33 #include "common/savefile.h" 34 34 #include "common/system.h" 35 #include "common/events.h" 35 36 36 37 #include "queen/queen.h" 37 38 #include "queen/bankman.h" … … 110 111 111 112 QueenEngine::QueenEngine(OSystem *syst) 112 113 : Engine(syst), _debugger(0) { 114 syst->getEventManager()->registerRandomSource(randomizer, "queen"); 113 115 } 114 116 115 117 QueenEngine::~QueenEngine() { -
engines/saga/saga.cpp
28 28 #include "common/file.h" 29 29 #include "common/config-manager.h" 30 30 #include "common/system.h" 31 #include "common/events.h" 31 32 32 33 #include "sound/mixer.h" 33 34 … … 114 115 } 115 116 116 117 _displayClip.left = _displayClip.top = 0; 118 syst->getEventManager()->registerRandomSource(_rnd, "saga"); 117 119 } 118 120 119 121 SagaEngine::~SagaEngine() { -
engines/scumm/scumm.cpp
532 532 // Add debug levels 533 533 for (int i = 0; i < ARRAYSIZE(debugChannels); ++i) 534 534 Common::addSpecialDebugLevel(debugChannels[i].flag, debugChannels[i].channel, debugChannels[i].desc); 535 536 syst->getEventManager()->registerRandomSource(_rnd, "scumm"); 535 537 } 536 538 537 539 -
engines/sky/logic.cpp
26 26 #include "common/stdafx.h" 27 27 #include "common/endian.h" 28 28 #include "common/rect.h" 29 #include "common/events.h" 29 30 30 31 #include "sky/autoroute.h" 31 32 #include "sky/compact.h" … … 71 72 } 72 73 73 74 Logic::Logic(SkyCompact *skyCompact, Screen *skyScreen, Disk *skyDisk, Text *skyText, MusicBase *skyMusic, Mouse *skyMouse, Sound *skySound) { 75 g_system->getEventManager()->registerRandomSource(_rnd, "sky"); 76 74 77 _skyCompact = skyCompact; 75 78 _skyScreen = skyScreen; 76 79 _skyDisk = skyDisk; -
engines/sword1/logic.cpp
26 26 #include "common/stdafx.h" 27 27 #include "common/endian.h" 28 28 #include "common/util.h" 29 #include "common/system.h" 30 #include "common/events.h" 29 31 30 32 #include "sword1/logic.h" 31 33 #include "sword1/text.h" … … 54 56 uint32 Logic::_scriptVars[NUM_SCRIPT_VARS]; 55 57 56 58 Logic::Logic(ObjectMan *pObjMan, ResMan *resMan, Screen *pScreen, Mouse *pMouse, Sound *pSound, Music *pMusic, Menu *pMenu, OSystem *system, Audio::Mixer *mixer) { 59 g_system->getEventManager()->registerRandomSource(_rnd, "sword1"); 60 57 61 _objMan = pObjMan; 58 62 _resMan = resMan; 59 63 _screen = pScreen; -
engines/sword1/sound.cpp
27 27 #include "common/endian.h" 28 28 29 29 #include "common/util.h" 30 #include "common/system.h" 31 #include "common/events.h" 30 32 31 33 #include "sword1/sound.h" 32 34 #include "sword1/resman.h" … … 43 45 #define SPEECH_FLAGS (Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_LITTLE_ENDIAN) 44 46 45 47 Sound::Sound(const char *searchPath, Audio::Mixer *mixer, ResMan *pResMan) { 48 g_system->getEventManager()->registerRandomSource(_rnd, "sword1sound"); 46 49 strcpy(_filePath, searchPath); 47 50 _mixer = mixer; 48 51 _resMan = pResMan; -
engines/sword2/sword2.cpp
209 209 _gameSpeed = 1; 210 210 211 211 _quit = false; 212 syst->getEventManager()->registerRandomSource(_rnd, "sword2"); 212 213 } 213 214 214 215 Sword2Engine::~Sword2Engine() { -
engines/touche/touche.cpp
73 73 Common::addSpecialDebugLevel(kDebugResource, "Resource", "Resource debug level"); 74 74 Common::addSpecialDebugLevel(kDebugOpcodes, "Opcodes", "Opcodes debug level"); 75 75 Common::addSpecialDebugLevel(kDebugUserIntf, "UserIntf", "UserInterface debug level"); 76 system->getEventManager()->registerRandomSource(_rnd, "touche"); 76 77 } 77 78 78 79 ToucheEngine::~ToucheEngine() {