Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 7900664391dec47885ec48ec1a2593fa > files > 2

skijump-0.2.0-9mdv2008.1.src.rpm

--- skijump-0.2.0/cup.cpp~	2004-07-25 12:11:03.000000000 +0200
+++ skijump-0.2.0/cup.cpp	2004-07-29 19:58:26.645074942 +0200
@@ -387,7 +387,7 @@ void load_cup(char * fname)
 	message("cannot load cup: %s",fname);
         exit(1);
     }
-    hills = new (char *)[50];
+    hills = new char * [50];
     syst = new enum system[50];
     numberofhills=0;
 	while (fgetc(f)!='\n');
--- skijump-0.2.0/hill.cpp~	2004-07-25 14:48:37.000000000 +0200
+++ skijump-0.2.0/hill.cpp	2004-07-29 19:58:18.494824522 +0200
@@ -24,6 +24,54 @@ char cache_ready;
 int cache_count;
 
 
+inline void q3d_later(  double x1, double y1, double z1,
+                double x2, double y2, double z2,
+                double x3, double y3, double z3,
+                double x4, double y4, double z4, int color){
+        V3D_f _p[4], _pout[50], _ptmp[50];
+        V3D_f *p[4], *pout[50], *ptmp[50];
+        int some_tmp[50];
+        int i,n;
+        for (i=0;i<4;++i)
+                p[i]=&_p[i];
+        for (i=0;i<8;++i){
+                pout[i]=&_pout[i];
+                ptmp[i]=&_ptmp[i];
+        }
+        p[0]->x=x1;
+        p[0]->y=y1;
+        p[0]->z=z1;
+        p[0]->u=0;
+        p[0]->v=0;
+        p[1]->x=x2;
+        p[1]->y=y2;
+        p[1]->u=0;
+        p[1]->v=32;
+        p[1]->z=z2;
+        p[2]->x=x3;
+        p[2]->y=y3;
+        p[2]->z=z3;
+        p[2]->u=32;
+        p[2]->v=32;
+        p[3]->x=x4;
+        p[3]->y=y4;
+        p[3]->z=z4;
+        p[3]->u=32;
+        p[3]->v=0;
+        for (i=0;i<4;++i)
+                apply_matrix_f(&camera,p[i]->x,p[i]->y,p[i]->z,&p[i]->x,&p[i]->y,&p[i]->z);
+        n=clip3d_f(POLYTYPE_FLAT,0.1,fog_dist,4,(AL_CONST V3D_f **)p,pout,ptmp,some_tmp);
+        if (n<=0) return;
+        for (i=0;i<n;++i)
+                persp_project_f(pout[i]->x, pout[i]->y, pout[i]->z, &pout[i]->x, &pout[i]->y);
+        if (polygon_z_normal_f(pout[2], pout[1], pout[0]) < 0) return;
+        pout[0]->c=color;
+        if (scene_polygon3d_f(POLYTYPE_FLAT | POLYTYPE_ZBUF, NULL, n, pout)){
+                message("scene_polygon3d_f: failed");
+                exit(1);
+        }
+}
+
 double lagrange(double x, int surface[][3]){		//cached version of lagrange (speeds things up)
 	if (x<-1000) return cache[0];
 	if (surface==hill)