- fix custom player colors for mods
This commit is contained in:
parent
157c052a82
commit
c11266d529
|
@ -3474,17 +3474,10 @@ int glestMain(int argc, char** argv) {
|
||||||
|
|
||||||
// Cache Player textures - START
|
// Cache Player textures - START
|
||||||
string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey);
|
string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey);
|
||||||
string playerColorTexturePath = getGameCustomCoreDataPath(data_path, "") + "data/core/faction_textures/faction*.tga";
|
|
||||||
vector<string> playerColorTextureFilenames;
|
|
||||||
findAll(playerColorTexturePath, playerColorTextureFilenames, false, false);
|
|
||||||
|
|
||||||
std::map<int,Texture2D *> &crcPlayerTextureCache = CacheManager::getCachedItem< std::map<int,Texture2D *> >(GameConstants::playerTextureCacheLookupKey);
|
std::map<int,Texture2D *> &crcPlayerTextureCache = CacheManager::getCachedItem< std::map<int,Texture2D *> >(GameConstants::playerTextureCacheLookupKey);
|
||||||
for(int index = 0; index < GameConstants::maxPlayers; ++index) {
|
for(int index = 0; index < GameConstants::maxPlayers; ++index) {
|
||||||
string playerTexture = data_path + "data/core/faction_textures/faction" + intToStr(index) + ".tga";
|
//string playerTexture = data_path + "data/core/faction_textures/faction" + intToStr(index) + ".tga";
|
||||||
if(playerColorTextureFilenames.size() > 0) {
|
string playerTexture = getGameCustomCoreDataPath(data_path, "data/core/faction_textures/faction" + intToStr(index) + ".tga");
|
||||||
playerTexture = getGameCustomCoreDataPath(data_path, "") + "data/core/faction_textures/faction" + intToStr(index) + ".tga";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(fileExists(playerTexture) == true) {
|
if(fileExists(playerTexture) == true) {
|
||||||
Texture2D *texture = Renderer::getInstance().newTexture2D(rsGlobal);
|
Texture2D *texture = Renderer::getInstance().newTexture2D(rsGlobal);
|
||||||
if(texture) {
|
if(texture) {
|
||||||
|
|
|
@ -490,15 +490,9 @@ void Faction::init(
|
||||||
|
|
||||||
texture= Renderer::getInstance().newTexture2D(rsGame);
|
texture= Renderer::getInstance().newTexture2D(rsGame);
|
||||||
string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey);
|
string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey);
|
||||||
|
|
||||||
if(texture) {
|
if(texture) {
|
||||||
string playerColorTexture = getGameCustomCoreDataPath(data_path, "") + "data/core/faction_textures/faction" + intToStr(startLocationIndex) + ".tga";
|
string playerTexture = getGameCustomCoreDataPath(data_path, "data/core/faction_textures/faction" + intToStr(startLocationIndex) + ".tga");
|
||||||
if(fileExists(playerColorTexture) == true) {
|
texture->load(playerTexture);
|
||||||
texture->load(getGameCustomCoreDataPath(data_path, "") + "data/core/faction_textures/faction" + intToStr(startLocationIndex) + ".tga");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
texture->load(data_path + "data/core/faction_textures/faction" + intToStr(startLocationIndex) + ".tga");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( game->getGameSettings()->getPathFinderType() == pfBasic &&
|
if( game->getGameSettings()->getPathFinderType() == pfBasic &&
|
||||||
|
|
Loading…
Reference in New Issue
Block a user