Commit Graph

805 Commits

Author SHA1 Message Date
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
Ozkan Sezer 61775cc8b4 use getcwd() or some equivalent for host_parms->basedir instead of '.' (from uhexen2)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1016 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-10 09:51:35 +00:00
Ozkan Sezer 52f8653d4c add missing header
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1015 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-10 09:47:34 +00:00
Ozkan Sezer 4b01a03387 applied the user directories support patch, disabled by default. 'make DO_USERDIRS=1' to enable it.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1013 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-10 07:28:28 +00:00
Ozkan Sezer 99fa5eb2a3 tighten a bit more..
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1012 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-09 11:50:38 +00:00
Ozkan Sezer 596628530b 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1011 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-09 10:12:30 +00:00
Ozkan Sezer ae876c943b 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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1010 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-09 07:13:20 +00:00
Ozkan Sezer d7d6ad2d05 fix a r1003 bug in COM_Game_f()
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1006 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 22:15:50 +00:00
Sander van Dijk 162e47a5ec pl_linux.c: implement PL_GetClipboardData using SDL2
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1005 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 21:30:16 +00:00
Ozkan Sezer 717b452da0 moved Host_Game_f to common.c, made it to use COM_AddGameDirectory(). moved in-memory pak structures, searchpatch structure and searchpath global declarations to common.h. adjusted affected extra patches.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1003 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 21:10:33 +00:00
Sander van Dijk dc4799f48a in_sdl.c: Rename the mouse filter functions for consistency.
Also surround the SDL version by "#if defined(USE_SDL2)" and "#endif", this
suppresses an unused function warning when building for SDL1. (Building for
SDL2 still gives an unused variable "modstate" warning though.)


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1002 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 20:29:16 +00:00
Ozkan Sezer 1c4c5ba254 add the com_base_searchpaths thing of qw and use it in Host_Game_f(), kill the no longer needed com_nummissionpacks, KillGameDir() and NumGames().
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@998 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 18:20:47 +00:00
Ozkan Sezer 9d2193f1d4 tighten Host_Game_f() a bit more
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@997 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 16:02:58 +00:00
Ozkan Sezer 985a16ee15 Host_Game_f(): simplify
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@996 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 14:29:12 +00:00
Ozkan Sezer 0fc8cce747 revert r988
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@993 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 09:10:27 +00:00
Eric Wasylishen db43cf1836 gl_screen.c: make the console speed independent of the current resolution. Before, switching to a really high (e.g. 2880x1800) resolution would make the colsole take several seconds to open/close
Not totally sure about this but i think it's a decent idea. I'm using 800x600 as a reference screen size (arbitrary choice but it's the default QS resolution). So if your resolution is 600 pixels tall this will make no difference. On higher resolutions this will make the console a bit faster than before.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@992 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 06:25:59 +00:00
Eric Wasylishen d8a33d73cc R_CullSurfaces: small optimization. Avoid doing (s->visframe == r_visframecount) test on all world surfaces, instead, use the surfaces in the world texture chains, which already passed that test in R_MarkSurfaces.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@991 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-08 04:31:26 +00:00
Sander van Dijk 093ecad80b gl_rmain.c: make gl_zfix default to 0, no longer save it to config.cfg
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@990 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-07 19:35:52 +00:00
Sander van Dijk 17c51df017 quakespasm.pak: add several .ent files to prevent z-fighting
fixed so far:
e1m1: quad secret elevator (when down)
e1m2: exit doors (when open)
e2m3: rockets secret doors (when open)
e2m7: bars in front of the exit doors (when raised)



git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@989 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-07 19:33:38 +00:00
Sander van Dijk 39237a64d6 common.c: make plain files overrule files inside a PAK file
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@988 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-07 12:32:27 +00:00
Eric Wasylishen 24f4a2dab4 SDL2 support, if USE_SDL2 defined.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@987 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-05 19:34:43 +00:00
Ozkan Sezer 5b9140cb06 restore compilability with g++. some whitespace tidy-ups.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@986 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-02 05:40:41 +00:00
Eric Wasylishen 7c1e078b2a PF_VarString: raise buffer size to 1024. I checked all buffers that the resulting string could end up in, and they're all at least 1024 bytes (even with an unmodified quake client).
PF_VarString is only called on the server, in:
- PF_error, PF_objerror, PF_dprint to print error / debugging messages
- PF_bprint, which calls SV_BroadcastPrintf which copies the string into a 1024-byte buffer, then sends that to clients in a svc_print message
- PF_sprint, which sends the string in a svc_print message using MSG_WriteString (without copying into an intermediate buffer)
- PF_centerprint, which sends the return value of PF_VarString in a svc_centerprint message (without copying into an intermediate buffer)

On the client:
- svc_print reads the payload string with MSG_ReadString (2048-byte buffer), then Con_Printf is called (4096-byte buffer)
- svc_centerprint uses MSG_ReadString then calls SCR_CenterPrint (1024-byte buffer)

I also checked the original quake source and the client-side buffers for MSG_ReadString, Con_Printf, and SCR_CenterPrint are all the same sizes as in QS.

Admittedly I want to support sock's ITS mod, but as far as I can see, it's a totally safe to increase this to 1024.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@985 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-01 07:30:23 +00:00
Ozkan Sezer b8fc8caa0f dropped support for GL_SGIS_multitexture
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@984 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-30 08:00:34 +00:00
Eric Wasylishen b9d280f10b Revert r981 "Simple use of vertex arrays in R_DrawTextureChains_Multitexture."
It caused a dramatic slowdown on my machine on windows (50% slower)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@983 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-30 06:30:49 +00:00
Eric Wasylishen bdca64b93b Silence warning about vid_fsaa requiring restart when parsing config.cfg at startup. Add missing newline to warning message.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@982 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-30 03:22:36 +00:00
Eric Wasylishen 745fa7ecce Simple use of vertex arrays in R_DrawTextureChains_Multitexture.
The glBegin(GL_POLYGON), for() loop with GL_MTexCoord2fFunc()/glVertex3fv() calls, and glEnd () per polygon is replaced by a memcpy() and a glDrawArrays() call per poly.

My guess is this only saves function call overhead, but it gives a decent ~20% speedup (36 -> 42fps) on my machine on orl’s map.

Note: glDrawArrays() is in OpenGL 1.1, but the glClientActiveTextureARB function is part of the GL_ARB_multitexture extension but not GL_SGIS_multitexture. Instead of splitting into two code paths, I just dropped support for GL_SGIS_multitexture.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@981 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-30 03:22:26 +00:00
Eric Wasylishen 9c6f93eb8a Remove R_DrawSequentialPoly and use texture chains for drawing brush models.
To make this work with the drawing order we use in gl_rmain (world excluding water, opaque ents, world water, transparent ents), I made each texture_t have two texture chains, one for world and one for bmodels. This way they can be cleared during entity drawing without having to regenerate the world ones.

Other than this the changes are mostly minor adjustments to the R_DrawTextureChains_* functions so they can work for things other than the world.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@979 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-29 08:27:22 +00:00
Eric Wasylishen 890fe165e8 Revert r968, optimization in R_DrawSequentialPoly. Going to try a deeper change that uses the world drawing code for bmodels.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@978 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-29 08:27:16 +00:00
Eric Wasylishen a7bf2f59a4 Apply Baker's fix for cross-map demo playback (http://forums.inside3d.com/viewtopic.php?f=3&t=2397).
With that alone, the console would come down and slide up when the map changes in a demo.
I added a SCR_BeginLoadingPlaque() call in CL_ParseServerInfo, only done during demo playback, which shows the loading plaque and prevents the console from appearing and sliding up.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@976 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-25 02:55:25 +00:00
Eric Wasylishen 526f90d69b Revert Pa3PyX support for cross-map demos
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@975 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-25 02:55:16 +00:00
Eric Wasylishen 9bd02ae55b cl_parse.c: hack so demos playback at the correct speed even if they contain a lot of svc_stufftext messages (e.g. one every frame).
for a test case, play a demo from: http://www.quaketastic.com/upload/files/demos/otp_honey100.zip
for the honey map pack: http://www.quaketastic.com/upload/files/single_player/maps/honey.zip
on a slow pc that gets signifigantly less than 72fps, or with host_maxfps lowered (e.g. set to 33).

with QS 0.85.9, the demo will play in slow-motion; with QS 0.85.6 (without the cross-map demo support) it plays normally.

admittedly this is a fringe scenario, but it's imo a legitimate bug in the Pa3PyX cross-map demo playback code.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@974 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-24 18:37:28 +00:00