fixes
This commit is contained in:
parent
ff6c1718d0
commit
0b8c135d11
@ -419,10 +419,7 @@ get_tiling_neighbor_trile :: () -> *Trile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
draw_trile_editor :: () {
|
draw_trile_editor :: () {
|
||||||
// A trile is drawn in the light of the world it will sit in.
|
|
||||||
environment := New(Environment,, temp);
|
environment := New(Environment,, temp);
|
||||||
curworld := get_current_world();
|
|
||||||
if curworld.valid environment = world_environment(*curworld.world);
|
|
||||||
|
|
||||||
view := add_view(.{camera = get_trile_editor_camera(), environment = environment, draw_world = false});
|
view := add_view(.{camera = get_trile_editor_camera(), environment = environment, draw_world = false});
|
||||||
mesh, ok := get_trile_mesh(editor_current_trile.name);
|
mesh, ok := get_trile_mesh(editor_current_trile.name);
|
||||||
|
|||||||
27
src/main.jai
27
src/main.jai
@ -108,6 +108,7 @@ init :: () {
|
|||||||
#if OS != .WASM { Thread.init(*g_mixer.mutex); }
|
#if OS != .WASM { Thread.init(*g_mixer.mutex); }
|
||||||
audio_init_thread_context();
|
audio_init_thread_context();
|
||||||
saudio_setup(*(saudio_desc.{
|
saudio_setup(*(saudio_desc.{
|
||||||
|
|
||||||
logger = .{ func = slog_func },
|
logger = .{ func = slog_func },
|
||||||
stream_cb = sokol_audio_callback,
|
stream_cb = sokol_audio_callback,
|
||||||
num_channels = 2,
|
num_channels = 2,
|
||||||
@ -230,21 +231,28 @@ frame :: () {
|
|||||||
if delta_time_accumulator > (4.0/60.0) then delta_time_accumulator = 4.0/60.0;
|
if delta_time_accumulator > (4.0/60.0) then delta_time_accumulator = 4.0/60.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if should_tick_game && !settings_menu_blocks_game() {
|
|
||||||
game_tick_per_frame(delta_time);
|
|
||||||
while delta_time_accumulator > (1.0/480.0) {
|
|
||||||
game_tick(1.0/480.0);
|
|
||||||
tick_particles(1.0/480.0);
|
|
||||||
delta_time_accumulator -= (1.0/480.0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for event: Input.events_this_frame {
|
for event: Input.events_this_frame {
|
||||||
GR.getrect_handle_event(event);
|
GR.getrect_handle_event(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tick_ui();
|
||||||
|
if should_tick_game && !settings_menu_blocks_game () {
|
||||||
|
firstTick := true;
|
||||||
|
while delta_time_accumulator > (1.0/480.0) {
|
||||||
|
game_tick(1.0/480.0);
|
||||||
|
if firstTick {
|
||||||
|
input_per_frame_event_and_flag_update();
|
||||||
|
firstTick = false;
|
||||||
|
}
|
||||||
|
tick_particles(1.0/480.0);
|
||||||
|
delta_time_accumulator -= (1.0/480.0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
input_per_frame_event_and_flag_update();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
add_frame_profiling_point("After game ticks");
|
add_frame_profiling_point("After game ticks");
|
||||||
tick_ui();
|
|
||||||
add_frame_profiling_point("After UI tick");
|
add_frame_profiling_point("After UI tick");
|
||||||
|
|
||||||
if should_tick_game then game_draw();
|
if should_tick_game then game_draw();
|
||||||
@ -272,7 +280,6 @@ frame :: () {
|
|||||||
#if OS != .WASM { profiler_update(); }
|
#if OS != .WASM { profiler_update(); }
|
||||||
reset_temporary_storage();
|
reset_temporary_storage();
|
||||||
frame_end_time := get_time();
|
frame_end_time := get_time();
|
||||||
input_per_frame_event_and_flag_update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup :: () {
|
cleanup :: () {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user