feat: Basic level editing

This commit is contained in:
2025-10-06 14:26:00 +01:00
parent 3e527f473b
commit 3a84947750
18 changed files with 242 additions and 34 deletions

View File

@@ -37,10 +37,24 @@ void ProcessEvents(SDL_Event *event, World *world)
}
void RenderWorld(World *world, D_Context *draw) {
World_Tile tileTypes[] = {dirt, middlePath, middlePathEdgeTop, middlePathEdgeRight, middlePathEdgeBottom, middlePathEdgeLeft, middlePathCornerTopLeft, middlePathCornerTopRight, middlePathCornerBottomRight, middlePathCornerTurnBottomLeft};
for (int i = 0; i < 4800; i++)
{
D_Rect(draw, (F32) (i % 96), (F32) (i / 96), .texture = tileTypes[map[i]].tile, .angle = (F32) tileTypes[map[i]].rotation);
for (int i = 0; i < 4800; i++) {
D_Rect(
draw,
(F32) (i % 96), (F32) (i / 96),
.texture = world->tileTypes[world->map[i]].tile,
.angle = (F32) world->tileTypes[world->map[i]].rotation,
);
}
for (int i = 0; i < world->propCount; i++) {
if(world->props[i].area == world->player.currentArea) {
D_Rect(
draw,
world->props[i].pos.x,
world->props[i].pos.y,
.texture = world->propTypes[world->props[i].propType].assetHandle,
.scale = world->propTypes[world->props[i].propType].scale,
);
}
}
for(U32 i = 0; i < world->npcCount; i++) {
NPC npc = world->npcs[i];