summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fontwrapper-ft.cc
diff options
context:
space:
mode:
authorEnne Walker <enne.walker@gmail.com>2010-05-14 18:14:29 -0400
committerEnne Walker <enne.walker@gmail.com>2010-05-14 18:18:55 -0400
commitead0fe703466d4c0045a30d793e9843cc1ef59e5 (patch)
treef8e7aa7e2aae01b8ade0a9d06f2f9f2651d805fc /crawl-ref/source/fontwrapper-ft.cc
parent451ecf4a58b193f3fb14b78108757ed6b91152fe (diff)
downloadcrawl-ref-ead0fe703466d4c0045a30d793e9843cc1ef59e5.tar.gz
crawl-ref-ead0fe703466d4c0045a30d793e9843cc1ef59e5.zip
Clean up GL code function parameters.
Remove any non-const-reference parameters. Change const pointer parameters to const reference parameters. Change all draw(NULL, NULL) calls to just draw(). Also, refactor to remove pretranslate and prescale parameters from draw calls.
Diffstat (limited to 'crawl-ref/source/fontwrapper-ft.cc')
-rw-r--r--crawl-ref/source/fontwrapper-ft.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/crawl-ref/source/fontwrapper-ft.cc b/crawl-ref/source/fontwrapper-ft.cc
index 0a5f8fa061..1323e1aab4 100644
--- a/crawl-ref/source/fontwrapper-ft.cc
+++ b/crawl-ref/source/fontwrapper-ft.cc
@@ -312,8 +312,6 @@ void FTFontWrapper::render_textblock(unsigned int x_pos, unsigned int y_pos,
if (!m_buf->size())
return;
- glmanager->reset_transform();
-
GLState state;
state.array_vertex = true;
state.array_texcoord = true;
@@ -324,6 +322,7 @@ void FTFontWrapper::render_textblock(unsigned int x_pos, unsigned int y_pos,
m_tex.bind();
GLW_3VF trans(x_pos, y_pos, 0.0f);
+ GLW_3VF scale(1, 1, 1);
if (drop_shadow)
{
@@ -332,11 +331,13 @@ void FTFontWrapper::render_textblock(unsigned int x_pos, unsigned int y_pos,
state_shadow.colour = VColour::black;
GLW_3VF trans_shadow(trans.x + 1, trans.y + 1, 0.0f);
+ glmanager->set_transform(trans_shadow, scale);
- m_buf->draw(state_shadow, &trans_shadow);
+ m_buf->draw(state_shadow);
}
- m_buf->draw(state, &trans);
+ glmanager->set_transform(trans, scale);
+ m_buf->draw(state);
}
static void _draw_box(int x_pos, int y_pos, float width, float height,
@@ -356,7 +357,7 @@ static void _draw_box(int x_pos, int y_pos, float width, float height,
buf->add(rect);
// Load identity matrix
- glmanager->set_transform();
+ glmanager->reset_transform();
GLState state;
state.array_vertex = true;