allow 320x240 resolution with USE_TINY_GUI;

provide a dummy 320x240 theme as a work basis, copy of 800x600
This commit is contained in:
Yann Dirson 2004-10-29 19:53:22 +00:00
parent b77b2df9be
commit 57ee2ea3b5
4 changed files with 351 additions and 4 deletions

View file

@ -683,4 +683,342 @@ height=600
[/status]
[/resolution]
[resolution]
width=320
height=240
[main_map]
rect=0,26,882,768
xanchor=left
yanchor=top
[/main_map]
[menu]
title= _ "Menu"
image=lite
items=objectives,statistics,unitlist,statustable,save,load,preferences,chatlog,help,quit
rect=3,1,103,22
xanchor=fixed
yanchor=fixed
[/menu]
[menu]
title= _ "Actions"
image=lite
items=undo,redo,cycle,speak,recruit,recall,showenemymoves,bestenemymoves,delayshroud,updateshroud,endturn
rect=105,1,205,22
xanchor=fixed
yanchor=fixed
[/menu]
[menu]
is_context_menu=true
items=undo,redo,describeunit,renameunit,createunit,changeside,labelterrain,speak,continue,recruit,recall,delayshroud,updateshroud,cycle,endturn
[/menu]
# top panel
[panel]
image=misc/top-bg.png
rect=0,0,1024,26
xanchor=top
yanchor=fixed
[/panel]
# rightside panel
[panel]
image=misc/rightside.png
rect=882,25,1024,309
xanchor=right
yanchor=fixed
[/panel]
[mini_map]
rect=892,32,1017,175
xanchor=right
yanchor=fixed
[/mini_map]
[panel]
image=misc/rightside-bg.png
rect=882,309,1024,730
xanchor=right
yanchor=top
[/panel]
[panel]
image=misc/rightside-bottom.png
rect=882,730,0,768
xanchor=right
yanchor=bottom
[/panel]
[menu]
title= _ "End Turn"
items=endturn
rect=900,737
xanchor=right
yanchor=bottom
[/menu]
[panel]
image=misc/status-bg.png
rect=270,2,365,21
xanchor=proportional
yanchor=fixed
[/panel]
[panel]
image=misc/status-bg.png
rect=370,2,465,21
xanchor=proportional
yanchor=fixed
[/panel]
[panel]
image=misc/status-bg.png
rect=470,2,555,21
xanchor=proportional
yanchor=fixed
[/panel]
[panel]
image=misc/status-bg.png
rect=560,2,645,21
xanchor=proportional
yanchor=fixed
[/panel]
[panel]
image=misc/status-bg.png
rect=650,2,750,21
xanchor=proportional
yanchor=fixed
[/panel]
[panel]
image=misc/status-bg.png
rect=755,2,844,21
xanchor=proportional
yanchor=fixed
[/panel]
# HP/XP
[label]
font_size=10
text= _ "HP"
rect=967,234,1022,246
xanchor=right
yanchor=fixed
[/label]
[label]
font_size=10
text= _ "XP"
rect=967,260,1022,272
xanchor=right
yanchor=fixed
[/label]
# gold icon
[label]
icon=misc/gold.png
text= _ "gold"
rect=375,3,391,19
xanchor=proportional
yanchor=fixed
[/label]
# villages icon
[label]
icon=misc/villages.png
text= _ "villages"
rect=475,3,491,19
xanchor=proportional
yanchor=fixed
[/label]
# units icon
[label]
icon=misc/units.png
text= _ "units"
rect=565,3,581,19
xanchor=proportional
yanchor=fixed
[/label]
# upkeep icon
[label]
icon=misc/upkeep.png
text= _ "upkeep"
rect=655,3,687,19
xanchor=proportional
yanchor=fixed
[/label]
# income icon
[label]
icon=misc/income.png
text= _ "income"
rect=760,3,792,19
xanchor=proportional
yanchor=fixed
[/label]
[status]
# the time of day image
[time_of_day]
rect=892,184,1017,223
xanchor=right
yanchor=fixed
[/time_of_day]
[observers]
font_size=12
rect=1004,3,1020,19
xanchor=proportional
yanchor=fixed
[/observers]
#put the side playing indicator next to the turn indicator
[side_playing]
rect=273,4,288,20
xanchor=proportional
yanchor=fixed
[/side_playing]
# the game status
[turn]
font_size=12
rect=292,4,360,20
xanchor=proportional
yanchor=fixed
prefix=
prefix_literal=""
[/turn]
[gold]
font_size=12
rect=395,4,460,20
xanchor=proportional
yanchor=fixed
prefix=
prefix_literal=""
[/gold]
[villages]
font_size=12
rect=495,4,550,20
xanchor=proportional
yanchor=fixed
prefix=
prefix_literal=""
[/villages]
[num_units]
font_size=12
rect=585,4,640,20
xanchor=proportional
yanchor=fixed
prefix=
prefix_literal=""
[/num_units]
[upkeep]
font_size=12
rect=690,4,745,20
xanchor=proportional
yanchor=fixed
prefix=
prefix_literal=""
[/upkeep]
[income]
font_size=12
rect=795,4,840,20
xanchor=proportional
yanchor=fixed
prefix=
prefix_literal=""
[/income]
[comment]
[terrain]
font_size=12
rect=770,4,890,20
xanchor=proportional
yanchor=fixed
[/terrain]
[/comment]
[position]
font_size=12
rect=855,4,1000,20
xanchor=proportional
yanchor=fixed
[/position]
#unit stats here
[unit_image]
rect=891,235,963,307
xanchor=right
yanchor=fixed
[/unit_image]
[unit_description]
font_size=14
rect=891,312,1022,330
xanchor=right
yanchor=fixed
[/unit_description]
[unit_type]
font_size=12
rect=891,330,1022,346
xanchor=right
yanchor=fixed
[/unit_type]
[unit_level]
font_size=12
rect=891,346,1022,362
prefix= _ "statuspanel^level"
prefix_literal=" "
xanchor=right
yanchor=fixed
[/unit_level]
[unit_alignment]
font_size=12
rect=891,362,1022,378
xanchor=right
yanchor=fixed
[/unit_alignment]
[unit_traits]
font_size=12
rect=891,378,1022,394
xanchor=right
yanchor=fixed
[/unit_traits]
[unit_abilities]
font_size=12
rect=891,394,1022,410
xanchor=right
yanchor=fixed
[/unit_abilities]
[unit_status]
font_size=12
rect=968,289,1020,305
xanchor=right
yanchor=fixed
[/unit_status]
[unit_moves]
font_size=12
rect=891,410,1022,426
prefix= _ "statuspanel^movement"
prefix_literal=": "
xanchor=right
yanchor=fixed
[/unit_moves]
[unit_hp]
font_size=12
rect=967,246,1022,260
#prefix=hp
#prefix_literal=" "
xanchor=right
yanchor=fixed
[/unit_hp]
[unit_xp]
font_size=12
rect=967,272,1022,286
#prefix=xp
#prefix_literal=" "
xanchor=right
yanchor=fixed
[/unit_xp]
[unit_weapons]
font_size=12
#rect=900,452,1020,620
rect=891,426,1022,594
xanchor=right
yanchor=fixed
[/unit_weapons]
[/status]
[/resolution]
[/theme]

