WINTERMUTE: Fix Windows build under MSVC2010

This commit is contained in:
Einar Johan Trøan Sømåen 2012-06-01 13:51:06 +02:00 committed by Einar Johan Trøan Sømåen
parent 2f02bec21f
commit 79f86732b8
18 changed files with 33 additions and 32 deletions

View File

@ -43,4 +43,4 @@ public:
} // end of namespace WinterMute
#endif // WINTERMUTE_ADACTORDIR_H
#endif // WINTERMUTE_ADACTORDIR_H

View File

@ -873,7 +873,7 @@ void CAdObject::Talk(const char *Text, const char *Sound, uint32 Duration, const
// set duration by text length
if (_sentence->_duration <= 0) {// TODO: Avoid longs.
_sentence->_duration = MAX((unsigned long)1000, Game->_subtitlesSpeed * strlen(_sentence->_text));
_sentence->_duration = MAX((size_t)1000, Game->_subtitlesSpeed * strlen(_sentence->_text));
}

View File

@ -179,8 +179,9 @@ HRESULT CBDiskFile::Read(void *Buffer, uint32 Size) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBDiskFile::Seek(uint32 Pos, TSeek Origin) {
// TODO: Should this really need to use uint32?
if (_compressed) {
int32 NewPos = 0;
uint32 NewPos = 0;
switch (Origin) {
case SEEK_TO_BEGIN:

View File

@ -427,7 +427,7 @@ HRESULT CBFileManager::RegisterPackage(Common::String Filename , bool SearchSign
package->seek(DirOffset, SEEK_SET);
}
for (int i = 0; i < hdr.NumDirs; i++) {
for (uint32 i = 0; i < hdr.NumDirs; i++) {
CBPackage *pkg = new CBPackage(Game);
if (!pkg) return E_FAIL;
@ -447,7 +447,7 @@ HRESULT CBFileManager::RegisterPackage(Common::String Filename , bool SearchSign
// read file entries
uint32 NumFiles = package->readUint32LE();
for (int j = 0; j < NumFiles; j++) {
for (uint32 j = 0; j < NumFiles; j++) {
char *Name;
uint32 Offset, Length, CompLength, Flags, TimeDate1, TimeDate2;
@ -818,8 +818,10 @@ CBFile *CBFileManager::OpenFileRaw(const char *Filename) {
HRESULT CBFileManager::RestoreCurrentDir() {
if (!_basePath) return S_OK;
else {
if (!chdir(_basePath)) return S_OK;
else return E_FAIL;
/*if (!chdir(_basePath)) return S_OK;
else return E_FAIL;*/
warning("CBFileManager::RestoreCurrentDir - ignored");
return S_OK;
}
}
@ -852,7 +854,7 @@ bool CBFileManager::FindPackageSignature(Common::File *f, uint32 *Offset) {
int StartPos = 1024 * 1024;
int BytesRead = StartPos;
uint32 BytesRead = StartPos;
while (BytesRead < FileSize - 16) {
int ToRead = MIN((unsigned int)32768, FileSize - BytesRead);

View File

@ -89,7 +89,7 @@ long CBParser::GetObject(char **buf, TokenDesc *tokens, char **name, char **data
if (tokens->id == 0) {
char *p = strchr(*buf, '\n');
if (p && p > *buf) {
strncpy(_lastOffender, *buf, MIN((long int)255, p - *buf)); // TODO, clean
strncpy(_lastOffender, *buf, MIN((uint32)255, (uint32)(p - *buf))); // TODO, clean
} else strcpy(_lastOffender, "");
return PARSERR_TOKENNOTFOUND;

View File

@ -61,7 +61,7 @@ HRESULT CBPkgFile::Open(Common::String Filename) {
strcpy(fileName, Filename.c_str());
// correct slashes
for (int i = 0; i < strlen(fileName); i++) {
for (uint32 i = 0; i < strlen(fileName); i++) {
if (fileName[i] == '/') fileName[i] = '\\';
}
@ -78,7 +78,7 @@ HRESULT CBPkgFile::Open(Common::String Filename) {
if (_compressed) {
// TODO: Really, most of this logic might be doable directly in the fileEntry?
// But for now, this should get us rolling atleast.
_file = wrapCompressedReadStream(new Common::SeekableSubReadStream(_file, _fileEntry->_offset, _fileEntry->_offset + _fileEntry->_length, DisposeAfterUse::YES));
_file = Common::wrapCompressedReadStream(new Common::SeekableSubReadStream(_file, _fileEntry->_offset, _fileEntry->_offset + _fileEntry->_length, DisposeAfterUse::YES));
} else {
_file = new Common::SeekableSubReadStream(_file, _fileEntry->_offset, _fileEntry->_offset + _fileEntry->_length, DisposeAfterUse::YES);
}
@ -128,7 +128,7 @@ HRESULT CBPkgFile::Read(void *Buffer, uint32 Size) {
HRESULT CBPkgFile::Seek(uint32 Pos, TSeek Origin) {
if (!_fileEntry) return E_FAIL;
int32 NewPos = 0;
uint32 NewPos = 0;
switch (Origin) {
case SEEK_TO_BEGIN:

View File

@ -506,4 +506,4 @@ HRESULT CBRegion::Mimic(CBRegion *Region, float Scale, int X, int Y) {
return CreateRegion() ? S_OK : E_FAIL;
}
} // end of namespace WinterMute
} // end of namespace WinterMute

View File

@ -122,4 +122,4 @@ private:
} // end of namespace WinterMute
#endif // WINTERMUTE_FONTGLYPHCACHE_H
#endif // WINTERMUTE_FONTGLYPHCACHE_H

View File

@ -56,4 +56,4 @@ public:
} // end of namespace WinterMute
#endif // WINTERMUTE_MATRIX4_H
#endif // WINTERMUTE_MATRIX4_H

View File

@ -518,17 +518,6 @@ AnsiString CBPlatform::GetPlatformName() {
return AnsiString("ScummVM");
}
//////////////////////////////////////////////////////////////////////////
int scumm_stricmp(const char *str1, const char *str2) {
return ::strcasecmp(str1, str2);
}
//////////////////////////////////////////////////////////////////////////
int scumm_strnicmp(const char *str1, const char *str2, size_t maxCount) {
return ::strncasecmp(str1, str2, maxCount);
}
//////////////////////////////////////////////////////////////////////////
char *CBPlatform::strupr(char *string) {
if (string) {

View File

@ -119,6 +119,7 @@ HRESULT CVidPlayer::Cleanup() {
return SetDefaults();
#endif
return 0;
}
@ -268,6 +269,7 @@ HRESULT CVidPlayer::Update() {
} else return E_FAIL;
} else return S_OK;
#endif
return 0;
}
@ -289,6 +291,7 @@ HRESULT CVidPlayer::Display() {
return res;
#endif
return 0;
}

View File

@ -328,6 +328,7 @@ HRESULT CVidTheoraPlayer::Initialize(char *Filename, char *SubtitleFile) {
return Res;
#endif
return 0;
}
@ -588,6 +589,7 @@ float CVidTheoraPlayer::GetMovieTime() {
else if (m_Sound) return (float)(m_Sound->GetPosition()) / 1000.0f + m_TimeOffset;
else return (float)(m_CurrentTime - m_StartTime) / 1000.0f + m_TimeOffset;
#endif
return 0;
}
@ -599,6 +601,7 @@ int CVidTheoraPlayer::GetMovieFrame() {
return Time / ((double)m_TheoraInfo.fps_denominator / m_TheoraInfo.fps_numerator);
#endif
return 0;
}
@ -808,6 +811,7 @@ byte CVidTheoraPlayer::GetAlphaAt(int X, int Y) {
if (_alphaImage) return _alphaImage->GetAlphaAt(X, Y);
else return 0xFF;
#endif
return 0;
}
@ -894,6 +898,7 @@ HRESULT CVidTheoraPlayer::Pause() {
return S_OK;
} else return E_FAIL;
#endif
return 0;
}
//////////////////////////////////////////////////////////////////////////
@ -905,6 +910,7 @@ HRESULT CVidTheoraPlayer::Resume() {
return S_OK;
} else return E_FAIL;
#endif
return 0;
}
//////////////////////////////////////////////////////////////////////////

View File

@ -144,4 +144,4 @@ public:
REGISTER_PLUGIN_DYNAMIC(WINTERMUTE, PLUGIN_TYPE_ENGINE, WinterMuteMetaEngine);
#else
REGISTER_PLUGIN_STATIC(WINTERMUTE, PLUGIN_TYPE_ENGINE, WinterMuteMetaEngine);
#endif
#endif

View File

@ -508,4 +508,4 @@ void StoreKit_RestoreFinishedCallback(void *data, int error) {
#endif // __IPHONEOS__
} // end of namespace WinterMute
} // end of namespace WinterMute

View File

@ -442,7 +442,7 @@ HRESULT CScScript::ExecuteInstruction() {
HRESULT ret = S_OK;
uint32 dw;
const char *str;
const char *str = NULL;
//CScValue* op = new CScValue(Game);
_operand->Cleanup();

View File

@ -118,4 +118,4 @@ Common::Error WinterMuteEngine::run() {
return Common::kNoError;
}
} // End of namespace WinterMute
} // End of namespace WinterMute

View File

@ -62,4 +62,4 @@ public:
} // End of namespace Wintermute
#endif
#endif

View File

@ -169,4 +169,4 @@ typedef bool (*WMEDBG_SHUTDOWN)(IWmeDebugServer *Server);
} // end of namespace WinterMute
#endif // WME_DEBUGGER_H
#endif // WME_DEBUGGER_H