Commit graph

341 commits

Author SHA1 Message Date
dhewg
f767af9d72 s/WriteDeltaLong/WriteDeltaInt/
to match the return type
2012-06-28 13:52:25 +02:00
dhewg
822b0b84af s/ReadDeltaLongCounter/ReadDeltaIntCounter/
to match the return type
2012-06-28 13:52:24 +02:00
dhewg
c51f59cb15 s/WriteDeltaLongCounter/WriteDeltaIntCounter/
to match the argument type.
2012-06-28 13:52:24 +02:00
dhewg
9034da11d0 s/ReadLong/ReadInt/ to match the return type 2012-06-28 13:52:24 +02:00
dhewg
94df46637a s/WriteLong/WriteInt/ to match the argument type 2012-06-28 13:52:23 +02:00
dhewg
5f5a6e7043 s/BigLong/BigInt/ to match the return type 2012-06-28 13:52:22 +02:00
dhewg
49c4d028a5 s/LittleLong/LittleInt/ to match the return type 2012-06-28 13:02:47 +02:00
Daniel Gibson
0eb604c436 Use int instead of long in FS_WriteFloatString()
The correct type for %d, %i, %u, ... is int, not long.
Even if FS_WriteFloatString() didn't care about that, sprintf() (which is called
with the same format strings and the corresponding values) does.
2012-06-28 13:02:46 +02:00
Daniel Gibson
a0fb3cd699 Don't use long in CollisionModel_local.h 2012-06-28 13:02:46 +02:00
Daniel Gibson
e8f047bcb6 Use int instead of long in idCompressor_Arithmetic methods
They return int anyway, so using long doesn't make sense (and originally on
win32 it didn't make a difference anyway)
2012-06-28 13:02:46 +02:00
Daniel Gibson
600531ec98 Don't use long for DDS magic number
It's a DWORD (i.e. 32bit int) according to spec, so using long is
actually wrong when sizeof(long) == 8.
2012-06-28 13:02:46 +02:00
Daniel Gibson
0d27bfe7b9 Remove usage of long type from idlib/
Apart from some minor stuff, this changes the signature of some methods
of Parser and Token classes and of the (unused) Random2 class.
That no problem though, because the calling code uses normal ints
anyway.
2012-06-28 13:02:45 +02:00
Daniel Gibson
b9247b67b4 Remove longs from game/ and d3xp/
(Except for handling of longs in TypeInfo and win32-only Maya import stuff).

sizeof(long) == sizeof(int) on x86 and win64,
but not on 64bit (x86_64) linux/unix/osx/.. so they should be avoided.
2012-06-22 18:20:09 +02:00
Daniel Gibson
4244436d7d Fix PVS calculations on 64bit systems
Monsters got stuck in same places of d3xp because PVS calculations
returned that they were not in the players PVS.
This only happened on LP64 systems like Unix/Linux amd64 where
sizeof(long) == 8 - it did not happen on Win64 because it's LLP64, i.e.
sizeof(long) == 4 (like on x86 32bit).

Bit fiddling code in Pvs.cpp seemed to assume that sizeof(long) == 4
like on win32.

Fixes #7.
2012-06-22 16:13:08 +02:00
dhewg
b9cc8548dc Remove leftover X11 header 2012-06-15 18:25:48 +02:00
Daniel Gibson
94cd0ee559 Fix several bugs from iodoom3 bugtracker
rhyskidd@gmail.com found them (with PVS studio IIRC), reported them and posted
patches.
Some of the patches were incorrect so I rewrote them.
2012-06-02 10:12:22 +02:00
Daniel Gibson
1e087d9bf6 Fix idMatX::IsOrthonormal()
The original implementation was pretty broken (but not used anyway),
it is now fixed and improved a bit (got rid of one inner loop).
This (at least part of the problem) was detected by PVS-Studio,
see http://www.viva64.com/en/b/0120/ Fragment 3
2012-05-13 03:04:34 +02:00
Daniel Gibson
5b2c78b9ff Fix wrong length used in memset() in idMegaTexture::GenerateMegaMipMaps()
it should be tileSize, not sizeof( tileSize ), as it was also used for
allocating that block of memory
2012-05-13 02:52:12 +02:00
Daniel Gibson
56873e1fec Fix memleak in snd_cache.cpp (from Harry Jeffery)
This fix is stolen from https://bugzilla.icculus.org/show_bug.cgi?id=5345
2012-05-13 02:31:37 +02:00
Daniel Gibson
6a23b17509 Work around broken libs that call setlocale(LC_ALL, "");
Because that can fuck up parsing floats if your locale uses ',' as a radix.

