69 Commits

Author SHA1 Message Date
Mark de Wever
e35f4bb501 Strip trailing whitespace. 2014-06-09 15:26:19 +02:00
Boldizsár Lipka
ac96a2b91b Move some functions to sdl/rect. 2014-06-03 10:30:12 +02:00
Chris Beck
3c9844889b Make sure all error logs flush with std::endl, so we get on travis.
This is the result of running this command in directory src/

find . -type f -exec sed -i 's/\(ERR.*\)\\n\"\;/\1\" << std::endl\;/g' '{}' \;

and carefully inspecting the results.
2014-05-20 15:37:52 -04:00
Chris Beck
c5838b9513 inline the definition map_location::null_location
If we decided it was worth it to inline map_location ==, then
surely this is also worth it to inline null_location, as the
compiler may be able to reduce tests for == null location to
"x == ... && y == ...", without having to move to a different
compilation unit.
2014-05-20 10:42:13 -04:00
Boldizsár Lipka
821b009948 Support SDL2's mouse wheel event in mouse_handler_base.
Allows to scroll the map with the wheel.
2014-03-14 22:00:22 +01:00
Mark de Wever
49b2a04e38 Disable some code for SDL2.
The code doesn't compile for SDL2 and it seems a work-around for an
issue in SDL, so maybe it is no longer required with SDL2. This needs to
be tested later.
2014-03-02 11:10:30 +01:00
Ignacio R. Morelle
b7848663bd Revert most of c1374ba032a06510e741f0944547dfeb655edadd
Commit c1374ba032a06510e741f0944547dfeb655edadd for some reason reverted
commits 4a44369d8ab01feb69bee0875d659fe7bd086970 and
91cbc9aff14c6290071e6d317024cd4ebf24917d.
2014-02-19 23:12:15 -03:00
ln-zookeeper
c1374ba032 Clarified 'Evacuation' now taking place at Lake Vrug. 2014-02-20 00:56:39 +02:00
Ignacio R. Morelle
4a44369d8a theme ui: Implement [theme] id= attribute, defaults to name=
[theme] id specifies the internal theme id used by the engine to match
the theme definition against the recorded user settings. Existing themes
are still handled by using the name attribute if it's present when the
id is not, and a deprecation warning is issued in that case.

