Commit Graph

947 Commits

Author SHA1 Message Date
Kevin Shanahan
d1087300b0 input: don't mess with key repeat handling in sdl driver
We don't really care about key repeats at this level, they are handled
by the key subsystem anyway. Probably should drop this from the other
input drivers as well.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 14:36:21 +10:30
Kevin Shanahan
1e81ac5c05 keys: make the toggle console key work again during demo playback
I broke this when I wanted to be able to use the ~ and ` keys within
the console. Now check the bindings directly so no matter what key is
bound to it, you can toggle the console.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 14:15:59 +10:30
Kevin Shanahan
7a9781d91e client: remove stufftext debugging printf
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 13:27:56 +10:30
Kevin Shanahan
6c51091dd4 trivial: cast data to correct type for CL_StartUpload
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 13:15:52 +10:30
Kevin Shanahan
00a3e9d26e client: reset any active palette shift on disconnect
Noticed sometimes (usually when playing a demo, then loading a level)
that the active palette shift remains when starting a new level.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 13:14:32 +10:30
Kevin Shanahan
fe2b85b1c5 screen: fix colours in gl remote screenshots
Fix a typo in the RGB orderings. Also switch to format GL_RGBA for
glReadPixels, as that's the only format that's guaranteed to be
available by the OpenGL ES spec (although we're not using that for
now, may as well be compatible).

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 13:11:31 +10:30
Kevin Shanahan
7906b99af7 screen: fix location of screenshot text for glquake
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 12:47:41 +10:30
Kevin Shanahan
5ab2db165e screen: fix filename generation for remote screenshot
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 12:46:34 +10:30
Kevin Shanahan
6e9cee5b49 screen: make local private functions/variables static
Reduce the surface area of the interfaces again. Turns out
SCR_BringDownConsole was never used (though I suspect we still want to
add back something to reset palette shift on disconnect, etc.)

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 09:18:40 +10:30
Kevin Shanahan
3bfba9541c screen: rename screen_common.c back to screen.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 08:51:59 +10:30
Kevin Shanahan
8df366f04d screen: merge SCR_UpdateScreen functions and move to common file
This one looks pretty ugly with all it's conditional bits but should
be able to clean that up more later.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 08:48:18 +10:30
Kevin Shanahan
465a6401ed screen: move loading plaque code to common file
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 08:05:06 +10:30
Kevin Shanahan
637f047809 screen: bit of re-ordering in SCR_UpdateScreen
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-18 07:05:57 +10:30
Kevin Shanahan
b54d1777b8 screen: move screenshot code to shared file
Starting to see that I should have just merged everything into
screen.c. That's pretty much where I expect this will end up.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 21:24:38 +10:30
Kevin Shanahan
b509e815a4 screen: move SCR_DrawConsole to common file
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 20:55:03 +10:30
Kevin Shanahan
5512afe6f1 screen: move more shared code to screen_common.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 20:44:15 +10:30
Kevin Shanahan
cb597d1120 screen: move scr_copy{top,everything} set in GL SCR_UpdateScreen
In glquake, this is set but never read so doesn't really matter where
it get's set. Let's match the software renderer's ordering.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 15:47:51 +10:30
Kevin Shanahan
c1de06175c screen: move shared refdef functions to screen_common.c
Minor differences in SCR_CalcRefdef worked around with an #ifdef GLQUAKE.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 15:37:26 +10:30
Kevin Shanahan
240cca9cdf screen: move r_refdef.fov_{x,y} calculation
Makes it easier to share the common SW/GL code.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 15:14:55 +10:30
Kevin Shanahan
a2d10fbadc screen: factor out gl refdef vrect calculations, similar to sw renderer
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 14:55:00 +10:30
Kevin Shanahan
ceb8c8efdd screen: re-organise GL SCR_CalcRefdef to be more like R_SetVrect
Looks like the R_SetVrect code was pulled inside this function at some
point and massaged for the GL version. Make it look more like the
original code (without changing the behaviour at all).

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 14:09:32 +10:30
Kevin Shanahan
62f08b09ce screen: make CalcFov static
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 14:09:15 +10:30
Kevin Shanahan
b2afdc3b59 render: mark input vrect const in R_SetVrect
Also, fix the argument names in the header file - an invitation for errors!

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 13:40:58 +10:30
Kevin Shanahan
f9a17a97a6 screen: #ifdef out the unused loading plaque code for QW/GL
The loading plaque code is never triggered in QW, so remove it from
the GL renderer in the same way it had been removed from the software
renderer.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 12:06:02 +10:30
Kevin Shanahan
8303aea9a1 screen: move some more shared code to screen_common.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 11:41:44 +10:30
Kevin Shanahan
4a5095252a screen: make private centerstring variables static
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 11:41:13 +10:30
Kevin Shanahan
990a106826 screen: fold SCR_CheckDrawCenterString into SCR_DrawCenterString
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 11:16:47 +10:30
Kevin Shanahan
ee4ae2d209 screen: pull common centerprint code into shared file
start pulling the common screen code into a shared file and leave only
the parts that need to differ between the renderers in the other
files.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 11:13:12 +10:30
Kevin Shanahan
7ee1a77cec input: take into account magnitude of scroll wheel event
SDL can deliver a variable amount of scroll wheel movment - not 100%
sure this is the correct way to handle it, but seems to work on all my
test boxes. Only on my Mac does the wheel event deliver a variable
magnitude depending on how far you scroll.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 10:15:08 +10:30
svdijk
087f489d54 SDL2ize mousewheel support (verify: up/down correct on windows/os x?).
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 09:56:08 +10:30
Kevin Shanahan
c36babc0b4 screen: constify SCR_CenterPrint(), fix truncation of long text
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 09:52:14 +10:30
Kevin Shanahan
a95b64a41b screen: rename block_drawing -> scr_block_drawing
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 09:11:19 +10:30
Kevin Shanahan
8a5607ef0a screen: constify argument to SCR_ModalMessage()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 09:06:33 +10:30
Kevin Shanahan
ab8cc408d3 screen: make WritePCXFile always take the upload parameter
Even though always false for NQ, make the API consistent to reduce
differences between NQ/QW. Constify the arguments as well.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 09:02:10 +10:30
Kevin Shanahan
bdef5d75ba screen: move screen.c file to common dir
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 08:55:52 +10:30
Kevin Shanahan
5a740d010c screen: merge differences between screen.c files
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 08:55:05 +10:30
Kevin Shanahan
72f8fd974d screen: remove duplicate definition of sb_lines
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 08:18:22 +10:30
Kevin Shanahan
3fb9f56f03 screen: move gl_screen.c file to common dir
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-16 21:30:35 +10:30
Kevin Shanahan
47405f3b05 screen: merge differences between gl_screen.c files
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-16 21:29:45 +10:30
Kevin Shanahan
97232f3069 draw: replace a couple of Draw_Char loops with Draw_String
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-16 21:05:22 +10:30
Kevin Shanahan
93116926a3 input: fix hang on new game screen for sdl/sgl on other platforms
Fixing the same bug in multiple places... bit of a hint that some
refactoring is in order here.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-16 20:58:55 +10:30
Kevin Shanahan
cf080cdefa cmd: make cmd_wait static
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-16 20:57:58 +10:30
Kevin Shanahan
0cf6215302 cmd: check command length against buffer space
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-16 20:56:30 +10:30
Kevin Shanahan
aed3d5183c keys: improved variable names and length check in Key_Bind_f
I think I put those single character variable names in there, but
easier to read with a little more verbosity. Re-work the binding
length check so it's all inside the loop, instead of once outside the
loop first and then in the loop as well.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-14 15:07:29 +10:30
Kevin Shanahan
a7df8c97e9 keys: buffer length checks in Key_Bind_f
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-14 10:00:23 +10:30
Kevin Shanahan
3541376147 trivial: use sizeof for buffer length check
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-14 09:59:12 +10:30
Kevin Shanahan
05f26c42e2 common: replace two more temp buffers with va()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-14 09:56:49 +10:30
Kevin Shanahan
530b82cbaa trivial: whitespace
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-14 09:54:46 +10:30
Kevin Shanahan
6b31a50386 trivial: remove some #if 0'd code targeted at 3dfx/Mesa
Looks like an old hack to deal with smaller max texture sizes in the
old, old days. Probably pre-dates the checking of GL_MAX_TEXTURE_SIZE.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-14 09:52:21 +10:30
Kevin Shanahan
3ef5b90a6a trivial: use va() instead of hand coded buffer
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-14 09:51:22 +10:30