Ok, this workaround fixes all of my problems with this dll and call's of ::DecompressImageIndirect( &dii; );
1. create a new method prototype
after line 52 at image.h
LoadImageSH calls SHLoadImageFile and don't needs separate memory mapping or decompress.
2. implement the new method at image.cpp
after line 240:
3. add pragma comment to image.cpp for new bindings
after line 24:
4. don't call
better call
5. recompile PocketFrog AND replace the lib's...
this works fine for me...[/code]
1. create a new method prototype
after line 52 at image.h
- Code:
// Load an image from a file
Surface* LoadImage( const TCHAR* filename );
// new code!
// Load an image from a file
Surface* LoadImageSH( const TCHAR* filename );[/b]
LoadImageSH calls SHLoadImageFile and don't needs separate memory mapping or decompress.
2. implement the new method at image.cpp
after line 240:
- Code:
Surface* LoadImage( const TCHAR* filename )
{
Internal::MemoryFile file( filename );
if (!file.IsOpen())
return 0;
return DecompressImage( file.begin(), file.end() );
}
// new code!
Surface* LoadImageSH( const TCHAR* filename )
{
Surface* pSurface = NULL;
HBITMAP hBitmap = SHLoadImageFile( filename );
if( NULL != hBitmap )
{
pSurface = CreateSurface( hBitmap );
DeleteObject( hBitmap );
}
return pSurface;
}
3. add pragma comment to image.cpp for new bindings
after line 24:
- Code:
#ifdef _WIN32_WCE
#include "foreign/imgdecmp/imgdecmp.h"
#pragma comment( lib, "imgdecmp.lib" )
// new code
#pragma comment( lib, "Aygshell.lib" ) //new lib!
#else
4. don't call
- Code:
Surface* pSurface = LoadImage( pDisplay, _T( "\\Program Files\\...\\gfx.png" ) );
// or
Surface* pSurface = LoadImage( _T( "\\Program Files\\...\\gfx.png" ) );
better call
- Code:
Surface* pSurface = LoadImageSH( _T( "\\Program Files\\...\\gfx.png" ) );
5. recompile PocketFrog AND replace the lib's...
this works fine for me...[/code]