aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/ad/ad_node_state.cpp2
-rw-r--r--engines/wintermute/ad/ad_node_state.h2
-rw-r--r--engines/wintermute/base/base_file_manager.cpp4
-rw-r--r--engines/wintermute/base/base_persistence_manager.cpp8
-rw-r--r--engines/wintermute/base/base_surface_storage.cpp2
-rw-r--r--engines/wintermute/base/font/base_font_bitmap.cpp2
-rw-r--r--engines/wintermute/base/gfx/base_renderer.cpp2
-rw-r--r--engines/wintermute/base/particles/part_particle.cpp2
-rw-r--r--engines/wintermute/base/scriptables/script_ext_file.cpp6
-rw-r--r--engines/wintermute/base/sound/base_sound.cpp3
-rw-r--r--engines/wintermute/detection.cpp4
-rw-r--r--engines/wintermute/ui/ui_object.cpp2
-rw-r--r--engines/wintermute/utils/crc.cpp3
-rw-r--r--engines/wintermute/utils/crc.h12
-rw-r--r--engines/wintermute/utils/path_util.cpp2
15 files changed, 32 insertions, 24 deletions
diff --git a/engines/wintermute/ad/ad_node_state.cpp b/engines/wintermute/ad/ad_node_state.cpp
index 5a58dba5b1..270a114277 100644
--- a/engines/wintermute/ad/ad_node_state.cpp
+++ b/engines/wintermute/ad/ad_node_state.cpp
@@ -128,7 +128,7 @@ void AdNodeState::setCaption(const char *caption, int caseVal) {
//////////////////////////////////////////////////////////////////////////
-char *AdNodeState::getCaption(int caseVal) {
+const char *AdNodeState::getCaption(int caseVal) {
if (caseVal == 0) {
caseVal = 1;
}
diff --git a/engines/wintermute/ad/ad_node_state.h b/engines/wintermute/ad/ad_node_state.h
index 64ecab6849..ce15bc893f 100644
--- a/engines/wintermute/ad/ad_node_state.h
+++ b/engines/wintermute/ad/ad_node_state.h
@@ -48,7 +48,7 @@ private:
char *_name;
char *_caption[7];
void setCaption(const char *caption, int caseVal);
- char *getCaption(int caseVal);
+ const char *getCaption(int caseVal);
uint32 _alphaColor;
char *_filename;
char *_cursor;
diff --git a/engines/wintermute/base/base_file_manager.cpp b/engines/wintermute/base/base_file_manager.cpp
index f1320b814b..5bad96d65e 100644
--- a/engines/wintermute/base/base_file_manager.cpp
+++ b/engines/wintermute/base/base_file_manager.cpp
@@ -253,8 +253,8 @@ Common::SeekableReadStream *BaseFileManager::openPkgFile(const Common::String &f
strcpy(fileName, upcName.c_str());
// correct slashes
- for (int32 i = 0; i < upcName.size(); i++) {
- if (upcName[i] == '/') {
+ for (uint32 i = 0; i < upcName.size(); i++) {
+ if (upcName[(int32)i] == '/') {
upcName.setChar('\\', (uint32)i);
}
}
diff --git a/engines/wintermute/base/base_persistence_manager.cpp b/engines/wintermute/base/base_persistence_manager.cpp
index 995b996b33..ce7c66b7dd 100644
--- a/engines/wintermute/base/base_persistence_manager.cpp
+++ b/engines/wintermute/base/base_persistence_manager.cpp
@@ -492,7 +492,7 @@ float BasePersistenceManager::getFloat() {
}
void BasePersistenceManager::putDouble(double val) {
- Common::String str = Common::String::format("F%f", val);
+ Common::String str = Common::String::format("D%f", val);
str.format("D%f", val);
_saveStream->writeUint32LE(str.size());
_saveStream->writeString(str);
@@ -500,10 +500,10 @@ void BasePersistenceManager::putDouble(double val) {
double BasePersistenceManager::getDouble() {
char *str = getString();
- double value = 0.0f;
- int ret = sscanf(str, "F%f", &value);
+ float value = 0.0f; // TODO: Do we ever really need to carry a full double-precision number?
+ int ret = sscanf(str, "D%f", &value);
if (ret != 1) {
- warning("%s not parsed as float", str);
+ warning("%s not parsed as double", str);
}
delete[] str;
return value;
diff --git a/engines/wintermute/base/base_surface_storage.cpp b/engines/wintermute/base/base_surface_storage.cpp
index 3d878b1346..689066eb6e 100644
--- a/engines/wintermute/base/base_surface_storage.cpp
+++ b/engines/wintermute/base/base_surface_storage.cpp
@@ -73,7 +73,7 @@ bool BaseSurfaceStorage::initLoop() {
break;
}
- if (_surfaces[i]->_lifeTime > 0 && _surfaces[i]->_valid && _gameRef->_liveTimer - _surfaces[i]->_lastUsedTime >= _surfaces[i]->_lifeTime) {
+ if (_surfaces[i]->_lifeTime > 0 && (int)(_surfaces[i]->_valid && _gameRef->_liveTimer - _surfaces[i]->_lastUsedTime) >= _surfaces[i]->_lifeTime) {
//_gameRef->QuickMessageForm("Invalidating: %s", _surfaces[i]->_filename);
_surfaces[i]->invalidate();
}
diff --git a/engines/wintermute/base/font/base_font_bitmap.cpp b/engines/wintermute/base/font/base_font_bitmap.cpp
index 152e08273d..ed7c13a54d 100644
--- a/engines/wintermute/base/font/base_font_bitmap.cpp
+++ b/engines/wintermute/base/font/base_font_bitmap.cpp
@@ -174,7 +174,7 @@ int BaseFontBitmap::textHeightDraw(byte *text, int x, int y, int width, TTextAli
longLine = true;
}
- if (str.size() == (index + 1) || (maxLength >= 0 && index == maxLength - 1)) {
+ if ((int)str.size() == (index + 1) || (maxLength >= 0 && index == maxLength - 1)) {
done = true;
if (!newLine) {
end = index;
diff --git a/engines/wintermute/base/gfx/base_renderer.cpp b/engines/wintermute/base/gfx/base_renderer.cpp
index 168aa75d91..3a29bf542d 100644
--- a/engines/wintermute/base/gfx/base_renderer.cpp
+++ b/engines/wintermute/base/gfx/base_renderer.cpp
@@ -111,7 +111,7 @@ BaseObject *BaseRenderer::getObjectAt(int x, int y) {
//////////////////////////////////////////////////////////////////////////
void BaseRenderer::deleteRectList() {
- for (int i = 0; i < _rectList.size(); i++) {
+ for (uint32 i = 0; i < _rectList.size(); i++) {
delete _rectList[i];
}
_rectList.clear();
diff --git a/engines/wintermute/base/particles/part_particle.cpp b/engines/wintermute/base/particles/part_particle.cpp
index 27dbe9999c..0c0ec08ba9 100644
--- a/engines/wintermute/base/particles/part_particle.cpp
+++ b/engines/wintermute/base/particles/part_particle.cpp
@@ -199,7 +199,7 @@ bool PartParticle::display(PartEmitter *emitter) {
}
_sprite->getCurrentFrame();
- return _sprite->display(_pos.x, _pos.y,
+ return _sprite->display((int)_pos.x, (int)_pos.y,
NULL,
_scale, _scale,
BYTETORGBA(255, 255, 255, _currentAlpha),
diff --git a/engines/wintermute/base/scriptables/script_ext_file.cpp b/engines/wintermute/base/scriptables/script_ext_file.cpp
index 4eeabca04d..9736ae3ee2 100644
--- a/engines/wintermute/base/scriptables/script_ext_file.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_file.cpp
@@ -211,8 +211,8 @@ bool SXFile::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Copy") == 0) {
stack->correctParams(2);
- const char *dest = stack->pop()->getString();
- bool overwrite = stack->pop()->getBool(true);
+ /* const char *dest = */ stack->pop()->getString();
+ /* bool overwrite = */ stack->pop()->getBool(true);
close();
error("SXFile-Method: Copy not supported");
@@ -601,7 +601,7 @@ bool SXFile::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
else if (strcmp(name, "WriteDouble") == 0) {
error("SXFile::WriteDouble - Not endian safe yet");
stack->correctParams(1);
- double val = stack->pop()->getFloat();
+ /* double val = */ stack->pop()->getFloat();
if (_textMode || !_writeFile) {
script->runtimeError("File.%s: File must be open for writing in binary mode.", name);
diff --git a/engines/wintermute/base/sound/base_sound.cpp b/engines/wintermute/base/sound/base_sound.cpp
index 9bea6be770..8a139ead4f 100644
--- a/engines/wintermute/base/sound/base_sound.cpp
+++ b/engines/wintermute/base/sound/base_sound.cpp
@@ -268,7 +268,8 @@ bool BaseSound::setPrivateVolume(int volume) {
if (!_sound) {
return STATUS_FAILED;
} else {
- return _sound->_privateVolume = volume;
+ _sound->_privateVolume = volume;
+ return STATUS_OK;
}
}
diff --git a/engines/wintermute/detection.cpp b/engines/wintermute/detection.cpp
index 011b64aff3..58b6c5df90 100644
--- a/engines/wintermute/detection.cpp
+++ b/engines/wintermute/detection.cpp
@@ -116,9 +116,9 @@ public:
if (allFiles.contains("data.dcp")) {
Common::String name, caption;
if (WinterMuteEngine::getGameInfo(fslist, name, caption)) {
- for (int32 i = 0; i < name.size(); i++) {
+ for (uint32 i = 0; i < name.size(); i++) {
// Replace spaces (and other non-alphanumerics) with underscores
- if (!Common::isAlnum(name[i])) {
+ if (!Common::isAlnum(name[(int32)i])) {
name.setChar('_', (uint32)i);
}
}
diff --git a/engines/wintermute/ui/ui_object.cpp b/engines/wintermute/ui/ui_object.cpp
index 9fe9cd18e4..d1a13200c8 100644
--- a/engines/wintermute/ui/ui_object.cpp
+++ b/engines/wintermute/ui/ui_object.cpp
@@ -102,7 +102,7 @@ void UIObject::setText(const char *text) {
_text = new char [strlen(text) + 1];
if (_text) {
strcpy(_text, text);
- for (int i = 0; i < strlen(_text); i++) {
+ for (uint32 i = 0; i < strlen(_text); i++) {
if (_text[i] == '|') {
_text[i] = '\n';
}
diff --git a/engines/wintermute/utils/crc.cpp b/engines/wintermute/utils/crc.cpp
index 933857e066..c127d08417 100644
--- a/engines/wintermute/utils/crc.cpp
+++ b/engines/wintermute/utils/crc.cpp
@@ -17,6 +17,7 @@
#include "engines/wintermute/utils/crc.h"
+namespace WinterMute {
/*
* Derive parameters from the standard-specific parameters in crc.h.
@@ -232,3 +233,5 @@ crc crc_process_byte(unsigned char byteVal, crc remainder) {
crc crc_finalize(crc remainder) {
return (REFLECT_REMAINDER(remainder) ^ FINAL_XOR_VALUE);
}
+
+} // end of namespace WinterMute
diff --git a/engines/wintermute/utils/crc.h b/engines/wintermute/utils/crc.h
index cf7ea1a00c..363340531d 100644
--- a/engines/wintermute/utils/crc.h
+++ b/engines/wintermute/utils/crc.h
@@ -16,6 +16,10 @@
#ifndef _crc_h
#define _crc_h
+#include "common/system.h" // For types.
+
+namespace WinterMute {
+
#ifndef TRUE
#define FALSE 0
#define TRUE !FALSE
@@ -26,10 +30,9 @@
*/
#define CRC32
-
#if defined(CRC_CCITT)
-typedef unsigned short crc;
+typedef uint16 crc;
#define CRC_NAME "CRC-CCITT"
#define POLYNOMIAL 0x1021
@@ -41,7 +44,7 @@ typedef unsigned short crc;
#elif defined(CRC16)
-typedef unsigned short crc;
+typedef uint16 crc;
#define CRC_NAME "CRC-16"
#define POLYNOMIAL 0x8005
@@ -53,7 +56,7 @@ typedef unsigned short crc;
#elif defined(CRC32)
-typedef unsigned long crc;
+typedef uint32 crc;
#define CRC_NAME "CRC-32"
#define POLYNOMIAL 0x04C11DB7
@@ -77,5 +80,6 @@ extern "C" crc crc_initialize(void);
extern "C" crc crc_process_byte(unsigned char byteVal, crc remainder);
extern "C" crc crc_finalize(crc remainder);
+} // End of namespace WinterMute
#endif /* _crc_h */
diff --git a/engines/wintermute/utils/path_util.cpp b/engines/wintermute/utils/path_util.cpp
index 51f0f5817e..2fbe785a38 100644
--- a/engines/wintermute/utils/path_util.cpp
+++ b/engines/wintermute/utils/path_util.cpp
@@ -97,7 +97,7 @@ AnsiString PathUtil::getFileNameWithoutExtension(const AnsiString &path) {
//size_t pos = fileName.find_last_of('.'); //TODO REMOVE!
// TODO: Prettify this.
AnsiString extension = Common::lastPathComponent(fileName, '.');
- for (int i = 0; i < extension.size() + 1; i++) {
+ for (uint32 i = 0; i < extension.size() + 1; i++) {
fileName.deleteLastChar();
}
// Common::String filename = Common::String(fileName.c_str(), fileName.size() - extension.size() + 1);