Fix: DSurface lost (#109)

Switching screen mode (from or to full screen) with FA2 open and loaded with map, when you get back, the program haulted and killed immediately. This PR fix the device lost issue, and get the right surface .
This commit is contained in:
Zero Fanker 2024-11-03 21:46:04 -05:00 committed by GitHub
parent 102f919e96
commit 98e8b7c562
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 266 additions and 226 deletions

View file

@ -1635,6 +1635,7 @@ namespace FSunPackLib
VoxelNormalTable emptyNormalTable;
#if defined(XCC_VXL_DRAW)
BOOL LoadVXLImageInSurface(const VoxelNormalTables& normalTables, Vec3f lightDirection, IDirectDraw4* pdd, int iStart, int iCount, const Vec3f rotation, const Vec3f postHVAOffset, LPDIRECTDRAWSURFACE4* pdds, HTSPALETTE hPalette, int* lpXCenter, int* lpYCenter, int ZAdjust, int* lpXCenterZMax, int* lpYCenterZMax, int i3dCenterX, int i3dCenterY)
{
if (hPalette == NULL || hPalette > dwPalCount) return NULL;
@ -1850,6 +1851,7 @@ namespace FSunPackLib
//pal.close();
return TRUE;
}
#endif
BOOL LoadVXLImage(
const VoxelNormalTables& normalTables,

View file

@ -228,7 +228,9 @@ namespace FSunPackLib
BOOL GetVXLSectionInfo(int section, VoxelNormalClass& normalClass);
#if defined(XCC_VXL_DRAW)
BOOL LoadVXLImageInSurface(const VoxelNormalTables& normalTables, Vec3f lightDirection, IDirectDraw4* pdd, int iStart, int iCount, Vec3f rotation, Vec3f modelOffset, LPDIRECTDRAWSURFACE4* pdds, HTSPALETTE hPalette, int* lpXCenter = NULL, int* lpYCenter = NULL, int ZAdjust = 0, int* lpXCenterZMax = NULL, int* lpYCenterZMax = NULL, int i3dCenterX = -1, int i3dCenterY = -1);
#endif
// modelOffset is applied before VXL/HVA translates and scales and before model-to-world rotation
BOOL LoadVXLImage(const VoxelNormalTables& normalTables,