Commit graph

1136 commits

Author SHA1 Message Date
Eric Wasylishen
5660094d1d host_cmd.c: add new "setpos" command.
developer cheat to teleport to a given origin, optionally looking in a given direction.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1308 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-06-07 07:08:23 +00:00
Ozkan Sezer
33fe493c89 sync net_sys.h with the uhexen2 tree.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1307 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-05-31 20:01:09 +00:00
Eric Wasylishen
759aa803d1 CL_Tracepos_f: fix wrong trace endpoint (developer function added in Fitzquake)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1304 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-05-21 19:50:03 +00:00
Ozkan Sezer
f07ac29c0b fix C++11 -Wliteral-suffix warnings. fix -Wnarrowing errors/warnings.
fix the detestable in_sdl.c/SDL2 int-to-enum conversion failure errors
from g++.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1302 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-04-29 20:00:50 +00:00
Ozkan Sezer
f3af6bf791 Fixed -Wmisleading-indentation warnings from new gcc6.
The warning from gl_model.c:Mod_LoadTextures() seemed
like a real bug: Eric please check and confirm.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1301 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-04-28 21:47:12 +00:00
Ozkan Sezer
5af28b2121 windows: use target-specfic flags for gcc too (-m32/-m64). hmph..
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1299 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-04-18 14:01:55 +00:00
Ozkan Sezer
f22eed7f57 use specific target flags with windres (pe-i386/pe-x86-64 for w32/w64),
just in case the compiler toolchain is a multilib one.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1298 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-04-17 19:10:01 +00:00
Eric Wasylishen
39a6b46713 in_sdl.c: lower default controller deadzone to 0.175. refactor a bit, fix clamping of look axis vector length.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1297 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-03-09 04:42:44 +00:00
Eric Wasylishen
f8ccd07420 in_sdl.c: IN_StartupJoystick: do SDL_INIT_GAMECONTROLLER before SDL_GameControllerAddMappingsFromFile, to match the sdl testgamecontroller tool
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1296 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-03-03 23:01:44 +00:00
Eric Wasylishen
dfcaa52260 in_sdl.c: improve error messages when opening joysticks
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1295 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-03-03 21:38:58 +00:00
Eric Wasylishen
e007e35e6d in_sdl.c: fix spurious "-1 mappings loaded from gamecontrollerdb.txt" message
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1294 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-03-02 00:04:25 +00:00
Eric Wasylishen
dc2218b9c8 SDL2 Game Controller support
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1293 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-03-01 21:58:08 +00:00
Eric Wasylishen
9c9facfe7b gl_vidsdl.c: add vid_borderless cvar for getting a borderless window
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1292 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-02-26 20:18:27 +00:00
Eric Wasylishen
185f2f2883 R_UpdateWarpTextures: workaround osx 10.6 driver bug when using FSAA, reported by Barnak.
R_Clear only clears the warpimage part of the screen, leading to an unplayable
HOM effect on the rest of the screen.

The workaround is calling GL_SetCanvas(CANVAS_DEFAULT); at the end of
R_UpdateWarpTextures, it should be harmless enough on other systems, so not sure
if it's worth making this workaround conditional.

My guess is glClear in this implementation is wrongly using glViewport as the
area to clear.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1291 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-02-26 07:37:00 +00:00
Eric Wasylishen
150be12da1 Contrast support with a "contrast" cvar, behaving the same as MarkV's.
It may be a useful alternative to the existing gamma control for laptops in a bright environment, etc.
(raising contrast gives less of a gray/washed out look than raising gamma, but as a disadvantage, colours near white get clipped to white.)

It's also implemented for both GLSL and SDL gamma ramps, but only if USE_GAMMA_RAMPS is set to 1.
Since USE_GAMMA_RAMPS  is 0, currently it only works with GLSL.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1290 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-02-12 23:26:36 +00:00
Eric Wasylishen
ebd73d2a3c world.c: use DoublePrecisionDotProduct to fix items falling out of the world
on oms3.bsp on SSE builds.

Thanks to ParuBaru for reporting the issue.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1289 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-02-01 22:41:15 +00:00
Eric Wasylishen
36d9cc4b42 Default gl_clear to 1, as described in "Common mistakes" https://www.opengl.org/wiki/Common_Mistakes#Swap_Buffers
"The buffers should always be cleared. On much older hardware, there was a technique to get away without clearing the scene, but on even semi-recent hardware, this will actually make things slower. So always do the clear."
Plus it's nice for map development / debugging.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1287 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-01-29 20:47:24 +00:00
Eric Wasylishen
ae8a4f82da SV_SpawnServer: use malloc for sv.edicts, and only zero it as needed
Previously we were Hunk_Alloc'ing space for 8192 edicts (by default) which zeros all of that memory, this way we only use as much RAM as needed since the unuesd pages aren't dirtied

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1286 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-01-29 01:05:11 +00:00
Eric Wasylishen
70a472bed1 GL_Init: log gl_vendor, gl_renderer, gl_version to the console.
Taken from RMQEngine. the idea is to ensure every -condebug log has the gfx driver version logged.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1284 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-01-28 06:07:07 +00:00
Ozkan Sezer
16a84f52b8 bumped version to 0.91.1 for future development
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1283 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-01-18 07:28:03 +00:00
Eric Wasylishen
65727a9810 max_edicts: raise to 8192 (from 2048) and make non-archived, to reduce the need for players to mess with it to get maps/mods to run.
Some measurements on the size of the sv.edicts hunk allocation, with this change, on various mods (it depends on the number of QC entity fields):
id1 7MB, quoth 11 MB, arcadim 21 MB, rrp 9MB,  ne_ruins 16MB.

