fix accidental extra frame of input latency
This commit is contained in:
parent
12e5cbe7cc
commit
38f88e3cc7
@ -2316,6 +2316,8 @@ INTERNAL SYS_THREAD_ENTRY_POINT_FUNC_DEF(user_local_sim_thread_entry_point, arg)
|
||||
|
||||
if (is_master) {
|
||||
/* Step master */
|
||||
u64 prev_tick = local_client->last_tick;
|
||||
u64 next_tick = prev_tick + 1;
|
||||
struct sim_step_ctx ctx = ZI;
|
||||
ctx.is_master = is_master;
|
||||
ctx.sim_dt_ns = step_dt_ns;
|
||||
@ -2323,9 +2325,9 @@ INTERNAL SYS_THREAD_ENTRY_POINT_FUNC_DEF(user_local_sim_thread_entry_point, arg)
|
||||
ctx.user_input_client = user_input_client;
|
||||
ctx.master_client = master_client;
|
||||
ctx.publish_client = publish_client;
|
||||
struct sim_snapshot *prev_world = sim_snapshot_from_tick(local_client, local_client->last_tick);
|
||||
ctx.world = sim_snapshot_alloc(local_client, prev_world, local_client->last_tick + 1);
|
||||
generate_user_input_cmds(user_input_client, local_client->last_tick + 1);
|
||||
struct sim_snapshot *prev_world = sim_snapshot_from_tick(local_client, prev_tick);
|
||||
ctx.world = sim_snapshot_alloc(local_client, prev_world, next_tick);
|
||||
generate_user_input_cmds(user_input_client, next_tick);
|
||||
sim_step(&ctx);
|
||||
} else if (master_client->valid) {
|
||||
/* Step client */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user