Adding mouse wheel support, console input via keypad, removed +/-mlook for good

This commit is contained in:
eukos 2015-09-18 19:25:56 +02:00
parent 1395e8c7b8
commit 033d5440b0
3 changed files with 69 additions and 34 deletions

5
README
View file

@ -25,6 +25,7 @@ It can run Q1 with all its fancy waterwarping, too.
- Water translucency and refractions
- Low detail modes
- Distance fog
- Video output and window handling done with GDK/GTK
- Music playback via DUMB, X Multimedia System and FModEx if desired
*************
@ -38,10 +39,9 @@ For a release build (smaller and faster) issue 'make build_release'.
Notes
*********
- Originally based on engoo by leileilol
- Carried over soundfixes from reQuiem
- Main sound is done via OSS, not ALSA - aoss will most likely not work
- The input is 'not good' right now
- Originally based on engoo by leileilol
- If you want to run Q1 with it, launch it with -data id1.
You can get a particles.spr file for Q1 here: http://euksy.oldtimes-software.com/files/NGUNIX/particle.spr
@ -49,7 +49,6 @@ For a release build (smaller and faster) issue 'make build_release'.
Plans
*********
- Video output switch from X11 to GDK
- Audio output switch from direct-OSS to OpenAL
- Menu system done primarily using CSQC or similar
- HUD system done primarily using CSQC or similar

View file

@ -119,22 +119,6 @@ void KeyUp (kbutton_t *b)
void IN_KLookDown (void) {KeyDown(&in_klook);}
void IN_KLookUp (void) {KeyUp(&in_klook);}
void IN_MLookDown (void)
{
KeyDown(&in_mlook);
// 2001-12-16 M_LOOK cvar by Heffo/Maddes start
if ( !((in_mlook.state & 1) ^ ((int)m_look->value & 1)) && lookspring->value)
V_StartPitchDrift();
// 2001-12-16 M_LOOK cvar by Heffo/Maddes end
}
void IN_MLookUp (void)
{
KeyUp(&in_mlook);
if ( !((in_mlook.state & 1) ^ ((int)m_look->value & 1)) && lookspring->value) // 2001-12-16 M_LOOK cvar by Heffo/Maddes
V_StartPitchDrift();
}
void IN_UpDown(void) {KeyDown(&in_up);}
void IN_UpUp(void) {KeyUp(&in_up);}
void IN_DownDown(void) {KeyDown(&in_down);}
@ -546,8 +530,6 @@ void CL_InitInput (void)
Cmd_AddCommand ("impulse", IN_Impulse);
Cmd_AddCommand ("+klook", IN_KLookDown);
Cmd_AddCommand ("-klook", IN_KLookUp);
Cmd_AddCommand ("+mlook", IN_MLookDown);
Cmd_AddCommand ("-mlook", IN_MLookUp);
Cmd_AddCommand ("+tiltleft",IN_TiltLeftDown);
Cmd_AddCommand ("-tiltleft",IN_TiltLeftUp);

View file

@ -379,6 +379,57 @@ int XLateKey(int keysym)
case GDK_grave:
key = '`';
break;
case GDK_KEY_underscore:
key = '_';
break;
case GDK_KEY_KP_Multiply:
key = '*';
break;
case GDK_KEY_KP_Add:
key = '+';
break;
case GDK_KEY_KP_Subtract:
key = '-';
break;
case GDK_KEY_KP_Divide:
key = '/';
break;
case GDK_KEY_KP_Delete:
key = ',';
break;
case GDK_KEY_KP_Enter:
key = K_ENTER;
break;
case GDK_KEY_KP_0 :
key = '0';
break;
case GDK_KEY_KP_1 :
key = '1';
break;
case GDK_KEY_KP_2 :
key = '2';
break;
case GDK_KEY_KP_3 :
key = '3';
break;
case GDK_KEY_KP_4:
key = '4';
break;
case GDK_KEY_KP_5 :
key = '5';
break;
case GDK_KEY_KP_6 :
key = '6';
break;
case GDK_KEY_KP_7 :
key = '7';
break;
case GDK_KEY_KP_8 :
key = '8';
break;
case GDK_KEY_KP_9 :
key = '9';
break;
default:
if (keysym > GDK_space && keysym <= GDK_9)
key = keysym;
@ -386,8 +437,6 @@ int XLateKey(int keysym)
key = keysym - GDK_A + 'a';
if (keysym >= GDK_a && keysym <= GDK_z)
key = keysym - GDK_a + 'a';
if(keysym == GDK_KEY_underscore)
key = '_';
break;
}
//printf("keysym: %x, key: %x\n", keysym, key);
@ -453,6 +502,17 @@ void GetEvent(void)
if(event->button.button == 2)
Key_Event (K_MOUSE3, false);
break;
case GDK_SCROLL:
if(event->scroll.direction == GDK_SCROLL_UP)
{
Key_Event (K_MWHEELUP, true);
Key_Event (K_MWHEELUP, false);
}
if(event->scroll.direction == GDK_SCROLL_DOWN){
Key_Event (K_MWHEELDOWN, true);
Key_Event (K_MWHEELDOWN, false);
}
break;
break;
}
}
@ -460,7 +520,6 @@ void GetEvent(void)
// flushes the given rectangles from the view buffer to the screen
void VID_Update(vrect_t * rects)
{
if (config_notify)
{
config_notify = 0;
@ -698,29 +757,24 @@ void VID_CreateSplash()
void VID_Init_Cvars()
{
// Add stuff in here... later
}
void IN_Init_Cvars()
{
m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE|CVAR_ORIGINAL);
}
/*
===========
IN_DeactivateMouse --eukara
===========
*/
* Mouse related functions
* that have nothing todo with aiming or pushing buttons
*/
void IN_DeactivateMouse (void)
{
mouse_enabled = false;
gdk_pointer_ungrab (GDK_CURRENT_TIME);
}
/*
===========
IN_DeactivateMouse --eukara
===========
*/
void IN_ActivateMouse (void)
{
mouse_enabled = true;