Partial tower implementation
This commit is contained in:
10
game/main.c
10
game/main.c
@@ -88,10 +88,13 @@ bool bzMain(BzAppDesc *appDesc, int argc, const char **argv) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int cmpDrawData(const void *a, const void *b) {
|
||||
static int cmpDrawData(const void *a, const void *b) {
|
||||
const DrawData *lhs = (DrawData *) a;
|
||||
const DrawData *rhs = (DrawData *) b;
|
||||
|
||||
if (lhs->layer != rhs->layer)
|
||||
return lhs->layer - rhs->layer;
|
||||
|
||||
f32 dif = (rhs->dst.y) - (lhs->dst.y);
|
||||
int cmpVal = 0;
|
||||
if (dif < 0) cmpVal = 1;
|
||||
@@ -499,11 +502,16 @@ static void renderGame(Game *game, float dt) {
|
||||
src.height -= 0.02f;
|
||||
if (t[i].flipX) src.width *= -1.0f;
|
||||
if (t[i].flipY) src.height *= -1.0f;
|
||||
u8 drawLayer = 0;
|
||||
if (ecs_has(ECS, it.entities[i], DrawLayer)) {
|
||||
drawLayer = *ecs_get(ECS, it.entities[i], DrawLayer);
|
||||
}
|
||||
DrawData draw = (DrawData) {
|
||||
.src = src,
|
||||
.dst = dst,
|
||||
.origin = origin,
|
||||
.rotation = r[i],
|
||||
.layer = drawLayer,
|
||||
.canHaveAlpha = true,
|
||||
};
|
||||
if (ecs_has_id(ECS, it.entities[i], ecs_id(Unit))) {
|
||||
|
||||
Reference in New Issue
Block a user