feat: Basic level editing
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user