From 9f69eb11f1982d388169bd036ea677ab2759ff75 Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Sun, 1 Dec 2002 02:35:16 +0000 Subject: [PATCH] - Code reformatting - Confirming X11 keyhandling bug fix. (icculus patchset #7) --- src/gl_glx.c | 14 +++++++------- src/rw_in_svgalib.c | 33 ++++++++++++++++----------------- src/rw_sdl.c | 22 ++++++++++++++++++++++ src/rw_x11.c | 18 ++++++++++-------- 4 files changed, 55 insertions(+), 32 deletions(-) diff --git a/src/gl_glx.c b/src/gl_glx.c index 134a6b6..051fca5 100644 --- a/src/gl_glx.c +++ b/src/gl_glx.c @@ -638,13 +638,13 @@ static int XLateKey(XKeyEvent *ev) case 0x03c: key = ',';break;/* [<] */ #endif - default: - key = *(unsigned char*)buf; - if (key >= 'A' && key <= 'Z') - key = key - 'A' + 'a'; - if (key >= 1 && key <= 26) /* ctrl+alpha */ - key = key + 'a' - 1; - break; + default: + key = *(unsigned char*)buf; + if (key >= 'A' && key <= 'Z') + key = key - 'A' + 'a'; + if (key >= 1 && key <= 26) /* ctrl+alpha */ + key = key + 'a' - 1; + break; } return key; diff --git a/src/rw_in_svgalib.c b/src/rw_in_svgalib.c index d82df19..0fcf658 100644 --- a/src/rw_in_svgalib.c +++ b/src/rw_in_svgalib.c @@ -202,13 +202,13 @@ void KBD_Close(void) static qboolean UseMouse = true; -static int mouse_buttons; -static int mouse_buttonstate; -static int mouse_oldbuttonstate; -static float mouse_x, mouse_y; -static float old_mouse_x, old_mouse_y; -static int mx, my; -static int mwheel; +static int mouse_buttons; +static int mouse_buttonstate; +static int mouse_oldbuttonstate; +static float mouse_x, mouse_y; +static float old_mouse_x, old_mouse_y; +static int mx, my; +static int mwheel; static cvar_t *m_filter; static cvar_t *in_mouse; @@ -250,13 +250,12 @@ static void mousehandler(int buttonstate, int dx, int dy) my += dy; } #else /* drx is assumed to be the mouse wheel */ -static void mousehandler(int buttonstate, int dx, int dy, int dz, int drx, int dry, int drz) -{ - mouse_buttonstate = buttonstate; - mx += dx; - my += dy; +static void mousehandler(int buttonstate, int dx, int dy, int dz, int drx, int dry, int drz) { + mouse_buttonstate = buttonstate; + mx += dx; + my += dy; - mwheel = drx; + mwheel = drx; } #endif @@ -333,12 +332,12 @@ void RW_IN_Commands (void) mouse_oldbuttonstate = mouse_buttonstate; if (mwheel < 0) { - in_state->Key_Event_fp (K_MWHEELUP, true); - in_state->Key_Event_fp (K_MWHEELUP, false); + in_state->Key_Event_fp (K_MWHEELUP, true); + in_state->Key_Event_fp (K_MWHEELUP, false); } if (mwheel > 0) { - in_state->Key_Event_fp (K_MWHEELDOWN, true); - in_state->Key_Event_fp (K_MWHEELDOWN, false); + in_state->Key_Event_fp (K_MWHEELDOWN, true); + in_state->Key_Event_fp (K_MWHEELDOWN, false); } mwheel = 0; } diff --git a/src/rw_sdl.c b/src/rw_sdl.c index 6b0c00d..d8ac9fc 100644 --- a/src/rw_sdl.c +++ b/src/rw_sdl.c @@ -1,3 +1,25 @@ +/* $Id$ + * + * all os-specific SDL refresher code + * + * Copyright (c) 2002 The QuakeForge Project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + /* ** RW_SDL.C ** diff --git a/src/rw_x11.c b/src/rw_x11.c index 35f6d32..762d1d7 100644 --- a/src/rw_x11.c +++ b/src/rw_x11.c @@ -1,4 +1,6 @@ /* $Id$ + * + * all os-specific X11 software refresh code * * Copyright (C) 1997-2001 Id Software, Inc. * Copyright (c) 2002 The Quakeforge Project. @@ -911,14 +913,14 @@ int XLateKey(XKeyEvent *ev) case 0x03c: key = ',';break;/* [<] */ #endif - default: - key = *(unsigned char*)buf; - if (key >= 'A' && key <= 'Z') - key = key - 'A' + 'a'; - if (key >= 1 && key <= 26) /* ctrl+alpha */ - key = key + 'a' - 1; - break; - } + default: + key = *(unsigned char*)buf; + if (key >= 'A' && key <= 'Z') + key = key - 'A' + 'a'; + if (key >= 1 && key <= 26) /* ctrl+alpha */ + key = key + 'a' - 1; + break; + } return key; }