aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Milburn2011-12-01 23:55:40 +0100
committerAlyssa Milburn2011-12-01 23:55:40 +0100
commit43d6d49e2edcb85ee4dbcdfb93b396c7dcfbbffa (patch)
treefd4d9758095038dca79b3b10699fbd4acdd3e80a
parent3a2bd43c7560542cd5de6b1eae28a5af99ac985a (diff)
downloadscummvm-rg350-43d6d49e2edcb85ee4dbcdfb93b396c7dcfbbffa.tar.gz
scummvm-rg350-43d6d49e2edcb85ee4dbcdfb93b396c7dcfbbffa.tar.bz2
scummvm-rg350-43d6d49e2edcb85ee4dbcdfb93b396c7dcfbbffa.zip
MOHAWK: Handle LB conversion from string to point/rect.
-rw-r--r--engines/mohawk/livingbooks_code.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index caf00c7129..d0feffde35 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -101,8 +101,11 @@ double LBValue::toDouble() const {
Common::Point LBValue::toPoint() const {
switch (type) {
case kLBValueString:
- // FIXME
- return Common::Point();
+ {
+ Common::Point ret;
+ sscanf(string.c_str(), "%hd , %hd", &ret.x, &ret.y);
+ return ret;
+ }
case kLBValueInteger:
return Common::Point(integer, integer);
case kLBValuePoint:
@@ -117,8 +120,11 @@ Common::Point LBValue::toPoint() const {
Common::Rect LBValue::toRect() const {
switch (type) {
case kLBValueString:
- // FIXME
- return Common::Rect();
+ {
+ Common::Rect ret;
+ sscanf(string.c_str(), "%hd , %hd , %hd , %hd", &ret.left, &ret.top, &ret.right, &ret.bottom);
+ return ret;
+ }
case kLBValueInteger:
return Common::Rect(integer, integer, integer, integer);
case kLBValuePoint: