replace with placeholder graphics

This commit is contained in:
jacob 2024-06-25 15:17:14 -05:00
parent 0b3e191bb2
commit 63c309b64f
3 changed files with 3 additions and 80 deletions

BIN
res/graphics/sound.ase (Stored with Git LFS)

Binary file not shown.

BIN
res/graphics/tim.ase (Stored with Git LFS)

Binary file not shown.

View File

@ -203,7 +203,7 @@ INTERNAL void game_update(void)
struct v2 sprite_pivot; 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); struct v2 half_size = v2_mul(sprite_size, 0.5f);
sprite_pivot = v2_mul_v2(sprite_pivot_norm, half_size); 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); //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 */ /* Camera ent */
{ {
struct entity *e = entity_alloc(&G.world.entity_store); struct entity *e = entity_alloc(&G.world.entity_store);
@ -299,26 +245,6 @@ INTERNAL void game_update(void)
f32 height = (f32)DEFAULT_CAMERA_HEIGHT; f32 height = (f32)DEFAULT_CAMERA_HEIGHT;
e->camera_quad_xform = XFORM_TRS(.s = V2(width, 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; ++G.world.tick_id;