Ticket #8693: TEST6.patch
File TEST6.patch, 24.5 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 event.type = (Common::EventType)inFile->readUint32LE(); 40 41 switch(event.type) { 42 case Common::EVENT_KEYDOWN: 43 case Common::EVENT_KEYUP: 44 event.kbd.keycode = inFile->readSint32LE(); 45 event.kbd.ascii = inFile->readUint16LE(); 46 event.kbd.flags = inFile->readByte(); 47 break; 48 case Common::EVENT_MOUSEMOVE: 49 case Common::EVENT_LBUTTONDOWN: 50 case Common::EVENT_LBUTTONUP: 51 case Common::EVENT_RBUTTONDOWN: 52 case Common::EVENT_RBUTTONUP: 53 case Common::EVENT_WHEELUP: 54 case Common::EVENT_WHEELDOWN: 55 event.mouse.x = inFile->readSint16LE(); 56 event.mouse.y = inFile->readSint16LE(); 57 break; 58 } 59 } 60 61 void writeRecord(Common::OutSaveFile *outFile, uint32 diff, Common::Event &event) { 62 outFile->writeUint32LE(diff); 63 64 outFile->writeUint32LE((uint32)event.type); 65 66 switch(event.type) { 67 case Common::EVENT_KEYDOWN: 68 case Common::EVENT_KEYUP: 69 outFile->writeSint32LE(event.kbd.keycode); 70 outFile->writeUint16LE(event.kbd.ascii); 71 outFile->writeByte(event.kbd.flags); 72 break; 73 case Common::EVENT_MOUSEMOVE: 74 case Common::EVENT_LBUTTONDOWN: 75 case Common::EVENT_LBUTTONUP: 76 case Common::EVENT_RBUTTONDOWN: 77 case Common::EVENT_RBUTTONUP: 78 case Common::EVENT_WHEELUP: 79 case Common::EVENT_WHEELDOWN: 80 outFile->writeSint16LE(event.mouse.x); 81 outFile->writeSint16LE(event.mouse.y); 82 break; 83 } 84 } 85 32 86 DefaultEventManager::DefaultEventManager(OSystem *boss) : 33 87 _boss(boss), 34 88 _buttonState(0), … … 37 91 38 92 assert(_boss); 39 93 94 _recordFile = NULL; 95 _recordTimeFile = NULL; 96 _playbackFile = NULL; 97 _playbackTimeFile = NULL; 98 _timeMutex = _boss->createMutex(); 99 _recorderMutex = _boss->createMutex(); 100 101 _eventCount = 0; 102 _lastEventCount = 0; 103 _lastMillis = 0; 104 105 Common::String recordModeString = ConfMan.get("record_mode"); 106 if (recordModeString.compareToIgnoreCase("record") == 0) { 107 _recordMode = kRecorderRecord; 108 } else { 109 if (recordModeString.compareToIgnoreCase("playback") == 0) { 110 _recordMode = kRecorderPlayback; 111 } else { 112 _recordMode = kPassthrough; 113 } 114 } 115 116 _recordFileName = ConfMan.get("record_file_name"); 117 if (_recordFileName.empty()) { 118 _recordFileName = "record.bin"; 119 } 120 _recordTempFileName = ConfMan.get("record_temp_file_name"); 121 if (_recordTempFileName.empty()) { 122 _recordTempFileName = "record.tmp"; 123 } 124 _recordTimeFileName = ConfMan.get("record_time_file_name"); 125 if (_recordTimeFileName.empty()) { 126 _recordTimeFileName = "record.time"; 127 } 128 40 129 // Reset key repeat 41 130 _currentKeyDown.keycode = 0; 131 132 // recorder stuff 133 if (_recordMode == kRecorderRecord) { 134 _recordCount = 0; 135 _recordTimeCount = 0; 136 _recordFile = _boss->getSavefileManager()->openForSaving(_recordTempFileName.c_str()); 137 _recordTimeFile = _boss->getSavefileManager()->openForSaving(_recordTimeFileName.c_str()); 138 _recordSubtitles = ConfMan.getBool("subtitles"); 139 } 140 141 uint32 sign; 142 uint32 version; 143 uint32 randomSourceCount; 144 if (_recordMode == kRecorderPlayback) { 145 _playbackCount = 0; 146 _playbackTimeCount = 0; 147 _playbackFile = _boss->getSavefileManager()->openForLoading(_recordFileName.c_str()); 148 _playbackTimeFile = _boss->getSavefileManager()->openForLoading(_recordTimeFileName.c_str()); 149 sign = _playbackFile->readUint32LE(); 150 if (sign != RECORD_SIGNATURE) { 151 error("Unknown record file signature"); 152 } 153 version = _playbackFile->readUint32LE(); 154 155 // conf vars 156 ConfMan.setBool("subtitles", _playbackFile->readByte() != 0); 157 158 _recordCount = _playbackFile->readUint32LE(); 159 _recordTimeCount = _playbackFile->readUint32LE(); 160 randomSourceCount = _playbackFile->readUint32LE(); 161 for (uint i = 0; i < randomSourceCount; ++i) { 162 RandomSourceRecord rec; 163 rec.name = ""; 164 uint32 sLen = _playbackFile->readUint32LE(); 165 for (uint j = 0; j < sLen; ++j) { 166 char c = _playbackFile->readSByte(); 167 rec.name += c; 168 } 169 rec.seed = _playbackFile->readUint32LE(); 170 _randomSourceRecords.push_back(rec); 171 } 172 173 _hasPlaybackEvent = false; 174 } 42 175 } 43 176 177 DefaultEventManager::~DefaultEventManager() { 178 _boss->lockMutex(_timeMutex); 179 _boss->lockMutex(_recorderMutex); 180 _recordMode = kPassthrough; 181 _boss->unlockMutex(_timeMutex); 182 _boss->unlockMutex(_recorderMutex); 183 184 if (_playbackFile != NULL) { 185 delete _playbackFile; 186 } 187 if (_playbackTimeFile != NULL) { 188 delete _playbackTimeFile; 189 } 190 191 if (_recordFile != NULL) { 192 _recordFile->finalize(); 193 delete _recordFile; 194 _recordTimeFile->finalize(); 195 delete _recordTimeFile; 196 197 _playbackFile = _boss->getSavefileManager()->openForLoading(_recordTempFileName.c_str()); 198 199 _recordFile = _boss->getSavefileManager()->openForSaving(_recordFileName.c_str()); 200 _recordFile->writeUint32LE(RECORD_SIGNATURE); 201 _recordFile->writeUint32LE(RECORD_VERSION); 202 203 // conf vars 204 _recordFile->writeByte(_recordSubtitles ? 1 : 0); 205 206 _recordFile->writeUint32LE(_recordCount); 207 _recordFile->writeUint32LE(_recordTimeCount); 208 209 _recordFile->writeUint32LE(_randomSourceRecords.size()); 210 for (uint i = 0; i < _randomSourceRecords.size(); ++i) { 211 _recordFile->writeUint32LE(_randomSourceRecords[i].name.size()); 212 _recordFile->writeString(_randomSourceRecords[i].name); 213 _recordFile->writeUint32LE(_randomSourceRecords[i].seed); 214 } 215 216 for (uint i = 0; i < _recordCount; ++i) { 217 uint32 tempDiff; 218 Common::Event tempEvent; 219 readRecord(_playbackFile, tempDiff, tempEvent); 220 writeRecord(_recordFile, tempDiff, tempEvent); 221 } 222 223 _recordFile->finalize(); 224 delete _recordFile; 225 delete _playbackFile; 226 227 //TODO: remove recordTempFileName'ed file 228 } 229 _boss->deleteMutex(_timeMutex); 230 _boss->deleteMutex(_recorderMutex); 231 } 232 233 bool DefaultEventManager::playback(Common::Event &event) { 234 235 if (!_hasPlaybackEvent) { 236 if (_recordCount > _playbackCount) { 237 readRecord(_playbackFile, (uint32&)_playbackDiff, _playbackEvent); 238 _playbackCount++; 239 _hasPlaybackEvent = true; 240 } 241 } 242 243 if (_hasPlaybackEvent) { 244 if (_playbackDiff <= (_eventCount - _lastEventCount)) { 245 switch(_playbackEvent.type) { 246 case Common::EVENT_MOUSEMOVE: 247 case Common::EVENT_LBUTTONDOWN: 248 case Common::EVENT_LBUTTONUP: 249 case Common::EVENT_RBUTTONDOWN: 250 case Common::EVENT_RBUTTONUP: 251 case Common::EVENT_WHEELUP: 252 case Common::EVENT_WHEELDOWN: 253 _boss->warpMouse(_playbackEvent.mouse.x, _playbackEvent.mouse.y); 254 break; 255 } 256 event = _playbackEvent; 257 _hasPlaybackEvent = false; 258 _lastEventCount = _eventCount; 259 return true; 260 } 261 } 262 263 return false; 264 } 265 266 void DefaultEventManager::record(Common::Event &event) { 267 writeRecord(_recordFile, _eventCount - _lastEventCount, event); 268 269 _recordCount++; 270 _lastEventCount = _eventCount; 271 } 272 273 void DefaultEventManager::registerRandomSource(Common::RandomSource &rnd, const char *name) { 274 275 if (_recordMode == kRecorderRecord) { 276 RandomSourceRecord rec; 277 rec.name = name; 278 rec.seed = rnd.getSeed(); 279 _randomSourceRecords.push_back(rec); 280 } 281 282 if (_recordMode == kRecorderPlayback) { 283 for (uint i = 0; i < _randomSourceRecords.size(); ++i) { 284 if (_randomSourceRecords[i].name == name) { 285 rnd.setSeed(_randomSourceRecords[i].seed); 286 _randomSourceRecords.remove_at(i); 287 break; 288 } 289 } 290 } 291 } 292 293 void DefaultEventManager::processMillis(uint32 &millis) { 294 uint32 d; 295 if (_recordMode == kPassthrough) { 296 return; 297 } 298 299 _boss->lockMutex(_timeMutex); 300 if (_recordMode == kRecorderRecord) { 301 //Simple RLE compression 302 d = millis - _lastMillis; 303 if (d >= 0xff) { 304 _recordTimeFile->writeByte(0xff); 305 _recordTimeFile->writeUint32LE(d); 306 } else { 307 _recordTimeFile->writeByte(d); 308 } 309 _recordTimeCount++; 310 } 311 312 if (_recordMode == kRecorderPlayback) { 313 if (_recordTimeCount > _playbackTimeCount) { 314 d = _playbackTimeFile->readByte(); 315 if (d == 0xff) { 316 d = _playbackTimeFile->readUint32LE(); 317 } 318 millis = _lastMillis + d; 319 _playbackTimeCount++; 320 } 321 } 322 _lastMillis = millis; 323 _boss->unlockMutex(_timeMutex); 324 } 325 44 326 bool DefaultEventManager::pollEvent(Common::Event &event) { 45 327 uint32 time = _boss->getMillis(); 46 328 bool result; 47 329 330 48 331 result = _boss->pollEvent(event); 49 332 333 if (_recordMode != kPassthrough) { 334 335 _boss->lockMutex(_recorderMutex); 336 _eventCount++; 337 338 if (_recordMode == kRecorderPlayback) { 339 if (event.type != Common::EVENT_QUIT) { 340 result = playback(event); 341 } 342 } else { 343 if (_recordMode == kRecorderRecord) { 344 if (result) { 345 record(event); 346 } 347 } 348 } 349 _boss->unlockMutex(_recorderMutex); 350 } 351 50 352 if (result) { 51 353 event.synthetic = false; 52 354 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 volatile uint32 _recordCount; 62 volatile uint32 _lastRecordEvent; 63 volatile uint32 _recordTimeCount; 64 Common::OutSaveFile *_recordFile; 65 Common::OutSaveFile *_recordTimeFile; 66 Common::MutexRef _timeMutex; 67 Common::MutexRef _recorderMutex; 68 volatile uint32 _lastMillis; 69 70 volatile uint32 _playbackCount; 71 volatile uint32 _playbackDiff; 72 volatile bool _hasPlaybackEvent; 73 volatile uint32 _playbackTimeCount; 74 Common::Event _playbackEvent; 75 Common::InSaveFile *_playbackFile; 76 Common::InSaveFile *_playbackTimeFile; 77 78 volatile uint32 _eventCount; 79 volatile uint32 _lastEventCount; 80 81 enum RecordMode { 82 kPassthrough = 0, 83 kRecorderRecord = 1, 84 kRecorderPlayback = 2 85 }; 86 volatile RecordMode _recordMode; 87 Common::String _recordFileName; 88 Common::String _recordTempFileName; 89 Common::String _recordTimeFileName; 90 52 91 // for continuous events (keyDown) 53 92 enum { 54 93 kKeyRepeatInitialDelay = 400, … … 62 101 } _currentKeyDown; 63 102 uint32 _keyRepeatTime; 64 103 104 void record(Common::Event &event); 105 bool playback(Common::Event &event); 65 106 public: 66 107 DefaultEventManager(OSystem *boss); 108 ~DefaultEventManager(); 67 109 68 110 virtual bool pollEvent(Common::Event &event); 111 virtual void registerRandomSource(Common::RandomSource &rnd, const char *name); 112 virtual void processMillis(uint32 &millis); 69 113 70 114 virtual Common::Point getMousePos() const { return _mousePos; } 71 115 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() {