changed resolution

This commit is contained in:
Dave White 2003-09-18 10:49:58 +00:00
parent da58f22675
commit 4e492d7a92
5 changed files with 28 additions and 22 deletions

View file

@ -94,15 +94,17 @@ void get_files_in_dir(const std::string& directory,
int res = dir;
do {
const std::string path = (mode == ENTIRE_FILE_PATH ?
directory + "/" : std::string("")) + fileinfo.name;
if(fileinfo.name[0] != '.') {
const std::string path = (mode == ENTIRE_FILE_PATH ?
directory + "/" : std::string("")) + fileinfo.name;
if(fileinfo.attrib&_A_SUBDIR) {
if(dirs != NULL)
dirs->push_back(path);
} else {
if(files != NULL)
files->push_back(path);
if(fileinfo.attrib&_A_SUBDIR) {
if(dirs != NULL)
dirs->push_back(path);
} else {
if(files != NULL)
files->push_back(path);
}
}
res = _findnext(dir,&fileinfo);
@ -113,6 +115,9 @@ void get_files_in_dir(const std::string& directory,
#else
struct dirent* entry;
while((entry = readdir(dir)) != NULL) {
if(entry->d_name[0] == '.')
continue;
const std::string name((directory + "/") + entry->d_name);
//try to open it as a directory to test if it is a directory

View file

@ -174,7 +174,7 @@ int play_game(int argc, char** argv)
}
}
const int bpp = video.modePossible(1024,768,16,video_flags);
const int bpp = video.modePossible(1152,864,16,video_flags);
if(bpp == 0) {
std::cerr << "The required video mode, 1024x768x16 "
@ -195,7 +195,7 @@ int play_game(int argc, char** argv)
<< "For best results, run the program on a 16 bpp display\n";
}
const int res = video.setMode(1024,768,16,video_flags);
const int res = video.setMode(1152,864,16,video_flags);
if(res != 16) {
std::cerr << "required video mode, 1024x768x16 is not supported\n";
return 0;

View file

@ -87,7 +87,7 @@ void show_intro(display& screen, config& data)
stream << c;
}
static const SDL_Rect area = {0,0,1024,768};
static const SDL_Rect area = {0,0,screen.x(),screen.y()};
font::draw_text(&screen,area,16,font::NORMAL_COLOUR,stream.str(),
textx,texty);
next_button.draw();
@ -227,7 +227,7 @@ void show_map_scene(display& screen, config& data)
SDL_Delay(500);
}
static const SDL_Rect area = {0,0,1024,768};
static const SDL_Rect area = {0,0,screen.x(),screen.y()};
const SDL_Rect scenario_size =
font::draw_text(NULL,area,24,font::NORMAL_COLOUR,scenario,0,0);
font::draw_text(&screen,area,24,font::NORMAL_COLOUR,scenario,

View file

@ -136,7 +136,8 @@ class menu
if(column_widths_.empty()) {
for(int row = 0; row != items_.size(); ++row) {
for(int col = 0; col != items_[row].size(); ++col) {
static const SDL_Rect area = {0,0,1024,768};
static const SDL_Rect area =
{0,0,display_->x(),display_->y()};
const SDL_Rect res =
font::draw_text(NULL,area,menu_font_size,
@ -176,7 +177,7 @@ class menu
item == selected_ ? 150:0,0,0,
0.7,display_->video().getSurface());
SDL_Rect area = {0,0,1024,768};
SDL_Rect area = {0,0,display_->x(),display_->y()};
const std::vector<int>& widths = column_widths();
@ -229,7 +230,7 @@ class menu
y = prev.y + prev.h;
}
static const SDL_Rect area = {0,0,1024,768};
static const SDL_Rect area = {0,0,display_->x(),display_->y()};
SDL_Rect res = font::draw_text(NULL,area,menu_font_size,
font::NORMAL_COLOUR,items_[item][0],x_,y);
@ -287,7 +288,7 @@ public:
int height() const {
if(height_ == -1) {
const SDL_Rect area = { 0, 0, 1024, 768 };
const SDL_Rect area = { 0, 0, display_->x(), display_->y() };
height_ = 0;
for(int i = 0; i != items_.size() && i != max_menu_items; ++i) {
height_ += get_item_rect(i).h;
@ -451,7 +452,7 @@ int show_dialog(display& disp, SDL_Surface* image,
CVideo& screen = disp.video();
SDL_Surface* const scr = screen.getSurface();
SDL_Rect clipRect = { 0, 0, 1024, 768 };
SDL_Rect clipRect = { 0, 0, disp.x(), disp.y() };
const bool use_textbox = text_widget_text != NULL;
static const std::string default_text_string = "";
@ -657,7 +658,7 @@ int show_dialog(display& disp, SDL_Surface* image,
if(!units.empty()) {
const int unitw = 200;
const int unith = 768/2;
const int unith = disp.y()/2;
draw_solid_tinted_rectangle(unitx,unity,unitw,unith,
0,0,0,1.0,scr);
draw_rectangle(unitx,unity,unitw,unith,border_colour,scr);
@ -853,7 +854,7 @@ TITLE_RESULT show_title(display& screen)
multi_button.draw();
quit_button.draw();
language_button.draw();
screen.video().update(0,0,1027,768);
screen.video().update(0,0,screen.x(),screen.y());
CKey key;

View file

@ -166,15 +166,15 @@ void set_grid(bool ison)
void show_preferences_dialog(display& disp)
{
const int border_size = 6;
const int xpos = 1024/2 - 300;
const int ypos = 768/2 - 200;
const int xpos = disp.x()/2 - 300;
const int ypos = disp.y()/2 - 200;
const int width = 600;
const int height = 400;
disp.invalidate_all();
disp.draw();
SDL_Rect clip_rect = {0,0,1024,768};
SDL_Rect clip_rect = {0,0,disp.x(),disp.y()};
SDL_Rect title_rect = font::draw_text(NULL,clip_rect,16,font::NORMAL_COLOUR,
string_table["preferences"],0,0);