From 43d6d49e2edcb85ee4dbcdfb93b396c7dcfbbffa Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Thu, 1 Dec 2011 23:55:40 +0100 Subject: MOHAWK: Handle LB conversion from string to point/rect. --- engines/mohawk/livingbooks_code.cpp | 14 ++++++++++---- 1 file 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: -- cgit v1.2.3