From efae5f30ea94f255e755bf0802cc88c97501d0b9 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Wed, 31 Aug 2005 20:54:51 +0000 Subject: cleanup svn-id: r18727 --- scumm/actor.cpp | 2 +- scumm/intern.h | 4 ++-- scumm/script_v100he.cpp | 18 +++++++++--------- scumm/script_v80he.cpp | 22 ++++++++++------------ scumm/script_v90he.cpp | 46 ++++++++++++++++++++++------------------------ 5 files changed, 44 insertions(+), 48 deletions(-) diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 444dcdbfb4..fc5f8961e1 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -173,7 +173,7 @@ void Actor::setActorWalkSpeed(uint newSpeedX, uint newSpeedY) { int ScummEngine::getAngleFromPos(int x, int y) const { if (_gameId == GID_DIG || _gameId == GID_CMI) { double temp = atan2((double)x, (double)-y); - return normalizeAngle((int)(temp * 180 / 3.1415926535)); + return normalizeAngle((int)(temp * 180 / PI)); } else { if (ABS(y) * 2 < ABS(x)) { if (x > 0) diff --git a/scumm/intern.h b/scumm/intern.h index a42a936433..3c01f39ef5 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -1100,9 +1100,9 @@ protected: struct VideoParameters { byte filename[260]; int32 status; - int32 unk1; + int32 flags; int32 unk2; - int32 unk3; + int32 wizResNum; }; VideoParameters _videoParams; diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp index 53bb136d23..d6159848cc 100644 --- a/scumm/script_v100he.cpp +++ b/scumm/script_v100he.cpp @@ -2158,28 +2158,28 @@ void ScummEngine_v100he::o100_videoOps() { _videoParams.status = 19; break; case 40: - _videoParams.unk3 = pop(); - if (_videoParams.unk1) - _videoParams.unk1 |= 2; + _videoParams.wizResNum = pop(); + if (_videoParams.wizResNum) + _videoParams.flags |= 2; break; case 47: copyScriptString(_videoParams.filename, sizeof(_videoParams.filename)); _videoParams.status = 47; break; case 67: - _videoParams.unk1 |= pop(); + _videoParams.flags |= pop(); break; case 92: if (_videoParams.status == 47) { // Start video - if (_videoParams.unk1 == 0) - _videoParams.unk1 = 4; + if (_videoParams.flags == 0) + _videoParams.flags = 4; - if (_videoParams.unk1 == 2) { - // result = startVideo(_videoParams.filename, _videoParams.unk1, _videoParams.unk3); + if (_videoParams.flags == 2) { + // result = startVideo(_videoParams.filename, _videoParams.flags, _videoParams.wizResNum); // VAR(119) = result; } else { - // result = startVideo(_videoParams.filename, _videoParams.unk1); + // result = startVideo(_videoParams.filename, _videoParams.flags); // VAR(119) = result; } } else if (_videoParams.status == 19) { diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp index b0960a0101..ec06ec469f 100644 --- a/scumm/script_v80he.cpp +++ b/scumm/script_v80he.cpp @@ -406,14 +406,12 @@ void ScummEngine_v80he::o80_getFileSize() { copyScriptString(filename, sizeof(filename)); Common::File f; - if (f.open((char *)filename) == false) { + if (!f.open((char *)filename)) { push(-1); - return; + } else { + push(f.size()); + f.close(); } - - f.seek(0, SEEK_END); - push(f.pos()); - f.close(); } void ScummEngine_v80he::o80_stringToInt() { @@ -647,17 +645,17 @@ void ScummEngine_v80he::drawLine(int x1, int y1, int x, int y, int step, int typ drawPixel(x, y, id); } - int var_C = 0; + int stepCount = 0; int tmpX = 0; int tmpY = 0; for (int i = 0; i <= maxDist; i++) { tmpX += absDX; tmpY += absDY; - int eax = 0; + int drawFlag = 0; if (tmpX > maxDist) { - eax = 1; + drawFlag = 1; tmpX -= maxDist; if (dx >= 0) { @@ -667,7 +665,7 @@ void ScummEngine_v80he::drawLine(int x1, int y1, int x, int y, int step, int typ } } if (tmpY > maxDist) { - eax = dy; + drawFlag = dy; tmpY -= maxDist; if (dy >= 0) { @@ -677,10 +675,10 @@ void ScummEngine_v80he::drawLine(int x1, int y1, int x, int y, int step, int typ } } - if (eax == 0) + if (drawFlag == 0) continue; - if ((var_C++ % step) != 0 && maxDist != i) + if ((stepCount++ % step) != 0 && maxDist != i) continue; if (type == 2) { diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index 71e388aae6..a59e804590 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -519,16 +519,16 @@ void ScummEngine_v90he::o90_videoOps() { _videoParams.status = status; break; case 5: - _videoParams.unk1 |= pop(); + _videoParams.flags |= pop(); break; case 8: memset(_videoParams.filename, 0, sizeof(_videoParams.filename)); _videoParams.unk2 = pop(); break; case 14: - _videoParams.unk3 = pop(); - if (_videoParams.unk1) - _videoParams.unk1 |= 2; + _videoParams.wizResNum = pop(); + if (_videoParams.wizResNum) + _videoParams.flags |= 2; break; case 116: _videoParams.status = status; @@ -536,14 +536,14 @@ void ScummEngine_v90he::o90_videoOps() { case 206: if (_videoParams.status == 49) { // Start video - if (_videoParams.unk1 == 0) - _videoParams.unk1 = 4; + if (_videoParams.flags == 0) + _videoParams.flags = 4; - if (_videoParams.unk1 == 2) { - // result = startVideo(_videoParams.filename, _videoParams.unk1, _videoParams.unk3); + if (_videoParams.flags == 2) { + // result = startVideo(_videoParams.filename, _videoParams.flags, _videoParams.wizResNum); // VAR(119) = result; } else { - // result = startVideo(_videoParams.filename, _videoParams.unk1); + // result = startVideo(_videoParams.filename, _videoParams.flags); // VAR(119) = result; } } else if (_videoParams.status == 165) { @@ -554,7 +554,7 @@ void ScummEngine_v90he::o90_videoOps() { error("o90_videoOps: unhandled case %d", subOp); } - debug(0,"o90_videoOps stub (%d)", subOp); + debug(0, "o90_videoOps stub (%d)", subOp); } void ScummEngine_v90he::o90_getVideoData() { @@ -578,7 +578,7 @@ void ScummEngine_v90he::o90_getVideoData() { case 31: // Get image number pop(); break; - case 107: // Get genreal property + case 107: // Get statistics pop(); pop(); break; @@ -587,7 +587,7 @@ void ScummEngine_v90he::o90_getVideoData() { } push(-1); - debug(0,"o90_getVideoData stub (%d)", subOp); + debug(0, "o90_getVideoData stub (%d)", subOp); } void ScummEngine_v90he::o90_wizImageOps() { @@ -807,7 +807,7 @@ void ScummEngine_v90he::o90_wizImageOps() { error("o90_wizImageOps: unhandled case %d", subOp); } - debug(1,"o90_wizImageOps (%d)", subOp); + debug(1, "o90_wizImageOps (%d)", subOp); } void ScummEngine_v90he::o90_getDistanceBetweenPoints() { @@ -861,7 +861,7 @@ void ScummEngine_v90he::o90_getSpriteInfo() { byte subOp = fetchScriptByte(); subOp -= 30; - debug(1,"o90_getSpriteInfo (%d)", subOp); + debug(1, "o90_getSpriteInfo (%d)", subOp); switch (subOp) { case 0: spriteId = pop(); @@ -1116,7 +1116,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { byte subOp = fetchScriptByte(); subOp -= 34; - debug(1,"o90_setSpriteInfo (%d)", subOp); + debug(1, "o90_setSpriteInfo (%d)", subOp); switch (subOp) { case 0: args[0] = pop(); @@ -1447,7 +1447,7 @@ void ScummEngine_v90he::o90_getSpriteGroupInfo() { byte subOp = fetchScriptByte(); - debug(1,"o90_getSpriteGroupInfo (%d)", subOp); + debug(1, "o90_getSpriteGroupInfo (%d)", subOp); switch (subOp) { case 8: // HE 99+ spriteGroupId = pop(); @@ -1529,7 +1529,7 @@ void ScummEngine_v90he::o90_setSpriteGroupInfo() { byte subOp = fetchScriptByte(); subOp -= 37; - debug(1,"o90_setSpriteGroupInfo (%d)", subOp); + debug(1, "o90_setSpriteGroupInfo (%d)", subOp); switch (subOp) { case 0: type = pop() - 1; @@ -1794,7 +1794,7 @@ void ScummEngine_v90he::o90_floodState() { default: error("o90_floodState: Unknown case %d", subOp); } - debug(1,"o90_floodState stub (%d)", subOp); + debug(1, "o90_floodState stub (%d)", subOp); } void ScummEngine_v90he::o90_shl() { @@ -2380,7 +2380,7 @@ void ScummEngine_v90he::o90_getObjectData() { default: error("o90_getObjectData: Unknown case %d", subOp); } - debug(1,"o90_getObjectData (%d)", subOp); + debug(1, "o90_getObjectData (%d)", subOp); } void ScummEngine_v90he::o90_getPaletteData() { @@ -2429,7 +2429,7 @@ void ScummEngine_v90he::o90_getPaletteData() { default: error("o90_getPaletteData: Unknown case %d", subOp); } - debug(1,"o90_getPaletteData stub (%d)", subOp); + debug(1, "o90_getPaletteData stub (%d)", subOp); } void ScummEngine_v90he::o90_paletteOps() { @@ -2501,11 +2501,9 @@ void ScummEngine_v90he::o90_paletteOps() { default: error("o90_paletteOps: Unknown case %d", subOp); } - debug(1,"o90_paletteOps (%d)", subOp); + debug(1, "o90_paletteOps (%d)", subOp); } - - void ScummEngine_v90he::o90_fontUnk() { // Font related byte string[80]; @@ -2536,7 +2534,7 @@ void ScummEngine_v90he::o90_fontUnk() { error("o90_fontUnk: Unknown case %d", subOp); } - debug(1,"o90_fontUnk stub (%d)", subOp); + debug(1, "o90_fontUnk stub (%d)", subOp); } void ScummEngine_v90he::o90_getActorAnimProgress() { -- cgit v1.2.3