[Scummvm-cvs-logs] scummvm master -> 64e21078dae76e900ed2c8e338e27fe57b4cae4d

sev- sev at scummvm.org
Tue Feb 23 11:19:28 CET 2016


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

Summary:
d7b008fa9a WAGE: Added detection for "3rd Floor" and "Bug Hunt"
a2553489a6 WAGE: Added safeguard checks for operands
ea0fb987e0 WAGE: Fix crashes for poorly initialized objects
a7f560ca61 WAGE: Fix assert in string Operand, as it allows TEXT_INPUT as string
d516cac634 WAGE: Improved debug output
64e21078da WAGE: Fix crash when border is off-screen. Bug Hunt was affected.


Commit: d7b008fa9a418951aaa86153aeeed7f5d3aa5e2c
    https://github.com/scummvm/scummvm/commit/d7b008fa9a418951aaa86153aeeed7f5d3aa5e2c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-02-23T11:18:43+01:00

Commit Message:
WAGE: Added detection for "3rd Floor" and "Bug Hunt"

Changed paths:
    engines/wage/detection_tables.h



diff --git a/engines/wage/detection_tables.h b/engines/wage/detection_tables.h
index 790186f..5d0f489 100644
--- a/engines/wage/detection_tables.h
+++ b/engines/wage/detection_tables.h
@@ -27,6 +27,15 @@ namespace Wage {
 
 static const ADGameDescription gameDescriptions[] = {
 	{
+		"wage",
+		"3rd Floor",
+		AD_ENTRY1s("3rd Floor", "a107d7a177970b2259e32681bd8b47c9", 285056),
+		Common::EN_ANY,
+		Common::kPlatformMacintosh,
+		ADGF_GENERIC,
+		GUIO0()
+	},
+	{
 		"afm",
 		"v1.8",
 		AD_ENTRY1s("Another Fine Mess 1.8", "8e5aa915f3253efb2aab52435647b25e", 1456000),
@@ -45,6 +54,15 @@ static const ADGameDescription gameDescriptions[] = {
 		GUIO0()
 	},
 	{
+		"wage",
+		"Bug Hunt",
+		AD_ENTRY1s("Bug Hunt", "2ebd3515a87941063ad66c3cf93c5e78", 200064),
+		Common::EN_ANY,
+		Common::kPlatformMacintosh,
+		ADGF_GENERIC,
+		GUIO0()
+	},
+	{
 		"cantitoe",
 		"",
 		AD_ENTRY1s("Camp Cantitoe", "098aa5c11c58e1ef274a30a9e01b4755", 621440),


Commit: a2553489a66f6c0ccb937cdaaa643f9f037cf51b
    https://github.com/scummvm/scummvm/commit/a2553489a66f6c0ccb937cdaaa643f9f037cf51b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-02-23T11:18:43+01:00

Commit Message:
WAGE: Added safeguard checks for operands

Changed paths:
    engines/wage/script.h



diff --git a/engines/wage/script.h b/engines/wage/script.h
index 1a7d07d..a915980 100644
--- a/engines/wage/script.h
+++ b/engines/wage/script.h
@@ -80,31 +80,37 @@ private:
 
 		Operand(Obj *value, OperandType type) {
 			_value.obj = value;
+			assert(type == OBJ);
 			_type = type;
 		}
 
 		Operand(Chr *value, OperandType type) {
 			_value.chr = value;
+			assert(type == CHR);
 			_type = type;
 		}
 
 		Operand(Scene *value, OperandType type) {
 			_value.scene = value;
+			assert(type == SCENE);
 			_type = type;
 		}
 
 		Operand(int value, OperandType type) {
 			_value.number = value;
+			assert(type == NUMBER);
 			_type = type;
 		}
 
 		Operand(Common::String *value, OperandType type) {
 			_value.string = value;
+			assert(type == STRING);
 			_type = type;
 		}
 
 		Operand(Designed *value, OperandType type) {
 			_value.inputClick = value;
+			assert(type == CLICK_INPUT);
 			_type = type;
 		}
 


Commit: ea0fb987e042a86b8da683cafa7b9cf04d1636e6
    https://github.com/scummvm/scummvm/commit/ea0fb987e042a86b8da683cafa7b9cf04d1636e6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-02-23T11:18:43+01:00

Commit Message:
WAGE: Fix crashes for poorly initialized objects

Changed paths:
    engines/wage/entities.h



diff --git a/engines/wage/entities.h b/engines/wage/entities.h
index ce006a6..33cf087 100644
--- a/engines/wage/entities.h
+++ b/engines/wage/entities.h
@@ -124,7 +124,7 @@ public:
 
 	void setDesignBounds(Common::Rect *bounds);
 
-	Common::String toString() { return _name; }
+	Common::String toString() { if (!this) return "<NULL>"; return _name; }
 };
 
 class Chr : public Designed {


Commit: a7f560ca61461a933bcd4c8ebb25c2bfc7c77c10
    https://github.com/scummvm/scummvm/commit/a7f560ca61461a933bcd4c8ebb25c2bfc7c77c10
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-02-23T11:18:44+01:00

Commit Message:
WAGE: Fix assert in string Operand, as it allows TEXT_INPUT as string

Changed paths:
    engines/wage/script.h



diff --git a/engines/wage/script.h b/engines/wage/script.h
index a915980..325733a 100644
--- a/engines/wage/script.h
+++ b/engines/wage/script.h
@@ -104,7 +104,7 @@ private:
 
 		Operand(Common::String *value, OperandType type) {
 			_value.string = value;
-			assert(type == STRING);
+			assert(type == STRING || type == TEXT_INPUT);
 			_type = type;
 		}
 


Commit: d516cac634eff061e863c7acb036562039faabb9
    https://github.com/scummvm/scummvm/commit/d516cac634eff061e863c7acb036562039faabb9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-02-23T11:18:44+01:00

Commit Message:
WAGE: Improved debug output

Changed paths:
    engines/wage/script.cpp



diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp
index 42fde9f..bd99fa1 100644
--- a/engines/wage/script.cpp
+++ b/engines/wage/script.cpp
@@ -574,6 +574,23 @@ enum {
 	kMoveChrScene
 };
 
+static const char *typeNames[] = {
+	"OBJ",
+	"CHR",
+	"SCENE",
+	"NUMBER",
+	"STRING",
+	"CLICK_INPUT",
+	"TEXT_INPUT"
+};
+
+static const char *operandTypeToStr(int type) {
+	if (type < 0 || type > 6)
+		return "UNKNOWN";
+
+	return typeNames[type];
+}
+
 struct Comparator {
 	char op;
 	OperandType o1;
@@ -711,6 +728,9 @@ bool Script::compare(Operand *o1, Operand *o2, int comparator) {
 }
 
 bool Script::evaluatePair(Operand *lhs, const char *op, Operand *rhs) {
+	debug(7, "HANDLING CASE: [lhs=%s/%s, op=%s rhs=%s/%s]",
+		operandTypeToStr(lhs->_type), lhs->toString().c_str(), op, operandTypeToStr(rhs->_type), rhs->toString().c_str());
+
 	for (int cmp = 0; comparators[cmp].op != 0; cmp++) {
 		if (comparators[cmp].op != op[0])
 			continue;
@@ -757,9 +777,8 @@ bool Script::evaluatePair(Operand *lhs, const char *op, Operand *rhs) {
 		}
 	}
 
-	warning("UNHANDLED CASE: [lhs=%d/%s, op=%s rhs=%d/%s]",
-		lhs->_type, lhs->toString().c_str(), op, rhs->_type, rhs->toString().c_str());
-
+	warning("UNHANDLED CASE: [lhs=%s/%s, op=%s rhs=%s/%s]",
+		operandTypeToStr(lhs->_type), lhs->toString().c_str(), op, operandTypeToStr(rhs->_type), rhs->toString().c_str());
 
 	return false;
 }
@@ -785,8 +804,8 @@ bool Script::eval(Operand *lhs, const char *op, Operand *rhs) {
 				result = _inputText->equalsIgnoreCase(lhs->toString());
 			}
 		} else {
-			error("UNHANDLED CASE: [lhs=%d/%s, rhs=%d/%s]",
-				lhs->_type, lhs->toString().c_str(), rhs->_type, rhs->toString().c_str());
+			error("UNHANDLED CASE: [lhs=%s/%s, rhs=%s/%s]",
+				operandTypeToStr(lhs->_type), lhs->toString().c_str(), operandTypeToStr(rhs->_type), rhs->toString().c_str());
 		}
 		if (!strcmp(op, ">>")) {
 			result = !result;
@@ -847,7 +866,7 @@ bool Script::evalClickEquality(Operand *lhs, Operand *rhs, bool partialMatch) {
 		str.toLowercase();
 
 		debug(9, "evalClickEquality(%s, %s, %d)", lhs->_value.designed->_name.c_str(), rhs->_value.designed->_name.c_str(), partialMatch);
-		debug(9, "l: %d r: %d (ch: %d ob: %d)", lhs->_type, rhs->_type, CHR, OBJ);
+		debug(9, "l: %s r: %s)", operandTypeToStr(lhs->_type), operandTypeToStr(rhs->_type));
 		debug(9, "class: %d", lhs->_value.inputClick->_classType);
 
 		if (lhs->_value.inputClick->_classType == CHR || lhs->_value.inputClick->_classType == OBJ) {


Commit: 64e21078dae76e900ed2c8e338e27fe57b4cae4d
    https://github.com/scummvm/scummvm/commit/64e21078dae76e900ed2c8e338e27fe57b4cae4d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-02-23T11:18:44+01:00

Commit Message:
WAGE: Fix crash when border is off-screen. Bug Hunt was affected.

Changed paths:
    engines/wage/gui.cpp



diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index afb30c7..9c80435 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -395,6 +395,14 @@ void Gui::paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowTy
 		font->drawString(g, _scene->_name, x + (width - w) / 2 + 5, y + yOff, w, kColorBlack);
 	}
 
+	if (x < 0) {
+		width += x;
+		x = 0;
+	}
+	if (y < 0) {
+		height += y;
+		y = 0;
+	}
 	if (x + width > _screen.w)
 		width = _screen.w - x;
 	if (y + height > _screen.h)






More information about the Scummvm-git-logs mailing list