git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7889 c06c8d41-db1a-0410-9941-cceddc491573
NROTGB26G7CER2PUMZWEQTW6OCAAQBHEVVESKY7XBGFBTIZKFS3AC
X4TW2JIQ6VTX5J7MXOUTJ7JK3765SE5OH54I6QYJSFFQACPCIEYAC
Q3B3UVMYEVC4YJUPYVSNTR4DJH4E6J4JJDHZNT5LNOCHCPPMEMXAC
X6ULJWV7HNNP7XTRF4LT5OVBE4RARGQZARKJUSU6DR3PTQTR4JOQC
PBTLQZHBQK5TAIO7SNSCKSHOQQ65CFFI55OTTETV7FG2FCJOXKHQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
UVO3NT3VC5KVZVJXMAHJLEIL2IRHQO6JVBPFKVENXPU3YMACCQFAC
XKNRIFG2ULQLAAQ5GC4RBZPOERV73DLCNILEA5EP37JLIX5EP3OQC
// Default Screen Settings
// width, height, map, crt, stat, msg, tip, lbl
static int _screen_sizes[4][8] =
{
// Default
{1024, 700, 4, 15, 16, 14, 15, 14},
// Eee PC 900+
{1024, 600, 3, 14, 14, 12, 13, 12},
// Small screen
{800, 600, 3, 14, 11, 12, 13, 12},
// Eee PC
{800, 480, 3, 13, 12, 10, 13, 11}
};
m_windowsz.x = Options.tile_window_width;
m_windowsz.y = Options.tile_window_height;
if (Options.tile_window_width && Options.tile_window_height)
{
m_windowsz.x = Options.tile_window_width;
m_windowsz.y = Options.tile_window_height;
}
else if (flags & SDL_FULLSCREEN)
{
// By default, fill the whole screen.
m_windowsz.x = m_screen_width;
m_windowsz.y = m_screen_height;
}
else
{
m_windowsz.x = std::max(800, m_screen_width - 100);
m_windowsz.y = std::max(480, m_screen_height - 100);
}
// Find which set of _screen_sizes to use.
int auto_size = 0;
int num_screen_sizes = sizeof(_screen_sizes) / sizeof(_screen_sizes[0]);
do
{
if (m_windowsz.x >= _screen_sizes[auto_size][0]
&& m_windowsz.y >= _screen_sizes[auto_size][1])
{
break;
}
} while (++auto_size < num_screen_sizes - 1);
// Auto pick map and font sizes if option is zero.
#define AUTO(x,y) (x = (x) ? (x) : _screen_sizes[auto_size][(y)])
AUTO(Options.tile_map_pixels, 2);
AUTO(Options.tile_font_crt_size, 3);
AUTO(Options.tile_font_stat_size, 4);
AUTO(Options.tile_font_msg_size, 5);
AUTO(Options.tile_font_tip_size, 6);
AUTO(Options.tile_font_lbl_size, 7);
#undef AUTO
### Predefined layouts for smaller standard resolutions. Any window size
### at or above 1024x768 should probably use the above defaults.
### 800 x 480 (EeePC)
# tile_window_width = 800
# tile_window_height = 480
# tile_map_pixels = 3
# tile_full_screen = true
# tile_font_crt_size = 13
# tile_font_stat_size = 12
# tile_font_msg_size = 10
# tile_font_tip_size = 13
# tile_font_lbl_size = 11
### 1024 x 600 (EeePC 900+)
# tile_window_width = 1024
# tile_window_height = 600
# tile_map_pixels = 3
# tile_full_screen = true
# tile_font_crt_size = 14
# tile_font_stat_size = 14
# tile_font_msg_size = 12
# tile_font_tip_size = 13
# tile_font_lbl_size = 12
### 800 x 600
# tile_window_width = 800
# tile_window_height = 600
# tile_map_pixels = 3
# tile_font_crt_size = 14
# tile_font_stat_size = 11
# tile_font_msg_size = 12
# tile_font_tip_size = 13
# tile_font_lbl_size = 12