diff options
Diffstat (limited to 'source/blender/compositor/operations/COM_TextureOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_TextureOperation.cpp | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp index 07316280bbc..e66cd57cb3f 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.cpp +++ b/source/blender/compositor/operations/COM_TextureOperation.cpp @@ -25,15 +25,15 @@ #include "BLI_listbase.h" #include "BLI_threads.h" -TextureBaseOperation::TextureBaseOperation() : NodeOperation() +TextureBaseOperation::TextureBaseOperation() { this->addInputSocket(COM_DT_VECTOR); // offset this->addInputSocket(COM_DT_VECTOR); // size - this->m_texture = NULL; - this->m_inputSize = NULL; - this->m_inputOffset = NULL; - this->m_rd = NULL; - this->m_pool = NULL; + this->m_texture = nullptr; + this->m_inputSize = nullptr; + this->m_inputOffset = nullptr; + this->m_rd = nullptr; + this->m_pool = nullptr; this->m_sceneColorManage = false; setComplex(true); } @@ -51,19 +51,20 @@ void TextureBaseOperation::initExecution() this->m_inputOffset = getInputSocketReader(0); this->m_inputSize = getInputSocketReader(1); this->m_pool = BKE_image_pool_new(); - if (this->m_texture != NULL && this->m_texture->nodetree != NULL && this->m_texture->use_nodes) { + if (this->m_texture != nullptr && this->m_texture->nodetree != nullptr && + this->m_texture->use_nodes) { ntreeTexBeginExecTree(this->m_texture->nodetree); } NodeOperation::initExecution(); } void TextureBaseOperation::deinitExecution() { - this->m_inputSize = NULL; - this->m_inputOffset = NULL; + this->m_inputSize = nullptr; + this->m_inputOffset = nullptr; BKE_image_pool_free(this->m_pool); - this->m_pool = NULL; - if (this->m_texture != NULL && this->m_texture->use_nodes && this->m_texture->nodetree != NULL && - this->m_texture->nodetree->execdata != NULL) { + this->m_pool = nullptr; + if (this->m_texture != nullptr && this->m_texture->use_nodes && + this->m_texture->nodetree != nullptr && this->m_texture->nodetree->execdata != nullptr) { ntreeTexEndExecTree(this->m_texture->nodetree->execdata); } NodeOperation::deinitExecution(); @@ -99,7 +100,7 @@ void TextureBaseOperation::executePixelSampled(float output[4], float y, PixelSampler sampler) { - TexResult texres = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL}; + TexResult texres = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, nullptr}; float textureSize[4]; float textureOffset[4]; float vec[3]; @@ -114,7 +115,7 @@ void TextureBaseOperation::executePixelSampled(float output[4], * interpolation and (b) in such configuration multitex() simply floor's the value * which often produces artifacts. */ - if (m_texture != NULL && (m_texture->imaflag & TEX_INTERPOL) == 0) { + if (m_texture != nullptr && (m_texture->imaflag & TEX_INTERPOL) == 0) { u += 0.5f / cx; v += 0.5f / cy; } @@ -127,8 +128,16 @@ void TextureBaseOperation::executePixelSampled(float output[4], vec[2] = textureSize[2] * textureOffset[2]; const int thread_id = WorkScheduler::current_thread_id(); - retval = multitex_ext( - this->m_texture, vec, NULL, NULL, 0, &texres, thread_id, m_pool, m_sceneColorManage, false); + retval = multitex_ext(this->m_texture, + vec, + nullptr, + nullptr, + 0, + &texres, + thread_id, + m_pool, + m_sceneColorManage, + false); if (texres.talpha) { output[3] = texres.ta; |