bomb wip
This commit is contained in:
parent
7d8b4d6d32
commit
62776720c3
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -14,6 +14,9 @@
|
|||||||
##############################
|
##############################
|
||||||
#- Binary files
|
#- Binary files
|
||||||
|
|
||||||
|
*.exe filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.dll filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lib filter=lfs diff=lfs merge=lfs -text
|
||||||
*.tga filter=lfs diff=lfs merge=lfs -text
|
*.tga filter=lfs diff=lfs merge=lfs -text
|
||||||
*.ase filter=lfs diff=lfs merge=lfs -text
|
*.ase filter=lfs diff=lfs merge=lfs -text
|
||||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,7 +7,6 @@
|
|||||||
*.wpix
|
*.wpix
|
||||||
*.tracy
|
*.tracy
|
||||||
*.pdb
|
*.pdb
|
||||||
*.exe
|
|
||||||
*.vs/*
|
*.vs/*
|
||||||
*.vscode/*
|
*.vscode/*
|
||||||
*.log
|
*.log
|
||||||
|
|||||||
@ -242,7 +242,7 @@ Enum(G_Access)
|
|||||||
G_Access_IndexBuffer = (1 << 8),
|
G_Access_IndexBuffer = (1 << 8),
|
||||||
G_Access_IndirectArgument = (1 << 9),
|
G_Access_IndirectArgument = (1 << 9),
|
||||||
|
|
||||||
G_Access_All = 0xFFFFFFFF // Represents all accesses relevant to the specified sync stage
|
G_Access_All = 0xFFFFFFFF // Represents all accesses relevant to the stage specified in the barrier
|
||||||
};
|
};
|
||||||
|
|
||||||
Enum(G_Layout)
|
Enum(G_Layout)
|
||||||
|
|||||||
86
src/pp/pp.c
86
src/pp/pp.c
@ -1502,11 +1502,26 @@ void P_UniqueSpaceEntriesFromRay(Arena *arena, P_SpaceEntryList *result, i32 spa
|
|||||||
Vec2 delta = SubVec2(ray_p1, ray_p0);
|
Vec2 delta = SubVec2(ray_p1, ray_p0);
|
||||||
Vec2 inv_delta = RecipVec2(delta);
|
Vec2 inv_delta = RecipVec2(delta);
|
||||||
Vec2 step_dir = VEC2((delta.x > 0) - (delta.x < 0), (delta.y > 0) - (delta.y < 0));
|
Vec2 step_dir = VEC2((delta.x > 0) - (delta.x < 0), (delta.y > 0) - (delta.y < 0));
|
||||||
Vec2 t_delta = MulVec2Vec2(step_dir, inv_delta);
|
Vec2 t_delta = VEC2(AbsF32(inv_delta.x), AbsF32(inv_delta.y));
|
||||||
Vec2 t_max = SubVec2(Vec2FromVec(dda_start), ray_p0);
|
Vec2 t_max = SubVec2(Vec2FromVec(dda_start), ray_p0);
|
||||||
t_max.x += step_dir.x > 0;
|
t_max.x += step_dir.x > 0;
|
||||||
t_max.y += step_dir.y > 0;
|
t_max.y += step_dir.y > 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
t_max = MulVec2Vec2(t_max, inv_delta);
|
t_max = MulVec2Vec2(t_max, inv_delta);
|
||||||
|
if (IsInf(inv_delta.x))
|
||||||
|
{
|
||||||
|
t_max.x = inv_delta.x;
|
||||||
|
}
|
||||||
|
if (IsInf(inv_delta.y))
|
||||||
|
{
|
||||||
|
t_max.y = inv_delta.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Vec2I32 dda_pos = dda_start;
|
Vec2I32 dda_pos = dda_start;
|
||||||
b32 done = 0;
|
b32 done = 0;
|
||||||
@ -2892,26 +2907,12 @@ void P_StepFrame(P_Frame *frame)
|
|||||||
|
|
||||||
P_Space post_solve_ents_space = P_SpaceFromEnts(scratch.arena, frame);
|
P_Space post_solve_ents_space = P_SpaceFromEnts(scratch.arena, frame);
|
||||||
|
|
||||||
//////////////////////////////
|
|
||||||
//- Move bullets
|
|
||||||
|
|
||||||
for (P_Ent *bullet = P_FirstEnt(frame); !P_IsEntNil(bullet); bullet = P_NextEnt(bullet))
|
|
||||||
{
|
|
||||||
if (bullet->is_bullet)
|
|
||||||
{
|
|
||||||
Vec2 start = bullet->bullet_start;
|
|
||||||
Vec2 end = bullet->bullet_end;
|
|
||||||
Vec2 vel = SubVec2(end, start);
|
|
||||||
bullet->bullet_start = end;
|
|
||||||
bullet->bullet_end = AddVec2(end, vel);
|
|
||||||
bullet->xf.t = bullet->bullet_start;
|
|
||||||
bullet->xf.r = NormRot(vel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- Fire bullets
|
//- Fire bullets
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO: Remove this
|
// TODO: Remove this
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -2933,7 +2934,8 @@ void P_StepFrame(P_Frame *frame)
|
|||||||
f32 spread = Tau * 0.05;
|
f32 spread = Tau * 0.05;
|
||||||
// f32 spread = Tau * 0.01;
|
// f32 spread = Tau * 0.01;
|
||||||
f32 bullet_speed = TweakFloat("Bullet speed", 100, 1, 100);
|
f32 bullet_speed = TweakFloat("Bullet speed", 100, 1, 100);
|
||||||
f32 bomb_speed = TweakFloat("Bomb speed", 2, 1, 100);
|
f32 bomb_speed = 10;
|
||||||
|
|
||||||
// f32 tweak_speed = TweakFloat("Bullet speed", 1, 1, 100);
|
// f32 tweak_speed = TweakFloat("Bullet speed", 1, 1, 100);
|
||||||
|
|
||||||
b32 can_fire = (firer->last_fire_ns + NsFromSeconds(1.0 / fire_rate)) <= frame->time_ns;
|
b32 can_fire = (firer->last_fire_ns + NsFromSeconds(1.0 / fire_rate)) <= frame->time_ns;
|
||||||
@ -3094,8 +3096,35 @@ void P_StepFrame(P_Frame *frame)
|
|||||||
P_SpawnEntsFromList(frame, bullets_to_spawn);
|
P_SpawnEntsFromList(frame, bullets_to_spawn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- Update bullet hits
|
//- Update bullets
|
||||||
|
|
||||||
// TODO: Separate 'hits' from bullets, so that bullets can have multiple hits
|
// TODO: Separate 'hits' from bullets, so that bullets can have multiple hits
|
||||||
|
|
||||||
@ -3107,6 +3136,23 @@ void P_StepFrame(P_Frame *frame)
|
|||||||
P_Ent *bullet_guy = P_EntFromKey(frame, bullet_weapon->source);
|
P_Ent *bullet_guy = P_EntFromKey(frame, bullet_weapon->source);
|
||||||
P_Ent *bullet_damager = P_EntFromKey(frame, bullet->damage_attribution);
|
P_Ent *bullet_damager = P_EntFromKey(frame, bullet->damage_attribution);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (bullet->created_at_tick != frame->tick)
|
||||||
|
{
|
||||||
|
Vec2 start = bullet->bullet_start;
|
||||||
|
Vec2 end = bullet->bullet_end;
|
||||||
|
Vec2 vel = SubVec2(end, start);
|
||||||
|
bullet->bullet_start = end;
|
||||||
|
bullet->bullet_end = AddVec2(end, vel);
|
||||||
|
bullet->xf.t = bullet->bullet_start;
|
||||||
|
bullet->xf.r = NormRot(vel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bullet->has_hit = 0;
|
bullet->has_hit = 0;
|
||||||
|
|
||||||
Struct(BulletPath)
|
Struct(BulletPath)
|
||||||
|
|||||||
BIN
src/pp/pp_res/guy/guy.ase
(Stored with Git LFS)
BIN
src/pp/pp_res/guy/guy.ase
(Stored with Git LFS)
Binary file not shown.
BIN
src/pp/pp_res/misc/bomb.ase
(Stored with Git LFS)
BIN
src/pp/pp_res/misc/bomb.ase
(Stored with Git LFS)
Binary file not shown.
@ -2717,8 +2717,9 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- Push test emitter
|
//- Push test emitter
|
||||||
|
|
||||||
if (frame->held_buttons[Button_F])
|
// if (frame->held_buttons[Button_F])
|
||||||
// if (frame->held_buttons[Button_F] && !prev_frame->held_buttons[Button_F])
|
// if (frame->held_buttons[Button_F] && !prev_frame->held_buttons[Button_F])
|
||||||
|
if (0)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
V_Emitter emitter = Zi;
|
V_Emitter emitter = Zi;
|
||||||
@ -2778,8 +2779,9 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- Push test explosion
|
//- Push test explosion
|
||||||
|
|
||||||
if (frame->held_buttons[Button_G])
|
// if (frame->held_buttons[Button_G])
|
||||||
// if (frame->held_buttons[Button_G] && !prev_frame->held_buttons[Button_G])
|
// if (frame->held_buttons[Button_G] && !prev_frame->held_buttons[Button_G])
|
||||||
|
if (0)
|
||||||
{
|
{
|
||||||
// Fire
|
// Fire
|
||||||
{
|
{
|
||||||
|
|||||||
@ -380,7 +380,8 @@ ImplComputeShader(V_SimParticlesCS)
|
|||||||
|
|
||||||
b32 done = 0;
|
b32 done = 0;
|
||||||
f32 t_diff = 0;
|
f32 t_diff = 0;
|
||||||
for (u32 iteration_idx = 0; iteration_idx < max_iterations && !done; ++iteration_idx)
|
u32 iteration_idx = 0;
|
||||||
|
for (; iteration_idx < max_iterations && !done; ++iteration_idx)
|
||||||
{
|
{
|
||||||
if (cell_pos.x == cell_p1.x && cell_pos.y == cell_p1.y)
|
if (cell_pos.x == cell_p1.x && cell_pos.y == cell_p1.y)
|
||||||
{
|
{
|
||||||
@ -516,7 +517,6 @@ ImplComputeShader(V_SimParticlesCS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
particle.cells_count += 1;
|
particle.cells_count += 1;
|
||||||
iteration_idx += 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -986,7 +986,7 @@ ImplComputeShader2D(V_BloomDownCS)
|
|||||||
Vec2 bloom_uv = bloom_pos / down_dims;
|
Vec2 bloom_uv = bloom_pos / down_dims;
|
||||||
Vec2 off_uv = 0.5 / down_dims;
|
Vec2 off_uv = 0.5 / down_dims;
|
||||||
|
|
||||||
f32 threshold = 0.25;
|
f32 threshold = 1;
|
||||||
f32 knee = 0.75;
|
f32 knee = 0.75;
|
||||||
|
|
||||||
Vec4 result = 0;
|
Vec4 result = 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user