[Scummvm-git-logs] scummvm master -> 9d50d2eaf730cd17c2ddd8c6250df9c8ea506c99

dreammaster noreply at scummvm.org
Wed Apr 6 03:54:58 UTC 2022


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

Summary:
c49bf9f666 AGS: Restored GUI controls interactivity on 100% transparent gui
60902d9277 AGS: Fixed SpriteFile::RebuildSpriteIndex() not really working
f1972a352a AGS: Fixup slashes for filepaths from the script ('\\' -> '/')
eafed5070a AGS: Log script's FileOpen command results
9a5b149176 AGS: Moved script paths slashes fixup to ResolveScriptPath()
096ea64f07 GLK: GLULX: Added detection entry
9d50d2eaf7 GLK: ZCODE: Added detection entry


Commit: c49bf9f666d726cd9bdfa940b7efbcf5c5750676
    https://github.com/scummvm/scummvm/commit/c49bf9f666d726cd9bdfa940b7efbcf5c5750676
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2022-04-05T20:42:56-07:00

Commit Message:
AGS: Restored GUI controls interactivity on 100% transparent gui

>From upstream f1df50557ee535822c630f81e13b216a931bba56

Starting to notice a whole bunch of new/different code attributed to commits
done years ago, prior to baseline the ScummVM version was started at.
I'm suspecting that someone upstream played around with the git history too much.

Changed paths:
    engines/ags/engine/ac/draw.cpp


