| 367 | } |
| 368 | |
| 369 | void 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, ¤t); |
| 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 | |
| 401 | void cWindow::RenderShrunk( cSurface* pImage ) { |
| 402 | SDL_Rect Src, Dest; |
no test coverage detected