diff options
Diffstat (limited to 'source/gameengine')
9 files changed, 66 insertions, 66 deletions
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index cedc27c3b92..82b26749fd1 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp @@ -495,10 +495,10 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) glBegin(GL_QUADS); glColor4f(1.f, 1.f, 1.f, 1.f); - glTexCoord2f(1.0, 1.0); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[1], canvascoord[3]); glVertex2f(1,1); - glTexCoord2f(0.0, 1.0); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[0], canvascoord[3]); glVertex2f(-1,1); - glTexCoord2f(0.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[0], canvascoord[2]); glVertex2f(-1,-1); - glTexCoord2f(1.0, 0.0); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[1], canvascoord[2]); glVertex2f(1,-1); + glTexCoord2f(1.0f, 1.0f); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[1], canvascoord[3]); glVertex2f(1.0f,1.0f); + glTexCoord2f(0.0f, 1.0f); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[0], canvascoord[3]); glVertex2f(-1.0f,1.0f); + glTexCoord2f(0.0f, 0.0f); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[0], canvascoord[2]); glVertex2f(-1.0f,-1.0f); + glTexCoord2f(1.0f, 0.0f); glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[1], canvascoord[2]); glVertex2f(1.0f,-1.0f); glEnd(); } } diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index f90b5959f76..d131891cb90 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -282,7 +282,7 @@ void RAS_BucketManager::OptimizeBuckets(MT_Scalar distance) { BucketList::iterator bit; - distance = 10.0; + distance = 10.0f; for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit) (*bit)->Optimize(distance); diff --git a/source/gameengine/Rasterizer/RAS_CameraData.h b/source/gameengine/Rasterizer/RAS_CameraData.h index e2024a4a55d..bc8433afd05 100644 --- a/source/gameengine/Rasterizer/RAS_CameraData.h +++ b/source/gameengine/Rasterizer/RAS_CameraData.h @@ -51,10 +51,10 @@ struct RAS_CameraData int m_viewporttop; float m_focallength; - RAS_CameraData(float lens = 35.0, float scale = 6.0, float sensor_x = 32.0, float sensor_y = 18.0, short sensor_fit = 0, - float shift_x = 0.0, float shift_y = 0.0, - float clipstart = 0.1, float clipend = 5000.0, bool perspective = true, - float focallength = 3.0, bool viewport = false, int viewportleft = 0, int viewportbottom = 0, + RAS_CameraData(float lens = 35.0f, float scale = 6.0f, float sensor_x = 32.0f, float sensor_y = 18.0f, short sensor_fit = 0, + float shift_x = 0.0f, float shift_y = 0.0f, + float clipstart = 0.1f, float clipend = 5000.0f, bool perspective = true, + float focallength = 3.0f, bool viewport = false, int viewportleft = 0, int viewportbottom = 0, int viewportright = 0, int viewporttop = 0) : m_lens(lens), m_scale(scale), diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.cpp b/source/gameengine/Rasterizer/RAS_FramingManager.cpp index c5f15c9ad21..8b0ec22fde3 100644 --- a/source/gameengine/Rasterizer/RAS_FramingManager.cpp +++ b/source/gameengine/Rasterizer/RAS_FramingManager.cpp @@ -283,14 +283,14 @@ ComputeFrustum( switch (sensor_fit) { case RAS_SENSORFIT_HOR: { - x_scale = 1.0; + x_scale = 1.0f; y_scale = float(viewport.GetHeight()) / float(viewport.GetWidth()); break; } case RAS_SENSORFIT_VERT: { x_scale = float(viewport.GetWidth()) / float(viewport.GetHeight()); - y_scale = 1.0; + y_scale = 1.0f; break; } case RAS_SENSORFIT_AUTO: @@ -377,14 +377,14 @@ RAS_FramingManager:: switch (sensor_fit) { case RAS_SENSORFIT_HOR: { - x_scale = 1.0; + x_scale = 1.0f; y_scale = float(viewport.GetHeight()) / float(viewport.GetWidth()); break; } case RAS_SENSORFIT_VERT: { x_scale = float(viewport.GetWidth()) / float(viewport.GetHeight()); - y_scale = 1.0; + y_scale = 1.0f; break; } case RAS_SENSORFIT_AUTO: diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index d07b4910968..2a736aa7deb 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -62,10 +62,10 @@ void RAS_IPolyMaterial::Initialize( m_polymatid = m_newpolymatid++; m_flag = 0; m_multimode = 0; - m_shininess = 35.0; - m_specular.setValue(0.5,0.5,0.5); - m_specularity = 1.0; - m_diffuse.setValue(0.5,0.5,0.5); + m_shininess = 35.0f; + m_specular.setValue(0.5f,0.5f,0.5f); + m_specularity = 1.0f; + m_diffuse.setValue(0.5f,0.5f,0.5f); m_drawingmode = ConvertFaceMode(game, image); } @@ -85,10 +85,10 @@ RAS_IPolyMaterial::RAS_IPolyMaterial() m_flag(0), m_multimode(0) { - m_shininess = 35.0; - m_specular = MT_Vector3(0.5,0.5,0.5); - m_specularity = 1.0; - m_diffuse = MT_Vector3(0.5,0.5,0.5); + m_shininess = 35.0f; + m_specular = MT_Vector3(0.5f,0.5f,0.5f); + m_specularity = 1.0f; + m_diffuse = MT_Vector3(0.5f,0.5f,0.5f); } RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, @@ -113,10 +113,10 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, m_flag(0), m_multimode(0) { - m_shininess = 35.0; - m_specular = MT_Vector3(0.5,0.5,0.5); - m_specularity = 1.0; - m_diffuse = MT_Vector3(0.5,0.5,0.5); + m_shininess = 35.0f; + m_specular = MT_Vector3(0.5f,0.5f,0.5f); + m_specularity = 1.0f; + m_diffuse = MT_Vector3(0.5f,0.5f,0.5f); } diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index 13d49c53423..9cd8f77adfd 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -58,7 +58,7 @@ RAS_MeshSlot::RAS_MeshSlot() : SG_QList() m_bVisible = false; m_bCulled = true; m_bObjectColor = false; - m_RGBAcolor = MT_Vector4(0.0, 0.0, 0.0, 0.0); + m_RGBAcolor = MT_Vector4(0.0f, 0.0f, 0.0f, 0.0f); m_DisplayList = NULL; m_bDisplayList = true; m_joinSlot = NULL; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp index c6d9981cb3c..8319b75331f 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp @@ -100,13 +100,13 @@ bool RAS_OpenGLLight::ApplyFixedFunctionLighting(KX_Scene *kxscene, int oblayer, //vec[0] = base->object->obmat[2][0]; //vec[1] = base->object->obmat[2][1]; //vec[2] = base->object->obmat[2][2]; - vec[3] = 0.0; + vec[3] = 0.0f; glLightfv((GLenum)(GL_LIGHT0+slot), GL_POSITION, vec); } else { - //vec[3] = 1.0; + //vec[3] = 1.0f; glLightfv((GLenum)(GL_LIGHT0+slot), GL_POSITION, vec); - glLightf((GLenum)(GL_LIGHT0+slot), GL_CONSTANT_ATTENUATION, 1.0); + glLightf((GLenum)(GL_LIGHT0+slot), GL_CONSTANT_ATTENUATION, 1.0f); glLightf((GLenum)(GL_LIGHT0+slot), GL_LINEAR_ATTENUATION, m_att1/m_distance); // without this next line it looks backward compatible. //attennuation still is acceptable @@ -124,30 +124,30 @@ bool RAS_OpenGLLight::ApplyFixedFunctionLighting(KX_Scene *kxscene, int oblayer, glLightf((GLenum)(GL_LIGHT0+slot), GL_SPOT_EXPONENT, 128.0f * m_spotblend); } else { - glLightf((GLenum)(GL_LIGHT0+slot), GL_SPOT_CUTOFF, 180.0); + glLightf((GLenum)(GL_LIGHT0+slot), GL_SPOT_CUTOFF, 180.0f); } } if (m_nodiffuse) { - vec[0] = vec[1] = vec[2] = vec[3] = 0.0; + vec[0] = vec[1] = vec[2] = vec[3] = 0.0f; } else { vec[0] = m_energy*m_color[0]; vec[1] = m_energy*m_color[1]; vec[2] = m_energy*m_color[2]; - vec[3] = 1.0; + vec[3] = 1.0f; } glLightfv((GLenum)(GL_LIGHT0+slot), GL_DIFFUSE, vec); if (m_nospecular) { - vec[0] = vec[1] = vec[2] = vec[3] = 0.0; + vec[0] = vec[1] = vec[2] = vec[3] = 0.0f; } else if (m_nodiffuse) { vec[0] = m_energy*m_color[0]; vec[1] = m_energy*m_color[1]; vec[2] = m_energy*m_color[2]; - vec[3] = 1.0; + vec[3] = 1.0f; } glLightfv((GLenum)(GL_LIGHT0+slot), GL_SPECULAR, vec); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 54cffcc3c18..e7b5bebd5e8 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -89,17 +89,17 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas, RAS_STORAGE_TYPE :RAS_IRasterizer(canvas), m_2DCanvas(canvas), m_fogenabled(false), - m_time(0.0), + m_time(0.0f), m_campos(0.0f, 0.0f, 0.0f), m_camortho(false), m_stereomode(RAS_STEREO_NOSTEREO), m_curreye(RAS_STEREO_LEFTEYE), - m_eyeseparation(0.0), - m_focallength(0.0), + m_eyeseparation(0.0f), + m_focallength(0.0f), m_setfocallength(false), m_noOfScanlines(32), m_motionblur(0), - m_motionblurvalue(-1.0), + m_motionblurvalue(-1.0f), m_usingoverrideshader(false), m_clientobject(NULL), m_auxilaryClientInfo(NULL), @@ -171,10 +171,10 @@ bool RAS_OpenGLRasterizer::Init() glFrontFace(GL_CCW); m_last_frontface = true; - m_redback = 0.4375; - m_greenback = 0.4375; - m_blueback = 0.4375; - m_alphaback = 0.0; + m_redback = 0.4375f; + m_greenback = 0.4375f; + m_blueback = 0.4375f; + m_alphaback = 0.0f; glClearColor(m_redback,m_greenback,m_blueback,m_alphaback); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); @@ -249,7 +249,7 @@ void RAS_OpenGLRasterizer::Exit() glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); - glClearDepth(1.0); + glClearDepth(1.0f); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glClearColor(m_redback, m_greenback, m_blueback, m_alphaback); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -383,7 +383,7 @@ void RAS_OpenGLRasterizer::FlushDebugShapes(SCA_IScene *scene) glBegin(GL_LINE_LOOP); glColor4f(debugShapes[i].m_color[0], debugShapes[i].m_color[1], debugShapes[i].m_color[2], 1.0f); - static const MT_Vector3 worldUp(0.0, 0.0, 1.0); + static const MT_Vector3 worldUp(0.0f, 0.0f, 1.0f); MT_Vector3 norm = debugShapes[i].m_param; MT_Matrix3x3 tr; if (norm.fuzzyZero() || norm == worldUp) @@ -403,8 +403,8 @@ void RAS_OpenGLRasterizer::FlushDebugShapes(SCA_IScene *scene) int n = (int)debugShapes[i].m_param2.y(); for (int j = 0; j<n; j++) { - MT_Scalar theta = j*M_PI*2/n; - MT_Vector3 pos(cos(theta) * rad, sin(theta) * rad, 0.0); + MT_Scalar theta = j*(float)M_PI*2/n; + MT_Vector3 pos(cos(theta) * rad, sin(theta) * rad, 0.0f); pos = pos*tr; pos += debugShapes[i].m_pos; const MT_Scalar* posPtr = &pos.x(); @@ -546,7 +546,7 @@ void RAS_OpenGLRasterizer::SetEye(const StereoEye eye) glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); } else { - //glAccum(GL_LOAD, 1.0); + //glAccum(GL_LOAD, 1.0f); glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_FALSE); ClearDepthBuffer(); } @@ -826,7 +826,7 @@ void RAS_OpenGLRasterizer::SetProjectionMatrix(MT_CmMatrix4x4 &mat) float* matrix = &mat(0, 0); glLoadMatrixf(matrix); - m_camortho = (mat(3, 3) != 0.0); + m_camortho = (mat(3, 3) != 0.0f); } void RAS_OpenGLRasterizer::SetProjectionMatrix(const MT_Matrix4x4 & mat) @@ -838,7 +838,7 @@ void RAS_OpenGLRasterizer::SetProjectionMatrix(const MT_Matrix4x4 & mat) /* Internally, MT_Matrix4x4 uses doubles (MT_Scalar). */ glLoadMatrixf(matrix); - m_camortho= (mat[3][3] != 0.0); + m_camortho= (mat[3][3] != 0.0f); } MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix( @@ -931,8 +931,8 @@ void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat, // correction for stereo if (Stereo() && perspective) { - MT_Vector3 unitViewDir(0.0, -1.0, 0.0); // minus y direction, Blender convention - MT_Vector3 unitViewupVec(0.0, 0.0, 1.0); + MT_Vector3 unitViewDir(0.0f, -1.0f, 0.0f); // minus y direction, Blender convention + MT_Vector3 unitViewupVec(0.0f, 0.0f, 1.0f); MT_Vector3 viewDir, viewupVec; MT_Vector3 eyeline; @@ -950,7 +950,7 @@ void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat, // translate to left by half the eye distance MT_Transform transform; transform.setIdentity(); - transform.translate(-(eyeline * m_eyeseparation / 2.0)); + transform.translate(-(eyeline * m_eyeseparation / 2.0f)); m_viewmatrix *= transform; } break; @@ -959,7 +959,7 @@ void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat, // translate to right by half the eye distance MT_Transform transform; transform.setIdentity(); - transform.translate(eyeline * m_eyeseparation / 2.0); + transform.translate(eyeline * m_eyeseparation / 2.0f); m_viewmatrix *= transform; } break; @@ -1066,7 +1066,7 @@ void RAS_OpenGLRasterizer::EnableMotionBlur(float motionblurvalue) void RAS_OpenGLRasterizer::DisableMotionBlur() { m_motionblur = 0; - m_motionblurvalue = -1.0; + m_motionblurvalue = -1.0f; } void RAS_OpenGLRasterizer::SetAlphaBlend(int alphablend) @@ -1337,14 +1337,14 @@ void RAS_OpenGLRasterizer::applyTransform(float* oglmatrix,int objectdrawmode ) //page 360/361 3D Game Engine Design, David Eberly for a discussion // on screen aligned and axis aligned billboards // assumed is that the preprocessor transformed all billboard polygons - // so that their normal points into the positive x direction (1.0, 0.0, 0.0) + // so that their normal points into the positive x direction (1.0f, 0.0f, 0.0f) // when new parenting for objects is done, this rotation // will be moved into the object MT_Point3 objpos (oglmatrix[12],oglmatrix[13],oglmatrix[14]); MT_Point3 campos = GetCameraPosition(); MT_Vector3 dir = (campos - objpos).safe_normalized(); - MT_Vector3 up(0,0,1.0); + MT_Vector3 up(0,0,1.0f); KX_GameObject* gameobj = (KX_GameObject*)m_clientobject; // get scaling of halo object @@ -1591,13 +1591,13 @@ void RAS_OpenGLRasterizer::MotionBlur() if (state==1) { //bugfix:load color buffer into accum buffer for the first time(state=1) - glAccum(GL_LOAD, 1.0); + glAccum(GL_LOAD, 1.0f); SetMotionBlurState(2); } else if (motionblurvalue >= 0.0f && motionblurvalue <= 1.0f) { glAccum(GL_MULT, motionblurvalue); glAccum(GL_ACCUM, 1-motionblurvalue); - glAccum(GL_RETURN, 1.0); + glAccum(GL_RETURN, 1.0f); glFlush(); } } diff --git a/source/gameengine/Rasterizer/RAS_TexVert.cpp b/source/gameengine/Rasterizer/RAS_TexVert.cpp index e6edc064200..2e176360d61 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.cpp +++ b/source/gameengine/Rasterizer/RAS_TexVert.cpp @@ -66,10 +66,10 @@ const MT_Point3& RAS_TexVert::xyz() void RAS_TexVert::SetRGBA(const MT_Vector4& rgba) { unsigned char *colp = (unsigned char*) &m_rgba; - colp[0] = (unsigned char) (rgba[0] * 255.0); - colp[1] = (unsigned char) (rgba[1] * 255.0); - colp[2] = (unsigned char) (rgba[2] * 255.0); - colp[3] = (unsigned char) (rgba[3] * 255.0); + colp[0] = (unsigned char) (rgba[0] * 255.0f); + colp[1] = (unsigned char) (rgba[1] * 255.0f); + colp[2] = (unsigned char) (rgba[2] * 255.0f); + colp[3] = (unsigned char) (rgba[3] * 255.0f); } @@ -153,12 +153,12 @@ unsigned int RAS_TexVert::getUnit() const void RAS_TexVert::Transform(const MT_Matrix4x4& mat, const MT_Matrix4x4& nmat) { - SetXYZ((mat * MT_Vector4(m_localxyz[0], m_localxyz[1], m_localxyz[2], 1.0)).getValue()); - SetNormal((nmat * MT_Vector4(m_normal[0], m_normal[1], m_normal[2], 1.0)).getValue()); - SetTangent((nmat * MT_Vector4(m_tangent[0], m_tangent[1], m_tangent[2], 1.0)).getValue()); + SetXYZ((mat * MT_Vector4(m_localxyz[0], m_localxyz[1], m_localxyz[2], 1.0f)).getValue()); + SetNormal((nmat * MT_Vector4(m_normal[0], m_normal[1], m_normal[2], 1.0f)).getValue()); + SetTangent((nmat * MT_Vector4(m_tangent[0], m_tangent[1], m_tangent[2], 1.0f)).getValue()); } void RAS_TexVert::TransformUV(int index, const MT_Matrix4x4& mat) { - SetUV(index, (mat * MT_Vector4(m_uvs[index][0], m_uvs[index][1], 0.0, 1.0)).getValue()); + SetUV(index, (mat * MT_Vector4(m_uvs[index][0], m_uvs[index][1], 0.0f, 1.0f)).getValue()); } |