X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0ce5a3a853f2eaa7fe58e494aa0605918531ff3b..7419ba028c7e2d0e585a9b043af587d993da16a7:/src/common/imagbmp.cpp diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index b4e8208c47..9cf6d614f9 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: imagbmp.cpp +// Name: src/common/imagbmp.cpp // Purpose: wxImage BMP,ICO and CUR handlers // Author: Robert Roebling, Chris Elliott // RCS-ID: $Id$ @@ -7,30 +7,30 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "imagbmp.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif -#include "wx/defs.h" - #if wxUSE_IMAGE #include "wx/imagbmp.h" -#include "wx/bitmap.h" -#include "wx/debug.h" -#include "wx/log.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #ifdef __WXMSW__ + #include "wx/msw/wrapwin.h" + #endif + #include "wx/log.h" + #include "wx/app.h" + #include "wx/bitmap.h" + #include "wx/palette.h" + #include "wx/intl.h" +#endif + #include "wx/filefn.h" #include "wx/wfstream.h" -#include "wx/intl.h" -#include "wx/module.h" #include "wx/quantize.h" // For memcpy @@ -42,10 +42,6 @@ #endif #endif -#ifdef __WXMSW__ -#include "wx/msw/wrapwin.h" -#endif - //----------------------------------------------------------------------------- // wxBMPHandler //----------------------------------------------------------------------------- @@ -278,7 +274,7 @@ bool wxBMPHandler::SaveDib(wxImage *image, for ( int i = 0; i < palette_size; i++ ) { // if 1BPP_BW then the value should be either 0 or 255 - wxUint8 c = (i > 0) && (format == wxBMP_1BPP_BW) ? 255 : i; + wxUint8 c = (wxUint8)((i > 0) && (format == wxBMP_1BPP_BW) ? 255 : i); rgbquad[i*4] = rgbquad[i*4+1] = @@ -927,7 +923,7 @@ bool wxBMPHandler::LoadDib(wxImage *image, wxInputStream& stream, verbose, IsBmp, true) ) { if (verbose) - wxLogError( _("Error in reading image DIB .") ); + wxLogError( _("Error in reading image DIB.") ); return false; } @@ -1023,7 +1019,7 @@ bool wxICOHandler::SaveFile(wxImage *image, return false; } - int images = 1; // only generate one image + const int images = 1; // only generate one image // VS: This is a hack of sort - since ICO and CUR files are almost // identical, we have all the meat in wxICOHandler and check for @@ -1051,7 +1047,7 @@ bool wxICOHandler::SaveFile(wxImage *image, // for each iamage write a description ICONDIRENTRY: ICONDIRENTRY icondirentry; - for (int i = 0; i < images; i++) + for (int img = 0; img < images; img++) { wxImage mask;