summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-10-12 14:41:16 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-10-12 14:45:48 +0200
commit7a1c0ad333073fcf2a90779f31ac0c75b1598c4e (patch)
treeaccb264a07aef909836173bf4bfa836a5d54b4eb /drawinglayer
parentca3436723455a0d0f3ced6f33b646b7c79ab05a1 (diff)
Reduce scope of fTexStart/Stop even further
...than 92c8d74c543aa94cd512369072975dca7006d5b3 "CppCheck : reduce variables scope" did, to make it clear that it is OK to move these into the for loop: the values these variables receive (when bCreateTextureCoordinates is true) are only relevant for each immediately following call to impAddInBetweenFill, and are only actually used inside impAddInBetweenFill when bCreateTextureCoordinates (which is also passed into the call) is true. Change-Id: Ib9e315d80a04736fb6b49144c8f09239ac351c7f
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
index a1c27c9f5d26..bea38f3ec761 100644
--- a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
@@ -646,9 +646,6 @@ namespace drawinglayer
if(bAcceptPair)
{
- double fTexStart(0.0);
- double fTexStop(1.0);
-
if(bCreateNormals)
{
impCreateInBetweenNormals(aPolB, aPolA, bSmoothHorizontalNormals);
@@ -728,6 +725,8 @@ namespace drawinglayer
if(bHasSlant)
{
+ double fTexStart{};
+ double fTexStop{};
if(bCreateTextureCoordinates)
{
fTexStart = fTexHeightPos * fInvTexHeight;
@@ -818,6 +817,8 @@ namespace drawinglayer
if(bHasSlant)
{
+ double fTexStart{};
+ double fTexStop{};
if(bCreateTextureCoordinates)
{
fTexStart = (fTexHeightPos + aTexHeightArray[a] + aTexHeightArray[(a + 1L) % nLoopCount]) * fInvTexHeight;
@@ -839,6 +840,8 @@ namespace drawinglayer
}
}
+ double fTexStart{};
+ double fTexStop{};
if(bCreateTextureCoordinates)
{
fTexStart = (fTexHeightPos + aTexHeightArray[a]) * fInvTexHeight;