[Scummvm-git-logs] scummvm master -> 8bce4e6a9b380b199c1be6805adb9208a0f01826

Strangerke noreply at scummvm.org
Sat Feb 14 09:50:39 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:
f98d111a2c M4: Remove some void parameters
8bce4e6a9b M4: Remove more deadcode in gui + various small cleanups


Commit: f98d111a2c1caf3dc509b1577dbf6abd3a21745d
    https://github.com/scummvm/scummvm/commit/f98d111a2c1caf3dc509b1577dbf6abd3a21745d
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-02-14T10:50:17+01:00

Commit Message:
M4: Remove some void parameters

Changed paths:
    engines/m4/adv_r/adv_been.h
    engines/m4/adv_r/adv_rails.cpp
    engines/m4/adv_r/conv_io.cpp
    engines/m4/burger/gui/game_menu.cpp
    engines/m4/fileio/fstream.cpp
    engines/m4/graphics/krn_pal.h
    engines/m4/wscript/ws_cruncher.cpp
    engines/m4/wscript/ws_load.cpp
    engines/m4/wscript/ws_machine.cpp
    engines/m4/wscript/ws_timer.cpp
    engines/m4/wscript/ws_timer.h


diff --git a/engines/m4/adv_r/adv_been.h b/engines/m4/adv_r/adv_been.h
index c619eb82b00..96b52acbf54 100644
--- a/engines/m4/adv_r/adv_been.h
+++ b/engines/m4/adv_r/adv_been.h
@@ -50,7 +50,7 @@ void player_been_shutdown();
 /**
  * Resets the player_been system
  */
