[Scummvm-cvs-logs] SF.net SVN: scummvm:[41646] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Thu Jun 18 23:47:10 CEST 2009
Revision: 41646
http://scummvm.svn.sourceforge.net/scummvm/?rev=41646&view=rev
Author: lordhoto
Date: 2009-06-18 21:47:10 +0000 (Thu, 18 Jun 2009)
Log Message:
-----------
Replaced "getRandomNumberSpecial" be RandomSource usage. (This is needed for proper event recording, also the probability for generated numbers is actually nearly the same)
Modified Paths:
--------------
scummvm/trunk/engines/kyra/lol.cpp
scummvm/trunk/engines/kyra/lol.h
scummvm/trunk/engines/kyra/scene_lol.cpp
scummvm/trunk/engines/kyra/sprites_lol.cpp
Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp 2009-06-18 21:08:51 UTC (rev 41645)
+++ scummvm/trunk/engines/kyra/lol.cpp 2009-06-18 21:47:10 UTC (rev 41646)
@@ -1797,32 +1797,6 @@
}
}
-uint8 LoLEngine::getRandomNumberSpecial() {
- uint8 a = _rndSpecial & 0xff;
- uint8 b = (_rndSpecial >> 8) & 0xff;
- uint8 c = (_rndSpecial >> 16) & 0xff;
-
- a >>= 1;
-
- uint as = a & 1;
- uint bs = (b >> 7) ? 0 : 1;
- uint cs = c >> 7;
-
- a >>= 1;
- c = (c << 1) | as;
- b = (b << 1) | cs;
-
- a -= ((_rndSpecial & 0xff) - bs);
- as = a & 1;
- a >>= 1;
-
- a = ((_rndSpecial & 0xff) >> 1) | (as << 7);
-
- _rndSpecial = (_rndSpecial & 0xff000000) | (c << 16) | (b << 8) | a;
-
- return a ^ b;
-}
-
void LoLEngine::updateEnvironmentalSfx(int soundId) {
snd_processEnvironmentalSoundEffect(soundId, _currentBlock);
}
Modified: scummvm/trunk/engines/kyra/lol.h
===================================================================
--- scummvm/trunk/engines/kyra/lol.h 2009-06-18 21:08:51 UTC (rev 41645)
+++ scummvm/trunk/engines/kyra/lol.h 2009-06-18 21:47:10 UTC (rev 41646)
@@ -1303,7 +1303,6 @@
// misc
void delay(uint32 millis, bool doUpdate = false, bool isMainLoop = false);
- uint8 getRandomNumberSpecial();
uint8 _compassBroken;
uint8 _drainMagic;
Modified: scummvm/trunk/engines/kyra/scene_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_lol.cpp 2009-06-18 21:08:51 UTC (rev 41645)
+++ scummvm/trunk/engines/kyra/scene_lol.cpp 2009-06-18 21:47:10 UTC (rev 41646)
@@ -604,7 +604,7 @@
if (_compassStep)
_compassStep -= (((ABS(_compassStep) >> 4) + 2) * dir);
- int16 d = _compassBroken ? ((int8)getRandomNumberSpecial() - _compassDirection) : (_currentDirection << 6) - _compassDirection;
+ int16 d = _compassBroken ? (int8(_rnd.getRandomNumber(255)) - _compassDirection) : (_currentDirection << 6) - _compassDirection;
if (d <= -128)
d += 256;
if (d >= 128)
@@ -1261,8 +1261,8 @@
while (endTime > _system->getMillis()) {
uint32 delayTimer = _system->getMillis() + 2 * _tickLength;
- int s1 = width ? (getRandomNumberSpecial() % (width << 1)) - width : 0;
- int s2 = height ? (getRandomNumberSpecial() % (height << 1)) - height : 0;
+ int s1 = width ? (_rnd.getRandomNumber(255) % (width << 1)) - width : 0;
+ int s2 = height ? (_rnd.getRandomNumber(255) % (height << 1)) - height : 0;
int x1, y1, x2, y2, w, h;
if (s1 >= 0) {
Modified: scummvm/trunk/engines/kyra/sprites_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sprites_lol.cpp 2009-06-18 21:08:51 UTC (rev 41645)
+++ scummvm/trunk/engines/kyra/sprites_lol.cpp 2009-06-18 21:47:10 UTC (rev 41646)
@@ -1092,7 +1092,7 @@
setMonsterMode(monster, 7);
if ((monster->mode != 11) && (monster->mode != 14)) {
- if (!(getRandomNumberSpecial() & 3)) {
+ if (!(_rnd.getRandomNumber(255) & 3)) {
monster->shiftStep = (++monster->shiftStep) & 0x0f;
checkSceneUpdateNeed(monster->block);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list