Nuke as many warnings as possible, and several globals as well

- Warnings completely suppressed for the included TinyXML and gzstream libraries
- Parentheses warnings are now errors, since there were several that looked like bugs
- Ditto for dangling else warnings

Some of these warnings were actually bugs:
- Town wandering monsters would have never spawned, because the code to do so was accidentally nested within a check for overall_mode == MODE_OUTDOORS
---> boe.monster.cpp, lines 105-137
- Monster's behaviour with respect to elemental fields did not correctly depend on their immunities (this is the same precedence issue Sylae messed up fixing in the Windows code)
---> boe.monsters.cpp, lines 345-359
- Display of damage blocked by armour appeared to be incorrect (needs verification)
---> boe.newgraph.cpp, line 1079
- Three-choice dialogs probably weren't dealing with unusual button types correctly, though that's a minor point since they aren't expected to use such buttons
This commit is contained in:
2014-12-04 06:16:40 -05:00
parent e7d8a6d848
commit 94d8717a0b
74 changed files with 611 additions and 637 deletions

View File

@@ -375,6 +375,7 @@ static rectangle loadFromPictResource(Handle resHandle, unsigned char*& pixelSto
return rectangle(bounds.top, bounds.left, bounds.bottom, bounds.right);
}
bool tryLoadPictFromResourceFile(fs::path& gpath, sf::Image& graphics_store); // Suppress "no prototype" warning
bool tryLoadPictFromResourceFile(fs::path& gpath, sf::Image& graphics_store) {
static const char*const noGraphics = "The game will still work without the custom graphics, but some things will not look right.";
// TODO: There's no way around it; I'll have to read resource files for this section.
@@ -387,7 +388,7 @@ bool tryLoadPictFromResourceFile(fs::path& gpath, sf::Image& graphics_store) {
err = FSGetResourceForkName(&rsrc);
err = FSOpenResourceFile(&file, rsrc.length, rsrc.unicode, fsRdPerm, &custRef);
if(err != noErr) {
giveError("An old-style .meg graphics file was found, but neither data nor resource fork could not be read.",noGraphics);
giveError("An old-style .meg graphics file was found, but neither data nor resource fork could be read.",noGraphics);
return false;
}
}