mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-04-30 17:11:40 -04:00
resolved custom palette remap issue .
This commit is contained in:
parent
9311007a17
commit
6d7c240f13
3 changed files with 6 additions and 6 deletions
|
@ -1547,14 +1547,14 @@ void CLoading::LoadBuilding(const CString& ID)
|
|||
if (bibImageName.GetLength()) {
|
||||
LoadSingleFrameShape(art.GetStringOr(bibImageName, "Image", bibImageName));
|
||||
}
|
||||
|
||||
bool paletteRemappable = true;
|
||||
CString PaletteName = art.GetStringOr(ArtID, "Palette", "unit");
|
||||
if (art.GetBool(ArtID, "TerrainPalette")) {
|
||||
PaletteName = "iso";
|
||||
paletteRemappable = false;
|
||||
}
|
||||
GetFullPaletteName(PaletteName, cur_theat);
|
||||
|
||||
CString DictName;
|
||||
|
||||
unsigned char* pBuffer;
|
||||
int width, height;
|
||||
|
@ -1564,7 +1564,7 @@ void CLoading::LoadBuilding(const CString& ID)
|
|||
if (!rules.GetBool(ID, "Turret")) {
|
||||
CString DictName;
|
||||
DictName.Format("%s%d", ID.operator LPCSTR(), 0);
|
||||
SetImageData(pBuffer, DictName, width, height, m_palettes.LoadPalette(PaletteName));
|
||||
SetImageData(pBuffer, DictName, width, height, m_palettes.LoadPalette(PaletteName, paletteRemappable));
|
||||
return;
|
||||
}
|
||||
// Has turret
|
||||
|
|
|
@ -294,7 +294,7 @@ void Palettes::CreateConvTable(RGBTRIPLE* pal, int* iPal)
|
|||
}
|
||||
|
||||
|
||||
Palette* Palettes::LoadPalette(const CString& palName)
|
||||
Palette* Palettes::LoadPalette(const CString& palName, bool remappable)
|
||||
{
|
||||
if (LoadedPalettes.size() == 0) {
|
||||
Palettes::Init();
|
||||
|
@ -309,7 +309,7 @@ Palette* Palettes::LoadPalette(const CString& palName)
|
|||
HMIXFILE mixIdx = loading.FindFileInMix(palName);
|
||||
|
||||
if (FSunPackLib::LoadTSPalette(reinterpret_cast<RGBTRIPLE*>(buffer.Data), palName, mixIdx)) {
|
||||
auto pal = new Palette(buffer);
|
||||
auto pal = new Palette(buffer, remappable);
|
||||
LoadedPalettes[palName] = pal;
|
||||
return pal;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
void FetchPalettes();
|
||||
void CreateConvTable(RGBTRIPLE* pal, int* iPal);
|
||||
|
||||
Palette* LoadPalette(const CString& palName);
|
||||
Palette* LoadPalette(const CString& palName, bool remappable = false);
|
||||
void Clear();
|
||||
|
||||
HTSPALETTE m_hPalIsoTemp;
|
||||
|
|
Loading…
Add table
Reference in a new issue