Commit: e6af1e447871a66dc5808e9544e459008c4c1977
Author: Brecht Van Lommel
Date:   Tue Aug 14 20:03:08 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBe6af1e447871a66dc5808e9544e459008c4c1977

Cleanup: remove unused theme color functions using legacy GL.

===================================================================

M       source/blender/editors/include/UI_resources.h
M       source/blender/editors/interface/resources.c

===================================================================

diff --git a/source/blender/editors/include/UI_resources.h 
b/source/blender/editors/include/UI_resources.h
index d2fbb881a0a..94223d1ff46 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -322,24 +322,6 @@ struct bThemeState {
 
 // THE CODERS API FOR THEMES:
 
-// sets the color
-void    UI_ThemeColor(int colorid);
-
-// sets the color plus alpha
-void   UI_ThemeColor4(int colorid);
-
-// sets color plus offset for shade
-void   UI_ThemeColorShade(int colorid, int offset);
-
-// sets color plus offset for alpha
-void   UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
-
-// sets color, which is blend between two theme colors
-void    UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
-// same, with shade offset
-void    UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int 
offset);
-void    UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, 
int offset, int alphaoffset);
-
 // returns one value, not scaled
 float   UI_GetThemeValuef(int colorid);
 int     UI_GetThemeValue(int colorid);
@@ -379,9 +361,6 @@ void UI_GetThemeColor4ubv(int colorid, unsigned char 
col[4]);
 // get a theme color from specified space type
 void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
 
-// blends and shades between two color pointers
-void    UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned 
char cp2[3], float fac, int offset);
-
 // shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor)
 void    UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char 
col[3], int offset);
 
diff --git a/source/blender/editors/interface/resources.c 
b/source/blender/editors/interface/resources.c
index 72023ebf2ae..7b6f6d0038b 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -799,51 +799,6 @@ void UI_Theme_Restore(struct bThemeState *theme_state)
        g_theme_state = *theme_state;
 }
 
-/* for space windows only */
-void UI_ThemeColor(int colorid)
-{
-       const unsigned char *cp;
-
-       cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
-       glColor3ubv(cp);
-
-}
-
-/* plus alpha */
-void UI_ThemeColor4(int colorid)
-{
-       const unsigned char *cp;
-
-       cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
-       glColor4ubv(cp);
-}
-
-/* set the color with offset for shades */
-void UI_ThemeColorShade(int colorid, int offset)
-{
-       unsigned char col[4];
-       UI_GetThemeColorShade4ubv(colorid, offset, col);
-       glColor4ubv(col);
-}
-
-void UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset)
-{
-       int r, g, b, a;
-       const unsigned char *cp;
-
-       cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
-       r = coloffset + (int) cp[0];
-       CLAMP(r, 0, 255);
-       g = coloffset + (int) cp[1];
-       CLAMP(g, 0, 255);
-       b = coloffset + (int) cp[2];
-       CLAMP(b, 0, 255);
-       a = alphaoffset + (int) cp[3];
-       CLAMP(a, 0, 255);
-
-       glColor4ub(r, g, b, a);
-}
-
 void UI_GetThemeColorShadeAlpha4ubv(int colorid, int coloffset, int 
alphaoffset, unsigned char col[4])
 {
        int r, g, b, a;
@@ -891,58 +846,6 @@ void UI_GetThemeColorBlend3f(int colorid1, int colorid2, 
float fac, float r_col[
        r_col[2] = ((1.0f - fac) * cp1[2] + fac * cp2[2]) / 255.0f;
 }
 
-/* blend between to theme colors, and set it */
-void UI_ThemeColorBlend(int colorid1, int colorid2, float fac)
-{
-       unsigned char col[3];
-       UI_GetThemeColorBlend3ubv(colorid1, colorid2, fac, col);
-       glColor3ubv(col);
-}
-
-/* blend between to theme colors, shade it, and set it */
-void UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset)
-{
-       int r, g, b;
-       const unsigned char *cp1, *cp2;
-
-       cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
-       cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
-
-       CLAMP(fac, 0.0f, 1.0f);
-       r = offset + floorf((1.0f - fac) * cp1[0] + fac * cp2[0]);
-       g = offset + floorf((1.0f - fac) * cp1[1] + fac * cp2[1]);
-       b = offset + floorf((1.0f - fac) * cp1[2] + fac * cp2[2]);
-
-       CLAMP(r, 0, 255);
-       CLAMP(g, 0, 255);
-       CLAMP(b, 0, 255);
-
-       glColor3ub(r, g, b);
-}
-
-/* blend between to theme colors, shade it, and set it */
-void UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int 
offset, int alphaoffset)
-{
-       int r, g, b, a;
-       const unsigned char *cp1, *cp2;
-
-       cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
-       cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
-
-       CLAMP(fac, 0.0f, 1.0f);
-       r = offset + floorf((1.0f - fac) * cp1[0] + fac * cp2[0]);
-       g = offset + floorf((1.0f - fac) * cp1[1] + fac * cp2[1]);
-       b = offset + floorf((1.0f - fac) * cp1[2] + fac * cp2[2]);
-       a = alphaoffset + floorf((1.0f - fac) * cp1[3] + fac * cp2[3]);
-
-       CLAMP(r, 0, 255);
-       CLAMP(g, 0, 255);
-       CLAMP(b, 0, 255);
-       CLAMP(a, 0, 255);
-
-       glColor4ub(r, g, b, a);
-}
-
 void UI_FontThemeColor(int fontid, int colorid)
 {
        unsigned char color[4];
@@ -1210,22 +1113,6 @@ void UI_GetThemeColorType4ubv(int colorid, int 
spacetype, char col[4])
        col[3] = cp[3];
 }
 
-/* blends and shades between two char color pointers */
-void UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char 
cp2[3], float fac, int offset)
-{
-       int r, g, b;
-       CLAMP(fac, 0.0f, 1.0f);
-       r = offset + floorf((1.0f - fac) * cp1[0] + fac * cp2[0]);
-       g = offset + floorf((1.0f - fac) * cp1[1] + fac * cp2[1]);
-       b = offset + floorf((1.0f - fac) * cp1[2] + fac * cp2[2]);
-
-       r = r < 0 ? 0 : (r > 255 ? 255 : r);
-       g = g < 0 ? 0 : (g > 255 ? 255 : g);
-       b = b < 0 ? 0 : (b > 255 ? 255 : b);
-
-       glColor3ub(r, g, b);
-}
-
 void UI_GetColorPtrShade3ubv(const unsigned char cp[3], unsigned char col[3], 
int offset)
 {
        int r, g, b;

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to