Browse Source

Merge pull request #482 from Hoikas/coverity

Fix some moar Coverity
Darryl Pogue 9 years ago
parent
commit
3b103dcb8d
  1. 2
      Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp
  2. 6
      Sources/Plasma/PubUtilLib/plInterp/plController.cpp
  3. 2
      Sources/Tools/MaxConvert/plMaxLightContext.h
  4. 2
      Sources/Tools/MaxConvert/plRenderGlobalContext.cpp
  5. 4
      Sources/Tools/MaxConvert/plRenderGlobalContext.h

2
Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp

@ -1567,7 +1567,7 @@ void plCameraBrain1_Fixed::Update(bool forced)
fTargetMatrix = fCamera->GetTarget()->GetCoordinateInterface()->GetLocalToWorld(); fTargetMatrix = fCamera->GetTarget()->GetCoordinateInterface()->GetLocalToWorld();
hsVector3 view; hsVector3 view;
hsVector3 up; hsVector3 up;
fTargetMatrix.GetAxis(0, &view, &up); fTargetMatrix.GetAxis(0, &up, &view);
fGoal = fTargetMatrix.GetTranslate(); fGoal = fTargetMatrix.GetTranslate();
if (fTargetPoint) if (fTargetPoint)
fPOAGoal = fTargetPoint->GetBrain()->GetGoal(); fPOAGoal = fTargetPoint->GetBrain()->GetGoal();

6
Sources/Plasma/PubUtilLib/plInterp/plController.cpp

@ -373,11 +373,11 @@ hsMatrix44Key *plLeafController::GetMatrix44Key(uint32_t i) const
void plLeafController::GetKeyTimes(hsTArray<float> &keyTimes) const void plLeafController::GetKeyTimes(hsTArray<float> &keyTimes) const
{ {
int cIdx; int cIdx = 0;
int kIdx; int kIdx = 0;
uint32_t stride = GetStride(); uint32_t stride = GetStride();
uint8_t *keyPtr = (uint8_t *)fKeys; uint8_t *keyPtr = (uint8_t *)fKeys;
for (cIdx = 0, kIdx = 0; cIdx < fNumKeys, kIdx < keyTimes.GetCount();) while (cIdx < fNumKeys && kIdx < keyTimes.GetCount())
{ {
float kTime = keyTimes[kIdx]; float kTime = keyTimes[kIdx];
float cTime = ((hsKeyFrame*)(keyPtr + cIdx * stride))->fFrame / MAX_FRAMES_PER_SEC; float cTime = ((hsKeyFrame*)(keyPtr + cIdx * stride))->fFrame / MAX_FRAMES_PER_SEC;

2
Sources/Tools/MaxConvert/plMaxLightContext.h

@ -131,7 +131,7 @@ class plMaxRendContext : public RendContext
public: public:
Matrix3 WorldToCam() const { return Matrix3(1); } Matrix3 WorldToCam() const { return Matrix3(1); }
Color GlobalLightLevel() const { return Color(1.f, 1.f, 1.f); } Color GlobalLightLevel() const { return Color(1.f, 1.f, 1.f); }
int Progress(int done, int total) { int Progress(int done, int total) const {
return 1; return 1;
} }
}; };

2
Sources/Tools/MaxConvert/plRenderGlobalContext.cpp

@ -118,7 +118,7 @@ void plRenderGlobalContext::MakeRenderInstances(plMaxNode* root, TimeValue t)
fInstList[i].SetNext(&fInstList[i+1]); fInstList[i].SetNext(&fInstList[i+1]);
} }
RenderInstance* plRenderGlobalContext::GetRenderInstance(int i) const RenderInstance* plRenderGlobalContext::GetRenderInstance(int i)
{ {
if (fInstList.GetCount() > i) if (fInstList.GetCount() > i)
return &fInstList[i]; return &fInstList[i];

4
Sources/Tools/MaxConvert/plRenderGlobalContext.h

@ -62,8 +62,8 @@ public:
void MakeRenderInstances(plMaxNode* root, TimeValue t); void MakeRenderInstances(plMaxNode* root, TimeValue t);
virtual int NumRenderInstances() const { return fInstList.GetCount(); } virtual int NumRenderInstances() { return fInstList.GetCount(); }
virtual RenderInstance* GetRenderInstance( int i ) const; virtual RenderInstance* GetRenderInstance( int i );
virtual void IntersectRay(RenderInstance *inst, Ray& ray, ISect &isct, ISectList &xpList, BOOL findExit); virtual void IntersectRay(RenderInstance *inst, Ray& ray, ISect &isct, ISectList &xpList, BOOL findExit);
virtual BOOL IntersectWorld(Ray &ray, int skipID, ISect &hit, ISectList &xplist, int blurFrame = NO_MOTBLUR); virtual BOOL IntersectWorld(Ray &ray, int skipID, ISect &hit, ISectList &xplist, int blurFrame = NO_MOTBLUR);

Loading…
Cancel
Save