This adds the command-line option `-c` or `--config` to specify a custom
configuration file.
Co-authored-by: Fabrice de Gans-Riberi <steelskin+github@gmail.com>
Do not link `SDL2main` on any WIN32, not just MSVC.
Define `WIN32_CONSOLE_APP` for Debug mode builds on any WIN32, not just
MSVC.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Remove generated files that are now written to the build dir instead.
Match any build directory from root.
Stop listing submodule and vcpkg.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Fix vcpkg upgrades to work with the current vcpkg master.
When upgrading zlib, remove all optional deps first, because everything
depends on zlib and this can overrun the appveyor 1hr time limit.
Make SFML an optional dep too, like ffmpeg.
Reduce the vcpkg install time limit to 20 minutes, otherwise it may try
to build wxWidgets and ffmpeg and overrun the 1hr time limit.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Make sure git is part of the base package list for Win32 builds.
Move the `git submodule update` out of `check_cross()` and into the
Win32 build sections.
Allow it to fail, in case the user is not using a git clone, the cmake
checks will produce an error if the subtree does not exist.
This fixes the problem with the git submodule update failing because git
is not installed yet.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
When doing a dynamic build, the wxWidgets dlls are needed by the wxrc
executable.
Invoke wxrc with the target triplet debug and release bin directory
prepended to the PATH, this is where the dlls are.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Add a function to check if libogg is installed but libvorbis isn't, this
means it failed to upgrade libvorbis because libogg wasn't upgraded to
the newest port revision supporting pkg-config, see:
https://github.com/microsoft/vcpkg/issues/13037
In this case, remove libogg recursively and allow the install action to
reinstall SFML and all deps.
This will also fix building link support on appveyor for the time being.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Make `speedup_frame_skip` and `speedup_throttle` independent settings,
with `speedup_frame_skip == 0` when `speedup_throttle` is not in effect,
and `speedup_throttle == 100` when `speedup_frame_skip` is in effect.
This fixes a previously introduced bug where `speedup == true &&
speedup_frame_skip = X` was never enabled.
This also allows `speedup_throttle == 0` for no throttle and no frame
skip during speedup.
Also set the upper bound on `throttle` and `speedup_throttle` to `450`
instead of `600`, as the DirectSound driver does not support values
higher than that.
In the DirectSound implementation of `setThrottle`, for `throttle == 0`
use a `throttle == 450` frequency multiplier, because a zero frequency
does nothing.
- Fix#719.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
The el_GR, Greek (Greece) translation is empty, while the el, Greek,
translation is 92% done.
Remove el_GR from git and from transifex.
- Fix#721.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Instead of just checking if the submodule has been cloned, always update
it when cmake runs if git is available.
This fixes the problem of users' dependencies submodule clone never
getting updated with new changes.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
When the wxrc installed by vcpkg into tools was made with the non-static
wxWidgets, and the build is static, it will not find the wxWidgets dlls
and fail.
Use our own wxrc.exe from the dependencies submodule for the time being.
This is a temporary fix, a proper fix would be adding the dlls, if they
are installed, to the PATH.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Rename the joystick polling timer accessors and add a predicate.
Check it and make sure the timer is running in the input and accelerator
config dialogs.
- Fix#711.
- Fix#716.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
- Removing mapperSeconds and mapperLSeconds since both of these can be
zero at any time since they are seconds timer, not seconds since
epoch.
- This leaves only mapperLastTime as this is the number of seconds since
last epoch. If this value is zero, then initialize rtc.
It is now installed as `libexpatMD.lib` for release and
`libexpatdMD.lib` for debug and not `expat.lib`.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Fix the problem with vcpkg installs including both wxWidgets and ffmpeg
overrunning the one hour time limit, by making ffmpeg optional and only
building it if the other builds are under 30 minutes.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Use the vcpkg installed wxrc, from a tools subdirectory, instead of
copying it out of the build tree.
Except when running on appveyor, for some reason the vcpkg wxrc does not
work there, so use our own from the dependencies submodule.
Support vcpkg mingw triplets, they don't work yet however.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
- This is done so we can poll inputs from one place all at once for all
player ports instead of calling the function multiple times for each player port.
Stereo buffer is not remade in the case of audio plugin
switch (only affects GBA, not GB). This results in a crash.
We need to remake the stereo buffer and reinit the pointers
in Gba_Pcm.output or they will be dangling, and lead to a
crash. Also, cleaning up the Multi_Buffer class a bit.
Just a hack to fix a problem with vcpkg upgrades, in this case the
version of the zlib port being too old breaks another upgrade, so we
will check if zlib is in the list of packages to upgrade and upgrade it
before anything else.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Don't disable ccache for msys+ninja anymore, since the mingw ccache
works now and there is no reason to use the msys ccache anymore.
Use RULE_LAUNCH_COMPILE only on cmake versions < 3.4.0, because this
currently breaks resource compilation with visual studio and the windows
native ccache from chocolatey, this needs to be fixed in ccache.
On cmake 3.4.0 and greater, set the variables
CMAKE_<LANG>_COMPILER_LAUNCHER instead. This has the effect of using
ccache for C, C++ and nasm, but not for the resource file, avoiding the
problem with visual studio, which has a more recent cmake. This must be
done before the project() call.
TODO: Currently the Visual Studio build with ccache from chocolatey
works correctly, ccache is being invoked from ninja, but no cache files
are being created. This is being followed up with the chocolatey package
maintainer and upstream if necessary. The resource compiler issue also
needs to be fixed upstream.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Add the Catch2 headers to third_party/include/catch2.
Add Catch.cmake and CatchAddTests.cmake to cmake/.
Add unit tests src/wx/tests/strutils.cpp using Catch2 to test
src/wx/strutils.cpp.
Make some code changes to strutils.cpp to make the tests pass.
See src/wx/tests/CMakeLists.txt for how to set up unit test files; they
plug into the normal CTest mechanism in cmake.
The test binaries are written to the tests/ subdirectory of the build
directory.
Building the tests and enabling the CTest support can be turned off by
passing -DBUILD_TESTING=OFF to cmake, the default is ON, this is the
standard mechanism.
Start running ctest on travis and appveyor.
Move stb to third_party/include where Catch2 is now as well.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>