Skip to content

Commit

Permalink
FIXED mapview size and forced scaling in window mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Sterker committed Oct 31, 2010
1 parent d6a2bb8 commit a5a1fd4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/gfx/gfx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ namespace gfx
}

screen::ShadowSurface = NULL;
screen::Scale = 1;

screen::get_video_mode_p = (void(*)(u_int16*, u_int16*, u_int8*)) lt_dlsym(dlhandle, "gfx_screen_get_video_mode");
if (!screen::get_video_mode_p)
Expand Down
11 changes: 7 additions & 4 deletions src/gfx/screen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ namespace gfx
const u_int8 screen::TRANS_BLUE = 0xff;

// All the static data for the screen.
u_int16 screen::length_, screen::height_;
u_int16 screen::length_ = 0, screen::height_ = 0;
u_int8 screen::bytes_per_pixel_;
bool screen::fullscreen_;
u_int8 screen::Scale;
u_int8 screen::Scale = 1;
surface *screen::ShadowSurface;

void (*screen::get_video_mode_p) (u_int16 *l, u_int16 *h, u_int8 *depth) = NULL;
Expand Down Expand Up @@ -120,8 +120,11 @@ namespace gfx
else
{
// use maximum allowed view size for windowed mode
length_ = length = max_x;
height_ = height = max_y;
length_ = max_x;
height_ = max_y;

length = length_ * Scale;
height = height_ * Scale;
}

if (!set_video_mode_p (length, height, bytes_per_pixel_*8))
Expand Down
3 changes: 3 additions & 0 deletions test/worldtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ class world_test : public adonthell::app
game_mgr.load (base::savegame::INITIAL_SAVE);
LOG(INFO) << " done!";

// set mapview to proper size
world::area_manager::get_mapview()->resize(gfx::screen::length(), gfx::screen::height());

LOG(INFO) << "Creating 'Human' specie... ";
rpg::specie human("Human");
human.get_state("groups/human.specie");
Expand Down

0 comments on commit a5a1fd4

Please sign in to comment.