LADSPA plugins that may be used by ALSA do this. A PITA to debug.
2012-05-13 00:04:17 +02:00
dhewg
45a73e2dcd Add the build target "Profile" suitable for profiling 2012-01-19 00:53:16 +01:00
dhewg
a18650b27e Remove initial R_SetColorMappings() call
This happens before the SDL GL window is set up, which just
results in a warning. Another call will properly set the
gamma table after the window is initialized.
Make gammaTable a stack variable. This is sufficient, since SDL
already restores the gamma values for us on exit.
2012-01-19 00:53:13 +01:00
dhewg
0e3500b919 Accept both alt keys for alt-enter
Reported by Ensiform.
2012-01-19 00:22:47 +01:00
dhewg
3e066baf91 Map the right alt key
SDLK_RALT was missing, it is independent of SDLK_MODE.
Reported by Ensiform.
2012-01-19 00:19:51 +01:00
dhewg
6d6c5c8ce7 Fix "unreachable code" warnings 2012-01-15 14:13:44 +01:00
dhewg
668802f09a Cleanup OpenAL includes
We use OpenAL Soft on all platforms.
2012-01-14 20:43:50 +01:00
dhewg
898f690fc4 This is dhewm 3
Rename project, now at https://github.com/dhewm
2012-01-14 20:06:05 +01:00
dhewg
d472149426 Get rid of unused defines in Licensee.h 2012-01-14 17:59:37 +01:00
dhewg
db4aca78d6 Get rid of CPU_EASYARGS
Never use the event callbacks with mismatching prototypes.
2012-01-14 15:19:38 +01:00
dhewg
b7ce0ef149 CMake: Use config.h for BUILD_OS and BUILD_CPU
This fixes, among others, FreeBSD 64bit builds where the build
system used a "amd64" suffix and runtime "x86_64".
2012-01-14 15:19:12 +01:00
dhewg
827124431e CMake: Detect libcurl and use it when found
Move ID_ENABLE_CURL to config.h
2012-01-14 15:09:29 +01:00
dhewg
545d98fc08 CMake: Create config.h
Use config.h for configure time settings.
2012-01-14 15:09:27 +01:00
dhewg
9108c4ec9c CMake: Use CMAKE_SOURCE_DIR
Instead of CMAKE_CURRENT_SOURCE_DIR.
2012-01-14 15:02:26 +01:00
dhewg
b5c66c088c Get rid of ID_OPENAL
This is always required for clients.
2012-01-14 15:02:26 +01:00
dhewg
dca4721c8f Get rid of the scons build system
This only works for linux and cmake works on all platforms.
Hopefully this prevents invalid reports.
2012-01-14 15:01:19 +01:00
dhewg
1a5499e6f5 Fix compilation of the dedicated server
Add missing OpenAL stubs.
2012-01-14 13:26:01 +01:00
dhewg
2b9e2e5193 More fixes regarding event saving and restoring
Fix silly issue from 3d692b58 (sizeof(E_EVENT_SIZEOF_VEC)).
Align entity values of events to the native pointer size, which
is noticeably faster on x86_64 and fixes another assert() in
debug builds.

Past savegames with entities in events are not compatible.
2012-01-13 01:45:19 +01:00
dhewg
3d692b58de Prevent assert() while saving and restoring events
The argument size of each event is checked in debug builds
and this change was missing from the x86_64 commits.

