summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/glwrapper-ogl.cc
diff options
context:
space:
mode:
authorEnne Walker <enne.walker@gmail.com>2010-05-14 12:50:55 -0400
committerEnne Walker <enne.walker@gmail.com>2010-05-14 18:18:54 -0400
commita9d79ac529bee0a27b15aaec8124ac324fc21389 (patch)
tree698fe7ee083ef6fc7a5ca6f8ff307925178464e7 /crawl-ref/source/glwrapper-ogl.cc
parent6d0f71ae6f14191940493c0b7465230b1d6c4210 (diff)
downloadcrawl-ref-a9d79ac529bee0a27b15aaec8124ac324fc21389.tar.gz
crawl-ref-a9d79ac529bee0a27b15aaec8124ac324fc21389.zip
Add "current colour" to GLState.
This simplifies code that was setting and unsetting the global current colour manually.
Diffstat (limited to 'crawl-ref/source/glwrapper-ogl.cc')
-rw-r--r--crawl-ref/source/glwrapper-ogl.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/crawl-ref/source/glwrapper-ogl.cc b/crawl-ref/source/glwrapper-ogl.cc
index 9002e568cd..889cefc189 100644
--- a/crawl-ref/source/glwrapper-ogl.cc
+++ b/crawl-ref/source/glwrapper-ogl.cc
@@ -123,6 +123,12 @@ void OGLStateManager::set(const GLState& state)
glDisable(GL_ALPHA_TEST);
}
+ if (state.colour != m_current_state.colour)
+ {
+ glColor4f(state.colour.r, state.colour.g,
+ state.colour.b, state.colour.a);
+ }
+
m_current_state = state;
}
@@ -209,16 +215,6 @@ void OGLStateManager::reset_view_for_redraw(float x, float y)
glTranslatef(x, y , 1.0f);
}
-void OGLStateManager::set_current_color(GLW_3VF &color)
-{
- glColor3f(color.r, color.g, color.b);
-}
-
-void OGLStateManager::set_current_color(VColour &color)
-{
- glColor4f(color.r, color.g, color.b, color.a);
-}
-
/////////////////////////////////////////////////////////////////////////////
// OGLShapeBuffer