[Scummvm-git-logs] scummvm master -> 136ef7475d9a785df64f54d31172257a4dd82310

sev- noreply at scummvm.org
Wed Oct 30 00:33:51 UTC 2024


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

Summary:
2dedd95547 QDENGINE: Print coords_animation type in human-readable form in XML output
136ef7475d QDENGINE: Print moving object control in human-readable form in XML


Commit: 2dedd955478cf3308e75ae7b884c80db58b887e9
    https://github.com/scummvm/scummvm/commit/2dedd955478cf3308e75ae7b884c80db58b887e9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-30T01:11:56+01:00

Commit Message:
QDENGINE: Print coords_animation type in human-readable form in XML output

Changed paths:
    engines/qdengine/qdcore/qd_coords_animation.cpp


diff --git a/engines/qdengine/qdcore/qd_coords_animation.cpp b/engines/qdengine/qdcore/qd_coords_animation.cpp
index 7a9722fbd31..fe7fa228990 100644
--- a/engines/qdengine/qdcore/qd_coords_animation.cpp
+++ b/engines/qdengine/qdcore/qd_coords_animation.cpp
@@ -268,7 +268,11 @@ bool qdCoordsAnimation::save_script(Common::WriteStream &fh, int indent) const {
 		fh.writeString(" name=\" \"");
 	}
 
-	fh.writeString(Common::String::format(" type=\"%d\"", (int)_type));
+	if (debugChannelSet(-1, kDebugLog))
+		fh.writeString(Common::String::format(" type=\"%s\"", _type == CA_INTERPOLATE_COORDS ? "CA_INTERPOLATE_COORDS" : "CA_WALK"));
+	else
+		fh.writeString(Common::String::format(" type=\"%d\"", (int)_type));
+
 	fh.writeString(Common::String::format(" speed=\"%f\"", _speed));
 	fh.writeString(Common::String::format(" animation_phase=\"%f\"", _animation_phase));
 


Commit: 136ef7475d9a785df64f54d31172257a4dd82310
    https://github.com/scummvm/scummvm/commit/136ef7475d9a785df64f54d31172257a4dd82310
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-10-30T01:33:08+01:00

Commit Message:
QDENGINE: Print moving object control in human-readable form in XML

Changed paths:
    engines/qdengine/qdcore/qd_game_dispatcher.cpp
    engines/qdengine/qdcore/qd_game_object_moving.cpp
    engines/qdengine/qdcore/qd_game_object_moving.h


diff --git a/engines/qdengine/qdcore/qd_game_dispatcher.cpp b/engines/qdengine/qdcore/qd_game_dispatcher.cpp
index dc7ca96a425..8e722c6fa13 100644
--- a/engines/qdengine/qdcore/qd_game_dispatcher.cpp
+++ b/engines/qdengine/qdcore/qd_game_dispatcher.cpp
@@ -1649,7 +1649,6 @@ bool qdGameDispatcher::check_condition(qdCondition *cnd) {
 		}
 		return false;
 	case qdCondition::CONDITION_KEYPRESS: {
-		warning("**** CONDITION_KEYPRESS");
 		int vkey;
 		if (!cnd->get_value(0, vkey)) return false;
 		return keyboardDispatcher::instance()->is_pressed(vkey);
diff --git a/engines/qdengine/qdcore/qd_game_object_moving.cpp b/engines/qdengine/qdcore/qd_game_object_moving.cpp
index 8292eb34f7d..5070013af37 100644
--- a/engines/qdengine/qdcore/qd_game_object_moving.cpp
+++ b/engines/qdengine/qdcore/qd_game_object_moving.cpp
@@ -276,7 +276,11 @@ bool qdGameObjectMoving::save_script_body(Common::WriteStream &fh, int indent) c
 	for (int i = 0; i <= indent; i++) {
 		fh.writeString("\t");
 	}
-	fh.writeString(Common::String::format("<control>%d</control>\r\n", _control_types));
+
+	if (debugChannelSet(-1, kDebugLog))
+		fh.writeString(Common::String::format("<control>%s</control>\r\n", control2str(_control_types).c_str()));
+	else
+		fh.writeString(Common::String::format("<control>%d</control>\r\n", _control_types));
 
 	return true;
 }
@@ -2701,4 +2705,46 @@ bool qdGameObjectMoving::get_debug_info(Common::String &buf) const {
 #endif
 	return true;
 }
+
+#define defFlag(x) { qdGameObjectMoving::x, #x }
+
+struct FlagsList {
+	int f;
+	const char *s;
+} static controlList[] = {
+	defFlag(CONTROL_MOUSE),
+	defFlag(CONTROL_KEYBOARD),
+	defFlag(CONTROL_COLLISION),
+	defFlag(CONTROL_AVOID_COLLISION),
+	defFlag(CONTROL_AUTO_MOVE),
+	defFlag(CONTROL_CLEAR_PATH),
+	defFlag(CONTROL_FOLLOW_ACTIVE_PERSONAGE),
+	defFlag(CONTROL_REPEAT_ACTIVE_PERSONAGE_MOVEMENT),
+	defFlag(CONTROL_ATTACHMENT_WITH_DIR_REL),
+	defFlag(CONTROL_ATTACHMENT_WITHOUT_DIR_REL),
+	defFlag(CONTROL_ATTACHMENT_TO_ACTIVE_WITH_MOVING),
+	defFlag(CONTROL_ACTIVE_CLICK_REACTING),
+	defFlag(CONTROL_ANIMATED_ROTATION),
+};
+
+Common::String qdGameObjectMoving::control2str(int fl) const {
+	Common::String res;
+
+	for (int i = 0; i < ARRAYSIZE(controlList); i++) {
+		if (fl & controlList[i].f) {
+			if (!res.empty())
+				res += " | ";
+
+			res += controlList[i].s;
+
+			fl &= ~controlList[i].f;
+		}
+	}
+
+	if (fl)
+		res += Common::String::format(" | %x", fl);
+
+	return res;
+}
+
 } // namespace QDEngine
diff --git a/engines/qdengine/qdcore/qd_game_object_moving.h b/engines/qdengine/qdcore/qd_game_object_moving.h
index 431b295c35c..1070bf45c40 100644
--- a/engines/qdengine/qdcore/qd_game_object_moving.h
+++ b/engines/qdengine/qdcore/qd_game_object_moving.h
@@ -350,6 +350,8 @@ public:
 	void set_path_attributes(int attr) const;
 	void clear_path_attributes(int attr) const;
 
+	Common::String control2str(int control) const;
+
 protected:
 
 	bool load_script_body(const xml::tag *p);




More information about the Scummvm-git-logs mailing list