diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index b0da40d03d..0563554c2f 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -24,14 +24,9 @@ jobs: # - os: ubuntu-aarch64-20.04 # targetos: linux # targetarch: aarch64 - -# - os: ubuntu-20.04 -# targetos: android -# targetarch: 32 -# - os: ubuntu-20.04 -# targetos: android -# targetarch: 64 - + - os: ubuntu-20.04 + targetos: android + targetarch: multiarch # - os: ubuntu-20.04 # targetos: motomagx # targetarch: armv6 @@ -51,7 +46,6 @@ jobs: env: SDL_VERSION: 2.28.1 GH_CPU_ARCH: ${{ matrix.targetarch }} - ANDROID_SDK_TOOLS_VER: 4333796 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.gitignore b/.gitignore index 42afad93a1..315b72ca35 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,11 @@ CMakeFiles Makefile cmake_install.cmake install_manifest.txt +CMakeLists.txt* +CMakeScripts +Testing +compile_commands.json +_deps # makedepend Makefile.dep *.bak diff --git a/engine/client/console.c b/engine/client/console.c index 64ddf883af..b85ac4dbf0 100644 --- a/engine/client/console.c +++ b/engine/client/console.c @@ -2093,7 +2093,11 @@ void Con_RunConsole( void ) { if( cls.state < ca_active || cl.first_frame ) con.showlines = refState.height; // full screen +#if XASH_MOBILE_PLATFORM + else con.showlines = refState.height; // always fullscreen on mobile +#else else con.showlines = (refState.height >> 1); // half screen +#endif } else con.showlines = 0; // none visible diff --git a/engine/client/in_touch.c b/engine/client/in_touch.c index a2ed8163e2..de3daf3479 100644 --- a/engine/client/in_touch.c +++ b/engine/client/in_touch.c @@ -2031,8 +2031,15 @@ int IN_TouchEvent( touchEventType type, int fingerID, float x, float y, float dx // Hack for keyboard, hope it help if( cls.key_dest == key_console || cls.key_dest == key_message ) { - if ( type == event_down ) // don't pop it again on event_up + static float x1 = 0.0f; + x1 += dx; + + if ( type == event_up ) // don't show keyboard on every tap + { Key_EnableTextInput( true, true ); + x1 = 0.0f; + } + if( cls.key_dest == key_console ) { static float y1 = 0; @@ -2051,9 +2058,12 @@ int IN_TouchEvent( touchEventType type, int fingerID, float x, float y, float dx } } - // exit of console area - if( type == event_down && x < 0.1f && y > 0.9f ) + // swipe from edge to exit console/chat + if(( x > 0.8f && x1 < -0.1f ) || ( x < 0.2f && x1 > 0.1f )) + { Cbuf_AddText( "escape\n" ); + x1 = 0.0f; + } } UI_MouseMove( TO_SCRN_X(x), TO_SCRN_Y(y) ); //MsgDev( D_NOTE, "touch %d %d\n", TO_SCRN_X(x), TO_SCRN_Y(y) ); diff --git a/engine/platform/sdl/events.c b/engine/platform/sdl/events.c index 2e9531a141..8b2e1a2329 100644 --- a/engine/platform/sdl/events.c +++ b/engine/platform/sdl/events.c @@ -654,7 +654,9 @@ static void SDLash_EventFilter( SDL_Event *event ) SDLash_ActiveEvent( false ); break; case SDL_WINDOWEVENT_RESIZED: +#ifndef XASH_MOBILE_PLATFORM if( vid_fullscreen.value == WINDOW_MODE_WINDOWED ) +#endif { SDL_Window *wnd = SDL_GetWindowFromID( event->window.windowID ); VID_SaveWindowSize( event->window.data1, event->window.data2, diff --git a/engine/platform/sdl/vid_sdl.c b/engine/platform/sdl/vid_sdl.c index 6d1204ff1b..9f70a06131 100644 --- a/engine/platform/sdl/vid_sdl.c +++ b/engine/platform/sdl/vid_sdl.c @@ -744,7 +744,6 @@ qboolean VID_CreateWindow( int width, int height, window_mode_t window_mode ) if( !glw_state.software ) SetBits( wndFlags, SDL_WINDOW_OPENGL ); -#if !XASH_MOBILE_PLATFORM if( window_mode == WINDOW_MODE_WINDOWED ) { SDL_Rect r; @@ -787,10 +786,6 @@ qboolean VID_CreateWindow( int width, int height, window_mode_t window_mode ) SetBits( wndFlags, SDL_WINDOW_BORDERLESS ); xpos = ypos = 0; } -#else - SetBits( wndFlags, SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_INPUT_GRABBED ); - xpos = ypos = SDL_WINDOWPOS_UNDEFINED; -#endif if( !VID_CreateWindowWithSafeGL( wndname, xpos, ypos, width, height, wndFlags )) return false; @@ -799,14 +794,12 @@ qboolean VID_CreateWindow( int width, int height, window_mode_t window_mode ) if( FBitSet( SDL_GetWindowFlags( host.hWnd ), SDL_WINDOW_MAXIMIZED|SDL_WINDOW_FULLSCREEN_DESKTOP ) != 0 ) SDL_GetWindowSize( host.hWnd, &width, &height ); -#if !XASH_MOBILE_PLATFORM if( window_mode != WINDOW_MODE_WINDOWED ) { if( !VID_SetScreenResolution( width, height, window_mode )) return false; } else VID_RestoreScreenResolution(); -#endif VID_SetWindowIcon( host.hWnd ); SDL_ShowWindow( host.hWnd ); @@ -1178,6 +1171,14 @@ qboolean VID_SetMode( void ) #endif // SDL_VERSION_ATLEAST( 2, 0, 0 ) } +#if XASH_MOBILE_PLATFORM + if( Q_strcmp( vid_fullscreen.string, DEFAULT_FULLSCREEN )) + { + Cvar_DirectSet( &vid_fullscreen, DEFAULT_FULLSCREEN ); + Con_Reportf( S_ERROR "VID_SetMode: windowed unavailable on this platform\n" ); + } +#endif + if( !FBitSet( vid_fullscreen.flags, FCVAR_CHANGED )) Cvar_DirectSet( &vid_fullscreen, DEFAULT_FULLSCREEN ); else diff --git a/engine/wscript b/engine/wscript index 6f009913ef..8bea525969 100644 --- a/engine/wscript +++ b/engine/wscript @@ -239,7 +239,7 @@ def build(bld): app_name = 'xash3d-fwgs' ) else: - if bld.env.SINGLE_BINARY: + if bld.env.SINGLE_BINARY and bld.env.DEST_OS != 'android': install_path = bld.env.BINDIR program = 'cxxprogram' if is_cxx_link else 'cprogram' if bld.env.STATIC: diff --git a/public/wscript b/public/wscript index 4f7b24f4ee..96a78769df 100644 --- a/public/wscript +++ b/public/wscript @@ -19,7 +19,7 @@ def build(bld): bld.stlib(source = bld.path.ant_glob('*.c'), target = 'public', features = 'c', - use = 'sdk_includes', + use = ['sdk_includes'], subsystem = bld.env.MSVC_SUBSYSTEM) if bld.env.TESTS: