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|;
> '
This was a casualty of 575286cb8609a913bc6d7788e06647a9f5519325
even though this particular use case is purely diagnostic for
devs reference when handling bug reports.
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.)
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.
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.
* 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.
* 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
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().
- 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
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.
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.
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.
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).
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.
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.
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.
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).
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.
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)
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)