From 1aa326b7f26aa5f9a2014b52e3572195833b784a Mon Sep 17 00:00:00 2001 From: nillerusr Date: Tue, 2 Aug 2022 10:45:21 +0300 Subject: [PATCH] appframework: use rawinput for android by default --- appframework/sdlmgr.cpp | 14 ++++++-------- game/client/particlemgr.cpp | 6 +++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/appframework/sdlmgr.cpp b/appframework/sdlmgr.cpp index e8e5a388..a2e82346 100644 --- a/appframework/sdlmgr.cpp +++ b/appframework/sdlmgr.cpp @@ -36,8 +36,8 @@ #define GLMPRINTF(args) #endif -#ifdef OSX -ConVar osx_rawinput_set_one_time( "osx_rawinput_set_one_time", "0", FCVAR_ARCHIVE|FCVAR_HIDDEN, ""); +#if defined( OSX ) || defined( ANDROID ) +ConVar rawinput_set_one_time( "rawinput_set_one_time", "0", FCVAR_ARCHIVE|FCVAR_HIDDEN, ""); #endif ConVar gl_blit_halfx( "gl_blit_halfx", "0" ); @@ -1141,17 +1141,15 @@ void CSDLMgr::OnFrameRendered() ConVarRef rawinput( "m_rawinput" ); - -#ifdef OSX - // We default raw input to on on Mac and set it one time for all users since +#if defined( OSX ) || defined( ANDROID ) + // We default raw input to on on Mac/Android and set it one time for all users since // it didn't used to be the default. - if ( !osx_rawinput_set_one_time.GetBool() ) + if ( !rawinput_set_one_time.GetBool() ) { - osx_rawinput_set_one_time.SetValue( 1 ); + rawinput_set_one_time.SetValue( 1 ); rawinput.SetValue( 1 ); } #endif - m_bRawInput = !m_bCursorVisible && rawinput.IsValid() && rawinput.GetBool(); SDL_bool bWindowGrab = !m_bCursorVisible ? SDL_TRUE : SDL_FALSE; diff --git a/game/client/particlemgr.cpp b/game/client/particlemgr.cpp index c880a415..8d14e7b6 100644 --- a/game/client/particlemgr.cpp +++ b/game/client/particlemgr.cpp @@ -1112,7 +1112,7 @@ void CParticleMgr::Term() { // Free all the effects. int iNext; - for ( int i = m_Effects.Head(); i != m_Effects.InvalidIndex(); i = iNext ) + for ( intp i = m_Effects.Head(); i != m_Effects.InvalidIndex(); i = iNext ) { iNext = m_Effects.Next( i ); m_Effects[i]->m_pSim->NotifyRemove(); @@ -1389,7 +1389,7 @@ void CParticleMgr::RemoveAllNewEffects() void CParticleMgr::RemoveAllEffects() { int iNext; - for ( int i = m_Effects.Head(); i != m_Effects.InvalidIndex(); i = iNext ) + for ( intp i = m_Effects.Head(); i != m_Effects.InvalidIndex(); i = iNext ) { iNext = m_Effects.Next( i ); RemoveEffect( m_Effects[i] ); @@ -1971,7 +1971,7 @@ void CParticleMgr::UpdateAllEffects( float flTimeDelta ) // Remove any effects that were flagged to be removed. int iNext; - for ( int i=m_Effects.Head(); i != m_Effects.InvalidIndex(); i=iNext ) + for ( intp i = m_Effects.Head(); i != m_Effects.InvalidIndex(); i=iNext ) { iNext = m_Effects.Next( i ); CParticleEffectBinding *pEffect = m_Effects[i];