From 6119f2c4802cccdaaff765d08a27c114a8b9256f Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sat, 5 Jul 2014 03:31:21 +0200 Subject: [PATCH] Make sure to always convert to plain bitmap. --HG-- branch : gsoc2014-dfighter --- code/studio/src/plugins/gui_editor/texture_chooser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/studio/src/plugins/gui_editor/texture_chooser.cpp b/code/studio/src/plugins/gui_editor/texture_chooser.cpp index 04328d9ef..95a081897 100644 --- a/code/studio/src/plugins/gui_editor/texture_chooser.cpp +++ b/code/studio/src/plugins/gui_editor/texture_chooser.cpp @@ -55,6 +55,11 @@ void TextureChooser::onCurrentRowChanged( int row ) NLMISC::CBitmap bm; uint8 depth = bm.load( f ); f.close(); + b = bm.convertToType( NLMISC::CBitmap::RGBA ); + if( !b ) + { + return; + } uint32 size = bm.getSize() * ( 32 / 8 ); // should be depth, but CBitmap always uses 32 bit to store the image