On systems where dirent provides a `d_type` field, we currently fall
back to stat() only for DT_UNKNOWN values.
Do so for all unexpected `d_type` values instead (that is, anything
different from DT_DIR, DT_REG and DT_LNK).
This is because there's no guarantee that `d_type` will be meaningful
for all OSes and filesystems. One such example is macOS Tiger, where
`d_type` will hold bogus values for the .aiff files of cddafs mount
points (as triggered by MacOSXAudioCDManager). (This bug appears to
have been fixed in cddafs-242.0.1, around the Snow Leopard area.)
When using stat() over the same files, the proper file type is
returned, though. Hence the need for the stat() fallback to be
triggered in more cases than DT_UNKNOWN.
This fixes Indy3 FM-TOWNS music being silent on macOS Tiger, when
playing from the original CD.
This adds a new shortcut (Ctrl+R) which toggles the resizable state of
the window and allows the user to lock the window size and prevents
resizing.
Closes bug:15124.
Init ImGui after our GLContext object has been initialized and check the
context type to specify the proper GLSL version.
Also make sure we are not in GLES mode before setuping ImGui.
When triggering buttons on the virtual gamepad, the down and up events
are sent on release. That's a leftover from the previous virtual gamepad
which didn't allow to select the buttons easily.
On the new virtual gamepad, the button choice is better so we can
trigger a button down as soon as the finger is on it.
This fixes a bug in some AGS games which missed the button press because
the release was sent too soon.
Fixes Trac#15444.
The JNI global references are limited in count and we overflow it for
games with a huge number of files (like Zork Nemesis).
Instead, track all the nodes from Java side using a unique identifier
generated using an atomic counter.
Then, all JNI calls either use a temporary local reference to access
node data or use the unique identifier.
This makes us use a single global reference per tree instead of
duplicating them on each filesystem node creation.
Thanks to the SharedPtr, the global reference is automatically
deallocated when needed.
This is the first step to avoid global references overflow.
Android libc (Bionic) had a bug in their memchr function where the
needle wasn't considered as an unsigned char for Android below 6.0
except for aarch64 where the implementation was in assembly and behaves
correctly.
This means that on every impacted platform, passing a needle made of a
char >= 0x80 makes memchr never find a match because the value is signed
extended.
Make sure we avoid this case by forcing a cast to unsigned char before
passing an int.
Pretending that the manager starts in the overlay mode was really
confusing.
Also, the concept of _workScreen seemed great in theory but lead to
various subtle errors which were very hard to debug (related to cursor
handling, resolution changing etc).