Commit graph

428 commits

Author SHA1 Message Date
Rohit Nirmal
c20218f9cd Minor spelling fix. 2013-07-13 23:07:22 -05:00
Daniel Gibson
d234bc60e9 Replace custom unzip functions with standard ones
unz[SG]etCurrentFileInfoPosition() isn't needed anymore,
because newer minizip versions have unz[SG]etOffset() for
that purpose.
2013-06-12 00:07:09 +02:00
Daniel Gibson
2e47865234 Use updated minizip version for unzip
The implementation is now in framework/minizip/*
instead of framework/Unzip.cpp

This was version 0.15beta, now we use 1.1 from
zlib 1.2.7/contrib/minizip

Some code had to be adjusted for this, but it got
cleaner on the way
2013-06-12 00:07:09 +02:00
bibendovsky
351f5dc94f Fixed screen twitches with "shakes" sound shader
Caused by inaccuracies in the precached amplitude data in the OpenAL
backend, see https://github.com/dhewm/dhewm3/pull/71 for more details.

Video sample (not mine):
http://www.youtube.com/watch?v=ZUohifAbPW0
The "twitches" can also be observed right at the beginning of the
mars_city2 map.
2013-06-11 23:58:20 +02:00
Kevin Doyon
6407881cff Fix SDL2 compile-errors, made it work on Win64
.. when compiled with MSVC2012
2013-05-02 21:13:06 +02:00
Daniel Gibson
cedc129a0e Silence "unknown pragma" warning in MSVC
Appeared quite often due to the #pragma GCC diagnostic ...
stuff in Str.h and List.h
2013-04-10 00:36:37 +02:00
Daniel Gibson
92a41322f4 3c96e19610 for d3xp/ - fix miscompilation with gcc 4.5
idAnimator::GetJointLocalTransform() miscompiles with gcc 4.5 and
-ftree-vrp (implied by -O2).

Reorder code to avoid the compiler bug, no functional change.

The original commit was for game/ only, but d3xp/ will have the same
issues..
2013-01-13 22:37:34 +01:00
Daniel Gibson
f8de73862e math.h should #include sys/platform.h
Similar to f317b05
2012-11-13 23:58:50 +01:00
Daniel Gibson
b13c131e4e CD-Key check for internet-games can now be disabled
with ID_ENFORCE_KEY_CLIENT 0

This patch is from Kot-in-Action Creative Artel

Fixes #55
2012-11-13 23:48:15 +01:00
Daniel Gibson
fe0ee16ccb Guess x/y FOV/aspectratio from resolution
Added r_aspectratio -1 which means "auto" (as new default).
This mode sets fov_x and fov_y according to screen-width/height.
=> No need to set r_aspectratio manually anymore (assuming your display's
   pixels are about square).

The standard aspect ratios can still be enforced as before, though.
2012-11-13 23:40:37 +01:00
Daniel Gibson
c7956a1cb5 Fix freeze when quitting the game during timedemo
When one tries to quit the game (via quit in console) while a timedemo
is running, the game freezes indefinitely while displaying the timedemo
results.
This happens because the MessageBox used for that waits for a an event
normally triggered by a timer - but it seems like that does not happen
anymore during Shutdown()

The fix makes sure that this message box isn't displayed.
2012-11-13 23:39:38 +01:00
Yamagi Burmeister
9a9babf8d6 Add a new cvar "r_waylandcompat"
Commit 9e158470 set the SDL OpenGL attribut SDL_GL_ALPHA_SIZE to 0 since
the alpha channel is used by Wayland. But for X11 the GLX 1.4 specification
clearly states: "If the requested number of bits in attrib_list for a
particular color component is 0 or GLX_DONT_CARE, then the number of
bits for that component is not considered." So if SDL_GL_ALPHA_SIZE is
0 a framebuffer without an alpha channel is created. This is no problem
on the default GLX module due to a non standard implementation but
manifests with Nvidias GLX module. The consequence are render mistakes
like in game display showing static or the flashlight looking weird.
2012-11-13 23:33:00 +01:00
Daniel Gibson
f317b056c6 List.h needs sys/platform.h for ID_INLINE
Everytime List.h is included in a new file (and sys/platform.h isn't)
there are confusing compiler-errors..
So just #include sys/platform.h in List.h directly, because it uses
ID_INLINE which is defined there
2012-11-13 23:28:21 +01:00
Daniel Gibson
a7bfd05797 Use current type for BT_CLOSED enum
doesn't really make a difference code-wise, but removes one compiler warning.
2012-11-13 23:27:07 +01:00
Daniel Gibson
3202f0aa0f Get rid of some compiler warnings
GCC had shitloads of superfluous warnings wherever List.h and Str.h were
included.. get rid of them by using #pragma GCC diagnostic at some places
in List.h and Str.h.
Also add some casts, initialize some variables for other warnings
2012-11-13 23:24:13 +01:00
Daniel Gibson
aedc76b50e Don't save duplicate consecutive commands to history
If the entered command is the same as the last command, don't save
it to history.
2012-11-13 23:21:38 +01:00
Daniel Gibson
04266eee5e Make console history persistent
The console history is saved to a file on quit and restored after
starting the game.
So the commands entered in the console the last times the game was run
are still available in the console-history, just like commands that
were just entered.
2012-11-13 23:21:38 +01:00
Daniel Gibson
8c6e4eb38a Add support for norwegian keyboard layout
via "in_kbd norwegian". It's the '|' and '§' chars (124, 167)

Fixes #33
2012-11-13 23:18:45 +01:00
Daniel Gibson
6d9a43cb23 On Linux/Unix, return EXE-path as base-path if BUILD_DATADIR fails
Using this path was the old behavior and is expected by many users.
2012-11-13 23:16:03 +01:00
Daniel Gibson
768fdb5707 Load base game's gamelib if mod has no own gamelib
Some mods/mappacks have their own game dir (fs_game) but no own gamelib.
Doom3 defaulted to the base game dll (I think), so we should do the same.

Fixes #44
2012-11-13 23:14:57 +01:00
Daniel Gibson
c193e0b98e Win32: Statically link libgcc and libstdc++
Else one needs to copy those files from mingw32.. and I see no reason
not to statically link them.
2012-11-13 23:12:42 +01:00
Daniel Gibson
5936422d9d Fix freezing of dedicated server window on Windows
The code was donated by motorsep, thanks!
2012-11-12 20:18:00 +01:00
Daniel Gibson
105fdb0624 Fix dedicated server for Windows
* the OpenAL function definitions mustn't include __declspec(dllimport)
  => fixed by pretending to compile OpenAL statically
* glimp.cpp shouldn't be used in dedicated-only mode (as it was already
  the case on Linux and OSX)
  => No special handling for ID_DEDICATED needed in glimp.cpp, as it's not
   used anyway
* add APIENTRY to every gl function in stub_gl.cpp for compatibility
  with windows headers and MSVC
* remove GL/gl.h #include from win_local.h as it's not needed
* in qgl.h, when building dedicated server for windows, redefine WINGDIAPI
  to nothing for SDL_opengl.h #include to get rid off __declspec(dllimport)
  by using #pragma push_macro and pop_macro, because our stub is no dll.

Fixes https://github.com/dhewm/dhewm3/issues/39
2012-11-12 20:18:00 +01:00
Daniel Gibson
1f25568762 Remove duplicate functions from openal_stub.cpp + extern C
Some functions were duplicated, the only difference was a const in one
parameter. The definitions in the header were with const, so I kept
those versions.
Also, the functions in the header are pure C, so add extern "C",
this fixes issues with MSVC and the formerly duplicated functions.
2012-11-12 20:15:08 +01:00
Daniel Gibson
fa8f092e67 Unset key modifiers when regaining focus to unset ALT
There used to be a bug (discussed in #40), that ALT was still set after
using ALT-Tab. Thus when next pressing enter fullscreen was toggled.
This should now be fixed by unsetting the modifiers when focus is
regained (SDL_ACTIVEEVENT or SDL_WINDOWEVENT_FOCUS_GAINED).
2012-09-08 16:45:07 +02:00
Daniel Gibson
844cd2d8a8 Don't un-grab mouse when taking screenshots (fixes #18)
On windows un-grabbing (or possibly re-grabbing) the mouse seems to
mess up the view angly (view is centered afterwards), see
https://github.com/dhewm/dhewm3/issues/18
That's fixed by not releasing the mouse (there is no reason to do that
anyway).
2012-08-27 21:27:05 +02:00
dhewg
1b1787bb50 Disable the warning if the mouse grab request fails
This fails on some SDL drivers and just spams the console.
2012-07-28 12:54:25 +02:00
dhewg
9e15847083 Don't use alpha bits for the GL config
Wayland actually uses this.
2012-07-28 12:51:02 +02:00
Daniel Gibson
df81835de0 Fix several bugs from iodoom3 bugtracker
Apply 94cd0ee5 to d3xp as well.
2012-07-20 21:08:04 +02:00
dhewg
89071f1f57 Provide a stub for GLimp_GrabInput()
Fixes compilation of the dedicated server.
2012-07-20 21:04:04 +02:00
dhewg
227e8ee5c9 Add SDL2 support to framework/Common.cpp 2012-07-20 21:02:59 +02:00
dhewg
918e06cf00 Add SDL2 support to sys/osx/DOOMController.mm 2012-07-20 17:41:40 +02:00
dhewg
ed121102f4 Add SDL2 support to sys/win32/SDL_win32_main.c 2012-07-20 17:34:38 +02:00
dhewg
f120900000 SDL2's SDL_TimerID is not a pointer anymore 2012-07-20 17:34:38 +02:00
dhewg
454bebf99f Add SDL2 support in sys/glimp.cpp 2012-07-20 17:34:37 +02:00
dhewg
4f2f855105 Add SDL2 support in sys/events.cpp 2012-07-20 17:34:36 +02:00
dhewg
b8765ccf22 Move GrabInput() and rename to GLimp_GrabInput()
SDL2 supports multiple windows, and the grabbing is set per
window, so move it to sys/glimp.cpp.
2012-07-20 17:34:34 +02:00
dhewg
6dcf07974d Cleanup GrabInput()
Convert to bitflags to ease moving it.
2012-07-20 17:34:34 +02:00
dhewg
a75387c55e Add SDL2 support in sys/threads.cpp 2012-07-20 17:34:33 +02:00
dhewg
368bf2819c Log the SDL version 2012-07-20 17:34:32 +02:00
dhewg
264fdfa10e Add SDL2 support for the build system
Defaults to off, tree doesn't yet compile with SDL2.
2012-07-20 17:34:32 +02:00
dhewg
5639720c1c Add FindSDL2.cmake for SDL2
This is just a modified version of FindSDL.cmake
2012-07-20 16:43:39 +02:00
dhewg
826d0f7b7b cmake: set SDL_BUILDING_LIBRARY for win32 and osx
While that's a lie it makes FindSDL skip SDLmain, which we have
in tree and compile ourselves.
2012-07-20 16:43:38 +02:00
dhewg
e62e3870a3 Don't link against OpenGL
Dynamically load all symbols at runtime.
This in in preparation for SDL2/OpenGLES.
2012-07-20 16:43:37 +02:00
dhewg
63fdea82b4 Get rid of wglext.h
Good riddance.
2012-07-20 16:43:37 +02:00
dhewg
ac921bc99f Get rid of editor specific win32 vars
We don't compile any mfc crap for our own good, so get rid of these.
2012-07-20 16:43:36 +02:00
dhewg
227fac443d Fix description of r_swapInterval
This isn't specific to wgl.
2012-07-20 00:13:07 +02:00
dhewg
bf922dfc59 Get rid of glConfig.wgl_extensions_string
Unused and nobody cares.
2012-07-20 00:13:05 +02:00
dhewg
30d5cb16d0 Disable editor related rendering
These use OpenGL calls, which are useless on all platforms without
editor support.
2012-07-20 00:13:05 +02:00
dhewg
7f3fc825ed Get rid of GetCardCaps()
Useless now.
2012-07-20 00:13:04 +02:00