diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-10 18:07:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-10 18:07:24 +0400 |
commit | 94a3945cf9de0913b75f83b26e2e62b3bc1b0c07 (patch) | |
tree | 89aeabd20d883137b69815d9580f3bc108531a7e /source/blender/compositor/operations/COM_TextureOperation.cpp | |
parent | e8772477894a6fd8c09488b488fdcc1af432da1b (diff) |
code cleanup: compositor - define size for executePixel function output float array
Diffstat (limited to 'source/blender/compositor/operations/COM_TextureOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_TextureOperation.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp index caf0bba741f..f8d6c0cfc01 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.cpp +++ b/source/blender/compositor/operations/COM_TextureOperation.cpp @@ -67,16 +67,16 @@ void TextureBaseOperation::determineResolution(unsigned int resolution[2], unsig } } -void TextureAlphaOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void TextureAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - TextureBaseOperation::executePixel(color, x, y, sampler); - color[0] = color[3]; - color[1] = 0.0f; - color[2] = 0.0f; - color[3] = 0.0f; + TextureBaseOperation::executePixel(output, x, y, sampler); + output[0] = output[3]; + output[1] = 0.0f; + output[2] = 0.0f; + output[3] = 0.0f; } -void TextureBaseOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void TextureBaseOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { TexResult texres = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL}; float textureSize[4]; @@ -98,14 +98,16 @@ void TextureBaseOperation::executePixel(float *color, float x, float y, PixelSam retval = multitex_ext(this->m_texture, vec, NULL, NULL, 0, &texres); if (texres.talpha) - color[3] = texres.ta; + output[3] = texres.ta; else - color[3] = texres.tin; + output[3] = texres.tin; if ((retval & TEX_RGB)) { - color[0] = texres.tr; - color[1] = texres.tg; - color[2] = texres.tb; + output[0] = texres.tr; + output[1] = texres.tg; + output[2] = texres.tb; + } + else { + output[0] = output[1] = output[2] = output[3]; } - else color[0] = color[1] = color[2] = color[3]; } |