57238 Commits

Author SHA1 Message Date
Chris Beck
ae5436d565 Merge branch 'add_display_context' 2014-06-10 18:34:09 -04:00
Chris Beck
43ade4615a display uses display_context internally, not 3 private pointers
Also refactor editor and game_display to use this.

To achieve this it turns out we also have to add a "dummy display
context" unique to the editor code, which it can use to initalize
editor display, because after refactor NULL doesn't cut it
anymore. This appears in src/editor/editor_display.?pp, might
want to branch into its own file later.
2014-06-10 18:29:03 -04:00
gfgtdf
35b8730f8c remove random.cpp
this file only contained outdated comments.
2014-06-11 00:19:29 +02:00
gfgtdf
911d9909ff remove old compability code
we aren't able to replay games from 1.2 anyway. (we aren't even able to replay games form 1.10)
2014-06-10 23:53:37 +02:00
Chris Beck
90e5d9206b editor map context implements display_context interface 2014-06-10 17:39:22 -04:00
Chris Beck
d9b3289355 define display_context interface, implement in game_board 2014-06-10 17:16:40 -04:00
Chris Beck
13fca9a358 fixup play_controller initialization order 2014-06-10 17:16:11 -04:00
gfgtdf
99feabf3c4 Merge pull request #200 from gfgtdf/gamestate_refactor
move next_underlying_unit_id + game_state refactor
2014-06-10 23:13:30 +02:00
gfgtdf
42a28bfc32 refactor carryover_info::transfer_all_to
the plan is to fully remove the [side] from [carryover_sides] in this
case, but it needs some testing still.
2014-06-10 21:37:24 +02:00
gfgtdf
469eabb53c make catching at game end optional
for debugging purposes these are annoying since the OS usualy gives a better error message (stacktrace etc) on "crash" than on a catched exception + return.
2014-06-10 21:25:07 +02:00
gfgtdf
a1c859a8c8 removed unneeded catch
the bug that can throw this error was removed some time ago.
2014-06-10 21:20:54 +02:00
gfgtdf
703502e0d3 remove unneeded argument in play_replay_level 2014-06-10 21:10:29 +02:00
gfgtdf
2a17224133 don't transfer carryover in replays
carryover_sides contains no data that wasn't already merged into replay_start.
2014-06-10 21:01:33 +02:00
gfgtdf
1eee975502 don't execute run_in_synced_context in replays. 2014-06-10 21:00:55 +02:00
Boldizsár Lipka
2b7da8fcb4 Move load_from_disk out of image::locator. 2014-06-10 22:39:14 +02:00
gfgtdf
b39601d700 remove outdated comment
there are random calls before "prestart" and we already use "random_new_deterministic" in that case.
2014-06-10 19:24:57 +02:00
gfgtdf
f26f992bf1 move next_underlying_unit_id
from savefiles toplevel to savefiles [snapshot]/[replay_start]/[carryover_sides_start]
previously this was handled specialy at scenario toplevel sometimes and in those tags at some other times.

accoringly to that change we now set n_unit::id_manager at play_controller s constructor.
2014-06-10 19:11:14 +02:00
Chris Beck
5dad318849 Merge branch 'units_draw_const' 2014-06-10 13:03:49 -04:00
Chris Beck
4459277f77 only const unit_map in display, unit_attack fcn uses game_board
This commit makes all the necessary changes to allow
display::get_units() to return a const unit_map rather than non-
const, and to eliminate display::get_const_units(). This allows
us to eliminate a const cast introduced in prior commit.

In leader_scroll_dialog, unit_animation, and some places in
unit_display, we change the call display::get_const_units to
get_units, and mark the return type as const.

In unit_display::unit_attack, we can't do this because that fcn
also calls unit::take_hit which is part of the game logic and
should not become const. We make that function take a reference
to game_board instead and pass resources::game_board from the
caller. Also we pass display in as an argument from the caller,
to improve encapsulation marginally.
2014-06-10 12:59:23 -04:00
Chris Beck
ca01a4be02 facing and hidden become mutable attributes of unit
This is needed to be able to do animation with const units.
2014-06-10 12:58:53 -04:00
Chris Beck
fe92895bd0 display::change_units takes a const argument 2014-06-10 11:35:32 -04:00
gfgtdf
534e3514ee fix unused variable 2014-06-10 17:11:31 +02:00
Chris Beck
76907870dc display object uses a const unit_map * internally
This was made possible because const units may now be drawn and
animated. There are some clients of the display object that still
call display::get_units, which is a non const getter, and which
we support by a const cast. The next step of refactor is to get
rid of that, but in this step we have at least gotten rid of all
internal uses of the non-const unit map.
2014-06-10 09:46:13 -04:00
Chris Beck
16db25b119 unit redraw fcn treats units as const 2014-06-10 09:25:04 -04:00
Chris Beck
829c66e6bc invalidate units fcn treats units as const
Since the relevant functions are const from previous commit.
2014-06-10 09:23:24 -04:00
Groggy Dice
61c8c93698 wmllint: reorganize help into mode options and other options
The organization of Elvish Hunter's wmllint GUI tab suggested this change.
2014-06-10 06:10:16 -04:00
Groggy Dice
5b06aa9205 wmllint: fix substitution that was missing a slash 2014-06-10 06:10:11 -04:00
Groggy Dice
6c12233d3c add janebot to credits 2014-06-10 06:10:03 -04:00
Groggy Dice
8e7581f593 wmlscope: fix mistakes in help and options pointed out by Elvish Hunter
See EH's forum post:

