comparison engine/core/video/sdl/renderbackendsdl.cpp @ 579:b2feacaed53c

* Added the colorbuffer patch with a small change due to SDL. Performance boost between 20-30% under OpenGL. * Improved the most renderers with setColor() function. * Fixed the genericrenderer, is now tested whether the images are in the viewport. * Fixed the gridrenderer, the grid is now drawn only up to the viewport. * Changed the vertex functions in opengl/renderbackendopengl.cpp from vertex3f() to vertex2f(). * Improved the Editor, now you can use blocking, grid and coordinate renderer over gui or keys. Additionally, the colors can be changed with the settings.xml.
author helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 31 Jul 2010 17:46:19 +0000
parents ad1f09d954f9
children 47b49b9b0c0a
comparison
equal deleted inserted replaced
578:54d83a0462ee 579:b2feacaed53c
38 38
39 namespace FIFE { 39 namespace FIFE {
40 static Logger _log(LM_VIDEO); 40 static Logger _log(LM_VIDEO);
41 41
42 RenderBackendSDL::RenderBackendSDL(const SDL_Color& colorkey) : RenderBackend(colorkey) { 42 RenderBackendSDL::RenderBackendSDL(const SDL_Color& colorkey) : RenderBackend(colorkey) {
43 m_clear = true;
43 } 44 }
44 45
45 46
46 RenderBackendSDL::~RenderBackendSDL() { 47 RenderBackendSDL::~RenderBackendSDL() {
47 deinit(); 48 deinit();
132 133
133 Image* RenderBackendSDL::createImage(const uint8_t* data, unsigned int width, unsigned int height) { 134 Image* RenderBackendSDL::createImage(const uint8_t* data, unsigned int width, unsigned int height) {
134 return new SDLImage(data, width, height); 135 return new SDLImage(data, width, height);
135 } 136 }
136 137
138 void RenderBackendSDL::isClearNeeded(bool clear) {
139 m_clear = clear;
140 }
141
137 bool RenderBackendSDL::putPixel(int x, int y, int r, int g, int b) { 142 bool RenderBackendSDL::putPixel(int x, int y, int r, int g, int b) {
138 return static_cast<SDLImage*>(m_screen)->putPixel(x, y, r, g, b); 143 return static_cast<SDLImage*>(m_screen)->putPixel(x, y, r, g, b);
139 } 144 }
140 145
141 void RenderBackendSDL::drawLine(const Point& p1, const Point& p2, int r, int g, int b) { 146 void RenderBackendSDL::drawLine(const Point& p1, const Point& p2, int r, int g, int b) {