- 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)
|
float defaultZoom,float defaultXRot, float defaultYRot)
|
||||||
: wxFrame(NULL, -1, ToUnicode(winHeader),
|
: wxFrame(NULL, -1, ToUnicode(winHeader),
|
||||||
wxPoint(Renderer::windowX, Renderer::windowY),
|
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();
|
//getGlPlatformExtensions();
|
||||||
int args[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_MIN_ALPHA, 8 }; // to prevent flicker
|
int args[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_MIN_ALPHA, 8 }; // to prevent flicker
|
||||||
|
@ -1026,7 +1026,9 @@ void MainWindow::loadParticle(string path) {
|
||||||
|
|
||||||
if(path != "" && fileExists(path) == true) {
|
if(path != "" && fileExists(path) == true) {
|
||||||
renderer->initModelManager();
|
renderer->initModelManager();
|
||||||
renderer->initTextureManager();
|
if(initTextureManager) {
|
||||||
|
renderer->initTextureManager();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1127,7 +1129,9 @@ void MainWindow::loadProjectileParticle(string path) {
|
||||||
|
|
||||||
if(path != "" && fileExists(path) == true) {
|
if(path != "" && fileExists(path) == true) {
|
||||||
renderer->initModelManager();
|
renderer->initModelManager();
|
||||||
renderer->initTextureManager();
|
if(initTextureManager) {
|
||||||
|
renderer->initTextureManager();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1226,7 +1230,9 @@ void MainWindow::loadSplashParticle(string path) { // uses ParticleSystemTypeSp
|
||||||
|
|
||||||
if(path != "" && fileExists(path) == true) {
|
if(path != "" && fileExists(path) == true) {
|
||||||
renderer->initModelManager();
|
renderer->initModelManager();
|
||||||
renderer->initTextureManager();
|
if(initTextureManager) {
|
||||||
|
renderer->initTextureManager();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1567,7 +1573,9 @@ void MainWindow::onMenuRestart(wxCommandEvent &event) {
|
||||||
loadSplashParticle(""); // as above
|
loadSplashParticle(""); // as above
|
||||||
|
|
||||||
renderer->initModelManager();
|
renderer->initModelManager();
|
||||||
renderer->initTextureManager();
|
if(initTextureManager) {
|
||||||
|
renderer->initTextureManager();
|
||||||
|
}
|
||||||
timer->Start(100);
|
timer->Start(100);
|
||||||
}
|
}
|
||||||
catch(std::runtime_error e) {
|
catch(std::runtime_error e) {
|
||||||
|
|
|
@ -91,6 +91,7 @@ private:
|
||||||
float backBrightness, gridBrightness, lightBrightness;
|
float backBrightness, gridBrightness, lightBrightness;
|
||||||
int lastX, lastY;
|
int lastX, lastY;
|
||||||
Renderer::PlayerColor playerColor;
|
Renderer::PlayerColor playerColor;
|
||||||
|
bool initTextureManager;
|
||||||
|
|
||||||
std::vector<UnitParticleSystemType *> unitParticleSystemTypes;
|
std::vector<UnitParticleSystemType *> unitParticleSystemTypes;
|
||||||
std::vector<UnitParticleSystem *> unitParticleSystems;
|
std::vector<UnitParticleSystem *> unitParticleSystems;
|
||||||
|
|
Loading…
Reference in New Issue