[Scummvm-cvs-logs] CVS: residual/tinygl api.cpp,1.3,1.4 clip.cpp,1.4,1.5 init.cpp,1.3,1.4 light.cpp,1.4,1.5 matrix.cpp,1.4,1.5 vertex.cpp,1.4,1.5 zgl.h,1.3,1.4 ztriangle.cpp,1.2,1.3 ztriangle.h,1.1,1.2
Pawel Kolodziejski
aquadran at users.sourceforge.net
Wed Jan 12 16:16:10 CET 2005
Update of /cvsroot/scummvm/residual/tinygl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10034/tinygl
Modified Files:
api.cpp clip.cpp init.cpp light.cpp matrix.cpp vertex.cpp
zgl.h ztriangle.cpp ztriangle.h
Log Message:
fixed more warnings
Index: api.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/tinygl/api.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- api.cpp 12 Jan 2005 18:00:19 -0000 1.3
+++ api.cpp 13 Jan 2005 00:15:15 -0000 1.4
@@ -357,12 +357,12 @@
TGLParam p[7];
p[0].op=OP_Frustum;
- p[1].f=left;
- p[2].f=right;
- p[3].f=bottom;
- p[4].f=top;
- p[5].f=near;
- p[6].f=farv;
+ p[1].f=(float)left;
+ p[2].f=(float)right;
+ p[3].f=(float)bottom;
+ p[4].f=(float)top;
+ p[5].f=(float)near;
+ p[6].f=(float)farv;
gl_add_op(p);
}
@@ -496,7 +496,7 @@
TGLParam p[2];
p[0].op=OP_ClearDepth;
- p[1].f=depth;
+ p[1].f=(float)depth;
gl_add_op(p);
}
Index: clip.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/tinygl/clip.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- clip.cpp 12 Jan 2005 22:59:59 -0000 1.4
+++ clip.cpp 13 Jan 2005 00:15:15 -0000 1.5
@@ -15,7 +15,7 @@
float winv;
/* coordinates */
- winv=1.0/v->pc.W;
+ winv=(float)(1.0/v->pc.W);
v->zp.x= (int) ( v->pc.X * winv * c->viewport.scale.X
+ c->viewport.trans.X );
v->zp.y= (int) ( v->pc.Y * winv * c->viewport.scale.Y
Index: init.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/tinygl/init.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- init.cpp 12 Jan 2005 18:00:19 -0000 1.3
+++ init.cpp 13 Jan 2005 00:15:15 -0000 1.4
@@ -80,7 +80,7 @@
l->enabled=0;
}
c->first_light=NULL;
- c->ambient_light_model=gl_V4_New(0.2,0.2,0.2,1);
+ c->ambient_light_model=gl_V4_New(0.2f,0.2f,0.2f,1);
c->local_light_model=0;
c->lighting_enabled=0;
c->light_model_two_side = 0;
@@ -89,8 +89,8 @@
for(i=0;i<2;i++) {
GLMaterial *m=&c->materials[i];
m->emission=gl_V4_New(0,0,0,1);
- m->ambient=gl_V4_New(0.2,0.2,0.2,1);
- m->diffuse=gl_V4_New(0.8,0.8,0.8,1);
+ m->ambient=gl_V4_New(0.2f,0.2f,0.2f,1);
+ m->diffuse=(gl_V4_New(0.8f,0.8f,0.8f,1));
m->specular=gl_V4_New(0,0,0,1);
m->shininess=0;
}
Index: light.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/tinygl/light.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- light.cpp 12 Jan 2005 22:59:59 -0000 1.4
+++ light.cpp 13 Jan 2005 00:15:15 -0000 1.5
@@ -113,7 +113,7 @@
float a=v.v[0];
assert(a == 180 || (a>=0 && a<=90));
l->spot_cutoff=a;
- if (a != 180) l->cos_spot_cutoff=cos(a * PI / 180.0);
+ if (a != 180) l->cos_spot_cutoff=(float)(cos(a * PI / 180.0));
}
break;
case TGL_CONSTANT_ATTENUATION:
@@ -268,7 +268,7 @@
} else {
s.X=d.X;
s.Y=d.Y;
- s.Z=d.Z+1.0;
+ s.Z=(float)(d.Z+1.0);
}
dot_spec=n.X*s.X+n.Y*s.Y+n.Z*s.Z;
if (twoside && dot_spec < 0) dot_spec = -dot_spec;
Index: matrix.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/tinygl/matrix.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- matrix.cpp 12 Jan 2005 22:59:59 -0000 1.4
+++ matrix.cpp 13 Jan 2005 00:15:15 -0000 1.5
@@ -116,7 +116,7 @@
float angle;
int dir_code;
- angle = p[1].f * PI / 180.0;
+ angle = (float)(p[1].f * PI / 180.0);
u[0]=p[2].f;
u[1]=p[3].f;
u[2]=p[4].f;
@@ -221,12 +221,12 @@
float farp=p[6].f;
float x,y,A,B,C,D;
- x = (2.0*near) / (right-left);
- y = (2.0*near) / (top-bottom);
+ x = (float)((2.0*near) / (right-left));
+ y = (float)((2.0*near) / (top-bottom));
A = (right+left) / (right-left);
B = (top+bottom) / (top-bottom);
C = -(farp+near) / ( farp-near);
- D = -(2.0*farp*near) / (farp-near);
+ D = (float)(-(2.0*farp*near) / (farp-near));
r=&m.m[0][0];
r[0]= x; r[1]=0; r[2]=A; r[3]=0;
Index: vertex.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/tinygl/vertex.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- vertex.cpp 12 Jan 2005 23:01:37 -0000 1.4
+++ vertex.cpp 13 Jan 2005 00:15:15 -0000 1.5
@@ -60,13 +60,13 @@
v = &c->viewport;
- v->trans.X = ((v->xsize - 0.5) / 2.0) + v->xmin;
- v->trans.Y = ((v->ysize - 0.5) / 2.0) + v->ymin;
- v->trans.Z = ((zsize - 0.5) / 2.0) + ((1 << ZB_POINT_Z_FRAC_BITS)) / 2;
+ v->trans.X = (float)(((v->xsize - 0.5) / 2.0) + v->xmin);
+ v->trans.Y = (float)(((v->ysize - 0.5) / 2.0) + v->ymin);
+ v->trans.Z = (float)(((zsize - 0.5) / 2.0) + ((1 << ZB_POINT_Z_FRAC_BITS)) / 2);
- v->scale.X = (v->xsize - 0.5) / 2.0;
- v->scale.Y = -(v->ysize - 0.5) / 2.0;
- v->scale.Z = -((zsize - 0.5) / 2.0);
+ v->scale.X = (float)((v->xsize - 0.5) / 2.0);
+ v->scale.Y = (float)(-(v->ysize - 0.5) / 2.0);
+ v->scale.Z = (float)(-((zsize - 0.5) / 2.0));
}
void glopBegin(GLContext * c, TGLParam * p)
Index: zgl.h
===================================================================
RCS file: /cvsroot/scummvm/residual/tinygl/zgl.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- zgl.h 12 Jan 2005 18:00:19 -0000 1.3
+++ zgl.h 13 Jan 2005 00:15:15 -0000 1.4
@@ -356,7 +356,7 @@
{
float w;
- w=w1 * (1.0 + CLIP_EPSILON);
+ w=(float)(w1 * (1.0 + CLIP_EPSILON));
return (x<-w) |
((x>w)<<1) |
((y<-w)<<2) |
Index: ztriangle.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/tinygl/ztriangle.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ztriangle.cpp 12 Jan 2005 15:26:45 -0000 1.2
+++ ztriangle.cpp 13 Jan 2005 00:15:15 -0000 1.3
@@ -298,7 +298,7 @@
float sz,tz,fz,zinv; \
n=(x2>>16)-x1; \
fz=(float)z1;\
- zinv=1.0 / fz;\
+ zinv=(float)(1.0 / fz);\
pp=(PIXEL *)((char *)pp1 + x1 * PSZB); \
pz=pz1+x1; \
z=z1; \
@@ -314,7 +314,7 @@
dsdx= (int)( (dszdx - ss*fdzdx)*zinv );\
dtdx= (int)( (dtzdx - tt*fdzdx)*zinv );\
fz+=fndzdx;\
- zinv=1.0 / fz;\
+ zinv=(float)(1.0 / fz);\
}\
PUT_PIXEL(0); \
PUT_PIXEL(1); \
Index: ztriangle.h
===================================================================
RCS file: /cvsroot/scummvm/residual/tinygl/ztriangle.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ztriangle.h 12 Jan 2005 15:20:02 -0000 1.1
+++ ztriangle.h 13 Jan 2005 00:15:15 -0000 1.2
@@ -52,16 +52,16 @@
/* we compute dXdx and dXdy for all interpolated values */
- fdx1 = p1->x - p0->x;
- fdy1 = p1->y - p0->y;
+ fdx1 = (float)(p1->x - p0->x);
+ fdy1 = (float)(p1->y - p0->y);
- fdx2 = p2->x - p0->x;
- fdy2 = p2->y - p0->y;
+ fdx2 = (float)(p2->x - p0->x);
+ fdy2 = (float)(p2->y - p0->y);
fz = fdx1 * fdy2 - fdx2 * fdy1;
if (fz == 0)
return;
- fz = 1.0 / fz;
+ fz = (float)(1.0 / fz);
fdx1 *= fz;
fdy1 *= fz;
@@ -69,38 +69,38 @@
fdy2 *= fz;
#ifdef INTERP_Z
- d1 = p1->z - p0->z;
- d2 = p2->z - p0->z;
+ d1 = (float)(p1->z - p0->z);
+ d2 = (float)(p2->z - p0->z);
dzdx = (int) (fdy2 * d1 - fdy1 * d2);
dzdy = (int) (fdx1 * d2 - fdx2 * d1);
#endif
#ifdef INTERP_RGB
- d1 = p1->r - p0->r;
- d2 = p2->r - p0->r;
+ d1 = (float)(p1->r - p0->r);
+ d2 = (float)(p2->r - p0->r);
drdx = (int) (fdy2 * d1 - fdy1 * d2);
drdy = (int) (fdx1 * d2 - fdx2 * d1);
- d1 = p1->g - p0->g;
- d2 = p2->g - p0->g;
+ d1 = (float)(p1->g - p0->g);
+ d2 = (float)(p2->g - p0->g);
dgdx = (int) (fdy2 * d1 - fdy1 * d2);
dgdy = (int) (fdx1 * d2 - fdx2 * d1);
- d1 = p1->b - p0->b;
- d2 = p2->b - p0->b;
+ d1 = (float)(p1->b - p0->b);
+ d2 = (float)(p2->b - p0->b);
dbdx = (int) (fdy2 * d1 - fdy1 * d2);
dbdy = (int) (fdx1 * d2 - fdx2 * d1);
#endif
#ifdef INTERP_ST
- d1 = p1->s - p0->s;
- d2 = p2->s - p0->s;
+ d1 = (float)(p1->s - p0->s);
+ d2 = (float)(p2->s - p0->s);
dsdx = (int) (fdy2 * d1 - fdy1 * d2);
dsdy = (int) (fdx1 * d2 - fdx2 * d1);
- d1 = p1->t - p0->t;
- d2 = p2->t - p0->t;
+ d1 = (float)(p1->t - p0->t);
+ d2 = (float)(p2->t - p0->t);
dtdx = (int) (fdy2 * d1 - fdy1 * d2);
dtdy = (int) (fdx1 * d2 - fdx2 * d1);
#endif
More information about the Scummvm-git-logs
mailing list