Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is this a bug in code?
06-03-2011, 05:41 PM,
#4
 
Here is the patch:
http://www.mediafire.com/file/x9229h7sp5...bugs.patch

Here unsolved code as I'm not shure what to do and don't wan't to screw it... Tongue

Quote:File: src/drawable.cpp
Line: 105
Error: Uninitialized variable: srgb_alpha
Is this a bug?

Code:
// uniforms
   if (uniformsChanged)
   {
      renderModel.clearUniformCache();
      renderModel.uniforms.clear();
      if (transform != MATRIX4<float>()) // only add it if it's not the identity matrix
         renderModel.uniforms.push_back(RenderUniformEntry(transformId, transform.GetArray(), 16));
      if (r != 1 || g != 1 || b != 1 || a != 1) // only add it if it's not the default
      {
         float srgb_alpha[4];
         for (int i = 0; i < 3; i++)
         {
            srgb_alpha[i] = srgb_alpha[i] < 1 ? pow((&r)[i],2.2) : (&r)[i];   // <------This is the line
         }
         srgb_alpha[3] = a;
         renderModel.uniforms.push_back(RenderUniformEntry(colorId, srgb_alpha, 4));
      }
      /*if (decal) // only add it if it's not the default of zero
      {
         float depthOffset = -0.005;
         renderModel.uniforms.push_back(RenderUniformEntry(depthOffsetId, &depthOffset, 1));
      }*/
      
      uniformsChanged = false;
   }

And a security one: Null pointer deference...
File: src/soundsource.cpp
Line: 34

Code:
SOUNDFILTER & SOUNDSOURCE::GetFilter(int num)
{
   int curnum = 0;
   for (std::list <SOUNDFILTER>::iterator i = filters.begin(); i != filters.end(); ++i)
   {
      if (num == curnum)
         return *i;
      curnum++;
   }
   assert(0);
   SOUNDFILTER * nullfilt = NULL; //Theese 2 last lines!
   return *nullfilt;
}
Reply


Messages In This Thread
Is this a bug in code? - by antoniovazquez - 06-03-2011, 07:40 AM
[No subject] - by NaN - 06-03-2011, 05:08 PM
[No subject] - by antoniovazquez - 06-03-2011, 05:18 PM
[No subject] - by antoniovazquez - 06-03-2011, 05:41 PM
[No subject] - by NaN - 06-03-2011, 05:47 PM
[No subject] - by antoniovazquez - 06-03-2011, 05:51 PM
[No subject] - by NaN - 06-03-2011, 05:59 PM
[No subject] - by antoniovazquez - 06-03-2011, 06:04 PM
[No subject] - by NaN - 06-03-2011, 06:15 PM
[No subject] - by antoniovazquez - 06-03-2011, 06:27 PM
Re: Is this a bug in code? - by antoniovazquez - 06-05-2011, 06:37 AM
[No subject] - by NaN - 06-05-2011, 07:22 AM
[No subject] - by antoniovazquez - 06-05-2011, 07:48 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)