mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-07-20 05:04:51 -04:00
Introduced voxel render lib written by Thomas Sneddon .
This commit is contained in:
parent
5648034cc5
commit
38ddc52d28
16 changed files with 329 additions and 215 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue