Commit graph

49 commits

Author SHA1 Message Date
Charles Dang
34e065e011 Tests: removed another empty file I missed in c93aebb1de
Its contents were also removed when SDL 1.2 was dropped.
2017-11-27 09:47:45 +11:00
Charles Dang
c93aebb1de Tests: removed empty files
These were emptied out when SDL 1.2 was removed (358bd1235f). I seem to recall
someone saying it might be worth keeping them around in case something needed to be put
back, but it's been a year and a half. Not much worth in keeping empty files.
2017-11-27 09:42:14 +11:00
Alexander van Gessel
669ba885ce Add make_unit_ptr functions in separate header, to avoid inclusion of unit.hpp 2017-11-19 17:50:47 +01:00
Charles Dang
378b9199ae Moved point wrapper out of GUI2 namespace
I'm not sure if it should become part of the sdl namespace, but for now I'm leaving it out.
2017-11-11 21:49:05 +11:00
Gregory A Lundberg
d091391899 Renamed the target and binary for the Boost unit tests from test to boost_unit_tests
This quells warnings from CMake about reserved target names, and reduces confusion about which `test` is intended: the wesnoth executable or the standard shell command.
2017-11-06 20:32:27 +02:00
Charles Dang
b1ad293ccd GUI2: removed unused MP Command Wrapper dialog
This was the equivalent of the Player Info dialog for the old GUI1 MP Lobby, and is now unused.
The new GUI2 lobby uses the aforementioned Player Info dialog. The functionality is basically
the same, though, except the send-private-message interface is more streamlined in the new lobby.
2017-10-29 16:56:16 +11:00
gfgtdf
e9c6dff56a Slider refactor
1) We now use a single function to set slider min/max value, this fixes #1641
   (sliders having a temporary invalid (min > max) state between set_min() and
   set_max() calls)
2) I split the sliders_base class from the scrollbar_base class to not
   accidently break the rather complicated scrollbar_base class while
   refactoring sliders.
3) We don't use floats in the slider code to make sure no rounding errors happen.
4) This fixes #1539 by removing slider::in_orthoginal (which made it impossible
   to pull a slider to its maximum/minimum) and intead clamping the mouse
   position in range.
5) This fixes #1656 and #1767 by refactoriung code (that bug happend mainly
   because the old code used variables that contained the position in 'steps'
   as pixel position and vice versa)
6) Sliders now 'snap' to the correct values just like the gui1 sliders did.
7) Slider positions are now poperly rounded to its neariest values
   instead of just beeing 'floored'
2017-10-29 01:13:48 +02:00
Gregory A Lundberg
f7bea59fe9 Finish switch to MT19937 for randomness
Coverity has been complaining about using rand() as an insecure function. As we're using it, this function is not insecure; but is also not a very good RNG. We're using MT19937 in a system-independant manner. But some uses of rand() were never converted. This converts them.

This closes the following Coverity issues:

CID 1356297
CID 1356299
CID 1356303
CID 1356304
CID 1356306
CID 1356312
CID 1356314
CID 1380163
CID 1380173
CID 1380179
CID 1380191
CID 1380198
CID 1380201
CID 1380210
CID 1380214
CID 1380215
CID 1380219
CID 1380230
CID 1380241
2017-10-26 09:28:24 +11:00
Charles Dang
f2593034a8 GUI2: moved MP Lobby and Player Info files into the multiplayer dialog subdir 2017-10-20 16:36:18 +11:00
Ignacio R. Morelle
28c5179636 campaignd: Add wrapper for atomic commits of crucial files
As the 2016-10-07~09 downtime incident shows, it is paramount to take
further steps in guaranteeing that the server can't corrupt its own data
files (especially the add-ons database) when receiving
inappropriately-timed signals.

This commit adds and deploys an ostream wrapper that requires callers to
explicitly commit the results to disk when finished writing to the
stream, so that only then the real destination file is overwritten with
the working copy (a temporary in the same dir). This way, there should
never be a situation in which the destination is left in an inconsistent
state due to a signal or exception.

The temporary receives a predictable name right now in the interest of
simplicity, since we are more or less in control of the target directory
anyway. We definitely don't want it to be an unlinked file since that
would make it impossible for admins to inspect and compare the temporary
against the original afterwards.

The code makes some assumptions about the nature of the return value of
filesystem::ostream_file() which will never be broken in this stable
branch, which is why one helper function is in campaignd land rather
than in the global filesystem API for now. This should probably be
rectified when forward-porting to master. Maybe.

