display/source/CursesDisplay.cpp
// Turn on colour using attron.
//
// Note that the enable/disable colour need to match!  Don't pass different colours!
Turn on colour using attron.
Note that the enable/disable colour need to match.  Don't pass different colours!
Turn on colour using attron . Note that the enable / disable colour need to match . Don ' t pass different colours!
void CursesDisplay::enable_colour(const int selected_colour, WINDOW* window)
{
  if (uses_colour())
  {
    set_colour(selected_colour, window);
  }
  else
  {
    if (mono_colour == Colour::COLOUR_UNDEFINED)
    {
      auto m_it = display_properties.find(DisplaySettings::DISPLAY_SETTING_MONOCHROME_COLOUR);
      if (m_it != display_properties.end())
      {
        int mono_i = String::to_int(m_it->second);
        mono_colour = static_cast<Colour>(mono_i);
      }
    }
    set_colour(static_cast<int>(mono_colour), window);
  }
}
void CursesDisplay :: enable_colour ( const int selected_colour , WINDOW * window ) { if ( uses_colour ( ) ) { set_colour ( selected_colour , window ) ; } else { if ( mono_colour == Colour :: COLOUR_UNDEFINED ) { auto m_it = display_properties . find ( DisplaySettings :: DISPLAY_SETTING_MONOCHROME_COLOUR ) ; if ( m_it != display_properties . end ( ) ) { int mono_i = String :: to_int ( m_it -> second ) ; mono_colour = static_cast < Colour > ( mono_i ) ; } } set_colour ( static_cast < int > ( mono_colour ) , window ) ; } }
Turn on colour using attron.
Turn on colour using attron .
// Do we need to set the "monochrome" display to a particular colour? // Dark red, like my thirteen-year-old-self's old QBASIC games? // Bright green, like an old Apple ][? // Set up the monochrome colour on initial use from the properties // set by the game.