aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-09 02:50:15 +0200
committerEinar Johan Trøan Sømåen2012-07-09 02:50:15 +0200
commit5224ebef2c8013bc9ff5cc6f9bdefbcf635b456c (patch)
treeba1c7248ce50a7ce6c9b00f566d3df21f713d712 /engines/wintermute
parent0273e495e1495d6abbcac4dde4cfa7e6ca2c29d7 (diff)
downloadscummvm-rg350-5224ebef2c8013bc9ff5cc6f9bdefbcf635b456c.tar.gz
scummvm-rg350-5224ebef2c8013bc9ff5cc6f9bdefbcf635b456c.tar.bz2
scummvm-rg350-5224ebef2c8013bc9ff5cc6f9bdefbcf635b456c.zip
WINTERMUTE: Silence most warnings
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/Ad/AdActor.cpp2
-rw-r--r--engines/wintermute/Ad/AdGame.cpp12
-rw-r--r--engines/wintermute/Ad/AdScene.cpp14
-rw-r--r--engines/wintermute/Ad/AdSpriteSet.cpp2
-rw-r--r--engines/wintermute/Base/BFileManager.cpp4
-rw-r--r--engines/wintermute/Base/BFileManager.h2
-rw-r--r--engines/wintermute/Base/BFontBitmap.cpp6
-rw-r--r--engines/wintermute/Base/BFontTT.cpp8
-rw-r--r--engines/wintermute/Base/BGame.cpp8
-rw-r--r--engines/wintermute/Base/BObject.cpp2
-rw-r--r--engines/wintermute/Base/BObject.h2
-rw-r--r--engines/wintermute/Base/BParser.cpp4
-rw-r--r--engines/wintermute/Base/BParser.h8
-rw-r--r--engines/wintermute/Base/BPersistMgr.cpp2
-rw-r--r--engines/wintermute/Base/BRenderSDL.cpp5
-rw-r--r--engines/wintermute/Base/BSoundBuffer.cpp2
-rw-r--r--engines/wintermute/Base/BStringTable.cpp8
-rw-r--r--engines/wintermute/Base/BSurfaceSDL.cpp4
-rw-r--r--engines/wintermute/Base/BTransitionMgr.cpp3
-rw-r--r--engines/wintermute/Base/PartEmitter.cpp4
-rw-r--r--engines/wintermute/Base/PartParticle.cpp12
-rw-r--r--engines/wintermute/Base/file/BSaveThumbFile.cpp2
-rw-r--r--engines/wintermute/Base/scriptables/SXArray.cpp12
-rw-r--r--engines/wintermute/Base/scriptables/SXFile.cpp2
-rw-r--r--engines/wintermute/Base/scriptables/SXStore.cpp6
-rw-r--r--engines/wintermute/Base/scriptables/SXString.cpp4
-rw-r--r--engines/wintermute/Base/scriptables/ScEngine.cpp11
-rw-r--r--engines/wintermute/Base/scriptables/ScEngine.h2
-rw-r--r--engines/wintermute/Base/scriptables/ScScript.cpp10
-rw-r--r--engines/wintermute/Base/scriptables/ScScript.h4
-rw-r--r--engines/wintermute/Base/scriptables/ScStack.cpp2
-rw-r--r--engines/wintermute/Sys/SysClassRegistry.cpp4
-rw-r--r--engines/wintermute/UI/UIObject.cpp4
-rw-r--r--engines/wintermute/wintermute.cpp2
34 files changed, 87 insertions, 92 deletions
diff --git a/engines/wintermute/Ad/AdActor.cpp b/engines/wintermute/Ad/AdActor.cpp
index 821c66f6fc..b07e444439 100644
--- a/engines/wintermute/Ad/AdActor.cpp
+++ b/engines/wintermute/Ad/AdActor.cpp
@@ -796,7 +796,7 @@ void CAdActor::getNextStep() {
maxStepX--;
}
- if (((CAdGame *)Game)->_scene->isBlockedAt(_pFX, _pFY, true, this)) {
+ if (((CAdGame *)Game)->_scene->isBlockedAt((int)_pFX,(int) _pFY, true, this)) {
if (_pFCount == 0) {
_state = _nextState;
_nextState = STATE_READY;
diff --git a/engines/wintermute/Ad/AdGame.cpp b/engines/wintermute/Ad/AdGame.cpp
index 55cb3b876b..3485b3eecd 100644
--- a/engines/wintermute/Ad/AdGame.cpp
+++ b/engines/wintermute/Ad/AdGame.cpp
@@ -1672,9 +1672,9 @@ HRESULT CAdGame::resetResponse(int ID) {
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdGame::displayContent(bool update, bool displayAll) {
+HRESULT CAdGame::displayContent(bool doUpdate, bool displayAll) {
// init
- if (update) initLoop();
+ if (doUpdate) initLoop();
// fill black
_renderer->fill(0, 0, 0);
@@ -1682,11 +1682,11 @@ HRESULT CAdGame::displayContent(bool update, bool displayAll) {
// playing exclusive video?
if (_videoPlayer->isPlaying()) {
- if (update) _videoPlayer->update();
+ if (doUpdate) _videoPlayer->update();
_videoPlayer->display();
} else if (_theoraPlayer) {
if (_theoraPlayer->isPlaying()) {
- if (update) _theoraPlayer->update();
+ if (doUpdate) _theoraPlayer->update();
_theoraPlayer->display();
}
if (_theoraPlayer->isFinished()) {
@@ -1696,7 +1696,7 @@ HRESULT CAdGame::displayContent(bool update, bool displayAll) {
} else {
// process scripts
- if (update) _scEngine->tick();
+ if (doUpdate) _scEngine->tick();
POINT p;
getMousePos(&p);
@@ -1712,7 +1712,7 @@ HRESULT CAdGame::displayContent(bool update, bool displayAll) {
if (_indicatorDisplay) displayIndicator();
- if (update || displayAll) {
+ if (doUpdate || displayAll) {
// display normal windows
displayWindows(false);
diff --git a/engines/wintermute/Ad/AdScene.cpp b/engines/wintermute/Ad/AdScene.cpp
index 3f6d724ac4..fe8295abad 100644
--- a/engines/wintermute/Ad/AdScene.cpp
+++ b/engines/wintermute/Ad/AdScene.cpp
@@ -856,7 +856,7 @@ HRESULT CAdScene::loadBuffer(byte *buffer, bool complete) {
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CAdScene::traverseNodes(bool update) {
+HRESULT CAdScene::traverseNodes(bool doUpdate) {
if (!_initialized) return S_OK;
int j, k;
@@ -877,7 +877,7 @@ HRESULT CAdScene::traverseNodes(bool update) {
//////////////////////////////////////////////////////////////////////////
// *** adjust scroll offset
- if (update) {
+ if (doUpdate) {
/*
if (_autoScroll && Game->_mainObject != NULL)
{
@@ -947,7 +947,7 @@ HRESULT CAdScene::traverseNodes(bool update) {
if (!_layers[j]->_active) continue;
// make layer exclusive
- if (!update) {
+ if (!doUpdate) {
if (_layers[j]->_closeUp && !Game->_editorMode) {
if (!_shieldWindow) _shieldWindow = new CUIWindow(Game);
if (_shieldWindow) {
@@ -984,7 +984,7 @@ HRESULT CAdScene::traverseNodes(bool update) {
if (node->_entity->_active && (Game->_editorMode || !node->_entity->_editorOnly)) {
Game->_renderer->setup2D();
- if (update) node->_entity->update();
+ if (doUpdate) node->_entity->update();
else node->_entity->display();
}
break;
@@ -993,7 +993,7 @@ HRESULT CAdScene::traverseNodes(bool update) {
if (node->_region->_blocked) break;
if (node->_region->_decoration) break;
- if (!update) displayRegionContent(node->_region);
+ if (!doUpdate) displayRegionContent(node->_region);
}
break;
default:
@@ -1004,7 +1004,7 @@ HRESULT CAdScene::traverseNodes(bool update) {
// display/update all objects which are off-regions
if (_layers[j]->_main) {
- if (update) {
+ if (doUpdate) {
updateFreeObjects();
} else {
displayRegionContent(NULL);
@@ -1019,7 +1019,7 @@ HRESULT CAdScene::traverseNodes(bool update) {
// display/update fader
if (_fader) {
- if (update) _fader->update();
+ if (doUpdate) _fader->update();
else _fader->display();
}
diff --git a/engines/wintermute/Ad/AdSpriteSet.cpp b/engines/wintermute/Ad/AdSpriteSet.cpp
index 296511491d..c02ba32ea1 100644
--- a/engines/wintermute/Ad/AdSpriteSet.cpp
+++ b/engines/wintermute/Ad/AdSpriteSet.cpp
@@ -237,7 +237,7 @@ CBSprite *CAdSpriteSet::getSprite(TDirection direction) {
// find nearest set sprite
int numSteps = 0;
- for (int i = dir, NumSteps = 0; i >= 0; i--) {
+ for (int i = dir; i >= 0; i--) {
if (_sprites[i] != NULL) {
ret = _sprites[i];
numSteps = dir - i;
diff --git a/engines/wintermute/Base/BFileManager.cpp b/engines/wintermute/Base/BFileManager.cpp
index 19f162315d..fdb43e28f5 100644
--- a/engines/wintermute/Base/BFileManager.cpp
+++ b/engines/wintermute/Base/BFileManager.cpp
@@ -140,7 +140,7 @@ byte *CBFileManager::readWholeFile(const Common::String &filename, uint32 *size,
return NULL;
}
- if (file->read(buffer, file->size()) != file->size()) {
+ if (file->read(buffer, (uint32)file->size()) != (uint32)file->size()) {
Game->LOG(0, "Error reading file '%s'", filename.c_str());
closeFile(file);
delete [] buffer;
@@ -224,7 +224,7 @@ HRESULT CBFileManager::saveFile(const Common::String &filename, byte *Buffer, ui
//////////////////////////////////////////////////////////////////////////
-HRESULT CBFileManager::requestCD(int cd, char *packageFile, char *filename) {
+HRESULT CBFileManager::requestCD(int cd, char *packageFile, const char *filename) {
// unmount all non-local packages
for (int i = 0; i < _packages.GetSize(); i++) {
if (_packages[i]->_cD > 0) _packages[i]->close();
diff --git a/engines/wintermute/Base/BFileManager.h b/engines/wintermute/Base/BFileManager.h
index 1b5c50c127..2c7415642f 100644
--- a/engines/wintermute/Base/BFileManager.h
+++ b/engines/wintermute/Base/BFileManager.h
@@ -62,7 +62,7 @@ public:
PATH_PACKAGE, PATH_SINGLE
} TPathType;
HRESULT addPath(TPathType type, const Common::String &path);
- HRESULT requestCD(int cd, char *packageFile, char *filename);
+ HRESULT requestCD(int cd, char *packageFile, const char *filename);
Common::SeekableReadStream *loadSaveGame(const Common::String &filename);
HRESULT saveFile(const Common::String &filename, byte *buffer, uint32 bufferSize, bool compressed = false, byte *prefixBuffer = NULL, uint32 prefixSize = 0);
byte *readWholeFile(const Common::String &filename, uint32 *size = NULL, bool mustExist = true);
diff --git a/engines/wintermute/Base/BFontBitmap.cpp b/engines/wintermute/Base/BFontBitmap.cpp
index 45c2efbdb7..4e01134a9a 100644
--- a/engines/wintermute/Base/BFontBitmap.cpp
+++ b/engines/wintermute/Base/BFontBitmap.cpp
@@ -92,8 +92,8 @@ int CBFontBitmap::getTextWidth(byte *text, int maxLength) {
str = AnsiString((char *)text);
}
- if (maxLength >= 0 && str.size() > maxLength)
- str = Common::String(str.c_str(), maxLength);
+ if (maxLength >= 0 && str.size() > (uint32)maxLength)
+ str = Common::String(str.c_str(), (uint32)maxLength);
//str.substr(0, maxLength); // TODO: Remove
int textWidth = 0;
@@ -111,8 +111,6 @@ int CBFontBitmap::textHeightDraw(byte *text, int x, int y, int width, TTextAlign
if (text == NULL || text[0] == '\0') return _tileHeight;
-
-
AnsiString str;
if (Game->_textEncoding == TEXT_UTF8) {
diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp
index e2240f28bb..353620bc24 100644
--- a/engines/wintermute/Base/BFontTT.cpp
+++ b/engines/wintermute/Base/BFontTT.cpp
@@ -126,8 +126,8 @@ int CBFontTT::getTextWidth(byte *text, int maxLength) {
if (Game->_textEncoding == TEXT_UTF8) textStr = StringUtil::utf8ToWide((char *)text);
else textStr = StringUtil::ansiToWide((char *)text);
- if (maxLength >= 0 && textStr.size() > maxLength)
- textStr = Common::String(textStr.c_str(), maxLength);
+ if (maxLength >= 0 && textStr.size() > (uint32)maxLength)
+ textStr = Common::String(textStr.c_str(), (uint32)maxLength);
//text = text.substr(0, MaxLength); // TODO: Remove
int textWidth, textHeight;
@@ -161,8 +161,8 @@ void CBFontTT::drawText(byte *text, int x, int y, int width, TTextAlign align, i
/* if (Game->_textEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
else text = StringUtil::AnsiToWide((char *)Text);*/
- if (maxLength >= 0 && textStr.size() > maxLength)
- textStr = Common::String(textStr.c_str(), maxLength);
+ if (maxLength >= 0 && textStr.size() > (uint32)maxLength)
+ textStr = Common::String(textStr.c_str(), (uint32)maxLength);
//text = text.substr(0, MaxLength); // TODO: Remove
CBRenderSDL *_renderer = (CBRenderSDL *)Game->_renderer;
diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp
index 94f105926b..def660274a 100644
--- a/engines/wintermute/Base/BGame.cpp
+++ b/engines/wintermute/Base/BGame.cpp
@@ -1779,7 +1779,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS
byte blue = stack->pop()->getInt(0);
byte alpha = stack->pop()->getInt(0xFF);
- bool System = (strcmp(name, "SystemFadeIn") == 0 || strcmp(name, "SystemFadeInAsync") == 0);
+ bool system = (strcmp(name, "SystemFadeIn") == 0 || strcmp(name, "SystemFadeInAsync") == 0);
_fader->fadeIn(DRGBA(red, green, blue, alpha), duration, system);
if (strcmp(name, "FadeInAsync") != 0 && strcmp(name, "SystemFadeInAsync") != 0) script->waitFor(_fader);
@@ -4030,7 +4030,7 @@ void CBGame::resetMousePos() {
//////////////////////////////////////////////////////////////////////////
-HRESULT CBGame::displayContent(bool update, bool displayAll) {
+HRESULT CBGame::displayContent(bool doUpdate, bool displayAll) {
return S_OK;
}
@@ -4108,8 +4108,8 @@ HRESULT CBGame::updateMusicCrossfade() {
} else {
//_music[_musicCrossfadeChannel1]->setVolume(GlobMusicVol - (float)CurrentTime / (float)_musicCrossfadeLength * GlobMusicVol);
//_music[_musicCrossfadeChannel2]->setVolume((float)CurrentTime / (float)_musicCrossfadeLength * GlobMusicVol);
- _music[_musicCrossfadeChannel1]->setVolume(100 - (float)currentTime / (float)_musicCrossfadeLength * 100);
- _music[_musicCrossfadeChannel2]->setVolume((float)currentTime / (float)_musicCrossfadeLength * 100);
+ _music[_musicCrossfadeChannel1]->setVolume((int)(100.0f - (float)currentTime / (float)_musicCrossfadeLength * 100.0f));
+ _music[_musicCrossfadeChannel2]->setVolume((int)((float)currentTime / (float)_musicCrossfadeLength * 100.0f));
//Game->QuickMessageForm("%d %d", _music[_musicCrossfadeChannel1]->GetVolume(), _music[_musicCrossfadeChannel2]->GetVolume());
}
diff --git a/engines/wintermute/Base/BObject.cpp b/engines/wintermute/Base/BObject.cpp
index ac45d9827a..af688a4514 100644
--- a/engines/wintermute/Base/BObject.cpp
+++ b/engines/wintermute/Base/BObject.cpp
@@ -152,7 +152,7 @@ void CBObject::setCaption(const char *caption, int caseVal) { // TODO: rename Ca
//////////////////////////////////////////////////////////////////////////
-char *CBObject::getCaption(int caseVal) {
+const char *CBObject::getCaption(int caseVal) {
if (caseVal == 0) caseVal = 1;
if (caseVal < 1 || caseVal > 7 || _caption[caseVal - 1] == NULL)
return "";
diff --git a/engines/wintermute/Base/BObject.h b/engines/wintermute/Base/BObject.h
index 48d2ea667b..db2bd2f290 100644
--- a/engines/wintermute/Base/BObject.h
+++ b/engines/wintermute/Base/BObject.h
@@ -86,7 +86,7 @@ public:
HRESULT setCursor(const char *filename);
HRESULT setActiveCursor(const char *filename);
HRESULT cleanup();
- char *getCaption(int caseVal = 1);
+ const char *getCaption(int caseVal = 1);
void setCaption(const char *caption, int caseVal = 1);
bool _editorSelected;
bool _editorAlwaysRegister;
diff --git a/engines/wintermute/Base/BParser.cpp b/engines/wintermute/Base/BParser.cpp
index 4354c5620d..45c0577f92 100644
--- a/engines/wintermute/Base/BParser.cpp
+++ b/engines/wintermute/Base/BParser.cpp
@@ -62,7 +62,7 @@ char *CBParser::getLastOffender() {
//////////////////////////////////////////////////////////////////////
-long CBParser::getObject(char **buf, TokenDesc *tokens, char **name, char **data) {
+int32 CBParser::getObject(char **buf, TokenDesc *tokens, char **name, char **data) {
skipCharacters(buf, _whiteSpace);
// skip comment lines.
@@ -113,7 +113,7 @@ long CBParser::getObject(char **buf, TokenDesc *tokens, char **name, char **data
//////////////////////////////////////////////////////////////////////
-long CBParser::getCommand(char **buf, TokenDesc *tokens, char **params) {
+int32 CBParser::getCommand(char **buf, TokenDesc *tokens, char **params) {
if (!*buf) return PARSERR_TOKENNOTFOUND;
Game->miniUpdate();
char *name;
diff --git a/engines/wintermute/Base/BParser.h b/engines/wintermute/Base/BParser.h
index f5aa0393e7..01d40067cc 100644
--- a/engines/wintermute/Base/BParser.h
+++ b/engines/wintermute/Base/BParser.h
@@ -60,13 +60,13 @@ namespace WinterMute {
class CBParser : public CBBase {
public:
struct TokenDesc {
- long id;
- const char *token;
+ int32 id;
+ const char *token;
};
public:
int scanStr(const char *in, const char *format, ...);
- long getCommand(char **buf, TokenDesc *tokens, char **params);
+ int32 getCommand(char **buf, TokenDesc *tokens, char **params);
CBParser(CBGame *inGame = NULL);
virtual ~CBParser();
private:
@@ -78,7 +78,7 @@ private:
char *getAssignmentText(char **buf);
char *getSubText(char **buf, char open, char close);
void skipCharacters(char **buf, const char *toSkip);
- long getObject(char **buf, TokenDesc *tokens, char **name, char **data);
+ int32 getObject(char **buf, TokenDesc *tokens, char **name, char **data);
int _parserLine;
char _lastOffender[255];
char *_whiteSpace;
diff --git a/engines/wintermute/Base/BPersistMgr.cpp b/engines/wintermute/Base/BPersistMgr.cpp
index 01ebb596b9..6491e821ae 100644
--- a/engines/wintermute/Base/BPersistMgr.cpp
+++ b/engines/wintermute/Base/BPersistMgr.cpp
@@ -400,7 +400,7 @@ Common::String CBPersistMgr::getStringObj() {
Common::String retString = ret;
- if (ret == "(null)") {
+ if (retString == "(null)") {
retString = "";
}
diff --git a/engines/wintermute/Base/BRenderSDL.cpp b/engines/wintermute/Base/BRenderSDL.cpp
index e156a76002..b6de4e2bf5 100644
--- a/engines/wintermute/Base/BRenderSDL.cpp
+++ b/engines/wintermute/Base/BRenderSDL.cpp
@@ -46,7 +46,7 @@ RenderTicket::RenderTicket(CBSurfaceSDL *owner, const Graphics::Surface *surf, C
_colorMod = 0;
if (surf) {
_surface = new Graphics::Surface();
- _surface->create(srcRect->width(), srcRect->height(), surf->format);
+ _surface->create((uint16)srcRect->width(), (uint16)srcRect->height(), surf->format);
assert(_surface->format.bytesPerPixel == 4);
// Get a clipped copy of the surface
for (int i = 0; i < _surface->h; i++) {
@@ -362,8 +362,6 @@ void CBRenderSDL::invalidateTicketsFromSurface(CBSurfaceSDL *surf) {
void CBRenderSDL::drawFromTicket(RenderTicket *renderTicket) {
renderTicket->_wantsDraw = true;
- // New item
- uint32 size = _renderQueue.size();
// A new item always has _drawNum == 0
if (renderTicket->_drawNum == 0) {
// In-order
@@ -425,7 +423,6 @@ void CBRenderSDL::drawTickets() {
if (!_dirtyRect)
return;
RenderQueueIterator it = _renderQueue.begin();
- uint32 size = _renderQueue.size();
// Clean out the old tickets
while (it != _renderQueue.end()) {
if ((*it)->_wantsDraw == false) {
diff --git a/engines/wintermute/Base/BSoundBuffer.cpp b/engines/wintermute/Base/BSoundBuffer.cpp
index 92881ab01a..40793efc98 100644
--- a/engines/wintermute/Base/BSoundBuffer.cpp
+++ b/engines/wintermute/Base/BSoundBuffer.cpp
@@ -349,7 +349,7 @@ void CBSoundBuffer::LoopSyncProc(HSYNC handle, uint32 channel, uint32 data, void
//////////////////////////////////////////////////////////////////////////
HRESULT CBSoundBuffer::setPan(float pan) {
if (_stream) {
- g_system->getMixer()->setChannelBalance(*_handle, pan * 127);
+ g_system->getMixer()->setChannelBalance(*_handle, (int8)(pan * 127));
}
return S_OK;
}
diff --git a/engines/wintermute/Base/BStringTable.cpp b/engines/wintermute/Base/BStringTable.cpp
index ed33e4d776..00e791dc5e 100644
--- a/engines/wintermute/Base/BStringTable.cpp
+++ b/engines/wintermute/Base/BStringTable.cpp
@@ -181,7 +181,7 @@ HRESULT CBStringTable::loadFile(const char *filename, bool clearOld) {
return E_FAIL;
}
- int pos = 0;
+ uint32 pos = 0;
if (size > 3 && buffer[0] == 0xEF && buffer[1] == 0xBB && buffer[2] == 0xBF) {
pos += 3;
@@ -192,12 +192,12 @@ HRESULT CBStringTable::loadFile(const char *filename, bool clearOld) {
}
} else Game->_textEncoding = TEXT_ANSI;
- int lineLength = 0;
+ uint32 lineLength = 0;
while (pos < size) {
lineLength = 0;
while (pos + lineLength < size && buffer[pos + lineLength] != '\n' && buffer[pos + lineLength] != '\0') lineLength++;
- int realLength = lineLength - (pos + lineLength >= size ? 0 : 1);
+ uint32 realLength = lineLength - (pos + lineLength >= size ? 0 : 1);
char *line = new char[realLength + 1];
strncpy(line, (char *)&buffer[pos], realLength);
line[realLength] = '\0';
@@ -208,7 +208,7 @@ HRESULT CBStringTable::loadFile(const char *filename, bool clearOld) {
if (value != NULL) {
value[0] = '\0';
value++;
- for (int i = 0; i < strlen(value); i++) {
+ for (uint32 i = 0; i < strlen(value); i++) {
if (value[i] == '|') value[i] = '\n';
}
addString(line, value, clearOld);
diff --git a/engines/wintermute/Base/BSurfaceSDL.cpp b/engines/wintermute/Base/BSurfaceSDL.cpp
index 67304db0af..de61d638a0 100644
--- a/engines/wintermute/Base/BSurfaceSDL.cpp
+++ b/engines/wintermute/Base/BSurfaceSDL.cpp
@@ -505,8 +505,8 @@ HRESULT CBSurfaceSDL::drawSprite(int x, int y, RECT *rect, float zoomX, float zo
position.top = 0; // TODO: Something is wrong
}
- position.setWidth((float)srcRect.width() * zoomX / 100.f);
- position.setHeight((float)srcRect.height() * zoomX / 100.f);
+ position.setWidth((int16)((float)srcRect.width() * zoomX / 100.f));
+ position.setHeight((int16)((float)srcRect.height() * zoomX / 100.f));
renderer->modTargetRect(&position);
diff --git a/engines/wintermute/Base/BTransitionMgr.cpp b/engines/wintermute/Base/BTransitionMgr.cpp
index f2da9b7351..02d6891528 100644
--- a/engines/wintermute/Base/BTransitionMgr.cpp
+++ b/engines/wintermute/Base/BTransitionMgr.cpp
@@ -70,7 +70,8 @@ HRESULT CBTransitionMgr::start(TTransitionType type, bool nonInteractive) {
_preserveInteractive = true;
_origInteractive = Game->_interactive;
Game->_interactive = false;
- } else _preserveInteractive;
+ } /*else _preserveInteractive */;
+
_type = type;
_state = TRANS_MGR_RUNNING;
diff --git a/engines/wintermute/Base/PartEmitter.cpp b/engines/wintermute/Base/PartEmitter.cpp
index ca19651ac9..b5e12ca6d2 100644
--- a/engines/wintermute/Base/PartEmitter.cpp
+++ b/engines/wintermute/Base/PartEmitter.cpp
@@ -245,7 +245,7 @@ HRESULT CPartEmitter::updateInternal(uint32 currentTime, uint32 timerDelta) {
// we're understaffed
if (numLive < _maxParticles) {
bool needsSort = false;
- if (currentTime - _lastGenTime > _genInterval) {
+ if ((int)(currentTime - _lastGenTime) > _genInterval) {
_lastGenTime = currentTime;
_batchesGenerated++;
@@ -293,7 +293,7 @@ HRESULT CPartEmitter::display(CBRegion *region) {
for (int i = 0; i < _particles.GetSize(); i++) {
if (region != NULL && _useRegion) {
- if (!region->pointInRegion(_particles[i]->_pos.x, _particles[i]->_pos.y)) continue;
+ if (!region->pointInRegion((int)_particles[i]->_pos.x, (int)_particles[i]->_pos.y)) continue;
}
_particles[i]->display(this);
diff --git a/engines/wintermute/Base/PartParticle.cpp b/engines/wintermute/Base/PartParticle.cpp
index f69446f36f..aad7594775 100644
--- a/engines/wintermute/Base/PartParticle.cpp
+++ b/engines/wintermute/Base/PartParticle.cpp
@@ -98,23 +98,23 @@ HRESULT CPartParticle::setSprite(const char *filename) {
//////////////////////////////////////////////////////////////////////////
HRESULT CPartParticle::update(CPartEmitter *emitter, uint32 currentTime, uint32 timerDelta) {
if (_state == PARTICLE_FADEIN) {
- if (currentTime - _fadeStart >= _fadeTime) {
+ if (currentTime - _fadeStart >= (uint32)_fadeTime) {
_state = PARTICLE_NORMAL;
_currentAlpha = _alpha1;
- } else _currentAlpha = ((float)currentTime - (float)_fadeStart) / (float)_fadeTime * _alpha1;
+ } else _currentAlpha = (int)(((float)currentTime - (float)_fadeStart) / (float)_fadeTime * _alpha1);
return S_OK;
} else if (_state == PARTICLE_FADEOUT) {
- if (currentTime - _fadeStart >= _fadeTime) {
+ if (currentTime - _fadeStart >= (uint32)_fadeTime) {
_isDead = true;
return S_OK;
- } else _currentAlpha = _fadeStartAlpha - ((float)currentTime - (float)_fadeStart) / (float)_fadeTime * _fadeStartAlpha;
+ } else _currentAlpha = _fadeStartAlpha - (int)(((float)currentTime - (float)_fadeStart) / (float)_fadeTime * _fadeStartAlpha);
return S_OK;
} else {
// time is up
if (_lifeTime > 0) {
- if (currentTime - _creationTime >= _lifeTime) {
+ if (currentTime - _creationTime >= (uint32)_lifeTime) {
if (emitter->_fadeOutTime > 0)
fadeOut(currentTime, emitter->_fadeOutTime);
else
@@ -137,7 +137,7 @@ HRESULT CPartParticle::update(CPartEmitter *emitter, uint32 currentTime, uint32
int age = (int)(currentTime - _creationTime);
int alphaDelta = (int)(_alpha2 - _alpha1);
- _currentAlpha = _alpha1 + ((float)alphaDelta / (float)_lifeTime * (float)age);
+ _currentAlpha = _alpha1 + (int)(((float)alphaDelta / (float)_lifeTime * (float)age));
}
// update position
diff --git a/engines/wintermute/Base/file/BSaveThumbFile.cpp b/engines/wintermute/Base/file/BSaveThumbFile.cpp
index b64efe9ab6..c51cff366a 100644
--- a/engines/wintermute/Base/file/BSaveThumbFile.cpp
+++ b/engines/wintermute/Base/file/BSaveThumbFile.cpp
@@ -58,7 +58,7 @@ HRESULT CBSaveThumbFile::open(const Common::String &filename) {
char *tempFilename = new char[strlen(filename.c_str()) - 8];
strcpy(tempFilename, filename.c_str() + 9);
- for (int i = 0; i < strlen(tempFilename); i++) {
+ for (uint32 i = 0; i < strlen(tempFilename); i++) {
if (tempFilename[i] < '0' || tempFilename[i] > '9') {
tempFilename[i] = '\0';
break;
diff --git a/engines/wintermute/Base/scriptables/SXArray.cpp b/engines/wintermute/Base/scriptables/SXArray.cpp
index 0b3c6a80d5..67466a2489 100644
--- a/engines/wintermute/Base/scriptables/SXArray.cpp
+++ b/engines/wintermute/Base/scriptables/SXArray.cpp
@@ -211,17 +211,17 @@ HRESULT CSXArray::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
bool CSXArray::validNumber(const char *origStr, char *outStr) {
- bool IsNumber = true;
- for (int i = 0; i < strlen(origStr); i++) {
+ bool isNumber = true;
+ for (uint32 i = 0; i < strlen(origStr); i++) {
if (!(origStr[i] >= '0' && origStr[i] <= '9')) {
- IsNumber = false;
+ isNumber = false;
break;
}
}
- if (IsNumber) {
- int Index = atoi(origStr);
- sprintf(outStr, "%d", Index);
+ if (isNumber) {
+ int index = atoi(origStr);
+ sprintf(outStr, "%d", index);
return true;
} else return false;
}
diff --git a/engines/wintermute/Base/scriptables/SXFile.cpp b/engines/wintermute/Base/scriptables/SXFile.cpp
index 83e9302678..58768db80f 100644
--- a/engines/wintermute/Base/scriptables/SXFile.cpp
+++ b/engines/wintermute/Base/scriptables/SXFile.cpp
@@ -271,7 +271,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
byte b;
HRESULT ret = E_FAIL;
- while (counter < textLen) {
+ while (counter < (uint32)textLen) {
ret = _readFile->read(&b, 1);
if (ret != 1) break;
diff --git a/engines/wintermute/Base/scriptables/SXStore.cpp b/engines/wintermute/Base/scriptables/SXStore.cpp
index 585a54fc6a..f987e950d8 100644
--- a/engines/wintermute/Base/scriptables/SXStore.cpp
+++ b/engines/wintermute/Base/scriptables/SXStore.cpp
@@ -139,8 +139,8 @@ HRESULT CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
else if (strcmp(name, "GetInvalidProduct") == 0) {
stack->correctParams(1);
int index = stack->pop()->getInt();
- if (index >= 0 && index < _invalidProducts.size())
- stack->pushString(_invalidProducts[index].c_str());
+ if (index >= 0 && (uint32)index < _invalidProducts.size())
+ stack->pushString(_invalidProducts[(uint32)index].c_str());
else
stack->pushNULL();
@@ -262,7 +262,7 @@ CScValue *CSXStore::scGetProperty(const char *name) {
// NumInvalidProducts (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumInvalidProducts") == 0) {
- _scValue->setInt(_invalidProducts.size());
+ _scValue->setInt((int)_invalidProducts.size());
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/Base/scriptables/SXString.cpp b/engines/wintermute/Base/scriptables/SXString.cpp
index 60a58d3cfd..172ae32ad1 100644
--- a/engines/wintermute/Base/scriptables/SXString.cpp
+++ b/engines/wintermute/Base/scriptables/SXString.cpp
@@ -357,8 +357,8 @@ HRESULT CSXString::scSetProperty(const char *name, CScValue *value) {
// Capacity
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Capacity") == 0) {
- int newCap = value->getInt();
- if (newCap < strlen(_string) + 1) Game->LOG(0, "Warning: cannot lower string capacity");
+ int32 newCap = (uint32)value->getInt();
+ if (newCap < (int32)(strlen(_string) + 1)) Game->LOG(0, "Warning: cannot lower string capacity");
else if (newCap != _capacity) {
char *newStr = new char[newCap];
if (newStr) {
diff --git a/engines/wintermute/Base/scriptables/ScEngine.cpp b/engines/wintermute/Base/scriptables/ScEngine.cpp
index 9b51cb2fe2..665829b6c0 100644
--- a/engines/wintermute/Base/scriptables/ScEngine.cpp
+++ b/engines/wintermute/Base/scriptables/ScEngine.cpp
@@ -289,9 +289,8 @@ byte *CScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool i
//////////////////////////////////////////////////////////////////////////
HRESULT CScEngine::tick() {
-
-
- if (_scripts.GetSize() == 0) return S_OK;
+ if (_scripts.GetSize() == 0)
+ return S_OK;
// resolve waiting scripts
@@ -369,15 +368,15 @@ HRESULT CScEngine::tick() {
// normal script
else {
- uint32 StartTime = 0;
+ uint32 startTime = 0;
bool isProfiling = _isProfiling;
- if (isProfiling) StartTime = CBPlatform::getTime();
+ if (isProfiling) startTime = CBPlatform::getTime();
while (_scripts[i]->_state == SCRIPT_RUNNING) {
_currentScript = _scripts[i];
_scripts[i]->executeInstruction();
}
- if (isProfiling && _scripts[i]->_filename) addScriptTime(_scripts[i]->_filename, CBPlatform::getTime() - StartTime);
+ if (isProfiling && _scripts[i]->_filename) addScriptTime(_scripts[i]->_filename, CBPlatform::getTime() - startTime);
}
_currentScript = NULL;
}
diff --git a/engines/wintermute/Base/scriptables/ScEngine.h b/engines/wintermute/Base/scriptables/ScEngine.h
index 6b290e4e94..ac59f6e31a 100644
--- a/engines/wintermute/Base/scriptables/ScEngine.h
+++ b/engines/wintermute/Base/scriptables/ScEngine.h
@@ -151,7 +151,7 @@ public:
void enableProfiling();
void disableProfiling();
- bool isProfiling() {
+ bool getIsProfiling() {
return _isProfiling;
}
diff --git a/engines/wintermute/Base/scriptables/ScScript.cpp b/engines/wintermute/Base/scriptables/ScScript.cpp
index 180d3d884b..58e61ca3f0 100644
--- a/engines/wintermute/Base/scriptables/ScScript.cpp
+++ b/engines/wintermute/Base/scriptables/ScScript.cpp
@@ -400,7 +400,7 @@ void CScScript::cleanup() {
if (_externals) {
- for (int i = 0; i < _numExternals; i++) {
+ for (uint32 i = 0; i < _numExternals; i++) {
if (_externals[i].nu_params > 0) delete [] _externals[i].params;
}
delete [] _externals;
@@ -431,7 +431,7 @@ void CScScript::cleanup() {
//////////////////////////////////////////////////////////////////////////
uint32 CScScript::getDWORD() {
- _scriptStream->seek(_iP);
+ _scriptStream->seek((int32)_iP);
uint32 ret = _scriptStream->readUint32LE();
_iP += sizeof(uint32);
// assert(oldRet == ret);
@@ -1060,7 +1060,7 @@ HRESULT CScScript::executeInstruction() {
//////////////////////////////////////////////////////////////////////////
uint32 CScScript::getFuncPos(const char *name) {
- for (int i = 0; i < _numFunctions; i++) {
+ for (uint32 i = 0; i < _numFunctions; i++) {
if (strcmp(name, _functions[i].name) == 0)
return _functions[i].pos;
}
@@ -1070,7 +1070,7 @@ uint32 CScScript::getFuncPos(const char *name) {
//////////////////////////////////////////////////////////////////////////
uint32 CScScript::getMethodPos(const char *name) {
- for (int i = 0; i < _numMethods; i++) {
+ for (uint32 i = 0; i < _numMethods; i++) {
if (strcmp(name, _methods[i].name) == 0)
return _methods[i].pos;
}
@@ -1328,7 +1328,7 @@ HRESULT CScScript::resume() {
//////////////////////////////////////////////////////////////////////////
CScScript::TExternalFunction *CScScript::getExternal(char *name) {
- for (int i = 0; i < _numExternals; i++) {
+ for (uint32 i = 0; i < _numExternals; i++) {
if (strcmp(name, _externals[i].name) == 0)
return &_externals[i];
}
diff --git a/engines/wintermute/Base/scriptables/ScScript.h b/engines/wintermute/Base/scriptables/ScScript.h
index 9dbc7d4522..8fd3383ee1 100644
--- a/engines/wintermute/Base/scriptables/ScScript.h
+++ b/engines/wintermute/Base/scriptables/ScScript.h
@@ -153,11 +153,11 @@ public:
virtual ~CScScript();
char *_filename;
char **_symbols;
- int _numSymbols;
+ uint32 _numSymbols;
TFunctionPos *_functions;
TMethodPos *_methods;
TEventPos *_events;
- int _numExternals;
+ uint32 _numExternals;
TExternalFunction *_externals;
uint32 _numFunctions;
uint32 _numMethods;
diff --git a/engines/wintermute/Base/scriptables/ScStack.cpp b/engines/wintermute/Base/scriptables/ScStack.cpp
index 498a8472cc..38efd393ad 100644
--- a/engines/wintermute/Base/scriptables/ScStack.cpp
+++ b/engines/wintermute/Base/scriptables/ScStack.cpp
@@ -111,7 +111,7 @@ CScValue *CScStack::getAt(int index) {
//////////////////////////////////////////////////////////////////////////
void CScStack::correctParams(uint32 expectedParams) {
- int nuParams = pop()->getInt();
+ uint32 nuParams = (uint32)pop()->getInt();
if (expectedParams < nuParams) { // too many params
while (expectedParams < nuParams) {
diff --git a/engines/wintermute/Sys/SysClassRegistry.cpp b/engines/wintermute/Sys/SysClassRegistry.cpp
index 59528f13f1..c29bc19578 100644
--- a/engines/wintermute/Sys/SysClassRegistry.cpp
+++ b/engines/wintermute/Sys/SysClassRegistry.cpp
@@ -244,7 +244,7 @@ HRESULT CSysClassRegistry::saveInstances(CBGame *Game, CBPersistMgr *persistMgr,
if (!quickSave) {
if (counter % 20 == 0) {
- Game->_indicatorProgress = 50 + 50.0f / (float)((float)_classes.size() / (float)counter);
+ Game->_indicatorProgress = (int)(50.0f + 50.0f / (float)((float)_classes.size() / (float)counter));
Game->displayContent(false);
Game->_renderer->flip();
}
@@ -264,7 +264,7 @@ HRESULT CSysClassRegistry::loadInstances(CBGame *Game, CBPersistMgr *persistMgr)
for (int i = 0; i < numInstances; i++) {
if (i % 20 == 0) {
- Game->_indicatorProgress = 50 + 50.0f / (float)((float)numInstances / (float)i);
+ Game->_indicatorProgress = (int)(50.0f + 50.0f / (float)((float)numInstances / (float)i));
Game->displayContentSimple();
Game->_renderer->flip();
}
diff --git a/engines/wintermute/UI/UIObject.cpp b/engines/wintermute/UI/UIObject.cpp
index 519b4d214b..d56e93e4b4 100644
--- a/engines/wintermute/UI/UIObject.cpp
+++ b/engines/wintermute/UI/UIObject.cpp
@@ -238,9 +238,9 @@ HRESULT CUIObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
}
// find by name
else {
- const char *name = val->getString();
+ const char *findName = val->getString();
for (i = 0; i < win->_widgets.GetSize(); i++) {
- if (scumm_stricmp(win->_widgets[i]->_name, name) == 0) {
+ if (scumm_stricmp(win->_widgets[i]->_name, findName) == 0) {
found = true;
break;
}
diff --git a/engines/wintermute/wintermute.cpp b/engines/wintermute/wintermute.cpp
index 2d1f1fdf00..7745589f55 100644
--- a/engines/wintermute/wintermute.cpp
+++ b/engines/wintermute/wintermute.cpp
@@ -269,7 +269,7 @@ int WinterMuteEngine::messageLoop() {
uint32 diff = 0;
const uint32 maxFPS = 25;
- const uint32 frameTime = (1.0/maxFPS) * 1000;
+ const uint32 frameTime = (uint32)((1.0/maxFPS) * 1000);
while (!done) {
Common::Event event;
while (_system->getEventManager()->pollEvent(event)) {