gephex--main--0.4--patch-1832

[email protected]
Newsgroups gmane.comp.video.gephex.devel
Message-ID <[email protected]>
Archive: [email protected]
New revision: gephex--main--0.4--patch-1832

--
Revision: gephex--main--0.4--patch-1832
Archive: [email protected]
Creator: The Gephex Source Archive <[email protected]>
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: [email protected]/gephex--main--0.4--patch-1832
    [email protected]/gephex--martin--0.4--patch-52
    [email protected]/gephex--martin--0.4--patch-53
Summary: [MERGE-REQUEST] cleanup in centermodule
Keywords: 

Patches applied:

 * [email protected]/gephex--martin--0.4--patch-52
   sync with main

 * [email protected]/gephex--martin--0.4--patch-53
   cleanup in centermodule

* added files

    {arch}/gephex/gephex--main/gephex--main--0.4/[email protected]/patch-log/patch-1832
    {arch}/gephex/gephex--martin/gephex--martin--0.4/[email protected]/patch-log/patch-52
    {arch}/gephex/gephex--martin/gephex--martin--0.4/[email protected]/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));
     }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.