Surprisingly this didn't trigger yet with the original game,
only with the mod 'Classic Doom 3'.
2012-01-12 19:05:52 +01:00
dhewg
91bca094c0 Fix out of bounds access for buggy UIs
Seen with the main menu on the mod 'Classic Doom 3'.
2012-01-12 19:05:51 +01:00
dhewg
3e07208cae New CVar s_device to choose the audio device to use 2012-01-11 22:52:05 +01:00
dhewg
35bd70ea46 Improve environment suit sfx
Set AL_LOWPASS_GAIN like EAX did under the hood.
Set the same filter via AL_DIRECT_FILTER on sources.

This should bring the overall sfx closer to EAX:
<kaan_> it sounds awesome

All infos provided by KittyCat from #openal.
2012-01-11 19:29:35 +01:00
dhewg
ad48afdbd7 Fix compilation via scons
SConscript.core was missing jpeg_memory_src.cpp.
Reported by ameyp.

Fixes #2.
2012-01-11 18:56:38 +01:00
dhewg
16958d070b Fix [record|play|time]Demo for x86_64
These are still fragile due to restored stale pointers (!).
But at least the vanilla demos can now be used to check for
performance regressions.
2012-01-10 22:54:01 +01:00
dhewg
d8acc43aca Port the D3XP environment suit effect to EFX
Use a AL_LOWPASS_GAINHF filter to muffle sfx.
2012-01-10 17:45:37 +01:00
dhewg
8ea0f8f0d5 Clamp EFX reverb effect values
The values might be slightly out of range due to the scale
conversion. Clamp them so OpenAL doesn't refuse them.
2012-01-10 17:45:37 +01:00
dhewg
bdbee3543c Cleanup EFX code
Add error checking.
Add debug printf()s, enable via EFX_VERBOSE.
2012-01-10 17:45:37 +01:00
dhewg
b8f9829255 Use the correct unit when passing values for EFX
The gain values are expressed as millibels in the .efx files
and need to be converted to normalized floating points.
Get the EAX4 EAXREVERBFLAGS_DECAYHFLIMIT from the "flags" token
and set AL_EAXREVERB_DECAY_HFLIMIT accordingly.

All infos provided by KittyCat from #openal, many thanks!
2012-01-09 00:52:30 +01:00
dhewg
ece2adbdcd Port EAX to EFX
First attempt at porting the EAX reverb code to EFX.
This only works when the ALC_EXT_EFX extension is supported by
the OpenAL vendor (which is not the case for the OSX supplied
framework, use OpenAL soft instead).

The current stable version of OpenAL Soft (v1.13 as of this
writing) can barely handle this additional workload, current
master is highly recommended when using this feature.
2012-01-08 22:04:56 +01:00
dhewg
1ce658e835 Get rid of memory status functions
Unused.
2012-01-08 12:24:58 +01:00
dhewg
fe7b32d47e Get rid of dead prototype 2012-01-08 12:24:58 +01:00
dhewg
6a1d6cb842 Always allow multiple instances 2012-01-08 12:24:58 +01:00
dhewg
438685e6e6 Get rid of Sys_FlushCacheMemory()
Stub on all platforms.
2012-01-08 12:24:58 +01:00
dhewg
9542663097 Get rid of Sys_DefaultCDPath()
Stub on all platforms.
2012-01-08 12:24:58 +01:00
dhewg
79fa35d0ec Get rid of ID_MCHECK
mcheck() is not thread safe, use MALLOC_CHECK_ or TCMalloc
instead.
2012-01-08 12:24:57 +01:00
dhewg
5f8712902c Return at least 64MB VRAM in case the detection fails 2012-01-08 12:24:57 +01:00
dhewg
a35d8c08b6 Fix usage of wrong define in sys/cpu.cpp 2012-01-08 12:24:57 +01:00
spiral
468b266860 Remove hard-wired -framework OpenAL
We already link to OPENAL_LIBRARY further down.

Log some debug OpenAL info, mainly so OSX users can check they are not
using Apple's OpenAL. OpenAL Soft is recommended as it fixes many
issues.

I specify it as follows:

