summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/matrix.h
diff options
context:
space:
mode:
authorEnne Walker <ennewalker@users.sourceforge.net>2009-11-28 18:06:49 -0500
committerEnne Walker <ennewalker@users.sourceforge.net>2009-11-28 20:53:42 -0500
commit4fe67e14cab6affd2a69a864dda356440d50e0ca (patch)
tree47da4f5b30a1534a818aedfd7ea92ea0995268ca /crawl-ref/source/matrix.h
parent13d037ff0e1c6394157ab5ccf5593458a167447a (diff)
downloadcrawl-ref-4fe67e14cab6affd2a69a864dda356440d50e0ca.tar.gz
crawl-ref-4fe67e14cab6affd2a69a864dda356440d50e0ca.zip
Subvaults.
Vaults can now include other vaults as a part of their definition. These subvaults are currently included by tag only and replace glyphs in their parent vault. See documentation for more details. Vault:8 has been modified to use subvaults.
Diffstat (limited to 'crawl-ref/source/matrix.h')
-rw-r--r--crawl-ref/source/matrix.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/matrix.h b/crawl-ref/source/matrix.h
index 520711ca88..311602cfdc 100644
--- a/crawl-ref/source/matrix.h
+++ b/crawl-ref/source/matrix.h
@@ -16,21 +16,24 @@ public:
void init(const Z &initial);
Z &operator () (int x, int y)
{
- return data[x + y * width];
+ return data[x + y * mwidth];
}
const Z &operator () (int x, int y) const
{
- return data[x + y * width];
+ return data[x + y * mwidth];
}
+ int width() const { return mwidth; }
+ int height() const { return mheight; }
+
private:
Z *data;
- int width, height, size;
+ int mwidth, mheight, size;
};
template <typename Z>
Matrix<Z>::Matrix(int _width, int _height, const Z &initial)
- : data(NULL), width(_width), height(_height), size(_width * _height)
+ : data(NULL), mwidth(_width), mheight(_height), size(_width * _height)
{
data = new Z [ size ];
init(initial);
@@ -38,7 +41,7 @@ Matrix<Z>::Matrix(int _width, int _height, const Z &initial)
template <typename Z>
Matrix<Z>::Matrix(int _width, int _height)
- : data(NULL), width(_width), height(_height), size(_width * _height)
+ : data(NULL), mwidth(_width), mheight(_height), size(_width * _height)
{
data = new Z [ size ];
}