Commit graph

1241 commits

Author SHA1 Message Date
ewasylishen
0555bd692e Xcode project: created "QuakeSpasmSDL2" target. It expects a copy of SDL2.framework to be in /Library/Frameworks
changes from "QuakeSpasm" target:
- remove double quotes around LIBRARY_SEARCH_PATHS values, this breaks linking on my OS X 10.6/Xcode 3.2.6 system
- drop ppc support
- add USE_SDL2 define
- bump minimum sdk deployment target to 10.5 as required by SDL2

Tested on OS X 10.6.8/Xcode 3.2.6, and OSX 10.9.4/Xcode 5.1.1.

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1055 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 21:22:35 +00:00
sezero
e1cd313574 rename gnu.txt to LICENSE.txt
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1054 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 14:02:30 +00:00
sezero
3f4f366dc9 add code for USE_GAMMA_RAMPS case for SDL2 builds. (still off by default.)
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1053 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 14:00:56 +00:00
sezero
04ec6efeb3 exec default.cfg and config.cfg upon in-game gamedir changes.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1052 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 11:10:22 +00:00
sezero
696214e82e cleanup USE_GAMMA_RAMPS and USE_SDL2 stuff
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1051 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 11:01:02 +00:00
svdijk
4d7387a92a gl_vidsdl.c: Correct some swap interval related messages.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1050 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 07:52:22 +00:00
ewasylishen
9afd65ffbb add a note about high-dpi displays on Windows to the readme.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1049 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 03:03:16 +00:00
ewasylishen
d899666d1c revert r1045 (SetProcessDPIAware).. while it fixed broken fullscreen on one configuration (sdl2/windows 8), it broke another that worked (sdl2/windows 8.1).
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1048 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 02:28:50 +00:00
svdijk
a7f9e3988b Minor cleanups.
in_keys.c: Key_ConsoleBindable: remove redundant check, this is now handled by Key_KeynumToString/Key_StringToKeynum.
in_sdl.c: IN_SendKeyEvents: use a single method for checking whether we have a keydown or keyup event.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1047 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 02:10:14 +00:00
svdijk
0472529285 keys.c: Key_ConsoleBindable: add a better check for "general bindability".
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1046 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 01:59:36 +00:00
ewasylishen
da5de52f1f sys_sdl_win.c: Call SetProcessDPIAware if available (Vista and above) to opt out of the OS scaling our window on a high-dpi display.
SDL (both 1.x and 2.x) is buggy and can't deal with scaled windows.
But we'd probably want to call this anyway beause it give us full-resolution windows.

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1045 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 00:59:24 +00:00
svdijk
a9d1910762 keys.c: Key_ConsoleBindable: special-case key 0, since it essentially means "no key".
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1044 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 23:04:41 +00:00
svdijk
4ada06645b keys.c Key_ConsoleBindable(): add sanity check
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1043 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 22:45:52 +00:00
svdijk
db221199ee in_sdl.c: Restructure the SDL1 backend a bit.
Tested on Linux and Windows with various keyboard layouts. This fixes some text input weirdness on Windows.

