feat: Hitbox drawing
This commit is contained in:
@@ -30,6 +30,7 @@ struct G_Editor {
|
||||
S32 currentAsset;
|
||||
G_EDITOR_MODE mode;
|
||||
V2f cursor;
|
||||
V2f dragStart;
|
||||
};
|
||||
|
||||
typedef struct G_State G_State;
|
||||
|
||||
@@ -37,13 +37,15 @@ void ProcessEvents(SDL_Event *event, World *world)
|
||||
}
|
||||
|
||||
void RenderWorld(World *world, D_Context *draw) {
|
||||
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,
|
||||
);
|
||||
if(world->player.currentArea == WORLD_AREA_OUTSIDE) {
|
||||
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) {
|
||||
|
||||
@@ -50,6 +50,8 @@ struct World {
|
||||
World_PropType propTypes[64];
|
||||
U32 propCount;
|
||||
World_Prop props[256];
|
||||
U32 hitboxCount;
|
||||
AABB hitboxes[4096];
|
||||
|
||||
//// Player
|
||||
Player player;
|
||||
|
||||
Reference in New Issue
Block a user