[Scummvm-git-logs] scummvm master -> e4fca9610b8467ecc0d49862647ee5fdc3fc3c13
dreammaster
paulfgilbert at gmail.com
Sat Sep 5 22:21:56 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e4fca9610b ULTIMA4: Symbian compilation fix
Commit: e4fca9610b8467ecc0d49862647ee5fdc3fc3c13
https://github.com/scummvm/scummvm/commit/e4fca9610b8467ecc0d49862647ee5fdc3fc3c13
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-09-05T15:17:52-07:00
Commit Message:
ULTIMA4: Symbian compilation fix
Changed paths:
engines/ultima/ultima4/controllers/combat_controller.cpp
engines/ultima/ultima4/controllers/game_controller.cpp
engines/ultima/ultima4/controllers/intro_controller.cpp
engines/ultima/ultima4/controllers/key_handler_controller.cpp
engines/ultima/ultima4/core/debugger.cpp
engines/ultima/ultima4/core/debugger_actions.cpp
engines/ultima/ultima4/core/utils.cpp
engines/ultima/ultima4/core/utils.h
engines/ultima/ultima4/events/event_handler.cpp
engines/ultima/ultima4/game/game.cpp
engines/ultima/ultima4/game/person.cpp
engines/ultima/ultima4/game/player.cpp
engines/ultima/ultima4/game/spell.cpp
engines/ultima/ultima4/gfx/image.cpp
engines/ultima/ultima4/gfx/imageloader_fmtowns.cpp
engines/ultima/ultima4/gfx/imageloader_u4.cpp
engines/ultima/ultima4/gfx/scale.cpp
engines/ultima/ultima4/gfx/screen.cpp
engines/ultima/ultima4/map/map.cpp
engines/ultima/ultima4/map/maploader.cpp
engines/ultima/ultima4/map/movement.cpp
engines/ultima/ultima4/sound/sound.cpp
engines/ultima/ultima4/views/menuitem.cpp
engines/ultima/ultima4/views/stats.cpp
engines/ultima/ultima4/views/textview.cpp
engines/ultima/ultima4/views/tileview.cpp
diff --git a/engines/ultima/ultima4/controllers/combat_controller.cpp b/engines/ultima/ultima4/controllers/combat_controller.cpp
index 1c9b89bf05..44d89add17 100644
--- a/engines/ultima/ultima4/controllers/combat_controller.cpp
+++ b/engines/ultima/ultima4/controllers/combat_controller.cpp
@@ -205,7 +205,7 @@ void CombatController::initDungeonRoom(int room, Direction from) {
int i;
init(nullptr);
- ASSERT(g_context->_location->_prev->_context & CTX_DUNGEON, "Error: called initDungeonRoom from non-dungeon context");
+ assertMsg(g_context->_location->_prev->_context & CTX_DUNGEON, "Error: called initDungeonRoom from non-dungeon context");
{
Dungeon *dng = dynamic_cast<Dungeon *>(g_context->_location->_prev->_map);
assert(dng);
@@ -565,8 +565,8 @@ void CombatController::awardLoot() {
}
bool CombatController::attackHit(Creature *attacker, Creature *defender) {
- ASSERT(attacker != nullptr, "attacker must not be nullptr");
- ASSERT(defender != nullptr, "defender must not be nullptr");
+ assertMsg(attacker != nullptr, "attacker must not be nullptr");
+ assertMsg(defender != nullptr, "defender must not be nullptr");
int attackValue = xu4_random(0x100) + attacker->getAttackBonus();
int defenseValue = defender->getDefense();
diff --git a/engines/ultima/ultima4/controllers/game_controller.cpp b/engines/ultima/ultima4/controllers/game_controller.cpp
index 577bd18ab1..ecab0c3230 100644
--- a/engines/ultima/ultima4/controllers/game_controller.cpp
+++ b/engines/ultima/ultima4/controllers/game_controller.cpp
@@ -287,7 +287,7 @@ void GameController::flashTile(const Coords &coords, MapTile tile, int frames) {
void GameController::flashTile(const Coords &coords, const Common::String &tilename, int timeFactor) {
Tile *tile = g_context->_location->_map->_tileSet->getByName(tilename);
- ASSERT(tile, "no tile named '%s' found in tileset", tilename.c_str());
+ assertMsg(tile, "no tile named '%s' found in tileset", tilename.c_str());
flashTile(coords, tile->getId(), timeFactor);
}
@@ -358,9 +358,9 @@ void GameController::initMoons() {
int trammelphase = g_ultima->_saveGame->_trammelPhase,
feluccaphase = g_ultima->_saveGame->_feluccaPhase;
- ASSERT(g_context != nullptr, "Game context doesn't exist!");
- ASSERT(g_ultima->_saveGame != nullptr, "Savegame doesn't exist!");
- //ASSERT(mapIsWorldMap(c->location->map) && c->location->viewMode == VIEW_NORMAL, "Can only call gameInitMoons() from the world map!");
+ assertMsg(g_context != nullptr, "Game context doesn't exist!");
+ assertMsg(g_ultima->_saveGame != nullptr, "Savegame doesn't exist!");
+ //assertMsg(mapIsWorldMap(c->location->map) && c->location->viewMode == VIEW_NORMAL, "Can only call gameInitMoons() from the world map!");
g_ultima->_saveGame->_trammelPhase = g_ultima->_saveGame->_feluccaPhase = 0;
g_context->_moonPhase = 0;
@@ -779,7 +779,7 @@ bool GameController::createBalloon(Map *map) {
}
const Tile *balloon = map->_tileSet->getByName("balloon");
- ASSERT(balloon, "no balloon tile found in tileset");
+ assertMsg(balloon, "no balloon tile found in tileset");
map->addObject(balloon->getId(), balloon->getId(), map->getLabel("balloon"));
return true;
}
diff --git a/engines/ultima/ultima4/controllers/intro_controller.cpp b/engines/ultima/ultima4/controllers/intro_controller.cpp
index 9e9b23b267..1189b69d28 100644
--- a/engines/ultima/ultima4/controllers/intro_controller.cpp
+++ b/engines/ultima/ultima4/controllers/intro_controller.cpp
@@ -356,7 +356,7 @@ void IntroController::deleteIntro() {
}
byte *IntroController::getSigData() {
- ASSERT(_binData->_sigData != nullptr, "intro sig data not loaded");
+ assertMsg(_binData->_sigData != nullptr, "intro sig data not loaded");
return _binData->_sigData;
}
@@ -583,7 +583,7 @@ void IntroController::drawBeastie(int beast, int vertoffset, int frame) {
char buffer[128];
int destx;
- ASSERT(beast == 0 || beast == 1, "invalid beast: %d", beast);
+ assertMsg(beast == 0 || beast == 1, "invalid beast: %d", beast);
sprintf(buffer, "beast%dframe%02d", beast, frame);
@@ -601,16 +601,16 @@ void IntroController::drawCard(int pos, int card) {
"sacrificecard", "honorcard", "spiritualitycard", "humilitycard"
};
- ASSERT(pos == 0 || pos == 1, "invalid pos: %d", pos);
- ASSERT(card >= 0 && card < 8, "invalid card: %d", card);
+ assertMsg(pos == 0 || pos == 1, "invalid pos: %d", pos);
+ assertMsg(card >= 0 && card < 8, "invalid card: %d", card);
_backgroundArea.draw(cardNames[card], pos ? 218 : 12, 12);
}
void IntroController::drawAbacusBeads(int row, int selectedVirtue, int rejectedVirtue) {
- ASSERT(row >= 0 && row < 7, "invalid row: %d", row);
- ASSERT(selectedVirtue < 8 && selectedVirtue >= 0, "invalid virtue: %d", selectedVirtue);
- ASSERT(rejectedVirtue < 8 && rejectedVirtue >= 0, "invalid virtue: %d", rejectedVirtue);
+ assertMsg(row >= 0 && row < 7, "invalid row: %d", row);
+ assertMsg(selectedVirtue < 8 && selectedVirtue >= 0, "invalid virtue: %d", selectedVirtue);
+ assertMsg(rejectedVirtue < 8 && rejectedVirtue >= 0, "invalid virtue: %d", rejectedVirtue);
_backgroundArea.draw("whitebead", 128 + (selectedVirtue * 9), 24 + (row * 15));
_backgroundArea.draw("blackbead", 128 + (rejectedVirtue * 9), 24 + (row * 15));
@@ -878,7 +878,7 @@ Common::String IntroController::getQuestion(int v1, int v2) {
int i = 0;
int d = 7;
- ASSERT(v1 < v2, "first virtue must be smaller (v1 = %d, v2 = %d)", v1, v2);
+ assertMsg(v1 < v2, "first virtue must be smaller (v1 = %d, v2 = %d)", v1, v2);
while (v1 > 0) {
i += d;
@@ -887,7 +887,7 @@ Common::String IntroController::getQuestion(int v1, int v2) {
v2--;
}
- ASSERT((i + v2 - 1) < 28, "calculation failed");
+ assertMsg((i + v2 - 1) < 28, "calculation failed");
return _binData->_introQuestions[i + v2 - 1];
}
@@ -1323,7 +1323,7 @@ void IntroController::initPlayers(SaveGame *saveGame) {
saveGame->_players[0]._class = static_cast<ClassType>(_questionTree[14]);
- ASSERT((int)saveGame->_players[0]._class < 8, "bad class: %d", saveGame->_players[0]._class);
+ assertMsg((int)saveGame->_players[0]._class < 8, "bad class: %d", saveGame->_players[0]._class);
saveGame->_positions.resize(1);
saveGame->_positions[0] = LocationCoords(MAP_WORLD,
initValuesForClass[saveGame->_players[0]._class].x,
diff --git a/engines/ultima/ultima4/controllers/key_handler_controller.cpp b/engines/ultima/ultima4/controllers/key_handler_controller.cpp
index a90b43887c..1f034043fc 100644
--- a/engines/ultima/ultima4/controllers/key_handler_controller.cpp
+++ b/engines/ultima/ultima4/controllers/key_handler_controller.cpp
@@ -109,7 +109,7 @@ KeyHandlerController::~KeyHandlerController() {
}
bool KeyHandlerController::keyPressed(int key) {
- ASSERT(_handler != nullptr, "key handler must be initialized");
+ assertMsg(_handler != nullptr, "key handler must be initialized");
return _handler->handle(key);
}
diff --git a/engines/ultima/ultima4/core/debugger.cpp b/engines/ultima/ultima4/core/debugger.cpp
index c050d0aec4..a80ad7880b 100644
--- a/engines/ultima/ultima4/core/debugger.cpp
+++ b/engines/ultima/ultima4/core/debugger.cpp
@@ -549,7 +549,7 @@ bool Debugger::cmdExit(int argc, const char **argv) {
g_context->_lastShip = obj;
Tile *avatar = g_context->_location->_map->_tileSet->getByName("avatar");
- ASSERT(avatar, "no avatar tile found in tileset");
+ assertMsg(avatar, "no avatar tile found in tileset");
g_context->_party->setTransport(avatar->getId());
g_context->_horseSpeed = 0;
diff --git a/engines/ultima/ultima4/core/debugger_actions.cpp b/engines/ultima/ultima4/core/debugger_actions.cpp
index b56bd076d5..5d47b95d60 100644
--- a/engines/ultima/ultima4/core/debugger_actions.cpp
+++ b/engines/ultima/ultima4/core/debugger_actions.cpp
@@ -176,7 +176,7 @@ bool DebuggerActions::jimmyAt(const Coords &coords) {
if (g_ultima->_saveGame->_keys) {
Tile *door = g_context->_location->_map->_tileSet->getByName("door");
- ASSERT(door, "no door tile found in tileset");
+ assertMsg(door, "no door tile found in tileset");
g_ultima->_saveGame->_keys--;
g_context->_location->_map->_annotations->add(coords, door->getId());
g_screen->screenMessage("\nUnlocked!\n");
@@ -295,7 +295,7 @@ bool DebuggerActions::openAt(const Coords &coords) {
}
Tile *floor = g_context->_location->_map->_tileSet->getByName("brick_floor");
- ASSERT(floor, "no floor tile found in tileset");
+ assertMsg(floor, "no floor tile found in tileset");
g_context->_location->_map->_annotations->add(coords, floor->getId(), false, true)->setTTL(4);
g_screen->screenMessage("\nOpened!\n");
diff --git a/engines/ultima/ultima4/core/utils.cpp b/engines/ultima/ultima4/core/utils.cpp
index a6c19a09d7..6d1f65d1f2 100644
--- a/engines/ultima/ultima4/core/utils.cpp
+++ b/engines/ultima/ultima4/core/utils.cpp
@@ -25,7 +25,7 @@
namespace Ultima {
namespace Ultima4 {
-void ASSERT(bool exp, const char *desc, ...) {
+void assertMsg(bool exp, const char *desc, ...) {
if (!exp) {
va_list args;
va_start(args, desc);
diff --git a/engines/ultima/ultima4/core/utils.h b/engines/ultima/ultima4/core/utils.h
index 4c30a5f2e0..44b3b2fe8f 100644
--- a/engines/ultima/ultima4/core/utils.h
+++ b/engines/ultima/ultima4/core/utils.h
@@ -32,7 +32,7 @@
namespace Ultima {
namespace Ultima4 {
-extern void ASSERT(bool exp, const char *desc, ...);
+extern void assertMsg(bool exp, const char *desc, ...);
/* The AdjustValue functions used to be #define'd macros, but these are
* evil for several reasons, *especially* when they contain multiple
diff --git a/engines/ultima/ultima4/events/event_handler.cpp b/engines/ultima/ultima4/events/event_handler.cpp
index 50c218ebbe..8400a19bbc 100644
--- a/engines/ultima/ultima4/events/event_handler.cpp
+++ b/engines/ultima/ultima4/events/event_handler.cpp
@@ -219,7 +219,7 @@ KeyHandler *EventHandler::getKeyHandler() const {
return nullptr;
KeyHandlerController *khc = dynamic_cast<KeyHandlerController *>(_controllers.back());
- ASSERT(khc != nullptr, "EventHandler::getKeyHandler called when controller wasn't a keyhandler");
+ assertMsg(khc != nullptr, "EventHandler::getKeyHandler called when controller wasn't a keyhandler");
if (khc == nullptr)
return nullptr;
diff --git a/engines/ultima/ultima4/game/game.cpp b/engines/ultima/ultima4/game/game.cpp
index 66af216ed6..00b87e37d9 100644
--- a/engines/ultima/ultima4/game/game.cpp
+++ b/engines/ultima/ultima4/game/game.cpp
@@ -205,7 +205,7 @@ int gameGetPlayer(bool canBeDisabled, bool canBeActivePlayer) {
return -1;
}
- ASSERT(player < g_context->_party->size(), "player %d, but only %d members\n", player, g_context->_party->size());
+ assertMsg(player < g_context->_party->size(), "player %d, but only %d members\n", player, g_context->_party->size());
return player;
}
diff --git a/engines/ultima/ultima4/game/person.cpp b/engines/ultima/ultima4/game/person.cpp
index 7170d62f72..d17bb25262 100644
--- a/engines/ultima/ultima4/game/person.cpp
+++ b/engines/ultima/ultima4/game/person.cpp
@@ -149,7 +149,7 @@ void Person::setDialogue(Dialogue *d) {
void Person::setNpcType(PersonNpcType t) {
_npcType = t;
- ASSERT(!isVendor() || _dialogue == nullptr, "vendor has dialogue");
+ assertMsg(!isVendor() || _dialogue == nullptr, "vendor has dialogue");
}
Common::List<Common::String> Person::getConversationText(Conversation *cnv, const char *inquiry) {
@@ -267,18 +267,18 @@ Common::List<Common::String> Person::getConversationText(Conversation *cnv, cons
break;
case Conversation::CONFIRMATION:
- ASSERT(_npcType == NPC_LORD_BRITISH, "invalid state: %d", cnv->_state);
+ assertMsg(_npcType == NPC_LORD_BRITISH, "invalid state: %d", cnv->_state);
text += lordBritishGetQuestionResponse(cnv, inquiry);
break;
case Conversation::ASK:
case Conversation::ASKYESNO:
- ASSERT(_npcType != NPC_HAWKWIND, "invalid state for hawkwind conversation");
+ assertMsg(_npcType != NPC_HAWKWIND, "invalid state for hawkwind conversation");
text += talkerGetQuestionResponse(cnv, inquiry) + "\n";
break;
case Conversation::GIVEBEGGAR:
- ASSERT(_npcType == NPC_TALKER_BEGGAR, "invalid npc type: %d", _npcType);
+ assertMsg(_npcType == NPC_TALKER_BEGGAR, "invalid npc type: %d", _npcType);
text = beggarGetQuantityResponse(cnv, inquiry);
break;
diff --git a/engines/ultima/ultima4/game/player.cpp b/engines/ultima/ultima4/game/player.cpp
index 86c96f6141..c72a5b9c63 100644
--- a/engines/ultima/ultima4/game/player.cpp
+++ b/engines/ultima/ultima4/game/player.cpp
@@ -545,7 +545,7 @@ MapTile PartyMember::tileForClass(int klass) {
}
const Tile *tile = g_tileSets->get("base")->getByName(name);
- ASSERT(tile, "no tile found for class %d", klass);
+ assertMsg(tile, "no tile found for class %d", klass);
return tile->getId();
}
@@ -1069,7 +1069,7 @@ MapTile Party::getTransport() const {
void Party::setTransport(MapTile tile) {
// transport value stored in savegame hardcoded to index into base tilemap
_saveGame->_transport = g_tileMaps->get("base")->untranslate(tile);
- ASSERT(_saveGame->_transport != 0, "could not generate valid savegame transport for tile with id %d\n", tile._id);
+ assertMsg(_saveGame->_transport != 0, "could not generate valid savegame transport for tile with id %d\n", tile._id);
_transport = tile;
@@ -1131,8 +1131,8 @@ int Party::getActivePlayer() const {
}
void Party::swapPlayers(int p1, int p2) {
- ASSERT(p1 < _saveGame->_members, "p1 out of range: %d", p1);
- ASSERT(p2 < _saveGame->_members, "p2 out of range: %d", p2);
+ assertMsg(p1 < _saveGame->_members, "p1 out of range: %d", p1);
+ assertMsg(p2 < _saveGame->_members, "p2 out of range: %d", p2);
SaveGamePlayerRecord tmp = _saveGame->_players[p1];
_saveGame->_players[p1] = g_ultima->_saveGame->_players[p2];
diff --git a/engines/ultima/ultima4/game/spell.cpp b/engines/ultima/ultima4/game/spell.cpp
index dd29fceb79..651d5a5d9e 100644
--- a/engines/ultima/ultima4/game/spell.cpp
+++ b/engines/ultima/ultima4/game/spell.cpp
@@ -120,7 +120,7 @@ Ingredients::Ingredients() {
}
bool Ingredients::addReagent(Reagent reagent) {
- ASSERT(reagent < REAG_MAX, "invalid reagent: %d", reagent);
+ assertMsg(reagent < REAG_MAX, "invalid reagent: %d", reagent);
if (g_context->_party->getReagent(reagent) < 1)
return false;
g_context->_party->adjustReagent(reagent, -1);
@@ -129,7 +129,7 @@ bool Ingredients::addReagent(Reagent reagent) {
}
bool Ingredients::removeReagent(Reagent reagent) {
- ASSERT(reagent < REAG_MAX, "invalid reagent: %d", reagent);
+ assertMsg(reagent < REAG_MAX, "invalid reagent: %d", reagent);
if (_reagents[reagent] == 0)
return false;
g_context->_party->adjustReagent(reagent, 1);
@@ -138,7 +138,7 @@ bool Ingredients::removeReagent(Reagent reagent) {
}
int Ingredients::getReagent(Reagent reagent) const {
- ASSERT(reagent < REAG_MAX, "invalid reagent: %d", reagent);
+ assertMsg(reagent < REAG_MAX, "invalid reagent: %d", reagent);
return _reagents[reagent];
}
@@ -162,7 +162,7 @@ bool Ingredients::checkMultiple(int batches) const {
}
void Ingredients::multiply(int batches) {
- ASSERT(checkMultiple(batches), "not enough reagents to multiply ingredients by %d\n", batches);
+ assertMsg(checkMultiple(batches), "not enough reagents to multiply ingredients by %d\n", batches);
for (int i = 0; i < REAG_MAX; i++) {
if (_reagents[i] > 0) {
g_ultima->_saveGame->_reagents[i] -= batches - 1;
@@ -188,25 +188,25 @@ void Spells::spellSetEffectCallback(SpellEffectCallback callback) {
}
const char *Spells::spellGetName(uint spell) const {
- ASSERT(spell < N_SPELLS, "invalid spell: %d", spell);
+ assertMsg(spell < N_SPELLS, "invalid spell: %d", spell);
return SPELL_LIST[spell]._name;
}
int Spells::spellGetRequiredMP(uint spell) const {
- ASSERT(spell < N_SPELLS, "invalid spell: %d", spell);
+ assertMsg(spell < N_SPELLS, "invalid spell: %d", spell);
return SPELL_LIST[spell]._mp;
}
LocationContext Spells::spellGetContext(uint spell) const {
- ASSERT(spell < N_SPELLS, "invalid spell: %d", spell);
+ assertMsg(spell < N_SPELLS, "invalid spell: %d", spell);
return SPELL_LIST[spell]._context;
}
TransportContext Spells::spellGetTransportContext(uint spell) const {
- ASSERT(spell < N_SPELLS, "invalid spell: %d", spell);
+ assertMsg(spell < N_SPELLS, "invalid spell: %d", spell);
return SPELL_LIST[spell]._transportContext;
}
@@ -244,7 +244,7 @@ Common::String Spells::spellGetErrorMessage(uint spell, SpellCastError error) {
int Spells::spellMix(uint spell, const Ingredients *ingredients) {
int regmask, reg;
- ASSERT(spell < N_SPELLS, "invalid spell: %d", spell);
+ assertMsg(spell < N_SPELLS, "invalid spell: %d", spell);
regmask = 0;
for (reg = 0; reg < REAG_MAX; reg++) {
@@ -261,7 +261,7 @@ int Spells::spellMix(uint spell, const Ingredients *ingredients) {
}
Spell::Param Spells::spellGetParamType(uint spell) const {
- ASSERT(spell < N_SPELLS, "invalid spell: %d", spell);
+ assertMsg(spell < N_SPELLS, "invalid spell: %d", spell);
return SPELL_LIST[spell]._paramType;
}
@@ -271,8 +271,8 @@ bool Spells::isDebuggerActive() const {
}
SpellCastError Spells::spellCheckPrerequisites(uint spell, int character) {
- ASSERT(spell < N_SPELLS, "invalid spell: %d", spell);
- ASSERT(character >= 0 && character < g_ultima->_saveGame->_members, "character out of range: %d", character);
+ assertMsg(spell < N_SPELLS, "invalid spell: %d", spell);
+ assertMsg(character >= 0 && character < g_ultima->_saveGame->_members, "character out of range: %d", character);
// Don't bother checking mix count and map when the spell
// has been manually triggered from the debugger
@@ -297,8 +297,8 @@ bool Spells::spellCast(uint spell, int character, int param, SpellCastError *err
int subject = (SPELL_LIST[spell]._paramType == Spell::PARAM_PLAYER) ? param : -1;
PartyMember *p = g_context->_party->member(character);
- ASSERT(spell < N_SPELLS, "invalid spell: %d", spell);
- ASSERT(character >= 0 && character < g_ultima->_saveGame->_members, "character out of range: %d", character);
+ assertMsg(spell < N_SPELLS, "invalid spell: %d", spell);
+ assertMsg(character >= 0 && character < g_ultima->_saveGame->_members, "character out of range: %d", character);
*error = spellCheckPrerequisites(spell, character);
@@ -388,7 +388,7 @@ bool Spells::spellMagicAttackAt(const Coords &coords, MapTile attackTile, int at
}
int Spells::spellAwaken(int player) {
- ASSERT(player < 8, "player out of range: %d", player);
+ assertMsg(player < 8, "player out of range: %d", player);
PartyMember *p = g_context->_party->member(player);
if ((player < g_context->_party->size()) && (p->getStatus() == STAT_SLEEPING)) {
@@ -451,7 +451,7 @@ int Spells::spellBlink(int dir) {
}
int Spells::spellCure(int player) {
- ASSERT(player < 8, "player out of range: %d", player);
+ assertMsg(player < 8, "player out of range: %d", player);
GameController::flashTile(g_context->_party->member(player)->getCoords(), "wisp", 1);
return g_context->_party->member(player)->heal(HT_CURE);
@@ -595,7 +595,7 @@ int Spells::spellGate(int phase) {
}
int Spells::spellHeal(int player) {
- ASSERT(player < 8, "player out of range: %d", player);
+ assertMsg(player < 8, "player out of range: %d", player);
GameController::flashTile(g_context->_party->member(player)->getCoords(), "wisp", 1);
g_context->_party->member(player)->heal(HT_HEAL);
@@ -643,7 +643,7 @@ int Spells::spellProtect(int unused) {
}
int Spells::spellRez(int player) {
- ASSERT(player < 8, "player out of range: %d", player);
+ assertMsg(player < 8, "player out of range: %d", player);
return g_context->_party->member(player)->heal(HT_RESURRECT);
}
diff --git a/engines/ultima/ultima4/gfx/image.cpp b/engines/ultima/ultima4/gfx/image.cpp
index 5809e15336..5833b8e183 100644
--- a/engines/ultima/ultima4/gfx/image.cpp
+++ b/engines/ultima/ultima4/gfx/image.cpp
@@ -93,7 +93,7 @@ Image::~Image() {
}
void Image::setPalette(const RGBA *colors, unsigned n_colors) {
- ASSERT(_paletted, "imageSetPalette called on non-paletted image");
+ assertMsg(_paletted, "imageSetPalette called on non-paletted image");
byte *pal = new byte[n_colors * 3];
byte *palP = pal;
@@ -108,7 +108,7 @@ void Image::setPalette(const RGBA *colors, unsigned n_colors) {
}
void Image::setPaletteFromImage(const Image *src) {
- ASSERT(_paletted && src->_paletted, "imageSetPaletteFromImage called on non-indexed image");
+ assertMsg(_paletted && src->_paletted, "imageSetPaletteFromImage called on non-indexed image");
const uint32 *srcPal = src->_surface->getPalette();
_surface->setPalette(srcPal, 0, PALETTE_COUNT);
diff --git a/engines/ultima/ultima4/gfx/imageloader_fmtowns.cpp b/engines/ultima/ultima4/gfx/imageloader_fmtowns.cpp
index e923a960c4..18b040dc5c 100644
--- a/engines/ultima/ultima4/gfx/imageloader_fmtowns.cpp
+++ b/engines/ultima/ultima4/gfx/imageloader_fmtowns.cpp
@@ -35,7 +35,7 @@ Image *FMTOWNSImageLoader::load(Common::File *file, int width, int height, int b
error("dimensions not set for fmtowns image");
}
- ASSERT((bpp == 16) | (bpp == 4), "invalid bpp: %d", bpp);
+ assertMsg((bpp == 16) | (bpp == 4), "invalid bpp: %d", bpp);
int rawLen = file->size() - _offset;
file->seek(_offset, 0);
diff --git a/engines/ultima/ultima4/gfx/imageloader_u4.cpp b/engines/ultima/ultima4/gfx/imageloader_u4.cpp
index 0e7e03b709..b47311c1b4 100644
--- a/engines/ultima/ultima4/gfx/imageloader_u4.cpp
+++ b/engines/ultima/ultima4/gfx/imageloader_u4.cpp
@@ -40,7 +40,7 @@ Image *U4RawImageLoader::load(Common::File *file, int width, int height, int bpp
error("dimensions not set for u4raw image");
}
- ASSERT(bpp == 1 || bpp == 4 || bpp == 8 || bpp == 24 || bpp == 32, "invalid bpp: %d", bpp);
+ assertMsg(bpp == 1 || bpp == 4 || bpp == 8 || bpp == 24 || bpp == 32, "invalid bpp: %d", bpp);
long rawLen = file->size();
byte *raw = (byte *)malloc(rawLen);
@@ -85,7 +85,7 @@ Image *U4RleImageLoader::load(Common::File *file, int width, int height, int bpp
error("dimensions not set for u4rle image");
}
- ASSERT(bpp == 1 || bpp == 4 || bpp == 8 || bpp == 24 || bpp == 32, "invalid bpp: %d", bpp);
+ assertMsg(bpp == 1 || bpp == 4 || bpp == 8 || bpp == 24 || bpp == 32, "invalid bpp: %d", bpp);
long compressedLen = file->size();
byte *compressed = (byte *) malloc(compressedLen);
@@ -132,7 +132,7 @@ Image *U4LzwImageLoader::load(Common::File *file, int width, int height, int bpp
error("dimensions not set for u4lzw image");
}
- ASSERT(bpp == 1 || bpp == 4 || bpp == 8 || bpp == 24 || bpp == 32, "invalid bpp: %d", bpp);
+ assertMsg(bpp == 1 || bpp == 4 || bpp == 8 || bpp == 24 || bpp == 32, "invalid bpp: %d", bpp);
long compressedLen = file->size();
byte *compressed = (byte *) malloc(compressedLen);
diff --git a/engines/ultima/ultima4/gfx/scale.cpp b/engines/ultima/ultima4/gfx/scale.cpp
index c21634678c..a340ff3b99 100644
--- a/engines/ultima/ultima4/gfx/scale.cpp
+++ b/engines/ultima/ultima4/gfx/scale.cpp
@@ -91,7 +91,7 @@ Image *scale2xBilinear(Image *src, int scale, int n) {
Image *dest;
/* this scaler works only with images scaled by 2x */
- ASSERT(scale == 2, "invalid scale: %d", scale);
+ assertMsg(scale == 2, "invalid scale: %d", scale);
dest = Image::create(src->width() * scale, src->height() * scale, false, Image::HARDWARE);
if (!dest)
@@ -193,7 +193,7 @@ Image *scale2xSaI(Image *src, int scale, int N) {
Image *dest;
/* this scaler works only with images scaled by 2x */
- ASSERT(scale == 2, "invalid scale: %d", scale);
+ assertMsg(scale == 2, "invalid scale: %d", scale);
dest = Image::create(src->width() * scale, src->height() * scale, false, Image::HARDWARE);
if (!dest)
@@ -359,7 +359,7 @@ Image *scaleScale2x(Image *src, int scale, int n) {
Image *dest;
/* this scaler works only with images scaled by 2x or 3x */
- ASSERT(scale == 2 || scale == 3, "invalid scale: %d", scale);
+ assertMsg(scale == 2 || scale == 3, "invalid scale: %d", scale);
dest = Image::create(src->width() * scale, src->height() * scale, src->isIndexed(), Image::HARDWARE);
if (!dest)
diff --git a/engines/ultima/ultima4/gfx/screen.cpp b/engines/ultima/ultima4/gfx/screen.cpp
index 617e9e8665..5bdaf6d5ae 100644
--- a/engines/ultima/ultima4/gfx/screen.cpp
+++ b/engines/ultima/ultima4/gfx/screen.cpp
@@ -468,7 +468,7 @@ bool Screen::screenTileUpdate(TileView *view, const Coords &coords, bool redraw)
}
void Screen::screenUpdate(TileView *view, bool showmap, bool blackout) {
- ASSERT(g_context != nullptr, "context has not yet been initialized");
+ assertMsg(g_context != nullptr, "context has not yet been initialized");
if (blackout) {
screenEraseMapArea();
@@ -586,7 +586,7 @@ void Screen::screenShowChar(int chr, int x, int y) {
}
void Screen::screenScrollMessageArea() {
- ASSERT(_charSetInfo != nullptr && _charSetInfo->_image != nullptr, "charset not initialized!");
+ assertMsg(_charSetInfo != nullptr && _charSetInfo->_image != nullptr, "charset not initialized!");
Image *screen = imageMgr->get("screen")->_image;
@@ -624,7 +624,7 @@ void Screen::screenCycle() {
void Screen::screenUpdateCursor() {
int phase = _currentCycle * SCR_CYCLE_PER_SECOND / SCR_CYCLE_MAX;
- ASSERT(phase >= 0 && phase < 4, "derived an invalid cursor phase: %d", phase);
+ assertMsg(phase >= 0 && phase < 4, "derived an invalid cursor phase: %d", phase);
if (_cursorStatus) {
screenShowChar(31 - phase, _cursorPos.x, _cursorPos.y);
@@ -1086,7 +1086,7 @@ int Screen::screenPointInTriangle(int x, int y, int tx1, int ty1, int tx2, int t
}
int Screen::screenPointInMouseArea(int x, int y, const MouseArea *area) {
- ASSERT(area->_nPoints == 2 || area->_nPoints == 3, "unsupported number of points in area: %d", area->_nPoints);
+ assertMsg(area->_nPoints == 2 || area->_nPoints == 3, "unsupported number of points in area: %d", area->_nPoints);
/* two points define a rectangle */
if (area->_nPoints == 2) {
@@ -1159,7 +1159,7 @@ void Screen::screenShowGemTile(Layout *layout, Map *map, MapTile &t, bool focus,
uint tile = map->translateToRawTileIndex(t);
if (map->_type == Map::DUNGEON) {
- ASSERT(_charSetInfo, "charset not initialized");
+ assertMsg(_charSetInfo, "charset not initialized");
Std::map<Common::String, int>::iterator charIndex = _dungeonTileChars.find(t.getTileType()->getName());
if (charIndex != _dungeonTileChars.end()) {
_charSetInfo->_image->drawSubRect((layout->_viewport.left + (x * layout->_tileShape.x)) * settings._scale,
diff --git a/engines/ultima/ultima4/map/map.cpp b/engines/ultima/ultima4/map/map.cpp
index b35785a454..bdb6fd0fc4 100644
--- a/engines/ultima/ultima4/map/map.cpp
+++ b/engines/ultima/ultima4/map/map.cpp
@@ -765,7 +765,7 @@ bool Map::fillMonsterTable() {
}
MapTile Map::translateFromRawTileIndex(int raw) const {
- ASSERT(_tileMap != nullptr, "tilemap hasn't been set");
+ assertMsg(_tileMap != nullptr, "tilemap hasn't been set");
return _tileMap->translate(raw);
}
diff --git a/engines/ultima/ultima4/map/maploader.cpp b/engines/ultima/ultima4/map/maploader.cpp
index f825b3f20d..51c6a31644 100644
--- a/engines/ultima/ultima4/map/maploader.cpp
+++ b/engines/ultima/ultima4/map/maploader.cpp
@@ -149,8 +149,8 @@ bool CityMapLoader::load(Map *map) {
error("unable to load map data");
// The map must be 32x32 to be read from an .ULT file
- ASSERT(city->_width == CITY_WIDTH, "map width is %d, should be %d", city->_width, CITY_WIDTH);
- ASSERT(city->_height == CITY_HEIGHT, "map height is %d, should be %d", city->_height, CITY_HEIGHT);
+ assertMsg(city->_width == CITY_WIDTH, "map width is %d, should be %d", city->_width, CITY_WIDTH);
+ assertMsg(city->_height == CITY_HEIGHT, "map height is %d, should be %d", city->_height, CITY_HEIGHT);
if (!loadData(city, ult))
return false;
@@ -263,8 +263,8 @@ bool ConMapLoader::load(Map *map) {
error("unable to load map data");
// The map must be 11x11 to be read from an .CON file
- ASSERT(map->_width == CON_WIDTH, "map width is %d, should be %d", map->_width, CON_WIDTH);
- ASSERT(map->_height == CON_HEIGHT, "map height is %d, should be %d", map->_height, CON_HEIGHT);
+ assertMsg(map->_width == CON_WIDTH, "map width is %d, should be %d", map->_width, CON_WIDTH);
+ assertMsg(map->_height == CON_HEIGHT, "map height is %d, should be %d", map->_height, CON_HEIGHT);
if (map->_type != Map::SHRINE) {
CombatMap *cm = getCombatMap(map);
@@ -303,8 +303,8 @@ bool DngMapLoader::load(Map *map) {
error("unable to load map data");
// The map must be 11x11 to be read from an .CON file
- ASSERT(dungeon->_width == DNG_WIDTH, "map width is %d, should be %d", dungeon->_width, DNG_WIDTH);
- ASSERT(dungeon->_height == DNG_HEIGHT, "map height is %d, should be %d", dungeon->_height, DNG_HEIGHT);
+ assertMsg(dungeon->_width == DNG_WIDTH, "map width is %d, should be %d", dungeon->_width, DNG_WIDTH);
+ assertMsg(dungeon->_height == DNG_HEIGHT, "map height is %d, should be %d", dungeon->_height, DNG_HEIGHT);
// Load the dungeon map
uint i, j;
diff --git a/engines/ultima/ultima4/map/movement.cpp b/engines/ultima/ultima4/map/movement.cpp
index cf3d4ae860..b8caf1b892 100644
--- a/engines/ultima/ultima4/map/movement.cpp
+++ b/engines/ultima/ultima4/map/movement.cpp
@@ -131,7 +131,7 @@ void moveAvatarInDungeon(MoveEvent &event) {
MapTile *tile;
// We're not in a dungeon, failed!
- ASSERT(g_context->_location->_context & CTX_DUNGEON, "moveAvatarInDungeon() called outside of dungeon, failed!");
+ assertMsg(g_context->_location->_context & CTX_DUNGEON, "moveAvatarInDungeon() called outside of dungeon, failed!");
// You must turn first!
if (!advancing && !retreating) {
@@ -268,7 +268,7 @@ int moveCombatObject(int act, Map *map, Creature *obj, MapCoords target) {
dir = new_coords.pathAway(target, valid_dirs);
} else {
- ASSERT(action == CA_ADVANCE, "action must be CA_ADVANCE or CA_FLEE");
+ assertMsg(action == CA_ADVANCE, "action must be CA_ADVANCE or CA_FLEE");
// If they're not fleeing, make sure they don't flee on accident
if (new_coords.x == 0)
valid_dirs = DIR_REMOVE_FROM_MASK(DIR_WEST, valid_dirs);
diff --git a/engines/ultima/ultima4/sound/sound.cpp b/engines/ultima/ultima4/sound/sound.cpp
index 25918ae34b..fbdf8e5fb6 100644
--- a/engines/ultima/ultima4/sound/sound.cpp
+++ b/engines/ultima/ultima4/sound/sound.cpp
@@ -77,7 +77,7 @@ SoundManager::~SoundManager() {
}
bool SoundManager::load(Sound sound) {
- ASSERT(sound < SOUND_MAX, "Attempted to load an invalid sound");
+ assertMsg(sound < SOUND_MAX, "Attempted to load an invalid sound");
if (_sounds[sound] == nullptr) {
Common::String pathname(u4find_sound(_soundFilenames[sound]));
@@ -90,7 +90,7 @@ bool SoundManager::load(Sound sound) {
}
void SoundManager::play(Sound sound, bool onlyOnce, int specificDurationInTicks) {
- ASSERT(sound < SOUND_MAX, "Attempted to play an invalid sound");
+ assertMsg(sound < SOUND_MAX, "Attempted to play an invalid sound");
if (_sounds[sound] == nullptr) {
if (!load(sound)) {
diff --git a/engines/ultima/ultima4/views/menuitem.cpp b/engines/ultima/ultima4/views/menuitem.cpp
index 73db8bd793..868ceec02e 100644
--- a/engines/ultima/ultima4/views/menuitem.cpp
+++ b/engines/ultima/ultima4/views/menuitem.cpp
@@ -32,7 +32,7 @@ MenuItem::MenuItem(Common::String t, short x, short y, int sc) :
_id(-1), _x(x), _y(y), _text(t), _highlighted(false),
_selected(false), _visible(true), _scOffset(sc), _closesMenu(false) {
// if the sc/scOffset is outside the range of the text string, assert
- ASSERT(sc == -1 || (sc >= 0 && sc <= (int)_text.size()), "sc value of %d out of range!", sc);
+ assertMsg(sc == -1 || (sc >= 0 && sc <= (int)_text.size()), "sc value of %d out of range!", sc);
if (sc != -1) addShortcutKey(tolower(_text[sc]));
}
diff --git a/engines/ultima/ultima4/views/stats.cpp b/engines/ultima/ultima4/views/stats.cpp
index d9b9b25d88..d0f1f645f6 100644
--- a/engines/ultima/ultima4/views/stats.cpp
+++ b/engines/ultima/ultima4/views/stats.cpp
@@ -180,7 +180,7 @@ void StatsArea::update(Menu *menu, MenuEvent &event) {
}
void StatsArea::highlightPlayer(int player) {
- ASSERT(player < g_context->_party->size(), "player number out of range: %d", player);
+ assertMsg(player < g_context->_party->size(), "player number out of range: %d", player);
_mainArea.highlight(0, player * CHAR_HEIGHT, STATS_AREA_WIDTH * CHAR_WIDTH, CHAR_HEIGHT);
#ifdef IOS_ULTIMA4
U4IOS::updateActivePartyMember(player);
@@ -212,7 +212,7 @@ void StatsArea::showPartyView(bool avatarOnly) {
PartyMember *p = nullptr;
int activePlayer = g_context->_party->getActivePlayer();
- ASSERT(g_context->_party->size() <= 8, "party members out of range: %d", g_context->_party->size());
+ assertMsg(g_context->_party->size() <= 8, "party members out of range: %d", g_context->_party->size());
if (!avatarOnly) {
for (int i = 0; i < g_context->_party->size(); i++) {
@@ -228,7 +228,7 @@ void StatsArea::showPartyView(bool avatarOnly) {
void StatsArea::showPlayerDetails() {
int player = _view - STATS_CHAR1;
- ASSERT(player < 8, "character number out of range: %d", player);
+ assertMsg(player < 8, "character number out of range: %d", player);
PartyMember *p = g_context->_party->member(player);
setTitle(p->getName());
diff --git a/engines/ultima/ultima4/views/textview.cpp b/engines/ultima/ultima4/views/textview.cpp
index 946451fbf3..5f7763345a 100644
--- a/engines/ultima/ultima4/views/textview.cpp
+++ b/engines/ultima/ultima4/views/textview.cpp
@@ -55,8 +55,8 @@ void TextView::reinit() {
}
void TextView::drawChar(int chr, int x, int y) {
- ASSERT(x < _columns, "x value of %d out of range", x);
- ASSERT(y < _rows, "y value of %d out of range", y);
+ assertMsg(x < _columns, "x value of %d out of range", x);
+ assertMsg(y < _rows, "y value of %d out of range", y);
_charset->drawSubRect(SCALED(_bounds.left + (x * CHAR_WIDTH)),
SCALED(_bounds.top + (y * CHAR_HEIGHT)),
@@ -247,7 +247,7 @@ void TextView::setCursorPos(int x, int y, bool clearOld) {
x -= _columns;
y++;
}
- ASSERT(y < _rows, "y value of %d out of range", y);
+ assertMsg(y < _rows, "y value of %d out of range", y);
if (clearOld && _cursorEnabled) {
drawChar(' ', _cursorX, _cursorY);
@@ -272,7 +272,7 @@ void TextView::disableCursor() {
}
void TextView::drawCursor() {
- ASSERT(_cursorPhase >= 0 && _cursorPhase < 4, "invalid cursor phase: %d", _cursorPhase);
+ assertMsg(_cursorPhase >= 0 && _cursorPhase < 4, "invalid cursor phase: %d", _cursorPhase);
if (!_cursorEnabled)
return;
diff --git a/engines/ultima/ultima4/views/tileview.cpp b/engines/ultima/ultima4/views/tileview.cpp
index e9782d10a9..c286502c94 100644
--- a/engines/ultima/ultima4/views/tileview.cpp
+++ b/engines/ultima/ultima4/views/tileview.cpp
@@ -86,8 +86,8 @@ void TileView::drawTile(MapTile &mapTile, bool focus, int x, int y) {
Tile *tile = _tileSet->get(mapTile._id);
Image *image = tile->getImage();
- ASSERT(x < _columns, "x value of %d out of range", x);
- ASSERT(y < _rows, "y value of %d out of range", y);
+ assertMsg(x < _columns, "x value of %d out of range", x);
+ assertMsg(y < _rows, "y value of %d out of range", y);
// Blank scratch pad
_animated->fillRect(0, 0, SCALED(_tileWidth), SCALED(_tileHeight), 0, 0, 0, 255);
@@ -122,8 +122,8 @@ void TileView::drawTile(MapTile &mapTile, bool focus, int x, int y) {
}
void TileView::drawTile(Std::vector<MapTile> &tiles, bool focus, int x, int y) {
- ASSERT(x < _columns, "x value of %d out of range", x);
- ASSERT(y < _rows, "y value of %d out of range", y);
+ assertMsg(x < _columns, "x value of %d out of range", x);
+ assertMsg(y < _rows, "y value of %d out of range", y);
// Clear tile contents
_animated->fillRect(0, 0, SCALED(_tileWidth), SCALED(_tileHeight), 0, 0, 0, 255);
@@ -173,8 +173,8 @@ void TileView::drawTile(Std::vector<MapTile> &tiles, bool focus, int x, int y) {
}
void TileView::drawFocus(int x, int y) {
- ASSERT(x < _columns, "x value of %d out of range", x);
- ASSERT(y < _rows, "y value of %d out of range", y);
+ assertMsg(x < _columns, "x value of %d out of range", x);
+ assertMsg(y < _rows, "y value of %d out of range", y);
// Draw the focus rectangle around the tile
if ((g_screen->_currentCycle * 4 / SCR_CYCLE_PER_SECOND) % 2) {
More information about the Scummvm-git-logs
mailing list