summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/glwrapper.h
diff options
context:
space:
mode:
authorEnne Walker <enne.walker@gmail.com>2010-05-14 15:28:43 -0400
committerEnne Walker <enne.walker@gmail.com>2010-05-14 18:18:55 -0400
commit39dd31c724d8e2eeb6cdb479da2cff7c8fa8f5c2 (patch)
tree85b469f2588408e73f98a77bb9a80c121c7b9078 /crawl-ref/source/glwrapper.h
parent46bd9b7116d87b6ebd461b75deefd767fa96895b (diff)
downloadcrawl-ref-39dd31c724d8e2eeb6cdb479da2cff7c8fa8f5c2.tar.gz
crawl-ref-39dd31c724d8e2eeb6cdb479da2cff7c8fa8f5c2.zip
Clean up storage of vertex colours in GLWRect.
Storing member variable pointers to data, even const ones, is sketchy. Better to depend on compiler optimizations to eliminate redundant variable copies.
Diffstat (limited to 'crawl-ref/source/glwrapper.h')
-rw-r--r--crawl-ref/source/glwrapper.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/crawl-ref/source/glwrapper.h b/crawl-ref/source/glwrapper.h
index 44bc9dfec8..c7b96d5067 100644
--- a/crawl-ref/source/glwrapper.h
+++ b/crawl-ref/source/glwrapper.h
@@ -98,7 +98,7 @@ struct GLWRect
GLWRect(float sx, float sy, float ex, float ey, float z = 0.0f) :
pos_sx(sx), pos_sy(sy), pos_ex(ex), pos_ey(ey), pos_z(z),
tex_sx(0.0f), tex_sy(0.0f), tex_ex(0.0f), tex_ey(0.0f),
- col_bl(NULL), col_br(NULL), col_tl(NULL), col_tr(NULL) {}
+ col_s(VColour::white), col_e(VColour::white) {}
inline void set_tex(float sx, float sy, float ex, float ey)
{
@@ -108,21 +108,21 @@ struct GLWRect
tex_ey = ey;
}
- inline void set_col(VColour const *bl, VColour const *br,
- VColour const *tl, VColour const *tr)
+ inline void set_col(const VColour &vc)
{
- col_bl = bl;
- col_br = br;
- col_tl = tl;
- col_tr = tr;
+ col_s = vc;
+ col_e = vc;
+ }
+
+ inline void set_col(const VColour &s, const VColour &e)
+ {
+ col_s = s;
+ col_e = e;
}
float pos_sx, pos_sy, pos_ex, pos_ey, pos_z;
float tex_sx, tex_sy, tex_ex, tex_ey;
- VColour const *col_bl;
- VColour const *col_br;
- VColour const *col_tl;
- VColour const *col_tr;
+ VColour col_s, col_e;
};
// This struct defines all of the state that any particular rendering needs.