Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalak committed Jan 4, 2025
1 parent 4cf86ba commit 90bb5d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
8 changes: 5 additions & 3 deletions source/3_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


#include "ui_win.hpp"
#include <windowsx.h>
//#include <windowsx.h>

// --------------------------------------------------------------------------
// ----- UIW_IMAGE ----------------------------------------------------------
Expand Down Expand Up @@ -203,7 +203,7 @@ int UIW_IMAGE::LoadImageFromFile(void)
// Load the bitmap.
ZIL_UINT32 dibSize = bitmapFileHeader.bfSize - sizeof(BITMAPFILEHEADER);
ZIL_UINT32 tdibSize = dibSize;
ZIL_UINT8 *dib = (ZIL_UINT8 *)GlobalAllocPtr(GMEM_MOVEABLE, dibSize);
ZIL_UINT8 *dib = (ZIL_UINT8 *)GlobalLock(GlobalAlloc(GMEM_MOVEABLE, dibSize));
ZIL_UINT8 *tdib = dib;
for ( ; dibSize; dibSize -= tdibSize, tdib += tdibSize)
{
Expand All @@ -222,7 +222,9 @@ int UIW_IMAGE::LoadImageFromFile(void)
ReleaseDC(NULL, hDC);

// Clean up.
GlobalFreePtr(dib);
GlobalUnlock( (HGLOBAL)GlobalHandle( dib ) );
GlobalFree( (HGLOBAL)GlobalHandle( dib ) );

delete bitmapInfo;
woStatus &= ~WOS_READ_ERROR;
return (image ? TRUE : FALSE);
Expand Down
8 changes: 5 additions & 3 deletions source/9_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


#include "ui_win.hpp"
#include <windowsx.h>
//#include <windowsx.h>

// --------------------------------------------------------------------------
// ----- UIW_IMAGE ----------------------------------------------------------
Expand Down Expand Up @@ -202,7 +202,7 @@ int UIW_IMAGE::LoadImageFromFile(void)
// Load the bitmap.
ZIL_UINT32 dibSize = bitmapFileHeader.bfSize - sizeof(BITMAPFILEHEADER);
ZIL_UINT32 tdibSize = dibSize;
ZIL_UINT8 *dib = (ZIL_UINT8 *)GlobalAllocPtr(GMEM_MOVEABLE, dibSize);
ZIL_UINT8 *dib = (ZIL_UINT8 *)GlobalLock(GlobalAlloc(GMEM_MOVEABLE, dibSize));
ZIL_UINT8 *tdib = dib;
for ( ; dibSize; dibSize -= tdibSize, tdib += tdibSize)
{
Expand All @@ -221,7 +221,9 @@ int UIW_IMAGE::LoadImageFromFile(void)
ReleaseDC(NULL, hDC);

// Clean up.
GlobalFreePtr(dib);
GlobalUnlock( (HGLOBAL)GlobalHandle( dib ) );
GlobalFree( (HGLOBAL)GlobalHandle( dib ) );

delete bitmapInfo;
woStatus &= ~WOS_READ_ERROR;
return (image ? TRUE : FALSE);
Expand Down
8 changes: 1 addition & 7 deletions source/w_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
// Zinc Software Incorporated. Pleasant Grove, Utah USA

#include "ui_win.hpp"
#include <windowsx.h>

#if defined(__WATCOMC__)
#undef GlobalFreePtr
#define GlobalFreePtr(lp) (GlobalUnlockPtr(lp), (BOOL)GlobalFree(GlobalPtrHandle(lp)))
#endif

// --------------------------------------------------------------------------
// ----- UIW_IMAGE ----------------------------------------------------------
Expand Down Expand Up @@ -195,7 +189,7 @@ int UIW_IMAGE::LoadImageFromFile(void)
// Load the bitmap.
ZIL_UINT32 dibSize = bitmapFileHeader.bfSize - sizeof(BITMAPFILEHEADER);
ZIL_UINT32 tdibSize = dibSize;
ZIL_UINT8 huge *dib = (ZIL_UINT8 huge *)GlobalAllocPtr(GMEM_MOVEABLE, dibSize);
ZIL_UINT8 huge *dib = (ZIL_UINT8 huge *)GlobalLock(GlobalAlloc(GMEM_MOVEABLE, dibSize));
ZIL_UINT8 huge *tdib = dib;
for ( ; dibSize; dibSize -= tdibSize, tdib += tdibSize)
{
Expand Down

0 comments on commit 90bb5d3

Please sign in to comment.