79 Commits

Author SHA1 Message Date
pentarctagon
f0991ec9c1 remove use of the config directory
the credentials and lan config files will now use the userdata folder
2024-07-08 17:42:20 -05:00
Iris Morelle
011e831171 bi: Fix for "unknown" arch issue and enforce the fix
Next time someone attempts to remove Boost.Predef because it looks
"unused", they will at least cause strict CI builds to fail.
2024-05-03 13:45:14 +02:00
shijie.chen
d88ddec6f1
Remove unnecessary header files (#8531)
Co-authored-by: shijie.chen <shijie.chen@goland.cn>
2024-03-12 00:07:48 -04:00
P. J. McDermott
b5d073a2ad Rename src/lua/*.h to src/lua/wrapper_*.h
These will be changed to conditionally include system Lua headers,
e.g. "lua.h", instead of submodule Lua headers, e.g. "module/lua/lua.h".
If a header named "lua.h" includes "lua.h", the build will fail due to
recursion.

This can't be solved using angle brackets to include system headers,
because macos builds won't find them:

    In file included from /Users/runner/work/wesnoth/wesnoth/src/ai/registry.cpp:30:
    In file included from /Users/runner/work/wesnoth/wesnoth/src/ai/composite/aspect.hpp:24:
    In file included from /Users/runner/work/wesnoth/wesnoth/src/ai/lua/lua_object.hpp:25:
    /Users/runner/work/wesnoth/wesnoth/src/lua/lua.h:4:14: error: 'lua.h' file not found with <angled> include; use "quotes" instead
        #include <lua.h>
                 ^~~~~~~
                 "lua.h"

Renamed with (requires GNU sed):

    $ for f in src/lua/*.h; do
    >     git mv "${f}" "src/lua/wrapper_${f#src/lua/}";
    > done
    $ git grep -El -- '#[ \t]*include[ \t]+"lua/[^"]+[.]h"' src | \
    > xargs sed -Ei -- '
    > s|(#[ \t]*include[ \t]+"lua/)(lua[.]h")(            )?|\1wrapper_\2|;
    > s|(#[ \t]*include[ \t]+"lua/)(lualib[.]h")(         )?|\1wrapper_\2|;
    > s|(#[ \t]*include[ \t]+"lua/)(lauxlib[.]h")(        )?|\1wrapper_\2|;
    > '
2024-02-11 23:21:15 -06:00
pentarctagon
970163813d 2024 copyright update 2024-01-20 22:22:23 -06:00
Iris Morelle
a93e89832b
bi: Whitespace fix, no code changes 2023-06-04 16:46:09 -04:00
Iris Morelle
63876485a4
bi: Add libcurl to library version reports 2023-05-20 04:51:14 -04:00
Pentarctagon
c44cc2742e Copyright update.. 2023-04-29 10:48:11 -05:00
Iris Morelle
20e8402ae0 bi: Re-add screen dpi report
This was a casualty of 575286cb8609a913bc6d7788e06647a9f5519325
even though this particular use case is purely diagnostic for
devs reference when handling bug reports.
2023-01-23 20:55:20 +01:00
Iris Morelle
daf126c75d bi: Add SDL renderer report
This includes information on the renderer's name, whether it's
a software renderer or it's hardware accelerated, whether vsync
is enabled, and the maximum texture size.

(The other items in SDL_RendererInfo do not seem particularly
relevant to us right now.)
2023-01-23 20:55:20 +01:00
Iris Morelle
1a430b7ecc bi: Fix --report SIGSEGV caused by uninitialised video
At some point in 1.17.x, the check for whether the game window
was null disappeared. This brings it back by exposing a check
through the video namespace so as to avoid piggybacking further
on the video::get_window() function, which we are meant to avoid
using.
2023-01-23 20:54:06 +01:00
Pentarctagon
fc7c87b765 Show the log directory in the build info on non-windows platforms.
Also moves the last bit of potentially common code from log_windows into the base logger.
2022-10-26 19:13:57 -05:00
Tommy
bef85a51a4 video: Clarify draw_area() -> game_canvas() in almost all cases
Theoretically the drawing area may change if we are rendering to
texture. However the vast majority of cases wanted the game canvas
size independent of whatever the current render target may be.

A function game_canvas_size() was also added returning a point,
and this was used to simplify things where appropriate.
2022-07-24 22:06:33 +12:00
Tommy
68f86eba10 video: Clarify headless and unit test checks and interfaces
* faked() has been renamed headless() to better express its meaning
  - it is true when there is no window or renderer at all
* internal usage of the window pointer has been clarified
  - a window should always exist, unless in headless mode
* non_interactive() has been removed in favour of headless()
  - they are logically identical
* some nomenclature internal to video:: was clarified
  - fake_interactive_ -> testing_
  - fake_size -> test_resolution_
  - init_fake_window() -> init_test_window()
  - make_fake() -> init_fake()
  - update_framebuffer_fake() -> update_test_framebuffer()
* any_fake() was replaced with testing() to check if running tests
* make_test_fake() was removed in favour of set_resolution()
  - the only other use was for init which can be done... in init()

There are now two clear non-standard modes: headless() and testing().

Headless mode has no window or renderer, and hardware rendering
should never be attempted.

Testing mode has a window and renderer, but there are not currently
any tests which use them. Rendering functions may be skipped.
2022-07-24 22:06:33 +12:00
Tommy
7877158b69 video: remove and refactor unnecessary and poor interfaces
* removed clear_screen() - not necessary to do
* removed delay() - inappropriately used, and should not be here anyway
* expose render_screen only to draw_manager - nothing else should do it
* remove read_texture - unused
* split window_has_flags into individual queries:
  - window_is_visible()
  - window_has_focus()
  - window_has_mouse_focus()
* tidied window mode setting code
* removed setup_completed() and has_window() - always true as used
* cleaned video.hpp includes
* deexposed some internal video functions
  - update_framebuffer -> update_buffers(false)
  - make_fake -> unused externally
2022-07-24 22:06:33 +12:00
Tommy
29c82e308a CVideo: Remove CVideo singleton, replacing with "video" interface
The only real change is that in stead of passing around CVideo
pointers and calling things via CVideo::get_singleton().foo()
one simply does not pass around pointers, and calls video::foo().
2022-07-24 22:06:33 +12:00
Tommy
738392069d Fix a whole bunch of bad indentation.
Mostly spaces where tabs should have been used.
2022-06-25 15:24:03 +12:00
Charles Dang
43a1ecc8bd CVideo: minor cleanup
- Removed overload of set_resolution taking two ints
- Removed get_width and get_height in favor of draw_area
- Removed some dead code
- Minor formatting cleanup
2022-06-14 14:48:34 +12:00
Tommy
575286cb86 CVideo: remove get_dpi and get_dpi_scale_factor.
screen_pitch_microns is deprecated, and has been removed from the
GUI_SCALE_RESOLUTION macro in WML. The macro itself has been left in
place for potential future use.

The screen_pitch_microns variable has been left in place, but is now
a constant and will only ever return the default value equivalent to
96 DPI.
2022-06-11 05:56:06 +12:00
Tommy
d130622b96 Initial indirect rendering prototype.
Rendering is now done to a separate surface. All routines that previously
wrote directly to the framebuffer now write to this surface. When the screen
is flipped, this surface is copied directly to a streaming texture, which is
then scaled to the window's rendering surface for display.

This has enabled a drawing resolution that differs from display resolution.
It is active and for the most part works. Input events are converted to the
correct scale by SDL, so most input handling routines can be used unchanged,
but one or two are causing problems so there are some bugs. To test this,
change the "pixel_scale" preference. Don't expect a playable game with
any pixel scale other than 1 yet.
2022-04-18 17:25:06 +12:00
Pentarctagon
1a3498cbf3 Rename nowarn/ to lua/
Also cleanup the includes.
2022-03-09 15:01:37 -06:00
Pentarctagon
dd947db289 Avoid lua build warning without altering source code. 2022-03-09 15:01:37 -06:00
Pentarctagon
340023921d
2022 copyright update. 2022-03-06 19:07:13 -06: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
Iris Morelle
4889769fec bi: Add Lua library version
It *is* a built-in library, but it changes over time. It may prove
useful in future times to be able to readily tell what Lua version is
attached to a particular Wesnoth dev version since it's harder to keep
track of singular releases (e.g. I don't remember which dev release
upgraded us to Lua 5.4 right now).
2021-03-30 20:06:44 -03:00
Iris Morelle
0438df91d2 bi: Don't localize the features table for stderr/clipboard
It's meant for devs anyhow. This also means we need to strip the caret
annotations ourselves but that's actually a trivial operation.
2021-03-30 19:56:47 -03:00
Iris Morelle
8a9e861eb3 bi: Remove tracking of SDL_ttf and FriBidi 2021-03-13 13:51:47 -03:00
Iris Morelle
6260a48e40 bi: Use Boost.Predef to detect and expose the build arch
This commit also adds this information to the startup banner on stderr,
the output of --report, and the Game Version dialog's main UI and
clipboard report.
2021-01-28 15:55:27 -03:00
Charles Dang
6adc9ab76f Bump SDL_Image dependency to 2.0.2 and enable jpg screenshots unconditionally 2020-12-05 09:30:17 +11:00
Iris Morelle
5ab41ee9f9 fs: Un-inline non-trivial blacklist_pattern_list methods
This allows us to drop the hard dependency on <algorithm>, <functional>,
and serialization/string_utils.hpp from filesystem.hpp, which should
make the latter less of a heavyweight include in places that otherwise
don't need those headers.

There are no performance concerns here because the class as a whole is
rarely used in general and never in performance-sensitive code.

This commit also addresses a few side-effects of other files
piggybacking on the filesystem.hpp dependencies.
2020-12-04 13:45:31 -03:00
Iris Morelle
e755bf21dc bi: Add sound configuration to the clipboard report
Also refactored the display driver formatting code since SDL enumerates
audio drivers in the exact same format.
2020-06-16 22:52:02 -04:00
Iris Morelle
5026305da0 bi: Include the list of SDL video drivers in the report
The current driver is highlighted in brackets.
2020-06-16 13:48:23 -04:00
Iris Morelle
e948f156b2 bi: Full refactoring of the clipboard report formatting logic
This makes all sections use a formatter class to deal with the issue of
keeping the first column's width consistent within each section (but not
across all sections), so that we don't run into inconveniences later in
the future if any section's entry labels change. It also allows us to
change the list formatting entirely in a single place rather than
multiple places if we ever decide to do so.

This also replaces CVideo::video_settings_report() with a similar but
slightly more detailed report using the new bi list formatter class to
make it look consistent with the other sections, implemented in the bi
module instead of CVideo.
2020-06-15 22:50:58 -04:00
Pentarctagon
4df1193c11
Add a trailing newline.
Also check that the config was able to be read.
2020-06-12 22:31:43 -05:00
Pentarctagon
9ecfdae09b
Fix for getting the addon versions with --report. 2020-06-12 21:53:04 -05:00
Pentarctagon
ff15419ae3
State if no add-ons installed. 2020-06-10 21:23:30 -05:00
Pentarctagon
177348bdb3 Add installed addons and addon versions to the build report.
This would be useful since often one of the things asked when a user reports issues is if they have any addons installed.
2020-06-10 18:47:26 -05:00
Glen Whitney
11f96b3a98 Add current video settings to the game_config::full_build_report. 2020-05-24 09:49:36 -05:00
Iris Morelle
57ef823750 bi: Make game distribution channel part of the build_info API
This moves the relevant code out of the MP game setup flow into a
dedicated function, so it can also be used in the --report output.

However, it also fixes two bugs we just found out with the previous
code:

 * The channel id was extracted using istream's formatted input
   operator, resulting in everything beyond the very first word being
   skipped.
 * The channel id was expected to be stored in ./data/dist rather than
   <game data dir>/data/dist. This causes issues whenever the process
   working dir is not the game data dir (most notably on X11 when
   launching with distribution-provided .desktop files) because the file
   won't be found.

So now the file is read by swallowing the first line and stripping
whitespace around, as well as using game_config::path (guaranteed to be
non-empty by the time the game makes actual use of this info).
2020-01-26 01:44:15 -03:00
Iris Morelle
7c16ced6d4 bi: The file format's name is JPEG, not JPG
(jpg is the most common file extension, not the format's name.)
2019-11-04 21:40:11 -03:00
Charles Dang
2470984af3 Prepend 'SDL2/' to all SDL includes
This was needed to get the build working with vcpkg's version of SDL, where all the SDL files are
in their own SDL folder. However, our cmake config also has a note saying it was a deliberate choice
to move our SDL files *out* of their SDL2 folder due to certain distros (FreeBSD is mentioned) not
putting the files in said folder in the first place.
2019-07-22 15:35:55 +11:00
Charles Dang
00a1edd149 Convert a bunch more C-style casts I missed in 0dc5656 to static_cast
(cherry picked from commit cb43d8b35fb3e0b9d8d3dd0d802db294e0720c35)
2018-10-28 02:53:11 +00:00
Victor Sergienko
8716b8f9d0 #3634, #3557: Port from iOS: Compile with Apple crypto framework instead of OpenSSL. 2018-10-25 23:20:04 -07:00
Martin Hrubý
96bbebb514 Fix building with Xcode 10 (#3460)
Resolves #3458.

(cherry-picked from commit 50301f84e33d828c39835bc47f04dd1107631960)
2018-10-07 03:24:17 +00: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
ee619b999f Convert a few remaining C-style casts (for char) too static_cast
(cherry-picked from commit ce85c170200aee86ebd0b7a98ef7102a03e62dd5)
2018-10-07 03:23:25 +00:00
Iris Morelle
f818dc17f4 bi: Refactor report headers generation
(cherry-picked from commit ba64a502e1b26bd9ccb679152ebbbef32c8707cc)
2018-10-07 03:20:58 +00:00
Charles Dang
31e6c40653 Removed OpenMP-related code
After some discussion, we concluded that this code was unmaintained, not even used in
some places (display.cpp, units/frame.cpp), leaving the only area that really used it
at all the image surface cache. Considering there was never really a conclusive benchmark
of its benefits and because said surface cache will be used a lot less going forward,
we're just removing it and simplifying everything for everyone.

Closes #1260 since it's now irrelevant.

(cherry-picked from commit 3792612fb759942e6eb5de51364c2cca4ed16b40)
2018-10-07 03:19:30 +00:00
Charles Dang
553cacd88e Moved game version stuff from game_config.hpp to version.hpp
They're still in the game_config namespace but are now in a more logical header.

game_config::version has been replaced with wesnoth_version.str(), save for one case
where it was replaced with wesnoth_version directly (it was a comparison against another
version_info object; no need to compare against a string...).

Also cleaned up a bunch of game_config.hpp includes.

(cherry-picked from commit b8d051cb72e51682d0fc41a3a37442ed7ecb553d)
2018-10-07 03:18:49 +00:00