From 0ddc77f9137e014bf22ea9a240c3a4ca0d239cd2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 19 Dec 2012 01:48:54 +0000 Subject: code cleanup: warnings --- source/blender/editors/space_clip/clip_intern.h | 2 +- source/blender/makesrna/intern/rna_scene.c | 4 ++-- source/blender/render/intern/source/multires_bake.c | 4 ++-- source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 2 +- source/gameengine/Converter/BL_BlenderDataConversion.cpp | 4 +--- source/gameengine/Rasterizer/RAS_BucketManager.cpp | 4 ++-- .../Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp | 2 +- source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp | 2 +- source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp | 6 +++--- .../gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.cpp | 2 +- 10 files changed, 15 insertions(+), 17 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_clip/clip_intern.h b/source/blender/editors/space_clip/clip_intern.h index ac5cfbaed11..432032e9dbf 100644 --- a/source/blender/editors/space_clip/clip_intern.h +++ b/source/blender/editors/space_clip/clip_intern.h @@ -54,7 +54,7 @@ struct wmOperatorType; /* extra padding for lengths (to go under scrollers) */ #define EXTRA_SCROLL_PAD 100.0f -#define STRIP_HEIGHT_HALF (0.25 * UI_UNIT_Y) +#define STRIP_HEIGHT_HALF (0.25f * UI_UNIT_Y) /* internal exports only */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 0501cecd71e..4c32fefe5ab 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2448,8 +2448,8 @@ static void rna_def_scene_game_data(BlenderRNA *brna) {RAS_STORE_AUTO, "AUTO", 0, "Auto Select", "Chooses the best supported mode"}, {RAS_STORE_IMMEDIATE, "IMMEDIATE", 0, "Immediate Mode", "Slowest performance, requires OpenGL (any version)"}, {RAS_STORE_VA, "VERTEX_ARRAY", 0, "Vertex Arrays", "Better performance, requires at least OpenGL 1.1"}, - /* VBOS are currently disabled since they cannot beat vertex array with display lists in performance. 8? - /*{RAS_STORE_VBO, "VERTEX_BUFFER_OBJECT", 0, "Vertex Buffer Objects", "Best performance, requires at least OpenGL 1.4"},*/ + /* VBOS are currently disabled since they cannot beat vertex array with display lists in performance. 8? */ + // {RAS_STORE_VBO, "VERTEX_BUFFER_OBJECT", 0, "Vertex Buffer Objects", "Best performance, requires at least OpenGL 1.4"}, {0, NULL, 0, NULL, NULL}}; srna = RNA_def_struct(brna, "SceneGameData", NULL); diff --git a/source/blender/render/intern/source/multires_bake.c b/source/blender/render/intern/source/multires_bake.c index 0eb0c9a51c3..44fc6476977 100644 --- a/source/blender/render/intern/source/multires_bake.c +++ b/source/blender/render/intern/source/multires_bake.c @@ -1042,13 +1042,13 @@ static void apply_ao_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, cons const float JitPh = (get_ao_random2(I + perm_offs) & (MAX_NUMBER_OF_AO_RAYS-1))/((float) MAX_NUMBER_OF_AO_RAYS); const float JitTh = (get_ao_random1(J + perm_offs) & (MAX_NUMBER_OF_AO_RAYS-1))/((float) MAX_NUMBER_OF_AO_RAYS); const float SiSqPhi = (I + JitPh) / ao_data->number_of_rays; - const float Theta = 2 * M_PI * ((J + JitTh) / ao_data->number_of_rays); + const float Theta = (float)(2 * M_PI) * ((J + JitTh) / ao_data->number_of_rays); /* this gives results identical to the so-called cosine * weighted distribution relative to the north pole. */ float SiPhi = sqrt(SiSqPhi); - float CoPhi = SiSqPhi < 1.0f ? sqrt(1.0f - SiSqPhi) : 1.0f - SiSqPhi; + float CoPhi = SiSqPhi < 1.0f ? sqrtf(1.0f - SiSqPhi) : 1.0f - SiSqPhi; float CoThe = cos(Theta); float SiThe = sin(Theta); diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 9f788b29ac6..482700d5958 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -269,7 +269,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c #ifdef WITH_PYTHON bool nodepwarnings = (SYS_GetCommandLineInt(syshandle, "ignore_deprecation_warnings", 0) != 0); #endif - bool novertexarrays = (SYS_GetCommandLineInt(syshandle, "novertexarrays", 0) != 0); + // bool novertexarrays = (SYS_GetCommandLineInt(syshandle, "novertexarrays", 0) != 0); bool mouse_state = startscene->gm.flag & GAME_SHOW_MOUSE; bool restrictAnimFPS = startscene->gm.flag & GAME_RESTRICT_ANIM_UPDATES; diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 15fc5ba76c7..f9586e32816 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -532,8 +532,6 @@ static void GetUVs(BL_Material *material, MTF_localLayer *layers, MFace *mface, if (map.uvCoName.IsEmpty() || strcmp(map.uvCoName.ReadPtr(), layer.name)==0) { - MT_Point2 uvSet[4]; - uvs[0][unit].setValue(layer.face->uv[0]); uvs[1][unit].setValue(layer.face->uv[1]); uvs[2][unit].setValue(layer.face->uv[2]); @@ -881,7 +879,7 @@ static bool ConvertMaterial( return true; } -RAS_MaterialBucket* material_from_mesh(Material *ma, MFace *mface, MTFace *tface, MCol *mcol, MTF_localLayer *layers, int lightlayer, unsigned int *rgb, MT_Point2 uvs[4][RAS_TexVert::MAX_UNIT], const char *tfaceName, KX_Scene* scene, KX_BlenderSceneConverter *converter) +static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace *tface, MCol *mcol, MTF_localLayer *layers, int lightlayer, unsigned int *rgb, MT_Point2 uvs[4][RAS_TexVert::MAX_UNIT], const char *tfaceName, KX_Scene* scene, KX_BlenderSceneConverter *converter) { RAS_IPolyMaterial* polymat = converter->FindCachedPolyMaterial(ma); BL_Material* bl_mat = converter->FindCachedBlenderMaterial(ma); diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index 2b5b0aeac2a..df72056565b 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -237,13 +237,13 @@ void RAS_BucketManager::Renderbuckets( BucketList::iterator bit; list::iterator mit; for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit) { - RAS_MaterialBucket* bucket = *bit; + // RAS_MaterialBucket *bucket = *bit; /* UNUSED */ for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) { mit->m_mesh->SetMeshModified(false); } } for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit) { - RAS_MaterialBucket* bucket = *bit; + // RAS_MaterialBucket* bucket = *bit; /* UNUSED */ for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) { mit->m_mesh->SetMeshModified(false); } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 1328a5521b4..a9609a266e8 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -119,7 +119,7 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas, int storage) m_failsafe_storage = new RAS_StorageIM(&m_texco_num, m_texco, &m_attrib_num, m_attrib); m_storage_type = RAS_VBO; } - else if (m_storage_type == RAS_VA || m_storage_type == RAS_AUTO_STORAGE && GLEW_VERSION_1_1) + else if ((m_storage_type == RAS_VA) || (m_storage_type == RAS_AUTO_STORAGE && GLEW_VERSION_1_1)) { m_storage = new RAS_StorageVA(&m_texco_num, m_texco, &m_attrib_num, m_attrib); m_failsafe_storage = new RAS_StorageIM(&m_texco_num, m_texco, &m_attrib_num, m_attrib); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp index 7b38b3b42f3..490c26a5c3b 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp @@ -41,8 +41,8 @@ extern "C"{ RAS_StorageIM::RAS_StorageIM(int *texco_num, RAS_IRasterizer::TexCoGen *texco, int *attrib_num, RAS_IRasterizer::TexCoGen *attrib) : m_texco_num(texco_num), - m_texco(texco), m_attrib_num(attrib_num), + m_texco(texco), m_attrib(attrib) { } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp index e0d580eff11..7182525ea71 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp @@ -31,11 +31,11 @@ RAS_StorageVA::RAS_StorageVA(int *texco_num, RAS_IRasterizer::TexCoGen *texco, int *attrib_num, RAS_IRasterizer::TexCoGen *attrib) : m_texco_num(texco_num), - m_texco(texco), m_attrib_num(attrib_num), - m_attrib(attrib), m_last_texco_num(0), - m_last_attrib_num(0) + m_last_attrib_num(0), + m_texco(texco), + m_attrib(attrib) { } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.cpp index d40aa98295b..3fba6698e25 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.cpp @@ -206,8 +206,8 @@ void VBO::Draw(int texco_num, RAS_IRasterizer::TexCoGen* texco, int attrib_num, RAS_StorageVBO::RAS_StorageVBO(int *texco_num, RAS_IRasterizer::TexCoGen *texco, int *attrib_num, RAS_IRasterizer::TexCoGen *attrib): m_texco_num(texco_num), - m_texco(texco), m_attrib_num(attrib_num), + m_texco(texco), m_attrib(attrib) { } -- cgit v1.2.3