Move the soundSetThrottle() calls after the soundSetSampleRate() calls
in LoadGame(), because the core calls soundInit() again after
soundSetSampleRate() wiping out the throttle value. This allows the
throttle setting to work with xaudio on startup and game loads.
TODO: the throttle config setting only works correctly for the xaudio
driver at the moment, it needs to be implemented for other sound drivers
and eventually moved out of the sound drivers altogether.
Check if link mode is active in GameArea::Pause() and refuse to pause if
it is.
Remove the check for the app not having focus with pauseWhenInactive
enabled in GameArea::OnIdle() as this is now handled in
MainFrame::OnActivate() (which receives focus events) since f10e2e99.
Revert 13f5afa9 which tried to check for link status in
MainFrame::MenuPopped() because it was completely wrong and the link
check is better done in GameArea::Pause().
Trigger OnSize in the drawing panel after setting the geometry and
calling Layout(). I'm not sure what exactly broke but this seems to fix
the issue for the time being.
Also do a bit of very minor refactoring, change some calls to GetSize()
to GetClientSize() and simplify GLDrawingPanel::OnSize(ev&), tested to
work fine in wx 2.8.
Homebrew SFML links itself with @rpath/ instead of the dylib path,
update the mac linking and bundling script to handle that case, also
move it from src/wx/tools/osx to tools/osx now that wx is the primary
port.
This fix is temporary and I will write a better one that takes
DYLD_LIBRARY_PATH and such into account, but will suffice for linking
Homebrew libs for now. The script needs more work in general.
Check that the CMAKE_VERSION is 3.0 or greater when setting the CMP0043
policy to NEW. The Ubuntu 14 cmake which is 2.8.12 throws an unknown
policy error otherwise.
Disable OpenGL support under Wayland because wxGLCanvas segfaults, and
fix an issue with drawn frames not appearing.
If the user has opengl as the render method in their config, it will not
be changed, but at runtime will be set to simple under Wayland.
To fix the issue with frames not being drawn, Call Refresh() to queue a
PaintEv from DrawArea(data) instead of calling DrawArea(device_context)
directly.
Also remove the DrawOSD() call from PaintEv, this was causing the OSD to
sometimes show up twice in one frame, because DrawArea(data) draws the
OSD directly on the frame data.
Add new files wayland.cpp and wayland.h with a bool IsItWayland() global
function. This uses a GDK (part of GTK) call to detect Wayland. This
unfortunately requires linking GTK libs separately.
Add cmake code to detect the version of GTK used by the wx being linked
and link it as well. Add gtk2 and gtk3 dev packages to the code for the
supported linux dists in ./installdeps.
In the MenuPopped method (which received MENU_OPEN, MENU_CLOSE and
MENU_HIGHLIGHT) check that gba_joybus_active is not true before pausing
the emulator, so that if Link mode is on it will not pause.
Try to install both pkgconfig.i686 and pkgconfig.x86_64 silently because
fc26+ does not have a separate 32 bit package.
If installing 32 bit packages fails on amd64, fall back to installing 64
bit packages only.
Add -fpermissive and -fexceptions to CMAKE_CXX_COMPILE_OBJECT so that
they only affect C++. -std=gnu++11 was already there from b4ba9d9d, but
this is a cleaner method (which is also used for NASM) where we use
STRING(REGEX REPLACE ...) to append options after the <FLAGS>
placeholder in CMAKE_CXX_COMPILE_OBJECT.
Remove the "check for updates" and "Update ROM database" menu entries,
as well as the automatic update checking and all supporting code.
This fixes the issue with the emulator hanging without access to the
internet.
Updating code will be reimplemented in the future using something like
Sparkle. wxHTTP does not support redirects or https so is pretty much
useless now.
Also update the About box to bump copyright year to 2017 and change my
name to "rkitover", which is what I use on github, and mention other
contributors.
Add a hack to the root CMakeLists.txt to SET(MSYS ON) for the Ninja
generator when running under msys2, otherwise it cannot find libs.
The quoting fixes from #70 allow all of this to work.
Move the check for dependencies/msvc into the previous IF(WIN32) block
adding an IF(MSVC) level.
Remove duplicate call to INCLUDE_DIRECTORIES(dependencies/msvc) from
later on in the main CMakeLists.txt.
Add -std=gnu+11 to CMAKE_CXX_COMPILE_OBJECT in the main CMakeLists.txt
to force the option for all C++ sources.
The right way to do this is to use a generator expression with
ADD_COMPILE_OPTIONS, but this is only available in cmake 3.3 and we must
maintain 2.8.12 compatibility to support Ubuntu 14.
This fixes the mac build (clang.)
Call GameArea::Pause and ::Resume in MainFrame::OnActivate based on
focus state if the pauseWhenInactive config option is set.
Also stop/play the primary dsound buffer in pause()/resume() in
dsound.cpp, not onlyu the secondary, this may not be necessary but it
doesn't hurt.
XCode 4.2 generates a broken binary if -fomit-frame-pointer and/or -flto
is used for compile and link flags.
Check for Clang version less than 4.3 on APPLE and remove these flags in
the compile options setting cmake code.
Apparently in some configurations, holding a key on the keyboard makes
Wx stop processing Idle events, so the emulator does not run until the
key is released, freezing the game and ignoring the key.
Hopefully fix this by calling wxWakeUpIdle() from OnKeyDown() and
OnKeyUp().
Other Misc. Improvements:
- refactor process_key_press() to only return true if the system is in a
pressed key state on key presses or a game key was released on
releases and always true on double releases.
- call ev.StopPropagation() from OnKey* events for game keys, this may
not actually do anything, but just in case.
- remove static OnKeyUp and OnKeyDown events from GameArea, these are
connected to the DrawingPanel dynamically now.
- remove the dynamic_cast<>s from PaintEv/EraseBackground/OnSize event
forwarders, since there is already a panel member to use.
TODO:
The state returned by process_key_press() is still not entirely correct,
if a joystick button is pressed, it will return true for a non-game
keyboard press, and it needs to return the correct state for double
releases.
As suggested by @Mystro256, try:
wxDynamicLibrary::CanonicalizeName(wxT("openal"))+wxT(".1")
before just the canonical name for "openal" when trying to load the
library.
Also add a utility method to quietly try loading the library, because on
wx 2.8 wxDL_QUIET does not work.
cmake automatically passes -std=gnu++11 in some cases, while we were
passing -std=c++11, and this was causing incompatibilites in name
mangling between different objects.
Fix this by using -std=gnu++11 for gcc.
The last commit removed generator expressions from ADD_COMPILE_OPTIONS()
which made C/C++ flags apply to nasm as well.
Fix this by removing <FLAGS> from CMAKE_ASM_NASM_COMPILE_OBJECT and
replacing it with the flags we want.