diff options
Diffstat (limited to 'src/game.c')
-rw-r--r-- | src/game.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -98,7 +98,7 @@ void DrawEntitySprite(const Entity* e, int spriteIndex) { srcRect.width = -srcRect.width; if (drawnSprite->flipY) - srcRect.height = -srcRect.width; + srcRect.height = -srcRect.height; DrawTexturePro(drawnSprite->texture, srcRect, destRect, origin, rotation, WHITE); } @@ -128,14 +128,17 @@ void DrawEntitiesInLayer(Entity* drawOrder[], int layer) { } } -void DrawGame() { - Entity* drawOrder[MAX_ENTITY_COUNT]; - +static inline void FillDrawOrder(Entity* drawOrder[]) { for (int i = 0; i < MAX_ENTITY_COUNT; i++) { drawOrder[i] = &game.entities[i]; } qsort(drawOrder, MAX_ENTITY_COUNT, sizeof(Entity*), compare); +} + +void DrawGame() { + Entity* drawOrder[MAX_ENTITY_COUNT]; + FillDrawOrder(drawOrder); BeginDrawing(); ClearBackground(RAYWHITE); |