Commit Graph

86 Commits

Author SHA1 Message Date
Sander van Dijk 103f041614 remove "type" from "viddef_t", use "modestate" instead
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@804 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-02-13 19:01:26 +00:00
Sander van Dijk ea0b236563 gl_vidsdl.c: remove "modenum" from vmode_t
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@803 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-02-11 18:13:09 +00:00
Sander van Dijk 148386cc03 gl_vidsdl.c: remove "modedesc" from vmode_t
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@802 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-02-11 18:03:14 +00:00
Sander van Dijk a958e33054 gl_vidsdl.c: get rid of obsolete "badmode"
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@801 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-02-10 17:30:40 +00:00
Sander van Dijk ba5c538d27 gl_vidsdl.c: Simplification of some functions
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@800 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-02-09 16:10:23 +00:00
Sander van Dijk dbaa3fec52 gl_vidsdl.c: Remove "halfscreen" stuff.
AFAICS this is not needed for SDL, and it in fact
breaks weird widescreen resolutions such as 1280x600.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@798 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-02-01 20:44:25 +00:00
Sander van Dijk d91f083ee4 Remove more dead code.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@790 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-28 19:10:52 +00:00
Sander van Dijk 011ca12117 gl_vidsdl.c: Remove some dead code.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@789 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-22 18:58:45 +00:00
Sander van Dijk 7b155bc6cc Really fix vsync saving/loading (finally...)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@787 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-11 17:35:43 +00:00
Ozkan Sezer 860a6007e8 regenerate gl_extensions_nice everytime the extensions string is retrieved
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@785 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-07 12:44:30 +00:00
Ozkan Sezer c66e78f53d move GL_Init(), TexMgr_ReloadImages() and GL_SetupState() calls from
VID_SetMode() to VID_Restart() so they aren't called twice at startup.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@784 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-07 12:27:39 +00:00
Ozkan Sezer bf64fd2d1a better parse for opengl extensions list (from quakeforge.)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@783 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-07 07:51:41 +00:00
Ozkan Sezer 7ce7ce71ca made GL_Init() to be called every time a video mode is changed. we may
need to kill device and rendering contexts too, will see to that later.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@781 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-06 08:50:45 +00:00
Sander van Dijk d15e823ab7 Fix vsync saving/loading (take three...)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@780 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-02 22:16:08 +00:00
Sander van Dijk a138b55fbe Fix vsync saving/loading (take two...)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@779 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-02 20:04:26 +00:00
Sander van Dijk 1777d5a49b Fix vsync saving/loading (hopefully...)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@778 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-01 17:34:40 +00:00
Sander van Dijk 95d20d835f revert (most of) r521, r756 and r759. Alter "gamekey" handling a bit to compensate.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@761 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-10-06 18:09:23 +00:00
Ozkan Sezer a19ea6b14b removed duplicated assignment to the local 'was_changed'
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@760 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-10-06 12:28:33 +00:00
Sander van Dijk d4611c823e more mouse grab/release fixes
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@759 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-10-05 18:58:59 +00:00
Sander van Dijk 6d8e3aa171 minor tuning of r753
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@754 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-10-01 01:57:20 +00:00
Ozkan Sezer 0dc8eab2a9 array size fix for r752
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@753 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-09-30 21:35:16 +00:00
Sander van Dijk 3be0ae496c gl_vidsdl.c: minor improvement to bpp list creation
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@752 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-09-30 21:11:39 +00:00
Ozkan Sezer 769d2ac75b simplify VID_Gamma_f: the oldgamma stuff is already handled by the cvar
system itself.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@751 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-09-30 14:03:15 +00:00
Ozkan Sezer 74e8e5f719 changed ToggleFullscreen failure message to be a debug print
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@705 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-09-04 06:54:59 +00:00
Ozkan Sezer 50e014d050 Updated support for building the OSX versions using Makefile.darwin. Do
not rely on sdl-config on OSX Framework builds, define new SDL_FRAMEWORK
and NO_SDL_CONFIG preprocessor macros to indicate that and include SDL.h
with the "SDL" subdirectory name included. Add new libmad and ogg/vorbis
headers and static and dynamic libraries for macosx. Xcode project files
need further updating.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@699 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-08-16 04:51:41 +00:00
Ozkan Sezer 5a2a7d96a7 * keys.h: renamed KP_* key macros to K_KP_*.
* key.c (Key_ClearStates): Instead of clearing all key's down state
  and repeat count, run KeyEvent(k,false) keys in down state, which
  will already clear those states for them. This also helps getting
  rid of several actions bound to keypad keys. Minor cleanups.
