- code cleanup from cppcheck
This commit is contained in:
parent
1a7f3d50ca
commit
c39da4cd69
|
@ -39,6 +39,7 @@ ProduceTask::ProduceTask() : Task() {
|
||||||
taskClass= tcProduce;
|
taskClass= tcProduce;
|
||||||
unitType= NULL;
|
unitType= NULL;
|
||||||
resourceType= NULL;
|
resourceType= NULL;
|
||||||
|
unitClass = ucWarrior;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProduceTask::ProduceTask(UnitClass unitClass) : Task() {
|
ProduceTask::ProduceTask(UnitClass unitClass) : Task() {
|
||||||
|
@ -52,11 +53,13 @@ ProduceTask::ProduceTask(const UnitType *unitType) : Task() {
|
||||||
taskClass= tcProduce;
|
taskClass= tcProduce;
|
||||||
this->unitType= unitType;
|
this->unitType= unitType;
|
||||||
resourceType= NULL;
|
resourceType= NULL;
|
||||||
|
unitClass = ucWarrior;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProduceTask::ProduceTask(const ResourceType *resourceType) : Task() {
|
ProduceTask::ProduceTask(const ResourceType *resourceType) : Task() {
|
||||||
taskClass= tcProduce;
|
taskClass= tcProduce;
|
||||||
unitType= NULL;
|
unitType= NULL;
|
||||||
|
unitClass = ucWarrior;
|
||||||
this->resourceType= resourceType;
|
this->resourceType= resourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ const int Logger::logLineCount= 15;
|
||||||
|
|
||||||
Logger::Logger() {
|
Logger::Logger() {
|
||||||
//masterserverMode = false;
|
//masterserverMode = false;
|
||||||
|
progress = 0;
|
||||||
string logs_path = getGameReadWritePath(GameConstants::path_logs_CacheLookupKey);
|
string logs_path = getGameReadWritePath(GameConstants::path_logs_CacheLookupKey);
|
||||||
if(logs_path != "") {
|
if(logs_path != "") {
|
||||||
fileName= logs_path + "log.txt";
|
fileName= logs_path + "log.txt";
|
||||||
|
|
|
@ -38,15 +38,16 @@ using namespace Shared::Graphics;
|
||||||
namespace Glest { namespace Game{
|
namespace Glest { namespace Game{
|
||||||
|
|
||||||
uint32 Renderer::SurfaceData::nextUniqueId = 1;
|
uint32 Renderer::SurfaceData::nextUniqueId = 1;
|
||||||
|
|
||||||
bool Renderer::renderText3DEnabled = true;
|
bool Renderer::renderText3DEnabled = true;
|
||||||
|
|
||||||
|
const float SKIP_INTERPOLATION_DISTANCE = 20.0f;
|
||||||
|
const string DEFAULT_CHAR_FOR_WIDTH_CALC = "V";
|
||||||
|
|
||||||
// =====================================================
|
// =====================================================
|
||||||
// class MeshCallbackTeamColor
|
// class MeshCallbackTeamColor
|
||||||
// =====================================================
|
// =====================================================
|
||||||
|
|
||||||
bool MeshCallbackTeamColor::noTeamColors = false;
|
bool MeshCallbackTeamColor::noTeamColors = false;
|
||||||
const string DEFAULT_CHAR_FOR_WIDTH_CALC = "V";
|
|
||||||
|
|
||||||
void MeshCallbackTeamColor::execute(const Mesh *mesh) {
|
void MeshCallbackTeamColor::execute(const Mesh *mesh) {
|
||||||
//team color
|
//team color
|
||||||
|
@ -4618,7 +4619,9 @@ void Renderer::renderObjects(const int renderFps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//objModel->updateInterpolationData(0.f, true);
|
//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);
|
modelRenderer->render(objModel);
|
||||||
|
|
||||||
triangleCount+= objModel->getTriangleCount();
|
triangleCount+= objModel->getTriangleCount();
|
||||||
|
@ -4975,7 +4978,11 @@ void Renderer::renderUnits(const int renderFps) {
|
||||||
|
|
||||||
//render
|
//render
|
||||||
Model *model= unit->getCurrentModelPtr();
|
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);
|
modelRenderer->render(model);
|
||||||
triangleCount+= model->getTriangleCount();
|
triangleCount+= model->getTriangleCount();
|
||||||
|
@ -7401,7 +7408,9 @@ vector<Unit *> Renderer::renderUnitsFast(bool renderingShadows, bool colorPickin
|
||||||
|
|
||||||
//render
|
//render
|
||||||
Model *model= unit->getCurrentModelPtr();
|
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) {
|
if(colorPickingSelection == true) {
|
||||||
unit->setUniquePickingColor();
|
unit->setUniquePickingColor();
|
||||||
|
@ -7507,7 +7516,9 @@ vector<Object *> Renderer::renderObjectsFast(bool renderingShadows, bool resour
|
||||||
|
|
||||||
if(resourceOnly == false || o->getResource()!= NULL) {
|
if(resourceOnly == false || o->getResource()!= NULL) {
|
||||||
Model *objModel= o->getModelPtr();
|
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();
|
const Vec3f &v= o->getConstPos();
|
||||||
|
|
||||||
if(colorPickingSelection == false) {
|
if(colorPickingSelection == false) {
|
||||||
|
|
|
@ -173,6 +173,7 @@ void Program::ShowMessageProgramState::update() {
|
||||||
|
|
||||||
Program::Program() {
|
Program::Program() {
|
||||||
//this->masterserverMode = false;
|
//this->masterserverMode = false;
|
||||||
|
this->window = NULL;
|
||||||
this->shutdownApplicationEnabled = false;
|
this->shutdownApplicationEnabled = false;
|
||||||
this->skipRenderFrameCount = 0;
|
this->skipRenderFrameCount = 0;
|
||||||
this->messageBoxIsSystemError = false;
|
this->messageBoxIsSystemError = false;
|
||||||
|
|
|
@ -593,7 +593,6 @@ void MenuStateJoinGame::update()
|
||||||
if(clientInterface->getIntroDone()) {
|
if(clientInterface->getIntroDone()) {
|
||||||
labelInfo.setText(lang.get("WaitingHost"));
|
labelInfo.setText(lang.get("WaitingHost"));
|
||||||
|
|
||||||
Config& config= Config::getInstance();
|
|
||||||
string host = labelServerIp.getText();
|
string host = labelServerIp.getText();
|
||||||
std::vector<std::string> hostPartsList;
|
std::vector<std::string> hostPartsList;
|
||||||
Tokenize(host,hostPartsList,":");
|
Tokenize(host,hostPartsList,":");
|
||||||
|
|
|
@ -408,6 +408,8 @@ Faction::Faction() {
|
||||||
loadWorldNode = NULL;
|
loadWorldNode = NULL;
|
||||||
techTree = NULL;
|
techTree = NULL;
|
||||||
|
|
||||||
|
control = ctClosed;
|
||||||
|
|
||||||
overridePersonalityType = fpt_EndCount;
|
overridePersonalityType = fpt_EndCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,13 @@ protected:
|
||||||
MeshCallback *meshCallback;
|
MeshCallback *meshCallback;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ModelRenderer() {meshCallback= NULL;}
|
ModelRenderer() {
|
||||||
|
renderNormals = false;
|
||||||
|
renderTextures = false;
|
||||||
|
renderColors = false;
|
||||||
|
|
||||||
|
meshCallback= NULL;
|
||||||
|
}
|
||||||
|
|
||||||
virtual ~ModelRenderer(){};
|
virtual ~ModelRenderer(){};
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,8 @@ Mesh::Mesh() {
|
||||||
vertexCount= 0;
|
vertexCount= 0;
|
||||||
indexCount= 0;
|
indexCount= 0;
|
||||||
texCoordFrameCount = 0;
|
texCoordFrameCount = 0;
|
||||||
|
opacity = 0.0f;
|
||||||
|
specularPower = 0.0f;
|
||||||
|
|
||||||
vertices= NULL;
|
vertices= NULL;
|
||||||
normals= NULL;
|
normals= NULL;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user