aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/simple_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/simple_file.cpp')
-rw-r--r--engines/titanic/simple_file.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index 521f9e9b99..045de1fe07 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -191,6 +191,24 @@ double SimpleFile::readFloat() {
return floatValue;
}
+Common::Point SimpleFile::readPoint() {
+ Common::Point pt;
+ pt.x = readNumber();
+ pt.y = readNumber();
+
+ return pt;
+}
+
+Common::Rect SimpleFile::readRect() {
+ Common::Rect r;
+ r.left = readNumber();
+ r.top = readNumber();
+ r.right = readNumber();
+ r.bottom = readNumber();
+
+ return r;
+}
+
void SimpleFile::readBuffer(char *buffer, size_t count) {
CString tempString = readString();
if (buffer) {
@@ -264,6 +282,18 @@ void SimpleFile::writeNumberLine(int val, int indent) {
write("\n", 1);
}
+void SimpleFile::writePoint(const Common::Point &pt, int indent) {
+ writeIndent(indent);
+ writeNumber(pt.x);
+ writeNumber(pt.y);
+ write("\n", 1);
+}
+
+void SimpleFile::writeRect(const Common::Rect &r, int indent) {
+ writePoint(Common::Point(r.left, r.top), indent);
+ writePoint(Common::Point(r.right, r.bottom), indent);
+}
+
void SimpleFile::writeIndent(uint indent) {
for (uint idx = 0; idx < indent; ++idx)
write("\t", 1);