* overlay: change bars to better match PS1 and fix scaling options
* refactor screen functions to use text and bar names
* set max UI bar scale to 1.5
* make separate text and bar scaling constants
Resolves#698.
After committing #680 for supporting SDL_GL and not using SDL_GetWindowWMInfo() anymore, including SDL_syswm.h (which is a Windows-only include file) is no longer needed. This bit had been forgotten in the previous PR.
Migrate to SDL_GL functions made available in SDL2. Remove wgl_ext.c and wgl_ext.h.
Add additional information to the log file to help debug issues like #582.
According to:
https://wiki.libsdl.org/SDL2/SDL_OpenAudioDevice
a device is always in paused state after SDL_OpenAudioDevice(), so in my opinion it is safe to initialize m_WorkingBuffer[] and then start the playback. This will avoid the need to use lock/unlock stuff.
While compiling my UNIX port of Tomb1Main, I got some error messages like this one:
In file included from src/game/camera.c:7:
src/game/sound.h:19:5: error: unknown type name ‘size_t’
19 | size_t num_samples, const char **sample_pointers, size_t *sizes);
| ^~~~~~
src/game/sound.h:1:1: note: ‘size_t’ is defined in header ‘<stddef.h>’; did you forget to '#include <stddef.h>’?
+++ |+#include <stddef.h>
I would like to suggest to add an #include <stddef.h> into global/types.h.
This fix required some adjustments to satisfy the linters.
On Linux, the engine crashes when printing the log messages. This
happens because the current code re-uses the same va_list variable on
two calls to vprintf() and vfprintf(). Actually, this is not allowed.
For using the same information on multiple formatting functions, it is
needed to create a copy of the primary va_list to a second one, by using
va_copy(). After rewriting properly the Log_Message() function, the
segmentation fault is gone. Tested on both Linux and Windows builds.
When running Tomb1Main compiled as a 64-bit application, I got an error.
This happens because ANIM_STRUCT has a frame_ptr item which is a pointer
and so it varies its size if it's compiled for an addressing depth
larger than 32-bit. I fixed the issue by adding a frame_ofs item, used
for indexing g_AnimFrames[], and by filling all the items of ANIM_STRUCT
by reading them one by one, in the same manner it has been done into
function Level_LoadRooms().
I tested Tomb1Main with the demo levels (see issue #667) and under
Windows, compiled as i686 (32-bit) and x64 (64-bit) and the engine
worked fine on both.