diff --git a/ChangeLog b/ChangeLog index e4e556f752..ae0f2d8f75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-07-08 Sven Neumann + + * plug-ins/common/spheredesigner.c: don't cast between GimpRGB and + GimpVector; it works but it's ugly and caused compiler warnings. + 2006-07-07 Michael Natterer * app/dialogs/preferences-dialog.c (prefs_dialog_new): changed diff --git a/plug-ins/common/spheredesigner.c b/plug-ins/common/spheredesigner.c index c7b853e72d..035c5be071 100644 --- a/plug-ins/common/spheredesigner.c +++ b/plug-ins/common/spheredesigner.c @@ -2394,25 +2394,41 @@ getscales (GtkWidget *widget, static void -color1_changed (GimpColorButton *button, - gpointer data) +color1_changed (GimpColorButton *button) { texture *t = currenttexture (); + if (t) { - gimp_color_button_get_color (button, (GimpRGB *) &t->color1); + GimpRGB color; + + gimp_color_button_get_color (button, &color); + + t->color1.x = color.r; + t->color1.y = color.g; + t->color1.z = color.b; + t->color1.w = color.a; + restartrender (); } } static void -color2_changed (GimpColorButton *button, - gpointer data) +color2_changed (GimpColorButton *button) { texture *t = currenttexture (); + if (t) { - gimp_color_button_get_color (button, (GimpRGB *) &t->color2); + GimpRGB color; + + gimp_color_button_get_color (button, &color); + + t->color2.x = color.r; + t->color2.y = color.g; + t->color2.z = color.b; + t->color2.w = color.a; + restartrender (); } } @@ -2422,19 +2438,23 @@ drawcolor1 (GtkWidget *w) { static GtkWidget *lastw = NULL; + GimpRGB color; texture *t = currenttexture (); if (w) lastw = w; else w = lastw; + if (!w) return; if (!t) return; - gimp_color_button_set_color (GIMP_COLOR_BUTTON (w), - (const GimpRGB *) &t->color1); + gimp_rgba_set (&color, + t->color1.x, t->color1.y, t->color1.z, t->color1.w); + + gimp_color_button_set_color (GIMP_COLOR_BUTTON (w), &color); } static void @@ -2442,19 +2462,23 @@ drawcolor2 (GtkWidget *w) { static GtkWidget *lastw = NULL; + GimpRGB color; texture *t = currenttexture (); if (w) lastw = w; else w = lastw; + if (!w) return; if (!t) return; - gimp_color_button_set_color (GIMP_COLOR_BUTTON (w), - (const GimpRGB *) &t->color2); + gimp_rgba_set (&color, + t->color2.x, t->color2.y, t->color2.z, t->color2.w); + + gimp_color_button_set_color (GIMP_COLOR_BUTTON (w), &color); } static gboolean do_run = FALSE;