- code cleanup from cppcheck

This commit is contained in:
Mark Vejvoda 2012-10-06 02:10:23 +00:00
parent 1a7f3d50ca
commit c39da4cd69
8 changed files with 33 additions and 8 deletions

View File

@ -39,6 +39,7 @@ ProduceTask::ProduceTask() : Task() {
taskClass= tcProduce;
unitType= NULL;
resourceType= NULL;
unitClass = ucWarrior;
}
ProduceTask::ProduceTask(UnitClass unitClass) : Task() {
@ -52,11 +53,13 @@ ProduceTask::ProduceTask(const UnitType *unitType) : Task() {
taskClass= tcProduce;
this->unitType= unitType;
resourceType= NULL;
unitClass = ucWarrior;
}
ProduceTask::ProduceTask(const ResourceType *resourceType) : Task() {
taskClass= tcProduce;
unitType= NULL;
unitClass = ucWarrior;
this->resourceType= resourceType;
}

View File

@ -39,6 +39,7 @@ const int Logger::logLineCount= 15;
Logger::Logger() {
//masterserverMode = false;
progress = 0;
string logs_path = getGameReadWritePath(GameConstants::path_logs_CacheLookupKey);
if(logs_path != "") {
fileName= logs_path + "log.txt";

View File

@ -38,15 +38,16 @@ using namespace Shared::Graphics;
namespace Glest { namespace Game{
uint32 Renderer::SurfaceData::nextUniqueId = 1;
bool Renderer::renderText3DEnabled = true;
const float SKIP_INTERPOLATION_DISTANCE = 20.0f;
const string DEFAULT_CHAR_FOR_WIDTH_CALC = "V";
// =====================================================
// class MeshCallbackTeamColor
// =====================================================
bool MeshCallbackTeamColor::noTeamColors = false;
const string DEFAULT_CHAR_FOR_WIDTH_CALC = "V";
void MeshCallbackTeamColor::execute(const Mesh *mesh) {
//team color
@ -4618,7 +4619,9 @@ void Renderer::renderObjects(const int renderFps) {
}
//objModel->updateInterpolationData(0.f, true);
objModel->updateInterpolationData(o->getAnimProgress(), true);
//if(this->gameCamera->getPos().dist(o->getPos()) <= SKIP_INTERPOLATION_DISTANCE) {
objModel->updateInterpolationData(o->getAnimProgress(), true);
//}
modelRenderer->render(objModel);
triangleCount+= objModel->getTriangleCount();
@ -4975,7 +4978,11 @@ void Renderer::renderUnits(const int renderFps) {
//render
Model *model= unit->getCurrentModelPtr();
model->updateInterpolationData(unit->getAnimProgress(), unit->isAlive() && !unit->isAnimProgressBound());
//printf("Rendering model [%d - %s]\n[%s]\nCamera [%s]\nDistance: %f\n",unit->getId(),unit->getType()->getName().c_str(),unit->getCurrVector().getString().c_str(),this->gameCamera->getPos().getString().c_str(),this->gameCamera->getPos().dist(unit->getCurrVector()));
//if(this->gameCamera->getPos().dist(unit->getCurrVector()) <= SKIP_INTERPOLATION_DISTANCE) {
model->updateInterpolationData(unit->getAnimProgress(), unit->isAlive() && !unit->isAnimProgressBound());
//}
modelRenderer->render(model);
triangleCount+= model->getTriangleCount();
@ -7401,7 +7408,9 @@ vector<Unit *> Renderer::renderUnitsFast(bool renderingShadows, bool colorPickin
//render
Model *model= unit->getCurrentModelPtr();
model->updateInterpolationVertices(unit->getAnimProgress(), unit->isAlive() && !unit->isAnimProgressBound());
//if(this->gameCamera->getPos().dist(unit->getCurrVector()) <= SKIP_INTERPOLATION_DISTANCE) {
model->updateInterpolationVertices(unit->getAnimProgress(), unit->isAlive() && !unit->isAnimProgressBound());
//}
if(colorPickingSelection == true) {
unit->setUniquePickingColor();
@ -7507,7 +7516,9 @@ vector<Object *> Renderer::renderObjectsFast(bool renderingShadows, bool resour
if(resourceOnly == false || o->getResource()!= NULL) {
Model *objModel= o->getModelPtr();
objModel->updateInterpolationData(o->getAnimProgress(), true);
//if(this->gameCamera->getPos().dist(o->getPos()) <= SKIP_INTERPOLATION_DISTANCE) {
objModel->updateInterpolationData(o->getAnimProgress(), true);
//}
const Vec3f &v= o->getConstPos();
if(colorPickingSelection == false) {

View File

@ -173,6 +173,7 @@ void Program::ShowMessageProgramState::update() {
Program::Program() {
//this->masterserverMode = false;
this->window = NULL;
this->shutdownApplicationEnabled = false;
this->skipRenderFrameCount = 0;
this->messageBoxIsSystemError = false;

View File

@ -593,7 +593,6 @@ void MenuStateJoinGame::update()
if(clientInterface->getIntroDone()) {
labelInfo.setText(lang.get("WaitingHost"));
Config& config= Config::getInstance();
string host = labelServerIp.getText();
std::vector<std::string> hostPartsList;
Tokenize(host,hostPartsList,":");

View File

@ -408,6 +408,8 @@ Faction::Faction() {
loadWorldNode = NULL;
techTree = NULL;
control = ctClosed;
overridePersonalityType = fpt_EndCount;
}

View File

@ -52,7 +52,13 @@ protected:
MeshCallback *meshCallback;
public:
ModelRenderer() {meshCallback= NULL;}
ModelRenderer() {
renderNormals = false;
renderTextures = false;
renderColors = false;
meshCallback= NULL;
}
virtual ~ModelRenderer(){};

View File

@ -47,6 +47,8 @@ Mesh::Mesh() {
vertexCount= 0;
indexCount= 0;
texCoordFrameCount = 0;
opacity = 0.0f;
specularPower = 0.0f;
vertices= NULL;
normals= NULL;