remove a few warnings in DemoApplication

This commit is contained in:
erwin.coumans
2010-01-19 23:29:19 +00:00
parent 7b41af1765
commit 8da244b443
5 changed files with 45 additions and 41 deletions

View File

@@ -118,12 +118,12 @@ void DemoApplication::overrideGLShapeDrawer (GL_ShapeDrawer* shapeDrawer)
void DemoApplication::myinit(void)
{
GLfloat light_ambient[] = { 0.2, 0.2, 0.2, 1.0 };
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat light_ambient[] = { btScalar(0.2), btScalar(0.2), btScalar(0.2), btScalar(1.0) };
GLfloat light_diffuse[] = { btScalar(1.0), btScalar(1.0), btScalar(1.0), btScalar(1.0) };
GLfloat light_specular[] = { btScalar(1.0), btScalar(1.0), btScalar(1.0), btScalar(1.0 )};
/* light_position is NOT default value */
GLfloat light_position0[] = { 1.0, 10.0, 1.0, 0.0 };
GLfloat light_position1[] = { -1.0, -10.0, -1.0, 0.0 };
GLfloat light_position0[] = { btScalar(1.0), btScalar(10.0), btScalar(1.0), btScalar(0.0 )};
GLfloat light_position1[] = { btScalar(-1.0), btScalar(-10.0), btScalar(-1.0), btScalar(0.0) };
glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
@@ -144,7 +144,7 @@ void DemoApplication::myinit(void)
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glClearColor(0.7,0.7,0.7,0);
glClearColor(btScalar(0.7),btScalar(0.7),btScalar(0.7),btScalar(0));
// glEnable(GL_CULL_FACE);
// glCullFace(GL_BACK);
@@ -180,8 +180,8 @@ void DemoApplication::updateCamera() {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
float rele = m_ele * 0.01745329251994329547;// rads per deg
float razi = m_azi * 0.01745329251994329547;// rads per deg
btScalar rele = m_ele * btScalar(0.01745329251994329547);// rads per deg
btScalar razi = m_azi * btScalar(0.01745329251994329547);// rads per deg
btQuaternion rot(m_cameraUp,razi);
@@ -277,14 +277,14 @@ void DemoApplication::stepBack()
}
void DemoApplication::zoomIn()
{
m_cameraDistance -= 0.4; updateCamera();
if (m_cameraDistance < 0.1)
m_cameraDistance = 0.1;
m_cameraDistance -= btScalar(0.4); updateCamera();
if (m_cameraDistance < btScalar(0.1))
m_cameraDistance = btScalar(0.1);
}
void DemoApplication::zoomOut()
{
m_cameraDistance += 0.4; updateCamera();
m_cameraDistance += btScalar(0.4); updateCamera();
}
@@ -596,7 +596,7 @@ btVector3 DemoApplication::getRayTo(int x,int y)
float bottom = -1.f;
float nearPlane = 1.f;
float tanFov = (top-bottom)*0.5f / nearPlane;
float fov = 2.0 * atanf (tanFov);
float fov = btScalar(2.0) * btAtan(tanFov);
btVector3 rayFrom = getCameraPosition();
btVector3 rayForward = (getCameraTargetPosition()-getCameraPosition());
@@ -639,8 +639,8 @@ btVector3 DemoApplication::getRayTo(int x,int y)
btVector3 rayTo = rayToCenter - 0.5f * hor + 0.5f * vertical;
rayTo += x * dHor;
rayTo -= y * dVert;
rayTo += btScalar(x) * dHor;
rayTo -= btScalar(y) * dVert;
return rayTo;
}
@@ -847,8 +847,8 @@ void DemoApplication::mouseMotionFunc(int x,int y)
}
float dx, dy;
dx = x - m_mouseOldX;
dy = y - m_mouseOldY;
dx = btScalar(x) - m_mouseOldX;
dy = btScalar(y) - m_mouseOldY;
///only if ALT key is pressed (Maya style)
@@ -858,8 +858,8 @@ void DemoApplication::mouseMotionFunc(int x,int y)
{
btVector3 hor = getRayTo(0,0)-getRayTo(1,0);
btVector3 vert = getRayTo(0,0)-getRayTo(0,1);
btScalar multiplierX = 0.01;
btScalar multiplierY = 0.01;
btScalar multiplierX = btScalar(0.01);
btScalar multiplierY = btScalar(0.01);
if (m_ortho)
{
multiplierX = 1;
@@ -876,16 +876,16 @@ void DemoApplication::mouseMotionFunc(int x,int y)
}
else if(m_mouseButtons & 1)
{
m_azi += dx * 0.2;
m_azi = fmodf(m_azi, 360.f);
m_ele += dy * 0.2;
m_ele = fmodf(m_ele, 180.f);
m_azi += dx * btScalar(0.2);
m_azi = fmodf(m_azi, btScalar(360.f));
m_ele += dy * btScalar(0.2);
m_ele = fmodf(m_ele, btScalar(180.f));
}
else if(m_mouseButtons & 4)
{
m_cameraDistance -= dy * 0.2f;
if (m_cameraDistance<0.1)
m_cameraDistance = 0.1;
m_cameraDistance -= dy * btScalar(0.2f);
if (m_cameraDistance<btScalar(0.1))
m_cameraDistance = btScalar(0.1);
}
@@ -953,7 +953,7 @@ void DemoApplication::setOrthographicProjection()
glScalef(1, -1, 1);
// mover the origin from the bottom left corner
// to the upper left corner
glTranslatef(0, -m_glutScreenHeight, 0);
glTranslatef(btScalar(0), btScalar(-m_glutScreenHeight), btScalar(0));
}
@@ -973,7 +973,7 @@ extern CProfileIterator * m_profileIterator;
void DemoApplication::displayProfileString(int xOffset,int yStart,char* message)
{
glRasterPos3f(xOffset,yStart,0);
glRasterPos3f(btScalar(xOffset),btScalar(yStart),btScalar(0));
GLDebugDrawString(xOffset,yStart,message);
}
@@ -1113,7 +1113,7 @@ void DemoApplication::renderscene(int pass)
{
case 0: m_shapeDrawer->drawOpenGL(m,colObj->getCollisionShape(),wireColor,getDebugMode(),aabbMin,aabbMax);break;
case 1: m_shapeDrawer->drawShadow(m,m_sundirection*rot,colObj->getCollisionShape(),aabbMin,aabbMax);break;
case 2: m_shapeDrawer->drawOpenGL(m,colObj->getCollisionShape(),wireColor*0.3,0,aabbMin,aabbMax);break;
case 2: m_shapeDrawer->drawOpenGL(m,colObj->getCollisionShape(),wireColor*btScalar(0.3),0,aabbMin,aabbMax);break;
}
}
}
@@ -1178,7 +1178,7 @@ void DemoApplication::renderme()
int xOffset = 10;
int yStart = 20;
int yIncr = 20;
char buf[124];
glDisable(GL_LIGHTING);
glColor3f(0, 0, 0);
@@ -1191,7 +1191,7 @@ void DemoApplication::renderme()
#ifdef USE_QUICKPROF
if ( getDebugMode() & btIDebugDraw::DBG_ProfileTimings)
{
static int counter = 0;

View File

@@ -169,7 +169,7 @@ public:
btScalar getDeltaTimeMicroseconds()
{
#ifdef USE_BT_CLOCK
btScalar dt = m_clock.getTimeMicroseconds();
btScalar dt = (btScalar)m_clock.getTimeMicroseconds();
m_clock.reset();
return dt;
#else

View File

@@ -118,7 +118,7 @@ void GLDebugDrawStringInternal(int x,int y,const char* string, const btVector3&
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glTranslatef(x,sScreenHeight - y,0);
glTranslatef(btScalar(x),btScalar(sScreenHeight - y),btScalar(0));
#if USE_ARRAYS
@@ -151,13 +151,13 @@ void GLDebugDrawStringInternal(int x,int y,const char* string, const btVector3&
char ch = string[i]-32;
if (ch>=0)
{
cx=float(ch%16) * 1./16.f;
cy=float(ch/16) * 1./16.f;
cx=float(ch%16) * btScalar(1./16.f);
cy=float(ch/16) * btScalar(1./16.f);
uv_texcoords[0] = cx; uv_texcoords[1] = 1-cy-1./16.f;
uv_texcoords[2] = cx+1./16.f; uv_texcoords[3] = 1-cy-1./16.f;
uv_texcoords[4] = cx+1./16.f; uv_texcoords[5] = 1-cy;
uv_texcoords[6] = cx; uv_texcoords[7] = 1-cy;
uv_texcoords[0] = cx; uv_texcoords[1] = btScalar(1-cy-1./16.f);
uv_texcoords[2] = btScalar(cx+1./16.f); uv_texcoords[3] = btScalar(1-cy-1./16.f);
uv_texcoords[4] = btScalar(cx+1./16.f); uv_texcoords[5] = btScalar(1-cy);
uv_texcoords[6] = cx; uv_texcoords[7] = btScalar(1-cy);
#if USE_ARRAYS
glTexCoordPointer(2,GL_FLOAT,0,uv_texcoords);
glVertexPointer(3, GL_FLOAT, 0, verts);
@@ -196,7 +196,7 @@ void GLDebugDrawStringInternal(int x,int y,const char* string, const btVector3&
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glScalef(0.025,0.025,0.025);
glScalef(btScalar(0.025),btScalar(0.025),btScalar(0.025));
#endif
glMatrixMode(GL_MODELVIEW);
#if USE_ARRAYS