disabled palette display if without console

This commit is contained in:
thrust26 2020-11-13 11:19:48 +01:00
parent 7708a9a692
commit 0532bc824a
1 changed files with 8 additions and 4 deletions

View File

@ -1156,11 +1156,12 @@ void VideoAudioDialog::addPalette(int x, int y, int w, int h)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoAudioDialog::colorPalette() void VideoAudioDialog::colorPalette()
{
if(instance().hasConsole())
{ {
constexpr int NUM_LUMA = 8; constexpr int NUM_LUMA = 8;
constexpr int NUM_CHROMA = 16; constexpr int NUM_CHROMA = 16;
if(instance().hasConsole())
{
const int order[2][NUM_CHROMA] = const int order[2][NUM_CHROMA] =
{ {
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
@ -1176,11 +1177,14 @@ void VideoAudioDialog::colorPalette()
ss << Common::Base::HEX1 << std::uppercase << color; ss << Common::Base::HEX1 << std::uppercase << color;
myColorLbl[idx]->setLabel(ss.str()); myColorLbl[idx]->setLabel(ss.str());
for(int lum = 0; lum < NUM_LUMA; ++lum) for(int lum = 0; lum < NUM_LUMA; ++lum)
{
myColor[idx][lum]->setColor(color * NUM_CHROMA + lum * 2); // skip grayscale colors myColor[idx][lum]->setColor(color * NUM_CHROMA + lum * 2); // skip grayscale colors
} }
} }
} else
// disable palette
for(int idx = 0; idx < NUM_CHROMA; ++idx)
for(int lum = 0; lum < NUM_LUMA; ++lum)
myColor[idx][lum]->setEnabled(false);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -