This commit is contained in:
2024-08-16 13:56:54 -04:00
parent 75df00b3e3
commit 2e364ff470
19 changed files with 211 additions and 125 deletions

View File

@@ -319,21 +319,25 @@ WORD PurePalette::identityPalette(void)
paletteData.systemPalette();
if(SYSPAL_NOSTATIC==::GetSystemPaletteUse(pureDevice))
{
Array<RGBColor> paletteColors;
Array<RGBColor> paletteColors;
RGBColor colorWhite(255,255,255);
RGBColor colorBlack(0,0,0);
getPaletteColors(paletteColors);
setPaletteColors(paletteColors,PaletteEntry::NoCollapse);
setPaletteColor(PurePalette::MaxColors-1,RGBColor(255,255,255));
setPaletteColor(0,RGBColor(0,0,0));
setPaletteColor(PurePalette::MaxColors-1,colorWhite);
setPaletteColor(0,colorBlack);
createPalette();
return TRUE;
}
if(SystemStaticColors!=(staticColors=::GetDeviceCaps(pureDevice,NUMCOLORS)))return FALSE;
staticColors/=2;
for(int paletteIndex=0;paletteIndex<staticColors;paletteIndex++)
int paletteIndex=0;
for(paletteIndex=0;paletteIndex<staticColors;paletteIndex++)
systemTree.insertItem(paletteData[paletteIndex]);
for(paletteIndex=MaxColors-staticColors;paletteIndex<MaxColors;paletteIndex++)
systemTree.insertItem(paletteData[paletteIndex]);
for(int index=0;index<staticColors;index++)paletteData[index].flags(PaletteEntry::NullFlag);
systemTree.insertItem(paletteData[paletteIndex]);
int index=0;
for(index=0;index<staticColors;index++)paletteData[index].flags(PaletteEntry::NullFlag);
while(index<MaxColors-staticColors&&useableIndex<MaxColors)
{
getPaletteColor(useableIndex,rgbColor);
@@ -373,7 +377,8 @@ WORD PurePalette::isIdentityPalette(void)const
}
if(SystemStaticColors!=(staticColors=::GetDeviceCaps(pureDevice,NUMCOLORS)))return FALSE;
staticColors/=2;
for(int paletteIndex=0;paletteIndex<staticColors;paletteIndex++)
int paletteIndex=0;
for(paletteIndex=0;paletteIndex<staticColors;paletteIndex++)
if(!(RGBColor(((PurePalette&)*this).mPaletteData[paletteIndex])==RGBColor(paletteData[paletteIndex])))return FALSE;
for(paletteIndex=paletteEntries()-staticColors;paletteIndex<paletteEntries();paletteIndex++)
if(!(RGBColor(((PurePalette&)*this).mPaletteData[paletteIndex])==RGBColor(paletteData[paletteIndex])))return FALSE;