[Scummvm-git-logs] scummvm master -> ae6229956eb7e2b2e3499b9fcdbbf357f044b7aa

dreammaster noreply at scummvm.org
Fri Feb 2 15:58:38 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ae6229956e M4: Add extra setting of new memory blocks to 0


Commit: ae6229956eb7e2b2e3499b9fcdbbf357f044b7aa
    https://github.com/scummvm/scummvm/commit/ae6229956eb7e2b2e3499b9fcdbbf357f044b7aa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2024-02-02T07:58:26-08:00

Commit Message:
M4: Add extra setting of new memory blocks to 0

Changed paths:
    engines/m4/burger/gui/game_menu.h
    engines/m4/burger/gui/gui_gizmo.cpp
    engines/m4/burger/gui/gui_gizmo.h
    engines/m4/mem/mem.cpp


diff --git a/engines/m4/burger/gui/game_menu.h b/engines/m4/burger/gui/game_menu.h
index b5479b7b205..e8cec67114f 100644
--- a/engines/m4/burger/gui/game_menu.h
+++ b/engines/m4/burger/gui/game_menu.h
@@ -477,9 +477,9 @@ struct MenuGlobals {
 
 	//menu sprite series vars
 	char *menuSeriesResource = nullptr;
-	MemHandle menuSeriesHandle;
-	int32 menuSeriesOffset;
-	int32 menuSeriesPalOffset;
+	MemHandle menuSeriesHandle = nullptr;
+	int32 menuSeriesOffset = 0;
+	int32 menuSeriesPalOffset = 0;
 
 	Font *menuFont = nullptr;
 
@@ -505,8 +505,8 @@ struct MenuGlobals {
 	bool saveLoadFromHotkey = false;	// Come from hotkey, not through game menu
 	bool gameMenuFromMain = false;		// Come from main menu, not through escape
 
-	int32 remember_digi_volume;			// For cancelling out of the options menu
-	int32 remember_digestability;		// For cancelling out of the options menu
+	int32 remember_digi_volume = 0;		// For cancelling out of the options menu
+	int32 remember_digestability = 0;	// For cancelling out of the options menu
 
 	~MenuGlobals() {
 		_thumbnail.free();
diff --git a/engines/m4/burger/gui/gui_gizmo.cpp b/engines/m4/burger/gui/gui_gizmo.cpp
index 6bf48a4f8ef..853b30be5f8 100644
--- a/engines/m4/burger/gui/gui_gizmo.cpp
+++ b/engines/m4/burger/gui/gui_gizmo.cpp
@@ -47,6 +47,10 @@ static Gizmo *gui_create_gizmo(M4sprite *sprite, int sx, int sy, uint scrnFlags)
 static void gizmo_digi_daemon(int trigger);
 static void gizmo_daemon(int trigger);
 
+Gizmo_Globals::Gizmo_Globals() {
+	Common::fill(_roomFlags, _roomFlags + 15, false);
+}
+
 Gizmo_Globals::~Gizmo_Globals() {
 	mem_free(_gui);
 }
diff --git a/engines/m4/burger/gui/gui_gizmo.h b/engines/m4/burger/gui/gui_gizmo.h
index d0d2e68c8a2..bd724ffa116 100644
--- a/engines/m4/burger/gui/gui_gizmo.h
+++ b/engines/m4/burger/gui/gui_gizmo.h
@@ -58,6 +58,7 @@ struct Gizmo_Globals {
 	int _savedX = 0;
 	int _savedY = 0;
 
+	Gizmo_Globals();
 	~Gizmo_Globals();
 };
 
diff --git a/engines/m4/mem/mem.cpp b/engines/m4/mem/mem.cpp
index 0e0c1294175..ea68f89c00d 100644
--- a/engines/m4/mem/mem.cpp
+++ b/engines/m4/mem/mem.cpp
@@ -96,7 +96,10 @@ void *mem_get_from_stash(int32 memType, const Common::String &name) {
 	for (i = 0; i < _G(requests)[memType]; i++) {
 		if (!*b_ptr) {
 			*b_ptr = 1;
-			return (void *)(b_ptr + 1);
+			void *result = (void *)(b_ptr + 1);
+			Common::fill((byte *)result, (byte *)result + _G(sizeMem)[memType], 0);
+			return result;
+
 		} else {
 			b_ptr += _G(sizeMem)[memType] + 1;
 		}




More information about the Scummvm-git-logs mailing list