[Scummvm-git-logs] scummvm master -> 66aa2f13a0dce5b5fc1a78792fb5cd415c3fdcc0
Strangerke
noreply at scummvm.org
Sun Feb 8 10:22:49 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
66aa2f13a0 M4: Refactoring - Remove errorCode from error_show as it's useless and not shared by Orion Burger and Riddle of Master L
Commit: 66aa2f13a0dce5b5fc1a78792fb5cd415c3fdcc0
https://github.com/scummvm/scummvm/commit/66aa2f13a0dce5b5fc1a78792fb5cd415c3fdcc0
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-02-08T11:22:31+01:00
Commit Message:
M4: Refactoring - Remove errorCode from error_show as it's useless and not shared by Orion Burger and Riddle of Master Lu
Changed paths:
engines/m4/adv_db_r/db_catalog.cpp
engines/m4/adv_r/adv_been.cpp
engines/m4/adv_r/adv_chk.cpp
engines/m4/adv_r/adv_control.cpp
engines/m4/adv_r/adv_file.cpp
engines/m4/adv_r/adv_hotspot.cpp
engines/m4/adv_r/adv_inv.cpp
engines/m4/adv_r/adv_rails.cpp
engines/m4/adv_r/adv_trigger.cpp
engines/m4/adv_r/adv_walk.cpp
engines/m4/adv_r/chunk_ops.cpp
engines/m4/adv_r/conv.cpp
engines/m4/adv_r/conv_io.cpp
engines/m4/adv_r/other.cpp
engines/m4/burger/burger.cpp
engines/m4/burger/gui/gui_gizmo.cpp
engines/m4/burger/gui/interface.cpp
engines/m4/burger/gui/inventory.cpp
engines/m4/burger/other.cpp
engines/m4/burger/rooms/section3/section3_room.cpp
engines/m4/burger/rooms/section9/menu_room.cpp
engines/m4/burger/rooms/section9/room904.cpp
engines/m4/core/errors.cpp
engines/m4/core/errors.h
engines/m4/core/rooms.cpp
engines/m4/fileio/fstream.cpp
engines/m4/graphics/gr_buff.cpp
engines/m4/graphics/gr_font.cpp
engines/m4/graphics/gr_pal.cpp
engines/m4/graphics/gr_series.cpp
engines/m4/graphics/gr_sprite.cpp
engines/m4/graphics/rend.cpp
engines/m4/gui/gui_cheapo.cpp
engines/m4/gui/gui_menu_items.cpp
engines/m4/gui/gui_vmng_rectangles.cpp
engines/m4/mem/mem.cpp
engines/m4/mem/memman.h
engines/m4/mem/res.cpp
engines/m4/platform/tile/tile_read.cpp
engines/m4/riddle/gui/interface.cpp
engines/m4/riddle/gui/inventory.cpp
engines/m4/riddle/rooms/section8/room808.cpp
engines/m4/vars.cpp
engines/m4/wscript/ws_cruncher.cpp
engines/m4/wscript/ws_hal.cpp
engines/m4/wscript/ws_load.cpp
diff --git a/engines/m4/adv_db_r/db_catalog.cpp b/engines/m4/adv_db_r/db_catalog.cpp
index 470832e3c4e..dd645a8c800 100644
--- a/engines/m4/adv_db_r/db_catalog.cpp
+++ b/engines/m4/adv_db_r/db_catalog.cpp
@@ -50,7 +50,7 @@ bool read_catalog() {
_G(catalog)._data = (char *)mem_alloc(size + 4, "catalog");
if (f.read(_G(catalog)._data, size) != size)
- error_show(FL, 'FRDF', "Could not read in the catalog.");
+ error_show(FL, "Could not read in the catalog.");
f.close();
@@ -163,7 +163,7 @@ static void sort_catalog() {
++index;
if (index > _G(catalog)._size)
- error_show(FL, 'OOM!');
+ error_show(FL);
}
qsort(_G(catalog)._catalog, _G(catalog)._size, sizeof(char *), compare_catalog_entries_for_sort);
@@ -221,7 +221,7 @@ static char *db_get_catalog_entry(char *c, short *tag, short *room, char *name,
s[i++] = c[x];
if (i == MAX_FILENAME_SIZE)
- error_show(FL, 'OOM!');
+ error_show(FL);
}
s[i] = '\0';
diff --git a/engines/m4/adv_r/adv_been.cpp b/engines/m4/adv_r/adv_been.cpp
index 7a400133bfb..116e3373058 100644
--- a/engines/m4/adv_r/adv_been.cpp
+++ b/engines/m4/adv_r/adv_been.cpp
@@ -77,7 +77,7 @@ bool player_enters_scene(int16 scene_num) {
++_G(scene_list).tail;
if (_G(scene_list).tail > _G(scene_list).total_scenes)
- error_show(FL, 'SLTS');
+ error_show(FL);
return false;
}
diff --git a/engines/m4/adv_r/adv_chk.cpp b/engines/m4/adv_r/adv_chk.cpp
index 96214d2f4b8..b654ccf3a0e 100644
--- a/engines/m4/adv_r/adv_chk.cpp
+++ b/engines/m4/adv_r/adv_chk.cpp
@@ -60,7 +60,7 @@ static HotSpotRec *read_hotspots(SysFile *fpdef, HotSpotRec *h, int32 num) {
if (str_len) {
if (!fpdef->read((byte *)s, str_len))
- error_show(FL, 0, "Could not read vocab");
+ error_show(FL, "Could not read vocab");
hotspot_newVocab(h, s);
}
@@ -68,7 +68,7 @@ static HotSpotRec *read_hotspots(SysFile *fpdef, HotSpotRec *h, int32 num) {
if (str_len) {
if (!fpdef->read((byte *)s, str_len))
- error_show(FL, 0, "Could not read verb");
+ error_show(FL, "Could not read verb");
hotspot_newVerb(h, s);
}
@@ -76,7 +76,7 @@ static HotSpotRec *read_hotspots(SysFile *fpdef, HotSpotRec *h, int32 num) {
if (str_len) {
if (!fpdef->read((byte *)s, str_len))
- error_show(FL, 0, "Could not read prep");
+ error_show(FL, "Could not read prep");
hotspot_newPrep(h, s);
}
@@ -84,7 +84,7 @@ static HotSpotRec *read_hotspots(SysFile *fpdef, HotSpotRec *h, int32 num) {
if (str_len) {
if (!fpdef->read((byte *)s, str_len))
- error_show(FL, 0, "Could not read sprite");
+ error_show(FL, "Could not read sprite");
hotspot_new_sprite(h, s);
}
@@ -123,7 +123,7 @@ static void load_def(SysFile *fpdef) {
y = fpdef->readSint32LE();
if (AddRailNode(x, y, nullptr, true) < 0)
- error_show(FL, 0, "more than %d (defn. in intrrail.h) nodes", MAXRAILNODES);
+ error_show(FL, "more than %d (defn. in intrrail.h) nodes", MAXRAILNODES);
}
_G(myDef)->hotspots = read_hotspots(fpdef, nullptr, _G(myDef)->num_hotspots);
diff --git a/engines/m4/adv_r/adv_control.cpp b/engines/m4/adv_r/adv_control.cpp
index f1e7e5835e2..0b305d9d317 100644
--- a/engines/m4/adv_r/adv_control.cpp
+++ b/engines/m4/adv_r/adv_control.cpp
@@ -161,7 +161,7 @@ void update_mouse_pos_dialog() {
if (_G(my_walker) != nullptr) {
if (!_G(my_walker)->myAnim8)
- error_show(FL, 'W:-(');
+ error_show(FL);
player_get_info();
}
diff --git a/engines/m4/adv_r/adv_file.cpp b/engines/m4/adv_r/adv_file.cpp
index c372d9b180f..0682e5f0bfc 100644
--- a/engines/m4/adv_r/adv_file.cpp
+++ b/engines/m4/adv_r/adv_file.cpp
@@ -90,7 +90,7 @@ void kernel_unload_room(SceneDef *rdef, GrBuff **code_data, GrBuff **loadBuffer)
bool kernel_load_room(int minPalEntry, int maxPalEntry, SceneDef *rdef, GrBuff **scr_orig_data, GrBuff **scr_orig) {
if (!scr_orig_data || !scr_orig) {
- error_show(FL, 'BUF!', "load_picture_and_codes");
+ error_show(FL, "load_picture_and_codes");
}
term_message("Reading scene %d", _G(game).new_room);
@@ -101,7 +101,7 @@ bool kernel_load_room(int minPalEntry, int maxPalEntry, SceneDef *rdef, GrBuff *
// Read DEF file
if (db_def_chk_read(_G(game).new_room, rdef) != -1) {
- error_show(FL, 'DF:(', "trying to find %d.CHK", (uint32)_G(game).new_room);
+ error_show(FL, "trying to find %d.CHK", (uint32)_G(game).new_room);
}
set_walker_scaling(rdef);
@@ -270,7 +270,7 @@ bool load_background(SysFile *pic_file, GrBuff **loadBuffer, RGB8 *palette) {
*loadBuffer = new GrBuff(file_x, file_y);
if (!*loadBuffer)
- error_show(FL, 'OOM!');
+ error_show(FL);
Buffer *theBuff = (**loadBuffer).get_buffer();
diff --git a/engines/m4/adv_r/adv_hotspot.cpp b/engines/m4/adv_r/adv_hotspot.cpp
index bb3c69b026e..a57b47b1c83 100644
--- a/engines/m4/adv_r/adv_hotspot.cpp
+++ b/engines/m4/adv_r/adv_hotspot.cpp
@@ -314,7 +314,7 @@ static HotSpotRec *saved_hotspots = nullptr;
void hotspot_hide_all() {
if (saved_hotspots)
- error_show(FL, 'HNST');
+ error_show(FL);
saved_hotspots = _G(currentSceneDef).hotspots;
_G(currentSceneDef).hotspots = nullptr;
@@ -322,7 +322,7 @@ void hotspot_hide_all() {
void hotspot_restore_all() {
if (!saved_hotspots) {
- error_show(FL, 'HNON');
+ error_show(FL);
}
if (_G(currentSceneDef).hotspots)
diff --git a/engines/m4/adv_r/adv_inv.cpp b/engines/m4/adv_r/adv_inv.cpp
index edf68a88f56..bfed048fda1 100644
--- a/engines/m4/adv_r/adv_inv.cpp
+++ b/engines/m4/adv_r/adv_inv.cpp
@@ -77,12 +77,12 @@ bool inv_init(int32 num_objects) {
_G(inventory)->_objects.resize(num_objects);
if (!mem_register_stash_type(&_G(inv_obj_mem_type), sizeof(InvObj), num_objects, "obj"))
- error_show(FL, 'OOM!', "fail to mem_register_stash_type for inv_obj");
+ error_show(FL, "fail to mem_register_stash_type for inv_obj");
for (int i = 0; i < num_objects; i++) {
_G(inventory)->_objects[i] = (InvObj *)mem_get_from_stash(_G(inv_obj_mem_type), "obj");
if (!_G(inventory)->_objects[i])
- error_show(FL, 'OOM!', "%d bytes", (int32)sizeof(InvObj));
+ error_show(FL, "%d bytes", (int32)sizeof(InvObj));
}
_G(inventory)->_tail = 0;
diff --git a/engines/m4/adv_r/adv_rails.cpp b/engines/m4/adv_r/adv_rails.cpp
index a8ba4732119..a02907ea434 100644
--- a/engines/m4/adv_r/adv_rails.cpp
+++ b/engines/m4/adv_r/adv_rails.cpp
@@ -128,7 +128,7 @@ noWalkRect *intr_add_no_walk_rect(int32 x1, int32 y1, int32 x2, int32 y2, int32
// Add the alternate walkto node - this node must exist
newRect->alternateWalkToNode = AddRailNode(altX, altY, walkCodes, false);
if (newRect->alternateWalkToNode < 0) {
- error_show(FL, 'IADN', "could not add node. coord: %d %d", altX, altY);
+ error_show(FL, "could not add node. coord: %d %d", altX, altY);
}
// Now add the corner nodes. Not as important if these don't exist
diff --git a/engines/m4/adv_r/adv_trigger.cpp b/engines/m4/adv_r/adv_trigger.cpp
index 79d0ac93108..c9d788eaf3e 100644
--- a/engines/m4/adv_r/adv_trigger.cpp
+++ b/engines/m4/adv_r/adv_trigger.cpp
@@ -34,7 +34,7 @@ int32 kernel_trigger_create(int32 trigger_num) {
return (trigger_num);
if (trigger_num > 0xffff) { // If room changed, this is an invalid trigger
- error_show(FL, 'BADT', "bad trigger. %d > 0xffff", trigger_num);
+ error_show(FL, "bad trigger. %d > 0xffff", trigger_num);
}
const int32 new_trigger = trigger_num + (_G(game).room_id << 16) + (_G(kernel).trigger_mode << 28);
diff --git a/engines/m4/adv_r/adv_walk.cpp b/engines/m4/adv_r/adv_walk.cpp
index 5157125ad0e..a7c33b0d566 100644
--- a/engines/m4/adv_r/adv_walk.cpp
+++ b/engines/m4/adv_r/adv_walk.cpp
@@ -42,13 +42,8 @@ void set_walker_scaling(SceneDef *rdef) {
static void ws_walkto_node(machine *myWalker, railNode *destNode, bool firstTime) {
// Parameter verification
- if (!myWalker) {
- error_show(FL, 'W:-(');
- return;
- }
- if (!destNode) {
- error_show(FL, 'WNDN');
- return;
+ if (!myWalker || !destNode) {
+ error_show(FL);
}
// Calculate the destination values x, y, s
@@ -77,8 +72,7 @@ static void ws_walkto_node(machine *myWalker, railNode *destNode, bool firstTime
bool walker_has_walk_finished(machine *sender) {
// Parameter verification
if ((!sender) || (!sender->myAnim8)) {
- error_show(FL, 'W:-(');
- return false;
+ error_show(FL);
}
// Remove the node we just arrived at from the sender's walkPath
@@ -107,7 +101,7 @@ void ws_walk(machine *myWalker, int32 x, int32 y, GrBuff **, int16 trigger, int3
int32 currNodeID, destNodeID;
if (!myWalker || !myWalker->myAnim8)
- error_show(FL, 'W:-(');
+ error_show(FL);
// Get walker's current location
const int32 currX = myWalker->myAnim8->myRegs[IDX_X] >> 16;
@@ -118,10 +112,10 @@ void ws_walk(machine *myWalker, int32 x, int32 y, GrBuff **, int16 trigger, int3
if (_G(screenCodeBuff))
walkerCodes = _G(screenCodeBuff)->get_buffer();
if ((currNodeID = AddRailNode(currX, currY, walkerCodes, true)) < 0) {
- error_show(FL, 'WCAN', "Walker's curr posn: %d %d", currX, currY);
+ error_show(FL, "Walker's curr posn: %d %d", currX, currY);
}
if ((destNodeID = AddRailNode(x, y, walkerCodes, true)) < 0) {
- error_show(FL, 'WCAN', "Trying to walk to: %d %d", x, y);
+ error_show(FL, "Trying to walk to: %d %d", x, y);
}
// Dispose of the current path myWalker is following
@@ -176,8 +170,7 @@ bool adv_walker_path_exists(machine *myWalker, int32 x, int32 y) {
int32 currNodeID, destNodeID;
if (!myWalker || !myWalker->myAnim8) {
- error_show(FL, 'W:-(');
- return false;
+ error_show(FL);
}
// Get walker's current location
@@ -190,10 +183,10 @@ bool adv_walker_path_exists(machine *myWalker, int32 x, int32 y) {
walkerCodes = _G(screenCodeBuff)->get_buffer();
}
if ((currNodeID = AddRailNode(currX, currY, walkerCodes, true)) < 0) {
- error_show(FL, 'WCAN', "Walker's curr posn: %d %d", currX, currY);
+ error_show(FL, "Walker's curr posn: %d %d", currX, currY);
}
if ((destNodeID = AddRailNode(x, y, walkerCodes, true)) < 0) {
- error_show(FL, 'WCAN', "Trying to walk to: %d %d", x, y);
+ error_show(FL, "Trying to walk to: %d %d", x, y);
}
// Dispose of the current path myWalker is following
@@ -295,8 +288,7 @@ void ws_turn_to_face(machine *myWalker, int32 facing, int32 trigger) {
int8 directions[13] = { 0, 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 9 };
if (!myWalker || !myWalker->myAnim8) {
- error_show(FL, 'W:-(', "demand facing: %d", facing);
- return;
+ error_show(FL, "demand facing: %d", facing);
}
// Verify that facing is valid or set -1
@@ -321,8 +313,7 @@ void ws_demand_location(int32 x, int32 y, int facing) {
void ws_hide_walker(machine *myWalker) {
if (!myWalker) {
- error_show(FL, 'W:-(');
- return;
+ error_show(FL);
}
_G(player).walker_visible = false;
@@ -331,8 +322,7 @@ void ws_hide_walker(machine *myWalker) {
void ws_unhide_walker(machine *myWalker) {
if (!myWalker) {
- error_show(FL, 'W:-(');
- return;
+ error_show(FL);
}
_G(player).walker_visible = true;
@@ -363,8 +353,7 @@ void ws_get_walker_info(machine *myWalker, int32 *x, int32 *y, int32 *s, int32 *
const int8 facings[10] = { 1, 2, 3, 4, 5, 7, 8, 9, 10, 11 };
if (!myWalker || !myWalker->myAnim8) {
- error_show(FL, 'W:-(');
- return;
+ error_show(FL);
}
Anim8 *myAnim8 = myWalker->myAnim8;
@@ -412,8 +401,7 @@ bool ws_walk_init_system() {
_G(my_walker) = _GW().walk_initialize_walker();
if (!_G(my_walker)) {
- error_show(FL, 'W:-(');
- return false;
+ error_show(FL);
}
return true;
}
@@ -425,7 +413,7 @@ bool ws_walk_load_series(const int16 *dir_array, const char *name_array[], bool
const int32 result = AddWSAssetCELS(name_array[i], dir_array[i],
(load_palette && !shadow_flag) ? _G(master_palette) : nullptr);
if (result < 0)
- error_show(FL, 'W:-(');
+ error_show(FL);
i++;
}
diff --git a/engines/m4/adv_r/chunk_ops.cpp b/engines/m4/adv_r/chunk_ops.cpp
index 4ec1b760a9e..d8afb330bf3 100644
--- a/engines/m4/adv_r/chunk_ops.cpp
+++ b/engines/m4/adv_r/chunk_ops.cpp
@@ -40,7 +40,7 @@ int32 conv_ops_text_strlen(char *s) {
void conv_ops_unknown_chunk(int32 tag, const char *s) {
char *tag_name = (char *)&tag;
- error_show(FL, 'PARS', "'%s' What type is this chunk: %c%c%c%c ?", s, tag_name[3], tag_name[2], tag_name[1], tag_name[0]);
+ error_show(FL, "'%s' What type is this chunk: %c%c%c%c ?", s, tag_name[3], tag_name[2], tag_name[1], tag_name[0]);
}
/*
@@ -56,7 +56,7 @@ char *conv_ops_get_entry(int32 i, int32 *next, int32 *tag, Conv *c) {
conv_chunk *CC;
if ((i + c->myCNode) > c->chunkSize) {
- error_show(FL, 'PARS', "Conv pointer skipped past chunk EOF. Please check script and make sure HAG is up to date");
+ error_show(FL, "Conv pointer skipped past chunk EOF. Please check script and make sure HAG is up to date");
}
char *outChunk = &(c->conv[c->myCNode]);
@@ -172,7 +172,7 @@ char *conv_ops_get_entry(int32 i, int32 *next, int32 *tag, Conv *c) {
break;
default:
- error_show(FL, 'PARS', "Tag: %d (%x) Node: %d (%x hex)", *tag, *tag, c->myCNode, c->myCNode);
+ error_show(FL, "Tag: %d (%x) Node: %d (%x hex)", *tag, *tag, c->myCNode, c->myCNode);
break;
}
@@ -476,7 +476,7 @@ int32 conv_ops_process_asgn(int32 val, int32 oprtr, int32 opnd) {
break;
default:
- error_show(FL, 'PARS', "Operator must be a +,-,*,/,=, Please check tag type: %d in token header file", oprtr);
+ error_show(FL, "Operator must be a +,-,*,/,=, Please check tag type: %d in token header file", oprtr);
break;
}
return val;
diff --git a/engines/m4/adv_r/conv.cpp b/engines/m4/adv_r/conv.cpp
index 620003df2ad..6cc70ac4e6e 100644
--- a/engines/m4/adv_r/conv.cpp
+++ b/engines/m4/adv_r/conv.cpp
@@ -847,7 +847,7 @@ void set_dlg_rect() {
int32 status;
ScreenContext *game_buff_ptr = vmng_screen_find(_G(gameDrawBuff), &status);
if (!game_buff_ptr)
- error_show(FL, 'BUF!');
+ error_show(FL);
const int32 screen_x_center = VIDEO_W / 2;
const int32 screen_y_center = (game_buff_ptr->y2 - game_buff_ptr->y1) / 2;
diff --git a/engines/m4/adv_r/conv_io.cpp b/engines/m4/adv_r/conv_io.cpp
index 90da5b6f7bf..240e06b41bd 100644
--- a/engines/m4/adv_r/conv_io.cpp
+++ b/engines/m4/adv_r/conv_io.cpp
@@ -490,7 +490,7 @@ static void conv_save_state(Conv *c) {
}
if (amt_to_write != size)
- error_show(FL, 'CNVS', "save_state: error! size written != size (%d %d)", amt_to_write, size);
+ error_show(FL, "save_state: error! size written != size (%d %d)", amt_to_write, size);
// Finally, write out the conversation data
if (overwrite_file == true) {
@@ -699,7 +699,7 @@ Conv *conv_load(const char *filename, int x1, int y1, int32 myTrigger, bool want
SysFile fp(fullPathname);
if (!fp.exists()) {
// Force the file open
- error_show(FL, 'CNVL', "couldn't conv_load %s", fullPathname);
+ error_show(FL, "couldn't conv_load %s", fullPathname);
}
const int32 cSize = fp.size();
diff --git a/engines/m4/adv_r/other.cpp b/engines/m4/adv_r/other.cpp
index 3acc17af6db..c2585e3d16b 100644
--- a/engines/m4/adv_r/other.cpp
+++ b/engines/m4/adv_r/other.cpp
@@ -27,7 +27,7 @@ namespace M4 {
void other_save_game_for_resurrection(void) {
if (kernel_save_game(0, nullptr, 0, nullptr, 0)) {
- error_show(FL, 0, "couldn't other_save_game_for_res");
+ error_show(FL, "couldn't other_save_game_for_res");
}
}
diff --git a/engines/m4/burger/burger.cpp b/engines/m4/burger/burger.cpp
index 26c5fb82292..53eeabe61e9 100644
--- a/engines/m4/burger/burger.cpp
+++ b/engines/m4/burger/burger.cpp
@@ -361,7 +361,7 @@ void BurgerEngine::global_daemon() {
_G(wilbur_should) = 10017;
kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
} else {
- error_show(FL, 'Burg', "Time to abduct Wilbur in space?");
+ error_show(FL, "Time to abduct Wilbur in space?");
}
break;
diff --git a/engines/m4/burger/gui/gui_gizmo.cpp b/engines/m4/burger/gui/gui_gizmo.cpp
index db7606709f4..772f72250a7 100644
--- a/engines/m4/burger/gui/gui_gizmo.cpp
+++ b/engines/m4/burger/gui/gui_gizmo.cpp
@@ -330,12 +330,12 @@ static void gizmo_restore_interface(bool fade) {
if (_GIZMO(lowMemory2)) {
if (!adv_restoreBackground())
- error_show(FL, 0, "unable to restore background");
+ error_show(FL, "unable to restore background");
}
if (_GIZMO(lowMemory1)) {
if (!adv_restoreCodes())
- error_show(FL, 0, "unable to restore screen codes");
+ error_show(FL, "unable to restore screen codes");
}
krn_fade_from_grey(_GIZMO(palette), 5, 1, fade ? 1 : 2);
diff --git a/engines/m4/burger/gui/interface.cpp b/engines/m4/burger/gui/interface.cpp
index ddc1a1724e1..9222e7c82fd 100644
--- a/engines/m4/burger/gui/interface.cpp
+++ b/engines/m4/burger/gui/interface.cpp
@@ -44,7 +44,7 @@ bool Interface::init(int arrow, int wait, int look, int grab, int use) {
_sprite = series_load("999intr", 22, nullptr);
if (_sprite != 22)
- error_show(FL, 'SLF!');
+ error_show(FL);
mouse_set_sprite(arrow);
diff --git a/engines/m4/burger/gui/inventory.cpp b/engines/m4/burger/gui/inventory.cpp
index e8facf6b087..09411fbf2f8 100644
--- a/engines/m4/burger/gui/inventory.cpp
+++ b/engines/m4/burger/gui/inventory.cpp
@@ -48,7 +48,7 @@ Inventory::Inventory(const RectClass &r, int32 sprite, int16 cells_h, int16 cell
// If requested cell configuration doesn't fit, blow up.
if ((cells_h * cell_w > (_x2 - _x1)) || (cells_v * cell_h > (_y2 - _y1))) {
- error_show(FL, 'CGIC');
+ error_show(FL);
}
_highlight = -1;
@@ -70,8 +70,7 @@ bool Inventory::add(const Common::String &name, const Common::String &verb, int3
}
if (_num_cells >= INVENTORY_CELLS_COUNT) {
- error_show(FL, 'CGIA');
- return false;
+ error_show(FL);
}
// Shift existing items up by one
diff --git a/engines/m4/burger/other.cpp b/engines/m4/burger/other.cpp
index 6a798c97fd4..cd55cc4a9cd 100644
--- a/engines/m4/burger/other.cpp
+++ b/engines/m4/burger/other.cpp
@@ -35,7 +35,7 @@ void other_resurrect_player() {
KernelTriggerType old_mode;
if (!g_engine->autosaveExists())
- error_show(FL, 'Burg', "Couldn't resume game");
+ error_show(FL, "Couldn't resume game");
_G(kernel).restore_slot = 0;
old_mode = _G(kernel).trigger_mode;
diff --git a/engines/m4/burger/rooms/section3/section3_room.cpp b/engines/m4/burger/rooms/section3/section3_room.cpp
index 9b5dd786516..b62684db62f 100644
--- a/engines/m4/burger/rooms/section3/section3_room.cpp
+++ b/engines/m4/burger/rooms/section3/section3_room.cpp
@@ -49,7 +49,7 @@ void Section3Room::setupDigi() {
void Section3Room::set_palette_brightness(int start, int finish, int percent) {
if (finish < start || finish > 255 || start < 0)
- error_show(FL, 'Burg', "set_palette_brightness index error");
+ error_show(FL, "set_palette_brightness index error");
RGB8 *pal = &_G(master_palette)[start];
for (int index = start; index < finish; ++index, ++pal) {
diff --git a/engines/m4/burger/rooms/section9/menu_room.cpp b/engines/m4/burger/rooms/section9/menu_room.cpp
index 261a177537b..5d75e61543d 100644
--- a/engines/m4/burger/rooms/section9/menu_room.cpp
+++ b/engines/m4/burger/rooms/section9/menu_room.cpp
@@ -54,7 +54,7 @@ void MenuRoom::setButtons(const MenuButtonDef *btns, int count) {
void MenuRoom::drawButton(int index) {
if (index < 0 || index >= (int)_buttons.size())
- error_show(FL, 'Burg', "draw_button which?");
+ error_show(FL, "draw_button which?");
MenuButton &btn = _buttons[index];
assert(btn._state >= BTNSTATE_DISABLED && btn._state <= BTNSTATE_PRESSED);
diff --git a/engines/m4/burger/rooms/section9/room904.cpp b/engines/m4/burger/rooms/section9/room904.cpp
index e156a536e93..2f243af0d98 100644
--- a/engines/m4/burger/rooms/section9/room904.cpp
+++ b/engines/m4/burger/rooms/section9/room904.cpp
@@ -736,7 +736,7 @@ size_t Room904::getCreditsSectionsCount() const {
int Room904::getCreditsSectionLine(int sectionNum) const {
if (sectionNum < 1 || sectionNum > _numSections)
- error_show(FL, 'Burg', "Bad index to credits");
+ error_show(FL, "Bad index to credits");
int lineNum;
for (lineNum = 0; sectionNum > 1; --sectionNum, ++lineNum) {
@@ -783,7 +783,7 @@ size_t Room904::getCreditsSectionWidth(int sectionNum) const {
const char *Room904::getLineInCreditsSection(int sectionNum, int lineNum) const {
if (lineNum < 1 || lineNum > getCreditsSectionLines(sectionNum))
- error_show(FL, 'Burg', "Bad index to names");
+ error_show(FL, "Bad index to names");
return CREDITS[getCreditsSectionLine(sectionNum) + lineNum];
}
diff --git a/engines/m4/core/errors.cpp b/engines/m4/core/errors.cpp
index 98858558a06..974e68d8910 100644
--- a/engines/m4/core/errors.cpp
+++ b/engines/m4/core/errors.cpp
@@ -29,19 +29,19 @@ inline static bool quadchar_equals_string(uint32 code, const Common::String &str
return READ_BE_UINT32(str.c_str()) == code;
}
-void error_show(const char *filename, uint32 line, quadchar errorCode, const char *fmt, ...) {
+void error_show(const char *filename, uint32 line, const char *fmt, ...) {
assert(fmt);
va_list va;
va_start(va, fmt);
- Common::String msg = Common::String::vformat(fmt, va);
+ const Common::String msg = Common::String::vformat(fmt, va);
va_end(va);
error("%s", msg.c_str());
}
-void error_show(const char *filename, uint32 line, quadchar errorCode) {
- error_show(filename, line, errorCode, "No extra description");
+void error_show(const char *filename, uint32 line) {
+ error_show(filename, line, "No extra description");
}
void error_look_up(quadchar errorCode, char *result_string) {
diff --git a/engines/m4/core/errors.h b/engines/m4/core/errors.h
index f9b283f4891..ff624b19076 100644
--- a/engines/m4/core/errors.h
+++ b/engines/m4/core/errors.h
@@ -30,8 +30,8 @@ namespace M4 {
#define FL __FILE__,__LINE__
#define ERROR_FILE "error.m4"
-void NORETURN_PRE error_show(const char *filename, uint32 line, quadchar errorCode, const char *fmt, ...) NORETURN_POST;
-void NORETURN_PRE error_show(const char *filename, uint32 line, quadchar errorCode) NORETURN_POST;
+void NORETURN_PRE error_show(const char *filename, uint32 line, const char *fmt, ...) NORETURN_POST;
+void NORETURN_PRE error_show(const char *filename, uint32 line) NORETURN_POST;
void error_look_up(quadchar errorCode, char *result_string);
} // namespace M4
diff --git a/engines/m4/core/rooms.cpp b/engines/m4/core/rooms.cpp
index 8f580d18291..8c8cf572506 100644
--- a/engines/m4/core/rooms.cpp
+++ b/engines/m4/core/rooms.cpp
@@ -116,7 +116,7 @@ void Sections::m4SceneLoad() {
_G(kernel).going = kernel_load_room(MIN_PAL_ENTRY, MAX_PAL_ENTRY,
&_G(currentSceneDef), &_G(screenCodeBuff), &_G(game_bgBuff));
if (!_G(kernel).going)
- error_show(FL, 'IMP!'); // this should never ever happen
+ error_show(FL); // this should never ever happen
get_ipl();
@@ -228,11 +228,11 @@ void Sections::m4EndScene() {
// Reload the walker and show scripts.
if (!LoadWSAssets("walker script", &_G(master_palette)[0]))
- error_show(FL, 'FNF!', "walker script");
+ error_show(FL, "walker script");
if (!LoadWSAssets("show script", &_G(master_palette)[0]))
- error_show(FL, 'FNF!', "show script");
+ error_show(FL, "show script");
if (!LoadWSAssets("stream script", &_G(master_palette)[0]))
- error_show(FL, 'FNF', "stream script");
+ error_show(FL, "stream script");
g_vars->global_menu_system_init();
}
@@ -260,7 +260,7 @@ void Sections::get_ipl() {
void Sections::get_walker() {
term_message("Loading walker sprites");
if (!_GW().walk_load_walker_and_shadow_series())
- error_show(FL, 'WLOD');
+ error_show(FL);
ws_walk_init_system();
}
@@ -271,7 +271,7 @@ void Sections::game_control_cycle() {
int32 status;
ScreenContext *screen = vmng_screen_find(_G(gameDrawBuff), &status);
if (!screen)
- error_show(FL, 'BUF!');
+ error_show(FL);
if (_G(player).ready_to_walk) {
if (_G(player).need_to_walk) {
@@ -390,7 +390,7 @@ void Sections::pal_game_task() {
_G(game_bgBuff)->release();
if (!game_buff_ptr)
- error_show(FL, 'BUF!');
+ error_show(FL);
if _G(please_hyperwalk) {
_G(please_hyperwalk) = false;
diff --git a/engines/m4/fileio/fstream.cpp b/engines/m4/fileio/fstream.cpp
index 2cf310e2ca7..161c9a35b3a 100644
--- a/engines/m4/fileio/fstream.cpp
+++ b/engines/m4/fileio/fstream.cpp
@@ -72,11 +72,11 @@ strmRequest *f_stream_Open(SysFile *srcFile, int32 fileOffset, int32 strmMinBuff
// Parameter verification
if (!srcFile) {
- error_show(FL, 'FSF!');
+ error_show(FL);
}
if (strmMinBuffSize < 0) {
- error_show(FL, 'FSF1', "neg min buffsize: %d", strmMinBuffSize);
+ error_show(FL, "neg min buffsize: %d", strmMinBuffSize);
}
// Allocate a new stream request struct
@@ -229,10 +229,10 @@ int32 f_stream_Read(strmRequest *myStream, uint8 **dest, int32 numBytes) {
// Parameter verification
if (!myStream)
- error_show(FL, 'FSIS', "f_stream_Read() failed - invalid stream request");
+ error_show(FL, "f_stream_Read() failed - invalid stream request");
if ((numBytes <= 0) || (numBytes >= myStream->strmSize))
- error_show(FL, 'FSR!', "%d stream size %d", numBytes, myStream->strmSize);
+ error_show(FL, "%d stream size %d", numBytes, myStream->strmSize);
// If the stream tail is > the stream head, and the number of bytes at the end of the buffer is < numBytes
// we must unwrap the stream, moving the data at the end of the buffer to the beginning, and slide the beginning down
diff --git a/engines/m4/graphics/gr_buff.cpp b/engines/m4/graphics/gr_buff.cpp
index cec52140a6f..162a48c9e3a 100644
--- a/engines/m4/graphics/gr_buff.cpp
+++ b/engines/m4/graphics/gr_buff.cpp
@@ -105,14 +105,12 @@ int32 gr_buffer_free(Buffer *buf) {
return true;
}
- error_show(FL, 'BUF!');
- return false;
+ error_show(FL);
}
byte *gr_buffer_pointer(Buffer *buf, int32 x, int32 y) {
if (!buf || !buf->data || y < 0 || x < 0) {
- error_show(FL, 'BUF!', "buffer_pointer x,y = %d,%d", x, y);
- return nullptr;
+ error_show(FL, "buffer_pointer x,y = %d,%d", x, y);
}
return (byte *)(buf->data + x + (y * buf->stride));
@@ -120,8 +118,7 @@ byte *gr_buffer_pointer(Buffer *buf, int32 x, int32 y) {
const byte *gr_buffer_pointer(const Buffer *buf, int32 x, int32 y) {
if (!buf || !buf->data || y < 0 || x < 0) {
- error_show(FL, 'BUF!', "buffer_pointer x,y = %d,%d", x, y);
- return nullptr;
+ error_show(FL, "buffer_pointer x,y = %d,%d", x, y);
}
return (byte *)(buf->data + x + (y * buf->stride));
@@ -129,7 +126,7 @@ const byte *gr_buffer_pointer(const Buffer *buf, int32 x, int32 y) {
int32 gr_buffer_init(Buffer *buf, const char *name, int32 w, int32 h) {
if (buf->data)
- error_show(FL, 'BUFR', "buffer_init %s", name);
+ error_show(FL, "buffer_init %s", name);
buf->w = w;
buf->h = h;
@@ -143,7 +140,7 @@ bool gr_buffer_rect_copy_2(const Buffer *from, Buffer *to, int32 sx, int32 sy,
int32 dx, int32 dy, int32 w, int32 h) {
// stupid check for no data
if (!from || !to || !from->data || !to->data)
- error_show(FL, 'BUF!', "buff_rect_copy2");
+ error_show(FL, "buff_rect_copy2");
// CKB: if height is greater than source height, truncate!
if (h > from->h)
@@ -187,7 +184,7 @@ int32 gr_buffer_rect_fill(Buffer *target, int32 x1, int32 y1, int32 w, int32 h)
// if no data, bad.
if (!target || !target->data)
- error_show(FL, 'BUF!', "buffer_rect_fill");
+ error_show(FL, "buffer_rect_fill");
// if nothing to fill, we're done
if ((w < 1) || (h < 1) || (x1 > target->w) || (y1 > target->h))
diff --git a/engines/m4/graphics/gr_font.cpp b/engines/m4/graphics/gr_font.cpp
index 037411539b1..2e05d028b08 100644
--- a/engines/m4/graphics/gr_font.cpp
+++ b/engines/m4/graphics/gr_font.cpp
@@ -359,7 +359,7 @@ Font *gr_font_load(const char *fontName) {
uint32 tag = fontFile.readUint32LE();
if (tag != 'FONT')
- error_show(FL, 'FNTL', "font: %s chkpnt: %d", (const char *)fontName, 0);
+ error_show(FL, "font: %s chkpnt: %d", (const char *)fontName, 0);
Font *newFont = (Font *)mem_alloc(sizeof(Font), STR_FONTSTRUCT);
@@ -370,7 +370,7 @@ Font *gr_font_load(const char *fontName) {
// read 'WIDT' into tag
tag = fontFile.readUint32LE();
if (tag != 'WIDT')
- error_show(FL, 'FNTL', "font: %s chkpnt: %d", fontName, 1);
+ error_show(FL, "font: %s chkpnt: %d", fontName, 1);
// width table
newFont->width = (byte *)mem_alloc(256, STR_FONTWIDTH);
@@ -380,7 +380,7 @@ Font *gr_font_load(const char *fontName) {
// read 'OFFS' into tag
tag = fontFile.readUint32LE();
if (tag != 'OFFS')
- error_show(FL, 'FNTL', "font: %s chkpnt: %d", fontName, 2);
+ error_show(FL, "font: %s chkpnt: %d", fontName, 2);
// offset table
newFont->offset = (short *)mem_alloc(256 * sizeof(int16), STR_FONTOFF);
@@ -391,7 +391,7 @@ Font *gr_font_load(const char *fontName) {
// read 'PIXS' into tag
tag = fontFile.readUint32LE();
if (tag != 'PIXS')
- error_show(FL, 'FNTL', "font: %s chkpnt: %d", fontName, 3);
+ error_show(FL, "font: %s chkpnt: %d", fontName, 3);
// pixData
newFont->pixData = (byte *)mem_alloc(newFont->dataSize, STR_FONTDATA);
diff --git a/engines/m4/graphics/gr_pal.cpp b/engines/m4/graphics/gr_pal.cpp
index c034e5f71bc..af6e473d5f6 100644
--- a/engines/m4/graphics/gr_pal.cpp
+++ b/engines/m4/graphics/gr_pal.cpp
@@ -171,7 +171,7 @@ void gr_restore_palette() {
void pal_mirror_colours(int first_color, int last_color, RGB8 *pal) {
if (first_color < 0 || last_color > 255 || first_color > last_color)
- error_show(FL, 'Burg', "pal_mirror_colours index error");
+ error_show(FL, "pal_mirror_colours index error");
const int num_colors = last_color - first_color + 1;
for (int index = 0; index < num_colors; ++index) {
diff --git a/engines/m4/graphics/gr_series.cpp b/engines/m4/graphics/gr_series.cpp
index 80cf70fbb48..01a57cf5a36 100644
--- a/engines/m4/graphics/gr_series.cpp
+++ b/engines/m4/graphics/gr_series.cpp
@@ -92,7 +92,7 @@ int32 series_load(const char *seriesName, int32 assetIndex, RGB8 *myPal) {
const int32 myAssetIndex = AddWSAssetCELS(seriesName, assetIndex, myPal);
if ((myAssetIndex < 0) || (myAssetIndex >= 256))
- error_show(FL, 'SPNF', seriesName);
+ error_show(FL, seriesName);
return myAssetIndex;
}
@@ -106,13 +106,12 @@ bool series_draw_sprite(int32 spriteHash, int32 index, Buffer *destBuff, int32 x
M4Rect clipRect, updateRect;
if (!destBuff) {
- error_show(FL, 'BUF!');
- return false;
+ error_show(FL);
}
M4sprite *srcSpritePtr = &srcSprite;
if ((srcSpritePtr = GetWSAssetSprite(nullptr, (uint32)spriteHash, (uint32)index, srcSpritePtr, nullptr)) == nullptr)
- error_show(FL, 'SPNF', "hash: %d, index: %d", spriteHash, index);
+ error_show(FL, "hash: %d, index: %d", spriteHash, index);
HLock(srcSpritePtr->sourceHandle);
//gr_pal_interface(&master_palette[0]);
@@ -197,7 +196,7 @@ bool series_stream_break_on_frame(machine *m, int32 frameNum, int32 trigger) {
void series_set_frame_rate(machine *m, int32 newFrameRate) {
if ((!m) || (!m->myAnim8) || !verifyMachineExists(m)) {
if (g_engine->getGameType() == GType_Burger)
- error_show(FL, 'SSFR');
+ error_show(FL);
return;
}
@@ -215,7 +214,7 @@ machine *series_show(const char *seriesName, frac16 layer, uint32 flags, int16 t
tempPalettePtr = &_G(master_palette)[0];
if ((myAssetIndex = AddWSAssetCELS(seriesName, -1, tempPalettePtr)) < 0)
- error_show(FL, 'SPNF', seriesName);
+ error_show(FL, seriesName);
_G(globals)[GLB_TEMP_1] = (frac16)myAssetIndex << 24; // cels hash
_G(globals)[GLB_TEMP_2] = layer << 16; // layer
@@ -235,7 +234,7 @@ machine *series_show(const char *seriesName, frac16 layer, uint32 flags, int16 t
machine *m = kernel_spawn_machine(seriesName, HASH_SERIES_SHOW_MACHINE, series_trigger_dispatch_callback);
if (!m)
- error_show(FL, 'WSMF', seriesName);
+ error_show(FL, seriesName);
return m;
}
@@ -260,7 +259,7 @@ machine *series_play(const char *seriesName, frac16 layer, uint32 flags, int16 t
tempPalettePtr = &_G(master_palette)[0];
if ((myAssetIndex = AddWSAssetCELS(seriesName, -1, tempPalettePtr)) < 0)
- error_show(FL, 'SPNF', seriesName);
+ error_show(FL, seriesName);
_G(globals)[GLB_TEMP_1] = (frac16)myAssetIndex << 24; // cels hash
_G(globals)[GLB_TEMP_2] = layer << 16; // layer
@@ -287,7 +286,7 @@ machine *series_play(const char *seriesName, frac16 layer, uint32 flags, int16 t
machine *m = kernel_spawn_machine(seriesName, HASH_SERIES_PLAY_MACHINE, series_trigger_dispatch_callback);
if (!m)
- error_show(FL, 'WSMF', seriesName);
+ error_show(FL, seriesName);
return m;
}
diff --git a/engines/m4/graphics/gr_sprite.cpp b/engines/m4/graphics/gr_sprite.cpp
index 95c49b2b925..b1694f0f1fa 100644
--- a/engines/m4/graphics/gr_sprite.cpp
+++ b/engines/m4/graphics/gr_sprite.cpp
@@ -36,10 +36,10 @@ namespace M4 {
*/
static uint8 scale_sprite(Buffer *S, Buffer *D, uint32 ScaleX, uint32 ScaleY) {
if (!D)
- error_show(FL, 'BUF!', "scale sprite NULL D");
+ error_show(FL, "scale sprite NULL D");
if (!S)
- error_show(FL, 'BUF!', "scale sprite h:%d w:%d sx:%uld sy:%uld", D->h, D->w, ScaleX, ScaleY);
+ error_show(FL, "scale sprite h:%d w:%d sx:%uld sy:%uld", D->h, D->w, ScaleX, ScaleY);
uint8 *pData = S->data;
@@ -113,7 +113,7 @@ uint8 gr_sprite_draw(DrawRequest *drawReq) {
// if it's RLE encoded, ensure the sprite will decode to match the expected size
if (source.encoding & RLE8) {
if (RLE8Decode_Size(source.data, source.stride) != (size_t)(source.stride * source.h))
- error_show(FL, 'RLE8', "RLE8 sprite suspected BAD!");
+ error_show(FL, "RLE8 sprite suspected BAD!");
}
// Check for RLE encoding in case of shadows
@@ -145,7 +145,7 @@ uint8 gr_sprite_draw(DrawRequest *drawReq) {
if (scaledBuff)
mem_free(scaledBuff);
- error_show(FL, 'SPSF', "gr_sprite_draw");
+ error_show(FL, "gr_sprite_draw");
}
// Preserve encoding
diff --git a/engines/m4/graphics/rend.cpp b/engines/m4/graphics/rend.cpp
index deff5eb6243..2bb17c81526 100644
--- a/engines/m4/graphics/rend.cpp
+++ b/engines/m4/graphics/rend.cpp
@@ -77,7 +77,7 @@ static RenderResult r_0() {
++to;
}
} else {
- uint8 data = *from++;
+ const uint8 data = *from++;
if (!data)
to += runLength;
@@ -132,7 +132,7 @@ static RenderResult r_0_5() {
--to;
}
} else {
- uint8 data = *from++;
+ const uint8 data = *from++;
if (!data)
to -= runLength;
@@ -169,8 +169,8 @@ static RenderResult r_1() {
uint8 *from = _GR(sourceAddress);
uint8 *to = _GR(destinationAddress);
uint8 *depth = _GR(depthAddress);
- uint8 sdepth = _GR(spriteDepth);
- long Inc = _GR(Increment);
+ const uint8 sdepth = _GR(spriteDepth);
+ const long Inc = _GR(Increment);
int32 myWidth = 0;
@@ -210,7 +210,7 @@ static RenderResult r_1() {
}
} else {
while (runLength--) {
- uint8 ddepth = (uint8)(*depth & DEPTH_MASK);
+ const uint8 ddepth = (uint8)(*depth & DEPTH_MASK);
if (!ddepth || sdepth < ddepth)
*to = data;
@@ -221,7 +221,7 @@ static RenderResult r_1() {
}
if (myWidth > 666) {
- error_show(FL, 0);
+ error_show(FL);
}
}
}
@@ -230,8 +230,8 @@ static RenderResult r_2() {
uint8 *from = _GR(sourceAddress);
uint8 *to = _GR(destinationAddress);
int32 Error = _GR(X_error);
- uint32 scaleX = _GR(X_scale);
- long Inc = _GR(Increment);
+ const uint32 scaleX = _GR(X_scale);
+ const long Inc = _GR(Increment);
for (;;) {
// Assume that the first byte is a run-length counter followed by pix data
diff --git a/engines/m4/gui/gui_cheapo.cpp b/engines/m4/gui/gui_cheapo.cpp
index a0338a71292..e10dd04a971 100644
--- a/engines/m4/gui/gui_cheapo.cpp
+++ b/engines/m4/gui/gui_cheapo.cpp
@@ -29,7 +29,6 @@
#include "m4/core/cstring.h"
#include "m4/core/errors.h"
#include "m4/m4.h"
-#include "m4/mem/mem.h"
#include "m4/mem/memman.h"
#include "m4/vars.h"
@@ -41,13 +40,13 @@ RectClass::RectClass() {
RectClass::RectClass(const RectClass *r) {
if (!r) {
- error_show(FL, 'CGNR');
- } else {
- _x1 = r->_x1;
- _y1 = r->_y1;
- _x2 = r->_x2;
- _y2 = r->_y2;
+ error_show(FL);
}
+
+ _x1 = r->_x1;
+ _y1 = r->_y1;
+ _x2 = r->_x2;
+ _y2 = r->_y2;
}
RectClass::RectClass(int16 x1, int16 y1, int16 x2, int16 y2) :
@@ -59,13 +58,13 @@ RectClass::~RectClass() {
void RectClass::copyInto(RectClass *r) const {
if (!r) {
- error_show(FL, 'CGNR');
- } else {
- r->_x1 = _x1;
- r->_y1 = _y1;
- r->_x2 = _x2;
- r->_y2 = _y2;
+ error_show(FL);
}
+
+ r->_x1 = _x1;
+ r->_y1 = _y1;
+ r->_x2 = _x2;
+ r->_y2 = _y2;
}
void RectClass::set(int16 x1, int16 y1, int16 x2, int16 y2) {
@@ -77,13 +76,13 @@ void RectClass::set(int16 x1, int16 y1, int16 x2, int16 y2) {
void RectClass::set(const RectClass *r) {
if (!r) {
- error_show(FL, 'CGNR');
- } else {
- _x1 = r->_x1;
- _y1 = r->_y1;
- _x2 = r->_x2;
- _y2 = r->_y2;
+ error_show(FL);
}
+
+ _x1 = r->_x1;
+ _y1 = r->_y1;
+ _x2 = r->_x2;
+ _y2 = r->_y2;
}
int16 RectClass::inside(int16 x, int16 y) const {
@@ -123,7 +122,7 @@ void TextField::set_string(const char *string) {
}
if (!_string)
- error_show(FL, 'OOM!', "TextField set_string:%s", _string);
+ error_show(FL, "TextField set_string:%s", _string);
_string_len = string_len;
cstrcpy(_string, string);
@@ -475,21 +474,19 @@ void InterfaceBox::set_selected(bool s) {
}
void InterfaceBox::add(ButtonClass *b) {
- if (!b) {
- error_show(FL, 'CGIA');
- } else if (_index >= MAX_BUTTONS) {
- error_show(FL, 'CGIA');
- } else {
- // Convert to global coordinates
- b->_x1 += _x1;
- b->_x2 += _x1;
- b->_y1 += _y1;
- b->_y2 += _y1;
-
- _button[_index] = b;
- _button[_index]->_must_redraw = true;
- ++_index;
+ if (!b || _index >= MAX_BUTTONS) {
+ error_show(FL);
}
+
+ // Convert to global coordinates
+ b->_x1 += _x1;
+ b->_x2 += _x1;
+ b->_y1 += _y1;
+ b->_y2 += _y1;
+
+ _button[_index] = b;
+ _button[_index]->_must_redraw = true;
+ ++_index;
}
ControlStatus InterfaceBox::track(int32 eventType, int16 x, int16 y) {
diff --git a/engines/m4/gui/gui_menu_items.cpp b/engines/m4/gui/gui_menu_items.cpp
index 7277924d3af..4881c602f88 100644
--- a/engines/m4/gui/gui_menu_items.cpp
+++ b/engines/m4/gui/gui_menu_items.cpp
@@ -172,12 +172,12 @@ void guiMenu::shutdown(bool fadeToColor) {
// Restore the background and codes if necessary
if (_GM(dumpedBackground)) {
if (!adv_restoreBackground()) {
- error_show(FL, 0, "unable to restore background");
+ error_show(FL, "unable to restore background");
}
}
if (_GM(dumpedCodes)) {
if (!adv_restoreCodes()) {
- error_show(FL, 0, "unable to restore screen codes");
+ error_show(FL, "unable to restore screen codes");
}
}
diff --git a/engines/m4/gui/gui_vmng_rectangles.cpp b/engines/m4/gui/gui_vmng_rectangles.cpp
index 69dc36bb32f..6556f3bcb04 100644
--- a/engines/m4/gui/gui_vmng_rectangles.cpp
+++ b/engines/m4/gui/gui_vmng_rectangles.cpp
@@ -35,7 +35,7 @@ namespace M4 {
RectList *vmng_CreateNewRect(int32 x1, int32 y1, int32 x2, int32 y2) {
RectList *newRect;
if ((newRect = (RectList *)mem_get_from_stash(_G(memtypeRECT), "+guiRectList")) == nullptr) {
- error_show(FL, 'OOS!', "vmng_CreateNewRect");
+ error_show(FL, "vmng_CreateNewRect");
}
newRect->x1 = x1;
@@ -222,7 +222,7 @@ RectList *vmng_DuplicateRectList(RectList *myRectList) {
// Duplicate myRect and stick it on the newRectList
RectList *tempRect = (RectList *)mem_get_from_stash(_G(memtypeRECT), "+guiRectList");
if (tempRect == nullptr) {
- error_show(FL, 'OOS!', "vmng_DuplicateRectList()");
+ error_show(FL, "vmng_DuplicateRectList()");
}
tempRect->x1 = myRect->x1;
tempRect->y1 = myRect->y1;
@@ -368,7 +368,7 @@ void vmng_RemoveRectFromRectList(RectList **scrnRectList, int32 x1, int32 y1, in
// Create a new rect of just the part that extends beyond the top of myRect
tempRect = (RectList *)mem_get_from_stash(_G(memtypeRECT), "+guiRectangle");
if (tempRect == nullptr) {
- error_show(FL, 'OOS!', "vmng_AddRectToRectList");
+ error_show(FL, "vmng_AddRectToRectList");
}
tempRect->x1 = myRect->x1;
tempRect->y1 = myRect->y1;
@@ -388,7 +388,7 @@ void vmng_RemoveRectFromRectList(RectList **scrnRectList, int32 x1, int32 y1, in
// Create a new rect of just the part that extends beyond the top of myRect
tempRect = (RectList *)mem_get_from_stash(_G(memtypeRECT), "+guiRectangle");
if (tempRect == nullptr) {
- error_show(FL, 'OOS!', "vmng_AddRectToRectList");
+ error_show(FL, "vmng_AddRectToRectList");
}
tempRect->x1 = myRect->x1;
tempRect->y1 = y2 + 1;
@@ -408,7 +408,7 @@ void vmng_RemoveRectFromRectList(RectList **scrnRectList, int32 x1, int32 y1, in
// Create a new rect of just the part that extends beyond the top of myRect
tempRect = (RectList *)mem_get_from_stash(_G(memtypeRECT), "+guiRectangle");
if (tempRect == nullptr) {
- error_show(FL, 'OOS!', "vmng_AddRectToRectList");
+ error_show(FL, "vmng_AddRectToRectList");
}
tempRect->x1 = myRect->x1;
tempRect->y1 = myRect->y1;
@@ -425,7 +425,7 @@ void vmng_RemoveRectFromRectList(RectList **scrnRectList, int32 x1, int32 y1, in
// Create a new rect of just the part that extends beyond the top of myRect
tempRect = (RectList *)mem_get_from_stash(_G(memtypeRECT), "+guiRectangle");
if (tempRect == nullptr) {
- error_show(FL, 'OOS!', "vmng_AddRectToRectList");
+ error_show(FL, "vmng_AddRectToRectList");
}
tempRect->x1 = x2 + 1;
diff --git a/engines/m4/mem/mem.cpp b/engines/m4/mem/mem.cpp
index 5b81bbb4c1b..c378f502a9d 100644
--- a/engines/m4/mem/mem.cpp
+++ b/engines/m4/mem/mem.cpp
@@ -29,7 +29,7 @@ namespace M4 {
void mem_stash_init(int16 num_types) {
if (num_types > _MEMTYPE_LIMIT)
- error_show(FL, 'MSIF', "num_types (%d) _MEMTYPE_LIMIT (%d)", num_types, _MEMTYPE_LIMIT);
+ error_show(FL, "num_types (%d) _MEMTYPE_LIMIT (%d)", num_types, _MEMTYPE_LIMIT);
for (int i = 0; i < _MEMTYPE_LIMIT; i++) {
_G(memBlock)[i] = nullptr;
@@ -54,7 +54,7 @@ bool mem_register_stash_type(int32 *memType, int32 blockSize, int32 maxNumReques
i++;
}
if (i == _MEMTYPE_LIMIT)
- error_show(FL, 'MSIF', "stash: %s", name.c_str());
+ error_show(FL, "stash: %s", name.c_str());
// Found a slot
if (i < _MEMTYPE_LIMIT) {
@@ -70,8 +70,7 @@ bool mem_register_stash_type(int32 *memType, int32 blockSize, int32 maxNumReques
return true;
}
- error_show(FL, 'MSIF', "stash: %s", name.c_str());
- return false;
+ error_show(FL, "stash: %s", name.c_str());
}
void mem_free_to_stash(void *mem, int32 memType) {
@@ -80,7 +79,7 @@ void mem_free_to_stash(void *mem, int32 memType) {
const int32 index = ((intptr)mem - (intptr)_G(memBlock)[memType]) / (_G(sizeMem)[memType] + sizeof(uintptr));
if (index < 0 || index > _G(requests)[memType])
- error_show(FL, 'MSGF');
+ error_show(FL);
b_ptr += index * (_G(sizeMem)[memType] + sizeof(uintptr));
*(uintptr *)b_ptr = 0;
@@ -101,8 +100,7 @@ void *mem_get_from_stash(int32 memType, const Common::String &name) {
}
}
- error_show(FL, 'OOS!', "stash full %s", name.c_str());
- return nullptr;
+ error_show(FL, "stash full %s", name.c_str());
}
char *mem_strdup(const char *str) {
diff --git a/engines/m4/mem/memman.h b/engines/m4/mem/memman.h
index 3bee9e53cba..446954d09b3 100644
--- a/engines/m4/mem/memman.h
+++ b/engines/m4/mem/memman.h
@@ -33,7 +33,7 @@ namespace M4 {
inline Handle mem_alloc(size_t size, const char *detail) {
byte *ptr = (byte *)malloc(size);
if (!ptr)
- error_show(FL, 'OOM!', "mem_alloc() - couldn't allocate %ld bytes - %s", size, detail);
+ error_show(FL, "mem_alloc() - couldn't allocate %ld bytes - %s", size, detail);
Common::fill(ptr, ptr + size, 0);
return (Handle)ptr;
diff --git a/engines/m4/mem/res.cpp b/engines/m4/mem/res.cpp
index 0db741bbd33..7c89e56e041 100644
--- a/engines/m4/mem/res.cpp
+++ b/engines/m4/mem/res.cpp
@@ -165,7 +165,7 @@ void Resources::rtoss(const Common::String &resourceName) {
}
if (!resEntry)
- error_show(FL, 'RIOU', "rtoss: %s", resourceName.c_str());
+ error_show(FL, "rtoss: %s", resourceName.c_str());
if (!(resEntry->Flags & FULLY_BUFFERED))
return;
diff --git a/engines/m4/platform/tile/tile_read.cpp b/engines/m4/platform/tile/tile_read.cpp
index 116d2b0da03..2c48cc3cf09 100644
--- a/engines/m4/platform/tile/tile_read.cpp
+++ b/engines/m4/platform/tile/tile_read.cpp
@@ -39,7 +39,7 @@ void tt_read_header(SysFile *ifp, int32 *file_x, int32 *file_y,
// Open file
if (!ifp->exists())
- error_show(FL, 'FNF!', ".TT file");
+ error_show(FL, ".TT file");
ifp->readUint32LE(); // skip chunk ID
ifp->readUint32LE(); // skip chunk size
@@ -71,14 +71,14 @@ Buffer *tt_read(SysFile *ifp, int index, int32 tile_x, int32 tile_y) {
// Check parameters
if (index < 0)
- error_show(FL, 'TILI');
+ error_show(FL);
const int32 tile_size = tile_x * tile_y;
if (index == 0) {
// First tile data
if (!ifp->exists())
- error_show(FL, 'FNF!', ".TT file");
+ error_show(FL, ".TT file");
// Read data of tiles to file
const int offset = index * tile_size + 256 * 4 + 32; // Get rid of color table and header stuff
@@ -90,8 +90,7 @@ Buffer *tt_read(SysFile *ifp, int index, int32 tile_x, int32 tile_y) {
out->w = 0;
out->stride = 0;
out->h = 0;
- error_show(FL, 'OOM!', "fail to allocate mem for .TT buffer");
- return out;
+ error_show(FL, "fail to allocate mem for .TT buffer");
}
out->w = out->stride = tile_x;
diff --git a/engines/m4/riddle/gui/interface.cpp b/engines/m4/riddle/gui/interface.cpp
index 0091ff18dca..9387b39c62c 100644
--- a/engines/m4/riddle/gui/interface.cpp
+++ b/engines/m4/riddle/gui/interface.cpp
@@ -47,7 +47,7 @@ bool Interface::init(int arrow, int wait, int look, int grab, int use) {
gr_pal_interface(_G(master_palette));
if (_sprite != 22)
- error_show(FL, 'SLF!');
+ error_show(FL);
mouse_set_sprite(arrow);
diff --git a/engines/m4/riddle/gui/inventory.cpp b/engines/m4/riddle/gui/inventory.cpp
index 8b2682de5c2..d831702b43f 100644
--- a/engines/m4/riddle/gui/inventory.cpp
+++ b/engines/m4/riddle/gui/inventory.cpp
@@ -49,7 +49,7 @@ Inventory::Inventory(const RectClass &r, int32 sprite, int16 cells_h, int16 cell
// If requested cell configuration doesn't fit, blow up.
if ((cells_h * cell_w > (_x2 - _x1)) || (cells_v * cell_h > (_y2 - _y1))) {
- error_show(FL, 'CGIC');
+ error_show(FL);
}
_highlight = -1;
@@ -83,7 +83,7 @@ bool Inventory::add(const Common::String &name, const Common::String &verb, int3
}
if (_num_cells >= INVENTORY_CELLS_COUNT) {
- error_show(FL, 'CGIA');
+ error_show(FL);
return false;
}
diff --git a/engines/m4/riddle/rooms/section8/room808.cpp b/engines/m4/riddle/rooms/section8/room808.cpp
index 5d7c0b77e91..5e8d5525564 100644
--- a/engines/m4/riddle/rooms/section8/room808.cpp
+++ b/engines/m4/riddle/rooms/section8/room808.cpp
@@ -1711,7 +1711,7 @@ void Room808::daemon() {
bool Room808::getWalkPath(machine *machine, int32 walk_x, int32 walk_y) {
if (machine == nullptr || machine->myAnim8 == nullptr) {
- error_show(FL, 514, "ws_walk");
+ error_show(FL, "ws_walk");
}
const int32 currPos_x = machine->myAnim8->myRegs[IDX_X] >> 16;
@@ -1721,19 +1721,19 @@ bool Room808::getWalkPath(machine *machine, int32 walk_x, int32 walk_y) {
const int32 currNode = AddRailNode(currPos_x, currPos_y, currBuffer, true);
if (currNode < 0) {
- error_show(FL, 520, "Walker's curr posn: %ld %ld", currPos_x, currPos_y);
+ error_show(FL, "Walker's curr posn: %ld %ld", currPos_x, currPos_y);
}
const int32 destNode = AddRailNode(walk_x, walk_y, currBuffer, true);
if (destNode < 0) {
- error_show(FL, 520, "Trying to walk to: %ld %ld", walk_x, walk_y);
+ error_show(FL, "Trying to walk to: %ld %ld", walk_x, walk_y);
}
if (machine->walkPath)
DisposePath(machine->walkPath);
- bool retVal = GetShortestPath(currNode, destNode, &machine->walkPath);
+ const bool retVal = GetShortestPath(currNode, destNode, &machine->walkPath);
RemoveRailNode(currNode, currBuffer, true);
RemoveRailNode(destNode, currBuffer, true);
diff --git a/engines/m4/vars.cpp b/engines/m4/vars.cpp
index ebfb4c8903a..94e5af4f055 100644
--- a/engines/m4/vars.cpp
+++ b/engines/m4/vars.cpp
@@ -79,23 +79,23 @@ bool Vars::init() {
if (!_kernel.hag_mode) {
if (!read_catalog())
- error_show(FL, 'PARS', "game_main");
+ error_show(FL, "game_main");
}
term_message("Load walker engines");
if (!LoadWSAssets("walker script", &_master_palette[0]))
- error_show(FL, 'FNF!', "walker script");
+ error_show(FL, "walker script");
if (!LoadWSAssets("show script", &_master_palette[0]))
- error_show(FL, 'FNF!', "show script");
+ error_show(FL, "show script");
if (!LoadWSAssets("stream script", &_master_palette[0]))
- error_show(FL, 'FNF!', "stream script");
+ error_show(FL, "stream script");
grab_fonts();
gr_font_set(_font_inter);
if (_cheating_enabled) {
if (!dbg_ws_init(_kernel.start_up_with_dbg_ws, _font_tiny_prop, _globals))
- error_show(FL, 'DWIF', "cheat system");
+ error_show(FL, "cheat system");
}
main_cold_data_init();
@@ -110,7 +110,7 @@ bool Vars::init() {
void Vars::game_systems_initialize(byte flags) {
_G(term).init(_G(kernel).use_debug_monitor, _G(kernel).use_log_file);
- int totalMem = _G(kernel).mem_avail();
+ const int totalMem = _G(kernel).mem_avail();
if (_G(kernel).suppress_cache == CACHE_NOT_OVERRIDE_BY_FLAG_PARSE)
_G(kernel).suppress_cache = totalMem < 8000000;
@@ -127,7 +127,7 @@ void Vars::game_systems_initialize(byte flags) {
if (flags & INSTALL_PLAYER_BEEN_INIT) {
if (!player_been_init(MAX_SCENES))
- error_show(FL, 'PBIF');
+ error_show(FL);
}
term_message("Firing up GUI");
@@ -142,7 +142,7 @@ void Vars::game_systems_initialize(byte flags) {
}
if (!woodscript_init())
- error_show(FL, 'WSIF');
+ error_show(FL);
gr_pal_clear(_master_palette);
@@ -151,7 +151,7 @@ void Vars::game_systems_initialize(byte flags) {
InitRails();
if (!f_stream_Init())
- error_show(FL, 'FSIF');
+ error_show(FL);
mouse_set_sprite(kArrowCursor);
@@ -219,19 +219,19 @@ void Vars::game_systems_shutdown() {
void Vars::fire_up_gui() {
if (!gui_system_init())
- error_show(FL, 'GUI0');
+ error_show(FL);
if (!vmng_init())
- error_show(FL, 'GUI1');
+ error_show(FL);
if (!gui_mouse_init())
- error_show(FL, 'GUI2');
+ error_show(FL);
if (!gui_dialog_init())
- error_show(FL, 'GUI3');
+ error_show(FL);
#ifdef TODO
if (!InitItems())
- error_show(FL, 'GUI4');
+ error_show(FL);
#endif
if (!gui_buffer_system_init())
- error_show(FL, 'GUI5');
+ error_show(FL);
}
bool Vars::woodscript_init() {
diff --git a/engines/m4/wscript/ws_cruncher.cpp b/engines/m4/wscript/ws_cruncher.cpp
index 71acf90175b..416d0e409af 100644
--- a/engines/m4/wscript/ws_cruncher.cpp
+++ b/engines/m4/wscript/ws_cruncher.cpp
@@ -30,7 +30,7 @@
namespace M4 {
-#define VERIFY_INTIALIZED(s) if (!_GWS(cruncherInitialized)) error_show(FL, 'WSCI', "%s failed.", s);
+#define VERIFY_INTIALIZED(s) if (!_GWS(cruncherInitialized)) error_show(FL, "%s failed.", s);
static int32 dataFormats[] = { 0, 5, 8, 12, 16 };
@@ -127,12 +127,12 @@ int32 *ws_GetDataFormats() {
bool ws_InitCruncher(void) {
// Make sure the cruncher has not been initialized
if (_GWS(cruncherInitialized))
- error_show(FL, 'WSCR');
+ error_show(FL);
// Register the end of sequence struct with the stash manager
mem_register_stash_type(&_GWS(memtypeEOS), sizeof(EOSreq), 32, "+EOS");
if (_GWS(memtypeEOS) < 0)
- error_show(FL, 'WSCE');
+ error_show(FL);
_GWS(myCruncher) = (cruncher *)mem_alloc(sizeof(cruncher), "cruncher");
@@ -244,8 +244,8 @@ bool ws_ChangeAnim8Program(machine *m, int32 newSequHash) {
VERIFY_INTIALIZED("ws_ChangeAnim8Program()");
// Parameter verification
- if ((!m) || (!m->myAnim8)) {
- error_show(FL, 'WSMI');
+ if (!m || !m->myAnim8) {
+ error_show(FL);
}
Anim8 *myAnim8 = m->myAnim8;
@@ -278,7 +278,7 @@ void ws_RemoveAnim8FromCruncher(Anim8 *myAnim8) {
VERIFY_INTIALIZED("ws_RemoveAnim8FromCruncher()");
if (!myAnim8)
- error_show(FL, 'WSAI');
+ error_show(FL);
// In case we are crunching the current list of EOS requests, remove any for this machine
EOSreq *tempEOSreq = _GWS(EOSreqList);
@@ -348,7 +348,7 @@ bool ws_PauseAnim8(Anim8 *myAnim8) {
VERIFY_INTIALIZED("ws_PauseAnim8()");
if (!myAnim8)
- error_show(FL, 'WSAI');
+ error_show(FL);
myAnim8->active = false;
HideCCB(myAnim8->myCCB);
@@ -361,7 +361,7 @@ bool ws_ResumeAnim8(Anim8 *myAnim8) {
VERIFY_INTIALIZED("ws_PauseAnim8()");
if (!myAnim8)
- error_show(FL, 'WSAI');
+ error_show(FL);
myAnim8->active = true;
if (myAnim8->myCCB) {
diff --git a/engines/m4/wscript/ws_hal.cpp b/engines/m4/wscript/ws_hal.cpp
index bf4badeb274..2635fdf1beb 100644
--- a/engines/m4/wscript/ws_hal.cpp
+++ b/engines/m4/wscript/ws_hal.cpp
@@ -116,7 +116,7 @@ void ws_Error(machine *m, int32 errorType, trigraph errorCode, const char *errMs
f_io_close(logFile);
// Now we fatal abort
- error_show(FL, errorCode, errMsg);
+ error_show(FL, errMsg);
}
void ws_LogErrorMsg(const char *filename, uint32 line, const char *fmt, ...) {
@@ -531,7 +531,7 @@ void ShowCCB(CCB *myCCB) {
void MoveCCB(CCB *myCCB, frac16 deltaX, frac16 deltaY) {
if (!myCCB || !myCCB->source) {
- error_show(FL, 'WSIC');
+ error_show(FL);
}
myCCB->newLocation->x1 = myCCB->currLocation->x1 + (deltaX >> 16);
@@ -562,7 +562,7 @@ void MoveCCB(CCB *myCCB, frac16 deltaX, frac16 deltaY) {
void KillCCB(CCB *myCCB, bool restoreFlag) {
if (!myCCB) {
- error_show(FL, 'WSIC');
+ error_show(FL);
}
if (restoreFlag && (!(myCCB->flags & CCB_SKIP)) && (!(myCCB->flags & CCB_HIDE))) {
if ((myCCB->flags & CCB_STREAM) && myCCB->maxArea) {
@@ -594,12 +594,12 @@ void KillCCB(CCB *myCCB, bool restoreFlag) {
void Cel_msr(Anim8 *myAnim8) {
if (!myAnim8) {
- error_show(FL, 'WSAI');
+ error_show(FL);
}
CCB *myCCB = myAnim8->myCCB;
if ((!myCCB) || (!myCCB->source)) {
- error_show(FL, 'WSIC');
+ error_show(FL);
}
if ((myCCB->source->w == 0) || (myCCB->source->h == 0)) {
@@ -608,7 +608,7 @@ void Cel_msr(Anim8 *myAnim8) {
frac16 *myRegs = myAnim8->myRegs;
if (!myRegs) {
- error_show(FL, 'WSAI');
+ error_show(FL);
}
const int32 scaler = FixedMul(myRegs[IDX_S], 100 << 16) >> 16;
diff --git a/engines/m4/wscript/ws_load.cpp b/engines/m4/wscript/ws_load.cpp
index 972d8e98c13..aaf7d96645b 100644
--- a/engines/m4/wscript/ws_load.cpp
+++ b/engines/m4/wscript/ws_load.cpp
@@ -91,7 +91,7 @@ bool InitWSAssets() {
// Make sure this is only called once.
if (_GWS(wsloaderInitialized)) {
- error_show(FL, 'WSSN');
+ error_show(FL);
}
// Allocate space for the tables used by the loader and the resource io MACHine tables
@@ -264,13 +264,13 @@ bool LoadWSAssets(const char *wsAssetName, RGB8 *myPalette) {
// Check that the loader has been initialized
if (!_GWS(wsloaderInitialized)) {
- error_show(FL, 'WSLI');
+ error_show(FL);
}
// Use the resource io manager to read in the entire block
const MemHandle workHandle = rget(wsAssetName, &assetSize);
if (workHandle == nullptr) {
- error_show(FL, 'FNF!', "Asset Name: %s", wsAssetName);
+ error_show(FL, "Asset Name: %s", wsAssetName);
}
// Lock the handle so we can step through the chunk
@@ -293,10 +293,10 @@ bool LoadWSAssets(const char *wsAssetName, RGB8 *myPalette) {
while (!finished) {
// Read in the chunk size and hash number
if (!GetNextint32(&parseAssetPtr, endOfAssetBlock, chunkSize)) {
- error_show(FL, 'WSLE', "Asset Name: %s", wsAssetName);
+ error_show(FL, "Asset Name: %s", wsAssetName);
}
if (!GetNextint32(&parseAssetPtr, endOfAssetBlock, chunkHash)) {
- error_show(FL, 'WSLE', "Asset Name: %s", wsAssetName);
+ error_show(FL, "Asset Name: %s", wsAssetName);
}
// Process the chunk according to type
@@ -314,7 +314,7 @@ bool LoadWSAssets(const char *wsAssetName, RGB8 *myPalette) {
case CHUNK_MACH:
// Check the validity of the machine hash number, and clear it
if (*chunkHash > MAX_ASSET_HASH) {
- error_show(FL, 'WSLA', "Asset Name: %s, MACH hash was: %d", wsAssetName, *chunkHash);
+ error_show(FL, "Asset Name: %s, MACH hash was: %d", wsAssetName, *chunkHash);
}
ClearWSAssets(_WS_ASSET_MACH, *chunkHash, *chunkHash);
@@ -325,7 +325,7 @@ bool LoadWSAssets(const char *wsAssetName, RGB8 *myPalette) {
// Check that the assetblocksize is big enough that the chunk body was read in...
if ((endOfAssetBlock - parseAssetPtr) < (int)(*chunkSize - 12)) {
- error_show(FL, 'WSLE', "Asset Name: %s, MACH hash was: %d", wsAssetName, *chunkHash);
+ error_show(FL, "Asset Name: %s, MACH hash was: %d", wsAssetName, *chunkHash);
}
// Byteswap the entire machine if necessary
@@ -353,7 +353,7 @@ bool LoadWSAssets(const char *wsAssetName, RGB8 *myPalette) {
case CHUNK_SEQU:
// Check the validity of the sequence hash number, and clear it
if (*chunkHash > MAX_ASSET_HASH) {
- error_show(FL, 'WSLA', "Asset Name: %s, SEQU hash was: %d", wsAssetName, *chunkHash);
+ error_show(FL, "Asset Name: %s, SEQU hash was: %d", wsAssetName, *chunkHash);
}
ClearWSAssets(_WS_ASSET_SEQU, *chunkHash, *chunkHash);
@@ -364,7 +364,7 @@ bool LoadWSAssets(const char *wsAssetName, RGB8 *myPalette) {
// Check that the assetblocksize is big enough that the chunk body was read in...
if ((endOfAssetBlock - parseAssetPtr) < (int)(*chunkSize - 12)) {
- error_show(FL, 'WSLE', "Asset Name: %s, SEQU hash was: %d", wsAssetName, *chunkHash);
+ error_show(FL, "Asset Name: %s, SEQU hash was: %d", wsAssetName, *chunkHash);
}
// Byteswap the entire sequence if necessary
@@ -392,7 +392,7 @@ bool LoadWSAssets(const char *wsAssetName, RGB8 *myPalette) {
case CHUNK_DATA:
// Check the validity of the data block hash number, and clear it
if (*chunkHash > MAX_ASSET_HASH) {
- error_show(FL, 'WSLA', "Asset Name: %s, DATA hash was: %d", wsAssetName, *chunkHash);
+ error_show(FL, "Asset Name: %s, DATA hash was: %d", wsAssetName, *chunkHash);
}
ClearWSAssets(_WS_ASSET_DATA, *chunkHash, *chunkHash);
@@ -403,7 +403,7 @@ bool LoadWSAssets(const char *wsAssetName, RGB8 *myPalette) {
// Check that the assetblocksize is big enough that the chunk body was read in...
if ((endOfAssetBlock - parseAssetPtr) < (int)(*chunkSize - 12)) {
- error_show(FL, 'WSLE', "Asset Name: %s, DATA hash was: %d", wsAssetName, *chunkHash);
+ error_show(FL, "Asset Name: %s, DATA hash was: %d", wsAssetName, *chunkHash);
}
// Byteswap the entire data block if necessary
@@ -430,7 +430,7 @@ bool LoadWSAssets(const char *wsAssetName, RGB8 *myPalette) {
case CHUNK_CELS: {
// Check the validity of the cels hash number, and clear it
if (*chunkHash > MAX_ASSET_HASH) {
- error_show(FL, 'WSLA', "Asset Name: %s, CELS hash was: %d", wsAssetName, *chunkHash);
+ error_show(FL, "Asset Name: %s, CELS hash was: %d", wsAssetName, *chunkHash);
}
ClearWSAssets(_WS_ASSET_CELS, *chunkHash, *chunkHash);
@@ -440,7 +440,7 @@ bool LoadWSAssets(const char *wsAssetName, RGB8 *myPalette) {
// Process the SS from the stream file
if (ProcessCELS(wsAssetName, &parseAssetPtr, mainAssetPtr, endOfAssetBlock, &celsPtr, &palPtr, myPalette) < 0) {
- error_show(FL, 'WSLP', "Asset Name: %s, CELS hash was: %d", wsAssetName, *chunkHash);
+ error_show(FL, "Asset Name: %s, CELS hash was: %d", wsAssetName, *chunkHash);
}
// At this point, celsPtr points to the beginning of the cels data, palPtr to the pal data
@@ -460,7 +460,7 @@ bool LoadWSAssets(const char *wsAssetName, RGB8 *myPalette) {
}
default:
- error_show(FL, 'WSLT', "Asset Name: %s, %d bytes into the file.", wsAssetName,
+ error_show(FL, "Asset Name: %s, %d bytes into the file.", wsAssetName,
(intptr)parseAssetPtr - 12 - (intptr)mainAssetPtr);
break;
}
@@ -549,7 +549,7 @@ int32 LoadSpriteSeries(const char *assetName, MemHandle *seriesHandle, int32 *ce
// Load in the sprite series
if ((workHandle = rget(assetName, &assetSize)) == nullptr)
- error_show(FL, 'FNF!', "Sprite series: %s", assetName);
+ error_show(FL, "Sprite series: %s", assetName);
HLock(workHandle);
@@ -560,7 +560,7 @@ int32 LoadSpriteSeries(const char *assetName, MemHandle *seriesHandle, int32 *ce
// Process the SS from the stream file
const int32 celsSize = ProcessCELS(assetName, &parseAssetPtr, mainAssetPtr, endOfAssetBlock, &celsPtr, &palPtr, myPalette);
if (celsSize < 0) {
- error_show(FL, 'WSLP', "series: %s", assetName);
+ error_show(FL, "series: %s", assetName);
}
// Store the handle and offsets
@@ -609,7 +609,7 @@ int32 LoadSpriteSeriesDirect(const char *assetName, MemHandle *seriesHandle, int
// Process the SS from the stream file
const int32 celsSize = ProcessCELS(assetName, &parseAssetPtr, mainAssetPtr, endOfAssetBlock, &celsPtr, &palPtr, myPalette);
if (celsSize < 0) {
- error_show(FL, 'WSLP', "series: %s", assetName);
+ error_show(FL, "series: %s", assetName);
}
// Store the handle and offsets
@@ -654,7 +654,7 @@ int32 AddWSAssetCELS(const char *wsAssetName, int32 hash, RGB8 *myPalette) {
// Check that the loader has been initialized
if (!_GWS(wsloaderInitialized)) {
- error_show(FL, 'WSLI', "Asset Name: %s", wsAssetName);
+ error_show(FL, "Asset Name: %s", wsAssetName);
}
int32 emptySlot = -1;
@@ -677,7 +677,7 @@ int32 AddWSAssetCELS(const char *wsAssetName, int32 hash, RGB8 *myPalette) {
// Else the SS must be stored in the given hash, replacing any previous contents.
// Index checking
if (hash > MAX_ASSET_HASH) {
- error_show(FL, 'WSLA', "Asset Name: %s, hash given was %d", wsAssetName, hash);
+ error_show(FL, "Asset Name: %s, hash given was %d", wsAssetName, hash);
}
// Check to see if the SS is already loaded in the given hash slot
@@ -706,7 +706,7 @@ int32 AddWSAssetCELS(const char *wsAssetName, int32 hash, RGB8 *myPalette) {
if ((i > MAX_ASSET_HASH) && (emptySlot >= 0)) {
workHandle = rget(wsAssetName, &assetSize);
if (workHandle == nullptr) {
- error_show(FL, 'FNF!', wsAssetName);
+ error_show(FL, wsAssetName);
}
// Lock the handle so we can step through the chunk
@@ -723,7 +723,7 @@ int32 AddWSAssetCELS(const char *wsAssetName, int32 hash, RGB8 *myPalette) {
// Process the SS from the stream file
if (ProcessCELS(wsAssetName, &parseAssetPtr, mainAssetPtr, endOfAssetBlock, &celsPtr, &palPtr, myPalette) < 0) {
- error_show(FL, 'WSLP', "Asset Name: %s", wsAssetName);
+ error_show(FL, "Asset Name: %s", wsAssetName);
}
// At this point, celsPtr points to the beginning of the cels data, palPtr to the pal data
@@ -763,7 +763,7 @@ int32 AddWSAssetCELS(const char *wsAssetName, int32 hash, RGB8 *myPalette) {
return i;
} else {
// Else we searched the entire table, it was not already loaded, and there are no empty slots
- error_show(FL, 'WSLF', "Asset Name: %s", wsAssetName);
+ error_show(FL, "Asset Name: %s", wsAssetName);
}
return -1;
@@ -1033,7 +1033,7 @@ int32 LoadSpriteSeries(const char *assetName, Handle *seriesHandle, int32 *celsO
// Load in the sprite series
const MemHandle workHandle = rget(assetName, &assetSize);
if (workHandle == nullptr)
- error_show(FL, 'FNF!', "Sprite series: %s", assetName);
+ error_show(FL, "Sprite series: %s", assetName);
HLock(workHandle);
@@ -1044,7 +1044,7 @@ int32 LoadSpriteSeries(const char *assetName, Handle *seriesHandle, int32 *celsO
// Process the SS from the stream file
const int32 celsSize = ProcessCELS(assetName, &parseAssetPtr, mainAssetPtr, endOfAssetBlock, &celsPtr, &palPtr, myPalette);
if (celsSize < 0) {
- error_show(FL, 'WSLP', "series: %s", assetName);
+ error_show(FL, "series: %s", assetName);
}
// Store the handle and offsets
@@ -1094,7 +1094,7 @@ int32 LoadSpriteSeriesDirect(const char *assetName, Handle *seriesHandle, int32
// Process the SS from the stream file
const int32 celsSize = ProcessCELS(assetName, &parseAssetPtr, mainAssetPtr, endOfAssetBlock, &celsPtr, &palPtr, myPalette);
if (celsSize < 0) {
- error_show(FL, 'WSLP', "series: %s", assetName);
+ error_show(FL, "series: %s", assetName);
}
// Store the handle and offsets
More information about the Scummvm-git-logs
mailing list