Commit: d9ee88d126ddb59b68d2561694b522a99e4923b6 Author: Jorge Bernal Date: Sun Dec 13 03:17:19 2015 +0100 Branches: master https://developer.blender.org/rBd9ee88d126ddb59b68d2561694b522a99e4923b6
BGE Rasterizer clean up: double-promotion warnings =================================================================== M source/gameengine/Rasterizer/RAS_2DFilterManager.cpp M source/gameengine/Rasterizer/RAS_BucketManager.cpp M source/gameengine/Rasterizer/RAS_CameraData.h M source/gameengine/Rasterizer/RAS_FramingManager.cpp M source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp M source/gameengine/Rasterizer/RAS_MaterialBucket.cpp M source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp M source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp M source/gameengine/Rasterizer/RAS_TexVert.cpp =================================================================== diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index cedc27c..82b2674 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 f90b595..d131891 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 e2024a4..bc8433a 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 c5f15c9..8b0ec22 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 d07b491..2a736aa 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 13d49c5..9cd8f77 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 c6d9981..8319b75 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 54cffcc..e7b5beb 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_L @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs