Mercurial > fife-parpg
diff engine/core/video/renderbackend.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 | 0c6fe081ca86 |
children | 356634098bd9 |
line wrap: on
line diff
--- a/engine/core/video/renderbackend.cpp Fri Feb 12 22:00:58 2010 +0000 +++ b/engine/core/video/renderbackend.cpp Sat Feb 20 19:11:01 2010 +0000 @@ -34,8 +34,12 @@ const unsigned int DEFAULT_CHUNKING_SIZE = 256; const unsigned int MAX_CHUNKING_SIZE = 262144; // pixels! - RenderBackend::RenderBackend(): - m_screen(NULL), m_isalphaoptimized(false), m_chunkingsize(DEFAULT_CHUNKING_SIZE) { + RenderBackend::RenderBackend(const SDL_Color& colorkey): + m_screen(NULL), + m_isalphaoptimized(false), + m_chunkingsize(DEFAULT_CHUNKING_SIZE), + m_iscolorkeyenabled(false), + m_colorkey(colorkey) { } @@ -122,4 +126,20 @@ unsigned int RenderBackend::getChunkingSize() { return m_chunkingsize; } + + void RenderBackend::setColorKeyEnabled(bool colorkeyenable) { + m_iscolorkeyenabled = colorkeyenable; + } + + bool RenderBackend::isColorKeyEnabled() const { + return m_iscolorkeyenabled; + } + + void RenderBackend::setColorKey(const SDL_Color& colorkey) { + m_colorkey = colorkey; + } + + const SDL_Color& RenderBackend::getColorKey() const { + return m_colorkey; + } }