aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/support')
-rw-r--r--engines/titanic/support/simple_file.cpp15
-rw-r--r--engines/titanic/support/simple_file.h10
2 files changed, 25 insertions, 0 deletions
diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
index fccf6c5b4f..88d74a9f47 100644
--- a/engines/titanic/support/simple_file.cpp
+++ b/engines/titanic/support/simple_file.cpp
@@ -213,6 +213,16 @@ Rect SimpleFile::readRect() {
return r;
}
+Rect SimpleFile::readBounds() {
+ Rect r;
+ r.left = readNumber();
+ r.top = readNumber();
+ r.setWidth(readNumber());
+ r.setHeight(readNumber());
+
+ return r;
+}
+
void SimpleFile::readBuffer(char *buffer, size_t count) {
CString tempString = readString();
if (buffer) {
@@ -309,6 +319,11 @@ void SimpleFile::writeRect(const Rect &r, int indent) {
writePoint(Point(r.right, r.bottom), indent);
}
+void SimpleFile::writeBounds(const Rect &r, int indent) {
+ writePoint(Point(r.left, r.top), indent);
+ writePoint(Point(r.width(), r.height()), indent);
+}
+
void SimpleFile::writeIndent(uint indent) {
for (uint idx = 0; idx < indent; ++idx)
write("\t", 1);
diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h
index 0ba7699088..115e3805da 100644
--- a/engines/titanic/support/simple_file.h
+++ b/engines/titanic/support/simple_file.h
@@ -112,6 +112,11 @@ public:
Rect readRect();
/**
+ * Rect in a bounds
+ */
+ Rect readBounds();
+
+ /**
* Read a string and copy it into an optionally passed buffer
*/
void readBuffer(char *buffer = nullptr, size_t count = 0);
@@ -167,6 +172,11 @@ public:
void writeRect(const Rect &r, int indent);
/**
+ * Write out a bounds line
+ */
+ void writeBounds(const Rect &r, int indent);
+
+ /**
* Write out a number of tabs to form an indent in the output
*/
void writeIndent(uint indent);