* gl_vidsdl.c (ClearAllStates): Removed code triggering every key
  with a release event, because we just changed Key_ClearStates() to
  do that for the necessary keys.
* in_sdl.c: Minor cleanups. Made K_KP_5 to send '5' when not in game
  mode, regardless of the numlock status. Moved prev_gamekey to top
  level and call SDL_EnableUNICODE() correctly.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@686 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-06-25 11:20:38 +00:00
Ozkan Sezer 8b45bbd612 minor gl_vidsdl.c cleanups: tidied up VID_SetMode(). Removed the defunct
_windowed_mouse cvar. Simplified va()+Cvar_Set() calls into Cvar_SetValue().

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@673 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-05-21 12:32:20 +00:00
Ozkan Sezer ee56c76abd removed the defunct block_drawing global (btw, it was checked incorrectly
in GL_EndRendering()... )

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@632 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-02-10 22:37:07 +00:00
Ozkan Sezer 7cddd6cb2b gl_vidsdl.c (VID_Init): fixed a -Wparentheses-equality warning from clang
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@623 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-01-29 18:04:28 +00:00
Ozkan Sezer abb004f5d4 minor cleanup
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@616 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-01-20 17:11:24 +00:00
Ozkan Sezer 0912ffd8a6 make sure gl_max_anisotropy is initialized. also added a uberparanoid check
for gl_max_anisotropy.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@615 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-01-19 20:55:27 +00:00
Sander van Dijk 272919a523 When modetesting, redraw the screen before asking for confirmation. Otherwise the screen is just a black rectangle, which may be confusing for the user.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@612 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-01-18 12:48:09 +00:00
Ozkan Sezer 17a4f90bb2 gl_texmgr.c, gl_vidsdl.c: made a lot of functions and variables static.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@584 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-30 14:00:28 +00:00
Ozkan Sezer ba8f8801c1 gl_vidsdl.c (GL_Init): set VID_Changed_f() callback to vid_vsync only if
GL_CheckExtensions() set gl_swap_control as true.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@582 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-30 12:15:19 +00:00
Ozkan Sezer 72efc8e384 gl_vidsdl.c (VID_SyncCvars): set vid_vsync to 1 only if the received value
is positive, not "not zero".

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@579 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-30 00:10:16 +00:00
Ozkan Sezer 6c341b9ed0 minor typo fixes for vsync related messages.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@578 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 23:05:12 +00:00
Ozkan Sezer f6d96cf7e9 gl_vidsdl.c (VID_Toggle): if SDL_WM_ToggleFullScreen() succeeded, ignore
the vid_fullscreen callback function setting vid_changed to true.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@577 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 21:44:36 +00:00
Ozkan Sezer eb09523d00 changed some of the Cvar_Set[Value] calls to their *Quick variants in the
source files where the vars are defined.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@576 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 21:21:11 +00:00
Ozkan Sezer 19953bd399 silenced -Wsign-compare warnings.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@575 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 19:06:08 +00:00
Ozkan Sezer 1928f2e1b8 * first shot at cvar flag system and cvar layer clean-ups :
- removed the archive and server members of cvar_t structure
  which are now represented by the CVAR_ARCHIVE, CVAR_NOTIFY
  and CVAR_SERVERINFO flags.
- added new Cvar_SetROM and Cvar_SetValueROM functions to 
  set vars marked as CVAR_ROM (read-only vars) programaticaly
- added Cvar_SetCallback() as a new function to assign (or
  remove) a callback function to a cvar.
- changed Cvar_RegisterVariable() to only accept a var pointer
  as in original quake
- moved notification handling from Cvar_Set() to callbacks.
- changed Cvar_Set() so that it doesn't reallocate the var's
  string buffer if nothing is changed, nor does it run the
  var's callback.
- changed the 'registered' and 'cmdline' cvars to be read-only
  so that the users can't change it using the console.  (and
  with 'registered' flagged as CVAR_ROM, the 'static_registered'
  thing is no longer required)
- added comment that sending cmdline upon CCREQ_RULE_INFO is
  evil...
