Author: apo-guest
Date: 2014-12-01 19:11:36 +0000 (Mon, 01 Dec 2014)
New Revision: 15354

Added:
   packages/trunk/megaglest/debian/patches/wxWidgets-assertions.patch
Modified:
   packages/trunk/megaglest/debian/changelog
   packages/trunk/megaglest/debian/control
   packages/trunk/megaglest/debian/patches/series
   packages/trunk/megaglest/debian/rules
Log:
Debian release 3.9.1-2

Fix wxWidgets assertions #768572


Modified: packages/trunk/megaglest/debian/changelog
===================================================================
--- packages/trunk/megaglest/debian/changelog   2014-12-01 12:37:12 UTC (rev 
15353)
+++ packages/trunk/megaglest/debian/changelog   2014-12-01 19:11:36 UTC (rev 
15354)
@@ -1,3 +1,15 @@
+megaglest (3.9.1-2) unstable; urgency=medium
+
+  * Add wxWidgets-assertions.patch.
+    Fix megaglest_editor and megaglest_g3dviewer assertions with newer versions
+    of wxWidgets that made the tools unusable. (Closes: #768572)
+    Cherry-picked from upstream master branch. Commits c21317a5f, ad0b65272,
+    6faa3dc72. Thanks to Mark Vejvoda for the patch.
+  * debian/rules: Export DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG and disable
+    wxWidgets assertions.
+
+ -- Markus Koschany <[email protected]>  Mon, 01 Dec 2014 19:19:07 +0100
+
 megaglest (3.9.1-1) unstable; urgency=low
 
   [ Mark Vejvoda ]

Modified: packages/trunk/megaglest/debian/control
===================================================================
--- packages/trunk/megaglest/debian/control     2014-12-01 12:37:12 UTC (rev 
15353)
+++ packages/trunk/megaglest/debian/control     2014-12-01 19:11:36 UTC (rev 
15354)
@@ -41,7 +41,6 @@
  famfamfam-flag-png,
  fonts-liberation,
  fonts-uralic,
- fonts-linuxlibertine,
  megaglest-data (<= ${source:Version}),
  megaglest-data (>= ${source:Upstream-Version}),
  p7zip-full,

Modified: packages/trunk/megaglest/debian/patches/series
===================================================================
--- packages/trunk/megaglest/debian/patches/series      2014-12-01 12:37:12 UTC 
(rev 15353)
+++ packages/trunk/megaglest/debian/patches/series      2014-12-01 19:11:36 UTC 
(rev 15354)
@@ -1 +1,2 @@
 fix-cmake-build-type-none.patch
+wxWidgets-assertions.patch

Added: packages/trunk/megaglest/debian/patches/wxWidgets-assertions.patch
===================================================================
--- packages/trunk/megaglest/debian/patches/wxWidgets-assertions.patch          
                (rev 0)
+++ packages/trunk/megaglest/debian/patches/wxWidgets-assertions.patch  
2014-12-01 19:11:36 UTC (rev 15354)
@@ -0,0 +1,168 @@
+From: Markus Koschany <[email protected]>
+Date: Mon, 1 Dec 2014 19:12:28 +0100
+Subject: wxWidgets assertions
+
+Fix wxWidgets assertions in megaglest_editor and megaglest_g3dviewer.
+
+Bug: https://bugs.debian.org/768572
+Forwarded: not-needed already fixed
+---
+ source/g3d_viewer/main.cpp                   | 23 +++++++++++++++--------
+ source/g3d_viewer/main.h                     |  1 +
+ source/glest_map_editor/main.cpp             | 20 +++++++++++++++-----
+ source/shared_lib/sources/graphics/model.cpp |  2 +-
+ 4 files changed, 32 insertions(+), 14 deletions(-)
+
+diff --git a/source/g3d_viewer/main.cpp b/source/g3d_viewer/main.cpp
+index 1276f73..a6cdb4a 100644
+--- a/source/g3d_viewer/main.cpp
++++ b/source/g3d_viewer/main.cpp
+@@ -480,12 +480,15 @@ void MainWindow::setupTimer() {
+ }
+ 
+ void MainWindow::setupStartupSettings() {
+-       GLuint err = glewInit();
+-       if (GLEW_OK != err) {
++
++      glCanvas->setCurrentGLContext();
++
++      GLuint err = glewInit();
++      if (GLEW_OK != err) {
+               fprintf(stderr, "Error [main]: glewInit failed: %s\n", 
glewGetErrorString(err));
+               //return 1;
+               throw std::runtime_error((char *)glewGetErrorString(err));
+-       }
++      }
+ 
+       renderer= Renderer::getInstance();
+ 
+@@ -567,7 +570,7 @@ MainWindow::~MainWindow(){
+ void MainWindow::init() {
+ 
+ #if wxCHECK_VERSION(2, 9, 3)
+-      glCanvas->setCurrentGLContext();
++      //glCanvas->setCurrentGLContext();
+       //printf("setcurrent #1\n");
+ #elif wxCHECK_VERSION(2, 9, 1)
+ 
+@@ -585,7 +588,9 @@ void MainWindow::init() {
+ void MainWindow::onPaint(wxPaintEvent &event) {
+       if(!IsShown()) return;
+       
+-#if wxCHECK_VERSION(2, 9, 3)
++#if wxCHECK_VERSION(2, 9, 4)
++      //glCanvas->setCurrentGLContext();
++#elif wxCHECK_VERSION(2, 9, 3)
+ 
+ #elif wxCHECK_VERSION(2, 9, 1)
+       glCanvas->setCurrentGLContext();
+@@ -756,8 +761,8 @@ void MainWindow::onClose(wxCloseEvent &event){
+       delete timer;
+       timer = NULL;
+ 
+-      delete model;
+-      model = NULL;
++      //delete model;
++      //model = NULL;
+ 
+       delete renderer;
+       renderer = NULL;
+@@ -2027,7 +2032,7 @@ GlCanvas::GlCanvas(MainWindow *  mainWindow, int *args)
+ }
+ 
+ GlCanvas::~GlCanvas() {
+-      delete this->context;
++      if(this->context) delete this->context;
+       this->context = NULL;
+ }
+ 
+@@ -2037,11 +2042,13 @@ void GlCanvas::setCurrentGLContext() {
+ #if wxCHECK_VERSION(2, 9, 1)
+       if(this->context == NULL) {
+               this->context = new wxGLContext(this);
++              //printf("Set ctx [%p]\n",this->context);
+       }
+ #endif
+       //printf("Set ctx [%p]\n",this->context);
+       if(this->context) {
+               wxGLCanvas::SetCurrent(*this->context);
++              //printf("Set ctx2 [%p]\n",this->context);
+       }
+ #else
+       this->SetCurrent();
+diff --git a/source/g3d_viewer/main.h b/source/g3d_viewer/main.h
+index d22020d..e8142b8 100644
+--- a/source/g3d_viewer/main.h
++++ b/source/g3d_viewer/main.h
+@@ -201,6 +201,7 @@ public:
+       void onKeyDown(wxKeyEvent &event);
+       void setCurrentGLContext();
+ 
++      wxGLContext * getCtx() { return context; }
+ private:
+       MainWindow *mainWindow;
+       wxGLContext *context;
+diff --git a/source/glest_map_editor/main.cpp 
b/source/glest_map_editor/main.cpp
+index 9b2dc57..e9c9b7c 100644
+--- a/source/glest_map_editor/main.cpp
++++ b/source/glest_map_editor/main.cpp
+@@ -138,12 +138,12 @@ END_EVENT_TABLE()
+ 
+ void MainWindow::init(string fname) {
+ #if wxCHECK_VERSION(2, 9, 3)
+-      glCanvas->setCurrentGLContext();
++      //glCanvas->setCurrentGLContext();
+       //printf("setcurrent #1\n");
+ #elif wxCHECK_VERSION(2, 9, 1)
+ 
+ #else
+-      glCanvas->SetCurrent();
++      //glCanvas->SetCurrent();
+       //printf("setcurrent #2\n");
+ #endif
+ 
+@@ -638,11 +638,17 @@ void MainWindow::onPaint(wxPaintEvent &event) {
+               return;
+       }
+ 
+-#if wxCHECK_VERSION(2, 9, 3)
++//#if wxCHECK_VERSION(2, 9, 3)
+ 
+-#elif wxCHECK_VERSION(2, 9, 1)
++//#elif wxCHECK_VERSION(2, 9, 1)
++//    glCanvas->setCurrentGLContext();
++//#endif
++
++      //static bool contextSet = false;
++      //if(contextSet == false) {
++      //      contextSet = true;
+       glCanvas->setCurrentGLContext();
+-#endif
++      //}
+ 
+       if(lastPaintEvent.getMillis() < 30) {
+               sleep(1);
+@@ -1579,6 +1585,10 @@ bool App::OnInit() {
+       SystemFlags::VERBOSE_MODE_ENABLED  = false;
+       SystemFlags::ENABLE_THREADED_LOGGING = false;
+ 
++#if defined(wxMAJOR_VERSION) && defined(wxMINOR_VERSION) && 
defined(wxRELEASE_NUMBER) && defined(wxSUBRELEASE_NUMBER)
++      printf("Using wxWidgets version 
[%d.%d.%d.%d]\n",wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxSUBRELEASE_NUMBER);
++#endif
++
+       string fileparam;
+       if(argc==2){
+               if(argv[1][0]=='-') {   // any flag gives help and exits 
program.
+diff --git a/source/shared_lib/sources/graphics/model.cpp 
b/source/shared_lib/sources/graphics/model.cpp
+index e3bf3cf..84becdb 100644
+--- a/source/shared_lib/sources/graphics/model.cpp
++++ b/source/shared_lib/sources/graphics/model.cpp
+@@ -1099,7 +1099,7 @@ Model::Model() {
+ }
+ 
+ Model::~Model() {
+-      delete [] meshes;
++      if(meshes) delete [] meshes;
+       meshes = NULL;
+ }
+ 

Modified: packages/trunk/megaglest/debian/rules
===================================================================
--- packages/trunk/megaglest/debian/rules       2014-12-01 12:37:12 UTC (rev 
15353)
+++ packages/trunk/megaglest/debian/rules       2014-12-01 19:11:36 UTC (rev 
15354)
@@ -1,5 +1,7 @@
 #!/usr/bin/make -f
 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+# Disable wxWidgets assertions
+export DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG
 
 %:
        dh $@ --parallel


_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to