diff options
author | Fox Caminiti <fox@foxcam.net> | 2023-01-03 16:40:57 -0500 |
---|---|---|
committer | Fox Caminiti <fox@foxcam.net> | 2023-01-03 16:40:57 -0500 |
commit | a37ea807e93886e6a6ebc22a878a5649e97f015a (patch) | |
tree | c5af6ddc8544d97e38276bc1b83dbf1b29a8180b /src/include | |
parent | 375c120d30456738897c4bd775e38aa1db7d239c (diff) |
shape layer work
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/functions.h | 5 | ||||
-rw-r--r-- | src/include/gl_calls.h | 1 | ||||
-rw-r--r-- | src/include/keybinds.h | 1 | ||||
-rw-r--r-- | src/include/main.h | 31 |
4 files changed, 32 insertions, 6 deletions
diff --git a/src/include/functions.h b/src/include/functions.h index 23d741e..53920cb 100644 --- a/src/include/functions.h +++ b/src/include/functions.h @@ -16,6 +16,11 @@ static void Bezier_Interact_Evaluate(project_state *State, bezier_poin // NOTE(fox): GraphZoomHeight and Y_Increment don't have to be specified if the Y value isn't needed, i.e. in Property_SortAll(). static void Bezier_Add(memory *Memory, memory_table_list TableName, property_channel *Property, bezier_point PointData, uint16 *ArrayLocation); +uint32 Bezier_CubicCalcPoints(v2 p1, v2 p2, v2 p3, v2 p4, void *Data, uint32 Size); + + +void GL_RasterizeShape(gl_effect_layer *TestL, gl_effect_layer *TestM, void *PointData, uint32 GL_PointCount, + layer_transforms T, int Width, int Height, int BytesPerPixel, void *EffectBitmapAddress, int L_Width, int L_Height); static void ImGui_ProcessInputs(project_data *File, project_state *State, ui *UI, memory *Memory, ImGuiIO io, sorted_file Sorted); static void ImGui_PropertiesPanel(project_data *File, project_state *State, ui *UI, memory *Memory, ImGuiIO io, sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray, sorted_property_array *SortedPropertyStart, uint16 *SortedKeyframeArray); diff --git a/src/include/gl_calls.h b/src/include/gl_calls.h index fa0a00c..3c2bef0 100644 --- a/src/include/gl_calls.h +++ b/src/include/gl_calls.h @@ -10,6 +10,7 @@ struct gl_vertex_shader { }; static default_gl_vertex_object DefaultVerts; +static default_gl_vertex_object ShapeVerts; static gl_vertex_shader GL_DefaultVertexObjects; static uint32 DefaultVertexShader; static uint32 DefaultShaderProgram; diff --git a/src/include/keybinds.h b/src/include/keybinds.h index 3fe5f64..7ea0499 100644 --- a/src/include/keybinds.h +++ b/src/include/keybinds.h @@ -30,6 +30,7 @@ static shortcut_entry ShortcutArray[] { { ImGuiKey_E, Mod_None, key_mode_all, "Step forward one frame" }, { ImGuiKey_V, Mod_None, key_mode_all, "Move tool" }, { ImGuiKey_B, Mod_None, key_mode_all, "Brush tool" }, + { ImGuiKey_D, Mod_None, key_mode_all, "Pen tool" }, { ImGuiKey_Space, Mod_None, key_mode_all, "Play scene" }, { ImGuiKey_Delete, Mod_None, key_mode_all, "Delete selection (WIP)" }, { ImGuiKey_S, Mod_Ctrl, key_mode_all, "Save" }, diff --git a/src/include/main.h b/src/include/main.h index fd295cf..8590904 100644 --- a/src/include/main.h +++ b/src/include/main.h @@ -183,6 +183,23 @@ struct sorted_file uint64 Source_SortSize; }; +struct shape_options { + int Visibility; + v4 FillCol = {1, 1, 1, 1}; + v4 StrokeCol = {1, 1, 1, 1}; + float StrokeWidth; +}; + +struct shape_layer { + uint16 Block_Bezier_Index[MAX_KEYFRAME_BLOCKS]; + uint16 Block_Bezier_Count; + uint16 Point_Count; + bool32 IsClosed; + int Width; + int Height; + shape_options Opt; +}; + enum timeline_mode { timeline_mode_default, @@ -190,7 +207,7 @@ enum timeline_mode }; struct pen_state { - bool32 IsActive; + shape_options Opt; }; struct brush_state @@ -251,8 +268,9 @@ struct interact_transform enum hotkey_input { hotkey_none, - hotkey_newpaintlayer, - hotkey_newlayerfromsource, + hotkey_newlayer_source, + hotkey_newlayer_paint, + hotkey_newlayer_shape, hotkey_deletelayer, hotkey_undo, hotkey_redo, @@ -360,6 +378,7 @@ struct project_state int32 PreviewSource = -1; hotkey_input HotkeyInput; + real32 HotkeyExtra[4]; // bloat? void *Dump1; void *Dump2; @@ -564,6 +583,7 @@ struct block_layer { uint8 Occupied; bool32 IsPrecomp; + bool32 IsShapeLayer; bool32 Precomp_Toggled; // NOTE(fox): References a precomp index if IsPrecomp is true, not a source index. uint16 Block_Source_Index; @@ -571,12 +591,11 @@ struct block_layer { // References the precomp that the layer belongs to. uint16 Block_Composition_Index; - uint16 Block_Mask_Index[MAX_MASKS]; - uint16 Block_Mask_Count; - uint16 Block_Effect_Index[MAX_EFFECTS]; uint16 Block_Effect_Count; + shape_layer Shape; + blend_mode BlendMode; union |