The name attribute is expected to be translatable for UI usage, whereas
the id attribute is not. (See also: [unit], [unit_type], etc.)
2014-02-19 08:53:49 -03:00
Ignacio R. Morelle
a4f47a63c7 New Year copyright update 2014-01-01 02:08:52 -03:00
anonymissimus
713a183805 avoid a compile error
(ambiguous call of overloaded function)
2013-12-23 18:37:56 +01:00
David Mikos
74de4fd1ff Make some middle click scrolling variables const 2013-12-22 10:53:40 +10:30
David Mikos
4aff27342d Better handle middle click scrolling event orders of down and initial click 2013-12-22 10:32:16 +10:30
Ignacio R. Morelle
e6c2e9ad18 Fix NULL pointer dereference when middle-click-scrolling in the editor
From commits 36b6b60beb507a1277de59691da051d4a2f75171 and
d04f6af930b18a740c7fccd0ee91d0e635f288e5 (paraphrasing):

  map_location original_loc = resources::controller->get_mouse_handler_base().get_scroll_start();
  .
  .
  .
  if (point_in_rect(mousex, mousey,rect) && resources::controller->get_mouse_handler_base().scroll_started()) {
  .
  .
  .

When in the game map editor, resources::controller is set to NULL since
it is only intended to refer to a play_controller object. But there's no
need to look specifically for a play_controller in this code or get the
current pointer to a controller_base subclass since the pointer we need
is actually none other than 'this', which is always non-NULL.

(get_mouse_handler_base() is a method of the same class the faulty
handle_scroll() method is, controller_base. There are no derived classes
of it other than play_controller and editor_controller, and there is
only supposed to be one such instantiated at a time, so the fix is
trivial.)
2013-12-21 14:13:09 -03:00
David Mikos
d04f6af930 add check to see that middle click scrolling variables are fully intialized 2013-12-22 01:53:44 +10:30
David Mikos
120f2011f3 Add snap horizontal/vertical to middle click scrolling and tweak speed. 2013-12-22 01:43:34 +10:30
David Mikos
36b6b60beb Make middle click scrolling based on movement distance not screen centre. 2013-12-21 22:28:59 +10:30
fendrin
34173e19c6 Made hotkey datastructure references constant.
This is just to get everything right, those objects don't need to get
manipulated in any way by code outside of the hotkey scope.
2013-12-10 14:42:27 +01:00
fendrin
4b16c1fa30 Reverse order of context menu and hotkey handling. 2013-11-27 02:16:17 +01:00
gfgtdf
a208620cf0 added hotkeys for wml menu items, step1 (changes in game_events.cpp missing) 2013-08-31 01:43:04 +02:00
fendrin
8083801e67 Reduced the show_menu methods to a single one.
This fixes a warning about overriden methods...
2013-05-19 21:59:53 +02:00
fendrin
dd7a497db1 Automagic Button State System. 2013-04-29 17:51:37 +02:00
Eric S. Raymond
043c4f9fd3 Remove $Id$ cookies. 2013-03-26 21:41:37 -04:00
Mark de Wever
074f6432a4 Fixing a comparison with the wrong member.
Discovered while looking at SDL 2.0 code.
2013-03-02 21:17:22 +00:00
Mark de Wever
43b71f2ff0 New year copyright update. 2013-01-01 09:22:03 +00:00
J. Tyne
cbe4941089 Remove no longer useful function post_mouse_press(). 2012-11-26 01:12:27 +00:00
Baihua Jie
f977886bd6 Uniformize const declaration for ticks and num_turns...
...over controller_base, play_controller and replay_controller
2012-11-14 06:47:08 +00:00
Fabian Müller
2e62d8258e Refactored the hotkey handling.
Several hotkeys (keyboard, joystick and mouse buttons) can be assigned
to the same function.
2012-09-19 05:47:52 +00:00
Sergey Popov
6b6eafb213 Use BOOST_FOREACH directly instead of #define foreach BOOST_FOREACH
The define is extremely unreliable, will break compile with boost >=
1.50 and upstream can't fix issues with it, see
https://svn.boost.org/trac/boost/ticket/6131
2012-07-07 00:49:45 +00:00
Ignacio R. Morelle
6ca69b2df5 New year copyright update 2012-01-07 02:35:17 +00:00
Fabian Müller
a2009b15e0 Cleanups to the joystick support. 2011-06-24 19:53:07 +00:00
Fabian Müller
8c616fe491 Added support for joystick hat hotkey binding. 2011-06-23 15:14:20 +00:00
Fabian Müller
6d1e001800 Cleaned up the joystick code.
Introduced a deadzone to avoid random scrolling.

Reduced the map_location::direction enum to the original one.
2011-06-21 15:14:23 +00:00
Fabian Müller
d04fa3be80 Basic Joystick support. 2011-06-20 23:33:10 +00:00
Mark de Wever
8f3ceb39a7 Remove an unused variable.
Not entirely sure whether the e instead of event should have been used,
but the code is there since 2008 an no bug reports. ilor you still might
want to review it.

Fixes a g++ 4.6 warning.
2011-01-16 09:49:08 +00:00
Mark de Wever
ecbabea838 New year copyright update. 2011-01-01 15:57:50 +00:00
Guillaume Melquiond
ab262086f9 Removed unused function controller_base::can_execute_command. 2010-11-07 20:19:57 +00:00
Ali El Gariani
224d4650e1 Clean after previous commit 2010-09-14 05:37:39 +00:00
Ali El Gariani
4497ed996f Big improvement of framerate (often several times bigger here)
by removing an useless 20ms delay between frames, which was stupid
since display::draw has already a smarter one.

PS: cleaning in next commmits, this was just for my "big optimization
in one char" collection :)
2010-09-14 05:37:35 +00:00
Guillaume Melquiond
eeb047de55 Fixed file headers so that they match the content of the COPYING file. 2010-09-01 21:12:38 +00:00
Mark de Wever
1aac317bf5 Remove an unneeded include in a header. 2010-08-29 10:48:31 +00:00
Gabriel Morin
adbc139bf6 Allowed raw handling of key events in play_controller,
...before hotkeys take over.
2010-07-18 05:26:47 +00:00
Ali El Gariani
ef72ecf413 Move tooltips processing to mouse_handler_base 2010-06-04 18:59:14 +00:00
Guillaume Melquiond
d90949d6ce Avoided costly roundtrip through strings. 2010-06-02 19:20:43 +00:00
Mark de Wever
92f5f92ce5 New year copyright update. 2010-01-01 13:16:49 +00:00
Guillaume Melquiond
4ee49a95e6 Used the proper name for the default theme.
Added some error messages. (Fix for bug #15002.)
2009-12-31 10:58:22 +00:00
Mark de Wever
1527e57f64 Remove an unneeded include. 2009-12-05 21:25:08 +00:00
Ali El Gariani
6e0b12e8c0 clean some includes 2009-12-05 00:19:32 +00:00
Guillaume Melquiond
e48c947cd6 Played nicer when the window is hidden. 2009-08-14 08:44:18 +00:00
Guillaume Melquiond
e76e4348c3 Prevented busy-waiting when not actually scrolling. 2009-08-14 08:43:50 +00:00