Mercurial > fife-parpg
comparison 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 |
comparison
equal
deleted
inserted
replaced
424:e29fbf84cb41 | 425:ad7969d9460b |
---|---|
32 namespace FIFE { | 32 namespace FIFE { |
33 | 33 |
34 const unsigned int DEFAULT_CHUNKING_SIZE = 256; | 34 const unsigned int DEFAULT_CHUNKING_SIZE = 256; |
35 const unsigned int MAX_CHUNKING_SIZE = 262144; // pixels! | 35 const unsigned int MAX_CHUNKING_SIZE = 262144; // pixels! |
36 | 36 |
37 RenderBackend::RenderBackend(): | 37 RenderBackend::RenderBackend(const SDL_Color& colorkey): |
38 m_screen(NULL), m_isalphaoptimized(false), m_chunkingsize(DEFAULT_CHUNKING_SIZE) { | 38 m_screen(NULL), |
39 m_isalphaoptimized(false), | |
40 m_chunkingsize(DEFAULT_CHUNKING_SIZE), | |
41 m_iscolorkeyenabled(false), | |
42 m_colorkey(colorkey) { | |
39 } | 43 } |
40 | 44 |
41 | 45 |
42 RenderBackend::~RenderBackend() { | 46 RenderBackend::~RenderBackend() { |
43 } | 47 } |
120 } | 124 } |
121 | 125 |
122 unsigned int RenderBackend::getChunkingSize() { | 126 unsigned int RenderBackend::getChunkingSize() { |
123 return m_chunkingsize; | 127 return m_chunkingsize; |
124 } | 128 } |
129 | |
130 void RenderBackend::setColorKeyEnabled(bool colorkeyenable) { | |
131 m_iscolorkeyenabled = colorkeyenable; | |
132 } | |
133 | |
134 bool RenderBackend::isColorKeyEnabled() const { | |
135 return m_iscolorkeyenabled; | |
136 } | |
137 | |
138 void RenderBackend::setColorKey(const SDL_Color& colorkey) { | |
139 m_colorkey = colorkey; | |
140 } | |
141 | |
142 const SDL_Color& RenderBackend::getColorKey() const { | |
143 return m_colorkey; | |
144 } | |
125 } | 145 } |