Commit 632446fa authored by Jan Möbius's avatar Jan Möbius
Browse files

Fixed more warnings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16349 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 43c570f4
......@@ -274,10 +274,8 @@ float GPUCacheOptimizer::ComputeATVR(unsigned int VertexCacheSize)
// forsyth's score function
void GPUCacheOptimizer::Opt_Vertex::FindScore(unsigned int MaxSizeVertexCache)
{
const float CacheDecayPower = 1.5f;
const float LastTriScore = 0.75f;
const float ValenceBoostScale = 2.0f;
const float ValenceBoostPower = 0.5f;
float fNewScore = -1.0f; // -1 : vertex unused
if (iNumTrisLeft > 0)
......@@ -285,6 +283,10 @@ void GPUCacheOptimizer::Opt_Vertex::FindScore(unsigned int MaxSizeVertexCache)
if (iCachePos < 0) fNewScore = 0.0f; // not in FIFO
else
{
const float CacheDecayPower = 1.5f;
const float LastTriScore = 0.75f;
if (iCachePos < 3) // last tri => fixed score
fNewScore = LastTriScore;
else
......@@ -300,6 +302,9 @@ void GPUCacheOptimizer::Opt_Vertex::FindScore(unsigned int MaxSizeVertexCache)
// Bonus points for having a low number of tris still to
// use the vert, so we get rid of lone verts quickly.
const float ValenceBoostScale = 2.0f;
const float ValenceBoostPower = 0.5f;
float ValenceBoost = powf( float(iNumTrisLeft), -float(ValenceBoostPower));
fNewScore += ValenceBoostScale * ValenceBoost;
}
......
......@@ -214,11 +214,10 @@ void BackupPlugin::slotUpdateContextMenu( int _objectId ){
if ( object != 0 ){
//get backup object data
BackupData* backupData = 0;
if ( object->hasObjectData( OBJECT_BACKUPS ) ){
backupData = dynamic_cast< BackupData* >(object->objectData(OBJECT_BACKUPS));
//get backup object data
BackupData* backupData = dynamic_cast< BackupData* >(object->objectData(OBJECT_BACKUPS));
if ( backupData->undoAvailable() ){
undoContextAction_->setData(_objectId);
......
......@@ -43,10 +43,11 @@ void GroupData::undo(){
if ( object != 0 ){
//get backup object data
BackupData* backupData = 0;
if ( object->hasObjectData( OBJECT_BACKUPS ) ){
//get backup object data
BackupData* backupData = 0;
backupData = dynamic_cast< BackupData* >(object->objectData(OBJECT_BACKUPS));
backupData->undo();
}
......@@ -91,10 +92,11 @@ void GroupData::redo(){
if ( object != 0 ){
//get backup object data
BackupData* backupData = 0;
if ( object->hasObjectData( OBJECT_BACKUPS ) ){
//get backup object data
BackupData* backupData = 0;
backupData = dynamic_cast< BackupData* >(object->objectData(OBJECT_BACKUPS));
backupData->redo();
}
......@@ -202,11 +204,10 @@ void GroupData::undo(int _objectid){
if ( object != 0 ){
//get backup object data
BackupData* backupData = 0;
if ( object->hasObjectData( OBJECT_BACKUPS ) ){
backupData = dynamic_cast< BackupData* >(object->objectData(OBJECT_BACKUPS));
//get backup object data
BackupData* backupData = dynamic_cast< BackupData* >(object->objectData(OBJECT_BACKUPS));
if ( !backupData->undoBlocked() ){
backupData->undo();
......@@ -227,11 +228,12 @@ void GroupData::redo(int _objectid){
if ( object != 0 ){
//get backup object data
BackupData* backupData = 0;
if ( object->hasObjectData( OBJECT_BACKUPS ) ){
backupData = dynamic_cast< BackupData* >(object->objectData(OBJECT_BACKUPS));
//get backup object data
BackupData* backupData = dynamic_cast< BackupData* >(object->objectData(OBJECT_BACKUPS));
if ( !backupData->redoBlocked() ){
backupData->redo();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment