- attempt to fix additional oos issues
This commit is contained in:
parent
111523f60b
commit
939e88ce38
|
@ -4259,18 +4259,7 @@ void Game::mouseMove(int x, int y, const MouseState *ms) {
|
||||||
mouseY = y;
|
mouseY = y;
|
||||||
|
|
||||||
if (ms->get(mbCenter)) {
|
if (ms->get(mbCenter)) {
|
||||||
//if (input.isCtrlDown()) {
|
|
||||||
// float speed = input.isShiftDown() ? 1.f : 0.125f;
|
|
||||||
// float response = input.isShiftDown() ? 0.1875f : 0.0625f;
|
|
||||||
// gameCamera.moveForwardH((y - lastMousePos.y) * speed, response);
|
|
||||||
// gameCamera.moveSideH((x - lastMousePos.x) * speed, response);
|
|
||||||
//} else
|
|
||||||
mouseMoved = true;
|
mouseMoved = true;
|
||||||
{
|
|
||||||
//float ymult = Config::getInstance().getCameraInvertYAxis() ? -0.2f : 0.2f;
|
|
||||||
//float xmult = Config::getInstance().getCameraInvertXAxis() ? -0.2f : 0.2f;
|
|
||||||
|
|
||||||
//if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
|
||||||
if(currentCameraFollowUnit == NULL) {
|
if(currentCameraFollowUnit == NULL) {
|
||||||
float ymult = 0.2f;
|
float ymult = 0.2f;
|
||||||
float xmult = 0.2f;
|
float xmult = 0.2f;
|
||||||
|
@ -4286,10 +4275,8 @@ void Game::mouseMove(int x, int y, const MouseState *ms) {
|
||||||
mouseY=lastMousePos.y;
|
mouseY=lastMousePos.y;
|
||||||
Shared::Platform::Window::revertMousePos();
|
Shared::Platform::Window::revertMousePos();
|
||||||
|
|
||||||
//if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if(currentCameraFollowUnit==NULL) {
|
else if(currentCameraFollowUnit==NULL) {
|
||||||
//if(Window::isKeyDown() == false)
|
//if(Window::isKeyDown() == false)
|
||||||
if(!camLeftButtonDown && !camRightButtonDown && !camUpButtonDown && !camDownButtonDown)
|
if(!camLeftButtonDown && !camRightButtonDown && !camUpButtonDown && !camDownButtonDown)
|
||||||
|
@ -4412,10 +4399,7 @@ void Game::eventMouseWheel(int x, int y, int zDelta) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
|
||||||
//gameCamera.transitionXYZ(0.0f, -(float)zDelta / 30.0f, 0.0f);
|
|
||||||
gameCamera.zoom((float)zDelta / 60.0f);
|
gameCamera.zoom((float)zDelta / 60.0f);
|
||||||
//gameCamera.setMoveY(1);
|
|
||||||
}
|
}
|
||||||
catch(const exception &ex) {
|
catch(const exception &ex) {
|
||||||
char szBuf[8096]="";
|
char szBuf[8096]="";
|
||||||
|
@ -5175,7 +5159,7 @@ string Game::getDebugStats(std::map<int,string> &factionDebugInfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//intToStr(stats.getFramesToCalculatePlaytime()/GameConstants::updateFps/60
|
//intToStr(stats.getFramesToCalculatePlaytime()/GameConstants::updateFps/60
|
||||||
str+= "Time: " + floatToStr(world.getTimeFlow()->getTime(),2) + " [" + floatToStr((float)world.getStats()->getFramesToCalculatePlaytime() / (float)GameConstants::updateFps / 60.0,2) + "]\n";
|
str+= "Time: " + doubleToStr(world.getTimeFlow()->getTime(),2) + " [" + doubleToStr((double)world.getStats()->getFramesToCalculatePlaytime() / (double)GameConstants::updateFps / 60.0,2) + "]\n";
|
||||||
|
|
||||||
if(SystemFlags::getThreadedLoggerRunning() == true) {
|
if(SystemFlags::getThreadedLoggerRunning() == true) {
|
||||||
str+= "Log buffer count: " + intToStr(SystemFlags::getLogEntryBufferCount())+"\n";
|
str+= "Log buffer count: " + intToStr(SystemFlags::getLogEntryBufferCount())+"\n";
|
||||||
|
@ -5219,7 +5203,7 @@ string Game::getDebugStats(std::map<int,string> &factionDebugInfo) {
|
||||||
// }
|
// }
|
||||||
str+= "\n";
|
str+= "\n";
|
||||||
|
|
||||||
str+= "Visible quad area: " + floatToStr(visibleQuad.area()) +"\n";
|
str+= "Visible quad area: " + doubleToStr(visibleQuad.area()) +"\n";
|
||||||
// str+= "Visible quad camera area: " + floatToStr(visibleQuadCamera.area()) +"\n";
|
// str+= "Visible quad camera area: " + floatToStr(visibleQuadCamera.area()) +"\n";
|
||||||
|
|
||||||
// Rect2i boundingRect= visibleQuad.computeBoundingRect();
|
// Rect2i boundingRect= visibleQuad.computeBoundingRect();
|
||||||
|
|
|
@ -682,7 +682,6 @@ void CoreData::loadFonts() {
|
||||||
if(displayFont) {
|
if(displayFont) {
|
||||||
displayFont->setType(displayFontName,config.getString("FontDisplay",""),config.getString("FontDisplayFamily",""));
|
displayFont->setType(displayFontName,config.getString("FontDisplay",""),config.getString("FontDisplayFamily",""));
|
||||||
displayFont->setSize(displayFontSize);
|
displayFont->setSize(displayFontSize);
|
||||||
//displayFont->setYOffsetFactor(config.getFloat("FontDisplayYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -695,7 +694,6 @@ void CoreData::loadFonts() {
|
||||||
if(displayFont3D) {
|
if(displayFont3D) {
|
||||||
displayFont3D->setType(displayFontName,config.getString("FontDisplay",""),config.getString("FontDisplayFamily",""));
|
displayFont3D->setType(displayFontName,config.getString("FontDisplay",""),config.getString("FontDisplayFamily",""));
|
||||||
displayFont3D->setSize(displayFontSize);
|
displayFont3D->setSize(displayFontSize);
|
||||||
//displayFont3D->setYOffsetFactor(config.getFloat("FontDisplayYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,7 +725,6 @@ void CoreData::loadFonts() {
|
||||||
if(displayFontSmall) {
|
if(displayFontSmall) {
|
||||||
displayFontSmall->setType(displayFontNameSmall,config.getString("FontSmallDisplay",""),config.getString("FontSmallDisplayFamily",""));
|
displayFontSmall->setType(displayFontNameSmall,config.getString("FontSmallDisplay",""),config.getString("FontSmallDisplayFamily",""));
|
||||||
displayFontSmall->setSize(displayFontNameSmallSize);
|
displayFontSmall->setSize(displayFontNameSmallSize);
|
||||||
//displayFontSmall->setYOffsetFactor(config.getFloat("FontSmallDisplayYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -740,7 +737,6 @@ void CoreData::loadFonts() {
|
||||||
if(displayFontSmall3D) {
|
if(displayFontSmall3D) {
|
||||||
displayFontSmall3D->setType(displayFontNameSmall,config.getString("FontSmallDisplay",""),config.getString("FontSmallDisplayFamily",""));
|
displayFontSmall3D->setType(displayFontNameSmall,config.getString("FontSmallDisplay",""),config.getString("FontSmallDisplayFamily",""));
|
||||||
displayFontSmall3D->setSize(displayFontNameSmallSize);
|
displayFontSmall3D->setSize(displayFontNameSmallSize);
|
||||||
//displayFontSmall3D->setYOffsetFactor(config.getFloat("FontSmallDisplayYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -774,7 +770,6 @@ void CoreData::loadFonts() {
|
||||||
menuFontNormal->setType(menuFontNameNormal,config.getString("FontMenuNormal",""),config.getString("FontMenuNormalFamily",""));
|
menuFontNormal->setType(menuFontNameNormal,config.getString("FontMenuNormal",""),config.getString("FontMenuNormalFamily",""));
|
||||||
menuFontNormal->setSize(menuFontNameNormalSize);
|
menuFontNormal->setSize(menuFontNameNormalSize);
|
||||||
menuFontNormal->setWidth(Font::wBold);
|
menuFontNormal->setWidth(Font::wBold);
|
||||||
//menuFontNormal->setYOffsetFactor(config.getFloat("FontMenuNormalYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -788,7 +783,6 @@ void CoreData::loadFonts() {
|
||||||
menuFontNormal3D->setType(menuFontNameNormal,config.getString("FontMenuNormal",""),config.getString("FontMenuNormalFamily",""));
|
menuFontNormal3D->setType(menuFontNameNormal,config.getString("FontMenuNormal",""),config.getString("FontMenuNormalFamily",""));
|
||||||
menuFontNormal3D->setSize(menuFontNameNormalSize);
|
menuFontNormal3D->setSize(menuFontNameNormalSize);
|
||||||
menuFontNormal3D->setWidth(Font::wBold);
|
menuFontNormal3D->setWidth(Font::wBold);
|
||||||
//menuFontNormal3D->setYOffsetFactor(config.getFloat("FontMenuNormalYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -819,7 +813,6 @@ void CoreData::loadFonts() {
|
||||||
if(menuFontBig) {
|
if(menuFontBig) {
|
||||||
menuFontBig->setType(menuFontNameBig,config.getString("FontMenuBig",""),config.getString("FontMenuBigFamily",""));
|
menuFontBig->setType(menuFontNameBig,config.getString("FontMenuBig",""),config.getString("FontMenuBigFamily",""));
|
||||||
menuFontBig->setSize(menuFontNameBigSize);
|
menuFontBig->setSize(menuFontNameBigSize);
|
||||||
//menuFontBig->setYOffsetFactor(config.getFloat("FontMenuBigYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -832,7 +825,6 @@ void CoreData::loadFonts() {
|
||||||
if(menuFontBig3D) {
|
if(menuFontBig3D) {
|
||||||
menuFontBig3D->setType(menuFontNameBig,config.getString("FontMenuBig",""),config.getString("FontMenuBigFamily",""));
|
menuFontBig3D->setType(menuFontNameBig,config.getString("FontMenuBig",""),config.getString("FontMenuBigFamily",""));
|
||||||
menuFontBig3D->setSize(menuFontNameBigSize);
|
menuFontBig3D->setSize(menuFontNameBigSize);
|
||||||
//menuFontBig3D->setYOffsetFactor(config.getFloat("FontMenuBigYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -863,7 +855,6 @@ void CoreData::loadFonts() {
|
||||||
if(menuFontVeryBig) {
|
if(menuFontVeryBig) {
|
||||||
menuFontVeryBig->setType(menuFontNameVeryBig,config.getString("FontMenuVeryBig",""),config.getString("FontMenuVeryBigFamily",""));
|
menuFontVeryBig->setType(menuFontNameVeryBig,config.getString("FontMenuVeryBig",""),config.getString("FontMenuVeryBigFamily",""));
|
||||||
menuFontVeryBig->setSize(menuFontNameVeryBigSize);
|
menuFontVeryBig->setSize(menuFontNameVeryBigSize);
|
||||||
//menuFontVeryBig->setYOffsetFactor(config.getFloat("FontMenuVeryBigYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -876,7 +867,6 @@ void CoreData::loadFonts() {
|
||||||
if(menuFontVeryBig3D) {
|
if(menuFontVeryBig3D) {
|
||||||
menuFontVeryBig3D->setType(menuFontNameVeryBig,config.getString("FontMenuVeryBig",""),config.getString("FontMenuVeryBigFamily",""));
|
menuFontVeryBig3D->setType(menuFontNameVeryBig,config.getString("FontMenuVeryBig",""),config.getString("FontMenuVeryBigFamily",""));
|
||||||
menuFontVeryBig3D->setSize(menuFontNameVeryBigSize);
|
menuFontVeryBig3D->setSize(menuFontNameVeryBigSize);
|
||||||
//menuFontVeryBig3D->setYOffsetFactor(config.getFloat("FontMenuVeryBigYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -910,7 +900,6 @@ void CoreData::loadFonts() {
|
||||||
if(consoleFont) {
|
if(consoleFont) {
|
||||||
consoleFont->setType(consoleFontName,config.getString("FontConsole",""),config.getString("FontConsoleFamily",""));
|
consoleFont->setType(consoleFontName,config.getString("FontConsole",""),config.getString("FontConsoleFamily",""));
|
||||||
consoleFont->setSize(consoleFontNameSize);
|
consoleFont->setSize(consoleFontNameSize);
|
||||||
//consoleFont->setYOffsetFactor(config.getFloat("FontConsoleYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -923,7 +912,6 @@ void CoreData::loadFonts() {
|
||||||
if(consoleFont3D) {
|
if(consoleFont3D) {
|
||||||
consoleFont3D->setType(consoleFontName,config.getString("FontConsole",""),config.getString("FontConsoleFamily",""));
|
consoleFont3D->setType(consoleFontName,config.getString("FontConsole",""),config.getString("FontConsoleFamily",""));
|
||||||
consoleFont3D->setSize(consoleFontNameSize);
|
consoleFont3D->setSize(consoleFontNameSize);
|
||||||
//consoleFont3D->setYOffsetFactor(config.getFloat("FontConsoleYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -937,15 +925,6 @@ int CoreData::computeFontSize(int size) {
|
||||||
int screenH = config.getInt("ScreenHeight");
|
int screenH = config.getInt("ScreenHeight");
|
||||||
rs = size * screenH / 1024;
|
rs = size * screenH / 1024;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if(Renderer::renderText3DEnabled) {
|
|
||||||
//rs = ((float)size * 0.85);
|
|
||||||
//rs = 24;
|
|
||||||
}
|
|
||||||
//int screenH = config.getInt("ScreenHeight");
|
|
||||||
//rs = size * screenH / 1024;
|
|
||||||
|
|
||||||
}
|
|
||||||
//FontSizeAdjustment
|
//FontSizeAdjustment
|
||||||
rs += config.getInt("FontSizeAdjustment");
|
rs += config.getInt("FontSizeAdjustment");
|
||||||
if(Font::forceLegacyFonts == false) {
|
if(Font::forceLegacyFonts == false) {
|
||||||
|
|
|
@ -327,7 +327,7 @@ void ParticleSystemType::saveGame(XmlNode *rootNode) {
|
||||||
// Texture2D *texture;
|
// Texture2D *texture;
|
||||||
// Model *model;
|
// Model *model;
|
||||||
// float modelCycle;
|
// float modelCycle;
|
||||||
particleSystemTypeNode->addAttribute("modelCycle",floatToStr(modelCycle,16), mapTagReplacements);
|
particleSystemTypeNode->addAttribute("modelCycle",doubleToStr(modelCycle,16), mapTagReplacements);
|
||||||
// string primitive;
|
// string primitive;
|
||||||
particleSystemTypeNode->addAttribute("primitive",primitive, mapTagReplacements);
|
particleSystemTypeNode->addAttribute("primitive",primitive, mapTagReplacements);
|
||||||
// Vec3f offset;
|
// Vec3f offset;
|
||||||
|
@ -337,15 +337,15 @@ void ParticleSystemType::saveGame(XmlNode *rootNode) {
|
||||||
// Vec4f colorNoEnergy;
|
// Vec4f colorNoEnergy;
|
||||||
particleSystemTypeNode->addAttribute("colorNoEnergy",colorNoEnergy.getString(), mapTagReplacements);
|
particleSystemTypeNode->addAttribute("colorNoEnergy",colorNoEnergy.getString(), mapTagReplacements);
|
||||||
// float size;
|
// float size;
|
||||||
particleSystemTypeNode->addAttribute("size",floatToStr(size,16), mapTagReplacements);
|
particleSystemTypeNode->addAttribute("size",doubleToStr(size,16), mapTagReplacements);
|
||||||
// float sizeNoEnergy;
|
// float sizeNoEnergy;
|
||||||
particleSystemTypeNode->addAttribute("sizeNoEnergy",floatToStr(sizeNoEnergy,16), mapTagReplacements);
|
particleSystemTypeNode->addAttribute("sizeNoEnergy",doubleToStr(sizeNoEnergy,16), mapTagReplacements);
|
||||||
// float speed;
|
// float speed;
|
||||||
particleSystemTypeNode->addAttribute("speed",floatToStr(speed,16), mapTagReplacements);
|
particleSystemTypeNode->addAttribute("speed",doubleToStr(speed,16), mapTagReplacements);
|
||||||
// float gravity;
|
// float gravity;
|
||||||
particleSystemTypeNode->addAttribute("gravity",floatToStr(gravity,16), mapTagReplacements);
|
particleSystemTypeNode->addAttribute("gravity",doubleToStr(gravity,16), mapTagReplacements);
|
||||||
// float emissionRate;
|
// float emissionRate;
|
||||||
particleSystemTypeNode->addAttribute("emissionRate",floatToStr(emissionRate,16), mapTagReplacements);
|
particleSystemTypeNode->addAttribute("emissionRate",doubleToStr(emissionRate,16), mapTagReplacements);
|
||||||
// int energyMax;
|
// int energyMax;
|
||||||
particleSystemTypeNode->addAttribute("energyMax",intToStr(energyMax), mapTagReplacements);
|
particleSystemTypeNode->addAttribute("energyMax",intToStr(energyMax), mapTagReplacements);
|
||||||
// int energyVar;
|
// int energyVar;
|
||||||
|
@ -413,7 +413,7 @@ void ParticleSystemTypeProjectile::load(const XmlNode* particleFileNode, const s
|
||||||
|
|
||||||
//trajectory speed
|
//trajectory speed
|
||||||
const XmlNode *tajectorySpeedNode= tajectoryNode->getChild("speed");
|
const XmlNode *tajectorySpeedNode= tajectoryNode->getChild("speed");
|
||||||
trajectorySpeed= tajectorySpeedNode->getAttribute("value")->getFloatValue() / (float)GameConstants::updateFps;
|
trajectorySpeed= tajectorySpeedNode->getAttribute("value")->getFloatValue() / (double)GameConstants::updateFps;
|
||||||
//printf("[%s] trajectorySpeed = %f\n",path.c_str(),trajectorySpeed);
|
//printf("[%s] trajectorySpeed = %f\n",path.c_str(),trajectorySpeed);
|
||||||
|
|
||||||
if(trajectory=="parabolic" || trajectory=="spiral"){
|
if(trajectory=="parabolic" || trajectory=="spiral"){
|
||||||
|
@ -466,11 +466,11 @@ void ParticleSystemTypeProjectile::saveGame(XmlNode *rootNode) {
|
||||||
// string trajectory;
|
// string trajectory;
|
||||||
particleSystemTypeProjectileNode->addAttribute("trajectory",trajectory, mapTagReplacements);
|
particleSystemTypeProjectileNode->addAttribute("trajectory",trajectory, mapTagReplacements);
|
||||||
// float trajectorySpeed;
|
// float trajectorySpeed;
|
||||||
particleSystemTypeProjectileNode->addAttribute("trajectorySpeed",floatToStr(trajectorySpeed,16), mapTagReplacements);
|
particleSystemTypeProjectileNode->addAttribute("trajectorySpeed",doubleToStr(trajectorySpeed,16), mapTagReplacements);
|
||||||
// float trajectoryScale;
|
// float trajectoryScale;
|
||||||
particleSystemTypeProjectileNode->addAttribute("trajectoryScale",floatToStr(trajectoryScale,16), mapTagReplacements);
|
particleSystemTypeProjectileNode->addAttribute("trajectoryScale",doubleToStr(trajectoryScale,16), mapTagReplacements);
|
||||||
// float trajectoryFrequency;
|
// float trajectoryFrequency;
|
||||||
particleSystemTypeProjectileNode->addAttribute("trajectoryFrequency",floatToStr(trajectoryFrequency,16), mapTagReplacements);
|
particleSystemTypeProjectileNode->addAttribute("trajectoryFrequency",doubleToStr(trajectoryFrequency,16), mapTagReplacements);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================
|
// ===========================================================
|
||||||
|
@ -549,15 +549,15 @@ void ParticleSystemTypeSplash::saveGame(XmlNode *rootNode) {
|
||||||
XmlNode *particleSystemTypeSplashNode = rootNode->addChild("ParticleSystemTypeSplash");
|
XmlNode *particleSystemTypeSplashNode = rootNode->addChild("ParticleSystemTypeSplash");
|
||||||
|
|
||||||
// float emissionRateFade;
|
// float emissionRateFade;
|
||||||
particleSystemTypeSplashNode->addAttribute("emissionRateFade",floatToStr(emissionRateFade,16), mapTagReplacements);
|
particleSystemTypeSplashNode->addAttribute("emissionRateFade",doubleToStr(emissionRateFade,16), mapTagReplacements);
|
||||||
// float verticalSpreadA;
|
// float verticalSpreadA;
|
||||||
particleSystemTypeSplashNode->addAttribute("verticalSpreadA",floatToStr(verticalSpreadA,16), mapTagReplacements);
|
particleSystemTypeSplashNode->addAttribute("verticalSpreadA",doubleToStr(verticalSpreadA,16), mapTagReplacements);
|
||||||
// float verticalSpreadB;
|
// float verticalSpreadB;
|
||||||
particleSystemTypeSplashNode->addAttribute("verticalSpreadB",floatToStr(verticalSpreadB,16), mapTagReplacements);
|
particleSystemTypeSplashNode->addAttribute("verticalSpreadB",doubleToStr(verticalSpreadB,16), mapTagReplacements);
|
||||||
// float horizontalSpreadA;
|
// float horizontalSpreadA;
|
||||||
particleSystemTypeSplashNode->addAttribute("horizontalSpreadA",floatToStr(horizontalSpreadA,16), mapTagReplacements);
|
particleSystemTypeSplashNode->addAttribute("horizontalSpreadA",doubleToStr(horizontalSpreadA,16), mapTagReplacements);
|
||||||
// float horizontalSpreadB;
|
// float horizontalSpreadB;
|
||||||
particleSystemTypeSplashNode->addAttribute("horizontalSpreadB",floatToStr(horizontalSpreadB,16), mapTagReplacements);
|
particleSystemTypeSplashNode->addAttribute("horizontalSpreadB",doubleToStr(horizontalSpreadB,16), mapTagReplacements);
|
||||||
}
|
}
|
||||||
|
|
||||||
}}//end mamespace
|
}}//end mamespace
|
||||||
|
|
|
@ -1082,58 +1082,6 @@ void Renderer::setupLighting() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
if(timeFlow->isTotalNight()) {
|
|
||||||
for(int i = 0; i < world->getFactionCount() && lightCount < maxLights; ++i) {
|
|
||||||
for(int j = 0; j < world->getFaction(i)->getUnitCount() && lightCount < maxLights; ++j) {
|
|
||||||
Unit *unit= world->getFaction(i)->getUnit(j);
|
|
||||||
if(world->toRenderUnit(unit) &&
|
|
||||||
unit->getCurrVector().dist(gameCamera->getPos()) < maxLightDist &&
|
|
||||||
unit->getType()->getLight() && unit->isOperative()){
|
|
||||||
//printf("$$$ Show light for faction: %s # %d / %d for Unit [%d - %s]\n",world->getFaction(i)->getType()->getName().c_str(),lightCount,maxLights,unit->getId(),unit->getFullName().c_str());
|
|
||||||
|
|
||||||
Vec4f pos= Vec4f(unit->getCurrVector());
|
|
||||||
pos.y+=4.f;
|
|
||||||
|
|
||||||
GLenum lightEnum= GL_LIGHT0 + lightCount;
|
|
||||||
|
|
||||||
glEnable(lightEnum);
|
|
||||||
glLightfv(lightEnum, GL_POSITION, pos.ptr());
|
|
||||||
glLightfv(lightEnum, GL_AMBIENT, Vec4f(unit->getType()->getLightColor()).ptr());
|
|
||||||
glLightfv(lightEnum, GL_DIFFUSE, Vec4f(unit->getType()->getLightColor()).ptr());
|
|
||||||
glLightfv(lightEnum, GL_SPECULAR, Vec4f(unit->getType()->getLightColor()*0.3f).ptr());
|
|
||||||
glLightf(lightEnum, GL_QUADRATIC_ATTENUATION, 0.05f);
|
|
||||||
|
|
||||||
++lightCount;
|
|
||||||
|
|
||||||
const GameCamera *gameCamera= game->getGameCamera();
|
|
||||||
|
|
||||||
if(Vec3f(pos).dist(gameCamera->getPos())<Vec3f(nearestLightPos).dist(gameCamera->getPos())){
|
|
||||||
nearestLightPos= pos;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// else {
|
|
||||||
// for(int i = 0; i < world->getFactionCount() && lightCount < maxLights; ++i) {
|
|
||||||
// for(int j = 0; j < world->getFaction(i)->getUnitCount() && lightCount < maxLights; ++j) {
|
|
||||||
// Unit *unit= world->getFaction(i)->getUnit(j);
|
|
||||||
// if(world->toRenderUnit(unit) == true) {
|
|
||||||
// float dist = unit->getCurrVector().dist(gameCamera->getPos());
|
|
||||||
// bool showUnitLight = dist < maxLightDist &&
|
|
||||||
// unit->getType()->getLight() && unit->isOperative();
|
|
||||||
//
|
|
||||||
// if(showUnitLight == false && unit->getType()->getLight() == true) {
|
|
||||||
// printf("$$$ Show light for faction: %s # %d / %d for Unit [%d - %s] showUnitLight = %d dist = %f [%f] unit->getType()->getLight() = %d unit->isOperative() = %d\n",world->getFaction(i)->getType()->getName().c_str(),lightCount,maxLights,unit->getId(),unit->getFullName().c_str(),showUnitLight,dist,maxLightDist,unit->getType()->getLight(),unit->isOperative());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
assertGl();
|
assertGl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -165,16 +165,7 @@ void Object::update() {
|
||||||
|
|
||||||
double newAnimProgress = animProgress + f*(((double)objectType->getTilesetModelType(variation)->getAnimSpeed() * heightFactor) / speedDenominator);
|
double newAnimProgress = animProgress + f*(((double)objectType->getTilesetModelType(variation)->getAnimSpeed() * heightFactor) / speedDenominator);
|
||||||
|
|
||||||
// printf("A [%f] B [%f] C [%f] D [%f] E [%f] F [%f]\n",
|
|
||||||
// ((float)objectType->getTilesetModelType(variation)->getAnimSpeed() * heightFactor),
|
|
||||||
// speedDenominator,
|
|
||||||
// ((objectType->getTilesetModelType(variation)->getAnimSpeed() * heightFactor) / speedDenominator),
|
|
||||||
// (animProgress + ((objectType->getTilesetModelType(variation)->getAnimSpeed() * heightFactor) / speedDenominator)),
|
|
||||||
// animProgress,newAnimProgress);
|
|
||||||
|
|
||||||
animProgress = newAnimProgress;
|
animProgress = newAnimProgress;
|
||||||
// printf("#2 new animProgress [%f]\n",animProgress);
|
|
||||||
|
|
||||||
if(animProgress > 1.f) {
|
if(animProgress > 1.f) {
|
||||||
animProgress = 0.f;
|
animProgress = 0.f;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2509,7 +2509,6 @@ void Unit::updateTimedParticles() {
|
||||||
UnitParticleSystemType *pst = queuedUnitParticleSystemTypes[i];
|
UnitParticleSystemType *pst = queuedUnitParticleSystemTypes[i];
|
||||||
if(pst != NULL) {
|
if(pst != NULL) {
|
||||||
if(truncateDecimal<double>(pst->getStartTime(),16) <= truncateDecimal<double>(getAnimProgressAsFloat(),16)) {
|
if(truncateDecimal<double>(pst->getStartTime(),16) <= truncateDecimal<double>(getAnimProgressAsFloat(),16)) {
|
||||||
//printf("STARTING queued particle system type [%s] [%f] [%f] [%f] [%f]\n",pst->getType().c_str(),truncateDecimal<float>(pst->getStartTime()),truncateDecimal<float>(pst->getEndTime()),truncateDecimal<float>(animProgress),truncateDecimal<float>(lastAnimProgress));
|
|
||||||
|
|
||||||
UnitParticleSystem *ups = new UnitParticleSystem(200);
|
UnitParticleSystem *ups = new UnitParticleSystem(200);
|
||||||
ups->setParticleOwner(this);
|
ups->setParticleOwner(this);
|
||||||
|
@ -2542,10 +2541,8 @@ void Unit::updateTimedParticles() {
|
||||||
double particleEndTime = truncateDecimal<double>(pet,16);
|
double particleEndTime = truncateDecimal<double>(pet,16);
|
||||||
|
|
||||||
if(particleStartTime != 0.0 || particleEndTime != 1.0) {
|
if(particleStartTime != 0.0 || particleEndTime != 1.0) {
|
||||||
//printf("Checking for end particle system #%d [%d] [%f] [%f] [%f] [%f]\n",i,ps->shape,truncateDecimal<float>(ps->getStartTime()),truncateDecimal<float>(ps->getEndTime()),truncateDecimal<float>(animProgress),truncateDecimal<float>(lastAnimProgress));
|
|
||||||
double animProgressTime = truncateDecimal<double>(getAnimProgressAsFloat(),16);
|
double animProgressTime = truncateDecimal<double>(getAnimProgressAsFloat(),16);
|
||||||
if(animProgressTime >= 0.99 || animProgressTime >= particleEndTime) {
|
if(animProgressTime >= 0.99 || animProgressTime >= particleEndTime) {
|
||||||
//printf("ENDING particle system [%d]\n",ps->shape);
|
|
||||||
|
|
||||||
ps->fade();
|
ps->fade();
|
||||||
unitParticleSystems.erase(unitParticleSystems.begin() + i);
|
unitParticleSystems.erase(unitParticleSystems.begin() + i);
|
||||||
|
@ -3099,7 +3096,6 @@ string Unit::getDesc(bool translatedValue) const {
|
||||||
str += lang.get("MaxUnitCount")+ ": " + intToStr(faction->getCountForMaxUnitCount(type)) + "/" + intToStr(type->getMaxUnitCount());
|
str += lang.get("MaxUnitCount")+ ": " + intToStr(faction->getCountForMaxUnitCount(type)) + "/" + intToStr(type->getMaxUnitCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
//str += "\n"+lang.get("Hp")+ ": " + intToStr(hp) + "/" + intToStr(type->getTotalMaxHp(&totalUpgrade)) + " [" + floatToStr(getHpRatio()) + "] [" + floatToStr(animProgress) + "]";
|
|
||||||
str += "\n"+lang.get("Hp")+ ": " + intToStr(hp) + "/" + intToStr(type->getTotalMaxHp(&totalUpgrade));
|
str += "\n"+lang.get("Hp")+ ": " + intToStr(hp) + "/" + intToStr(type->getTotalMaxHp(&totalUpgrade));
|
||||||
if(type->getHpRegeneration() != 0 || totalUpgrade.getMaxHpRegeneration() != 0) {
|
if(type->getHpRegeneration() != 0 || totalUpgrade.getMaxHpRegeneration() != 0) {
|
||||||
str+= " (" + lang.get("Regeneration") + ": " + intToStr(type->getHpRegeneration());
|
str+= " (" + lang.get("Regeneration") + ": " + intToStr(type->getHpRegeneration());
|
||||||
|
|
|
@ -306,7 +306,6 @@ public:
|
||||||
inline bool getSubmerged(const Cell *c) const {return c->getHeight()<waterLevel;}
|
inline bool getSubmerged(const Cell *c) const {return c->getHeight()<waterLevel;}
|
||||||
inline bool getDeepSubmerged(const SurfaceCell *sc) const {return sc->getHeight()<waterLevel-(1.5f/heightFactor);}
|
inline bool getDeepSubmerged(const SurfaceCell *sc) const {return sc->getHeight()<waterLevel-(1.5f/heightFactor);}
|
||||||
inline bool getDeepSubmerged(const Cell *c) const {return c->getHeight()<waterLevel-(1.5f/heightFactor);}
|
inline bool getDeepSubmerged(const Cell *c) const {return c->getHeight()<waterLevel-(1.5f/heightFactor);}
|
||||||
//float getSurfaceHeight(const Vec2i &pos) const;
|
|
||||||
|
|
||||||
//is
|
//is
|
||||||
inline bool isInside(int x, int y) const {
|
inline bool isInside(int x, int y) const {
|
||||||
|
|
|
@ -1164,7 +1164,7 @@ void World::addAttackEffects(const Unit *unit) {
|
||||||
|
|
||||||
//returns the nearest unit that can store a type of resource given a position and a faction
|
//returns the nearest unit that can store a type of resource given a position and a faction
|
||||||
Unit *World::nearestStore(const Vec2i &pos, int factionIndex, const ResourceType *rt) {
|
Unit *World::nearestStore(const Vec2i &pos, int factionIndex, const ResourceType *rt) {
|
||||||
float currDist= infinity;
|
double currDist = infinity;
|
||||||
Unit *currUnit= NULL;
|
Unit *currUnit= NULL;
|
||||||
|
|
||||||
if(factionIndex >= getFactionCount()) {
|
if(factionIndex >= getFactionCount()) {
|
||||||
|
@ -1174,7 +1174,7 @@ Unit *World::nearestStore(const Vec2i &pos, int factionIndex, const ResourceType
|
||||||
for(int i=0; i < getFaction(factionIndex)->getUnitCount(); ++i) {
|
for(int i=0; i < getFaction(factionIndex)->getUnitCount(); ++i) {
|
||||||
Unit *u= getFaction(factionIndex)->getUnit(i);
|
Unit *u= getFaction(factionIndex)->getUnit(i);
|
||||||
if(u != NULL) {
|
if(u != NULL) {
|
||||||
float tmpDist= u->getPos().dist(pos);
|
double tmpDist= u->getPos().dist(pos);
|
||||||
if(tmpDist < currDist && u->getType() != NULL && u->getType()->getStore(rt) > 0 && u->isOperative()) {
|
if(tmpDist < currDist && u->getType() != NULL && u->getType()->getStore(rt) > 0 && u->isOperative()) {
|
||||||
currDist= tmpDist;
|
currDist= tmpDist;
|
||||||
currUnit= u;
|
currUnit= u;
|
||||||
|
|
|
@ -233,7 +233,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float area(){
|
double area() {
|
||||||
Vec2i v0= p[3]-p[0];
|
Vec2i v0= p[3]-p[0];
|
||||||
Vec2i v1= p[1]-p[2];
|
Vec2i v1= p[1]-p[2];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user