summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dependencies/include/SDL/SDL.h (renamed from dependencies/SDL/SDL.h)0
-rw-r--r--dependencies/include/SDL/SDL_assert.h (renamed from dependencies/SDL/SDL_assert.h)0
-rw-r--r--dependencies/include/SDL/SDL_atomic.h (renamed from dependencies/SDL/SDL_atomic.h)0
-rw-r--r--dependencies/include/SDL/SDL_audio.h (renamed from dependencies/SDL/SDL_audio.h)0
-rw-r--r--dependencies/include/SDL/SDL_bits.h (renamed from dependencies/SDL/SDL_bits.h)0
-rw-r--r--dependencies/include/SDL/SDL_blendmode.h (renamed from dependencies/SDL/SDL_blendmode.h)0
-rw-r--r--dependencies/include/SDL/SDL_clipboard.h (renamed from dependencies/SDL/SDL_clipboard.h)0
-rw-r--r--dependencies/include/SDL/SDL_config.h (renamed from dependencies/SDL/SDL_config.h)0
-rw-r--r--dependencies/include/SDL/SDL_copying.h (renamed from dependencies/SDL/SDL_copying.h)0
-rw-r--r--dependencies/include/SDL/SDL_cpuinfo.h (renamed from dependencies/SDL/SDL_cpuinfo.h)0
-rw-r--r--dependencies/include/SDL/SDL_egl.h (renamed from dependencies/SDL/SDL_egl.h)0
-rw-r--r--dependencies/include/SDL/SDL_endian.h (renamed from dependencies/SDL/SDL_endian.h)0
-rw-r--r--dependencies/include/SDL/SDL_error.h (renamed from dependencies/SDL/SDL_error.h)0
-rw-r--r--dependencies/include/SDL/SDL_events.h (renamed from dependencies/SDL/SDL_events.h)0
-rw-r--r--dependencies/include/SDL/SDL_filesystem.h (renamed from dependencies/SDL/SDL_filesystem.h)0
-rw-r--r--dependencies/include/SDL/SDL_gamecontroller.h (renamed from dependencies/SDL/SDL_gamecontroller.h)0
-rw-r--r--dependencies/include/SDL/SDL_gesture.h (renamed from dependencies/SDL/SDL_gesture.h)0
-rw-r--r--dependencies/include/SDL/SDL_guid.h (renamed from dependencies/SDL/SDL_guid.h)0
-rw-r--r--dependencies/include/SDL/SDL_haptic.h (renamed from dependencies/SDL/SDL_haptic.h)0
-rw-r--r--dependencies/include/SDL/SDL_hidapi.h (renamed from dependencies/SDL/SDL_hidapi.h)0
-rw-r--r--dependencies/include/SDL/SDL_hints.h (renamed from dependencies/SDL/SDL_hints.h)0
-rw-r--r--dependencies/include/SDL/SDL_joystick.h (renamed from dependencies/SDL/SDL_joystick.h)0
-rw-r--r--dependencies/include/SDL/SDL_keyboard.h (renamed from dependencies/SDL/SDL_keyboard.h)0
-rw-r--r--dependencies/include/SDL/SDL_keycode.h (renamed from dependencies/SDL/SDL_keycode.h)0
-rw-r--r--dependencies/include/SDL/SDL_loadso.h (renamed from dependencies/SDL/SDL_loadso.h)0
-rw-r--r--dependencies/include/SDL/SDL_locale.h (renamed from dependencies/SDL/SDL_locale.h)0
-rw-r--r--dependencies/include/SDL/SDL_log.h (renamed from dependencies/SDL/SDL_log.h)0
-rw-r--r--dependencies/include/SDL/SDL_main.h (renamed from dependencies/SDL/SDL_main.h)0
-rw-r--r--dependencies/include/SDL/SDL_messagebox.h (renamed from dependencies/SDL/SDL_messagebox.h)0
-rw-r--r--dependencies/include/SDL/SDL_metal.h (renamed from dependencies/SDL/SDL_metal.h)0
-rw-r--r--dependencies/include/SDL/SDL_misc.h (renamed from dependencies/SDL/SDL_misc.h)0
-rw-r--r--dependencies/include/SDL/SDL_mouse.h (renamed from dependencies/SDL/SDL_mouse.h)0
-rw-r--r--dependencies/include/SDL/SDL_mutex.h (renamed from dependencies/SDL/SDL_mutex.h)0
-rw-r--r--dependencies/include/SDL/SDL_name.h (renamed from dependencies/SDL/SDL_name.h)0
-rw-r--r--dependencies/include/SDL/SDL_opengl.h (renamed from dependencies/SDL/SDL_opengl.h)0
-rw-r--r--dependencies/include/SDL/SDL_opengl_glext.h (renamed from dependencies/SDL/SDL_opengl_glext.h)0
-rw-r--r--dependencies/include/SDL/SDL_opengles.h (renamed from dependencies/SDL/SDL_opengles.h)0
-rw-r--r--dependencies/include/SDL/SDL_opengles2.h (renamed from dependencies/SDL/SDL_opengles2.h)0
-rw-r--r--dependencies/include/SDL/SDL_opengles2_gl2.h (renamed from dependencies/SDL/SDL_opengles2_gl2.h)0
-rw-r--r--dependencies/include/SDL/SDL_opengles2_gl2ext.h (renamed from dependencies/SDL/SDL_opengles2_gl2ext.h)0
-rw-r--r--dependencies/include/SDL/SDL_opengles2_gl2platform.h (renamed from dependencies/SDL/SDL_opengles2_gl2platform.h)0
-rw-r--r--dependencies/include/SDL/SDL_opengles2_khrplatform.h (renamed from dependencies/SDL/SDL_opengles2_khrplatform.h)0
-rw-r--r--dependencies/include/SDL/SDL_pixels.h (renamed from dependencies/SDL/SDL_pixels.h)0
-rw-r--r--dependencies/include/SDL/SDL_platform.h (renamed from dependencies/SDL/SDL_platform.h)0
-rw-r--r--dependencies/include/SDL/SDL_power.h (renamed from dependencies/SDL/SDL_power.h)0
-rw-r--r--dependencies/include/SDL/SDL_quit.h (renamed from dependencies/SDL/SDL_quit.h)0
-rw-r--r--dependencies/include/SDL/SDL_rect.h (renamed from dependencies/SDL/SDL_rect.h)0
-rw-r--r--dependencies/include/SDL/SDL_render.h (renamed from dependencies/SDL/SDL_render.h)0
-rw-r--r--dependencies/include/SDL/SDL_revision.h (renamed from dependencies/SDL/SDL_revision.h)0
-rw-r--r--dependencies/include/SDL/SDL_rwops.h (renamed from dependencies/SDL/SDL_rwops.h)0
-rw-r--r--dependencies/include/SDL/SDL_scancode.h (renamed from dependencies/SDL/SDL_scancode.h)0
-rw-r--r--dependencies/include/SDL/SDL_sensor.h (renamed from dependencies/SDL/SDL_sensor.h)0
-rw-r--r--dependencies/include/SDL/SDL_shape.h (renamed from dependencies/SDL/SDL_shape.h)0
-rw-r--r--dependencies/include/SDL/SDL_stdinc.h (renamed from dependencies/SDL/SDL_stdinc.h)0
-rw-r--r--dependencies/include/SDL/SDL_surface.h (renamed from dependencies/SDL/SDL_surface.h)0
-rw-r--r--dependencies/include/SDL/SDL_system.h (renamed from dependencies/SDL/SDL_system.h)0
-rw-r--r--dependencies/include/SDL/SDL_syswm.h (renamed from dependencies/SDL/SDL_syswm.h)0
-rw-r--r--dependencies/include/SDL/SDL_test.h (renamed from dependencies/SDL/SDL_test.h)0
-rw-r--r--dependencies/include/SDL/SDL_test_assert.h (renamed from dependencies/SDL/SDL_test_assert.h)0
-rw-r--r--dependencies/include/SDL/SDL_test_common.h (renamed from dependencies/SDL/SDL_test_common.h)0
-rw-r--r--dependencies/include/SDL/SDL_test_compare.h (renamed from dependencies/SDL/SDL_test_compare.h)0
-rw-r--r--dependencies/include/SDL/SDL_test_crc32.h (renamed from dependencies/SDL/SDL_test_crc32.h)0
-rw-r--r--dependencies/include/SDL/SDL_test_font.h (renamed from dependencies/SDL/SDL_test_font.h)0
-rw-r--r--dependencies/include/SDL/SDL_test_fuzzer.h (renamed from dependencies/SDL/SDL_test_fuzzer.h)0
-rw-r--r--dependencies/include/SDL/SDL_test_harness.h (renamed from dependencies/SDL/SDL_test_harness.h)0
-rw-r--r--dependencies/include/SDL/SDL_test_images.h (renamed from dependencies/SDL/SDL_test_images.h)0
-rw-r--r--dependencies/include/SDL/SDL_test_log.h (renamed from dependencies/SDL/SDL_test_log.h)0
-rw-r--r--dependencies/include/SDL/SDL_test_md5.h (renamed from dependencies/SDL/SDL_test_md5.h)0
-rw-r--r--dependencies/include/SDL/SDL_test_memory.h (renamed from dependencies/SDL/SDL_test_memory.h)0
-rw-r--r--dependencies/include/SDL/SDL_test_random.h (renamed from dependencies/SDL/SDL_test_random.h)0
-rw-r--r--dependencies/include/SDL/SDL_thread.h (renamed from dependencies/SDL/SDL_thread.h)0
-rw-r--r--dependencies/include/SDL/SDL_timer.h (renamed from dependencies/SDL/SDL_timer.h)0
-rw-r--r--dependencies/include/SDL/SDL_touch.h (renamed from dependencies/SDL/SDL_touch.h)0
-rw-r--r--dependencies/include/SDL/SDL_types.h (renamed from dependencies/SDL/SDL_types.h)0
-rw-r--r--dependencies/include/SDL/SDL_version.h (renamed from dependencies/SDL/SDL_version.h)0
-rw-r--r--dependencies/include/SDL/SDL_video.h (renamed from dependencies/SDL/SDL_video.h)0
-rw-r--r--dependencies/include/SDL/SDL_vulkan.h (renamed from dependencies/SDL/SDL_vulkan.h)0
-rw-r--r--dependencies/include/SDL/begin_code.h (renamed from dependencies/SDL/begin_code.h)0
-rw-r--r--dependencies/include/SDL/close_code.h (renamed from dependencies/SDL/close_code.h)0
-rw-r--r--dependencies/src/imgui/imgui_impl_sdl.cpp34
-rwxr-xr-xpackage.sh2
-rw-r--r--src/createcalls.cpp5
-rw-r--r--src/ffmpeg_backend.cpp42
-rw-r--r--src/imgui_helper_internal.cpp32
-rw-r--r--src/imgui_ui.cpp7
-rw-r--r--src/imgui_ui_debug.cpp2
-rw-r--r--src/imgui_ui_properties.cpp6
-rw-r--r--src/imgui_ui_timeline.cpp78
-rw-r--r--src/include/imgui_internal_widgets.h1
-rw-r--r--src/include/main.h12
-rw-r--r--src/main.cpp74
-rw-r--r--src/memory.cpp2
-rw-r--r--src/sorted.cpp12
93 files changed, 197 insertions, 112 deletions
diff --git a/dependencies/SDL/SDL.h b/dependencies/include/SDL/SDL.h
index 12e7f31..12e7f31 100644
--- a/dependencies/SDL/SDL.h
+++ b/dependencies/include/SDL/SDL.h
diff --git a/dependencies/SDL/SDL_assert.h b/dependencies/include/SDL/SDL_assert.h
index e71cf97..e71cf97 100644
--- a/dependencies/SDL/SDL_assert.h
+++ b/dependencies/include/SDL/SDL_assert.h
diff --git a/dependencies/SDL/SDL_atomic.h b/dependencies/include/SDL/SDL_atomic.h
index f0c05f4..f0c05f4 100644
--- a/dependencies/SDL/SDL_atomic.h
+++ b/dependencies/include/SDL/SDL_atomic.h
diff --git a/dependencies/SDL/SDL_audio.h b/dependencies/include/SDL/SDL_audio.h
index c42de3e..c42de3e 100644
--- a/dependencies/SDL/SDL_audio.h
+++ b/dependencies/include/SDL/SDL_audio.h
diff --git a/dependencies/SDL/SDL_bits.h b/dependencies/include/SDL/SDL_bits.h
index 22cb853..22cb853 100644
--- a/dependencies/SDL/SDL_bits.h
+++ b/dependencies/include/SDL/SDL_bits.h
diff --git a/dependencies/SDL/SDL_blendmode.h b/dependencies/include/SDL/SDL_blendmode.h
index 08c9f9d..08c9f9d 100644
--- a/dependencies/SDL/SDL_blendmode.h
+++ b/dependencies/include/SDL/SDL_blendmode.h
diff --git a/dependencies/SDL/SDL_clipboard.h b/dependencies/include/SDL/SDL_clipboard.h
index 783c7c2..783c7c2 100644
--- a/dependencies/SDL/SDL_clipboard.h
+++ b/dependencies/include/SDL/SDL_clipboard.h
diff --git a/dependencies/SDL/SDL_config.h b/dependencies/include/SDL/SDL_config.h
index c6283b2..c6283b2 100644
--- a/dependencies/SDL/SDL_config.h
+++ b/dependencies/include/SDL/SDL_config.h
diff --git a/dependencies/SDL/SDL_copying.h b/dependencies/include/SDL/SDL_copying.h
index 49e3f9d..49e3f9d 100644
--- a/dependencies/SDL/SDL_copying.h
+++ b/dependencies/include/SDL/SDL_copying.h
diff --git a/dependencies/SDL/SDL_cpuinfo.h b/dependencies/include/SDL/SDL_cpuinfo.h
index b5ad0fc..b5ad0fc 100644
--- a/dependencies/SDL/SDL_cpuinfo.h
+++ b/dependencies/include/SDL/SDL_cpuinfo.h
diff --git a/dependencies/SDL/SDL_egl.h b/dependencies/include/SDL/SDL_egl.h
index e8bd657..e8bd657 100644
--- a/dependencies/SDL/SDL_egl.h
+++ b/dependencies/include/SDL/SDL_egl.h
diff --git a/dependencies/SDL/SDL_endian.h b/dependencies/include/SDL/SDL_endian.h
index c3f8431..c3f8431 100644
--- a/dependencies/SDL/SDL_endian.h
+++ b/dependencies/include/SDL/SDL_endian.h
diff --git a/dependencies/SDL/SDL_error.h b/dependencies/include/SDL/SDL_error.h
index 5c961e4..5c961e4 100644
--- a/dependencies/SDL/SDL_error.h
+++ b/dependencies/include/SDL/SDL_error.h
diff --git a/dependencies/SDL/SDL_events.h b/dependencies/include/SDL/SDL_events.h
index 55a343e..55a343e 100644
--- a/dependencies/SDL/SDL_events.h
+++ b/dependencies/include/SDL/SDL_events.h
diff --git a/dependencies/SDL/SDL_filesystem.h b/dependencies/include/SDL/SDL_filesystem.h
index 1914f81..1914f81 100644
--- a/dependencies/SDL/SDL_filesystem.h
+++ b/dependencies/include/SDL/SDL_filesystem.h
diff --git a/dependencies/SDL/SDL_gamecontroller.h b/dependencies/include/SDL/SDL_gamecontroller.h
index 4703b63..4703b63 100644
--- a/dependencies/SDL/SDL_gamecontroller.h
+++ b/dependencies/include/SDL/SDL_gamecontroller.h
diff --git a/dependencies/SDL/SDL_gesture.h b/dependencies/include/SDL/SDL_gesture.h
index e2caea2..e2caea2 100644
--- a/dependencies/SDL/SDL_gesture.h
+++ b/dependencies/include/SDL/SDL_gesture.h
diff --git a/dependencies/SDL/SDL_guid.h b/dependencies/include/SDL/SDL_guid.h
index b971636..b971636 100644
--- a/dependencies/SDL/SDL_guid.h
+++ b/dependencies/include/SDL/SDL_guid.h
diff --git a/dependencies/SDL/SDL_haptic.h b/dependencies/include/SDL/SDL_haptic.h
index f240ae9..f240ae9 100644
--- a/dependencies/SDL/SDL_haptic.h
+++ b/dependencies/include/SDL/SDL_haptic.h
diff --git a/dependencies/SDL/SDL_hidapi.h b/dependencies/include/SDL/SDL_hidapi.h
index 354af5c..354af5c 100644
--- a/dependencies/SDL/SDL_hidapi.h
+++ b/dependencies/include/SDL/SDL_hidapi.h
diff --git a/dependencies/SDL/SDL_hints.h b/dependencies/include/SDL/SDL_hints.h
index 76a74f0..76a74f0 100644
--- a/dependencies/SDL/SDL_hints.h
+++ b/dependencies/include/SDL/SDL_hints.h
diff --git a/dependencies/SDL/SDL_joystick.h b/dependencies/include/SDL/SDL_joystick.h
index 72c6604..72c6604 100644
--- a/dependencies/SDL/SDL_joystick.h
+++ b/dependencies/include/SDL/SDL_joystick.h
diff --git a/dependencies/SDL/SDL_keyboard.h b/dependencies/include/SDL/SDL_keyboard.h
index e7663fb..e7663fb 100644
--- a/dependencies/SDL/SDL_keyboard.h
+++ b/dependencies/include/SDL/SDL_keyboard.h
diff --git a/dependencies/SDL/SDL_keycode.h b/dependencies/include/SDL/SDL_keycode.h
index 65420f2..65420f2 100644
--- a/dependencies/SDL/SDL_keycode.h
+++ b/dependencies/include/SDL/SDL_keycode.h
diff --git a/dependencies/SDL/SDL_loadso.h b/dependencies/include/SDL/SDL_loadso.h
index 61857c8..61857c8 100644
--- a/dependencies/SDL/SDL_loadso.h
+++ b/dependencies/include/SDL/SDL_loadso.h
diff --git a/dependencies/SDL/SDL_locale.h b/dependencies/include/SDL/SDL_locale.h
index 7515779..7515779 100644
--- a/dependencies/SDL/SDL_locale.h
+++ b/dependencies/include/SDL/SDL_locale.h
diff --git a/dependencies/SDL/SDL_log.h b/dependencies/include/SDL/SDL_log.h
index 1d8b20b..1d8b20b 100644
--- a/dependencies/SDL/SDL_log.h
+++ b/dependencies/include/SDL/SDL_log.h
diff --git a/dependencies/SDL/SDL_main.h b/dependencies/include/SDL/SDL_main.h
index 113d11d..113d11d 100644
--- a/dependencies/SDL/SDL_main.h
+++ b/dependencies/include/SDL/SDL_main.h
diff --git a/dependencies/SDL/SDL_messagebox.h b/dependencies/include/SDL/SDL_messagebox.h
index d763534..d763534 100644
--- a/dependencies/SDL/SDL_messagebox.h
+++ b/dependencies/include/SDL/SDL_messagebox.h
diff --git a/dependencies/SDL/SDL_metal.h b/dependencies/include/SDL/SDL_metal.h
index 9285471..9285471 100644
--- a/dependencies/SDL/SDL_metal.h
+++ b/dependencies/include/SDL/SDL_metal.h
diff --git a/dependencies/SDL/SDL_misc.h b/dependencies/include/SDL/SDL_misc.h
index 261b6b8..261b6b8 100644
--- a/dependencies/SDL/SDL_misc.h
+++ b/dependencies/include/SDL/SDL_misc.h
diff --git a/dependencies/SDL/SDL_mouse.h b/dependencies/include/SDL/SDL_mouse.h
index b318c70..b318c70 100644
--- a/dependencies/SDL/SDL_mouse.h
+++ b/dependencies/include/SDL/SDL_mouse.h
diff --git a/dependencies/SDL/SDL_mutex.h b/dependencies/include/SDL/SDL_mutex.h
index 173468f..173468f 100644
--- a/dependencies/SDL/SDL_mutex.h
+++ b/dependencies/include/SDL/SDL_mutex.h
diff --git a/dependencies/SDL/SDL_name.h b/dependencies/include/SDL/SDL_name.h
index 6ff35b4..6ff35b4 100644
--- a/dependencies/SDL/SDL_name.h
+++ b/dependencies/include/SDL/SDL_name.h
diff --git a/dependencies/SDL/SDL_opengl.h b/dependencies/include/SDL/SDL_opengl.h
index 0f2b257..0f2b257 100644
--- a/dependencies/SDL/SDL_opengl.h
+++ b/dependencies/include/SDL/SDL_opengl.h
diff --git a/dependencies/SDL/SDL_opengl_glext.h b/dependencies/include/SDL/SDL_opengl_glext.h
index 8527e17..8527e17 100644
--- a/dependencies/SDL/SDL_opengl_glext.h
+++ b/dependencies/include/SDL/SDL_opengl_glext.h
diff --git a/dependencies/SDL/SDL_opengles.h b/dependencies/include/SDL/SDL_opengles.h
index 8511b96..8511b96 100644
--- a/dependencies/SDL/SDL_opengles.h
+++ b/dependencies/include/SDL/SDL_opengles.h
diff --git a/dependencies/SDL/SDL_opengles2.h b/dependencies/include/SDL/SDL_opengles2.h
index 172fcb3..172fcb3 100644
--- a/dependencies/SDL/SDL_opengles2.h
+++ b/dependencies/include/SDL/SDL_opengles2.h
diff --git a/dependencies/SDL/SDL_opengles2_gl2.h b/dependencies/include/SDL/SDL_opengles2_gl2.h
index d13622a..d13622a 100644
--- a/dependencies/SDL/SDL_opengles2_gl2.h
+++ b/dependencies/include/SDL/SDL_opengles2_gl2.h
diff --git a/dependencies/SDL/SDL_opengles2_gl2ext.h b/dependencies/include/SDL/SDL_opengles2_gl2ext.h
index 9448ce0..9448ce0 100644
--- a/dependencies/SDL/SDL_opengles2_gl2ext.h
+++ b/dependencies/include/SDL/SDL_opengles2_gl2ext.h
diff --git a/dependencies/SDL/SDL_opengles2_gl2platform.h b/dependencies/include/SDL/SDL_opengles2_gl2platform.h
index 426796e..426796e 100644
--- a/dependencies/SDL/SDL_opengles2_gl2platform.h
+++ b/dependencies/include/SDL/SDL_opengles2_gl2platform.h
diff --git a/dependencies/SDL/SDL_opengles2_khrplatform.h b/dependencies/include/SDL/SDL_opengles2_khrplatform.h
index 0164644..0164644 100644
--- a/dependencies/SDL/SDL_opengles2_khrplatform.h
+++ b/dependencies/include/SDL/SDL_opengles2_khrplatform.h
diff --git a/dependencies/SDL/SDL_pixels.h b/dependencies/include/SDL/SDL_pixels.h
index 5d2c0c8..5d2c0c8 100644
--- a/dependencies/SDL/SDL_pixels.h
+++ b/dependencies/include/SDL/SDL_pixels.h
diff --git a/dependencies/SDL/SDL_platform.h b/dependencies/include/SDL/SDL_platform.h
index a8e3ac2..a8e3ac2 100644
--- a/dependencies/SDL/SDL_platform.h
+++ b/dependencies/include/SDL/SDL_platform.h
diff --git a/dependencies/SDL/SDL_power.h b/dependencies/include/SDL/SDL_power.h
index ecb3f4b..ecb3f4b 100644
--- a/dependencies/SDL/SDL_power.h
+++ b/dependencies/include/SDL/SDL_power.h
diff --git a/dependencies/SDL/SDL_quit.h b/dependencies/include/SDL/SDL_quit.h
index 4090f7f..4090f7f 100644
--- a/dependencies/SDL/SDL_quit.h
+++ b/dependencies/include/SDL/SDL_quit.h
diff --git a/dependencies/SDL/SDL_rect.h b/dependencies/include/SDL/SDL_rect.h
index 6c641c5..6c641c5 100644
--- a/dependencies/SDL/SDL_rect.h
+++ b/dependencies/include/SDL/SDL_rect.h
diff --git a/dependencies/SDL/SDL_render.h b/dependencies/include/SDL/SDL_render.h
index 5b7b059..5b7b059 100644
--- a/dependencies/SDL/SDL_render.h
+++ b/dependencies/include/SDL/SDL_render.h
diff --git a/dependencies/SDL/SDL_revision.h b/dependencies/include/SDL/SDL_revision.h
index 5f44fb5..5f44fb5 100644
--- a/dependencies/SDL/SDL_revision.h
+++ b/dependencies/include/SDL/SDL_revision.h
diff --git a/dependencies/SDL/SDL_rwops.h b/dependencies/include/SDL/SDL_rwops.h
index 3960f56..3960f56 100644
--- a/dependencies/SDL/SDL_rwops.h
+++ b/dependencies/include/SDL/SDL_rwops.h
diff --git a/dependencies/SDL/SDL_scancode.h b/dependencies/include/SDL/SDL_scancode.h
index 17e8fe2..17e8fe2 100644
--- a/dependencies/SDL/SDL_scancode.h
+++ b/dependencies/include/SDL/SDL_scancode.h
diff --git a/dependencies/SDL/SDL_sensor.h b/dependencies/include/SDL/SDL_sensor.h
index 684d2c6..684d2c6 100644
--- a/dependencies/SDL/SDL_sensor.h
+++ b/dependencies/include/SDL/SDL_sensor.h
diff --git a/dependencies/SDL/SDL_shape.h b/dependencies/include/SDL/SDL_shape.h
index 1bca927..1bca927 100644
--- a/dependencies/SDL/SDL_shape.h
+++ b/dependencies/include/SDL/SDL_shape.h
diff --git a/dependencies/SDL/SDL_stdinc.h b/dependencies/include/SDL/SDL_stdinc.h
index 70dba7d..70dba7d 100644
--- a/dependencies/SDL/SDL_stdinc.h
+++ b/dependencies/include/SDL/SDL_stdinc.h
diff --git a/dependencies/SDL/SDL_surface.h b/dependencies/include/SDL/SDL_surface.h
index 838de65..838de65 100644
--- a/dependencies/SDL/SDL_surface.h
+++ b/dependencies/include/SDL/SDL_surface.h
diff --git a/dependencies/SDL/SDL_system.h b/dependencies/include/SDL/SDL_system.h
index 0edca63..0edca63 100644
--- a/dependencies/SDL/SDL_system.h
+++ b/dependencies/include/SDL/SDL_system.h
diff --git a/dependencies/SDL/SDL_syswm.h b/dependencies/include/SDL/SDL_syswm.h
index 45f8e75..45f8e75 100644
--- a/dependencies/SDL/SDL_syswm.h
+++ b/dependencies/include/SDL/SDL_syswm.h
diff --git a/dependencies/SDL/SDL_test.h b/dependencies/include/SDL/SDL_test.h
index 8cc9d61..8cc9d61 100644
--- a/dependencies/SDL/SDL_test.h
+++ b/dependencies/include/SDL/SDL_test.h
diff --git a/dependencies/SDL/SDL_test_assert.h b/dependencies/include/SDL/SDL_test_assert.h
index 7342305..7342305 100644
--- a/dependencies/SDL/SDL_test_assert.h
+++ b/dependencies/include/SDL/SDL_test_assert.h
diff --git a/dependencies/SDL/SDL_test_common.h b/dependencies/include/SDL/SDL_test_common.h
index b86520d..b86520d 100644
--- a/dependencies/SDL/SDL_test_common.h
+++ b/dependencies/include/SDL/SDL_test_common.h
diff --git a/dependencies/SDL/SDL_test_compare.h b/dependencies/include/SDL/SDL_test_compare.h
index 8a7a070..8a7a070 100644
--- a/dependencies/SDL/SDL_test_compare.h
+++ b/dependencies/include/SDL/SDL_test_compare.h
diff --git a/dependencies/SDL/SDL_test_crc32.h b/dependencies/include/SDL/SDL_test_crc32.h
index 049da74..049da74 100644
--- a/dependencies/SDL/SDL_test_crc32.h
+++ b/dependencies/include/SDL/SDL_test_crc32.h
diff --git a/dependencies/SDL/SDL_test_font.h b/dependencies/include/SDL/SDL_test_font.h
index 6e7247d..6e7247d 100644
--- a/dependencies/SDL/SDL_test_font.h
+++ b/dependencies/include/SDL/SDL_test_font.h
diff --git a/dependencies/SDL/SDL_test_fuzzer.h b/dependencies/include/SDL/SDL_test_fuzzer.h
index bbe8eb8..bbe8eb8 100644
--- a/dependencies/SDL/SDL_test_fuzzer.h
+++ b/dependencies/include/SDL/SDL_test_fuzzer.h
diff --git a/dependencies/SDL/SDL_test_harness.h b/dependencies/include/SDL/SDL_test_harness.h
index 1fd4236..1fd4236 100644
--- a/dependencies/SDL/SDL_test_harness.h
+++ b/dependencies/include/SDL/SDL_test_harness.h
diff --git a/dependencies/SDL/SDL_test_images.h b/dependencies/include/SDL/SDL_test_images.h
index e2bfc36..e2bfc36 100644
--- a/dependencies/SDL/SDL_test_images.h
+++ b/dependencies/include/SDL/SDL_test_images.h
diff --git a/dependencies/SDL/SDL_test_log.h b/dependencies/include/SDL/SDL_test_log.h
index e3d39ad..e3d39ad 100644
--- a/dependencies/SDL/SDL_test_log.h
+++ b/dependencies/include/SDL/SDL_test_log.h
diff --git a/dependencies/SDL/SDL_test_md5.h b/dependencies/include/SDL/SDL_test_md5.h
index 17b1d2b..17b1d2b 100644
--- a/dependencies/SDL/SDL_test_md5.h
+++ b/dependencies/include/SDL/SDL_test_md5.h
diff --git a/dependencies/SDL/SDL_test_memory.h b/dependencies/include/SDL/SDL_test_memory.h
index cc2edc1..cc2edc1 100644
--- a/dependencies/SDL/SDL_test_memory.h
+++ b/dependencies/include/SDL/SDL_test_memory.h
diff --git a/dependencies/SDL/SDL_test_random.h b/dependencies/include/SDL/SDL_test_random.h
index b1d6060..b1d6060 100644
--- a/dependencies/SDL/SDL_test_random.h
+++ b/dependencies/include/SDL/SDL_test_random.h
diff --git a/dependencies/SDL/SDL_thread.h b/dependencies/include/SDL/SDL_thread.h
index 7364f81..7364f81 100644
--- a/dependencies/SDL/SDL_thread.h
+++ b/dependencies/include/SDL/SDL_thread.h
diff --git a/dependencies/SDL/SDL_timer.h b/dependencies/include/SDL/SDL_timer.h
index 62f81d4..62f81d4 100644
--- a/dependencies/SDL/SDL_timer.h
+++ b/dependencies/include/SDL/SDL_timer.h
diff --git a/dependencies/SDL/SDL_touch.h b/dependencies/include/SDL/SDL_touch.h
index 9592413..9592413 100644
--- a/dependencies/SDL/SDL_touch.h
+++ b/dependencies/include/SDL/SDL_touch.h
diff --git a/dependencies/SDL/SDL_types.h b/dependencies/include/SDL/SDL_types.h
index 355fb50..355fb50 100644
--- a/dependencies/SDL/SDL_types.h
+++ b/dependencies/include/SDL/SDL_types.h
diff --git a/dependencies/SDL/SDL_version.h b/dependencies/include/SDL/SDL_version.h
index 786b112..786b112 100644
--- a/dependencies/SDL/SDL_version.h
+++ b/dependencies/include/SDL/SDL_version.h
diff --git a/dependencies/SDL/SDL_video.h b/dependencies/include/SDL/SDL_video.h
index b2f1509..b2f1509 100644
--- a/dependencies/SDL/SDL_video.h
+++ b/dependencies/include/SDL/SDL_video.h
diff --git a/dependencies/SDL/SDL_vulkan.h b/dependencies/include/SDL/SDL_vulkan.h
index ab86a0b..ab86a0b 100644
--- a/dependencies/SDL/SDL_vulkan.h
+++ b/dependencies/include/SDL/SDL_vulkan.h
diff --git a/dependencies/SDL/begin_code.h b/dependencies/include/SDL/begin_code.h
index b3e69e8..b3e69e8 100644
--- a/dependencies/SDL/begin_code.h
+++ b/dependencies/include/SDL/begin_code.h
diff --git a/dependencies/SDL/close_code.h b/dependencies/include/SDL/close_code.h
index dc73432..dc73432 100644
--- a/dependencies/SDL/close_code.h
+++ b/dependencies/include/SDL/close_code.h
diff --git a/dependencies/src/imgui/imgui_impl_sdl.cpp b/dependencies/src/imgui/imgui_impl_sdl.cpp
index 1273a2f..34e1abb 100644
--- a/dependencies/src/imgui/imgui_impl_sdl.cpp
+++ b/dependencies/src/imgui/imgui_impl_sdl.cpp
@@ -278,6 +278,18 @@ bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)
SDL_GetWindowPosition(SDL_GetWindowFromID(event->motion.windowID), &window_x, &window_y);
mouse_pos.x += window_x;
mouse_pos.y += window_y;
+ } else {
+#if defined(__APPLE__)
+ // Fix for high DPI mac
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ int display_id = SDL_GetWindowDisplayIndex(SDL_GetWindowFromID(event->motion.windowID));
+ if (!platform_io.Monitors.empty() && platform_io.Monitors[display_id].DpiScale > 1.0f)
+ {
+ // The Framebuffer is scaled by an integer ceiling of the actual ratio, so 2.0 not 1.685 on Mac!
+ mouse_pos.x *= roundf(platform_io.Monitors[display_id].DpiScale);
+ mouse_pos.y *= roundf(platform_io.Monitors[display_id].DpiScale);
+ }
+#endif
}
io.AddMousePosEvent(mouse_pos.x, mouse_pos.y);
return true;
@@ -534,7 +546,19 @@ static void ImGui_ImplSDL2_UpdateMouseData()
SDL_GetWindowPosition(focused_window, &window_x, &window_y);
mouse_x -= window_x;
mouse_y -= window_y;
+ #if defined(__APPLE__)
+ // Fix for high DPI mac
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ int display_id = SDL_GetWindowDisplayIndex(focused_window);
+ if (!platform_io.Monitors.empty() && platform_io.Monitors[display_id].DpiScale > 1.0f)
+ {
+ // The Framebuffer is scaled by an integer ceiling of the actual ratio, so 2.0 not 1.685 on Mac!
+ mouse_x *= roundf(platform_io.Monitors[display_id].DpiScale);
+ mouse_y *= roundf(platform_io.Monitors[display_id].DpiScale);
+ }
+#endif
}
+
io.AddMousePosEvent((float)mouse_x, (float)mouse_y);
}
}
@@ -673,6 +697,16 @@ void ImGui_ImplSDL2_NewFrame()
if (w > 0 && h > 0)
io.DisplayFramebufferScale = ImVec2((float)display_w / w, (float)display_h / h);
+#if defined(__APPLE__)
+ // On Apple, The window size is reported in Low DPI, even when running in high DPI mode
+ ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
+ if (!platform_io.Monitors.empty() && platform_io.Monitors[0].DpiScale > 1.0f && display_h != h)
+ {
+ io.DisplayFramebufferScale = ImVec2(1.0f, 1.0f);
+ io.DisplaySize = ImVec2((float)display_w, (float)display_h);
+ }
+#endif
+
// Setup time step (we don't use SDL_GetTicks() because it is using millisecond resolution)
static Uint64 frequency = SDL_GetPerformanceFrequency();
Uint64 current_time = SDL_GetPerformanceCounter();
diff --git a/package.sh b/package.sh
index f0b3474..8a9de4c 100755
--- a/package.sh
+++ b/package.sh
@@ -13,7 +13,7 @@ zip -r zip/real2d_m1_mac.zip real_arm.app
# linux
zip -r zip/real2d_x86_linux.zip real2d_x86_linux
-zip -r zip/real2d_arm_linux.zip real2d_arm_linux
+# zip -r zip/real2d_arm_linux.zip real2d_arm_linux
rsync -avz zip/* root@foxcam.net:/var/www/foxcam/bin/
diff --git a/src/createcalls.cpp b/src/createcalls.cpp
index d3c7da4..8b0ebf7 100644
--- a/src/createcalls.cpp
+++ b/src/createcalls.cpp
@@ -529,11 +529,10 @@ void Effect_Curves_Sort(memory *Memory, block_effect *Effect, uint16 *SortedPoin
static void
Interact_Evaluate_Layer(memory *Memory, project_state *State, uint16 Layer_Index_Physical, sorted_comp_array SortedCompStart, sorted_layer_array *SortedLayerStart,
- int32 *Frame_Start, int32 *Frame_End)
+ int32 *Frame_Start, int32 *Frame_End, int *Frame_Offset)
{
if (State->Interact_Active == interact_type_layer_move) {
- *Frame_Start += (int32)(State->Interact_Offset[0] + 0);
- *Frame_End += (int32)(State->Interact_Offset[0] + 0);
+ *Frame_Offset += (int32)(State->Interact_Offset[0] + 0);
}
if (State->Interact_Active == interact_type_layer_timeadjust) {
int Side[2] = {0};
diff --git a/src/ffmpeg_backend.cpp b/src/ffmpeg_backend.cpp
index 821afce..a104714 100644
--- a/src/ffmpeg_backend.cpp
+++ b/src/ffmpeg_backend.cpp
@@ -253,7 +253,7 @@ void AV_Init(block_source *Source, av_info *AV, memory *Memory)
avcodec_flush_buffers(AV->Audio.CodecContext);
};
-uint32 AV_AudioTest(av_info *AV, void *Data, uint32 Size)
+uint32 AV_AudioTest(av_info *AV, void *Data, uint32 Size, real32 FPS, int32 InitialFrameToSeek)
{
AVChannelLayout ChannelLayout = {};
av_channel_layout_default(&ChannelLayout, 2);
@@ -261,12 +261,16 @@ uint32 AV_AudioTest(av_info *AV, void *Data, uint32 Size)
av_stream_info *Stream = &AV->Audio;
Assert(Stream->CodecContext->ch_layout.nb_channels == 2);
+ real32 TotalFrames = AV->SecondCount * FPS;
+ int64 SeekPTS = (int64)(((real64)InitialFrameToSeek / TotalFrames) * AV->PTSDuration);
+ int64 AveragePTS = AV->PTSDuration / TotalFrames;
+
int32 err = 0;
bool32 EndOfFile = 0;
while (err >= 0) {
if (AV_TryFrame(AV, Stream->CodecContext, &err, &EndOfFile, Stream->Index))
{
- if (AV->Frame->pts < Stream->Stream->start_time) {
+ if (AV->Frame->pts < Stream->Stream->start_time || AV->Frame->pts < SeekPTS) {
av_frame_unref(AV->Frame);
continue;
}
@@ -309,40 +313,6 @@ void AV_SeekAudio(av_info *AV, real32 FPS, int32 FrameToSeek)
Assert(FrameToSeek > -1)
int64 SeekSeconds = (int64)(FrameToSeek / (int32)(FPS + 0.5f) * AV_TIME_BASE);
av_seek_frame(AV->FileFormatContext, -1, SeekSeconds, AVSEEK_FLAG_BACKWARD);
-
- /*
- real32 TotalFrames = AV->SecondCount * FPS;
- int64 SeekPTS = (int64)(((real64)FrameToSeek / TotalFrames) * AV->PTSDuration);
- int64 AveragePTS = AV->PTSDuration / TotalFrames;
-
- int32 err = 0;
- bool32 EndOfFile = 0;
- while (err >= 0) {
- if (AV_TryFrame(AV, AV->Audio.CodecContext, &err, &EndOfFile))
- {
- int a = 0;
- }
- }
-
- while (err >= 0) {
- if (AV_TryFrame(AV, AV->Audio.CodecContext, &err, &EndOfFile, AV->Audio.Index))
- {
- // The first frame that gets loaded isn't always the actual
- // first frame, so we need to check until it's correct.
- if (FrameToSeek == 0 && AV->Frame->pts < AV->Audio.Stream->start_time) {
- av_frame_unref(AV->Frame);
- // printf("NON-START: avg: %li, real pts: %li", SeekPTS, AV->VideoFrame->pts);
- continue;
- }
-
- int64 Difference = AV->Frame->pts - SeekPTS;
- if (abs(Difference) < AveragePTS)
- {
- return;
- }
- }
- }
- */
}
diff --git a/src/imgui_helper_internal.cpp b/src/imgui_helper_internal.cpp
index 3267dcc..184930e 100644
--- a/src/imgui_helper_internal.cpp
+++ b/src/imgui_helper_internal.cpp
@@ -1,12 +1,42 @@
#include "imgui_internal_widgets.h"
-
#include "imgui.h"
#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
#endif
#include "imgui_internal.h"
+
+// NOTE(fox): This API will change in the future!
+void ImGui::MyWindowSetup(ImGuiID id)
+{
+ ImGuiViewport *Viewport = GetMainViewport();
+ ImVec2 WindowMin = Viewport->WorkPos;
+ ImVec2 WindowSize = Viewport->WorkSize;
+
+ DockBuilderRemoveNode(id);
+ DockBuilderAddNode(id, ImGuiDockNodeFlags_PassthruCentralNode | ImGuiDockNodeFlags_AutoHideTabBar);
+ DockBuilderSetNodeSize(id, WindowSize);
+ DockBuilderSetNodePos(id, WindowMin);
+
+ ImGuiID DockTop = ImGui::DockBuilderSplitNode(id, ImGuiDir_Down, 1.f, nullptr, &id);
+ ImGuiID DockBottom = ImGui::DockBuilderSplitNode(DockTop, ImGuiDir_Down, 0.4f, nullptr, &DockTop);
+ ImGuiID DockLeft = ImGui::DockBuilderSplitNode(DockTop, ImGuiDir_Left, 0.15f, nullptr, &DockTop);
+ ImGuiID DockRight = ImGui::DockBuilderSplitNode(DockTop, ImGuiDir_Right, 0.2f, nullptr, &DockTop);
+ ImGuiID DockRightBottom = ImGui::DockBuilderSplitNode(DockRight, ImGuiDir_Down, 0.2f, nullptr, &DockRight);
+ ImGuiID DockRightTop = ImGui::DockBuilderSplitNode(DockRight, ImGuiDir_Up, 0.6f, nullptr, &DockRight);
+
+ ImGui::DockBuilderDockWindow("Menu", id);
+ ImGui::DockBuilderDockWindow("Viewport", DockTop);
+ ImGui::DockBuilderDockWindow("Timeline", DockBottom);
+ ImGui::DockBuilderDockWindow("Properties###Properties", DockLeft);
+ ImGui::DockBuilderDockWindow("Colors", DockRightTop);
+ ImGui::DockBuilderDockWindow("Files", DockRight);
+ ImGui::DockBuilderDockWindow("Effects list", DockRightBottom);
+
+ ImGui::DockBuilderFinish(id);
+}
+
// A modded version of ScalarSlider allowing for the minimum and maximum parts
// of the slider to be draggable by two other buttons. p_mid is from range -1
// to 1, and s_min and max are from 0-1.
diff --git a/src/imgui_ui.cpp b/src/imgui_ui.cpp
index 5247716..77a6712 100644
--- a/src/imgui_ui.cpp
+++ b/src/imgui_ui.cpp
@@ -618,6 +618,7 @@ ImGui_Viewport(project_data *File, project_state *State, ui *UI, memory *Memory,
bool open = true;
ImGui::Begin("Viewport", &open, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse);
+
if (ImGui::IsWindowHovered(ImGuiFocusedFlags_ChildWindows)) {
State->FocusedWindow = focus_viewport;
}
@@ -628,6 +629,11 @@ ImGui_Viewport(project_data *File, project_state *State, ui *UI, memory *Memory,
ImVec2 ViewportScale = ImGui::GetContentRegionAvail();
ImVec2 ViewportMax = ImVec2(ViewportMin.x + ViewportScale.x, ViewportMin.y + ViewportScale.y);
+ if (ViewportScale.x < 50 || ViewportScale.y < 50) {
+ ImGui::End();
+ return;
+ }
+
if (State->Initializing) {
UI->CompZoom = ImVec2(MainComp->Width, MainComp->Height);
UI->CompPos = ImVec2(ViewportMin.x + ((ViewportMax.x - ViewportMin.x)/2 - UI->CompZoom.x/2),
@@ -952,6 +958,7 @@ ImGui_Popups(project_data *File, project_state *State, ui *UI, memory *Memory, I
case popup_keybinds:
{
ImGui::OpenPopup("Keybinds");
+ ImGui::SetNextWindowSize(ImVec2(700, 700));
ImGui::SetKeyboardFocusHere();
} break;
default:
diff --git a/src/imgui_ui_debug.cpp b/src/imgui_ui_debug.cpp
index f79fb88..8c63ff3 100644
--- a/src/imgui_ui_debug.cpp
+++ b/src/imgui_ui_debug.cpp
@@ -1,7 +1,7 @@
static void
ImGui_DebugMemoryViewer(memory *Memory, project_state *State)
{
- ImGui::Begin("Memory viewer");
+ ImGui::Begin("debug_memory");
ImVec2 ViewportMin = ImGui::GetCursorScreenPos();
ImVec2 ViewportScale = ImGui::GetContentRegionAvail();
diff --git a/src/imgui_ui_properties.cpp b/src/imgui_ui_properties.cpp
index 5fda218..c6b710c 100644
--- a/src/imgui_ui_properties.cpp
+++ b/src/imgui_ui_properties.cpp
@@ -301,7 +301,7 @@ ImGui_PropertiesPanel(project_data *File, project_state *State, ui *UI, memory *
ImGui::PushID(Property);
if ((h - 1) < AmountOf(Layer->Property) && c == 0) {
if (ImGui::Button("K")) {
- Property_AddKeyframe(Memory, F_Layers, Property, State->Frame_Current, ArrayLocation);
+ Property_AddKeyframe(Memory, F_Layers, Property, State->Frame_Current - Layer->Frame_Offset, ArrayLocation);
}
ImGui::SameLine();
#if DEBUG
@@ -358,14 +358,14 @@ ImGui_PropertiesPanel(project_data *File, project_state *State, ui *UI, memory *
if (EffectHeader->DisplayType == effect_display_type_standard) {
if (ChannelHeader.DisplayType == property_display_type_standard) {
if (ImGui::Button("K")) {
- Property_AddKeyframe(Memory, F_Properties, Property, State->Frame_Current, ArrayLocation);
+ Property_AddKeyframe(Memory, F_Properties, Property, State->Frame_Current - Layer->Frame_Offset, ArrayLocation);
}
ImGui::SameLine();
ImGui::DragScalar(Name, ImGuiDataType_Float, &Property->CurrentValue, Property->ScrubVal, &Property->MinVal, &Property->MaxVal, "%f");
ImGui_Properties_Slider(State, Memory, Property, io, WindowMinAbs, WindowMaxAbs, F_Properties);
} else if (ChannelHeader.DisplayType == property_display_type_color) {
if (ImGui::Button("K")) {
- Property_AddKeyframe(Memory, F_Properties, Property, State->Frame_Current, ArrayLocation);
+ Property_AddKeyframe(Memory, F_Properties, Property, State->Frame_Current - Layer->Frame_Offset, ArrayLocation);
}
ImGui::SameLine();
ImGui::DragScalar(Name, ImGuiDataType_Float, &Property->CurrentValue, Property->ScrubVal, &Property->MinVal, &Property->MaxVal, "%f");
diff --git a/src/imgui_ui_timeline.cpp b/src/imgui_ui_timeline.cpp
index 42bb788..92a08f6 100644
--- a/src/imgui_ui_timeline.cpp
+++ b/src/imgui_ui_timeline.cpp
@@ -143,7 +143,7 @@ ImGui_Timeline_GraphInfo(project_data *File, project_state *State, memory *Memor
static void
ImGui_Timeline_DrawKeySheet(project_data *File, project_state *State, memory *Memory, ui *UI, ImGuiIO io, ImDrawList *draw_list, property_channel *Property, uint16 *ArrayLocation,
- ImVec2 Increment, ImVec2 TimelineAbsolutePos, ImVec2 GraphPos, ImVec2 TimelineMoveSize, ImVec2 TimelineZoomSize,
+ ImVec2 Increment, ImVec2 TimelineAbsolutePos, ImVec2 GraphPos, int Frame_Offset, ImVec2 TimelineMoveSize, ImVec2 TimelineZoomSize,
ImVec2 TimelineSize, ImVec2 TimelineSizeWithBorder, real32 LayerIncrement,
sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray, sorted_property_array *SortedPropertyStart, uint16 *SortedKeyframeArray)
{
@@ -156,7 +156,7 @@ ImGui_Timeline_DrawKeySheet(project_data *File, project_state *State, memory *Me
v2 PointPos[3];
Bezier_Interact_Evaluate(State, PointAddress, PointPos);
- real32 LocalPos_Ratio_X = PointPos[0].x * Increment.x;
+ real32 LocalPos_Ratio_X = (PointPos[0].x + Frame_Offset) * Increment.x;
real32 Keyframe_ScreenPos_X = GraphPos.x + TimelineMoveSize.x + LocalPos_Ratio_X * TimelineZoomSize.x;
ImVec2 Keyframe_ScreenPos(Keyframe_ScreenPos_X, GraphPos.y);
@@ -241,7 +241,7 @@ ImGui_Timeline_DrawGraph(project_data *File, project_state *State, memory *Memor
if (!Layer->IsSelected)
continue;
- int32 Frame_Start = Layer->Frame_Start;
+ int32 Frame_Offset = Layer->Frame_Offset;
ImGui::PushID(i);
@@ -320,6 +320,7 @@ ImGui_Timeline_DrawGraph(project_data *File, project_state *State, memory *Memor
v2 PointPos[3];
Bezier_Interact_Evaluate(State, PointAddress[Idx], PointPos, GraphZoomHeight, Y_Increment);
+ PointPos[0].x += Frame_Offset;
ImVec2 Keyframe_LocalPos[3] = { V2(PointPos[0]), V2(PointPos[0] + PointPos[1]), V2(PointPos[0] + PointPos[2]) };
@@ -430,12 +431,13 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
int32 Frame_Start = Layer->Frame_Start;
int32 Frame_End = Layer->Frame_End;
+ int32 Frame_Offset = Layer->Frame_Offset;
real32 Vertical_Offset = SortEntry.SortedOffset + SortEntry.DisplayOffset;
if (Layer->IsSelected)
- Interact_Evaluate_Layer(Memory, State, Index_Physical, SortedCompStart, SortedLayerStart, &Frame_Start, &Frame_End);
+ Interact_Evaluate_Layer(Memory, State, Index_Physical, SortedCompStart, SortedLayerStart, &Frame_Start, &Frame_End, &Frame_Offset);
- ImVec2 Layer_LocalPos = ImVec2(Frame_Start, Vertical_Offset);
+ ImVec2 Layer_LocalPos = ImVec2(Frame_Start + Frame_Offset, Vertical_Offset);
ImVec2 Layer_LocalSize = ImVec2(Frame_End - Frame_Start, Layer->Vertical_Height);
ImVec2 Layer_LocalPos_Ratio = (Layer_LocalPos * Increment);
@@ -537,7 +539,7 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
// NOTE(fox): Some data on the tree could be saved here.
History_Action_Swap(Memory, F_File, sizeof(Layer->Frame_Start), &Layer->Frame_Start);
History_Action_Swap(Memory, F_File, sizeof(Layer->Frame_End), &Layer->Frame_End);
- Interact_Evaluate_Layer(Memory, State, Index_Physical, SortedCompStart, SortedLayerStart, &Layer->Frame_Start, &Layer->Frame_End);
+ Interact_Evaluate_Layer(Memory, State, Index_Physical, SortedCompStart, SortedLayerStart, &Layer->Frame_Start, &Layer->Frame_End, &Layer->Frame_Offset);
}
}
History_Entry_End(Memory);
@@ -678,9 +680,8 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
History_Action_Swap(Memory, F_File, sizeof(Layer->Vertical_Offset), &Layer->Vertical_Offset);
Layer->Vertical_Offset = SortEntry.SortedOffset;
if (Layer->IsSelected) {
- History_Action_Swap(Memory, F_File, sizeof(Layer->Frame_Start), &Layer->Frame_Start);
- History_Action_Swap(Memory, F_File, sizeof(Layer->Frame_End), &Layer->Frame_End);
- Interact_Evaluate_Layer(Memory, State, Index_Physical, SortedCompStart, SortedLayerStart, &Layer->Frame_Start, &Layer->Frame_End);
+ History_Action_Swap(Memory, F_File, sizeof(Layer->Frame_Offset), &Layer->Frame_Offset);
+ Interact_Evaluate_Layer(Memory, State, Index_Physical, SortedCompStart, SortedLayerStart, &Layer->Frame_Start, &Layer->Frame_End, &Layer->Frame_Offset);
}
}
State->Interact_Active = interact_type_none;
@@ -700,56 +701,59 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
while (Layer_LoopChannels(State, Memory, &InfoLocation, &ArrayLocation, Layer, &Property, &Effect, &h, &c, &p))
{
if (Property->IsToggled) {
- ImVec2 GraphMinPos = ImVec2(TimelineAbsolutePos.x, Layer_ScreenPos_Min.y + Layer_ScreenSize.y + (Layer_ScreenSize.y * Channel));
+ ImVec2 GraphMinPos = ImVec2(TimelineAbsolutePos.x,
+ Layer_ScreenPos_Min.y + Layer_ScreenSize.y + (Layer_ScreenSize.y * Channel));
ImVec2 GraphPos = GraphMinPos + ImVec2(0, Layer_ScreenSize.y / 2);
ImVec2 GraphMinBounds = GraphMinPos;
ImVec2 GraphMaxBounds = GraphMinBounds + ImVec2(TimelineSizeWithBorder.x, Layer_ScreenSize.y);
uint32 col = (Channel % 2) ? IM_COL32(50, 50, 50, 255) : IM_COL32(70, 70, 70, 255);
draw_list->AddRectFilled(GraphMinBounds, GraphMaxBounds, col);
ImGui_Timeline_DrawKeySheet(File, State, Memory, UI, io, draw_list, Property, ArrayLocation,
- Increment, TimelineAbsolutePos, GraphPos, TimelineMoveSize, TimelineZoomSize,
+ Increment, TimelineAbsolutePos, GraphPos, Frame_Offset, TimelineMoveSize, TimelineZoomSize,
TimelineSize, TimelineSizeWithBorder, LayerIncrement,
SortedCompArray, SortedLayerArray, SortedPropertyStart, SortedKeyframeArray);
Channel++;
}
}
- }
- //
+ //
- // Precomp recursion
+ // Precomp recursion
- if (Layer->IsPrecomp && Layer->Precomp_Toggled) {
+ if (Layer->IsPrecomp && Layer->Precomp_Toggled) {
- sorted_layer_array *Precomp_SortedLayerStart = Sorted_GetLayerStart(SortedLayerArray, SortedCompArray, Layer->Block_Source_Index);
- sorted_comp_array Precomp_SortedCompStart = SortedCompArray[Layer->Block_Source_Index];
+ sorted_layer_array *Precomp_SortedLayerStart = Sorted_GetLayerStart(SortedLayerArray, SortedCompArray, Layer->Block_Source_Index);
+ sorted_comp_array Precomp_SortedCompStart = SortedCompArray[Layer->Block_Source_Index];
- block_layer *Layer_Top = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, Precomp_SortedLayerStart[Precomp_SortedCompStart.LayerCount - 1].Block_Layer_Index);
- real32 SmallestY = Layer_Top->Vertical_Offset;
- real32 PrecompHeight = Precomp_SortedCompStart.DisplaySize;
+ block_layer *Layer_Top = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, Precomp_SortedLayerStart[Precomp_SortedCompStart.LayerCount - 1].Block_Layer_Index);
+ sorted_layer_array TopLayerEntry = Precomp_SortedLayerStart[Precomp_SortedCompStart.LayerCount - 1];
+ real32 SmallestY = TopLayerEntry.SortedOffset + TopLayerEntry.DisplayOffset;
+ real32 PrecompHeight = Precomp_SortedCompStart.DisplaySize;
- ImVec2 MinClipPos = ImVec2(Layer_ScreenPos_Min.x, Layer_ScreenPos_Max.y);
- ImVec2 MaxClipPos = ImVec2(Layer_ScreenPos_Max.x, MinClipPos.y + (PrecompHeight * Increment.y * TimelineZoomSize.y));
- draw_list->AddRectFilled(MinClipPos, MaxClipPos, ImColor(0.2f, 0.2f, 0.2f, 1.0f));
+ ImVec2 MinClipPos = ImVec2(Layer_ScreenPos_Min.x, Layer_ScreenPos_Max.y + (Channel * Increment.y * TimelineZoomSize.y));
+ ImVec2 MaxClipPos = ImVec2(Layer_ScreenPos_Max.x, MinClipPos.y + (PrecompHeight * Increment.y * TimelineZoomSize.y));
+ draw_list->AddRectFilled(MinClipPos, MaxClipPos, ImColor(0.2f, 0.2f, 0.2f, 1.0f));
- ImVec2 Layer_LocalPos_Screen = Layer_LocalPos_Ratio * TimelineZoomSize;
- ImVec2 NestedTimelineAbsolutePos = TimelineAbsolutePos + Layer_LocalPos_Screen - ImVec2(0, SmallestY * Increment.y * TimelineZoomSize.y) + ImVec2(0, Layer_ScreenSize.y * 1.5);
+ ImVec2 Layer_LocalPos_Screen = Layer_LocalPos_Ratio * TimelineZoomSize;
+ ImVec2 NestedTimelineAbsolutePos = TimelineAbsolutePos + Layer_LocalPos_Screen - ImVec2(0, (SmallestY - Channel) * Increment.y * TimelineZoomSize.y) + ImVec2(0, Layer_ScreenSize.y * 1.5);
- ImGui::PushClipRect(MinClipPos, MaxClipPos, true);
- draw_list->PushClipRect(MinClipPos, MaxClipPos, true);
- uint32 RecursionsCount = Recursions+1;
- RecursionIdx[RecursionsCount] = Index_Physical;
- ImGui_Timeline_DrawPrecomp(File, State, Memory, UI, io, draw_list, RecursionIdx, RecursionsCount,
- Increment, NestedTimelineAbsolutePos, TimelineMoveSize, TimelineZoomSize,
- TimelineSize, TimelineSizeWithBorder, LayerIncrement,
- SortedCompArray, SortedLayerArray, SortedPropertyStart, SortedKeyframeArray);
- draw_list->PopClipRect();
- ImGui::PopClipRect();
+ ImGui::PushClipRect(MinClipPos, MaxClipPos, true);
+ draw_list->PushClipRect(MinClipPos, MaxClipPos, true);
+ uint32 RecursionsCount = Recursions+1;
+ RecursionIdx[RecursionsCount] = Index_Physical;
+ ImGui_Timeline_DrawPrecomp(File, State, Memory, UI, io, draw_list, RecursionIdx, RecursionsCount,
+ Increment, NestedTimelineAbsolutePos, TimelineMoveSize, TimelineZoomSize,
+ TimelineSize, TimelineSizeWithBorder, LayerIncrement,
+ SortedCompArray, SortedLayerArray, SortedPropertyStart, SortedKeyframeArray);
+ draw_list->PopClipRect();
+ ImGui::PopClipRect();
- }
+ }
- //
+ //
+
+ }
ImGui::PopID();
}
diff --git a/src/include/imgui_internal_widgets.h b/src/include/imgui_internal_widgets.h
index 52fdc74..863e934 100644
--- a/src/include/imgui_internal_widgets.h
+++ b/src/include/imgui_internal_widgets.h
@@ -6,6 +6,7 @@
// NOTE(fox): Appending to the standard ImGui namespace so I don't have to convert all the functions to ImGui::Function()
namespace ImGui {
+ IMGUI_API void MyWindowSetup(ImGuiID id);
IMGUI_API bool SliderLevels(const char* label, const char* label2, const char* label3, void* p_data, void* p_min, void* p_max);
IMGUI_API bool TestLine(ImVec2 P1, ImVec2 P2);
IMGUI_API bool BezierInteractive(ImVec2 p0, ImVec2 p1, ImVec2 p2, ImVec2 p3);
diff --git a/src/include/main.h b/src/include/main.h
index af92e31..fd295cf 100644
--- a/src/include/main.h
+++ b/src/include/main.h
@@ -325,7 +325,10 @@ struct project_state
bool32 UpdateKeyframes = 0;
bool32 UpdateFrame = 1; // only refreshes frame; set UpdateKeyframes to update animation
bool32 DebugDisableCache = 1;
+
+ // bad
uint32 CachedFrameCount;
+ int32 LastCachedFrame = -10000;
uint64 HotFramePerf = 0;
@@ -562,8 +565,10 @@ struct block_layer {
bool32 IsPrecomp;
bool32 Precomp_Toggled;
- uint16 Block_Source_Index; // also used for precomp
+ // NOTE(fox): References a precomp index if IsPrecomp is true, not a source index.
+ uint16 Block_Source_Index;
uint16 Block_String_Index;
+ // References the precomp that the layer belongs to.
uint16 Block_Composition_Index;
uint16 Block_Mask_Index[MAX_MASKS];
@@ -594,8 +599,13 @@ struct block_layer {
bool32 IsVisible;
bool32 IsAdjustment;
+ // NOTE(fox): I use these in some places without calling
+ // Interact_Evaluate_Layer(), because I'm assuming it's impossible for
+ // layer dragging to happen in those contexts. Check for this if weird bugs appear.
int32 Frame_Start;
int32 Frame_End;
+ // This is what changes when the layer is dragged. It also marks the starting frame for video footage.
+ int32 Frame_Offset;
real32 Vertical_Offset;
real32 Vertical_Height = 1;
diff --git a/src/main.cpp b/src/main.cpp
index 1b13405..88bc3ef 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -141,6 +141,11 @@ Main_InputTest(project_data *File, project_state *State, memory *Memory, sorted_
ImGui::NewFrame();
+ ImGuiID DockID = ImGui::DockSpaceOverViewport(ImGui::GetMainViewport(), ImGuiDockNodeFlags_AutoHideTabBar);
+ if (State->FirstFrame) {
+ ImGui::MyWindowSetup(DockID);
+ }
+
if (State->Warp_WantSetPos) {
ImGui_WarpMouseFinish(State, io.MousePos);
io.MouseDelta = {};
@@ -150,7 +155,12 @@ Main_InputTest(project_data *File, project_state *State, memory *Memory, sorted_
if (!io.WantCaptureKeyboard)
ImGui_ProcessInputs(File, State, UI, Memory, io, Sorted);
- ImGui::DockSpaceOverViewport();
+ // The windows don't seem to draw properly on the frame after startup, so
+ // we need to delay a bit.
+ if (State->FirstFrame) {
+ ImGui::EndFrame();
+ return;
+ }
#if DEBUG
if (Debug.ToggleWindow) {
@@ -163,8 +173,8 @@ Main_InputTest(project_data *File, project_state *State, memory *Memory, sorted_
ImGui_Viewport(File, State, UI, Memory, io, textureID, Sorted.CompArray, Sorted.LayerArray, Sorted.PropertyArray);
ImGui_Timeline(File, State, Memory, UI, io, Sorted.CompArray, Sorted.LayerArray, Sorted.PropertyStart, Sorted.PropertyArray);
- ImGui_File(File, State, Memory, io, Sorted.CompArray, Sorted.LayerArray);
ImGui_PropertiesPanel(File, State, UI, Memory, io, Sorted.CompArray, Sorted.LayerArray, Sorted.PropertyStart, Sorted.PropertyArray);
+ ImGui_File(File, State, Memory, io, Sorted.CompArray, Sorted.LayerArray);
ImGui_ColorPanel(File, State, UI, Memory, io);
ImGui_EffectsPanel(File, State, Memory, UI, io);
#if STABLE
@@ -295,12 +305,15 @@ Render_Comp(project_data *File, project_state *State, memory *Memory, sorted_fil
int32 Frame_Start = Layer->Frame_Start;
int32 Frame_End = Layer->Frame_End;
+ int32 Frame_Offset = Layer->Frame_Offset;
if (Layer->IsSelected)
- Interact_Evaluate_Layer(Memory, State, Index_Physical, *SortedCompStart, SortedLayerStart, &Frame_Start, &Frame_End);
- int FrameToSeek = State->Frame_Current - Frame_Start;
+ Interact_Evaluate_Layer(Memory, State, Index_Physical, *SortedCompStart, SortedLayerStart, &Frame_Start, &Frame_End, &Frame_Offset);
+ int32 Frame_Start_Abs = Frame_Start + Frame_Offset;
+ int32 Frame_End_Abs = Frame_End + Frame_Offset;
+ int FrameToSeek = State->Frame_Current - Frame_Start_Abs;
- if (Frame_Start <= Frame_Current &&
- Frame_End > Frame_Current && Layer->IsVisible)
+ if (Frame_Start_Abs <= Frame_Current &&
+ Frame_End_Abs > Frame_Current && Layer->IsVisible)
{
if (State->UpdateKeyframes) {
sorted_property_array *SortedLayerProperties = SortedPropertyStart + SortEntry.SortedPropertyStart;
@@ -324,12 +337,15 @@ Render_Comp(project_data *File, project_state *State, memory *Memory, sorted_fil
int32 Frame_Start = Layer->Frame_Start;
int32 Frame_End = Layer->Frame_End;
+ int32 Frame_Offset = Layer->Frame_Offset;
if (Layer->IsSelected)
- Interact_Evaluate_Layer(Memory, State, Index_Physical, *SortedCompStart, SortedLayerStart, &Frame_Start, &Frame_End);
- int FrameToSeek = State->Frame_Current - Frame_Start;
+ Interact_Evaluate_Layer(Memory, State, Index_Physical, *SortedCompStart, SortedLayerStart, &Frame_Start, &Frame_End, &Frame_Offset);
+ int32 Frame_Start_Abs = Frame_Start + Frame_Offset;
+ int32 Frame_End_Abs = Frame_End + Frame_Offset;
+ int FrameToSeek = State->Frame_Current - Frame_Start_Abs;
- if (Frame_Start <= Frame_Current &&
- Frame_End > Frame_Current && Layer->IsVisible)
+ if (Frame_Start_Abs <= Frame_Current &&
+ Frame_End_Abs > Frame_Current && Layer->IsVisible)
{
layer_bitmap_state *BitmapState = &State->Render.Bitmap[Index_Physical];
void *BitmapAddress = NULL;
@@ -438,8 +454,10 @@ Render_Comp(project_data *File, project_state *State, memory *Memory, sorted_fil
Entry_Main->CycleTime = GetCPUTime() - Comp_TimeStart;
Entry_Main->IsCached = true;
- if (CompIndex == File->PrincipalCompIndex)
+ if (CompIndex == File->PrincipalCompIndex && State->LastCachedFrame != State->Frame_Current) {
State->CachedFrameCount++;
+ State->LastCachedFrame = State->Frame_Current;
+ }
return CompBuffer;
}
@@ -488,7 +506,6 @@ Render_Blit(project_data *File, project_state *State, memory *Memory, sorted_fil
static void
Main_Renderer(project_data *File, project_state *State, memory *Memory, sorted_file Sorted, ui *UI, SDL_Window *window, GLuint textureID, ImGuiIO io)
{
- State->UpdateFrame = false;
block_composition *MainComp = (block_composition *)Memory_Block_AddressAtIndex(Memory, F_Precomps, File->PrincipalCompIndex);
@@ -506,10 +523,11 @@ Main_Renderer(project_data *File, project_state *State, memory *Memory, sorted_f
// TODO(fox): garbage collect AV state!
+ State->UpdateFrame = false;
State->UpdateKeyframes = false;
-
}
+static int pp = -2;
int main(int argc, char *argv[]) {
@@ -604,7 +622,7 @@ int main(int argc, char *argv[]) {
MainComp->FPS = 60;
MainComp->BytesPerPixel = 4;
MainComp->Frame_Count = 80;
- MainComp->Frame_End = 80;
+ MainComp->Frame_End = 79;
MainComp->Occupied = 1;
MainComp->Name_String_Index = String_AddToFile(&Memory, "Main comp");
@@ -708,18 +726,12 @@ int main(int argc, char *argv[]) {
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_DockingEnable | ImGuiConfigFlags_NavEnableSetMousePos;
(void)io;
- // NOTE(fox): Instead of constructing the position of the windows on
- // startup with Docking API calls (which is experimental and incomplete)
- // I'm loading the window positions from this convenient tool. ImGui by
- // default saves window position to an external .ini file, which can be
- // loaded from disk or memory.
+ // NOTE(fox): Window construction is done in MyWindowSetup().
#if DEBUG
- io.IniFilename = NULL;
- ImGui::LoadIniSettingsFromMemory(ImGuiPrefs);
#else
io.IniFilename = NULL;
- ImGui::LoadIniSettingsFromMemory(ImGuiPrefs);
#endif
+ // ImGui::LoadIniSettingsFromMemory(ImGuiPrefs);
// ImGui::SaveIniSettingsToDisk("imgui.ini");
ImGui::StyleColorsDark();
@@ -730,6 +742,11 @@ int main(int argc, char *argv[]) {
ImGui_ImplSDL2_InitForOpenGL(window, gl_context);
ImGui_ImplOpenGL3_Init(glsl_version);
+ // ImGuiPlatformIO &plat_io = ImGui::GetPlatformIO();
+ // printf("Scale: %.2f * 96 dpi", plat_io.Monitors[0].DpiScale);
+ // io.FontGlobalScale = plat_io.Monitors[0].DpiScale;
+ // printf("global: %.2f", io.FontGlobalScale);
+
GLuint textureID;
glGenTextures(1, &textureID);
glBindTexture(GL_TEXTURE_2D, textureID);
@@ -748,7 +765,7 @@ int main(int argc, char *argv[]) {
#endif
#if DEBUG
-#if 1
+#if 0
sprintf(State->DummyName, "test");
File_Open(File, State, &Memory, State->DummyName);
State->UpdateFrame = true;
@@ -761,6 +778,7 @@ int main(int argc, char *argv[]) {
#endif
#endif
+
while (State->IsRunning)
{
uint64 PerfFrequency = SDL_GetPerformanceFrequency();
@@ -806,12 +824,14 @@ int main(int argc, char *argv[]) {
History_Undo(&Memory);
Memory_Cache_Purge(File, State, &Memory);
State->UpdateFrame = true;
+ State->UpdateKeyframes = true;
} break;
case hotkey_redo:
{
History_Redo(&Memory);
Memory_Cache_Purge(File, State, &Memory);
State->UpdateFrame = true;
+ State->UpdateKeyframes = true;
} break;
default:
{
@@ -832,9 +852,10 @@ int main(int argc, char *argv[]) {
State->UpdateKeyframes = true;
}
- bool32 FullyCached = (State->CachedFrameCount == (MainComp->Frame_End - MainComp->Frame_Start));
+ bool32 FullyCached = (State->CachedFrameCount == (MainComp->Frame_End - MainComp->Frame_Start + 1));
if ((State->AudioLayerIndex != -1) && FullyCached)
{
+ Assert(0);
block_layer *AudioLayer = (block_layer *)Memory_Block_AddressAtIndex(&Memory, F_Layers, State->AudioLayerIndex);
av_info *AV = AV_Retrieve(State, &Memory, AudioLayer->Block_Source_Index);
int32 LayerPos = AudioLayer->Frame_Start;
@@ -858,9 +879,10 @@ int main(int argc, char *argv[]) {
int BytesToWrite = TargetAudioSize - QueuedAudioSize;
printf("%i bytes in queue.\n", QueuedAudioSize);
int BytePlayhead = 0;
+ int32 InitialFrameToSeek = State->Frame_Current - LayerPos;
while (BytePlayhead < BytesToWrite) {
uint8 *Data = (uint8 *)AudioData + BytePlayhead;
- int SampleCount = AV_AudioTest(AV, Data, AudioBufferSize - BytePlayhead);
+ int SampleCount = AV_AudioTest(AV, Data, AudioBufferSize - BytePlayhead, MainComp->FPS, InitialFrameToSeek);
int Size = SampleCount * BytesPerSample;
BytePlayhead += Size;
}
@@ -884,6 +906,8 @@ int main(int argc, char *argv[]) {
if (State->Interact_Active) {
Memory_Cache_Purge(File, State, &Memory, State->Frame_Current);
}
+ // Assert(pp != State->Frame_Current);
+ pp = State->Frame_Current;
Main_Renderer(File, State, &Memory, Sorted, &File->UI, window, textureID, io);
} else if (Item.Type == 1) {
Assert(State->Interact_Active == interact_type_brush);
diff --git a/src/memory.cpp b/src/memory.cpp
index 488f6bf..ca64745 100644
--- a/src/memory.cpp
+++ b/src/memory.cpp
@@ -193,6 +193,8 @@ Memory_Cache_Purge(project_data *File, project_state *State, memory *Memory, int
c++;
count--;
}
+ State->LastCachedFrame = -10000;
+ State->CachedFrameCount = 0;
}
static cache_entry *
diff --git a/src/sorted.cpp b/src/sorted.cpp
index 9f2e135..46b9549 100644
--- a/src/sorted.cpp
+++ b/src/sorted.cpp
@@ -108,10 +108,14 @@ Layer_Sort_DisplayOffset(project_state *State, memory *Memory,
}
}
if (SortedCompStart->LayerCount > 1) {
- block_layer *Layer_Top = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, SortedLayerStart[SortedCompStart->LayerCount - 1].Block_Layer_Index);
- block_layer *Layer_Bottom = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, SortedLayerStart[0].Block_Layer_Index);
- real32 SmallestY = Layer_Top->Vertical_Offset;
- real32 LargestY = Layer_Bottom->Vertical_Offset;
+ sorted_layer_array LayerEntry_Top = SortedLayerStart[SortedCompStart->LayerCount - 1];
+ sorted_layer_array LayerEntry_Bottom = SortedLayerStart[0];
+ real32 SmallestY = LayerEntry_Top.SortedOffset;
+ real32 LargestY = LayerEntry_Bottom.SortedOffset;
+ // block_layer *Layer_Top = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, SortedLayerStart[SortedCompStart->LayerCount - 1].Block_Layer_Index);
+ // block_layer *Layer_Bottom = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, SortedLayerStart[0].Block_Layer_Index);
+ // real32 SmallestY = Layer_Top->Vertical_Offset;
+ // real32 LargestY = Layer_Bottom->Vertical_Offset;
DisplayOffset = LargestY - SmallestY + 2 + DisplayOffset;
}
return DisplayOffset;