analized with PVS-Studio, corrected some bugs

This commit is contained in:
turanszkij
2017-04-11 00:05:16 +02:00
parent d969ca30e1
commit 17c19a824a
7 changed files with 9 additions and 11 deletions
+1 -1
View File
@@ -1542,7 +1542,7 @@ void VertexGroup::Serialize(wiArchive& archive)
GPUBuffer Mesh::impostorVBs[VPROP_COUNT];
void Mesh::LoadFromFile(const string& newName, const string& fname
, const MaterialCollection& materialColl, list<Armature*> armatures, const string& identifier) {
, const MaterialCollection& materialColl, const list<Armature*>& armatures, const string& identifier) {
name = newName;
BYTE* buffer;
+1 -1
View File
@@ -375,7 +375,7 @@ public:
}
~Mesh() {}
void LoadFromFile(const string& newName, const string& fname
, const MaterialCollection& materialColl, list<Armature*> armatures, const string& identifier="");
, const MaterialCollection& materialColl, const list<Armature*>& armatures, const string& identifier="");
bool buffersComplete;
void Optimize();
// Object is needed in CreateBuffers because how else would we know if the mesh needs to be deformed?
+2 -2
View File
@@ -1889,7 +1889,7 @@ void wiRenderer::UpdateRenderData(GRAPHICSTHREAD threadID)
const CulledList& culledLights = mainCameraCulling.culledLights;
static LightArrayType* lightArray = (LightArrayType*)_mm_malloc(sizeof(LightArrayType)*MAX_LIGHTS, 16);
ZeroMemory(lightArray, sizeof(lightArray));
ZeroMemory(lightArray, sizeof(LightArrayType)*MAX_LIGHTS);
XMMATRIX viewMatrix = cam->GetView();
@@ -4855,7 +4855,7 @@ void wiRenderer::UpdateMaterialCB(const MaterialCB& value, GRAPHICSTHREAD thread
}
}
wiRenderer::APICB apiCB[GRAPHICSTHREAD_COUNT];
void wiRenderer::SetClipPlane(XMFLOAT4 clipPlane, GRAPHICSTHREAD threadID)
void wiRenderer::SetClipPlane(const XMFLOAT4& clipPlane, GRAPHICSTHREAD threadID)
{
apiCB[threadID].clipPlane = clipPlane;
GetDevice()->UpdateBuffer(constantBuffers[CBTYPE_API], &apiCB[threadID], threadID);
+1 -1
View File
@@ -436,7 +436,7 @@ public:
static void UpdateFrameCB(GRAPHICSTHREAD threadID);
static void UpdateCameraCB(Camera* camera, GRAPHICSTHREAD threadID);
static void UpdateMaterialCB(const MaterialCB& value, GRAPHICSTHREAD threadID);
static void SetClipPlane(XMFLOAT4 clipPlane, GRAPHICSTHREAD threadID);
static void SetClipPlane(const XMFLOAT4& clipPlane, GRAPHICSTHREAD threadID);
static void SetAlphaRef(float alphaRef, GRAPHICSTHREAD threadID);
static void ResetAlphaRef(GRAPHICSTHREAD threadID) { SetAlphaRef(0.75f, threadID); }
static void UpdateGBuffer(wiGraphicsTypes::Texture2D* slot0, wiGraphicsTypes::Texture2D* slot1, wiGraphicsTypes::Texture2D* slot2, wiGraphicsTypes::Texture2D* slot3, wiGraphicsTypes::Texture2D* slot4, GRAPHICSTHREAD threadID);
+1 -1
View File
@@ -158,7 +158,7 @@ void* wiResourceManager::add(const wiHashString& name, Data_Type newType
wiRenderer::GetDevice()->CreateGeometryShader(buffer, bufferSize, nullptr, shader);
if (streamOutDecl != nullptr && elementCount > 0){
wiRenderer::GetDevice()->CreateGeometryShaderWithStreamOutput(buffer, bufferSize, streamOutDecl,
elementCount, NULL, 0, shader ? 0 : SO_NO_RASTERIZED_STREAM, NULL, shader);
elementCount, NULL, 0, SO_NO_RASTERIZED_STREAM, NULL, shader);
}
delete[] buffer;
success = shader;
+2 -4
View File
@@ -100,9 +100,8 @@ Luna<wiSoundEffect_BindLua>::PropertyType wiSoundEffect_BindLua::properties[] =
{ NULL, NULL }
};
wiSoundEffect_BindLua::wiSoundEffect_BindLua(lua_State *L)
wiSoundEffect_BindLua::wiSoundEffect_BindLua(lua_State *L) :wiSound_BindLua()
{
wiSoundEffect_BindLua::wiSound_BindLua();
int argc = wiLua::SGetArgCount(L);
if (argc > 0)
{
@@ -132,9 +131,8 @@ Luna<wiMusic_BindLua>::PropertyType wiMusic_BindLua::properties[] = {
{ NULL, NULL }
};
wiMusic_BindLua::wiMusic_BindLua(lua_State *L)
wiMusic_BindLua::wiMusic_BindLua(lua_State *L) :wiSound_BindLua()
{
wiSoundEffect_BindLua::wiSound_BindLua();
int argc = wiLua::SGetArgCount(L);
if (argc > 0)
{
+1 -1
View File
@@ -7,7 +7,7 @@ namespace wiVersion
// minor features, major updates
const int minor = 11;
// minor bug fixes, alterations, refactors, updates
const int revision = 24;
const int revision = 25;
long GetVersion()