the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 38 lines 707 B view raw
1#include "stdafx.h" 2#include "ScreenSizeCalculator.h" 3#include "Options.h" 4 5ScreenSizeCalculator::ScreenSizeCalculator(Options *options, int width, int height, int forceScale/*=-1*/) 6{ 7 w = width; 8 h = height; 9 if( forceScale == -1 ) 10 { 11 scale = 1; 12 13 int maxScale = options->guiScale; 14 if (maxScale == 0) maxScale = 1000; 15 while (scale < maxScale && w / (scale + 1) >= 320 && h / (scale + 1) >= 240) 16 { 17 scale++; 18 } 19 } 20 else 21 { 22 scale = forceScale; 23 } 24 rawWidth = w / (double) scale; 25 rawHeight = h / (double) scale; 26 w = (int) ceil(rawWidth); 27 h = (int) ceil(rawHeight); 28} 29 30int ScreenSizeCalculator::getWidth() 31{ 32 return w; 33} 34 35int ScreenSizeCalculator::getHeight() 36{ 37 return h; 38}