Nothing of this will work reliably on Windows but we don't care. There's
only one machine in the world where we support running campaignd at this
time and it runs Linux.
2017-09-14 20:14:08 -03:00
Celtic Minstrel
658bbbf1da fixup Travis compile 2017-08-14 22:05:29 -04:00
Celtic Minstrel
25a0d099a9 Enable sorting campaign list in chronological or lexicographical order 2017-08-14 12:36:07 -04:00
Celtic Minstrel
4bd1fa7157 Allow filter formulas to use a number of previously FormulaAI-exclusive functions 2017-06-24 19:07:53 -04:00
Jyrki Vesterinen
56433d12a3 Merge branch 'login_save_crypt' 2017-05-22 20:10:09 +03:00
Charles Dang
246ea98dd9 GUI2: moved common swap_grid util function into new widget_helpers file 2017-05-22 14:50:16 +11:00
Charles Dang
1ea8e0f05c Renamed wmi_container to wmi_manager
Since it's not a container anymore, it shouldn't be called such.
2017-05-19 06:50:57 +11:00
gfgtdf
13b00f73ff move config::attribte_value out of config.?pp
this has 2 advantages:
1) we can now forwaed declare the class config_attribute_value without
including config.hpp
2) the config.?pp files are a little easier to read.
2017-05-15 02:27:18 +02:00
Celtic Minstrel
c9191c9812 Add OpenSSL's libcrypto as a dependency
This also removes the included SHA1 and MD5 implementations
in favour of those from OpenSSL.

Thanks to @jyrkive for helping to get the CMake build working and
ensuring the game still compiles with OpenSSL 1.1.0.
(The SHA_xxx() aliases were removed in OpenSSL 1.1.0.)
2017-05-12 15:57:13 -04:00
Celtic Minstrel
9365538b3b Don't store the user's password in plaintext in the prefs file
The game now supports @ or = in usernames for the purpose of saving them to a file.

Though I don't think these are allowed currently, it's probably better to
support it from the start rather than having things break if they later
become allowed.
2017-05-12 15:56:41 -04:00
Charles Dang
ad4f6b122d Rename animated_game.cpp -> animated.cpp
Makes it clearer which header it's a companion to.
2017-05-11 21:17:54 +11:00
Charles Dang
194b5ef17d Removed unused help_button class and its associated GUI1 components
Looking at this more I realized the help_button was a GUI1 dialog component meant to open the Help
dialog. Since all dialogs invoking Help now use GUI2, there's no need for this class anymore. It
also allows a bunch of remaining GUI1 stuff to be cleaned up.
2017-05-10 10:50:46 +11:00
Charles Dang
e4f03fe459 Moved all preferences source files into a single folder 2017-05-04 11:04:19 +11:00
Charles Dang
e97b992393 Storyscreen: split common WML parsing code into a helper class 2017-05-03 20:07:03 +11:00
Charles Dang
b0f91e7d2e GUI2: removed unused Campaign Settings dialog
This was a dialog used early in 1.13 during the SP/MP codepath unification to configure certain options.
The modification selection is now built into the Selection dialog, and we decided not to enable other options
like Era selection in SP. The only option we might look to restoring in the future is the "show_connect"
option, but that requires some additional code elsewhere and probably won't be used anyway.
2017-04-30 21:15:39 +11:00
Charles Dang
47d77c79d4 Story Viewer: delegate storyscreen controller creation to dialog
I left the controller passed in an argument for compatibility with the GUI1 dialog, but since that's removed
it makes sense that the dialog handle the creation of the controller, especially since due to an oversight
it made a copy instead of holding a reference.

