Browse Source

add mobile definitions

pull/260/head
Er2 11 months ago
parent
commit
9cc3539f6d
  1. 2
      game/client/touch.cpp
  2. 6
      gameui/OptionsDialog.cpp
  3. 7
      public/tier0/platform.h
  4. 2
      serverbrowser/BaseGamesPage.cpp
  5. 5
      wscript

2
game/client/touch.cpp

@ -23,7 +23,7 @@ extern ConVar default_fov; @@ -23,7 +23,7 @@ extern ConVar default_fov;
extern IMatSystemSurface *g_pMatSystemSurface;
#ifdef ANDROID
#ifdef PLATFORM_MOBILE
#define TOUCH_DEFAULT "1"
#else
#define TOUCH_DEFAULT "0"

6
gameui/OptionsDialog.cpp

@ -87,9 +87,9 @@ COptionsDialog::COptionsDialog(vgui::Panel *parent) : PropertyDialog(parent, "Op @@ -87,9 +87,9 @@ COptionsDialog::COptionsDialog(vgui::Panel *parent) : PropertyDialog(parent, "Op
AddPage(new COptionsSubKeyboard(this), "#GameUI_Keyboard");
AddPage(new COptionsSubMouse(this), "#GameUI_Mouse");
#ifdef ANDROID
AddPage(new COptionsSubTouch(this), "Touch");
#endif
// Requires additional res file from extras_dir.vpk
if (IsMobile())
AddPage(new COptionsSubTouch(this), "Touch");
m_pOptionsSubAudio = new COptionsSubAudio(this);
AddPage(m_pOptionsSubAudio, "#GameUI_Audio");

7
public/tier0/platform.h

@ -276,6 +276,13 @@ typedef signed char int8; @@ -276,6 +276,13 @@ typedef signed char int8;
#else
#define IsAndroid() false
#endif
#ifdef PLATFORM_MOBILE
#define IsMobile() true
#else
#define IsMobile() false
#endif
// From steam/steamtypes.h
// RTime32
// We use this 32 bit time representing real world time.

2
serverbrowser/BaseGamesPage.cpp

@ -582,7 +582,7 @@ void CBaseGamesPage::LoadFilterSettings() @@ -582,7 +582,7 @@ void CBaseGamesPage::LoadFilterSettings()
m_bFilterNoEmptyServers = filter->GetInt("NoEmpty");
m_bFilterNoPasswordedServers = filter->GetInt("NoPassword");
m_bFilterReplayServers = filter->GetInt("Replay");
m_pQuickListCheckButton->SetSelected( filter->GetInt( "QuickList", IsAndroid() ) );
m_pQuickListCheckButton->SetSelected( filter->GetInt( "QuickList", IsMobile() ) );
int secureFilter = filter->GetInt("Secure");
m_pSecureFilter->ActivateItem(secureFilter);

5
wscript

@ -190,6 +190,11 @@ def define_platform(conf): @@ -190,6 +190,11 @@ def define_platform(conf):
if conf.options.ALLOW64:
conf.define('PLATFORM_64BITS', 1)
if (conf.env.DEST_OS == 'android' or
(conf.env.DEST_OS == 'win32' and conf.env.DEST_CPU in ['arm', 'arm64'])):
conf.env.MOBILE = True
conf.env.append_unique('DEFINES', ['PLATFORM_MOBILE=1'])
if conf.env.DEST_OS == 'linux':
conf.define('_GLIBCXX_USE_CXX11_ABI',0)
conf.env.append_unique('DEFINES', [

Loading…
Cancel
Save