Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-03-26 17:56:27 +0300
committerJeroen Bakker <jeroen@blender.org>2021-03-26 18:02:59 +0300
commit2371454b2da4eab159315b3f1da6b683af9dbe04 (patch)
treee5466ec312ec0e4dd1b07f5c17fa5e8577b3bd58 /source/blender/compositor/intern
parent6524ceb8cfa53e2209b73023cfa16d1b58b1247e (diff)
Cleanup: Replace Methode Overloading With Default Value.
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r--source/blender/compositor/intern/COM_NodeOperation.cc23
-rw-r--r--source/blender/compositor/intern/COM_NodeOperation.h6
2 files changed, 8 insertions, 21 deletions
diff --git a/source/blender/compositor/intern/COM_NodeOperation.cc b/source/blender/compositor/intern/COM_NodeOperation.cc
index e68c53bd7b2..a8559b76d21 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.cc
+++ b/source/blender/compositor/intern/COM_NodeOperation.cc
@@ -62,27 +62,18 @@ void NodeOperation::addOutputSocket(DataType datatype)
void NodeOperation::determineResolution(unsigned int resolution[2],
unsigned int preferredResolution[2])
{
- unsigned int temp[2];
- unsigned int temp2[2];
+ NodeOperationInput &input = m_inputs[m_resolutionInputSocketIndex];
+ input.determineResolution(resolution, preferredResolution);
+ unsigned int temp2[2] = {resolution[0], resolution[1]};
- // TODO(jbakker): Replace for loops with direct array access.
+ unsigned int temp[2];
for (unsigned int index = 0; index < m_inputs.size(); index++) {
- NodeOperationInput &input = m_inputs[index];
- if (input.isConnected()) {
- if (index == this->m_resolutionInputSocketIndex) {
- input.determineResolution(resolution, preferredResolution);
- temp2[0] = resolution[0];
- temp2[1] = resolution[1];
- break;
- }
+ if (index == this->m_resolutionInputSocketIndex) {
+ continue;
}
- }
- for (unsigned int index = 0; index < m_inputs.size(); index++) {
NodeOperationInput &input = m_inputs[index];
if (input.isConnected()) {
- if (index != this->m_resolutionInputSocketIndex) {
- input.determineResolution(temp, temp2);
- }
+ input.determineResolution(temp, temp2);
}
}
}
diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h
index 5b9375ae531..b06a453a775 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.h
+++ b/source/blender/compositor/intern/COM_NodeOperation.h
@@ -238,11 +238,7 @@ class NodeOperation {
{
return m_outputs.size();
}
- NodeOperationOutput *getOutputSocket(unsigned int index);
- NodeOperationOutput *getOutputSocket()
- {
- return getOutputSocket(0);
- }
+ NodeOperationOutput *getOutputSocket(unsigned int index = 0);
NodeOperationInput *getInputSocket(unsigned int index);
/** Check if this is an input operation