From 7807f356917457e0cfc1a2e3c70887954fb184d8 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Mon, 20 Aug 2012 21:24:54 +0000 Subject: [PATCH] control layer: comment out some unused functions and stuff. git-svn-id: https://svn.eduke32.com/eduke32@2940 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/jmact/_control.h | 23 +++-------------------- polymer/eduke32/source/jmact/control.c | 22 ++++++++++++---------- polymer/eduke32/source/jmact/control.h | 2 +- polymer/eduke32/source/jmact/mouse.c | 4 ++-- polymer/eduke32/source/jmact/mouse.h | 4 ++-- 5 files changed, 20 insertions(+), 35 deletions(-) diff --git a/polymer/eduke32/source/jmact/_control.h b/polymer/eduke32/source/jmact/_control.h index ca49ec048..149297168 100644 --- a/polymer/eduke32/source/jmact/_control.h +++ b/polymer/eduke32/source/jmact/_control.h @@ -164,24 +164,7 @@ typedef struct // int32_t ThrottleMultH; // int32_t RudderMultH; -/* -typedef struct - { - uint8_t active : 1; - uint8_t used : 1; - uint8_t toggle : 1; - uint8_t buttonheld : 1; - uint8_t cleared : 1; - } controlflags; -typedef struct - { - volatile uint8_t active : 1; - volatile uint8_t used : 1; - volatile uint8_t toggle : 1; - volatile uint8_t buttonheld : 1; - volatile uint8_t cleared : 1; - } controlflags; -*/ + typedef struct { uint8_t active ; @@ -228,7 +211,7 @@ typedef struct void CONTROL_GetMouseDelta( void ); uint8_t CONTROL_GetMouseButtons( void ); int32_t CONTROL_StartMouse( void ); -void CONTROL_GetJoyAbs( void ); +//void CONTROL_GetJoyAbs( void ); void CONTROL_GetJoyDelta( void ); int32_t CONTROL_StartJoy( int32_t joy ); void CONTROL_ShutJoy( int32_t joy ); @@ -236,7 +219,7 @@ void CONTROL_SetFlag( int32_t which, int32_t active ); void CONTROL_ButtonFunctionState( int32_t * state ); int32_t CONTROL_KeyboardFunctionPressed( int32_t whichfunction ); static inline int32_t CONTROL_CheckRange( int32_t which ); -int32_t CONTROL_GetTime( void ); +static int32_t CONTROL_GetTime( void ); void CONTROL_AxisFunctionState( int32_t * state ); void CONTROL_GetJoyMovement( ControlInfo * info ); diff --git a/polymer/eduke32/source/jmact/control.c b/polymer/eduke32/source/jmact/control.c index ce64db460..458bc5ef7 100644 --- a/polymer/eduke32/source/jmact/control.c +++ b/polymer/eduke32/source/jmact/control.c @@ -51,7 +51,7 @@ static uint8_t CONTROL_MouseButtonClickedCount[MAXMOUSEBUTTONS], CONTROL_JoyButt static int32_t CONTROL_UserInputCleared[3]; static int32_t(*GetTime)(void); int32_t CONTROL_Started = FALSE; -static int32_t ticrate; +//static int32_t ticrate; static int32_t CONTROL_DoubleClickSpeed; int32_t extinput[CONTROL_NUM_FLAGS]; @@ -86,6 +86,7 @@ int32_t CONTROL_StartMouse(void) return Mouse_Init(); } +#if 0 void CONTROL_GetJoyAbs(void) { } @@ -93,6 +94,7 @@ void CONTROL_GetJoyAbs(void) void CONTROL_FilterJoyDelta(void) { } +#endif void CONTROL_GetJoyDelta(void) { @@ -114,7 +116,7 @@ void CONTROL_ShutJoy(int32_t joy) CONTROL_JoyPresent = FALSE; } -int32_t CONTROL_GetTime(void) +static int32_t CONTROL_GetTime(void) { static int32_t t = 0; t += 5; @@ -442,11 +444,11 @@ static void DoGetDeviceButtons( uint8_t *ButtonClickedCount ) { - int32_t i=NumButtons-1, bs; + int32_t i=NumButtons-1; for (; i>=0; i--) { - bs = (buttons >> i) & 1; + int32_t bs = (buttons >> i) & 1; DeviceButtonState[i] = bs; ButtonClickedState[i] = FALSE; @@ -473,8 +475,10 @@ static void DoGetDeviceButtons( { ButtonClickedState[i] = TRUE; } + continue; } + if (ButtonClickedCount[i] == 2) ButtonClickedCount[i] = 0; @@ -484,9 +488,7 @@ static void DoGetDeviceButtons( void CONTROL_GetDeviceButtons(void) { - int32_t t; - - t = GetTime(); + int32_t t = GetTime(); if (CONTROL_MouseEnabled) { @@ -609,7 +611,7 @@ void CONTROL_ApplyAxis(int32_t axis, ControlInfo *info, controldevice device) } } -void CONTROL_PollDevices(ControlInfo *info) +static void CONTROL_PollDevices(ControlInfo *info) { Bmemcpy(CONTROL_LastMouseAxes, CONTROL_MouseAxes, sizeof(CONTROL_MouseAxes)); Bmemcpy(CONTROL_LastJoyAxes, CONTROL_JoyAxes, sizeof(CONTROL_JoyAxes)); @@ -769,7 +771,7 @@ void CONTROL_ProcessBinds(void) while (i--); } -void CONTROL_GetFunctionInput(void) +static void CONTROL_GetFunctionInput(void) { int32_t periphs[CONTROL_NUM_FLAGS]; int32_t i = CONTROL_NUM_FLAGS-1; @@ -811,7 +813,7 @@ int32_t CONTROL_Startup(controltype which, int32_t(*TimeFunction)(void), int32_t if (TimeFunction) GetTime = TimeFunction; else GetTime = CONTROL_GetTime; - ticrate = ticspersecond; +// ticrate = ticspersecond; CONTROL_DoubleClickSpeed = (ticspersecond*57)/100; if (CONTROL_DoubleClickSpeed <= 0) diff --git a/polymer/eduke32/source/jmact/control.h b/polymer/eduke32/source/jmact/control.h index c08dcb622..ecc0b79a4 100644 --- a/polymer/eduke32/source/jmact/control.h +++ b/polymer/eduke32/source/jmact/control.h @@ -158,7 +158,7 @@ void CONTROL_MapButton void CONTROL_DefineFlag( int32_t which, int32_t toggle ); int32_t CONTROL_FlagActive( int32_t which ); void CONTROL_ClearAssignments( void ); -void CONTROL_GetFunctionInput( void ); +// void CONTROL_GetFunctionInput( void ); void CONTROL_GetInput( ControlInfo *info ); void CONTROL_ClearButton( int32_t whichbutton ); extern float CONTROL_MouseSensitivity; diff --git a/polymer/eduke32/source/jmact/mouse.c b/polymer/eduke32/source/jmact/mouse.c index 7399116f2..81d0f861b 100644 --- a/polymer/eduke32/source/jmact/mouse.c +++ b/polymer/eduke32/source/jmact/mouse.c @@ -49,7 +49,7 @@ void MOUSE_Shutdown(void) uninitmouse(); } - +#if 0 void MOUSE_ShowCursor(void) { } @@ -58,7 +58,7 @@ void MOUSE_ShowCursor(void) void MOUSE_HideCursor(void) { } - +#endif int32_t MOUSE_GetButtons(void) { diff --git a/polymer/eduke32/source/jmact/mouse.h b/polymer/eduke32/source/jmact/mouse.h index 5bf251e14..c53c838a2 100644 --- a/polymer/eduke32/source/jmact/mouse.h +++ b/polymer/eduke32/source/jmact/mouse.h @@ -43,8 +43,8 @@ extern "C" { int32_t Mouse_Init( void ); void MOUSE_Shutdown( void ); -void MOUSE_ShowCursor( void ); -void MOUSE_HideCursor( void ); +//void MOUSE_ShowCursor( void ); +//void MOUSE_HideCursor( void ); int32_t MOUSE_GetButtons( void ); int32_t MOUSE_ClearButton( int32_t b ); void MOUSE_ClearAllButtons(void);