MCPcopy Create free account
hub / github.com/TASEmulators/fceux / CalcWindowSize

Function CalcWindowSize

src/drivers/win/window.cpp:344–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344void CalcWindowSize(RECT *al)
345{
346 int xres = 256;
347 if(fullscreen && vmodes[0].special==3)
348 xres=301;
349 if(!fullscreen && winspecial==3)
350 xres=301;
351
352 double screen_width = VNSWID_NU(xres);
353 double screen_height = FSettings.TotalScanlines();
354 if (eoptions & EO_TVASPECT)
355 screen_width = ceil(screen_height * (screen_width / xres) * (tvAspectX / tvAspectY));
356
357 al->left = 0;
358 al->top = 0;
359 al->right = ceil(screen_width * winsizemulx);
360 al->bottom = menuYoffset + ceil(screen_height * winsizemuly);
361
362 AdjustWindowRectEx(al,
363 GetWindowLong(hAppWnd, GWL_STYLE),
364 GetMenu(hAppWnd) != NULL,
365 GetWindowLong(hAppWnd, GWL_EXSTYLE)
366 );
367
368 al->right -= al->left;
369 al->left = 0;
370 al->bottom -= al->top;
371 al->top=0;
372}
373
374/// Updates the menu items that should only be enabled if a game is loaded.
375/// @param enable Flag that indicates whether the menus should be enabled (1) or disabled (0).

Callers 2

AppWndProcFunction · 0.85
SetMainWindowStuffFunction · 0.85

Calls 1

TotalScanlinesMethod · 0.80

Tested by

no test coverage detected