From bedd6906eabdd513042d6a178d4dc56a3a41d1d3 Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Fri, 16 Dec 2022 20:16:43 -0500 Subject: v3, file/build organization --- effects_constructors.cpp | 117 ----------------------------------------------- 1 file changed, 117 deletions(-) delete mode 100644 effects_constructors.cpp (limited to 'effects_constructors.cpp') diff --git a/effects_constructors.cpp b/effects_constructors.cpp deleted file mode 100644 index 406cb08..0000000 --- a/effects_constructors.cpp +++ /dev/null @@ -1,117 +0,0 @@ -static void -Effect_AddEntry(project_state *State, char *Name, char *ID, void (*func)(real32 *, int, int, int, void *, uint16), const char *GL_Shader, effect_display_type DisplayType = effect_display_type_standard) -{ - header_effect *Effect = &State->Effect[State->Playhead_Effect]; - Effect->Name = Name; - Effect->ID = ID; - Effect->func = func; - Effect->DisplayType = DisplayType; - Effect->PropertyStartIndex = State->Playhead_Property; - if (GL_Shader) { - Effect->GLShaderIndex = Effect_GL_InitShader(GL_Shader); - Effect->UseGL = true; - } -} - -static void -Effect_EndEntry(project_state *State) -{ - State->Playhead_Effect++; -} - -static void -Effect_AddProperty_Real(project_state *State, char *Name, real32 DefaultValue, real32 MinVal = -999999, real32 MaxVal = 999999, property_display_type DisplayType = property_display_type_standard) -{ - header_effect *Effect = &State->Effect[State->Playhead_Effect]; - Effect->Property_Count++; - header_property *Property = &State->Property[State->Playhead_Property++]; - Property->Name = Name; - Property->DefaultValue = DefaultValue; - Property->DisplayType = DisplayType; - Property->MinVal = MinVal; - Property->MaxVal = MaxVal; -} - -static void -Effect_AddProperty_Col(project_state *State, char *Name, v4 DefaultValue) -{ - Effect_AddProperty_Real(State, "r", DefaultValue.r, 0, 1, property_display_type_color); - Effect_AddProperty_Real(State, "g", DefaultValue.g, 0, 1, property_display_type_color); - Effect_AddProperty_Real(State, "b", DefaultValue.b, 0, 1, property_display_type_color); - Effect_AddProperty_Real(State, "a", DefaultValue.a, 0, 1, property_display_type_color); -} - -static void -Effect_AddProperty_Blendmode(project_state *State, char *Name, blend_mode DefaultValue) -{ - header_effect *Effect = &State->Effect[State->Playhead_Effect]; - Effect->Property_Count++; - header_property *Property = &State->Property[State->Playhead_Property++]; - Property->Name = Name; - Property->DefaultValue = DefaultValue; - Property->DisplayType = property_display_type_blendmode; -} - -static header_effect* -Effect_EntryFromID(project_state *State, char *ID) -{ - for (int i = 0; i < State->Playhead_Effect; i++) { - if (String_Compare(ID, State->Effect[i].ID, 8)) - return &State->Effect[i]; - } - Assert(0); - return &State->Effect[0]; -} - -static void -Effect_InitEntries(project_state *State) -{ - /* - */ - // Curves - /* - Effect_AddEntry(State, "Curves", "REALCRVS", &NULL, NULL, effect_display_type_curves); - Effect_AddProperty_Real(State, "Selected channel", 0.0f); - Effect_AddProperty_Real(State, "Number of points (main)", 2.0f); - Effect_AddProperty_Col(State, "Number of points (individual)", V4(2.0f)); - for (int i = 0; i < MAX_CURVESPOINTS*5/2; i++) { - v4 PointData = ((i % (MAX_CURVESPOINTS/2)) == 0) ? V4(0, 0, 1, 1) : V4(0); - Effect_AddProperty_Col(State, "PointData", PointData); - } - Effect_EndEntry(State); - */ - - // Solid color - Effect_AddEntry(State, "Solid color", "REALSCOL", &Effect_DrawColor, GLShader_SolidColor); - Effect_AddProperty_Col(State, "Color", V4(0.3f, 0.2f, 0.6f, 1.0f)); - Effect_EndEntry(State); - - // Gaussian blur - Effect_AddEntry(State, "Gaussian blur", "REALGBLR", &Effect_GaussianBlur, GLShader_GaussianBlur); - Effect_AddProperty_Real(State, "Radius", 1.0f, 0.0f, 200.0f); - Effect_EndEntry(State); - - // Curves - Effect_AddEntry(State, "Curves", "REALCRVS", &Effect_Curves, NULL, effect_display_type_curves); - for (int i = 0; i < MAX_PROPERTIES_PER_EFFECT; i++) { - Effect_AddProperty_Real(State, "point", 0.0f); - } - Effect_EndEntry(State); - - // Levels - Effect_AddEntry(State, "Levels", "REALLVLS", &Effect_Levels, GLShader_Levels, effect_display_type_levels); - // min/max is handled by the UI - Effect_AddProperty_Real(State, "All start point", 0.0f); - Effect_AddProperty_Real(State, "All mid point", 1.0f); - Effect_AddProperty_Real(State, "All end point", 1.0f); - Effect_AddProperty_Col(State, "Channel start point", V4(0.0f)); - Effect_AddProperty_Col(State, "Channel mid point", V4(1.0f)); - Effect_AddProperty_Col(State, "Channel end point", V4(1.0f)); - Effect_EndEntry(State); - /* - // Test gradient - Effect_AddEntry(State, "Test gradient", "REALTGRD", &Effect_TestGradient, NULL); - Effect_AddProperty_Col(State, "Color", V4(0.3f, 0.2f, 0.6f, 1.0f)); - Effect_EndEntry(State); - */ -} -- cgit v1.2.3