[gephex-devel] gephex--main--0.4--patch-1832

gephex at sonnenland.kexbox.org gephex at sonnenland.kexbox.org
Thu Jan 13 20:48:24 CET 2005


Archive: gephex at gephex.org--2004
New revision: gephex--main--0.4--patch-1832

--
Revision: gephex--main--0.4--patch-1832
Archive: gephex at gephex.org--2004
Creator: The Gephex Source Archive <gephex at gephex.org>
Date: Thu Jan 13 20:46:12 CET 2005
Standard-date: 2005-01-13 19:46:12 GMT
Modified-files: modules/src/centermodule/centermodule.c
New-patches: gephex at gephex.org--2004/gephex--main--0.4--patch-1832
    martin at gephex.org--2004/gephex--martin--0.4--patch-52
    martin at gephex.org--2004/gephex--martin--0.4--patch-53
Summary: [MERGE-REQUEST] cleanup in centermodule
Keywords: 

Patches applied:

 * martin at gephex.org--2004/gephex--martin--0.4--patch-52
   sync with main

 * martin at gephex.org--2004/gephex--martin--0.4--patch-53
   cleanup in centermodule

* added files

    {arch}/gephex/gephex--main/gephex--main--0.4/gephex at gephex.org--2004/patch-log/patch-1832
    {arch}/gephex/gephex--martin/gephex--martin--0.4/martin at gephex.org--2004/patch-log/patch-52
    {arch}/gephex/gephex--martin/gephex--martin--0.4/martin at gephex.org--2004/patch-log/patch-53

* modified files

--- orig/modules/src/centermodule/centermodule.c
+++ mod/modules/src/centermodule/centermodule.c
@@ -43,14 +43,12 @@
 void update(void* instance)
 {
   InstancePtr inst = (InstancePtr) instance;
-  MyInstancePtr my = inst->my;
 
   // Add your effect here!
   int xsize, ysize; 
   int x,y; 
 
-  int v_acc;
-  double x_acc, y_acc;
+  double v_acc, x_acc, y_acc;
 
   uint_32 *src;
   src = (int*)inst->in_1->framebuffer;
@@ -67,7 +65,7 @@
       {
 	double tmpbw;
 	unsigned char* tmpc = (unsigned char*)(src+x+y*xsize);
-	tmpbw = tmpc[0] + tmpc[1] + tmpc[2];
+	tmpbw = (double)(tmpc[0] + tmpc[1] + tmpc[2]);
 
 	x_acc += x * tmpbw;
 	y_acc += y * tmpbw;
@@ -81,8 +79,8 @@
     }
   else
     {
-      inst->out_r->x= 1.0-((double)x_acc / (v_acc*xsize));
-      inst->out_r->y= 1.0-((double)y_acc / (v_acc*ysize));
+      inst->out_r->x= 1.0-(x_acc / (v_acc*(double)xsize));
+      inst->out_r->y= 1.0-(y_acc / (v_acc*(double)ysize));
     }
 }
 



More information about the gephex-devel mailing list