diff --git a/engines/ags/engine/ac/draw.cpp b/engines/ags/engine/ac/draw.cpp
index f0b8110bf5c..12f7b625fad 100644
--- a/engines/ags/engine/ac/draw.cpp
+++ b/engines/ags/engine/ac/draw.cpp
@@ -1966,9 +1966,9 @@ void draw_gui_and_overlays() {
 		_G(our_eip) = 37;
 		{
 			for (aa = 0; aa < _GP(game).numgui; aa++) {
-				if (!_GP(guis)[aa].IsDisplayed()) continue;
-				if (!_GP(guis)[aa].HasChanged()) continue;
-				if (_GP(guis)[aa].Transparency == 255) continue;
+				if (!_GP(guis)[aa].IsDisplayed()) continue; // not on screen
+				if (!_GP(guis)[aa].HasChanged()) continue; // no changes: no need to update image
+				if (_GP(guis)[aa].Transparency == 255) continue; // 100% transparent
 
 				_GP(guis)[aa].ClearChanged();
 				if (_GP(guibg)[aa] == nullptr ||
@@ -2004,8 +2004,8 @@ void draw_gui_and_overlays() {
 		// Draw the GUIs
 		for (int gg = 0; gg < _GP(game).numgui; gg++) {
 			aa = _GP(play).gui_draw_order[gg];
-			if (!_GP(guis)[aa].IsDisplayed()) continue;
-			if (_GP(guis)[aa].Transparency == 255) continue;
+			if (!_GP(guis)[aa].IsDisplayed()) continue; // not on screen
+			if (_GP(guis)[aa].Transparency == 255) continue; // 100% transparent
 
 			// Don't draw GUI if "GUIs Turn Off When Disabled"
 			if ((_GP(game).options[OPT_DISABLEOFF] == 3) &&
@@ -2015,11 +2015,21 @@ void draw_gui_and_overlays() {
 
 			_GP(guibgbmp)[aa]->SetTransparency(_GP(guis)[aa].Transparency);
 			add_to_sprite_list(_GP(guibgbmp)[aa], _GP(guis)[aa].X, _GP(guis)[aa].Y, _GP(guis)[aa].ZOrder, false);
+		}
 
-			// only poll if the interface is enabled (mouseovers should not
-			// work while in Wait state)
-			if (IsInterfaceEnabled())
-				_GP(guis)[aa].Poll();
+		// Poll the GUIs
+		// TODO: move this out of the draw routine into game update!!
+		// only poll if the interface is enabled
+		if (IsInterfaceEnabled()) {
+			for (int gg = 0; gg < _GP(game).numgui; gg++) {
+				if (!_GP(guis)[gg].IsDisplayed()) continue; // not on screen
+				// Don't touch GUI if "GUIs Turn Off When Disabled"
+				if ((_GP(game).options[OPT_DISABLEOFF] == 3) &&
+					(_G(all_buttons_disabled) > 0) &&
+					(_GP(guis)[gg].PopupStyle != kGUIPopupNoAutoRemove))
+					continue;
+				_GP(guis)[gg].Poll();
+			}
 		}
 	}
 


Commit: 60902d92771ff50b5f9310e5e7200605f8836ef4
    https://github.com/scummvm/scummvm/commit/60902d92771ff50b5f9310e5e7200605f8836ef4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2022-04-05T20:42:56-07:00

Commit Message:
AGS: Fixed SpriteFile::RebuildSpriteIndex() not really working

>From upstream 59901dea5bc858b338f4b616769b561ab0c07134

Changed paths:
    engines/ags/shared/ac/sprite_file.cpp


diff --git a/engines/ags/shared/ac/sprite_file.cpp b/engines/ags/shared/ac/sprite_file.cpp
index fe71c4b2603..07a0820c455 100644
--- a/engines/ags/shared/ac/sprite_file.cpp
+++ b/engines/ags/shared/ac/sprite_file.cpp
@@ -325,13 +325,15 @@ HError SpriteFile::RebuildSpriteIndex(Stream *in, sprkey_t topmost,
 		_spriteData[i].Offset = in->GetPosition();
 		SpriteDatHeader hdr;
 		ReadSprHeader(hdr, _stream.get(), _version, _compress);
-		if (hdr.BPP == 0) return HError::None(); // empty slot, this is normal
+		if (hdr.BPP == 0) continue; // empty slot, this is normal
 		int pal_bpp = GetPaletteBPP(hdr.SFormat);
 		if (pal_bpp > 0) in->Seek(hdr.PalCount * pal_bpp); // skip palette
 		size_t data_sz =
 			((_version >= kSprfVersion_StorageFormats) || _compress != kSprCompress_None) ?
 			(uint32_t)in->ReadInt32() : hdr.Width * hdr.Height * hdr.BPP;
 		in->Seek(data_sz); // skip image data
+		metrics[i].Width = hdr.Width;
+		metrics[i].Height = hdr.Height;
 	}
 	return HError::None();
 }


Commit: f1972a352a624896c0de20b1a7179e415fd53c7a
    https://github.com/scummvm/scummvm/commit/f1972a352a624896c0de20b1a7179e415fd53c7a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2022-04-05T20:42:56-07:00

Commit Message:
AGS: Fixup slashes for filepaths from the script ('\\' -> '/')

>From upstream 53a705c6f0f64b9092f8992c7c56fa06e587774f

Changed paths:
    engines/ags/engine/ac/global_file.cpp


diff --git a/engines/ags/engine/ac/global_file.cpp b/engines/ags/engine/ac/global_file.cpp
index 80babc04160..f30807ddf78 100644
--- a/engines/ags/engine/ac/global_file.cpp
+++ b/engines/ags/engine/ac/global_file.cpp
@@ -67,16 +67,20 @@ int32_t FindFreeFileSlot() {
 }
 
 int32_t FileOpen(const char *fnmm, Shared::FileOpenMode open_mode, Shared::FileWorkMode work_mode) {
+	// make sure the file path has system-compatible form
+	String filepath = fnmm;
+	filepath.Replace('\\', '/');
+
 	int32_t useindx = FindFreeFileSlot();
 	if (useindx < 0)
 		return 0;
 
 	ResolvedPath rp;
 	if (open_mode == kFile_Open && work_mode == kFile_Read) {
-		if (!ResolveScriptPath(fnmm, true, rp))
+		if (!ResolveScriptPath(filepath, true, rp))
 			return 0;
 	} else {
-		if (!ResolveWritePathAndCreateDirs(fnmm, rp))
+		if (!ResolveWritePathAndCreateDirs(filepath, rp))
 			return 0;
 	}
 


Commit: eafed5070a79f18836ab1770cfcc76cc458313ef
    https://github.com/scummvm/scummvm/commit/eafed5070a79f18836ab1770cfcc76cc458313ef
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2022-04-05T20:42:56-07:00

Commit Message:
AGS: Log script's FileOpen command results

>From upstream ad39a4336829927ae47516d85dffd5dcde61584d

Changed paths:
    engines/ags/engine/ac/global_file.cpp
    engines/ags/engine/debugging/debug.cpp
    engines/ags/engine/debugging/debug_log.h


diff --git a/engines/ags/engine/ac/global_file.cpp b/engines/ags/engine/ac/global_file.cpp
index f30807ddf78..174733c404d 100644
--- a/engines/ags/engine/ac/global_file.cpp
+++ b/engines/ags/engine/ac/global_file.cpp
@@ -67,13 +67,16 @@ int32_t FindFreeFileSlot() {
 }
 
 int32_t FileOpen(const char *fnmm, Shared::FileOpenMode open_mode, Shared::FileWorkMode work_mode) {
+	debug_script_print(kDbgMsg_Debug, "FileOpen: request: %s", fnmm);
 	// make sure the file path has system-compatible form
 	String filepath = fnmm;
 	filepath.Replace('\\', '/');
 
 	int32_t useindx = FindFreeFileSlot();
-	if (useindx < 0)
+	if (useindx < 0) {
+		debug_script_warn("FileOpen: no free handles: %s", filepath.GetCStr());
 		return 0;
+	}
 
 	ResolvedPath rp;
 	if (open_mode == kFile_Open && work_mode == kFile_Read) {
@@ -85,18 +88,24 @@ int32_t FileOpen(const char *fnmm, Shared::FileOpenMode open_mode, Shared::FileW
 	}
 
 	Stream *s;
+	String resolved_path = rp.FullPath;
 	if (rp.AssetMgr) {
 		s = _GP(AssetMgr)->OpenAsset(rp.FullPath, "*");
 	} else {
 		s = File::OpenFile(rp.FullPath, open_mode, work_mode);
-		if (!s && !rp.AltPath.IsEmpty() && rp.AltPath.Compare(rp.FullPath) != 0)
+		if (!s && !rp.AltPath.IsEmpty() && rp.AltPath.Compare(rp.FullPath) != 0) {
 			s = File::OpenFile(rp.AltPath, open_mode, work_mode);
+			resolved_path = rp.AltPath;
+		}
 	}
 
 	valid_handles[useindx].stream = s;
-	if (valid_handles[useindx].stream == nullptr)
+	if (valid_handles[useindx].stream == nullptr) {
+		debug_script_warn("FileOpen: FAILED: %s", resolved_path.GetCStr());
 		return 0;
+	}
 	valid_handles[useindx].handle = useindx + 1; // make handle indexes 1-based
+	debug_script_print(kDbgMsg_Info, "FileOpen: success: %s", resolved_path.GetCStr());
 
 	if (useindx >= num_open_script_files)
 		num_open_script_files++;
diff --git a/engines/ags/engine/debugging/debug.cpp b/engines/ags/engine/debugging/debug.cpp
index 8080be0e4cc..9f5a43fb45b 100644
--- a/engines/ags/engine/debugging/debug.cpp
+++ b/engines/ags/engine/debugging/debug.cpp
@@ -269,7 +269,7 @@ void debug_set_console(bool enable) {
 }
 
 // Prepends message text with current room number and running script info, then logs result
-void debug_script_print(const String &msg, MessageType mt) {
+static void debug_script_print_impl(const String &msg, MessageType mt) {
 	String script_ref;
 	ccInstance *curinst = ccInstance::GetCurrentInstance();
 	if (curinst != nullptr) {
@@ -288,12 +288,20 @@ void debug_script_print(const String &msg, MessageType mt) {
 	Debug::Printf(kDbgGroup_Game, mt, "(room:%d)%s %s", _G(displayed_room), script_ref.GetCStr(), msg.GetCStr());
 }
 
+void debug_script_print(MessageType mt, const char *msg, ...) {
+	va_list ap;
+	va_start(ap, msg);
+	String full_msg = String::FromFormatV(msg, ap);
+	va_end(ap);
+	debug_script_print_impl(full_msg, mt);
+}
+
 void debug_script_warn(const char *msg, ...) {
 	va_list ap;
 	va_start(ap, msg);
 	String full_msg = String::FromFormatV(msg, ap);
 	va_end(ap);
-	debug_script_print(full_msg, kDbgMsg_Warn);
+	debug_script_print_impl(full_msg, kDbgMsg_Warn);
 }
 
 void debug_script_log(const char *msg, ...) {
@@ -301,7 +309,7 @@ void debug_script_log(const char *msg, ...) {
 	va_start(ap, msg);
 	String full_msg = String::FromFormatV(msg, ap);
 	va_end(ap);
-	debug_script_print(full_msg, kDbgMsg_Debug);
+	debug_script_print_impl(full_msg, kDbgMsg_Debug);
 }
 
 
diff --git a/engines/ags/engine/debugging/debug_log.h b/engines/ags/engine/debugging/debug_log.h
index 07c16851528..51caf6805e4 100644
--- a/engines/ags/engine/debugging/debug_log.h
+++ b/engines/ags/engine/debugging/debug_log.h
@@ -38,13 +38,13 @@ void shutdown_debug();
 
 void debug_set_console(bool enable);
 
-// prints debug messages of given type tagged with kDbgGroup_Script,
+// prints debug messages of given type tagged with kDbgGroup_Game,
 // prepending it with current room number and script position info
-void debug_script_print(const AGS::Shared::String &msg, AGS::Shared::MessageType mt);
-// prints formatted debug warnings tagged with kDbgGroup_Script,
+void debug_script_print(AGS::Shared::MessageType mt, const char *msg, ...);
+// prints formatted debug warnings tagged with kDbgGroup_Game,
 // prepending it with current room number and script position info
-void debug_script_warn(const char *texx, ...);
-// prints formatted debug message tagged with kDbgGroup_Script,
+void debug_script_warn(const char *msg, ...);
+// prints formatted debug message tagged with kDbgGroup_Game,
 // prepending it with current room number and script position info
 void debug_script_log(const char *msg, ...);
 


Commit: 9a5b149176652d3fcbdc35a3e2868b3873370173
    https://github.com/scummvm/scummvm/commit/9a5b149176652d3fcbdc35a3e2868b3873370173
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2022-04-05T20:42:57-07:00

Commit Message:
AGS: Moved script paths slashes fixup to ResolveScriptPath()

>From upstream 6249e0fd9529b54b435b299c78394c1fa1efcbe2

Changed paths:
    engines/ags/engine/ac/file.cpp
    engines/ags/engine/ac/global_file.cpp


diff --git a/engines/ags/engine/ac/file.cpp b/engines/ags/engine/ac/file.cpp
index 62e6ab5f815..bd2d5695e0b 100644
--- a/engines/ags/engine/ac/file.cpp
+++ b/engines/ags/engine/ac/file.cpp
@@ -312,20 +312,29 @@ FSLocation GetGameUserDataDir() {
 }
 
 bool ResolveScriptPath(const String &orig_sc_path, bool read_only, ResolvedPath &rp) {
-	debugC(::AGS::kDebugFilePath, "ResolveScriptPath(%s)", orig_sc_path.GetCStr());
 	rp = ResolvedPath();
 
-	if (!Path::IsRelativePath(orig_sc_path)) {
+	// Make sure that the file path has system-compatible form
+	String sc_path = orig_sc_path;
+	sc_path.Replace('\\', '/');
+
+	// File tokens (they must be the only thing in script path)
+	if (sc_path.Compare(UserConfigFileToken) == 0) {
+		auto loc = GetGameUserConfigDir();
+		rp = ResolvedPath(loc, DefaultConfigFileName);
+		return true;
+	}
+
+	// Test absolute paths
+	if (!Path::IsRelativePath(sc_path)) {
 		if (!read_only) {
-			debug_script_warn("Attempt to access file '%s' denied (cannot write to absolute path)", orig_sc_path.GetCStr());
+			debug_script_warn("Attempt to access file '%s' denied (cannot write to absolute path)", sc_path.GetCStr());
 			return false;
 		}
-
-		rp = ResolvedPath(orig_sc_path);
+		rp = ResolvedPath(sc_path);
 		return true;
 	}
 
-	String sc_path = orig_sc_path;
 	if (sc_path.CompareLeft(GameAssetToken, strlen(GameAssetToken)) == 0) {
 		if (!read_only) {
 			debug_script_warn("Attempt to access file '%s' denied (cannot write to game assets)", orig_sc_path.GetCStr());
diff --git a/engines/ags/engine/ac/global_file.cpp b/engines/ags/engine/ac/global_file.cpp
index 174733c404d..b68ec717a64 100644
--- a/engines/ags/engine/ac/global_file.cpp
+++ b/engines/ags/engine/ac/global_file.cpp
@@ -68,22 +68,19 @@ int32_t FindFreeFileSlot() {
 
 int32_t FileOpen(const char *fnmm, Shared::FileOpenMode open_mode, Shared::FileWorkMode work_mode) {
 	debug_script_print(kDbgMsg_Debug, "FileOpen: request: %s", fnmm);
-	// make sure the file path has system-compatible form
-	String filepath = fnmm;
-	filepath.Replace('\\', '/');
 
 	int32_t useindx = FindFreeFileSlot();
 	if (useindx < 0) {
-		debug_script_warn("FileOpen: no free handles: %s", filepath.GetCStr());
+		debug_script_warn("FileOpen: no free handles: %s", fnmm);
 		return 0;
 	}
 
 	ResolvedPath rp;
 	if (open_mode == kFile_Open && work_mode == kFile_Read) {
-		if (!ResolveScriptPath(filepath, true, rp))
+		if (!ResolveScriptPath(fnmm, true, rp))
 			return 0;
 	} else {
-		if (!ResolveWritePathAndCreateDirs(filepath, rp))
+		if (!ResolveWritePathAndCreateDirs(fnmm, rp))
 			return 0;
 	}
 


Commit: 096ea64f07d9330111bd45c995c2185b0499e8b4
    https://github.com/scummvm/scummvm/commit/096ea64f07d9330111bd45c995c2185b0499e8b4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2022-04-05T20:50:29-07:00

Commit Message:
GLK: GLULX: Added detection entry

Changed paths:
    engines/glk/glulx/detection_tables.h


diff --git a/engines/glk/glulx/detection_tables.h b/engines/glk/glulx/detection_tables.h
index 789e7e570d7..16dd7850932 100644
--- a/engines/glk/glulx/detection_tables.h
+++ b/engines/glk/glulx/detection_tables.h
@@ -497,6 +497,7 @@ const GlkDetectionEntry GLULXE_GAMES[] = {
 	DT_ENTRY1("counterfeitmonkey", "171224", "340232662aa8e9f4d45726e8ca7f9f5a", 12580166),
 	DT_ENTRY1("counterfeitmonkey", "181204", "c3e41db7aa8642f40b157c51fa91a26b", 12348938),
 	DT_ENTRY1("counterfeitmonkey", "200810", "493169aff19d6c1b42649197b7fbb6e0", 12400746),
+	DT_ENTRY1("counterfeitmonkey", "210312", "dc67e9f95854b3be82ab33522c4db0e9", 11314624),
 	DT_ENTRY1("countingcrabs", "090728", "ffc19674d99b4d6f530bb00287c83c7e", 1508676),
 	DT_ENTRY1("crackcoldone", "170706", "c2d5bf64a0aadaead7640b5750826d55", 627136),
 	DT_ENTRY1("crackcoldone", "170711", "d64bd51d8fe05dc190ac3589e11b6ea6", 627136),


Commit: 9d50d2eaf730cd17c2ddd8c6250df9c8ea506c99
    https://github.com/scummvm/scummvm/commit/9d50d2eaf730cd17c2ddd8c6250df9c8ea506c99
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2022-04-05T20:54:41-07:00

Commit Message:
GLK: ZCODE: Added detection entry

Changed paths:
    engines/glk/zcode/detection_tables.h


diff --git a/engines/glk/zcode/detection_tables.h b/engines/glk/zcode/detection_tables.h
index 771d2e89df9..c9cf56d401c 100644
--- a/engines/glk/zcode/detection_tables.h
+++ b/engines/glk/zcode/detection_tables.h
@@ -812,6 +812,7 @@ const PlainGameDescriptor ZCODE_GAME_LIST[] = {
 	{ "taipan",            "Taipan!" },
 	{ "takethedogout",     "Take the Dog Out" },
 	{ "talemorning",       "The Mundane Tale of the Morning After" },
+	{ "tapestry",          "Tapestry" },
 	{ "tatctae",           "Time: All things come to an end" },
 	{ "tauntingdonut",     "Taunting Donut" },
 	{ "tblw",              "The Blood lust Warrior" },
@@ -1962,6 +1963,7 @@ const FrotzGameDescription FROTZ_GAMES[] = {
 	ENTRY0("vergingpaths", "151027", "c6df1e824df593e8c4995502e6704571", 1131672),
 	ENTRY0("minimalistgame", "101102", "4ea052eed3e86283912bff5e817151fb", 151040),
 	ENTRY0("talemorning", "140109", "234a6da218d56ca47410f7e03c2b89a8", 286756),
+	ENTRY0("tapestry", "901010", "a8e97156b7211dea1aa94471f0509042", 185344),
 	ENTRY0("paperbagprincess", "150818", "fdf4a244b41e4a314cfa189ba85453cb", 398848),
 	ENTRY0("worldupsidedown", "151224", "1b7311638555848aaf3a50857ed4035b", 457496),
 	ENTRY0("takethedogout", "210328", "3cc6fd155953f3a5321f6e762ff2cd19", 434112),




More information about the Scummvm-git-logs mailing list