diff options
Diffstat (limited to 'main.h')
-rw-r--r-- | main.h | 135 |
1 files changed, 106 insertions, 29 deletions
@@ -125,6 +125,7 @@ struct sorted_comp_info struct sorted_layer { uint16 Block_Layer_Index; + real32 SortedOffset; }; enum timeline_mode @@ -144,10 +145,11 @@ struct ui ImVec2 TimelinePercentZoomed; ImVec2 TimelinePercentOffset; - timeline_mode TimelineMode = timeline_mode_graph; + uint32 InteractTransformMode; // Whether a drag on the Shift+T UI is scale (1), rotation (2), or position (3). + + timeline_mode TimelineMode; bool32 BoxSelect; - ImVec2 DragDelta_Prev; // TODO(fox): Make native ImGui? focused_window FocusedWindow; // Convenience for adding window-specific hotkeys. @@ -160,23 +162,27 @@ struct ui real32 Warp_PositionInitial; int32 Warp_Direction; + v4 Color = {1, 1, 1, 1}; + v4 AltColor = {0, 0, 0, 1}; + bool32 IsPrimary; + ImU32 LayerColors[16] = { - 0x00050506, - 0x00806754, - 0x002d3f66, - 0x0044546e, - 0x00556780, - 0x005d7392, - 0x007e7b7e, - 0x00828282, - 0x00434344, - 0x00AB8A71, - 0x003C5588, - 0x005B7193, - 0x00728AAB, - 0x007C9AC3, - 0x00A9A5A8, - 0x00c0c0c0 + 0xff0000ff, + 0xff00ff00, + 0xffff0000, + 0xff44546e, + 0xff556780, + 0xff5d7392, + 0xff7e7b7e, + 0xff828282, + 0xff434344, + 0xffAB8A71, + 0xff3C5588, + 0xff5B7193, + 0xff728AAB, + 0xff7C9AC3, + 0xffA9A5A8, + 0xffc0c0c0 }; }; @@ -184,14 +190,70 @@ struct pen_state { bool32 IsActive; }; +enum brush_type +{ + brush_normal, + brush_wacky1, + brush_wacky2, + brush_wacky3, + brush_amount +}; + +char *BrushNames[brush_amount] = { + "brush_normal", + "brush_wacky1", + "brush_wacky2", + "brush_wacky3" +}; + +struct brush_state +{ + ImVec2 UIPos; // Initial position when ctrl is held + real32 Size = 15; // Maxes at 1024 for now + real32 Hardness = 1.0f; // From 1 to 100 + real32 Spacing = 1.0f; + brush_type Type = brush_normal; + GLuint GLTexture; + void *PaintBuffer; + rectangle CacheBounds; +}; + enum interact_type { interact_type_none, interact_type_layer_move, interact_type_layer_timeadjust, + interact_type_viewport_transform, interact_type_keyframe_move, interact_type_keyframe_scale, interact_type_keyframe_rotate, + interact_type_newlayer_paint +}; + +char *ToolName[] { + "Move", + "Crop", + "Brush", + "Pen" +}; + +enum tool { + tool_default, + tool_crop, + tool_brush, + tool_pen, + tool_count +}; + +struct interact_transform +{ + v2 Min; + v2 Max; + real32 Radians; + v2 Position; + real32 Scale = 1.0f; + ImVec2 OGPos; + uint32 TransformMode; }; struct project_state @@ -202,9 +264,13 @@ struct project_state render_state Render; - int32 Frame_Current; - // tool Tool = tool_default; + int32 Frame_Current; + tool Tool = tool_default; + // GLuint ToolIconTex[(int)tool_count]; pen_state Pen = {}; + brush_state Brush; + + char DummyName2[512]; bool32 IsRunning = 1; bool32 IsPlaying; @@ -214,7 +280,7 @@ struct project_state // selection_type RecentSelectionType = selection_none; interact_type Interact_Active; - real32 Interact_Offset[4]; + real32 Interact_Offset[12]; void *Interact_Address; int32 Initializing = 3; @@ -253,25 +319,36 @@ struct block_composition enum source_type { source_type_none, - source_type_video, - source_type_image + source_type_principal, + source_type_file +}; + +struct layer_transforms +{ + real32 x; + real32 y; + real32 ax; + real32 ay; + real32 rotation; + real32 scale; }; struct block_source { uint8 Occupied; + bool32 IsSelected; + uint16 Path_String_Index; uint16 Name_String_Index; - // Image and video + + // Only used for type_principal + uint16 Bitmap_Index; + uint16 Width; uint16 Height; uint16 BytesPerPixel; - // Video only - real32 FPS; - real32 AvgPTSPerFrame; // set by Libav - source_type Type; }; @@ -353,7 +430,7 @@ struct block_layer { real32 Vertical_Offset; real32 Vertical_Height = 1; - real32 Col[3]; + uint16 ColIndex; }; struct render_byte_info { |