static DWORD PASCAL lread(int fh, void far *pv, DWORD ul)
{
DWORD ulT = ul;
-#if defined(WINNT) || defined(__WIN32__) || defined(__WIN32__) || defined(__WXWINE__)
+#if defined(WINNT) || defined(__WIN32__) || defined(__WIN32__)
BYTE *hp = (BYTE *) pv;
#else
BYTE huge *hp = (BYTE huge *) pv;
static DWORD PASCAL lwrite(int fh, VOID FAR *pv, DWORD ul)
{
DWORD ulT = ul;
-#if defined(WINNT) || defined(__WIN32__) || defined(__WIN32__) || defined(__WXWINE__)
+#if defined(WINNT) || defined(__WIN32__) || defined(__WIN32__)
BYTE *hp = (BYTE *) pv;
#else
BYTE huge *hp = (BYTE huge *) pv;
****************************************************************************/
HPALETTE wxMakeDIBPalette(LPBITMAPINFOHEADER lpInfo)
{
-#ifdef __WXWINE__
- return (FALSE);
-#else
LPLOGPALETTE npPal;
RGBQUAD far *lpRGB;
HPALETTE hLogPal;
npPal = (LPLOGPALETTE)malloc(sizeof(LOGPALETTE) +
(WORD)lpInfo->biClrUsed * sizeof(PALETTEENTRY));
if (!npPal)
- return(FALSE);
+ return NULL;
npPal->palVersion = 0x300;
npPal->palNumEntries = (WORD)lpInfo->biClrUsed;
*/
else
return((HPALETTE) GetStockObject(DEFAULT_PALETTE));
-#endif
-
}
bool wxLoadIntoBitmap(wxChar *filename, wxBitmap *bitmap, wxPalette **pal)
{
- HBITMAP hBitmap;
- HPALETTE hPalette;
+ HBITMAP hBitmap = NULL;
+ HPALETTE hPalette = NULL;
bool success = (wxReadDIB(filename, &hBitmap, &hPalette) != 0);
if (!success)
{
- DeleteObject(hPalette);
+ if (hPalette)
+ DeleteObject(hPalette);
return FALSE;
}
if (hPalette)
{
+#if wxUSE_PALETTE
if (pal)
{
*pal = new wxPalette;
(*pal)->SetHPALETTE((WXHPALETTE) hPalette);
}
else
+#endif // wxUSE_PALETTE
DeleteObject(hPalette);
}
else if (pal)
bool wxSaveBitmap(wxChar *filename, wxBitmap *bitmap, wxPalette *colourmap)
{
HPALETTE hPalette = 0;
+#if wxUSE_PALETTE
if (colourmap)
hPalette = (HPALETTE) colourmap->GetHPALETTE();
+#endif // wxUSE_PALETTE
HANDLE dibHandle = wxBitmapToDIB((HBITMAP) bitmap->GetHBITMAP(), hPalette);
if (dibHandle)