Ensure width and height of entities is set.

This commit is contained in:
Steve 2015-11-02 13:34:59 +00:00
parent 61068f04f4
commit ef1d0b4f4a
1 changed files with 4 additions and 0 deletions

View File

@ -318,6 +318,8 @@ static void loadEntities(cJSON *node)
{
e->flags = flagsToLong(cJSON_GetObjectItem(node, "flags")->valuestring);
}
SDL_QueryTexture(e->texture, NULL, NULL, &e->w, &e->h);
node = node->next;
}
@ -375,6 +377,8 @@ static void loadEntityGroups(cJSON *node)
e->x += (rand() % scatter) - (rand() % scatter);
e->y += (rand() % scatter) - (rand() % scatter);
SDL_QueryTexture(e->texture, NULL, NULL, &e->w, &e->h);
}
node = node->next;