This commit is contained in:
uid66289 2003-12-23 21:55:07 +00:00
parent 7299c63e74
commit 15574b6539
34 changed files with 1384 additions and 166 deletions

View file

@ -1,9 +1,26 @@
Version 0.6.1:
* removed plague ability from Wraiths
* decreased Lich's melee damage by one
* hitpoints are displayed in red/white/green depending on 1/3, 2/3, full energy.
* display experience in green when unit is near advancement
* basic support for 800x600 resolution has been added, it still needs a lot work
* translated manuals:
* norwegian
* new translations:
* dutch
* autotools: enabled changing datadir name with ./configure
* autotools: configure stops and gives error messages if libs & includes aren't found
* fixed Crossroads scenario lacking victory and defeat conditions
* fixed 'A Choice Must Be Made' defeat conditions
* fixed bug causing crash on scenario completion
* fixed 'Storm Trident' mislocation on 'Bay of Pearls'
* fixed resetting player starting gold, gold per village, player race, and player type when loading multiplayer game
* change to the way images are handled to fix resizing (and other potential) bugs
* enabled changing datadir name with ./configure
* change the way images are handled to fix resizing (and other potential) bugs
* fixed problem where gold was reset to 100 on some scenarios
* made it so both holy water items in the valley of death work properly
* fixed bug where using items such as the 'Storm Trident' and 'Sceptre of Fire' could crash the game
* fixed bug that occurred when the display was zoomed very far out
* fixed reference counting problem
* code cleanups
Version 0.6:

60
configure vendored
View file

