From 30077f39771f21ab3880b3871fe541f8c721ad1a Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 18 Feb 2016 11:55:58 +0100 Subject: [PATCH 1/2] Move some stuff for easier debug --HG-- branch : develop --- code/nel/include/nel/misc/bitmap.h | 12 ++---------- code/nel/src/misc/bitmap.cpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/code/nel/include/nel/misc/bitmap.h b/code/nel/include/nel/misc/bitmap.h index 8d2bf156f..0466cd673 100644 --- a/code/nel/include/nel/misc/bitmap.h +++ b/code/nel/include/nel/misc/bitmap.h @@ -320,16 +320,8 @@ public: // don't forget to update operator=() and swap() if adding a data member - CBitmap() - { - _MipMapCount = 1; - _Width = 0; - _Height = 0; - PixelFormat = RGBA; - _LoadGrayscaleAsAlpha = true; - } - - virtual ~CBitmap() { } + CBitmap(); + virtual ~CBitmap(); // swap 2 bitmaps contents void swap(CBitmap &other); diff --git a/code/nel/src/misc/bitmap.cpp b/code/nel/src/misc/bitmap.cpp index c1249319e..798a52019 100644 --- a/code/nel/src/misc/bitmap.cpp +++ b/code/nel/src/misc/bitmap.cpp @@ -84,6 +84,20 @@ void MakeWhite(CBitmap &bitmaps) } #endif // NEL_ALL_BITMAP_WHITE +CBitmap::CBitmap() +{ + _MipMapCount = 1; + _Width = 0; + _Height = 0; + PixelFormat = RGBA; + _LoadGrayscaleAsAlpha = true; +} + +CBitmap::~CBitmap() +{ + +} + /*-------------------------------------------------------------------*\ load \*-------------------------------------------------------------------*/ From e28b6deaf90c9c87abedbe7a1c5cec2858b0a6b9 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 18 Feb 2016 11:56:44 +0100 Subject: [PATCH 2/2] Fix gl context not being deleted with custom window --HG-- branch : develop --- code/nel/src/3d/driver/opengl/driver_opengl_window.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index d2abbfd38..3595a31ba 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -1629,7 +1629,7 @@ bool CDriverGL::destroyWindow() if (_hDC) wglMakeCurrent(_hDC, NULL); - if (_DestroyWindow && _hRC) + if (_hRC) { wglDeleteContext(_hRC); _hRC = NULL; @@ -1644,7 +1644,7 @@ bool CDriverGL::destroyWindow() #elif defined(NL_OS_MAC) #elif defined(NL_OS_UNIX) - if (_DestroyWindow && _ctx) + if (_DestroyWindow && _ctx) // FIXME: _DestroyWindow may need to be removed here as well glXDestroyContext(_dpy, _ctx); _ctx = NULL;