Introduced voxel render lib written by Thomas Sneddon .

This commit is contained in:
Zero Fanker 2024-05-20 23:27:42 -04:00
parent 5648034cc5
commit 38ddc52d28
16 changed files with 329 additions and 215 deletions

View file

@ -349,6 +349,35 @@ namespace FSunPackLib
return pDDS->SetColorKey(DDCKEY_SRCBLT, &color_key);
}
std::pair<MemoryBuffer, bool> LoadCCFile(LPCTSTR filepath, HMIXFILE hMix)
{
MemoryBuffer buffer;
Ccc_file file(true);
if (hMix != NULL) {
if (file.open(filepath, mixfiles[hMix - 1])) {
return {};
}
} else {
if (file.open(filepath)) {
return {};
}
}
auto const size = file.get_size();
if (size < 0) {
return {};
}
buffer.resize(size);
if (file.read(buffer.data(), size)) {
return {};
}
return { std::move(buffer), true };
}
BOOL XCC_Initialize(BOOL bLoadFromRegistry)
{
if (bLoadFromRegistry)

View file

@ -45,6 +45,8 @@ class VoxelNormalTables;
typedef DWORD HMIXFILE;
typedef DWORD HTSPALETTE;
using MemoryBuffer = std::vector<char>;
struct SHPHEADER
{
__int16 zero;// type
@ -249,6 +251,7 @@ namespace FSunPackLib
HRESULT SetColorKey(IDirectDrawSurface4* pDDS, COLORREF rgb);
std::pair<MemoryBuffer, bool> LoadCCFile(LPCTSTR name, HMIXFILE hMix);
};
#endif