// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
-// Copyright: (c) Microsoft, Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Copyright: (c) Microsoft, Julian Smart
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#include "wx/msw/dibutils.h"
-#ifdef __WXWINE__
- #include <module.h>
-#endif
-
#if defined(__WIN32__)
#if !defined(__MWERKS__) && !defined(__SALFORDC__)
#include <memory.h> // for _fmemcpy()
(GlobalUnlockPtr(lp), (BOOL)GlobalFree(GlobalPtrHandle(lp)))
#endif
-
-/*
- * Clear the System Palette so that we can ensure an identity palette
- * mapping for fast performance.
- */
-
-void wxClearSystemPalette(void)
-{
- //*** A dummy palette setup
- struct
- {
- WORD Version;
- WORD NumberOfEntries;
- PALETTEENTRY aEntries[256];
- } Palette =
- {
- 0x300,
- 256
- };
-
- HPALETTE ScreenPalette = 0;
- HDC ScreenDC;
- int Counter;
- UINT nMapped = 0;
- BOOL bOK = FALSE;
- int nOK = 0;
-
- // *** Reset everything in the system palette to black
- for(Counter = 0; Counter < 256; Counter++)
- {
- Palette.aEntries[Counter].peRed = 0;
- Palette.aEntries[Counter].peGreen = 0;
- Palette.aEntries[Counter].peBlue = 0;
- Palette.aEntries[Counter].peFlags = PC_NOCOLLAPSE;
- }
-
- // *** Create, select, realize, deselect, and delete the palette
-#ifdef __WXWINE__
- ScreenDC = GetDC((HWND)NULL);
-#else
- ScreenDC = GetDC(NULL);
-#endif
- ScreenPalette = CreatePalette((LOGPALETTE *)&Palette);
-
- if (ScreenPalette)
- {
- ScreenPalette = SelectPalette(ScreenDC,ScreenPalette,FALSE);
- nMapped = RealizePalette(ScreenDC);
- ScreenPalette = SelectPalette(ScreenDC,ScreenPalette,FALSE);
- bOK = DeleteObject(ScreenPalette);
- }
-
-#ifdef __WXWINE__
- nOK = ReleaseDC((HWND)NULL, ScreenDC);
-#else
- nOK = ReleaseDC(NULL, ScreenDC);
-#endif
-
- return;
-}
-
-
/*
* Open a DIB file and return a MEMORY DIB, a memory handle containing..
*
fh = OpenFile(wxConvFile.cWX2MB(szFile), &of, OF_WRITE | OF_CREATE);
if (!fh) {
-// printf("la regamos0");
- return 0;
+ return 0;
}
long size = wxDibSize(lpbi);
LPVOID p;
OFSTRUCT of;
-#if defined(WIN32) || defined(_WIN32)
+#if defined(__WIN32__)
#define GetCurrentInstance() GetModuleHandle(NULL)
#else
#define GetCurrentInstance() (HINSTANCE)SELECTOROF((LPVOID)&of)
off = _llseek(fh,0L,SEEK_CUR);
if (sizeof(bf) != _lread(fh,(LPSTR)&bf,sizeof(bf)))
- return FALSE;
+ return NULL;
/*
* do we have a RC HEADER?
}
if (sizeof(bi) != _lread(fh,(LPSTR)&bi,sizeof(bi)))
- return FALSE;
+ return NULL;
/*
* what type of bitmap info is this?
bi.biSize = sizeof(BITMAPINFOHEADER);
bi.biWidth = (DWORD)bc.bcWidth;
bi.biHeight = (DWORD)bc.bcHeight;
- bi.biPlanes = (UINT)bc.bcPlanes;
- bi.biBitCount = (UINT)bc.bcBitCount;
+ bi.biPlanes = (WORD)bc.bcPlanes;
+ bi.biBitCount = (WORD)bc.bcBitCount;
bi.biCompression = BI_RGB;
bi.biSizeImage = 0;
bi.biXPelsPerMeter = 0;
#define RLE_EOF 1
#define RLE_JMP 2
-static void xlatRle8(BYTE FAR *pb, DWORD dwSize, BYTE FAR *xlat)
+static void xlatRle8(BYTE FAR *pb, DWORD WXUNUSED(dwSize), BYTE FAR *xlat)
{
BYTE cnt;
BYTE b;
}
}
-static void xlatRle4(BYTE FAR *pb, DWORD dwSize, BYTE FAR *xlat)
+static void xlatRle4(BYTE FAR *WXUNUSED(pb), DWORD WXUNUSED(dwSize), BYTE FAR *WXUNUSED(xlat))
{
}
HPALETTE hPalette;
const RGBQUAD FAR* rgb = Info->bmiColors;
- WORD nColors = Info->bmiHeader.biClrUsed;
+ WORD nColors = (WORD)Info->bmiHeader.biClrUsed;
if (nColors) {
LOGPALETTE* logPal = (LOGPALETTE*)
new BYTE[sizeof(LOGPALETTE) + (nColors-1)*sizeof(PALETTEENTRY)];