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!