diff options
Diffstat (limited to 'engines/bladerunner/regions.cpp')
-rw-r--r-- | engines/bladerunner/regions.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/engines/bladerunner/regions.cpp b/engines/bladerunner/regions.cpp new file mode 100644 index 0000000000..fe817e074b --- /dev/null +++ b/engines/bladerunner/regions.cpp @@ -0,0 +1,47 @@ +#include "bladerunner/regions.h" + +namespace BladeRunner { + Regions::Regions() { + _enabled = true; + _regions = new Region[10]; + } + + Regions::~Regions() { + delete[] _regions; + } + + bool Regions::add(int index, Common::Rect rect, int type) { + if (index <= 0 || index >= 10) + return false; + + if (_regions[index]._present) + return false; + + _regions[index]._rectangle = rect; + _regions[index]._type = type; + _regions[index]._present = 1; + + return true; + } + + bool Regions::remove(int index) { + if (index <= 0 || index >= 10) + return false; + + _regions[index]._rectangle = Common::Rect(-1, -1, -1, -1); + _regions[index]._type = -1; + _regions[index]._present = 0; + + return true; + } + + void BladeRunner::Regions::clear() { + int i; + for (i = 0; i < 10; i++) + remove(i); + } + + void Regions::setEnabled(bool enabled) { + _enabled = enabled; + } +}
\ No newline at end of file |