Skip to content

Commit

Permalink
add mobile definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
er2off committed Aug 20, 2023
1 parent b5a9add commit 9cc3539
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion game/client/touch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions gameui/OptionsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
7 changes: 7 additions & 0 deletions public/tier0/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion serverbrowser/BaseGamesPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down

0 comments on commit 9cc3539

Please sign in to comment.