diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-30 15:49:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-30 15:49:58 +0400 |
commit | 2c43f99c0affd1837f7ee721061e486357f7b19d (patch) | |
tree | 403011bc4feed6594e4d863972ea841e5a63fbaa /source/gameengine | |
parent | 41cbc47fbe1598fc7f41f977d8c64a826c86be9d (diff) |
formatting edits, missed these last commit.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/BL_Material.cpp | 18 | ||||
-rw-r--r-- | source/gameengine/Ketsji/BL_Texture.cpp | 6 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Dome.cpp | 3 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_MeshProxy.cpp | 6 |
4 files changed, 22 insertions, 11 deletions
diff --git a/source/gameengine/Ketsji/BL_Material.cpp b/source/gameengine/Ketsji/BL_Material.cpp index fd0756d067d..092f9273a6b 100644 --- a/source/gameengine/Ketsji/BL_Material.cpp +++ b/source/gameengine/Ketsji/BL_Material.cpp @@ -98,21 +98,24 @@ void BL_Material::Initialize() } } -void BL_Material::SetConversionRGB(unsigned int *nrgb) { +void BL_Material::SetConversionRGB(unsigned int *nrgb) +{ rgb[0]=*nrgb++; rgb[1]=*nrgb++; rgb[2]=*nrgb++; rgb[3]=*nrgb; } -void BL_Material::GetConversionRGB(unsigned int *nrgb) { +void BL_Material::GetConversionRGB(unsigned int *nrgb) +{ *nrgb++ = rgb[0]; *nrgb++ = rgb[1]; *nrgb++ = rgb[2]; *nrgb = rgb[3]; } -void BL_Material::SetConversionUV(const STR_String& name, MT_Point2 *nuv) { +void BL_Material::SetConversionUV(const STR_String& name, MT_Point2 *nuv) +{ uvName = name; uv[0] = *nuv++; uv[1] = *nuv++; @@ -120,13 +123,15 @@ void BL_Material::SetConversionUV(const STR_String& name, MT_Point2 *nuv) { uv[3] = *nuv; } -void BL_Material::GetConversionUV(MT_Point2 *nuv){ +void BL_Material::GetConversionUV(MT_Point2 *nuv) +{ *nuv++ = uv[0]; *nuv++ = uv[1]; *nuv++ = uv[2]; *nuv = uv[3]; } -void BL_Material::SetConversionUV2(const STR_String& name, MT_Point2 *nuv) { +void BL_Material::SetConversionUV2(const STR_String& name, MT_Point2 *nuv) +{ uv2Name = name; uv2[0] = *nuv++; uv2[1] = *nuv++; @@ -134,7 +139,8 @@ void BL_Material::SetConversionUV2(const STR_String& name, MT_Point2 *nuv) { uv2[3] = *nuv; } -void BL_Material::GetConversionUV2(MT_Point2 *nuv){ +void BL_Material::GetConversionUV2(MT_Point2 *nuv) +{ *nuv++ = uv2[0]; *nuv++ = uv2[1]; *nuv++ = uv2[2]; diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp index 6c57776cb60..2c57004e6c4 100644 --- a/source/gameengine/Ketsji/BL_Texture.cpp +++ b/source/gameengine/Ketsji/BL_Texture.cpp @@ -38,10 +38,12 @@ extern "C" { } // (n&(n-1)) zeros the least significant bit of n -static int is_power_of_2_i(int num) { +static int is_power_of_2_i(int num) +{ return ((num)&(num-1))==0; } -static int power_of_2_min_i(int num) { +static int power_of_2_min_i(int num) +{ while (!is_power_of_2_i(num)) num= num&(num-1); return num; diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index 828c327a228..4f959d9d2f9 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -255,7 +255,8 @@ void KX_Dome::CalculateImageSize(void) } } -bool KX_Dome::CreateDL(){ +bool KX_Dome::CreateDL() +{ dlistId = glGenLists((GLsizei) m_numimages); if (dlistId != 0) { if(m_mode == DOME_FISHEYE || m_mode == DOME_TRUNCATED_FRONT || m_mode == DOME_TRUNCATED_REAR){ diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index fec1d9d296c..fa1366874a3 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -247,12 +247,14 @@ PyObject* KX_MeshProxy::pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_ return materials; } -PyObject * KX_MeshProxy::pyattr_get_numMaterials(void * selfv, const KX_PYATTRIBUTE_DEF * attrdef) { +PyObject * KX_MeshProxy::pyattr_get_numMaterials(void * selfv, const KX_PYATTRIBUTE_DEF * attrdef) +{ KX_MeshProxy * self = static_cast<KX_MeshProxy *> (selfv); return PyLong_FromSsize_t(self->m_meshobj->NumMaterials()); } -PyObject * KX_MeshProxy::pyattr_get_numPolygons(void * selfv, const KX_PYATTRIBUTE_DEF * attrdef) { +PyObject * KX_MeshProxy::pyattr_get_numPolygons(void * selfv, const KX_PYATTRIBUTE_DEF * attrdef) +{ KX_MeshProxy * self = static_cast<KX_MeshProxy *> (selfv); return PyLong_FromSsize_t(self->m_meshobj->NumPolygons()); } |