generally transplanted FA2sp image handling logic, but still WIP

TODO: Fix palette background issue. Fix voxel handling .
This commit is contained in:
Zero Fanker 2024-05-18 21:19:01 -04:00
parent 981059c2b4
commit 800cd951b6
17 changed files with 1058 additions and 1163 deletions

View file

@ -413,7 +413,7 @@ namespace FSunPackLib
BOOL XCC_DoesFileExist(LPCSTR szFile, HMIXFILE hOwner)
{
if (hOwner == 0)
if (hOwner == NULL)
return FALSE;
if (hOwner > dwMixFileCount)
return FALSE;
@ -1819,8 +1819,22 @@ namespace FSunPackLib
return TRUE;
}
BOOL LoadVXLImage(const VoxelNormalTables& normalTables, Vec3f lightDirection, const Vec3f rotation, const Vec3f modelOffset, std::vector<BYTE>& image, std::vector<BYTE>& lighting, int* lpXCenter, int* lpYCenter, int ZAdjust, int* lpXCenterZMax, int* lpYCenterZMax, int i3dCenterX, int i3dCenterY, RECT* vxlrect)
{
BOOL LoadVXLImage(
const VoxelNormalTables& normalTables,
Vec3f lightDirection,
const Vec3f rotation,
const Vec3f modelOffset,
OUT std::vector<BYTE>& image,
OUT std::vector<BYTE>& lighting,
OUT OPTIONAL int* lpXCenter,
OUT OPTIONAL int* lpYCenter,
int ZAdjust,
OUT OPTIONAL int* lpXCenterZMax,
OUT OPTIONAL int* lpYCenterZMax,
int i3dCenterX,
int i3dCenterY,
OUT OPTIONAL RECT* vxlrect
) {
last_succeeded_operation = 1;
int i;

View file

@ -28,6 +28,18 @@
#include <string>
#include "Vec3.h"
#ifndef IN
#define IN
#endif
#ifndef OUT
#define OUT
#endif
#ifndef OPTIONAL
#define OPTIONAL
#endif
class VoxelNormalTables;
typedef DWORD HMIXFILE;
@ -217,7 +229,20 @@ namespace FSunPackLib
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);
// modelOffset is applied before VXL/HVA translates and scales and before model-to-world rotation
BOOL LoadVXLImage(const VoxelNormalTables& normalTables, Vec3f lightDirection, Vec3f rotation, Vec3f modelOffset, std::vector<BYTE>& image, std::vector<BYTE>& lighting, int* lpXCenter = NULL, int* lpYCenter = NULL, int ZAdjust = 0, int* lpXCenterZMax = NULL, int* lpYCenterZMax = NULL, int i3dCenterX = -1, int i3dCenterY = -1, RECT* vxlrect = NULL);
BOOL LoadVXLImage(const VoxelNormalTables& normalTables,
Vec3f lightDirection,
Vec3f rotation,
Vec3f modelOffset,
OUT std::vector<BYTE>& image,
OUT std::vector<BYTE>& lighting,
OUT OPTIONAL int* lpXCenter = NULL,
OUT OPTIONAL int* lpYCenter = NULL,
int ZAdjust = 0,
OUT OPTIONAL int* lpXCenterZMax = NULL,
OUT OPTIONAL int* lpYCenterZMax = NULL,
int i3dCenterX = -1,
int i3dCenterY = -1,
OUT OPTIONAL RECT* vxlrect = NULL);
BOOL WriteMixFile(LPCTSTR lpMixFile, LPCSTR* lpFiles, DWORD dwFileCount, Game game);