diff options
author | Johannes Schickel | 2013-01-26 05:25:14 -0800 |
---|---|---|
committer | Johannes Schickel | 2013-01-26 05:25:14 -0800 |
commit | 59dde5451908de79a89ee29937f3878cf221cc93 (patch) | |
tree | af40548096459f766726938a0db278224f48705a /engines | |
parent | 94edb3409fa949a6391c54adb4bf7fc4a1d210ad (diff) | |
parent | 4d3ecbfcd2aabf0885df978e6e44ef8b8256c657 (diff) | |
download | scummvm-rg350-59dde5451908de79a89ee29937f3878cf221cc93.tar.gz scummvm-rg350-59dde5451908de79a89ee29937f3878cf221cc93.tar.bz2 scummvm-rg350-59dde5451908de79a89ee29937f3878cf221cc93.zip |
Merge pull request #301 from lordhoto/c++11-playground
RFC: Allow use of override and nullptr. Also allow C++11 compilation.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agi/op_cmd.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/sound_intern.h | 6 | ||||
-rw-r--r-- | engines/pegasus/neighborhood/mars/reactor.cpp | 6 | ||||
-rw-r--r-- | engines/saga/resource.cpp | 12 | ||||
-rw-r--r-- | engines/scumm/saveload.h | 14 | ||||
-rw-r--r-- | engines/sky/compact.cpp | 2 | ||||
-rw-r--r-- | engines/sword25/gfx/graphicengine.cpp | 8 |
7 files changed, 25 insertions, 25 deletions
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 5334407eb8..9d899b1855 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -1399,7 +1399,7 @@ void cmdDistance(AgiGame *state, uint8 *p) { // a zombie or the zombie getting turned away by the scarab) we make it appear the // zombie is far away from Rosella if the zombie is not already up and chasing her. enum zombieStates {ZOMBIE_SET_TO_RISE_UP, ZOMBIE_RISING_UP, ZOMBIE_CHASING_EGO}; - uint8 zombieStateVarNumList[] = {155, 156, (_v[vCurRoom] == 16) ? 162 : 158}; + uint8 zombieStateVarNumList[] = {155, 156, (uint8)((_v[vCurRoom] == 16) ? 162 : 158)}; uint8 zombieNum = p2 - 221; // Zombie's number (In range 0-2) uint8 zombieStateVarNum = zombieStateVarNumList[zombieNum]; // Number of the variable containing zombie's state uint8 zombieState = _v[zombieStateVarNum]; // Zombie's state diff --git a/engines/kyra/sound_intern.h b/engines/kyra/sound_intern.h index 4bf43d73d8..007ca3d3f5 100644 --- a/engines/kyra/sound_intern.h +++ b/engines/kyra/sound_intern.h @@ -183,7 +183,7 @@ public: virtual void haltTrack(); virtual void beginFadeOut(); - virtual int32 voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volume, uint8 priority, bool isSfx) { return -1; } + virtual int32 voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volume, uint8 priority, bool isSfx) override { return -1; } virtual void playSoundEffect(uint8 track, uint8 volume = 0xFF); virtual void updateVolumeSettings(); @@ -219,7 +219,7 @@ public: virtual void haltTrack(); virtual void beginFadeOut(); - virtual int32 voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volume = 255, uint8 priority = 255, bool isSfx = true); + virtual int32 voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volume = 255, uint8 priority = 255, bool isSfx = true) override; virtual void playSoundEffect(uint8 track, uint8 volume = 0xFF); virtual void updateVolumeSettings(); @@ -334,7 +334,7 @@ public: virtual void haltTrack(); virtual void beginFadeOut(); - virtual int32 voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volume, uint8 priority, bool isSfx) { return -1; } + virtual int32 voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volume, uint8 priority, bool isSfx) override { return -1; } virtual void playSoundEffect(uint8 track, uint8 volume = 0xFF); protected: diff --git a/engines/pegasus/neighborhood/mars/reactor.cpp b/engines/pegasus/neighborhood/mars/reactor.cpp index 334fb98879..3a7ef9d7eb 100644 --- a/engines/pegasus/neighborhood/mars/reactor.cpp +++ b/engines/pegasus/neighborhood/mars/reactor.cpp @@ -244,9 +244,9 @@ void ReactorHistory::draw(const Common::Rect &) { static const CoordType kColorTops[5] = { 0, kColorHeights[0], - kColorHeights[0] + kColorHeights[1], - kColorHeights[0] + kColorHeights[1] + kColorHeights[2], - kColorHeights[0] + kColorHeights[1] + kColorHeights[2] + kColorHeights[3], + (CoordType)(kColorHeights[0] + kColorHeights[1]), + (CoordType)(kColorHeights[0] + kColorHeights[1] + kColorHeights[2]), + (CoordType)(kColorHeights[0] + kColorHeights[1] + kColorHeights[2] + kColorHeights[3]), }; if (_colors.isSurfaceValid() && _digits.isSurfaceValid()) { diff --git a/engines/saga/resource.cpp b/engines/saga/resource.cpp index 1b0dfa2f22..8025a949d4 100644 --- a/engines/saga/resource.cpp +++ b/engines/saga/resource.cpp @@ -200,15 +200,15 @@ bool Resource::createContexts() { //// Detect and add voice files ///////////////////////////////////////////// SoundFileInfo voiceFiles[] = { - { GID_ITE, "voices.rsc", false , (_soundFileName[0] == 0) ? GAME_SOUNDFILE : 0}, - { GID_ITE, "voices.cmp", true , (_soundFileName[0] == 0) ? GAME_SOUNDFILE : 0}, - { GID_ITE, "voicesd.rsc", false , (_soundFileName[0] == 0) ? GAME_SOUNDFILE : 0}, - { GID_ITE, "voicesd.cmp", true , (_soundFileName[0] == 0) ? GAME_SOUNDFILE : 0}, + { GID_ITE, "voices.rsc", false , (uint16)((_soundFileName[0] == 0) ? GAME_SOUNDFILE : 0)}, + { GID_ITE, "voices.cmp", true , (uint16)((_soundFileName[0] == 0) ? GAME_SOUNDFILE : 0)}, + { GID_ITE, "voicesd.rsc", false , (uint16)((_soundFileName[0] == 0) ? GAME_SOUNDFILE : 0)}, + { GID_ITE, "voicesd.cmp", true , (uint16)((_soundFileName[0] == 0) ? GAME_SOUNDFILE : 0)}, // The resources in the Wyrmkeep combined Windows/Mac/Linux CD version are little endian, but // the voice file is big endian. If we got such a version with mixed files, mark this voice file // as big endian - { GID_ITE, "inherit the earth voices", false , _vm->isBigEndian() ? 0 : GAME_SWAPENDIAN}, - { GID_ITE, "inherit the earth voices.cmp", true , _vm->isBigEndian() ? 0 : GAME_SWAPENDIAN}, + { GID_ITE, "inherit the earth voices", false , (uint16)(_vm->isBigEndian() ? 0 : GAME_SWAPENDIAN)}, + { GID_ITE, "inherit the earth voices.cmp", true , (uint16)(_vm->isBigEndian() ? 0 : GAME_SWAPENDIAN)}, { GID_ITE, "ite voices.bin", false , GAME_MACBINARY}, #ifdef ENABLE_IHNM { GID_IHNM, "voicess.res", false , 0}, diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h index 4bfa7d0e71..7b2ff91ad3 100644 --- a/engines/scumm/saveload.h +++ b/engines/scumm/saveload.h @@ -74,7 +74,7 @@ namespace Scumm { * what POD means refer to <http://en.wikipedia.org/wiki/Plain_Old_Data_Structures> or * to <http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=32&rl=1>) */ -#define OFFS(type,item) (((ptrdiff_t)(&((type *)42)->type::item))-42) +#define OFFS(type,item) ((uint32)(((ptrdiff_t)(&((type *)42)->type::item))-42)) /** * Similar to the OFFS macro, this macro computes the size (in bytes) of a @@ -84,19 +84,19 @@ namespace Scumm { // Any item that is still in use automatically gets a maxVersion equal to CURRENT_VER #define MKLINE(type,item,saveas,minVer) {OFFS(type,item),saveas,SIZE(type,item),minVer,CURRENT_VER} -#define MKARRAY(type,item,saveas,dim,minVer) {OFFS(type,item),128|saveas,SIZE(type,item),minVer,CURRENT_VER}, {dim,1,0,0,0} -#define MKARRAY2(type,item,saveas,dim,dim2,rowlen,minVer) {OFFS(type,item),128|saveas,SIZE(type,item),minVer,CURRENT_VER}, {dim,dim2,rowlen,0,0} +#define MKARRAY(type,item,saveas,dim,minVer) {OFFS(type,item),128|saveas,SIZE(type,item),minVer,CURRENT_VER}, {(uint32)(dim),1,0,0,0} +#define MKARRAY2(type,item,saveas,dim,dim2,rowlen,minVer) {OFFS(type,item),128|saveas,SIZE(type,item),minVer,CURRENT_VER}, {(uint32)(dim),(uint32)(dim2),(uint16)(rowlen),0,0} // Use this if you have an entry that used to be smaller: #define MKLINE_OLD(type,item,saveas,minVer,maxVer) {OFFS(type,item),saveas,SIZE(type,item),minVer,maxVer} -#define MKARRAY_OLD(type,item,saveas,dim,minVer,maxVer) {OFFS(type,item),128|saveas,SIZE(type,item),minVer,maxVer}, {dim,1,0,0,0} -#define MKARRAY2_OLD(type,item,saveas,dim,dim2,rowlen,minVer,maxVer) {OFFS(type,item),128|saveas,SIZE(type,item),minVer,maxVer}, {dim,dim2,rowlen,0,0} +#define MKARRAY_OLD(type,item,saveas,dim,minVer,maxVer) {OFFS(type,item),128|saveas,SIZE(type,item),minVer,maxVer}, {(uint32)(dim),1,0,0,0} +#define MKARRAY2_OLD(type,item,saveas,dim,dim2,rowlen,minVer,maxVer) {OFFS(type,item),128|saveas,SIZE(type,item),minVer,maxVer}, {(uint32)(dim),(uint32)(dim2),(uint16)(rowlen),0,0} // An obsolete item/array, to be ignored upon load. We retain the type/item params to make it easier to debug. // Obsolete items have size == 0. #define MK_OBSOLETE(type,item,saveas,minVer,maxVer) {0,saveas,0,minVer,maxVer} -#define MK_OBSOLETE_ARRAY(type,item,saveas,dim,minVer,maxVer) {0,128|saveas,0,minVer,maxVer}, {dim,1,0,0,0} -#define MK_OBSOLETE_ARRAY2(type,item,saveas,dim,dim2,rowlen,minVer,maxVer) {0,128|saveas,0,minVer,maxVer}, {dim,dim2,rowlen,0,0} +#define MK_OBSOLETE_ARRAY(type,item,saveas,dim,minVer,maxVer) {0,128|saveas,0,minVer,maxVer}, {(uint32)(dim),1,0,0,0} +#define MK_OBSOLETE_ARRAY2(type,item,saveas,dim,dim2,rowlen,minVer,maxVer) {0,128|saveas,0,minVer,maxVer}, {(uint32)(dim),(uint32)(dim2),(uint16)(rowlen),0,0} // End marker #define MKEND() {0xFFFF,0xFF,0xFF,0,0} diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp index cf9bd55b1a..ee165934a0 100644 --- a/engines/sky/compact.cpp +++ b/engines/sky/compact.cpp @@ -34,7 +34,7 @@ namespace Sky { #define SKY_CPT_SIZE 419427 -#define OFFS(type,item) (((ptrdiff_t)(&((type *)42)->item))-42) +#define OFFS(type,item) ((uint32)(((ptrdiff_t)(&((type *)42)->item))-42)) #define MK32(type,item) OFFS(type, item),0,0,0 #define MK16(type,item) OFFS(type, item),0 #define MK32_A5(type, item) MK32(type, item[0]), MK32(type, item[1]), \ diff --git a/engines/sword25/gfx/graphicengine.cpp b/engines/sword25/gfx/graphicengine.cpp index 6f5da32bc4..216d801f3e 100644 --- a/engines/sword25/gfx/graphicengine.cpp +++ b/engines/sword25/gfx/graphicengine.cpp @@ -376,10 +376,10 @@ bool GraphicEngine::saveThumbnailScreenshot(const Common::String &filename) { void GraphicEngine::ARGBColorToLuaColor(lua_State *L, uint color) { lua_Number components[4] = { - (color >> 16) & 0xff, // Rot - (color >> 8) & 0xff, // Grün - color & 0xff, // Blau - color >> 24, // Alpha + (lua_Number)((color >> 16) & 0xff), // Rot + (lua_Number)((color >> 8) & 0xff), // Grün + (lua_Number)(color & 0xff), // Blau + (lua_Number)(color >> 24), // Alpha }; lua_newtable(L); |