MADS: Fix a bunch of GCC warnings

This commit is contained in:
Paul Gilbert 2014-04-12 12:09:29 -04:00
parent bb82a344a9
commit 8b2a7525cc
11 changed files with 23 additions and 16 deletions

View file

@ -403,6 +403,9 @@ void MADSAction::checkActionAtMousePos() {
} }
} }
break; break;
default:
break;
} }
} }
@ -618,6 +621,9 @@ void MADSAction::leftClick() {
break; break;
} }
break; break;
default:
break;
} }
} }

View file

@ -315,8 +315,8 @@ void Animation::load(UserInterface &interfaceSurface, MSurface &depthSurface,
} }
if (_header._manualFlag) { if (_header._manualFlag) {
Common::String resName = "*" + _header._spriteSetNames[_header._spritesIndex]; Common::String assetResName = "*" + _header._spriteSetNames[_header._spritesIndex];
SpriteAsset *sprites = new SpriteAsset(_vm, resName, flags); SpriteAsset *sprites = new SpriteAsset(_vm, assetResName, flags);
_spriteSets[_header._spritesIndex] = sprites; _spriteSets[_header._spritesIndex] = sprites;
_spriteListIndexes[_header._spritesIndex] = _scene->_sprites.add(sprites); _spriteListIndexes[_header._spritesIndex] = _scene->_sprites.add(sprites);

View file

@ -59,7 +59,7 @@ static const MADSGameDescription gameDescriptions[] = {
0 0
}, },
{ AD_TABLE_END_MARKER } { AD_TABLE_END_MARKER, 0, 0 }
}; };
} // End of namespace MADS } // End of namespace MADS

View file

@ -51,7 +51,6 @@ enum KernelMode {
enum ProtectionResult { enum ProtectionResult {
PROTECTION_SUCCEED = 0, PROTECTION_FAIL = 1, PROTECTION_ESCAPE = 2 PROTECTION_SUCCEED = 0, PROTECTION_FAIL = 1, PROTECTION_ESCAPE = 2
}; };
;
class Game { class Game {
private: private:

View file

@ -169,12 +169,12 @@ bool DialogsNebular::show(int msgId) {
} else if (commandCheck("VERB", valStr, commandText)) { } else if (commandCheck("VERB", valStr, commandText)) {
dialogText += getVocab(action._activeAction._verbId); dialogText += getVocab(action._activeAction._verbId);
} else if (commandCheck("INDEX", valStr, commandText)) { } else if (commandCheck("INDEX", valStr, commandText)) {
int idx = atoi(valStr.c_str()); int idxLocal = atoi(valStr.c_str());
if (_indexList[idx]) if (_indexList[idxLocal])
dialogText += getVocab(_indexList[idx]); dialogText += getVocab(_indexList[idxLocal]);
} else if (commandCheck("NUMBER", valStr, commandText)) { } else if (commandCheck("NUMBER", valStr, commandText)) {
int idx = atoi(valStr.c_str()); int idxLocal = atoi(valStr.c_str());
dialogText += Common::String::format("%.4d", _indexList[idx]); dialogText += Common::String::format("%.4d", _indexList[idxLocal]);
} else if (commandCheck("NOUN1", valStr, commandText)) { } else if (commandCheck("NOUN1", valStr, commandText)) {
if (!textNoun(dialogText, 1, valStr)) if (!textNoun(dialogText, 1, valStr))
dialogText += getVocab(action._activeAction._objectNameId); dialogText += getVocab(action._activeAction._objectNameId);

View file

@ -704,7 +704,7 @@ void GameNebular::step() {
} }
break; break;
case 2: case FACING_SOUTH:
if (randomVal < 500) { if (randomVal < 500) {
for (int count = 0; count < 10; ++count) { for (int count = 0; count < 10; ++count) {
_player.addWalker((randomVal < 250) ? 1 : 2, 0); _player.addWalker((randomVal < 250) ? 1 : 2, 0);
@ -722,6 +722,9 @@ void GameNebular::step() {
} }
} }
break; break;
default:
break;
} }
} }
} }

View file

@ -1298,7 +1298,7 @@ void Scene103::step() {
if (_globals._frameTime <= _scene->_frameStartTime) { if (_globals._frameTime <= _scene->_frameStartTime) {
pt = _vm->_game->_player._playerPos; pt = _vm->_game->_player._playerPos;
int dist = _vm->hypotenuse(pt.x - 79, pt.y - 137); dist = _vm->hypotenuse(pt.x - 79, pt.y - 137);
_vm->_sound->command(29, (dist * -127 / 378) + 127); _vm->_sound->command(29, (dist * -127 / 378) + 127);
pt = _vm->_game->_player._playerPos; pt = _vm->_game->_player._playerPos;

View file

@ -114,7 +114,7 @@ void Rails::setupRouteNode(int *routeIndexP, int nodeIndex, int flags, int route
for (int idx = _nodes.size() - 2; idx > 0; --idx) { for (int idx = _nodes.size() - 2; idx > 0; --idx) {
int nodePos = idx - 1; int nodePos = idx - 1;
if (!_nodes[nodePos]._active && ((currentNode._distances[nodePos] & flags) != 0)) if (!_nodes[nodePos]._active && ((currentNode._distances[nodePos] & flags) != 0))
setupRouteNode(routeIndexP, nodePos, 0x8000, routeLength + distanceVal & 0x3fff); setupRouteNode(routeIndexP, nodePos, 0x8000, routeLength + (distanceVal & 0x3fff));
} }
} }

View file

@ -389,7 +389,7 @@ void ScreenObjects::elementHighlighted() {
int index; int index;
int indexEnd = -1; int indexEnd = -1;
int var8 = 0; int var8 = 0;
int uiCount; //int uiCount;
switch (userInterface._category) { switch (userInterface._category) {
case CAT_COMMAND: case CAT_COMMAND:
@ -461,7 +461,7 @@ void ScreenObjects::elementHighlighted() {
break; break;
default: default:
uiCount = size() - _uiCount; //uiCount = size() - _uiCount;
index = scene._hotspots.size(); index = scene._hotspots.size();
indexEnd = index - 1; indexEnd = index - 1;
varA = 0; varA = 0;

View file

@ -149,7 +149,7 @@ int SequenceList::addTimer(int time, int abortVal) {
if (!_entries[seqIndex]._active) if (!_entries[seqIndex]._active)
break; break;
} }
assert(seqIndex < (int)_entries.size()); assert(seqIndex < _entries.size());
SequenceEntry &se = _entries[seqIndex]; SequenceEntry &se = _entries[seqIndex];
se._active = true; se._active = true;

View file

@ -865,7 +865,6 @@ void UserInterface::updateSelection(ScrCategory category, int newIndex, int *idx
*idx = newIndex; *idx = newIndex;
if (oldIndex >= 0) { if (oldIndex >= 0) {
Common::Rect bounds;
writeVocab(category, oldIndex); writeVocab(category, oldIndex);
if (getBounds(category, oldIndex, bounds)) if (getBounds(category, oldIndex, bounds))