Commit graph

237 commits

Author SHA1 Message Date
Robert Beckebans
a92a49dc2f Astyle 2013-10-30 09:42:24 +01:00
Jonathan Young
db626df078 Fixed the autosave dialog being stuck on the screen when starting a map (map or devmap) via the command line, or before selecting Doom 3. 2013-10-19 16:43:39 +10:00
Jonathan Young
2555b804d6 Fixed ERR_DROP resulting in a glitched screen with only the console accessible - show the main menu instead. 2013-09-29 21:03:32 +10:00
Robert Beckebans
9e7230de34 Disabled tunnel vision. Fixes #33 Red screen flash on damage does not dissapear until load or full health 2013-09-25 09:19:21 +02:00
Robert Beckebans
c603add210 Reverted fs_resourceLoadPriority. Be aware to keep this changed if you work on mods or standalones. fixes #59 Player starts out with Soul Cube in Doom 3 2013-09-25 09:09:09 +02:00
Jonathan Young
c925f05f85 Fixed warp effect not being centered when r_useVirtualScreenResolution was 0. 2013-09-22 13:50:49 +10:00
Jonathan Young
bb2e41b5d7 Added r_useVirtualScreenResolution cvar to control whether to do 2D rendering at 640x480 and stretch to the current resolution (default), or render at the current resolution. 2013-09-21 22:12:42 +10:00
Jonathan Young
b3983e582a astyle 2013-09-21 19:37:12 +10:00
Jonathan Young
4c7a2c5de3 Prioritize source SWF and image (for SWF atlas) files over their binary equivalents in resources files when not in production mode. Now you can replace individual menus without having to extract and delete all the base/*.resources files first. 2013-09-21 19:35:00 +10:00
Jonathan Young
adf2b63e88 Skip some common SWF tags (FileAttributes, Metadata and SetBackgroundColor) instead of failing to load a SWF file if any of them are encountered. 2013-09-21 19:27:03 +10:00
Jonathan Young
a1776a22d0 r_vidMode sanity check was off by 1. 2013-09-18 12:39:31 +10:00
Jonathan Young
45ea17fd70 Removed unused FileSystem variables. 2013-09-17 20:36:18 +10:00
Jonathan Young
1c500b710b Mirror source code directory structure in generated MSVC projects. 2013-09-16 17:54:14 +10:00
Daniel Gibson
9372fddabb Fix compile when system GLDEBUGPROCARB signature is without const
.. by just casting our DebugCallback to GLDEBUGPROCARB.
It shouldn't make a difference ABI-wise, if there is a const at
a parameter or not.

Fixes #61
2013-08-31 19:23:45 +02:00
Robert Beckebans
d3ddf61d9c Changed signature of GLDEBUGPROCARB to match OpenGL GL_ARB_debug_output specs 2013-08-29 09:38:52 +02:00
Robert Beckebans
bc45492d9c Fixed typo that hid the sys/*.h files in the VS solutions 2013-08-14 02:48:07 +02:00
Daniel Gibson
1f5579a697 Fix compilation with SDL2 Release
.. they removed ev.key.keysym.unicode - but checking for
SDL_SCANCODE_GRAVE is better anyway to handle console key
2013-08-13 23:08:48 +02:00
Daniel Gibson
88b23611f9 Fix DEBUG_THREADS on FreeBSD
There was a typo in an #include, furthermore FreeBSD has no
pthread_getname_np equivalent.

I added Sys_GetThreadName() so the code is a bit cleaner.
2013-06-23 19:16:23 +02:00
Dmitry Shapovalov
e6b4326f86 Code duplication in idWeapon::Clear 2013-06-03 14:56:25 +06:00
Robert Beckebans
3b67eabf79 Fixed critical bug in the generic C++ code of DotProduct_SIMD that caused massive errors in the physics system 2013-06-01 18:29:12 +02:00
Robert Beckebans
2a4970c86c Added CMake batch file for OpenAL 2013-06-01 15:15:18 +02:00
Robert Beckebans
db715535cc Merged generic C++ fallbacks for SSE optimized code to allow support for non-x86 based platforms like ARM 2013-06-01 15:13:00 +02:00
Robert Beckebans
e510691c36 Changed model loader to not generate binary files for defaulted models. closes #39 2013-05-24 19:27:18 +02:00
Robert Beckebans
bdfc2aadb1 Allow slow-motion sound effect for OpenAL sounds 2013-05-24 18:55:56 +02:00
Robert Beckebans
e7ffc153c2 Added back workaround in RB_DrawElementsWithCounters 2013-04-10 02:40:09 +02:00
Robert Beckebans
d176bca1e7 Fixed critical out of bounds bug in RB_DrawShaderPasses() 2013-04-10 02:13:27 +02:00
Robert Beckebans
3023533e57 Added pthread priority code but it is disabled by default because it requires root privileges 2013-03-26 13:43:30 +01:00
Robert Beckebans
cbd696cc67 Merge remote-tracking branch 'DanielGibson/improve-threading' 2013-03-26 09:58:14 +01:00
Robert Beckebans
dcae311b7f Renamed in_kbd to in_keyboard 2013-03-26 09:56:48 +01:00
Daniel Gibson
3c755e490b change threadnames so they fit into 15chars
+ terminating null byte - that's the limit of threadnames on linux

Furthermore: idJobThread::Start used va() to create the threadname.
va() isn't threadsafe... so I replaced it with a local buffer and
idStr::snPrintf()
2013-03-26 00:36:04 +01:00
Daniel Gibson
da9ab07e9c Refactor setting threadname on POSIX systems
* 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
2013-03-26 00:36:04 +01:00
Daniel Gibson
fe18a49303 Improve POSIX threading code
* 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).
2013-03-25 22:05:02 +01:00
Daniel Gibson
ae02bb54a1 Make it compile with SDL2 again
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
2013-03-24 23:44:13 +01:00
Robert Beckebans
75f7fa3aa8 Removed obsolete old renderer SMP code 2013-03-23 21:33:40 +01:00
Robert Beckebans
a916fd71fc Added openal-soft library for Win32 2013-03-23 21:32:07 +01:00
Robert Beckebans
3f29e641eb Fixed missing CVAR_ARCHIVE flag to g_fov 2013-03-23 17:45:48 +01:00
Daniel Gibson
07524dadb0 Adapt #includes for moved files, make it build again
socket_net.cpp needed some small fixes to build again,
because of imcompatibilities between Winsock and the
real POSIX sockets API.
2013-03-18 00:38:58 +01:00
Daniel Gibson
cec460d38c Move stuff from sys/posix/ and sys/win32/ to sys/common/
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)
2013-03-18 00:38:58 +01:00
Daniel Gibson
95a1066004 prepare unification of more sys/win32/ and sys/posix/ stuff
because the code is almost the same anyway, so
* add win32 support to sys/posix/posix_signin.cpp
* add posix support to sys/win32/win_savegame.cpp
2013-03-18 00:38:40 +01:00
Daniel Gibson
c635566bcc Move sys/posix/posix_net.cpp to sys/common/socket_net.cpp, remove win_net.cpp
and adjust the CMakeLists.txt accordingly
2013-03-17 23:35:12 +01:00
Daniel Gibson
a2be306fed Add Winsock support to posix_net.cpp (to remove code duplication)
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
2013-03-17 23:35:12 +01:00
Daniel Gibson
e2359ba333 Add CVar r_displayGLSLCompilerMessages to suppress AMD driver warnings
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)
2013-03-17 23:35:12 +01:00
Daniel Gibson
d5898abfa4 Don't use net_port as port to connect to
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.
2013-03-17 23:35:12 +01:00
Daniel Gibson
b38aff8995 Fix sending clients from lobby to game when lobby and game are on same server
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"
2013-03-17 23:35:12 +01:00
Daniel Gibson
6e6703b93f Print net checksums as unsigned int
because it actually *is* unsigned and the negative values look strange
2013-03-17 23:35:12 +01:00
Daniel Gibson
e8c8a04c07 rewrote posix_net.cpp based on win_net.cpp
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.
2013-03-17 23:33:39 +01:00
Daniel Gibson
5001b49841 try to fix console deadkey problem 2013-03-16 14:32:47 +01:00
Daniel Gibson
9aa63e4074 Some timer-related improvements for POSIX
* 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
2013-03-16 14:32:47 +01:00
Daniel Gibson
a203345897 Configurable username for Multi-Player (ui_name), com_pause no cheat
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.
2013-03-16 14:32:47 +01:00
Daniel Gibson
4040a3a9ef shut up compiler warnings
and a small comment
2013-03-16 14:32:47 +01:00
Yamagi Burmeister
a2dca39727 There's no libdl on FreeBSD 2013-03-16 14:32:47 +01:00
Yamagi Burmeister
63b1816be6 Add an explicit cast to shut up g++47 on FreeBSD 2013-03-16 14:32:47 +01:00
Yamagi Burmeister
649577e9be Include stddef.h for ptrdiff_t on FreeBSD 2013-03-16 14:32:46 +01:00
Yamagi Burmeister
f51688a470 Add FreeBSD defines 2013-03-16 14:32:46 +01:00
Yamagi Burmeister
da31237ed0 Replace malloc.h by stdlib.h
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.
2013-03-16 01:38:53 +01:00
Reto Schneider
f7b532df63 SDL_GetWindowDisplay got renamed to SDL_GetWindowDisplayIndex
SDL2 commit: http://hg.libsdl.org/SDL/rev/7174fb08017a
2013-02-05 07:07:49 +01:00
Daniel Gibson
deb41fb69f Add classic com_showFPS mode
That only displays the fps.
It's com_showFPS 2
2013-01-20 15:58:32 +01:00
RobertBeckebans
592da5df54 Merge pull request #35 from DanielGibson/fix-relaunch
Implement Sys_ReLaunch() for Linux, refactor it
2013-01-20 02:12:01 -08:00
Daniel Gibson
b044526ddb Implement Sys_ReLaunch() for Linux, refactor it
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.
2013-01-20 04:32:11 +01:00
Daniel Gibson
1d56411f56 Fix console-input in SDL1.2 for lots of unmapped keys
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!
2013-01-20 04:16:19 +01:00
Robert Beckebans
98093a4e8d Added long neck GCC compiler workaround from dhewm3 2013-01-14 00:24:11 +01:00
Robert Beckebans
83b3439e87 Disabled unused OpenAL code requiring the AL_SOFT_buffer_samples extension 2013-01-08 18:08:24 +01:00
Daniel Gibson
155e5e589e Also check for com_pause when USE_DOOMCLASSIC
oops, somehow forgot this one
2013-01-07 08:36:53 +01:00
Robert Beckebans
5234e4cd77 Cleaned up OpenAL code. Updated README.txt 2013-01-06 17:47:40 +01:00
Robert Beckebans
4884cc5793 Fixed OpenAL bug when deleting the OpenAL buffers that caused the game to hang. 2013-01-06 13:03:56 +01:00
Robert Beckebans
699e0e39f5 Fixed problems in the ADPCM decoder. Sound is working. 2013-01-05 19:00:22 +01:00
Robert Beckebans
27b83db50d Added missing add_executable(RBDoom3BFG ...) 2013-01-05 17:17:13 +01:00
Robert Beckebans
5bef3a327f Added MS ADPCM decoder from SDL2 2013-01-05 17:02:48 +01:00
Robert Beckebans
0b66e57359 Merge branch 'master' into openal 2013-01-05 11:50:21 +01:00
Robert Beckebans
64a2c6c39c Merge remote-tracking branch 'DanielGibson/gcc-pch' 2013-01-05 11:36:03 +01:00
Robert Beckebans
0881085589 Merge remote-tracking branch 'DanielGibson/improve-window-handling' 2013-01-05 11:35:52 +01:00
Robert Beckebans
00a9c353f3 Defaulted OPENAL=ON for the openal branch 2013-01-05 00:14:55 +01:00
Robert Beckebans
b55d668c5c Merge branch 'master' into openal 2013-01-05 00:13:51 +01:00
Robert Beckebans
a2fe079600 Changed OpenAL to use buffers instead of streaming 2013-01-05 00:13:35 +01:00
Robert Beckebans
0cf039bfdb Changed project to use the DirectX10 SDK on Windows 8 2013-01-04 22:51:30 +01:00
Robert Beckebans
9ac405223b Changed idSoundSample_OpenAL::MakeDefault() to generated a proper beep sound 2013-01-04 18:12:20 +01:00
Daniel Gibson
c58f0d4749 Precompiled Headers for GCC+Clang 2013-01-04 17:01:40 +01:00
Daniel Gibson
cf8d287a4e Fix Sys_ListFiles() on POSIX once again
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.
2013-01-04 14:40:35 +01:00
Daniel Gibson
a405b37f13 Pause when window loses focus, introduce com_pause
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.
2013-01-04 14:40:35 +01:00
Daniel Gibson
732d8987d3 support ctrl-g for (un)grabbing mouse
Many Linux Games support that
2013-01-04 14:40:35 +01:00
Daniel Gibson
a1c1f1b6b2 Support resizing windows for SDL1.2
By implementing GLimp_SetScreenParms() for SDL1.2
and enhancing the event handling
2013-01-04 14:40:35 +01:00
Daniel Gibson
d6c32cd49b Support resizing windows + improve fullscreen for SDL2
By implementing GLimp_SetScreenParms() and enhancing the
event handling
2013-01-04 14:40:35 +01:00
Daniel Gibson
19effdad2c fix zlib include path in zip.h 2013-01-04 14:40:35 +01:00
Robert Beckebans
33774e2225 Added OpenAL support to Linux 2013-01-04 13:24:52 +01:00
Robert Beckebans
c47e78d6f3 Misc changes 2013-01-03 21:25:34 +01:00
Robert Beckebans
00a459c61b OpenAL plays first scratchy sounds 2013-01-03 20:17:54 +01:00
Robert Beckebans
038037e524 Replaced most XAudio2 calls with OpenAL 2013-01-03 16:56:25 +01:00
Robert Beckebans
9a40f246b6 Copied neo/sound/XAudio2/XA2_* to neo/sound/OpenAL/AL_* 2013-01-02 21:45:47 +01:00
Robert Beckebans
946768ad9f Moved minizip contrib code to libs/zlib/minizip/ 2013-01-02 17:09:45 +01:00
Robert Beckebans
3830118767 Merge remote-tracking branch 'DanielGibson/update-zip' 2013-01-02 16:01:35 +01:00
Daniel Gibson
66ed216ad8 Update zip code to minizip 1.1
.. 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.
2013-01-02 05:29:56 +01:00
Daniel Gibson
ca112294b8 Update unzip code to minizip 1.1
.. 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.
2013-01-02 05:29:56 +01:00
Daniel Gibson
634f7ea630 Update zlib to version 1.2.7 2013-01-02 05:29:56 +01:00
Daniel Gibson
a102d9d469 also do Sys_Sleep for less then 20ms
Sys_Sleep(10) is used quite often throughout the code.
2012-12-30 16:26:24 +01:00
Daniel Gibson
478d7e4f6e Workaround for erebus1 crash in debug mode on Linux 2012-12-30 16:24:12 +01:00
Daniel Gibson
edb4856abd Set timestamp for savegames on POSIX
So they can be sorted correctly etc
2012-12-29 05:29:56 +01:00
Daniel Gibson
1e3bc3429b Fix Sys_ListFiles() on POSIX as needed for savegames
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()
2012-12-29 05:29:29 +01:00
Daniel Gibson
f77ca851d5 Small fix in Mem_Alloc16(): int->size_t 2012-12-29 04:27:01 +01:00
Robert Beckebans
e3584014b9 Fixed MSVC C++ exception warnings 2012-12-24 12:34:18 +01:00
Daniel Gibson
876aa96637 Fix messed up view angle after taking screenshots
Pretty much like https://github.com/dhewm/dhewm3/issues/18
but here it took some more changes
2012-12-23 06:43:20 +01:00