Browse Source

Fix drawing with >= 16k sprites in a spritebatch on desktops.

--HG--
branch : minor
Alex Szpakowski 8 years ago
parent
commit
b7dde8712a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/modules/graphics/Buffer.cpp

+ 2 - 2
src/modules/graphics/Buffer.cpp

@@ -50,7 +50,7 @@ Buffer *QuadIndices::indexBuffer = nullptr;
 char *QuadIndices::indices = nullptr;
 
 QuadIndices::QuadIndices(Graphics *gfx, size_t size)
-: size(size)
+	: size(size)
 {
 	// The upper limit is the maximum of uint32 divided by six (the number
 	// of indices per size) and divided by the size of uint32. This guarantees
@@ -148,7 +148,7 @@ size_t QuadIndices::getIndexCount(size_t elements) const
 
 IndexDataType QuadIndices::getType(size_t s) const
 {
-	return vertex::getIndexDataTypeFromMax(s);
+	return vertex::getIndexDataTypeFromMax(getIndexCount(s));
 }
 
 size_t QuadIndices::getElementSize()