42 Commits

Author SHA1 Message Date
Iris Morelle
4b1faf1a5a
Remove support for writing BMP screenshots
This is redundant now that PNG support is part of SDL_image and
therefore always available to us on supported configurations. BMP files
are horribly expensive to store.
2021-10-21 16:29:25 -03:00
Pentarctagon
57ce449af8
Re-add attribution to copyright notices.
These are mostly useless and outdated/wrong, but apparently it's probably illegal to remove them.
2021-07-27 20:21:38 -05:00
Pentarctagon
ba75e1af50
Copyright update.
This additionally:
* Makes all copyright notices identical aside from the starting year for Wesnoth-specific source files. Files not included: mariadbpp, lua, spirit po, xbrz, and bcrypt (crypt_blowfish).
* Removes all attribution from the files, since the vast majority of them are outdated or seemingly just outright incorrect. For example, I would guess that Dave is no longer the sole author of the majority of Wesnoth's current code.
2021-07-26 11:38:03 -05:00
Charles Dang
2c06bd1e35 Cleaned up remaining cases of spaced closing template brackets 2021-01-07 21:43:08 +11:00
Steve Cotton
b63b8a959a Convert the editor_action framework to use std::unique_ptr instead of raw pointers
When returning std::unique_ptr instead of raw pointers, the return type can't
be a co-variant, which is why the clone() functions are all being changed to
return the base class.

All of the instances of editor_action_ptr were replaced, except those in
commented-out code. Many of these replacements were with the `auto` keyword;
for the others the reason that I didn't use editor_action_ptr was that I find
`std::unique_ptr<editor_action>` quicker to read than remembering if
editor_action_ptr is a unique_ptr, a shared_ptr or a plain raw pointer.

A large amount of commented-out code in mouse_action_item.cpp and
mouse_action_unit.cpp gets removed, but the commented-out code in
action_item.cpp is left for a future refactor. I think the classes in these
files should end up being refactored with the responsibilty for putting items
on the map moving from mouse_action_item.cpp to action_item.cpp, leaving only
the parts specific to the input method in mouse_action_item.cpp. However,
that's for a separate commit (and separate PR).
2020-11-20 11:51:08 +01:00
gfgtdf
93aa2ca409 deploy new game_config_view object
the game_config_view object offers const
access to the game_config object, furthermore
it allows the game_config config object to be
replaced by a vector of config objects which
is what we will do later.
2020-06-29 15:16:05 +02:00
Victor Sergienko
aedc081b2e iOS: Touch interface implemented, and a RMB emulation of such on PC. 2018-10-28 18:21:53 +02:00
Martin Hrubý (hrubymar10)
674fda85b7 Migrate links to https if available - Fwd c18537edc0678f40a209797d72dfaba3e5e88545
(cherry-picked from commit bc4d22dc72e79c3d6a3364ac896e473afd298246)
2018-10-07 03:23:36 +00:00
Charles Dang
f46e217454 Stop passing a milion game_config refs around during game initializaton
There are only 3 places where it's actually really needed. Used the game_config_manager
singleton to retrieve a reference in those cases.

(cherry-picked from commit 4eee386664b66e801bd4498e8730c017af03f0aa)
2018-10-07 03:22:55 +00:00
Jyrki Vesterinen
75b50979b6 Fix #2657: inability to scroll diagonally with keyboard
Regression from commit ecc0dca665737bcb411fbd355edd37df8a9038b8.

Scrolling diagonally requires holding two keys. Now when a key press event
is considered a key press only if there hasn't been a key release in
between, the second key press is no longer considered a key press.

As a workaround, simply activate scrolling on key event even if the event
isn't considered a key press.
2018-03-15 19:33:32 +02:00
Jyrki Vesterinen
ecc0dca665 Don't consider input events as keypresses without release in between
When the player holds a key down, the OS generates multiple key press and
text input events. We can't assume that every such event is a real key
press; instead, we need to track whether there has been a key up event
since we last sent a key press event.

Fixes #1711.