@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Version: 0.7.
# From configure.ac Version: 0.8.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.58 for wesnoth 0.7.
# Generated by GNU Autoconf 2.58 for wesnoth 0.8.
#
# Report bugs to <davidnwhite@optusnet.com.au>.
#
@ -270,8 +270,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='wesnoth'
PACKAGE_TARNAME='Battle for Wesnoth'
PACKAGE_VERSION='0.7'
PACKAGE_STRING='wesnoth 0.7'
PACKAGE_VERSION='0.8'
PACKAGE_STRING='wesnoth 0.8'
PACKAGE_BUGREPORT='davidnwhite@optusnet.com.au'
ac_unique_file="src/actions.cpp"
@ -789,7 +789,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures wesnoth 0.7 to adapt to many kinds of systems.
\`configure' configures wesnoth 0.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -851,7 +851,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of wesnoth 0.7:";;
short | recursive ) echo "Configuration of wesnoth 0.8:";;
esac
cat <<\_ACEOF
@ -983,7 +983,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
wesnoth configure 0.7
wesnoth configure 0.8
generated by GNU Autoconf 2.58
Copyright (C) 2003 Free Software Foundation, Inc.
@ -997,7 +997,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by wesnoth $as_me 0.7, which was
It was created by wesnoth $as_me 0.8, which was
generated by GNU Autoconf 2.58. Invocation command line was
$ $0 $@
@ -1338,7 +1338,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
PACKAGE=wesnoth
MAJOR_VERSION="0"
MINOR_VERSION="6"
MICRO_VERSION="1RC1"
MICRO_VERSION="1"
if test "x$MICRO_VERSION" = "x"; then
VERSION=$MAJOR_VERSION.$MINOR_VERSION
@ -3436,9 +3436,9 @@ if test $ac_cv_lib_SDL_image_IMG_Load = yes; then
SDL_IMAGE_LIBS=-lSDL_image
else
{ { echo "$as_me:$LINENO: error: *** SDL_image lib not found! Get SDL_image from
http://www.libsdl.org/projects/SDL_image/index.html" >&5
http://www.libsdl.org/projects/SDL_image/index.html" >&5
echo "$as_me: error: *** SDL_image lib not found! Get SDL_image from
http://www.libsdl.org/projects/SDL_image/index.html" >&2;}
http://www.libsdl.org/projects/SDL_image/index.html" >&2;}
{ (exit 1); exit 1; }; }
fi
@ -3510,9 +3510,9 @@ if test $ac_cv_lib_SDL_mixer_Mix_OpenAudio = yes; then
SDL_MIXER_LIBS=-lSDL_mixer
else
{ { echo "$as_me:$LINENO: error: *** SDL_mixer lib not found! Get SDL_mixer from
http://www.libsdl.org/projects/SDL_mixer/index.html" >&5
http://www.libsdl.org/projects/SDL_mixer/index.html" >&5
echo "$as_me: error: *** SDL_mixer lib not found! Get SDL_mixer from
http://www.libsdl.org/projects/SDL_mixer/index.html" >&2;}
http://www.libsdl.org/projects/SDL_mixer/index.html" >&2;}
{ (exit 1); exit 1; }; }
fi
@ -3584,9 +3584,9 @@ if test $ac_cv_lib_SDL_net_SDLNet_Init = yes; then
SDL_NET_LIBS=-lSDL_net
else
{ { echo "$as_me:$LINENO: error: *** SDL_net lib not found! Get SDL_net from
http://www.libsdl.org/projects/SDL_net/index.html" >&5
http://www.libsdl.org/projects/SDL_net/index.html" >&5
echo "$as_me: error: *** SDL_net lib not found! Get SDL_net from
http://www.libsdl.org/projects/SDL_net/index.html" >&2;}
http://www.libsdl.org/projects/SDL_net/index.html" >&2;}
{ (exit 1); exit 1; }; }
fi
@ -3658,9 +3658,9 @@ if test $ac_cv_lib_SDL_ttf_TTF_OpenFont = yes; then
SDL_TTF_LIBS=-lSDL_ttf
else
{ { echo "$as_me:$LINENO: error: *** SDL_ttf lib not found! Get SDL_ttf from
http://www.libsdl.org/projects/SDL_ttf/index.html" >&5
http://www.libsdl.org/projects/SDL_ttf/index.html" >&5
echo "$as_me: error: *** SDL_ttf lib not found! Get SDL_ttf from
http://www.libsdl.org/projects/SDL_ttf/index.html" >&2;}
http://www.libsdl.org/projects/SDL_ttf/index.html" >&2;}
{ (exit 1); exit 1; }; }
fi
@ -4634,9 +4634,9 @@ if test $ac_cv_header_SDL_h = yes; then
:
else
{ { echo "$as_me:$LINENO: error: *** SDL include files not found!
You should install SDL development package." >&5
You should install SDL development package." >&5
echo "$as_me: error: *** SDL include files not found!
You should install SDL development package." >&2;}
You should install SDL development package." >&2;}
{ (exit 1); exit 1; }; }
fi
@ -4782,9 +4782,9 @@ if test $ac_cv_header_SDL_image_h = yes; then
:
else
{ { echo "$as_me:$LINENO: error: *** SDL_image include files not found!
You should install development package." >&5
You should install development package." >&5
echo "$as_me: error: *** SDL_image include files not found!
You should install development package." >&2;}
You should install development package." >&2;}
{ (exit 1); exit 1; }; }
fi
@ -4930,9 +4930,9 @@ if test $ac_cv_header_SDL_mixer_h = yes; then
:
else
{ { echo "$as_me:$LINENO: error: *** SDL_mixer include files not found!
You should install development package." >&5
You should install development package." >&5
echo "$as_me: error: *** SDL_mixer include files not found!
You should install development package." >&2;}
You should install development package." >&2;}
{ (exit 1); exit 1; }; }
fi
@ -5078,9 +5078,9 @@ if test $ac_cv_header_SDL_net_h = yes; then
:
else
{ { echo "$as_me:$LINENO: error: *** SDL_net include files not found!
You should install development package." >&5
You should install development package." >&5
echo "$as_me: error: *** SDL_net include files not found!
You should install development package." >&2;}
You should install development package." >&2;}
{ (exit 1); exit 1; }; }
fi
@ -5226,9 +5226,9 @@ if test $ac_cv_header_SDL_ttf_h = yes; then
:
else
{ { echo "$as_me:$LINENO: error: *** SDL_ttf include files not found!
You should install development package." >&5
You should install development package." >&5
echo "$as_me: error: *** SDL_ttf include files not found!
You should install development package." >&2;}
You should install development package." >&2;}
{ (exit 1); exit 1; }; }
fi
@ -6411,6 +6411,7 @@ if test "${enable_debug+set}" = set; then
CXXFLAGS="$CXXFLAGS -DDEBUG -ggdb3"
fi;
DATADIR=$PACKAGE
# Check whether --enable-datadir-name or --disable-datadir-name was given.
if test "${enable_datadir_name+set}" = set; then
enableval="$enable_datadir_name"
@ -6419,7 +6420,6 @@ if test "${enable_datadir_name+set}" = set; then
DATADIR="wesnoth-data"
;;
no)
DATADIR=$PACKAGE
;;
*)
DATADIR="${enableval}"
@ -6913,7 +6913,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by wesnoth $as_me 0.7, which was
This file was extended by wesnoth $as_me 0.8, which was
generated by GNU Autoconf 2.58. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -6976,7 +6976,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
wesnoth config.status 0.7
wesnoth config.status 0.8
configured by $0, generated by GNU Autoconf 2.58,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"

View file

@ -1,13 +1,13 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(wesnoth, 0.7, davidnwhite@optusnet.com.au, Battle for Wesnoth)
AC_INIT(wesnoth, 0.8, davidnwhite@optusnet.com.au, Battle for Wesnoth)
AC_REVISION($Version: 0.7$)
AC_REVISION($Version: 0.8$)
PACKAGE=wesnoth
MAJOR_VERSION="0"
MINOR_VERSION="6"
MICRO_VERSION="1RC1"
MICRO_VERSION="1"
if test "x$MICRO_VERSION" = "x"; then
VERSION=$MAJOR_VERSION.$MINOR_VERSION
@ -49,25 +49,25 @@ AC_CHECK_LIB([SDL_image],
[IMG_Load],
[SDL_IMAGE_LIBS=-lSDL_image],
[AC_MSG_ERROR([*** SDL_image lib not found! Get SDL_image from
http://www.libsdl.org/projects/SDL_image/index.html])])
http://www.libsdl.org/projects/SDL_image/index.html])])
AC_CHECK_LIB([SDL_mixer],
[Mix_OpenAudio],
[SDL_MIXER_LIBS=-lSDL_mixer],
[AC_MSG_ERROR([*** SDL_mixer lib not found! Get SDL_mixer from
http://www.libsdl.org/projects/SDL_mixer/index.html])])
http://www.libsdl.org/projects/SDL_mixer/index.html])])
AC_CHECK_LIB([SDL_net],
[SDLNet_Init],
[SDL_NET_LIBS=-lSDL_net],
[AC_MSG_ERROR([*** SDL_net lib not found! Get SDL_net from
http://www.libsdl.org/projects/SDL_net/index.html])])
http://www.libsdl.org/projects/SDL_net/index.html])])
AC_CHECK_LIB([SDL_ttf],
[TTF_OpenFont],
[SDL_TTF_LIBS=-lSDL_ttf],
[AC_MSG_ERROR([*** SDL_ttf lib not found! Get SDL_ttf from
http://www.libsdl.org/projects/SDL_ttf/index.html])])
http://www.libsdl.org/projects/SDL_ttf/index.html])])
LIBS=$OLD_LIBS
@ -92,27 +92,27 @@ CXXFLAGS="$CFLAGS $SDL_CFLAGS"
AC_CHECK_HEADER([SDL.h],
[],
[AC_MSG_ERROR([*** SDL include files not found!
You should install SDL development package.])])
You should install SDL development package.])])
AC_CHECK_HEADER([SDL_image.h],
[],
[AC_MSG_ERROR([*** SDL_image include files not found!
You should install development package.])])
You should install development package.])])
AC_CHECK_HEADER([SDL_mixer.h],
[],
[AC_MSG_ERROR([*** SDL_mixer include files not found!
You should install development package.])])
You should install development package.])])
AC_CHECK_HEADER([SDL_net.h],
[],
[AC_MSG_ERROR([*** SDL_net include files not found!
You should install development package.])])
You should install development package.])])
AC_CHECK_HEADER([SDL_ttf.h],
[],
[AC_MSG_ERROR([*** SDL_ttf include files not found!
You should install development package.])])
You should install development package.])])
CPPFLAGS=$OLD_CPPFLAGS
CXXFLAGS=$OLD_CXXFLAGS
@ -139,6 +139,7 @@ AC_ARG_ENABLE(debug,
[ --enable-debug Enable debug in wesnoth],
CXXFLAGS="$CXXFLAGS -DDEBUG -ggdb3")
DATADIR=$PACKAGE
AC_ARG_ENABLE(datadir-name,
[ --datadir-name[[=dir]] Change name of data directory. Default with this option: wesnoth-data],
[case "${enableval}" in
@ -146,7 +147,6 @@ AC_ARG_ENABLE(datadir-name,
DATADIR="wesnoth-data"
;;
no)
DATADIR=$PACKAGE
;;
*)
DATADIR="${enableval}"

View file

@ -97,7 +97,7 @@
x={X}
y={Y}
type=Dwarvish {TYPE}
decription={NAME}
description={NAME}
side=0
[/unit]
@ -111,7 +111,7 @@
x={X}
y={Y}
type=Dwarvish {TYPE}
decription={NAME}
description={NAME}
side=0
[/unit]
[/command]

View file

@ -17,7 +17,11 @@ Victory:
@Defeat either of the enemy leaders
Defeat
#Death of Konrad
#Death of Delfador"
#Death of Delfador
#Death of Li'sar
#Death of Kalenz"
{deaths.cfg}
[side]
type=Commander
@ -209,6 +213,7 @@ Defeat
[endlevel]
next_scenario=Snow_Plains
result=victory
bonus=yes
[/endlevel]
[/event]
@ -220,6 +225,7 @@ Defeat
[endlevel]
next_scenario=Swamp_Of_Dread
result=victory
bonus=yes
[/endlevel]
[/event]
[/scenario]

View file

@ -6,7 +6,7 @@
id=Crossroads
next_scenario=The_Princess_of_Wesnoth
scenario_objectives="
objectives="
Victory:
@Defeat both enemy leaders
Defeat

View file

@ -63,7 +63,7 @@ Defeat:
canrecruit=1
recruit=Orcish Grunt,Wolf Rider,Orcish Archer,Troll Whelp
recruitment_pattern=scout,scout,fighter,fighter,archer
{GOLD 60 120 240}
{GOLD 80 120 240}
enemy=1
[/side]

View file

@ -18,7 +18,11 @@ Victory:
@Defeat enemy leader
Defeat
#Death of Konrad
#Death of Delfador"
#Death of Delfador
#Death of Li'sar
#Death of Kalenz"
{deaths.cfg}
[side]
type=Commander
@ -55,6 +59,12 @@ Defeat
[recall]
description=Delfador
[/recall]
[recall]
description=Kalenz
[/recall]
[recall]
description=Li'sar
[/recall]
[message]
id=msgsnowplains1
description=Delfador

View file

@ -18,7 +18,11 @@ Victory:
@Defeat all enemy leaders
Defeat
#Death of Konrad
#Death of Delfador"
#Death of Delfador
#Death of Li'sar
#Death of Kalenz"
{deaths.cfg}
[side]
type=Commander
@ -102,6 +106,12 @@ Defeat
[recall]
description=Delfador
[/recall]
[recall]
description=Li'sar
[/recall]
[recall]
description=Kalenz
[/recall]
[message]
id=msgswamp1
description=Delfador

View file

@ -37,10 +37,6 @@ Defeat:
side=1
canrecruit=1
controller=human
recruitment_pattern=scout,fighter,archer
aggression=-0.5
village_value=1.0
leader_value=2.0
enemy=2,3,4
[/side]
@ -135,9 +131,10 @@ Defeat:
enemy=1
[/side]
#define HOLY_WATER X Y ID
[item]
x=5
y=23
x={X}
y={Y}
image=item-holywater.png
[/item]
@ -146,11 +143,11 @@ Defeat:
first_time_only=no
[filter]
side=1
x=5
y=23
x={X}
y={Y}
[/filter]
[object]
id=object7_holywater
id={ID}
name=Holy Water
image=item-holywater.png
duration=level
@ -163,35 +160,10 @@ Defeat:
[/effect]
[/object]
[/event]
#enddef
[item]
x=31
y=43
image=item-holywater.png
[/item]
[event]
name=moveto
first_time_only=no
[filter]
side=1
x=31
y=43
[/filter]
[object]
id=object7_holywater
name=Holy Water
image=item-holywater.png
duration=level
description=This water will make close range weapons holy.
cannot_use_message=I am not suited to using this item! Let another take it.
[effect]
apply_to=attack
range=short
set_type=holy
[/effect]
[/object]
[/event]
{HOLY_WATER 5 23 object7_holywater}
{HOLY_WATER 31 43 object7_holywater2}
[event]
name=start

1154
data/translations/dutch.cfg Normal file

File diff suppressed because it is too large Load diff

View file

@ -128,6 +128,7 @@ HARD="Champion (hard)"
no_leader_to_recruit="You don't have a leader to recruit with."
leader_not_on_start="You must have your leader on a keep to recruit or recall units."
no_recruit_location="There are no vacant castle tiles in which to recruit a unit."
no_units_to_recruit="You have no units available to recruit."
your_turn="It is now your turn"

View file

@ -17,7 +17,7 @@ get_hit_sound=groan.wav
name=touch
type=cold
range=short
damage=7
damage=6
number=3
special=drain
[/attack]

View file

@ -28,6 +28,5 @@ get_hit_sound=groan.wav
range=long
damage=4
number=3
special=plague
[/attack]
[/unit]

View file

@ -401,9 +401,9 @@ void attack(display& gui, const gamemap& map,
}
if(dies) {
attackerxp = 8*d->second.type().level();
attackerxp = game_config::kill_experience*d->second.type().level();
if(d->second.type().level() == 0)
attackerxp = 4;
attackerxp = game_config::kill_experience/2;
a->second.get_experience(attackerxp);
attackerxp = 0;
@ -514,9 +514,9 @@ void attack(display& gui, const gamemap& map,
}
if(dies) {
defenderxp = 8*a->second.type().level();
defenderxp = game_config::kill_experience*a->second.type().level();
if(a->second.type().level() == 0)
defenderxp = 4;
defenderxp = game_config::kill_experience/2;
d->second.get_experience(defenderxp);
defenderxp = 0;

View file

@ -105,13 +105,12 @@ void show_objectives(display& disp, config& level_info)
}
int get_save_name(display & disp,const std::string& caption, const std::string& message,
std::string * name)
std::string* name, gui::DIALOG_TYPE dialog_type)
{
int overwrite=0;
int res=0;
do {
res = gui::show_dialog(disp,NULL,"",caption,gui::OK_CANCEL,
NULL,NULL,message,name);
res = gui::show_dialog(disp,NULL,"",caption,dialog_type,NULL,NULL,message,name);
if (res == 0 && save_game_exists(*name))
overwrite = gui::show_dialog(disp,NULL,"",
string_table["save_confirm_overwrite"],gui::YES_NO);

View file

@ -29,7 +29,8 @@ void show_objectives(display& disp, config& level_info);
// Ask user if I should really save the game and what name I should use
// returns 0 iff user wants to save the game
int get_save_name(display & disp, const std::string& caption,
const std::string& message, std::string * name);
const std::string& message, std::string* name,
gui::DIALOG_TYPE dialog_type=gui::YES_NO);
//allow user to select the game they want to load. Returns the name
//of the save they want to load. Stores whether the user wants to show

View file

@ -699,14 +699,26 @@ void display::draw_unit_details(int x, int y, const gamemap::location& loc,
details << translate_string_default("ability_" + *a, *a) << "\n";
}
//display in green/white/red depending on hitpoints
if(u.hitpoints() <= u.max_hitpoints()/3)
details << "#";
else if(u.hitpoints() > 2*(u.max_hitpoints()/3))
details << "@";
details << string_table["hp"] << ": " << u.hitpoints()
<< "/" << u.max_hitpoints() << "\n"
<< string_table["xp"] << ": ";
<< "/" << u.max_hitpoints() << "\n";
if(u.type().advances_to().empty())
details << u.experience() << "/-";
else
details << u.experience() << "/" << u.max_experience();
if(u.type().advances_to().empty()) {
details << string_table["xp"] << ": " << u.experience() << "/-";
} else {
//if killing a unit the same level as us would level us up,
//then display in green
if(u.max_experience() - u.experience() < game_config::kill_experience) {
details << "@";
}
details << string_table["xp"] << ": " << u.experience() << "/" << u.max_experience();
}
details << "\n"
<< string_table["moves"] << ": " << u.movement_left() << "/"
@ -739,9 +751,12 @@ void display::draw_unit_details(int x, int y, const gamemap::location& loc,
details << "\n\n";
}
description_rect =
font::draw_text(this,clipRect,13,font::NORMAL_COLOUR,
details.str(),x,y);
//choose the font size based on how much room we have to play
//with on the right-side panel
const size_t font_size = this->y() >= 700 ? 13 : 10;
description_rect = font::draw_text(this,clipRect,font_size,font::NORMAL_COLOUR,
details.str(),x,y);
update_rect(description_rect);
@ -1132,8 +1147,13 @@ void display::draw_tile(int x, int y, SDL_Surface* unit_image_override,
assert(srcy >= 0);
surface_lock srclock(surface);
short* startsrc = srclock.pixels() + srcy*(surface->w+xpad) +
maximum<int>(xoffset,xsrc);
const int diff = maximum<int>(0,srcy*(surface->w+xpad) + maximum<int>(xoffset,xsrc));
short* startsrc = srclock.pixels() + diff;
len = minimum<int>(len,(surface->w+xpad)*surface->h - diff);
if(len <= 0) {
continue;
}
short* endsrc = startsrc + len;
if(!(startsrc >= srclock.pixels() &&
@ -1713,8 +1733,7 @@ bool display::unit_attack_ranged(const gamemap::location& a,
}
if(!hide) {
SDL_Surface* const image = (unit_image == NULL) ?
NULL : image::get_image(*unit_image);
const scoped_sdl_surface image((unit_image == NULL) ? NULL : image::get_image(*unit_image));
draw_tile(a.x,a.y,image);
}

View file

@ -70,7 +70,7 @@ void pump()
const SDL_ResizeEvent* const resize
= reinterpret_cast<SDL_ResizeEvent*>(&event);
if(resize->w < 1024 || resize->h < 768) {
if(resize->w < 800 || resize->h < 600) {
resize_dimensions.first = 0;
resize_dimensions.second = 0;
} else {

View file

@ -247,20 +247,33 @@ int play_game(int argc, char** argv)
resolution.first = 1024;
resolution.second = 768;
const int bpp = video.modePossible(resolution.first,resolution.second,16,video_flags);
int bpp = video.modePossible(resolution.first,resolution.second,16,video_flags);
if(bpp == 0) {
//Attempt 1024x768.
resolution.first = 1024;
resolution.second = 768;
std::cerr << "1024x768x16 is not possible.\nAttempting 800x600x16...\n";
resolution.first = 800;
resolution.second = 600;
bpp = video.modePossible(resolution.first,resolution.second,16,video_flags);
}
if(bpp == 0) {
//couldn't do 1024x768 either
//couldn't do 1024x768 or 800x600 either
std::cerr << "The required video mode, " << resolution.first
<< "x" << resolution.second << "x16 "
<< "is not supported\n";
if((video_flags&FULL_SCREEN) != 0 && argc == 0)
std::cerr << "Try running the program with the -windowed option "
std::cerr << "Try running the program with the --windowed option "
<< "using a 16bpp X windows setting\n";
if((video_flags&FULL_SCREEN) == 0 && argc == 0)
std::cerr << "Try running with the -fullscreen option\n";
std::cerr << "Try running with the --fullscreen option\n";
return 0;
}
@ -463,6 +476,7 @@ int play_game(int argc, char** argv)
} else if(res == gui::EDIT_PREFERENCES) {
const preferences::display_manager disp_manager(&disp);
preferences::show_preferences_dialog(disp);
disp.redraw_everything();
continue;
} else if(res == gui::SHOW_ABOUT) {
about::show_about(disp);

View file

@ -22,7 +22,8 @@ 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.6.1RC1";
const int kill_experience = 8;
const std::string version = "0.6.1";
bool debug = false;
#ifdef WESNOTH_PATH

View file

@ -26,6 +26,7 @@ namespace game_config
extern const int cure_amount;
extern const int curer_heals_per_turn;
extern const int recall_cost;
extern const int kill_experience;
extern const std::string version;
extern bool debug;

View file

@ -18,6 +18,7 @@
#include "key.hpp"
#include "language.hpp"
#include "show_dialog.hpp"
#include "util.hpp"
#include "video.hpp"
#include "widgets/button.hpp"
@ -25,6 +26,10 @@
#include <sstream>
#include <vector>
namespace {
const int min_room_at_bottom = 150;
}
void show_intro(display& screen, const config& data)
{
//stop the screen being resized while we're in this function
@ -35,10 +40,10 @@ void show_intro(display& screen, const config& data)
gui::button next_button(screen,string_table["next_button"] + ">>>");
gui::button skip_button(screen,string_table["skip_button"]);
next_button.set_x(700);
next_button.set_y(500);
skip_button.set_x(700);
skip_button.set_y(550);
next_button.set_x(screen.x()-200);
next_button.set_y(screen.y()-150);
skip_button.set_x(screen.x()-200);
skip_button.set_y(screen.y()-100);
const config::child_list& parts = data.get_children("part");
@ -62,14 +67,18 @@ void show_intro(display& screen, const config& data)
dstrect.w = image->w;
dstrect.h = image->h;
if(dstrect.y + dstrect.h > screen.y() - min_room_at_bottom) {
dstrect.y = maximum<int>(0,screen.y() - dstrect.h - min_room_at_bottom);
}
SDL_BlitSurface(image,NULL,screen.video().getSurface(),&dstrect);
textx = dstrect.x;
texty = dstrect.y + dstrect.h + 10;
next_button.set_x(dstrect.x+dstrect.w);
next_button.set_x(dstrect.x+dstrect.w-40);
next_button.set_y(dstrect.y+dstrect.h+20);
skip_button.set_x(dstrect.x+dstrect.w);
skip_button.set_x(dstrect.x+dstrect.w-40);
skip_button.set_y(dstrect.y+dstrect.h+70);
}
@ -195,6 +204,10 @@ void show_map_scene(display& screen, config& data)
dstrect.w = image->w;
dstrect.h = image->h;
if(dstrect.y + dstrect.h > screen.y() - min_room_at_bottom) {
dstrect.y = maximum<int>(0,screen.y() - dstrect.h - min_room_at_bottom);
}
SDL_BlitSurface(image,NULL,screen.video().getSurface(),&dstrect);
update_whole_screen();

View file

@ -849,7 +849,6 @@ int play_multiplayer(display& disp, game_data& units_data, config cfg,
rect.w = 175;
rect.h = 175;
SDL_BlitSurface(mini, NULL, disp.video().getSurface(), &rect);
SDL_FreeSurface(mini);
update_rect(rect);
}
}else{

View file

@ -18,6 +18,13 @@ namespace lobby {
RESULT enter(display& disp, config& game_data)
{
//prevent entry into the lobby if mode is less than 1024x768
//FIXME: the lobby should be fixed properly
if(disp.x() < 1024 || disp.y() < 768) {
gui::show_dialog(disp,NULL,"","You currently cannot enter the lobby with a resolution of less than 1024x768 (we're working on this)",gui::OK_ONLY);
return QUIT;
}
CKey key;
std::vector<std::string> messages;

View file

@ -63,14 +63,15 @@ LEVEL_RESULT play_level(game_data& gameinfo, config& terrain_config,
}
}
std::string gold = (*ui)->values["gold"];
std::string gold = (**ui)["gold"];
if(gold.empty())
gold = "100";
int ngold = ::atoi(gold.c_str());
if(ui == unit_cfg.begin() && state_of_game.gold >= ngold &&
(*level)["disallow_recall"] != "yes")
(*level)["disallow_recall"] != "yes") {
ngold = state_of_game.gold;
}
const gamemap::location& start_pos = map.starting_position(new_unit.side());
@ -376,12 +377,10 @@ LEVEL_RESULT play_level(game_data& gameinfo, config& terrain_config,
}
//add all the units that survived the scenario
for(std::map<gamemap::location,unit>::iterator un =
units.begin(); un != units.end(); ++un) {
for(std::map<gamemap::location,unit>::iterator un = units.begin(); un != units.end(); ++un) {
if(un->second.side() == 1) {
un->second.new_level();
state_of_game.available_units.
push_back(un->second);
state_of_game.available_units.push_back(un->second);
}
}
@ -390,8 +389,7 @@ LEVEL_RESULT play_level(game_data& gameinfo, config& terrain_config,
}
const int remaining_gold = teams[0].gold();
const int finishing_bonus_per_turn =
map.towers().size()*game_config::tower_income;
const int finishing_bonus_per_turn = map.towers().size()*game_config::tower_income + game_config::base_income;
const int turns_left = status.number_of_turns() - status.turn();
const int finishing_bonus = end_level.gold_bonus ?
(finishing_bonus_per_turn * turns_left) : 0;

View file

@ -657,6 +657,7 @@ void turn_info::show_menu()
rename_unit();
} else if(result == string_table["preferences"]) {
preferences::show_preferences_dialog(gui_);
gui_.redraw_everything();
} else if(result == string_table["end_turn"]) {
end_turn();
} else if(result == string_table["scenario_objectives"]) {
@ -1024,7 +1025,7 @@ void turn_info::save_game()
<< " " << status_.turn();
std::string label = stream.str();
const int res = dialogs::get_save_name(gui_,"",string_table["save_game_label"],&label);
const int res = dialogs::get_save_name(gui_,"",string_table["save_game_label"],&label,gui::OK_CANCEL);
if(res == 0) {
recorder.save_game(gameinfo_,label);
@ -1114,6 +1115,11 @@ void turn_info::recruit()
sample_units.push_back(unit(&type,team_num_));
}
if(sample_units.empty()) {
gui::show_dialog(gui_,NULL,"",string_table["no_units_to_recruit"],gui::MESSAGE);
return;
}
const int recruit_res = gui::show_dialog(gui_,NULL,"",
string_table["recruit_unit"] + ":\n",
gui::OK_CANCEL,&items,&sample_units);

View file

@ -105,8 +105,8 @@ std::pair<int,int> resolution()
const string_map::const_iterator y = prefs.values.find("yresolution");
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()),1024),
maximum(atoi(y->second.c_str()),768));
std::pair<int,int> res (maximum(atoi(x->second.c_str()),800),
maximum(atoi(y->second.c_str()),600));
//make sure resolutions are always divisible by 4
res.first &= ~3;
@ -122,9 +122,9 @@ void set_resolution(const std::pair<int,int>& resolution)
if(disp != NULL) {
std::pair<int,int> res = resolution;
//dimensions must be even
res.first &= ~1;
res.second &= ~1;
//make sure resolutions are always divisible by 4
res.first &= ~3;
res.second &= ~3;
CVideo& video = disp->video();
const int flags = fullscreen() ? FULL_SCREEN : 0;
@ -358,6 +358,11 @@ void show_preferences_dialog(display& disp)
const int width = 600;
const int height = 400;
//make sure that the frame buffer is restored to its original state
//when the dialog closes
SDL_Rect dialog_rect = {xpos-10,ypos-10,width+20,height+20};
const surface_restorer restorer(disp.video().getSurface(),dialog_rect);
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);
@ -579,7 +584,7 @@ void show_video_mode_dialog(display& disp)
}
for(int i = 0; modes[i] != NULL; ++i) {
if(modes[i]->w >= 1024 && modes[i]->h >= 768) {
if(modes[i]->w >= 800 && modes[i]->h >= 600) {
const std::pair<int,int> new_res(modes[i]->w,modes[i]->h);
if(std::count(resolutions.begin(),resolutions.end(),new_res) > 0)
continue;

View file

@ -107,7 +107,6 @@ struct surface_lock
const int res = SDL_LockSurface(surface_);
if(res == 0) {
locked_ = true;
std::cerr << "locked surface\n";
}
}
}
@ -115,7 +114,6 @@ struct surface_lock
~surface_lock()
{
if(locked_) {
std::cerr << "unlocking surface\n";
SDL_UnlockSurface(surface_);
}
}

View file

@ -371,9 +371,6 @@ int show_dialog(display& disp, SDL_Surface* image,
padding_height + button_heights + menu_.height() +
text_widget_height + check_button_height;
if(total_width > scr->w - 100 || total_height > scr->h - 100)
return 0;
int xloc = scr->w/2 - total_width/2;
int yloc = scr->h/2 - total_height/2;
@ -390,16 +387,6 @@ int show_dialog(display& disp, SDL_Surface* image,
unity = yloc;
}
//make sure that the dialog doesn't overlap the right part of the screen
if(xloc + total_width+border_size >= disp.mapx()-1) {
std::cerr << "in if...\n";
xloc = disp.mapx()-(total_width+border_size+2);
if(xloc < 0) {
std::cerr << "dialog is too large to fit on-screen!\n";
return 0;
}
}
const int button_wpadding = total_width - button_widths;
int button_offset = 0;
for(size_t button_num = 0; button_num != buttons.size(); ++button_num) {
@ -675,7 +662,7 @@ TITLE_RESULT show_title(display& screen)
const int menu_xbase = screen.x() - (x + tutorial_button.width() + 20);
const int menu_xincr = 0;
const int menu_ybase = 120 + title_surface->h;
const int menu_yincr = 50;
const int menu_yincr = 44;
int bc = 0; //button count
#define BUTTON_XY() (menu_xbase+(bc)*menu_xincr), (menu_ybase+(bc++)*menu_yincr)

View file

@ -14,6 +14,7 @@
#include "game_config.hpp"
#include "replay.hpp"
#include "team.hpp"
#include "util.hpp"
#include <algorithm>
#include <cstdlib>
@ -107,8 +108,9 @@ team::team_info::team_info(const config& cfg)
team::team(const config& cfg, int gold) : gold_(gold), info_(cfg)
{
//gold is the maximum of 'gold' and what is given in the config file
if(info_.gold.empty() == false)
gold_ = ::atoi(info_.gold.c_str());
gold_ = maximum(gold,::atoi(info_.gold.c_str()));
}
void team::get_tower(const gamemap::location& loc)

View file

@ -39,7 +39,7 @@ SDL_Surface* current_background = NULL;
SDL_Rect get_text_size(const std::string& msg)
{
SDL_Rect area = {0,0,1024,768};
SDL_Rect area = {0,0,10000,10000};
return font::draw_text(NULL,area,font_size,font::BLACK_COLOUR,msg,0,0);
}

View file

@ -143,10 +143,10 @@ const std::string* attack_type::get_frame(int milliseconds, int* xoff,
*xoff = i->xoffset;
}
if(dir == DIAGONAL && i->image_diagonal != NULL) {
return i->image_diagonal;
if(dir == DIAGONAL && i->image_diagonal != "") {
return &i->image_diagonal;
} else {
return i->image;
return &i->image;
}
}
}

View file

@ -70,20 +70,19 @@ private:
struct frame {
frame(int i1, int i2, const std::string& img, int offset)
: start(i1), end(i2), xoffset(offset),
image(&img), image_diagonal(NULL)
: start(i1), end(i2), xoffset(offset), image(img)
{}
frame(int i1, int i2, const std::string& img, const std::string& diag,
int offset)
: start(i1), end(i2), xoffset(offset),
image(&img), image_diagonal(&diag)
image(img), image_diagonal(diag)
{}
int start, end;
int xoffset;
const std::string* image;
const std::string* image_diagonal;
std::string image;
std::string image_diagonal;
};
std::vector<frame> frames_[2];