Before, we always used the "unicode" field (if available) of SDL's keydown events to overrule the "sym" field with which Key_Event() is called. However, the "unicode" field is only filled for keydown events, so this meant that our keyup events didn't always match their corresponding keydown events. With the introduction of Char_Event(), we can now use the "unicode" field for textinput only, and call Key_Event() with the non-overruled "sym" field. This has the benefit that keyup events now match keydown events, and that we can get rid of several ugly hacks (some platform specific ifdef's and some control character handling).

Note: the translation of the numpad keys to other keys when not in "gamekey" mode was dropped, because otherwise a numpad key could trigger (for intstance) both a textinput and a cursor movement in the console. This is arguably cleaner anyway.



git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1042 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 22:41:44 +00:00
sezero
f2471e55c9 remove SDL_net support which had been unsupported for some time
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1041 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 20:37:35 +00:00
svdijk
08a0fd713d in_sdl.c: SDL2: skip over UTF-8 multibyte characters.
Before, we stopped processing at the first byte of a multibyte character, now we skip over the bytes of a multibyte character and continue. This will probably not have a noticeable effect, but it's arguably more correct.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1040 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 17:46:23 +00:00
svdijk
d2341d3bbc Revert r731 ("Make the key menu scrollable").
In hindsight this really was "shooting a cannon at a mosquito". Even at a resolution of 320x200 we don't actually draw any keybindings off-screen, we just draw the last one very close to the edge (similar to the version string in the bottom right of the console). Although that is not visually pleasing, it is not that likely to actually occur (not many people will use a resolution of 320x200 or set the 2D scaling to the maximum value), and is not worth always having one keybinding "missing" at any scale setting.

(If we even want/need to readd this, it should work dynamically, e.g. calculate a "virtual resolution" from the actual window resolution and the actual 2D scaling value.)


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1039 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 15:57:33 +00:00
svdijk
58f607c014 keys.c Key_Event(): add sanity check
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1038 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 14:27:32 +00:00
sezero
675ee2a2fe documentation update
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1037 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 14:00:25 +00:00
sezero
2453c20e13 apply a modified form of Eric's Makefile.darwin patch from
https://github.com/ericwa/quakespasm-build-scripts/blob/master/sdlframeworkpath.diff


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1036 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 08:37:30 +00:00
ewasylishen
960676cef8 r_world: Add a new R_DrawTextureChains_Multitexture_VBO function. Draws lightmapped surfaces with fulbrights in one pass, using the VBO. Requires 3 TMUs, GL_COMBINE_EXT, and GL_ADD.
R_DrawTextureChains_Multitexture: revert to the way it was before VBO support was added.
gl_texmgr: expose GL_SelectTexture. make the implementation less convoluted and support 3 TMUs.
gl_vidsdl: check GL_MAX_TEXTURE_UNITS
r_brush: only create VBOs if 3 TMUs available

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1035 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 01:08:13 +00:00
sezero
dea5f4274c Makefile.darwin: target 10.5 when building for x86 against SDL2.
build_cross_osx-sdl2.sh: new script for me to cross-build on my linux.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1034 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-17 11:00:28 +00:00
sezero
da841f030e bumped version to 0.90.0
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1033 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-16 09:05:36 +00:00
sezero
8907cca76f update README files to reflect further 0.85.10 changes so far.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1032 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-15 09:10:19 +00:00
sezero
10d5bca4d7 fix SDL2 compilation using g++
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1031 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-14 06:03:56 +00:00
svdijk
a66248f2c4 menu: Add Char_Event support for the textfields in the menu.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1030 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 16:13:16 +00:00
svdijk
3a0f3c6b5b input: Add a function Key_GameKey to separate the input driver layer a bit more.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1029 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 09:39:51 +00:00
svdijk
387c467cbe keys.c: Simplify Key_ConsoleBindable.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1028 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 08:06:04 +00:00
svdijk
3674e9387c input: Some more console-toggle-key tuning.
Partial revert of r1024, since the lastKeyDown stuff is actually needed for SDL2 when the keyboard layout has a printable character that isn't '`' or '~' on the default console-toggle-key (the one below 'Esc'). Instead of hardcoding it though, it is now determined by a new Key_ConsoleBindable function. This makes sure that we don't write an unwanted character into the console as a side effect of opening/closing it, but it still does allow the user to type '`' and '~' in chat messages.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1027 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 07:53:31 +00:00
svdijk
775a688c3c gl_vidsdl.c: Minor VID_Toggle() fast path optimization.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1026 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 01:48:24 +00:00
svdijk
e3279142e9 net_sdlnet.c: Silence an assigned-but-not-used compiler warning.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1025 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 01:42:25 +00:00
svdijk
eede0be6be input: Some cleanup regarding the special treatment of '`' and '~' in the console.
This was hardcoded in in_sdl.c, now it is handled by Char_Console() itself, like it is in Key_Event().


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1024 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 01:34:02 +00:00
svdijk
efb1a35e3e in_sdl: SDL1: don't send '`' or '~' to the console.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1023 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-12 21:01:28 +00:00
svdijk
718ebfb9ff input: remove the USE_SDL2 check from keys.c.
Instead, make the backend responsible for calling either or both
of Key_Event and Char_Event under the appropriate circumstances.
For SDL2 this means no change, for SDL1 this means call both when
a key is pressed, but call only Key_Event when a key is released.



git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1022 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-12 20:37:05 +00:00
svdijk
157f883cc1 keys.c: K_BACKSPACE (127) is a non printable character.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1021 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-12 20:23:20 +00:00
ewasylishen
9f2271278e Revamp SDL2 key handling, based on how ioquake3 does it.
- Reverted the addition of the interpret_shift param to Key_Event
- Now, SDL_KEYUP/SDL_KEYDOWN are converted from SDL scancodes to quake keys, and passed directly to Key_Event with no extra conditions / logic
- When SDL2 is used, Key_Console/Key_Message no longer convert keys to characters to insert in the typing buffer, but all other functionality is unchanged
- SDL_TEXTINPUT calls a new function, Char_Event. This calls either Char_Console/Char_Message depending on the keydest. These just insert the typed text into the buffer

This is cleaner than before because it maintains a clear separation between key presses and characters, whereas the old code was converting characters from SDL_TEXTINPUT back into fake keys and then feeding those into Key_Event. This also fixes Ctrl+C / Ctrl+V not working in the console

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1020 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-12 04:27:54 +00:00
svdijk
573c01174b Makefile[.*]: SDL2 build support. 'make USE_SDL2=1' to enable.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1019 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-11 18:47:07 +00:00
ewasylishen
9524b80f79 Load world and brush models into a VBO, and draw it in batches in R_DrawTextureChains_Multitexture. Uses the same immediate mode code as before if VBOs are not available, or if "-novbo" used at the command line. I only touched R_DrawTextureChains_Multitexture because it's usually the main bottleneck aside from alias model rendering.
This seems to help fps a fair bit on maps with a lot of world polys like jam2_tronyn. Tried on a few computers with intel and nvidia gpus, windows, mac os, linux, and there's always at least some fps improvement. Best case was 70fps -> 96fps on jam2_tronyn, on OS X + nvidia 650gt.

Interested to hear how this works for amd gpu's, just do a timedemo with and without "-novbo".

Only downside is I had to disable the fast path in Vid_Toggle_f() because at least with SDL1, the vbo no longer works after a toggle. So as a result, fullscreen toggles with alt-enter are slightly slower.

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1018 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-11 04:55:16 +00:00
svdijk
389737196f Add some missing SDL2 includes when not using sdl2-config.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1017 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-10 17:41:34 +00:00
sezero
2f8904b379 use getcwd() or some equivalent for host_parms->basedir instead of '.' (from uhexen2)
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1016 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-10 09:51:35 +00:00
sezero
bbd53f0dc3 add missing header
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1015 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-10 09:47:34 +00:00
sezero
7c3d1234a5 update docs after r1013
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1014 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-10 07:40:58 +00:00
sezero
79162a9839 applied the user directories support patch, disabled by default. 'make DO_USERDIRS=1' to enable it.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1013 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-10 07:28:28 +00:00
sezero
098164746b tighten a bit more..
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1012 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-09 11:50:38 +00:00
sezero
140ee9c9c9 improve mission pack loading from cmdline and via the 'game' command:
interpret -missionpack and [-]game missionpack as the same as a new
QuakeSpasm extension.  besides, do not let loading of the mission pack
directory twice.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1011 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-09 10:12:30 +00:00
sezero
b7848d0233 changes/fixes to 'game' command, to replicate FitzQuake Mark V behavior:
* make 'game' command to strip all mission pack support
* make 'game' command to accept an optional second mission pack argument,
  i.e. -hipnotic, -rogue or -quoth.
* so the new behavior does:
  game id1 --> really returns to bare id1 game, doesn't accept any mission pack arguments
  game xxx -hipnotic --> strip down to id1 game, load hipnotic and load xxx on top of them
  game xxx --> strip down to id1 game and load xxx on top of it
* additionally, some extravaganza:
  game xxx --> if the game is already xxx, but the engine was started with -hiptonic
               or -rogue or -quoth, strip down to id1 and reload xxx on top of bare id1
  game xxx -hipnotic --> if the game is already xxx, but the engine was started without
              -hiptonic, strip down to id1, load hipnotic and reload xxx on top of them


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1010 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-09 07:13:20 +00:00
sezero
c4d1052c2b add/remove some newlines to Quakespasm.txt for easier reading
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1009 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-09 07:10:50 +00:00
stevenaaus
a37cf183dc Update doco a little for recent changes.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1008 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-09 01:52:00 +00:00
stevenaaus
dab96331b9 Rename our docos from README.html to Quakespasm.html (etc).
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1007 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-09 00:45:12 +00:00
sezero
d7bf2dff4f fix a r1003 bug in COM_Game_f()
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1006 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 22:15:50 +00:00