DREAMWEB: Silenced warnings, applied coding conventions

- Silenced a lot of signed/unsigned MSVC warnings
- Changed (rarely used) "not" keywords to "!"
This commit is contained in:
Filippos Karapetis 2011-10-15 12:21:02 +03:00
parent 63b3db2753
commit 4062a9653d
2 changed files with 15 additions and 14 deletions

View file

@ -243,7 +243,7 @@ void DreamGenContext::aboutturn(Sprite *sprite) {
data.byte(kFacing) = (data.byte(kFacing) + 1) & 7; data.byte(kFacing) = (data.byte(kFacing) + 1) & 7;
sprite->b29 = 0; sprite->b29 = 0;
} else { } else {
data.byte(kTurndirection) = -1; data.byte(kTurndirection) = (uint8)-1;
data.byte(kFacing) = (data.byte(kFacing) - 1) & 7; data.byte(kFacing) = (data.byte(kFacing) - 1) & 7;
sprite->b29 = 0; sprite->b29 = 0;
} }
@ -295,17 +295,17 @@ void DreamGenContext::random(Sprite *sprite, SetObject *objData) {
} }
void DreamGenContext::doorway(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(kDoorcheck2) = 10;
data.byte(kDoorcheck3) = -30; data.byte(kDoorcheck3) = (uint8)-30;
data.byte(kDoorcheck4) = 10; data.byte(kDoorcheck4) = 10;
dodoor(sprite, objData); dodoor(sprite, objData);
} }
void DreamGenContext::widedoor(Sprite *sprite, SetObject *objData) { void DreamGenContext::widedoor(Sprite *sprite, SetObject *objData) {
data.byte(kDoorcheck1) = -24; data.byte(kDoorcheck1) = (uint8)-24;
data.byte(kDoorcheck2) = 24; data.byte(kDoorcheck2) = 24;
data.byte(kDoorcheck3) = -30; data.byte(kDoorcheck3) = (uint8)-30;
data.byte(kDoorcheck4) = 24; data.byte(kDoorcheck4) = 24;
dodoor(sprite, objData); dodoor(sprite, objData);
} }
@ -782,7 +782,7 @@ void DreamGenContext::madman() {
ax = pop(); ax = pop();
bx = pop(); bx = pop();
es = pop(); es = pop();
data.byte(kCombatcount) = -1; data.byte(kCombatcount) = (uint8)-1;
data.byte(kSpeechcount) = 0; data.byte(kSpeechcount) = 0;
} }
++ax; ++ax;
@ -811,7 +811,7 @@ void DreamGenContext::madman() {
else { else {
if (data.byte(kLastweapon) == 8) { if (data.byte(kLastweapon) == 8) {
data.byte(kCombatcount) = isCD() ? 72 : 70; data.byte(kCombatcount) = isCD() ? 72 : 70;
data.byte(kLastweapon) = -1; data.byte(kLastweapon) = (uint8)-1;
data.byte(kMadmanflag) = 1; data.byte(kMadmanflag) = 1;
ax = 67; ax = 67;
} }

View file

@ -127,7 +127,7 @@ void DreamGenContext::dreamweb() {
data.byte(kLastflag) = 32; data.byte(kLastflag) = 32;
startup1(); startup1();
data.byte(kVolumeto) = 0; data.byte(kVolumeto) = 0;
data.byte(kVolumedirection) = -1; data.byte(kVolumedirection) = (uint8)-1;
data.byte(kCommandtype) = 255; data.byte(kCommandtype) = 255;
} }
@ -769,7 +769,7 @@ void DreamGenContext::startloading(const Room *room) {
data.byte(kCounttoopen) = room->countToOpen; data.byte(kCounttoopen) = room->countToOpen;
data.byte(kLiftpath) = room->liftPath; data.byte(kLiftpath) = room->liftPath;
data.byte(kDoorpath) = room->doorPath; data.byte(kDoorpath) = room->doorPath;
data.byte(kLastweapon) = -1; data.byte(kLastweapon) = (uint8)-1;
al = room->b27; al = room->b27;
push(ax); push(ax);
al = room->b31; al = room->b31;
@ -867,7 +867,7 @@ void DreamGenContext::startloading(const Room *room) {
autoappear(); autoappear();
al = data.byte(kNewlocation); al = data.byte(kNewlocation);
getroomdata(); getroomdata();
data.byte(kLastweapon) = -1; data.byte(kLastweapon) = (uint8)-1;
data.byte(kMandead) = 0; data.byte(kMandead) = 0;
data.word(kLookcounter) = 160; data.word(kLookcounter) = 160;
data.byte(kNewlocation) = 255; data.byte(kNewlocation) = 255;
@ -973,7 +973,7 @@ void DreamGenContext::commandonly(uint8 command) {
} }
void DreamGenContext::checkifperson() { void DreamGenContext::checkifperson() {
flags._z = not checkifperson(al, ah); flags._z = !checkifperson(al, ah);
} }
bool DreamGenContext::checkifperson(uint8 x, uint8 y) { bool DreamGenContext::checkifperson(uint8 x, uint8 y) {
@ -1007,7 +1007,7 @@ bool DreamGenContext::checkifperson(uint8 x, uint8 y) {
} }
void DreamGenContext::checkiffree() { void DreamGenContext::checkiffree() {
flags._z = not checkiffree(al, ah); flags._z = !checkiffree(al, ah);
} }
bool DreamGenContext::checkiffree(uint8 x, uint8 y) { bool DreamGenContext::checkiffree(uint8 x, uint8 y) {
@ -1031,7 +1031,7 @@ bool DreamGenContext::checkiffree(uint8 x, uint8 y) {
} }
void DreamGenContext::checkifex() { void DreamGenContext::checkifex() {
flags._z = not checkifex(al, ah); flags._z = !checkifex(al, ah);
} }
bool DreamGenContext::checkifex(uint8 x, uint8 y) { bool DreamGenContext::checkifex(uint8 x, uint8 y) {
@ -1807,7 +1807,8 @@ void DreamGenContext::hangonp(uint16 count) {
showpointer(); showpointer();
vsync(); vsync();
dumppointer(); 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(); delpointer();
readmouse(); readmouse();
animpointer(); animpointer();