diff options
author | Paul Gilbert | 2016-04-05 20:15:14 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-04-05 20:15:14 -0400 |
commit | 4f46928444acb1da4e7cd31ac816ad6c9e7c265d (patch) | |
tree | 1a6dcfa462f24383004b61a9e8c8698e7c5c4dbe /engines/titanic/support | |
parent | 6f8de06ddb210f71f611e2cfcee106832d100a78 (diff) | |
download | scummvm-rg350-4f46928444acb1da4e7cd31ac816ad6c9e7c265d.tar.gz scummvm-rg350-4f46928444acb1da4e7cd31ac816ad6c9e7c265d.tar.bz2 scummvm-rg350-4f46928444acb1da4e7cd31ac816ad6c9e7c265d.zip |
TITANIC: Fix loading of game object bounds
Diffstat (limited to 'engines/titanic/support')
-rw-r--r-- | engines/titanic/support/simple_file.cpp | 15 | ||||
-rw-r--r-- | engines/titanic/support/simple_file.h | 10 |
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); |