- added a new bit style gamesetting flag for future new game settings.
- added ability to see map resources but still keep fog of war (GAE's shroud of darkness), but not activated by UI yet, tested and works
This commit is contained in:
parent
1c51b6c21d
commit
f204d4445c
|
@ -116,7 +116,8 @@ public:
|
||||||
~Game();
|
~Game();
|
||||||
|
|
||||||
//get
|
//get
|
||||||
GameSettings *getGameSettings() {return &gameSettings;}
|
GameSettings *getGameSettings() {return &gameSettings;}
|
||||||
|
const GameSettings *getReadOnlyGameSettings() const {return &gameSettings;}
|
||||||
|
|
||||||
const GameCamera *getGameCamera() const {return &gameCamera;}
|
const GameCamera *getGameCamera() const {return &gameCamera;}
|
||||||
GameCamera *getGameCamera() {return &gameCamera;}
|
GameCamera *getGameCamera() {return &gameCamera;}
|
||||||
|
|
|
@ -24,6 +24,16 @@ namespace Glest{ namespace Game{
|
||||||
// class GameSettings
|
// class GameSettings
|
||||||
// =====================================================
|
// =====================================================
|
||||||
|
|
||||||
|
enum FlagTypes1 {
|
||||||
|
ft1_none = 0x00,
|
||||||
|
ft1_show_map_resources = 0x01
|
||||||
|
//ft1_xx = 0x02,
|
||||||
|
//ft1_xx = 0x04,
|
||||||
|
//ft1_xx = 0x08,
|
||||||
|
//ft1_xx = 0x10,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class GameSettings{
|
class GameSettings{
|
||||||
private:
|
private:
|
||||||
string description;
|
string description;
|
||||||
|
@ -43,7 +53,7 @@ private:
|
||||||
int teams[GameConstants::maxPlayers];
|
int teams[GameConstants::maxPlayers];
|
||||||
int startLocationIndex[GameConstants::maxPlayers];
|
int startLocationIndex[GameConstants::maxPlayers];
|
||||||
int mapFilterIndex;
|
int mapFilterIndex;
|
||||||
|
|
||||||
|
|
||||||
bool defaultUnits;
|
bool defaultUnits;
|
||||||
bool defaultResources;
|
bool defaultResources;
|
||||||
|
@ -57,6 +67,8 @@ private:
|
||||||
bool networkPauseGameForLaggedClients;
|
bool networkPauseGameForLaggedClients;
|
||||||
PathFinderType pathFinderType;
|
PathFinderType pathFinderType;
|
||||||
|
|
||||||
|
uint32 flagTypes1;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,6 +90,8 @@ public:
|
||||||
teams[i] = 0;
|
teams[i] = 0;
|
||||||
startLocationIndex[i] = i;
|
startLocationIndex[i] = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flagTypes1 = ft1_none;
|
||||||
}
|
}
|
||||||
|
|
||||||
// default copy constructor will do fine, and will maintain itself ;)
|
// default copy constructor will do fine, and will maintain itself ;)
|
||||||
|
@ -131,6 +145,7 @@ public:
|
||||||
int getNetworkFramePeriod() const {return networkFramePeriod; }
|
int getNetworkFramePeriod() const {return networkFramePeriod; }
|
||||||
bool getNetworkPauseGameForLaggedClients() const {return networkPauseGameForLaggedClients; }
|
bool getNetworkPauseGameForLaggedClients() const {return networkPauseGameForLaggedClients; }
|
||||||
PathFinderType getPathFinderType() const { return pathFinderType; }
|
PathFinderType getPathFinderType() const { return pathFinderType; }
|
||||||
|
uint32 getFlagTypes1() const { return flagTypes1;}
|
||||||
|
|
||||||
//set
|
//set
|
||||||
void setDescription(const string& description) {this->description= description;}
|
void setDescription(const string& description) {this->description= description;}
|
||||||
|
@ -144,7 +159,7 @@ public:
|
||||||
void setNetworkPlayerName(int factionIndex,const string& playername) {this->networkPlayerNames[factionIndex]= playername;}
|
void setNetworkPlayerName(int factionIndex,const string& playername) {this->networkPlayerNames[factionIndex]= playername;}
|
||||||
void setFactionControl(int factionIndex, ControlType controller) {this->factionControls[factionIndex]= controller;}
|
void setFactionControl(int factionIndex, ControlType controller) {this->factionControls[factionIndex]= controller;}
|
||||||
void setResourceMultiplierIndex(int factionIndex, int multiplierIndex) {this->resourceMultiplierIndex[factionIndex]= multiplierIndex;}
|
void setResourceMultiplierIndex(int factionIndex, int multiplierIndex) {this->resourceMultiplierIndex[factionIndex]= multiplierIndex;}
|
||||||
|
|
||||||
void setThisFactionIndex(int thisFactionIndex) {this->thisFactionIndex= thisFactionIndex;}
|
void setThisFactionIndex(int thisFactionIndex) {this->thisFactionIndex= thisFactionIndex;}
|
||||||
void setFactionCount(int factionCount) {this->factionCount= factionCount;}
|
void setFactionCount(int factionCount) {this->factionCount= factionCount;}
|
||||||
void setTeam(int factionIndex, int team) {this->teams[factionIndex]= team;}
|
void setTeam(int factionIndex, int team) {this->teams[factionIndex]= team;}
|
||||||
|
@ -162,6 +177,7 @@ public:
|
||||||
void setNetworkFramePeriod(int value) {this->networkFramePeriod = value; }
|
void setNetworkFramePeriod(int value) {this->networkFramePeriod = value; }
|
||||||
void setNetworkPauseGameForLaggedClients(bool value) {this->networkPauseGameForLaggedClients = value; }
|
void setNetworkPauseGameForLaggedClients(bool value) {this->networkPauseGameForLaggedClients = value; }
|
||||||
void setPathFinderType(PathFinderType value) {this->pathFinderType = value; }
|
void setPathFinderType(PathFinderType value) {this->pathFinderType = value; }
|
||||||
|
void setFlagTypes1(uint32 value) {this->flagTypes1 = value; }
|
||||||
|
|
||||||
string toString() const {
|
string toString() const {
|
||||||
string result = "";
|
string result = "";
|
||||||
|
@ -197,6 +213,7 @@ public:
|
||||||
result += "networkFramePeriod = " + intToStr(networkFramePeriod) + "\n";
|
result += "networkFramePeriod = " + intToStr(networkFramePeriod) + "\n";
|
||||||
result += "networkPauseGameForLaggedClients = " + intToStr(networkPauseGameForLaggedClients) + "\n";
|
result += "networkPauseGameForLaggedClients = " + intToStr(networkPauseGameForLaggedClients) + "\n";
|
||||||
result += "pathFinderType = " + intToStr(pathFinderType) + "\n";
|
result += "pathFinderType = " + intToStr(pathFinderType) + "\n";
|
||||||
|
result += "flagTypes1 = " + intToStr(flagTypes1) + "\n";
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1965,6 +1965,10 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings) {
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
|
// Test flags values
|
||||||
|
//gameSettings->setFlagTypes1(ft1_show_map_resources);
|
||||||
|
//
|
||||||
|
|
||||||
gameSettings->setMapFilterIndex(listBoxMapFilter.getSelectedItemIndex());
|
gameSettings->setMapFilterIndex(listBoxMapFilter.getSelectedItemIndex());
|
||||||
gameSettings->setDescription(formatString(getCurrentMapFile()));
|
gameSettings->setDescription(formatString(getCurrentMapFile()));
|
||||||
gameSettings->setMap(getCurrentMapFile());
|
gameSettings->setMap(getCurrentMapFile());
|
||||||
|
|
|
@ -232,6 +232,7 @@ NetworkMessageLaunch::NetworkMessageLaunch(const GameSettings *gameSettings,int8
|
||||||
data.networkFramePeriod = gameSettings->getNetworkFramePeriod();
|
data.networkFramePeriod = gameSettings->getNetworkFramePeriod();
|
||||||
data.networkPauseGameForLaggedClients = gameSettings->getNetworkPauseGameForLaggedClients();
|
data.networkPauseGameForLaggedClients = gameSettings->getNetworkPauseGameForLaggedClients();
|
||||||
data.pathFinderType = gameSettings->getPathFinderType();
|
data.pathFinderType = gameSettings->getPathFinderType();
|
||||||
|
data.flagTypes1 = gameSettings->getFlagTypes1();
|
||||||
|
|
||||||
for(int i= 0; i<data.factionCount; ++i){
|
for(int i= 0; i<data.factionCount; ++i){
|
||||||
data.factionTypeNames[i]= gameSettings->getFactionTypeName(i);
|
data.factionTypeNames[i]= gameSettings->getFactionTypeName(i);
|
||||||
|
@ -261,6 +262,7 @@ void NetworkMessageLaunch::buildGameSettings(GameSettings *gameSettings) const{
|
||||||
gameSettings->setNetworkFramePeriod(data.networkFramePeriod);
|
gameSettings->setNetworkFramePeriod(data.networkFramePeriod);
|
||||||
gameSettings->setNetworkPauseGameForLaggedClients((data.networkPauseGameForLaggedClients != 0));
|
gameSettings->setNetworkPauseGameForLaggedClients((data.networkPauseGameForLaggedClients != 0));
|
||||||
gameSettings->setPathFinderType(static_cast<PathFinderType>(data.pathFinderType));
|
gameSettings->setPathFinderType(static_cast<PathFinderType>(data.pathFinderType));
|
||||||
|
gameSettings->setFlagTypes1(data.flagTypes1);
|
||||||
|
|
||||||
for(int i= 0; i<data.factionCount; ++i){
|
for(int i= 0; i<data.factionCount; ++i){
|
||||||
gameSettings->setFactionTypeName(i, data.factionTypeNames[i].getString());
|
gameSettings->setFactionTypeName(i, data.factionTypeNames[i].getString());
|
||||||
|
|
|
@ -211,6 +211,7 @@ private:
|
||||||
uint8 networkFramePeriod; // allowed values 0 - 255
|
uint8 networkFramePeriod; // allowed values 0 - 255
|
||||||
int8 networkPauseGameForLaggedClients;
|
int8 networkPauseGameForLaggedClients;
|
||||||
int8 pathFinderType;
|
int8 pathFinderType;
|
||||||
|
uint32 flagTypes1;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
//
|
//
|
||||||
// Copyright (C) 2001-2008 Martio Figueroa
|
// Copyright (C) 2001-2008 Martio Figueroa
|
||||||
//
|
//
|
||||||
// You can redistribute this code and/or modify it under
|
// You can redistribute this code and/or modify it under
|
||||||
// the terms of the GNU General Public License as published
|
// the terms of the GNU General Public License as published
|
||||||
// by the Free Software Foundation; either version 2 of the
|
// by the Free Software Foundation; either version 2 of the
|
||||||
// License, or (at your option) any later version
|
// License, or (at your option) any later version
|
||||||
// ==============================================================
|
// ==============================================================
|
||||||
|
|
||||||
|
@ -15,9 +15,10 @@
|
||||||
|
|
||||||
#include "world.h"
|
#include "world.h"
|
||||||
#include "vec.h"
|
#include "vec.h"
|
||||||
#include "renderer.h"
|
#include "renderer.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
#include "game_settings.h"
|
||||||
#include "leak_dumper.h"
|
#include "leak_dumper.h"
|
||||||
|
|
||||||
using namespace Shared::Graphics;
|
using namespace Shared::Graphics;
|
||||||
|
@ -34,21 +35,36 @@ Minimap::Minimap() {
|
||||||
fowPixmap0= NULL;
|
fowPixmap0= NULL;
|
||||||
fowPixmap1= NULL;
|
fowPixmap1= NULL;
|
||||||
fogOfWar= true;//Config::getInstance().getBool("FogOfWar");
|
fogOfWar= true;//Config::getInstance().getBool("FogOfWar");
|
||||||
|
gameSettings= NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Minimap::init(int w, int h, const World *world, bool fogOfWar){
|
void Minimap::init(int w, int h, const World *world, bool fogOfWar) {
|
||||||
int scaledW= w/Map::cellScale;
|
int scaledW= w/Map::cellScale;
|
||||||
int scaledH= h/Map::cellScale;
|
int scaledH= h/Map::cellScale;
|
||||||
|
|
||||||
this->fogOfWar = fogOfWar;
|
this->fogOfWar = fogOfWar;
|
||||||
|
this->gameSettings = world->getGameSettings();
|
||||||
Renderer &renderer= Renderer::getInstance();
|
Renderer &renderer= Renderer::getInstance();
|
||||||
|
|
||||||
//fow pixmaps
|
//fow pixmaps
|
||||||
float f= 0.f;
|
float f= 0.f;
|
||||||
fowPixmap0= new Pixmap2D(next2Power(scaledW), next2Power(scaledH), 1);
|
fowPixmap0= new Pixmap2D(next2Power(scaledW), next2Power(scaledH), 1);
|
||||||
fowPixmap1= new Pixmap2D(next2Power(scaledW), next2Power(scaledH), 1);
|
fowPixmap1= new Pixmap2D(next2Power(scaledW), next2Power(scaledH), 1);
|
||||||
|
|
||||||
fowPixmap0->setPixels(&f);
|
fowPixmap0->setPixels(&f);
|
||||||
fowPixmap1->setPixels(&f);
|
if((this->gameSettings->getFlagTypes1() & ft1_show_map_resources) == ft1_show_map_resources) {
|
||||||
|
f = 0.f;
|
||||||
|
fowPixmap1->setPixels(&f);
|
||||||
|
f = 0.5f;
|
||||||
|
for (int y=1; y < scaledH - 1; ++y) {
|
||||||
|
for (int x=1; x < scaledW - 1; ++x) {
|
||||||
|
fowPixmap1->setPixel(x, y, &f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fowPixmap1->setPixels(&f);
|
||||||
|
}
|
||||||
|
|
||||||
//fow tex
|
//fow tex
|
||||||
fowTex= renderer.newTexture2D(rsGame);
|
fowTex= renderer.newTexture2D(rsGame);
|
||||||
|
@ -62,7 +78,7 @@ void Minimap::init(int w, int h, const World *world, bool fogOfWar){
|
||||||
tex= renderer.newTexture2D(rsGame);
|
tex= renderer.newTexture2D(rsGame);
|
||||||
tex->getPixmap()->init(scaledW, scaledH, 3);
|
tex->getPixmap()->init(scaledW, scaledH, 3);
|
||||||
tex->setMipmap(false);
|
tex->setMipmap(false);
|
||||||
|
|
||||||
computeTexture(world);
|
computeTexture(world);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,9 +91,9 @@ Minimap::~Minimap() {
|
||||||
// ==================== set ====================
|
// ==================== set ====================
|
||||||
|
|
||||||
void Minimap::incFowTextureAlphaSurface(const Vec2i &sPos, float alpha) {
|
void Minimap::incFowTextureAlphaSurface(const Vec2i &sPos, float alpha) {
|
||||||
|
|
||||||
assert(sPos.x<fowPixmap1->getW() && sPos.y<fowPixmap1->getH());
|
assert(sPos.x<fowPixmap1->getW() && sPos.y<fowPixmap1->getH());
|
||||||
|
|
||||||
if(fowPixmap1->getPixelf(sPos.x, sPos.y)<alpha){
|
if(fowPixmap1->getPixelf(sPos.x, sPos.y)<alpha){
|
||||||
fowPixmap1->setPixel(sPos.x, sPos.y, alpha);
|
fowPixmap1->setPixel(sPos.x, sPos.y, alpha);
|
||||||
}
|
}
|
||||||
|
@ -93,7 +109,19 @@ void Minimap::resetFowTex() {
|
||||||
|
|
||||||
for(int i=0; i<fowTex->getPixmap()->getW(); ++i){
|
for(int i=0; i<fowTex->getPixmap()->getW(); ++i){
|
||||||
for(int j=0; j<fowTex->getPixmap()->getH(); ++j){
|
for(int j=0; j<fowTex->getPixmap()->getH(); ++j){
|
||||||
if(fogOfWar && overridefogOfWarValue){
|
if ((fogOfWar == false && overridefogOfWarValue == false) &&
|
||||||
|
(gameSettings->getFlagTypes1() & ft1_show_map_resources) != ft1_show_map_resources) {
|
||||||
|
float p0 = fowPixmap0->getPixelf(i, j);
|
||||||
|
float p1 = fowPixmap1->getPixelf(i, j);
|
||||||
|
if (p0 > p1) {
|
||||||
|
fowPixmap1->setPixel(i, j, p0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fowPixmap1->setPixel(i, j, p1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if((fogOfWar && overridefogOfWarValue) ||
|
||||||
|
(gameSettings->getFlagTypes1() & ft1_show_map_resources) != ft1_show_map_resources) {
|
||||||
float p0= fowPixmap0->getPixelf(i, j);
|
float p0= fowPixmap0->getPixelf(i, j);
|
||||||
float p1= fowPixmap1->getPixelf(i, j);
|
float p1= fowPixmap1->getPixelf(i, j);
|
||||||
|
|
||||||
|
@ -117,13 +145,13 @@ void Minimap::updateFowTex(float t) {
|
||||||
float p1= fowPixmap1->getPixelf(i, j);
|
float p1= fowPixmap1->getPixelf(i, j);
|
||||||
if(p1!=fowTex->getPixmap()->getPixelf(i, j)){
|
if(p1!=fowTex->getPixmap()->getPixelf(i, j)){
|
||||||
float p0= fowPixmap0->getPixelf(i, j);
|
float p0= fowPixmap0->getPixelf(i, j);
|
||||||
fowTex->getPixmap()->setPixel(i, j, p0+(t*(p1-p0)));
|
fowTex->getPixmap()->setPixel(i, j, p0+(t*(p1-p0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== PRIVATE ====================
|
// ==================== PRIVATE ====================
|
||||||
|
|
||||||
void Minimap::computeTexture(const World *world) {
|
void Minimap::computeTexture(const World *world) {
|
||||||
|
|
||||||
|
@ -134,8 +162,8 @@ void Minimap::computeTexture(const World *world) {
|
||||||
|
|
||||||
for(int j=0; j<tex->getPixmap()->getH(); ++j){
|
for(int j=0; j<tex->getPixmap()->getH(); ++j){
|
||||||
for(int i=0; i<tex->getPixmap()->getW(); ++i){
|
for(int i=0; i<tex->getPixmap()->getW(); ++i){
|
||||||
SurfaceCell *sc= map->getSurfaceCell(i, j);
|
SurfaceCell *sc= map->getSurfaceCell(i, j);
|
||||||
|
|
||||||
if(sc->getObject()==NULL || sc->getObject()->getType()==NULL){
|
if(sc->getObject()==NULL || sc->getObject()->getType()==NULL){
|
||||||
const Pixmap2D *p= world->getTileset()->getSurfPixmap(sc->getSurfaceType(), 0);
|
const Pixmap2D *p= world->getTileset()->getSurfPixmap(sc->getSurfaceType(), 0);
|
||||||
color= p->getPixel3f(p->getW()/2, p->getH()/2);
|
color= p->getPixel3f(p->getW()/2, p->getH()/2);
|
||||||
|
@ -149,7 +177,7 @@ void Minimap::computeTexture(const World *world) {
|
||||||
if(color.y>1.f) color.y=1.f;
|
if(color.y>1.f) color.y=1.f;
|
||||||
if(color.z>1.f) color.z=1.f;
|
if(color.z>1.f) color.z=1.f;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
color= sc->getObject()->getType()->getColor();
|
color= sc->getObject()->getType()->getColor();
|
||||||
}
|
}
|
||||||
tex->getPixmap()->setPixel(i, j, color);
|
tex->getPixmap()->setPixel(i, j, color);
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
//
|
//
|
||||||
// Copyright (C) 2001-2008 Martio Figueroa
|
// Copyright (C) 2001-2008 Martio Figueroa
|
||||||
//
|
//
|
||||||
// You can redistribute this code and/or modify it under
|
// You can redistribute this code and/or modify it under
|
||||||
// the terms of the GNU General Public License as published
|
// the terms of the GNU General Public License as published
|
||||||
// by the Free Software Foundation; either version 2 of the
|
// by the Free Software Foundation; either version 2 of the
|
||||||
// License, or (at your option) any later version
|
// License, or (at your option) any later version
|
||||||
// ==============================================================
|
// ==============================================================
|
||||||
|
|
||||||
|
@ -24,7 +24,8 @@ using Shared::Graphics::Vec2i;
|
||||||
using Shared::Graphics::Pixmap2D;
|
using Shared::Graphics::Pixmap2D;
|
||||||
using Shared::Graphics::Texture2D;
|
using Shared::Graphics::Texture2D;
|
||||||
|
|
||||||
class World;
|
class World;
|
||||||
|
class GameSettings;
|
||||||
|
|
||||||
enum ExplorationState{
|
enum ExplorationState{
|
||||||
esNotExplored,
|
esNotExplored,
|
||||||
|
@ -33,7 +34,7 @@ enum ExplorationState{
|
||||||
};
|
};
|
||||||
|
|
||||||
// =====================================================
|
// =====================================================
|
||||||
// class Minimap
|
// class Minimap
|
||||||
//
|
//
|
||||||
/// State of the in-game minimap
|
/// State of the in-game minimap
|
||||||
// =====================================================
|
// =====================================================
|
||||||
|
@ -44,7 +45,8 @@ private:
|
||||||
Pixmap2D *fowPixmap1;
|
Pixmap2D *fowPixmap1;
|
||||||
Texture2D *tex;
|
Texture2D *tex;
|
||||||
Texture2D *fowTex; //Fog Of War Texture2D
|
Texture2D *fowTex; //Fog Of War Texture2D
|
||||||
bool fogOfWar;
|
bool fogOfWar;
|
||||||
|
const GameSettings *gameSettings;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const float exploredAlpha;
|
static const float exploredAlpha;
|
||||||
|
@ -66,6 +68,6 @@ private:
|
||||||
void computeTexture(const World *world);
|
void computeTexture(const World *world);
|
||||||
};
|
};
|
||||||
|
|
||||||
}}//end namespace
|
}}//end namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -876,7 +876,7 @@ void World::initCells(bool fogOfWar) {
|
||||||
j/(next2Power(map.getSurfaceH())-1.f)));
|
j/(next2Power(map.getSurfaceH())-1.f)));
|
||||||
|
|
||||||
for (int k = 0; k < GameConstants::maxPlayers; k++) {
|
for (int k = 0; k < GameConstants::maxPlayers; k++) {
|
||||||
sc->setExplored(k, !fogOfWar);
|
sc->setExplored(k, (game->getGameSettings()->getFlagTypes1() & ft1_show_map_resources) == ft1_show_map_resources);
|
||||||
sc->setVisible(k, !fogOfWar);
|
sc->setVisible(k, !fogOfWar);
|
||||||
}
|
}
|
||||||
for (int k = GameConstants::maxPlayers; k < GameConstants::maxPlayers + GameConstants::specialFactions; k++) {
|
for (int k = GameConstants::maxPlayers; k < GameConstants::maxPlayers + GameConstants::specialFactions; k++) {
|
||||||
|
@ -1342,6 +1342,10 @@ void World::computeFow(int factionIdxToTick) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const GameSettings * World::getGameSettings() const {
|
||||||
|
return (game != NULL ? game->getReadOnlyGameSettings() : NULL);
|
||||||
|
}
|
||||||
|
|
||||||
// WARNING! This id is critical! Make sure it fits inside the network packet
|
// WARNING! This id is critical! Make sure it fits inside the network packet
|
||||||
// (currently cannot be larger than 2,147,483,647)
|
// (currently cannot be larger than 2,147,483,647)
|
||||||
// Make sure each faction has their own unique section of id #'s for proper
|
// Make sure each faction has their own unique section of id #'s for proper
|
||||||
|
|
|
@ -196,7 +196,8 @@ public:
|
||||||
int getUnitCount(int factionIndex);
|
int getUnitCount(int factionIndex);
|
||||||
int getUnitCountOfType(int factionIndex, const string &typeName);
|
int getUnitCountOfType(int factionIndex, const string &typeName);
|
||||||
|
|
||||||
Game * getGame() { return game; }
|
Game * getGame() { return game; }
|
||||||
|
const GameSettings * getGameSettings() const;
|
||||||
|
|
||||||
std::vector<std::string> validateFactionTypes();
|
std::vector<std::string> validateFactionTypes();
|
||||||
std::vector<std::string> validateResourceTypes();
|
std::vector<std::string> validateResourceTypes();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user