Merge branch 'develop' of github.com:MegaGlest/megaglest-source into develop

This commit is contained in:
titiger 2014-11-28 00:33:55 +01:00
commit 588811783f
4 changed files with 23 additions and 13 deletions

View File

@ -117,30 +117,30 @@ void CoreData::cleanup() {
waterSounds.getSoundsPtr()->clear();
}
Texture2D *CoreData::getTextureBySystemId(TextureSystemType type) const {
Texture2D *CoreData::getTextureBySystemId(TextureSystemType type) {
Texture2D *result = NULL;
switch(type) {
case tsyst_logoTexture:
result = logoTexture;
result = getLogoTexture();
break;
//std::vector<Texture2D *> logoTextureList;
case tsyst_backgroundTexture:
result = backgroundTexture;
result = getBackgroundTexture();
break;
case tsyst_fireTexture:
result = fireTexture;
result = getFireTexture();
break;
case tsyst_teamColorTexture:
result = teamColorTexture;
result = getTeamColorTexture();
break;
case tsyst_snowTexture:
result = snowTexture;
result = getSnowTexture();
break;
case tsyst_waterSplashTexture:
result = waterSplashTexture;
result = getWaterSplashTexture();
break;
case tsyst_customTexture:
result = customTexture;
result = getCustomTexture();
break;
case tsyst_buttonSmallTexture:
result = buttonSmallTexture;

View File

@ -152,7 +152,7 @@ public:
void loadFonts();
// Textures
Texture2D *getTextureBySystemId(TextureSystemType type) const;
Texture2D *getTextureBySystemId(TextureSystemType type);
Texture2D *getBackgroundTexture();
Texture2D *getFireTexture();

View File

@ -582,10 +582,15 @@ void Renderer::manageDeferredParticleSystems() {
CoreData::TextureSystemType textureSystemId =
static_cast<CoreData::TextureSystemType>(
ps->getTextureFileLoadDeferredSystemId());
//printf("Load DEFERRED particle i = %d textureSystemId = %d\n",i,textureSystemId);
if(textureSystemId != CoreData::tsyst_NONE) {
Texture2D *texture= CoreData::getInstance().getTextureBySystemId(textureSystemId);
//printf("Loading texture from system [%d] [%p]\n",textureSystemId,texture);
ps->setTexture(texture);
//printf("#2 Load DEFERRED particle i = %d textureSystemId = %d, texture = %p\n",i,textureSystemId,texture);
}
else {
Texture2D *texture= newTexture2D(rs);
@ -601,6 +606,7 @@ void Renderer::manageDeferredParticleSystems() {
texture->load(textureFile);
ps->setTexture(texture);
}
//printf("#3 Load DEFERRED particle i = %d textureSystemId = %d, texture = %p\n",i,textureSystemId,texture);
}
}
if(dynamic_cast<GameParticleSystem *>(ps) != NULL) {

View File

@ -5263,6 +5263,8 @@ Unit * Unit::loadGame(const XmlNode *rootNode, GameSettings *settings, Faction *
//result->fire->setTexture(CoreData::getInstance().getFireTexture());
result->fireParticleSystems.push_back(result->fire);
//printf("Load MAIN fire particle result->fire = %p\n",result->fire);
Renderer::getInstance().addToDeferredParticleSystemList(make_pair(result->fire, rsGame));
}
@ -5387,16 +5389,18 @@ Unit * Unit::loadGame(const XmlNode *rootNode, GameSettings *settings, Faction *
for(int i = 0; i < (int)unitParticleSystemNodeList.size(); ++i) {
XmlNode *node = unitParticleSystemNodeList[i];
if(linkFireIndex != i) {
if(result->fire == NULL || linkFireIndex != i) {
FireParticleSystem *ups = new FireParticleSystem();
ups->setParticleOwner(result);
ups->loadGame(node);
//ups->setTexture(CoreData::getInstance().getFireTexture());
result->fireParticleSystems.push_back(ups);
//if(linkFireIndex >= 0 && linkFireIndex == i) {
// result->fire = ups;
//}
//printf("Load fire particle i = %d linkFireIndex = %d result->fire = %p ups = %p\n",i,linkFireIndex,result->fire,ups);
if(result->fire == NULL && linkFireIndex >= 0 && linkFireIndex == i) {
result->fire = ups;
}
Renderer::getInstance().addToDeferredParticleSystemList(make_pair(ups, rsGame));
}
}