diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-04-07 22:41:55 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-04-07 22:41:55 +0100 |
commit | 6d410918675effd76c5b30f6dbe5b6f4b9154708 (patch) | |
tree | 0be71c70001c5fbfaf9766e961b909825cf4f7eb /src | |
parent | afe623ba793f9f4c51f94abe6464020d22387c9d (diff) | |
download | YAGE-6d410918675effd76c5b30f6dbe5b6f4b9154708.tar.gz YAGE-6d410918675effd76c5b30f6dbe5b6f4b9154708.zip |
fixed spritebatch
Diffstat (limited to 'src')
-rw-r--r-- | src/spritebatch.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/spritebatch.cpp b/src/spritebatch.cpp index 8a08ea86..d09b663b 100644 --- a/src/spritebatch.cpp +++ b/src/spritebatch.cpp @@ -18,8 +18,8 @@ Glyph::Glyph(GLuint texture, float depth, const Vertex &top_left, const Vertex & {} RenderBatch::RenderBatch(GLint offset, GLsizei num_vertices, GLuint texture) : - offset_(offset), num_vertices_(num_vertices), + offset_(offset), texture_(texture) {} @@ -129,7 +129,7 @@ void SpriteBatch::createRenderBatches() std::vector<Vertex> vertices; if(glyph_ptrs_.empty()) return; - + render_batches_.reserve(glyph_ptrs_.size()*NUM_VERTICES); for(int i=0; i<(int)glyph_ptrs_.size(); ++i) @@ -137,7 +137,7 @@ void SpriteBatch::createRenderBatches() if(i==0 || (i>0 && (glyph_ptrs_[i]->texture()!=glyph_ptrs_[i-1]->texture()))) render_batches_.emplace_back(i*NUM_VERTICES, NUM_VERTICES, glyph_ptrs_[i]->texture()); else - render_batches_.back().offset_+=NUM_VERTICES; + render_batches_.back().num_vertices_+=NUM_VERTICES; vertices.push_back(glyph_ptrs_[i]->bottom_left()); vertices.push_back(glyph_ptrs_[i]->top_left()); |