* setting threadname is now done in a seperate function
* if setting the threadname fails, it just prints a warning now
instead of terminating the game with a FatalError
* setting threadname is now done in a seperate function so it's a bit
cleaner (it's different for every platform..)
* replace/refactor signaling code (based on my SDL threading branch and
the old pthread signaling code from RB):
- The interface is like on win32 now (Sys_Signal* functions instead of
overwriting idSysSignal class)
- created a custom signalHandle_t struct for that, which contains all
needed information
- Mimic Windows functions used in win32 implementation more closely,
e.g. signal all waiting threads on manualReset signalRaise, count
waiting threads etc. I'm pretty sure the behavior on Win32 and POSIX
now is identical (as far as possible).
For some reason SDL.h (or headers included by it) need some
string functions (like strncmp) in inline-functions (that we
don't even use).
Str.h has #defines preventing their usage.. so #undef those in
the (few) sourcefiles that need SDL headers
All these files were almost identical, so there is no good reason to
have them twice..
and change CMakeLists.txt accordingly
(Not that this commit won't compile because some #includes are still
broken - will be fixed in the next one)
win_net.cpp and posix_net.cpp were almost identical, i.e. caused a lot
of duplicated code.
To get rid of that, unify both files - by adding Winsock support to
posix_net.cpp and, in the next step, moving posix_net.cpp to sys/common/
and removing win_net.cpp
The AMD drivers output a lot of useless warnings when compiling the shaders.
Those are pretty annoying, especially as idRenderProgManager::LoadGLSLShader
prints out the whole shader with them..
So I added this CVar to suppress them (when it's set to 0)
the connect commands supports adding the port with ":"
like "connect 10.1.2.3:27016" - if no port is set, it defaults to 27015
net_port is still used as the port to listen on and to send from.
In the current case (only "direct" lobby backend, i.e. connect to a
server directly), lobby and game are always on the same server anyway..
It used to send the IP of the first network interface.. that kinda works
on Windows and FreeBSD in LANs (i.e. not over the internet or even
behind a NAT), but not at all on Linux, because the first device seems
to be the loopback device there (at least on my machine)..
Now it sends net_ip (so it should even work behind NAT) or, if net_ip is
set to "localhost" (the default), 0.0.0.0 is sent, which the client
interprets as "just use the IP of the lobby you're already connected to"
And suddenly hosting a server on linux works at least locally
(with client and server on the same machine).
Even though there are still strange bugs (massive lags in one
direction, doesn't work in LAN), at least it works at all now.
* idSysSignal::Wait should now handle timeouts > 1s better (or at all)
* Use clock_gettime for Sys_Milliseconds()
* Use CLOCK_MONOTONIC_RAW (and CLOCK_MONOTONIC as fallback if
that's not available) for Sys_Milliseconds() and Sys_Microseconds()
CLOCK_MONOTONIC can behave strange when NTP is used
* Small fixes in Sys_Microseconds(): use 64bit int to store time
(like return type...), divide by 1000 (not 1000000) for nsec=>musec
D3BFG gets the username from Steam, in the GPL release it just
uses the hostname.
Now it's possible to set a custom name with the ui_name CVAR
(like in classic doom3). If ui_name is empty ("") the hostname
is used.
The window losing focus in MP resulted in the console being spammed
with "changing com_pause not allowed in Multi Player" (or similar)
messages. Added CVAR_NOCHEAT flag to com_pause to get rid of that.
On true unices malloc.h was never available and on Linux one should
include stdlib.h instead. While this change is necessary to build
rbdoom3 on FreeBSD and other true unices, the big question is what
it means to Windows.
It now works on Linux so executing it doesn't freeze the game
like described in
https://github.com/RobertBeckebans/RBDOOM-3-BFG/issues/33
Furthermore, this function doesn't have any parameters anymore
(on any platform) because the only thing supplied was the original
program arguments +"+set com_skipIntroVideos 1" anyway - this is now
done in Sys_ReLaunch() (also on Windows).
Having the program arguments as one string is bad on Linux/POSIX
because there it's expected that the program arguments are one
C-string per argument.
A lot of keys (especially keys not available on US keyboards) just weren't
supported for console input with SDL1.2 (SDL2 uses a different mechanism for
that).
This is fixed now by reordering a few lines in sdl_events.cpp
Please note that still only ASCII characters are supported and those keys
still can not be used in bindings - only for text input!
Turned out that as "extension" (which is really more like a pattern
that matches the whole file) was even used with patterns like "*.*"
so we do proper matching using fnmatch() now - which is even easier
than the old way.
Now deleting savegames on POSIX works.
If the window loses focus com_pause is set to 1, when it regains focus
it's set to 0.
The behaviour on Win32 stayed the same (the implementation is less
hacky though) and Linux now matchces that.
.. from zlib-1.2.7/contrib/minizip/
It resides next to the unzip code in framework/minizip/
This updates makes the code a bit cleaner and creating zip64
with the idZipBuilder is now more feasible and update to future
minizip versions should be easier as I didn't change the original
files from minizip 1.1 very much.
.. from zlib-1.2.7/contrib/minizip/
The original source was minizip 0.15beta from 1998.
This update brings zip64 support (untested) and cleaner code.
Furthermore, updates to future minizip should be much easier now, as
my changes to the original source files from minizip are quite small.
To make diffing to upstream minizip-src easier, I added the minizip
source as exceptions in the astyle-scripts and left them in their own
directory.
Two custom functions from idSoftware - unzSetCurrentFileInfoPosition()
and unzGetCurrentFileInfoPosition() - aren't needed anymore as
minizip 1.1 has functions that do the same.
In Sys_ListFiles() the extension was abused to match whole
filenames (of savegames), not just their extensions - that
didn't work with the POSIX backend, now it does.
Sys_ListFiles() now also supports "*" as a wildcard that matches
all files - needed for deleting savegames.
However, things like "bl*" or "*ub" don't work.
While at it, I replaced readdir() with the thread-safe readdir_r()
* manage warning flags in a variable, they're reused for
each profile anyway (but this way profile-specific flags can
still be added before or after the generic ones)
* added some disable-warning flags specifically for clang
* add define for SDL_SCANCODE_GRAVE - seems like only SDL2
has names for the values
* add some missing keys to SDL_KeyToDoom3Key
* add scancode to unmapped-key warning
* backspace needs to be handled the same for SDL1 as in SDL2
(i.e. a new event must be created for it) to work in console
* Add support for Console-Key independently of KB Layout (with scancode)
* add support for TAB key
* Add hack so console is empty after opening it (SDL-only)
* Pressing up and down again in the console will result in an empty line,
not the stay at the last line from history
* Pressing up will really show the last command, not the last-but-one
it didn't work correctly because the mouse isn't grabbed
(in contrast to dhewm3).
It's fixed now by returning absolute coordinates when a menu
is open, furthermore the cursor is now always hidden.