From 9062e0aae9f2f576b7a237c28028aa6b09feee5e Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Wed, 17 Aug 2022 23:41:08 -0400 Subject: undo and pen development --- main.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'main.h') diff --git a/main.h b/main.h index a31bc64..af45516 100644 --- a/main.h +++ b/main.h @@ -1,7 +1,11 @@ enum instruction_mode { instruction_mode_scalar, +#if ARM + instruction_mode_neon, +#else instruction_mode_sse, instruction_mode_avx +#endif }; struct cache { @@ -67,8 +71,6 @@ struct cached_bitmap { uint32 Frame; // What frame it is. }; -// Some actions may require a higher-level function to undo to a satisfactory -// standard, so actions are allowed to do more than just set/swap single values. enum action_entry_type { action_entry_layerinit, action_entry_default @@ -207,6 +209,8 @@ union val { struct keyframe { val Value; + // NOTE(fox): Frame values are relative to the layer's FrameOffset! This is + // done to reduce the footprint of layer moving in the undo tree. int32 FrameNumber; keyframe_type Type; bool32 IsSelected; @@ -291,17 +295,17 @@ struct source { struct layer_bitmap_info { // Image and video void *BitmapBuffer; // Each layer has a persistent bitmap that the source data gets packed into. + int32 FrameOffset; // The "true" position of the layer, separate from StartFrame. Starts at zero and only gets incremented when the layer is moved. bool32 ToUpdate = 1; gl_effect_layer Test; // TODO(fox): Find a better place to store this. Either give effects a more // fleshed-out API to add things to a struct like this or integrate into ImGui. - void *HistogramVals; // 256*5 packed floats (all channel average + RGBA). + void *HistogramVals; // 256*5 floats (all channel average + RGBA). uint16 LevelsSelector; // Which channel is currently active // Video only - int32 FrameOffset; // the "true" position of video layers, separate from StartFrame - int32 CurrentFrame = -1; // The last frame number rendered to the bitmap. + int32 CurrentFrame = -1; // The last frame number rendered to the bitmap. -1 gurantees a load upon layer creation. void *AVInfo; // Internal data containing current frame info }; @@ -364,6 +368,7 @@ struct mask_point { struct mask { mask_point Point[16]; + bool32 IsClosed; uint16 NumberOfPoints; uint16 NumberOfSelectedPoints; void *TriangulatedPointCache; -- cgit v1.2.3