-void player_reset_been(void);
+void player_reset_been();
 
 /**
  * Saves/loads player_been information
diff --git a/engines/m4/adv_r/adv_rails.cpp b/engines/m4/adv_r/adv_rails.cpp
index f8412f30149..1f91cac847f 100644
--- a/engines/m4/adv_r/adv_rails.cpp
+++ b/engines/m4/adv_r/adv_rails.cpp
@@ -56,7 +56,7 @@ void InitRails() {
 }
 
 
-void rail_system_shutdown(void) {
+void rail_system_shutdown() {
 	if (_G(rails).stackBottom) {
 		mem_free(_G(rails).stackBottom);
 		_G(rails).stackBottom = nullptr;
@@ -75,7 +75,7 @@ void rail_system_shutdown(void) {
 }
 
 
-void ClearRails(void) {
+void ClearRails() {
 	int32 i;
 
 	if (_G(rails).myNodes) {
diff --git a/engines/m4/adv_r/conv_io.cpp b/engines/m4/adv_r/conv_io.cpp
index 5440fa0152e..10783e04444 100644
--- a/engines/m4/adv_r/conv_io.cpp
+++ b/engines/m4/adv_r/conv_io.cpp
@@ -83,7 +83,7 @@ void cdd_init() {
 	_G(cdd).mesg_snd_file = nullptr;
 }
 
-Conv *conv_get_handle(void) {
+Conv *conv_get_handle() {
 	return _GC(globConv);
 }
 
@@ -658,7 +658,7 @@ void conv_set_box_xy(int32 x, int32 y) {
 	_GC(glob_y) = y;
 }
 
-static void conv_set_disp_default(void) {
+static void conv_set_disp_default() {
 	_GC(conv_font_spacing_h) = _GC(conv_default_h);
 	_GC(conv_font_spacing_v) = _GC(conv_default_v);
 	_GC(conv_normal_colour) = _GC(conv_default_normal_colour);
diff --git a/engines/m4/burger/gui/game_menu.cpp b/engines/m4/burger/gui/game_menu.cpp
index da36ab32a57..c5a75eba3a7 100644
--- a/engines/m4/burger/gui/game_menu.cpp
+++ b/engines/m4/burger/gui/game_menu.cpp
@@ -296,7 +296,7 @@ void OptionsMenu::cb_Options_Digestability(menuItemHSlider *myItem, guiMenu *myM
 	guiMenu::itemRefresh(nullptr, OM_TAG_DONE, myMenu);
 }
 
-void OptionsMenu::destroyMenu(void) {
+void OptionsMenu::destroyMenu() {
 	if (!_GM(opMenu))
 		return;
 
diff --git a/engines/m4/fileio/fstream.cpp b/engines/m4/fileio/fstream.cpp
index ece5fb33762..536fca1f5f3 100644
--- a/engines/m4/fileio/fstream.cpp
+++ b/engines/m4/fileio/fstream.cpp
@@ -55,7 +55,7 @@ bool f_stream_Init() {
 	return true;
 }
 
-void f_stream_Shutdown(void) {
+void f_stream_Shutdown() {
 	// Loop through the list, closing all stream requests, which also deallocs the request
 	strmRequest *myStream = _G(firstStream);
 	while (myStream) {
diff --git a/engines/m4/graphics/krn_pal.h b/engines/m4/graphics/krn_pal.h
index 3f262105b48..9253cb8d080 100644
--- a/engines/m4/graphics/krn_pal.h
+++ b/engines/m4/graphics/krn_pal.h
@@ -126,8 +126,8 @@ void kernel_unexamine_inventory_object(RGB8 *pal, int steps, int delay);
 
 void remap_buffer_with_luminance_map(Buffer *src, int32 x1, int32 y1, int32 x2, int32 y2);
 void krn_SetGreyVideoMode(int32 grey_x1, int32 grey_y1, int32 grey_x2, int32 grey_y2, int32 color_x1, int32 color_y1, int32 color_x2, int32 color_y2);
-void krn_UnsetGreyVideoMode(void);
-bool krn_GetGreyMode(void);
+void krn_UnsetGreyVideoMode();
+bool krn_GetGreyMode();
 void krn_UpdateGreyArea(Buffer *greyOutThisBuffer, int32 scrnX, int32 scrnY,
 	int32 greyX1, int32 greyY1, int32 greyX2, int32 greyY2);
 void krn_ChangeBufferLuminance(Buffer *target, int32 percent);
diff --git a/engines/m4/wscript/ws_cruncher.cpp b/engines/m4/wscript/ws_cruncher.cpp
index c8a37762e2d..0bd7ba561e7 100644
--- a/engines/m4/wscript/ws_cruncher.cpp
+++ b/engines/m4/wscript/ws_cruncher.cpp
@@ -124,7 +124,7 @@ int32 *ws_GetDataFormats() {
 	return &dataFormats[0];
 }
 
-bool ws_InitCruncher(void) {
+bool ws_InitCruncher() {
 	// Make sure the cruncher has not been initialized
 	if (_GWS(cruncherInitialized))
 		error_show(FL,"cruncher not initialized");
@@ -1515,7 +1515,7 @@ void ws_CrunchAnim8s(int16 *depth_table) {
 	_GWS(crunchNext) = nullptr;
 }
 
-void ws_CrunchEOSreqs(void) {
+void ws_CrunchEOSreqs() {
 	// Make sure the cruncher has been initialized
 	VERIFY_INTIALIZED("ws_CrunchEOSreqs()");
 
diff --git a/engines/m4/wscript/ws_load.cpp b/engines/m4/wscript/ws_load.cpp
index 174e866ba70..0d9bf2e73bd 100644
--- a/engines/m4/wscript/ws_load.cpp
+++ b/engines/m4/wscript/ws_load.cpp
@@ -221,7 +221,7 @@ bool ClearWSAssets(uint32 assetType, int32 minHash, int32 maxHash) {
 	return true;
 }
 
-void ShutdownWSAssets(void) {
+void ShutdownWSAssets() {
 	if (!_GWS(wsloaderInitialized))
 		return;
 
diff --git a/engines/m4/wscript/ws_machine.cpp b/engines/m4/wscript/ws_machine.cpp
index 1cdfe81869c..d68b823c55c 100644
--- a/engines/m4/wscript/ws_machine.cpp
+++ b/engines/m4/wscript/ws_machine.cpp
@@ -625,11 +625,11 @@ void (*condOpTable[])(machine *m, int32 *pcOffset) = {
 	&op_SWITCH_GT				//9
 };
 
-void pauseEngines(void) {
+void pauseEngines() {
 	_GWS(enginesPaused) = true;
 }
 
-void unpauseEngines(void) {
+void unpauseEngines() {
 	_GWS(enginesPaused) = false;
 }
 
diff --git a/engines/m4/wscript/ws_timer.cpp b/engines/m4/wscript/ws_timer.cpp
index 1939703e25c..9a554c88a35 100644
--- a/engines/m4/wscript/ws_timer.cpp
+++ b/engines/m4/wscript/ws_timer.cpp
@@ -26,7 +26,7 @@ namespace M4 {
 
 static void dispose_timeRequest(onTimeReq *timeReq);
 
-bool ws_InitWSTimer(void) {
+bool ws_InitWSTimer() {
 	_GWS(firstTimeReq) = nullptr;
 	return true;
 }
diff --git a/engines/m4/wscript/ws_timer.h b/engines/m4/wscript/ws_timer.h
index fde2cb30719..430af54453c 100644
--- a/engines/m4/wscript/ws_timer.h
+++ b/engines/m4/wscript/ws_timer.h
@@ -31,8 +31,8 @@ struct WSTimer_Globals {
 	onTimeReq *_firstTimeReq = nullptr;
 };
 
-bool ws_InitWSTimer(void);
-void ws_KillTime(void);
+bool ws_InitWSTimer();
+void ws_KillTime();
 void ws_MakeOnTimeReq(int32 wakeUpTime, machine *myXM, int32 pcOffset, int32 pcCount);
 void ws_CancelOnTimeReqs(machine *m);
 void ws_CheckTimeReqs(int32 curTime);


Commit: 8bce4e6a9b380b199c1be6805adb9208a0f01826
    https://github.com/scummvm/scummvm/commit/8bce4e6a9b380b199c1be6805adb9208a0f01826
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-02-14T10:50:18+01:00

Commit Message:
M4: Remove more deadcode in gui + various small cleanups

Changed paths:
    engines/m4/gui/gui_dialog.cpp
    engines/m4/gui/gui_event.h
    engines/m4/gui/gui_item.cpp
    engines/m4/gui/gui_item.h
    engines/m4/gui/gui_menu_items.cpp
    engines/m4/gui/gui_menu_items.h
    engines/m4/gui/gui_sys.cpp
    engines/m4/gui/gui_sys.h
    engines/m4/gui/gui_vmng.h
    engines/m4/gui/gui_vmng_core.cpp
    engines/m4/gui/gui_vmng_rectangles.cpp
    engines/m4/gui/gui_vmng_rectangles.h
    engines/m4/gui/gui_vmng_screen.cpp
    engines/m4/gui/gui_vmng_screen.h
    engines/m4/gui/hotkeys.cpp
    engines/m4/gui/hotkeys.h


diff --git a/engines/m4/gui/gui_dialog.cpp b/engines/m4/gui/gui_dialog.cpp
index 226053a1ca6..3bd9a34a724 100644
--- a/engines/m4/gui/gui_dialog.cpp
+++ b/engines/m4/gui/gui_dialog.cpp
@@ -321,7 +321,7 @@ void Dialog_Refresh(Dialog *d) {
 	}
 }
 
-void Dialog_Refresh_All(void) {
+void Dialog_Refresh_All() {
 	ScreenContext *myScreen = _G(frontScreen);
 
 	while (myScreen) {
@@ -522,11 +522,7 @@ static void Dialog_GetPrevPageList(Dialog *d) {
 	}
 }
 
-static void SystemErrCallback(void *, void *) {
-	_GD(okButton) = true;
-}
-
-void Dialog_KeyMouseCollision(void) {
+void Dialog_KeyMouseCollision() {
 	_GD(movingScreen) = false;
 	_GD(clickItem) = nullptr;
 	_GD(doubleClickItem) = nullptr;
diff --git a/engines/m4/gui/gui_event.h b/engines/m4/gui/gui_event.h
index 524bbe9b362..86bde040508 100644
--- a/engines/m4/gui/gui_event.h
+++ b/engines/m4/gui/gui_event.h
@@ -23,8 +23,6 @@
 #ifndef M4_GUI_GUI_EVENT_H
 #define M4_GUI_GUI_EVENT_H
 
-#include "m4/m4_types.h"
-
 namespace M4 {
 
 enum {
diff --git a/engines/m4/gui/gui_item.cpp b/engines/m4/gui/gui_item.cpp
index 5b2e428192d..d90ebf6205e 100644
--- a/engines/m4/gui/gui_item.cpp
+++ b/engines/m4/gui/gui_item.cpp
@@ -252,18 +252,6 @@ bool drawGUIelement(ButtonDrawRec *bdr, M4Rect *myRect) {
 	return true;
 }
 
-bool InitItems() {
-	_G(items).origPrompt = nullptr;
-	_G(items).undoPrompt = nullptr;
-	_G(items).currTextField = nullptr;
-	_G(items).clipBoard[0] = '\0';
-	_G(items).clipBoard[99] = '\0';
-	if (!sizeofGUIelement_border(BUTTON, &_G(items).buttonWidth, &_G(items).buttonHeight))
-		return false;
-
-	return true;
-}
-
 Item *Item_create(Item *parent, enum ItemType type, int32 tag, M4CALLBACK cb) {
 	Item *temp = (Item *)mem_alloc(sizeof(Item), STR_ITEM);
 
@@ -301,23 +289,6 @@ void Item_destroy(Item *myItem) {
 	mem_free((void *)myItem);
 }
 
-void Item_empty_list(Item *myItem) {
-	ListItem *myList = myItem->myList;
-	ListItem *tempListItem = myList;
-	while (tempListItem) {
-		myList = myList->next;
-		mem_free((void *)tempListItem);
-		tempListItem = myList;
-	}
-	myItem->myList = nullptr;
-	myItem->currItem = nullptr;
-	myItem->viewTop = nullptr;
-	myItem->viewBottom = nullptr;
-	myItem->myListCount = 0;
-	myItem->viewIndex = 0;
-	myItem->thumbY = minThumbY;
-}
-
 static int32 item_string_width(char *myStr, int32 spacing) {
 	char *tempPtr, highlightChar[2];
 
@@ -355,7 +326,9 @@ static int32 item_string_width(char *myStr, int32 spacing) {
 static int32 item_string_write(Buffer *target, char *myStr, int32 x, int32 y, int32 w, int32 spacing, int32 color, int32 highlight) {
 	char tempStr[2];
 
-	if (!target) return false;
+	if (!target)
+		return false;
+
 	char *tempPtr = strchr(myStr, '^');
 	if (tempPtr == nullptr) {
 		tempPtr = strchr(myStr, '~');
@@ -601,207 +574,6 @@ static void SetViewIndex(Item *myItem) {
 	Item_SetViewBottom(myItem);
 }
 
-bool ListItemExists(Item *myItem, char *prompt, int32 listTag) {
-	if (!myItem)
-		return false;
-
-	ListItem *myListItems = myItem->myList;
-	if (prompt) {
-		while (myListItems && strcmp(myListItems->prompt, prompt)) {
-			myListItems = myListItems->next;
-		}
-	} else {
-		while (myListItems && (myListItems->tag != listTag)) {
-			myListItems = myListItems->next;
-		}
-	}
-	if (myListItems)
-		return true;
-
-	return false;
-}
-
-bool ListItemAdd(Item *myItem, char *prompt, int32 listTag, int32 addMode, ListItem *changedItem) {
-	ListItem *newListItem;
-
-	if (!myItem)
-		return false;
-
-	if (changedItem)
-		newListItem = changedItem;
-	else {
-		newListItem = (ListItem *)mem_alloc(sizeof(ListItem), STR_LIST);
-
-		Common::strlcpy(newListItem->prompt, prompt, 80);
-		newListItem->tag = listTag;
-	}
-	//Add it into the list in the correct place...
-	ListItem *myList = myItem->myList;
-	if (!myList) {
-		newListItem->prev = nullptr;
-		newListItem->next = nullptr;
-		myItem->myList = newListItem;
-		myItem->currItem = newListItem;
-		myItem->viewTop = newListItem;
-		myItem->viewIndex = 0;
-		myItem->thumbY = minThumbY;
-	} else {
-		switch (addMode) {
-		case LIST_SEQUN:
-			while (myList->next) myList = myList->next;
-			myList->next = newListItem;
-			newListItem->prev = myList;
-			newListItem->next = nullptr;
-			break;
-		case LIST_ALPH:
-			if (strcmp(newListItem->prompt, myList->prompt) <= 0) {		//add to front
-				newListItem->prev = nullptr;
-				newListItem->next = myList;
-				myList->prev = newListItem;
-				myItem->myList = newListItem;
-				myItem->currItem = newListItem;
-				myItem->viewTop = newListItem;
-			} else {
-				while (myList->next && strcmp(newListItem->prompt, myList->next->prompt) > 0) {
-					myList = myList->next;
-				}
-				if (myList->next) {
-					newListItem->next = myList->next;
-					newListItem->prev = myList;
-					myList->next->prev = newListItem;
-					myList->next = newListItem;
-				} else {
-					newListItem->next = nullptr;
-					newListItem->prev = myList;
-					myList->next = newListItem;
-				}
-			}
-			break;
-		case LIST_BY_TAG:
-		default:
-			if (newListItem->tag <= myList->tag) {		//add to front
-				newListItem->prev = nullptr;
-				newListItem->next = myList;
-				myList->prev = newListItem;
-				myItem->myList = newListItem;
-				myItem->currItem = newListItem;
-				myItem->viewTop = newListItem;
-			} else {
-				while (myList->next && (newListItem->tag > myList->next->tag)) {
-					myList = myList->next;
-				}
-				if (myList->next) {
-					newListItem->next = myList->next;
-					newListItem->prev = myList;
-					myList->next->prev = newListItem;
-					myList->next = newListItem;
-				} else {
-					newListItem->next = nullptr;
-					newListItem->prev = myList;
-					myList->next = newListItem;
-				}
-			}
-			break;
-		}
-		if (changedItem) {
-			myItem->currItem = myList;
-			myItem->viewTop = myList;
-		}
-	}
-	myItem->myListCount++;
-	if (!Item_SetViewBottom(myItem))
-		ViewCurrListItem(myItem);
-	else
-		CalculateViewIndex(myItem);
-
-	return true;
-}
-
-bool ListItemDelete(Item *myItem, ListItem *myListItem, int32 listTag) {
-	ListItem *myList;
-
-	if (!myItem)
-		return false;
-
-	if (!myListItem) {
-		myList = myItem->myList;
-		while (myList && (myList->tag != listTag))
-			myList = myList->next;
-	} else
-		myList = myListItem;
-
-	if (!myList)
-		return false;
-
-	if (myList == myItem->myList) {	//first in the list...
-		myItem->myList = myItem->myList->next;
-		if (myItem->myList)
-			myItem->myList->prev = nullptr;
-	} else {
-		myList->prev->next = myList->next;
-		if (myList->next)
-			myList->next->prev = myList->prev;
-	}
-	if (myList == myItem->currItem) {
-		if (myList->next)
-			myItem->currItem = myList->next;
-		else
-			myItem->currItem = myList->prev;
-	}
-	if (myList == myItem->viewTop) {
-		if (myItem->viewTop->prev)
-			myItem->viewTop = myItem->viewTop->prev;
-		else
-			myItem->viewTop = myItem->viewTop->next;
-	}
-	myItem->myListCount--;
-	Item_SetViewBottom(myItem);
-	if (!myItem->viewBottom)
-		ViewCurrListItem(myItem);
-	else
-		CalculateViewIndex(myItem);
-
-	mem_free((void *)myList);
-	return true;
-}
-
-bool ListItemChange(Item *myItem, ListItem *myListItem, int32 listTag,
-	char *newPrompt, int32 newTag, int32 changeMode) {
-	ListItem *myList;
-
-	if (!myItem)
-		return false;
-
-	if (!myListItem) {
-		myList = myItem->myList;
-		while (myList && (myList->tag != listTag))
-			myList = myList->next;
-	} else
-		myList = myListItem;
-
-	if (!myList)
-		return false;
-	if (!strcmp(myList->prompt, newPrompt) && myList->tag == newTag)
-		return false;
-
-	Common::strcpy_s(myList->prompt, newPrompt);
-	const int32 oldTag = myList->tag;
-	myList->tag = newTag;
-	if (((changeMode == LIST_BY_TAG) && (oldTag != newTag)) || (changeMode == LIST_ALPH)) {
-		if (myList == myItem->myList) {	//first in the list...
-			myItem->myList = myItem->myList->next;
-			if (myItem->myList)
-				myItem->myList->prev = nullptr;
-		} else {
-			myList->prev->next = myList->next;
-			if (myList->next)
-				myList->next->prev = myList->prev;
-		}
-		ListItemAdd(myItem, nullptr, 0, changeMode, myList);
-	}
-	return true;
-}
-
 bool GetNextListItem(Item *myItem) {
 	if (myItem->currItem) {
 		ListItem *nextItem = myItem->currItem->next;
@@ -1215,7 +987,7 @@ static void Item_Clear_origPrompt() {
 	}
 }
 
-Item *Item_RestoreTextField(void) {
+Item *Item_RestoreTextField() {
 	if (!_G(items).origPrompt)
 		return nullptr;
 
@@ -1231,7 +1003,7 @@ Item *Item_RestoreTextField(void) {
 	return _G(items).currTextField;
 }
 
-Item *Item_CheckTextField(void) {
+Item *Item_CheckTextField() {
 	Item *myItem = nullptr;
 	if (_G(items).origPrompt) {
 		if (strcmp(_G(items).currTextField->prompt, _G(items).origPrompt))
@@ -1257,7 +1029,7 @@ static void Item_SaveTextFieldChange(Item *myItem, bool majorChange) {
 	_G(items).undoAux2 = _G(items).undoPrompt + (myItem->aux2 - myItem->prompt);
 }
 
-static bool Item_UndoTextFieldChange(void) {
+static bool Item_UndoTextFieldChange() {
 	if (_G(items).undoPrompt) {
 		char *tempBuf = mem_strdup(_G(items).currTextField->prompt);
 		char *tempAux = tempBuf + (_G(items).currTextField->aux - _G(items).currTextField->prompt);
diff --git a/engines/m4/gui/gui_item.h b/engines/m4/gui/gui_item.h
index 43ae1c76107..f3db1ceaeb4 100644
--- a/engines/m4/gui/gui_item.h
+++ b/engines/m4/gui/gui_item.h
@@ -115,19 +115,12 @@ struct Item_Globals {
 	char clipBoard[100] = { 0 };
 };
 
-bool InitItems(void);
 Item *Item_create(Item *parent, enum ItemType type, int32 tag, M4CALLBACK cb);
 void Item_destroy(Item *myItem);
-void Item_empty_list(Item *myItem);
 Item *ItemAdd(Item *itemList, int32 x, int32 y, int32 w, int32 h, const char *prompt, int32 tag,
 	ItemType type, M4CALLBACK cb, int32 promptMax);
 Item *ItemFind(Item *itemList, int32 tag);
 bool Item_SetViewBottom(Item *i);
-bool ListItemExists(Item *myItem, char *prompt, int32 listTag);
-bool ListItemAdd(Item *myItem, char *prompt, int32 listTag, int32 addMode, ListItem *changedItem);
-bool ListItemDelete(Item *myItem, ListItem *myListItem, int32 listTag);
-bool ListItemChange(Item *myItem, ListItem *myListItem, int32 listTag,
-	char *newPrompt, int32 newTag, int32 changeMode);
 void ViewCurrListItem(Item *myItem);
 ListItem *ListItemFind(Item *myItem, int32 searchMode, char *searchStr, int32 parm1);
 bool ListItemSearch(Item *myItem, int32 searchMode, char *searchStr, int32 parm1);
@@ -135,9 +128,9 @@ bool DoubleClickOnListBox(Item *myItem, int32 xOffset, int32 yOffset);
 bool ClickOnListBox(Item *myItem, int32 xOffset, int32 yOffset, int32 scrollType);
 bool ResetDefaultListBox(Item *myItem);
 bool Item_change_prompt(Item *myItem, const char *newPrompt);
-void Item_ClearOrigPrompt(void);
-Item *Item_RestoreTextField(void);
-Item *Item_CheckTextField(void);
+void Item_ClearOrigPrompt();
+Item *Item_RestoreTextField();
+Item *Item_CheckTextField();
 void Item_SaveTextField(Item *myItem);
 void SetTextBlockBegin(Item *myItem, int32 relXPos);
 void SetTextBlockEnd(Item *myItem, int32 relXPos);
diff --git a/engines/m4/gui/gui_menu_items.cpp b/engines/m4/gui/gui_menu_items.cpp
index 4881c602f88..be0f6227e37 100644
--- a/engines/m4/gui/gui_menu_items.cpp
+++ b/engines/m4/gui/gui_menu_items.cpp
@@ -21,7 +21,6 @@
 
 #include "graphics/thumbnail.h"
 #include "m4/gui/gui_menu_items.h"
-#include "m4/adv_r/other.h"
 #include "m4/adv_r/adv_background.h"
 #include "m4/adv_r/adv_control.h"
 #include "m4/adv_r/adv_player.h"
@@ -1224,7 +1223,7 @@ void menuItemMsg::drawMsg(menuItemMsg *myItem, guiMenu *myMenu, int32 x, int32 y
 
 	// Get the menu buffer and draw the sprite to it
 	Buffer *myBuff = myMenu->menuBuffer->get_buffer();
-	if (!myBuff) {
+	if (!myBuff || !mySprite) {
 		return;
 	}
 
diff --git a/engines/m4/gui/gui_menu_items.h b/engines/m4/gui/gui_menu_items.h
index ce7ae97191e..a2112e81068 100644
--- a/engines/m4/gui/gui_menu_items.h
+++ b/engines/m4/gui/gui_menu_items.h
@@ -170,8 +170,6 @@ public:
 	int32 itemFlags = 0;
 
 	static menuItemMsg *msgAdd(guiMenu *myMenu, int32 tag, int32 x, int32 y, int32 w, int32 h, bool transparent = false);
-	static void disableMsg(menuItemMsg *myItem, int32 tag, guiMenu *myMenu);
-	static void enableMsg(menuItemMsg *myItem, int32 tag, guiMenu *myMenu);
 };
 
 struct menuItemButton : public menuItem {
@@ -214,7 +212,7 @@ public:
 		const char *prompt = nullptr, ItemHandlerFunction i_handler = (ItemHandlerFunction)handler);
 	static void disableButton(menuItemButton *myItem, int32 tag, guiMenu *myMenu);
 	static void enableButton(menuItemButton *myItem, int32 tag, guiMenu *myMenu);
-	static bool handler(menuItemButton *theItem, int32 eventType, int32 event,
+	static bool handler(menuItemButton *myItem, int32 eventType, int32 event,
 		int32 x, int32 y, void **currItem);
 };
 
diff --git a/engines/m4/gui/gui_sys.cpp b/engines/m4/gui/gui_sys.cpp
index aeadc07b366..f5ffb2c10b0 100644
--- a/engines/m4/gui/gui_sys.cpp
+++ b/engines/m4/gui/gui_sys.cpp
@@ -152,7 +152,8 @@ void gui_system_event_handler() {
 						if (myHotkey->callback) {
 							(myHotkey->callback)((void *)static_cast<intptr>(parm1), (void *)myScreen->scrnContent);
 						}
-					} else myHotkey = myHotkey->next;
+					} else
+						myHotkey = myHotkey->next;
 				}
 			}
 			myScreen = myScreen->behind;
@@ -170,7 +171,8 @@ void gui_system_event_handler() {
 					if (myHotkey->callback) {
 						(myHotkey->callback)((void *)static_cast<intptr>(parm1), nullptr);
 					}
-				} else myHotkey = myHotkey->next;
+				} else
+					myHotkey = myHotkey->next;
 			}
 		}
 	} // end key handling check
diff --git a/engines/m4/gui/gui_sys.h b/engines/m4/gui/gui_sys.h
index e7d4677eee1..38100907032 100644
--- a/engines/m4/gui/gui_sys.h
+++ b/engines/m4/gui/gui_sys.h
@@ -23,7 +23,6 @@
 #ifndef M4_GUI_GUI_SYS_H
 #define M4_GUI_GUI_SYS_H
 
-#include "m4/m4_types.h"
 #include "m4/gui/gui_univ.h"
 
 namespace M4 {
diff --git a/engines/m4/gui/gui_vmng.h b/engines/m4/gui/gui_vmng.h
index 7d0277075fb..8975c8c2f8b 100644
--- a/engines/m4/gui/gui_vmng.h
+++ b/engines/m4/gui/gui_vmng.h
@@ -23,8 +23,6 @@
 #ifndef M4_GUI_GUI_VMNG_H
 #define M4_GUI_GUI_VMNG_H
 
-#include "m4/m4_types.h"
-#include "m4/gui/gui_univ.h"
 #include "m4/gui/gui_vmng_core.h"
 #include "m4/gui/gui_vmng_rectangles.h"
 #include "m4/gui/gui_vmng_screen.h"
@@ -59,9 +57,6 @@ enum {
 #define SF_OFFSCRN		0x0200		// can be dragged off screen, if it's draggable
 #define SF_TRANSPARENT	0x0400		// if the screen is transparent
 
-#define SF_DEFAULT	SF_DRIFTER | SF_GET_ALL | SF_BLOCK_NONE
-#define SF_ALERT	SF_FLOATER | SF_GET_ALL | SF_BLOCK_ALL
-
 } // End of namespace M4
 
 #endif
diff --git a/engines/m4/gui/gui_vmng_core.cpp b/engines/m4/gui/gui_vmng_core.cpp
index 598d771e9c6..1b5fb19f342 100644
--- a/engines/m4/gui/gui_vmng_core.cpp
+++ b/engines/m4/gui/gui_vmng_core.cpp
@@ -309,7 +309,8 @@ ScreenContext *ExtractScreen(void *scrnContent, int32 status) {
 			} else {
 				tempScreen = myScreen->infront;
 				tempScreen->behind = myScreen->behind;
-				if (tempScreen->behind) tempScreen->behind->infront = tempScreen;
+				if (tempScreen->behind)
+					tempScreen->behind->infront = tempScreen;
 			}
 		}
 	}
diff --git a/engines/m4/gui/gui_vmng_rectangles.cpp b/engines/m4/gui/gui_vmng_rectangles.cpp
index 6556f3bcb04..afbfb8116f4 100644
--- a/engines/m4/gui/gui_vmng_rectangles.cpp
+++ b/engines/m4/gui/gui_vmng_rectangles.cpp
@@ -20,7 +20,6 @@
  */
 
 #include "m4/gui/gui_vmng_rectangles.h"
