[cpp] Fix rendererObject assignment in sequence loading code

This commit is contained in:
Mario Zechner 2024-07-01 16:24:18 +02:00
parent e12b71bb1a
commit e9aab1c94e
3 changed files with 2 additions and 4 deletions

View File

@ -50,7 +50,6 @@ namespace spine {
String path = sequence->getPath(basePath, i);
regions[i] = atlas->findRegion(path);
if (!regions[i]) return false;
regions[i]->rendererObject = regions[i];
}
return true;
}

View File

@ -787,7 +787,6 @@ int main() {
testcase(spineboy, "data/spineboy-pro.json", "data/spineboy-pro.skel", "data/spineboy-pma.atlas", 0.62f);
testcase(ikDemo, "data/spineboy-pro.json", "data/spineboy-pro.skel", "data/spineboy-pma.atlas", 0.6f);
testcase(vine, "data/vine-pro.json", "data/vine-pro.skel", "data/vine-pma.atlas", 0.5f);
testcase(dragon, "data/dragon-ess.json", "data/dragon-ess.skel", "data/dragon-pma.atlas", 0.6f);
testcase(owl, "data/owl-pro.json", "data/owl-pro.skel", "data/owl-pma.atlas", 0.5f);
testcase(coin, "data/coin-pro.json", "data/coin-pro.skel", "data/coin-pma.atlas", 0.5f);
testcase(raptor, "data/raptor-pro.json", "data/raptor-pro.skel", "data/raptor-pma.atlas", 0.5f);

View File

@ -90,13 +90,13 @@ void SkeletonDrawable::draw(RenderTarget &target, RenderStates states) const {
if (!skeletonRenderer) skeletonRenderer = new (__FILE__, __LINE__) SkeletonRenderer();
RenderCommand *command = skeletonRenderer->render(*skeleton);
while (command) {
Texture *texture = (Texture *)command->texture;
Vector2u size = texture->getSize();
Vertex vertex;
float *positions = command->positions;
float *uvs = command->uvs;
uint32_t *colors = command->colors;
uint16_t *indices = command->indices;
Texture *texture = (Texture *)command->texture;
Vector2u size = texture->getSize();
for (int i = 0, n = command->numIndices; i < n; ++i) {
int ii = indices[i];
int index = ii << 1;