mirror of
https://github.com/glest/glest-source.git
synced 2025-08-22 07:52:51 +02:00
Bugfixes:
- final network fixes for mega-glest multiplayer performance improvements - added ability for windows builds to "ignore" hidden files so that glest wont try to read svn files - bugfix for loading the map editor
This commit is contained in:
@@ -252,7 +252,7 @@ END_EVENT_TABLE()
|
|||||||
// =====================================================
|
// =====================================================
|
||||||
|
|
||||||
GlCanvas::GlCanvas(MainWindow * mainWindow):
|
GlCanvas::GlCanvas(MainWindow * mainWindow):
|
||||||
wxGLCanvas(mainWindow, -1)
|
wxGLCanvas(mainWindow, -1, wxDefaultPosition)
|
||||||
{
|
{
|
||||||
this->mainWindow = mainWindow;
|
this->mainWindow = mainWindow;
|
||||||
}
|
}
|
||||||
|
@@ -85,6 +85,16 @@ void FactionType::load(const string &dir, const TechTree *techTree, Checksum* ch
|
|||||||
//open xml file
|
//open xml file
|
||||||
string path= dir+"/"+name+".xml";
|
string path= dir+"/"+name+".xml";
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
|
DWORD fileAttributes = GetFileAttributes(path.c_str());
|
||||||
|
if( (fileAttributes & FILE_ATTRIBUTE_HIDDEN) == FILE_ATTRIBUTE_HIDDEN)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
checksum->addFile(path);
|
checksum->addFile(path);
|
||||||
|
|
||||||
XmlTree xmlTree;
|
XmlTree xmlTree;
|
||||||
|
@@ -42,6 +42,16 @@ void ResourceType::load(const string &dir, Checksum* checksum){
|
|||||||
Logger::getInstance().add("Resource type: "+ formatString(name), true);
|
Logger::getInstance().add("Resource type: "+ formatString(name), true);
|
||||||
path= dir+"/"+name+".xml";
|
path= dir+"/"+name+".xml";
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
|
DWORD fileAttributes = GetFileAttributes(path.c_str());
|
||||||
|
if( (fileAttributes & FILE_ATTRIBUTE_HIDDEN) == FILE_ATTRIBUTE_HIDDEN)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
checksum->addFile(path);
|
checksum->addFile(path);
|
||||||
|
|
||||||
//tree
|
//tree
|
||||||
|
@@ -60,38 +60,52 @@ void TechTree::load(const string &dir, set<string> &factions, Checksum* checksum
|
|||||||
XmlTree xmlTree;
|
XmlTree xmlTree;
|
||||||
string path= dir+"/"+lastDir(dir)+".xml";
|
string path= dir+"/"+lastDir(dir)+".xml";
|
||||||
|
|
||||||
checksum->addFile(path);
|
bool bCanProcessFile = true;
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
xmlTree.load(path);
|
DWORD fileAttributes = GetFileAttributes(path.c_str());
|
||||||
const XmlNode *techTreeNode= xmlTree.getRootNode();
|
if( (fileAttributes & FILE_ATTRIBUTE_HIDDEN) == FILE_ATTRIBUTE_HIDDEN)
|
||||||
|
{
|
||||||
//attack types
|
bCanProcessFile = false;
|
||||||
const XmlNode *attackTypesNode= techTreeNode->getChild("attack-types");
|
|
||||||
attackTypes.resize(attackTypesNode->getChildCount());
|
|
||||||
for(int i=0; i<attackTypes.size(); ++i){
|
|
||||||
const XmlNode *attackTypeNode= attackTypesNode->getChild("attack-type", i);
|
|
||||||
attackTypes[i].setName(attackTypeNode->getAttribute("name")->getRestrictedValue());
|
|
||||||
attackTypes[i].setId(i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//armor types
|
#endif
|
||||||
const XmlNode *armorTypesNode= techTreeNode->getChild("armor-types");
|
|
||||||
armorTypes.resize(armorTypesNode->getChildCount());
|
|
||||||
for(int i=0; i<armorTypes.size(); ++i){
|
|
||||||
const XmlNode *armorTypeNode= armorTypesNode->getChild("armor-type", i);
|
|
||||||
armorTypes[i].setName(armorTypeNode->getAttribute("name")->getRestrictedValue());
|
|
||||||
armorTypes[i].setId(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
//damage multipliers
|
if(bCanProcessFile == true)
|
||||||
damageMultiplierTable.init(attackTypes.size(), armorTypes.size());
|
{
|
||||||
const XmlNode *damageMultipliersNode= techTreeNode->getChild("damage-multipliers");
|
checksum->addFile(path);
|
||||||
for(int i=0; i<damageMultipliersNode->getChildCount(); ++i){
|
|
||||||
const XmlNode *damageMultiplierNode= damageMultipliersNode->getChild("damage-multiplier", i);
|
xmlTree.load(path);
|
||||||
const AttackType *attackType= getAttackType(damageMultiplierNode->getAttribute("attack")->getRestrictedValue());
|
const XmlNode *techTreeNode= xmlTree.getRootNode();
|
||||||
const ArmorType *armorType= getArmorType(damageMultiplierNode->getAttribute("armor")->getRestrictedValue());
|
|
||||||
float multiplier= damageMultiplierNode->getAttribute("value")->getFloatValue();
|
//attack types
|
||||||
damageMultiplierTable.setDamageMultiplier(attackType, armorType, multiplier);
|
const XmlNode *attackTypesNode= techTreeNode->getChild("attack-types");
|
||||||
|
attackTypes.resize(attackTypesNode->getChildCount());
|
||||||
|
for(int i=0; i<attackTypes.size(); ++i){
|
||||||
|
const XmlNode *attackTypeNode= attackTypesNode->getChild("attack-type", i);
|
||||||
|
attackTypes[i].setName(attackTypeNode->getAttribute("name")->getRestrictedValue());
|
||||||
|
attackTypes[i].setId(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
//armor types
|
||||||
|
const XmlNode *armorTypesNode= techTreeNode->getChild("armor-types");
|
||||||
|
armorTypes.resize(armorTypesNode->getChildCount());
|
||||||
|
for(int i=0; i<armorTypes.size(); ++i){
|
||||||
|
const XmlNode *armorTypeNode= armorTypesNode->getChild("armor-type", i);
|
||||||
|
armorTypes[i].setName(armorTypeNode->getAttribute("name")->getRestrictedValue());
|
||||||
|
armorTypes[i].setId(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
//damage multipliers
|
||||||
|
damageMultiplierTable.init(attackTypes.size(), armorTypes.size());
|
||||||
|
const XmlNode *damageMultipliersNode= techTreeNode->getChild("damage-multipliers");
|
||||||
|
for(int i=0; i<damageMultipliersNode->getChildCount(); ++i){
|
||||||
|
const XmlNode *damageMultiplierNode= damageMultipliersNode->getChild("damage-multiplier", i);
|
||||||
|
const AttackType *attackType= getAttackType(damageMultiplierNode->getAttribute("attack")->getRestrictedValue());
|
||||||
|
const ArmorType *armorType= getArmorType(damageMultiplierNode->getAttribute("armor")->getRestrictedValue());
|
||||||
|
float multiplier= damageMultiplierNode->getAttribute("value")->getFloatValue();
|
||||||
|
damageMultiplierTable.setDamageMultiplier(attackType, armorType, multiplier);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(const exception &e){
|
catch(const exception &e){
|
||||||
|
@@ -94,6 +94,16 @@ void UnitType::load(int id,const string &dir, const TechTree *techTree, const Fa
|
|||||||
//file load
|
//file load
|
||||||
path= dir+"/"+name+".xml";
|
path= dir+"/"+name+".xml";
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
|
DWORD fileAttributes = GetFileAttributes(path.c_str());
|
||||||
|
if( (fileAttributes & FILE_ATTRIBUTE_HIDDEN) == FILE_ATTRIBUTE_HIDDEN)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
checksum->addFile(path);
|
checksum->addFile(path);
|
||||||
|
|
||||||
XmlTree xmlTree;
|
XmlTree xmlTree;
|
||||||
|
@@ -54,6 +54,16 @@ void UpgradeType::load(const string &dir, const TechTree *techTree, const Factio
|
|||||||
|
|
||||||
path=dir+"/"+name+".xml";
|
path=dir+"/"+name+".xml";
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
|
DWORD fileAttributes = GetFileAttributes(path.c_str());
|
||||||
|
if( (fileAttributes & FILE_ATTRIBUTE_HIDDEN) == FILE_ATTRIBUTE_HIDDEN)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
try{
|
try{
|
||||||
checksum->addFile(path);
|
checksum->addFile(path);
|
||||||
|
|
||||||
|
@@ -96,6 +96,16 @@ void Tileset::load(const string &dir, Checksum *checksum){
|
|||||||
string name= lastDir(dir);
|
string name= lastDir(dir);
|
||||||
string path= dir+"/"+name+".xml";
|
string path= dir+"/"+name+".xml";
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
|
||||||
|
DWORD fileAttributes = GetFileAttributes(path.c_str());
|
||||||
|
if( (fileAttributes & FILE_ATTRIBUTE_HIDDEN) == FILE_ATTRIBUTE_HIDDEN)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
checksum->addFile(path);
|
checksum->addFile(path);
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
Reference in New Issue
Block a user