commented out interpolation thread since it doesn't seem to improve anything.

This commit is contained in:
Mark Vejvoda 2010-05-10 19:51:53 +00:00
parent a68ae2fdfb
commit e7d06aebc3
2 changed files with 35 additions and 33 deletions

View File

@ -99,7 +99,7 @@ void MeshCallbackTeamColor::execute(const Mesh *mesh){
// =========================================================== // ===========================================================
// class InterpolateTaskThread // class InterpolateTaskThread
// =========================================================== // ===========================================================
/*
InterpolateTaskThread::InterpolateTaskThread(InterpolateTaskCallbackInterface *interpolateTaskInterface) InterpolateTaskThread::InterpolateTaskThread(InterpolateTaskCallbackInterface *interpolateTaskInterface)
: BaseThread() { : BaseThread() {
this->interpolateTaskInterface = interpolateTaskInterface; this->interpolateTaskInterface = interpolateTaskInterface;
@ -182,7 +182,7 @@ void InterpolateTaskThread::execute() {
} }
setRunningStatus(false); setRunningStatus(false);
} }
*/
// =========================================================== // ===========================================================
// class Renderer // class Renderer
// =========================================================== // ===========================================================
@ -250,18 +250,18 @@ Renderer::Renderer(){
allowRotateUnits = config.getBool("AllowRotateUnits","0"); allowRotateUnits = config.getBool("AllowRotateUnits","0");
interpolateThread = NULL; //interpolateThread = NULL;
// Run interpolation calcs in a background thread if enabled // Run interpolation calcs in a background thread if enabled
if(config.getBool("ThreadedInterpolation","false") == true) { //if(config.getBool("ThreadedInterpolation","false") == true) {
interpolateThread = new InterpolateTaskThread(this); // interpolateThread = new InterpolateTaskThread(this);
interpolateThread->start(); // interpolateThread->start();
} //}
} }
Renderer::~Renderer(){ Renderer::~Renderer(){
BaseThread::shutdownAndWait(interpolateThread); //BaseThread::shutdownAndWait(interpolateThread);
delete interpolateThread; //delete interpolateThread;
interpolateThread = NULL; //interpolateThread = NULL;
delete modelRenderer; delete modelRenderer;
delete textRenderer; delete textRenderer;
@ -1432,12 +1432,12 @@ void Renderer::renderObjectList(std::vector<RenderEntity> &vctEntity,const Vec3f
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] vctEntity.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,vctEntity.size()); //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] vctEntity.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,vctEntity.size());
// Run interpolation threaded if the thread is created // Run interpolation threaded if the thread is created
if(interpolateThread != NULL) { //if(interpolateThread != NULL) {
interpolateThread->setTaskSignalled(&vctEntity); // interpolateThread->setTaskSignalled(&vctEntity);
} //}
else { //else {
interpolateTask(vctEntity); interpolateTask(vctEntity);
} //}
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] vctEntity.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,vctEntity.size()); //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] vctEntity.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,vctEntity.size());
@ -1744,12 +1744,12 @@ void Renderer::renderUnitList(std::vector<RenderEntity> &vctEntity,MeshCallbackT
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] vctEntity.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,vctEntity.size()); //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] vctEntity.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,vctEntity.size());
// Run interpolation threaded if the thread is created // Run interpolation threaded if the thread is created
if(interpolateThread != NULL) { //if(interpolateThread != NULL) {
interpolateThread->setTaskSignalled(&vctEntity); // interpolateThread->setTaskSignalled(&vctEntity);
} //}
else { //else {
interpolateTask(vctEntity); interpolateTask(vctEntity);
} //}
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] vctEntity.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,vctEntity.size()); //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] vctEntity.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,vctEntity.size());
@ -2879,12 +2879,12 @@ void Renderer::renderUnitFastList(std::vector<RenderEntity> &vctEntity) {
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] vctEntity.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,vctEntity.size()); //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] vctEntity.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,vctEntity.size());
// Run interpolation threaded if the thread is created // Run interpolation threaded if the thread is created
if(interpolateThread != NULL) { //if(interpolateThread != NULL) {
interpolateThread->setTaskSignalled(&vctEntity); // interpolateThread->setTaskSignalled(&vctEntity);
} //}
else { //else {
interpolateTask(vctEntity); interpolateTask(vctEntity);
} //}
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] vctEntity.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,vctEntity.size()); //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] vctEntity.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,vctEntity.size());

View File

@ -27,7 +27,7 @@
#include "font_manager.h" #include "font_manager.h"
#include "camera.h" #include "camera.h"
#include <vector> #include <vector>
#include "base_thread.h" //#include "base_thread.h"
#include "model_renderer.h" #include "model_renderer.h"
#include "model.h" #include "model.h"
@ -55,7 +55,7 @@ using Shared::Graphics::Camera;
using Shared::Graphics::MeshCallback; using Shared::Graphics::MeshCallback;
using Shared::Graphics::Mesh; using Shared::Graphics::Mesh;
using namespace Shared::PlatformCommon; //using namespace Shared::PlatformCommon;
// ===================================================== // =====================================================
// class MeshCallbackTeamColor // class MeshCallbackTeamColor
@ -168,6 +168,7 @@ public:
} }
}; };
/*
// //
// This interface describes the methods a callback object must implement // This interface describes the methods a callback object must implement
// //
@ -198,9 +199,10 @@ public:
void setTaskSignalled(std::vector<RenderEntity> *vctEntity); void setTaskSignalled(std::vector<RenderEntity> *vctEntity);
bool getTaskSignalled(); bool getTaskSignalled();
}; };
*/
//class Renderer : public InterpolateTaskCallbackInterface {
class Renderer : public InterpolateTaskCallbackInterface { class Renderer {
public: public:
//progress bar //progress bar
static const int maxProgressBar; static const int maxProgressBar;
@ -297,7 +299,7 @@ private:
float waterAnim; float waterAnim;
bool allowRotateUnits; bool allowRotateUnits;
InterpolateTaskThread *interpolateThread; //InterpolateTaskThread *interpolateThread;
private: private:
Renderer(); Renderer();