diff --git a/res/graphics/sound.ase b/res/graphics/sound.ase deleted file mode 100644 index 20b42cb3..00000000 --- a/res/graphics/sound.ase +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:47f0ff498681bd8e240fb2187823dfd5b1726a4bde3328455379138871471c7f -size 614 diff --git a/res/graphics/tim.ase b/res/graphics/tim.ase index d0aa5b98..70d39afb 100644 --- a/res/graphics/tim.ase +++ b/res/graphics/tim.ase @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:42234bae71a187445fe944b4658b630d981c1d8e7d7e61ae3fb7274297afbbd6 -size 5881 +oid sha256:2089ee4280aefb07b9f249f30bcdf7d8a3d3be4a04f5c7f41384657ed00ca2e0 +size 890 diff --git a/src/game.c b/src/game.c index e700c34f..8e2cc5e5 100644 --- a/src/game.c +++ b/src/game.c @@ -203,7 +203,7 @@ INTERNAL void game_update(void) struct v2 sprite_pivot; { - struct v2 sprite_pivot_norm = V2(0, 0.5); /* Pivot x & y are each normalized about sprite dimensions. <0, 0> is center, <1, 1> is bottom right corner, etc. */ + struct v2 sprite_pivot_norm = V2(0, 0); /* Pivot x & y are each normalized about sprite dimensions. <0, 0> is center, <1, 1> is bottom right corner, etc. */ struct v2 half_size = v2_mul(sprite_size, 0.5f); sprite_pivot = v2_mul_v2(sprite_pivot_norm, half_size); } @@ -231,60 +231,6 @@ INTERNAL void game_update(void) //entity_enable_prop(e, ENTITY_PROP_TEST_FOLLOW_MOUSE); } - /* Child ent */ - struct entity *parent = player_ent; - { - struct v2 pos = V2(0, 0.25); - struct v2 size = V2(1, 1); - f32 r = 0; - - struct entity *e = entity_alloc(&G.world.entity_store); - e->valid = true; - e->rel_xform = XFORM_TRS(.t = pos, .r = r, .s = size); - - struct v2 sprite_pos = V2(0, 0); - f32 sprite_rot = 0; - struct v2 sprite_size = V2(0.5f, 0.5f); - // struct v2 sprite_size = sprite_sheet_size_meters(sprite_sheet_tag); - - struct v2 sprite_pivot; - { - struct v2 sprite_pivot_norm = V2(0, 0.5); /* Pivot x & y are each normalized about sprite dimensions. <0, 0> is center, <1, 1> is bottom right corner, etc. */ - struct v2 half_size = v2_mul(sprite_size, 0.5f); - sprite_pivot = v2_mul_v2(sprite_pivot_norm, half_size); - } - - struct xform sprite_xf = XFORM_POS(sprite_pos); - sprite_xf = xform_rotate(sprite_xf, sprite_rot); - sprite_xf = xform_translate(sprite_xf, v2_neg(sprite_pivot)); - sprite_xf = xform_scale(sprite_xf, sprite_size); - e->sprite_quad_xform = sprite_xf; - - e->sprite = sprite_tag_from_path(STR("res/graphics/tim.ase"));; - e->sprite_span_name = STR("UNARMED"); - e->sprite_tint = RGBA_32_F(0.5, 0.5, 0, 1); - - //entity_enable_prop(e, ENTITY_PROP_PLAYER_CONTROLLED); - //e->player_max_speed = 5.f; - //e->player_acceleration = 15.0f; - - entity_enable_prop(e, ENTITY_PROP_ANIMATING); - - //entity_enable_prop(e, ENTITY_PROP_TEST); - - entity_link(&G.world.entity_store, parent, e); - - if (sys_rand_u32() % 2 == 0) { - u64 parent_idx = sys_rand_u32() % entity_store_as_array(&G.world.entity_store).count; - struct entity *rand_ent = entity_from_handle(&G.world.entity_store, (struct entity_handle) { .idx = parent_idx, .gen = 1 }); - if (rand_ent->valid) { - parent = rand_ent; - } else { - parent = e; - } - } - } - /* Camera ent */ { struct entity *e = entity_alloc(&G.world.entity_store); @@ -299,26 +245,6 @@ INTERNAL void game_update(void) f32 height = (f32)DEFAULT_CAMERA_HEIGHT; e->camera_quad_xform = XFORM_TRS(.s = V2(width, height)); } - - /* Sound ent */ - { - struct entity *e = entity_alloc(&G.world.entity_store); - e->valid = true; - e->rel_xform = XFORM_POS(V2(-3, -3)); - - struct v2 sprite_size = V2(0.25f, 0.25f); - // struct v2 sprite_size = sprite_sheet_size_meters(sprite_sheet_tag); - e->sprite_quad_xform = xform_with_scale(XFORM_IDENT, sprite_size); - - e->sprite = sprite_tag_from_path(STR("res/graphics/sound.ase"));; - e->sprite_tint = RGBA_32_F(1, 1, 0, 1); - - entity_enable_prop(e, ENTITY_PROP_TEST_SOUND_EMITTER); - e->sound_name = STR("res/sounds/test.mp3"); - e->sound_desc = MIXER_DESC(.flags = MIXER_FLAG_SPATIALIZE); - - entity_enable_prop(e, ENTITY_PROP_TEST); - } } ++G.world.tick_id;