TESTBED: Small Improvements & Bugfixes#6605
Conversation
|
Please fix code formatting |
…an up formatting in fs.cpp
|
Sorry missed the formatting issues. Fixed now (and I also fixed some older formatting issues in the same files) |
Would it be possible to have this button in desktop builds too, which would open the log file with the default system text editor? |
|
I havent seen any comparable function to open files on the host system in OSystem or any specific backend. The reason I added this to Emscripten was because theres no good way to access the filesystem (intially needed for screenshots), but in theory this could work everywhere if we feel its worth implementing for each backend. Probably should be added as an optional feature to OSystem. PS: I wonder how the mobile platforms solve this, its not that easy to access the filesystem there either. |
We do have This function is implemented in some of our backends (including Emscripten). Perhaps we could override the log file name that is opened by this function? |
|
I added a feature to this effect. There's now also
|
9ec5f4b to
f2b85e7
Compare
5426a91 to
089bf98
Compare
engines/testbed/midi.cpp
Outdated
| #ifdef EMSCRIPTEN | ||
| g_system->delayMillis(10); | ||
| #endif |
There was a problem hiding this comment.
Should we do this on all platforms, not just Emscripten?
There was a problem hiding this comment.
I don't think so. This is a quirk of single-threaded webassembly. Without threads, everything runs in the JavaScript event loop. Having a loop such as the above blocks this event loop with the result that no I/O can happen and the page freezes.
I don't think other platforms have this issue.
There was a problem hiding this comment.
We have other single thread platforms which could benefit from it.
In addition, on desktop platforms, not having this call makes a high CPU usage because the loop never pauses.
Any event loop should have such call. So this should be unguarded.
There was a problem hiding this comment.
thanks for the clarification, I unguarded it.
engines/testbed/testbed.cpp
Outdated
| #ifdef EMSCRIPTEN | ||
| #include "backends/platform/sdl/emscripten/emscripten.h" | ||
| #endif |
There was a problem hiding this comment.
This looks like it can be removed.
There was a problem hiding this comment.
I forgot to add removing this to the commit introducing the arbitrary file open method in OSystem. I have since reverted that commit, so this is needed again.
There was a problem hiding this comment.
it's gone now again as I removed all backend-specific code.
|
@bluegr after the discussion on discord I removed cfda843. I think for now it's probably easier to keep this button limited to Emscripten and later add functionality to open such files on any platform properly:
|
|
@chkuendig We discussed about implementing the log file reading functionality in the UI, instead of making it backend-specific. We do display the main logfile in the options GUI. It would be preferable to use a single implementation this way, instead of something that's only available to a single backend |
… indentation issues in testbed.cpp
|
@bluegr I adjusted it accordingly. |
|
@chkuendig Excellent work! Thanks for addressing all issues Squashing |
Make Interactive Mode configurable in GUI I wanted to be able to run testbed in automated mode without adjusting the scummvm.ini - this is now possible:

Fix file writing if game data directory is read-only: This is a bug we discussed a while ago on discord: https://discord.com/channels/581224060529148060/711242520415174666/1339720409745981582. If the game directory is read-only the write tests and the filelog are now stored in the savegame location.
Support opening logfile in Emscripten: This is similar to the screenshot export from Emscripten: Screenshot and Logfile support and minor bugfixes & improvements #5587. I added a button to download the log file:

Fix freeze when playing MIDI in Emscripten: This type of loop needs to yield to the browser regularly in single-threaded Emscripten.