summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorEnne Walker <enne.walker@gmail.com>2010-05-09 23:03:25 -0400
committerEnne Walker <enne.walker@gmail.com>2010-05-14 18:18:53 -0400
commit5f37332d3f99cae46f5a84ebb5b4af1a644ee774 (patch)
tree5befe0a34f64469eae1ac0aad7d13f365a1dc949 /crawl-ref/source
parente9233e8c0fc4cf32b0a1c45d9d8170904cc45f14 (diff)
downloadcrawl-ref-5f37332d3f99cae46f5a84ebb5b4af1a644ee774.tar.gz
crawl-ref-5f37332d3f99cae46f5a84ebb5b4af1a644ee774.zip
Rename vert buffer 'push' to 'add' for clarity.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/fontwrapper-ft.cc8
-rw-r--r--crawl-ref/source/glwrapper-ogl.cc11
-rw-r--r--crawl-ref/source/glwrapper-ogl.h9
-rw-r--r--crawl-ref/source/glwrapper.h9
-rw-r--r--crawl-ref/source/tilebuf.cc16
-rw-r--r--crawl-ref/source/tilebuf.h2
-rw-r--r--crawl-ref/source/tilereg-title.cc2
7 files changed, 27 insertions, 30 deletions
diff --git a/crawl-ref/source/fontwrapper-ft.cc b/crawl-ref/source/fontwrapper-ft.cc
index d0540184cc..d31277e95e 100644
--- a/crawl-ref/source/fontwrapper-ft.cc
+++ b/crawl-ref/source/fontwrapper-ft.cc
@@ -276,7 +276,7 @@ void FTFontWrapper::render_textblock(unsigned int x_pos, unsigned int y_pos,
term_colours[col_bg].g,
term_colours[col_bg].b);
rect.set_col(&col, &col, &col, &col);
- m_buf->push(rect);
+ m_buf->add(rect);
}
adv.x += m_glyphs[c].offset;
@@ -298,7 +298,7 @@ void FTFontWrapper::render_textblock(unsigned int x_pos, unsigned int y_pos,
rect.set_col(&col, &col, &col, &col);
rect.set_tex(tex_x, tex_y, tex_x2, tex_y2);
- m_buf->push(rect);
+ m_buf->add(rect);
}
i++;
@@ -361,7 +361,7 @@ static void _draw_box(int x_pos, int y_pos, float width, float height,
box_alpha);
rect.set_col(&colour, &colour, &colour, &colour);
- buf->push(rect);
+ buf->add(rect);
// Load identity matrix
glmanager->set_transform();
@@ -666,7 +666,7 @@ void FTFontWrapper::store(FontBuffer &buf, float &x, float &y,
GLWRect rect(pos_sx, pos_sy, pos_ex, pos_ey);
rect.set_tex(tex_sx, tex_sy, tex_ex, tex_ey);
rect.set_col(&col, &col, &col, &col);
- buf.push(rect);
+ buf.add_primitive(rect);
x += m_glyphs[c].advance;
}
diff --git a/crawl-ref/source/glwrapper-ogl.cc b/crawl-ref/source/glwrapper-ogl.cc
index 3d729fb491..d24bd5b55d 100644
--- a/crawl-ref/source/glwrapper-ogl.cc
+++ b/crawl-ref/source/glwrapper-ogl.cc
@@ -239,16 +239,15 @@ unsigned int OGLShapeBuffer::size() const
return (m_position_buffer.size());
}
-// Add a rectangle
-void OGLShapeBuffer::push(const GLWRect &rect)
+void OGLShapeBuffer::add(const GLWRect &rect)
{
switch (m_prim_type)
{
case GLW_RECTANGLE:
- push_rect(rect);
+ add_rect(rect);
break;
case GLW_LINES:
- push_line(rect);
+ add_line(rect);
break;
default:
ASSERT(!"Invalid primitive type");
@@ -256,7 +255,7 @@ void OGLShapeBuffer::push(const GLWRect &rect)
}
}
-void OGLShapeBuffer::push_rect(const GLWRect &rect)
+void OGLShapeBuffer::add_rect(const GLWRect &rect)
{
// Copy vert positions
size_t last = m_position_buffer.size();
@@ -324,7 +323,7 @@ void OGLShapeBuffer::push_rect(const GLWRect &rect)
}
}
-void OGLShapeBuffer::push_line(const GLWRect &rect)
+void OGLShapeBuffer::add_line(const GLWRect &rect)
{
// Copy vert positions
size_t last = m_position_buffer.size();
diff --git a/crawl-ref/source/glwrapper-ogl.h b/crawl-ref/source/glwrapper-ogl.h
index a41d2a7a71..6d5555f69d 100644
--- a/crawl-ref/source/glwrapper-ogl.h
+++ b/crawl-ref/source/glwrapper-ogl.h
@@ -39,18 +39,17 @@ public:
OGLShapeBuffer(bool texture = false, bool colour = false,
drawing_modes prim = GLW_RECTANGLE);
- // Accounting
virtual const char *print_statistics() const;
virtual unsigned int size() const;
- virtual void push(const GLWRect &rect);
+ virtual void add(const GLWRect &rect);
virtual void draw(GLW_3VF *pt = NULL, GLW_3VF *ps = NULL);
virtual void clear();
protected:
- // Helper methods for pushing specific prim types
- void push_rect(const GLWRect &rect);
- void push_line(const GLWRect &rect);
+ // Helper methods for adding specific primitives.
+ void add_rect(const GLWRect &rect);
+ void add_line(const GLWRect &rect);
drawing_modes m_prim_type;
bool m_texture_verts;
diff --git a/crawl-ref/source/glwrapper.h b/crawl-ref/source/glwrapper.h
index 09bbc8abbe..4792f00087 100644
--- a/crawl-ref/source/glwrapper.h
+++ b/crawl-ref/source/glwrapper.h
@@ -234,17 +234,16 @@ public:
static GLShapeBuffer *create(bool texture = false, bool colour = false,
drawing_modes prim = GLW_RECTANGLE);
- // Accounting
virtual const char *print_statistics() const = 0;
virtual unsigned int size() const = 0;
- // Add a rectangle or line
- virtual void push(const GLWRect &rect) = 0;
+ // Add a primitive to be drawn.
+ virtual void add(const GLWRect &rect) = 0;
- // Draw the buffer
+ // Draw all the primitives in the buffer.
virtual void draw(GLW_3VF *pt = NULL, GLW_3VF *ps = NULL) = 0;
- // Manipulate state
+ // Clear all the primitives from the buffer.
virtual void clear() = 0;
};
diff --git a/crawl-ref/source/tilebuf.cc b/crawl-ref/source/tilebuf.cc
index 4023db7a74..110f1a98a7 100644
--- a/crawl-ref/source/tilebuf.cc
+++ b/crawl-ref/source/tilebuf.cc
@@ -45,7 +45,7 @@ void VertBuffer::draw(GLW_3VF *pt, GLW_3VF *ps) const
// render m_tile_buf[2] which, before the item description table
// is created, will be bound to a texture that has not been loaded.
// It never crashes, though, because m_tile_buf[2] will always be
- // empty (no pushed verts) before you start a game. -- ixtli
+ // empty (no verts) before you start a game. -- ixtli
if (size() == 0)
return;
@@ -79,9 +79,9 @@ void VertBuffer::clear()
m_vert_buf->clear();
}
-void VertBuffer::push(const GLWRect &rect)
+void VertBuffer::add_primitive(const GLWRect &rect)
{
- m_vert_buf->push(rect);
+ m_vert_buf->add(rect);
}
unsigned int VertBuffer::size() const
@@ -146,7 +146,7 @@ void TileBuffer::add_unscaled(int idx, float x, float y, int ymax)
GLWRect rect(pos_sx, pos_sy, pos_ex, pos_ey);
rect.set_tex(tex_sx, tex_sy, tex_ex, tex_ey);
- push(rect);
+ add_primitive(rect);
}
void TileBuffer::add(int idx, int x, int y, int ox, int oy, bool centre, int ymax)
@@ -165,7 +165,7 @@ void TileBuffer::add(int idx, int x, int y, int ox, int oy, bool centre, int yma
GLWRect rect(pos_sx, pos_sy, pos_ex, pos_ey);
rect.set_tex(tex_sx, tex_sy, tex_ex, tex_ey);
- push(rect);
+ add_primitive(rect);
}
/////////////////////////////////////////////////////////////////////////////
@@ -226,7 +226,7 @@ void ColouredTileBuffer::add(int idx, int x, int y, int z,
GLWRect rect(pos_sx, pos_sy, pos_ex, pos_ey, pos_z);
rect.set_tex(tex_sx, tex_sy, tex_ex, tex_ey);
rect.set_col(&col_sy, &col_sy, &col_ey, &col_ey);
- push(rect);
+ add_primitive(rect);
}
/////////////////////////////////////////////////////////////////////////////
@@ -360,7 +360,7 @@ void ShapeBuffer::add(float pos_sx, float pos_sy, float pos_ex, float pos_ey,
{
GLWRect rect(pos_sx, pos_sy, pos_ex, pos_ey);
rect.set_col(&col, &col, &col, &col);
- push(rect);
+ add_primitive(rect);
}
/////////////////////////////////////////////////////////////////////////////
@@ -376,7 +376,7 @@ void LineBuffer::add(float pos_sx, float pos_sy, float pos_ex, float pos_ey,
{
GLWRect rect(pos_sx, pos_sy, pos_ex, pos_ey);
rect.set_col(&col, &col);
- push(rect);
+ add_primitive(rect);
}
void LineBuffer::add_square(float sx, float sy, float ex, float ey,
diff --git a/crawl-ref/source/tilebuf.h b/crawl-ref/source/tilebuf.h
index 006f1c81aa..039455fe5a 100644
--- a/crawl-ref/source/tilebuf.h
+++ b/crawl-ref/source/tilebuf.h
@@ -34,7 +34,7 @@ public:
// State Manipulation
void set_state(const GLState &state);
- void push(const GLWRect &rect);
+ void add_primitive(const GLWRect &rect);
void clear();
// Note: this could invalidate previous additions if they were
diff --git a/crawl-ref/source/tilereg-title.cc b/crawl-ref/source/tilereg-title.cc
index 1d2577c62c..c6eda2ee55 100644
--- a/crawl-ref/source/tilereg-title.cc
+++ b/crawl-ref/source/tilereg-title.cc
@@ -35,7 +35,7 @@ TitleRegion::TitleRegion(int width, int height, FontWrapper* font) :
GLWRect rect(0, 0, m_img.width(), m_img.height());
rect.set_tex(0, 0, 1, 1);
- m_buf.push(rect);
+ m_buf.add_primitive(rect);
}
void TitleRegion::render()