I also moved hotkey::execute_command() into the hotkey::command_executor
class, and renamed the existing member function of same name to
do_execute_command(). I did that because the command_executor class was
the best place to store the "press event already sent" flag.
2018-02-27 19:04:50 +02:00
Charles Dang
e270a7c665 Formatting cleanup: > > to '>>`
Allowed since C++11. Might as well use it everywhere.
2018-02-21 12:11:21 +11:00
Gregory A Lundberg
b5f76eff79
Bump copyright to 2018 2018-01-19 00:02:20 -06:00
Charles Dang
9dd497db4a Cleaned up the mess of CVideo references passed around the game initialization process
Essentially, we had CVideo arguments being passed down this chain:
- game_launcher
- free-standing MP initialization functions
- campaign_controller
- playsingle_controller/playmp_controller
- play_controller
- game_display
- display

And likewise down through
- game_launcher
- editor_controller
- editor_display
- display

With only a minimal number of actual calls along the way. :| There were maybe... two remaining?

This removes the CVideo arguments and class members from both chains (except of course, game_launcher.
That's where the "real" CVideo object lives).

The display class now initializes its CVideo reference from the singleton, which is also used in the
very few other places it's needed. I also replaced a check for a null video ptr in show_tooltip()
with a faked() check (see src/tooltips.cpp). That seems to make more sense, since CVideo is never
null now.
2017-11-21 02:30:19 +11:00
Charles Dang
2101353d36 Convert include guards to the shorter #pragma once
Turns out I mistook @celticminstrel's opinion that we should use include guards over pragma (737916e).
Since all major compilers support `#pragma once`, there's no reason not to use it.

For future mergability reasons, this excludes src/spirit_po and src/xBRZ. It also excludes src/boost-patched.
2017-05-09 19:41:37 +11:00
Celtic Minstrel
86505e58a4 Revert "Revert an unnecessary part of 7d2d100"
This reverts commit 42cb55fa24ca79b43d3a5fc7f29841fce77eea34,
which broke generated menus in the editor due to changing the signature
of a method that was overridden from two superclasses.
2017-04-24 12:17:20 -04:00
Charles Dang
4656cbfd51 Editor Controller: add getter for current map context 2017-04-24 16:25:46 +11:00
Charles Dang
42cb55fa24 Revert an unnecessary part of 7d2d100
I realized the the theme menu class doesn't contain the *parsed* data - which should indeed be in a config -
it only contains the *ids* of the menu's contents. Therefor, there's no need to store the list of ids in a config,
since it would only have one entry. A string is therefor sufficient.

To enable the input and output vectors being different types, I cleaned up the output initialization loop in
controller_base::show_menu
2017-04-22 14:13:15 +11:00
Charles Dang
7d2d100cf8 Convert menu item handling to the new vector-of-config method
This matches removes the need for end-conversion to config right before the menus are shown.
2017-04-22 06:29:22 +11:00
Celtic Minstrel
b4dc11ce36 Belated 2017 copyright update 2017-03-19 10:05:38 -04:00
Charles Dang
f11fa0652a Delete copy and move constructors instead of inheriting from boost::noncopyable 2016-11-30 09:20:02 +11:00
JaMiT
44741dc36d Add some const, virtual, and override qualifiers
Also a new non-const version of a wrapper.
2016-09-05 00:23:40 -05:00
JaMiT
a6d23581e1 Return mouse_action by reference instead of a not-null pointer
Plus the implementation of a previously-declared wrapper function
to get said mouse_action.
2016-09-05 00:23:40 -05:00
Celtic Minstrel
0b15dfd0fc Add many missing override annotations
This mainly fixes cases caught by -Winconsistent-missing-override,
so there are doubtless still many missing ones.
2016-09-04 16:07:55 -04:00
Charles Dang
05092ba2f6 Refactor most boost pointer related stuff to use their stdlib counterparts
This constitutes drop-in replacements for:

* boost::shared_ptr
* boost::scoped_ptr
* boost::weak_ptr
* boost::enable_shared_from_this
* boost::static_pointer_cast
* boost::dynamic_pointer_cast

This excludes boost::intrusive_ptr, except for stray includes. Refactoring that is more complicated.
2016-07-25 09:28:42 +11:00
gfgtdf
1e088d9a50 add remove button to location palette 2016-06-17 19:33:39 +02:00
Ryan Roden-Corrent
94e390c067 Gracefully handle multiple scrolling hotkeys.
Track whether each scroll direction is enabled separately.
This avoids odd behavior when holding multiple hotkeys for the same
scroll direction.
For example, holding two hotkeys for right and releasing both will no
longer cause the map to begin scrolling left.
2016-04-05 20:51:33 -04:00
Ryan Roden-Corrent
419bf799ac Handle scrolling hotkeys in editor. 2016-04-05 20:51:33 -04:00
Celtic Minstrel
3ac7f8d970 NULL -> nullptr
A few cases of NULL were missed, since changing them led to errors
(Mainly instances where it was passed to a boost::function)
2016-03-31 00:42:38 -04:00
Charles Dang
d2bec9ec9d Refactored out preferences display manager 2016-03-21 10:11:35 +11:00
Charles Dang
83ee4f6087 Convert most includes to src/-relative
This excludes includes that need backtrack path specifiers in order to resolve
name clashes.
2016-03-19 19:35:17 +11:00
gfgtdf
0484fdd414 fix quit confirmation promt in editor
previously it showed the default "do you want to quit the game" message
when leaving the editor. using the red cross in the corner.

This also changes some dublication of the "Do you really want to quit?"
translatable string in the c++ code.
2016-02-23 20:35:54 +01:00
gfgtdf
75659ba9e2 fix editor buttons 2016-01-13 17:15:24 +01:00
gfgtdf
8680ce45c6 remove display dependency from hotkey::command_executor
command_executor_default which is used ingame and by the editor now
handles display related stuff. (map screenshots, zoom...)

this also removes a hotkey::basic_handler form titlescreen which didn't
work anyway becasue it didnt pass a hotkey_executor.
2016-01-12 23:17:57 +01:00
gfgtdf
a953848dda remove display dependency from show_help()
help_button still needs a display& for regierting it in the hotkey code.
2016-01-12 23:17:56 +01:00
Chris Beck
ba51524f6e update copyright to year 2016
using this shell script:

find src -type f -print0 | xargs -0 sed -i "s|Copyright (C) \([[:digit:]]*\)\([ ]*\)-\([ ]*\)2015|Copyright (C) \1\2-\32016|g"
2016-01-02 23:59:31 -05:00
Ignacio R. Morelle
25a5facce3 editor: Add Recent Files menu with recently loaded/saved files
File paths are recorded into the game preferences up to a (currently
hardcoded) limit of 6 and opening or saving maps adds or bumps existing
entries to the top. We may allow users to change the MRU limit in
Advanced Preferences in a later commit.

Adds two translatable strings.

In order to fit file paths in the menu without filling up the whole
screen sideways, we use only the file names for now. Because identical
file names could prove to be an actual issue later, I intend to look
into ellipsizing paths correctly in a later step.

(Note that I'm piggybacking on the crummy submenu support we already had
in the themable UI so that this can be safely backported to 1.12. It's
decidedly not optimal usability-wise, but it'll have to do for now.)
2015-10-09 19:47:38 -03:00
Ignacio R. Morelle
57ae45387a New Year copyright update 2015-01-01 19:07:35 -03:00
Chris Beck
449204f35e controllers: allow hotkey handlers to be defined separately
Instead of inheriting from hotkey::command_executor,
controller_base now returns a pointer to a command_executor.
With current implementations all controllers return this, but in
some cases it may be simpler to have a separate small class for
this.
2014-12-20 23:07:01 -05:00
Chris Beck
0459f8a574 make "reports" not a singleton object
This is necessary to make game_events not a singleton.
2014-12-13 01:28:57 -05:00
Chris Beck
a02235a567 move the help browser files into their own folder
This is the start of a refactor to make all the help code more
easy to follow.
2014-11-11 01:24:44 -05:00
fendrin
e98237b11c Moved the editor controller into a new subdirectory.
This is the first step of a major refactoring of the editor code tree.
2014-10-09 18:27:28 +02:00