attempt bugfix for bad screenshots on saved games
This commit is contained in:
parent
1067e89915
commit
0bc9ed082f
|
@ -268,16 +268,23 @@ void MenuStateLoadGame::mouseClick(int x, int y, MouseButton mouseButton){
|
||||||
if(slots[i]->mouseClick(x, y) && selectedButton != slots[i]) {
|
if(slots[i]->mouseClick(x, y) && selectedButton != slots[i]) {
|
||||||
soundRenderer.playFx(coreData.getClickSoundB());
|
soundRenderer.playFx(coreData.getClickSoundB());
|
||||||
|
|
||||||
|
Lang &lang= Lang::getInstance();
|
||||||
cleanupTexture(&previewTexture);
|
cleanupTexture(&previewTexture);
|
||||||
selectedButton = slots[i];
|
selectedButton = slots[i];
|
||||||
string filename = saveGameDir + selectedButton->getText()+".xml";
|
string filename = saveGameDir + selectedButton->getText()+".xml";
|
||||||
string screenShotFilename = filename + ".jpg";
|
string screenShotFilename = filename + ".jpg";
|
||||||
if(fileExists(screenShotFilename) == true) {
|
if(fileExists(screenShotFilename) == true) {
|
||||||
previewTexture = GraphicsInterface::getInstance().getFactory()->newTexture2D();
|
try {
|
||||||
if(previewTexture) {
|
previewTexture = GraphicsInterface::getInstance().getFactory()->newTexture2D();
|
||||||
previewTexture->setMipmap(true);
|
if(previewTexture) {
|
||||||
previewTexture->load(screenShotFilename);
|
previewTexture->setMipmap(true);
|
||||||
previewTexture->init();
|
previewTexture->load(screenShotFilename);
|
||||||
|
previewTexture->init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(const megaglest_runtime_error &ex) {
|
||||||
|
cleanupTexture(&previewTexture);
|
||||||
|
showMessageBox(ex.what(), lang.getString("Notice"), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -285,8 +292,6 @@ void MenuStateLoadGame::mouseClick(int x, int y, MouseButton mouseButton){
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fileExists(filename) == true) {
|
if(fileExists(filename) == true) {
|
||||||
Lang &lang= Lang::getInstance();
|
|
||||||
|
|
||||||
// Xerces is infinitely slower than rapidxml
|
// Xerces is infinitely slower than rapidxml
|
||||||
// XmlTree xmlTree(XML_XERCES_ENGINE);
|
// XmlTree xmlTree(XML_XERCES_ENGINE);
|
||||||
XmlTree xmlTree(XML_RAPIDXML_ENGINE);
|
XmlTree xmlTree(XML_RAPIDXML_ENGINE);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user