I must be tired, I can't figure out a way to verify this, but I assume
this is a correct fix for a real problem? Unless somebody opposes,
I'll commit this.

Piet van Oostrum <[EMAIL PROTECTED]> writes:
> I found another case where the lighting plug-in doesn't initialize
> variables in non-interactive mode. This one didn't cause a crash, but
> it gave wrong results. I suspect that there might another one as the
> results for an interactive and a non-interactive application with the
> same parameters are slightly different.

> here is the (cumulative) diff:

--- lighting_apply.c.~1~        Sun May 28 21:23:50 2000
+++ lighting_apply.c    Tue Aug 15 20:36:18 2000
@@ -94,13 +94,15 @@
     {
       gimp_pixel_rgn_init (&bump_region, gimp_drawable_get(mapvals.bumpmap_id),
         0, 0, width, height, FALSE, FALSE);
-      precompute_init(width,height);
     }
+  precompute_init(width,height);
 
   if (!mapvals.env_mapped || mapvals.envmap_id==-1)
      ray_func = get_ray_color;
   else
     {
+      env_width = gimp_drawable_width (mapvals.envmap_id);
+      env_height = gimp_drawable_height (mapvals.envmap_id);
       gimp_pixel_rgn_init (&env_region, gimp_drawable_get(mapvals.envmap_id),
         0, 0, env_width, env_height, FALSE, FALSE);
       ray_func = get_ray_color_ref;


Reply via email to