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

Method RenderAt

Source/Window.cpp:369–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369void cWindow::RenderAt( cSurface* pImage ) {
370 SDL_Rect Src, Dest;
371
372 Src.w = mScreenSize.mWidth;
373 Src.h = mScreenSize.mHeight;
374 Src.x = (int) 16;
375 Src.y = (int) 16;
376
377 if (g_Fodder->mParams->mIntegerScaling || mWindowMode) {
378 Dest.w = GetWindowSize().mWidth;
379 Dest.h = GetWindowSize().mHeight;
380 }
381 else {
382 SDL_GetWindowSize(mWindow, NULL, &Dest.h);
383 Dest.w = (int) (Dest.h*(float)(4.0/3.0));
384 }
385
386 if (mWindowMode) {
387 Dest.x = 0;
388 Dest.y = 0;
389 }
390 else {
391 SDL_DisplayMode current;
392 SDL_GetCurrentDisplayMode(0, &current);
393
394 Dest.x = (current.w - Dest.w) / 2;
395 Dest.y = (current.h - Dest.h) / 2;
396 }
397
398 SDL_RenderCopy( mRenderer, pImage->GetTexture(), &Src, &Dest );
399}
400
401void cWindow::RenderShrunk( cSurface* pImage ) {
402 SDL_Rect Src, Dest;

Callers 3

menu_loopFunction · 0.80
CycleMethod · 0.80
Video_SurfaceRenderMethod · 0.80

Calls 1

GetTextureMethod · 0.80

Tested by

no test coverage detected