From fd315f15828b8537a48530c094ced845edc3a1d3 Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Wed, 23 Nov 2022 20:39:55 -0500 Subject: effects reintroduction --- main.h | 108 +++++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 79 insertions(+), 29 deletions(-) (limited to 'main.h') diff --git a/main.h b/main.h index 5b92039..ed74fa6 100644 --- a/main.h +++ b/main.h @@ -212,22 +212,22 @@ struct ui bool32 IsPrimary; ImU32 LayerColors[16] = { - 0xff0000ff, - 0xff00ff00, - 0xffff0000, - 0xff44546e, - 0xff556780, - 0xff5d7392, - 0xff7e7b7e, - 0xff828282, - 0xff434344, - 0xffAB8A71, - 0xff3C5588, - 0xff5B7193, - 0xff728AAB, - 0xff7C9AC3, - 0xffA9A5A8, - 0xffc0c0c0 + 0xff8b1f1f, + 0xffc25909, + 0xff57c20a, + 0xff8ee6da, + 0xffa48fb7, + 0xffd14061, + 0xff38b683, + 0xff3fdbe5, + 0xffc9c9c9, + 0xff978489, + 0xfffaf5ab, + 0xff101010, + 0xffa024ca, + 0xfffae920, + 0xff208dfa, + 0xfffa2051 }; }; @@ -269,6 +269,7 @@ struct brush_state enum interact_type { interact_type_none, + interact_type_timeline_scrub, interact_type_layer_move, interact_type_layer_timeadjust, interact_type_viewport_transform, @@ -304,8 +305,6 @@ struct interact_transform uint32 TransformMode; }; - - enum hotkey_input { hotkey_none, @@ -314,6 +313,61 @@ enum hotkey_input hotkey_paste }; +enum property_display_type +{ + property_display_type_standard, + property_display_type_blendmode, + property_display_type_color +}; + +struct header_property +{ + char *Name; + real32 DefaultValue; + property_display_type DisplayType; + real32 MinVal; + real32 MaxVal; + bool32 AlwaysInteger; + +}; + +struct gl_effect_layer { + bool32 Initialized; + GLuint Texture; + GLuint FramebufferObject; + uint32 Color_Renderbuffer; + uint32 Stencil_Renderbuffer; +}; + + +enum effect_display_type +{ + effect_display_type_standard, + effect_display_type_levels, + effect_display_type_curves +}; + +struct block_effect +{ + uint8 Occupied; + char ID[8]; + bool32 IsToggled; + uint16 Index; + uint32 Block_Property_Index[MAX_PROPERTIES_PER_EFFECT]; +}; + +struct header_effect +{ + char *Name; + char *ID; // Eight-letter string that's used in the actual file + void (*func)(real32 *, int, int, int, void *, uint16); + uint16 PropertyStartIndex; + uint16 Property_Count; + effect_display_type DisplayType; + bool32 UseGL; + uint32 GLShaderIndex; +}; + struct project_state { bool32 UpdateKeyframes = 0; @@ -337,6 +391,11 @@ struct project_state real64 SDTimer; #endif + header_effect Effect[128]; + header_property Property[512]; + uint16 Playhead_Effect; + uint16 Playhead_Property; + int32 PreviewLayer = -1; int32 PreviewSource = -1; @@ -435,15 +494,6 @@ struct block_source source_type Type; }; -struct property_header -{ - char *Name; - real32 DefaultVal; - real32 MinVal; - real32 MaxVal; - bool32 AlwaysInteger; -}; - struct property_channel { uint8 Occupied; char *Name; @@ -469,10 +519,10 @@ struct block_layer { uint16 Block_String_Index; uint16 Block_Composition_Index; - uint16 Block_Mask_Index[MAX_EFFECTS]; + uint16 Block_Mask_Index[MAX_MASKS]; uint16 Block_Mask_Count; - uint16 Block_Effect_Index[MAX_MASKS]; + uint16 Block_Effect_Index[MAX_EFFECTS]; uint16 Block_Effect_Count; blend_mode BlendMode; -- cgit v1.2.3