summaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'main.h')
-rw-r--r--main.h256
1 files changed, 5 insertions, 251 deletions
diff --git a/main.h b/main.h
index 3b9cd38..ce7dac5 100644
--- a/main.h
+++ b/main.h
@@ -92,9 +92,9 @@ struct block_bezier {
enum selection_type
{
- selection_none,
- selection_layer,
- selection_keyframe
+ selection_type_none,
+ selection_type_layer,
+ selection_type_keyframe
};
struct clipboard_channel {
@@ -212,6 +212,7 @@ enum interact_type
{
interact_type_none,
interact_type_timeline_scrub,
+ interact_type_slider_scrub,
interact_type_layer_move,
interact_type_layer_timeadjust,
interact_type_viewport_transform,
@@ -367,7 +368,7 @@ struct project_state
// NOTE(fox): Try to use this only where you actually need it (the
// ambiguous case of copying keyframes versus layers), since this state
// transfer will get buggy if you expand it to everything.
- selection_type RecentSelectionType = selection_none;
+ selection_type RecentSelectionType = selection_type_none;
interact_type Interact_Active;
int32 Interact_Modifier;
@@ -662,250 +663,3 @@ struct render_entry {
rectangle RenderRegion;
};
-#if 0
-
-struct cached_bitmap {
- uint32 SourceIndex; // Which source it belongs to. Currently used to dereference the bitmap.
- void *Data; // Unpacked data loaded from the source file.
- uint32 Frame; // What frame it is.
-};
-
-struct gl_effect_layer {
- bool32 Initialized;
- GLuint Texture;
- GLuint FramebufferObject;
- uint32 Color_Renderbuffer;
- uint32 Stencil_Renderbuffer;
-};
-
-
-// Bitmaps from files are loaded into these temporary cache blocks.
-
-
-// NOTE(fox): I use the term "comp" (composition) to mean the canvas that is
-// being rendered to, since it's what I'm used to from AE.
-struct comp_buffer {
- uint16 Width;
- uint16 Height;
- uint16 BytesPerPixel;
- void *PackedBuffer;
- void *UnpackedBuffer;
-};
-
-struct mask_point {
- v2 Pos;
- bool32 HandleBezier;
- bool32 IsSelected;
- v2 TangentLeft;
- v2 TangentRight;
-};
-
-struct mask {
- mask_point Point[16];
- bool32 IsClosed;
- uint16 NumberOfPoints;
- uint16 NumberOfSelectedPoints;
- void *TriangulatedPointCache;
- uint32 NumberOfVerts;
-};
-
-
-struct main_sdl
-{
- SDL_Texture *Texture;
- SDL_Event Event;
- SDL_Window *Window;
- SDL_Renderer *Renderer;
-};
-
-char *ToolName[] {
- "Move",
- "Pen"
-};
-
-enum tool {
- tool_default,
- tool_pen,
- tool_count
-};
-
-struct pen_state {
- bool32 IsActive;
-};
-
-struct brush_tool
-{
- real32 Size;
- real32 Opacity;
- real32 Hardness;
-};
-
-enum focused_window
-{
- focus_viewport,
- focus_properties,
- focus_timeline
-};
-
-struct ui_graph {
- property_channel *ChannelViewed;
- real32 WindowYOffset = 300;
- real32 UpperVal;
- real32 LowerVal;
- uint16 GraphWindowHeight; // The size of the window enclosing the graph
-};
-
-struct ui
-{
- real32 TimelineSplit = 600;
- real32 GraphPropsSplit = 200;
- real32 TimelineZoom;
- real32 GraphZoom = 30;
-
- // Under 1 is zoomed in!
- real32 TimelinePercentZoomed = 1.0f;
- real32 TimelinePercentOffset = 0.3f;
-
- real32 Default_Y_TimelinePercentZoomed = 1.2f;
- real32 Default_Y_TimelinePercentOffset = 0.0f;
-
- real32 Y_TimelinePercentZoomed;
- real32 Y_TimelinePercentOffset;
-
- bool32 IsDragging;
- bool32 IsTransforming;
- int32 Wrap_X = 0;
- int32 Wrap_Y = 0;
- real32 TempVal;
- real32 TempVal_X;
- real32 OldVal[4];
-
- real32 Y_MaxVal;
- real32 Y_MinVal;
-
- real32 Display_Y_MaxVal;
- real32 Display_Y_MinVal;
-
- bool32 WantSetPos = false;
- ImVec2 SetPos;
- real32 InitPos;
- int32 WrapDirection;
-
- // Note that I don't use "zoom" to mean the scale in relation to the
- // original (i.e. default = 1.0f); it's the literal screen size in pixels
- // of the composition in the UI.
- ImVec2 CompZoom;
- ImVec2 CompPos;
-
- // Used to set UI values on the first frame. Some UI setup in Docking takes
- // more than 1 frame for some reason, so I'm temporarily extending it.
- bool32 Initializing = 4;
-
- // Custom scrolling for the timeline, as ImGui's didn't work well
- real32 ScrollXOffset;
- real32 ScrollYOffset;
-
- // Custom scrolling for the timeline, as ImGui's didn't work well
- real32 G_ScrollXOffset;
- real32 G_ScrollYOffset;
-
- // NOTE(fox): Keeping track of mouse delta myself since the ImGui threshold
- // dragging API doesn't let you do things like subtract the delta easily.
- real32 DraggingKeyframeThreshold;
- real32 DraggingLayerThreshold;
- real32 DraggingTimelineThreshold;
- real32 DraggingEffectThreshold;
- real32 KeyframeSpacing = 6;
-
- ImVec2 BoxStart = ImVec2(0,0);
- ImVec2 BoxEnd = ImVec2(0,0);
- bool32 BoxSelectActive = false;
-
- // Temporary varibles used when zooming in/out
- v2 TempZoomRatio = V2(1, 1);
- real32 TempZoomRatioTimeline = 0;
- real32 TempZoomRatioGraph = 0;
-
- focused_window FocusedWindow; // Convenience for adding window-specific hotkeys.
-
- ui_graph Graph[4];
- uint16 NumberOfGraphsEnabled;
-
- bool32 TemporaryUpdateOverride;
-};
-
-struct imgui_buttonstate
-{
- bool32 IsItemHovered;
- bool32 IsItemActive;
- bool32 IsItemActivated;
- bool32 IsItemDeactivated;
- bool32 LeftClick;
- bool32 RightClick;
-};
-
-struct timeline_properties
-{
- rectangle Timeline;
-
- v2i MainWindow;
- uint16 WindowPadding;
-
- rectangle EffectPanel;
-
- rectangle Toolbar;
- rectangle ColorPanel;
-
- bool32 RenderSlidingBrush;
-
- uint16 CompX;
- uint16 CompY;
- uint16 TimelineZoom;
- uint16 CompScale;
- uint16 FramePadding;
- uint16 LayerPadding;
- uint16 TimelineCurrentFrame;
- int16 TimelineCurrentLayer; // Signed as a shortcut for invalid on -1
- uint16 InfoTimelineSplit;
- bool32 DrawTimeline;
- bool32 DrawEffectPanel;
- bool32 DrawComp;
-};
-
-struct sdl_button
-{
- bool32 IsDown;
- bool32 SingleClick; // More precisely, when button is released and no dragging/selecting events are happening.
- int HeldLength;
-};
-
-struct sdl_input
-{
- v2i Mouse;
- sdl_button MouseButton[3];
- rectangle Selection;
-};
-
-struct render_queue
-{
- project_data *File;
- project_state *State;
- comp_buffer *CompBuffer;
-};
-
-struct thread_info
-{
- render_queue *RenderInfo;
- uint16 Index;
-};
-
-struct work_queue_entry {
- char *StringToPrint;
-};
-
-struct render_entry {
- rectangle RenderRegion;
-};
-
-#endif
-