- more to follow later.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@566 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 22:01:33 +00:00
Ozkan Sezer 42e55b3377 changed cvar callback functions to accept a cvar_t pointer arg. I may
have a use for that later.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@545 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-24 14:04:01 +00:00
Ozkan Sezer 0953ac6751 removed support for the -mode argument from gl_vidsdl.c
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@535 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-22 23:10:25 +00:00
Ozkan Sezer 1befaa5a49 gl_vidsdl.c fixes/changes from Sander van Dijk: if (hypothetically) no
fullscreen modes are reported at all fixes bad behaviour of several
options in the video menu, and allows the user to use "-force" to force
a fullscreen mode even if none was reported; this was previously only
possible if there was at least one fullscreen mode reported), makes the
treatment of "-current" more similar to "-width/-height/-bpp" (only
forcing it if the user provides "-force"), gets rid of leavecurrentmode
hack (which didn't do much useful, besides making the code less clear).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@534 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-22 21:55:48 +00:00
Ozkan Sezer 6c4ad9c240 backport from uhexen2: read video variables early so that a vid_restart
isn't necessary after init. thanks to Sander van Dijk.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@531 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-20 09:22:19 +00:00
Ozkan Sezer 968b469872 gl_vidsdl.c: comment out the rest of vid_refreshrate usage which isn't supported.
(VID_SetMode): check whether SDL_SetVideoMode() actually succeeded. otherwise we
just segfault. noticed by Sander.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@530 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-18 16:27:14 +00:00
Steven fc70175239 Make the default fullscreen mode 800x600 (same as window default), from Sander.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@487 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-09-20 06:41:36 +00:00
Ozkan Sezer 250fa2b7ce check for arguments to several command line options. patch from Sander van Dijk.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@446 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-04-19 18:29:41 +00:00
Ozkan Sezer 4f95ba8ef8 fixed several gcc-4.6 -Wunused-but-set-variable warnings.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@442 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-04-12 12:36:04 +00:00
Ozkan Sezer e3d1bf3814 gl_vidsdl.c (VID_Menu_ChooseNextRate): refresh rates not implemented for SDL.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@403 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-29 07:21:04 +00:00
Ozkan Sezer cbb7eb0428 Backported external music files support using decoder libraries and the
new raw samples interface from Hammer of Thyrion (uhexen2) :
- bgmusic.c, bgmusic.h: New BGM interface for background music handling.
  Handles streaming music as raw sound samples.
- bgmnull.c: BGM source for cases where the engine is configured for no
  sound.
- cl_main.c: Include bgmusic.h. Call BGM_Stop() and CDAudio_Stop() in
  CL_Disconnect().
- cd_sdl.c: Moved bgmvolume boundary checking to bgmusic.c upon value
  changes.
- gl_vidnt.c, gl_vidsdl.c, cl_parse.c: Include bgmusic.h. Add BGM_Pause()
  and BGM_Resume() calls along with CDAudio_ counterparts.
- cl_parse.c: Replace CDAudio_Play() call by the new BGM_PlayCDtrack()
  which first tries CDAudio_Play() and then streaming music if it fails.
- host.c: Include bgmusic.h. Call BGM_Update() just before S_Update()
  in Host_Frame(). In Host_Init(), call BGM_Init() after other audio init
  calls. In Host_Shutdown(), call BGM_Shutdown() before all other audio
  shutdown calls.
- snd_dma.c: Include snd_codec.h and bgmusic.h. Call S_CodecInit() from
  S_Init(). Call S_CodecShutdown() from S_Shutdown().
- snd_codec.c, snd_codec.h: New public codec interface for streaming
  music as raw samples. Adapted from quake2 and ioquake3 with changes.
  Individual codecs are responsible for handling any necessary byte swap
  operations.
- snd_codeci.h: New header for snd_codec internals.
- snd_wave.c, snd_wave.h: Codec for WAV format streaming music. Adapted
  from ioquake3 with changes.
- snd_vorbis.c, snd_vorbis.h: Codec for Ogg/Vorbis format streaming music.
- snd_mp3.c, snd_mp3.h: Codec for MP3 format streaming music using libmad.
  Adapted from the SoX project with changes.
- Makefile: Adjusted for the new sources. Added switches USE_CODEC_WAVE,
  USE_CODEC_MP3, USE_CODEC_VORBIS for enabling and disabling individual
  codecs.
- Windows makefiles and project files as well as other CodeBlocks project
  files will be updated shortly.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@374 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 19:50:43 +00:00