summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorFox Caminiti <fox@foxcam.net>2023-02-01 13:11:05 -0500
committerFox Caminiti <fox@foxcam.net>2023-02-01 13:11:05 -0500
commita2c1ceedc6c6b3756f8d9b3b9c29798b5d925447 (patch)
tree8c7e2cb9a6534bf12b5544053ac608ec0dec8dbe /src/include
parentc40fb7c82be088db4166e92f131865f72b975f56 (diff)
sorting and shape updates
Diffstat (limited to 'src/include')
-rw-r--r--src/include/all.h11
-rw-r--r--src/include/layer.h4
-rw-r--r--src/include/main.h50
3 files changed, 48 insertions, 17 deletions
diff --git a/src/include/all.h b/src/include/all.h
index 08a96e6..da7de64 100644
--- a/src/include/all.h
+++ b/src/include/all.h
@@ -351,11 +351,11 @@ static void
Layer_GetDimensions(memory *Memory, block_layer *Layer, int *Width, int *Height);
static v2
-Layer_TraverseForPoint(project_data *File, project_state *State, memory *Memory, v2 PrincipalCompUV, sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray);
+Layer_TraverseForPoint(project_data *File, project_state *State, memory *Memory, v2 PrincipalCompUV, sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray, uint16 LayerIndex);
// TODO(fox);: Precomps?
static int32
-Layer_TestSelection(memory *Memory, project_state *State, ui *UI, sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray, uint16 PrincipalIndex);
+Layer_TestSelection(memory *Memory, project_state *State, ui *UI, sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray, uint16 PrincipalIndex, bool32 BelowOnly);
static bool32
Shape_TestBoxSelect(v2 Min, v2 Max, bezier_point *BezierPointData, uint32 BezierCount);
@@ -488,10 +488,13 @@ static v2
T_CompPosToLayerPos(layer_transforms T, uint32 FileWidth, uint32 FileHeight, uint32 SourceWidth, uint32 SourceHeight, real32 X, real32 Y);
static void
-Render_UI(project_data *File, project_state *State, memory *Memory, ui *UI, ImDrawList *draw_list,
- sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray,
+Render_UI(project_data *File, project_state *State, memory *Memory, ui *UI, ImDrawList *draw_list, uint8 *PointBuffer, gl_viewport_data *RenderData,
+ sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray, layer_transforms *ExtraT,
sorted_property_array *SortedPropertyStart, uint16 *SortedKeyframeArray, uint32 CompIndex, int32 Frame_Current);
+static layer_transforms
+Transform_Add(layer_transforms T, layer_transforms ExtraT);
+
static v2
Transform_ScreenSpaceToLocal(layer_transforms T, uint32 FileWidth, uint32 FileHeight, uint32 SourceWidth, uint32 SourceHeight,
ImVec2 CompPos, ImVec2 CompZoom, ImVec2 ViewportMin, ImVec2 Point);
diff --git a/src/include/layer.h b/src/include/layer.h
index 2b83a79..d059bb6 100644
--- a/src/include/layer.h
+++ b/src/include/layer.h
@@ -40,10 +40,10 @@ Layer_Select_Traverse(uint16 PrincipalCompIndex, memory *Memory, project_state *
int16 RecursionIdx[MAX_PRECOMP_RECURSIONS], int32 *Recursions);
static v2
-Layer_TraverseForPoint(project_data *File, project_state *State, memory *Memory, v2 PrincipalCompUV, sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray);
+Layer_TraverseForPoint(project_data *File, project_state *State, memory *Memory, v2 PrincipalCompUV, sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray, uint16 LayerIndex);
static int32
-Layer_TestSelection(memory *Memory, project_state *State, ui *UI, sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray, uint16 PrincipalIndex);
+Layer_TestSelection(memory *Memory, project_state *State, ui *UI, sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray, uint16 PrincipalIndex, bool32 BelowOnly);
static void
Layer_RecursiveDeselect(memory *Memory, sorted_comp_array *SortedCompArray, sorted_layer_array *SortedLayerArray, uint16 TargetIndex, uint16 PrincipalIndex);
diff --git a/src/include/main.h b/src/include/main.h
index e1d1787..1f04d41 100644
--- a/src/include/main.h
+++ b/src/include/main.h
@@ -192,6 +192,16 @@ struct render_queue_item
v2 Pos;
};
+struct layer_transforms
+{
+ real32 x;
+ real32 y;
+ real32 ax;
+ real32 ay;
+ real32 rotation;
+ real32 scale;
+};
+
struct render_queue
{
uint16 Playhead;
@@ -387,6 +397,33 @@ struct gl_effect_layer {
uint32 Stencil_Renderbuffer;
};
+struct gl_data
+{
+ int Type;
+ void *StrokeData;
+ uint32 StrokeCount;
+ v4 StrokeCol;
+ void *FillData;
+ uint32 FillCount;
+ v4 FillCol;
+ layer_transforms T;
+ real32 Width;
+ real32 Height;
+ int RenderMode;
+};
+
+struct gl_viewport_data
+{
+ ImVec2 ViewportSize;
+ int Width;
+ int Height;
+ int BytesPerPixel;
+ ImVec2 UIPos;
+ ImVec2 UIZoom;
+ real32 UIScale;
+ gl_data *LayerEntry[MAX_LAYERS];
+ int LayerCount;
+};
enum effect_display_type
{
@@ -610,16 +647,6 @@ struct block_composition
int32 Frame_End;
};
-struct layer_transforms
-{
- real32 x;
- real32 y;
- real32 ax;
- real32 ay;
- real32 rotation;
- real32 scale;
-};
-
enum source_type {
source_type_none,
source_type_principal,
@@ -710,8 +737,9 @@ struct block_layer {
};
};
- bool32 IsSelected;
bool32 IsVisible;
+ bool32 IsLocked;
+ bool32 IsSelected;
bool32 IsAdjustment;
// NOTE(fox): I use these in some places without calling