Mercurial > fife-parpg
diff engine/core/controller/enginesettings.cpp @ 425:ad7969d9460b
A client can now specify a global color key to be used with all images. The default color key is (255,0,255) in RGB format. Also the client can enable/disable the color key feature by using the setColorKeyEnabled function in the EngineSettings class. By default the color key feature is disabled. fixes[t:451]
author | vtchill@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 20 Feb 2010 19:11:01 +0000 |
parents | 98541d3b9220 |
children | 79678719d569 |
line wrap: on
line diff
--- a/engine/core/controller/enginesettings.cpp Fri Feb 12 22:00:58 2010 +0000 +++ b/engine/core/controller/enginesettings.cpp Sat Feb 20 19:11:01 2010 +0000 @@ -50,7 +50,11 @@ m_defaultfontpath(""), m_defaultfontsize(8), m_defaultfontglyphs(""), - m_image_chunking_size(256) { + m_image_chunking_size(256), + m_iscolorkeyenabled(false) { + m_colorkey.r = 255; + m_colorkey.g = 0; + m_colorkey.b = 255; } EngineSettings::~EngineSettings() { @@ -159,6 +163,23 @@ void EngineSettings::setWindowIcon(const std::string& icon) { m_windowicon = icon; } - + + void EngineSettings::setColorKeyEnabled(bool colorkeyenable) { + m_iscolorkeyenabled = colorkeyenable; + } + + bool EngineSettings::isColorKeyEnabled() const { + return m_iscolorkeyenabled; + } + + void EngineSettings::setColorKey(Uint8 r, Uint8 g, Uint8 b) { + m_colorkey.r = r; + m_colorkey.g = g; + m_colorkey.b = b; + } + + const SDL_Color& EngineSettings::getColorKey() const { + return m_colorkey; + } }