diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-03-05 17:10:18 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-03-05 17:10:18 (GMT) |
| commit | 81f3114cb22592a8c09fa564db49fbea079f1328 (patch) | |
| tree | 47c0faf05e2dd2adfcdb965542b2012465591c63 /src/simulation/Simulation.cpp | |
| parent | 55acb6aa801f89f14ccc2ae469247149b19a806d (diff) | |
| download | powder-81f3114cb22592a8c09fa564db49fbea079f1328.zip powder-81f3114cb22592a8c09fa564db49fbea079f1328.tar.gz | |
Better sliders for Decoration editor
Diffstat (limited to 'src/simulation/Simulation.cpp')
| -rw-r--r-- | src/simulation/Simulation.cpp | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index d88d4d6..3f82f1b 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -325,36 +325,29 @@ void Simulation::ApplyDecoration(int x, int y, int colR_, int colG_, int colB_, } else if (mode == DECO_ADD) { - tr += colR*0.05f; - tg += colG*0.05f; - tb += colB*0.05f; + ta += (colA*0.1f)*colA; + tr += (colR*0.1f)*colA; + tg += (colG*0.1f)*colA; + tb += (colB*0.1f)*colA; } else if (mode == DECO_SUBTRACT) { - tr -= colR*0.05f; - tg -= colG*0.05f; - tb -= colB*0.05f; + ta -= (colA*0.1f)*colA; + tr -= (colR*0.1f)*colA; + tg -= (colG*0.1f)*colA; + tb -= (colB*0.1f)*colA; } else if (mode == DECO_MULTIPLY) { - tr *= colR*0.05f; - tg *= colG*0.05f; - tb *= colB*0.05f; + tr *= 1.0f+(colR*0.1f)*colA; + tg *= 1.0f+(colG*0.1f)*colA; + tb *= 1.0f+(colB*0.1f)*colA; } else if (mode == DECO_DIVIDE) { - if(colR>0) - tr /= colR*0.05f; - else - tr = 0.0f; - if(colG>0) - tg /= colG*0.05f; - else - tg = 0.0f; - if(colB>0) - tb /= colB*0.05f; - else - tb = 0.0f; + tr /= 1.0f+(colR*0.1f)*colA; + tg /= 1.0f+(colG*0.1f)*colA; + tb /= 1.0f+(colB*0.1f)*colA; } colA_ = ta*255.0f; |
