From b7dde8712a73c75fb87df93088fc9d4de9e1ff05 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 20 Feb 2017 15:46:43 -0400 Subject: [PATCH] Fix drawing with >= 16k sprites in a spritebatch on desktops. --HG-- branch : minor --- src/modules/graphics/Buffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/graphics/Buffer.cpp b/src/modules/graphics/Buffer.cpp index 4ad7377d6..eeddcfde2 100644 --- a/src/modules/graphics/Buffer.cpp +++ b/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()