Most of these changes resolve inconsistencies between the three loaders.
Formatting, error handling, logging, etc.
V2 and V3 parsers no longer assume that directory files are multiples
of three. Some Mac games have padding. This caused uninitialized memory
to be parsed and stored in the directory table.
The floor and ceiling drawing in RaycastPuzzle is broken
on ARM processors. This commit attempts to fix it, based
on an assumption of precision loss in large floating point
numbers.
This may have been a mistake; freezing isn't necessarily bad, it just
needs to pick up running the same script after loading the new frame.
Will have another go after writing a D4 test with all the known edge
cases. Makes The Dark Eye work again.
Reverts commit 331df0a138fff525b5084776c372bd2868f340d9.
Changed the way keymaps are disabled/enabled to reduce
calls to the InputManager, and make sure secondary
keymaps are only enabled when needed, and kept disabled
the rest of the time.
Add a convenience function to check if the application is running
in macOS. Use this method to change the default visibility of on-
screen control buttons and function bar.
Neither of these are needed when running on macOS since both mouse
and keyboard are available. Also the mouse pointer in ScummVM does
not access the on-screen control buttons.
However this requires function keys and key combinations like e.g.
Alt+X to work to be able to save and quit games.
These will be added in future commits.
Applications running on iOS are usually full screen. On newer iPads
and when running iOS applications on macOS the application window
size can be changed.
When running the iOS application on macOS using "Designed for iPad"
option, the window can be changed, also to full screen. The function
"safeAreaInsetsDidChange" is then called. Update the screen size
using the view window property instead of checking the UIScreen
window bounds since these never changes.
If forcing the application to run in full screen setting the option
UIRequiresFullScreen to TRUE, it seems to trigger ScummVM to run
in portrait mode instead of landscape mode when running the app in
macOS using "Designed for iPad" on Apple silicon macs.
The UI doesn't require full screen since the application handles
resolution changes nice.
It is possible to run iOS applications on macOS on Mac computers
running on Apple Silicon. This was possible before moving to the
ModularGraphicsBackend implementation in the iOS7 port with just
a little tweaking.
After the move to ModularGraphicsBackend, the ScummVM application
crashed on launch. There were two reasons for crashing;
1. dlsym() was called with the special handle RTLD_SELF to search
for the address binding of the GLES2 load symbol. Using RTLD_SELF
the search for the symbol is limited to the shared object issuing
the call to dlsym() and those shared objjects which were loaded
after it. When running an iOS app in macOS it seems that the app
is running inside a wrapper, which means that the objects resides
in a different level. Changing the search level to RTLD_DEFAULT
changes the search to also include all objects loaded at program
start-up.
2. As for the native macOS application, XCode also adds the
argument -NSDocumentRevisionsDebugMode YES if XCode option
"Allow debugging when using document Versions Browser" is on.
Make sure not to parse that argument also when building the
IPHONE target.
It was not possible to change the mouse mode between "Direct mouse"
and "Touchpad emulation" if a hardware keyboard was connected when
using the on-screen control button.
Fix this by checking if a hardware keyboard is connected.
This was inspired by bug report https://bugs.scummvm.org/ticket/14876
It is a naive fix, whereby I've added checks for nullptr where Visual Studio debugging
would crash with exception, due to trying to access a nullptr pointer.
It works for the specific crash case, but someone more familiar with the engines should review it.
The crash itself seems to be caused by the game data folder missing
the resource file for subtitles in that scene (which I think is the "DATA\MINEROAD.TRS").
When `Score::loadFrame(frameNum)` is called with frameNum <=
_curFrameNumber it will start by resetting frame state, then loading
previous n-l frames and then updating `_curFrameNumber to` `frameNum`.
This is by design, to allow abribtrary script-based frame jumping and debug console commands.
Previous to this change `Score::update()` incrementing `_curFrameNumber` directly before
calling `Score::loadFrame(_curFrameNumber)`. In effect, this meant that
every time the playhead moved forward one frame, all previous frames
would first be loaded from the stream first. Any state built
up by previous scripting is lost and perhaps impacts performance at
suitably high frame counts and debug levels.
In this change, `Score::update()` instead makes changes to a local
variable and passes the result to `Score::loadFrame()`.
Also made the ensureAccessibleDirectoryForPathOption() method use a recursive call to reduce complexity
The following decisions are made for commandline path options accessibility checks:
"screenshotpath" option is required to be writeable (not checked for readable)
"path" option is required to be readable (not checked for writeable)
"savepath" option is required to be readable AND writeable
"extrapath" option is required to be readable (not checked for writeable)
"iconspath" option is required to be readable AND writeable
"themepath" option is required to be readable (not checked for writeable)