MCPcopy Create free account
hub / github.com/diasurgical/devilution / ScaleOutputRect

Function ScaleOutputRect

SourceX/display.cpp:155–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155void ScaleOutputRect(SDL_Rect *rect)
156{
157 if (!OutputRequiresScaling())
158 return;
159 const auto *surface = GetOutputSurface();
160 rect->x = rect->x * surface->w / SCREEN_WIDTH;
161 rect->y = rect->y * surface->h / SCREEN_HEIGHT;
162 rect->w = rect->w * surface->w / SCREEN_WIDTH;
163 rect->h = rect->h * surface->h / SCREEN_HEIGHT;
164}
165
166#ifdef USE_SDL1
167namespace {

Callers 5

CreateScaledSurfaceFunction · 0.85
BlitFunction · 0.85
DrawTTFFunction · 0.85
DrawArtFunction · 0.85
RenderMethod · 0.85

Calls 2

OutputRequiresScalingFunction · 0.85
GetOutputSurfaceFunction · 0.85

Tested by

no test coverage detected