Remove texture from DrawData
This commit is contained in:
@@ -14,7 +14,6 @@ typedef enum GameScreen {
|
||||
} GameScreen;
|
||||
|
||||
typedef struct DrawData {
|
||||
Texture tex;
|
||||
Rectangle src;
|
||||
Rectangle dst;
|
||||
Vector2 origin;
|
||||
|
||||
@@ -381,7 +381,6 @@ static void renderGame(Game *game, float dt) {
|
||||
if (t[i].flipX) src.width *= -1.0f;
|
||||
if (t[i].flipY) src.height *= -1.0f;
|
||||
drawData[drawIdx++] = (DrawData) {
|
||||
.tex = t[i].texture,
|
||||
.src = src,
|
||||
.dst = dst,
|
||||
.origin = origin,
|
||||
@@ -392,9 +391,10 @@ static void renderGame(Game *game, float dt) {
|
||||
BZ_ASSERT(drawIdx == numDraws);
|
||||
qsort(drawData, numDraws, sizeof(*drawData), cmpDrawData);
|
||||
|
||||
Texture2D tex = game->tileset.tiles;
|
||||
for (i32 i = 0; i < numDraws; i++) {
|
||||
DrawData draw = drawData[i];
|
||||
DrawTexturePro(draw.tex, draw.src, draw.dst, draw.origin, draw.rotation, WHITE);
|
||||
DrawTexturePro(tex, draw.src, draw.dst, draw.origin, draw.rotation, WHITE);
|
||||
}
|
||||
Vector2 target = GetMousePosition();
|
||||
target = GetScreenToWorld2D(target, game->camera);
|
||||
|
||||
Reference in New Issue
Block a user