mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Replace Android-specific member variables with static variables
This commit is contained in:
parent
ff43b32257
commit
ec84e81e17
|
@ -55,9 +55,6 @@ CInput::CInput()
|
||||||
m_NumTextInputInstances = 0;
|
m_NumTextInputInstances = 0;
|
||||||
m_EditingTextLen = -1;
|
m_EditingTextLen = -1;
|
||||||
m_aEditingText[0] = 0;
|
m_aEditingText[0] = 0;
|
||||||
|
|
||||||
m_LastX = 0;
|
|
||||||
m_LastY = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInput::Init()
|
void CInput::Init()
|
||||||
|
@ -78,11 +75,13 @@ bool CInput::MouseRelative(float *pX, float *pY)
|
||||||
float Sens = g_Config.m_InpMousesens / 100.0f;
|
float Sens = g_Config.m_InpMousesens / 100.0f;
|
||||||
|
|
||||||
#if defined(CONF_PLATFORM_ANDROID) // No relative mouse on Android
|
#if defined(CONF_PLATFORM_ANDROID) // No relative mouse on Android
|
||||||
|
static int s_LastX = 0;
|
||||||
|
static int s_LastY = 0;
|
||||||
SDL_GetMouseState(&nx, &ny);
|
SDL_GetMouseState(&nx, &ny);
|
||||||
int XTmp = nx - m_LastX;
|
int XTmp = nx - s_LastX;
|
||||||
int YTmp = ny - m_LastY;
|
int YTmp = ny - s_LastY;
|
||||||
m_LastX = nx;
|
s_LastX = nx;
|
||||||
m_LastY = ny;
|
s_LastY = ny;
|
||||||
nx = XTmp;
|
nx = XTmp;
|
||||||
ny = YTmp;
|
ny = YTmp;
|
||||||
Sens = 1;
|
Sens = 1;
|
||||||
|
|
|
@ -11,9 +11,6 @@ class CInput : public IEngineInput
|
||||||
{
|
{
|
||||||
IEngineGraphics *m_pGraphics;
|
IEngineGraphics *m_pGraphics;
|
||||||
|
|
||||||
int m_LastX;
|
|
||||||
int m_LastY;
|
|
||||||
|
|
||||||
int m_InputGrabbed;
|
int m_InputGrabbed;
|
||||||
char *m_pClipboardText;
|
char *m_pClipboardText;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue