MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / RenderShrunk

Method RenderShrunk

Source/Window.cpp:401–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401void cWindow::RenderShrunk( cSurface* pImage ) {
402 SDL_Rect Src, Dest;
403 Src.w = (int) pImage->GetWidth();
404 Src.h = (int) pImage->GetHeight();
405 Src.x = 0;
406 Src.y = 0;
407
408 Dest.w = GetWindowSize().mWidth;
409 Dest.h = GetWindowSize().mHeight;
410
411 if (mWindowMode) {
412 Dest.x = 0;
413 Dest.y = 0;
414 }
415 else {
416 SDL_DisplayMode current;
417 SDL_GetCurrentDisplayMode(0, &current);
418
419 Dest.x = (current.w - Dest.w) / 2;
420 Dest.y = (current.h - Dest.h) / 2;
421 }
422
423 SDL_RenderCopy( mRenderer, pImage->GetTexture(), &Src, &Dest);
424}
425
426void cWindow::SetCursor() {
427

Callers 1

Video_SurfaceRenderMethod · 0.80

Calls 3

GetWidthMethod · 0.80
GetHeightMethod · 0.80
GetTextureMethod · 0.80

Tested by

no test coverage detected