View file

@ -237,7 +237,7 @@ void pump()
case SDL_VIDEORESIZE: {
const SDL_ResizeEvent* const resize = reinterpret_cast<SDL_ResizeEvent*>(&event);
if(resize->w < 800 || resize->h < 600) {
if(resize->w < min_allowed_width || resize->h < min_allowed_height) {
resize_dimensions.first = 0;
resize_dimensions.second = 0;
} else {

View file

@ -158,8 +158,8 @@ std::pair<int,int> resolution()
const string_map::const_iterator y = prefs.values.find('y' + postfix);
if(x != prefs.values.end() && y != prefs.values.end() &&
x->second.empty() == false && y->second.empty() == false) {
std::pair<int,int> res (maximum(atoi(x->second.c_str()),800),
maximum(atoi(y->second.c_str()),600));
std::pair<int,int> res (maximum(atoi(x->second.c_str()),min_allowed_width),
maximum(atoi(y->second.c_str()),min_allowed_height));
//make sure resolutions are always divisible by 4
//res.first &= ~3;
@ -991,7 +991,7 @@ bool show_video_mode_dialog(display& disp)
std::vector<std::pair<int,int> > resolutions;
for(int i = 0; modes[i] != NULL; ++i) {
if(modes[i]->w >= 800 && modes[i]->h >= 600) {
if(modes[i]->w >= min_allowed_width && modes[i]->h >= min_allowed_height) {
resolutions.push_back(std::pair<int,int>(modes[i]->w,modes[i]->h));
}
}

View file

@ -20,6 +20,15 @@
#include <utility>
#include <set>
// only there temporary
#ifdef USE_TINY_GUI
const int min_allowed_width = 320;
const int min_allowed_height = 240;
#else
const int min_allowed_width = 800;
const int min_allowed_height = 600;
#endif
namespace preferences {
struct manager