Since this is a Hunk_Alloc, the whole 10-20MB is cleared to zero which will allocate that much physical ram.
We could probably change it to a malloc later, and not clear the memory, so physical ram is only allocated when the memory is cleared in ED_Alloc.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1278 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-01-10 23:03:06 +00:00
Eric Wasylishen
74eb6b0f9d Raise default heapsize to 256MB and zone to 4MB (matching Fitz MarkV)
N.B.: I verified with the OS X Instruments tool that unused space in the heap isn't dirtied (e.g. we never memset the entire heap, only the portions returned by Hunk_Alloc) so this should have no impact on RAM required.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1276 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-01-09 20:29:22 +00:00
Eric Wasylishen
0da03db7b8 zone.c: fix padding in memblock_t struct to works as intended. the previous layout was probably harmless but wasted a few bytes.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1275 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-01-09 20:03:27 +00:00
Eric Wasylishen
ba5ce1e5af TexMgr_RecalcWarpImageSize: removed early exit if (gl_warpimagesize == oldsize), fixes liquids sometimes turning to noise after a mode change.
after vid_restart TexMgr_ReloadImage reloads textures to tx->source_width/source_height, which might not match oldsize.
fixes: https://sourceforge.net/p/quakespasm/bugs/13/

steps to reproduce (fixed) bug:
-launch at 640x480, windowed, and with "r_oldwater 0"
-do "map start"
-change to 1024x768 windowed
-change to 1920x1080 windowed
-this last mode change makes liquid textures turn into random garbage.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1274 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-01-08 08:22:27 +00:00
Eric Wasylishen
239503c998 VID_Toggle: disable the fast path entirely because it was failing on SDL2/WinXP.
(640x480 fullscreen -> windowed would give a large 1280x768 window mostly filled with garbage).

Previously, we were only using the fast path on old systems (no VBO support) anyway.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1272 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-01-03 08:38:46 +00:00
Eric Wasylishen
35631f4b02 snd_dma.c: raise MAX_SFX to 1024, for the upcoming arcadim mod.
Uses only 36k extra of hunk memory, less for 32-bit builds, so shouldn't have any negative effects.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1266 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-12-22 06:22:29 +00:00
Eric Wasylishen
be808701ea GLSLGamma_GammaCorrect: clear the cached texture binding in GL_Bind properly, after the glBindTexture calls earlier in this function.
Fixes a obscure bug where:
 - a bsp with no textures (pink checkerboard displayed)
 - gamma != 1
 - nothing else on screen (sbar hidden, r_drawviewmodel 0)
would result in the screen turning to noise.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1263 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-12-13 07:23:04 +00:00
Steven
0d14920ba0 Credit Eric as co-author.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1261 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-12-01 10:35:51 +00:00
Eric Wasylishen
e2321d816b Fog: move setting of GL_FOG_MODE to GL_EXP2 to a new Fog_SetupState() function and call it in VID_Restart.
Fixes bug where the fog mode was resetting to the default (GL_EXP) after a mode switch, causing fog to look different. This was only affecting SDL1 for me.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1259 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-11-26 09:06:42 +00:00
Eric Wasylishen
5ac3b16363 Sbar_DrawPicAlpha: change glColor3f call to glColor4f with explicit alpha of 1 to work around intel 855 bug, which also affected Fitzquake 0.85.
With "r_oldwater 0" and "scr_sbaralpha 0", warp textures wouldn't be rendered and instead you would see a copy of the screen tiled where water surfaces should be.
Thanks to graham for reporting.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1256 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-10-06 06:18:30 +00:00
Eric Wasylishen
69791776a4 PF_traceline: change Host_Error when a NaN is detected to a Con_Warning.
This only affects the case when the developer cvar is set, we already ignore NaN's here.

negke reports getting the nan error with this debug progs.dat: http://negke.fov120.com/files/progsbjp.zip (rename to pak0.pak + install as a mod)
and his sm133_neg!ke.bsp: https://www.quaddicted.com/reviews/sm133_pack.html (walk over the zombie to activate a lightning trap)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1255 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-10-06 04:08:29 +00:00
Eric Wasylishen
e007116a5d Alias model VBO renderer: restructure so each model is stored in a separate VBO and load them in Mod_LoadAliasModel, rather than R_NewMap.
Initially I thought that we would never need to draw an alias model that hadn't been precached when R_NewMap runs, but this assumption turned out to be incorrect. This fixes the issue where progs/bolt.mdl wasn't rendering in the Scourge Done Slick demos.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1253 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-09-20 20:10:49 +00:00
Steven
b2465a4c82 r_pos cvar: Dynamic position info, aka r_speeds + viewpos.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1252 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-09-12 03:29:41 +00:00
Eric Wasylishen
5b158a2807 VID_SetMode: for SDL2, move GL context creation to be after the window is shown.
This matches the order used in the SDL2 sample applications included with the library.