-#include "m4/gui/gui_vmng.h"
 #include "m4/core/errors.h"
 #include "m4/core/imath.h"
 #include "m4/mem/mem.h"
@@ -28,7 +27,6 @@
 
 namespace M4 {
 
-
 #define LEFT_EDGE 1
 #define RIGHT_EDGE 2
 
@@ -314,19 +312,6 @@ bool vmng_ClipRectList(RectList **myRectList, int32 clipX1, int32 clipY1, int32
 	return true;
 }
 
-bool vmng_RectListValid(RectList *myRectList) {
-	RectList *myRect = myRectList;
-	while (myRect) {
-		RectList *tempRectList = myRect->next;
-		if (vmng_RectIntersectsRectList(tempRectList, myRect->x1, myRect->y1, myRect->x2, myRect->y2)) {
-			return false;
-		}
-		myRect = myRect->next;
-	}
-
-	return true;
-}
-
 void vmng_DisposeRectList(RectList **rectList) {
 	// Loop through the rect list
 	RectList *myRect = *rectList;
diff --git a/engines/m4/gui/gui_vmng_rectangles.h b/engines/m4/gui/gui_vmng_rectangles.h
index a88ea9f55b0..262736f27cb 100644
--- a/engines/m4/gui/gui_vmng_rectangles.h
+++ b/engines/m4/gui/gui_vmng_rectangles.h
@@ -23,7 +23,6 @@
 #ifndef M4_GUI_GUI_VMNG_RECTANGLES_H
 #define M4_GUI_GUI_VMNG_RECTANGLES_H
 
-#include "m4/m4_types.h"
 #include "m4/gui/gui_univ.h"
 
 namespace M4 {
@@ -32,7 +31,6 @@ RectList *vmng_CreateNewRect(int32 x1, int32 y1, int32 x2, int32 y2);
 void vmng_AddRectToRectList(RectList **scrnRectList, int32 x1, int32 y1, int32 x2, int32 y2);
 RectList *vmng_DuplicateRectList(RectList *myRectList);
 bool vmng_RectIntersectsRectList(RectList *myRectList, int32 x1, int32 y1, int32 x2, int32 y2);
-bool vmng_RectListValid(RectList *myRectList);
 bool vmng_ClipRectList(RectList **myRectList, int32 clipX1, int32 clipY1, int32 clipX2, int32 clipY2);
 void vmng_DisposeRectList(RectList **rectList);
 void vmng_RemoveRectFromRectList(RectList **scrnRectList, int32 x1, int32 y1, int32 x2, int32 y2);
diff --git a/engines/m4/gui/gui_vmng_screen.cpp b/engines/m4/gui/gui_vmng_screen.cpp
index 15054554486..3debc69b2af 100644
--- a/engines/m4/gui/gui_vmng_screen.cpp
+++ b/engines/m4/gui/gui_vmng_screen.cpp
@@ -31,23 +31,6 @@ namespace M4 {
 static void vmng_black_out_video(int32 x1, int32 y1, int32 x2, int32 y2);
 static bool MoveScreen(ScreenContext *myScreen, int32 parmX, int32 parmY, bool deltaMove);
 
-bool GetScreenCoords(void *scrnContent, int32 *x1, int32 *y1, int32 *x2, int32 *y2) {
-	ScreenContext *myScreen = vmng_screen_find(scrnContent, nullptr);
-	if (myScreen == nullptr)
-		return false;
-
-	if (x1)
-		*x1 = myScreen->x1;
-	if (y1)
-		*y1 = myScreen->y1;
-	if (x2)
-		*x2 = myScreen->x2;
-	if (y2)
-		*y2 = myScreen->y2;
-
-	return true;
-}
-
 void RestoreScreens(int32 updateX1, int32 updateY1, int32 updateX2, int32 updateY2) {
 	RectList *updateRectList, *scrnUpdateList, *tempRect;
 
@@ -213,33 +196,6 @@ static void vmng_black_out_video(int32 x1, int32 y1, int32 x2, int32 y2) {
 	g_system->fillScreen(r, 0);
 }
 
-bool RemoveScreenHotkey(void *scrnContent, int32 myKey) {
-	ScreenContext *myScreen = vmng_screen_find(scrnContent, nullptr);
-	if (myScreen == nullptr)
-		return false;
-
-	Hotkey *myHotkey = myScreen->scrnHotkeys;
-
-	if (myHotkey->myKey == myKey) {
-		myScreen->scrnHotkeys = myHotkey->next;
-		mem_free(myHotkey);
-
-	} else {
-		while (myHotkey->next && (myHotkey->next->myKey != myKey)) {
-			myHotkey = myHotkey->next;
-		}
-		if (myHotkey->next) {
-			Hotkey *tempHotkey = myHotkey->next;
-			myHotkey->next = tempHotkey->next;
-			mem_free(tempHotkey);
-		} else {
-			return false;
-		}
-	}
-
-	return true;
-}
-
 bool MoveScreenAbs(ScreenContext *myScreen, int32 parmX, int32 parmY) {
 	return MoveScreen(myScreen, parmX, parmY, false);
 }
@@ -254,7 +210,9 @@ bool MoveScreenDelta(int32 parmX, int32 parmY) {
 
 void vmng_screen_to_back(void *scrnContent) {
 	ScreenContext *myScreen = ExtractScreen(scrnContent, SCRN_ANY);
-	if (myScreen == nullptr) return;
+	if (myScreen == nullptr)
+		return;
+
 	if (!_G(backScreen)) {
 		myScreen->infront = nullptr;
 		myScreen->behind = nullptr;
diff --git a/engines/m4/gui/gui_vmng_screen.h b/engines/m4/gui/gui_vmng_screen.h
index 9dc34b05942..2833b363bb9 100644
--- a/engines/m4/gui/gui_vmng_screen.h
+++ b/engines/m4/gui/gui_vmng_screen.h
@@ -28,16 +28,6 @@
 
 namespace M4 {
 
-/**
- * Record the (global) coordinates of the window which was created for scrnContent.
- * @param scrnContent	The window identifier
- * @param x1			Window top-left X
- * @param y1			Window top-left Y
- * @param x2			Window bottom-right X
- * @param y2			Window bottom-right Y
- */
-bool GetScreenCoords(void *scrnContent, int32 *x1, int32 *y1, int32 *x2, int32 *y2);
-
 /**
  * Change which procedure will be called when a portion of the window
  * needs to be redrawn.
@@ -46,15 +36,6 @@ bool GetScreenCoords(void *scrnContent, int32 *x1, int32 *y1, int32 *x2, int32 *
  */
 bool vmng_SetScreenRefresh(void *scrnContent, RefreshFunc redraw);
 
-/**
- * Remove a hot key
- * @param scrnContent	The window identifier
- * @param myKey			The "hot key" to be removed.
- * @returns		False if either the window or the "hot key" could not be found,
- * TRUE if successful
- */
-bool RemoveScreenHotkey(void *scrnContent, int32 myKey);
-
 /**
  * Obvious shell to MoveScreen
  */
@@ -89,11 +70,6 @@ void RestoreScreens(int32 updateX1, int32 updateY1, int32 updateX2, int32 update
  */
 void RestoreScreensInContext(int32 x1, int32 y1, int32 x2, int32 y2, ScreenContext *myScreen);
 
-/**
- * Capture a screenshot to a bitmap.
- */
-void Screen2BuffC(int8 *Buff);
-
 } // End of namespace M4
 
 #endif
diff --git a/engines/m4/gui/hotkeys.cpp b/engines/m4/gui/hotkeys.cpp
index c90f19fcea6..83974eeb67c 100644
--- a/engines/m4/gui/hotkeys.cpp
+++ b/engines/m4/gui/hotkeys.cpp
@@ -46,45 +46,6 @@ Hotkeys::Hotkeys() {
 	_teleportDialog = nullptr;
 }
 
-void Hotkeys::disable_hot_keys() {
-	RemoveSystemHotkey(KEY_HOME);
-	RemoveSystemHotkey(KEY_PAGE_UP);
-	RemoveSystemHotkey(KEY_PAGE_DOWN);
-	RemoveSystemHotkey(KEY_END);
-
-	RemoveSystemHotkey(KEY_ALT_UP);
-	RemoveSystemHotkey(KEY_ALT_DOWN);
-	RemoveSystemHotkey(KEY_ALT_LEFT);
-	RemoveSystemHotkey(KEY_ALT_RIGHT);
-
-	RemoveSystemHotkey(KEY_CTRL_UP);
-	RemoveSystemHotkey(KEY_CTRL_DOWN);
-	RemoveSystemHotkey(KEY_CTRL_LEFT);
-	RemoveSystemHotkey(KEY_CTRL_RIGHT);
-
-	RemoveSystemHotkey(KEY_F4);
-
-	RemoveSystemHotkey('[');
-	RemoveSystemHotkey(']');
-	RemoveSystemHotkey('{');
-	RemoveSystemHotkey('}');
-
-	//RemoveSystemHotkey( KEY_ALT_B);
-	RemoveSystemHotkey(KEY_ALT_C);
-	RemoveSystemHotkey(KEY_ALT_D);
-	RemoveSystemHotkey(KEY_ALT_F);
-	RemoveSystemHotkey(KEY_ALT_G);
-	RemoveSystemHotkey(KEY_ALT_I);
-	RemoveSystemHotkey(KEY_ALT_B);
-	RemoveSystemHotkey(KEY_ALT_M);
-	RemoveSystemHotkey(KEY_ALT_P);
-	RemoveSystemHotkey(KEY_ALT_R);
-	RemoveSystemHotkey(KEY_ALT_S);
-	RemoveSystemHotkey(KEY_ALT_T);
-	RemoveSystemHotkey(KEY_ALT_W);
-	RemoveSystemHotkey(KEY_ALT_Z);
-}
-
 void Hotkeys::add_hot_keys() {
 	AddSystemHotkey(KEY_F2, saveGame);
 	AddSystemHotkey(KEY_F3, loadGame);
diff --git a/engines/m4/gui/hotkeys.h b/engines/m4/gui/hotkeys.h
index 4e2109158c5..bd78827e986 100644
--- a/engines/m4/gui/hotkeys.h
+++ b/engines/m4/gui/hotkeys.h
@@ -23,7 +23,6 @@
 #ifndef M4_GUI_HOTKEYS_H
 #define M4_GUI_HOTKEYS_H
 
-#include "m4/m4_types.h"
 #include "m4/gui/gui_dialog.h"
 
 namespace M4 {
@@ -95,7 +94,6 @@ public:
 	virtual ~Hotkeys() {}
 
 	virtual void add_hot_keys();
-	void disable_hot_keys();
 
 	static void saveGame(void *, void *);
 	static void loadGame(void *, void *);




More information about the Scummvm-git-logs mailing list