This also allows storyscreen/interface.*pp to be removed. The START_POSITION was part of the GUI1 implementation
and isn't needed anymore.
2017-04-30 16:46:53 +11:00
Celtic Minstrel
6906ced4e7 Properly port [music] to Lua 2017-04-27 17:09:03 -04:00
Charles Dang
d8ed11c2b1 Drop the _new suffix from random_new
The 'old' random code has long been removed.
2017-04-20 08:48:47 +11:00
Charles Dang
337ef03120 Removed GUI1 Storyscreen 2017-04-19 15:21:06 +11:00
Charles Dang
55e295a801 Updated source listings for 1793133 2017-04-16 17:08:51 +11:00
Charles Dang
dec0fd6dfd Convert outro screen to GUI2
It's the screen that shows 'The End' at the end of an SP campaign.
2017-04-09 21:37:16 +11:00
Charles Dang
dec492d6dc Renamed variable_private.*pp to better reflect its role 2017-04-02 16:59:26 +11:00
Charles Dang
99874f4253 Refactor variant class
This splits the handling of each applicable type into its own helper class to better encapsulate the functionality of each.
It also contains a lot of related cleanup and improvements to the class interface itself.
2017-04-02 16:59:19 +11:00
Charles Dang
1cf90d02d6 Initial implementation of GUI2 story viewer 2017-03-24 11:42:13 +11:00
Charles Dang
3281df4e2f Base framework for GUI2 Help Browser 2017-03-23 22:58:37 +11:00
Charles Dang
8090a2f333 Removed GUI1 Attack Predictions dialog
The GUI2 version still needs a few tweaks, but I'm working on it.
2017-03-22 02:32:32 +11:00
Charles Dang
18a7e80243 Removed GUI2 Addon Description and Filter Options dialog
These have been rolled into the new GUI2 addon manager.
2017-03-17 08:52:01 +11:00
Charles Dang
581aba7e9d Hotkey Bind: enable dialog and remove old GUI1 code 2017-03-15 22:19:42 +11:00
Charles Dang
e7cdb76a01 GUI2: basic dialog definition for a Hotkey Bind dialog (not enabled)
Still need to determine proper event handling.
2017-03-15 09:48:39 +11:00
Charles Dang
12a18e9f74 So this is where that listing was (fixup c912f7e) 2017-03-07 22:31:47 +11:00
Charles Dang
dec7c30644 Removed GUI1 scrollpane class
Not sure when this became unused, but it is now.
2017-02-19 01:14:02 +11:00
Jyrki Vesterinen
678a21b4fe Replace the 'Install Dependencies' dialog with a GUI2 version 2017-02-02 21:44:15 +02:00
Jyrki Vesterinen
575326c74d Move linked group definition to a shared location
@Vultraz suggested this change.
2017-01-31 20:29:02 +02:00
Jyrki Vesterinen
dc71d9d671 WIP: make the add-on list a widget
The purpose of this change is ability to create more dialogs which present
a list of add-ons, such as a GUI2 version of the "Install Dependencies"
dialog.

This change is still highly incomplete. First of all, I disabled inline
install buttons and ability to sort the add-on list. In addition, a lot of
functionality that belongs in the add-on list widget is still in the GUI2
add-on manager instead. It is also notable that the widget relies on
several linked groups being defined in the window.

I plan to finish the transition to the add-on list widget, and address the
problems in the previous paragraph, in the future. The linked group issue
is going to require a lot of work in particular: I plan to either make
linked groups grid-specific instead of window-specific (like they are now)
or allow widgets to inject linked groups to the containing window. Either
way, I'm going to change the operation of GUI2 fairly deeply.
2017-01-21 22:57:51 +02:00
Jyrki Vesterinen
fc928d6841 Renamed manager_old.hpp back to manager.hpp
There isn't anything obsolete in manager.hpp.
Hence having _old in its name is unnecessary and misleading.
2017-01-12 20:34:23 +02:00
Celtic Minstrel
5432f99c79 Move tag.?pp into serialization directory 2016-12-18 23:24:08 -05:00
pentarctagon
9f79398ecf Deletes unused, unbuildable tools
Deletes create_images, cuter, exploder, schema_generator, schema_validator, and wesmage
2016-12-18 23:07:11 -05:00
Charles Dang
fc91f5df10 GUI2: initial basic implementation of a GUI2 Attack Predictions dialog (WIP) 2016-12-18 11:10:24 +11:00
Charles Dang
28d56206bc Removed strftime.*pp 2016-12-18 09:54:08 +11:00
Pentarctagon
5b29805554 Have cmake and scons use same lists of source files (#882)
* Use separate files to build scons and to build lua for cmake

Move lists of source files into their own directory
Make scons use the lists of source files
Move lua build step to src/SConscript and delete src/lua/SConscript
Make cmake use the separate file with the list of lua sources to build

* Finish changing over to source lists

scons
  move source files from libraries that don't appear in cmake over to existing source lists - libcampaignd, libcutter, libdummy_video, libtest_utils
  add the defines FIFODIR and WESNOTH_PATH to all compiled source files, as cmake does, and move the single files those defines had previously been defined on into the source lists
  remove WESNOTH_PREFIX, as not used
  added schema_validator sources from cmake
  added OBJPREFIX to - cutter, exploder, campaignd, schema_generator, schema_validator
cmake
  change over to using the source lists
  move source files from libraries that don't appear in scons over to existing source lists - wesnoth-gui_types, wesnoth-gui_event, wesnoth-gui_iterator, wesnoth-gui_placer, wesnoth-gui_tooltip, wesnoth-gui_widget, wesnoth-gui_widget_definition, wesnoth-gui1_widgets, wesnoth-schema_validator
2016-12-15 15:51:29 -05:00