- attempt to fix segfault on ubuntu 10.04
This commit is contained in:
parent
f3a1b7534e
commit
fe51ccee48
|
@ -189,7 +189,7 @@ MainWindow::MainWindow( std::pair<string,vector<string> > unitToLoad,
|
|||
float defaultZoom,float defaultXRot, float defaultYRot)
|
||||
: wxFrame(NULL, -1, ToUnicode(winHeader),
|
||||
wxPoint(Renderer::windowX, Renderer::windowY),
|
||||
wxSize(Renderer::windowW, Renderer::windowH)), model(NULL), glCanvas(NULL), renderer(NULL)
|
||||
wxSize(Renderer::windowW, Renderer::windowH)), model(NULL), glCanvas(NULL), renderer(NULL), initTextureManager(true)
|
||||
{
|
||||
//getGlPlatformExtensions();
|
||||
int args[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_MIN_ALPHA, 8 }; // to prevent flicker
|
||||
|
@ -1026,10 +1026,12 @@ void MainWindow::loadParticle(string path) {
|
|||
|
||||
if(path != "" && fileExists(path) == true) {
|
||||
renderer->initModelManager();
|
||||
if(initTextureManager) {
|
||||
renderer->initTextureManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SetTitle(ToUnicode(titlestring));
|
||||
}
|
||||
}
|
||||
|
@ -1127,10 +1129,12 @@ void MainWindow::loadProjectileParticle(string path) {
|
|||
|
||||
if(path != "" && fileExists(path) == true) {
|
||||
renderer->initModelManager();
|
||||
if(initTextureManager) {
|
||||
renderer->initTextureManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(std::runtime_error e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Not a Mega-Glest projectile particle XML file, or broken"), wxOK | wxICON_ERROR).ShowModal();
|
||||
|
@ -1226,10 +1230,12 @@ void MainWindow::loadSplashParticle(string path) { // uses ParticleSystemTypeSp
|
|||
|
||||
if(path != "" && fileExists(path) == true) {
|
||||
renderer->initModelManager();
|
||||
if(initTextureManager) {
|
||||
renderer->initTextureManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(std::runtime_error e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Not a Mega-Glest projectile particle XML file, or broken"), wxOK | wxICON_ERROR).ShowModal();
|
||||
|
@ -1567,7 +1573,9 @@ void MainWindow::onMenuRestart(wxCommandEvent &event) {
|
|||
loadSplashParticle(""); // as above
|
||||
|
||||
renderer->initModelManager();
|
||||
if(initTextureManager) {
|
||||
renderer->initTextureManager();
|
||||
}
|
||||
timer->Start(100);
|
||||
}
|
||||
catch(std::runtime_error e) {
|
||||
|
|
|
@ -91,6 +91,7 @@ private:
|
|||
float backBrightness, gridBrightness, lightBrightness;
|
||||
int lastX, lastY;
|
||||
Renderer::PlayerColor playerColor;
|
||||
bool initTextureManager;
|
||||
|
||||
std::vector<UnitParticleSystemType *> unitParticleSystemTypes;
|
||||
std::vector<UnitParticleSystem *> unitParticleSystems;
|
||||
|
|
Loading…
Reference in New Issue