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.
Their new `main` branch now serves as a stepping stone for the upcoming
3.x release, and they switched away from autotools to CMake in
7b21eaddce4fb80f94e7ac54744edc9cdb733c36.
MSVC complains the use of macro GFX_GL_CheckError(), saying that it
needs a parameter. By looking its declaration into src\gfx\gl\utils.h,
I have seen that it is declared with a "void" inside. Probably, in the
past GFX_GL_CheckError() was a function and the "void" was forgotten
when it had been converted into a macro. GCC doesn't suffer much, but CL
thinks instead that "void" is a required parameter. Hopefully, removing
that thing made all compilers happy.
config:
- settings.c functionality moved to config.c;
- some bool settings inverted in line with config tool;
- default config file comments updated in line with config tool.
Part of #633.