http://forums.wesnoth.org/viewtopic.php?f=10&t=40397#p570438
2014-06-10 06:09:58 -04:00
Chris Beck
390babf184 unit animation fcns become const
This commit makes the main unit animation accessor / mutator
functions applicable to const units, and makes the animation
state member variables mutable to allow this.

const'ed member functions:

set standning
idling
selecting
ghosted
disabed_ghosted
clear_haloes
refresh
invalidate
redraw

mutable member variables:

animation state enum
boost scoped pointer anim_ (can be reset in the redraw fcn)
next_idling_
frame_begin_time_
unit_halo_
refreshing_
draw_bars_

The purpose of this is to improve encapsulation of units, as now
we can use const units in the display functions, and reserve non-
const unit references for use in the game logic.
2014-06-10 01:10:00 -04:00
Chris Beck
2282f6e90a remove unnnecessary location argument from unit::invalidate
This function was always called with the current location of the
unit as the argument, so we simplify it.
2014-06-09 23:55:40 -04:00
Chris Beck
654fd22ba8 pass display as an argument to unit::invalidate
Previously it always used the singleton display function, but this
seems better.
2014-06-09 23:55:40 -04:00
Ignacio R. Morelle
03021c0482 Merge branch 'feature/inspect-copy-paste' 2014-06-09 18:14:25 -04:00
Ignacio R. Morelle
eab3e6fb64 gui2/tgamestate_inspector: Add a button to copy contents to clipboard
This copies the contents of the main display area to clipboard. The
button currently lacks a tooltip because the tooltip causes map labels
to glitch through the dialog when displayed (noticeable in e.g. the test
scenario). I'll file a bug for this issue later using a (commented-out)
line introduced by this commit as a test case.
2014-06-09 18:13:48 -04:00
Ignacio R. Morelle
0e9f18d8eb gui2/tgamestate_inspector: Use write() function for printing WML objects
The write() function from the WML parser is a dedicated WML
serialization mechanism that is also used to write saved games and such,
and thus it will output WML in the same format that the game would
normally use. The config::debug() method we were using here before,
instead, only implements a simplified strategy that will not produce
valid multiline attribute values, for example, or include any textdomain
directives applicable to the contents.

If we are to have a way to copy the inspect window's contents, it should
prove far more convenient for coders to see the generated WML in the
same format as it would normally be saved to disk.
2014-06-09 18:13:27 -04:00
Andrius Silinskas
51a2c0443f Set missing game_classification members for MP Campaigns.
This fixes bug #22134.
2014-06-09 19:43:33 +01:00
fendrin
84baedf4d3 Change unit facing submenu for the scenario editor. 2014-06-09 19:16:52 +02:00
fendrin
11a7b22381 Support for submenues which are associated with a hotkey action. 2014-06-09 19:16:52 +02:00
fendrin
efec080348 Save the facing of the units to the scenario file. 2014-06-09 19:16:52 +02:00
fendrin
03a455e35f Getter for translated names of the hex field directions. 2014-06-09 19:16:52 +02:00
Mark de Wever
b7ef64cb19 Set the minimum size for a listbox cell.
The images drawn for a selected cell require a minimum size.

The change is part 2/2 of the fix for bug #22144.
2014-06-09 19:07:53 +02:00
Mark de Wever
0322918cef Honour the minimum size for a container.
Some containers require a minimum size when they draw on their own
canvas.

The change is part 1/2 of the fix for bug #22144.
2014-06-09 19:06:07 +02:00
Chris Beck
7e9d522232 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-06-09 12:03:55 -04:00
Sergey Popov
311c4d3d48 Merge pull request #184 from techtonik/master
Minor SCons enhancements
2014-06-09 19:48:28 +04:00
Chris Beck
f1d947b879 change throw in destructor to an assert, to silence cppcheck 2014-06-09 11:48:05 -04:00
Chris Beck
02d8d0a07d add warning about memory leaks reported by cppcheck 2014-06-09 11:39:21 -04:00
Mark de Wever
91ea8b103f Use a variable as const ref instead of const.
Issue found by cppcheck.
2014-06-09 15:35:08 +02:00
Mark de Wever
e35f4bb501 Strip trailing whitespace. 2014-06-09 15:26:19 +02:00
Mark de Wever
7efb1ba73b Merge branch 'gamestate_dialogue_improvements'
Improves the gamestate inspection dialogue. It fixes a long-standing
assertion issue and also reduces the amount of redundant work done.

Note the dialogue can still be improved further, but the currently
shown dialogue is /a/ valid way to show its contents.

The merge fixes bug #22095, possibly #15615 and #21785.
2014-06-09 15:12:13 +02:00
Mark de Wever
ea1a6fbe0f Remove redundant window invalidations.
The other commits in this branch make the calls to invalidate_layout()
redundant.
2014-06-09 13:07:03 +02:00