MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / flip

Method flip

src/Engine/Screen.cpp:184–212  ·  view source on GitHub ↗

* Renders the buffer's contents onto the screen, applying * any necessary filters or conversions in the process. * If the scaling factor is bigger than 1, the entire contents * of the buffer are resized by that factor (eg. 2 = doubled) * before being put on screen. */

Source from the content-addressed store, hash-verified

182 * before being put on screen.
183 */
184void Screen::flip()
185{
186 if (getWidth() != _baseWidth || getHeight() != _baseHeight || isOpenGLEnabled())
187 {
188 Zoom::flipWithZoom(_surface->getSurface(), _screen, _topBlackBand, _bottomBlackBand, _leftBlackBand, _rightBlackBand, &glOutput);
189 }
190 else
191 {
192 SDL_BlitSurface(_surface->getSurface(), 0, _screen, 0);
193 }
194
195 // perform any requested palette update
196 if (_pushPalette && _numColors && _screen->format->BitsPerPixel == 8)
197 {
198 if (_screen->format->BitsPerPixel == 8 && SDL_SetColors(_screen, &(deferredPalette[_firstColor]), _firstColor, _numColors) == 0)
199 {
200 Log(LOG_DEBUG) << "Display palette doesn't match requested palette";
201 }
202 _numColors = 0;
203 _pushPalette = false;
204 }
205
206
207
208 if (SDL_Flip(_screen) == -1)
209 {
210 throw Exception(SDL_GetError());
211 }
212}
213
214/**
215 * Clears all the contents out of the internal buffer.

Callers 5

runMethod · 0.80
FlcMainFunction · 0.80
initMethod · 0.80
initMethod · 0.80
initMethod · 0.80

Calls 2

ExceptionClass · 0.85
getSurfaceMethod · 0.45

Tested by

no test coverage detected