Seems to fix an issue on Windows 10 with DPI scaling 150%, launching QS 0.90.1 with  "-width 1920 -height 1080 -fullscreen", and you get a horrible black flicker every few frames.
see http://celephais.net/board/view_thread.php?id=60452&start=1587

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1249 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-09-07 20:36:43 +00:00
Eric Wasylishen
0e8f1f393b sys_sdl_win.c: fix calling conventions for SetProcessDpiAware[ness]. Was getting a runtime error about that when compiling with VS2015.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1248 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-09-07 20:36:39 +00:00
Eric Wasylishen
53a5fe5053 TexMgr_ReloadImages: attempt to fix random texture recoloring after mode change (http://sourceforge.net/p/quakespasm/bugs/10/)
This removes the Cache_Flush() call that was here, which was there to fix the jam3_tronyn / low heapsize bug, and instead adds a different workaround for that issue.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1247 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-09-04 09:22:33 +00:00
Eric Wasylishen
76909f07c2 r_alias.c, r_sprite.c: print the model name in the "no such skin" (r_alias.c) and "no such frame" (r_sprite.c) developer messages
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1246 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-08-31 18:36:38 +00:00
Ozkan Sezer
58831bf2ca prevent a possible buffer overflow in Cbuf_Execute (an old q1/q2 issue this was.)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1245 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-08-23 09:56:31 +00:00
Ozkan Sezer
6e6d70213a gl_mesh.c: add missing casts so that C++ compilers won't fail
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1244 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-08-23 09:55:02 +00:00
Ozkan Sezer
ec833cde0f r_alias.c: remove duplicated shadevector (was introduced in r1151)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1243 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-08-23 09:53:05 +00:00
Ozkan Sezer
f857cd4669 constify arg_completion_type_t->command
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1242 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-08-23 09:51:35 +00:00
Ozkan Sezer
d8704bc2d8 common.c (MSG_ReadString): replaced MSG_ReadChar with MSG_ReadByte
to avoid potentional vulnerability (icculus.org quake2 svn rev. 180.)


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1240 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-08-05 14:47:25 +00:00
Eric Wasylishen
2fdd3946bc r_alias.c: Add model name to "no such frame" warning
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1239 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-08-02 18:21:57 +00:00
Eric Wasylishen
01faf4e5b6 new cvars: r_lavaalpha, r_slimealpha, r_telealpha for fine-tuning specific liquid opacities (from DirectQ, RMQEngine)
new worldspawn keys: _wateralpha, _lavaalpha, _slimealpha, _telealpha, _skyfog (unique to Quakespasm)

The lava/slime/telealpha cvars are non-archived, and default to 0, which means to use the value of r_wateralpha, so they have no effect by default.

The worldspawn keys allow custom maps to set these values in a way that only applies while the map is loaded, and doesn't change the cvar value. (similar to the behaviour of the "fog" worldspawn key.) They are accepted with or without the underscore, like "fog".

see also:
http://forums.insideqc.com/viewtopic.php?f=3&t=5532
http://celephais.net/board/view_thread.php?id=60452&start=937

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1238 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-07-26 21:51:25 +00:00
Ozkan Sezer
97c00d9f43 snd_mp3.c: applied a patch to skip APEv2 tags
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1236 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-07-13 06:37:02 +00:00
Ozkan Sezer
56d1ab5f7a snd_mp3.c: return type tweak for mp3_tagsize()
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1235 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-07-13 06:26:15 +00:00
Eric Wasylishen
271f05bf63 R_DrawEntitiesOnList: revert entity texture sorting added in r1151 as it introduces wrong alpha-sorting in contract revoked start.bsp
reported here: http://www.celephais.net/board/view_thread.php?id=60452&start=1515

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1234 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-06-24 18:22:56 +00:00
Eric Wasylishen
286ffcb95a "flush" command: Call a wrapper around Cache_Flush that also does GLMesh_LoadVertexBuffers.
"flush" command is used by modders to view modified mdl files. need to call GLMesh_LoadVertexBuffers to keep that use case working with GLSL renderer.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1233 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-06-15 22:52:29 +00:00
Eric Wasylishen
b94df5a4cd SCR_TileClear: fix for GLSL gamma causing the tiled screen border to turn white, if you use "sizedown" to show the border.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1232 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-06-15 21:17:45 +00:00
Eric Wasylishen
56a7b45200 GLSLGamma_GammaCorrect: support this code path on old cards without the NPOT extension
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1231 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-06-15 21:17:39 +00:00
Ozkan Sezer
4c7ebfd20b bumped version to 0.91.0 for future development
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1230 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-06-15 08:21:14 +00:00
Eric Wasylishen
064753591f gl_model.c: Mod_LoadTextures: avoid crash on broken maps such as jam2_tronyn.bsp or kellbase1.bsp, where we try to read texture pixel data past the end of the texture lump (crashing because the textue lump is the last thing in the .bsp file buffer).
This would only hapen on OS X or Linux (perhaps just luck or windows is more leniant about reading ~40 bytes past the end of a malloc). Note this will only handle cases where the lump size is recorded as being too small, we will still crash if the bsp file itself is truncated since there are generally no checks against the whole .bsp file buffer size.

FYI, the corruption in jam2_tronyn.bsp was caused by a bug in tyrutils which is fixed now: http://disenchant.net/git/?p=tyrutils&a=commit&h=5111c5485c96918b937843715f9b8f51f263e40e
Not sure about kellbase1.bsp (quoth).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1228 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-06-12 02:26:10 +00:00
Eric Wasylishen
84bd3944b2 Modlist_Init: (win32) don't list "." as a mod.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1224 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-06-03 03:54:47 +00:00
Eric Wasylishen
0ba423061b Add filename tab-completion for "playdemo" and "record" commands
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1219 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-30 02:28:58 +00:00
Eric Wasylishen
7bcea9a968 Host_Pause_f: Allow pausing demos even if cls.demonum != -1, i.e. we are in a demo loop.
The logic to prevent pausing the demo loop was preventing pausing in some valid cases, and there's no special reason not to allow pausing a demo loop.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1218 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-29 18:33:19 +00:00
Eric Wasylishen
f6755c56b8 ExtraMaps_Add: merge with Modlist_Add into new FileList_Add
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1217 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-29 18:33:14 +00:00
Eric Wasylishen
11a5300247 Convert to Con_DWarning (developer 1 only) the remaining two "exceeded standard limit" warnings.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1216 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-29 18:33:08 +00:00
Eric Wasylishen
621fa18dd8 Move more spammy message from "developer 1" to "developer 2", continued:
- .ent, .lit not found in COM_FindFile (they will usually be missing, we print a message with "develoepr 1" when they are found)
- "trying to load" .ent file
- "bad chunk length"

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1214 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-25 18:38:37 +00:00
Eric Wasylishen
b750698e93 Move more spammy message from "developer 1" to "developer 2":
- "meshing", "tri vert cmd"
- "PR_AlocStringSlots: realloc'ing"

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1213 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-25 03:39:05 +00:00
Eric Wasylishen
ddefff6b9e COM_FindFile: in addition to .pcx, suppress "can't find" warning for .tga textures when developer.value < 2
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1212 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-25 02:00:06 +00:00
Eric Wasylishen
1f3c1a711a Make "exceeds standard limit of" messages only display when developer cvar is set, with a new Con_DWarning function.
Have heard these are confusing players and mappers/modders; people assume there is an error or a limit in QS is exceeded, but the messages are only about exceeding the limits in vanilla WinQuake/GLQuake.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1211 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-25 01:48:03 +00:00
Eric Wasylishen
95e0be7afe add r_noshadow_list cvar (from MarkV), removing hardcoded list of models to not have shadows
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1210 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-18 18:00:49 +00:00
Eric Wasylishen
2e2b110ecb r_shadows: Better stencil shadow rendering from MarkV.
Now an 8-bit stencil buffer is requested when using a 24-bit depth buffer (the default).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1209 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-18 06:11:56 +00:00
Eric Wasylishen
93a442003a cl_parse.c: fix viewmodel lerping on large maps (e.g. zendar, warpd)
cl.stats[STAT_WEAPON] was being used before the high 8 bits were filled in, which is done with the SU_WEAPON2 byte.
Moved the block which clears the viewmodel lerp state to be after handling SU_WEAPON2.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1208 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-16 22:15:15 +00:00
Eric Wasylishen
1f29972017 r_alias.c: GLSL: fix for fullbright pixels on alias models not respecting alpha.
e.g. fixes light_flame_small_yellow entity (progs/flame2.mdl) with alpha 0.5 showing up as solid (most of the pixels on flame2.mdl are fullbright)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1207 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-16 20:55:56 +00:00
Eric Wasylishen
3806a5d2d5 r_alias.c: for out of range skin numbers, bring back the checkerboard texture wihch was removed in the last commit
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1205 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-05 04:51:05 +00:00
Eric Wasylishen
825e5c8f4f r_alias.c: fix crash on out-of-range skin numbers. This bounds check was in WinQuake, but not FitzQuake.
Fixes crash in malice TC reported by NightFright: http://www.celephais.net/board/view_thread.php?id=60831&start=829

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1204 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-01 09:24:06 +00:00
Eric Wasylishen
665c81084f R_Clear: clear stencil buffer together with depth buffer if we have one.
mh suggest that not doing this may cause performance
issues: http://forums.inside3d.com/viewtopic.php?t=2408
It's also mentioned in a "Depth In-Depth" document from AMD.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1203 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-04-16 23:57:45 +00:00
Eric Wasylishen
44b7d3a4fc R_DrawParticles: exit early if there is nothing to draw, avoid a useless glBegin() glEnd() pair.
This fixes a weird bug on Windows/AMD, where under some conditions, the
world would be drawn totally corrupted. Conditions for the bug were:
- gl_clear 0
- gamma 1
- glsl alias code in use
- status bar hidden, or, scr_sbaralpha 1
- map e1m1, look around the start position

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1202 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-04-16 23:57:39 +00:00
Ozkan Sezer
fe95edf20f fix windows linkage after r1200
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1201 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-04-14 18:15:09 +00:00
Eric Wasylishen
4800fbde34 sys_sdl_win.: call timeBeginPeriod(1) to set OS timer resolution to 1ms.
Works around buffer underruns with directsound and SDL2, but also will
make Sleep()/SDL_Dleay() accurate to 1ms which should help framerate
stability.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1200 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-04-14 18:01:33 +00:00
Eric Wasylishen
bcd429b4e3 Com_Game_f: print reminder message to player about "exec quake.rc"
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1199 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-04-03 19:03:17 +00:00
Ozkan Sezer
86a9748ddb constify NET_QSocketGetTime() and NET_QSocketGetAddressString()
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1198 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-04-01 09:30:10 +00:00
Eric Wasylishen
dbed5c9426 GLSL gamma: implement some suggestions from Spike - remove redundant glClear, remove matrix changes (not used in programmable pipeline), change filter mode to nearest (no filtering will happen anyway)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1188 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-03-08 21:13:26 +00:00
Ozkan Sezer
de4c27b793 change windows makefiles so that they aren't for cross-building by default;
keep the cross-build stuff only in the scripts. update the explanations in
windows and darwin makefiles.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1183 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-03-02 22:04:26 +00:00
Ozkan Sezer
3e1eae3e47 Makefile.darwin (SDL_FRAMEWORK_PATH): seems like older OSX ld does not
treat '-F dir' the same as '-Fdir' and fails, so directly use -Fdir as
LDFLAGS, instead of -Wl,-F,dir .


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1182 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-03-02 22:03:18 +00:00
Ozkan Sezer
00846e545d fix the cross-build scripts after r1180.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1181 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-03-02 22:01:12 +00:00
Eric Wasylishen
b737b8a29f Update makefiles to use local SDL/SDL2 copies. Add sdl[2]-config. Patch from szo.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1180 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-03-02 21:43:04 +00:00
Eric Wasylishen
96f7d2004f gl_vidsdl.c: remove AMD driver special case which disabled GLSL mdl renderer, as the latest drivers fixed the bug that was working around
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1178 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-03-02 03:13:58 +00:00
Ozkan Sezer
b6570041e3 snd_sdl.c: remove superfluous SDL_PauseAudio() and SDL_LockAudio() calls from the Shutdown() proc.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1173 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-27 14:01:23 +00:00
Ozkan Sezer
1eb675b5b3 Mod_LoadAllSkins(): change name[] size from 32 to 64 (MAX_QPATH) -- consistent with fbr_mask_name[]
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1172 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-27 14:00:49 +00:00
Eric Wasylishen
91196a618f Disable GLSL alias model renderer on Win32+ATI/AMD until szo's bug with models drawing black can be fixed.
Replace GLAlias_SupportsShaders() with gl_glsl_alias_able variable.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1171 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-20 00:24:05 +00:00
Eric Wasylishen
39bd217f6c gl_rmisc.c: allow glsl gamma to be used in combination with -novbo
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1170 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-20 00:23:44 +00:00
Ozkan Sezer
6ddd983eb8 snd_flac.c, snd_mpg123.c: fix incorrect usage of decoder function
return value in RewindStream procedures.
bgmusic.c (BGM_UpdateStream): print msg if stream rewinding fails.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1169 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-19 08:37:13 +00:00
Eric Wasylishen
ea65ff0c6d gl_texmgr.c: fix GL_DeleteTexture not clearing deleted textures out of our currently-bound-texture cache for all TMU's
Fixes a bug where if you do "map e1m6" then "kill", the fullbright part of the key texture is missing (drawn in black) - this bug was introduced in 0.90.0.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1168 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-19 00:50:54 +00:00
Ozkan Sezer
1c26cc3c9d add some extra safety checks to pak loading
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1165 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-08 08:00:56 +00:00
Eric Wasylishen
4c4ef48fcd gl_vidsdl.c: Experimental support for SDL2's new SDL_WINDOW_FULLSCREEN_DESKTOP mode.
When cvar vid_desktopfullscreen is set to 1, fullscreen mode ignores vid_width/vid_height and uses the desktop resolution. SDL docs recommend using this, it's supposed to offer better OS integration.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1164 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-07 00:05:06 +00:00
Eric Wasylishen
4618546e6c TexMgr_SafeTextureSize: take advantage of NPOT textures for mdl skins, 2d graphics, etc. Uses about 35% less texture memory on start.bsp.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1163 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-06 06:46:08 +00:00
Eric Wasylishen
7be39c651e TexMgr_ReloadImages: put in a workaround for the bug reported by Steven where fullscreen toggle on jam3_tronyn.bsp with -heapsize 65536 causes corrupted textures
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1162 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-06 05:21:39 +00:00
Ozkan Sezer
bc89fbea05 build_cross_win[32|64]-sdl2.sh: new scripts for me to cross-build on my linux.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1161 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-04 10:00:13 +00:00
Eric Wasylishen
603d2a6f76 sbar.c: don't skip redrawing the status bar if we're doing glsl gamma, since it would get gamma correction applied multiple times.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1160 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-04 03:57:06 +00:00
Eric Wasylishen
a568c712c1 tab completion: lower size of filelist_item_t name buffer from MAX_OSPATH to 32 to avoid filling up the zone memory (this limits the length of maps / games you can tab-complete).
Prior to r1153 it was 32 for maps and MAX_OSPATH for mods.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1158 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-26 23:35:55 +00:00
Eric Wasylishen
1311398e80 New gamma correction implementation using glsl. Enabled by default on OpenGL2. Disable with -noglslgamma.
Avoids general bugginess of hardware gamma, doesn't affect the whole screen in windowed mode like HW gamma. Should fix http://sourceforge.net/p/quakespasm/bugs/5/

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1157 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-26 20:18:45 +00:00
Eric Wasylishen
1a5c428100 VID_Restart: delete all GL textures before calling VID_SetMode. SDL2 reuses the gl context when changing modes, so the TexMgr_ReloadImages call after the mode change was leaking textures.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1156 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-26 20:18:39 +00:00
Eric Wasylishen
3b1c8a97ff RecursiveLightPoint: add casts to double to force 64-bit precision, fixes zombie at the start of jam3_ericw.bsp from incorrectly being lit up in SSE builds.
See also: http://forums.inside3d.com/viewtopic.php?f=3&t=5620

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1155 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-26 06:46:53 +00:00
Eric Wasylishen
6970b01052 GLAlias_GetUniformLocation: refactor to GL_GetUniformLocation, take program as an argument
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1154 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-25 20:29:30 +00:00
Eric Wasylishen
c31fb37b20 Refactor argument completion for "game" and "map" so all of the code is shared.
TODO: currently using a char[MAX_OSPATH] buffer to store map/mod names in the completion list which is probably unnecessairly large

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1153 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-24 08:26:14 +00:00
Eric Wasylishen
f0778c45b5 Autocompletion of mod names for the "game" command.
Copied from the "map" autocompletion code, now I should probably refactor because most of the code could be shared.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1152 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-24 07:02:47 +00:00
Eric Wasylishen
112c8b68b8 Alias model rendering fast-path using OpenGL 2.
In GL_MakeAliasModelDisplayLists, after saving the standerd triangle strips and fans onto the hunk, if the system is GL2 capable, we also save a second version of the mdl on the hunk designed to be loaded into a VBO (GL_MakeAliasModelDisplayLists_VBO). In R_NewMap, and on video mode changes, we call GLMesh_LoadVertexBuffers which loops over all precached mdl's and loads the data into a pair of VBO's (vertices and vertex indices).

Finally, in R_DrawAliasModel, assuming no rendering options are disabling the fast-path (r_drawflat 1, r_lightmap 1, or r_fullbright 1 would disable it), we call GL_DrawAliasFrame_GLSL, which sets up all of the bindings and draws the (possibly lerped) mdl in one glDrawElements call.

Special thanks to MH for some of the code from RMQEngine and the general concept.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-20 18:59:15 +00:00
Eric Wasylishen
f4768566a1 r_oldwater: change default to 0 (which means use the higher quality fitzquake render-to-texture water by default, instead of the lower quality glquake water).
Reasoning is, we default to the higher-quality settings for everything else except this.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1150 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-17 00:54:09 +00:00
Eric Wasylishen
171b08cf39 Support pausing demo playback.
This is done by adding an extra 'demopaused' flag to client_static_t, separate from cl.paused because we don't want a svc_setpause inside the demo (caused by the player pausing during recording) to actually pause demo playback. The only potential failure case is, if the demo contains a svc_stufftext of the command "pause", the demo will pause itself when being played.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1147 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-12-08 19:30:36 +00:00
Eric Wasylishen
e26923ec8a Host_Startdemos_f: set cls.demonum to -1 in the default case where we skip the demo loop.
Fixes a bug where if you launched QS and immediately did "playdemo [something]", after the demo finished, demo1.dem would start to play instead of returning to the console.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1146 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-12-08 19:30:30 +00:00
Eric Wasylishen
6afd1e5286 Host_Loadgame_f: don't break when there are } characters in quoted strings. Fixes issue loading savegames from retrojam1_skacky
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1145 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-12-08 19:30:21 +00:00
Eric Wasylishen
4a2e29f1c1 R_SetupGL: remove some dead code (glGet call that stores GL_MODELVIEW_MATRIX into r_world_matrix, which is not used anywhere.) The glGet calls was stalling the OpenGL pipeline.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1141 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-11-11 23:27:12 +00:00
Eric Wasylishen
1d7a9903e3 Fog_ParseWorldspawn: before reading the worldspawn value, clear the fog rgb color back to the default value (0.3).
This fixes a bug seen in jam3_tronyn.bsp (which only has a density value in the worldspawn), where the fog color of the last map played would carry over.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1140 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-11-03 21:27:27 +00:00
Ozkan Sezer
6b57f04f57 make sure we have more than one CPUs before enabling multi-threaded OpenGL
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1139 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-11-03 09:20:23 +00:00
Ozkan Sezer
a4b30a4eed add new numcpus field to the quakeparms structure and detect it during Sys_Init time
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1138 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-11-03 09:10:18 +00:00
Eric Wasylishen
2870be2bee GL_Init: on OS X, enable multi-threaded OpenGL mode.
This moves some of the OpenGL implementation to a background thread, and makes draw calls block for a shorter amount of time. AFAIK, this is the default mode on most other OS'es, not sure why you have to explicitly ask for it on OS X.

N.B. the kCGLCEMPEngine constant is available on 10.4+ so I don't bother checking the OS X version.
More info: https://developer.apple.com/library/mac/technotes/tn2085/_index.html

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1137 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-11-02 23:01:20 +00:00
Sander van Dijk
fce0215843 quakespasm.pak: Another z-fighting workaround.
This fixes:

e2m3:
- The wallpiece that blocks the way out of the Well of Wishes (when open).


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1136 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-11-02 20:06:35 +00:00
Sander van Dijk
996d692db0 quakespasm.pak: More z-fighting workarounds.
This fixes:

e2m3:
- The floorpiece (when down) and wallpiece (when open) by the crates opposite the normal exit.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1135 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-11-02 19:36:39 +00:00
Sander van Dijk
e4d99195bf quakespasm.pak: More z-fighting workarounds.
This fixes:

e1m4:
- The secret doors in the room with the five quake-logo buttons on the floor (when open).

e2m2:
- The platform in the water behind the gold key door (when down).
- The wallpiece that pushes the player into the gold key room (when "closed").


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1134 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-11-02 19:16:35 +00:00
Ozkan Sezer
50a277c1f7 a few more minor stuff from uhexen2 svn
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1133 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-31 13:03:20 +00:00
Ozkan Sezer
ed0eeb149f sync a few minor stuff with uhexen2 svn
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1132 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-30 18:00:06 +00:00
Ozkan Sezer
472bd01fce bump version to 0.90.1
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1131 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-21 20:05:08 +00:00
Eric Wasylishen
b694b513ec Tweak the MH dynamic lighting speedup to be more correct: upload the lightmaps from the current frame instead of the previous frame.
It was possible, but unlikely, to see artifacts from the previous code in some circumstances, e.g. "host_maxfps 10" and spin around quickly near a flashing light e1m1, you may see a surface drawn with an out-of-date lightmap for one frame.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1130 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-21 19:27:42 +00:00
Ozkan Sezer
25b8df20a7 minor tidy-ups
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1128 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-18 17:00:34 +00:00
Sander van Dijk
bc30c6278c sdl: Make our error checking for SDL_Init(SubSystem) consistent with the SDL wiki/test programs.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1126 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-18 16:33:01 +00:00
Ozkan Sezer
ce78a2ea51 run SDL_Quit() at exit
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1125 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-18 11:20:14 +00:00
Eric Wasylishen
53288141e7 sys_sdl_win: Sys_SetDPIAware: only call GetProcAddress on a non-NULL library handle
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1121 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-17 00:15:49 +00:00
Eric Wasylishen
f244f82c64 sys_sdl_win.c: Sys_SetDPIAware: call SetProcessDPIAwareness / SetProcessDPIAware
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1119 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-16 23:01:43 +00:00
Sander van Dijk
5438f83b08 keys.c: Add keynames BACKQUOTE and TILDE, to facilitate (un)binding them from the console.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1118 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-15 17:32:40 +00:00
Sander van Dijk
e06f197879 keys: K_ALT is not a consolekey (it was accidentally added in r1112).
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1117 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-15 06:18:29 +00:00
Sander van Dijk
25d630c1b8 console.c: When toggling the fullscreen console off, clear the current line.
This is consistent with toggling the in-game console off, and fixes stray '`' or '~' (or '^' or '\' or ..., depending on the keyboard layout) characters.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1116 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-15 06:06:18 +00:00
Sander van Dijk
b2222b0a62 keys.c: Ignore control characters in Char_Event(), to prevent text input when pressing ctrl-c/ctrl-v.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1115 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-15 05:58:54 +00:00
Eric Wasylishen
f607f1b4eb in_sdl: change DBEUG_INPUT preprocessor check to an "in_debugkeys" cvar to make it easier to debug unusual keyboards
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1114 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-14 18:31:49 +00:00
Sander van Dijk
81daee8fcf input: Minor fix in Char_Event().
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1113 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-14 17:13:03 +00:00
Sander van Dijk
13cfd00787 input: Remove some of stuff obsoleted by r1110.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1112 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-14 17:10:34 +00:00
Eric Wasylishen
3cb6f871f1 in_sdl.c: make key debug logging more verbose
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1111 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-14 04:03:16 +00:00
Eric Wasylishen
1b6abd0e04 in_sdl.c, key.c: Fixes agreed on with Sander:
1. Remove Key_IgnoreTextInput(), and simple always send a Char_Event when
we receive TEXTINPUT (SDL2) or the unicode field of a KEYDOWN event is
filled (SDL1.).
2. Remove handling of K_KP_* in the menu/console, since they cannot be
relied on to not also send text (see issue described above). The handling
of K_KP_ENTER can stay, since we do know that it never sends text.
3. Remove the interpretation hack for the numpad, since it will no longer
be needed (and doesn't currently work for SDL2 anyway); if a numpad key
generates text we will handle it (because of "1"), if not then it will
simply be if ignored (because of "2”).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1110 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-14 03:30:44 +00:00
Eric Wasylishen
aeb4ed86d2 in_sdl: remove lastKeyDown hack
was no longer needed and was causing issues typing underscores (US keyboard layout) on Linux/SDL2 where SDL_TEXTINPUT is delivered before the SDL_KEYDOWN.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1109 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-13 03:21:47 +00:00
Eric Wasylishen
bd07399747 in_sdl: add some debug logging for key events (only if DEBUG_INPUT is defined)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1108 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-13 03:21:40 +00:00
Ozkan Sezer
5678106819 fix sdl2-msvc build
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1103 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-12 11:20:34 +00:00
Ozkan Sezer
039fdaad6f minor whitespace adjustments
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1101 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-11 19:11:40 +00:00
Sander van Dijk
6ae9f2e37e keys: Simplify r1097.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1098 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-11 11:47:05 +00:00
Sander van Dijk
3ecdc28743 keys: Rework the specialkeys[]/consolekeys[] initialization a bit.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1097 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-11 11:22:53 +00:00
Sander van Dijk
1440636ec6 input: Move fullscreen and console toggle from in_sdl.c to keys.c.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1096 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-11 08:49:45 +00:00
Sander van Dijk
42c708a1e1 in_sdl.c: rewrite TEXTINPUT handling a bit again.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1094 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-08 20:03:05 +00:00
Sander van Dijk
db68976877 in_sdl: Remove commented-out m_filter code and a misleading comment.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1093 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-08 18:57:55 +00:00
Sander van Dijk
c23a0197d6 Rename some (recently added) functions.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1092 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-08 18:30:17 +00:00
Sander van Dijk
5e73eb18a4 in_sdl.c: Workaround for broken SDL2 numlock state.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1091 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-07 06:15:16 +00:00
Sander van Dijk
eaa33b20b6 in_sdl.c: Fix numpad translation with SDL 1.2.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1090 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-06 20:47:35 +00:00
Sander van Dijk
745c643ef2 input: Some more tuning.
* in_sdl.c: Remove the over-zealous "no events for unknown keys" checks introduced in r1085. Events for unknown keys can be useful for "press any key" situations.
* keys.c: In input grab mode, update the "lastkey" member only for key down events.
* keys.c/console.c: Adapt input grab mode to properly support catching "any key" presses.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1089 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-06 06:09:42 +00:00
Sander van Dijk
045cf968de in_sdl.c: Inline IN_IsNumpadKey().
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1088 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-05 21:02:25 +00:00
Sander van Dijk
0c28e5a03e keys.c: Allow SetBinding() to really clear a key, instead of binding it to the empty string.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1087 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-05 20:48:27 +00:00
Sander van Dijk
5ca58d55b0 input: Minor tuning.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1086 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-05 19:03:48 +00:00
Sander van Dijk
14f5275a2c input: Implement numpad translation in text input mode.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1085 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-05 18:21:58 +00:00
Sander van Dijk
f6d44a3a10 Fix SDL2 fallback when no FSAA is available.
On my old laptop, when running "./quakespasm -fsaa 2", quakespasm would error out with a "Couldn't create window" message. Our "no FSAA available" fallback was applied at OpenGL context creation time, but according to the SDL2 wiki FSAA settings should be done before creation of the window (see https://wiki.libsdl.org/SDL_GLattr#multisample). Moved it there.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1084 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-05 17:06:35 +00:00
Sander van Dijk
4b011d6285 input: Remove unneeded key_repeats array, some input grab tuning.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1083 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-05 16:35:59 +00:00
Sander van Dijk
f605137b02 menu: Add M_Quit_InputtingText() for consistency.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1082 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-05 15:32:45 +00:00
Sander van Dijk
e4575839a9 input: Fix SDL2 mouse wheel up/down behaviour.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1081 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-05 15:25:31 +00:00
Eric Wasylishen
749ed362e7 gl_vidsdl.c: for OpenGL versions below 1.5, assume "-novbo" (attempting to avoid old, broken VBO implementations).
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1080 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-03 18:31:58 +00:00
Sander van Dijk
2c177df399 input: Minor addition to r1077.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1079 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-02 19:34:33 +00:00
Sander van Dijk
1ab2cbde9b input: Support for "plain" numpad keys in the menu/console (still todo: numpad translation).
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1078 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-02 19:21:52 +00:00
Sander van Dijk
8d0cb0086a input: More text input restructuring.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1077 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-02 19:00:42 +00:00
Sander van Dijk
856f94fac8 input: Some text input restructuring in preparation of numpad translation support.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1075 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-30 19:29:58 +00:00
Sander van Dijk
ad7ac7caf6 Revert r1073.
I read that comment as "bindings for these keys won't execute when in the menu", but it should be read as "no new bindings can be made for these keys through the bindings sub-menu", which is actually correct.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1074 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-30 06:18:31 +00:00
Sander van Dijk
ddf7f188d1 keys.c: Correct a typo in a comment.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1073 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-29 18:33:20 +00:00
Sander van Dijk
f30f590ec7 keys.c: Remove shift interpretation.
This never really belonged in keys.c (should have been handled in the backend instead), but now that we have separated Key_Event()/Char_Event() this no longer serves any purpose at all.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1072 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-29 18:31:41 +00:00
Eric Wasylishen
26c1b63c00 sv_main: Second part of fixing the MAX_ENT_LEAFS issue (after bumping MAX_ENT_LEAFS to 32 in r967).
If an entity is visilbe from MAX_ENT_LEAFS (32) or more leafs, don't try to vis-cull it, just send it to the client.
This should completely eliminate any flickering entities, no matter how many leafs they're visible from.

This could potentially increase packet sizes a bit.. but ent->num_leafs == 32 never happens in id1 epsiode 1, so it will not cause any increase on those maps.
hip1m1 has one entity (a rotator) that is caught by this change and will be always sent.

see e.g.
http://forums.inside3d.com/viewtopic.php?f=1&t=5554
http://www.celephais.net/board/view_thread.php?id=60452&start=1235

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1069 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-28 19:02:27 +00:00
Sander van Dijk
cebef615e5 input: Rework the text/non-text input mode handling.
Before, "gamekey" was the special case, now "textmode" is. We are now more precise about when we activate "textmode", e.g. we only do this when the console, messagemode, or a textfield in the menu are active. The trigger for doing this was this line on the "SDL_StartTextInput" page of the SDL2 wiki: "On some platforms using this function activates the screen keyboard.". Although we currenly support no such platform, it's good te be prepared, and what we do now is more correct anyway.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1066 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-23 19:10:02 +00:00
Sander van Dijk
c8da3f1f61 Rename some functions for consistency.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1064 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-23 02:19:57 +00:00
Sander van Dijk
46e003557a in_sdl.c: rewrite TEXTINPUT handling a bit.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1063 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-23 02:15:46 +00:00
Ozkan Sezer
b9032b7815 copyright years, general tidy-up, remove unused d_ifacea.h.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1059 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-22 08:55:46 +00:00
Ozkan Sezer
c80fbd9629 allow KP_ENTER to function as K_ENTER in menus, console, etc., after r1042.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1058 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-22 06:21:06 +00:00
Ozkan Sezer
78b028cd50 revert exec'ing default.cfg and config.cfg upon in-game gamedir changes.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1057 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-22 06:15:23 +00:00
Eric Wasylishen
3be35611b5 Correct the buttonremap table for SDL2 so K_MOUSE4/K_MOUSE5 work.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1056 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-22 03:32:19 +00:00
Ozkan Sezer
f040037e64 add code for USE_GAMMA_RAMPS case for SDL2 builds. (still off by default.)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1053 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 14:00:56 +00:00
Ozkan Sezer
11c1b1f67c exec default.cfg and config.cfg upon in-game gamedir changes.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1052 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 11:10:22 +00:00
Ozkan Sezer
84e79ad4a2 cleanup USE_GAMMA_RAMPS and USE_SDL2 stuff
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1051 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 11:01:02 +00:00
Sander van Dijk
4aedfee2af gl_vidsdl.c: Correct some swap interval related messages.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1050 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 07:52:22 +00:00
Eric Wasylishen
4a28b9ad2e 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1048 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 02:28:50 +00:00
Sander van Dijk
5989e7136d 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1047 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 02:10:14 +00:00
Sander van Dijk
f7276bc483 keys.c: Key_ConsoleBindable: add a better check for "general bindability".
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1046 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 01:59:36 +00:00
Eric Wasylishen
2e23f6a3b5 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1045 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-21 00:59:24 +00:00
Sander van Dijk
362deedf20 keys.c: Key_ConsoleBindable: special-case key 0, since it essentially means "no key".
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1044 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 23:04:41 +00:00
Sander van Dijk
3be5b16965 keys.c Key_ConsoleBindable(): add sanity check
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1043 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 22:45:52 +00:00
Sander van Dijk
c21ea8687e 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1042 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 22:41:44 +00:00
Ozkan Sezer
d99ea684d2 remove SDL_net support which had been unsupported for some time
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1041 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 20:37:35 +00:00
Sander van Dijk
8ad4f6b437 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1040 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 17:46:23 +00:00
Sander van Dijk
cb0c84ac9d 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1039 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 15:57:33 +00:00
Sander van Dijk
b5628dbe2f keys.c Key_Event(): add sanity check
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1038 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 14:27:32 +00:00
Ozkan Sezer
5d10347f78 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1036 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 08:37:30 +00:00
Eric Wasylishen
90b26fc215 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1035 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 01:08:13 +00:00
Ozkan Sezer
d37b1574fe 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1034 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-17 11:00:28 +00:00
Ozkan Sezer
ad2905b5e4 bumped version to 0.90.0
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1033 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-16 09:05:36 +00:00
Ozkan Sezer
8091edb1ef fix SDL2 compilation using g++
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1031 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-14 06:03:56 +00:00
Sander van Dijk
a21d18a4ec menu: Add Char_Event support for the textfields in the menu.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1030 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 16:13:16 +00:00
Sander van Dijk
d690b1e38a input: Add a function Key_GameKey to separate the input driver layer a bit more.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1029 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 09:39:51 +00:00
Sander van Dijk
1c9666f049 keys.c: Simplify Key_ConsoleBindable.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1028 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 08:06:04 +00:00
Sander van Dijk
bd58d1c1b8 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1027 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 07:53:31 +00:00
Sander van Dijk
a5e4a93cf0 gl_vidsdl.c: Minor VID_Toggle() fast path optimization.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1026 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 01:48:24 +00:00
Sander van Dijk
6603d78e5e net_sdlnet.c: Silence an assigned-but-not-used compiler warning.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1025 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 01:42:25 +00:00
Sander van Dijk
d687676d5a 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1024 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-13 01:34:02 +00:00
Sander van Dijk
3b539b156c in_sdl: SDL1: don't send '`' or '~' to the console.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1023 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-12 21:01:28 +00:00
Sander van Dijk
da5ee0c612 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1022 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-12 20:37:05 +00:00
Sander van Dijk
1e522abb2d keys.c: K_BACKSPACE (127) is a non printable character.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1021 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-12 20:23:20 +00:00
Eric Wasylishen
f44d44d419 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1020 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-12 04:27:54 +00:00
Sander van Dijk
34f2f6f1ca Makefile[.*]: SDL2 build support. 'make USE_SDL2=1' to enable.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1019 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-11 18:47:07 +00:00
Eric Wasylishen
e0680cb6d3 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1018 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-11 04:55:16 +00:00
Sander van Dijk
b2c3363718 Add some missing SDL2 includes when not using sdl2-config.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1017 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-10 17:41:34 +00:00