summaryrefslogtreecommitdiff
path: root/src/include/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/main.h')
-rw-r--r--src/include/main.h93
1 files changed, 85 insertions, 8 deletions
diff --git a/src/include/main.h b/src/include/main.h
index 7d3299e..6c9caca 100644
--- a/src/include/main.h
+++ b/src/include/main.h
@@ -1,3 +1,62 @@
+#include <glad.h>
+
+#include <stdio.h>
+#if WINDOWS
+#include <windows.h>
+#else
+#include <sys/mman.h>
+#include <unistd.h>
+#endif
+
+#if ARM
+#include <arm_neon.h>
+#include <arm_sve.h>
+#else
+#include <smmintrin.h>
+#endif
+
+#include "imgui.h"
+#include "imgui_impl_sdl.h"
+#include "imgui_impl_opengl3.h"
+#include <SDL.h>
+#if defined(IMGUI_IMPL_OPENGL_ES2)
+#include <SDL_opengles2.h>
+#else
+#include <SDL_opengl.h>
+#endif
+
+#define STB_IMAGE_IMPLEMENTATION
+#define STBI_FAILURE_USERMSG
+#include "stb_image.h"
+
+#define STB_IMAGE_WRITE_IMPLEMENTATION
+#include "stb_image_write.h"
+
+// TODO(fox): Used for thumbnails. The renderer could be expanded to do this
+// much more efficiently.
+#define STB_IMAGE_RESIZE_IMPLEMENTATION
+#include "stb_image_resize.h"
+
+extern "C" {
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
+#include <libavformat/avio.h>
+#include <libavutil/avutil.h>
+#include <libswscale/swscale.h>
+#include <libswresample/swresample.h>
+}
+
+
+
+#include "defines.h"
+#include "my_math.h"
+#include "structs.h"
+#if STABLE
+#include "stable_diffusion.h"
+#endif
+#include "memory.h"
+#include "nanovg.h"
+
enum instruction_mode {
instruction_mode_scalar,
#if ARM
@@ -156,6 +215,7 @@ struct sorted_property_array
struct sorted_comp_array
{
uint32 LayerCount;
+ uint32 FakeLayerCount;
uint32 CurrentSortIndex; // Used intermediately in the sorting algorithm
real32 DisplaySize;
};
@@ -163,6 +223,7 @@ struct sorted_comp_array
struct sorted_layer_array
{
uint16 Block_Layer_Index;
+ bool32 IsFake;
real32 SortedOffset;
real32 DisplayOffset;
uint16 Sorted_Effect_Index[MAX_EFFECTS];
@@ -187,8 +248,8 @@ struct sorted_file
struct shape_options {
int Visibility;
v4 FillCol = {1, 1, 1, 1};
- v4 StrokeCol = {0, 1, 0, 1};
- float StrokeWidth = 25;
+ v4 StrokeCol = {1, 0, 0, 1};
+ float StrokeWidth = 10;
nvg_line_cap LineJoinType = NVG_ROUND;
nvg_line_cap LineCapType = NVG_ROUND;
real32 Roundness;
@@ -200,10 +261,10 @@ struct shape_layer {
uint16 Point_Count;
bool32 IsClosed;
bool32 Contiguous = 1; // No points have been deleted/added, so sorting isn't needed.
- // NOTE(fox): This is kinda lazily done atm, there may be situations where
- // this isn't the correct value.
- int Width;
- int Height;
+ // NOTE(fox): Point vals are normalized based on whatever these values are!
+ // They get set once the shape becomes a shape layer!
+ real32 Width;
+ real32 Height;
shape_options Opt;
};
@@ -239,6 +300,8 @@ enum interact_type
interact_type_layer_move,
interact_type_layer_timeadjust,
interact_type_viewport_transform,
+ interact_type_viewport_duplicate,
+ interact_type_viewport_slide,
interact_type_keyframe_move,
interact_type_keyframe_scale,
interact_type_keyframe_rotate,
@@ -249,16 +312,18 @@ char *ToolName[] {
"Move",
"Crop",
"Brush",
+ "Slide",
"Pen",
- "Square"
+ "Rectangle"
};
enum tool {
tool_default,
tool_crop,
tool_brush,
+ tool_slide,
tool_pen,
- tool_square,
+ tool_rectangle,
tool_count
};
@@ -413,6 +478,7 @@ struct project_state
interact_type Interact_Active;
int32 Interact_Modifier;
real32 Interact_Offset[12];
+ real32 Interact_Dup_Previous[2];
void *Interact_Address;
// NOTE(fox): We need to keep track of when the user changes the CurrentValue of a
@@ -459,6 +525,8 @@ struct ui
ImVec2 CompZoom; // In screen pixels, not percentage.
ImVec2 CompPos;
+ int Mode = 1;
+
// Under 1 is zoomed in!
ImVec2 TimelinePercentZoomed;
ImVec2 TimelinePercentOffset;
@@ -730,3 +798,12 @@ struct render_entry {
rectangle RenderRegion;
};
+
+#include "ffmpeg_backend.h"
+#include "layer.h"
+#include "debug.h"
+#include "all.h"
+
+#include "imgui_internal_widgets.h"
+
+#include "imgui_ops.h"