3791
|
|
|
Chris Townsend |
|
11 years ago
|
|
|
3790
|
|
|
Automatic PS uploade... |
|
11 years ago
|
|
|
3789
|
|
|
Marco Trevisan (Trev... |
|
11 years ago
|
|
|
3788
|
|
|
Chris Townsend |
|
11 years ago
|
|
|
3787
|
|
|
Chris Townsend |
|
11 years ago
|
|
|
3786
|
|
|
Automatic PS uploade... |
|
11 years ago
|
|
|
3785
|
|
|
Łukasz 'sil2100' Zem... |
|
11 years ago
|
|
|
3784
|
|
|
Chris Townsend |
|
11 years ago
|
|
|
3783
|
|
|
Chris Townsend |
|
11 years ago
|
|
|
3782
|
|
|
Automatic PS uploade... |
|
11 years ago
|
|
|
3781
|
|
|
Łukasz 'sil2100' Zem... |
|
11 years ago
|
|
|
3780
|
|
|
Łukasz 'sil2100' Zem... |
|
11 years ago
|
|
|
3779
|
|
|
Andrea Azzarone |
|
11 years ago
|
|
|
3778
|
|
|
Andrea Azzarone |
|
11 years ago
|
|
|
3777
|
|
|
MC Return |
|
11 years ago
|
|
|
3776
|
|
cube.cpp, code cleanup:
#include "privates.h", not <privates.h>. Merged if condition checks. Declaration of variables, where you need them to improve the code structure and readability. Use C++ standard bool for topDir, bottomDir, allCaps and mCapsPainted[output] (bool true/false instead Bool TRUE/FALSE). Initialize all of the class member variables in the constructor. Replaced if (priv->mSky.size () > 0) with if (!priv->mSky.empty ()). Removed redundant brackets. Fixed indentation. Added TODO.
cube.cpp, code speedup:
Do not call optionGetInactiveOpacity () twice, instead save the value as float inactiveOpacity and use this variable in the following calculation. Introduced the variables float halfHsize = hsize / 2.0; and float tsSize = 360.0f / size; and used those in following calculations to not have to recalculate those values multiple times. Do not calculate M_PI / sides and 2 * M_PI / sides multiple times in loops, instead save those values in the GLfloats mps and tmps and use those values inside the loops. Use GLdouble mDist2 = 0.5 / mDistance; in the GLdouble clipPlane* arrays, instead of recalculating this value multiple times. Use GLfloat oneMinusFStepX = 1.0f - fStepX; and GLfloat oneMinusFStepY = 1.0f - fStepY; instead of calculating those values multiple times. Use float outputWidth = outputPtr->width (); and float outputHeight = outputPtr->height (); instead of calling the functions multiple times. Introduced the GLfloat normInvert = 0.5f * invert; and used this variable instead of recalculating this value multiple times. Introduced the GLfloats mSkyWidth and mSkyHeight and used those in the following loops instead of calling mSkySize.width () and mSkySize.height () multiple times. Try to avoid redundant GL_BLEND state changes, because OpenGL will blindly change the global state, no matter what it currently is set to and that state change is expensive. So we query and save the actual blending state in the variable GLboolean glBlendEnabled = glIsEnabled (GL_BLEND); and just enable it if it isn't already and just disable it, if it was disabled before.
(LP: #1101422, LP: #1195977)
cube.cpp, other fixes:
Return false in function PrivateCubeScreen::updateGeometry (int, int) if sides should ever be 0, which should never happen, but should make Coverity happy.
(LP: #1101541)
Initialize all class member variables in the PrivateCubeScreen:: PrivateCubeScreen (CompScreen *) constructor. (mTc, mNOutput, mOutput, mOutputMask, mCleared, mCapsPainted)
(LP: #1101575). Fixes: https://bugs.launchpad.net/bugs/1101422, https://bugs.launchpad.net/bugs/1101541, https://bugs.launchpad.net/bugs/1101575.
Approved by Sam Spilsbury, PS Jenkins bot.
|
MC Return |
|
11 years ago
|
|
|
3775
|
|
|
Sami Jaktholm |
|
11 years ago
|
|
|
3774
|
|
|
Sam Spilsbury |
|
11 years ago
|
|
|
3773
|
|
|
Sam Spilsbury |
v0.9.10.0 |
11 years ago
|
|
|
3772
|
|
|
Sami Jaktholm |
|
11 years ago
|
|
|