aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMatt Hargett2002-09-22 03:53:53 +0000
committerMatt Hargett2002-09-22 03:53:53 +0000
commit8390b0cc53b2025108eee9a8ea9ee7f411edd55e (patch)
tree5ca2452114d38060824e0edee01ce7955132ad37 /scumm
parentfbe9c544de19cc4a7f28e2dbf1fdebaf351b83ee (diff)
downloadscummvm-rg350-8390b0cc53b2025108eee9a8ea9ee7f411edd55e.tar.gz
scummvm-rg350-8390b0cc53b2025108eee9a8ea9ee7f411edd55e.tar.bz2
scummvm-rg350-8390b0cc53b2025108eee9a8ea9ee7f411edd55e.zip
2002-09-21 Matt Hargett <matt@use.net>
* scumm.dsp, scummvm.dsp, simon.dsp: Turn on warning as errors. Generate PDBs on all builds. * gameDetector.cpp, newgui.cpp, widget.cpp, actor.cpp, dialogs.cpp, resource.cpp, saveload.cpp, scumm_renderer.cpp: Fix warnings where possible. One pragma added to eliminate warning of unknown pragmas. * string.cpp: If unknown escape sequence, print warning. svn-id: r4998
Diffstat (limited to 'scumm')
-rw-r--r--scumm/actor.cpp2
-rw-r--r--scumm/dialogs.cpp5
-rw-r--r--scumm/resource.cpp6
-rw-r--r--scumm/saveload.cpp2
-rw-r--r--scumm/script_v1.cpp4
-rw-r--r--scumm/smush/scumm_renderer.cpp3
-rw-r--r--scumm/string.cpp7
7 files changed, 18 insertions, 11 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 7e762a9314..4d8f08ceb7 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -256,7 +256,7 @@ int Actor::updateActorDirection(bool is_walking)
from = toSimpleDir(dirType, facing);
dir = remapDirection(newDirection, is_walking);
- shouldInterpolate = (dir & 1024);
+ shouldInterpolate = (dir & 1024) ? true : false;
to = toSimpleDir(dirType, dir & 1023);
num = dirType ? 8 : 4;
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp
index c1292e3734..a9080737dc 100644
--- a/scumm/dialogs.cpp
+++ b/scumm/dialogs.cpp
@@ -30,6 +30,11 @@
#include "common/config-file.h"
+#ifdef _MSC_VER
+# pragma warning( disable : 4068 )
+#endif
+
+
struct ResString {
int num;
char string[80];
diff --git a/scumm/resource.cpp b/scumm/resource.cpp
index bef67b94a4..69b9b9e257 100644
--- a/scumm/resource.cpp
+++ b/scumm/resource.cpp
@@ -1084,9 +1084,9 @@ int Scumm::readSoundResourceSmallHeader(int type, int idx)
dw = 500000; // for sanity
debug(4, " ticks = %d, speed = %ld", ticks, dw);
memcpy(ptr, "\x00\xFF\x51\x03", 4); ptr += 4;
- *ptr++ = (dw >> 16) & 0xFF;
- *ptr++ = (dw >> 8) & 0xFF;
- *ptr++ = dw & 0xFF;
+ *ptr++ = (byte)((dw >> 16) & 0xFF);
+ *ptr++ = (byte)((dw >> 8) & 0xFF);
+ *ptr++ = (byte)(dw & 0xFF);
memcpy(ptr, OLD256_MIDI_HACK, sizeof(OLD256_MIDI_HACK) - 1);
ptr += sizeof(OLD256_MIDI_HACK) - 1;
memcpy(ptr, track, size);
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index 614f6b825f..84af9cc3ce 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -142,7 +142,7 @@ bool Scumm::loadState(int slot, bool compat)
int old_screenEffectFlag = _screenEffectFlag;
_screenEffectFlag = true;
fadeOut(129);
- _screenEffectFlag = old_screenEffectFlag;
+ _screenEffectFlag = old_screenEffectFlag ? true : false;
initScreens(0, sb, _realWidth, sh);
diff --git a/scumm/script_v1.cpp b/scumm/script_v1.cpp
index 6663683e77..30f50c147c 100644
--- a/scumm/script_v1.cpp
+++ b/scumm/script_v1.cpp
@@ -851,7 +851,7 @@ void Scumm::o5_setClass()
if (_gameId == GID_INDY3_256)
newClass--;
- putClass(obj, newClass, (newClass & 0x80));
+ putClass(obj, newClass, (newClass & 0x80) ? true : false);
}
}
@@ -1379,7 +1379,7 @@ void Scumm::o5_ifState()
{
int a = getVarOrDirectWord(0x80);
int b = getVarOrDirectByte(0x40);
- bool isNegated = _opcode & 0x20;
+ bool isNegated = (_opcode & 0x20) ? true : false;
if ((getState(a) != b) ^ isNegated)
o5_jumpRelative();
diff --git a/scumm/smush/scumm_renderer.cpp b/scumm/smush/scumm_renderer.cpp
index 07da819e0b..708161a811 100644
--- a/scumm/smush/scumm_renderer.cpp
+++ b/scumm/smush/scumm_renderer.cpp
@@ -266,7 +266,8 @@ void ScummRenderer::save(int32 frame) {
}
bool ScummRenderer::prematureClose() {
- return _scumm->videoFinished;
+
+ return _scumm->videoFinished ? true : false;
}
bool ScummRenderer::update() {
diff --git a/scumm/string.cpp b/scumm/string.cpp
index 52747c1ca7..31b00f3342 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -621,7 +621,7 @@ void Scumm::drawString(int a)
byte *Scumm::addMessageToStack(byte *msg)
{
int num, numorg;
- byte *ptr, chr;
+ unsigned char *ptr, chr;
numorg = num = _numInMsgStack;
ptr = getResourceAddress(rtTemp, 6);
@@ -640,7 +640,6 @@ while ((ptr[num++] = chr = *msg++) != 0) {
if (chr == 0xff) { // 0xff is an escape character
ptr[num++] = chr = *msg++; // followed by a "command" code
-
if (chr != 1 && chr != 2 && chr != 3 && chr != 8) {
ptr[num++] = *msg++; // and some commands are followed by parameters to the functions below
ptr[num++] = *msg++; // these are numbers of names, strings, verbs, variables, etc
@@ -687,9 +686,11 @@ while ((ptr[num++] = chr = *msg++) != 0) {
*_msgPtrToAdd++ = ptr[num++];
*_msgPtrToAdd++ = ptr[num++];
break;
- default:
+ default:
+ warning("addMessageToStack(): string escape sequence %d unknown", chr);
*_msgPtrToAdd++ = 0xFF;
*_msgPtrToAdd++ = chr;
+ break;
}
} else {
if (chr != '@') {