Commit graph

596 commits

Author SHA1 Message Date
yamir
12fa28b260 Fix ppc64le build 2019-09-11 13:02:55 -01:00
Daniel Gibson
04a50e1927 Recreate s_scantokey_* tables in win_input.cpp to fix MinGW build
the tables contain character constants like ('ä') that are supposed to
be interpreted as ISO8859-1 or WINDOWS-1252 or sth, but that doesn't
seem to work with MinGW (anymore) - seems like it assumes UTF-8 by
default, and for some reason -finput-charset=ISO8859-1 doesn't help
either, it complains about multichar character constants then..

Anyway, now the table entries are represented as the corresponding
integer constants which seems to work as intended.

Fixes #238
2019-06-17 03:50:07 +02:00
Daniel Gibson
e33921a28a Fix build with CMake < 3.8 by replacing source_group() with stub
dhewm3 uses source_group(TREE ...) which is only supported in
CMake 3.8 and newer.
As it's only cosmetical (so files show up in correct path in IDEs like
Visual Studio), I just replace the source_group() function with a dummy
for affected CMake versions. At least people can still compile then..

fixes #232
2019-04-08 00:59:31 +02:00
Daniel Gibson
3a763fc685 Merge branch 'tools'
Bringing back support for the (MFC-based Windows-only) editing tools.
Only tested 32bit (not sure if the code is 64bit-clean), needs a
"proper" (non-Express) version of Visual Studio *including* MFC support,
tested the free "Community" Editions of VS 2013 and 2017.
(For VS2013 I needed to install the "Visual C++ MFC MBCS Library for
Visual Studio 2013" because it either didn't include MFC support at all
or only the wrong version, don't remember, you'll need that one anyway)
2019-03-11 01:30:26 +01:00
Daniel Gibson
5c1e1d7708 Fix ParticleEditor's Materialpicker screwing up ViewPort
In short, it uses a idGLDrawableMaterial widget that calls
renderSystem->BeginFrame(w, h); (with w and h being small for the texture
preview window) and BeginFrame() sets glConfig.vidWidth and vidHeight to
w/h and that never got reset to the original value (window width/height).
This breaks everything because for some reason
renderSystem->GetSCreenWidth()/Height() return glConfig.vidWidth/Height
so it will just continue to render everything at that resolution (in a
small rectangle on the lower left corner of the window).
This bug has already existed in Doom3 1.3.1 (but was less noticable because
apparently  when switching away from Doom3 and back to the window it reset
vidWidth/Height to the window resolution)
I only implemented a workaround (restore glConfig.vid* after rendering the
texture preview), it's possible that the same issue exists in other
(probably editor-) code - but a "proper fix" might also break code (and I'm
not super-familiar with the editor code or even just using them)
2019-03-10 05:23:06 +01:00
Daniel Gibson
b0d022f559 Fix crash when selecting nonexistant texture in D3Radiant
When selecting a texture in Inspectors -> Media -> Textures that doesn't
really exist (.mtr defines it, but referenced image files are missing),
the game/editor used to crash.
The problem was that somehow people thought the best way to communicate
that a file wasn't found was by setting the timestamp to 0xFFFFFFFF
and then checking for that - sometimes (incorrectly) by comparing it to -1.
That worked for 32bit ID_TIME_T (typedefed to time_t), but not with 64bit
time_t, which now seems to be the default for Win32 in VS.
So I replaced a few -1 and 0xFF... with FILE_NOT_FOUND_TIMESTAMP and now it
works.
FILE_NOT_FOUND_TIMESTAMP is still defined as 0xFFFFFFFF, maybe I should
change that, unsure if that'd break anything though..
When changing it one should keep in mind that time_t might still be 32bit
on some platforms (Linux x86?) so that should still work.. (-1 could work)
2019-03-10 05:11:33 +01:00
Dmitry Marakasov
17c10d40a5 Fix build on powerpc but not mac
...by including `vecLib/vecLib.h` only on `__APPLE__`, and not just any `__ppc__`

