Strict use of fc::colornames in FOptiAttr

This commit is contained in:
Markus Gans 2018-04-15 20:48:25 +02:00
parent bbacc369ec
commit 73ba1bc219
6 changed files with 14 additions and 25 deletions

View File

@ -194,13 +194,6 @@ class FOptiAttr
all_tests = 0x1f
};
enum default_color
{
Default = -1,
Black = 0,
LightGray = 7
};
enum attr_modes
{
standout_mode = 1,

View File

@ -1333,7 +1333,6 @@ void FListBox::recalculateHorizontalBar (int len, bool has_brackets)
if ( ! hbar->isVisible() )
hbar->setVisible();
}
}
//----------------------------------------------------------------------

View File

@ -1626,7 +1626,6 @@ inline void FMenu::keyRight (FKeyEvent* ev)
}
else
keypressMenuBar(ev); // select next menu
}
//----------------------------------------------------------------------

View File

@ -1067,8 +1067,8 @@ bool FOptiAttr::setTermDefaultColor (char_data*& term)
if ( ! term )
return false;
term->fg_color = Default;
term->bg_color = Default;
term->fg_color = fc::Default;
term->bg_color = fc::Default;
if ( append_sequence(F_orig_pair.cap) )
return true;
@ -1230,8 +1230,8 @@ inline void FOptiAttr::resetColor (char_data*& attr)
{
if ( attr )
{
attr->fg_color = Default;
attr->bg_color = Default;
attr->fg_color = fc::Default;
attr->bg_color = fc::Default;
}
}
@ -1400,7 +1400,7 @@ void FOptiAttr::change_color (char_data*& term, char_data*& next)
fg = next->fg_color;
bg = next->bg_color;
if ( fg == Default || bg == Default )
if ( fg == fc::Default || bg == fc::Default )
change_to_default_color (term, next, fg, bg);
if ( fake_reverse && fg < 0 && bg < 0 )
@ -1411,7 +1411,7 @@ void FOptiAttr::change_color (char_data*& term, char_data*& next)
{
std::swap (fg, bg);
if ( fg == Default || bg == Default )
if ( fg == fc::Default || bg == fc::Default )
setTermDefaultColor(term);
}
@ -1428,18 +1428,18 @@ inline void FOptiAttr::change_to_default_color ( char_data*& term
{
if ( ansi_default_color )
{
if ( fg == Default && term->fg_color != Default
&& bg == Default && term->bg_color != Default )
if ( fg == fc::Default && term->fg_color != fc::Default
&& bg == fc::Default && term->bg_color != fc::Default )
{
setTermDefaultColor(term);
}
else if ( fg == Default && term->fg_color != Default )
else if ( fg == fc::Default && term->fg_color != fc::Default )
{
char sgr_39[] = CSI "39m";
append_sequence (sgr_39);
term->fg_color = Default;
term->fg_color = fc::Default;
}
else if ( bg == Default && term->bg_color != Default )
else if ( bg == fc::Default && term->bg_color != fc::Default )
{
char* sgr_49;
char* op = F_orig_pair.cap;
@ -1450,14 +1450,14 @@ inline void FOptiAttr::change_to_default_color ( char_data*& term
sgr_49 = C_STR(CSI "49m");
append_sequence (sgr_49);
term->bg_color = Default;
term->bg_color = fc::Default;
}
}
else if ( ! setTermDefaultColor(term) )
{
// Fallback to gray on black
fg = next->fg_color = LightGray;
bg = next->bg_color = Black;
fg = next->fg_color = fc::LightGray;
bg = next->bg_color = fc::Black;
}
}

View File

@ -395,7 +395,6 @@ void FScrollView::scrollTo (int x, int y)
viewport->has_changes = true;
copy2area();
updateTerminal();
}
//----------------------------------------------------------------------

View File

@ -505,7 +505,6 @@ void FStringTest::additionTest()
const char c2 = 'a';
CPPUNIT_ASSERT ( c2 + s5 == "aabc" );
CPPUNIT_ASSERT ( c2 + FString("def") == L"adef" );
}
//----------------------------------------------------------------------