final checkin for RC4, including bug found by VC++

This commit is contained in:
Dave White 2003-10-29 07:13:20 +00:00
parent 125a863aef
commit 02048139d0
5 changed files with 11 additions and 15 deletions

View file

@ -471,7 +471,7 @@ void display::draw(bool update,bool force)
//force a wait for 10 ms every frame.
//TODO: review whether this is the correct thing to do
SDL_Delay(maximum(10,wait_time));
SDL_Delay(maximum<int>(10,wait_time));
if(update) {
lastDraw_ = SDL_GetTicks();
@ -559,7 +559,7 @@ void display::draw_game_status(int x, int y)
const int upkeep = team_upkeep(units_,currentTeam_+1);
const int expenses = upkeep - teams_[currentTeam_].towers().size();
const int income = teams_[currentTeam_].income() - maximum(expenses,0);
const int income = teams_[currentTeam_].income() - maximum<int>(expenses,0);
details << char(activeTeam_+1) << string_table["turn"] << ": "
<< status_.turn() << "/" << status_.number_of_turns() << "\n"
@ -657,8 +657,6 @@ void display::draw_unit_details(int x, int y, const gamemap::location& loc,
srcrect.y -= background->h;
srcrect.x -= mapx();
SDL_Rect dstrect = description_rect;
SDL_BlitSurface(background_bot,&srcrect,screen,&description_rect);
}
@ -1070,7 +1068,7 @@ void display::draw_tile(int x, int y, SDL_Surface* unit_image,
surface_lock srclock(surface);
short* startsrc = srclock.pixels() + srcy*(surface->w+xpad) +
maximum(xoffset,xsrc);
maximum<int>(xoffset,xsrc);
short* endsrc = startsrc + len;
if(!(startsrc >= srclock.pixels() &&
@ -1194,7 +1192,7 @@ void display::draw_tile(int x, int y, SDL_Surface* unit_image,
const int energy_w = energy_image->w + is_odd(energy_image->w);
if(yloc + skip < energy_image->h) {
startenergy = energy_lock.pixels() + (yloc+skip)*energy_w +
maximum(xoffset,xsrc);
maximum<int>(xoffset,xsrc);
for(int i = 0; i != len; ++i) {
if(startenergy != NULL && *startenergy != 0) {
@ -1326,7 +1324,7 @@ std::vector<SDL_Surface*> display::getAdjacentTerrain(int x, int y,
const gamemap::TERRAIN current_terrain = map_.on_board(loc) ? map_[x][y]:0;
std::vector<bool> done(true,6);
std::vector<bool> done(6,true);
gamemap::location adjacent[6];
get_adjacent_tiles(loc,adjacent);
int tiles[6];
@ -1805,7 +1803,7 @@ bool display::unit_attack_ranged(const gamemap::location& a,
double defensive_alpha = 1.0;
if(damage > 0 && i >= missile_impact) {
if(def->second.gets_hit(minimum(drain_speed,damage))) {
if(def->second.gets_hit(minimum<int>(drain_speed,damage))) {
dead = true;
damage = 0;
} else {
@ -1814,7 +1812,7 @@ bool display::unit_attack_ranged(const gamemap::location& a,
if(flash_num == 0 || flash_num == 2) {
defensive_alpha = 0.0;
defensive_colour = 0xF000;
defensive_colour = short(0xF000);
}
++flash_num;
@ -2029,7 +2027,7 @@ bool display::unit_attack(const gamemap::location& a,
double defender_alpha = 1.0;
if(damage > 0 && i >= 0) {
if(def->second.gets_hit(minimum(drain_speed,damage))) {
if(def->second.gets_hit(minimum<int>(drain_speed,damage))) {
dead = true;
damage = 0;
} else {

View file

@ -22,7 +22,7 @@ namespace game_config
const int cure_amount = 8;
const int curer_heals_per_turn = 18;
const int recall_cost = 20;
const std::string version = "0.5-RC3";
const std::string version = "0.5-RC4";
bool debug = false;
#ifdef WESNOTH_PATH

View file

@ -5,7 +5,7 @@
#include "multiplayer_lobby.hpp"
#include "network.hpp"
#include "show_dialog.hpp"
#include "textbox.hpp"
#include "widgets/textbox.hpp"
#include "widgets/button.hpp"
#include "widgets/menu.hpp"

View file

@ -112,7 +112,7 @@ size_t distance_between(const gamemap::location& a, const gamemap::location& b)
const size_t vpenalty = (is_even(a.x) && is_odd(b.x) && a.y < b.y ||
is_even(b.x) && is_odd(a.x) && b.y < a.y) ? 1:0;
const size_t vdistance = abs(a.y - b.y) + vpenalty;
const size_t vsavings = minimum(vdistance,hdistance/2 + hdistance%2);
const size_t vsavings = minimum<int>(vdistance,hdistance/2 + hdistance%2);
return hdistance + vdistance - vsavings;
}

View file

@ -303,8 +303,6 @@ void set_turn_dialog(bool ison)
void show_preferences_dialog(display& disp)
{
assert(::disp != NULL);
const events::resize_lock prevent_resizing;
log_scope("show_preferences_dialog");