- fixed mod center image previews in cases where userdata folder was non default

- removed commented out old code
This commit is contained in:
Mark Vejvoda
2013-10-03 05:44:50 +00:00
parent 312c2db483
commit 53a557d8d1
15 changed files with 80 additions and 430 deletions

View File

@@ -1764,17 +1764,7 @@ void ProjectileParticleSystem::update(){
float relative= clamp(currentVector.length() / targetVector.length(), 0.0f, 1.0f);
relative = truncateDecimal<float>(relative,6);
//printf("Update particle targetVector [%s][%f] currentVector [%s][%f] relative = %f\n",targetVector.getString().c_str(),targetVector.length(),currentVector.getString().c_str(),currentVector.length(),relative);
//#ifdef USE_STREFLOP
// float absolute= clamp(streflop::fabs(static_cast<streflop::Simple>(currentVector.length())), 0.0f, 1.0f);
//#else
// float absolute= clamp(fabs(currentVector.length()), 0.0f, 1.0f);
//#endif
//printf("#a currentVector.length() = %f, targetVector.length() = %f, relative = %f, absolute = %f, trajectorySpeed = %f\n",currentVector.length(),targetVector.length(),relative,absolute,trajectorySpeed);
float absolute = relative;
setTween(relative,absolute);
// trajectory

View File

@@ -1313,19 +1313,6 @@ void Pixmap2D::splat(const Pixmap2D *leftUp, const Pixmap2D *rightUp, const Pixm
float distRd= splatDist(Vec2i(i, j), Vec2i(w, h));
const float powFactor= 2.0f;
//#ifdef USE_STREFLOP
// distLu= streflop::pow(static_cast<streflop::Simple>(distLu), static_cast<streflop::Simple>(powFactor));
// distRu= streflop::pow(static_cast<streflop::Simple>(distRu), static_cast<streflop::Simple>(powFactor));
// distLd= streflop::pow(static_cast<streflop::Simple>(distLd), static_cast<streflop::Simple>(powFactor));
// distRd= streflop::pow(static_cast<streflop::Simple>(distRd), static_cast<streflop::Simple>(powFactor));
// avg= streflop::pow(static_cast<streflop::Simple>(avg), static_cast<streflop::Simple>(powFactor));
//#else
// distLu= pow(distLu, powFactor);
// distRu= pow(distRu, powFactor);
// distLd= pow(distLd, powFactor);
// distRd= pow(distRd, powFactor);
// avg= pow(avg, powFactor);
//#endif
distLu = std::pow(distLu, powFactor);
distRu = std::pow(distRu, powFactor);

View File

@@ -66,42 +66,9 @@ void Quaternion::setAddIdentity(){
v= Vec3f(0.0f);
}
//void Quaternion::setAxisAngle(const AxisAngle &axisAngle){
//#ifdef USE_STREFLOP
// w= streflop::cosf(static_cast<streflop::Simple>(axisAngle.angle/2.0f));
// v.x= axisAngle.axis.x * streflop::sinf(static_cast<streflop::Simple>(axisAngle.angle/2.0f));
// v.y= axisAngle.axis.y * streflop::sinf(static_cast<streflop::Simple>(axisAngle.angle/2.0f));
// v.z= axisAngle.axis.z * streflop::sinf(static_cast<streflop::Simple>(axisAngle.angle/2.0f));
//#else
// w= cosf(axisAngle.angle/2.0f);
// v.x= axisAngle.axis.x * sinf(axisAngle.angle/2.0f);
// v.y= axisAngle.axis.y * sinf(axisAngle.angle/2.0f);
// v.z= axisAngle.axis.z * sinf(axisAngle.angle/2.0f);
//#endif
//}
void Quaternion::setEuler(const EulerAngles &eulerAngles){
Quaternion qx, qy, qz, qr;
//#ifdef USE_STREFLOP
// qx.w= streflop::cosf(static_cast<streflop::Simple>(eulerAngles.x/2.0f));
// qx.v= Vec3f(streflop::sinf(static_cast<streflop::Simple>(eulerAngles.x/2.0f)), 0.0f, 0.0f);
//
// qy.w= streflop::cosf(static_cast<streflop::Simple>(eulerAngles.y/2.0f));
// qy.v= Vec3f(0.0f, streflop::sinf(static_cast<streflop::Simple>(eulerAngles.y/2.0f)), 0.0f);
//
// qz.w= streflop::cosf(static_cast<streflop::Simple>(eulerAngles.z/2.0f));
// qz.v= Vec3f(0.0f, 0.0f, streflop::sinf(static_cast<streflop::Simple>(eulerAngles.z/2.0f)));
//#else
// qx.w= cosf(eulerAngles.x/2.0f);
// qx.v= Vec3f(sinf(eulerAngles.x/2.0f), 0.0f, 0.0f);
//
// qy.w= cosf(eulerAngles.y/2.0f);
// qy.v= Vec3f(0.0f, sinf(eulerAngles.y/2.0f), 0.0f);
//
// qz.w= cosf(eulerAngles.z/2.0f);
// qz.v= Vec3f(0.0f, 0.0f, sinf(eulerAngles.z/2.0f));
//#endif
qx.w= std::cos(eulerAngles.x/2.0f);
qx.v= Vec3f(std::sin(eulerAngles.x/2.0f), 0.0f, 0.0f);
@@ -117,24 +84,10 @@ void Quaternion::setEuler(const EulerAngles &eulerAngles){
v= qr.v;
}
//float Quaternion::length(){
//#ifdef USE_STREFLOP
// return streflop::sqrt(static_cast<streflop::Simple>(w*w+v.x*v.x+v.y*v.y+v.z*v.z));
//#else
// return sqrt(w*w+v.x*v.x+v.y*v.y+v.z*v.z);
//#endif
//}
Quaternion Quaternion::conjugate(){
return Quaternion(w, -v);
}
//void Quaternion::normalize(){
// float il= 1.f/length();
// w*= il;
// v= v*il;
//}
Quaternion Quaternion::operator + (const Quaternion &q) const{
return Quaternion(w +q.w, v+q.v);
}
@@ -212,15 +165,6 @@ Matrix4f Quaternion::toMatrix4() const{
return rm;
}
//AxisAngle Quaternion::toAxisAngle() const{
// float scale= 1.0f/(v.x*v.x + v.y*v.y + v.z*v.z);
//#ifdef USE_STREFLOP
// return AxisAngle(v*scale, 2*streflop::acosf(static_cast<streflop::Simple>(w)));
//#else
// return AxisAngle(v*scale, 2*acosf(w));
//#endif
//}
Vec3f Quaternion::getLocalXAxis() const{
return Vec3f(
1.0f - 2*v.y*v.y - 2*v.z*v.z,

View File

@@ -481,11 +481,7 @@ void Window::setupGraphicsScreen(int depthBits, int stencilBits, bool hardware_a
//const float lodBias = std::max(std::min( configHandler->Get("TextureLODBias", 0.0f) , 4.0f), -4.0f);
const float lodBias = max(min(0.0f,4.0f),-4.0f);
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("\n\n\n\n\n$$$$ In [%s::%s Line: %d] lodBias = %f\n\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,lodBias);
#ifdef USE_STREFLOP
if (streflop::fabs(static_cast<streflop::Simple>(lodBias)) > 0.01f) {
#else
if (fabs(lodBias) > 0.01f) {
#endif
if (std::fabs(lodBias) > 0.01f) {
glTexEnvf(GL_TEXTURE_FILTER_CONTROL,GL_TEXTURE_LOD_BIAS, lodBias );
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);

View File

@@ -520,12 +520,7 @@ bool SoundPlayerDs8::findStrBuffer(Sound *sound, int *bufferIndex){
// =====================================================
long dsVolume(float floatVolume){
#ifdef USE_STREFLOP
float correctedVol= streflop::log10f(static_cast<streflop::Simple>(floatVolume*9.f+1.f));
#else
float correctedVol= log10f(floatVolume*9.f+1.f);
#endif
long vol= static_cast<long>(DSBVOLUME_MIN+correctedVol*(DSBVOLUME_MAX-DSBVOLUME_MIN));
return clamp(vol, DSBVOLUME_MIN, DSBVOLUME_MAX);
}

View File

@@ -32,34 +32,15 @@ const int RandomGen::a= 1366;
const int RandomGen::b= 150889;
RandomGen::RandomGen(){
//#ifdef USE_STREFLOP
// lastNumber = streflop::RandomInit(0); // streflop
//#else
lastNumber= 0;
//#endif
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] lastNumber = %d\n",__FILE__,__FUNCTION__,__LINE__,lastNumber);
}
void RandomGen::init(int seed){
//#ifdef USE_STREFLOP
// lastNumber = streflop::RandomInit(seed); // streflop
//#else
lastNumber= seed % m;
//#endif
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] seed = %d, lastNumber = %d\n",__FILE__,__FUNCTION__,__LINE__,seed,lastNumber);
}
int RandomGen::rand(string lastCaller) {
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] lastNumber = %d\n",__FILE__,__FUNCTION__,__LINE__,lastNumber);
this->lastNumber = (a*lastNumber + b) % m;
//this->lastCaller.push_back(lastCaller);
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] lastNumber = %d\n",__FILE__,__FUNCTION__,__LINE__,lastNumber);
return lastNumber;
}