Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is this a bug in code?
06-05-2011, 06:37 AM,
#11
Re: Is this a bug in code?
Everything fixed except the following bug:

antoniovazquez Wrote: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;
    }

I can't understand what are you trying to do with theese lines:
Code:
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
            }

Can anybody explain them?
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)