Skip to content

Commit

Permalink
DREAMWEB: Silenced warnings, applied coding conventions
Browse files Browse the repository at this point in the history
- Silenced a lot of signed/unsigned MSVC warnings
- Changed (rarely used) "not" keywords to "!"
  • Loading branch information
bluegr committed Oct 15, 2011
1 parent 63b3db2 commit 4062a96
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
14 changes: 7 additions & 7 deletions engines/dreamweb/sprite.cpp
Expand Up @@ -243,7 +243,7 @@ void DreamGenContext::aboutturn(Sprite *sprite) {
data.byte(kFacing) = (data.byte(kFacing) + 1) & 7;
sprite->b29 = 0;
} else {
data.byte(kTurndirection) = -1;
data.byte(kTurndirection) = (uint8)-1;
data.byte(kFacing) = (data.byte(kFacing) - 1) & 7;
sprite->b29 = 0;
}
Expand Down Expand Up @@ -295,17 +295,17 @@ void DreamGenContext::random(Sprite *sprite, SetObject *objData) {
}

void DreamGenContext::doorway(Sprite *sprite, SetObject *objData) {
data.byte(kDoorcheck1) = -24;
data.byte(kDoorcheck1) = (uint8)-24;
data.byte(kDoorcheck2) = 10;
data.byte(kDoorcheck3) = -30;
data.byte(kDoorcheck3) = (uint8)-30;
data.byte(kDoorcheck4) = 10;
dodoor(sprite, objData);
}

void DreamGenContext::widedoor(Sprite *sprite, SetObject *objData) {
data.byte(kDoorcheck1) = -24;
data.byte(kDoorcheck1) = (uint8)-24;
data.byte(kDoorcheck2) = 24;
data.byte(kDoorcheck3) = -30;
data.byte(kDoorcheck3) = (uint8)-30;
data.byte(kDoorcheck4) = 24;
dodoor(sprite, objData);
}
Expand Down Expand Up @@ -782,7 +782,7 @@ void DreamGenContext::madman() {
ax = pop();
bx = pop();
es = pop();
data.byte(kCombatcount) = -1;
data.byte(kCombatcount) = (uint8)-1;
data.byte(kSpeechcount) = 0;
}
++ax;
Expand Down Expand Up @@ -811,7 +811,7 @@ void DreamGenContext::madman() {
else {
if (data.byte(kLastweapon) == 8) {
data.byte(kCombatcount) = isCD() ? 72 : 70;
data.byte(kLastweapon) = -1;
data.byte(kLastweapon) = (uint8)-1;
data.byte(kMadmanflag) = 1;
ax = 67;
}
Expand Down
15 changes: 8 additions & 7 deletions engines/dreamweb/stubs.cpp
Expand Up @@ -127,7 +127,7 @@ void DreamGenContext::dreamweb() {
data.byte(kLastflag) = 32;
startup1();
data.byte(kVolumeto) = 0;
data.byte(kVolumedirection) = -1;
data.byte(kVolumedirection) = (uint8)-1;
data.byte(kCommandtype) = 255;

}
Expand Down Expand Up @@ -769,7 +769,7 @@ void DreamGenContext::startloading(const Room *room) {
data.byte(kCounttoopen) = room->countToOpen;
data.byte(kLiftpath) = room->liftPath;
data.byte(kDoorpath) = room->doorPath;
data.byte(kLastweapon) = -1;
data.byte(kLastweapon) = (uint8)-1;
al = room->b27;
push(ax);
al = room->b31;
Expand Down Expand Up @@ -867,7 +867,7 @@ void DreamGenContext::startloading(const Room *room) {
autoappear();
al = data.byte(kNewlocation);
getroomdata();
data.byte(kLastweapon) = -1;
data.byte(kLastweapon) = (uint8)-1;
data.byte(kMandead) = 0;
data.word(kLookcounter) = 160;
data.byte(kNewlocation) = 255;
Expand Down Expand Up @@ -973,7 +973,7 @@ void DreamGenContext::commandonly(uint8 command) {
}

void DreamGenContext::checkifperson() {
flags._z = not checkifperson(al, ah);
flags._z = !checkifperson(al, ah);
}

bool DreamGenContext::checkifperson(uint8 x, uint8 y) {
Expand Down Expand Up @@ -1007,7 +1007,7 @@ bool DreamGenContext::checkifperson(uint8 x, uint8 y) {
}

void DreamGenContext::checkiffree() {
flags._z = not checkiffree(al, ah);
flags._z = !checkiffree(al, ah);
}

bool DreamGenContext::checkiffree(uint8 x, uint8 y) {
Expand All @@ -1031,7 +1031,7 @@ bool DreamGenContext::checkiffree(uint8 x, uint8 y) {
}

void DreamGenContext::checkifex() {
flags._z = not checkifex(al, ah);
flags._z = !checkifex(al, ah);
}

bool DreamGenContext::checkifex(uint8 x, uint8 y) {
Expand Down Expand Up @@ -1807,7 +1807,8 @@ void DreamGenContext::hangonp(uint16 count) {
showpointer();
vsync();
dumppointer();
for (size_t i = 0; i < count * 3; ++i) {
uint32 counter = count; // silence a signed/unsigned MSVC warning below
for (uint32 i = 0; i < counter * 3; ++i) {
delpointer();
readmouse();
animpointer();
Expand Down

0 comments on commit 4062a96

Please sign in to comment.