// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "imagbmp.h"
#endif
#endif
#ifdef __WXMSW__
-#include <windows.h>
+#include "wx/msw/wrapwin.h"
#endif
//-----------------------------------------------------------------------------
#if wxUSE_STREAMS
#ifndef BI_RGB
-#define BI_RGB 0
+ #define BI_RGB 0
+#endif
+
+#ifndef BI_RLE8
#define BI_RLE8 1
+#endif
+
+#ifndef BI_RLE4
#define BI_RLE4 2
#endif
wxUint16 aWord;
// allocate space for palette if needed:
- _cmap *cmap = NULL;
+ _cmap *cmap;
if ( bpp < 16 )
{
ptr = data;
}
- int line = 0;
- int column = 0;
int linesize = ((width * bpp + 31) / 32) * 4;
/* BMPs are stored upside down */
- for ( line = (height - 1); line >= 0; line-- )
+ for ( int line = (height - 1); line >= 0; line-- )
{
int linepos = 0;
- for ( column = 0; column < width ; )
+ for ( int column = 0; column < width ; )
{
if ( bpp < 16 )
{
- int index = 0;
linepos++;
aByte = stream.GetC();
if ( bpp == 1 )
{
- int bit = 0;
- for (bit = 0; bit < 8 && column < width; bit++)
+ for (int bit = 0; bit < 8 && column < width; bit++)
{
- index = ((aByte & (0x80 >> bit)) ? 1 : 0);
+ int index = ((aByte & (0x80 >> bit)) ? 1 : 0);
ptr[poffset] = cmap[index].r;
ptr[poffset + 1] = cmap[index].g;
ptr[poffset + 2] = cmap[index].b;
}
else
{
- int nibble = 0;
- for (nibble = 0; nibble < 2 && column < width; nibble++)
+ for (int nibble = 0; nibble < 2 && column < width; nibble++)
{
- index = ((aByte & (0xF0 >> nibble * 4)) >> (!nibble * 4));
+ int index = ((aByte & (0xF0 >> nibble * 4)) >> (!nibble * 4));
if ( index >= 16 )
index = 15;
ptr[poffset] = cmap[index].r;
bool verbose)
{
- bool bResult = FALSE;
//sanity check; icon must be less than 127 pixels high and 255 wide
if ( image->GetHeight () > 127 )
{
//calculate size and offset of image and mask
wxCountingOutputStream cStream;
- bResult = SaveDib(image, cStream, verbose, IsBmp, IsMask);
+ bool bResult = SaveDib(image, cStream, verbose, IsBmp, IsMask);
if ( !bResult )
{
if ( verbose )
bool wxICOHandler::DoLoadFile(wxImage *image, wxInputStream& stream,
bool WXUNUSED(verbose), int index)
{
- bool bResult = FALSE;
- bool IsBmp = FALSE;
+ bool bResult wxDUMMY_INITIALIZE(false);
+ bool IsBmp = false;
ICONDIR IconDir;
if ( iSel == wxNOT_FOUND || iSel < 0 || iSel >= nIcons )
{
wxLogError(_("ICO: Invalid icon index."));
- bResult = FALSE;
+ bResult = false;
}
else
{