This is a rather large patch which adds an experimental SDL rendering
target for Win32 (software renderer only). Changes to support SDL input
spilled over into a number of other areas - most notably the big churn in
keys.h to match the key symbols to those of SDL.
Credit to the Quakeforge project, whose sources were very helpful for me
in working out how this all fits together.
Compile with USE_SDL=Y to select the experimental target (tyr-quake.exe
and tyr-qwcl.exe only). Expect that not everything works - e.g. A single
800x600 video mode is hard coded right now.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Removes a couple of #ifdef WIN32 instances. Was supposed to be to release
the mouse pointer, but hasn't been doing that for a while now.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
As requested by Jonas Nicolaisen <J.Nicolaisen@gmx.net>. Actually, I can't
really verify that this works, since I don't have that many buttons myself.
Signed-off-by: Tyrann <tyrann@disenchant.net>
Move commctrl.h include to gl_vidnt.c, as that seems to be the only file that
needs it. Also remove a bunch of declarations for non-existent variables.
Signed-off-by: Tyrann <tyrann@disenchant.net>
Make a few more global variables in snd_win.c static. There was an interesting comment next to some of the variables, which I don't understand the reason for:
/*
* Global variables. Must be visible to window-procedure function
* so it can unlock and free the data block after it has been played.
*/
...but it all "seems to work" as statics, so I'll go ahead and do it.
Signed-off-by: Tyrann <tyrann@disenchant.net>
Add SNDDMA_LockBuffer() and SNDDMA_UnlockBuffer() functions to the generic
sound interface, to allow drivers to implement appropriate locking on their
DMA buffers if required. Move the #ifdef'd Windows specific code to do this
from the shared snd_mix.c and snd_dma.c files to the windows sound driver.
Thanks to O.Sezer <sezero@users.sourceforge.net> for the idea and for
providing the orginal patch which was the basis for this one.
Signed-off-by: Tyrann <tyrann@disenchant.net>
The HANDLEs hinput and houtput were made static in QW, but not in NQ - this
made QW conflict with the winquake header. Make NQ's static as well and remove
extern definition from the header.
Signed-off-by: Tyrann <tyrann@disenchant.net>
Annotate our varargs "printf" style functions with the gcc "format" attribute.
This shows up a whole bunch of incorrect usage in our code, so we'll start to
clean that up in subsequent patches. We've also constified the format string
arguments here.
Based on a patch from O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
Annotate a few functions (BOPS_Error, Sys_Error, Sys_Quit and SV_Error) with
the gcc attribute "noreturn" and clean up a few lines of dead code which were
only there previously to quiet the corresponding compiler warnings.
Based on a patch from O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
Introduce the Z_Realloc function, allowing zone allocations to be resized.
Based on the implementation in uHexenII.
Thanks to O.Sezer <sezero@users.sourceforge.net>.
Signed-off-by: Tyrann <tyrann@disenchant.net>
min/max clashes with another macro in the mingw headers, so just rename ours
to qmin/qmax. Move the definitions to mathlib.h so they can be shared between
QW and NQ.
Signed-off-by: Tyrann <tyrann@disenchant.net>
Mouse wheel events weren't being processed at all when direct input was
active. For direct input, these are given as Z axis mouse movement.
Signed-off-by: Tyrann <tyrann@disenchant.net>
Well, it turns out that progs->numstrings is actually the number of bytes
dedicated to storage of the progs strings, not the number of strings.
Consequently, our attempt to calculate the strings size was completely bogus.
To avoid futher confusion, we'll rename the numstrings member in the progs
header.
Thanks to O.Sezer <sezero@users.sourceforge.net> for pointing this out :)
Signed-off-by: Tyrann <tyrann@disenchant.net>
removed the splitbuffer, gamealive and soundalive members of the dma_t
structure, they aren't used in any way.
Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
removed the clipbox, clipmins and clipmaxs members of the model structure:
the header says it to be 'solid volume for clipping (sent from server)',
but the server doesn't do that and cl_ents does a bogus check for clipbox
in CL_SetSolidEntities which is removed now.
Signed-off-by: O.Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
Make a whole lot of globals from gl_mesh.c static.
Pass in the aliashdr_t to GL_MakeAliasModelDisplayLists so that
pheader global in gl_model.c can be made static also.
Signed-off-by: Tyrann <tyrann@disenchant.net>
Some assumptions about the sky texture in a BSP being unique prevented bsps
with more than one sky texture working properly. Indeed, this could also cause
bad memory corruption when a face with the non-primary sky texture, having
extents greater than the maximum was dynamically lit. The blocklights array is
only sized appropriately for areas <= 256 texels.
Signed-off-by: Tyrann <tyrann@disenchant.net>
The only one that really makes a difference here for systems I'm ever likely
to use is the sizeof(void *) removal, but it's probably a good idea to start
moving towards use of fixed size integer types for all the on-disk structures
throughout the source.
Signed-off-by: Tyrann <tyrann@disenchant.net>
Expose the game's gamma ramps so that the video driver can restore the gamma
when it gets focus in/out events from the windowing system. Add calls to
save/restore gamma to the gl_vidnt driver.
Signed-off-by: Ozkan Sezer <sezero@users.sourceforge.net>
Signed-off-by: Tyrann <tyrann@disenchant.net>
Move MAXPRINTMSG to sys.h so it can be shared between the various
users. Rename to MAX_PRINTMSG for consistency with other MAX_ defines.
Signed-off-by: Tyrann <tyrann@disenchant.net>
Detect FreeBSD, NetBSD and OpenBSD in the makefile. Add cdaudio support via
cd_bsd.c. I also had to add the track argument to the IsPlaying driver
function, as BSD uses it in the ioctl. Thanks to Alejandro Pulver for the
doing the original FreeBSD port.
Signed-off-by: Tyrann <tyrann@disenchant.net>
Rename the Windows CDAudio_MessageHandler to CDDrv_MessageHandler, as it's
part of the driver, not the generic CD layer. Move the declaration to the
winquake header.
Signed-off-by: Tyrann <tyrann@disenchant.net>
The windows driver needs to know which track is being resumed, so pass it down
through the driver API. Other drivers can ignore it if it's not needed.
Signed-off-by: Tyrann <tyrann@disenchant.net>