[Scummvm-git-logs] scummvm master -> 9f2ea57755909bc36e3fe9b2fb25e1497b545c1f
Strangerke
noreply at scummvm.org
Tue Feb 10 11:39:22 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
8229d09fa9 M4: Remove two unused functions
9f2ea57755 M4: Complete the description of all the calls of error_show, remove the variant without a description
Commit: 8229d09fa917fe0c0e0477e425f420d118e98388
https://github.com/scummvm/scummvm/commit/8229d09fa917fe0c0e0477e425f420d118e98388
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-02-10T12:38:54+01:00
Commit Message:
M4: Remove two unused functions
Changed paths:
engines/m4/adv_r/adv_walk.cpp
engines/m4/adv_r/adv_walk.h
engines/m4/wscript/ws_hal.cpp
engines/m4/wscript/ws_hal.h
diff --git a/engines/m4/adv_r/adv_walk.cpp b/engines/m4/adv_r/adv_walk.cpp
index 8958ae3c067..2ad20eb333b 100644
--- a/engines/m4/adv_r/adv_walk.cpp
+++ b/engines/m4/adv_r/adv_walk.cpp
@@ -43,7 +43,7 @@ void set_walker_scaling(SceneDef *rdef) {
static void ws_walkto_node(machine *myWalker, railNode *destNode, bool firstTime) {
// Parameter verification
if (!myWalker || !destNode) {
- error_show(FL);
+ error_show(FL, "walkto node");
}
// Calculate the destination values x, y, s
@@ -72,7 +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);
+ error_show(FL, "walker node callback");
}
// Remove the node we just arrived at from the sender's walkPath
@@ -101,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);
+ error_show(FL, "ws_walk");
// Get walker's current location
const int32 currX = myWalker->myAnim8->myRegs[IDX_X] >> 16;
@@ -166,47 +166,6 @@ void ws_walk(machine *myWalker, int32 x, int32 y, GrBuff **, int16 trigger, int3
adv_hyperwalk_to_final_destination(nullptr, nullptr);
}
-bool adv_walker_path_exists(machine *myWalker, int32 x, int32 y) {
- int32 currNodeID, destNodeID;
-
- if (!myWalker || !myWalker->myAnim8) {
- error_show(FL);
- }
-
- // Get walker's current location
- const int32 currX = myWalker->myAnim8->myRegs[IDX_X] >> 16;
- const int32 currY = myWalker->myAnim8->myRegs[IDX_Y] >> 16;
-
- // Add the walker's current location and the destination to the rail nodes...
- Buffer *walkerCodes = nullptr;
- if (_G(screenCodeBuff)) {
- walkerCodes = _G(screenCodeBuff)->get_buffer();
- }
- if ((currNodeID = AddRailNode(currX, currY, walkerCodes, true)) < 0) {
- error_show(FL, "Walker's curr posn: %d %d", currX, currY);
- }
- if ((destNodeID = AddRailNode(x, y, walkerCodes, true)) < 0) {
- error_show(FL, "Trying to walk to: %d %d", x, y);
- }
-
- // Dispose of the current path myWalker is following
- if (myWalker->walkPath) {
- DisposePath(myWalker->walkPath);
- }
-
- // Find the shortest path between currNodeID, and destNodeID
- const bool result = GetShortestPath(currNodeID, destNodeID, &(myWalker->walkPath));
-
- // Now that a path has been attempted, remove the two extra added nodes
- RemoveRailNode(currNodeID, walkerCodes, true);
- RemoveRailNode(destNodeID, walkerCodes, true);
- if (_G(screenCodeBuff))
- _G(screenCodeBuff)->release();
-
- return result;
-}
-
-
void ws_custom_walk(machine *myWalker, int32 finalFacing, int32 trigger, bool complete_walk) {
const int8 directions[14] = { 0, 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 9 };
@@ -313,7 +272,7 @@ void ws_demand_location(int32 x, int32 y, int facing) {
void ws_hide_walker(machine *myWalker) {
if (!myWalker) {
- error_show(FL);
+ error_show(FL, "hide walker");
}
_G(player).walker_visible = false;
@@ -322,7 +281,7 @@ void ws_hide_walker(machine *myWalker) {
void ws_unhide_walker(machine *myWalker) {
if (!myWalker) {
- error_show(FL);
+ error_show(FL, "unhide_walker");
}
_G(player).walker_visible = true;
@@ -353,7 +312,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);
+ error_show(FL, "ws_Get_walker_info");
}
Anim8 *myAnim8 = myWalker->myAnim8;
@@ -401,7 +360,7 @@ void ws_walk_init_system() {
_G(my_walker) = _GW().walk_initialize_walker();
if (!_G(my_walker)) {
- error_show(FL);
+ error_show(FL, "ws_walk_init_system");
}
}
@@ -412,7 +371,7 @@ void 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);
+ error_show(FL, "ws_walk_load_series");
i++;
}
diff --git a/engines/m4/adv_r/adv_walk.h b/engines/m4/adv_r/adv_walk.h
index 5778ff79e4b..57410557ac5 100644
--- a/engines/m4/adv_r/adv_walk.h
+++ b/engines/m4/adv_r/adv_walk.h
@@ -89,7 +89,6 @@ void ws_custom_walk(machine *myWalker, int32 finalFacing, int32 trigger, bool co
#define adv_walker_move(ww, xx, yy) (ws_demand_location(ww, xx, yy))
#define adv_walker_hide(ww) (ws_hide_walker(ww))
#define adv_walker_unhide(ww) (ws_unhide_walker(ww))
-bool adv_walker_path_exists(machine *myWalker, int32 x, int32 y);
void adv_hyperwalk_to_final_destination(void *, void *);
diff --git a/engines/m4/wscript/ws_hal.cpp b/engines/m4/wscript/ws_hal.cpp
index 067307d046b..e45d548c5e7 100644
--- a/engines/m4/wscript/ws_hal.cpp
+++ b/engines/m4/wscript/ws_hal.cpp
@@ -520,41 +520,10 @@ void ShowCCB(CCB *myCCB) {
myCCB->flags &= ~CCB_HIDE;
}
-void MoveCCB(CCB *myCCB, frac16 deltaX, frac16 deltaY) {
- if (!myCCB || !myCCB->source) {
- error_show(FL);
- }
-
- myCCB->newLocation->x1 = myCCB->currLocation->x1 + (deltaX >> 16);
- myCCB->newLocation->y1 = myCCB->currLocation->y1 + (deltaY >> 16);
- myCCB->newLocation->x2 = myCCB->currLocation->x2 + (deltaX >> 16);
- myCCB->newLocation->y2 = myCCB->currLocation->y2 + (deltaY >> 16);
-
- if (myCCB->flags & CCB_STREAM) {
- if (!myCCB->maxArea) {
- myCCB->maxArea = (M4Rect *)mem_alloc(sizeof(M4Rect), "Rectangle");
-
- myCCB->maxArea->x1 = myCCB->newLocation->x1;
- myCCB->maxArea->y1 = myCCB->newLocation->y1;
- myCCB->maxArea->x2 = myCCB->newLocation->x2;
- myCCB->maxArea->y2 = myCCB->newLocation->y2;
- } else {
- myCCB->maxArea->x1 = imath_min(myCCB->maxArea->x1, myCCB->newLocation->x1);
- myCCB->maxArea->y1 = imath_min(myCCB->maxArea->y1, myCCB->newLocation->y1);
- myCCB->maxArea->x2 = imath_max(myCCB->maxArea->x2, myCCB->newLocation->x2);
- myCCB->maxArea->y2 = imath_max(myCCB->maxArea->y2, myCCB->newLocation->y2);
- }
- }
-
- if ((myCCB->source->w != 0) && (myCCB->source->h != 0)) {
- myCCB->flags |= CCB_REDRAW;
- }
-}
-
void KillCCB(CCB *myCCB, bool restoreFlag) {
- if (!myCCB) {
- error_show(FL);
- }
+ if (!myCCB)
+ error_show(FL, "myCCB not set");
+
if (restoreFlag && (!(myCCB->flags & CCB_SKIP)) && (!(myCCB->flags & CCB_HIDE))) {
if ((myCCB->flags & CCB_STREAM) && myCCB->maxArea) {
vmng_AddRectToRectList(&_GWS(deadRectList), myCCB->maxArea->x1, myCCB->maxArea->y1,
@@ -585,12 +554,12 @@ void KillCCB(CCB *myCCB, bool restoreFlag) {
void Cel_msr(Anim8 *myAnim8) {
if (!myAnim8) {
- error_show(FL);
+ error_show(FL, "myAnim8 not set");
}
CCB *myCCB = myAnim8->myCCB;
if ((!myCCB) || (!myCCB->source)) {
- error_show(FL);
+ error_show(FL, "myCCB not set");
}
if ((myCCB->source->w == 0) || (myCCB->source->h == 0)) {
@@ -599,7 +568,7 @@ void Cel_msr(Anim8 *myAnim8) {
frac16 *myRegs = myAnim8->myRegs;
if (!myRegs) {
- error_show(FL);
+ error_show(FL, "myRegs not set");
}
const int32 scaler = FixedMul(myRegs[IDX_S], 100 << 16) >> 16;
@@ -632,14 +601,11 @@ void Cel_msr(Anim8 *myAnim8) {
myCCB->layer = imath_max(0, myAnim8->myLayer);
myCCB->flags &= ~CCB_SKIP;
myCCB->flags |= CCB_REDRAW;
- return;
}
void ws_OverrideCrunchTime(machine *m) {
- if ((!m) || (!m->myAnim8)) {
- return;
- }
- m->myAnim8->switchTime = 0;
+ if (m && m->myAnim8)
+ m->myAnim8->switchTime = 0;
}
} // End of namespace M4
diff --git a/engines/m4/wscript/ws_hal.h b/engines/m4/wscript/ws_hal.h
index 9b98188159b..de3486a5fab 100644
--- a/engines/m4/wscript/ws_hal.h
+++ b/engines/m4/wscript/ws_hal.h
@@ -56,8 +56,7 @@ void GetBezPoint(frac16 *x, frac16 *y, frac16 *coeffs, frac16 tVal);
void InitCCB(CCB *myCCB);
void HideCCB(CCB *myCCB);
void ShowCCB(CCB *myCCB);
-//void SetLastCCB(CCB *myCCB);
-void MoveCCB(CCB *myCCB, frac16 deltaX, frac16 deltaY);
+
void KillCCB(CCB *myCCB, bool restoreFlag);
void Cel_msr(Anim8 *myAnim8);
void ws_OverrideCrunchTime(machine *m);
Commit: 9f2ea57755909bc36e3fe9b2fb25e1497b545c1f
https://github.com/scummvm/scummvm/commit/9f2ea57755909bc36e3fe9b2fb25e1497b545c1f
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-02-10T12:38:55+01:00
Commit Message:
M4: Complete the description of all the calls of error_show, remove the variant without a description
Changed paths:
engines/m4/adv_db_r/db_catalog.cpp
engines/m4/adv_r/adv_been.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/conv.cpp
engines/m4/burger/gui/interface.cpp
engines/m4/burger/gui/inventory.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_buff.h
engines/m4/graphics/gr_series.cpp
engines/m4/graphics/rend.cpp
engines/m4/gui/gui_cheapo.cpp
engines/m4/mem/mem.cpp
engines/m4/platform/tile/tile_read.cpp
engines/m4/riddle/gui/interface.cpp
engines/m4/riddle/gui/inventory.cpp
engines/m4/riddle/walker.cpp
engines/m4/vars.cpp
engines/m4/wscript/ws_cruncher.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 ca42bddbdf1..f056a55d856 100644
--- a/engines/m4/adv_db_r/db_catalog.cpp
+++ b/engines/m4/adv_db_r/db_catalog.cpp
@@ -162,7 +162,7 @@ static void sort_catalog() {
++index;
if (index > _G(catalog)._size)
- error_show(FL);
+ error_show(FL, "sort_catalog");
}
qsort(_G(catalog)._catalog, _G(catalog)._size, sizeof(char *), compare_catalog_entries_for_sort);
@@ -220,7 +220,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);
+ error_show(FL, "db_get_catalog_entry");
}
s[i] = '\0';
diff --git a/engines/m4/adv_r/adv_been.cpp b/engines/m4/adv_r/adv_been.cpp
index 116e3373058..1c0acc274e4 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);
+ error_show(FL, "player_enters_scene()");
return false;
}
diff --git a/engines/m4/adv_r/adv_control.cpp b/engines/m4/adv_r/adv_control.cpp
index 738247fbcb1..ae5a1ea0d6e 100644
--- a/engines/m4/adv_r/adv_control.cpp
+++ b/engines/m4/adv_r/adv_control.cpp
@@ -149,7 +149,7 @@ void update_mouse_pos_dialog() {
if (_G(my_walker) != nullptr) {
if (!_G(my_walker)->myAnim8)
- error_show(FL);
+ error_show(FL, "you sunk the walker!");
player_get_info();
}
diff --git a/engines/m4/adv_r/adv_file.cpp b/engines/m4/adv_r/adv_file.cpp
index 0682e5f0bfc..1462bdc320a 100644
--- a/engines/m4/adv_r/adv_file.cpp
+++ b/engines/m4/adv_r/adv_file.cpp
@@ -269,9 +269,6 @@ bool load_background(SysFile *pic_file, GrBuff **loadBuffer, RGB8 *palette) {
*loadBuffer = new GrBuff(file_x, file_y);
- if (!*loadBuffer)
- error_show(FL);
-
Buffer *theBuff = (**loadBuffer).get_buffer();
for (int i = 0; i < num_y_tiles; i++) {
diff --git a/engines/m4/adv_r/adv_hotspot.cpp b/engines/m4/adv_r/adv_hotspot.cpp
index a57b47b1c83..6c6984df4be 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);
+ error_show(FL, "Cannot nest hotspots_hide_all()");
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);
+ error_show(FL, "No saved hotspots to restore");
}
if (_G(currentSceneDef).hotspots)
diff --git a/engines/m4/adv_r/conv.cpp b/engines/m4/adv_r/conv.cpp
index 6cc70ac4e6e..692d8a2d2e3 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);
+ error_show(FL, "no gameDrawBuff");
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/burger/gui/interface.cpp b/engines/m4/burger/gui/interface.cpp
index 9222e7c82fd..c33c270f04c 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);
+ error_show(FL, "interface stuff");
mouse_set_sprite(arrow);
@@ -52,9 +52,9 @@ bool Interface::init(int arrow, int wait, int look, int grab, int use) {
_G(gameInterfaceBuff) = new GrBuff(_x2 - _x1, _y2 - _y1);
setup();
return true;
- } else {
- return false;
}
+
+ return false;
}
Interface::~Interface() {
diff --git a/engines/m4/burger/gui/inventory.cpp b/engines/m4/burger/gui/inventory.cpp
index 09411fbf2f8..6d4c98fa5e0 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);
+ error_show(FL, "requested cell configuration doesn't fit");
}
_highlight = -1;
@@ -70,7 +70,7 @@ bool Inventory::add(const Common::String &name, const Common::String &verb, int3
}
if (_num_cells >= INVENTORY_CELLS_COUNT) {
- error_show(FL);
+ error_show(FL, "too many cells");
}
// Shift existing items up by one
diff --git a/engines/m4/core/errors.cpp b/engines/m4/core/errors.cpp
index 1fae0c23391..94282340462 100644
--- a/engines/m4/core/errors.cpp
+++ b/engines/m4/core/errors.cpp
@@ -30,14 +30,10 @@ void error_show(const char *filename, uint32 line, const char *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) {
- error_show(filename, line, "No extra description");
-}
-
} // namespace M4
diff --git a/engines/m4/core/errors.h b/engines/m4/core/errors.h
index bb8d2701c52..76dea697bd0 100644
--- a/engines/m4/core/errors.h
+++ b/engines/m4/core/errors.h
@@ -29,7 +29,6 @@ namespace M4 {
#define FL __FILE__,__LINE__
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;
} // namespace M4
diff --git a/engines/m4/core/rooms.cpp b/engines/m4/core/rooms.cpp
index 04537b62706..818ee704864 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); // this should never ever happen
+ error_show(FL, "kernel_load_room failed"); // this should never ever happen
get_ipl();
@@ -270,7 +270,7 @@ void Sections::game_control_cycle() {
int32 status;
ScreenContext *screen = vmng_screen_find(_G(gameDrawBuff), &status);
if (!screen)
- error_show(FL);
+ error_show(FL, "no gameDrawBuff");
if (_G(player).ready_to_walk) {
if (_G(player).need_to_walk) {
@@ -389,7 +389,7 @@ void Sections::pal_game_task() {
_G(game_bgBuff)->release();
if (!game_buff_ptr)
- error_show(FL);
+ error_show(FL, "no gameDrawBuff");
if _G(please_hyperwalk) {
_G(please_hyperwalk) = false;
diff --git a/engines/m4/fileio/fstream.cpp b/engines/m4/fileio/fstream.cpp
index 161c9a35b3a..4ea3cda93e2 100644
--- a/engines/m4/fileio/fstream.cpp
+++ b/engines/m4/fileio/fstream.cpp
@@ -72,7 +72,7 @@ strmRequest *f_stream_Open(SysFile *srcFile, int32 fileOffset, int32 strmMinBuff
// Parameter verification
if (!srcFile) {
- error_show(FL);
+ error_show(FL,"f_stream_Open() failed - invalid FILE* given");
}
if (strmMinBuffSize < 0) {
diff --git a/engines/m4/graphics/gr_buff.cpp b/engines/m4/graphics/gr_buff.cpp
index 162a48c9e3a..2fb9715203d 100644
--- a/engines/m4/graphics/gr_buff.cpp
+++ b/engines/m4/graphics/gr_buff.cpp
@@ -105,7 +105,7 @@ int32 gr_buffer_free(Buffer *buf) {
return true;
}
- error_show(FL);
+ error_show(FL, "buffer_free");
}
byte *gr_buffer_pointer(Buffer *buf, int32 x, int32 y) {
@@ -124,7 +124,7 @@ const byte *gr_buffer_pointer(const Buffer *buf, int32 x, int32 y) {
return (byte *)(buf->data + x + (y * buf->stride));
}
-int32 gr_buffer_init(Buffer *buf, const char *name, int32 w, int32 h) {
+void gr_buffer_init(Buffer *buf, const char *name, int32 w, int32 h) {
if (buf->data)
error_show(FL, "buffer_init %s", name);
@@ -132,8 +132,6 @@ int32 gr_buffer_init(Buffer *buf, const char *name, int32 w, int32 h) {
buf->h = h;
buf->stride = w;
buf->data = (uint8 *)mem_alloc(buf->stride * h, name);
-
- return (true);
}
bool gr_buffer_rect_copy_2(const Buffer *from, Buffer *to, int32 sx, int32 sy,
diff --git a/engines/m4/graphics/gr_buff.h b/engines/m4/graphics/gr_buff.h
index 9deceadd5ac..31a124aaada 100644
--- a/engines/m4/graphics/gr_buff.h
+++ b/engines/m4/graphics/gr_buff.h
@@ -60,7 +60,7 @@ public:
int32 gr_buffer_free(Buffer *buf);
byte *gr_buffer_pointer(Buffer *buf, int32 x, int32 y);
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);
+void gr_buffer_init(Buffer *buf, const char *name, int32 w, int32 h);
/**
* Copies a "rectangular" buffer area from "from" to "unto". Size
diff --git a/engines/m4/graphics/gr_series.cpp b/engines/m4/graphics/gr_series.cpp
index 01a57cf5a36..76fe463bf49 100644
--- a/engines/m4/graphics/gr_series.cpp
+++ b/engines/m4/graphics/gr_series.cpp
@@ -106,11 +106,12 @@ bool series_draw_sprite(int32 spriteHash, int32 index, Buffer *destBuff, int32 x
M4Rect clipRect, updateRect;
if (!destBuff) {
- error_show(FL);
+ error_show(FL, "series_draw_sprite");
}
M4sprite *srcSpritePtr = &srcSprite;
- if ((srcSpritePtr = GetWSAssetSprite(nullptr, (uint32)spriteHash, (uint32)index, srcSpritePtr, nullptr)) == nullptr)
+ srcSpritePtr = GetWSAssetSprite(nullptr, (uint32)spriteHash, (uint32)index, srcSpritePtr, nullptr);
+ if (srcSpritePtr == nullptr)
error_show(FL, "hash: %d, index: %d", spriteHash, index);
HLock(srcSpritePtr->sourceHandle);
@@ -196,7 +197,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);
+ error_show(FL, "CHECK_SERIES");
return;
}
diff --git a/engines/m4/graphics/rend.cpp b/engines/m4/graphics/rend.cpp
index 2bb17c81526..23d5f5083ee 100644
--- a/engines/m4/graphics/rend.cpp
+++ b/engines/m4/graphics/rend.cpp
@@ -221,7 +221,7 @@ static RenderResult r_1() {
}
if (myWidth > 666) {
- error_show(FL);
+ error_show(FL, "myWidth too large");
}
}
}
diff --git a/engines/m4/gui/gui_cheapo.cpp b/engines/m4/gui/gui_cheapo.cpp
index e10dd04a971..7afe69c9b00 100644
--- a/engines/m4/gui/gui_cheapo.cpp
+++ b/engines/m4/gui/gui_cheapo.cpp
@@ -40,7 +40,7 @@ RectClass::RectClass() {
RectClass::RectClass(const RectClass *r) {
if (!r) {
- error_show(FL);
+ error_show(FL, "missing rect");
}
_x1 = r->_x1;
@@ -58,7 +58,7 @@ RectClass::~RectClass() {
void RectClass::copyInto(RectClass *r) const {
if (!r) {
- error_show(FL);
+ error_show(FL, "missing rect");
}
r->_x1 = _x1;
@@ -76,7 +76,7 @@ void RectClass::set(int16 x1, int16 y1, int16 x2, int16 y2) {
void RectClass::set(const RectClass *r) {
if (!r) {
- error_show(FL);
+ error_show(FL, "missing rect");
}
_x1 = r->_x1;
@@ -475,7 +475,7 @@ void InterfaceBox::set_selected(bool s) {
void InterfaceBox::add(ButtonClass *b) {
if (!b || _index >= MAX_BUTTONS) {
- error_show(FL);
+ error_show(FL, "Bad button or index");
}
// Convert to global coordinates
diff --git a/engines/m4/mem/mem.cpp b/engines/m4/mem/mem.cpp
index 22606f1d4af..666461a571e 100644
--- a/engines/m4/mem/mem.cpp
+++ b/engines/m4/mem/mem.cpp
@@ -73,7 +73,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);
+ error_show(FL, "block not in stash");
b_ptr += index * (_G(sizeMem)[memType] + sizeof(uintptr));
*(uintptr *)b_ptr = 0;
diff --git a/engines/m4/platform/tile/tile_read.cpp b/engines/m4/platform/tile/tile_read.cpp
index 2c48cc3cf09..da10ab0ee09 100644
--- a/engines/m4/platform/tile/tile_read.cpp
+++ b/engines/m4/platform/tile/tile_read.cpp
@@ -71,7 +71,7 @@ Buffer *tt_read(SysFile *ifp, int index, int32 tile_x, int32 tile_y) {
// Check parameters
if (index < 0)
- error_show(FL);
+ error_show(FL, "Negative index");
const int32 tile_size = tile_x * tile_y;
@@ -86,12 +86,6 @@ Buffer *tt_read(SysFile *ifp, int index, int32 tile_x, int32 tile_y) {
}
gr_buffer_init(out, "back tile", tile_x, tile_y);
- if (out->data == nullptr) {
- out->w = 0;
- out->stride = 0;
- out->h = 0;
- error_show(FL, "fail to allocate mem for .TT buffer");
- }
out->w = out->stride = tile_x;
out->h = tile_y;
diff --git a/engines/m4/riddle/gui/interface.cpp b/engines/m4/riddle/gui/interface.cpp
index 9387b39c62c..50ae54034fb 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);
+ error_show(FL, "interface stuff");
mouse_set_sprite(arrow);
diff --git a/engines/m4/riddle/gui/inventory.cpp b/engines/m4/riddle/gui/inventory.cpp
index d831702b43f..f0e2ecc2fb1 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);
+ error_show(FL, "Inventory()");
}
_highlight = -1;
@@ -83,8 +83,7 @@ bool Inventory::add(const Common::String &name, const Common::String &verb, int3
}
if (_num_cells >= INVENTORY_CELLS_COUNT) {
- error_show(FL);
- return false;
+ error_show(FL, "Inventory::add()");
}
auto &item = _items[_num_cells++];
diff --git a/engines/m4/riddle/walker.cpp b/engines/m4/riddle/walker.cpp
index 4b814b2310c..3a2d837afa2 100644
--- a/engines/m4/riddle/walker.cpp
+++ b/engines/m4/riddle/walker.cpp
@@ -111,7 +111,7 @@ void Walker::walk_load_walker_and_shadow_series() {
break;
default:
- error_show(FL);
+ error_show(FL, "walk_load_walker_and_shadow_series");
}
}
diff --git a/engines/m4/vars.cpp b/engines/m4/vars.cpp
index 94e5af4f055..856d65c5080 100644
--- a/engines/m4/vars.cpp
+++ b/engines/m4/vars.cpp
@@ -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);
+ error_show(FL, "main init");
}
term_message("Firing up GUI");
@@ -142,7 +142,7 @@ void Vars::game_systems_initialize(byte flags) {
}
if (!woodscript_init())
- error_show(FL);
+ error_show(FL, "main init");
gr_pal_clear(_master_palette);
@@ -151,7 +151,7 @@ void Vars::game_systems_initialize(byte flags) {
InitRails();
if (!f_stream_Init())
- error_show(FL);
+ error_show(FL, "main init");
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);
+ error_show(FL, "gui init");
if (!vmng_init())
- error_show(FL);
+ error_show(FL, "gui init");
if (!gui_mouse_init())
- error_show(FL);
+ error_show(FL, "gui init");
if (!gui_dialog_init())
- error_show(FL);
+ error_show(FL, "gui init");
#ifdef TODO
if (!InitItems())
- error_show(FL);
+ error_show(FL, "gui init");
#endif
if (!gui_buffer_system_init())
- error_show(FL);
+ error_show(FL, "gui init");
}
bool Vars::woodscript_init() {
diff --git a/engines/m4/wscript/ws_cruncher.cpp b/engines/m4/wscript/ws_cruncher.cpp
index e3389fb442a..2e6299a0e5a 100644
--- a/engines/m4/wscript/ws_cruncher.cpp
+++ b/engines/m4/wscript/ws_cruncher.cpp
@@ -127,12 +127,10 @@ int32 *ws_GetDataFormats() {
bool ws_InitCruncher(void) {
// Make sure the cruncher has not been initialized
if (_GWS(cruncherInitialized))
- error_show(FL);
+ error_show(FL,"cruncher not initialized");
// 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);
_GWS(myCruncher) = (cruncher *)mem_alloc(sizeof(cruncher), "cruncher");
@@ -245,7 +243,7 @@ bool ws_ChangeAnim8Program(machine *m, int32 newSequHash) {
// Parameter verification
if (!m || !m->myAnim8) {
- error_show(FL);
+ error_show(FL, "myAnim8 not set");
}
Anim8 *myAnim8 = m->myAnim8;
@@ -278,7 +276,7 @@ void ws_RemoveAnim8FromCruncher(Anim8 *myAnim8) {
VERIFY_INTIALIZED("ws_RemoveAnim8FromCruncher()");
if (!myAnim8)
- error_show(FL);
+ error_show(FL, "myAnim8 not set");
// In case we are crunching the current list of EOS requests, remove any for this machine
EOSreq *tempEOSreq = _GWS(EOSreqList);
@@ -348,7 +346,7 @@ bool ws_PauseAnim8(Anim8 *myAnim8) {
VERIFY_INTIALIZED("ws_PauseAnim8()");
if (!myAnim8)
- error_show(FL);
+ error_show(FL, "myAnim8 not set");
myAnim8->active = false;
HideCCB(myAnim8->myCCB);
@@ -361,7 +359,7 @@ bool ws_ResumeAnim8(Anim8 *myAnim8) {
VERIFY_INTIALIZED("ws_PauseAnim8()");
if (!myAnim8)
- error_show(FL);
+ error_show(FL, "myAnim8 not set");
myAnim8->active = true;
if (myAnim8->myCCB) {
diff --git a/engines/m4/wscript/ws_load.cpp b/engines/m4/wscript/ws_load.cpp
index aaf7d96645b..174e866ba70 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);
+ error_show(FL, "WSLoader not initialized");
}
// Allocate space for the tables used by the loader and the resource io MACHine tables
@@ -264,7 +264,7 @@ bool LoadWSAssets(const char *wsAssetName, RGB8 *myPalette) {
// Check that the loader has been initialized
if (!_GWS(wsloaderInitialized)) {
- error_show(FL);
+ error_show(FL, "Asset Name: %s", wsAssetName);
}
// Use the resource io manager to read in the entire block
More information about the Scummvm-git-logs
mailing list