Skip to content

Commit

Permalink
DREAMWEB: 'checkSpeed' takes a reference
Browse files Browse the repository at this point in the history
  • Loading branch information
tramboi committed Dec 4, 2011
1 parent 2801eaf commit 112921a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions engines/dreamweb/people.cpp
Expand Up @@ -137,7 +137,7 @@ void DreamGenContext::madmanText() {

void DreamGenContext::madman(ReelRoutine &routine) {
data.word(kWatchingtime) = 2;
if (checkSpeed(&routine)) {
if (checkSpeed(routine)) {
uint16 newReelPointer = routine.reelPointer();
if (newReelPointer >= 364) {
data.byte(kMandead) = 2;
Expand Down Expand Up @@ -207,21 +207,21 @@ void DreamGenContext::addToPeopleList(ReelRoutine *routine) {

void DreamGenContext::checkSpeed() {
ReelRoutine *routine = (ReelRoutine *)es.ptr(bx, sizeof(ReelRoutine));
flags._z = checkSpeed(routine);
flags._z = checkSpeed(*routine);
}

bool DreamGenContext::checkSpeed(ReelRoutine *routine) {
bool DreamGenContext::checkSpeed(ReelRoutine &routine) {
if (data.byte(kLastweapon) != (uint8)-1)
return true;
++routine->counter;
if (routine->counter != routine->period)
++routine.counter;
if (routine.counter != routine.period)
return false;
routine->counter = 0;
routine.counter = 0;
return true;
}

void DreamGenContext::sparkyDrip(ReelRoutine &routine) {
if (checkSpeed(&routine))
if (checkSpeed(routine))
playChannel0(14, 0);
}

Expand All @@ -231,7 +231,7 @@ void DreamGenContext::otherSmoker(ReelRoutine &routine) {
}

void DreamGenContext::gamer(ReelRoutine &routine) {
if (checkSpeed(&routine)) {
if (checkSpeed(routine)) {
uint8 v;
do {
v = 20 + engine->randomNumber() % 5;
Expand Down Expand Up @@ -263,7 +263,7 @@ void DreamGenContext::maleFan(ReelRoutine &routine) {
void DreamGenContext::sparky(ReelRoutine &routine) {
if (data.word(kCard1money))
routine.b7 = 3;
if (checkSpeed(&routine)) {
if (checkSpeed(routine)) {
if (routine.reelPointer() != 34) {
if (engine->randomNumber() < 30)
routine.incReelPointer();
Expand All @@ -288,7 +288,7 @@ void DreamGenContext::rockstar(ReelRoutine &routine) {
showGameReel(&routine);
return;
}
if (checkSpeed(&routine)) {
if (checkSpeed(routine)) {
uint16 nextReelPointer = routine.reelPointer() + 1;
if (nextReelPointer == 118) {
data.byte(kMandead) = 2;
Expand Down Expand Up @@ -333,7 +333,7 @@ void DreamGenContext::smokeBloke(ReelRoutine &routine) {
if (routine.b7 & 128)
setLocation(5);
}
if (checkSpeed(&routine)) {
if (checkSpeed(routine)) {
if (routine.reelPointer() == 100) {
if (engine->randomNumber() < 30)
routine.incReelPointer();
Expand Down
2 changes: 1 addition & 1 deletion engines/dreamweb/stubs.h
Expand Up @@ -386,7 +386,7 @@
void drawFloor();
void allocateBuffers();
void workToScreenM();
bool checkSpeed(ReelRoutine *routine);
bool checkSpeed(ReelRoutine &routine);
void checkSpeed();
void sparkyDrip(ReelRoutine &routine);
void otherSmoker(ReelRoutine &routine);
Expand Down

0 comments on commit 112921a

Please sign in to comment.