summaryrefslogtreecommitdiffstats
path: root/src/graphics/opengl/gldevice.cpp
diff options
context:
space:
mode:
authorMohamed Waheed <mohamedwaheedmohamed@gmail.com>2014-06-24 20:27:31 +0300
committerMohamed Waheed <mohamedwaheedmohamed@gmail.com>2014-06-24 20:27:31 +0300
commitb7125a5b24bc6d2581bec0d3f792ba948e0e7edd (patch)
tree4770e1157e82b584611560b4f43a506571a88397 /src/graphics/opengl/gldevice.cpp
parent613e1d74c47cf3a756af9aff75575c7567699381 (diff)
downloadcolobot-b7125a5b24bc6d2581bec0d3f792ba948e0e7edd.tar.gz
colobot-b7125a5b24bc6d2581bec0d3f792ba948e0e7edd.tar.bz2
colobot-b7125a5b24bc6d2581bec0d3f792ba948e0e7edd.zip
formatting and enhancements for savefile screenshot feature
Diffstat (limited to 'src/graphics/opengl/gldevice.cpp')
-rw-r--r--src/graphics/opengl/gldevice.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp
index 57738a6..b42f29d 100644
--- a/src/graphics/opengl/gldevice.cpp
+++ b/src/graphics/opengl/gldevice.cpp
@@ -1793,17 +1793,13 @@ FillMode CGLDevice::GetFillMode()
void* CGLDevice::GetFrameBufferPixels()const{
- SDL_Surface* surface = SDL_GetVideoSurface();
-
- assert(surface != nullptr);
-
- GLubyte* pixels = new GLubyte [4 * surface->h * surface->w];
+ GLubyte* pixels = new GLubyte [4 * m_config.size.x * m_config.size.y];
- glReadPixels(0,0,surface->w,surface->h,GL_RGBA,GL_UNSIGNED_BYTE,pixels);
+ glReadPixels(0, 0, m_config.size.x, m_config.size.y, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
unsigned int* p = static_cast<unsigned int*> ( static_cast<void*>(pixels) );
- for (int i = 0; i < surface->h * surface->w; ++i)
+ for (int i = 0; i < m_config.size.x * m_config.size.y; ++i)
p[i] |= 0xFF000000;
return static_cast<void*>(p);