cmake -DOPENAL_LIBRARY=/usr/local/lib/libopenal.dylib -DOPENAL_INCLUDE_DIR=/usr/local/include -GXcode ../neo/

(because FindOpenAL.cmake prefers the /System frameworks)
2012-01-08 12:24:45 +01:00
dhewg
035dcbcd46 Move jpeg_memory_src()
Found another copy in renderer/Cinematic.cpp. Move the
newer implementation from renderer/Image_files.cpp in its
own file and use the libjpeg v8c license blob (which is where
this code comes from).

Adapt README too with the v8c license.
2012-01-07 20:57:07 +01:00
dhewg
fcc947433b Disable a few MSVC warnings
These just spam the console. Some are useless, some need to be
looked at at some point.
2012-01-07 19:01:54 +01:00
dhewg
47e486b62a Add SDL_win32_main.c
Don't link against SDLmain.[a|lib], always compile it.
We can use pure C MinGW cross compiled libraries with MSVC, and
this is the only static library used.
2012-01-07 19:01:53 +01:00
dhewg
eb2ecfa22a Add support for the doom3-libs repo
Single CMake variable "DOOM3LIBS" to point to the repo of
binaries to make CMake find libraries from there.
2012-01-07 19:00:44 +01:00
dhewg
b3085e03b4 Fix sys/win32/* for x86_64 2012-01-07 19:00:43 +01:00
dhewg
4927299cb9 Include malloc.h for alloca for MinGW
Newer versions of MinGW do not seem to require this, but older
ones do.
2012-01-07 15:40:22 +01:00
dhewg
82a87863ff Rename FILE_[EXEC|OPEN] due to conflict
Some MinGW versions already define it.
2012-01-07 15:40:18 +01:00
dhewg
989b812a6e Cleanup DOOMController.mm
Cleanup headers and use MAXPATHLEN.
2012-01-05 00:24:16 +01:00
dhewg
6fa12c3a44 Get rid of the NSObject in DOOMController.mm
SDLmain.m does the bulk of the work for us, so get rid of
the DOOMController NSObject, move the quakeMain() contents to
main() and let SDL do its thing.
2012-01-05 00:24:16 +01:00
dhewg
532b642222 Get rid of checkOS() and checkDVD()
Former is already handled by cmake via -mmacosx-version-min=
and the latter is just a stub.
2012-01-05 00:24:15 +01:00
dhewg
8e5702ef36 Get rid of applicationShouldTerminate()
Redundant, already handled by SDL_QUIT event.
2012-01-05 00:24:15 +01:00
dhewg
23752a2cd2 Get rid of applicationDidFinishLaunching()
SDL already implements this for us and the assert()s are
already part of idlib.
2012-01-05 00:24:15 +01:00
spiral
ec0f836f41 Generate an .app bundle for OSX
Add missing SDLMain and icon/resource files to generated .xcodeproj

Now builds on Lion in XCode4 with the 10.6 SDK using LLVM-GCC4.2.

Also tested on WinXP in VS 9 2008 Professional, I don't appear to have
broken anything there, stuff like MACOSX_BUNDLE_INFO_PLIST is
effectively ignored.
2012-01-05 00:24:15 +01:00
spiral
6453bce10c We don't need XOPEN_SOURCE deprecated content
Just what's in sys/ucontext.h specifically.
2012-01-05 00:24:15 +01:00
scottWakeling
c08249b9db Fix semi-colons being inserted into ldflags
It is causing clang++ to error when linking game{cpu}.dylib
2012-01-05 00:24:14 +01:00
dhewg
d4ec9cc87f OSX .dylib's do not get a CPU suffix 2012-01-05 00:24:14 +01:00
dhewg
bf1f05bd87 Rename game${cpu}-d3xp to d3xp${cpu} 2012-01-05 00:24:14 +01:00
dhewg
7f0b7b54ec Drop the cpu suffix on binaries 2012-01-05 00:24:14 +01:00
dhewg
522c5bbccf R_GetModeInfo() doesn't need to be public on OSX
Remove redundant special case.
2012-01-05 00:24:14 +01:00
dhewg
1fed72fbb4 Get rid of Sys_DoPreferences()
The OSX backend was the only one utilizing this to set CVars
for the video mode.
Not required anymore since its now based on SDL.
2012-01-05 00:24:13 +01:00
dhewg
3c90c12605 Don't link against X11 libraries
Not required anymore. All backends use SDL based implementations
now.
2012-01-05 00:24:13 +01:00
dhewg
bf69f7ec76 Use SDL GLimp and input implementations on OSX 2012-01-05 00:24:13 +01:00
dhewg
03d4833aa9 Use memory mapped async mixing on OSX
The OSX specific preferences dialog sets com_asyncSound to "1"
when OpenAL is used, do the same.
2012-01-05 00:24:13 +01:00
dhewg
8df54ffad2 Move OSX ATI_fragment_shader functions
Move the software implementation to
sys/glimp_ati_fragment_shader.cpp in preparation to move to
the SDL based GLimp and events.
2012-01-05 00:24:12 +01:00
dhewg
36870b7e10 Get rid of stubs in the OSX backend 2012-01-05 00:24:12 +01:00
dhewg
b875b54b8b Get rid of Sys_FadeScreens() and Sys_UnfadeScreens()
Unused functions in the OSX backend.
2012-01-05 00:24:12 +01:00
dhewg
fdd6360712 Get rid of Sys_PauseGL() and Sys_ResumeGL()
Unused functions in the OSX backend.
2012-01-05 00:24:12 +01:00
dhewg
fa8e50a086 Get rid of unused Sys_Hide() and Sys_Unhide()
Unused functions in the OSX backend.
2012-01-05 00:24:12 +01:00
dhewg
cab89769b4 Get rid of dead code in the OSX backend
Not used by anything.
2012-01-05 00:24:11 +01:00
dhewg
42841c2435 Get rid of RegCodeHandler()
Unhooked ancient code in the OSX backend which isn't working
for D3XP.
2012-01-05 00:24:11 +01:00
dhewg
8fbc629be6 Add support for spanish keyboard layouts
There is no keyNum_t for º or ª; catch unmapped console keys.
2012-01-05 00:21:43 +01:00
dhewg
3c96e19610 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.
2012-01-05 00:21:43 +01:00
dhewg
8ae3ab7641 Get rid of unhooked draw_exp.cpp
Unused experimental Windows-only renderer.
2012-01-05 00:21:43 +01:00
dhewg
13bf514a8f Get rid of Cg leftovers 2012-01-05 00:21:42 +01:00
dhewg
cf9f5a2623 Use SDL_opengl.h
That already contains an up to date glext.h.
2012-01-05 00:21:10 +01:00
dhewg
8370a7d213 Turn a Warning() in R_FlareDeform into a DPrintf()
The warning is printed on every frame in some areas and slows
down the whole game. Use DPrintf() instead to prevent the
slowdown.
2012-01-03 18:14:21 +01:00
dhewg
bf30c8216a Get rid of GetExceptionCodeInfo()
Unused function is the Windows backend.
2012-01-03 18:14:20 +01:00
dhewg
4740a55295 Don't use a console lock on Windows or OSX builds
Sync with Linux.
2012-01-02 20:00:11 +01:00
dhewg
f7915a5ffa Get rid of dead code in the Windows backend
Not used by anything.
2012-01-02 20:00:11 +01:00
dhewg
6f8bb2dfc3 Remove file logging feature from Common.cpp
SDL already redirects stdout and stderr into files, this is not
required anymore.
2012-01-02 15:44:46 -05:00
dhewg
1af6da6fdd Make the printf() family on Windows print to stdout
SDL logs this into stdout.txt for us.
2012-01-02 15:44:41 -05:00
dhewg
b83868090c Use SDL GLimp and input implementations on Windows
The DirectX SDK is not required anymore.
2012-01-02 15:44:40 -05:00
dhewg
95233c470b Use BufferCommandText() in win_syscon.cpp
Get rid of the dependency of the local event queue.
2012-01-02 15:44:36 -05:00