From https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235668:

> On powerpc* platforms vecLib/vecLib.h is included by default.
> This header is only available on Mac OS X, so remove it. It
> doesn't seem to be actually needed to compile this port.
2019-02-14 16:53:38 +01:00
Klez
31e877e7e4 Compilation fix on 64 bit macOS. Upgrade min SDK version
Upgrade CMakeLists.txt minimum SDK version for compiling in macOS to v.10.9 "Mavericks" for 64 bit builds.
Until now, make failed with this error:

warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from /Juegos/dhewm3/neo/idlib/bv/Bounds.cpp:29:
/Juegos/dhewm3/neo/sys/platform.h:185:10: fatal error: 'cstddef' file not found
#include <cstddef>
         ^~~~~~~~~
1 warning and 1 error generated.
2019-01-15 16:28:07 +01:00
Daniel Gibson
9a95a2a1cf Building with editor support (on Win w/ VS2017) works \o/
Editor also seems to start, didn't test much further.

Only tested 32bit Windows, I fear the editor code isn't 64bit clean..

I hope I haven't broken anything elsewhere..
2019-01-13 22:52:28 +01:00
Daniel Gibson
596d40d5c9 MSVC: Shut up Compiler warning in Matrix.h if asserts are disabled 2019-01-13 22:12:36 +01:00
Daniel Gibson
c60f630eea GUI Editor code/integration from SteelStorm2, doesn't build yet 2019-01-13 22:12:36 +01:00
Daniel Gibson
08970f186d CMake: Don't try to find X11
causes trouble on macOS, and we shouldn't interact with X11 directly
anyway, because SDL does it for us.
OpenBSD apparently needed it (at least it was added for OpenBSD
support), but the only place I can imagine it being needed is the
superfluous #include <SDL_syswm.h> in neo/sys/glimp.cpp - which I now
removed. In case it's needed after all please tell me, then I'll add it
again - but guarded by if(os STREQUALS "OpenBSD") or however one checks
for OpenBSD in CMake.
2019-01-13 19:06:32 +01:00
Daniel Gibson
cd0ec54991 CMake: Fix build in path with spaces
fixes #174
2019-01-13 19:03:12 +01:00
Yamagi Burmeister
48b8c199d9 We need to link libexecinfo for the backtrace() functions on FreeBSD. 2019-01-13 18:39:10 +01:00
Daniel Gibson
1320e29aaf Implement Signal-Handlers for POSIX systems, incl. SIGTTIN/SIGTTOU
handling SIGTTIN/OU allows running Doom3 in the background (or even
sending it to the background with Ctrl-Z + bg) by disabling TTY input
(before it would get stuck when run in background without +set in_tty 0,
 see #215)

While at it, I also added signal handlers for some common crash signals
(SIGILL, SIGABRT, SIGFPE, SIGSEGV) to print a backtrace before exiting
the game (partly based on Yamagi Quake II code).
2019-01-13 07:07:39 +01:00
Daniel Gibson
bd39f9ecf2 CMake: Make source files listing in VS usable
For some reason CMake thinks it's a great default to display all the source
files of a project in Visual Studio as a flat list (instead of in the
directory structure they're physically in).
source_group(TREE ...) *per project/"target"* helps.

Also, so far there was no reason to list or otherwise use header files
in CMakeLists.txt - but for them to turn up in VS they must be added to
the source lists. I've done that, but I'm sloppily globbing them instead
of adding each headder manually like it's done for the source files
(because it doesn't matter if a header that's not really used turns up
in those lists)
2019-01-07 15:06:59 +01:00
Daniel Gibson
6a507c6a5b Windows: Don't put stdout.txt and stderr.txt into binary dir
It might not be writable.. which will cause game startup to fail.
Put them in My Documents/My Games/dhewm3/ instead, like the save games.
2019-01-07 15:06:59 +01:00
Daniel Gibson
fa363ab5ef Fallback to demo/ should work better now
i.e. also when not starting the game with +set fs_basepath /bla/
2019-01-07 15:06:59 +01:00
Daniel Gibson
efd814a4e0 Fall back to demo/ if no gamedata can be found in base/
The demo game data is in demo/ instead of base/, so try to fall back
to that to cause minimal confusion.
2019-01-07 15:06:59 +01:00
Daniel Gibson
42886f0e4b Modify check for Demo version to not break Game DLL ABI
Changing idSession would break the interface for Game DLLs, making the
existing ports of Mods incompatible.
Luckily we have idCommon::GetAdditionalFunction() for cases like this..

Also added a check for WEAPON_NETFIRING in idWeapon::EnterCinematic(),
I got an Assert() there in Debug builds.

Running the Demo seems to work now, at least I could finish it without
any problems (ignoring some warnings in the console)
2019-01-07 15:06:59 +01:00
Daniel Gibson
cf35cecbc7 Revert changes for Demo to d3xp/ - Demo only needs game/ code 2019-01-07 15:06:59 +01:00
gab
7d9d8680e1 Additional fix 2019-01-07 15:06:59 +01:00
gab
12629e1f66 Support for D3 demo data files (minimum viable changes) 2019-01-07 15:06:59 +01:00
Daniel Gibson
53e0db9f41 Bump version to 1.5.1pre
this is not 1.5.0 anymore.
2019-01-07 15:06:59 +01:00
Daniel Gibson
593141651a Fix ModWiki links in --help text, link Mods page in README 2018-12-21 04:49:00 +01:00
Daniel Gibson
9822aea458 Change version to 1.5.0
I think the release is ready, not 100% sure though
2018-12-15 05:49:59 +01:00
Daniel Gibson
f11c176f67 CMake: LINUX_RELEASE_BINS option that sets RPATH $ORIGIN/libs/
so we can bundle some libs with dhewm3 for Linux binaries
2018-12-15 05:49:19 +01:00
Daniel Gibson
1d647fcad8 make com_fixedTic CVAR_ARCHIVE 2018-12-15 00:55:34 +01:00
Daniel Gibson
5c813ee738 Allow com_fixedtic -1 (unlimited framerate)
it's not enabled by default, but Revility said it works.
2018-12-09 06:21:17 +01:00
Daniel Gibson
3ab553bcf9 Fix pot. Crash in idWinding2D::ExpandForAxialBox()
it could happen that i is 1 but numPlanes is still 0
(=> if for i = 0:  ( p[j] - p[i] ).LengthSqr() < 0.01f )
so planes[-1] would be accessed which of course is invalid and can crash
2018-12-09 04:16:43 +01:00
Daniel Gibson
bca648709f Only set LINUX_DEFAULT_PATH in Licensee.h if not already set
allows setting it from the build system - I think OpenBSD at least
used to use this.
2018-12-09 04:12:22 +01:00
Daniel Gibson
807b329fb7 A little change to minizips ioapi.h for OpenBSD 2018-11-23 00:20:02 +01:00
Daniel Gibson
f982f2c1dd dhewm3 1.5.0 RC2
releasing RC2 with the SDL workaround so it runs smoothly again
on Windows
2018-11-20 14:54:39 +01:00
Daniel Gibson
d6773d304f Work around SDL bug that causes little freezes, see #188 2018-11-20 14:19:11 +01:00
Daniel Gibson
a2c99f9fca dhewm3 1.5.0rc1, link Mods/SDK repo in README
I decided that the next version will be 1.5.0 (not 1.4.2), because the
game DLL interface has changed since 1.4.1
2018-11-11 23:31:55 +01:00
Daniel Gibson
4e2f2c6241 Show dhewm3 version in window title 2018-11-11 23:24:07 +01:00
Daniel Gibson
3ca51bd73e Disable Assertions in Release builds
and handle the potential problem detected by one assert() that
apparently occurs (very rarely) with Ruiner/Riveness.
2018-11-11 23:21:23 +01:00
Daniel Gibson
4a94ec0ac0 Output --help text to Console window on Windows
(that Console thing they wrote for the dedicated server which is also used
by Sys_Error())
2018-11-10 20:28:02 +01:00
Daniel Gibson
f5dfdead43 Do the cursor/crosshair scaling to 4:3 also when loading savegame 2018-11-05 04:54:53 +01:00
Daniel Gibson
f407b2b8e9 Increase Script MAX_GLOBALS in vanilla game DLL
It's the same value d3xp uses.
This is for mods that have their own (more complex) scripts, but use
the standard base.dll/.so
2018-11-05 04:33:57 +01:00
Daniel Gibson
cd0a11f974 Allow scaling non-menu WIN_DESKTOP GUIs to 4:3
WIN_DESKTOP means that this can currently only be set for the top-level
window in a .gui (all its subwindows/widgets will be scaled implicitly)

There are two ways to make a GUI use this:
1. in the .gui add a window variable "scaleto43 1", like
    windowDef Desktop {
	rect	0 ,0 ,640 ,480
	nocursor	1
	float	talk 	0

	scaleto43 1

	// .. etc rest of windowDef

2. When creating the GUI from C++ code, you can afterwards make the
   UserInterface scale to 4:3 like this:
    idUserInterface* ui = Whatever(); // create it
    ui->SetStateBool("scaleto43", true);
    ui->StateChanged(gameLocal.time);
   Both lines are important!

As you can see in my changes to Player.cpp, my primary usecase for this
is the cursor/crosshair GUI.
2018-11-05 04:33:57 +01:00
Daniel Gibson
6c1efd5a29 GCC/Clang: Don't use -ffast-math, Debug Build with -O0
I don't trust -ffast-math, not even with -fno-unsafe-math-optimizations
2018-11-05 04:33:57 +01:00
Tobias Frost
be5f1dac91 Revise patch after comments 2018-10-28 19:53:39 +01:00
Daniel Gibson
e41bf2b147 Scale "Menu" GUIs (incl. PDA + fullscreen vids) to 4:3
So stuff doesn't look so distorted in widescreen resolutions.
Implies that there are black bars on the left/right then..

Can be disabled with "r_scaleMenusTo43 0"

Does *not* affect the HUD (incl. crosshair) - scaling it automagically
would be very hard (or impossible), because it doesn't only render
the crosshair, healthpoints etc, but also fullscreen effects like the
screen turning red when the player is hit - and fullscreen effects
would look very shitty if they didn't cover the whole screen but had
"empty" bars on left/right.

(Mostly) fixes #188 and #189
2018-10-28 05:29:11 +01:00
Daniel Gibson
7a8f0e9fdb Allow injecting video mode list into Mod menus
Mods that have their own video settings menu can tell dhewm3 to replace
the "choices" and "values" entries in their choiceDef with the
resolutions supported by dhewm3 (and corresponding modes).
So if we add new video modes to dhewm3, they'll automatically appear in
the menu without changing the .gui
To enable this, the mod authors only need to add a "injectResolutions 1"
entry to their resolution choiceDef. By default, the first entry will
be "r_custom*" for r_mode -1, which means "custom resolution, use
r_customWidth and r_customHeight".
If that entry shoud be disabled for the mod, just add another entry:
"injectCustomResolutionMode 0"
2018-10-21 23:56:38 +02:00
Daniel Gibson
519cc68b0e idCommon::SetCallback() and GetAdditionalFunction() - for Mods
This is an ugly hack that allows both exporting additional functions
(incl. methods via static function + void* userArg) to Game DLLs
and setting callback functions from the Game DLL that the Engine will
call, without breaking the Game API (again after this change).
This is mostly meant for replacing ugly hacks with SourceHook and
similar and mods (yes, this is still an ugly hack, but less ugly).

See the huge comment in Common.h for more information.

Right now the only thing implemented is a Callback for when images
are reloaded (via reloadImages or vid_restart) - Ruiner needs that.

Also increased GAME_API_VERSION to 9, because this breaks the A[PB]I
(hopefully after the next release it won't be broken in the foreseeable
 future)
2018-09-30 05:06:20 +02:00
Daniel Gibson
9e2b73bff6 Implement --help cmdline arg, set version to 1.4.2pre
if --help or -h or -help or -? or /? is passed as commandline argument,
the help is printed (to stdout) and then the game quits.
The help shows some helpful commandline arguments, including how to
tell the engine where to find the game data, how to set the resolution
and more
2018-09-03 04:11:46 +02:00
Yamagi Burmeister
4a6327d87a Fix entering the menu or saving the game stopping some sounds.
If an OpenAL source runs out of samples it transisions into state
AL_STOPPED. That happens if we're entering the menu (which switches
to another soundworld) and when saving the game (because the game
blocks for some milliseconds). Work around this by adding a new
field 'stopped' to the channel state and use that to determine if
a sound was stopped. And not AL_STOPPED like before.
2018-08-19 16:58:44 +02:00
Daniel Gibson
84a70a3a05 Tell Windows we're High DPI aware, (hopefully) fixes #191
taken (with permission) from Yamagi Quake II, thanks a lot!
2018-07-14 20:54:21 +02:00
Yamagi Burmeister
043f0dfaa0 Lower release build optimizations from -O3 to -O2.
In the last few weeks I've played again through the game and kept an eye
on small oddities. And there're a lot of them. For example some GUIs and
videos getting stuck after the first frame (issue #192) or being unable
to protect the guy with the lamp in Alpha Labs 3. Some digging proved
that most - if not all - of these problems are caused by the compilers
optimization level. When build with -O2 both g++ 8.1 and clang 6.0.0 are
producing working code. g++ 8.1 with -O3 has some small, hard to notice
oddities, clang 6.0.0 with -O3 shows a lot of them. Since there's not
measurable difference between -O3 and -O2 just go down to the later:

x doom_o3.txt
+ doom_o2.txt
+----------------------------------------------------------------------+
|                                                               +      |
|                                      +                        *      |
|x                                     *           x            *      |
|                 |_____________________|___A______M__A_________M___|_||
+----------------------------------------------------------------------+

    N        Min           Max        Median           Avg        Stddev
x   5        173           178           177         176.4     2.0736441
+   5        176           178           178         177.2     1.0954451
2018-07-03 13:34:45 -01:00
Tobias Frost
dbb90b7565 Some spelling error fixes found during Debian build
- s/allready/already
- s/Uknown/Unknown
- s/thier/their
2018-06-30 00:08:45 -01:00
Andre Heider
83b358ddbe Fix color glitches on cinematics for selected archs
These two casts assumed char is signed, which is not a valid assumption.
Be explicit.

Fixes idlogo.roq on e.g. aarch64.
2018-02-23 13:40:11 +01:00
Andre Heider
bbcb2b00dc Fix endless loop with in_tty on selected archs
Ran into this on aarch64.

Quoting http://c-faq.com/stdio/getcharc.html
"The bug can go undetected for a long time" :)

Fixes #102
2018-02-22 22:42:00 +01:00
Daniel Gibson
3c01757d27 Scale down volume of all sounds, fixes #179
so even with many loud sounds the overall volume isn't reduced by
OpenAL - apparently OpenAL scales down all sounds temporarily if the
mixed result would be too loud or sth like that.
Just sending all sounds to OpenAL with a lower volume prevents that from
happening (just set your system speaker volume a bit higher if needed).
This problem was especially noticable when shooting at metal walls with
the shotgun (each pellet produces an impact sound so it gets kinda loud)
2018-02-12 03:31:34 +01:00
Daniel Gibson
ebac192352 Don't Shut down the game with Error() if OpenAL buffer commands fail
based on a Patch from https://github.com/PROPHESSOR, see
https://github.com/dhewm/dhewm3/pull/184
(I added a common->Warning() as a compromise between common->Error()
 and just ignoring the error)
2018-02-12 03:31:34 +01:00
Kalamatee
c8cdb641d4 # move the AROS specific folder icon and default.cfg mmakefile.src under neo/sys/aros/setup
# add a comment to the top level AROS mmakefile.src to clarify that it is specifically for AROS.
2017-04-22 16:21:14 +02:00
Kalamatee
c482b2da13 update for AROS build system changes. Use the defined flags in case the compiler doesn't support them. 2017-04-22 16:21:14 +02:00
Kalamatee
7a2da3127e update for AROS trunk changes 2017-04-22 16:21:14 +02:00
Kalamatee
edf3b077ce use the correct extension for x86 2017-04-22 16:21:14 +02:00
Kalamatee
4813718954 use socklen_t 2017-04-22 16:21:14 +02:00
Kalamatee
315d66f8f8 rename the resurrection of evil files to just "ROE". 2017-04-22 16:21:14 +02:00
Kalamatee
17c66c3da0 pass static-libstdc++ via USER_LDFLAGS 2017-04-22 16:21:14 +02:00
Kalamatee
1a7c574dce delint 2017-04-22 16:21:14 +02:00
Kalamatee
d1fe0b7cb3 add dependency on libjpeg 2017-04-02 00:42:29 +01:00
Kalamatee
f83e270cdb revert changes committed in error 2017-04-02 00:42:28 +01:00
Kalamatee
46279bf11f import AROS changes 2017-04-02 00:42:28 +01:00
Turo Lamminen
d535e54c90 Add 2560x1440 screen mode 2017-04-02 00:48:40 +02:00
Turo Lamminen
9e628e8474 Fix read from uninitialized part of buffer
According to "man 2 readlink": "readlink() does not append a null byte to buf."
I have no idea how this worked up to now.
2017-03-14 22:19:20 +01:00
Turo Lamminen
5da6374663 Fix idStr self-assignment
Was calling memcpy with overlapping parameters which is inefficient,
undefined behavior and Valgrind complained about it.
2017-03-14 21:45:40 +01:00
Turo Lamminen
f26f70c717 Fix stack overflow in SSE code
This was checking the wrong variable so when count was < 4 it was writing
past the end of buffer and potentially breaking the stack.
2017-03-14 21:11:13 +01:00
Daniel Gibson
3d57e99e0a Hopefully fix built on OSX El Capitan with libjpeg9 2017-02-27 20:19:20 +01:00
David Carlier
09c1330a0e make it compilable under openbsd 2016-12-09 16:21:54 +00:00
Daniel Gibson
665ed62d8e Version 1.4.1 2016-06-19 01:48:20 +02:00
Daniel Gibson
89f227b365 1.4.1 Release Candidate 1 2015-12-23 03:57:35 +01:00
Daniel Gibson
befe732dbb Fix new[]/delete missmatches and memory leaks found by clang's ASAN
Sometimes memory was allocated with new[] but freed with delete instead
of delete[], which is wrong.
And there were some small memory leaks, too.
Furtunately clang's AddressSanitizer detected all that so I could easily
fix it.

(There seem to be some more small memory leaks which are harder to fix,
though)
2015-12-17 18:11:03 +01:00
Daniel Gibson
9950a5721f Fix heap corruption when loading (broken?) .ma models
On FreeBSD, the game used to crash when loading the last level of RoE
(d3xp), while loading models/david/hell_h7.ma.
The problem could be reproduced on Linux whith #define USE_LIBC_MALLOC 1
and clang's AddressSanitizer.
Turns out that this file specifies a vertex transform for a non-existent
vertex (index 31, while we only have 0-30) and thus the bounds of
pMesh->vertexes[] are violated.
I added a check to ensure the index is within the bounds and a Warning
if it isn't.
It should work now. If however it turns out that more files have this
problem, maybe .ma is parsed incorrectly and we need a differently fix.

(Should) fix #138
2015-12-17 18:07:35 +01:00
Daniel Gibson
df90fce6a5 small improvement for handling up to 8 mouse buttons
as we do int buttonIndex = ev.button.button - SDL_BUTTON_LEFT;
it's only consistent to do if(ev.button.button < SDL_BUTTON_LEFT + 8)

it doesn't really make any difference as long as SDL_BUTTON_LEFT is 1,
but this way it's safe for SDL3 or whatever future version might break
the ABI.
2015-12-13 03:49:29 +01:00
Sébastien Noel
32feff2be1 handle up to 8 buttons with SDL2 based on https://github.com/RobertBeckebans/RBDOOM-3-BFG/pull/213
it's buggy on Linux/X11 before 2.0.4, but it works fine on other platforms
extra bonus: don't generate garbage events for unknown mouse buttons
2015-12-13 03:30:43 +01:00
Daniel Gibson
48511003b6 Unix: On failed assertion, break gracefully into debugger
__builtin_trap() causes an illegal instruction and thus the process
can't resume afterwards.
raise(SIGTRAP) only breaks into the debugger and thus allows to
"ignore" the assertion while debugging.
2015-12-13 03:30:03 +01:00
Daniel Gibson
b03fc9271a Fix crash by assert in last RoE level (and maybe elsewhere)
The assertion in idBounds::operator-(const idBounds&) was triggered
from idWeapon::Event_LaunchProjectiles() (ownerBounds - projBounds)
It only happened when using the BFG.
So I added a check to make sure calling operator- is legal.

I guess this also caused #122
2015-12-13 03:30:03 +01:00
Daniel Gibson
c5ad45368a Workaround to better support AZERTY keyboards
The first row of AZERTY-Keyboards (used in France and Belgium) doesn't
have numbers as keys but ², &, é, ", ', (, -, è, _, ç, à, ), =
(with small differences between France and Belgium).
For some of those keys we don't have keycodes - and neither does SDL2.
See also https://bugzilla.libsdl.org/show_bug.cgi?id=3188

As a workaround, just map those keys to 1, 2, ..., 9, 0 anyway, as those
are keys Quake2 already knows (and those chars are printed on the keys
too, for typing they're reachable via shift).
This workaround only works for SDL2, as SDL1.2 doesn't have Scancodes
which we need to identify the keys.

This should obsolete one part of pull request #135
2015-11-22 23:21:30 +01:00
Daniel Gibson
1680603d8c Sort vidmodes in menu, add 2880x1800
it's the native resolution of "Macbook Pro retina 15-inch mid 2014"
2015-10-30 21:41:18 +01:00
Daniel Gibson
4198f92bd5 ignore unknown SDL events
they just spam the console and don't matter anyway.
for example, on OS X you get lots of SDL_FINGER* events that spam
the console.
2015-10-23 18:19:46 +02:00
Daniel Gibson
9958e3807c Win32: Don't access FILE::_file, use _fileno() instead
It has always been ugly to do that with and MSVC2015 doesn't seem to
work at all.
2015-10-11 23:32:31 +02:00
leffmann
c86e394da5 more fixes for Visual Studio 14 2015-10-11 23:27:42 +02:00
leffmann
498ef9cb83 make d3xp build with Visual Studio 14 2015-10-11 23:27:42 +02:00
leffmann
61aee9ed29 make base build with Visual Studio 14 2015-10-11 23:27:42 +02:00
leffmann
db461045bf make idlib build with Visual Studio 14 2015-10-11 00:36:25 +02:00
Daniel Gibson
999b5635f4 change version number to 1.4.1pre
so hopefully people trying code from git won't report problems (that
might be new) as bugs in 1.4.0
2015-10-11 00:36:25 +02:00
Daniel Gibson
5f6177839f Version 1.4.0
Thanks to all the testers!
Especially from http://idtechforums.fuzzylogicinc.com/
http://www.holarse-linuxgaming.de/ (special thanks to NoXPhasma!)
http://www.quakehaus.com/ and #iodoom3.

Also many thanks to everyone reporting bugs and sending pull requests
over the years.
And dhewg of course for starting this and doing all the hard work :-)
2015-10-09 16:06:49 +02:00
Daniel Gibson
8f4f1ca39f Get rid of "WARNING: unknown event 770" on Windows
It's an SDL_TEXTEDITING event which we seem to get on Windows whenever
the Window gains focus (or is created). I think it can be safely
ignored, so that's what I do.

I also changed how those warnings are printed - as a hex number now,
because they're defined as hex numbers in the SDL source and it's easier
to find out what kind of event it is this way.
2015-10-05 15:14:42 +02:00
Daniel Gibson
dad0eda29e Release Candiate 1 preparations, other small fixes 2015-10-03 19:14:22 +02:00
Daniel Gibson
5ab546f67d Esc should only open menu if shift isn't pressed (=> shift+esc for console)
When ingame, Shift-Esc would open the menu and another Shift-Esc the
console. Now it immediately opens the console and only Esc without
Shift opens the menu.
2015-10-03 18:58:49 +02:00
svdijk
dd082b78de Win32: Add an icon to the dhewm3 executable 2015-10-03 09:17:30 +02:00
Daniel Gibson
61d3efec98 Fix mouse cursor moving to fast in fullscreen GUIs (main menu, PDA)
The fullscreen guis pretend to be 640x480 internally, also for the mouse
cursor position. So adding the actually moved pixels (when playing the
game at a higher resolution) to the GUIs cursor position makes it move
too fast.
To fix that I detect (hopefully that check is reliable!) if the
idUserInterfaceLocal instance is a fullscreen GUI and if so scale the
reported mouse moved pixels with 640/actual_window_width and
480/actual_window_height.
2015-09-30 18:38:27 +02:00
Daniel Gibson
412dad6758 Sys_GetEvent(): Don't return res_none when more events are available
If res_none (event with .evType == EV_NONE) is returned,
idEventLoop::RunEventLoop() will assume there are no more events this
frame => pending events will be delayed til next frame (or later if
again res_none is returned in the meantime).
So res_none shouldn't be returned just because there was an SDL event
we didn't care about or we did care about but don't generate a doom3
event for (but toggle fullscreen or something).
Instead we should just fetch and handle the next SDL event.
2015-09-30 15:58:50 +02:00
Daniel Gibson
66f7b6aa87 no allocation per SDL_TEXTINPUT event
those event have a max size (SDL_TEXTINPUTEVENT_TEXT_SIZE) so we can
just use a static buffer.
2015-09-30 15:41:14 +02:00
Francisco Magalhães
32afbca7c1 Add support for brazilian keyboard layout 2015-09-30 15:12:10 +02:00
Daniel Gibson
c333a46373 Linux: Fix fallback to look for gamedata in /usr/local/games/doom3/
Before checking there I look for gamedata next to the executable, but
the check was broken: I got the directory the executable is in and
checked if it exists.. well.. of course it does, but that doesn't mean
there's game data in it..
So now I check if that directory actually has a "base/" subdirectory
(or whatever is #defined in BASE_GAMEDIR) and if that fails
/usr/local/games/doom3/ is tried instead.

Thanks chungy for pointing the bug out in #97 !
2015-09-30 15:07:51 +02:00
Daniel Gibson
6ba1b71fb1 Change default values for some video and sound (EAX) CVars
* r_mode defaults to 5 (1024x768), I think that's more sane than 640x480
* r_fullscreen defaults to 0 (=> windowed mode) because fullscreen in
  the wrong resolution sucks.. let people do their initial configuration
  in windowed mode
* r_swapInterval defaults to 1 (=> VSync active by default) because that
  makes the game feel more smooth and most PCs should be able to 60fps
  in this 11years old game anyway

* s_useEAXReverb defaults to 1 (=> use EAX/EFX effects by default),
  because OpenAL-soft supports them on all platforms/hardware and if
  for some reason the used OpenAL implementation doesn't support it,
  it's deactivated automatically anyway.

All these things can be configured in the Options Menu.
2015-09-29 21:14:45 +02:00