An OpenMW mod that lets you play the whole Elder Scrolls III: Morrowind as a top-down isometric game — with full online co-op or MMO modes.
C++
The Android build goes: the app, its build scripts and patches, and its CI
Alan Saunders6fb132255991
diff --git a/.github/workflows/android.yml b/.github/workflows/android.ymldeleted file mode 100644index c90341f..0000000--- a/.github/workflows/android.yml+++ /dev/null@@ -1,86 +0,0 @@-name: Android--on:- # Branches only: tags (like the bundled-mods release's) don't build- push:- branches: ['**']- workflow_dispatch:--# A newer push replaces a run still going-concurrency:- group: ${{ github.workflow }}- cancel-in-progress: true--jobs:- apk:- runs-on: ubuntu-24.04- timeout-minutes: 360- steps:- # The NDK, the dependencies and their builds need more room than the runner leaves free- - name: Free disk space- run: sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL-- - uses: actions/checkout@v4-- - name: Dependencies- run: |- sudo apt-get update -qq- sudo apt-get install -y -qq build-essential cmake python3 wget unzip bzip2 pkg-config gettext-base autoconf \- automake libtool patch nasm-- - uses: actions/setup-java@v4- with:- distribution: temurin- java-version: 17-- # The NDK, downloaded sources and built dependencies (the engine itself is always rebuilt). Saved after every- # run, failed or not, so a failing engine build doesn't cost the hour the libraries take.- - uses: actions/cache/restore@v4- with:- path: |- android/buildscripts/downloads- android/buildscripts/toolchain- android/buildscripts/prefix- android/buildscripts/build- !android/buildscripts/build/arm64/openmw-prefix- key: android-deps-${{ github.run_id }}- restore-keys: android-deps--- # The bundled mods (third-party, so not in git): bundled-mods.zip on this repository's "bundled-mods" release- - name: Bundled mods- env:- GH_TOKEN: ${{ github.token }}- run: |- if gh release download bundled-mods -p bundled-mods.zip; then- unzip -q bundled-mods.zip -d bundled-mods- else- echo "::warning::No bundled-mods release: the APK goes without the bundled mods"- fi-- - name: Engine and libraries (arm64)- env:- ISOWIND_MODS: ${{ github.workspace }}/bundled-mods- # Report every file that fails, not just the first- MAKEFLAGS: -k- run: |- rm -rf android/buildscripts/build/arm64/openmw-prefix- cd android/buildscripts && ./build.sh --arch arm64-- - uses: actions/cache/save@v4- if: always()- with:- path: |- android/buildscripts/downloads- android/buildscripts/toolchain- android/buildscripts/prefix- android/buildscripts/build- !android/buildscripts/build/arm64/openmw-prefix- key: android-deps-${{ github.run_id }}-- - name: APK- run: cd android && ./gradlew --no-daemon assembleMainlineDebug-- - uses: actions/upload-artifact@v4- with:- name: isowind-android-arm64- path: android/app/build/outputs/apk/mainline/debug/*.apkdiff --git a/.gitignore b/.gitignoreindex 092ea2c..529f6ff 100644--- a/.gitignore+++ b/.gitignore@@ -91,6 +91,3 @@ venv/## operating system files.DS_StoreThumbs.db--# Isowind: the Android build scripts (build*/ above would skip them)-!android/buildscripts/diff --git a/CMakeLists.txt b/CMakeLists.txtindex 9a22336..b4d650f 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -85,9 +85,7 @@ set(OPENMW_VERSION_RELEASE 0)set(OPENMW_LUA_API_REVISION 129)set(OPENMW_POSTPROCESSING_API_REVISION 5)-# Isowind: builds from an exported source tree (no .git, e.g. Android) pass the engine source hash as ISOWIND_SOURCE_HASH-# (see cmake/GitVersion.cmake)-set(OPENMW_VERSION_COMMITHASH "${ISOWIND_SOURCE_HASH}")+set(OPENMW_VERSION_COMMITHASH "")set(OPENMW_VERSION_TAGHASH "")set(OPENMW_VERSION_COMMITDATE "")diff --git a/android/.gitignore b/android/.gitignoredeleted file mode 100644index d0297e2..0000000--- a/android/.gitignore+++ /dev/null@@ -1,17 +0,0 @@-.gradle-build-jniLibs-.idea-local.properties-*.iml-obj-assets-.gdb_history-app/wrap-fabric.properties-captures-*.apk-output.json-.ccls-cache-app/nightly-app/mainlinediff --git a/android/3rdparty-licenses.txt b/android/3rdparty-licenses.txtdeleted file mode 100644index 6fdf9d0..0000000--- a/android/3rdparty-licenses.txt+++ /dev/null@@ -1,2830 +0,0 @@-=================-Font Awesome Free-=================--This software includes graphical resources based on Font Awesome icons. Font Awesome is licensed under the Creative Commons Attribution 4.0 International license. See https://fontawesome.com/license/free for more details.--journal.png: https://fontawesome.com/icons/book-open?style=solid-jump.png: https://fontawesome.com/icons/reply?style=solid-keyboard.png: https://fontawesome.com/icons/keyboard?style=solid-pause.png: https://fontawesome.com/icons/pause?style=solid-save.png: https://fontawesome.com/icons/file-download?style=solid-sneak.png: https://fontawesome.com/icons/eye-slash?style=solid-third_person.png: https://fontawesome.com/icons/video?style=solid-toggle.png: https://fontawesome.com/icons/bars?style=solid-toggle_magic.png: https://fontawesome.com/icons/bolt?style=solid-use.png: https://fontawesome.com/icons/hand-point-up?style=solid-wait.png: https://fontawesome.com/icons/hourglass?style=solid-mouse.png - https://github.com/FortAwesome/Font-Awesome/issues/2376#issuecomment-215401368 - Based on an icon by t1k3 https://github.com/t1k3---============-Noun Project-============--This software includes graphical resources based on Noun Project icons.--inventory.png: https://thenounproject.com/term/backpack/2551/ - CC-0 - By Rémy Médard, FR-weapon.png: https://thenounproject.com/term/sword/1161/ - CC-BY-3 - By Christopher T. Howlett, CA-attack.png: Based on the weapon.png by Christopher T. Howlett and modified by treio---=============-libjpeg-turbo-=============--This software is based in part on the work of the Independent JPEG Group.---======-libpng-======--PNG Reference Library License version 2------------------------------------------ * Copyright (c) 1995-2019 The PNG Reference Library Authors.- * Copyright (c) 2018-2019 Cosmin Truta.- * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.- * Copyright (c) 1996-1997 Andreas Dilger.- * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.--The software is supplied "as is", without warranty of any kind,-express or implied, including, without limitation, the warranties-of merchantability, fitness for a particular purpose, title, and-non-infringement. In no event shall the Copyright owners, or-anyone distributing the software, be liable for any damages or-other liability, whether in contract, tort or otherwise, arising-from, out of, or in connection with the software, or the use or-other dealings in the software, even if advised of the possibility-of such damage.--Permission is hereby granted to use, copy, modify, and distribute-this software, or portions hereof, for any purpose, without fee,-subject to the following restrictions:-- 1. The origin of this software must not be misrepresented; you- must not claim that you wrote the original software. If you- use this software in a product, an acknowledgment in the product- documentation would be appreciated, but is not required.-- 2. Altered source versions must be plainly marked as such, and must- not be misrepresented as being the original software.-- 3. This Copyright notice may not be removed or altered from any- source or altered source distribution.---==========-FreeType 2-==========--Portions of this software are copyright © 2019 The FreeType-Project (www.freetype.org). All rights reserved.---===========-OpenAL Soft-===========--This software uses the OpenAL Soft Library.--Copyright (c) 1987, 1993, 1994 The Regents of the University of California-Copyright (C) 1999-2000 by authors.-Copyright (C) 1999-2007 by authors.-Copyright (C) 1999-2010 by authors.-Copyright (c) 2005 Boris Mikhaylov-Copyright (c) 2006, 2008 Junio C Hamano-Copyright (c) 2006, Matthias Kretz, <[email protected]>-Copyright (C) 2008 by authors.-Copyright (c) 2008, Alexander Neundorf, <[email protected]>-Copyright (C) 2008-2017 by Chris Robinson and Christopher Fitzgerald.-Copyright (C) 2009 by Chris Robinson.-Copyright (C) 2009 by Konstantinos Natsakis <[email protected]>-Copyright (c) 2009, Chris Robinson-Copyright (C) 2010 by Chris Robinson-Copyright (c) 2010 by Chris Robinson <[email protected]>-Copyright (C) 2010 by Chris Robinson <[email protected]>-Copyright (C) 2011 by authors.-Copyright (C) 2011 by Chris Robinson-Copyright (c) 2011 by Chris Robinson <[email protected]>-Copyright (C) 2011 by Chris Robinson.-Copyright (C) 2011 The Android Open Source Project-Copyright (c) 2011, Michael Jansen, <[email protected]>-Copyright (C) 2011-2013 by authors.-Copyright (C) 2011-2019 Christopher Fitzgerald-Copyright (c) 2012 by Chris Robinson <[email protected]>-Copyright (C) 2013 by Anis A. Hireche-Copyright (c) 2013 by Chris Robinson <[email protected]>-Copyright (C) 2013 by Mike Gorchak-Copyright (C) 2014 by Timothy Arceri <[email protected]>.-Copyright (c) 2015 by Chris Robinson <[email protected]>-Copyright (C) 2015 by Christopher Fitzgerald.-Copyright (c) 2017 by Chris Robinson <[email protected]>-Copyright (C) 2018 by authors.-Copyright (c) 2018 by Chris Robinson <[email protected]>-Copyright (C) 2018 by Raul Herraiz.-Copyright (C) 2018-2019 Christopher Fitzgerald-Copyright 2003-2009 Kitware, Inc.-Copyright 2003-2011 Kitware, Inc.-Copyright 2005-2009 Kitware, Inc.-Copyright 2009-2011 Kitware, Inc.-Copyright 2009-2011 Philip Lowman <[email protected]>-Copyright 2012 Benjamin Eikel-Copyright Iowa State University 2012.--The OpenAL Soft Library is licensed under the GNU Lesser General Public Library, version 2. A copy of the license is provided below.---=====-boost-=====--Boost Software License - Version 1.0 - August 17th, 2003--Permission is hereby granted, free of charge, to any person or organization-obtaining a copy of the software and accompanying documentation covered by-this license (the "Software") to use, reproduce, display, distribute,-execute, and transmit the Software, and to prepare derivative works of the-Software, and to permit third-parties to whom the Software is furnished to-do so, all subject to the following:--The copyright notices in the Software and this entire statement, including-the above license grant, this restriction and the following disclaimer,-must be included in all copies of the Software, in whole or in part, and-all derivative works of the Software, unless such copies or derivative-works are solely in the form of machine-executable object code generated by-a source language processor.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER-DEALINGS IN THE SOFTWARE.---======-ffmpeg-======--This software uses the ffmpeg Library.--Copyright (c) Nick Kurshev <[email protected]>-Copyright (c) 1990 James Ashton - Sydney University-Copyright (c) 1994-2012 by the Xiph.Org Foundation and contributors-Copyright (C) 1995 Mark Adler-Copyright (C) 1995 The Bitmap Brothers Ltd."-Copyright (c) 1997-2001 ZSNES Team ( [email protected] / [email protected] )-Copyright (c) 1998 - 2009 Conifer Software-Copyright (c) 1998 Juergen Mueller And Sundry Contributors-Copyright (c) 1999 Chris Bagwell-Copyright (C) 1999 Intel Corporation)-Copyright (c) 1999 Nick Bailey-Copyright (c) 1999 Roger Hardiman-Copyright (c) 2000 Chris Ausbrooks <[email protected]>-Copyright (c) 2000 Edward Beingessner And Sundry Contributors.-Copyright (c) 2000 Fabien COELHO <[email protected]>-Copyright (c) 2000 Fabrice Bellard-Copyright (c) 2000 John Walker-Copyright (c) 2000, 2001 Fabrice Bellard-Copyright (c) 2000, 2001, 2002 Fabrice Bellard-Copyright (c) 2000, 2001, 2002, 2003 Fabrice Bellard-Copyright (c) 2000,2001 Fabrice Bellard-Copyright (c) 2000-2001 Fabrice Bellard <[email protected]>-Copyright (c) 2000-2002 Fabrice Bellard-Copyright (c) 2000-2003 Fabrice Bellard-Copyright (c) 2001 Chris Bagwell-Copyright (c) 2001 Donald A. Graft-Copyright (c) 2001 Fabrice Bellard-Copyright (c) 2001 Fabrice Bellard (original AU code)-Copyright (c) 2001 Fabrice Bellard.-Copyright (c) 2001 FFmpeg project-Copyright (c) 2001 Heikki Leinonen-Copyright (c) 2001 Juan J. Sierralta P-Copyright (c) 2001 Lionel Ulmer-Copyright (c) 2001 Lionel Ulmer ([email protected] / [email protected])-Copyright (c) 2001 Michael Niedermayer <[email protected]>-Copyright (c) 2001 Michel Lespinasse-Copyright (c) 2001, 2002 Fabrice Bellard-Copyright (c) 2001, 2002 Michael Niedermayer <[email protected]>-Copyright (c) 2001, 2002, 2003 Fabrice Bellard-Copyright (c) 2001,2003 BERO-Copyright (C) 2001-2002 Michael Niedermayer ([email protected])-Copyright (c) 2001-2003 BERO <[email protected]>-Copyright (C) 2001-2003 Michael Niedermayer ([email protected])-Copyright (C) 2001-2003 Michael Niedermayer <[email protected]>-Copyright (c) 2001-2003 The FFmpeg project-Copyright (c) 2001-2003, David Janssens-Copyright (C) 2001-2007 Michael Niedermayer-Copyright (C) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen-Copyright (c) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen and others-Copyright (C) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen and others-Copyright (C) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen, Damien Zammit-Copyright (c) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen, Damien Zammit and others-Copyright (c) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen, Vladimir Sadovnikov and others-Copyright (c) 2001-2010 Vladimir Sadovnikov-Copyright (C) 2001-2011 Michael Niedermayer <[email protected]>-Copyright (C) 2001-2012 Michael Niedermayer <[email protected]>-Copyright (c) 2001-2014, Jim Teeuwen-Copyright (c) 2002 A'rpi-Copyright (c) 2002 Alex Beregszaszi-Copyright (c) 2002 Anders Johansson <[email protected]>-Copyright (c) 2002 Brian Foley-Copyright (c) 2002 Dieter Shirley-Copyright (c) 2002 Fabrice Bellard-Copyright (c) 2002 Falk Hueffner <[email protected]>-Copyright (c) 2002 Francois Revol-Copyright (c) 2002 Francois Revol <[email protected]>-Copyright (C) 2002 Frederic 'dilb' Boulay-Copyright (C) 2002 Gunnar Monell <[email protected]>-Copyright (c) 2002 Jindrich Makovicka <[email protected]>-Copyright (c) 2002 Laszlo Torok <[email protected]>-Copyright (c) 2002 Lennert Buytenhek <[email protected]>-Copyright (c) 2002 Mark Hills <[email protected]>-Copyright (c) 2002 Michael Niedermayer-Copyright (c) 2002 Michael Niedermayer <[email protected]>-Copyright (C) 2002 Michael Niedermayer <[email protected]>-Copyright (c) 2002 Naoki Shibata-Copyright (c) 2002 Steve O'Hara-Smith-Copyright (c) 2002 The FFmpeg project-Copyright (c) 2002 The FFmpeg Project-Copyright (c) 2002 The Xine project-Copyright (c) 2002 Zdenek Kabelac <[email protected]>-Copyright (c) 2002, 2003 Fabrice Bellard-Copyright (c) 2002-2003 Brian J. Murrell-Copyright (c) 2002-2003 Fabrice Bellard-Copyright (c) 2002-2003, Yannick Verschueren-Copyright (c) 2002-2004 Maxim Poliakovski-Copyright (c) 2002-2004 Michael Niedermayer-Copyright (c) 2002-2004 Michael Niedermayer <[email protected]>-Copyright (C) 2002-2004 Michael Niedermayer <[email protected]>-Copyright (c) 2002-2004 Roberto Togni-Copyright (c) 2002-2006 Michael Niedermayer <[email protected]>-Copyright (c) 2002-2007 The FFmpeg Project-Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium-Copyright (c) 2002-2007, Professor Benoit Macq-Copyright (c) 2002-2010 Michael Niedermayer <[email protected]>-Copyright (c) 2002-2012 Michael Niedermayer-Copyright (C) 2002-2012 Michael Niedermayer-Copyright (c) 2002-2013 Michael Niedermayer <[email protected]>-Copyright (c) 2002-2014 Michael Niedermayer <[email protected]>-Copyright (C) 2003 James Klicman <[email protected]>-Copyright (c) 2003 The FFmpeg project-Copyright (c) 2003 Alex Beregszaszi-Copyright (C) 2003 Alex Beregszaszi & Mike Melanson-Copyright (c) 2003 Daniel Moreno <comac AT comac DOT darktech DOT org>-Copyright (c) 2003 Donald A. Graft-Copyright (c) 2003 Donnie Smith-Copyright (C) 2003 Dr. Tim Ferguson-Copyright (c) 2003 Ewald Snel-Copyright (c) 2003 Fabrice Bellard-Copyright (c) 2003 Gustavo Sverzut Barbieri <[email protected]>-Copyright (c) 2003 International Business Machines, Corp.-Copyright (c) 2003 Ivan Kalvachev-Copyright (C) 2003 Ivan Kalvachev-Copyright (c) 2003 LeFunGus, [email protected]-Copyright (c) 2003 Michael Niedermayer-Copyright (c) 2003 Michael Niedermayer <[email protected]>-Copyright (c) 2003 Michael Zucchi <[email protected]>-Copyright (c) 2003 Michel Bardiaux-Copyright (C) 2003 Mike Melanson-Copyright (c) 2003 Nick Kurshev-Copyright (c) 2003 Rich Felker-Copyright (C) 2003 Roberto Togni-Copyright (c) 2003 Romain Dolbeau <[email protected]>-Copyright (c) 2003 Roman Shaposhnik-Copyright (c) 2003 Sascha Sommer-Copyright (c) 2003 The FFmpeg project-Copyright (c) 2003 The FFmpeg Project-Copyright (C) 2003 The FFmpeg project-Copyright (c) 2003 Thomas Raivio-Copyright (c) 2003 Tinic Uro-Copyright (c) 2003 Tobias Diedrich-Copyright (C) 2003, 2004 The FFmpeg project-Copyright (c) 2003-2004 Michael Niedermayer-Copyright (c) 2003-2004 Michael Niedermayer <[email protected]>-Copyright (c) 2003-2004 Romain Dolbeau-Copyright (c) 2003-2004 Romain Dolbeau <[email protected]>-Copyright (c) 2003-2004 The FFmpeg project-Copyright (C) 2003-2004 The FFmpeg project-Copyright (C) 2003-2005 by Christopher R. Hertel ([email protected])-Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe-Copyright (c) 2003-2008 The FFmpeg Project-Copyright (C) 2003-2008 x264 project-Copyright (c) 2003-2010 Michael Niedermayer <[email protected]>-Copyright (c) 2003-2011 Michael Niedermayer <[email protected]>-Copyright (C) 2003-2011 Michael Niedermayer <[email protected]>-Copyright (c) 2003-2012 Michael Niedermayer <[email protected]>-Copyright (c) 2003-2013 Loren Merritt-Copyright (c) 2003-2013 Michael Niedermayer-Copyright (c) 2003-2013 Michael Niedermayer <[email protected]>-Copyright (c) 2003-2016 Michael Niedermayer <[email protected]>-Copyright (c) 2004 The FFmpeg project-Copyright (c) 2004 Adam Thayer <[email protected]>-Copyright (c) 2004 AGAWA Koji <i (AT) atty (DOT) jp>-Copyright (c) 2004 Alex Beregszaszi-Copyright (C) 2004 Alex Beregszaszi-Copyright (C) 2004 Benjamin Zores-Copyright (c) 2004 Denes Balatoni.-Copyright (C) 2004 Gildas Bazin-Copyright (c) 2004 Gildas Bazin <gbazin at videolan dot org>-Copyright (c) 2004 Konstantin Shishkov-Copyright (C) 2004 Konstantin Shishkov-Copyright (c) 2004 Maarten Daniels-Copyright (c) 2004 Michael Niedermayer-Copyright (c) 2004 Michael Niedermayer <[email protected]>-Copyright (C) 2004 Michael Niedermayer <[email protected]>-Copyright (C) 2004 Mike Melanson <[email protected]>-Copyright (c) 2004 Romain Dolbeau <[email protected]>-Copyright (C) 2004 Romain Dolbeau <[email protected]>-Copyright (c) 2004 Roman Shaposhnik-Copyright (c) 2004 The FFmpeg project-Copyright (c) 2004 The FFmpeg Project-Copyright (C) 2004 The FFmpeg project-Copyright (c) 2004 Tobias Diedrich-Copyright (c) 2004 Ville Saari-Copyright (C) 2004-2005 Henryk Ploetz <[email protected]>-Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt-Copyright (C) 2004-2005 Michael Niedermayer, Loren Merritt-Copyright (c) 2004-2006 Michael Niedermayer-Copyright (C) 2004-2007 Eric Lasota-Copyright (c) 2004-2007 Michael Niedermayer-Copyright (c) 2004-2008 Marko Kreen-Copyright (C) 2004-2010 Marcel Holtmann <[email protected]>-Copyright (C) 2004-2010 Michael Niedermayer <[email protected]>-Copyright (c) 2004-2011 Michael Niedermayer <[email protected]>-Copyright (c) 2004-2012 Michael Niedermayer <[email protected]>-Copyright (C) 2005 Mans Rullgard <[email protected]>-Copyright (C) 2005 Matthieu CASTET-Copyright (C) 2005 Matthieu CASTET, Alex Beregszaszi-Copyright (C) 2005 Michael Ahlberg, Måns Rullgård-Copyright (C) 2005 Ole André Vadla Ravnås <[email protected]>-Copyright (c) 2005 Alban Bedel <[email protected]>-Copyright (c) 2005 Alex Beregszaszi-Copyright (c) 2005 Benjamin Larsson-Copyright (c) 2005 by Neal Symms ([email protected]) - February 2005-Copyright (c) 2005 David Hammerton-Copyright (c) 2005 DivX, Inc.-Copyright (c) 2005 Eric Lasota-Copyright (c) 2005 Fabrice Bellard-Copyright (c) 2005 Francois Revol-Copyright (c) 2005 Ian Caulfield-Copyright (c) 2005 Jeff Muizelaar-Copyright (c) 2005 Konstantin Shishkov-Copyright (c) 2005 Luca Barbato <[email protected]>-Copyright (c) 2005 Mans Rullgard-Copyright (c) 2005 Michael Niedermayer <[email protected]>-Copyright (C) 2005 Nikolaj Poroshin <[email protected]>-Copyright (c) 2005 Reimar Döffinger-Copyright (c) 2005 Robert Edele <[email protected]>-Copyright (c) 2005 Roberto Togni-Copyright (c) 2005 Roine Gustafsson-Copyright (c) 2005 Steve Underwood <steveu at coppice.org>-Copyright (C) 2005 The FFmpeg project-Copyright (c) 2005 Vidar Madsen-Copyright (c) 2005 VLC authors and VideoLAN-Copyright (c) 2005 Wolfram Gloger-Copyright (c) 2005 Zoltan Hidvegi <hzoli -a- hzoli -d- com>,-Copyright (c) 2005, 2011 Peter Ross <[email protected]>-Copyright (c) 2005, Herve Drolon, FreeImage Team-Copyright (C) 2005-2006 Brad Midgley <[email protected]>-Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )-Copyright (c) 2005-2006 Robert Edele <[email protected]>-Copyright (C) 2005-2008 Brad Midgley <[email protected]>-Copyright (c) 2005-2008 Diego Biurrun-Copyright (c) 2005-2008 Mans Rullgard-Copyright (C) 2005-2010 x264 project-Copyright (c) 2005-2010, 2012 Wolfram Gloger-Copyright (C) 2005-2011 x264 project-Copyright (c) 2005-2012 Michael Niedermayer <[email protected]>-Copyright (C) 2005-2018 x264 project-Copyright (c) 2006 Aurelien Jacobs <[email protected]>-Copyright (C) 2006 Aurelien Jacobs <[email protected]>-Copyright (c) 2006 Justin Ruggles <[email protected]>-Copyright (c) 2006 Patrick Guimond-Copyright (c) 2006 Stefan Gehrer <[email protected]>-Copyright (c) 2006 Thijs Vermeir <[email protected]>-Copyright (c) 2006 Alex Beregszaszi-Copyright (c) 2006 Aurelien Jacobs <[email protected]>-Copyright (c) 2006 Baptiste Coudurier-Copyright (c) 2006 Baptiste Coudurier <[email protected]>-Copyright (c) 2006 Baptiste Coudurier <[email protected]>-Copyright (c) 2006 Benjamin Larsson-Copyright (C) 2006 Benjamin Larsson-Copyright (c) 2006 Cyril Zorin-Copyright (c) 2006 Daniel Maas <[email protected]>-Copyright (c) 2006 Gregory Montoir ([email protected])-Copyright (c) 2006 Industrial Light & Magic, a division of Lucas Digital Ltd. LLC-Copyright (c) 2006 Ivo van Poorten-Copyright (c) 2006 John Maddock-Copyright (c) 2006 Julian Hall-Copyright (c) 2006 Kartikey Mahendra BHATT (bhattkm at gmail dot com)-Copyright (c) 2006 Konstantin Shishkov-Copyright (C) 2006 Loren Merritt <[email protected]>-Copyright (c) 2006 Luca Abeni-Copyright (c) 2006 Luca Barbato <[email protected]>-Copyright (c) 2006 Mans Rullgard <[email protected]>-Copyright (c) 2006 Michael Niedermayer-Copyright (C) 2006 Michael Niedermayer ([email protected])-Copyright (c) 2006 Michael Niedermayer <[email protected]>-Copyright (C) 2006 Michael Niedermayer <[email protected]>-Copyright (c) 2006 Michael Niedermayer <[email protected]> et al-Copyright (c) 2006 Oded Shimon <[email protected]>-Copyright (c) 2006 Paul Richards <[email protected]>-Copyright (c) 2006 Peter Ross-Copyright (c) 2006 Reimar Doeffinger-Copyright (c) 2006 Reynaldo H. Verdejo Pinochet-Copyright (c) 2006 Rob Sykes <[email protected]>-Copyright (C) 2006 Robert Edele <[email protected]>-Copyright (c) 2006 Roman Shaposhnik-Copyright (c) 2006 Ryan Martell-Copyright (c) 2006 Ryan Martell <[email protected]>-Copyright (c) 2006 Ryan Martell. ([email protected])-Copyright (c) 2006 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>-Copyright (c) 2006 Smartjog S.A.S, Baptiste Coudurier <[email protected]>-Copyright (c) 2006 Steve Lhomme-Copyright (c) 2006 The FFmpeg Project-Copyright (c) 2006 Xiaogang Zhang-Copyright (c) 2006, 2007 Michel Bardiaux-Copyright (c) 2006, 2007 Michel Bardiaux <[email protected]>-Copyright (c) 2006, 2008 Konstantin Shishkov-Copyright (c) 2006,2007 Ryan Martell-Copyright (c) 2006,2008 Peter Ross-Copyright (c) 2006,2011 Konstantin Shishkov-Copyright (c) 2006-2007 Benjamin Larsson-Copyright (C) 2006-2007 Kevin Stone-Copyright (c) 2006-2007 Konstantin Shishkov-Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )-Copyright (c) 2006-2007 Maxim Poliakovski-Copyright (c) 2006-2007 Robert Swain-Copyright (c) 2006-2008 Benjamin Larsson-Copyright (c) 2006-2008 Maxim Poliakovski-Copyright (c) 2006-2008 Peter Ross-Copyright (c) 2006-2008 Ramiro Polla-Copyright (c) 2006-2008 Rob Sykes <[email protected]>-Copyright (c) 2006-2009 Justin Ruggles-Copyright (c) 2006-2010 Justin Ruggles <[email protected]>-Copyright (c) 2006-2010 Prakash Punnoor <[email protected]>-Copyright (c) 2006-2011 Justin Ruggles <[email protected]>-Copyright (C) 2006-2011 Michael Niedermayer <[email protected]>-Copyright (C) 2006-2011 Xvid Solutions GmbH-Copyright (c) 2006-2013 Maxim Poliakovski-Copyright (C) 2007 Aurelien Jacobs <[email protected]>-Copyright (c) 2007 Justin Ruggles-Copyright (c) 2007 a840bda5870ba11f19698ff6eb9581dfb0f95fa5,-Copyright (C) 2007 Alexis Ballier-Copyright (c) 2007 Anssi Hannula <[email protected]>-Copyright (c) 2007 Aurelien Jacobs <[email protected]>-Copyright (c) 2007 Baptiste Coudurier-Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at free dot fr>-Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>-Copyright (c) 2007 Baptiste Coudurier, Benjamin Larsson, Ulion-Copyright (c) 2007 Bartlomiej Wolowiec-Copyright (c) 2007 Bartlomiej Wolowiec <[email protected]>-Copyright (c) 2007 Benjamin Zores <[email protected]>-Copyright (c) 2007 Benoit Fouet-Copyright (c) 2007 Benoit Fouet ( benoit fouet free fr )-Copyright (c) 2007 Benoit Fouet <[email protected]>-Copyright (c) 2007 Björn Axelsson-Copyright (c) 2007 Bobby Bingham-Copyright (C) 2007 by Andrew Zabolotny (author of lensfun, from which this filter derives from)-Copyright (c) 2007 Christian Ohm, 2008 Eli Friedman-Copyright (c) 2007 Christophe GISQUET <[email protected]>-Copyright (C) 2007 Clemens Fruhwirth-Copyright (c) 2007 David Conrad-Copyright (c) 2007 Ian Caulfield-Copyright (c) 2007 Ivo van Poorten-Copyright (c) 2007 Justin Ruggles-Copyright (c) 2007 Justin Ruggles <[email protected]>-Copyright (c) 2007 Kamil Nowosad-Copyright (c) 2007 Konstantin Shishkov-Copyright (C) 2007 Konstantin Shishkov-Copyright (c) 2007 Loic Minier <lool at dooz.org>-Copyright (c) 2007 Loren Merritt-Copyright (c) 2007 Luca Abeni-Copyright (c) 2007 Luca Abeni ( lucabe72 email it )-Copyright (c) 2007 Luca Barbato <[email protected]>-Copyright (c) 2007 Mans Rullgard-Copyright (c) 2007 Mans Rullgard <[email protected]>-Copyright (C) 2007 Marc Hoffman-Copyright (c) 2007 Marco Gerards-Copyright (c) 2007 Marco Gerards <[email protected]>-Copyright (C) 2007 Marco Gerards <[email protected]>-Copyright (c) 2007 Michael Niedermayer-Copyright (c) 2007 Michael Niedermayer <[email protected]>-Copyright (C) 2007 Michael Niedermayer <[email protected]>-Copyright (c) 2007 Mike Melanson, Konstantin Shishkov-Copyright (c) 2007 Nicholas Tung-Copyright (C) 2007 Nicholas Tung-Copyright (c) 2007 Nicolas George <[email protected]>-Copyright (c) 2007 Peter Ross-Copyright (c) 2007 Reimar Doeffinger-Copyright (c) 2007 Reimar Döffinger-Copyright (c) 2007 Reynaldo H. Verdejo Pinochet-Copyright (c) 2007 Reynaldo H. Verdejo Pinochet (QCELP decoder)-Copyright (C) 2007 Richard Spindler (author of frei0r plugin from which this was derived)-Copyright (c) 2007 Rob Sykes <[email protected]>-Copyright (c) 2007 Ronald S. Bultje-Copyright (c) 2007 Ronald S. Bultje <[email protected]>-Copyright (c) 2007 Siarhei Siamashka <[email protected]>-Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>-Copyright (c) 2007 The FFmpeg Project-Copyright (C) 2007 The FFmpeg Project-Copyright (c) 2007 Vitor Sessak-Copyright (C) 2007 Vitor Sessak <[email protected]>-Copyright (c) 2007 Vladimir Voroshilov-Copyright (c) 2007 Wolfram Gloger-Copyright (c) 2007, 2008 Ivo van Poorten-Copyright (c) 2007, Callum Lerwick <[email protected]>-Copyright (c) 2007-2008 Bartlomiej Wolowiec <[email protected]>-Copyright (c) 2007-2008 CSIRO-Copyright (c) 2007-2008 Ian Caulfield-Copyright (c) 2007-2008 Marco Gerards <[email protected]>-Copyright (c) 2007-2008 Peter Ross-Copyright (c) 2007-2008 Peter Ross <[email protected]>-Copyright (c) 2007-2008 Vladimir Voroshilov-Copyright (c) 2007-2009 Peter Ross-Copyright (c) 2007-2009 Peter Ross <[email protected]>-Copyright (c) 2007-2009 Xiph.Org Foundation-Copyright (C) 2007-2010 Christophe Gisquet <[email protected]>-Copyright (c) 2007-2010 Stefano Sabatini-Copyright (c) 2007-2011 Peter Ross ([email protected])-Copyright (c) 2007-2013 Stefano Sabatini-Copyright (c) 2007-2016 David Robillard <http://drobilla.net>-Copyright (C) 2008 David Conrad-Copyright (c) 2008 Jaikrishnan Menon <[email protected]>-Copyright (C) 2008 Ramiro Polla-Copyright (C) 2008 Reimar Döffinger-Copyright (c) 2008 - 2009 Sascha Sommer-Copyright (c) 2008 - 2011 Sascha Sommer, Benjamin Larsson-Copyright (c) 2008 Adam Gashlin-Copyright (c) 2008 Affine Systems, Inc (Michael Sullivan, Bobby Impollonia)-Copyright (c) 2008 Alessandro Sappia-Copyright (c) 2008 Alexander Strange ([email protected])-Copyright (c) 2008 Alexander Strange <[email protected]>-Copyright (c) 2008 Aurelien Jacobs <[email protected]>-Copyright (c) 2008 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>-Copyright (c) 2008 Baptiste Coudurier <[email protected]>-Copyright (c) 2008 Baptiste Coudurier <[email protected]>-Copyright (c) 2008 Bartlomiej Wolowiec-Copyright (c) 2008 BBC, Anuradha Suraparaju <[email protected]>-Copyright (c) 2008 Benjamin Larsson-Copyright (C) 2008 David Conrad-Copyright (C) 2008 Eli Friedman (eli.friedman <at> gmail.com)-Copyright (C) 2008 Eli Friedman ([email protected])-Copyright (c) 2008 Gregory Montoir ([email protected])-Copyright (c) 2008 GUCAS, Zhentan Feng <spyfeng at gmail dot com>-Copyright (c) 2008 Ivo van Poorten-Copyright (C) 2008 Jaikrishnan Menon-Copyright (c) 2008 Jaikrishnan Menon <[email protected]>-Copyright (c) 2008 Justin Ruggles-Copyright (c) 2008 Konstantin Shishkov-Copyright (C) 2008 Konstantin Shishkov-Copyright (c) 2008 Laurent Aimar <[email protected]>-Copyright (c) 2008 Loren Merrit <[email protected]>-Copyright (c) 2008 Loren Merritt-Copyright (c) 2008 Loren Merritt <[email protected]>-Copyright (c) 2008 Luca Abeni-Copyright (c) 2008 Mans Rullgard <[email protected]>-Copyright (c) 2008 Michael Niedermayer-Copyright (C) 2008 Michael Niedermayer-Copyright (c) 2008 Michael Niedermayer <[email protected]>-Copyright (c) 2008 NVIDIA-Copyright (C) 2008 NVIDIA-Copyright (c) 2008 Peter Ross-Copyright (c) 2008 Ramiro Polla-Copyright (c) 2008 Ramiro Polla <[email protected]>-Copyright (c) 2008 Reimar Döffinger-Copyright (c) 2008 Rob Sykes-Copyright (c) 2008 Robert Marston-Copyright (c) 2008 Robert Swain-Copyright (c) 2008 [email protected]-Copyright (c) 2008 Ronald S. Bultje-Copyright (c) 2008 Sascha Sommer ([email protected])-Copyright (C) 2008 Sascha Sommer ([email protected])-Copyright (c) 2008 Siarhei Siamashka <[email protected]>-Copyright (c) 2008 Sisir Koppaka-Copyright (c) 2008 Victor Paesa-Copyright (c) 2008 Vitor Sessak-Copyright (c) 2008 Vladimir Voroshilov-Copyright (c) 2008 vmrsss-Copyright (c) 2008, 2013 Maxim Poliakovski-Copyright (c) 2008-2009 Andrej Stepanchuk-Copyright (c) 2008-2009 Gregory Maxwell-Copyright (C) 2008-2009 Konstantin Shishkov-Copyright (c) 2008-2009 Rob Sykes <[email protected]>-Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )-Copyright (C) 2008-2009 Splitted-Desktop Systems-Copyright (C) 2008-2010 Nokia Corporation-Copyright (c) 2008-2010 Paul Kendall <[email protected]>-Copyright (c) 2008-2010 Peter Ross ([email protected])-Copyright (c) 2008-2010 Stefano Sabatini-Copyright (C) 2008-2010 x264 project-Copyright (C) 2008-2012 Alexander E. Patrakov-Copyright (c) 2008-2013 Alex Converse <[email protected]>-Copyright (c) 2008-9 [email protected]-Copyright (c) 2009 Aurelien Jacobs <[email protected]>-Copyright (c) 2009 Nicolas Martin (martinic at iro dot umontreal dot ca)-Copyright (C) 2009 Sebastien Lucas <[email protected]>-Copyright (c) 2009 Stefan Gehrer <[email protected]>-Copyright (C) 2009 Zuxy Meng <[email protected]>-Copyright (c) 2009 - 2011 Maxim Poliakovski-Copyright (c) 2009 Alex Converse-Copyright (c) 2009 Alex Converse <alex dot converse at gmail dot com>-Copyright (c) 2009 Alex Converse <[email protected]>-Copyright (c) 2009 Andrej Stepanchuk-Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>-Copyright (c) 2009 Baptiste Coudurier <[email protected]>-Copyright (c) 2009 Bartlomiej Wolowiec-Copyright (C) 2009 Benjamin Dobell, Glass Echidna-Copyright (c) 2009 Benjamin Larsson-Copyright (c) 2009 Bjorn Axelsson-Copyright (c) 2009 Colin McQuillan-Copyright (c) 2009 Colin McQuillian-Copyright (c) 2009 Daniel Verkamp-Copyright (c) 2009 Daniel Verkamp ([email protected])-Copyright (c) 2009 Daniel Verkamp <daniel at drv.nu>-Copyright (c) 2009 Daniel Verkamp <[email protected]>-Copyright (c) 2009 David Conrad-Copyright (C) 2009 David Conrad-Copyright (c) 2009 David Conrad <[email protected]>-Copyright (C) 2009 Dylan Yudaken-Copyright (c) 2009 Fiona Glaser-Copyright (c) 2009 Giliard B. de Freitas <[email protected]>-Copyright (c) 2009 Jaikrishnan Menon <[email protected]>-Copyright (c) 2009 James Darnley-Copyright (c) 2009 Jimmy Christensen-Copyright (C) 2009 Joshua Warner-Copyright (c) 2009 Justin Ruggles-Copyright (C) 2009 Justin Ruggles-Copyright (c) 2009 Kenan Gillet-Copyright (c) 2009 Konstantin Shishkov-Copyright (C) 2009 Konstantin Shishkov-Copyright (c) 2009 Kostya Shishkov-Copyright (c) 2009 Loren Merritt-Copyright (c) 2009 Loren Merritt <[email protected]>-Copyright (C) 2009 Loren Merritt <[email protected]>-Copyright (c) 2009 Luca Abeni-Copyright (c) 2009 Mans Rullgard <[email protected]>-Copyright (c) 2009 Martin Storsjo-Copyright (c) 2009 Maxim Poliakovski-Copyright (c) 2009 Michael Niedermayer-Copyright (c) 2009 Michael Niedermayer <[email protected]>-Copyright (C) 2009 Michael Niedermayer <[email protected]>-Copyright (c) 2009 Michael Tison-Copyright (c) 2009 Naotoshi Nojiri-Copyright (c) 2009 Nathan Caldwell <saintdev (at) gmail.com>-Copyright (c) 2009 Peter Holik-Copyright (c) 2009 Peter Ross-Copyright (c) 2009 Peter Ross <[email protected]>-Copyright (c) 2009 Ramiro Polla-Copyright (c) 2009 Reimar Doeffinger <[email protected]>-Copyright (c) 2009 Reimar Döffinger <[email protected]>-Copyright (c) 2009 Reimar Döffinger, based on crcenc (c) 2002 Fabrice Bellard-Copyright (c) 2009 Rob Sykes <[email protected]>-Copyright (c) 2009 Robert Swain ( rob opendot cl )-Copyright (c) 2009 Ronald S. Bultje-Copyright (c) 2009 Samalyse-Copyright (c) 2009 Stefano Sabatini-Copyright (c) 2009 Stephen Backway-Copyright (c) 2009 Thilo Borgmann <thilo.borgmann _at_ mail.de>-Copyright (C) 2009 Thomas P. Higdon <[email protected]>-Copyright (c) 2009 Tobias Bindhammer-Copyright (c) 2009 Toshimitsu Kimura-Copyright (c) 2009 Vitor Sessak-Copyright (c) 2009 Xuggle Incorporated-Copyright (c) 2009, 2011 Sebastian Gesemann. All rights reserved.-Copyright (c) 2009, 2013 Christian Schmidt-Copyright (c) 2009-2010 Alex Converse <[email protected]>-Copyright (c) 2009-2010 Howard Chu-Copyright (c) 2009-2010 Maxim Poliakovski-Copyright (c) 2009-2011 Maxim Poliakovski-Copyright (c) 2009-2013 Maxim Poliakovski-Copyright (c) 2010 Alex Converse <[email protected]>-Copyright (c) 2010 Janne Grunau <[email protected]>-Copyright (c) 2010 Aurelien Jacobs <[email protected]>-Copyright (C) 2010 Eli Friedman-Copyright (c) 2010 Adrian Daerr and Nicolas George-Copyright (c) 2010 Alex Converse <[email protected]>-Copyright (c) 2010 Alexander Strange <[email protected]>-Copyright (C) 2010 Amanda, Y.N. Wu <[email protected]>-Copyright (c) 2010 Anatoly Nenashev-Copyright (c) 2010 Anssi Hannula-Copyright (c) 2010 Anssi Hannula <anssi.hannula at iki.fi>-Copyright (c) 2010 Anton Khirnov-Copyright (c) 2010 Baptiste Coudurier-Copyright (c) 2010 Bobby Bingham-Copyright (c) 2010 Brandon Mintern-Copyright (c) 2010 Carl Eugen Hoyos-Copyright (C) 2010 Daniel G. Taylor <[email protected]>-Copyright (c) 2010 Daniel Verkamp-Copyright (c) 2010 David Conrad-Copyright (C) 2010 David Conrad-Copyright (C) 2010 Eli Friedman <[email protected]>-Copyright (c) 2010 Fabrice Bellard-Copyright (c) 2010 Fiona Glaser-Copyright (C) 2010 Fiona Glaser-Copyright (c) 2010 Fiona Glaser <[email protected]>-Copyright (c) 2010 Francesco Lavra <[email protected]>-Copyright (C) 2010 Georg Martius <[email protected]>-Copyright (c) 2010 Google Inc.-Copyright (c) 2010 Google, Inc.-Copyright (c) 2010 Gordon Schmidt <gordon.schmidt <at> s2000.tu-chemnitz.de>-Copyright (c) 2010 Hans de Goede <[email protected]>-Copyright (c) 2010 Holger Lubitz-Copyright (c) 2010 Howard Chu-Copyright (c) 2010 Jacob Meuser-Copyright (c) 2010 Josh Allmann-Copyright (c) 2010 Loren Merritt-Copyright (c) 2010 Mans Rullgard-Copyright (C) 2010 Mans Rullgard-Copyright (c) 2010 Mans Rullgard <[email protected]>-Copyright (C) 2010 Mans Rullgard <[email protected]>-Copyright (c) 2010 Marcelo Galvao Povoa-Copyright (c) 2010 Mark Heath mjpeg0 @ silicontrip dot org-Copyright (c) 2010 Martin Storsjo-Copyright (c) 2010 Michael Chinen-Copyright (c) 2010 Michael Niedermayer-Copyright (c) 2010 Michele Orrù-Copyright (c) 2010 Mohamed Naufal Basheer-Copyright (C) 2010 Mohamed Naufal Basheer <[email protected]>-Copyright (c) 2010 Nicolas George-Copyright (c) 2010 Niel van der Westhuizen <[email protected]>-Copyright (c) 2010 Nolan Lum <[email protected]>-Copyright (c) 2010 Peter Ross-Copyright (c) 2010 Peter Ross ([email protected])-Copyright (c) 2010 Peter Ross <[email protected]>-Copyright (c) 2010 Rafael Carre-Copyright (c) 2010 Ramiro Polla-Copyright (c) 2010 Reimar Döffinger-Copyright (c) 2010 Reimar Döffinger <[email protected]>-Copyright (c) 2010 Rob Clark <[email protected]>-Copyright (c) 2010 Ronald S. Bultje-Copyright (C) 2010 Ronald S. Bultje-Copyright (c) 2010 Ronald S. Bultje <[email protected]>-Copyright (C) 2010 Rémi Denis-Courmont-Copyright (c) 2010 S.N. Hemanth Meenakshisundaram-Copyright (c) 2010 S.N. Hemanth Meenakshisundaram <[email protected]>-Copyright (c) 2010 Sebastian Vater <[email protected]>-Copyright (c) 2010 Stefano Sabatini-Copyright (c) 2010 Thilo Borgmann <thilo.borgmann _at_ mail.de>-Copyright (c) 2010 Tomas Härdin-Copyright (c) 2010 Vitor Sessak-Copyright (c) 2010 Zhentan Feng <spyfeng at gmail dot com>-Copyright (C) 2010, 2011, 2012, 2013-Copyright (C) 2010, Chris Moeller,-Copyright (c) 2010, Google, Inc.-Copyright (c) 2010-2011 Elvis Presley-Copyright (C) 2010-2011 Kevin Stone-Copyright (c) 2010-2011 Maxim Poliakovski-Copyright (c) 2010-2011 Peter Ross <[email protected]>-Copyright (C) 2010-2011 x264 project-Copyright (c) 2010-2013 Maxim Poliakovski-Copyright (c) 2011 Justin Ruggles-Copyright (c) 2011 - 2012 Mashiat Sarker Shakkhar-Copyright (c) 2011 Anatoliy Wasserman-Copyright (c) 2011 Anatoly Nenashev-Copyright (c) 2011 Andreas Öman-Copyright (c) 2011 Anton Khirnov-Copyright (c) 2011 Anton Khirnov <[email protected]>-Copyright (c) 2011 Baptiste Coudurier-Copyright (c) 2011 Carl Eugen Hoyos-Copyright (c) 2011 Clément Bœsch <u pkh me>-Copyright (c) 2011 Daniel Kang-Copyright (c) 2011 Derek Buitenhuis-Copyright (c) 2011 Jan Kokemüller-Copyright (c) 2011 Janne Grunau-Copyright (c) 2011 Janne Grunau <[email protected]>-Copyright (c) 2011 Jonathan Baldwin-Copyright (C) 2011 Jordi Ortiz-Copyright (c) 2011 Juan Carlos Rodriguez <[email protected]>-Copyright (c) 2011 Justin Ruggles-Copyright (c) 2011 Justin Ruggles <[email protected]>-Copyright (c) 2011 Kieran Kunhya <[email protected]>-Copyright (c) 2011 Konstantin Shishkov-Copyright (C) 2011 Konstantin Shishkov-Copyright (c) 2011 Loren Merritt <[email protected]>-Copyright (c) 2011 Luca Barbato <[email protected]>-Copyright (c) 2011 Mans Rullgard-Copyright (c) 2011 Mans Rullgard <[email protected]>-Copyright (c) 2011 Mark Himsley-Copyright (c) 2011 Martin Storsjo-Copyright (C) 2011 Martin Storsjo-Copyright (c) 2011 Mashiat Sarker Shakkhar-Copyright (c) 2011 Matthew Hoops <[email protected]>-Copyright (c) 2011 Max Horn-Copyright (c) 2011 Michael Bradshaw <mjbshaw gmail com>-Copyright (c) 2011 Michael Karcher-Copyright (c) 2011 Michael Niedermayer-Copyright (C) 2011 Michael Niedermayer ([email protected])-Copyright (c) 2011 Mina Nagy Zaki-Copyright (c) 2011 Miroslav Slugeň <[email protected]>-Copyright (c) 2011 MirriAd Ltd-Copyright (c) 2011 Nicolas George-Copyright (c) 2011 Nicolas George <[email protected]>-Copyright (c) 2011 Oskar Arvidsson-Copyright (c) 2011 Pascal Getreuer-Copyright (c) 2011 Paul B Mahol-Copyright (c) 2011 Peter Ross ([email protected])-Copyright (c) 2011 Peter Ross <[email protected]>-Copyright (C) 2011 Peter Ross <[email protected]>-Copyright (c) 2011 Reimar Döffinger-Copyright (c) 2011 Reinhard Tartler-Copyright (c) 2011 Roger Pau Monné <[email protected]>-Copyright (c) 2011 Ronald S. Bultje <[email protected]>-Copyright (c) 2011 Smartjog S.A.S, Clément Bœsch <[email protected]>-Copyright (c) 2011 Stefano Sabatini-Copyright (C) 2011 Stefano Sabatini-Copyright (c) 2011 Sven Hesse <[email protected]>-Copyright (c) 2011 Thomas Kuehnel-Copyright (c) 2011 Vitor Sessak-Copyright (c) 2011 Vladimir Voroshilov-Copyright (C) 2011 x264 project-Copyright (c) 2011 Zhentan Feng <spyfeng at gmail dot com>-Copyright (c) 2011, 2012 Hyllian/Jararaca <[email protected]>-Copyright (c) 2011, Luca Barbato-Copyright (c) 2011,2014 Michael Niedermayer-Copyright (C) 2011-2012 Michael Niedermayer ([email protected])-Copyright (c) 2011-2012 Paul B Mahol-Copyright (c) 2011-2012 Smartjog S.A.S, Clément Bœsch <[email protected]>-Copyright (c) 2011-2013 James Darnley <[email protected]>-Copyright (C) 2011-2013 Michael Niedermayer ([email protected])-Copyright (c) 2011-2014 Peter Ross <[email protected]>-Copyright (c) 2011-2017 KO Myung-Hun <[email protected]>-Copyright (c) 2012-Copyright (c) 2012 Clément Bœsch <u pkh me>-Copyright (c) 2012 Justin Ruggles-Copyright (c) 2012 Nicolas George <[email protected]>-Copyright (c) 2012 Philip Langdale <[email protected]>-Copyright (C) 2012 - 2013 Gildas Cocherel-Copyright (C) 2012 - 2013 Guillaume Martres-Copyright (C) 2012 - 2013 Mickael Raulet-Copyright (C) 2012 - 2013 Wassim Hamidouche-Copyright (C) 2012 - 2103 Guillaume Martres-Copyright (C) 2012 - 2103 Mickael Raulet-Copyright (c) 2012 Aleksi Nurmi-Copyright (c) 2012 Andrew D'Addesio-Copyright (c) 2012 Andrey Utkin-Copyright (c) 2012 Aneesh Dogra (lionaneesh) <[email protected]>-Copyright (c) 2012 Anton Khirnov-Copyright (c) 2012 Antti Seppälä-Copyright (c) 2012 AvxSynth Team-Copyright (C) 2012 British Broadcasting Corporation, All Rights Reserved-Copyright (c) 2012 Carl Eugen Hoyos-Copyright (C) 2012 Carl Eugen Hoyos-Copyright (c) 2012 Christophe Gisquet <[email protected]>-Copyright (C) 2012 Christophe Gisquet <[email protected]>-Copyright (c) 2012 Clément Bœsch-Copyright (C) 2012 Clément Bœsch-Copyright (c) 2012 Clément Bœsch <u pkh me>-Copyright (C) 2012 Clément Bœsch <u pkh me>-Copyright (C) 2012 Daniel Kang-Copyright (c) 2012 David Kment-Copyright (c) 2012 Derek Buitenhuis-Copyright (c) 2012 Fredrik Mellbin-Copyright (c) 2012 Georg Lippitsch <[email protected]>-Copyright (c) 2012 Google, Inc.-Copyright (c) 2012 Henrik Gramner-Copyright (c) 2012 James Almer-Copyright (C) 2012 James Almer-Copyright (c) 2012 Jan Ekström-Copyright (c) 2012 Jeremy Tran-Copyright (c) 2012 Justin Ruggles-Copyright (c) 2012 Justin Ruggles <[email protected]>-Copyright (c) 2012 Konstantin Shishkov-Copyright (C) 2012 Konstantin Shishkov-Copyright (c) 2012 Laurent Aimar-Copyright (c) 2012 Laurent de Soras-Copyright (c) 2012 Loren Merritt-Copyright (c) 2012 Luca Barbato-Copyright (c) 2012 Mans Rullgard-Copyright (c) 2012 Mans Rullgard <[email protected]>-Copyright (C) 2012 Mark Himsley-Copyright (c) 2012 Martin Storsjo-Copyright (C) 2012 Martin Storsjo-Copyright (C) 2012 Matthäus G. "Anteru" Chajdas (http://anteru.net)-Copyright (c) 2012 Michael Bradshaw <mjbshaw gmail com>-Copyright (c) 2012 Michael Niedermayer-Copyright (C) 2012 Michael Niedermayer ([email protected])-Copyright (c) 2012 Michael Niedermayer <[email protected]>-Copyright (C) 2012 Michael Niedermayer <[email protected]>-Copyright (c) 2012 Nathan Caldwell-Copyright (c) 2012 Nicolas George-Copyright (c) 2012 Paul B Mahol-Copyright (c) 2012 Pavel Koshevoy <pkoshevoy at gmail dot com>-Copyright (c) 2012 Peter Ross-Copyright (c) 2012 Petri Hintukainen <phintuka <at> users.sourceforge.net>-Copyright (c) 2012 Rob Sykes <[email protected]>-Copyright (C) 2012 Ronald S. Bultje-Copyright (c) 2012 Ronald S. Bultje <[email protected]>-Copyright (c) 2012 Rudolf Polzer-Copyright (c) 2012 Samuel Pitoiset-Copyright (c) 2012 Stefano Sabatini-Copyright (c) 2012 Steven Robertson-Copyright (c) 2012 Vitaliy E Sugrobov-Copyright (C) 2012 VLC authors and VideoLAN-Copyright (C) 2012, Collabora Ltd.-Copyright (c) 2012, Derek Buitenhuis-Copyright (c) 2012, Luca Barbato-Copyright (C) 2012, Rafaël Carré <funman@videolanorg>-Copyright (C) 2012-2013 Intel Corporation-Copyright (c) 2012-2013 Clément Bœsch-Copyright (c) 2012-2013 Clément Bœsch <u pkh me>-Copyright (c) 2012-2013 Derek Buitenhuis-Copyright (C) 2012-2013 Michael Niedermayer ([email protected])-Copyright (c) 2012-2013 Oka Motofumi (chikuzen.mo at gmail dot com)-Copyright (c) 2012-2013 Paul B Mahol-Copyright (C) 2012-2014 Intel Corporation-Copyright (c) 2012-2014 Christophe Gisquet <[email protected]>-Copyright (C) 2012-2014 Christophe Gisquet <[email protected]>-Copyright (c) 2012-2014 Clément Bœsch <u pkh me>-Copyright (c) 2012-2016 Paul B Mahol-Copyright (c) 2012-2018 Konstantin Shishkov-Copyright (c) 2013-Copyright (c) 2013 - 2014 Pierre-Edouard Lepere-Copyright (C) 2013 - 2014 Pierre-Edouard Lepere-Copyright (C) 2013 Anand Meher Kotra-Copyright (c) 2013 Andrey Utkin <andrey.krieger.utkin gmail com>-Copyright (c) 2013 Aneesh Dogra <[email protected]>-Copyright (c) 2013 Anssi Hannula-Copyright (c) 2013 Ash Hughes-Copyright (C) 2013 Calvin Walton <[email protected]>-Copyright (c) 2013 Christian Schmidt-Copyright (c) 2013 Clément Bœsch-Copyright (c) 2013 Clément Bœsch <u pkh me>-Copyright (C) 2013 Clément Bœsch <u pkh me>-Copyright (c) 2013 Daniel Kang-Copyright (c) 2013 Daniel Kang <[email protected]>-Copyright (c) 2013 Daniel Verkamp <[email protected]>-Copyright (c) 2013 Darryl Wallace <[email protected]>-Copyright (c) 2013 Diego Biurrun <[email protected]>-Copyright (c) 2013 Dirk Farin <[email protected]>-Copyright (c) 2013 Fredrik Mellbin-Copyright (c) 2013 Georg Martius <georg dot martius at web dot de>-Copyright (c) 2013 Guillaume Martres <[email protected]>-Copyright (c) 2013 James Almer-Copyright (C) 2013 James Almer-Copyright (C) 2013 James Almer <[email protected]>-Copyright (c) 2013 Janne Grunau <[email protected]>-Copyright (c) 2013 Jeff Moguillansky-Copyright (c) 2013 Justin Ruggles <[email protected]>-Copyright (c) 2013 Konstantin Shishkov-Copyright (c) 2013 Konstantin Shishkov <[email protected]>-Copyright (C) 2013 Lenny Wang-Copyright (c) 2013 Loren Merritt-Copyright (c) 2013 Luca Barbato-Copyright (c) 2013 Lukasz Marek-Copyright (c) 2013 Lukasz Marek <[email protected]>-Copyright (c) 2013 Martin Storsjo-Copyright (C) 2013 Martin Storsjo-Copyright (c) 2013 Marton Balint-Copyright (c) 2013 Matthew Heaney-Copyright (c) 2013 Maxim Poliakovski-Copyright (c) 2013 Michael Niedermayer-Copyright (c) 2013 Nicolas Bertrand <[email protected]>-Copyright (c) 2013 Nicolas George-Copyright (c) 2013 Oka Motofumi (chikuzen.mo at gmail dot com)-Copyright (c) 2013 Paul B Mahol-Copyright (c) 2013 Philip Langdale-Copyright (c) 2013 Pierre-Edouard LEPERE-Copyright (C) 2013 Reimar Döffinger <[email protected]>-Copyright (c) 2013 RISC OS Open Ltd-Copyright (c) 2013 RISC OS Open Ltd <[email protected]>-Copyright (c) 2013 Ronald S. Bultje <rsbultje gmail com>-Copyright (C) 2013 Ronald S. Bultje <rsbultje gmail com>-Copyright (c) 2013 Rudolf Polzer <[email protected]>-Copyright (c) 2013 Rémi Denis-Courmont-Copyright (c) 2013 Seppo Tomperi-Copyright (C) 2013 Seppo Tomperi-Copyright (c) 2013 Stefano Sabatini-Copyright (c) 2013 The FFmpeg Project-Copyright (c) 2013 Thilo Borgmann <thilo.borgmann _at_ mail.de>-Copyright (c) 2013 Tiancheng "Timothy" Gu-Copyright (C) 2013 Tiancheng "Timothy" Gu-Copyright (c) 2013 Vittorio Giovara-Copyright (C) 2013 Vittorio Giovara-Copyright (c) 2013 Vittorio Giovara <[email protected]>-Copyright (C) 2013 VTT-Copyright (C) 2013 Wassim Hamidouche-Copyright (C) 2013 Wei Gao <[email protected]>-Copyright (C) 2013 Xiaolei Yu <[email protected]>-Copyright (c) 2013, 2015 Jean Delvare <[email protected]>-Copyright (c) 2013, Derek Buitenhuis-Copyright (c) 2013, The WebRTC project authors. All rights reserved.-Copyright (c) 2013-2014 Clément Bœsch-Copyright (C) 2013-2014 Clément Bœsch <u pkh me>-Copyright (c) 2013-2014 Derek Buitenhuis-Copyright (c) 2013-2014 Luca Barbato, Deti Fliegl-Copyright (c) 2013-2014 Mozilla Corporation-Copyright (c) 2013-2014 Ramiro Polla-Copyright (c) 2013-2014 Ramiro Polla, Luca Barbato, Deti Fliegl-Copyright (C) 2013-2015 Andreas Fuchs, Wolfgang Hrauda-Copyright (C) 2013-2015 Andreas Fuchs, Wolfgang Hrauda,-Copyright (c) 2013-2015 Paul B Mahol-Copyright (c) 2013-2018 Andreas Unterweger-Copyright (c) 2014 Aman Gupta <[email protected]>-Copyright (c) 2014 - 2015 Seppo Tomperi <[email protected]>-Copyright (c) 2014 Alexandra Hájková-Copyright (c) 2014 Andreas Cadhalpun-Copyright (c) 2014 Andrew Kelley-Copyright (c) 2014 Andrey Utkin-Copyright (c) 2014 Arwa Arif <[email protected]>-Copyright (c) 2014 Barbara Lepage <[email protected]>-Copyright (c) 2014 Benoit Fouet-Copyright (c) 2014 Christophe Gisquet-Copyright (c) 2014 Clément Bœsch-Copyright (c) 2014 Clément Bœsch <u pkh me>-Copyright (C) 2014 Clément Bœsch <u pkh me>-Copyright (C) 2014 Daniel Oberhoff-Copyright (c) 2014 Dave Rice @dericed-Copyright (c) 2014 Derek Buitenhuis-Copyright (c) 2014 Deti Fliegl-Copyright (c) 2014 Eejya Singh-Copyright (c) 2014 Georg Lippitsch <[email protected]>-Copyright (c) 2014 James Almer-Copyright (C) 2014 James Almer-Copyright (c) 2014 James Almer <jamrial <at> gmail.com>-Copyright (c) 2014 James Almer <[email protected]>-Copyright (c) 2014 James Darnley <[email protected]>-Copyright (c) 2014 James Yu <[email protected]>-Copyright (c) 2014 Janne Grunau <[email protected]>-Copyright (c) 2014 Kieran Kunhya <[email protected]>-Copyright (C) 2014 Kieran Kunhya <[email protected]>-Copyright (c) 2014 Konstantin Shishkov-Copyright (C) 2014 Loren Merritt-Copyright (c) 2014 Luca Barbato <[email protected]>-Copyright (C) 2014 Luca Barbato <[email protected]>-Copyright (c) 2014 Lukasz Marek-Copyright (c) 2014 Lukasz Marek <[email protected]>-Copyright (c) 2014 Martin Storsjo-Copyright (C) 2014 Martin Storsjo-Copyright (c) 2014 Marvin Scholz-Copyright (c) 2014 Michael Niedermayer-Copyright (c) 2014 Michael Niedermayer <[email protected]>-Copyright (c) 2014 Neil Birkbeck ([email protected])-Copyright (c) 2014 Nicholas Robbins-Copyright (c) 2014 Nicolas Bertrand-Copyright (c) 2014 Nicolas George-Copyright (c) 2014 Oleksij Rempel <[email protected]>-Copyright (C) 2014 Oleksij Rempel <[email protected]>-Copyright (C) 2014 Pascal Massimino ([email protected])-Copyright (c) 2014 Paul B Mahol-Copyright (c) 2014 Peter Meerwald <[email protected]>-Copyright (c) 2014 Peter Ross-Copyright (C) 2014 Peter Ross-Copyright (c) 2014 Peter Ross <[email protected]>-Copyright (c) 2014 Petri Hintukainen <[email protected]>-Copyright (c) 2014 Pierre-Edouard LEPERE-Copyright (c) 2014 Rafaël Carré-Copyright (C) 2014 Red Hat, Inc.-Copyright (c) 2014 Reimar Döffinger <[email protected]>-Copyright (c) 2014 RISC OS Open Ltd-Copyright (c) 2014 Ronald S. Bultje <[email protected]>-Copyright (C) 2014 Ronald S. Bultje <[email protected]>-Copyright (c) 2014 Rong Yan-Copyright (c) 2014 Seppo Tomperi <[email protected]>-Copyright (c) 2014 StarBrilliant <[email protected]>-Copyright (c) 2014 Stefano Sabatini-Copyright (c) 2014 Supraja Meedinti-Copyright (c) 2014 Thilo Borgmann <[email protected]>-Copyright (c) 2014 Thomas Volkert <[email protected]>-Copyright (c) 2014 Tiancheng "Timothy" Gu-Copyright (c) 2014 Tiancheng "Timothy" Gu <[email protected]>-Copyright (c) 2014 Tim Walker <[email protected]>-Copyright (c) 2014 Vignesh Venkatasubramanian-Copyright (c) 2014 Vittorio Giovara <[email protected]>-Copyright (C) 2014 Vittorio Giovara <[email protected]>-Copyright (c) 2014-2015 Michael Niedermayer <[email protected]>-Copyright (c) 2014-2015 Muhammad Faiz <[email protected]>-Copyright (C) 2014-2015, Collabora Ltd.-Copyright (c) 2014-2016 James Almer-Copyright (C) 2014-2016 James Almer-Copyright (c) 2015 Clément Bœsch <u pkh me>-Copyright (c) 2015 Ganesh Ajjanagadde-Copyright (c) 2015 - 2017 Manojkumar Bhosale ([email protected])-Copyright (c) 2015 - 2017 Parag Salasakar ([email protected])-Copyright (c) 2015 - 2017 Shivraj Patil ([email protected])-Copyright (c) 2015 -2017 Manojkumar Bhosale ([email protected])-Copyright (c) 2015 -2017 Parag Salasakar ([email protected])-Copyright (c) 2015 Andreas Cadhalpun <[email protected]>-Copyright (c) 2015 Anshul Maheshwari-Copyright (c) 2015 Anton Khirnov-Copyright (c) 2015 Arwa Arif <[email protected]>-Copyright (c) 2015 Carl Eugen Hoyos-Copyright (c) 2015 Christophe Gisquet-Copyright (C) 2015 Claudio Freire-Copyright (c) 2015 Clément Bœsch <clement stupeflix.com>-Copyright (c) 2015 Derek Buitenhuis-Copyright (c) 2015 Donny Yang-Copyright (c) 2015 Eran Kornblau <erankor at gmail dot com>-Copyright (c) 2015 Gilles Chanteperdrix <[email protected]>-Copyright (c) 2015 Hendrik Leppkes-Copyright (c) 2015 Henrik Gramner-Copyright (c) 2015 Henrik Gramner <henrik gramner com>-Copyright (c) 2015 Himangi Saraogi <[email protected]>-Copyright (c) 2015 Imagination Technologies Ltd-Copyright (c) 2015 James Almer-Copyright (C) 2015 James Almer-Copyright (c) 2015 James Darnley-Copyright (C) 2015 James Darnley-Copyright (c) 2015 Janne Grunau-Copyright (c) 2015 Janne Grunau <[email protected]>-Copyright (c) 2015 Janne Grunau <[email protected]>b-Copyright (c) 2015 Janne Grunau <[email protected]>-Copyright (c) 2015 Kevin Wheatley <[email protected]>-Copyright (c) 2015 Kieran Kunhya-Copyright (c) 2015 Kyle Swanson <[email protected]>.-Copyright (c) 2015 Loongson Technology Corporation Limited-Copyright (c) 2015 LoRd_MuldeR <[email protected]>. Some rights reserved.-Copyright (c) 2015 Luca Barbato-Copyright (c) 2015 Luca Barbato <[email protected]>-Copyright (c) 2015 Ludmila Glinskih-Copyright (c) 2015 Manojkumar Bhosale ([email protected])-Copyright (c) 2015 Martin Storsjo-Copyright (c) 2015 Mats Peterson-Copyright (c) 2015 Matthieu Bouron <matthieu.bouron stupeflix.com>-Copyright (c) 2015 Michael Niedermayer <[email protected]>-Copyright (C) 2015 Michael Niedermayer <[email protected]>-Copyright (c) 2015 Muhammad Faiz <[email protected]>-Copyright (c) 2015 Nicolas George-Copyright (c) 2015 Niklas Haas-Copyright (C) 2015 Open Broadcast Systems Ltd.-Copyright (c) 2015 Parag Salasakar ([email protected])-Copyright (c) 2015 Parag Salasakar ([email protected])-Copyright (C) 2015 Paul B Mahol-Copyright (c) 2015 Paul B Mahol-Copyright (c) 2015 Paul B. Mahol-Copyright (C) 2015 Pedro Arthur <[email protected]>-Copyright (c) 2015 Peter Meerwald <[email protected]>-Copyright (c) 2015 Rodger Combs-Copyright (c) 2015 Roger Pack-Copyright (c) 2015 Ronald S. Bultje <rsbultje gmail com>-Copyright (C) 2015 Ronald S. Bultje <rsbultje gmail com>-Copyright (c) 2015 Ronald S. Bultje <[email protected]>-Copyright (C) 2015 Ronald S. Bultje <[email protected]>-Copyright (C) 2015 Rostislav Pehlivanov-Copyright (c) 2015 Rostislav Pehlivanov ( atomnuker gmail com )-Copyright (C) 2015 Rostislav Pehlivanov <atomnuker gmail com>-Copyright (c) 2015 Shivraj Patil ([email protected])-Copyright (c) 2015 Stephan Holljes-Copyright (c) 2015 Stupeflix-Copyright (c) 2015 Supraja Meedinti-Copyright (c) 2015 Tampere University of Technology-Copyright (c) 2015 The FFmpeg Project-Copyright (c) 2015 Thomas Volkert <[email protected]>-Copyright (c) 2015 Tiancheng "Timothy" Gu-Copyright (c) 2015 Timo Rothenpieler <[email protected]>-Copyright (C) 2015 Timo Rothenpieler <[email protected]>-Copyright (C) 2015 Tom Butterworth <[email protected]>-Copyright (c) 2015 Urvang Joshi-Copyright (c) 2015 Vesselin Bontchev-Copyright (c) 2015 Vittorio Giovara-Copyright (C) 2015 Vittorio Giovara <vittorio.giovara gmail com>-Copyright (c) 2015 Vittorio Giovara <[email protected]>-Copyright (C) 2015 Vittorio Giovara <[email protected]>-Copyright (c) 2015 Zhang Rui <[email protected]>-Copyright (c) 2015 Zhou Xiaoyong <[email protected]>-Copyright (C) 2015, Edward Hervey-Copyright (C) 2015, Matthew Waters <[email protected]>-Copyright (C) 2015, Sebastian Dröge <[email protected]>-Copyright (c) 2015, Vignesh Venkatasubramanian-Copyright (c) 2015-2016 Clément Bœsch <u pkh me>-Copyright (c) 2015-2016 Kieran Kunhya <[email protected]>-Copyright (c) 2015-2016 Matthieu Bouron <matthieu.bouron stupeflix.com>-Copyright (c) 2015-2016 mawen1250-Copyright (c) 2016 Alexandra Hájková-Copyright (c) 2016 Anton Khirnov-Copyright (c) 2016 Clément Bœsch <clement stupeflix.com>-Copyright (c) 2016 Clément Bœsch <u pkh me>-Copyright (c) 2016 Davinder Singh (DSM_) <ds.mudhar<@gmail.com>-Copyright (c) 2016 Floris Sluiter-Copyright (C) 2016 foo86-Copyright (c) 2016 Google Inc.-Copyright (c) 2016 James Almer-Copyright (C) 2016 James Almer-Copyright (c) 2016 Jan Sebechlebsky-Copyright (c) 2016 Jokyo Images-Copyright (c) 2016 Josh de Kock-Copyright (c) 2016 KongQun Yang ([email protected])-Copyright (c) 2016 Kyle Swanson <[email protected]>.-Copyright (c) 2016 Loongson Technology Corporation Limited-Copyright (c) 2016 Martin Storsjo-Copyright (C) 2016 Martin Storsjo-Copyright (c) 2016 Marton Balnt <[email protected]>-Copyright (c) 2016 Matthieu Bouron <matthieu.bouron stupeflix.com>-Copyright (c) 2016 Michael Niedermayer-Copyright (c) 2016 Michael Niedermayer <[email protected]>-Copyright (c) 2016 Mobibase, France (http://www.mobibase.com)-Copyright (c) 2016 Muhammad Faiz <[email protected]>-Copyright (C) 2016 Muhammad Faiz <[email protected]>-Copyright (c) 2016 Neil Birkbeck <[email protected]>-Copyright (c) 2016 Nicolas George-Copyright (C) 2016 Open Broadcast Systems Ltd.-Copyright (c) 2016 Paul B Mahol-Copyright (C) 2016 Paul B Mahol-Copyright (c) 2016 Reimar Döffinger <[email protected]>-Copyright (c) 2016 Ronald S. Bultje <[email protected]>-Copyright (C) 2016 Ronald S. Bultje <[email protected]>-Copyright (c) 2016 Rostislav Pehlivanov <[email protected]>-Copyright (C) 2016 Rostislav Pehlivanov <[email protected]>-Copyright (c) 2016 Savoir-faire Linux, Inc-Copyright (c) 2016 Ståle Kristoffersen-Copyright (c) 2016 The FFmpeg Project-Copyright (c) 2016 Thilo Borgmann-Copyright (C) 2016 Thomas Mundt <[email protected]>-Copyright (c) 2016 Thomas Volkert <[email protected]>-Copyright (c) 2016 Tiancheng "Timothy" Gu-Copyright (c) 2016 Timo Rothenpieler-Copyright (c) 2016 Timo Rothenpieler <[email protected]>-Copyright (c) 2016 Tobias Rapp-Copyright (c) 2016 Umair Khan <[email protected]>-Copyright (c) 2016 Vittorio Giovara <[email protected]>-Copyright (c) 2016 William Ma, Sofia Kim, Dustin Woo-Copyright (c) 2016 William Ma, Ted Ying, Jerry Jiang-Copyright (c) 2016 Zhou Xiaoyong <[email protected]>-Copyright (C) 2017 Aurelien Jacobs <[email protected]>-Copyright (c) 2017 Clément Bœsch <[email protected]>-Copyright (c) 2017 Akamai Technologies, Inc.-Copyright (c) 2017 Alexandra Hájková-Copyright (C) 2017 Alexis Ballier <[email protected]>-Copyright (c) 2017 Anton Khirnov-Copyright (c) 2017 Ashish Pratap Singh <[email protected]>-Copyright (c) 2017 Clément Bœsch <u pkh me>-Copyright (C) 2017 Daniil Cherednik-Copyright (C) 2017 Felix Matouschek-Copyright (C) 2017 foo86-Copyright (c) 2017 Gerion Entrup-Copyright (c) 2017 Google Inc.-Copyright (C) 2017 Ivan Kalvachev <[email protected]>-Copyright (c) 2017 James Almer-Copyright (c) 2017 Jokyo Images-Copyright (C) 2017 Jorge Ramirez <[email protected]>-Copyright (c) 2017 Jun Zhao-Copyright (c) 2017 Kaixuan Liu-Copyright (c) 2017 Kaustubh Raste ([email protected])-Copyright (c) 2017 Konstantin Shishkov-Copyright (c) 2017 Lionel CHAZALLON-Copyright (c) 2017 Maksym Veremeyenko-Copyright (c) 2017 Matthieu Bouron <matthieu.bouron gmail.com>-Copyright (c) 2017 Matthieu Bouron <[email protected]>-Copyright (c) 2017 Meng Wang <[email protected]>-Copyright (c) 2017 Paras Chadha-Copyright (c) 2017 Paul B Mahol-Copyright (C) 2017 Paul B Mahol-Copyright (c) 2017 Philip Langdale-Copyright (c) 2017 Richard Ling-Copyright (c) 2017 Ronald S. Bultje <[email protected]>-Copyright (c) 2017 Rostislav Pehlivanov <[email protected]>-Copyright (C) 2017 Rostislav Pehlivanov <[email protected]>-Copyright (c) 2017 [email protected] based on HLS demux-Copyright (c) 2017 Savoir-faire Linux, Inc-Copyright (c) 2017 sfan5 <[email protected]>-Copyright (c) 2017 Steven Liu-Copyright (c) 2017 Thomas Mundt <[email protected]>-Copyright (c) 2017 Tomas Härdin-Copyright (c) 2017 Vittorio Giovara <[email protected]>-Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.-Copyright (c) 2018 Huiwen Ren <[email protected]>-Copyright (c) 2018 Akamai Technologies, Inc.-Copyright (c) 2018 Clément Bœsch <u pkh me>-Copyright (c) 2018 Danil Iashchenko-Copyright (c) 2018 Dylan Fernando-Copyright (C) 2018 Henrik Gramner-Copyright (C) 2018 Huiwen Ren, <[email protected]>-Copyright (c) 2018 James Almer <[email protected]>-Copyright (C) 2018 James Almer <[email protected]>-Copyright (C) 2018 Jokyo Images-Copyright (c) 2018 Loongson Technology Corporation Limited-Copyright (c) 2018 Marton Balint-Copyright (C) 2018 Marton Balint-Copyright (c) 2018 Mina Sami-Copyright (C) 2018 Misty De Meo-Copyright (c) 2018 Paul B Mahol-Copyright (C) 2018 Paul B Mahol-Copyright (C) 2018 Philip Langdale <[email protected]>-Copyright (c) 2018 Rostislav Pehlivanov <[email protected]>-Copyright (c) 2018 Sergey Lavrushkin-Copyright (c) 2018 Shiyou Yin <[email protected]>-Copyright (C) 2018 Stephen Seo-Copyright (c) 2018 The FFmpeg Project-Copyright (c) 2018 Thomas Volkert-Copyright (c) 2018 Yingming Fan <[email protected]>-Copyright (C) 2018 Yiqun Xu, <[email protected]>-Copyright (C) 2018 Yiqun Xu, <[email protected]>-Copyright (c) Alexandra Hajkova-Copyright (c) CMU 1993 Computer Science, Speech Group-Copyright (c) Luca Barbato-Copyright (c) Markus Schmidt and Christian Holschuh-Copyright (c) Mohamed Naufal <[email protected]>-Copyright (c) S.N. Hemanth Meenakshisundaram | smeenaks at ucsd.edu-Copyright (c) Stefano Sabatini 2010-Copyright (c) Stefano Sabatini 2011-Copyright (c) Stefano Sabatini | stefasab at gmail.com-Copyright (C) Wilbert Dijkhof-Copyright 2003 Kevin Atkinson-Copyright 2004-2006 Lennart Poettering-Copyright 2005 Balatoni Denes-Copyright 2005 Wim Taymans-Copyright 2006 Loren Merritt-Copyright 2007 Bobby Bingham-Copyright 2007 Collabora Ltd, Philippe Kalaf-Copyright 2007 Edward Hervey-Copyright 2007 Nokia Corporation-Copyright 2010 Mark Nauwelaerts-Copyright 2010 S.N. Hemanth Meenakshisundaram <smeenaks ucsd edu>-Copyright 2010 Stefano Sabatini <stefano.sabatini-lala poste it>-Copyright 2011 Stefano Sabatini <stefano.sabatini-lala poste it>-Copyright 2011-2014 Twitter, Inc.-Copyright 2012 Anton Khirnov <anton khirnov net>-Copyright 2012 Nicolas George <nicolas.george normalesup org>-Copyright 2012 Robert Nagy <ronag89 gmail com>-Copyright 2012 Stefano Sabatini <stefasab gmail com>-Copyright 2016 Anton Khirnov-Copyright 2016 James Almer-Copyright 2017 Carl Eugen Hoyos-Copyright 2017 Steinar H. Gunderson-Copyright 2018 Calvin Walton <[email protected]>-Copyright 2018 Jokyo Images-Copyright Ivo van Poorten-Copyright Joseph Artsimovich and UAB "DKD"-Copyright Konstantin Shishkov-Copyright Michael ([email protected])-Copyright Nick Kurshev-Copyright Stefano Sabatini <stefasab gmail com>-Copyright Vitor Sessak <vitor1001 gmail com>-Copyright © 2012 Rafaël Carré-Copyright(C) 2000 Michel Lespinasse <[email protected]>-Copyright(C) 2000-2001 Peter Gubanov <[email protected]>-Copyright(C) 2001 Peter Ross <[email protected]>-Copyright(C) 2003 Pascal Massimino <[email protected]>-Copyright(C) 2010,2011 Philip Langdale <[email protected]>--The ffmpeg Library is licensed under the GNU Lesser General Public Library, version 3. A copy of the license is provided below.-- GNU LESSER GENERAL PUBLIC LICENSE- Version 3, 29 June 2007-- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>- Everyone is permitted to copy and distribute verbatim copies- of this license document, but changing it is not allowed.--- This version of the GNU Lesser General Public License incorporates-the terms and conditions of version 3 of the GNU General Public-License, supplemented by the additional permissions listed below.-- 0. Additional Definitions.-- As used herein, "this License" refers to version 3 of the GNU Lesser-General Public License, and the "GNU GPL" refers to version 3 of the GNU-General Public License.-- "The Library" refers to a covered work governed by this License,-other than an Application or a Combined Work as defined below.-- An "Application" is any work that makes use of an interface provided-by the Library, but which is not otherwise based on the Library.-Defining a subclass of a class defined by the Library is deemed a mode-of using an interface provided by the Library.-- A "Combined Work" is a work produced by combining or linking an-Application with the Library. The particular version of the Library-with which the Combined Work was made is also called the "Linked-Version".-- The "Minimal Corresponding Source" for a Combined Work means the-Corresponding Source for the Combined Work, excluding any source code-for portions of the Combined Work that, considered in isolation, are-based on the Application, and not on the Linked Version.-- The "Corresponding Application Code" for a Combined Work means the-object code and/or source code for the Application, including any data-and utility programs needed for reproducing the Combined Work from the-Application, but excluding the System Libraries of the Combined Work.-- 1. Exception to Section 3 of the GNU GPL.-- You may convey a covered work under sections 3 and 4 of this License-without being bound by section 3 of the GNU GPL.-- 2. Conveying Modified Versions.-- If you modify a copy of the Library, and, in your modifications, a-facility refers to a function or data to be supplied by an Application-that uses the facility (other than as an argument passed when the-facility is invoked), then you may convey a copy of the modified-version:-- a) under this License, provided that you make a good faith effort to- ensure that, in the event an Application does not supply the- function or data, the facility still operates, and performs- whatever part of its purpose remains meaningful, or-- b) under the GNU GPL, with none of the additional permissions of- this License applicable to that copy.-- 3. Object Code Incorporating Material from Library Header Files.-- The object code form of an Application may incorporate material from-a header file that is part of the Library. You may convey such object-code under terms of your choice, provided that, if the incorporated-material is not limited to numerical parameters, data structure-layouts and accessors, or small macros, inline functions and templates-(ten or fewer lines in length), you do both of the following:-- a) Give prominent notice with each copy of the object code that the- Library is used in it and that the Library and its use are- covered by this License.-- b) Accompany the object code with a copy of the GNU GPL and this license- document.-- 4. Combined Works.-- You may convey a Combined Work under terms of your choice that,-taken together, effectively do not restrict modification of the-portions of the Library contained in the Combined Work and reverse-engineering for debugging such modifications, if you also do each of-the following:-- a) Give prominent notice with each copy of the Combined Work that- the Library is used in it and that the Library and its use are- covered by this License.-- b) Accompany the Combined Work with a copy of the GNU GPL and this license- document.-- c) For a Combined Work that displays copyright notices during- execution, include the copyright notice for the Library among- these notices, as well as a reference directing the user to the- copies of the GNU GPL and this license document.-- d) Do one of the following:-- 0) Convey the Minimal Corresponding Source under the terms of this- License, and the Corresponding Application Code in a form- suitable for, and under terms that permit, the user to- recombine or relink the Application with a modified version of- the Linked Version to produce a modified Combined Work, in the- manner specified by section 6 of the GNU GPL for conveying- Corresponding Source.-- 1) Use a suitable shared library mechanism for linking with the- Library. A suitable mechanism is one that (a) uses at run time- a copy of the Library already present on the user's computer- system, and (b) will operate properly with a modified version- of the Library that is interface-compatible with the Linked- Version.-- e) Provide Installation Information, but only if you would otherwise- be required to provide such information under section 6 of the- GNU GPL, and only to the extent that such information is- necessary to install and execute a modified version of the- Combined Work produced by recombining or relinking the- Application with a modified version of the Linked Version. (If- you use option 4d0, the Installation Information must accompany- the Minimal Corresponding Source and Corresponding Application- Code. If you use option 4d1, you must provide the Installation- Information in the manner specified by section 6 of the GNU GPL- for conveying Corresponding Source.)-- 5. Combined Libraries.-- You may place library facilities that are a work based on the-Library side by side in a single library together with other library-facilities that are not Applications and are not covered by this-License, and convey such a combined library under terms of your-choice, if you do both of the following:-- a) Accompany the combined library with a copy of the same work based- on the Library, uncombined with any other library facilities,- conveyed under the terms of this License.-- b) Give prominent notice with the combined library that part of it- is a work based on the Library, and explaining where to find the- accompanying uncombined form of the same work.-- 6. Revised Versions of the GNU Lesser General Public License.-- The Free Software Foundation may publish revised and/or new versions-of the GNU Lesser General Public License from time to time. Such new-versions will be similar in spirit to the present version, but may-differ in detail to address new problems or concerns.-- Each version is given a distinguishing version number. If the-Library as you received it specifies that a certain numbered version-of the GNU Lesser General Public License "or any later version"-applies to it, you have the option of following the terms and-conditions either of that published version or of any later version-published by the Free Software Foundation. If the Library as you-received it does not specify a version number of the GNU Lesser-General Public License, you may choose any version of the GNU Lesser-General Public License ever published by the Free Software Foundation.-- If the Library as you received it specifies that a proxy can decide-whether future versions of the GNU Lesser General Public License shall-apply, that proxy's public statement of acceptance of any version is-permanent authorization for you to choose that version for the-Library.---====-SDL2-====--This software is provided 'as-is', without any express or implied-warranty. In no event will the authors be held liable for any damages-arising from the use of this software.--Permission is granted to anyone to use this software for any purpose,-including commercial applications, and to alter it and redistribute it-freely, subject to the following restrictions:--1. The origin of this software must not be misrepresented; you must not- claim that you wrote the original software. If you use this software- in a product, an acknowledgment in the product documentation would be- appreciated but is not required.-2. Altered source versions must be plainly marked as such, and must not be- misrepresented as being the original software.-3. This notice may not be removed or altered from any source distribution.---======-bullet-======--Bullet Continuous Collision Detection and Physics Library-http://bulletphysics.org--This software is provided 'as-is', without any express or implied warranty.-In no event will the authors be held liable for any damages arising from the use of this software.-Permission is granted to anyone to use this software for any purpose,-including commercial applications, and to alter it and redistribute it freely,-subject to the following restrictions:--1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.-3. This notice may not be removed or altered from any source distribution.---=====-MyGUI-=====--Copyright (c) 2007-2013 MyGUI Developers--Permission is hereby granted, free of charge, to any person obtaining a copy of-this software and associated documentation files (the "Software"), to deal in-the Software without restriction, including without limitation the rights to-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies-of the Software, and to permit persons to whom the Software is furnished to do-so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in all-copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE-SOFTWARE.---=====-gl4es-=====--Copyright (c) 2016-2018 Sebastien Chevalier-Copyright (c) 2013-2016 Ryan Hileman--Permission is hereby granted, free of charge, to any person obtaining a copy-of this software and associated documentation files (the "Software"), to deal-in the Software without restriction, including without limitation the rights-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell-copies of the Software, and to permit persons to whom the Software is-furnished to do so, subject to the following conditions:--The above copyright notice and this permission notice shall be included in-all copies or substantial portions of the Software.--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN-THE SOFTWARE.---==============-OpenSceneGraph-==============-- OpenSceneGraph Public License, Version 1.0- ==========================================-- Copyright (C) 2018 Robert Osfield.-- Everyone is permitted to copy and distribute verbatim copies- of this licence document, but changing it is not allowed.-- OPENSCENEGRAPH PUBLIC LICENCE- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION-- This library is free software; you can redistribute it and/or modify it- under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0- or later.-- Notes: the OSGPL is based on the LGPL-2.1-only WITH WxWindows-exception-3.1,- with the 4 exceptions laid out in the wxWindows section below. The LGPL is- contained in the final section of this license.------------------------------------------------------------------------------------- wxWindows Library Licence, Version 3.1- ======================================-- Copyright (c) 1998-2005 Julian Smart, Robert Roebling et al-- Everyone is permitted to copy and distribute verbatim copies- of this licence document, but changing it is not allowed.-- WXWINDOWS LIBRARY LICENCE- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION-- This library is free software; you can redistribute it and/or modify it- under the terms of the GNU Library General Public Licence as published by- the Free Software Foundation; either version 2 of the Licence, or (at- your option) any later version.-- This library is distributed in the hope that it will be useful, but- WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library- General Public Licence for more details.-- You should have received a copy of the GNU Library General Public Licence- along with this software, usually in a file named COPYING.LIB. If not,- write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,- Boston, MA 02110-1301 USA.-- EXCEPTION NOTICE-- 1. As a special exception, the copyright holders of this library give- permission for additional uses of the text contained in this release of- the library as licenced under the wxWindows Library Licence, applying- either version 3.1 of the Licence, or (at your option) any later version of- the Licence as published by the copyright holders of version- 3.1 of the Licence document.-- 2. The exception is that you may use, copy, link, modify and distribute- under your own terms, binary object code versions of works based- on the Library.-- 3. If you copy code from files distributed under the terms of the GNU- General Public Licence or the GNU Library General Public Licence into a- copy of this library, as this licence permits, the exception does not- apply to the code that you add in this way. To avoid misleading anyone as- to the status of such modified files, you must delete this exception- notice from such code and/or adjust the licensing conditions notice- accordingly.-- 4. If you write modifications of your own for this library, it is your- choice whether to permit this exception to apply to your modifications.- If you do not wish that, you must delete the exception notice from such- code and/or adjust the licensing conditions notice accordingly.------------------------------------------------------------------------------------ GNU LESSER GENERAL PUBLIC LICENSE- Version 2.1, February 1999-- Copyright (C) 1991, 1999 Free Software Foundation, Inc.- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA- Everyone is permitted to copy and distribute verbatim copies- of this license document, but changing it is not allowed.--[This is the first released version of the Lesser GPL. It also counts- as the successor of the GNU Library Public License, version 2, hence- the version number 2.1.]-- Preamble-- The licenses for most software are designed to take away your-freedom to share and change it. By contrast, the GNU General Public-Licenses are intended to guarantee your freedom to share and change-free software--to make sure the software is free for all its users.-- This license, the Lesser General Public License, applies to some-specially designated software packages--typically libraries--of the-Free Software Foundation and other authors who decide to use it. You-can use it too, but we suggest you first think carefully about whether-this license or the ordinary General Public License is the better-strategy to use in any particular case, based on the explanations below.-- When we speak of free software, we are referring to freedom of use,-not price. Our General Public Licenses are designed to make sure that-you have the freedom to distribute copies of free software (and charge-for this service if you wish); that you receive source code or can get-it if you want it; that you can change the software and use pieces of-it in new free programs; and that you are informed that you can do-these things.-- To protect your rights, we need to make restrictions that forbid-distributors to deny you these rights or to ask you to surrender these-rights. These restrictions translate to certain responsibilities for-you if you distribute copies of the library or if you modify it.-- For example, if you distribute copies of the library, whether gratis-or for a fee, you must give the recipients all the rights that we gave-you. You must make sure that they, too, receive or can get the source-code. If you link other code with the library, you must provide-complete object files to the recipients, so that they can relink them-with the library after making changes to the library and recompiling-it. And you must show them these terms so they know their rights.-- We protect your rights with a two-step method: (1) we copyright the-library, and (2) we offer you this license, which gives you legal-permission to copy, distribute and/or modify the library.-- To protect each distributor, we want to make it very clear that-there is no warranty for the free library. Also, if the library is-modified by someone else and passed on, the recipients should know-that what they have is not the original version, so that the original-author's reputation will not be affected by problems that might be-introduced by others.-- Finally, software patents pose a constant threat to the existence of-any free program. We wish to make sure that a company cannot-effectively restrict the users of a free program by obtaining a-restrictive license from a patent holder. Therefore, we insist that-any patent license obtained for a version of the library must be-consistent with the full freedom of use specified in this license.-- Most GNU software, including some libraries, is covered by the-ordinary GNU General Public License. This license, the GNU Lesser-General Public License, applies to certain designated libraries, and-is quite different from the ordinary General Public License. We use-this license for certain libraries in order to permit linking those-libraries into non-free programs.-- When a program is linked with a library, whether statically or using-a shared library, the combination of the two is legally speaking a-combined work, a derivative of the original library. The ordinary-General Public License therefore permits such linking only if the-entire combination fits its criteria of freedom. The Lesser General-Public License permits more lax criteria for linking other code with-the library.-- We call this license the "Lesser" General Public License because it-does Less to protect the user's freedom than the ordinary General-Public License. It also provides other free software developers Less-of an advantage over competing non-free programs. These disadvantages-are the reason we use the ordinary General Public License for many-libraries. However, the Lesser license provides advantages in certain-special circumstances.-- For example, on rare occasions, there may be a special need to-encourage the widest possible use of a certain library, so that it becomes-a de-facto standard. To achieve this, non-free programs must be-allowed to use the library. A more frequent case is that a free-library does the same job as widely used non-free libraries. In this-case, there is little to gain by limiting the free library to free-software only, so we use the Lesser General Public License.-- In other cases, permission to use a particular library in non-free-programs enables a greater number of people to use a large body of-free software. For example, permission to use the GNU C Library in-non-free programs enables many more people to use the whole GNU-operating system, as well as its variant, the GNU/Linux operating-system.-- Although the Lesser General Public License is Less protective of the-users' freedom, it does ensure that the user of a program that is-linked with the Library has the freedom and the wherewithal to run-that program using a modified version of the Library.-- The precise terms and conditions for copying, distribution and-modification follow. Pay close attention to the difference between a-"work based on the library" and a "work that uses the library". The-former contains code derived from the library, whereas the latter must-be combined with the library in order to run.-- GNU LESSER GENERAL PUBLIC LICENSE- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION-- 0. This License Agreement applies to any software library or other-program which contains a notice placed by the copyright holder or-other authorized party saying it may be distributed under the terms of-this Lesser General Public License (also called "this License").-Each licensee is addressed as "you".-- A "library" means a collection of software functions and/or data-prepared so as to be conveniently linked with application programs-(which use some of those functions and data) to form executables.-- The "Library", below, refers to any such software library or work-which has been distributed under these terms. A "work based on the-Library" means either the Library or any derivative work under-copyright law: that is to say, a work containing the Library or a-portion of it, either verbatim or with modifications and/or translated-straightforwardly into another language. (Hereinafter, translation is-included without limitation in the term "modification".)-- "Source code" for a work means the preferred form of the work for-making modifications to it. For a library, complete source code means-all the source code for all modules it contains, plus any associated-interface definition files, plus the scripts used to control compilation-and installation of the library.-- Activities other than copying, distribution and modification are not-covered by this License; they are outside its scope. The act of-running a program using the Library is not restricted, and output from-such a program is covered only if its contents constitute a work based-on the Library (independent of the use of the Library in a tool for-writing it). Whether that is true depends on what the Library does-and what the program that uses the Library does.-- 1. You may copy and distribute verbatim copies of the Library's-complete source code as you receive it, in any medium, provided that-you conspicuously and appropriately publish on each copy an-appropriate copyright notice and disclaimer of warranty; keep intact-all the notices that refer to this License and to the absence of any-warranty; and distribute a copy of this License along with the-Library.-- You may charge a fee for the physical act of transferring a copy,-and you may at your option offer warranty protection in exchange for a-fee.-- 2. You may modify your copy or copies of the Library or any portion-of it, thus forming a work based on the Library, and copy and-distribute such modifications or work under the terms of Section 1-above, provided that you also meet all of these conditions:-- a) The modified work must itself be a software library.-- b) You must cause the files modified to carry prominent notices- stating that you changed the files and the date of any change.-- c) You must cause the whole of the work to be licensed at no- charge to all third parties under the terms of this License.-- d) If a facility in the modified Library refers to a function or a- table of data to be supplied by an application program that uses- the facility, other than as an argument passed when the facility- is invoked, then you must make a good faith effort to ensure that,- in the event an application does not supply such function or- table, the facility still operates, and performs whatever part of- its purpose remains meaningful.-- (For example, a function in a library to compute square roots has- a purpose that is entirely well-defined independent of the- application. Therefore, Subsection 2d requires that any- application-supplied function or table used by this function must- be optional: if the application does not supply it, the square- root function must still compute square roots.)--These requirements apply to the modified work as a whole. If-identifiable sections of that work are not derived from the Library,-and can be reasonably considered independent and separate works in-themselves, then this License, and its terms, do not apply to those-sections when you distribute them as separate works. But when you-distribute the same sections as part of a whole which is a work based-on the Library, the distribution of the whole must be on the terms of-this License, whose permissions for other licensees extend to the-entire whole, and thus to each and every part regardless of who wrote-it.--Thus, it is not the intent of this section to claim rights or contest-your rights to work written entirely by you; rather, the intent is to-exercise the right to control the distribution of derivative or-collective works based on the Library.--In addition, mere aggregation of another work not based on the Library-with the Library (or with a work based on the Library) on a volume of-a storage or distribution medium does not bring the other work under-the scope of this License.-- 3. You may opt to apply the terms of the ordinary GNU General Public-License instead of this License to a given copy of the Library. To do-this, you must alter all the notices that refer to this License, so-that they refer to the ordinary GNU General Public License, version 2,-instead of to this License. (If a newer version than version 2 of the-ordinary GNU General Public License has appeared, then you can specify-that version instead if you wish.) Do not make any other change in-these notices.-- Once this change is made in a given copy, it is irreversible for-that copy, so the ordinary GNU General Public License applies to all-subsequent copies and derivative works made from that copy.-- This option is useful when you wish to copy part of the code of-the Library into a program that is not a library.-- 4. You may copy and distribute the Library (or a portion or-derivative of it, under Section 2) in object code or executable form-under the terms of Sections 1 and 2 above provided that you accompany-it with the complete corresponding machine-readable source code, which-must be distributed under the terms of Sections 1 and 2 above on a-medium customarily used for software interchange.-- If distribution of object code is made by offering access to copy-from a designated place, then offering equivalent access to copy the-source code from the same place satisfies the requirement to-distribute the source code, even though third parties are not-compelled to copy the source along with the object code.-- 5. A program that contains no derivative of any portion of the-Library, but is designed to work with the Library by being compiled or-linked with it, is called a "work that uses the Library". Such a-work, in isolation, is not a derivative work of the Library, and-therefore falls outside the scope of this License.-- However, linking a "work that uses the Library" with the Library-creates an executable that is a derivative of the Library (because it-contains portions of the Library), rather than a "work that uses the-library". The executable is therefore covered by this License.-Section 6 states terms for distribution of such executables.-- When a "work that uses the Library" uses material from a header file-that is part of the Library, the object code for the work may be a-derivative work of the Library even though the source code is not.-Whether this is true is especially significant if the work can be-linked without the Library, or if the work is itself a library. The-threshold for this to be true is not precisely defined by law.-- If such an object file uses only numerical parameters, data-structure layouts and accessors, and small macros and small inline-functions (ten lines or less in length), then the use of the object-file is unrestricted, regardless of whether it is legally a derivative-work. (Executables containing this object code plus portions of the-Library will still fall under Section 6.)-- Otherwise, if the work is a derivative of the Library, you may-distribute the object code for the work under the terms of Section 6.-Any executables containing that work also fall under Section 6,-whether or not they are linked directly with the Library itself.-- 6. As an exception to the Sections above, you may also combine or-link a "work that uses the Library" with the Library to produce a-work containing portions of the Library, and distribute that work-under terms of your choice, provided that the terms permit-modification of the work for the customer's own use and reverse-engineering for debugging such modifications.-- You must give prominent notice with each copy of the work that the-Library is used in it and that the Library and its use are covered by-this License. You must supply a copy of this License. If the work-during execution displays copyright notices, you must include the-copyright notice for the Library among them, as well as a reference-directing the user to the copy of this License. Also, you must do one-of these things:-- a) Accompany the work with the complete corresponding- machine-readable source code for the Library including whatever- changes were used in the work (which must be distributed under- Sections 1 and 2 above); and, if the work is an executable linked- with the Library, with the complete machine-readable "work that- uses the Library", as object code and/or source code, so that the- user can modify the Library and then relink to produce a modified- executable containing the modified Library. (It is understood- that the user who changes the contents of definitions files in the- Library will not necessarily be able to recompile the application- to use the modified definitions.)-- b) Use a suitable shared library mechanism for linking with the- Library. A suitable mechanism is one that (1) uses at run time a- copy of the library already present on the user's computer system,- rather than copying library functions into the executable, and (2)- will operate properly with a modified version of the library, if- the user installs one, as long as the modified version is- interface-compatible with the version that the work was made with.-- c) Accompany the work with a written offer, valid for at- least three years, to give the same user the materials- specified in Subsection 6a, above, for a charge no more- than the cost of performing this distribution.-- d) If distribution of the work is made by offering access to copy- from a designated place, offer equivalent access to copy the above- specified materials from the same place.-- e) Verify that the user has already received a copy of these- materials or that you have already sent this user a copy.-- For an executable, the required form of the "work that uses the-Library" must include any data and utility programs needed for-reproducing the executable from it. However, as a special exception,-the materials to be distributed need not include anything that is-normally distributed (in either source or binary form) with the major-components (compiler, kernel, and so on) of the operating system on-which the executable runs, unless that component itself accompanies-the executable.-- It may happen that this requirement contradicts the license-restrictions of other proprietary libraries that do not normally-accompany the operating system. Such a contradiction means you cannot-use both them and the Library together in an executable that you-distribute.-- 7. You may place library facilities that are a work based on the-Library side-by-side in a single library together with other library-facilities not covered by this License, and distribute such a combined-library, provided that the separate distribution of the work based on-the Library and of the other library facilities is otherwise-permitted, and provided that you do these two things:-- a) Accompany the combined library with a copy of the same work- based on the Library, uncombined with any other library- facilities. This must be distributed under the terms of the- Sections above.-- b) Give prominent notice with the combined library of the fact- that part of it is a work based on the Library, and explaining- where to find the accompanying uncombined form of the same work.-- 8. You may not copy, modify, sublicense, link with, or distribute-the Library except as expressly provided under this License. Any-attempt otherwise to copy, modify, sublicense, link with, or-distribute the Library is void, and will automatically terminate your-rights under this License. However, parties who have received copies,-or rights, from you under this License will not have their licenses-terminated so long as such parties remain in full compliance.-- 9. You are not required to accept this License, since you have not-signed it. However, nothing else grants you permission to modify or-distribute the Library or its derivative works. These actions are-prohibited by law if you do not accept this License. Therefore, by-modifying or distributing the Library (or any work based on the-Library), you indicate your acceptance of this License to do so, and-all its terms and conditions for copying, distributing or modifying-the Library or works based on it.-- 10. Each time you redistribute the Library (or any work based on the-Library), the recipient automatically receives a license from the-original licensor to copy, distribute, link with or modify the Library-subject to these terms and conditions. You may not impose any further-restrictions on the recipients' exercise of the rights granted herein.-You are not responsible for enforcing compliance by third parties with-this License.-- 11. If, as a consequence of a court judgment or allegation of patent-infringement or for any other reason (not limited to patent issues),-conditions are imposed on you (whether by court order, agreement or-otherwise) that contradict the conditions of this License, they do not-excuse you from the conditions of this License. If you cannot-distribute so as to satisfy simultaneously your obligations under this-License and any other pertinent obligations, then as a consequence you-may not distribute the Library at all. For example, if a patent-license would not permit royalty-free redistribution of the Library by-all those who receive copies directly or indirectly through you, then-the only way you could satisfy both it and this License would be to-refrain entirely from distribution of the Library.--If any portion of this section is held invalid or unenforceable under any-particular circumstance, the balance of the section is intended to apply,-and the section as a whole is intended to apply in other circumstances.--It is not the purpose of this section to induce you to infringe any-patents or other property right claims or to contest validity of any-such claims; this section has the sole purpose of protecting the-integrity of the free software distribution system which is-implemented by public license practices. Many people have made-generous contributions to the wide range of software distributed-through that system in reliance on consistent application of that-system; it is up to the author/donor to decide if he or she is willing-to distribute software through any other system and a licensee cannot-impose that choice.--This section is intended to make thoroughly clear what is believed to-be a consequence of the rest of this License.-- 12. If the distribution and/or use of the Library is restricted in-certain countries either by patents or by copyrighted interfaces, the-original copyright holder who places the Library under this License may add-an explicit geographical distribution limitation excluding those countries,-so that distribution is permitted only in or among countries not thus-excluded. In such case, this License incorporates the limitation as if-written in the body of this License.-- 13. The Free Software Foundation may publish revised and/or new-versions of the Lesser General Public License from time to time.-Such new versions will be similar in spirit to the present version,-but may differ in detail to address new problems or concerns.--Each version is given a distinguishing version number. If the Library-specifies a version number of this License which applies to it and-"any later version", you have the option of following the terms and-conditions either of that version or of any later version published by-the Free Software Foundation. If the Library does not specify a-license version number, you may choose any version ever published by-the Free Software Foundation.-- 14. If you wish to incorporate parts of the Library into other free-programs whose distribution conditions are incompatible with these,-write to the author to ask for permission. For software which is-copyrighted by the Free Software Foundation, write to the Free-Software Foundation; we sometimes make exceptions for this. Our-decision will be guided by the two goals of preserving the free status-of all derivatives of our free software and of promoting the sharing-and reuse of software generally.-- NO WARRANTY-- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.-- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH-DAMAGES.-- END OF TERMS AND CONDITIONS---======-OpenMW-======--This software uses the OpenMW library.--Copyright (C) 1998-2006 Robert Osfield-Copyright (C) 1998-2011 Robert Osfield-Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is-Copyright (C) 2005 Ariya Hidayat ([email protected])-Copyright (C) 2006 Ariya Hidayat ([email protected])-Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.-Copyright (c) 2006, 2008 Junio C Hamano-Copyright (c) 2006, Matthias Kretz, <[email protected]>-Copyright (C) 2007 Ariya Hidayat ([email protected])-Copyright (c) 2007 Trolltech ASA <[email protected]>-Copyright (C) 2008 by authors.-Copyright (c) 2008, Alexander Neundorf, <[email protected]>-Copyright (C) 2008-2010 Nicolay Korslund-Copyright (c) 2009 Mikko Mononen [email protected]-Copyright (C) 2009 Wang Rui-Copyright (c) 2009, Philip Lowman <philip at yhbt.com>-Copyright (c) 2009-2010 Mikko Mononen [email protected]-Copyright (c) 2009-2011 Mikko Mononen [email protected]-Copyright (c) 2009-2014 Mikko Mononen-Copyright (c) 2011 Alberto G. Salguero (alberto.salguero (at) uca.es)-Copyright (c) 2011 Matej Svec-Copyright (c) 2011, Michael Jansen, <[email protected]>-Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.-Copyright (c) 2014 scrawl, Chris Robinson-Copyright (c) 2016 Kamil Strzempowicz-Copyright (c) 2016 Michel Estermann-Copyright (c) 2016, Roman Proskuryakov, <[email protected]>-Copyright 2000-2011 Insight Software Consortium-Copyright 2000-2016 Kitware, Inc.-Copyright 2003-2009 Kitware, Inc.-Copyright 2015 Alexandre Moine <[email protected]>-Copyright 2018 Bret Curtis <[email protected]>-Copyright Sensics, Inc. 2015.-Copyright © 2007, Matt Williams--The OpenMW library is licensed under the GNU General Public Library, version 3. A copy of the license is provided below.--- GNU GENERAL PUBLIC LICENSE- Version 3, 29 June 2007-- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>- Everyone is permitted to copy and distribute verbatim copies- of this license document, but changing it is not allowed.-- Preamble-- The GNU General Public License is a free, copyleft license for-software and other kinds of works.-- The licenses for most software and other practical works are designed-to take away your freedom to share and change the works. By contrast,-the GNU General Public License is intended to guarantee your freedom to-share and change all versions of a program--to make sure it remains free-software for all its users. We, the Free Software Foundation, use the-GNU General Public License for most of our software; it applies also to-any other work released this way by its authors. You can apply it to-your programs, too.-- When we speak of free software, we are referring to freedom, not-price. Our General Public Licenses are designed to make sure that you-have the freedom to distribute copies of free software (and charge for-them if you wish), that you receive source code or can get it if you-want it, that you can change the software or use pieces of it in new-free programs, and that you know you can do these things.-- To protect your rights, we need to prevent others from denying you-these rights or asking you to surrender the rights. Therefore, you have-certain responsibilities if you distribute copies of the software, or if-you modify it: responsibilities to respect the freedom of others.-- For example, if you distribute copies of such a program, whether-gratis or for a fee, you must pass on to the recipients the same-freedoms that you received. You must make sure that they, too, receive-or can get the source code. And you must show them these terms so they-know their rights.-- Developers that use the GNU GPL protect your rights with two steps:-(1) assert copyright on the software, and (2) offer you this License-giving you legal permission to copy, distribute and/or modify it.-- For the developers' and authors' protection, the GPL clearly explains-that there is no warranty for this free software. For both users' and-authors' sake, the GPL requires that modified versions be marked as-changed, so that their problems will not be attributed erroneously to-authors of previous versions.-- Some devices are designed to deny users access to install or run-modified versions of the software inside them, although the manufacturer-can do so. This is fundamentally incompatible with the aim of-protecting users' freedom to change the software. The systematic-pattern of such abuse occurs in the area of products for individuals to-use, which is precisely where it is most unacceptable. Therefore, we-have designed this version of the GPL to prohibit the practice for those-products. If such problems arise substantially in other domains, we-stand ready to extend this provision to those domains in future versions-of the GPL, as needed to protect the freedom of users.-- Finally, every program is threatened constantly by software patents.-States should not allow patents to restrict development and use of-software on general-purpose computers, but in those that do, we wish to-avoid the special danger that patents applied to a free program could-make it effectively proprietary. To prevent this, the GPL assures that-patents cannot be used to render the program non-free.-- The precise terms and conditions for copying, distribution and-modification follow.-- TERMS AND CONDITIONS-- 0. Definitions.-- "This License" refers to version 3 of the GNU General Public License.-- "Copyright" also means copyright-like laws that apply to other kinds of-works, such as semiconductor masks.-- "The Program" refers to any copyrightable work licensed under this-License. Each licensee is addressed as "you". "Licensees" and-"recipients" may be individuals or organizations.-- To "modify" a work means to copy from or adapt all or part of the work-in a fashion requiring copyright permission, other than the making of an-exact copy. The resulting work is called a "modified version" of the-earlier work or a work "based on" the earlier work.-- A "covered work" means either the unmodified Program or a work based-on the Program.-- To "propagate" a work means to do anything with it that, without-permission, would make you directly or secondarily liable for-infringement under applicable copyright law, except executing it on a-computer or modifying a private copy. Propagation includes copying,-distribution (with or without modification), making available to the-public, and in some countries other activities as well.-- To "convey" a work means any kind of propagation that enables other-parties to make or receive copies. Mere interaction with a user through-a computer network, with no transfer of a copy, is not conveying.-- An interactive user interface displays "Appropriate Legal Notices"-to the extent that it includes a convenient and prominently visible-feature that (1) displays an appropriate copyright notice, and (2)-tells the user that there is no warranty for the work (except to the-extent that warranties are provided), that licensees may convey the-work under this License, and how to view a copy of this License. If-the interface presents a list of user commands or options, such as a-menu, a prominent item in the list meets this criterion.-- 1. Source Code.-- The "source code" for a work means the preferred form of the work-for making modifications to it. "Object code" means any non-source-form of a work.-- A "Standard Interface" means an interface that either is an official-standard defined by a recognized standards body, or, in the case of-interfaces specified for a particular programming language, one that-is widely used among developers working in that language.-- The "System Libraries" of an executable work include anything, other-than the work as a whole, that (a) is included in the normal form of-packaging a Major Component, but which is not part of that Major-Component, and (b) serves only to enable use of the work with that-Major Component, or to implement a Standard Interface for which an-implementation is available to the public in source code form. A-"Major Component", in this context, means a major essential component-(kernel, window system, and so on) of the specific operating system-(if any) on which the executable work runs, or a compiler used to-produce the work, or an object code interpreter used to run it.-- The "Corresponding Source" for a work in object code form means all-the source code needed to generate, install, and (for an executable-work) run the object code and to modify the work, including scripts to-control those activities. However, it does not include the work's-System Libraries, or general-purpose tools or generally available free-programs which are used unmodified in performing those activities but-which are not part of the work. For example, Corresponding Source-includes interface definition files associated with source files for-the work, and the source code for shared libraries and dynamically-linked subprograms that the work is specifically designed to require,-such as by intimate data communication or control flow between those-subprograms and other parts of the work.-- The Corresponding Source need not include anything that users-can regenerate automatically from other parts of the Corresponding-Source.-- The Corresponding Source for a work in source code form is that-same work.-- 2. Basic Permissions.-- All rights granted under this License are granted for the term of-copyright on the Program, and are irrevocable provided the stated-conditions are met. This License explicitly affirms your unlimited-permission to run the unmodified Program. The output from running a-covered work is covered by this License only if the output, given its-content, constitutes a covered work. This License acknowledges your-rights of fair use or other equivalent, as provided by copyright law.-- You may make, run and propagate covered works that you do not-convey, without conditions so long as your license otherwise remains-in force. You may convey covered works to others for the sole purpose-of having them make modifications exclusively for you, or provide you-with facilities for running those works, provided that you comply with-the terms of this License in conveying all material for which you do-not control copyright. Those thus making or running the covered works-for you must do so exclusively on your behalf, under your direction-and control, on terms that prohibit them from making any copies of-your copyrighted material outside their relationship with you.-- Conveying under any other circumstances is permitted solely under-the conditions stated below. Sublicensing is not allowed; section 10-makes it unnecessary.-- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.-- No covered work shall be deemed part of an effective technological-measure under any applicable law fulfilling obligations under article-11 of the WIPO copyright treaty adopted on 20 December 1996, or-similar laws prohibiting or restricting circumvention of such-measures.-- When you convey a covered work, you waive any legal power to forbid-circumvention of technological measures to the extent such circumvention-is effected by exercising rights under this License with respect to-the covered work, and you disclaim any intention to limit operation or-modification of the work as a means of enforcing, against the work's-users, your or third parties' legal rights to forbid circumvention of-technological measures.-- 4. Conveying Verbatim Copies.-- You may convey verbatim copies of the Program's source code as you-receive it, in any medium, provided that you conspicuously and-appropriately publish on each copy an appropriate copyright notice;-keep intact all notices stating that this License and any-non-permissive terms added in accord with section 7 apply to the code;-keep intact all notices of the absence of any warranty; and give all-recipients a copy of this License along with the Program.-- You may charge any price or no price for each copy that you convey,-and you may offer support or warranty protection for a fee.-- 5. Conveying Modified Source Versions.-- You may convey a work based on the Program, or the modifications to-produce it from the Program, in the form of source code under the-terms of section 4, provided that you also meet all of these conditions:-- a) The work must carry prominent notices stating that you modified- it, and giving a relevant date.-- b) The work must carry prominent notices stating that it is- released under this License and any conditions added under section- 7. This requirement modifies the requirement in section 4 to- "keep intact all notices".-- c) You must license the entire work, as a whole, under this- License to anyone who comes into possession of a copy. This- License will therefore apply, along with any applicable section 7- additional terms, to the whole of the work, and all its parts,- regardless of how they are packaged. This License gives no- permission to license the work in any other way, but it does not- invalidate such permission if you have separately received it.-- d) If the work has interactive user interfaces, each must display- Appropriate Legal Notices; however, if the Program has interactive- interfaces that do not display Appropriate Legal Notices, your- work need not make them do so.-- A compilation of a covered work with other separate and independent-works, which are not by their nature extensions of the covered work,-and which are not combined with it such as to form a larger program,-in or on a volume of a storage or distribution medium, is called an-"aggregate" if the compilation and its resulting copyright are not-used to limit the access or legal rights of the compilation's users-beyond what the individual works permit. Inclusion of a covered work-in an aggregate does not cause this License to apply to the other-parts of the aggregate.-- 6. Conveying Non-Source Forms.-- You may convey a covered work in object code form under the terms-of sections 4 and 5, provided that you also convey the-machine-readable Corresponding Source under the terms of this License,-in one of these ways:-- a) Convey the object code in, or embodied in, a physical product- (including a physical distribution medium), accompanied by the- Corresponding Source fixed on a durable physical medium- customarily used for software interchange.-- b) Convey the object code in, or embodied in, a physical product- (including a physical distribution medium), accompanied by a- written offer, valid for at least three years and valid for as- long as you offer spare parts or customer support for that product- model, to give anyone who possesses the object code either (1) a- copy of the Corresponding Source for all the software in the- product that is covered by this License, on a durable physical- medium customarily used for software interchange, for a price no- more than your reasonable cost of physically performing this- conveying of source, or (2) access to copy the- Corresponding Source from a network server at no charge.-- c) Convey individual copies of the object code with a copy of the- written offer to provide the Corresponding Source. This- alternative is allowed only occasionally and noncommercially, and- only if you received the object code with such an offer, in accord- with subsection 6b.-- d) Convey the object code by offering access from a designated- place (gratis or for a charge), and offer equivalent access to the- Corresponding Source in the same way through the same place at no- further charge. You need not require recipients to copy the- Corresponding Source along with the object code. If the place to- copy the object code is a network server, the Corresponding Source- may be on a different server (operated by you or a third party)- that supports equivalent copying facilities, provided you maintain- clear directions next to the object code saying where to find the- Corresponding Source. Regardless of what server hosts the- Corresponding Source, you remain obligated to ensure that it is- available for as long as needed to satisfy these requirements.-- e) Convey the object code using peer-to-peer transmission, provided- you inform other peers where the object code and Corresponding- Source of the work are being offered to the general public at no- charge under subsection 6d.-- A separable portion of the object code, whose source code is excluded-from the Corresponding Source as a System Library, need not be-included in conveying the object code work.-- A "User Product" is either (1) a "consumer product", which means any-tangible personal property which is normally used for personal, family,-or household purposes, or (2) anything designed or sold for incorporation-into a dwelling. In determining whether a product is a consumer product,-doubtful cases shall be resolved in favor of coverage. For a particular-product received by a particular user, "normally used" refers to a-typical or common use of that class of product, regardless of the status-of the particular user or of the way in which the particular user-actually uses, or expects or is expected to use, the product. A product-is a consumer product regardless of whether the product has substantial-commercial, industrial or non-consumer uses, unless such uses represent-the only significant mode of use of the product.-- "Installation Information" for a User Product means any methods,-procedures, authorization keys, or other information required to install-and execute modified versions of a covered work in that User Product from-a modified version of its Corresponding Source. The information must-suffice to ensure that the continued functioning of the modified object-code is in no case prevented or interfered with solely because-modification has been made.-- If you convey an object code work under this section in, or with, or-specifically for use in, a User Product, and the conveying occurs as-part of a transaction in which the right of possession and use of the-User Product is transferred to the recipient in perpetuity or for a-fixed term (regardless of how the transaction is characterized), the-Corresponding Source conveyed under this section must be accompanied-by the Installation Information. But this requirement does not apply-if neither you nor any third party retains the ability to install-modified object code on the User Product (for example, the work has-been installed in ROM).-- The requirement to provide Installation Information does not include a-requirement to continue to provide support service, warranty, or updates-for a work that has been modified or installed by the recipient, or for-the User Product in which it has been modified or installed. Access to a-network may be denied when the modification itself materially and-adversely affects the operation of the network or violates the rules and-protocols for communication across the network.-- Corresponding Source conveyed, and Installation Information provided,-in accord with this section must be in a format that is publicly-documented (and with an implementation available to the public in-source code form), and must require no special password or key for-unpacking, reading or copying.-- 7. Additional Terms.-- "Additional permissions" are terms that supplement the terms of this-License by making exceptions from one or more of its conditions.-Additional permissions that are applicable to the entire Program shall-be treated as though they were included in this License, to the extent-that they are valid under applicable law. If additional permissions-apply only to part of the Program, that part may be used separately-under those permissions, but the entire Program remains governed by-this License without regard to the additional permissions.-- When you convey a copy of a covered work, you may at your option-remove any additional permissions from that copy, or from any part of-it. (Additional permissions may be written to require their own-removal in certain cases when you modify the work.) You may place-additional permissions on material, added by you to a covered work,-for which you have or can give appropriate copyright permission.-- Notwithstanding any other provision of this License, for material you-add to a covered work, you may (if authorized by the copyright holders of-that material) supplement the terms of this License with terms:-- a) Disclaiming warranty or limiting liability differently from the- terms of sections 15 and 16 of this License; or-- b) Requiring preservation of specified reasonable legal notices or- author attributions in that material or in the Appropriate Legal- Notices displayed by works containing it; or-- c) Prohibiting misrepresentation of the origin of that material, or- requiring that modified versions of such material be marked in- reasonable ways as different from the original version; or-- d) Limiting the use for publicity purposes of names of licensors or- authors of the material; or-- e) Declining to grant rights under trademark law for use of some- trade names, trademarks, or service marks; or-- f) Requiring indemnification of licensors and authors of that- material by anyone who conveys the material (or modified versions of- it) with contractual assumptions of liability to the recipient, for- any liability that these contractual assumptions directly impose on- those licensors and authors.-- All other non-permissive additional terms are considered "further-restrictions" within the meaning of section 10. If the Program as you-received it, or any part of it, contains a notice stating that it is-governed by this License along with a term that is a further-restriction, you may remove that term. If a license document contains-a further restriction but permits relicensing or conveying under this-License, you may add to a covered work material governed by the terms-of that license document, provided that the further restriction does-not survive such relicensing or conveying.-- If you add terms to a covered work in accord with this section, you-must place, in the relevant source files, a statement of the-additional terms that apply to those files, or a notice indicating-where to find the applicable terms.-- Additional terms, permissive or non-permissive, may be stated in the-form of a separately written license, or stated as exceptions;-the above requirements apply either way.-- 8. Termination.-- You may not propagate or modify a covered work except as expressly-provided under this License. Any attempt otherwise to propagate or-modify it is void, and will automatically terminate your rights under-this License (including any patent licenses granted under the third-paragraph of section 11).-- However, if you cease all violation of this License, then your-license from a particular copyright holder is reinstated (a)-provisionally, unless and until the copyright holder explicitly and-finally terminates your license, and (b) permanently, if the copyright-holder fails to notify you of the violation by some reasonable means-prior to 60 days after the cessation.-- Moreover, your license from a particular copyright holder is-reinstated permanently if the copyright holder notifies you of the-violation by some reasonable means, this is the first time you have-received notice of violation of this License (for any work) from that-copyright holder, and you cure the violation prior to 30 days after-your receipt of the notice.-- Termination of your rights under this section does not terminate the-licenses of parties who have received copies or rights from you under-this License. If your rights have been terminated and not permanently-reinstated, you do not qualify to receive new licenses for the same-material under section 10.-- 9. Acceptance Not Required for Having Copies.-- You are not required to accept this License in order to receive or-run a copy of the Program. Ancillary propagation of a covered work-occurring solely as a consequence of using peer-to-peer transmission-to receive a copy likewise does not require acceptance. However,-nothing other than this License grants you permission to propagate or-modify any covered work. These actions infringe copyright if you do-not accept this License. Therefore, by modifying or propagating a-covered work, you indicate your acceptance of this License to do so.-- 10. Automatic Licensing of Downstream Recipients.-- Each time you convey a covered work, the recipient automatically-receives a license from the original licensors, to run, modify and-propagate that work, subject to this License. You are not responsible-for enforcing compliance by third parties with this License.-- An "entity transaction" is a transaction transferring control of an-organization, or substantially all assets of one, or subdividing an-organization, or merging organizations. If propagation of a covered-work results from an entity transaction, each party to that-transaction who receives a copy of the work also receives whatever-licenses to the work the party's predecessor in interest had or could-give under the previous paragraph, plus a right to possession of the-Corresponding Source of the work from the predecessor in interest, if-the predecessor has it or can get it with reasonable efforts.-- You may not impose any further restrictions on the exercise of the-rights granted or affirmed under this License. For example, you may-not impose a license fee, royalty, or other charge for exercise of-rights granted under this License, and you may not initiate litigation-(including a cross-claim or counterclaim in a lawsuit) alleging that-any patent claim is infringed by making, using, selling, offering for-sale, or importing the Program or any portion of it.-- 11. Patents.-- A "contributor" is a copyright holder who authorizes use under this-License of the Program or a work on which the Program is based. The-work thus licensed is called the contributor's "contributor version".-- A contributor's "essential patent claims" are all patent claims-owned or controlled by the contributor, whether already acquired or-hereafter acquired, that would be infringed by some manner, permitted-by this License, of making, using, or selling its contributor version,-but do not include claims that would be infringed only as a-consequence of further modification of the contributor version. For-purposes of this definition, "control" includes the right to grant-patent sublicenses in a manner consistent with the requirements of-this License.-- Each contributor grants you a non-exclusive, worldwide, royalty-free-patent license under the contributor's essential patent claims, to-make, use, sell, offer for sale, import and otherwise run, modify and-propagate the contents of its contributor version.-- In the following three paragraphs, a "patent license" is any express-agreement or commitment, however denominated, not to enforce a patent-(such as an express permission to practice a patent or covenant not to-sue for patent infringement). To "grant" such a patent license to a-party means to make such an agreement or commitment not to enforce a-patent against the party.-- If you convey a covered work, knowingly relying on a patent license,-and the Corresponding Source of the work is not available for anyone-to copy, free of charge and under the terms of this License, through a-publicly available network server or other readily accessible means,-then you must either (1) cause the Corresponding Source to be so-available, or (2) arrange to deprive yourself of the benefit of the-patent license for this particular work, or (3) arrange, in a manner-consistent with the requirements of this License, to extend the patent-license to downstream recipients. "Knowingly relying" means you have-actual knowledge that, but for the patent license, your conveying the-covered work in a country, or your recipient's use of the covered work-in a country, would infringe one or more identifiable patents in that-country that you have reason to believe are valid.-- If, pursuant to or in connection with a single transaction or-arrangement, you convey, or propagate by procuring conveyance of, a-covered work, and grant a patent license to some of the parties-receiving the covered work authorizing them to use, propagate, modify-or convey a specific copy of the covered work, then the patent license-you grant is automatically extended to all recipients of the covered-work and works based on it.-- A patent license is "discriminatory" if it does not include within-the scope of its coverage, prohibits the exercise of, or is-conditioned on the non-exercise of one or more of the rights that are-specifically granted under this License. You may not convey a covered-work if you are a party to an arrangement with a third party that is-in the business of distributing software, under which you make payment-to the third party based on the extent of your activity of conveying-the work, and under which the third party grants, to any of the-parties who would receive the covered work from you, a discriminatory-patent license (a) in connection with copies of the covered work-conveyed by you (or copies made from those copies), or (b) primarily-for and in connection with specific products or compilations that-contain the covered work, unless you entered into that arrangement,-or that patent license was granted, prior to 28 March 2007.-- Nothing in this License shall be construed as excluding or limiting-any implied license or other defenses to infringement that may-otherwise be available to you under applicable patent law.-- 12. No Surrender of Others' Freedom.-- If conditions are imposed on you (whether by court order, agreement or-otherwise) that contradict the conditions of this License, they do not-excuse you from the conditions of this License. If you cannot convey a-covered work so as to satisfy simultaneously your obligations under this-License and any other pertinent obligations, then as a consequence you may-not convey it at all. For example, if you agree to terms that obligate you-to collect a royalty for further conveying from those to whom you convey-the Program, the only way you could satisfy both those terms and this-License would be to refrain entirely from conveying the Program.-- 13. Use with the GNU Affero General Public License.-- Notwithstanding any other provision of this License, you have-permission to link or combine any covered work with a work licensed-under version 3 of the GNU Affero General Public License into a single-combined work, and to convey the resulting work. The terms of this-License will continue to apply to the part which is the covered work,-but the special requirements of the GNU Affero General Public License,-section 13, concerning interaction through a network will apply to the-combination as such.-- 14. Revised Versions of this License.-- The Free Software Foundation may publish revised and/or new versions of-the GNU General Public License from time to time. Such new versions will-be similar in spirit to the present version, but may differ in detail to-address new problems or concerns.-- Each version is given a distinguishing version number. If the-Program specifies that a certain numbered version of the GNU General-Public License "or any later version" applies to it, you have the-option of following the terms and conditions either of that numbered-version or of any later version published by the Free Software-Foundation. If the Program does not specify a version number of the-GNU General Public License, you may choose any version ever published-by the Free Software Foundation.-- If the Program specifies that a proxy can decide which future-versions of the GNU General Public License can be used, that proxy's-public statement of acceptance of a version permanently authorizes you-to choose that version for the Program.-- Later license versions may give you additional or different-permissions. However, no additional obligations are imposed on any-author or copyright holder as a result of your choosing to follow a-later version.-- 15. Disclaimer of Warranty.-- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.-- 16. Limitation of Liability.-- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF-SUCH DAMAGES.-- 17. Interpretation of Sections 15 and 16.-- If the disclaimer of warranty and limitation of liability provided-above cannot be given local legal effect according to their terms,-reviewing courts shall apply local law that most closely approximates-an absolute waiver of all civil liability in connection with the-Program, unless a warranty or assumption of liability accompanies a-copy of the Program in return for a fee.-- END OF TERMS AND CONDITIONSdiff --git a/android/LICENSE.txt b/android/LICENSE.txtdeleted file mode 100644index f288702..0000000--- a/android/LICENSE.txt+++ /dev/null@@ -1,674 +0,0 @@- GNU GENERAL PUBLIC LICENSE- Version 3, 29 June 2007-- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>- Everyone is permitted to copy and distribute verbatim copies- of this license document, but changing it is not allowed.-- Preamble-- The GNU General Public License is a free, copyleft license for-software and other kinds of works.-- The licenses for most software and other practical works are designed-to take away your freedom to share and change the works. By contrast,-the GNU General Public License is intended to guarantee your freedom to-share and change all versions of a program--to make sure it remains free-software for all its users. We, the Free Software Foundation, use the-GNU General Public License for most of our software; it applies also to-any other work released this way by its authors. You can apply it to-your programs, too.-- When we speak of free software, we are referring to freedom, not-price. Our General Public Licenses are designed to make sure that you-have the freedom to distribute copies of free software (and charge for-them if you wish), that you receive source code or can get it if you-want it, that you can change the software or use pieces of it in new-free programs, and that you know you can do these things.-- To protect your rights, we need to prevent others from denying you-these rights or asking you to surrender the rights. Therefore, you have-certain responsibilities if you distribute copies of the software, or if-you modify it: responsibilities to respect the freedom of others.-- For example, if you distribute copies of such a program, whether-gratis or for a fee, you must pass on to the recipients the same-freedoms that you received. You must make sure that they, too, receive-or can get the source code. And you must show them these terms so they-know their rights.-- Developers that use the GNU GPL protect your rights with two steps:-(1) assert copyright on the software, and (2) offer you this License-giving you legal permission to copy, distribute and/or modify it.-- For the developers' and authors' protection, the GPL clearly explains-that there is no warranty for this free software. For both users' and-authors' sake, the GPL requires that modified versions be marked as-changed, so that their problems will not be attributed erroneously to-authors of previous versions.-- Some devices are designed to deny users access to install or run-modified versions of the software inside them, although the manufacturer-can do so. This is fundamentally incompatible with the aim of-protecting users' freedom to change the software. The systematic-pattern of such abuse occurs in the area of products for individuals to-use, which is precisely where it is most unacceptable. Therefore, we-have designed this version of the GPL to prohibit the practice for those-products. If such problems arise substantially in other domains, we-stand ready to extend this provision to those domains in future versions-of the GPL, as needed to protect the freedom of users.-- Finally, every program is threatened constantly by software patents.-States should not allow patents to restrict development and use of-software on general-purpose computers, but in those that do, we wish to-avoid the special danger that patents applied to a free program could-make it effectively proprietary. To prevent this, the GPL assures that-patents cannot be used to render the program non-free.-- The precise terms and conditions for copying, distribution and-modification follow.-- TERMS AND CONDITIONS-- 0. Definitions.-- "This License" refers to version 3 of the GNU General Public License.-- "Copyright" also means copyright-like laws that apply to other kinds of-works, such as semiconductor masks.-- "The Program" refers to any copyrightable work licensed under this-License. Each licensee is addressed as "you". "Licensees" and-"recipients" may be individuals or organizations.-- To "modify" a work means to copy from or adapt all or part of the work-in a fashion requiring copyright permission, other than the making of an-exact copy. The resulting work is called a "modified version" of the-earlier work or a work "based on" the earlier work.-- A "covered work" means either the unmodified Program or a work based-on the Program.-- To "propagate" a work means to do anything with it that, without-permission, would make you directly or secondarily liable for-infringement under applicable copyright law, except executing it on a-computer or modifying a private copy. Propagation includes copying,-distribution (with or without modification), making available to the-public, and in some countries other activities as well.-- To "convey" a work means any kind of propagation that enables other-parties to make or receive copies. Mere interaction with a user through-a computer network, with no transfer of a copy, is not conveying.-- An interactive user interface displays "Appropriate Legal Notices"-to the extent that it includes a convenient and prominently visible-feature that (1) displays an appropriate copyright notice, and (2)-tells the user that there is no warranty for the work (except to the-extent that warranties are provided), that licensees may convey the-work under this License, and how to view a copy of this License. If-the interface presents a list of user commands or options, such as a-menu, a prominent item in the list meets this criterion.-- 1. Source Code.-- The "source code" for a work means the preferred form of the work-for making modifications to it. "Object code" means any non-source-form of a work.-- A "Standard Interface" means an interface that either is an official-standard defined by a recognized standards body, or, in the case of-interfaces specified for a particular programming language, one that-is widely used among developers working in that language.-- The "System Libraries" of an executable work include anything, other-than the work as a whole, that (a) is included in the normal form of-packaging a Major Component, but which is not part of that Major-Component, and (b) serves only to enable use of the work with that-Major Component, or to implement a Standard Interface for which an-implementation is available to the public in source code form. A-"Major Component", in this context, means a major essential component-(kernel, window system, and so on) of the specific operating system-(if any) on which the executable work runs, or a compiler used to-produce the work, or an object code interpreter used to run it.-- The "Corresponding Source" for a work in object code form means all-the source code needed to generate, install, and (for an executable-work) run the object code and to modify the work, including scripts to-control those activities. However, it does not include the work's-System Libraries, or general-purpose tools or generally available free-programs which are used unmodified in performing those activities but-which are not part of the work. For example, Corresponding Source-includes interface definition files associated with source files for-the work, and the source code for shared libraries and dynamically-linked subprograms that the work is specifically designed to require,-such as by intimate data communication or control flow between those-subprograms and other parts of the work.-- The Corresponding Source need not include anything that users-can regenerate automatically from other parts of the Corresponding-Source.-- The Corresponding Source for a work in source code form is that-same work.-- 2. Basic Permissions.-- All rights granted under this License are granted for the term of-copyright on the Program, and are irrevocable provided the stated-conditions are met. This License explicitly affirms your unlimited-permission to run the unmodified Program. The output from running a-covered work is covered by this License only if the output, given its-content, constitutes a covered work. This License acknowledges your-rights of fair use or other equivalent, as provided by copyright law.-- You may make, run and propagate covered works that you do not-convey, without conditions so long as your license otherwise remains-in force. You may convey covered works to others for the sole purpose-of having them make modifications exclusively for you, or provide you-with facilities for running those works, provided that you comply with-the terms of this License in conveying all material for which you do-not control copyright. Those thus making or running the covered works-for you must do so exclusively on your behalf, under your direction-and control, on terms that prohibit them from making any copies of-your copyrighted material outside their relationship with you.-- Conveying under any other circumstances is permitted solely under-the conditions stated below. Sublicensing is not allowed; section 10-makes it unnecessary.-- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.-- No covered work shall be deemed part of an effective technological-measure under any applicable law fulfilling obligations under article-11 of the WIPO copyright treaty adopted on 20 December 1996, or-similar laws prohibiting or restricting circumvention of such-measures.-- When you convey a covered work, you waive any legal power to forbid-circumvention of technological measures to the extent such circumvention-is effected by exercising rights under this License with respect to-the covered work, and you disclaim any intention to limit operation or-modification of the work as a means of enforcing, against the work's-users, your or third parties' legal rights to forbid circumvention of-technological measures.-- 4. Conveying Verbatim Copies.-- You may convey verbatim copies of the Program's source code as you-receive it, in any medium, provided that you conspicuously and-appropriately publish on each copy an appropriate copyright notice;-keep intact all notices stating that this License and any-non-permissive terms added in accord with section 7 apply to the code;-keep intact all notices of the absence of any warranty; and give all-recipients a copy of this License along with the Program.-- You may charge any price or no price for each copy that you convey,-and you may offer support or warranty protection for a fee.-- 5. Conveying Modified Source Versions.-- You may convey a work based on the Program, or the modifications to-produce it from the Program, in the form of source code under the-terms of section 4, provided that you also meet all of these conditions:-- a) The work must carry prominent notices stating that you modified- it, and giving a relevant date.-- b) The work must carry prominent notices stating that it is- released under this License and any conditions added under section- 7. This requirement modifies the requirement in section 4 to- "keep intact all notices".-- c) You must license the entire work, as a whole, under this- License to anyone who comes into possession of a copy. This- License will therefore apply, along with any applicable section 7- additional terms, to the whole of the work, and all its parts,- regardless of how they are packaged. This License gives no- permission to license the work in any other way, but it does not- invalidate such permission if you have separately received it.-- d) If the work has interactive user interfaces, each must display- Appropriate Legal Notices; however, if the Program has interactive- interfaces that do not display Appropriate Legal Notices, your- work need not make them do so.-- A compilation of a covered work with other separate and independent-works, which are not by their nature extensions of the covered work,-and which are not combined with it such as to form a larger program,-in or on a volume of a storage or distribution medium, is called an-"aggregate" if the compilation and its resulting copyright are not-used to limit the access or legal rights of the compilation's users-beyond what the individual works permit. Inclusion of a covered work-in an aggregate does not cause this License to apply to the other-parts of the aggregate.-- 6. Conveying Non-Source Forms.-- You may convey a covered work in object code form under the terms-of sections 4 and 5, provided that you also convey the-machine-readable Corresponding Source under the terms of this License,-in one of these ways:-- a) Convey the object code in, or embodied in, a physical product- (including a physical distribution medium), accompanied by the- Corresponding Source fixed on a durable physical medium- customarily used for software interchange.-- b) Convey the object code in, or embodied in, a physical product- (including a physical distribution medium), accompanied by a- written offer, valid for at least three years and valid for as- long as you offer spare parts or customer support for that product- model, to give anyone who possesses the object code either (1) a- copy of the Corresponding Source for all the software in the- product that is covered by this License, on a durable physical- medium customarily used for software interchange, for a price no- more than your reasonable cost of physically performing this- conveying of source, or (2) access to copy the- Corresponding Source from a network server at no charge.-- c) Convey individual copies of the object code with a copy of the- written offer to provide the Corresponding Source. This- alternative is allowed only occasionally and noncommercially, and- only if you received the object code with such an offer, in accord- with subsection 6b.-- d) Convey the object code by offering access from a designated- place (gratis or for a charge), and offer equivalent access to the- Corresponding Source in the same way through the same place at no- further charge. You need not require recipients to copy the- Corresponding Source along with the object code. If the place to- copy the object code is a network server, the Corresponding Source- may be on a different server (operated by you or a third party)- that supports equivalent copying facilities, provided you maintain- clear directions next to the object code saying where to find the- Corresponding Source. Regardless of what server hosts the- Corresponding Source, you remain obligated to ensure that it is- available for as long as needed to satisfy these requirements.-- e) Convey the object code using peer-to-peer transmission, provided- you inform other peers where the object code and Corresponding- Source of the work are being offered to the general public at no- charge under subsection 6d.-- A separable portion of the object code, whose source code is excluded-from the Corresponding Source as a System Library, need not be-included in conveying the object code work.-- A "User Product" is either (1) a "consumer product", which means any-tangible personal property which is normally used for personal, family,-or household purposes, or (2) anything designed or sold for incorporation-into a dwelling. In determining whether a product is a consumer product,-doubtful cases shall be resolved in favor of coverage. For a particular-product received by a particular user, "normally used" refers to a-typical or common use of that class of product, regardless of the status-of the particular user or of the way in which the particular user-actually uses, or expects or is expected to use, the product. A product-is a consumer product regardless of whether the product has substantial-commercial, industrial or non-consumer uses, unless such uses represent-the only significant mode of use of the product.-- "Installation Information" for a User Product means any methods,-procedures, authorization keys, or other information required to install-and execute modified versions of a covered work in that User Product from-a modified version of its Corresponding Source. The information must-suffice to ensure that the continued functioning of the modified object-code is in no case prevented or interfered with solely because-modification has been made.-- If you convey an object code work under this section in, or with, or-specifically for use in, a User Product, and the conveying occurs as-part of a transaction in which the right of possession and use of the-User Product is transferred to the recipient in perpetuity or for a-fixed term (regardless of how the transaction is characterized), the-Corresponding Source conveyed under this section must be accompanied-by the Installation Information. But this requirement does not apply-if neither you nor any third party retains the ability to install-modified object code on the User Product (for example, the work has-been installed in ROM).-- The requirement to provide Installation Information does not include a-requirement to continue to provide support service, warranty, or updates-for a work that has been modified or installed by the recipient, or for-the User Product in which it has been modified or installed. Access to a-network may be denied when the modification itself materially and-adversely affects the operation of the network or violates the rules and-protocols for communication across the network.-- Corresponding Source conveyed, and Installation Information provided,-in accord with this section must be in a format that is publicly-documented (and with an implementation available to the public in-source code form), and must require no special password or key for-unpacking, reading or copying.-- 7. Additional Terms.-- "Additional permissions" are terms that supplement the terms of this-License by making exceptions from one or more of its conditions.-Additional permissions that are applicable to the entire Program shall-be treated as though they were included in this License, to the extent-that they are valid under applicable law. If additional permissions-apply only to part of the Program, that part may be used separately-under those permissions, but the entire Program remains governed by-this License without regard to the additional permissions.-- When you convey a copy of a covered work, you may at your option-remove any additional permissions from that copy, or from any part of-it. (Additional permissions may be written to require their own-removal in certain cases when you modify the work.) You may place-additional permissions on material, added by you to a covered work,-for which you have or can give appropriate copyright permission.-- Notwithstanding any other provision of this License, for material you-add to a covered work, you may (if authorized by the copyright holders of-that material) supplement the terms of this License with terms:-- a) Disclaiming warranty or limiting liability differently from the- terms of sections 15 and 16 of this License; or-- b) Requiring preservation of specified reasonable legal notices or- author attributions in that material or in the Appropriate Legal- Notices displayed by works containing it; or-- c) Prohibiting misrepresentation of the origin of that material, or- requiring that modified versions of such material be marked in- reasonable ways as different from the original version; or-- d) Limiting the use for publicity purposes of names of licensors or- authors of the material; or-- e) Declining to grant rights under trademark law for use of some- trade names, trademarks, or service marks; or-- f) Requiring indemnification of licensors and authors of that- material by anyone who conveys the material (or modified versions of- it) with contractual assumptions of liability to the recipient, for- any liability that these contractual assumptions directly impose on- those licensors and authors.-- All other non-permissive additional terms are considered "further-restrictions" within the meaning of section 10. If the Program as you-received it, or any part of it, contains a notice stating that it is-governed by this License along with a term that is a further-restriction, you may remove that term. If a license document contains-a further restriction but permits relicensing or conveying under this-License, you may add to a covered work material governed by the terms-of that license document, provided that the further restriction does-not survive such relicensing or conveying.-- If you add terms to a covered work in accord with this section, you-must place, in the relevant source files, a statement of the-additional terms that apply to those files, or a notice indicating-where to find the applicable terms.-- Additional terms, permissive or non-permissive, may be stated in the-form of a separately written license, or stated as exceptions;-the above requirements apply either way.-- 8. Termination.-- You may not propagate or modify a covered work except as expressly-provided under this License. Any attempt otherwise to propagate or-modify it is void, and will automatically terminate your rights under-this License (including any patent licenses granted under the third-paragraph of section 11).-- However, if you cease all violation of this License, then your-license from a particular copyright holder is reinstated (a)-provisionally, unless and until the copyright holder explicitly and-finally terminates your license, and (b) permanently, if the copyright-holder fails to notify you of the violation by some reasonable means-prior to 60 days after the cessation.-- Moreover, your license from a particular copyright holder is-reinstated permanently if the copyright holder notifies you of the-violation by some reasonable means, this is the first time you have-received notice of violation of this License (for any work) from that-copyright holder, and you cure the violation prior to 30 days after-your receipt of the notice.-- Termination of your rights under this section does not terminate the-licenses of parties who have received copies or rights from you under-this License. If your rights have been terminated and not permanently-reinstated, you do not qualify to receive new licenses for the same-material under section 10.-- 9. Acceptance Not Required for Having Copies.-- You are not required to accept this License in order to receive or-run a copy of the Program. Ancillary propagation of a covered work-occurring solely as a consequence of using peer-to-peer transmission-to receive a copy likewise does not require acceptance. However,-nothing other than this License grants you permission to propagate or-modify any covered work. These actions infringe copyright if you do-not accept this License. Therefore, by modifying or propagating a-covered work, you indicate your acceptance of this License to do so.-- 10. Automatic Licensing of Downstream Recipients.-- Each time you convey a covered work, the recipient automatically-receives a license from the original licensors, to run, modify and-propagate that work, subject to this License. You are not responsible-for enforcing compliance by third parties with this License.-- An "entity transaction" is a transaction transferring control of an-organization, or substantially all assets of one, or subdividing an-organization, or merging organizations. If propagation of a covered-work results from an entity transaction, each party to that-transaction who receives a copy of the work also receives whatever-licenses to the work the party's predecessor in interest had or could-give under the previous paragraph, plus a right to possession of the-Corresponding Source of the work from the predecessor in interest, if-the predecessor has it or can get it with reasonable efforts.-- You may not impose any further restrictions on the exercise of the-rights granted or affirmed under this License. For example, you may-not impose a license fee, royalty, or other charge for exercise of-rights granted under this License, and you may not initiate litigation-(including a cross-claim or counterclaim in a lawsuit) alleging that-any patent claim is infringed by making, using, selling, offering for-sale, or importing the Program or any portion of it.-- 11. Patents.-- A "contributor" is a copyright holder who authorizes use under this-License of the Program or a work on which the Program is based. The-work thus licensed is called the contributor's "contributor version".-- A contributor's "essential patent claims" are all patent claims-owned or controlled by the contributor, whether already acquired or-hereafter acquired, that would be infringed by some manner, permitted-by this License, of making, using, or selling its contributor version,-but do not include claims that would be infringed only as a-consequence of further modification of the contributor version. For-purposes of this definition, "control" includes the right to grant-patent sublicenses in a manner consistent with the requirements of-this License.-- Each contributor grants you a non-exclusive, worldwide, royalty-free-patent license under the contributor's essential patent claims, to-make, use, sell, offer for sale, import and otherwise run, modify and-propagate the contents of its contributor version.-- In the following three paragraphs, a "patent license" is any express-agreement or commitment, however denominated, not to enforce a patent-(such as an express permission to practice a patent or covenant not to-sue for patent infringement). To "grant" such a patent license to a-party means to make such an agreement or commitment not to enforce a-patent against the party.-- If you convey a covered work, knowingly relying on a patent license,-and the Corresponding Source of the work is not available for anyone-to copy, free of charge and under the terms of this License, through a-publicly available network server or other readily accessible means,-then you must either (1) cause the Corresponding Source to be so-available, or (2) arrange to deprive yourself of the benefit of the-patent license for this particular work, or (3) arrange, in a manner-consistent with the requirements of this License, to extend the patent-license to downstream recipients. "Knowingly relying" means you have-actual knowledge that, but for the patent license, your conveying the-covered work in a country, or your recipient's use of the covered work-in a country, would infringe one or more identifiable patents in that-country that you have reason to believe are valid.-- If, pursuant to or in connection with a single transaction or-arrangement, you convey, or propagate by procuring conveyance of, a-covered work, and grant a patent license to some of the parties-receiving the covered work authorizing them to use, propagate, modify-or convey a specific copy of the covered work, then the patent license-you grant is automatically extended to all recipients of the covered-work and works based on it.-- A patent license is "discriminatory" if it does not include within-the scope of its coverage, prohibits the exercise of, or is-conditioned on the non-exercise of one or more of the rights that are-specifically granted under this License. You may not convey a covered-work if you are a party to an arrangement with a third party that is-in the business of distributing software, under which you make payment-to the third party based on the extent of your activity of conveying-the work, and under which the third party grants, to any of the-parties who would receive the covered work from you, a discriminatory-patent license (a) in connection with copies of the covered work-conveyed by you (or copies made from those copies), or (b) primarily-for and in connection with specific products or compilations that-contain the covered work, unless you entered into that arrangement,-or that patent license was granted, prior to 28 March 2007.-- Nothing in this License shall be construed as excluding or limiting-any implied license or other defenses to infringement that may-otherwise be available to you under applicable patent law.-- 12. No Surrender of Others' Freedom.-- If conditions are imposed on you (whether by court order, agreement or-otherwise) that contradict the conditions of this License, they do not-excuse you from the conditions of this License. If you cannot convey a-covered work so as to satisfy simultaneously your obligations under this-License and any other pertinent obligations, then as a consequence you may-not convey it at all. For example, if you agree to terms that obligate you-to collect a royalty for further conveying from those to whom you convey-the Program, the only way you could satisfy both those terms and this-License would be to refrain entirely from conveying the Program.-- 13. Use with the GNU Affero General Public License.-- Notwithstanding any other provision of this License, you have-permission to link or combine any covered work with a work licensed-under version 3 of the GNU Affero General Public License into a single-combined work, and to convey the resulting work. The terms of this-License will continue to apply to the part which is the covered work,-but the special requirements of the GNU Affero General Public License,-section 13, concerning interaction through a network will apply to the-combination as such.-- 14. Revised Versions of this License.-- The Free Software Foundation may publish revised and/or new versions of-the GNU General Public License from time to time. Such new versions will-be similar in spirit to the present version, but may differ in detail to-address new problems or concerns.-- Each version is given a distinguishing version number. If the-Program specifies that a certain numbered version of the GNU General-Public License "or any later version" applies to it, you have the-option of following the terms and conditions either of that numbered-version or of any later version published by the Free Software-Foundation. If the Program does not specify a version number of the-GNU General Public License, you may choose any version ever published-by the Free Software Foundation.-- If the Program specifies that a proxy can decide which future-versions of the GNU General Public License can be used, that proxy's-public statement of acceptance of a version permanently authorizes you-to choose that version for the Program.-- Later license versions may give you additional or different-permissions. However, no additional obligations are imposed on any-author or copyright holder as a result of your choosing to follow a-later version.-- 15. Disclaimer of Warranty.-- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.-- 16. Limitation of Liability.-- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF-SUCH DAMAGES.-- 17. Interpretation of Sections 15 and 16.-- If the disclaimer of warranty and limitation of liability provided-above cannot be given local legal effect according to their terms,-reviewing courts shall apply local law that most closely approximates-an absolute waiver of all civil liability in connection with the-Program, unless a warranty or assumption of liability accompanies a-copy of the Program in return for a fee.-- END OF TERMS AND CONDITIONS-- How to Apply These Terms to Your New Programs-- If you develop a new program, and you want it to be of the greatest-possible use to the public, the best way to achieve this is to make it-free software which everyone can redistribute and change under these terms.-- To do so, attach the following notices to the program. It is safest-to attach them to the start of each source file to most effectively-state the exclusion of warranty; and each file should have at least-the "copyright" line and a pointer to where the full notice is found.-- <one line to give the program's name and a brief idea of what it does.>- Copyright (C) <year> <name of author>-- This program is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- This program is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with this program. If not, see <https://www.gnu.org/licenses/>.--Also add information on how to contact you by electronic and paper mail.-- If the program does terminal interaction, make it output a short-notice like this when it starts in an interactive mode:-- <program> Copyright (C) <year> <name of author>- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.- This is free software, and you are welcome to redistribute it- under certain conditions; type `show c' for details.--The hypothetical commands `show w' and `show c' should show the appropriate-parts of the General Public License. Of course, your program's commands-might be different; for a GUI interface, you would use an "about box".-- You should also get your employer (if you work as a programmer) or school,-if any, to sign a "copyright disclaimer" for the program, if necessary.-For more information on this, and how to apply and follow the GNU GPL, see-<https://www.gnu.org/licenses/>.-- The GNU General Public License does not permit incorporating your program-into proprietary programs. If your program is a subroutine library, you-may consider it more useful to permit linking proprietary applications with-the library. If this is what you want to do, use the GNU Lesser General-Public License instead of this License. But first, please read-<https://www.gnu.org/licenses/why-not-lgpl.html>.diff --git a/android/README-upstream.md b/android/README-upstream.mddeleted file mode 100644index 45e4e37..0000000--- a/android/README-upstream.md+++ /dev/null@@ -1,84 +0,0 @@-<div align="center">--<img width="1541" height="333" alt="image" src="https://github.com/user-attachments/assets/15a5cc0d-9210-4ce6-b8a2-09304a1b72c9" />--**OpenMW (Morrowind) for Android and ChromeOS with improved controls and enhanced OMWFX shaders**--------</div>--# OpenMW Android and ChromeOS--## ✨ About--This project is an **OpenMW Android and ChromeOS port for The Elder Scrolls III: Morrowind**. It is based on the [CaveBros openmw-android project](https://gitlab.com/cavebros/openmw-android/-/releases) and extends it with **OpenMW 0.51**, additional Android/ChromeOS improvements and enhanced post-processing shaders.-This is not meant to be the umpteenth OpenMW port; rather, this fork is about continuing the clear and simple launcher user interface of the CaveBros port, combined with a more up-to-date OpenMW base and more modern shaders.--The goal is a clean, controller-friendly Morrowind experience on **Android handhelds, tablets and ChromeOS** while staying close to the upstream OpenMW engine.--## ⚔️ Highlights--- ⚙️ **OpenMW 0.51.0 Final** engine integrated into the Android port-- 📱 Optimized for **Android handhelds, tablets, TV devices and ChromeOS**-- 🎮 Improved **gamepad, touch, keyboard and physical mouse** support-- 🖥️ Extended launcher with direct access to **gameplay, visual, shadow, interface and engine settings**-- 📐 Configurable **resolution, UI scaling, framerate and performance options**-- 🌑 Android-compatible **dynamic shadows** with selectable quality and distance presets-- 🎨 Four shader presets: **Original, Modified, Zesterer and OMWFX**-- ✨ Enhanced **OMWFX post-processing** with **WetWorld, RainLens, Godrays, Bloom and Lens Flare**-- 🧩 Support for **mods, custom data files, shader presets and environment flags**-- 🔧 Android-specific fixes for **GLES2/GL4ES, post-processing and depth handling**--<img width="1920" height="1080" alt="openmw0" src="https://github.com/user-attachments/assets/993327f9-ee20-466c-b1bc-ef19c0cc1d00" />-<img width="1920" height="1080" alt="image" src="https://github.com/user-attachments/assets/1a742936-ebb4-4199-a565-fd7ff30a30f5" />-<img width="1920" height="1080" alt="openmw1" src="https://github.com/user-attachments/assets/ace8b873-e704-45e8-b4a5-760e4994f347" />-<img width="1920" height="1080" alt="openmw2" src="https://github.com/user-attachments/assets/97bbf06b-b6d9-4fcd-8d79-bd9f36ab7db3" />-<img width="1920" height="1080" alt="openmw4" src="https://github.com/user-attachments/assets/cb9b06d6-265c-495c-ad78-f7464ac5b541" />---## 🎨 OMWFX Shaders--The project includes an enhanced OMWFX shader option based on the OpenMW post-processing framework and the community [OMWFX Shaders collection](https://gitlab.com/vtastek/omwfx-shaders).--The bundled preset adds a more modern visual presentation while remaining optional, including the project's additional **Lens Flare** effect.--## 🧩 Project Base--| Component | Source |-|---|---|-| Android port | [CaveBros / openmw-android](https://gitlab.com/cavebros/openmw-android/-/releases) |-| OpenMW engine | [OpenMW / openmw](https://github.com/OpenMW/openmw) |-| Shader framework | [OMWFX Shaders](https://gitlab.com/vtastek/omwfx-shaders) |--## 📦 Requirements--You need your own legally obtained **The Elder Scrolls III: Morrowind** game data. Bethesda game files are **not included** in this repository.--## ❤️ Support--If you enjoy this project and would like to support my work, you can make a small contribution via PayPal.--Your support helps me spend more time maintaining existing projects, fixing bugs, improving compatibility, and working on new features.--[](https://paypal.me/andiweli)--Thank you for your support!--## 📜 Credits & Disclaimer--OpenMW is an independent open-source reimplementation of the Morrowind engine. This Android/ChromeOS project builds upon the work of the **OpenMW**, **CaveBros** and **OMWFX shader** contributors.--This project is not affiliated with or endorsed by Bethesda Softworks. **The Elder Scrolls**, **Morrowind** and related trademarks belong to their respective owners.-------<div align="center">--**OpenMW • Morrowind • Android • ChromeOS • OMWFX**--</div>diff --git a/android/app/build.gradle b/android/app/build.gradledeleted file mode 100644index 3c6839b..0000000--- a/android/app/build.gradle+++ /dev/null@@ -1,847 +0,0 @@-apply plugin: 'com.android.application'-apply plugin: 'kotlin-android'--/*- * OpenMW 0.51.0 Android final release baseline- *- * Keeps the tested ARM64 runtime, Android launcher settings, shadows and- * calibrated OMWFX chain together behind one build-time verification gate.- */--def openMwVersionCode = 5111-def openMwAndroidVersionName = '0.51.0-11'-def versionFile = new File(- project.rootDir,- 'app/src/main/assets/libopenmw/resources/version'-)--def calculateVersion = {- def engineVersion = 'openmw-native-not-built'-- if (versionFile.isFile()) {- def firstLine = versionFile.readLines().find { line -> !line.trim().isEmpty() }- if (firstLine != null) {- engineVersion = firstLine.trim()- }- }- return engineVersion == '0.51.0' ? openMwAndroidVersionName : engineVersion-}--// The final release deliberately supports ARM64 only.-// The original native build creates one ABI at a time; advertising x86/ARM32-// while only libopenmw.so for ARM64 exists would produce installable but broken APKs.-def requiredOpenMwPayload = [- file('src/main/assets/libopenmw/resources/version'),- file('src/main/assets/libopenmw/resources/shaders/compatibility/fullscreen_tri.vert'),- file('src/main/assets/libopenmw/resources/shaders/compatibility/shadowcasting.vert'),- file('src/main/assets/libopenmw/resources/shaders/compatibility/shadows_vertex.glsl'),- file('src/main/assets/libopenmw/resources/shaders/compatibility/shadows_fragment.glsl'),- file('src/main/assets/libopenmw/resources/shaders/compatibility/water.vert'),- file('src/main/assets/libopenmw/resources/shaders/compatibility/water.frag'),- file('src/main/assets/libopenmw/resources/shaders/compatibility/debug.vert'),- file('src/main/assets/libopenmw/resources/shaders/compatibility/debug.frag'),- file('src/main/assets/libopenmw/resources/vfs/shaders/adjustments.omwfx'),- file('src/main/assets/android_omwfx/gateh_bloom051.omwfx'),- file('src/main/assets/android_omwfx/godrays_android_051_depthfixed_vivid.omwfx'),- file('src/main/assets/android_omwfx/lensflare_android_051_rayocc.omwfx'),- file('src/main/assets/android_omwfx/rainlens_android_051_v12_dense.omwfx'),- file('src/main/assets/android_omwfx/wetworld_android_051_weather.omwfx'),- file('src/main/assets/libopenmw/openmw/defaults.bin'),- file('src/main/assets/libopenmw/openmw/openmw.base.cfg'),- file('src/main/assets/libopenmw/openmw/openmw-engine-version.txt'),- file('src/main/assets/libopenmw/openmw/gamecontrollerdb.txt'),- file('src/main/assets/libopenmw/3rdparty-licenses.txt'),-- file('src/main/java/ui/activity/MainActivity.kt'),- file('src/main/java/ui/fragments/FragmentSettings.kt'),- file('src/main/res/xml/settings.xml'),- file('src/main/res/xml/gs_engine.xml'),- file('src/main/res/values/strings.xml'),- file('src/main/res/values/styles.xml'),-- file('src/main/jniLibs/arm64-v8a/libopenmw.so'),- file('src/main/jniLibs/arm64-v8a/libopenal.so'),- file('src/main/jniLibs/arm64-v8a/libSDL2.so'),- file('src/main/jniLibs/arm64-v8a/libGL.so'),- file('src/main/jniLibs/arm64-v8a/libcollada-dom2.5-dp.so'),- file('src/main/jniLibs/arm64-v8a/libc++_shared.so')-]--// Retire assets left by earlier ZIP overlays before merging APK assets.-// Only these two files belonged to the removed experimental water preset.-tasks.register('removeRetiredWaterAssets', Delete) {- delete file('src/main/assets/android_omwfx/OWSE.omwfx'),- file('src/main/assets/android_omwfx/GreenWaterShader.frag')-}--tasks.register('verifyOpenMwPayload') {- dependsOn tasks.named('removeRetiredWaterAssets')- group = 'verification'- description = 'Checks the consolidated OpenMW 0.51.0 Android final release payload.'-- doLast {- def missing = requiredOpenMwPayload.findAll { !it.exists() }- if (!missing.isEmpty()) {- def relativeMissing = missing.collect {- project.rootDir.toPath().relativize(it.toPath()).toString()- }.join('\n - ')-- throw new GradleException(- 'OpenMW 0.51 runtime payload is missing.\n' +- 'Build it first with tools\\build-openmw-051-runtime.ps1.\n\n' +- 'Missing files:\n - ' + relativeMissing- )- }-- def engineMarkerFile = file('src/main/assets/libopenmw/openmw/openmw-engine-version.txt')- def engineMarker = engineMarkerFile.getText('UTF-8').replace('\r\n', '\n').trim()- def requiredFinalCommit = 'f4bec41444214a7903bebd178389ca22ca13f646'- def expectedEngineMarker = 'OpenMW 0.51.0 Final\ncommit=' + requiredFinalCommit-- if (engineMarker != expectedEngineMarker) {- def printableMarker = engineMarker.replace('\n', ' | ')- throw new GradleException(- 'The native payload is not the pinned OpenMW 0.51.0 Final runtime gate.\n' +- 'Run tools\\build-openmw-051-runtime.ps1 before assembling the APK.\n' +- 'Expected marker: ' + expectedEngineMarker.replace('\n', ' | ') + '\n' +- 'Actual marker: ' + printableMarker- )- }-- // Keep the release-cleaned native build tied to its generated digest.- def finalNativeShaFile = new File(project.rootDir, 'buildscripts/openmw-051-patch39-libopenmw.sha256')- if (!finalNativeShaFile.isFile()) {- throw new GradleException(- 'OpenMW 0.51 Android requires the release-cleaned native library.\n' +- 'Run tools\\apply-openmw-051-patch39-release-log-cleanup.ps1 before assembling the APK.'- )- }-- def expectedNativeSha = finalNativeShaFile.getText('UTF-8').trim().split(/\s+/)[0]- def finalNativeLib = file('src/main/jniLibs/arm64-v8a/libopenmw.so')- def digest = java.security.MessageDigest.getInstance('SHA-256')- finalNativeLib.withInputStream { input ->- byte[] buffer = new byte[64 * 1024]- int count- while ((count = input.read(buffer)) > 0) {- digest.update(buffer, 0, count)- }- }- def actualNativeSha = digest.digest().collect { String.format('%02x', it & 0xff) }.join()- if (!expectedNativeSha.equalsIgnoreCase(actualNativeSha)) {- throw new GradleException(- 'OpenMW 0.51 Android release native payload is stale.\n' +- 'Run tools\\apply-openmw-051-patch39-release-log-cleanup.ps1 again.\n' +- 'Expected SHA-256: ' + expectedNativeSha + '\n' +- 'Actual SHA-256: ' + actualNativeSha- )- }-- def resourceVersion = file('src/main/assets/libopenmw/resources/version')- .getText('UTF-8').trim()- if (!resourceVersion.startsWith('0.51.0')) {- throw new GradleException(- 'OpenMW resources are not from 0.51.0 Final. Actual resources/version: ' +- resourceVersion- )- }-- if (openMwVersionCode != 5111 || calculateVersion() != '0.51.0-11') {- throw new GradleException(- 'OpenMW Android final release identity must be versionName 0.51.0-11 and versionCode 5111.'- )- }-- def launcherMainActivity = file('src/main/java/ui/activity/MainActivity.kt').getText('UTF-8')- // OPENMW_ANDROID_051_GRAZING_SHADOW_LAUNCHER_SYNC_BUILD_GATE_V2- if (!launcherMainActivity.contains('"shaders/compatibility/shadows_vertex.glsl"') ||- !launcherMainActivity.contains('OPENMW_ANDROID_051_GRAZING_SHADOW_PAIR_SYNC_V2')) {- throw new GradleException(- 'OpenMW launcher must refresh and verify both grazing-angle shadow include files.'- )- }- if (!launcherMainActivity.contains('migrateOpenMw051SettingsPreferences()') ||- !launcherMainActivity.contains('private fun controllerTriggerThresholds(): Pair<Int, Int>') ||- !launcherMainActivity.contains('private fun applyOpenMw051LauncherSettings()') ||- !launcherMainActivity.contains('private fun applyOpenMw051RuntimeSettings()') ||- !launcherMainActivity.contains('OMWFX_RECOMMENDED_CHAIN.joinToString(",")') ||- !launcherMainActivity.contains('"controller trigger press" to triggerPress.toString()') ||- !launcherMainActivity.contains('"controller trigger release" to triggerRelease.toString()') ||- !launcherMainActivity.contains('"point lighting" to if (groundcoverPointLighting) "true" else "false"') ||- !launcherMainActivity.contains('"pref_omw051_controller_trigger_thresholds"') ||- !launcherMainActivity.contains('"gs_groundcover_point_lighting"') ||- !launcherMainActivity.contains('"gs_groundcover_enabled"') ||- !launcherMainActivity.contains('"gs_groundcover_density"') ||- !launcherMainActivity.contains('"gs_groundcover_rendering_distance"') ||- launcherMainActivity.contains('"paging" to if(prefs.getString("gs_groundcover_handling"') ||- launcherMainActivity.contains('"timeplayed" to') ||- !launcherMainActivity.contains('text = "ARM64 \\u2022 v${BuildConfig.VERSION_NAME}"') ||- !launcherMainActivity.contains('OpenMW 0.51 Android release runtime:') ||- !launcherMainActivity.contains('setContentView(createOpaqueLoadingPanel())') ||- !launcherMainActivity.contains('private fun initializeLauncher(savedInstanceState: Bundle?)') ||- !launcherMainActivity.contains('private fun isOledLauncherTheme(): Boolean') ||- !launcherMainActivity.contains('R.string.action_theme_oled') ||- !launcherMainActivity.contains('prefs.getInt(getString(R.string.theme), 0) == 3') ||- launcherMainActivity.contains('Gate H5a') ||- launcherMainActivity.indexOf('text = "ARM64 \\u2022 v${BuildConfig.VERSION_NAME}"') >- launcherMainActivity.indexOf('getString(R.string.about_port_info)')) {- throw new GradleException(- 'OpenMW 0.51 Android launcher, OMWFX consolidation or About information is incomplete.'- )- }-- def launcherStyles = file('src/main/res/values/styles.xml').getText('UTF-8')- if (launcherStyles.contains('<item name="android:windowBackground">') ||- launcherStyles.contains('<item name="android:colorBackground">') ||- launcherStyles.contains('<item name="android:windowIsTranslucent">')) {- throw new GradleException(- 'OpenMW launcher must keep the original MyTheme/AppCompat DayNight window/background definitions.'- )- }- if (!launcherMainActivity.contains('restoreOriginalLauncherWindowBackground()')) {- throw new GradleException(- 'OpenMW launcher must restore the original themed window background after the startup loading panel.'- )- }-- def launcherFragmentSettings = file('src/main/java/ui/fragments/FragmentSettings.kt').getText('UTF-8')- if (!launcherFragmentSettings.contains('prepareControllerTriggerPreference()') ||- !launcherFragmentSettings.contains('R.string.controller_trigger_custom_values') ||- !launcherFragmentSettings.contains('sharedPref.getString("pref_shadersDir_v2", "") == "modified"') ||- !launcherFragmentSettings.contains('sharedPref.getInt(getString(R.string.theme), 0) == 3')) {- throw new GradleException(- 'OpenMW 0.51 launcher controller, shader-precision or OLED-theme handling is missing.'- )- }-- def launcherSettingsXml = file('src/main/res/xml/settings.xml').getText('UTF-8')- def controllerTooltipsIndex = launcherSettingsXml.indexOf('android:key="pref_omw050_controller_tooltips"')- def controllerTriggerIndex = launcherSettingsXml.indexOf('android:key="pref_omw051_controller_trigger_thresholds"')- def onScreenControlsIndex = launcherSettingsXml.indexOf('android:key="pref_controls"')- def hideOnScreenButtonsIndex = launcherSettingsXml.indexOf('android:key="pref_hide_controls"')- if (!launcherSettingsXml.contains('android:dependency="pref_omw050_controller_menus"') ||- !launcherSettingsXml.contains('android:summary="@string/pref_omw050_controller_menus_summary"') ||- !launcherSettingsXml.contains('android:summary="@string/pref_nohighp_summary"') ||- controllerTooltipsIndex < 0 ||- controllerTriggerIndex <= controllerTooltipsIndex ||- onScreenControlsIndex <= controllerTriggerIndex ||- hideOnScreenButtonsIndex <= onScreenControlsIndex ||- launcherSettingsXml.contains('android:key="pref_graphicsLibrary_v2"')) {- throw new GradleException(- 'OpenMW 0.51 launcher order or precision explanation is missing from settings.xml.'- )- }-- // OPENMW_ANDROID_051_LAUNCHER_AUDIT_GATE_V1- def launcherEngineXml = file('src/main/res/xml/gs_engine.xml').getText('UTF-8')- if (!launcherEngineXml.contains('android:key="gs_groundcover_enabled"') ||- !launcherEngineXml.contains('android:key="gs_groundcover_density"') ||- !launcherEngineXml.contains('android:key="gs_groundcover_rendering_distance"') ||- !launcherEngineXml.contains('android:key="gs_groundcover_point_lighting"') ||- launcherEngineXml.contains('android:key="gs_groundcover_handling"')) {- throw new GradleException(- 'OpenMW 0.51 native Groundcover launcher controls are incomplete or legacy Paging remains.'- )- }-- def launcherGameActivity = file('src/main/java/ui/activity/GameActivity.kt').getText('UTF-8')- if (!launcherGameActivity.contains('OPENMW_ANDROID_051_LAUNCHER_AUDIT_V1') ||- !launcherGameActivity.contains('Os.setenv("OPENMW_GLES_VERSION", "2", true)') ||- !launcherGameActivity.contains('Os.setenv("LIBGL_ES", "2", true)') ||- launcherGameActivity.contains('graphicsLibrary != "gles1"')) {- throw new GradleException(- 'OpenMW 0.51 Android final runtime must use the GLES2/GL4ES path.'- )- }-- def launcherStrings = file('src/main/res/values/strings.xml').getText('UTF-8')- ['30720,26624', '24576,20480', '16384,12288'].each { thresholdPreset ->- if (!launcherStrings.contains('<item>' + thresholdPreset + '</item>')) {- throw new GradleException(- 'OpenMW 0.51 controller-trigger preset is missing: ' + thresholdPreset- )- }- }- if (!launcherStrings.contains('<string name="pref_nohighp_summary">Uses medium instead of high precision; available only with the Modified shader preset</string>')) {- throw new GradleException(- 'OpenMW 0.51 Medium shader precision explanation is missing.'- )- }-- // Every launcher locale must contain the complete English string-key set.- // This prevents newly added launcher text from silently falling back to English.- def launcherPreferenceStrings = file('src/main/res/values/launcher_preferences.xml').getText('UTF-8')- def extractStringKeys = { String xml ->- def keys = [] as Set- def matcher = (xml =~ /<string\s+name="([^"]+)"/)- matcher.each { match -> keys.add(match[1]) }- return keys- }- def requiredGeneralStringKeys = extractStringKeys(launcherStrings)- def requiredPreferenceStringKeys = extractStringKeys(launcherPreferenceStrings)- def requiredLocalizedArrays = [- 'pref_encoding_entries',- 'gs_factor_strength_into_hand_to_hand_combat_entries',- 'gs_show_owned_entries',- 'pref_omw051_controller_trigger_sensitivity_entries',- 'pref_textureShrinking_entries',- 'pref_shadersDir_entries',- 'pref_mouse_mode_entries',- 'gs_shadow_quality_entries',- 'gs_shadow_distance_entries'- ]- def extractArrayItemCounts = { String xml ->- def counts = [:]- def matcher = (xml =~ /(?s)<string-array\s+name="([^"]+)"[^>]*>(.*?)<\/string-array>/)- matcher.each { match ->- counts[match[1]] = (match[2] =~ /<item(?:\s[^>]*)?>/).findAll().size()- }- return counts- }- def baseArrayItemCounts = extractArrayItemCounts(launcherStrings)- def storageChooserBase = new File(- project.rootDir,- 'storagechooser/src/main/res/values/strings.xml'- )- def storageChooserKeys = storageChooserBase.isFile()- ? extractStringKeys(storageChooserBase.getText('UTF-8'))- : ([] as Set)-- ['de', 'fr', 'pl', 'ru', 'sv'].each { locale ->- def localeDir = file('src/main/res/values-' + locale)- def localeGeneralFile = new File(localeDir, 'strings.xml')- def localePreferencesFile = new File(localeDir, 'launcher_preferences.xml')- if (!localeGeneralFile.isFile() || !localePreferencesFile.isFile()) {- throw new GradleException('Launcher localization is incomplete for locale: ' + locale)- }-- def localeGeneralText = localeGeneralFile.getText('UTF-8')- def localeGeneralKeys = extractStringKeys(localeGeneralText)- def localePreferenceKeys = extractStringKeys(localePreferencesFile.getText('UTF-8'))- def localeArrayItemCounts = extractArrayItemCounts(localeGeneralText)- def missingGeneral = requiredGeneralStringKeys - localeGeneralKeys- def missingPreferences = requiredPreferenceStringKeys - localePreferenceKeys- def invalidArrays = requiredLocalizedArrays.findAll { arrayName ->- !localeArrayItemCounts.containsKey(arrayName) ||- localeArrayItemCounts[arrayName] != baseArrayItemCounts[arrayName]- }-- def storageChooserLocaleFile = new File(- project.rootDir,- 'storagechooser/src/main/res/values-' + locale + '/strings.xml'- )- def storageChooserLocaleKeys = storageChooserLocaleFile.isFile()- ? extractStringKeys(storageChooserLocaleFile.getText('UTF-8'))- : ([] as Set)- def missingStorageChooser = storageChooserKeys - storageChooserLocaleKeys-- if (!missingGeneral.isEmpty() || !missingPreferences.isEmpty() ||- !invalidArrays.isEmpty() || !missingStorageChooser.isEmpty()) {- throw new GradleException(- 'Launcher localization is incomplete for ' + locale +- '. Missing general keys: ' + missingGeneral.sort().join(', ') +- '. Missing preference keys: ' + missingPreferences.sort().join(', ') +- '. Missing/invalid arrays: ' + invalidArrays.sort().join(', ') +- '. Missing StorageChooser keys: ' + missingStorageChooser.sort().join(', ')- )- }- }-- def finalBloom = file('src/main/assets/android_omwfx/gateh_bloom051.omwfx')- .getText('UTF-8')- if (!finalBloom.contains('passes = nomipmap, horizontal, vertical, final;') ||- !finalBloom.contains('internal_format = rgb16f;') ||- !finalBloom.contains('source_type = half_float;') ||- !finalBloom.contains('uniform_float uThreshold {\n default = 0.30;') ||- !finalBloom.contains('uniform_float uSkyFactor {\n default = 0.60;') ||- !finalBloom.contains('uniform_float uRadius {\n default = 0.55;') ||- !finalBloom.contains('uniform_float uStrength {\n default = 0.35;')) {- throw new GradleException(- 'OpenMW 0.51 Android requires the calibrated four-pass Bloom shader.'- )- }-- def finalLensflare = file('src/main/assets/android_omwfx/lensflare_android_051_rayocc.omwfx')- .getText('UTF-8')- if (!finalLensflare.contains('vec4 viewDir = omw.viewMatrix * vec4(discDir, 0.0);') ||- !finalLensflare.contains('omw.sunVis * clamp(omw.sunOcclusion, 0.0, 1.0) * edgeFade051(sunUv)') ||- finalLensflare.contains('sunOcclusion(') ||- finalLensflare.contains('sunOcclusion051(') ||- finalLensflare.contains('omw_GetLinearDepth(') ||- finalLensflare.contains('omw_GetDepth(') ||- finalLensflare.contains('Disable_SunGlare') ||- !finalLensflare.contains('version = "2.1-051-rayocc";')) {- throw new GradleException(- 'OpenMW 0.51 Android requires the CPU-ray-occluded Lensflare shader.'- )- }-- def finalGodrays = file('src/main/assets/android_omwfx/godrays_android_051_depthfixed_vivid.omwfx')- .getText('UTF-8')- if (!finalGodrays.contains('uniform_float ray_strength {\n default = 0.60;') ||- !finalGodrays.contains('uniform_float ray_length {\n default = 0.85;') ||- !finalGodrays.contains('uniform_float sun_glow_strength {\n default = 0.65;') ||- !finalGodrays.contains('uniform_float direct_glare_strength {\n default = 0.48;') ||- !finalGodrays.contains('vec4 viewDir = omw.viewMatrix * vec4(discDir, 0.0);') ||- !finalGodrays.contains('clamp(omw.sunOcclusion, 0.0, 1.0)') ||- !finalGodrays.contains('float depth = omw_GetDepth(clamp(uv, vec2(0.001), vec2(0.999)));') ||- !finalGodrays.contains('return smoothstep(0.99970, 0.99999, depth);') ||- !finalGodrays.contains('float shaftContrast = smoothstep(0.08, 0.92, shafts);') ||- !finalGodrays.contains('shafts = mix(shafts, shaftContrast, 0.35);') ||- !finalGodrays.contains('light += warmColor * shaftIntensity * 0.78;') ||- !finalGodrays.contains('light += sunColor * directSun * direct_glare_strength * 0.60 * glowVisibility;') ||- finalGodrays.contains('direct_glare_strength * 0.80 * glowVisibility;') ||- !finalGodrays.contains('float directSun = 1.0 - smoothstep(0.035, 0.48, centerDistance);') ||- !finalGodrays.contains('for (int i = 0; i < 16; i += 1)') ||- finalGodrays.contains('omw_GetLinearDepth(') ||- finalGodrays.contains('Disable_SunGlare') ||- !finalGodrays.contains('version = "3.4-051-depthfixed-vivid-softglare";')) {- throw new GradleException(- 'OpenMW 0.51 Android requires the dynamic 16-tap Tex_Depth Godrays with 75-percent Direct Sun Glare.'- )- }-- def finalRainLens = file('src/main/assets/android_omwfx/rainlens_android_051_v12_dense.omwfx')- .getText('UTF-8')- if (!finalRainLens.contains('uniform_float rainlens_strength_v34 {\n default = 0.72;') ||- !finalRainLens.contains('uniform_float rainlens_refraction_v34 {\n default = 0.92;') ||- !finalRainLens.contains('uniform_float rainlens_density_v34 {\n default = 0.90;') ||- !finalRainLens.contains('float hash21051(vec2 p)') ||- !finalRainLens.contains('vec4 movingDrop051(') ||- !finalRainLens.contains('p.y += timeValue * speed;') ||- !finalRainLens.contains('float timeValue = omw.simulationTime;') ||- !finalRainLens.contains('float currentRain = rainForWeather051(omw.weatherID);') ||- !finalRainLens.contains('float nextRain = rainForWeather051(omw.nextWeatherID);') ||- !finalRainLens.contains('clamp(omw.weatherTransition, 0.0, 1.0)') ||- !finalRainLens.contains('vec4 drop = movingDrop051(') ||- !finalRainLens.contains('omw_TexCoord, 5.6, 0.215, 19.7, timeValue, wind, density') ||- !finalRainLens.contains('float threshold = mix(0.94, 0.72, clamp(density, 0.0, 1.0));') ||- !finalRainLens.contains('float refractionMix = clamp(mask * 0.82, 0.0, 0.82);') ||- !finalRainLens.contains('result += vec3(0.028) * drop.w * rain;') ||- !finalRainLens.contains('flags = Disable_Interiors, Disable_Underwater;') ||- !finalRainLens.contains('version = "4.3-051-rainlens-v12-dense";') ||- finalRainLens.contains('omw.simulationTime * 0.001') ||- finalRainLens.contains('rainHash3051(') ||- finalRainLens.contains('teardropLayer051(') ||- finalRainLens.contains('omw_GetDepth(') ||- finalRainLens.contains('omw_GetLinearDepth(')) {- throw new GradleException(- 'OpenMW 0.51 Android requires RainLens v1.2 geometry with the doubled drop population.'- )- }-- def finalWetWorld = file('src/main/assets/android_omwfx/wetworld_android_051_weather.omwfx')- .getText('UTF-8')- if (!finalWetWorld.contains('uniform_float wet_strength_v35 {\n default = 0.92;') ||- !finalWetWorld.contains('uniform_float wet_darkening_v35 {\n default = 0.30;') ||- !finalWetWorld.contains('uniform_float wet_sheen_v35 {\n default = 0.34;') ||- !finalWetWorld.contains('uniform_float puddle_strength_v35 {\n default = 0.62;') ||- !finalWetWorld.contains('float rainFactor051()') ||- !finalWetWorld.contains('float valueNoise051(vec2 p)') ||- !finalWetWorld.contains('vec3 reconstructedViewPos051(vec2 uv)') ||- !finalWetWorld.contains('vec3 reconstructedWorldNormal051(vec2 uv)') ||- !finalWetWorld.contains('vec3 dxForward = pR - p;') ||- !finalWetWorld.contains('vec3 nWorld = (omw.invViewMatrix * vec4(nView, 0.0)).xyz;') ||- !finalWetWorld.contains('float upFacing = smoothstep(0.30, 0.76, abs(n.z));') ||- !finalWetWorld.contains('float puddleMask = smoothstep(0.56, 0.76, puddleField)') ||- !finalWetWorld.contains('if (base.a < 0.25)') ||- !finalWetWorld.contains('flags = Disable_Interiors, Disable_Underwater;') ||- !finalWetWorld.contains('version = "5.1-051-weather-puddles-mali-safe";') ||- finalWetWorld.contains('dFdx(') ||- finalWetWorld.contains('dFdy(') ||- finalWetWorld.contains('sin(')) {- throw new GradleException(- 'OpenMW 0.51 Android requires the GLES2-safe weather WetWorld/puddle shader.'- )- }-- def finalWaterVertex = file('src/main/assets/libopenmw/resources/shaders/compatibility/water.vert')- .getText('UTF-8')- def finalWaterShader = file('src/main/assets/libopenmw/resources/shaders/compatibility/water.frag')- .getText('UTF-8')- if (!finalWaterVertex.contains('OPENMW_ANDROID_051_WATER_PROJECTIVE_SCREEN_COORDS') ||- !finalWaterVertex.contains('screenPosition = gl_Position;') ||- !finalWaterShader.contains('OPENMW_ANDROID_051_WATER_PROJECTIVE_SCREEN_COORDS') ||- !finalWaterShader.contains('(screenPosition.xy / screenPosition.w) * 0.5 + 0.5') ||- finalWaterShader.contains('gl_FragCoord.xy / screenRes') ||- !finalWaterShader.contains('OPENMW_ANDROID_051_WETWORLD_WATER_MASK') ||- !finalWaterShader.contains('#if @wetWorldWaterMask') ||- !finalWaterShader.contains('gl_FragData[0].a = 0.0;') ||- !finalWaterShader.contains('rainCombined(position.xy/1000.0, waterTimer)')) {- throw new GradleException(- 'OpenMW 0.51 Android requires resolution-independent water reflection UVs plus exact WetWorld water exclusion.'- )- }-- def runtimePatcher = new File(project.rootDir, 'buildscripts/patches/openmw051-final/apply-android-runtime-baseline.py')- def runtimePatcherText = runtimePatcher.isFile() ? runtimePatcher.getText('UTF-8') : ''- if (!runtimePatcherText.contains('OPENMW_ANDROID_051_CPU_SUN_OCCLUSION') ||- !runtimePatcherText.contains('OPENMW_ANDROID_051_POSTPROCESSING_SCENE_DEPTH') ||- !runtimePatcherText.contains('setTextureDepth(getTexture(Tex_Depth, frameId))') ||- !runtimePatcherText.contains('OPENMW_ANDROID_051_WETWORLD_WATER_MASK') ||- !runtimePatcherText.contains('defineMap["wetWorldWaterMask"] = "1";') ||- !runtimePatcherText.contains("release_log_marker = 'OpenMW 0.51 Android renderer:'") ||- !runtimePatcherText.contains('CPU sun-occlusion diagnostic logging was not removed') ||- !runtimePatcherText.contains('repetitive shadow diagnostic was not removed')) {- throw new GradleException('OpenMW 0.51 Android requires the permanent renderer patches and final release-log cleanup.')- }-- // The final release intentionally carries only the small GLSL syntax corrections- // that are independently safe on the 0.51 shader architecture.- def fullscreenShader = file('src/main/assets/libopenmw/resources/shaders/compatibility/fullscreen_tri.vert').getText('UTF-8')- def shadowShader = file('src/main/assets/libopenmw/resources/shaders/compatibility/shadowcasting.vert').getText('UTF-8')- def debugVert = file('src/main/assets/libopenmw/resources/shaders/compatibility/debug.vert').getText('UTF-8')- def debugFrag = file('src/main/assets/libopenmw/resources/shaders/compatibility/debug.frag').getText('UTF-8')- def shadowVertexShader = file('src/main/assets/libopenmw/resources/shaders/compatibility/shadows_vertex.glsl').getText('UTF-8')- def shadowFragmentShader = file('src/main/assets/libopenmw/resources/shaders/compatibility/shadows_fragment.glsl').getText('UTF-8')-- // OPENMW_ANDROID_051_GRAZING_SHADOW_PAIR_BUILD_GATE_V2- if (!shadowVertexShader.contains('OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V1') ||- !shadowFragmentShader.contains('OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V1') ||- !shadowVertexShader.contains('varying vec2 shadowReceiverPlaneSlope@shadow_texture_unit_index;') ||- !shadowFragmentShader.contains('varying vec2 shadowReceiverPlaneSlope@shadow_texture_unit_index;')) {- throw new GradleException(- 'OpenMW Android grazing-angle shadow include pair is incomplete or mismatched.'- )- }-- if (fullscreenShader.contains('uniform vec2 scaling =') ||- shadowShader.contains('uniform bool useDiffuseMapForShadowAlpha =') ||- shadowShader.contains('uniform bool alphaTestShadows =') ||- debugVert.contains('uniform bool useAdvancedShader =') ||- debugFrag.contains('uniform bool useAdvancedShader =')) {- throw new GradleException(- 'OpenMW 0.51 runtime gate is missing the minimal Android/GL4ES uniform-initializer patch.\n' +- 'Re-run tools\\build-openmw-051-runtime.ps1.'- )- }-- // Keep the proven Android GLES2 one-map shadow baseline active and- // require the quality-dependent PCF receiver used by the launcher. The- // bundled asset is intentionally the Medium profile; MainActivity- // specializes only the two guarded constants before each game start.- if (!shadowFragmentShader.contains('OPENMW_ANDROID_051_GLES2_MANUAL_SHADOW_COMPARE') ||- !shadowFragmentShader.contains('OPENMW_ANDROID_051_GLES2_QUALITY_PCF') ||- !shadowFragmentShader.contains('#define OPENMW_ANDROID_SHADOW_PCF_LEVEL 2') ||- !shadowFragmentShader.contains('#define OPENMW_ANDROID_SHADOW_MAP_RESOLUTION 4096.0') ||- !shadowFragmentShader.contains('uniform sampler2D shadowTexture@shadow_texture_unit_index;') ||- !shadowFragmentShader.contains('OPENMW_ANDROID_051_GLES2_RECEIVER_DEPTH_BIAS') ||- !shadowFragmentShader.contains('float receiverDepth = max(shadowXYZ.z - 0.00005, 0.0);') ||- // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3_BUILD_GATE- // V1/V2 compare directly against receiverDepth. V3 reconstructs- // receiver depth at the actual shadow texel centre first, so- // anchorReceiverDepth is the correct comparison variable.- (!shadowFragmentShader.contains('step(receiverDepth, texture2D(') &&- !shadowFragmentShader.contains('step(anchorReceiverDepth, texture2D(')) ||- !shadowFragmentShader.contains('pcfShadow * 0.25') ||- !shadowFragmentShader.contains('pcfShadow * (1.0 / 9.0)') ||- !shadowFragmentShader.contains('pcfShadow * (1.0 / 64.0)') ||- !shadowFragmentShader.contains('OPENMW_ANDROID_051_GLES2_TENT_PCF') ||- shadowFragmentShader.contains('uniform sampler2DShadow') ||- shadowFragmentShader.contains('shadow2DProj(') ||- !shadowShader.contains('OPENMW_ANDROID_051_GLES2_NATIVE_SHADOW_CLIPPING') ||- shadowShader.contains('gl_Position.z = clamp(gl_Position.z, -gl_Position.w, gl_Position.w);')) {- throw new GradleException(- 'OpenMW 0.51 Android GLES2 shadow/quality-PCF payload is incomplete.\n' +- 'Restore the final Android shadow receiver before assembling the APK.'- )- }- }-}---// ------------------------------------------------------------------------------// OMWFX post-processing package-// ------------------------------------------------------------------------------// Keep third-party shader sources out of this patch ZIP itself. The first build-// downloads the upstream package once, stores the archive in project/.gradle,-// then generates an Android asset overlay. A normal `clean` removes only the-// generated copy; the cached archive remains available for offline rebuilds.-def omwfxSourceUrl =- 'https://gitlab.com/glassmancody.info/omwfx-shaders/-/archive/main/omwfx-shaders-main.zip'-def omwfxCacheDir = new File(rootProject.projectDir, '.gradle/openmw-omwfx')-def omwfxArchive = new File(omwfxCacheDir, 'omwfx-shaders-main.zip')-def omwfxGeneratedAssetsDir = new File(buildDir, 'generated/omwfxAssets')-def omwfxGeneratedVfsDir =- new File(omwfxGeneratedAssetsDir, 'libopenmw/resources/vfs')--tasks.register('prepareOmwfxShaders') {- group = 'openmw'- description = 'Downloads/caches OMWFX and prepares its shaders as generated APK assets.'-- inputs.property('omwfxSourceUrl', omwfxSourceUrl)- outputs.dir(omwfxGeneratedAssetsDir)-- doLast {- omwfxCacheDir.mkdirs()-- def downloadArchive = {- def tempArchive = new File(omwfxCacheDir, 'omwfx-shaders-main.zip.part')- tempArchive.delete()-- logger.lifecycle('OpenMW: downloading OMWFX shaders (one-time cache)...')- def connection = new URL(omwfxSourceUrl).openConnection()- connection.setConnectTimeout(20000)- connection.setReadTimeout(120000)- connection.setRequestProperty('User-Agent', 'OpenMW-Android-v12')-- connection.getInputStream().withCloseable { input ->- tempArchive.withOutputStream { output ->- byte[] buffer = new byte[64 * 1024]- int count- while ((count = input.read(buffer)) >= 0) {- if (count > 0) {- output.write(buffer, 0, count)- }- }- }- }-- if (!tempArchive.isFile() || tempArchive.length() < 1024) {- tempArchive.delete()- throw new GradleException(- 'OMWFX download produced an invalid archive: ' + omwfxSourceUrl- )- }-- if (omwfxArchive.exists() && !omwfxArchive.delete()) {- tempArchive.delete()- throw new GradleException('Could not replace cached OMWFX archive: ' + omwfxArchive)- }-- if (!tempArchive.renameTo(omwfxArchive)) {- tempArchive.delete()- throw new GradleException('Could not finalize cached OMWFX archive: ' + omwfxArchive)- }- }-- if (!omwfxArchive.isFile() || omwfxArchive.length() < 1024) {- downloadArchive()- }-- project.delete(omwfxGeneratedAssetsDir)- omwfxGeneratedVfsDir.mkdirs()-- def extractArchive = {- int extractedFiles = 0- int extractedOmwfx = 0-- new java.util.zip.ZipInputStream(- new BufferedInputStream(new FileInputStream(omwfxArchive))- ).withCloseable { zip ->- java.util.zip.ZipEntry entry-- while ((entry = zip.nextEntry) != null) {- def normalized = entry.name.replace('\\', '/')- def shaderMarker = normalized.indexOf('/shaders/')-- if (shaderMarker >= 0) {- // Strip the archive's top-level directory but retain the- // complete "shaders/..." tree expected by OpenMW's VFS.- def relative = normalized.substring(shaderMarker + 1)-- if (!entry.isDirectory()) {- // Avoid duplicate asset paths when OpenMW itself- // already ships a shader/resource with the same name.- def bundledFile =- file('src/main/assets/libopenmw/resources/vfs/' + relative)-- if (!bundledFile.exists()) {- def destination = new File(omwfxGeneratedVfsDir, relative)- def canonicalRoot = omwfxGeneratedVfsDir.canonicalFile- def canonicalDestination = destination.canonicalFile-- if (!canonicalDestination.path.startsWith(- canonicalRoot.path + File.separator)) {- throw new GradleException(- 'Unsafe path in OMWFX archive: ' + entry.name- )- }-- destination.parentFile.mkdirs()- destination.withOutputStream { output ->- byte[] buffer = new byte[64 * 1024]- int count- while ((count = zip.read(buffer)) > 0) {- output.write(buffer, 0, count)- }- }-- extractedFiles++- if (relative.toLowerCase(Locale.ROOT).endsWith('.omwfx')) {- extractedOmwfx++- }- }- }- }-- zip.closeEntry()- }- }-- if (extractedOmwfx == 0) {- throw new GradleException(- 'The cached OMWFX archive did not contain any usable .omwfx shaders.'- )- }-- def marker = new File(omwfxGeneratedVfsDir, 'omwfx-android-preset.txt')- marker.text =- 'OpenMW Android OMWFX preset v12\n' +- 'Source: ' + omwfxSourceUrl + '\n' +- 'Generated .omwfx files: ' + extractedOmwfx + '\n' +- 'Generated total files: ' + extractedFiles + '\n'-- logger.lifecycle(- "OpenMW: prepared OMWFX assets (${extractedOmwfx} .omwfx files, " +- "${extractedFiles} total generated files)."- )- }-- try {- extractArchive()- } catch (Exception firstFailure) {- // A stale/corrupt partial cache should never permanently poison- // future builds. Re-download once and retry extraction.- logger.warn('OpenMW: cached OMWFX archive is unusable; downloading it again.')- project.delete(omwfxGeneratedAssetsDir)- omwfxArchive.delete()- downloadArchive()- omwfxGeneratedVfsDir.mkdirs()- extractArchive()- }- }-}--android {- // Keep the historical source namespace for now. It controls generated R and- // BuildConfig classes, not the installed Android package/application ID.- // Changing it would require unrelated package/import churn across the launcher.- namespace 'com.libopenmw.openmw'-- compileSdk 35- ndkVersion '26.1.10909125'-- sourceSets {- main {- resources {- srcDir "wrap/res"- }-- // Do not merge the generated upstream OMWFX VFS overlay.- // MainActivity exposes only the calibrated- // WetWorld, Godrays, Lensflare, Bloom and RainLens assets at runtime.- }- }-- defaultConfig {- // Both flavors intentionally use the same installed package name. Google Play- // can therefore serve the appropriate artifact per form factor while the- // shared OpenMW user-data path remains stable.- applicationId "tf.pw.isowind"-- versionCode openMwVersionCode- versionName calculateVersion()-- minSdk 21-- ndk {- abiFilters "arm64-v8a"- }- }-- buildFeatures {- buildConfig true- }-- lint {- checkReleaseBuilds false- }-- compileOptions {- sourceCompatibility JavaVersion.VERSION_17- targetCompatibility JavaVersion.VERSION_17- }-- kotlinOptions {- jvmTarget = '17'- }-- // Isowind: every build signed with the same debug key (app/isowind-debug.keystore), so a new APK installs over- // the last one and keeps the player's data; the key Gradle makes on each fresh CI runner would need an uninstall- signingConfigs {- debug {- storeFile file('isowind-debug.keystore')- storePassword 'android'- keyAlias 'androiddebugkey'- keyPassword 'android'- }- }-- buildTypes {- release {- minifyEnabled false- }-- debug {- // Deliberately no applicationIdSuffix. Debug and release both use- // com.ast.openmw, so Android gives both the same app-specific data path.- debuggable true- }- }-- // Keep the historical "mainline" flavor as the normal Android flavor.- // This preserves the existing Android Studio run variant (mainlineDebug)- // instead of replacing it with a newly named mobileDebug variant.- // Automotive is an additional release-only target for Google Play AAOS.- flavorDimensions += "platform"-- productFlavors {- mainline {- dimension "platform"- targetSdk 29- buildConfigField "boolean", "IS_AUTOMOTIVE_BUILD", "false"- }-- automotive {- dimension "platform"- targetSdk 35- // Keep Play version codes unique when Mainline and Automotive artifacts- // are uploaded under the same com.ast.openmw application ID.- versionCode openMwVersionCode + 100000- buildConfigField "boolean", "IS_AUTOMOTIVE_BUILD", "true"- }- }-- packaging {- jniLibs {- useLegacyPackaging = true- }- }-}--// There is no useful local Automotive debug deployment for this project:-// the Renault/AAOS build is delivered through the Google Play Automotive track.-// Disable automotiveDebug so Android Studio's green Run button can only select-// the established mainlineDebug variant and cannot accidentally replace it.-androidComponents {- beforeVariants(selector().withBuildType("debug")) { variantBuilder ->- if (variantBuilder.productFlavors.any { flavor -> flavor.second == "automotive" }) {- variantBuilder.enable = false- }- }-}--// Isowind: verifyOpenMwPayload pins upstream's own libopenmw.so build, which Isowind's engine never matches; not run.--dependencies {- implementation 'androidx.appcompat:appcompat:1.3.1'- implementation 'com.google.android.material:material:1.4.0'- implementation 'androidx.recyclerview:recyclerview:1.2.1'-- implementation project(':storagechooser')-- implementation 'com.bugsnag:bugsnag-android-ndk:4.22.3'-- testImplementation 'junit:junit:4.13.2'-}diff --git a/android/app/isowind-debug.keystore b/android/app/isowind-debug.keystoredeleted file mode 100644index c20c0e1..0000000Binary files a/android/app/isowind-debug.keystore and /dev/null differdiff --git a/android/app/lint.xml b/android/app/lint.xmldeleted file mode 100644index 3d35aa7..0000000--- a/android/app/lint.xml+++ /dev/null@@ -1,4 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<lint>- <issue id="NewApi" severity="ignore" />-</lint>\ No newline at end of filediff --git a/android/app/openmw.base.cfg b/android/app/openmw.base.cfgdeleted file mode 100644index 519f463..0000000--- a/android/app/openmw.base.cfg+++ /dev/null@@ -1,3 +0,0 @@-no-sound=0-encoding=win1252-user-data="?userdata?"diff --git a/android/app/src/automotive/AndroidManifest.xml b/android/app/src/automotive/AndroidManifest.xmldeleted file mode 100644index f224b8c..0000000--- a/android/app/src/automotive/AndroidManifest.xml+++ /dev/null@@ -1,25 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<manifest xmlns:android="http://schemas.android.com/apk/res/android">-- <!-- This feature is present only in the Automotive flavor so Google Play- routes the AAB exclusively through the Android Automotive OS form factor. -->- <uses-feature- android:name="android.hardware.type.automotive"- android:required="true" />-- <!-- Do not exclude AAOS head units that do not advertise these input/display- features in the same way as phones/tablets. -->- <uses-feature- android:name="android.hardware.gamepad"- android:required="false" />- <uses-feature- android:name="android.hardware.touchscreen"- android:required="false" />- <uses-feature- android:name="android.hardware.screen.landscape"- android:required="false" />- <uses-feature- android:name="android.hardware.screen.portrait"- android:required="false" />--</manifest>diff --git a/android/app/src/automotive/res/values/themes.xml b/android/app/src/automotive/res/values/themes.xmldeleted file mode 100644index 67de00a..0000000--- a/android/app/src/automotive/res/values/themes.xml+++ /dev/null@@ -1,13 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<resources>- <!-- AAOS/openR link owns its system bars. Keep the SDL surface opaque and- titleless, but do not request Android fullscreen in this flavor. -->- <style name="Theme.AppCompat.FullScreen" parent="@style/Theme.AppCompat">- <item name="android:windowNoTitle">true</item>- <item name="android:windowFullscreen">false</item>- <item name="android:windowBackground">@android:color/black</item>- <item name="android:colorBackground">@android:color/black</item>- <item name="android:windowIsTranslucent">false</item>- <item name="android:windowDisablePreview">true</item>- </style>-</resources>diff --git a/android/app/src/main/.gitignore b/android/app/src/main/.gitignoredeleted file mode 100644index 43a7c30..0000000--- a/android/app/src/main/.gitignore+++ /dev/null@@ -1,2 +0,0 @@-gdb.exec-jnidiff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xmldeleted file mode 100644index 3e2eef7..0000000--- a/android/app/src/main/AndroidManifest.xml+++ /dev/null@@ -1,128 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<manifest xmlns:android="http://schemas.android.com/apk/res/android"- xmlns:tools="http://schemas.android.com/tools">-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />- <uses-permission android:name="android.permission.INTERNET" />-- <uses-feature android:name="android.hardware.gamepad" android:required="false" />--<application- android:appCategory="game"- android:name="utils.MyApp"- android:allowBackup="true"- android:hardwareAccelerated="true"- android:icon="@mipmap/ic_launcher"- android:roundIcon="@mipmap/ic_launcher_round"- android:label="@string/app_name"- android:requestLegacyExternalStorage="true"- android:theme="@style/MyTheme"- tools:ignore="GoogleAppIndexingWarning">-- <activity- android:name="ui.activity.MainActivity"- android:configChanges="keyboardHidden|orientation|screenSize"- android:exported="true"- android:label="@string/app_name"- android:screenOrientation="fullUser">- <intent-filter>- <action android:name="android.intent.action.MAIN" />- <category android:name="android.intent.category.LAUNCHER" />- </intent-filter>- </activity>-- <activity- android:name="ui.activity.GameActivity"- android:configChanges="keyboardHidden|orientation"- android:screenOrientation="sensorLandscape"- android:theme="@style/Theme.AppCompat.FullScreen" />-- <activity- android:name="ui.activity.ConfigureControls"- android:configChanges="keyboardHidden|orientation"- android:screenOrientation="sensorLandscape"- android:theme="@style/Theme.AppCompat.FullScreen" />-- <activity- android:name="ui.activity.ModsActivity"- android:configChanges="keyboardHidden|orientation|screenSize"- android:exported="false"- android:label="@string/activity_mods"- android:screenOrientation="fullUser"- android:theme="@style/MyTheme" />-- <activity- android:name="ui.activity.SettingsActivity"- android:configChanges="keyboardHidden|orientation|screenSize"- android:exported="false"- android:label="@string/activity_settings"- android:screenOrientation="fullUser"- android:theme="@style/MyTheme" />-- <activity- android:name="ui.activity.Game_Mechanics_SettingsActivity"- android:configChanges="keyboardHidden|orientation|screenSize"- android:exported="false"- android:label="@string/game_mechanics_activity_settings"- android:screenOrientation="fullUser"- android:theme="@style/MyTheme" />-- <activity- android:name="ui.activity.Visuals_SettingsActivity"- android:configChanges="keyboardHidden|orientation|screenSize"- android:exported="false"- android:label="@string/visuals_activity_settings"- android:screenOrientation="fullUser"- android:theme="@style/MyTheme" />-- <activity- android:name="ui.activity.Shadows_SettingsActivity"- android:configChanges="keyboardHidden|orientation|screenSize"- android:exported="false"- android:label="@string/shadows_activity_settings"- android:screenOrientation="fullUser"- android:theme="@style/MyTheme" />-- <activity- android:name="ui.activity.Animations_SettingsActivity"- android:configChanges="keyboardHidden|orientation|screenSize"- android:exported="false"- android:label="@string/animations_activity_settings"- android:screenOrientation="fullUser"- android:theme="@style/MyTheme" />-- <activity- android:name="ui.activity.Interface_SettingsActivity"- android:configChanges="keyboardHidden|orientation|screenSize"- android:exported="false"- android:label="@string/interface_activity_settings"- android:screenOrientation="fullUser"- android:theme="@style/MyTheme" />-- <activity- android:name="ui.activity.Bug_Fixes_SettingsActivity"- android:configChanges="keyboardHidden|orientation|screenSize"- android:exported="false"- android:label="@string/bug_fixes_activity_settings"- android:screenOrientation="fullUser"- android:theme="@style/MyTheme" />-- <activity- android:name="ui.activity.Miscellaneous_SettingsActivity"- android:configChanges="keyboardHidden|orientation|screenSize"- android:exported="false"- android:label="@string/miscellaneous_activity_settings"- android:screenOrientation="fullUser"- android:theme="@style/MyTheme" />-- <activity- android:name="ui.activity.Engine_SettingsActivity"- android:configChanges="keyboardHidden|orientation|screenSize"- android:exported="false"- android:label="@string/engine_activity_settings"- android:screenOrientation="fullUser"- android:theme="@style/MyTheme" />-- </application>-</manifest>diff --git a/android/app/src/main/assets/android_omwfx/gateh_bloom051.omwfx b/android/app/src/main/assets/android_omwfx/gateh_bloom051.omwfxdeleted file mode 100644index 934586c..0000000--- a/android/app/src/main/assets/android_omwfx/gateh_bloom051.omwfx+++ /dev/null@@ -1,223 +0,0 @@-uniform_float uGamma {- default = 2.2;- min = 0.1;- max = 4.0;- step = 0.01;- display_name = "#{OMWShaders:GammaLevelName}";- description = "#{OMWShaders:GammaLevelDescription}";-}-uniform_float uThreshold {- default = 0.30;- min = 0.0;- max = 1.0;- step = 0.01;- display_name = "#{OMWShaders:BloomThresholdLevelName}";- description = "#{OMWShaders:BloomThresholdLevelDescription}";-}-uniform_float uClamp {- default = 1.0;- min = 0.0;- max = 1.0;- step = 0.01;- display_name = "#{OMWShaders:BloomClampLevelName}";- description = "#{OMWShaders:BloomClampLevelDescription}";-}-uniform_float uSkyFactor {- default = 0.60;- min = 0.0;- max = 2.0;- step = 0.01;- display_name = "#{OMWShaders:SkyFactorLevelName}";- description = "#{OMWShaders:SkyFactorLevelDescription}";-}-uniform_float uRadius {- default = 0.55;- min = 0.0;- max = 1.0;- step = 0.01;- display_name = "#{OMWShaders:RadiusLevelName}";- description = "#{OMWShaders:RadiusLevelDescription}";-}-uniform_float uStrength {- default = 0.35;- min = 0.0;- max = 1.0;- step = 0.01;- display_name = "#{OMWShaders:StrengthLevelName}";- description = "#{OMWShaders:StrengthLevelDescription}";-}--shared {- float scramblify(float x)- {- x = fract(x);- x = x + 4.0;- x = x*x;- x = x*x;- return fract(x);- }- float scramblev2_inner(vec2 v, float z)- {- return scramblify(v.x*0.6491 + v.y*0.029 + z);- }-- float time = fract(omw.simulationTime);- vec4 scramblev2(vec2 v)- {- v *= 61.12;- vec2 fwup = vec2(scramblev2_inner(v, fract(time)), scramblev2_inner(v, fract(time*fract(v.x)) + 0.18943));- return vec4(0.5) - vec4(fwup, fwup);- }-- float gauss(float x)- {- return exp(-x*x);- }- float calculate_radius(vec2 texcoord)- {- float radius = uRadius * 0.2;- radius *= omw.resolution.y;- radius = max(radius, 0.1);- // hack: make the radius wider on the screen edges- // (makes things in the corner of the screen look less "wrong" with not-extremely-low FOVs)- texcoord = texcoord * 2.0 - vec2(1.0);- radius *= texcoord.x * texcoord.x + 1.0;- radius *= texcoord.y * texcoord.y + 1.0;- return radius;- }- vec3 powv(vec3 a, float x)- {- return pow(a, vec3(x));- }-}--render_target RT_NoMipmap {- width_ratio = 0.25;- height_ratio = 0.25;- internal_format = rgb16f;- source_type = half_float;- source_format = rgb;- mipmaps = false;- min_filter = nearest;- mag_filter = nearest;-}--render_target RT_Horizontal {- width_ratio = 0.25;- height_ratio = 0.25;- internal_format = rgb16f;- source_type = half_float;- source_format = rgb;- mipmaps = false;- min_filter = nearest;- mag_filter = nearest;-}--render_target RT_Vertical {- width_ratio = 0.25;- height_ratio = 0.25;- internal_format = rgb16f;- source_type = half_float;- source_format = rgb;- mipmaps = false;- min_filter = linear;- mag_filter = linear;-}--fragment nomipmap(target=RT_NoMipmap) {- omw_In vec2 omw_TexCoord;-- void main()- {- // downsample into a smaller buffer with mipmapping disabled (no need for it + might interfere with the blurring process)- // do the gamma compression step while we're at it- vec3 sample = omw_GetLastShader(omw_TexCoord).rgb;- bool is_sky = (omw_GetLinearDepth(omw_TexCoord) > omw.far*0.999);- float factor = is_sky ? uSkyFactor : 1.0;- vec3 ret_sample = powv(sample, uGamma);- factor *= (!is_sky && (dot(sample, vec3(1.0/3.0)) < uThreshold)) ? 0.0 : 1.0;- ret_sample *= factor;- omw_FragColor = vec4(ret_sample, 1.0);- }-}--fragment horizontal(target=RT_Horizontal, rt1=RT_NoMipmap) {- omw_In vec2 omw_TexCoord;-- void main()- {- // gaussian blur, horizontal step- float radius = calculate_radius(omw_TexCoord);- int radius_i = int(ceil(radius));- vec3 sum = vec3(0.0);- float normalize = 0.0;- for(int x = -radius_i; x <= radius_i; x += 1)- {- float strength = gauss(float(x)/radius*2.0);- normalize += strength;- vec2 coord = omw_TexCoord + vec2(float(x), 0.0) / omw.resolution.xy;- vec3 sample = omw_Texture2D(RT_NoMipmap, coord).rgb;- sum += strength * sample;- }- sum /= normalize;-- omw_FragColor = vec4(sum, 1.0);- }-}--fragment vertical(target=RT_Vertical, rt1=RT_Horizontal) {- omw_In vec2 omw_TexCoord;-- void main()- {- // gaussian blur, vertical step- float radius = calculate_radius(omw_TexCoord);- int radius_i = int(ceil(radius));- vec3 sum = vec3(0.0);- float normalize = 0.0;- for(int y = -radius_i; y <= radius_i; y += 1)- {- float strength = gauss(float(y)/radius*2.0);- normalize += strength;- vec2 coord = omw_TexCoord + vec2(0.0, float(y)) / omw.resolution.xy;- vec3 sample = omw_Texture2D(RT_Horizontal, coord).rgb;- sum += strength * sample;- }- sum /= normalize;-- omw_FragColor = vec4(sum, 1.0);- }-}--fragment final(rt1=RT_Vertical) {- omw_In vec2 omw_TexCoord;-- void main()- {- vec3 color = omw_Texture2D(RT_Vertical, omw_TexCoord).rgb;- // add dithering (in gamma-compressed light, because monitors are sRGB)- color = powv(color, 1.0/uGamma);- color += (scramblev2(omw_TexCoord).rgb/255.0 - vec3(0.5/255.0))*2.0;- color = max(vec3(0.0), color);- // also do clamping in gamma-compressed light- float color_luma = dot(color, vec3(1.0/3.0));- if(uClamp == 0.0)- color *= 0.0;- else if(color_luma > uClamp)- color /= color_luma/uClamp;- color = powv(color, uGamma);-- // add bloom to base color in linear light- vec3 base_color = powv(omw_GetLastShader(omw_TexCoord).rgb, uGamma);- vec3 add_color = base_color + color * uStrength * 0.5;- omw_FragColor = vec4(powv(add_color, 1.0/uGamma), 1.0);- }-}--technique {- passes = nomipmap, horizontal, vertical, final;- description = "#{OMWShaders:BloomDescription}";- author = "OpenMW";- version = "1.0";-}-diff --git a/android/app/src/main/assets/android_omwfx/godrays_android_051_depthfixed_vivid.omwfx b/android/app/src/main/assets/android_omwfx/godrays_android_051_depthfixed_vivid.omwfxdeleted file mode 100644index 82e6d88..0000000--- a/android/app/src/main/assets/android_omwfx/godrays_android_051_depthfixed_vivid.omwfx+++ /dev/null@@ -1,180 +0,0 @@-uniform_float ray_strength {- default = 0.60;- min = 0.0;- max = 1.0;- step = 0.01;- display_name = "Godray strength";- description = "Strength of the dynamic scene-depth light shafts around the visible sun.";-}--uniform_float ray_length {- default = 0.85;- min = 0.10;- max = 1.0;- step = 0.02;- display_name = "Godray length";- description = "How far the dynamic shafts extend from the sun toward the screen.";-}--uniform_float sun_glow_strength {- default = 0.65;- min = 0.0;- max = 1.5;- step = 0.01;- display_name = "Sun glow strength";- description = "Strength of the broad glow surrounding the visible sun.";-}--uniform_float direct_glare_strength {- default = 0.48;- min = 0.0;- max = 1.5;- step = 0.01;- display_name = "Direct sun glare";- description = "Full-screen glare when looking directly toward the visible sun.";-}--shared {- vec3 getSunView051Dynamic()- {- // Patch-22/Patch-26 device-proven visual sun-disc projection. Using- // w=0 keeps camera translation out of the direction transform.- vec3 disc = omw.sunPos.xyz;- float discLength = length(disc);- if (omw.sunPos.z <= 0.0 || discLength < 0.0001)- return vec3(0.5, 0.5, 0.0);-- vec3 discDir = disc / discLength;- vec4 viewDir = omw.viewMatrix * vec4(discDir, 0.0);- vec4 clip = omw.projectionMatrix * viewDir;-- float valid = 1.0;- if (abs(clip.w) < 0.0001 || clip.w <= 0.0)- valid = 0.0;-- float safeW = max(abs(clip.w), 0.0001);- vec2 uv = clip.xy / safeW;- uv = uv * 0.5 + 0.5;- return vec3(uv, valid);- }-- float edgeFade051Dynamic(vec2 uv)- {- float x = smoothstep(-0.18, 0.03, uv.x) * (1.0 - smoothstep(0.97, 1.18, uv.x));- float y = smoothstep(-0.18, 0.03, uv.y) * (1.0 - smoothstep(0.97, 1.18, uv.y));- return x * y;- }-- float aspectDistance051Dynamic(vec2 uv, vec2 center, float aspect)- {- vec2 d = uv - center;- d.x *= aspect;- return length(d);- }-}--fragment main {- omw_In vec2 omw_TexCoord;-- float dynamicSkyVisibility051(vec2 uv)- {- // Patch 29 restores the proven Android Tex_Depth binding. Use the raw- // scene depth just like the official multi-pass OMWFX Godrays: cleared- // sky is at 1.0 while current-frame geometry is below it. A narrow- // smooth band avoids hard Adreno sampling stripes at silhouette edges.- float depth = omw_GetDepth(clamp(uv, vec2(0.001), vec2(0.999)));- return smoothstep(0.99970, 0.99999, depth);- }-- void main()- {- vec4 base = omw_GetLastShader(omw_TexCoord);- vec3 sunView = getSunView051Dynamic();-- if (sunView.z < 0.5 || omw.sunVis <= 0.001)- {- omw_FragColor = base;- return;- }-- vec2 sunUv = sunView.xy;- float edgeVisibility = omw.sunVis * edgeFade051Dynamic(sunUv);- if (edgeVisibility <= 0.001)- {- omw_FragColor = base;- return;- }-- float aspect = omw.resolution.x / max(omw.resolution.y, 1.0);- vec2 toSun = sunUv - omw_TexCoord;- vec2 aspectFromSun = omw_TexCoord - sunUv;- aspectFromSun.x *= aspect;- float sunDistance = length(aspectFromSun);-- // Sixteen independent depth samples recreate the dynamic 0.50 shaft- // mask. As a branch, actor, creature, or flying object moves through a- // sample line, the weighted average changes continuously and reshapes- // the corresponding ray instead of toggling a fixed ray texture.- float shafts = 0.0;- float decay = 1.0;- float decaySum = 0.0;- for (int i = 0; i < 16; i += 1)- {- float t = float(i + 1) / 16.0;- vec2 sampleUv = omw_TexCoord + toSun * (t * ray_length);- shafts += dynamicSkyVisibility051(sampleUv) * decay;- decaySum += decay;- decay *= 0.94;- }- shafts /= max(decaySum, 0.0001);-- // Patch 30 keeps the proven Tex_Depth mask and sample count, but gives- // it a modest S-curve. Bright shaft regions become clearer while the- // gaps cast by branches and actors remain dark and well defined.- float shaftContrast = smoothstep(0.08, 0.92, shafts);- shafts = mix(shafts, shaftContrast, 0.35);-- float rayEnvelope = smoothstep(0.018, 0.12, sunDistance)- * (1.0 - smoothstep(0.24, 1.22, sunDistance));-- // Match the useful 0.50 behaviour: a centre blocker removes the broad- // glare, but a small residual ray budget remains so silhouettes can- // still form crepuscular shafts around trees, rocks, and actors. A- // wall covering the sampled region still drives the depth mask to 0.- float cpuVisibility = clamp(omw.sunOcclusion, 0.0, 1.0);- float shaftOcclusion = 0.28 + cpuVisibility * 0.72;- float shaftIntensity = shafts * rayEnvelope * edgeVisibility- * shaftOcclusion * ray_strength * 1.08;-- float innerGlow = 1.0 - smoothstep(0.015, 0.18, sunDistance);- float broadGlow = 1.0 - smoothstep(0.05, 0.72, sunDistance);-- float centerDistance = aspectDistance051Dynamic(sunUv, vec2(0.5), aspect);- float directSun = 1.0 - smoothstep(0.035, 0.48, centerDistance);- directSun *= directSun;-- vec3 sunColor = max(omw.sunColor.rgb, vec3(0.08));- vec3 warmColor = sunColor * vec3(1.00, 0.90, 0.72);- float glowVisibility = edgeVisibility * cpuVisibility;-- vec3 light = vec3(0.0);- light += warmColor * shaftIntensity * 0.78;- light += sunColor * broadGlow * sun_glow_strength * 0.42 * glowVisibility;- light += warmColor * innerGlow * sun_glow_strength * 0.34 * glowVisibility;- // Patch 40: reduce only the full-screen direct-sun glare by exactly- // 25 percent. Godrays, the local Sun Glow halo and general Bloom keep- // their device-proven Patch-39 calibration.- light += sunColor * directSun * direct_glare_strength * 0.60 * glowVisibility;-- base.rgb += light;- omw_FragColor = base;- }-}--technique {- passes = main;- description = "OpenMW 0.51 Android vivid dynamic scene-depth Godrays with CPU-occluded Sun Glow.";- author = "OpenMW Android project; official OMWFX-style depth mask on the restored Android Tex_Depth path";- version = "3.4-051-depthfixed-vivid-softglare";- flags = Disable_Interiors, Disable_Underwater;-}diff --git a/android/app/src/main/assets/android_omwfx/lensflare_android_051_rayocc.omwfx b/android/app/src/main/assets/android_omwfx/lensflare_android_051_rayocc.omwfxdeleted file mode 100644index 3642379..0000000--- a/android/app/src/main/assets/android_omwfx/lensflare_android_051_rayocc.omwfx+++ /dev/null@@ -1,139 +0,0 @@-uniform_float flare_strength {- default = 0.27;- min = 0.0;- max = 1.0;- step = 0.01;- display_name = "Flare strength";- description = "Overall strength of the OpenMW 0.51 Android lens flare.";-}--uniform_float halo_size {- default = 0.18;- min = 0.05;- max = 0.35;- step = 0.01;- display_name = "Halo size";- description = "Size of the soft halo around the sun.";-}--uniform_float ghost_strength {- default = 0.13;- min = 0.0;- max = 0.40;- step = 0.01;- display_name = "Ghost strength";- description = "Strength of the two lens ghosts.";-}--shared {- vec3 getSunView051()- {- // OpenMW 0.51 distinguishes the visual sun-disc position (sunPos)- // from the sunlight direction (sunVec). Treat sunPos as a direction- // from the camera and force w=0 so camera translation can never enter- // the projection math.- vec3 disc = omw.sunPos.xyz;- float discLength = length(disc);- if (omw.sunPos.z <= 0.0 || discLength < 0.0001)- return vec3(0.5, 0.5, 0.0);-- vec3 discDir = disc / discLength;- vec4 viewDir = omw.viewMatrix * vec4(discDir, 0.0);- vec4 clip = omw.projectionMatrix * viewDir;-- float valid = 1.0;- if (abs(clip.w) < 0.0001 || clip.w <= 0.0)- valid = 0.0;-- float safeW = max(abs(clip.w), 0.0001);- vec2 uv = clip.xy / safeW;- uv = uv * 0.5 + 0.5;- return vec3(uv, valid);- }-- float edgeFade051(vec2 uv)- {- float x = smoothstep(-0.18, 0.03, uv.x) * (1.0 - smoothstep(0.97, 1.18, uv.x));- float y = smoothstep(-0.18, 0.03, uv.y) * (1.0 - smoothstep(0.97, 1.18, uv.y));- return x * y;- }-- float aspectDistance051(vec2 uv, vec2 center, float aspect)- {- vec2 d = uv - center;- d.x *= aspect;- return length(d);- }-- float softDisc051(vec2 uv, vec2 center, float radius, float aspect)- {- float d = aspectDistance051(uv, center, aspect);- return 1.0 - smoothstep(radius * 0.18, radius, d);- }-}--fragment main {- omw_In vec2 omw_TexCoord;-- void main()- {- vec4 base = omw_GetLastShader(omw_TexCoord);- vec3 sunView = getSunView051();-- if (sunView.z < 0.5 || omw.sunVis <= 0.001)- {- omw_FragColor = base;- return;- }-- vec2 sunUv = sunView.xy;- float aspect = omw.resolution.x / max(omw.resolution.y, 1.0);- vec2 center = vec2(0.5);- vec2 axis = center - sunUv;-- vec2 ghost1Pos = sunUv + axis * 1.28;- vec2 ghost2Pos = sunUv + axis * 1.72;-- float halo = softDisc051(omw_TexCoord, sunUv, halo_size, aspect);- float innerGlow = softDisc051(omw_TexCoord, sunUv, halo_size * 0.40, aspect);- float ghost1 = softDisc051(omw_TexCoord, ghost1Pos, 0.082, aspect);- float ghost2 = softDisc051(omw_TexCoord, ghost2Pos, 0.052, aspect);- float flareMask = halo + innerGlow + ghost1 + ghost2;-- if (flareMask <= 0.0001)- {- omw_FragColor = base;- return;- }-- // Gate H2g keeps the device-proven Patch-22/Patch-25 flare projection and- // consumes only the native CPU scene-ray visibility. No PP depth sampling.- float visibility = omw.sunVis * clamp(omw.sunOcclusion, 0.0, 1.0) * edgeFade051(sunUv);- if (visibility <= 0.001)- {- omw_FragColor = base;- return;- }-- vec3 sunColor = max(omw.sunColor.rgb, vec3(0.05));- vec3 warmColor = sunColor * vec3(1.00, 0.88, 0.68);- vec3 coolColor = sunColor * vec3(0.60, 0.78, 1.00);-- vec3 flare = vec3(0.0);- flare += sunColor * halo * flare_strength * 0.52;- flare += warmColor * innerGlow * flare_strength * 0.66;- flare += warmColor * ghost1 * ghost_strength * 1.10;- flare += coolColor * ghost2 * ghost_strength * 0.68;-- base.rgb += flare * visibility * 1.28;- omw_FragColor = base;- }-}--technique {- passes = main;- description = "OpenMW 0.51 Android lens flare with CPU scene-ray sun occlusion; builtin sunglare remains enabled.";- author = "OpenMW Android project";- version = "2.1-051-rayocc";- flags = Disable_Interiors, Disable_Underwater;-}diff --git a/android/app/src/main/assets/android_omwfx/rainlens_android_051_v12_dense.omwfx b/android/app/src/main/assets/android_omwfx/rainlens_android_051_v12_dense.omwfxdeleted file mode 100644index ad140f3..0000000--- a/android/app/src/main/assets/android_omwfx/rainlens_android_051_v12_dense.omwfx+++ /dev/null@@ -1,178 +0,0 @@-uniform_float rainlens_strength_v34 {- default = 0.72;- min = 0.0;- max = 1.25;- step = 0.05;- static = true;- display_name = "RainLens strength";- header = "RainLens";- description = "Overall visibility of lens raindrops during rain and thunderstorms.";-}--uniform_float rainlens_refraction_v34 {- default = 0.92;- min = 0.0;- max = 1.50;- step = 0.05;- static = true;- display_name = "RainLens refraction";- header = "RainLens";- description = "Strength of local scene refraction inside each droplet.";-}--uniform_float rainlens_density_v34 {- default = 0.90;- min = 0.0;- max = 1.0;- step = 0.05;- static = true;- display_name = "RainLens density";- header = "RainLens";- description = "Number of visible lens droplets. The default is calibrated to twice the Patch-33 population.";-}--fragment main {- omw_In vec2 omw_TexCoord;-- float rainForWeather051(int weatherId)- {- if (weatherId == 4)- return 0.82;- if (weatherId == 5)- return 1.0;- return 0.0;- }-- float rainFactor051()- {- float currentRain = rainForWeather051(omw.weatherID);- float nextRain = rainForWeather051(omw.nextWeatherID);- return mix(currentRain, nextRain, clamp(omw.weatherTransition, 0.0, 1.0));- }-- float hash21051(vec2 p)- {- return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);- }-- // Direct OpenMW 0.50 RainLens v1.2 port. One coherent moving teardrop:- // xy = refraction vector, z = body mask, w = edge mask.- vec4 movingDrop051(vec2 uv, float cells, float speed, float seed,- float timeValue, float wind, float density)- {- float aspect = omw.resolution.x / max(omw.resolution.y, 1.0);-- vec2 p = uv;- p.x = (p.x - 0.5) * aspect + 0.5;- p *= cells;-- p.y += timeValue * speed;- p.x -= timeValue * wind * 0.018;-- vec2 id = floor(p);- vec2 gv = fract(p) - 0.5;-- float rx = hash21051(id + vec2(seed, seed * 1.73));- float ry = hash21051(id + vec2(seed * 2.31, seed * 0.61));- float rs = hash21051(id + vec2(seed * 0.37, seed * 3.17));- float ra = hash21051(id + vec2(seed * 3.91, seed * 0.29));-- // Patch 34 keeps the exact v1.2 drop geometry but doubles the expected- // active-cell population: 12.28% in Patch 33 becomes 24.40% here.- float threshold = mix(0.94, 0.72, clamp(density, 0.0, 1.0));- float dropEnabled = smoothstep(threshold, min(0.995, threshold + 0.028), ra);-- gv.x -= (rx - 0.5) * 0.58;- gv.y -= (ry - 0.5) * 0.24;-- float size = mix(0.88, 1.22, rs);- vec2 q = gv / size;- q.x -= sin((q.y + 0.16) * 7.0 + rx * 6.28318) * 0.010;-- vec2 bulbPosition = vec2(q.x / 0.108, (q.y + 0.105) / 0.145);- float bulbDistance = length(bulbPosition);- float bulb = 1.0 - smoothstep(0.88, 1.04, bulbDistance);-- float taperT = clamp((q.y + 0.035) / 0.255, 0.0, 1.0);- float taperWidth = mix(0.082, 0.006, taperT);- float taperX = 1.0 - smoothstep(taperWidth * 0.78, taperWidth, abs(q.x));- float taperY = smoothstep(-0.060, -0.020, q.y)- * (1.0 - smoothstep(0.185, 0.245, q.y));- float taper = taperX * taperY;-- float bridgeWidth = mix(0.096, 0.066,- clamp((q.y + 0.060) / 0.105, 0.0, 1.0));- float bridge = (1.0 - smoothstep(bridgeWidth * 0.78, bridgeWidth, abs(q.x)))- * smoothstep(-0.080, -0.045, q.y)- * (1.0 - smoothstep(0.025, 0.060, q.y));-- float body = clamp(max(bulb, max(taper, bridge)) * dropEnabled, 0.0, 1.0);- float inner = clamp(max(- 1.0 - smoothstep(0.70, 0.88, bulbDistance),- max(taper * 0.72, bridge * 0.72)- ) * dropEnabled, 0.0, 1.0);- float edge = clamp(body - inner, 0.0, 1.0);-- vec2 direction = vec2(q.x, (q.y + 0.085) * 0.68);- float lengthSquared = dot(direction, direction);- if (lengthSquared > 0.000001)- direction *= inversesqrt(lengthSquared);- else- direction = vec2(0.0, -1.0);-- vec2 refractionOffset = direction * body * 0.00235;- refractionOffset.x /= max(aspect, 0.001);-- return vec4(refractionOffset, body, edge);- }-- void main()- {- vec4 base = omw_GetLastShader(omw_TexCoord);- float rain = rainFactor051() * rainlens_strength_v34;-- if (rain <= 0.001)- {- omw_FragColor = base;- return;- }-- float timeValue = omw.simulationTime;- float wind = clamp(omw.windSpeed, 0.0, 1.5);- float density = clamp(rainlens_density_v34, 0.0, 1.0);- vec4 drop = movingDrop051(- omw_TexCoord, 5.6, 0.215, 19.7, timeValue, wind, density- );-- float mask = clamp(drop.z * rain, 0.0, 1.0);-- if (mask <= 0.001)- {- omw_FragColor = base;- return;- }-- vec2 sampleUv = clamp(- omw_TexCoord + drop.xy * rainlens_refraction_v34 * rain,- vec2(0.001),- vec2(0.999)- );- vec4 refracted = omw_GetLastShader(sampleUv);-- float refractionMix = clamp(mask * 0.82, 0.0, 0.82);- vec3 result = mix(base.rgb, refracted.rgb, refractionMix);- result *= 1.0 - 0.030 * mask;- result += vec3(0.028) * drop.w * rain;-- base.rgb = result;- omw_FragColor = base;- }-}--technique {- passes = main;- description = "OpenMW 0.51 Android RainLens v1.2 with a doubled moving-drop population.";- author = "OpenMW Android project";- version = "4.3-051-rainlens-v12-dense";- flags = Disable_Interiors, Disable_Underwater;-}diff --git a/android/app/src/main/assets/android_omwfx/wetworld_android_051_weather.omwfx b/android/app/src/main/assets/android_omwfx/wetworld_android_051_weather.omwfxdeleted file mode 100644index d2184c8..0000000--- a/android/app/src/main/assets/android_omwfx/wetworld_android_051_weather.omwfx+++ /dev/null@@ -1,223 +0,0 @@-uniform_float wet_strength_v35 {- default = 0.92;- min = 0.0;- max = 1.5;- step = 0.05;- display_name = "Wet surface strength";- description = "Overall darkening and sheen applied to rain-wet upward-facing surfaces.";-}--uniform_float wet_darkening_v35 {- default = 0.30;- min = 0.0;- max = 0.60;- step = 0.02;- display_name = "Wet darkening";- description = "How much roads, paths and other upward-facing surfaces darken in rain.";-}--uniform_float wet_sheen_v35 {- default = 0.34;- min = 0.0;- max = 0.80;- step = 0.02;- display_name = "Wet sheen";- description = "Strength of the broad sky-coloured wet reflection sheen.";-}--uniform_float puddle_strength_v35 {- default = 0.62;- min = 0.0;- max = 1.0;- step = 0.02;- display_name = "Puddle strength";- description = "Strength of irregular darker and more reflective puddle patches.";-}--fragment main {- omw_In vec2 omw_TexCoord;-- float rainForWeather051(int weatherId)- {- if (weatherId == 4)- return 1.0;- if (weatherId == 5)- return 1.0;- return 0.0;- }-- float rainFactor051()- {- float currentRain = rainForWeather051(omw.weatherID);- float nextRain = rainForWeather051(omw.nextWeatherID);- return mix(currentRain, nextRain, clamp(omw.weatherTransition, 0.0, 1.0));- }-- float hash21051(vec2 p)- {- // Arithmetic-only hash for the GLES2 path. It avoids eight expensive- // trigonometric calls per pixel while keeping stable world-space pools.- vec3 p3 = fract(vec3(p.xyx) * 0.1031);- p3 += dot(p3, p3.yzx + 33.33);- return fract((p3.x + p3.y) * p3.z);- }-- float valueNoise051(vec2 p)- {- vec2 cell = floor(p);- vec2 f = fract(p);- f = f * f * (3.0 - 2.0 * f);-- float a = hash21051(cell);- float b = hash21051(cell + vec2(1.0, 0.0));- float c = hash21051(cell + vec2(0.0, 1.0));- float d = hash21051(cell + vec2(1.0, 1.0));-- return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);- }-- // Reconstruct camera-relative view-space positions directly from depth.- // This avoids subtracting large absolute world coordinates, which can lose- // precision on some Mali/GL4ES paths and turn the wetness normal into- // camera-aligned stripes. Android currently runs without reverse-Z, but- // keep the generated OpenMW branch correct for completeness.- vec3 reconstructedViewPos051(vec2 uv)- {- float depth = omw_GetDepth(uv);-#if OMW_REVERSE_Z- float clipDepth = 1.0 - depth;-#else- float clipDepth = depth * 2.0 - 1.0;-#endif- vec4 clipPos = vec4(uv * 2.0 - 1.0, clipDepth, 1.0);- vec4 viewPos = omw.invProjectionMatrix * clipPos;- float safeW = abs(viewPos.w) > 0.000001 ? viewPos.w : 1.0;- return viewPos.xyz / safeW;- }-- vec3 reconstructedWorldNormal051(vec2 uv)- {- // Central four-neighbour sampling is less directionally biased than the- // old +X/+Y finite difference. For each axis use the shorter one-sided- // vector, which naturally rejects most depth discontinuities at object- // silhouettes without derivatives or a normals render target.- vec2 texel = vec2(1.0) / max(omw.resolution.xy, vec2(1.0));- vec2 uvL = clamp(uv - vec2(texel.x, 0.0), vec2(0.001), vec2(0.999));- vec2 uvR = clamp(uv + vec2(texel.x, 0.0), vec2(0.001), vec2(0.999));- vec2 uvD = clamp(uv - vec2(0.0, texel.y), vec2(0.001), vec2(0.999));- vec2 uvU = clamp(uv + vec2(0.0, texel.y), vec2(0.001), vec2(0.999));-- vec3 p = reconstructedViewPos051(uv);- vec3 pL = reconstructedViewPos051(uvL);- vec3 pR = reconstructedViewPos051(uvR);- vec3 pD = reconstructedViewPos051(uvD);- vec3 pU = reconstructedViewPos051(uvU);-- vec3 dxForward = pR - p;- vec3 dxBackward = p - pL;- vec3 dyForward = pU - p;- vec3 dyBackward = p - pD;- vec3 dx = dot(dxForward, dxForward) <= dot(dxBackward, dxBackward)- ? dxForward : dxBackward;- vec3 dy = dot(dyForward, dyForward) <= dot(dyBackward, dyBackward)- ? dyForward : dyBackward;-- vec3 nView = cross(dx, dy);- float len2 = dot(nView, nView);- if (len2 < 0.0000001)- return vec3(0.0, 0.0, 1.0);-- nView *= inversesqrt(len2);- vec3 nWorld = (omw.invViewMatrix * vec4(nView, 0.0)).xyz;- float worldLen2 = dot(nWorld, nWorld);- if (worldLen2 < 0.0000001)- return vec3(0.0, 0.0, 1.0);- return nWorld * inversesqrt(worldLen2);- }-- void main()- {- vec4 base = omw_GetLastShader(omw_TexCoord);-- // OPENMW_ANDROID_051_FINAL7_WETWORLD_PASS_THROUGH_V4- // Android GLES2/GL4ES has no reliable material/foliage classification- // in this post-process pass. Depth-derived normals can classify alpha-- // tested leaves and tree cards as upward-facing wet ground. Disable only- // WetWorld's surface colouring. Later OMWFX passes and native water/rain- // rendering remain unchanged. Keep the legacy code below intact because- // the release payload gate validates this calibrated GLES2-safe revision.- omw_FragColor = base;- return;-- // Patch 35 marks actual water pixels with scene alpha 0. Preserve lakes,- // rivers and native rain ripples instead of treating them as wet ground.- if (base.a < 0.25)- {- omw_FragColor = base;- return;- }-- float rain = rainFactor051();- if (rain <= 0.001)- {- omw_FragColor = base;- return;- }-- float linearDepth = omw_GetLinearDepth(omw_TexCoord);- if (linearDepth >= omw.far * 0.992)- {- omw_FragColor = base;- return;- }-- vec3 worldPos = omw_GetWorldPosFromUV(omw_TexCoord);- vec3 n = reconstructedWorldNormal051(omw_TexCoord);-- // Roads, paths, flat stone and terrain receive most rain. The absolute- // component keeps the result stable if finite-difference winding flips.- float upFacing = smoothstep(0.30, 0.76, abs(n.z));- float distanceFade = 1.0 - smoothstep(omw.far * 0.48, omw.far * 0.92, linearDepth);- float wetMask = clamp(rain * upFacing * distanceFade * wet_strength_v35, 0.0, 1.0);-- // OPENMW_ANDROID_051_WETWORLD_PUDDLES_DISABLED- // Puddles are intentionally disabled on the GLES2/GL4ES Android path.- // The compatibility symbols stay present because the 0.51.0-07 launcher- // and Gradle payload guards validate this calibrated WetWorld revision.- // Keeping puddleField constant avoids all procedural puddle/noise work.- float puddleField = 0.0;- float puddleMask = smoothstep(0.56, 0.76, puddleField)- * wetMask * puddle_strength_v35 * 0.0;-- float luma = dot(base.rgb, vec3(0.299, 0.587, 0.114));- vec3 saturated = mix(vec3(luma), base.rgb, 1.12);-- // WetWorld keeps the rain darkening, but standing-water darkening is disabled.- float darken = wet_darkening_v35 * wetMask;- vec3 wetBase = saturated * (1.0 - clamp(darken, 0.0, 0.62));-- vec3 viewDir = normalize(omw.eyePos.xyz - worldPos);- float ndv = clamp(abs(dot(n, viewDir)), 0.0, 1.0);- float fresnel = pow(1.0 - ndv, 2.0);- float broadSheen = 0.20 + fresnel * 0.80;-- vec3 skyTint = mix(omw.skyColor.rgb, omw.fogColor.rgb, 0.28);- skyTint = max(skyTint, vec3(0.07));-- // Broad wet-surface sheen remains active. Puddle reflection and the- // puddle-specific sky-colour blend are deliberately removed.- vec3 sheen = skyTint * broadSheen * wet_sheen_v35 * wetMask;- vec3 result = wetBase + sheen;-- base.rgb = result;- omw_FragColor = base;- }-}--technique {- passes = main;- description = "Android/GL4ES rain wetness with Mali-safe view-space normals and puddles disabled.";- author = "OpenMW Android project";- version = "5.1-051-weather-puddles-mali-safe";- flags = Disable_Interiors, Disable_Underwater;-}\ No newline at end of filediff --git a/android/app/src/main/gdb.sh b/android/app/src/main/gdb.shdeleted file mode 100755index 5adb390..0000000--- a/android/app/src/main/gdb.sh+++ /dev/null@@ -1,21 +0,0 @@-#!/bin/bash--set -e-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"-cd $DIR--# first argument: arch of the executable used (you have to figure it out yourself!)-ARCH=${1:-arm}-source ../../../buildscripts/include/version.sh--# set up fake "jni" so that ndk-gdb can find a "valid" Android.mk-rm -rf jni && mkdir jni-echo "APP_ABI := $ABI" > jni/Android.mk--rm -f gdb.exec-echo "shell rm -rf jni" >> gdb.exec-echo "set solib-search-path ../../../buildscripts/symbols/$ABI/" >> gdb.exec-echo "set history save on" >> gdb.exec-echo "set breakpoint pending on" >> gdb.exec--../../../buildscripts/toolchain/ndk/ndk-gdb --attach is.xyz.omw_nightly.debug -x "gdb.exec"diff --git a/android/app/src/main/ic_launcher-web.png b/android/app/src/main/ic_launcher-web.pngdeleted file mode 100644index 2ee75f1..0000000Binary files a/android/app/src/main/ic_launcher-web.png and /dev/null differdiff --git a/android/app/src/main/java/constants/Constants.kt b/android/app/src/main/java/constants/Constants.ktdeleted file mode 100644index 33fdae0..0000000--- a/android/app/src/main/java/constants/Constants.kt+++ /dev/null@@ -1,69 +0,0 @@-/*- Copyright (C) 2015, 2016 sandstranger- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package constants--object Constants {- const val APP_PREFERENCES = "settings"- const val HIDE_CONTROLS = "pref_hide_controls"-- // User-owned OpenMW data root.- //- // This is initialized from Context.getExternalFilesDir(null) by MyApp:- // /storage/emulated/0/Android/data/com.ast.openmw/files/OpenMW- //- // It contains saves, screenshots, user config, custom control icons,- // the writable resource mirror, navmesh.db and other engine user data.- var USER_FILE_STORAGE = ""-- // Internal APK-provided/default configuration.- // e.g. /data/user/0/com.ast.openmw/files/config/defaults.bin- var DEFAULTS_BIN = ""-- // Generated launcher configuration used as global config.- // e.g. /data/user/0/com.ast.openmw/files/config/openmw.cfg- var OPENMW_CFG = ""-- var OPENMW_BASE_CFG = ""- var OPENMW_FALLBACK_CFG = ""-- // Internal engine resource payload copied from APK assets.- // e.g. /data/user/0/com.ast.openmw/files/resources- var RESOURCES = ""-- // Internal global config directory.- // e.g. /data/user/0/com.ast.openmw/files/config- var GLOBAL_CONFIG = ""-- // User config directory below USER_FILE_STORAGE.- // e.g. .../Android/data/com.ast.openmw/files/OpenMW/config- var USER_CONFIG = ""-- // User-editable OpenMW config below USER_CONFIG.- var USER_OPENMW_CFG = ""-- // Contains app version code for currently deployed internal resources.- var VERSION_STAMP = ""-- // Isowind's files copied from APK assets: the mod, the bundled mods, pixel art and the profiles, laid out as in- // the desktop packages (the profiles' openmw.cfg data paths are relative to their own folder).- // e.g. /data/user/0/tf.pw.isowind/files/isowind- var ISOWIND = ""-}diff --git a/android/app/src/main/java/cursor/MouseCursor.kt b/android/app/src/main/java/cursor/MouseCursor.ktdeleted file mode 100644index 2531a18..0000000--- a/android/app/src/main/java/cursor/MouseCursor.kt+++ /dev/null@@ -1,150 +0,0 @@-/*- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package cursor--import android.content.Context-import android.os.Build-import android.util.AttributeSet-import android.util.TypedValue-import android.view.Choreographer-import android.view.View-import android.widget.RelativeLayout--import com.libopenmw.openmw.R--import org.libsdl.app.SDLActivity--import ui.activity.GameActivity-import ui.activity.MainActivity-import ui.activity.MouseMode-import ui.controls.Osc--import android.graphics.BitmapFactory-import constants.Constants-import java.io.File--/**- * An image view which doesn't downsize itself when moved to the border of a RelativeLayout- * (not sure if original behavior is intended)- */-internal class FixedSizeImageView : androidx.appcompat.widget.AppCompatImageView {-- // Just something so that it's visible- private var fixedWidth = 10- private var fixedHeight = 10-- // Default constructors for studio UI editor- constructor(context: Context): super(context)- constructor(context: Context, attrs: AttributeSet): super(context, attrs)- constructor(context: Context, attrs: AttributeSet, defStyle: Int):- super(context, attrs, defStyle)-- /**- * @param w Fixed width of this view- * @param h Fixed height of this view- */- constructor(context: Context, w: Int, h: Int): super(context) {- fixedWidth = w- fixedHeight = h- }-- override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {- setMeasuredDimension(fixedWidth, fixedHeight)- }-}--class MouseCursor(activity: GameActivity, private val osc: Osc?) : Choreographer.FrameCallback {-- private val choreographer: Choreographer- private val cursor: FixedSizeImageView- private var prevMouseShown = -1- private val useChromeOsSystemCursor =- Build.VERSION.SDK_INT >= 24 && SDLActivity.isChromebook() // OPENMW_CHROMEOS_NATIVE_MOUSE_V1-- init {- val height = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f,- activity.resources.displayMetrics).toInt()- val width = Math.round(height / 1.5).toInt()-- cursor = FixedSizeImageView(activity, width, height)-- if (!useChromeOsSystemCursor) {- if (File(Constants.USER_FILE_STORAGE + "/icons/pointer_arrow.png").exists())- cursor.setImageBitmap(BitmapFactory.decodeFile(Constants.USER_FILE_STORAGE + "/icons/pointer_arrow.png"))- else- cursor.setImageResource(R.drawable.pointer_arrow)-- cursor.layoutParams = RelativeLayout.LayoutParams(width, height)- activity.layout.addView(cursor)- }-- choreographer = Choreographer.getInstance()- choreographer.postFrameCallback(this)- }-- override fun doFrame(frameTimeNanos: Long) {- // Check if we need to switch osc widgets visibility- val mouseShown = SDLActivity.isMouseShown()- if (osc != null && mouseShown != prevMouseShown) {- if (GameActivity.mouseMode == MouseMode.Touch) {- // If the player has default mouse-mode enabled, trigger it here- osc.mouseVisible = mouseShown != 0- }- osc.showBasedOnState()- }-- if (useChromeOsSystemCursor) {- // SDL_ShowCursor() / Android PointerIcon owns the visible ChromeOS cursor.- // Do not mirror SDL_GetMouseState() into an ImageView once per UI frame.- prevMouseShown = mouseShown- choreographer.postFrameCallback(this)- return- }-- if (GameActivity.mouseMode == MouseMode.Touch || mouseShown == 0 || (osc != null && osc.keyboardVisible)) {- cursor.visibility = View.GONE- } else {- cursor.visibility = View.VISIBLE-- val surface = SDLActivity.getSurface()-- var translateX = 1.0f- var translateY = 1.0f-- if (MainActivity.resolutionX > 0) {- translateX = 1.0f * surface.width / MainActivity.resolutionX- translateY = 1.0f * surface.height / MainActivity.resolutionY- }-- val mouseX = SDLActivity.getMouseX()- val mouseY = SDLActivity.getMouseY()-- // calling setX/setY here results in a bug cropping part of the mouse cursor- // changing LayoutParams works as expected...- val params = cursor.layoutParams as RelativeLayout.LayoutParams- params.leftMargin = (mouseX * translateX + surface.left).toInt()- params.topMargin = (mouseY * translateY + surface.top).toInt()- cursor.layoutParams = params- }-- prevMouseShown = mouseShown- choreographer.postFrameCallback(this)- }-}diff --git a/android/app/src/main/java/file/GameInstaller.kt b/android/app/src/main/java/file/GameInstaller.ktdeleted file mode 100644index 3372807..0000000--- a/android/app/src/main/java/file/GameInstaller.kt+++ /dev/null@@ -1,151 +0,0 @@-/*- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package file--import android.content.Context-import android.preference.PreferenceManager-import constants.Constants-import java.io.File-import java.io.IOException-import java.nio.charset.Charset-import java.util.Locale--/**- * Class responsible for initial game setup which involves- * transforming morrowind.ini into openmw.cfg.- */-class GameInstaller(path: String) {-- val dir = File(path)-- /**- * Lists the root directory and finds a file or directory named [name]- * using a case-insensitive comparison.- */- private fun findCaseInsensitive(name: String): File? {- val nameLower = name.lowercase(Locale.ROOT)- return try {- dir.listFiles()- ?.firstOrNull { it.name.lowercase(Locale.ROOT) == nameLower }- } catch (_: SecurityException) {- null- }- }-- /**- * Checks that the selected game directory contains a Morrowind.ini file- * and a Data Files directory.- */- fun check(): Boolean {- if (!dir.isDirectory)- return false-- val ini = findCaseInsensitive(INI_NAME)- val dataFiles = findCaseInsensitive(DATA_NAME)- return ini?.isFile == true && dataFiles?.isDirectory == true- }-- /**- * Returns the actual Data Files directory found on disk. This preserves- * the real filename casing on case-sensitive filesystems.- *- * If the directory has not been validated yet, the conventional path is- * returned so callers can still display a useful location.- */- fun findDataFilesFile(): File {- return findCaseInsensitive(DATA_NAME)- ?.takeIf { it.isDirectory }- ?: File(dir, DATA_NAME)- }-- /** Returns the absolute path to the Data Files directory. */- fun findDataFiles(): String = findDataFilesFile().absolutePath-- /**- * Adds a .nomedia file to the game folder so media scanners do not index- * all game assets. Failure is intentionally non-fatal.- */- fun setNomedia() {- try {- val file = File(dir, ".nomedia")- if (!file.exists())- file.createNewFile()- } catch (_: IOException) {- // Non-critical convenience file.- }- }-- /**- * Converts Morrowind.ini into OpenMW format and writes the result into- * the application configuration directory.- *- * @param encoding game encoding selected by the user- * @return true when the conversion and write completed successfully- */- fun convertIni(encoding: String): Boolean {- val file = findCaseInsensitive(INI_NAME)?.takeIf { it.isFile } ?: return false-- val charset = when (encoding) {- "win1250" -> Charset.forName("windows-1250")- "win1251" -> Charset.forName("windows-1251")- else -> Charset.forName("windows-1252")- }-- return try {- val contents = file.readText(charset)- if (contents.isEmpty())- return false-- val output = IniConverter(contents).convert()- if (output.isEmpty())- return false-- val target = File(Constants.OPENMW_FALLBACK_CFG)- target.parentFile?.mkdirs()- target.writeText(output)- target.isFile && target.length() > 0- } catch (_: IOException) {- false- } catch (_: SecurityException) {- false- } catch (_: RuntimeException) {- // Malformed input should be reported as a failed conversion, not- // terminate the launcher process.- false- }- }-- companion object {- const val INI_NAME = "Morrowind.ini"- const val DATA_NAME = "Data Files"- const val DEFAULT_CHARSET_PREF = "win1252"-- /** Returns the configured Data Files directory. */- fun getDataFilesFile(ctx: Context): File {- val gamePath = PreferenceManager.getDefaultSharedPreferences(ctx)- .getString("game_files", "")- .orEmpty()- return GameInstaller(gamePath).findDataFilesFile()- }-- /** Returns the absolute path of the configured Data Files directory. */- fun getDataFiles(ctx: Context): String = getDataFilesFile(ctx).absolutePath- }-}diff --git a/android/app/src/main/java/file/IniConverter.kt b/android/app/src/main/java/file/IniConverter.ktdeleted file mode 100644index f6b68e3..0000000--- a/android/app/src/main/java/file/IniConverter.kt+++ /dev/null@@ -1,75 +0,0 @@-/*- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package file--/**- * Converts morrowind.ini to fallback= format- * @param data Contents of morrowind.ini as a string- */-class IniConverter(private val data: String) {-- /**- * Performs the actual conversion- * @return String contents of the output file in openmw's fallback format- */- fun convert(): String {- var category = ""- var output = ""-- data- // Split into lines- .lines()- // Trim whitespace/newlines- .map { it.trim() }- // Remove comments and empty lines- .filter { it.isNotEmpty() && !it.startsWith(";") }- .forEach {- if (it.startsWith("[") && it.endsWith("]")) {- // It's a category- category = it.substring(1, it.length - 1).replace(" ", "_")- } else if (it.contains("=")) {- // It's a key-value pair- val converted = convertLine(it)- if (converted.isNotEmpty())- output += "fallback=${category}_$converted\n"- }- }-- return output- }-- /**- * Converts a single morrowind setting line into openmw format- * (replacing spaces with _ and = with ,)- * @param line Line to convert- * @return Converted result, note that this does not include the fallback=Category_ part- */- private fun convertLine(line: String): String {- // key and value are separated by = in mw and by , in omw- val kv = line.split("=".toRegex(), 2)- val key = kv[0].replace(" ", "_")- val value = kv[1]-- if (key.isEmpty() || value.isEmpty())- return ""-- return "$key,$value"- }-}diff --git a/android/app/src/main/java/file/Writer.kt b/android/app/src/main/java/file/Writer.ktdeleted file mode 100644index cf6f135..0000000--- a/android/app/src/main/java/file/Writer.kt+++ /dev/null@@ -1,68 +0,0 @@-/*- Copyright (C) 2016 sandstranger- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package file--import java.io.BufferedReader-import java.io.File-import java.io.FileInputStream-import java.io.FileWriter-import java.io.IOException-import java.io.InputStreamReader--object Writer {-- /**- * Replaces a key=value in config file with the new value- * @param path Path to the configuration file to edit- * @param key Key to replace- * @param value New value to put- */- @Throws(IOException::class)- fun write(path: String, key: String, value: String) {- // Create a new empty file if it doesn't already exist- val fin = File(path)-- fin.createNewFile()-- val file = FileInputStream(path)- val reader = BufferedReader(InputStreamReader(file))- var line: String? = reader.readLine()- val builder = StringBuilder()- var contains = false- while (line != null) {- if (line.startsWith(key) && !contains) {- builder.append("$key=$value")- contains = true- } else- builder.append(line)- builder.append("\n")- line = reader.readLine()- }- if (!contains)- builder.append("$key=$value")-- reader.close()- val writer = FileWriter(path)- writer.write(builder.toString())- writer.flush()- writer.close()- }-}diff --git a/android/app/src/main/java/file/utils/CopyFilesFromAssets.kt b/android/app/src/main/java/file/utils/CopyFilesFromAssets.ktdeleted file mode 100644index a857f56..0000000--- a/android/app/src/main/java/file/utils/CopyFilesFromAssets.kt+++ /dev/null@@ -1,77 +0,0 @@-/*- Copyright (C) 2016 sandstranger- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package file.utils--import java.io.File-import java.io.FileOutputStream-import java.io.IOException--import android.content.Context--/**- * Helper class to handle copying assets to the storage- * @param context Android context to use- */-class CopyFilesFromAssets(private val context: Context) {-- /**- * Copies assets recursively- * @param src Source directory in assets- * @param dst Destination directory on disk, absolute path- */- fun copy(src: String, dst: String) {- val assetManager = context.assets- try {- val assets = assetManager.list(src) ?: return- if (assets.isEmpty()) {- copyFile(src, dst)- } else {- // Recurse into a subdirectory- val dir = File(dst)- if (!dir.exists())- dir.mkdirs()- for (i in assets.indices) {- copy(src + "/" + assets[i], dst + "/" + assets[i])- }- }- } catch (ex: IOException) {- }- }-- /**- * Copies a single file from assets to disk- * @param src Path of source file inside assets- * @param dst Absolute path to destination file on disk- */- private fun copyFile(src: String, dst: String) {- try {- val inp = context.assets.open(src)- val out = FileOutputStream(dst)-- inp.copyTo(out)- out.flush()-- inp.close()- out.close()- } catch (e: IOException) {- }- }-}diff --git a/android/app/src/main/java/mods/Mod.kt b/android/app/src/main/java/mods/Mod.ktdeleted file mode 100644index 56ca96f..0000000--- a/android/app/src/main/java/mods/Mod.kt+++ /dev/null@@ -1,93 +0,0 @@-/*- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package mods--import android.content.ContentValues-import android.database.Cursor-import android.database.sqlite.SQLiteDatabase--enum class ModType(val v: Int) {- Plugin(1),- Resource(2),- Dir(3),- Groundcover(4);-- companion object {- private val reverseValues: Map<Int, ModType> = values().associate { it.v to it }-- fun valueFrom(i: Int): ModType = reverseValues.getValue(i)- }-}--/**- * Representation of a single mod in the database- * @param type Type of the mod: plugin or resource- * @param filename Filename of the mod, without the path- * @param order Load order, or order in the list- * @param enabled Whether the mod is enabled- */-class Mod(val type: ModType, val filename: String, var order: Int, var enabled: Boolean) {-- /// Set to true when DB update is needed to keep consistency- var dirty: Boolean = false-- /**- * Updates the representation of this mod in the database- * @param db Database connection- */- fun update(db: SQLiteDatabase) {- val values = ContentValues().apply {- put("load_order", order)- put("enabled", if (enabled) 1 else 0)- }-- db.update(- "mod",- values,- "filename = ? AND type = ?",- arrayOf(filename, type.v.toString())- )- }-- /**- * Inserts this mod into the database- * @param db Database connection- */- fun insert(db: SQLiteDatabase) {- val values = ContentValues().apply {- put("type", type.v)- put("filename", filename)- put("load_order", order)- put("enabled", if (enabled) 1 else 0)- }-- db.insert("mod", null, values)- }-- companion object {- fun fromCursor(cursor: Cursor): Mod {- return Mod(- ModType.valueFrom(cursor.getInt(cursor.getColumnIndexOrThrow("type"))),- cursor.getString(cursor.getColumnIndexOrThrow("filename")),- cursor.getInt(cursor.getColumnIndexOrThrow("load_order")),- cursor.getInt(cursor.getColumnIndexOrThrow("enabled")) != 0- )- }- }-}diff --git a/android/app/src/main/java/mods/ModMoveCallback.kt b/android/app/src/main/java/mods/ModMoveCallback.ktdeleted file mode 100644index 6090bf3..0000000--- a/android/app/src/main/java/mods/ModMoveCallback.kt+++ /dev/null@@ -1,84 +0,0 @@-/*- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package mods--import androidx.recyclerview.widget.RecyclerView-import androidx.recyclerview.widget.ItemTouchHelper--/**- * Callback for dragging the mods around to change load order- */-class ModMoveCallback(private val mAdapter: ModsAdapter) : ItemTouchHelper.Callback() {-- override fun isLongPressDragEnabled(): Boolean {- return true- }-- override fun isItemViewSwipeEnabled(): Boolean {- return false- }--- override fun onSwiped(viewHolder: RecyclerView.ViewHolder, i: Int) {-- }-- override fun getMovementFlags(recyclerView: RecyclerView,- viewHolder: RecyclerView.ViewHolder): Int {- val dragFlags = ItemTouchHelper.UP or ItemTouchHelper.DOWN- return ItemTouchHelper.Callback.makeMovementFlags(dragFlags, 0)- }-- override fun onMove(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder,- target: RecyclerView.ViewHolder): Boolean {- mAdapter.onRowMoved(viewHolder.adapterPosition, target.adapterPosition)- return true- }-- override fun onSelectedChanged(viewHolder: RecyclerView.ViewHolder?,- actionState: Int) {- if (actionState != ItemTouchHelper.ACTION_STATE_IDLE) {- if (viewHolder is ModsAdapter.ModViewHolder) {- mAdapter.onRowSelected(viewHolder)- }- }-- super.onSelectedChanged(viewHolder, actionState)- }-- override fun clearView(recyclerView: RecyclerView,- viewHolder: RecyclerView.ViewHolder) {- super.clearView(recyclerView, viewHolder)-- if (viewHolder is ModsAdapter.ModViewHolder) {- mAdapter.onRowClear(viewHolder)- }- }-- /**- * Speed up dragging of a list element- */- override fun interpolateOutOfBoundsScroll(recyclerView: RecyclerView, viewSize: Int,- viewSizeOutOfBounds: Int, totalSize: Int,- msSinceStartScroll: Long): Int {- val direction = Math.signum(viewSizeOutOfBounds.toFloat()).toInt()- return 20 * direction- }-}diff --git a/android/app/src/main/java/mods/ModsAdapter.kt b/android/app/src/main/java/mods/ModsAdapter.ktdeleted file mode 100644index 9d5fb8d..0000000--- a/android/app/src/main/java/mods/ModsAdapter.kt+++ /dev/null@@ -1,115 +0,0 @@-/*- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package mods--import android.annotation.SuppressLint-import android.graphics.Color-import androidx.recyclerview.widget.RecyclerView-import androidx.recyclerview.widget.ItemTouchHelper-import android.view.LayoutInflater-import android.view.MotionEvent-import android.view.View-import android.view.ViewGroup-import android.widget.CheckBox-import android.widget.ImageView-import android.widget.TextView-import com.libopenmw.openmw.R-import java.util.*--/**- * An adapter to put a ModsCollection into a UI list- */-class ModsAdapter() : RecyclerView.Adapter<ModsAdapter.ModViewHolder>() {-- lateinit var touchHelper: ItemTouchHelper- lateinit var collection: ModsCollection-- /**- * A row representation of a mod- */- inner class ModViewHolder(internal var rowView: View) : RecyclerView.ViewHolder(rowView) {- val mTitle: TextView = rowView.findViewById(R.id.txtTitle)- val mHandle: ImageView = rowView.findViewById(R.id.handle)- val mCheckbox: CheckBox = rowView.findViewById(R.id.modCheckbox)- }-- override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ModViewHolder {- val itemView = LayoutInflater.from(parent.context).inflate(R.layout.mod_item, parent, false)- return ModViewHolder(itemView)- }-- @SuppressLint("ClickableViewAccessibility")- override fun onBindViewHolder(holder: ModViewHolder, position: Int) {- val mod = collection.mods[position]- holder.mTitle.text = mod.filename- holder.mHandle.setOnTouchListener { _, event ->- if (event.action == MotionEvent.ACTION_DOWN) {- touchHelper.startDrag(holder)- }- false- }- holder.mCheckbox.isChecked = mod.enabled- holder.mCheckbox.setOnClickListener {- mod.enabled = (it as CheckBox).isChecked- mod.dirty = true- collection.update()- }- }-- override fun getItemCount(): Int {- return collection.mods.size- }-- private fun swapMods(from: Int, to: Int) {- // Swap the orders- val tmp = collection.mods[from].order- collection.mods[from].order = collection.mods[to].order- collection.mods[to].order = tmp-- // Swap the mods inside the list- Collections.swap(collection.mods, from, to)-- // Mark mods as dirty to update when the user releases currently dragged mod- collection.mods[from].dirty = true- collection.mods[to].dirty = true- }-- fun onRowMoved(fromPosition: Int, toPosition: Int) {- if (fromPosition < toPosition) {- for (i in fromPosition until toPosition) {- swapMods(i, i + 1)- }- } else {- for (i in fromPosition downTo toPosition + 1) {- swapMods(i, i - 1)- }- }- notifyItemMoved(fromPosition, toPosition)- }-- fun onRowSelected(modViewHolder: ModViewHolder) {- modViewHolder.rowView.setBackgroundResource(R.drawable.mod_item_selected_background)- }-- fun onRowClear(modViewHolder: ModViewHolder) {- modViewHolder.rowView.setBackgroundResource(R.drawable.mod_item_background)- collection.update()- }-}diff --git a/android/app/src/main/java/mods/ModsCollection.kt b/android/app/src/main/java/mods/ModsCollection.ktdeleted file mode 100644index 7df0ca8..0000000--- a/android/app/src/main/java/mods/ModsCollection.kt+++ /dev/null@@ -1,212 +0,0 @@-/*- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package mods--import android.database.sqlite.SQLiteDatabase-import java.io.File-import java.util.Locale--/**- * Represents an ordered list of mods of a specific type- * @param type Type of the mods represented by this collection, Plugin or Resource- * @param dataFiles Path to the directory of the mods (the Data Files directory)- */-class ModsCollection(- private val type: ModType,- private val dataFiles: ArrayList<String>,- private val db: ModsDatabaseOpenHelper-) {- val mods = arrayListOf<Mod>()-- private val extensions: Array<String> = when (type) {- ModType.Resource -> arrayOf("bsa")- ModType.Dir -> emptyArray()- else -> arrayOf("esm", "esp", "omwaddon", "omwgame", "omwscripts")- }-- init {- if (isEmpty()) {- initDb()- }-- syncWithFs(type)-- // The database might have become empty (e.g. if user deletes all mods) after the FS sync.- if (isEmpty()) {- initDb()- }- }-- /**- * Checks if the mod DB is empty, i.e. no mods defined yet.- */- private fun isEmpty(): Boolean {- val database = db.readableDatabase- database.rawQuery("SELECT count(1) FROM mod", null).use { cursor ->- return !cursor.moveToFirst() || cursor.getInt(0) == 0- }- }-- /**- * Inserts built-in mods into the database, in proper order.- * Also checks to make sure only installed mods are inserted.- */- private fun initDb() {- val builtIn = arrayOf("Morrowind", "Tribunal", "Bloodmoon")- initDbMods(builtIn.map { "$it.esm" }, ModType.Plugin)- initDbMods(builtIn.map { "$it.bsa" }, ModType.Resource)- }-- /**- * Inserts built-in mods of a specific mod type.- * All of the built-in mods will be enabled by default.- */- private fun initDbMods(files: List<String>, type: ModType) {- var order = 0- val database = db.writableDatabase-- dataFiles.forEach { dataPath ->- files- .map { File(dataPath, it) }- .filter { it.exists() }- .map {- order += 1- Mod(type, it.name, order, true)- }- .forEach { it.insert(database) }- }- }-- /**- * Synchronizes state of mods in database with the actual mod files on disk.- */- private fun syncWithFs(type: ModType) {- val database = db.writableDatabase- val dbMods = mutableListOf<Mod>()-- database.query(- "mod",- arrayOf("type", "filename", "load_order", "enabled"),- "type = ?",- arrayOf(type.v.toString()),- null,- null,- null- ).use { cursor ->- while (cursor.moveToNext()) {- dbMods.add(Mod.fromCursor(cursor))- }- }-- val fsNames = mutableSetOf<String>()-- dataFiles.forEach { dataPath ->- val modFiles = File(dataPath).listFiles()?.filter {- when (type) {- ModType.Dir -> it.isDirectory- else -> it.isFile && extensions.contains(it.extension.lowercase(Locale.ROOT))- }- }-- // Blacklist "Data Files" in Directories tab and default plugins in Groundcovers tab.- val blacklist = mutableSetOf<String>()- if (type == ModType.Dir) {- File(dataPath).listFiles()- ?.firstOrNull { it.name.equals("Data Files", ignoreCase = true) }- ?.let { blacklist.add(it.name) }- }- if (type == ModType.Groundcover) {- blacklist.add("Morrowind.esm")- blacklist.add("Tribunal.esm")- blacklist.add("Bloodmoon.esm")- blacklist.add("adamantiumarmor.esp")- blacklist.add("AreaEffectArrows.esp")- blacklist.add("bcsounds.esp")- blacklist.add("EBQ_Artifact.esp")- blacklist.add("entertainers.esp")- blacklist.add("LeFemmArmor.esp")- blacklist.add("master_index.esp")- blacklist.add("Siege at Firemoth.esp")- }-- modFiles?.forEach {- if (!blacklist.contains(it.name)) {- fsNames.add(it.name)- }- }- }-- val dbNames = dbMods.mapTo(mutableSetOf()) { it.filename }-- // Mods present in both the DB and on disk.- dbMods.filter { fsNames.contains(it.filename) }.forEach {- mods.add(it)- }-- // New mods are appended after the current maximum load order.- var maxOrder = mods.maxOfOrNull { it.order } ?: 0-- val newMods = arrayListOf<Mod>()- (fsNames - dbNames).forEach {- maxOrder += 1- val mod = Mod(type, it, maxOrder, false)- newMods.add(mod)- mods.add(mod)- }-- database.beginTransaction()- try {- // Delete mods which remain in the DB but no longer exist on disk.- (dbNames - fsNames).forEach {- database.delete(- "mod",- "type = ? AND filename = ?",- arrayOf(type.v.toString(), it)- )- }-- // Insert newly discovered mods.- newMods.forEach { it.insert(database) }-- database.setTransactionSuccessful()- } finally {- database.endTransaction()- }-- mods.sortBy { it.order }- }-- /**- * Performs DB updates for all mods marked as dirty.- */- fun update() {- val database = db.writableDatabase- database.beginTransaction()-- try {- mods.filter { it.dirty }.forEach {- it.update(database)- it.dirty = false- }- database.setTransactionSuccessful()- } finally {- database.endTransaction()- }- }-}diff --git a/android/app/src/main/java/mods/ModsDatabase.kt b/android/app/src/main/java/mods/ModsDatabase.ktdeleted file mode 100644index b4eb0ce..0000000--- a/android/app/src/main/java/mods/ModsDatabase.kt+++ /dev/null@@ -1,68 +0,0 @@-/*- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package mods--import android.content.Context-import android.database.sqlite.SQLiteDatabase-import android.database.sqlite.SQLiteOpenHelper--class ModsDatabaseOpenHelper private constructor(ctx: Context) :- SQLiteOpenHelper(ctx, DATABASE_NAME, null, DATABASE_VERSION) {-- companion object {- private const val DATABASE_NAME = "ModsDatabase"- private const val DATABASE_VERSION = 1-- @Volatile- private var instance: ModsDatabaseOpenHelper? = null-- fun getInstance(ctx: Context): ModsDatabaseOpenHelper {- return instance ?: synchronized(this) {- instance ?: ModsDatabaseOpenHelper(ctx.applicationContext).also {- instance = it- }- }- }- }-- override fun onCreate(db: SQLiteDatabase) {- db.execSQL(- """- CREATE TABLE IF NOT EXISTS mod (- type INTEGER,- filename TEXT,- load_order INTEGER,- enabled INTEGER- )- """.trimIndent()- )-- db.execSQL("CREATE INDEX IF NOT EXISTS mod_type ON mod(type)")- db.execSQL("CREATE INDEX IF NOT EXISTS mod_filename ON mod(filename)")- db.execSQL("CREATE UNIQUE INDEX IF NOT EXISTS mod_type_name ON mod(type, filename)")- }-- override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {- // Database schema version 1 is unchanged from the original Anko implementation.- }-}--// Access property for Context-val Context.database: ModsDatabaseOpenHelper- get() = ModsDatabaseOpenHelper.getInstance(this)diff --git a/android/app/src/main/java/mods/ModsPaths.kt b/android/app/src/main/java/mods/ModsPaths.ktdeleted file mode 100644index 9b8aaf6..0000000--- a/android/app/src/main/java/mods/ModsPaths.kt+++ /dev/null@@ -1,81 +0,0 @@-/*- Copyright (C) 2026 OpenMW-Android contributors-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-*/--package mods--import android.content.Context-import file.GameInstaller-import java.io.File--/** Shared path handling for the launcher mod manager and openmw.cfg writer. */-object ModsPaths {-- /** Root directory that contains the game's Data Files directory. */- fun gameRoot(ctx: Context): File {- val dataFiles = GameInstaller.getDataFilesFile(ctx)- return dataFiles.parentFile ?: File("")- }-- /** Path list used by the Directories tab. */- fun directoryRoots(ctx: Context): ArrayList<String> =- arrayListOf(gameRoot(ctx).absolutePath)-- /**- * Returns the base Data Files directory plus every additional directory- * next to it. This is used by the mod manager so enable/load-order state- * is preserved even while an additional data directory is disabled.- */- fun allDataDirectories(ctx: Context): ArrayList<String> {- val dataFiles = GameInstaller.getDataFilesFile(ctx)- val result = arrayListOf(dataFiles.absolutePath)- val root = dataFiles.parentFile ?: return result-- root.listFiles()- ?.asSequence()- ?.filter { it.isDirectory }- ?.filterNot { it.absoluteFile == dataFiles.absoluteFile }- ?.mapTo(result) { it.absolutePath }-- return result- }-- /**- * Returns the base Data Files directory plus only additional data- * directories that are enabled in the launcher.- */- fun activeDataDirectories(- ctx: Context,- db: ModsDatabaseOpenHelper = ModsDatabaseOpenHelper.getInstance(ctx)- ): ArrayList<String> {- val dataFiles = GameInstaller.getDataFilesFile(ctx)- val result = arrayListOf(dataFiles.absolutePath)- val root = dataFiles.parentFile ?: return result-- val directories = ModsCollection(- ModType.Dir,- arrayListOf(root.absolutePath),- db- )-- directories.mods- .asSequence()- .filter { it.enabled }- .map { File(root, it.filename) }- .filter { it.isDirectory }- .mapTo(result) { it.absolutePath }-- return result- }-- /** Returns true if [filename] is present in at least one active data directory. */- fun fileExistsIn(filename: String, dataDirectories: Collection<String>): Boolean =- dataDirectories.any { File(it, filename).isFile }-}diff --git a/android/app/src/main/java/org/libsdl/app/HIDDevice.java b/android/app/src/main/java/org/libsdl/app/HIDDevice.javadeleted file mode 100644index 955df5d..0000000--- a/android/app/src/main/java/org/libsdl/app/HIDDevice.java+++ /dev/null@@ -1,22 +0,0 @@-package org.libsdl.app;--import android.hardware.usb.UsbDevice;--interface HIDDevice-{- public int getId();- public int getVendorId();- public int getProductId();- public String getSerialNumber();- public int getVersion();- public String getManufacturerName();- public String getProductName();- public UsbDevice getDevice();- public boolean open();- public int sendFeatureReport(byte[] report);- public int sendOutputReport(byte[] report);- public boolean getFeatureReport(byte[] report);- public void setFrozen(boolean frozen);- public void close();- public void shutdown();-}diff --git a/android/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java b/android/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.javadeleted file mode 100644index 30f079c..0000000--- a/android/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java+++ /dev/null@@ -1,649 +0,0 @@-package org.libsdl.app;--import android.content.Context;-import android.bluetooth.BluetoothDevice;-import android.bluetooth.BluetoothGatt;-import android.bluetooth.BluetoothGattCallback;-import android.bluetooth.BluetoothGattCharacteristic;-import android.bluetooth.BluetoothGattDescriptor;-import android.bluetooth.BluetoothManager;-import android.bluetooth.BluetoothProfile;-import android.bluetooth.BluetoothGattService;-import android.hardware.usb.UsbDevice;-import android.os.Handler;-import android.os.Looper;-import android.util.Log;-import android.os.*;--//import com.android.internal.util.HexDump;--import java.lang.Runnable;-import java.util.Arrays;-import java.util.LinkedList;-import java.util.UUID;--class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDevice {-- private static final String TAG = "hidapi";- private HIDDeviceManager mManager;- private BluetoothDevice mDevice;- private int mDeviceId;- private BluetoothGatt mGatt;- private boolean mIsRegistered = false;- private boolean mIsConnected = false;- private boolean mIsChromebook = false;- private boolean mIsReconnecting = false;- private boolean mFrozen = false;- private LinkedList<GattOperation> mOperations;- GattOperation mCurrentOperation = null;- private Handler mHandler;-- private static final int TRANSPORT_AUTO = 0;- private static final int TRANSPORT_BREDR = 1;- private static final int TRANSPORT_LE = 2;-- private static final int CHROMEBOOK_CONNECTION_CHECK_INTERVAL = 10000;-- static public final UUID steamControllerService = UUID.fromString("100F6C32-1735-4313-B402-38567131E5F3");- static public final UUID inputCharacteristic = UUID.fromString("100F6C33-1735-4313-B402-38567131E5F3");- static public final UUID reportCharacteristic = UUID.fromString("100F6C34-1735-4313-B402-38567131E5F3");- static private final byte[] enterValveMode = new byte[] { (byte)0xC0, (byte)0x87, 0x03, 0x08, 0x07, 0x00 };-- static class GattOperation {- private enum Operation {- CHR_READ,- CHR_WRITE,- ENABLE_NOTIFICATION- }-- Operation mOp;- UUID mUuid;- byte[] mValue;- BluetoothGatt mGatt;- boolean mResult = true;-- private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid) {- mGatt = gatt;- mOp = operation;- mUuid = uuid;- }-- private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid, byte[] value) {- mGatt = gatt;- mOp = operation;- mUuid = uuid;- mValue = value;- }-- public void run() {- // This is executed in main thread- BluetoothGattCharacteristic chr;-- switch (mOp) {- case CHR_READ:- chr = getCharacteristic(mUuid);- //Log.v(TAG, "Reading characteristic " + chr.getUuid());- if (!mGatt.readCharacteristic(chr)) {- Log.e(TAG, "Unable to read characteristic " + mUuid.toString());- mResult = false;- break;- }- mResult = true;- break;- case CHR_WRITE:- chr = getCharacteristic(mUuid);- //Log.v(TAG, "Writing characteristic " + chr.getUuid() + " value=" + HexDump.toHexString(value));- chr.setValue(mValue);- if (!mGatt.writeCharacteristic(chr)) {- Log.e(TAG, "Unable to write characteristic " + mUuid.toString());- mResult = false;- break;- }- mResult = true;- break;- case ENABLE_NOTIFICATION:- chr = getCharacteristic(mUuid);- //Log.v(TAG, "Writing descriptor of " + chr.getUuid());- if (chr != null) {- BluetoothGattDescriptor cccd = chr.getDescriptor(UUID.fromString("00002902-0000-1000-8000-00805f9b34fb"));- if (cccd != null) {- int properties = chr.getProperties();- byte[] value;- if ((properties & BluetoothGattCharacteristic.PROPERTY_NOTIFY) == BluetoothGattCharacteristic.PROPERTY_NOTIFY) {- value = BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE;- } else if ((properties & BluetoothGattCharacteristic.PROPERTY_INDICATE) == BluetoothGattCharacteristic.PROPERTY_INDICATE) {- value = BluetoothGattDescriptor.ENABLE_INDICATION_VALUE;- } else {- Log.e(TAG, "Unable to start notifications on input characteristic");- mResult = false;- return;- }-- mGatt.setCharacteristicNotification(chr, true);- cccd.setValue(value);- if (!mGatt.writeDescriptor(cccd)) {- Log.e(TAG, "Unable to write descriptor " + mUuid.toString());- mResult = false;- return;- }- mResult = true;- }- }- }- }-- public boolean finish() {- return mResult;- }-- private BluetoothGattCharacteristic getCharacteristic(UUID uuid) {- BluetoothGattService valveService = mGatt.getService(steamControllerService);- if (valveService == null)- return null;- return valveService.getCharacteristic(uuid);- }-- static public GattOperation readCharacteristic(BluetoothGatt gatt, UUID uuid) {- return new GattOperation(gatt, Operation.CHR_READ, uuid);- }-- static public GattOperation writeCharacteristic(BluetoothGatt gatt, UUID uuid, byte[] value) {- return new GattOperation(gatt, Operation.CHR_WRITE, uuid, value);- }-- static public GattOperation enableNotification(BluetoothGatt gatt, UUID uuid) {- return new GattOperation(gatt, Operation.ENABLE_NOTIFICATION, uuid);- }- }-- public HIDDeviceBLESteamController(HIDDeviceManager manager, BluetoothDevice device) {- mManager = manager;- mDevice = device;- mDeviceId = mManager.getDeviceIDForIdentifier(getIdentifier());- mIsRegistered = false;- mIsChromebook = mManager.getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");- mOperations = new LinkedList<GattOperation>();- mHandler = new Handler(Looper.getMainLooper());-- mGatt = connectGatt();- // final HIDDeviceBLESteamController finalThis = this;- // mHandler.postDelayed(new Runnable() {- // @Override- // public void run() {- // finalThis.checkConnectionForChromebookIssue();- // }- // }, CHROMEBOOK_CONNECTION_CHECK_INTERVAL);- }-- public String getIdentifier() {- return String.format("SteamController.%s", mDevice.getAddress());- }-- public BluetoothGatt getGatt() {- return mGatt;- }-- // Because on Chromebooks we show up as a dual-mode device, it will attempt to connect TRANSPORT_AUTO, which will use TRANSPORT_BREDR instead- // of TRANSPORT_LE. Let's force ourselves to connect low energy.- private BluetoothGatt connectGatt(boolean managed) {- if (Build.VERSION.SDK_INT >= 23) {- try {- return mDevice.connectGatt(mManager.getContext(), managed, this, TRANSPORT_LE);- } catch (Exception e) {- return mDevice.connectGatt(mManager.getContext(), managed, this);- }- } else {- return mDevice.connectGatt(mManager.getContext(), managed, this);- }- }-- private BluetoothGatt connectGatt() {- return connectGatt(false);- }-- protected int getConnectionState() {-- Context context = mManager.getContext();- if (context == null) {- // We are lacking any context to get our Bluetooth information. We'll just assume disconnected.- return BluetoothProfile.STATE_DISCONNECTED;- }-- BluetoothManager btManager = (BluetoothManager)context.getSystemService(Context.BLUETOOTH_SERVICE);- if (btManager == null) {- // This device doesn't support Bluetooth. We should never be here, because how did- // we instantiate a device to start with?- return BluetoothProfile.STATE_DISCONNECTED;- }-- return btManager.getConnectionState(mDevice, BluetoothProfile.GATT);- }-- public void reconnect() {-- if (getConnectionState() != BluetoothProfile.STATE_CONNECTED) {- mGatt.disconnect();- mGatt = connectGatt();- }-- }-- protected void checkConnectionForChromebookIssue() {- if (!mIsChromebook) {- // We only do this on Chromebooks, because otherwise it's really annoying to just attempt- // over and over.- return;- }-- int connectionState = getConnectionState();-- switch (connectionState) {- case BluetoothProfile.STATE_CONNECTED:- if (!mIsConnected) {- // We are in the Bad Chromebook Place. We can force a disconnect- // to try to recover.- Log.v(TAG, "Chromebook: We are in a very bad state; the controller shows as connected in the underlying Bluetooth layer, but we never received a callback. Forcing a reconnect.");- mIsReconnecting = true;- mGatt.disconnect();- mGatt = connectGatt(false);- break;- }- else if (!isRegistered()) {- if (mGatt.getServices().size() > 0) {- Log.v(TAG, "Chromebook: We are connected to a controller, but never got our registration. Trying to recover.");- probeService(this);- }- else {- Log.v(TAG, "Chromebook: We are connected to a controller, but never discovered services. Trying to recover.");- mIsReconnecting = true;- mGatt.disconnect();- mGatt = connectGatt(false);- break;- }- }- else {- Log.v(TAG, "Chromebook: We are connected, and registered. Everything's good!");- return;- }- break;-- case BluetoothProfile.STATE_DISCONNECTED:- Log.v(TAG, "Chromebook: We have either been disconnected, or the Chromebook BtGatt.ContextMap bug has bitten us. Attempting a disconnect/reconnect, but we may not be able to recover.");-- mIsReconnecting = true;- mGatt.disconnect();- mGatt = connectGatt(false);- break;-- case BluetoothProfile.STATE_CONNECTING:- Log.v(TAG, "Chromebook: We're still trying to connect. Waiting a bit longer.");- break;- }-- final HIDDeviceBLESteamController finalThis = this;- mHandler.postDelayed(new Runnable() {- @Override- public void run() {- finalThis.checkConnectionForChromebookIssue();- }- }, CHROMEBOOK_CONNECTION_CHECK_INTERVAL);- }-- private boolean isRegistered() {- return mIsRegistered;- }-- private void setRegistered() {- mIsRegistered = true;- }-- private boolean probeService(HIDDeviceBLESteamController controller) {-- if (isRegistered()) {- return true;- }-- if (!mIsConnected) {- return false;- }-- Log.v(TAG, "probeService controller=" + controller);-- for (BluetoothGattService service : mGatt.getServices()) {- if (service.getUuid().equals(steamControllerService)) {- Log.v(TAG, "Found Valve steam controller service " + service.getUuid());-- for (BluetoothGattCharacteristic chr : service.getCharacteristics()) {- if (chr.getUuid().equals(inputCharacteristic)) {- Log.v(TAG, "Found input characteristic");- // Start notifications- BluetoothGattDescriptor cccd = chr.getDescriptor(UUID.fromString("00002902-0000-1000-8000-00805f9b34fb"));- if (cccd != null) {- enableNotification(chr.getUuid());- }- }- }- return true;- }- }-- if ((mGatt.getServices().size() == 0) && mIsChromebook && !mIsReconnecting) {- Log.e(TAG, "Chromebook: Discovered services were empty; this almost certainly means the BtGatt.ContextMap bug has bitten us.");- mIsConnected = false;- mIsReconnecting = true;- mGatt.disconnect();- mGatt = connectGatt(false);- }-- return false;- }-- //////////////////////////////////////////////////////////////////////////////////////////////////////- //////////////////////////////////////////////////////////////////////////////////////////////////////- //////////////////////////////////////////////////////////////////////////////////////////////////////-- private void finishCurrentGattOperation() {- GattOperation op = null;- synchronized (mOperations) {- if (mCurrentOperation != null) {- op = mCurrentOperation;- mCurrentOperation = null;- }- }- if (op != null) {- boolean result = op.finish(); // TODO: Maybe in main thread as well?-- // Our operation failed, let's add it back to the beginning of our queue.- if (!result) {- mOperations.addFirst(op);- }- }- executeNextGattOperation();- }-- private void executeNextGattOperation() {- synchronized (mOperations) {- if (mCurrentOperation != null)- return;-- if (mOperations.isEmpty())- return;-- mCurrentOperation = mOperations.removeFirst();- }-- // Run in main thread- mHandler.post(new Runnable() {- @Override- public void run() {- synchronized (mOperations) {- if (mCurrentOperation == null) {- Log.e(TAG, "Current operation null in executor?");- return;- }-- mCurrentOperation.run();- // now wait for the GATT callback and when it comes, finish this operation- }- }- });- }-- private void queueGattOperation(GattOperation op) {- synchronized (mOperations) {- mOperations.add(op);- }- executeNextGattOperation();- }-- private void enableNotification(UUID chrUuid) {- GattOperation op = HIDDeviceBLESteamController.GattOperation.enableNotification(mGatt, chrUuid);- queueGattOperation(op);- }-- public void writeCharacteristic(UUID uuid, byte[] value) {- GattOperation op = HIDDeviceBLESteamController.GattOperation.writeCharacteristic(mGatt, uuid, value);- queueGattOperation(op);- }-- public void readCharacteristic(UUID uuid) {- GattOperation op = HIDDeviceBLESteamController.GattOperation.readCharacteristic(mGatt, uuid);- queueGattOperation(op);- }-- //////////////////////////////////////////////////////////////////////////////////////////////////////- ////////////// BluetoothGattCallback overridden methods- //////////////////////////////////////////////////////////////////////////////////////////////////////-- public void onConnectionStateChange(BluetoothGatt g, int status, int newState) {- //Log.v(TAG, "onConnectionStateChange status=" + status + " newState=" + newState);- mIsReconnecting = false;- if (newState == 2) {- mIsConnected = true;- // Run directly, without GattOperation- if (!isRegistered()) {- mHandler.post(new Runnable() {- @Override- public void run() {- mGatt.discoverServices();- }- });- }- }- else if (newState == 0) {- mIsConnected = false;- }-- // Disconnection is handled in SteamLink using the ACTION_ACL_DISCONNECTED Intent.- }-- public void onServicesDiscovered(BluetoothGatt gatt, int status) {- //Log.v(TAG, "onServicesDiscovered status=" + status);- if (status == 0) {- if (gatt.getServices().size() == 0) {- Log.v(TAG, "onServicesDiscovered returned zero services; something has gone horribly wrong down in Android's Bluetooth stack.");- mIsReconnecting = true;- mIsConnected = false;- gatt.disconnect();- mGatt = connectGatt(false);- }- else {- probeService(this);- }- }- }-- public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {- //Log.v(TAG, "onCharacteristicRead status=" + status + " uuid=" + characteristic.getUuid());-- if (characteristic.getUuid().equals(reportCharacteristic) && !mFrozen) {- mManager.HIDDeviceFeatureReport(getId(), characteristic.getValue());- }-- finishCurrentGattOperation();- }-- public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {- //Log.v(TAG, "onCharacteristicWrite status=" + status + " uuid=" + characteristic.getUuid());-- if (characteristic.getUuid().equals(reportCharacteristic)) {- // Only register controller with the native side once it has been fully configured- if (!isRegistered()) {- Log.v(TAG, "Registering Steam Controller with ID: " + getId());- mManager.HIDDeviceConnected(getId(), getIdentifier(), getVendorId(), getProductId(), getSerialNumber(), getVersion(), getManufacturerName(), getProductName(), 0, 0, 0, 0);- setRegistered();- }- }-- finishCurrentGattOperation();- }-- public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {- // Enable this for verbose logging of controller input reports- //Log.v(TAG, "onCharacteristicChanged uuid=" + characteristic.getUuid() + " data=" + HexDump.dumpHexString(characteristic.getValue()));-- if (characteristic.getUuid().equals(inputCharacteristic) && !mFrozen) {- mManager.HIDDeviceInputReport(getId(), characteristic.getValue());- }- }-- public void onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {- //Log.v(TAG, "onDescriptorRead status=" + status);- }-- public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {- BluetoothGattCharacteristic chr = descriptor.getCharacteristic();- //Log.v(TAG, "onDescriptorWrite status=" + status + " uuid=" + chr.getUuid() + " descriptor=" + descriptor.getUuid());-- if (chr.getUuid().equals(inputCharacteristic)) {- boolean hasWrittenInputDescriptor = true;- BluetoothGattCharacteristic reportChr = chr.getService().getCharacteristic(reportCharacteristic);- if (reportChr != null) {- Log.v(TAG, "Writing report characteristic to enter valve mode");- reportChr.setValue(enterValveMode);- gatt.writeCharacteristic(reportChr);- }- }-- finishCurrentGattOperation();- }-- public void onReliableWriteCompleted(BluetoothGatt gatt, int status) {- //Log.v(TAG, "onReliableWriteCompleted status=" + status);- }-- public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) {- //Log.v(TAG, "onReadRemoteRssi status=" + status);- }-- public void onMtuChanged(BluetoothGatt gatt, int mtu, int status) {- //Log.v(TAG, "onMtuChanged status=" + status);- }-- //////////////////////////////////////////////////////////////////////////////////////////////////////- //////// Public API- //////////////////////////////////////////////////////////////////////////////////////////////////////-- @Override- public int getId() {- return mDeviceId;- }-- @Override- public int getVendorId() {- // Valve Corporation- final int VALVE_USB_VID = 0x28DE;- return VALVE_USB_VID;- }-- @Override- public int getProductId() {- // We don't have an easy way to query from the Bluetooth device, but we know what it is- final int D0G_BLE2_PID = 0x1106;- return D0G_BLE2_PID;- }-- @Override- public String getSerialNumber() {- // This will be read later via feature report by Steam- return "12345";- }-- @Override- public int getVersion() {- return 0;- }-- @Override- public String getManufacturerName() {- return "Valve Corporation";- }-- @Override- public String getProductName() {- return "Steam Controller";- }-- @Override- public UsbDevice getDevice() {- return null;- }-- @Override- public boolean open() {- return true;- }-- @Override- public int sendFeatureReport(byte[] report) {- if (!isRegistered()) {- Log.e(TAG, "Attempted sendFeatureReport before Steam Controller is registered!");- if (mIsConnected) {- probeService(this);- }- return -1;- }-- // We need to skip the first byte, as that doesn't go over the air- byte[] actual_report = Arrays.copyOfRange(report, 1, report.length - 1);- //Log.v(TAG, "sendFeatureReport " + HexDump.dumpHexString(actual_report));- writeCharacteristic(reportCharacteristic, actual_report);- return report.length;- }-- @Override- public int sendOutputReport(byte[] report) {- if (!isRegistered()) {- Log.e(TAG, "Attempted sendOutputReport before Steam Controller is registered!");- if (mIsConnected) {- probeService(this);- }- return -1;- }-- //Log.v(TAG, "sendFeatureReport " + HexDump.dumpHexString(report));- writeCharacteristic(reportCharacteristic, report);- return report.length;- }-- @Override- public boolean getFeatureReport(byte[] report) {- if (!isRegistered()) {- Log.e(TAG, "Attempted getFeatureReport before Steam Controller is registered!");- if (mIsConnected) {- probeService(this);- }- return false;- }-- //Log.v(TAG, "getFeatureReport");- readCharacteristic(reportCharacteristic);- return true;- }-- @Override- public void close() {- }-- @Override- public void setFrozen(boolean frozen) {- mFrozen = frozen;- }-- @Override- public void shutdown() {- close();-- BluetoothGatt g = mGatt;- if (g != null) {- g.disconnect();- g.close();- mGatt = null;- }- mManager = null;- mIsRegistered = false;- mIsConnected = false;- mOperations.clear();- }--}diff --git a/android/app/src/main/java/org/libsdl/app/HIDDeviceManager.java b/android/app/src/main/java/org/libsdl/app/HIDDeviceManager.javadeleted file mode 100644index 802c725..0000000--- a/android/app/src/main/java/org/libsdl/app/HIDDeviceManager.java+++ /dev/null@@ -1,675 +0,0 @@-package org.libsdl.app;--import android.app.Activity;-import android.app.AlertDialog;-import android.app.PendingIntent;-import android.bluetooth.BluetoothAdapter;-import android.bluetooth.BluetoothDevice;-import android.bluetooth.BluetoothManager;-import android.bluetooth.BluetoothProfile;-import android.os.Build;-import android.util.Log;-import android.content.BroadcastReceiver;-import android.content.Context;-import android.content.DialogInterface;-import android.content.Intent;-import android.content.IntentFilter;-import android.content.SharedPreferences;-import android.content.pm.PackageManager;-import android.hardware.usb.*;-import android.os.Handler;-import android.os.Looper;--import java.util.ArrayList;-import java.util.HashMap;-import java.util.Iterator;-import java.util.List;--public class HIDDeviceManager {- private static final String TAG = "hidapi";- private static final String ACTION_USB_PERMISSION = "org.libsdl.app.USB_PERMISSION";-- private static HIDDeviceManager sManager;- private static int sManagerRefCount = 0;-- public static HIDDeviceManager acquire(Context context) {- if (sManagerRefCount == 0) {- sManager = new HIDDeviceManager(context);- }- ++sManagerRefCount;- return sManager;- }-- public static void release(HIDDeviceManager manager) {- if (manager == sManager) {- --sManagerRefCount;- if (sManagerRefCount == 0) {- sManager.close();- sManager = null;- }- }- }-- private Context mContext;- private HashMap<Integer, HIDDevice> mDevicesById = new HashMap<Integer, HIDDevice>();- private HashMap<BluetoothDevice, HIDDeviceBLESteamController> mBluetoothDevices = new HashMap<BluetoothDevice, HIDDeviceBLESteamController>();- private int mNextDeviceId = 0;- private SharedPreferences mSharedPreferences = null;- private boolean mIsChromebook = false;- private UsbManager mUsbManager;- private Handler mHandler;- private BluetoothManager mBluetoothManager;- private List<BluetoothDevice> mLastBluetoothDevices;-- private final BroadcastReceiver mUsbBroadcast = new BroadcastReceiver() {- @Override- public void onReceive(Context context, Intent intent) {- String action = intent.getAction();- if (action.equals(UsbManager.ACTION_USB_DEVICE_ATTACHED)) {- UsbDevice usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);- handleUsbDeviceAttached(usbDevice);- } else if (action.equals(UsbManager.ACTION_USB_DEVICE_DETACHED)) {- UsbDevice usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);- handleUsbDeviceDetached(usbDevice);- } else if (action.equals(HIDDeviceManager.ACTION_USB_PERMISSION)) {- UsbDevice usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);- handleUsbDevicePermission(usbDevice, intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false));- }- }- };-- private final BroadcastReceiver mBluetoothBroadcast = new BroadcastReceiver() {- @Override- public void onReceive(Context context, Intent intent) {- String action = intent.getAction();- // Bluetooth device was connected. If it was a Steam Controller, handle it- if (action.equals(BluetoothDevice.ACTION_ACL_CONNECTED)) {- BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);- Log.d(TAG, "Bluetooth device connected: " + device);-- if (isSteamController(device)) {- connectBluetoothDevice(device);- }- }-- // Bluetooth device was disconnected, remove from controller manager (if any)- if (action.equals(BluetoothDevice.ACTION_ACL_DISCONNECTED)) {- BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);- Log.d(TAG, "Bluetooth device disconnected: " + device);-- disconnectBluetoothDevice(device);- }- }- };-- private HIDDeviceManager(final Context context) {- mContext = context;-- HIDDeviceRegisterCallback();-- mSharedPreferences = mContext.getSharedPreferences("hidapi", Context.MODE_PRIVATE);- mIsChromebook = mContext.getPackageManager().hasSystemFeature("org.chromium.arc.device_management");--// if (shouldClear) {-// SharedPreferences.Editor spedit = mSharedPreferences.edit();-// spedit.clear();-// spedit.commit();-// }-// else- {- mNextDeviceId = mSharedPreferences.getInt("next_device_id", 0);- }- }-- public Context getContext() {- return mContext;- }-- public int getDeviceIDForIdentifier(String identifier) {- SharedPreferences.Editor spedit = mSharedPreferences.edit();-- int result = mSharedPreferences.getInt(identifier, 0);- if (result == 0) {- result = mNextDeviceId++;- spedit.putInt("next_device_id", mNextDeviceId);- }-- spedit.putInt(identifier, result);- spedit.commit();- return result;- }-- private void initializeUSB() {- mUsbManager = (UsbManager)mContext.getSystemService(Context.USB_SERVICE);- if (mUsbManager == null) {- return;- }-- /*- // Logging- for (UsbDevice device : mUsbManager.getDeviceList().values()) {- Log.i(TAG,"Path: " + device.getDeviceName());- Log.i(TAG,"Manufacturer: " + device.getManufacturerName());- Log.i(TAG,"Product: " + device.getProductName());- Log.i(TAG,"ID: " + device.getDeviceId());- Log.i(TAG,"Class: " + device.getDeviceClass());- Log.i(TAG,"Protocol: " + device.getDeviceProtocol());- Log.i(TAG,"Vendor ID " + device.getVendorId());- Log.i(TAG,"Product ID: " + device.getProductId());- Log.i(TAG,"Interface count: " + device.getInterfaceCount());- Log.i(TAG,"---------------------------------------");-- // Get interface details- for (int index = 0; index < device.getInterfaceCount(); index++) {- UsbInterface mUsbInterface = device.getInterface(index);- Log.i(TAG," ***** *****");- Log.i(TAG," Interface index: " + index);- Log.i(TAG," Interface ID: " + mUsbInterface.getId());- Log.i(TAG," Interface class: " + mUsbInterface.getInterfaceClass());- Log.i(TAG," Interface subclass: " + mUsbInterface.getInterfaceSubclass());- Log.i(TAG," Interface protocol: " + mUsbInterface.getInterfaceProtocol());- Log.i(TAG," Endpoint count: " + mUsbInterface.getEndpointCount());-- // Get endpoint details- for (int epi = 0; epi < mUsbInterface.getEndpointCount(); epi++)- {- UsbEndpoint mEndpoint = mUsbInterface.getEndpoint(epi);- Log.i(TAG," ++++ ++++ ++++");- Log.i(TAG," Endpoint index: " + epi);- Log.i(TAG," Attributes: " + mEndpoint.getAttributes());- Log.i(TAG," Direction: " + mEndpoint.getDirection());- Log.i(TAG," Number: " + mEndpoint.getEndpointNumber());- Log.i(TAG," Interval: " + mEndpoint.getInterval());- Log.i(TAG," Packet size: " + mEndpoint.getMaxPacketSize());- Log.i(TAG," Type: " + mEndpoint.getType());- }- }- }- Log.i(TAG," No more devices connected.");- */-- // Register for USB broadcasts and permission completions- IntentFilter filter = new IntentFilter();- filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);- filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);- filter.addAction(HIDDeviceManager.ACTION_USB_PERMISSION);- mContext.registerReceiver(mUsbBroadcast, filter);-- for (UsbDevice usbDevice : mUsbManager.getDeviceList().values()) {- handleUsbDeviceAttached(usbDevice);- }- }-- UsbManager getUSBManager() {- return mUsbManager;- }-- private void shutdownUSB() {- try {- mContext.unregisterReceiver(mUsbBroadcast);- } catch (Exception e) {- // We may not have registered, that's okay- }- }-- private boolean isHIDDeviceInterface(UsbDevice usbDevice, UsbInterface usbInterface) {- if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_HID) {- return true;- }- if (isXbox360Controller(usbDevice, usbInterface) || isXboxOneController(usbDevice, usbInterface)) {- return true;- }- return false;- }-- private boolean isXbox360Controller(UsbDevice usbDevice, UsbInterface usbInterface) {- final int XB360_IFACE_SUBCLASS = 93;- final int XB360_IFACE_PROTOCOL = 1; // Wired- final int XB360W_IFACE_PROTOCOL = 129; // Wireless- final int[] SUPPORTED_VENDORS = {- 0x0079, // GPD Win 2- 0x044f, // Thrustmaster- 0x045e, // Microsoft- 0x046d, // Logitech- 0x056e, // Elecom- 0x06a3, // Saitek- 0x0738, // Mad Catz- 0x07ff, // Mad Catz- 0x0e6f, // PDP- 0x0f0d, // Hori- 0x1038, // SteelSeries- 0x11c9, // Nacon- 0x12ab, // Unknown- 0x1430, // RedOctane- 0x146b, // BigBen- 0x1532, // Razer Sabertooth- 0x15e4, // Numark- 0x162e, // Joytech- 0x1689, // Razer Onza- 0x1949, // Lab126, Inc.- 0x1bad, // Harmonix- 0x24c6, // PowerA- };-- if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC &&- usbInterface.getInterfaceSubclass() == XB360_IFACE_SUBCLASS &&- (usbInterface.getInterfaceProtocol() == XB360_IFACE_PROTOCOL ||- usbInterface.getInterfaceProtocol() == XB360W_IFACE_PROTOCOL)) {- int vendor_id = usbDevice.getVendorId();- for (int supportedVid : SUPPORTED_VENDORS) {- if (vendor_id == supportedVid) {- return true;- }- }- }- return false;- }-- private boolean isXboxOneController(UsbDevice usbDevice, UsbInterface usbInterface) {- final int XB1_IFACE_SUBCLASS = 71;- final int XB1_IFACE_PROTOCOL = 208;- final int[] SUPPORTED_VENDORS = {- 0x045e, // Microsoft- 0x0738, // Mad Catz- 0x0e6f, // PDP- 0x0f0d, // Hori- 0x1532, // Razer Wildcat- 0x24c6, // PowerA- 0x2e24, // Hyperkin- };-- if (usbInterface.getId() == 0 &&- usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC &&- usbInterface.getInterfaceSubclass() == XB1_IFACE_SUBCLASS &&- usbInterface.getInterfaceProtocol() == XB1_IFACE_PROTOCOL) {- int vendor_id = usbDevice.getVendorId();- for (int supportedVid : SUPPORTED_VENDORS) {- if (vendor_id == supportedVid) {- return true;- }- }- }- return false;- }-- private void handleUsbDeviceAttached(UsbDevice usbDevice) {- connectHIDDeviceUSB(usbDevice);- }-- private void handleUsbDeviceDetached(UsbDevice usbDevice) {- List<Integer> devices = new ArrayList<Integer>();- for (HIDDevice device : mDevicesById.values()) {- if (usbDevice.equals(device.getDevice())) {- devices.add(device.getId());- }- }- for (int id : devices) {- HIDDevice device = mDevicesById.get(id);- mDevicesById.remove(id);- device.shutdown();- HIDDeviceDisconnected(id);- }- }-- private void handleUsbDevicePermission(UsbDevice usbDevice, boolean permission_granted) {- for (HIDDevice device : mDevicesById.values()) {- if (usbDevice.equals(device.getDevice())) {- boolean opened = false;- if (permission_granted) {- opened = device.open();- }- HIDDeviceOpenResult(device.getId(), opened);- }- }- }-- private void connectHIDDeviceUSB(UsbDevice usbDevice) {- synchronized (this) {- int interface_mask = 0;- for (int interface_index = 0; interface_index < usbDevice.getInterfaceCount(); interface_index++) {- UsbInterface usbInterface = usbDevice.getInterface(interface_index);- if (isHIDDeviceInterface(usbDevice, usbInterface)) {- // Check to see if we've already added this interface- // This happens with the Xbox Series X controller which has a duplicate interface 0, which is inactive- int interface_id = usbInterface.getId();- if ((interface_mask & (1 << interface_id)) != 0) {- continue;- }- interface_mask |= (1 << interface_id);-- HIDDeviceUSB device = new HIDDeviceUSB(this, usbDevice, interface_index);- int id = device.getId();- mDevicesById.put(id, device);- HIDDeviceConnected(id, device.getIdentifier(), device.getVendorId(), device.getProductId(), device.getSerialNumber(), device.getVersion(), device.getManufacturerName(), device.getProductName(), usbInterface.getId(), usbInterface.getInterfaceClass(), usbInterface.getInterfaceSubclass(), usbInterface.getInterfaceProtocol());- }- }- }- }-- private void initializeBluetooth() {- Log.d(TAG, "Initializing Bluetooth");-- if (Build.VERSION.SDK_INT <= 30 &&- mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {- Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH");- return;- }-- if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE) || (Build.VERSION.SDK_INT < 18)) {- Log.d(TAG, "Couldn't initialize Bluetooth, this version of Android does not support Bluetooth LE");- return;- }-- // Find bonded bluetooth controllers and create SteamControllers for them- mBluetoothManager = (BluetoothManager)mContext.getSystemService(Context.BLUETOOTH_SERVICE);- if (mBluetoothManager == null) {- // This device doesn't support Bluetooth.- return;- }-- BluetoothAdapter btAdapter = mBluetoothManager.getAdapter();- if (btAdapter == null) {- // This device has Bluetooth support in the codebase, but has no available adapters.- return;- }-- // Get our bonded devices.- for (BluetoothDevice device : btAdapter.getBondedDevices()) {-- Log.d(TAG, "Bluetooth device available: " + device);- if (isSteamController(device)) {- connectBluetoothDevice(device);- }-- }-- // NOTE: These don't work on Chromebooks, to my undying dismay.- IntentFilter filter = new IntentFilter();- filter.addAction(BluetoothDevice.ACTION_ACL_CONNECTED);- filter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED);- mContext.registerReceiver(mBluetoothBroadcast, filter);-- if (mIsChromebook) {- mHandler = new Handler(Looper.getMainLooper());- mLastBluetoothDevices = new ArrayList<BluetoothDevice>();-- // final HIDDeviceManager finalThis = this;- // mHandler.postDelayed(new Runnable() {- // @Override- // public void run() {- // finalThis.chromebookConnectionHandler();- // }- // }, 5000);- }- }-- private void shutdownBluetooth() {- try {- mContext.unregisterReceiver(mBluetoothBroadcast);- } catch (Exception e) {- // We may not have registered, that's okay- }- }-- // Chromebooks do not pass along ACTION_ACL_CONNECTED / ACTION_ACL_DISCONNECTED properly.- // This function provides a sort of dummy version of that, watching for changes in the- // connected devices and attempting to add controllers as things change.- public void chromebookConnectionHandler() {- if (!mIsChromebook) {- return;- }-- ArrayList<BluetoothDevice> disconnected = new ArrayList<BluetoothDevice>();- ArrayList<BluetoothDevice> connected = new ArrayList<BluetoothDevice>();-- List<BluetoothDevice> currentConnected = mBluetoothManager.getConnectedDevices(BluetoothProfile.GATT);-- for (BluetoothDevice bluetoothDevice : currentConnected) {- if (!mLastBluetoothDevices.contains(bluetoothDevice)) {- connected.add(bluetoothDevice);- }- }- for (BluetoothDevice bluetoothDevice : mLastBluetoothDevices) {- if (!currentConnected.contains(bluetoothDevice)) {- disconnected.add(bluetoothDevice);- }- }-- mLastBluetoothDevices = currentConnected;-- for (BluetoothDevice bluetoothDevice : disconnected) {- disconnectBluetoothDevice(bluetoothDevice);- }- for (BluetoothDevice bluetoothDevice : connected) {- connectBluetoothDevice(bluetoothDevice);- }-- final HIDDeviceManager finalThis = this;- mHandler.postDelayed(new Runnable() {- @Override- public void run() {- finalThis.chromebookConnectionHandler();- }- }, 10000);- }-- public boolean connectBluetoothDevice(BluetoothDevice bluetoothDevice) {- Log.v(TAG, "connectBluetoothDevice device=" + bluetoothDevice);- synchronized (this) {- if (mBluetoothDevices.containsKey(bluetoothDevice)) {- Log.v(TAG, "Steam controller with address " + bluetoothDevice + " already exists, attempting reconnect");-- HIDDeviceBLESteamController device = mBluetoothDevices.get(bluetoothDevice);- device.reconnect();-- return false;- }- HIDDeviceBLESteamController device = new HIDDeviceBLESteamController(this, bluetoothDevice);- int id = device.getId();- mBluetoothDevices.put(bluetoothDevice, device);- mDevicesById.put(id, device);-- // The Steam Controller will mark itself connected once initialization is complete- }- return true;- }-- public void disconnectBluetoothDevice(BluetoothDevice bluetoothDevice) {- synchronized (this) {- HIDDeviceBLESteamController device = mBluetoothDevices.get(bluetoothDevice);- if (device == null)- return;-- int id = device.getId();- mBluetoothDevices.remove(bluetoothDevice);- mDevicesById.remove(id);- device.shutdown();- HIDDeviceDisconnected(id);- }- }-- public boolean isSteamController(BluetoothDevice bluetoothDevice) {- // Sanity check. If you pass in a null device, by definition it is never a Steam Controller.- if (bluetoothDevice == null) {- return false;- }-- // If the device has no local name, we really don't want to try an equality check against it.- if (bluetoothDevice.getName() == null) {- return false;- }-- return bluetoothDevice.getName().equals("SteamController") && ((bluetoothDevice.getType() & BluetoothDevice.DEVICE_TYPE_LE) != 0);- }-- private void close() {- shutdownUSB();- shutdownBluetooth();- synchronized (this) {- for (HIDDevice device : mDevicesById.values()) {- device.shutdown();- }- mDevicesById.clear();- mBluetoothDevices.clear();- HIDDeviceReleaseCallback();- }- }-- public void setFrozen(boolean frozen) {- synchronized (this) {- for (HIDDevice device : mDevicesById.values()) {- device.setFrozen(frozen);- }- }- }-- //////////////////////////////////////////////////////////////////////////////////////////////////////- //////////////////////////////////////////////////////////////////////////////////////////////////////- //////////////////////////////////////////////////////////////////////////////////////////////////////-- private HIDDevice getDevice(int id) {- synchronized (this) {- HIDDevice result = mDevicesById.get(id);- if (result == null) {- Log.v(TAG, "No device for id: " + id);- Log.v(TAG, "Available devices: " + mDevicesById.keySet());- }- return result;- }- }-- //////////////////////////////////////////////////////////////////////////////////////////////////////- ////////// JNI interface functions- //////////////////////////////////////////////////////////////////////////////////////////////////////-- public boolean initialize(boolean usb, boolean bluetooth) {- Log.v(TAG, "initialize(" + usb + ", " + bluetooth + ")");-- if (usb) {- initializeUSB();- }- if (bluetooth) {- initializeBluetooth();- }- return true;- }-- public boolean openDevice(int deviceID) {- Log.v(TAG, "openDevice deviceID=" + deviceID);- HIDDevice device = getDevice(deviceID);- if (device == null) {- HIDDeviceDisconnected(deviceID);- return false;- }-- // Look to see if this is a USB device and we have permission to access it- UsbDevice usbDevice = device.getDevice();- if (usbDevice != null && !mUsbManager.hasPermission(usbDevice)) {- HIDDeviceOpenPending(deviceID);- try {- final int FLAG_MUTABLE = 0x02000000; // PendingIntent.FLAG_MUTABLE, but don't require SDK 31- int flags;- if (Build.VERSION.SDK_INT >= 31) {- flags = FLAG_MUTABLE;- } else {- flags = 0;- }- mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags));- } catch (Exception e) {- Log.v(TAG, "Couldn't request permission for USB device " + usbDevice);- HIDDeviceOpenResult(deviceID, false);- }- return false;- }-- try {- return device.open();- } catch (Exception e) {- Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));- }- return false;- }-- public int sendOutputReport(int deviceID, byte[] report) {- try {- //Log.v(TAG, "sendOutputReport deviceID=" + deviceID + " length=" + report.length);- HIDDevice device;- device = getDevice(deviceID);- if (device == null) {- HIDDeviceDisconnected(deviceID);- return -1;- }-- return device.sendOutputReport(report);- } catch (Exception e) {- Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));- }- return -1;- }-- public int sendFeatureReport(int deviceID, byte[] report) {- try {- //Log.v(TAG, "sendFeatureReport deviceID=" + deviceID + " length=" + report.length);- HIDDevice device;- device = getDevice(deviceID);- if (device == null) {- HIDDeviceDisconnected(deviceID);- return -1;- }-- return device.sendFeatureReport(report);- } catch (Exception e) {- Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));- }- return -1;- }-- public boolean getFeatureReport(int deviceID, byte[] report) {- try {- //Log.v(TAG, "getFeatureReport deviceID=" + deviceID);- HIDDevice device;- device = getDevice(deviceID);- if (device == null) {- HIDDeviceDisconnected(deviceID);- return false;- }-- return device.getFeatureReport(report);- } catch (Exception e) {- Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));- }- return false;- }-- public void closeDevice(int deviceID) {- try {- Log.v(TAG, "closeDevice deviceID=" + deviceID);- HIDDevice device;- device = getDevice(deviceID);- if (device == null) {- HIDDeviceDisconnected(deviceID);- return;- }-- device.close();- } catch (Exception e) {- Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));- }- }--- //////////////////////////////////////////////////////////////////////////////////////////////////////- /////////////// Native methods- //////////////////////////////////////////////////////////////////////////////////////////////////////-- private native void HIDDeviceRegisterCallback();- private native void HIDDeviceReleaseCallback();-- native void HIDDeviceConnected(int deviceID, String identifier, int vendorId, int productId, String serial_number, int release_number, String manufacturer_string, String product_string, int interface_number, int interface_class, int interface_subclass, int interface_protocol);- native void HIDDeviceOpenPending(int deviceID);- native void HIDDeviceOpenResult(int deviceID, boolean opened);- native void HIDDeviceDisconnected(int deviceID);-- native void HIDDeviceInputReport(int deviceID, byte[] report);- native void HIDDeviceFeatureReport(int deviceID, byte[] report);-}diff --git a/android/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java b/android/app/src/main/java/org/libsdl/app/HIDDeviceUSB.javadeleted file mode 100644index d20fe80..0000000--- a/android/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java+++ /dev/null@@ -1,309 +0,0 @@-package org.libsdl.app;--import android.hardware.usb.*;-import android.os.Build;-import android.util.Log;-import java.util.Arrays;--class HIDDeviceUSB implements HIDDevice {-- private static final String TAG = "hidapi";-- protected HIDDeviceManager mManager;- protected UsbDevice mDevice;- protected int mInterfaceIndex;- protected int mInterface;- protected int mDeviceId;- protected UsbDeviceConnection mConnection;- protected UsbEndpoint mInputEndpoint;- protected UsbEndpoint mOutputEndpoint;- protected InputThread mInputThread;- protected boolean mRunning;- protected boolean mFrozen;-- public HIDDeviceUSB(HIDDeviceManager manager, UsbDevice usbDevice, int interface_index) {- mManager = manager;- mDevice = usbDevice;- mInterfaceIndex = interface_index;- mInterface = mDevice.getInterface(mInterfaceIndex).getId();- mDeviceId = manager.getDeviceIDForIdentifier(getIdentifier());- mRunning = false;- }-- public String getIdentifier() {- return String.format("%s/%x/%x/%d", mDevice.getDeviceName(), mDevice.getVendorId(), mDevice.getProductId(), mInterfaceIndex);- }-- @Override- public int getId() {- return mDeviceId;- }-- @Override- public int getVendorId() {- return mDevice.getVendorId();- }-- @Override- public int getProductId() {- return mDevice.getProductId();- }-- @Override- public String getSerialNumber() {- String result = null;- if (Build.VERSION.SDK_INT >= 21) {- try {- result = mDevice.getSerialNumber();- }- catch (SecurityException exception) {- //Log.w(TAG, "App permissions mean we cannot get serial number for device " + getDeviceName() + " message: " + exception.getMessage());- }- }- if (result == null) {- result = "";- }- return result;- }-- @Override- public int getVersion() {- return 0;- }-- @Override- public String getManufacturerName() {- String result = null;- if (Build.VERSION.SDK_INT >= 21) {- result = mDevice.getManufacturerName();- }- if (result == null) {- result = String.format("%x", getVendorId());- }- return result;- }-- @Override- public String getProductName() {- String result = null;- if (Build.VERSION.SDK_INT >= 21) {- result = mDevice.getProductName();- }- if (result == null) {- result = String.format("%x", getProductId());- }- return result;- }-- @Override- public UsbDevice getDevice() {- return mDevice;- }-- public String getDeviceName() {- return getManufacturerName() + " " + getProductName() + "(0x" + String.format("%x", getVendorId()) + "/0x" + String.format("%x", getProductId()) + ")";- }-- @Override- public boolean open() {- mConnection = mManager.getUSBManager().openDevice(mDevice);- if (mConnection == null) {- Log.w(TAG, "Unable to open USB device " + getDeviceName());- return false;- }-- // Force claim our interface- UsbInterface iface = mDevice.getInterface(mInterfaceIndex);- if (!mConnection.claimInterface(iface, true)) {- Log.w(TAG, "Failed to claim interfaces on USB device " + getDeviceName());- close();- return false;- }-- // Find the endpoints- for (int j = 0; j < iface.getEndpointCount(); j++) {- UsbEndpoint endpt = iface.getEndpoint(j);- switch (endpt.getDirection()) {- case UsbConstants.USB_DIR_IN:- if (mInputEndpoint == null) {- mInputEndpoint = endpt;- }- break;- case UsbConstants.USB_DIR_OUT:- if (mOutputEndpoint == null) {- mOutputEndpoint = endpt;- }- break;- }- }-- // Make sure the required endpoints were present- if (mInputEndpoint == null || mOutputEndpoint == null) {- Log.w(TAG, "Missing required endpoint on USB device " + getDeviceName());- close();- return false;- }-- // Start listening for input- mRunning = true;- mInputThread = new InputThread();- mInputThread.start();-- return true;- }-- @Override- public int sendFeatureReport(byte[] report) {- int res = -1;- int offset = 0;- int length = report.length;- boolean skipped_report_id = false;- byte report_number = report[0];-- if (report_number == 0x0) {- ++offset;- --length;- skipped_report_id = true;- }-- res = mConnection.controlTransfer(- UsbConstants.USB_TYPE_CLASS | 0x01 /*RECIPIENT_INTERFACE*/ | UsbConstants.USB_DIR_OUT,- 0x09/*HID set_report*/,- (3/*HID feature*/ << 8) | report_number,- mInterface,- report, offset, length,- 1000/*timeout millis*/);-- if (res < 0) {- Log.w(TAG, "sendFeatureReport() returned " + res + " on device " + getDeviceName());- return -1;- }-- if (skipped_report_id) {- ++length;- }- return length;- }-- @Override- public int sendOutputReport(byte[] report) {- int r = mConnection.bulkTransfer(mOutputEndpoint, report, report.length, 1000);- if (r != report.length) {- Log.w(TAG, "sendOutputReport() returned " + r + " on device " + getDeviceName());- }- return r;- }-- @Override- public boolean getFeatureReport(byte[] report) {- int res = -1;- int offset = 0;- int length = report.length;- boolean skipped_report_id = false;- byte report_number = report[0];-- if (report_number == 0x0) {- /* Offset the return buffer by 1, so that the report ID- will remain in byte 0. */- ++offset;- --length;- skipped_report_id = true;- }-- res = mConnection.controlTransfer(- UsbConstants.USB_TYPE_CLASS | 0x01 /*RECIPIENT_INTERFACE*/ | UsbConstants.USB_DIR_IN,- 0x01/*HID get_report*/,- (3/*HID feature*/ << 8) | report_number,- mInterface,- report, offset, length,- 1000/*timeout millis*/);-- if (res < 0) {- Log.w(TAG, "getFeatureReport() returned " + res + " on device " + getDeviceName());- return false;- }-- if (skipped_report_id) {- ++res;- ++length;- }-- byte[] data;- if (res == length) {- data = report;- } else {- data = Arrays.copyOfRange(report, 0, res);- }- mManager.HIDDeviceFeatureReport(mDeviceId, data);-- return true;- }-- @Override- public void close() {- mRunning = false;- if (mInputThread != null) {- while (mInputThread.isAlive()) {- mInputThread.interrupt();- try {- mInputThread.join();- } catch (InterruptedException e) {- // Keep trying until we're done- }- }- mInputThread = null;- }- if (mConnection != null) {- UsbInterface iface = mDevice.getInterface(mInterfaceIndex);- mConnection.releaseInterface(iface);- mConnection.close();- mConnection = null;- }- }-- @Override- public void shutdown() {- close();- mManager = null;- }-- @Override- public void setFrozen(boolean frozen) {- mFrozen = frozen;- }-- protected class InputThread extends Thread {- @Override- public void run() {- int packetSize = mInputEndpoint.getMaxPacketSize();- byte[] packet = new byte[packetSize];- while (mRunning) {- int r;- try- {- r = mConnection.bulkTransfer(mInputEndpoint, packet, packetSize, 1000);- }- catch (Exception e)- {- Log.v(TAG, "Exception in UsbDeviceConnection bulktransfer: " + e);- break;- }- if (r < 0) {- // Could be a timeout or an I/O error- }- if (r > 0) {- byte[] data;- if (r == packetSize) {- data = packet;- } else {- data = Arrays.copyOfRange(packet, 0, r);- }-- if (!mFrozen) {- mManager.HIDDeviceInputReport(mDeviceId, data);- }- }- }- }- }-}diff --git a/android/app/src/main/java/org/libsdl/app/SDL.java b/android/app/src/main/java/org/libsdl/app/SDL.javadeleted file mode 100644index 859678e..0000000--- a/android/app/src/main/java/org/libsdl/app/SDL.java+++ /dev/null@@ -1,85 +0,0 @@-package org.libsdl.app;--import android.content.Context;--import java.lang.Class;-import java.lang.reflect.Method;--/**- SDL library initialization-*/-public class SDL {-- // This function should be called first and sets up the native code- // so it can call into the Java classes- public static void setupJNI() {- SDLActivity.nativeSetupJNI();- SDLAudioManager.nativeSetupJNI();- SDLControllerManager.nativeSetupJNI();- }-- // This function should be called each time the activity is started- public static void initialize() {- setContext(null);-- SDLActivity.initialize();- SDLAudioManager.initialize();- SDLControllerManager.initialize();- }-- // This function stores the current activity (SDL or not)- public static void setContext(Context context) {- mContext = context;- }-- public static Context getContext() {- return mContext;- }-- public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError, SecurityException, NullPointerException {-- if (libraryName == null) {- throw new NullPointerException("No library name provided.");- }-- try {- // Let's see if we have ReLinker available in the project. This is necessary for- // some projects that have huge numbers of local libraries bundled, and thus may- // trip a bug in Android's native library loader which ReLinker works around. (If- // loadLibrary works properly, ReLinker will simply use the normal Android method- // internally.)- //- // To use ReLinker, just add it as a dependency. For more information, see- // https://github.com/KeepSafe/ReLinker for ReLinker's repository.- //- Class<?> relinkClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker");- Class<?> relinkListenerClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener");- Class<?> contextClass = mContext.getClassLoader().loadClass("android.content.Context");- Class<?> stringClass = mContext.getClassLoader().loadClass("java.lang.String");-- // Get a 'force' instance of the ReLinker, so we can ensure libraries are reinstalled if- // they've changed during updates.- Method forceMethod = relinkClass.getDeclaredMethod("force");- Object relinkInstance = forceMethod.invoke(null);- Class<?> relinkInstanceClass = relinkInstance.getClass();-- // Actually load the library!- Method loadMethod = relinkInstanceClass.getDeclaredMethod("loadLibrary", contextClass, stringClass, stringClass, relinkListenerClass);- loadMethod.invoke(relinkInstance, mContext, libraryName, null, null);- }- catch (final Throwable e) {- // Fall back- try {- System.loadLibrary(libraryName);- }- catch (final UnsatisfiedLinkError ule) {- throw ule;- }- catch (final SecurityException se) {- throw se;- }- }- }-- protected static Context mContext;-}diff --git a/android/app/src/main/java/org/libsdl/app/SDLActivity.java b/android/app/src/main/java/org/libsdl/app/SDLActivity.javadeleted file mode 100644index 502cdd8..0000000--- a/android/app/src/main/java/org/libsdl/app/SDLActivity.java+++ /dev/null@@ -1,2650 +0,0 @@-package org.libsdl.app;--import android.app.*;-import android.content.*;-import android.content.pm.ActivityInfo;-import android.content.pm.PackageManager;-import android.content.pm.ApplicationInfo;-import android.content.res.Configuration;-import android.graphics.*;-import android.graphics.drawable.Drawable;-import android.hardware.*;-import android.net.Uri;-import android.os.*;-import android.text.InputType;-import android.util.DisplayMetrics;-import android.util.Log;-import android.util.SparseArray;-import android.view.*;-import android.view.inputmethod.BaseInputConnection;-import android.view.inputmethod.EditorInfo;-import android.view.inputmethod.InputConnection;-import android.view.inputmethod.InputMethodManager;-import android.widget.Button;-import android.widget.LinearLayout;-import android.widget.RelativeLayout;-import android.widget.TextView;-import android.widget.Toast;--import java.util.Hashtable;-import java.util.Locale;--import ui.activity.GameActivity;-import ui.activity.MainActivity;-import ui.activity.MouseMode;-import com.libopenmw.openmw.R;--/**- SDL Activity-*/-public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {- private static final String TAG = "SDL";-- public static boolean mIsResumedCalled, mHasFocus;- public static final boolean mHasMultiWindow = (Build.VERSION.SDK_INT >= 24);-- // Cursor types- private static final int SDL_SYSTEM_CURSOR_NONE = -1;- private static final int SDL_SYSTEM_CURSOR_ARROW = 0;- private static final int SDL_SYSTEM_CURSOR_IBEAM = 1;- private static final int SDL_SYSTEM_CURSOR_WAIT = 2;- private static final int SDL_SYSTEM_CURSOR_CROSSHAIR = 3;- private static final int SDL_SYSTEM_CURSOR_WAITARROW = 4;- private static final int SDL_SYSTEM_CURSOR_SIZENWSE = 5;- private static final int SDL_SYSTEM_CURSOR_SIZENESW = 6;- private static final int SDL_SYSTEM_CURSOR_SIZEWE = 7;- private static final int SDL_SYSTEM_CURSOR_SIZENS = 8;- private static final int SDL_SYSTEM_CURSOR_SIZEALL = 9;- private static final int SDL_SYSTEM_CURSOR_NO = 10;- private static final int SDL_SYSTEM_CURSOR_HAND = 11;-- protected static final int SDL_ORIENTATION_UNKNOWN = 0;- protected static final int SDL_ORIENTATION_LANDSCAPE = 1;- protected static final int SDL_ORIENTATION_LANDSCAPE_FLIPPED = 2;- protected static final int SDL_ORIENTATION_PORTRAIT = 3;- protected static final int SDL_ORIENTATION_PORTRAIT_FLIPPED = 4;-- protected static int mCurrentOrientation;- protected static Locale mCurrentLocale;-- // Handle the state of the native layer- public enum NativeState {- INIT, RESUMED, PAUSED- }-- public static NativeState mNextNativeState;- public static NativeState mCurrentNativeState;-- /** If shared libraries (e.g. SDL or the native application) could not be loaded. */- public static boolean mBrokenLibraries = true;-- // Main components- protected static SDLActivity mSingleton;- protected static SDLSurface mSurface;- protected static View mTextEdit;- protected static boolean mScreenKeyboardShown;- protected static ViewGroup mLayout;- protected static SDLClipboardHandler mClipboardHandler;- protected static Hashtable<Integer, PointerIcon> mCursors;- protected static int mLastCursorID;- protected static SDLGenericMotionListener_API12 mMotionListener;- protected static HIDDeviceManager mHIDDeviceManager;-- // This is what SDL runs in. It invokes SDL_main(), eventually- protected static Thread mSDLThread;-- protected static SDLGenericMotionListener_API12 getMotionListener() {- if (mMotionListener == null) {- if (Build.VERSION.SDK_INT >= 26) {- mMotionListener = new SDLGenericMotionListener_API26();- } else- if (Build.VERSION.SDK_INT >= 24) {- mMotionListener = new SDLGenericMotionListener_API24();- } else {- mMotionListener = new SDLGenericMotionListener_API12();- }- }-- return mMotionListener;- }-- /**- * This method returns the name of the shared object with the application entry point- * It can be overridden by derived classes.- */- protected String getMainSharedObject() {- String library;- String[] libraries = SDLActivity.mSingleton.getLibraries();- if (libraries.length > 0) {- library = "lib" + libraries[libraries.length - 1] + ".so";- } else {- library = "libmain.so";- }- return getContext().getApplicationInfo().nativeLibraryDir + "/" + library;- }-- /**- * This method returns the name of the application entry point- * It can be overridden by derived classes.- */- protected String getMainFunction() {- return "SDL_main";- }-- /**- * This method is called by SDL before loading the native shared libraries.- * It can be overridden to provide names of shared libraries to be loaded.- * The default implementation returns the defaults. It never returns null.- * An array returned by a new implementation must at least contain "SDL2".- * Also keep in mind that the order the libraries are loaded may matter.- * @return names of shared libraries to be loaded (e.g. "SDL2", "main").- */- protected String[] getLibraries() {- return new String[] {- "SDL2",- // "SDL2_image",- // "SDL2_mixer",- // "SDL2_net",- // "SDL2_ttf",- "main"- };- }-- // Load the .so- public void loadLibraries() {- for (String lib : getLibraries()) {- SDL.loadLibrary(lib);- }- }-- /**- * This method is called by SDL before starting the native application thread.- * It can be overridden to provide the arguments after the application name.- * The default implementation returns an empty array. It never returns null.- * @return arguments for the native application.- */- protected String[] getArguments() {- return new String[0];- }-- public static void initialize() {- // The static nature of the singleton and Android quirkyness force us to initialize everything here- // Otherwise, when exiting the app and returning to it, these variables *keep* their pre exit values- mSingleton = null;- mSurface = null;- mTextEdit = null;- mLayout = null;- mClipboardHandler = null;- mCursors = new Hashtable<Integer, PointerIcon>();- mLastCursorID = 0;- mSDLThread = null;- mIsResumedCalled = false;- mHasFocus = true;- mNextNativeState = NativeState.INIT;- mCurrentNativeState = NativeState.INIT;- }-- // Setup- @Override- protected void onCreate(Bundle savedInstanceState) {- Log.v(TAG, "Device: " + Build.DEVICE);- Log.v(TAG, "Model: " + Build.MODEL);- Log.v(TAG, "onCreate()");- super.onCreate(savedInstanceState);-- try {- Thread.currentThread().setName("SDLActivity");- } catch (Exception e) {- Log.v(TAG, "modify thread properties failed " + e.toString());- }-- // Load shared libraries- String errorMsgBrokenLib = "";- try {- loadLibraries();- mBrokenLibraries = false; /* success */- } catch(UnsatisfiedLinkError e) {- System.err.println(e.getMessage());- mBrokenLibraries = true;- errorMsgBrokenLib = e.getMessage();- } catch(Exception e) {- System.err.println(e.getMessage());- mBrokenLibraries = true;- errorMsgBrokenLib = e.getMessage();- }-- if (mBrokenLibraries)- {- mSingleton = this;- AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this);- dlgAlert.setMessage(getString(R.string.sdl_start_error, errorMsgBrokenLib));- dlgAlert.setTitle(R.string.sdl_error_title);- dlgAlert.setPositiveButton(R.string.sdl_exit,- new DialogInterface.OnClickListener() {- @Override- public void onClick(DialogInterface dialog,int id) {- // if this button is clicked, close current activity- SDLActivity.mSingleton.finish();- }- });- dlgAlert.setCancelable(false);- dlgAlert.create().show();-- return;- }-- // Set up JNI- SDL.setupJNI();-- // Initialize state- SDL.initialize();-- // So we can call stuff from static callbacks- mSingleton = this;- SDL.setContext(this);-- mClipboardHandler = new SDLClipboardHandler_API11();-- mHIDDeviceManager = HIDDeviceManager.acquire(this);-- // Set up the surface- mSurface = new SDLSurface(getApplication());- RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(- ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);- params.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);- mSurface.setLayoutParams(params);-- mLayout = new RelativeLayout(this);- mLayout.setBackgroundColor(Color.BLACK);- mLayout.addView(mSurface);-- // Get our current screen orientation and pass it down.- mCurrentOrientation = SDLActivity.getCurrentOrientation();- // Only record current orientation- SDLActivity.onNativeOrientationChanged(mCurrentOrientation);-- try {- if (Build.VERSION.SDK_INT < 24) {- mCurrentLocale = getContext().getResources().getConfiguration().locale;- } else {- mCurrentLocale = getContext().getResources().getConfiguration().getLocales().get(0);- }- } catch(Exception ignored) {- }-- setContentView(mLayout);-- setWindowStyle(false);--// getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(this);-- // Get filename from "Open with" of another application- Intent intent = getIntent();- if (intent != null && intent.getData() != null) {- String filename = intent.getData().getPath();- if (filename != null) {- Log.v(TAG, "Got filename: " + filename);- SDLActivity.onNativeDropFile(filename);- }- }- }-- protected void pauseNativeThread() {- mNextNativeState = NativeState.PAUSED;- mIsResumedCalled = false;-- if (SDLActivity.mBrokenLibraries) {- return;- }-- SDLActivity.handleNativeState();- }-- protected void resumeNativeThread() {- mNextNativeState = NativeState.RESUMED;- mIsResumedCalled = true;-- if (SDLActivity.mBrokenLibraries) {- return;- }-- SDLActivity.handleNativeState();- }-- // Events- @Override- protected void onPause() {- Log.v(TAG, "onPause()");- super.onPause();-- if (mHIDDeviceManager != null) {- mHIDDeviceManager.setFrozen(true);- }- if (!mHasMultiWindow) {- pauseNativeThread();- }- }-- @Override- protected void onResume() {- Log.v(TAG, "onResume()");- super.onResume();-- if (mHIDDeviceManager != null) {- mHIDDeviceManager.setFrozen(false);- }- if (!mHasMultiWindow) {- resumeNativeThread();- }- }-- @Override- protected void onStop() {- Log.v(TAG, "onStop()");- super.onStop();- if (mHasMultiWindow) {- pauseNativeThread();- }- }-- @Override- protected void onStart() {- Log.v(TAG, "onStart()");- super.onStart();- if (mHasMultiWindow) {- resumeNativeThread();- }- }-- public static int getCurrentOrientation() {-- int result = SDL_ORIENTATION_UNKNOWN;-- if (mSingleton == null) {- return result;- }- Display display = SDLActivity.mSingleton.getWindowManager().getDefaultDisplay();-- switch (display.getRotation()) {- case Surface.ROTATION_0:- result = SDL_ORIENTATION_PORTRAIT;- break;-- case Surface.ROTATION_90:- result = SDL_ORIENTATION_LANDSCAPE;- break;-- case Surface.ROTATION_180:- result = SDL_ORIENTATION_PORTRAIT_FLIPPED;- break;-- case Surface.ROTATION_270:- result = SDL_ORIENTATION_LANDSCAPE_FLIPPED;- break;- }-- return result;- }-- @Override- public void onWindowFocusChanged(boolean hasFocus) {- super.onWindowFocusChanged(hasFocus);- Log.v(TAG, "onWindowFocusChanged(): " + hasFocus);-- if (SDLActivity.mBrokenLibraries) {- return;- }-- mHasFocus = hasFocus;- if (hasFocus) {- mNextNativeState = NativeState.RESUMED;- SDLActivity.getMotionListener().reclaimRelativeMouseModeIfNeeded();-- SDLActivity.handleNativeState();- nativeFocusChanged(true);-- } else {- nativeFocusChanged(false);- if (!mHasMultiWindow) {- mNextNativeState = NativeState.PAUSED;- SDLActivity.handleNativeState();- }- }- }-- @Override- public void onLowMemory() {- Log.v(TAG, "onLowMemory()");- super.onLowMemory();-- if (SDLActivity.mBrokenLibraries) {- return;- }-- SDLActivity.nativeLowMemory();- }-- @Override- public void onConfigurationChanged(Configuration newConfig) {- Log.v(TAG, "onConfigurationChanged()");- super.onConfigurationChanged(newConfig);-- if (SDLActivity.mBrokenLibraries) {- return;- }-- if (mCurrentLocale == null || !mCurrentLocale.equals(newConfig.locale)) {- mCurrentLocale = newConfig.locale;- SDLActivity.onNativeLocaleChanged();- }- }-- @Override- protected void onDestroy() {- Log.v(TAG, "onDestroy()");-- if (mHIDDeviceManager != null) {- HIDDeviceManager.release(mHIDDeviceManager);- mHIDDeviceManager = null;- }-- if (SDLActivity.mBrokenLibraries) {- super.onDestroy();- return;- }-- if (SDLActivity.mSDLThread != null) {-- // Send Quit event to "SDLThread" thread- SDLActivity.nativeSendQuit();-- // Wait for "SDLThread" thread to end- try {- SDLActivity.mSDLThread.join();- } catch(Exception e) {- Log.v(TAG, "Problem stopping SDLThread: " + e);- }- }-- SDLActivity.nativeQuit();-- super.onDestroy();- }-- @Override- public void onBackPressed() {- // Check if we want to block the back button in case of mouse right click.- //- // If we do, the normal hardware back button will no longer work and people have to use home,- // but the mouse right click will work.- //- boolean trapBack = SDLActivity.nativeGetHintBoolean("SDL_ANDROID_TRAP_BACK_BUTTON", false);- if (trapBack) {- // Exit and let the mouse handler handle this button (if appropriate)- return;- }-- // Default system back button behavior.- if (!isFinishing()) {- super.onBackPressed();- }- }-- // Called by JNI from SDL.- public static void manualBackButton() {- mSingleton.pressBackButton();- }-- // Used to get us onto the activity's main thread- public void pressBackButton() {- runOnUiThread(new Runnable() {- @Override- public void run() {- if (!SDLActivity.this.isFinishing()) {- SDLActivity.this.superOnBackPressed();- }- }- });- }-- // Used to access the system back behavior.- public void superOnBackPressed() {- super.onBackPressed();- }-- @Override- public boolean dispatchKeyEvent(KeyEvent event) {-- if (SDLActivity.mBrokenLibraries) {- return false;- }-- int keyCode = event.getKeyCode();- // Ignore certain special keys so they're handled by Android- if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN ||- keyCode == KeyEvent.KEYCODE_VOLUME_UP ||- keyCode == KeyEvent.KEYCODE_CAMERA ||- keyCode == KeyEvent.KEYCODE_ZOOM_IN || /* API 11 */- keyCode == KeyEvent.KEYCODE_ZOOM_OUT /* API 11 */- ) {- return false;- }- return super.dispatchKeyEvent(event);- }-- /* Transition to next state */- public static void handleNativeState() {-- if (mNextNativeState == mCurrentNativeState) {- // Already in same state, discard.- return;- }-- // Try a transition to init state- if (mNextNativeState == NativeState.INIT) {-- mCurrentNativeState = mNextNativeState;- return;- }-- // Try a transition to paused state- if (mNextNativeState == NativeState.PAUSED) {- if (mSDLThread != null) {- nativePause();- }- if (mSurface != null) {- mSurface.handlePause();- }- mCurrentNativeState = mNextNativeState;- return;- }-- // Try a transition to resumed state- if (mNextNativeState == NativeState.RESUMED) {- if (mSurface.mIsSurfaceReady && mHasFocus && mIsResumedCalled) {- if (mSDLThread == null) {- // This is the entry point to the C app.- // Start up the C app thread and enable sensor input for the first time- // FIXME: Why aren't we enabling sensor input at start?-- mSDLThread = new Thread(new SDLMain(), "SDLThread");- mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);- mSDLThread.start();-- // No nativeResume(), don't signal Android_ResumeSem- mSurface.handleResume();- } else {- nativeResume();- mSurface.handleResume();- }-- mCurrentNativeState = mNextNativeState;- }- }- }-- // Messages from the SDLMain thread- static final int COMMAND_CHANGE_TITLE = 1;- static final int COMMAND_CHANGE_WINDOW_STYLE = 2;- static final int COMMAND_TEXTEDIT_HIDE = 3;- static final int COMMAND_SET_KEEP_SCREEN_ON = 5;-- protected static final int COMMAND_USER = 0x8000;-- protected static boolean mFullscreenModeActive;-- /**- * This method is called by SDL if SDL did not handle a message itself.- * This happens if a received message contains an unsupported command.- * Method can be overwritten to handle Messages in a different class.- * @param command the command of the message.- * @param param the parameter of the message. May be null.- * @return if the message was handled in overridden method.- */- protected boolean onUnhandledMessage(int command, Object param) {- return false;- }-- /**- * A Handler class for Messages from native SDL applications.- * It uses current Activities as target (e.g. for the title).- * static to prevent implicit references to enclosing object.- */- protected static class SDLCommandHandler extends Handler {- @Override- public void handleMessage(Message msg) {- Context context = SDL.getContext();- if (context == null) {- Log.e(TAG, "error handling message, getContext() returned null");- return;- }- switch (msg.arg1) {- case COMMAND_CHANGE_TITLE:- if (context instanceof Activity) {- ((Activity) context).setTitle((String)msg.obj);- } else {- Log.e(TAG, "error handling message, getContext() returned no Activity");- }- break;-/*- case COMMAND_CHANGE_WINDOW_STYLE:- if (Build.VERSION.SDK_INT < 19) {- // This version of Android doesn't support the immersive fullscreen mode- break;- }- if (context instanceof Activity) {- Window window = ((Activity) context).getWindow();- if (window != null) {- if ((msg.obj instanceof Integer) && (((Integer) msg.obj).intValue() != 0)) {- int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |- View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |- View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |- View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |- View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |- View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;- window.getDecorView().setSystemUiVisibility(flags);- window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);- window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);- SDLActivity.mFullscreenModeActive = true;- } else {- int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_VISIBLE;- window.getDecorView().setSystemUiVisibility(flags);- window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);- window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);- SDLActivity.mFullscreenModeActive = false;- }- }- } else {- Log.e(TAG, "error handling message, getContext() returned no Activity");- }- break;- */- case COMMAND_TEXTEDIT_HIDE:- if (mTextEdit != null) {- // Note: On some devices setting view to GONE creates a flicker in landscape.- // Setting the View's sizes to 0 is similar to GONE but without the flicker.- // The sizes will be set to useful values when the keyboard is shown again.- mTextEdit.setLayoutParams(new RelativeLayout.LayoutParams(0, 0));-- InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);- imm.hideSoftInputFromWindow(mTextEdit.getWindowToken(), 0);-- mScreenKeyboardShown = false;-- mSurface.requestFocus();- }- break;- case COMMAND_SET_KEEP_SCREEN_ON:- {- if (context instanceof Activity) {- Window window = ((Activity) context).getWindow();- if (window != null) {- if ((msg.obj instanceof Integer) && (((Integer) msg.obj).intValue() != 0)) {- window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);- } else {- window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);- }- }- }- break;- }- default:- if ((context instanceof SDLActivity) && !((SDLActivity) context).onUnhandledMessage(msg.arg1, msg.obj)) {- Log.e(TAG, "error handling message, command is " + msg.arg1);- }- }- }- }-- // Handler for the messages- Handler commandHandler = new SDLCommandHandler();-- // Send a message from the SDLMain thread- boolean sendCommand(int command, Object data) {- Message msg = commandHandler.obtainMessage();- msg.arg1 = command;- msg.obj = data;- boolean result = commandHandler.sendMessage(msg);-- if ((Build.VERSION.SDK_INT >= 19) && (command == COMMAND_CHANGE_WINDOW_STYLE)) {- // Ensure we don't return until the resize has actually happened,- // or 500ms have passed.-- boolean bShouldWait = false;-- if (data instanceof Integer) {- // Let's figure out if we're already laid out fullscreen or not.- Display display = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();- android.util.DisplayMetrics realMetrics = new android.util.DisplayMetrics();- display.getRealMetrics( realMetrics );-- boolean bFullscreenLayout = ((realMetrics.widthPixels == mSurface.getWidth()) &&- (realMetrics.heightPixels == mSurface.getHeight()));-- if (((Integer)data).intValue() == 1) {- // If we aren't laid out fullscreen or actively in fullscreen mode already, we're going- // to change size and should wait for surfaceChanged() before we return, so the size- // is right back in native code. If we're already laid out fullscreen, though, we're- // not going to change size even if we change decor modes, so we shouldn't wait for- // surfaceChanged() -- which may not even happen -- and should return immediately.- bShouldWait = !bFullscreenLayout;- }- else {- // If we're laid out fullscreen (even if the status bar and nav bar are present),- // or are actively in fullscreen, we're going to change size and should wait for- // surfaceChanged before we return, so the size is right back in native code.- bShouldWait = bFullscreenLayout;- }- }-- if (bShouldWait && (SDLActivity.getContext() != null)) {- // We'll wait for the surfaceChanged() method, which will notify us- // when called. That way, we know our current size is really the- // size we need, instead of grabbing a size that's still got- // the navigation and/or status bars before they're hidden.- //- // We'll wait for up to half a second, because some devices- // take a surprisingly long time for the surface resize, but- // then we'll just give up and return.- //- synchronized(SDLActivity.getContext()) {- try {- SDLActivity.getContext().wait(500);- }- catch (InterruptedException ie) {- ie.printStackTrace();- }- }- }- }-- return result;- }-- // C functions we call- public static native int nativeInit();- public static native int nativeSetupJNI();- public static native int nativeRunMain(String library, String function, Object arguments);- public static native void nativeLowMemory();- public static native void nativeSendQuit();- public static native void nativeQuit();- public static native void nativePause();- public static native void nativeResume();- public static native void nativeFocusChanged(boolean hasFocus);- public static native void onNativeDropFile(String filename);- public static native void nativeSetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, float rate);- public static native void onNativeResize();- public static native void onNativeKeyDown(int keycode);- public static native void onNativeKeyUp(int keycode);- public static native boolean onNativeSoftReturnKey();- public static native void onNativeKeyboardFocusLost();- public static native void onNativeMouse(int button, int action, float x, float y, boolean relative);- public static native void onNativeTouch(int touchDevId, int pointerFingerId,- int action, float x,- float y, float p);- public static native void onNativeAccel(float x, float y, float z);- public static native void onNativeClipboardChanged();- public static native void onNativeSurfaceCreated();- public static native void onNativeSurfaceChanged();- public static native void onNativeSurfaceDestroyed();- public static native String nativeGetHint(String name);- public static native boolean nativeGetHintBoolean(String name, boolean default_value);- public static native void nativeSetenv(String name, String value);- public static native void onNativeOrientationChanged(int orientation);- public static native void nativeAddTouch(int touchId, String name);- public static native void nativePermissionResult(int requestCode, boolean result);- public static native void onNativeLocaleChanged();- public static native int getMouseX();- public static native int getMouseY();- public static native int isMouseShown();- public static native void sendRelativeMouseMotion(int x, int y);- public static native void sendMouseButton(int state, int button);-- public static native void omwSurfaceDestroyed();- public static native void omwSurfaceRecreated();-- /**- * This method is called by SDL using JNI.- */- public static boolean setActivityTitle(String title) {- // Called from SDLMain() thread and can't directly affect the view- return mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title);- }-- /**- * This method is called by SDL using JNI.- */- public static void setWindowStyle(boolean fullscreen) {- // Called from SDLMain() thread and can't directly affect the view- mSingleton.sendCommand(COMMAND_CHANGE_WINDOW_STYLE, fullscreen ? 1 : 0);- }-- /**- * This method is called by SDL using JNI.- * This is a static method for JNI convenience, it calls a non-static method- * so that is can be overridden- */- public static void setOrientation(int w, int h, boolean resizable, String hint)- {- if (mSingleton != null) {- mSingleton.setOrientationBis(w, h, resizable, hint);- }- }-- /**- * This can be overridden- */- public void setOrientationBis(int w, int h, boolean resizable, String hint)- {- int orientation_landscape = -1;- int orientation_portrait = -1;-- /* If set, hint "explicitly controls which UI orientations are allowed". */- if (hint.contains("LandscapeRight") && hint.contains("LandscapeLeft")) {- orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;- } else if (hint.contains("LandscapeRight")) {- orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;- } else if (hint.contains("LandscapeLeft")) {- orientation_landscape = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;- }-- if (hint.contains("Portrait") && hint.contains("PortraitUpsideDown")) {- orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;- } else if (hint.contains("Portrait")) {- orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;- } else if (hint.contains("PortraitUpsideDown")) {- orientation_portrait = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;- }-- boolean is_landscape_allowed = (orientation_landscape == -1 ? false : true);- boolean is_portrait_allowed = (orientation_portrait == -1 ? false : true);- int req = -1; /* Requested orientation */-- /* No valid hint, nothing is explicitly allowed */- if (!is_portrait_allowed && !is_landscape_allowed) {- if (resizable) {- /* All orientations are allowed */- req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;- } else {- /* Fixed window and nothing specified. Get orientation from w/h of created window */- req = (w > h ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);- }- } else {- /* At least one orientation is allowed */- if (resizable) {- if (is_portrait_allowed && is_landscape_allowed) {- /* hint allows both landscape and portrait, promote to full sensor */- req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;- } else {- /* Use the only one allowed "orientation" */- req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);- }- } else {- /* Fixed window and both orientations are allowed. Choose one. */- if (is_portrait_allowed && is_landscape_allowed) {- req = (w > h ? orientation_landscape : orientation_portrait);- } else {- /* Use the only one allowed "orientation" */- req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);- }- }- }-- Log.v(TAG, "setOrientation() requestedOrientation=" + req + " width=" + w +" height="+ h +" resizable=" + resizable + " hint=" + hint);- mSingleton.setRequestedOrientation(req);- }-- /**- * This method is called by SDL using JNI.- */- public static void minimizeWindow() {-- if (mSingleton == null) {- return;- }-- Intent startMain = new Intent(Intent.ACTION_MAIN);- startMain.addCategory(Intent.CATEGORY_HOME);- startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);- mSingleton.startActivity(startMain);- }-- /**- * This method is called by SDL using JNI.- */- public static boolean shouldMinimizeOnFocusLoss() {-/*- if (Build.VERSION.SDK_INT >= 24) {- if (mSingleton == null) {- return true;- }-- if (mSingleton.isInMultiWindowMode()) {- return false;- }-- if (mSingleton.isInPictureInPictureMode()) {- return false;- }- }-- return true;-*/- return false;- }-- /**- * This method is called by SDL using JNI.- */- public static boolean isScreenKeyboardShown()- {- if (mTextEdit == null) {- return false;- }-- if (!mScreenKeyboardShown) {- return false;- }-- InputMethodManager imm = (InputMethodManager) SDL.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);- return imm.isAcceptingText();-- }-- /**- * This method is called by SDL using JNI.- */- public static boolean supportsRelativeMouse()- {- // DeX mode in Samsung Experience 9.0 and earlier doesn't support relative mice properly under- // Android 7 APIs, and simply returns no data under Android 8 APIs.- //- // This is fixed in Samsung Experience 9.5, which corresponds to Android 8.1.0, and- // thus SDK version 27. If we are in DeX mode and not API 27 or higher, as a result,- // we should stick to relative mode.- //- if ((Build.VERSION.SDK_INT < 27) && isDeXMode()) {- return false;- }-- return SDLActivity.getMotionListener().supportsRelativeMouse();- }-- /**- * This method is called by SDL using JNI.- */- public static boolean setRelativeMouseEnabled(boolean enabled)- {- if (enabled && !supportsRelativeMouse()) {- return false;- }-- return SDLActivity.getMotionListener().setRelativeMouseEnabled(enabled);- }-- /**- * This method is called by SDL using JNI.- */- public static boolean sendMessage(int command, int param) {- if (mSingleton == null) {- return false;- }- return mSingleton.sendCommand(command, Integer.valueOf(param));- }-- /**- * This method is called by SDL using JNI.- */- public static Context getContext() {- return SDL.getContext();- }-- /**- * This method is called by SDL using JNI.- */- public static boolean isAndroidTV() {- UiModeManager uiModeManager = (UiModeManager) getContext().getSystemService(UI_MODE_SERVICE);- if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {- return true;- }- if (Build.MANUFACTURER.equals("MINIX") && Build.MODEL.equals("NEO-U1")) {- return true;- }- if (Build.MANUFACTURER.equals("Amlogic") && Build.MODEL.equals("X96-W")) {- return true;- }- if (Build.MANUFACTURER.equals("Amlogic") && Build.MODEL.startsWith("TV")) {- return true;- }- return false;- }-- public static double getDiagonal()- {- DisplayMetrics metrics = new DisplayMetrics();- Activity activity = (Activity)getContext();- if (activity == null) {- return 0.0;- }- activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);-- double dWidthInches = metrics.widthPixels / (double)metrics.xdpi;- double dHeightInches = metrics.heightPixels / (double)metrics.ydpi;-- double dDiagonal = Math.sqrt((dWidthInches * dWidthInches) + (dHeightInches * dHeightInches));-- return dDiagonal;- }-- /**- * This method is called by SDL using JNI.- */- public static boolean isTablet() {- // If our diagonal size is seven inches or greater, we consider ourselves a tablet.- return (getDiagonal() >= 7.0);- }-- /**- * This method is called by SDL using JNI.- */- public static boolean isChromebook() {- if (getContext() == null) {- return false;- }- return getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");- }-- /**- * Android Automotive displays can expose their touch panel as an absolute- * mouse device. Keep this runtime check here because input routing depends- * on the device that is actually running the game, not just on the build- * flavor that produced the APK/AAB.- */- public static boolean isAutomotive() {- if (getContext() == null) {- return false;- }- return getContext().getPackageManager().hasSystemFeature("android.hardware.type.automotive");- }-- /**- * This method is called by SDL using JNI.- */- public static boolean isDeXMode() {- if (Build.VERSION.SDK_INT < 24) {- return false;- }- try {- final Configuration config = getContext().getResources().getConfiguration();- final Class configClass = config.getClass();- return configClass.getField("SEM_DESKTOP_MODE_ENABLED").getInt(configClass)- == configClass.getField("semDesktopModeEnabled").getInt(config);- } catch(Exception ignored) {- return false;- }- }-- /**- * This method is called by SDL using JNI.- */- public static DisplayMetrics getDisplayDPI() {- return getContext().getResources().getDisplayMetrics();- }-- /**- * This method is called by SDL using JNI.- */- public static boolean getManifestEnvironmentVariables() {- try {- if (getContext() == null) {- return false;- }-- ApplicationInfo applicationInfo = getContext().getPackageManager().getApplicationInfo(getContext().getPackageName(), PackageManager.GET_META_DATA);- Bundle bundle = applicationInfo.metaData;- if (bundle == null) {- return false;- }- String prefix = "SDL_ENV.";- final int trimLength = prefix.length();- for (String key : bundle.keySet()) {- if (key.startsWith(prefix)) {- String name = key.substring(trimLength);- String value = bundle.get(key).toString();- nativeSetenv(name, value);- }- }- /* environment variables set! */- return true;- } catch (Exception e) {- Log.v(TAG, "exception " + e.toString());- }- return false;- }-- // This method is called by SDLControllerManager's API 26 Generic Motion Handler.- public static View getContentView()- {- return mSingleton.mLayout;- }-- static class ShowTextInputTask implements Runnable {- /*- * This is used to regulate the pan&scan method to have some offset from- * the bottom edge of the input region and the top edge of an input- * method (soft keyboard)- */- static final int HEIGHT_PADDING = 15;-- public int x, y, w, h;-- public ShowTextInputTask(int x, int y, int w, int h) {- this.x = x;- this.y = y;- this.w = w;- this.h = h;-- /* Minimum size of 1 pixel, so it takes focus. */- if (this.w <= 0) {- this.w = 1;- }- if (this.h + HEIGHT_PADDING <= 0) {- this.h = 1 - HEIGHT_PADDING;- }- }-- @Override- public void run() {-// RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(w, h + HEIGHT_PADDING);-// params.leftMargin = x;-// params.topMargin = y;-//-// if (mTextEdit == null) {-// mTextEdit = new DummyEdit(SDL.getContext());-//-// mLayout.addView(mTextEdit, params);-// } else {-// mTextEdit.setLayoutParams(params);-// }-//-// mTextEdit.setVisibility(View.VISIBLE);-// mTextEdit.requestFocus();-//-// InputMethodManager imm = (InputMethodManager) SDL.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);-// imm.showSoftInput(mTextEdit, 0);-//-// mScreenKeyboardShown = true;- }- }-- /**- * This method is called by SDL using JNI.- */- public static boolean showTextInput(int x, int y, int w, int h) {- // Transfer the task to the main thread as a Runnable- return mSingleton.commandHandler.post(new ShowTextInputTask(x, y, w, h));- }-- public static boolean isTextInputEvent(KeyEvent event) {-- // Key pressed with Ctrl should be sent as SDL_KEYDOWN/SDL_KEYUP and not SDL_TEXTINPUT- if (event.isCtrlPressed()) {- return false;- }-- return event.isPrintingKey() || event.getKeyCode() == KeyEvent.KEYCODE_SPACE;- }-- /**- * This method is called by SDL using JNI.- */- public static Surface getNativeSurface() {- if (SDLActivity.mSurface == null) {- return null;- }- return SDLActivity.mSurface.getNativeSurface();- }-- public static SurfaceView getSurface() {- return SDLActivity.mSurface;- }-- // OpenMW Android custom-resolution bridge.- // Relative pointer-capture deltas must never be scaled.- public static float scaleAbsoluteMouseX(float x) {- final int logicalWidth = MainActivity.Companion.getResolutionX();- if (mSurface == null || logicalWidth <= 0) {- return x;- }-- final int viewWidth = mSurface.getWidth();- if (viewWidth <= 0) {- return x;- }-- final float scaled = x * ((float) logicalWidth / (float) viewWidth);- return Math.max(0.0f, Math.min((float) logicalWidth - 1.0f, scaled));- }-- public static float scaleAbsoluteMouseY(float y) {- final int logicalHeight = MainActivity.Companion.getResolutionY();- if (mSurface == null || logicalHeight <= 0) {- return y;- }-- final int viewHeight = mSurface.getHeight();- if (viewHeight <= 0) {- return y;- }-- final float scaled = y * ((float) logicalHeight / (float) viewHeight);- return Math.max(0.0f, Math.min((float) logicalHeight - 1.0f, scaled));- }-- // Input-- /**- * This method is called by SDL using JNI.- */- public static void initTouch() {- int[] ids = InputDevice.getDeviceIds();-- for (int i = 0; i < ids.length; ++i) {- InputDevice device = InputDevice.getDevice(ids[i]);- if (device != null && (device.getSources() & InputDevice.SOURCE_TOUCHSCREEN) != 0) {- nativeAddTouch(device.getId(), device.getName());- }- }- }-- // Messagebox-- /** Result of current messagebox. Also used for blocking the calling thread. */- protected final int[] messageboxSelection = new int[1];-- /**- * This method is called by SDL using JNI.- * Shows the messagebox from UI thread and block calling thread.- * buttonFlags, buttonIds and buttonTexts must have same length.- * @param buttonFlags array containing flags for every button.- * @param buttonIds array containing id for every button.- * @param buttonTexts array containing text for every button.- * @param colors null for default or array of length 5 containing colors.- * @return button id or -1.- */- public int messageboxShowMessageBox(- final int flags,- final String title,- final String message,- final int[] buttonFlags,- final int[] buttonIds,- final String[] buttonTexts,- final int[] colors) {-- messageboxSelection[0] = -1;-- // sanity checks-- if ((buttonFlags.length != buttonIds.length) && (buttonIds.length != buttonTexts.length)) {- return -1; // implementation broken- }-- // collect arguments for Dialog-- final Bundle args = new Bundle();- args.putInt("flags", flags);- args.putString("title", title);- args.putString("message", message);- args.putIntArray("buttonFlags", buttonFlags);- args.putIntArray("buttonIds", buttonIds);- args.putStringArray("buttonTexts", buttonTexts);- args.putIntArray("colors", colors);-- // trigger Dialog creation on UI thread-- runOnUiThread(new Runnable() {- @Override- public void run() {- messageboxCreateAndShow(args);- }- });-- // block the calling thread-- synchronized (messageboxSelection) {- try {- messageboxSelection.wait();- } catch (InterruptedException ex) {- ex.printStackTrace();- return -1;- }- }-- // return selected value-- return messageboxSelection[0];- }-- private Dialog showModernDialog(Bundle args) {- AlertDialog.Builder builder = new AlertDialog.Builder(this);-- int[] buttonIds = args.getIntArray("buttonIds");- String[] buttonTexts = args.getStringArray("buttonTexts");-- if (buttonIds.length >= 1)- builder.setPositiveButton(buttonTexts[0], (dialog, which) -> {- messageboxSelection[0] = buttonIds[0];- dialog.dismiss();- });-- AlertDialog dialog = builder.create();- dialog.setTitle(args.getString("title"));- dialog.setCancelable(false);- dialog.setOnDismissListener(unused -> {- synchronized (messageboxSelection) {- messageboxSelection.notify();- }- });- dialog.setMessage(args.getString("message"));-- return dialog;- }-- protected void messageboxCreateAndShow(Bundle args) {- if (args.getIntArray("buttonIds").length <= 1)- return;-- // TODO set values from "flags" to messagebox dialog-- // get colors-- int[] colors = args.getIntArray("colors");- int backgroundColor;- int textColor;- int buttonBorderColor;- int buttonBackgroundColor;- int buttonSelectedColor;- if (colors != null) {- int i = -1;- backgroundColor = colors[++i];- textColor = colors[++i];- buttonBorderColor = colors[++i];- buttonBackgroundColor = colors[++i];- buttonSelectedColor = colors[++i];- } else {- backgroundColor = Color.TRANSPARENT;- textColor = Color.TRANSPARENT;- buttonBorderColor = Color.TRANSPARENT;- buttonBackgroundColor = Color.TRANSPARENT;- buttonSelectedColor = Color.TRANSPARENT;- }-- // create dialog with title and a listener to wake up calling thread-- final AlertDialog dialog = new AlertDialog.Builder(this).create();- dialog.setTitle(args.getString("title"));- dialog.setCancelable(false);- dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {- @Override- public void onDismiss(DialogInterface unused) {- synchronized (messageboxSelection) {- messageboxSelection.notify();- }- }- });-- // create text-- TextView message = new TextView(this);- message.setGravity(Gravity.CENTER);- message.setText(args.getString("message"));- if (textColor != Color.TRANSPARENT) {- message.setTextColor(textColor);- }-- // create buttons-- int[] buttonFlags = args.getIntArray("buttonFlags");- int[] buttonIds = args.getIntArray("buttonIds");- String[] buttonTexts = args.getStringArray("buttonTexts");-- final SparseArray<Button> mapping = new SparseArray<Button>();-- LinearLayout buttons = new LinearLayout(this);- buttons.setOrientation(LinearLayout.HORIZONTAL);- buttons.setGravity(Gravity.CENTER);- for (int i = 0; i < buttonTexts.length; ++i) {- Button button = new Button(this);- final int id = buttonIds[i];- button.setOnClickListener(new View.OnClickListener() {- @Override- public void onClick(View v) {- messageboxSelection[0] = id;- dialog.dismiss();- }- });- if (buttonFlags[i] != 0) {- // see SDL_messagebox.h- if ((buttonFlags[i] & 0x00000001) != 0) {- mapping.put(KeyEvent.KEYCODE_ENTER, button);- }- if ((buttonFlags[i] & 0x00000002) != 0) {- mapping.put(KeyEvent.KEYCODE_ESCAPE, button); /* API 11 */- }- }- button.setText(buttonTexts[i]);- if (textColor != Color.TRANSPARENT) {- button.setTextColor(textColor);- }- if (buttonBorderColor != Color.TRANSPARENT) {- // TODO set color for border of messagebox button- }- if (buttonBackgroundColor != Color.TRANSPARENT) {- Drawable drawable = button.getBackground();- if (drawable == null) {- // setting the color this way removes the style- button.setBackgroundColor(buttonBackgroundColor);- } else {- // setting the color this way keeps the style (gradient, padding, etc.)- drawable.setColorFilter(buttonBackgroundColor, PorterDuff.Mode.MULTIPLY);- }- }- if (buttonSelectedColor != Color.TRANSPARENT) {- // TODO set color for selected messagebox button- }- buttons.addView(button);- }-- // create content-- LinearLayout content = new LinearLayout(this);- content.setOrientation(LinearLayout.VERTICAL);- content.addView(message);- content.addView(buttons);- if (backgroundColor != Color.TRANSPARENT) {- content.setBackgroundColor(backgroundColor);- }-- // add content to dialog and return-- dialog.setView(content);- dialog.setOnKeyListener(new Dialog.OnKeyListener() {- @Override- public boolean onKey(DialogInterface d, int keyCode, KeyEvent event) {- Button button = mapping.get(keyCode);- if (button != null) {- if (event.getAction() == KeyEvent.ACTION_UP) {- button.performClick();- }- return true; // also for ignored actions- }- return false;- }- });-- dialog.show();- }-- private final Runnable rehideSystemUi = new Runnable() {- @Override- public void run() {- int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |- View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |- View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |- View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |- View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |- View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.INVISIBLE;-- SDLActivity.this.getWindow().getDecorView().setSystemUiVisibility(flags);- }- };-- public void onSystemUiVisibilityChange(int visibility) {- if (SDLActivity.mFullscreenModeActive && ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0 || (visibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0)) {-- Handler handler = getWindow().getDecorView().getHandler();- if (handler != null) {- handler.removeCallbacks(rehideSystemUi); // Prevent a hide loop.- handler.postDelayed(rehideSystemUi, 2000);- }-- }- }-- /**- * This method is called by SDL using JNI.- */- public static boolean clipboardHasText() {- return mClipboardHandler.clipboardHasText();- }-- /**- * This method is called by SDL using JNI.- */- public static String clipboardGetText() {- return mClipboardHandler.clipboardGetText();- }-- /**- * This method is called by SDL using JNI.- */- public static void clipboardSetText(String string) {- mClipboardHandler.clipboardSetText(string);- }-- /**- * This method is called by SDL using JNI.- */- public static int createCustomCursor(int[] colors, int width, int height, int hotSpotX, int hotSpotY) {- Bitmap bitmap = Bitmap.createBitmap(colors, width, height, Bitmap.Config.ARGB_8888);- ++mLastCursorID;-- if (Build.VERSION.SDK_INT >= 24) {- try {- mCursors.put(mLastCursorID, PointerIcon.create(bitmap, hotSpotX, hotSpotY));- } catch (Exception e) {- return 0;- }- } else {- return 0;- }- return mLastCursorID;- }-- /**- * This method is called by SDL using JNI.- */- public static void destroyCustomCursor(int cursorID) {- if (Build.VERSION.SDK_INT >= 24) {- try {- mCursors.remove(cursorID);- } catch (Exception e) {- }- }- return;- }-- /**- * This method is called by SDL using JNI.- */- public static boolean setCustomCursor(int cursorID) {-- if (Build.VERSION.SDK_INT >= 24) {- try {- mSurface.setPointerIcon(mCursors.get(cursorID));- } catch (Exception e) {- return false;- }- } else {- return false;- }- return true;- }-- /**- * This method is called by SDL using JNI.- */- public static boolean setSystemCursor(int cursorID) {- int cursor_type = 0; //PointerIcon.TYPE_NULL;- switch (cursorID) {- case SDL_SYSTEM_CURSOR_ARROW:- cursor_type = 1000; //PointerIcon.TYPE_ARROW;- break;- case SDL_SYSTEM_CURSOR_IBEAM:- cursor_type = 1008; //PointerIcon.TYPE_TEXT;- break;- case SDL_SYSTEM_CURSOR_WAIT:- cursor_type = 1004; //PointerIcon.TYPE_WAIT;- break;- case SDL_SYSTEM_CURSOR_CROSSHAIR:- cursor_type = 1007; //PointerIcon.TYPE_CROSSHAIR;- break;- case SDL_SYSTEM_CURSOR_WAITARROW:- cursor_type = 1004; //PointerIcon.TYPE_WAIT;- break;- case SDL_SYSTEM_CURSOR_SIZENWSE:- cursor_type = 1017; //PointerIcon.TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW;- break;- case SDL_SYSTEM_CURSOR_SIZENESW:- cursor_type = 1016; //PointerIcon.TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW;- break;- case SDL_SYSTEM_CURSOR_SIZEWE:- cursor_type = 1014; //PointerIcon.TYPE_HORIZONTAL_DOUBLE_ARROW;- break;- case SDL_SYSTEM_CURSOR_SIZENS:- cursor_type = 1015; //PointerIcon.TYPE_VERTICAL_DOUBLE_ARROW;- break;- case SDL_SYSTEM_CURSOR_SIZEALL:- cursor_type = 1020; //PointerIcon.TYPE_GRAB;- break;- case SDL_SYSTEM_CURSOR_NO:- cursor_type = 1012; //PointerIcon.TYPE_NO_DROP;- break;- case SDL_SYSTEM_CURSOR_HAND:- cursor_type = 1002; //PointerIcon.TYPE_HAND;- break;- }- if (Build.VERSION.SDK_INT >= 24) {- try {- mSurface.setPointerIcon(PointerIcon.getSystemIcon(SDL.getContext(), cursor_type));- } catch (Exception e) {- return false;- }- }- return true;- }-- /**- * This method is called by SDL using JNI.- */- public static void requestPermission(String permission, int requestCode) {- if (Build.VERSION.SDK_INT < 23) {- nativePermissionResult(requestCode, true);- return;- }-- Activity activity = (Activity)getContext();- if (activity.checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) {- activity.requestPermissions(new String[]{permission}, requestCode);- } else {- nativePermissionResult(requestCode, true);- }- }-- @Override- public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {- if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {- nativePermissionResult(requestCode, true);- } else {- nativePermissionResult(requestCode, false);- }- }-- /**- * This method is called by SDL using JNI.- */- public static int openURL(String url)- {- try {- Intent i = new Intent(Intent.ACTION_VIEW);- i.setData(Uri.parse(url));-- int flags = Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_MULTIPLE_TASK;- if (Build.VERSION.SDK_INT >= 21) {- flags |= Intent.FLAG_ACTIVITY_NEW_DOCUMENT;- } else {- flags |= Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET;- }- i.addFlags(flags);-- mSingleton.startActivity(i);- } catch (Exception ex) {- return -1;- }- return 0;- }-- /**- * This method is called by SDL using JNI.- */- public static int showToast(String message, int duration, int gravity, int xOffset, int yOffset)- {- if(null == mSingleton) {- return - 1;- }-- try- {- class OneShotTask implements Runnable {- String mMessage;- int mDuration;- int mGravity;- int mXOffset;- int mYOffset;-- OneShotTask(String message, int duration, int gravity, int xOffset, int yOffset) {- mMessage = message;- mDuration = duration;- mGravity = gravity;- mXOffset = xOffset;- mYOffset = yOffset;- }-- public void run() {- try- {- Toast toast = Toast.makeText(mSingleton, mMessage, mDuration);- if (mGravity >= 0) {- toast.setGravity(mGravity, mXOffset, mYOffset);- }- toast.show();- } catch(Exception ex) {- Log.e(TAG, ex.getMessage());- }- }- }- mSingleton.runOnUiThread(new OneShotTask(message, duration, gravity, xOffset, yOffset));- } catch(Exception ex) {- return -1;- }- return 0;- }-- public static void nativeCommitText(String text, int newCursorPosition) {- SDLInputConnection.nativeCommitText(text, newCursorPosition);- }-}--/**- Simple runnable to start the SDL application-*/-class SDLMain implements Runnable {- @Override- public void run() {- // Runs SDL_main()- SDLActivity.nativeInit();-- String library = SDLActivity.mSingleton.getMainSharedObject();- String function = SDLActivity.mSingleton.getMainFunction();- String[] arguments = SDLActivity.mSingleton.getArguments();-- try {- android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_DISPLAY);- } catch (Exception e) {- Log.v("SDL", "modify thread properties failed " + e.toString());- }-- Log.v("SDL", "Running main function " + function + " from library " + library);-- SDLActivity.nativeRunMain(library, function, arguments);-- Log.v("SDL", "Finished main function");-- if (SDLActivity.mSingleton == null || SDLActivity.mSingleton.isFinishing()) {- // Activity is already being destroyed- } else {- // Let's finish the Activity- SDLActivity.mSDLThread = null;- SDLActivity.mSingleton.finish();- }- }-}---/**- SDLSurface. This is what we draw on, so we need to know when it's created- in order to do anything useful.-- Because of this, that's where we set up the SDL thread-*/-class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,- View.OnKeyListener, View.OnTouchListener, SensorEventListener {-- // Sensors- protected SensorManager mSensorManager;- protected Display mDisplay;-- // Keep track of the surface size to normalize touch events- protected float mWidth, mHeight;-- // Is SurfaceView ready for rendering- public boolean mIsSurfaceReady;-- private int fixedWidth = 0;- private int fixedHeight = 0;-- private float normalizeTouchCoordinate(float coordinate, int currentViewSize, float measuredFallback) {- // MotionEvent coordinates are local to the laid-out View. mWidth/mHeight- // are populated during onMeasure(), but AAOS may relayout the app area- // after system bars/insets change without those cached values matching- // the final SurfaceView bounds. Use the live bounds whenever possible.- final float size = currentViewSize > 0 ? currentViewSize : measuredFallback;- if (size <= 0.0f) {- return 0.0f;- }-- final float normalized = coordinate / size;- return Math.max(0.0f, Math.min(1.0f, normalized));- }-- private float normalizeTouchX(float x) {- return normalizeTouchCoordinate(x, getWidth(), mWidth);- }-- private float normalizeTouchY(float y) {- return normalizeTouchCoordinate(y, getHeight(), mHeight);- }-- // OPENMW_CHROMEOS_GAMEPLAY_MOUSE_V11- // OPENMW_CHROMEOS_GAMEPLAY_MOUSE_V12_ACCEL- // Pointer capture bypasses ChromeOS pointer ballistics. Keep the proven v1.1- // 2.0x low-speed gain exactly intact, then add only a very gentle speed-dependent- // boost for larger raw samples. X/Y share one gain so direction is preserved.- private static final float CHROMEOS_GAMEPLAY_MOUSE_GAIN_BASE = 2.0f;- private static final float CHROMEOS_GAMEPLAY_MOUSE_GAIN_MID = 2.2f;- private static final float CHROMEOS_GAMEPLAY_MOUSE_GAIN_MAX = 2.5f;- private static final float CHROMEOS_GAMEPLAY_MOUSE_ACCEL_START = 2.0f;- private static final float CHROMEOS_GAMEPLAY_MOUSE_ACCEL_MID = 8.0f;- private static final float CHROMEOS_GAMEPLAY_MOUSE_ACCEL_FULL = 24.0f;- private float mChromeOsCapturedResidualX = 0.0f;- private float mChromeOsCapturedResidualY = 0.0f;- private int mChromeOsMouseDiagnosticSamples = 0;--- // Startup- public SDLSurface(Context context) {- super(context);- fixedWidth = MainActivity.Companion.getResolutionX();- fixedHeight = MainActivity.Companion.getResolutionY();-- if (fixedWidth > 0) {- getHolder().setFixedSize(fixedWidth, fixedHeight);- }- getHolder().addCallback(this);-- setFocusable(true);- setFocusableInTouchMode(true);- requestFocus();- setOnKeyListener(this);- setOnTouchListener(this);-- mDisplay = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();- mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);-- setOnGenericMotionListener(SDLActivity.getMotionListener());-- // Some arbitrary defaults to avoid a potential division by zero- mWidth = 1.0f;- mHeight = 1.0f;-- mIsSurfaceReady = false;- }-- @Override- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {- int widthSize = MeasureSpec.getSize(widthMeasureSpec);- int heightSize = MeasureSpec.getSize(heightMeasureSpec);-- if (fixedWidth > 0) {- float myAspect = 1.0f * fixedWidth / fixedHeight;- float resultWidth = widthSize;- float resultHeight = resultWidth / myAspect;- if (resultHeight > heightSize) {- resultHeight = heightSize;- resultWidth = resultHeight * myAspect;- }-- mWidth = resultWidth;- mHeight = resultHeight;- setMeasuredDimension((int) resultWidth, (int) resultHeight);- } else {- mWidth = widthSize;- mHeight = heightSize;- setMeasuredDimension(widthSize, heightSize);- }- }-- public void handlePause() {- enableSensor(Sensor.TYPE_ACCELEROMETER, false);- }-- public void handleResume() {- setFocusable(true);- setFocusableInTouchMode(true);- requestFocus();- setOnKeyListener(this);- setOnTouchListener(this);- enableSensor(Sensor.TYPE_ACCELEROMETER, true);- }-- public Surface getNativeSurface() {- return getHolder().getSurface();- }-- // Called when we have a valid drawing surface- @Override- public void surfaceCreated(SurfaceHolder holder) {- Log.v("SDL", "surfaceCreated()");- SDLActivity.onNativeSurfaceCreated();- holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);-- SDLActivity.omwSurfaceRecreated();- }-- // Called when we lose the surface- @Override- public void surfaceDestroyed(SurfaceHolder holder) {- Log.v("SDL", "surfaceDestroyed()");-- // Transition to pause, if needed- SDLActivity.mNextNativeState = SDLActivity.NativeState.PAUSED;- SDLActivity.handleNativeState();-- mIsSurfaceReady = false;- SDLActivity.onNativeSurfaceDestroyed();-- SDLActivity.omwSurfaceDestroyed();- }-- // Called when the surface is resized- @Override- public void surfaceChanged(SurfaceHolder holder,- int format, int width, int height) {- Log.v("SDL", "surfaceChanged()");-- if (SDLActivity.mSingleton == null) {- return;- }-- int nDeviceWidth = width;- int nDeviceHeight = height;- try- {- if (Build.VERSION.SDK_INT >= 17) {- android.util.DisplayMetrics realMetrics = new android.util.DisplayMetrics();- mDisplay.getRealMetrics( realMetrics );- nDeviceWidth = realMetrics.widthPixels;- nDeviceHeight = realMetrics.heightPixels;- }- }- catch ( java.lang.Throwable throwable ) {}-- synchronized(SDLActivity.getContext()) {- // In case we're waiting on a size change after going fullscreen, send a notification.- SDLActivity.getContext().notifyAll();- }-- Log.v("SDL", "Window size: " + width + "x" + height);- Log.v("SDL", "Device size: " + nDeviceWidth + "x" + nDeviceHeight);-- // OPENMW_CHROMEOS_CUSTOM_RESOLUTION_V1- // ARC/ChromeOS may resize the Android SurfaceView back to the physical- // display size even though OpenMW-Android requested a fixed custom- // rendering size through SurfaceHolder.setFixedSize(). Keep the real- // device dimensions for SDL's display information, but preserve the- // launcher-selected logical window size passed to native SDL/OpenMW.- //- // Normal Android devices retain the original path unchanged.- int nWindowWidth = width;- int nWindowHeight = height;- if (SDLActivity.isChromebook() && fixedWidth > 0 && fixedHeight > 0) {- nWindowWidth = fixedWidth;- nWindowHeight = fixedHeight;- }-- SDLActivity.nativeSetScreenResolution(- nWindowWidth,- nWindowHeight,- nDeviceWidth,- nDeviceHeight,- mDisplay.getRefreshRate());- SDLActivity.onNativeResize();-- // Prevent a screen distortion glitch,- // for instance when the device is in Landscape and a Portrait App is resumed.- boolean skip = false;- int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation();-- if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)- {- // Accept any- }- else if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT)- {- if (mWidth > mHeight) {- skip = true;- }- } else if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) {- if (mWidth < mHeight) {- skip = true;- }- }-- // Special Patch for Square Resolution: Black Berry Passport- if (skip) {- double min = Math.min(mWidth, mHeight);- double max = Math.max(mWidth, mHeight);-- if (max / min < 1.20) {- Log.v("SDL", "Don't skip on such aspect-ratio. Could be a square resolution.");- skip = false;- }- }-- // Don't skip in MultiWindow.- if (skip) {- if (Build.VERSION.SDK_INT >= 24) {- if (SDLActivity.mSingleton.isInMultiWindowMode()) {- Log.v("SDL", "Don't skip in Multi-Window");- skip = false;- }- }- }-- if (skip) {- Log.v("SDL", "Skip .. Surface is not ready.");- mIsSurfaceReady = false;- return;- }-- /* If the surface has been previously destroyed by onNativeSurfaceDestroyed, recreate it here */- SDLActivity.onNativeSurfaceChanged();-- /* Surface is ready */- mIsSurfaceReady = true;-- SDLActivity.mNextNativeState = SDLActivity.NativeState.RESUMED;- SDLActivity.handleNativeState();- }-- // Key events- @Override- public boolean onKey(View v, int keyCode, KeyEvent event) {-- int deviceId = event.getDeviceId();- int source = event.getSource();-- // Dispatch the different events depending on where they come from- // Some SOURCE_JOYSTICK, SOURCE_DPAD or SOURCE_GAMEPAD are also SOURCE_KEYBOARD- // So, we try to process them as JOYSTICK/DPAD/GAMEPAD events first, if that fails we try them as KEYBOARD- //- // Furthermore, it's possible a game controller has SOURCE_KEYBOARD and- // SOURCE_JOYSTICK, while its key events arrive from the keyboard source- // So, retrieve the device itself and check all of its sources- if (SDLControllerManager.isDeviceSDLJoystick(deviceId)) {- // Note that we process events with specific key codes here- if (event.getAction() == KeyEvent.ACTION_DOWN) {- if (SDLControllerManager.onNativePadDown(deviceId, keyCode) == 0) {- return true;- }- } else if (event.getAction() == KeyEvent.ACTION_UP) {- if (SDLControllerManager.onNativePadUp(deviceId, keyCode) == 0) {- return true;- }- }- }-- if (source == InputDevice.SOURCE_UNKNOWN) {- InputDevice device = InputDevice.getDevice(deviceId);- if (device != null) {- source = device.getSources();- }- }-- if ((source & InputDevice.SOURCE_KEYBOARD) != 0) {- if (event.getAction() == KeyEvent.ACTION_DOWN) {- //Log.v("SDL", "key down: " + keyCode);- if (SDLActivity.isTextInputEvent(event)) {- SDLInputConnection.nativeCommitText(String.valueOf((char) event.getUnicodeChar()), 1);- }- SDLActivity.onNativeKeyDown(keyCode);- return true;- }- else if (event.getAction() == KeyEvent.ACTION_UP) {- //Log.v("SDL", "key up: " + keyCode);- SDLActivity.onNativeKeyUp(keyCode);- return true;- }- }-- if ((source & InputDevice.SOURCE_MOUSE) != 0) {- // on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses- // they are ignored here because sending them as mouse input to SDL is messy- if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {- switch (event.getAction()) {- case KeyEvent.ACTION_DOWN:- case KeyEvent.ACTION_UP:- // mark the event as handled or it will be handled by system- // handling KEYCODE_BACK by system will call onBackPressed()- return true;- }- }- }-- return false;- }-- // Touch events- @Override- public boolean onTouch(View v, MotionEvent event) {- /* Ref: http://developer.android.com/training/gestures/multi.html */- final int touchDevId = event.getDeviceId();- final int pointerCount = event.getPointerCount();- int action = event.getActionMasked();- int pointerFingerId;- int mouseButton;- int i = -1;- float x,y,p;-- // drop event unless the mouse is shown (i.e. unless we're in a mouse-enabled menu)- if ((action == MotionEvent.ACTION_DOWN || action == MotionEvent.ACTION_POINTER_DOWN) &&- SDLActivity.isMouseShown() == 0)- return false;-- // For joystick mode don't process touch events at all- if (GameActivity.Companion.getMouseMode() == MouseMode.Joystick)- return false;-- // 12290 = Samsung DeX mode desktop mouse- // 12290 = 0x3002 = 0x2002 | 0x1002 = SOURCE_MOUSE | SOURCE_TOUCHSCREEN- // 0x2 = SOURCE_CLASS_POINTER- if (event.getSource() == InputDevice.SOURCE_MOUSE || event.getSource() == (InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHSCREEN)) {- try {- mouseButton = (Integer) event.getClass().getMethod("getButtonState").invoke(event);- } catch(Exception e) {- mouseButton = 1;- }-- // We need to check if we're in relative mouse mode and get the axis offset rather than the x/y values- // if we are. We'll leverage our existing mouse motion listener- SDLGenericMotionListener_API12 motionListener = SDLActivity.getMotionListener();- x = motionListener.getEventX(event);- y = motionListener.getEventY(event);-- boolean relativeMouse = motionListener.inRelativeMode();- if (!relativeMouse && (SDLActivity.isChromebook() || SDLActivity.isAutomotive())) {- // OPENMW_CHROMEOS_NATIVE_MOUSE_V1- // OPENMW_AUTOMOTIVE_TOUCH_COORDINATES_V1- // ChromeOS cursors and some AAOS touch panels report absolute- // coordinates in host View pixels. Map those GUI coordinates to- // OpenMW's logical render size; never scale relative mouse deltas.- x = SDLActivity.scaleAbsoluteMouseX(x);- y = SDLActivity.scaleAbsoluteMouseY(y);- }-- SDLActivity.onNativeMouse(mouseButton, action, x, y, relativeMouse);- } else {- switch(action) {- case MotionEvent.ACTION_MOVE:- for (i = 0; i < pointerCount; i++) {- pointerFingerId = event.getPointerId(i);- x = normalizeTouchX(event.getX(i));- y = normalizeTouchY(event.getY(i));- p = event.getPressure(i);- if (p > 1.0f) {- // may be larger than 1.0f on some devices- // see the documentation of getPressure(i)- p = 1.0f;- }- SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);- }- break;-- case MotionEvent.ACTION_UP:- case MotionEvent.ACTION_DOWN:- // Primary pointer up/down, the index is always zero- i = 0;- case MotionEvent.ACTION_POINTER_UP:- case MotionEvent.ACTION_POINTER_DOWN:- // Non primary pointer up/down- if (i == -1) {- i = event.getActionIndex();- }-- pointerFingerId = event.getPointerId(i);- x = normalizeTouchX(event.getX(i));- y = normalizeTouchY(event.getY(i));- p = event.getPressure(i);- if (p > 1.0f) {- // may be larger than 1.0f on some devices- // see the documentation of getPressure(i)- p = 1.0f;- }- SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);- break;-- case MotionEvent.ACTION_CANCEL:- for (i = 0; i < pointerCount; i++) {- pointerFingerId = event.getPointerId(i);- x = normalizeTouchX(event.getX(i));- y = normalizeTouchY(event.getY(i));- p = event.getPressure(i);- if (p > 1.0f) {- // may be larger than 1.0f on some devices- // see the documentation of getPressure(i)- p = 1.0f;- }- SDLActivity.onNativeTouch(touchDevId, pointerFingerId, MotionEvent.ACTION_UP, x, y, p);- }- break;-- default:- break;- }- }-- return true;- }-- // Sensor events- public void enableSensor(int sensortype, boolean enabled) {- // TODO: This uses getDefaultSensor - what if we have >1 accels?- if (enabled) {- mSensorManager.registerListener(this,- mSensorManager.getDefaultSensor(sensortype),- SensorManager.SENSOR_DELAY_GAME, null);- } else {- mSensorManager.unregisterListener(this,- mSensorManager.getDefaultSensor(sensortype));- }- }-- @Override- public void onAccuracyChanged(Sensor sensor, int accuracy) {- // TODO- }-- @Override- public void onSensorChanged(SensorEvent event) {- if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {-- // Since we may have an orientation set, we won't receive onConfigurationChanged events.- // We thus should check here.- int newOrientation = SDLActivity.SDL_ORIENTATION_UNKNOWN;-- float x, y;- switch (mDisplay.getRotation()) {- case Surface.ROTATION_90:- x = -event.values[1];- y = event.values[0];- newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE;- break;- case Surface.ROTATION_270:- x = event.values[1];- y = -event.values[0];- newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE_FLIPPED;- break;- case Surface.ROTATION_180:- x = -event.values[0];- y = -event.values[1];- newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT_FLIPPED;- break;- default:- x = event.values[0];- y = event.values[1];- newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT;- break;- }-- if (newOrientation != SDLActivity.mCurrentOrientation) {- SDLActivity.mCurrentOrientation = newOrientation;- SDLActivity.onNativeOrientationChanged(newOrientation);- }-- SDLActivity.onNativeAccel(-x / SensorManager.GRAVITY_EARTH,- y / SensorManager.GRAVITY_EARTH,- event.values[2] / SensorManager.GRAVITY_EARTH);--- }- }-- // Captured pointer events for API 26.- private float getChromeOsCapturedDelta(MotionEvent event, int axis, int historyIndex)- {- float relative;- if (historyIndex >= 0) {- relative = event.getHistoricalAxisValue(axis, 0, historyIndex);- } else {- relative = event.getAxisValue(axis, 0);- }-- if (relative != 0.0f) {- return relative;- }-- // Older/ARC implementations may expose captured mouse deltas through X/Y.- if (axis == MotionEvent.AXIS_RELATIVE_X) {- return historyIndex >= 0 ? event.getHistoricalX(0, historyIndex) : event.getX(0);- }- return historyIndex >= 0 ? event.getHistoricalY(0, historyIndex) : event.getY(0);- }-- private int roundCapturedMouseSymmetric(float value)- {- return value >= 0.0f- ? (int)Math.floor(value + 0.5f)- : (int)Math.ceil(value - 0.5f);- }-- private float smoothChromeOsMouseGain(float t)- {- t = Math.max(0.0f, Math.min(1.0f, t));- return t * t * (3.0f - 2.0f * t);- }-- private float getChromeOsGameplayMouseGain(float rawX, float rawY)- {- float magnitude = (float)Math.hypot(rawX, rawY);-- if (magnitude <= CHROMEOS_GAMEPLAY_MOUSE_ACCEL_START) {- return CHROMEOS_GAMEPLAY_MOUSE_GAIN_BASE;- }-- if (magnitude < CHROMEOS_GAMEPLAY_MOUSE_ACCEL_MID) {- float t = (magnitude - CHROMEOS_GAMEPLAY_MOUSE_ACCEL_START)- / (CHROMEOS_GAMEPLAY_MOUSE_ACCEL_MID - CHROMEOS_GAMEPLAY_MOUSE_ACCEL_START);- t = smoothChromeOsMouseGain(t);- return CHROMEOS_GAMEPLAY_MOUSE_GAIN_BASE- + (CHROMEOS_GAMEPLAY_MOUSE_GAIN_MID - CHROMEOS_GAMEPLAY_MOUSE_GAIN_BASE) * t;- }-- if (magnitude < CHROMEOS_GAMEPLAY_MOUSE_ACCEL_FULL) {- float t = (magnitude - CHROMEOS_GAMEPLAY_MOUSE_ACCEL_MID)- / (CHROMEOS_GAMEPLAY_MOUSE_ACCEL_FULL - CHROMEOS_GAMEPLAY_MOUSE_ACCEL_MID);- t = smoothChromeOsMouseGain(t);- return CHROMEOS_GAMEPLAY_MOUSE_GAIN_MID- + (CHROMEOS_GAMEPLAY_MOUSE_GAIN_MAX - CHROMEOS_GAMEPLAY_MOUSE_GAIN_MID) * t;- }-- return CHROMEOS_GAMEPLAY_MOUSE_GAIN_MAX;- }-- private void dispatchChromeOsCapturedMouseSample(MotionEvent event, int action, int historyIndex)- {- float rawX = getChromeOsCapturedDelta(event, MotionEvent.AXIS_RELATIVE_X, historyIndex);- float rawY = getChromeOsCapturedDelta(event, MotionEvent.AXIS_RELATIVE_Y, historyIndex);-- float gameplayGain = getChromeOsGameplayMouseGain(rawX, rawY);- mChromeOsCapturedResidualX += rawX * gameplayGain;- mChromeOsCapturedResidualY += rawY * gameplayGain;-- int wholeX = roundCapturedMouseSymmetric(mChromeOsCapturedResidualX);- int wholeY = roundCapturedMouseSymmetric(mChromeOsCapturedResidualY);-- mChromeOsCapturedResidualX -= wholeX;- mChromeOsCapturedResidualY -= wholeY;-- if (SDLActivity.isChromebook() && mChromeOsMouseDiagnosticSamples < 12- && (rawX != 0.0f || rawY != 0.0f)) {- Log.i("OpenMW-Mouse",- "captured raw=" + rawX + "," + rawY- + " gain=" + gameplayGain- + " out=" + wholeX + "," + wholeY- + " history=" + historyIndex);- mChromeOsMouseDiagnosticSamples++;- }-- if (wholeX != 0 || wholeY != 0) {- SDLActivity.onNativeMouse(0, action, wholeX, wholeY, true);- }- }-- @Override- public void onPointerCaptureChange(boolean hasCapture)- {- super.onPointerCaptureChange(hasCapture);-- // Never carry a fractional remainder across GUI <-> gameplay transitions.- mChromeOsCapturedResidualX = 0.0f;- mChromeOsCapturedResidualY = 0.0f;- mChromeOsMouseDiagnosticSamples = 0;-- if (SDLActivity.isChromebook()) {- Log.i("OpenMW-Mouse", "pointerCapture=" + hasCapture- + " gameplayGain=" + CHROMEOS_GAMEPLAY_MOUSE_GAIN_BASE- + ".." + CHROMEOS_GAMEPLAY_MOUSE_GAIN_MAX);- }- }-- // OPENMW_CHROMEOS_NATIVE_MOUSE_V1- // OPENMW_CHROMEOS_GAMEPLAY_MOUSE_V11- public boolean onCapturedPointerEvent(MotionEvent event)- {- int action = event.getActionMasked();-- float x, y;- switch (action) {- case MotionEvent.ACTION_SCROLL:- x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);- y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);- SDLActivity.onNativeMouse(0, action, x, y, false);- return true;-- case MotionEvent.ACTION_HOVER_MOVE:- case MotionEvent.ACTION_MOVE:- if (SDLActivity.isChromebook()) {- // AXIS_RELATIVE_X/Y values are not accumulated by Android when- // MotionEvents are batched. Process every historical sample first.- for (int historyIndex = 0; historyIndex < event.getHistorySize(); historyIndex++) {- dispatchChromeOsCapturedMouseSample(event, action, historyIndex);- }- dispatchChromeOsCapturedMouseSample(event, action, -1);- } else {- // Keep the stock SDL Android path unchanged on non-Chromebook devices.- x = event.getX(0);- y = event.getY(0);- SDLActivity.onNativeMouse(0, action, x, y, true);- }- return true;-- case MotionEvent.ACTION_BUTTON_PRESS:- case MotionEvent.ACTION_BUTTON_RELEASE:-- // Change our action value to what SDL's code expects.- if (action == MotionEvent.ACTION_BUTTON_PRESS) {- action = MotionEvent.ACTION_DOWN;- }- else if (action == MotionEvent.ACTION_BUTTON_RELEASE) {- action = MotionEvent.ACTION_UP;- }-- int button = event.getButtonState();-- if (SDLActivity.isChromebook()) {- // Button transitions must not inject an additional camera delta.- SDLActivity.onNativeMouse(button, action, 0.0f, 0.0f, true);- } else {- x = event.getX(0);- y = event.getY(0);- SDLActivity.onNativeMouse(button, action, x, y, true);- }- return true;- }-- return false;- }--}--/* This is a fake invisible editor view that receives the input and defines the- * pan&scan region- */-class DummyEdit extends View implements View.OnKeyListener {- InputConnection ic;-- public DummyEdit(Context context) {- super(context);- setFocusableInTouchMode(true);- setFocusable(true);- setOnKeyListener(this);- }-- @Override- public boolean onCheckIsTextEditor() {- return true;- }-- @Override- public boolean onKey(View v, int keyCode, KeyEvent event) {- /*- * This handles the hardware keyboard input- */- if (event.getAction() == KeyEvent.ACTION_DOWN) {- if (SDLActivity.isTextInputEvent(event)) {- ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);- return true;- }- SDLActivity.onNativeKeyDown(keyCode);- return true;- } else if (event.getAction() == KeyEvent.ACTION_UP) {- SDLActivity.onNativeKeyUp(keyCode);- return true;- }- return false;- }-- //- @Override- public boolean onKeyPreIme (int keyCode, KeyEvent event) {- // As seen on StackOverflow: http://stackoverflow.com/questions/7634346/keyboard-hide-event- // FIXME: Discussion at http://bugzilla.libsdl.org/show_bug.cgi?id=1639- // FIXME: This is not a 100% effective solution to the problem of detecting if the keyboard is showing or not- // FIXME: A more effective solution would be to assume our Layout to be RelativeLayout or LinearLayout- // FIXME: And determine the keyboard presence doing this: http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android- // FIXME: An even more effective way would be if Android provided this out of the box, but where would the fun be in that :)- if (event.getAction()==KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {- if (SDLActivity.mTextEdit != null && SDLActivity.mTextEdit.getVisibility() == View.VISIBLE) {- SDLActivity.onNativeKeyboardFocusLost();- }- }- return super.onKeyPreIme(keyCode, event);- }-- @Override- public InputConnection onCreateInputConnection(EditorInfo outAttrs) {- ic = new SDLInputConnection(this, true);-- outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;- outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI- | EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;-- return ic;- }-}--class SDLInputConnection extends BaseInputConnection {-- public SDLInputConnection(View targetView, boolean fullEditor) {- super(targetView, fullEditor);-- }-- @Override- public boolean sendKeyEvent(KeyEvent event) {- /*- * This used to handle the keycodes from soft keyboard (and IME-translated input from hardkeyboard)- * However, as of Ice Cream Sandwich and later, almost all soft keyboard doesn't generate key presses- * and so we need to generate them ourselves in commitText. To avoid duplicates on the handful of keys- * that still do, we empty this out.- */-- /*- * Return DOES still generate a key event, however. So rather than using it as the 'click a button' key- * as we do with physical keyboards, let's just use it to hide the keyboard.- */-- if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {- if (SDLActivity.onNativeSoftReturnKey()) {- return true;- }- }--- return super.sendKeyEvent(event);- }-- @Override- public boolean commitText(CharSequence text, int newCursorPosition) {-- for (int i = 0; i < text.length(); i++) {- char c = text.charAt(i);- if (c == '\n') {- if (SDLActivity.onNativeSoftReturnKey()) {- return true;- }- }- nativeGenerateScancodeForUnichar(c);- }-- SDLInputConnection.nativeCommitText(text.toString(), newCursorPosition);-- return super.commitText(text, newCursorPosition);- }-- @Override- public boolean setComposingText(CharSequence text, int newCursorPosition) {-- nativeSetComposingText(text.toString(), newCursorPosition);-- return super.setComposingText(text, newCursorPosition);- }-- public static native void nativeCommitText(String text, int newCursorPosition);-- public native void nativeGenerateScancodeForUnichar(char c);-- public native void nativeSetComposingText(String text, int newCursorPosition);-- @Override- public boolean deleteSurroundingText(int beforeLength, int afterLength) {- // Workaround to capture backspace key. Ref: http://stackoverflow.com/questions/14560344/android-backspace-in-webview-baseinputconnection- // and https://bugzilla.libsdl.org/show_bug.cgi?id=2265- if (beforeLength > 0 && afterLength == 0) {- boolean ret = true;- // backspace(s)- while (beforeLength-- > 0) {- boolean ret_key = sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL))- && sendKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL));- ret = ret && ret_key;- }- return ret;- }-- return super.deleteSurroundingText(beforeLength, afterLength);- }-}--interface SDLClipboardHandler {-- boolean clipboardHasText();- String clipboardGetText();- void clipboardSetText(String string);--}---class SDLClipboardHandler_API11 implements- SDLClipboardHandler,- android.content.ClipboardManager.OnPrimaryClipChangedListener {-- protected android.content.ClipboardManager mClipMgr;-- SDLClipboardHandler_API11() {- mClipMgr = (android.content.ClipboardManager) SDL.getContext().getSystemService(Context.CLIPBOARD_SERVICE);- mClipMgr.addPrimaryClipChangedListener(this);- }-- @Override- public boolean clipboardHasText() {- return mClipMgr.hasPrimaryClip();- }-- @Override- public String clipboardGetText() {- ClipData clip = mClipMgr.getPrimaryClip();- if (clip != null) {- ClipData.Item item = clip.getItemAt(0);- if (item != null) {- CharSequence text = item.getText();- if (text != null) {- return text.toString();- }- }- }- return null;- }-- @Override- public void clipboardSetText(String string) {- mClipMgr.removePrimaryClipChangedListener(this);- ClipData clip = ClipData.newPlainText(null, string);- mClipMgr.setPrimaryClip(clip);- mClipMgr.addPrimaryClipChangedListener(this);- }-- @Override- public void onPrimaryClipChanged() {- SDLActivity.onNativeClipboardChanged();- }-}diff --git a/android/app/src/main/java/org/libsdl/app/SDLAudioManager.java b/android/app/src/main/java/org/libsdl/app/SDLAudioManager.javadeleted file mode 100644index 2bfc718..0000000--- a/android/app/src/main/java/org/libsdl/app/SDLAudioManager.java+++ /dev/null@@ -1,394 +0,0 @@-package org.libsdl.app;--import android.media.AudioFormat;-import android.media.AudioManager;-import android.media.AudioRecord;-import android.media.AudioTrack;-import android.media.MediaRecorder;-import android.os.Build;-import android.util.Log;--public class SDLAudioManager-{- protected static final String TAG = "SDLAudio";-- protected static AudioTrack mAudioTrack;- protected static AudioRecord mAudioRecord;-- public static void initialize() {- mAudioTrack = null;- mAudioRecord = null;- }-- // Audio-- protected static String getAudioFormatString(int audioFormat) {- switch (audioFormat) {- case AudioFormat.ENCODING_PCM_8BIT:- return "8-bit";- case AudioFormat.ENCODING_PCM_16BIT:- return "16-bit";- case AudioFormat.ENCODING_PCM_FLOAT:- return "float";- default:- return Integer.toString(audioFormat);- }- }-- protected static int[] open(boolean isCapture, int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {- int channelConfig;- int sampleSize;- int frameSize;-- Log.v(TAG, "Opening " + (isCapture ? "capture" : "playback") + ", requested " + desiredFrames + " frames of " + desiredChannels + " channel " + getAudioFormatString(audioFormat) + " audio at " + sampleRate + " Hz");-- /* On older devices let's use known good settings */- if (Build.VERSION.SDK_INT < 21) {- if (desiredChannels > 2) {- desiredChannels = 2;- }- }-- /* AudioTrack has sample rate limitation of 48000 (fixed in 5.0.2) */- if (Build.VERSION.SDK_INT < 22) {- if (sampleRate < 8000) {- sampleRate = 8000;- } else if (sampleRate > 48000) {- sampleRate = 48000;- }- }-- if (audioFormat == AudioFormat.ENCODING_PCM_FLOAT) {- int minSDKVersion = (isCapture ? 23 : 21);- if (Build.VERSION.SDK_INT < minSDKVersion) {- audioFormat = AudioFormat.ENCODING_PCM_16BIT;- }- }- switch (audioFormat)- {- case AudioFormat.ENCODING_PCM_8BIT:- sampleSize = 1;- break;- case AudioFormat.ENCODING_PCM_16BIT:- sampleSize = 2;- break;- case AudioFormat.ENCODING_PCM_FLOAT:- sampleSize = 4;- break;- default:- Log.v(TAG, "Requested format " + audioFormat + ", getting ENCODING_PCM_16BIT");- audioFormat = AudioFormat.ENCODING_PCM_16BIT;- sampleSize = 2;- break;- }-- if (isCapture) {- switch (desiredChannels) {- case 1:- channelConfig = AudioFormat.CHANNEL_IN_MONO;- break;- case 2:- channelConfig = AudioFormat.CHANNEL_IN_STEREO;- break;- default:- Log.v(TAG, "Requested " + desiredChannels + " channels, getting stereo");- desiredChannels = 2;- channelConfig = AudioFormat.CHANNEL_IN_STEREO;- break;- }- } else {- switch (desiredChannels) {- case 1:- channelConfig = AudioFormat.CHANNEL_OUT_MONO;- break;- case 2:- channelConfig = AudioFormat.CHANNEL_OUT_STEREO;- break;- case 3:- channelConfig = AudioFormat.CHANNEL_OUT_STEREO | AudioFormat.CHANNEL_OUT_FRONT_CENTER;- break;- case 4:- channelConfig = AudioFormat.CHANNEL_OUT_QUAD;- break;- case 5:- channelConfig = AudioFormat.CHANNEL_OUT_QUAD | AudioFormat.CHANNEL_OUT_FRONT_CENTER;- break;- case 6:- channelConfig = AudioFormat.CHANNEL_OUT_5POINT1;- break;- case 7:- channelConfig = AudioFormat.CHANNEL_OUT_5POINT1 | AudioFormat.CHANNEL_OUT_BACK_CENTER;- break;- case 8:- if (Build.VERSION.SDK_INT >= 23) {- channelConfig = AudioFormat.CHANNEL_OUT_7POINT1_SURROUND;- } else {- Log.v(TAG, "Requested " + desiredChannels + " channels, getting 5.1 surround");- desiredChannels = 6;- channelConfig = AudioFormat.CHANNEL_OUT_5POINT1;- }- break;- default:- Log.v(TAG, "Requested " + desiredChannels + " channels, getting stereo");- desiredChannels = 2;- channelConfig = AudioFormat.CHANNEL_OUT_STEREO;- break;- }--/*- Log.v(TAG, "Speaker configuration (and order of channels):");-- if ((channelConfig & 0x00000004) != 0) {- Log.v(TAG, " CHANNEL_OUT_FRONT_LEFT");- }- if ((channelConfig & 0x00000008) != 0) {- Log.v(TAG, " CHANNEL_OUT_FRONT_RIGHT");- }- if ((channelConfig & 0x00000010) != 0) {- Log.v(TAG, " CHANNEL_OUT_FRONT_CENTER");- }- if ((channelConfig & 0x00000020) != 0) {- Log.v(TAG, " CHANNEL_OUT_LOW_FREQUENCY");- }- if ((channelConfig & 0x00000040) != 0) {- Log.v(TAG, " CHANNEL_OUT_BACK_LEFT");- }- if ((channelConfig & 0x00000080) != 0) {- Log.v(TAG, " CHANNEL_OUT_BACK_RIGHT");- }- if ((channelConfig & 0x00000100) != 0) {- Log.v(TAG, " CHANNEL_OUT_FRONT_LEFT_OF_CENTER");- }- if ((channelConfig & 0x00000200) != 0) {- Log.v(TAG, " CHANNEL_OUT_FRONT_RIGHT_OF_CENTER");- }- if ((channelConfig & 0x00000400) != 0) {- Log.v(TAG, " CHANNEL_OUT_BACK_CENTER");- }- if ((channelConfig & 0x00000800) != 0) {- Log.v(TAG, " CHANNEL_OUT_SIDE_LEFT");- }- if ((channelConfig & 0x00001000) != 0) {- Log.v(TAG, " CHANNEL_OUT_SIDE_RIGHT");- }-*/- }- frameSize = (sampleSize * desiredChannels);-- // Let the user pick a larger buffer if they really want -- but ye- // gods they probably shouldn't, the minimums are horrifyingly high- // latency already- int minBufferSize;- if (isCapture) {- minBufferSize = AudioRecord.getMinBufferSize(sampleRate, channelConfig, audioFormat);- } else {- minBufferSize = AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat);- }- desiredFrames = Math.max(desiredFrames, (minBufferSize + frameSize - 1) / frameSize);-- int[] results = new int[4];-- if (isCapture) {- if (mAudioRecord == null) {- mAudioRecord = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, sampleRate,- channelConfig, audioFormat, desiredFrames * frameSize);-- // see notes about AudioTrack state in audioOpen(), above. Probably also applies here.- if (mAudioRecord.getState() != AudioRecord.STATE_INITIALIZED) {- Log.e(TAG, "Failed during initialization of AudioRecord");- mAudioRecord.release();- mAudioRecord = null;- return null;- }-- mAudioRecord.startRecording();- }-- results[0] = mAudioRecord.getSampleRate();- results[1] = mAudioRecord.getAudioFormat();- results[2] = mAudioRecord.getChannelCount();-- } else {- if (mAudioTrack == null) {- mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate, channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM);-- // Instantiating AudioTrack can "succeed" without an exception and the track may still be invalid- // Ref: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/AudioTrack.java- // Ref: http://developer.android.com/reference/android/media/AudioTrack.html#getState()- if (mAudioTrack.getState() != AudioTrack.STATE_INITIALIZED) {- /* Try again, with safer values */-- Log.e(TAG, "Failed during initialization of Audio Track");- mAudioTrack.release();- mAudioTrack = null;- return null;- }-- mAudioTrack.play();- }-- results[0] = mAudioTrack.getSampleRate();- results[1] = mAudioTrack.getAudioFormat();- results[2] = mAudioTrack.getChannelCount();- }- results[3] = desiredFrames;-- Log.v(TAG, "Opening " + (isCapture ? "capture" : "playback") + ", got " + results[3] + " frames of " + results[2] + " channel " + getAudioFormatString(results[1]) + " audio at " + results[0] + " Hz");-- return results;- }-- /**- * This method is called by SDL using JNI.- */- public static int[] audioOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {- return open(false, sampleRate, audioFormat, desiredChannels, desiredFrames);- }-- /**- * This method is called by SDL using JNI.- */- public static void audioWriteFloatBuffer(float[] buffer) {- if (mAudioTrack == null) {- Log.e(TAG, "Attempted to make audio call with uninitialized audio!");- return;- }-- for (int i = 0; i < buffer.length;) {- int result = mAudioTrack.write(buffer, i, buffer.length - i, AudioTrack.WRITE_BLOCKING);- if (result > 0) {- i += result;- } else if (result == 0) {- try {- Thread.sleep(1);- } catch(InterruptedException e) {- // Nom nom- }- } else {- Log.w(TAG, "SDL audio: error return from write(float)");- return;- }- }- }-- /**- * This method is called by SDL using JNI.- */- public static void audioWriteShortBuffer(short[] buffer) {- if (mAudioTrack == null) {- Log.e(TAG, "Attempted to make audio call with uninitialized audio!");- return;- }-- for (int i = 0; i < buffer.length;) {- int result = mAudioTrack.write(buffer, i, buffer.length - i);- if (result > 0) {- i += result;- } else if (result == 0) {- try {- Thread.sleep(1);- } catch(InterruptedException e) {- // Nom nom- }- } else {- Log.w(TAG, "SDL audio: error return from write(short)");- return;- }- }- }-- /**- * This method is called by SDL using JNI.- */- public static void audioWriteByteBuffer(byte[] buffer) {- if (mAudioTrack == null) {- Log.e(TAG, "Attempted to make audio call with uninitialized audio!");- return;- }-- for (int i = 0; i < buffer.length; ) {- int result = mAudioTrack.write(buffer, i, buffer.length - i);- if (result > 0) {- i += result;- } else if (result == 0) {- try {- Thread.sleep(1);- } catch(InterruptedException e) {- // Nom nom- }- } else {- Log.w(TAG, "SDL audio: error return from write(byte)");- return;- }- }- }-- /**- * This method is called by SDL using JNI.- */- public static int[] captureOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {- return open(true, sampleRate, audioFormat, desiredChannels, desiredFrames);- }-- /** This method is called by SDL using JNI. */- public static int captureReadFloatBuffer(float[] buffer, boolean blocking) {- return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);- }-- /** This method is called by SDL using JNI. */- public static int captureReadShortBuffer(short[] buffer, boolean blocking) {- if (Build.VERSION.SDK_INT < 23) {- return mAudioRecord.read(buffer, 0, buffer.length);- } else {- return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);- }- }-- /** This method is called by SDL using JNI. */- public static int captureReadByteBuffer(byte[] buffer, boolean blocking) {- if (Build.VERSION.SDK_INT < 23) {- return mAudioRecord.read(buffer, 0, buffer.length);- } else {- return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);- }- }-- /** This method is called by SDL using JNI. */- public static void audioClose() {- if (mAudioTrack != null) {- mAudioTrack.stop();- mAudioTrack.release();- mAudioTrack = null;- }- }-- /** This method is called by SDL using JNI. */- public static void captureClose() {- if (mAudioRecord != null) {- mAudioRecord.stop();- mAudioRecord.release();- mAudioRecord = null;- }- }-- /** This method is called by SDL using JNI. */- public static void audioSetThreadPriority(boolean iscapture, int device_id) {- try {-- /* Set thread name */- if (iscapture) {- Thread.currentThread().setName("SDLAudioC" + device_id);- } else {- Thread.currentThread().setName("SDLAudioP" + device_id);- }-- /* Set thread priority */- android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_AUDIO);-- } catch (Exception e) {- Log.v(TAG, "modify thread properties failed " + e.toString());- }- }-- public static native int nativeSetupJNI();-}diff --git a/android/app/src/main/java/org/libsdl/app/SDLControllerManager.java b/android/app/src/main/java/org/libsdl/app/SDLControllerManager.javadeleted file mode 100644index f47217d..0000000--- a/android/app/src/main/java/org/libsdl/app/SDLControllerManager.java+++ /dev/null@@ -1,817 +0,0 @@-package org.libsdl.app;--import java.util.ArrayList;-import java.util.Collections;-import java.util.Comparator;-import java.util.List;--import android.content.Context;-import android.os.Build;-import android.os.VibrationEffect;-import android.os.Vibrator;-import android.util.Log;-import android.view.InputDevice;-import android.view.KeyEvent;-import android.view.MotionEvent;-import android.view.View;---public class SDLControllerManager-{-- public static native int nativeSetupJNI();-- public static native int nativeAddJoystick(int device_id, String name, String desc,- int vendor_id, int product_id,- boolean is_accelerometer, int button_mask,- int naxes, int nhats, int nballs);- public static native int nativeRemoveJoystick(int device_id);- public static native int nativeAddHaptic(int device_id, String name);- public static native int nativeRemoveHaptic(int device_id);- public static native int onNativePadDown(int device_id, int keycode);- public static native int onNativePadUp(int device_id, int keycode);- public static native void onNativeJoy(int device_id, int axis,- float value);- public static native void onNativeHat(int device_id, int hat_id,- int x, int y);-- protected static SDLJoystickHandler mJoystickHandler;- protected static SDLHapticHandler mHapticHandler;-- private static final String TAG = "SDLControllerManager";-- public static void initialize() {- if (mJoystickHandler == null) {- if (Build.VERSION.SDK_INT >= 19) {- mJoystickHandler = new SDLJoystickHandler_API19();- } else {- mJoystickHandler = new SDLJoystickHandler_API16();- }- }-- if (mHapticHandler == null) {- if (Build.VERSION.SDK_INT >= 26) {- mHapticHandler = new SDLHapticHandler_API26();- } else {- mHapticHandler = new SDLHapticHandler();- }- }- }-- // Joystick glue code, just a series of stubs that redirect to the SDLJoystickHandler instance- public static boolean handleJoystickMotionEvent(MotionEvent event) {- return mJoystickHandler.handleMotionEvent(event);- }-- /**- * This method is called by SDL using JNI.- */- public static void pollInputDevices() {- mJoystickHandler.pollInputDevices();- }-- /**- * This method is called by SDL using JNI.- */- public static void pollHapticDevices() {- mHapticHandler.pollHapticDevices();- }-- /**- * This method is called by SDL using JNI.- */- public static void hapticRun(int device_id, float intensity, int length) {- mHapticHandler.run(device_id, intensity, length);- }-- /**- * This method is called by SDL using JNI.- */- public static void hapticStop(int device_id)- {- mHapticHandler.stop(device_id);- }-- // Check if a given device is considered a possible SDL joystick- public static boolean isDeviceSDLJoystick(int deviceId) {- InputDevice device = InputDevice.getDevice(deviceId);- // We cannot use InputDevice.isVirtual before API 16, so let's accept- // only nonnegative device ids (VIRTUAL_KEYBOARD equals -1)- if ((device == null) || (deviceId < 0)) {- return false;- }- int sources = device.getSources();-- /* This is called for every button press, so let's not spam the logs */- /*- if ((sources & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {- Log.v(TAG, "Input device " + device.getName() + " has class joystick.");- }- if ((sources & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD) {- Log.v(TAG, "Input device " + device.getName() + " is a dpad.");- }- if ((sources & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) {- Log.v(TAG, "Input device " + device.getName() + " is a gamepad.");- }- */-- return ((sources & InputDevice.SOURCE_CLASS_JOYSTICK) != 0 ||- ((sources & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD) ||- ((sources & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD)- );- }--}--class SDLJoystickHandler {-- /**- * Handles given MotionEvent.- * @param event the event to be handled.- * @return if given event was processed.- */- public boolean handleMotionEvent(MotionEvent event) {- return false;- }-- /**- * Handles adding and removing of input devices.- */- public void pollInputDevices() {- }-}--/* Actual joystick functionality available for API >= 12 devices */-class SDLJoystickHandler_API16 extends SDLJoystickHandler {-- static class SDLJoystick {- public int device_id;- public String name;- public String desc;- public ArrayList<InputDevice.MotionRange> axes;- public ArrayList<InputDevice.MotionRange> hats;- }- static class RangeComparator implements Comparator<InputDevice.MotionRange> {- @Override- public int compare(InputDevice.MotionRange arg0, InputDevice.MotionRange arg1) {- // Some controllers, like the Moga Pro 2, return AXIS_GAS (22) for right trigger and AXIS_BRAKE (23) for left trigger - swap them so they're sorted in the right order for SDL- int arg0Axis = arg0.getAxis();- int arg1Axis = arg1.getAxis();- if (arg0Axis == MotionEvent.AXIS_GAS) {- arg0Axis = MotionEvent.AXIS_BRAKE;- } else if (arg0Axis == MotionEvent.AXIS_BRAKE) {- arg0Axis = MotionEvent.AXIS_GAS;- }- if (arg1Axis == MotionEvent.AXIS_GAS) {- arg1Axis = MotionEvent.AXIS_BRAKE;- } else if (arg1Axis == MotionEvent.AXIS_BRAKE) {- arg1Axis = MotionEvent.AXIS_GAS;- }-- return arg0Axis - arg1Axis;- }- }-- private final ArrayList<SDLJoystick> mJoysticks;-- public SDLJoystickHandler_API16() {-- mJoysticks = new ArrayList<SDLJoystick>();- }-- @Override- public void pollInputDevices() {- int[] deviceIds = InputDevice.getDeviceIds();-- for (int device_id : deviceIds) {- if (SDLControllerManager.isDeviceSDLJoystick(device_id)) {- SDLJoystick joystick = getJoystick(device_id);- if (joystick == null) {- InputDevice joystickDevice = InputDevice.getDevice(device_id);- joystick = new SDLJoystick();- joystick.device_id = device_id;- joystick.name = joystickDevice.getName();- joystick.desc = getJoystickDescriptor(joystickDevice);- joystick.axes = new ArrayList<InputDevice.MotionRange>();- joystick.hats = new ArrayList<InputDevice.MotionRange>();-- List<InputDevice.MotionRange> ranges = joystickDevice.getMotionRanges();- Collections.sort(ranges, new RangeComparator());- for (InputDevice.MotionRange range : ranges) {- if ((range.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {- if (range.getAxis() == MotionEvent.AXIS_HAT_X || range.getAxis() == MotionEvent.AXIS_HAT_Y) {- joystick.hats.add(range);- } else {- joystick.axes.add(range);- }- }- }-- mJoysticks.add(joystick);- SDLControllerManager.nativeAddJoystick(joystick.device_id, joystick.name, joystick.desc,- getVendorId(joystickDevice), getProductId(joystickDevice), false,- getButtonMask(joystickDevice), joystick.axes.size(), joystick.hats.size()/2, 0);- }- }- }-- /* Check removed devices */- ArrayList<Integer> removedDevices = null;- for (SDLJoystick joystick : mJoysticks) {- int device_id = joystick.device_id;- int i;- for (i = 0; i < deviceIds.length; i++) {- if (device_id == deviceIds[i]) break;- }- if (i == deviceIds.length) {- if (removedDevices == null) {- removedDevices = new ArrayList<Integer>();- }- removedDevices.add(device_id);- }- }-- if (removedDevices != null) {- for (int device_id : removedDevices) {- SDLControllerManager.nativeRemoveJoystick(device_id);- for (int i = 0; i < mJoysticks.size(); i++) {- if (mJoysticks.get(i).device_id == device_id) {- mJoysticks.remove(i);- break;- }- }- }- }- }-- protected SDLJoystick getJoystick(int device_id) {- for (SDLJoystick joystick : mJoysticks) {- if (joystick.device_id == device_id) {- return joystick;- }- }- return null;- }-- @Override- public boolean handleMotionEvent(MotionEvent event) {- int actionPointerIndex = event.getActionIndex();- int action = event.getActionMasked();- if (action == MotionEvent.ACTION_MOVE) {- SDLJoystick joystick = getJoystick(event.getDeviceId());- if (joystick != null) {- for (int i = 0; i < joystick.axes.size(); i++) {- InputDevice.MotionRange range = joystick.axes.get(i);- /* Normalize the value to -1...1 */- float value = (event.getAxisValue(range.getAxis(), actionPointerIndex) - range.getMin()) / range.getRange() * 2.0f - 1.0f;- SDLControllerManager.onNativeJoy(joystick.device_id, i, value);- }- for (int i = 0; i < joystick.hats.size() / 2; i++) {- int hatX = Math.round(event.getAxisValue(joystick.hats.get(2 * i).getAxis(), actionPointerIndex));- int hatY = Math.round(event.getAxisValue(joystick.hats.get(2 * i + 1).getAxis(), actionPointerIndex));- SDLControllerManager.onNativeHat(joystick.device_id, i, hatX, hatY);- }- }- }- return true;- }-- public String getJoystickDescriptor(InputDevice joystickDevice) {- String desc = joystickDevice.getDescriptor();-- if (desc != null && !desc.isEmpty()) {- return desc;- }-- return joystickDevice.getName();- }- public int getProductId(InputDevice joystickDevice) {- return 0;- }- public int getVendorId(InputDevice joystickDevice) {- return 0;- }- public int getButtonMask(InputDevice joystickDevice) {- return -1;- }-}--class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {-- @Override- public int getProductId(InputDevice joystickDevice) {- return joystickDevice.getProductId();- }-- @Override- public int getVendorId(InputDevice joystickDevice) {- return joystickDevice.getVendorId();- }-- @Override- public int getButtonMask(InputDevice joystickDevice) {- int button_mask = 0;- int[] keys = new int[] {- KeyEvent.KEYCODE_BUTTON_A,- KeyEvent.KEYCODE_BUTTON_B,- KeyEvent.KEYCODE_BUTTON_X,- KeyEvent.KEYCODE_BUTTON_Y,- KeyEvent.KEYCODE_BACK,- KeyEvent.KEYCODE_MENU,- KeyEvent.KEYCODE_BUTTON_MODE,- KeyEvent.KEYCODE_BUTTON_START,- KeyEvent.KEYCODE_BUTTON_THUMBL,- KeyEvent.KEYCODE_BUTTON_THUMBR,- KeyEvent.KEYCODE_BUTTON_L1,- KeyEvent.KEYCODE_BUTTON_R1,- KeyEvent.KEYCODE_DPAD_UP,- KeyEvent.KEYCODE_DPAD_DOWN,- KeyEvent.KEYCODE_DPAD_LEFT,- KeyEvent.KEYCODE_DPAD_RIGHT,- KeyEvent.KEYCODE_BUTTON_SELECT,- KeyEvent.KEYCODE_DPAD_CENTER,-- // These don't map into any SDL controller buttons directly- KeyEvent.KEYCODE_BUTTON_L2,- KeyEvent.KEYCODE_BUTTON_R2,- KeyEvent.KEYCODE_BUTTON_C,- KeyEvent.KEYCODE_BUTTON_Z,- KeyEvent.KEYCODE_BUTTON_1,- KeyEvent.KEYCODE_BUTTON_2,- KeyEvent.KEYCODE_BUTTON_3,- KeyEvent.KEYCODE_BUTTON_4,- KeyEvent.KEYCODE_BUTTON_5,- KeyEvent.KEYCODE_BUTTON_6,- KeyEvent.KEYCODE_BUTTON_7,- KeyEvent.KEYCODE_BUTTON_8,- KeyEvent.KEYCODE_BUTTON_9,- KeyEvent.KEYCODE_BUTTON_10,- KeyEvent.KEYCODE_BUTTON_11,- KeyEvent.KEYCODE_BUTTON_12,- KeyEvent.KEYCODE_BUTTON_13,- KeyEvent.KEYCODE_BUTTON_14,- KeyEvent.KEYCODE_BUTTON_15,- KeyEvent.KEYCODE_BUTTON_16,- };- int[] masks = new int[] {- (1 << 0), // A -> A- (1 << 1), // B -> B- (1 << 2), // X -> X- (1 << 3), // Y -> Y- (1 << 4), // BACK -> BACK- (1 << 6), // MENU -> START- (1 << 5), // MODE -> GUIDE- (1 << 6), // START -> START- (1 << 7), // THUMBL -> LEFTSTICK- (1 << 8), // THUMBR -> RIGHTSTICK- (1 << 9), // L1 -> LEFTSHOULDER- (1 << 10), // R1 -> RIGHTSHOULDER- (1 << 11), // DPAD_UP -> DPAD_UP- (1 << 12), // DPAD_DOWN -> DPAD_DOWN- (1 << 13), // DPAD_LEFT -> DPAD_LEFT- (1 << 14), // DPAD_RIGHT -> DPAD_RIGHT- (1 << 4), // SELECT -> BACK- (1 << 0), // DPAD_CENTER -> A- (1 << 15), // L2 -> ??- (1 << 16), // R2 -> ??- (1 << 17), // C -> ??- (1 << 18), // Z -> ??- (1 << 20), // 1 -> ??- (1 << 21), // 2 -> ??- (1 << 22), // 3 -> ??- (1 << 23), // 4 -> ??- (1 << 24), // 5 -> ??- (1 << 25), // 6 -> ??- (1 << 26), // 7 -> ??- (1 << 27), // 8 -> ??- (1 << 28), // 9 -> ??- (1 << 29), // 10 -> ??- (1 << 30), // 11 -> ??- (1 << 31), // 12 -> ??- // We're out of room...- 0xFFFFFFFF, // 13 -> ??- 0xFFFFFFFF, // 14 -> ??- 0xFFFFFFFF, // 15 -> ??- 0xFFFFFFFF, // 16 -> ??- };- boolean[] has_keys = joystickDevice.hasKeys(keys);- for (int i = 0; i < keys.length; ++i) {- if (has_keys[i]) {- button_mask |= masks[i];- }- }- return button_mask;- }-}--class SDLHapticHandler_API26 extends SDLHapticHandler {- @Override- public void run(int device_id, float intensity, int length) {- SDLHaptic haptic = getHaptic(device_id);- if (haptic != null) {- Log.d("SDL", "Rtest: Vibe with intensity " + intensity + " for " + length);- if (intensity == 0.0f) {- stop(device_id);- return;- }-- int vibeValue = Math.round(intensity * 255);-- if (vibeValue > 255) {- vibeValue = 255;- }- if (vibeValue < 1) {- stop(device_id);- return;- }- try {- haptic.vib.vibrate(VibrationEffect.createOneShot(length, vibeValue));- }- catch (Exception e) {- // Fall back to the generic method, which uses DEFAULT_AMPLITUDE, but works even if- // something went horribly wrong with the Android 8.0 APIs.- haptic.vib.vibrate(length);- }- }- }-}--class SDLHapticHandler {-- static class SDLHaptic {- public int device_id;- public String name;- public Vibrator vib;- }-- private final ArrayList<SDLHaptic> mHaptics;-- public SDLHapticHandler() {- mHaptics = new ArrayList<SDLHaptic>();- }-- public void run(int device_id, float intensity, int length) {- SDLHaptic haptic = getHaptic(device_id);- if (haptic != null) {- haptic.vib.vibrate(length);- }- }-- public void stop(int device_id) {- SDLHaptic haptic = getHaptic(device_id);- if (haptic != null) {- haptic.vib.cancel();- }- }-- public void pollHapticDevices() {-- final int deviceId_VIBRATOR_SERVICE = 999999;- boolean hasVibratorService = false;-- int[] deviceIds = InputDevice.getDeviceIds();- // It helps processing the device ids in reverse order- // For example, in the case of the XBox 360 wireless dongle,- // so the first controller seen by SDL matches what the receiver- // considers to be the first controller-- for (int i = deviceIds.length - 1; i > -1; i--) {- SDLHaptic haptic = getHaptic(deviceIds[i]);- if (haptic == null) {- InputDevice device = InputDevice.getDevice(deviceIds[i]);- Vibrator vib = device.getVibrator();- if (vib.hasVibrator()) {- haptic = new SDLHaptic();- haptic.device_id = deviceIds[i];- haptic.name = device.getName();- haptic.vib = vib;- mHaptics.add(haptic);- SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);- }- }- }-- /* Check VIBRATOR_SERVICE */- Vibrator vib = (Vibrator) SDL.getContext().getSystemService(Context.VIBRATOR_SERVICE);- if (vib != null) {- hasVibratorService = vib.hasVibrator();-- if (hasVibratorService) {- SDLHaptic haptic = getHaptic(deviceId_VIBRATOR_SERVICE);- if (haptic == null) {- haptic = new SDLHaptic();- haptic.device_id = deviceId_VIBRATOR_SERVICE;- haptic.name = "VIBRATOR_SERVICE";- haptic.vib = vib;- mHaptics.add(haptic);- SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);- }- }- }-- /* Check removed devices */- ArrayList<Integer> removedDevices = null;- for (SDLHaptic haptic : mHaptics) {- int device_id = haptic.device_id;- int i;- for (i = 0; i < deviceIds.length; i++) {- if (device_id == deviceIds[i]) break;- }-- if (device_id != deviceId_VIBRATOR_SERVICE || !hasVibratorService) {- if (i == deviceIds.length) {- if (removedDevices == null) {- removedDevices = new ArrayList<Integer>();- }- removedDevices.add(device_id);- }- } // else: don't remove the vibrator if it is still present- }-- if (removedDevices != null) {- for (int device_id : removedDevices) {- SDLControllerManager.nativeRemoveHaptic(device_id);- for (int i = 0; i < mHaptics.size(); i++) {- if (mHaptics.get(i).device_id == device_id) {- mHaptics.remove(i);- break;- }- }- }- }- }-- protected SDLHaptic getHaptic(int device_id) {- for (SDLHaptic haptic : mHaptics) {- if (haptic.device_id == device_id) {- return haptic;- }- }- return null;- }-}--class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener {- // Generic Motion (mouse hover, joystick...) events go here- @Override- public boolean onGenericMotion(View v, MotionEvent event) {- float x, y;- int action;-- switch ( event.getSource() ) {- case InputDevice.SOURCE_JOYSTICK:- return SDLControllerManager.handleJoystickMotionEvent(event);-- case InputDevice.SOURCE_MOUSE:- action = event.getActionMasked();- switch (action) {- case MotionEvent.ACTION_SCROLL:- x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);- y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);- SDLActivity.onNativeMouse(0, action, x, y, false);- return true;-- case MotionEvent.ACTION_HOVER_MOVE:- x = event.getX(0);- y = event.getY(0);-- SDLActivity.onNativeMouse(0, action, x, y, false);- return true;-- default:- break;- }- break;-- default:- break;- }-- // Event was not managed- return false;- }-- public boolean supportsRelativeMouse() {- return false;- }-- public boolean inRelativeMode() {- return false;- }-- public boolean setRelativeMouseEnabled(boolean enabled) {- return false;- }-- public void reclaimRelativeMouseModeIfNeeded()- {-- }-- public float getEventX(MotionEvent event) {- return event.getX(0);- }-- public float getEventY(MotionEvent event) {- return event.getY(0);- }--}--class SDLGenericMotionListener_API24 extends SDLGenericMotionListener_API12 {- // Generic Motion (mouse hover, joystick...) events go here-- private boolean mRelativeModeEnabled;-- @Override- public boolean onGenericMotion(View v, MotionEvent event) {-- // Handle relative mouse mode- if (mRelativeModeEnabled) {- if (event.getSource() == InputDevice.SOURCE_MOUSE) {- int action = event.getActionMasked();- if (action == MotionEvent.ACTION_HOVER_MOVE) {- float x = event.getAxisValue(MotionEvent.AXIS_RELATIVE_X);- float y = event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y);- SDLActivity.onNativeMouse(0, action, x, y, true);- return true;- }- }- }-- // Event was not managed, call SDLGenericMotionListener_API12 method- return super.onGenericMotion(v, event);- }-- @Override- public boolean supportsRelativeMouse() {- return true;- }-- @Override- public boolean inRelativeMode() {- return mRelativeModeEnabled;- }-- @Override- public boolean setRelativeMouseEnabled(boolean enabled) {- mRelativeModeEnabled = enabled;- return true;- }-- @Override- public float getEventX(MotionEvent event) {- if (mRelativeModeEnabled) {- return event.getAxisValue(MotionEvent.AXIS_RELATIVE_X);- } else {- return event.getX(0);- }- }-- @Override- public float getEventY(MotionEvent event) {- if (mRelativeModeEnabled) {- return event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y);- } else {- return event.getY(0);- }- }-}--class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {- // Generic Motion (mouse hover, joystick...) events go here- private boolean mRelativeModeEnabled;-- @Override- public boolean onGenericMotion(View v, MotionEvent event) {- float x, y;- int action;-- switch ( event.getSource() ) {- case InputDevice.SOURCE_JOYSTICK:- return SDLControllerManager.handleJoystickMotionEvent(event);-- case InputDevice.SOURCE_MOUSE:- // DeX desktop mouse cursor is a separate non-standard input type.- case InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHSCREEN:- action = event.getActionMasked();- switch (action) {- case MotionEvent.ACTION_SCROLL:- x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);- y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);- SDLActivity.onNativeMouse(0, action, x, y, false);- return true;-- case MotionEvent.ACTION_HOVER_MOVE:- x = event.getX(0);- y = event.getY(0);- if (SDLActivity.isChromebook()) {- x = SDLActivity.scaleAbsoluteMouseX(x);- y = SDLActivity.scaleAbsoluteMouseY(y);- }- SDLActivity.onNativeMouse(0, action, x, y, false);- return true;-- default:- break;- }- break;-- case InputDevice.SOURCE_MOUSE_RELATIVE:- action = event.getActionMasked();- switch (action) {- case MotionEvent.ACTION_SCROLL:- x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);- y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);- SDLActivity.onNativeMouse(0, action, x, y, false);- return true;-- case MotionEvent.ACTION_HOVER_MOVE:- x = event.getX(0);- y = event.getY(0);- SDLActivity.onNativeMouse(0, action, x, y, true);- return true;-- default:- break;- }- break;-- default:- break;- }-- // Event was not managed- return false;- }-- @Override- public boolean supportsRelativeMouse() {- return (!SDLActivity.isDeXMode() || (Build.VERSION.SDK_INT >= 27));- }-- @Override- public boolean inRelativeMode() {- return mRelativeModeEnabled;- }-- private View getRelativeMouseCaptureView() {- // OPENMW_CHROMEOS_NATIVE_MOUSE_V1- // On ChromeOS capture the focused SDLSurface itself so its existing- // onCapturedPointerEvent() receives the raw relative stream directly.- if (SDLActivity.isChromebook() && SDLActivity.getSurface() != null) {- return SDLActivity.getSurface();- }- return SDLActivity.getContentView();- }-- @Override- public boolean setRelativeMouseEnabled(boolean enabled) {- if (!SDLActivity.isDeXMode() || (Build.VERSION.SDK_INT >= 27)) {- View captureView = getRelativeMouseCaptureView();- if (captureView == null) {- return false;- }-- if (enabled) {- captureView.requestFocus();- captureView.requestPointerCapture();- } else {- captureView.releasePointerCapture();- }-- mRelativeModeEnabled = enabled;- if (SDLActivity.isChromebook()) {- Log.i("SDLControllerManager", "ChromeOS native mouse v1: relative=" + enabled- + ", captureView=" + captureView.getClass().getSimpleName());- }- return true;- } else {- return false;- }- }-- @Override- public void reclaimRelativeMouseModeIfNeeded()- {- if (mRelativeModeEnabled && !SDLActivity.isDeXMode()) {- View captureView = getRelativeMouseCaptureView();- if (captureView != null) {- captureView.requestFocus();- captureView.requestPointerCapture();- }- }- }-- @Override- public float getEventX(MotionEvent event) {- // Relative mouse in capture mode will only have relative for X/Y- return event.getX(0);- }-- @Override- public float getEventY(MotionEvent event) {- // Relative mouse in capture mode will only have relative for X/Y- return event.getY(0);- }-}diff --git a/android/app/src/main/java/parser/CommandlineParser.kt b/android/app/src/main/java/parser/CommandlineParser.ktdeleted file mode 100644index eb371a5..0000000--- a/android/app/src/main/java/parser/CommandlineParser.kt+++ /dev/null@@ -1,112 +0,0 @@-/*- Copyright (C) 2016 sandstranger- Copyright (C) 2018 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package parser--import java.util.ArrayList--/** Parses the launcher command line while preserving quoted arguments. */-class CommandlineParser(data: String) {- private val args = ArrayList<String>()- val argv: Array<String>-- val argc: Int- get() = args.size-- init {- args.add("openmw")-- if (data.contains("--")) {- args.addAll(tokenize(data))- }-- argv = args.toTypedArray()- }-- private fun tokenize(input: String): List<String> {- val result = mutableListOf<String>()- val current = StringBuilder()- var quote: Char? = null- var tokenStarted = false- var index = 0-- fun flush() {- if (tokenStarted) {- result += current.toString()- current.setLength(0)- tokenStarted = false- }- }-- while (index < input.length) {- val char = input[index]-- if (quote != null) {- when {- char == quote -> {- quote = null- tokenStarted = true- index += 1- }- char == '\\' && index + 1 < input.length &&- (input[index + 1] == quote || input[index + 1] == '\\') -> {- current.append(input[index + 1])- tokenStarted = true- index += 2- }- else -> {- current.append(char)- tokenStarted = true- index += 1- }- }- continue- }-- when {- char.isWhitespace() -> {- flush()- index += 1- }- char == '"' || char == '\'' -> {- quote = char- tokenStarted = true- index += 1- }- char == '\\' && index + 1 < input.length &&- (input[index + 1].isWhitespace() || input[index + 1] == '"' ||- input[index + 1] == '\'' || input[index + 1] == '\\') -> {- current.append(input[index + 1])- tokenStarted = true- index += 2- }- else -> {- current.append(char)- tokenStarted = true- index += 1- }- }- }-- // An unmatched quote is treated as extending to the end of input.- flush()- return result- }-}diff --git a/android/app/src/main/java/permission/PermissionHelper.kt b/android/app/src/main/java/permission/PermissionHelper.ktdeleted file mode 100644index ecdbcff..0000000--- a/android/app/src/main/java/permission/PermissionHelper.kt+++ /dev/null@@ -1,74 +0,0 @@-/*- Copyright (C) 2016 sandstranger-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package permission--import android.Manifest-import android.app.Activity-import android.content.pm.PackageManager-import android.os.Build-import androidx.core.app.ActivityCompat-import androidx.core.content.ContextCompat-import com.libopenmw.openmw.BuildConfig--object PermissionHelper {- const val STORAGE_PERMISSION_REQUEST = 23-- /**- * The Mobile flavor keeps the port's existing targetSdk 29 legacy-storage- * behavior. The Automotive flavor targets API 35, where WRITE_EXTERNAL_STORAGE- * can no longer grant broad filesystem access. Android/media/com.ast.openmw is- * still directly usable by this app, so the chooser must not be blocked by an- * obsolete permission check on AAOS.- */- fun canOpenLegacyStorageChooser(activity: Activity): Boolean {- if (BuildConfig.IS_AUTOMOTIVE_BUILD && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)- return true-- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)- return true-- return ContextCompat.checkSelfPermission(- activity,- Manifest.permission.WRITE_EXTERNAL_STORAGE- ) == PackageManager.PERMISSION_GRANTED- }-- fun getWriteExternalStoragePermission(activity: Activity) {- if (BuildConfig.IS_AUTOMOTIVE_BUILD && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)- return-- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)- return-- if (ContextCompat.checkSelfPermission(- activity,- Manifest.permission.WRITE_EXTERNAL_STORAGE- ) == PackageManager.PERMISSION_GRANTED- ) {- return- }-- ActivityCompat.requestPermissions(- activity,- arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE),- STORAGE_PERMISSION_REQUEST- )- }-}diff --git a/android/app/src/main/java/ui/activity/ConfigureControls.kt b/android/app/src/main/java/ui/activity/ConfigureControls.ktdeleted file mode 100644index 728c101..0000000--- a/android/app/src/main/java/ui/activity/ConfigureControls.kt+++ /dev/null@@ -1,134 +0,0 @@-/*- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.activity--import com.libopenmw.openmw.R--import android.app.Activity-import android.graphics.Color-import android.os.Bundle-import android.view.MotionEvent-import android.view.View-import android.widget.RelativeLayout--import ui.controls.Osc-import ui.controls.OscElement-import ui.controls.VIRTUAL_SCREEN_HEIGHT-import ui.controls.VIRTUAL_SCREEN_WIDTH-import utils.Utils.hideAndroidControls--class ConfigureCallback(activity: Activity) : View.OnTouchListener {-- var currentView: View? = null- private var layout: RelativeLayout = activity.findViewById(R.id.controlsContainer)- private var origX: Float = 0.0f- private var origY: Float = 0.0f- private var startX: Float = 0.0f- private var startY: Float = 0.0f-- override fun onTouch(v: View, event: MotionEvent): Boolean {- when (event.actionMasked) {- MotionEvent.ACTION_DOWN -> {- currentView?.setBackgroundColor(Color.TRANSPARENT)- currentView = v- v.setBackgroundColor(Color.RED)- origX = v.x- origY = v.y- startX = event.rawX- startY = event.rawY- }- MotionEvent.ACTION_MOVE -> if (currentView != null) {- val view = currentView!!- val x = ((event.rawX - startX) + origX).toInt()- val y = ((event.rawY - startY) + origY).toInt()-- val el = view.tag as OscElement- el.changePosition(x * VIRTUAL_SCREEN_WIDTH / layout.width, y * VIRTUAL_SCREEN_HEIGHT / layout.height)- el.updateView()- }- }-- return true- }--}--class ConfigureControls : Activity() {-- private var callback: ConfigureCallback? = null- private var osc = Osc()-- public override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)-- setContentView(R.layout.configure_controls)-- val cb = ConfigureCallback(this)- callback = cb-- val container: RelativeLayout = findViewById(R.id.controlsContainer)- osc.placeConfigurableElements(container, cb)- }-- override fun onWindowFocusChanged(hasFocus: Boolean) {- if (hasFocus) {- hideAndroidControls(this)- }- }-- private fun changeOpacity(delta: Float) {- val view = callback?.currentView ?: return- val el = view.tag as OscElement- el.changeOpacity(delta)- el.updateView()- }-- private fun changeSize(delta: Int) {- val view = callback?.currentView ?: return- val el = view.tag as OscElement- el.changeSize(delta)- el.updateView()- }-- fun clickOpacityPlus(v: View) {- changeOpacity(0.1f)- }-- fun clickOpacityMinus(v: View) {- changeOpacity(-0.1f)- }-- fun clickSizePlus(v: View) {- changeSize(5)- }-- fun clickSizeMinus(v: View) {- changeSize(-5)- }-- fun clickResetControls(v: View) {- osc.resetElements(applicationContext)- }-- fun clickBack(v: View) {- finish()- }--}diff --git a/android/app/src/main/java/ui/activity/GameActivity.kt b/android/app/src/main/java/ui/activity/GameActivity.ktdeleted file mode 100644index 8d42f5d..0000000--- a/android/app/src/main/java/ui/activity/GameActivity.kt+++ /dev/null@@ -1,592 +0,0 @@-/*- Copyright (C) 2015-2017 sandstranger- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.activity--import android.content.SharedPreferences-import android.content.pm.PackageManager-import android.os.Build-import android.os.Bundle-import android.os.Process-import android.preference.PreferenceManager-import android.system.ErrnoException-import android.system.Os-import android.util.Log-import android.view.WindowManager-import android.widget.RelativeLayout-import com.libopenmw.openmw.BuildConfig-import com.libopenmw.openmw.R--import org.libsdl.app.SDLActivity--import constants.Constants-import cursor.MouseCursor-import parser.CommandlineParser-import ui.controls.Osc--import utils.Utils.hideAndroidControls--import android.util.DisplayMetrics-import android.os.AsyncTask-import android.widget.ImageView-import android.widget.TextView-import android.graphics.Typeface-import android.graphics.Rect-import java.io.File-import java.io.IOException-import java.io.RandomAccessFile--/**- * Enum for different mouse modes as specified in settings- */-enum class MouseMode {- Hybrid,- Joystick,- Touch;-- companion object {- fun get(s: String): MouseMode {- return when (s) {- "joystick" -> Joystick- "touch" -> Touch- else -> Hybrid- }- }- }-}--class GameActivity : SDLActivity() {-- private var prefs: SharedPreferences? = null-- @Volatile- private var nativeLogBridgeRunning = false-- // OPENMW_CHROMEOS_NATIVE_MOUSE_V1- // ChromeOS uses SDL's own relative-mouse / pointer-capture path. Do not install- // a second captured-pointer bridge or force the host cursor permanently hidden.-- // OPENMW_CHROMEOS_EXIT_NO_WHITE_V1- private val chromeOsExitHandler = android.os.Handler(android.os.Looper.getMainLooper())- private var chromeOsExitScheduled = false-- val layout: RelativeLayout- get() = SDLActivity.mLayout as RelativeLayout-- override fun loadLibraries() {- prefs = PreferenceManager.getDefaultSharedPreferences(this)- val physicsFPS = prefs!!.getString("pref_physicsFPS2", "")- if (!physicsFPS!!.isEmpty()) {- try {- Os.setenv("OPENMW_PHYSICS_FPS", physicsFPS, true)- Os.setenv("OSG_TEXT_SHADER_TECHNIQUE", "ALL", true)- } catch (e: ErrnoException) {- Log.e("OpenMW", "Failed setting environment variables.")- e.printStackTrace()- }- }-- System.loadLibrary("c++_shared")- System.loadLibrary("openal")- System.loadLibrary("SDL2")-- // OPENMW_ANDROID_051_LAUNCHER_AUDIT_V1- // OpenMW 0.51 final and this port's GL4ES/OMWFX compatibility shaders- // use the GLES2 backend. The old GLES1 launcher selector is a CaveBros- // legacy path and is no longer exposed.- try {- Os.setenv("OPENMW_GLES_VERSION", "2", true)- Os.setenv("LIBGL_ES", "2", true)- } catch (e: ErrnoException) {- Log.e("OpenMW", "Failed setting GLES2 environment variables.")- e.printStackTrace()- }-- val textureShrinkingOption = prefs!!.getString("pref_textureShrinking_v2", "")- if (textureShrinkingOption == "low") Os.setenv("LIBGL_SHRINK", "2", true)- if (textureShrinkingOption == "medium") Os.setenv("LIBGL_SHRINK", "7", true)- if (textureShrinkingOption == "high") Os.setenv("LIBGL_SHRINK", "6", true)-- val shaderDirOption = prefs!!.getString("pref_shadersDir_v2", "")- if (shaderDirOption == "modified") Os.setenv("OPENMW_SHADERS", "modified", true)- if (shaderDirOption == "zesterer") Os.setenv("OPENMW_SHADERS", "zesterer", true)-- if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("pref_nohighp", false) && shaderDirOption == "modified") {- Os.setenv("LIBGL_NOHIGHP", "1", true)- }-- Os.setenv("OSG_VERTEX_BUFFER_HINT", "VBO", true)- Os.setenv("OPENMW_USER_FILE_STORAGE", Constants.USER_FILE_STORAGE + "/", true)- //Os.setenv("OSG_NOTIFY_LEVEL", "FATAL", true) //hide osg errors for now, gl4es bug.-- val envline: String = PreferenceManager.getDefaultSharedPreferences(this).getString("envLine", "").toString()- if (envline.length > 0) {- val envs: List<String> = envline.split(" ", "\n")- var i = 0-- repeat(envs.count())- {- val env: List<String> = envs[i].split("=", limit = 2)- if (env.count() == 2) Os.setenv(env[0], env[1], true)- i = i + 1- }- }-- System.loadLibrary("GL")- System.loadLibrary("openmw")- }-- override fun getMainSharedObject(): String {- return "libopenmw.so"- }--- private fun showProgressBar() {- val dm = DisplayMetrics()- windowManager.defaultDisplay.getRealMetrics(dm)-- val progressBarBackground = ImageView(layout.context)- progressBarBackground.setImageResource(R.drawable.progressbarbackground)- progressBarBackground.setScaleType(ImageView.ScaleType.FIT_XY)- progressBarBackground.setX(((dm.widthPixels / 2) - 405).toFloat())- progressBarBackground.setY(((dm.heightPixels / 2) - 105).toFloat())- layout.addView(progressBarBackground)- progressBarBackground.getLayoutParams().width = 810- progressBarBackground.getLayoutParams().height = 60--- val progressBar = ImageView(layout.context)- progressBar.setImageResource(R.drawable.progressbar)- progressBar.setScaleType(ImageView.ScaleType.FIT_XY)- progressBar.setX(((dm.widthPixels / 2) - 400).toFloat())- progressBar.setY(((dm.heightPixels / 2) - 100).toFloat())- layout.addView(progressBar)- progressBar.getLayoutParams().width = 0- progressBar.getLayoutParams().height = 50-- val message = getString(R.string.navmesh_generating_cache)- val text = TextView(this)- text.text = message- val bounds = Rect()- text.paint.getTextBounds(message, 0, message.length, bounds)- text.setX(((dm.widthPixels / 2) - (bounds.width() / 2)) .toFloat())- text.setY(((dm.heightPixels / 2) - 200).toFloat())- text.setTypeface(null, Typeface.BOLD)- layout.addView(text)-- val percentageText = TextView(this)- percentageText.setX((dm.widthPixels / 2).toFloat())- percentageText.setY(((dm.heightPixels / 2) + 50).toFloat())- layout.addView(percentageText)-- Os.setenv("NAVMESHTOOL_MESSAGE", "0.0", true)- ProgressBarUpdater(percentageText, progressBar, dm.widthPixels, dm.heightPixels).execute()- }-- class ProgressBarUpdater(val percentageText: TextView, val progressBar: ImageView, val screenWidth: Int, val screenHeight: Int) : AsyncTask<Void, String, String>() {- override fun doInBackground(vararg params: Void?): String {-- while(Os.getenv("NAVMESHTOOL_MESSAGE") != "Done") {- publishProgress(Os.getenv("NAVMESHTOOL_MESSAGE"))- Thread.sleep(50)- }-- return "DONE"- }-/*- override fun onPreExecute() {- super.onPreExecute()- }-- override fun onPostExecute() {- super.onPostExecute()- }-*/- override fun onProgressUpdate(vararg progress: String?) {- super.onProgressUpdate()-- val progressText = progress.firstOrNull() ?: return- val progressValue = progressText.toFloatOrNull() ?: return-- progressBar.requestLayout()- progressBar.layoutParams.width = (8.0f * progressValue).toInt().coerceIn(0, 800)-- val bounds = Rect()- percentageText.paint.getTextBounds(progressText, 0, progressText.length, bounds)-- percentageText.x = ((screenWidth / 2) - (bounds.width() / 2)).toFloat()- percentageText.text = progressText- }-- }-- public override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)-- val displayInCutoutArea = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("pref_display_cutout_area", false)- if (displayInCutoutArea) {- window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES- }-- KeepScreenOn()- getPathToJni(filesDir.parent, Constants.USER_FILE_STORAGE)-- prepareNativeDiagnostics()-- if(Os.getenv("OPENMW_GENERATE_NAVMESH_CACHE") == "1")- showProgressBar()- else- showControls()- }-- private fun prepareNativeDiagnostics() {- val userConfigDir = File(Constants.USER_CONFIG)- if (!userConfigDir.exists() && !userConfigDir.mkdirs()) {- Log.w(DIAG_TAG, "Could not create user config directory: ${userConfigDir.absolutePath}")- }-- // On debug builds rotate stale files before SDL_main starts, so every Logcat- // capture contains the diagnostics from exactly this launch.- if (BuildConfig.DEBUG) {- rotateLogForDiagnostics(File(userConfigDir, "openmw.log"))- rotateLogForDiagnostics(File(userConfigDir, "crash.log"))- }-- logLaunchDiagnostics()- startNativeLogBridge()- }-- private fun rotateLogForDiagnostics(logFile: File) {- if (!logFile.isFile) {- return- }-- val previous = File(logFile.parentFile, "${logFile.name}.previous")- if (previous.exists() && !previous.delete()) {- Log.w(DIAG_TAG, "Could not delete old ${previous.absolutePath}")- }-- if (!logFile.renameTo(previous)) {- Log.w(DIAG_TAG, "Could not rotate ${logFile.absolutePath}; truncating it instead.")- try {- logFile.writeText("")- } catch (e: IOException) {- Log.e(DIAG_TAG, "Could not reset ${logFile.absolutePath}", e)- }- }- }-- private fun logLaunchDiagnostics() {- val graphicsLibrary = prefs?.getString("pref_graphicsLibrary_v2", "") ?: ""- val shaderDirectory = prefs?.getString("pref_shadersDir_v2", "") ?: ""- val commandLine = prefs?.getString("commandLine", "") ?: ""-- Log.i(DIAG_TAG, "package=$packageName debug=${BuildConfig.DEBUG}")- Log.i(DIAG_TAG, "device=${Build.MANUFACTURER} ${Build.MODEL}; sdk=${Build.VERSION.SDK_INT}; abis=${Build.SUPPORTED_ABIS.joinToString()}")- Log.i(DIAG_TAG, "customResolution=${MainActivity.resolutionX}x${MainActivity.resolutionY}; surfaceView=${SDLActivity.getSurface()?.width}x${SDLActivity.getSurface()?.height}")- Log.i(DIAG_TAG, "chromebook=${SDLActivity.isChromebook()}; relativeMouseSupported=${SDLActivity.supportsRelativeMouse()}")- Log.i(DIAG_TAG, "mousePath=${if (SDLActivity.isChromebook()) "SDL native capture + system cursor" else "legacy Android cursor"}")- Log.i(DIAG_TAG, "graphicsLibrary=${if (graphicsLibrary.isBlank()) "<default/GLES2>" else graphicsLibrary}; shaderDirectory=${if (shaderDirectory.isBlank()) "<default>" else shaderDirectory}")- Log.i(DIAG_TAG, "OPENMW_GLES_VERSION=${Os.getenv("OPENMW_GLES_VERSION")}; LIBGL_ES=${Os.getenv("LIBGL_ES")}; OPENMW_USER_FILE_STORAGE=${Os.getenv("OPENMW_USER_FILE_STORAGE")}")- Log.i(DIAG_TAG, "USER_FILE_STORAGE=${Constants.USER_FILE_STORAGE}")- Log.i(DIAG_TAG, "USER_CONFIG=${Constants.USER_CONFIG}")- Log.i(DIAG_TAG, "GLOBAL_CONFIG=${Constants.GLOBAL_CONFIG}")- Log.i(DIAG_TAG, "RESOURCES=${Constants.RESOURCES}")- Log.i(DIAG_TAG, "runtimeResources=${selectRuntimeResourcesPath()}")- Log.i(DIAG_TAG, "commandLine=${if (commandLine.isBlank()) "<empty>" else commandLine}")- Log.i(DIAG_TAG, "SDL arguments=${getArguments().joinToString(" ")}")-- logFileState("openmw.cfg", File(Constants.OPENMW_CFG))- logFileState("defaults.bin", File(Constants.DEFAULTS_BIN))- logFileState("bundled resources", File(Constants.RESOURCES))- logFileState("bundled resources/version", File(Constants.RESOURCES, "version"))- logFileState("bundled resources/openmw.png", File(Constants.RESOURCES, "openmw.png"))- logFileState("user resources", File(Constants.USER_FILE_STORAGE + "/resources/"))- logFileState("user resources/version", File(Constants.USER_FILE_STORAGE + "/resources/version"))- logFileState("user resources/openmw.png", File(Constants.USER_FILE_STORAGE + "/resources/openmw.png"))- logOpenMwConfigSummary()- }-- private fun logFileState(label: String, file: File) {- val size = if (file.isFile) file.length() else 0L- Log.i(DIAG_TAG, "$label: path=${file.absolutePath}; exists=${file.exists()}; directory=${file.isDirectory}; size=$size")- }-- private fun logOpenMwConfigSummary() {- val config = File(Constants.OPENMW_CFG)- if (!config.isFile) {- Log.e(DIAG_TAG, "Cannot inspect openmw.cfg because it does not exist.")- return- }-- val interestingPrefixes = listOf(- "resources=",- "data=",- "content=",- "groundcover=",- "fallback-archive=",- "encoding="- )-- try {- var count = 0- config.forEachLine { line ->- val trimmed = line.trim()- if (interestingPrefixes.any { trimmed.startsWith(it) }) {- if (count < MAX_CONFIG_LOG_LINES) {- Log.i(CONFIG_TAG, trimmed)- }- count += 1- }- }-- if (count == 0) {- Log.e(CONFIG_TAG, "No data/content/resources entries found in openmw.cfg")- } else if (count > MAX_CONFIG_LOG_LINES) {- Log.i(CONFIG_TAG, "... ${count - MAX_CONFIG_LOG_LINES} additional entries omitted")- }- } catch (e: IOException) {- Log.e(CONFIG_TAG, "Failed reading openmw.cfg", e)- }- }-- private fun startNativeLogBridge() {- nativeLogBridgeRunning = true-- Thread({- val logs = listOf(- File(Constants.USER_CONFIG, "openmw.log"),- File(Constants.USER_CONFIG, "crash.log")- )- val positions = mutableMapOf<String, Long>()- val deadline = System.currentTimeMillis() + NATIVE_LOG_BRIDGE_MILLIS-- Log.i(DIAG_TAG, "Native log bridge active for ${NATIVE_LOG_BRIDGE_MILLIS / 1000}s")-- while (nativeLogBridgeRunning && System.currentTimeMillis() < deadline) {- logs.forEach { logFile ->- if (!logFile.isFile) {- return@forEach- }-- var position = positions[logFile.absolutePath] ?: 0L- if (logFile.length() < position) {- position = 0L- }-- if (logFile.length() > position) {- try {- RandomAccessFile(logFile, "r").use { reader ->- reader.seek(position)-- while (true) {- val line = reader.readLine() ?: break- if (logFile.name == "crash.log") {- Log.e(NATIVE_LOG_TAG, "${logFile.name}: $line")- } else {- Log.i(NATIVE_LOG_TAG, "${logFile.name}: $line")- }- }-- positions[logFile.absolutePath] = reader.filePointer- }- } catch (e: IOException) {- Log.e(DIAG_TAG, "Failed reading ${logFile.absolutePath}", e)- }- }- }-- try {- Thread.sleep(100)- } catch (_: InterruptedException) {- Thread.currentThread().interrupt()- break- }- }-- Log.i(DIAG_TAG, "Native log bridge stopped")- }, "OpenMW-native-log-bridge").apply {- isDaemon = true- start()- }- }-- private fun showControls() {- val prefs = PreferenceManager.getDefaultSharedPreferences(this)-- mouseMode = MouseMode.get((prefs.getString("pref_mouse_mode",- getString(R.string.pref_mouse_mode_default))!!))-- // OPENMW_ANDROID_TOUCH_CONTROLS_FIRST_START_V1- // The settings checkbox has no persisted value until the user changes it.- // Match the visible unchecked state on real touchscreen Android/AAOS devices,- // while ChromeOS keeps the overlay hidden for mouse/keyboard operation.- val hasTouchscreen = packageManager.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)- val defaultHideControls = !hasTouchscreen || SDLActivity.isChromebook()- val pref_hide_controls = prefs.getBoolean(Constants.HIDE_CONTROLS, defaultHideControls)-- var osc: Osc? = null- if (!pref_hide_controls) {- val layout = layout- osc = Osc()- osc.placeElements(layout)- }- MouseCursor(this, osc)- }-- private fun installChromeOsExitCover() {- val decor = window.decorView as? android.view.ViewGroup ?: return- val cover = android.view.View(this)- cover.setBackgroundColor(android.graphics.Color.BLACK)- cover.isClickable = true- cover.isFocusable = true- decor.addView(- cover,- android.view.ViewGroup.LayoutParams(- android.view.ViewGroup.LayoutParams.MATCH_PARENT,- android.view.ViewGroup.LayoutParams.MATCH_PARENT- )- )- cover.bringToFront()- }-- private fun finishAfterChromeOsExitDelay() {- super.finish()- }-- override fun finish() {- if (Build.VERSION.SDK_INT >= 26 &&- SDLActivity.isChromebook() &&- !chromeOsExitScheduled &&- !isFinishing) {- chromeOsExitScheduled = true-- runOnUiThread {- // OPENMW_CHROMEOS_EXIT_NO_WHITE_V1- // Cover the final GL frame, put the task behind the ChromeOS desktop- // immediately, then close the now-invisible Activity shortly afterwards.- installChromeOsExitCover()- moveTaskToBack(true)- chromeOsExitHandler.postDelayed(- { finishAfterChromeOsExitDelay() },- CHROMEOS_EXIT_FINISH_DELAY_MILLIS- )- }- return- }-- super.finish()- }-- private fun KeepScreenOn() {- val needKeepScreenOn = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("pref_screen_keeper", false)- if (needKeepScreenOn) {- window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)- }- }-- public override fun onDestroy() {- nativeLogBridgeRunning = false-- if (Build.VERSION.SDK_INT >= 26 && SDLActivity.isChromebook()) {- chromeOsExitHandler.removeCallbacksAndMessages(null)-- // Let SDLActivity release native state after the task has already been- // moved behind the desktop. Kill the shared launcher/game process only- // after the Android/SDL teardown path has completed.- super.onDestroy()- Process.killProcess(Process.myPid())- return- }-- // Preserve the existing Android behavior outside ChromeOS.- finish()- Process.killProcess(Process.myPid())- super.onDestroy()- }--- override fun onWindowFocusChanged(hasFocus: Boolean) {- // SDLActivity maintains native focus state and reclaims relative mouse- // capture here. Do not bypass the superclass implementation.- super.onWindowFocusChanged(hasFocus)-- if (hasFocus) {- hideAndroidControls(this)- }- }-- private fun resourcePayloadMatches(source: File, target: File): Boolean {- if (!source.isDirectory || !target.isDirectory) {- return false- }-- val sourceVersion = File(source, "version")- val targetVersion = File(target, "version")- val targetLogo = File(target, "openmw.png")- val targetVfs = File(target, "vfs")-- if (!sourceVersion.isFile || !targetVersion.isFile ||- !targetLogo.isFile || !targetVfs.isDirectory) {- return false- }-- return try {- sourceVersion.readText().trim() == targetVersion.readText().trim()- } catch (e: IOException) {- false- }- }-- private fun selectRuntimeResourcesPath(): String {- val bundledResources = File(Constants.RESOURCES)- val userResources = File(Constants.USER_FILE_STORAGE + "/resources/")-- return if (resourcePayloadMatches(bundledResources, userResources)) {- userResources.absolutePath- } else {- Log.w(- DIAG_TAG,- "User resource mirror is invalid; falling back to bundled resources at ${bundledResources.absolutePath}"- )- bundledResources.absolutePath- }- }-- override fun getArguments(): Array<String> {- val cmd = PreferenceManager.getDefaultSharedPreferences(this).getString("commandLine", "") ?: ""- val resourcesPath = selectRuntimeResourcesPath()- val commandlineParser = CommandlineParser("--resources $resourcesPath $cmd")- return commandlineParser.argv- }-- private external fun getPathToJni(path_global: String, path_user: String)-- companion object {- private const val DIAG_TAG = "OpenMW-Diag"- private const val CONFIG_TAG = "OpenMW-Config"- private const val NATIVE_LOG_TAG = "OpenMW-Native"- private const val MAX_CONFIG_LOG_LINES = 120- private const val NATIVE_LOG_BRIDGE_MILLIS = 120_000L- private const val CHROMEOS_EXIT_FINISH_DELAY_MILLIS = 50L-- var mouseMode = MouseMode.Hybrid- }-}diff --git a/android/app/src/main/java/ui/activity/MainActivity.kt b/android/app/src/main/java/ui/activity/MainActivity.ktdeleted file mode 100644index 34de6d5..0000000--- a/android/app/src/main/java/ui/activity/MainActivity.kt+++ /dev/null@@ -1,3045 +0,0 @@-/*- Copyright (C) 2015, 2016 sandstranger- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.activity--import android.annotation.SuppressLint-import android.app.AlarmManager-import android.app.AlertDialog-import android.app.PendingIntent-import android.app.ProgressDialog-import android.content.*-import android.net.Uri-import android.os.Bundle-import android.preference.PreferenceManager-import android.system.ErrnoException-import android.system.Os-import android.util.DisplayMetrics-import com.google.android.material.floatingactionbutton.FloatingActionButton-import androidx.appcompat.app.AppCompatActivity-import androidx.appcompat.app.AppCompatDelegate-import android.util.Log-import android.view.Menu-import android.view.MenuItem-import android.widget.Toast-import com.bugsnag.android.Bugsnag--import com.libopenmw.openmw.BuildConfig-import com.libopenmw.openmw.R-import constants.Constants-import file.GameInstaller--import java.io.BufferedReader-import java.io.File-import java.io.FileInputStream-import java.io.IOException-import java.io.InputStreamReader--import file.utils.CopyFilesFromAssets-import mods.ModType-import mods.ModsCollection-import mods.ModsDatabaseOpenHelper-import mods.ModsPaths-import ui.fragments.FragmentSettings-import permission.PermissionHelper-import utils.MyApp-import utils.Utils.hideAndroidControls-import java.util.*--import android.util.Base64--import android.content.res.Configuration--class MainActivity : AppCompatActivity() {- private lateinit var prefs: SharedPreferences-- // v14.3 Skip GUI launch + v14.4 no-flash behavior restored in v14.6.2- private val skipGuiHandler =- android.os.Handler(android.os.Looper.getMainLooper())- private var skipGuiAutoLaunchPending = false- private var skipGuiOverrideRequested = false- private var skipGuiVolumeOverrideHeld = false- private var skipGuiDirectLaunchActive = false-- private val skipGuiAutoLaunchRunnable = java.lang.Runnable {- if (!skipGuiAutoLaunchPending || skipGuiOverrideRequested || isFinishing) {- return@Runnable- }-- skipGuiAutoLaunchPending = false- skipGuiDirectLaunchActive = true- Log.i(TAG, "Skip GUI: launching game directly after Volume Up override window.")- checkStartGame()- }-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)-- // Draw an opaque loading surface before the launcher hierarchy is inflated.- // Together with MyTheme's black starting-window background this prevents- // Android from presenting stale launcher/app pixels while MainActivity is- // being created. Keep it on-screen for at least one display frame so the- // user sees a deterministic "Loading" state before the launcher.- window.setBackgroundDrawable(- android.graphics.drawable.ColorDrawable(android.graphics.Color.BLACK)- )- setContentView(createOpaqueLoadingPanel())- window.decorView.postDelayed({- if (!isFinishing && !isDestroyed) {- initializeLauncher(savedInstanceState)- }- }, 34L)- }-- private fun initializeLauncher(savedInstanceState: Bundle?) {- MyApp.app.defaultScaling = determineScaling()-- prefs = PreferenceManager.getDefaultSharedPreferences(this)- migrateRetiredShaderSelection()-- // Only a fresh app launch may auto-skip. Activity recreation while the- // launcher is already open must never unexpectedly start the game.- // First-run Bugsnag consent takes precedence over direct launch.- val bugsnagConsentMissing =- MyApp.haveBugsnagApiKey &&- prefs.getString("bugsnag_consent", "").isNullOrEmpty()-- skipGuiOverrideRequested = false- skipGuiVolumeOverrideHeld = false- skipGuiDirectLaunchActive = false- skipGuiAutoLaunchPending =- savedInstanceState == null &&- prefs.getBoolean("pref_skip_gui", false) &&- !bugsnagConsentMissing-- PermissionHelper.getWriteExternalStoragePermission(this@MainActivity)-- // Keep the opaque black Android starting window only for the short- // pre-launcher loading phase. Once the launcher hierarchy is installed,- // restore the stock themed background unless the explicit OLED launcher- // design is selected.- val launcherThemePreference = prefs.getInt(getString(R.string.theme), 0)- setContentView(R.layout.main)- if (launcherThemePreference == 3) {- applyOledLauncherWindowBackground()- } else {- restoreOriginalLauncherWindowBackground()- }- migrateObjectPagingMinSizeDefault()- migrateOpenMw050SettingsPreferences()- migrateOpenMw051SettingsPreferences()- migrateOpenMw051GroundcoverPreferences()-- if(launcherThemePreference == 0) AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)- else if(launcherThemePreference == 1) AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)- else AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)-- fragmentManager.beginTransaction()- .replace(R.id.content_frame, FragmentSettings()).commit()-- val launcherToolbar =- findViewById<androidx.appcompat.widget.Toolbar>(R.id.main_toolbar)- setSupportActionBar(launcherToolbar)- applyLauncherSurfaceTheme(launcherToolbar)- installUserConfigurationOverflow(launcherToolbar)-- val fab = findViewById<FloatingActionButton>(R.id.fab)- fab.setOnClickListener { checkStartGame() }-- if (prefs.getString("bugsnag_consent", "")!! == "") {- askBugsnagConsent()- }-- if (skipGuiAutoLaunchPending) {- // Preserve the existing no-flash Skip GUI behaviour after the normal- // launcher layout has been constructed behind the startup screen.- window.decorView.alpha = 0f- Log.i(- TAG,- "Skip GUI armed: press/hold Volume Up during startup to show launcher."- )- skipGuiHandler.postDelayed(skipGuiAutoLaunchRunnable, 800L)- }- }-- private fun restoreOriginalLauncherWindowBackground() {- // The startup panel deliberately paints the Window black before the launcher exists.- // Once R.layout.main is installed, restore the Window background resolved from the- // original MyTheme/AppCompat DayNight theme. Do not hard-code a grey here: this is- // exactly the background the unmodified launcher inherited from its theme.- val value = android.util.TypedValue()- if (!theme.resolveAttribute(android.R.attr.windowBackground, value, true)) {- window.setBackgroundDrawable(null)- return- }-- val background = when {- value.resourceId != 0 -> resources.getDrawable(value.resourceId, theme)- value.type in android.util.TypedValue.TYPE_FIRST_COLOR_INT..android.util.TypedValue.TYPE_LAST_COLOR_INT ->- android.graphics.drawable.ColorDrawable(value.data)- else -> null- }- window.setBackgroundDrawable(background)- }-- private fun isOledLauncherTheme(): Boolean =- prefs.getInt(getString(R.string.theme), 0) == 3-- private fun applyOledLauncherWindowBackground() {- val black = android.graphics.Color.BLACK- window.setBackgroundDrawable(android.graphics.drawable.ColorDrawable(black))- window.statusBarColor = black- window.navigationBarColor = black- }-- private fun applyLauncherSurfaceTheme(toolbar: androidx.appcompat.widget.Toolbar) {- if (!isOledLauncherTheme()) {- return- }-- val black = android.graphics.Color.BLACK- applyOledLauncherWindowBackground()- findViewById<android.view.View>(R.id.drawer_layout)?.setBackgroundColor(black)- findViewById<android.view.View>(R.id.content_frame)?.setBackgroundColor(black)- toolbar.setBackgroundColor(black)- }-- private fun createOpaqueLoadingPanel(): android.view.View {- val density = resources.displayMetrics.density- val spacing = (18f * density + 0.5f).toInt()- val horizontalPadding = (28f * density + 0.5f).toInt()-- return android.widget.LinearLayout(this).apply {- orientation = android.widget.LinearLayout.VERTICAL- gravity = android.view.Gravity.CENTER- setPadding(horizontalPadding, spacing, horizontalPadding, spacing)- setBackgroundColor(android.graphics.Color.BLACK)-- addView(android.widget.ProgressBar(this@MainActivity))- addView(android.widget.TextView(this@MainActivity).apply {- text = getString(R.string.launch_preparing)- setTextColor(android.graphics.Color.WHITE)- textSize = 16f- gravity = android.view.Gravity.CENTER- setPadding(0, spacing, 0, 0)- })- }- }-- override fun dispatchKeyEvent(event: android.view.KeyEvent): Boolean {- if (event.keyCode == android.view.KeyEvent.KEYCODE_VOLUME_UP) {- if (skipGuiAutoLaunchPending &&- event.action == android.view.KeyEvent.ACTION_DOWN) {- skipGuiOverrideRequested = true- skipGuiAutoLaunchPending = false- skipGuiDirectLaunchActive = false- skipGuiVolumeOverrideHeld = true- skipGuiHandler.removeCallbacks(skipGuiAutoLaunchRunnable)- window.decorView.alpha = 1f-- Log.i(TAG, "Skip GUI overridden by Volume Up; launcher remains visible.")- return true- }-- if (skipGuiVolumeOverrideHeld) {- if (event.action == android.view.KeyEvent.ACTION_UP) {- skipGuiVolumeOverrideHeld = false- }- return true- }- }-- return super.dispatchKeyEvent(event)- }-- override fun onDestroy() {- skipGuiHandler.removeCallbacks(skipGuiAutoLaunchRunnable)- skipGuiAutoLaunchPending = false- super.onDestroy()- }-- private fun revealLauncherAfterSkipGui(reason: String) {- if (!skipGuiDirectLaunchActive && window.decorView.alpha >= 1f) {- return- }-- skipGuiDirectLaunchActive = false- skipGuiAutoLaunchPending = false- skipGuiHandler.removeCallbacks(skipGuiAutoLaunchRunnable)- window.decorView.alpha = 1f- Log.i(TAG, "Skip GUI: launcher restored ($reason).")- }-- override fun onResume() {- super.onResume()-- // Migrate the legacy /storage/emulated/0/omw user tree after the- // Activity has had a chance to request legacy game-file storage- // permission. On modern Android this is a no-op after migration.- MyApp.app.migrateLegacyUserStorageIfPossible()- }-- private fun migrateObjectPagingMinSizeDefault() {- val valueKey = "gs_object_paging_min_size"- val migrationKey = "migration_object_paging_min_size_025_v11"-- if (prefs.getBoolean(migrationKey, false)) {- return- }-- val current = prefs.getString(valueKey, null)- val editor = prefs.edit()-- // v11 changes the Android preset default from OpenMW's 0.01 to 0.25.- // Preserve any explicitly selected non-default value.- if (current.isNullOrBlank() || current == "0.01") {- editor.putString(valueKey, "0.25")- }-- editor.putBoolean(migrationKey, true)- editor.apply()- }-- /**- * Set new user consent and maybe restart the app- * @param consent New value of bugsnag consent- */- @SuppressLint("ApplySharedPref")- private fun setBugsnagConsent(consent: String) {- val currentConsent = prefs.getString("bugsnag_consent", "")!!- if (currentConsent == consent)- return-- // We only need to force a restart if the user revokes their consent- // If user grants consent, crashes won't be reported for 1 game session, but that's alright- val needRestart = currentConsent == "true" && consent == "false"-- with (prefs.edit()) {- putString("bugsnag_consent", consent)- commit()- }-- if (needRestart) {- AlertDialog.Builder(this)- .setOnDismissListener { System.exit(0) }- .setTitle(R.string.bugsnag_consent_restart_title)- .setMessage(R.string.bugsnag_consent_restart_message)- .setPositiveButton(android.R.string.ok) { _, _ -> System.exit(0) }- .show()- }- }-- /**- * Opens the url in a web browser and gracefully handles the failure- * @param url Url to open- */- fun openUrl(url: String) {- try {- val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))- startActivity(browserIntent)- } catch (e: ActivityNotFoundException) {- AlertDialog.Builder(this)- .setTitle(R.string.no_browser_title)- .setMessage(getString(R.string.no_browser_message, url))- .setPositiveButton(android.R.string.ok) { _, _ -> }- .show()- }- }-- /**- * Asks the user if they want to automatically report crashes- */- private fun askBugsnagConsent() {- // Do nothing for builds without api-key- if (!MyApp.haveBugsnagApiKey)- return-- val dialog = AlertDialog.Builder(this)- .setTitle(R.string.bugsnag_consent_title)- .setMessage(R.string.bugsnag_consent_message)- .setNeutralButton(R.string.bugsnag_policy) { _, _ -> /* set up below */ }- .setNegativeButton(R.string.bugsnag_no) { _, _ -> setBugsnagConsent("false") }- .setPositiveButton(R.string.bugsnag_yes) { _, _ -> setBugsnagConsent("true") }- .create()-- dialog.show()-- // don't close the dialog when the privacy-policy button is clicked- dialog.getButton(AlertDialog.BUTTON_NEUTRAL).setOnClickListener {- openUrl("https://omw.xyz.is/privacy-policy.html")- }- }-- /**- * Checks that the game is properly installed and if so, starts the game- * - the game files must be selected- * - there must be at least 1 activated mod (user can ignore this warning)- */- private fun checkStartGame() {- // First, check that there are game files present- val inst = GameInstaller(prefs.getString("game_files", "")!!)- if (!inst.check()) {- revealLauncherAfterSkipGui("game files need configuration")- AlertDialog.Builder(this)- .setTitle(R.string.no_data_files_title)- .setMessage(R.string.no_data_files_message)- .setNeutralButton(R.string.dialog_howto) { _, _ ->- openUrl("https://omw.xyz.is/game.html")- }- .setPositiveButton(android.R.string.ok) { _: DialogInterface, _: Int -> }- .show()- return- }-- // Second, check if user has at least one mod enabled. Only scan the- // base Data Files directory and additional data directories enabled by- // the user; disabled directories must not leak plugins into the launch.- val db = ModsDatabaseOpenHelper.getInstance(this)- val allDataFilesList = ModsPaths.allDataDirectories(this)- val activeDataFilesList = ModsPaths.activeDataDirectories(this, db)- val plugins = ModsCollection(ModType.Plugin, allDataFilesList, db)- if (plugins.mods.count { it.enabled && ModsPaths.fileExistsIn(it.filename, activeDataFilesList) } == 0) {- // No mods enabled, show a warning- revealLauncherAfterSkipGui("content selection needs confirmation")- AlertDialog.Builder(this)- .setTitle(R.string.no_content_files_title)- .setMessage(R.string.no_content_files_message)- .setNeutralButton(R.string.dialog_howto) { _, _ ->- openUrl("https://omw.xyz.is/mods.html")- }- .setNegativeButton(R.string.no_content_files_dismiss) { _, _ -> startGame() }- .setPositiveButton(R.string.configure_mods) { _, _ ->- this.startActivity(Intent(this, ModsActivity::class.java))- }- .show()-- return- }-- // If everything's alright, start the game- startGame()- }-- private fun deleteRecursive(fileOrDirectory: File) {- if (fileOrDirectory.isDirectory) {- fileOrDirectory.listFiles()?.forEach { child ->- deleteRecursive(child)- }- }-- fileOrDirectory.delete()- }-- private fun logConfig() {- val config = File(Constants.OPENMW_CFG)- Log.i(TAG, "OpenMW config path: ${config.absolutePath}; exists=${config.exists()}; size=${if (config.exists()) config.length() else 0}")-- if (!config.isFile) {- return- }-- try {- val interestingPrefixes = listOf(- "resources=",- "data=",- "content=",- "groundcover=",- "fallback-archive=",- "encoding="- )-- var logged = 0- config.forEachLine { line ->- val trimmed = line.trim()- if (interestingPrefixes.any { trimmed.startsWith(it) }) {- if (logged < 120) {- Log.i("OpenMW-Config", trimmed)- }- logged += 1- }- }-- if (logged > 120) {- Log.i("OpenMW-Config", "... ${logged - 120} additional config entries omitted")- }- } catch (e: IOException) {- Log.e(TAG, "Failed to log generated openmw.cfg.", e)- }- }-- private fun runGame() {- logConfig()-- val intent = Intent(this@MainActivity, GameActivity::class.java)- startActivity(intent)- finish()- }--- /**- * Set up fixed screen resolution- * This doesn't do anything unless the user chose to override screen resolution- */- private fun obtainFixedScreenResolution() {- // Split resolution e.g 640x480 to width/height- val customResolution = prefs.getString("pref_customResolution", "")- val sep = customResolution!!.indexOf("x")- if (sep > 0) {- try {- val x = Integer.parseInt(customResolution.substring(0, sep))- val y = Integer.parseInt(customResolution.substring(sep + 1))-- resolutionX = x- resolutionY = y- } catch (e: NumberFormatException) {- // user entered resolution wrong, just ignore it- }- }- }-- /**- * Generates openmw.cfg using values from openmw.base.cfg combined with mod manager settings- */- private fun generateOpenmwCfg(): Boolean {- // contents of openmw.base.cfg- val base: String- // contents of openmw.fallback.cfg- val fallback: String-- // try to read the files- try {- base = File(Constants.OPENMW_BASE_CFG).readLines()- .filterNot { it.trim() == "data=\"specify-me!\"" }- .joinToString("\n", postfix = "\n")- // TODO: support user custom options- fallback = File(Constants.OPENMW_FALLBACK_CFG).readText()- } catch (e: IOException) {- Log.e(TAG, "Failed to read openmw.base.cfg or openmw.fallback.cfg", e)- return false- }-- val db = ModsDatabaseOpenHelper.getInstance(this)- val allDataFilesList = ModsPaths.allDataDirectories(this)- val activeDataFilesList = ModsPaths.activeDataDirectories(this, db)-- // Keep the database synchronized against every present directory so- // disabled directories retain their enable/load-order state. Runtime- // output below is restricted to active data directories only.- val resources = ModsCollection(ModType.Resource, allDataFilesList, db)- val plugins = ModsCollection(ModType.Plugin, allDataFilesList, db)- val groundcovers = ModsCollection(ModType.Groundcover, allDataFilesList, db)-- try {- // Generate final openmw.cfg without repeatedly reallocating a growing String.- val output = buildString {- append(base)- append('\n')- append(fallback)- append('\n')-- resources.mods- .filter { it.enabled && ModsPaths.fileExistsIn(it.filename, activeDataFilesList) }- .forEach { append("fallback-archive=${it.filename}\n") }-- // The base Data Files path must be first. startGame() later- // rewrites the first data= line for compatibility; keeping the- // base path first prevents that write from replacing an enabled- // additional data directory.- activeDataFilesList- .map(::File)- .filter { it.isDirectory }- .forEach { append("data=\"${it.absolutePath}\"\n") }-- plugins.mods- .filter { it.enabled && ModsPaths.fileExistsIn(it.filename, activeDataFilesList) }- .forEach { append("content=${it.filename}\n") }-- groundcovers.mods- .filter { it.enabled && ModsPaths.fileExistsIn(it.filename, activeDataFilesList) }- .forEach { append("groundcover=${it.filename}\n") }-- append(isowindCfgLines())- }-- // Write only the real launcher configuration. Keep unrelated- // legacy side writes out of this code path; on ChromeOS a failed- // secondary write must never invalidate a valid openmw.cfg.- val configFile = File(Constants.OPENMW_CFG)- configFile.parentFile?.mkdirs()- configFile.writeText(output)- Log.i(TAG, "Generated openmw.cfg at ${configFile.absolutePath}; size=${configFile.length()}")- return configFile.isFile && configFile.length() > 0- } catch (e: IOException) {- Log.e(TAG, "Failed to generate openmw.cfg.", e)- return false- }- }-- // Isowind's look on Android: pixel art (the engine renders at low resolution, which also suits phones; the retro- // textures the desktop launchers build aren't made here yet)- private val isowindLook = "pixelart"-- // What the Android launcher sets itself, so the Isowind profile leaves it alone- private val isowindLauncherSections = setOf("Post Processing", "Shadows")-- /**- * Isowind: the profile's data folders (its mod and the bundled mods) after every other one, and its plugins after- * Morrowind's, in the order the multiplayer server expects. Its data paths are relative to the profile's folder.- */- private fun isowindCfgLines(): String {- val profile = File(Constants.ISOWIND, "profiles/$isowindLook")- val cfg = File(profile, "openmw.cfg")- if (!cfg.isFile) return ""- return buildString {- cfg.readLines().map { it.trim() }.forEach { line ->- when {- line.startsWith("data=") ->- append("data=\"${File(profile, line.removePrefix("data=").trim('"')).canonicalPath}\"\n")- line.startsWith("content=") -> append(line).append('\n')- }- }- }- }-- /**- * Isowind: the profile's settings (what the top-down camera, the pixel art look and the HUD need) over the- * user's settings.cfg on every start, except what the Android launcher owns: post-processing, shadows, the GUI- * scaling it works out for the screen.- */- private fun applyIsowindSettings() {- val profileSettings = File(Constants.ISOWIND, "profiles/$isowindLook/settings.cfg")- if (!profileSettings.isFile) return- val sections = linkedMapOf<String, LinkedHashMap<String, String?>>()- var section = ""- profileSettings.readLines().map { it.trim() }.forEach { line ->- when {- line.isEmpty() || line.startsWith("#") -> {}- line.startsWith("[") && line.endsWith("]") -> section = line.substring(1, line.length - 1)- "=" in line && section !in isowindLauncherSections- && !(section == "GUI" && line.startsWith("scaling factor")) ->- sections.getOrPut(section) { linkedMapOf() }[line.substringBefore('=').trim()] =- line.substringAfter('=').trim()- }- }- // Menus made for a controller: the handheld's pad or the on-screen one drives them- sections.getOrPut("GUI") { linkedMapOf() }["controller menus"] = "true"- val settingsFile = File(Constants.USER_CONFIG, "settings.cfg")- sections.forEach { (name, values) -> updateSettingsSection(settingsFile, name, values) }- }-- /**- * Determines required screen scaling based on resolution and physical size of the device- */- private fun determineScaling(): Float {- // The idea is to stretch an old-school 1024x768 monitor to the device screen- // Assume that 1x scaling corresponds to resolution of 1024x768- // Assume that the longest side of the device corresponds to the 1024 side- // Therefore scaling is calculated as longest size of the device divided by 1024- // Note that it doesn't take into account DPI at all. Which is fine for now, but in future- // we might want to add some bonus scaling to e.g. phone devices so that it's easier- // to click things.-- val dm = DisplayMetrics()- windowManager.defaultDisplay.getMetrics(dm)- return maxOf(dm.heightPixels, dm.widthPixels) / 1024.0f- }-- /**- * Checks whether the OpenMW runtime payload was successfully deployed.- */- private fun staticFilesInstalled(): Boolean {- val fullscreenShader = File(- Constants.RESOURCES,- "shaders/compatibility/fullscreen_tri.vert"- )- val shadowShader = File(- Constants.RESOURCES,- "shaders/compatibility/shadowcasting.vert"- )- val shadowFragmentShader = File(- Constants.RESOURCES,- "shaders/compatibility/shadows_fragment.glsl"- )- val debugVert = File(- Constants.RESOURCES,- "shaders/compatibility/debug.vert"- )- val debugFrag = File(- Constants.RESOURCES,- "shaders/compatibility/debug.frag"- )- val objectsVertexShader = File(- Constants.RESOURCES,- "shaders/compatibility/objects.vert"- )- val objectsFragmentShader = File(- Constants.RESOURCES,- "shaders/compatibility/objects.frag"- )- val terrainVertexShader = File(- Constants.RESOURCES,- "shaders/compatibility/terrain.vert"- )- val terrainFragmentShader = File(- Constants.RESOURCES,- "shaders/compatibility/terrain.frag"- )- val groundcoverVertexShader = File(- Constants.RESOURCES,- "shaders/compatibility/groundcover.vert"- )- val bsDefaultVertexShader = File(- Constants.RESOURCES,- "shaders/compatibility/bs/default.vert"- )- val bsDefaultFragmentShader = File(- Constants.RESOURCES,- "shaders/compatibility/bs/default.frag"- )- val bsNoLightingVertexShader = File(- Constants.RESOURCES,- "shaders/compatibility/bs/nolighting.vert"- )- val fogShader = File(- Constants.RESOURCES,- "shaders/compatibility/fog.glsl"- )- val coreVertexHeader = File(- Constants.RESOURCES,- "shaders/lib/core/vertex.h.glsl"- )- val coreFragmentHeader = File(- Constants.RESOURCES,- "shaders/lib/core/fragment.h.glsl"- )- val esmFallbacksScript = File(- Constants.RESOURCES,- "vfs-mw/scripts/omw/esmfallbacks.lua"- )- val bundledAdjustments = File(- Constants.RESOURCES,- "vfs/shaders/adjustments.omwfx"- )-- if (!File(Constants.DEFAULTS_BIN).isFile ||- !File(Constants.OPENMW_BASE_CFG).isFile ||- !File(Constants.RESOURCES).isDirectory ||- !File(Constants.RESOURCES, "version").isFile ||- !fullscreenShader.isFile ||- !shadowShader.isFile ||- !shadowFragmentShader.isFile ||- !debugVert.isFile ||- !debugFrag.isFile ||- !objectsVertexShader.isFile ||- !objectsFragmentShader.isFile ||- !terrainVertexShader.isFile ||- !terrainFragmentShader.isFile ||- !groundcoverVertexShader.isFile ||- !bsDefaultVertexShader.isFile ||- !bsDefaultFragmentShader.isFile ||- !bsNoLightingVertexShader.isFile ||- !fogShader.isFile ||- !coreVertexHeader.isFile ||- !coreFragmentHeader.isFile ||- !esmFallbacksScript.isFile ||- !bundledAdjustments.isFile) {- return false- }-- return try {- val resourceVersion = File(Constants.RESOURCES, "version").readText().trim()- val shadowFragmentText = shadowFragmentShader.readText()- val objectsVertexText = objectsVertexShader.readText()- val objectsFragmentText = objectsFragmentShader.readText()- val terrainVertexText = terrainVertexShader.readText()- val terrainFragmentText = terrainFragmentShader.readText()- val groundcoverVertexText = groundcoverVertexShader.readText()- val bsDefaultVertexText = bsDefaultVertexShader.readText()- val bsDefaultFragmentText = bsDefaultFragmentShader.readText()- val bsNoLightingVertexText = bsNoLightingVertexShader.readText()- val fogShaderText = fogShader.readText()- val coreVertexText = coreVertexHeader.readText()- val coreFragmentText = coreFragmentHeader.readText()-- resourceVersion.startsWith("0.51.0") &&- !fullscreenShader.readText().contains("uniform vec2 scaling =") &&- !shadowShader.readText().contains("uniform bool useDiffuseMapForShadowAlpha =") &&- !shadowShader.readText().contains("uniform bool alphaTestShadows =") &&- !debugVert.readText().contains("uniform bool useAdvancedShader =") &&- !debugFrag.readText().contains("uniform bool useAdvancedShader =") &&- objectsFragmentText.contains("OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG") &&- objectsFragmentText.contains("OPENMW_ANDROID_051_LOCALMAP_OBJECT_FOG_BYPASS_V1") &&- // Patch 8 ports only the proven OpenMW-0.50 Android/GL4ES- // normal-transform compatibility substitutions. Avoid direct- // gl_NormalMatrix * passNormal in these 0.51 shader stages.- objectsVertexText.contains("vec3 viewNormal = normalToView(passNormal);") &&- objectsFragmentText.contains("vec3 viewNormal = normalToView(normalize(passNormal));") &&- terrainVertexText.contains("vec3 viewNormal = normalToView(passNormal);") &&- terrainFragmentText.contains("vec3 viewNormal = normalToView(normalize(passNormal));") &&- groundcoverVertexText.contains("vec3 viewNormal = normalToView(passNormal);") &&- bsDefaultVertexText.contains("vec3 viewNormal = normalToView(passNormal);") &&- bsDefaultFragmentText.contains("vec3 viewNormal = normalToView(normalize(passNormal));") &&- bsNoLightingVertexText.contains("vec3 viewNormal = normalize((gl_NormalMatrix * gl_Normal).xyz);") &&- fogShaderText.contains("OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG") &&- fogShaderText.contains("uniform float omwFogStart") &&- fogShaderText.contains("uniform float omwFogEnd") &&- // GL4ES on the Retroid/Adreno path cannot link OpenMW 0.51's- // helper-only shader objects. Patch 4 keeps the public helper- // API but inlines the implementations into the include headers.- !coreVertexText.contains("@link") &&- coreVertexText.contains("OPENMW_ANDROID_051_GL4ES_CORE_INLINE") &&- coreVertexText.contains("vec4 modelToClip(vec4 pos)") &&- !coreFragmentText.contains("@link") &&- coreFragmentText.contains("OPENMW_ANDROID_051_GL4ES_CORE_INLINE") &&- coreFragmentText.contains("vec4 sampleReflectionMap(vec2 uv)") &&- // Patch 12 / Gate F: GLES2 depth textures are sampled as regular- // sampler2D values and compared manually; the casting shader also- // uses normal GLES2 near/far clipping instead of emulating GL_DEPTH_CLAMP.- shadowFragmentText.contains("OPENMW_ANDROID_051_GLES2_MANUAL_SHADOW_COMPARE") &&- shadowFragmentText.contains("OPENMW_ANDROID_051_GLES2_QUALITY_PCF") &&- !shadowFragmentText.contains("uniform sampler2DShadow") &&- !shadowFragmentText.contains("shadow2DProj(") &&- shadowShader.readText().contains("OPENMW_ANDROID_051_GLES2_NATIVE_SHADOW_CLIPPING")- } catch (e: IOException) {- false- }- }-- /**- * Removes old and creates new files located in private application directories- * (i.e. under getFilesDir(), or /data/data/.../files)- */- private fun reinstallStaticFiles() {- // we store global "config" and "resources" under private files-- // wipe old version first- removeStaticFiles()-- // copy in the new version- val assetCopier = CopyFilesFromAssets(this)- assetCopier.copy("libopenmw/resources", Constants.RESOURCES)- assetCopier.copy("libopenmw/openmw", Constants.GLOBAL_CONFIG)- assetCopier.copy("isowind", Constants.ISOWIND)-- // The non-OMWFX path uses OpenMW 0.51's bundled adjustments.omwfx.- // The standalone Android/OMWFX shader assets remain isolated and are- // still not copied into OpenMW's VFS during this gate.-- if (!staticFilesInstalled()) {- throw IOException(- "OpenMW runtime assets are missing from this APK. " +- "Run tools/bootstrap-openmw-arm64.ps1 or buildscripts/build.sh before building the APK."- )- }-- // set up user config (if not present)- File(Constants.USER_CONFIG).mkdirs()- if (!File(Constants.USER_OPENMW_CFG).exists())- File(Constants.USER_OPENMW_CFG).writeText("# This is the user openmw.cfg. Feel free to modify it as you wish.\n")- // Isowind's key and controller bindings, unless the player has their own- val isowindBindings = File(Constants.ISOWIND, "profiles/input_v3.xml")- val userBindings = File(Constants.USER_CONFIG, "input_v3.xml")- if (!userBindings.exists() && isowindBindings.isFile)- isowindBindings.copyTo(userBindings)-- // create user custom icon folder as a hint- File(Constants.USER_FILE_STORAGE + "/icons").mkdirs()- if (!File(Constants.USER_FILE_STORAGE + "/icons/paste custom icons here.txt").exists())- File(Constants.USER_FILE_STORAGE + "/icons/paste custom icons here.txt").writeText(-"attack.png \ninventory.png \njournal.png \njump.png \nkeyboard.png \nmouse.png \npause.png \npointer_arrow.png \nrun.png \nsave.png \nsneak.png \nthird_person.png \ntoggle_magic.png \ntoggle_weapon.png \ntoggle.png \nuse.png \nwait.png")-- // set version stamp- File(Constants.VERSION_STAMP).writeText(BuildConfig.VERSION_CODE.toString())- }-- /**- * Removes global static files, these include resources and config- */- private fun removeStaticFiles() {- // remove version stamp so that reinstallStaticFiles is called during game launch- File(Constants.VERSION_STAMP).delete()-- deleteRecursive(File(Constants.GLOBAL_CONFIG))- deleteRecursive(File(Constants.RESOURCES))- deleteRecursive(File(Constants.ISOWIND))- }-- /**- * Resets user config to default values by removing it- */- private fun removeUserConfig() {- deleteRecursive(File(Constants.USER_CONFIG))- }-- /**- * Reset user resource files to default- */- private fun removeResourceFiles() {- reinstallStaticFiles()- deleteRecursive(File(Constants.USER_FILE_STORAGE + "/resources/"))-- val src = File(Constants.RESOURCES)- val dst = File(Constants.USER_FILE_STORAGE + "/resources/")- dst.mkdirs()- src.copyRecursively(dst, true)- }-- private fun resourcePayloadMatches(source: File, target: File): Boolean {- if (!source.isDirectory || !target.isDirectory) {- return false- }-- val sourceVersion = File(source, "version")- val targetVersion = File(target, "version")- val sourceLogo = File(source, "openmw.png")- val targetLogo = File(target, "openmw.png")- val sourceEsmFallbacks = File(source, "vfs-mw/scripts/omw/esmfallbacks.lua")- val targetEsmFallbacks = File(target, "vfs-mw/scripts/omw/esmfallbacks.lua")-- if (!sourceVersion.isFile || !targetVersion.isFile ||- !sourceLogo.isFile || !targetLogo.isFile ||- !sourceEsmFallbacks.isFile || !targetEsmFallbacks.isFile) {- return false- }-- return try {- sourceVersion.readText().trim() == targetVersion.readText().trim() &&- sourceVersion.readText().trim().startsWith("0.51.0") &&- sourceLogo.length() == targetLogo.length() &&- sourceEsmFallbacks.length() == targetEsmFallbacks.length()- } catch (e: IOException) {- false- }- }-- /**- * The original CaveBros launcher runs OpenMW against the writable resource- * mirror under USER_FILE_STORAGE. Older installs can leave that mirror- * incomplete or from another engine revision. In that case OpenMW starts,- * but reports that the resource directory does not match the binary and can- * remain on a black screen.- *- * Only rebuild the mirror when it is demonstrably incomplete/mismatched so- * valid user-customised resources are preserved during normal launches.- */- private fun ensureUserResourcesCurrent() {- val source = File(Constants.RESOURCES)- val target = File(Constants.USER_FILE_STORAGE + "/resources/")-- if (!source.isDirectory) {- throw IOException("Bundled OpenMW resources are missing: ${source.absolutePath}")- }-- if (!resourcePayloadMatches(source, target)) {- Log.w(TAG, "User OpenMW resources are incomplete or mismatched; rebuilding ${target.absolutePath}")- deleteRecursive(target)- target.parentFile?.mkdirs()-- if (!source.copyRecursively(target, overwrite = true)) {- throw IOException("Failed to rebuild OpenMW user resources at ${target.absolutePath}")- }-- if (!resourcePayloadMatches(source, target)) {- throw IOException("OpenMW user resources still do not match the bundled runtime after rebuild")- }- }-- syncAndroidShaderCompatibilityResources()- }-- /**- * OpenMW 0.51 adds engine-owned Morrowind compatibility scripts below- * resources/vfs-mw. CaveBros historically stripped every data= line from- * the generated base config, which also removed this new internal path.- * Insert it before user/game data paths so engine fallbacks are loaded first- * while mods can still override them afterwards.- */- private fun ensureOpenMw051InternalDataPath() {- val configFile = File(Constants.OPENMW_CFG)- if (!configFile.isFile) {- throw IOException("OpenMW config is missing before vfs-mw migration: ${configFile.absolutePath}")- }-- val internalPath = Constants.USER_FILE_STORAGE + "/resources/vfs-mw"- val internalLine = "data=\"$internalPath\""- val original = configFile.readLines()- val filtered = original.filterNot { line ->- val trimmed = line.trim()- trimmed.startsWith("data=") && trimmed.contains("/resources/vfs-mw")- }.toMutableList()-- val firstData = filtered.indexOfFirst { it.trim().startsWith("data=") }- if (firstData >= 0) {- filtered.add(firstData, internalLine)- } else {- filtered.add(internalLine)- }-- configFile.writeText(filtered.joinToString("\n", postfix = "\n"))-- val fallbackScript = File(internalPath, "scripts/omw/esmfallbacks.lua")- if (!fallbackScript.isFile) {- throw IOException("OpenMW 0.51 vfs-mw fallback script is missing: ${fallbackScript.absolutePath}")- }-- Log.i(TAG, "OpenMW 0.51 internal data path enabled: $internalPath")- }-- private fun syncAndroidShaderCompatibilityResources() {- // VERSION_CODE can stay unchanged between development APK rebuilds.- // Refresh the Patch-12 GL4ES compatibility + shadow shader set from the APK on every launch so- // the private tree and writable user mirror cannot retain stale 0.50/0.51 files.- val coreRelativePaths = listOf(- "shaders/compatibility/fullscreen_tri.vert",- "shaders/compatibility/shadowcasting.vert",- "shaders/compatibility/shadows_vertex.glsl",- "shaders/compatibility/shadows_fragment.glsl",- "shaders/compatibility/debug.vert",- "shaders/compatibility/debug.frag",- "shaders/compatibility/objects.vert",- "shaders/compatibility/objects.frag",- "shaders/compatibility/terrain.vert",- "shaders/compatibility/terrain.frag",- "shaders/compatibility/groundcover.vert",- "shaders/compatibility/groundcover.frag",- "shaders/compatibility/water.vert",- "shaders/compatibility/water.frag",- "shaders/compatibility/bs/default.vert",- "shaders/compatibility/bs/default.frag",- "shaders/compatibility/bs/nolighting.vert",- "shaders/compatibility/bs/nolighting.frag",- "shaders/compatibility/fog.glsl",- "shaders/lib/core/vertex.h.glsl",- "shaders/lib/core/fragment.h.glsl"- )-- coreRelativePaths.forEach { relativePath ->- val assetPath = "libopenmw/resources/$relativePath"- val privateTarget = File(Constants.RESOURCES, relativePath)- val userTarget = File(Constants.USER_FILE_STORAGE + "/resources/", relativePath)-- privateTarget.parentFile?.mkdirs()- userTarget.parentFile?.mkdirs()-- if (relativePath == "shaders/compatibility/shadows_fragment.glsl") {- // The bundled receiver is a valid Medium-quality shader. Before- // each launch specialize its compile-time GLES2 PCF constants- // to the currently selected shadow quality. This keeps the- // stable one-map Android path while avoiding runtime loops,- // textureSize() (not available on GLES2) or native uniforms.- val bundledShadowShader = assets.open(assetPath).bufferedReader(Charsets.UTF_8).use {- it.readText()- }- val specializedShadowShader = specializeAndroidShadowShader(bundledShadowShader)- privateTarget.writeText(specializedShadowShader, Charsets.UTF_8)- userTarget.writeText(specializedShadowShader, Charsets.UTF_8)- } else {- assets.open(assetPath).use { input ->- privateTarget.outputStream().use { output ->- input.copyTo(output)- }- }- privateTarget.copyTo(userTarget, overwrite = true)- }- }-- // Publish only the device-proven OpenMW 0.51 Android OMWFX stack.- // WetWorld runs before the optical passes, RainLens runs last, and the- // native water-alpha marker excludes actual water from WetWorld.- val bloomShader = "gateh_bloom051.omwfx"- val bloomPrivateTarget = File(Constants.RESOURCES, "vfs/shaders/$bloomShader")- val bloomUserTarget = File(- Constants.USER_FILE_STORAGE + "/resources/vfs/shaders/",- bloomShader- )-- bloomPrivateTarget.parentFile?.mkdirs()- assets.open("android_omwfx/$bloomShader").use { input ->- bloomPrivateTarget.outputStream().use { output ->- input.copyTo(output)- }- }- bloomUserTarget.parentFile?.mkdirs()- bloomPrivateTarget.copyTo(bloomUserTarget, overwrite = true)-- val lensflareShader = "lensflare_android_051_rayocc.omwfx"- val lensflarePrivateTarget = File(Constants.RESOURCES, "vfs/shaders/$lensflareShader")- val lensflareUserTarget = File(- Constants.USER_FILE_STORAGE + "/resources/vfs/shaders/",- lensflareShader- )-- lensflarePrivateTarget.parentFile?.mkdirs()- assets.open("android_omwfx/$lensflareShader").use { input ->- lensflarePrivateTarget.outputStream().use { output ->- input.copyTo(output)- }- }- lensflareUserTarget.parentFile?.mkdirs()- lensflarePrivateTarget.copyTo(lensflareUserTarget, overwrite = true)-- val godraysShader = "godrays_android_051_depthfixed_vivid.omwfx"- val godraysPrivateTarget = File(Constants.RESOURCES, "vfs/shaders/$godraysShader")- val godraysUserTarget = File(- Constants.USER_FILE_STORAGE + "/resources/vfs/shaders/",- godraysShader- )-- godraysPrivateTarget.parentFile?.mkdirs()- assets.open("android_omwfx/$godraysShader").use { input ->- godraysPrivateTarget.outputStream().use { output ->- input.copyTo(output)- }- }- godraysUserTarget.parentFile?.mkdirs()- godraysPrivateTarget.copyTo(godraysUserTarget, overwrite = true)-- val rainLensShader = "rainlens_android_051_v12_dense.omwfx"- val rainLensPrivateTarget = File(Constants.RESOURCES, "vfs/shaders/$rainLensShader")- val rainLensUserTarget = File(- Constants.USER_FILE_STORAGE + "/resources/vfs/shaders/",- rainLensShader- )-- rainLensPrivateTarget.parentFile?.mkdirs()- assets.open("android_omwfx/$rainLensShader").use { input ->- rainLensPrivateTarget.outputStream().use { output ->- input.copyTo(output)- }- }- rainLensUserTarget.parentFile?.mkdirs()- rainLensPrivateTarget.copyTo(rainLensUserTarget, overwrite = true)-- val wetWorldShader = "wetworld_android_051_weather.omwfx"- val wetWorldPrivateTarget = File(Constants.RESOURCES, "vfs/shaders/$wetWorldShader")- val wetWorldUserTarget = File(- Constants.USER_FILE_STORAGE + "/resources/vfs/shaders/",- wetWorldShader- )-- wetWorldPrivateTarget.parentFile?.mkdirs()- assets.open("android_omwfx/$wetWorldShader").use { input ->- wetWorldPrivateTarget.outputStream().use { output ->- input.copyTo(output)- }- }- wetWorldUserTarget.parentFile?.mkdirs()- wetWorldPrivateTarget.copyTo(wetWorldUserTarget, overwrite = true)-- // Remove obsolete development techniques so shaders.yaml cannot bind- // stale values to superseded uniforms.- val obsoleteAndroidOmwfxShaders = listOf(- "OWSE.omwfx", // Retired launcher-owned water technique.- "gateh_probe.omwfx",- "bloomlinear_android.omwfx",- "lensflare_android.omwfx",- "lensflare_android_051.omwfx",- "lensflare_android_051_occ.omwfx",- "lensflare_android_051_depthocc.omwfx",- "lensflare_android_051_h2f.omwfx",- "godrays_android.omwfx",- "godrays_android_051.omwfx",- "godrays_android_051_rayocc.omwfx",- "godrays_android_051_dynamic.omwfx",- "godrays_android_051_depthfixed.omwfx",- "rainlens_android.omwfx",- "rainlens_android_051_weather.omwfx",- "rainlens_android_051_teardrops.omwfx",- "rainlens_android_051_v12.omwfx",- "wetworld_android.omwfx"- )- obsoleteAndroidOmwfxShaders.forEach { shaderName ->- File(Constants.RESOURCES, "vfs/shaders/$shaderName").delete()- File(- Constants.USER_FILE_STORAGE + "/resources/vfs/shaders/",- shaderName- ).delete()- }-- val bloomText = bloomUserTarget.readText()- if (!bloomText.contains("passes = nomipmap, horizontal, vertical, final;") ||- !bloomText.contains("internal_format = rgb16f;") ||- !bloomText.contains("source_type = half_float;") ||- !bloomText.contains("uniform_float uThreshold {\n default = 0.30;") ||- !bloomText.contains("uniform_float uSkyFactor {\n default = 0.60;") ||- !bloomText.contains("uniform_float uRadius {\n default = 0.55;") ||- !bloomText.contains("uniform_float uStrength {\n default = 0.35;") ||- bloomText.count { it == '\n' } < 150) {- throw IOException("OpenMW 0.51 Android OMWFX bloom payload is invalid")- }-- val lensflareText = lensflareUserTarget.readText()- if (!lensflareText.contains("uniform_float flare_strength {\n default = 0.27;") ||- !lensflareText.contains("uniform_float halo_size {\n default = 0.18;") ||- !lensflareText.contains("uniform_float ghost_strength {\n default = 0.13;") ||- !lensflareText.contains("vec4 viewDir = omw.viewMatrix * vec4(discDir, 0.0);") ||- !lensflareText.contains("omw.sunVis * clamp(omw.sunOcclusion, 0.0, 1.0) * edgeFade051(sunUv)") ||- lensflareText.contains("sunOcclusion(") ||- lensflareText.contains("sunOcclusion051(") ||- lensflareText.contains("omw_GetLinearDepth(") ||- lensflareText.contains("omw_GetDepth(") ||- lensflareText.contains("Disable_SunGlare") ||- !lensflareText.contains("passes = main;") ||- !lensflareText.contains("version = \"2.1-051-rayocc\";") ||- lensflareText.count { it == '\n' } < 100) {- throw IOException("OpenMW 0.51 Android OMWFX CPU-ray lens flare payload is invalid")- }-- val godraysText = godraysUserTarget.readText()- if (!godraysText.contains("uniform_float ray_strength {\n default = 0.60;") ||- !godraysText.contains("uniform_float ray_length {\n default = 0.85;") ||- !godraysText.contains("uniform_float sun_glow_strength {\n default = 0.65;") ||- !godraysText.contains("uniform_float direct_glare_strength {\n default = 0.48;") ||- !godraysText.contains("vec4 viewDir = omw.viewMatrix * vec4(discDir, 0.0);") ||- !godraysText.contains("clamp(omw.sunOcclusion, 0.0, 1.0)") ||- !godraysText.contains("float depth = omw_GetDepth(clamp(uv, vec2(0.001), vec2(0.999)));") ||- !godraysText.contains("float shaftContrast = smoothstep(0.08, 0.92, shafts);") ||- !godraysText.contains("shafts = mix(shafts, shaftContrast, 0.35);") ||- !godraysText.contains("light += warmColor * shaftIntensity * 0.78;") ||- !godraysText.contains("light += sunColor * directSun * direct_glare_strength * 0.60 * glowVisibility;") ||- godraysText.contains("direct_glare_strength * 0.80 * glowVisibility;") ||- !godraysText.contains("float directSun = 1.0 - smoothstep(0.035, 0.48, centerDistance);") ||- godraysText.contains("omw_GetLinearDepth(") ||- godraysText.contains("Disable_SunGlare") ||- !godraysText.contains("for (int i = 0; i < 16; i += 1)") ||- !godraysText.contains("passes = main;") ||- !godraysText.contains("version = \"3.4-051-depthfixed-vivid-softglare\";") ||- godraysText.count { it == '\n' } < 150) {- throw IOException("OpenMW 0.51 Android OMWFX calibrated Godrays/Sun-Glow payload is invalid")- }-- val rainLensText = rainLensUserTarget.readText()- if (!rainLensText.contains("uniform_float rainlens_strength_v34 {\n default = 0.72;") ||- !rainLensText.contains("uniform_float rainlens_refraction_v34 {\n default = 0.92;") ||- !rainLensText.contains("uniform_float rainlens_density_v34 {\n default = 0.90;") ||- !rainLensText.contains("float hash21051(vec2 p)") ||- !rainLensText.contains("vec4 movingDrop051(") ||- !rainLensText.contains("p.y += timeValue * speed;") ||- !rainLensText.contains("float timeValue = omw.simulationTime;") ||- !rainLensText.contains("float currentRain = rainForWeather051(omw.weatherID);") ||- !rainLensText.contains("float nextRain = rainForWeather051(omw.nextWeatherID);") ||- !rainLensText.contains("clamp(omw.weatherTransition, 0.0, 1.0)") ||- !rainLensText.contains("vec4 drop = movingDrop051(") ||- !rainLensText.contains("omw_TexCoord, 5.6, 0.215, 19.7, timeValue, wind, density") ||- !rainLensText.contains("float threshold = mix(0.94, 0.72, clamp(density, 0.0, 1.0));") ||- !rainLensText.contains("float refractionMix = clamp(mask * 0.82, 0.0, 0.82);") ||- !rainLensText.contains("result += vec3(0.028) * drop.w * rain;") ||- !rainLensText.contains("flags = Disable_Interiors, Disable_Underwater;") ||- !rainLensText.contains("version = \"4.3-051-rainlens-v12-dense\";") ||- rainLensText.contains("omw.simulationTime * 0.001") ||- rainLensText.contains("rainHash3051(") ||- rainLensText.contains("teardropLayer051(") ||- rainLensText.count { it == '\n' } < 160) {- throw IOException("OpenMW 0.51 Android OMWFX RainLens payload is invalid")- }-- val wetWorldText = wetWorldUserTarget.readText()- if (!wetWorldText.contains("uniform_float wet_strength_v35 {\n default = 0.92;") ||- !wetWorldText.contains("uniform_float wet_darkening_v35 {\n default = 0.30;") ||- !wetWorldText.contains("uniform_float wet_sheen_v35 {\n default = 0.34;") ||- !wetWorldText.contains("uniform_float puddle_strength_v35 {\n default = 0.62;") ||- !wetWorldText.contains("float rainFactor051()") ||- !wetWorldText.contains("float valueNoise051(vec2 p)") ||- !wetWorldText.contains("vec3 reconstructedWorldNormal051(vec2 uv)") ||- !wetWorldText.contains("float upFacing = smoothstep(0.30, 0.76, abs(n.z));") ||- !wetWorldText.contains("float puddleMask = smoothstep(0.56, 0.76, puddleField)") ||- !wetWorldText.contains("if (base.a < 0.25)") ||- !wetWorldText.contains("flags = Disable_Interiors, Disable_Underwater;") ||- !wetWorldText.contains("version = \"5.1-051-weather-puddles-mali-safe\";") ||- wetWorldText.contains("dFdx(") ||- wetWorldText.contains("dFdy(") ||- wetWorldText.contains("sin(") ||- wetWorldText.count { it == '\n' } < 170) {- throw IOException("OpenMW 0.51 Android OMWFX WetWorld/Puddle payload is invalid")- }-- val waterVertexText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/water.vert"- ).readText()- val waterShaderText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/water.frag"- ).readText()- if (!waterVertexText.contains("OPENMW_ANDROID_051_WATER_PROJECTIVE_SCREEN_COORDS") ||- !waterVertexText.contains("screenPosition = gl_Position;") ||- !waterShaderText.contains("OPENMW_ANDROID_051_WATER_PROJECTIVE_SCREEN_COORDS") ||- !waterShaderText.contains("(screenPosition.xy / screenPosition.w) * 0.5 + 0.5") ||- waterShaderText.contains("gl_FragCoord.xy / screenRes") ||- !waterShaderText.contains("OPENMW_ANDROID_051_WETWORLD_WATER_MASK") ||- !waterShaderText.contains("#if @wetWorldWaterMask") ||- !waterShaderText.contains("gl_FragData[0].a = 0.0;") ||- !waterShaderText.contains("rainCombined(position.xy/1000.0, waterTimer)")) {- throw IOException("Runtime OpenMW 0.51 Android water reflection/ripple shader is missing or stale")- }-- val fullscreenText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/fullscreen_tri.vert"- ).readText()- val shadowCastingText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/shadowcasting.vert"- ).readText()- val shadowVertexText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/shadows_vertex.glsl"- ).readText()- val shadowReceiverText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/shadows_fragment.glsl"- ).readText()- val objectsVertexText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/objects.vert"- ).readText()- val objectsFragmentText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/objects.frag"- ).readText()- val terrainVertexText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/terrain.vert"- ).readText()- val terrainFragmentText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/terrain.frag"- ).readText()- val groundcoverVertexText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/groundcover.vert"- ).readText()- val groundcoverFragmentText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/groundcover.frag"- ).readText()- val bsDefaultVertexText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/bs/default.vert"- ).readText()- val bsDefaultFragmentText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/bs/default.frag"- ).readText()- val bsNoLightingVertexText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/bs/nolighting.vert"- ).readText()- val bsNoLightingFragmentText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/bs/nolighting.frag"- ).readText()- val fogShaderText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/compatibility/fog.glsl"- ).readText()- val coreVertexText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/lib/core/vertex.h.glsl"- ).readText()- val coreFragmentText = File(- Constants.USER_FILE_STORAGE + "/resources/shaders/lib/core/fragment.h.glsl"- ).readText()-- if (fullscreenText.contains("uniform vec2 scaling =") ||- shadowCastingText.contains("uniform bool useDiffuseMapForShadowAlpha =") ||- shadowCastingText.contains("uniform bool alphaTestShadows =")) {- throw IOException("Runtime OpenMW 0.51 compatibility shaders still contain GL4ES-hostile uniform initializers")- }-- // OPENMW_ANDROID_051_GRAZING_SHADOW_PAIR_SYNC_V2- // Both shared shadow includes must come from the same APK payload. A- // fragment-only refresh produces valid shaders individually but an- // invalid program interface and can make terrain/water disappear.- if (!shadowVertexText.contains("OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V1") ||- !shadowReceiverText.contains("OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V1") ||- !shadowVertexText.contains("varying vec2 shadowReceiverPlaneSlope@shadow_texture_unit_index;") ||- !shadowReceiverText.contains("varying vec2 shadowReceiverPlaneSlope@shadow_texture_unit_index;")) {- throw IOException("Runtime OpenMW 0.51 grazing-angle shadow vertex/fragment pair is mismatched")- }-- val shadowQualityProfile = selectedAndroidShadowQualityProfile()- if (shadowQualityProfile.pcfLevel == 4 &&- (!shadowReceiverText.contains("OPENMW_ANDROID_051_CUBIC_PCF_16_V3") ||- !shadowReceiverText.contains("pcfShadow * (1.0 / 81.0)"))) {- throw IOException("Very High shadow quality requires the continuous cubic 4x4 PCF shader")- }-- if (!shadowReceiverText.contains("OPENMW_ANDROID_051_GLES2_MANUAL_SHADOW_COMPARE") ||- !shadowReceiverText.contains("OPENMW_ANDROID_051_GLES2_QUALITY_PCF") ||- !shadowReceiverText.contains("#define OPENMW_ANDROID_SHADOW_PCF_LEVEL ${shadowQualityProfile.pcfLevel}") ||- !shadowReceiverText.contains("#define OPENMW_ANDROID_SHADOW_MAP_RESOLUTION ${shadowQualityProfile.shadowMapResolution}.0") ||- !shadowReceiverText.contains("pcfShadow * 0.25") ||- !shadowReceiverText.contains("pcfShadow * (1.0 / 9.0)") ||- !shadowReceiverText.contains("pcfShadow * (1.0 / 64.0)") ||- !shadowReceiverText.contains("OPENMW_ANDROID_051_GLES2_TENT_PCF") ||- !shadowReceiverText.contains("OPENMW_ANDROID_051_GLES2_RECEIVER_DEPTH_BIAS") ||- !shadowReceiverText.contains("float receiverDepth = max(shadowXYZ.z - 0.00005, 0.0);") ||- shadowReceiverText.contains("uniform sampler2DShadow") ||- shadowReceiverText.contains("shadow2DProj(") ||- !shadowCastingText.contains("OPENMW_ANDROID_051_GLES2_NATIVE_SHADOW_CLIPPING") ||- shadowCastingText.contains("gl_Position.z = clamp(gl_Position.z, -gl_Position.w, gl_Position.w);")) {- throw IOException("Runtime OpenMW 0.51 Android GLES2 shadow compatibility/PCF shader is missing or mismatched")- }-- if (coreVertexText.contains("@link") ||- !coreVertexText.contains("OPENMW_ANDROID_051_GL4ES_CORE_INLINE") ||- coreFragmentText.contains("@link") ||- !coreFragmentText.contains("OPENMW_ANDROID_051_GL4ES_CORE_INLINE")) {- throw IOException("Runtime OpenMW 0.51 core shader helpers are not GL4ES-inline compatible")- }-- if (!objectsVertexText.contains("vec3 viewNormal = normalToView(passNormal);") ||- !objectsFragmentText.contains("vec3 viewNormal = normalToView(normalize(passNormal));") ||- !terrainVertexText.contains("vec3 viewNormal = normalToView(passNormal);") ||- !terrainFragmentText.contains("vec3 viewNormal = normalToView(normalize(passNormal));") ||- !groundcoverVertexText.contains("vec3 viewNormal = normalToView(passNormal);") ||- !bsDefaultVertexText.contains("vec3 viewNormal = normalToView(passNormal);") ||- !bsDefaultFragmentText.contains("vec3 viewNormal = normalToView(normalize(passNormal));") ||- !bsNoLightingVertexText.contains("vec3 viewNormal = normalize((gl_NormalMatrix * gl_Normal).xyz);")) {- throw IOException("Runtime OpenMW 0.51 Android GL4ES normal-transform compatibility shaders are missing")- }-- if (!objectsFragmentText.contains("OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG") ||- !objectsFragmentText.contains("OPENMW_ANDROID_051_LOCALMAP_OBJECT_FOG_BYPASS_V1") ||- !fogShaderText.contains("OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG") ||- !fogShaderText.contains("uniform vec4 omwFogColor") ||- !fogShaderText.contains("uniform float omwFogStart") ||- !fogShaderText.contains("uniform float omwFogEnd")) {- throw IOException("Runtime OpenMW 0.51 Android explicit GL4ES object-fog/LocalMap shaders are missing")- }-- if (!objectsFragmentText.contains("OPENMW_ANDROID_051_GL4ES_DISABLE_ADDITIVE_FOG") ||- objectsFragmentText.contains("#define ADDITIVE_BLENDING") ||- objectsFragmentText.contains("OPENMW_ANDROID_051_SHADER_PREFIX_TAG_OBJECTS") ||- bsDefaultFragmentText.contains("OPENMW_ANDROID_051_SHADER_PREFIX_TAG_BS_DEFAULT") ||- bsNoLightingFragmentText.contains("OPENMW_ANDROID_051_SHADER_PREFIX_TAG_BS_NOLIGHTING") ||- groundcoverFragmentText.contains("OPENMW_ANDROID_051_SHADER_PREFIX_TAG_GROUNDCOVER")) {- throw IOException("Runtime OpenMW 0.51 Android GL4ES additive-fog compatibility shaders are missing or diagnostics remain")- }-- Log.i(- TAG,- "Synced OpenMW 0.51 Android OMWFX release payload: WetWorld, Godrays, Lensflare, Bloom and RainLens"- )- }-- private fun availableOmwfxChain(): String {- val shaderDirectory = File(- Constants.USER_FILE_STORAGE + "/resources/vfs/shaders"- )-- val available = OMWFX_RECOMMENDED_CHAIN.filter { technique ->- File(shaderDirectory, "$technique.omwfx").isFile- }-- if (available.isEmpty()) {- throw IOException(- "OMWFX was selected, but no OMWFX techniques were found in " +- shaderDirectory.absolutePath- )- }-- return available.joinToString(",")- }-- /**- * Updates one INI-style section without touching unrelated settings.- * OpenMW stores user rendering settings in USER_CONFIG/settings.cfg.- */- private fun updateSettingsSection(- file: File,- sectionName: String,- values: Map<String, String?>- ) {- file.parentFile?.mkdirs()-- val lines = if (file.isFile) {- file.readLines().toMutableList()- } else {- mutableListOf()- }-- val header = "[$sectionName]"- var sectionStart = lines.indexOfFirst {- it.trim().equals(header, ignoreCase = true)- }-- if (sectionStart < 0) {- if (lines.isNotEmpty() && lines.last().isNotBlank()) {- lines.add("")- }- lines.add(header)- sectionStart = lines.lastIndex- }-- var sectionEnd = lines.size- for (index in sectionStart + 1 until lines.size) {- val trimmed = lines[index].trim()- if (trimmed.startsWith("[") && trimmed.endsWith("]")) {- sectionEnd = index- break- }- }-- values.forEach { (key, value) ->- var existingIndex = -1-- for (index in sectionStart + 1 until sectionEnd) {- val line = lines[index]- val equals = line.indexOf('=')- if (equals > 0 &&- line.substring(0, equals).trim().equals(key, ignoreCase = true)) {- existingIndex = index- break- }- }-- if (value == null) {- if (existingIndex >= 0) {- lines.removeAt(existingIndex)- sectionEnd -= 1- }- return@forEach- }- val replacement = "$key = $value"- if (existingIndex >= 0) {- lines[existingIndex] = replacement- } else {- lines.add(sectionEnd, replacement)- sectionEnd += 1- }- }-- file.writeText(lines.joinToString("\n").trimEnd() + "\n")- }-- private data class AndroidShadowQualityProfile(- val preferenceValue: String,- val shadowMapResolution: String,- val pcfLevel: Int,- val pcfSamples: Int,- val normalOffsetDistance: String- )-- /**- * Android deliberately keeps exactly one orthographic shadow map because- * multiple maps/cascades caused moving dark regions on the GLES2/GL4ES- * backend. Quality therefore scales both map resolution and a compile-time- * PCF kernel in the receiver shader.- */- private fun selectedAndroidShadowQualityProfile(): AndroidShadowQualityProfile {- return when (prefs.getString("gs_shadow_quality", "medium") ?: "medium") {- "low" -> AndroidShadowQualityProfile("low", "2048", 1, 4, "1.25")- "high" -> AndroidShadowQualityProfile("high", "4096", 3, 16, "1.75")- "very_high" -> AndroidShadowQualityProfile("very_high", "8192", 4, 16, "1.75")- else -> AndroidShadowQualityProfile("medium", "4096", 2, 9, "1.50")- }- }-- /**- * Rewrites only two guarded compile-time constants in the bundled receiver.- * The rest of the shader stays byte-for-byte identical. A hard failure is- * preferable to silently launching with mismatched resolution/PCF offsets.- */- private fun specializeAndroidShadowShader(sourceText: String): String {- if (!sourceText.contains("OPENMW_ANDROID_051_GLES2_QUALITY_PCF")) {- throw IOException("Bundled Android shadow shader has no quality-PCF marker")- }-- val levelPattern = Regex(- "(?m)^#define\\s+OPENMW_ANDROID_SHADOW_PCF_LEVEL\\s+\\d+\\s*$"- )- val resolutionPattern = Regex(- "(?m)^#define\\s+OPENMW_ANDROID_SHADOW_MAP_RESOLUTION\\s+\\d+(?:\\.\\d+)?\\s*$"- )- if (levelPattern.findAll(sourceText).count() != 1 ||- resolutionPattern.findAll(sourceText).count() != 1) {- throw IOException("Bundled Android shadow shader PCF constants are missing or duplicated")- }-- val profile = selectedAndroidShadowQualityProfile()- return sourceText- .replace(levelPattern, "#define OPENMW_ANDROID_SHADOW_PCF_LEVEL ${profile.pcfLevel}")- .replace(- resolutionPattern,- "#define OPENMW_ANDROID_SHADOW_MAP_RESOLUTION ${profile.shadowMapResolution}.0"- )- }-- /**- * Applies the launcher Shadow settings directly to OpenMW's user settings.- *- * OpenMW 0.51 provides the complete shadow-mapping implementation.- * On Android/GL4ES, Quality keeps one stable shadow map and controls its- * resolution plus the GLES2 PCF kernel. Distance controls the maximum shadow range. A 0.75 fade start gives the outer 25 percent of- * the selected range to smoothly fade shadows out (and back in when approaching).- */- private fun applyShadowSettings() {- val qualityProfile = selectedAndroidShadowQualityProfile()- // Android/GL4ES: keep a single shadow map for every quality tier.- // Multi-map cascades (2+ maps) produce moving dark/flickering regions on- // GLES2 devices. Quality scales resolution plus the launcher-specialized- // PCF receiver kernel instead: Low=4 taps, Medium=9 taps, High=16 taps, Very High=16 cubic-weighted taps.- val shadowMapCount = "1"- val shadowMapResolution = qualityProfile.shadowMapResolution-- val maximumShadowDistance = when (prefs.getString("gs_shadow_distance", "medium")) {- "low" -> "2048"- "high" -> "8192"- else -> "4096"- }-- val settingsFile = File(Constants.USER_CONFIG, "settings.cfg")- updateSettingsSection(- settingsFile,- "Shadows",- linkedMapOf(- "enable shadows" to if (prefs.getBoolean("gs_enable_shadows", false)) "true" else "false",- "player shadows" to if (prefs.getBoolean("gs_player_shadows", true)) "true" else "false",- "actor shadows" to if (prefs.getBoolean("gs_actor_shadows", true)) "true" else "false",- "object shadows" to if (prefs.getBoolean("gs_object_shadows", true)) "true" else "false",- "terrain shadows" to if (prefs.getBoolean("gs_terrain_shadows", true)) "true" else "false",- "enable indoor shadows" to if (prefs.getBoolean("gs_indoor_shadows", true)) "true" else "false",- "number of shadow maps" to shadowMapCount,- "shadow map resolution" to shadowMapResolution,- "maximum shadow map distance" to maximumShadowDistance,- "shadow fade start" to "0.75",- // OpenMW's normal-offset mechanism is the least intrusive way to- // suppress receiver self-shadowing (shadow acne). The wider PCF- // kernel used at higher quality samples a larger terrain slope,- // so scale the offset modestly with the selected quality. Keep- // polygon offset at the upstream 0.51 defaults to avoid excess- // Peter Panning on actors and small objects.- "polygon offset factor" to "1.1",- "polygon offset units" to "4.0",- "normal offset distance" to qualityProfile.normalOffsetDistance,- "use front face culling" to "false"- )- )-- Log.i(- TAG,- "Applied OpenMW 0.51 Android shadows: enabled=${prefs.getBoolean("gs_enable_shadows", false)}, " +- "quality=${qualityProfile.preferenceValue} (${shadowMapCount}x${shadowMapResolution}, " +- "pcf=${qualityProfile.pcfSamples} taps), distance=$maximumShadowDistance, fadeStart=0.75, " +- "normalOffset=${qualityProfile.normalOffsetDistance}"- )- }-- /**- * WetWorld runs first so wet roads and procedural puddles feed the optical- * stack. RainLens remains last, and OpenMW 0.51 weather IDs drive both- * weather effects through smooth transitions.- */- private fun applyOpenMw051RuntimeSettings() {- val settingsFile = File(Constants.USER_CONFIG, "settings.cfg")- val selectedShaderPreset = prefs.getString("pref_shadersDir_v2", "none") ?: "none"- val omwfxSelected = selectedShaderPreset == OMWFX_PRESET_VALUE- val postProcessingChain = if (omwfxSelected) {- OMWFX_RECOMMENDED_CHAIN.joinToString(",")- } else {- "adjustments"- }-- if (omwfxSelected) {- val wetWorldFile = File(- Constants.USER_FILE_STORAGE + "/resources/vfs/shaders/wetworld_android_051_weather.omwfx"- )- if (!wetWorldFile.isFile) {- throw IOException(- "OMWFX was selected, but wetworld_android_051_weather.omwfx is missing: " +- wetWorldFile.absolutePath- )- }-- val bloomFile = File(- Constants.USER_FILE_STORAGE + "/resources/vfs/shaders/gateh_bloom051.omwfx"- )- if (!bloomFile.isFile) {- throw IOException(- "OMWFX was selected, but gateh_bloom051.omwfx is missing: " +- bloomFile.absolutePath- )- }-- val lensflareFile = File(- Constants.USER_FILE_STORAGE + "/resources/vfs/shaders/lensflare_android_051_rayocc.omwfx"- )- if (!lensflareFile.isFile) {- throw IOException(- "OMWFX was selected, but lensflare_android_051_rayocc.omwfx is missing: " +- lensflareFile.absolutePath- )- }-- val godraysFile = File(- Constants.USER_FILE_STORAGE + "/resources/vfs/shaders/godrays_android_051_depthfixed_vivid.omwfx"- )- if (!godraysFile.isFile) {- throw IOException(- "OMWFX was selected, but godrays_android_051_depthfixed_vivid.omwfx is missing: " +- godraysFile.absolutePath- )- }-- val rainLensFile = File(- Constants.USER_FILE_STORAGE + "/resources/vfs/shaders/rainlens_android_051_v12_dense.omwfx"- )- if (!rainLensFile.isFile) {- throw IOException(- "OMWFX was selected, but rainlens_android_051_v12_dense.omwfx is missing: " +- rainLensFile.absolutePath- )- }- }-- updateSettingsSection(- settingsFile,- "Post Processing",- linkedMapOf(- // OPENMW_ANDROID_051_POSTPROCESSING_PRESERVE_ENABLED_V1- // enabled is owned by preset transitions/F2, not every launch.- "chain" to postProcessingChain,- "transparent postpass" to if (omwfxSelected) "true" else if (- prefs.getBoolean("gs_transparent_postpass", false)- ) "true" else "false"- )- )-- // Keep the complete device-proven Android shadow selection unchanged.- applyShadowSettings()-- Log.i(- TAG,- "OpenMW 0.51 Android release runtime: shadows=launcher-controlled, " +- "postProcessing=preset/F2-controlled, transparentPostpass=${if (omwfxSelected) "forced-on" else "launcher"}, " +- "chain=$postProcessingChain, omwfx=${if (omwfxSelected) "enabled" else "off"}"- )- }-- // v14.2 OpenMW 0.50 launcher settings- private fun readOpenMwSetting(- file: File,- sectionName: String,- key: String- ): String? {- if (!file.isFile) {- return null- }-- val wantedSection = "[$sectionName]"- var inSection = false-- return try {- for (line in file.readLines()) {- val trimmed = line.trim()-- if (trimmed.startsWith("[") && trimmed.endsWith("]")) {- inSection = trimmed.equals(wantedSection, ignoreCase = true)- continue- }-- if (!inSection || trimmed.isEmpty() ||- trimmed.startsWith("#") || trimmed.startsWith(";")) {- continue- }-- val equals = trimmed.indexOf('=')- if (equals <= 0) {- continue- }-- val foundKey = trimmed.substring(0, equals).trim()- if (foundKey.equals(key, ignoreCase = true)) {- return trimmed.substring(equals + 1)- .substringBefore('#')- .substringBefore(';')- .trim()- }- }-- null- } catch (e: IOException) {- Log.w(TAG, "Could not read OpenMW 0.51 setting [$sectionName] $key", e)- null- }- }-- /**- * Import existing user choices once. If settings.cfg does not contain one- * of the new OpenMW 0.50 settings, use the official 0.50 default.- *- * This means an existing hand-edited settings.cfg is respected when the- * new launcher controls first appear.- */- private fun migrateOpenMw050SettingsPreferences() {- val migrationKey = "migration_openmw050_launcher_settings_v1"- if (prefs.getBoolean(migrationKey, false)) {- return- }-- val settingsFile = File(Constants.USER_CONFIG, "settings.cfg")-- fun readBoolean(section: String, key: String, defaultValue: Boolean): Boolean {- val raw = readOpenMwSetting(settingsFile, section, key) ?: return defaultValue- return when {- raw.equals("true", ignoreCase = true) -> true- raw.equals("false", ignoreCase = true) -> false- else -> defaultValue- }- }-- val controllerMenus =- readBoolean("GUI", "controller menus", false)- val controllerTooltips =- readBoolean("GUI", "controller tooltips", false)- val cameraListener =- readBoolean("Sound", "camera listener", false)-- val dopplerFactor =- readOpenMwSetting(settingsFile, "Sound", "doppler factor")- ?.toDoubleOrNull()- val dopplerEnabled = dopplerFactor?.let { it != 0.0 } ?: true-- prefs.edit()- .putBoolean("pref_omw050_controller_menus", controllerMenus)- .putBoolean("pref_omw050_controller_tooltips", controllerTooltips)- .putBoolean("pref_omw050_doppler", dopplerEnabled)- .putBoolean("pref_omw050_camera_listener", cameraListener)- .putBoolean(migrationKey, true)- .apply()-- Log.i(- TAG,- "Imported OpenMW 0.50 launcher settings: " +- "controllerMenus=$controllerMenus, " +- "controllerTooltips=$controllerTooltips, " +- "doppler=$dopplerEnabled, " +- "cameraListener=$cameraListener"- )- }-- /**- * Import the Android-relevant settings added by OpenMW 0.51. Exact custom- * trigger thresholds from a hand-edited settings.cfg are preserved as one- * pair even if they are not one of the launcher presets.- */- private fun migrateOpenMw051SettingsPreferences() {- val migrationKey = "migration_openmw051_launcher_settings_v1"- if (prefs.getBoolean(migrationKey, false)) {- return- }-- val settingsFile = File(Constants.USER_CONFIG, "settings.cfg")-- val triggerPress = readOpenMwSetting(settingsFile, "GUI", "controller trigger press")- ?.toIntOrNull()- ?.coerceIn(1, 32767)- ?: 30720- val triggerRelease = readOpenMwSetting(settingsFile, "GUI", "controller trigger release")- ?.toIntOrNull()- ?.coerceIn(0, minOf(32766, triggerPress - 1))- ?: minOf(26624, triggerPress - 1)- val groundcoverPointLighting =- !readOpenMwSetting(settingsFile, "Groundcover", "point lighting")- .equals("false", ignoreCase = true)-- prefs.edit()- .putString(- "pref_omw051_controller_trigger_thresholds",- "$triggerPress,$triggerRelease"- )- .putBoolean("gs_groundcover_point_lighting", groundcoverPointLighting)- .putBoolean(migrationKey, true)- .apply()-- Log.i(- TAG,- "Imported OpenMW 0.51 launcher settings: " +- "controllerTrigger=$triggerPress/$triggerRelease, " +- "groundcoverPointLighting=$groundcoverPointLighting"- )- }--- /**- * OPENMW_ANDROID_051_LAUNCHER_AUDIT_V1- *- * OpenMW 0.51 no longer has the CaveBros Groundcover Paging/Instancing- * selector. Groundcover is a native instanced renderer controlled by- * [Groundcover] enabled, density and rendering distance.- *- * Import the old launcher choice once and then retire the legacy string key.- */- private fun migrateOpenMw051GroundcoverPreferences() {- val migrationKey = "migration_openmw051_groundcover_toggle_v1"- if (prefs.getBoolean(migrationKey, false)) {- return- }-- val settingsFile = File(Constants.USER_CONFIG, "settings.cfg")- val legacyMode = prefs.getString("gs_groundcover_handling", "0") ?: "0"- val configuredEnabled = readOpenMwSetting(- settingsFile,- "Groundcover",- "enabled"- )-- val groundcoverEnabled = when {- configuredEnabled.equals("true", ignoreCase = true) -> true- configuredEnabled.equals("false", ignoreCase = true) -> false- else -> legacyMode == "1" || legacyMode == "2"- }-- val groundcoverDensity = readOpenMwSetting(- settingsFile,- "Groundcover",- "density"- )?.toFloatOrNull()?.coerceIn(0.0f, 1.0f) ?: 1.0f-- val groundcoverRenderingDistance = readOpenMwSetting(- settingsFile,- "Groundcover",- "rendering distance"- )?.toFloatOrNull()?.coerceAtLeast(0.0f) ?: 6144.0f-- prefs.edit()- .putBoolean("gs_groundcover_enabled", groundcoverEnabled)- .putString(- "gs_groundcover_density",- String.format(Locale.ROOT, "%.2f", groundcoverDensity)- )- .putString(- "gs_groundcover_rendering_distance",- String.format(Locale.ROOT, "%.0f", groundcoverRenderingDistance)- )- .remove("gs_groundcover_handling")- .putBoolean(migrationKey, true)- .apply()-- Log.i(- TAG,- "Migrated OpenMW 0.51 Groundcover launcher settings: " +- "enabled=$groundcoverEnabled, " +- "density=$groundcoverDensity, " +- "renderingDistance=$groundcoverRenderingDistance"- )- }-- private fun controllerTriggerThresholds(): Pair<Int, Int> {- val encoded = prefs.getString(- "pref_omw051_controller_trigger_thresholds",- "30720,26624"- ) ?: "30720,26624"- val values = encoded.split(',', limit = 2)- val triggerPress = values.getOrNull(0)- ?.trim()- ?.toIntOrNull()- ?.coerceIn(1, 32767)- ?: 30720- val triggerRelease = values.getOrNull(1)- ?.trim()- ?.toIntOrNull()- ?.coerceIn(0, minOf(32766, triggerPress - 1))- ?: minOf(26624, triggerPress - 1)- return triggerPress to triggerRelease- }-- /**- * Write only launcher-owned controller/audio and Groundcover settings to- * settings.cfg. Unrelated settings and OMWFX/F2 edits remain untouched.- */- private fun applyOpenMw051LauncherSettings() {- val settingsFile = File(Constants.USER_CONFIG, "settings.cfg")-- val controllerMenus =- prefs.getBoolean("pref_omw050_controller_menus", false)- val controllerTooltips =- prefs.getBoolean("pref_omw050_controller_tooltips", false)- val dopplerEnabled =- prefs.getBoolean("pref_omw050_doppler", true)- val cameraListener =- prefs.getBoolean("pref_omw050_camera_listener", false)- val (triggerPress, triggerRelease) = controllerTriggerThresholds()- val groundcoverEnabled =- prefs.getBoolean("gs_groundcover_enabled", false)- val groundcoverDensity =- prefs.getString("gs_groundcover_density", "1.00")- ?.toFloatOrNull()- ?.coerceIn(0.0f, 1.0f)- ?: 1.0f- val groundcoverRenderingDistance =- prefs.getString("gs_groundcover_rendering_distance", "6144")- ?.toFloatOrNull()- ?.coerceAtLeast(0.0f)- ?: 6144.0f- val groundcoverPointLighting =- prefs.getBoolean("gs_groundcover_point_lighting", true)-- updateSettingsSection(- settingsFile,- "GUI",- linkedMapOf(- "controller menus" to if (controllerMenus) "true" else "false",- "controller trigger press" to triggerPress.toString(),- "controller trigger release" to triggerRelease.toString(),- "controller tooltips" to if (controllerTooltips) "true" else "false"- )- )-- updateSettingsSection(- settingsFile,- "Sound",- linkedMapOf(- "doppler factor" to if (dopplerEnabled) "0.25" else "0.0",- "camera listener" to if (cameraListener) "true" else "false"- )- )-- updateSettingsSection(- settingsFile,- "Groundcover",- linkedMapOf(- "enabled" to if (groundcoverEnabled) "true" else "false",- "density" to String.format(Locale.ROOT, "%.2f", groundcoverDensity),- "rendering distance" to String.format(- Locale.ROOT,- "%.0f",- groundcoverRenderingDistance- ),- "point lighting" to if (groundcoverPointLighting) "true" else "false"- )- )-- Log.i(- TAG,- "Applied OpenMW 0.51 launcher settings: " +- "controllerMenus=$controllerMenus, " +- "controllerTrigger=$triggerPress/$triggerRelease, " +- "controllerTooltips=$controllerTooltips, " +- "doppler=${if (dopplerEnabled) "0.25" else "0.0"}, " +- "cameraListener=$cameraListener, " +- "groundcoverEnabled=$groundcoverEnabled, " +- "groundcoverDensity=$groundcoverDensity, " +- "groundcoverRenderingDistance=$groundcoverRenderingDistance, " +- "groundcoverPointLighting=$groundcoverPointLighting"- )- }- // Upgrade old installations without exposing the retired preset in the UI.- // Normalize both values so an unchanged OMWFX selection preserves F2 state.- private fun migrateRetiredShaderSelection() {- val editor = prefs.edit()- for (key in listOf("pref_shadersDir_v2", OMWFX_APPLIED_PRESET_KEY)) {- if (prefs.getString(key, null) == "omwfx_plus") {- editor.putString(key, OMWFX_PRESET_VALUE)- }- }- editor.apply()- }-- // Restore only settings for which the retired preset saved a backup.- // Keep the backup until the configuration write succeeds, allowing retries.- private fun restoreRetiredWaterSettings() {- val backupKey = "omwfx_plus_water_backup_v1"- if (!prefs.getBoolean(backupKey, false)) return- val waterKeys = listOf("shader", "refraction")- val restored = waterKeys.associateWith { prefs.getString("${backupKey}_$it", null) }- updateSettingsSection(File(Constants.USER_CONFIG, "settings.cfg"), "Water", restored)- val editor = prefs.edit().remove(backupKey)- waterKeys.forEach { editor.remove("${backupKey}_$it") }- if (!editor.commit()) throw IOException("Could not finish restoring previous water settings")- }-- /**- * `Original`, `Modified` and `Zesterer` remain core-shader presets.- * OMWFX is different: it uses the original core shaders plus OpenMW's- * post-processing pipeline.- *- * Only change the Post Processing enabled state when the launcher preset- * actually changes. Normal relaunches preserve the F2/user enabled choice;- * launcher-owned chain/transparent-postpass values remain runtime-managed.- */- private fun applyShaderPresetSettings() {- restoreRetiredWaterSettings()- val selected = prefs.getString("pref_shadersDir_v2", "none") ?: "none"- val previouslyApplied = prefs.getString(OMWFX_APPLIED_PRESET_KEY, null)-- if (selected == OMWFX_PRESET_VALUE) {- if (previouslyApplied != OMWFX_PRESET_VALUE) {- val chain = availableOmwfxChain()- val settingsFile = File(Constants.USER_CONFIG, "settings.cfg")-- updateSettingsSection(- settingsFile,- "Post Processing",- linkedMapOf(- "enabled" to "true",- "chain" to chain- )- )-- Log.i(TAG, "Enabled OMWFX OpenMW 0.51 preset with weather WetWorld/puddles + Tex_Depth Godrays + CPU-ray Lensflare + calibrated Bloom + weather RainLens: $chain")- }- } else if (previouslyApplied == OMWFX_PRESET_VALUE) {- val settingsFile = File(Constants.USER_CONFIG, "settings.cfg")-- updateSettingsSection(- settingsFile,- "Post Processing",- linkedMapOf(- "enabled" to "false",- "chain" to ""- )- )-- Log.i(TAG, "Disabled OMWFX post-processing preset.")- }-- if (previouslyApplied != selected) {- prefs.edit()- .putString(OMWFX_APPLIED_PRESET_KEY, selected)- .apply()- }- }-- private fun configureDefaultsBin(args: Map<String, String>) {- val defaults = File(Constants.DEFAULTS_BIN).readText()- val decoded = String(android.util.Base64.decode(defaults, android.util.Base64.DEFAULT))- val lines = decoded.lines().map {- for ((k, v) in args) {- if (it.startsWith("$k ="))- return@map "$k = $v"- }- it- }- val data = lines.joinToString("\n")-- val encoded = android.util.Base64.encodeToString(data.toByteArray(), android.util.Base64.NO_WRAP)- File(Constants.DEFAULTS_BIN).writeText(encoded)- }-- private fun startGame() {- // Get scaling factor from config; if invalid or not provided, generate one- var scaling = 0f-- try {- scaling = prefs.getString("pref_uiScaling", "")!!.toFloat()- } catch (e: NumberFormatException) {- // Reset the invalid setting- with(prefs.edit()) {- putString("pref_uiScaling", "")- apply()- }- }-- // set up gamma, if invalid, use the default (1.0)- var gamma = 1.0f- try {- gamma = prefs.getString("pref_gamma", "")!!.toFloat()- } catch (e: NumberFormatException) {- // Reset the invalid setting- with(prefs.edit()) {- putString("pref_gamma", "")- apply()- }- }-- try {- Os.setenv("OPENMW_GAMMA", "%.2f".format(Locale.ROOT, gamma), true)- } catch (e: ErrnoException) {- // can't really do much if that fails...- }-- // If scaling didn't get set, determine it automatically- if (scaling == 0f) {- scaling = MyApp.app.defaultScaling- }-- // Keep the opaque "Loading" screen exclusive to application startup.- // When the user starts the game from the launcher, retain the launcher's- // long-standing compact preparation dialog instead of covering the whole- // screen a second time. Skip-GUI stays dialog-free as before.- val dialog = if (skipGuiDirectLaunchActive) {- null- } else {- ProgressDialog.show(- this,- "",- getString(R.string.launch_preparing_game),- true,- false- )- }-- // Hide Android system chrome after the dialog has been created so screen- // resolution probing sees the actual game viewport, matching the original- // launcher sequence.- hideAndroidControls(this)-- val activity = this-- val th = Thread {- try {- // Reinstall static files if their version mismatches OR if an older- // launcher-only APK left a valid-looking stamp without the runtime payload.- val staticFilesCurrent = try {- val stamp = File(Constants.VERSION_STAMP).readText().trim()- stamp.toInt() == BuildConfig.VERSION_CODE && staticFilesInstalled()- } catch (e: Exception) {- false- }- if (!staticFilesCurrent) {- reinstallStaticFiles()- }-- val inst = GameInstaller(prefs.getString("game_files", "")!!)-- // Regenerate the fallback file in case user edits their Morrowind.ini- if (!inst.convertIni(prefs.getString("pref_encoding", GameInstaller.DEFAULT_CHARSET_PREF)!!)) {- throw IOException("Failed to convert Morrowind.ini into openmw.fallback.cfg")- }-- if (!generateOpenmwCfg()) {- throw IOException("Failed to generate openmw.cfg")- }-- // openmw.cfg: data, resources- file.Writer.write(Constants.OPENMW_CFG, "resources", Constants.RESOURCES)- file.Writer.write(Constants.OPENMW_CFG, "data", "\"" + inst.findDataFiles() + "\"")-- file.Writer.write(Constants.OPENMW_CFG, "encoding", prefs!!.getString("pref_encoding", GameInstaller.DEFAULT_CHARSET_PREF)!!)-- // Keep the writable CaveBros resource mirror in sync with the- // embedded runtime. This also repairs stale/incomplete resource- // directories left behind by older installs.- ensureUserResourcesCurrent()- ensureOpenMw051InternalDataPath()-- // Keep the retained 0.50 controller/audio choices and apply the- // Android-relevant controller/Groundcover additions from 0.51.- // The older SharedPreferences keys intentionally remain stable.- applyOpenMw051LauncherSettings()-- // Apply OMWFX enable/disable only when the launcher preset actually- // changes. Normal relaunches must preserve the F2/user choice.- applyShaderPresetSettings()-- // Android shadows remain launcher-controlled. OMWFX forces the- // transparent postpass for WetWorld and the optical stack.- applyOpenMw051RuntimeSettings()-- // Isowind's look and HUD over the user's settings- applyIsowindSettings()-- //val displayInCutoutArea = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("pref_display_cutout_area", false)- obtainFixedScreenResolution()- val dm = DisplayMetrics()- windowManager.defaultDisplay.getRealMetrics(dm)-- val orientation = this.getResources().getConfiguration().orientation- var displayWidth = 0- var displayHeight = 0-- if (orientation == Configuration.ORIENTATION_PORTRAIT)- {- displayWidth = if(resolutionX == 0) dm.heightPixels else resolutionX- displayHeight = if(resolutionY == 0) dm.widthPixels else resolutionY- }- else- {- displayWidth = if(resolutionX == 0) dm.widthPixels else resolutionX- displayHeight = if(resolutionY == 0) dm.heightPixels else resolutionY- }-- // OPENMW_ANDROID_051_SYNC_LAUNCHER_RESOLUTION_TO_SETTINGS- // defaults.bin provides Android defaults, but an existing user- // settings.cfg has higher precedence. ChromeOS can therefore retain- // a previously persisted physical display size (for example- // 1920x1080) even when the launcher requests 640x360.- //- // Keep OpenMW's real [Video] settings synchronized with the- // launcher-selected logical render size on every game start.- // If no custom resolution is selected, displayWidth/displayHeight- // already contain the physical/native size, so stale custom values- // are also cleared correctly.- updateSettingsSection(- File(Constants.USER_CONFIG, "settings.cfg"),- "Video",- linkedMapOf(- "resolution x" to displayWidth.toString(),- "resolution y" to displayHeight.toString()- )- )-- Log.i(- TAG,- "OpenMW Android launcher resolution synced to settings.cfg: " +- "${displayWidth}x${displayHeight}"- )-- configureDefaultsBin(mapOf(- "scaling factor" to "%.2f".format(Locale.ROOT, scaling),- // android-specific defaults- "viewing distance" to "2048.0",- "camera sensitivity" to "0.4",- "resolution x" to displayWidth.toString(),- "resolution y" to displayHeight.toString(),- // and a bunch of windows positioning- "stats x" to "0.0",- "stats y" to "0.0",- "stats w" to "0.375",- "stats h" to "0.4275",- "spells x" to "0.625",- "spells y" to "0.5725",- "spells w" to "0.375",- "spells h" to "0.4275",- "map x" to "0.625",- "map y" to "0.0",- "map w" to "0.375",- "map h" to "0.5725",- "inventory y" to "0.4275",- "inventory w" to "0.6225",- "inventory h" to "0.5725",- "inventory container x" to "0.0",- "inventory container y" to "0.4275",- "inventory container w" to "0.6225",- "inventory container h" to "0.5725",- "inventory barter x" to "0.0",- "inventory barter y" to "0.4275",- "inventory barter w" to "0.6225",- "inventory barter h" to "0.5725",- "inventory companion x" to "0.0",- "inventory companion y" to "0.4275",- "inventory companion w" to "0.6225",- "inventory companion h" to "0.5725",- "dialogue x" to "0.095",- "dialogue y" to "0.095",- "dialogue w" to "0.810",- "dialogue h" to "0.890",- "console x" to "0.0",- "console y" to "0.0",- "container x" to "0.25",- "container y" to "0.0",- "container w" to "0.75",- "container h" to "0.375",- "barter x" to "0.25",- "barter y" to "0.0",- "barter w" to "0.75",- "barter h" to "0.375",- "companion x" to "0.25",- "companion y" to "0.0",- "companion w" to "0.75",- "companion h" to "0.375",-- // Game Mechanics- "toggle sneak" to if(prefs.getBoolean("gs_toggle_sneak", true)) "true" else "false",- "uncapped damage fatigue" to if(prefs.getBoolean("gs_uncapped_damage_fatigue", false)) "true" else "false",- "rebalance soul gem values" to if(prefs.getBoolean("gs_soulgem_values_rebalance", false)) "true" else "false",- "followers attack on sight" to if(prefs.getBoolean("gs_followers_defend_immediately", false)) "true" else "false",- "barter disposition change is permanent" to if(prefs.getBoolean("gs_permanent_barter_disposition_changes", false)) "true" else "false",- "NPCs avoid collisions" to if(prefs.getBoolean("gs_npc_avoid_collision", false)) "true" else "false",- "only appropriate ammunition bypasses resistance" to if(prefs.getBoolean("gs_only_weapon_bs", false)) "true" else "false",- "normalise race speed" to if(prefs.getBoolean("gs_racial_variation_in_speed_fix", false)) "true" else "false",- "swim upward correction" to if(prefs.getBoolean("gs_swim_upward_correction", false)) "true" else "false",- "can loot during death animation" to if(prefs.getBoolean("gs_can_loot_during_death_animation", true)) "true" else "false",- "enchanted weapons are magical" to if(prefs.getBoolean("gs_enchanted_weapons_are_magical", true)) "true" else "false",- "classic reflected absorb spells behavior" to if(prefs.getBoolean("gs_classic_reflected_absorb_spells_behavior", true)) "true" else "false",- "always allow stealing from knocked out actors" to if(prefs.getBoolean("gs_always_allow_stealing_from_knocked_out_actors", false)) "true" else "false",- "allow actors to follow over water surface" to if(prefs.getBoolean("gs_always_allow_npc_to_follow_over_water_surface", true)) "true" else "false",- "strength influences hand to hand" to prefs.getString("gs_factor_strength_into_hand-to-hand_combat", "0").toString(),-- // Visuals terrain- "object paging min size" to prefs.getString("gs_object_paging_min_size", "0.25").toString(),- "distant terrain" to if(prefs.getBoolean("gs_distant_land", false)) "true" else "false",- "object paging active grid" to if(prefs.getBoolean("gs_active_grid_object_paging", true)) "true" else "false",-- // Visuals graphics- //"antialiasing" to prefs.getString("gs_antialiasing", "0").toString(),- "framerate limit" to prefs.getString("gs_framerate_limit", "60").toString(),-- // Visuals shaders- "auto use object normal maps" to if(prefs.getBoolean("gs_auto_use_object_normal_maps", false)) "true" else "false",- "auto use object specular maps" to if(prefs.getBoolean("gs_auto_use_object_specular_maps", false)) "true" else "false",- "auto use terrain normal maps" to if(prefs.getBoolean("gs_auto_use_terrain_normal_maps", false)) "true" else "false",- "auto use terrain specular maps" to if(prefs.getBoolean("gs_auto_use_terrain_specular_maps", false)) "true" else "false",- "apply lighting to environment maps" to if(prefs.getBoolean("gs_bump_map_local_lighting", false)) "true" else "false",- //"soft particles" to if(prefs.getBoolean("gs_soft_particles", false)) "true" else "false",-- // Visuals fog- "radial fog" to if(prefs.getBoolean("gs_radial_fog", false)) "true" else "false",- "exponential fog" to if(prefs.getBoolean("gs_exponential_fog", false)) "true" else "false",- "sky blending" to if(prefs.getBoolean("gs_sky_blending", false)) "true" else "false",-- // Visuals PostProcessing- "soft particles" to if(prefs.getBoolean("gs_soft_particles", false)) "true" else "false",- "transparent postpass" to if(prefs.getBoolean("gs_transparent_postpass", false)) "true" else "false",-- // Animations- "use magic item animations" to if(prefs.getBoolean("gs_use_magic_item_animation", false)) "true" else "false",- "use additional anim sources" to if(prefs.getBoolean("gs_use_additional_animation_sources", false)) "true" else "false",- "weapon sheathing" to if(prefs.getBoolean("gs_weapon_sheating", false)) "true" else "false",- "shield sheathing" to if(prefs.getBoolean("gs_shield_sheating", false)) "true" else "false",- "graphic herbalism" to if(prefs.getBoolean("gs_enable_graphics_herbalism", true)) "true" else "false",- "smooth movement" to if(prefs.getBoolean("gs_smooth_movement", false)) "true" else "false",- "smooth animation transitions" to if(prefs.getBoolean("gs_smooth_animation_transitions", false)) "true" else "false",- "turn to movement direction" to if(prefs.getBoolean("gs_turn_to_movement_direction", false)) "true" else "false",-- // Animations FirstPerson- "hand inertia" to if(prefs.getBoolean("gs_hand_inertia", false)) "3.0" else "0.0",-- // Interface- "show owned" to prefs!!.getString("gs_show_owned", "0").toString(),- "show effect duration" to if(prefs.getBoolean("gs_show_effect_duration", false)) "true" else "false",- "show enchant chance" to if(prefs.getBoolean("gs_show_enchant_chance", false)) "true" else "false",- "show melee info" to if(prefs.getBoolean("gs_show_melee_info", false)) "true" else "false",- "show projectile damage" to if(prefs.getBoolean("gs_show_projectile_damage", false)) "true" else "false",- "color topic enable" to if(prefs.getBoolean("gs_change_dialogue_topic_color", false)) "true" else "false",- "stretch menu background" to if(prefs.getBoolean("gs_stretch_menu_background", false)) "true" else "false",- "allow zooming" to if(prefs.getBoolean("gs_can_zoom_on_maps", false)) "true" else "false",-- // Bug Fixes- "prevent merchant equipping" to if(prefs.getBoolean("gs_merchant_equipping_fix", false)) "true" else "false",- "trainers training skills based on base skill" to if(prefs.getBoolean("gs_trainers_bs", false)) "true" else "false",-- // Miscellaneous- "max quicksaves" to prefs.getString("gs_maximum_quicksaves", "1").toString(),-- // Engine Settings- "enable" to if(prefs.getBoolean("gs_build_navmesh", true)) "true" else "false",- "write to navmeshdb" to if(prefs.getBoolean("gs_write_navmesh", true)) "true" else "false",- "async nav mesh updater threads" to prefs.getString("gs_navmesh_threads", "1").toString(),- "async num threads" to prefs.getString("gs_physics_threads", "1").toString(),- "preload num threads" to ((prefs.getString("gs_preload_threads", "2")- ?.toIntOrNull() ?: 2).coerceIn(1, 3)).toString()-- ))-- runOnUiThread {- obtainFixedScreenResolution()- dialog?.dismiss()- runGame()- }- } catch (e: Exception) {- Log.e(TAG, "Failed to prepare OpenMW launch.", e)- runOnUiThread {- revealLauncherAfterSkipGui("launch preparation failed")- dialog?.dismiss()- AlertDialog.Builder(activity)- .setTitle(R.string.launch_failed_title)- .setMessage(e.message ?: getString(R.string.launch_failed_unknown))- .setPositiveButton(android.R.string.ok) { _, _ -> }- .show()- }- }- }- th.start()- }-- // v14.1 launcher popup/about polish- private data class AboutLicenseSection(- val title: String,- val body: String- )-- // Cache the small section index once. Individual licence bodies are still- // inflated lazily only when the user expands a section in About.- private var cachedThirdPartyLicenseSections: List<AboutLicenseSection>? = null-- private fun launcherDp(value: Int): Int =- (value * resources.displayMetrics.density + 0.5f).toInt()-- private fun launcherThemeColor(attribute: Int, fallback: Int): Int {- val value = android.util.TypedValue()- if (!theme.resolveAttribute(attribute, value, true)) {- return fallback- }-- if (value.resourceId != 0) {- return try {- androidx.appcompat.content.res.AppCompatResources- .getColorStateList(this, value.resourceId)- ?.defaultColor ?: fallback- } catch (_: Exception) {- fallback- }- }-- return value.data- }-- /**- * The stock AppCompat overflow popup can overlap its three-dot anchor.- * Install a launcher-owned overflow button instead so the popup is always- * positioned BELOW the icon and can have a proper section heading.- */- private fun installUserConfigurationOverflow(- toolbar: androidx.appcompat.widget.Toolbar- ) {- val overflow = android.widget.TextView(this).apply {- text = "\u22ee"- textSize = 29f- gravity = android.view.Gravity.CENTER- contentDescription = getString(R.string.user_configuration)- isClickable = true- isFocusable = true- setTextColor(- launcherThemeColor(- android.R.attr.textColorPrimary,- android.graphics.Color.WHITE- )- )-- val selectable = android.util.TypedValue()- if (theme.resolveAttribute(- android.R.attr.selectableItemBackgroundBorderless,- selectable,- true- ) && selectable.resourceId != 0- ) {- setBackgroundResource(selectable.resourceId)- }-- layoutParams = androidx.appcompat.widget.Toolbar.LayoutParams(- launcherDp(48),- android.view.ViewGroup.LayoutParams.MATCH_PARENT,- android.view.Gravity.END- )-- setOnClickListener { anchor ->- showUserConfigurationPopup(anchor)- }- }-- toolbar.addView(overflow)- }-- private fun launcherPopupRow(- text: String,- primaryColor: Int- ): android.widget.TextView =- android.widget.TextView(this).apply {- this.text = text- textSize = 16f- gravity = android.view.Gravity.CENTER_VERTICAL- setTextColor(primaryColor)- setPadding(launcherDp(18), 0, launcherDp(18), 0)- minHeight = launcherDp(48)- isClickable = true- isFocusable = true-- val selectable = android.util.TypedValue()- if (theme.resolveAttribute(- android.R.attr.selectableItemBackground,- selectable,- true- ) && selectable.resourceId != 0- ) {- setBackgroundResource(selectable.resourceId)- }- }-- private fun showLauncherPopup(- anchor: android.view.View,- title: String,- entries: List<Pair<String, () -> Unit>>- ) {- val oledTheme = isOledLauncherTheme()- val backgroundColor = if (oledTheme) {- android.graphics.Color.BLACK- } else {- launcherThemeColor(- android.R.attr.colorBackground,- android.graphics.Color.WHITE- )- }- val primaryColor = if (oledTheme) {- android.graphics.Color.WHITE- } else {- launcherThemeColor(- android.R.attr.textColorPrimary,- android.graphics.Color.BLACK- )- }- val secondaryColor = if (oledTheme) {- android.graphics.Color.rgb(176, 176, 176)- } else {- launcherThemeColor(- android.R.attr.textColorSecondary,- primaryColor- )- }-- val container = android.widget.LinearLayout(this).apply {- orientation = android.widget.LinearLayout.VERTICAL- setPadding(0, launcherDp(6), 0, launcherDp(6))-- background = android.graphics.drawable.GradientDrawable().apply {- setColor(backgroundColor)- cornerRadius = launcherDp(5).toFloat()- }- }-- val heading = android.widget.TextView(this).apply {- text = title- textSize = 13f- typeface = android.graphics.Typeface.DEFAULT_BOLD- setTextColor(secondaryColor)- gravity = android.view.Gravity.CENTER_VERTICAL- setPadding(launcherDp(18), launcherDp(8), launcherDp(18), launcherDp(6))- }- container.addView(- heading,- android.widget.LinearLayout.LayoutParams(- android.view.ViewGroup.LayoutParams.MATCH_PARENT,- android.view.ViewGroup.LayoutParams.WRAP_CONTENT- )- )-- val divider = android.view.View(this).apply {- setBackgroundColor(secondaryColor)- alpha = 0.18f- }- container.addView(- divider,- android.widget.LinearLayout.LayoutParams(- android.view.ViewGroup.LayoutParams.MATCH_PARENT,- launcherDp(1)- )- )-- val popupWidth = launcherDp(286)- lateinit var popup: android.widget.PopupWindow-- entries.forEach { entry ->- val row = launcherPopupRow(entry.first, primaryColor)- row.setOnClickListener {- popup.dismiss()- entry.second.invoke()- }- container.addView(- row,- android.widget.LinearLayout.LayoutParams(- android.view.ViewGroup.LayoutParams.MATCH_PARENT,- android.view.ViewGroup.LayoutParams.WRAP_CONTENT- )- )- }-- popup = android.widget.PopupWindow(- container,- popupWidth,- android.view.ViewGroup.LayoutParams.WRAP_CONTENT,- true- ).apply {- isOutsideTouchable = true- setBackgroundDrawable(- android.graphics.drawable.ColorDrawable(- android.graphics.Color.TRANSPARENT- )- )- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {- elevation = launcherDp(8).toFloat()- }- }-- // Right-align with the three-dot anchor while keeping the popup entirely- // below it. showAsDropDown(), unlike the standard overflow implementation,- // does not intentionally overlap the anchor.- val xOffset = anchor.width - popupWidth- popup.showAsDropDown(anchor, xOffset, launcherDp(2))- }-- private fun showUserConfigurationPopup(anchor: android.view.View) {- val entries = mutableListOf<Pair<String, () -> Unit>>()-- entries += getString(R.string.action_reset_user_config) to {- removeUserConfig()- android.widget.Toast.makeText(- this,- getString(R.string.user_config_was_reset),- android.widget.Toast.LENGTH_SHORT- ).show()- }-- entries += getString(R.string.action_reset_user_resources) to {- removeStaticFiles()- removeResourceFiles()- android.widget.Toast.makeText(- this,- getString(R.string.user_resources_was_reset),- android.widget.Toast.LENGTH_SHORT- ).show()- }-- entries += getString(R.string.action_theme_submenu) to {- showThemePopup(anchor)- }-- entries += getString(R.string.action_about) to {- showAboutDialog()- }-- if (MyApp.haveBugsnagApiKey) {- entries += getString(R.string.action_bugsnag_consent) to {- askBugsnagConsent()- }- }-- showLauncherPopup(anchor, getString(R.string.user_configuration), entries)- }-- private fun setLauncherTheme(- preferenceValue: Int,- nightMode: Int,- displayNameRes: Int- ) {- val previousPreference = prefs.getInt(getString(R.string.theme), 0)- prefs.edit()- .putInt(getString(R.string.theme), preferenceValue)- .apply()-- if (previousPreference != preferenceValue) {- if (androidx.appcompat.app.AppCompatDelegate.getDefaultNightMode() == nightMode) {- // Dark and Black/OLED both use MODE_NIGHT_YES, so switching- // between them otherwise would not recreate the launcher.- recreate()- } else {- androidx.appcompat.app.AppCompatDelegate.setDefaultNightMode(nightMode)- }- }-- android.widget.Toast.makeText(- this,- getString(R.string.theme_set_to, getString(displayNameRes)),- android.widget.Toast.LENGTH_SHORT- ).show()- }-- private fun showThemePopup(anchor: android.view.View) {- showLauncherPopup(- anchor,- getString(R.string.action_theme),- listOf(- getString(R.string.action_theme_system) to {- setLauncherTheme(- 0,- androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM,- R.string.action_theme_system- )- },- getString(R.string.action_theme_light) to {- setLauncherTheme(- 1,- androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO,- R.string.action_theme_light- )- },- getString(R.string.action_theme_dark) to {- setLauncherTheme(- 2,- androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES,- R.string.action_theme_dark- )- },- getString(R.string.action_theme_oled) to {- setLauncherTheme(- 3,- androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES,- R.string.action_theme_oled- )- }- )- )- }-- /**- * 3rdparty-licenses.txt contains concatenated licence texts. Most top-level- * package headings use the common:- *- * Package name- * ------------- *- * format. Convert those package blocks into collapsed accordion sections.- * If a future generated licence file does not use that format, keep all text- * accessible in one fallback section rather than dropping anything.- */- private fun parseThirdPartyLicenses(text: String): List<AboutLicenseSection> {- val normalized = text.replace("\r\n", "\n").replace('\r', '\n')- val lines = normalized.split('\n')- val sections = mutableListOf<AboutLicenseSection>()- val body = mutableListOf<String>()- var title: String? = null-- fun flush() {- val cleaned = body.joinToString("\n").trim()- if (cleaned.isNotEmpty()) {- sections += AboutLicenseSection(- title ?: getString(R.string.third_party_notices),- cleaned- )- }- body.clear()- }-- var index = 0- while (index < lines.size) {- val line = lines[index]- val trimmed = line.trim()-- // "===== Name =====" style headings.- val decorated = Regex("""^[=-]{3,}\s*(.+?)\s*[=-]{3,}$""")- .matchEntire(trimmed)- if (decorated != null) {- flush()- val parsedTitle = decorated.groupValues[1].trim()- // A long dashed separator in the generated licence bundle is- // parsed as a single "-" by the generic decorated-heading regex.- // Keep it as its own licence section with a meaningful heading.- title = if (parsedTitle == "-") "GNU General Public License" else parsedTitle- index += 1- continue- }-- // "Name" followed by "-----" or "=====".- if (trimmed.isNotEmpty() && index + 1 < lines.size) {- val underline = lines[index + 1].trim()- if (underline.matches(Regex("""^[=-]{3,}$"""))) {- flush()- title = trimmed- index += 2- continue- }- }-- body += line- index += 1- }-- flush()-- if (sections.isEmpty() && normalized.isNotBlank()) {- return listOf(- AboutLicenseSection(- getString(R.string.third_party_notices),- normalized.trim()- )- )- }-- return sections- }-- private fun getThirdPartyLicenseSections(): List<AboutLicenseSection> {- cachedThirdPartyLicenseSections?.let { return it }-- val licenseText = assets.open("libopenmw/3rdparty-licenses.txt")- .bufferedReader()- .use { it.readText() }- return parseThirdPartyLicenses(licenseText).also {- cachedThirdPartyLicenseSections = it- }- }-- private fun showAboutDialog() {- val licenseSections = getThirdPartyLicenseSections()-- val primaryColor = launcherThemeColor(- android.R.attr.textColorPrimary,- android.graphics.Color.BLACK- )- val secondaryColor = launcherThemeColor(- android.R.attr.textColorSecondary,- primaryColor- )-- val content = android.widget.LinearLayout(this).apply {- orientation = android.widget.LinearLayout.VERTICAL- setPadding(- launcherDp(24),- launcherDp(4),- launcherDp(24),- launcherDp(12)- )- }-- val versionInfo = android.widget.TextView(this).apply {- text = "ARM64 \u2022 v${BuildConfig.VERSION_NAME}"- textSize = 16f- typeface = android.graphics.Typeface.DEFAULT_BOLD- gravity = android.view.Gravity.START- textAlignment = android.view.View.TEXT_ALIGNMENT_VIEW_START- setTextColor(primaryColor)- setPadding(0, launcherDp(8), 0, 0)- }- content.addView(versionInfo)-- val portInfo = android.widget.TextView(this).apply {- text = getString(R.string.about_port_info)- textSize = 16f- gravity = android.view.Gravity.START- textAlignment = android.view.View.TEXT_ALIGNMENT_VIEW_START- setTextColor(primaryColor)- setPadding(0, launcherDp(8), 0, launcherDp(14))- }- content.addView(portInfo)-- licenseSections.forEach { section ->- var bodyView: android.widget.TextView? = null- var expanded = false-- val header = launcherPopupRow(- "\u25b8 ${section.title}",- primaryColor- ).apply {- typeface = android.graphics.Typeface.DEFAULT_BOLD- setPadding(launcherDp(4), 0, launcherDp(4), 0)- }-- header.setOnClickListener {- val body = bodyView ?: android.widget.TextView(this).apply {- text = section.body- textSize = 13f- setTextColor(secondaryColor)- setPadding(- launcherDp(12),- launcherDp(2),- launcherDp(8),- launcherDp(14)- )- visibility = android.view.View.GONE- setTextIsSelectable(true)- }.also { created ->- bodyView = created- content.addView(created, content.indexOfChild(header) + 1)- }-- expanded = !expanded- body.visibility =- if (expanded) android.view.View.VISIBLE else android.view.View.GONE- header.text =- (if (expanded) "\u25be " else "\u25b8 ") + section.title- }-- content.addView(header)- }-- val scroll = android.widget.ScrollView(this).apply {- isFillViewport = true- addView(- content,- android.widget.FrameLayout.LayoutParams(- android.view.ViewGroup.LayoutParams.MATCH_PARENT,- android.view.ViewGroup.LayoutParams.WRAP_CONTENT- )- )- }-- android.app.AlertDialog.Builder(this)- .setTitle(getString(R.string.about_title))- .setView(scroll)- .setPositiveButton(android.R.string.ok) { _, _ -> }- .show()- }- override fun onPrepareOptionsMenu(menu: Menu): Boolean {- // The launcher owns its overflow popup so it can stay below the three-dot anchor.- menu.clear()- return true- }-- override fun onOptionsItemSelected(item: MenuItem): Boolean {- return when (item.itemId) {- R.id.action_reset_user_config -> {- removeUserConfig()- Toast.makeText(this, getString(R.string.user_config_was_reset), Toast.LENGTH_SHORT).show()- true- }-- R.id.action_reset_user_resources -> {- removeStaticFiles()- removeResourceFiles()- Toast.makeText(this, getString(R.string.user_resources_was_reset), Toast.LENGTH_SHORT).show()- true- }-- R.id.action_theme_system -> {- with (prefs.edit()) {- putInt(getString(R.string.theme), 0)- apply()- }-- AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)-- Toast.makeText(this, getString(R.string.theme_set_to, getString(R.string.action_theme_system)), Toast.LENGTH_SHORT).show()- true- }-- R.id.action_theme_light -> {- with (prefs.edit()) {- putInt(getString(R.string.theme), 1)- apply()- }-- AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)-- Toast.makeText(this, getString(R.string.theme_set_to, getString(R.string.action_theme_light)), Toast.LENGTH_SHORT).show()- true- }-- R.id.action_theme_dark -> {- setLauncherTheme(- 2,- AppCompatDelegate.MODE_NIGHT_YES,- R.string.action_theme_dark- )- true- }-- R.id.action_theme_oled -> {- setLauncherTheme(- 3,- AppCompatDelegate.MODE_NIGHT_YES,- R.string.action_theme_oled- )- true- }-- R.id.action_about -> {- showAboutDialog()- true- }-- R.id.action_bugsnag_consent -> {- askBugsnagConsent()- true- }-- else -> super.onOptionsItemSelected(item)- }- }-- companion object {- private const val TAG = "OpenMW-Launcher"-- // v11.x shared custom-resolution state. MouseCursor and GameActivity- // both reference these fields, so they must remain in this companion.- var resolutionX = 0- var resolutionY = 0-- // OpenMW 0.51 Android OMWFX launcher preset state.- private const val OMWFX_PRESET_VALUE = "omwfx"- // Historical migration key: keep it stable so existing installations- // are not reset to the OMWFX preset during release consolidation.- private const val OMWFX_APPLIED_PRESET_KEY =- "launcher_shader_preset_applied_v35_openmw051_gate_h5a"-- // Final Android/GL4ES chain. WetWorld runs first so its wet surfaces- // feed the optical stack. RainLens remains last.- private val OMWFX_RECOMMENDED_CHAIN = listOf(- "wetworld_android_051_weather",- "godrays_android_051_depthfixed_vivid",- "lensflare_android_051_rayocc",- "gateh_bloom051",- "rainlens_android_051_v12_dense"- )- }-}diff --git a/android/app/src/main/java/ui/activity/ModsActivity.kt b/android/app/src/main/java/ui/activity/ModsActivity.ktdeleted file mode 100644index d0dd99c..0000000--- a/android/app/src/main/java/ui/activity/ModsActivity.kt+++ /dev/null@@ -1,134 +0,0 @@-/*- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.activity--import android.os.Bundle-import android.view.MenuItem-import android.widget.ViewFlipper-import androidx.appcompat.app.AppCompatActivity-import androidx.recyclerview.widget.ItemTouchHelper-import androidx.recyclerview.widget.LinearLayoutManager-import androidx.recyclerview.widget.RecyclerView-import com.google.android.material.tabs.TabLayout-import com.libopenmw.openmw.R-import mods.ModMoveCallback-import mods.ModType-import mods.ModsAdapter-import mods.ModsCollection-import mods.ModsPaths-import mods.database--class ModsActivity : AppCompatActivity() {-- val mPluginAdapter = ModsAdapter()- val mResourceAdapter = ModsAdapter()- val mDirAdapter = ModsAdapter()- val mGroundcoverAdapter = ModsAdapter()-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)- setContentView(R.layout.activity_mods)-- setSupportActionBar(findViewById(R.id.mods_toolbar))- supportActionBar?.setDisplayHomeAsUpEnabled(true)-- val tabLayout = findViewById<TabLayout>(R.id.tabLayout)- val flipper = findViewById<ViewFlipper>(R.id.flipper)-- tabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {- override fun onTabSelected(tab: TabLayout.Tab) {- // Persist directory changes before rebuilding the other tabs.- if (flipper.displayedChild == 2) {- mDirAdapter.collection.update()- updateModList()- mPluginAdapter.notifyDataSetChanged()- mResourceAdapter.notifyDataSetChanged()- mGroundcoverAdapter.notifyDataSetChanged()- }-- flipper.displayedChild = tab.position- }-- override fun onTabUnselected(tab: TabLayout.Tab) = Unit- override fun onTabReselected(tab: TabLayout.Tab) = Unit- })-- setupModList(findViewById(R.id.list_mods), ModType.Plugin)- setupModList(findViewById(R.id.list_resources), ModType.Resource)- setupModList(findViewById(R.id.list_dirs), ModType.Dir)- setupModList(findViewById(R.id.list_groundcovers), ModType.Groundcover)-- updateModList()- }-- override fun onDestroy() {- // Persist each list before the Activity goes away. updateModList() must- // not replace collections before dirty entries have been written.- mPluginAdapter.collection.update()- mResourceAdapter.collection.update()- mDirAdapter.collection.update()- mGroundcoverAdapter.collection.update()- super.onDestroy()- }-- /** Rebuilds mod lists from the base Data Files directory plus enabled data dirs. */- private fun updateModList() {- val dataFilesList = ModsPaths.allDataDirectories(this)- mPluginAdapter.collection = ModsCollection(ModType.Plugin, dataFilesList, database)- mResourceAdapter.collection = ModsCollection(ModType.Resource, dataFilesList, database)- mGroundcoverAdapter.collection = ModsCollection(ModType.Groundcover, dataFilesList, database)- }-- /** Connects a RecyclerView to the corresponding mod collection. */- private fun setupModList(list: RecyclerView, type: ModType) {- val dataFilesList = if (type == ModType.Dir) {- ModsPaths.directoryRoots(this)- } else {- ModsPaths.allDataDirectories(this)- }-- list.layoutManager = LinearLayoutManager(this).apply {- orientation = RecyclerView.VERTICAL- }-- val adapter = when (type) {- ModType.Plugin -> mPluginAdapter- ModType.Resource -> mResourceAdapter- ModType.Dir -> mDirAdapter- ModType.Groundcover -> mGroundcoverAdapter- }-- adapter.collection = ModsCollection(type, dataFilesList, database)- val touchHelper = ItemTouchHelper(ModMoveCallback(adapter))- touchHelper.attachToRecyclerView(list)- adapter.touchHelper = touchHelper- list.adapter = adapter- }-- override fun onOptionsItemSelected(item: MenuItem): Boolean {- return when (item.itemId) {- android.R.id.home -> {- onBackPressed()- true- }- else -> super.onOptionsItemSelected(item)- }- }-}diff --git a/android/app/src/main/java/ui/activity/SettingsActivity.kt b/android/app/src/main/java/ui/activity/SettingsActivity.ktdeleted file mode 100644index b4eec73..0000000--- a/android/app/src/main/java/ui/activity/SettingsActivity.kt+++ /dev/null@@ -1,668 +0,0 @@-/*- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.activity--import com.libopenmw.openmw.R--import androidx.appcompat.app.AppCompatActivity-import android.os.Bundle-import android.app.AlertDialog-import com.google.android.material.tabs.TabLayout-import androidx.recyclerview.widget.RecyclerView-import androidx.recyclerview.widget.ItemTouchHelper-import androidx.recyclerview.widget.LinearLayoutManager-import file.GameInstaller-import android.view.MenuItem-import android.view.Gravity-import android.widget.LinearLayout-import android.widget.SeekBar-import android.widget.TextView-import java.io.File-import java.util.Locale-import kotlin.math.round---import android.content.SharedPreferences-import android.content.SharedPreferences.OnSharedPreferenceChangeListener-import android.content.Intent-import android.preference.EditTextPreference-import android.preference.Preference-import android.preference.ListPreference-import android.preference.PreferenceFragment-import android.preference.PreferenceGroup--class FragmentGameSettings : PreferenceFragment() {- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)-- addPreferencesFromResource(R.xml.game_settings)-- // Every entry on this page opens a child settings screen.- listOf(- "game_settings_game_mechanics",- "game_settings_visuals",- "game_settings_shadows",- "game_settings_animations",- "game_settings_interface",- "game_settings_engine"- ).forEach { key ->- findPreference(key)?.widgetLayoutResource = R.layout.preference_widget_chevron- }-/*- findPreference("game_settings_game_mechanics").setOnPreferenceClickListener {- getPreferenceScreen().removeAll()- addPreferencesFromResource(R.xml.gs_game_mechanics)- true- }-- findPreference("game_settings_visuals").setOnPreferenceClickListener {- getPreferenceScreen().removeAll()- addPreferencesFromResource(R.xml.gs_visuals)- true- }-*/- findPreference("game_settings_game_mechanics").setOnPreferenceClickListener {- val intent = Intent(activity, Game_Mechanics_SettingsActivity::class.java)- this.startActivity(intent)- true- }-- findPreference("game_settings_visuals").setOnPreferenceClickListener {- val intent = Intent(activity, Visuals_SettingsActivity::class.java)- this.startActivity(intent)- true- }-- findPreference("game_settings_shadows").setOnPreferenceClickListener {- val intent = Intent(activity, Shadows_SettingsActivity::class.java)- this.startActivity(intent)- true- }-- findPreference("game_settings_animations").setOnPreferenceClickListener {- val intent = Intent(activity, Animations_SettingsActivity::class.java)- this.startActivity(intent)- true- }-- findPreference("game_settings_interface").setOnPreferenceClickListener {- val intent = Intent(activity, Interface_SettingsActivity::class.java)- this.startActivity(intent)- true- }-- findPreference("game_settings_engine").setOnPreferenceClickListener {- val intent = Intent(activity, Engine_SettingsActivity::class.java)- this.startActivity(intent)- true- }- }-}--class SettingsActivity : AppCompatActivity() {-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)- setContentView(R.layout.activity_settings)-- setSupportActionBar(findViewById(R.id.settings_toolbar))-- // Enable the "back" icon in the action bar- supportActionBar?.setDisplayHomeAsUpEnabled(true)-/*- // Switch tabs between categories- settings_tabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {- override fun onTabSelected(tab: TabLayout.Tab) {- settings_flipper.displayedChild = tab.position- }-- override fun onTabUnselected(tab: TabLayout.Tab) {- }-- override fun onTabReselected(tab: TabLayout.Tab) {- }- })-*/-- if (savedInstanceState == null) {- fragmentManager.beginTransaction()- .replace(R.id.settings_frame, FragmentGameSettings())- .commit()- }- }-- /**- * Makes the "back" icon in the actionbar perform the back operation- */- override fun onOptionsItemSelected(item: MenuItem): Boolean {- return when (item.itemId) {- android.R.id.home -> {- onBackPressed()- true- }-- else -> super.onOptionsItemSelected(item)- }- }-}--class FragmentGameSettingsPage : PreferenceFragment(), OnSharedPreferenceChangeListener {- private var pageResource: Int = 0-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)-- pageResource = arguments?.getInt(ARG_PAGE_RESOURCE, 0) ?: 0- if (pageResource == 0) {- throw IllegalStateException("Missing settings page resource")- }-- addPreferencesFromResource(pageResource)- preferenceScreen.sharedPreferences.registerOnSharedPreferenceChangeListener(this)-- if (pageResource == R.xml.gs_game_mechanics) {- findPreference("gs_always_allow_npc_to_follow_over_water_surface").isEnabled =- preferenceScreen.sharedPreferences.getBoolean("gs_build_navmesh", true)-- val quicksavePreference = findPreference("gs_maximum_quicksaves") as ListPreference- val storedQuicksaves = preferenceScreen.sharedPreferences- .getString("gs_maximum_quicksaves", "1")- ?.toIntOrNull() ?: 1- val normalizedQuicksaves = storedQuicksaves.coerceIn(1, 3).toString()- if (quicksavePreference.value != normalizedQuicksaves)- quicksavePreference.value = normalizedQuicksaves- }-- if (pageResource == R.xml.gs_visuals) {- normalizeFloatPreference("gs_object_paging_min_size", 0.01f, 1.0f, 0.25f, 2)- findPreference("gs_object_paging_min_size").setOnPreferenceClickListener {- showSteppedSliderPreference(- key = "gs_object_paging_min_size",- title = findPreference("gs_object_paging_min_size").title.toString(),- minimum = 0.01f,- maximum = 1.0f,- step = 0.01f,- defaultValue = 0.25f,- decimals = 2- )- true- }- }-- if (pageResource == R.xml.gs_animations)- updatePreference(preferenceScreen.sharedPreferences, "gs_use_additional_animation_sources")-- if (pageResource == R.xml.gs_engine) {- // OPENMW_ANDROID_051_LAUNCHER_AUDIT_V1- updatePreference(preferenceScreen.sharedPreferences, "gs_build_navmesh")-- normalizeFloatPreference("gs_groundcover_density", 0.0f, 1.0f, 1.0f, 2)- normalizeFloatPreference(- "gs_groundcover_rendering_distance",- 1024.0f,- 8192.0f,- 6144.0f,- 0- )-- findPreference("gs_groundcover_density").setOnPreferenceClickListener {- showSteppedSliderPreference(- key = "gs_groundcover_density",- title = findPreference("gs_groundcover_density").title.toString(),- minimum = 0.0f,- maximum = 1.0f,- step = 0.05f,- defaultValue = 1.0f,- decimals = 2- )- true- }-- findPreference("gs_groundcover_rendering_distance").setOnPreferenceClickListener {- showSteppedSliderPreference(- key = "gs_groundcover_rendering_distance",- title = findPreference("gs_groundcover_rendering_distance").title.toString(),- minimum = 1024.0f,- maximum = 8192.0f,- step = 256.0f,- defaultValue = 6144.0f,- decimals = 0- )- true- }-- normalizeIntegerPreference("gs_navmesh_threads", 1, 8, 1)- normalizeIntegerPreference("gs_physics_threads", 1, 8, 1)- normalizeIntegerPreference("gs_preload_threads", 1, 3, 2)-- listOf(- "gs_navmesh_threads",- "gs_physics_threads"- ).forEach { key ->- findPreference(key).setOnPreferenceClickListener {- showSteppedSliderPreference(- key = key,- title = findPreference(key).title.toString(),- minimum = 1.0f,- maximum = 8.0f,- step = 1.0f,- defaultValue = 1.0f,- decimals = 0- )- true- }- }-- findPreference("gs_preload_threads").setOnPreferenceClickListener {- showSteppedSliderPreference(- key = "gs_preload_threads",- title = findPreference("gs_preload_threads").title.toString(),- minimum = 1.0f,- maximum = 3.0f,- step = 1.0f,- defaultValue = 2.0f,- decimals = 0- )- true- }- }- }-- private fun dp(value: Int): Int =- (value * resources.displayMetrics.density + 0.5f).toInt()-- private fun normalizeIntegerPreference(key: String, minimum: Int, maximum: Int, defaultValue: Int) {- val sharedPreferences = preferenceScreen.sharedPreferences- val current = sharedPreferences.getString(key, null)?.toIntOrNull() ?: defaultValue- val normalized = current.coerceIn(minimum, maximum).toString()- if (sharedPreferences.getString(key, null) != normalized)- sharedPreferences.edit().putString(key, normalized).apply()- }-- private fun normalizeFloatPreference(- key: String,- minimum: Float,- maximum: Float,- defaultValue: Float,- decimals: Int- ) {- val sharedPreferences = preferenceScreen.sharedPreferences- val current = sharedPreferences.getString(key, null)?.toFloatOrNull() ?: defaultValue- val normalizedValue = current.coerceIn(minimum, maximum)- val normalized = String.format(Locale.ROOT, "%.${decimals}f", normalizedValue)- if (sharedPreferences.getString(key, null) != normalized)- sharedPreferences.edit().putString(key, normalized).apply()- }-- private fun showSteppedSliderPreference(- key: String,- title: String,- minimum: Float,- maximum: Float,- step: Float,- defaultValue: Float,- decimals: Int- ) {- val sharedPreferences = preferenceScreen.sharedPreferences- val current = sharedPreferences.getString(key, null)- ?.toFloatOrNull()- ?.coerceIn(minimum, maximum)- ?: defaultValue.coerceIn(minimum, maximum)-- val steps = round((maximum - minimum) / step).toInt()- val initialProgress = round((current - minimum) / step)- .toInt()- .coerceIn(0, steps)-- fun valueForProgress(progress: Int): Float =- (minimum + progress * step).coerceIn(minimum, maximum)-- fun formatValue(value: Float): String =- if (decimals == 0) {- round(value).toInt().toString()- } else {- String.format(Locale.ROOT, "%.${decimals}f", value)- }-- val valueLabel = TextView(activity).apply {- textSize = 18f- gravity = Gravity.CENTER- text = formatValue(valueForProgress(initialProgress))- }-- val seekBar = SeekBar(activity).apply {- max = steps- progress = initialProgress- setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {- override fun onProgressChanged(bar: SeekBar?, progress: Int, fromUser: Boolean) {- valueLabel.text = formatValue(valueForProgress(progress))- }-- override fun onStartTrackingTouch(bar: SeekBar?) = Unit- override fun onStopTrackingTouch(bar: SeekBar?) = Unit- })- }-- val limits = LinearLayout(activity).apply {- orientation = LinearLayout.HORIZONTAL- addView(- TextView(activity).apply { text = formatValue(minimum) },- LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f)- )- addView(- TextView(activity).apply {- text = formatValue(maximum)- gravity = Gravity.END- },- LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f)- )- }-- val content = LinearLayout(activity).apply {- orientation = LinearLayout.VERTICAL- setPadding(dp(24), dp(16), dp(24), dp(8))- addView(- valueLabel,- LinearLayout.LayoutParams(- LinearLayout.LayoutParams.MATCH_PARENT,- LinearLayout.LayoutParams.WRAP_CONTENT- )- )- addView(- seekBar,- LinearLayout.LayoutParams(- LinearLayout.LayoutParams.MATCH_PARENT,- LinearLayout.LayoutParams.WRAP_CONTENT- ).apply { topMargin = dp(8) }- )- addView(- limits,- LinearLayout.LayoutParams(- LinearLayout.LayoutParams.MATCH_PARENT,- LinearLayout.LayoutParams.WRAP_CONTENT- )- )- }-- AlertDialog.Builder(activity)- .setTitle(title)- .setView(content)- .setNegativeButton(android.R.string.cancel, null)- .setPositiveButton(android.R.string.ok) { _, _ ->- sharedPreferences.edit()- .putString(key, formatValue(valueForProgress(seekBar.progress)))- .apply()- }- .show()- }-- override fun onDestroy() {- super.onDestroy()- preferenceScreen.sharedPreferences.unregisterOnSharedPreferenceChangeListener(this)- }-- override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String?) {- if (key == null)- return- updatePreference(sharedPreferences, key)- }-- private fun updatePreference(sharedPreferences: SharedPreferences, key: String) {-- if(key == "gs_use_additional_animation_sources") {- findPreference("gs_weapon_sheating").isEnabled = sharedPreferences.getBoolean("gs_use_additional_animation_sources", false)- findPreference("gs_shield_sheating").isEnabled = sharedPreferences.getBoolean("gs_use_additional_animation_sources", false)- }-- if(key == "gs_build_navmesh") {- findPreference("gs_write_navmesh").isEnabled = sharedPreferences.getBoolean("gs_build_navmesh", true)- findPreference("gs_navmesh_threads").isEnabled = sharedPreferences.getBoolean("gs_build_navmesh", true)- }- }-- companion object {- private const val ARG_PAGE_RESOURCE = "page_resource"-- fun newInstance(resource: Int): FragmentGameSettingsPage {- return FragmentGameSettingsPage().apply {- arguments = Bundle().apply {- putInt(ARG_PAGE_RESOURCE, resource)- }- }- }- }-}--class Game_Mechanics_SettingsActivity : AppCompatActivity() {-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)- setContentView(R.layout.activity_settings)-- setSupportActionBar(findViewById(R.id.settings_toolbar))- supportActionBar?.setDisplayHomeAsUpEnabled(true)-- if (savedInstanceState == null) {- fragmentManager.beginTransaction()- .replace(R.id.settings_frame, FragmentGameSettingsPage.newInstance(R.xml.gs_game_mechanics))- .commit()- }- }-- override fun onOptionsItemSelected(item: MenuItem): Boolean {- return when (item.itemId) {- android.R.id.home -> {- onBackPressed()- true- }- else -> super.onOptionsItemSelected(item)- }- }-}--class Visuals_SettingsActivity : AppCompatActivity() {-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)- setContentView(R.layout.activity_settings)-- setSupportActionBar(findViewById(R.id.settings_toolbar))- supportActionBar?.setDisplayHomeAsUpEnabled(true)-- if (savedInstanceState == null) {- fragmentManager.beginTransaction()- .replace(R.id.settings_frame, FragmentGameSettingsPage.newInstance(R.xml.gs_visuals))- .commit()- }- }-- override fun onOptionsItemSelected(item: MenuItem): Boolean {- return when (item.itemId) {- android.R.id.home -> {- onBackPressed()- true- }- else -> super.onOptionsItemSelected(item)- }- }-}--class Shadows_SettingsActivity : AppCompatActivity() {-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)- setContentView(R.layout.activity_settings)-- setSupportActionBar(findViewById(R.id.settings_toolbar))- supportActionBar?.setDisplayHomeAsUpEnabled(true)-- if (savedInstanceState == null) {- fragmentManager.beginTransaction()- .replace(R.id.settings_frame, FragmentGameSettingsPage.newInstance(R.xml.gs_shadows))- .commit()- }- }-- override fun onOptionsItemSelected(item: MenuItem): Boolean {- return when (item.itemId) {- android.R.id.home -> {- onBackPressed()- true- }- else -> super.onOptionsItemSelected(item)- }- }-}--class Animations_SettingsActivity : AppCompatActivity() {-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)- setContentView(R.layout.activity_settings)-- setSupportActionBar(findViewById(R.id.settings_toolbar))- supportActionBar?.setDisplayHomeAsUpEnabled(true)-- if (savedInstanceState == null) {- fragmentManager.beginTransaction()- .replace(R.id.settings_frame, FragmentGameSettingsPage.newInstance(R.xml.gs_animations))- .commit()- }- }-- override fun onOptionsItemSelected(item: MenuItem): Boolean {- return when (item.itemId) {- android.R.id.home -> {- onBackPressed()- true- }- else -> super.onOptionsItemSelected(item)- }- }-}--class Interface_SettingsActivity : AppCompatActivity() {-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)- setContentView(R.layout.activity_settings)-- setSupportActionBar(findViewById(R.id.settings_toolbar))- supportActionBar?.setDisplayHomeAsUpEnabled(true)-- if (savedInstanceState == null) {- fragmentManager.beginTransaction()- .replace(R.id.settings_frame, FragmentGameSettingsPage.newInstance(R.xml.gs_interface))- .commit()- }- }-- override fun onOptionsItemSelected(item: MenuItem): Boolean {- return when (item.itemId) {- android.R.id.home -> {- onBackPressed()- true- }- else -> super.onOptionsItemSelected(item)- }- }-}--class Bug_Fixes_SettingsActivity : AppCompatActivity() {-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)- setContentView(R.layout.activity_settings)-- setSupportActionBar(findViewById(R.id.settings_toolbar))- supportActionBar?.setDisplayHomeAsUpEnabled(true)-- if (savedInstanceState == null) {- fragmentManager.beginTransaction()- .replace(R.id.settings_frame, FragmentGameSettingsPage.newInstance(R.xml.gs_bug_fixes))- .commit()- }- }-- override fun onOptionsItemSelected(item: MenuItem): Boolean {- return when (item.itemId) {- android.R.id.home -> {- onBackPressed()- true- }- else -> super.onOptionsItemSelected(item)- }- }-}--class Miscellaneous_SettingsActivity : AppCompatActivity() {-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)- setContentView(R.layout.activity_settings)-- setSupportActionBar(findViewById(R.id.settings_toolbar))- supportActionBar?.setDisplayHomeAsUpEnabled(true)-- if (savedInstanceState == null) {- fragmentManager.beginTransaction()- .replace(R.id.settings_frame, FragmentGameSettingsPage.newInstance(R.xml.gs_miscellaneous))- .commit()- }- }-- override fun onOptionsItemSelected(item: MenuItem): Boolean {- return when (item.itemId) {- android.R.id.home -> {- onBackPressed()- true- }- else -> super.onOptionsItemSelected(item)- }- }-}--class Engine_SettingsActivity : AppCompatActivity() {-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)- setContentView(R.layout.activity_settings)-- setSupportActionBar(findViewById(R.id.settings_toolbar))- supportActionBar?.setDisplayHomeAsUpEnabled(true)-- if (savedInstanceState == null) {- fragmentManager.beginTransaction()- .replace(R.id.settings_frame, FragmentGameSettingsPage.newInstance(R.xml.gs_engine))- .commit()- }- }-- override fun onOptionsItemSelected(item: MenuItem): Boolean {- return when (item.itemId) {- android.R.id.home -> {- onBackPressed()- true- }- else -> super.onOptionsItemSelected(item)- }- }-}-diff --git a/android/app/src/main/java/ui/controls/ButtonTouchListener.kt b/android/app/src/main/java/ui/controls/ButtonTouchListener.ktdeleted file mode 100644index f759cde..0000000--- a/android/app/src/main/java/ui/controls/ButtonTouchListener.kt+++ /dev/null@@ -1,83 +0,0 @@-/*- Copyright (C) 2015, 2016 sandstranger- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/---package ui.controls--import android.annotation.SuppressLint-import android.view.MotionEvent-import android.view.View-import android.view.View.OnTouchListener--import org.libsdl.app.SDLActivity--class ButtonTouchListener(private val keyCode: Int, private val needEmulateMouse: Boolean) : OnTouchListener {-- enum class Movement {- KEY_DOWN,- KEY_UP,- MOUSE_DOWN,- MOUSE_UP- }-- @SuppressLint("ClickableViewAccessibility")- override fun onTouch(v: View, event: MotionEvent): Boolean {- when (event.action) {- MotionEvent.ACTION_DOWN -> {- onTouchDown()- return true- }- MotionEvent.ACTION_UP -> {- onTouchUp()- return true- }- MotionEvent.ACTION_CANCEL -> {- onTouchUp()- return true- }- }- return false- }-- private fun onTouchDown() {- if (!needEmulateMouse) {- eventMovement(Movement.KEY_DOWN)- } else {- eventMovement(Movement.MOUSE_DOWN)- }- }-- private fun onTouchUp() {- if (!needEmulateMouse) {- eventMovement(Movement.KEY_UP)- } else {- eventMovement(Movement.MOUSE_UP)- }- }-- private fun eventMovement(event: Movement) {- when (event) {- Movement.KEY_DOWN -> SDLActivity.onNativeKeyDown(keyCode)- Movement.KEY_UP -> SDLActivity.onNativeKeyUp(keyCode)- Movement.MOUSE_DOWN -> SDLActivity.sendMouseButton(1, keyCode)- Movement.MOUSE_UP -> SDLActivity.sendMouseButton(0, keyCode)- }- }-}diff --git a/android/app/src/main/java/ui/controls/GamepadEmulator.kt b/android/app/src/main/java/ui/controls/GamepadEmulator.ktdeleted file mode 100644index a29dcbd..0000000--- a/android/app/src/main/java/ui/controls/GamepadEmulator.kt+++ /dev/null@@ -1,44 +0,0 @@-/*- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.controls--import org.libsdl.app.SDLControllerManager--internal object GamepadEmulator {-- private var registered = false-- fun updateStick(stickId: Int, x: Float, y: Float) {- // random device ID to make sure it doesn't conflict with anything- val deviceId = 1384510555-- if (!registered) {- registered = true- SDLControllerManager.nativeAddJoystick(deviceId, "Virtual", "Virtual",- 0xbad, 0xf00d,- false, -0x1,- 4, 0, 0)- }-- SDLControllerManager.onNativeJoy(deviceId, stickId * 2, x)- SDLControllerManager.onNativeJoy(deviceId, stickId * 2 + 1, y)- }--}diff --git a/android/app/src/main/java/ui/controls/Joystick.kt b/android/app/src/main/java/ui/controls/Joystick.ktdeleted file mode 100644index 4710676..0000000--- a/android/app/src/main/java/ui/controls/Joystick.kt+++ /dev/null@@ -1,125 +0,0 @@-/*- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.controls--import android.annotation.SuppressLint-import android.content.Context-import android.graphics.Canvas-import android.graphics.Color-import android.graphics.Paint-import android.util.AttributeSet-import android.util.TypedValue-import android.view.MotionEvent-import android.view.View--open class Joystick : View {-- // Initial touch position- protected var initialX = 0f- protected var initialY = 0f-- // Current touch position- protected var currentX = -1f- protected var currentY = -1f-- // Whether the finger is down- protected var down = false-- // left or right stick- protected var stickId = 0-- // width of a stroke to draw stick circles- private var strokeWidth = 0-- private val paint = Paint()-- constructor(context: Context) : super(context) {- init()- }-- constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {- init()- }-- constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {- init()- }-- private fun init() {- strokeWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2f, context.resources.displayMetrics).toInt()- }-- fun setStick(id: Int) {- stickId = id- }-- public override fun onDraw(canvas: Canvas) {- super.onDraw(canvas)-- paint.style = Paint.Style.STROKE- paint.strokeWidth = strokeWidth.toFloat()- paint.color = Color.GRAY-- if (down) {- // Draw initial touch- canvas.drawCircle(initialX, initialY, width / 10f, paint)-- // Draw current stick position- canvas.drawCircle(currentX, currentY, width / 5f, paint)- } else {- // Draw the outline- canvas.drawCircle(width / 2f, height / 2f,- width / 2f - strokeWidth, paint)- }- }-- public override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {- setMeasuredDimension(widthMeasureSpec, heightMeasureSpec)- }-- @SuppressLint("ClickableViewAccessibility")- override fun onTouchEvent(event: MotionEvent): Boolean {- when (event.actionMasked) {- MotionEvent.ACTION_DOWN -> {- initialX = event.x- initialY = event.y- currentX = initialX- currentY = initialY- down = true- }- MotionEvent.ACTION_MOVE -> {- currentX = event.x- currentY = event.y- }- MotionEvent.ACTION_UP -> {- down = false- // make sure it's hidden- currentY = -1f- currentX = -1f- }- }-- updateStick()- invalidate()- return true- }-- protected open fun updateStick() {}-}diff --git a/android/app/src/main/java/ui/controls/JoystickLeft.kt b/android/app/src/main/java/ui/controls/JoystickLeft.ktdeleted file mode 100644index a3fab19..0000000--- a/android/app/src/main/java/ui/controls/JoystickLeft.kt+++ /dev/null@@ -1,55 +0,0 @@-/*- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.controls--import android.content.Context-import androidx.core.math.MathUtils-import android.util.AttributeSet--class JoystickLeft : Joystick {-- constructor(context: Context) : super(context)- constructor(context: Context, attrs: AttributeSet) : super(context, attrs)- constructor(context: Context, attrs: AttributeSet, defStyle: Int)- : super(context, attrs, defStyle)-- override fun updateStick() {- if (down) {- // GamepadEmulator takes values on a scale [-1; 1] so convert our values- val w = (width / 3).toFloat()- var diffX = currentX - initialX- var diffY = currentY - initialY-- val bias = 0.3f-- if (Math.abs(diffX) > Math.abs(diffY)) {- diffY = Math.signum(diffY) * Math.max(0f, Math.abs(diffY) - bias * Math.abs(diffX))- } else {- diffX = Math.signum(diffX) * Math.max(0f, Math.abs(diffX) - bias * Math.abs(diffY))- }-- val dx = MathUtils.clamp(diffX / w + 0.2f * Math.signum(diffX), -1f, 1f)- val dy = MathUtils.clamp(diffY / w + 0.2f * Math.signum(diffY), -1f, 1f)- GamepadEmulator.updateStick(stickId, dx, dy)- } else {- GamepadEmulator.updateStick(stickId, 0f, 0f)- }- }-}diff --git a/android/app/src/main/java/ui/controls/JoystickRight.kt b/android/app/src/main/java/ui/controls/JoystickRight.ktdeleted file mode 100644index 01c489f..0000000--- a/android/app/src/main/java/ui/controls/JoystickRight.kt+++ /dev/null@@ -1,67 +0,0 @@-/*- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.controls--import android.annotation.SuppressLint-import android.content.Context-import android.util.AttributeSet-import android.view.MotionEvent--import org.libsdl.app.SDLActivity--class JoystickRight : Joystick {-- private var curX: Float = 0.toFloat()- private var curY: Float = 0.toFloat()-- constructor(context: Context) : super(context)-- constructor(context: Context, attrs: AttributeSet) : super(context, attrs)-- constructor(context: Context, attrs: AttributeSet, defStyle: Int)- : super(context, attrs, defStyle)-- @SuppressLint("ClickableViewAccessibility")- override fun onTouchEvent(event: MotionEvent): Boolean {- when (event.actionMasked) {- MotionEvent.ACTION_DOWN -> {- curX = event.x- curY = event.y- }- MotionEvent.ACTION_MOVE -> {- val newX = event.x- val newY = event.y-- // this isn't configurable here but configurable in openmw built-in settings- val mouseScalingFactor = 900f-- val movementX = (newX - curX) * mouseScalingFactor / width- val movementY = (newY - curY) * mouseScalingFactor / height-- SDLActivity.sendRelativeMouseMotion(Math.round(movementX), Math.round(movementY))-- curX = newX- curY = newY- }- }-- return super.onTouchEvent(event)- }-}diff --git a/android/app/src/main/java/ui/controls/Osc.kt b/android/app/src/main/java/ui/controls/Osc.ktdeleted file mode 100644index 62e63ef..0000000--- a/android/app/src/main/java/ui/controls/Osc.kt+++ /dev/null@@ -1,562 +0,0 @@-/*- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.controls--import android.annotation.SuppressLint-import android.content.Context-import android.graphics.Color-import android.preference.PreferenceManager-import android.view.KeyEvent-import android.view.MotionEvent-import android.view.View-import android.widget.Button-import android.widget.ImageView-import android.widget.RelativeLayout-import com.libopenmw.openmw.R-import org.libsdl.app.SDLActivity-import ui.activity.GameActivity-import ui.activity.MouseMode--import android.graphics.BitmapFactory-import constants.Constants-import java.io.File--const val VIRTUAL_SCREEN_WIDTH = 1024-const val VIRTUAL_SCREEN_HEIGHT = 768-const val CONTROL_DEFAULT_SIZE = 70-const val JOYSTICK_SIZE = 230-const val JOYSTICK_OFFSET = 110-const val TOP_BAR_SPACING = 90--/**- * Class to hold on-screen control elements such as buttons or joysticks.- * The position, opacity and size can be customized by the user.- *- * @param uniqueId a string identifying the element, used to store customized positions- * @param defaultX: default X position of the element- * @param defaultY: default Y position of the element- * @param defaultSize: default size (both width and height) of the element- * @param defaultOpacity: default opacity of the element- */-open class OscElement(- val uniqueId: String,- val iconName: String,- var visibility: OscVisibility,- val defaultX: Int,- val defaultY: Int,- private val defaultSize: Int = CONTROL_DEFAULT_SIZE,- private val defaultOpacity: Float = 0.4f-) {-- private var opacity = defaultOpacity- var size = defaultSize- var x = defaultX- var y = defaultY-- var view: View? = null-- /**- * Creates a View object for this element.- * The object should have a custom OnTouchListener which performs the desired action.- *- * @param ctx Android Context, comes from layout.- */- open fun makeView(ctx: Context) {- val v = ImageView(ctx)- v.setBackgroundColor(Color.RED)- v.tag = this- view = v- }-- /**- * Creates and places this element into a RelativeLayout.- *- * @param target RelativeLayout to put the new element into.- */- fun place(target: RelativeLayout) {- makeView(target.context)- val v = view ?: return-- target.addView(v)- updateView()- }-- fun placeConfigurable(target: RelativeLayout, listener: View.OnTouchListener) {- place(target)- view?.setOnTouchListener(listener)- view?.visibility = View.VISIBLE- }-- fun changeOpacity(delta: Float) {- opacity = Math.max(0f, Math.min(opacity + delta, 1.0f))- savePrefs()- }-- fun changeSize(delta: Int) {- size = Math.max(0, size + delta)- savePrefs()- }-- fun changePosition(virtualX: Int, virtualY: Int) {- x = virtualX- y = virtualY- savePrefs()- }-- fun updateView() {- val v = view ?: return-- val realScreenWidth = (v.parent as View).width- val realScreenHeight = (v.parent as View).height- val realX = x * realScreenWidth / VIRTUAL_SCREEN_WIDTH- val realY = y * realScreenHeight / VIRTUAL_SCREEN_HEIGHT-- val screenSize = (1.0 * size * realScreenWidth / VIRTUAL_SCREEN_WIDTH).toInt()- val params = RelativeLayout.LayoutParams(screenSize, screenSize)-- params.leftMargin = realX- params.topMargin = realY-- v.layoutParams = params-- v.alpha = opacity- }-- private fun savePrefs() {- val v = view ?: return- val prefs = PreferenceManager.getDefaultSharedPreferences(v.context)- with (prefs.edit()) {- putFloat("osc:$uniqueId:opacity", opacity)- putInt("osc:$uniqueId:size", size)- putInt("osc:$uniqueId:x", x)- putInt("osc:$uniqueId:y", y)-- commit()- }- }-- fun loadPrefs(ctx: Context) {- val prefs = PreferenceManager.getDefaultSharedPreferences(ctx)-- opacity = prefs.getFloat("osc:$uniqueId:opacity", defaultOpacity)- size = prefs.getInt("osc:$uniqueId:size", defaultSize)- x = prefs.getInt("osc:$uniqueId:x", defaultX)- y = prefs.getInt("osc:$uniqueId:y", defaultY)-- updateView()- }-- fun resetPrefs(ctx: Context) {- val prefs = PreferenceManager.getDefaultSharedPreferences(ctx)-- with (prefs.edit()) {- remove("osc:$uniqueId:opacity")- remove("osc:$uniqueId:size")- remove("osc:$uniqueId:x")- remove("osc:$uniqueId:y")-- commit()- }-- loadPrefs(ctx)- }-}--class OscImageButton(- uniqueId: String,- iconName: String,- visibility: OscVisibility,- private val imageSrc: Int,- defaultX: Int,- defaultY: Int,- private val keyCode: Int,- private val needMouse: Boolean = false,- defaultSize: Int = CONTROL_DEFAULT_SIZE-) : OscElement(uniqueId, iconName, visibility, defaultX, defaultY, defaultSize) {-- override fun makeView(ctx: Context) {- val v = ImageView(ctx)-- if (File(Constants.USER_FILE_STORAGE + "/icons/" + iconName).exists())- v.setImageBitmap(BitmapFactory.decodeFile(Constants.USER_FILE_STORAGE + "/icons/" + iconName))- else- v.setImageResource(imageSrc)-- // fix blurry icons on old android- v.scaleType = ImageView.ScaleType.FIT_XY- v.setOnTouchListener(ButtonTouchListener(keyCode, needMouse))- v.tag = this-- view = v- }--}--class OscCustomButton(- uniqueId: String,- iconName: String,- visibility: OscVisibility,- private val imageSrc: Int,- defaultX: Int,- defaultY: Int,- private val handler: () -> Unit-) : OscElement(uniqueId, iconName, visibility, defaultX, defaultY) {-- @SuppressLint("ClickableViewAccessibility")- override fun makeView(ctx: Context) {- val v = ImageView(ctx)-- if (File(Constants.USER_FILE_STORAGE + "/icons/" + iconName).exists())- v.setImageBitmap(BitmapFactory.decodeFile(Constants.USER_FILE_STORAGE + "/icons/" + iconName))- else- v.setImageResource(imageSrc)-- v.setOnTouchListener { _, motionEvent ->- if (motionEvent.action == MotionEvent.ACTION_UP)- handler()- true- }- v.tag = this-- view = v- }--}--class OscJoystickLeft(- uniqueId: String,- visibility: OscVisibility,- defaultX: Int,- defaultY: Int,- defaultSize: Int,- private val stick: Int-) : OscElement(uniqueId, "", visibility, defaultX, defaultY, defaultSize) {-- override fun makeView(ctx: Context) {- val v = JoystickLeft(ctx)- v.setStick(stick)- v.tag = this-- view = v- }--}--class OscJoystickRight(- uniqueId: String,- visibility: OscVisibility,- defaultX: Int,- defaultY: Int,- defaultSize: Int,- private val stick: Int-) : OscElement(uniqueId, "", visibility, defaultX, defaultY, defaultSize) {-- override fun makeView(ctx: Context) {- val v = JoystickRight(ctx)- v.setStick(stick)- v.tag = this-- view = v- }--}--open class OscHiddenButton(- uniqueId: String,- visibility: OscVisibility,- defaultX: Int,- defaultY: Int,- private val title: String,- private val keyCode: Int-) : OscElement(uniqueId, "", visibility, defaultX, defaultY) {-- override fun makeView(ctx: Context) {- val v = Button(ctx)- v.tag = this- v.setOnTouchListener(ButtonTouchListener(keyCode, false))- v.text = title- v.visibility = View.GONE-- view = v- }--}---class ToggleTouchListener(private val buttons: ArrayList<OscHiddenButton>): View.OnTouchListener {-- private var shown = false-- override fun onTouch(v: View?, event: MotionEvent): Boolean {- if (event.action != MotionEvent.ACTION_UP)- return false-- for (button in buttons)- button.view?.visibility = if (shown) View.GONE else View.VISIBLE-- shown = !shown-- return true- }--}--class OscHiddenToggle(- uniqueId: String,- visibility: OscVisibility,- defaultX: Int,- defaultY: Int,- title: String,- private val buttons: ArrayList<OscHiddenButton>-) : OscHiddenButton(uniqueId, visibility, defaultX, defaultY, title, 0) {-- override fun makeView(ctx: Context) {- super.makeView(ctx)- view?.setOnTouchListener(ToggleTouchListener(buttons))- view?.visibility = View.VISIBLE- }--}--// Visibility is used as a bitmask-enum class OscVisibility(val v: Int) {- // Mark as should not be touched by osc-visibility handling- NULL(0),- // Widgets that must be visible when menu is open- ESSENTIAL(1),- // Widgets visible during gameplay- NORMAL(2),-}--class Osc {- private var osk = Osk()- var keyboardVisible = false //< Mode where only keyboard is visible- var mouseVisible = false //< Mode where only mouse-switch icon is visible- private var topVisible = true //< The controls located at the top hidden behind the hamburger toggle- private var visibilityState = 0- private val btnMouse = OscCustomButton("mouse", "mouse.png", OscVisibility.NULL,- R.drawable.mouse, TOP_BAR_SPACING * 6, 0) { toggleMouse() }- private val btnTopToggle = OscCustomButton("toggle", "toggle.png", OscVisibility.NULL,- R.drawable.toggle, 0, 0) { toggleTopControls() }-- private val joystickLeft = OscJoystickLeft("joystickLeft", OscVisibility.NORMAL,- JOYSTICK_OFFSET, 400, JOYSTICK_SIZE, 0)- private val joystickRight = OscJoystickRight("joystickRight", OscVisibility.ESSENTIAL,- VIRTUAL_SCREEN_WIDTH - JOYSTICK_SIZE - JOYSTICK_OFFSET,- 400, JOYSTICK_SIZE, 1)-- private var elements = arrayListOf(- joystickLeft,- joystickRight,-- btnTopToggle,- OscImageButton("inventory", "inventory.png", OscVisibility.NULL,- R.drawable.inventory, 940, 95, 3, true),- OscImageButton("crouch", "sneak.png", OscVisibility.NORMAL,- R.drawable.sneak, 940 - TOP_BAR_SPACING, 0, 113),- OscImageButton("pause", "pause.png", OscVisibility.ESSENTIAL,- R.drawable.pause, 940, 0, KeyEvent.KEYCODE_ESCAPE),- OscImageButton("magic", "toggle_magic.png", OscVisibility.NORMAL,- R.drawable.toggle_magic, 940, 450, KeyEvent.KEYCODE_R),- OscImageButton("weapon", "toggle_weapon.png", OscVisibility.NORMAL,- R.drawable.toggle_weapon, 940, 560, KeyEvent.KEYCODE_F),- OscAttackButton("fire", "attack.png", OscVisibility.ESSENTIAL,- R.drawable.attack, 800, 315, 1, 120),- OscImageButton("use", "use.png", OscVisibility.NORMAL,- R.drawable.use, joystickLeft.defaultX + JOYSTICK_SIZE/2 + 105, 630,- KeyEvent.KEYCODE_SPACE),- OscImageButton("jump", "jump.png", OscVisibility.NORMAL, R.drawable.jump,- joystickRight.defaultX + JOYSTICK_SIZE/2 - 105 - CONTROL_DEFAULT_SIZE,- 630, KeyEvent.KEYCODE_E)- )-- private val topButtons: ArrayList<OscElement>- private val fnButtons = arrayListOf<OscHiddenButton>()- private val quickButtons = arrayListOf<OscHiddenButton>()- private val fn: OscHiddenToggle- private val qp: OscHiddenToggle-- init {- val btnRowSpacing = 74- val btnColumnSpacing = 65-- // Fn buttons: F1, F3, F4, F10, F11 are the only ones we care about- arrayOf(1, 2, 3, 4, 10, 11).forEachIndexed{ i, el ->- val code = 130 + el- val column = (i + 1) / 4 + 2- val row = (i + 1) % 4 + 1- fnButtons.add(OscHiddenButton("f$el", OscVisibility.NULL,- btnColumnSpacing * column, btnRowSpacing * row, "F$el", code))- }- fn = OscHiddenToggle("fn", OscVisibility.NULL,- 2 * btnColumnSpacing, btnRowSpacing, "FN", fnButtons)-- // Quick buttons: 0 to 9- for (i in 0..9) {- val code = KeyEvent.KEYCODE_0 + i- val column = (i + 1) / 9- val row = (i + 1) % 9 + 1- quickButtons.add(OscHiddenButton("qp$i", OscVisibility.NULL,- btnColumnSpacing * column, btnRowSpacing * row, "$i", code))- }- qp = OscHiddenToggle("qp", OscVisibility.NULL,- 0, btnRowSpacing, "QP", quickButtons)-- topButtons = arrayListOf(- OscImageButton("changePerson", "third_person.png", OscVisibility.NORMAL,- R.drawable.third_person, TOP_BAR_SPACING * 1, 0, KeyEvent.KEYCODE_TAB),- OscImageButton("quickSave", "save.png", OscVisibility.NORMAL,- R.drawable.save, TOP_BAR_SPACING * 2, 0, 135),- OscImageButton("diary", "journal.png", OscVisibility.ESSENTIAL,- R.drawable.journal, TOP_BAR_SPACING * 3, 0, KeyEvent.KEYCODE_J),- OscImageButton("wait", "wait.png", OscVisibility.NORMAL,- R.drawable.wait, TOP_BAR_SPACING * 4, 0, KeyEvent.KEYCODE_T),- OscCustomButton("keyboard", "keyboard.png", OscVisibility.NULL,- R.drawable.keyboard, TOP_BAR_SPACING * 5, 0) { toggleKeyboard() },- btnMouse- )-- elements.addAll(fnButtons)- elements.add(fn)- elements.addAll(quickButtons)- elements.add(qp)- elements.addAll(topButtons)- }-- fun placeElements(target: RelativeLayout) {- val prefs = PreferenceManager.getDefaultSharedPreferences(target.context)- val showQp = prefs.getBoolean("pref_show_qp", false)- val showFn = prefs.getBoolean("pref_show_fn", false)- val alwaysShowTop = prefs.getBoolean("pref_always_show_top_bar", false)-- for (element in elements) {- if (!showQp && (element == qp || quickButtons.contains(element)))- continue- if (!showFn && (element == fn || fnButtons.contains(element)))- continue- if (alwaysShowTop && element == btnTopToggle)- continue- // If we want to utilize top-bar, don't let mouse/keyboard icons control it- if (!alwaysShowTop && topButtons.contains(element))- element.visibility = OscVisibility.NULL-- element.place(target)- element.loadPrefs(target.context)- }- osk.placeElements(target)-- target.addOnLayoutChangeListener { v, l, t, r, b, ol, ot, or, ob -> relayout(l, t, r, b, ol, ot, or, ob) }-- showBasedOnState()-- // Mouse button is only needed in hybrid mode- if (GameActivity.mouseMode != MouseMode.Hybrid)- btnMouse.view?.visibility = View.GONE-- // Prepare initial top-button state- if (!alwaysShowTop)- toggleTopControls()- }-- fun toggleKeyboard() {- osk.toggle()-- keyboardVisible = !keyboardVisible- showBasedOnState()- }-- private fun toggleTopControls() {- topVisible = !topVisible- // Note that this is done separate from the showBasedOnState mode- // Perhaps some refactoring is due- topButtons.forEach {- it.view?.visibility = if (topVisible) View.VISIBLE else View.GONE- }- }-- /**- * Displays different controls depending on current state- * - keyboard visibility- * - mouse-mode visibility- * - actual mouse cursor visibility- */- fun showBasedOnState() {- // If keyboard or mouse-mode or both, then hide everything- if (keyboardVisible || mouseVisible) {- setVisibility(OscVisibility.NULL.v)- } else {- if (SDLActivity.isMouseShown() == 0)- setVisibility(OscVisibility.ESSENTIAL.v or OscVisibility.NORMAL.v)- else- setVisibility(OscVisibility.ESSENTIAL.v)- }- }-- fun toggleMouse() {- mouseVisible = !mouseVisible- showBasedOnState()- }-- fun placeConfigurableElements(target: RelativeLayout, listener: View.OnTouchListener) {- for (element in elements) {- element.placeConfigurable(target, listener)- element.loadPrefs(target.context)- }-- target.addOnLayoutChangeListener { v, l, t, r, b, ol, ot, or, ob -> relayout(l, t, r, b, ol, ot, or, ob) }- }-- fun resetElements(ctx: Context) {- for (element in elements) {- element.resetPrefs(ctx)- }- }-- /**- * Hide/show stuff based on visibility state- */- private fun setVisibility(newState: Int) {- if (visibilityState == newState)- return-- for (element in elements) {- // don't touch elements with NULL visibility as these are managed externally- if (element.visibility == OscVisibility.NULL)- continue- if (newState and element.visibility.v == 0) {- element.view?.visibility = View.GONE- } else {- element.view?.visibility = View.VISIBLE- }- }-- visibilityState = newState- }-- private fun relayout(l: Int, t: Int, r: Int, b: Int, ol: Int, ot: Int, or: Int, ob: Int) {- // don't do anything if layout didn't change- if (l == ol && t == ot && r == or && b == ob)- return- for (element in elements) {- element.updateView()- }- }--}diff --git a/android/app/src/main/java/ui/controls/OscAttackButton.kt b/android/app/src/main/java/ui/controls/OscAttackButton.ktdeleted file mode 100644index d595999..0000000--- a/android/app/src/main/java/ui/controls/OscAttackButton.kt+++ /dev/null@@ -1,103 +0,0 @@-/*- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.controls--import android.annotation.SuppressLint-import android.content.Context-import android.view.MotionEvent-import android.view.View-import android.widget.ImageView-import org.libsdl.app.SDLActivity--import android.graphics.BitmapFactory-import constants.Constants-import java.io.File--/**- * The attack button is special in that it allows us to control the camera a little- */-class OscAttackButton(- uniqueId: String,- iconName: String,- visibility: OscVisibility,- private val imageSrc: Int,- defaultX: Int,- defaultY: Int,- private val keyCode: Int,- defaultSize: Int = 50-) : OscElement(uniqueId, iconName, visibility, defaultX, defaultY, defaultSize) {-- private var curX = 0f- private var curY = 0f- private var downFrom = 0L-- @SuppressLint("ClickableViewAccessibility")- override fun makeView(ctx: Context) {- val v = ImageView(ctx)-- if (File(Constants.USER_FILE_STORAGE + "/icons/" + iconName).exists())- v.setImageBitmap(BitmapFactory.decodeFile(Constants.USER_FILE_STORAGE + "/icons/" + iconName))- else- v.setImageResource(imageSrc)-- // fix blurry icons on old android- v.scaleType = ImageView.ScaleType.FIT_XY- v.setOnTouchListener(View.OnTouchListener { _, motionEvent ->- onMotionEvent(motionEvent)- return@OnTouchListener true- })- v.tag = this-- view = v- }-- /**- * Process events, emulating mouse clicks on down/up and movement on move- */- private fun onMotionEvent(ev: MotionEvent) {- when (ev.actionMasked) {- MotionEvent.ACTION_DOWN -> {- SDLActivity.sendMouseButton(1, keyCode)- curX = ev.x- curY = ev.y- downFrom = System.currentTimeMillis()- }- MotionEvent.ACTION_MOVE -> {- val newX = ev.x- val newY = ev.y-- // Must hold button for specified ms to activate- if (System.currentTimeMillis() - downFrom > 100) {- val mouseScalingFactor = 400f-- val movementX = (newX - curX) * mouseScalingFactor / view!!.width- val movementY = (newY - curY) * mouseScalingFactor / view!!.height-- SDLActivity.sendRelativeMouseMotion(Math.round(movementX), Math.round(movementY))- }-- curX = newX- curY = newY- }- MotionEvent.ACTION_UP -> SDLActivity.sendMouseButton(0, keyCode)- }- }--}diff --git a/android/app/src/main/java/ui/controls/Osk.kt b/android/app/src/main/java/ui/controls/Osk.ktdeleted file mode 100644index 99a8409..0000000--- a/android/app/src/main/java/ui/controls/Osk.kt+++ /dev/null@@ -1,364 +0,0 @@-/*- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.controls--import android.view.KeyEvent-import android.view.MotionEvent-import android.view.View-import android.widget.Button-import android.widget.RelativeLayout-import android.util.DisplayMetrics-import org.libsdl.app.SDLActivity-import com.libopenmw.openmw.R---class OskTouchListener(val btn: OskButton): View.OnTouchListener {-- override fun onTouch(v: View, event: MotionEvent): Boolean {- when (event.action) {- MotionEvent.ACTION_DOWN -> btn.pressed()- MotionEvent.ACTION_UP -> btn.released()- }-- return true- }--}--/**- * Base class for keyboard buttons.- *- * @param text text displayed on the button- * @param positionX X position of the button- * @param positionY Y position of the button- * @param sizeW width of the button- * @param sizeH height of the button- */-abstract class OskButton(- val text: String,- private val positionX: Int,- private val positionY: Int,- private val sizeW: Int,- private val sizeH: Int,- private val textRes: Int? = null-) {-- var view: Button? = null-- /**- * Show the keyboard button.- */- fun show() {- view?.visibility = View.VISIBLE- }-- /**- * Hide the keyboard button.- */- fun hide() {- view?.visibility = View.GONE- }-- /**- * Place this button into a RelativeLayout.- * This also allocates an underlying View object.- */- fun place(target: RelativeLayout) {- val v = Button(target.context)- v.transformationMethod = null- v.text = textRes?.let { v.context.getString(it) } ?: text- v.tag = this- v.alpha = 0.5f- v.visibility = View.GONE-- // The on-screen keyboard is touch-only. Keep Android's hardware/gamepad- // focus navigation on the SDL surface instead of allowing a connected- // controller to move View focus onto these overlay buttons.- v.isFocusable = false- v.isFocusableInTouchMode = false-- // TODO: this doesn't take soft keys into account- val realScreenWidth = v.context.resources.displayMetrics.widthPixels- val realScreenHeight = v.context.resources.displayMetrics.heightPixels- val realX = positionX * realScreenWidth / VIRTUAL_SCREEN_WIDTH- val realY = positionY * realScreenHeight / VIRTUAL_SCREEN_HEIGHT-- val realW = sizeW * realScreenWidth / VIRTUAL_SCREEN_WIDTH- val realH = sizeH * realScreenHeight / VIRTUAL_SCREEN_HEIGHT- val params = RelativeLayout.LayoutParams(realW, realH)-- params.leftMargin = realX- params.topMargin = realY-- v.layoutParams = params-- v.setOnTouchListener(OskTouchListener(this))-- target.addView(v)- view = v- }- fun remove(target: RelativeLayout) {- target.removeView(view);- }- /**- * This is called when the button is pressed down.- * Optionally, children can override this method.- */- open fun pressed() {- }-- /**- * This is called when the button is released.- * Every child probably should override this method.- */- open fun released() {- }-}--/**- * A simple keyboard button which has two states: normal and shift pressed.- * This uses nativeCommitText to send the text events.- *- * @param key key sent when in normal state- * @param shiftKey key sent when shift is pressed- */-class OskSimpleButton(val key: Char, val shiftKey: Char, positionX: Int, positionY: Int, sizeW: Int, sizeH: Int):- OskButton(key.toString(), positionX, positionY, sizeW, sizeH) {-- private val keyStr = key.toString()- private val shiftKeyStr = shiftKey.toString()- private var curKeyStr = keyStr-- override fun released() {- // Printable characters belong to SDL's text-input path. Do not also- // synthesize hardware key down/up events: with an active gamepad those- // events can participate in controller/keyboard GUI navigation and- // interfere with the EditBox that owns text input.- SDLActivity.nativeCommitText(curKeyStr, 0)- }-- fun shift(on: Boolean) {- curKeyStr = if (on) shiftKeyStr else keyStr- view?.text = curKeyStr- }-}--class OskRawButton(text: String, private val keyCode: Int, positionX: Int, positionY: Int, sizeW: Int, sizeH: Int):- OskButton(text, positionX, positionY, sizeW, sizeH) {-- override fun pressed() {- SDLActivity.onNativeKeyDown(keyCode)- }-- override fun released() {- SDLActivity.onNativeKeyUp(keyCode)- }-}--class OskShift(val buttons: ArrayList<OskSimpleButton>, positionX: Int, positionY: Int, sizeW: Int, sizeH: Int):- OskButton("", positionX, positionY, sizeW, sizeH, R.string.osk_shift) {-- override fun pressed() {- for (btn in buttons)- btn.shift(true)- }-- override fun released() {- for (btn in buttons)- btn.shift(false)- }-}-class OskCaps(val buttons: ArrayList<OskSimpleButton>, positionX: Int, positionY: Int, sizeW: Int, sizeH: Int):- OskButton("", positionX, positionY, sizeW, sizeH, R.string.osk_caps_lock) {-- private var state = false-- override fun pressed() {- state = !state- for (btn in buttons)- btn.shift(state)- }--}--class OskLanguage(val reference: Osk, positionX: Int, positionY: Int, sizeW: Int, sizeH: Int):- OskButton("", positionX, positionY, sizeW, sizeH, R.string.osk_language) {-- override fun pressed() {- reference.changeLanguage()- }-}--class Osk {- /* Every key is defined by two characters, first is input normally, second is input when shift is active- * Note: This is only the "middle" part of the virtual keyboard- */-- private var elements = ArrayList<OskButton>()-- private var visible = false-- private lateinit var relativelayouttarget: RelativeLayout-- private var russian = false-- init {- placeKeyboard(russian)- }-- fun placeKeyboard(isRussian: Boolean) {- var keyboardLayout: ArrayList<String>-- val buttonWidth = 60- val buttonHeight = 100- val buttonMarginX = 3- val buttonMarginY = 1- val offsetX: Int-- if( isRussian )- offsetX = 0- else- offsetX = 30-- val offsetY = 110-- var curX: Int- var curY = offsetY-- if( isRussian ) {- keyboardLayout = arrayListOf(- "1!2@3#4$5%6^7&8*9(0)-_=+",- "йЙцЦуУкКеЕнНгГшШщЩзЗхХ[{]}\\|",- "фФыЫвВаАпПрРоОлЛдДжЖэЭ;:'\"",- "яЯчЧсСмМиИтТьЬбБюЮ,<.>/?"- )- } else {- keyboardLayout = arrayListOf(- "1!2@3#4$5%6^7&8*9(0)-_=+",- "qQwWeErRtTyYuUiIoOpP[{]}\\|",- "aAsSdDfFgGhHjJkKlL;:'\"",- "zZxXcCvVbBnNmM,<.>/?"- )- }-- val lineOffset = arrayOf(- (offsetX + buttonWidth * 1.0 + buttonMarginX).toInt(),- (offsetX + buttonWidth * 0.5 + buttonMarginX).toInt(),- (offsetX + buttonWidth * 1.25 + buttonMarginX).toInt(),- (offsetX + buttonWidth * 1.5 + buttonMarginX).toInt()- )-- val simpleButtons = ArrayList<OskSimpleButton>()- keyboardLayout.forEachIndexed{ i, line ->- curX = lineOffset[i]-- for (j in 0..(line.length - 1) step 2) {- simpleButtons.add(OskSimpleButton(line[j], line[j + 1], curX, curY, buttonWidth, buttonHeight))- curX += buttonWidth + buttonMarginX- }- curY += buttonHeight + buttonMarginY- }- elements.addAll(simpleButtons)-- // Shift- elements.add(OskShift(simpleButtons, offsetX, offsetY + 3 * (buttonHeight + buttonMarginY), (buttonWidth * 1.5).toInt(), buttonHeight))-- // Capslock- elements.add(OskCaps(simpleButtons, offsetX, offsetY + 2 * (buttonHeight + buttonMarginY), (buttonWidth * 1.25).toInt(), buttonHeight))-- // Backspace- elements.add(OskRawButton(- "⌫",- KeyEvent.KEYCODE_DEL,- lineOffset[0] + (buttonWidth + buttonMarginX) * keyboardLayout[0].length / 2,- offsetY,- buttonWidth * 2,- buttonHeight- ))-- // Enter- elements.add(OskRawButton(- "⏎",- KeyEvent.KEYCODE_ENTER,- lineOffset[2] + (buttonWidth + buttonMarginX) * keyboardLayout[2].length / 2,- offsetY + (buttonHeight + buttonMarginY) * 2,- buttonWidth * 3,- buttonHeight- ))-- // Language- elements.add(OskLanguage(this, offsetX, curY, (buttonWidth * 1.5).toInt(), buttonHeight))-- // Spacebar- elements.add(OskSimpleButton(' ', ' ', offsetX + buttonWidth * 3, curY, buttonWidth * 7, buttonHeight))-- // Arrows- var arrowsCurX = lineOffset[3] + (buttonWidth + buttonMarginX) * keyboardLayout[3].length / 2 + buttonWidth- if (isRussian)- arrowsCurX -= 15- var arrowsCurY = offsetY + (buttonHeight + buttonMarginY) * 3- elements.add(OskRawButton("↑", KeyEvent.KEYCODE_DPAD_UP, arrowsCurX, arrowsCurY, buttonWidth, buttonHeight))- arrowsCurX -= buttonWidth + buttonMarginX- arrowsCurY += buttonHeight + buttonMarginY- elements.add(OskRawButton("←", KeyEvent.KEYCODE_DPAD_LEFT, arrowsCurX, arrowsCurY, buttonWidth, buttonHeight))- arrowsCurX += buttonWidth + buttonMarginX- elements.add(OskRawButton("↓", KeyEvent.KEYCODE_DPAD_DOWN, arrowsCurX, arrowsCurY, buttonWidth, buttonHeight))- arrowsCurX += buttonWidth + buttonMarginX- elements.add(OskRawButton("→", KeyEvent.KEYCODE_DPAD_RIGHT, arrowsCurX, arrowsCurY, buttonWidth, buttonHeight))-- // Tilde. It's kinda crappy that it's separate just for console but oh well- elements.add(OskRawButton("~", 68, offsetX, offsetY, buttonWidth, buttonHeight))- }-- fun placeElements(target: RelativeLayout) {- for (element in elements) {- element.place(target)- }- relativelayouttarget = target- }-- fun removeElements(target: RelativeLayout) {- for (element in elements) {- element.remove(target)- }- }-- fun changeLanguage() {- removeElements(relativelayouttarget)- elements = ArrayList<OskButton>()-- russian = !russian- placeKeyboard(russian)- placeElements(relativelayouttarget)- // hack, make visible into false so it can do the keyboard again- visible = false- toggle()- }-- fun toggle() {- visible = !visible- for (element in elements) {- if (visible)- element.show()- else- element.hide()- }- }-}diff --git a/android/app/src/main/java/ui/fragments/FragmentSettings.kt b/android/app/src/main/java/ui/fragments/FragmentSettings.ktdeleted file mode 100644index 6611b89..0000000--- a/android/app/src/main/java/ui/fragments/FragmentSettings.kt+++ /dev/null@@ -1,569 +0,0 @@-/*- Copyright (C) 2016 sandstranger- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package ui.fragments--import android.app.AlertDialog-import android.content.DialogInterface-import android.content.Intent-import android.content.SharedPreferences-import android.content.SharedPreferences.OnSharedPreferenceChangeListener-import android.graphics.Color-import android.os.Bundle-import android.preference.EditTextPreference-import android.preference.ListPreference-import android.preference.Preference-import android.preference.PreferenceFragment-import android.preference.PreferenceGroup-import android.text.InputType-import android.view.Gravity-import android.view.View-import android.widget.EditText-import android.widget.LinearLayout-import android.widget.SeekBar-import android.widget.TextView-import android.widget.Toast-import com.codekidlabs.storagechooser.Content-import com.codekidlabs.storagechooser.StorageChooser-import com.libopenmw.openmw.BuildConfig-import com.libopenmw.openmw.R-import file.GameInstaller-import permission.PermissionHelper--import ui.activity.ConfigureControls-import ui.activity.MainActivity-import ui.activity.ModsActivity-import ui.activity.SettingsActivity-import utils.MyApp-import java.io.File-import java.util.*--class FragmentSettings : PreferenceFragment(), OnSharedPreferenceChangeListener {-- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {- super.onViewCreated(view, savedInstanceState)-- // Black/OLED is intentionally limited to the launcher presentation.- // The normal Dark design keeps the original AppCompat grey unchanged.- val sharedPref = preferenceScreen.sharedPreferences- if (sharedPref.getInt(getString(R.string.theme), 0) == 3) {- view.setBackgroundColor(Color.BLACK)- view.findViewById<View>(android.R.id.list)?.setBackgroundColor(Color.BLACK)- }- }-- override fun onCreate(savedInstanceState: Bundle?) {- super.onCreate(savedInstanceState)-- addPreferencesFromResource(R.xml.settings)- preferenceScreen.sharedPreferences.registerOnSharedPreferenceChangeListener(this)-- prepareControllerTriggerPreference()- updateGammaState()-- // Make launcher entries that open another screen visually distinct.- listOf("pref_game_settings", "pref_mods", "pref_controls").forEach { key ->- findPreference(key)?.widgetLayoutResource = R.layout.preference_widget_chevron- }-- findPreference("pref_uiScaling").setOnPreferenceClickListener {- showSteppedSliderPreference(- key = "pref_uiScaling",- title = getString(R.string.pref_uiScaling),- minimum = 0.5f,- maximum = 3.0f,- step = 0.1f,- defaultValue = MyApp.app.defaultScaling.coerceIn(0.5f, 3.0f),- neutralLabel = getString(R.string.slider_auto)- )- true- }-- findPreference("pref_customResolution").setOnPreferenceClickListener {- showCustomResolutionDialog()- true- }-- findPreference("pref_gamma").setOnPreferenceClickListener {- showSteppedSliderPreference(- key = "pref_gamma",- title = getString(R.string.pref_gamma),- minimum = 1.0f,- maximum = 3.0f,- step = 0.1f,- defaultValue = 1.0f- )- true- }-- findPreference("pref_controls").setOnPreferenceClickListener {- val intent = Intent(activity, ConfigureControls::class.java)- this.startActivity(intent)- true- }-- findPreference("pref_game_settings").setOnPreferenceClickListener {- val intent = Intent(activity, SettingsActivity::class.java)- this.startActivity(intent)- true- }-- findPreference("pref_mods").setOnPreferenceClickListener {- // Just prevent crash here if data files are not selected- val sharedPref = preferenceScreen.sharedPreferences- val inst = GameInstaller(sharedPref.getString("game_files", "")!!)- if (!inst.check()) {- AlertDialog.Builder(getActivity())- .setTitle(R.string.no_data_files_title)- .setMessage(R.string.no_data_files_message)- .setPositiveButton(android.R.string.ok) { _: DialogInterface, _: Int -> }- .show()-- false- }- else- {- val intent = Intent(activity, ModsActivity::class.java)- this.startActivity(intent)- true- }- }-- findPreference("game_files").setOnPreferenceClickListener {- if (!PermissionHelper.canOpenLegacyStorageChooser(activity)) {- showError(R.string.permissions_error_title, R.string.permissions_error_message)- } else {- val chooserContent = Content().apply {- selectLabel = getString(R.string.chooser_select)- createLabel = getString(R.string.chooser_create)- newFolderLabel = getString(R.string.chooser_new_folder)- cancelLabel = getString(R.string.chooser_cancel)- overviewHeading = getString(R.string.chooser_heading)- internalStorageText = getString(R.string.chooser_internal_storage)- freeSpaceText = getString(R.string.chooser_free_space)- folderCreatedToastText = getString(R.string.chooser_folder_created)- folderErrorToastText = getString(R.string.chooser_folder_error)- textfieldHintText = getString(R.string.chooser_folder_name)- textfieldErrorText = getString(R.string.chooser_empty_folder_name)- }-- val chooser = StorageChooser.Builder()- .withActivity(activity)- .withFragmentManager(fragmentManager)- .withMemoryBar(true)- .withContent(chooserContent)- .allowCustomPath(true)- .setType(StorageChooser.DIRECTORY_CHOOSER)- .build()-- chooser.show()-- chooser.setOnSelectListener { path -> setupData(path) }- }- true- }-- // On AAOS, prefer the app-owned shared-media directory. This remains a- // normal filesystem path, so the native OpenMW core does not need SAF/VFS- // changes and the game data is not copied into Android/data.- autoSelectAutomotiveGameFilesIfAvailable()- }-- private fun autoSelectAutomotiveGameFilesIfAvailable() {- if (!BuildConfig.IS_AUTOMOTIVE_BUILD)- return-- val sharedPref = preferenceScreen.sharedPreferences- val currentPath = sharedPref.getString("game_files", "") ?: ""- if (currentPath.isNotEmpty() && GameInstaller(currentPath).check())- return-- val mediaDirs = activity.externalMediaDirs- for (mediaRoot in mediaDirs) {- if (mediaRoot == null)- continue-- val candidate = File(mediaRoot, "Morrowind")- if (GameInstaller(candidate.absolutePath).check()) {- setupData(candidate.absolutePath)- return- }- }- }-- private fun dp(value: Int): Int =- (value * resources.displayMetrics.density + 0.5f).toInt()-- private fun prepareControllerTriggerPreference() {- val key = "pref_omw051_controller_trigger_thresholds"- val preference = findPreference(key) as? ListPreference ?: return- val stored = preferenceScreen.sharedPreferences- .getString(key, "30720,26624")- ?: "30720,26624"-- if (preference.findIndexOfValue(stored) >= 0) {- return- }-- val values = stored.split(',', limit = 2)- val triggerPress = values.getOrNull(0)?.trim()?.toIntOrNull()- val triggerRelease = values.getOrNull(1)?.trim()?.toIntOrNull()- val customLabel = if (triggerPress != null && triggerRelease != null) {- getString(R.string.controller_trigger_custom_values, triggerPress, triggerRelease)- } else {- getString(R.string.controller_trigger_custom)- }-- preference.entries = preference.entries- .toMutableList()- .apply { add(customLabel) }- .toTypedArray()- preference.entryValues = preference.entryValues- .toMutableList()- .apply { add(stored) }- .toTypedArray()- }-- private fun showSteppedSliderPreference(- key: String,- title: String,- minimum: Float,- maximum: Float,- step: Float,- defaultValue: Float,- neutralLabel: String? = null- ) {- val sharedPref = preferenceScreen.sharedPreferences- val current = sharedPref.getString(key, "")- ?.toFloatOrNull()- ?.coerceIn(minimum, maximum)- ?: defaultValue.coerceIn(minimum, maximum)-- val steps = kotlin.math.round((maximum - minimum) / step).toInt()- val initialProgress = kotlin.math.round((current - minimum) / step)- .toInt()- .coerceIn(0, steps)-- val valueLabel = TextView(activity).apply {- textSize = 18f- gravity = Gravity.CENTER- }-- val seekBar = SeekBar(activity).apply {- max = steps- progress = initialProgress- }-- fun valueForProgress(progress: Int): Float =- (minimum + progress * step).coerceIn(minimum, maximum)-- fun updateLabel(progress: Int) {- valueLabel.text = String.format(Locale.ROOT, "%.1f", valueForProgress(progress))- }-- updateLabel(initialProgress)-- seekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {- override fun onProgressChanged(bar: SeekBar?, progress: Int, fromUser: Boolean) {- updateLabel(progress)- }-- override fun onStartTrackingTouch(bar: SeekBar?) = Unit- override fun onStopTrackingTouch(bar: SeekBar?) = Unit- })-- val content = LinearLayout(activity).apply {- orientation = LinearLayout.VERTICAL- setPadding(dp(24), dp(16), dp(24), dp(8))- addView(- valueLabel,- LinearLayout.LayoutParams(- LinearLayout.LayoutParams.MATCH_PARENT,- LinearLayout.LayoutParams.WRAP_CONTENT- )- )- addView(- seekBar,- LinearLayout.LayoutParams(- LinearLayout.LayoutParams.MATCH_PARENT,- LinearLayout.LayoutParams.WRAP_CONTENT- ).apply { topMargin = dp(8) }- )-- val limits = LinearLayout(activity).apply {- orientation = LinearLayout.HORIZONTAL- addView(- TextView(activity).apply {- text = String.format(Locale.ROOT, "%.1f", minimum)- },- LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f)- )- addView(- TextView(activity).apply {- text = String.format(Locale.ROOT, "%.1f", maximum)- gravity = Gravity.END- },- LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f)- )- }- addView(- limits,- LinearLayout.LayoutParams(- LinearLayout.LayoutParams.MATCH_PARENT,- LinearLayout.LayoutParams.WRAP_CONTENT- )- )- }-- val builder = AlertDialog.Builder(activity)- .setTitle(title)- .setView(content)- .setNegativeButton(android.R.string.cancel, null)- .setPositiveButton(android.R.string.ok) { _, _ ->- sharedPref.edit()- .putString(- key,- String.format(Locale.ROOT, "%.1f", valueForProgress(seekBar.progress))- )- .apply()- updatePreference(findPreference(key), key)- }-- if (neutralLabel != null) {- builder.setNeutralButton(neutralLabel) { _, _ ->- sharedPref.edit().putString(key, "").apply()- updatePreference(findPreference(key), key)- }- }-- builder.show()- }-- private fun showCustomResolutionDialog() {- val sharedPref = preferenceScreen.sharedPreferences- val current = sharedPref.getString("pref_customResolution", "") ?: ""- val match = Regex("""^\s*(\d+)\s*[xX×]\s*(\d+)\s*$""").matchEntire(current)-- val widthInput = EditText(activity).apply {- inputType = InputType.TYPE_CLASS_NUMBER- hint = getString(R.string.resolution_width_hint)- gravity = Gravity.CENTER- setSingleLine(true)- match?.groupValues?.getOrNull(1)?.let { setText(it) }- }-- val separator = TextView(activity).apply {- text = "×"- textSize = 20f- gravity = Gravity.CENTER- setPadding(dp(10), 0, dp(10), 0)- }-- val heightInput = EditText(activity).apply {- inputType = InputType.TYPE_CLASS_NUMBER- hint = getString(R.string.resolution_height_hint)- gravity = Gravity.CENTER- setSingleLine(true)- match?.groupValues?.getOrNull(2)?.let { setText(it) }- }-- val row = LinearLayout(activity).apply {- orientation = LinearLayout.HORIZONTAL- gravity = Gravity.CENTER_VERTICAL- setPadding(dp(20), dp(10), dp(20), dp(4))- addView(- widthInput,- LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f)- )- addView(- separator,- LinearLayout.LayoutParams(- LinearLayout.LayoutParams.WRAP_CONTENT,- LinearLayout.LayoutParams.WRAP_CONTENT- )- )- addView(- heightInput,- LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1f)- )- }-- val dialog = AlertDialog.Builder(activity)- .setTitle(getString(R.string.pref_customResolution))- .setView(row)- .setNegativeButton(android.R.string.cancel, null)- .setNeutralButton(R.string.resolution_native) { _, _ ->- sharedPref.edit().putString("pref_customResolution", "").apply()- updatePreference(findPreference("pref_customResolution"), "pref_customResolution")- }- .setPositiveButton(android.R.string.ok, null)- .create()-- dialog.setOnShowListener {- dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {- val width = widthInput.text.toString().toIntOrNull()- val height = heightInput.text.toString().toIntOrNull()-- if (width == null || height == null || width <= 0 || height <= 0) {- Toast.makeText(- activity,- getString(R.string.resolution_invalid),- Toast.LENGTH_SHORT- ).show()- return@setOnClickListener- }-- sharedPref.edit()- .putString("pref_customResolution", "${width}x${height}")- .apply()- updatePreference(findPreference("pref_customResolution"), "pref_customResolution")- dialog.dismiss()- }- }-- dialog.show()- }-- /**- * Checks the specified path for a valid morrowind installation, generates config files- * and saves the path to shared prefs if it's valid.- * If it isn't, an error is displayed to the user.- */- private fun setupData(path: String) {- val sharedPref = preferenceScreen.sharedPreferences-- // reset the setting so that it's erased on error instead of keeping- // possibly stale value- var gameFiles = ""-- val inst = GameInstaller(path)- if (inst.check()) {- inst.setNomedia()- if (!inst.convertIni(sharedPref.getString("pref_encoding", GameInstaller.DEFAULT_CHARSET_PREF)!!)) {- showError(R.string.data_error_title, R.string.ini_error_message)- } else {- gameFiles = path- }- } else {- showError(R.string.data_error_title, R.string.data_error_message,- "https://omw.xyz.is/game.html")- }-- with(sharedPref.edit()) {- putString("game_files", gameFiles)- apply()- }- }-- /**- * Shows an alert dialog displaying a specific error- * @param title Title string resource- * @param message Message string resource- */- private fun showError(title: Int, message: Int, url: String? = null) {- val dialog = AlertDialog.Builder(activity)- .setTitle(title)- .setMessage(message)- .setPositiveButton(android.R.string.ok) { _: DialogInterface, _: Int -> }-- if (url != null) {- dialog.setNeutralButton(R.string.dialog_howto) { _, _ ->- (activity as MainActivity).openUrl(url)- }- }-- dialog.show()- }-- override fun onResume() {- super.onResume()- for (i in 0 until preferenceScreen.preferenceCount) {- val preference = preferenceScreen.getPreference(i)- if (preference is PreferenceGroup) {- for (j in 0 until preference.preferenceCount) {- val singlePref = preference.getPreference(j)- updatePreference(singlePref, singlePref.key)- }- } else {- updatePreference(preference, preference.key)- }- }- }-- override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String?) {- if (key == null)- return- updatePreference(findPreference(key), key)- updateGammaState()- }-- private fun updatePreference(preference: Preference?, key: String) {- if (preference == null)- return- val sharedPref = preference.sharedPreferences- when (key) {- "pref_uiScaling" -> {- val value = sharedPref.getString(key, "") ?: ""- preference.summary = if (value.isEmpty()) {- MyApp.app.getString(R.string.uiScaling_auto)- .format(Locale.ROOT, MyApp.app.defaultScaling)- } else {- value- }- }- "pref_customResolution" -> {- val value = sharedPref.getString(key, "") ?: ""- preference.summary = if (value.isEmpty()) getString(R.string.resolution_native) else value.replace('x', '×')- }- "pref_gamma" -> {- val value = sharedPref.getString(key, "") ?: ""- preference.summary = if (value.isEmpty()) "1.0" else value- }- else -> if (preference is EditTextPreference) {- preference.summary = preference.text- }- }- // Show selected value as a summary for game_files- if (key == "game_files") {- preference.summary = preference.sharedPreferences.getString("game_files", "")- }- }-- /**- * Update launcher controls whose availability depends on another option.- * GLES1 is no longer exposed by the OpenMW 0.51 Android launcher.- */- private fun updateGammaState() {- val sharedPref = preferenceScreen.sharedPreferences- findPreference("pref_gamma").isEnabled = true-- var isnohighpenabled = false;- if(sharedPref.getString("pref_shadersDir_v2", "") == "modified")- isnohighpenabled = true- findPreference("pref_nohighp").isEnabled = isnohighpenabled-/*- var isAdditionalAnimSourcesEnabled = false;- if(sharedPref.getBoolean("gs_use_additional_animation_sources", false) == true) isAdditionalAnimSourcesEnabled = true- findPreference("gs_weapon_sheating").isEnabled = isAdditionalAnimSourcesEnabled- findPreference("gs_shield_sheating").isEnabled = isAdditionalAnimSourcesEnabled-*/- }--}diff --git a/android/app/src/main/java/utils/BugsnagApiKey.kt b/android/app/src/main/java/utils/BugsnagApiKey.ktdeleted file mode 100644index a94335e..0000000--- a/android/app/src/main/java/utils/BugsnagApiKey.kt+++ /dev/null@@ -1,12 +0,0 @@-package utils--/**- * This provides a global access to bugsnag api key.- * To enable crash reporting, put a valid bugsnag api key here.- * And mark this file as unchanged in git tree with:- * git update-index --assume-unchanged BugsnagApiKey.kt- */-object BugsnagApiKey {- // Put your Bugsnag API key here to enable crash reporting- const val API_KEY = ""-}diff --git a/android/app/src/main/java/utils/MyApp.kt b/android/app/src/main/java/utils/MyApp.ktdeleted file mode 100644index 50fb01d..0000000--- a/android/app/src/main/java/utils/MyApp.kt+++ /dev/null@@ -1,189 +0,0 @@-package utils--import android.app.Application-import android.content.pm.PackageManager-import android.os.Environment-import android.preference.PreferenceManager-import android.util.Base64-import android.util.Log-import com.bugsnag.android.Bugsnag-import com.bugsnag.android.Configuration-import constants.Constants-import java.io.File-import java.security.MessageDigest--class MyApp : Application() {-- var defaultScaling = 0f-- override fun onCreate() {- app = this-- super.onCreate()-- setupPaths()-- // Enable Bugsnag only when an API key is provided and we have user consent.- // Also don't enable Bugsnag in debug builds.- if (isProductionBuild() && BugsnagApiKey.API_KEY.isNotEmpty() && !com.libopenmw.openmw.BuildConfig.DEBUG) {- haveBugsnagApiKey = true-- val prefs = PreferenceManager.getDefaultSharedPreferences(this)- if (prefs.getString("bugsnag_consent", "false") == "true") {- val config = Configuration(BugsnagApiKey.API_KEY)- config.buildUUID = ""- Bugsnag.init(this, config)- reportCrashes = true- }- }- }-- private fun setupPaths() {- // Android-conform app-specific external storage. Do not construct- // /storage/emulated/0/Android/data paths manually; Android supplies- // the correct volume/package path here (also on ChromeOS).- val externalBase = getExternalFilesDir(null)- val userRoot = if (externalBase != null) {- File(externalBase, USER_STORAGE_DIRECTORY)- } else {- // Very unusual fallback when shared/external storage is unavailable.- // OpenMW can still run with an internal user-data directory.- Log.w(TAG, "getExternalFilesDir(null) returned null; using internal user storage.")- File(filesDir, "user/$USER_STORAGE_DIRECTORY")- }-- Constants.USER_FILE_STORAGE = userRoot.absolutePath-- // With the canonical applicationId com.ast.openmw this normally resolves to:- // /storage/emulated/0/Android/data/com.ast.openmw/files/OpenMW- Constants.USER_CONFIG = File(userRoot, "config").absolutePath- Constants.USER_OPENMW_CFG = File(userRoot, "config/openmw.cfg").absolutePath-- Constants.DEFAULTS_BIN = File(filesDir, "config/defaults.bin").absolutePath- Constants.OPENMW_CFG = File(filesDir, "config/openmw.cfg").absolutePath- Constants.OPENMW_BASE_CFG = File(filesDir, "config/openmw.base.cfg").absolutePath- Constants.OPENMW_FALLBACK_CFG = File(filesDir, "config/openmw.fallback.cfg").absolutePath- Constants.RESOURCES = File(filesDir, "resources").absolutePath- Constants.GLOBAL_CONFIG = File(filesDir, "config").absolutePath- Constants.VERSION_STAMP = File(filesDir, "stamp").absolutePath- Constants.ISOWIND = File(filesDir, "isowind").absolutePath-- Log.i(TAG, "OpenMW user storage: ${Constants.USER_FILE_STORAGE}")- }-- /**- * One-time migration of the old public /storage/emulated/0/omw tree.- *- * This is intentionally called from MainActivity.onResume(), rather than- * Application.onCreate(), because an existing installation may still need- * to grant legacy shared-storage permission before the old tree is readable.- *- * The migration includes saves, screenshots, config, icons, resources and- * navmesh.db. The old tree is deleted only after a verified successful copy.- */- @Synchronized- fun migrateLegacyUserStorageIfPossible() {- val target = File(Constants.USER_FILE_STORAGE)-- try {- val legacy = File(Environment.getExternalStorageDirectory(), LEGACY_USER_STORAGE_DIRECTORY)-- if (!legacy.isDirectory) {- target.mkdirs()- return- }-- // Never attempt to migrate if paths unexpectedly resolve to the same place.- if (legacy.canonicalFile == target.canonicalFile) {- target.mkdirs()- return- }-- target.parentFile?.mkdirs()-- // Fast path: a rename preserves timestamps and avoids copying large saves/resources.- if (!target.exists() && legacy.renameTo(target)) {- Log.i(TAG, "Migrated legacy OpenMW storage by rename: ${legacy.absolutePath} -> ${target.absolutePath}")- return- }-- // Fallback for FUSE/scoped-storage implementations where rename across- // directory classes is rejected. Legacy data wins during this one-time- // migration; the launcher will refresh generated resources afterwards.- if (!target.exists() && !target.mkdirs()) {- Log.w(TAG, "Could not create OpenMW user storage at ${target.absolutePath}")- return- }-- val copied = legacy.copyRecursively(- target = target,- overwrite = true,- onError = { file, exception ->- Log.e(TAG, "Failed migrating ${file.absolutePath}", exception)- kotlin.io.OnErrorAction.TERMINATE- }- )-- if (!copied || !verifyMigration(legacy, target)) {- Log.w(- TAG,- "Legacy OpenMW storage migration was incomplete; keeping ${legacy.absolutePath} as a safety copy."- )- return- }-- if (legacy.deleteRecursively()) {- Log.i(TAG, "Legacy OpenMW storage migrated and removed: ${legacy.absolutePath}")- } else {- Log.w(- TAG,- "Migration succeeded, but the old directory could not be removed: ${legacy.absolutePath}"- )- }- } catch (e: SecurityException) {- // Expected on a first launch before legacy storage permission is granted.- Log.w(TAG, "Legacy /omw migration is not permitted yet; it will be retried.", e)- target.mkdirs()- } catch (e: Exception) {- Log.e(TAG, "Legacy /omw migration failed; keeping the old directory untouched.", e)- target.mkdirs()- }- }-- private fun verifyMigration(source: File, target: File): Boolean {- return try {- source.walkTopDown()- .filter { it.isFile }- .all { sourceFile ->- val relative = sourceFile.relativeTo(source).path- val targetFile = File(target, relative)- targetFile.isFile && targetFile.length() == sourceFile.length()- }- } catch (e: Exception) {- Log.e(TAG, "Could not verify legacy OpenMW storage migration.", e)- false- }- }-- private fun isProductionBuild(): Boolean {- val packageInfo = applicationContext.packageManager.getPackageInfo(- applicationContext.packageName,- PackageManager.GET_SIGNATURES- )- val sig = packageInfo.signatures?.firstOrNull() ?: return false- val digest = MessageDigest.getInstance("SHA-256")- val hashBytes = digest.digest(sig.toByteArray())- val hash = Base64.encodeToString(hashBytes, Base64.NO_WRAP)- return hash == "cOqSYH3ucLraOQ7wyg/v8UKTGHlxP8N8JTN6UXO7rV0="- }-- companion object {- private const val TAG = "OpenMW-Storage"- private const val USER_STORAGE_DIRECTORY = "OpenMW"- private const val LEGACY_USER_STORAGE_DIRECTORY = "omw"-- var reportCrashes = false- var haveBugsnagApiKey = false- lateinit var app: MyApp- }-}diff --git a/android/app/src/main/java/utils/Utils.kt b/android/app/src/main/java/utils/Utils.ktdeleted file mode 100644index fb303ec..0000000--- a/android/app/src/main/java/utils/Utils.kt+++ /dev/null@@ -1,43 +0,0 @@-/*- Copyright (C) 2017 sandstranger- Copyright (C) 2018, 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package utils--import android.app.Activity-import android.view.View-import com.libopenmw.openmw.BuildConfig--object Utils {- fun hideAndroidControls(activity: Activity) {- // The Automotive flavor renders inside the app area reserved by AAOS.- // The Mobile flavor retains the existing immersive fullscreen behavior.- if (BuildConfig.IS_AUTOMOTIVE_BUILD) {- activity.window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE- return- }-- activity.window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE- or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION- or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN- or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION- or View.SYSTEM_UI_FLAG_FULLSCREEN- or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)- }-}diff --git a/android/app/src/main/res/drawable/attack.png b/android/app/src/main/res/drawable/attack.pngdeleted file mode 100644index 7e067bd..0000000Binary files a/android/app/src/main/res/drawable/attack.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/ic_drag_handle_black_24dp.xml b/android/app/src/main/res/drawable/ic_drag_handle_black_24dp.xmldeleted file mode 100644index 68a7190..0000000--- a/android/app/src/main/res/drawable/ic_drag_handle_black_24dp.xml+++ /dev/null@@ -1,9 +0,0 @@-<vector xmlns:android="http://schemas.android.com/apk/res/android"- android:width="24dp"- android:height="24dp"- android:viewportWidth="24.0"- android:viewportHeight="24.0">- <path- android:fillColor="#FF000000"- android:pathData="M20,9H4v2h16V9zM4,15h16v-2H4v2z"/>-</vector>diff --git a/android/app/src/main/res/drawable/inventory.png b/android/app/src/main/res/drawable/inventory.pngdeleted file mode 100644index a55989f..0000000Binary files a/android/app/src/main/res/drawable/inventory.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/journal.png b/android/app/src/main/res/drawable/journal.pngdeleted file mode 100644index 8840827..0000000Binary files a/android/app/src/main/res/drawable/journal.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/jump.png b/android/app/src/main/res/drawable/jump.pngdeleted file mode 100644index 0416c74..0000000Binary files a/android/app/src/main/res/drawable/jump.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/keyboard.png b/android/app/src/main/res/drawable/keyboard.pngdeleted file mode 100644index 980396a..0000000Binary files a/android/app/src/main/res/drawable/keyboard.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/load.xml b/android/app/src/main/res/drawable/load.xmldeleted file mode 100644index 8511f5f..0000000--- a/android/app/src/main/res/drawable/load.xml+++ /dev/null@@ -1,4 +0,0 @@-<vector android:height="100dp" android:viewportHeight="576"- android:viewportWidth="576" android:width="100dp" xmlns:android="http://schemas.android.com/apk/res/android">- <path android:fillColor="#FFFFFFFF" android:pathData="m572.694,324.093 l-72.424,124.155A63.997,63.997 0,0 1,444.989 480H45.025c-18.523,0 -30.064,-20.093 -20.731,-36.093l72.424,-124.155A64,64 0,0 1,152 288h399.964c18.523,0 30.064,20.093 20.73,36.093zM152,256h328v-48c0,-26.51 -21.49,-48 -48,-48h-160l-64,-64H48C21.49,96 0,117.49 0,144V422.046L69.077,303.628C86.214,274.25 117.989,256 152,256Z"/>-</vector>diff --git a/android/app/src/main/res/drawable/mod_item_background.xml b/android/app/src/main/res/drawable/mod_item_background.xmldeleted file mode 100644index b5bab4d..0000000--- a/android/app/src/main/res/drawable/mod_item_background.xml+++ /dev/null@@ -1,8 +0,0 @@-<shape xmlns:android="http://schemas.android.com/apk/res/android"- android:shape="rectangle">- <gradient- android:startColor="@color/modItemBackgroundColor"- android:endColor="@color/modItemBackgroundColor"- android:angle="90" />-</shape>-diff --git a/android/app/src/main/res/drawable/mod_item_selected_background.xml b/android/app/src/main/res/drawable/mod_item_selected_background.xmldeleted file mode 100644index 2837be0..0000000--- a/android/app/src/main/res/drawable/mod_item_selected_background.xml+++ /dev/null@@ -1,8 +0,0 @@-<shape xmlns:android="http://schemas.android.com/apk/res/android"- android:shape="rectangle">- <gradient- android:startColor="@color/modItemSelectedColor"- android:endColor="@color/modItemSelectedColor"- android:angle="90" />-</shape>-diff --git a/android/app/src/main/res/drawable/mouse.png b/android/app/src/main/res/drawable/mouse.pngdeleted file mode 100644index 01edcb3..0000000Binary files a/android/app/src/main/res/drawable/mouse.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/pause.png b/android/app/src/main/res/drawable/pause.pngdeleted file mode 100644index fc5ca1e..0000000Binary files a/android/app/src/main/res/drawable/pause.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/pointer_arrow.png b/android/app/src/main/res/drawable/pointer_arrow.pngdeleted file mode 100644index 99160f1..0000000Binary files a/android/app/src/main/res/drawable/pointer_arrow.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/progressbar.png b/android/app/src/main/res/drawable/progressbar.pngdeleted file mode 100644index b7989d8..0000000Binary files a/android/app/src/main/res/drawable/progressbar.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/progressbarbackground.png b/android/app/src/main/res/drawable/progressbarbackground.pngdeleted file mode 100644index cbcef6f..0000000Binary files a/android/app/src/main/res/drawable/progressbarbackground.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/run.png b/android/app/src/main/res/drawable/run.pngdeleted file mode 100644index 3fd763a..0000000Binary files a/android/app/src/main/res/drawable/run.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/save.png b/android/app/src/main/res/drawable/save.pngdeleted file mode 100644index 68773d4..0000000Binary files a/android/app/src/main/res/drawable/save.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/sneak.png b/android/app/src/main/res/drawable/sneak.pngdeleted file mode 100644index 4a695c8..0000000Binary files a/android/app/src/main/res/drawable/sneak.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/third_person.png b/android/app/src/main/res/drawable/third_person.pngdeleted file mode 100644index 5dd7b3d..0000000Binary files a/android/app/src/main/res/drawable/third_person.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/toggle.png b/android/app/src/main/res/drawable/toggle.pngdeleted file mode 100644index 8ee7f80..0000000Binary files a/android/app/src/main/res/drawable/toggle.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/toggle_magic.png b/android/app/src/main/res/drawable/toggle_magic.pngdeleted file mode 100644index 0571cb1..0000000Binary files a/android/app/src/main/res/drawable/toggle_magic.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/toggle_weapon.png b/android/app/src/main/res/drawable/toggle_weapon.pngdeleted file mode 100644index 4862a38..0000000Binary files a/android/app/src/main/res/drawable/toggle_weapon.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/use.png b/android/app/src/main/res/drawable/use.pngdeleted file mode 100644index 92dc273..0000000Binary files a/android/app/src/main/res/drawable/use.png and /dev/null differdiff --git a/android/app/src/main/res/drawable/wait.png b/android/app/src/main/res/drawable/wait.pngdeleted file mode 100644index e19e63e..0000000Binary files a/android/app/src/main/res/drawable/wait.png and /dev/null differdiff --git a/android/app/src/main/res/layout-night/main.xml b/android/app/src/main/res/layout-night/main.xmldeleted file mode 100644index 1123acb..0000000--- a/android/app/src/main/res/layout-night/main.xml+++ /dev/null@@ -1,46 +0,0 @@-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"- xmlns:app="http://schemas.android.com/apk/res-auto"- android:id="@+id/drawer_layout"- android:layout_width="match_parent"- android:layout_height="match_parent"- android:orientation="vertical">-- <androidx.appcompat.widget.Toolbar- android:id="@+id/main_toolbar"- android:layout_width="match_parent"- android:layout_height="?attr/actionBarSize"- android:background="?attr/colorPrimary"- android:elevation="4dp"- android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"- app:popupTheme="@style/ThemeOverlay.AppCompat.Dark"/>-- <LinearLayout- android:layout_width="match_parent"- android:layout_height="match_parent"- android:orientation="vertical">-- <FrameLayout- android:layout_width="match_parent"- android:layout_height="match_parent">-- <FrameLayout- android:id="@+id/content_frame"- android:layout_width="match_parent"- android:layout_height="match_parent"- android:layout_weight="4"-- />-- <com.google.android.material.floatingactionbutton.FloatingActionButton- android:id="@+id/fab"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_gravity="bottom|right"- android:layout_margin="16dp"- android:src="@android:drawable/ic_media_play"- app:backgroundTint="#555555"- app:rippleColor="#FFFFFF" />- </FrameLayout>- </LinearLayout>--</LinearLayout>diff --git a/android/app/src/main/res/layout/activity_mods.xml b/android/app/src/main/res/layout/activity_mods.xmldeleted file mode 100644index 08c053d..0000000--- a/android/app/src/main/res/layout/activity_mods.xml+++ /dev/null@@ -1,73 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"- xmlns:tools="http://schemas.android.com/tools"- android:layout_width="match_parent"- android:layout_height="match_parent"- xmlns:app="http://schemas.android.com/apk/res-auto"- tools:context="ui.activity.ModsActivity"- android:orientation="vertical">-- <androidx.appcompat.widget.Toolbar- android:id="@+id/mods_toolbar"- android:layout_width="match_parent"- android:layout_height="?attr/actionBarSize"- android:background="?attr/colorPrimary"- android:elevation="4dp"- android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"- app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>-- <com.google.android.material.tabs.TabLayout- android:layout_height="wrap_content"- android:layout_width="match_parent"- app:tabTextAppearance="@style/MyCustomTextAppearance"- android:id="@+id/tabLayout"- app:tabMode="scrollable">-- <com.google.android.material.tabs.TabItem- android:layout_height="match_parent"- android:layout_width="wrap_content"- android:text="@string/tab_plugins"/>-- <com.google.android.material.tabs.TabItem- android:layout_height="match_parent"- android:layout_width="wrap_content"- android:text="@string/tab_resources"/>-- <com.google.android.material.tabs.TabItem- android:layout_height="match_parent"- android:layout_width="wrap_content"- android:text="@string/tab_dirs"/>-- <com.google.android.material.tabs.TabItem- android:layout_height="match_parent"- android:layout_width="wrap_content"- android:text="@string/tab_groundcover"/>- </com.google.android.material.tabs.TabLayout>-- <ViewFlipper- android:id="@+id/flipper"- android:layout_width="match_parent"- android:layout_height="match_parent">-- <androidx.recyclerview.widget.RecyclerView- android:id="@+id/list_mods"- android:layout_width="match_parent"- android:layout_height="match_parent" />-- <androidx.recyclerview.widget.RecyclerView- android:id="@+id/list_resources"- android:layout_width="match_parent"- android:layout_height="match_parent" />-- <androidx.recyclerview.widget.RecyclerView- android:id="@+id/list_dirs"- android:layout_width="match_parent"- android:layout_height="match_parent" />-- <androidx.recyclerview.widget.RecyclerView- android:id="@+id/list_groundcovers"- android:layout_width="match_parent"- android:layout_height="match_parent" />- </ViewFlipper>--</LinearLayout>diff --git a/android/app/src/main/res/layout/activity_settings.xml b/android/app/src/main/res/layout/activity_settings.xmldeleted file mode 100644index c39e4d5..0000000--- a/android/app/src/main/res/layout/activity_settings.xml+++ /dev/null@@ -1,70 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"- xmlns:tools="http://schemas.android.com/tools"- android:layout_width="match_parent"- android:layout_height="match_parent"- xmlns:app="http://schemas.android.com/apk/res-auto"- tools:context="ui.activity.SettingsActivity"- android:orientation="vertical">-- <androidx.appcompat.widget.Toolbar- android:id="@+id/settings_toolbar"- android:layout_width="match_parent"- android:layout_height="?attr/actionBarSize"- android:background="?attr/colorPrimary"- android:elevation="4dp"- android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"- app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>-<!--- <com.google.android.material.tabs.TabLayout- android:layout_height="wrap_content"- android:layout_width="match_parent"- app:tabTextAppearance="@style/MyCustomTextAppearance"- android:id="@+id/settings_tabLayout">-- <com.google.android.material.tabs.TabItem- android:layout_height="match_parent"- android:layout_width="wrap_content"- android:text="tab 2"/>-- <com.google.android.material.tabs.TabItem- android:layout_height="match_parent"- android:layout_width="wrap_content"- android:text="tab 1"/>--- </com.google.android.material.tabs.TabLayout>-- <ViewFlipper- android:id="@+id/settings_flipper"- android:layout_width="match_parent"- android:layout_height="match_parent">-- <androidx.recyclerview.widget.RecyclerView- android:id="@+id/list_1"- android:layout_width="match_parent"- android:layout_height="match_parent" />-- <androidx.recyclerview.widget.RecyclerView- android:id="@+id/list_2"- android:layout_width="match_parent"- android:layout_height="match_parent" />-- </ViewFlipper>--->-- <FrameLayout- android:layout_width="match_parent"- android:layout_height="match_parent">-- <FrameLayout- android:id="@+id/settings_frame"- android:layout_width="match_parent"- android:layout_height="match_parent"- android:layout_weight="4"-- />-- </FrameLayout>--</LinearLayout>diff --git a/android/app/src/main/res/layout/configure_controls.xml b/android/app/src/main/res/layout/configure_controls.xmldeleted file mode 100644index 23e4b4e..0000000--- a/android/app/src/main/res/layout/configure_controls.xml+++ /dev/null@@ -1,78 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"- android:id="@+id/controlsContainer"- android:layout_width="match_parent"- android:layout_height="match_parent">-- <LinearLayout- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:orientation="vertical"- android:layout_centerInParent="true"- >--- <LinearLayout- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:orientation="horizontal">-- <Button- android:id="@+id/btnOpacityPlus"- android:layout_width="match_parent"- android:layout_height="wrap_content"- android:text="@string/btn_opacityPlus"- android:onClick="clickOpacityPlus"- />-- <Button- android:id="@+id/btnOpacityMinus"- android:layout_width="match_parent"- android:layout_height="wrap_content"- android:text="@string/btn_opacityMinus"- android:onClick="clickOpacityMinus"- />- </LinearLayout>--- <LinearLayout- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:orientation="horizontal">-- <Button- android:id="@+id/btnSizePlus"- android:layout_width="match_parent"- android:layout_height="wrap_content"- android:text="@string/btn_sizePlus"- android:onClick="clickSizePlus"- />-- <Button- android:id="@+id/btnSizeMinus"- android:layout_width="match_parent"- android:layout_height="wrap_content"- android:text="@string/btn_sizeMinus"- android:onClick="clickSizeMinus"- />- </LinearLayout>--- <Button- android:layout_width="match_parent"- android:layout_height="wrap_content"- android:text="@string/btn_resetControlsLayout"- android:onClick="clickResetControls"- />-- <Button- android:layout_width="match_parent"- android:layout_height="wrap_content"- android:text="@string/btn_back"- android:onClick="clickBack"- />--- </LinearLayout>--</RelativeLayout>diff --git a/android/app/src/main/res/layout/main.xml b/android/app/src/main/res/layout/main.xmldeleted file mode 100644index 9a2e839..0000000--- a/android/app/src/main/res/layout/main.xml+++ /dev/null@@ -1,46 +0,0 @@-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"- xmlns:app="http://schemas.android.com/apk/res-auto"- android:id="@+id/drawer_layout"- android:layout_width="match_parent"- android:layout_height="match_parent"- android:orientation="vertical">-- <androidx.appcompat.widget.Toolbar- android:id="@+id/main_toolbar"- android:layout_width="match_parent"- android:layout_height="?attr/actionBarSize"- android:background="?attr/colorPrimary"- android:elevation="4dp"- android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"- app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>-- <LinearLayout- android:layout_width="match_parent"- android:layout_height="match_parent"- android:orientation="vertical">-- <FrameLayout- android:layout_width="match_parent"- android:layout_height="match_parent">-- <FrameLayout- android:id="@+id/content_frame"- android:layout_width="match_parent"- android:layout_height="match_parent"- android:layout_weight="4"-- />-- <com.google.android.material.floatingactionbutton.FloatingActionButton- android:id="@+id/fab"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_gravity="bottom|right"- android:layout_margin="16dp"- android:src="@android:drawable/ic_media_play"- app:backgroundTint="#2196F3"- app:rippleColor="#FFFFFF" />- </FrameLayout>- </LinearLayout>--</LinearLayout>diff --git a/android/app/src/main/res/layout/mod_item.xml b/android/app/src/main/res/layout/mod_item.xmldeleted file mode 100644index 7f14dfb..0000000--- a/android/app/src/main/res/layout/mod_item.xml+++ /dev/null@@ -1,6 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/cardView" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:background="@drawable/mod_item_background">- <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_drag_handle_black_24dp" android:id="@+id/handle" android:layout_gravity="center_vertical" android:tint="#aaa" android:padding="10dp" />- <TextView android:id="@+id/txtTitle" android:text="@string/txttitle_text" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:paddingTop="10dp" android:paddingBottom="10dp" android:textColor="@color/modItemTextColor" />- <CheckBox android:paddingRight="10dp" android:id="@+id/modCheckbox" android:layout_width="wrap_content" android:layout_height="wrap_content" />-</LinearLayout>\ No newline at end of filediff --git a/android/app/src/main/res/layout/preference_widget_chevron.xml b/android/app/src/main/res/layout/preference_widget_chevron.xmldeleted file mode 100644index fecd146..0000000--- a/android/app/src/main/res/layout/preference_widget_chevron.xml+++ /dev/null@@ -1,10 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<TextView xmlns:android="http://schemas.android.com/apk/res/android"- android:layout_width="32dp"- android:layout_height="match_parent"- android:minHeight="48dp"- android:gravity="center"- android:text="›"- android:textSize="28sp"- android:textColor="?android:attr/textColorSecondary"- android:contentDescription="@null" />diff --git a/android/app/src/main/res/menu/menu_settings.xml b/android/app/src/main/res/menu/menu_settings.xmldeleted file mode 100644index 2a7a650..0000000--- a/android/app/src/main/res/menu/menu_settings.xml+++ /dev/null@@ -1,52 +0,0 @@-<menu xmlns:android="http://schemas.android.com/apk/res/android"- xmlns:app="http://schemas.android.com/apk/res-auto"- xmlns:tools="http://schemas.android.com/tools"- tools:context=".MainActivity">- <group android:id="@+id/main_menu_group">-- <item- android:id="@+id/action_reset_user_config"- android:title="@string/action_reset_user_config"- app:showAsAction="never"- />-- <item- android:id="@+id/action_reset_user_resources"- android:title="@string/action_reset_user_resources"- app:showAsAction="never"- />-- <item- android:id="@+id/action_bugsnag_consent"- android:title="@string/action_bugsnag_consent"- app:showAsAction="never"- />-- <item- android:id="@+id/action_theme"- android:title="@string/action_theme"- app:showAsAction="never">- <menu>- <item- android:id="@+id/action_theme_system"- android:title="@string/action_theme_system" />- <item- android:id="@+id/action_theme_light"- android:title="@string/action_theme_light" />- <item- android:id="@+id/action_theme_dark"- android:title="@string/action_theme_dark" />- <item- android:id="@+id/action_theme_oled"- android:title="@string/action_theme_oled" />- </menu>- </item>-- <item- android:id="@+id/action_about"- android:title="@string/action_about"- app:showAsAction="never"- />-- </group>-</menu>diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xmldeleted file mode 100644index 036d09b..0000000--- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml+++ /dev/null@@ -1,5 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">- <background android:drawable="@color/ic_launcher_background"/>- <foreground android:drawable="@mipmap/ic_launcher_foreground"/>-</adaptive-icon>\ No newline at end of filediff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xmldeleted file mode 100644index 036d09b..0000000--- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml+++ /dev/null@@ -1,5 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">- <background android:drawable="@color/ic_launcher_background"/>- <foreground android:drawable="@mipmap/ic_launcher_foreground"/>-</adaptive-icon>\ No newline at end of filediff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.pngdeleted file mode 100644index a967cc7..0000000Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.pngdeleted file mode 100644index 649003d..0000000Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.pngdeleted file mode 100644index a967cc7..0000000Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.pngdeleted file mode 100644index 7c2dc94..0000000Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.pngdeleted file mode 100644index 6cc5fa1..0000000Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.pngdeleted file mode 100644index 7c2dc94..0000000Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.pngdeleted file mode 100644index 19bd4c4..0000000Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.pngdeleted file mode 100644index 3241030..0000000Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.pngdeleted file mode 100644index 19bd4c4..0000000Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.pngdeleted file mode 100644index 678881b..0000000Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.pngdeleted file mode 100644index 00a71c7..0000000Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.pngdeleted file mode 100644index 678881b..0000000Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.pngdeleted file mode 100644index c4f190c..0000000Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.pngdeleted file mode 100644index 6deef06..0000000Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differdiff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.pngdeleted file mode 100644index c4f190c..0000000Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differdiff --git a/android/app/src/main/res/values-de/launcher_preferences.xml b/android/app/src/main/res/values-de/launcher_preferences.xmldeleted file mode 100644index 8635f05..0000000--- a/android/app/src/main/res/values-de/launcher_preferences.xml+++ /dev/null@@ -1,180 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<resources>- <string name="l10n_gs_animations_animations_title">Animationen</string>- <string name="gs_use_magic_item_animation_title">Animationen für magische Gegenstände verwenden</string>- <string name="gs_use_magic_item_animation_summary">Zauberanimationen auch für magische Gegenstände verwenden, genau wie bei Zaubern.</string>- <string name="gs_use_additional_animation_sources_title">Zusätzliche Animationsquellen verwenden</string>- <string name="gs_use_additional_animation_sources_summary">Gruppenbezogene KF-Dateien und Skelettdateien aus dem Ordner „Animations“ laden.</string>- <string name="gs_weapon_sheating_title">Waffen wegstecken</string>- <string name="gs_weapon_sheating_summary">Weggesteckte Waffen mit Köchern und Scheiden darstellen; benötigt angepasste Assets.</string>- <string name="gs_shield_sheating_title">Schild wegstecken</string>- <string name="gs_shield_sheating_summary">Weggesteckten Schild darstellen; benötigt angepasste Assets.</string>- <string name="gs_enable_graphics_herbalism_title">Grafisches Kräutersammeln aktivieren</string>- <string name="gs_enable_graphics_herbalism_summary">Unterstützte Pflanzenbehälter verwenden grafisches Kräutersammeln, anstatt ein Menü zu öffnen.</string>- <string name="gs_smooth_movement_title">Weiche Bewegung</string>- <string name="gs_smooth_movement_summary">Macht die Bewegung von NPCs und Spieler flüssiger. Empfohlen zusammen mit „In Bewegungsrichtung drehen“.</string>- <string name="gs_smooth_animation_transitions_title">Weiche Animationsübergänge</string>- <string name="gs_smooth_animation_transitions_summary">Blendet kompatible Animationsübergänge weich ineinander. Neu seit OpenMW 0.49; standardmäßig deaktiviert.</string>- <string name="gs_turn_to_movement_direction_title">In Bewegungsrichtung drehen</string>- <string name="gs_turn_to_movement_direction_summary">Beeinflusst seitliche und diagonale Bewegung. Aktiviert wirkt die Bewegung realistischer. Ist die Option deaktiviert, zeigt der gesamte Körper in Blickrichtung; diagonale Bewegung besitzt keine eigene Animation und kann gleitend wirken. Ist sie aktiviert, dreht die Figur den Unterkörper in Bewegungsrichtung, während der Oberkörper nur teilweise mitdreht. Der Kopf bleibt in Blickrichtung. Im Kampf wirkt dies nur bei diagonaler Bewegung, außerhalb des Kampfes auch bei direkter Bewegung nach links und rechts. Beim Schwimmen wird außerdem der ganze Körper entsprechend der Bewegungsrichtung nach oben oder unten gedreht.</string>- <string name="l10n_gs_engine_engine_title">Engine</string>- <string name="gs_groundcover_handling_title">Bodenbewuchs</string>- <string name="gs_groundcover_handling_summary">Aktiviert den nativen instanzierten Bodenbewuchs-Renderer von OpenMW 0.51 für Mods aus dem Reiter „Bodenbewuchs“.</string>- <string name="gs_groundcover_handling_dialogtitle">Bodenbewuchs-Verarbeitung</string>- <string name="gs_groundcover_point_lighting_title">Punktlicht auf Bodenbewuchs</string>- <string name="gs_groundcover_point_lighting_summary">OpenMW 0.51: Nahe Lampen und andere Punktlichter können Gras beleuchten. Deaktivieren, um etwas GPU-Leistung zu sparen.</string>- <string name="gs_build_navmesh_title">NavMesh für Weltgeometrie erstellen</string>- <string name="gs_build_navmesh_summary">Aktiviert den Navigator. Im Hintergrund werden Threads zum Erstellen des NavMesh für die Weltgeometrie gestartet. Die Wegfindung verwendet das NavMesh zur Pfadberechnung; ist die Option deaktiviert, wird nur das Pathgrid verwendet. Auf Einkern-CPUs kann das Verlassen von Innenbereichen und Bewegen durch die Außenwelt deutlich langsamer werden. Auf Mehrkern-CPUs ist der Einfluss meist gering, die Aktualisierungslatenz hängt aber von Systemleistung und weiteren Einstellungen ab. Beim Bewegen durch die Außenwelt sowie beim Betreten und Verlassen von Bereichen wird das NavMesh aktualisiert. NPCs und Kreaturen können möglicherweise keinen Weg finden, bevor das NavMesh um sie herum erstellt wurde. Deaktivieren, wenn das klassische KI-Verhalten ohne moderne Navigation gewünscht ist.</string>- <string name="gs_write_navmesh_title">NavMesh-Cache auf Datenträger schreiben</string>- <string name="gs_write_navmesh_summary">NavMesh-Kacheln auf dem Datenträger zwischenspeichern.</string>- <string name="l10n_gs_engine_threading_title">Threads</string>- <string name="gs_navmesh_threads_title">NavMesh-Hintergrundthreads</string>- <string name="gs_navmesh_threads_summary">Anzahl der Hintergrundthreads zur Aktualisierung des NavMesh. Einstellbar von 1 bis 8; Standard ist 1.</string>- <string name="gs_physics_threads_title">Physik-Hintergrundthreads</string>- <string name="gs_physics_threads_summary">Anzahl der Hintergrundthreads für Physikaktualisierungen. Einstellbar von 1 bis 8; Standard ist 1.</string>- <string name="gs_preload_threads_title">Preload-Hintergrundthreads</string>- <string name="gs_preload_threads_summary">Anzahl der Hintergrund-Threads zum Vorladen. OpenMW 0.51 empfiehlt auf Mehrkern-Systemen 2–3; 4 oder mehr werden nicht empfohlen.</string>- <string name="l10n_gs_bug_fixes_miscellaneous_title">Verschiedenes</string>- <string name="gs_merchant_equipping_fix_title">Fix für ausrüstende Händler</string>- <string name="gs_merchant_equipping_fix_summary">Verhindert, dass Händler Gegenstände ausrüsten, die ihnen verkauft wurden.</string>- <string name="gs_trainers_bs_title">Trainer wählen Fertigkeiten anhand ihrer Basiswerte</string>- <string name="gs_trainers_bs_summary">Trainer wählen angebotene Fertigkeiten nur anhand ihrer Basis-Fertigkeitswerte. Dadurch können Effekte zur Verbesserung von Feilschen verwendet werden, ohne dass Feilschen automatisch als Training angeboten wird.</string>- <string name="l10n_gs_shadows_general_title">Allgemein</string>- <string name="gs_enable_shadows_title">Schatten aktivieren</string>- <string name="gs_enable_shadows_summary">Aktiviert OpenMW-Echtzeit-Schattenmapping. Verwendet den Shader-Renderingpfad und kann die Leistung reduzieren.</string>- <string name="l10n_gs_shadows_shadow_casters_title">Schattenwerfer</string>- <string name="gs_player_shadows_title">Spielerschatten</string>- <string name="gs_player_shadows_summary">Erlaubt der Spielerfigur, Schatten zu werfen.</string>- <string name="gs_actor_shadows_title">Akteursschatten</string>- <string name="gs_actor_shadows_summary">Erlaubt NPCs und Kreaturen, Schatten zu werfen.</string>- <string name="gs_object_shadows_title">Objektschatten</string>- <string name="gs_object_shadows_summary">Erlaubt Weltobjekten, Schatten zu werfen.</string>- <string name="gs_terrain_shadows_title">Geländeschatten</string>- <string name="gs_terrain_shadows_summary">Erlaubt dem Gelände, Schatten zu werfen.</string>- <string name="gs_indoor_shadows_title">Schatten in Innenbereichen</string>- <string name="gs_indoor_shadows_summary">Erlaubt Schatten in Innenbereichen. Aufgrund der Einschränkungen der Morrowind-Daten können dort nur Akteure Schatten werfen.</string>- <string name="l10n_gs_shadows_quality_distance_title">Qualität & Entfernung</string>- <string name="gs_shadow_quality_title">Schattenqualität</string>- <string name="gs_shadow_quality_dialogtitle">Schattenqualität</string>- <string name="gs_shadow_distance_title">Schattenentfernung</string>- <string name="gs_shadow_distance_dialogtitle">Schattenentfernung</string>- <string name="l10n_gs_miscellaneous_saves_title">Spielstände</string>- <string name="gs_add_time_to_saves_title">Spielzeit in Spielständen anzeigen</string>- <string name="gs_add_time_to_saves_summary">Legt fest, ob die bisherige Spielzeit für jeden Spielstand im Laden-Menü angezeigt wird.</string>- <string name="gs_maximum_quicksaves_title">Maximale Schnellspeicherstände</string>- <string name="gs_maximum_quicksaves_summary">Maximale Anzahl gespeicherter Schnellspeicherstände.</string>- <string name="gs_maximum_quicksaves_dialogtitle">Maximale Schnellspeicherstände</string>- <string name="l10n_gs_visuals_terrain_title">Gelände</string>- <string name="gs_object_paging_min_size_title">Minimale Objektgröße für Paging</string>- <string name="gs_object_paging_min_size_summary">Legt fest, wie groß ein Objekt sein muss, um in der Szene sichtbar zu sein. Einstellbar von 0,01 bis 1,00 in Schritten von 0,01.</string>- <string name="gs_distant_land_title">Fernlandschaft</string>- <string name="gs_distant_land_summary">Aktiviert Paging- und LOD-Verfahren zur Darstellung des gesamten Geländes. Ist die Option deaktiviert, wird nur das Gelände der geladenen Zellen angezeigt.</string>- <string name="gs_active_grid_object_paging_title">Objekt-Paging im aktiven Raster</string>- <string name="gs_active_grid_object_paging_summary">Verwendet Objekt-Paging für das Raster aktiver Zellen.</string>- <string name="l10n_gs_visuals_graphics_title">Grafik</string>- <string name="pref_physicsfps2_summary">%s FPS</string>- <string name="l10n_gs_visuals_shaders_title">Shader</string>- <string name="gs_auto_use_object_normal_maps_title">Objekt-Normalmaps automatisch verwenden</string>- <string name="gs_auto_use_object_normal_maps_summary">Wenn aktiviert, werden passend benannte Normalmaps automatisch erkannt und verwendet (siehe „normal map pattern“; bei der Basistexur foo.dds müsste die Normalmap z. B. foo_n.dds heißen). Wenn deaktiviert, werden Normalmaps nur verwendet, wenn sie ausdrücklich in der Mesh-Datei (.nif oder .osg) aufgeführt sind. Betrifft Objekte.</string>- <string name="gs_auto_use_object_specular_maps_title">Objekt-Specularmaps automatisch verwenden</string>- <string name="gs_auto_use_object_specular_maps_summary">Wenn aktiviert, werden passend benannte Specularmaps automatisch erkannt und verwendet (siehe „specular map pattern“; bei der Basistexur foo.dds müsste die Specularmap z. B. foo_spec.dds heißen). Wenn deaktiviert, werden sie nur verwendet, wenn sie ausdrücklich in der Mesh-Datei aufgeführt sind (.osg; in .nif-Dateien nicht unterstützt). Betrifft Objekte.</string>- <string name="gs_auto_use_terrain_normal_maps_title">Gelände-Normalmaps automatisch verwenden</string>- <string name="gs_auto_use_terrain_normal_maps_summary">Siehe „Objekt-Normalmaps automatisch verwenden“. Betrifft das Gelände.</string>- <string name="gs_auto_use_terrain_specular_maps_title">Gelände-Specularmaps automatisch verwenden</string>- <string name="gs_auto_use_terrain_specular_maps_summary">Existiert eine Datei passend zum Muster „terrain specular map pattern“, wird sie als diffuse Specularmap verwendet. Die Textur muss die Ebenenfarbe wie üblich im RGB-Kanal und einen Specular-Multiplikator im Alpha-Kanal enthalten.</string>- <string name="gs_bump_map_local_lighting_title">Lokale Beleuchtung für Bump-/Reflexionsmaps</string>- <string name="gs_bump_map_local_lighting_summary">Normalerweise werden Spiegelungen von Environment-Maps nicht von der Beleuchtung beeinflusst, wodurch Environment- und damit Bump-Mapping-Objekte im Dunkeln leuchten können. Der Morrowind Code Patch behebt dies optional, indem Environment-Mapping vor der Beleuchtung angewendet wird; diese Einstellung entspricht dieser Option. Betroffene Objekte verwenden Shader.</string>- <string name="l10n_gs_visuals_fog_title">Nebel</string>- <string name="gs_radial_fog_title">Radialer Nebel</string>- <string name="gs_radial_fog_summary">Standardmäßig nimmt die Nebeldichte proportional zur Entfernung von der Clipping-Ebene zu, was an den Bildschirmrändern zu Verzerrungen führen kann. Diese Einstellung verwendet stattdessen die tatsächliche Entfernung vom Auge (euklidische Distanz) und lässt den Nebel besonders bei großem Sichtfeld natürlicher wirken.</string>- <string name="gs_exponential_fog_title">Exponentieller Nebel</string>- <string name="gs_exponential_fog_summary">Verwendet eine exponentielle Formel für den Nebel.</string>- <string name="gs_sky_blending_title">Himmelsüberblendung</string>- <string name="gs_sky_blending_summary">Verbirgt die Clipping-Ebene durch Überblendung mit dem Himmel.</string>- <string name="l10n_gs_visuals_post_processing_title">Nachbearbeitung</string>- <string name="gs_soft_particles_title">Weiche Partikel</string>- <string name="gs_soft_particles_summary">Weicht Übergänge zwischen transparenten Partikelsystemen und undurchsichtiger Geometrie auf.</string>- <string name="gs_transparent_postpass_title">Transparenz-Postpass</string>- <string name="gs_transparent_postpass_summary">Transparenter Tiefen-Postpass. Rendert transparente Objekte erneut und erzwingt Alpha-Clipping mit einem festen Schwellenwert.</string>- <string name="pref_game_settings_title">Spieleinstellungen</string>- <string name="pref_game_settings_summary">Gameplay, Grafik, Schatten, Animationen, Oberfläche und Engine konfigurieren.</string>- <string name="pref_mods_summary">Mods zu OpenMW hinzufügen.</string>- <string name="pref_omw050_controller_menus_title">Controller-Menüs</string>- <string name="pref_omw050_controller_menus_summary">Gamepad-optimierte Menünavigation von OpenMW 0.51 verwenden.</string>- <string name="pref_omw050_controller_tooltips_title">Controller-Tooltips</string>- <string name="pref_omw050_controller_tooltips_summary">Gegenstands-Tooltips immer anzeigen, ohne R3 drücken zu müssen.</string>- <string name="pref_omw051_controller_trigger_thresholds_title">Controller-Trigger-Empfindlichkeit</string>- <string name="pref_omw051_controller_trigger_thresholds_dialogtitle">Controller-Trigger-Empfindlichkeit</string>- <string name="pref_controls_summary">Bevorzugte Touch-Bildschirmsteuerung konfigurieren.</string>- <string name="gs_framerate_limit_summary">%s FPS</string>- <string name="l10n_settings_audio_title">Audio</string>- <string name="pref_omw050_doppler_title">Doppler-Effekt</string>- <string name="pref_omw050_doppler_summary">Positionsabhängigen Doppler-Audioeffekt von OpenMW 0.51 aktivieren (Faktor 0,25).</string>- <string name="pref_omw050_camera_listener_title">Kamera als Audio-Hörer</string>- <string name="pref_omw050_camera_listener_summary">Die Kameraposition statt der Spielerposition als 3D-Audio-Hörer verwenden.</string>- <string name="pref_skip_gui_title">Launcher-Oberfläche überspringen</string>- <string name="pref_skip_gui_summary">Beim Start der App „Lautstärke +“ gedrückt halten, um den Launcher wieder anzuzeigen.</string>- <string name="game_settings_game_mechanics_title">Gameplay</string>- <string name="game_settings_visuals_title">Grafik</string>- <string name="game_settings_shadows_title">Schatten</string>- <string name="game_settings_animations_title">Animationen</string>- <string name="game_settings_interface_title">Oberfläche</string>- <string name="game_settings_engine_title">Engine</string>- <string name="l10n_gs_interface_ui_title">Benutzeroberfläche</string>- <string name="gs_show_owned_title">Besitz anzeigen</string>- <string name="gs_show_owned_dialogtitle">Besitz anzeigen</string>- <string name="gs_show_effect_duration_title">Effektdauer anzeigen</string>- <string name="gs_show_effect_duration_summary">Zeigt die verbleibende Dauer magischer Effekte und Lichter im Tooltip an, wenn der Mauszeiger über dem magischen Effekt steht.</string>- <string name="gs_show_enchant_chance_title">Verzauberungschance anzeigen</string>- <string name="gs_show_enchant_chance_summary">Zeigt die Erfolgschance im Verzauberungsmenü an.</string>- <string name="gs_show_melee_info_title">Nahkampfinformationen anzeigen</string>- <string name="gs_show_melee_info_summary">Zeigt Reichweite und Geschwindigkeit von Nahkampfwaffen im Gegenstands-Tooltip an.</string>- <string name="gs_show_projectile_damage_title">Projektilschaden anzeigen</string>- <string name="gs_show_projectile_damage_summary">Zeigt den Schadensbonus von Pfeilen und Bolzen im Gegenstands-Tooltip an.</string>- <string name="gs_change_dialogue_topic_color_title">Farbe von Dialogthemen ändern</string>- <string name="gs_change_dialogue_topic_color_summary">Dialogthemen erhalten eine andere Farbe, wenn sie speziell für den aktuellen NPC gelten oder bereits zuvor gesehen wurden. Die Farbe kann in settings.cfg geändert werden.</string>- <string name="gs_stretch_menu_background_title">Menühintergrund strecken</string>- <string name="gs_stretch_menu_background_summary">Streckt Menüs, Ladebildschirme usw. auf das Seitenverhältnis des Fensters.</string>- <string name="gs_can_zoom_on_maps_title">Kartenzoom erlauben</string>- <string name="gs_can_zoom_on_maps_summary">Aktiviert das Zoomen auf lokalen und globalen Karten.</string>- <string name="l10n_gs_game_mechanics_general_title">Allgemein</string>- <string name="gs_soulgem_values_rebalance_title">Werte von Seelensteinen neu ausbalancieren</string>- <string name="gs_soulgem_values_rebalance_summary">Der Wert gefüllter Seelensteine hängt nur noch von der Stärke der Seele ab.</string>- <string name="gs_can_loot_during_death_animation_title">Plündern während der Todesanimation erlauben</string>- <string name="gs_can_loot_during_death_animation_summary">Ist diese Option aktiviert, kann der Spieler Akteure wie beschworene Kreaturen während ihrer Todesanimation plündern, sofern sie nicht mehr im Kampf sind. Dabei wird der Todeszähler erhöht und das Skript des entfernten Akteurs sofort ausgeführt. Ist die Option deaktiviert, muss immer bis zum Ende der Todesanimation gewartet werden. Dadurch werden Exploits mit beschworenen Kreaturen, etwa das Plündern beschworener Dremora und Goldener Heiliger für teure Waffen, deutlich erschwert. Kann mit Mannequin-Mods kollidieren, die SkipAnim verwenden, um das Ende der Todesanimation zu verhindern.</string>- <string name="gs_always_allow_stealing_from_knocked_out_actors_title">Diebstahl bei bewusstlosen Akteuren immer erlauben</string>- <string name="gs_always_allow_stealing_from_knocked_out_actors_summary">Erlaubt das Stehlen von Gegenständen bei niedergeschlagenen NPCs während des Kampfes.</string>- <string name="l10n_gs_game_mechanics_movement_combat_title">Bewegung & Kampf</string>- <string name="gs_toggle_sneak_title">Schleichen umschalten</string>- <string name="gs_toggle_sneak_summary">Ändert die Schleichtaste (standardmäßig Strg) zu einem Umschalter: Schleichen bleibt aktiv, ohne dass die Taste gehalten werden muss. Das kann die Steuerung für Spieler erleichtern, die häufig schleichen.</string>- <string name="gs_uncapped_damage_fatigue_title">Unbegrenzter Ausdauerschaden</string>- <string name="gs_uncapped_damage_fatigue_summary">Hebt die Begrenzung des Magieeffekts „Ausdauer schädigen“ analog zu „Ausdauer entziehen“ auf. Dadurch können Akteure anders als im ursprünglichen Morrowind mit diesem Effekt zu Boden gebracht werden.</string>- <string name="gs_only_weapon_bs_title">Nur passende Munition umgeht Resistenz gegen normale Waffen</string>- <string name="gs_only_weapon_bs_summary">Erlaubt nicht standardmäßiger Munition ausschließlich, Resistenz oder Schwäche gegen normale Waffen zu umgehen.</string>- <string name="gs_swim_upward_correction_title">Aufwärtskorrektur beim Schwimmen</string>- <string name="gs_swim_upward_correction_summary">Lässt den Spieler etwas oberhalb der Blicklinie schwimmen. Gilt nur in der Third-Person-Ansicht und soll Schwimmen ohne unbeabsichtigtes Abtauchen erleichtern.</string>- <string name="gs_factor_strength_into_hand_to_hand_combat_title">Stärke im waffenlosen Kampf berücksichtigen</string>- <string name="gs_factor_strength_into_hand_to_hand_combat_dialogtitle">Stärke im waffenlosen Kampf berücksichtigen</string>- <string name="l10n_gs_game_mechanics_npc_followers_title">NPCs & Begleiter</string>- <string name="gs_followers_defend_immediately_title">Begleiter verteidigen sofort</string>- <string name="gs_followers_defend_immediately_summary">Begleiter und eskortierte NPCs beginnen sofort den Kampf gegen Gegner, die sie oder den Spieler angegriffen haben. Andernfalls warten sie, bis der Gegner oder der Spieler zuerst angreift.</string>- <string name="gs_permanent_barter_disposition_changes_title">Dauerhafte Dispositionsänderungen beim Handeln</string>- <string name="gs_permanent_barter_disposition_changes_summary">Macht durch Handel verursachte Dispositionsänderungen von Händlern dauerhaft.</string>- <string name="gs_npc_avoid_collision_title">NPCs vermeiden Kollisionen</string>- <string name="gs_npc_avoid_collision_summary">NPCs führen Ausweichmanöver aus, um Kollisionen mit anderen zu vermeiden.</string>- <string name="gs_always_allow_npc_to_follow_over_water_surface_title">NPCs dürfen immer über Wasser folgen</string>- <string name="gs_always_allow_npc_to_follow_over_water_surface_summary">Erlaubt NPCs, beim Folgen eines anderen Akteurs an der Wasseroberfläche zu schwimmen, unabhängig von ihrer normalen Schwimmfähigkeit. Wirkt nur, wenn die NavMesh-Erstellung aktiviert ist.</string>- <string name="l10n_gs_game_mechanics_gameplay_fixes_title">Gameplay-Fixes</string>- <string name="gs_racial_variation_in_speed_fix_title">Fix für rassenabhängige Geschwindigkeitsunterschiede</string>- <string name="gs_racial_variation_in_speed_fix_summary">Das Rassengewicht wird bei der Berechnung der NPC-Bewegungsgeschwindigkeit nicht verwendet.</string>- <string name="gs_enchanted_weapons_are_magical_title">Verzauberte Waffen gelten als magisch</string>- <string name="gs_enchanted_weapons_are_magical_summary">Verzauberte Waffen ohne „Magisch“-Flag umgehen wie in Morrowind die Resistenz gegen normale Waffen.</string>- <string name="gs_classic_reflected_absorb_spells_behavior_title">Klassisches Verhalten reflektierter Absorptionszauber</string>- <string name="gs_classic_reflected_absorb_spells_behavior_summary">Die Effekte reflektierter Absorptionszauber werden wie in Morrowind nicht gespiegelt.</string>- <string name="l10n_gs_game_mechanics_saves_title">Spielstände</string>- <string name="txttitle_text">Mod-Name</string>- <string name="gs_groundcover_density_title">Bodenbewuchs-Dichte</string>- <string name="gs_groundcover_density_summary">Anteil der gerenderten Bodenbewuchs-Instanzen. 100 % erhält die vollständige Mod-Dichte; niedrigere Werte verbessern die Leistung.</string>- <string name="gs_groundcover_rendering_distance_title">Bodenbewuchs-Sichtweite</string>- <string name="gs_groundcover_rendering_distance_summary">Entfernung, bis zu der Bodenbewuchs gerendert wird. Größere Werte erhöhen den Renderaufwand.</string>-</resources>diff --git a/android/app/src/main/res/values-de/strings.xml b/android/app/src/main/res/values-de/strings.xmldeleted file mode 100644index efe125d..0000000--- a/android/app/src/main/res/values-de/strings.xml+++ /dev/null@@ -1,185 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="app_name">OpenMW</string>- <string name="general_settings">Einrichtung</string>- <string name="start_game_label">Spiel starten</string>- <string name="closeDrawer">Navigation</string>- <string name="openDrawer">Navigation geschlossen</string>- <string name="game_files">Spieldateien</string>- <string name="pref_graphicsLibrary">Grafik-API-Bibliothek</string>- <string name="pref_graphicsLibrary_default">gles2</string>- <string name="pref_advanced">Erweitert</string>- <string name="pref_graphics">Grafik</string>- <string name="pref_commandLine">Benutzerdefinierte Kommandozeilenargumente</string>- <string name="pref_envLine">Benutzerdefinierte Umgebungsvariablen</string>- <string name="pref_nohighp">Mittlere Shader-Präzision</string>- <string name="pref_nohighp_summary">Verwendet mittlere statt hoher Präzision; nur mit dem Shader-Preset „Modified“ verfügbar.</string>- <string name="pref_ui">Benutzeroberfläche</string>- <string name="pref_textureShrinking">Texturverkleinerung</string>- <string name="pref_textureShrinking_default">none</string>- <string name="pref_shadersDir">Shader-Presets</string>- <string name="pref_shadersDir_default">none</string>- <string name="pref_gamma">Gamma</string>- <string name="pref_uiScaling">UI-Skalierungsfaktor</string>- <string name="uiScaling_auto">Automatisch (%1$.2f)</string>- <string name="pref_screen_keeper">Bildschirm immer eingeschaltet lassen</string>- <string name="pref_touchpadSensitivity">Empfindlichkeit des virtuellen Touchpads</string>- <string name="action_reset_config">Statische Konfigurationsdateien zurücksetzen</string>- <string name="action_reset_user_config">Benutzerkonfigurationsdateien zurücksetzen</string>- <string name="action_reset_user_resources">Benutzerressourcen zurücksetzen</string>- <string name="action_reset_screen_controls">Bildschirmsteuerung zurücksetzen</string>- <string name="action_show_screen_controls">Bildschirmsteuerung</string>- <string name="pref_hide_controls">Bildschirmtasten ausblenden</string>- <string name="config_was_reset">Statische Konfiguration wurde auf Standardwerte zurückgesetzt</string>- <string name="user_config_was_reset">Benutzerkonfiguration wurde auf Standardwerte zurückgesetzt</string>- <string name="user_resources_was_reset">Benutzerressourcen wurden auf Standardwerte zurückgesetzt</string>- <string name="pref_lang">Spracheinstellungen</string>- <string name="pref_encoding">Spielsprache</string>- <string name="pref_encoding_default">win1252</string>- <string name="btn_opacityPlus">Alpha+</string>- <string name="btn_opacityMinus">Alpha-</string>- <string name="btn_sizePlus">Größe+</string>- <string name="btn_sizeMinus">Größe-</string>- <string name="btn_resetControlsLayout">Auf Standard zurücksetzen</string>- <string name="pref_physicsFPS2">Physik-FPS</string>- <string name="pref_framerate_limit">Bildratenlimit</string>- <string name="pref_framerate_limit_default">60</string>- <string name="pref_physicsFPS2_default">30</string>- <string name="btn_back">Zurück</string>- <string name="pref_customResolution">Benutzerdefinierte Auflösung</string>- <string name="pref_display_cutout_area">Im Display-Ausschnitt anzeigen</string>- <string name="mods">Spielmodifikationen</string>- <string name="action_about">Info</string>- <string name="about_title">Über OpenMW</string>- <string name="action_theme">Design</string>- <string name="action_theme_system">System</string>- <string name="action_theme_light">Hell</string>- <string name="action_theme_dark">Dunkel</string>- <string name="action_theme_oled">Schwarz/OLED</string>- <string name="activity_settings">Spieleinstellungen</string>- <string name="game_mechanics_activity_settings">Gameplay</string>- <string name="visuals_activity_settings">Grafik</string>- <string name="animations_activity_settings">Animationen</string>- <string name="interface_activity_settings">Oberfläche</string>- <string name="bug_fixes_activity_settings">Bugfixes</string>- <string name="miscellaneous_activity_settings">Verschiedenes</string>- <string name="engine_activity_settings">Engine</string>- <string name="activity_mods">Mods</string>- <string name="tab_plugins">Plugins</string>- <string name="tab_resources">Ressourcen</string>- <string name="tab_dirs">Verzeichnisse</string>- <string name="tab_groundcover">Bodenvegetation</string>- <string name="data_error_title">Fehler beim Auffinden der Spieldateien</string>- <string name="data_error_message">Bitte wähle ein Verzeichnis, das sowohl die Datei „Morrowind.ini“ als auch das Verzeichnis „Data Files“ enthält.</string>- <string name="permissions_error_title">Keine Berechtigung</string>- <string name="permissions_error_message">OpenMW benötigt Speicherberechtigungen, um die Morrowind-Spieldateien zu finden und darauf zuzugreifen. Bitte erteile diese Berechtigung in den App-Einstellungen.</string>- <string name="ini_error_message">Die Konfigurationsdatei konnte nicht umgewandelt werden. Bitte stelle sicher, dass „Morrowind.ini“ korrekt aufgebaut ist.</string>- <string name="no_data_files_title">Spieldateien nicht gefunden</string>- <string name="no_data_files_message">Du musst die Morrowind-Spieldateien auf dein Gerät kopieren und unter „Spieldateien“ den Pfad auswählen, bevor das Spiel gestartet werden kann.</string>- <string name="category_performance">Leistung</string>- <string name="no_content_files_title">Keine Inhaltsdateien!</string>- <string name="no_content_files_message">Es sind keine Inhaltsdateien aktiviert. Bevor das Spiel gestartet werden kann, musst du im Menü „Mods…“ mindestens eine Plugin-Datei aktivieren.</string>- <string name="no_content_files_dismiss">Trotzdem fortfahren</string>- <string name="configure_mods">Mods konfigurieren</string>- <string name="pref_mouse_mode">Mausmodus in Menüs</string>- <string name="pref_mouse_mode_default">hybrid</string>- <string name="bugsnag_yes">Ja</string>- <string name="bugsnag_no">Nein</string>- <string name="bugsnag_policy">Datenschutzerklärung</string>- <string name="bugsnag_consent_title">Abstürze automatisch melden?</string>- <string name="bugsnag_consent_message">Möchtest du die automatische Absturzmeldung aktivieren?\nBei einem Absturz werden einige Daten über dein Gerät, deine Konfiguration und installierte Mods automatisch an Bugsnag übermittelt. Weitere Informationen findest du in der Datenschutzerklärung.\nDiese Einstellung kann jederzeit über das Menü geändert werden.</string>- <string name="bugsnag_consent_restart_title">Bitte die Anwendung neu starten</string>- <string name="bugsnag_consent_restart_message">Du musst die Anwendung neu starten, damit diese Einstellungen wirksam werden.</string>- <string name="action_bugsnag_consent">Absturzberichte</string>- <string name="dialog_howto">Anleitung</string>- <string name="no_browser_title">URL kann nicht geöffnet werden</string>- <string name="no_browser_message">Es scheint kein Webbrowser installiert zu sein. Folgende URL sollte geöffnet werden:\n\n%1$s</string>- <string name="pref_show_qp">Schnelltasten aktivieren</string>- <string name="pref_show_fn">FN-Tasten aktivieren</string>- <string name="pref_always_show_top_bar">Symbole der oberen Leiste immer anzeigen</string>- <string name="theme">0</string>- <string name="shadows_activity_settings">Schatten</string>- <string name="slider_auto">Automatisch</string>- <string name="controller_trigger_custom_values">Benutzerdefiniert (%1$d drücken, %2$d loslassen)</string>- <string name="controller_trigger_custom">Benutzerdefiniert</string>- <string name="resolution_width_hint">Breite</string>- <string name="resolution_height_hint">Höhe</string>- <string name="resolution_native">Nativ</string>- <string name="resolution_invalid">Bitte gib eine gültige Breite und Höhe ein.</string>- <string name="launch_preparing">Wird geladen…</string>- <string name="launch_preparing_game">OpenMW wird vorbereitet…</string>- <string name="launch_failed_title">OpenMW konnte nicht gestartet werden</string>- <string name="launch_failed_unknown">Unbekannter Fehler bei der Vorbereitung von OpenMW.</string>- <string name="user_configuration">Benutzerkonfiguration</string>- <string name="action_theme_submenu">Design ›</string>- <string name="theme_set_to">Design auf %1$s gesetzt</string>- <string name="about_port_info">Dieser Port von Andreas \'Andiweli\' Stürmer\nBasierend auf einem Port von CaveBros\nOpenMW vom OpenMW-Team seit 2008</string>- <string name="third_party_notices">Hinweise zu Drittanbieterkomponenten</string>- <string name="chooser_select">Auswählen</string>- <string name="chooser_create">Erstellen</string>- <string name="chooser_new_folder">Neuer Ordner</string>- <string name="chooser_cancel">Abbrechen</string>- <string name="chooser_heading">Speicher auswählen</string>- <string name="chooser_internal_storage">Interner Speicher</string>- <string name="chooser_free_space">%1$s frei</string>- <string name="chooser_folder_created">Ordner erstellt</string>- <string name="chooser_folder_error">Beim Erstellen des Ordners ist ein Fehler aufgetreten. Bitte versuche es erneut.</string>- <string name="chooser_folder_name">Ordnername</string>- <string name="chooser_empty_folder_name">Der Ordnername darf nicht leer sein</string>- <string-array name="pref_encoding_entries">- <item>Mittel- und Osteuropäisch (win1250)</item>- <item>Kyrillisch (win1251)</item>- <item>Lateinisch (win1252)</item>- </string-array>- <string-array name="gs_factor_strength_into_hand_to_hand_combat_entries">- <item>Aus</item>- <item>Betrifft Werwölfe</item>- <item>Betrifft Werwölfe nicht</item>- </string-array>- <string-array name="gs_show_owned_entries">- <item>Aus</item>- <item>Nur Tooltip</item>- <item>Nur Fadenkreuz</item>- <item>Tooltip und Fadenkreuz</item>- </string-array>- <string-array name="pref_omw051_controller_trigger_sensitivity_entries">- <item>OpenMW-Standard (15/16 drücken, 13/16 loslassen)</item>- <item>Ausgewogen (12/16 drücken, 10/16 loslassen)</item>- <item>Empfindlich (8/16 drücken, 6/16 loslassen)</item>- </string-array>- <string-array name="pref_textureShrinking_entries">- <item>Keine</item>- <item>Niedrig</item>- <item>Mittel</item>- <item>Hoch</item>- </string-array>- <string-array name="pref_shadersDir_entries">- <item>Original</item>- <item>Modifiziert</item>- <item>Zesterer</item>- <item>OMWFX</item>- </string-array>- <string-array name="pref_mouse_mode_entries">- <item>Hybrid</item>- <item>Relative Joystick-Steuerung</item>- <item>Absolute Touch-Steuerung</item>- </string-array>- <string-array name="gs_shadow_quality_entries">- <item>Niedrig</item>- <item>Mittel</item>- <item>Hoch</item>- <item>Sehr hoch</item>- </string-array>- <string-array name="gs_shadow_distance_entries">- <item>Niedrig</item>- <item>Mittel</item>- <item>Hoch</item>- </string-array>- <string name="osk_shift">Umschalt</string>- <string name="osk_caps_lock">Feststelltaste</string>- <string name="osk_language">Sprache</string>- <string name="sdl_error_title">SDL-Fehler</string>- <string name="sdl_exit">Beenden</string>- <string name="sdl_start_error">Beim Starten der Anwendung ist ein Fehler aufgetreten. Bitte versuche es erneut und/oder installiere die Anwendung neu.\n\nFehler: %1$s</string>- <string name="navmesh_generating_cache">NAVMESH-CACHE WIRD ERSTELLT</string>-</resources>\ No newline at end of filediff --git a/android/app/src/main/res/values-fr/launcher_preferences.xml b/android/app/src/main/res/values-fr/launcher_preferences.xmldeleted file mode 100644index 4f2c392..0000000--- a/android/app/src/main/res/values-fr/launcher_preferences.xml+++ /dev/null@@ -1,180 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="l10n_gs_animations_animations_title">Animations</string>- <string name="gs_use_magic_item_animation_title">Utiliser l’animation des objets magiques</string>- <string name="gs_use_magic_item_animation_summary">Utilise les animations d’incantation pour les objets magiques, comme pour les sorts.</string>- <string name="gs_use_additional_animation_sources_title">Utiliser des sources d’animation supplémentaires</string>- <string name="gs_use_additional_animation_sources_summary">Charge les fichiers KF par groupe et les fichiers de squelette depuis le dossier Animations.</string>- <string name="gs_weapon_sheating_title">Rangement des armes</string>- <string name="gs_weapon_sheating_summary">Affiche les armes rangées (avec carquois et fourreaux) ; nécessite des ressources modifiées.</string>- <string name="gs_shield_sheating_title">Rangement des boucliers</string>- <string name="gs_shield_sheating_summary">Affiche un bouclier rangé ; nécessite des ressources modifiées.</string>- <string name="gs_enable_graphics_herbalism_title">Activer l’herboristerie graphique</string>- <string name="gs_enable_graphics_herbalism_summary">Si cette option est activée, les conteneurs compatibles avec l’herboristerie graphique l’utiliseront au lieu d’ouvrir le menu.</string>- <string name="gs_smooth_movement_title">Mouvement fluide</string>- <string name="gs_smooth_movement_summary">Rend les mouvements des PNJ et du joueur plus fluides. Recommandé avec Tourner vers la direction du mouvement activé.</string>- <string name="gs_smooth_animation_transitions_title">Transitions d’animation fluides</string>- <string name="gs_smooth_animation_transitions_summary">Mélange progressivement les transitions d’animation compatibles. Nouveau dans OpenMW 0.49 ; désactivé par défaut.</string>- <string name="gs_turn_to_movement_direction_title">Tourner vers la direction du mouvement</string>- <string name="gs_turn_to_movement_direction_summary">Affecte les déplacements latéraux et diagonaux. Activer cette option rend les mouvements plus réalistes. Si elle est désactivée, tout le corps du personnage est orienté dans la direction du regard. Le déplacement diagonal n’a pas d’animation spéciale et provoque un glissement. Si elle est activée, le personnage tourne le bas du corps dans la direction du mouvement. Le haut du corps ne tourne que partiellement. La tête reste toujours orientée dans la direction du regard. En combat, cela ne s’applique qu’aux déplacements diagonaux. Hors combat, cela modifie aussi les déplacements directs vers la droite et la gauche. En nageant, le corps entier s’incline également vers le haut ou le bas selon la direction du mouvement.</string>- <string name="l10n_gs_engine_engine_title">Moteur</string>- <string name="gs_groundcover_handling_title">Végétation au sol</string>- <string name="gs_groundcover_handling_summary">Active le rendu instancié natif d’OpenMW 0.51 pour les mods chargés via l’onglet de végétation au sol.</string>- <string name="gs_groundcover_handling_dialogtitle">Gestion du couvre-sol</string>- <string name="gs_groundcover_point_lighting_title">Éclairage ponctuel du couvre-sol</string>- <string name="gs_groundcover_point_lighting_summary">OpenMW 0.51 : permet aux lampes proches et autres sources de lumière ponctuelles d’éclairer l’herbe. Désactivez cette option pour économiser un peu de performances GPU.</string>- <string name="gs_build_navmesh_title">Construire le NavMesh pour la géométrie du monde</string>- <string name="gs_build_navmesh_summary">Active le navigateur. Lorsque cette option est activée, des threads d’arrière-plan construisent le maillage de navigation de la géométrie du monde. Le système de recherche de chemin utilise ce maillage pour calculer les trajets. Lorsqu’elle est désactivée, seul le pathgrid est utilisé. Sur les processeurs monocœurs, les performances peuvent être fortement affectées lors de la sortie d’un intérieur ou du déplacement dans le monde extérieur. L’impact est généralement faible sur les processeurs multicœurs, mais la latence de mise à jour du NavMesh peut varier selon les autres réglages et les performances du système. Se déplacer dans le monde extérieur et entrer ou sortir d’un lieu déclenche une mise à jour du NavMesh. Les PNJ et créatures peuvent ne pas trouver de chemin tant que le NavMesh n’est pas construit autour d’eux. Désactivez cette option si vous préférez l’ancienne IA qui ne sait pas où aller lorsque vous vous placez derrière un rocher en lançant un trait de feu.</string>- <string name="gs_write_navmesh_title">Écrire le cache du NavMesh sur le disque</string>- <string name="gs_write_navmesh_summary">Met en cache les tuiles du maillage de navigation sur le disque.</string>- <string name="l10n_gs_engine_threading_title">Threads</string>- <string name="gs_navmesh_threads_title">Threads NavMesh en arrière-plan</string>- <string name="gs_navmesh_threads_summary">Nombre de threads d’arrière-plan utilisés pour mettre à jour le NavMesh. Réglable de 1 à 8 ; valeur par défaut : 1.</string>- <string name="gs_physics_threads_title">Threads de physique en arrière-plan</string>- <string name="gs_physics_threads_summary">Nombre de threads d’arrière-plan utilisés pour les mises à jour de la physique. Réglable de 1 à 8 ; valeur par défaut : 1.</string>- <string name="gs_preload_threads_title">Threads de préchargement en arrière-plan</string>- <string name="gs_preload_threads_summary">Nombre de threads d’arrière-plan utilisés pour le préchargement. OpenMW 0.51 recommande 2 à 3 threads sur les systèmes multicœurs ; 4 ou plus ne sont pas recommandés.</string>- <string name="l10n_gs_bug_fixes_miscellaneous_title">Divers</string>- <string name="gs_merchant_equipping_fix_title">Correction de l’équipement des marchands</string>- <string name="gs_merchant_equipping_fix_summary">Empêche les marchands d’équiper les objets qui leur sont vendus.</string>- <string name="gs_trainers_bs_title">Les entraîneurs choisissent les compétences selon leur valeur de base</string>- <string name="gs_trainers_bs_summary">Les entraîneurs choisissent les compétences à enseigner uniquement d’après leurs valeurs de compétence de base, ce qui permet d’utiliser des effets améliorant le Marchandage sans que celui-ci devienne une compétence proposée.</string>- <string name="l10n_gs_shadows_general_title">Général</string>- <string name="gs_enable_shadows_title">Activer les ombres</string>- <string name="gs_enable_shadows_summary">Active les ombres en temps réel d’OpenMW. Utilise le rendu par shaders et peut réduire les performances.</string>- <string name="l10n_gs_shadows_shadow_casters_title">Sources d’ombres</string>- <string name="gs_player_shadows_title">Ombres du joueur</string>- <string name="gs_player_shadows_summary">Autorise le personnage du joueur à projeter des ombres.</string>- <string name="gs_actor_shadows_title">Ombres des acteurs</string>- <string name="gs_actor_shadows_summary">Autorise les PNJ et les créatures à projeter des ombres.</string>- <string name="gs_object_shadows_title">Ombres des objets</string>- <string name="gs_object_shadows_summary">Autorise les objets du monde à projeter des ombres.</string>- <string name="gs_terrain_shadows_title">Ombres du terrain</string>- <string name="gs_terrain_shadows_summary">Autorise le terrain à projeter des ombres.</string>- <string name="gs_indoor_shadows_title">Ombres en intérieur</string>- <string name="gs_indoor_shadows_summary">Autorise les ombres en intérieur. En raison des limitations des données de Morrowind, seuls les acteurs peuvent y projeter des ombres.</string>- <string name="l10n_gs_shadows_quality_distance_title">Qualité et distance</string>- <string name="gs_shadow_quality_title">Qualité des ombres</string>- <string name="gs_shadow_quality_dialogtitle">Qualité des ombres</string>- <string name="gs_shadow_distance_title">Distance des ombres</string>- <string name="gs_shadow_distance_dialogtitle">Distance des ombres</string>- <string name="l10n_gs_miscellaneous_saves_title">Sauvegardes</string>- <string name="gs_add_time_to_saves_title">Ajouter le temps de jeu aux sauvegardes</string>- <string name="gs_add_time_to_saves_summary">Détermine si le temps passé à jouer est affiché pour chaque sauvegarde dans le menu Charger.</string>- <string name="gs_maximum_quicksaves_title">Nombre maximal de sauvegardes rapides</string>- <string name="gs_maximum_quicksaves_summary">Nombre maximal de sauvegardes rapides conservées</string>- <string name="gs_maximum_quicksaves_dialogtitle">Nombre maximal de sauvegardes rapides</string>- <string name="l10n_gs_visuals_terrain_title">Terrain</string>- <string name="gs_object_paging_min_size_title">Taille minimale pour le paging des objets</string>- <string name="gs_object_paging_min_size_summary">Contrôle la taille minimale qu’un objet doit avoir pour être visible dans la scène. Réglable de 0,01 à 1,00 par pas de 0,01.</string>- <string name="gs_distant_land_title">Terrain distant</string>- <string name="gs_distant_land_summary">Si cette option est activée, utilise les algorithmes de paging et de LOD pour afficher l’ensemble du terrain. Sinon, seul le terrain des cellules chargées est affiché.</string>- <string name="gs_active_grid_object_paging_title">Paging des objets de la grille active</string>- <string name="gs_active_grid_object_paging_summary">Utilise le paging des objets pour la grille des cellules actives.</string>- <string name="l10n_gs_visuals_graphics_title">Graphismes</string>- <string name="pref_physicsfps2_summary">%s FPS</string>- <string name="l10n_gs_visuals_shaders_title">Shaders</string>- <string name="gs_auto_use_object_normal_maps_title">Utiliser automatiquement les normal maps des objets</string>- <string name="gs_auto_use_object_normal_maps_summary">Si cette option est activée, les normal maps sont automatiquement détectées et utilisées si leur nom respecte le modèle prévu (voir « modèle de normal map » ; par exemple, pour une texture de base foo.dds, la normal map doit être nommée foo_n.dds). Si elle est désactivée, les normal maps ne sont utilisées que lorsqu’elles sont explicitement indiquées dans le fichier de maillage (.nif ou .osg). Affecte les objets.</string>- <string name="gs_auto_use_object_specular_maps_title">Utiliser automatiquement les specular maps des objets</string>- <string name="gs_auto_use_object_specular_maps_summary">Si cette option est activée, les specular maps sont automatiquement détectées et utilisées si leur nom respecte le modèle prévu (voir « modèle de specular map » ; par exemple, pour une texture de base foo.dds, la specular map doit être nommée foo_spec.dds). Si elle est désactivée, ces maps ne sont utilisées que lorsqu’elles sont explicitement indiquées dans le fichier de maillage (.osg ; non pris en charge dans les fichiers .nif). Affecte les objets.</string>- <string name="gs_auto_use_terrain_normal_maps_title">Utiliser automatiquement les normal maps du terrain</string>- <string name="gs_auto_use_terrain_normal_maps_summary">Voir « Utiliser automatiquement les normal maps des objets ». Affecte le terrain.</string>- <string name="gs_auto_use_terrain_specular_maps_title">Utiliser automatiquement les specular maps du terrain</string>- <string name="gs_auto_use_terrain_specular_maps_summary">Si un fichier correspondant au « modèle de specular map du terrain » existe, il est utilisé comme map « diffuse specular ». La texture doit contenir la couleur de la couche dans le canal RVB, comme d’habitude, et un multiplicateur spéculaire dans le canal alpha.</string>- <string name="gs_bump_map_local_lighting_title">Éclairage local des bump/reflect maps</string>- <string name="gs_bump_map_local_lighting_summary">Normalement, les réflexions des environment maps ne sont pas affectées par l’éclairage, ce qui fait briller dans l’obscurité les objets utilisant une environment map, et donc les bump maps. Morrowind Code Patch propose une option qui corrige ce comportement en appliquant l’environment mapping avant l’éclairage ; ce réglage est son équivalent. Les objets concernés utiliseront des shaders.</string>- <string name="l10n_gs_visuals_fog_title">Brouillard</string>- <string name="gs_radial_fog_title">Brouillard radial</string>- <string name="gs_radial_fog_summary">Par défaut, le brouillard s’épaissit proportionnellement à la distance du plan de clipping placé à la distance de clipping, ce qui provoque des déformations sur les bords de l’écran. Ce réglage utilise la distance réelle depuis le point de vue, appelée distance euclidienne, pour calculer le brouillard. Le résultat paraît moins artificiel, surtout avec un champ de vision large.</string>- <string name="gs_exponential_fog_title">Brouillard exponentiel</string>- <string name="gs_exponential_fog_summary">Détermine si une formule exponentielle est utilisée pour le brouillard.</string>- <string name="gs_sky_blending_title">Fusion avec le ciel</string>- <string name="gs_sky_blending_summary">Détermine si le plan de clipping est masqué en le fusionnant avec le ciel.</string>- <string name="l10n_gs_visuals_post_processing_title">Post-traitement</string>- <string name="gs_soft_particles_title">Particules douces</string>- <string name="gs_soft_particles_summary">Adoucit l’intersection des systèmes de particules mélangées avec la géométrie opaque.</string>- <string name="gs_transparent_postpass_title">Post-passe transparente</string>- <string name="gs_transparent_postpass_summary">Post-passe de profondeur transparente. Réaffiche les objets transparents en imposant un alpha clipping avec un seuil fixe.</string>- <string name="pref_game_settings_title">Paramètres du jeu</string>- <string name="pref_game_settings_summary">Configure le gameplay, les graphismes, les ombres, les animations, l’interface et les réglages du moteur.</string>- <string name="pref_mods_summary">Ajouter des mods à OpenMW</string>- <string name="pref_omw050_controller_menus_title">Menus à la manette</string>- <string name="pref_omw050_controller_menus_summary">Utilise la navigation de menus optimisée pour manette d’OpenMW 0.51.</string>- <string name="pref_omw050_controller_tooltips_title">Infobulles à la manette</string>- <string name="pref_omw050_controller_tooltips_summary">Toujours afficher les infobulles des objets sans appuyer sur R3.</string>- <string name="pref_omw051_controller_trigger_thresholds_title">Sensibilité des gâchettes de la manette</string>- <string name="pref_omw051_controller_trigger_thresholds_dialogtitle">Sensibilité des gâchettes de la manette</string>- <string name="pref_controls_summary">Configure vos commandes tactiles à l’écran préférées.</string>- <string name="gs_framerate_limit_summary">%s FPS</string>- <string name="l10n_settings_audio_title">Audio</string>- <string name="pref_omw050_doppler_title">Effet Doppler</string>- <string name="pref_omw050_doppler_summary">Active l’effet Doppler de l’audio positionnel d’OpenMW 0.51 (facteur 0,25).</string>- <string name="pref_omw050_camera_listener_title">Caméra comme auditeur audio</string>- <string name="pref_omw050_camera_listener_summary">Utilise la position de la caméra au lieu de celle du joueur comme point d’écoute audio 3D.</string>- <string name="pref_skip_gui_title">Ignorer l’interface du lanceur</string>- <string name="pref_skip_gui_summary">Maintenez « Volume + » pendant le démarrage de l’application pour afficher à nouveau le lanceur.</string>- <string name="game_settings_game_mechanics_title">Gameplay</string>- <string name="game_settings_visuals_title">Graphismes</string>- <string name="game_settings_shadows_title">Ombres</string>- <string name="game_settings_animations_title">Animations</string>- <string name="game_settings_interface_title">Interface</string>- <string name="game_settings_engine_title">Moteur</string>- <string name="l10n_gs_interface_ui_title">Interface utilisateur</string>- <string name="gs_show_owned_title">Afficher les objets possédés</string>- <string name="gs_show_owned_dialogtitle">Afficher les objets possédés</string>- <string name="gs_show_effect_duration_title">Afficher la durée des effets</string>- <string name="gs_show_effect_duration_summary">Affiche la durée restante des effets magiques et des lumières. La durée restante apparaît dans l’infobulle lorsque le pointeur survole l’effet magique.</string>- <string name="gs_show_enchant_chance_title">Afficher les chances d’enchantement</string>- <string name="gs_show_enchant_chance_summary">Détermine si les chances de réussite sont affichées dans le menu d’enchantement.</string>- <string name="gs_show_melee_info_title">Afficher les informations de mêlée</string>- <string name="gs_show_melee_info_summary">Si cette option est activée, la portée et la vitesse des armes de mêlée sont affichées dans l’infobulle de l’objet.</string>- <string name="gs_show_projectile_damage_title">Afficher les dégâts des projectiles</string>- <string name="gs_show_projectile_damage_summary">Si cette option est activée, le bonus de dégâts des flèches et carreaux est affiché dans l’infobulle de l’objet.</string>- <string name="gs_change_dialogue_topic_color_title">Modifier la couleur des sujets de dialogue</string>- <string name="gs_change_dialogue_topic_color_summary">Si cette option est activée, les sujets de dialogue ont une couleur différente lorsqu’ils sont propres au PNJ avec lequel vous parlez ou ont déjà été consultés. La couleur peut être modifiée dans settings.cfg.</string>- <string name="gs_stretch_menu_background_title">Étirer l’arrière-plan des menus</string>- <string name="gs_stretch_menu_background_summary">Étire les menus, les écrans de chargement, etc. au format de la fenêtre.</string>- <string name="gs_can_zoom_on_maps_title">Autoriser le zoom sur les cartes</string>- <string name="gs_can_zoom_on_maps_summary">Active le zoom sur les cartes locales et globales.</string>- <string name="l10n_gs_game_mechanics_general_title">Général</string>- <string name="gs_soulgem_values_rebalance_title">Rééquilibrage de la valeur des gemmes spirituelles</string>- <string name="gs_soulgem_values_rebalance_summary">Fait dépendre la valeur des gemmes spirituelles remplies uniquement de la puissance de l’âme.</string>- <string name="gs_can_loot_during_death_animation_title">Pillage pendant l’animation de mort</string>- <string name="gs_can_loot_during_death_animation_summary">Si cette option est activée, le joueur peut piller les acteurs, par exemple les créatures invoquées, pendant leur animation de mort lorsqu’ils ne sont plus en combat. Dans ce cas, le compteur de morts est incrémenté et le script de l’acteur supprimé est exécuté immédiatement. Si elle est désactivée, le joueur doit attendre la fin de l’animation de mort. Cela rend beaucoup plus difficiles les exploits liés aux créatures invoquées, comme piller des Drémoras et des Saints dorés invoqués pour récupérer des armes coûteuses. Peut entrer en conflit avec les mods de mannequins utilisant SkipAnim pour empêcher la fin de l’animation de mort.</string>- <string name="gs_always_allow_stealing_from_knocked_out_actors_title">Toujours autoriser le vol sur les acteurs assommés</string>- <string name="gs_always_allow_stealing_from_knocked_out_actors_summary">Permet de voler des objets aux PNJ mis à terre pendant un combat.</string>- <string name="l10n_gs_game_mechanics_movement_combat_title">Mouvement et combat</string>- <string name="gs_toggle_sneak_title">Basculer le mode furtif</string>- <string name="gs_toggle_sneak_summary">Transforme la touche de furtivité, Ctrl par défaut, en interrupteur : la furtivité reste active sans maintenir la touche. Les joueurs qui se déplacent souvent furtivement peuvent trouver le personnage plus facile à contrôler avec cette option.</string>- <string name="gs_uncapped_damage_fatigue_title">Dégâts de fatigue sans limite</string>- <string name="gs_uncapped_damage_fatigue_summary">Supprime la limite de l’effet magique Dégâts de fatigue comme pour Absorption de fatigue. Contrairement à Morrowind, il devient ainsi possible de mettre des acteurs à terre avec cet effet.</string>- <string name="gs_only_weapon_bs_title">Seuls les projectiles appropriés ignorent la résistance aux armes normales</string>- <string name="gs_only_weapon_bs_summary">Autorise uniquement les munitions non standard à ignorer la résistance ou la faiblesse aux armes normales.</string>- <string name="gs_swim_upward_correction_title">Correction de nage vers le haut</string>- <string name="gs_swim_upward_correction_summary">Fait nager le joueur légèrement au-dessus de la ligne de visée. S’applique uniquement à la vue à la troisième personne et facilite la nage sans plonger involontairement.</string>- <string name="gs_factor_strength_into_hand_to_hand_combat_title">Prendre la Force en compte dans le combat à mains nues</string>- <string name="gs_factor_strength_into_hand_to_hand_combat_dialogtitle">Prendre la Force en compte dans le combat à mains nues</string>- <string name="l10n_gs_game_mechanics_npc_followers_title">PNJ et compagnons</string>- <string name="gs_followers_defend_immediately_title">Les compagnons défendent immédiatement</string>- <string name="gs_followers_defend_immediately_summary">Les compagnons du joueur et les PNJ escortés engagent immédiatement les ennemis qui les ont attaqués ou ont attaqué le joueur. Sinon, ils attendent que l’ennemi ou le joueur porte la première attaque.</string>- <string name="gs_permanent_barter_disposition_changes_title">Changements permanents de disposition lors du marchandage</string>- <string name="gs_permanent_barter_disposition_changes_summary">Rend permanents les changements de disposition des marchands provoqués par les échanges.</string>- <string name="gs_npc_avoid_collision_title">Les PNJ évitent les collisions</string>- <string name="gs_npc_avoid_collision_summary">Si cette option est activée, les PNJ effectuent des manœuvres d’évitement pour ne pas entrer en collision avec les autres.</string>- <string name="gs_always_allow_npc_to_follow_over_water_surface_title">Toujours autoriser les PNJ à suivre à la surface de l’eau</string>- <string name="gs_always_allow_npc_to_follow_over_water_surface_summary">Permet aux PNJ de nager à la surface lorsqu’ils suivent un autre acteur, indépendamment de leur capacité normale à nager. N’a d’effet que si la construction du NavMesh est activée.</string>- <string name="l10n_gs_game_mechanics_gameplay_fixes_title">Corrections de gameplay</string>- <string name="gs_racial_variation_in_speed_fix_title">Correction des variations raciales de vitesse</string>- <string name="gs_racial_variation_in_speed_fix_summary">N’utilise pas le poids racial dans le calcul de la vitesse de déplacement des PNJ.</string>- <string name="gs_enchanted_weapons_are_magical_title">Les armes enchantées sont magiques</string>- <string name="gs_enchanted_weapons_are_magical_summary">Les armes enchantées dépourvues du drapeau « Magique » ignorent la résistance aux armes normales, comme dans Morrowind.</string>- <string name="gs_classic_reflected_absorb_spells_behavior_title">Comportement classique des sorts d’Absorption réfléchis</string>- <string name="gs_classic_reflected_absorb_spells_behavior_summary">Les effets des sorts d’Absorption réfléchis ne sont pas inversés, comme dans Morrowind.</string>- <string name="l10n_gs_game_mechanics_saves_title">Sauvegardes</string>- <string name="txttitle_text">Nom du mod</string>- <string name="gs_groundcover_density_title">Densité de la végétation au sol</string>- <string name="gs_groundcover_density_summary">Pourcentage d’instances de végétation affichées. 100 % conserve la densité complète du mod ; des valeurs plus basses améliorent les performances.</string>- <string name="gs_groundcover_rendering_distance_title">Distance d’affichage de la végétation</string>- <string name="gs_groundcover_rendering_distance_summary">Distance jusqu’à laquelle la végétation au sol est affichée. Des valeurs plus élevées augmentent le coût du rendu.</string>-</resources>\ No newline at end of filediff --git a/android/app/src/main/res/values-fr/strings.xml b/android/app/src/main/res/values-fr/strings.xmldeleted file mode 100644index e197e43..0000000--- a/android/app/src/main/res/values-fr/strings.xml+++ /dev/null@@ -1,185 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="app_name">OpenMW</string>- <string name="general_settings">Configuration</string>- <string name="start_game_label">Lancer le jeu</string>- <string name="closeDrawer">Navigation</string>- <string name="openDrawer">Navigation fermée</string>- <string name="game_files">Fichiers du jeu</string>- <string name="pref_graphicsLibrary">Bibliothèque API graphique</string>- <string name="pref_graphicsLibrary_default">gles2</string>- <string name="pref_advanced">Avancé</string>- <string name="pref_graphics">Graphismes</string>- <string name="pref_commandLine">Arguments de ligne de commande personnalisés</string>- <string name="pref_envLine">Variables d’environnement personnalisées</string>- <string name="pref_nohighp">Précision moyenne des shaders</string>- <string name="pref_nohighp_summary">Utilise une précision moyenne au lieu d’une précision élevée ; disponible uniquement avec le préréglage de shaders « Modified ».</string>- <string name="pref_ui">Interface utilisateur</string>- <string name="pref_textureShrinking">Réduction des textures</string>- <string name="pref_textureShrinking_default">none</string>- <string name="pref_shadersDir">Préréglages de shaders</string>- <string name="pref_shadersDir_default">none</string>- <string name="pref_gamma">Gamma</string>- <string name="pref_uiScaling">Facteur d’échelle de l’interface</string>- <string name="uiScaling_auto">Auto (%1$.2f)</string>- <string name="pref_screen_keeper">Garder l’écran toujours allumé</string>- <string name="pref_touchpadSensitivity">Sensibilité du pavé tactile virtuel</string>- <string name="action_reset_config">Réinitialiser les fichiers de configuration statiques</string>- <string name="action_reset_user_config">Réinitialiser les fichiers de configuration utilisateur</string>- <string name="action_reset_user_resources">Réinitialiser les ressources utilisateur</string>- <string name="action_reset_screen_controls">Réinitialiser les commandes à l’écran</string>- <string name="action_show_screen_controls">Commandes à l’écran</string>- <string name="pref_hide_controls">Masquer les boutons à l’écran</string>- <string name="config_was_reset">La configuration statique a été réinitialisée aux valeurs par défaut</string>- <string name="user_config_was_reset">La configuration utilisateur a été réinitialisée aux valeurs par défaut</string>- <string name="user_resources_was_reset">Les ressources utilisateur ont été réinitialisées aux valeurs par défaut</string>- <string name="pref_lang">Paramètres de langue</string>- <string name="pref_encoding">Langue du jeu</string>- <string name="pref_encoding_default">win1252</string>- <string name="btn_opacityPlus">Alpha+</string>- <string name="btn_opacityMinus">Alpha-</string>- <string name="btn_sizePlus">Taille+</string>- <string name="btn_sizeMinus">Taille-</string>- <string name="btn_resetControlsLayout">Réinitialiser par défaut</string>- <string name="pref_physicsFPS2">FPS de la physique</string>- <string name="pref_framerate_limit">Limite de fréquence d’images</string>- <string name="pref_framerate_limit_default">60</string>- <string name="pref_physicsFPS2_default">30</string>- <string name="btn_back">Retour</string>- <string name="pref_customResolution">Résolution personnalisée</string>- <string name="pref_display_cutout_area">Afficher dans la zone de découpe</string>- <string name="mods">Modifications du jeu</string>- <string name="action_about">À propos</string>- <string name="about_title">À propos d’OpenMW</string>- <string name="action_theme">Thème</string>- <string name="action_theme_system">Système</string>- <string name="action_theme_light">Clair</string>- <string name="action_theme_dark">Sombre</string>- <string name="action_theme_oled">Noir/OLED</string>- <string name="activity_settings">Paramètres du jeu</string>- <string name="game_mechanics_activity_settings">Gameplay</string>- <string name="visuals_activity_settings">Graphismes</string>- <string name="animations_activity_settings">Animations</string>- <string name="interface_activity_settings">Interface</string>- <string name="bug_fixes_activity_settings">Corrections de bugs</string>- <string name="miscellaneous_activity_settings">Divers</string>- <string name="engine_activity_settings">Moteur</string>- <string name="activity_mods">Mods</string>- <string name="tab_plugins">Plugins</string>- <string name="tab_resources">Ressources</string>- <string name="tab_dirs">Répertoires</string>- <string name="tab_groundcover">Couvre-sol</string>- <string name="data_error_title">Erreur lors de la recherche des fichiers du jeu</string>- <string name="data_error_message">Veuillez sélectionner un répertoire contenant à la fois le fichier « Morrowind.ini » et le répertoire « Data Files ».</string>- <string name="permissions_error_title">Aucune autorisation</string>- <string name="permissions_error_message">OpenMW a besoin de l’autorisation d’accéder au stockage pour localiser et utiliser les fichiers de Morrowind. Veuillez accorder cette autorisation dans les paramètres de l’application.</string>- <string name="ini_error_message">Échec de la conversion du fichier de configuration. Vérifiez que votre fichier « Morrowind.ini » est correctement structuré.</string>- <string name="no_data_files_title">Fichiers du jeu introuvables</string>- <string name="no_data_files_message">Vous devez copier les fichiers de Morrowind sur votre appareil et sélectionner leur chemin dans « Fichiers du jeu » avant de pouvoir lancer le jeu.</string>- <string name="category_performance">Performances</string>- <string name="no_content_files_title">Aucun fichier de contenu !</string>- <string name="no_content_files_message">Aucun fichier de contenu n’est activé. Avant de lancer le jeu, vous devez activer au moins un fichier plugin dans le menu « Mods… ».</string>- <string name="no_content_files_dismiss">Continuer quand même</string>- <string name="configure_mods">Configurer les mods</string>- <string name="pref_mouse_mode">Mode souris dans les menus</string>- <string name="pref_mouse_mode_default">hybrid</string>- <string name="bugsnag_yes">Oui</string>- <string name="bugsnag_no">Non</string>- <string name="bugsnag_policy">Politique de confidentialité</string>- <string name="bugsnag_consent_title">Signaler automatiquement les plantages ?</string>- <string name="bugsnag_consent_message">Souhaitez-vous activer le signalement automatique des plantages ?\nEn cas de plantage, certaines données concernant votre appareil, votre configuration et les mods installés seront automatiquement envoyées à Bugsnag. Vous trouverez plus d’informations dans la Politique de confidentialité.\nCe réglage peut être modifié à tout moment depuis le menu.</string>- <string name="bugsnag_consent_restart_title">Veuillez redémarrer l’application</string>- <string name="bugsnag_consent_restart_message">Vous devez redémarrer l’application pour que ces réglages prennent effet.</string>- <string name="action_bugsnag_consent">Rapports de plantage</string>- <string name="dialog_howto">Mode d’emploi</string>- <string name="no_browser_title">Impossible d’ouvrir une URL</string>- <string name="no_browser_message">Aucun navigateur web ne semble être installé. Tentative d’ouverture de l’URL suivante :\n\n%1$s</string>- <string name="pref_show_qp">Activer les touches rapides</string>- <string name="pref_show_fn">Activer les touches FN</string>- <string name="pref_always_show_top_bar">Toujours afficher les icônes de la barre supérieure</string>- <string name="theme">0</string>- <string name="shadows_activity_settings">Ombres</string>- <string name="slider_auto">Auto</string>- <string name="controller_trigger_custom_values">Personnalisé (%1$d appui, %2$d relâchement)</string>- <string name="controller_trigger_custom">Personnalisé</string>- <string name="resolution_width_hint">Largeur</string>- <string name="resolution_height_hint">Hauteur</string>- <string name="resolution_native">Native</string>- <string name="resolution_invalid">Veuillez saisir une largeur et une hauteur valides.</string>- <string name="launch_preparing">Chargement…</string>- <string name="launch_preparing_game">Préparation d’OpenMW…</string>- <string name="launch_failed_title">Échec du lancement d’OpenMW</string>- <string name="launch_failed_unknown">Erreur inconnue lors de la préparation d’OpenMW.</string>- <string name="user_configuration">Configuration utilisateur</string>- <string name="action_theme_submenu">Thème ›</string>- <string name="theme_set_to">Thème défini sur %1$s</string>- <string name="about_port_info">Ce port est réalisé par Andreas « \'Andiweli\' » Stürmer\nBasé sur un port de CaveBros\nOpenMW par l’équipe OpenMW depuis 2008</string>- <string name="third_party_notices">Mentions relatives aux composants tiers</string>- <string name="chooser_select">Sélectionner</string>- <string name="chooser_create">Créer</string>- <string name="chooser_new_folder">Nouveau dossier</string>- <string name="chooser_cancel">Annuler</string>- <string name="chooser_heading">Choisir le stockage</string>- <string name="chooser_internal_storage">Stockage interne</string>- <string name="chooser_free_space">%1$s libres</string>- <string name="chooser_folder_created">Dossier créé</string>- <string name="chooser_folder_error">Une erreur est survenue lors de la création du dossier. Veuillez réessayer.</string>- <string name="chooser_folder_name">Nom du dossier</string>- <string name="chooser_empty_folder_name">Le nom du dossier ne peut pas être vide</string>- <string-array name="pref_encoding_entries">- <item>Europe centrale et orientale (win1250)</item>- <item>Cyrillique (win1251)</item>- <item>Latin (win1252)</item>- </string-array>- <string-array name="gs_factor_strength_into_hand_to_hand_combat_entries">- <item>Désactivé</item>- <item>Affecter les loups-garous</item>- <item>Ne pas affecter les loups-garous</item>- </string-array>- <string-array name="gs_show_owned_entries">- <item>Désactivé</item>- <item>Infobulle uniquement</item>- <item>Réticule uniquement</item>- <item>Infobulle et réticule</item>- </string-array>- <string-array name="pref_omw051_controller_trigger_sensitivity_entries">- <item>Valeur OpenMW par défaut (15/16 appui, 13/16 relâchement)</item>- <item>Équilibré (12/16 appui, 10/16 relâchement)</item>- <item>Sensible (8/16 appui, 6/16 relâchement)</item>- </string-array>- <string-array name="pref_textureShrinking_entries">- <item>Aucune</item>- <item>Faible</item>- <item>Moyenne</item>- <item>Élevée</item>- </string-array>- <string-array name="pref_shadersDir_entries">- <item>Original</item>- <item>Modifié</item>- <item>Zesterer</item>- <item>OMWFX</item>- </string-array>- <string-array name="pref_mouse_mode_entries">- <item>Hybride</item>- <item>Contrôles joystick relatifs</item>- <item>Contrôles tactiles absolus</item>- </string-array>- <string-array name="gs_shadow_quality_entries">- <item>Faible</item>- <item>Moyenne</item>- <item>Élevée</item>- <item>Très élevée</item>- </string-array>- <string-array name="gs_shadow_distance_entries">- <item>Faible</item>- <item>Moyenne</item>- <item>Élevée</item>- </string-array>- <string name="osk_shift">Maj</string>- <string name="osk_caps_lock">Verr. Maj</string>- <string name="osk_language">Langue</string>- <string name="sdl_error_title">Erreur SDL</string>- <string name="sdl_exit">Quitter</string>- <string name="sdl_start_error">Une erreur est survenue lors du démarrage de l’application. Veuillez réessayer et/ou réinstaller l’application.\n\nErreur : %1$s</string>- <string name="navmesh_generating_cache">GÉNÉRATION DU CACHE NAVMESH</string>-</resources>\ No newline at end of filediff --git a/android/app/src/main/res/values-night/colors.xml b/android/app/src/main/res/values-night/colors.xmldeleted file mode 100644index efc148f..0000000--- a/android/app/src/main/res/values-night/colors.xml+++ /dev/null@@ -1,34 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<resources>- <color name="colorPrimary">#212121</color>- <color name="colorPrimaryDark">#999999</color>- <color name="colorAccent">#FF4081</color>-- <color name="modItemBackgroundColor">#404040</color>- <color name="modItemSelectedColor">#212121</color>- <color name="modItemTextColor">#FFFFFF</color>-- <color name="statusBarColor">#000000</color>-- <!-- Storage Chooser -->- <array name="default_light">- <!-- Overview -->- <item>#121212</item> <!-- Top Header bg -->- <item>@android:color/white</item> <!-- header text -->- <item>#212121</item> <!-- list bg -->- <item>@android:color/white</item> <!-- storage list name text -->- <item>#da6c6c</item> <!-- free space text -->- <item>#999999</item> <!-- memory bar -->-- <!-- secondary dialog colors -->- <item>#ffae42</item> <!-- folder icon color -->- <item>#414141</item> <!-- list bg -->- <item>@android:color/white</item> <!-- list text -->- <item>@android:color/white</item> <!-- address bar text color -->- <item>@color/chevronBgColor</item> <!-- new folder hint tint -->- <item>@color/colorAccent</item> <!-- select button color -->- <item>#404040</item> <!-- new folder layour bg -->- <item>#ff0000</item> <!-- new multi fab -->- <item>#000000</item> <!-- new multi fab -->- </array>-</resources>diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xmldeleted file mode 100644index 8d1a964..0000000--- a/android/app/src/main/res/values-night/styles.xml+++ /dev/null@@ -1,9 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<resources>-- <style name="MyTheme.Base" parent="Theme.AppCompat.DayNight.NoActionBar">- <item name="colorAccent">@color/colorAccent</item>- <item name="android:navigationBarColor">#181818</item>- </style>--</resources>diff --git a/android/app/src/main/res/values-pl/launcher_preferences.xml b/android/app/src/main/res/values-pl/launcher_preferences.xmldeleted file mode 100644index fe725df..0000000--- a/android/app/src/main/res/values-pl/launcher_preferences.xml+++ /dev/null@@ -1,180 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="l10n_gs_animations_animations_title">Animacje</string>- <string name="gs_use_magic_item_animation_title">Używaj animacji magicznych przedmiotów</string>- <string name="gs_use_magic_item_animation_summary">Używa animacji rzucania czarów dla magicznych przedmiotów, tak samo jak dla zaklęć.</string>- <string name="gs_use_additional_animation_sources_title">Używaj dodatkowych źródeł animacji</string>- <string name="gs_use_additional_animation_sources_summary">Wczytuje pliki KF dla poszczególnych grup oraz pliki szkieletów z folderu Animations.</string>- <string name="gs_weapon_sheating_title">Chowanie broni</string>- <string name="gs_weapon_sheating_summary">Wyświetla schowaną broń (wraz z kołczanami i pochwami); wymaga zmodyfikowanych zasobów.</string>- <string name="gs_shield_sheating_title">Chowanie tarczy</string>- <string name="gs_shield_sheating_summary">Wyświetla schowaną tarczę; wymaga zmodyfikowanych zasobów.</string>- <string name="gs_enable_graphics_herbalism_title">Włącz graficzne zielarstwo</string>- <string name="gs_enable_graphics_herbalism_summary">Jeśli ta opcja jest włączona, obsługiwane pojemniki będą używać graficznego zielarstwa zamiast otwierać menu.</string>- <string name="gs_smooth_movement_title">Płynny ruch</string>- <string name="gs_smooth_movement_summary">Wygładza ruch NPC i gracza. Zalecane przy włączonej opcji Obracaj w kierunku ruchu.</string>- <string name="gs_smooth_animation_transitions_title">Płynne przejścia animacji</string>- <string name="gs_smooth_animation_transitions_summary">Płynnie łączy zgodne przejścia między animacjami. Nowość w OpenMW 0.49; domyślnie wyłączone.</string>- <string name="gs_turn_to_movement_direction_title">Obracaj w kierunku ruchu</string>- <string name="gs_turn_to_movement_direction_summary">Wpływa na ruch boczny i po skosie. Włączenie tej opcji sprawia, że ruch wygląda bardziej realistycznie. Gdy jest wyłączona, całe ciało postaci jest zwrócone w kierunku patrzenia. Ruch po skosie nie ma specjalnej animacji i powoduje ślizganie. Po włączeniu dolna część ciała obraca się w kierunku ruchu, górna tylko częściowo, a głowa zawsze pozostaje zwrócona w kierunku patrzenia. W trybie walki działa tylko dla ruchu po skosie. Poza walką zmienia także ruch bezpośrednio w prawo i w lewo. Podczas pływania obraca również całe ciało w górę lub w dół zgodnie z kierunkiem ruchu.</string>- <string name="l10n_gs_engine_engine_title">Silnik</string>- <string name="gs_groundcover_handling_title">Roślinność podłoża</string>- <string name="gs_groundcover_handling_summary">Włącza natywne renderowanie instancjonowane OpenMW 0.51 dla modów wczytanych przez kartę roślinności podłoża.</string>- <string name="gs_groundcover_handling_dialogtitle">Obsługa roślinności przyziemnej</string>- <string name="gs_groundcover_point_lighting_title">Oświetlenie punktowe roślinności</string>- <string name="gs_groundcover_point_lighting_summary">OpenMW 0.51: pozwala pobliskim lampom i innym światłom punktowym oświetlać trawę. Wyłącz, aby nieco zmniejszyć obciążenie GPU.</string>- <string name="gs_build_navmesh_title">Buduj NavMesh dla geometrii świata</string>- <string name="gs_build_navmesh_summary">Włącza system nawigacji. Po włączeniu uruchamiane są wątki w tle budujące siatkę nawigacji dla geometrii świata. System wyszukiwania drogi używa NavMesh do wyznaczania tras. Po wyłączeniu używany jest wyłącznie pathgrid. Na procesorach jednordzeniowych może to mocno wpływać na wydajność przy opuszczaniu wnętrz i przemieszczaniu się po świecie zewnętrznym. Na procesorach wielordzeniowych wpływ jest zwykle niewielki, ale opóźnienie aktualizacji NavMesh może zależeć od innych ustawień i wydajności systemu. Poruszanie się po świecie oraz wchodzenie i wychodzenie z lokacji powoduje aktualizację NavMesh. NPC i stworzenia mogą nie znaleźć drogi, zanim siatka nie zostanie zbudowana wokół nich. Wyłącz tę opcję, jeśli chcesz korzystać ze starego typu AI, które nie wie, dokąd iść, gdy stoisz za głazem i rzucasz ognistą kulę.</string>- <string name="gs_write_navmesh_title">Zapisuj pamięć podręczną NavMesh na dysku</string>- <string name="gs_write_navmesh_summary">Zapisuje kafle siatki nawigacji w pamięci podręcznej na dysku.</string>- <string name="l10n_gs_engine_threading_title">Wątki</string>- <string name="gs_navmesh_threads_title">Wątki NavMesh w tle</string>- <string name="gs_navmesh_threads_summary">Liczba wątków w tle aktualizujących NavMesh. Zakres od 1 do 8; domyślnie 1.</string>- <string name="gs_physics_threads_title">Wątki fizyki w tle</string>- <string name="gs_physics_threads_summary">Liczba wątków w tle używanych do aktualizacji fizyki. Zakres od 1 do 8; domyślnie 1.</string>- <string name="gs_preload_threads_title">Wątki wstępnego wczytywania</string>- <string name="gs_preload_threads_summary">Liczba wątków w tle używanych do wstępnego ładowania. OpenMW 0.51 zaleca 2–3 na systemach wielordzeniowych; 4 lub więcej nie jest zalecane.</string>- <string name="l10n_gs_bug_fixes_miscellaneous_title">Różne</string>- <string name="gs_merchant_equipping_fix_title">Poprawka wyposażania kupców</string>- <string name="gs_merchant_equipping_fix_summary">Zapobiega zakładaniu przez kupców przedmiotów, które zostały im sprzedane.</string>- <string name="gs_trainers_bs_title">Trenerzy wybierają umiejętności na podstawie wartości bazowych</string>- <string name="gs_trainers_bs_summary">Trenerzy wybierają umiejętności do szkolenia wyłącznie na podstawie ich bazowych wartości, dzięki czemu efekty zwiększające Handel mogą być używane bez powodowania, że Handel stanie się oferowaną umiejętnością.</string>- <string name="l10n_gs_shadows_general_title">Ogólne</string>- <string name="gs_enable_shadows_title">Włącz cienie</string>- <string name="gs_enable_shadows_summary">Włącza mapowanie cieni OpenMW w czasie rzeczywistym. Używa ścieżki renderowania opartej na shaderach i może obniżyć wydajność.</string>- <string name="l10n_gs_shadows_shadow_casters_title">Obiekty rzucające cień</string>- <string name="gs_player_shadows_title">Cień gracza</string>- <string name="gs_player_shadows_summary">Pozwala postaci gracza rzucać cień.</string>- <string name="gs_actor_shadows_title">Cienie postaci</string>- <string name="gs_actor_shadows_summary">Pozwala NPC i stworzeniom rzucać cienie.</string>- <string name="gs_object_shadows_title">Cienie obiektów</string>- <string name="gs_object_shadows_summary">Pozwala obiektom świata rzucać cienie.</string>- <string name="gs_terrain_shadows_title">Cienie terenu</string>- <string name="gs_terrain_shadows_summary">Pozwala terenowi rzucać cienie.</string>- <string name="gs_indoor_shadows_title">Cienie we wnętrzach</string>- <string name="gs_indoor_shadows_summary">Pozwala wyświetlać cienie we wnętrzach. Z powodu ograniczeń danych Morrowinda tylko postacie mogą tam rzucać cienie.</string>- <string name="l10n_gs_shadows_quality_distance_title">Jakość i zasięg</string>- <string name="gs_shadow_quality_title">Jakość cieni</string>- <string name="gs_shadow_quality_dialogtitle">Jakość cieni</string>- <string name="gs_shadow_distance_title">Zasięg cieni</string>- <string name="gs_shadow_distance_dialogtitle">Zasięg cieni</string>- <string name="l10n_gs_miscellaneous_saves_title">Zapisy gry</string>- <string name="gs_add_time_to_saves_title">Dodaj czas gry do zapisów</string>- <string name="gs_add_time_to_saves_summary">Określa, czy czas spędzony w grze będzie wyświetlany przy każdym zapisie w menu Wczytaj.</string>- <string name="gs_maximum_quicksaves_title">Maksymalna liczba szybkich zapisów</string>- <string name="gs_maximum_quicksaves_summary">Maksymalna liczba przechowywanych szybkich zapisów</string>- <string name="gs_maximum_quicksaves_dialogtitle">Maksymalna liczba szybkich zapisów</string>- <string name="l10n_gs_visuals_terrain_title">Teren</string>- <string name="gs_object_paging_min_size_title">Minimalny rozmiar stronicowania obiektów</string>- <string name="gs_object_paging_min_size_summary">Określa, jak duży musi być obiekt, aby był widoczny w scenie. Zakres od 0,01 do 1,00 w krokach co 0,01.</string>- <string name="gs_distant_land_title">Odległy teren</string>- <string name="gs_distant_land_summary">Po włączeniu używa algorytmów stronicowania i LOD do wyświetlania całego terenu. Po wyłączeniu wyświetla tylko teren wczytanych komórek.</string>- <string name="gs_active_grid_object_paging_title">Stronicowanie obiektów aktywnej siatki</string>- <string name="gs_active_grid_object_paging_summary">Używa stronicowania obiektów dla siatki aktywnych komórek.</string>- <string name="l10n_gs_visuals_graphics_title">Grafika</string>- <string name="pref_physicsfps2_summary">%s FPS</string>- <string name="l10n_gs_visuals_shaders_title">Shadery</string>- <string name="gs_auto_use_object_normal_maps_title">Automatycznie używaj map normalnych obiektów</string>- <string name="gs_auto_use_object_normal_maps_summary">Jeśli ta opcja jest włączona, mapy normalne są automatycznie rozpoznawane i używane, gdy mają odpowiednią nazwę (zobacz „wzorzec mapy normalnej”; np. dla tekstury bazowej foo.dds mapa normalna musi nazywać się foo_n.dds). Po wyłączeniu mapy normalne są używane tylko wtedy, gdy zostały jawnie wymienione w pliku siatki (.nif lub .osg). Dotyczy obiektów.</string>- <string name="gs_auto_use_object_specular_maps_title">Automatycznie używaj map połysku obiektów</string>- <string name="gs_auto_use_object_specular_maps_summary">Jeśli ta opcja jest włączona, mapy połysku są automatycznie rozpoznawane i używane, gdy mają odpowiednią nazwę (zobacz „wzorzec mapy połysku”; np. dla tekstury bazowej foo.dds mapa połysku musi nazywać się foo_spec.dds). Po wyłączeniu mapy te są używane tylko wtedy, gdy zostały jawnie wymienione w pliku siatki (.osg; nieobsługiwane w plikach .nif). Dotyczy obiektów.</string>- <string name="gs_auto_use_terrain_normal_maps_title">Automatycznie używaj map normalnych terenu</string>- <string name="gs_auto_use_terrain_normal_maps_summary">Zobacz „Automatycznie używaj map normalnych obiektów”. Dotyczy terenu.</string>- <string name="gs_auto_use_terrain_specular_maps_title">Automatycznie używaj map połysku terenu</string>- <string name="gs_auto_use_terrain_specular_maps_summary">Jeśli istnieje plik zgodny ze „wzorcem mapy połysku terenu”, użyj go jako mapy „diffuse specular”. Tekstura musi zawierać kolor warstwy w kanałach RGB, jak zwykle, oraz mnożnik połysku w kanale alfa.</string>- <string name="gs_bump_map_local_lighting_title">Lokalne oświetlenie map wypukłości/odbicia</string>- <string name="gs_bump_map_local_lighting_summary">Zwykle odbicia map środowiskowych nie są zależne od oświetlenia, przez co obiekty z mapowaniem środowiskowym, a więc także z mapami wypukłości, świecą w ciemności. Morrowind Code Patch zawiera opcję naprawiającą to przez wykonanie mapowania środowiskowego przed zastosowaniem oświetlenia; to ustawienie jest jej odpowiednikiem. Obiekty objęte zmianą będą używać shaderów.</string>- <string name="l10n_gs_visuals_fog_title">Mgła</string>- <string name="gs_radial_fog_title">Mgła radialna</string>- <string name="gs_radial_fog_summary">Domyślnie mgła gęstnieje proporcjonalnie do odległości od płaszczyzny odcinania ustawionej w zasięgu odcinania, co powoduje zniekształcenia przy krawędziach ekranu. To ustawienie używa rzeczywistej odległości od punktu widzenia, czyli odległości euklidesowej, dzięki czemu mgła wygląda mniej sztucznie, szczególnie przy szerokim polu widzenia.</string>- <string name="gs_exponential_fog_title">Mgła wykładnicza</string>- <string name="gs_exponential_fog_summary">Określa, czy do obliczania mgły używana jest formuła wykładnicza.</string>- <string name="gs_sky_blending_title">Mieszanie z niebem</string>- <string name="gs_sky_blending_summary">Określa, czy płaszczyzna odcinania ma być ukrywana przez mieszanie z niebem.</string>- <string name="l10n_gs_visuals_post_processing_title">Postprocessing</string>- <string name="gs_soft_particles_title">Miękkie cząsteczki</string>- <string name="gs_soft_particles_summary">Wygładza przecięcia mieszanych systemów cząsteczek z nieprzezroczystą geometrią.</string>- <string name="gs_transparent_postpass_title">Przezroczysty postpass</string>- <string name="gs_transparent_postpass_summary">Przezroczysty postpass głębokości. Ponownie renderuje przezroczyste obiekty z wymuszonym alpha clippingiem o stałym progu.</string>- <string name="pref_game_settings_title">Ustawienia gry</string>- <string name="pref_game_settings_summary">Konfiguruj rozgrywkę, grafikę, cienie, animacje, interfejs i ustawienia silnika.</string>- <string name="pref_mods_summary">Dodaj mody do OpenMW</string>- <string name="pref_omw050_controller_menus_title">Menu kontrolera</string>- <string name="pref_omw050_controller_menus_summary">Używa nawigacji menu OpenMW 0.51 zoptymalizowanej dla kontrolera.</string>- <string name="pref_omw050_controller_tooltips_title">Podpowiedzi kontrolera</string>- <string name="pref_omw050_controller_tooltips_summary">Zawsze pokazuje podpowiedzi przedmiotów bez naciskania R3.</string>- <string name="pref_omw051_controller_trigger_thresholds_title">Czułość spustów kontrolera</string>- <string name="pref_omw051_controller_trigger_thresholds_dialogtitle">Czułość spustów kontrolera</string>- <string name="pref_controls_summary">Skonfiguruj preferowane ekranowe sterowanie dotykowe.</string>- <string name="gs_framerate_limit_summary">%s FPS</string>- <string name="l10n_settings_audio_title">Dźwięk</string>- <string name="pref_omw050_doppler_title">Efekt Dopplera</string>- <string name="pref_omw050_doppler_summary">Włącza efekt Dopplera dla dźwięku pozycyjnego w OpenMW 0.51 (współczynnik 0,25).</string>- <string name="pref_omw050_camera_listener_title">Kamera jako punkt odsłuchu</string>- <string name="pref_omw050_camera_listener_summary">Używa pozycji kamery zamiast gracza jako punktu odsłuchu dźwięku 3D.</string>- <string name="pref_skip_gui_title">Pomiń interfejs launchera</string>- <string name="pref_skip_gui_summary">Przytrzymaj „Głośność +” podczas uruchamiania aplikacji, aby ponownie wyświetlić launcher.</string>- <string name="game_settings_game_mechanics_title">Rozgrywka</string>- <string name="game_settings_visuals_title">Grafika</string>- <string name="game_settings_shadows_title">Cienie</string>- <string name="game_settings_animations_title">Animacje</string>- <string name="game_settings_interface_title">Interfejs</string>- <string name="game_settings_engine_title">Silnik</string>- <string name="l10n_gs_interface_ui_title">Interfejs użytkownika</string>- <string name="gs_show_owned_title">Pokaż własność</string>- <string name="gs_show_owned_dialogtitle">Pokaż własność</string>- <string name="gs_show_effect_duration_title">Pokaż czas trwania efektów</string>- <string name="gs_show_effect_duration_summary">Pokazuje pozostały czas działania efektów magicznych i świateł. Pozostały czas jest wyświetlany w podpowiedzi po wskazaniu efektu magicznego.</string>- <string name="gs_show_enchant_chance_title">Pokaż szansę na zaklęcie</string>- <string name="gs_show_enchant_chance_summary">Określa, czy w menu zaklinania będzie wyświetlana szansa powodzenia.</string>- <string name="gs_show_melee_info_title">Pokaż informacje o walce wręcz</string>- <string name="gs_show_melee_info_summary">Po włączeniu w podpowiedzi przedmiotu będą wyświetlane zasięg i szybkość broni do walki wręcz.</string>- <string name="gs_show_projectile_damage_title">Pokaż obrażenia pocisków</string>- <string name="gs_show_projectile_damage_summary">Po włączeniu w podpowiedzi przedmiotu będzie wyświetlany bonus obrażeń strzał i bełtów.</string>- <string name="gs_change_dialogue_topic_color_title">Zmień kolor tematów dialogowych</string>- <string name="gs_change_dialogue_topic_color_summary">Po włączeniu tematy dialogowe mają inny kolor, jeśli są specyficzne dla NPC, z którym rozmawiasz, albo były już wcześniej wyświetlane. Kolor można zmienić w settings.cfg.</string>- <string name="gs_stretch_menu_background_title">Rozciągaj tło menu</string>- <string name="gs_stretch_menu_background_summary">Rozciąga menu, ekrany wczytywania itd. do proporcji okna.</string>- <string name="gs_can_zoom_on_maps_title">Zezwalaj na powiększanie map</string>- <string name="gs_can_zoom_on_maps_summary">Włącza powiększanie map lokalnych i globalnych.</string>- <string name="l10n_gs_game_mechanics_general_title">Ogólne</string>- <string name="gs_soulgem_values_rebalance_title">Równoważenie wartości klejnotów dusz</string>- <string name="gs_soulgem_values_rebalance_summary">Uzależnia wartość wypełnionych klejnotów dusz wyłącznie od siły duszy.</string>- <string name="gs_can_loot_during_death_animation_title">Można plądrować podczas animacji śmierci</string>- <string name="gs_can_loot_during_death_animation_summary">Po włączeniu gracz może plądrować postacie, np. przywołane stworzenia, podczas ich animacji śmierci, jeśli nie są już w walce. W takim przypadku licznik śmierci zostaje zwiększony, a skrypt usuwanego aktora uruchamia się natychmiast. Po wyłączeniu gracz musi czekać do końca animacji śmierci. Znacznie utrudnia to wykorzystywanie przywołanych stworzeń, np. plądrowanie przywołanych Dremor i Złotych Świętych dla drogich broni. Może kolidować z modami manekinów używającymi SkipAnim, aby zapobiec zakończeniu animacji śmierci.</string>- <string name="gs_always_allow_stealing_from_knocked_out_actors_title">Zawsze pozwalaj okradać ogłuszone postacie</string>- <string name="gs_always_allow_stealing_from_knocked_out_actors_summary">Pozwala kraść przedmioty NPC powalonym podczas walki.</string>- <string name="l10n_gs_game_mechanics_movement_combat_title">Ruch i walka</string>- <string name="gs_toggle_sneak_title">Przełączanie skradania</string>- <string name="gs_toggle_sneak_summary">Zmienia działanie klawisza skradania, domyślnie Ctrl, tak aby przełączał skradanie zamiast wymagać ciągłego przytrzymywania. Gracze często skradający się mogą uznać sterowanie za łatwiejsze po włączeniu tej opcji.</string>- <string name="gs_uncapped_damage_fatigue_title">Nielimitowane obrażenia kondycji</string>- <string name="gs_uncapped_damage_fatigue_summary">Usuwa limit z efektu magicznego Obrażenia kondycji, podobnie jak dla efektu Wyssanie kondycji. W przeciwieństwie do Morrowinda umożliwia to powalanie postaci za pomocą tego efektu.</string>- <string name="gs_only_weapon_bs_title">Tylko odpowiednia amunicja omija odporność na zwykłą broń</string>- <string name="gs_only_weapon_bs_summary">Pozwala wyłącznie niestandardowej amunicji omijać odporność lub podatność na zwykłą broń.</string>- <string name="gs_swim_upward_correction_title">Korekta pływania w górę</string>- <string name="gs_swim_upward_correction_summary">Sprawia, że gracz płynie nieco powyżej linii wzroku. Działa tylko w widoku z trzeciej osoby i ma ułatwiać pływanie bez przypadkowego nurkowania.</string>- <string name="gs_factor_strength_into_hand_to_hand_combat_title">Uwzględniaj Siłę w walce wręcz bez broni</string>- <string name="gs_factor_strength_into_hand_to_hand_combat_dialogtitle">Uwzględniaj Siłę w walce wręcz bez broni</string>- <string name="l10n_gs_game_mechanics_npc_followers_title">NPC i towarzysze</string>- <string name="gs_followers_defend_immediately_title">Towarzysze bronią natychmiast</string>- <string name="gs_followers_defend_immediately_summary">Sprawia, że towarzysze gracza i eskortowani NPC natychmiast rozpoczynają walkę z przeciwnikami, którzy zaatakowali ich lub gracza. W przeciwnym razie czekają, aż wróg lub gracz pierwszy zaatakuje.</string>- <string name="gs_permanent_barter_disposition_changes_title">Trwałe zmiany nastawienia podczas handlu</string>- <string name="gs_permanent_barter_disposition_changes_summary">Sprawia, że zmiany nastawienia kupców spowodowane handlem są trwałe.</string>- <string name="gs_npc_avoid_collision_title">NPC unikają kolizji</string>- <string name="gs_npc_avoid_collision_summary">Po włączeniu NPC wykonują manewry omijania, aby unikać kolizji z innymi.</string>- <string name="gs_always_allow_npc_to_follow_over_water_surface_title">Zawsze pozwalaj NPC podążać po powierzchni wody</string>- <string name="gs_always_allow_npc_to_follow_over_water_surface_summary">Pozwala NPC pływać po powierzchni wody podczas podążania za inną postacią, niezależnie od ich normalnej zdolności pływania. Działa tylko przy włączonym budowaniu NavMesh.</string>- <string name="l10n_gs_game_mechanics_gameplay_fixes_title">Poprawki rozgrywki</string>- <string name="gs_racial_variation_in_speed_fix_title">Poprawka różnic prędkości między rasami</string>- <string name="gs_racial_variation_in_speed_fix_summary">Nie uwzględnia masy rasy przy obliczaniu prędkości poruszania się NPC.</string>- <string name="gs_enchanted_weapons_are_magical_title">Zaklęta broń jest magiczna</string>- <string name="gs_enchanted_weapons_are_magical_summary">Sprawia, że zaklęta broń bez flagi „Magiczna” omija odporność na zwykłą broń, tak jak w Morrowindzie.</string>- <string name="gs_classic_reflected_absorb_spells_behavior_title">Klasyczne zachowanie odbitych zaklęć Absorpcji</string>- <string name="gs_classic_reflected_absorb_spells_behavior_summary">Efekty odbitych zaklęć Absorpcji nie są odwracane, tak jak w Morrowindzie.</string>- <string name="l10n_gs_game_mechanics_saves_title">Zapisy gry</string>- <string name="txttitle_text">Nazwa moda</string>- <string name="gs_groundcover_density_title">Gęstość roślinności podłoża</string>- <string name="gs_groundcover_density_summary">Procent renderowanych instancji roślinności. 100% zachowuje pełną gęstość moda; niższe wartości zwiększają wydajność.</string>- <string name="gs_groundcover_rendering_distance_title">Zasięg renderowania roślinności</string>- <string name="gs_groundcover_rendering_distance_summary">Odległość, do której renderowana jest roślinność podłoża. Większe wartości zwiększają koszt renderowania.</string>-</resources>\ No newline at end of filediff --git a/android/app/src/main/res/values-pl/strings.xml b/android/app/src/main/res/values-pl/strings.xmldeleted file mode 100644index ac2c87b..0000000--- a/android/app/src/main/res/values-pl/strings.xml+++ /dev/null@@ -1,185 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="app_name">OpenMW</string>- <string name="general_settings">Konfiguracja</string>- <string name="start_game_label">Uruchom grę</string>- <string name="closeDrawer">Nawigacja</string>- <string name="openDrawer">Nawigacja zamknięta</string>- <string name="game_files">Pliki gry</string>- <string name="pref_graphicsLibrary">Biblioteka API grafiki</string>- <string name="pref_graphicsLibrary_default">gles2</string>- <string name="pref_advanced">Zaawansowane</string>- <string name="pref_graphics">Grafika</string>- <string name="pref_commandLine">Niestandardowe argumenty wiersza poleceń</string>- <string name="pref_envLine">Niestandardowe zmienne środowiskowe</string>- <string name="pref_nohighp">Średnia precyzja shaderów</string>- <string name="pref_nohighp_summary">Używa średniej zamiast wysokiej precyzji; dostępne tylko z ustawieniem shaderów „Modified”.</string>- <string name="pref_ui">Interfejs użytkownika</string>- <string name="pref_textureShrinking">Zmniejszanie tekstur</string>- <string name="pref_textureShrinking_default">none</string>- <string name="pref_shadersDir">Ustawienia shaderów</string>- <string name="pref_shadersDir_default">none</string>- <string name="pref_gamma">Gamma</string>- <string name="pref_uiScaling">Skalowanie interfejsu</string>- <string name="uiScaling_auto">Auto (%1$.2f)</string>- <string name="pref_screen_keeper">Nie wyłączaj ekranu</string>- <string name="pref_touchpadSensitivity">Czułość wirtualnego touchpada</string>- <string name="action_reset_config">Zresetuj statyczne pliki konfiguracji</string>- <string name="action_reset_user_config">Zresetuj pliki konfiguracji użytkownika</string>- <string name="action_reset_user_resources">Zresetuj zasoby użytkownika</string>- <string name="action_reset_screen_controls">Zresetuj sterowanie ekranowe</string>- <string name="action_show_screen_controls">Sterowanie ekranowe</string>- <string name="pref_hide_controls">Ukryj przyciski ekranowe</string>- <string name="config_was_reset">Statyczna konfiguracja została przywrócona do wartości domyślnych</string>- <string name="user_config_was_reset">Konfiguracja użytkownika została przywrócona do wartości domyślnych</string>- <string name="user_resources_was_reset">Zasoby użytkownika zostały przywrócone do wartości domyślnych</string>- <string name="pref_lang">Ustawienia języka</string>- <string name="pref_encoding">Język gry</string>- <string name="pref_encoding_default">win1252</string>- <string name="btn_opacityPlus">Alfa+</string>- <string name="btn_opacityMinus">Alfa-</string>- <string name="btn_sizePlus">Rozmiar+</string>- <string name="btn_sizeMinus">Rozmiar-</string>- <string name="btn_resetControlsLayout">Przywróć domyślne</string>- <string name="pref_physicsFPS2">FPS fizyki</string>- <string name="pref_framerate_limit">Limit liczby klatek</string>- <string name="pref_framerate_limit_default">60</string>- <string name="pref_physicsFPS2_default">30</string>- <string name="btn_back">Wstecz</string>- <string name="pref_customResolution">Niestandardowa rozdzielczość</string>- <string name="pref_display_cutout_area">Wyświetlaj w obszarze wycięcia</string>- <string name="mods">Modyfikacje gry</string>- <string name="action_about">Informacje</string>- <string name="about_title">O OpenMW</string>- <string name="action_theme">Motyw</string>- <string name="action_theme_system">Systemowy</string>- <string name="action_theme_light">Jasny</string>- <string name="action_theme_dark">Ciemny</string>- <string name="action_theme_oled">Czarny/OLED</string>- <string name="activity_settings">Ustawienia gry</string>- <string name="game_mechanics_activity_settings">Rozgrywka</string>- <string name="visuals_activity_settings">Grafika</string>- <string name="animations_activity_settings">Animacje</string>- <string name="interface_activity_settings">Interfejs</string>- <string name="bug_fixes_activity_settings">Poprawki błędów</string>- <string name="miscellaneous_activity_settings">Różne</string>- <string name="engine_activity_settings">Silnik</string>- <string name="activity_mods">Mody</string>- <string name="tab_plugins">Pluginy</string>- <string name="tab_resources">Zasoby</string>- <string name="tab_dirs">Katalogi</string>- <string name="tab_groundcover">Roślinność</string>- <string name="data_error_title">Błąd podczas odnajdywania plików gry</string>- <string name="data_error_message">Wybierz katalog zawierający zarówno plik „Morrowind.ini”, jak i katalog „Data Files”.</string>- <string name="permissions_error_title">Brak uprawnień</string>- <string name="permissions_error_message">OpenMW potrzebuje uprawnień do pamięci, aby odnaleźć i odczytać pliki gry Morrowind. Przyznaj te uprawnienia w ustawieniach aplikacji.</string>- <string name="ini_error_message">Nie udało się przekształcić pliku konfiguracji. Upewnij się, że plik „Morrowind.ini” ma poprawną strukturę.</string>- <string name="no_data_files_title">Nie znaleziono plików gry</string>- <string name="no_data_files_message">Przed uruchomieniem gry musisz skopiować pliki Morrowind na urządzenie i wskazać ich ścieżkę w sekcji „Pliki gry”.</string>- <string name="category_performance">Wydajność</string>- <string name="no_content_files_title">Brak plików zawartości!</string>- <string name="no_content_files_message">Nie włączono żadnych plików zawartości. Przed uruchomieniem gry musisz aktywować co najmniej jeden plik pluginu w menu „Mody…”.</string>- <string name="no_content_files_dismiss">Mimo to kontynuuj</string>- <string name="configure_mods">Konfiguruj mody</string>- <string name="pref_mouse_mode">Tryb myszy w menu</string>- <string name="pref_mouse_mode_default">hybrid</string>- <string name="bugsnag_yes">Tak</string>- <string name="bugsnag_no">Nie</string>- <string name="bugsnag_policy">Polityka prywatności</string>- <string name="bugsnag_consent_title">Automatycznie zgłaszać awarie?</string>- <string name="bugsnag_consent_message">Czy chcesz włączyć automatyczne zgłaszanie awarii?\nW razie awarii niektóre dane o urządzeniu, konfiguracji i zainstalowanych modach zostaną automatycznie przesłane do Bugsnag. Więcej informacji znajdziesz w Polityce prywatności.\nTo ustawienie można w każdej chwili zmienić w menu.</string>- <string name="bugsnag_consent_restart_title">Uruchom ponownie aplikację</string>- <string name="bugsnag_consent_restart_message">Aby te ustawienia zaczęły obowiązywać, musisz ponownie uruchomić aplikację.</string>- <string name="action_bugsnag_consent">Raportowanie awarii</string>- <string name="dialog_howto">Instrukcja</string>- <string name="no_browser_title">Nie można otworzyć adresu URL</string>- <string name="no_browser_message">Wygląda na to, że nie masz zainstalowanej przeglądarki internetowej. Próbowano otworzyć następujący adres URL:\n\n%1$s</string>- <string name="pref_show_qp">Włącz szybkie klawisze</string>- <string name="pref_show_fn">Włącz klawisze FN</string>- <string name="pref_always_show_top_bar">Zawsze pokazuj ikony górnego paska</string>- <string name="theme">0</string>- <string name="shadows_activity_settings">Cienie</string>- <string name="slider_auto">Auto</string>- <string name="controller_trigger_custom_values">Niestandardowa (%1$d wciśnięcie, %2$d zwolnienie)</string>- <string name="controller_trigger_custom">Niestandardowa</string>- <string name="resolution_width_hint">Szerokość</string>- <string name="resolution_height_hint">Wysokość</string>- <string name="resolution_native">Natywna</string>- <string name="resolution_invalid">Podaj prawidłową szerokość i wysokość.</string>- <string name="launch_preparing">Wczytywanie…</string>- <string name="launch_preparing_game">Przygotowywanie OpenMW…</string>- <string name="launch_failed_title">Nie udało się uruchomić OpenMW</string>- <string name="launch_failed_unknown">Nieznany błąd podczas przygotowywania OpenMW.</string>- <string name="user_configuration">Konfiguracja użytkownika</string>- <string name="action_theme_submenu">Motyw ›</string>- <string name="theme_set_to">Ustawiono motyw %1$s</string>- <string name="about_port_info">Ten port przygotował Andreas \'Andiweli\' Stürmer\nNa podstawie portu CaveBros\nOpenMW rozwijane przez zespół OpenMW od 2008 roku</string>- <string name="third_party_notices">Informacje o komponentach firm trzecich</string>- <string name="chooser_select">Wybierz</string>- <string name="chooser_create">Utwórz</string>- <string name="chooser_new_folder">Nowy folder</string>- <string name="chooser_cancel">Anuluj</string>- <string name="chooser_heading">Wybierz pamięć</string>- <string name="chooser_internal_storage">Pamięć wewnętrzna</string>- <string name="chooser_free_space">%1$s wolne</string>- <string name="chooser_folder_created">Folder utworzony</string>- <string name="chooser_folder_error">Wystąpił błąd podczas tworzenia folderu. Spróbuj ponownie.</string>- <string name="chooser_folder_name">Nazwa folderu</string>- <string name="chooser_empty_folder_name">Nazwa folderu nie może być pusta</string>- <string-array name="pref_encoding_entries">- <item>Europa Środkowa i Wschodnia (win1250)</item>- <item>Cyrylica (win1251)</item>- <item>Łaciński (win1252)</item>- </string-array>- <string-array name="gs_factor_strength_into_hand_to_hand_combat_entries">- <item>Wyłączone</item>- <item>Dotyczy wilkołaków</item>- <item>Nie dotyczy wilkołaków</item>- </string-array>- <string-array name="gs_show_owned_entries">- <item>Wyłączone</item>- <item>Tylko podpowiedź</item>- <item>Tylko celownik</item>- <item>Podpowiedź i celownik</item>- </string-array>- <string-array name="pref_omw051_controller_trigger_sensitivity_entries">- <item>Domyślne OpenMW (15/16 wciśnięcie, 13/16 zwolnienie)</item>- <item>Zrównoważone (12/16 wciśnięcie, 10/16 zwolnienie)</item>- <item>Czułe (8/16 wciśnięcie, 6/16 zwolnienie)</item>- </string-array>- <string-array name="pref_textureShrinking_entries">- <item>Brak</item>- <item>Niskie</item>- <item>Średnie</item>- <item>Wysokie</item>- </string-array>- <string-array name="pref_shadersDir_entries">- <item>Oryginalne</item>- <item>Zmodyfikowane</item>- <item>Zesterer</item>- <item>OMWFX</item>- </string-array>- <string-array name="pref_mouse_mode_entries">- <item>Hybrydowy</item>- <item>Względne sterowanie joystickiem</item>- <item>Bezwzględne sterowanie dotykowe</item>- </string-array>- <string-array name="gs_shadow_quality_entries">- <item>Niska</item>- <item>Średnia</item>- <item>Wysoka</item>- <item>Bardzo wysoka</item>- </string-array>- <string-array name="gs_shadow_distance_entries">- <item>Niski</item>- <item>Średni</item>- <item>Wysoki</item>- </string-array>- <string name="osk_shift">Shift</string>- <string name="osk_caps_lock">Caps Lock</string>- <string name="osk_language">Język</string>- <string name="sdl_error_title">Błąd SDL</string>- <string name="sdl_exit">Zakończ</string>- <string name="sdl_start_error">Wystąpił błąd podczas uruchamiania aplikacji. Spróbuj ponownie i/lub zainstaluj aplikację ponownie.\n\nBłąd: %1$s</string>- <string name="navmesh_generating_cache">TWORZENIE PAMIĘCI PODRĘCZNEJ NAVMESH</string>-</resources>\ No newline at end of filediff --git a/android/app/src/main/res/values-ru/launcher_preferences.xml b/android/app/src/main/res/values-ru/launcher_preferences.xmldeleted file mode 100644index 07e8f74..0000000--- a/android/app/src/main/res/values-ru/launcher_preferences.xml+++ /dev/null@@ -1,180 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="l10n_gs_animations_animations_title">Анимации</string>- <string name="gs_use_magic_item_animation_title">Использовать анимацию магических предметов</string>- <string name="gs_use_magic_item_animation_summary">Использует анимации произнесения заклинаний для магических предметов так же, как для заклинаний.</string>- <string name="gs_use_additional_animation_sources_title">Использовать дополнительные источники анимаций</string>- <string name="gs_use_additional_animation_sources_summary">Загружает групповые KF-файлы и файлы скелетов из папки Animations.</string>- <string name="gs_weapon_sheating_title">Отображение убранного оружия</string>- <string name="gs_weapon_sheating_summary">Отображает убранное оружие (включая колчаны и ножны); требуются изменённые ресурсы.</string>- <string name="gs_shield_sheating_title">Отображение убранного щита</string>- <string name="gs_shield_sheating_summary">Отображает убранный щит; требуются изменённые ресурсы.</string>- <string name="gs_enable_graphics_herbalism_title">Включить графический сбор растений</string>- <string name="gs_enable_graphics_herbalism_summary">Если эта настройка включена, поддерживающие графический сбор растений контейнеры будут использовать его вместо открытия меню.</string>- <string name="gs_smooth_movement_title">Плавное движение</string>- <string name="gs_smooth_movement_summary">Делает движение NPC и игрока более плавным. Рекомендуется вместе с включённым поворотом по направлению движения.</string>- <string name="gs_smooth_animation_transitions_title">Плавные переходы анимаций</string>- <string name="gs_smooth_animation_transitions_summary">Плавно смешивает совместимые переходы между анимациями. Добавлено в OpenMW 0.49; по умолчанию отключено.</string>- <string name="gs_turn_to_movement_direction_title">Поворачиваться по направлению движения</string>- <string name="gs_turn_to_movement_direction_summary">Влияет на боковое и диагональное движение. Включение делает движение реалистичнее. Если параметр отключён, всё тело персонажа направлено в сторону взгляда. Для диагонального движения нет отдельной анимации, поэтому персонаж скользит. Если параметр включён, нижняя часть тела поворачивается по направлению движения, верхняя — лишь частично, а голова всегда направлена по взгляду. В бою это действует только при диагональном движении. Вне боя также изменяет движение строго вправо и влево. При плавании всё тело дополнительно наклоняется вверх или вниз по направлению движения.</string>- <string name="l10n_gs_engine_engine_title">Движок</string>- <string name="gs_groundcover_handling_title">Наземная растительность</string>- <string name="gs_groundcover_handling_summary">Включает нативный инстансинг OpenMW 0.51 для модов, загруженных через вкладку наземной растительности.</string>- <string name="gs_groundcover_handling_dialogtitle">Обработка наземной растительности</string>- <string name="gs_groundcover_point_lighting_title">Точечное освещение наземной растительности</string>- <string name="gs_groundcover_point_lighting_summary">OpenMW 0.51: позволяет ближайшим лампам и другим точечным источникам света освещать траву. Отключите, чтобы немного снизить нагрузку на GPU.</string>- <string name="gs_build_navmesh_title">Строить NavMesh для геометрии мира</string>- <string name="gs_build_navmesh_summary">Включает навигацию. При включении запускаются фоновые потоки, которые строят навигационную сетку для геометрии мира. Система поиска пути использует NavMesh для построения маршрутов. При отключении используется только pathgrid. На одноядерных процессорах возможна значительная потеря производительности при выходе из помещений и перемещении по внешнему миру. На многоядерных системах влияние обычно невелико, но задержка обновления NavMesh зависит от других настроек и производительности системы. Перемещение по внешнему миру и вход или выход из локаций вызывают обновление NavMesh. NPC и существа могут не находить путь, пока сетка вокруг них не будет построена. Отключите эту настройку, если предпочитаете старую ИИ-модель, которая не знает, куда идти, когда вы стоите за камнем и бросаете огненный шар.</string>- <string name="gs_write_navmesh_title">Записывать кэш NavMesh на диск</string>- <string name="gs_write_navmesh_summary">Кэширует тайлы навигационной сетки на диске.</string>- <string name="l10n_gs_engine_threading_title">Потоки</string>- <string name="gs_navmesh_threads_title">Фоновые потоки NavMesh</string>- <string name="gs_navmesh_threads_summary">Количество фоновых потоков для обновления NavMesh. От 1 до 8; по умолчанию 1.</string>- <string name="gs_physics_threads_title">Фоновые потоки физики</string>- <string name="gs_physics_threads_summary">Количество фоновых потоков для обновления физики. От 1 до 8; по умолчанию 1.</string>- <string name="gs_preload_threads_title">Фоновые потоки предзагрузки</string>- <string name="gs_preload_threads_summary">Количество фоновых потоков предварительной загрузки. OpenMW 0.51 рекомендует 2–3 на многоядерных системах; 4 и более не рекомендуются.</string>- <string name="l10n_gs_bug_fixes_miscellaneous_title">Разное</string>- <string name="gs_merchant_equipping_fix_title">Исправление экипировки торговцев</string>- <string name="gs_merchant_equipping_fix_summary">Не позволяет торговцам экипировать проданные им предметы.</string>- <string name="gs_trainers_bs_title">Тренеры выбирают навыки по базовым значениям</string>- <string name="gs_trainers_bs_summary">Тренеры выбирают навыки для обучения только по их базовым значениям, поэтому эффекты повышения Торговли можно использовать без появления Торговли среди предлагаемых навыков.</string>- <string name="l10n_gs_shadows_general_title">Общие</string>- <string name="gs_enable_shadows_title">Включить тени</string>- <string name="gs_enable_shadows_summary">Включает тени OpenMW в реальном времени. Использует шейдерный путь рендеринга и может снизить производительность.</string>- <string name="l10n_gs_shadows_shadow_casters_title">Источники теней</string>- <string name="gs_player_shadows_title">Тень игрока</string>- <string name="gs_player_shadows_summary">Позволяет персонажу игрока отбрасывать тень.</string>- <string name="gs_actor_shadows_title">Тени персонажей</string>- <string name="gs_actor_shadows_summary">Позволяет NPC и существам отбрасывать тени.</string>- <string name="gs_object_shadows_title">Тени объектов</string>- <string name="gs_object_shadows_summary">Позволяет объектам мира отбрасывать тени.</string>- <string name="gs_terrain_shadows_title">Тени ландшафта</string>- <string name="gs_terrain_shadows_summary">Позволяет ландшафту отбрасывать тени.</string>- <string name="gs_indoor_shadows_title">Тени в помещениях</string>- <string name="gs_indoor_shadows_summary">Разрешает тени в помещениях. Из-за ограничений данных Morrowind тени внутри помещений могут отбрасывать только персонажи.</string>- <string name="l10n_gs_shadows_quality_distance_title">Качество и дальность</string>- <string name="gs_shadow_quality_title">Качество теней</string>- <string name="gs_shadow_quality_dialogtitle">Качество теней</string>- <string name="gs_shadow_distance_title">Дальность теней</string>- <string name="gs_shadow_distance_dialogtitle">Дальность теней</string>- <string name="l10n_gs_miscellaneous_saves_title">Сохранения</string>- <string name="gs_add_time_to_saves_title">Добавлять время игры в сохранения</string>- <string name="gs_add_time_to_saves_summary">Определяет, будет ли для каждого сохранения в меню загрузки отображаться проведённое в игре время.</string>- <string name="gs_maximum_quicksaves_title">Максимум быстрых сохранений</string>- <string name="gs_maximum_quicksaves_summary">Максимальное количество хранимых быстрых сохранений</string>- <string name="gs_maximum_quicksaves_dialogtitle">Максимум быстрых сохранений</string>- <string name="l10n_gs_visuals_terrain_title">Ландшафт</string>- <string name="gs_object_paging_min_size_title">Минимальный размер для подгрузки объектов</string>- <string name="gs_object_paging_min_size_summary">Определяет минимальный размер объекта, при котором он видим в сцене. Диапазон от 0,01 до 1,00 с шагом 0,01.</string>- <string name="gs_distant_land_title">Дальний ландшафт</string>- <string name="gs_distant_land_summary">Если включено, использует алгоритмы подгрузки и LOD для отображения всего ландшафта. Если отключено, отображается только ландшафт загруженных ячеек.</string>- <string name="gs_active_grid_object_paging_title">Подгрузка объектов активной сетки</string>- <string name="gs_active_grid_object_paging_summary">Использует подгрузку объектов для сетки активных ячеек.</string>- <string name="l10n_gs_visuals_graphics_title">Графика</string>- <string name="pref_physicsfps2_summary">%s FPS</string>- <string name="l10n_gs_visuals_shaders_title">Шейдеры</string>- <string name="gs_auto_use_object_normal_maps_title">Автоматически использовать карты нормалей объектов</string>- <string name="gs_auto_use_object_normal_maps_summary">Если параметр включён, карты нормалей автоматически распознаются и используются при правильном имени (см. «шаблон карты нормалей»; например, для базовой текстуры foo.dds карта нормалей должна называться foo_n.dds). Если параметр отключён, карты нормалей используются только при явном указании в файле модели (.nif или .osg). Влияет на объекты.</string>- <string name="gs_auto_use_object_specular_maps_title">Автоматически использовать карты отражений объектов</string>- <string name="gs_auto_use_object_specular_maps_summary">Если параметр включён, карты отражений автоматически распознаются и используются при правильном имени (см. «шаблон карты отражений»; например, для базовой текстуры foo.dds карта отражений должна называться foo_spec.dds). Если параметр отключён, такие карты используются только при явном указании в файле модели (.osg; в .nif не поддерживается). Влияет на объекты.</string>- <string name="gs_auto_use_terrain_normal_maps_title">Автоматически использовать карты нормалей ландшафта</string>- <string name="gs_auto_use_terrain_normal_maps_summary">См. «Автоматически использовать карты нормалей объектов». Влияет на ландшафт.</string>- <string name="gs_auto_use_terrain_specular_maps_title">Автоматически использовать карты отражений ландшафта</string>- <string name="gs_auto_use_terrain_specular_maps_summary">Если существует файл по «шаблону карты отражений ландшафта», он используется как карта «diffuse specular». Текстура должна содержать цвет слоя в каналах RGB, как обычно, и множитель отражения в альфа-канале.</string>- <string name="gs_bump_map_local_lighting_title">Локальное освещение Bump/Reflect-карт</string>- <string name="gs_bump_map_local_lighting_summary">Обычно отражения environment map не зависят от освещения, из-за чего объекты с environment mapping, а значит и с bump mapping, светятся в темноте. В Morrowind Code Patch есть параметр, исправляющий это выполнением environment mapping до применения освещения; эта настройка является его аналогом. Затронутые объекты будут использовать шейдеры.</string>- <string name="l10n_gs_visuals_fog_title">Туман</string>- <string name="gs_radial_fog_title">Радиальный туман</string>- <string name="gs_radial_fog_summary">По умолчанию туман становится плотнее пропорционально расстоянию до плоскости отсечения, установленной на дальности отсечения, что вызывает искажения по краям экрана. Эта настройка использует фактическое расстояние от точки наблюдения, то есть евклидово расстояние, поэтому туман выглядит естественнее, особенно при широком поле зрения.</string>- <string name="gs_exponential_fog_title">Экспоненциальный туман</string>- <string name="gs_exponential_fog_summary">Определяет, использовать ли экспоненциальную формулу для тумана.</string>- <string name="gs_sky_blending_title">Смешивание с небом</string>- <string name="gs_sky_blending_summary">Определяет, скрывать ли плоскость отсечения путём смешивания с небом.</string>- <string name="l10n_gs_visuals_post_processing_title">Постобработка</string>- <string name="gs_soft_particles_title">Мягкие частицы</string>- <string name="gs_soft_particles_summary">Смягчает пересечения смешиваемых систем частиц с непрозрачной геометрией.</string>- <string name="gs_transparent_postpass_title">Прозрачный постпроход</string>- <string name="gs_transparent_postpass_summary">Прозрачный постпроход глубины. Повторно отрисовывает прозрачные объекты с принудительным alpha clipping и фиксированным порогом.</string>- <string name="pref_game_settings_title">Настройки игры</string>- <string name="pref_game_settings_summary">Настройка игрового процесса, графики, теней, анимаций, интерфейса и параметров движка.</string>- <string name="pref_mods_summary">Добавить моды в OpenMW</string>- <string name="pref_omw050_controller_menus_title">Меню с контроллера</string>- <string name="pref_omw050_controller_menus_summary">Использует оптимизированную для геймпада навигацию по меню OpenMW 0.51.</string>- <string name="pref_omw050_controller_tooltips_title">Подсказки контроллера</string>- <string name="pref_omw050_controller_tooltips_summary">Всегда показывает подсказки предметов без нажатия R3.</string>- <string name="pref_omw051_controller_trigger_thresholds_title">Чувствительность курков контроллера</string>- <string name="pref_omw051_controller_trigger_thresholds_dialogtitle">Чувствительность курков контроллера</string>- <string name="pref_controls_summary">Настройте предпочитаемые экранные сенсорные элементы управления.</string>- <string name="gs_framerate_limit_summary">%s FPS</string>- <string name="l10n_settings_audio_title">Аудио</string>- <string name="pref_omw050_doppler_title">Эффект Доплера</string>- <string name="pref_omw050_doppler_summary">Включает эффект Доплера для позиционного звука OpenMW 0.51 (коэффициент 0,25).</string>- <string name="pref_omw050_camera_listener_title">Камера как слушатель звука</string>- <string name="pref_omw050_camera_listener_summary">Использует положение камеры вместо положения игрока как точку прослушивания 3D-звука.</string>- <string name="pref_skip_gui_title">Пропускать интерфейс лаунчера</string>- <string name="pref_skip_gui_summary">Удерживайте «Громкость +» при запуске приложения, чтобы снова показать лаунчер.</string>- <string name="game_settings_game_mechanics_title">Игровой процесс</string>- <string name="game_settings_visuals_title">Графика</string>- <string name="game_settings_shadows_title">Тени</string>- <string name="game_settings_animations_title">Анимации</string>- <string name="game_settings_interface_title">Интерфейс</string>- <string name="game_settings_engine_title">Движок</string>- <string name="l10n_gs_interface_ui_title">Интерфейс</string>- <string name="gs_show_owned_title">Показывать принадлежность</string>- <string name="gs_show_owned_dialogtitle">Показывать принадлежность</string>- <string name="gs_show_effect_duration_title">Показывать длительность эффектов</string>- <string name="gs_show_effect_duration_summary">Показывает оставшееся время магических эффектов и источников света. Оставшееся время отображается во всплывающей подсказке при наведении на магический эффект.</string>- <string name="gs_show_enchant_chance_title">Показывать шанс зачарования</string>- <string name="gs_show_enchant_chance_summary">Определяет, отображать ли вероятность успеха в меню зачарования.</string>- <string name="gs_show_melee_info_title">Показывать данные ближнего боя</string>- <string name="gs_show_melee_info_summary">Если включено, дальность и скорость оружия ближнего боя отображаются в подсказке предмета.</string>- <string name="gs_show_projectile_damage_title">Показывать урон снарядов</string>- <string name="gs_show_projectile_damage_summary">Если включено, бонус урона стрел и болтов отображается в подсказке предмета.</string>- <string name="gs_change_dialogue_topic_color_title">Изменять цвет тем диалога</string>- <string name="gs_change_dialogue_topic_color_summary">Если включено, темы диалога имеют другой цвет, когда тема относится именно к NPC, с которым вы говорите, или уже была просмотрена. Цвет можно изменить в settings.cfg.</string>- <string name="gs_stretch_menu_background_title">Растягивать фон меню</string>- <string name="gs_stretch_menu_background_summary">Растягивает меню, экраны загрузки и т. п. до соотношения сторон окна.</string>- <string name="gs_can_zoom_on_maps_title">Разрешить масштабирование карт</string>- <string name="gs_can_zoom_on_maps_summary">Включает масштабирование локальной и глобальной карт.</string>- <string name="l10n_gs_game_mechanics_general_title">Общие</string>- <string name="gs_soulgem_values_rebalance_title">Перебалансировка стоимости камней душ</string>- <string name="gs_soulgem_values_rebalance_summary">Определяет стоимость заполненных камней душ только по силе души.</string>- <string name="gs_can_loot_during_death_animation_title">Разрешить обыск во время анимации смерти</string>- <string name="gs_can_loot_during_death_animation_summary">Если включено, игрок может обыскивать персонажей, например призванных существ, во время их анимации смерти, когда они уже не участвуют в бою. В этом случае счётчик смертей увеличивается, а скрипт удаляемого персонажа выполняется немедленно. Если отключено, необходимо дождаться окончания анимации смерти. Это значительно усложняет эксплойты с призванными существами, например обыск призванных дремор и золотых святых ради дорогого оружия. Может конфликтовать с модами манекенов, использующими SkipAnim для предотвращения завершения анимации смерти.</string>- <string name="gs_always_allow_stealing_from_knocked_out_actors_title">Всегда разрешать кражу у оглушённых персонажей</string>- <string name="gs_always_allow_stealing_from_knocked_out_actors_summary">Позволяет красть предметы у поваленных NPC во время боя.</string>- <string name="l10n_gs_game_mechanics_movement_combat_title">Движение и бой</string>- <string name="gs_toggle_sneak_title">Переключение скрытности</string>- <string name="gs_toggle_sneak_summary">Меняет поведение клавиши скрытности, по умолчанию Ctrl: скрытность включается и выключается нажатием, а удерживать клавишу не требуется. Игрокам, часто использующим скрытность, так может быть удобнее управлять персонажем.</string>- <string name="gs_uncapped_damage_fatigue_title">Неограниченный урон запасу сил</string>- <string name="gs_uncapped_damage_fatigue_summary">Снимает ограничение с магического эффекта «Урон запасу сил», как у эффекта «Поглощение запаса сил». В отличие от Morrowind, с его помощью становится возможно сбивать персонажей с ног.</string>- <string name="gs_only_weapon_bs_title">Только подходящие боеприпасы обходят сопротивление обычному оружию</string>- <string name="gs_only_weapon_bs_summary">Позволяет только нестандартным боеприпасам обходить сопротивление или уязвимость к обычному оружию.</string>- <string name="gs_swim_upward_correction_title">Коррекция движения вверх при плавании</string>- <string name="gs_swim_upward_correction_summary">Заставляет игрока плыть немного выше линии взгляда. Действует только от третьего лица и упрощает плавание без случайного погружения.</string>- <string name="gs_factor_strength_into_hand_to_hand_combat_title">Учитывать Силу в рукопашном бою</string>- <string name="gs_factor_strength_into_hand_to_hand_combat_dialogtitle">Учитывать Силу в рукопашном бою</string>- <string name="l10n_gs_game_mechanics_npc_followers_title">NPC и спутники</string>- <string name="gs_followers_defend_immediately_title">Спутники защищают немедленно</string>- <string name="gs_followers_defend_immediately_summary">Заставляет спутников игрока и сопровождаемых NPC сразу вступать в бой с врагами, которые напали на них или на игрока. Иначе они ждут, пока враг или игрок не нанесёт первый удар.</string>- <string name="gs_permanent_barter_disposition_changes_title">Постоянные изменения отношения при торговле</string>- <string name="gs_permanent_barter_disposition_changes_summary">Делает вызванные торговлей изменения отношения торговцев постоянными.</string>- <string name="gs_npc_avoid_collision_title">NPC избегают столкновений</string>- <string name="gs_npc_avoid_collision_summary">Если включено, NPC выполняют манёвры уклонения, чтобы избегать столкновений с другими.</string>- <string name="gs_always_allow_npc_to_follow_over_water_surface_title">Всегда разрешать NPC следовать по поверхности воды</string>- <string name="gs_always_allow_npc_to_follow_over_water_surface_summary">Позволяет NPC плыть по поверхности воды при следовании за другим персонажем независимо от их обычной способности плавать. Действует только при включённом построении NavMesh.</string>- <string name="l10n_gs_game_mechanics_gameplay_fixes_title">Исправления игрового процесса</string>- <string name="gs_racial_variation_in_speed_fix_title">Исправление расовых различий скорости</string>- <string name="gs_racial_variation_in_speed_fix_summary">Не учитывает вес расы при расчёте скорости движения NPC.</string>- <string name="gs_enchanted_weapons_are_magical_title">Зачарованное оружие считается магическим</string>- <string name="gs_enchanted_weapons_are_magical_summary">Зачарованное оружие без флага «Магическое» обходит сопротивление обычному оружию, как в Morrowind.</string>- <string name="gs_classic_reflected_absorb_spells_behavior_title">Классическое поведение отражённых заклинаний Поглощения</string>- <string name="gs_classic_reflected_absorb_spells_behavior_summary">Эффекты отражённых заклинаний Поглощения не меняются местами, как в Morrowind.</string>- <string name="l10n_gs_game_mechanics_saves_title">Сохранения</string>- <string name="txttitle_text">Название мода</string>- <string name="gs_groundcover_density_title">Плотность наземной растительности</string>- <string name="gs_groundcover_density_summary">Доля отображаемых экземпляров растительности. 100% сохраняет полную плотность мода; меньшие значения повышают производительность.</string>- <string name="gs_groundcover_rendering_distance_title">Дальность отрисовки растительности</string>- <string name="gs_groundcover_rendering_distance_summary">Расстояние, на котором отображается наземная растительность. Большие значения увеличивают нагрузку на рендеринг.</string>-</resources>\ No newline at end of filediff --git a/android/app/src/main/res/values-ru/strings.xml b/android/app/src/main/res/values-ru/strings.xmldeleted file mode 100644index f635388..0000000--- a/android/app/src/main/res/values-ru/strings.xml+++ /dev/null@@ -1,185 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="app_name">OpenMW</string>- <string name="general_settings">Настройка</string>- <string name="start_game_label">Запустить игру</string>- <string name="closeDrawer">Навигация</string>- <string name="openDrawer">Навигация закрыта</string>- <string name="game_files">Файлы игры</string>- <string name="pref_graphicsLibrary">Библиотека графического API</string>- <string name="pref_graphicsLibrary_default">gles2</string>- <string name="pref_advanced">Дополнительно</string>- <string name="pref_graphics">Графика</string>- <string name="pref_commandLine">Пользовательские аргументы командной строки</string>- <string name="pref_envLine">Пользовательские переменные окружения</string>- <string name="pref_nohighp">Средняя точность шейдеров</string>- <string name="pref_nohighp_summary">Использует среднюю точность вместо высокой; доступно только с набором шейдеров «Modified».</string>- <string name="pref_ui">Интерфейс</string>- <string name="pref_textureShrinking">Уменьшение текстур</string>- <string name="pref_textureShrinking_default">none</string>- <string name="pref_shadersDir">Наборы шейдеров</string>- <string name="pref_shadersDir_default">none</string>- <string name="pref_gamma">Гамма</string>- <string name="pref_uiScaling">Масштаб интерфейса</string>- <string name="uiScaling_auto">Авто (%1$.2f)</string>- <string name="pref_screen_keeper">Не выключать экран</string>- <string name="pref_touchpadSensitivity">Чувствительность виртуальной сенсорной панели</string>- <string name="action_reset_config">Сбросить статические файлы конфигурации</string>- <string name="action_reset_user_config">Сбросить файлы конфигурации пользователя</string>- <string name="action_reset_user_resources">Сбросить пользовательские ресурсы</string>- <string name="action_reset_screen_controls">Сбросить экранное управление</string>- <string name="action_show_screen_controls">Экранное управление</string>- <string name="pref_hide_controls">Скрыть экранные кнопки</string>- <string name="config_was_reset">Статическая конфигурация сброшена к значениям по умолчанию</string>- <string name="user_config_was_reset">Конфигурация пользователя сброшена к значениям по умолчанию</string>- <string name="user_resources_was_reset">Пользовательские ресурсы сброшены к значениям по умолчанию</string>- <string name="pref_lang">Настройки языка</string>- <string name="pref_encoding">Язык игры</string>- <string name="pref_encoding_default">win1252</string>- <string name="btn_opacityPlus">Прозрачность+</string>- <string name="btn_opacityMinus">Прозрачность-</string>- <string name="btn_sizePlus">Размер+</string>- <string name="btn_sizeMinus">Размер-</string>- <string name="btn_resetControlsLayout">Сбросить по умолчанию</string>- <string name="pref_physicsFPS2">FPS физики</string>- <string name="pref_framerate_limit">Ограничение частоты кадров</string>- <string name="pref_framerate_limit_default">60</string>- <string name="pref_physicsFPS2_default">30</string>- <string name="btn_back">Назад</string>- <string name="pref_customResolution">Пользовательское разрешение</string>- <string name="pref_display_cutout_area">Отображать в области выреза</string>- <string name="mods">Модификации игры</string>- <string name="action_about">О программе</string>- <string name="about_title">Об OpenMW</string>- <string name="action_theme">Тема</string>- <string name="action_theme_system">Системная</string>- <string name="action_theme_light">Светлая</string>- <string name="action_theme_dark">Тёмная</string>- <string name="action_theme_oled">Чёрная/OLED</string>- <string name="activity_settings">Настройки игры</string>- <string name="game_mechanics_activity_settings">Игровой процесс</string>- <string name="visuals_activity_settings">Графика</string>- <string name="animations_activity_settings">Анимации</string>- <string name="interface_activity_settings">Интерфейс</string>- <string name="bug_fixes_activity_settings">Исправления ошибок</string>- <string name="miscellaneous_activity_settings">Разное</string>- <string name="engine_activity_settings">Движок</string>- <string name="activity_mods">Моды</string>- <string name="tab_plugins">Плагины</string>- <string name="tab_resources">Ресурсы</string>- <string name="tab_dirs">Каталоги</string>- <string name="tab_groundcover">Наземная растительность</string>- <string name="data_error_title">Ошибка поиска файлов игры</string>- <string name="data_error_message">Выберите каталог, содержащий одновременно файл «Morrowind.ini» и каталог «Data Files».</string>- <string name="permissions_error_title">Нет разрешений</string>- <string name="permissions_error_message">OpenMW требуется доступ к хранилищу, чтобы найти и использовать файлы Morrowind. Разрешите доступ в настройках приложения.</string>- <string name="ini_error_message">Не удалось преобразовать файл конфигурации. Убедитесь, что файл «Morrowind.ini» имеет корректную структуру.</string>- <string name="no_data_files_title">Файлы игры не найдены</string>- <string name="no_data_files_message">Скопируйте файлы Morrowind на устройство и укажите путь к ним в разделе «Файлы игры», прежде чем запускать игру.</string>- <string name="category_performance">Производительность</string>- <string name="no_content_files_title">Нет файлов содержимого!</string>- <string name="no_content_files_message">Не включено ни одного файла содержимого. Перед запуском игры необходимо активировать хотя бы один файл плагина в меню «Моды…».</string>- <string name="no_content_files_dismiss">Всё равно продолжить</string>- <string name="configure_mods">Настроить моды</string>- <string name="pref_mouse_mode">Режим мыши в меню</string>- <string name="pref_mouse_mode_default">hybrid</string>- <string name="bugsnag_yes">Да</string>- <string name="bugsnag_no">Нет</string>- <string name="bugsnag_policy">Политика конфиденциальности</string>- <string name="bugsnag_consent_title">Автоматически отправлять отчёты о сбоях?</string>- <string name="bugsnag_consent_message">Включить автоматическую отправку отчётов о сбоях?\nЕсли произойдёт сбой, некоторые данные об устройстве, конфигурации и установленных модах будут автоматически отправлены в Bugsnag. Подробнее см. в Политике конфиденциальности.\nЭту настройку можно изменить в меню в любое время.</string>- <string name="bugsnag_consent_restart_title">Перезапустите приложение</string>- <string name="bugsnag_consent_restart_message">Чтобы настройки вступили в силу, необходимо перезапустить приложение.</string>- <string name="action_bugsnag_consent">Отчёты о сбоях</string>- <string name="dialog_howto">Инструкция</string>- <string name="no_browser_title">Не удалось открыть URL</string>- <string name="no_browser_message">Похоже, на устройстве не установлен веб-браузер. Была предпринята попытка открыть следующий URL:\n\n%1$s</string>- <string name="pref_show_qp">Включить быстрые клавиши</string>- <string name="pref_show_fn">Включить клавиши FN</string>- <string name="pref_always_show_top_bar">Всегда показывать значки верхней панели</string>- <string name="theme">0</string>- <string name="shadows_activity_settings">Тени</string>- <string name="slider_auto">Авто</string>- <string name="controller_trigger_custom_values">Пользовательская (%1$d нажатие, %2$d отпускание)</string>- <string name="controller_trigger_custom">Пользовательская</string>- <string name="resolution_width_hint">Ширина</string>- <string name="resolution_height_hint">Высота</string>- <string name="resolution_native">Родное</string>- <string name="resolution_invalid">Введите корректные ширину и высоту.</string>- <string name="launch_preparing">Загрузка…</string>- <string name="launch_preparing_game">Подготовка OpenMW…</string>- <string name="launch_failed_title">Не удалось запустить OpenMW</string>- <string name="launch_failed_unknown">Неизвестная ошибка при подготовке OpenMW.</string>- <string name="user_configuration">Конфигурация пользователя</string>- <string name="action_theme_submenu">Тема ›</string>- <string name="theme_set_to">Установлена тема %1$s</string>- <string name="about_port_info">Этот порт подготовил Andreas \'Andiweli\' Stürmer\nНа основе порта CaveBros\nOpenMW разрабатывается командой OpenMW с 2008 года</string>- <string name="third_party_notices">Сведения о сторонних компонентах</string>- <string name="chooser_select">Выбрать</string>- <string name="chooser_create">Создать</string>- <string name="chooser_new_folder">Новая папка</string>- <string name="chooser_cancel">Отмена</string>- <string name="chooser_heading">Выбор хранилища</string>- <string name="chooser_internal_storage">Внутреннее хранилище</string>- <string name="chooser_free_space">Свободно %1$s</string>- <string name="chooser_folder_created">Папка создана</string>- <string name="chooser_folder_error">При создании папки произошла ошибка. Повторите попытку.</string>- <string name="chooser_folder_name">Имя папки</string>- <string name="chooser_empty_folder_name">Имя папки не может быть пустым</string>- <string-array name="pref_encoding_entries">- <item>Центральная и Восточная Европа (win1250)</item>- <item>Кириллица (win1251)</item>- <item>Латиница (win1252)</item>- </string-array>- <string-array name="gs_factor_strength_into_hand_to_hand_combat_entries">- <item>Выкл.</item>- <item>Влияет на оборотней</item>- <item>Не влияет на оборотней</item>- </string-array>- <string-array name="gs_show_owned_entries">- <item>Выкл.</item>- <item>Только подсказка</item>- <item>Только прицел</item>- <item>Подсказка и прицел</item>- </string-array>- <string-array name="pref_omw051_controller_trigger_sensitivity_entries">- <item>По умолчанию OpenMW (15/16 нажатие, 13/16 отпускание)</item>- <item>Сбалансированная (12/16 нажатие, 10/16 отпускание)</item>- <item>Чувствительная (8/16 нажатие, 6/16 отпускание)</item>- </string-array>- <string-array name="pref_textureShrinking_entries">- <item>Нет</item>- <item>Низкое</item>- <item>Среднее</item>- <item>Высокое</item>- </string-array>- <string-array name="pref_shadersDir_entries">- <item>Оригинальные</item>- <item>Изменённые</item>- <item>Zesterer</item>- <item>OMWFX</item>- </string-array>- <string-array name="pref_mouse_mode_entries">- <item>Гибридный</item>- <item>Относительное управление джойстиком</item>- <item>Абсолютное сенсорное управление</item>- </string-array>- <string-array name="gs_shadow_quality_entries">- <item>Низкое</item>- <item>Среднее</item>- <item>Высокое</item>- <item>Очень высокое</item>- </string-array>- <string-array name="gs_shadow_distance_entries">- <item>Малая</item>- <item>Средняя</item>- <item>Большая</item>- </string-array>- <string name="osk_shift">Shift</string>- <string name="osk_caps_lock">Caps Lock</string>- <string name="osk_language">Язык</string>- <string name="sdl_error_title">Ошибка SDL</string>- <string name="sdl_exit">Выйти</string>- <string name="sdl_start_error">При запуске приложения произошла ошибка. Повторите попытку и/или переустановите приложение.\n\nОшибка: %1$s</string>- <string name="navmesh_generating_cache">СОЗДАНИЕ КЭША NAVMESH</string>-</resources>\ No newline at end of filediff --git a/android/app/src/main/res/values-sv/launcher_preferences.xml b/android/app/src/main/res/values-sv/launcher_preferences.xmldeleted file mode 100644index 743e60d..0000000--- a/android/app/src/main/res/values-sv/launcher_preferences.xml+++ /dev/null@@ -1,180 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="l10n_gs_animations_animations_title">Animationer</string>- <string name="gs_use_magic_item_animation_title">Använd animation för magiska föremål</string>- <string name="gs_use_magic_item_animation_summary">Använd besvärjelseanimationer för magiska föremål, precis som för trollformler.</string>- <string name="gs_use_additional_animation_sources_title">Använd ytterligare animationskällor</string>- <string name="gs_use_additional_animation_sources_summary">Läser in gruppspecifika KF-filer och skelettfiler från mappen Animations.</string>- <string name="gs_weapon_sheating_title">Hölstrade vapen</string>- <string name="gs_weapon_sheating_summary">Visar hölstrade vapen (med koger och skidor); kräver modifierade resurser.</string>- <string name="gs_shield_sheating_title">Hölstrade sköldar</string>- <string name="gs_shield_sheating_summary">Visar en undanstoppad sköld; kräver modifierade resurser.</string>- <string name="gs_enable_graphics_herbalism_title">Aktivera grafisk örtskörd</string>- <string name="gs_enable_graphics_herbalism_summary">Om inställningen är aktiverad använder behållare med stöd för grafisk örtskörd detta i stället för att öppna menyn.</string>- <string name="gs_smooth_movement_title">Mjuk rörelse</string>- <string name="gs_smooth_movement_summary">Gör NPC- och spelarrörelser mjukare. Rekommenderas tillsammans med Vänd mot rörelseriktningen.</string>- <string name="gs_smooth_animation_transitions_title">Mjuka animationsövergångar</string>- <string name="gs_smooth_animation_transitions_summary">Blandar kompatibla animationsövergångar mjukt. Nytt i OpenMW 0.49; avstängt som standard.</string>- <string name="gs_turn_to_movement_direction_title">Vänd mot rörelseriktningen</string>- <string name="gs_turn_to_movement_direction_summary">Påverkar rörelse i sidled och diagonalt. När inställningen är aktiverad blir rörelsen mer realistisk. Om den är avstängd pekar hela figurens kropp i blickriktningen. Diagonal rörelse har ingen särskild animation och gör att figuren glider. När den är aktiverad vrider figuren underkroppen i rörelseriktningen, medan överkroppen bara vrids delvis. Huvudet pekar alltid i blickriktningen. I stridsläge gäller detta bara diagonal rörelse. Utanför strid påverkar det även rörelse rakt åt höger och vänster. Vid simning vrids dessutom hela kroppen uppåt eller nedåt efter rörelseriktningen.</string>- <string name="l10n_gs_engine_engine_title">Motor</string>- <string name="gs_groundcover_handling_title">Markvegetation</string>- <string name="gs_groundcover_handling_summary">Aktiverar OpenMW 0.51:s inbyggda instansrendering för markvegetationsmoddar som lästs in via fliken för markvegetation.</string>- <string name="gs_groundcover_handling_dialogtitle">Hantering av marktäckning</string>- <string name="gs_groundcover_point_lighting_title">Punktbelysning på marktäckning</string>- <string name="gs_groundcover_point_lighting_summary">OpenMW 0.51: låter närliggande lampor och andra punktljus belysa gräs. Stäng av för att spara lite GPU-prestanda.</string>- <string name="gs_build_navmesh_title">Bygg NavMesh för världsgeometri</string>- <string name="gs_build_navmesh_summary">Aktiverar navigeringssystemet. När det är aktiverat startas bakgrundstrådar som bygger navigeringsnät för världsgeometrin. Sökvägssystemet använder NavMesh för att skapa vägar. När inställningen är avstängd används endast pathgrid. System med en enda CPU-kärna kan få stor prestandapåverkan när man lämnar interiörer och rör sig i utomhusvärlden. På flerkärniga system är påverkan normalt liten, men fördröjningen vid NavMesh-uppdateringar kan variera beroende på övriga inställningar och systemets prestanda. Förflyttning i utomhusvärlden och in- eller utgång ur platser utlöser en NavMesh-uppdatering. NPC:er och varelser kan ha svårt att hitta vägen innan nätet har byggts runt dem. Stäng av detta om du föredrar den äldre AI:n som inte vet vart den ska gå när du står bakom en sten och kastar en eldprojektil.</string>- <string name="gs_write_navmesh_title">Skriv NavMesh-cache till disk</string>- <string name="gs_write_navmesh_summary">Lagrar navigeringsnätets rutor i cache på disk.</string>- <string name="l10n_gs_engine_threading_title">Trådar</string>- <string name="gs_navmesh_threads_title">NavMesh-trådar i bakgrunden</string>- <string name="gs_navmesh_threads_summary">Antal bakgrundstrådar som uppdaterar NavMesh. Kan ställas från 1 till 8; standard är 1.</string>- <string name="gs_physics_threads_title">Fysiktrådar i bakgrunden</string>- <string name="gs_physics_threads_summary">Antal bakgrundstrådar som används för fysikuppdateringar. Kan ställas från 1 till 8; standard är 1.</string>- <string name="gs_preload_threads_title">Förinläsningstrådar i bakgrunden</string>- <string name="gs_preload_threads_summary">Antal bakgrundstrådar för förinläsning. OpenMW 0.51 rekommenderar 2–3 på flerkärniga system; 4 eller fler rekommenderas inte.</string>- <string name="l10n_gs_bug_fixes_miscellaneous_title">Diverse</string>- <string name="gs_merchant_equipping_fix_title">Korrigering av handlarutrustning</string>- <string name="gs_merchant_equipping_fix_summary">Förhindrar handlare från att utrusta föremål som säljs till dem.</string>- <string name="gs_trainers_bs_title">Tränare väljer färdigheter utifrån grundvärden</string>- <string name="gs_trainers_bs_summary">Tränare väljer endast vilka färdigheter de kan träna utifrån sina grundvärden, så effekter som förbättrar Handel kan användas utan att Handel blir en erbjuden färdighet.</string>- <string name="l10n_gs_shadows_general_title">Allmänt</string>- <string name="gs_enable_shadows_title">Aktivera skuggor</string>- <string name="gs_enable_shadows_summary">Aktiverar OpenMW:s skuggmappning i realtid. Detta använder shader-rendering och kan minska prestandan.</string>- <string name="l10n_gs_shadows_shadow_casters_title">Skuggkastare</string>- <string name="gs_player_shadows_title">Spelarskugga</string>- <string name="gs_player_shadows_summary">Låter spelarens figur kasta skugga.</string>- <string name="gs_actor_shadows_title">Figurskuggor</string>- <string name="gs_actor_shadows_summary">Låter NPC:er och varelser kasta skuggor.</string>- <string name="gs_object_shadows_title">Objektskuggor</string>- <string name="gs_object_shadows_summary">Låter objekt i världen kasta skuggor.</string>- <string name="gs_terrain_shadows_title">Terrängskuggor</string>- <string name="gs_terrain_shadows_summary">Låter terrängen kasta skuggor.</string>- <string name="gs_indoor_shadows_title">Skuggor inomhus</string>- <string name="gs_indoor_shadows_summary">Tillåter skuggor inomhus. På grund av begränsningar i Morrowinds data kan endast aktörer kasta skuggor inomhus.</string>- <string name="l10n_gs_shadows_quality_distance_title">Kvalitet och avstånd</string>- <string name="gs_shadow_quality_title">Skuggkvalitet</string>- <string name="gs_shadow_quality_dialogtitle">Skuggkvalitet</string>- <string name="gs_shadow_distance_title">Skuggavstånd</string>- <string name="gs_shadow_distance_dialogtitle">Skuggavstånd</string>- <string name="l10n_gs_miscellaneous_saves_title">Sparningar</string>- <string name="gs_add_time_to_saves_title">Lägg till speltid i sparningar</string>- <string name="gs_add_time_to_saves_summary">Avgör om tiden spelaren har spelat ska visas för varje sparning i menyn Läs in.</string>- <string name="gs_maximum_quicksaves_title">Maximalt antal snabbsparningar</string>- <string name="gs_maximum_quicksaves_summary">Maximalt antal lagrade snabbsparningar</string>- <string name="gs_maximum_quicksaves_dialogtitle">Maximalt antal snabbsparningar</string>- <string name="l10n_gs_visuals_terrain_title">Terräng</string>- <string name="gs_object_paging_min_size_title">Minsta storlek för objektpaging</string>- <string name="gs_object_paging_min_size_summary">Styr hur stort ett objekt måste vara för att synas i scenen. Kan ställas från 0,01 till 1,00 i steg om 0,01.</string>- <string name="gs_distant_land_title">Avlägsen terräng</string>- <string name="gs_distant_land_summary">När inställningen är aktiverad används paging- och LOD-algoritmer för att visa hela terrängen. När den är avstängd visas endast terräng i inlästa celler.</string>- <string name="gs_active_grid_object_paging_title">Objektpaging för aktivt rutnät</string>- <string name="gs_active_grid_object_paging_summary">Använder objektpaging för rutnätet av aktiva celler.</string>- <string name="l10n_gs_visuals_graphics_title">Grafik</string>- <string name="pref_physicsfps2_summary">%s FPS</string>- <string name="l10n_gs_visuals_shaders_title">Shaders</string>- <string name="gs_auto_use_object_normal_maps_title">Använd objektens normal maps automatiskt</string>- <string name="gs_auto_use_object_normal_maps_summary">Om inställningen är aktiverad känns normal maps automatiskt igen och används när de har rätt namn (se ”normal map-mönster”; för en bastextur foo.dds måste normal map-filen exempelvis heta foo_n.dds). Om inställningen är avstängd används normal maps endast om de uttryckligen anges i mesh-filen (.nif eller .osg). Påverkar objekt.</string>- <string name="gs_auto_use_object_specular_maps_title">Använd objektens specular maps automatiskt</string>- <string name="gs_auto_use_object_specular_maps_summary">Om inställningen är aktiverad känns specular maps automatiskt igen och används när de har rätt namn (se ”specular map-mönster”; för en bastextur foo.dds måste specular map-filen exempelvis heta foo_spec.dds). Om inställningen är avstängd används dessa endast om de uttryckligen anges i mesh-filen (.osg; stöds inte i .nif-filer). Påverkar objekt.</string>- <string name="gs_auto_use_terrain_normal_maps_title">Använd terrängens normal maps automatiskt</string>- <string name="gs_auto_use_terrain_normal_maps_summary">Se ”Använd objektens normal maps automatiskt”. Påverkar terräng.</string>- <string name="gs_auto_use_terrain_specular_maps_title">Använd terrängens specular maps automatiskt</string>- <string name="gs_auto_use_terrain_specular_maps_summary">Om en fil som matchar ”mönster för terrängens specular map” finns används den som en ”diffuse specular”-map. Texturen måste innehålla lagrets färg i RGB-kanalerna, som vanligt, och en spegelmultiplikator i alfakanalen.</string>- <string name="gs_bump_map_local_lighting_title">Lokal belysning för bump/reflect maps</string>- <string name="gs_bump_map_local_lighting_summary">Normalt påverkas reflektioner från environment maps inte av belysning, vilket gör att objekt med environment mapping, och därmed bump mapping, lyser i mörker. Morrowind Code Patch har en inställning som åtgärdar detta genom att utföra environment mapping före belysningen; den här inställningen motsvarar den. Berörda objekt använder shaders.</string>- <string name="l10n_gs_visuals_fog_title">Dimma</string>- <string name="gs_radial_fog_title">Radiell dimma</string>- <string name="gs_radial_fog_summary">Som standard blir dimman tätare i proportion till avståndet från klippningsplanet vid klippningsavståndet, vilket kan ge förvrängning vid skärmkanterna. Den här inställningen använder det faktiska avståndet från ögonpunkten, det så kallade euklidiska avståndet, för att beräkna dimman. Det gör att dimman ser mindre konstgjord ut, särskilt med brett synfält.</string>- <string name="gs_exponential_fog_title">Exponentiell dimma</string>- <string name="gs_exponential_fog_summary">Anger om en exponentiell formel ska användas för dimman.</string>- <string name="gs_sky_blending_title">Blandning med himlen</string>- <string name="gs_sky_blending_summary">Anger om klippningsplanet ska döljas genom att blandas med himlen.</string>- <string name="l10n_gs_visuals_post_processing_title">Efterbehandling</string>- <string name="gs_soft_particles_title">Mjuka partiklar</string>- <string name="gs_soft_particles_summary">Mjukar upp skärningen mellan blandade partikelsystem och ogenomskinlig geometri.</string>- <string name="gs_transparent_postpass_title">Transparent efterpass</string>- <string name="gs_transparent_postpass_summary">Transparent djupefterpass. Ritar om transparenta objekt med tvingad alpha clipping och ett fast tröskelvärde.</string>- <string name="pref_game_settings_title">Spelinställningar</string>- <string name="pref_game_settings_summary">Konfigurera spelmekanik, grafik, skuggor, animationer, gränssnitt och motorinställningar.</string>- <string name="pref_mods_summary">Lägg till moddar i OpenMW</string>- <string name="pref_omw050_controller_menus_title">Handkontrollmenyer</string>- <string name="pref_omw050_controller_menus_summary">Använder OpenMW 0.51:s meny-navigering optimerad för handkontroll.</string>- <string name="pref_omw050_controller_tooltips_title">Handkontrollens verktygstips</string>- <string name="pref_omw050_controller_tooltips_summary">Visar alltid föremålens verktygstips utan att R3 behöver tryckas.</string>- <string name="pref_omw051_controller_trigger_thresholds_title">Känslighet för handkontrollens avtryckare</string>- <string name="pref_omw051_controller_trigger_thresholds_dialogtitle">Känslighet för handkontrollens avtryckare</string>- <string name="pref_controls_summary">Konfigurera de pekskärmskontroller du föredrar.</string>- <string name="gs_framerate_limit_summary">%s FPS</string>- <string name="l10n_settings_audio_title">Ljud</string>- <string name="pref_omw050_doppler_title">Dopplereffekt</string>- <string name="pref_omw050_doppler_summary">Aktiverar OpenMW 0.51:s dopplereffekt för positionsljud (faktor 0,25).</string>- <string name="pref_omw050_camera_listener_title">Kameran som ljudlyssnare</string>- <string name="pref_omw050_camera_listener_summary">Använder kamerans position i stället för spelarens som lyssnarposition för 3D-ljud.</string>- <string name="pref_skip_gui_title">Hoppa över startprogrammets gränssnitt</string>- <string name="pref_skip_gui_summary">Håll ned ”Volym upp” när appen startas för att visa startprogrammet igen.</string>- <string name="game_settings_game_mechanics_title">Spelmekanik</string>- <string name="game_settings_visuals_title">Grafik</string>- <string name="game_settings_shadows_title">Skuggor</string>- <string name="game_settings_animations_title">Animationer</string>- <string name="game_settings_interface_title">Gränssnitt</string>- <string name="game_settings_engine_title">Motor</string>- <string name="l10n_gs_interface_ui_title">Användargränssnitt</string>- <string name="gs_show_owned_title">Visa ägda föremål</string>- <string name="gs_show_owned_dialogtitle">Visa ägda föremål</string>- <string name="gs_show_effect_duration_title">Visa effekters varaktighet</string>- <string name="gs_show_effect_duration_summary">Visar återstående tid för magiska effekter och ljus. Den återstående tiden visas i verktygstipset när pekaren hålls över den magiska effekten.</string>- <string name="gs_show_enchant_chance_title">Visa chans för förtrollning</string>- <string name="gs_show_enchant_chance_summary">Anger om chansen att lyckas ska visas i förtrollningsmenyn.</string>- <string name="gs_show_melee_info_title">Visa information om närstrid</string>- <string name="gs_show_melee_info_summary">När inställningen är aktiverad visas närstridsvapnens räckvidd och hastighet i föremålets verktygstips.</string>- <string name="gs_show_projectile_damage_title">Visa projektilskada</string>- <string name="gs_show_projectile_damage_summary">När inställningen är aktiverad visas skadebonusen för pilar och armborstpilar i föremålets verktygstips.</string>- <string name="gs_change_dialogue_topic_color_title">Ändra färg på dialogämnen</string>- <string name="gs_change_dialogue_topic_color_summary">När inställningen är aktiverad får dialogämnen en annan färg om ämnet är specifikt för den NPC du talar med eller om ämnet redan har visats. Färgen kan ändras i settings.cfg.</string>- <string name="gs_stretch_menu_background_title">Sträck menybakgrunden</string>- <string name="gs_stretch_menu_background_summary">Sträcker menyer, laddningsskärmar med mera till fönstrets bildförhållande.</string>- <string name="gs_can_zoom_on_maps_title">Tillåt zoom på kartor</string>- <string name="gs_can_zoom_on_maps_summary">Aktiverar zoomning på lokala och globala kartor.</string>- <string name="l10n_gs_game_mechanics_general_title">Allmänt</string>- <string name="gs_soulgem_values_rebalance_title">Balansera om själsstenarnas värden</string>- <string name="gs_soulgem_values_rebalance_summary">Gör värdet på fyllda själsstenar beroende enbart av själens styrka.</string>- <string name="gs_can_loot_during_death_animation_title">Tillåt plundring under dödsanimation</string>- <string name="gs_can_loot_during_death_animation_summary">När inställningen är aktiverad kan spelaren plundra aktörer, exempelvis frammanade varelser, under deras dödsanimation när de inte längre är i strid. Då ökas dödsräknaren och den borttagna aktörens skript körs omedelbart. När inställningen är avstängd måste spelaren vänta tills dödsanimationen är klar. Det gör exploateringar med frammanade varelser, såsom att plundra frammanade Dremora och Golden Saints på dyrbara vapen, betydligt svårare. Kan krocka med skyltdocksmoddar som använder SkipAnim för att hindra dödsanimationen från att avslutas.</string>- <string name="gs_always_allow_stealing_from_knocked_out_actors_title">Tillåt alltid stöld från utslagna aktörer</string>- <string name="gs_always_allow_stealing_from_knocked_out_actors_summary">Gör det möjligt att stjäla föremål från NPC:er som slagits omkull under strid.</string>- <string name="l10n_gs_game_mechanics_movement_combat_title">Rörelse och strid</string>- <string name="gs_toggle_sneak_title">Växla smygläge</string>- <string name="gs_toggle_sneak_summary">Gör att smygknappen, som normalt är Ctrl, växlar smygläget på och av i stället för att behöva hållas ned. Spelare som smyger mycket kan uppleva att figuren blir lättare att styra med inställningen aktiverad.</string>- <string name="gs_uncapped_damage_fatigue_title">Obegränsad skada på uthållighet</string>- <string name="gs_uncapped_damage_fatigue_summary">Tar bort gränsen för den magiska effekten Skada uthållighet, på samma sätt som för Dränera uthållighet. Till skillnad från Morrowind blir det då möjligt att slå omkull aktörer med effekten.</string>- <string name="gs_only_weapon_bs_title">Endast lämplig ammunition kringgår motstånd mot vanliga vapen</string>- <string name="gs_only_weapon_bs_summary">Tillåter endast icke-standardammunition att kringgå motstånd eller svaghet mot vanliga vapen.</string>- <string name="gs_swim_upward_correction_title">Korrigering uppåt vid simning</string>- <string name="gs_swim_upward_correction_summary">Gör att spelaren simmar något ovanför siktlinjen. Gäller endast i tredjepersonsläge och är avsett att göra det enklare att simma utan att oavsiktligt dyka.</string>- <string name="gs_factor_strength_into_hand_to_hand_combat_title">Räkna in Styrka i obeväpnad strid</string>- <string name="gs_factor_strength_into_hand_to_hand_combat_dialogtitle">Räkna in Styrka i obeväpnad strid</string>- <string name="l10n_gs_game_mechanics_npc_followers_title">NPC:er och följeslagare</string>- <string name="gs_followers_defend_immediately_title">Följeslagare försvarar omedelbart</string>- <string name="gs_followers_defend_immediately_summary">Gör att spelarens följeslagare och eskorterade NPC:er omedelbart börjar slåss mot fiender som har angripit dem eller spelaren. Annars väntar de tills fienden eller spelaren anfaller först.</string>- <string name="gs_permanent_barter_disposition_changes_title">Permanenta attitydförändringar vid handel</string>- <string name="gs_permanent_barter_disposition_changes_summary">Gör att förändringar i handlares attityd som orsakas av handel blir permanenta.</string>- <string name="gs_npc_avoid_collision_title">NPC:er undviker kollisioner</string>- <string name="gs_npc_avoid_collision_summary">När inställningen är aktiverad gör NPC:er undanmanövrar för att undvika kollisioner med andra.</string>- <string name="gs_always_allow_npc_to_follow_over_water_surface_title">Tillåt alltid NPC:er att följa över vattenytan</string>- <string name="gs_always_allow_npc_to_follow_over_water_surface_summary">Låter NPC:er simma på vattenytan när de följer en annan aktör, oberoende av deras vanliga simförmåga. Har endast effekt när NavMesh-byggande är aktiverat.</string>- <string name="l10n_gs_game_mechanics_gameplay_fixes_title">Spelmekaniska korrigeringar</string>- <string name="gs_racial_variation_in_speed_fix_title">Korrigering av rasbaserade hastighetsskillnader</string>- <string name="gs_racial_variation_in_speed_fix_summary">Använder inte rasens vikt vid beräkning av NPC:ers rörelsehastighet.</string>- <string name="gs_enchanted_weapons_are_magical_title">Förtrollade vapen är magiska</string>- <string name="gs_enchanted_weapons_are_magical_summary">Gör att förtrollade vapen utan flaggan ”Magisk” kringgår motstånd mot vanliga vapen, som i Morrowind.</string>- <string name="gs_classic_reflected_absorb_spells_behavior_title">Klassiskt beteende för reflekterade Absorb-besvärjelser</string>- <string name="gs_classic_reflected_absorb_spells_behavior_summary">Effekterna av reflekterade Absorb-besvärjelser spegelvänds inte, som i Morrowind.</string>- <string name="l10n_gs_game_mechanics_saves_title">Sparningar</string>- <string name="txttitle_text">Moddnamn</string>- <string name="gs_groundcover_density_title">Markvegetationens täthet</string>- <string name="gs_groundcover_density_summary">Andel markvegetationsinstanser som ritas. 100 % behåller moddarnas fulla täthet; lägre värden förbättrar prestandan.</string>- <string name="gs_groundcover_rendering_distance_title">Ritavstånd för markvegetation</string>- <string name="gs_groundcover_rendering_distance_summary">Avståndet som markvegetation ritas på. Högre värden ökar renderingskostnaden.</string>-</resources>\ No newline at end of filediff --git a/android/app/src/main/res/values-sv/strings.xml b/android/app/src/main/res/values-sv/strings.xmldeleted file mode 100644index 0cd27b2..0000000--- a/android/app/src/main/res/values-sv/strings.xml+++ /dev/null@@ -1,185 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="app_name">OpenMW</string>- <string name="general_settings">Inställningar</string>- <string name="start_game_label">Starta spelet</string>- <string name="closeDrawer">Navigering</string>- <string name="openDrawer">Navigering stängd</string>- <string name="game_files">Spelfiler</string>- <string name="pref_graphicsLibrary">Grafik-API-bibliotek</string>- <string name="pref_graphicsLibrary_default">gles2</string>- <string name="pref_advanced">Avancerat</string>- <string name="pref_graphics">Grafik</string>- <string name="pref_commandLine">Egna kommandoradsargument</string>- <string name="pref_envLine">Egna miljövariabler</string>- <string name="pref_nohighp">Medelhög shaderprecision</string>- <string name="pref_nohighp_summary">Använder medelhög i stället för hög precision; endast tillgängligt med shaderförinställningen ”Modified”.</string>- <string name="pref_ui">Användargränssnitt</string>- <string name="pref_textureShrinking">Texturminskning</string>- <string name="pref_textureShrinking_default">none</string>- <string name="pref_shadersDir">Shaderförinställningar</string>- <string name="pref_shadersDir_default">none</string>- <string name="pref_gamma">Gamma</string>- <string name="pref_uiScaling">Skalningsfaktor för gränssnitt</string>- <string name="uiScaling_auto">Auto (%1$.2f)</string>- <string name="pref_screen_keeper">Håll skärmen alltid på</string>- <string name="pref_touchpadSensitivity">Känslighet för virtuell pekplatta</string>- <string name="action_reset_config">Återställ statiska konfigurationsfiler</string>- <string name="action_reset_user_config">Återställ användarens konfigurationsfiler</string>- <string name="action_reset_user_resources">Återställ användarresurser</string>- <string name="action_reset_screen_controls">Återställ skärmkontroller</string>- <string name="action_show_screen_controls">Skärmkontroller</string>- <string name="pref_hide_controls">Dölj skärmknappar</string>- <string name="config_was_reset">Den statiska konfigurationen återställdes till standardvärden</string>- <string name="user_config_was_reset">Användarkonfigurationen återställdes till standardvärden</string>- <string name="user_resources_was_reset">Användarresurserna återställdes till standardvärden</string>- <string name="pref_lang">Språkinställningar</string>- <string name="pref_encoding">Spelspråk</string>- <string name="pref_encoding_default">win1252</string>- <string name="btn_opacityPlus">Alfa+</string>- <string name="btn_opacityMinus">Alfa-</string>- <string name="btn_sizePlus">Storlek+</string>- <string name="btn_sizeMinus">Storlek-</string>- <string name="btn_resetControlsLayout">Återställ standard</string>- <string name="pref_physicsFPS2">Fysik-FPS</string>- <string name="pref_framerate_limit">Bildfrekvensgräns</string>- <string name="pref_framerate_limit_default">60</string>- <string name="pref_physicsFPS2_default">30</string>- <string name="btn_back">Tillbaka</string>- <string name="pref_customResolution">Egen upplösning</string>- <string name="pref_display_cutout_area">Visa i skärmens urklippsområde</string>- <string name="mods">Spelmodifieringar</string>- <string name="action_about">Om</string>- <string name="about_title">Om OpenMW</string>- <string name="action_theme">Tema</string>- <string name="action_theme_system">System</string>- <string name="action_theme_light">Ljust</string>- <string name="action_theme_dark">Mörkt</string>- <string name="action_theme_oled">Svart/OLED</string>- <string name="activity_settings">Spelinställningar</string>- <string name="game_mechanics_activity_settings">Spelmekanik</string>- <string name="visuals_activity_settings">Grafik</string>- <string name="animations_activity_settings">Animationer</string>- <string name="interface_activity_settings">Gränssnitt</string>- <string name="bug_fixes_activity_settings">Felkorrigeringar</string>- <string name="miscellaneous_activity_settings">Diverse</string>- <string name="engine_activity_settings">Motor</string>- <string name="activity_mods">Moddar</string>- <string name="tab_plugins">Insticksfiler</string>- <string name="tab_resources">Resurser</string>- <string name="tab_dirs">Kataloger</string>- <string name="tab_groundcover">Marktäckning</string>- <string name="data_error_title">Fel vid sökning efter spelfiler</string>- <string name="data_error_message">Välj en katalog som innehåller både filen ”Morrowind.ini” och katalogen ”Data Files”.</string>- <string name="permissions_error_title">Inga behörigheter</string>- <string name="permissions_error_message">OpenMW behöver lagringsbehörighet för att hitta och komma åt Morrowinds spelfiler. Ge behörigheten i appens inställningar.</string>- <string name="ini_error_message">Konfigurationsfilen kunde inte omvandlas. Kontrollera att ”Morrowind.ini” är korrekt formaterad.</string>- <string name="no_data_files_title">Spelfiler hittades inte</string>- <string name="no_data_files_message">Du måste kopiera Morrowinds spelfiler till enheten och välja sökvägen under ”Spelfiler” innan spelet kan startas.</string>- <string name="category_performance">Prestanda</string>- <string name="no_content_files_title">Inga innehållsfiler!</string>- <string name="no_content_files_message">Inga innehållsfiler är aktiverade. Innan spelet kan starta måste du aktivera minst en insticksfil via menyn ”Moddar…”.</string>- <string name="no_content_files_dismiss">Fortsätt ändå</string>- <string name="configure_mods">Konfigurera moddar</string>- <string name="pref_mouse_mode">Musläge i menyer</string>- <string name="pref_mouse_mode_default">hybrid</string>- <string name="bugsnag_yes">Ja</string>- <string name="bugsnag_no">Nej</string>- <string name="bugsnag_policy">Integritetspolicy</string>- <string name="bugsnag_consent_title">Rapportera krascher automatiskt?</string>- <string name="bugsnag_consent_message">Vill du aktivera automatisk kraschrapportering?\nOm en krasch inträffar skickas viss information om enheten, konfigurationen och installerade moddar automatiskt till Bugsnag. Mer information finns i integritetspolicyn.\nInställningen kan ändras när som helst från menyn.</string>- <string name="bugsnag_consent_restart_title">Starta om appen</string>- <string name="bugsnag_consent_restart_message">Du måste starta om appen för att inställningarna ska börja gälla.</string>- <string name="action_bugsnag_consent">Kraschrapportering</string>- <string name="dialog_howto">Guide</string>- <string name="no_browser_title">Kunde inte öppna en URL</string>- <string name="no_browser_message">Det verkar inte finnas någon webbläsare installerad. Följande URL försökte öppnas:\n\n%1$s</string>- <string name="pref_show_qp">Aktivera snabbknappar</string>- <string name="pref_show_fn">Aktivera FN-tangenter</string>- <string name="pref_always_show_top_bar">Visa alltid ikoner i översta fältet</string>- <string name="theme">0</string>- <string name="shadows_activity_settings">Skuggor</string>- <string name="slider_auto">Auto</string>- <string name="controller_trigger_custom_values">Egen (%1$d tryck, %2$d släpp)</string>- <string name="controller_trigger_custom">Egen</string>- <string name="resolution_width_hint">Bredd</string>- <string name="resolution_height_hint">Höjd</string>- <string name="resolution_native">Inbyggd</string>- <string name="resolution_invalid">Ange en giltig bredd och höjd.</string>- <string name="launch_preparing">Läser in…</string>- <string name="launch_preparing_game">Förbereder OpenMW…</string>- <string name="launch_failed_title">OpenMW kunde inte startas</string>- <string name="launch_failed_unknown">Okänt fel när OpenMW förbereddes.</string>- <string name="user_configuration">Användarkonfiguration</string>- <string name="action_theme_submenu">Tema ›</string>- <string name="theme_set_to">Tema inställt på %1$s</string>- <string name="about_port_info">Den här portningen är gjord av Andreas \'Andiweli\' Stürmer\nBaserad på en portning av CaveBros\nOpenMW av OpenMW-teamet sedan 2008</string>- <string name="third_party_notices">Information om tredjepartskomponenter</string>- <string name="chooser_select">Välj</string>- <string name="chooser_create">Skapa</string>- <string name="chooser_new_folder">Ny mapp</string>- <string name="chooser_cancel">Avbryt</string>- <string name="chooser_heading">Välj lagring</string>- <string name="chooser_internal_storage">Intern lagring</string>- <string name="chooser_free_space">%1$s ledigt</string>- <string name="chooser_folder_created">Mapp skapad</string>- <string name="chooser_folder_error">Ett fel inträffade när mappen skapades. Försök igen.</string>- <string name="chooser_folder_name">Mappnamn</string>- <string name="chooser_empty_folder_name">Mappnamnet får inte vara tomt</string>- <string-array name="pref_encoding_entries">- <item>Central- och östeuropeisk (win1250)</item>- <item>Kyrillisk (win1251)</item>- <item>Latinsk (win1252)</item>- </string-array>- <string-array name="gs_factor_strength_into_hand_to_hand_combat_entries">- <item>Av</item>- <item>Påverka varulvar</item>- <item>Påverka inte varulvar</item>- </string-array>- <string-array name="gs_show_owned_entries">- <item>Av</item>- <item>Endast verktygstips</item>- <item>Endast sikte</item>- <item>Verktygstips och sikte</item>- </string-array>- <string-array name="pref_omw051_controller_trigger_sensitivity_entries">- <item>OpenMW-standard (15/16 tryck, 13/16 släpp)</item>- <item>Balanserad (12/16 tryck, 10/16 släpp)</item>- <item>Känslig (8/16 tryck, 6/16 släpp)</item>- </string-array>- <string-array name="pref_textureShrinking_entries">- <item>Ingen</item>- <item>Låg</item>- <item>Medel</item>- <item>Hög</item>- </string-array>- <string-array name="pref_shadersDir_entries">- <item>Original</item>- <item>Modifierad</item>- <item>Zesterer</item>- <item>OMWFX</item>- </string-array>- <string-array name="pref_mouse_mode_entries">- <item>Hybrid</item>- <item>Relativ joystickstyrning</item>- <item>Absolut pekstyrning</item>- </string-array>- <string-array name="gs_shadow_quality_entries">- <item>Låg</item>- <item>Medel</item>- <item>Hög</item>- <item>Mycket hög</item>- </string-array>- <string-array name="gs_shadow_distance_entries">- <item>Kort</item>- <item>Medel</item>- <item>Lång</item>- </string-array>- <string name="osk_shift">Skift</string>- <string name="osk_caps_lock">Caps Lock</string>- <string name="osk_language">Språk</string>- <string name="sdl_error_title">SDL-fel</string>- <string name="sdl_exit">Avsluta</string>- <string name="sdl_start_error">Ett fel inträffade när appen skulle startas. Försök igen och/eller installera om appen.\n\nFel: %1$s</string>- <string name="navmesh_generating_cache">SKAPAR NAVMESH-CACHE</string>-</resources>\ No newline at end of filediff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xmldeleted file mode 100644index e474057..0000000--- a/android/app/src/main/res/values/colors.xml+++ /dev/null@@ -1,34 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<resources>- <color name="colorPrimary">#2196F3</color>- <color name="colorPrimaryDark">#1976D2</color>- <color name="colorAccent">#FF4081</color>-- <color name="modItemBackgroundColor">#FFFFFF</color>- <color name="modItemSelectedColor">#999999</color>- <color name="modItemTextColor">#000000</color>-- <color name="statusBarColor">#1976D2</color>-- <!-- Storage Chooser -->- <array name="default_light">- <!-- Overview -->- <item>@color/colorPrimary</item> <!-- Top Header bg -->- <item>@android:color/white</item> <!-- header text -->- <item>@android:color/white</item> <!-- list bg -->- <item>@android:color/black</item> <!-- storage list name text -->- <item>@color/colorPrimary</item> <!-- free space text -->- <item>@color/colorAccent</item> <!-- memory bar -->-- <!-- secondary dialog colors -->- <item>@color/colorPrimary</item> <!-- folder icon color -->- <item>@android:color/white</item> <!-- list bg -->- <item>@android:color/black</item> <!-- list text -->- <item>@android:color/white</item> <!-- address bar text color -->- <item>@color/chevronBgColor</item> <!-- new folder hint tint -->- <item>#da6c6c</item> <!-- select button color -->- <item>#da6c6c</item> <!-- new folder layour bg -->- <item>#da6c6c</item> <!-- new folder layour bg -->- <item>@color/colorPrimary</item> <!-- new folder layour bg -->- </array>-</resources>diff --git a/android/app/src/main/res/values/ic_launcher_background.xml b/android/app/src/main/res/values/ic_launcher_background.xmldeleted file mode 100644index cdde88f..0000000--- a/android/app/src/main/res/values/ic_launcher_background.xml+++ /dev/null@@ -1,4 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<resources>- <color name="ic_launcher_background">#000000</color>-</resources>diff --git a/android/app/src/main/res/values/launcher_preferences.xml b/android/app/src/main/res/values/launcher_preferences.xmldeleted file mode 100644index a6dd1e9..0000000--- a/android/app/src/main/res/values/launcher_preferences.xml+++ /dev/null@@ -1,180 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<resources>- <string name="l10n_gs_animations_animations_title">Animations</string>- <string name="gs_use_magic_item_animation_title">Use Magic Item Animation</string>- <string name="gs_use_magic_item_animation_summary">Use casting animations for magic items, just as for spells.</string>- <string name="gs_use_additional_animation_sources_title">Use Additional Animation Sources</string>- <string name="gs_use_additional_animation_sources_summary">Load per-group KF-files and skeleton files from Animations folder.</string>- <string name="gs_weapon_sheating_title">Weapon Sheathing</string>- <string name="gs_weapon_sheating_summary">Render holstered weapons (with quivers and scabbards); requires modded assets.</string>- <string name="gs_shield_sheating_title">Shield Sheathing</string>- <string name="gs_shield_sheating_summary">Render a holstered shield; requires modded assets.</string>- <string name="gs_enable_graphics_herbalism_title">Enable Graphics Herbalism</string>- <string name="gs_enable_graphics_herbalism_summary">If this setting is true, containers supporting graphic herbalism will do so instead of opening the menu.</string>- <string name="gs_smooth_movement_title">Smooth Movement</string>- <string name="gs_smooth_movement_summary">Makes NPC and player movement smoother. Recommended with Turn to Movement Direction enabled.</string>- <string name="gs_smooth_animation_transitions_title">Smooth Animation Transitions</string>- <string name="gs_smooth_animation_transitions_summary">Smoothly blends compatible animation transitions. New in OpenMW 0.49; disabled by default.</string>- <string name="gs_turn_to_movement_direction_title">Turn to Movement Direction</string>- <string name="gs_turn_to_movement_direction_summary">Affects side and diagonal movement. Enabling this setting makes movement more realistic. If disabled then the whole character\'s body is pointed to the direction of view. Diagonal movement has no special animation and causes sliding. If enabled then the character turns lower body to the direction of movement. Upper body is turned partially. Head is always pointed to the direction of view. In combat mode it works only for diagonal movement. In non-combat mode it changes straight right and straight left movement as well. Also turns the whole body up or down when swimming according to the movement direction.</string>- <string name="l10n_gs_engine_engine_title">Engine</string>- <string name="gs_groundcover_handling_title">Groundcover</string>- <string name="gs_groundcover_handling_summary">Enable OpenMW 0.51 native instanced groundcover rendering for mods loaded through the Groundcovers tab.</string>- <string name="gs_groundcover_handling_dialogtitle">Groundcover Handling</string>- <string name="gs_groundcover_point_lighting_title">Point Lighting on Groundcover</string>- <string name="gs_groundcover_point_lighting_summary">OpenMW 0.51: allow nearby lamps and other point lights to illuminate grass. Disable to save some GPU performance.</string>- <string name="gs_build_navmesh_title">Build Navmesh for World Geometry</string>- <string name="gs_build_navmesh_summary">Enable navigator. When enabled background threads are started to build nav mesh for world geometry. Pathfinding system uses nav mesh to build paths. When disabled only pathgrid is used to build paths. Single-core CPU systems may have big performance impact on exiting interior location and moving across exterior world. May slightly affect performance on multi-core CPU systems. Multi-core CPU systems may have different latency for nav mesh update depending on other settings and system performance. Moving across external world, entering/exiting location produce nav mesh update. NPC and creatures may not be able to find path before nav mesh is built around them. Try to disable this if you want to have old fashioned AI which doesn’t know where to go when you stand behind that stone and casting a firebolt.</string>- <string name="gs_write_navmesh_title">Write Navmesh Cache to Disk</string>- <string name="gs_write_navmesh_summary">Cache navigation mesh tiles to disk</string>- <string name="l10n_gs_engine_threading_title">Threading</string>- <string name="gs_navmesh_threads_title">Background Navmesh Threads</string>- <string name="gs_navmesh_threads_summary">Number of background threads to update nav mesh. Adjustable from 1 to 8; default is 1.</string>- <string name="gs_physics_threads_title">Background Physics Threads</string>- <string name="gs_physics_threads_summary">Number of background threads used for physics updates. Adjustable from 1 to 8; default is 1.</string>- <string name="gs_preload_threads_title">Background Preload Threads</string>- <string name="gs_preload_threads_summary">Number of background threads used for preloading. OpenMW 0.51 recommends 2–3 on multicore systems; 4 or more is not recommended.</string>- <string name="l10n_gs_bug_fixes_miscellaneous_title">Miscellaneous</string>- <string name="gs_merchant_equipping_fix_title">Merchant Equipping Fix</string>- <string name="gs_merchant_equipping_fix_summary">Prevents merchants from equipping items that are sold to them.</string>- <string name="gs_trainers_bs_title">Trainers Choose Training Skill Based on Their Base Skill Point</string>- <string name="gs_trainers_bs_summary">Trainers now only choose which skills to train using their base skill points, allowing mercantile improving effects to be used without making mercantile an offered skill.</string>- <string name="l10n_gs_shadows_general_title">General</string>- <string name="gs_enable_shadows_title">Enable Shadows</string>- <string name="gs_enable_shadows_summary">Enable OpenMW real-time shadow mapping. This uses the shader rendering path and can reduce performance.</string>- <string name="l10n_gs_shadows_shadow_casters_title">Shadow Casters</string>- <string name="gs_player_shadows_title">Player Shadows</string>- <string name="gs_player_shadows_summary">Allow the player character to cast shadows.</string>- <string name="gs_actor_shadows_title">Actor Shadows</string>- <string name="gs_actor_shadows_summary">Allow NPCs and creatures to cast shadows.</string>- <string name="gs_object_shadows_title">Object Shadows</string>- <string name="gs_object_shadows_summary">Allow world objects to cast shadows.</string>- <string name="gs_terrain_shadows_title">Terrain Shadows</string>- <string name="gs_terrain_shadows_summary">Allow terrain to cast shadows.</string>- <string name="gs_indoor_shadows_title">Indoor Shadows</string>- <string name="gs_indoor_shadows_summary">Allow shadows indoors. Due to Morrowind data limitations, only actors can cast indoor shadows.</string>- <string name="l10n_gs_shadows_quality_distance_title">Quality & Distance</string>- <string name="gs_shadow_quality_title">Shadow Quality</string>- <string name="gs_shadow_quality_dialogtitle">Shadow Quality</string>- <string name="gs_shadow_distance_title">Shadow Distance</string>- <string name="gs_shadow_distance_dialogtitle">Shadow Distance</string>- <string name="l10n_gs_miscellaneous_saves_title">Saves</string>- <string name="gs_add_time_to_saves_title">Add Time Played to Saves</string>- <string name="gs_add_time_to_saves_summary">This setting determines whether the amount of the time the player has spent playing will be displayed for each saved game in the Load menu.</string>- <string name="gs_maximum_quicksaves_title">Maximum Quicksaves</string>- <string name="gs_maximum_quicksaves_summary">Max amount of stored quicksaves</string>- <string name="gs_maximum_quicksaves_dialogtitle">Maximum Quicksaves</string>- <string name="l10n_gs_visuals_terrain_title">Terrain</string>- <string name="gs_object_paging_min_size_title">Object Paging Min Size</string>- <string name="gs_object_paging_min_size_summary">Controls how large an object must be to be visible in the scene. Adjustable from 0.01 to 1.00 in steps of 0.01.</string>- <string name="gs_distant_land_title">Distant Land</string>- <string name="gs_distant_land_summary">If true, use paging and LOD algorithms to display the entire terrain. If false, only display terrain of the loaded cells.</string>- <string name="gs_active_grid_object_paging_title">Active Grid Object Paging</string>- <string name="gs_active_grid_object_paging_summary">Use object paging for active cells grid.</string>- <string name="l10n_gs_visuals_graphics_title">Graphics</string>- <string name="pref_physicsfps2_summary">%s FPS</string>- <string name="l10n_gs_visuals_shaders_title">Shaders</string>- <string name="gs_auto_use_object_normal_maps_title">Auto Use Objects Normal Maps</string>- <string name="gs_auto_use_object_normal_maps_summary">If this option is enabled, normal maps are automatically recognized and used if they are named appropriately (see \'normal map pattern\', e.g. for a base texture foo.dds, the normal map texture would have to be named foo_n.dds). If this option is disabled, normal maps are only used if they are explicitly listed within the mesh file (.nif or .osg file). Affects objects</string>- <string name="gs_auto_use_object_specular_maps_title">Auto Use Objects Specular Maps</string>- <string name="gs_auto_use_object_specular_maps_summary">If this option is enabled, specular maps are automatically recognized and used if they are named appropriately (see \'specular map pattern\', e.g. for a base texture foo.dds, the specular map texture would have to be named foo_spec.dds). If this option is disabled, normal maps are only used if they are explicitly listed within the mesh file (.osg file, not supported in .nif files). Affects objects.</string>- <string name="gs_auto_use_terrain_normal_maps_title">Auto Use Terrain Normal Maps</string>- <string name="gs_auto_use_terrain_normal_maps_summary">See \'auto use object normal maps\'. Affects terrain.</string>- <string name="gs_auto_use_terrain_specular_maps_title">Auto Use Terrain Specular Maps</string>- <string name="gs_auto_use_terrain_specular_maps_summary">If a file with pattern \'terrain specular map pattern\' exists, use that file as a \'diffuse specular\' map. The texture must contain the layer colour in the RGB channel (as usual), and a specular multiplier in the alpha channel.</string>- <string name="gs_bump_map_local_lighting_title">Bump/Reflect Map Local Lighting</string>- <string name="gs_bump_map_local_lighting_summary">Normally environment map reflections aren\'t affected by lighting, which makes environment-mapped (and thus bump-mapped objects) glow in the dark. Morrowind Code Patch includes an option to remedy that by doing environment-mapping before applying lighting, this is the equivalent of that option. Affected objects will use shaders.</string>- <string name="l10n_gs_visuals_fog_title">Fog</string>- <string name="gs_radial_fog_title">Radial Fog</string>- <string name="gs_radial_fog_summary">By default, the fog becomes thicker proportionally to your distance from the clipping plane set at the clipping distance, which causes distortion at the edges of the screen. This setting makes the fog use the actual eye point distance (or so called Euclidean distance) to calculate the fog, which makes the fog look less artificial, especially if you have a wide FOV.</string>- <string name="gs_exponential_fog_title">Exponential Fog</string>- <string name="gs_exponential_fog_summary">Whether to use exponential formula for fog.</string>- <string name="gs_sky_blending_title">Sky Blending</string>- <string name="gs_sky_blending_summary">Whether to hide the clipping plane by blending with sky.</string>- <string name="l10n_gs_visuals_post_processing_title">Post Processing</string>- <string name="gs_soft_particles_title">Soft Particles</string>- <string name="gs_soft_particles_summary">Soften intersection of blended particle systems with opaque geometry.</string>- <string name="gs_transparent_postpass_title">Transparent Postpass</string>- <string name="gs_transparent_postpass_summary">Transparent depth postpass. Re-renders transparent objects with alpha-clipping forced with a fixed threshold.</string>- <string name="pref_game_settings_title">Game Settings</string>- <string name="pref_game_settings_summary">Configure gameplay, visuals, shadows, animations, interface, and engine settings.</string>- <string name="pref_mods_summary">Add mods to OpenMW</string>- <string name="pref_omw050_controller_menus_title">Controller Menus</string>- <string name="pref_omw050_controller_menus_summary">Use OpenMW 0.51 gamepad-optimized menu navigation</string>- <string name="pref_omw050_controller_tooltips_title">Controller Tooltips</string>- <string name="pref_omw050_controller_tooltips_summary">Always show item tooltips without pressing R3</string>- <string name="pref_omw051_controller_trigger_thresholds_title">Controller Trigger Sensitivity</string>- <string name="pref_omw051_controller_trigger_thresholds_dialogtitle">Controller Trigger Sensitivity</string>- <string name="pref_controls_summary">Configure your preferred on-screen touch controls</string>- <string name="gs_framerate_limit_summary">%s FPS</string>- <string name="l10n_settings_audio_title">Audio</string>- <string name="pref_omw050_doppler_title">Doppler Effect</string>- <string name="pref_omw050_doppler_summary">Enable OpenMW 0.51 positional-audio Doppler effect (factor 0.25)</string>- <string name="pref_omw050_camera_listener_title">Camera as Audio Listener</string>- <string name="pref_omw050_camera_listener_summary">Use the camera position instead of the player as the 3D audio listener</string>- <string name="pref_skip_gui_title">Skip Launcher GUI</string>- <string name="pref_skip_gui_summary">Hold \'Volume Up\' while launching the app to show the launcher again.</string>- <string name="game_settings_game_mechanics_title">Gameplay</string>- <string name="game_settings_visuals_title">Visuals</string>- <string name="game_settings_shadows_title">Shadows</string>- <string name="game_settings_animations_title">Animations</string>- <string name="game_settings_interface_title">Interface</string>- <string name="game_settings_engine_title">Engine</string>- <string name="l10n_gs_interface_ui_title">UI</string>- <string name="gs_show_owned_title">Show Owned</string>- <string name="gs_show_owned_dialogtitle">Show Owned</string>- <string name="gs_show_effect_duration_title">Show Effects Duration</string>- <string name="gs_show_effect_duration_summary">Show the remaining duration of magic effects and lights. The remaining duration is displayed in the tooltip when hovering over the magical effect.</string>- <string name="gs_show_enchant_chance_title">Show Enchant Chance</string>- <string name="gs_show_enchant_chance_summary">Whether or not the chance of success will be displayed in the enchanting menu.</string>- <string name="gs_show_melee_info_title">Show Melee Info</string>- <string name="gs_show_melee_info_summary">If this setting is true, melee weapons reach and speed will be shown on item tooltip.</string>- <string name="gs_show_projectile_damage_title">Show Projectile Damage</string>- <string name="gs_show_projectile_damage_summary">If this setting is true, damage bonus of arrows and bolts will be shown on item tooltip.</string>- <string name="gs_change_dialogue_topic_color_title">Change Dialogue Topic Color</string>- <string name="gs_change_dialogue_topic_color_summary">If this setting is true, dialogue topics will have a different color if the topic is specific to the NPC you\'re talking to or the topic was previously seen. Color can be changed in settings.cfg.</string>- <string name="gs_stretch_menu_background_title">Stretch Menu Background</string>- <string name="gs_stretch_menu_background_summary">Stretch menus, load screens, etc. to the window aspect ratio.</string>- <string name="gs_can_zoom_on_maps_title">Can Zoom on Maps</string>- <string name="gs_can_zoom_on_maps_summary">Enable zooming on local and global maps.</string>- <string name="l10n_gs_game_mechanics_general_title">General</string>- <string name="gs_soulgem_values_rebalance_title">Soulgem Values Rebalance</string>- <string name="gs_soulgem_values_rebalance_summary">Make the value of filled soul gems dependent only on soul magnitude.</string>- <string name="gs_can_loot_during_death_animation_title">Can Loot During Death Animation</string>- <string name="gs_can_loot_during_death_animation_summary">If this setting is enabled, the player can loot actors (e.g. summoned creatures) during their death animation when they are not in combat. In this case, the death counter is incremented and the disposed actor\'s script runs immediately. If disabled, the player must wait until the death animation ends. This makes exploits involving summoned creatures (such as looting summoned Dremoras and Golden Saints for expensive weapons) much harder. Conflicts with mannequin mods that use SkipAnim to prevent the death animation from ending.</string>- <string name="gs_always_allow_stealing_from_knocked_out_actors_title">Always Allow Stealing From Knocked Out Actors</string>- <string name="gs_always_allow_stealing_from_knocked_out_actors_summary">Make stealing items from NPCs that were knocked down possible during combat.</string>- <string name="l10n_gs_game_mechanics_movement_combat_title">Movement & Combat</string>- <string name="gs_toggle_sneak_title">Toggle Sneak</string>- <string name="gs_toggle_sneak_summary">This setting causes the behavior of the sneak key (bound to Ctrl by default) to toggle sneaking on and off rather than requiring the key to be held down while sneaking. Players that spend significant time sneaking may find the character easier to control with this option enabled.</string>- <string name="gs_uncapped_damage_fatigue_title">Uncapped Damage Fatigue</string>- <string name="gs_uncapped_damage_fatigue_summary">Make Damage Fatigue magic effect uncapped like Drain Fatigue effect. This means that unlike Morrowind you will be able to knock down actors using this effect.</string>- <string name="gs_only_weapon_bs_title">Only Appropriate Ammunition Bypasses Normal Weapon Resistance</string>- <string name="gs_only_weapon_bs_summary">Allow non-standard ammunition solely to bypass normal weapon resistance or weakness.</string>- <string name="gs_swim_upward_correction_title">Swim Upward Correction</string>- <string name="gs_swim_upward_correction_summary">Makes player swim a bit upward from the line of sight. Applies only in third person mode. Intended to make simpler swimming without diving.</string>- <string name="gs_factor_strength_into_hand_to_hand_combat_title">Factor Strength into Hand-to-hand Combat</string>- <string name="gs_factor_strength_into_hand_to_hand_combat_dialogtitle">Factor Strength into Hand-to-hand Combat</string>- <string name="l10n_gs_game_mechanics_npc_followers_title">NPC & Followers</string>- <string name="gs_followers_defend_immediately_title">Followers Defend Immediately</string>- <string name="gs_followers_defend_immediately_summary">Make player followers and escorters start combat with enemies who have started combat with them or the player. Otherwise they wait for the enemies or the player to do an attack first.</string>- <string name="gs_permanent_barter_disposition_changes_title">Permanent Barter Disposition Changes</string>- <string name="gs_permanent_barter_disposition_changes_summary">Make merchant disposition changes caused by trading permanent.</string>- <string name="gs_npc_avoid_collision_title">NPC Avoid Collision</string>- <string name="gs_npc_avoid_collision_summary">If enabled NPCs apply evasion maneuver to avoid collisions with others.</string>- <string name="gs_always_allow_npc_to_follow_over_water_surface_title">Always Allow NPC To Follow Over Water Surface</string>- <string name="gs_always_allow_npc_to_follow_over_water_surface_summary">Give NPC an ability to swim over the water surface when they follow other actor independently from their ability to swim. Has effect only when nav mesh building is enabled.</string>- <string name="l10n_gs_game_mechanics_gameplay_fixes_title">Gameplay Fixes</string>- <string name="gs_racial_variation_in_speed_fix_title">Racial Variation In Speed Fix</string>- <string name="gs_racial_variation_in_speed_fix_summary">Don\'t use race weight in NPC movement speed calculations.</string>- <string name="gs_enchanted_weapons_are_magical_title">Enchanted Weapons Are Magical</string>- <string name="gs_enchanted_weapons_are_magical_summary">Make enchanted weaponry without Magical flag bypass normal weapons resistance, like in Morrowind.</string>- <string name="gs_classic_reflected_absorb_spells_behavior_title">Classic Reflected Absorb Spells Behavior</string>- <string name="gs_classic_reflected_absorb_spells_behavior_summary">Effects of reflected Absorb spells are not mirrored, as in Morrowind.</string>- <string name="l10n_gs_game_mechanics_saves_title">Saves</string>- <string name="txttitle_text">Mod Name</string>- <string name="gs_groundcover_density_title">Groundcover Density</string>- <string name="gs_groundcover_density_summary">Percentage of groundcover instances to render. 100% keeps the full mod density; lower values improve performance.</string>- <string name="gs_groundcover_rendering_distance_title">Groundcover Rendering Distance</string>- <string name="gs_groundcover_rendering_distance_summary">Distance at which groundcover is rendered. Larger values increase rendering cost.</string>-</resources>diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xmldeleted file mode 100644index d864014..0000000--- a/android/app/src/main/res/values/strings.xml+++ /dev/null@@ -1,275 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="app_name">Isowind</string>- <string-array name="pref_encoding_entries">- <item>Central and Eastern European (win1250)</item>- <item>Cyrillic (win1251)</item>- <item>Latin (win1252)</item>- </string-array>- <string-array name="pref_encoding_values">- <item>win1250</item>- <item>win1251</item>- <item>win1252</item>- </string-array>- <string-array name="gs_factor_strength_into_hand_to_hand_combat_entries">- <item>Off</item>- <item>Affect Werewolves</item>- <item>Do Not Affect Werewolves</item>- </string-array>- <string-array name="gs_factor_strength_into_hand_to_hand_combat_values">- <item>0</item>- <item>1</item>- <item>2</item>- </string-array>- <string-array name="gs_show_owned_entries">- <item>Off</item>- <item>Tool Tip Only</item>- <item>Crosshair Only</item>- <item>Tool Tip and Crosshair</item>- </string-array>- <string-array name="gs_show_owned_values">- <item>0</item>- <item>1</item>- <item>2</item>- <item>3</item>- </string-array>- <string-array name="gs_antialiasing_entries">- <item>0</item>- <item>2</item>- <item>4</item>- <item>8</item>- <item>16</item>- </string-array>- <string-array name="gs_antialiasing_values">- <item>0</item>- <item>2</item>- <item>4</item>- <item>8</item>- <item>16</item>- </string-array>- <string-array name="pref_omw051_controller_trigger_sensitivity_entries">- <item>OpenMW default (15/16 press, 13/16 release)</item>- <item>Balanced (12/16 press, 10/16 release)</item>- <item>Sensitive (8/16 press, 6/16 release)</item>- </string-array>- <string-array name="pref_omw051_controller_trigger_sensitivity_values">- <item>30720,26624</item>- <item>24576,20480</item>- <item>16384,12288</item>- </string-array>- <string name="general_settings">Setup</string>- <string name="start_game_label">Start game</string>- <string name="closeDrawer">Navigation View</string>- <string name="openDrawer">Navigation View Closed</string>- <string name="game_files">Game Files</string>- <string name="pref_graphicsLibrary">Graphics API Library</string>- <string name="pref_graphicsLibrary_default">gles2</string>- <string name="pref_advanced">Advanced</string>- <string name="pref_graphics">Graphics</string>- <string name="pref_commandLine">Custom Command-Line Arguments</string>- <string name="pref_envLine">Custom Environment Flags</string>- <string name="pref_nohighp">Medium shader precision</string>- <string name="pref_nohighp_summary">Uses medium instead of high precision; available only with the Modified shader preset</string>- <string name="pref_ui">User Interface</string>- <string name="pref_textureShrinking">Texture Shrinking</string>- <string name="pref_textureShrinking_default">none</string>- <string name="pref_shadersDir">Shader Presets</string>- <string name="pref_shadersDir_default">none</string>- <string name="pref_gamma">Gamma</string>- <string name="pref_uiScaling">UI Scaling Factor</string>- <string name="uiScaling_auto">Auto (%1$.2f)</string>- <string name="pref_screen_keeper">Keep Screen Always On</string>- <string name="pref_touchpadSensitivity">Virtual Touchpad Sensitivity</string>- <string name="action_reset_config">Reset static configuration files</string>- <string name="action_reset_user_config">Reset user configuration files</string>- <string name="action_reset_user_resources">Reset user resources</string>- <string name="action_reset_screen_controls">Reset on-screen controls</string>- <string name="action_show_screen_controls">On-Screen Controls</string>- <string name="pref_hide_controls">Hide On-Screen Buttons</string>- <string name="config_was_reset">Static configuration was reset to default values</string>- <string name="user_config_was_reset">User configuration was reset to default values</string>- <string name="user_resources_was_reset">User resources were reset to default values</string>- <string name="pref_lang">Language Settings</string>- <string name="pref_encoding">Game Language</string>- <string name="pref_encoding_default">win1252</string>- <string name="btn_opacityPlus">Alpha+</string>- <string name="btn_opacityMinus">Alpha-</string>- <string name="btn_sizePlus">Size+</string>- <string name="btn_sizeMinus">Size-</string>- <string name="btn_resetControlsLayout">Reset to defaults</string>- <string name="pref_physicsFPS2">Physics FPS</string>- <string name="pref_framerate_limit">Frame Rate Limit</string>- <string-array name="pref_framerate_limit_entries">- <item>20</item>- <item>30</item>- <item>60</item>- </string-array>- <string-array name="pref_framerate_limit_values">- <item>20</item>- <item>30</item>- <item>60</item>- </string-array>- <string-array name="pref_physicsFPS2_entries">- <item>20</item>- <item>30</item>- <item>60</item>- </string-array>- <string-array name="pref_textureShrinking_entries">- <item>None</item>- <item>Low</item>- <item>Medium</item>- <item>High</item>- </string-array>- <string-array name="pref_textureShrinking_values">- <item>none</item>- <item>low</item>- <item>medium</item>- <item>high</item>- </string-array>- <string-array name="pref_shadersDir_entries">- <item>Original</item>- <item>Modified</item>- <item>Zesterer</item>- <item>OMWFX</item>- </string-array>- <string-array name="pref_shadersDir_values">- <item>none</item>- <item>modified</item>- <item>zesterer</item>- <item>omwfx</item>- </string-array>- <string name="pref_framerate_limit_default">60</string>- <string name="pref_physicsFPS2_default">30</string>- <string name="btn_back">Back</string>- <string name="pref_customResolution">Custom Resolution</string>- <string name="pref_display_cutout_area">Display in Cutout Area</string>- <string name="mods">Game Modifications</string>- <string name="action_about">About</string>- <string name="about_title">About OpenMW</string>- <string name="action_theme">Theme</string>- <string name="action_theme_system">System</string>- <string name="action_theme_light">Light</string>- <string name="action_theme_dark">Dark</string>- <string name="action_theme_oled">Black/OLED</string>- <string name="activity_settings">Game Settings</string>- <string name="game_mechanics_activity_settings">Gameplay</string>- <string name="visuals_activity_settings">Visuals</string>- <string name="animations_activity_settings">Animations</string>- <string name="interface_activity_settings">Interface</string>- <string name="bug_fixes_activity_settings">Bug Fixes</string>- <string name="miscellaneous_activity_settings">Miscellaneous</string>- <string name="engine_activity_settings">Engine</string>- <string name="activity_mods">Mods</string>- <string name="tab_plugins">Plugins</string>- <string name="tab_resources">Resources</string>- <string name="tab_dirs">Directories</string>- <string name="tab_groundcover">Groundcovers</string>- <string name="data_error_title">Error locating data files</string>- <string name="data_error_message">Please select a directory which contains both the \"Morrowind.ini\" file and the \"Data Files\" directory.</string>- <string name="permissions_error_title">No permissions</string>- <string name="permissions_error_message">OpenMW needs storage permissions to locate and access Morrowind game files. Please grant this permission through settings.</string>- <string name="ini_error_message">Failure transforming the configuration file. Please ensure your \"Morrowind.ini\" is well-formed.</string>- <string name="no_data_files_title">Data files not found</string>- <string name="no_data_files_message">You must copy Morrowind game files to your device and select the path under \"Game files\" before the game can be played.</string>- <string name="category_performance">Performance</string>- <string name="no_content_files_title">No content files!</string>- <string name="no_content_files_message">There are no content files enabled. Before the game can run, you must activate at least one plugin file from the \"Mods…\" menu.</string>- <string name="no_content_files_dismiss">Proceed anyway</string>- <string name="configure_mods">Configure mods</string>- <string name="pref_mouse_mode">Mouse Mode in Menus</string>- <string-array name="pref_mouse_mode_entries">- <item>Hybrid</item>- <item>Relative joystick controls</item>- <item>Absolute touch controls</item>- </string-array>- <string-array name="pref_mouse_mode_values">- <item>hybrid</item>- <item>joystick</item>- <item>touch</item>- </string-array>- <string name="pref_mouse_mode_default">hybrid</string>- <string name="bugsnag_yes">Yes</string>- <string name="bugsnag_no">No</string>- <string name="bugsnag_policy">Privacy policy</string>- <string name="bugsnag_consent_title">Report crashes automatically?</string>- <string name="bugsnag_consent_message">Would you like to enable automatic crash reporting?\nIf a crash occurs, some data about your device, configuration and installed mods will be automatically submitted to Bugsnag. You can find more information in the Privacy Policy.\nThis setting can be changed at any time from the menu.</string>- <string name="bugsnag_consent_restart_title">Please restart the application</string>- <string name="bugsnag_consent_restart_message">You must restart the application for these settings to come into effect.</string>- <string name="action_bugsnag_consent">Crash reporting</string>- <string name="dialog_howto">How To</string>- <string name="no_browser_title">Unable to open a URL</string>- <string name="no_browser_message">You don\'t appear to have a web browser installed. Tried to open the following URL:\n\n%1$s</string>- <string name="pref_show_qp">Enable Quick Keys</string>- <string name="pref_show_fn">Enable FN Keys</string>- <string name="pref_always_show_top_bar">Always Show Top Bar Icons</string>- <string name="theme">0</string>- <string-array name="gs_shadow_quality_entries">- <item>Low</item>- <item>Medium</item>- <item>High</item>- <item>Very high</item>- </string-array>- <string-array name="gs_shadow_quality_values">- <item>low</item>- <item>medium</item>- <item>high</item>- <item>very_high</item>- </string-array>- <string-array name="gs_shadow_distance_entries">- <item>Low</item>- <item>Medium</item>- <item>High</item>- </string-array>- <string-array name="gs_shadow_distance_values">- <item>low</item>- <item>medium</item>- <item>high</item>- </string-array>- <string name="shadows_activity_settings">Shadows</string>- <string-array name="gs_maximum_quicksaves_entries">- <item>1</item>- <item>2</item>- <item>3</item>- </string-array>- <string-array name="gs_maximum_quicksaves_values">- <item>1</item>- <item>2</item>- <item>3</item>- </string-array>- <string name="slider_auto">Auto</string>- <string name="controller_trigger_custom_values">Custom (%1$d press, %2$d release)</string>- <string name="controller_trigger_custom">Custom</string>- <string name="resolution_width_hint">Width</string>- <string name="resolution_height_hint">Height</string>- <string name="resolution_native">Native</string>- <string name="resolution_invalid">Please enter a valid width and height.</string>- <string name="launch_preparing">Loading…</string>- <string name="launch_preparing_game">Preparing OpenMW…</string>- <string name="launch_failed_title">OpenMW launch failed</string>- <string name="launch_failed_unknown">Unknown error while preparing OpenMW.</string>- <string name="user_configuration">User Configuration</string>- <string name="action_theme_submenu">Theme ›</string>- <string name="theme_set_to">Theme set to %1$s</string>- <string name="about_port_info">This port by Andreas \'Andiweli\' Stürmer-Based on a port by CaveBros-OpenMW by the OpenMW Team since 2008</string>- <string name="third_party_notices">Third-party notices</string>- <string name="chooser_select">Select</string>- <string name="chooser_create">Create</string>- <string name="chooser_new_folder">New Folder</string>- <string name="chooser_cancel">Cancel</string>- <string name="chooser_heading">Choose Storage</string>- <string name="chooser_internal_storage">Internal Storage</string>- <string name="chooser_free_space">%1$s free</string>- <string name="chooser_folder_created">Folder Created</string>- <string name="chooser_folder_error">An error occurred while creating the folder. Please try again.</string>- <string name="chooser_folder_name">Folder Name</string>- <string name="chooser_empty_folder_name">Folder name cannot be empty</string>- <string name="osk_shift">Shift</string>- <string name="osk_caps_lock">Caps Lock</string>- <string name="osk_language">Lang</string>- <string name="sdl_error_title">SDL Error</string>- <string name="sdl_exit">Exit</string>- <string name="sdl_start_error">An error occurred while trying to start the application. Please try again and/or reinstall.\n\nError: %1$s</string>- <string name="navmesh_generating_cache">GENERATING NAVMESH CACHE</string>-</resources>\ No newline at end of filediff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xmldeleted file mode 100644index 8f1509e..0000000--- a/android/app/src/main/res/values/styles.xml+++ /dev/null@@ -1,30 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<resources>- <style name="MyTheme" parent="MyTheme.Base">- </style>-- <style name="MyActionBar" parent="@style/Widget.AppCompat.ActionBar.Solid">- <item name="titleTextStyle">@style/MyTitleTextStyle</item>- </style>-- <style name="MyTitleTextStyle" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">- <item name="android:textColor">#FFFFFFFF</item>- </style>-- <style name="MyTheme.Base" parent="Theme.AppCompat.DayNight.NoActionBar">- <item name="colorPrimary">@color/colorPrimary</item>- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>- <item name="colorAccent">@color/colorAccent</item>- <item name="actionBarStyle">@style/MyActionBar</item>- <item name="android:statusBarColor">@color/statusBarColor</item>- </style>-- <style name="MyCustomTextAppearance" parent="TextAppearance.Design.Tab">- <item name="android:textAppearance">@style/CustomTabWidgetText</item>- </style>-- <style name="CustomTabWidgetText"- parent="@android:style/TextAppearance.Widget.TabWidget">- <item name="android:textSize">16sp</item>- </style>-</resources>diff --git a/android/app/src/main/res/values/themes.xml b/android/app/src/main/res/values/themes.xmldeleted file mode 100644index 26371c4..0000000--- a/android/app/src/main/res/values/themes.xml+++ /dev/null@@ -1,13 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<resources>- <style name="Theme.AppCompat.FullScreen" parent="@style/Theme.AppCompat">- <item name="android:windowNoTitle">true</item>- <item name="android:windowFullscreen">true</item>- <!-- Deterministic opaque clear while SDL/GL4ES creates its surface. -->- <item name="android:windowBackground">@android:color/black</item>- <item name="android:colorBackground">@android:color/black</item>- <item name="android:windowIsTranslucent">false</item>- <item name="android:windowDisablePreview">true</item>- </style>--</resources>\ No newline at end of filediff --git a/android/app/src/main/res/xml/game_settings.xml b/android/app/src/main/res/xml/game_settings.xmldeleted file mode 100644index 7ec0aac..0000000--- a/android/app/src/main/res/xml/game_settings.xml+++ /dev/null@@ -1,9 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">- <Preference android:key="game_settings_game_mechanics" android:title="@string/game_settings_game_mechanics_title" />- <Preference android:key="game_settings_visuals" android:title="@string/game_settings_visuals_title" />- <Preference android:key="game_settings_shadows" android:title="@string/game_settings_shadows_title" />- <Preference android:key="game_settings_animations" android:title="@string/game_settings_animations_title" />- <Preference android:key="game_settings_interface" android:title="@string/game_settings_interface_title" />- <Preference android:key="game_settings_engine" android:title="@string/game_settings_engine_title" />-</PreferenceScreen>\ No newline at end of filediff --git a/android/app/src/main/res/xml/gs_animations.xml b/android/app/src/main/res/xml/gs_animations.xmldeleted file mode 100644index 9459963..0000000--- a/android/app/src/main/res/xml/gs_animations.xml+++ /dev/null@@ -1,13 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">- <PreferenceCategory android:title="@string/l10n_gs_animations_animations_title">- <CheckBoxPreference android:key="gs_use_magic_item_animation" android:title="@string/gs_use_magic_item_animation_title" android:summary="@string/gs_use_magic_item_animation_summary" />- <CheckBoxPreference android:key="gs_use_additional_animation_sources" android:title="@string/gs_use_additional_animation_sources_title" android:summary="@string/gs_use_additional_animation_sources_summary" />- <CheckBoxPreference android:key="gs_weapon_sheating" android:title="@string/gs_weapon_sheating_title" android:summary="@string/gs_weapon_sheating_summary" />- <CheckBoxPreference android:key="gs_shield_sheating" android:title="@string/gs_shield_sheating_title" android:summary="@string/gs_shield_sheating_summary" />- <CheckBoxPreference android:key="gs_enable_graphics_herbalism" android:title="@string/gs_enable_graphics_herbalism_title" android:defaultValue="true" android:summary="@string/gs_enable_graphics_herbalism_summary" />- <CheckBoxPreference android:key="gs_smooth_movement" android:title="@string/gs_smooth_movement_title" android:summary="@string/gs_smooth_movement_summary" />- <CheckBoxPreference android:key="gs_smooth_animation_transitions" android:title="@string/gs_smooth_animation_transitions_title" android:defaultValue="false" android:summary="@string/gs_smooth_animation_transitions_summary" />- <CheckBoxPreference android:key="gs_turn_to_movement_direction" android:title="@string/gs_turn_to_movement_direction_title" android:summary="@string/gs_turn_to_movement_direction_summary" />- </PreferenceCategory>-</PreferenceScreen>\ No newline at end of filediff --git a/android/app/src/main/res/xml/gs_bug_fixes.xml b/android/app/src/main/res/xml/gs_bug_fixes.xmldeleted file mode 100644index 7b18203..0000000--- a/android/app/src/main/res/xml/gs_bug_fixes.xml+++ /dev/null@@ -1,7 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">- <PreferenceCategory android:title="@string/l10n_gs_bug_fixes_miscellaneous_title">- <CheckBoxPreference android:key="gs_merchant_equipping_fix" android:title="@string/gs_merchant_equipping_fix_title" android:summary="@string/gs_merchant_equipping_fix_summary" />- <CheckBoxPreference android:key="gs_trainers_bs" android:title="@string/gs_trainers_bs_title" android:summary="@string/gs_trainers_bs_summary" />- </PreferenceCategory>-</PreferenceScreen>\ No newline at end of filediff --git a/android/app/src/main/res/xml/gs_engine.xml b/android/app/src/main/res/xml/gs_engine.xmldeleted file mode 100644index 226aae4..0000000--- a/android/app/src/main/res/xml/gs_engine.xml+++ /dev/null@@ -1,16 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">- <PreferenceCategory android:title="@string/l10n_gs_engine_engine_title">- <CheckBoxPreference android:key="gs_groundcover_enabled" android:title="@string/gs_groundcover_handling_title" android:summary="@string/gs_groundcover_handling_summary" android:defaultValue="false" />- <Preference android:key="gs_groundcover_density" android:title="@string/gs_groundcover_density_title" android:summary="@string/gs_groundcover_density_summary" android:dependency="gs_groundcover_enabled" />- <Preference android:key="gs_groundcover_rendering_distance" android:title="@string/gs_groundcover_rendering_distance_title" android:summary="@string/gs_groundcover_rendering_distance_summary" android:dependency="gs_groundcover_enabled" />- <CheckBoxPreference android:key="gs_groundcover_point_lighting" android:title="@string/gs_groundcover_point_lighting_title" android:summary="@string/gs_groundcover_point_lighting_summary" android:defaultValue="true" android:dependency="gs_groundcover_enabled" />- <CheckBoxPreference android:key="gs_build_navmesh" android:title="@string/gs_build_navmesh_title" android:defaultValue="true" android:summary="@string/gs_build_navmesh_summary" />- <CheckBoxPreference android:key="gs_write_navmesh" android:title="@string/gs_write_navmesh_title" android:defaultValue="true" android:summary="@string/gs_write_navmesh_summary" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/l10n_gs_engine_threading_title">- <Preference android:key="gs_navmesh_threads" android:title="@string/gs_navmesh_threads_title" android:summary="@string/gs_navmesh_threads_summary" />- <Preference android:key="gs_physics_threads" android:title="@string/gs_physics_threads_title" android:summary="@string/gs_physics_threads_summary" />- <Preference android:key="gs_preload_threads" android:title="@string/gs_preload_threads_title" android:summary="@string/gs_preload_threads_summary" />- </PreferenceCategory>-</PreferenceScreen>\ No newline at end of filediff --git a/android/app/src/main/res/xml/gs_game_mechanics.xml b/android/app/src/main/res/xml/gs_game_mechanics.xmldeleted file mode 100644index e7f29c7..0000000--- a/android/app/src/main/res/xml/gs_game_mechanics.xml+++ /dev/null@@ -1,31 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">- <PreferenceCategory android:title="@string/l10n_gs_game_mechanics_general_title">- <CheckBoxPreference android:key="gs_soulgem_values_rebalance" android:title="@string/gs_soulgem_values_rebalance_title" android:summary="@string/gs_soulgem_values_rebalance_summary" />- <CheckBoxPreference android:key="gs_can_loot_during_death_animation" android:title="@string/gs_can_loot_during_death_animation_title" android:defaultValue="true" android:summary="@string/gs_can_loot_during_death_animation_summary" />- <CheckBoxPreference android:key="gs_always_allow_stealing_from_knocked_out_actors" android:title="@string/gs_always_allow_stealing_from_knocked_out_actors_title" android:summary="@string/gs_always_allow_stealing_from_knocked_out_actors_summary" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/l10n_gs_game_mechanics_movement_combat_title">- <CheckBoxPreference android:key="gs_toggle_sneak" android:title="@string/gs_toggle_sneak_title" android:defaultValue="true" android:summary="@string/gs_toggle_sneak_summary" />- <CheckBoxPreference android:key="gs_uncapped_damage_fatigue" android:title="@string/gs_uncapped_damage_fatigue_title" android:summary="@string/gs_uncapped_damage_fatigue_summary" />- <CheckBoxPreference android:key="gs_only_weapon_bs" android:title="@string/gs_only_weapon_bs_title" android:summary="@string/gs_only_weapon_bs_summary" />- <CheckBoxPreference android:key="gs_swim_upward_correction" android:title="@string/gs_swim_upward_correction_title" android:summary="@string/gs_swim_upward_correction_summary" />- <ListPreference android:key="gs_factor_strength_into_hand-to-hand_combat" android:summary="%s" android:title="@string/gs_factor_strength_into_hand_to_hand_combat_title" android:dialogTitle="@string/gs_factor_strength_into_hand_to_hand_combat_dialogtitle" android:entries="@array/gs_factor_strength_into_hand_to_hand_combat_entries" android:entryValues="@array/gs_factor_strength_into_hand_to_hand_combat_values" android:defaultValue="0" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/l10n_gs_game_mechanics_npc_followers_title">- <CheckBoxPreference android:key="gs_followers_defend_immediately" android:title="@string/gs_followers_defend_immediately_title" android:summary="@string/gs_followers_defend_immediately_summary" />- <CheckBoxPreference android:key="gs_permanent_barter_disposition_changes" android:title="@string/gs_permanent_barter_disposition_changes_title" android:summary="@string/gs_permanent_barter_disposition_changes_summary" />- <CheckBoxPreference android:key="gs_npc_avoid_collision" android:title="@string/gs_npc_avoid_collision_title" android:summary="@string/gs_npc_avoid_collision_summary" />- <CheckBoxPreference android:key="gs_always_allow_npc_to_follow_over_water_surface" android:title="@string/gs_always_allow_npc_to_follow_over_water_surface_title" android:defaultValue="true" android:summary="@string/gs_always_allow_npc_to_follow_over_water_surface_summary" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/l10n_gs_game_mechanics_gameplay_fixes_title">- <CheckBoxPreference android:key="gs_racial_variation_in_speed_fix" android:title="@string/gs_racial_variation_in_speed_fix_title" android:summary="@string/gs_racial_variation_in_speed_fix_summary" />- <CheckBoxPreference android:key="gs_enchanted_weapons_are_magical" android:title="@string/gs_enchanted_weapons_are_magical_title" android:defaultValue="true" android:summary="@string/gs_enchanted_weapons_are_magical_summary" />- <CheckBoxPreference android:key="gs_classic_reflected_absorb_spells_behavior" android:title="@string/gs_classic_reflected_absorb_spells_behavior_title" android:defaultValue="true" android:summary="@string/gs_classic_reflected_absorb_spells_behavior_summary" />- <CheckBoxPreference android:key="gs_merchant_equipping_fix" android:title="@string/gs_merchant_equipping_fix_title" android:summary="@string/gs_merchant_equipping_fix_summary" />- <CheckBoxPreference android:key="gs_trainers_bs" android:title="@string/gs_trainers_bs_title" android:summary="@string/gs_trainers_bs_summary" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/l10n_gs_game_mechanics_saves_title">- <ListPreference android:key="gs_maximum_quicksaves" android:title="@string/gs_maximum_quicksaves_title" android:dialogTitle="@string/gs_maximum_quicksaves_dialogtitle" android:entries="@array/gs_maximum_quicksaves_entries" android:entryValues="@array/gs_maximum_quicksaves_values" android:defaultValue="1" android:summary="%s" />- </PreferenceCategory>-</PreferenceScreen>\ No newline at end of filediff --git a/android/app/src/main/res/xml/gs_interface.xml b/android/app/src/main/res/xml/gs_interface.xmldeleted file mode 100644index c89b3c4..0000000--- a/android/app/src/main/res/xml/gs_interface.xml+++ /dev/null@@ -1,13 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">- <PreferenceCategory android:title="@string/l10n_gs_interface_ui_title">- <ListPreference android:key="gs_show_owned" android:summary="%s" android:title="@string/gs_show_owned_title" android:dialogTitle="@string/gs_show_owned_dialogtitle" android:entries="@array/gs_show_owned_entries" android:entryValues="@array/gs_show_owned_values" android:defaultValue="0" />- <CheckBoxPreference android:key="gs_show_effect_duration" android:title="@string/gs_show_effect_duration_title" android:summary="@string/gs_show_effect_duration_summary" />- <CheckBoxPreference android:key="gs_show_enchant_chance" android:title="@string/gs_show_enchant_chance_title" android:summary="@string/gs_show_enchant_chance_summary" />- <CheckBoxPreference android:key="gs_show_melee_info" android:title="@string/gs_show_melee_info_title" android:summary="@string/gs_show_melee_info_summary" />- <CheckBoxPreference android:key="gs_show_projectile_damage" android:title="@string/gs_show_projectile_damage_title" android:summary="@string/gs_show_projectile_damage_summary" />- <CheckBoxPreference android:key="gs_change_dialogue_topic_color" android:title="@string/gs_change_dialogue_topic_color_title" android:summary="@string/gs_change_dialogue_topic_color_summary" />- <CheckBoxPreference android:key="gs_stretch_menu_background" android:title="@string/gs_stretch_menu_background_title" android:summary="@string/gs_stretch_menu_background_summary" />- <CheckBoxPreference android:key="gs_can_zoom_on_maps" android:title="@string/gs_can_zoom_on_maps_title" android:summary="@string/gs_can_zoom_on_maps_summary" />- </PreferenceCategory>-</PreferenceScreen>\ No newline at end of filediff --git a/android/app/src/main/res/xml/gs_miscellaneous.xml b/android/app/src/main/res/xml/gs_miscellaneous.xmldeleted file mode 100644index 00a3cc0..0000000--- a/android/app/src/main/res/xml/gs_miscellaneous.xml+++ /dev/null@@ -1,7 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">- <PreferenceCategory android:title="@string/l10n_gs_miscellaneous_saves_title">- <CheckBoxPreference android:key="gs_add_time_to_saves" android:title="@string/gs_add_time_to_saves_title" android:summary="@string/gs_add_time_to_saves_summary" />- <EditTextPreference android:key="gs_maximum_quicksaves" android:title="@string/gs_maximum_quicksaves_title" android:dialogTitle="@string/gs_maximum_quicksaves_dialogtitle" android:inputType="numberDecimal" android:hint="1" android:defaultValue="1" android:summary="@string/gs_maximum_quicksaves_summary" />- </PreferenceCategory>-</PreferenceScreen>\ No newline at end of filediff --git a/android/app/src/main/res/xml/gs_shadows.xml b/android/app/src/main/res/xml/gs_shadows.xmldeleted file mode 100644index 322683e..0000000--- a/android/app/src/main/res/xml/gs_shadows.xml+++ /dev/null@@ -1,17 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">- <PreferenceCategory android:title="@string/l10n_gs_shadows_general_title">- <CheckBoxPreference android:key="gs_enable_shadows" android:title="@string/gs_enable_shadows_title" android:defaultValue="false" android:summary="@string/gs_enable_shadows_summary" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/l10n_gs_shadows_shadow_casters_title">- <CheckBoxPreference android:key="gs_player_shadows" android:title="@string/gs_player_shadows_title" android:defaultValue="true" android:dependency="gs_enable_shadows" android:summary="@string/gs_player_shadows_summary" />- <CheckBoxPreference android:key="gs_actor_shadows" android:title="@string/gs_actor_shadows_title" android:defaultValue="true" android:dependency="gs_enable_shadows" android:summary="@string/gs_actor_shadows_summary" />- <CheckBoxPreference android:key="gs_object_shadows" android:title="@string/gs_object_shadows_title" android:defaultValue="true" android:dependency="gs_enable_shadows" android:summary="@string/gs_object_shadows_summary" />- <CheckBoxPreference android:key="gs_terrain_shadows" android:title="@string/gs_terrain_shadows_title" android:defaultValue="true" android:dependency="gs_enable_shadows" android:summary="@string/gs_terrain_shadows_summary" />- <CheckBoxPreference android:key="gs_indoor_shadows" android:title="@string/gs_indoor_shadows_title" android:defaultValue="true" android:dependency="gs_enable_shadows" android:summary="@string/gs_indoor_shadows_summary" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/l10n_gs_shadows_quality_distance_title">- <ListPreference android:key="gs_shadow_quality" android:title="@string/gs_shadow_quality_title" android:dialogTitle="@string/gs_shadow_quality_dialogtitle" android:entries="@array/gs_shadow_quality_entries" android:entryValues="@array/gs_shadow_quality_values" android:defaultValue="medium" android:dependency="gs_enable_shadows" android:summary="%s" />- <ListPreference android:key="gs_shadow_distance" android:title="@string/gs_shadow_distance_title" android:dialogTitle="@string/gs_shadow_distance_dialogtitle" android:entries="@array/gs_shadow_distance_entries" android:entryValues="@array/gs_shadow_distance_values" android:defaultValue="medium" android:dependency="gs_enable_shadows" android:summary="%s" />- </PreferenceCategory>-</PreferenceScreen>\ No newline at end of filediff --git a/android/app/src/main/res/xml/gs_visuals.xml b/android/app/src/main/res/xml/gs_visuals.xmldeleted file mode 100644index 4e3d3bc..0000000--- a/android/app/src/main/res/xml/gs_visuals.xml+++ /dev/null@@ -1,27 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">- <PreferenceCategory android:title="@string/l10n_gs_visuals_terrain_title">- <Preference android:key="gs_object_paging_min_size" android:title="@string/gs_object_paging_min_size_title" android:summary="@string/gs_object_paging_min_size_summary" />- <CheckBoxPreference android:key="gs_distant_land" android:title="@string/gs_distant_land_title" android:summary="@string/gs_distant_land_summary" />- <CheckBoxPreference android:key="gs_active_grid_object_paging" android:title="@string/gs_active_grid_object_paging_title" android:defaultValue="true" android:summary="@string/gs_active_grid_object_paging_summary" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/l10n_gs_visuals_graphics_title">- <ListPreference android:key="pref_physicsFPS2" android:title="@string/pref_physicsFPS2" android:dialogTitle="@string/pref_physicsFPS2" android:entries="@array/pref_physicsFPS2_entries" android:entryValues="@array/pref_physicsFPS2_entries" android:defaultValue="@string/pref_physicsFPS2_default" android:summary="@string/pref_physicsfps2_summary" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/l10n_gs_visuals_shaders_title">- <CheckBoxPreference android:key="gs_auto_use_object_normal_maps" android:title="@string/gs_auto_use_object_normal_maps_title" android:summary="@string/gs_auto_use_object_normal_maps_summary" />- <CheckBoxPreference android:key="gs_auto_use_object_specular_maps" android:title="@string/gs_auto_use_object_specular_maps_title" android:summary="@string/gs_auto_use_object_specular_maps_summary" />- <CheckBoxPreference android:key="gs_auto_use_terrain_normal_maps" android:title="@string/gs_auto_use_terrain_normal_maps_title" android:summary="@string/gs_auto_use_terrain_normal_maps_summary" />- <CheckBoxPreference android:key="gs_auto_use_terrain_specular_maps" android:title="@string/gs_auto_use_terrain_specular_maps_title" android:summary="@string/gs_auto_use_terrain_specular_maps_summary" />- <CheckBoxPreference android:key="gs_bump_map_local_lighting" android:title="@string/gs_bump_map_local_lighting_title" android:summary="@string/gs_bump_map_local_lighting_summary" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/l10n_gs_visuals_fog_title">- <CheckBoxPreference android:key="gs_radial_fog" android:title="@string/gs_radial_fog_title" android:summary="@string/gs_radial_fog_summary" />- <CheckBoxPreference android:key="gs_exponential_fog" android:title="@string/gs_exponential_fog_title" android:summary="@string/gs_exponential_fog_summary" />- <CheckBoxPreference android:key="gs_sky_blending" android:title="@string/gs_sky_blending_title" android:summary="@string/gs_sky_blending_summary" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/l10n_gs_visuals_post_processing_title">- <CheckBoxPreference android:key="gs_soft_particles" android:title="@string/gs_soft_particles_title" android:summary="@string/gs_soft_particles_summary" />- <CheckBoxPreference android:key="gs_transparent_postpass" android:title="@string/gs_transparent_postpass_title" android:summary="@string/gs_transparent_postpass_summary" />- </PreferenceCategory>-</PreferenceScreen>\ No newline at end of filediff --git a/android/app/src/main/res/xml/settings.xml b/android/app/src/main/res/xml/settings.xmldeleted file mode 100644index 968566d..0000000--- a/android/app/src/main/res/xml/settings.xml+++ /dev/null@@ -1,42 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">- <PreferenceCategory android:key="general_settings" android:title="@string/general_settings">- <ListPreference android:key="pref_encoding" android:summary="%s" android:title="@string/pref_encoding" android:dialogTitle="@string/pref_encoding" android:entries="@array/pref_encoding_entries" android:entryValues="@array/pref_encoding_values" android:defaultValue="@string/pref_encoding_default" />- <Preference android:key="game_files" android:title="@string/game_files" />- <Preference android:title="@string/mods" android:key="pref_mods" android:summary="@string/pref_mods_summary" />- <Preference android:key="pref_game_settings" android:title="@string/pref_game_settings_title" android:summary="@string/pref_game_settings_summary" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/pref_ui">- <Preference android:key="pref_uiScaling" android:title="@string/pref_uiScaling" />- <ListPreference android:key="pref_mouse_mode" android:title="@string/pref_mouse_mode" android:dialogTitle="@string/pref_mouse_mode" android:entries="@array/pref_mouse_mode_entries" android:entryValues="@array/pref_mouse_mode_values" android:defaultValue="@string/pref_mouse_mode_default" android:summary="%s" />- <CheckBoxPreference android:key="pref_omw050_controller_menus" android:title="@string/pref_omw050_controller_menus_title" android:summary="@string/pref_omw050_controller_menus_summary" android:defaultValue="false" />- <CheckBoxPreference android:key="pref_omw050_controller_tooltips" android:title="@string/pref_omw050_controller_tooltips_title" android:summary="@string/pref_omw050_controller_tooltips_summary" android:dependency="pref_omw050_controller_menus" android:defaultValue="false" />- <ListPreference android:key="pref_omw051_controller_trigger_thresholds" android:title="@string/pref_omw051_controller_trigger_thresholds_title" android:dialogTitle="@string/pref_omw051_controller_trigger_thresholds_dialogtitle" android:entries="@array/pref_omw051_controller_trigger_sensitivity_entries" android:entryValues="@array/pref_omw051_controller_trigger_sensitivity_values" android:defaultValue="30720,26624" android:dependency="pref_omw050_controller_menus" android:summary="%s" />- <Preference android:title="@string/action_show_screen_controls" android:key="pref_controls" android:summary="@string/pref_controls_summary" />- <CheckBoxPreference android:key="pref_hide_controls" android:title="@string/pref_hide_controls" />- <CheckBoxPreference android:key="pref_always_show_top_bar" android:title="@string/pref_always_show_top_bar" />- <CheckBoxPreference android:key="pref_show_qp" android:title="@string/pref_show_qp" />- <CheckBoxPreference android:key="pref_show_fn" android:title="@string/pref_show_fn" />- <CheckBoxPreference android:key="pref_screen_keeper" android:title="@string/pref_screen_keeper" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/category_performance">- <ListPreference android:key="gs_framerate_limit" android:title="@string/pref_framerate_limit" android:dialogTitle="@string/pref_framerate_limit" android:entries="@array/pref_framerate_limit_entries" android:entryValues="@array/pref_framerate_limit_values" android:defaultValue="@string/pref_framerate_limit_default" android:summary="@string/gs_framerate_limit_summary" />- <CheckBoxPreference android:key="pref_nohighp" android:title="@string/pref_nohighp" android:summary="@string/pref_nohighp_summary" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/pref_graphics">- <Preference android:key="pref_customResolution" android:title="@string/pref_customResolution" />- <CheckBoxPreference android:key="pref_display_cutout_area" android:title="@string/pref_display_cutout_area" />- <Preference android:key="pref_gamma" android:title="@string/pref_gamma" />- <ListPreference android:key="pref_textureShrinking_v2" android:title="@string/pref_textureShrinking" android:dialogTitle="@string/pref_textureShrinking" android:entries="@array/pref_textureShrinking_entries" android:entryValues="@array/pref_textureShrinking_values" android:defaultValue="@string/pref_textureShrinking_default" android:summary="%s" />- <ListPreference android:key="pref_shadersDir_v2" android:title="@string/pref_shadersDir" android:dialogTitle="@string/pref_shadersDir" android:entries="@array/pref_shadersDir_entries" android:entryValues="@array/pref_shadersDir_values" android:defaultValue="@string/pref_shadersDir_default" android:summary="%s" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/l10n_settings_audio_title">- <CheckBoxPreference android:key="pref_omw050_doppler" android:title="@string/pref_omw050_doppler_title" android:summary="@string/pref_omw050_doppler_summary" android:defaultValue="true" />- <CheckBoxPreference android:key="pref_omw050_camera_listener" android:title="@string/pref_omw050_camera_listener_title" android:summary="@string/pref_omw050_camera_listener_summary" android:defaultValue="false" />- </PreferenceCategory>- <PreferenceCategory android:title="@string/pref_advanced">- <CheckBoxPreference android:key="pref_skip_gui" android:title="@string/pref_skip_gui_title" android:summary="@string/pref_skip_gui_summary" android:defaultValue="false" />- <EditTextPreference android:key="commandLine" android:title="@string/pref_commandLine" />- <EditTextPreference android:key="envLine" android:title="@string/pref_envLine" />- </PreferenceCategory>-</PreferenceScreen>\ No newline at end of filediff --git a/android/app/src/test/java/file/IniConverterTest.kt b/android/app/src/test/java/file/IniConverterTest.ktdeleted file mode 100644index c53aeeb..0000000--- a/android/app/src/test/java/file/IniConverterTest.kt+++ /dev/null@@ -1,48 +0,0 @@-/*- Copyright (C) 2019 Ilya Zhuravlev-- This file is part of OpenMW-Android.-- OpenMW-Android is free software: you can redistribute it and/or modify- it under the terms of the GNU General Public License as published by- the Free Software Foundation, either version 3 of the License, or- (at your option) any later version.-- OpenMW-Android is distributed in the hope that it will be useful,- but WITHOUT ANY WARRANTY; without even the implied warranty of- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- GNU General Public License for more details.-- You should have received a copy of the GNU General Public License- along with OpenMW-Android. If not, see <https://www.gnu.org/licenses/>.-*/--package file--import org.junit.Test--import org.junit.Assert.*--class IniConverterTest {-- @Test- fun convertSimple() {- val ini = IniConverter("""-[Something]-; A comment-; Another comment-Long key with spaces=Some value also with spaces--[Another thing]-First=Value-This ones empty=-Second=Another value- """.trimIndent())- val res = ini.convert()- assertEquals(- "fallback=Something_Long_key_with_spaces,Some value also with spaces\n" +- "fallback=Another_thing_First,Value\n" +- "fallback=Another_thing_Second,Another value\n",- res)- }-}diff --git a/android/build.gradle b/android/build.gradledeleted file mode 100644index 271bedd..0000000--- a/android/build.gradle+++ /dev/null@@ -1,30 +0,0 @@-// Phase 1 v2 bridge for Android Studio 2025.-// Goal: build the existing CaveBros OpenMW-Android snapshot first.-// The OpenMW engine revision itself is intentionally unchanged.--buildscript {- ext.kotlin_version = '1.9.24'-- repositories {- google()- mavenCentral()- }-- dependencies {- classpath 'com.android.tools.build:gradle:8.7.2'- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"- }-}--allprojects {- repositories {- google()- mavenCentral()- }-}--apply plugin: 'idea'--idea.module {- excludeDirs += file('buildscripts/')-}diff --git a/android/buildscripts/.gitignore b/android/buildscripts/.gitignoredeleted file mode 100644index d721bf2..0000000--- a/android/buildscripts/.gitignore+++ /dev/null@@ -1,10 +0,0 @@-build-downloads-prefix-toolchain-tmp_script.sh-tmp-symbols.7z-symbols--baseline-outputdiff --git a/android/buildscripts/CMakeLists.txt b/android/buildscripts/CMakeLists.txtdeleted file mode 100644index 3915817..0000000--- a/android/buildscripts/CMakeLists.txt+++ /dev/null@@ -1,664 +0,0 @@-cmake_minimum_required(VERSION 3.2.0)--# https://github.com/libjpeg-turbo/libjpeg-turbo/releases-set(LIBJPEG_TURBO_VERSION 1.5.3)-set(LIBJPEG_TURBO_HASH SHA256=b24890e2bb46e12e72a79f7e965f409f4e16466d00e1dd15d93d73ee6b592523)--# http://www.libpng.org/pub/png/libpng.html-set(LIBPNG_VERSION 1.6.42)-set(LIBPNG_HASH SHA256=505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca)--# https://www.freetype.org/index.html#news-set(FREETYPE2_VERSION 2.13.2)-set(FREETYPE2_HASH SHA256=1ac27e16c134a7f2ccea177faba19801131116fd682efc1f5737037c5db224b5)--# https://github.com/kcat/openal-soft/releases-set(OPENAL_VERSION 1.23.1)-set(OPENAL_HASH SHA256=8ac17e4e3b32c1af3d5508acfffb838640669b4274606b7892aa796ca9d7467f)--# https://www.boost.org/users/download/#live-set(BOOST_VERSION 1.83.0)-set(BOOST_HASH SHA256=0c6049764e80aa32754acd7d4f179fd5551d8172a83b71532ae093e7384e98da)--# https://www.ffmpeg.org/download.html-set(FFMPEG_VERSION 6.1)-set(FFMPEG_HASH SHA256=42093549751b582cf0f338a21a3664f52e0a9fbe0d238d3c992005e493607d0e)--# https://www.libsdl.org/download-2.0.php-set(SDL2_VERSION 2.0.22)-set(SDL2_HASH SHA256=fe7cbf3127882e3fc7259a75a0cb585620272c51745d3852ab9dd87960697f2e)--# https://github.com/bulletphysics/bullet3/releases-set(BULLET_VERSION 3.25)-set(BULLET_HASH SHA256=baa642c906576d4d98d041d0acb80d85dd6eff6e3c16a009b1abf1ccd2bc0a61)--#https://github.com/MyGUI/mygui/releases-set(MYGUI_VERSION 3.4.3)-set(MYGUI_HASH SHA256=33c91b531993047e77cace36d6fea73634b8c17bd0ed193d4cd12ac7c6328abd)--# https://github.com/sisah2/gl4es/releases-set(GL4ES_VERSION 5ac069d82ad8ca2cc3c574484e4c5bad880db83e)-set(GL4ES_HASH SHA256=b565e717c7d192e936bda25f3cb90ad8db398af56414ec08294b6716574c1a6d)--# https://github.com/openscenegraph/OpenSceneGraph/releases-set(OSG_VERSION 69cfecebfb6dc703b42e8de39eed750a84a87489)-set(OSG_HASH SHA256=aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12)--# https://github.com/lz4/lz4/releases-set(LZ4_VERSION 1.9.3)-set(LZ4_HASH SHA256=030644df4611007ff7dc962d981f390361e6c97a34e5cbc393ddfbe019ffe2c1)--# https://luajit.org/download.html-set(LUAJIT_VERSION 505e2c03de35e2718eef0d2d3660712e06dadf1f)-set(LUAJIT_HASH SHA256=409f7fe570d3c16558e594421c47bdd130238323c9d6fd6c83dedd2aaeb082a8)--# OpenMW 0.51.0 Final Android runtime gate — immutable commit behind tag openmw-0.51.0-set(OPENMW_VERSION f4bec41444214a7903bebd178389ca22ca13f646)-# ExternalProject currently does not enforce OPENMW_HASH; keep the commit immutable instead.-set(OPENMW_HASH "")--# https://github.com/unicode-org/icu/-set(LIBICU_VERSION 70-1)-set(LIBICU_HASH SHA256=4013d7aff8a34bae410664bdb16554d7eda03654b22627b9284ab55a685492d4)--# End of configurable options--project(openmw-android)--include(ExternalProject)--set(wrapper_command ${CMAKE_BINARY_DIR}/command_wrapper.sh)-set(ndk_triplet ${NDK_TRIPLET})-set(download_dir ${CMAKE_SOURCE_DIR}/downloads/)-set(prefix ${CMAKE_INSTALL_PREFIX})-set(host ${ndk_triplet})-set(android_platform android-${ANDROID_API})-set(app_abi ${ABI})--set(COMMON_CMAKE_ARGS- -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/toolchain/ndk/build/cmake/android.toolchain.cmake- -DANDROID_ABI=${app_abi}- -DANDROID_PLATFORM=${android_platform}- -DANDROID_STL=c++_shared- -DANDROID_LD=deprecated- -DANDROID_CPP_FEATURES=rtti\ exceptions- -DCMAKE_C_FLAGS=-I${prefix}/include/\ $ENV{CFLAGS}- -DCMAKE_CXX_FLAGS=-I${prefix}/include/\ $ENV{CXXFLAGS}- -DCMAKE_SHARED_LINKER_FLAGS=$ENV{LDFLAGS}- -DCMAKE_BUILD_TYPE=${BUILD_TYPE}- -DCMAKE_DEBUG_POSTFIX=- -DCMAKE_INSTALL_PREFIX=${prefix}- -DCMAKE_FIND_ROOT_PATH=${prefix}-)--set(COMMON_NDK_BUILD_FLAGS- NDK_PROJECT_PATH=.- APP_BUILD_SCRIPT=<SOURCE_DIR>/Android.mk- APP_PLATFORM=${android_platform}- APP_ABI=${app_abi}- APP_LD=deprecated- LOCAL_LDFLAGS=$ENV{LDFLAGS}- -j4-)--set(COMMON_AUTOCONF_FLAGS- --enable-static- --disable-shared- --prefix=${prefix}-)--# ffmpeg doesn't like --host, so sandwich it between adding --host to the flags-set(ffmpeg_configure_flags ${COMMON_AUTOCONF_FLAGS})-if (${BUILD_TYPE} STREQUAL "debug")- # ffmpeg fails to compile if we have asm enabled and optimizations disabled, so disable both- set(ffmpeg_configure_flags ${ffmpeg_configure_flags} --disable-asm --disable-optimizations)-endif()--if ((${ARCH} STREQUAL "x86_64") OR (${ARCH} STREQUAL "x86") OR (${ARCH} STREQUAL "arm64"))- # ffmpeg fails to link with assembly optimizations on x86-64- set(ffmpeg_configure_flags ${ffmpeg_configure_flags} --disable-asm)-endif()--set(COMMON_AUTOCONF_FLAGS- --host=${host}- ${COMMON_AUTOCONF_FLAGS}-)--if (${ARCH} STREQUAL "arm")- set(ffmpeg_configure_flags ${ffmpeg_configure_flags} --enable-thumb)-endif()--# on x86 enabling simd results in text relocations, which are banned on Android-set(libjpeg_turbo_flags "")-if (${ARCH} STREQUAL "x86")- set(libjpeg_turbo_flags ${libjpeg_turbo_flags} --without-simd)-endif()--ExternalProject_Add(bzip2-- URL https://github.com/Duron27/bzip2/archive/refs/tags/v1.tar.gz- #URL_HASH SHA256=- DOWNLOAD_DIR ${download_dir}-- CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>- ${COMMON_CMAKE_ARGS}-- BUILD_COMMAND ${wrapper_command} $(MAKE)-- INSTALL_COMMAND ${wrapper_command} $(MAKE) install-)--ExternalProject_Add(libjpeg-turbo- URL https://sourceforge.net/projects/libjpeg-turbo/files/${LIBJPEG_TURBO_VERSION}/libjpeg-turbo-${LIBJPEG_TURBO_VERSION}.tar.gz- URL_HASH ${LIBJPEG_TURBO_HASH}- DOWNLOAD_DIR ${download_dir}-- CONFIGURE_COMMAND ${wrapper_command} <SOURCE_DIR>/configure- ${COMMON_AUTOCONF_FLAGS}- ${libjpeg_turbo_flags}-- BUILD_COMMAND ${wrapper_command} $(MAKE) PROGRAMS=-- INSTALL_COMMAND ${wrapper_command} $(MAKE) install-libLTLIBRARIES install-data-am-)--set(libicu_flags- --disable-tests- --disable-samples- --disable-icuio- --disable-extras- --with-cross-build=${CMAKE_SOURCE_DIR}/build/icu-host-build)--ExternalProject_Add(libicu- URL https://github.com/unicode-org/icu/archive/refs/tags/release-${LIBICU_VERSION}.zip- URL_HASH ${LIBICU_HASH}- DOWNLOAD_DIR ${download_dir}-- CONFIGURE_COMMAND ${wrapper_command} <SOURCE_DIR>/icu4c/source/configure- ${COMMON_AUTOCONF_FLAGS}- ${libicu_flags}-- BUILD_COMMAND ${wrapper_command} $(MAKE) check_PROGRAMS= bin_PROGRAMS=-- INSTALL_COMMAND ${wrapper_command} $(MAKE) install check_PROGRAMS= bin_PROGRAMS=-)--ExternalProject_Add(libpng- URL http://prdownloads.sourceforge.net/libpng/libpng-${LIBPNG_VERSION}.tar.xz-# URL_HASH ${LIBPNG_HASH}- DOWNLOAD_DIR ${download_dir}-- CONFIGURE_COMMAND ${wrapper_command} <SOURCE_DIR>/configure- ${COMMON_AUTOCONF_FLAGS}-- BUILD_COMMAND ${wrapper_command} $(MAKE) check_PROGRAMS= bin_PROGRAMS=-- INSTALL_COMMAND ${wrapper_command} $(MAKE) install check_PROGRAMS= bin_PROGRAMS=-)--ExternalProject_Add(freetype2- # FreeType's Savannah endpoint occasionally returns transient 5xx errors.- # ExternalProject tries URL entries in order, so use SourceForge first and- # retain Savannah as an independent fallback. The verified upstream hash- # also lets CMake reuse a valid archive from DOWNLOAD_DIR safely.- URL- https://sourceforge.net/projects/freetype/files/freetype2/${FREETYPE2_VERSION}/freetype-${FREETYPE2_VERSION}.tar.gz/download- https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE2_VERSION}.tar.gz- URL_HASH ${FREETYPE2_HASH}- DOWNLOAD_DIR ${download_dir}-- CONFIGURE_COMMAND ${wrapper_command} <SOURCE_DIR>/configure- ${COMMON_AUTOCONF_FLAGS}- --with-png=no-- BUILD_COMMAND ${wrapper_command} $(MAKE)-- INSTALL_COMMAND ${wrapper_command} $(MAKE) install-)--ExternalProject_Add(openal- URL https://github.com/kcat/openal-soft/archive/${OPENAL_VERSION}.tar.gz- #URL_HASH ${OPENAL_HASH}- DOWNLOAD_DIR ${download_dir}-- CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>- ${COMMON_CMAKE_ARGS}- -DALSOFT_EXAMPLES=OFF- -DALSOFT_TESTS=OFF- -DALSOFT_UTILS=OFF- -DALSOFT_NO_CONFIG_UTIL=ON- -DALSOFT_BACKEND_OPENSL=ON- -DALSOFT_BACKEND_WAVE=OFF-- BUILD_COMMAND ${wrapper_command} $(MAKE)-- INSTALL_COMMAND ${wrapper_command} $(MAKE) install-)--ExternalProject_Add(boost- URL https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}.tar.gz- URL_HASH ${BOOST_HASH}- DOWNLOAD_DIR ${download_dir}---BUILD_IN_SOURCE 1-- CONFIGURE_COMMAND ${wrapper_command} <SOURCE_DIR>/bootstrap.sh- --prefix=${prefix}- COMMAND ${wrapper_command} bash ${CMAKE_SOURCE_DIR}/include/configure-boost-android.sh <SOURCE_DIR>-- BUILD_COMMAND ""-- INSTALL_COMMAND ${wrapper_command} ./b2- --user-config=<SOURCE_DIR>/android-user-config.jam- -j4- --with-filesystem- --with-program_options- --with-system- --with-iostreams- --ignore-site-config- toolset=clang- architecture=${BOOST_ARCH}- address-model=${BOOST_ADDRESS_MODEL}- cflags=$ENV{CFLAGS}- cxxflags=$ENV{CXXFLAGS}- variant=release- target-os=android- threading=multi- threadapi=pthread- link=static- runtime-link=static- install- COMMAND llvm-ranlib ${prefix}/lib/libboost_filesystem.a- COMMAND llvm-ranlib ${prefix}/lib/libboost_program_options.a- COMMAND llvm-ranlib ${prefix}/lib/libboost_system.a- COMMAND llvm-ranlib ${prefix}/lib/libboost_iostreams.a-)--ExternalProject_Add(ffmpeg- URL http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2- #URL_HASH ${FFMPEG_HASH}- DOWNLOAD_DIR ${download_dir}-- CONFIGURE_COMMAND ${wrapper_command} <SOURCE_DIR>/configure- ${ffmpeg_configure_flags}- --target-os=android- --enable-cross-compile- --cross-prefix=llvm-- --cc=${host}-clang- --arch=${ARCH}- --cpu=${FFMPEG_CPU}- --enable-version3- --enable-pic- --disable-everything- --disable-doc- --disable-programs- --disable-autodetect- --disable-iconv- --enable-decoder=mp3- --enable-demuxer=mp3- --enable-decoder=bink- --enable-decoder=binkaudio_rdft- --enable-decoder=binkaudio_dct- --enable-demuxer=bink- --enable-demuxer=wav- --enable-decoder=pcm_*- --enable-decoder=vp8- --enable-decoder=vp9- --enable-decoder=opus- --enable-decoder=vorbis- --enable-demuxer=matroska- --enable-demuxer=ogg-- BUILD_COMMAND ${wrapper_command} $(MAKE)-- INSTALL_COMMAND ${wrapper_command} $(MAKE) install-)--ExternalProject_Add(sdl2- URL https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz- URL_HASH ${SDL2_HASH}- DOWNLOAD_DIR ${download_dir}--- CONFIGURE_COMMAND ""-- BUILD_COMMAND ${wrapper_command} ndk-build- ${COMMON_NDK_BUILD_FLAGS}-- INSTALL_COMMAND mkdir -p ${prefix}/lib/- COMMAND cp libs/${app_abi}/libSDL2.so ${prefix}/lib/- COMMAND cp -r <SOURCE_DIR>/include ${prefix}/- COMMAND mkdir -p ${prefix}/lib/cmake/SDL2- COMMAND cp ${CMAKE_SOURCE_DIR}/cmake/SDL2Config.cmake ${prefix}/lib/cmake/SDL2/- COMMAND cp ${CMAKE_SOURCE_DIR}/cmake/SDL2ConfigVersion.cmake ${prefix}/lib/cmake/SDL2/-)--ExternalProject_Add(bullet- URL https://github.com/bulletphysics/bullet3/archive/${BULLET_VERSION}.tar.gz- #URL_HASH ${BULLET_HASH}- DOWNLOAD_DIR ${download_dir}-- PATCH_COMMAND patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/bullet-fix-cmake.patch-- CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>- ${COMMON_CMAKE_ARGS}- -DBUILD_BULLET2_DEMOS=OFF- -DBUILD_CPU_DEMOS=OFF- -DBUILD_UNIT_TESTS=OFF- -DBUILD_EXTRAS=OFF- -DUSE_DOUBLE_PRECISION=ON- -DBULLET2_MULTITHREADING=ON-- BUILD_COMMAND ${wrapper_command} $(MAKE)-- INSTALL_COMMAND $(MAKE) install-)--ExternalProject_Add(gl4es- URL https://github.com/sisah2/gl4es/archive/${GL4ES_VERSION}.tar.gz- #URL_HASH ${GL4ES_HASH}- DOWNLOAD_DIR ${download_dir}-- BUILD_COMMAND ${wrapper_command} ndk-build- ${COMMON_NDK_BUILD_FLAGS}-- INSTALL_COMMAND mkdir -p ${prefix}/lib/- COMMAND cp libs/${app_abi}/libGL.so ${prefix}/lib/- COMMAND cp -r <SOURCE_DIR>/include ${prefix}/- COMMAND cp -r <SOURCE_DIR>/include ${prefix}/include/gl4es/-)--ExternalProject_Add(mygui- DEPENDS freetype2-- URL https://github.com/MyGUI/mygui/archive/MyGUI${MYGUI_VERSION}.tar.gz- URL_HASH ${MYGUI_HASH}- DOWNLOAD_DIR ${download_dir}-- CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>- ${COMMON_CMAKE_ARGS}- -DMYGUI_RENDERSYSTEM=1- -DMYGUI_BUILD_DEMOS=OFF- -DMYGUI_BUILD_TOOLS=OFF- -DMYGUI_BUILD_PLUGINS=OFF- -DMYGUI_DONT_USE_OBSOLETE=ON- -DFREETYPE_FT2BUILD_INCLUDE_DIR=${prefix}/include/freetype2/-- -DMYGUI_STATIC=ON-- BUILD_COMMAND ${wrapper_command} $(MAKE)-- INSTALL_COMMAND ${wrapper_command} $(MAKE) install-)--ExternalProject_Add(lz4- URL https://github.com/lz4/lz4/archive/v${LZ4_VERSION}.tar.gz- URL_HASH ${LZ4_HASH}- DOWNLOAD_DIR ${download_dir}-- CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>/build/cmake/- ${COMMON_CMAKE_ARGS}- -DBUILD_STATIC_LIBS=ON- -DBUILD_SHARED_LIBS=OFF-- BUILD_COMMAND ${wrapper_command} $(MAKE)-- INSTALL_COMMAND ${wrapper_command} $(MAKE) install-)--set(LUAJIT_MAKE_FLAGS- HOST_CC=${LUAJIT_HOST_CC}- CFLAGS=- TARGET_CFLAGS=$ENV{CFLAGS}- CROSS=llvm-- STATIC_CC=${host}-clang- DYNAMIC_CC=${host}-clang\ -fPIC- TARGET_LD=${host}-clang- PREFIX=${prefix}-)--ExternalProject_Add(luajit-URL https://github.com/LuaJIT/LuaJIT/archive/${LUAJIT_VERSION}.tar.gz-# URL_HASH ${LUAJIT_HASH}- DOWNLOAD_DIR ${download_dir}-- BUILD_IN_SOURCE 1-- CONFIGURE_COMMAND ""-- BUILD_COMMAND ${wrapper_command} $(MAKE) amalg- ${LUAJIT_MAKE_FLAGS}-- INSTALL_COMMAND ${wrapper_command} $(MAKE) install- ${LUAJIT_MAKE_FLAGS}- COMMAND bash -c "rm ${prefix}/lib/libluajit*.so*"-)--ExternalProject_Add(zlib- URL https://github.com/madler/zlib/archive/refs/tags/v1.3.1.tar.gz-# URL_HASH SHA256=629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff- DOWNLOAD_DIR ${download_dir}-- CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>- ${COMMON_CMAKE_ARGS}-- BUILD_COMMAND ${wrapper_command} $(MAKE)- INSTALL_COMMAND ${wrapper_command} $(MAKE) install-)--ExternalProject_Add(libxml- DEPENDS zlib-- URL https://github.com/GNOME/libxml2/archive/refs/tags/v2.12.5.tar.gz- #URL_HASH SHA256=0ae29f4bad60d9d65fe6e6b8bc96147b743f9075b63c13d4aeb0391c0046c442- DOWNLOAD_DIR ${download_dir}-- CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>- ${COMMON_CMAKE_ARGS}- -DBUILD_SHARED_LIBS=OFF- -DLIBXML2_WITH_THREADS=ON- -DLIBXML2_WITH_CATALOG=OFF- -DLIBXML2_WITH_ICONV=OFF- -DLIBXML2_WITH_LZMA=OFF- -DLIBXML2_WITH_PROGRAMS=OFF- -DLIBXML2_WITH_PYTHON=OFF- -DLIBXML2_WITH_TESTS=OFF- -DLIBXML2_WITH_ZLIB=ON-- BUILD_COMMAND ${wrapper_command} $(MAKE)-- INSTALL_COMMAND ${wrapper_command} $(MAKE) install-)--set(LIBCOLLADA_PATCH patch -d <SOURCE_DIR> -p0 -t -N < ${CMAKE_SOURCE_DIR}/patches/libcollada-minizip-fix.patch)--ExternalProject_Add(libcollada- DEPENDS libxml boost-- URL https://github.com/rdiankov/collada-dom/archive/v2.5.0.tar.gz- URL_HASH SHA256=3be672407a7aef60b64ce4b39704b32816b0b28f61ebffd4fbd02c8012901e0d- DOWNLOAD_DIR ${download_dir}-- PATCH_COMMAND ${LIBCOLLADA_PATCH}-- CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>- ${COMMON_CMAKE_ARGS}- -DBoost_USE_STATIC_LIBS=ON- -DBoost_USE_STATIC_RUNTIME=ON- -DBoost_NO_SYSTEM_PATHS=ON- -DBoost_INCLUDE_DIR=${prefix}/include- -DCMAKE_CXX_FLAGS=-Dauto_ptr=unique_ptr\ -I${prefix}/include/\ $ENV{CXXFLAGS}-- BUILD_COMMAND ${wrapper_command} $(MAKE)-- INSTALL_COMMAND ${wrapper_command} $(MAKE) install-)--set(OSG_COMMON- -DOPENGL_PROFILE="GL1"- -DDYNAMIC_OPENTHREADS=OFF- -DDYNAMIC_OPENSCENEGRAPH=OFF- -DBUILD_OSG_PLUGIN_OSG=ON- -DBUILD_OSG_PLUGIN_DAE=ON- -DBUILD_OSG_PLUGIN_DDS=ON- -DBUILD_OSG_PLUGIN_TGA=ON- -DBUILD_OSG_PLUGIN_BMP=ON- -DBUILD_OSG_PLUGIN_JPEG=ON- -DBUILD_OSG_PLUGIN_PNG=ON- -DBUILD_OSG_PLUGIN_FREETYPE=ON- -DJPEG_INCLUDE_DIR=${prefix}/include/- -DPNG_INCLUDE_DIR=${prefix}/include/- -DFREETYPE_DIR=${prefix}- -DOSG_VERTEX_BUFFER_HINT=VBO- -DCOLLADA_INCLUDE_DIR=${prefix}/include/collada-dom2.5- -DCOLLADA_DIR=${prefix}/include/collada-dom2.5/1.4- -DOSG_CPP_EXCEPTIONS_AVAILABLE=TRUE- -DOSG_GL1_AVAILABLE=ON- -DOSG_GL2_AVAILABLE=OFF- -DOSG_GL3_AVAILABLE=OFF- -DOSG_GLES1_AVAILABLE=OFF- -DOSG_GLES2_AVAILABLE=OFF- -DOSG_GL_LIBRARY_STATIC=OFF- -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF- -DOSG_GL_MATRICES_AVAILABLE=ON- -DOSG_GL_VERTEX_FUNCS_AVAILABLE=ON- -DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=ON- -DOSG_GL_FIXED_FUNCTION_AVAILABLE=ON- -DBUILD_OSG_APPLICATIONS=OFF- -DBUILD_OSG_PLUGINS_BY_DEFAULT=OFF- -DBUILD_OSG_DEPRECATED_SERIALIZERS=OFF-)--set(OSG_PATCH- patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/disable-polygon-offset.patch &&- patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/remove-lib-prefix-from-plugins.patch &&- patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/fix-freetype-include-dirs.patch &&- patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/0001-Replace-Atomic-impl-with-std-atomic.patch &&- patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/0002-BufferObject-make-numClients-atomic.patch &&- patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/0004-IncrementalCompileOperation-wrap-some-stuff-in-atomi.patch &&- patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/force-add-plugins.patch &&- patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/dae_collada.patch &&- patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/android-shadow-texture-compat.patch &&- patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/0005-CullSettings-make-inheritanceMask-atomic-to-silence-.patch-)--ExternalProject_Add(osg- DEPENDS libjpeg-turbo libpng gl4es freetype2 libcollada-- URL https://github.com/openmw/osg/archive/${OSG_VERSION}.tar.gz-# URL_HASH ${OSG_HASH}- DOWNLOAD_DIR ${download_dir}-- PATCH_COMMAND ${OSG_PATCH}-- CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>- ${COMMON_CMAKE_ARGS}- ${OSG_COMMON}- -DCMAKE_CXX_FLAGS=-Dauto_ptr=unique_ptr\ -I${prefix}/include/\ $ENV{CXXFLAGS}-- BUILD_COMMAND ${wrapper_command} $(MAKE)-- INSTALL_COMMAND mkdir -p <SOURCE_DIR>/3rdparty/build/libpng <SOURCE_DIR>/3rdparty/build/libjpeg <SOURCE_DIR>/3rdparty/build/freetype- COMMAND $(MAKE) install-)--set(OPENMW_COMMON- -DBUILD_BSATOOL=0- -DBUILD_NIFTEST=0- -DBUILD_ESMTOOL=0- -DBUILD_LAUNCHER=0- -DBUILD_MWINIIMPORTER=0- -DBUILD_ESSIMPORTER=0- -DBUILD_OPENCS=0- -DBUILD_NAVMESHTOOL=0- -DBUILD_WIZARD=0- -DBUILD_MYGUI_PLUGIN=0- -DBUILD_BULLETOBJECTTOOL=0- -DBUILD_COMPONENTS_TESTS=OFF- -DBUILD_OPENMW_TESTS=OFF- -DOPENMW_USE_SYSTEM_SQLITE3=OFF- -DOPENMW_USE_SYSTEM_YAML_CPP=OFF- -DOPENMW_USE_SYSTEM_ICU=ON- -DOPENMW_USE_SYSTEM_OSG=ON- -DOPENMW_USE_SYSTEM_MYGUI=ON- -DOPENMW_USE_SYSTEM_BULLET=ON- -DOPENMW_USE_SYSTEM_RECASTNAVIGATION=OFF- -DOPENMW_GL4ES_MANUAL_INIT=OFF- -DCMAKE_CXX_STANDARD=20- -DCMAKE_CXX_STANDARD_REQUIRED=ON- -DCMAKE_CXX_EXTENSIONS=OFF- -DOPENAL_INCLUDE_DIR=${prefix}/include/AL/- -DBullet_INCLUDE_DIR=${prefix}/include/bullet/- -DBULLET_STATIC=TRUE- -DOSG_STATIC=TRUE- -DMYGUI_STATIC=TRUE- -DMyGUI_LIBRARY=${prefix}/lib/libMyGUIEngineStatic.a- -DBoost_USE_STATIC_LIBS=ON- -DBoost_USE_STATIC_RUNTIME=ON- -DBoost_DIR=${prefix}/lib/cmake/Boost-${BOOST_VERSION}- -DSDL2_DIR=${prefix}/lib/cmake/SDL2-)--# Isowind: first, the Android port's final shaders (its GL4ES fog, normal and shadow fixes, from its 0.51.0-11-# release) merged onto Isowind's: the scripts below then find their shader markers present and leave them alone.-set(OPENMW_PATCH- patch -d <SOURCE_DIR>/files/shaders -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/isowind/android-shaders.patch &&- patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/openmw051-final/0001-ndk-r26-stringstream-compat.patch &&- patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/openmw051-final/0002-static-osg-link.patch &&- python3 ${CMAKE_SOURCE_DIR}/patches/openmw051-final/apply-ndk-r26-format.py <SOURCE_DIR> &&- python3 ${CMAKE_SOURCE_DIR}/patches/openmw051-final/apply-android-runtime-baseline.py <SOURCE_DIR> &&- python3 ${CMAKE_SOURCE_DIR}/patches/openmw051-final/apply-android-gl4es-core-inline.py <SOURCE_DIR> &&- python3 ${CMAKE_SOURCE_DIR}/patches/openmw051-final/apply-android-graphics-followup.py <SOURCE_DIR> &&- python3 ${CMAKE_SOURCE_DIR}/patches/openmw051-final/apply-android-graphics-followup2.py <SOURCE_DIR> &&- python3 ${CMAKE_SOURCE_DIR}/patches/openmw051-final/apply-android-graphics-followup3.py <SOURCE_DIR> &&- python3 ${CMAKE_SOURCE_DIR}/patches/openmw051-final/apply-android-graphics-followup4.py <SOURCE_DIR>-)-# Isowind: the multiplayer's networking (TES3MP's CrabNet), at the commit the desktop builds use-ExternalProject_Add(crabnet- GIT_REPOSITORY https://github.com/TES3MP/CrabNet.git- GIT_TAG 19e66190e83f53bcdcbcd6513238ed2e54878a21- # Newer compilers don't pull in <cstdint> for it; the NDK has no <asm/io.h> (nothing there uses it)- PATCH_COMMAND sed -i "1i #include <cstdint>" <SOURCE_DIR>/Source/Utils/_FindFirst.h- COMMAND sed -i "s|<asm/io.h>|<unistd.h>|" <SOURCE_DIR>/Source/Plugins/FileList.cpp-- CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>- ${COMMON_CMAKE_ARGS}- -DCRABNET_ENABLE_DLL=OFF- -DCRABNET_ENABLE_SAMPLES=OFF-- BUILD_COMMAND ${wrapper_command} $(MAKE)-- INSTALL_COMMAND ""-)-ExternalProject_Get_Property(crabnet SOURCE_DIR BINARY_DIR)-set(CRABNET_SOURCE_DIR ${SOURCE_DIR})-set(CRABNET_BINARY_DIR ${BINARY_DIR})--# Isowind: the engine is this repository (two levels up), exported clean so the build folder isn't copied into itself,-# with the engine source's hash as the version, as cmake/GitVersion.cmake computes it (multiplayer only lets the same-# version play together)-execute_process(COMMAND git -C ${CMAKE_SOURCE_DIR}/../.. rev-parse HEAD:apps HEAD:components HEAD:files HEAD:extern- HEAD:cmake HEAD:CMakeLists.txt- OUTPUT_VARIABLE ISOWIND_ENGINE_TREES OUTPUT_STRIP_TRAILING_WHITESPACE)-string(SHA1 ISOWIND_SOURCE_HASH "${ISOWIND_ENGINE_TREES}")-ExternalProject_Add(openmw- DEPENDS boost openal osg mygui ffmpeg sdl2 bullet lz4 luajit libicu crabnet-- DOWNLOAD_COMMAND sh -c "git -C ${CMAKE_SOURCE_DIR}/../.. archive HEAD | tar -x -C <SOURCE_DIR>"-- PATCH_COMMAND ${OPENMW_PATCH}-- CONFIGURE_COMMAND ${wrapper_command} cmake <SOURCE_DIR>- ${COMMON_CMAKE_ARGS}- ${OPENMW_COMMON}- -DBUILD_OPENMW_MP=OFF- -DISOWIND_SOURCE_HASH=${ISOWIND_SOURCE_HASH}- -DRakNet_INCLUDES=${CRABNET_SOURCE_DIR}/include- -DRakNet_LIBRARY_RELEASE=${CRABNET_BINARY_DIR}/lib/libRakNetLibStatic.a- -DRakNet_LIBRARY_DEBUG=${CRABNET_BINARY_DIR}/lib/libRakNetLibStatic.a-- BUILD_COMMAND $(MAKE)-- INSTALL_COMMAND ""-)diff --git a/android/buildscripts/build.sh b/android/buildscripts/build.shdeleted file mode 100755index a3ac61a..0000000--- a/android/buildscripts/build.sh+++ /dev/null@@ -1,278 +0,0 @@-#!/bin/bash--set -e-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"-cd $DIR--export ARCH="arm"-export CCACHE="false"-ASAN="false"-DEPLOY_RESOURCES="true"-LTO="false"-BUILD_TYPE="release"-JOBS=""-CFLAGS="-fPIC"-CXXFLAGS="-fPIC -frtti -fexceptions"-LDFLAGS="-fPIC -Wl,--undefined-version"--usage() {- echo "Usage: ./build.sh [--help] [--asan] [--arch arch] [--debug|--release]"- echo " --help: print this message"- echo " --arch: build for specified architecture [arm, arm64, x86_64, x86] (default: arm)"- echo " --asan: build with AddressSanitizer enabled"- echo " --no-resources: don't deploy the resources (used in full-build.sh)"- echo " --lto: use LTO for linking"- echo " --jobs N: limit parallel build jobs (default: all detected CPUs)"- echo " --ccache: use ccache to speed up repeated builds"- echo " --debug: produce a debug build without optimizations"- echo " --release: produce a release build with optimizations (default)"- exit 0-}--# Parse command-line arguments-while [[ $# -gt 0 ]]; do- key="$1"-- case $key in- --help)- usage- shift- ;;- --arch)- export ARCH="$2"- shift 2- ;;- --asan)- ASAN=true- shift- ;;- --lto)- LTO=true- shift- ;;- --ccache)- export CCACHE="true"- shift- ;;- --jobs)- JOBS="$2"- shift 2- ;;- --debug)- BUILD_TYPE="debug"- shift- ;;- --release)- BUILD_TYPE="release"- shift- ;;- --no-resources)- DEPLOY_RESOURCES="false"- shift- ;;- *)- echo "Invalid argument: $key"- exit 1- ;;- esac-done--if [[ $ASAN = true && $ARCH != "arm" && $ARCH != "arm64" ]]; then- echo "AddressSanitizer is only supported on arm and aarch64 architectures"- exit 1-fi--source ./include/version.sh--if [ $ASAN = true ]; then- CFLAGS="$CFLAGS -fsanitize=address -fuse-ld=lld -fno-omit-frame-pointer"- CXXFLAGS="$CXXFLAGS -fsanitize=address -fuse-ld=lld -fno-omit-frame-pointer"- LDFLAGS="$LDFLAGS -fsanitize=address -fuse-ld=lld -fno-omit-frame-pointer"-fi--if [ $BUILD_TYPE = "release" ]; then- CFLAGS="$CFLAGS -O3"- CXXFLAGS="$CXXFLAGS -O3"-else- CFLAGS="$CFLAGS -O0 -g"- CXXFLAGS="$CXXFLAGS -O0 -g"-fi--if [[ $LTO = "true" ]]; then- CFLAGS="$CFLAGS -flto"- CXXFLAGS="$CXXFLAGS -flto"- # emulated-tls should not be needed in ndk r18 https://github.com/android-ndk/ndk/issues/498#issuecomment-327825754- LDFLAGS="$LDFLAGS -flto -Wl,-plugin-opt=-emulated-tls -fuse-ld=lld"-fi--if [[ $ARCH = "arm" ]]; then- CFLAGS="$CFLAGS -mthumb"- CXXFLAGS="$CXXFLAGS -mthumb"-fi--echo ""-echo "================================================================================"-echo ""-echo "Build configuration:"-echo " - Architecture: $ARCH"-echo " - Build type: $BUILD_TYPE"-echo " - AddressSanitizer: $ASAN"-echo ""-echo " ------------------------------------------------------------------------------ "-echo ""-echo "Computed flags:"-echo " - CFLAGS: $CFLAGS"-echo " - CXXFLAGS: $CXXFLAGS"-echo " - LDFLAGS: $LDFLAGS"-echo ""-echo "================================================================================"-echo "(Please run ./clean.sh manually if you modify any of the options)"-echo ""--echo "==> Download and set up the NDK"-./include/download-ndk.sh-./include/setup-ndk.sh-./include/setup-icu.sh--if [[ -n "$JOBS" ]]; then- if ! [[ "$JOBS" =~ ^[1-9][0-9]*$ ]]; then- echo "Invalid --jobs value: $JOBS" >&2- exit 1- fi- NCPU="$JOBS"-else- NCPU=$(grep -c ^processor /proc/cpuinfo)-fi-echo "==> Build using $NCPU parallel job(s)"-mkdir -p build/$ARCH/-mkdir -p prefix/$ARCH/--# symlink lib64 -> lib so we don't get half the libs in one directory half in another-mkdir -p prefix/$ARCH/lib-ln -sf lib prefix/$ARCH/lib64-mkdir -p prefix/$ARCH/osg/lib-ln -sf lib prefix/$ARCH/osg/lib64--# generate command_wrapper.sh-cat include/command_wrapper_head.sh.in | \- DIR=$DIR \- ARCH=$ARCH \- ENV_CFLAGS=$CFLAGS \- ENV_CXXFLAGS=$CXXFLAGS \- NDK_TRIPLET=$NDK_TRIPLET \- ENV_LDFLAGS=$LDFLAGS \- envsubst > build/$ARCH/command_wrapper.sh-cat include/command_wrapper_tail.sh.in >> build/$ARCH/command_wrapper.sh-chmod +x build/$ARCH/command_wrapper.sh--pushd build/$ARCH/--# Get CC/CXX/etc vars-source ./command_wrapper.sh true--# Build!-cmake ../.. \- -DCMAKE_INSTALL_PREFIX=$DIR/prefix/$ARCH/ \- -DARCH=$ARCH \- -DBUILD_TYPE=$BUILD_TYPE \- -DNDK_TRIPLET=$NDK_TRIPLET \- -DANDROID_API=$ANDROID_API \- -DABI=$ABI \- -DBOOST_ARCH=$BOOST_ARCH \- -DBOOST_ADDRESS_MODEL=$BOOST_ADDRESS_MODEL \- -DLUAJIT_HOST_CC="$LUAJIT_HOST_CC" \- -DFFMPEG_CPU=$FFMPEG_CPU-make -j$NCPU openmw--popd--echo "==> Installing shared libraries"--rm -rf ../app/wrap/-rm -rf ../app/src/main/jniLibs/$ABI/-mkdir -p ../app/src/main/jniLibs/$ABI/--# libopenmw.so is a special case-find build/$ARCH/openmw-prefix/ -iname "libopenmw.so" -exec cp "{}" ../app/src/main/jniLibs/$ABI/libopenmw.so \;--# copy over libs we compiled-cp prefix/$ARCH/lib/{libopenal,libSDL2,libGL,libcollada-dom2.5-dp}.so ../app/src/main/jniLibs/$ABI/-# copy over libc++_shared-find ./toolchain/$ARCH/sysroot/usr/lib/$NDK_TRIPLET -iname "libc++_shared.so" -exec cp "{}" ../app/src/main/jniLibs/$ABI/ \;--if [[ $DEPLOY_RESOURCES = "true" ]]; then- echo "==> Deploying resources"-- DST=$DIR/../app/src/main/assets/libopenmw/- SRC=build/$ARCH/openmw-prefix/src/openmw-build/-- rm -rf "$DST" && mkdir -p "$DST"-- # resources- cp -r "$SRC/resources" "$DST"-- # global config- mkdir -p "$DST/openmw/"- cp "$SRC/defaults.bin" "$DST/openmw/"- cp "$SRC/gamecontrollerdb.txt" "$DST/openmw/"- # OpenMW 0.51 adds an engine-owned data path for resources/vfs-mw.- # Do not strip every data= line as the old CaveBros pipeline did; remove- # only data-local and preserve the internal vfs-mw entry. MainActivity- # rewrites it to the writable Android resource mirror at runtime.- grep -v '^data-local=' "$SRC/openmw.cfg" >> "$DST/openmw/openmw.base.cfg"- cat "$DIR/../app/openmw.base.cfg" >> "$DST/openmw/openmw.base.cfg"-- # Immutable engine marker consumed by app/build.gradle. Prevents accidentally- # packaging a stale pre-0.51 libopenmw.so after this upgrade.- cat > "$DST/openmw/openmw-engine-version.txt" <<'EOF'-OpenMW 0.51.0 Final-commit=f4bec41444214a7903bebd178389ca22ca13f646-EOF-- # licensing info- cp "$DIR/../3rdparty-licenses.txt" "$DST"-- # Isowind: the mod, pixel art and profiles, plus the bundled mods from $ISOWIND_MODS when given, laid out as in- # the desktop packages (MainActivity copies them out and adds the profile to openmw.cfg)- echo "==> Deploying Isowind"- ISO="$DIR/../../isowind"- ISO_DST="$DIR/../app/src/main/assets/isowind"- rm -rf "$ISO_DST" && mkdir -p "$ISO_DST/profiles"- cp -r "$ISO/mod" "$ISO/pixelart" "$ISO_DST/"- cp -r "$ISO/profiles/pixelart" "$ISO/profiles/normal" "$ISO/profiles/input_v3.xml" "$ISO_DST/profiles/"- if [[ -n "$ISOWIND_MODS" && -d "$ISOWIND_MODS" ]]; then- cp -r "$ISOWIND_MODS" "$ISO_DST/mods"- else- echo "warning: no bundled mods (ISOWIND_MODS); servers require their plugins"- fi-fi--echo "==> Making your debugging life easier"--# copy unstripped libs to aid debugging-rm -rf "./symbols/$ABI/" && mkdir -p "./symbols/$ABI/"-cp "./build/$ARCH/openal-prefix/src/openal-build/libopenal.so" "./symbols/$ABI/"-cp "./build/$ARCH/sdl2-prefix/src/sdl2-build/obj/local/$ABI/libSDL2.so" "./symbols/$ABI/"-OPENMW_SYMBOL_LIB=$(find "./build/$ARCH/openmw-prefix/" -iname "libopenmw.so" | head -n 1)-if [[ -z "$OPENMW_SYMBOL_LIB" ]]; then- echo "ERROR: libopenmw.so was built but its unstripped symbol copy could not be located."- exit 1-fi-cp "$OPENMW_SYMBOL_LIB" "./symbols/$ABI/libopenmw.so"-cp "./build/$ARCH/gl4es-prefix/src/gl4es-build/obj/local/$ABI/libGL.so" "./symbols/$ABI/"-cp "../app/src/main/jniLibs/$ABI/libc++_shared.so" "./symbols/$ABI/"--if [ $ASAN = true ]; then- cp ./toolchain/$ARCH/lib64/clang/*/lib/linux/libclang_rt.asan-$ASAN_ARCH-android.so "./symbols/$ABI/"- cp ./toolchain/$ARCH/lib64/clang/*/lib/linux/libclang_rt.asan-$ASAN_ARCH-android.so "../app/src/main/jniLibs/$ABI/"- mkdir -p ../app/wrap/res/lib/$ABI/- sed "s/@ASAN_ARCH@/$ASAN_ARCH/g" < include/asan-wrapper.sh > "../app/wrap/res/lib/$ABI/wrap.sh"- chmod +x "../app/wrap/res/lib/$ABI/wrap.sh"-fi--#PATH="$DIR/toolchain/ndk/prebuilt/linux-x86_64/bin/:$DIR/toolchain/$ARCH/$NDK_TRIPLET/bin/:$PATH" ./include/gdb-add-index ./symbols/$ABI/*.so--# gradle should do it, but just in case...-llvm-strip ../app/src/main/jniLibs/$ABI/*.so--echo "==> Success"diff --git a/android/buildscripts/checksum.py b/android/buildscripts/checksum.pydeleted file mode 100644index e7daa9d..0000000--- a/android/buildscripts/checksum.py+++ /dev/null@@ -1,117 +0,0 @@-#!/usr/bin/env python3-"""-Generates updated sha256 checksums from CMakeLists.txt and git diff; very hacky but does its job-"""--import subprocess-import re-import sys-import urllib.request-import hashlib---def eprint(*args, **kwargs):- print(*args, file=sys.stderr, **kwargs)---class Project:- def __init__(self, name, url, hash_variable):- self.name = name- self.url = url- self.hash_variable = hash_variable- self.version_variables = set()- self.changed = False-- def resolve_url(self, variables):- url = self.url- for name, value in variables.items():- if name in url:- self.version_variables.add(name)- url = url.replace("${%s}" % name, value)- if "$(" in url:- raise RuntimeError("failed to resolve all variables for URL {}".format(self.url))- return url---def main():- with open("CMakeLists.txt", "r") as inf:- data = inf.read()- lines = data.split("\n")-- # get the header lines from the file, the header defines versions and hashes- header = []- for line in lines:- header.append(line)- if "End of configurable options" in line:- break;- header = header[2:]-- # resolve all cmake external projects, i.e. calls to ExternalProject_Add- projects = []- variables = dict()- for line in lines:- if line.startswith("set(") and "_VERSION " in line:- line = line[4:-1]- name, value = line.split()- variables[name] = value-- if line.startswith("ExternalProject_Add"):- name = line[line.find("(")+1:]- elif "URL_HASH" in line:- hash_variable = line.split()[1][2:-1]- elif "URL" in line:- url = line.split()[1]-- # insert this project now- if "DOWNLOAD_DIR" in line:- projects.append(Project(name, url, hash_variable))-- variables["BOOST_VERSION_UNDERSCORE"] = variables["BOOST_VERSION"].replace(".", "_")-- # resolve the urls in advance to get version_variables- for project in projects:- project.resolve_url(variables)-- # figure which projects have changed using git diff- output = subprocess.check_output(["git", "diff", "--unified=0", "CMakeLists.txt"]).decode("utf-8").split("\n")- for line in output:- if line.startswith("-set("):- for project in projects:- for var in project.version_variables:- if var in line:- project.changed = True-- # find out which URLs we need to download and which hash variables to update, the mapping is url->hash variable- url_to_hash = dict()- for project in projects:- if project.changed:- url_to_hash[project.resolve_url(variables)] = project.hash_variable-- # download the URLs and make note of the new hashes- new_variables = dict()- for url, hash_variable in url_to_hash.items():- eprint("Downloading {}".format(url))-- resp = urllib.request.urlopen(url)- binary = resp.read()- h = hashlib.sha256(binary).hexdigest()-- eprint(" => {}".format(h))-- new_hash = "SHA256={}".format(h)- new_variables[hash_variable] = new_hash-- # insert new variables into the header- for x in range(len(header)):- line = header[x]- for variable, value in new_variables.items():- if variable in line:- line = re.sub(r"SHA256=.{64}", value, line)- header[x] = line-- eprint("")- print("\n".join(header))---if __name__ == "__main__":- main()diff --git a/android/buildscripts/clean.sh b/android/buildscripts/clean.shdeleted file mode 100755index c9b6551..0000000--- a/android/buildscripts/clean.sh+++ /dev/null@@ -1,32 +0,0 @@-#!/bin/bash--set -e-cd "$(dirname ${BASH_SOURCE[0]})"--# Always clean old jniLibs-rm -rf ../app/src/main/jniLibs/-rm -rf ../app/wrap/--# Clean a single thing-if [[ $1 == "--build" ]]; then- rm -rf build symbols- exit 0-fi--if [[ $1 == "--toolchain" ]]; then- rm -rf toolchain- exit 0-fi--if [[ $1 == "--prefix" ]]; then- rm -rf prefix- exit 0-fi--# Generic clean, good most of the time-rm -rf toolchain prefix build symbols--# Clean everything, including downloads-if [[ $1 == "--all" ]]; then- rm -rf downloads-fidiff --git a/android/buildscripts/cmake/SDL2Config.cmake b/android/buildscripts/cmake/SDL2Config.cmakedeleted file mode 100644index b92348a..0000000--- a/android/buildscripts/cmake/SDL2Config.cmake+++ /dev/null@@ -1,64 +0,0 @@-# OpenMW Android v13.13-#-# Bridge the CaveBros ndk-build SDL installation to OpenMW 0.50 Final's-# SDL2::SDL2 CMake target.-#-# CaveBros historically installs SDL headers by copying <SOURCE_DIR>/include-# into ${prefix}. Depending on the exact SDL packaging/layout this can yield-# either:-#-# ${prefix}/include/SDL.h-#-# or:-#-# ${prefix}/include/SDL2/SDL.h-#-# Do not hard-code one layout. Resolve the actual installed header root.--get_filename_component(_OPENMW_ANDROID_SDL2_PREFIX- "${CMAKE_CURRENT_LIST_DIR}/../../.."- ABSOLUTE-)--set(_OPENMW_ANDROID_SDL2_LIBRARY- "${_OPENMW_ANDROID_SDL2_PREFIX}/lib/libSDL2.so"-)--if(EXISTS "${_OPENMW_ANDROID_SDL2_PREFIX}/include/SDL.h")- set(_OPENMW_ANDROID_SDL2_INCLUDE_DIR- "${_OPENMW_ANDROID_SDL2_PREFIX}/include"- )-elseif(EXISTS "${_OPENMW_ANDROID_SDL2_PREFIX}/include/SDL2/SDL.h")- set(_OPENMW_ANDROID_SDL2_INCLUDE_DIR- "${_OPENMW_ANDROID_SDL2_PREFIX}/include/SDL2"- )-else()- message(FATAL_ERROR- "OpenMW Android SDL2 bridge: SDL.h was not found below "- "${_OPENMW_ANDROID_SDL2_PREFIX}/include"- )-endif()--if(NOT EXISTS "${_OPENMW_ANDROID_SDL2_LIBRARY}")- message(FATAL_ERROR- "OpenMW Android SDL2 bridge: libSDL2.so was not found at "- "${_OPENMW_ANDROID_SDL2_LIBRARY}"- )-endif()--if(NOT TARGET SDL2::SDL2)- add_library(SDL2::SDL2 SHARED IMPORTED)- set_target_properties(SDL2::SDL2 PROPERTIES- IMPORTED_LOCATION "${_OPENMW_ANDROID_SDL2_LIBRARY}"- INTERFACE_INCLUDE_DIRECTORIES "${_OPENMW_ANDROID_SDL2_INCLUDE_DIR}"- )-endif()--set(SDL2_INCLUDE_DIRS "${_OPENMW_ANDROID_SDL2_INCLUDE_DIR}")-set(SDL2_LIBRARIES SDL2::SDL2)-set(SDL2_FOUND TRUE)-set(SDL2_VERSION "2.0.22")--unset(_OPENMW_ANDROID_SDL2_PREFIX)-unset(_OPENMW_ANDROID_SDL2_LIBRARY)-unset(_OPENMW_ANDROID_SDL2_INCLUDE_DIR)diff --git a/android/buildscripts/cmake/SDL2ConfigVersion.cmake b/android/buildscripts/cmake/SDL2ConfigVersion.cmakedeleted file mode 100644index 2df3928..0000000--- a/android/buildscripts/cmake/SDL2ConfigVersion.cmake+++ /dev/null@@ -1,9 +0,0 @@-set(PACKAGE_VERSION "2.0.22")-if(PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)- set(PACKAGE_VERSION_COMPATIBLE FALSE)-else()- set(PACKAGE_VERSION_COMPATIBLE TRUE)- if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)- set(PACKAGE_VERSION_EXACT TRUE)- endif()-endif()diff --git a/android/buildscripts/full-build.sh b/android/buildscripts/full-build.shdeleted file mode 100755index 945845a..0000000--- a/android/buildscripts/full-build.sh+++ /dev/null@@ -1,22 +0,0 @@-#!/bin/bash--set -e--./clean.sh --all--# ARCH=arm below is a hack for our Great Build System-ARCH=arm ./include/download-ndk.sh-ARCH=arm ./include/setup-ndk.sh--./build.sh --arch arm --lto--./build.sh --arch arm64 --lto --no-resources &-PID1=$!--./build.sh --arch x86_64 --lto --no-resources &-PID2=$!--./build.sh --arch x86 --lto --no-resources &-PID3=$!--wait $PID1 $PID2 $PID3diff --git a/android/buildscripts/include/asan-wrapper.sh b/android/buildscripts/include/asan-wrapper.shdeleted file mode 100755index 601c98c..0000000--- a/android/buildscripts/include/asan-wrapper.sh+++ /dev/null@@ -1,5 +0,0 @@-#!/system/bin/sh-HERE="$(cd "$(dirname "$0")" && pwd)"-export ASAN_OPTIONS=log_to_syslog=false,allow_user_segv_handler=1-export LD_PRELOAD="$HERE/libc++_shared.so $HERE/libclang_rt.asan-@[email protected]"-"$@"diff --git a/android/buildscripts/include/command_wrapper_head.sh.in b/android/buildscripts/include/command_wrapper_head.sh.indeleted file mode 100644index ea1fc7f..0000000--- a/android/buildscripts/include/command_wrapper_head.sh.in+++ /dev/null@@ -1,12 +0,0 @@-#!/bin/bash--# Head: Preprocessed by build.sh--export PKG_CONFIG_LIBDIR="$DIR/prefix/$ARCH/lib/pkgconfig"-export CC="$NDK_TRIPLET-clang"-export CXX="$NDK_TRIPLET-clang++"-export PATH="$DIR/toolchain/$ARCH/bin/:$DIR/toolchain/ndk/:$PATH"--export CFLAGS="$ENV_CFLAGS"-export CXXFLAGS="$ENV_CXXFLAGS"-export LDFLAGS="$ENV_LDFLAGS"diff --git a/android/buildscripts/include/command_wrapper_tail.sh.in b/android/buildscripts/include/command_wrapper_tail.sh.indeleted file mode 100644index 6523f5b..0000000--- a/android/buildscripts/include/command_wrapper_tail.sh.in+++ /dev/null@@ -1,7 +0,0 @@-# Tail: inserted as-is--COMMAND_NAME="$1"--shift--${COMMAND_NAME} "$@"diff --git a/android/buildscripts/include/configure-boost-android.sh b/android/buildscripts/include/configure-boost-android.shdeleted file mode 100755index 4575028..0000000--- a/android/buildscripts/include/configure-boost-android.sh+++ /dev/null@@ -1,34 +0,0 @@-#!/usr/bin/env bash-set -euo pipefail--BOOST_SOURCE_DIR="${1:?Boost source directory argument is required}"--if [[ -z "${CXX:-}" ]]; then- echo "ERROR: Boost Android setup requires CXX from command_wrapper.sh." >&2- exit 2-fi--CXX_PATH="$(command -v "$CXX" 2>/dev/null || true)"-if [[ -z "$CXX_PATH" || ! -x "$CXX_PATH" ]]; then- echo "ERROR: Android CXX compiler '$CXX' is not executable in the dependency-build PATH." >&2- echo "PATH=$PATH" >&2- exit 2-fi--echo "Boost.Android: CXX=$CXX"-echo "Boost.Android: compiler=$CXX_PATH"-"$CXX_PATH" --version | head -n 1 || true--USER_CONFIG="$BOOST_SOURCE_DIR/android-user-config.jam"--# Boost.Build's clang-linux toolset otherwise falls back to a plain host-# `clang++`. Configure the already selected Android NDK C++ compiler explicitly.-#-# The NDK compiler wrapper already carries the Android target/API, therefore-# suppress B2's own target-triple inference.-cat > "$USER_CONFIG" <<EOF-using clang : : $CXX_PATH : <triple>none ;-EOF--echo "Boost.Android: wrote $USER_CONFIG"-cat "$USER_CONFIG"diff --git a/android/buildscripts/include/download-ndk.sh b/android/buildscripts/include/download-ndk.shdeleted file mode 100755index d65afb1..0000000--- a/android/buildscripts/include/download-ndk.sh+++ /dev/null@@ -1,25 +0,0 @@-#!/bin/bash--set -e--source ./include/version.sh--mkdir -p downloads--pushd downloads--if [[ -f $NDK_FILE ]]; then- # We've already downloaded it- exit 0-fi--curl --http1.1 "https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux.zip" > $NDK_FILE--echo "==> Checking NDK zip file integrity"-FILE_HASH=$(sha256sum $NDK_FILE | awk '{print $1}' )-if [[ $FILE_HASH != $NDK_HASH ]]; then- echo "Failed, expected $NDK_HASH got $FILE_HASH"- exit 1-fi--popddiff --git a/android/buildscripts/include/gdb-add-index b/android/buildscripts/include/gdb-add-indexdeleted file mode 100644index 479690e..0000000--- a/android/buildscripts/include/gdb-add-index+++ /dev/null@@ -1,150 +0,0 @@-#!/bin/bash-# Copyright (c) 2012 The Chromium Authors. All rights reserved.-# Use of this source code is governed by a BSD-style license that can be-# found in the LICENSE file.-#-# Saves the gdb index for a given binary and its shared library dependencies.-#-# This will run gdb index in parallel on a number of binaries using SIGUSR1-# as the communication mechanism to simulate a semaphore. Because of the-# nature of this technique, using "set -e" is very difficult. The SIGUSR1-# terminates a "wait" with an error which we need to interpret.-#-# When modifying this code, most of the real logic is in the index_one_file-# function. The rest is cleanup + sempahore plumbing.--# Cleanup temp directory and ensure all child jobs are dead-dead.-function on_exit {- trap "" EXIT USR1 # Avoid reentrancy.-- local jobs=$(jobs -p)- if [ -n "$jobs" ]; then- echo -n "Killing outstanding index jobs..."- kill -KILL $(jobs -p)- wait- echo "done"- fi-- if [ -f "$DIRECTORY" ]; then- echo -n "Removing temp directory $DIRECTORY..."- rm -rf $DIRECTORY- echo done- fi-}--# Add index to one binary.-function index_one_file {- local file=$1- local basename=$(basename "$file")- local should_index="${SHOULD_INDEX}"-- local readelf_out=$(readelf -S "$file")- if [[ $readelf_out =~ "gdb_index" ]]; then- if [ "${REMOVE_INDEX}" = 1 ]; then- objcopy --remove-section .gdb_index "$file"- echo "Removed index from $basename."- else- echo "Skipped $basename -- already contains index."- should_index=0- fi- fi-- if [ "${should_index}" = 1 ]; then- local start=$(date +"%s%N")- echo "Adding index to $basename..."-- gdb -batch "$file" -ex "save gdb-index $DIRECTORY" -ex "quit"- local index_file="$DIRECTORY/$basename.gdb-index"- if [ -f "$index_file" ]; then- objcopy --add-section .gdb_index="$index_file" \- --set-section-flags .gdb_index=readonly "$file" "$file"- local finish=$(date +"%s%N")- local elappsed=$(((finish - start)/1000000))- echo " ...$basename indexed. [${elappsed}ms]"- else- echo " ...$basename unindexable."- fi- fi-}--# Functions that when combined, concurrently index all files in FILES_TO_INDEX-# array. The global FILES_TO_INDEX is declared in the main body of the script.-function async_index {- # Start a background subshell to run the index command.- {- index_one_file $1- kill -SIGUSR1 $$ # $$ resolves to the parent script.- exit 129 # See comment above wait loop at bottom.- } &-}--CUR_FILE_NUM=0-function index_next {- if (( CUR_FILE_NUM >= ${#FILES_TO_INDEX[@]} )); then- return- fi-- async_index "${FILES_TO_INDEX[CUR_FILE_NUM]}"- ((CUR_FILE_NUM += 1)) || true-}---########-### Main body of the script.--REMOVE_INDEX=0-SHOULD_INDEX=1-while getopts ":f:r" opt; do- case $opt in- f)- REMOVE_INDEX=1- shift- ;;- r)- REMOVE_INDEX=1- SHOULD_INDEX=0- shift- ;;- *)- echo "Invalid option: -$OPTARG" >&2- ;;- esac-done--FILENAME="$1"-if [[ ! -f "$FILENAME" ]]; then- echo "Path $FILENAME does not exist."- exit 1-fi--# Ensure we cleanup on on exit.-trap on_exit EXIT--# We're good to go! Create temp directory for index files.-DIRECTORY=$(mktemp -d)-echo "Made temp directory $DIRECTORY."--# Create array with the filename and all shared libraries that-# have the same dirname. The dirname is a signal that these-# shared libraries were part of the same build as the binary.-declare -a FILES_TO_INDEX=( "$@" )--# Start concurrent indexing.-trap index_next USR1--# 4 is an arbitrary default. When changing, remember we are likely IO bound-# so basing this off the number of cores is not sensible.-INDEX_TASKS=${INDEX_TASKS:-4}-for ((i=0;i<${INDEX_TASKS};i++)); do- index_next-done--# Do a wait loop. Bash waits that terminate due a trap have an exit-# code > 128. We also ensure that our subshell's "normal" exit occurs with-# an exit code > 128. This allows us to do consider a > 128 exit code as-# an indication that the loop should continue. Unfortunately, it also means-# we cannot use set -e since technically the "wait" is failing.-wait-while (( $? > 128 )); do- wait-donediff --git a/android/buildscripts/include/setup-icu.sh b/android/buildscripts/include/setup-icu.shdeleted file mode 100755index 3458543..0000000--- a/android/buildscripts/include/setup-icu.sh+++ /dev/null@@ -1,20 +0,0 @@-#!/bin/bash--set -e-mkdir -p build-cd build--# Build a version of ICU for the host so that it can use the tools during the cross-compilation-mkdir -p icu-host-build-cd icu-host-build-if [ -r release-70-1.zip ]; then- ICU_SOURCE_DIR=./icu-release-70-1/icu4c/source-else- wget https://github.com/unicode-org/icu/archive/refs/tags/release-70-1.zip- unzip release-70-1.zip- ICU_SOURCE_DIR=./icu-release-70-1/icu4c/source- ${ICU_SOURCE_DIR}/configure --disable-tests --disable-samples --disable-icuio --disable-extras CC="gcc" CXX="g++"- make -j $(nproc)-fi--cd ../..diff --git a/android/buildscripts/include/setup-ndk.sh b/android/buildscripts/include/setup-ndk.shdeleted file mode 100755index 6462d34..0000000--- a/android/buildscripts/include/setup-ndk.sh+++ /dev/null@@ -1,144 +0,0 @@-#!/bin/bash--set -euo pipefail--DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"--# build.sh normally exports both values before calling this file.-export ARCH="${ARCH:-arm}"-export CCACHE="${CCACHE:-false}"--source ./include/version.sh--TOOLCHAIN_ROOT="toolchain"-NDK_ROOT="$TOOLCHAIN_ROOT/ndk"-ARCH_ROOT="$TOOLCHAIN_ROOT/$ARCH"--if [[ ! -d "$NDK_ROOT" ]]; then- mkdir -p "$TOOLCHAIN_ROOT"-- echo "==> Extracting Android NDK $NDK_VERSION"- unzip -q "downloads/$NDK_FILE" -d "$TOOLCHAIN_ROOT/"-- extracted_ndk="$(find "$TOOLCHAIN_ROOT" -maxdepth 1 -type d -name 'android-ndk-*' | head -n 1)"- if [[ -z "$extracted_ndk" ]]; then- echo "Unable to find extracted Android NDK directory."- exit 1- fi-- mv "$extracted_ndk" "$NDK_ROOT"-fi--PREBUILT="$NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64"--if [[ ! -d "$PREBUILT/bin" ]]; then- echo "Expected Linux x86_64 LLVM toolchain not found:"- echo " $PREBUILT"- echo "The native build scripts are intended for Linux/WSL2."- exit 1-fi--case "$ARCH" in- arm)- CLANG_TRIPLE="armv7a-linux-androideabi"- ;;- arm64)- CLANG_TRIPLE="aarch64-linux-android"- ;;- x86)- CLANG_TRIPLE="i686-linux-android"- ;;- x86_64)- CLANG_TRIPLE="x86_64-linux-android"- ;;- *)- echo "Unknown architecture: $ARCH"- exit 1- ;;-esac--PREBUILT_ABS="$(cd "$PREBUILT" && pwd)"-ARCH_ROOT_ABS="$(mkdir -p "$ARCH_ROOT" && cd "$ARCH_ROOT" && pwd)"-ARCH_BIN="$ARCH_ROOT_ABS/bin"--mkdir -p "$ARCH_BIN"-mkdir -p "$ARCH_ROOT_ABS/lib64"--echo "==> Creating NDK r26 compatibility toolchain for $ARCH (API $ANDROID_API)"--# Old OpenMW-Android scripts expect standalone-toolchain paths. NDK r26 no-# longer ships make_standalone_toolchain.py, so expose the unified sysroot and-# Clang runtime in the locations expected by build.sh.-ln -sfn "$PREBUILT_ABS/sysroot" "$ARCH_ROOT_ABS/sysroot"-ln -sfn "$PREBUILT_ABS/lib/clang" "$ARCH_ROOT_ABS/lib64/clang"--create_compiler_wrapper() {- local output="$1"- local compiler="$2"-- cat > "$output" <<EOF-#!/bin/bash-set -e-if [[ "\${CCACHE:-false}" == "true" ]]; then- exec ccache "$compiler" "\$@"-else- exec "$compiler" "\$@"-fi-EOF- chmod +x "$output"-}--TARGET_CC="$PREBUILT_ABS/bin/${CLANG_TRIPLE}${ANDROID_API}-clang"-TARGET_CXX="$PREBUILT_ABS/bin/${CLANG_TRIPLE}${ANDROID_API}-clang++"--if [[ ! -x "$TARGET_CC" || ! -x "$TARGET_CXX" ]]; then- echo "Target compiler driver not found for $ARCH / API $ANDROID_API"- echo " CC: $TARGET_CC"- echo " CXX: $TARGET_CXX"- exit 1-fi--create_compiler_wrapper "$ARCH_BIN/$NDK_TRIPLET-clang" "$TARGET_CC"-create_compiler_wrapper "$ARCH_BIN/$NDK_TRIPLET-clang++" "$TARGET_CXX"--# Some legacy dependency build systems still probe gcc/g++ names.-ln -sfn "$NDK_TRIPLET-clang" "$ARCH_BIN/$NDK_TRIPLET-gcc"-ln -sfn "$NDK_TRIPLET-clang++" "$ARCH_BIN/$NDK_TRIPLET-g++"--# Triple-prefixed binutils names were also present in old standalone toolchains.-declare -A BINUTILS=(- [ar]="llvm-ar"- [nm]="llvm-nm"- [objcopy]="llvm-objcopy"- [objdump]="llvm-objdump"- [ranlib]="llvm-ranlib"- [readelf]="llvm-readelf"- [size]="llvm-size"- [strings]="llvm-strings"- [strip]="llvm-strip"-)--for legacy_name in "${!BINUTILS[@]}"; do- llvm_name="${BINUTILS[$legacy_name]}"- if [[ -x "$PREBUILT_ABS/bin/$llvm_name" ]]; then- ln -sfn "$PREBUILT_ABS/bin/$llvm_name" "$ARCH_BIN/$NDK_TRIPLET-$legacy_name"- ln -sfn "$PREBUILT_ABS/bin/$llvm_name" "$ARCH_BIN/$llvm_name"- fi-done--# Useful LLVM tools that are invoked by parts of the existing build.-for llvm_name in ld.lld lld llvm-addr2line llvm-cxxfilt; do- if [[ -x "$PREBUILT_ABS/bin/$llvm_name" ]]; then- ln -sfn "$PREBUILT_ABS/bin/$llvm_name" "$ARCH_BIN/$llvm_name"- fi-done--cp "$DIR/../patches/gas-preprocessor.pl" "$ARCH_BIN/gas-preprocessor.pl"-chmod +x "$ARCH_BIN/gas-preprocessor.pl"--if [[ "$CCACHE" == "true" ]] && ! command -v ccache >/dev/null 2>&1; then- echo "CCACHE=true, but ccache is not installed."- exit 1-fi--echo "==> NDK compatibility toolchain ready: $ARCH_ROOT_ABS"diff --git a/android/buildscripts/include/version.sh b/android/buildscripts/include/version.shdeleted file mode 100755index 18a03a0..0000000--- a/android/buildscripts/include/version.sh+++ /dev/null@@ -1,44 +0,0 @@-#!/bin/bash--NDK_VERSION="r26b"-NDK_HASH="ad73c0370f0b0a87d1671ed2fd5a9ac9acfd1eb5c43a7fbfbd330f85d19dd632"-ANDROID_API="21"--# End of configurable options--NDK_FILE="ndk-$NDK_VERSION.zip"--if [[ $ARCH = "arm" ]]; then- ABI="armeabi-v7a"- NDK_TRIPLET="arm-linux-androideabi"- FFMPEG_CPU="armv7-a"- BOOST_ARCH="arm"- BOOST_ADDRESS_MODEL="32"- LUAJIT_HOST_CC="gcc -m32"- ASAN_ARCH="arm"-elif [[ $ARCH = "arm64" ]]; then- ABI="arm64-v8a"- NDK_TRIPLET="aarch64-linux-android"- FFMPEG_CPU="armv8-a"- BOOST_ARCH="arm"- BOOST_ADDRESS_MODEL="64"- LUAJIT_HOST_CC="gcc -m64"- ASAN_ARCH="aarch64"-elif [[ $ARCH = "x86_64" ]]; then- ABI="x86_64"- NDK_TRIPLET="x86_64-linux-android"- FFMPEG_CPU="intel"- BOOST_ARCH="x86"- BOOST_ADDRESS_MODEL="64"- LUAJIT_HOST_CC="gcc -m64"-elif [[ $ARCH = "x86" ]]; then- ABI="x86"- NDK_TRIPLET="i686-linux-android"- FFMPEG_CPU="intel"- BOOST_ARCH="x86"- BOOST_ADDRESS_MODEL="32"- LUAJIT_HOST_CC="gcc -m32"-else- echo "Unknown architecture: $ARCH"- exit 1-fidiff --git a/android/buildscripts/llvm.sh b/android/buildscripts/llvm.shdeleted file mode 100755index 200c039..0000000--- a/android/buildscripts/llvm.sh+++ /dev/null@@ -1,176 +0,0 @@-#!/bin/bash-################################################################################-# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.-# See https://llvm.org/LICENSE.txt for license information.-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception-################################################################################-#-# This script will install the llvm toolchain on the different-# Debian and Ubuntu versions--set -eux--usage() {- set +x- echo "Usage: $0 [llvm_major_version] [all] [OPTIONS]" 1>&2- echo -e "all\t\t\tInstall all packages." 1>&2- echo -e "-n=code_name\t\tSpecifies the distro codename, for example bionic" 1>&2- echo -e "-h\t\t\tPrints this help." 1>&2- echo -e "-m=repo_base_url\tSpecifies the base URL from which to download." 1>&2- exit 1;-}--CURRENT_LLVM_STABLE=17-BASE_URL="http://apt.llvm.org"--# Check for required tools-needed_binaries=(lsb_release wget add-apt-repository gpg)-missing_binaries=()-for binary in "${needed_binaries[@]}"; do- if ! which $binary &>/dev/null ; then- missing_binaries+=($binary)- fi-done-if [[ ${#missing_binaries[@]} -gt 0 ]] ; then- echo "You are missing some tools this script requires: ${missing_binaries[@]}"- echo "(hint: apt install lsb-release wget software-properties-common gnupg)"- exit 4-fi--# Set default values for commandline arguments-# We default to the current stable branch of LLVM-LLVM_VERSION=$CURRENT_LLVM_STABLE-ALL=0-DISTRO=$(lsb_release -is)-VERSION=$(lsb_release -sr)-UBUNTU_CODENAME=""-CODENAME_FROM_ARGUMENTS=""-# Obtain VERSION_CODENAME and UBUNTU_CODENAME (for Ubuntu and its derivatives)-source /etc/os-release-DISTRO=${DISTRO,,}-case ${DISTRO} in- debian)- # Debian Trixie has a workaround because of- # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1038383- if [[ "${VERSION}" == "unstable" ]] || [[ "${VERSION}" == "testing" ]] || [[ "${VERSION_CODENAME}" == "trixie" ]]; then- CODENAME=unstable- LINKNAME=- else- # "stable" Debian release- CODENAME=${VERSION_CODENAME}- LINKNAME=-${CODENAME}- fi- ;;- *)- # ubuntu and its derivatives- if [[ -n "${UBUNTU_CODENAME}" ]]; then- CODENAME=${UBUNTU_CODENAME}- if [[ -n "${CODENAME}" ]]; then- LINKNAME=-${CODENAME}- fi- fi- ;;-esac--# read optional command line arguments-if [ "$#" -ge 1 ] && [ "${1::1}" != "-" ]; then- if [ "$1" != "all" ]; then- LLVM_VERSION=$1- else- # special case for ./llvm.sh all- ALL=1- fi- OPTIND=2- if [ "$#" -ge 2 ]; then- if [ "$2" == "all" ]; then- # Install all packages- ALL=1- OPTIND=3- fi- fi-fi--while getopts ":hm:n:" arg; do- case $arg in- h)- usage- ;;- m)- BASE_URL=${OPTARG}- ;;- n)- CODENAME=${OPTARG}- if [[ "${CODENAME}" == "unstable" ]]; then- # link name does not apply to unstable repository- LINKNAME=- else- LINKNAME=-${CODENAME}- fi- CODENAME_FROM_ARGUMENTS="true"- ;;- esac-done--if [[ $EUID -ne 0 ]]; then- echo "This script must be run as root!"- exit 1-fi--declare -A LLVM_VERSION_PATTERNS-LLVM_VERSION_PATTERNS[9]="-9"-LLVM_VERSION_PATTERNS[10]="-10"-LLVM_VERSION_PATTERNS[11]="-11"-LLVM_VERSION_PATTERNS[12]="-12"-LLVM_VERSION_PATTERNS[13]="-13"-LLVM_VERSION_PATTERNS[14]="-14"-LLVM_VERSION_PATTERNS[15]="-15"-LLVM_VERSION_PATTERNS[16]="-16"-LLVM_VERSION_PATTERNS[17]="-17"-LLVM_VERSION_PATTERNS[18]=""--if [ ! ${LLVM_VERSION_PATTERNS[$LLVM_VERSION]+_} ]; then- echo "This script does not support LLVM version $LLVM_VERSION"- exit 3-fi--LLVM_VERSION_STRING=${LLVM_VERSION_PATTERNS[$LLVM_VERSION]}--# join the repository name-if [[ -n "${CODENAME}" ]]; then- REPO_NAME="deb ${BASE_URL}/${CODENAME}/ llvm-toolchain${LINKNAME}${LLVM_VERSION_STRING} main"-- # check if the repository exists for the distro and version- if ! wget -q --method=HEAD ${BASE_URL}/${CODENAME} &> /dev/null; then- if [[ -n "${CODENAME_FROM_ARGUMENTS}" ]]; then- echo "Specified codename '${CODENAME}' is not supported by this script."- else- echo "Distribution '${DISTRO}' in version '${VERSION}' is not supported by this script."- fi- exit 2- fi-fi---# install everything--if [[ ! -f /etc/apt/trusted.gpg.d/apt.llvm.org.asc ]]; then- # download GPG key once- wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc-fi--if [[ -z "`apt-key list 2> /dev/null | grep -i llvm`" ]]; then- # Delete the key in the old format- apt-key del AF4F7421-fi-add-apt-repository "${REPO_NAME}"-apt-get update-PKG="clang-$LLVM_VERSION lldb-$LLVM_VERSION lld-$LLVM_VERSION clangd-$LLVM_VERSION"-if [[ $ALL -eq 1 ]]; then- # same as in test-install.sh- # No worries if we have dups- PKG="$PKG clang-tidy-$LLVM_VERSION clang-format-$LLVM_VERSION clang-tools-$LLVM_VERSION llvm-$LLVM_VERSION-dev lld-$LLVM_VERSION lldb-$LLVM_VERSION llvm-$LLVM_VERSION-tools libomp-$LLVM_VERSION-dev libc++-$LLVM_VERSION-dev libc++abi-$LLVM_VERSION-dev libclang-common-$LLVM_VERSION-dev libclang-$LLVM_VERSION-dev libclang-cpp$LLVM_VERSION-dev libunwind-$LLVM_VERSION-dev"- if test $LLVM_VERSION -gt 14; then- PKG="$PKG libclang-rt-$LLVM_VERSION-dev libpolly-$LLVM_VERSION-dev"- fi-fi-apt-get install -y $PKGdiff --git a/android/buildscripts/package-symbols.sh b/android/buildscripts/package-symbols.shdeleted file mode 100755index 65ea6c9..0000000--- a/android/buildscripts/package-symbols.sh+++ /dev/null@@ -1,4 +0,0 @@-#!/bin/bash--rm -f symbols.7z-7z a symbols.7z symbolsdiff --git a/android/buildscripts/patches/bullet-fix-cmake.patch b/android/buildscripts/patches/bullet-fix-cmake.patchdeleted file mode 100644index 9d32563..0000000--- a/android/buildscripts/patches/bullet-fix-cmake.patch+++ /dev/null@@ -1,12 +0,0 @@-diff -ur a/build3/cmake/FindPythonLibs.cmake b/build3/cmake/FindPythonLibs.cmake---- a/build3/cmake/FindPythonLibs.cmake-+++ b/build3/cmake/FindPythonLibs.cmake-@@ -112,7 +112,7 @@-- message(STATUS "Looking for versions: ${_PYTHON_VERSIONS}")--- FIND_FILE(_FIND_LIB_PYTHON_PY FindLibPython.py PATHS ${CMAKE_MODULE_PATH} ${CMAKE_ROOT}/Modules)-+ FIND_FILE(_FIND_LIB_PYTHON_PY FindLibPython.py PATHS ${CMAKE_MODULE_PATH} ${CMAKE_ROOT}/Modules CMAKE_FIND_ROOT_PATH_BOTH)-- if(NOT _FIND_LIB_PYTHON_PY)- message(FATAL_ERROR "Could not find required file 'FindLibPython.py'")diff --git a/android/buildscripts/patches/clang++-ccache.sh b/android/buildscripts/patches/clang++-ccache.shdeleted file mode 100755index d007231..0000000--- a/android/buildscripts/patches/clang++-ccache.sh+++ /dev/null@@ -1,3 +0,0 @@-#!/bin/bash--ccache `dirname $0`/clangX++ "$@"diff --git a/android/buildscripts/patches/clang-ccache.sh b/android/buildscripts/patches/clang-ccache.shdeleted file mode 100755index 4d33873..0000000--- a/android/buildscripts/patches/clang-ccache.sh+++ /dev/null@@ -1,3 +0,0 @@-#!/bin/bash--ccache `dirname $0`/clangX "$@"diff --git a/android/buildscripts/patches/gas-preprocessor.pl b/android/buildscripts/patches/gas-preprocessor.pldeleted file mode 100755index 3787756..0000000--- a/android/buildscripts/patches/gas-preprocessor.pl+++ /dev/null@@ -1,1179 +0,0 @@-#!/usr/bin/env perl-# by David Conrad-# This code is licensed under GPLv2 or later; go to gnu.org to read it-# (not that it much matters for an asm preprocessor)-# usage: set your assembler to be something like "perl gas-preprocessor.pl gcc"-use strict;--# Apple's gas is ancient and doesn't support modern preprocessing features like-# .rept and has ugly macro syntax, among other things. Thus, this script-# implements the subset of the gas preprocessor used by x264 and ffmpeg-# that isn't supported by Apple's gas.--my %canonical_arch = ("aarch64" => "aarch64", "arm64" => "aarch64",- "arm" => "arm",- "powerpc" => "powerpc", "ppc" => "powerpc");--my %comments = ("aarch64" => '//',- "arm" => '@',- "powerpc" => '#');--my @gcc_cmd;-my @preprocess_c_cmd;--my $comm;-my $arch;-my $as_type = "apple-gas";--my $fix_unreq = $^O eq "darwin";-my $force_thumb = 0;--my $arm_cond_codes = "eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|hs|lo";--my $usage_str = "-$0\n-Gas-preprocessor.pl converts assembler files using modern GNU as syntax for-Apple's ancient gas version or clang's incompatible integrated assembler. The-conversion is regularly tested for Libav, x264 and vlc. Other projects might-use different features which are not correctly handled.--Options for this program needs to be separated with ' -- ' from the assembler-command. Following options are currently supported:-- -help - this usage text- -arch - target architecture- -as-type - one value out of {{,apple-}{gas,clang},armasm}- -fix-unreq- -no-fix-unreq- -force-thumb - assemble as thumb regardless of the input source- (note, this is incomplete and only works for sources- it explicitly was tested with)-";--sub usage() {- print $usage_str;-}--while (@ARGV) {- my $opt = shift;-- if ($opt =~ /^-(no-)?fix-unreq$/) {- $fix_unreq = $1 ne "no-";- } elsif ($opt eq "-force-thumb") {- $force_thumb = 1;- } elsif ($opt eq "-arch") {- $arch = shift;- die "unknown arch: '$arch'\n" if not exists $canonical_arch{$arch};- } elsif ($opt eq "-as-type") {- $as_type = shift;- die "unknown as type: '$as_type'\n" if $as_type !~ /^((apple-)?(gas|clang)|armasm)$/;- } elsif ($opt eq "-help") {- usage();- exit 0;- } elsif ($opt eq "--" ) {- @gcc_cmd = @ARGV;- } elsif ($opt =~ /^-/) {- die "option '$opt' is not known. See '$0 -help' for usage information\n";- } else {- push @gcc_cmd, $opt, @ARGV;- }- last if (@gcc_cmd);-}--if (grep /\.c$/, @gcc_cmd) {- # C file (inline asm?) - compile- @preprocess_c_cmd = (@gcc_cmd, "-S");-} elsif (grep /\.[sS]$/, @gcc_cmd) {- # asm file, just do C preprocessor- @preprocess_c_cmd = (@gcc_cmd, "-E");-} elsif (grep /-(v|h|-version|dumpversion)/, @gcc_cmd) {- # pass -v/--version along, used during probing. Matching '-v' might have- # uninteded results but it doesn't matter much if gas-preprocessor or- # the compiler fails.- exec(@gcc_cmd);-} else {- die "Unrecognized input filetype";-}-if ($as_type eq "armasm") {-- $preprocess_c_cmd[0] = "cpp";- push(@preprocess_c_cmd, "-undef");- # Normally a preprocessor for windows would predefine _WIN32,- # but we're using any generic system-agnostic preprocessor "cpp"- # with -undef (to avoid getting predefined variables from the host- # system in cross compilation cases), so manually define it here.- push(@preprocess_c_cmd, "-D_WIN32");-- @preprocess_c_cmd = grep ! /^-nologo$/, @preprocess_c_cmd;- # Remove -ignore XX parameter pairs from preprocess_c_cmd- my $index = 1;- while ($index < $#preprocess_c_cmd) {- if ($preprocess_c_cmd[$index] eq "-ignore" and $index + 1 < $#preprocess_c_cmd) {- splice(@preprocess_c_cmd, $index, 2);- next;- }- $index++;- }- if (grep /^-MM$/, @preprocess_c_cmd) {- system(@preprocess_c_cmd) == 0 or die "Error running preprocessor";- exit 0;- }-}--# if compiling, avoid creating an output file named '-.o'-if ((grep /^-c$/, @gcc_cmd) && !(grep /^-o/, @gcc_cmd)) {- foreach my $i (@gcc_cmd) {- if ($i =~ /\.[csS]$/) {- my $outputfile = $i;- $outputfile =~ s/\.[csS]$/.o/;- push(@gcc_cmd, "-o");- push(@gcc_cmd, $outputfile);- last;- }- }-}-# replace only the '-o' argument with '-', avoids rewriting the make dependency-# target specified with -MT to '-'-my $index = 1;-while ($index < $#preprocess_c_cmd) {- if ($preprocess_c_cmd[$index] eq "-o") {- $index++;- $preprocess_c_cmd[$index] = "-";- }- $index++;-}--my $tempfile;-if ($as_type ne "armasm") {- @gcc_cmd = map { /\.[csS]$/ ? qw(-x assembler -) : $_ } @gcc_cmd;-} else {- @preprocess_c_cmd = grep ! /^-c$/, @preprocess_c_cmd;- @preprocess_c_cmd = grep ! /^-m/, @preprocess_c_cmd;-- @preprocess_c_cmd = grep ! /^-G/, @preprocess_c_cmd;- @preprocess_c_cmd = grep ! /^-W/, @preprocess_c_cmd;- @preprocess_c_cmd = grep ! /^-Z/, @preprocess_c_cmd;- @preprocess_c_cmd = grep ! /^-fp/, @preprocess_c_cmd;- @preprocess_c_cmd = grep ! /^-EHsc$/, @preprocess_c_cmd;- @preprocess_c_cmd = grep ! /^-O/, @preprocess_c_cmd;-- @gcc_cmd = grep ! /^-G/, @gcc_cmd;- @gcc_cmd = grep ! /^-W/, @gcc_cmd;- @gcc_cmd = grep ! /^-Z/, @gcc_cmd;- @gcc_cmd = grep ! /^-fp/, @gcc_cmd;- @gcc_cmd = grep ! /^-EHsc$/, @gcc_cmd;- @gcc_cmd = grep ! /^-O/, @gcc_cmd;-- my @outfiles = grep /\.(o|obj)$/, @gcc_cmd;- $tempfile = $outfiles[0].".asm";-- # Remove most parameters from gcc_cmd, which actually is the armasm command,- # which doesn't support any of the common compiler/preprocessor options.- @gcc_cmd = grep ! /^-D/, @gcc_cmd;- @gcc_cmd = grep ! /^-U/, @gcc_cmd;- @gcc_cmd = grep ! /^-m/, @gcc_cmd;- @gcc_cmd = grep ! /^-M/, @gcc_cmd;- @gcc_cmd = grep ! /^-c$/, @gcc_cmd;- @gcc_cmd = grep ! /^-I/, @gcc_cmd;- @gcc_cmd = map { /\.S$/ ? $tempfile : $_ } @gcc_cmd;-}--# detect architecture from gcc binary name-if (!$arch) {- if ($gcc_cmd[0] =~ /(arm64|aarch64|arm|powerpc|ppc)/) {- $arch = $1;- } else {- # look for -arch flag- foreach my $i (1 .. $#gcc_cmd-1) {- if ($gcc_cmd[$i] eq "-arch" and- $gcc_cmd[$i+1] =~ /(arm64|aarch64|arm|powerpc|ppc)/) {- $arch = $1;- }- }- }-}--# assume we're not cross-compiling if no -arch or the binary doesn't have the arch name-$arch = qx/arch/ if (!$arch);--die "Unknown target architecture '$arch'" if not exists $canonical_arch{$arch};--$arch = $canonical_arch{$arch};-$comm = $comments{$arch};-my $inputcomm = $comm;-$comm = ";" if $as_type =~ /armasm/;--my %ppc_spr = (ctr => 9,- vrsave => 256);--open(INPUT, "-|", @preprocess_c_cmd) || die "Error running preprocessor";--if ($ENV{GASPP_DEBUG}) {- open(ASMFILE, ">&STDOUT");-} else {- if ($as_type ne "armasm") {- open(ASMFILE, "|-", @gcc_cmd) or die "Error running assembler";- } else {- open(ASMFILE, ">", $tempfile);- }-}--my $current_macro = '';-my $macro_level = 0;-my $rept_level = 0;-my %macro_lines;-my %macro_args;-my %macro_args_default;-my $macro_count = 0;-my $altmacro = 0;-my $in_irp = 0;--my $num_repts;-my @rept_lines;--my @irp_args;-my $irp_param;--my @ifstack;--my %symbols;--my @sections;--my %literal_labels; # for ldr <reg>, =<expr>-my $literal_num = 0;-my $literal_expr = ".word";-$literal_expr = ".quad" if $arch eq "aarch64";--my $thumb = 0;--my %thumb_labels;-my %call_targets;-my %import_symbols;--my %neon_alias_reg;-my %neon_alias_type;--my $temp_label_next = 0;-my %last_temp_labels;-my %next_temp_labels;--my %labels_seen;--my %aarch64_req_alias;--if ($force_thumb) {- parse_line(".thumb\n");-}--# pass 1: parse .macro-# note that the handling of arguments is probably overly permissive vs. gas-# but it should be the same for valid cases-while (<INPUT>) {- # remove lines starting with '#', preprocessing is done, '#' at start of- # the line indicates a comment for all supported archs (aarch64, arm, ppc- # and x86). Also strips line number comments but since they are off anyway- # it is no loss.- s/^\s*#.*$//;- # remove all comments (to avoid interfering with evaluating directives)- s/(?<!\\)$inputcomm.*//x;- # Strip out windows linefeeds- s/\r$//;-- foreach my $subline (split(";", $_)) {- # Add newlines at the end of lines that don't already have one- chomp $subline;- $subline .= "\n";- parse_line($subline);- }-}--sub eval_expr {- my $expr = $_[0];- while ($expr =~ /([A-Za-z._][A-Za-z0-9._]*)/g) {- my $sym = $1;- $expr =~ s/$sym/($symbols{$sym})/ if defined $symbols{$sym};- }- eval $expr;-}--sub handle_if {- my $line = $_[0];- # handle .if directives; apple's assembler doesn't support important non-basic ones- # evaluating them is also needed to handle recursive macros- if ($line =~ /\.if(n?)([a-z]*)\s+(.*)/) {- my $result = $1 eq "n";- my $type = $2;- my $expr = $3;-- if ($type eq "b") {- $expr =~ s/\s//g;- $result ^= $expr eq "";- } elsif ($type eq "c") {- if ($expr =~ /(.*)\s*,\s*(.*)/) {- $result ^= $1 eq $2;- } else {- die "argument to .ifc not recognized";- }- } elsif ($type eq "") {- $result ^= eval_expr($expr) != 0;- } elsif ($type eq "eq") {- $result = eval_expr($expr) == 0;- } elsif ($type eq "lt") {- $result = eval_expr($expr) < 0;- } else {- chomp($line);- die "unhandled .if varient. \"$line\"";- }- push (@ifstack, $result);- return 1;- } else {- return 0;- }-}--sub parse_if_line {- my $line = $_[0];-- # evaluate .if blocks- if (scalar(@ifstack)) {- # Don't evaluate any new if statements if we're within- # a repetition or macro - they will be evaluated once- # the repetition is unrolled or the macro is expanded.- if (scalar(@rept_lines) == 0 and $macro_level == 0) {- if ($line =~ /\.endif/) {- pop(@ifstack);- return 1;- } elsif ($line =~ /\.elseif\s+(.*)/) {- if ($ifstack[-1] == 0) {- $ifstack[-1] = !!eval_expr($1);- } elsif ($ifstack[-1] > 0) {- $ifstack[-1] = -$ifstack[-1];- }- return 1;- } elsif ($line =~ /\.else/) {- $ifstack[-1] = !$ifstack[-1];- return 1;- } elsif (handle_if($line)) {- return 1;- }- }-- # discard lines in false .if blocks- foreach my $i (0 .. $#ifstack) {- if ($ifstack[$i] <= 0) {- return 1;- }- }- }- return 0;-}--sub parse_line {- my $line = $_[0];-- return if (parse_if_line($line));-- if (scalar(@rept_lines) == 0) {- if (/\.macro/) {- $macro_level++;- if ($macro_level > 1 && !$current_macro) {- die "nested macros but we don't have master macro";- }- } elsif (/\.endm/) {- $macro_level--;- if ($macro_level < 0) {- die "unmatched .endm";- } elsif ($macro_level == 0) {- $current_macro = '';- return;- }- }- }-- if ($macro_level == 0) {- if ($line =~ /\.(rept|irp)/) {- $rept_level++;- } elsif ($line =~ /.endr/) {- $rept_level--;- }- }-- if ($macro_level > 1) {- push(@{$macro_lines{$current_macro}}, $line);- } elsif (scalar(@rept_lines) and $rept_level >= 1) {- push(@rept_lines, $line);- } elsif ($macro_level == 0) {- expand_macros($line);- } else {- if ($line =~ /\.macro\s+([\d\w\.]+)\s*,?\s*(.*)/) {- $current_macro = $1;-- # commas in the argument list are optional, so only use whitespace as the separator- my $arglist = $2;- $arglist =~ s/,/ /g;-- my @args = split(/\s+/, $arglist);- foreach my $i (0 .. $#args) {- my @argpair = split(/=/, $args[$i]);- $macro_args{$current_macro}[$i] = $argpair[0];- $argpair[0] =~ s/:vararg$//;- $macro_args_default{$current_macro}{$argpair[0]} = $argpair[1];- }- # ensure %macro_lines has the macro name added as a key- $macro_lines{$current_macro} = [];-- } elsif ($current_macro) {- push(@{$macro_lines{$current_macro}}, $line);- } else {- die "macro level without a macro name";- }- }-}--sub handle_set {- my $line = $_[0];- if ($line =~ /\.(?:set|equ)\s+(\S*)\s*,\s*(.*)/) {- $symbols{$1} = eval_expr($2);- return 1;- }- return 0;-}--sub expand_macros {- my $line = $_[0];-- # handle .if directives; apple's assembler doesn't support important non-basic ones- # evaluating them is also needed to handle recursive macros- if (handle_if($line)) {- return;- }-- if (/\.purgem\s+([\d\w\.]+)/) {- delete $macro_lines{$1};- delete $macro_args{$1};- delete $macro_args_default{$1};- return;- }-- if ($line =~ /\.altmacro/) {- $altmacro = 1;- return;- }-- if ($line =~ /\.noaltmacro/) {- $altmacro = 0;- return;- }-- $line =~ s/\%([^,]*)/eval_expr($1)/eg if $altmacro;-- # Strip out the .set lines from the armasm output- return if (handle_set($line) and $as_type eq "armasm");-- if ($line =~ /\.rept\s+(.*)/) {- $num_repts = $1;- @rept_lines = ("\n");-- # handle the possibility of repeating another directive on the same line- # .endr on the same line is not valid, I don't know if a non-directive is- if ($num_repts =~ s/(\.\w+.*)//) {- push(@rept_lines, "$1\n");- }- $num_repts = eval_expr($num_repts);- } elsif ($line =~ /\.irp\s+([\d\w\.]+)\s*(.*)/) {- $in_irp = 1;- $num_repts = 1;- @rept_lines = ("\n");- $irp_param = $1;-- # only use whitespace as the separator- my $irp_arglist = $2;- $irp_arglist =~ s/,/ /g;- $irp_arglist =~ s/^\s+//;- @irp_args = split(/\s+/, $irp_arglist);- } elsif ($line =~ /\.irpc\s+([\d\w\.]+)\s*(.*)/) {- $in_irp = 1;- $num_repts = 1;- @rept_lines = ("\n");- $irp_param = $1;-- my $irp_arglist = $2;- $irp_arglist =~ s/,/ /g;- $irp_arglist =~ s/^\s+//;- @irp_args = split(//, $irp_arglist);- } elsif ($line =~ /\.endr/) {- my @prev_rept_lines = @rept_lines;- my $prev_in_irp = $in_irp;- my @prev_irp_args = @irp_args;- my $prev_irp_param = $irp_param;- my $prev_num_repts = $num_repts;- @rept_lines = ();- $in_irp = 0;- @irp_args = '';-- if ($prev_in_irp != 0) {- foreach my $i (@prev_irp_args) {- foreach my $origline (@prev_rept_lines) {- my $line = $origline;- $line =~ s/\\$prev_irp_param/$i/g;- $line =~ s/\\\(\)//g; # remove \()- parse_line($line);- }- }- } else {- for (1 .. $prev_num_repts) {- foreach my $origline (@prev_rept_lines) {- my $line = $origline;- parse_line($line);- }- }- }- } elsif ($line =~ /(\S+:|)\s*([\w\d\.]+)\s*(.*)/ && exists $macro_lines{$2}) {- handle_serialized_line($1);- my $macro = $2;-- # commas are optional here too, but are syntactically important because- # parameters can be blank- my @arglist = split(/,/, $3);- my @args;- my @args_seperator;-- my $comma_sep_required = 0;- foreach (@arglist) {- # allow arithmetic/shift operators in macro arguments- $_ =~ s/\s*(\+|-|\*|\/|<<|>>|<|>)\s*/$1/g;-- my @whitespace_split = split(/\s+/, $_);- if (!@whitespace_split) {- push(@args, '');- push(@args_seperator, '');- } else {- foreach (@whitespace_split) {- #print ("arglist = \"$_\"\n");- if (length($_)) {- push(@args, $_);- my $sep = $comma_sep_required ? "," : " ";- push(@args_seperator, $sep);- #print ("sep = \"$sep\", arg = \"$_\"\n");- $comma_sep_required = 0;- }- }- }-- $comma_sep_required = 1;- }-- my %replacements;- if ($macro_args_default{$macro}){- %replacements = %{$macro_args_default{$macro}};- }-- # construct hashtable of text to replace- foreach my $i (0 .. $#args) {- my $argname = $macro_args{$macro}[$i];- my @macro_args = @{ $macro_args{$macro} };- if ($args[$i] =~ m/=/) {- # arg=val references the argument name- # XXX: I'm not sure what the expected behaviour if a lot of- # these are mixed with unnamed args- my @named_arg = split(/=/, $args[$i]);- $replacements{$named_arg[0]} = $named_arg[1];- } elsif ($i > $#{$macro_args{$macro}}) {- # more args given than the macro has named args- # XXX: is vararg allowed on arguments before the last?- $argname = $macro_args{$macro}[-1];- if ($argname =~ s/:vararg$//) {- #print "macro = $macro, args[$i] = $args[$i], args_seperator=@args_seperator, argname = $argname, arglist[$i] = $arglist[$i], arglist = @arglist, args=@args, macro_args=@macro_args\n";- #$replacements{$argname} .= ", $args[$i]";- $replacements{$argname} .= "$args_seperator[$i] $args[$i]";- } else {- die "Too many arguments to macro $macro";- }- } else {- $argname =~ s/:vararg$//;- $replacements{$argname} = $args[$i];- }- }-- my $count = $macro_count++;-- # apply replacements as regex- foreach (@{$macro_lines{$macro}}) {- my $macro_line = $_;- # do replacements by longest first, this avoids wrong replacement- # when argument names are subsets of each other- foreach (reverse sort {length $a <=> length $b} keys %replacements) {- $macro_line =~ s/\\$_/$replacements{$_}/g;- }- if ($altmacro) {- foreach (reverse sort {length $a <=> length $b} keys %replacements) {- $macro_line =~ s/\b$_\b/$replacements{$_}/g;- }- }- $macro_line =~ s/\\\@/$count/g;- $macro_line =~ s/\\\(\)//g; # remove \()- parse_line($macro_line);- }- } else {- handle_serialized_line($line);- }-}--sub is_arm_register {- my $name = $_[0];- if ($name eq "lr" or- $name eq "ip" or- $name =~ /^[rav]\d+$/) {- return 1;- }- return 0;-}--sub is_aarch64_register {- my $name = $_[0];- if ($name =~ /^[xw]\d+$/) {- return 1;- }- return 0;-}--sub handle_local_label {- my $line = $_[0];- my $num = $_[1];- my $dir = $_[2];- my $target = "$num$dir";- if ($dir eq "b") {- $line =~ s/\b$target\b/$last_temp_labels{$num}/g;- } else {- my $name = "temp_label_$temp_label_next";- $temp_label_next++;- push(@{$next_temp_labels{$num}}, $name);- $line =~ s/\b$target\b/$name/g;- }- return $line;-}--sub handle_serialized_line {- my $line = $_[0];-- # handle .previous (only with regard to .section not .subsection)- if ($line =~ /\.(section|text|const_data)/) {- push(@sections, $line);- } elsif ($line =~ /\.previous/) {- if (!$sections[-2]) {- die ".previous without a previous section";- }- $line = $sections[-2];- push(@sections, $line);- }-- $thumb = 1 if $line =~ /\.code\s+16|\.thumb/;- $thumb = 0 if $line =~ /\.code\s+32|\.arm/;-- # handle ldr <reg>, =<expr>- if ($line =~ /(.*)\s*ldr([\w\s\d]+)\s*,\s*=(.*)/ and $as_type ne "armasm") {- my $label = $literal_labels{$3};- if (!$label) {- $label = "Literal_$literal_num";- $literal_num++;- $literal_labels{$3} = $label;- }- $line = "$1 ldr$2, $label\n";- } elsif ($line =~ /\.ltorg/ and $as_type ne "armasm") {- $line .= ".align 2\n";- foreach my $literal (keys %literal_labels) {- $line .= "$literal_labels{$literal}:\n $literal_expr $literal\n";- }- %literal_labels = ();- }-- # handle GNU as pc-relative relocations for adrp/add- if ($line =~ /(.*)\s*adrp([\w\s\d]+)\s*,\s*#?:pg_hi21:([^\s]+)/ and $as_type =~ /^apple-/) {- $line = "$1 adrp$2, ${3}\@PAGE\n";- } elsif ($line =~ /(.*)\s*add([\w\s\d]+)\s*,([\w\s\d]+)\s*,\s*#?:lo12:([^\s]+)/ and $as_type =~ /^apple-/) {- $line = "$1 add$2, $3, ${4}\@PAGEOFF\n";- }-- # thumb add with large immediate needs explicit add.w- if ($thumb and $line =~ /add\s+.*#([^@]+)/) {- $line =~ s/add/add.w/ if eval_expr($1) > 255;- }-- # mach-o local symbol names start with L (no dot)- $line =~ s/(?<!\w)\.(L\w+)/$1/g;-- # recycle the '.func' directive for '.thumb_func'- if ($thumb and $as_type =~ /^apple-/) {- $line =~ s/\.func/.thumb_func/x;- }-- if ($thumb and $line =~ /^\s*(\w+)\s*:/) {- $thumb_labels{$1}++;- }-- if ($as_type =~ /^apple-/ and- $line =~ /^\s*((\w+\s*:\s*)?bl?x?(..)?(?:\.w)?|\.global)\s+(\w+)/) {- my $cond = $3;- my $label = $4;- # Don't interpret e.g. bic as b<cc> with ic as conditional code- if ($cond =~ /^(|$arm_cond_codes)$/) {- if (exists $thumb_labels{$label}) {- print ASMFILE ".thumb_func $label\n";- } else {- $call_targets{$label}++;- }- }- }-- # @l -> lo16() @ha -> ha16()- $line =~ s/,\s+([^,]+)\@l\b/, lo16($1)/g;- $line =~ s/,\s+([^,]+)\@ha\b/, ha16($1)/g;-- # move to/from SPR- if ($line =~ /(\s+)(m[ft])([a-z]+)\s+(\w+)/ and exists $ppc_spr{$3}) {- if ($2 eq 'mt') {- $line = "$1${2}spr $ppc_spr{$3}, $4\n";- } else {- $line = "$1${2}spr $4, $ppc_spr{$3}\n";- }- }-- if ($line =~ /\.unreq\s+(.*)/) {- if (defined $neon_alias_reg{$1}) {- delete $neon_alias_reg{$1};- delete $neon_alias_type{$1};- return;- } elsif (defined $aarch64_req_alias{$1}) {- delete $aarch64_req_alias{$1};- return;- }- }- # old gas versions store upper and lower case names on .req,- # but they remove only one on .unreq- if ($fix_unreq) {- if ($line =~ /\.unreq\s+(.*)/) {- $line = ".unreq " . lc($1) . "\n";- $line .= ".unreq " . uc($1) . "\n";- }- }-- if ($line =~ /(\w+)\s+\.(dn|qn)\s+(\w+)(?:\.(\w+))?(\[\d+\])?/) {- $neon_alias_reg{$1} = "$3$5";- $neon_alias_type{$1} = $4;- return;- }- if (scalar keys %neon_alias_reg > 0 && $line =~ /^\s+v\w+/) {- # This line seems to possibly have a neon instruction- foreach (keys %neon_alias_reg) {- my $alias = $_;- # Require the register alias to match as an invididual word, not as a substring- # of a larger word-token.- if ($line =~ /\b$alias\b/) {- $line =~ s/\b$alias\b/$neon_alias_reg{$alias}/g;- # Add the type suffix. If multiple aliases match on the same line,- # only do this replacement the first time (a vfoo.bar string won't match v\w+).- $line =~ s/^(\s+)(v\w+)(\s+)/$1$2.$neon_alias_type{$alias}$3/;- }- }- }-- if ($arch eq "aarch64" or $as_type eq "armasm") {- # clang's integrated aarch64 assembler in Xcode 5 does not support .req/.unreq- if ($line =~ /\b(\w+)\s+\.req\s+(\w+)\b/) {- $aarch64_req_alias{$1} = $2;- return;- }- foreach (keys %aarch64_req_alias) {- my $alias = $_;- # recursively resolve aliases- my $resolved = $aarch64_req_alias{$alias};- while (defined $aarch64_req_alias{$resolved}) {- $resolved = $aarch64_req_alias{$resolved};- }- $line =~ s/\b$alias\b/$resolved/g;- }- }- if ($arch eq "aarch64") {- # fix missing aarch64 instructions in Xcode 5.1 (beta3)- # mov with vector arguments is not supported, use alias orr instead- if ($line =~ /^(\d+:)?\s*mov\s+(v\d[\.{}\[\]\w]+),\s*(v\d[\.{}\[\]\w]+)\b\s*$/) {- $line = "$1 orr $2, $3, $3\n";- }- # movi 16, 32 bit shifted variant, shift is optional- if ($line =~ /^(\d+:)?\s*movi\s+(v[0-3]?\d\.(?:2|4|8)[hsHS])\s*,\s*(#\w+)\b\s*$/) {- $line = "$1 movi $2, $3, lsl #0\n";- }- # Xcode 5 misses the alias uxtl. Replace it with the more general ushll.- # Clang 3.4 misses the alias sxtl too. Replace it with the more general sshll.- # armasm64 also misses these instructions.- if ($line =~ /^(\d+:)?\s*(s|u)xtl(2)?\s+(v[0-3]?\d\.[248][hsdHSD])\s*,\s*(v[0-3]?\d\.(?:2|4|8|16)[bhsBHS])\b\s*$/) {- $line = "$1 $2shll$3 $4, $5, #0\n";- }- # clang 3.4 and armasm64 do not automatically use shifted immediates in add/sub- if (($as_type eq "clang" or $as_type eq "armasm") and- $line =~ /^(\d+:)?(\s*(?:add|sub)s?) ([^#l]+)#([\d\+\-\*\/ <>]+)\s*$/) {- my $imm = eval $4;- if ($imm > 4095 and not ($imm & 4095)) {- $line = "$1 $2 $3#" . ($imm >> 12) . ", lsl #12\n";- }- }- if ($ENV{GASPP_FIX_XCODE5}) {- if ($line =~ /^\s*bsl\b/) {- $line =~ s/\b(bsl)(\s+v[0-3]?\d\.(\w+))\b/$1.$3$2/;- $line =~ s/\b(v[0-3]?\d)\.$3\b/$1/g;- }- if ($line =~ /^\s*saddl2?\b/) {- $line =~ s/\b(saddl2?)(\s+v[0-3]?\d\.(\w+))\b/$1.$3$2/;- $line =~ s/\b(v[0-3]?\d)\.\w+\b/$1/g;- }- if ($line =~ /^\s*dup\b.*\]$/) {- $line =~ s/\bdup(\s+v[0-3]?\d)\.(\w+)\b/dup.$2$1/g;- $line =~ s/\b(v[0-3]?\d)\.[bhsdBHSD](\[\d\])$/$1$2/g;- }- }- }-- if ($as_type eq "armasm") {- # Also replace variables set by .set- foreach (keys %symbols) {- my $sym = $_;- $line =~ s/\b$sym\b/$symbols{$sym}/g;- }-- # Handle function declarations and keep track of the declared labels- if ($line =~ s/^\s*\.func\s+(\w+)/$1 PROC/) {- $labels_seen{$1} = 1;- }-- if ($line =~ s/^\s*(\d+)://) {- # Convert local labels into unique labels. armasm (at least in- # RVCT) has something similar, but still different enough.- # By converting to unique labels we avoid any possible- # incompatibilities.-- my $num = $1;- foreach (@{$next_temp_labels{$num}}) {- $line = "$_\n" . $line;- }- @next_temp_labels{$num} = ();- my $name = "temp_label_$temp_label_next";- $temp_label_next++;- # The matching regexp above removes the label from the start of- # the line (which might contain an instruction as well), readd- # it on a separate line above it.- $line = "$name:\n" . $line;- $last_temp_labels{$num} = $name;- }-- if ($line =~ s/^\s*(\w+):/$1/) {- # Skip labels that have already been declared with a PROC,- # labels must not be declared multiple times.- return if (defined $labels_seen{$1});- $labels_seen{$1} = 1;- } elsif ($line !~ /(\w+) PROC/) {- # If not a label, make sure the line starts with whitespace,- # otherwise ms armasm interprets it incorrectly.- $line =~ s/^[\.\w]/\t$&/;- }--- # Check branch instructions- if ($line =~ /(?:^|\n)\s*(\w+\s*:\s*)?(bl?x?\.?(..)?(\.w)?)\s+(\w+)/) {- my $instr = $2;- my $cond = $3;- my $width = $4;- my $target = $5;- # Don't interpret e.g. bic as b<cc> with ic as conditional code- if ($cond !~ /^(|$arm_cond_codes)$/) {- # Not actually a branch- } elsif ($target =~ /^(\d+)([bf])$/) {- # The target is a local label- $line = handle_local_label($line, $1, $2);- $line =~ s/\b$instr\b/$&.w/ if $width eq "" and $arch eq "arm";- } elsif (($arch eq "arm" and !is_arm_register($target)) or- ($arch eq "aarch64" and !is_aarch64_register($target))) {- $call_targets{$target}++;- }- } elsif ($line =~ /(?:^|\n)\s*(\w+\s*:\s*)?(cbn?z|adr|tbz)\s+(\w+)\s*,(\s*#\d+\s*,)?\s*(\w+)/) {- my $instr = $2;- my $reg = $3;- my $bit = $4;- my $target = $5;- if ($target =~ /^(\d+)([bf])$/) {- # The target is a local label- $line = handle_local_label($line, $1, $2);- } else {- $call_targets{$target}++;- }- # Convert tbz with a wX register into an xX register,- # due to armasm64 bugs/limitations.- if ($instr eq "tbz" and $reg =~ /w\d+/) {- my $xreg = $reg;- $xreg =~ s/w/x/;- $line =~ s/\b$reg\b/$xreg/;- }- } elsif ($line =~ /^\s*.h?word.*\b\d+[bf]\b/) {- while ($line =~ /\b(\d+)([bf])\b/g) {- $line = handle_local_label($line, $1, $2);- }- }-- # ALIGN in armasm syntax is the actual number of bytes- if ($line =~ /\.(?:p2)?align\s+(\d+)/) {- my $align = 1 << $1;- $line =~ s/\.(?:p2)?align\s(\d+)/ALIGN $align/;- }- # Convert gas style [r0, :128] into armasm [r0@128] alignment specification- $line =~ s/\[([^\[,]+),?\s*:(\d+)\]/[$1\@$2]/g;-- # armasm treats logical values {TRUE} and {FALSE} separately from- # numeric values - logical operators and values can't be intermixed- # with numerical values. Evaluate !<number> and (a <> b) into numbers,- # let the assembler evaluate the rest of the expressions. This current- # only works for cases when ! and <> are used with actual constant numbers,- # we don't evaluate subexpressions here.-- # Evaluate !<number>- while ($line =~ /!\s*(\d+)/g) {- my $val = ($1 != 0) ? 0 : 1;- $line =~ s/!(\d+)/$val/;- }- # Evaluate (a > b)- while ($line =~ /\(\s*(\d+)\s*([<>])\s*(\d+)\s*\)/) {- my $val;- if ($2 eq "<") {- $val = ($1 < $3) ? 1 : 0;- } else {- $val = ($1 > $3) ? 1 : 0;- }- $line =~ s/\(\s*(\d+)\s*([<>])\s*(\d+)\s*\)/$val/;- }-- if ($arch eq "arm") {- # Change a movw... #:lower16: into a mov32 pseudoinstruction- $line =~ s/^(\s*)movw(\s+\w+\s*,\s*)\#:lower16:(.*)$/$1mov32$2$3/;- # and remove the following, matching movt completely- $line =~ s/^\s*movt\s+\w+\s*,\s*\#:upper16:.*$//;-- if ($line =~ /^\s*mov32\s+\w+,\s*([a-zA-Z]\w*)/) {- $import_symbols{$1}++;- }-- # Misc bugs/deficiencies:- # armasm seems unable to parse e.g. "vmov s0, s1" without a type- # qualifier, thus add .f32.- $line =~ s/^(\s+(?:vmov|vadd))(\s+s\d+\s*,\s*s\d+)/$1.f32$2/;- } elsif ($arch eq "aarch64") {- # Convert ext into ext8; armasm64 seems to require it named as ext8.- $line =~ s/^(\s+)ext(\s+)/$1ext8$2/;-- # Pick up targets from ldr x0, =sym+offset- if ($line =~ /^\s*ldr\s+(\w+)\s*,\s*=([a-zA-Z]\w*)(.*)$/) {- my $reg = $1;- my $sym = $2;- my $offset = eval_expr($3);- if ($offset < 0) {- # armasm64 is buggy with ldr x0, =sym+offset where the- # offset is a negative value; it does write a negative- # offset into the literal pool as it should, but the- # negative offset only covers the lower 32 bit of the 64- # bit literal/relocation.- # Thus remove the offset and apply it manually with a sub- # afterwards.- $offset = -$offset;- $line = "\tldr $reg, =$sym\n\tsub $reg, $reg, #$offset\n";- }- $import_symbols{$sym}++;- }-- # armasm64 (currently) doesn't support offsets on adrp targets,- # even though the COFF format relocations (and the linker)- # supports it. Therefore strip out the offsets from adrp and- # add :lo12: (in case future armasm64 would start handling it)- # and add an extra explicit add instruction for the offset.- if ($line =~ s/(adrp\s+\w+\s*,\s*(\w+))([\d\+\-\*\/\(\) <>]+)?/\1/) {- $import_symbols{$2}++;- }- if ($line =~ s/(add\s+(\w+)\s*,\s*\w+\s*,\s*):lo12:(\w+)([\d\+\-\*\/\(\) <>]+)?/\1\3/) {- my $reg = $2;- my $sym = $3;- my $offset = eval_expr($4);- $line .= "\tadd $reg, $reg, #$offset\n" if $offset > 0;- $import_symbols{$sym}++;- }-- # Convert e.g. "add x0, x0, w0, uxtw" into "add x0, x0, w0, uxtw #0",- # or "ldr x0, [x0, w0, uxtw]" into "ldr x0, [x0, w0, uxtw #0]".- $line =~ s/(uxtw|sxtw)(\s*\]?\s*)$/\1 #0\2/i;-- # Convert "mov x0, v0.d[0]" into "umov x0, v0.d[0]"- $line =~ s/\bmov\s+[xw]\d+\s*,\s*v\d+\.[ds]/u$&/i;-- # Convert "ccmp w0, #0, #0, ne" into "ccmpne w0, #0, #0",- # and "csel w0, w0, w0, ne" into "cselne w0, w0, w0".- $line =~ s/(ccmp|csel)\s+([xw]\w+)\s*,\s*([xw#]\w+)\s*,\s*([xw#]\w+)\s*,\s*($arm_cond_codes)/\1\5 \2, \3, \4/;-- # Convert "cinc w0, w0, ne" into "cincne w0, w0".- $line =~ s/(cinc)\s+([xw]\w+)\s*,\s*([xw]\w+)\s*,\s*($arm_cond_codes)/\1\4 \2, \3/;-- # Convert "cset w0, lo" into "csetlo w0"- $line =~ s/(cset)\s+([xw]\w+)\s*,\s*($arm_cond_codes)/\1\3 \2/;-- # Strip out prfum; armasm64 fails to assemble any- # variant/combination of prfum tested so far, but it can be- # left out without any- $line =~ s/prfum.*\]//;-- # Convert "ldrb w0, [x0, #-1]" into "ldurb w0, [x0, #-1]".- # Don't do this for forms with writeback though.- if ($line =~ /(ld|st)(r[bh]?)\s+(\w+)\s*,\s*\[\s*(\w+)\s*,\s*#([^\]]+)\s*\][^!]/) {- my $instr = $1;- my $suffix = $2;- my $target = $3;- my $base = $4;- my $offset = eval_expr($5);- if ($offset < 0) {- $line =~ s/$instr$suffix/${instr}u$suffix/;- }- }-- if ($ENV{GASPP_ARMASM64_INVERT_SCALE}) {- # Instructions like fcvtzs and scvtf store the scale value- # inverted in the opcode (stored as 64 - scale), but armasm64- # in early versions stores it as-is. Thus convert from- # "fcvtzs w0, s0, #8" into "fcvtzs w0, s0, #56".- if ($line =~ /(?:fcvtzs|scvtf)\s+(\w+)\s*,\s*(\w+)\s*,\s*#(\d+)/) {- my $scale = $3;- my $inverted_scale = 64 - $3;- $line =~ s/#$scale/#$inverted_scale/;- }- }- }- # armasm is unable to parse &0x - add spacing- $line =~ s/&0x/& 0x/g;- }-- if ($force_thumb) {- # Convert register post indexing to a separate add instruction.- # This converts e.g. "ldr r0, [r1], r2" into "ldr r0, [r1]",- # "add r1, r1, r2".- $line =~ s/((?:ldr|str)[bh]?)\s+(\w+),\s*\[(\w+)\],\s*(\w+)/$1 $2, [$3]\n\tadd $3, $3, $4/g;-- # Convert "mov pc, lr" into "bx lr", since the former only works- # for switching from arm to thumb (and only in armv7), but not- # from thumb to arm.- $line =~ s/mov\s*pc\s*,\s*lr/bx lr/g;-- # Convert stmdb/ldmia/stmfd/ldmfd/ldm with only one register into a plain str/ldr with post-increment/decrement.- # Wide thumb2 encoding requires at least two registers in register list while all other encodings support one register too.- $line =~ s/stm(?:db|fd)\s+sp!\s*,\s*\{([^,-]+)\}/str $1, [sp, #-4]!/g;- $line =~ s/ldm(?:ia|fd)?\s+sp!\s*,\s*\{([^,-]+)\}/ldr $1, [sp], #4/g;-- # Convert muls into mul+cmp- $line =~ s/muls\s+(\w+),\s*(\w+)\,\s*(\w+)/mul $1, $2, $3\n\tcmp $1, #0/g;-- # Convert "and r0, sp, #xx" into "mov r0, sp", "and r0, r0, #xx"- $line =~ s/and\s+(\w+),\s*(sp|r13)\,\s*#(\w+)/mov $1, $2\n\tand $1, $1, #$3/g;-- # Convert "ldr r0, [r0, r1, lsl #6]" where the shift is >3 (which- # can't be handled in thumb) into "add r0, r0, r1, lsl #6",- # "ldr r0, [r0]", for the special case where the same address is- # used as base and target for the ldr.- if ($line =~ /(ldr[bh]?)\s+(\w+),\s*\[\2,\s*(\w+),\s*lsl\s*#(\w+)\]/ and $4 > 3) {- $line =~ s/(ldr[bh]?)\s+(\w+),\s*\[\2,\s*(\w+),\s*lsl\s*#(\w+)\]/add $2, $2, $3, lsl #$4\n\t$1 $2, [$2]/;- }-- $line =~ s/\.arm/.thumb/x;- }-- # comment out unsupported directives- $line =~ s/\.type/$comm$&/x if $as_type =~ /^(apple-|armasm)/;- $line =~ s/\.func/$comm$&/x if $as_type =~ /^(apple-|clang)/;- $line =~ s/\.endfunc/$comm$&/x if $as_type =~ /^(apple-|clang)/;- $line =~ s/\.endfunc/ENDP/x if $as_type =~ /armasm/;- $line =~ s/\.ltorg/$comm$&/x if $as_type =~ /^(apple-|clang)/;- $line =~ s/\.ltorg/LTORG/x if $as_type eq "armasm";- $line =~ s/\.size/$comm$&/x if $as_type =~ /^(apple-|armasm)/;- $line =~ s/\.fpu/$comm$&/x if $as_type =~ /^(apple-|armasm)/;- $line =~ s/\.arch/$comm$&/x if $as_type =~ /^(apple-|clang|armasm)/;- $line =~ s/\.object_arch/$comm$&/x if $as_type =~ /^(apple-|armasm)/;- $line =~ s/.section\s+.note.GNU-stack.*/$comm$&/x if $as_type =~ /^(apple-|armasm)/;-- $line =~ s/\.syntax/$comm$&/x if $as_type =~ /armasm/;-- $line =~ s/\.hword/.short/x;-- if ($as_type =~ /^apple-/) {- # the syntax for these is a little different- $line =~ s/\.global/.globl/x;- # also catch .section .rodata since the equivalent to .const_data is .section __DATA,__const- $line =~ s/(.*)\.rodata/.const_data/x;- $line =~ s/\.int/.long/x;- $line =~ s/\.float/.single/x;- }- if ($as_type eq "apple-gas") {- $line =~ s/vmrs\s+APSR_nzcv/fmrx r15/x;- }- if ($as_type eq "armasm") {- $line =~ s/\.global/EXPORT/x;- $line =~ s/\.int/dcd/x;- $line =~ s/\.long/dcd/x;- $line =~ s/\.float/dcfs/x;- $line =~ s/\.word/dcd/x;- $line =~ s/\.short/dcw/x;- $line =~ s/\.byte/dcb/x;- $line =~ s/\.quad/dcq/x;- $line =~ s/\.ascii/dcb/x;- $line =~ s/\.asciz(.*)$/dcb\1,0/x;- $line =~ s/\.thumb/THUMB/x;- $line =~ s/\.arm/ARM/x;- # The alignment in AREA is the power of two, just as .align in gas- $line =~ s/\.text/AREA |.text|, CODE, READONLY, ALIGN=4, CODEALIGN/;- $line =~ s/(\s*)(.*)\.rodata/$1AREA |.rodata|, DATA, READONLY, ALIGN=5/;- $line =~ s/\.data/AREA |.data|, DATA, ALIGN=5/;- }- if ($as_type eq "armasm" and $arch eq "arm") {- $line =~ s/fmxr/vmsr/;- $line =~ s/fmrx/vmrs/;- $line =~ s/fadds/vadd.f32/;- }- if ($as_type eq "armasm" and $arch eq "aarch64") {- # Convert "b.eq" into "beq"- $line =~ s/\bb\.($arm_cond_codes)\b/b\1/;- }-- # catch unknown section names that aren't mach-o style (with a comma)- if ($as_type =~ /apple-/ and $line =~ /.section ([^,]*)$/) {- die ".section $1 unsupported; figure out the mach-o section name and add it";- }-- print ASMFILE $line;-}--if ($as_type ne "armasm") {- print ASMFILE ".text\n";- print ASMFILE ".align 2\n";- foreach my $literal (keys %literal_labels) {- print ASMFILE "$literal_labels{$literal}:\n $literal_expr $literal\n";- }-- map print(ASMFILE ".thumb_func $_\n"),- grep exists $thumb_labels{$_}, keys %call_targets;-} else {- map print(ASMFILE "\tIMPORT $_\n"),- grep ! exists $labels_seen{$_}, (keys %call_targets, keys %import_symbols);-- print ASMFILE "\tEND\n";-}--close(INPUT) or exit 1;-close(ASMFILE) or exit 1;-if ($as_type eq "armasm" and ! defined $ENV{GASPP_DEBUG}) {- system(@gcc_cmd) == 0 or die "Error running assembler";-}--END {- unlink($tempfile) if defined $tempfile;-}-#exit 1diff --git a/android/buildscripts/patches/gl4es/disable-shader-hacks.patch b/android/buildscripts/patches/gl4es/disable-shader-hacks.patchdeleted file mode 100644index 6c40480..0000000--- a/android/buildscripts/patches/gl4es/disable-shader-hacks.patch+++ /dev/null@@ -1,21 +0,0 @@-diff --git a/src/gl/shader_hacks.c b/src/gl/shader_hacks.c-index 2d068904..55056683 100644---- a/src/gl/shader_hacks.c-+++ b/src/gl/shader_hacks.c-@@ -486,6 +486,7 @@ static char* ShaderHacks_2(char* shader, char* Tmp, int* tmpsize)-- char* ShaderHacks(char* shader)- {-+/*- char* Tmp = shader;- int tmpsize = strlen(Tmp)+10;- // specific hacks-@@ -504,4 +505,6 @@ char* ShaderHacks(char* shader)- }- }- return Tmp;--}-\ No newline at end of file-+*/-+ return shader;-+}diff --git a/android/buildscripts/patches/gl4es/gamma-hack.patch b/android/buildscripts/patches/gl4es/gamma-hack.patchdeleted file mode 100644index d3310f7..0000000--- a/android/buildscripts/patches/gl4es/gamma-hack.patch+++ /dev/null@@ -1,51 +0,0 @@-diff --git a/src/gl/fpe_shader.c b/src/gl/fpe_shader.c-index dd6ad8d6..307d5cde 100755---- a/src/gl/fpe_shader.c-+++ b/src/gl/fpe_shader.c-@@ -1381,6 +1381,11 @@ const char* const* fpe_FragmentShader(shaderconv_need_t* need, fpe_state_t *stat- #endif- }--+ if(globals4es.gamma != 0.0) {-+ sprintf(buff, "fColor.rgb = pow(fColor.rgb, vec3(1.0/%f));\n", globals4es.gamma);-+ ShadAppend(buff);-+ }-+- //done- ShadAppend("gl_FragColor = fColor;\n");- ShadAppend("}");-diff --git a/src/gl/init.c b/src/gl/init.c-index e5c5b494..a609017f 100755---- a/src/gl/init.c-+++ b/src/gl/init.c-@@ -129,11 +129,11 @@ void initialize_gl4es() {- #ifdef USE_FBIO- env(LIBGL_VSYNC, globals4es.vsync, "vsync enabled");- #endif--#ifdef PANDORA-+- if(GetEnvVarFloat("LIBGL_GAMMA",&globals4es.gamma,0.0f)) {- SHUT_LOGD("Set gamma to %.2f\n", globals4es.gamma);- }--#endif-+- env(LIBGL_NOBGRA, globals4es.nobgra, "Ignore BGRA texture capability");- env(LIBGL_NOTEXRECT, globals4es.notexrect, "Don't export Text Rectangle extension");- if(globals4es.usefbo) {-diff --git a/src/gl/shaderconv.c b/src/gl/shaderconv.c-index b2f98285..f32d7341 100755---- a/src/gl/shaderconv.c-+++ b/src/gl/shaderconv.c-@@ -1202,6 +1202,12 @@ char* ConvertShader(const char* pEntry, int isVertex, shaderconv_need_t *need)- Tmp = InplaceReplace(Tmp, &tmpsize, "mat3x3", "mat3");- }--+ if(globals4es.gamma != 0.0) {-+ char shaderHack[200];-+ sprintf(shaderHack, "applyShadowDebugOverlay(); \n gl_FragData[0].xyz = pow(gl_FragData[0].xyz, vec3(1.0/%f));", globals4es.gamma);-+ Tmp = InplaceReplace(Tmp, &tmpsize, "applyShadowDebugOverlay();", shaderHack);-+ }-+- // finish- if((globals4es.dbgshaderconv&maskafter)==maskafter) {- printf("New Shader source:\n%s\n", Tmp);diff --git a/android/buildscripts/patches/gl4es/gamma.patch b/android/buildscripts/patches/gl4es/gamma.patchdeleted file mode 100644index 1228199..0000000--- a/android/buildscripts/patches/gl4es/gamma.patch+++ /dev/null@@ -1,43 +0,0 @@-diff --git a/src/gl/fpe.h b/src/gl/fpe.h-index 723f9328..268ce28a 100644---- a/src/gl/fpe.h-+++ b/src/gl/fpe.h-@@ -188,6 +188,7 @@ typedef struct fpe_state_s {- unsigned int fragment_prg_enable:1; // if fragment program is enabled- uint16_t vertex_prg_id; // Id of vertex program currently binded (0 most of the time), 16bits is more than enough...- uint16_t fragment_prg_id; // Id of fragment program currently binded (0 most of the time)-+ int16_t gamma;- } fpe_state_t;- #pragma pack()--diff --git a/src/gl/fpe_shader.c b/src/gl/fpe_shader.c-index 705d6ee6..9b99220a 100644---- a/src/gl/fpe_shader.c-+++ b/src/gl/fpe_shader.c-@@ -1377,6 +1377,11 @@ const char* const* fpe_FragmentShader(shaderconv_need_t* need, fpe_state_t *stat- #endif- }--+ if (state->gamma) {-+ sprintf(buff, "fColor.rgb = pow(fColor.rgb, vec3(1.0 / %.3f));\n", state->gamma / 100.0);-+ ShadAppend(buff);-+ }-+- //done- ShadAppend("gl_FragColor = fColor;\n");- ShadAppend("}");-diff --git a/src/gl/light.c b/src/gl/light.c-index 00527649..5f8ac7d5 100644---- a/src/gl/light.c-+++ b/src/gl/light.c-@@ -77,6 +77,10 @@ void APIENTRY_GL4ES gl4es_glLightModelfv(GLenum pname, const GLfloat* params) {- return;- } else gl4es_flush();- switch (pname) {-+ case 0x4242:-+ if (glstate->fpe_state)-+ glstate->fpe_state->gamma = params[0] * 100;-+ return;- case GL_LIGHT_MODEL_AMBIENT:- if(memcmp(glstate->light.ambient, params, 4*sizeof(GLfloat))==0) {- noerrorShim();diff --git a/android/buildscripts/patches/gl4es/gamma.patch-1.1.4 b/android/buildscripts/patches/gl4es/gamma.patch-1.1.4deleted file mode 100644index 522141c..0000000--- a/android/buildscripts/patches/gl4es/gamma.patch-1.1.4+++ /dev/null@@ -1,49 +0,0 @@-commit bc40a4836c9d915909eafb7906ca7812259380ba-Author: Ilya Zhuravlev <[email protected]>-Date: Sun Aug 30 18:05:49 2020 -0400-- Add a shader hack to allow modifying gamma value--diff --git a/src/gl/fpe.h b/src/gl/fpe.h-index e4ceb9c..2022808 100755---- a/src/gl/fpe.h-+++ b/src/gl/fpe.h-@@ -187,6 +187,7 @@ typedef struct fpe_state_s {- unsigned int fragment_prg_enable:1; // if fragment program is enabled- uint16_t vertex_prg_id; // Id of vertex program currently binded (0 most of the time), 16bits is more than enough...- uint16_t fragment_prg_id; // Id of fragment program currently binded (0 most of the time)-+ int16_t gamma;- }__attribute__((packed)) fpe_state_t;-- typedef struct fpe_fpe_s {-diff --git a/src/gl/fpe_shader.c b/src/gl/fpe_shader.c-index dd6ad8d..c716710 100755---- a/src/gl/fpe_shader.c-+++ b/src/gl/fpe_shader.c-@@ -1381,6 +1381,11 @@ const char* const* fpe_FragmentShader(shaderconv_need_t* need, fpe_state_t *stat- #endif- }--+ if (state->gamma) {-+ sprintf(buff, "fColor.rgb = pow(fColor.rgb, vec3(1.0 / %.3f));\n", state->gamma / 100.0);-+ ShadAppend(buff);-+ }-+- //done- ShadAppend("gl_FragColor = fColor;\n");- ShadAppend("}");-diff --git a/src/gl/light.c b/src/gl/light.c-index 54aeb4f..1f114a9 100755---- a/src/gl/light.c-+++ b/src/gl/light.c-@@ -77,6 +77,10 @@ void gl4es_glLightModelfv(GLenum pname, const GLfloat* params) {- return;- } else gl4es_flush();- switch (pname) {-+ case 0x4242:-+ if (glstate->fpe_state)-+ glstate->fpe_state->gamma = params[0] * 100;-+ return;- case GL_LIGHT_MODEL_AMBIENT:- if(memcmp(glstate->light.ambient, params, 4*sizeof(GLfloat))==0) {- noerrorShim();diff --git a/android/buildscripts/patches/gl4es/highp-fog.patch b/android/buildscripts/patches/gl4es/highp-fog.patchdeleted file mode 100644index e6ae111..0000000--- a/android/buildscripts/patches/gl4es/highp-fog.patch+++ /dev/null@@ -1,71 +0,0 @@-diff --git a/src/gl/fpe_shader.c b/src/gl/fpe_shader.c-index 705d6ee6..d819603c 100644---- a/src/gl/fpe_shader.c-+++ b/src/gl/fpe_shader.c-@@ -186,7 +186,7 @@ const char* const* fpe_VertexShader(shaderconv_need_t* need, fpe_state_t *state)- int cm_back_nullexp = state->cm_back_nullexp;- int texgens = 0;- int texmats = 0;-- const char* fogp = hardext.highp?"highp":"mediump";-+ const char* fogp = "highp";-- for (int i=0; i<hardext.maxtex; ++i) {- if(state->texgen[i].texgen_s || state->texgen[i].texgen_t || state->texgen[i].texgen_r || state->texgen[i].texgen_q)-@@ -836,7 +836,7 @@ const char* const* fpe_FragmentShader(shaderconv_need_t* need, fpe_state_t *stat- int texenv_combine = 0;- int texturing = 0;- char buff[1024];-- const char* fogp = hardext.highp?"highp":"mediump";-+ const char* fogp = "highp";--- strcpy(shad, fpeshader_signature);-@@ -1369,7 +1369,7 @@ const char* const* fpe_FragmentShader(shaderconv_need_t* need, fpe_state_t *stat- sprintf(buff, "%s float FogF = clamp(exp(-(gl_Fog.density * fog_c)*(gl_Fog.density * fog_c)), 0., 1.);\n", fogp);- break;- case FPE_FOG_LINEAR:-- sprintf(buff, "%s float FogF = clamp((gl_Fog.end - fog_c) %s, 0., 1.);\n", fogp, hardext.highp?"* gl_Fog.scale":"/ (gl_Fog.end - gl_Fog.start)");-+ sprintf(buff, "%s float FogF = clamp((gl_Fog.end - fog_c) * gl_Fog.scale, 0., 1.);\n", fogp);- break;- }- ShadAppend(buff);-diff --git a/src/gl/shaderconv.c b/src/gl/shaderconv.c-index e25ea8c3..839892a6 100644---- a/src/gl/shaderconv.c-+++ b/src/gl/shaderconv.c-@@ -196,15 +196,6 @@ static const char* gl4es_FogParametersSource =- "struct gl_FogParameters {\n"- " lowp vec4 color;\n"- " mediump float density;\n"--" mediump float start;\n"--" mediump float end;\n"--" mediump float scale;\n" // Derived: 1.0 / (end - start)--"};\n"--"uniform gl_FogParameters gl_Fog;\n";--static const char* gl4es_FogParametersSourceHighp =--"struct gl_FogParameters {\n"--" lowp vec4 color;\n"--" mediump float density;\n"- " highp float start;\n"- " highp float end;\n"- " highp float scale;\n" // Derived: 1.0 / (end - start)-@@ -890,8 +881,9 @@ char* ConvertShader(const char* pEntry, int isVertex, shaderconv_need_t *need)- if(builtin_matrix[i].matrix == MAT_MV) {- if(need->need_mvmatrix && !hardext.highp)- ishighp = 0;-- if(!hardext.highp && !isVertex)-+ if(/*!hardext.highp &&*/ !isVertex)- need->need_mvmatrix = 1;-+ ishighp = 1; //force this shit- }- if(builtin_matrix[i].matrix == MAT_MVP) {- if(need->need_mvpmatrix && !hardext.highp)-@@ -1029,7 +1021,7 @@ char* ConvertShader(const char* pEntry, int isVertex, shaderconv_need_t *need)- Tmp = InplaceReplace(Tmp, &tmpsize, "gl_Point", "_gl4es_Point");- if(strstr(Tmp, "gl_FogParameters") || strstr(Tmp, "gl_Fog"))- {-- Tmp = InplaceInsert(GetLine(Tmp, headline), hardext.highp?gl4es_FogParametersSourceHighp:gl4es_FogParametersSource, Tmp, &tmpsize);-+ Tmp = InplaceInsert(GetLine(Tmp, headline), gl4es_FogParametersSource, Tmp, &tmpsize);- headline+=CountLine(gl4es_FogParametersSource);- Tmp = InplaceReplace(Tmp, &tmpsize, "gl_FogParameters", "_gl4es_FogParameters");- }diff --git a/android/buildscripts/patches/gl4es/highp-fog.patch-1.1.4 b/android/buildscripts/patches/gl4es/highp-fog.patch-1.1.4deleted file mode 100644index a26c63f..0000000--- a/android/buildscripts/patches/gl4es/highp-fog.patch-1.1.4+++ /dev/null@@ -1,78 +0,0 @@-diff --git a/src/gl/fpe_shader.c b/src/gl/fpe_shader.c-index dd6ad8d6..42917960 100755---- a/src/gl/fpe_shader.c-+++ b/src/gl/fpe_shader.c-@@ -194,7 +194,7 @@ const char* const* fpe_VertexShader(shaderconv_need_t* need, fpe_state_t *state)- int cm_back_nullexp = state->cm_back_nullexp;- int texgens = 0;- int texmats = 0;-- const char* fogp = hardext.highp?"highp":"mediump";-+ const char* fogp = "highp";-- for (int i=0; i<hardext.maxtex; ++i) {- if(state->texgen[i].texgen_s || state->texgen[i].texgen_t || state->texgen[i].texgen_r || state->texgen[i].texgen_q)-@@ -836,7 +836,7 @@ const char* const* fpe_FragmentShader(shaderconv_need_t* need, fpe_state_t *stat- int texenv_combine = 0;- int texturing = 0;- char buff[1024];-- const char* fogp = hardext.highp?"highp":"mediump";-+ const char* fogp = "highp";--- strcpy(shad, fpeshader_signature);-@@ -1373,7 +1373,7 @@ const char* const* fpe_FragmentShader(shaderconv_need_t* need, fpe_state_t *stat- sprintf(buff, "%s float FogF = clamp(exp(-(gl_Fog.density * fog_c)*(gl_Fog.density * fog_c)), 0., 1.);\n", fogp);- break;- case FPE_FOG_LINEAR:-- sprintf(buff, "%s float FogF = clamp((gl_Fog.end - fog_c) %s, 0., 1.);\n", fogp, hardext.highp?"* gl_Fog.scale":"/ (gl_Fog.end - gl_Fog.start)");-+ sprintf(buff, "%s float FogF = clamp((gl_Fog.end - fog_c) * gl_Fog.scale, 0., 1.);\n", fogp);- break;- }- ShadAppend(buff);-diff --git a/src/gl/shaderconv.c b/src/gl/shaderconv.c-index b2f98285..2c0a8594 100755---- a/src/gl/shaderconv.c-+++ b/src/gl/shaderconv.c-@@ -195,15 +195,6 @@ static const char* gl4es_FogParametersSource =- "struct gl_FogParameters {\n"- " lowp vec4 color;\n"- " mediump float density;\n"--" mediump float start;\n"--" mediump float end;\n"--" mediump float scale;\n" // Derived: 1.0 / (end - start)--"};\n"--"uniform gl_FogParameters gl_Fog;\n";--static const char* gl4es_FogParametersSourceHighp =--"struct gl_FogParameters {\n"--" lowp vec4 color;\n"--" mediump float density;\n"- " highp float start;\n"- " highp float end;\n"- " highp float scale;\n" // Derived: 1.0 / (end - start)-@@ -874,8 +865,9 @@ char* ConvertShader(const char* pEntry, int isVertex, shaderconv_need_t *need)- if(builtin_matrix[i].matrix == MAT_MV) {- if(need->need_mvmatrix && !hardext.highp)- ishighp = 0;-- if(!hardext.highp && !isVertex)-+ if(/*!hardext.highp &&*/ !isVertex)- need->need_mvmatrix = 1;-+ ishighp = 1;- }- if(builtin_matrix[i].matrix == MAT_MVP) {- if(need->need_mvpmatrix && !hardext.highp)-@@ -1013,7 +1005,7 @@ char* ConvertShader(const char* pEntry, int isVertex, shaderconv_need_t *need)- Tmp = InplaceReplace(Tmp, &tmpsize, "gl_Point", "_gl4es_Point");- if(strstr(Tmp, "gl_FogParameters") || strstr(Tmp, "gl_Fog"))- {-- Tmp = InplaceInsert(GetLine(Tmp, headline), hardext.highp?gl4es_FogParametersSourceHighp:gl4es_FogParametersSource, Tmp, &tmpsize);-+ Tmp = InplaceInsert(GetLine(Tmp, headline), gl4es_FogParametersSource, Tmp, &tmpsize);- headline+=CountLine(gl4es_FogParametersSource);- Tmp = InplaceReplace(Tmp, &tmpsize, "gl_FogParameters", "_gl4es_FogParameters");- }-@@ -1303,4 +1295,4 @@ const char* builtinAttribInternalName(const char* name) {- return gl4es_VA[n];- }- return name;--}-\ No newline at end of file-+}diff --git a/android/buildscripts/patches/gl4es/psa.patch b/android/buildscripts/patches/gl4es/psa.patchdeleted file mode 100644index bf64a01..0000000--- a/android/buildscripts/patches/gl4es/psa.patch+++ /dev/null@@ -1,68 +0,0 @@-diff --git a/src/gl/hint.c b/src/gl/hint.c-index feef2e30..354a62fa 100644---- a/src/gl/hint.c-+++ b/src/gl/hint.c-@@ -12,6 +12,13 @@ void pandora_set_gamma();-- void APIENTRY_GL4ES gl4es_glHint(GLenum pname, GLenum mode) {--+//hack, save precomipled shader archive-+if(pname == 41231){-+ fpe_writePSA();-+ return;-+}-+-+- FLUSH_BEGINEND;-- LOAD_GLES(glHint);-@@ -132,4 +139,4 @@ void APIENTRY_GL4ES gl4es_glHint(GLenum pname, GLenum mode) {- gles_glHint(pname, mode);- }- }--AliasExport(void,glHint,,(GLenum pname, GLenum mode));-\ No newline at end of file-+AliasExport(void,glHint,,(GLenum pname, GLenum mode));-diff --git a/src/gl/init.c b/src/gl/init.c-index b182ba9b..c56eb9a0 100644---- a/src/gl/init.c-+++ b/src/gl/init.c-@@ -668,18 +668,14 @@ void initialize_gl4es() {- env(LIBGL_NOPSA, globals4es.nopsa, "Don't use PrecompiledShaderArchive");- if(globals4es.nopsa==0) {- cwd[0]='\0';-- // TODO: What to do on ANDROID and EMSCRIPTEN?--#ifdef __linux__-- const char* home = GetEnvVar("HOME");-- if(home)-- strcpy(cwd, home);-- if(cwd[strlen(cwd)]!='/')-- strcat(cwd, "/");--#elif defined AMIGAOS4-- strcpy(cwd, "PROGDIR:");--#endif-+-+ strcpy(cwd, GetEnvVar("OPENMW_USER_FILE_STORAGE"));-+- if(strlen(cwd)) {-- strcat(cwd, ".gl4es.psa");-+ if(globals4es.nohighp)-+ strcat(cwd, ".gl4es.psa-mediump");-+ else-+ strcat(cwd, ".gl4es.psa-highp");- fpe_InitPSA(cwd);- fpe_readPSA();- }-diff --git a/src/glx/hardext.c b/src/glx/hardext.c-index 6b8212ad..307c290b 100644---- a/src/glx/hardext.c-+++ b/src/glx/hardext.c-@@ -357,7 +357,7 @@ void GetHardwareExtensions(int notest)- gles_glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &hardext.maxvattrib);- SHUT_LOGD("Max vertex attrib: %d\n", hardext.maxvattrib);- S("GL_OES_standard_derivatives ", derivatives, 1);-- S("GL_OES_get_program ", prgbinary, 1);-+ S("GL_OES_get_program_binary ", prgbinary, 1);- if(hardext.prgbinary) {- gles_glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS_OES, &hardext.prgbin_n);- SHUT_LOGD("Number of supported Program Binary Format: %d\n", hardext.prgbin_n);diff --git a/android/buildscripts/patches/gl4es/psa.patch-1.1.4 b/android/buildscripts/patches/gl4es/psa.patch-1.1.4deleted file mode 100644index 842ccae..0000000--- a/android/buildscripts/patches/gl4es/psa.patch-1.1.4+++ /dev/null@@ -1,66 +0,0 @@-diff --git a/src/gl/hint.c b/src/gl/hint.c-index effb8dce..b35343db 100755---- a/src/gl/hint.c-+++ b/src/gl/hint.c-@@ -12,6 +12,12 @@ void pandora_set_gamma();-- void gl4es_glHint(GLenum pname, GLenum mode) {--+//hack, save precomipled shader archive-+if(pname == 41231){-+ fpe_writePSA();-+ return;-+}-+- FLUSH_BEGINEND;-- LOAD_GLES(glHint);-@@ -132,4 +138,4 @@ void gl4es_glHint(GLenum pname, GLenum mode) {- gles_glHint(pname, mode);- }- }--void glHint(GLenum pname, GLenum mode) AliasExport("gl4es_glHint");-\ No newline at end of file-+void glHint(GLenum pname, GLenum mode) AliasExport("gl4es_glHint");-diff --git a/src/gl/init.c b/src/gl/init.c-index e5c5b494..35ca1da9 100755---- a/src/gl/init.c-+++ b/src/gl/init.c-@@ -633,18 +633,13 @@ void initialize_gl4es() {- env(LIBGL_NOPSA, globals4es.nopsa, "Don't use PrecompiledShaderArchive");- if(globals4es.nopsa==0) {- cwd[0]='\0';-- // TODO: What to do on ANDROID and EMSCRIPTEN?--#ifdef __linux__-- const char* home = GetEnvVar("HOME");-- if(home)-- strcpy(cwd, home);-- if(cwd[strlen(cwd)]!='/')-- strcat(cwd, "/");--#elif defined AMIGAOS4-- strcpy(cwd, "PROGDIR:");--#endif-+-+ strcpy(cwd, GetEnvVar("OPENMW_USER_FILE_STORAGE"));- if(strlen(cwd)) {-- strcat(cwd, ".gl4es.psa");-+ if(globals4es.nohighp)-+ strcat(cwd, ".gl4es.psa-mediump");-+ else-+ strcat(cwd, ".gl4es.psa-highp");- fpe_InitPSA(cwd);- fpe_readPSA();- }-diff --git a/src/glx/hardext.c b/src/glx/hardext.c-index 9790fc3e..0df88455 100755---- a/src/glx/hardext.c-+++ b/src/glx/hardext.c-@@ -345,7 +345,7 @@ void GetHardwareExtensions(int notest)- gles_glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &hardext.maxvattrib);- SHUT_LOGD("Max vertex attrib: %d\n", hardext.maxvattrib);- S("GL_OES_standard_derivatives ", derivatives, 1);-- S("GL_OES_get_program ", prgbinary, 1);-+ S("GL_OES_get_program_binary ", prgbinary, 1);- if(hardext.prgbinary) {- gles_glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS_OES, &hardext.prgbin_n);- SHUT_LOGD("Number of supported Program Binary Format: %d\n", hardext.prgbin_n);diff --git a/android/buildscripts/patches/gl4es/shared-library.patch b/android/buildscripts/patches/gl4es/shared-library.patchdeleted file mode 100644index ed74820..0000000--- a/android/buildscripts/patches/gl4es/shared-library.patch+++ /dev/null@@ -1,26 +0,0 @@-diff --git a/Android.mk b/Android.mk-index 2290e5ac..888f516a 100644---- a/Android.mk-+++ b/Android.mk-@@ -92,13 +92,17 @@ LOCAL_SRC_FILES := \- LOCAL_CFLAGS += -g -std=gnu99 -funwind-tables -O3 -fvisibility=hidden -include include/android_debug.h- LOCAL_CFLAGS += -DNOX11- LOCAL_CFLAGS += -DNO_GBM--#LOCAL_CFLAGS += -DNO_INIT_CONSTRUCTOR-+LOCAL_CFLAGS += -DNO_INIT_CONSTRUCTOR-+LOCAL_CFLAGS += -DNOEGL-+LOCAL_CFLAGS += -DNO_LOADER- LOCAL_CFLAGS += -DDEFAULT_ES=2- //TODO: maybe temporary?- LOCAL_CFLAGS += -Wno-typedef-redefinition -Wno-dangling-else-+LOCAL_CFLAGS += -Dasm=__asm__ -Dvolatile=__volatile__-+LOCAL_CFLAGS += -include include/gl4esinit.h-- LOCAL_LDLIBS := -llog--#building as a static lib-+#building as a shared lib---LOCAL_CFLAGS += -DSTATICLIB--include $(BUILD_STATIC_LIBRARY)-+LOCAL_CFLAGS += -DSHAREDLIB-+include $(BUILD_SHARED_LIBRARY)diff --git a/android/buildscripts/patches/gl4es/shared-library.patch-1.1.4 b/android/buildscripts/patches/gl4es/shared-library.patch-1.1.4deleted file mode 100644index ed1563d..0000000--- a/android/buildscripts/patches/gl4es/shared-library.patch-1.1.4+++ /dev/null@@ -1,19 +0,0 @@-diff --git a/Android.mk b/Android.mk-index 51831b97..22f33a62 100755---- a/Android.mk-+++ b/Android.mk-@@ -91,11 +91,12 @@ LOCAL_SRC_FILES := \- LOCAL_CFLAGS += -g -std=c99 -funwind-tables -O3 -fvisibility=hidden -include include/android_debug.h- LOCAL_CFLAGS += -DNOX11- LOCAL_CFLAGS += -DNO_GBM-+LOCAL_CFLAGS += -Dasm=__asm__ -Dvolatile=__volatile__- #LOCAL_CFLAGS += -DNO_INIT_CONSTRUCTOR- #LOCAL_CFLAGS += -DDEFAULT_ES=2-- LOCAL_LDLIBS := -ldl -llog- #building as a static lib---LOCAL_CFLAGS += -DSTATICLIB--include $(BUILD_STATIC_LIBRARY)-+#LOCAL_CFLAGS += -DSTATICLIB-+include $(BUILD_SHARED_LIBRARY)diff --git a/android/buildscripts/patches/isowind/android-shaders.patch b/android/buildscripts/patches/isowind/android-shaders.patchdeleted file mode 100644index 6ad9a3f..0000000--- a/android/buildscripts/patches/isowind/android-shaders.patch+++ /dev/null@@ -1,681 +0,0 @@---- a/compatibility/bs/default.frag-+++ b/compatibility/bs/default.frag-@@ -72,7 +72,6 @@- if (!useTreeAnim)- gl_FragData[0].a *= diffuseColor.a;- gl_FragData[0].a = alphaTest(gl_FragData[0].a, alphaRef);--- vec3 specularColor = getSpecularColor().xyz;- #if @normalMap- vec4 normalTex = texture2D(normalMap, normalMapUV);-@@ -83,7 +82,7 @@- vec3 viewNormal = normalToView(normal);- specularColor *= normalTex.a;- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- float shadowing = unshadowedLightRatio(linearDepth);---- a/compatibility/bs/default.vert-+++ b/compatibility/bs/default.vert-@@ -69,7 +69,7 @@--- #if @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- setupShadowCoords(viewPos, viewNormal);- #endif- }---- a/compatibility/bs/nolighting.frag-+++ b/compatibility/bs/nolighting.frag-@@ -56,7 +56,6 @@- gl_FragData[0].a *= passFalloff;-- gl_FragData[0].a = alphaTest(gl_FragData[0].a, alphaRef);--- gl_FragData[0] = applyFogAtDist(gl_FragData[0], euclideanDepth, linearDepth, far);-- #if !defined(FORCE_OPAQUE) && @softParticles---- a/compatibility/bs/nolighting.vert-+++ b/compatibility/bs/nolighting.vert-@@ -63,7 +63,7 @@- }-- #if @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalize((gl_NormalMatrix * gl_Normal).xyz);- setupShadowCoords(viewPos, viewNormal);- #endif- }---- a/compatibility/debug.frag-+++ b/compatibility/debug.frag-@@ -4,7 +4,7 @@-- varying vec3 vertexNormal;---uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- void main()- {---- a/compatibility/debug.vert-+++ b/compatibility/debug.vert-@@ -6,7 +6,7 @@- uniform vec3 trans;- uniform vec3 scale;- uniform bool useNormalAsColor;--uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- centroid varying vec4 passColor;- varying vec3 vertexNormal;---- a/compatibility/fog.glsl-+++ b/compatibility/fog.glsl-@@ -1,3 +1,19 @@-+// OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG-+#ifdef OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG-+uniform vec4 omwFogColor;-+uniform float omwFogStart;-+uniform float omwFogEnd;-+#define OPENMW_FOG_START omwFogStart-+#define OPENMW_FOG_END omwFogEnd-+#define OPENMW_FOG_SCALE (1.0 / max(omwFogEnd - omwFogStart, 0.0001))-+#define OPENMW_FOG_COLOR omwFogColor-+#else-+#define OPENMW_FOG_START gl_Fog.start-+#define OPENMW_FOG_END gl_Fog.end-+#define OPENMW_FOG_SCALE gl_Fog.scale-+#define OPENMW_FOG_COLOR gl_Fog.color-+#endif-+- #if @skyBlending- #include "lib/core/fragment.h.glsl"--@@ -12,14 +28,14 @@- float dist = abs(linearDist);- #endif- #if @exponentialFog-- float fogValue = 1.0 - exp(-2.0 * max(0.0, dist - gl_Fog.start/2.0) / (gl_Fog.end - gl_Fog.start/2.0));-+ float fogValue = 1.0 - exp(-2.0 * max(0.0, dist - OPENMW_FOG_START/2.0) / (OPENMW_FOG_END - OPENMW_FOG_START/2.0));- #else-- float fogValue = clamp((dist - gl_Fog.start) * gl_Fog.scale, 0.0, 1.0);-+ float fogValue = clamp((dist - OPENMW_FOG_START) * OPENMW_FOG_SCALE, 0.0, 1.0);- #endif- #ifdef ADDITIVE_BLENDING- color.xyz *= 1.0 - fogValue;- #else-- color.xyz = mix(color.xyz, gl_Fog.color.xyz, fogValue);-+ color.xyz = mix(color.xyz, OPENMW_FOG_COLOR.xyz, fogValue);- #endif-- #if @skyBlending---- a/compatibility/fullscreen_tri.vert-+++ b/compatibility/fullscreen_tri.vert-@@ -1,6 +1,6 @@- #version 120---uniform vec2 scaling = vec2(1.0, 1.0);-+uniform vec2 scaling;-- varying vec2 uv;----- a/compatibility/groundcover.frag-+++ b/compatibility/groundcover.frag-@@ -57,7 +57,6 @@- gl_FragData[0].a *= 1.0-smoothstep(@groundcoverFadeStart, @groundcoverFadeEnd, euclideanDepth);-- gl_FragData[0].a = alphaTest(gl_FragData[0].a, alphaRef);--- #if @normalMap- vec4 normalTex = texture2D(normalMap, normalMapUV);- vec3 normal = normalTex.xyz * 2.0 - 1.0;---- a/compatibility/groundcover.vert-+++ b/compatibility/groundcover.vert-@@ -156,7 +156,7 @@- #endif-- #if (!PER_PIXEL_LIGHTING || @shadows_enabled)-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if @diffuseMap---- a/compatibility/objects.frag-+++ b/compatibility/objects.frag-@@ -85,9 +85,11 @@- varying vec4 passTangent;- #endif---#if @additiveBlending--#define ADDITIVE_BLENDING--#endif-+// OPENMW_ANDROID_051_GL4ES_DISABLE_ADDITIVE_FOG-+// Android/GL4ES compatibility: OpenMW's additive fog branch fades RGB toward-+// black instead of the scene fog colour. The stable 0.50 Android GL4ES patch-+// deliberately did not define ADDITIVE_BLENDING for compatibility/objects.frag.-+// Keep the same compatibility behaviour while diagnosing 0.51 forced shaders.-- #include "lib/core/fragment.h.glsl"- #include "lib/light/lighting.glsl"-@@ -96,6 +98,9 @@- #include "lib/util/distortion.glsl"- #include "lib/util/cutaway.glsl"--+// Android/GL4ES Patch 7: use authoritative OpenMW fog uniforms instead of-+// compatibility gl_Fog built-ins for ordinary NIF/object shaders only.-+#define OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG- #include "fog.glsl"- #include "vertexcolors.glsl"- #include "shadows_fragment.glsl"-@@ -164,7 +169,6 @@- #endif-- gl_FragData[0].a = alphaTest(gl_FragData[0].a, alphaRef);--- #if @normalMap- vec4 normalTex = texture2D(normalMap, normalMapUV + offset);- vec3 normal = normalTex.xyz * 2.0 - 1.0;-@@ -173,7 +177,7 @@- #endif- vec3 viewNormal = normalToView(normal);- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- vec3 viewVec = normalize(passViewPos);-@@ -248,7 +252,14 @@- gl_FragData[0].xyz += texture2D(emissiveMap, emissiveMapUV).xyz;- #endif--- gl_FragData[0] = applyFogAtPos(gl_FragData[0], passViewPos, far);-+ // OPENMW_ANDROID_051_LOCALMAP_OBJECT_FOG_BYPASS_V1-+ // LocalMapRenderToTexture sets screenRes=(1,1) and disables fog through-+ // its own osg/gl_Fog state. The Android/GL4ES ordinary-object path uses-+ // explicit omwFog* world-camera uniforms instead, so applying that fog to-+ // the orthographic LocalMap RTT washes Object/Static textures into the-+ // current world fog colour. Keep explicit fog everywhere except LocalMap.-+ if (screenRes.x > 1.5 || screenRes.y > 1.5)-+ gl_FragData[0] = applyFogAtPos(gl_FragData[0], passViewPos, far);- gl_FragData[0].xyz = applyCutawaySilhouette(gl_FragData[0].xyz, cutawaySilhouette);- // Faded by the top-down cutaway: OcclusionFader blends such objects- gl_FragData[0].a *= cutawayAlpha;---- a/compatibility/objects.vert-+++ b/compatibility/objects.vert-@@ -101,7 +101,7 @@- #endif-- #if @envMap || !PER_PIXEL_LIGHTING || @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if @envMap---- a/compatibility/shadowcasting.vert-+++ b/compatibility/shadowcasting.vert-@@ -6,13 +6,19 @@-- uniform int colorMode;- uniform bool useTreeAnim;--uniform bool useDiffuseMapForShadowAlpha = true;--uniform bool alphaTestShadows = true;-+uniform bool useDiffuseMapForShadowAlpha;-+uniform bool alphaTestShadows;-- void main(void)- {- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;--+ // OPENMW_ANDROID_051_GLES2_NATIVE_SHADOW_CLIPPING-+ // GL_DEPTH_CLAMP/ARB_clip_control are unavailable through the GLES2 backend.-+ // Deliberately use normal GLES2 near/far clipping here. Per-vertex Z-+ // clamping can collapse off-volume caster vertices onto a clip plane and-+ // produce large view-dependent triangular shadow projections.-+- vec4 viewPos = (gl_ModelViewMatrix * gl_Vertex);- gl_ClipVertex = viewPos;----- a/compatibility/shadows_fragment.glsl-+++ b/compatibility/shadows_fragment.glsl-@@ -1,11 +1,31 @@- #define SHADOWS @shadows_enabled--+// OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3-+// OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V6-+// V3 remains the primary plane. Geometry supplies a conditioned, one-sided-+// correction measured at each sampled texel, with a bounded depth budget.-+//-+// OPENMW_ANDROID_051_GLES2_MANUAL_SHADOW_COMPARE-+// GLES2/GL4ES: sample OES depth textures through sampler2D and perform-+// the LEQUAL test explicitly; EXT_shadow_samplers is not available.-+//-+// OPENMW_ANDROID_051_GLES2_QUALITY_PCF-+// The launcher specializes these two compile-time constants before each game-+// start. Keeping the kernel compile-time avoids dynamic loops/branches on GLES2.-+// Level 0 = legacy 1 tap, level 1 = 2x2 / 4 taps (Low),-+// level 2 = 3x3 / 9 taps (Medium), level 3 = 4x4 / 16 taps (High).-+// Level 4 = continuously weighted cubic 4x4 / 16 taps (Very High).-+#define OPENMW_ANDROID_SHADOW_PCF_LEVEL 2-+#define OPENMW_ANDROID_SHADOW_MAP_RESOLUTION 4096.0-+- #if SHADOWS- uniform float maximumShadowMapDistance;- uniform float shadowFadeStart;- @foreach shadow_texture_unit_index @shadow_texture_unit_list-- uniform sampler2DShadow shadowTexture@shadow_texture_unit_index;-+ uniform sampler2D shadowTexture@shadow_texture_unit_index;- varying vec4 shadowSpaceCoords@shadow_texture_unit_index;-+ // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V1-+ varying vec2 shadowReceiverPlaneSlope@shadow_texture_unit_index;-- #if @perspectiveShadowMaps- varying vec4 shadowRegionCoords@shadow_texture_unit_index;-@@ -13,10 +33,75 @@- @endforeach- #endif // SHADOWS--+float openmwAndroidReceiverDepthForOffset(float centerDepth, vec2 receiverPlaneSlope, vec2 texelSize, vec2 texelOffset)-+{-+ // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V1-+ // Receiver-plane depth bias (RPDB): neighbouring PCF taps must compare-+ // against the depth of the same geometric plane at the neighbouring UV,-+ // not against the centre fragment depth. This is the key fix for long-+ // shadow-acne bands and terrain-triangle artifacts at grazing sun angles.-+ return clamp(centerDepth + dot(receiverPlaneSlope, texelSize * texelOffset), 0.0, 1.0);-+}-+-+vec2 openmwAndroidGeometricReceiverPlaneSlopeV6(vec3 shadowXYZ, vec2 stableSlope)-+{-+ // Evaluate before distance/cascade branches. Normalize each derivative by-+ // its largest UV component before solving: an absolute determinant cutoff-+ // wrongly rejects valid small triangles and distant receivers.-+ vec3 dx = dFdx(shadowXYZ);-+ vec3 dy = dFdy(shadowXYZ);-+ float scaleX = max(abs(dx.x), abs(dx.y));-+ float scaleY = max(abs(dy.x), abs(dy.y));-+ dx /= max(scaleX, 1e-20);-+ dy /= max(scaleY, 1e-20);-+ float determinant = dx.x * dy.y - dy.x * dx.y;-+ float conditioning = abs(determinant) / max(length(dx.xy) * length(dy.xy), 1e-10);-+ if (scaleX < 1e-20 || scaleY < 1e-20 || conditioning <= 0.0001)-+ return stableSlope;-+-+ vec2 slope = vec2(dx.z * dy.y - dy.z * dx.y,-+ dy.z * dx.x - dx.z * dy.x) / determinant;-+ // Ease back to the interpolated plane near a singular light projection,-+ // instead of switching abruptly between unrelated slopes at the horizon.-+ float reliability = smoothstep(0.0001, 0.01, conditioning);-+ return mix(stableSlope, clamp(slope, vec2(-128.0), vec2(128.0)), reliability);-+}-+-+float openmwAndroidConservativeReceiverDepthV6(-+ float centerDepth,-+ vec2 stableSlope,-+ vec2 geometricSlope,-+ vec2 texelSize,-+ vec2 totalTexelOffset)-+{-+ // Smoothed rock normals are not the rasterized triangle plane. The V5-+ // fixed 0.00010 relief left a depth error at grazing angles, particularly-+ // at the outer PCF taps. Correct the actual signed error at this texel.-+ // Never raise the V3 comparison depth (the dark-facet regression in V4).-+ float stableDepth = openmwAndroidReceiverDepthForOffset(-+ centerDepth, stableSlope, texelSize, totalTexelOffset);-+ float geometricDepth = openmwAndroidReceiverDepthForOffset(-+ centerDepth, geometricSlope, texelSize, totalTexelOffset);-+ // Same maximum normalized-depth scale as the existing slope bias. The-+ // correction is zero when the planes agree; it is not a global offset or-+ // a sun-angle fade of real cast shadows. Singular projections use V3.-+ float oneSidedRelief = clamp(stableDepth - geometricDepth, 0.0, 0.0030);-+ return max(stableDepth - oneSidedRelief, 0.0);-+}-+- float unshadowedLightRatio(float distance)- {- float shadowing = 1.0;- #if SHADOWS-+ // All derivative evaluations precede even the fade early-return and the-+ // cascade-selection branch, so neighbouring fragments share control flow.-+ @foreach shadow_texture_unit_index @shadow_texture_unit_list-+ float receiverW@shadow_texture_unit_index = shadowSpaceCoords@shadow_texture_unit_index.w;-+ vec3 receiverXYZ@shadow_texture_unit_index = shadowSpaceCoords@shadow_texture_unit_index.xyz /-+ (abs(receiverW@shadow_texture_unit_index) > 1e-6 ? receiverW@shadow_texture_unit_index : 1e-6);-+ vec2 receiverGeometry@shadow_texture_unit_index = openmwAndroidGeometricReceiverPlaneSlopeV6(-+ receiverXYZ@shadow_texture_unit_index, shadowReceiverPlaneSlope@shadow_texture_unit_index);-+ @endforeach- #if @limitShadowMapDistance- float fade = clamp((distance - shadowFadeStart) / (maximumShadowMapDistance - shadowFadeStart), 0.0, 1.0);- if (fade == 1.0)-@@ -26,13 +111,164 @@- @foreach shadow_texture_unit_index @shadow_texture_unit_list- if (!doneShadows)- {-- vec3 shadowXYZ = shadowSpaceCoords@shadow_texture_unit_index.xyz / shadowSpaceCoords@shadow_texture_unit_index.w;-+ vec3 shadowXYZ = receiverXYZ@shadow_texture_unit_index;-+ vec2 stableReceiverPlaneSlope = shadowReceiverPlaneSlope@shadow_texture_unit_index;-+ vec2 geometricReceiverPlaneSlope = receiverGeometry@shadow_texture_unit_index;- #if @perspectiveShadowMaps- vec3 shadowRegionXYZ = shadowRegionCoords@shadow_texture_unit_index.xyz / shadowRegionCoords@shadow_texture_unit_index.w;- #endif- if (all(lessThan(shadowXYZ.xy, vec2(1.0, 1.0))) && all(greaterThan(shadowXYZ.xy, vec2(0.0, 0.0))))- {-- shadowing = min(shadow2DProj(shadowTexture@shadow_texture_unit_index, shadowSpaceCoords@shadow_texture_unit_index).r, shadowing);-+ // OPENMW_ANDROID_051_GLES2_SHADOW_COORD_BOUNDS-+ // Raw GLES2 depth sampling must never compare receivers outside-+ // the valid projected shadow depth volume. Otherwise z > 1 can-+ // become a view-dependent full-shadow patch with CLAMP_TO_EDGE.-+ if (shadowSpaceCoords@shadow_texture_unit_index.w > 0.0 && shadowXYZ.z > 0.0 && shadowXYZ.z < 1.0)-+ {-+ vec2 shadowTexel = vec2(1.0 / OPENMW_ANDROID_SHADOW_MAP_RESOLUTION);-+ // OPENMW_ANDROID_051_GLES2_RECEIVER_DEPTH_BIAS-+ // Retain the proven tiny fixed safety bias, then add only a-+ // tightly capped slope-scaled residual for the centre sample.-+ // Most grazing-angle correction happens per PCF tap through-+ // receiver-plane depth reconstruction below, so this does not-+ // require the large global offsets that cause Peter Panning.-+ float receiverDepth = max(shadowXYZ.z - 0.00005, 0.0);-+ vec2 receiverPlaneSlope = stableReceiverPlaneSlope;-+ // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3-+ // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V6-+ // Bounded residual after exact texel-centre reconstruction.-+ float receiverSlopeFootprint =-+ (abs(receiverPlaneSlope.x) + abs(receiverPlaneSlope.y)) * shadowTexel.x;-+ float receiverSlopeBias = min(receiverSlopeFootprint * 0.35, 0.0030);-+ receiverDepth = max(receiverDepth - receiverSlopeBias, 0.0);-+#if OPENMW_ANDROID_SHADOW_PCF_LEVEL == 0-+ // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3-+ vec2 shadowUv = (floor(shadowXYZ.xy * OPENMW_ANDROID_SHADOW_MAP_RESOLUTION) + vec2(0.5)) * shadowTexel;-+ shadowUv = clamp(shadowUv, shadowTexel, vec2(1.0) - shadowTexel);-+ vec2 anchorOffset = (shadowUv - shadowXYZ.xy) / shadowTexel;-+ float anchorReceiverDepth = openmwAndroidConservativeReceiverDepthV6(-+ receiverDepth,-+ receiverPlaneSlope,-+ geometricReceiverPlaneSlope,-+ shadowTexel,-+ anchorOffset);-+ shadowing = min(step(anchorReceiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv).r), shadowing);-+#elif OPENMW_ANDROID_SHADOW_PCF_LEVEL == 1-+ // Low: anchor half-texel taps on a real texel boundary so-+ // all four lookups land at actual texel centres.-+ vec2 shadowUv = floor(-+ shadowXYZ.xy * OPENMW_ANDROID_SHADOW_MAP_RESOLUTION + vec2(0.5)) * shadowTexel;-+ shadowUv = clamp(shadowUv, shadowTexel, vec2(1.0) - shadowTexel);-+ vec2 anchorOffset = (shadowUv - shadowXYZ.xy) / shadowTexel;-+ float anchorReceiverDepth = openmwAndroidConservativeReceiverDepthV6(-+ receiverDepth,-+ receiverPlaneSlope,-+ geometricReceiverPlaneSlope,-+ shadowTexel,-+ anchorOffset);-+ float pcfShadow = 0.0;-+ pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-0.5, -0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, -0.5)).r);-+ pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.5, -0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, -0.5)).r);-+ pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-0.5, 0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, 0.5)).r);-+ pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.5, 0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, 0.5)).r);-+ shadowing = min(pcfShadow * 0.25, shadowing);-+#elif OPENMW_ANDROID_SHADOW_PCF_LEVEL == 2-+ // Medium: snap the integer 3x3 kernel to the containing-+ // shadow texel centre and reconstruct depth from the original UV.-+ vec2 shadowUv = (floor(shadowXYZ.xy * OPENMW_ANDROID_SHADOW_MAP_RESOLUTION) + vec2(0.5)) * shadowTexel;-+ shadowUv = clamp(shadowUv, shadowTexel, vec2(1.0) - shadowTexel);-+ vec2 anchorOffset = (shadowUv - shadowXYZ.xy) / shadowTexel;-+ float anchorReceiverDepth = openmwAndroidConservativeReceiverDepthV6(-+ receiverDepth,-+ receiverPlaneSlope,-+ geometricReceiverPlaneSlope,-+ shadowTexel,-+ anchorOffset);-+ float pcfShadow = 0.0;-+ pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, -1.0)).r);-+ pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.0, -1.0)).r);-+ pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.0, -1.0)).r);-+ pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, 0.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, 0.0)).r);-+ pcfShadow += step(anchorReceiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv).r);-+ pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.0, 0.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.0, 0.0)).r);-+ pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, 1.0)).r);-+ pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.0, 1.0)).r);-+ pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.0, 1.0)).r);-+ shadowing = min(pcfShadow * (1.0 / 9.0), shadowing);-+#elif OPENMW_ANDROID_SHADOW_PCF_LEVEL == 3-+ // High: weighted 4x4 tent PCF at 4096.-+ // OPENMW_ANDROID_051_GLES2_TENT_PCF-+ // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3-+ // Anchor +/-0.5 and +/-1.5 samples on the nearest real-+ // texel boundary; all sixteen taps then hit distinct centres.-+ vec2 shadowMargin = shadowTexel * 2.0;-+ vec2 shadowUv = floor(-+ shadowXYZ.xy * OPENMW_ANDROID_SHADOW_MAP_RESOLUTION + vec2(0.5)) * shadowTexel;-+ shadowUv = clamp(shadowUv, shadowMargin, vec2(1.0) - shadowMargin);-+ vec2 anchorOffset = (shadowUv - shadowXYZ.xy) / shadowTexel;-+ float anchorReceiverDepth = openmwAndroidConservativeReceiverDepthV6(-+ receiverDepth,-+ receiverPlaneSlope,-+ geometricReceiverPlaneSlope,-+ shadowTexel,-+ anchorOffset);-+ float pcfShadow = 0.0;-+ pcfShadow += 1.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.5, -1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.5, -1.5)).r);-+ pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-0.5, -1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, -1.5)).r);-+ pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.5, -1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, -1.5)).r);-+ pcfShadow += 1.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.5, -1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.5, -1.5)).r);-+ pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.5, -0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.5, -0.5)).r);-+ pcfShadow += 9.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-0.5, -0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, -0.5)).r);-+ pcfShadow += 9.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.5, -0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, -0.5)).r);-+ pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.5, -0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.5, -0.5)).r);-+ pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.5, 0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.5, 0.5)).r);-+ pcfShadow += 9.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-0.5, 0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, 0.5)).r);-+ pcfShadow += 9.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.5, 0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, 0.5)).r);-+ pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.5, 0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.5, 0.5)).r);-+ pcfShadow += 1.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.5, 1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.5, 1.5)).r);-+ pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-0.5, 1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, 1.5)).r);-+ pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.5, 1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, 1.5)).r);-+ pcfShadow += 1.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.5, 1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.5, 1.5)).r);-+ shadowing = min(pcfShadow * (1.0 / 64.0), shadowing);-+#else-+ // OPENMW_ANDROID_051_CONTINUOUS_TENT_PCF_V1-+ // OPENMW_ANDROID_051_CUBIC_PCF_16_V3-+ // Cubic B-spline reconstruction has continuous coverage-+ // AND continuous first derivatives across texel boundaries.-+ // 16 samples, like High; no 36-tap outer skirt or contrast-+ // sharpening. Keep each axis normalized to 9 for the-+ // existing runtime validation contract (2D divisor 81).-+ vec2 grid = clamp(shadowXYZ.xy * OPENMW_ANDROID_SHADOW_MAP_RESOLUTION - vec2(0.5),-+ vec2(1.0), vec2(OPENMW_ANDROID_SHADOW_MAP_RESOLUTION - 3.0));-+ vec2 cell = floor(grid);-+ vec2 f = grid - cell;-+ vec2 g = vec2(1.0) - f;-+ vec2 w0 = g * g * g * 1.5;-+ vec2 w1 = (3.0 * f * f * f - 6.0 * f * f + vec2(4.0)) * 1.5;-+ vec2 w2 = (-3.0 * f * f * f + 3.0 * f * f + 3.0 * f + vec2(1.0)) * 1.5;-+ vec2 w3 = f * f * f * 1.5;-+ vec2 shadowUv = (cell + vec2(0.5)) * shadowTexel;-+ vec2 anchorOffset = (shadowUv - shadowXYZ.xy) / shadowTexel;-+ float pcfShadow = 0.0;-+ pcfShadow += w0.x * w0.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, -1.0)).r);-+ pcfShadow += w1.x * w0.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(0.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(0.0, -1.0)).r);-+ pcfShadow += w2.x * w0.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(1.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(1.0, -1.0)).r);-+ pcfShadow += w3.x * w0.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(2.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(2.0, -1.0)).r);-+ pcfShadow += w0.x * w1.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, 0.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, 0.0)).r);-+ pcfShadow += w1.x * w1.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(0.0, 0.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(0.0, 0.0)).r);-+ pcfShadow += w2.x * w1.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(1.0, 0.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(1.0, 0.0)).r);-+ pcfShadow += w3.x * w1.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(2.0, 0.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(2.0, 0.0)).r);-+ pcfShadow += w0.x * w2.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, 1.0)).r);-+ pcfShadow += w1.x * w2.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(0.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(0.0, 1.0)).r);-+ pcfShadow += w2.x * w2.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(1.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(1.0, 1.0)).r);-+ pcfShadow += w3.x * w2.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(2.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(2.0, 1.0)).r);-+ pcfShadow += w0.x * w3.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, 2.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, 2.0)).r);-+ pcfShadow += w1.x * w3.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(0.0, 2.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(0.0, 2.0)).r);-+ pcfShadow += w2.x * w3.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(1.0, 2.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(1.0, 2.0)).r);-+ pcfShadow += w3.x * w3.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(2.0, 2.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(2.0, 2.0)).r);-+ shadowing = min(pcfShadow * (1.0 / 81.0), shadowing);-+#endif-+ }-- doneShadows = all(lessThan(shadowXYZ, vec3(0.95, 0.95, 1.0))) && all(greaterThan(shadowXYZ, vec3(0.05, 0.05, 0.0)));- #if @perspectiveShadowMaps---- a/compatibility/shadows_vertex.glsl-+++ b/compatibility/shadows_vertex.glsl-@@ -4,6 +4,13 @@- @foreach shadow_texture_unit_index @shadow_texture_unit_list- uniform mat4 shadowSpaceMatrix@shadow_texture_unit_index;- varying vec4 shadowSpaceCoords@shadow_texture_unit_index;-+ // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V1-+ // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3-+ // Local receiver-plane depth slope in normalized shadow UV coordinates.-+ // The fragment shader uses this to move each PCF comparison onto the-+ // expected depth of the same receiver plane instead of comparing every-+ // neighbour against the centre depth.-+ varying vec2 shadowReceiverPlaneSlope@shadow_texture_unit_index;-- #if @perspectiveShadowMaps- uniform mat4 validRegionMatrix@shadow_texture_unit_index;-@@ -15,6 +22,55 @@- const bool onlyNormalOffsetUV = false;- #endif // SHADOWS--+#if SHADOWS-+vec2 openmwAndroidReceiverPlaneSlope(mat4 shadowMatrix, vec4 shadowCoord, vec3 viewNormal)-+{-+ // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V1-+ // Derivative-free receiver-plane depth bias for GLES2/GL4ES.-+ // Build two tangents on the receiver plane, project them into shadow-+ // coordinates and solve dz/du,dz/dv. This remains valid for the Android-+ // orthographic sun map and also handles homogeneous W conservatively.-+ float normalLength2 = dot(viewNormal, viewNormal);-+ if (normalLength2 < 1e-10 || abs(shadowCoord.w) < 1e-6)-+ return vec2(0.0);-+-+ vec3 n = viewNormal * inversesqrt(normalLength2);-+ vec3 helperAxis = abs(n.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(0.0, 1.0, 0.0);-+ vec3 tangentA = normalize(cross(helperAxis, n));-+ vec3 tangentB = cross(n, tangentA);-+-+ vec4 projectedA = shadowMatrix * vec4(tangentA, 0.0);-+ vec4 projectedB = shadowMatrix * vec4(tangentB, 0.0);-+-+ float invW = 1.0 / shadowCoord.w;-+ float invW2 = invW * invW;-+ vec3 deltaA = projectedA.xyz * invW - shadowCoord.xyz * projectedA.w * invW2;-+ vec3 deltaB = projectedB.xyz * invW - shadowCoord.xyz * projectedB.w * invW2;-+-+ float determinant = deltaA.x * deltaB.y - deltaB.x * deltaA.y;-+-+ // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3-+ // Use a scale-independent conditioning test. With the Android orthographic-+ // shadow range, valid UV basis determinants are naturally around 1e-8, so-+ // the previous absolute 1e-8 cutoff discarded ordinary terrain slopes.-+ float determinantScale = length(deltaA.xy) * length(deltaB.xy);-+ if (determinantScale < 1e-16)-+ return vec2(0.0);-+-+ float minimumDeterminant = determinantScale * 1e-5;-+ if (abs(determinant) < minimumDeterminant)-+ determinant = determinant < 0.0 ? -minimumDeterminant : minimumDeterminant;-+-+ vec2 receiverSlope = vec2(-+ (deltaA.z * deltaB.y - deltaB.z * deltaA.y) / determinant,-+ (deltaB.z * deltaA.x - deltaA.z * deltaB.x) / determinant-+ );-+-+ // Keep only the mathematically singular horizon case finite.-+ return clamp(receiverSlope, vec2(-128.0), vec2(128.0));-+}-+#endif-+- void setupShadowCoords(vec4 viewPos, vec3 viewNormal)- {- #if SHADOWS-@@ -42,6 +98,12 @@- shadowSpaceCoords@shadow_texture_unit_index = shadowSpaceMatrix@shadow_texture_unit_index * offsetViewPosition;- }- #endif-+-+ shadowReceiverPlaneSlope@shadow_texture_unit_index = openmwAndroidReceiverPlaneSlope(-+ shadowSpaceMatrix@shadow_texture_unit_index,-+ shadowSpaceCoords@shadow_texture_unit_index,-+ viewNormal-+ );- @endforeach- #endif // SHADOWS- }---- a/compatibility/terrain.frag-+++ b/compatibility/terrain.frag-@@ -74,7 +74,7 @@- #endif- vec3 viewNormal = normalToView(normal);- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- float shadowing = unshadowedLightRatio(linearDepth);---- a/compatibility/terrain.vert-+++ b/compatibility/terrain.vert-@@ -52,7 +52,7 @@- #endif-- #if !PER_PIXEL_LIGHTING || @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if !PER_PIXEL_LIGHTING---- a/compatibility/water.frag-+++ b/compatibility/water.frag-@@ -71,6 +71,7 @@-- varying vec4 position;- varying float linearDepth;-+varying vec4 screenPosition; // OPENMW_ANDROID_051_WATER_PROJECTIVE_SCREEN_COORDS-- uniform sampler2D normalMap;--@@ -98,7 +99,12 @@-- float shadow = unshadowedLightRatio(linearDepth);--- vec2 screenCoords = gl_FragCoord.xy / screenRes;-+ // OPENMW_ANDROID_051_WATER_PROJECTIVE_SCREEN_COORDS-+ // On Android custom resolutions, the shared screenRes uniform can briefly retain-+ // the host/native display size during startup. Derive normalized screen UV from-+ // the water vertex clip position instead, so reflection/refraction sampling is-+ // resolution-independent from the very first rendered frame.-+ vec2 screenCoords = (screenPosition.xy / screenPosition.w) * 0.5 + 0.5;-- #define waterTimer osg_SimulationTime--@@ -213,7 +219,14 @@- #endif-- gl_FragData[0].rgb = mix(refraction, reflection, fresnel);-+#if @wetWorldWaterMask-+ // OPENMW_ANDROID_051_WETWORLD_WATER_MASK-+ // Alpha is reserved as an exact post-processing water marker on Android.-+ // RGB shading and native rain-ripple lighting remain unchanged.-+ gl_FragData[0].a = 0.0;-+#else- gl_FragData[0].a = 1.0;-+#endif- // no alpha here, so make sure raindrop ripple specularity gets properly subdued- rainSpecular *= waterTransparency;- #else---- a/compatibility/water.vert-+++ b/compatibility/water.vert-@@ -4,6 +4,7 @@-- varying vec4 position;- varying float linearDepth;-+varying vec4 screenPosition; // OPENMW_ANDROID_051_WATER_PROJECTIVE_SCREEN_COORDS-- #include "shadows_vertex.glsl"- #include "lib/view/depth.glsl"-@@ -17,6 +18,7 @@- void main(void)- {- gl_Position = modelToClip(gl_Vertex);-+ screenPosition = gl_Position;-- position = gl_Vertex;-diff --git a/android/buildscripts/patches/libcollada-minizip-fix.patch b/android/buildscripts/patches/libcollada-minizip-fix.patchdeleted file mode 100644index 206c6fd..0000000--- a/android/buildscripts/patches/libcollada-minizip-fix.patch+++ /dev/null@@ -1,11 +0,0 @@---- dom/external-libs/minizip-1.1/ioapi.h 2021-11-14 15:14:43.676418790 +0100-+++ dom/external-libs/minizip-1.1/ioapi.h 2021-11-14 15:14:50.468378154 +0100-@@ -44,7 +44,7 @@- #include <stdlib.h>- #include "zlib.h"---#if defined(USE_FILE32API)-+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__ANDROID__)- #define fopen64 fopen- #define ftello64 ftell- #define fseeko64 fseekdiff --git a/android/buildscripts/patches/mygui-dont-set-debug-postfix.patch b/android/buildscripts/patches/mygui-dont-set-debug-postfix.patchdeleted file mode 100644index 9fab2d5..0000000--- a/android/buildscripts/patches/mygui-dont-set-debug-postfix.patch+++ /dev/null@@ -1,35 +0,0 @@-diff --git a/CMake/InstallResources.cmake b/CMake/InstallResources.cmake-index 12501726e..d6850e75d 100644---- a/CMake/InstallResources.cmake-+++ b/CMake/InstallResources.cmake-@@ -60,7 +60,7 @@ if (MYGUI_INSTALL_SAMPLES OR MYGUI_INSTALL_TOOLS)- else() # other OS only need one cfg file- string(TOLOWER "${CMAKE_BUILD_TYPE}" MYGUI_BUILD_TYPE)- if (MYGUI_BUILD_TYPE STREQUAL "debug" AND NOT APPLE)-- set(MYGUI_CFG_SUFFIX "_d")-+ # set(MYGUI_CFG_SUFFIX "_d")- endif ()- # create resources.xml- configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/resources.xml)-@@ -83,7 +83,7 @@ else ()- else() # other OS only need one cfg file- string(TOLOWER "${CMAKE_BUILD_TYPE}" MYGUI_BUILD_TYPE)- if (MYGUI_BUILD_TYPE STREQUAL "debug" AND NOT APPLE)-- set(MYGUI_CFG_SUFFIX "_d")-+ # set(MYGUI_CFG_SUFFIX "_d")- endif ()- # create resources.xml- configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/resources.xml)-diff --git a/CMakeLists.txt b/CMakeLists.txt-index 35658d989..0f5f9d3cd 100644---- a/CMakeLists.txt-+++ b/CMakeLists.txt-@@ -44,7 +44,7 @@ message(STATUS "Configuring MYGUI ${MYGUI_VERSION}")-- if (NOT APPLE)- # Create debug libraries with _d postfix-- set(CMAKE_DEBUG_POSTFIX "_d")-+ # set(CMAKE_DEBUG_POSTFIX "_d")- endif ()-- if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")diff --git a/android/buildscripts/patches/openmw/0001-loadingscreen-disable-for-now.patch b/android/buildscripts/patches/openmw/0001-loadingscreen-disable-for-now.patchdeleted file mode 100644index e29e70b..0000000--- a/android/buildscripts/patches/openmw/0001-loadingscreen-disable-for-now.patch+++ /dev/null@@ -1,25 +0,0 @@-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001-From: Ilya Zhuravlev <[email protected]>-Date: Sun, 10 Feb 2019 19:11:34 -0500-Subject: [PATCH] loadingscreen: disable for now------ apps/openmw/mwgui/loadingscreen.cpp | 2 ++- 1 file changed, 2 insertions(+)--diff --git a/apps/openmw/mwgui/loadingscreen.cpp b/apps/openmw/mwgui/loadingscreen.cpp-index a9480f261..091ed7c78 100644---- a/apps/openmw/mwgui/loadingscreen.cpp-+++ b/apps/openmw/mwgui/loadingscreen.cpp-@@ -293,6 +293,8 @@ namespace MWGui-- void LoadingScreen::setupCopyFramebufferToTextureCallback()- {-+ return;-+- // Copy the current framebuffer onto a texture and display that texture as the background image- // Note, we could also set the camera to disable clearing and have the background image transparent,- // but then we get shaking effects on buffer swaps.----2.19.2-diff --git a/android/buildscripts/patches/openmw/0009-windowmanagerimp-always-show-mouse-when-possible-pat.patch b/android/buildscripts/patches/openmw/0009-windowmanagerimp-always-show-mouse-when-possible-pat.patchdeleted file mode 100644index f7d0e5a..0000000--- a/android/buildscripts/patches/openmw/0009-windowmanagerimp-always-show-mouse-when-possible-pat.patch+++ /dev/null@@ -1,26 +0,0 @@-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001-From: Ilya Zhuravlev <[email protected]>-Date: Thu, 25 Apr 2019 06:35:09 -0400-Subject: [PATCH] windowmanagerimp: always show mouse when possible (patch by- @terabyte25)------ apps/openmw/mwgui/windowmanagerimp.cpp | 2 +-- 1 file changed, 1 insertion(+), 1 deletion(-)--diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp-index 1b271dfd5..8aaac51fa 100644---- a/apps/openmw/mwgui/windowmanagerimp.cpp-+++ b/apps/openmw/mwgui/windowmanagerimp.cpp-@@ -1708,7 +1708,7 @@ namespace MWGui-- bool WindowManager::getCursorVisible()- {-- return mCursorVisible && mCursorActive;-+ return mCursorVisible;- }-- void WindowManager::trackWindow(Layout *layout, const std::string &name)----2.19.2-diff --git a/android/buildscripts/patches/openmw/0010-android-fix-context-being-lost-on-app-minimize.patch b/android/buildscripts/patches/openmw/0010-android-fix-context-being-lost-on-app-minimize.patchdeleted file mode 100644index ba91678..0000000--- a/android/buildscripts/patches/openmw/0010-android-fix-context-being-lost-on-app-minimize.patch+++ /dev/null@@ -1,64 +0,0 @@-diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp-index 92483bd8c3..77fc0c6698 100644---- a/apps/openmw/engine.cpp-+++ b/apps/openmw/engine.cpp-@@ -457,6 +457,9 @@ void OMW::Engine::setSkipMenu(bool skipMenu, bool newGame)- mNewGame = newGame;- }--+// To share the viewer with Android interfaces-+osg::ref_ptr<osgViewer::Viewer> g_viewer;-+- void OMW::Engine::createWindow()- {- const int screen = Settings::video().mScreen;-@@ -661,6 +664,9 @@ void OMW::Engine::createWindow()-- mViewer->getEventQueue()->getCurrentEventState()->setWindowRectangle(- 0, 0, graphicsWindow->getTraits()->width, graphicsWindow->getTraits()->height);-+-+ // To share the viewer with Android interfaces-+ g_viewer = mViewer;- }-- void OMW::Engine::setWindowIcon()-@@ -1040,6 +1046,8 @@ void OMW::Engine::go()-- mLuaWorker->join();--+ g_viewer.release();-+- // Save user settings- Settings::Manager::saveUser(mCfgMgr.getUserConfigPath() / "settings.cfg");- Settings::ShaderManager::get().save();-diff --git a/components/debug/debugging.cpp b/components/debug/debugging.cpp-index 3be977657a..6c3dd611bf 100644---- a/components/debug/debugging.cpp-+++ b/components/debug/debugging.cpp-@@ -34,6 +34,8 @@-- #include <SDL_messagebox.h>--+#include <osgViewer/Viewer>-+- namespace Debug- {- #ifdef _WIN32-@@ -323,6 +325,8 @@ void setupLogging(const std::filesystem::path& logDir, std::string_view appName,- #endif- }--+extern osg::ref_ptr<osgViewer::Viewer> g_viewer;-+- int wrapApplication(int (*innerApplication)(int argc, char* argv[]), int argc, char* argv[], std::string_view appName)- {- #if defined _WIN32-@@ -362,6 +366,8 @@ int wrapApplication(int (*innerApplication)(int argc, char* argv[]), int argc, c- }- catch (const std::exception& e)- {-+ g_viewer.release();-+- #if (defined(__APPLE__) || defined(__linux) || defined(__unix) || defined(__posix))- if (!isatty(fileno(stdin)))- #endifdiff --git a/android/buildscripts/patches/openmw/0012-components-misc-stringops-use-boost-format-instead-o.patch b/android/buildscripts/patches/openmw/0012-components-misc-stringops-use-boost-format-instead-o.patchdeleted file mode 100644index e9cd9b6..0000000--- a/android/buildscripts/patches/openmw/0012-components-misc-stringops-use-boost-format-instead-o.patch+++ /dev/null@@ -1,29 +0,0 @@-diff --git a/components/misc/stringops.hpp b/components/misc/stringops.hpp-index fe4be0000..b89185919 100644---- a/components/misc/stringops.hpp-+++ b/components/misc/stringops.hpp-@@ -7,6 +7,7 @@- #include <string_view>- #include <iterator>- #include <functional>-+#include <boost/format.hpp>-- namespace Misc- {-@@ -167,13 +168,14 @@ public:- template <typename ... Args>- static std::string format(const char* fmt, Args const & ... args)- {-- auto size = std::snprintf(nullptr, 0, fmt, argument(args) ...);-+ /*auto size = std::snprintf(nullptr, 0, fmt, argument(args) ...);- // Note: sprintf also writes a trailing null character. We should remove it.- std::string ret(size+1, '\0');- std::sprintf(&ret[0], fmt, argument(args) ...);- ret.erase(size);--- return ret;-+ return ret;*/-+ return boost::str((boost::format(fmt) % ... % args));- }-- template <typename ... Args>diff --git a/android/buildscripts/patches/openmw/android_main.cpp b/android/buildscripts/patches/openmw/android_main.cppdeleted file mode 100644index c7361eb..0000000--- a/android/buildscripts/patches/openmw/android_main.cpp+++ /dev/null@@ -1,108 +0,0 @@-int stderr = 0; // Hack: fix linker error--#include "SDL_main.h"-#include "engine.hpp"-#include "mwbase/windowmanager.hpp"-#include <SDL_gamecontroller.h>-#include <SDL_mouse.h>-#include <SDL_events.h>-#include <SDL_hints.h>--#include <osg/GraphicsContext>-#include <osg/OperationThread>--/*******************************************************************************- Functions called by JNI- *******************************************************************************/-#include <jni.h>--/* Called before to initialize JNI bindings */--extern void SDL_Android_Init(JNIEnv* env, jclass cls);-extern int argcData;-extern const char **argvData;-void releaseArgv();---extern "C" int Java_org_libsdl_app_SDLActivity_getMouseX(JNIEnv *env, jclass cls, jobject obj) {- int ret = 0;- SDL_GetMouseState(&ret, nullptr);- return ret;-}---extern "C" int Java_org_libsdl_app_SDLActivity_getMouseY(JNIEnv *env, jclass cls, jobject obj) {- int ret = 0;- SDL_GetMouseState(nullptr, &ret);- return ret;-}--extern "C" int Java_org_libsdl_app_SDLActivity_isMouseShown(JNIEnv *env, jclass cls, jobject obj) {- return SDL_ShowCursor(SDL_QUERY);-}--extern SDL_Window *Android_Window;-extern "C" int SDL_SendMouseMotion(SDL_Window * window, int mouseID, int relative, int x, int y);-extern "C" void Java_org_libsdl_app_SDLActivity_sendRelativeMouseMotion(JNIEnv *env, jclass cls, int x, int y) {- SDL_SendMouseMotion(Android_Window, 0, 1, x, y);-}--extern "C" int SDL_SendMouseButton(SDL_Window * window, int mouseID, Uint8 state, Uint8 button);-extern "C" void Java_org_libsdl_app_SDLActivity_sendMouseButton(JNIEnv *env, jclass cls, int state, int button) {- SDL_SendMouseButton(Android_Window, 0, state, button);-}--extern "C" int Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject obj) {- setenv("OPENMW_DECOMPRESS_TEXTURES", "1", 1);-- // On Android, we use a virtual controller with guid="Virtual"- SDL_GameControllerAddMapping("5669727475616c000000000000000000,Virtual,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4");-- SDL_SetHint(SDL_HINT_ANDROID_BLOCK_ON_PAUSE, "0");- SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");-- return 0;-}--extern osg::ref_ptr<osgViewer::Viewer> g_viewer;-static osg::GraphicsContext *ctx;--class CtxReleaseOperation : public osg::Operation {-public:- virtual void operator () (osg::Object* caller) {- ctx->releaseContext();- }-};--class CtxAcquireOperation : public osg::Operation {-public:- virtual void operator () (osg::Object* caller) {- ctx->makeCurrent();- }-};--extern "C" void Java_org_libsdl_app_SDLActivity_omwSurfaceDestroyed(JNIEnv *env, jclass cls, jobject obj) {- if (!g_viewer)- return;-- osg::ref_ptr<CtxReleaseOperation> op = new CtxReleaseOperation();- ctx = g_viewer->getCamera()->getGraphicsContext();- ctx->add(op);-- auto win = (MWBase::WindowManager *)MWBase::Environment::get().getWindowManager();- if (win)- win->windowVisibilityChange(false);-}--extern "C" void Java_org_libsdl_app_SDLActivity_omwSurfaceRecreated(JNIEnv *env, jclass cls, jobject obj) {- if (!g_viewer)- return;-- osg::ref_ptr<CtxAcquireOperation> op = new CtxAcquireOperation();- ctx = g_viewer->getCamera()->getGraphicsContext();- ctx->add(op);-- auto win = (MWBase::WindowManager *)MWBase::Environment::get().getWindowManager();- if (win)- win->windowVisibilityChange(true);-}diff --git a/android/buildscripts/patches/openmw/cmakefix.patch b/android/buildscripts/patches/openmw/cmakefix.patchdeleted file mode 100644index 241a107..0000000--- a/android/buildscripts/patches/openmw/cmakefix.patch+++ /dev/null@@ -1,13 +0,0 @@-diff --git a/CMakeLists.txt b/CMakeLists.txt-index 34df0216da..0a23e009f5 100644---- a/CMakeLists.txt-+++ b/CMakeLists.txt-@@ -471,7 +471,7 @@ else(USE_LUAJIT)- find_package(Lua REQUIRED)- add_compile_definitions(NO_LUAJIT)- endif(USE_LUAJIT)--if (NOT WIN32)-+if (NOT ANDROID)- include(cmake/CheckLuaCustomAllocator.cmake)- endif()-diff --git a/android/buildscripts/patches/openmw/enablepost.patch b/android/buildscripts/patches/openmw/enablepost.patchdeleted file mode 100644index eaf3d9a..0000000--- a/android/buildscripts/patches/openmw/enablepost.patch+++ /dev/null@@ -1,13 +0,0 @@-diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp-index 1aaeb460b7d..d3f4ed092c3 100644---- a/apps/openmw/mwrender/postprocessor.cpp-+++ b/apps/openmw/mwrender/postprocessor.cpp-@@ -300,7 +300,7 @@ namespace MWRender- mCanvases[frameId]->setCalculateAvgLum(mHDR);-- mCanvases[frameId]->setTextureScene(getTexture(Tex_Scene, frameId));-- mCanvases[frameId]->setTextureDepth(getTexture(Tex_OpaqueDepth, frameId));-+ mCanvases[frameId]->setTextureDepth(getTexture(Tex_Depth, frameId));- mCanvases[frameId]->setTextureDistortion(getTexture(Tex_Distortion, frameId));-- mTransparentDepthPostPass->mFbo[frameId] = mFbos[frameId][FBO_Primary];diff --git a/android/buildscripts/patches/openmw/fix-build.patch b/android/buildscripts/patches/openmw/fix-build.patchdeleted file mode 100644index 54a23ce..0000000--- a/android/buildscripts/patches/openmw/fix-build.patch+++ /dev/null@@ -1,15 +0,0 @@-diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt-index 1c11825ef..a66c4d39b 100644---- a/apps/openmw/CMakeLists.txt-+++ b/apps/openmw/CMakeLists.txt-@@ -158,7 +158,9 @@ if(OSG_STATIC)- endif(OSG_STATIC)-- if (ANDROID)-- target_link_libraries(openmw EGL android log z)-+ find_package(OSGPlugins REQUIRED COMPONENTS ${USED_OSG_PLUGINS})-+ list(APPEND OPENSCENEGRAPH_LIBRARIES ${OSGPlugins_LIBRARIES})-+ target_link_libraries(openmw EGL android log z ${OPENSCENEGRAPH_LIBRARIES} freetype jpeg png)- endif (ANDROID)-- if (USE_SYSTEM_TINYXML)diff --git a/android/buildscripts/patches/openmw/fullshaders.patch b/android/buildscripts/patches/openmw/fullshaders.patchdeleted file mode 100644index f904b74..0000000--- a/android/buildscripts/patches/openmw/fullshaders.patch+++ /dev/null@@ -1,7467 +0,0 @@-From a7c29c99bfb0b842ffdefbfba3e1264b1ff77085 Mon Sep 17 00:00:00 2001-From: Duron27 <[email protected]>-Date: Thu, 15 Feb 2024 23:30:38 -0500-Subject: [PATCH] fixed sisahs patches for newest commit--yep----- apps/navmeshtool/CMakeLists.txt | 2 +-- apps/navmeshtool/main.cpp | 8 +-- apps/navmeshtool/main.cpp.orig | 260 +++- apps/navmeshtool/navmesh.cpp | 3 +- apps/navmeshtool/navmesh.hpp | 2 +- apps/openmw/CMakeLists.txt | 4 +- apps/openmw/engine.cpp | 3 +- apps/openmw/main.cpp | 14 +- apps/openmw/mwrender/luminancecalculator.cpp | 4 +-- apps/openmw/mwrender/npcanimation.cpp | 2 +-- apps/openmw/mwrender/postprocessor.cpp | 6 +-- apps/openmw/mwrender/postprocessor.cpp.orig | 840 ++++++++- apps/openmw/mwrender/renderingmanager.cpp | 4 +-- .../openmw/mwrender/renderingmanager.cpp.orig | 1767 +++++++++++++++++- apps/openmw/mwrender/transparentpass.cpp | 7 +-- apps/openmw/mwrender/water.cpp | 10 +-- apps/openmw/mwrender/water.cpp.orig | 907 +++++++++- components/debug/debugging.cpp | 2 +- components/fx/parse_constants.hpp | 5 +-- components/fx/pass.cpp | 2 +-- components/settings/categories/water.hpp | 1 +- components/shader/shadervisitor.cpp | 10 +- files/data/l10n/OMWEngine/en.yaml | 1 +- files/data/l10n/OMWEngine/en.yaml.orig | 180 ++- .../data/mygui/openmw_settings_window.layout | 14 +- .../mygui/openmw_settings_window.layout.orig | 729 +++++++- files/data/shaders/bloomlinear.omwfx | 10 +-- files/settings-default.cfg | 3 +- files/settings-default.cfg.orig | 1267 ++++++++++++- files/shaders/CMakeLists.txt | 1 +- files/shaders/compatibility/bs/default.frag | 2 +-- files/shaders/compatibility/bs/default.vert | 2 +-- .../shaders/compatibility/bs/nolighting.frag | 0- .../shaders/compatibility/bs/nolighting.vert | 2 +-- files/shaders/compatibility/debug.frag | 2 +-- files/shaders/compatibility/debug.vert | 2 +-- files/shaders/compatibility/depthclipped.frag | 0- files/shaders/compatibility/depthclipped.vert | 0- files/shaders/compatibility/fog.glsl | 0- .../shaders/compatibility/fullscreen_tri.frag | 0- .../shaders/compatibility/fullscreen_tri.vert | 2 +-- files/shaders/compatibility/groundcover.frag | 0- files/shaders/compatibility/groundcover.vert | 2 +-- files/shaders/compatibility/gui.frag | 0- files/shaders/compatibility/gui.vert | 0- .../compatibility/luminance/luminance.frag | 0- .../compatibility/luminance/resolve.frag | 0- .../compatibility/multiview_resolve.frag | 0- .../compatibility/multiview_resolve.vert | 0- files/shaders/compatibility/normals.glsl | 0- files/shaders/compatibility/objects.frag | 8 +-- files/shaders/compatibility/objects.vert | 2 +-- .../compatibility/ripples_blobber.frag | 0- .../compatibility/ripples_simulate.frag | 0- files/shaders/compatibility/s360.frag | 0- files/shaders/compatibility/s360.vert | 0- .../shaders/compatibility/shadowcasting.frag | 0- .../shaders/compatibility/shadowcasting.vert | 0- .../compatibility/shadows_fragment.glsl | 0- .../shaders/compatibility/shadows_vertex.glsl | 0- files/shaders/compatibility/sky.frag | 0- files/shaders/compatibility/sky.vert | 0- files/shaders/compatibility/terrain.frag | 2 +-- files/shaders/compatibility/terrain.vert | 2 +-- files/shaders/compatibility/vertexcolors.glsl | 0- files/shaders/compatibility/water.frag | 30 +-- files/shaders/compatibility/water.frag.orig | 255 +++- files/shaders/compatibility/water.vert | 0- files/shaders/core/gui.frag | 0- files/shaders/core/gui.vert | 0- files/shaders/core/ripples_blobber.comp | 0- files/shaders/core/ripples_simulate.comp | 0- files/shaders/lib/core/fragment.glsl | 0- .../shaders/lib/core/fragment_multiview.glsl | 0- files/shaders/lib/core/vertex.glsl | 0- files/shaders/lib/core/vertex.h.glsl | 20 +-- files/shaders/lib/core/vertex_multiview.glsl | 0- files/shaders/lib/light/lighting.glsl | 0- files/shaders/lib/light/lighting_util.glsl | 0- files/shaders/lib/luminance/constants.glsl | 0- files/shaders/lib/material/alpha.glsl | 0- files/shaders/lib/material/parallax.glsl | 0- files/shaders/lib/particle/occlusion.glsl | 0- files/shaders/lib/particle/soft.glsl | 0- files/shaders/lib/sky/passes.glsl | 0- files/shaders/lib/util/coordinates.glsl | 0- files/shaders/lib/util/distortion.glsl | 0- files/shaders/lib/util/quickstep.glsl | 0- files/shaders/lib/view/depth.glsl | 0- files/shaders/lib/water/fresnel.glsl | 0- files/shaders/lib/water/rain_ripples.glsl | 0- files/shaders/lib/water/rain_ripples_old.glsl | 126 ++- files/shaders/lib/water/ripples.glsl | 0- 93 files changed, 6461 insertions(+), 66 deletions(-)- create mode 100644 apps/navmeshtool/main.cpp.orig- create mode 100644 apps/openmw/mwrender/postprocessor.cpp.orig- create mode 100644 apps/openmw/mwrender/renderingmanager.cpp.orig- create mode 100644 apps/openmw/mwrender/water.cpp.orig- create mode 100644 files/data/l10n/OMWEngine/en.yaml.orig- create mode 100644 files/data/mygui/openmw_settings_window.layout.orig- mode change 100644 => 100755 files/data/shaders/bloomlinear.omwfx- create mode 100644 files/settings-default.cfg.orig- mode change 100644 => 100755 files/shaders/compatibility/bs/default.frag- mode change 100644 => 100755 files/shaders/compatibility/bs/default.vert- mode change 100644 => 100755 files/shaders/compatibility/bs/nolighting.frag- mode change 100644 => 100755 files/shaders/compatibility/bs/nolighting.vert- mode change 100644 => 100755 files/shaders/compatibility/debug.frag- mode change 100644 => 100755 files/shaders/compatibility/debug.vert- mode change 100644 => 100755 files/shaders/compatibility/depthclipped.frag- mode change 100644 => 100755 files/shaders/compatibility/depthclipped.vert- mode change 100644 => 100755 files/shaders/compatibility/fog.glsl- mode change 100644 => 100755 files/shaders/compatibility/fullscreen_tri.frag- mode change 100644 => 100755 files/shaders/compatibility/fullscreen_tri.vert- mode change 100644 => 100755 files/shaders/compatibility/groundcover.frag- mode change 100644 => 100755 files/shaders/compatibility/groundcover.vert- mode change 100644 => 100755 files/shaders/compatibility/gui.frag- mode change 100644 => 100755 files/shaders/compatibility/gui.vert- mode change 100644 => 100755 files/shaders/compatibility/luminance/luminance.frag- mode change 100644 => 100755 files/shaders/compatibility/luminance/resolve.frag- mode change 100644 => 100755 files/shaders/compatibility/multiview_resolve.frag- mode change 100644 => 100755 files/shaders/compatibility/multiview_resolve.vert- mode change 100644 => 100755 files/shaders/compatibility/normals.glsl- mode change 100644 => 100755 files/shaders/compatibility/objects.frag- mode change 100644 => 100755 files/shaders/compatibility/objects.vert- mode change 100644 => 100755 files/shaders/compatibility/ripples_blobber.frag- mode change 100644 => 100755 files/shaders/compatibility/ripples_simulate.frag- mode change 100644 => 100755 files/shaders/compatibility/s360.frag- mode change 100644 => 100755 files/shaders/compatibility/s360.vert- mode change 100644 => 100755 files/shaders/compatibility/shadowcasting.frag- mode change 100644 => 100755 files/shaders/compatibility/shadowcasting.vert- mode change 100644 => 100755 files/shaders/compatibility/shadows_fragment.glsl- mode change 100644 => 100755 files/shaders/compatibility/shadows_vertex.glsl- mode change 100644 => 100755 files/shaders/compatibility/sky.frag- mode change 100644 => 100755 files/shaders/compatibility/sky.vert- mode change 100644 => 100755 files/shaders/compatibility/terrain.frag- mode change 100644 => 100755 files/shaders/compatibility/terrain.vert- mode change 100644 => 100755 files/shaders/compatibility/vertexcolors.glsl- mode change 100644 => 100755 files/shaders/compatibility/water.frag- create mode 100755 files/shaders/compatibility/water.frag.orig- mode change 100644 => 100755 files/shaders/compatibility/water.vert- mode change 100644 => 100755 files/shaders/core/gui.frag- mode change 100644 => 100755 files/shaders/core/gui.vert- mode change 100644 => 100755 files/shaders/core/ripples_blobber.comp- mode change 100644 => 100755 files/shaders/core/ripples_simulate.comp- mode change 100644 => 100755 files/shaders/lib/core/fragment.glsl- mode change 100644 => 100755 files/shaders/lib/core/fragment_multiview.glsl- mode change 100644 => 100755 files/shaders/lib/core/vertex.glsl- mode change 100644 => 100755 files/shaders/lib/core/vertex.h.glsl- mode change 100644 => 100755 files/shaders/lib/core/vertex_multiview.glsl- mode change 100644 => 100755 files/shaders/lib/light/lighting.glsl- mode change 100644 => 100755 files/shaders/lib/light/lighting_util.glsl- mode change 100644 => 100755 files/shaders/lib/luminance/constants.glsl- mode change 100644 => 100755 files/shaders/lib/material/alpha.glsl- mode change 100644 => 100755 files/shaders/lib/material/parallax.glsl- mode change 100644 => 100755 files/shaders/lib/particle/occlusion.glsl- mode change 100644 => 100755 files/shaders/lib/particle/soft.glsl- mode change 100644 => 100755 files/shaders/lib/sky/passes.glsl- mode change 100644 => 100755 files/shaders/lib/util/coordinates.glsl- mode change 100644 => 100755 files/shaders/lib/util/distortion.glsl- mode change 100644 => 100755 files/shaders/lib/util/quickstep.glsl- mode change 100644 => 100755 files/shaders/lib/view/depth.glsl- mode change 100644 => 100755 files/shaders/lib/water/fresnel.glsl- mode change 100644 => 100755 files/shaders/lib/water/rain_ripples.glsl- create mode 100755 files/shaders/lib/water/rain_ripples_old.glsl- mode change 100644 => 100755 files/shaders/lib/water/ripples.glsl--diff --git a/apps/navmeshtool/CMakeLists.txt b/apps/navmeshtool/CMakeLists.txt-index 9abd8dc2833..35264ae55ce 100644---- a/apps/navmeshtool/CMakeLists.txt-+++ b/apps/navmeshtool/CMakeLists.txt-@@ -5,7 +5,7 @@ set(NAVMESHTOOL- )- source_group(apps\\navmeshtool FILES ${NAVMESHTOOL})---openmw_add_executable(openmw-navmeshtool ${NAVMESHTOOL})-+add_library(openmw-navmeshtool SHARED ${NAVMESHTOOL})-- target_link_libraries(openmw-navmeshtool- ${Boost_PROGRAM_OPTIONS_LIBRARY}-diff --git a/apps/navmeshtool/main.cpp b/apps/navmeshtool/main.cpp-index 3ec34114afb..4095064d47e 100644---- a/apps/navmeshtool/main.cpp-+++ b/apps/navmeshtool/main.cpp-@@ -51,8 +51,8 @@-- namespace NavMeshTool- {-- namespace-- {-+// namespace-+// {- namespace bpo = boost::program_options;-- using StringsVector = std::vector<std::string>;-@@ -251,10 +251,12 @@ namespace NavMeshTool-- return 0;- }-- }-+// }- }--+/*- int main(int argc, char* argv[])- {- return wrapApplication(NavMeshTool::runNavMeshTool, argc, argv, NavMeshTool::applicationName);- }-+*/-diff --git a/apps/navmeshtool/main.cpp.orig b/apps/navmeshtool/main.cpp.orig-new file mode 100644-index 00000000000..3ec34114afb---- /dev/null-+++ b/apps/navmeshtool/main.cpp.orig-@@ -0,0 +1,260 @@-+#include "navmesh.hpp"-+#include "worldspacedata.hpp"-+-+#include <components/debug/debugging.hpp>-+#include <components/debug/debuglog.hpp>-+#include <components/detournavigator/agentbounds.hpp>-+#include <components/detournavigator/collisionshapetype.hpp>-+#include <components/detournavigator/navmeshdb.hpp>-+#include <components/detournavigator/recastglobalallocator.hpp>-+#include <components/detournavigator/settings.hpp>-+#include <components/esm3/readerscache.hpp>-+#include <components/esm3/variant.hpp>-+#include <components/esmloader/esmdata.hpp>-+#include <components/esmloader/load.hpp>-+#include <components/fallback/fallback.hpp>-+#include <components/fallback/validate.hpp>-+#include <components/files/collections.hpp>-+#include <components/files/configurationmanager.hpp>-+#include <components/files/conversion.hpp>-+#include <components/files/multidircollection.hpp>-+#include <components/platform/platform.hpp>-+#include <components/resource/bulletshapemanager.hpp>-+#include <components/resource/imagemanager.hpp>-+#include <components/resource/niffilemanager.hpp>-+#include <components/resource/scenemanager.hpp>-+#include <components/settings/values.hpp>-+#include <components/to_utf8/to_utf8.hpp>-+#include <components/version/version.hpp>-+#include <components/vfs/manager.hpp>-+#include <components/vfs/registerarchives.hpp>-+-+#include <osg/Vec3f>-+-+#include <boost/program_options.hpp>-+-+#include <cstddef>-+#include <cstdint>-+#include <filesystem>-+#include <iostream>-+#include <map>-+#include <string>-+#include <thread>-+#include <type_traits>-+#include <utility>-+#include <vector>-+-+#ifdef WIN32-+#include <fcntl.h>-+#include <io.h>-+#endif-+-+namespace NavMeshTool-+{-+ namespace-+ {-+ namespace bpo = boost::program_options;-+-+ using StringsVector = std::vector<std::string>;-+-+ constexpr std::string_view applicationName = "NavMeshTool";-+-+ bpo::options_description makeOptionsDescription()-+ {-+ using Fallback::FallbackMap;-+-+ bpo::options_description result;-+ auto addOption = result.add_options();-+ addOption("help", "print help message");-+-+ addOption("version", "print version information and quit");-+-+ addOption("data",-+ bpo::value<Files::MaybeQuotedPathContainer>()-+ ->default_value(Files::MaybeQuotedPathContainer(), "data")-+ ->multitoken()-+ ->composing(),-+ "set data directories (later directories have higher priority)");-+-+ addOption("data-local",-+ bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(-+ Files::MaybeQuotedPathContainer::value_type(), ""),-+ "set local data directory (highest priority)");-+-+ addOption("fallback-archive",-+ bpo::value<StringsVector>()-+ ->default_value(StringsVector(), "fallback-archive")-+ ->multitoken()-+ ->composing(),-+ "set fallback BSA archives (later archives have higher priority)");-+-+ addOption("content",-+ bpo::value<StringsVector>()->default_value(StringsVector(), "")->multitoken()->composing(),-+ "content file(s): esm/esp, or omwgame/omwaddon/omwscripts");-+-+ addOption("encoding", bpo::value<std::string>()->default_value("win1252"),-+ "Character encoding used in OpenMW game messages:\n"-+ "\n\twin1250 - Central and Eastern European such as Polish, Czech, Slovak, Hungarian, Slovene, "-+ "Bosnian, Croatian, Serbian (Latin script), Romanian and Albanian languages\n"-+ "\n\twin1251 - Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages\n"-+ "\n\twin1252 - Western European (Latin) alphabet, used by default");-+-+ addOption("fallback",-+ bpo::value<Fallback::FallbackMap>()-+ ->default_value(Fallback::FallbackMap(), "")-+ ->multitoken()-+ ->composing(),-+ "fallback values");-+-+ addOption("threads",-+ bpo::value<std::size_t>()->default_value(-+ std::max<std::size_t>(std::thread::hardware_concurrency() - 1, 1)),-+ "number of threads for parallel processing");-+-+ addOption("process-interior-cells", bpo::value<bool>()->implicit_value(true)->default_value(false),-+ "build navmesh for interior cells");-+-+ addOption("remove-unused-tiles", bpo::value<bool>()->implicit_value(true)->default_value(false),-+ "remove tiles from cache that will not be used with current content profile");-+-+ addOption("write-binary-log", bpo::value<bool>()->implicit_value(true)->default_value(false),-+ "write progress in binary messages to be consumed by the launcher");-+-+ Files::ConfigurationManager::addCommonOptions(result);-+-+ return result;-+ }-+-+ int runNavMeshTool(int argc, char* argv[])-+ {-+ Platform::init();-+-+ bpo::options_description desc = makeOptionsDescription();-+-+ bpo::parsed_options options = bpo::command_line_parser(argc, argv).options(desc).allow_unregistered().run();-+ bpo::variables_map variables;-+-+ bpo::store(options, variables);-+ bpo::notify(variables);-+-+ if (variables.find("help") != variables.end())-+ {-+ getRawStdout() << desc << std::endl;-+ return 0;-+ }-+-+ Files::ConfigurationManager config;-+ config.readConfiguration(variables, desc);-+-+ setupLogging(config.getLogPath(), applicationName);-+-+ const std::string encoding(variables["encoding"].as<std::string>());-+ Log(Debug::Info) << ToUTF8::encodingUsingMessage(encoding);-+ ToUTF8::Utf8Encoder encoder(ToUTF8::calculateEncoding(encoding));-+-+ Files::PathContainer dataDirs(asPathContainer(variables["data"].as<Files::MaybeQuotedPathContainer>()));-+-+ auto local = variables["data-local"].as<Files::MaybeQuotedPathContainer::value_type>();-+ if (!local.empty())-+ dataDirs.push_back(std::move(local));-+-+ config.filterOutNonExistingPaths(dataDirs);-+-+ const auto& resDir = variables["resources"].as<Files::MaybeQuotedPath>();-+ Log(Debug::Info) << Version::getOpenmwVersionDescription();-+ dataDirs.insert(dataDirs.begin(), resDir / "vfs");-+ const Files::Collections fileCollections(dataDirs);-+ const auto& archives = variables["fallback-archive"].as<StringsVector>();-+ const auto& contentFiles = variables["content"].as<StringsVector>();-+ const std::size_t threadsNumber = variables["threads"].as<std::size_t>();-+-+ if (threadsNumber < 1)-+ {-+ std::cerr << "Invalid threads number: " << threadsNumber << ", expected >= 1";-+ return -1;-+ }-+-+ const bool processInteriorCells = variables["process-interior-cells"].as<bool>();-+ const bool removeUnusedTiles = variables["remove-unused-tiles"].as<bool>();-+ const bool writeBinaryLog = variables["write-binary-log"].as<bool>();-+-+#ifdef WIN32-+ if (writeBinaryLog)-+ _setmode(_fileno(stderr), _O_BINARY);-+#endif-+-+ Fallback::Map::init(variables["fallback"].as<Fallback::FallbackMap>().mMap);-+-+ VFS::Manager vfs;-+-+ VFS::registerArchives(&vfs, fileCollections, archives, true);-+-+ Settings::Manager::load(config);-+-+ const DetourNavigator::AgentBounds agentBounds{-+ Settings::game().mActorCollisionShapeType,-+ Settings::game().mDefaultActorPathfindHalfExtents,-+ };-+ const std::uint64_t maxDbFileSize = Settings::navigator().mMaxNavmeshdbFileSize;-+ const auto dbPath = Files::pathToUnicodeString(config.getUserDataPath() / "navmesh.db");-+-+ Log(Debug::Info) << "Using navmeshdb at " << dbPath;-+-+ DetourNavigator::NavMeshDb db(dbPath, maxDbFileSize);-+-+ ESM::ReadersCache readers;-+ EsmLoader::Query query;-+ query.mLoadActivators = true;-+ query.mLoadCells = true;-+ query.mLoadContainers = true;-+ query.mLoadDoors = true;-+ query.mLoadGameSettings = true;-+ query.mLoadLands = true;-+ query.mLoadStatics = true;-+ const EsmLoader::EsmData esmData-+ = EsmLoader::loadEsmData(query, contentFiles, fileCollections, readers, &encoder);-+-+ constexpr double expiryDelay = 0;-+-+ Resource::ImageManager imageManager(&vfs, expiryDelay);-+ Resource::NifFileManager nifFileManager(&vfs, &encoder.getStatelessEncoder());-+ Resource::SceneManager sceneManager(&vfs, &imageManager, &nifFileManager, expiryDelay);-+ Resource::BulletShapeManager bulletShapeManager(&vfs, &sceneManager, &nifFileManager, expiryDelay);-+ DetourNavigator::RecastGlobalAllocator::init();-+ DetourNavigator::Settings navigatorSettings = DetourNavigator::makeSettingsFromSettingsManager();-+ navigatorSettings.mRecast.mSwimHeightScale-+ = EsmLoader::getGameSetting(esmData.mGameSettings, "fSwimHeightScale").getFloat();-+-+ WorldspaceData cellsData = gatherWorldspaceData(-+ navigatorSettings, readers, vfs, bulletShapeManager, esmData, processInteriorCells, writeBinaryLog);-+-+ const Status status = generateAllNavMeshTiles(agentBounds, navigatorSettings, threadsNumber,-+ removeUnusedTiles, writeBinaryLog, cellsData, std::move(db));-+-+ switch (status)-+ {-+ case Status::Ok:-+ Log(Debug::Info) << "Done";-+ break;-+ case Status::Cancelled:-+ Log(Debug::Warning) << "Cancelled";-+ break;-+ case Status::NotEnoughSpace:-+ Log(Debug::Warning)-+ << "Navmesh generation is cancelled due to running out of disk space or limits "-+ << "for navmesh db. Check disk space at the db location \"" << dbPath-+ << "\". If there is enough space, adjust \"max navmeshdb file size\" setting (see "-+ << "https://openmw.readthedocs.io/en/latest/reference/modding/settings/"-+ "navigator.html?highlight=navmesh#max-navmeshdb-file-size).";-+ break;-+ }-+-+ return 0;-+ }-+ }-+}-+-+int main(int argc, char* argv[])-+{-+ return wrapApplication(NavMeshTool::runNavMeshTool, argc, argv, NavMeshTool::applicationName);-+}-diff --git a/apps/navmeshtool/navmesh.cpp b/apps/navmeshtool/navmesh.cpp-index 384c9654660..e41a248e6d8 100644---- a/apps/navmeshtool/navmesh.cpp-+++ b/apps/navmeshtool/navmesh.cpp-@@ -53,6 +53,9 @@ namespace NavMeshTool- Log(Debug::Info) << provided << "/" << expected << " ("- << (static_cast<double>(provided) / static_cast<double>(expected) * 100)- << "%) navmesh tiles are generated";-+-+ std::string message = std::to_string((static_cast<double>(provided) / static_cast<double>(expected) * 100));-+ setenv("NAVMESHTOOL_MESSAGE", message.c_str(), true);- }-- template <class T>-diff --git a/apps/navmeshtool/navmesh.hpp b/apps/navmeshtool/navmesh.hpp-index 4e607f4f2b0..47282237644 100644---- a/apps/navmeshtool/navmesh.hpp-+++ b/apps/navmeshtool/navmesh.hpp-@@ -24,6 +24,8 @@ namespace NavMeshTool- Status generateAllNavMeshTiles(const DetourNavigator::AgentBounds& agentBounds,- const DetourNavigator::Settings& settings, std::size_t threadsNumber, bool removeUnusedTiles,- bool writeBinaryLog, WorldspaceData& cellsData, DetourNavigator::NavMeshDb&& db);-+-+ int runNavMeshTool(int argc, char *argv[]);- }-- #endif-diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt-index cf9f2657304..c6125d36ff0 100644---- a/apps/openmw/CMakeLists.txt-+++ b/apps/openmw/CMakeLists.txt-@@ -116,6 +116,10 @@ add_openmw_dir (mwbase- inputmanager windowmanager statemanager luamanager- )--+add_openmw_dir (.-+ ../navmeshtool/main ../navmeshtool/navmesh ../navmeshtool/worldspacedata-+ )-+- # Main executable-- if (NOT ANDROID)-diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp-index 75687ff2810..5c718ec52f7 100644---- a/apps/openmw/engine.cpp-+++ b/apps/openmw/engine.cpp-@@ -467,6 +467,9 @@ void OMW::Engine::setSkipMenu(bool skipMenu, bool newGame)- mNewGame = newGame;- }--+ // To share the viewer with Android interfaces-+extern osg::ref_ptr<osgViewer::Viewer> g_viewer;-+- void OMW::Engine::createWindow()- {- const int screen = Settings::video().mScreen;-diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp-index 5bbc0211c19..1f1c114e717 100644---- a/apps/openmw/main.cpp-+++ b/apps/openmw/main.cpp-@@ -27,6 +27,9 @@ extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x- #include <unistd.h>- #endif--+// Android navmeshtool hack-+#include "../navmeshtool/navmesh.hpp"-+- using namespace Fallback;-- /**-@@ -226,6 +229,17 @@ int runApplication(int argc, char* argv[])- Files::ConfigurationManager cfgMgr;- std::unique_ptr<OMW::Engine> engine = std::make_unique<OMW::Engine>(cfgMgr);--+ // Android navmeshtool hack-+ if ( getenv("OPENMW_GENERATE_NAVMESH_CACHE") )-+ {-+ if(NavMeshTool::runNavMeshTool(argc, argv))-+ Log(Debug::Error) << "runNavMeshTool failed";-+ else-+ Log(Debug::Error) << "runNavMeshTool sucess";-+-+ return 0;-+ }-+- if (parseOptions(argc, argv, *engine, cfgMgr))- {- engine->go();-diff --git a/apps/openmw/mwrender/luminancecalculator.cpp b/apps/openmw/mwrender/luminancecalculator.cpp-index 30918db87cc..d2bb2e10496 100644---- a/apps/openmw/mwrender/luminancecalculator.cpp-+++ b/apps/openmw/mwrender/luminancecalculator.cpp-@@ -26,7 +26,7 @@ namespace MWRender- buffer.mipmappedSceneLuminanceTex = new osg::Texture2D;- buffer.mipmappedSceneLuminanceTex->setInternalFormat(GL_R16F);- buffer.mipmappedSceneLuminanceTex->setSourceFormat(GL_RED);-- buffer.mipmappedSceneLuminanceTex->setSourceType(GL_FLOAT);-+ buffer.mipmappedSceneLuminanceTex->setSourceType(GL_HALF_FLOAT);- buffer.mipmappedSceneLuminanceTex->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);- buffer.mipmappedSceneLuminanceTex->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);- buffer.mipmappedSceneLuminanceTex->setFilter(-@@ -37,7 +37,7 @@ namespace MWRender- buffer.luminanceTex = new osg::Texture2D;- buffer.luminanceTex->setInternalFormat(GL_R16F);- buffer.luminanceTex->setSourceFormat(GL_RED);-- buffer.luminanceTex->setSourceType(GL_FLOAT);-+ buffer.luminanceTex->setSourceType(GL_HALF_FLOAT);- buffer.luminanceTex->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);- buffer.luminanceTex->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);- buffer.luminanceTex->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::NEAREST);-diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp-index 61260e687e1..3c5bbb7d64d 100644---- a/apps/openmw/mwrender/npcanimation.cpp-+++ b/apps/openmw/mwrender/npcanimation.cpp-@@ -347,7 +347,7 @@ namespace MWRender- auto primaryFBO = postProcessor->getPrimaryFbo(frameId);- primaryFBO->apply(*state);--- postProcessor->getFbo(PostProcessor::FBO_OpaqueDepth, frameId)->apply(*state);-+ //postProcessor->getFbo(PostProcessor::FBO_OpaqueDepth, frameId)->apply(*state);-- // depth accumulation pass- osg::ref_ptr<osg::StateSet> restore = bin->getStateSet();-diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp-index 42b2e4e1eec..c02566d40a4 100644---- a/apps/openmw/mwrender/postprocessor.cpp-+++ b/apps/openmw/mwrender/postprocessor.cpp-@@ -301,7 +301,7 @@ namespace MWRender- mCanvases[frameId]->setCalculateAvgLum(mHDR);-- mCanvases[frameId]->setTextureScene(getTexture(Tex_Scene, frameId));-- mCanvases[frameId]->setTextureDepth(getTexture(Tex_OpaqueDepth, frameId));-+ mCanvases[frameId]->setTextureDepth(getTexture(Tex_Depth, frameId));- mCanvases[frameId]->setTextureDistortion(getTexture(Tex_Distortion, frameId));-- mTransparentDepthPostPass->mFbo[frameId] = mFbos[frameId][FBO_Primary];-@@ -408,12 +408,12 @@ namespace MWRender- mPrevPassLights = mPassLights;-- mViewer->stopThreading();---+/*- auto& shaderManager = MWBase::Environment::get().getResourceSystem()->getSceneManager()->getShaderManager();- auto defines = shaderManager.getGlobalDefines();- defines["disableNormals"] = mNormals ? "0" : "1";- shaderManager.setGlobalDefines(defines);---+*/- mRendering.getLightRoot()->setCollectPPLights(mPassLights);- mStateUpdater->bindPointLights(mPassLights ? mRendering.getLightRoot()->getPPLightsBuffer() : nullptr);- mStateUpdater->reset();-diff --git a/apps/openmw/mwrender/postprocessor.cpp.orig b/apps/openmw/mwrender/postprocessor.cpp.orig-new file mode 100644-index 00000000000..42b2e4e1eec---- /dev/null-+++ b/apps/openmw/mwrender/postprocessor.cpp.orig-@@ -0,0 +1,840 @@-+#include "postprocessor.hpp"-+-+#include <SDL_opengl_glext.h>-+#include <algorithm>-+#include <chrono>-+#include <thread>-+-+#include <osg/Texture1D>-+#include <osg/Texture2D>-+#include <osg/Texture2DArray>-+#include <osg/Texture2DMultisample>-+#include <osg/Texture3D>-+-+#include <components/files/conversion.hpp>-+#include <components/misc/strings/algorithm.hpp>-+#include <components/misc/strings/lower.hpp>-+#include <components/resource/scenemanager.hpp>-+#include <components/sceneutil/color.hpp>-+#include <components/sceneutil/depth.hpp>-+#include <components/sceneutil/nodecallback.hpp>-+#include <components/settings/values.hpp>-+#include <components/shader/shadermanager.hpp>-+#include <components/stereo/multiview.hpp>-+#include <components/stereo/stereomanager.hpp>-+#include <components/vfs/manager.hpp>-+#include <components/vfs/recursivedirectoryiterator.hpp>-+-+#include "../mwbase/environment.hpp"-+#include "../mwbase/windowmanager.hpp"-+-+#include "../mwgui/postprocessorhud.hpp"-+-+#include "distortion.hpp"-+#include "pingpongcull.hpp"-+#include "renderbin.hpp"-+#include "renderingmanager.hpp"-+#include "sky.hpp"-+#include "transparentpass.hpp"-+#include "vismask.hpp"-+-+namespace-+{-+ struct ResizedCallback : osg::GraphicsContext::ResizedCallback-+ {-+ ResizedCallback(MWRender::PostProcessor* postProcessor)-+ : mPostProcessor(postProcessor)-+ {-+ }-+-+ void resizedImplementation(osg::GraphicsContext* gc, int x, int y, int width, int height) override-+ {-+ gc->resizedImplementation(x, y, width, height);-+-+ mPostProcessor->setRenderTargetSize(width, height);-+ mPostProcessor->resize();-+ }-+-+ MWRender::PostProcessor* mPostProcessor;-+ };-+-+ class HUDCullCallback : public SceneUtil::NodeCallback<HUDCullCallback, osg::Camera*, osgUtil::CullVisitor*>-+ {-+ public:-+ void operator()(osg::Camera* camera, osgUtil::CullVisitor* cv)-+ {-+ osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet;-+ auto& sm = Stereo::Manager::instance();-+ auto* fullViewport = camera->getViewport();-+ if (sm.getEye(cv) == Stereo::Eye::Left)-+ stateset->setAttributeAndModes(-+ new osg::Viewport(0, 0, fullViewport->width() / 2, fullViewport->height()));-+ if (sm.getEye(cv) == Stereo::Eye::Right)-+ stateset->setAttributeAndModes(-+ new osg::Viewport(fullViewport->width() / 2, 0, fullViewport->width() / 2, fullViewport->height()));-+-+ cv->pushStateSet(stateset);-+ traverse(camera, cv);-+ cv->popStateSet();-+ }-+ };-+-+ enum class Usage-+ {-+ RENDER_BUFFER,-+ TEXTURE,-+ };-+-+ static osg::FrameBufferAttachment createFrameBufferAttachmentFromTemplate(-+ Usage usage, int width, int height, osg::Texture* template_, int samples)-+ {-+ if (usage == Usage::RENDER_BUFFER && !Stereo::getMultiview())-+ {-+ osg::ref_ptr<osg::RenderBuffer> attachment-+ = new osg::RenderBuffer(width, height, template_->getInternalFormat(), samples);-+ return osg::FrameBufferAttachment(attachment);-+ }-+-+ auto texture = Stereo::createMultiviewCompatibleTexture(width, height, samples);-+ texture->setSourceFormat(template_->getSourceFormat());-+ texture->setSourceType(template_->getSourceType());-+ texture->setInternalFormat(template_->getInternalFormat());-+ texture->setFilter(osg::Texture2D::MIN_FILTER, template_->getFilter(osg::Texture2D::MIN_FILTER));-+ texture->setFilter(osg::Texture2D::MAG_FILTER, template_->getFilter(osg::Texture2D::MAG_FILTER));-+ texture->setWrap(osg::Texture::WRAP_S, template_->getWrap(osg::Texture2D::WRAP_S));-+ texture->setWrap(osg::Texture::WRAP_T, template_->getWrap(osg::Texture2D::WRAP_T));-+-+ return Stereo::createMultiviewCompatibleAttachment(texture);-+ }-+-+ constexpr float DistortionRatio = 0.25;-+}-+-+namespace MWRender-+{-+ PostProcessor::PostProcessor(-+ RenderingManager& rendering, osgViewer::Viewer* viewer, osg::Group* rootNode, const VFS::Manager* vfs)-+ : osg::Group()-+ , mRootNode(rootNode)-+ , mHUDCamera(new osg::Camera)-+ , mRendering(rendering)-+ , mViewer(viewer)-+ , mVFS(vfs)-+ , mUsePostProcessing(Settings::postProcessing().mEnabled)-+ , mSamples(Settings::video().mAntialiasing)-+ , mPingPongCull(new PingPongCull(this))-+ , mDistortionCallback(new DistortionCallback)-+ {-+ auto& shaderManager = mRendering.getResourceSystem()->getSceneManager()->getShaderManager();-+-+ std::shared_ptr<LuminanceCalculator> luminanceCalculator = std::make_shared<LuminanceCalculator>(shaderManager);-+-+ for (auto& canvas : mCanvases)-+ canvas = new PingPongCanvas(shaderManager, luminanceCalculator);-+-+ mHUDCamera->setReferenceFrame(osg::Camera::ABSOLUTE_RF);-+ mHUDCamera->setRenderOrder(osg::Camera::POST_RENDER);-+ mHUDCamera->setClearColor(osg::Vec4(0.45, 0.45, 0.14, 1.0));-+ mHUDCamera->setClearMask(0);-+ mHUDCamera->setProjectionMatrix(osg::Matrix::ortho2D(0, 1, 0, 1));-+ mHUDCamera->setAllowEventFocus(false);-+ mHUDCamera->setViewport(0, 0, mWidth, mHeight);-+ mHUDCamera->setNodeMask(Mask_RenderToTexture);-+ mHUDCamera->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);-+ mHUDCamera->getOrCreateStateSet()->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);-+ mHUDCamera->addChild(mCanvases[0]);-+ mHUDCamera->addChild(mCanvases[1]);-+ mHUDCamera->setCullCallback(new HUDCullCallback);-+ mViewer->getCamera()->addCullCallback(mPingPongCull);-+-+ // resolves the multisampled depth buffer and optionally draws an additional depth postpass-+ mTransparentDepthPostPass-+ = new TransparentDepthBinCallback(mRendering.getResourceSystem()->getSceneManager()->getShaderManager(),-+ Settings::postProcessing().mTransparentPostpass);-+ osgUtil::RenderBin::getRenderBinPrototype("DepthSortedBin")->setDrawCallback(mTransparentDepthPostPass);-+-+ osg::ref_ptr<osgUtil::RenderBin> distortionRenderBin-+ = new osgUtil::RenderBin(osgUtil::RenderBin::SORT_BACK_TO_FRONT);-+ // This is silly to have to do, but if nothing is drawn then the drawcallback is never called and the distortion-+ // texture will never be cleared-+ osg::ref_ptr<osg::Node> dummyNodeToClear = new osg::Node;-+ dummyNodeToClear->setCullingActive(false);-+ dummyNodeToClear->getOrCreateStateSet()->setRenderBinDetails(RenderBin_Distortion, "Distortion");-+ rootNode->addChild(dummyNodeToClear);-+ distortionRenderBin->setDrawCallback(mDistortionCallback);-+ distortionRenderBin->getStateSet()->setDefine("DISTORTION", "1", osg::StateAttribute::ON);-+-+ // Give the renderbin access to the opaque depth sampler so it can write its occlusion-+ // Distorted geometry is drawn with ALWAYS depth function and depths writes disbled.-+ const int unitSoftEffect-+ = shaderManager.reserveGlobalTextureUnits(Shader::ShaderManager::Slot::OpaqueDepthTexture);-+ distortionRenderBin->getStateSet()->addUniform(new osg::Uniform("opaqueDepthTex", unitSoftEffect));-+-+ osgUtil::RenderBin::addRenderBinPrototype("Distortion", distortionRenderBin);-+-+ auto defines = shaderManager.getGlobalDefines();-+ defines["distorionRTRatio"] = std::to_string(DistortionRatio);-+ shaderManager.setGlobalDefines(defines);-+-+ createObjectsForFrame(0);-+ createObjectsForFrame(1);-+-+ populateTechniqueFiles();-+-+ auto distortion = loadTechnique("internal_distortion");-+ distortion->setInternal(true);-+ distortion->setLocked(true);-+ mInternalTechniques.push_back(distortion);-+-+ osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext();-+ osg::GLExtensions* ext = gc->getState()->get<osg::GLExtensions>();-+-+ mWidth = gc->getTraits()->width;-+ mHeight = gc->getTraits()->height;-+-+ if (!ext->glDisablei && ext->glDisableIndexedEXT)-+ ext->glDisablei = ext->glDisableIndexedEXT;-+-+#ifdef ANDROID-+ ext->glDisablei = nullptr;-+#endif-+-+ if (ext->glDisablei)-+ mNormalsSupported = true;-+ else-+ Log(Debug::Error) << "'glDisablei' unsupported, pass normals will not be available to shaders.";-+-+ mGLSLVersion = ext->glslLanguageVersion * 100;-+ mUBO = ext->isUniformBufferObjectSupported && mGLSLVersion >= 330;-+ mStateUpdater = new fx::StateUpdater(mUBO);-+-+ addChild(mHUDCamera);-+ addChild(mRootNode);-+-+ mViewer->setSceneData(this);-+ mViewer->getCamera()->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);-+ mViewer->getCamera()->getGraphicsContext()->setResizedCallback(new ResizedCallback(this));-+ mViewer->getCamera()->setUserData(this);-+-+ setCullCallback(mStateUpdater);-+-+ if (mUsePostProcessing)-+ enable();-+ }-+-+ PostProcessor::~PostProcessor()-+ {-+ if (auto* bin = osgUtil::RenderBin::getRenderBinPrototype("DepthSortedBin"))-+ bin->setDrawCallback(nullptr);-+ }-+-+ void PostProcessor::resize()-+ {-+ mHUDCamera->resize(mWidth, mHeight);-+ mViewer->getCamera()->resize(mWidth, mHeight);-+ if (Stereo::getStereo())-+ Stereo::Manager::instance().screenResolutionChanged();-+-+ size_t frameId = frame() % 2;-+-+ createObjectsForFrame(frameId);-+-+ mRendering.updateProjectionMatrix();-+ mRendering.setScreenRes(renderWidth(), renderHeight());-+-+ dirtyTechniques(true);-+-+ mDirty = true;-+ mDirtyFrameId = !frameId;-+ }-+-+ void PostProcessor::populateTechniqueFiles()-+ {-+ for (const auto& name : mVFS->getRecursiveDirectoryIterator(fx::Technique::sSubdir))-+ {-+ std::filesystem::path path = Files::pathFromUnicodeString(name);-+ std::string fileExt = Misc::StringUtils::lowerCase(Files::pathToUnicodeString(path.extension()));-+ if (!path.parent_path().has_parent_path() && fileExt == fx::Technique::sExt)-+ {-+ const auto absolutePath = mVFS->getAbsoluteFileName(path);-+ mTechniqueFileMap[Files::pathToUnicodeString(absolutePath.stem())] = absolutePath;-+ }-+ }-+ }-+-+ void PostProcessor::enable()-+ {-+ mReload = true;-+ mUsePostProcessing = true;-+ }-+-+ void PostProcessor::disable()-+ {-+ mUsePostProcessing = false;-+ mRendering.getSkyManager()->setSunglare(true);-+ }-+-+ void PostProcessor::traverse(osg::NodeVisitor& nv)-+ {-+ size_t frameId = nv.getTraversalNumber() % 2;-+-+ if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)-+ cull(frameId, static_cast<osgUtil::CullVisitor*>(&nv));-+ else if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)-+ update(frameId);-+-+ osg::Group::traverse(nv);-+ }-+-+ void PostProcessor::cull(size_t frameId, osgUtil::CullVisitor* cv)-+ {-+ if (const auto& fbo = getFbo(FBO_Intercept, frameId))-+ {-+ osgUtil::RenderStage* rs = cv->getRenderStage();-+ if (rs && rs->getMultisampleResolveFramebufferObject())-+ rs->setMultisampleResolveFramebufferObject(fbo);-+ }-+-+ mCanvases[frameId]->setPostProcessing(mUsePostProcessing);-+ mCanvases[frameId]->setTextureNormals(mNormals ? getTexture(Tex_Normal, frameId) : nullptr);-+ mCanvases[frameId]->setMask(mUnderwater, mExteriorFlag);-+ mCanvases[frameId]->setCalculateAvgLum(mHDR);-+-+ mCanvases[frameId]->setTextureScene(getTexture(Tex_Scene, frameId));-+ mCanvases[frameId]->setTextureDepth(getTexture(Tex_OpaqueDepth, frameId));-+ mCanvases[frameId]->setTextureDistortion(getTexture(Tex_Distortion, frameId));-+-+ mTransparentDepthPostPass->mFbo[frameId] = mFbos[frameId][FBO_Primary];-+ mTransparentDepthPostPass->mMsaaFbo[frameId] = mFbos[frameId][FBO_Multisample];-+ mTransparentDepthPostPass->mOpaqueFbo[frameId] = mFbos[frameId][FBO_OpaqueDepth];-+-+ mDistortionCallback->setFBO(mFbos[frameId][FBO_Distortion], frameId);-+ mDistortionCallback->setOriginalFBO(mFbos[frameId][FBO_Primary], frameId);-+-+ size_t frame = cv->getTraversalNumber();-+-+ mStateUpdater->setResolution(osg::Vec2f(cv->getViewport()->width(), cv->getViewport()->height()));-+-+ // per-frame data-+ if (frame != mLastFrameNumber)-+ {-+ mLastFrameNumber = frame;-+ auto stamp = cv->getFrameStamp();-+-+ mStateUpdater->setSimulationTime(static_cast<float>(stamp->getSimulationTime()));-+ mStateUpdater->setDeltaSimulationTime(static_cast<float>(stamp->getSimulationTime() - mLastSimulationTime));-+ mLastSimulationTime = stamp->getSimulationTime();-+-+ for (const auto& dispatchNode : mCanvases[frameId]->getPasses())-+ {-+ for (auto& uniform : dispatchNode.mHandle->getUniformMap())-+ {-+ if (uniform->getType().has_value() && !uniform->mSamplerType)-+ if (auto* u = dispatchNode.mRootStateSet->getUniform(uniform->mName))-+ uniform->setUniform(u);-+ }-+ }-+ }-+ }-+-+ void PostProcessor::updateLiveReload()-+ {-+ if (!mEnableLiveReload && !mTriggerShaderReload)-+ return;-+-+ mTriggerShaderReload = false; // Done only once-+-+ for (auto& technique : mTechniques)-+ {-+ if (technique->getStatus() == fx::Technique::Status::File_Not_exists)-+ continue;-+-+ const auto lastWriteTime = std::filesystem::last_write_time(mTechniqueFileMap[technique->getName()]);-+ const bool isDirty = technique->setLastModificationTime(lastWriteTime);-+-+ if (!isDirty)-+ continue;-+-+ // TODO: Temporary workaround to avoid conflicts with external programs saving the file, especially-+ // problematic on Windows.-+ // If we move to a file watcher using native APIs this should be removed.-+ std::this_thread::sleep_for(std::chrono::milliseconds(5));-+-+ if (technique->compile())-+ Log(Debug::Info) << "Reloaded technique : " << mTechniqueFileMap[technique->getName()];-+-+ mReload = technique->isValid();-+ }-+ }-+-+ void PostProcessor::reloadIfRequired()-+ {-+ if (!mReload)-+ return;-+-+ mReload = false;-+-+ loadChain();-+ resize();-+ }-+-+ void PostProcessor::update(size_t frameId)-+ {-+ while (!mQueuedTemplates.empty())-+ {-+ mTemplates.push_back(std::move(mQueuedTemplates.back()));-+-+ mQueuedTemplates.pop_back();-+ }-+-+ updateLiveReload();-+-+ reloadIfRequired();-+-+ mCanvases[frameId]->setNodeMask(~0u);-+ mCanvases[!frameId]->setNodeMask(0);-+-+ if (mDirty && mDirtyFrameId == frameId)-+ {-+ createObjectsForFrame(frameId);-+-+ mDirty = false;-+ mCanvases[frameId]->setPasses(fx::DispatchArray(mTemplateData));-+ }-+-+ if ((mNormalsSupported && mNormals != mPrevNormals) || (mPassLights != mPrevPassLights))-+ {-+ mPrevNormals = mNormals;-+ mPrevPassLights = mPassLights;-+-+ mViewer->stopThreading();-+-+ auto& shaderManager = MWBase::Environment::get().getResourceSystem()->getSceneManager()->getShaderManager();-+ auto defines = shaderManager.getGlobalDefines();-+ defines["disableNormals"] = mNormals ? "0" : "1";-+ shaderManager.setGlobalDefines(defines);-+-+ mRendering.getLightRoot()->setCollectPPLights(mPassLights);-+ mStateUpdater->bindPointLights(mPassLights ? mRendering.getLightRoot()->getPPLightsBuffer() : nullptr);-+ mStateUpdater->reset();-+-+ mViewer->startThreading();-+-+ createObjectsForFrame(frameId);-+-+ mDirty = true;-+ mDirtyFrameId = !frameId;-+ }-+ }-+-+ void PostProcessor::createObjectsForFrame(size_t frameId)-+ {-+ auto& textures = mTextures[frameId];-+-+ int width = renderWidth();-+ int height = renderHeight();-+-+ for (osg::ref_ptr<osg::Texture>& texture : textures)-+ {-+ if (!texture)-+ {-+ if (Stereo::getMultiview())-+ texture = new osg::Texture2DArray;-+ else-+ texture = new osg::Texture2D;-+ }-+ Stereo::setMultiviewCompatibleTextureSize(texture, width, height);-+ texture->setSourceFormat(GL_RGBA);-+ texture->setSourceType(GL_UNSIGNED_BYTE);-+ texture->setInternalFormat(GL_RGBA);-+ texture->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture::LINEAR);-+ texture->setFilter(osg::Texture2D::MAG_FILTER, osg::Texture::LINEAR);-+ texture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);-+ texture->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);-+ texture->setResizeNonPowerOfTwoHint(false);-+ Stereo::setMultiviewCompatibleTextureSize(texture, width, height);-+ texture->dirtyTextureObject();-+ }-+-+ textures[Tex_Normal]->setSourceFormat(GL_RGB);-+ textures[Tex_Normal]->setInternalFormat(GL_RGB);-+-+ textures[Tex_Distortion]->setSourceFormat(GL_RGB);-+ textures[Tex_Distortion]->setInternalFormat(GL_RGB);-+-+ Stereo::setMultiviewCompatibleTextureSize(-+ textures[Tex_Distortion], width * DistortionRatio, height * DistortionRatio);-+ textures[Tex_Distortion]->dirtyTextureObject();-+-+ auto setupDepth = [](osg::Texture* tex) {-+ tex->setSourceFormat(GL_DEPTH_STENCIL_EXT);-+ tex->setSourceType(SceneUtil::AutoDepth::depthSourceType());-+ tex->setInternalFormat(SceneUtil::AutoDepth::depthInternalFormat());-+ };-+-+ setupDepth(textures[Tex_Depth]);-+ setupDepth(textures[Tex_OpaqueDepth]);-+ textures[Tex_OpaqueDepth]->setName("opaqueTexMap");-+-+ auto& fbos = mFbos[frameId];-+-+ fbos[FBO_Primary] = new osg::FrameBufferObject;-+ fbos[FBO_Primary]->setAttachment(-+ osg::Camera::COLOR_BUFFER0, Stereo::createMultiviewCompatibleAttachment(textures[Tex_Scene]));-+ if (mNormals && mNormalsSupported)-+ fbos[FBO_Primary]->setAttachment(-+ osg::Camera::COLOR_BUFFER1, Stereo::createMultiviewCompatibleAttachment(textures[Tex_Normal]));-+ fbos[FBO_Primary]->setAttachment(-+ osg::Camera::PACKED_DEPTH_STENCIL_BUFFER, Stereo::createMultiviewCompatibleAttachment(textures[Tex_Depth]));-+-+ fbos[FBO_FirstPerson] = new osg::FrameBufferObject;-+-+ auto fpDepthRb = createFrameBufferAttachmentFromTemplate(-+ Usage::RENDER_BUFFER, width, height, textures[Tex_Depth], mSamples);-+ fbos[FBO_FirstPerson]->setAttachment(osg::FrameBufferObject::BufferComponent::PACKED_DEPTH_STENCIL_BUFFER,-+ osg::FrameBufferAttachment(fpDepthRb));-+-+ if (mSamples > 1)-+ {-+ fbos[FBO_Multisample] = new osg::FrameBufferObject;-+ auto colorRB = createFrameBufferAttachmentFromTemplate(-+ Usage::RENDER_BUFFER, width, height, textures[Tex_Scene], mSamples);-+ if (mNormals && mNormalsSupported)-+ {-+ auto normalRB = createFrameBufferAttachmentFromTemplate(-+ Usage::RENDER_BUFFER, width, height, textures[Tex_Normal], mSamples);-+ fbos[FBO_Multisample]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1, normalRB);-+ fbos[FBO_FirstPerson]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1, normalRB);-+ }-+ auto depthRB = createFrameBufferAttachmentFromTemplate(-+ Usage::RENDER_BUFFER, width, height, textures[Tex_Depth], mSamples);-+ fbos[FBO_Multisample]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER0, colorRB);-+ fbos[FBO_Multisample]->setAttachment(-+ osg::FrameBufferObject::BufferComponent::PACKED_DEPTH_STENCIL_BUFFER, depthRB);-+ fbos[FBO_FirstPerson]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER0, colorRB);-+-+ fbos[FBO_Intercept] = new osg::FrameBufferObject;-+ fbos[FBO_Intercept]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER0,-+ Stereo::createMultiviewCompatibleAttachment(textures[Tex_Scene]));-+ fbos[FBO_Intercept]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1,-+ Stereo::createMultiviewCompatibleAttachment(textures[Tex_Normal]));-+ }-+ else-+ {-+ fbos[FBO_FirstPerson]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER0,-+ Stereo::createMultiviewCompatibleAttachment(textures[Tex_Scene]));-+ if (mNormals && mNormalsSupported)-+ fbos[FBO_FirstPerson]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER1,-+ Stereo::createMultiviewCompatibleAttachment(textures[Tex_Normal]));-+ }-+-+ fbos[FBO_OpaqueDepth] = new osg::FrameBufferObject;-+ fbos[FBO_OpaqueDepth]->setAttachment(osg::FrameBufferObject::BufferComponent::PACKED_DEPTH_STENCIL_BUFFER,-+ Stereo::createMultiviewCompatibleAttachment(textures[Tex_OpaqueDepth]));-+-+ fbos[FBO_Distortion] = new osg::FrameBufferObject;-+ fbos[FBO_Distortion]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER0,-+ Stereo::createMultiviewCompatibleAttachment(textures[Tex_Distortion]));-+-+#ifdef __APPLE__-+ if (textures[Tex_OpaqueDepth])-+ fbos[FBO_OpaqueDepth]->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER,-+ osg::FrameBufferAttachment(new osg::RenderBuffer(textures[Tex_OpaqueDepth]->getTextureWidth(),-+ textures[Tex_OpaqueDepth]->getTextureHeight(), textures[Tex_Scene]->getInternalFormat())));-+#endif-+-+ mCanvases[frameId]->dirty();-+ }-+-+ void PostProcessor::dirtyTechniques(bool dirtyAttachments)-+ {-+ size_t frameId = frame() % 2;-+-+ mDirty = true;-+ mDirtyFrameId = !frameId;-+-+ mTemplateData = {};-+-+ bool sunglare = true;-+ mHDR = false;-+ mNormals = false;-+ mPassLights = false;-+-+ std::vector<fx::Types::RenderTarget> attachmentsToDirty;-+-+ for (const auto& technique : mTechniques)-+ {-+ if (!technique->isValid())-+ continue;-+-+ if (technique->getGLSLVersion() > mGLSLVersion)-+ {-+ Log(Debug::Warning) << "Technique " << technique->getName() << " requires GLSL version "-+ << technique->getGLSLVersion() << " which is unsupported by your hardware.";-+ continue;-+ }-+-+ fx::DispatchNode node;-+-+ node.mFlags = technique->getFlags();-+-+ if (technique->getHDR())-+ mHDR = true;-+-+ if (technique->getNormals())-+ mNormals = true;-+-+ if (technique->getLights())-+ mPassLights = true;-+-+ if (node.mFlags & fx::Technique::Flag_Disable_SunGlare)-+ sunglare = false;-+-+ // required default samplers available to every shader pass-+ node.mRootStateSet->addUniform(new osg::Uniform("omw_SamplerLastShader", Unit_LastShader));-+ node.mRootStateSet->addUniform(new osg::Uniform("omw_SamplerLastPass", Unit_LastPass));-+ node.mRootStateSet->addUniform(new osg::Uniform("omw_SamplerDepth", Unit_Depth));-+ node.mRootStateSet->addUniform(new osg::Uniform("omw_SamplerDistortion", Unit_Distortion));-+-+ if (mNormals)-+ node.mRootStateSet->addUniform(new osg::Uniform("omw_SamplerNormals", Unit_Normals));-+-+ if (technique->getHDR())-+ node.mRootStateSet->addUniform(new osg::Uniform("omw_EyeAdaptation", Unit_EyeAdaptation));-+-+ node.mRootStateSet->addUniform(new osg::Uniform("omw_SamplerDistortion", Unit_Distortion));-+-+ int texUnit = Unit_NextFree;-+-+ // user-defined samplers-+ for (const osg::Texture* texture : technique->getTextures())-+ {-+ if (const auto* tex1D = dynamic_cast<const osg::Texture1D*>(texture))-+ node.mRootStateSet->setTextureAttribute(texUnit, new osg::Texture1D(*tex1D));-+ else if (const auto* tex2D = dynamic_cast<const osg::Texture2D*>(texture))-+ node.mRootStateSet->setTextureAttribute(texUnit, new osg::Texture2D(*tex2D));-+ else if (const auto* tex3D = dynamic_cast<const osg::Texture3D*>(texture))-+ node.mRootStateSet->setTextureAttribute(texUnit, new osg::Texture3D(*tex3D));-+-+ node.mRootStateSet->addUniform(new osg::Uniform(texture->getName().c_str(), texUnit++));-+ }-+-+ // user-defined uniforms-+ for (auto& uniform : technique->getUniformMap())-+ {-+ if (uniform->mSamplerType)-+ continue;-+-+ if (auto type = uniform->getType())-+ uniform->setUniform(node.mRootStateSet->getOrCreateUniform(-+ uniform->mName.c_str(), *type, uniform->getNumElements()));-+ }-+-+ for (const auto& pass : technique->getPasses())-+ {-+ int subTexUnit = texUnit;-+ fx::DispatchNode::SubPass subPass;-+-+ pass->prepareStateSet(subPass.mStateSet, technique->getName());-+-+ node.mHandle = technique;-+-+ if (!pass->getTarget().empty())-+ {-+ auto& renderTarget = technique->getRenderTargetsMap()[pass->getTarget()];-+ subPass.mSize = renderTarget.mSize;-+ subPass.mRenderTexture = renderTarget.mTarget;-+ subPass.mMipMap = renderTarget.mMipMap;-+-+ subPass.mRenderTarget = new osg::FrameBufferObject;-+ subPass.mRenderTarget->setAttachment(osg::FrameBufferObject::BufferComponent::COLOR_BUFFER0,-+ osg::FrameBufferAttachment(subPass.mRenderTexture));-+-+ const auto [w, h] = renderTarget.mSize.get(renderWidth(), renderHeight());-+ subPass.mStateSet->setAttributeAndModes(new osg::Viewport(0, 0, w, h));-+-+ if (std::find_if(attachmentsToDirty.cbegin(), attachmentsToDirty.cend(),-+ [renderTarget](const auto& rt) { return renderTarget.mTarget == rt.mTarget; })-+ == attachmentsToDirty.cend())-+ {-+ attachmentsToDirty.push_back(fx::Types::RenderTarget(renderTarget));-+ }-+ }-+-+ for (const auto& name : pass->getRenderTargets())-+ {-+ if (name.empty())-+ {-+ continue;-+ }-+-+ auto& renderTarget = technique->getRenderTargetsMap()[name];-+ subPass.mStateSet->setTextureAttribute(subTexUnit, renderTarget.mTarget);-+ subPass.mStateSet->addUniform(new osg::Uniform(name.c_str(), subTexUnit));-+-+ if (std::find_if(attachmentsToDirty.cbegin(), attachmentsToDirty.cend(),-+ [renderTarget](const auto& rt) { return renderTarget.mTarget == rt.mTarget; })-+ == attachmentsToDirty.cend())-+ {-+ attachmentsToDirty.push_back(fx::Types::RenderTarget(renderTarget));-+ }-+ subTexUnit++;-+ }-+-+ node.mPasses.emplace_back(std::move(subPass));-+ }-+-+ node.compile();-+-+ mTemplateData.emplace_back(std::move(node));-+ }-+-+ mCanvases[frameId]->setPasses(fx::DispatchArray(mTemplateData));-+-+ if (auto hud = MWBase::Environment::get().getWindowManager()->getPostProcessorHud())-+ hud->updateTechniques();-+-+ mRendering.getSkyManager()->setSunglare(sunglare);-+-+ if (dirtyAttachments)-+ mCanvases[frameId]->setDirtyAttachments(attachmentsToDirty);-+ }-+-+ PostProcessor::Status PostProcessor::enableTechnique(-+ std::shared_ptr<fx::Technique> technique, std::optional<int> location)-+ {-+ if (!technique || technique->getLocked() || (location.has_value() && location.value() < 0))-+ return Status_Error;-+-+ disableTechnique(technique, false);-+-+ int pos = std::min<int>(location.value_or(mTechniques.size()) + mInternalTechniques.size(), mTechniques.size());-+-+ mTechniques.insert(mTechniques.begin() + pos, technique);-+ dirtyTechniques(Settings::ShaderManager::get().getMode() == Settings::ShaderManager::Mode::Debug);-+-+ return Status_Toggled;-+ }-+-+ PostProcessor::Status PostProcessor::disableTechnique(std::shared_ptr<fx::Technique> technique, bool dirty)-+ {-+ if (technique->getLocked())-+ return Status_Error;-+-+ auto it = std::find(mTechniques.begin(), mTechniques.end(), technique);-+ if (it == std::end(mTechniques))-+ return Status_Unchanged;-+-+ mTechniques.erase(it);-+ if (dirty)-+ dirtyTechniques();-+-+ return Status_Toggled;-+ }-+-+ bool PostProcessor::isTechniqueEnabled(const std::shared_ptr<fx::Technique>& technique) const-+ {-+ if (auto it = std::find(mTechniques.begin(), mTechniques.end(), technique); it == mTechniques.end())-+ return false;-+-+ return technique->isValid();-+ }-+-+ std::shared_ptr<fx::Technique> PostProcessor::loadTechnique(const std::string& name, bool loadNextFrame)-+ {-+ for (const auto& technique : mTemplates)-+ if (Misc::StringUtils::ciEqual(technique->getName(), name))-+ return technique;-+-+ for (const auto& technique : mQueuedTemplates)-+ if (Misc::StringUtils::ciEqual(technique->getName(), name))-+ return technique;-+-+ auto technique = std::make_shared<fx::Technique>(*mVFS, *mRendering.getResourceSystem()->getImageManager(),-+ name, renderWidth(), renderHeight(), mUBO, mNormalsSupported);-+-+ technique->compile();-+-+ if (technique->getStatus() != fx::Technique::Status::File_Not_exists)-+ technique->setLastModificationTime(-+ std::filesystem::last_write_time(mTechniqueFileMap[technique->getName()]));-+-+ if (loadNextFrame)-+ {-+ mQueuedTemplates.push_back(technique);-+ return technique;-+ }-+-+ mTemplates.push_back(std::move(technique));-+-+ return mTemplates.back();-+ }-+-+ void PostProcessor::loadChain()-+ {-+ mTechniques.clear();-+-+ for (const auto& technique : mInternalTechniques)-+ {-+ mTechniques.push_back(technique);-+ }-+-+ for (const std::string& techniqueName : Settings::postProcessing().mChain.get())-+ {-+ if (techniqueName.empty())-+ continue;-+-+ mTechniques.push_back(loadTechnique(techniqueName));-+ }-+-+ dirtyTechniques();-+ }-+-+ void PostProcessor::saveChain()-+ {-+ std::vector<std::string> chain;-+-+ for (const auto& technique : mTechniques)-+ {-+ if (!technique || technique->getDynamic() || technique->getInternal())-+ continue;-+ chain.push_back(technique->getName());-+ }-+-+ Settings::postProcessing().mChain.set(chain);-+ }-+-+ void PostProcessor::toggleMode()-+ {-+ for (auto& technique : mTemplates)-+ technique->compile();-+-+ dirtyTechniques(true);-+ }-+-+ void PostProcessor::disableDynamicShaders()-+ {-+ for (auto& technique : mTechniques)-+ if (technique->getDynamic())-+ disableTechnique(technique);-+ }-+-+ int PostProcessor::renderWidth() const-+ {-+ if (Stereo::getStereo())-+ return Stereo::Manager::instance().eyeResolution().x();-+ return mWidth;-+ }-+-+ int PostProcessor::renderHeight() const-+ {-+ if (Stereo::getStereo())-+ return Stereo::Manager::instance().eyeResolution().y();-+ return mHeight;-+ }-+-+ void PostProcessor::triggerShaderReload()-+ {-+ mTriggerShaderReload = true;-+ }-+}-diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp-index 224774d1029..0eca81d2470 100644---- a/apps/openmw/mwrender/renderingmanager.cpp-+++ b/apps/openmw/mwrender/renderingmanager.cpp-@@ -464,8 +464,8 @@ namespace MWRender-- mPostProcessor = new PostProcessor(*this, viewer, mRootNode, resourceSystem->getVFS());- resourceSystem->getSceneManager()->setOpaqueDepthTex(-- mPostProcessor->getTexture(PostProcessor::Tex_OpaqueDepth, 0),-- mPostProcessor->getTexture(PostProcessor::Tex_OpaqueDepth, 1));-+ mPostProcessor->getTexture(PostProcessor::Tex_Depth, 0),-+ mPostProcessor->getTexture(PostProcessor::Tex_Depth, 1));- resourceSystem->getSceneManager()->setSoftParticles(Settings::shaders().mSoftParticles);- resourceSystem->getSceneManager()->setSupportsNormalsRT(mPostProcessor->getSupportsNormalsRT());- resourceSystem->getSceneManager()->setWeatherParticleOcclusion(Settings::shaders().mWeatherParticleOcclusion);-diff --git a/apps/openmw/mwrender/renderingmanager.cpp.orig b/apps/openmw/mwrender/renderingmanager.cpp.orig-new file mode 100644-index 00000000000..224774d1029---- /dev/null-+++ b/apps/openmw/mwrender/renderingmanager.cpp.orig-@@ -0,0 +1,1767 @@-+#include "renderingmanager.hpp"-+-+#include <cstdlib>-+#include <limits>-+-+#include <osg/ClipControl>-+#include <osg/ComputeBoundsVisitor>-+#include <osg/Fog>-+#include <osg/Group>-+#include <osg/Light>-+#include <osg/LightModel>-+#include <osg/Material>-+#include <osg/PolygonMode>-+#include <osg/UserDataContainer>-+-+#include <osgUtil/LineSegmentIntersector>-+-+#include <osgViewer/Viewer>-+-+#include <components/nifosg/nifloader.hpp>-+-+#include <components/debug/debuglog.hpp>-+-+#include <components/stereo/multiview.hpp>-+#include <components/stereo/stereomanager.hpp>-+-+#include <components/resource/imagemanager.hpp>-+#include <components/resource/keyframemanager.hpp>-+#include <components/resource/resourcesystem.hpp>-+-+#include <components/shader/removedalphafunc.hpp>-+#include <components/shader/shadermanager.hpp>-+-+#include <components/settings/values.hpp>-+-+#include <components/sceneutil/cullsafeboundsvisitor.hpp>-+#include <components/sceneutil/depth.hpp>-+#include <components/sceneutil/lightmanager.hpp>-+#include <components/sceneutil/positionattitudetransform.hpp>-+#include <components/sceneutil/rtt.hpp>-+#include <components/sceneutil/shadow.hpp>-+#include <components/sceneutil/statesetupdater.hpp>-+#include <components/sceneutil/visitor.hpp>-+#include <components/sceneutil/workqueue.hpp>-+#include <components/sceneutil/writescene.hpp>-+-+#include <components/misc/constants.hpp>-+-+#include <components/terrain/quadtreeworld.hpp>-+#include <components/terrain/terraingrid.hpp>-+-+#include <components/esm3/loadcell.hpp>-+#include <components/esm4/loadcell.hpp>-+-+#include <components/debug/debugdraw.hpp>-+#include <components/detournavigator/navigator.hpp>-+#include <components/detournavigator/navmeshcacheitem.hpp>-+-+#include "../mwworld/cellstore.hpp"-+#include "../mwworld/class.hpp"-+#include "../mwworld/groundcoverstore.hpp"-+#include "../mwworld/scene.hpp"-+-+#include "../mwgui/postprocessorhud.hpp"-+-+#include "../mwmechanics/actorutil.hpp"-+-+#include "../mwbase/environment.hpp"-+#include "../mwbase/windowmanager.hpp"-+#include "../mwbase/world.hpp"-+-+#include "actorspaths.hpp"-+#include "camera.hpp"-+#include "effectmanager.hpp"-+#include "fogmanager.hpp"-+#include "groundcover.hpp"-+#include "navmesh.hpp"-+#include "npcanimation.hpp"-+#include "objectpaging.hpp"-+#include "pathgrid.hpp"-+#include "postprocessor.hpp"-+#include "recastmesh.hpp"-+#include "screenshotmanager.hpp"-+#include "sky.hpp"-+#include "terrainstorage.hpp"-+#include "util.hpp"-+#include "vismask.hpp"-+#include "water.hpp"-+-+namespace MWRender-+{-+ class PerViewUniformStateUpdater final : public SceneUtil::StateSetUpdater-+ {-+ public:-+ PerViewUniformStateUpdater(Resource::SceneManager* sceneManager)-+ : mSceneManager(sceneManager)-+ {-+ mOpaqueTextureUnit = mSceneManager->getShaderManager().reserveGlobalTextureUnits(-+ Shader::ShaderManager::Slot::OpaqueDepthTexture);-+ }-+-+ void setDefaults(osg::StateSet* stateset) override-+ {-+ stateset->addUniform(new osg::Uniform("projectionMatrix", osg::Matrixf{}));-+ if (mSkyRTT)-+ stateset->addUniform(new osg::Uniform("sky", mSkyTextureUnit));-+ }-+-+ void apply(osg::StateSet* stateset, osg::NodeVisitor* nv) override-+ {-+ stateset->getUniform("projectionMatrix")->set(mProjectionMatrix);-+ if (mSkyRTT && nv->getVisitorType() == osg::NodeVisitor::CULL_VISITOR)-+ {-+ osg::Texture* skyTexture = mSkyRTT->getColorTexture(static_cast<osgUtil::CullVisitor*>(nv));-+ stateset->setTextureAttribute(-+ mSkyTextureUnit, skyTexture, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);-+ }-+-+ stateset->setTextureAttribute(mOpaqueTextureUnit,-+ mSceneManager->getOpaqueDepthTex(nv->getTraversalNumber()), osg::StateAttribute::ON);-+ }-+-+ void applyLeft(osg::StateSet* stateset, osgUtil::CullVisitor* nv) override-+ {-+ stateset->getUniform("projectionMatrix")->set(getEyeProjectionMatrix(0));-+ }-+-+ void applyRight(osg::StateSet* stateset, osgUtil::CullVisitor* nv) override-+ {-+ stateset->getUniform("projectionMatrix")->set(getEyeProjectionMatrix(1));-+ }-+-+ void setProjectionMatrix(const osg::Matrixf& projectionMatrix) { mProjectionMatrix = projectionMatrix; }-+-+ const osg::Matrixf& getProjectionMatrix() const { return mProjectionMatrix; }-+-+ void enableSkyRTT(int skyTextureUnit, SceneUtil::RTTNode* skyRTT)-+ {-+ mSkyTextureUnit = skyTextureUnit;-+ mSkyRTT = skyRTT;-+ }-+-+ private:-+ osg::Matrixf getEyeProjectionMatrix(int view)-+ {-+ return Stereo::Manager::instance().computeEyeProjection(view, SceneUtil::AutoDepth::isReversed());-+ }-+-+ osg::Matrixf mProjectionMatrix;-+ int mSkyTextureUnit = -1;-+ SceneUtil::RTTNode* mSkyRTT = nullptr;-+-+ Resource::SceneManager* mSceneManager;-+ int mOpaqueTextureUnit = -1;-+ };-+-+ class SharedUniformStateUpdater : public SceneUtil::StateSetUpdater-+ {-+ public:-+ SharedUniformStateUpdater()-+ : mNear(0.f)-+ , mFar(0.f)-+ , mWindSpeed(0.f)-+ , mSkyBlendingStartCoef(Settings::fog().mSkyBlendingStart)-+ {-+ }-+-+ void setDefaults(osg::StateSet* stateset) override-+ {-+ stateset->addUniform(new osg::Uniform("near", 0.f));-+ stateset->addUniform(new osg::Uniform("far", 0.f));-+ stateset->addUniform(new osg::Uniform("skyBlendingStart", 0.f));-+ stateset->addUniform(new osg::Uniform("screenRes", osg::Vec2f{}));-+ stateset->addUniform(new osg::Uniform("isReflection", false));-+ stateset->addUniform(new osg::Uniform("windSpeed", 0.0f));-+ stateset->addUniform(new osg::Uniform("playerPos", osg::Vec3f(0.f, 0.f, 0.f)));-+ stateset->addUniform(new osg::Uniform("useTreeAnim", false));-+ }-+-+ void apply(osg::StateSet* stateset, osg::NodeVisitor* nv) override-+ {-+ stateset->getUniform("near")->set(mNear);-+ stateset->getUniform("far")->set(mFar);-+ stateset->getUniform("skyBlendingStart")->set(mFar * mSkyBlendingStartCoef);-+ stateset->getUniform("screenRes")->set(mScreenRes);-+ stateset->getUniform("windSpeed")->set(mWindSpeed);-+ stateset->getUniform("playerPos")->set(mPlayerPos);-+ }-+-+ void setNear(float near) { mNear = near; }-+-+ void setFar(float far) { mFar = far; }-+-+ void setScreenRes(float width, float height) { mScreenRes = osg::Vec2f(width, height); }-+-+ void setWindSpeed(float windSpeed) { mWindSpeed = windSpeed; }-+-+ void setPlayerPos(osg::Vec3f playerPos) { mPlayerPos = playerPos; }-+-+ private:-+ float mNear;-+ float mFar;-+ float mWindSpeed;-+ float mSkyBlendingStartCoef;-+ osg::Vec3f mPlayerPos;-+ osg::Vec2f mScreenRes;-+ };-+-+ class StateUpdater : public SceneUtil::StateSetUpdater-+ {-+ public:-+ StateUpdater()-+ : mFogStart(0.f)-+ , mFogEnd(0.f)-+ , mWireframe(false)-+ {-+ }-+-+ void setDefaults(osg::StateSet* stateset) override-+ {-+ osg::LightModel* lightModel = new osg::LightModel;-+ stateset->setAttribute(lightModel, osg::StateAttribute::ON);-+ osg::Fog* fog = new osg::Fog;-+ fog->setMode(osg::Fog::LINEAR);-+ stateset->setAttributeAndModes(fog, osg::StateAttribute::ON);-+ if (mWireframe)-+ {-+ osg::PolygonMode* polygonmode = new osg::PolygonMode;-+ polygonmode->setMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE);-+ stateset->setAttributeAndModes(polygonmode, osg::StateAttribute::ON);-+ }-+ else-+ stateset->removeAttribute(osg::StateAttribute::POLYGONMODE);-+ }-+-+ void apply(osg::StateSet* stateset, osg::NodeVisitor*) override-+ {-+ osg::LightModel* lightModel-+ = static_cast<osg::LightModel*>(stateset->getAttribute(osg::StateAttribute::LIGHTMODEL));-+ lightModel->setAmbientIntensity(mAmbientColor);-+ osg::Fog* fog = static_cast<osg::Fog*>(stateset->getAttribute(osg::StateAttribute::FOG));-+ fog->setColor(mFogColor);-+ fog->setStart(mFogStart);-+ fog->setEnd(mFogEnd);-+ }-+-+ void setAmbientColor(const osg::Vec4f& col) { mAmbientColor = col; }-+-+ void setFogColor(const osg::Vec4f& col) { mFogColor = col; }-+-+ void setFogStart(float start) { mFogStart = start; }-+-+ void setFogEnd(float end) { mFogEnd = end; }-+-+ void setWireframe(bool wireframe)-+ {-+ if (mWireframe != wireframe)-+ {-+ mWireframe = wireframe;-+ reset();-+ }-+ }-+-+ bool getWireframe() const { return mWireframe; }-+-+ private:-+ osg::Vec4f mAmbientColor;-+ osg::Vec4f mFogColor;-+ float mFogStart;-+ float mFogEnd;-+ bool mWireframe;-+ };-+-+ class PreloadCommonAssetsWorkItem : public SceneUtil::WorkItem-+ {-+ public:-+ PreloadCommonAssetsWorkItem(Resource::ResourceSystem* resourceSystem)-+ : mResourceSystem(resourceSystem)-+ {-+ }-+-+ void doWork() override-+ {-+ try-+ {-+ for (std::vector<std::string>::const_iterator it = mModels.begin(); it != mModels.end(); ++it)-+ mResourceSystem->getSceneManager()->getTemplate(*it);-+ for (std::vector<std::string>::const_iterator it = mTextures.begin(); it != mTextures.end(); ++it)-+ mResourceSystem->getImageManager()->getImage(*it);-+ for (std::vector<std::string>::const_iterator it = mKeyframes.begin(); it != mKeyframes.end(); ++it)-+ mResourceSystem->getKeyframeManager()->get(*it);-+ }-+ catch (std::exception&)-+ {-+ // ignore error (will be shown when these are needed proper)-+ }-+ }-+-+ std::vector<std::string> mModels;-+ std::vector<std::string> mTextures;-+ std::vector<std::string> mKeyframes;-+-+ private:-+ Resource::ResourceSystem* mResourceSystem;-+ };-+-+ RenderingManager::RenderingManager(osgViewer::Viewer* viewer, osg::ref_ptr<osg::Group> rootNode,-+ Resource::ResourceSystem* resourceSystem, SceneUtil::WorkQueue* workQueue,-+ DetourNavigator::Navigator& navigator, const MWWorld::GroundcoverStore& groundcoverStore,-+ SceneUtil::UnrefQueue& unrefQueue)-+ : mSkyBlending(Settings::fog().mSkyBlending)-+ , mViewer(viewer)-+ , mRootNode(rootNode)-+ , mResourceSystem(resourceSystem)-+ , mWorkQueue(workQueue)-+ , mNavigator(navigator)-+ , mNightEyeFactor(0.f)-+ // TODO: Near clip should not need to be bounded like this, but too small values break OSG shadow calculations-+ // CPU-side. See issue: #6072-+ , mNearClip(Settings::camera().mNearClip)-+ , mViewDistance(Settings::camera().mViewingDistance)-+ , mFieldOfViewOverridden(false)-+ , mFieldOfViewOverride(0.f)-+ , mFieldOfView(Settings::camera().mFieldOfView)-+ , mFirstPersonFieldOfView(Settings::camera().mFirstPersonFieldOfView)-+ , mGroundCoverStore(groundcoverStore)-+ {-+ bool reverseZ = SceneUtil::AutoDepth::isReversed();-+ const SceneUtil::LightingMethod lightingMethod = Settings::shaders().mLightingMethod;-+-+ resourceSystem->getSceneManager()->setParticleSystemMask(MWRender::Mask_ParticleSystem);-+ // Shadows and radial fog have problems with fixed-function mode.-+ bool forceShaders = Settings::fog().mRadialFog || Settings::fog().mExponentialFog-+ || Settings::shaders().mSoftParticles || Settings::shaders().mForceShaders-+ || Settings::shadows().mEnableShadows || lightingMethod != SceneUtil::LightingMethod::FFP || reverseZ-+ || mSkyBlending || Stereo::getMultiview();-+ resourceSystem->getSceneManager()->setForceShaders(forceShaders);-+-+ // FIXME: calling dummy method because terrain needs to know whether lighting is clamped-+ resourceSystem->getSceneManager()->setClampLighting(Settings::shaders().mClampLighting);-+ resourceSystem->getSceneManager()->setAutoUseNormalMaps(Settings::shaders().mAutoUseObjectNormalMaps);-+ resourceSystem->getSceneManager()->setNormalMapPattern(Settings::shaders().mNormalMapPattern);-+ resourceSystem->getSceneManager()->setNormalHeightMapPattern(Settings::shaders().mNormalHeightMapPattern);-+ resourceSystem->getSceneManager()->setAutoUseSpecularMaps(Settings::shaders().mAutoUseObjectSpecularMaps);-+ resourceSystem->getSceneManager()->setSpecularMapPattern(Settings::shaders().mSpecularMapPattern);-+ resourceSystem->getSceneManager()->setApplyLightingToEnvMaps(-+ Settings::shaders().mApplyLightingToEnvironmentMaps);-+ resourceSystem->getSceneManager()->setConvertAlphaTestToAlphaToCoverage(shouldAddMSAAIntermediateTarget());-+ resourceSystem->getSceneManager()->setAdjustCoverageForAlphaTest(-+ Settings::shaders().mAdjustCoverageForAlphaTest);-+-+ // Let LightManager choose which backend to use based on our hint. For methods besides legacy lighting, this-+ // depends on support for various OpenGL extensions.-+ osg::ref_ptr<SceneUtil::LightManager> sceneRoot = new SceneUtil::LightManager(SceneUtil::LightSettings{-+ .mLightingMethod = lightingMethod,-+ .mMaxLights = Settings::shaders().mMaxLights,-+ .mMaximumLightDistance = Settings::shaders().mMaximumLightDistance,-+ .mLightFadeStart = Settings::shaders().mLightFadeStart,-+ .mLightBoundsMultiplier = Settings::shaders().mLightBoundsMultiplier,-+ });-+ resourceSystem->getSceneManager()->setLightingMethod(sceneRoot->getLightingMethod());-+ resourceSystem->getSceneManager()->setSupportedLightingMethods(sceneRoot->getSupportedLightingMethods());-+-+ sceneRoot->setLightingMask(Mask_Lighting);-+ mSceneRoot = sceneRoot;-+ sceneRoot->setStartLight(1);-+ sceneRoot->setNodeMask(Mask_Scene);-+ sceneRoot->setName("Scene Root");-+-+ int shadowCastingTraversalMask = Mask_Scene;-+ if (Settings::shadows().mActorShadows)-+ shadowCastingTraversalMask |= Mask_Actor;-+ if (Settings::shadows().mPlayerShadows)-+ shadowCastingTraversalMask |= Mask_Player;-+-+ int indoorShadowCastingTraversalMask = shadowCastingTraversalMask;-+ if (Settings::shadows().mObjectShadows)-+ shadowCastingTraversalMask |= (Mask_Object | Mask_Static);-+ if (Settings::shadows().mTerrainShadows)-+ shadowCastingTraversalMask |= Mask_Terrain;-+-+ mShadowManager = std::make_unique<SceneUtil::ShadowManager>(sceneRoot, mRootNode, shadowCastingTraversalMask,-+ indoorShadowCastingTraversalMask, Mask_Terrain | Mask_Object | Mask_Static, Settings::shadows(),-+ mResourceSystem->getSceneManager()->getShaderManager());-+-+ Shader::ShaderManager::DefineMap shadowDefines = mShadowManager->getShadowDefines(Settings::shadows());-+ Shader::ShaderManager::DefineMap lightDefines = sceneRoot->getLightDefines();-+ Shader::ShaderManager::DefineMap globalDefines-+ = mResourceSystem->getSceneManager()->getShaderManager().getGlobalDefines();-+-+ for (auto itr = shadowDefines.begin(); itr != shadowDefines.end(); itr++)-+ globalDefines[itr->first] = itr->second;-+-+ globalDefines["forcePPL"] = Settings::shaders().mForcePerPixelLighting ? "1" : "0";-+ globalDefines["clamp"] = Settings::shaders().mClampLighting ? "1" : "0";-+ globalDefines["preLightEnv"] = Settings::shaders().mApplyLightingToEnvironmentMaps ? "1" : "0";-+ const bool exponentialFog = Settings::fog().mExponentialFog;-+ globalDefines["radialFog"] = (exponentialFog || Settings::fog().mRadialFog) ? "1" : "0";-+ globalDefines["exponentialFog"] = exponentialFog ? "1" : "0";-+ globalDefines["skyBlending"] = mSkyBlending ? "1" : "0";-+ globalDefines["refraction_enabled"] = "0";-+ globalDefines["useGPUShader4"] = "0";-+ globalDefines["useOVR_multiview"] = "0";-+ globalDefines["numViews"] = "1";-+ globalDefines["disableNormals"] = "1";-+-+ for (auto itr = lightDefines.begin(); itr != lightDefines.end(); itr++)-+ globalDefines[itr->first] = itr->second;-+-+ // Refactor this at some point - most shaders don't care about these defines-+ const float groundcoverDistance = Settings::groundcover().mRenderingDistance;-+ globalDefines["groundcoverFadeStart"] = std::to_string(groundcoverDistance * 0.9f);-+ globalDefines["groundcoverFadeEnd"] = std::to_string(groundcoverDistance);-+ globalDefines["groundcoverStompMode"] = std::to_string(Settings::groundcover().mStompMode);-+ globalDefines["groundcoverStompIntensity"] = std::to_string(Settings::groundcover().mStompIntensity);-+-+ globalDefines["reverseZ"] = reverseZ ? "1" : "0";-+-+ // It is unnecessary to stop/start the viewer as no frames are being rendered yet.-+ mResourceSystem->getSceneManager()->getShaderManager().setGlobalDefines(globalDefines);-+-+ mNavMesh = std::make_unique<NavMesh>(mRootNode, mWorkQueue, Settings::navigator().mEnableNavMeshRender,-+ Settings::navigator().mNavMeshRenderMode);-+ mActorsPaths = std::make_unique<ActorsPaths>(mRootNode, Settings::navigator().mEnableAgentsPathsRender);-+ mRecastMesh = std::make_unique<RecastMesh>(mRootNode, Settings::navigator().mEnableRecastMeshRender);-+ mPathgrid = std::make_unique<Pathgrid>(mRootNode);-+-+ mObjects = std::make_unique<Objects>(mResourceSystem, sceneRoot, unrefQueue);-+-+ if (getenv("OPENMW_DONT_PRECOMPILE") == nullptr)-+ {-+ mViewer->setIncrementalCompileOperation(new osgUtil::IncrementalCompileOperation);-+ mViewer->getIncrementalCompileOperation()->setTargetFrameRate(Settings::cells().mTargetFramerate);-+ }-+-+ mDebugDraw-+ = std::make_unique<Debug::DebugDrawer>(mResourceSystem->getSceneManager()->getShaderManager(), mRootNode);-+ mResourceSystem->getSceneManager()->setIncrementalCompileOperation(mViewer->getIncrementalCompileOperation());-+-+ mEffectManager = std::make_unique<EffectManager>(sceneRoot, mResourceSystem);-+-+ const std::string& normalMapPattern = Settings::shaders().mNormalMapPattern;-+ const std::string& heightMapPattern = Settings::shaders().mNormalHeightMapPattern;-+ const std::string& specularMapPattern = Settings::shaders().mTerrainSpecularMapPattern;-+ const bool useTerrainNormalMaps = Settings::shaders().mAutoUseTerrainNormalMaps;-+ const bool useTerrainSpecularMaps = Settings::shaders().mAutoUseTerrainSpecularMaps;-+-+ mTerrainStorage = std::make_unique<TerrainStorage>(mResourceSystem, normalMapPattern, heightMapPattern,-+ useTerrainNormalMaps, specularMapPattern, useTerrainSpecularMaps);-+-+ WorldspaceChunkMgr& chunkMgr = getWorldspaceChunkMgr(ESM::Cell::sDefaultWorldspaceId);-+ mTerrain = chunkMgr.mTerrain.get();-+ mGroundcover = chunkMgr.mGroundcover.get();-+ mObjectPaging = chunkMgr.mObjectPaging.get();-+-+ mStateUpdater = new StateUpdater;-+ sceneRoot->addUpdateCallback(mStateUpdater);-+-+ mSharedUniformStateUpdater = new SharedUniformStateUpdater();-+ rootNode->addUpdateCallback(mSharedUniformStateUpdater);-+-+ mPerViewUniformStateUpdater = new PerViewUniformStateUpdater(mResourceSystem->getSceneManager());-+ rootNode->addCullCallback(mPerViewUniformStateUpdater);-+-+ mPostProcessor = new PostProcessor(*this, viewer, mRootNode, resourceSystem->getVFS());-+ resourceSystem->getSceneManager()->setOpaqueDepthTex(-+ mPostProcessor->getTexture(PostProcessor::Tex_OpaqueDepth, 0),-+ mPostProcessor->getTexture(PostProcessor::Tex_OpaqueDepth, 1));-+ resourceSystem->getSceneManager()->setSoftParticles(Settings::shaders().mSoftParticles);-+ resourceSystem->getSceneManager()->setSupportsNormalsRT(mPostProcessor->getSupportsNormalsRT());-+ resourceSystem->getSceneManager()->setWeatherParticleOcclusion(Settings::shaders().mWeatherParticleOcclusion);-+-+ // water goes after terrain for correct waterculling order-+ mWater = std::make_unique<Water>(-+ sceneRoot->getParent(0), sceneRoot, mResourceSystem, mViewer->getIncrementalCompileOperation());-+-+ mCamera = std::make_unique<Camera>(mViewer->getCamera());-+-+ mScreenshotManager-+ = std::make_unique<ScreenshotManager>(viewer, mRootNode, sceneRoot, mResourceSystem, mWater.get());-+-+ mViewer->setLightingMode(osgViewer::View::NO_LIGHT);-+-+ osg::ref_ptr<osg::LightSource> source = new osg::LightSource;-+ source->setNodeMask(Mask_Lighting);-+ mSunLight = new osg::Light;-+ source->setLight(mSunLight);-+ mSunLight->setDiffuse(osg::Vec4f(0, 0, 0, 1));-+ mSunLight->setAmbient(osg::Vec4f(0, 0, 0, 1));-+ mSunLight->setSpecular(osg::Vec4f(0, 0, 0, 0));-+ mSunLight->setConstantAttenuation(1.f);-+ sceneRoot->setSunlight(mSunLight);-+ sceneRoot->addChild(source);-+-+ sceneRoot->getOrCreateStateSet()->setMode(GL_CULL_FACE, osg::StateAttribute::ON);-+ sceneRoot->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::ON);-+ sceneRoot->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON);-+ osg::ref_ptr<osg::Material> defaultMat(new osg::Material);-+ defaultMat->setColorMode(osg::Material::OFF);-+ defaultMat->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4f(1, 1, 1, 1));-+ defaultMat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4f(1, 1, 1, 1));-+ defaultMat->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4f(0.f, 0.f, 0.f, 0.f));-+ sceneRoot->getOrCreateStateSet()->setAttribute(defaultMat);-+ sceneRoot->getOrCreateStateSet()->addUniform(new osg::Uniform("emissiveMult", 1.f));-+ sceneRoot->getOrCreateStateSet()->addUniform(new osg::Uniform("specStrength", 1.f));-+ sceneRoot->getOrCreateStateSet()->addUniform(new osg::Uniform("distortionStrength", 0.f));-+-+ mFog = std::make_unique<FogManager>();-+-+ mSky = std::make_unique<SkyManager>(-+ sceneRoot, mRootNode, mViewer->getCamera(), resourceSystem->getSceneManager(), mSkyBlending);-+ if (mSkyBlending)-+ {-+ int skyTextureUnit = mResourceSystem->getSceneManager()->getShaderManager().reserveGlobalTextureUnits(-+ Shader::ShaderManager::Slot::SkyTexture);-+ mPerViewUniformStateUpdater->enableSkyRTT(skyTextureUnit, mSky->getSkyRTT());-+ }-+-+ source->setStateSetModes(*mRootNode->getOrCreateStateSet(), osg::StateAttribute::ON);-+-+ osg::Camera::CullingMode cullingMode = osg::Camera::DEFAULT_CULLING | osg::Camera::FAR_PLANE_CULLING;-+-+ if (!Settings::camera().mSmallFeatureCulling)-+ cullingMode &= ~(osg::CullStack::SMALL_FEATURE_CULLING);-+ else-+ {-+ mViewer->getCamera()->setSmallFeatureCullingPixelSize(Settings::camera().mSmallFeatureCullingPixelSize);-+ cullingMode |= osg::CullStack::SMALL_FEATURE_CULLING;-+ }-+-+ mViewer->getCamera()->setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);-+ mViewer->getCamera()->setCullingMode(cullingMode);-+ mViewer->getCamera()->setName(Constants::SceneCamera);-+-+ auto mask = ~(Mask_UpdateVisitor | Mask_SimpleWater);-+ MWBase::Environment::get().getWindowManager()->setCullMask(mask);-+ NifOsg::Loader::setHiddenNodeMask(Mask_UpdateVisitor);-+ NifOsg::Loader::setIntersectionDisabledNodeMask(Mask_Effect);-+ Nif::Reader::setLoadUnsupportedFiles(Settings::models().mLoadUnsupportedNifFiles);-+ Nif::Reader::setWriteNifDebugLog(Settings::models().mWriteNifDebugLog);-+-+ mStateUpdater->setFogEnd(mViewDistance);-+-+ // Hopefully, anything genuinely requiring the default alpha func of GL_ALWAYS explicitly sets it-+ mRootNode->getOrCreateStateSet()->setAttribute(Shader::RemovedAlphaFunc::getInstance(GL_ALWAYS));-+ // The transparent renderbin sets alpha testing on because that was faster on old GPUs. It's now slower and-+ // breaks things.-+ mRootNode->getOrCreateStateSet()->setMode(GL_ALPHA_TEST, osg::StateAttribute::OFF);-+-+ if (reverseZ)-+ {-+ osg::ref_ptr<osg::ClipControl> clipcontrol-+ = new osg::ClipControl(osg::ClipControl::LOWER_LEFT, osg::ClipControl::ZERO_TO_ONE);-+ mRootNode->getOrCreateStateSet()->setAttributeAndModes(new SceneUtil::AutoDepth, osg::StateAttribute::ON);-+ mRootNode->getOrCreateStateSet()->setAttributeAndModes(clipcontrol, osg::StateAttribute::ON);-+ }-+-+ SceneUtil::setCameraClearDepth(mViewer->getCamera());-+-+ updateProjectionMatrix();-+-+ mViewer->getCamera()->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);-+ }-+-+ RenderingManager::~RenderingManager()-+ {-+ // let background loading thread finish before we delete anything else-+ mWorkQueue = nullptr;-+ }-+-+ osgUtil::IncrementalCompileOperation* RenderingManager::getIncrementalCompileOperation()-+ {-+ return mViewer->getIncrementalCompileOperation();-+ }-+-+ MWRender::Objects& RenderingManager::getObjects()-+ {-+ return *mObjects.get();-+ }-+-+ Resource::ResourceSystem* RenderingManager::getResourceSystem()-+ {-+ return mResourceSystem;-+ }-+-+ SceneUtil::WorkQueue* RenderingManager::getWorkQueue()-+ {-+ return mWorkQueue.get();-+ }-+-+ Terrain::World* RenderingManager::getTerrain()-+ {-+ return mTerrain;-+ }-+-+ void RenderingManager::preloadCommonAssets()-+ {-+ osg::ref_ptr<PreloadCommonAssetsWorkItem> workItem(new PreloadCommonAssetsWorkItem(mResourceSystem));-+ mSky->listAssetsToPreload(workItem->mModels, workItem->mTextures);-+ mWater->listAssetsToPreload(workItem->mTextures);-+-+ workItem->mModels.push_back(Settings::models().mXbaseanim);-+ workItem->mModels.push_back(Settings::models().mXbaseanim1st);-+ workItem->mModels.push_back(Settings::models().mXbaseanimfemale);-+ workItem->mModels.push_back(Settings::models().mXargonianswimkna);-+-+ workItem->mKeyframes.push_back(Settings::models().mXbaseanimkf);-+ workItem->mKeyframes.push_back(Settings::models().mXbaseanim1stkf);-+ workItem->mKeyframes.push_back(Settings::models().mXbaseanimfemalekf);-+ workItem->mKeyframes.push_back(Settings::models().mXargonianswimknakf);-+-+ workItem->mTextures.emplace_back("textures/_land_default.dds");-+-+ mWorkQueue->addWorkItem(std::move(workItem));-+ }-+-+ double RenderingManager::getReferenceTime() const-+ {-+ return mViewer->getFrameStamp()->getReferenceTime();-+ }-+-+ SceneUtil::LightManager* RenderingManager::getLightRoot()-+ {-+ return mSceneRoot.get();-+ }-+-+ void RenderingManager::setNightEyeFactor(float factor)-+ {-+ if (factor != mNightEyeFactor)-+ {-+ mNightEyeFactor = factor;-+ updateAmbient();-+ }-+ }-+-+ void RenderingManager::setAmbientColour(const osg::Vec4f& colour)-+ {-+ mAmbientColor = colour;-+ updateAmbient();-+ }-+-+ void RenderingManager::skySetDate(int day, int month)-+ {-+ mSky->setDate(day, month);-+ }-+-+ int RenderingManager::skyGetMasserPhase() const-+ {-+ return mSky->getMasserPhase();-+ }-+-+ int RenderingManager::skyGetSecundaPhase() const-+ {-+ return mSky->getSecundaPhase();-+ }-+-+ void RenderingManager::skySetMoonColour(bool red)-+ {-+ mSky->setMoonColour(red);-+ }-+-+ void RenderingManager::configureAmbient(const MWWorld::Cell& cell)-+ {-+ bool isInterior = !cell.isExterior() && !cell.isQuasiExterior();-+ bool needsAdjusting = false;-+ if (mResourceSystem->getSceneManager()->getLightingMethod() != SceneUtil::LightingMethod::FFP)-+ needsAdjusting = isInterior;-+-+ osg::Vec4f ambient = SceneUtil::colourFromRGB(cell.getMood().mAmbiantColor);-+-+ if (needsAdjusting)-+ {-+ constexpr float pR = 0.2126;-+ constexpr float pG = 0.7152;-+ constexpr float pB = 0.0722;-+-+ // we already work in linear RGB so no conversions are needed for the luminosity function-+ float relativeLuminance = pR * ambient.r() + pG * ambient.g() + pB * ambient.b();-+ const float minimumAmbientLuminance = Settings::shaders().mMinimumInteriorBrightness;-+ if (relativeLuminance < minimumAmbientLuminance)-+ {-+ // brighten ambient so it reaches the minimum threshold but no more, we want to mess with content data-+ // as least we can-+ if (ambient.r() == 0.f && ambient.g() == 0.f && ambient.b() == 0.f)-+ ambient = osg::Vec4(-+ minimumAmbientLuminance, minimumAmbientLuminance, minimumAmbientLuminance, ambient.a());-+ else-+ ambient *= minimumAmbientLuminance / relativeLuminance;-+ }-+ }-+-+ setAmbientColour(ambient);-+-+ osg::Vec4f diffuse = SceneUtil::colourFromRGB(cell.getMood().mDirectionalColor);-+-+ setSunColour(diffuse, diffuse, 1.f);-+ // This is total nonsense but it's what Morrowind uses-+ static const osg::Vec4f interiorSunPos-+ = osg::Vec4f(-1.f, osg::DegreesToRadians(45.f), osg::DegreesToRadians(45.f), 0.f);-+ mPostProcessor->getStateUpdater()->setSunPos(interiorSunPos, false);-+ mSunLight->setPosition(interiorSunPos);-+ }-+-+ void RenderingManager::setSunColour(const osg::Vec4f& diffuse, const osg::Vec4f& specular, float sunVis)-+ {-+ // need to wrap this in a StateUpdater?-+ mSunLight->setDiffuse(diffuse);-+ mSunLight->setSpecular(osg::Vec4f(specular.x(), specular.y(), specular.z(), specular.w() * sunVis));-+-+ mPostProcessor->getStateUpdater()->setSunColor(diffuse);-+ mPostProcessor->getStateUpdater()->setSunVis(sunVis);-+ }-+-+ void RenderingManager::setSunDirection(const osg::Vec3f& direction)-+ {-+ osg::Vec3 position = direction * -1;-+ // need to wrap this in a StateUpdater?-+ mSunLight->setPosition(osg::Vec4(position.x(), position.y(), position.z(), 0));-+-+ // The sun is not synchronized with the sunlight because sunlight origin can't reach the horizon-+ // This is based on exterior sun orbit and won't make sense for interiors, see WeatherManager::update-+ position.z() = 400.f - std::abs(position.x());-+ mSky->setSunDirection(position);-+-+ mPostProcessor->getStateUpdater()->setSunPos(osg::Vec4f(position, 0.f), mNight);-+ }-+-+ void RenderingManager::addCell(const MWWorld::CellStore* store)-+ {-+ mPathgrid->addCell(store);-+-+ mWater->changeCell(store);-+-+ if (store->getCell()->isExterior())-+ {-+ enableTerrain(true, store->getCell()->getWorldSpace());-+ mTerrain->loadCell(store->getCell()->getGridX(), store->getCell()->getGridY());-+ }-+ }-+ void RenderingManager::removeCell(const MWWorld::CellStore* store)-+ {-+ mPathgrid->removeCell(store);-+ mActorsPaths->removeCell(store);-+ mObjects->removeCell(store);-+-+ if (store->getCell()->isExterior())-+ {-+ getWorldspaceChunkMgr(store->getCell()->getWorldSpace())-+ .mTerrain->unloadCell(store->getCell()->getGridX(), store->getCell()->getGridY());-+ }-+-+ mWater->removeCell(store);-+ }-+-+ void RenderingManager::enableTerrain(bool enable, ESM::RefId worldspace)-+ {-+ if (!enable)-+ mWater->setCullCallback(nullptr);-+ else-+ {-+ WorldspaceChunkMgr& newChunks = getWorldspaceChunkMgr(worldspace);-+ if (newChunks.mTerrain.get() != mTerrain)-+ {-+ mTerrain->enable(false);-+ mTerrain = newChunks.mTerrain.get();-+ mGroundcover = newChunks.mGroundcover.get();-+ mObjectPaging = newChunks.mObjectPaging.get();-+ }-+ }-+ mTerrain->enable(enable);-+ }-+-+ void RenderingManager::setSkyEnabled(bool enabled)-+ {-+ mSky->setEnabled(enabled);-+ if (enabled)-+ mShadowManager->enableOutdoorMode();-+ else-+ mShadowManager->enableIndoorMode(Settings::shadows());-+ mPostProcessor->getStateUpdater()->setIsInterior(!enabled);-+ }-+-+ bool RenderingManager::toggleBorders()-+ {-+ bool borders = !mTerrain->getBordersVisible();-+ mTerrain->setBordersVisible(borders);-+ return borders;-+ }-+-+ bool RenderingManager::toggleRenderMode(RenderMode mode)-+ {-+ if (mode == Render_CollisionDebug || mode == Render_Pathgrid)-+ return mPathgrid->toggleRenderMode(mode);-+ else if (mode == Render_Wireframe)-+ {-+ bool wireframe = !mStateUpdater->getWireframe();-+ mStateUpdater->setWireframe(wireframe);-+ return wireframe;-+ }-+ else if (mode == Render_Water)-+ {-+ return mWater->toggle();-+ }-+ else if (mode == Render_Scene)-+ {-+ const auto wm = MWBase::Environment::get().getWindowManager();-+ unsigned int mask = wm->getCullMask();-+ bool enabled = !(mask & sToggleWorldMask);-+ if (enabled)-+ mask |= sToggleWorldMask;-+ else-+ mask &= ~sToggleWorldMask;-+ mWater->showWorld(enabled);-+ wm->setCullMask(mask);-+ return enabled;-+ }-+ else if (mode == Render_NavMesh)-+ {-+ return mNavMesh->toggle();-+ }-+ else if (mode == Render_ActorsPaths)-+ {-+ return mActorsPaths->toggle();-+ }-+ else if (mode == Render_RecastMesh)-+ {-+ return mRecastMesh->toggle();-+ }-+ return false;-+ }-+-+ void RenderingManager::configureFog(const MWWorld::Cell& cell)-+ {-+ mFog->configure(mViewDistance, cell);-+ }-+-+ void RenderingManager::configureFog(-+ float fogDepth, float underwaterFog, float dlFactor, float dlOffset, const osg::Vec4f& color)-+ {-+ mFog->configure(mViewDistance, fogDepth, underwaterFog, dlFactor, dlOffset, color);-+ }-+-+ SkyManager* RenderingManager::getSkyManager()-+ {-+ return mSky.get();-+ }-+-+ void RenderingManager::update(float dt, bool paused)-+ {-+ reportStats();-+-+ mResourceSystem->getSceneManager()->getShaderManager().update(*mViewer);-+-+ float rainIntensity = mSky->getPrecipitationAlpha();-+ mWater->setRainIntensity(rainIntensity);-+ mWater->setRainRipplesEnabled(mSky->getRainRipplesEnabled());-+-+ mWater->update(dt, paused);-+ if (!paused)-+ {-+ mEffectManager->update(dt);-+ mSky->update(dt);-+-+ const MWWorld::Ptr& player = mPlayerAnimation->getPtr();-+ osg::Vec3f playerPos(player.getRefData().getPosition().asVec3());-+-+ float windSpeed = mSky->getBaseWindSpeed();-+ mSharedUniformStateUpdater->setWindSpeed(windSpeed);-+ mSharedUniformStateUpdater->setPlayerPos(playerPos);-+ }-+-+ updateNavMesh();-+ updateRecastMesh();-+-+ if (mUpdateProjectionMatrix)-+ {-+ mUpdateProjectionMatrix = false;-+ updateProjectionMatrix();-+ }-+ mCamera->update(dt, paused);-+-+ bool isUnderwater = mWater->isUnderwater(mCamera->getPosition());-+-+ float fogStart = mFog->getFogStart(isUnderwater);-+ float fogEnd = mFog->getFogEnd(isUnderwater);-+ osg::Vec4f fogColor = mFog->getFogColor(isUnderwater);-+-+ mStateUpdater->setFogStart(fogStart);-+ mStateUpdater->setFogEnd(fogEnd);-+ setFogColor(fogColor);-+-+ auto world = MWBase::Environment::get().getWorld();-+ const auto& stateUpdater = mPostProcessor->getStateUpdater();-+-+ stateUpdater->setFogRange(fogStart, fogEnd);-+ stateUpdater->setNearFar(mNearClip, mViewDistance);-+ stateUpdater->setIsUnderwater(isUnderwater);-+ stateUpdater->setFogColor(fogColor);-+ stateUpdater->setGameHour(world->getTimeStamp().getHour());-+ stateUpdater->setWeatherId(world->getCurrentWeather());-+ stateUpdater->setNextWeatherId(world->getNextWeather());-+ stateUpdater->setWeatherTransition(world->getWeatherTransition());-+ stateUpdater->setWindSpeed(world->getWindSpeed());-+ stateUpdater->setSkyColor(mSky->getSkyColor());-+ mPostProcessor->setUnderwaterFlag(isUnderwater);-+ }-+-+ void RenderingManager::updatePlayerPtr(const MWWorld::Ptr& ptr)-+ {-+ if (mPlayerAnimation.get())-+ {-+ setupPlayer(ptr);-+ mPlayerAnimation->updatePtr(ptr);-+ }-+ mCamera->attachTo(ptr);-+ }-+-+ void RenderingManager::removePlayer(const MWWorld::Ptr& player)-+ {-+ mWater->removeEmitter(player);-+ }-+-+ void RenderingManager::rotateObject(const MWWorld::Ptr& ptr, const osg::Quat& rot)-+ {-+ if (ptr == mCamera->getTrackingPtr() && !mCamera->isVanityOrPreviewModeEnabled())-+ {-+ mCamera->rotateCameraToTrackingPtr();-+ }-+-+ ptr.getRefData().getBaseNode()->setAttitude(rot);-+ }-+-+ void RenderingManager::moveObject(const MWWorld::Ptr& ptr, const osg::Vec3f& pos)-+ {-+ ptr.getRefData().getBaseNode()->setPosition(pos);-+ }-+-+ void RenderingManager::scaleObject(const MWWorld::Ptr& ptr, const osg::Vec3f& scale)-+ {-+ ptr.getRefData().getBaseNode()->setScale(scale);-+-+ if (ptr == mCamera->getTrackingPtr()) // update height of camera-+ mCamera->processViewChange();-+ }-+-+ void RenderingManager::removeObject(const MWWorld::Ptr& ptr)-+ {-+ mActorsPaths->remove(ptr);-+ mObjects->removeObject(ptr);-+ mWater->removeEmitter(ptr);-+ }-+-+ void RenderingManager::setWaterEnabled(bool enabled)-+ {-+ mWater->setEnabled(enabled);-+ mSky->setWaterEnabled(enabled);-+-+ mPostProcessor->getStateUpdater()->setIsWaterEnabled(enabled);-+ }-+-+ void RenderingManager::setWaterHeight(float height)-+ {-+ mWater->setCullCallback(mTerrain->getHeightCullCallback(height, Mask_Water));-+ mWater->setHeight(height);-+ mSky->setWaterHeight(height);-+-+ mPostProcessor->getStateUpdater()->setWaterHeight(height);-+ }-+-+ void RenderingManager::screenshot(osg::Image* image, int w, int h)-+ {-+ mScreenshotManager->screenshot(image, w, h);-+ }-+-+ bool RenderingManager::screenshot360(osg::Image* image)-+ {-+ if (mCamera->isVanityOrPreviewModeEnabled())-+ {-+ Log(Debug::Warning) << "Spherical screenshots are not allowed in preview mode.";-+ return false;-+ }-+-+ mScreenshotManager->screenshot360(image);-+-+ return true;-+ }-+-+ osg::Vec4f RenderingManager::getScreenBounds(const osg::BoundingBox& worldbb)-+ {-+ if (!worldbb.valid())-+ return osg::Vec4f();-+ osg::Matrix viewProj = mViewer->getCamera()->getViewMatrix() * mViewer->getCamera()->getProjectionMatrix();-+ float min_x = 1.0f, max_x = 0.0f, min_y = 1.0f, max_y = 0.0f;-+ for (int i = 0; i < 8; ++i)-+ {-+ osg::Vec3f corner = worldbb.corner(i);-+ corner = corner * viewProj;-+-+ float x = (corner.x() + 1.f) * 0.5f;-+ float y = (corner.y() - 1.f) * (-0.5f);-+-+ if (x < min_x)-+ min_x = x;-+-+ if (x > max_x)-+ max_x = x;-+-+ if (y < min_y)-+ min_y = y;-+-+ if (y > max_y)-+ max_y = y;-+ }-+-+ return osg::Vec4f(min_x, min_y, max_x, max_y);-+ }-+-+ RenderingManager::RayResult getIntersectionResult(osgUtil::LineSegmentIntersector* intersector,-+ const osg::ref_ptr<osgUtil::IntersectionVisitor>& visitor, std::span<const MWWorld::Ptr> ignoreList = {})-+ {-+ RenderingManager::RayResult result;-+ result.mHit = false;-+ result.mRatio = 0;-+-+ if (!intersector->containsIntersections())-+ return result;-+-+ auto test = [&](const osgUtil::LineSegmentIntersector::Intersection& intersection) {-+ PtrHolder* ptrHolder = nullptr;-+ std::vector<RefnumMarker*> refnumMarkers;-+ for (osg::NodePath::const_iterator it = intersection.nodePath.begin(); it != intersection.nodePath.end();-+ ++it)-+ {-+ osg::UserDataContainer* userDataContainer = (*it)->getUserDataContainer();-+ if (!userDataContainer)-+ continue;-+ for (unsigned int i = 0; i < userDataContainer->getNumUserObjects(); ++i)-+ {-+ if (PtrHolder* p = dynamic_cast<PtrHolder*>(userDataContainer->getUserObject(i)))-+ {-+ if (std::find(ignoreList.begin(), ignoreList.end(), p->mPtr) == ignoreList.end())-+ {-+ ptrHolder = p;-+ }-+ }-+ if (RefnumMarker* r = dynamic_cast<RefnumMarker*>(userDataContainer->getUserObject(i)))-+ {-+ refnumMarkers.push_back(r);-+ }-+ }-+ }-+-+ if (ptrHolder)-+ result.mHitObject = ptrHolder->mPtr;-+-+ unsigned int vertexCounter = 0;-+ for (unsigned int i = 0; i < refnumMarkers.size(); ++i)-+ {-+ unsigned int intersectionIndex = intersection.indexList.empty() ? 0 : intersection.indexList[0];-+ if (!refnumMarkers[i]->mNumVertices-+ || (intersectionIndex >= vertexCounter-+ && intersectionIndex < vertexCounter + refnumMarkers[i]->mNumVertices))-+ {-+ auto it = std::find_if(-+ ignoreList.begin(), ignoreList.end(), [target = refnumMarkers[i]->mRefnum](const auto& ptr) {-+ return target == ptr.getCellRef().getRefNum();-+ });-+-+ if (it == ignoreList.end())-+ {-+ result.mHitRefnum = refnumMarkers[i]->mRefnum;-+ }-+-+ break;-+ }-+ vertexCounter += refnumMarkers[i]->mNumVertices;-+ }-+-+ if (!result.mHitObject.isEmpty() || result.mHitRefnum.isSet())-+ {-+ result.mHit = true;-+ result.mHitPointWorld = intersection.getWorldIntersectPoint();-+ result.mHitNormalWorld = intersection.getWorldIntersectNormal();-+ result.mRatio = intersection.ratio;-+ }-+ };-+-+ if (ignoreList.empty() || intersector->getIntersectionLimit() != osgUtil::LineSegmentIntersector::NO_LIMIT)-+ {-+ test(intersector->getFirstIntersection());-+ }-+ else-+ {-+ for (const auto& intersection : intersector->getIntersections())-+ {-+ test(intersection);-+-+ if (result.mHit)-+ {-+ break;-+ }-+ }-+ }-+-+ return result;-+ }-+-+ class IntersectionVisitorWithIgnoreList : public osgUtil::IntersectionVisitor-+ {-+ public:-+ bool skipTransform(osg::Transform& transform)-+ {-+ if (mContainsPagedRefs)-+ return false;-+-+ osg::UserDataContainer* userDataContainer = transform.getUserDataContainer();-+ if (!userDataContainer)-+ return false;-+-+ for (unsigned int i = 0; i < userDataContainer->getNumUserObjects(); ++i)-+ {-+ if (PtrHolder* p = dynamic_cast<PtrHolder*>(userDataContainer->getUserObject(i)))-+ {-+ if (std::find(mIgnoreList.begin(), mIgnoreList.end(), p->mPtr) != mIgnoreList.end())-+ {-+ return true;-+ }-+ }-+ }-+-+ return false;-+ }-+-+ void apply(osg::Transform& transform) override-+ {-+ if (skipTransform(transform))-+ {-+ return;-+ }-+ osgUtil::IntersectionVisitor::apply(transform);-+ }-+-+ void setIgnoreList(std::span<const MWWorld::Ptr> ignoreList) { mIgnoreList = ignoreList; }-+ void setContainsPagedRefs(bool contains) { mContainsPagedRefs = contains; }-+-+ private:-+ std::span<const MWWorld::Ptr> mIgnoreList;-+ bool mContainsPagedRefs = false;-+ };-+-+ osg::ref_ptr<osgUtil::IntersectionVisitor> RenderingManager::getIntersectionVisitor(-+ osgUtil::Intersector* intersector, bool ignorePlayer, bool ignoreActors,-+ std::span<const MWWorld::Ptr> ignoreList)-+ {-+ if (!mIntersectionVisitor)-+ mIntersectionVisitor = new IntersectionVisitorWithIgnoreList;-+-+ mIntersectionVisitor->setIgnoreList(ignoreList);-+ mIntersectionVisitor->setContainsPagedRefs(false);-+-+ MWWorld::Scene* worldScene = MWBase::Environment::get().getWorldScene();-+ for (const auto& ptr : ignoreList)-+ {-+ if (worldScene->isPagedRef(ptr))-+ {-+ mIntersectionVisitor->setContainsPagedRefs(true);-+ intersector->setIntersectionLimit(osgUtil::LineSegmentIntersector::NO_LIMIT);-+ break;-+ }-+ }-+-+ mIntersectionVisitor->setTraversalNumber(mViewer->getFrameStamp()->getFrameNumber());-+ mIntersectionVisitor->setFrameStamp(mViewer->getFrameStamp());-+ mIntersectionVisitor->setIntersector(intersector);-+-+ unsigned int mask = ~0u;-+ mask &= ~(Mask_RenderToTexture | Mask_Sky | Mask_Debug | Mask_Effect | Mask_Water | Mask_SimpleWater-+ | Mask_Groundcover);-+ if (ignorePlayer)-+ mask &= ~(Mask_Player);-+ if (ignoreActors)-+ mask &= ~(Mask_Actor | Mask_Player);-+-+ mIntersectionVisitor->setTraversalMask(mask);-+ return mIntersectionVisitor;-+ }-+-+ RenderingManager::RayResult RenderingManager::castRay(const osg::Vec3f& origin, const osg::Vec3f& dest,-+ bool ignorePlayer, bool ignoreActors, std::span<const MWWorld::Ptr> ignoreList)-+ {-+ osg::ref_ptr<osgUtil::LineSegmentIntersector> intersector(-+ new osgUtil::LineSegmentIntersector(osgUtil::LineSegmentIntersector::MODEL, origin, dest));-+ intersector->setIntersectionLimit(osgUtil::LineSegmentIntersector::LIMIT_NEAREST);-+-+ mRootNode->accept(*getIntersectionVisitor(intersector, ignorePlayer, ignoreActors, ignoreList));-+-+ return getIntersectionResult(intersector, mIntersectionVisitor, ignoreList);-+ }-+-+ RenderingManager::RayResult RenderingManager::castCameraToViewportRay(-+ const float nX, const float nY, float maxDistance, bool ignorePlayer, bool ignoreActors)-+ {-+ osg::ref_ptr<osgUtil::LineSegmentIntersector> intersector(new osgUtil::LineSegmentIntersector(-+ osgUtil::LineSegmentIntersector::PROJECTION, nX * 2.f - 1.f, nY * (-2.f) + 1.f));-+-+ osg::Vec3d dist(0.f, 0.f, -maxDistance);-+-+ dist = dist * mViewer->getCamera()->getProjectionMatrix();-+-+ osg::Vec3d end = intersector->getEnd();-+ end.z() = dist.z();-+ intersector->setEnd(end);-+ intersector->setIntersectionLimit(osgUtil::LineSegmentIntersector::LIMIT_NEAREST);-+-+ mViewer->getCamera()->accept(*getIntersectionVisitor(intersector, ignorePlayer, ignoreActors));-+-+ return getIntersectionResult(intersector, mIntersectionVisitor);-+ }-+-+ void RenderingManager::updatePtr(const MWWorld::Ptr& old, const MWWorld::Ptr& updated)-+ {-+ mObjects->updatePtr(old, updated);-+ mActorsPaths->updatePtr(old, updated);-+ }-+-+ void RenderingManager::spawnEffect(const std::string& model, std::string_view texture,-+ const osg::Vec3f& worldPosition, float scale, bool isMagicVFX)-+ {-+ mEffectManager->addEffect(model, texture, worldPosition, scale, isMagicVFX);-+ }-+-+ void RenderingManager::notifyWorldSpaceChanged()-+ {-+ mEffectManager->clear();-+ mWater->clearRipples();-+ }-+-+ void RenderingManager::clear()-+ {-+ mSky->setMoonColour(false);-+-+ notifyWorldSpaceChanged();-+ if (mObjectPaging)-+ mObjectPaging->clear();-+ }-+-+ MWRender::Animation* RenderingManager::getAnimation(const MWWorld::Ptr& ptr)-+ {-+ if (mPlayerAnimation.get() && ptr == mPlayerAnimation->getPtr())-+ return mPlayerAnimation.get();-+-+ return mObjects->getAnimation(ptr);-+ }-+-+ const MWRender::Animation* RenderingManager::getAnimation(const MWWorld::ConstPtr& ptr) const-+ {-+ if (mPlayerAnimation.get() && ptr == mPlayerAnimation->getPtr())-+ return mPlayerAnimation.get();-+-+ return mObjects->getAnimation(ptr);-+ }-+-+ PostProcessor* RenderingManager::getPostProcessor()-+ {-+ return mPostProcessor;-+ }-+-+ void RenderingManager::setupPlayer(const MWWorld::Ptr& player)-+ {-+ if (!mPlayerNode)-+ {-+ mPlayerNode = new SceneUtil::PositionAttitudeTransform;-+ mPlayerNode->setNodeMask(Mask_Player);-+ mPlayerNode->setName("Player Root");-+ mSceneRoot->addChild(mPlayerNode);-+ }-+-+ mPlayerNode->setUserDataContainer(new osg::DefaultUserDataContainer);-+ mPlayerNode->getUserDataContainer()->addUserObject(new PtrHolder(player));-+-+ player.getRefData().setBaseNode(mPlayerNode);-+-+ mWater->removeEmitter(player);-+ mWater->addEmitter(player);-+ }-+-+ void RenderingManager::renderPlayer(const MWWorld::Ptr& player)-+ {-+ mPlayerAnimation = new NpcAnimation(player, player.getRefData().getBaseNode(), mResourceSystem, 0,-+ NpcAnimation::VM_Normal, mFirstPersonFieldOfView);-+-+ mCamera->setAnimation(mPlayerAnimation.get());-+ mCamera->attachTo(player);-+ }-+-+ void RenderingManager::rebuildPtr(const MWWorld::Ptr& ptr)-+ {-+ NpcAnimation* anim = nullptr;-+ if (ptr == mPlayerAnimation->getPtr())-+ anim = mPlayerAnimation.get();-+ else-+ anim = dynamic_cast<NpcAnimation*>(mObjects->getAnimation(ptr));-+ if (anim)-+ {-+ anim->rebuild();-+ if (mCamera->getTrackingPtr() == ptr)-+ {-+ mCamera->attachTo(ptr);-+ mCamera->setAnimation(anim);-+ }-+ }-+ }-+-+ void RenderingManager::addWaterRippleEmitter(const MWWorld::Ptr& ptr)-+ {-+ mWater->addEmitter(ptr);-+ }-+-+ void RenderingManager::removeWaterRippleEmitter(const MWWorld::Ptr& ptr)-+ {-+ mWater->removeEmitter(ptr);-+ }-+-+ void RenderingManager::emitWaterRipple(const osg::Vec3f& pos)-+ {-+ mWater->emitRipple(pos);-+ }-+-+ void RenderingManager::updateProjectionMatrix()-+ {-+ if (mNearClip < 0.0f)-+ throw std::runtime_error("Near clip is less than zero");-+ if (mViewDistance < mNearClip)-+ throw std::runtime_error("Viewing distance is less than near clip");-+-+ const double width = Settings::video().mResolutionX;-+ const double height = Settings::video().mResolutionY;-+-+ double aspect = (height == 0.0) ? 1.0 : width / height;-+ float fov = mFieldOfView;-+ if (mFieldOfViewOverridden)-+ fov = mFieldOfViewOverride;-+-+ mViewer->getCamera()->setProjectionMatrixAsPerspective(fov, aspect, mNearClip, mViewDistance);-+-+ if (SceneUtil::AutoDepth::isReversed())-+ {-+ mPerViewUniformStateUpdater->setProjectionMatrix(-+ SceneUtil::getReversedZProjectionMatrixAsPerspective(fov, aspect, mNearClip, mViewDistance));-+ }-+ else-+ mPerViewUniformStateUpdater->setProjectionMatrix(mViewer->getCamera()->getProjectionMatrix());-+-+ mSharedUniformStateUpdater->setNear(mNearClip);-+ mSharedUniformStateUpdater->setFar(mViewDistance);-+ if (Stereo::getStereo())-+ {-+ auto res = Stereo::Manager::instance().eyeResolution();-+ mSharedUniformStateUpdater->setScreenRes(res.x(), res.y());-+ Stereo::Manager::instance().setMasterProjectionMatrix(mPerViewUniformStateUpdater->getProjectionMatrix());-+ }-+ else-+ {-+ mSharedUniformStateUpdater->setScreenRes(width, height);-+ }-+-+ // Since our fog is not radial yet, we should take FOV in account, otherwise terrain near viewing distance may-+ // disappear. Limit FOV here just for sure, otherwise viewing distance can be too high.-+ float distanceMult = std::cos(osg::DegreesToRadians(std::min(fov, 140.f)) / 2.f);-+ mTerrain->setViewDistance(mViewDistance * (distanceMult ? 1.f / distanceMult : 1.f));-+-+ if (mPostProcessor)-+ {-+ mPostProcessor->getStateUpdater()->setProjectionMatrix(mPerViewUniformStateUpdater->getProjectionMatrix());-+ mPostProcessor->getStateUpdater()->setFov(fov);-+ }-+ }-+-+ void RenderingManager::setScreenRes(int width, int height)-+ {-+ mSharedUniformStateUpdater->setScreenRes(width, height);-+ }-+-+ void RenderingManager::updateTextureFiltering()-+ {-+ mViewer->stopThreading();-+-+ mResourceSystem->getSceneManager()->setFilterSettings(Settings::general().mTextureMagFilter,-+ Settings::general().mTextureMinFilter, Settings::general().mTextureMipmap, Settings::general().mAnisotropy);-+-+ mTerrain->updateTextureFiltering();-+ mWater->processChangedSettings({});-+-+ mViewer->startThreading();-+ }-+-+ void RenderingManager::updateAmbient()-+ {-+ osg::Vec4f color = mAmbientColor;-+-+ if (mNightEyeFactor > 0.f)-+ color += osg::Vec4f(0.7, 0.7, 0.7, 0.0) * mNightEyeFactor;-+-+ mPostProcessor->getStateUpdater()->setAmbientColor(color);-+ mStateUpdater->setAmbientColor(color);-+ }-+-+ void RenderingManager::setFogColor(const osg::Vec4f& color)-+ {-+ mViewer->getCamera()->setClearColor(color);-+-+ mStateUpdater->setFogColor(color);-+ }-+-+ RenderingManager::WorldspaceChunkMgr& RenderingManager::getWorldspaceChunkMgr(ESM::RefId worldspace)-+ {-+ auto existingChunkMgr = mWorldspaceChunks.find(worldspace);-+ if (existingChunkMgr != mWorldspaceChunks.end())-+ return existingChunkMgr->second;-+ RenderingManager::WorldspaceChunkMgr newChunkMgr;-+-+ const float lodFactor = Settings::terrain().mLodFactor;-+ const bool groundcover = Settings::groundcover().mEnabled;-+ const bool distantTerrain = Settings::terrain().mDistantTerrain;-+ const double expiryDelay = Settings::cells().mCacheExpiryDelay;-+ if (distantTerrain || groundcover)-+ {-+ const int compMapResolution = Settings::terrain().mCompositeMapResolution;-+ const int compMapPower = Settings::terrain().mCompositeMapLevel;-+ const float compMapLevel = std::pow(2, compMapPower);-+ const int vertexLodMod = Settings::terrain().mVertexLodMod;-+ const float maxCompGeometrySize = Settings::terrain().mMaxCompositeGeometrySize;-+ const bool debugChunks = Settings::terrain().mDebugChunks;-+ auto quadTreeWorld = std::make_unique<Terrain::QuadTreeWorld>(mSceneRoot, mRootNode, mResourceSystem,-+ mTerrainStorage.get(), Mask_Terrain, Mask_PreCompile, Mask_Debug, compMapResolution, compMapLevel,-+ lodFactor, vertexLodMod, maxCompGeometrySize, debugChunks, worldspace, expiryDelay);-+ if (Settings::terrain().mObjectPaging)-+ {-+ newChunkMgr.mObjectPaging-+ = std::make_unique<ObjectPaging>(mResourceSystem->getSceneManager(), worldspace);-+ quadTreeWorld->addChunkManager(newChunkMgr.mObjectPaging.get());-+ mResourceSystem->addResourceManager(newChunkMgr.mObjectPaging.get());-+ }-+ if (groundcover)-+ {-+ const float groundcoverDistance = Settings::groundcover().mRenderingDistance;-+ const float density = Settings::groundcover().mDensity;-+-+ newChunkMgr.mGroundcover = std::make_unique<Groundcover>(-+ mResourceSystem->getSceneManager(), density, groundcoverDistance, mGroundCoverStore);-+ quadTreeWorld->addChunkManager(newChunkMgr.mGroundcover.get());-+ mResourceSystem->addResourceManager(newChunkMgr.mGroundcover.get());-+ }-+ newChunkMgr.mTerrain = std::move(quadTreeWorld);-+ }-+ else-+ newChunkMgr.mTerrain = std::make_unique<Terrain::TerrainGrid>(mSceneRoot, mRootNode, mResourceSystem,-+ mTerrainStorage.get(), Mask_Terrain, worldspace, expiryDelay, Mask_PreCompile, Mask_Debug);-+-+ newChunkMgr.mTerrain->setTargetFrameRate(Settings::cells().mTargetFramerate);-+ float distanceMult = std::cos(osg::DegreesToRadians(std::min(mFieldOfView, 140.f)) / 2.f);-+ newChunkMgr.mTerrain->setViewDistance(mViewDistance * (distanceMult ? 1.f / distanceMult : 1.f));-+-+ return mWorldspaceChunks.emplace(worldspace, std::move(newChunkMgr)).first->second;-+ }-+-+ void RenderingManager::reportStats() const-+ {-+ osg::Stats* stats = mViewer->getViewerStats();-+ unsigned int frameNumber = mViewer->getFrameStamp()->getFrameNumber();-+ if (stats->collectStats("resource"))-+ {-+ mTerrain->reportStats(frameNumber, stats);-+ }-+ }-+-+ void RenderingManager::processChangedSettings(const Settings::CategorySettingVector& changed)-+ {-+ // Only perform a projection matrix update once if a relevant setting is changed.-+ bool updateProjection = false;-+-+ for (Settings::CategorySettingVector::const_iterator it = changed.begin(); it != changed.end(); ++it)-+ {-+ if (it->first == "Camera" && it->second == "field of view")-+ {-+ mFieldOfView = Settings::camera().mFieldOfView;-+ updateProjection = true;-+ }-+ else if (it->first == "Video" && (it->second == "resolution x" || it->second == "resolution y"))-+ {-+ updateProjection = true;-+ }-+ else if (it->first == "Camera" && it->second == "viewing distance")-+ {-+ setViewDistance(Settings::camera().mViewingDistance);-+ }-+ else if (it->first == "General"-+ && (it->second == "texture filter" || it->second == "texture mipmap" || it->second == "anisotropy"))-+ {-+ updateTextureFiltering();-+ }-+ else if (it->first == "Water")-+ {-+ mWater->processChangedSettings(changed);-+ }-+ else if (it->first == "Shaders" && it->second == "minimum interior brightness")-+ {-+ if (MWMechanics::getPlayer().isInCell())-+ configureAmbient(*MWMechanics::getPlayer().getCell()->getCell());-+ }-+ else if (it->first == "Shaders"-+ && (it->second == "light bounds multiplier" || it->second == "maximum light distance"-+ || it->second == "light fade start" || it->second == "max lights"))-+ {-+ auto* lightManager = getLightRoot();-+-+ lightManager->processChangedSettings(Settings::shaders().mLightBoundsMultiplier,-+ Settings::shaders().mMaximumLightDistance, Settings::shaders().mLightFadeStart);-+-+ if (it->second == "max lights" && !lightManager->usingFFP())-+ {-+ mViewer->stopThreading();-+-+ lightManager->updateMaxLights(Settings::shaders().mMaxLights);-+-+ auto defines = mResourceSystem->getSceneManager()->getShaderManager().getGlobalDefines();-+ for (const auto& [name, key] : lightManager->getLightDefines())-+ defines[name] = key;-+ mResourceSystem->getSceneManager()->getShaderManager().setGlobalDefines(defines);-+-+ mStateUpdater->reset();-+-+ mViewer->startThreading();-+ }-+ }-+ else if (it->first == "Post Processing" && it->second == "enabled")-+ {-+ if (Settings::postProcessing().mEnabled)-+ mPostProcessor->enable();-+ else-+ {-+ mPostProcessor->disable();-+ if (auto* hud = MWBase::Environment::get().getWindowManager()->getPostProcessorHud())-+ hud->setVisible(false);-+ }-+ }-+ }-+-+ if (updateProjection)-+ {-+ updateProjectionMatrix();-+ }-+ }-+-+ void RenderingManager::setViewDistance(float distance, bool delay)-+ {-+ mViewDistance = distance;-+-+ if (delay)-+ {-+ mUpdateProjectionMatrix = true;-+ return;-+ }-+-+ updateProjectionMatrix();-+ }-+-+ float RenderingManager::getTerrainHeightAt(const osg::Vec3f& pos, ESM::RefId worldspace)-+ {-+ return getWorldspaceChunkMgr(worldspace).mTerrain->getHeightAt(pos);-+ }-+-+ void RenderingManager::overrideFieldOfView(float val)-+ {-+ if (mFieldOfViewOverridden != true || mFieldOfViewOverride != val)-+ {-+ mFieldOfViewOverridden = true;-+ mFieldOfViewOverride = val;-+ updateProjectionMatrix();-+ }-+ }-+-+ void RenderingManager::setFieldOfView(float val)-+ {-+ mFieldOfView = val;-+ mUpdateProjectionMatrix = true;-+ }-+-+ float RenderingManager::getFieldOfView() const-+ {-+ return mFieldOfViewOverridden ? mFieldOfViewOverridden : mFieldOfView;-+ }-+-+ osg::Vec3f RenderingManager::getHalfExtents(const MWWorld::ConstPtr& object) const-+ {-+ osg::Vec3f halfExtents(0, 0, 0);-+ std::string modelName = object.getClass().getCorrectedModel(object);-+ if (modelName.empty())-+ return halfExtents;-+-+ osg::ref_ptr<const osg::Node> node = mResourceSystem->getSceneManager()->getTemplate(modelName);-+ osg::ComputeBoundsVisitor computeBoundsVisitor;-+ computeBoundsVisitor.setTraversalMask(~(MWRender::Mask_ParticleSystem | MWRender::Mask_Effect));-+ const_cast<osg::Node*>(node.get())->accept(computeBoundsVisitor);-+ osg::BoundingBox bounds = computeBoundsVisitor.getBoundingBox();-+-+ if (bounds.valid())-+ {-+ halfExtents[0] = std::abs(bounds.xMax() - bounds.xMin()) / 2.f;-+ halfExtents[1] = std::abs(bounds.yMax() - bounds.yMin()) / 2.f;-+ halfExtents[2] = std::abs(bounds.zMax() - bounds.zMin()) / 2.f;-+ }-+-+ return halfExtents;-+ }-+-+ osg::BoundingBox RenderingManager::getCullSafeBoundingBox(const MWWorld::Ptr& ptr) const-+ {-+ const std::string model = ptr.getClass().getCorrectedModel(ptr);-+ if (model.empty())-+ return {};-+-+ osg::ref_ptr<SceneUtil::PositionAttitudeTransform> rootNode = new SceneUtil::PositionAttitudeTransform;-+ // Hack even used by osg internally, osg's NodeVisitor won't accept const qualified nodes-+ rootNode->addChild(const_cast<osg::Node*>(mResourceSystem->getSceneManager()->getTemplate(model).get()));-+-+ const float refScale = ptr.getCellRef().getScale();-+ rootNode->setScale({ refScale, refScale, refScale });-+ rootNode->setPosition(osg::Vec3(0, 0, 0));-+-+ osg::ref_ptr<Animation> animation = nullptr;-+-+ if (ptr.getClass().isNpc())-+ {-+ rootNode->setNodeMask(Mask_Actor);-+ animation = new NpcAnimation(ptr, osg::ref_ptr<osg::Group>(rootNode), mResourceSystem);-+ }-+-+ SceneUtil::CullSafeBoundsVisitor computeBounds;-+ computeBounds.setTraversalMask(~(MWRender::Mask_ParticleSystem | MWRender::Mask_Effect));-+ rootNode->accept(computeBounds);-+-+ return computeBounds.mBoundingBox;-+ }-+-+ void RenderingManager::resetFieldOfView()-+ {-+ if (mFieldOfViewOverridden == true)-+ {-+ mFieldOfViewOverridden = false;-+-+ updateProjectionMatrix();-+ }-+ }-+ void RenderingManager::exportSceneGraph(-+ const MWWorld::Ptr& ptr, const std::filesystem::path& filename, const std::string& format)-+ {-+ osg::Node* node = mViewer->getSceneData();-+ if (!ptr.isEmpty())-+ node = ptr.getRefData().getBaseNode();-+-+ SceneUtil::writeScene(node, filename, format);-+ }-+-+ LandManager* RenderingManager::getLandManager() const-+ {-+ return mTerrainStorage->getLandManager();-+ }-+-+ void RenderingManager::updateActorPath(const MWWorld::ConstPtr& actor, const std::deque<osg::Vec3f>& path,-+ const DetourNavigator::AgentBounds& agentBounds, const osg::Vec3f& start, const osg::Vec3f& end) const-+ {-+ mActorsPaths->update(actor, path, agentBounds, start, end, mNavigator.getSettings());-+ }-+-+ void RenderingManager::removeActorPath(const MWWorld::ConstPtr& actor) const-+ {-+ mActorsPaths->remove(actor);-+ }-+-+ void RenderingManager::setNavMeshNumber(const std::size_t value)-+ {-+ mNavMeshNumber = value;-+ }-+-+ void RenderingManager::updateNavMesh()-+ {-+ if (!mNavMesh->isEnabled())-+ return;-+-+ const auto navMeshes = mNavigator.getNavMeshes();-+-+ auto it = navMeshes.begin();-+ for (std::size_t i = 0; it != navMeshes.end() && i < mNavMeshNumber; ++i)-+ ++it;-+ if (it == navMeshes.end())-+ {-+ mNavMesh->reset();-+ }-+ else-+ {-+ try-+ {-+ mNavMesh->update(it->second, mNavMeshNumber, mNavigator.getSettings());-+ }-+ catch (const std::exception& e)-+ {-+ Log(Debug::Error) << "NavMesh render update exception: " << e.what();-+ }-+ }-+ }-+-+ void RenderingManager::updateRecastMesh()-+ {-+ if (!mRecastMesh->isEnabled())-+ return;-+-+ mRecastMesh->update(mNavigator.getRecastMeshTiles(), mNavigator.getSettings());-+ }-+-+ void RenderingManager::setActiveGrid(const osg::Vec4i& grid)-+ {-+ mTerrain->setActiveGrid(grid);-+ }-+ bool RenderingManager::pagingEnableObject(int type, const MWWorld::ConstPtr& ptr, bool enabled)-+ {-+ if (!ptr.isInCell() || !ptr.getCell()->isExterior() || !mObjectPaging)-+ return false;-+ if (mObjectPaging->enableObject(type, ptr.getCellRef().getRefNum(), ptr.getCellRef().getPosition().asVec3(),-+ osg::Vec2i(ptr.getCell()->getCell()->getGridX(), ptr.getCell()->getCell()->getGridY()), enabled))-+ {-+ mTerrain->rebuildViews();-+ return true;-+ }-+ return false;-+ }-+ void RenderingManager::pagingBlacklistObject(int type, const MWWorld::ConstPtr& ptr)-+ {-+ if (!ptr.isInCell() || !ptr.getCell()->isExterior() || !mObjectPaging)-+ return;-+ ESM::RefNum refnum = ptr.getCellRef().getRefNum();-+ if (!refnum.hasContentFile())-+ return;-+ if (mObjectPaging->blacklistObject(type, refnum, ptr.getCellRef().getPosition().asVec3(),-+ osg::Vec2i(ptr.getCell()->getCell()->getGridX(), ptr.getCell()->getCell()->getGridY())))-+ mTerrain->rebuildViews();-+ }-+ bool RenderingManager::pagingUnlockCache()-+ {-+ if (mObjectPaging && mObjectPaging->unlockCache())-+ {-+ mTerrain->rebuildViews();-+ return true;-+ }-+ return false;-+ }-+ void RenderingManager::getPagedRefnums(const osg::Vec4i& activeGrid, std::vector<ESM::RefNum>& out)-+ {-+ if (mObjectPaging)-+ mObjectPaging->getPagedRefnums(activeGrid, out);-+ }-+-+ void RenderingManager::setNavMeshMode(Settings::NavMeshRenderMode value)-+ {-+ mNavMesh->setMode(value);-+ }-+}-diff --git a/apps/openmw/mwrender/transparentpass.cpp b/apps/openmw/mwrender/transparentpass.cpp-index ce53b1c2193..cdda1d4fe39 100644---- a/apps/openmw/mwrender/transparentpass.cpp-+++ b/apps/openmw/mwrender/transparentpass.cpp-@@ -92,8 +92,9 @@ namespace MWRender- else- {- opaqueFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);-- ext->glBlitFramebuffer(0, 0, tex->getTextureWidth(), tex->getTextureHeight(), 0, 0, tex->getTextureWidth(),-- tex->getTextureHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST);-+ //ext->glBlitFramebuffer(0, 0, tex->getTextureWidth(), tex->getTextureHeight(), 0, 0, tex->getTextureWidth(),-+ //tex->getTextureHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST);-+ glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);- }-- msaaFbo ? msaaFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER)-@@ -105,7 +106,7 @@ namespace MWRender- if (!mPostPass)- return;--- opaqueFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);-+ //opaqueFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);-- // draw transparent post-pass to populate a postprocess friendly depth texture with alpha-clipped geometry--diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp-index 9fdb0583a21..6f32f3a237b 100644---- a/apps/openmw/mwrender/water.cpp-+++ b/apps/openmw/mwrender/water.cpp-@@ -555,9 +555,12 @@ namespace MWRender- mParent->addChild(mRefraction);- }--- mRipples = new Ripples(mResourceSystem);-- mSimulation->setRipples(mRipples);-- mParent->addChild(mRipples);-+ if(Settings::Manager::getBool("shader ripples", "Water")-+ {-+ mRipples = new Ripples(mResourceSystem);-+ mSimulation->setRipples(mRipples);-+ mParent->addChild(mRipples);-+ }-- showWorld(mShowWorld);--@@ -706,6 +709,7 @@ namespace MWRender- defineMap["rain_ripple_detail"] = std::to_string(rippleDetail);- defineMap["ripple_map_world_scale"] = std::to_string(RipplesSurface::mWorldScaleFactor);- defineMap["ripple_map_size"] = std::to_string(RipplesSurface::mRTTSize) + ".0";-+ defineMap["shader_ripples"] = Settings::Manager::getBool("shader ripples", "Water") ? "1" : "0";-- Stereo::shaderStereoDefines(defineMap);--diff --git a/apps/openmw/mwrender/water.cpp.orig b/apps/openmw/mwrender/water.cpp.orig-new file mode 100644-index 00000000000..9fdb0583a21---- /dev/null-+++ b/apps/openmw/mwrender/water.cpp.orig-@@ -0,0 +1,907 @@-+#include "water.hpp"-+-+#include <sstream>-+-+#include <osg/ClipNode>-+#include <osg/Depth>-+#include <osg/Fog>-+#include <osg/FrontFace>-+#include <osg/Geometry>-+#include <osg/Group>-+#include <osg/Material>-+#include <osg/PositionAttitudeTransform>-+#include <osg/ViewportIndexed>-+-+#include <osgUtil/CullVisitor>-+#include <osgUtil/IncrementalCompileOperation>-+-+#include <components/resource/imagemanager.hpp>-+#include <components/resource/resourcesystem.hpp>-+#include <components/resource/scenemanager.hpp>-+-+#include <components/sceneutil/depth.hpp>-+#include <components/sceneutil/rtt.hpp>-+#include <components/sceneutil/shadow.hpp>-+#include <components/sceneutil/waterutil.hpp>-+-+#include <components/misc/constants.hpp>-+#include <components/stereo/stereomanager.hpp>-+-+#include <components/nifosg/controller.hpp>-+-+#include <components/shader/shadermanager.hpp>-+-+#include <components/esm3/loadcell.hpp>-+-+#include <components/fallback/fallback.hpp>-+-+#include <components/settings/values.hpp>-+-+#include "../mwworld/cellstore.hpp"-+-+#include "renderbin.hpp"-+#include "ripples.hpp"-+#include "ripplesimulation.hpp"-+#include "util.hpp"-+#include "vismask.hpp"-+-+namespace MWRender-+{-+-+ // ---------------------------------------------------------------------------------------------------------------------------------+-+ /// @brief Allows to cull and clip meshes that are below a plane. Useful for reflection & refraction camera effects.-+ /// Also handles flipping of the plane when the eye point goes below it.-+ /// To use, simply create the scene as subgraph of this node, then do setPlane(const osg::Plane& plane);-+ class ClipCullNode : public osg::Group-+ {-+ class PlaneCullCallback : public SceneUtil::NodeCallback<PlaneCullCallback, osg::Node*, osgUtil::CullVisitor*>-+ {-+ public:-+ /// @param cullPlane The culling plane (in world space).-+ PlaneCullCallback(const osg::Plane* cullPlane)-+ : mCullPlane(cullPlane)-+ {-+ }-+-+ void operator()(osg::Node* node, osgUtil::CullVisitor* cv)-+ {-+ osg::Polytope::PlaneList origPlaneList-+ = cv->getProjectionCullingStack().back().getFrustum().getPlaneList();-+-+ osg::Plane plane = *mCullPlane;-+ plane.transform(*cv->getCurrentRenderStage()->getInitialViewMatrix());-+-+ osg::Vec3d eyePoint = cv->getEyePoint();-+ if (mCullPlane->intersect(osg::BoundingSphere(osg::Vec3d(0, 0, eyePoint.z()), 0)) > 0)-+ plane.flip();-+-+ cv->getProjectionCullingStack().back().getFrustum().add(plane);-+-+ traverse(node, cv);-+-+ // undo-+ cv->getProjectionCullingStack().back().getFrustum().set(origPlaneList);-+ }-+-+ private:-+ const osg::Plane* mCullPlane;-+ };-+-+ class FlipCallback : public SceneUtil::NodeCallback<FlipCallback, osg::Node*, osgUtil::CullVisitor*>-+ {-+ public:-+ FlipCallback(const osg::Plane* cullPlane)-+ : mCullPlane(cullPlane)-+ {-+ }-+-+ void operator()(osg::Node* node, osgUtil::CullVisitor* cv)-+ {-+ osg::Vec3d eyePoint = cv->getEyePoint();-+-+ osg::RefMatrix* modelViewMatrix = new osg::RefMatrix(*cv->getModelViewMatrix());-+-+ // apply the height of the plane-+ // we can't apply this height in the addClipPlane() since the "flip the below graph" function would-+ // otherwise flip the height as well-+ modelViewMatrix->preMultTranslate(mCullPlane->getNormal() * ((*mCullPlane)[3] * -1));-+-+ // flip the below graph if the eye point is above the plane-+ if (mCullPlane->intersect(osg::BoundingSphere(osg::Vec3d(0, 0, eyePoint.z()), 0)) > 0)-+ {-+ modelViewMatrix->preMultScale(osg::Vec3(1, 1, -1));-+ }-+-+ // move the plane back along its normal a little bit to prevent bleeding at the water shore-+ float fov = Settings::camera().mFieldOfView;-+ const float clipFudgeMin = 2.5; // minimum offset of clip plane-+ const float clipFudgeScale = -15000.0;-+ float clipFudge = abs(abs((*mCullPlane)[3]) - eyePoint.z()) * fov / clipFudgeScale - clipFudgeMin;-+ modelViewMatrix->preMultTranslate(mCullPlane->getNormal() * clipFudge);-+-+ cv->pushModelViewMatrix(modelViewMatrix, osg::Transform::RELATIVE_RF);-+ traverse(node, cv);-+ cv->popModelViewMatrix();-+ }-+-+ private:-+ const osg::Plane* mCullPlane;-+ };-+-+ public:-+ ClipCullNode()-+ {-+ addCullCallback(new PlaneCullCallback(&mPlane));-+-+ mClipNodeTransform = new osg::Group;-+ mClipNodeTransform->addCullCallback(new FlipCallback(&mPlane));-+ osg::Group::addChild(mClipNodeTransform);-+-+ mClipNode = new osg::ClipNode;-+-+ mClipNodeTransform->addChild(mClipNode);-+ }-+-+ void setPlane(const osg::Plane& plane)-+ {-+ if (plane == mPlane)-+ return;-+ mPlane = plane;-+-+ mClipNode->getClipPlaneList().clear();-+ mClipNode->addClipPlane(-+ new osg::ClipPlane(0, osg::Plane(mPlane.getNormal(), 0))); // mPlane.d() applied in FlipCallback-+ mClipNode->setStateSetModes(*getOrCreateStateSet(), osg::StateAttribute::ON);-+ mClipNode->setCullingActive(false);-+ }-+-+ private:-+ osg::ref_ptr<osg::Group> mClipNodeTransform;-+ osg::ref_ptr<osg::ClipNode> mClipNode;-+-+ osg::Plane mPlane;-+ };-+-+ /// This callback on the Camera has the effect of a RELATIVE_RF_INHERIT_VIEWPOINT transform mode (which does not-+ /// exist in OSG). We want to keep the View Point of the parent camera so we will not have to recreate LODs.-+ class InheritViewPointCallback-+ : public SceneUtil::NodeCallback<InheritViewPointCallback, osg::Node*, osgUtil::CullVisitor*>-+ {-+ public:-+ InheritViewPointCallback() {}-+-+ void operator()(osg::Node* node, osgUtil::CullVisitor* cv)-+ {-+ osg::ref_ptr<osg::RefMatrix> modelViewMatrix = new osg::RefMatrix(*cv->getModelViewMatrix());-+ cv->popModelViewMatrix();-+ cv->pushModelViewMatrix(modelViewMatrix, osg::Transform::ABSOLUTE_RF_INHERIT_VIEWPOINT);-+ traverse(node, cv);-+ }-+ };-+-+ /// Moves water mesh away from the camera slightly if the camera gets too close on the Z axis.-+ /// The offset works around graphics artifacts that occurred with the GL_DEPTH_CLAMP when the camera gets extremely-+ /// close to the mesh (seen on NVIDIA at least). Must be added as a Cull callback.-+ class FudgeCallback : public SceneUtil::NodeCallback<FudgeCallback, osg::Node*, osgUtil::CullVisitor*>-+ {-+ public:-+ void operator()(osg::Node* node, osgUtil::CullVisitor* cv)-+ {-+ const float fudge = 0.2;-+ if (std::abs(cv->getEyeLocal().z()) < fudge)-+ {-+ float diff = fudge - cv->getEyeLocal().z();-+ osg::RefMatrix* modelViewMatrix = new osg::RefMatrix(*cv->getModelViewMatrix());-+-+ if (cv->getEyeLocal().z() > 0)-+ modelViewMatrix->preMultTranslate(osg::Vec3f(0, 0, -diff));-+ else-+ modelViewMatrix->preMultTranslate(osg::Vec3f(0, 0, diff));-+-+ cv->pushModelViewMatrix(modelViewMatrix, osg::Transform::RELATIVE_RF);-+ traverse(node, cv);-+ cv->popModelViewMatrix();-+ }-+ else-+ traverse(node, cv);-+ }-+ };-+-+ class RainSettingsUpdater : public SceneUtil::StateSetUpdater-+ {-+ public:-+ RainSettingsUpdater()-+ : mRainIntensity(0.f)-+ , mEnableRipples(false)-+ {-+ }-+-+ void setRainIntensity(float rainIntensity) { mRainIntensity = rainIntensity; }-+ void setRipplesEnabled(bool enableRipples) { mEnableRipples = enableRipples; }-+-+ protected:-+ void setDefaults(osg::StateSet* stateset) override-+ {-+ osg::ref_ptr<osg::Uniform> rainIntensityUniform = new osg::Uniform("rainIntensity", 0.0f);-+ stateset->addUniform(rainIntensityUniform.get());-+ osg::ref_ptr<osg::Uniform> enableRainRipplesUniform = new osg::Uniform("enableRainRipples", false);-+ stateset->addUniform(enableRainRipplesUniform.get());-+ }-+-+ void apply(osg::StateSet* stateset, osg::NodeVisitor* /*nv*/) override-+ {-+ osg::ref_ptr<osg::Uniform> rainIntensityUniform = stateset->getUniform("rainIntensity");-+ if (rainIntensityUniform != nullptr)-+ rainIntensityUniform->set(mRainIntensity);-+ osg::ref_ptr<osg::Uniform> enableRainRipplesUniform = stateset->getUniform("enableRainRipples");-+ if (enableRainRipplesUniform != nullptr)-+ enableRainRipplesUniform->set(mEnableRipples);-+ }-+-+ private:-+ float mRainIntensity;-+ bool mEnableRipples;-+ };-+-+ class Refraction : public SceneUtil::RTTNode-+ {-+ public:-+ Refraction(uint32_t rttSize)-+ : RTTNode(rttSize, rttSize, 0, false, 1, StereoAwareness::Aware, shouldAddMSAAIntermediateTarget())-+ , mNodeMask(Refraction::sDefaultCullMask)-+ {-+ setDepthBufferInternalFormat(GL_DEPTH24_STENCIL8);-+ mClipCullNode = new ClipCullNode;-+ }-+-+ void setDefaults(osg::Camera* camera) override-+ {-+ camera->setReferenceFrame(osg::Camera::RELATIVE_RF);-+ camera->setSmallFeatureCullingPixelSize(Settings::water().mSmallFeatureCullingPixelSize);-+ camera->setName("RefractionCamera");-+ camera->addCullCallback(new InheritViewPointCallback);-+ camera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);-+-+ // No need for fog here, we are already applying fog on the water surface itself as well as underwater fog-+ // assign large value to effectively turn off fog-+ // shaders don't respect glDisable(GL_FOG)-+ osg::ref_ptr<osg::Fog> fog(new osg::Fog);-+ fog->setStart(10000000);-+ fog->setEnd(10000000);-+ camera->getOrCreateStateSet()->setAttributeAndModes(-+ fog, osg::StateAttribute::OFF | osg::StateAttribute::OVERRIDE);-+-+ camera->addChild(mClipCullNode);-+ camera->setNodeMask(Mask_RenderToTexture);-+-+ if (Settings::water().mRefractionScale != 1) // TODO: to be removed with issue #5709-+ SceneUtil::ShadowManager::disableShadowsForStateSet(-+ Settings::shadows(), *camera->getOrCreateStateSet());-+ }-+-+ void apply(osg::Camera* camera) override-+ {-+ camera->setViewMatrix(mViewMatrix);-+ camera->setCullMask(mNodeMask);-+ }-+-+ void setScene(osg::Node* scene)-+ {-+ if (mScene)-+ mClipCullNode->removeChild(mScene);-+ mScene = scene;-+ mClipCullNode->addChild(scene);-+ }-+-+ void setWaterLevel(float waterLevel)-+ {-+ const float refractionScale = Settings::water().mRefractionScale;-+-+ mViewMatrix = osg::Matrix::scale(1, 1, refractionScale)-+ * osg::Matrix::translate(0, 0, (1.0 - refractionScale) * waterLevel);-+-+ mClipCullNode->setPlane(osg::Plane(osg::Vec3d(0, 0, -1), osg::Vec3d(0, 0, waterLevel)));-+ }-+-+ void showWorld(bool show)-+ {-+ if (show)-+ mNodeMask = Refraction::sDefaultCullMask;-+ else-+ mNodeMask = Refraction::sDefaultCullMask & ~sToggleWorldMask;-+ }-+-+ private:-+ osg::ref_ptr<ClipCullNode> mClipCullNode;-+ osg::ref_ptr<osg::Node> mScene;-+ osg::Matrix mViewMatrix{ osg::Matrix::identity() };-+-+ unsigned int mNodeMask;-+-+ static constexpr unsigned int sDefaultCullMask = Mask_Effect | Mask_Scene | Mask_Object | Mask_Static-+ | Mask_Terrain | Mask_Actor | Mask_ParticleSystem | Mask_Sky | Mask_Sun | Mask_Player | Mask_Lighting-+ | Mask_Groundcover;-+ };-+-+ class Reflection : public SceneUtil::RTTNode-+ {-+ public:-+ Reflection(uint32_t rttSize, bool isInterior)-+ : RTTNode(rttSize, rttSize, 0, false, 0, StereoAwareness::Aware, shouldAddMSAAIntermediateTarget())-+ {-+ setInterior(isInterior);-+ setDepthBufferInternalFormat(GL_DEPTH24_STENCIL8);-+ mClipCullNode = new ClipCullNode;-+ }-+-+ void setDefaults(osg::Camera* camera) override-+ {-+ camera->setReferenceFrame(osg::Camera::RELATIVE_RF);-+ camera->setSmallFeatureCullingPixelSize(Settings::water().mSmallFeatureCullingPixelSize);-+ camera->setName("ReflectionCamera");-+ camera->addCullCallback(new InheritViewPointCallback);-+-+ // Inform the shader that we're in a reflection-+ camera->getOrCreateStateSet()->addUniform(new osg::Uniform("isReflection", true));-+-+ // XXX: should really flip the FrontFace on each renderable instead of forcing clockwise.-+ osg::ref_ptr<osg::FrontFace> frontFace(new osg::FrontFace);-+ frontFace->setMode(osg::FrontFace::CLOCKWISE);-+ camera->getOrCreateStateSet()->setAttributeAndModes(frontFace, osg::StateAttribute::ON);-+-+ camera->addChild(mClipCullNode);-+ camera->setNodeMask(Mask_RenderToTexture);-+-+ SceneUtil::ShadowManager::disableShadowsForStateSet(Settings::shadows(), *camera->getOrCreateStateSet());-+ }-+-+ void apply(osg::Camera* camera) override-+ {-+ camera->setViewMatrix(mViewMatrix);-+ camera->setCullMask(mNodeMask);-+ }-+-+ void setInterior(bool isInterior)-+ {-+ mInterior = isInterior;-+ mNodeMask = calcNodeMask();-+ }-+-+ void setWaterLevel(float waterLevel)-+ {-+ mViewMatrix = osg::Matrix::scale(1, 1, -1) * osg::Matrix::translate(0, 0, 2 * waterLevel);-+ mClipCullNode->setPlane(osg::Plane(osg::Vec3d(0, 0, 1), osg::Vec3d(0, 0, waterLevel)));-+ }-+-+ void setScene(osg::Node* scene)-+ {-+ if (mScene)-+ mClipCullNode->removeChild(mScene);-+ mScene = scene;-+ mClipCullNode->addChild(scene);-+ }-+-+ void showWorld(bool show)-+ {-+ if (show)-+ mNodeMask = calcNodeMask();-+ else-+ mNodeMask = calcNodeMask() & ~sToggleWorldMask;-+ }-+-+ private:-+ unsigned int calcNodeMask()-+ {-+ int reflectionDetail = Settings::water().mReflectionDetail;-+ reflectionDetail = std::clamp(reflectionDetail, mInterior ? 2 : 0, 5);-+ unsigned int extraMask = 0;-+ if (reflectionDetail >= 1)-+ extraMask |= Mask_Terrain;-+ if (reflectionDetail >= 2)-+ extraMask |= Mask_Static;-+ if (reflectionDetail >= 3)-+ extraMask |= Mask_Effect | Mask_ParticleSystem | Mask_Object;-+ if (reflectionDetail >= 4)-+ extraMask |= Mask_Player | Mask_Actor;-+ if (reflectionDetail >= 5)-+ extraMask |= Mask_Groundcover;-+ return Mask_Scene | Mask_Sky | Mask_Lighting | extraMask;-+ }-+-+ osg::ref_ptr<ClipCullNode> mClipCullNode;-+ osg::ref_ptr<osg::Node> mScene;-+ osg::Node::NodeMask mNodeMask;-+ osg::Matrix mViewMatrix{ osg::Matrix::identity() };-+ bool mInterior;-+ };-+-+ /// DepthClampCallback enables GL_DEPTH_CLAMP for the current draw, if supported.-+ class DepthClampCallback : public osg::Drawable::DrawCallback-+ {-+ public:-+ void drawImplementation(osg::RenderInfo& renderInfo, const osg::Drawable* drawable) const override-+ {-+ static bool supported = osg::isGLExtensionOrVersionSupported(-+ renderInfo.getState()->getContextID(), "GL_ARB_depth_clamp", 3.3);-+ if (!supported)-+ {-+ drawable->drawImplementation(renderInfo);-+ return;-+ }-+-+ glEnable(GL_DEPTH_CLAMP);-+-+ drawable->drawImplementation(renderInfo);-+-+ // restore default-+ glDisable(GL_DEPTH_CLAMP);-+ }-+ };-+-+ Water::Water(osg::Group* parent, osg::Group* sceneRoot, Resource::ResourceSystem* resourceSystem,-+ osgUtil::IncrementalCompileOperation* ico)-+ : mRainSettingsUpdater(nullptr)-+ , mParent(parent)-+ , mSceneRoot(sceneRoot)-+ , mResourceSystem(resourceSystem)-+ , mEnabled(true)-+ , mToggled(true)-+ , mTop(0)-+ , mInterior(false)-+ , mShowWorld(true)-+ , mCullCallback(nullptr)-+ , mShaderWaterStateSetUpdater(nullptr)-+ {-+ mSimulation = std::make_unique<RippleSimulation>(mSceneRoot, resourceSystem);-+-+ mWaterGeom = SceneUtil::createWaterGeometry(Constants::CellSizeInUnits * 150, 40, 900);-+ mWaterGeom->setDrawCallback(new DepthClampCallback);-+ mWaterGeom->setNodeMask(Mask_Water);-+ mWaterGeom->setDataVariance(osg::Object::STATIC);-+ mWaterGeom->setName("Water Geometry");-+-+ mWaterNode = new osg::PositionAttitudeTransform;-+ mWaterNode->setName("Water Root");-+ mWaterNode->addChild(mWaterGeom);-+ mWaterNode->addCullCallback(new FudgeCallback);-+-+ // simple water fallback for the local map-+ osg::ref_ptr<osg::Geometry> geom2(osg::clone(mWaterGeom.get(), osg::CopyOp::DEEP_COPY_NODES));-+ createSimpleWaterStateSet(geom2, Fallback::Map::getFloat("Water_Map_Alpha"));-+ geom2->setNodeMask(Mask_SimpleWater);-+ geom2->setName("Simple Water Geometry");-+ mWaterNode->addChild(geom2);-+-+ mSceneRoot->addChild(mWaterNode);-+-+ setHeight(mTop);-+-+ updateWaterMaterial();-+-+ if (ico)-+ ico->add(mWaterNode);-+ }-+-+ void Water::setCullCallback(osg::Callback* callback)-+ {-+ if (mCullCallback)-+ {-+ mWaterNode->removeCullCallback(mCullCallback);-+ if (mReflection)-+ mReflection->removeCullCallback(mCullCallback);-+ if (mRefraction)-+ mRefraction->removeCullCallback(mCullCallback);-+ }-+-+ mCullCallback = callback;-+-+ if (callback)-+ {-+ mWaterNode->addCullCallback(callback);-+ if (mReflection)-+ mReflection->addCullCallback(callback);-+ if (mRefraction)-+ mRefraction->addCullCallback(callback);-+ }-+ }-+-+ void Water::updateWaterMaterial()-+ {-+ if (mShaderWaterStateSetUpdater)-+ {-+ mWaterNode->removeCullCallback(mShaderWaterStateSetUpdater);-+ mShaderWaterStateSetUpdater = nullptr;-+ }-+ if (mReflection)-+ {-+ mParent->removeChild(mReflection);-+ mReflection = nullptr;-+ }-+ if (mRefraction)-+ {-+ mParent->removeChild(mRefraction);-+ mRefraction = nullptr;-+ }-+ if (mRipples)-+ {-+ mParent->removeChild(mRipples);-+ mRipples = nullptr;-+ mSimulation->setRipples(nullptr);-+ }-+-+ mWaterNode->setStateSet(nullptr);-+ mWaterGeom->setStateSet(nullptr);-+ mWaterGeom->setUpdateCallback(nullptr);-+-+ if (Settings::water().mShader)-+ {-+ const unsigned int rttSize = Settings::water().mRttSize;-+-+ mReflection = new Reflection(rttSize, mInterior);-+ mReflection->setWaterLevel(mTop);-+ mReflection->setScene(mSceneRoot);-+ if (mCullCallback)-+ mReflection->addCullCallback(mCullCallback);-+ mParent->addChild(mReflection);-+-+ if (Settings::water().mRefraction)-+ {-+ mRefraction = new Refraction(rttSize);-+ mRefraction->setWaterLevel(mTop);-+ mRefraction->setScene(mSceneRoot);-+ if (mCullCallback)-+ mRefraction->addCullCallback(mCullCallback);-+ mParent->addChild(mRefraction);-+ }-+-+ mRipples = new Ripples(mResourceSystem);-+ mSimulation->setRipples(mRipples);-+ mParent->addChild(mRipples);-+-+ showWorld(mShowWorld);-+-+ createShaderWaterStateSet(mWaterNode);-+ }-+ else-+ createSimpleWaterStateSet(mWaterGeom, Fallback::Map::getFloat("Water_World_Alpha"));-+-+ updateVisible();-+ }-+-+ osg::Node* Water::getReflectionNode()-+ {-+ return mReflection;-+ }-+-+ osg::Node* Water::getRefractionNode()-+ {-+ return mRefraction;-+ }-+-+ osg::Vec3d Water::getPosition() const-+ {-+ return mWaterNode->getPosition();-+ }-+-+ void Water::createSimpleWaterStateSet(osg::Node* node, float alpha)-+ {-+ osg::ref_ptr<osg::StateSet> stateset = SceneUtil::createSimpleWaterStateSet(alpha, MWRender::RenderBin_Water);-+-+ node->setStateSet(stateset);-+ node->setUpdateCallback(nullptr);-+ mRainSettingsUpdater = nullptr;-+-+ // Add animated textures-+ std::vector<osg::ref_ptr<osg::Texture2D>> textures;-+ const int frameCount = std::clamp(Fallback::Map::getInt("Water_SurfaceFrameCount"), 0, 320);-+ std::string_view texture = Fallback::Map::getString("Water_SurfaceTexture");-+ for (int i = 0; i < frameCount; ++i)-+ {-+ std::ostringstream texname;-+ texname << "textures/water/" << texture << std::setw(2) << std::setfill('0') << i << ".dds";-+ osg::ref_ptr<osg::Texture2D> tex(-+ new osg::Texture2D(mResourceSystem->getImageManager()->getImage(texname.str())));-+ tex->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT);-+ tex->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT);-+ mResourceSystem->getSceneManager()->applyFilterSettings(tex);-+ textures.push_back(tex);-+ }-+-+ if (textures.empty())-+ return;-+-+ float fps = Fallback::Map::getFloat("Water_SurfaceFPS");-+-+ osg::ref_ptr<NifOsg::FlipController> controller(new NifOsg::FlipController(0, 1.f / fps, textures));-+ controller->setSource(std::make_shared<SceneUtil::FrameTimeSource>());-+ node->setUpdateCallback(controller);-+-+ stateset->setTextureAttributeAndModes(0, textures[0], osg::StateAttribute::ON);-+-+ // use a shader to render the simple water, ensuring that fog is applied per pixel as required.-+ // this could be removed if a more detailed water mesh, using some sort of paging solution, is implemented.-+ Resource::SceneManager* sceneManager = mResourceSystem->getSceneManager();-+ bool oldValue = sceneManager->getForceShaders();-+ sceneManager->setForceShaders(true);-+ sceneManager->recreateShaders(node);-+ sceneManager->setForceShaders(oldValue);-+ }-+-+ class ShaderWaterStateSetUpdater : public SceneUtil::StateSetUpdater-+ {-+ public:-+ ShaderWaterStateSetUpdater(Water* water, Reflection* reflection, Refraction* refraction, Ripples* ripples,-+ osg::ref_ptr<osg::Program> program, osg::ref_ptr<osg::Texture2D> normalMap)-+ : mWater(water)-+ , mReflection(reflection)-+ , mRefraction(refraction)-+ , mRipples(ripples)-+ , mProgram(std::move(program))-+ , mNormalMap(std::move(normalMap))-+ {-+ }-+-+ void setDefaults(osg::StateSet* stateset) override-+ {-+ stateset->addUniform(new osg::Uniform("normalMap", 0));-+ stateset->setTextureAttributeAndModes(0, mNormalMap, osg::StateAttribute::ON);-+ stateset->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);-+ stateset->setAttributeAndModes(mProgram, osg::StateAttribute::ON);-+-+ stateset->addUniform(new osg::Uniform("reflectionMap", 1));-+ if (mRefraction)-+ {-+ stateset->addUniform(new osg::Uniform("refractionMap", 2));-+ stateset->addUniform(new osg::Uniform("refractionDepthMap", 3));-+ stateset->setRenderBinDetails(MWRender::RenderBin_Default, "RenderBin");-+ }-+ else-+ {-+ stateset->setMode(GL_BLEND, osg::StateAttribute::ON);-+ stateset->setRenderBinDetails(MWRender::RenderBin_Water, "RenderBin");-+ osg::ref_ptr<osg::Depth> depth = new SceneUtil::AutoDepth;-+ depth->setWriteMask(false);-+ stateset->setAttributeAndModes(depth, osg::StateAttribute::ON);-+ }-+ if (mRipples)-+ {-+ stateset->addUniform(new osg::Uniform("rippleMap", 4));-+ }-+ stateset->addUniform(new osg::Uniform("nodePosition", osg::Vec3f(mWater->getPosition())));-+ }-+-+ void apply(osg::StateSet* stateset, osg::NodeVisitor* nv) override-+ {-+ osgUtil::CullVisitor* cv = static_cast<osgUtil::CullVisitor*>(nv);-+ stateset->setTextureAttributeAndModes(1, mReflection->getColorTexture(cv), osg::StateAttribute::ON);-+-+ if (mRefraction)-+ {-+ stateset->setTextureAttributeAndModes(2, mRefraction->getColorTexture(cv), osg::StateAttribute::ON);-+ stateset->setTextureAttributeAndModes(3, mRefraction->getDepthTexture(cv), osg::StateAttribute::ON);-+ }-+ if (mRipples)-+ {-+ stateset->setTextureAttributeAndModes(4, mRipples->getColorTexture(), osg::StateAttribute::ON);-+ }-+ stateset->getUniform("nodePosition")->set(osg::Vec3f(mWater->getPosition()));-+ }-+-+ private:-+ Water* mWater;-+ Reflection* mReflection;-+ Refraction* mRefraction;-+ Ripples* mRipples;-+ osg::ref_ptr<osg::Program> mProgram;-+ osg::ref_ptr<osg::Texture2D> mNormalMap;-+ };-+-+ void Water::createShaderWaterStateSet(osg::Node* node)-+ {-+ // use a define map to conditionally compile the shader-+ std::map<std::string, std::string> defineMap;-+ defineMap["refraction_enabled"] = std::string(mRefraction ? "1" : "0");-+ const int rippleDetail = Settings::water().mRainRippleDetail;-+ defineMap["rain_ripple_detail"] = std::to_string(rippleDetail);-+ defineMap["ripple_map_world_scale"] = std::to_string(RipplesSurface::mWorldScaleFactor);-+ defineMap["ripple_map_size"] = std::to_string(RipplesSurface::mRTTSize) + ".0";-+-+ Stereo::shaderStereoDefines(defineMap);-+-+ Shader::ShaderManager& shaderMgr = mResourceSystem->getSceneManager()->getShaderManager();-+ osg::ref_ptr<osg::Program> program = shaderMgr.getProgram("water", defineMap);-+-+ osg::ref_ptr<osg::Texture2D> normalMap(-+ new osg::Texture2D(mResourceSystem->getImageManager()->getImage("textures/omw/water_nm.png")));-+ if (normalMap->getImage())-+ normalMap->getImage()->flipVertical();-+ normalMap->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT);-+ normalMap->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT);-+ normalMap->setMaxAnisotropy(16);-+ normalMap->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR_MIPMAP_LINEAR);-+ normalMap->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);-+-+ mRainSettingsUpdater = new RainSettingsUpdater();-+ node->setUpdateCallback(mRainSettingsUpdater);-+-+ mShaderWaterStateSetUpdater = new ShaderWaterStateSetUpdater(-+ this, mReflection, mRefraction, mRipples, std::move(program), std::move(normalMap));-+ node->addCullCallback(mShaderWaterStateSetUpdater);-+ }-+-+ void Water::processChangedSettings(const Settings::CategorySettingVector& settings)-+ {-+ updateWaterMaterial();-+ }-+-+ Water::~Water()-+ {-+ mParent->removeChild(mWaterNode);-+-+ if (mReflection)-+ {-+ mParent->removeChild(mReflection);-+ mReflection = nullptr;-+ }-+ if (mRefraction)-+ {-+ mParent->removeChild(mRefraction);-+ mRefraction = nullptr;-+ }-+ if (mRipples)-+ {-+ mParent->removeChild(mRipples);-+ mRipples = nullptr;-+ mSimulation->setRipples(nullptr);-+ }-+ }-+-+ void Water::listAssetsToPreload(std::vector<std::string>& textures)-+ {-+ const int frameCount = std::clamp(Fallback::Map::getInt("Water_SurfaceFrameCount"), 0, 320);-+ std::string_view texture = Fallback::Map::getString("Water_SurfaceTexture");-+ for (int i = 0; i < frameCount; ++i)-+ {-+ std::ostringstream texname;-+ texname << "textures/water/" << texture << std::setw(2) << std::setfill('0') << i << ".dds";-+ textures.push_back(texname.str());-+ }-+ }-+-+ void Water::setEnabled(bool enabled)-+ {-+ mEnabled = enabled;-+ updateVisible();-+ }-+-+ void Water::changeCell(const MWWorld::CellStore* store)-+ {-+ bool isInterior = !store->getCell()->isExterior();-+ bool wasInterior = mInterior;-+ if (!isInterior)-+ {-+ mWaterNode->setPosition(-+ getSceneNodeCoordinates(store->getCell()->getGridX(), store->getCell()->getGridY()));-+ mInterior = false;-+ }-+ else-+ {-+ mWaterNode->setPosition(osg::Vec3f(0, 0, mTop));-+ mInterior = true;-+ }-+ if (mInterior != wasInterior && mReflection)-+ mReflection->setInterior(mInterior);-+ }-+-+ void Water::setHeight(const float height)-+ {-+ mTop = height;-+-+ mSimulation->setWaterHeight(height);-+-+ osg::Vec3f pos = mWaterNode->getPosition();-+ pos.z() = height;-+ mWaterNode->setPosition(pos);-+-+ if (mReflection)-+ mReflection->setWaterLevel(mTop);-+ if (mRefraction)-+ mRefraction->setWaterLevel(mTop);-+ }-+-+ void Water::setRainIntensity(float rainIntensity)-+ {-+ if (mRainSettingsUpdater)-+ mRainSettingsUpdater->setRainIntensity(rainIntensity);-+ }-+-+ void Water::setRainRipplesEnabled(bool enableRipples)-+ {-+ if (mRainSettingsUpdater)-+ mRainSettingsUpdater->setRipplesEnabled(enableRipples);-+ }-+-+ void Water::update(float dt, bool paused)-+ {-+ if (!paused)-+ {-+ mSimulation->update(dt);-+ }-+-+ if (mRipples)-+ {-+ mRipples->setPaused(paused);-+ }-+ }-+-+ void Water::updateVisible()-+ {-+ bool visible = mEnabled && mToggled;-+ mWaterNode->setNodeMask(visible ? ~0u : 0u);-+ if (mRefraction)-+ mRefraction->setNodeMask(visible ? Mask_RenderToTexture : 0u);-+ if (mReflection)-+ mReflection->setNodeMask(visible ? Mask_RenderToTexture : 0u);-+ if (mRipples)-+ mRipples->setNodeMask(visible ? Mask_RenderToTexture : 0u);-+ }-+-+ bool Water::toggle()-+ {-+ mToggled = !mToggled;-+ updateVisible();-+ return mToggled;-+ }-+-+ bool Water::isUnderwater(const osg::Vec3f& pos) const-+ {-+ return pos.z() < mTop && mToggled && mEnabled;-+ }-+-+ osg::Vec3f Water::getSceneNodeCoordinates(int gridX, int gridY)-+ {-+ return osg::Vec3f(static_cast<float>(gridX * Constants::CellSizeInUnits + (Constants::CellSizeInUnits / 2)),-+ static_cast<float>(gridY * Constants::CellSizeInUnits + (Constants::CellSizeInUnits / 2)), mTop);-+ }-+-+ void Water::addEmitter(const MWWorld::Ptr& ptr, float scale, float force)-+ {-+ mSimulation->addEmitter(ptr, scale, force);-+ }-+-+ void Water::removeEmitter(const MWWorld::Ptr& ptr)-+ {-+ mSimulation->removeEmitter(ptr);-+ }-+-+ void Water::updateEmitterPtr(const MWWorld::Ptr& old, const MWWorld::Ptr& ptr)-+ {-+ mSimulation->updateEmitterPtr(old, ptr);-+ }-+-+ void Water::emitRipple(const osg::Vec3f& pos)-+ {-+ mSimulation->emitRipple(pos);-+ }-+-+ void Water::removeCell(const MWWorld::CellStore* store)-+ {-+ mSimulation->removeCell(store);-+ }-+-+ void Water::clearRipples()-+ {-+ mSimulation->clear();-+ }-+-+ void Water::showWorld(bool show)-+ {-+ if (mReflection)-+ mReflection->showWorld(show);-+ if (mRefraction)-+ mRefraction->showWorld(show);-+ mShowWorld = show;-+ }-+-+}-diff --git a/components/debug/debugging.cpp b/components/debug/debugging.cpp-index d170cf1929b..e94b8d3f943 100644---- a/components/debug/debugging.cpp-+++ b/components/debug/debugging.cpp-@@ -323,6 +323,8 @@ void setupLogging(const std::filesystem::path& logDir, std::string_view appName,- #endif- }--+osg::ref_ptr<osgViewer::Viewer> g_viewer;-+- int wrapApplication(int (*innerApplication)(int argc, char* argv[]), int argc, char* argv[], std::string_view appName)- {- #if defined _WIN32-diff --git a/components/fx/parse_constants.hpp b/components/fx/parse_constants.hpp-index 9be54ed3a76..55585f8106d 100644---- a/components/fx/parse_constants.hpp-+++ b/components/fx/parse_constants.hpp-@@ -35,7 +35,7 @@ namespace fx- { "bgra", GL_BGRA },- } };--- constexpr std::array<std::pair<std::string_view, int>, 9> SourceType = { {-+ constexpr std::array<std::pair<std::string_view, int>, 10> SourceType = { {- { "byte", GL_BYTE },- { "unsigned_byte", GL_UNSIGNED_BYTE },- { "short", GL_SHORT },-@@ -44,6 +44,7 @@ namespace fx- { "unsigned_int", GL_UNSIGNED_INT },- { "unsigned_int_24_8", GL_UNSIGNED_INT_24_8 },- { "float", GL_FLOAT },-+ { "half_float", GL_HALF_FLOAT },- { "double", GL_DOUBLE },- } };--@@ -129,4 +130,4 @@ namespace fx- }- }---#endif-\ No newline at end of file-+#endif-diff --git a/components/fx/pass.cpp b/components/fx/pass.cpp-index cf50d20fe22..20d090ef6cf 100644---- a/components/fx/pass.cpp-+++ b/components/fx/pass.cpp-@@ -89,7 +89,7 @@ namespace fx-- uniform @builtinSampler omw_SamplerLastShader;- uniform @builtinSampler omw_SamplerLastPass;--uniform @builtinSampler omw_SamplerDepth;-+uniform highp @builtinSampler omw_SamplerDepth;- uniform @builtinSampler omw_SamplerNormals;- uniform @builtinSampler omw_SamplerDistortion;--diff --git a/components/settings/categories/water.hpp b/components/settings/categories/water.hpp-index 2e041142449..29ecb2f4700 100644---- a/components/settings/categories/water.hpp-+++ b/components/settings/categories/water.hpp-@@ -19,6 +19,7 @@ namespace Settings- using WithIndex::WithIndex;-- SettingValue<bool> mShader{ mIndex, "Water", "shader" };-+ SettingValue<bool> mShaderRipples{ "Water", "shader ripples" };- SettingValue<int> mRttSize{ mIndex, "Water", "rtt size", makeMaxSanitizerInt(1) };- SettingValue<bool> mRefraction{ mIndex, "Water", "refraction" };- SettingValue<int> mReflectionDetail{ mIndex, "Water", "reflection detail", makeClampSanitizerInt(0, 5) };-diff --git a/components/shader/shadervisitor.cpp b/components/shader/shadervisitor.cpp-index e281f644480..3f09e833d1e 100644---- a/components/shader/shadervisitor.cpp-+++ b/components/shader/shadervisitor.cpp-@@ -32,6 +32,9 @@- #include "removedalphafunc.hpp"- #include "shadermanager.hpp"--+#include <components/settings/values.hpp>-+#include <components/sceneutil/depth.hpp>-+- namespace Shader- {- /**-@@ -730,6 +733,13 @@ namespace Shader- updateRemovedState(*writableUserData, removedState);- }--+ if (reqs.mAlphaBlend && Settings::postProcessing().mTransparentPostpass && Settings::postProcessing().mEnabled)-+ {-+ osg::ref_ptr<osg::Depth> depth = new SceneUtil::AutoDepth;-+ depth->setWriteMask(false);-+ writableStateSet->setAttributeAndModes(depth, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);-+ }-+- defineMap["softParticles"] = reqs.mSoftParticles ? "1" : "0";-- Stereo::shaderStereoDefines(defineMap);-diff --git a/files/data/l10n/OMWEngine/en.yaml b/files/data/l10n/OMWEngine/en.yaml-index f6ad2373942..c23937d6ac4 100644---- a/files/data/l10n/OMWEngine/en.yaml-+++ b/files/data/l10n/OMWEngine/en.yaml-@@ -171,6 +171,7 @@ VSync: "VSync"- VSyncAdaptive: "Adaptive"- Water: "Water"- WaterShader: "Water shader"-+WaterShaderRipples: "Water shader ripples"- WaterShaderTextureQuality: "Texture quality"- WindowBorder: "Window Border"- WindowMode: "Window Mode"-diff --git a/files/data/l10n/OMWEngine/en.yaml.orig b/files/data/l10n/OMWEngine/en.yaml.orig-new file mode 100644-index 00000000000..f6ad2373942---- /dev/null-+++ b/files/data/l10n/OMWEngine/en.yaml.orig-@@ -0,0 +1,180 @@-+# Console-+-+ConsoleWindow: "Console"-+-+# Debug window-+-+DebugWindow: "Debug"-+LogViewer: "Log Viewer"-+LuaProfiler: "Lua Profiler"-+PhysicsProfiler: "Physics Profiler"-+-+-+# Messages-+-+AskLoadLastSave: "The most recent save is '%s'. Do you want to load it?"-+BuildingNavigationMesh: "Building navigation mesh"-+InitializingData: "Initializing Data..."-+LoadingExterior: "Loading Area"-+LoadingFailed: "Failed to load saved game"-+LoadingInterior: "Loading Area"-+LoadingInProgress: "Loading Save Game"-+LoadingRequiresNewVersionError: |--+ This save file was created using a newer version of OpenMW and is thus not supported.-+ Please upgrade to the newest OpenMW version to load this file.-+LoadingRequiresOldVersionError: |--+ This save file was created using an older version of OpenMW in a format that is no longer supported.-+ Load and save this file using {version} to upgrade it.-+NewGameConfirmation: "Do you want to start a new game and lose the current one?"-+QuitGameConfirmation: "Quit the game?"-+SaveGameDenied: "The game cannot be saved right now."-+SavingInProgress: "Saving..."-+ScreenshotFailed: "Failed to save screenshot"-+ScreenshotMade: "%s has been saved"-+-+-+# Save game menu-+-+DeleteGame: "Delete Game"-+DeleteGameConfirmation: "Are you sure you want to delete this saved game?"-+EmptySaveNameError: "Game can not be saved without a name!"-+LoadGameConfirmation: "Do you want to load a saved game and lose the current one?"-+MissingContentFilesConfirmation: |--+ The currently selected content files do not match the ones used by this save game.-+ Errors may occur during load or game play.-+ Do you wish to continue?-+MissingContentFilesList: |--+ {files, plural,-+ one{\n\nFound missing file: }-+ few{\n\nFound {files} missing files:\n}-+ other{\n\nFound {files} missing files:\n}-+ }-+MissingContentFilesListCopy: |--+ {files, plural,-+ one{\n\nPress Copy to place its name to the clipboard.}-+ few{\n\nPress Copy to place their names to the clipboard.}-+ other{\n\nPress Copy to place their names to the clipboard.}-+ }-+OverwriteGameConfirmation: "Are you sure you want to overwrite this saved game?"-+SelectCharacter: "Select Character..."-+TimePlayed: "Time played"-+-+-+# Settings menu-+-+ActorsProcessingRange: "Actors Processing Range"-+Anisotropy: "Anisotropy"-+Audio: "Audio"-+AudioEffects: "Effects"-+AudioFootsteps: "Footsteps"-+AudioMaster: "Master"-+AudioMusic: "Music"-+AudioVoice: "Voice"-+CameraSensitivity: "Camera Sensitivity"-+CameraZoomIn: "Zoom Camera In"-+CameraZoomOut: "Zoom Camera Out"-+ChangeRequiresRestart: "This change requires a restart to take effect."-+ConfirmResetBindings: "Reset all controls to the default?"-+ConfirmResolution: "New resolution will be applied immediately. Do you want to continue?"-+Controller: "Controller"-+Controls: "Controls"-+DelayLow: "Fast"-+DelayHigh: "Slow"-+DetailLevel: "Detail Level"-+Difficulty: "Difficulty"-+DifficultyEasy: "Easy"-+DifficultyHard: "Hard"-+DistanceHigh: "Far"-+DistanceLow: "Near"-+EnableController: "Enable Controller"-+FieldOfView: "Field of View"-+FieldOfViewHigh: "High"-+FieldOfViewLow: "Low"-+FrameRateHint: "Hint: press F3 to show\nthe current frame rate."-+GammaCorrection: "Gamma Correction"-+GammaDark: "Dark"-+GammaLight: "Light"-+GmstOverridesL10n: "Strings from ESM files have priority"-+InvertXAxis: "Invert X Axis"-+InvertYAxis: "Invert Y Axis"-+Language: "Language"-+LanguageNote: "Note: these settings do not affect strings from ESM files."-+LightingMethod: "Lighting Method"-+LightingMethodLegacy: "Legacy"-+LightingMethodShaders: "Shaders"-+LightingMethodShadersCompatibility: "Shaders (compatibility)"-+LightingResetToDefaults: "Resets to default values, would you like to continue? Changes to lighting method will require a restart."-+Lights: "Lights"-+LightsBoundingSphereMultiplier: "Bounding Sphere Multiplier"-+LightsBoundingSphereMultiplierTooltip: "Default: 1.65\nMultipler for bounding sphere of lights.\nHigher numbers allows for smooth falloff but require an increase in number of max lights.\n\nDoes not effect the illumination or strength of lights."-+LightsFadeStartMultiplier: "Fade Start Multiplier"-+LightsFadeStartMultiplierTooltip: "Default: 0.85\nFraction of maximum distance at which lights will start to fade.\n\nSet this to a low value for slower transitions or a high value for quicker transitions."-+LightsLightingMethodTooltip: "Set the internal handling of light sources.\n\n-+ \"Legacy\" always uses 8 lights per object and provides a lighting closest to an original game.\n\n-+ \"Shaders (compatibility)\" removes the 8 light limit. This mode also enables lighting on groundcover and a configurable light fade. It is recommended to use this with older hardware and a light limit closer to 8.\n\n-+ \"Shaders\" carries all of the benefits that \"Shaders (compatibility)\" does, but uses a modern approach that allows for a higher max lights count with little to no performance penalties on modern hardware."-+LightsMaximumDistance: "Maximum Light Distance"-+LightsMaximumDistanceTooltip: "Default: 8192\nMaximum distance at which lights will appear (measured in units).\n\nSet this to 0 to use an unlimited distance."-+LightsMinimumInteriorBrightness: "Minimum Interior Brightness"-+LightsMinimumInteriorBrightnessTooltip: "Default: 0.08\nMinimum ambient interior brightness.\n\nIncrease this if you feel interiors are too dark."-+MaxLights: "Max Lights"-+MaxLightsTooltip: "Default: 8\nMaximum number of lights per object.\n\nA low number near default will cause light popping similar to what you would see with legacy lighting."-+MenuHelpDelay: "Menu Help Delay"-+MenuTransparency: "Menu Transparency"-+MouseAndKeyboard: "Mouse/Keyboard"-+PostProcessing: "Post Processing"-+PostProcessingIsNotEnabled: "Postprocessor is not enabled"-+PostProcessingTooltip: "Tweaked via Post Processor HUD, see input bindings."-+Preferences: "Prefs"-+PrimaryLanguage: "Primary Language"-+PrimaryLanguageTooltip: "Localization files for this language have the highest priority."-+QualityHigh: "High"-+QualityLow: "Low"-+QualityMedium: "Medium"-+RainRippleDetail: "Rain ripple detail"-+RainRippleDetailDense: "Dense"-+RainRippleDetailSimple: "Simple"-+RainRippleDetailSparse: "Sparse"-+RebindAction: "Press a key or button to rebind this control."-+ReflectionShaderDetail: "Reflection shader detail"-+ReflectionShaderDetailActors: "Actors"-+ReflectionShaderDetailGroundcover: "Groundcover"-+ReflectionShaderDetailObjects: "Objects"-+ReflectionShaderDetailSky: "Sky"-+ReflectionShaderDetailTerrain: "Terrain"-+ReflectionShaderDetailWorld: "World"-+Refraction: "Refraction"-+ResetControls: "Reset Controls"-+Screenshot: "Screenshot"-+Scripts: "Scripts"-+ScriptsDisabled: "Load a game to access script settings."-+SecondaryLanguage: "Secondary Language"-+SecondaryLanguageTooltip: "Localization files for this language may be used if the primary language files lack the necessary lines."-+SensitivityHigh: "High"-+SensitivityLow: "Low"-+SettingsWindow: "Options"-+Subtitles: "Subtitles"-+TestingExteriorCells: "Testing exterior cells"-+TestingInteriorCells: "Testing interior cells"-+TextureFiltering: "Texture Filtering"-+TextureFilteringBilinear: "Bilinear"-+TextureFilteringDisabled: "None"-+TextureFilteringOther: "Other"-+TextureFilteringTrilinear: "Trilinear"-+ToggleHUD: "Toggle HUD"-+TogglePostProcessorHUD: "Toggle Post Processor HUD"-+TransparencyFull: "Full"-+TransparencyNone: "None"-+Video: "Video"-+ViewDistance: "View Distance"-+VSync: "VSync"-+VSyncAdaptive: "Adaptive"-+Water: "Water"-+WaterShader: "Water shader"-+WaterShaderTextureQuality: "Texture quality"-+WindowBorder: "Window Border"-+WindowMode: "Window Mode"-+WindowModeFullscreen: "Fullscreen"-+WindowModeHint: "Hint: Windowed Fullscreen mode\nalways uses the native display resolution."-+WindowModeWindowed: "Windowed"-+WindowModeWindowedFullscreen: "Windowed Fullscreen"-diff --git a/files/data/mygui/openmw_settings_window.layout b/files/data/mygui/openmw_settings_window.layout-index 27298b9756a..3a548aa9a98 100644---- a/files/data/mygui/openmw_settings_window.layout-+++ b/files/data/mygui/openmw_settings_window.layout-@@ -453,6 +453,20 @@- </Widget>- </Widget>--+ <Widget type="HBox" align="Stretch">-+ <UserString key="HStretch" value="true"/>-+ <UserString key="VStretch" value="false"/>-+-+ <Widget type="AutoSizedButton" skin="MW_Button">-+ <UserString key="SettingCategory" value="Water"/>-+ <UserString key="SettingName" value="shader ripples"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText">-+ <Property key="Caption" value="#{OMWEngine:WaterShaderRipples}"/>-+ </Widget>-+ </Widget>-+- <Widget type="HBox" align="Stretch">- <UserString key="HStretch" value="true"/>- <UserString key="VStretch" value="false"/>-diff --git a/files/data/mygui/openmw_settings_window.layout.orig b/files/data/mygui/openmw_settings_window.layout.orig-new file mode 100644-index 00000000000..27298b9756a---- /dev/null-+++ b/files/data/mygui/openmw_settings_window.layout.orig-@@ -0,0 +1,729 @@-+<?xml version="1.0" encoding="UTF-8"?>-+<MyGUI type="Layout" version="3.2.0">-+ <Widget type="Window" skin="MW_Window" position="0 0 400 485" layer="MainMenu" name="_Main">-+ <Property key="MinSize" value="640 490"/>-+ <Widget type="TabControl" skin="TabControl" position="8 8 368 405" align="Stretch" name="SettingsTab">-+ <Property key="ButtonAutoWidth" value="true"/>-+ <Widget type="TabItem">-+ <Property key="Caption" value=" #{OMWEngine:Preferences} "/>-+ <Widget type="Widget" position="4 4 352 54" align="Left Top HStretch">-+ <Widget type="TextBox" skin="NormalText" position="0 0 352 16" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:MenuTransparency}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 20 352 14" align="Left Top HStretch">-+ <Property key="Range" value="10000"/>-+ <Property key="Page" value="300"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="GUI"/>-+ <UserString key="SettingName" value="menu transparency"/>-+ <UserString key="SettingValueType" value="Float"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 38 352 16" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:TransparencyFull}"/>-+ <Property key="TextAlign" value="Left"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 38 352 16" align="Right Top">-+ <Property key="Caption" value="#{OMWEngine:TransparencyNone}"/>-+ <Property key="TextAlign" value="Right"/>-+ </Widget>-+ </Widget>-+ <Widget type="Widget" position="4 64 352 54" align="Left Top HStretch">-+ <Widget type="TextBox" skin="NormalText" position="0 0 352 16" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:MenuHelpDelay}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 20 352 14" align="Left Top HStretch">-+ <Property key="Range" value="10000"/>-+ <Property key="Page" value="300"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="GUI"/>-+ <UserString key="SettingName" value="tooltip delay"/>-+ <UserString key="SettingValueType" value="Float"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 38 352 16" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:DelayLow}"/>-+ <Property key="TextAlign" value="Left"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 38 352 16" align="Right Top">-+ <Property key="Caption" value="#{OMWEngine:DelayHigh}"/>-+ <Property key="TextAlign" value="Right"/>-+ </Widget>-+ </Widget>-+ <Widget type="Widget" position="4 124 352 54" align="Left Top HStretch">-+ <Widget type="TextBox" skin="NormalText" position="0 0 352 16" align="Left Top" name="DifficultyText">-+ <Property key="Caption" value="#{OMWEngine:Difficulty}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 20 352 14" align="Left Top HStretch">-+ <Property key="Range" value="201"/>-+ <Property key="Page" value="1"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Game"/>-+ <UserString key="SettingName" value="difficulty"/>-+ <UserString key="SettingValueType" value="Integer"/>-+ <UserString key="SettingMin" value="-100"/>-+ <UserString key="SettingMax" value="100"/>-+ <UserString key="SettingLabelWidget" value="DifficultyText"/>-+ <UserString key="SettingLabelCaption" value="#{OMWEngine:Difficulty} (%s)"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 38 352 16" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:DifficultyEasy}"/>-+ <Property key="TextAlign" value="Left"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 38 352 16" align="Right Top">-+ <Property key="Caption" value="#{OMWEngine:DifficultyHard}"/>-+ <Property key="TextAlign" value="Right"/>-+ </Widget>-+ </Widget>-+ <Widget type="Widget" position="4 184 400 54" align="Left Top HStretch">-+ <Widget type="TextBox" skin="NormalText" position="0 0 400 16" align="Left Top" name="ActorProcessingText">-+ <Property key="Caption" value="#{OMWEngine:ActorsProcessingRange}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 20 352 14" align="Left Top HStretch">-+ <Property key="Range" value="3584"/>-+ <Property key="Page" value="300"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Game"/>-+ <UserString key="SettingName" value="actors processing range"/>-+ <UserString key="SettingValueType" value="Integer"/>-+ <UserString key="SettingMin" value="3584"/>-+ <UserString key="SettingMax" value="7168"/>-+ <UserString key="SettingLabelWidget" value="ActorProcessingText"/>-+ <UserString key="SettingLabelCaption" value="#{OMWEngine:ActorsProcessingRange} (%s)"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 38 352 16" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:DistanceLow}"/>-+ <Property key="TextAlign" value="Left"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 38 352 16" align="Right Top">-+ <Property key="Caption" value="#{OMWEngine:DistanceHigh}"/>-+ <Property key="TextAlign" value="Right"/>-+ </Widget>-+ </Widget>-+ <Widget type="HBox" position="4 250 260 28">-+ <Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top">-+ <UserString key="SettingCategory" value="Saves"/>-+ <UserString key="SettingName" value="autosave"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText" position="28 4 95 16" align="Left Top">-+ <Property key="Caption" value="#{sQuick_Save}"/>-+ </Widget>-+ </Widget>-+ <Widget type="HBox" position="4 280 260 28">-+ <Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top">-+ <UserString key="SettingCategory" value="Game"/>-+ <UserString key="SettingName" value="best attack"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText" position="28 4 89 16" align="Left Top">-+ <Property key="Caption" value="#{sBestAttack}"/>-+ </Widget>-+ </Widget>-+ <Widget type="HBox" position="4 310 260 28">-+ <Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top">-+ <UserString key="SettingCategory" value="GUI"/>-+ <UserString key="SettingName" value="subtitles"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText" position="28 4 71 16" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:Subtitles}"/>-+ </Widget>-+ </Widget>-+ <Widget type="HBox" position="4 340 260 28">-+ <Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top">-+ <UserString key="SettingCategory" value="HUD"/>-+ <UserString key="SettingName" value="crosshair"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText" position="28 4 80 16" align="Left Top">-+ <Property key="Caption" value="#{sCursorOff}"/>-+ </Widget>-+ </Widget>-+ </Widget>-+ <Widget type="TabItem">-+ <Property key="Caption" value=" #{OMWEngine:Audio} "/>-+ <Widget type="TextBox" skin="NormalText" position="4 4 352 18" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:AudioMaster}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="4 28 352 18" align="HStretch Top">-+ <Property key="Range" value="10000"/>-+ <Property key="Page" value="300"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Sound"/>-+ <UserString key="SettingName" value="master volume"/>-+ <UserString key="SettingValueType" value="Float"/>-+ </Widget>-+ <Widget type="TextBox" skin="NormalText" position="4 54 352 18" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:AudioVoice}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="4 78 352 18" align="HStretch Top">-+ <Property key="Range" value="10000"/>-+ <Property key="Page" value="300"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Sound"/>-+ <UserString key="SettingName" value="voice volume"/>-+ <UserString key="SettingValueType" value="Float"/>-+ </Widget>-+ <Widget type="TextBox" skin="NormalText" position="4 104 352 18" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:AudioEffects}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="4 128 352 18" align="HStretch Top">-+ <Property key="Range" value="10000"/>-+ <Property key="Page" value="300"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Sound"/>-+ <UserString key="SettingName" value="sfx volume"/>-+ <UserString key="SettingValueType" value="Float"/>-+ </Widget>-+ <Widget type="TextBox" skin="NormalText" position="4 154 352 18" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:AudioFootsteps}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="4 178 352 18" align="HStretch Top">-+ <Property key="Range" value="10000"/>-+ <Property key="Page" value="300"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Sound"/>-+ <UserString key="SettingName" value="footsteps volume"/>-+ <UserString key="SettingValueType" value="Float"/>-+ </Widget>-+ <Widget type="TextBox" skin="NormalText" position="4 204 352 18" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:AudioMusic}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="4 228 352 18" align="HStretch Top">-+ <Property key="Range" value="10000"/>-+ <Property key="Page" value="300"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Sound"/>-+ <UserString key="SettingName" value="music volume"/>-+ <UserString key="SettingValueType" value="Float"/>-+ </Widget>-+ </Widget>-+ <Widget type="TabItem">-+ <Property key="Caption" value=" #{OMWEngine:Controls} "/>-+-+ <Widget type="HBox" position="4 4 360 28">-+ <Property key="Padding" value="0"/>-+ <Property key="Spacing" value="4"/>-+ <Widget type="AutoSizedButton" skin="MW_Button" name="KeyboardButton">-+ <Property key="Caption" value="#{OMWEngine:MouseAndKeyboard}"/>-+ </Widget>-+ <Widget type="AutoSizedButton" skin="MW_Button" name="ControllerButton">-+ <Property key="Caption" value="#{OMWEngine:Controller}"/>-+ </Widget>-+ </Widget>-+-+ <Widget type="Widget" skin="MW_Box" position="4 38 352 154" align="Stretch">-+ <Widget type="ScrollView" skin="MW_ScrollView" position="4 4 344 146" align="Stretch" name="ControlsBox">-+ <Property key="CanvasAlign" value="Left Top"/>-+ </Widget>-+ </Widget>-+ <Widget type="AutoSizedButton" skin="MW_Button" position="4 198 137 24" align="Left Bottom" name="ResetControlsButton">-+ <Property key="Caption" value="#{OMWEngine:ResetControls}"/>-+ </Widget>-+ <Widget type="HBox" position="4 228 600 28" align="Left Bottom">-+ <Widget type="AutoSizedButton" skin="MW_Button">-+ <UserString key="SettingCategory" value="Input"/>-+ <UserString key="SettingName" value="invert x axis"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText">-+ <Property key="Caption" value="#{OMWEngine:InvertXAxis} "/>-+ </Widget>-+ <Widget type="AutoSizedButton" skin="MW_Button">-+ <UserString key="SettingCategory" value="Input"/>-+ <UserString key="SettingName" value="invert y axis"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText" position="56 4 78 16" align="Left Bottom">-+ <Property key="Caption" value="#{OMWEngine:InvertYAxis}"/>-+ </Widget>-+ </Widget>-+ <Widget type="TextBox" skin="NormalText" position="4 258 352 18" align="Left Bottom">-+ <Property key="Caption" value="#{OMWEngine:CameraSensitivity}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="4 282 352 18" align="HStretch Bottom">-+ <Property key="Range" value="10000"/>-+ <Property key="Page" value="300"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Input"/>-+ <UserString key="SettingName" value="camera sensitivity"/>-+ <UserString key="SettingValueType" value="Float"/>-+ <UserString key="SettingMin" value="0.2"/>-+ <UserString key="SettingMax" value="5.0"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="4 306 352 18" align="Left Bottom">-+ <Property key="Caption" value="#{OMWEngine:SensitivityLow}"/>-+ <Property key="TextAlign" value="Left"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="4 306 352 18" align="Right Bottom">-+ <Property key="Caption" value="#{OMWEngine:SensitivityHigh}"/>-+ <Property key="TextAlign" value="Right"/>-+ </Widget>-+ <Widget type="HBox" position="4 328 352 28" align="Left Bottom">-+ <Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Bottom">-+ <UserString key="SettingCategory" value="Input"/>-+ <UserString key="SettingName" value="enable controller"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText" position="28 4 78 16" align="Left Bottom">-+ <Property key="Caption" value="#{OMWEngine:EnableController}"/>-+ </Widget>-+ </Widget>-+ </Widget>-+ <Widget type="TabItem">-+ <Property key="Caption" value=" #{OMWEngine:Video} "/>-+ <Widget type="TabControl" skin="TabControlInner" position="4 4 352 390" align="Stretch">-+ <Property key="ButtonAutoWidth" value="true"/>-+ <Widget type="TabItem">-+ <Property key="Caption" value=" #{OMWEngine:Video} "/>-+ <Widget type="ListBox" skin="MW_List" position="0 4 195 225" align="Left Top" name="ResolutionList"/>-+ <Widget type="TextBox" skin="NormalText" position="207 4 250 18" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:WindowMode}"/>-+ </Widget>-+ <Widget type="HBox" position="207 24 400 24">-+ <Widget type="ComboBox" skin="MW_ComboBox" position="0 0 200 24" align="Left Top" name="WindowModeList">-+ <Property key="AddItem" value="#{OMWEngine:WindowModeFullscreen}"/>-+ <Property key="AddItem" value="#{OMWEngine:WindowModeWindowedFullscreen}"/>-+ <Property key="AddItem" value="#{OMWEngine:WindowModeWindowed}"/>-+ </Widget>-+ </Widget>-+ <Widget type="TextBox" skin="NormalText" position="207 54 250 18" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:VSync}"/>-+ </Widget>-+ <Widget type="HBox" position="207 74 400 28">-+ <Widget type="ComboBox" skin="MW_ComboBox" position="0 0 200 24" align="Left Top" name="VSyncModeList">-+ <Property key="AddItem" value="#{Interface:Off}"/>-+ <Property key="AddItem" value="#{Interface:On}"/>-+ <Property key="AddItem" value="#{OMWEngine:VSyncAdaptive}"/>-+ </Widget>-+ </Widget>-+ <Widget type="HBox" position="207 108 300 28">-+ <Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top" name="WindowBorderButton">-+ <UserString key="SettingCategory" value="Video"/>-+ <UserString key="SettingName" value="window border"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText" position="28 4 48 16" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:WindowBorder}"/>-+ </Widget>-+ </Widget>-+ <Widget type="HBox" position="207 142 300 28">-+ <Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top" name="WindowBorderButton">-+ <UserString key="SettingCategory" value="Post Processing"/>-+ <UserString key="SettingName" value="enabled"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText" position="28 4 48 16" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:PostProcessing}"/>-+ <UserString key="ToolTipType" value="Layout"/>-+ <UserString key="ToolTipLayout" value="TextToolTip"/>-+ <UserString key="Caption_Text" value="#{OMWEngine:PostProcessingTooltip}"/>-+ </Widget>-+ </Widget>-+-+ <Widget type="AutoSizedTextBox" skin="SandText" position="207 174 300 32" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:FrameRateHint}"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText" position="207 216 300 32" align="Left Top" name="WindowModeHint">-+ <Property key="Caption" value="#{OMWEngine:WindowModeHint}"/>-+ </Widget>-+-+ <Widget type="TextBox" skin="NormalText" position="0 238 352 18" align="Left Top" name="FovText">-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 262 352 18" align="HStretch Top">-+ <Property key="Range" value="81"/>-+ <Property key="Page" value="1"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Camera"/>-+ <UserString key="SettingName" value="field of view"/>-+ <UserString key="SettingValueType" value="Float"/>-+ <UserString key="SettingMin" value="30"/>-+ <UserString key="SettingMax" value="110"/>-+ <UserString key="SettingLabelWidget" value="FovText"/>-+ <UserString key="SettingLabelCaption" value="#{OMWEngine:FieldOfView} (%s)"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 286 352 18" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:FieldOfViewLow}"/>-+ <Property key="TextAlign" value="Left"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 286 352 18" align="Right Top">-+ <Property key="Caption" value="#{OMWEngine:FieldOfViewHigh}"/>-+ <Property key="TextAlign" value="Right"/>-+ </Widget>-+ <Widget type="TextBox" skin="NormalText" position="0 308 352 18" align="Left Top" name="GammaText">-+ <Property key="Caption" value="#{OMWEngine:GammaCorrection}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 332 352 18" align="HStretch Top" name="GammaSlider">-+ <Property key="Range" value="10000"/>-+ <Property key="Page" value="300"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Video"/>-+ <UserString key="SettingName" value="gamma"/>-+ <UserString key="SettingValueType" value="Float"/>-+ <UserString key="SettingMin" value="0.1"/>-+ <UserString key="SettingMax" value="3.0"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 356 352 18" align="Left Top" name="GammaTextDark">-+ <Property key="Caption" value="#{OMWEngine:GammaDark}"/>-+ <Property key="TextAlign" value="Left"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 356 352 18" align="Right Top" name="GammaTextLight">-+ <Property key="Caption" value="#{OMWEngine:GammaLight}"/>-+ <Property key="TextAlign" value="Right"/>-+ </Widget>-+ </Widget>-+ <Widget type="TabItem">-+ <Property key="Caption" value=" #{OMWEngine:DetailLevel} "/>-+-+ <Widget type="AutoSizedTextBox" skin="NormalText" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:TextureFiltering}"/>-+ <UserString key="VStretch" value="false"/>-+ <UserString key="HStretch" value="false"/>-+ </Widget>-+ <Widget type="ComboBox" align="Left Top" skin="MW_ComboBox" position="0 28 200 24" name="TextureFilteringButton">-+ <Property key="AddItem" value="#{OMWEngine:TextureFilteringBilinear}"/>-+ <Property key="AddItem" value="#{OMWEngine:TextureFilteringTrilinear}"/>-+ </Widget>-+-+ <Widget type="AutoSizedTextBox" skin="NormalText" position="0 58 200 18" name="AnisotropyLabel">-+ <Property key="Caption" value="#{OMWEngine:Anisotropy}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 80 352 18" align="HStretch Top">-+ <Property key="Range" value="17"/>-+ <Property key="Page" value="1"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="General"/>-+ <UserString key="SettingName" value="anisotropy"/>-+ <UserString key="SettingLabelWidget" value="AnisotropyLabel"/>-+ <UserString key="SettingLabelCaption" value="#{OMWEngine:Anisotropy} (%s)"/>-+ </Widget>-+-+ <Widget type="AutoSizedTextBox" skin="NormalText" position="0 104 0 18" align="Left Top" name="RenderDistanceLabel">-+ <Property key="Caption" value="#{OMWEngine:ViewDistance}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 126 352 18" align="HStretch Top" name="RenderingDistanceSlider">-+ <Property key="Range" value="4669"/>-+ <Property key="Page" value="128"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Camera"/>-+ <UserString key="SettingName" value="viewing distance"/>-+ <UserString key="SettingValueType" value="Float"/>-+ <UserString key="SettingMin" value="2500"/>-+ <UserString key="SettingMax" value="7168"/>-+ <UserString key="SettingLabelWidget" value="RenderDistanceLabel"/>-+ <UserString key="SettingLabelCaption" value="#{OMWEngine:ViewDistance} (%s)"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 126 352 18" align="HStretch Top" name="LargeRenderingDistanceSlider">-+ <Property key="Range" value="79421"/>-+ <Property key="Page" value="2048"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Camera"/>-+ <UserString key="SettingName" value="viewing distance"/>-+ <UserString key="SettingValueType" value="Cell"/>-+ <UserString key="SettingMin" value="2500"/>-+ <UserString key="SettingMax" value="81920"/>-+ <UserString key="SettingLabelWidget" value="RenderDistanceLabel"/>-+ <UserString key="SettingLabelCaption" value="#{OMWEngine:ViewDistance} (x%s)"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 148 352 18" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:DistanceLow}"/>-+ <Property key="TextAlign" value="Left"/>-+ </Widget>-+ <Widget type="TextBox" skin="SandText" position="0 148 352 18" align="Right Top">-+ <Property key="Caption" value="#{OMWEngine:DistanceHigh}"/>-+ <Property key="TextAlign" value="Right"/>-+ </Widget>-+-+ </Widget>-+ <Widget type="TabItem">-+ <Property key="Caption" value=" #{OMWEngine:Water} "/>-+-+ <Widget type="VBox" position_real="0 0 1 1" align="Stretch">-+-+ <Widget type="HBox" align="Stretch">-+ <UserString key="HStretch" value="true"/>-+ <UserString key="VStretch" value="false"/>-+-+ <Widget type="AutoSizedButton" skin="MW_Button">-+ <UserString key="SettingCategory" value="Water"/>-+ <UserString key="SettingName" value="shader"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText">-+ <Property key="Caption" value="#{OMWEngine:WaterShader}"/>-+ </Widget>-+ </Widget>-+-+ <Widget type="HBox" align="Stretch">-+ <UserString key="HStretch" value="true"/>-+ <UserString key="VStretch" value="false"/>-+-+ <Widget type="AutoSizedButton" skin="MW_Button">-+ <UserString key="SettingCategory" value="Water"/>-+ <UserString key="SettingName" value="refraction"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText">-+ <Property key="Caption" value="#{OMWEngine:Refraction}"/>-+ </Widget>-+ </Widget>-+-+ <Widget type="Widget" position="0 0 0 18" align="Top Left HStretch">-+ <UserString key="HStretch" value="true"/>-+ <Widget type="AutoSizedTextBox" skin="NormalText">-+ <Property key="Caption" value="#{OMWEngine:WaterShaderTextureQuality}"/>-+ </Widget>-+ <Widget type="Spacer" />-+ </Widget>-+-+ <Widget type="HBox" align="Stretch">-+ <UserString key="HStretch" value="true"/>-+ <UserString key="VStretch" value="false"/>-+ <Widget type="ComboBox" skin="MW_ComboBox" position="0 0 200 24" align="Left Top" name="WaterTextureSize">-+ <Property key="AddItem" value="#{OMWEngine:QualityLow}"/>-+ <Property key="AddItem" value="#{OMWEngine:QualityMedium}"/>-+ <Property key="AddItem" value="#{OMWEngine:QualityHigh}"/>-+ </Widget>-+ <Widget type="Spacer" />-+ </Widget>-+-+ <Widget type="Widget" position="0 0 0 18" align="Top Left HStretch">-+ <UserString key="HStretch" value="true"/>-+ <Widget type="AutoSizedTextBox" skin="NormalText">-+ <Property key="Caption" value="#{OMWEngine:ReflectionShaderDetail}"/>-+ </Widget>-+ <Widget type="Spacer" />-+ </Widget>-+ <Widget type="HBox" align="Stretch">-+ <UserString key="HStretch" value="true"/>-+ <UserString key="VStretch" value="false"/>-+-+ <Widget type="ComboBox" skin="MW_ComboBox" position="0 0 200 24" align="Left Top" name="WaterReflectionDetail">-+ <Property key="AddItem" value="#{OMWEngine:ReflectionShaderDetailSky}"/>-+ <Property key="AddItem" value="#{OMWEngine:ReflectionShaderDetailTerrain}"/>-+ <Property key="AddItem" value="#{OMWEngine:ReflectionShaderDetailWorld}"/>-+ <Property key="AddItem" value="#{OMWEngine:ReflectionShaderDetailObjects}"/>-+ <Property key="AddItem" value="#{OMWEngine:ReflectionShaderDetailActors}"/>-+ <Property key="AddItem" value="#{OMWEngine:ReflectionShaderDetailGroundcover}"/>-+ </Widget>-+ <Widget type="Spacer" />-+ </Widget>-+-+ <Widget type="Widget" position="0 0 0 18" align="Top Left HStretch">-+ <UserString key="HStretch" value="true"/>-+ <Widget type="AutoSizedTextBox" skin="NormalText">-+ <Property key="Caption" value="#{OMWEngine:RainRippleDetail}"/>-+ </Widget>-+ <Widget type="Spacer" />-+ </Widget>-+-+ <Widget type="HBox" align="Stretch">-+ <UserString key="HStretch" value="true"/>-+ <UserString key="VStretch" value="false"/>-+-+ <Widget type="ComboBox" skin="MW_ComboBox" position="0 0 200 24" align="Left Top" name="WaterRainRippleDetail">-+ <Property key="AddItem" value="#{OMWEngine:RainRippleDetailSimple}"/>-+ <Property key="AddItem" value="#{OMWEngine:RainRippleDetailSparse}"/>-+ <Property key="AddItem" value="#{OMWEngine:RainRippleDetailDense}"/>-+ </Widget>-+ <Widget type="Spacer" />-+ </Widget>-+-+ </Widget>-+-+ </Widget>-+ <Widget type="TabItem">-+ <Property key="Caption" value=" #{OMWEngine:Lights} "/>-+ <!-- Lighting Method -->-+ <Widget type="TextBox" skin="NormalText" position="0 4 250 18" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:LightingMethod}"/>-+ <UserString key="ToolTipType" value="Layout"/>-+ <UserString key="ToolTipLayout" value="TextToolTip"/>-+ <UserString key="Caption_Text" value="#{OMWEngine:LightsLightingMethodTooltip}"/>-+ </Widget>-+ <Widget type="ComboBox" skin="MW_ComboBox" position="0 28 250 24" align="Left Top" name="LightingMethodButton">-+ <Property key="AddItem" value="legacy"/>-+ <Property key="AddItem" value="shaders compatibility"/>-+ <Property key="AddItem" value="shaders"/>-+ </Widget>-+ <!-- Max Lights -->-+ <Widget type="TextBox" skin="NormalText" position="258 4 350 18" align="Left Top" name="MaxLightsText">-+ <UserString key="ToolTipType" value="Layout"/>-+ <UserString key="ToolTipLayout" value="TextToolTip"/>-+ <UserString key="Caption_Text" value="#{OMWEngine:MaxLightsTooltip}"/>-+ </Widget>-+ <Widget type="ScrollBar" position="0 0 0 0">-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Shaders"/>-+ <UserString key="SettingName" value="max lights"/>-+ <UserString key="SettingValueType" value="Integer"/>-+ <UserString key="SettingLabelWidget" value="MaxLightsText"/>-+ <UserString key="SettingLabelCaption" value="#{OMWEngine:MaxLights} (%s)"/>-+ </Widget>-+ <Widget type="ComboBox" skin="MW_ComboBox" position="258 28 250 24" align="Left Top" name="MaxLights">-+ <Property key="AddItem" value="8"/>-+ <Property key="AddItem" value="16"/>-+ <Property key="AddItem" value="24"/>-+ <Property key="AddItem" value="32"/>-+ <Property key="AddItem" value="40"/>-+ <Property key="AddItem" value="48"/>-+ <Property key="AddItem" value="56"/>-+ <Property key="AddItem" value="64"/>-+ </Widget>-+ <Widget type="ImageBox" skin="MW_HLine" position="0 54 360 18" align="Top HStretch"/>-+ <!-- Light Fade Start -->-+ <Widget type="TextBox" skin="NormalText" position="0 78 500 18" align="Left Top" name="MaxLightDistanceText">-+ <UserString key="ToolTipType" value="Layout"/>-+ <UserString key="ToolTipLayout" value="TextToolTip"/>-+ <UserString key="Caption_Text" value="#{OMWEngine:LightsMaximumDistanceTooltip}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 104 352 18" align="HStretch Top">-+ <Property key="Range" value="8193"/>-+ <Property key="Page" value="128"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingMin" value="0"/>-+ <UserString key="SettingMax" value="8192"/>-+ <UserString key="SettingCategory" value="Shaders"/>-+ <UserString key="SettingName" value="maximum light distance"/>-+ <UserString key="SettingValueType" value="Float"/>-+ <UserString key="SettingLabelWidget" value="MaxLightDistanceText"/>-+ <UserString key="SettingLabelCaption" value="#{OMWEngine:LightsMaximumDistance} (%s)"/>-+ </Widget>-+ <!-- Light Fade Multiplier -->-+ <Widget type="TextBox" skin="NormalText" position="0 128 500 18" align="Left Top" name="LightFadeMultiplierText">-+ <UserString key="ToolTipType" value="Layout"/>-+ <UserString key="ToolTipLayout" value="TextToolTip"/>-+ <UserString key="Caption_Text" value="#{OMWEngine:LightsFadeStartMultiplierTooltip}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 152 352 18" align="HStretch Top">-+ <Property key="Range" value="10000"/>-+ <Property key="Page" value="100"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Shaders"/>-+ <UserString key="SettingName" value="light fade start"/>-+ <UserString key="SettingValueType" value="Float"/>-+ <UserString key="SettingMin" value="0.0"/>-+ <UserString key="SettingMax" value="1.0"/>-+ <UserString key="SettingLabelWidget" value="LightFadeMultiplierText"/>-+ <UserString key="SettingLabelCaption" value="#{OMWEngine:LightsFadeStartMultiplier} (%s)"/>-+ </Widget>-+ <!-- Bounding Sphere Multiplier -->-+ <Widget type="TextBox" skin="NormalText" position="0 176 500 18" align="Left Top" name="BoundingSphereMultText">-+ <UserString key="ToolTipType" value="Layout"/>-+ <UserString key="ToolTipLayout" value="TextToolTip"/>-+ <UserString key="Caption_Text" value="#{OMWEngine:LightsBoundingSphereMultiplierTooltip}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 200 352 18" align="HStretch Top">-+ <Property key="Range" value="500000"/>-+ <Property key="Page" value="1000"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingMin" value="0.0"/>-+ <UserString key="SettingMax" value="5.0"/>-+ <UserString key="SettingCategory" value="Shaders"/>-+ <UserString key="SettingName" value="light bounds multiplier"/>-+ <UserString key="SettingValueType" value="Float"/>-+ <UserString key="SettingLabelWidget" value="BoundingSphereMultText"/>-+ <UserString key="SettingLabelCaption" value="#{OMWEngine:LightsBoundingSphereMultiplier} (%s)"/>-+ </Widget>-+ <!-- Minimum Ambient Brightness -->-+ <Widget type="TextBox" skin="NormalText" position="0 224 500 18" align="Left Top" name="MinimumBrightnessText">-+ <UserString key="ToolTipType" value="Layout"/>-+ <UserString key="ToolTipLayout" value="TextToolTip"/>-+ <UserString key="Caption_Text" value="#{OMWEngine:LightsMinimumInteriorBrightnessTooltip}"/>-+ </Widget>-+ <Widget type="ScrollBar" skin="MW_HScroll" position="0 248 352 18" align="HStretch Top">-+ <Property key="Range" value="10000"/>-+ <Property key="Page" value="100"/>-+ <UserString key="SettingType" value="Slider"/>-+ <UserString key="SettingCategory" value="Shaders"/>-+ <UserString key="SettingName" value="minimum interior brightness"/>-+ <UserString key="SettingValueType" value="Float"/>-+ <UserString key="SettingLabelWidget" value="MinimumBrightnessText"/>-+ <UserString key="SettingLabelCaption" value="#{OMWEngine:LightsMinimumInteriorBrightness} (%s)"/>-+ </Widget>-+ <Widget type="AutoSizedButton" skin="MW_Button" position="0 290 0 0" align="Top Left" name="LightsResetButton">-+ <Property key="Caption" value="#{Interface:Reset}"/>-+ </Widget>-+ </Widget>-+ </Widget>-+ </Widget>-+ <Widget type="TabItem">-+ <Property key="Caption" value=" #{OMWEngine:Scripts} "/>-+-+ <Widget name="ScriptDisabled" type="EditBox" skin="SandText" position_real="0 0 1 1" align="HStretch Top">-+ <Property key="Caption" value="#{OMWEngine:ScriptsDisabled}"/>-+ <Property key="TextAlign" value="Center"/>-+ <Property key="MultiLine" value="true"/>-+ <Property key="WordWrap" value="true"/>-+ <Property key="Static" value="true"/>-+ </Widget>-+-+ <Widget type="HBox" position_real="0 0 1 0.99" align="Stretch">-+ <Property key="Padding" value="0"/>-+ <Property key="Spacing" value="0"/>-+ <Widget type="VBox" align="Left VStretch">-+ <UserString key="VStretch" value="true"/>-+-+ <Widget name="ScriptFilter" type="EditBox" skin="MW_TextEdit" position="0 0 300 28">-+ <UserString key="HStretch" value="false"/>-+ <UserString key="VStretch" value="false"/>-+ </Widget>-+-+ <Widget name="ScriptList" type="ListBox" skin="MW_List" align="Left VStretch">-+ <UserString key="HStretch" value="true"/>-+ <UserString key="VStretch" value="true"/>-+ </Widget>-+ </Widget>-+-+ <Widget name="ScriptBox" type="Widget" align="Stretch" name="ScriptBox">-+ <UserString key="HStretch" value="true"/>-+ <UserString key="VStretch" value="true"/>-+-+ <Widget name="ScriptView" type="ScrollView" skin="MW_ScrollViewVH" align="Stretch">-+ <Property key="CanvasAlign" value="Left Top"/>-+ <Widget name="ScriptAdapter" type="LuaAdapter"/>-+ </Widget>-+ </Widget>-+-+ </Widget>-+-+ </Widget>-+ <Widget type="TabItem">-+ <Property key="Caption" value=" #{OMWEngine:Language} "/>-+ <Widget type="AutoSizedTextBox" skin="SandText" position="4 4 300 32" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:LanguageNote}"/>-+ </Widget>-+ <!-- Primary Language -->-+ <Widget type="TextBox" skin="NormalText" position="4 28 250 18" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:PrimaryLanguage}"/>-+ <UserString key="ToolTipType" value="Layout"/>-+ <UserString key="ToolTipLayout" value="TextToolTip"/>-+ <UserString key="Caption_Text" value="#{OMWEngine:PrimaryLanguageTooltip}"/>-+ </Widget>-+ <Widget type="ComboBox" skin="MW_ComboBox" position="4 52 250 24" align="Left Top" name="PrimaryLanguage" />-+ <!-- Secondary Language -->-+ <Widget type="TextBox" skin="NormalText" position="262 28 250 18" align="Left Top">-+ <Property key="Caption" value="#{OMWEngine:SecondaryLanguage}"/>-+ <UserString key="ToolTipType" value="Layout"/>-+ <UserString key="ToolTipLayout" value="TextToolTip"/>-+ <UserString key="Caption_Text" value="#{OMWEngine:SecondaryLanguageTooltip}"/>-+ </Widget>-+ <Widget type="ComboBox" skin="MW_ComboBox" position="262 52 250 24" align="Left Top" name="SecondaryLanguage" />-+ <Widget type="HBox" position="4 84 500 32">-+ <Widget type="AutoSizedButton" skin="MW_Button" name="GmstOverridesL10nButton">-+ <UserString key="SettingCategory" value="General"/>-+ <UserString key="SettingName" value="gmst overrides l10n"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText">-+ <Property key="Caption" value="#{OMWEngine:GmstOverridesL10n} "/>-+ </Widget>-+ </Widget>-+ </Widget>-+ </Widget>-+ <Widget type="AutoSizedButton" skin="MW_Button" position="320 420 56 24" align="Right Bottom" name="OkButton">-+ <Property key="ExpandDirection" value="Left"/>-+ <Property key="Caption" value="#{Interface:OK}"/>-+ </Widget>-+ </Widget>-+ <CodeGeneratorSettings/>-+</MyGUI>-diff --git a/files/data/shaders/bloomlinear.omwfx b/files/data/shaders/bloomlinear.omwfx-old mode 100644-new mode 100755-index 3de7139f39a..4c583a9a898---- a/files/data/shaders/bloomlinear.omwfx-+++ b/files/data/shaders/bloomlinear.omwfx-@@ -80,8 +80,8 @@ shared {- radius = max(radius, 0.1);- // hack: make the radius wider on the screen edges- // (makes things in the corner of the screen look less "wrong" with not-extremely-low FOVs)-- radius *= pow(texcoord.x*2.0-1.0, 2)+1.0;-- radius *= pow(texcoord.y*2.0-1.0, 2)+1.0;-+ radius *= pow(texcoord.x*2.0-1.0, 2.0)+1.0;-+ radius *= pow(texcoord.y*2.0-1.0, 2.0)+1.0;- return radius;- }- vec3 powv(vec3 a, float x)-@@ -94,7 +94,7 @@ render_target RT_NoMipmap {- width_ratio = 0.25;- height_ratio = 0.25;- internal_format = rgb16f;-- source_type = float;-+ source_type = half_float;- source_format = rgb;- mipmaps = false;- min_filter = nearest;-@@ -105,7 +105,7 @@ render_target RT_Horizontal {- width_ratio = 0.25;- height_ratio = 0.25;- internal_format = rgb16f;-- source_type = float;-+ source_type = half_float;- source_format = rgb;- mipmaps = false;- min_filter = nearest;-@@ -116,7 +116,7 @@ render_target RT_Vertical {- width_ratio = 0.25;- height_ratio = 0.25;- internal_format = rgb16f;-- source_type = float;-+ source_type = half_float;- source_format = rgb;- mipmaps = false;- min_filter = linear;-diff --git a/files/settings-default.cfg b/files/settings-default.cfg-index 1caf03c123f..336a0b34ccf 100644---- a/files/settings-default.cfg-+++ b/files/settings-default.cfg-@@ -657,6 +657,9 @@ screenshot type = regular- # Enable water shader with reflections and optionally refraction.- shader = false--+# Enable shader ripples.-+shader ripples = false-+- # Reflection and refraction texture size in pixels. (512, 1024, 2048).- rtt size = 512--diff --git a/files/settings-default.cfg.orig b/files/settings-default.cfg.orig-new file mode 100644-index 00000000000..1caf03c123f---- /dev/null-+++ b/files/settings-default.cfg.orig-@@ -0,0 +1,1267 @@-+# WARNING: Users should NOT edit this file. Users should add their personal preferences to the settings.cfg file overriding this file.-+# For the location of the settings.cfg file, as well as more detailed settings documentation, refer to:-+#-+# https://openmw.readthedocs.io/en/latest/reference/modding/settings/index.html-+#-+-+[Camera]-+-+# Near clipping plane (>0.0, e.g. 0.01 to 18.0).-+near clip = 1-+-+# Cull objects that occupy less than 'small feature culling pixel size' on the screen.-+small feature culling = true-+-+small feature culling pixel size = 2.0-+-+# Maximum visible distance. Caution: this setting-+# can dramatically affect performance, see documentation for details.-+viewing distance = 7168.0-+-+# Camera field of view in degrees (e.g. 30.0 to 110.0).-+# Does not affect the player's hands in the first person camera.-+field of view = 60.0-+-+# Field of view for first person meshes (i.e. the player's hands)-+# Best to leave this at the default since vanilla assets are not complete enough to adapt to high FoV's. Too low FoV would clip the hands off screen.-+first person field of view = 60.0-+-+# Reverse the depth range, reduces z-fighting of distant objects and terrain-+reverse z = true-+-+[Cells]-+-+# Preload cells in a background thread. All settings starting with 'preload' have no effect unless this is enabled.-+preload enabled = true-+-+# The number of threads to be used for preloading operations.-+preload num threads = 1-+-+# Preload adjacent cells when moving close to an exterior cell border.-+preload exterior grid = true-+-+# Preload possible fast travel destinations.-+preload fast travel = false-+-+# Preload the locations that doors lead to.-+preload doors = true-+-+# Preloading distance threshold-+preload distance = 1000-+-+# Controls whether or not the nodes/collision shapes are pre-"instanced" (i.e. cloned) when a cell is preloaded.-+# Enabling this option slightly reduces the time it takes to transition into a preloaded cell, but also results in higher memory usage-+# proportional to the number of cells that are preloaded.-+preload instances = true-+-+# The minimum amount of cells in the preload cache before unused cells start to get thrown out (see "preload cell expiry delay").-+# This value should be lower or equal to 'preload cell cache max'.-+preload cell cache min = 12-+-+# The maximum amount of cells in the preload cache. A too high value could cause you to run out of memory.-+# You may need to reduce this setting when running lots of mods or high-res texture replacers.-+preload cell cache max = 20-+-+# How long to keep preloaded cells in cache after they're no longer referenced/required (in seconds)-+preload cell expiry delay = 5-+-+# The predicted position of the player N seconds in the future will be used for preloading cells and distant terrain-+prediction time = 1-+-+# How long to keep models/textures/collision shapes in cache after they're no longer referenced/required (in seconds)-+cache expiry delay = 5-+-+# Affects the time to be set aside each frame for graphics preloading operations-+target framerate = 60-+-+# The count of pointers, that will be saved for a faster search by object ID.-+pointers cache size = 40-+-+[Terrain]-+-+# If true, use paging and LOD algorithms to display the entire terrain. If false, only display terrain of the loaded cells-+distant terrain = false-+-+# Controls how the Quad Tree is split. This affects Vertex LOD, Texture LOD and load times. Values > 1 increase detail, values < 1 reduce detail.-+lod factor = 1.0-+-+# Controls only the Vertex LOD. Change in increments of 1, each change doubles (or halves) the number of vertices. Values > 0 increase detail, values < 0 reduce detail.-+vertex lod mod = 0-+-+# Controls when the distant terrain will flip to composited textures instead of high-detail textures, should be >= -3.-+# Higher value is more detailed textures.-+composite map level = 0-+-+# Controls the resolution of composite maps.-+composite map resolution = 512-+-+# Controls the maximum size of composite geometry, should be >= 1.0. With low values there will be many small chunks, with high values - lesser count of bigger chunks.-+max composite geometry size = 4.0-+-+# Draw lines arround chunks.-+debug chunks = false-+-+# Use object paging for non active cells-+object paging = true-+-+# Use object paging for active cells grid-+object paging active grid = true-+-+# Affects the likelyhood of more complex objects to get paged. Higher values improve visual fidelity at the cost of performance and RAM.-+object paging merge factor = 250-+-+# Cull objects smaller than this size divided by distance-+object paging min size = 0.01-+-+# Adjusts 'min size' based on merging decision. Allows inexpensive objects to be rendered from a greater distance.-+object paging min size merge factor = 0.3-+-+# Controls how inexpensive an object needs to be to utilize 'min size merge factor'.-+object paging min size cost multiplier = 25-+-+[Fog]-+-+# If true, use extended fog parameters for distant terrain not controlled by-+# viewing distance. If false, use the standard fog calculations.-+use distant fog = false-+-+distant land fog start = 16384-+-+distant land fog end = 40960-+-+distant underwater fog start = -4096-+-+distant underwater fog end = 2457.6-+-+distant interior fog start = 0-+-+distant interior fog end = 16384-+-+# Determine fog intensity based on the distance from the eye point.-+# This makes fogging independent from the viewing angle. Shaders will be used to render all objects.-+radial fog = false-+-+# Whether to use exponential formula for fog.-+exponential fog = false-+-+# Whether to hide the clipping plane by blending with sky.-+sky blending = false-+-+# Fraction of the maximum distance at which blending with the sky starts.-+sky blending start = 0.8-+-+# The sky RTT texture size, used only for sky blending. Smaller values-+# reduce quality of the sky blending, but can have slightly better performance.-+sky rtt resolution = 512 256-+-+[Map]-+-+# Size of each exterior cell in pixels in the world map. (e.g. 12 to 24).-+# Warning: affects explored areas in save files, see documentation.-+global map cell size = 18-+-+# Enables Fog of War rendering on the HUD map. Default is Off since with default settings-+# the map is so small that the fog would not obscure anything, just darken the edges slightly.-+local map hud fog of war = false-+-+# Resolution of local map in GUI window in pixels. See documentation-+# for details which may affect cell load performance. (e.g. 128 to 1024).-+local map resolution = 256-+-+# Size of local map in GUI window in pixels. (e.g. 256 to 1024).-+local map widget size = 512-+-+# If true, map in world mode, otherwise in local mode-+global = false-+-+# If true, allow zoom on local and global maps-+allow zooming = false-+-+# The local view distance in number of cells (up to the view distance)-+max local viewing distance = 10-+-+[GUI]-+-+# Scales GUI window and widget size. (<1.0 is smaller, >1.0 is larger).-+scaling factor = 1.0-+-+# Size of in-game fonts-+font size = 16-+-+# Transparency of GUI windows (0.0 to 1.0, transparent to opaque).-+menu transparency = 0.84-+-+# Time until tool tip appears when hovering over an object (0.0 is-+# instantly, 1.0 is the maximum delay of about 1.5 seconds).-+tooltip delay = 0.0-+-+# Stretch menus, load screens, etc. to the window aspect ratio.-+stretch menu background = false-+-+# Subtitles for NPC spoken dialog and some sound effects.-+subtitles = false-+-+# Red flash visually showing player damage.-+hit fader = true-+-+# Werewolf overlay border around screen or window.-+werewolf overlay = true-+-+# Color for tool tips and crosshair when owned by an NPC (R G B A).-+color background owned = 0.15 0.0 0.0 1.0-+color crosshair owned = 1.0 0.15 0.15 1.0-+-+# Controls whether Arrow keys, Movement keys, Tab/Shift-Tab and Spacebar/Enter/Activate may be used to navigate GUI buttons.-+keyboard navigation = true-+-+# Apply the defined color to dialogue topic.-+color topic enable = false-+-+# The color of dialogue topic keywords that gives unique actor responses-+# Format R G B A or empty for no special formatting-+# Default to blue-+color topic specific = 0.45 0.5 0.8 1-+-+# The color of dialogue topic keywords that gives already read responses-+# Format R G B A or empty for no special formatting-+# Default to grey-+color topic exhausted = 0.3 0.3 0.3 1-+-+[HUD]-+-+# Displays the crosshair or reticle when not in GUI mode.-+crosshair = true-+-+[Game]-+-+# Color crosshair and tool tip when object is owned by an NPC. (O is-+# no color, 1 is tool tip only, 2 is crosshair only, and 3 is both).-+show owned = 0-+-+# Show damage bonus of arrow and bolts.-+show projectile damage = false-+-+# Show additional weapon info: reach and attack speed-+show melee info = false-+-+# Show success probability in self-enchant dialog-+show enchant chance = false-+-+# Always use the best mode of attack: e.g. chop, slash or thrust.-+best attack = false-+-+# Difficulty. Expressed as damage dealt and received. (e.g. -100 to 100).-+difficulty = 0-+-+# The maximum range of actor AI, animations and physics updates.-+actors processing range = 7168-+-+# Make reflected Absorb spells have no practical effect, like in Morrowind.-+classic reflected absorb spells behavior = true-+-+# Make Calm spells stop combat on every frame-+classic calm spells behavior = true-+-+# Show duration of magic effect and lights in the spells window.-+show effect duration = false-+-+# Prevent merchants from equipping items that are sold to them.-+prevent merchant equipping = false-+-+# Make enchanted weaponry without Magical flag bypass normal weapons resistance-+enchanted weapons are magical = true-+-+# Make player followers and escorters start combat with enemies who have started combat with them-+# or the player. Otherwise they wait for the enemies or the player to do an attack first.-+followers attack on sight = false-+-+# Can loot non-fighting actors during death animation-+can loot during death animation = true-+-+# Make the value of filled soul gems dependent only on soul magnitude (with formula from the Morrowind Code Patch)-+rebalance soul gem values = false-+-+# Allow to load per-group KF-files from Animations folder-+use additional anim sources = false-+-+# Make the disposition change of merchants caused by barter dealings permanent-+barter disposition change is permanent = false-+-+# Uses the MCP formula (damage * (strength / 40)) to factor Strength into hand-to-hand combat.-+# (0 means it does not factor it in, 1 means it factors into werewolves damage calculation and-+# 2 means werewolves are ignored)-+strength influences hand to hand = 0-+-+# Render holstered weapons (with quivers and scabbards), requires modded assets-+weapon sheathing = false-+-+# Render holstered shield when it is not in actor's hands, requires modded assets-+shield sheathing = false-+-+# Allow non-standard ammunition solely to bypass normal weapon resistance or weakness-+only appropriate ammunition bypasses resistance = false-+-+# Use casting animations for magic items, just as for spells-+use magic item animations = false-+-+# Don't use race weight in NPC movement speed calculations-+normalise race speed = false-+-+# Adjusts the number of projectiles you can enchant at once:-+# count = (soul gem charge * projectiles enchant multiplier) / enchantment strength-+# A value of 0 means that you can only enchant one projectile.-+projectiles enchant multiplier = 0-+-+# Make Damage Fatigue magic effect uncapped like Drain Fatigue effect.-+# This means that unlike Morrowind you will be able to knock down actors using this effect.-+uncapped damage fatigue = false-+-+# Turn lower body to movement direction. 'true' makes diagonal movement more realistic.-+turn to movement direction = false-+-+# Makes all movements of NPCs and player more smooth.-+smooth movement = false-+-+# Max delay of turning (in seconds) if player drastically changes direction on the run.-+smooth movement player turning delay = 0.333-+-+# All actors avoid collisions with other actors.-+NPCs avoid collisions = false-+-+# Give way to moving actors when idle. Requires 'NPCs avoid collisions' to be enabled.-+NPCs give way = true-+-+# Makes player swim a bit upward from the line of sight.-+swim upward correction = false-+-+# Strength of the 'swim upward correction' effect (if enabled).-+swim upward coef = 0.2-+-+# Make the training skills proposed by a trainer based on its base attribute instead of its modified ones-+trainers training skills based on base skill = false-+-+# Make stealing items from NPCs that were knocked down possible during combat.-+always allow stealing from knocked out actors = false-+-+# Enables visually harvesting plants for models that support it.-+graphic herbalism = true-+-+# Give actors an ability to swim over water surface when they follow other actor independently from their ability to swim-+# (true, false)-+allow actors to follow over water surface = true-+-+# Default size of actor for navmesh generation-+default actor pathfind half extents = 29.27999496459961 28.479997634887695 66.5-+-+# Enables use of day/night switch nodes-+day night switches = true-+-+# Enables degradation of NPC's armor from unarmed creature attacks.-+unarmed creature attacks damage armor = false-+-+# Collision is used for both physics simulation and navigation mesh generation for pathfinding:-+# 0 = Axis-aligned bounding box-+# 1 = Rotating box-+# 2 = Cylinder-+actor collision shape type = 0-+-+# When false the player character will base movement on animations. This will sway the camera-+# while moving in third person like in vanilla, and reproduce movement bugs caused by glitchy-+# vanilla animations.-+player movement ignores animation = false-+-+[General]-+-+# Anisotropy reduces distortion in textures at low angles (e.g. 0 to 16).-+anisotropy = 4-+-+# File format for screenshots. (jpg, png, tga, and possibly more).-+screenshot format = png-+-+# Texture magnification filter type. (nearest or linear).-+texture mag filter = linear-+-+# Texture minification filter type. (nearest or linear).-+texture min filter = linear-+-+# Texture mipmap type. (none, nearest, or linear).-+texture mipmap = nearest-+-+# Show message box when screenshot is saved to a file.-+notify on saved screenshot = false-+-+# List of the preferred languages separated by comma.-+# For example "de,en" means German as the first prority and English as a fallback.-+preferred locales = en-+-+# If true then l10n/*/gmst.yaml has priority over other l10n files.-+gmst overrides l10n = true-+-+# Buffer size for the in-game log viewer (press F10 to toggle). Zero disables the log viewer.-+log buffer size = 65536-+-+# Number of console history objects to retrieve from previous session.-+console history buffer size = 4096-+-+[Shaders]-+-+# Force rendering with shaders. By default, only bump-mapped objects will use shaders.-+# Enabling this option may cause slightly different visuals if the "clamp lighting" option-+# is set to false. Otherwise, there should not be a visual difference.-+force shaders = false-+-+# Force the use of per pixel lighting. By default, only bump mapped objects use per-pixel lighting.-+# Has no effect if the 'force shaders' option is false.-+# Enabling per-pixel lighting can result in visual differences to the original MW engine as-+# certain lights in Morrowind rely on vertex lighting to look as intended.-+force per pixel lighting = false-+-+# Restrict the amount of lighting that an object can receive to a maximum of (1,1,1).-+# Only affects objects that render with shaders (see 'force shaders' option). Always affects terrain.-+# Setting this option to 'true' results in fixed-function compatible lighting, but the lighting-+# may appear 'dull' and there might be color shifts.-+# Setting this option to 'false' results in more realistic lighting.-+clamp lighting = true-+-+# If this option is enabled, normal maps are automatically recognized and used if they are named appropriately-+# (see 'normal map pattern', e.g. for a base texture foo.dds, the normal map texture would have to be named foo_n.dds).-+# If this option is disabled, normal maps are only used if they are explicitly listed within the mesh file (.nif or .osg file).-+# Affects objects.-+auto use object normal maps = false-+-+# If this option is enabled, specular maps are automatically recognized and used if they are named appropriately-+# (see 'specular map pattern', e.g. for a base texture foo.dds, the specular map texture would have to be named foo_spec.dds).-+# If this option is disabled, normal maps are only used if they are explicitly listed within the mesh file (.osg file, not supported in .nif files).-+# Affects objects.-+auto use object specular maps = false-+-+# See 'auto use object normal maps'. Affects terrain.-+auto use terrain normal maps = false-+-+# If a file with pattern 'terrain specular map pattern' exists, use that file as a 'diffuse specular' map. The texture-+# must contain the layer color in the RGB channel (as usual), and a specular multiplier in the alpha channel.-+auto use terrain specular maps = false-+-+# The filename pattern to probe for when detecting normal maps (see 'auto use object normal maps', 'auto use terrain normal maps')-+normal map pattern = _n-+-+# Alternative filename pattern to probe for when detecting normal maps. Files with this pattern are expected to include 'height' in the alpha channel.-+# This height is used for parallax effects. Works for both terrain and objects.-+normal height map pattern = _nh-+-+# The filename pattern to probe for when detecting object specular maps (see 'auto use object specular maps')-+specular map pattern = _spec-+-+# The filename pattern to probe for when detecting terrain specular maps (see 'auto use terrain specular maps')-+terrain specular map pattern = _diffusespec-+-+# Apply lighting to reflections on the environment-mapped objects like in Morrowind Code Patch.-+# Affected objects use shaders.-+apply lighting to environment maps = false-+-+# Internal handling of lights, ignored if 'force shaders' is off. "legacy"-+# provides fixed function pipeline emulation."shaders compatibility" (default)-+# uncaps the light limit, enables groundcover lighting, and uses a modified-+# attenuation formula to reduce popping and light seams. "shaders" comes with-+# all these benefits and is meant for larger light limits, but may not be-+# supported on older hardware and may be slower on weaker hardware when-+# 'force per pixel lighting' is enabled.-+lighting method = shaders compatibility-+-+# Sets the bounding sphere multiplier of light sources if 'lighting method' is-+# not 'legacy'. These are used to determine if an object should receive-+# lighting. Higher values will allow for smoother transitions of light sources,-+# but may carry a performance cost and requires a higher number of 'max lights'-+# set.-+light bounds multiplier = 1.65-+-+# The distance from the camera at which lights fade away completely.-+# Set to 0 to disable fading.-+maximum light distance = 8192-+-+# Fraction of the maximum distance at which lights begin to gradually fade away.-+light fade start = 0.85-+-+# Set maximum number of lights per object.-+# When 'lighting method' is set to 'legacy', this setting will have no effect.-+max lights = 8-+-+# Sets minimum ambient brightness of interior cells. Levels below this threshold will have their-+# ambient values adjusted to balance the darker interiors.-+# When 'lighting method' is set to 'legacy', this setting will have no effect.-+minimum interior brightness = 0.08-+-+# Convert the alpha test (cutout/punchthrough alpha) to alpha-to-coverage.-+# This allows MSAA to work with alpha-tested meshes, producing better-looking edges without pixelation.-+# When MSAA is off, this setting will have no visible effect, but might have a performance cost.-+antialias alpha test = false-+-+# Attempt to simulate coverage-preserving mipmaps in textures created without them which are used for alpha testing anyway.-+# This will somewhat mitigate these objects appearing to shrink as they get further from the camera, but isn't perfect.-+# Better results can be achieved by generating more appropriate mipmaps in the first place, but if this workaround is used with such textures, affected objects will appear to grow as they get further from the camera.-+# It is recommended that mod authors specify how this setting should be set, and mod users follow their advice.-+adjust coverage for alpha test = true-+-+# Soften intersection of blended particle systems with opaque geometry-+soft particles = false-+-+# Rain and snow particle occlusion-+weather particle occlusion = false-+-+weather particle occlusion small feature culling pixel size = 4.0-+-+[Input]-+-+# Capture control of the cursor prevent movement outside the window.-+grab cursor = true-+-+# Camera sensitivity when not in GUI mode. (>0.0, e.g. 0.1 to 5.0).-+camera sensitivity = 1.0-+-+# Vertical camera sensitivity multiplier when not in GUI mode.-+# (>0.0, Because it's a multiplier values should be near 1.0)-+camera y multiplier = 1.0-+-+# Invert the horizontal axis while not in GUI mode.-+invert x axis = false-+-+# Invert the vertical axis while not in GUI mode.-+invert y axis = false-+-+# Enable controller support.-+enable controller = true-+-+# Emulated gamepad cursor sensitivity.-+gamepad cursor speed = 1.0-+-+# Set dead zone for joysticks (gamepad or on-screen ones)-+joystick dead zone = 0.1-+-+# Enable gyroscope support.-+enable gyroscope = false-+-+# Gyroscope axis that corresponds to horizontal camera axis.-+gyro horizontal axis = -x-+-+# Gyroscope axis that corresponds to vertical camera axis.-+gyro vertical axis = y-+-+# The minimum gyroscope movement that is able to rotate the camera.-+gyro input threshold = 0-+-+# Horizontal camera axis sensitivity to gyroscope movement.-+gyro horizontal sensitivity = 1.0-+-+# Vertical camera axis sensitivity to gyroscope movement.-+gyro vertical sensitivity = 1.0-+-+[Saves]-+-+# Name of last character played, and default for loading save files.-+character =-+-+# Automatically save the game whenever the player rests.-+autosave = true-+-+# Display the time played on each save file in the load menu.-+timeplayed = false-+-+# The maximum number of quick (or auto) save slots to have.-+# If all slots are used, the oldest save is reused-+max quicksaves = 1-+-+[Sound]-+-+# Name of audio device file. Blank means use the default device.-+device =-+-+# Volumes are 0.0 for silent and 1.0 for the maximum volume.-+-+# Master volume. Controls all other volumes.-+master volume = 1.0-+-+# Footsteps volume.-+footsteps volume = 0.2-+-+# Music tracks volume.-+music volume = 0.5-+-+# Sound effects volume.-+sfx volume = 1.0-+-+# Voice dialog volume.-+voice volume = 0.8-+-+# Minimum size to use for the sound buffer cache, in MB. When the cache is-+# filled, old buffers will be unloaded until it's using no more than this much-+# memory. Must be less than or equal to 'buffer cache max'.-+buffer cache min = 56-+-+# Maximum size to use for the sound buffer cache, in MB. The cache can use up-+# to this much memory until old buffers get purged.-+buffer cache max = 64-+-+# Specifies whether to enable HRTF processing. Valid values are: -1 = auto,-+# 0 = off, 1 = on.-+hrtf enable = -1-+-+# Specifies which HRTF to use when HRTF is used. Blank means use the default.-+hrtf =-+-+# Specifies whether to use camera as audio listener-+camera listener = false-+-+[Video]-+-+# Resolution of the OpenMW window or screen.-+resolution x = 800-+resolution y = 600-+-+# Specify the window mode.-+# 0 = Fullscreen, 1 = Windowed Fullscreen, 2 = Windowed-+window mode = 2-+-+# Determines which screen OpenMW is on. (>=0).-+screen = 0-+-+# Minimize OpenMW if it loses cursor or keyboard focus.-+minimize on focus loss = true-+-+# An operating system border is drawn around the OpenMW window.-+window border = true-+-+# Anti-aliasing reduces jagged polygon edges. (>=0).-+antialiasing = 0-+-+# Vertical syncing to reduce tearing defects.-+# 0 = Off-+# 1 = On-+# 2 = Adaptive-+vsync mode = 0-+-+# Maximum frames per second. 0.0 is unlimited, or >0.0 to limit.-+framerate limit = 300-+-+# Game video contrast. (>0.0). No effect in Linux.-+contrast = 1.0-+-+# Video gamma setting. (>0.0). No effect in Linux.-+gamma = 1.0-+-+# Type of screenshot to take (regular, cylindrical, spherical, planet or cubemap), optionally followed by-+# screenshot width, height and cubemap resolution in pixels. (e.g. spherical 1600 1000 1200)-+screenshot type = regular-+-+[Water]-+-+# Enable water shader with reflections and optionally refraction.-+shader = false-+-+# Reflection and refraction texture size in pixels. (512, 1024, 2048).-+rtt size = 512-+-+# Enable refraction which affects visibility through water plane.-+refraction = false-+-+# Draw objects on water reflections.-+reflection detail = 2-+-+# Whether to use fully detailed raindrop ripples. (0, 1, 2).-+# 0 = rings only; 1 = sparse, high detail; 2 = dense, high detail-+rain ripple detail = 1-+-+# Overrides the value in '[Camera] small feature culling pixel size' specifically for water reflection/refraction textures.-+small feature culling pixel size = 20.0-+-+# By what factor water downscales objects. Only works with water shader and refractions on.-+refraction scale = 1.0-+-+[Windows]-+-+# Location and sizes of windows as a fraction of the OpenMW window or-+# screen size. (0.0 to 1.0). X & Y, Width & Height.-+-+# Stats window displaying level, race, class, skills and stats.-+stats x = 0.015-+stats y = 0.015-+stats w = 0.4275-+stats h = 0.45-+stats maximized x = 0.255-+stats maximized y = 0.275-+stats maximized w = 0.4275-+stats maximized h = 0.45-+stats pin = false-+stats hidden = false-+stats maximized = false-+-+# Spells window displaying powers, spells, and magical items.-+spells x = 0.63-+spells y = 0.39-+spells w = 0.36-+spells h = 0.51-+spells maximized x = 0.32-+spells maximized y = 0.02-+spells maximized w = 0.36-+spells maximized h = 0.88-+spells pin = false-+spells hidden = false-+spells maximized = false-+-+# Local and world map window.-+map x = 0.63-+map y = 0.015-+map w = 0.36-+map h = 0.37-+map maximized x = 0.015-+map maximized y = 0.02-+map maximized w = 0.97-+map maximized h = 0.875-+map pin = false-+map hidden = false-+map maximized = false-+-+# Player inventory window when explicitly opened.-+inventory x = 0.015-+inventory y = 0.54-+inventory w = 0.45-+inventory h = 0.38-+inventory maximized x = 0.015-+inventory maximized y = 0.02-+inventory maximized w = 0.97-+inventory maximized h = 0.875-+inventory pin = false-+inventory hidden = false-+inventory maximized = false-+-+# Player inventory window when searching a container.-+inventory container x = 0.015-+inventory container y = 0.54-+inventory container w = 0.45-+inventory container h = 0.38-+inventory container maximized x = 0.015-+inventory container maximized y = 0.02-+inventory container maximized w = 0.97-+inventory container maximized h = 0.875-+inventory container maximized = false-+-+# Player inventory window when bartering with a shopkeeper.-+inventory barter x = 0.015-+inventory barter y = 0.54-+inventory barter w = 0.45-+inventory barter h = 0.38-+inventory barter maximized x = 0.015-+inventory barter maximized y = 0.02-+inventory barter maximized w = 0.97-+inventory barter maximized h = 0.875-+inventory barter maximized = false-+-+# Player inventory window when trading with a companion.-+inventory companion x = 0.015-+inventory companion y = 0.54-+inventory companion w = 0.45-+inventory companion h = 0.38-+inventory companion maximized x = 0.015-+inventory companion maximized y = 0.02-+inventory companion maximized w = 0.97-+inventory companion maximized h = 0.875-+inventory companion maximized = false-+-+# Dialog window for talking with NPCs.-+dialogue x = 0.15-+dialogue y = 0.5-+dialogue w = 0.7-+dialogue h = 0.45-+dialogue maximized x = 0.015-+dialogue maximized y = 0.02-+dialogue maximized w = 0.97-+dialogue maximized h = 0.875-+dialogue maximized = false-+-+# Alchemy window for crafting potions.-+alchemy x = 0.25-+alchemy y = 0.25-+alchemy w = 0.5-+alchemy h = 0.5-+alchemy maximized x = 0.015-+alchemy maximized y = 0.02-+alchemy maximized w = 0.97-+alchemy maximized h = 0.875-+alchemy maximized = false-+-+# Console command window for debugging commands.-+console x = 0.255-+console y = 0.215-+console w = 0.49-+console h = 0.3125-+console maximized x = 0.015-+console maximized y = 0.02-+console maximized w = 0.97-+console maximized h = 0.875-+console maximized = false-+-+# Container inventory when searching a container.-+container x = 0.49-+container y = 0.54-+container w = 0.39-+container h = 0.38-+container maximized x = 0.015-+container maximized y = 0.02-+container maximized w = 0.97-+container maximized h = 0.875-+container maximized = false-+-+# NPC inventory window when bartering with a shopkeeper.-+barter x = 0.6-+barter y = 0.27-+barter w = 0.38-+barter h = 0.63-+barter maximized x = 0.015-+barter maximized y = 0.02-+barter maximized w = 0.97-+barter maximized h = 0.875-+barter maximized = false-+-+# NPC inventory window when trading with a companion.-+companion x = 0.6-+companion y = 0.27-+companion w = 0.38-+companion h = 0.63-+companion maximized x = 0.015-+companion maximized y = 0.02-+companion maximized w = 0.97-+companion maximized h = 0.875-+companion maximized = false-+-+# Settings menu-+settings x = 0.1-+settings y = 0.1-+settings w = 0.8-+settings h = 0.8-+settings maximized x = 0.015-+settings maximized y = 0.02-+settings maximized w = 0.97-+settings maximized h = 0.875-+settings maximized = false-+-+# Postprocessor configuration window for controlling shaders.-+postprocessor h = 0.95-+postprocessor w = 0.44-+postprocessor x = 0.01-+postprocessor y = 0.02-+postprocessor maximized x = 0.015-+postprocessor maximized y = 0.02-+postprocessor maximized w = 0.97-+postprocessor maximized h = 0.875-+postprocessor maximized = false-+-+# Debug window for viewing logs and profiling-+debug x = 0.70-+debug y = 0.00-+debug w = 0.30-+debug h = 1.00-+debug maximized x = 0.015-+debug maximized y = 0.02-+debug maximized w = 0.97-+debug maximized h = 0.875-+debug maximized = false-+-+[Navigator]-+-+# Enable navigator (true, false). When enabled background threads are started to build navmesh for world geometry.-+# Pathfinding system uses navmesh to build paths. When disabled only pathgrid is used to build paths.-+enable = true-+-+# Scale of NavMesh coordinates to world coordinates (value > 0.0). Recastnavigation builds voxels for world geometry.-+# Basically voxel size is 1 / "cell size". To reduce amount of voxels we apply scale factor, to make voxel size-+# "recast scale factor" / "cell size". Default value calculates by this equation:-+# sStepSizeUp * "recast scale factor" / "cell size" = 5 (max climb height should be equal to 4 voxels)-+recast scale factor = 0.029411764705882353-+-+# The z-axis cell size to use for fields. (value > 0.0)-+# Defines voxel/grid/cell size. So their values have significant-+# side effects on all parameters defined in voxel units.-+# The minimum value for this parameter depends on the platform's floating point-+# accuracy, with the practical minimum usually around 0.05.-+# Same default value is used in RecastDemo.-+cell height = 0.2-+-+# The xy-plane cell size to use for fields. (value > 0.0)-+# Defines voxel/grid/cell size. So their values have significant-+# side effects on all parameters defined in voxel units.-+# The minimum value for this parameter depends on the platform's floating point-+# accuracy, with the practical minimum usually around 0.05.-+# Same default value is used in RecastDemo.-+cell size = 0.2-+-+# Sets the sampling distance to use when generating the detail mesh. (value = 0.0 or value >= 0.9)-+detail sample dist = 6.0-+-+# The maximum distance the detail mesh surface should deviate from heightfield data. (value >= 0.0)-+detail sample max error = 1.0-+-+# The maximum distance a simplfied contour's border edges should deviate the original raw contour. (value >= 0.0)-+max simplification error = 1.3-+-+# The width and height of each tile. (value > 0)-+tile size = 128-+-+# The size of the non-navigable border around the heightfield. (value >= 0)-+border size = 16-+-+# The maximum allowed length for contour edges along the border of the mesh. (value >= 0)-+max edge len = 12-+-+# Maximum number of search nodes. (0 < value <= 65535)-+max nav mesh query nodes = 2048-+-+# Maximum number of polygons per navmesh tile (value = 2^n, 0 < n < 22). Maximum number of navmesh tiles depends on-+# this value. 22 bits is a limit to store both tile identifier and polygon identifier (tiles = 2^(22 - log2(polygons))).-+# See recastnavigation for more details.-+max polygons per tile = 4096-+-+# The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. (value >= 3)-+max verts per poly = 6-+-+# Any regions with a span count smaller than this value will, if possible, be merged with larger regions. (value >= 0)-+region merge area = 400-+-+# The minimum number of cells allowed to form isolated island areas. (value >= 0)-+region min area = 64-+-+# Number of background threads to update nav mesh (value >= 1)-+async nav mesh updater threads = 1-+-+# Maximum total cached size of all nav mesh tiles in bytes (value >= 0)-+max nav mesh tiles cache size = 268435456-+-+# Maximum size of path over polygons (value > 0)-+max polygon path size = 1024-+-+# Maximum size of smoothed path (value > 0)-+max smooth path size = 1024-+-+# Write recast mesh to file in .obj format for each use to update nav mesh (true, false)-+enable write recast mesh to file = false-+-+# Write NavMesh to file to be able to open by RecastDemo (true, false)-+enable write nav mesh to file = false-+-+# Write each recast mesh file with revision in name. Otherwise will rewrite same file. (true, false)-+enable recast mesh file name revision = false-+-+# Write each nav mesh file with revision in name. Otherwise will rewrite same file. (true, false)-+enable nav mesh file name revision = false-+-+# Write recast mesh file at path with this prefix-+recast mesh path prefix =-+-+# Write nav mesh file at path with this prefix-+nav mesh path prefix =-+-+# Render nav mesh (true, false)-+enable nav mesh render = false-+-+# Navigation mesh rendering mode (default, update frequency)-+nav mesh render mode = area type-+-+# Render agents paths (true, false)-+enable agents paths render = false-+-+# Render recast mesh (true, false)-+enable recast mesh render = false-+-+# Max number of navmesh tiles (value >= 0)-+max tiles number = 512-+-+# Min time duration for the same tile update in milliseconds (value >= 0)-+min update interval ms = 250-+-+# Keep loading screen until navmesh is generated around the player for all tiles within manhattan distance (value >= 0).-+# Distance is measured in the number of tiles and can be only an integer value.-+wait until min distance to player = 5-+-+# Use navigation mesh cache stored on disk (true, false)-+enable nav mesh disk cache = true-+-+# Cache navigation mesh tiles to disk (true, false)-+write to navmeshdb = true-+-+# Approximate maximum file size of navigation mesh cache stored on disk in bytes (value > 0)-+max navmeshdb file size = 2147483648-+-+[Shadows]-+-+# Enable or disable shadows. Bear in mind that this will force OpenMW to use shaders as if "[Shaders]/force shaders" was set to true.-+enable shadows = false-+-+# How many shadow maps to use - more of these means each shadow map texel covers less area, producing better looking shadows, but may decrease performance.-+number of shadow maps = 3-+-+# The distance from the camera at which shadows fade away completely. Set to 0 to make the distance infinite.-+maximum shadow map distance = 8192-+-+# Fraction of the maximum distance at which shadows begin to gradually fade away.-+shadow fade start = 0.9-+-+# If true, allow shadow maps to overlap. Counter-intuitively, will produce better results when the light is behind the camera. When enabled, OpenMW uses Cascaded Shadow Maps and when disabled, it uses Parallel Split Shadow Maps.-+allow shadow map overlap = true-+-+# Indirectly controls where to split the shadow map(s). Values closer to 1.0 bring more detail closer to the camera (potentially excessively so), and values closer to 0.0 spread it more evenly across the whole viewing distance. 0.5 is recommended for most viewing distances by the original Parallel Split Shadow Maps paper, but this does not take into account use of a Light Space Perspective transformation, so other values may be preferable. If some of the terms used here go over your head, you might not want to change this, especially not without reading the associated papers first. When "allow shadow map overlap" is combined with a higher-than-default viewing distance, values closer to 1.0 will prevent nearby shadows losing a lot of quality.-+split point uniform logarithmic ratio = 0.5-+-+# Indirectly controls where to split the shadow map(s). Positive values move split points away from the camera and negative values move them towards the camera. Intended to be used in conjunction with changes to 'split point uniform logarithmic ratio' to counteract side effects, but may cause additional, more serious side effects. Read the Parallel Split Shadow Maps paper by F Zhang et al before changing.-+split point bias = 0.0-+-+# Enable the debug hud to see what the shadow map(s) contain.-+enable debug hud = false-+-+# Enable the debug overlay to see where each shadow map affects.-+enable debug overlay = false-+-+# Used to set the type of tight scene bound calculation method to be used by the shadow map that covers a smaller area. "bounds" (default) is less precise shadows but better performance or "primitives" for more precise shadows at expense of CPU.-+compute scene bounds = bounds-+-+# How large to make the shadow map(s). Higher values increase GPU load, but can produce better-looking results. Power-of-two values may turn out to be faster on some GPU/driver combinations.-+shadow map resolution = 1024-+-+# Controls the minimum near/far ratio for the Light Space Perspective Shadow Map transformation. Helps prevent too much detail being brought towards the camera at the expense of detail further from the camera. Increasing this pushes detail further away.-+minimum lispsm near far ratio = 0.25-+-+# Used as the factor parameter for the polygon offset used for shadow map rendering. Higher values reduce shadow flicker, but risk increasing Peter Panning. See https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glPolygonOffset.xhtml for details.-+polygon offset factor = 1.1-+-+# Used as the units parameter for the polygon offset used for shadow map rendering. Higher values reduce shadow flicker, but risk increasing Peter Panning. See https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glPolygonOffset.xhtml for details.-+polygon offset units = 4.0-+-+# How far along the surface normal to project shadow coordinates. Higher values significantly reduce shadow flicker, usually with a lower increase of Peter Panning than the Polygon Offset settings. This value is in in-game units, so 1.0 is roughly 1.4 cm.-+normal offset distance = 1.0-+-+# Excludes theoretically unnecessary faces from shadow maps, slightly increasing performance. In practice, Peter Panning can be much less visible with these faces included, so if you have high polygon offset values, leave this off to minimise the side effects.-+use front face culling = false-+-+# Allow actors to cast shadows. Potentially decreases performance.-+actor shadows = false-+-+# Allow the player to cast shadows. Potentially decreases performance.-+player shadows = false-+-+# Allow terrain to cast shadows. Potentially decreases performance.-+terrain shadows = false-+-+# Allow world objects to cast shadows. Potentially decreases performance.-+object shadows = false-+-+# Allow shadows indoors. Due to limitations with Morrowind's data, only actors can cast shadows indoors, which some might feel is distracting.-+enable indoor shadows = true-+-+[Physics]-+# Set the number of background threads used for physics.-+# If no background threads are used, physics calculations are processed in the main thread-+# and the settings below have no effect.-+async num threads = 1-+-+# Set the number of frames an inactive line-of-sight request will be kept-+# refreshed in the background physics thread cache.-+lineofsight keep inactive cache = 0-+-+[Models]-+-+# Attempt to load any valid NIF file regardless of its version and track the progress.-+# Loading arbitrary meshes is not advised and may cause instability.-+load unsupported nif files = false-+-+# 3rd person base animation model that looks also for the corresponding kf-file-+xbaseanim = meshes/xbase_anim.nif-+-+# 3rd person base model with textkeys-data-+baseanim = meshes/base_anim.nif-+-+# 1st person base animation model that looks also for corresponding kf-file-+xbaseanim1st = meshes/xbase_anim.1st.nif-+-+# 3rd person beast race base model with textkeys-data-+baseanimkna = meshes/base_animkna.nif-+-+# 1st person beast race base animation model-+baseanimkna1st = meshes/base_animkna.1st.nif-+-+# 3rd person female base animation model-+xbaseanimfemale = meshes/xbase_anim_female.nif-+-+# 3rd person female base model with textkeys-data-+baseanimfemale = meshes/base_anim_female.nif-+-+# 1st person female base model with textkeys-data-+baseanimfemale1st = meshes/base_anim_female.1st.nif-+-+# 3rd person werewolf skin-+wolfskin = meshes/wolf/skin.nif-+-+# 1st person werewolf skin-+wolfskin1st = meshes/wolf/skin.1st.nif-+-+# Argonian smimkna-+xargonianswimkna = meshes/xargonian_swimkna.nif-+-+# File to load xbaseanim 3rd person animations-+xbaseanimkf = meshes/xbase_anim.kf-+-+# File to load xbaseanim 3rd person animations-+xbaseanim1stkf = meshes/xbase_anim.1st.kf-+-+# File to load xbaseanim animations from-+xbaseanimfemalekf = meshes/xbase_anim_female.kf-+-+# File to load xargonianswimkna animations from-+xargonianswimknakf = meshes/xargonian_swimkna.kf-+-+# Sky atmosphere mesh-+skyatmosphere = meshes/sky_atmosphere.nif-+-+# Sky clouds mesh-+skyclouds = meshes/sky_clouds_01.nif-+-+# Sky stars mesh 01-+skynight01 = meshes/sky_night_01.nif-+-+# Sky stars mesh 02-+skynight02 = meshes/sky_night_02.nif-+-+# Ash clouds weather effect-+weatherashcloud = meshes/ashcloud.nif-+-+# Blight clouds weather effect-+weatherblightcloud = meshes/blightcloud.nif-+-+# Snow falling weather effect-+weathersnow = meshes/snow.nif-+-+# Blizzard weather effect-+weatherblizzard = meshes/blizzard.nif-+-+# Enable to write logs when loading NIF files-+write nif debug log = false-+-+[Groundcover]-+-+# enable separate groundcover handling-+enabled = false-+-+# A groundcover density (0.0 <= value <= 1.0)-+# 1.0 means 100% density-+density = 1.0-+-+# A maximum distance in game units on which groundcover is rendered.-+rendering distance = 6144.0-+-+# Whether grass should respond to the player treading on it.-+# 0 - Grass cannot be trampled.-+# 1 - The player's XY position is taken into account.-+# 2 - The player's height above the ground is taken into account, too.-+stomp mode = 2-+-+# How far away from the player grass can be before it's unaffected by being trod on, and how far it moves when it is.-+# 2 - MGE XE levels. Generally excessive, but what existing mods were made with in mind-+# 1 - Reduced levels.-+# 0 - Gentle levels.-+stomp intensity = 1-+-+[Lua]-+-+# Enable performance-heavy debug features-+lua debug = false-+-+# Set the maximum number of threads used for Lua scripts.-+# If zero, Lua scripts are processed in the main thread.-+lua num threads = 1-+-+# Enable Lua profiler-+lua profiler = true-+-+# No ownership tracking for allocations below or equal this size.-+small alloc max size = 1024-+-+# Memory limit for Lua runtime (only if lua profiler = true). If exceeded then only small allocations are allowed.-+# Small allocations are always allowed, so e.g. Lua console can function. Default value is 2GB.-+memory limit = 2147483648-+-+# Print debug info about memory usage (only if lua profiler = true).-+log memory usage = false-+-+# The maximal number of Lua instructions per function call (only if lua profiler = true).-+# If exceeded (e.g. because of an infinite loop) the function will be terminated.-+instruction limit per call = 100000000-+-+# Lua garbage collector steps per frame.-+gc steps per frame = 100-+-+[Stereo]-+# Enable/disable stereo view. This setting is ignored in VR.-+stereo enabled = false-+-+# If enabled, OpenMW will use the GL_OVR_MultiView and GL_OVR_MultiView2 extensions where possible.-+multiview = false-+-+# May accelerate the BruteForce method when shadows are enabled-+shared shadow maps = true-+-+# If false, OpenMW-VR will disable display lists when using multiview. Necessary on some buggy drivers, but may incur a slight performance penalty.-+allow display lists for multiview = false-+-+# If false, the default OSG horizontal split will be used for stereo-+# If true, the config defined in the [Stereo View] settings category will be used-+# Note: This option is ignored in VR, and exists primarily for debugging purposes-+use custom view = false-+-+# If true, overrides rendering resolution for each eye.-+# Note: This option is ignored in VR, and exists primarily for debugging purposes-+use custom eye resolution = false-+-+[Stereo View]-+# The default values are based on an HP Reverb G2 HMD-+eye resolution x = 3128-+eye resolution y = 3060-+-+# Left eye offset from center, expressed in MW units (1 meter = ~70)-+left eye offset x = -2.35-+left eye offset y = 0.0-+left eye offset z = 0.0-+# Left eye orientation, expressed as a quaternion-+left eye orientation x = 0.0-+left eye orientation y = 0.0-+left eye orientation z = 0.0-+left eye orientation w = 1.0-+# Left eye field of view, expressed in radians-+left eye fov left = -0.86-+left eye fov right = 0.78-+left eye fov up = 0.8-+left eye fov down = -0.8-+-+# Left eye offset from center, expressed in MW units (1 meter = ~70)-+right eye offset x = 2.35-+right eye offset y = 0.0-+right eye offset z = 0.0-+# Left eye orientation, expressed as a quaternion-+right eye orientation x = 0.0-+right eye orientation y = 0.0-+right eye orientation z = 0.0-+right eye orientation w = 1.0-+# Left eye field of view-+right eye fov left = -0.78-+right eye fov right = 0.86-+right eye fov up = 0.8-+right eye fov down = -0.8-+-+[Post Processing]-+-+# Enables post-processing-+enabled = false-+-+# List of active shaders. This is more easily with the in-game shader HUD, by default accessible with the F2 key.-+chain =-+-+# Used for eye adaptation to control speed at which scene luminance can change from one frame to the next. No effect when HDR is not being utilized.-+auto exposure speed = 0.9-+-+# Transparent depth postpass. Re-renders transparent objects with alpha-clipping forced with a fixed threshold.-+transparent postpass = true-diff --git a/files/shaders/CMakeLists.txt b/files/shaders/CMakeLists.txt-index ca0c264ade7..20f4263b9ff 100644---- a/files/shaders/CMakeLists.txt-+++ b/files/shaders/CMakeLists.txt-@@ -9,6 +9,7 @@ set(DDIRRELATIVE resources/shaders)- set(SHADER_FILES- lib/water/fresnel.glsl- lib/water/rain_ripples.glsl-+ lib/water/rain_ripples_old.glsl- lib/water/ripples.glsl- lib/view/depth.glsl- lib/luminance/constants.glsl-diff --git a/files/shaders/compatibility/bs/default.frag b/files/shaders/compatibility/bs/default.frag-old mode 100644-new mode 100755-index 77131c6a52c..ec5f5c89780---- a/files/shaders/compatibility/bs/default.frag-+++ b/files/shaders/compatibility/bs/default.frag-@@ -80,7 +80,7 @@ void main()- vec3 viewNormal = normalToView(normalTex.xyz * 2.0 - 1.0);- specularColor *= normalTex.a;- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- float shadowing = unshadowedLightRatio(linearDepth);-diff --git a/files/shaders/compatibility/bs/default.vert b/files/shaders/compatibility/bs/default.vert-old mode 100644-new mode 100755-index 21942ec91e8..d9d47843c09---- a/files/shaders/compatibility/bs/default.vert-+++ b/files/shaders/compatibility/bs/default.vert-@@ -69,7 +69,7 @@ void main(void)--- #if @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- setupShadowCoords(viewPos, viewNormal);- #endif- }-diff --git a/files/shaders/compatibility/bs/nolighting.frag b/files/shaders/compatibility/bs/nolighting.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/bs/nolighting.vert b/files/shaders/compatibility/bs/nolighting.vert-old mode 100644-new mode 100755-index 57cedc6e948..3b0fa7b6261---- a/files/shaders/compatibility/bs/nolighting.vert-+++ b/files/shaders/compatibility/bs/nolighting.vert-@@ -63,7 +63,7 @@ void main(void)- }-- #if @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalize((gl_NormalMatrix * gl_Normal).xyz);- setupShadowCoords(viewPos, viewNormal);- #endif- }-diff --git a/files/shaders/compatibility/debug.frag b/files/shaders/compatibility/debug.frag-old mode 100644-new mode 100755-index a92b406d46b..041562fc0e2---- a/files/shaders/compatibility/debug.frag-+++ b/files/shaders/compatibility/debug.frag-@@ -4,7 +4,7 @@-- varying vec3 vertexNormal;---uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- void main()- {-diff --git a/files/shaders/compatibility/debug.vert b/files/shaders/compatibility/debug.vert-old mode 100644-new mode 100755-index 47d5337a66f..a1fa462f397---- a/files/shaders/compatibility/debug.vert-+++ b/files/shaders/compatibility/debug.vert-@@ -6,7 +6,7 @@ uniform vec3 color;- uniform vec3 trans;- uniform vec3 scale;- uniform bool useNormalAsColor;--uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- centroid varying vec4 passColor;- varying vec3 vertexNormal;-diff --git a/files/shaders/compatibility/depthclipped.frag b/files/shaders/compatibility/depthclipped.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/depthclipped.vert b/files/shaders/compatibility/depthclipped.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/fog.glsl b/files/shaders/compatibility/fog.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/fullscreen_tri.frag b/files/shaders/compatibility/fullscreen_tri.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/fullscreen_tri.vert b/files/shaders/compatibility/fullscreen_tri.vert-old mode 100644-new mode 100755-index 3174384212e..8510a0933c1---- a/files/shaders/compatibility/fullscreen_tri.vert-+++ b/files/shaders/compatibility/fullscreen_tri.vert-@@ -1,6 +1,6 @@- #version 120---uniform vec2 scaling = vec2(1.0, 1.0);-+uniform vec2 scaling;// = vec2(1.0, 1.0);-- varying vec2 uv;--diff --git a/files/shaders/compatibility/groundcover.frag b/files/shaders/compatibility/groundcover.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/groundcover.vert b/files/shaders/compatibility/groundcover.vert-old mode 100644-new mode 100755-index 8cf53a19e05..95a17b50849---- a/files/shaders/compatibility/groundcover.vert-+++ b/files/shaders/compatibility/groundcover.vert-@@ -156,7 +156,7 @@ void main(void)- #endif-- #if (!PER_PIXEL_LIGHTING || @shadows_enabled)-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if @diffuseMap-diff --git a/files/shaders/compatibility/gui.frag b/files/shaders/compatibility/gui.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/gui.vert b/files/shaders/compatibility/gui.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/luminance/luminance.frag b/files/shaders/compatibility/luminance/luminance.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/luminance/resolve.frag b/files/shaders/compatibility/luminance/resolve.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/multiview_resolve.frag b/files/shaders/compatibility/multiview_resolve.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/multiview_resolve.vert b/files/shaders/compatibility/multiview_resolve.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/normals.glsl b/files/shaders/compatibility/normals.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/objects.frag b/files/shaders/compatibility/objects.frag-old mode 100644-new mode 100755-index 56c7abf27c7..563929473cc---- a/files/shaders/compatibility/objects.frag-+++ b/files/shaders/compatibility/objects.frag-@@ -84,11 +84,11 @@ varying vec3 passNormal;- #if @normalMap || @diffuseParallax- varying vec4 passTangent;- #endif---+/*- #if @additiveBlending- #define ADDITIVE_BLENDING- #endif---+*/- #include "lib/light/lighting.glsl"- #include "lib/material/parallax.glsl"- #include "lib/material/alpha.glsl"-@@ -109,11 +109,11 @@ uniform float softFalloffDepth;-- #if @particleOcclusion- #include "lib/particle/occlusion.glsl"--uniform sampler2D orthoDepthMap;-+uniform highp sampler2D orthoDepthMap;- varying vec3 orthoDepthMapCoord;- #endif---uniform sampler2D opaqueDepthTex;-+uniform highp sampler2D opaqueDepthTex;-- void main()- {-diff --git a/files/shaders/compatibility/objects.vert b/files/shaders/compatibility/objects.vert-old mode 100644-new mode 100755-index 081ff909cf0..2bebcd60bf2---- a/files/shaders/compatibility/objects.vert-+++ b/files/shaders/compatibility/objects.vert-@@ -101,7 +101,7 @@ void main(void)- #endif-- #if @envMap || !PER_PIXEL_LIGHTING || @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if @envMap-diff --git a/files/shaders/compatibility/ripples_blobber.frag b/files/shaders/compatibility/ripples_blobber.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/ripples_simulate.frag b/files/shaders/compatibility/ripples_simulate.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/s360.frag b/files/shaders/compatibility/s360.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/s360.vert b/files/shaders/compatibility/s360.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/shadowcasting.frag b/files/shaders/compatibility/shadowcasting.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/shadowcasting.vert b/files/shaders/compatibility/shadowcasting.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/shadows_fragment.glsl b/files/shaders/compatibility/shadows_fragment.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/shadows_vertex.glsl b/files/shaders/compatibility/shadows_vertex.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/sky.frag b/files/shaders/compatibility/sky.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/sky.vert b/files/shaders/compatibility/sky.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/terrain.frag b/files/shaders/compatibility/terrain.frag-old mode 100644-new mode 100755-index abc7425eb05..38b985223e4---- a/files/shaders/compatibility/terrain.frag-+++ b/files/shaders/compatibility/terrain.frag-@@ -65,7 +65,7 @@ void main()- #if @normalMap- vec3 viewNormal = normalToView(texture2D(normalMap, adjustedUV).xyz * 2.0 - 1.0);- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- float shadowing = unshadowedLightRatio(linearDepth);-diff --git a/files/shaders/compatibility/terrain.vert b/files/shaders/compatibility/terrain.vert-old mode 100644-new mode 100755-index cbfb7769ba5..3b2cb16db49---- a/files/shaders/compatibility/terrain.vert-+++ b/files/shaders/compatibility/terrain.vert-@@ -52,7 +52,7 @@ void main(void)- #endif-- #if !PER_PIXEL_LIGHTING || @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if !PER_PIXEL_LIGHTING-diff --git a/files/shaders/compatibility/vertexcolors.glsl b/files/shaders/compatibility/vertexcolors.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/water.frag b/files/shaders/compatibility/water.frag-old mode 100644-new mode 100755-index c971f92b997..4b275575f34---- a/files/shaders/compatibility/water.frag-+++ b/files/shaders/compatibility/water.frag-@@ -17,8 +17,6 @@- // tweakables -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ---- const float VISIBILITY = 2500.0;--const float VISIBILITY_DEPTH = VISIBILITY * 1.5;--const float DEPTH_FADE = 0.15;-- const float BIG_WAVES_X = 0.1; // strength of big waves- const float BIG_WAVES_Y = 0.1;-@@ -50,7 +48,6 @@ const float SUN_SPEC_FADING_THRESHOLD = 0.15; // visibility at which sun s- const float SPEC_HARDNESS = 256.0; // specular highlights hardness-- const float BUMP_SUPPRESS_DEPTH = 300.0; // at what water depth bumpmap will be suppressed for reflections and refractions (prevents artifacts at shores)--const float REFR_FOG_DISTORT_DISTANCE = 3000.0; // at what distance refraction fog will be calculated using real water depth instead of distorted depth (prevents splotchy shores)-- const vec2 WIND_DIR = vec2(0.5f, -0.8f);- const float WIND_SPEED = 0.2f;-@@ -94,7 +91,11 @@ uniform vec2 screenRes;- #include "lib/light/lighting.glsl"- #include "fog.glsl"- #include "lib/water/fresnel.glsl"--#include "lib/water/rain_ripples.glsl"-+#if @shader_ripples-+ #include "lib/water/rain_ripples.glsl"-+#else-+ #include "lib/water/rain_ripples_old.glsl"-+#endif- #include "lib/view/depth.glsl"-- void main(void)-@@ -124,11 +125,13 @@ void main(void)-- vec3 rippleAdd = rainRipple.xyz * 10.0;--+#if @shader_ripples- float distToCenter = length(rippleMapUV - vec2(0.5));- float blendClose = smoothstep(0.001, 0.02, distToCenter);- float blendFar = 1.0 - smoothstep(0.3, 0.4, distToCenter);- float distortionLevel = 2.0;- rippleAdd += distortionLevel * vec3(texture2D(rippleMap, rippleMapUV).ba * blendFar * blendClose, 0.0);-+#endif-- vec2 bigWaves = vec2(BIG_WAVES_X,BIG_WAVES_Y);- vec2 midWaves = mix(vec2(MID_WAVES_X,MID_WAVES_Y),vec2(MID_WAVES_RAIN_X,MID_WAVES_RAIN_Y),rainIntensity);-@@ -163,10 +166,9 @@ void main(void)- vec2 screenCoordsOffset = normal.xy * REFL_BUMP;- #if REFRACTION- float depthSample = linearizeDepth(sampleRefractionDepthMap(screenCoords), near, far) * radialise;-+ float depthSampleDistorted = linearizeDepth(sampleRefractionDepthMap(screenCoords-screenCoordsOffset), near, far) * radialise;- float surfaceDepth = linearizeDepth(gl_FragCoord.z, near, far) * radialise;- float realWaterDepth = depthSample - surfaceDepth; // undistorted water depth in view direction, independent of frustum-- float depthSampleDistorted = linearizeDepth(sampleRefractionDepthMap(screenCoords - screenCoordsOffset), near, far) * radialise;-- float waterDepthDistorted = max(depthSampleDistorted - surfaceDepth, 0.0);- screenCoordsOffset *= clamp(realWaterDepth / BUMP_SUPPRESS_DEPTH,0,1);- #endif- // reflection-@@ -189,16 +191,6 @@ void main(void)- // no alpha here, so make sure raindrop ripple specularity gets properly subdued- rainSpecular *= clamp(fresnel*6.0 + specular * sunSpec.a, 0.0, 1.0);--- // selectively nullify screenCoordsOffset to eliminate remaining shore artifacts, not needed for reflection-- if (cameraPos.z > 0.0 && realWaterDepth <= VISIBILITY_DEPTH && waterDepthDistorted > VISIBILITY_DEPTH)-- screenCoordsOffset = vec2(0.0);---- depthSampleDistorted = linearizeDepth(sampleRefractionDepthMap(screenCoords - screenCoordsOffset), near, far) * radialise;-- waterDepthDistorted = max(depthSampleDistorted - surfaceDepth, 0.0);---- // fade to realWaterDepth at a distance to compensate for physically inaccurate depth calculation-- waterDepthDistorted = mix(waterDepthDistorted, realWaterDepth, min(surfaceDepth / REFR_FOG_DISTORT_DISTANCE, 1.0));--- // refraction- vec3 refraction = sampleRefractionMap(screenCoords - screenCoordsOffset).rgb;- vec3 rawRefraction = refraction;-@@ -207,11 +199,7 @@ void main(void)- if (cameraPos.z < 0.0)- refraction = clamp(refraction * 1.5, 0.0, 1.0);- else-- {-- float depthCorrection = sqrt(1.0 + 4.0 * DEPTH_FADE * DEPTH_FADE);-- float factor = DEPTH_FADE * DEPTH_FADE / (-0.5 * depthCorrection + 0.5 - waterDepthDistorted / VISIBILITY) + 0.5 * depthCorrection + 0.5;-- refraction = mix(refraction, waterColor, clamp(factor, 0.0, 1.0));-- }-+ refraction = mix(refraction, waterColor, clamp(depthSampleDistorted/VISIBILITY, 0.0, 1.0));-- // sunlight scattering- // normal for sunlight scattering-diff --git a/files/shaders/compatibility/water.frag.orig b/files/shaders/compatibility/water.frag.orig-new file mode 100755-index 00000000000..4ac640d37ee---- /dev/null-+++ b/files/shaders/compatibility/water.frag.orig-@@ -0,0 +1,255 @@-+#version 120-+-+#if @useUBO-+ #extension GL_ARB_uniform_buffer_object : require-+#endif-+-+#if @useGPUShader4-+ #extension GL_EXT_gpu_shader4: require-+#endif-+-+#include "lib/core/fragment.h.glsl"-+-+#define REFRACTION @refraction_enabled-+-+// Inspired by Blender GLSL Water by martinsh ( https://devlog-martinsh.blogspot.de/2012/07/waterundewater-shader-wip.html )-+-+// tweakables -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ---+-+const float VISIBILITY = 2500.0;-+const float VISIBILITY_DEPTH = VISIBILITY * 1.5;-+const float DEPTH_FADE = 0.15;-+-+const float BIG_WAVES_X = 0.1; // strength of big waves-+const float BIG_WAVES_Y = 0.1;-+-+const float MID_WAVES_X = 0.1; // strength of middle sized waves-+const float MID_WAVES_Y = 0.1;-+const float MID_WAVES_RAIN_X = 0.2;-+const float MID_WAVES_RAIN_Y = 0.2;-+-+const float SMALL_WAVES_X = 0.1; // strength of small waves-+const float SMALL_WAVES_Y = 0.1;-+const float SMALL_WAVES_RAIN_X = 0.3;-+const float SMALL_WAVES_RAIN_Y = 0.3;-+-+const float WAVE_CHOPPYNESS = 0.05; // wave choppyness-+const float WAVE_SCALE = 75.0; // overall wave scale-+-+const float BUMP = 0.5; // overall water surface bumpiness-+const float BUMP_RAIN = 2.5;-+const float REFL_BUMP = 0.10; // reflection distortion amount-+const float REFR_BUMP = 0.07; // refraction distortion amount-+-+const float SCATTER_AMOUNT = 0.3; // amount of sunlight scattering-+const vec3 SCATTER_COLOUR = vec3(0.0,1.0,0.95); // colour of sunlight scattering-+-+const vec3 SUN_EXT = vec3(0.45, 0.55, 0.68); //sunlight extinction-+const float SUN_SPEC_FADING_THRESHOLD = 0.15; // visibility at which sun specularity starts to fade-+-+const float SPEC_HARDNESS = 256.0; // specular highlights hardness-+-+const float BUMP_SUPPRESS_DEPTH = 300.0; // at what water depth bumpmap will be suppressed for reflections and refractions (prevents artifacts at shores)-+const float REFR_FOG_DISTORT_DISTANCE = 3000.0; // at what distance refraction fog will be calculated using real water depth instead of distorted depth (prevents splotchy shores)-+-+const vec2 WIND_DIR = vec2(0.5f, -0.8f);-+const float WIND_SPEED = 0.2f;-+-+const vec3 WATER_COLOR = vec3(0.090195, 0.115685, 0.12745);-+-+const float WOBBLY_SHORE_FADE_DISTANCE = 6200.0; // fade out wobbly shores to mask precision errors, the effect is almost impossible to see at a distance-+-+// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --+-+vec2 normalCoords(vec2 uv, float scale, float speed, float time, float timer1, float timer2, vec3 previousNormal)-+{-+ return uv * (WAVE_SCALE * scale) + WIND_DIR * time * (WIND_SPEED * speed) -(previousNormal.xy/previousNormal.zz) * WAVE_CHOPPYNESS + vec2(time * timer1,time * timer2);-+}-+-+uniform sampler2D rippleMap;-+uniform vec3 playerPos;-+-+varying vec3 worldPos;-+-+varying vec2 rippleMapUV;-+-+varying vec4 position;-+varying float linearDepth;-+-+uniform sampler2D normalMap;-+-+uniform float osg_SimulationTime;-+-+uniform float near;-+uniform float far;-+-+uniform float rainIntensity;-+uniform bool enableRainRipples;-+-+uniform vec2 screenRes;-+-+#define PER_PIXEL_LIGHTING 0-+-+#include "shadows_fragment.glsl"-+#include "lib/light/lighting.glsl"-+#include "fog.glsl"-+#include "lib/water/fresnel.glsl"-+#if @shader_ripples-+ #include "lib/water/rain_ripples.glsl"-+#else-+ #include "lib/water/rain_ripples_old.glsl"-+#endif-+#include "lib/view/depth.glsl"-+-+void main(void)-+{-+ vec2 UV = worldPos.xy / (8192.0*5.0) * 3.0;-+ UV.y *= -1.0;-+-+ float shadow = unshadowedLightRatio(linearDepth);-+-+ vec2 screenCoords = gl_FragCoord.xy / screenRes;-+-+ #define waterTimer osg_SimulationTime-+-+ vec3 normal0 = 2.0 * texture2D(normalMap,normalCoords(UV, 0.05, 0.04, waterTimer, -0.015, -0.005, vec3(0.0,0.0,0.0))).rgb - 1.0;-+ vec3 normal1 = 2.0 * texture2D(normalMap,normalCoords(UV, 0.1, 0.08, waterTimer, 0.02, 0.015, normal0)).rgb - 1.0;-+ vec3 normal2 = 2.0 * texture2D(normalMap,normalCoords(UV, 0.25, 0.07, waterTimer, -0.04, -0.03, normal1)).rgb - 1.0;-+ vec3 normal3 = 2.0 * texture2D(normalMap,normalCoords(UV, 0.5, 0.09, waterTimer, 0.03, 0.04, normal2)).rgb - 1.0;-+ vec3 normal4 = 2.0 * texture2D(normalMap,normalCoords(UV, 1.0, 0.4, waterTimer, -0.02, 0.1, normal3)).rgb - 1.0;-+ vec3 normal5 = 2.0 * texture2D(normalMap,normalCoords(UV, 2.0, 0.7, waterTimer, 0.1, -0.06, normal4)).rgb - 1.0;-+-+ vec4 rainRipple;-+-+ if (rainIntensity > 0.01 && enableRainRipples)-+ rainRipple = rainCombined(position.xy/1000.0, waterTimer) * clamp(rainIntensity, 0.0, 1.0);-+ else-+ rainRipple = vec4(0.0);-+-+ vec3 rippleAdd = rainRipple.xyz * 10.0;-+-+#if @shader_ripples-+ float distToCenter = length(rippleMapUV - vec2(0.5));-+ float blendClose = smoothstep(0.001, 0.02, distToCenter);-+ float blendFar = 1.0 - smoothstep(0.3, 0.4, distToCenter);-+ float distortionLevel = 2.0;-+ rippleAdd += distortionLevel * vec3(texture2D(rippleMap, rippleMapUV).ba * blendFar * blendClose, 0.0);-+#endif-+-+ vec2 bigWaves = vec2(BIG_WAVES_X,BIG_WAVES_Y);-+ vec2 midWaves = mix(vec2(MID_WAVES_X,MID_WAVES_Y),vec2(MID_WAVES_RAIN_X,MID_WAVES_RAIN_Y),rainIntensity);-+ vec2 smallWaves = mix(vec2(SMALL_WAVES_X,SMALL_WAVES_Y),vec2(SMALL_WAVES_RAIN_X,SMALL_WAVES_RAIN_Y),rainIntensity);-+ float bump = mix(BUMP,BUMP_RAIN,rainIntensity);-+-+ vec3 normal = (normal0 * bigWaves.x + normal1 * bigWaves.y + normal2 * midWaves.x +-+ normal3 * midWaves.y + normal4 * smallWaves.x + normal5 * smallWaves.y + rippleAdd);-+ normal = normalize(vec3(-normal.x * bump, -normal.y * bump, normal.z));-+-+ vec3 lVec = normalize((gl_ModelViewMatrixInverse * vec4(lcalcPosition(0).xyz, 0.0)).xyz);-+ vec3 cameraPos = (gl_ModelViewMatrixInverse * vec4(0,0,0,1)).xyz;-+ vec3 vVec = normalize(position.xyz - cameraPos.xyz);-+-+ float sunFade = length(gl_LightModel.ambient.xyz);-+-+ // fresnel-+ float ior = (cameraPos.z>0.0)?(1.333/1.0):(1.0/1.333); // air to water; water to air-+ float fresnel = clamp(fresnel_dielectric(vVec, normal, ior), 0.0, 1.0);-+-+ float radialise = 1.0;-+-+#if @radialFog-+ float radialDepth = distance(position.xyz, cameraPos);-+ // TODO: Figure out how to properly radialise refraction depth and thus underwater fog-+ // while avoiding oddities when the water plane is close to the clipping plane-+ // radialise = radialDepth / linearDepth;-+#else-+ float radialDepth = 0.0;-+#endif-+-+ vec2 screenCoordsOffset = normal.xy * REFL_BUMP;-+#if REFRACTION-+ float depthSample = linearizeDepth(sampleRefractionDepthMap(screenCoords), near, far) * radialise;-+ float surfaceDepth = linearizeDepth(gl_FragCoord.z, near, far) * radialise;-+ float realWaterDepth = depthSample - surfaceDepth; // undistorted water depth in view direction, independent of frustum-+ float depthSampleDistorted = linearizeDepth(sampleRefractionDepthMap(screenCoords - screenCoordsOffset), near, far) * radialise;-+ float waterDepthDistorted = max(depthSampleDistorted - surfaceDepth, 0.0);-+ screenCoordsOffset *= clamp(realWaterDepth / BUMP_SUPPRESS_DEPTH,0,1);-+#endif-+ // reflection-+ vec3 reflection = sampleReflectionMap(screenCoords + screenCoordsOffset).rgb;-+-+ // specular-+ float specular = pow(max(dot(reflect(vVec, normal), lVec), 0.0),SPEC_HARDNESS) * shadow;-+-+ vec3 waterColor = WATER_COLOR * sunFade;-+-+ vec4 sunSpec = lcalcSpecular(0);-+ // alpha component is sun visibility; we want to start fading lighting effects when visibility is low-+ sunSpec.a = min(1.0, sunSpec.a / SUN_SPEC_FADING_THRESHOLD);-+-+ // artificial specularity to make rain ripples more noticeable-+ vec3 skyColorEstimate = vec3(max(0.0, mix(-0.3, 1.0, sunFade)));-+ vec3 rainSpecular = abs(rainRipple.w)*mix(skyColorEstimate, vec3(1.0), 0.05)*0.5;-+-+#if REFRACTION-+ // no alpha here, so make sure raindrop ripple specularity gets properly subdued-+ rainSpecular *= clamp(fresnel*6.0 + specular * sunSpec.a, 0.0, 1.0);-+-+ // selectively nullify screenCoordsOffset to eliminate remaining shore artifacts, not needed for reflection-+ if (cameraPos.z > 0.0 && realWaterDepth <= VISIBILITY_DEPTH && waterDepthDistorted > VISIBILITY_DEPTH)-+ screenCoordsOffset = vec2(0.0);-+-+ depthSampleDistorted = linearizeDepth(sampleRefractionDepthMap(screenCoords - screenCoordsOffset), near, far) * radialise;-+ waterDepthDistorted = max(depthSampleDistorted - surfaceDepth, 0.0);-+-+ // fade to realWaterDepth at a distance to compensate for physically inaccurate depth calculation-+ waterDepthDistorted = mix(waterDepthDistorted, realWaterDepth, min(surfaceDepth / REFR_FOG_DISTORT_DISTANCE, 1.0));-+-+ // refraction-+ vec3 refraction = sampleRefractionMap(screenCoords - screenCoordsOffset).rgb;-+ vec3 rawRefraction = refraction;-+-+ // brighten up the refraction underwater-+ if (cameraPos.z < 0.0)-+ refraction = clamp(refraction * 1.5, 0.0, 1.0);-+ else-+ {-+ float depthCorrection = sqrt(1.0 + 4.0 * DEPTH_FADE * DEPTH_FADE);-+ float factor = DEPTH_FADE * DEPTH_FADE / (-0.5 * depthCorrection + 0.5 - waterDepthDistorted / VISIBILITY) + 0.5 * depthCorrection + 0.5;-+ refraction = mix(refraction, waterColor, clamp(factor, 0.0, 1.0));-+ }-+-+ // sunlight scattering-+ // normal for sunlight scattering-+ vec3 lNormal = (normal0 * bigWaves.x * 0.5 + normal1 * bigWaves.y * 0.5 + normal2 * midWaves.x * 0.2 +-+ normal3 * midWaves.y * 0.2 + normal4 * smallWaves.x * 0.1 + normal5 * smallWaves.y * 0.1 + rippleAdd);-+ lNormal = normalize(vec3(-lNormal.x * bump, -lNormal.y * bump, lNormal.z));-+ float sunHeight = lVec.z;-+ vec3 scatterColour = mix(SCATTER_COLOUR*vec3(1.0,0.4,0.0), SCATTER_COLOUR, clamp(1.0-exp(-sunHeight*SUN_EXT), 0.0, 1.0));-+ vec3 lR = reflect(lVec, lNormal);-+ float lightScatter = clamp(dot(lVec,lNormal)*0.7+0.3, 0.0, 1.0) * clamp(dot(lR, vVec)*2.0-1.2, 0.0, 1.0) * SCATTER_AMOUNT * sunFade * sunSpec.a * clamp(1.0-exp(-sunHeight), 0.0, 1.0);-+ gl_FragData[0].xyz = mix(mix(refraction, scatterColour, lightScatter), reflection, fresnel) + specular * sunSpec.rgb * sunSpec.a + rainSpecular;-+ gl_FragData[0].w = 1.0;-+-+ // wobbly water: hard-fade into refraction texture at extremely low depth, with a wobble based on normal mapping-+ vec3 normalShoreRippleRain = texture2D(normalMap,normalCoords(UV, 2.0, 2.7, -1.0*waterTimer, 0.05, 0.1, normal3)).rgb - 0.5-+ + texture2D(normalMap,normalCoords(UV, 2.0, 2.7, waterTimer, 0.04, -0.13, normal4)).rgb - 0.5;-+ float verticalWaterDepth = realWaterDepth * mix(abs(vVec.z), 1.0, 0.2); // an estimate-+ float shoreOffset = verticalWaterDepth - (normal2.r + mix(0.0, normalShoreRippleRain.r, rainIntensity) + 0.15)*8.0;-+ float fuzzFactor = min(1.0, 1000.0/surfaceDepth) * mix(abs(vVec.z), 1.0, 0.2);-+ shoreOffset *= fuzzFactor;-+ shoreOffset = clamp(mix(shoreOffset, 1.0, clamp(linearDepth / WOBBLY_SHORE_FADE_DISTANCE, 0.0, 1.0)), 0.0, 1.0);-+ gl_FragData[0].xyz = mix(rawRefraction, gl_FragData[0].xyz, shoreOffset);-+#else-+ gl_FragData[0].xyz = mix(reflection, waterColor, (1.0-fresnel)*0.5) + specular * sunSpec.rgb * sunSpec.a + rainSpecular;-+ gl_FragData[0].w = clamp(fresnel*6.0 + specular * sunSpec.a, 0.0, 1.0); //clamp(fresnel*2.0 + specular * gl_LightSource[0].specular.a, 0.0, 1.0);-+#endif-+-+ gl_FragData[0] = applyFogAtDist(gl_FragData[0], radialDepth, linearDepth, far);-+-+#if !@disableNormals-+ gl_FragData[1].rgb = normalize(gl_NormalMatrix * normal) * 0.5 + 0.5;-+#endif-+-+ applyShadowDebugOverlay();-+}-diff --git a/files/shaders/compatibility/water.vert b/files/shaders/compatibility/water.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/core/gui.frag b/files/shaders/core/gui.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/core/gui.vert b/files/shaders/core/gui.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/core/ripples_blobber.comp b/files/shaders/core/ripples_blobber.comp-old mode 100644-new mode 100755-diff --git a/files/shaders/core/ripples_simulate.comp b/files/shaders/core/ripples_simulate.comp-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/fragment.glsl b/files/shaders/lib/core/fragment.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/fragment_multiview.glsl b/files/shaders/lib/core/fragment_multiview.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/vertex.glsl b/files/shaders/lib/core/vertex.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/vertex.h.glsl b/files/shaders/lib/core/vertex.h.glsl-old mode 100644-new mode 100755-index 6e22f6deb15..c8a1080574d---- a/files/shaders/lib/core/vertex.h.glsl-+++ b/files/shaders/lib/core/vertex.h.glsl-@@ -1,6 +1,16 @@--@link "lib/core/vertex.glsl" if !@useOVR_multiview--@link "lib/core/vertex_multiview.glsl" if @useOVR_multiview-+uniform mat4 projectionMatrix;---vec4 modelToClip(vec4 pos);--vec4 modelToView(vec4 pos);--vec4 viewToClip(vec4 pos);-+vec4 modelToView(vec4 pos)-+{-+ return gl_ModelViewMatrix * pos;-+}-+-+vec4 modelToClip(vec4 pos)-+{-+ return projectionMatrix * modelToView(pos);-+}-+-+vec4 viewToClip(vec4 pos)-+{-+ return projectionMatrix * pos;-+}-diff --git a/files/shaders/lib/core/vertex_multiview.glsl b/files/shaders/lib/core/vertex_multiview.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/light/lighting.glsl b/files/shaders/lib/light/lighting.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/light/lighting_util.glsl b/files/shaders/lib/light/lighting_util.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/luminance/constants.glsl b/files/shaders/lib/luminance/constants.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/material/alpha.glsl b/files/shaders/lib/material/alpha.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/material/parallax.glsl b/files/shaders/lib/material/parallax.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/particle/occlusion.glsl b/files/shaders/lib/particle/occlusion.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/particle/soft.glsl b/files/shaders/lib/particle/soft.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/sky/passes.glsl b/files/shaders/lib/sky/passes.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/util/coordinates.glsl b/files/shaders/lib/util/coordinates.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/util/distortion.glsl b/files/shaders/lib/util/distortion.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/util/quickstep.glsl b/files/shaders/lib/util/quickstep.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/view/depth.glsl b/files/shaders/lib/view/depth.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/water/fresnel.glsl b/files/shaders/lib/water/fresnel.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/water/rain_ripples.glsl b/files/shaders/lib/water/rain_ripples.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/water/rain_ripples_old.glsl b/files/shaders/lib/water/rain_ripples_old.glsl-new file mode 100755-index 00000000000..4e5f85017be---- /dev/null-+++ b/files/shaders/lib/water/rain_ripples_old.glsl-@@ -0,0 +1,126 @@-+#ifndef LIB_WATER_RIPPLES-+#define LIB_WATER_RIPPLES-+-+#define RAIN_RIPPLE_DETAIL @rain_ripple_detail-+-+const float RAIN_RIPPLE_GAPS = 10.0;-+const float RAIN_RIPPLE_RADIUS = 0.2;-+-+float scramble(float x, float z)-+{-+ return fract(pow(fract(x)*3.0+1.0, z));-+}-+-+vec2 randOffset(vec2 c, float time)-+{-+ time = fract(time/1000.0);-+ c = vec2(c.x * c.y / 8.0 + c.y * 0.3 + c.x * 0.2,-+ c.x * c.y / 14.0 + c.y * 0.5 + c.x * 0.7);-+ c.x *= scramble(scramble(time + c.x/1000.0, 4.0), 3.0) + 1.0;-+ c.y *= scramble(scramble(time + c.y/1000.0, 3.5), 3.0) + 1.0;-+ return fract(c);-+}-+-+float randPhase(vec2 c)-+{-+ return fract((c.x * c.y) / (c.x + c.y + 0.1));-+}-+-+float blip(float x)-+{-+ x = max(0.0, 1.0-x*x);-+ return x*x*x;-+}-+-+float blipDerivative(float x)-+{-+ x = clamp(x, -1.0, 1.0);-+ float n = x*x-1.0;-+ return -6.0*x*n*n;-+}-+-+const float RAIN_RING_TIME_OFFSET = 1.0/6.0;-+-+vec4 circle(vec2 coords, vec2 corner, float adjusted_time)-+{-+ vec2 center = vec2(0.5,0.5) + (0.5 - RAIN_RIPPLE_RADIUS) * (2.0 * randOffset(corner, floor(adjusted_time)) - 1.0);-+ float phase = fract(adjusted_time);-+ vec2 toCenter = coords - center;-+-+ float r = RAIN_RIPPLE_RADIUS;-+ float d = length(toCenter);-+ float ringfollower = (phase-d/r)/RAIN_RING_TIME_OFFSET-1.0; // -1.0 ~ +1.0 cover the breadth of the ripple's ring-+-+#if RAIN_RIPPLE_DETAIL > 0-+// normal mapped ripples-+ if(ringfollower < -1.0 || ringfollower > 1.0)-+ return vec4(0.0);-+-+ if(d > 1.0) // normalize center direction vector, but not for near-center ripples-+ toCenter /= d;-+-+ float height = blip(ringfollower*2.0+0.5); // brighten up outer edge of ring; for fake specularity-+ float range_limit = blip(min(0.0, ringfollower));-+ float energy = 1.0-phase;-+-+ vec2 normal2d = -toCenter*blipDerivative(ringfollower)*5.0;-+ vec3 normal = vec3(normal2d, 0.5);-+ vec4 ret = vec4(normal, height);-+ ret.xyw *= energy*energy;-+ // do energy adjustment here rather than later, so that we can use the w component for fake specularity-+ ret.xyz = normalize(ret.xyz) * energy*range_limit;-+ ret.z *= range_limit;-+ return ret;-+#else-+// ring-only ripples-+ if(ringfollower < -1.0 || ringfollower > 0.5)-+ return vec4(0.0);-+-+ float energy = 1.0-phase;-+ float height = blip(ringfollower*2.0+0.5)*energy*energy; // fake specularity-+-+ return vec4(0.0, 0.0, 0.0, height);-+#endif-+}-+vec4 rain(vec2 uv, float time)-+{-+ uv *= RAIN_RIPPLE_GAPS;-+ vec2 f_part = fract(uv);-+ vec2 i_part = floor(uv);-+ float adjusted_time = time * 1.2 + randPhase(i_part);-+#if RAIN_RIPPLE_DETAIL > 0-+ vec4 a = circle(f_part, i_part, adjusted_time);-+ vec4 b = circle(f_part, i_part, adjusted_time - RAIN_RING_TIME_OFFSET);-+ vec4 c = circle(f_part, i_part, adjusted_time - RAIN_RING_TIME_OFFSET*2.0);-+ vec4 d = circle(f_part, i_part, adjusted_time - RAIN_RING_TIME_OFFSET*3.0);-+ vec4 ret;-+ ret.xy = a.xy - b.xy/2.0 + c.xy/4.0 - d.xy/8.0;-+ // z should always point up-+ ret.z = a.z + b.z /2.0 + c.z /4.0 + d.z /8.0;-+ //ret.xyz *= 1.5;-+ // fake specularity looks weird if we use every single ring, also if the inner rings are too bright-+ ret.w = (a.w + c.w /8.0)*1.5;-+ return ret;-+#else-+ return circle(f_part, i_part, adjusted_time) * 1.5;-+#endif-+}-+-+vec2 complex_mult(vec2 a, vec2 b)-+{-+ return vec2(a.x*b.x - a.y*b.y, a.x*b.y + a.y*b.x);-+}-+vec4 rainCombined(vec2 uv, float time) // returns ripple normal in xyz and fake specularity in w-+{-+ return-+ rain(uv, time)-+ + rain(complex_mult(uv, vec2(0.4, 0.7)) + vec2(1.2, 3.0),time)-+ #if RAIN_RIPPLE_DETAIL == 2-+ + rain(uv * 0.75 + vec2( 3.7,18.9),time)-+ + rain(uv * 0.9 + vec2( 5.7,30.1),time)-+ + rain(uv * 1.0 + vec2(10.5 ,5.7),time)-+ #endif-+ ;-+}-+-+#endif-diff --git a/files/shaders/lib/water/ripples.glsl b/files/shaders/lib/water/ripples.glsl-old mode 100644-new mode 100755diff --git a/android/buildscripts/patches/openmw/gamma.patch b/android/buildscripts/patches/openmw/gamma.patchdeleted file mode 100644index 9ea341a..0000000--- a/android/buildscripts/patches/openmw/gamma.patch+++ /dev/null@@ -1,79 +0,0 @@-diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp-index e497fdecd..cc654e629 100644---- a/apps/openmw/mwrender/renderingmanager.cpp-+++ b/apps/openmw/mwrender/renderingmanager.cpp-@@ -69,6 +69,32 @@- #include "screenshotmanager.hpp"- #include "groundcover.hpp"--+namespace {-+ class GammaCorrection : public osg::StateAttribute-+ {-+ public :-+ GammaCorrection() : gamma(0) {}-+ GammaCorrection(float gamma_) : gamma(gamma_) {}-+ GammaCorrection(const GammaCorrection& copy,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY)-+ : osg::StateAttribute(copy,copyop), gamma(copy.gamma) {}-+-+ META_StateAttribute(, GammaCorrection, (osg::StateAttribute::Type)123)-+-+ /** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */-+ virtual int compare(const StateAttribute& sa) const-+ {-+ throw std::runtime_error("");-+ }-+-+ virtual void apply(osg::State& state) const {-+ glLightModelfv(0x4242,&gamma);-+ }-+-+ private:-+ float gamma;-+ };-+}-+- namespace MWRender- {--@@ -97,6 +123,19 @@ namespace MWRender- }- else- stateset->removeAttribute(osg::StateAttribute::POLYGONMODE);-+-+ {-+ static bool init = false;-+ static float gamma = 0;-+ if (!init) {-+ const char *s = getenv("OPENMW_GAMMA");-+ if (s)-+ gamma = atof(s);-+ init = true;-+ }-+ osg::ref_ptr<GammaCorrection> gammaAttribute = new GammaCorrection(gamma);-+ stateset->setAttribute(gammaAttribute);-+ }- }-- void apply(osg::StateSet* stateset, osg::NodeVisitor*) override-@@ -252,6 +291,10 @@ namespace MWRender- for (auto itr = shadowDefines.begin(); itr != shadowDefines.end(); itr++)- globalDefines[itr->first] = itr->second;--+ const char *s = getenv("OPENMW_GAMMA");-+ if (s) globalDefines["gamma"] = s;-+ else globalDefines["gamma"] = "1.0";-+- globalDefines["forcePPL"] = Settings::Manager::getBool("force per pixel lighting", "Shaders") ? "1" : "0";- globalDefines["clamp"] = Settings::Manager::getBool("clamp lighting", "Shaders") ? "1" : "0";- globalDefines["preLightEnv"] = Settings::Manager::getBool("apply lighting to environment maps", "Shaders") ? "1" : "0";-@@ -363,6 +406,9 @@ namespace MWRender-- mScreenshotManager.reset(new ScreenshotManager(viewer, mRootNode, sceneRoot, mResourceSystem, mWater.get()));--+ osg::ref_ptr<GammaCorrection> gamma = new GammaCorrection(1.0);-+ mViewer->getCamera()->getOrCreateStateSet()->setAttribute(gamma);-+- mViewer->setLightingMode(osgViewer::View::NO_LIGHT);-- osg::ref_ptr<osg::LightSource> source = new osg::LightSource;-diff --git a/android/buildscripts/patches/openmw/navmeshtool.patch b/android/buildscripts/patches/openmw/navmeshtool.patchdeleted file mode 100644index 988f0f8..0000000--- a/android/buildscripts/patches/openmw/navmeshtool.patch+++ /dev/null@@ -1,158 +0,0 @@-From ea1d746e75fd64f1d411155d01483f37bce2806b Mon Sep 17 00:00:00 2001-From: sisah <[email protected]>-Date: Fri, 10 Mar 2023 11:19:03 -0500-Subject: [PATCH] add navmeshtool hack------ apps/navmeshtool/CMakeLists.txt | 2 +-- apps/navmeshtool/main.cpp | 8 +++++---- apps/navmeshtool/navmesh.cpp | 3 +++- apps/navmeshtool/navmesh.hpp | 2 ++- apps/openmw/CMakeLists.txt | 4 ++++- apps/openmw/engine.cpp | 2 +-- apps/openmw/main.cpp | 14 ++++++++++++++- components/debug/debugging.cpp | 2 +-- 8 files changed, 31 insertions(+), 6 deletions(-)--diff --git a/apps/navmeshtool/CMakeLists.txt b/apps/navmeshtool/CMakeLists.txt-index 9f57d52a7e4..495fa3f47a8 100644---- a/apps/navmeshtool/CMakeLists.txt-+++ b/apps/navmeshtool/CMakeLists.txt-@@ -5,7 +5,7 @@ set(NAVMESHTOOL- )- source_group(apps\\navmeshtool FILES ${NAVMESHTOOL})---openmw_add_executable(openmw-navmeshtool ${NAVMESHTOOL})-+add_library(openmw-navmeshtool SHARED ${NAVMESHTOOL})-- target_link_libraries(openmw-navmeshtool- ${Boost_PROGRAM_OPTIONS_LIBRARY}-diff --git a/apps/navmeshtool/main.cpp b/apps/navmeshtool/main.cpp-index b93e6cd7c86..fdb183e4a36 100644---- a/apps/navmeshtool/main.cpp-+++ b/apps/navmeshtool/main.cpp-@@ -51,8 +51,8 @@-- namespace NavMeshTool- {-- namespace-- {-+// namespace-+// {- namespace bpo = boost::program_options;-- using StringsVector = std::vector<std::string>;-@@ -261,10 +261,12 @@ namespace NavMeshTool-- return 0;- }-- }-+// }- }--+/*- int main(int argc, char* argv[])- {- return wrapApplication(NavMeshTool::runNavMeshTool, argc, argv, NavMeshTool::applicationName);- }-+*/-diff --git a/apps/navmeshtool/navmesh.cpp b/apps/navmeshtool/navmesh.cpp-index 384c9654660..e41a248e6d8 100644---- a/apps/navmeshtool/navmesh.cpp-+++ b/apps/navmeshtool/navmesh.cpp-@@ -53,6 +53,9 @@ namespace NavMeshTool- Log(Debug::Info) << provided << "/" << expected << " ("- << (static_cast<double>(provided) / static_cast<double>(expected) * 100)- << "%) navmesh tiles are generated";-+-+ std::string message = std::to_string((static_cast<double>(provided) / static_cast<double>(expected) * 100));-+ setenv("NAVMESHTOOL_MESSAGE", message.c_str(), true);- }-- template <class T>-diff --git a/apps/navmeshtool/navmesh.hpp b/apps/navmeshtool/navmesh.hpp-index 4e607f4f2b0..47282237644 100644---- a/apps/navmeshtool/navmesh.hpp-+++ b/apps/navmeshtool/navmesh.hpp-@@ -24,6 +24,8 @@ namespace NavMeshTool- Status generateAllNavMeshTiles(const DetourNavigator::AgentBounds& agentBounds,- const DetourNavigator::Settings& settings, std::size_t threadsNumber, bool removeUnusedTiles,- bool writeBinaryLog, WorldspaceData& cellsData, DetourNavigator::NavMeshDb&& db);-+-+ int runNavMeshTool(int argc, char *argv[]);- }-- #endif-diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt-index ff2ecfe5c93..dde84863aa8 100644---- a/apps/openmw/CMakeLists.txt-+++ b/apps/openmw/CMakeLists.txt-@@ -111,6 +111,10 @@ add_openmw_dir (mwbase- inputmanager windowmanager statemanager- )--+add_openmw_dir (.-+ ../navmeshtool/main ../navmeshtool/navmesh ../navmeshtool/worldspacedata-+ )-+- # Main executable-- if (NOT ANDROID)-diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp-index 95119a0c165..d1b431ab103 100644---- a/apps/openmw/engine.cpp-+++ b/apps/openmw/engine.cpp-@@ -466,7 +466,7 @@ void OMW::Engine::setSkipMenu(bool skipMenu, bool newGame)- }-- // To share the viewer with Android interfaces--osg::ref_ptr<osgViewer::Viewer> g_viewer;-+extern osg::ref_ptr<osgViewer::Viewer> g_viewer;-- void OMW::Engine::createWindow()- {-diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp-index cc51462322d..a806df6fcd3 100644---- a/apps/openmw/main.cpp-+++ b/apps/openmw/main.cpp-@@ -27,6 +27,9 @@ extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x- #include <unistd.h>- #endif--+// Android navmeshtool hack-+#include "../navmeshtool/navmesh.hpp"-+- using namespace Fallback;-- /**-@@ -242,6 +245,17 @@ int runApplication(int argc, char* argv[])- Files::ConfigurationManager cfgMgr;- std::unique_ptr<OMW::Engine> engine = std::make_unique<OMW::Engine>(cfgMgr);--+ // Android navmeshtool hack-+ if ( getenv("OPENMW_GENERATE_NAVMESH_CACHE") )-+ {-+ if(NavMeshTool::runNavMeshTool(argc, argv))-+ Log(Debug::Error) << "runNavMeshTool failed";-+ else-+ Log(Debug::Error) << "runNavMeshTool sucess";-+-+ return 0;-+ }-+- if (parseOptions(argc, argv, *engine, cfgMgr))- {- engine->go();-diff --git a/components/debug/debugging.cpp b/components/debug/debugging.cpp-index 40f207fe459..4a37625c675 100644---- a/components/debug/debugging.cpp-+++ b/components/debug/debugging.cpp-@@ -304,7 +304,7 @@ void setupLogging(const std::filesystem::path& logDir, std::string_view appName,- #endif- }---extern osg::ref_ptr<osgViewer::Viewer> g_viewer;-+osg::ref_ptr<osgViewer::Viewer> g_viewer;-- int wrapApplication(int (*innerApplication)(int argc, char* argv[]), int argc, char* argv[], std::string_view appName)- {diff --git a/android/buildscripts/patches/openmw/post-processing-hud-resize.patch b/android/buildscripts/patches/openmw/post-processing-hud-resize.patchdeleted file mode 100644index 1f7c605..0000000--- a/android/buildscripts/patches/openmw/post-processing-hud-resize.patch+++ /dev/null@@ -1,22 +0,0 @@-From 29265739cd050e5d284d9a17581d3a3f52680dd3 Mon Sep 17 00:00:00 2001-From: Duron27 <[email protected]>-Date: Wed, 6 Mar 2024 21:14:37 -0500-Subject: [PATCH] Update openmw_postprocessor_hud.layout------ files/data/mygui/openmw_postprocessor_hud.layout | 2 +-- 1 file changed, 1 insertion(+), 1 deletion(-)--diff --git a/files/data/mygui/openmw_postprocessor_hud.layout b/files/data/mygui/openmw_postprocessor_hud.layout-index 4ed8ecdb36a..afdeef5e969 100644---- a/files/data/mygui/openmw_postprocessor_hud.layout-+++ b/files/data/mygui/openmw_postprocessor_hud.layout-@@ -3,7 +3,7 @@- <Widget type="Window" skin="MW_Window" position="0 0 500 500" layer="Debug" name="_Main" align="Stretch">- <Property key="Visible" value="false"/>- <Property key="Caption" value="#{OMWShaders:PostProcessHUD}"/>-- <Property key="MinSize" value="600 600"/>-+ <Property key="MinSize" value="600 400"/>-- <Widget type="TabControl" skin="TabControl_NoBorder" position="8 8 468 450" align="Stretch" name="TabControl">- <Property key="ButtonAutoWidth" value="true"/>diff --git a/android/buildscripts/patches/openmw/postprocessing.patch b/android/buildscripts/patches/openmw/postprocessing.patchdeleted file mode 100644index f0eb7be..0000000--- a/android/buildscripts/patches/openmw/postprocessing.patch+++ /dev/null@@ -1,689 +0,0 @@-From f9445de2faabd65f0685d8f795cce572b5187969 Mon Sep 17 00:00:00 2001-From: sisah <[email protected]>-Date: Mon, 1 Jan 2024 06:36:33 -0500-Subject: [PATCH] Postprocessing fixes, core shaders------ apps/openmw/mwrender/luminancecalculator.cpp | 4 +-- apps/openmw/mwrender/npcanimation.cpp | 2 +-- apps/openmw/mwrender/postprocessor.cpp | 6 +--- apps/openmw/mwrender/renderingmanager.cpp | 4 +-- apps/openmw/mwrender/transparentpass.cpp | 7 ++--- components/fx/parse_constants.hpp | 5 ++-- components/fx/pass.cpp | 2 +-- components/shader/shadervisitor.cpp | 10 +++++- files/data/shaders/bloomlinear.omwfx | 10 ++---- files/shaders/compatibility/bs/default.frag | 0- files/shaders/compatibility/bs/default.vert | 0- .../shaders/compatibility/bs/nolighting.frag | 0- .../shaders/compatibility/bs/nolighting.vert | 0- files/shaders/compatibility/debug.frag | 2 +-- files/shaders/compatibility/debug.vert | 2 +-- files/shaders/compatibility/depthclipped.frag | 0- files/shaders/compatibility/depthclipped.vert | 0- files/shaders/compatibility/fog.glsl | 0- .../shaders/compatibility/fullscreen_tri.frag | 0- .../shaders/compatibility/fullscreen_tri.vert | 2 +-- files/shaders/compatibility/groundcover.frag | 0- files/shaders/compatibility/groundcover.vert | 0- files/shaders/compatibility/gui.frag | 0- files/shaders/compatibility/gui.vert | 0- .../compatibility/luminance/luminance.frag | 0- .../compatibility/luminance/resolve.frag | 0- .../compatibility/multiview_resolve.frag | 0- .../compatibility/multiview_resolve.vert | 0- files/shaders/compatibility/normals.glsl | 0- files/shaders/compatibility/objects.frag | 8 ++--- files/shaders/compatibility/objects.vert | 0- .../compatibility/ripples_blobber.frag | 0- .../compatibility/ripples_simulate.frag | 0- files/shaders/compatibility/s360.frag | 0- files/shaders/compatibility/s360.vert | 0- .../shaders/compatibility/shadowcasting.frag | 0- .../shaders/compatibility/shadowcasting.vert | 0- .../compatibility/shadows_fragment.glsl | 0- .../shaders/compatibility/shadows_vertex.glsl | 0- files/shaders/compatibility/sky.frag | 0- files/shaders/compatibility/sky.vert | 0- files/shaders/compatibility/terrain.frag | 0- files/shaders/compatibility/terrain.vert | 0- files/shaders/compatibility/vertexcolors.glsl | 0- files/shaders/compatibility/water.frag | 0- files/shaders/compatibility/water.vert | 0- files/shaders/core/gui.frag | 0- files/shaders/core/gui.vert | 0- files/shaders/core/ripples_blobber.comp | 0- files/shaders/core/ripples_simulate.comp | 0- files/shaders/lib/core/fragment.glsl | 0- files/shaders/lib/core/fragment.h.glsl | 37 +++++++++++++++----- .../shaders/lib/core/fragment_multiview.glsl | 0- files/shaders/lib/core/vertex.glsl | 0- files/shaders/lib/core/vertex.h.glsl | 20 +++++++---- files/shaders/lib/core/vertex_multiview.glsl | 0- files/shaders/lib/light/lighting.glsl | 0- files/shaders/lib/light/lighting_util.glsl | 0- files/shaders/lib/luminance/constants.glsl | 0- files/shaders/lib/material/alpha.glsl | 0- files/shaders/lib/material/parallax.glsl | 0- files/shaders/lib/particle/occlusion.glsl | 0- files/shaders/lib/particle/soft.glsl | 0- files/shaders/lib/sky/passes.glsl | 0- files/shaders/lib/util/coordinates.glsl | 0- files/shaders/lib/util/distortion.glsl | 0- files/shaders/lib/util/quickstep.glsl | 0- files/shaders/lib/view/depth.glsl | 0- files/shaders/lib/water/fresnel.glsl | 0- files/shaders/lib/water/rain_ripples.glsl | 0- files/shaders/lib/water/ripples.glsl | 0- 71 files changed, 83 insertions(+), 38 deletions(-)- mode change 100644 => 100755 files/data/shaders/bloomlinear.omwfx- mode change 100644 => 100755 files/shaders/compatibility/bs/default.frag- mode change 100644 => 100755 files/shaders/compatibility/bs/default.vert- mode change 100644 => 100755 files/shaders/compatibility/bs/nolighting.frag- mode change 100644 => 100755 files/shaders/compatibility/bs/nolighting.vert- mode change 100644 => 100755 files/shaders/compatibility/debug.frag- mode change 100644 => 100755 files/shaders/compatibility/debug.vert- mode change 100644 => 100755 files/shaders/compatibility/depthclipped.frag- mode change 100644 => 100755 files/shaders/compatibility/depthclipped.vert- mode change 100644 => 100755 files/shaders/compatibility/fog.glsl- mode change 100644 => 100755 files/shaders/compatibility/fullscreen_tri.frag- mode change 100644 => 100755 files/shaders/compatibility/fullscreen_tri.vert- mode change 100644 => 100755 files/shaders/compatibility/groundcover.frag- mode change 100644 => 100755 files/shaders/compatibility/groundcover.vert- mode change 100644 => 100755 files/shaders/compatibility/gui.frag- mode change 100644 => 100755 files/shaders/compatibility/gui.vert- mode change 100644 => 100755 files/shaders/compatibility/luminance/luminance.frag- mode change 100644 => 100755 files/shaders/compatibility/luminance/resolve.frag- mode change 100644 => 100755 files/shaders/compatibility/multiview_resolve.frag- mode change 100644 => 100755 files/shaders/compatibility/multiview_resolve.vert- mode change 100644 => 100755 files/shaders/compatibility/normals.glsl- mode change 100644 => 100755 files/shaders/compatibility/objects.frag- mode change 100644 => 100755 files/shaders/compatibility/objects.vert- mode change 100644 => 100755 files/shaders/compatibility/ripples_blobber.frag- mode change 100644 => 100755 files/shaders/compatibility/ripples_simulate.frag- mode change 100644 => 100755 files/shaders/compatibility/s360.frag- mode change 100644 => 100755 files/shaders/compatibility/s360.vert- mode change 100644 => 100755 files/shaders/compatibility/shadowcasting.frag- mode change 100644 => 100755 files/shaders/compatibility/shadowcasting.vert- mode change 100644 => 100755 files/shaders/compatibility/shadows_fragment.glsl- mode change 100644 => 100755 files/shaders/compatibility/shadows_vertex.glsl- mode change 100644 => 100755 files/shaders/compatibility/sky.frag- mode change 100644 => 100755 files/shaders/compatibility/sky.vert- mode change 100644 => 100755 files/shaders/compatibility/terrain.frag- mode change 100644 => 100755 files/shaders/compatibility/terrain.vert- mode change 100644 => 100755 files/shaders/compatibility/vertexcolors.glsl- mode change 100644 => 100755 files/shaders/compatibility/water.frag- mode change 100644 => 100755 files/shaders/compatibility/water.vert- mode change 100644 => 100755 files/shaders/core/gui.frag- mode change 100644 => 100755 files/shaders/core/gui.vert- mode change 100644 => 100755 files/shaders/core/ripples_blobber.comp- mode change 100644 => 100755 files/shaders/core/ripples_simulate.comp- mode change 100644 => 100755 files/shaders/lib/core/fragment.glsl- mode change 100644 => 100755 files/shaders/lib/core/fragment.h.glsl- mode change 100644 => 100755 files/shaders/lib/core/fragment_multiview.glsl- mode change 100644 => 100755 files/shaders/lib/core/vertex.glsl- mode change 100644 => 100755 files/shaders/lib/core/vertex.h.glsl- mode change 100644 => 100755 files/shaders/lib/core/vertex_multiview.glsl- mode change 100644 => 100755 files/shaders/lib/light/lighting.glsl- mode change 100644 => 100755 files/shaders/lib/light/lighting_util.glsl- mode change 100644 => 100755 files/shaders/lib/luminance/constants.glsl- mode change 100644 => 100755 files/shaders/lib/material/alpha.glsl- mode change 100644 => 100755 files/shaders/lib/material/parallax.glsl- mode change 100644 => 100755 files/shaders/lib/particle/occlusion.glsl- mode change 100644 => 100755 files/shaders/lib/particle/soft.glsl- mode change 100644 => 100755 files/shaders/lib/sky/passes.glsl- mode change 100644 => 100755 files/shaders/lib/util/coordinates.glsl- mode change 100644 => 100755 files/shaders/lib/util/distortion.glsl- mode change 100644 => 100755 files/shaders/lib/util/quickstep.glsl- mode change 100644 => 100755 files/shaders/lib/view/depth.glsl- mode change 100644 => 100755 files/shaders/lib/water/fresnel.glsl- mode change 100644 => 100755 files/shaders/lib/water/rain_ripples.glsl- mode change 100644 => 100755 files/shaders/lib/water/ripples.glsl--diff --git a/apps/openmw/mwrender/luminancecalculator.cpp b/apps/openmw/mwrender/luminancecalculator.cpp-index ae29b7fdcc8..de4ac766f1b 100644---- a/apps/openmw/mwrender/luminancecalculator.cpp-+++ b/apps/openmw/mwrender/luminancecalculator.cpp-@@ -26,7 +26,7 @@ namespace MWRender- buffer.mipmappedSceneLuminanceTex = new osg::Texture2D;- buffer.mipmappedSceneLuminanceTex->setInternalFormat(GL_R16F);- buffer.mipmappedSceneLuminanceTex->setSourceFormat(GL_RED);-- buffer.mipmappedSceneLuminanceTex->setSourceType(GL_FLOAT);-+ buffer.mipmappedSceneLuminanceTex->setSourceType(GL_HALF_FLOAT);- buffer.mipmappedSceneLuminanceTex->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);- buffer.mipmappedSceneLuminanceTex->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);- buffer.mipmappedSceneLuminanceTex->setFilter(-@@ -37,7 +37,7 @@ namespace MWRender- buffer.luminanceTex = new osg::Texture2D;- buffer.luminanceTex->setInternalFormat(GL_R16F);- buffer.luminanceTex->setSourceFormat(GL_RED);-- buffer.luminanceTex->setSourceType(GL_FLOAT);-+ buffer.luminanceTex->setSourceType(GL_HALF_FLOAT);- buffer.luminanceTex->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);- buffer.luminanceTex->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);- buffer.luminanceTex->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::NEAREST);-diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp-index 01bdcec665e..20fd4aac692 100644---- a/apps/openmw/mwrender/npcanimation.cpp-+++ b/apps/openmw/mwrender/npcanimation.cpp-@@ -347,7 +347,7 @@ namespace MWRender- auto primaryFBO = postProcessor->getPrimaryFbo(frameId);- primaryFBO->apply(*state);--- postProcessor->getFbo(PostProcessor::FBO_OpaqueDepth, frameId)->apply(*state);-+ //postProcessor->getFbo(PostProcessor::FBO_OpaqueDepth, frameId)->apply(*state);-- // depth accumulation pass- osg::ref_ptr<osg::StateSet> restore = bin->getStateSet();-diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp-index 1aaeb460b7d..d3f4ed092c3 100644---- a/apps/openmw/mwrender/postprocessor.cpp-+++ b/apps/openmw/mwrender/postprocessor.cpp-@@ -300,7 +300,7 @@ namespace MWRender- mCanvases[frameId]->setCalculateAvgLum(mHDR);-- mCanvases[frameId]->setTextureScene(getTexture(Tex_Scene, frameId));-- mCanvases[frameId]->setTextureDepth(getTexture(Tex_OpaqueDepth, frameId));-+ mCanvases[frameId]->setTextureDepth(getTexture(Tex_Depth, frameId));- mCanvases[frameId]->setTextureDistortion(getTexture(Tex_Distortion, frameId));-- mTransparentDepthPostPass->mFbo[frameId] = mFbos[frameId][FBO_Primary];-@@ -407,12 +407,12 @@ namespace MWRender- mPrevPassLights = mPassLights;-- mViewer->stopThreading();---+/*- auto& shaderManager = MWBase::Environment::get().getResourceSystem()->getSceneManager()->getShaderManager();- auto defines = shaderManager.getGlobalDefines();- defines["disableNormals"] = mNormals ? "0" : "1";- shaderManager.setGlobalDefines(defines);---+*/- mRendering.getLightRoot()->setCollectPPLights(mPassLights);- mStateUpdater->bindPointLights(mPassLights ? mRendering.getLightRoot()->getPPLightsBuffer() : nullptr);- mStateUpdater->reset();-diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp-index 2cfcd2fd37f..6770a5c93e2 100644---- a/apps/openmw/mwrender/renderingmanager.cpp-+++ b/apps/openmw/mwrender/renderingmanager.cpp-@@ -463,8 +463,8 @@ namespace MWRender-- mPostProcessor = new PostProcessor(*this, viewer, mRootNode, resourceSystem->getVFS());- resourceSystem->getSceneManager()->setOpaqueDepthTex(-- mPostProcessor->getTexture(PostProcessor::Tex_OpaqueDepth, 0),-- mPostProcessor->getTexture(PostProcessor::Tex_OpaqueDepth, 1));-+ mPostProcessor->getTexture(PostProcessor::Tex_Depth, 0),-+ mPostProcessor->getTexture(PostProcessor::Tex_Depth, 1));- resourceSystem->getSceneManager()->setSoftParticles(Settings::shaders().mSoftParticles);- resourceSystem->getSceneManager()->setSupportsNormalsRT(mPostProcessor->getSupportsNormalsRT());- resourceSystem->getSceneManager()->setWeatherParticleOcclusion(Settings::shaders().mWeatherParticleOcclusion);-diff --git a/apps/openmw/mwrender/transparentpass.cpp b/apps/openmw/mwrender/transparentpass.cpp-index ce53b1c2193..cdda1d4fe39 100644---- a/apps/openmw/mwrender/transparentpass.cpp-+++ b/apps/openmw/mwrender/transparentpass.cpp-@@ -92,8 +92,9 @@ namespace MWRender- else- {- opaqueFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);-- ext->glBlitFramebuffer(0, 0, tex->getTextureWidth(), tex->getTextureHeight(), 0, 0, tex->getTextureWidth(),-- tex->getTextureHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST);-+ //ext->glBlitFramebuffer(0, 0, tex->getTextureWidth(), tex->getTextureHeight(), 0, 0, tex->getTextureWidth(),-+ //tex->getTextureHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST);-+ glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);- }-- msaaFbo ? msaaFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER)-@@ -105,7 +106,7 @@ namespace MWRender- if (!mPostPass)- return;--- opaqueFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);-+ //opaqueFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);-- // draw transparent post-pass to populate a postprocess friendly depth texture with alpha-clipped geometry--diff --git a/components/fx/parse_constants.hpp b/components/fx/parse_constants.hpp-index 9be54ed3a76..55585f8106d 100644---- a/components/fx/parse_constants.hpp-+++ b/components/fx/parse_constants.hpp-@@ -35,7 +35,7 @@ namespace fx- { "bgra", GL_BGRA },- } };--- constexpr std::array<std::pair<std::string_view, int>, 9> SourceType = { {-+ constexpr std::array<std::pair<std::string_view, int>, 10> SourceType = { {- { "byte", GL_BYTE },- { "unsigned_byte", GL_UNSIGNED_BYTE },- { "short", GL_SHORT },-@@ -44,6 +44,7 @@ namespace fx- { "unsigned_int", GL_UNSIGNED_INT },- { "unsigned_int_24_8", GL_UNSIGNED_INT_24_8 },- { "float", GL_FLOAT },-+ { "half_float", GL_HALF_FLOAT },- { "double", GL_DOUBLE },- } };--@@ -129,4 +130,4 @@ namespace fx- }- }---#endif-\ No newline at end of file-+#endif-diff --git a/components/fx/pass.cpp b/components/fx/pass.cpp-index cf50d20fe22..20d090ef6cf 100644---- a/components/fx/pass.cpp-+++ b/components/fx/pass.cpp-@@ -89,7 +89,7 @@ namespace fx-- uniform @builtinSampler omw_SamplerLastShader;- uniform @builtinSampler omw_SamplerLastPass;--uniform @builtinSampler omw_SamplerDepth;-+uniform highp @builtinSampler omw_SamplerDepth;- uniform @builtinSampler omw_SamplerNormals;- uniform @builtinSampler omw_SamplerDistortion;--diff --git a/components/shader/shadervisitor.cpp b/components/shader/shadervisitor.cpp-index 70464f571e6..24ef8c8238c 100644---- a/components/shader/shadervisitor.cpp-+++ b/components/shader/shadervisitor.cpp-@@ -32,6 +32,9 @@- #include "removedalphafunc.hpp"- #include "shadermanager.hpp"--+#include <components/settings/values.hpp>-+#include <components/sceneutil/depth.hpp>-+- namespace Shader- {- /**-@@ -730,6 +733,13 @@ namespace Shader- updateRemovedState(*writableUserData, removedState);- }--+ if (reqs.mAlphaBlend && Settings::postProcessing().mTransparentPostpass && Settings::postProcessing().mEnabled)-+ {-+ osg::ref_ptr<osg::Depth> depth = new SceneUtil::AutoDepth;-+ depth->setWriteMask(false);-+ writableStateSet->setAttributeAndModes(depth, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);-+ }-+- defineMap["softParticles"] = reqs.mSoftParticles ? "1" : "0";-- Stereo::shaderStereoDefines(defineMap);-diff --git a/files/data/shaders/bloomlinear.omwfx b/files/data/shaders/bloomlinear.omwfx-old mode 100644-new mode 100755-index 3de7139f39a..4c583a9a898---- a/files/data/shaders/bloomlinear.omwfx-+++ b/files/data/shaders/bloomlinear.omwfx-@@ -80,8 +80,8 @@ shared {- radius = max(radius, 0.1);- // hack: make the radius wider on the screen edges- // (makes things in the corner of the screen look less "wrong" with not-extremely-low FOVs)-- radius *= pow(texcoord.x*2.0-1.0, 2)+1.0;-- radius *= pow(texcoord.y*2.0-1.0, 2)+1.0;-+ radius *= pow(texcoord.x*2.0-1.0, 2.0)+1.0;-+ radius *= pow(texcoord.y*2.0-1.0, 2.0)+1.0;- return radius;- }- vec3 powv(vec3 a, float x)-@@ -94,7 +94,7 @@ render_target RT_NoMipmap {- width_ratio = 0.25;- height_ratio = 0.25;- internal_format = rgb16f;-- source_type = float;-+ source_type = half_float;- source_format = rgb;- mipmaps = false;- min_filter = nearest;-@@ -105,7 +105,7 @@ render_target RT_Horizontal {- width_ratio = 0.25;- height_ratio = 0.25;- internal_format = rgb16f;-- source_type = float;-+ source_type = half_float;- source_format = rgb;- mipmaps = false;- min_filter = nearest;-@@ -116,7 +116,7 @@ render_target RT_Vertical {- width_ratio = 0.25;- height_ratio = 0.25;- internal_format = rgb16f;-- source_type = float;-+ source_type = half_float;- source_format = rgb;- mipmaps = false;- min_filter = linear;-diff --git a/files/shaders/compatibility/bs/default.frag b/files/shaders/compatibility/bs/default.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/bs/default.vert b/files/shaders/compatibility/bs/default.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/bs/nolighting.frag b/files/shaders/compatibility/bs/nolighting.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/bs/nolighting.vert b/files/shaders/compatibility/bs/nolighting.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/debug.frag b/files/shaders/compatibility/debug.frag-old mode 100644-new mode 100755-index a92b406d46b..041562fc0e2---- a/files/shaders/compatibility/debug.frag-+++ b/files/shaders/compatibility/debug.frag-@@ -4,7 +4,7 @@-- varying vec3 vertexNormal;---uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- void main()- {-diff --git a/files/shaders/compatibility/debug.vert b/files/shaders/compatibility/debug.vert-old mode 100644-new mode 100755-index 47d5337a66f..a1fa462f397---- a/files/shaders/compatibility/debug.vert-+++ b/files/shaders/compatibility/debug.vert-@@ -6,7 +6,7 @@ uniform vec3 color;- uniform vec3 trans;- uniform vec3 scale;- uniform bool useNormalAsColor;--uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- centroid varying vec4 passColor;- varying vec3 vertexNormal;-diff --git a/files/shaders/compatibility/depthclipped.frag b/files/shaders/compatibility/depthclipped.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/depthclipped.vert b/files/shaders/compatibility/depthclipped.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/fog.glsl b/files/shaders/compatibility/fog.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/fullscreen_tri.frag b/files/shaders/compatibility/fullscreen_tri.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/fullscreen_tri.vert b/files/shaders/compatibility/fullscreen_tri.vert-old mode 100644-new mode 100755-index 3174384212e..8510a0933c1---- a/files/shaders/compatibility/fullscreen_tri.vert-+++ b/files/shaders/compatibility/fullscreen_tri.vert-@@ -1,6 +1,6 @@- #version 120---uniform vec2 scaling = vec2(1.0, 1.0);-+uniform vec2 scaling;// = vec2(1.0, 1.0);-- varying vec2 uv;--diff --git a/files/shaders/compatibility/groundcover.frag b/files/shaders/compatibility/groundcover.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/groundcover.vert b/files/shaders/compatibility/groundcover.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/gui.frag b/files/shaders/compatibility/gui.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/gui.vert b/files/shaders/compatibility/gui.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/luminance/luminance.frag b/files/shaders/compatibility/luminance/luminance.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/luminance/resolve.frag b/files/shaders/compatibility/luminance/resolve.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/multiview_resolve.frag b/files/shaders/compatibility/multiview_resolve.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/multiview_resolve.vert b/files/shaders/compatibility/multiview_resolve.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/normals.glsl b/files/shaders/compatibility/normals.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/objects.frag b/files/shaders/compatibility/objects.frag-old mode 100644-new mode 100755-index 043aa266d88..8966a84bf05---- a/files/shaders/compatibility/objects.frag-+++ b/files/shaders/compatibility/objects.frag-@@ -84,11 +84,11 @@ varying vec3 passNormal;- #if @normalMap || @diffuseParallax- varying vec4 passTangent;- #endif---+/*- #if @additiveBlending- #define ADDITIVE_BLENDING- #endif---+*/- #include "lib/light/lighting.glsl"- #include "lib/material/parallax.glsl"- #include "lib/material/alpha.glsl"-@@ -109,11 +109,11 @@ uniform float softFalloffDepth;-- #if @particleOcclusion- #include "lib/particle/occlusion.glsl"--uniform sampler2D orthoDepthMap;-+uniform highp sampler2D orthoDepthMap;- varying vec3 orthoDepthMapCoord;- #endif---uniform sampler2D opaqueDepthTex;-+uniform highp sampler2D opaqueDepthTex;-- void main()- {-diff --git a/files/shaders/compatibility/objects.vert b/files/shaders/compatibility/objects.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/ripples_blobber.frag b/files/shaders/compatibility/ripples_blobber.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/ripples_simulate.frag b/files/shaders/compatibility/ripples_simulate.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/s360.frag b/files/shaders/compatibility/s360.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/s360.vert b/files/shaders/compatibility/s360.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/shadowcasting.frag b/files/shaders/compatibility/shadowcasting.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/shadowcasting.vert b/files/shaders/compatibility/shadowcasting.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/shadows_fragment.glsl b/files/shaders/compatibility/shadows_fragment.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/shadows_vertex.glsl b/files/shaders/compatibility/shadows_vertex.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/sky.frag b/files/shaders/compatibility/sky.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/sky.vert b/files/shaders/compatibility/sky.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/terrain.frag b/files/shaders/compatibility/terrain.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/terrain.vert b/files/shaders/compatibility/terrain.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/vertexcolors.glsl b/files/shaders/compatibility/vertexcolors.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/water.frag b/files/shaders/compatibility/water.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/water.vert b/files/shaders/compatibility/water.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/core/gui.frag b/files/shaders/core/gui.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/core/gui.vert b/files/shaders/core/gui.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/core/ripples_blobber.comp b/files/shaders/core/ripples_blobber.comp-old mode 100644-new mode 100755-diff --git a/files/shaders/core/ripples_simulate.comp b/files/shaders/core/ripples_simulate.comp-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/fragment.glsl b/files/shaders/lib/core/fragment.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/fragment.h.glsl b/files/shaders/lib/core/fragment.h.glsl-old mode 100644-new mode 100755-index 1bc2a1f79ab..de41dbc7ab1---- a/files/shaders/lib/core/fragment.h.glsl-+++ b/files/shaders/lib/core/fragment.h.glsl-@@ -1,20 +1,43 @@- #ifndef OPENMW_FRAGMENT_H_GLSL- #define OPENMW_FRAGMENT_H_GLSL---@link "lib/core/fragment.glsl" if !@useOVR_multiview--@link "lib/core/fragment_multiview.glsl" if @useOVR_multiview-+uniform sampler2D reflectionMap;---vec4 sampleReflectionMap(vec2 uv);-+vec4 sampleReflectionMap(vec2 uv)-+{-+ return texture2D(reflectionMap, uv);-+}-- #if @refraction_enabled--vec4 sampleRefractionMap(vec2 uv);--float sampleRefractionDepthMap(vec2 uv);-+uniform sampler2D refractionMap;-+uniform highp sampler2D refractionDepthMap;-+-+vec4 sampleRefractionMap(vec2 uv)-+{-+ return texture2D(refractionMap, uv);-+}-+-+float sampleRefractionDepthMap(vec2 uv)-+{-+ return texture2D(refractionDepthMap, uv).x;-+}-+- #endif---vec4 samplerLastShader(vec2 uv);-+uniform sampler2D lastShader;-+-+vec4 samplerLastShader(vec2 uv)-+{-+ return texture2D(lastShader, uv);-+}-- #if @skyBlending--vec3 sampleSkyColor(vec2 uv);-+uniform sampler2D sky;-+-+vec3 sampleSkyColor(vec2 uv)-+{-+ return texture2D(sky, uv).xyz;-+}- #endif-- #endif // OPENMW_FRAGMENT_H_GLSL-diff --git a/files/shaders/lib/core/fragment_multiview.glsl b/files/shaders/lib/core/fragment_multiview.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/vertex.glsl b/files/shaders/lib/core/vertex.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/vertex.h.glsl b/files/shaders/lib/core/vertex.h.glsl-old mode 100644-new mode 100755-index 6e22f6deb15..c8a1080574d---- a/files/shaders/lib/core/vertex.h.glsl-+++ b/files/shaders/lib/core/vertex.h.glsl-@@ -1,6 +1,16 @@--@link "lib/core/vertex.glsl" if !@useOVR_multiview--@link "lib/core/vertex_multiview.glsl" if @useOVR_multiview-+uniform mat4 projectionMatrix;---vec4 modelToClip(vec4 pos);--vec4 modelToView(vec4 pos);--vec4 viewToClip(vec4 pos);-+vec4 modelToView(vec4 pos)-+{-+ return gl_ModelViewMatrix * pos;-+}-+-+vec4 modelToClip(vec4 pos)-+{-+ return projectionMatrix * modelToView(pos);-+}-+-+vec4 viewToClip(vec4 pos)-+{-+ return projectionMatrix * pos;-+}-diff --git a/files/shaders/lib/core/vertex_multiview.glsl b/files/shaders/lib/core/vertex_multiview.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/light/lighting.glsl b/files/shaders/lib/light/lighting.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/light/lighting_util.glsl b/files/shaders/lib/light/lighting_util.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/luminance/constants.glsl b/files/shaders/lib/luminance/constants.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/material/alpha.glsl b/files/shaders/lib/material/alpha.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/material/parallax.glsl b/files/shaders/lib/material/parallax.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/particle/occlusion.glsl b/files/shaders/lib/particle/occlusion.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/particle/soft.glsl b/files/shaders/lib/particle/soft.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/sky/passes.glsl b/files/shaders/lib/sky/passes.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/util/coordinates.glsl b/files/shaders/lib/util/coordinates.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/util/distortion.glsl b/files/shaders/lib/util/distortion.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/util/quickstep.glsl b/files/shaders/lib/util/quickstep.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/view/depth.glsl b/files/shaders/lib/view/depth.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/water/fresnel.glsl b/files/shaders/lib/water/fresnel.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/water/rain_ripples.glsl b/files/shaders/lib/water/rain_ripples.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/water/ripples.glsl b/files/shaders/lib/water/ripples.glsl-old mode 100644-new mode 100755diff --git a/android/buildscripts/patches/openmw/postprocessing1.patch b/android/buildscripts/patches/openmw/postprocessing1.patchdeleted file mode 100644index b682fb2..0000000--- a/android/buildscripts/patches/openmw/postprocessing1.patch+++ /dev/null@@ -1,541 +0,0 @@-From f9445de2faabd65f0685d8f795cce572b5187969 Mon Sep 17 00:00:00 2001-From: sisah <[email protected]>-Date: Mon, 1 Jan 2024 06:36:33 -0500-Subject: [PATCH] Postprocessing fixes, core shaders------ apps/openmw/mwrender/luminancecalculator.cpp | 4 +-- apps/openmw/mwrender/npcanimation.cpp | 2 +-- apps/openmw/mwrender/postprocessor.cpp | 6 +--- apps/openmw/mwrender/renderingmanager.cpp | 4 +-- apps/openmw/mwrender/transparentpass.cpp | 7 ++--- components/fx/parse_constants.hpp | 5 ++-- components/fx/pass.cpp | 2 +-- components/shader/shadervisitor.cpp | 10 +++++- files/data/shaders/bloomlinear.omwfx | 10 ++---- files/shaders/compatibility/bs/default.frag | 0- files/shaders/compatibility/bs/default.vert | 0- .../shaders/compatibility/bs/nolighting.frag | 0- .../shaders/compatibility/bs/nolighting.vert | 0- files/shaders/compatibility/debug.frag | 2 +-- files/shaders/compatibility/debug.vert | 2 +-- files/shaders/compatibility/depthclipped.frag | 0- files/shaders/compatibility/depthclipped.vert | 0- files/shaders/compatibility/fog.glsl | 0- .../shaders/compatibility/fullscreen_tri.frag | 0- .../shaders/compatibility/fullscreen_tri.vert | 2 +-- files/shaders/compatibility/groundcover.frag | 0- files/shaders/compatibility/groundcover.vert | 0- files/shaders/compatibility/gui.frag | 0- files/shaders/compatibility/gui.vert | 0- .../compatibility/luminance/luminance.frag | 0- .../compatibility/luminance/resolve.frag | 0- .../compatibility/multiview_resolve.frag | 0- .../compatibility/multiview_resolve.vert | 0- files/shaders/compatibility/normals.glsl | 0- files/shaders/compatibility/objects.frag | 8 ++--- files/shaders/compatibility/objects.vert | 0- .../compatibility/ripples_blobber.frag | 0- .../compatibility/ripples_simulate.frag | 0- files/shaders/compatibility/s360.frag | 0- files/shaders/compatibility/s360.vert | 0- .../shaders/compatibility/shadowcasting.frag | 0- .../shaders/compatibility/shadowcasting.vert | 0- .../compatibility/shadows_fragment.glsl | 0- .../shaders/compatibility/shadows_vertex.glsl | 0- files/shaders/compatibility/sky.frag | 0- files/shaders/compatibility/sky.vert | 0- files/shaders/compatibility/terrain.frag | 0- files/shaders/compatibility/terrain.vert | 0- files/shaders/compatibility/vertexcolors.glsl | 0- files/shaders/compatibility/water.frag | 0- files/shaders/compatibility/water.vert | 0- files/shaders/core/gui.frag | 0- files/shaders/core/gui.vert | 0- files/shaders/core/ripples_blobber.comp | 0- files/shaders/core/ripples_simulate.comp | 0- files/shaders/lib/core/fragment.glsl | 0- files/shaders/lib/core/fragment.h.glsl | 37 +++++++++++++++----- .../shaders/lib/core/fragment_multiview.glsl | 0- files/shaders/lib/core/vertex.glsl | 0- files/shaders/lib/core/vertex.h.glsl | 20 +++++++---- files/shaders/lib/core/vertex_multiview.glsl | 0- files/shaders/lib/light/lighting.glsl | 0- files/shaders/lib/light/lighting_util.glsl | 0- files/shaders/lib/luminance/constants.glsl | 0- files/shaders/lib/material/alpha.glsl | 0- files/shaders/lib/material/parallax.glsl | 0- files/shaders/lib/particle/occlusion.glsl | 0- files/shaders/lib/particle/soft.glsl | 0- files/shaders/lib/sky/passes.glsl | 0- files/shaders/lib/util/coordinates.glsl | 0- files/shaders/lib/util/distortion.glsl | 0- files/shaders/lib/util/quickstep.glsl | 0- files/shaders/lib/view/depth.glsl | 0- files/shaders/lib/water/fresnel.glsl | 0- files/shaders/lib/water/rain_ripples.glsl | 0- files/shaders/lib/water/ripples.glsl | 0- 71 files changed, 83 insertions(+), 38 deletions(-)- mode change 100644 => 100755 files/data/shaders/bloomlinear.omwfx- mode change 100644 => 100755 files/shaders/compatibility/bs/default.frag- mode change 100644 => 100755 files/shaders/compatibility/bs/default.vert- mode change 100644 => 100755 files/shaders/compatibility/bs/nolighting.frag- mode change 100644 => 100755 files/shaders/compatibility/bs/nolighting.vert- mode change 100644 => 100755 files/shaders/compatibility/debug.frag- mode change 100644 => 100755 files/shaders/compatibility/debug.vert- mode change 100644 => 100755 files/shaders/compatibility/depthclipped.frag- mode change 100644 => 100755 files/shaders/compatibility/depthclipped.vert- mode change 100644 => 100755 files/shaders/compatibility/fog.glsl- mode change 100644 => 100755 files/shaders/compatibility/fullscreen_tri.frag- mode change 100644 => 100755 files/shaders/compatibility/fullscreen_tri.vert- mode change 100644 => 100755 files/shaders/compatibility/groundcover.frag- mode change 100644 => 100755 files/shaders/compatibility/groundcover.vert- mode change 100644 => 100755 files/shaders/compatibility/gui.frag- mode change 100644 => 100755 files/shaders/compatibility/gui.vert- mode change 100644 => 100755 files/shaders/compatibility/luminance/luminance.frag- mode change 100644 => 100755 files/shaders/compatibility/luminance/resolve.frag- mode change 100644 => 100755 files/shaders/compatibility/multiview_resolve.frag- mode change 100644 => 100755 files/shaders/compatibility/multiview_resolve.vert- mode change 100644 => 100755 files/shaders/compatibility/normals.glsl- mode change 100644 => 100755 files/shaders/compatibility/objects.frag- mode change 100644 => 100755 files/shaders/compatibility/objects.vert- mode change 100644 => 100755 files/shaders/compatibility/ripples_blobber.frag- mode change 100644 => 100755 files/shaders/compatibility/ripples_simulate.frag- mode change 100644 => 100755 files/shaders/compatibility/s360.frag- mode change 100644 => 100755 files/shaders/compatibility/s360.vert- mode change 100644 => 100755 files/shaders/compatibility/shadowcasting.frag- mode change 100644 => 100755 files/shaders/compatibility/shadowcasting.vert- mode change 100644 => 100755 files/shaders/compatibility/shadows_fragment.glsl- mode change 100644 => 100755 files/shaders/compatibility/shadows_vertex.glsl- mode change 100644 => 100755 files/shaders/compatibility/sky.frag- mode change 100644 => 100755 files/shaders/compatibility/sky.vert- mode change 100644 => 100755 files/shaders/compatibility/terrain.frag- mode change 100644 => 100755 files/shaders/compatibility/terrain.vert- mode change 100644 => 100755 files/shaders/compatibility/vertexcolors.glsl- mode change 100644 => 100755 files/shaders/compatibility/water.frag- mode change 100644 => 100755 files/shaders/compatibility/water.vert- mode change 100644 => 100755 files/shaders/core/gui.frag- mode change 100644 => 100755 files/shaders/core/gui.vert- mode change 100644 => 100755 files/shaders/core/ripples_blobber.comp- mode change 100644 => 100755 files/shaders/core/ripples_simulate.comp- mode change 100644 => 100755 files/shaders/lib/core/fragment.glsl- mode change 100644 => 100755 files/shaders/lib/core/fragment.h.glsl- mode change 100644 => 100755 files/shaders/lib/core/fragment_multiview.glsl- mode change 100644 => 100755 files/shaders/lib/core/vertex.glsl- mode change 100644 => 100755 files/shaders/lib/core/vertex.h.glsl- mode change 100644 => 100755 files/shaders/lib/core/vertex_multiview.glsl- mode change 100644 => 100755 files/shaders/lib/light/lighting.glsl- mode change 100644 => 100755 files/shaders/lib/light/lighting_util.glsl- mode change 100644 => 100755 files/shaders/lib/luminance/constants.glsl- mode change 100644 => 100755 files/shaders/lib/material/alpha.glsl- mode change 100644 => 100755 files/shaders/lib/material/parallax.glsl- mode change 100644 => 100755 files/shaders/lib/particle/occlusion.glsl- mode change 100644 => 100755 files/shaders/lib/particle/soft.glsl- mode change 100644 => 100755 files/shaders/lib/sky/passes.glsl- mode change 100644 => 100755 files/shaders/lib/util/coordinates.glsl- mode change 100644 => 100755 files/shaders/lib/util/distortion.glsl- mode change 100644 => 100755 files/shaders/lib/util/quickstep.glsl- mode change 100644 => 100755 files/shaders/lib/view/depth.glsl- mode change 100644 => 100755 files/shaders/lib/water/fresnel.glsl- mode change 100644 => 100755 files/shaders/lib/water/rain_ripples.glsl- mode change 100644 => 100755 files/shaders/lib/water/ripples.glsl--diff --git a/apps/openmw/mwrender/luminancecalculator.cpp b/apps/openmw/mwrender/luminancecalculator.cpp-index ae29b7fdcc8..de4ac766f1b 100644---- a/apps/openmw/mwrender/luminancecalculator.cpp-+++ b/apps/openmw/mwrender/luminancecalculator.cpp-@@ -26,7 +26,7 @@ namespace MWRender- buffer.mipmappedSceneLuminanceTex = new osg::Texture2D;- buffer.mipmappedSceneLuminanceTex->setInternalFormat(GL_R16F);- buffer.mipmappedSceneLuminanceTex->setSourceFormat(GL_RED);-- buffer.mipmappedSceneLuminanceTex->setSourceType(GL_FLOAT);-+ buffer.mipmappedSceneLuminanceTex->setSourceType(GL_HALF_FLOAT);- buffer.mipmappedSceneLuminanceTex->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);- buffer.mipmappedSceneLuminanceTex->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);- buffer.mipmappedSceneLuminanceTex->setFilter(-@@ -37,7 +37,7 @@ namespace MWRender- buffer.luminanceTex = new osg::Texture2D;- buffer.luminanceTex->setInternalFormat(GL_R16F);- buffer.luminanceTex->setSourceFormat(GL_RED);-- buffer.luminanceTex->setSourceType(GL_FLOAT);-+ buffer.luminanceTex->setSourceType(GL_HALF_FLOAT);- buffer.luminanceTex->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);- buffer.luminanceTex->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);- buffer.luminanceTex->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::NEAREST);-diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp-index 01bdcec665e..20fd4aac692 100644---- a/apps/openmw/mwrender/npcanimation.cpp-+++ b/apps/openmw/mwrender/npcanimation.cpp-@@ -347,7 +347,7 @@ namespace MWRender- auto primaryFBO = postProcessor->getPrimaryFbo(frameId);- primaryFBO->apply(*state);--- postProcessor->getFbo(PostProcessor::FBO_OpaqueDepth, frameId)->apply(*state);-+ //postProcessor->getFbo(PostProcessor::FBO_OpaqueDepth, frameId)->apply(*state);-- // depth accumulation pass- osg::ref_ptr<osg::StateSet> restore = bin->getStateSet();-diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp-index 1aaeb460b7d..d3f4ed092c3 100644---- a/apps/openmw/mwrender/postprocessor.cpp-+++ b/apps/openmw/mwrender/postprocessor.cpp-@@ -300,7 +300,7 @@ namespace MWRender- mCanvases[frameId]->setCalculateAvgLum(mHDR);-- mCanvases[frameId]->setTextureScene(getTexture(Tex_Scene, frameId));-- mCanvases[frameId]->setTextureDepth(getTexture(Tex_OpaqueDepth, frameId));-+ mCanvases[frameId]->setTextureDepth(getTexture(Tex_Depth, frameId));- mCanvases[frameId]->setTextureDistortion(getTexture(Tex_Distortion, frameId));-- mTransparentDepthPostPass->mFbo[frameId] = mFbos[frameId][FBO_Primary];-@@ -407,12 +407,12 @@ namespace MWRender- mPrevPassLights = mPassLights;-- mViewer->stopThreading();---+/*- auto& shaderManager = MWBase::Environment::get().getResourceSystem()->getSceneManager()->getShaderManager();- auto defines = shaderManager.getGlobalDefines();- defines["disableNormals"] = mNormals ? "0" : "1";- shaderManager.setGlobalDefines(defines);---+*/- mRendering.getLightRoot()->setCollectPPLights(mPassLights);- mStateUpdater->bindPointLights(mPassLights ? mRendering.getLightRoot()->getPPLightsBuffer() : nullptr);- mStateUpdater->reset();-diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp-index 2cfcd2fd37f..6770a5c93e2 100644---- a/apps/openmw/mwrender/renderingmanager.cpp-+++ b/apps/openmw/mwrender/renderingmanager.cpp-@@ -463,8 +463,8 @@ namespace MWRender-- mPostProcessor = new PostProcessor(*this, viewer, mRootNode, resourceSystem->getVFS());- resourceSystem->getSceneManager()->setOpaqueDepthTex(-- mPostProcessor->getTexture(PostProcessor::Tex_OpaqueDepth, 0),-- mPostProcessor->getTexture(PostProcessor::Tex_OpaqueDepth, 1));-+ mPostProcessor->getTexture(PostProcessor::Tex_Depth, 0),-+ mPostProcessor->getTexture(PostProcessor::Tex_Depth, 1));- resourceSystem->getSceneManager()->setSoftParticles(Settings::shaders().mSoftParticles);- resourceSystem->getSceneManager()->setSupportsNormalsRT(mPostProcessor->getSupportsNormalsRT());- resourceSystem->getSceneManager()->setWeatherParticleOcclusion(Settings::shaders().mWeatherParticleOcclusion);-diff --git a/apps/openmw/mwrender/transparentpass.cpp b/apps/openmw/mwrender/transparentpass.cpp-index ce53b1c2193..cdda1d4fe39 100644---- a/apps/openmw/mwrender/transparentpass.cpp-+++ b/apps/openmw/mwrender/transparentpass.cpp-@@ -92,8 +92,9 @@ namespace MWRender- else- {- opaqueFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);-- ext->glBlitFramebuffer(0, 0, tex->getTextureWidth(), tex->getTextureHeight(), 0, 0, tex->getTextureWidth(),-- tex->getTextureHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST);-+ //ext->glBlitFramebuffer(0, 0, tex->getTextureWidth(), tex->getTextureHeight(), 0, 0, tex->getTextureWidth(),-+ //tex->getTextureHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST);-+ glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);- }-- msaaFbo ? msaaFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER)-@@ -105,7 +106,7 @@ namespace MWRender- if (!mPostPass)- return;--- opaqueFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);-+ //opaqueFbo->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);-- // draw transparent post-pass to populate a postprocess friendly depth texture with alpha-clipped geometry--diff --git a/components/fx/parse_constants.hpp b/components/fx/parse_constants.hpp-index 9be54ed3a76..55585f8106d 100644---- a/components/fx/parse_constants.hpp-+++ b/components/fx/parse_constants.hpp-@@ -35,7 +35,7 @@ namespace fx- { "bgra", GL_BGRA },- } };--- constexpr std::array<std::pair<std::string_view, int>, 9> SourceType = { {-+ constexpr std::array<std::pair<std::string_view, int>, 10> SourceType = { {- { "byte", GL_BYTE },- { "unsigned_byte", GL_UNSIGNED_BYTE },- { "short", GL_SHORT },-@@ -44,6 +44,7 @@ namespace fx- { "unsigned_int", GL_UNSIGNED_INT },- { "unsigned_int_24_8", GL_UNSIGNED_INT_24_8 },- { "float", GL_FLOAT },-+ { "half_float", GL_HALF_FLOAT },- { "double", GL_DOUBLE },- } };--@@ -129,4 +130,4 @@ namespace fx- }- }---#endif-\ No newline at end of file-+#endif-diff --git a/components/fx/pass.cpp b/components/fx/pass.cpp-index cf50d20fe22..20d090ef6cf 100644---- a/components/fx/pass.cpp-+++ b/components/fx/pass.cpp-@@ -89,7 +89,7 @@ namespace fx-- uniform @builtinSampler omw_SamplerLastShader;- uniform @builtinSampler omw_SamplerLastPass;--uniform @builtinSampler omw_SamplerDepth;-+uniform highp @builtinSampler omw_SamplerDepth;- uniform @builtinSampler omw_SamplerNormals;- uniform @builtinSampler omw_SamplerDistortion;--diff --git a/components/shader/shadervisitor.cpp b/components/shader/shadervisitor.cpp-index 70464f571e6..24ef8c8238c 100644---- a/components/shader/shadervisitor.cpp-+++ b/components/shader/shadervisitor.cpp-@@ -32,6 +32,9 @@- #include "removedalphafunc.hpp"- #include "shadermanager.hpp"--+#include <components/settings/values.hpp>-+#include <components/sceneutil/depth.hpp>-+- namespace Shader- {- /**-@@ -730,6 +733,13 @@ namespace Shader- updateRemovedState(*writableUserData, removedState);- }--+ if (reqs.mAlphaBlend && Settings::postProcessing().mTransparentPostpass && Settings::postProcessing().mEnabled)-+ {-+ osg::ref_ptr<osg::Depth> depth = new SceneUtil::AutoDepth;-+ depth->setWriteMask(false);-+ writableStateSet->setAttributeAndModes(depth, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);-+ }-+- defineMap["softParticles"] = reqs.mSoftParticles ? "1" : "0";-- Stereo::shaderStereoDefines(defineMap);-diff --git a/files/data/shaders/bloomlinear.omwfx b/files/data/shaders/bloomlinear.omwfx-old mode 100644-new mode 100755-index 3de7139f39a..4c583a9a898---- a/files/data/shaders/bloomlinear.omwfx-+++ b/files/data/shaders/bloomlinear.omwfx-@@ -80,8 +80,8 @@ shared {- radius = max(radius, 0.1);- // hack: make the radius wider on the screen edges- // (makes things in the corner of the screen look less "wrong" with not-extremely-low FOVs)-- radius *= pow(texcoord.x*2.0-1.0, 2)+1.0;-- radius *= pow(texcoord.y*2.0-1.0, 2)+1.0;-+ radius *= pow(texcoord.x*2.0-1.0, 2.0)+1.0;-+ radius *= pow(texcoord.y*2.0-1.0, 2.0)+1.0;- return radius;- }- vec3 powv(vec3 a, float x)-@@ -94,7 +94,7 @@ render_target RT_NoMipmap {- width_ratio = 0.25;- height_ratio = 0.25;- internal_format = rgb16f;-- source_type = float;-+ source_type = half_float;- source_format = rgb;- mipmaps = false;- min_filter = nearest;-@@ -105,7 +105,7 @@ render_target RT_Horizontal {- width_ratio = 0.25;- height_ratio = 0.25;- internal_format = rgb16f;-- source_type = float;-+ source_type = half_float;- source_format = rgb;- mipmaps = false;- min_filter = nearest;-@@ -116,7 +116,7 @@ render_target RT_Vertical {- width_ratio = 0.25;- height_ratio = 0.25;- internal_format = rgb16f;-- source_type = float;-+ source_type = half_float;- source_format = rgb;- mipmaps = false;- min_filter = linear;-diff --git a/files/shaders/compatibility/bs/default.frag b/files/shaders/compatibility/bs/default.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/bs/default.vert b/files/shaders/compatibility/bs/default.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/bs/nolighting.frag b/files/shaders/compatibility/bs/nolighting.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/bs/nolighting.vert b/files/shaders/compatibility/bs/nolighting.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/debug.frag b/files/shaders/compatibility/debug.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/depthclipped.frag b/files/shaders/compatibility/depthclipped.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/depthclipped.vert b/files/shaders/compatibility/depthclipped.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/fog.glsl b/files/shaders/compatibility/fog.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/fullscreen_tri.frag b/files/shaders/compatibility/fullscreen_tri.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/fullscreen_tri.vert b/files/shaders/compatibility/fullscreen_tri.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/groundcover.frag b/files/shaders/compatibility/groundcover.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/groundcover.vert b/files/shaders/compatibility/groundcover.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/gui.frag b/files/shaders/compatibility/gui.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/gui.vert b/files/shaders/compatibility/gui.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/luminance/luminance.frag b/files/shaders/compatibility/luminance/luminance.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/luminance/resolve.frag b/files/shaders/compatibility/luminance/resolve.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/multiview_resolve.frag b/files/shaders/compatibility/multiview_resolve.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/multiview_resolve.vert b/files/shaders/compatibility/multiview_resolve.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/normals.glsl b/files/shaders/compatibility/normals.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/objects.frag b/files/shaders/compatibility/objects.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/objects.vert b/files/shaders/compatibility/objects.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/ripples_blobber.frag b/files/shaders/compatibility/ripples_blobber.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/ripples_simulate.frag b/files/shaders/compatibility/ripples_simulate.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/s360.frag b/files/shaders/compatibility/s360.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/s360.vert b/files/shaders/compatibility/s360.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/shadowcasting.frag b/files/shaders/compatibility/shadowcasting.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/shadowcasting.vert b/files/shaders/compatibility/shadowcasting.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/shadows_fragment.glsl b/files/shaders/compatibility/shadows_fragment.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/shadows_vertex.glsl b/files/shaders/compatibility/shadows_vertex.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/sky.frag b/files/shaders/compatibility/sky.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/sky.vert b/files/shaders/compatibility/sky.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/terrain.frag b/files/shaders/compatibility/terrain.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/terrain.vert b/files/shaders/compatibility/terrain.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/vertexcolors.glsl b/files/shaders/compatibility/vertexcolors.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/water.frag b/files/shaders/compatibility/water.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/compatibility/water.vert b/files/shaders/compatibility/water.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/core/gui.frag b/files/shaders/core/gui.frag-old mode 100644-new mode 100755-diff --git a/files/shaders/core/gui.vert b/files/shaders/core/gui.vert-old mode 100644-new mode 100755-diff --git a/files/shaders/core/ripples_blobber.comp b/files/shaders/core/ripples_blobber.comp-old mode 100644-new mode 100755-diff --git a/files/shaders/core/ripples_simulate.comp b/files/shaders/core/ripples_simulate.comp-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/fragment.glsl b/files/shaders/lib/core/fragment.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/fragment.h.glsl b/files/shaders/lib/core/fragment.h.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/fragment_multiview.glsl b/files/shaders/lib/core/fragment_multiview.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/vertex.glsl b/files/shaders/lib/core/vertex.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/vertex.h.glsl b/files/shaders/lib/core/vertex.h.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/core/vertex_multiview.glsl b/files/shaders/lib/core/vertex_multiview.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/light/lighting.glsl b/files/shaders/lib/light/lighting.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/light/lighting_util.glsl b/files/shaders/lib/light/lighting_util.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/luminance/constants.glsl b/files/shaders/lib/luminance/constants.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/material/alpha.glsl b/files/shaders/lib/material/alpha.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/material/parallax.glsl b/files/shaders/lib/material/parallax.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/particle/occlusion.glsl b/files/shaders/lib/particle/occlusion.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/particle/soft.glsl b/files/shaders/lib/particle/soft.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/sky/passes.glsl b/files/shaders/lib/sky/passes.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/util/coordinates.glsl b/files/shaders/lib/util/coordinates.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/util/distortion.glsl b/files/shaders/lib/util/distortion.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/util/quickstep.glsl b/files/shaders/lib/util/quickstep.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/view/depth.glsl b/files/shaders/lib/view/depth.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/water/fresnel.glsl b/files/shaders/lib/water/fresnel.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/water/rain_ripples.glsl b/files/shaders/lib/water/rain_ripples.glsl-old mode 100644-new mode 100755-diff --git a/files/shaders/lib/water/ripples.glsl b/files/shaders/lib/water/ripples.glsl-old mode 100644-new mode 100755diff --git a/android/buildscripts/patches/openmw/psa.patch b/android/buildscripts/patches/openmw/psa.patchdeleted file mode 100644index 5029145..0000000--- a/android/buildscripts/patches/openmw/psa.patch+++ /dev/null@@ -1,21 +0,0 @@-diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp-index 9f572fde9..bdad92a2d 100644---- a/apps/openmw/mwstate/statemanagerimp.cpp-+++ b/apps/openmw/mwstate/statemanagerimp.cpp-@@ -14,6 +14,7 @@- #include <components/settings/settings.hpp>-- #include <osg/Image>-+#include <osg/Hint>-- #include <osgDB/Registry>--@@ -309,6 +310,8 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot- Settings::Manager::setString ("character", "Saves",- slot->mPath.parent_path().filename().string());--+ osg::Hint::GL4ES_SavePSA();-+- const auto finish = std::chrono::steady_clock::now();-- Log(Debug::Info) << '\'' << description << "' is saved in "diff --git a/android/buildscripts/patches/openmw/sdlfix.patch b/android/buildscripts/patches/openmw/sdlfix.patchdeleted file mode 100644index 4aec473..0000000--- a/android/buildscripts/patches/openmw/sdlfix.patch+++ /dev/null@@ -1,261 +0,0 @@-From: elsid <[email protected]>-Date: Fri, 24 Nov 2023 14:26:53 +0100-Subject: [PATCH] Use SDL2 generate cmake files to find the package------ CMakeLists.txt | 4 +-- apps/launcher/CMakeLists.txt | 2 +-- apps/openmw/CMakeLists.txt | 2 +-- cmake/FindSDL2.cmake | 129 -------------------- components/CMakeLists.txt | 2 +-- extern/oics/CMakeLists.txt | 2 +- extern/osg-ffmpeg-videoplayer/CMakeLists.txt | 1 +- 8 files changed, 11 insertions(+), 138 deletions(-)- delete mode 100644 cmake/FindSDL2.cmake--@@ -930,7 +929,7 @@ printf "SDL 2.24.0... "- rm -rf SDL2-2.24.0- eval 7z x -y SDL2-devel-2.24.0-VC.zip $STRIP- fi-- export SDL2DIR="$(real_pwd)/SDL2-2.24.0"-+ SDL2DIR="$(real_pwd)/SDL2-2.24.0"- for config in ${CONFIGURATIONS[@]}; do- add_runtime_dlls $config "$(pwd)/SDL2-2.24.0/lib/x${ARCHSUFFIX}/SDL2.dll"- done-@@ -1025,6 +1024,8 @@ printf "zlib 1.2.11... "- echo Done.- }--+add_cmake_opts -DCMAKE_PREFIX_PATH="\"${QT_SDK};${SDL2DIR}\""-+- echo- cd $DEPS_INSTALL/..- echo-diff --git a/CMakeLists.txt b/CMakeLists.txt-index 10d7fba386f..d61075c0573 100644---- a/CMakeLists.txt-+++ b/CMakeLists.txt-@@ -114,7 +114,6 @@ include(WholeArchive)- configure_file ("${OpenMW_SOURCE_DIR}/docs/mainpage.hpp.cmake" "${OpenMW_BINARY_DIR}/docs/mainpage.hpp")-- option(BOOST_STATIC "Link static build of Boost into the binaries" FALSE)--option(SDL2_STATIC "Link static build of SDL into the binaries" FALSE)- option(QT_STATIC "Link static build of Qt into the binaries" FALSE)-- option(OPENMW_USE_SYSTEM_BULLET "Use system provided bullet physics library" ON)-@@ -481,7 +480,6 @@ set(SOL_CONFIG_DIR ${OpenMW_SOURCE_DIR}/extern/sol_config)- include_directories(- BEFORE SYSTEM- "."-- ${SDL2_INCLUDE_DIR}- ${Boost_INCLUDE_DIR}- ${MyGUI_INCLUDE_DIRS}- ${OPENAL_INCLUDE_DIR}-@@ -493,7 +491,7 @@ include_directories(- ${ICU_INCLUDE_DIRS}- )---link_directories(${SDL2_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS} ${COLLADA_DOM_LIBRARY_DIRS})-+link_directories(${Boost_LIBRARY_DIRS} ${COLLADA_DOM_LIBRARY_DIRS})-- if(MYGUI_STATIC)- add_definitions(-DMYGUI_STATIC)-diff --git a/apps/launcher/CMakeLists.txt b/apps/launcher/CMakeLists.txt-index 87cee06e5d5..daae65dc668 100644---- a/apps/launcher/CMakeLists.txt-+++ b/apps/launcher/CMakeLists.txt-@@ -77,7 +77,7 @@ if (WIN32)- endif (WIN32)-- target_link_libraries(openmw-launcher-- ${SDL2_LIBRARY_ONLY}-+ SDL2::SDL2- ${OPENAL_LIBRARY}- components_qt- )-diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt-index 7e1c39f3df1..db44b91159e 100644---- a/apps/openmw/CMakeLists.txt-+++ b/apps/openmw/CMakeLists.txt-@@ -150,7 +150,7 @@ target_link_libraries(openmw- ${OPENAL_LIBRARY}- ${FFmpeg_LIBRARIES}- ${MyGUI_LIBRARIES}-- ${SDL2_LIBRARY}-+ SDL2::SDL2- ${RecastNavigation_LIBRARIES}- "osg-ffmpeg-videoplayer"- "oics"-diff --git a/cmake/FindSDL2.cmake b/cmake/FindSDL2.cmake-deleted file mode 100644-index 4f2be8c421a..00000000000---- a/cmake/FindSDL2.cmake-+++ /dev/null-@@ -1,129 +0,0 @@--# Locate SDL2 library--# This module defines--# SDL2_LIBRARY, the SDL2 library, with no other libraries--# SDL2_LIBRARIES, the SDL library and required components with compiler flags--# SDL2_FOUND, if false, do not try to link to SDL2--# SDL2_INCLUDE_DIR, where to find SDL.h--# SDL2_VERSION, the version of the found library--#--# This module accepts the following env variables--# SDL2DIR - Can be set to ./configure --prefix=$SDL2DIR used in building SDL2. l.e.galup 9-20-02--# This module responds to the the flag:--# SDL2_BUILDING_LIBRARY--# If this is defined, then no SDL2_main will be linked in because--# only applications need main().--# Otherwise, it is assumed you are building an application and this--# module will attempt to locate and set the the proper link flags--# as part of the returned SDL2_LIBRARIES variable.--#--# Don't forget to include SDL2main.h and SDL2main.m your project for the--# OS X framework based version. (Other versions link to -lSDL2main which--# this module will try to find on your behalf.) Also for OS X, this--# module will automatically add the -framework Cocoa on your behalf.--#--#--# Modified by Eric Wing.--# Added code to assist with automated building by using environmental variables--# and providing a more controlled/consistent search behavior.--# Added new modifications to recognize OS X frameworks and--# additional Unix paths (FreeBSD, etc).--# Also corrected the header search path to follow "proper" SDL2 guidelines.--# Added a search for SDL2main which is needed by some platforms.--# Added a search for threads which is needed by some platforms.--# Added needed compile switches for MinGW.--#--# On OSX, this will prefer the Framework version (if found) over others.--# People will have to manually change the cache values of--# SDL2_LIBRARY to override this selection or set the CMake environment--# CMAKE_INCLUDE_PATH to modify the search paths.--#--# Note that the header path has changed from SDL2/SDL.h to just SDL.h--# This needed to change because "proper" SDL2 convention--# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability--# reasons because not all systems place things in SDL2/ (see FreeBSD).--#--# Ported by Johnny Patterson. This is a literal port for SDL2 of the FindSDL.cmake--# module with the minor edit of changing "SDL" to "SDL2" where necessary. This--# was not created for redistribution, and exists temporarily pending official--# SDL2 CMake modules.----#=============================================================================--# Copyright 2003-2009 Kitware, Inc.--#--# Distributed under the OSI-approved BSD License (the "License");--# see accompanying file Copyright.txt for details.--#--# This software is distributed WITHOUT ANY WARRANTY; without even the--# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.--# See the License for more information.--#=============================================================================--# (To distribute this file outside of CMake, substitute the full--# License text for the above reference.)------if (CMAKE_SIZEOF_VOID_P EQUAL 8)-- set(_sdl_lib_suffix lib/x64)--else()-- set(_sdl_lib_suffix lib/x86)--endif()----libfind_pkg_detect(SDL2 sdl2-- FIND_PATH SDL.h-- HINTS $ENV{SDL2DIR}-- PATH_SUFFIXES include SDL2 include/SDL2-- FIND_LIBRARY SDL2-- HINTS $ENV{SDL2DIR}-- PATH_SUFFIXES lib ${_sdl_lib_suffix}--)--libfind_version_n_header(SDL2 NAMES SDL_version.h DEFINES SDL_MAJOR_VERSION SDL_MINOR_VERSION SDL_PATCHLEVEL)----IF(NOT SDL2_BUILDING_LIBRARY AND NOT APPLE)-- # Non-OS X framework versions expect you to also dynamically link to-- # SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms-- # seem to provide SDL2main for compatibility even though they don't-- # necessarily need it.-- libfind_pkg_detect(SDL2MAIN sdl2-- FIND_LIBRARY SDL2main-- HINTS $ENV{SDL2DIR}-- PATH_SUFFIXES lib ${_sdl_lib_suffix}-- )-- set(SDL2MAIN_FIND_QUIETLY TRUE)-- libfind_process(SDL2MAIN)-- list(APPEND SDL2_PROCESS_LIBS SDL2MAIN_LIBRARY)--ENDIF()------set(SDL2_TARGET_SPECIFIC)----if (APPLE)-- # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.-- list(APPEND SDL2_TARGET_SPECIFIC "-framework Cocoa")--else()-- # SDL2 may require threads on your system.-- # The Apple build may not need an explicit flag because one of the-- # frameworks may already provide it.-- # But for non-OSX systems, I will use the CMake Threads package.-- libfind_package(SDL2 Threads)-- list(APPEND SDL2_TARGET_SPECIFIC ${CMAKE_THREAD_LIBS_INIT})--endif()----# MinGW needs an additional library, mwindows--# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows--# (Actually on second look, I think it only needs one of the m* libraries.)--if(MINGW)-- list(APPEND SDL2_TARGET_SPECIFIC mingw32)--endif()----if(WIN32)-- list(APPEND SDL2_TARGET_SPECIFIC winmm imm32 version msimg32)--endif()----set(SDL2_PROCESS_LIBS SDL2_TARGET_SPECIFIC)----libfind_process(SDL2)----if (SDL2_STATIC AND UNIX AND NOT APPLE)-- execute_process(COMMAND sdl2-config --static-libs OUTPUT_VARIABLE SDL2_STATIC_FLAGS)-- string(REGEX REPLACE "(\r?\n)+$" "" SDL2_STATIC_FLAGS "${SDL2_STATIC_FLAGS}")-- set(SDL2_LIBRARIES ${SDL2_STATIC_FLAGS})--endif()-diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt-index 85f6c264494..c9c74957ece 100644---- a/components/CMakeLists.txt-+++ b/components/CMakeLists.txt-@@ -556,7 +556,7 @@ target_link_libraries(components- ${Boost_PROGRAM_OPTIONS_LIBRARY}- ${Boost_IOSTREAMS_LIBRARY}--- ${SDL2_LIBRARIES}-+ SDL2::SDL2- ${OPENGL_gl_LIBRARY}- ${MyGUI_LIBRARIES}- ${LUA_LIBRARIES}-diff --git a/extern/oics/CMakeLists.txt b/extern/oics/CMakeLists.txt-index 1b9fea9217f..4bd3bc51ad6 100644---- a/extern/oics/CMakeLists.txt-+++ b/extern/oics/CMakeLists.txt-@@ -20,6 +20,8 @@ else()- target_link_libraries(oics local_tinyxml)- endif()--+target_link_libraries(oics SDL2::SDL2)-+- if (MSVC)- target_precompile_headers(oics PUBLIC <algorithm> <string>)- endif()-diff --git a/extern/osg-ffmpeg-videoplayer/CMakeLists.txt b/extern/osg-ffmpeg-videoplayer/CMakeLists.txt-index 7e2712f19b7..10c8d356a07 100644---- a/extern/osg-ffmpeg-videoplayer/CMakeLists.txt-+++ b/extern/osg-ffmpeg-videoplayer/CMakeLists.txt-@@ -14,6 +14,7 @@ include_directories(${FFmpeg_INCLUDE_DIRS})- add_library(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} STATIC ${OSG_FFMPEG_VIDEOPLAYER_SOURCE_FILES})- target_link_libraries(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} ${FFmpeg_LIBRARIES})- target_link_libraries(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} ${OSG_LIBRARIES})-+target_link_libraries(${OSG_FFMPEG_VIDEOPLAYER_LIBRARY} SDL2::SDL2)-- link_directories(${CMAKE_CURRENT_BINARY_DIR})-diff --git a/android/buildscripts/patches/openmw/shader_ripples.patch b/android/buildscripts/patches/openmw/shader_ripples.patchdeleted file mode 100644index 5f0b1c2..0000000--- a/android/buildscripts/patches/openmw/shader_ripples.patch+++ /dev/null@@ -1,283 +0,0 @@-From ea9f7f82ae33fe8e3ab0bc1486bba2d675c3d209 Mon Sep 17 00:00:00 2001-From: sisah <[email protected]>-Date: Sat, 15 Apr 2023 04:31:17 -0400-Subject: [PATCH] add shader ripples toggle------ apps/openmw/mwrender/water.cpp | 10 +-- components/settings/categories/water.hpp | 1 +- files/data/l10n/OMWEngine/en.yaml | 1 +- .../data/mygui/openmw_settings_window.layout | 14 ++- files/settings-default.cfg | 3 +- files/shaders/CMakeLists.txt | 1 +- files/shaders/compatibility/water.frag | 8 +-- files/shaders/lib/water/rain_ripples_old.glsl | 126 ++++++++++++++++++- 8 files changed, 160 insertions(+), 4 deletions(-)- create mode 100755 files/shaders/lib/water/rain_ripples_old.glsl--diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp-index 5c57764c801..7151f8810fd 100644---- a/apps/openmw/mwrender/water.cpp-+++ b/apps/openmw/mwrender/water.cpp-@@ -543,9 +543,12 @@ namespace MWRender- mParent->addChild(mRefraction);- }--- mRipples = new Ripples(mResourceSystem);-- mSimulation->setRipples(mRipples);-- mParent->addChild(mRipples);-+ if(Settings::Manager::getBool("shader ripples", "Water")-+ {-+ mRipples = new Ripples(mResourceSystem);-+ mSimulation->setRipples(mRipples);-+ mParent->addChild(mRipples);-+ }-- showWorld(mShowWorld);--@@ -694,6 +697,7 @@ namespace MWRender- defineMap["rain_ripple_detail"] = std::to_string(rippleDetail);- defineMap["ripple_map_world_scale"] = std::to_string(RipplesSurface::mWorldScaleFactor);- defineMap["ripple_map_size"] = std::to_string(RipplesSurface::mRTTSize) + ".0";-+ defineMap["shader_ripples"] = Settings::Manager::getBool("shader ripples", "Water") ? "1" : "0";-- Stereo::Manager::instance().shaderStereoDefines(defineMap);--diff --git a/components/settings/categories/water.hpp b/components/settings/categories/water.hpp-index 97c466bc615..2a3e0d5734d 100644---- a/components/settings/categories/water.hpp-+++ b/components/settings/categories/water.hpp-@@ -17,6 +17,7 @@ namespace Settings- struct WaterCategory- {- SettingValue<bool> mShader{ "Water", "shader" };-+ SettingValue<bool> mShaderRipples{ "Water", "shader ripples" };- SettingValue<int> mRttSize{ "Water", "rtt size", makeMaxSanitizerInt(1) };- SettingValue<bool> mRefraction{ "Water", "refraction" };- SettingValue<int> mReflectionDetail{ "Water", "reflection detail", makeEnumSanitizerInt({ 0, 1, 2, 3, 4, 5 }) };-diff --git a/files/data/l10n/OMWEngine/en.yaml b/files/data/l10n/OMWEngine/en.yaml-index 80d45ba94e6..0216c1cacb4 100644---- a/files/data/l10n/OMWEngine/en.yaml-+++ b/files/data/l10n/OMWEngine/en.yaml-@@ -149,6 +149,7 @@ VSync: "VSync"- VSyncAdaptive: "Adaptive"- Water: "Water"- WaterShader: "Water shader"-+WaterShaderRipples: "Water shader ripples"- WaterShaderTextureQuality: "Texture quality"- WindowBorder: "Window Border"- WindowMode: "Window Mode"-diff --git a/files/data/mygui/openmw_settings_window.layout b/files/data/mygui/openmw_settings_window.layout-index 565803130ec..154c1de168c 100755---- a/files/data/mygui/openmw_settings_window.layout-+++ b/files/data/mygui/openmw_settings_window.layout-@@ -483,6 +483,20 @@- </Widget>- </Widget>--+ <Widget type="HBox" align="Stretch">-+ <UserString key="HStretch" value="true"/>-+ <UserString key="VStretch" value="false"/>-+-+ <Widget type="AutoSizedButton" skin="MW_Button">-+ <UserString key="SettingCategory" value="Water"/>-+ <UserString key="SettingName" value="shader ripples"/>-+ <UserString key="SettingType" value="CheckButton"/>-+ </Widget>-+ <Widget type="AutoSizedTextBox" skin="SandText">-+ <Property key="Caption" value="#{OMWEngine:WaterShaderRipples}"/>-+ </Widget>-+ </Widget>-+- <Widget type="HBox" align="Stretch">- <UserString key="HStretch" value="true"/>- <UserString key="VStretch" value="false"/>-diff --git a/files/settings-default.cfg b/files/settings-default.cfg-index 86287104652..712eb441680 100644---- a/files/settings-default.cfg-+++ b/files/settings-default.cfg-@@ -651,6 +651,9 @@ screenshot type = regular- # Enable water shader with reflections and optionally refraction.- shader = false--+# Enable shader ripples.-+shader ripples = false-+- # Reflection and refraction texture size in pixels. (512, 1024, 2048).- rtt size = 512--diff --git a/files/shaders/CMakeLists.txt b/files/shaders/CMakeLists.txt-index 5ecb584d04b..f358c6dfcf0 100644---- a/files/shaders/CMakeLists.txt-+++ b/files/shaders/CMakeLists.txt-@@ -9,6 +9,7 @@ set(DDIRRELATIVE resources/shaders)- set(SHADER_FILES- lib/water/fresnel.glsl- lib/water/rain_ripples.glsl-+ lib/water/rain_ripples_old.glsl- lib/water/ripples.glsl- lib/view/depth.glsl- lib/luminance/constants.glsl-diff --git a/files/shaders/compatibility/water.frag b/files/shaders/compatibility/water.frag-index 6db51106fdc..5ba9ee2a544 100755---- a/files/shaders/compatibility/water.frag-+++ b/files/shaders/compatibility/water.frag-@@ -89,7 +89,11 @@ uniform vec2 screenRes;- #include "lib/light/lighting.glsl"- #include "fog.glsl"- #include "lib/water/fresnel.glsl"--#include "lib/water/rain_ripples.glsl"-+#if @shader_ripples-+ #include "lib/water/rain_ripples.glsl"-+#else-+ #include "lib/water/rain_ripples_old.glsl"-+#endif- #include "lib/view/depth.glsl"-- void main(void)-@@ -119,11 +123,13 @@ void main(void)-- vec3 rippleAdd = rainRipple.xyz * 10.0;--+#if @shader_ripples- float distToCenter = length(rippleMapUV - vec2(0.5));- float blendClose = smoothstep(0.001, 0.02, distToCenter);- float blendFar = 1.0 - smoothstep(0.3, 0.4, distToCenter);- float distortionLevel = 2.0;- rippleAdd += distortionLevel * vec3(texture2D(rippleMap, rippleMapUV).ba * blendFar * blendClose, 0.0);-+#endif-- vec2 bigWaves = vec2(BIG_WAVES_X,BIG_WAVES_Y);- vec2 midWaves = mix(vec2(MID_WAVES_X,MID_WAVES_Y),vec2(MID_WAVES_RAIN_X,MID_WAVES_RAIN_Y),rainIntensity);-diff --git a/files/shaders/lib/water/rain_ripples_old.glsl b/files/shaders/lib/water/rain_ripples_old.glsl-new file mode 100755-index 00000000000..4e5f85017be---- /dev/null-+++ b/files/shaders/lib/water/rain_ripples_old.glsl-@@ -0,0 +1,126 @@-+#ifndef LIB_WATER_RIPPLES-+#define LIB_WATER_RIPPLES-+-+#define RAIN_RIPPLE_DETAIL @rain_ripple_detail-+-+const float RAIN_RIPPLE_GAPS = 10.0;-+const float RAIN_RIPPLE_RADIUS = 0.2;-+-+float scramble(float x, float z)-+{-+ return fract(pow(fract(x)*3.0+1.0, z));-+}-+-+vec2 randOffset(vec2 c, float time)-+{-+ time = fract(time/1000.0);-+ c = vec2(c.x * c.y / 8.0 + c.y * 0.3 + c.x * 0.2,-+ c.x * c.y / 14.0 + c.y * 0.5 + c.x * 0.7);-+ c.x *= scramble(scramble(time + c.x/1000.0, 4.0), 3.0) + 1.0;-+ c.y *= scramble(scramble(time + c.y/1000.0, 3.5), 3.0) + 1.0;-+ return fract(c);-+}-+-+float randPhase(vec2 c)-+{-+ return fract((c.x * c.y) / (c.x + c.y + 0.1));-+}-+-+float blip(float x)-+{-+ x = max(0.0, 1.0-x*x);-+ return x*x*x;-+}-+-+float blipDerivative(float x)-+{-+ x = clamp(x, -1.0, 1.0);-+ float n = x*x-1.0;-+ return -6.0*x*n*n;-+}-+-+const float RAIN_RING_TIME_OFFSET = 1.0/6.0;-+-+vec4 circle(vec2 coords, vec2 corner, float adjusted_time)-+{-+ vec2 center = vec2(0.5,0.5) + (0.5 - RAIN_RIPPLE_RADIUS) * (2.0 * randOffset(corner, floor(adjusted_time)) - 1.0);-+ float phase = fract(adjusted_time);-+ vec2 toCenter = coords - center;-+-+ float r = RAIN_RIPPLE_RADIUS;-+ float d = length(toCenter);-+ float ringfollower = (phase-d/r)/RAIN_RING_TIME_OFFSET-1.0; // -1.0 ~ +1.0 cover the breadth of the ripple's ring-+-+#if RAIN_RIPPLE_DETAIL > 0-+// normal mapped ripples-+ if(ringfollower < -1.0 || ringfollower > 1.0)-+ return vec4(0.0);-+-+ if(d > 1.0) // normalize center direction vector, but not for near-center ripples-+ toCenter /= d;-+-+ float height = blip(ringfollower*2.0+0.5); // brighten up outer edge of ring; for fake specularity-+ float range_limit = blip(min(0.0, ringfollower));-+ float energy = 1.0-phase;-+-+ vec2 normal2d = -toCenter*blipDerivative(ringfollower)*5.0;-+ vec3 normal = vec3(normal2d, 0.5);-+ vec4 ret = vec4(normal, height);-+ ret.xyw *= energy*energy;-+ // do energy adjustment here rather than later, so that we can use the w component for fake specularity-+ ret.xyz = normalize(ret.xyz) * energy*range_limit;-+ ret.z *= range_limit;-+ return ret;-+#else-+// ring-only ripples-+ if(ringfollower < -1.0 || ringfollower > 0.5)-+ return vec4(0.0);-+-+ float energy = 1.0-phase;-+ float height = blip(ringfollower*2.0+0.5)*energy*energy; // fake specularity-+-+ return vec4(0.0, 0.0, 0.0, height);-+#endif-+}-+vec4 rain(vec2 uv, float time)-+{-+ uv *= RAIN_RIPPLE_GAPS;-+ vec2 f_part = fract(uv);-+ vec2 i_part = floor(uv);-+ float adjusted_time = time * 1.2 + randPhase(i_part);-+#if RAIN_RIPPLE_DETAIL > 0-+ vec4 a = circle(f_part, i_part, adjusted_time);-+ vec4 b = circle(f_part, i_part, adjusted_time - RAIN_RING_TIME_OFFSET);-+ vec4 c = circle(f_part, i_part, adjusted_time - RAIN_RING_TIME_OFFSET*2.0);-+ vec4 d = circle(f_part, i_part, adjusted_time - RAIN_RING_TIME_OFFSET*3.0);-+ vec4 ret;-+ ret.xy = a.xy - b.xy/2.0 + c.xy/4.0 - d.xy/8.0;-+ // z should always point up-+ ret.z = a.z + b.z /2.0 + c.z /4.0 + d.z /8.0;-+ //ret.xyz *= 1.5;-+ // fake specularity looks weird if we use every single ring, also if the inner rings are too bright-+ ret.w = (a.w + c.w /8.0)*1.5;-+ return ret;-+#else-+ return circle(f_part, i_part, adjusted_time) * 1.5;-+#endif-+}-+-+vec2 complex_mult(vec2 a, vec2 b)-+{-+ return vec2(a.x*b.x - a.y*b.y, a.x*b.y + a.y*b.x);-+}-+vec4 rainCombined(vec2 uv, float time) // returns ripple normal in xyz and fake specularity in w-+{-+ return-+ rain(uv, time)-+ + rain(complex_mult(uv, vec2(0.4, 0.7)) + vec2(1.2, 3.0),time)-+ #if RAIN_RIPPLE_DETAIL == 2-+ + rain(uv * 0.75 + vec2( 3.7,18.9),time)-+ + rain(uv * 0.9 + vec2( 5.7,30.1),time)-+ + rain(uv * 1.0 + vec2(10.5 ,5.7),time)-+ #endif-+ ;-+}-+-+#endifdiff --git a/android/buildscripts/patches/openmw/shaders.patch b/android/buildscripts/patches/openmw/shaders.patchdeleted file mode 100644index dad64ff..0000000--- a/android/buildscripts/patches/openmw/shaders.patch+++ /dev/null@@ -1,337 +0,0 @@-From bbd346e0111367653cb952fec867a9dc38bbcf88 Mon Sep 17 00:00:00 2001-From: Duron27 <[email protected]>-Date: Thu, 15 Feb 2024 02:14:12 -0500-Subject: [PATCH] shaders--yep----- files/shaders/compatibility/bs/default.frag | 2 +-- files/shaders/compatibility/bs/default.vert | 2 +-- .../shaders/compatibility/bs/nolighting.vert | 2 +-- files/shaders/compatibility/debug.frag | 2 +-- files/shaders/compatibility/debug.vert | 2 +-- .../shaders/compatibility/fullscreen_tri.vert | 2 +-- files/shaders/compatibility/groundcover.vert | 2 +-- files/shaders/compatibility/objects.frag | 10 ++---- files/shaders/compatibility/objects.vert | 2 +-- files/shaders/compatibility/terrain.frag | 2 +-- files/shaders/compatibility/terrain.vert | 2 +-- files/shaders/compatibility/water.frag | 22 +----------- files/shaders/lib/core/fragment.h.glsl | 37 +++++++++++++++----- files/shaders/lib/core/vertex.h.glsl | 20 +++++++---- 14 files changed, 62 insertions(+), 47 deletions(-)--diff --git a/files/shaders/compatibility/bs/default.frag b/files/shaders/compatibility/bs/default.frag-index 77131c6a52c..ec5f5c89780 100644---- a/files/shaders/compatibility/bs/default.frag-+++ b/files/shaders/compatibility/bs/default.frag-@@ -80,7 +80,7 @@ void main()- vec3 viewNormal = normalToView(normalTex.xyz * 2.0 - 1.0);- specularColor *= normalTex.a;- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- float shadowing = unshadowedLightRatio(linearDepth);-diff --git a/files/shaders/compatibility/bs/default.vert b/files/shaders/compatibility/bs/default.vert-index 21942ec91e8..d9d47843c09 100644---- a/files/shaders/compatibility/bs/default.vert-+++ b/files/shaders/compatibility/bs/default.vert-@@ -69,7 +69,7 @@ void main(void)--- #if @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- setupShadowCoords(viewPos, viewNormal);- #endif- }-diff --git a/files/shaders/compatibility/bs/nolighting.vert b/files/shaders/compatibility/bs/nolighting.vert-index 57cedc6e948..3b0fa7b6261 100644---- a/files/shaders/compatibility/bs/nolighting.vert-+++ b/files/shaders/compatibility/bs/nolighting.vert-@@ -63,7 +63,7 @@ void main(void)- }-- #if @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalize((gl_NormalMatrix * gl_Normal).xyz);- setupShadowCoords(viewPos, viewNormal);- #endif- }-diff --git a/files/shaders/compatibility/debug.frag b/files/shaders/compatibility/debug.frag-index a92b406d46b..041562fc0e2 100644---- a/files/shaders/compatibility/debug.frag-+++ b/files/shaders/compatibility/debug.frag-@@ -4,7 +4,7 @@-- varying vec3 vertexNormal;---uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- void main()- {-diff --git a/files/shaders/compatibility/debug.vert b/files/shaders/compatibility/debug.vert-index 47d5337a66f..a1fa462f397 100644---- a/files/shaders/compatibility/debug.vert-+++ b/files/shaders/compatibility/debug.vert-@@ -6,7 +6,7 @@ uniform vec3 color;- uniform vec3 trans;- uniform vec3 scale;- uniform bool useNormalAsColor;--uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- centroid varying vec4 passColor;- varying vec3 vertexNormal;-diff --git a/files/shaders/compatibility/fullscreen_tri.vert b/files/shaders/compatibility/fullscreen_tri.vert-index 3174384212e..8510a0933c1 100644---- a/files/shaders/compatibility/fullscreen_tri.vert-+++ b/files/shaders/compatibility/fullscreen_tri.vert-@@ -1,6 +1,6 @@- #version 120---uniform vec2 scaling = vec2(1.0, 1.0);-+uniform vec2 scaling;// = vec2(1.0, 1.0);-- varying vec2 uv;--diff --git a/files/shaders/compatibility/groundcover.vert b/files/shaders/compatibility/groundcover.vert-index 8cf53a19e05..95a17b50849 100644---- a/files/shaders/compatibility/groundcover.vert-+++ b/files/shaders/compatibility/groundcover.vert-@@ -156,7 +156,7 @@ void main(void)- #endif-- #if (!PER_PIXEL_LIGHTING || @shadows_enabled)-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if @diffuseMap-diff --git a/files/shaders/compatibility/objects.frag b/files/shaders/compatibility/objects.frag-index 56c7abf27c7..8966a84bf05 100644---- a/files/shaders/compatibility/objects.frag-+++ b/files/shaders/compatibility/objects.frag-@@ -84,11 +84,11 @@ varying vec3 passNormal;- #if @normalMap || @diffuseParallax- varying vec4 passTangent;- #endif---+/*- #if @additiveBlending- #define ADDITIVE_BLENDING- #endif---+*/- #include "lib/light/lighting.glsl"- #include "lib/material/parallax.glsl"- #include "lib/material/alpha.glsl"-@@ -109,11 +109,11 @@ uniform float softFalloffDepth;-- #if @particleOcclusion- #include "lib/particle/occlusion.glsl"--uniform sampler2D orthoDepthMap;-+uniform highp sampler2D orthoDepthMap;- varying vec3 orthoDepthMapCoord;- #endif---uniform sampler2D opaqueDepthTex;-+uniform highp sampler2D opaqueDepthTex;-- void main()- {-@@ -169,7 +169,7 @@ vec2 screenCoords = gl_FragCoord.xy / screenRes;- #if @normalMap- vec3 viewNormal = normalToView(texture2D(normalMap, normalMapUV + offset).xyz * 2.0 - 1.0);- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- vec3 viewVec = normalize(passViewPos);-diff --git a/files/shaders/compatibility/objects.vert b/files/shaders/compatibility/objects.vert-index 081ff909cf0..2bebcd60bf2 100644---- a/files/shaders/compatibility/objects.vert-+++ b/files/shaders/compatibility/objects.vert-@@ -101,7 +101,7 @@ void main(void)- #endif-- #if @envMap || !PER_PIXEL_LIGHTING || @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if @envMap-diff --git a/files/shaders/compatibility/terrain.frag b/files/shaders/compatibility/terrain.frag-index abc7425eb05..38b985223e4 100644---- a/files/shaders/compatibility/terrain.frag-+++ b/files/shaders/compatibility/terrain.frag-@@ -65,7 +65,7 @@ void main()- #if @normalMap- vec3 viewNormal = normalToView(texture2D(normalMap, adjustedUV).xyz * 2.0 - 1.0);- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- float shadowing = unshadowedLightRatio(linearDepth);-diff --git a/files/shaders/compatibility/terrain.vert b/files/shaders/compatibility/terrain.vert-index cbfb7769ba5..3b2cb16db49 100644---- a/files/shaders/compatibility/terrain.vert-+++ b/files/shaders/compatibility/terrain.vert-@@ -52,7 +52,7 @@ void main(void)- #endif-- #if !PER_PIXEL_LIGHTING || @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if !PER_PIXEL_LIGHTING-diff --git a/files/shaders/compatibility/water.frag b/files/shaders/compatibility/water.frag-index c971f92b997..5817b0c5aef 100644---- a/files/shaders/compatibility/water.frag-+++ b/files/shaders/compatibility/water.frag-@@ -17,8 +17,6 @@- // tweakables -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ---- const float VISIBILITY = 2500.0;--const float VISIBILITY_DEPTH = VISIBILITY * 1.5;--const float DEPTH_FADE = 0.15;-- const float BIG_WAVES_X = 0.1; // strength of big waves- const float BIG_WAVES_Y = 0.1;-@@ -50,7 +48,6 @@ const float SUN_SPEC_FADING_THRESHOLD = 0.15; // visibility at which sun s- const float SPEC_HARDNESS = 256.0; // specular highlights hardness-- const float BUMP_SUPPRESS_DEPTH = 300.0; // at what water depth bumpmap will be suppressed for reflections and refractions (prevents artifacts at shores)--const float REFR_FOG_DISTORT_DISTANCE = 3000.0; // at what distance refraction fog will be calculated using real water depth instead of distorted depth (prevents splotchy shores)-- const vec2 WIND_DIR = vec2(0.5f, -0.8f);- const float WIND_SPEED = 0.2f;-@@ -163,10 +160,9 @@ void main(void)- vec2 screenCoordsOffset = normal.xy * REFL_BUMP;- #if REFRACTION- float depthSample = linearizeDepth(sampleRefractionDepthMap(screenCoords), near, far) * radialise;-+ float depthSampleDistorted = linearizeDepth(sampleRefractionDepthMap(screenCoords-screenCoordsOffset), near, far) * radialise;- float surfaceDepth = linearizeDepth(gl_FragCoord.z, near, far) * radialise;- float realWaterDepth = depthSample - surfaceDepth; // undistorted water depth in view direction, independent of frustum-- float depthSampleDistorted = linearizeDepth(sampleRefractionDepthMap(screenCoords - screenCoordsOffset), near, far) * radialise;-- float waterDepthDistorted = max(depthSampleDistorted - surfaceDepth, 0.0);- screenCoordsOffset *= clamp(realWaterDepth / BUMP_SUPPRESS_DEPTH,0,1);- #endif- // reflection-@@ -189,16 +185,6 @@ void main(void)- // no alpha here, so make sure raindrop ripple specularity gets properly subdued- rainSpecular *= clamp(fresnel*6.0 + specular * sunSpec.a, 0.0, 1.0);--- // selectively nullify screenCoordsOffset to eliminate remaining shore artifacts, not needed for reflection-- if (cameraPos.z > 0.0 && realWaterDepth <= VISIBILITY_DEPTH && waterDepthDistorted > VISIBILITY_DEPTH)-- screenCoordsOffset = vec2(0.0);---- depthSampleDistorted = linearizeDepth(sampleRefractionDepthMap(screenCoords - screenCoordsOffset), near, far) * radialise;-- waterDepthDistorted = max(depthSampleDistorted - surfaceDepth, 0.0);---- // fade to realWaterDepth at a distance to compensate for physically inaccurate depth calculation-- waterDepthDistorted = mix(waterDepthDistorted, realWaterDepth, min(surfaceDepth / REFR_FOG_DISTORT_DISTANCE, 1.0));--- // refraction- vec3 refraction = sampleRefractionMap(screenCoords - screenCoordsOffset).rgb;- vec3 rawRefraction = refraction;-@@ -207,11 +193,7 @@ void main(void)- if (cameraPos.z < 0.0)- refraction = clamp(refraction * 1.5, 0.0, 1.0);- else-- {-- float depthCorrection = sqrt(1.0 + 4.0 * DEPTH_FADE * DEPTH_FADE);-- float factor = DEPTH_FADE * DEPTH_FADE / (-0.5 * depthCorrection + 0.5 - waterDepthDistorted / VISIBILITY) + 0.5 * depthCorrection + 0.5;-- refraction = mix(refraction, waterColor, clamp(factor, 0.0, 1.0));-- }-+ refraction = mix(refraction, waterColor, clamp(depthSampleDistorted/VISIBILITY, 0.0, 1.0));-- // sunlight scattering- // normal for sunlight scattering-diff --git a/files/shaders/lib/core/fragment.h.glsl b/files/shaders/lib/core/fragment.h.glsl-index 1bc2a1f79ab..de41dbc7ab1 100644---- a/files/shaders/lib/core/fragment.h.glsl-+++ b/files/shaders/lib/core/fragment.h.glsl-@@ -1,20 +1,43 @@- #ifndef OPENMW_FRAGMENT_H_GLSL- #define OPENMW_FRAGMENT_H_GLSL---@link "lib/core/fragment.glsl" if !@useOVR_multiview--@link "lib/core/fragment_multiview.glsl" if @useOVR_multiview-+uniform sampler2D reflectionMap;---vec4 sampleReflectionMap(vec2 uv);-+vec4 sampleReflectionMap(vec2 uv)-+{-+ return texture2D(reflectionMap, uv);-+}-- #if @refraction_enabled--vec4 sampleRefractionMap(vec2 uv);--float sampleRefractionDepthMap(vec2 uv);-+uniform sampler2D refractionMap;-+uniform highp sampler2D refractionDepthMap;-+-+vec4 sampleRefractionMap(vec2 uv)-+{-+ return texture2D(refractionMap, uv);-+}-+-+float sampleRefractionDepthMap(vec2 uv)-+{-+ return texture2D(refractionDepthMap, uv).x;-+}-+- #endif---vec4 samplerLastShader(vec2 uv);-+uniform sampler2D lastShader;-+-+vec4 samplerLastShader(vec2 uv)-+{-+ return texture2D(lastShader, uv);-+}-- #if @skyBlending--vec3 sampleSkyColor(vec2 uv);-+uniform sampler2D sky;-+-+vec3 sampleSkyColor(vec2 uv)-+{-+ return texture2D(sky, uv).xyz;-+}- #endif-- #endif // OPENMW_FRAGMENT_H_GLSL-diff --git a/files/shaders/lib/core/vertex.h.glsl b/files/shaders/lib/core/vertex.h.glsl-index 6e22f6deb15..c8a1080574d 100644---- a/files/shaders/lib/core/vertex.h.glsl-+++ b/files/shaders/lib/core/vertex.h.glsl-@@ -1,6 +1,16 @@--@link "lib/core/vertex.glsl" if !@useOVR_multiview--@link "lib/core/vertex_multiview.glsl" if @useOVR_multiview-+uniform mat4 projectionMatrix;---vec4 modelToClip(vec4 pos);--vec4 modelToView(vec4 pos);--vec4 viewToClip(vec4 pos);-+vec4 modelToView(vec4 pos)-+{-+ return gl_ModelViewMatrix * pos;-+}-+-+vec4 modelToClip(vec4 pos)-+{-+ return projectionMatrix * modelToView(pos);-+}-+-+vec4 viewToClip(vec4 pos)-+{-+ return projectionMatrix * pos;-+}diff --git a/android/buildscripts/patches/openmw/shaders1.patch b/android/buildscripts/patches/openmw/shaders1.patchdeleted file mode 100644index dad64ff..0000000--- a/android/buildscripts/patches/openmw/shaders1.patch+++ /dev/null@@ -1,337 +0,0 @@-From bbd346e0111367653cb952fec867a9dc38bbcf88 Mon Sep 17 00:00:00 2001-From: Duron27 <[email protected]>-Date: Thu, 15 Feb 2024 02:14:12 -0500-Subject: [PATCH] shaders--yep----- files/shaders/compatibility/bs/default.frag | 2 +-- files/shaders/compatibility/bs/default.vert | 2 +-- .../shaders/compatibility/bs/nolighting.vert | 2 +-- files/shaders/compatibility/debug.frag | 2 +-- files/shaders/compatibility/debug.vert | 2 +-- .../shaders/compatibility/fullscreen_tri.vert | 2 +-- files/shaders/compatibility/groundcover.vert | 2 +-- files/shaders/compatibility/objects.frag | 10 ++---- files/shaders/compatibility/objects.vert | 2 +-- files/shaders/compatibility/terrain.frag | 2 +-- files/shaders/compatibility/terrain.vert | 2 +-- files/shaders/compatibility/water.frag | 22 +----------- files/shaders/lib/core/fragment.h.glsl | 37 +++++++++++++++----- files/shaders/lib/core/vertex.h.glsl | 20 +++++++---- 14 files changed, 62 insertions(+), 47 deletions(-)--diff --git a/files/shaders/compatibility/bs/default.frag b/files/shaders/compatibility/bs/default.frag-index 77131c6a52c..ec5f5c89780 100644---- a/files/shaders/compatibility/bs/default.frag-+++ b/files/shaders/compatibility/bs/default.frag-@@ -80,7 +80,7 @@ void main()- vec3 viewNormal = normalToView(normalTex.xyz * 2.0 - 1.0);- specularColor *= normalTex.a;- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- float shadowing = unshadowedLightRatio(linearDepth);-diff --git a/files/shaders/compatibility/bs/default.vert b/files/shaders/compatibility/bs/default.vert-index 21942ec91e8..d9d47843c09 100644---- a/files/shaders/compatibility/bs/default.vert-+++ b/files/shaders/compatibility/bs/default.vert-@@ -69,7 +69,7 @@ void main(void)--- #if @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- setupShadowCoords(viewPos, viewNormal);- #endif- }-diff --git a/files/shaders/compatibility/bs/nolighting.vert b/files/shaders/compatibility/bs/nolighting.vert-index 57cedc6e948..3b0fa7b6261 100644---- a/files/shaders/compatibility/bs/nolighting.vert-+++ b/files/shaders/compatibility/bs/nolighting.vert-@@ -63,7 +63,7 @@ void main(void)- }-- #if @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalize((gl_NormalMatrix * gl_Normal).xyz);- setupShadowCoords(viewPos, viewNormal);- #endif- }-diff --git a/files/shaders/compatibility/debug.frag b/files/shaders/compatibility/debug.frag-index a92b406d46b..041562fc0e2 100644---- a/files/shaders/compatibility/debug.frag-+++ b/files/shaders/compatibility/debug.frag-@@ -4,7 +4,7 @@-- varying vec3 vertexNormal;---uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- void main()- {-diff --git a/files/shaders/compatibility/debug.vert b/files/shaders/compatibility/debug.vert-index 47d5337a66f..a1fa462f397 100644---- a/files/shaders/compatibility/debug.vert-+++ b/files/shaders/compatibility/debug.vert-@@ -6,7 +6,7 @@ uniform vec3 color;- uniform vec3 trans;- uniform vec3 scale;- uniform bool useNormalAsColor;--uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- centroid varying vec4 passColor;- varying vec3 vertexNormal;-diff --git a/files/shaders/compatibility/fullscreen_tri.vert b/files/shaders/compatibility/fullscreen_tri.vert-index 3174384212e..8510a0933c1 100644---- a/files/shaders/compatibility/fullscreen_tri.vert-+++ b/files/shaders/compatibility/fullscreen_tri.vert-@@ -1,6 +1,6 @@- #version 120---uniform vec2 scaling = vec2(1.0, 1.0);-+uniform vec2 scaling;// = vec2(1.0, 1.0);-- varying vec2 uv;--diff --git a/files/shaders/compatibility/groundcover.vert b/files/shaders/compatibility/groundcover.vert-index 8cf53a19e05..95a17b50849 100644---- a/files/shaders/compatibility/groundcover.vert-+++ b/files/shaders/compatibility/groundcover.vert-@@ -156,7 +156,7 @@ void main(void)- #endif-- #if (!PER_PIXEL_LIGHTING || @shadows_enabled)-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if @diffuseMap-diff --git a/files/shaders/compatibility/objects.frag b/files/shaders/compatibility/objects.frag-index 56c7abf27c7..8966a84bf05 100644---- a/files/shaders/compatibility/objects.frag-+++ b/files/shaders/compatibility/objects.frag-@@ -84,11 +84,11 @@ varying vec3 passNormal;- #if @normalMap || @diffuseParallax- varying vec4 passTangent;- #endif---+/*- #if @additiveBlending- #define ADDITIVE_BLENDING- #endif---+*/- #include "lib/light/lighting.glsl"- #include "lib/material/parallax.glsl"- #include "lib/material/alpha.glsl"-@@ -109,11 +109,11 @@ uniform float softFalloffDepth;-- #if @particleOcclusion- #include "lib/particle/occlusion.glsl"--uniform sampler2D orthoDepthMap;-+uniform highp sampler2D orthoDepthMap;- varying vec3 orthoDepthMapCoord;- #endif---uniform sampler2D opaqueDepthTex;-+uniform highp sampler2D opaqueDepthTex;-- void main()- {-@@ -169,7 +169,7 @@ vec2 screenCoords = gl_FragCoord.xy / screenRes;- #if @normalMap- vec3 viewNormal = normalToView(texture2D(normalMap, normalMapUV + offset).xyz * 2.0 - 1.0);- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- vec3 viewVec = normalize(passViewPos);-diff --git a/files/shaders/compatibility/objects.vert b/files/shaders/compatibility/objects.vert-index 081ff909cf0..2bebcd60bf2 100644---- a/files/shaders/compatibility/objects.vert-+++ b/files/shaders/compatibility/objects.vert-@@ -101,7 +101,7 @@ void main(void)- #endif-- #if @envMap || !PER_PIXEL_LIGHTING || @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if @envMap-diff --git a/files/shaders/compatibility/terrain.frag b/files/shaders/compatibility/terrain.frag-index abc7425eb05..38b985223e4 100644---- a/files/shaders/compatibility/terrain.frag-+++ b/files/shaders/compatibility/terrain.frag-@@ -65,7 +65,7 @@ void main()- #if @normalMap- vec3 viewNormal = normalToView(texture2D(normalMap, adjustedUV).xyz * 2.0 - 1.0);- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- float shadowing = unshadowedLightRatio(linearDepth);-diff --git a/files/shaders/compatibility/terrain.vert b/files/shaders/compatibility/terrain.vert-index cbfb7769ba5..3b2cb16db49 100644---- a/files/shaders/compatibility/terrain.vert-+++ b/files/shaders/compatibility/terrain.vert-@@ -52,7 +52,7 @@ void main(void)- #endif-- #if !PER_PIXEL_LIGHTING || @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if !PER_PIXEL_LIGHTING-diff --git a/files/shaders/compatibility/water.frag b/files/shaders/compatibility/water.frag-index c971f92b997..5817b0c5aef 100644---- a/files/shaders/compatibility/water.frag-+++ b/files/shaders/compatibility/water.frag-@@ -17,8 +17,6 @@- // tweakables -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ---- const float VISIBILITY = 2500.0;--const float VISIBILITY_DEPTH = VISIBILITY * 1.5;--const float DEPTH_FADE = 0.15;-- const float BIG_WAVES_X = 0.1; // strength of big waves- const float BIG_WAVES_Y = 0.1;-@@ -50,7 +48,6 @@ const float SUN_SPEC_FADING_THRESHOLD = 0.15; // visibility at which sun s- const float SPEC_HARDNESS = 256.0; // specular highlights hardness-- const float BUMP_SUPPRESS_DEPTH = 300.0; // at what water depth bumpmap will be suppressed for reflections and refractions (prevents artifacts at shores)--const float REFR_FOG_DISTORT_DISTANCE = 3000.0; // at what distance refraction fog will be calculated using real water depth instead of distorted depth (prevents splotchy shores)-- const vec2 WIND_DIR = vec2(0.5f, -0.8f);- const float WIND_SPEED = 0.2f;-@@ -163,10 +160,9 @@ void main(void)- vec2 screenCoordsOffset = normal.xy * REFL_BUMP;- #if REFRACTION- float depthSample = linearizeDepth(sampleRefractionDepthMap(screenCoords), near, far) * radialise;-+ float depthSampleDistorted = linearizeDepth(sampleRefractionDepthMap(screenCoords-screenCoordsOffset), near, far) * radialise;- float surfaceDepth = linearizeDepth(gl_FragCoord.z, near, far) * radialise;- float realWaterDepth = depthSample - surfaceDepth; // undistorted water depth in view direction, independent of frustum-- float depthSampleDistorted = linearizeDepth(sampleRefractionDepthMap(screenCoords - screenCoordsOffset), near, far) * radialise;-- float waterDepthDistorted = max(depthSampleDistorted - surfaceDepth, 0.0);- screenCoordsOffset *= clamp(realWaterDepth / BUMP_SUPPRESS_DEPTH,0,1);- #endif- // reflection-@@ -189,16 +185,6 @@ void main(void)- // no alpha here, so make sure raindrop ripple specularity gets properly subdued- rainSpecular *= clamp(fresnel*6.0 + specular * sunSpec.a, 0.0, 1.0);--- // selectively nullify screenCoordsOffset to eliminate remaining shore artifacts, not needed for reflection-- if (cameraPos.z > 0.0 && realWaterDepth <= VISIBILITY_DEPTH && waterDepthDistorted > VISIBILITY_DEPTH)-- screenCoordsOffset = vec2(0.0);---- depthSampleDistorted = linearizeDepth(sampleRefractionDepthMap(screenCoords - screenCoordsOffset), near, far) * radialise;-- waterDepthDistorted = max(depthSampleDistorted - surfaceDepth, 0.0);---- // fade to realWaterDepth at a distance to compensate for physically inaccurate depth calculation-- waterDepthDistorted = mix(waterDepthDistorted, realWaterDepth, min(surfaceDepth / REFR_FOG_DISTORT_DISTANCE, 1.0));--- // refraction- vec3 refraction = sampleRefractionMap(screenCoords - screenCoordsOffset).rgb;- vec3 rawRefraction = refraction;-@@ -207,11 +193,7 @@ void main(void)- if (cameraPos.z < 0.0)- refraction = clamp(refraction * 1.5, 0.0, 1.0);- else-- {-- float depthCorrection = sqrt(1.0 + 4.0 * DEPTH_FADE * DEPTH_FADE);-- float factor = DEPTH_FADE * DEPTH_FADE / (-0.5 * depthCorrection + 0.5 - waterDepthDistorted / VISIBILITY) + 0.5 * depthCorrection + 0.5;-- refraction = mix(refraction, waterColor, clamp(factor, 0.0, 1.0));-- }-+ refraction = mix(refraction, waterColor, clamp(depthSampleDistorted/VISIBILITY, 0.0, 1.0));-- // sunlight scattering- // normal for sunlight scattering-diff --git a/files/shaders/lib/core/fragment.h.glsl b/files/shaders/lib/core/fragment.h.glsl-index 1bc2a1f79ab..de41dbc7ab1 100644---- a/files/shaders/lib/core/fragment.h.glsl-+++ b/files/shaders/lib/core/fragment.h.glsl-@@ -1,20 +1,43 @@- #ifndef OPENMW_FRAGMENT_H_GLSL- #define OPENMW_FRAGMENT_H_GLSL---@link "lib/core/fragment.glsl" if !@useOVR_multiview--@link "lib/core/fragment_multiview.glsl" if @useOVR_multiview-+uniform sampler2D reflectionMap;---vec4 sampleReflectionMap(vec2 uv);-+vec4 sampleReflectionMap(vec2 uv)-+{-+ return texture2D(reflectionMap, uv);-+}-- #if @refraction_enabled--vec4 sampleRefractionMap(vec2 uv);--float sampleRefractionDepthMap(vec2 uv);-+uniform sampler2D refractionMap;-+uniform highp sampler2D refractionDepthMap;-+-+vec4 sampleRefractionMap(vec2 uv)-+{-+ return texture2D(refractionMap, uv);-+}-+-+float sampleRefractionDepthMap(vec2 uv)-+{-+ return texture2D(refractionDepthMap, uv).x;-+}-+- #endif---vec4 samplerLastShader(vec2 uv);-+uniform sampler2D lastShader;-+-+vec4 samplerLastShader(vec2 uv)-+{-+ return texture2D(lastShader, uv);-+}-- #if @skyBlending--vec3 sampleSkyColor(vec2 uv);-+uniform sampler2D sky;-+-+vec3 sampleSkyColor(vec2 uv)-+{-+ return texture2D(sky, uv).xyz;-+}- #endif-- #endif // OPENMW_FRAGMENT_H_GLSL-diff --git a/files/shaders/lib/core/vertex.h.glsl b/files/shaders/lib/core/vertex.h.glsl-index 6e22f6deb15..c8a1080574d 100644---- a/files/shaders/lib/core/vertex.h.glsl-+++ b/files/shaders/lib/core/vertex.h.glsl-@@ -1,6 +1,16 @@--@link "lib/core/vertex.glsl" if !@useOVR_multiview--@link "lib/core/vertex_multiview.glsl" if @useOVR_multiview-+uniform mat4 projectionMatrix;---vec4 modelToClip(vec4 pos);--vec4 modelToView(vec4 pos);--vec4 viewToClip(vec4 pos);-+vec4 modelToView(vec4 pos)-+{-+ return gl_ModelViewMatrix * pos;-+}-+-+vec4 modelToClip(vec4 pos)-+{-+ return projectionMatrix * modelToView(pos);-+}-+-+vec4 viewToClip(vec4 pos)-+{-+ return projectionMatrix * pos;-+}diff --git a/android/buildscripts/patches/openmw049-final/0001-gl4es-shaders.patch b/android/buildscripts/patches/openmw049-final/0001-gl4es-shaders.patchdeleted file mode 100644index 6402473..0000000--- a/android/buildscripts/patches/openmw049-final/0001-gl4es-shaders.patch+++ /dev/null@@ -1,250 +0,0 @@-diff --git a/files/shaders/compatibility/debug.frag b/files/shaders/compatibility/debug.frag---- a/files/shaders/compatibility/debug.frag-+++ b/files/shaders/compatibility/debug.frag-@@ -4,6 +4,6 @@- varying vec3 vertexNormal;---uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- void main()- {-diff --git a/files/shaders/compatibility/debug.vert b/files/shaders/compatibility/debug.vert---- a/files/shaders/compatibility/debug.vert-+++ b/files/shaders/compatibility/debug.vert-@@ -6,7 +6,7 @@ uniform vec3 color;- uniform vec3 trans;- uniform vec3 scale;- uniform bool useNormalAsColor;--uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- centroid varying vec4 passColor;- varying vec3 vertexNormal;-diff --git a/files/shaders/compatibility/fullscreen_tri.vert b/files/shaders/compatibility/fullscreen_tri.vert---- a/files/shaders/compatibility/fullscreen_tri.vert-+++ b/files/shaders/compatibility/fullscreen_tri.vert-@@ -1,6 +1,6 @@- #version 120---uniform vec2 scaling = vec2(1.0, 1.0);-+uniform vec2 scaling;-- varying vec2 uv;--diff --git a/files/shaders/compatibility/shadowcasting.vert b/files/shaders/compatibility/shadowcasting.vert---- a/files/shaders/compatibility/shadowcasting.vert-+++ b/files/shaders/compatibility/shadowcasting.vert-@@ -6,8 +6,8 @@ varying float alphaPassthrough;-- uniform int colorMode;- uniform bool useTreeAnim;--uniform bool useDiffuseMapForShadowAlpha = true;--uniform bool alphaTestShadows = true;-+uniform bool useDiffuseMapForShadowAlpha;-+uniform bool alphaTestShadows;-- void main(void)- {-diff --git a/files/shaders/compatibility/bs/default.frag b/files/shaders/compatibility/bs/default.frag---- a/files/shaders/compatibility/bs/default.frag-+++ b/files/shaders/compatibility/bs/default.frag-@@ -82,7 +82,7 @@ void main()- vec3 viewNormal = normalToView(normal);- specularColor *= normalTex.a;- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- float shadowing = unshadowedLightRatio(linearDepth);-diff --git a/files/shaders/compatibility/bs/default.vert b/files/shaders/compatibility/bs/default.vert---- a/files/shaders/compatibility/bs/default.vert-+++ b/files/shaders/compatibility/bs/default.vert-@@ -69,7 +69,7 @@ void main(void)--- #if @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- setupShadowCoords(viewPos, viewNormal);- #endif- }-diff --git a/files/shaders/compatibility/bs/nolighting.vert b/files/shaders/compatibility/bs/nolighting.vert---- a/files/shaders/compatibility/bs/nolighting.vert-+++ b/files/shaders/compatibility/bs/nolighting.vert-@@ -60,7 +60,7 @@ void main(void)- }-- #if @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalize((gl_NormalMatrix * gl_Normal).xyz);- setupShadowCoords(viewPos, viewNormal);- #endif- }-diff --git a/files/shaders/compatibility/groundcover.vert b/files/shaders/compatibility/groundcover.vert---- a/files/shaders/compatibility/groundcover.vert-+++ b/files/shaders/compatibility/groundcover.vert-@@ -153,7 +153,7 @@ void main(void)- #endif-- #if (!PER_PIXEL_LIGHTING || @shadows_enabled)-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if @diffuseMap-diff --git a/files/shaders/compatibility/objects.frag b/files/shaders/compatibility/objects.frag---- a/files/shaders/compatibility/objects.frag-+++ b/files/shaders/compatibility/objects.frag-@@ -86,9 +86,9 @@ varying vec3 passNormal;- varying vec4 passTangent;- #endif---#if @additiveBlending-+/* #if @additiveBlending- #define ADDITIVE_BLENDING--#endif-+#endif */-- #include "lib/core/fragment.h.glsl"- #include "lib/light/lighting.glsl"-@@ -108,6 +108,6 @@ uniform float softFalloffDepth;-- #if @particleOcclusion- #include "lib/particle/occlusion.glsl"--uniform sampler2D orthoDepthMap;-+uniform highp sampler2D orthoDepthMap;- varying vec3 orthoDepthMapCoord;- #endif-@@ -165,7 +165,7 @@ vec2 screenCoords = gl_FragCoord.xy / screenRes;- #endif- vec3 viewNormal = normalToView(normal);- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- vec3 viewVec = normalize(passViewPos);-diff --git a/files/shaders/compatibility/objects.vert b/files/shaders/compatibility/objects.vert---- a/files/shaders/compatibility/objects.vert-+++ b/files/shaders/compatibility/objects.vert-@@ -99,7 +99,7 @@ void main(void)- #endif-- #if @envMap || !PER_PIXEL_LIGHTING || @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if @envMap-diff --git a/files/shaders/compatibility/terrain.frag b/files/shaders/compatibility/terrain.frag---- a/files/shaders/compatibility/terrain.frag-+++ b/files/shaders/compatibility/terrain.frag-@@ -62,7 +62,7 @@ void main()- #if @normalMap- vec3 viewNormal = normalToView(texture2D(normalMap, adjustedUV).xyz * 2.0 - 1.0);- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif- float shadowing = unshadowedLightRatio(linearDepth);--diff --git a/files/shaders/compatibility/terrain.vert b/files/shaders/compatibility/terrain.vert---- a/files/shaders/compatibility/terrain.vert-+++ b/files/shaders/compatibility/terrain.vert-@@ -49,7 +49,7 @@ void main(void)- #endif-- #if !PER_PIXEL_LIGHTING || @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif- #if !PER_PIXEL_LIGHTING- doLighting(viewPos.xyz, viewNormal, passLighting, passSpecular);-diff --git a/files/shaders/lib/core/fragment.h.glsl b/files/shaders/lib/core/fragment.h.glsl---- a/files/shaders/lib/core/fragment.h.glsl-+++ b/files/shaders/lib/core/fragment.h.glsl-@@ -1,22 +1,49 @@- #ifndef OPENMW_FRAGMENT_H_GLSL- #define OPENMW_FRAGMENT_H_GLSL---@link "lib/core/fragment.glsl" if !@useOVR_multiview--@link "lib/core/fragment_multiview.glsl" if @useOVR_multiview-+uniform sampler2D reflectionMap;---vec4 sampleReflectionMap(vec2 uv);-+vec4 sampleReflectionMap(vec2 uv)-+{-+ return texture2D(reflectionMap, uv);-+}-- #if @waterRefraction--vec4 sampleRefractionMap(vec2 uv);--float sampleRefractionDepthMap(vec2 uv);-+uniform sampler2D refractionMap;-+uniform highp sampler2D refractionDepthMap;-+-+vec4 sampleRefractionMap(vec2 uv)-+{-+ return texture2D(refractionMap, uv);-+}-+-+float sampleRefractionDepthMap(vec2 uv)-+{-+ return texture2D(refractionDepthMap, uv).x;-+}- #endif---vec4 samplerLastShader(vec2 uv);-+uniform sampler2D lastShader;-+-+vec4 samplerLastShader(vec2 uv)-+{-+ return texture2D(lastShader, uv);-+}-- #if @skyBlending--vec3 sampleSkyColor(vec2 uv);-+uniform sampler2D sky;-+-+vec3 sampleSkyColor(vec2 uv)-+{-+ return texture2D(sky, uv).xyz;-+}- #endif---vec4 sampleOpaqueDepthTex(vec2 uv);-+uniform highp sampler2D opaqueDepthTex;-+-+vec4 sampleOpaqueDepthTex(vec2 uv)-+{-+ return texture2D(opaqueDepthTex, uv);-+}-- #endif // OPENMW_FRAGMENT_H_GLSL-diff --git a/files/shaders/lib/core/vertex.h.glsl b/files/shaders/lib/core/vertex.h.glsl---- a/files/shaders/lib/core/vertex.h.glsl-+++ b/files/shaders/lib/core/vertex.h.glsl-@@ -1,6 +1,16 @@--@link "lib/core/vertex.glsl" if !@useOVR_multiview--@link "lib/core/vertex_multiview.glsl" if @useOVR_multiview-+uniform mat4 projectionMatrix;---vec4 modelToClip(vec4 pos);--vec4 modelToView(vec4 pos);--vec4 viewToClip(vec4 pos);-+vec4 modelToView(vec4 pos)-+{-+ return gl_ModelViewMatrix * pos;-+}-+-+vec4 modelToClip(vec4 pos)-+{-+ return projectionMatrix * modelToView(pos);-+}-+-+vec4 viewToClip(vec4 pos)-+{-+ return projectionMatrix * pos;-+}diff --git a/android/buildscripts/patches/openmw049-final/0002-android-lifecycle.patch b/android/buildscripts/patches/openmw049-final/0002-android-lifecycle.patchdeleted file mode 100644index b9da7ca..0000000--- a/android/buildscripts/patches/openmw049-final/0002-android-lifecycle.patch+++ /dev/null@@ -1,105 +0,0 @@-diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp---- a/apps/openmw/engine.cpp-+++ b/apps/openmw/engine.cpp-@@ -457,5 +457,8 @@ void OMW::Engine::setSkipMenu(bool skipMenu, bool newGame)- mNewGame = newGame;- }--+// Shared with the Android surface lifecycle bridge in android_main.cpp.-+osg::ref_ptr<osgViewer::Viewer> g_viewer;-+- void OMW::Engine::createWindow()- {-@@ -660,4 +663,7 @@ void OMW::Engine::createWindow()-- mViewer->getEventQueue()->getCurrentEventState()->setWindowRectangle(- 0, 0, graphicsWindow->getTraits()->width, graphicsWindow->getTraits()->height);-+-+ // Android may destroy/recreate the Surface without terminating the engine.-+ g_viewer = mViewer;- }-@@ -1041,6 +1047,8 @@ void OMW::Engine::go()-- mLuaWorker->join();--+ g_viewer.release();-+- // Save user settings- Settings::Manager::saveUser(mCfgMgr.getUserConfigPath() / "settings.cfg");- Settings::ShaderManager::get().save();-diff --git a/apps/openmw/android_main.cpp b/apps/openmw/android_main.cpp---- a/apps/openmw/android_main.cpp-+++ b/apps/openmw/android_main.cpp-@@ -4,10 +4,18 @@ int stderr = 0; // Hack: fix linker error- #endif-- #include "SDL_main.h"-+#include "mwbase/environment.hpp"-+#include "mwbase/windowmanager.hpp"-+- #include <SDL_events.h>- #include <SDL_gamecontroller.h>-+#include <SDL_hints.h>- #include <SDL_mouse.h>--+#include <osg/GraphicsContext>-+#include <osg/OperationThread>-+#include <osgViewer/Viewer>-+- /*******************************************************************************- Functions called by JNI- *******************************************************************************/-@@ -60,5 +68,53 @@ extern "C" int Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls,- "guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,"- "righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4");--+ SDL_SetHint(SDL_HINT_ANDROID_BLOCK_ON_PAUSE, "0");-+ SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");-+- return 0;- }-+-+extern osg::ref_ptr<osgViewer::Viewer> g_viewer;-+static osg::GraphicsContext* g_androidContext = nullptr;-+-+class CtxReleaseOperation : public osg::Operation-+{-+public:-+ void operator()(osg::Object*) override-+ {-+ if (g_androidContext)-+ g_androidContext->releaseContext();-+ }-+};-+-+class CtxAcquireOperation : public osg::Operation-+{-+public:-+ void operator()(osg::Object*) override-+ {-+ if (g_androidContext)-+ g_androidContext->makeCurrent();-+ }-+};-+-+extern "C" void Java_org_libsdl_app_SDLActivity_omwSurfaceDestroyed(JNIEnv*, jclass, jobject)-+{-+ if (!g_viewer)-+ return;-+-+ g_androidContext = g_viewer->getCamera()->getGraphicsContext();-+ g_androidContext->add(new CtxReleaseOperation());-+-+ MWBase::Environment::get().getWindowManager()->windowVisibilityChange(false);-+}-+-+extern "C" void Java_org_libsdl_app_SDLActivity_omwSurfaceRecreated(JNIEnv*, jclass, jobject)-+{-+ if (!g_viewer)-+ return;-+-+ g_androidContext = g_viewer->getCamera()->getGraphicsContext();-+ g_androidContext->add(new CtxAcquireOperation());-+-+ MWBase::Environment::get().getWindowManager()->windowVisibilityChange(true);-+}diff --git a/android/buildscripts/patches/openmw049-final/0003-android-ui.patch b/android/buildscripts/patches/openmw049-final/0003-android-ui.patchdeleted file mode 100644index 9dc9b42..0000000--- a/android/buildscripts/patches/openmw049-final/0003-android-ui.patch+++ /dev/null@@ -1,24 +0,0 @@-diff --git a/apps/openmw/mwgui/loadingscreen.cpp b/apps/openmw/mwgui/loadingscreen.cpp---- a/apps/openmw/mwgui/loadingscreen.cpp-+++ b/apps/openmw/mwgui/loadingscreen.cpp-@@ -280,6 +280,8 @@ namespace MWGui-- void LoadingScreen::setupCopyFramebufferToTextureCallback()- {-+ return;-+- // Copy the current framebuffer onto a texture and display that texture as the background image- // Note, we could also set the camera to disable clearing and have the background image transparent,- // but then we get shaking effects on buffer swaps.-diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp---- a/apps/openmw/mwgui/windowmanagerimp.cpp-+++ b/apps/openmw/mwgui/windowmanagerimp.cpp-@@ -1718,7 +1718,7 @@ namespace MWGui-- bool WindowManager::getCursorVisible()- {-- return mCursorVisible && mCursorActive;-+ return mCursorVisible;- }-- void WindowManager::trackWindow(Layout* layout, const WindowSettingValues& settings)diff --git a/android/buildscripts/patches/openmw049-final/0004-static-osg-link.patch b/android/buildscripts/patches/openmw049-final/0004-static-osg-link.patchdeleted file mode 100644index 284a086..0000000--- a/android/buildscripts/patches/openmw049-final/0004-static-osg-link.patch+++ /dev/null@@ -1,18 +0,0 @@-diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt---- a/apps/openmw/CMakeLists.txt-+++ b/apps/openmw/CMakeLists.txt-@@ -187,7 +187,14 @@ target_link_libraries(openmw-lib- )-- if (ANDROID)- target_link_libraries(openmw-lib EGL android log z)-+-+ if (BUILD_OPENMW)-+ # Force static OSG plugin objects into libopenmw.so on Android.-+ find_package(OSGPlugins REQUIRED COMPONENTS ${USED_OSG_PLUGINS})-+ list(APPEND OPENSCENEGRAPH_LIBRARIES ${OSGPlugins_LIBRARIES})-+ target_link_libraries(openmw ${OPENSCENEGRAPH_LIBRARIES} freetype jpeg png)-+ endif()- endif (ANDROID)-- if (USE_SYSTEM_TINYXML)diff --git a/android/buildscripts/patches/openmw049-final/0005-gl4es-save-psa.patch b/android/buildscripts/patches/openmw049-final/0005-gl4es-save-psa.patchdeleted file mode 100644index 7e86b2c..0000000--- a/android/buildscripts/patches/openmw049-final/0005-gl4es-save-psa.patch+++ /dev/null@@ -1,20 +0,0 @@-diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp---- a/apps/openmw/mwstate/statemanagerimp.cpp-+++ b/apps/openmw/mwstate/statemanagerimp.cpp-@@ -19,6 +19,7 @@- #include <components/settings/values.hpp>-- #include <osg/Image>-+#include <osg/Hint>-- #include <osgDB/Registry>--@@ -336,6 +337,8 @@ void MWState::StateManager::saveGame(std::string_view description, const Slot*- Settings::saves().mCharacter.set(Files::pathToUnicodeString(slot->mPath.parent_path().filename()));- mLastSavegame = slot->mPath;--+ osg::Hint::GL4ES_SavePSA();-+- const auto finish = std::chrono::steady_clock::now();-- Log(Debug::Info) << '\'' << description << "' is saved in "diff --git a/android/buildscripts/patches/openmw049-final/0006-ndk-r26-stringstream-compat.patch b/android/buildscripts/patches/openmw049-final/0006-ndk-r26-stringstream-compat.patchdeleted file mode 100644index d8f5351..0000000--- a/android/buildscripts/patches/openmw049-final/0006-ndk-r26-stringstream-compat.patch+++ /dev/null@@ -1,13 +0,0 @@-diff --git a/components/misc/resourcehelpers.cpp b/components/misc/resourcehelpers.cpp---- a/components/misc/resourcehelpers.cpp-+++ b/components/misc/resourcehelpers.cpp-@@ -264,8 +264,9 @@ VFS::Path::Normalized Misc::ResourceHelpers::getLODMeshName(- {- std::stringstream patern;- patern << distantMeshPattern << "_" << l;-- const VFS::Path::Normalized meshName = getBestLODMeshName(resPath, vfs, patern.view());-+ const std::string paternString = patern.str();-+ const VFS::Path::Normalized meshName = getBestLODMeshName(resPath, vfs, paternString);- if (meshName != resPath)- return meshName;- }diff --git a/android/buildscripts/patches/openmw049-final/0007-android-postprocessing-init.patch b/android/buildscripts/patches/openmw049-final/0007-android-postprocessing-init.patchdeleted file mode 100644index 2cc2359..0000000--- a/android/buildscripts/patches/openmw049-final/0007-android-postprocessing-init.patch+++ /dev/null@@ -1,29 +0,0 @@-diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp-@@ -13,6 +13,14 @@- , mPingPongCull(new PingPongCull(this))- , mDistortionCallback(new DistortionCallback)- {-+ // Android/GL4ES: the post-processing cameras and FBOs below need the-+ // real surface size from their very first construction. mWidth and-+ // mHeight are otherwise still uninitialised at this point.-+ osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext();-+ osg::GLExtensions* ext = gc->getState()->get<osg::GLExtensions>();-+ mWidth = gc->getTraits()->width;-+ mHeight = gc->getTraits()->height;-+- auto& shaderManager = mRendering.getResourceSystem()->getSceneManager()->getShaderManager();-- std::shared_ptr<LuminanceCalculator> luminanceCalculator = std::make_shared<LuminanceCalculator>(shaderManager);-@@ -39,12 +47,6 @@- distortion->setLocked(true);- mInternalTechniques.push_back(distortion);--- osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext();-- osg::GLExtensions* ext = gc->getState()->get<osg::GLExtensions>();---- mWidth = gc->getTraits()->width;-- mHeight = gc->getTraits()->height;--- if (!ext->glDisablei && ext->glDisableIndexedEXT)- ext->glDisablei = ext->glDisableIndexedEXT;- }diff --git a/android/buildscripts/patches/openmw049-final/0008-android-deferred-postprocessing-enable.patch b/android/buildscripts/patches/openmw049-final/0008-android-deferred-postprocessing-enable.patchdeleted file mode 100644index d552935..0000000--- a/android/buildscripts/patches/openmw049-final/0008-android-deferred-postprocessing-enable.patch+++ /dev/null@@ -1,79 +0,0 @@-diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp---- a/apps/openmw/mwrender/postprocessor.cpp-+++ b/apps/openmw/mwrender/postprocessor.cpp-@@ -198,8 +198,24 @@ namespace MWRender-- setCullCallback(mStateUpdater);--+#ifdef ANDROID-+ // Android can resize the SDL surface while OpenMW is already starting-+ // (for example when switching from the inset drawable to fullscreen).-+ // Building the user post-processing chain before the first real cull-+ // can therefore leave GL4ES ping-pong FBO state tied to a transitional-+ // drawable. Defer only the first chain reload; after one live cull the-+ // next update traversal rebuilds it against the actual viewport.- if (mUsePostProcessing)-- enable();-+ {-+ // Keep isEnabled() truthful from startup. Only delay the first-+ // chain reload until a real frame has established the viewport.-+ mReload = false;-+ mDeferredAndroidPostProcessingEnable = true;-+ }-+#else-+ if (mUsePostProcessing)-+ enable();-+#endif- }- PostProcessor::~PostProcessor()- {-@@ -246,6 +262,9 @@ namespace MWRender-- void PostProcessor::disable()- {-+#ifdef ANDROID-+ mDeferredAndroidPostProcessingEnable = false;-+#endif- mUsePostProcessing = false;- mRendering.getSkyManager()->setSunglare(true);- }-@@ -305,6 +324,26 @@ namespace MWRender- }- }- }-+-+#ifdef ANDROID-+ if (mDeferredAndroidPostProcessingEnable)-+ {-+ const osg::Viewport* viewport = cv->getViewport();-+ if (viewport && viewport->width() > 0.0 && viewport->height() > 0.0)-+ {-+ // Do not resize or rebuild FBOs during the cull traversal.-+ // Only store the live size and arm enable(); reloadIfRequired()-+ // will rebuild the complete chain safely during the next update.-+ setRenderTargetSize(-+ static_cast<int>(viewport->width()), static_cast<int>(viewport->height()));-+ mDeferredAndroidPostProcessingEnable = false;-+ enable();-+-+ Log(Debug::Info) << "Android post-processing startup deferred until live viewport "-+ << mWidth << "x" << mHeight;-+ }-+ }-+#endif- }- void PostProcessor::updateLiveReload()- {-diff --git a/apps/openmw/mwrender/postprocessor.hpp b/apps/openmw/mwrender/postprocessor.hpp---- a/apps/openmw/mwrender/postprocessor.hpp-+++ b/apps/openmw/mwrender/postprocessor.hpp-@@ -229,6 +229,9 @@ namespace MWRender- bool mReload = true;- bool mTriggerShaderReload = false;- bool mUsePostProcessing = false;-+#ifdef ANDROID-+ bool mDeferredAndroidPostProcessingEnable = false;-+#endif-- bool mUBO = false;- bool mHDR = false;diff --git a/android/buildscripts/patches/openmw049-final/0009-android-postprocessing-gl-warmup.patch b/android/buildscripts/patches/openmw049-final/0009-android-postprocessing-gl-warmup.patchdeleted file mode 100644index 231012c..0000000--- a/android/buildscripts/patches/openmw049-final/0009-android-postprocessing-gl-warmup.patch+++ /dev/null@@ -1,173 +0,0 @@-diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp---- a/apps/openmw/mwrender/postprocessor.cpp-+++ b/apps/openmw/mwrender/postprocessor.cpp-@@ -52,6 +52,25 @@ namespace- MWRender::PostProcessor* mPostProcessor;- };--+#ifdef ANDROID-+ class AndroidPostProcessingStartupDrawCallback : public osg::Camera::DrawCallback-+ {-+ public:-+ explicit AndroidPostProcessingStartupDrawCallback(MWRender::PostProcessor* postProcessor)-+ : mPostProcessor(postProcessor)-+ {-+ }-+-+ void operator()(osg::RenderInfo&) const override-+ {-+ mPostProcessor->signalAndroidPostProcessingWarmupDraw();-+ }-+-+ private:-+ MWRender::PostProcessor* mPostProcessor;-+ };-+#endif-+- class HUDCullCallback : public SceneUtil::NodeCallback<HUDCullCallback, osg::Camera*, osgUtil::CullVisitor*>- {- public:-@@ -198,17 +217,19 @@ namespace MWRender-- #ifdef ANDROID-- // Android can resize the SDL surface while OpenMW is already starting-- // (for example when switching from the inset drawable to fullscreen).-- // Building the user post-processing chain before the first real cull-- // can therefore leave GL4ES ping-pong FBO state tied to a transitional-- // drawable. Defer only the first chain reload; after one live cull the-- // next update traversal rebuilds it against the actual viewport.-+ // A valid cull viewport is not enough on Android/GL4ES: the graphics-+ // context can already have its final size while the first post-process-+ // GL objects are still being realized. A normal in-game OFF -> ON cycle-+ // works because at least one real draw completes with post-processing-+ // disabled before the chain is rebuilt. Reproduce that lifecycle-+ // deterministically without changing the persisted setting.- if (mUsePostProcessing)- {-- // Keep isEnabled() truthful from startup. Only delay the first-- // chain reload until a real frame has established the viewport.- mReload = false;-- mDeferredAndroidPostProcessingEnable = true;-+ mUsePostProcessing = false;-+ mAndroidPostProcessingStartupPending.store(true, std::memory_order_release);-+ mAndroidPostProcessingWarmupDrawComplete.store(false, std::memory_order_release);-+ mHUDCamera->setFinalDrawCallback(new AndroidPostProcessingStartupDrawCallback(this));-+ Log(Debug::Info) << "Android post-processing startup: waiting for one completed GL draw";- }- #else- if (mUsePostProcessing)-@@ -262,11 +283,21 @@ namespace MWRender- void PostProcessor::disable()- {- #ifdef ANDROID-- mDeferredAndroidPostProcessingEnable = false;-+ mAndroidPostProcessingStartupPending.store(false, std::memory_order_release);-+ mAndroidPostProcessingWarmupDrawComplete.store(false, std::memory_order_release);- #endif- mUsePostProcessing = false;- mRendering.getSkyManager()->setSunglare(true);- }-+-+#ifdef ANDROID-+ void PostProcessor::signalAndroidPostProcessingWarmupDraw()-+ {-+ if (mAndroidPostProcessingStartupPending.load(std::memory_order_acquire))-+ mAndroidPostProcessingWarmupDrawComplete.store(true, std::memory_order_release);-+ }-+#endif-+- void PostProcessor::traverse(osg::NodeVisitor& nv)- {- size_t frameId = nv.getTraversalNumber() % 2;-@@ -324,26 +351,6 @@ namespace MWRender- }- }- }----#ifdef ANDROID-- if (mDeferredAndroidPostProcessingEnable)-- {-- const osg::Viewport* viewport = cv->getViewport();-- if (viewport && viewport->width() > 0.0 && viewport->height() > 0.0)-- {-- // Do not resize or rebuild FBOs during the cull traversal.-- // Only store the live size and arm enable(); reloadIfRequired()-- // will rebuild the complete chain safely during the next update.-- setRenderTargetSize(-- static_cast<int>(viewport->width()), static_cast<int>(viewport->height()));-- mDeferredAndroidPostProcessingEnable = false;-- enable();---- Log(Debug::Info) << "Android post-processing startup deferred until live viewport "-- << mWidth << "x" << mHeight;-- }-- }--#endif- }- void PostProcessor::updateLiveReload()- {-@@ -356,6 +367,32 @@ namespace MWRender-- updateLiveReload();--+#ifdef ANDROID-+ if (mAndroidPostProcessingStartupPending.load(std::memory_order_acquire)-+ && mAndroidPostProcessingWarmupDrawComplete.exchange(false, std::memory_order_acq_rel))-+ {-+ // The final-draw callback proves that OSG/GL4ES has completed an-+ // actual render pass on the live context. Use the camera viewport-+ // now, not the early GraphicsContext traits from construction.-+ if (const osg::Viewport* viewport = mViewer->getCamera()->getViewport())-+ {-+ const int width = static_cast<int>(viewport->width());-+ const int height = static_cast<int>(viewport->height());-+ if (width > 0 && height > 0)-+ setRenderTargetSize(width, height);-+ }-+-+ mAndroidPostProcessingStartupPending.store(false, std::memory_order_release);-+-+ // From here on use the exact same OpenMW path as a successful-+ // manual re-enable: enable() -> reloadIfRequired() -> loadChain()-+ // -> resize(), but only after the first completed GL draw.-+ enable();-+ Log(Debug::Info) << "Android post-processing startup: GL warm-up complete, rebuilding chain at "-+ << mWidth << "x" << mHeight;-+ }-+#endif-+- reloadIfRequired();- mCanvases[frameId]->setNodeMask(~0u);- mCanvases[!frameId]->setNodeMask(0);-diff --git a/apps/openmw/mwrender/postprocessor.hpp b/apps/openmw/mwrender/postprocessor.hpp---- a/apps/openmw/mwrender/postprocessor.hpp-+++ b/apps/openmw/mwrender/postprocessor.hpp-@@ -2,6 +2,7 @@- #define OPENMW_MWRENDER_POSTPROCESSOR_H-- #include <array>-+#include <atomic>- #include <string>- #include <unordered_map>- #include <vector>-@@ -191,6 +192,10 @@ namespace MWRender- void loadChain();- void saveChain();--+#ifdef ANDROID-+ void signalAndroidPostProcessingWarmupDraw();-+#endif-+- private:- void populateTechniqueFiles();--@@ -229,7 +234,8 @@ namespace MWRender- bool mTriggerShaderReload = false;- bool mUsePostProcessing = false;- #ifdef ANDROID-- bool mDeferredAndroidPostProcessingEnable = false;-+ std::atomic_bool mAndroidPostProcessingStartupPending{ false };-+ std::atomic_bool mAndroidPostProcessingWarmupDrawComplete{ false };- #endif-- bool mUBO = false;diff --git a/android/buildscripts/patches/openmw049-final/0010-android-postprocessing-stabilize-after-live-draws.patch b/android/buildscripts/patches/openmw049-final/0010-android-postprocessing-stabilize-after-live-draws.patchdeleted file mode 100644index c9fffc2..0000000--- a/android/buildscripts/patches/openmw049-final/0010-android-postprocessing-stabilize-after-live-draws.patch+++ /dev/null@@ -1,126 +0,0 @@-diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp---- a/apps/openmw/mwrender/postprocessor.cpp-+++ b/apps/openmw/mwrender/postprocessor.cpp-@@ -71,6 +71,25 @@ namespace- };- #endif--+#ifdef ANDROID-+ class AndroidPostProcessingStabilizeDrawCallback : public osg::Camera::DrawCallback-+ {-+ public:-+ explicit AndroidPostProcessingStabilizeDrawCallback(MWRender::PostProcessor* postProcessor)-+ : mPostProcessor(postProcessor)-+ {-+ }-+-+ void operator()(osg::RenderInfo&) const override-+ {-+ mPostProcessor->signalAndroidPostProcessingStabilizeDraw();-+ }-+-+ private:-+ MWRender::PostProcessor* mPostProcessor;-+ };-+#endif-+- class HUDCullCallback : public SceneUtil::NodeCallback<HUDCullCallback, osg::Camera*, osgUtil::CullVisitor*>- {- public:-@@ -217,6 +236,16 @@ namespace MWRender-- setCullCallback(mStateUpdater);--+#ifdef ANDROID-+ if (mUsePostProcessing)-+ {-+ mAndroidPostProcessingStabilizePending.store(true, std::memory_order_release);-+ mAndroidPostProcessingCompletedDraws.store(0, std::memory_order_release);-+ mViewer->getCamera()->setFinalDrawCallback(new AndroidPostProcessingStabilizeDrawCallback(this));-+ Log(Debug::Info) << "Android post-processing startup stabilization v13.23 armed";-+ }-+#endif-+- #ifdef ANDROID- // A valid cull viewport is not enough on Android/GL4ES: the graphics- // context can already have its final size while the first post-process-@@ -283,6 +314,8 @@ namespace MWRender- void PostProcessor::disable()- {- #ifdef ANDROID-+ mAndroidPostProcessingStabilizePending.store(false, std::memory_order_release);-+ mAndroidPostProcessingCompletedDraws.store(0, std::memory_order_release);- mAndroidPostProcessingStartupPending.store(false, std::memory_order_release);- mAndroidPostProcessingWarmupDrawComplete.store(false, std::memory_order_release);- #endif-@@ -300,6 +333,14 @@ namespace MWRender- }- #endif--+#ifdef ANDROID-+ void PostProcessor::signalAndroidPostProcessingStabilizeDraw()-+ {-+ if (mAndroidPostProcessingStabilizePending.load(std::memory_order_acquire))-+ mAndroidPostProcessingCompletedDraws.fetch_add(1, std::memory_order_acq_rel);-+ }-+#endif-+- void PostProcessor::traverse(osg::NodeVisitor& nv)- {- size_t frameId = nv.getTraversalNumber() % 2;-@@ -367,6 +409,30 @@ namespace MWRender-- updateLiveReload();--+#ifdef ANDROID-+ if (mUsePostProcessing && mAndroidPostProcessingStabilizePending.load(std::memory_order_acquire)-+ && mAndroidPostProcessingCompletedDraws.load(std::memory_order_acquire) >= 4)-+ {-+ mAndroidPostProcessingStabilizePending.store(false, std::memory_order_release);-+ mAndroidPostProcessingCompletedDraws.store(0, std::memory_order_release);-+-+ if (const osg::Viewport* viewport = mViewer->getCamera()->getViewport())-+ {-+ const int width = static_cast<int>(viewport->width());-+ const int height = static_cast<int>(viewport->height());-+ if (width > 0 && height > 0)-+ setRenderTargetSize(width, height);-+ }-+-+ // Re-run OpenMW's normal chain/FBO rebuild only after several-+ // actual completed draws. This mirrors the useful part of the-+ // user's successful manual OFF -> ON cycle without a visible toggle.-+ mReload = true;-+ Log(Debug::Info) << "Android post-processing startup stabilization: scheduling final chain rebuild after 4 completed draws at "-+ << mWidth << "x" << mHeight;-+ }-+#endif-+- #ifdef ANDROID- if (mAndroidPostProcessingStartupPending.load(std::memory_order_acquire)- && mAndroidPostProcessingWarmupDrawComplete.exchange(false, std::memory_order_acq_rel))-diff --git a/apps/openmw/mwrender/postprocessor.hpp b/apps/openmw/mwrender/postprocessor.hpp---- a/apps/openmw/mwrender/postprocessor.hpp-+++ b/apps/openmw/mwrender/postprocessor.hpp-@@ -194,6 +194,10 @@ namespace MWRender- #ifdef ANDROID- void signalAndroidPostProcessingWarmupDraw();- #endif-+-+#ifdef ANDROID-+ void signalAndroidPostProcessingStabilizeDraw();-+#endif-- private:- void populateTechniqueFiles();-@@ -237,6 +241,10 @@ namespace MWRender- std::atomic_bool mAndroidPostProcessingStartupPending{ false };- std::atomic_bool mAndroidPostProcessingWarmupDrawComplete{ false };- #endif-+#ifdef ANDROID-+ std::atomic_bool mAndroidPostProcessingStabilizePending{ false };-+ std::atomic_uint mAndroidPostProcessingCompletedDraws{ 0 };-+#endif-- bool mUBO = false;- bool mHDR = false;diff --git a/android/buildscripts/patches/openmw050-final/0001-gl4es-shaders.patch b/android/buildscripts/patches/openmw050-final/0001-gl4es-shaders.patchdeleted file mode 100644index 6402473..0000000--- a/android/buildscripts/patches/openmw050-final/0001-gl4es-shaders.patch+++ /dev/null@@ -1,250 +0,0 @@-diff --git a/files/shaders/compatibility/debug.frag b/files/shaders/compatibility/debug.frag---- a/files/shaders/compatibility/debug.frag-+++ b/files/shaders/compatibility/debug.frag-@@ -4,6 +4,6 @@- varying vec3 vertexNormal;---uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- void main()- {-diff --git a/files/shaders/compatibility/debug.vert b/files/shaders/compatibility/debug.vert---- a/files/shaders/compatibility/debug.vert-+++ b/files/shaders/compatibility/debug.vert-@@ -6,7 +6,7 @@ uniform vec3 color;- uniform vec3 trans;- uniform vec3 scale;- uniform bool useNormalAsColor;--uniform bool useAdvancedShader = false;-+uniform bool useAdvancedShader;-- centroid varying vec4 passColor;- varying vec3 vertexNormal;-diff --git a/files/shaders/compatibility/fullscreen_tri.vert b/files/shaders/compatibility/fullscreen_tri.vert---- a/files/shaders/compatibility/fullscreen_tri.vert-+++ b/files/shaders/compatibility/fullscreen_tri.vert-@@ -1,6 +1,6 @@- #version 120---uniform vec2 scaling = vec2(1.0, 1.0);-+uniform vec2 scaling;-- varying vec2 uv;--diff --git a/files/shaders/compatibility/shadowcasting.vert b/files/shaders/compatibility/shadowcasting.vert---- a/files/shaders/compatibility/shadowcasting.vert-+++ b/files/shaders/compatibility/shadowcasting.vert-@@ -6,8 +6,8 @@ varying float alphaPassthrough;-- uniform int colorMode;- uniform bool useTreeAnim;--uniform bool useDiffuseMapForShadowAlpha = true;--uniform bool alphaTestShadows = true;-+uniform bool useDiffuseMapForShadowAlpha;-+uniform bool alphaTestShadows;-- void main(void)- {-diff --git a/files/shaders/compatibility/bs/default.frag b/files/shaders/compatibility/bs/default.frag---- a/files/shaders/compatibility/bs/default.frag-+++ b/files/shaders/compatibility/bs/default.frag-@@ -82,7 +82,7 @@ void main()- vec3 viewNormal = normalToView(normal);- specularColor *= normalTex.a;- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- float shadowing = unshadowedLightRatio(linearDepth);-diff --git a/files/shaders/compatibility/bs/default.vert b/files/shaders/compatibility/bs/default.vert---- a/files/shaders/compatibility/bs/default.vert-+++ b/files/shaders/compatibility/bs/default.vert-@@ -69,7 +69,7 @@ void main(void)--- #if @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- setupShadowCoords(viewPos, viewNormal);- #endif- }-diff --git a/files/shaders/compatibility/bs/nolighting.vert b/files/shaders/compatibility/bs/nolighting.vert---- a/files/shaders/compatibility/bs/nolighting.vert-+++ b/files/shaders/compatibility/bs/nolighting.vert-@@ -60,7 +60,7 @@ void main(void)- }-- #if @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalize((gl_NormalMatrix * gl_Normal).xyz);- setupShadowCoords(viewPos, viewNormal);- #endif- }-diff --git a/files/shaders/compatibility/groundcover.vert b/files/shaders/compatibility/groundcover.vert---- a/files/shaders/compatibility/groundcover.vert-+++ b/files/shaders/compatibility/groundcover.vert-@@ -153,7 +153,7 @@ void main(void)- #endif-- #if (!PER_PIXEL_LIGHTING || @shadows_enabled)-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if @diffuseMap-diff --git a/files/shaders/compatibility/objects.frag b/files/shaders/compatibility/objects.frag---- a/files/shaders/compatibility/objects.frag-+++ b/files/shaders/compatibility/objects.frag-@@ -86,9 +86,9 @@ varying vec3 passNormal;- varying vec4 passTangent;- #endif---#if @additiveBlending-+/* #if @additiveBlending- #define ADDITIVE_BLENDING--#endif-+#endif */-- #include "lib/core/fragment.h.glsl"- #include "lib/light/lighting.glsl"-@@ -108,6 +108,6 @@ uniform float softFalloffDepth;-- #if @particleOcclusion- #include "lib/particle/occlusion.glsl"--uniform sampler2D orthoDepthMap;-+uniform highp sampler2D orthoDepthMap;- varying vec3 orthoDepthMapCoord;- #endif-@@ -165,7 +165,7 @@ vec2 screenCoords = gl_FragCoord.xy / screenRes;- #endif- vec3 viewNormal = normalToView(normal);- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif-- vec3 viewVec = normalize(passViewPos);-diff --git a/files/shaders/compatibility/objects.vert b/files/shaders/compatibility/objects.vert---- a/files/shaders/compatibility/objects.vert-+++ b/files/shaders/compatibility/objects.vert-@@ -99,7 +99,7 @@ void main(void)- #endif-- #if @envMap || !PER_PIXEL_LIGHTING || @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif-- #if @envMap-diff --git a/files/shaders/compatibility/terrain.frag b/files/shaders/compatibility/terrain.frag---- a/files/shaders/compatibility/terrain.frag-+++ b/files/shaders/compatibility/terrain.frag-@@ -62,7 +62,7 @@ void main()- #if @normalMap- vec3 viewNormal = normalToView(texture2D(normalMap, adjustedUV).xyz * 2.0 - 1.0);- #else-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(normalize(passNormal));- #endif- float shadowing = unshadowedLightRatio(linearDepth);--diff --git a/files/shaders/compatibility/terrain.vert b/files/shaders/compatibility/terrain.vert---- a/files/shaders/compatibility/terrain.vert-+++ b/files/shaders/compatibility/terrain.vert-@@ -49,7 +49,7 @@ void main(void)- #endif-- #if !PER_PIXEL_LIGHTING || @shadows_enabled-- vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);-+ vec3 viewNormal = normalToView(passNormal);- #endif- #if !PER_PIXEL_LIGHTING- doLighting(viewPos.xyz, viewNormal, passLighting, passSpecular);-diff --git a/files/shaders/lib/core/fragment.h.glsl b/files/shaders/lib/core/fragment.h.glsl---- a/files/shaders/lib/core/fragment.h.glsl-+++ b/files/shaders/lib/core/fragment.h.glsl-@@ -1,22 +1,49 @@- #ifndef OPENMW_FRAGMENT_H_GLSL- #define OPENMW_FRAGMENT_H_GLSL---@link "lib/core/fragment.glsl" if !@useOVR_multiview--@link "lib/core/fragment_multiview.glsl" if @useOVR_multiview-+uniform sampler2D reflectionMap;---vec4 sampleReflectionMap(vec2 uv);-+vec4 sampleReflectionMap(vec2 uv)-+{-+ return texture2D(reflectionMap, uv);-+}-- #if @waterRefraction--vec4 sampleRefractionMap(vec2 uv);--float sampleRefractionDepthMap(vec2 uv);-+uniform sampler2D refractionMap;-+uniform highp sampler2D refractionDepthMap;-+-+vec4 sampleRefractionMap(vec2 uv)-+{-+ return texture2D(refractionMap, uv);-+}-+-+float sampleRefractionDepthMap(vec2 uv)-+{-+ return texture2D(refractionDepthMap, uv).x;-+}- #endif---vec4 samplerLastShader(vec2 uv);-+uniform sampler2D lastShader;-+-+vec4 samplerLastShader(vec2 uv)-+{-+ return texture2D(lastShader, uv);-+}-- #if @skyBlending--vec3 sampleSkyColor(vec2 uv);-+uniform sampler2D sky;-+-+vec3 sampleSkyColor(vec2 uv)-+{-+ return texture2D(sky, uv).xyz;-+}- #endif---vec4 sampleOpaqueDepthTex(vec2 uv);-+uniform highp sampler2D opaqueDepthTex;-+-+vec4 sampleOpaqueDepthTex(vec2 uv)-+{-+ return texture2D(opaqueDepthTex, uv);-+}-- #endif // OPENMW_FRAGMENT_H_GLSL-diff --git a/files/shaders/lib/core/vertex.h.glsl b/files/shaders/lib/core/vertex.h.glsl---- a/files/shaders/lib/core/vertex.h.glsl-+++ b/files/shaders/lib/core/vertex.h.glsl-@@ -1,6 +1,16 @@--@link "lib/core/vertex.glsl" if !@useOVR_multiview--@link "lib/core/vertex_multiview.glsl" if @useOVR_multiview-+uniform mat4 projectionMatrix;---vec4 modelToClip(vec4 pos);--vec4 modelToView(vec4 pos);--vec4 viewToClip(vec4 pos);-+vec4 modelToView(vec4 pos)-+{-+ return gl_ModelViewMatrix * pos;-+}-+-+vec4 modelToClip(vec4 pos)-+{-+ return projectionMatrix * modelToView(pos);-+}-+-+vec4 viewToClip(vec4 pos)-+{-+ return projectionMatrix * pos;-+}diff --git a/android/buildscripts/patches/openmw050-final/0002-android-lifecycle.patch b/android/buildscripts/patches/openmw050-final/0002-android-lifecycle.patchdeleted file mode 100644index abc2725..0000000--- a/android/buildscripts/patches/openmw050-final/0002-android-lifecycle.patch+++ /dev/null@@ -1,105 +0,0 @@-diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp---- a/apps/openmw/engine.cpp-+++ b/apps/openmw/engine.cpp-@@ -457,5 +457,8 @@ void OMW::Engine::setSkipMenu(bool skipMenu, bool newGame)- mNewGame = newGame;- }--+// Shared with the Android surface lifecycle bridge in androidmain.cpp.-+osg::ref_ptr<osgViewer::Viewer> g_viewer;-+- void OMW::Engine::createWindow()- {-@@ -660,4 +663,7 @@ void OMW::Engine::createWindow()-- mViewer->getEventQueue()->getCurrentEventState()->setWindowRectangle(- 0, 0, graphicsWindow->getTraits()->width, graphicsWindow->getTraits()->height);-+-+ // Android may destroy/recreate the Surface without terminating the engine.-+ g_viewer = mViewer;- }-@@ -1041,6 +1047,8 @@ void OMW::Engine::go()-- mLuaWorker->join();--+ g_viewer.release();-+- // Save user settings- Settings::Manager::saveUser(mCfgMgr.getUserConfigPath() / "settings.cfg");- Settings::ShaderManager::get().save();-diff --git a/apps/openmw/androidmain.cpp b/apps/openmw/androidmain.cpp---- a/apps/openmw/androidmain.cpp-+++ b/apps/openmw/androidmain.cpp-@@ -4,10 +4,18 @@ int stderr = 0; // Hack: fix linker error- #endif-- #include "SDL_main.h"-+#include "mwbase/environment.hpp"-+#include "mwbase/windowmanager.hpp"-+- #include <SDL_events.h>- #include <SDL_gamecontroller.h>-+#include <SDL_hints.h>- #include <SDL_mouse.h>--+#include <osg/GraphicsContext>-+#include <osg/OperationThread>-+#include <osgViewer/Viewer>-+- /*******************************************************************************- Functions called by JNI- *******************************************************************************/-@@ -60,5 +68,53 @@ extern "C" int Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls,- "guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,"- "righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4");--+ SDL_SetHint(SDL_HINT_ANDROID_BLOCK_ON_PAUSE, "0");-+ SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");-+- return 0;- }-+-+extern osg::ref_ptr<osgViewer::Viewer> g_viewer;-+static osg::GraphicsContext* g_androidContext = nullptr;-+-+class CtxReleaseOperation : public osg::Operation-+{-+public:-+ void operator()(osg::Object*) override-+ {-+ if (g_androidContext)-+ g_androidContext->releaseContext();-+ }-+};-+-+class CtxAcquireOperation : public osg::Operation-+{-+public:-+ void operator()(osg::Object*) override-+ {-+ if (g_androidContext)-+ g_androidContext->makeCurrent();-+ }-+};-+-+extern "C" void Java_org_libsdl_app_SDLActivity_omwSurfaceDestroyed(JNIEnv*, jclass, jobject)-+{-+ if (!g_viewer)-+ return;-+-+ g_androidContext = g_viewer->getCamera()->getGraphicsContext();-+ g_androidContext->add(new CtxReleaseOperation());-+-+ MWBase::Environment::get().getWindowManager()->windowVisibilityChange(false);-+}-+-+extern "C" void Java_org_libsdl_app_SDLActivity_omwSurfaceRecreated(JNIEnv*, jclass, jobject)-+{-+ if (!g_viewer)-+ return;-+-+ g_androidContext = g_viewer->getCamera()->getGraphicsContext();-+ g_androidContext->add(new CtxAcquireOperation());-+-+ MWBase::Environment::get().getWindowManager()->windowVisibilityChange(true);-+}diff --git a/android/buildscripts/patches/openmw050-final/0003-android-ui.patch b/android/buildscripts/patches/openmw050-final/0003-android-ui.patchdeleted file mode 100644index 9dc9b42..0000000--- a/android/buildscripts/patches/openmw050-final/0003-android-ui.patch+++ /dev/null@@ -1,24 +0,0 @@-diff --git a/apps/openmw/mwgui/loadingscreen.cpp b/apps/openmw/mwgui/loadingscreen.cpp---- a/apps/openmw/mwgui/loadingscreen.cpp-+++ b/apps/openmw/mwgui/loadingscreen.cpp-@@ -280,6 +280,8 @@ namespace MWGui-- void LoadingScreen::setupCopyFramebufferToTextureCallback()- {-+ return;-+- // Copy the current framebuffer onto a texture and display that texture as the background image- // Note, we could also set the camera to disable clearing and have the background image transparent,- // but then we get shaking effects on buffer swaps.-diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp---- a/apps/openmw/mwgui/windowmanagerimp.cpp-+++ b/apps/openmw/mwgui/windowmanagerimp.cpp-@@ -1718,7 +1718,7 @@ namespace MWGui-- bool WindowManager::getCursorVisible()- {-- return mCursorVisible && mCursorActive;-+ return mCursorVisible;- }-- void WindowManager::trackWindow(Layout* layout, const WindowSettingValues& settings)diff --git a/android/buildscripts/patches/openmw050-final/0004-static-osg-link.patch b/android/buildscripts/patches/openmw050-final/0004-static-osg-link.patchdeleted file mode 100644index 284a086..0000000--- a/android/buildscripts/patches/openmw050-final/0004-static-osg-link.patch+++ /dev/null@@ -1,18 +0,0 @@-diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt---- a/apps/openmw/CMakeLists.txt-+++ b/apps/openmw/CMakeLists.txt-@@ -187,7 +187,14 @@ target_link_libraries(openmw-lib- )-- if (ANDROID)- target_link_libraries(openmw-lib EGL android log z)-+-+ if (BUILD_OPENMW)-+ # Force static OSG plugin objects into libopenmw.so on Android.-+ find_package(OSGPlugins REQUIRED COMPONENTS ${USED_OSG_PLUGINS})-+ list(APPEND OPENSCENEGRAPH_LIBRARIES ${OSGPlugins_LIBRARIES})-+ target_link_libraries(openmw ${OPENSCENEGRAPH_LIBRARIES} freetype jpeg png)-+ endif()- endif (ANDROID)-- if (USE_SYSTEM_TINYXML)diff --git a/android/buildscripts/patches/openmw050-final/0005-gl4es-save-psa.patch b/android/buildscripts/patches/openmw050-final/0005-gl4es-save-psa.patchdeleted file mode 100644index 7e86b2c..0000000--- a/android/buildscripts/patches/openmw050-final/0005-gl4es-save-psa.patch+++ /dev/null@@ -1,20 +0,0 @@-diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp---- a/apps/openmw/mwstate/statemanagerimp.cpp-+++ b/apps/openmw/mwstate/statemanagerimp.cpp-@@ -19,6 +19,7 @@- #include <components/settings/values.hpp>-- #include <osg/Image>-+#include <osg/Hint>-- #include <osgDB/Registry>--@@ -336,6 +337,8 @@ void MWState::StateManager::saveGame(std::string_view description, const Slot*- Settings::saves().mCharacter.set(Files::pathToUnicodeString(slot->mPath.parent_path().filename()));- mLastSavegame = slot->mPath;--+ osg::Hint::GL4ES_SavePSA();-+- const auto finish = std::chrono::steady_clock::now();-- Log(Debug::Info) << '\'' << description << "' is saved in "diff --git a/android/buildscripts/patches/openmw050-final/0006-ndk-r26-stringstream-compat.patch b/android/buildscripts/patches/openmw050-final/0006-ndk-r26-stringstream-compat.patchdeleted file mode 100644index 41ec711..0000000--- a/android/buildscripts/patches/openmw050-final/0006-ndk-r26-stringstream-compat.patch+++ /dev/null@@ -1,13 +0,0 @@-diff --git a/components/misc/resourcehelpers.cpp b/components/misc/resourcehelpers.cpp---- a/components/misc/resourcehelpers.cpp-+++ b/components/misc/resourcehelpers.cpp-@@ -269,7 +269,8 @@ VFS::Path::Normalized Misc::ResourceHelpers::getLODMeshName(- {- std::stringstream patern;- patern << distantMeshPattern << "_" << l;-- const VFS::Path::Normalized meshName = getBestLODMeshName(resPath, vfs, patern.view());-+ const std::string paternString = patern.str();-+ const VFS::Path::Normalized meshName = getBestLODMeshName(resPath, vfs, paternString);- if (meshName != resPath)- return meshName;- }diff --git a/android/buildscripts/patches/openmw050-final/0007-android-shadow-depth-clamp-fallback.patch b/android/buildscripts/patches/openmw050-final/0007-android-shadow-depth-clamp-fallback.patchdeleted file mode 100644index 9be1834..0000000--- a/android/buildscripts/patches/openmw050-final/0007-android-shadow-depth-clamp-fallback.patch+++ /dev/null@@ -1,39 +0,0 @@-diff --git a/components/sceneutil/mwshadowtechnique.cpp b/components/sceneutil/mwshadowtechnique.cpp---- a/components/sceneutil/mwshadowtechnique.cpp-+++ b/components/sceneutil/mwshadowtechnique.cpp-@@ -1736,10 +1736,19 @@ void MWShadowTechnique::createShaders()- _shadowCastingStateSet->addUniform(new osg::Uniform("alphaTestShadows", false));- osg::ref_ptr<osg::Depth> depth = new osg::Depth;- depth->setWriteMask(true);-+#ifndef ANDROID- osg::ref_ptr<osg::ClipControl> clipcontrol = new osg::ClipControl(osg::ClipControl::LOWER_LEFT, osg::ClipControl::NEGATIVE_ONE_TO_ONE);- _shadowCastingStateSet->setAttribute(clipcontrol, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);-+#endif- _shadowCastingStateSet->setAttribute(depth, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);-+#ifndef ANDROID- _shadowCastingStateSet->setMode(GL_DEPTH_CLAMP, osg::StateAttribute::ON);-+#else-+ // Android/GL4ES exposes neither GL_ARB_clip_control nor GL_DEPTH_CLAMP on-+ // the GLES2 backend used by this port. The Android shadow-casting vertex-+ // shader clamps clip-space Z explicitly, so neither desktop-only state is-+ // required here.-+#endif-- // TODO: compare performance when alpha testing is handled here versus using a discard in the fragment shader- }-diff --git a/files/shaders/compatibility/shadowcasting.vert b/files/shaders/compatibility/shadowcasting.vert---- a/files/shaders/compatibility/shadowcasting.vert-+++ b/files/shaders/compatibility/shadowcasting.vert-@@ -12,6 +12,12 @@ uniform bool alphaTestShadows;- void main(void)- {- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;-+-+ // Android/GL4ES fallback for GL_DEPTH_CLAMP. Cascaded shadow rendering in-+ // OpenMW enables GL_DEPTH_CLAMP, but the GLES2 backend does not expose it.-+ // Clamp clip-space Z explicitly so shadow casters are not discarded at the-+ // shadow camera near/far planes on Android.-+ gl_Position.z = clamp(gl_Position.z, -gl_Position.w, gl_Position.w);-- vec4 viewPos = (gl_ModelViewMatrix * gl_Vertex);- gl_ClipVertex = viewPos;diff --git a/android/buildscripts/patches/openmw050-final/apply-android-gles-depth-fallback.py b/android/buildscripts/patches/openmw050-final/apply-android-gles-depth-fallback.pydeleted file mode 100644index 4b915a7..0000000--- a/android/buildscripts/patches/openmw050-final/apply-android-gles-depth-fallback.py+++ /dev/null@@ -1,58 +0,0 @@-#!/usr/bin/env python3-from pathlib import Path-import sys--if len(sys.argv) != 2:- raise SystemExit("usage: apply-android-gles-depth-fallback.py <openmw-source-dir>")--root = Path(sys.argv[1])-cpp = root / "apps/openmw/mwrender/postprocessor.cpp"-if not cpp.is_file():- raise SystemExit(f"postprocessor.cpp not found: {cpp}")--text = cpp.read_text(encoding="utf-8")-runtime_marker = "Android GLES post-processing depth fallback: sampling Tex_Depth directly"--android_binding = """#ifdef ANDROID- // OpenGL ES cannot reliably populate Tex_OpaqueDepth because that path- // depends on a depth copy/blit. The primary scene depth texture is- // already sampleable, so use it directly for Android post-processing.- mCanvases[frameId]->setTextureDepth(getTexture(Tex_Depth, frameId));-#else- mCanvases[frameId]->setTextureDepth(getTexture(Tex_OpaqueDepth, frameId));-#endif"""--if android_binding not in text:- old = " mCanvases[frameId]->setTextureDepth(getTexture(Tex_OpaqueDepth, frameId));"- count = text.count(old)- if count != 1:- raise SystemExit(- f"Expected exactly one Tex_OpaqueDepth canvas binding, found {count}; refusing ambiguous patch."- )- text = text.replace(old, android_binding, 1)- print("Applied Android canvas depth source: Tex_OpaqueDepth -> Tex_Depth.")-else:- print("Android Tex_Depth canvas fallback already applied.")--if runtime_marker not in text:- anchor = """#ifdef ANDROID- ext->glDisablei = nullptr;-#endif-"""- count = text.count(anchor)- if count != 1:- raise SystemExit(- f"Expected exactly one Android glDisablei anchor, found {count}; refusing ambiguous marker insertion."- )- replacement = anchor + """-#ifdef ANDROID- Log(Debug::Info) << "Android GLES post-processing depth fallback: sampling Tex_Depth directly";-#endif-"""- text = text.replace(anchor, replacement, 1)- print("Added Android depth-fallback runtime marker.")-else:- print("Android depth-fallback runtime marker already present.")--cpp.write_text(text, encoding="utf-8", newline="\n")-print("OpenMW 0.50 Android GLES depth fallback source: READY")diff --git a/android/buildscripts/patches/openmw050-final/apply-android-shadow-gles2-manual-compare.py b/android/buildscripts/patches/openmw050-final/apply-android-shadow-gles2-manual-compare.pydeleted file mode 100644index 9d078fc..0000000--- a/android/buildscripts/patches/openmw050-final/apply-android-shadow-gles2-manual-compare.py+++ /dev/null@@ -1,143 +0,0 @@-#!/usr/bin/env python3-from pathlib import Path-import sys--MARKER = "OPENMW_ANDROID_GLES2_MANUAL_SHADOW_COMPARE"---def read(path: Path) -> str:- return path.read_text(encoding="utf-8")---def write(path: Path, text: str) -> None:- path.write_text(text, encoding="utf-8", newline="\n")---def replace_once(text: str, old: str, new: str, label: str) -> str:- count = text.count(old)- if count != 1:- raise SystemExit(f"{label}: expected exactly one match, found {count}")- return text.replace(old, new, 1)---def remove_once(text: str, old: str, label: str) -> str:- return replace_once(text, old, "", label)---def patch_shadows_fragment(root: Path) -> None:- path = root / "files/shaders/compatibility/shadows_fragment.glsl"- text = read(path)-- if MARKER in text:- return-- text = replace_once(- text,- "#define SHADOWS @shadows_enabled\n",- "#define SHADOWS @shadows_enabled\n\n"- f"// {MARKER}\n"- "// GL4ES uses a GLES2 backend on Android. GLES2 can expose depth textures\n"- "// through GL_OES_depth_texture without exposing EXT_shadow_samplers, so\n"- "// hardware shadow samplers cannot be compiled on those devices.\n"- "// Sample the depth texture as a regular sampler2D and perform the LEQUAL\n"- "// comparison explicitly in GLSL instead.\n",- "shadow fragment marker",- )- text = replace_once(- text,- "uniform sampler2DShadow shadowTexture@shadow_texture_unit_index;",- "uniform sampler2D shadowTexture@shadow_texture_unit_index;",- "shadow sampler type",- )- text = replace_once(- text,- "shadowing = min(shadow2DProj(shadowTexture@shadow_texture_unit_index, shadowSpaceCoords@shadow_texture_unit_index).r, shadowing);",- "shadowing = min(step(shadowXYZ.z, texture2D(shadowTexture@shadow_texture_unit_index, shadowXYZ.xy).r), shadowing);",- "manual shadow depth comparison",- )-- if "uniform sampler2DShadow" in text or "shadow2DProj(" in text:- raise SystemExit("shadow fragment still contains hardware shadow sampler syntax")-- write(path, text)---def patch_shadow_technique(root: Path) -> None:- path = root / "components/sceneutil/mwshadowtechnique.cpp"- text = read(path)-- if MARKER in text:- return-- # Internal OSG fallback shaders must also remain valid if OpenMW ever selects- # them instead of the normal compatibility shader files.- text = text.replace("sampler2DShadow", "sampler2D")- text = text.replace(- "shadow2DProj( shadowTexture, gl_TexCoord[1] ).r",- "step(gl_TexCoord[1].z / gl_TexCoord[1].w, "- "texture2D(shadowTexture, gl_TexCoord[1].xy / gl_TexCoord[1].w).r)",- )-- text = text.replace(- "shadow2DProj( shadowTexture0, gl_TexCoord[shadowTextureUnit0] ).r",- "step(gl_TexCoord[shadowTextureUnit0].z / gl_TexCoord[shadowTextureUnit0].w, "- "texture2D(shadowTexture0, gl_TexCoord[shadowTextureUnit0].xy / gl_TexCoord[shadowTextureUnit0].w).r)",- )- text = text.replace(- "shadow2DProj( shadowTexture1, gl_TexCoord[shadowTextureUnit1] ).r",- "step(gl_TexCoord[shadowTextureUnit1].z / gl_TexCoord[shadowTextureUnit1].w, "- "texture2D(shadowTexture1, gl_TexCoord[shadowTextureUnit1].xy / gl_TexCoord[shadowTextureUnit1].w).r)",- )-- old_texture = """ _texture->setInternalFormat(GL_DEPTH_COMPONENT);\n _texture->setShadowComparison(true);\n _texture->setShadowTextureMode(osg::Texture2D::LUMINANCE);\n }\n\n _texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);\n _texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);\n"""- new_texture = """ _texture->setInternalFormat(GL_DEPTH_COMPONENT);\n#ifdef ANDROID\n // __MARKER__\n // The GLES2 backend has OES_depth_texture but no shadow-sampler support.\n // Keep the depth texture in raw sampling mode; shadows_fragment.glsl\n // performs the LEQUAL comparison manually. NEAREST avoids interpolating\n // depth before that comparison.\n OSG_NOTICE << "Android GLES2 manual shadow comparison enabled" << std::endl;\n _texture->setShadowComparison(false);\n#else\n _texture->setShadowComparison(true);\n _texture->setShadowTextureMode(osg::Texture2D::LUMINANCE);\n#endif\n }\n\n#ifdef ANDROID\n _texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST);\n _texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST);\n#else\n _texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);\n _texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);\n#endif\n""".replace("__MARKER__", MARKER)- text = replace_once(text, old_texture, new_texture, "shadow depth texture sampling mode")-- old_fallback = """ _fallbackShadowMapTexture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST);\n _fallbackShadowMapTexture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST);\n _fallbackShadowMapTexture->setShadowComparison(true);\n _fallbackShadowMapTexture->setShadowCompareFunc(osg::Texture::ShadowCompareFunc::ALWAYS);\n"""- new_fallback = """ _fallbackShadowMapTexture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST);\n _fallbackShadowMapTexture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST);\n#ifdef ANDROID\n _fallbackShadowMapTexture->setShadowComparison(false);\n#else\n _fallbackShadowMapTexture->setShadowComparison(true);\n _fallbackShadowMapTexture->setShadowCompareFunc(osg::Texture::ShadowCompareFunc::ALWAYS);\n#endif\n"""- text = replace_once(text, old_fallback, new_fallback, "fallback shadow texture sampling mode")-- if "sampler2DShadow" in text or "shadow2DProj(" in text:- raise SystemExit("mwshadowtechnique.cpp still contains hardware shadow sampler syntax")-- write(path, text)---def patch_shadow_manager(root: Path) -> None:- path = root / "components/sceneutil/shadow.cpp"- text = read(path)-- if MARKER in text:- return-- old_image = """ osg::ref_ptr<osg::Image> fakeShadowMapImage = new osg::Image();\n fakeShadowMapImage->allocateImage(1, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT);\n *(float*)fakeShadowMapImage->data() = std::numeric_limits<float>::infinity();\n osg::ref_ptr<osg::Texture> fakeShadowMapTexture = new osg::Texture2D(fakeShadowMapImage);\n"""- new_image = f""" osg::ref_ptr<osg::Image> fakeShadowMapImage = new osg::Image();\n#ifdef ANDROID\n // {MARKER}\n // Receiver shaders sample raw depth through sampler2D on GLES2. A white\n // RGBA texel therefore represents an always-unshadowed fallback without\n // requiring unsupported depth-compare texture state.\n fakeShadowMapImage->allocateImage(1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE);\n fakeShadowMapImage->data()[0] = 0xFF;\n fakeShadowMapImage->data()[1] = 0xFF;\n fakeShadowMapImage->data()[2] = 0xFF;\n fakeShadowMapImage->data()[3] = 0xFF;\n#else\n fakeShadowMapImage->allocateImage(1, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT);\n *(float*)fakeShadowMapImage->data() = std::numeric_limits<float>::infinity();\n#endif\n osg::ref_ptr<osg::Texture> fakeShadowMapTexture = new osg::Texture2D(fakeShadowMapImage);\n"""- text = replace_once(text, old_image, new_image, "fake shadow map image")-- old_compare = """ fakeShadowMapTexture->setShadowComparison(true);\n fakeShadowMapTexture->setShadowCompareFunc(osg::Texture::ShadowCompareFunc::ALWAYS);\n"""- new_compare = """#ifdef ANDROID\n fakeShadowMapTexture->setShadowComparison(false);\n#else\n fakeShadowMapTexture->setShadowComparison(true);\n fakeShadowMapTexture->setShadowCompareFunc(osg::Texture::ShadowCompareFunc::ALWAYS);\n#endif\n"""- text = replace_once(text, old_compare, new_compare, "fake shadow map comparison mode")-- write(path, text)---def main() -> None:- if len(sys.argv) != 2:- raise SystemExit("usage: apply-android-shadow-gles2-manual-compare.py <openmw-source-dir>")-- root = Path(sys.argv[1]).resolve()- if not (root / "CMakeLists.txt").is_file():- raise SystemExit(f"OpenMW source directory not found: {root}")-- patch_shadows_fragment(root)- patch_shadow_technique(root)- patch_shadow_manager(root)-- print("OpenMW Android GLES2 manual shadow comparison: READY")- print(" sampler2DShadow/shadow2DProj: replaced with sampler2D + explicit LEQUAL")- print(" shadow depth textures: raw-sampling mode on Android")- print(" fake shadow textures: GLES2-safe white fallback")---if __name__ == "__main__":- main()diff --git a/android/buildscripts/patches/openmw050-final/apply-ndk-r26-format.py b/android/buildscripts/patches/openmw050-final/apply-ndk-r26-format.pydeleted file mode 100644index 342131a..0000000--- a/android/buildscripts/patches/openmw050-final/apply-ndk-r26-format.py+++ /dev/null@@ -1,106 +0,0 @@-#!/usr/bin/env python3-from pathlib import Path-import sys--if len(sys.argv) != 2:- raise SystemExit('usage: apply-ndk-r26-format.py <openmw-source-dir>')--root = Path(sys.argv[1])-cmake = root / 'CMakeLists.txt'-openmw_cmake = root / 'apps' / 'openmw' / 'CMakeLists.txt'--for path in (cmake, openmw_cmake):- if not path.is_file():- raise SystemExit(f'missing expected OpenMW 0.50 source file: {path}')--marker_compile = 'OPENMW_ANDROID_NDK_R26_EXPERIMENTAL_FORMAT'-marker_probe = 'OPENMW_ANDROID_NDK_R26_FORMAT_PROBE'-marker_link = 'OPENMW_ANDROID_NDK_R26_EXPERIMENTAL_FORMAT_LINK'--text = cmake.read_text(encoding='utf-8')-if marker_compile not in text:- needle = 'set(CMAKE_CXX_EXTENSIONS OFF)\n'- if text.count(needle) != 1:- raise SystemExit('could not locate unique CMAKE_CXX_EXTENSIONS anchor in OpenMW 0.50 CMakeLists.txt')- replacement = needle + r'''-# OPENMW_ANDROID_NDK_R26_EXPERIMENTAL_FORMAT-# Android NDK r26b ships a libc++ 17 snapshot whose <format> implementation is-# still hidden by _LIBCPP_HAS_NO_INCOMPLETE_FORMAT unless the libc++-# experimental-library gate is enabled. OpenMW 0.50 uses std::format in both-# components and game code, so enable that vendor gate for Android C++ files.-if (ANDROID AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")- add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-fexperimental-library>")-- # OPENMW_ANDROID_NDK_R26_FORMAT_PROBE- # Fail during CMake configuration, before the long OpenMW compile, unless- # the exact Android toolchain can compile *and link* both the simple and- # floating-point formatting forms used by OpenMW 0.50.- include(CheckCXXSourceCompiles)- set(_openmw_saved_required_flags "${CMAKE_REQUIRED_FLAGS}")- set(_openmw_saved_required_libraries "${CMAKE_REQUIRED_LIBRARIES}")- set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fexperimental-library")- list(APPEND CMAKE_REQUIRED_LIBRARIES c++experimental)- check_cxx_source_compiles([=[- #include <format>- #include <string>- int main()- {- const std::string a = std::format("value={}", 42);- const std::string b = std::format("{:.3f}", 1.25f);- return (a.empty() || b.empty()) ? 1 : 0;- }- ]=] OPENMW_ANDROID_NDK_R26_STD_FORMAT_WORKS)- set(CMAKE_REQUIRED_FLAGS "${_openmw_saved_required_flags}")- set(CMAKE_REQUIRED_LIBRARIES "${_openmw_saved_required_libraries}")- unset(_openmw_saved_required_flags)- unset(_openmw_saved_required_libraries)-- if (NOT OPENMW_ANDROID_NDK_R26_STD_FORMAT_WORKS)- message(FATAL_ERROR- "Android NDK r26 std::format probe failed. The toolchain must support "- "-fexperimental-library and libc++experimental before OpenMW 0.50 can be built.")- endif()-endif()-'''- text = text.replace(needle, replacement, 1)- cmake.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android NDK r26 std::format compile support (-fexperimental-library).')- print('Installed configure-time std::format compile/link probe.')-else:- print('Android NDK r26 std::format compile support is already applied.')- if marker_probe in text:- print('Android NDK r26 std::format configure-time probe is already applied.')- else:- raise SystemExit('format compile marker exists but configure-time probe marker is missing')--text = openmw_cmake.read_text(encoding='utf-8')-if marker_link not in text:- needle = ' target_link_libraries(openmw openmw-lib)\n'- if text.count(needle) != 1:- raise SystemExit('could not locate unique openmw target_link_libraries anchor in OpenMW 0.50 apps/openmw/CMakeLists.txt')- replacement = needle + r'''-- # OPENMW_ANDROID_NDK_R26_EXPERIMENTAL_FORMAT_LINK- # The r26b gated format implementation has out-of-line support in- # libc++experimental.a. Keep the extra library Android-only.- if (ANDROID)- target_link_libraries(openmw c++experimental)- endif()-'''- text = text.replace(needle, replacement, 1)- openmw_cmake.write_text(text, encoding='utf-8', newline='\n')- print('Linked Android OpenMW against libc++experimental for std::format.')-else:- print('Android libc++experimental std::format link support is already applied.')--# Strict verification: compile gate, configure-time probe and final link support-# are all required. Missing one of them must stop the patch step immediately.-verify_cmake = cmake.read_text(encoding='utf-8')-verify_openmw = openmw_cmake.read_text(encoding='utf-8')-for marker in (marker_compile, marker_probe):- if marker not in verify_cmake:- raise SystemExit(f'verification failed: {marker} missing')-if marker_link not in verify_openmw:- raise SystemExit('verification failed: Android libc++experimental link marker missing')--print('OpenMW 0.50 Android NDK r26 C++20 format compatibility: READY')diff --git a/android/buildscripts/patches/openmw050-final/apply-omwfx050-diagnostics.py b/android/buildscripts/patches/openmw050-final/apply-omwfx050-diagnostics.pydeleted file mode 100644index 249e4bb..0000000--- a/android/buildscripts/patches/openmw050-final/apply-omwfx050-diagnostics.py+++ /dev/null@@ -1,202 +0,0 @@-#!/usr/bin/env python3-from __future__ import annotations--import sys-from pathlib import Path--MARKER = "OMWFX050-DIAG"-STARTUP_MARKER = "Android post-processing startup stabilization: scheduling final chain rebuild after 4 completed draws at "---def die(msg: str) -> None:- raise SystemExit("ERROR: " + msg)---def read(path: Path) -> str:- if not path.is_file():- die(f"required OpenMW source file is missing: {path}")- return path.read_text(encoding="utf-8")---def write(path: Path, text: str) -> None:- path.write_text(text.replace("\r\n", "\n"), encoding="utf-8", newline="\n")---def replace_once(text: str, old: str, new: str, label: str) -> str:- count = text.count(old)- if count != 1:- die(f"{label}: expected exactly one source anchor, found {count}")- return text.replace(old, new, 1)---def main() -> None:- if len(sys.argv) != 2:- die("usage: apply-omwfx050-diagnostics.py <OpenMW-source-dir>")-- root = Path(sys.argv[1]).resolve()- cpp_path = root / "apps/openmw/mwrender/postprocessor.cpp"- cpp = read(cpp_path)-- if STARTUP_MARKER not in cpp:- die("the established Android 4-draw post-processing stabilization is missing; refusing to patch another source baseline")-- if MARKER in cpp:- for token in (- "OMWFX050-DIAG: capability",- "OMWFX050-DIAG: load file=",- "OMWFX050-DIAG: loadChain configuredCount=",- "OMWFX050-DIAG: dirty name=",- "OMWFX050-DIAG: dispatch templates=",- ):- if token not in cpp:- die(f"diagnostic marker exists but required token is missing: {token}")- print("OpenMW 0.50 OMWFX diagnostics: already applied")- return-- # Runtime capability and discovery summary. This executes after OpenMW has- # populated mTechniqueFiles and queried the real GL context.- cpp = replace_once(- cpp,- """ mGLSLVersion = ext->glslLanguageVersion * 100;- mUBO = ext->isUniformBufferObjectSupported && mGLSLVersion >= 330;- mStateUpdater = new Fx::StateUpdater(mUBO);""",- """ mGLSLVersion = ext->glslLanguageVersion * 100;- mUBO = ext->isUniformBufferObjectSupported && mGLSLVersion >= 330;-#ifdef ANDROID- Log(Debug::Info) << "OMWFX050-DIAG: capability glsl=" << mGLSLVersion- << " ubo=" << mUBO- << " normalsSupported=" << mNormalsSupported- << " discoveredFiles=" << mTechniqueFiles.size();-#endif- mStateUpdater = new Fx::StateUpdater(mUBO);""",- "capability summary",- )-- # Capture the exact normalized path lookup result and parser/compiler state- # for every requested technique. All getters below are already used by the- # 0.50 PostProcessor implementation, so this adds logging only.- cpp = replace_once(- cpp,- """ std::string name;- if (mTechniqueFiles.contains(path))- name = mVFS->getStem(path);- else- name = path.stem();-- auto technique = std::make_shared<Fx::Technique>(*mVFS, *mRendering.getResourceSystem()->getImageManager(),- path, std::move(name), renderWidth(), renderHeight(), mUBO, mNormalsSupported);-- technique->compile();""",- """ const bool discovered = mTechniqueFiles.contains(path);- std::string name;- if (discovered)- name = mVFS->getStem(path);- else- name = path.stem();-- auto technique = std::make_shared<Fx::Technique>(*mVFS, *mRendering.getResourceSystem()->getImageManager(),- path, std::move(name), renderWidth(), renderHeight(), mUBO, mNormalsSupported);-- const bool compiled = technique->compile();-#ifdef ANDROID- Log(Debug::Info) << "OMWFX050-DIAG: load file=" << technique->getFileName()- << " name=" << technique->getName()- << " discovered=" << discovered- << " compiled=" << compiled- << " valid=" << technique->isValid()- << " status=" << static_cast<int>(technique->getStatus())- << " glsl=" << technique->getGLSLVersion()- << " passes=" << technique->getPasses().size();-#endif""",- "technique load diagnostics",- )-- # Log the configured chain before OpenMW resolves it, and every requested- # name individually. This proves that Settings reached the native loader.- cpp = replace_once(- cpp,- """ for (const std::string& techniqueName : Settings::postProcessing().mChain.get())- {- if (techniqueName.empty())- continue;-- mTechniques.push_back(loadTechnique(techniqueName));- }""",- """#ifdef ANDROID- Log(Debug::Info) << "OMWFX050-DIAG: loadChain configuredCount="- << Settings::postProcessing().mChain.get().size();-#endif- for (const std::string& techniqueName : Settings::postProcessing().mChain.get())- {- if (techniqueName.empty())- continue;--#ifdef ANDROID- Log(Debug::Info) << "OMWFX050-DIAG: loadChain request=" << techniqueName;-#endif- mTechniques.push_back(loadTechnique(techniqueName));- }""",- "chain diagnostics",- )-- # Log the validity/GLSL/pass state immediately before 0.50's normal filters.- cpp = replace_once(- cpp,- """ for (const auto& technique : mTechniques)- {- if (!technique->isValid())- continue;""",- """ for (const auto& technique : mTechniques)- {-#ifdef ANDROID- Log(Debug::Info) << "OMWFX050-DIAG: dirty name=" << technique->getName()- << " file=" << technique->getFileName()- << " internal=" << technique->getInternal()- << " valid=" << technique->isValid()- << " status=" << static_cast<int>(technique->getStatus())- << " techniqueGlsl=" << technique->getGLSLVersion()- << " hardwareGlsl=" << mGLSLVersion- << " passes=" << technique->getPasses().size();-#endif- if (!technique->isValid())- continue;""",- "dirty-technique diagnostics",- )-- cpp = replace_once(- cpp,- """ mCanvases[frameId]->setPasses(Fx::DispatchArray(mTemplateData));-- if (auto hud = MWBase::Environment::get().getWindowManager()->getPostProcessorHud())""",- """ mCanvases[frameId]->setPasses(Fx::DispatchArray(mTemplateData));-#ifdef ANDROID- Log(Debug::Info) << "OMWFX050-DIAG: dispatch templates=" << mTemplateData.size()- << " frameId=" << frameId- << " usePostProcessing=" << mUsePostProcessing;-#endif-- if (auto hud = MWBase::Environment::get().getWindowManager()->getPostProcessorHud())""",- "dispatch diagnostics",- )-- for token in (- "OMWFX050-DIAG: capability",- "OMWFX050-DIAG: load file=",- "OMWFX050-DIAG: loadChain configuredCount=",- "OMWFX050-DIAG: loadChain request=",- "OMWFX050-DIAG: dirty name=",- "OMWFX050-DIAG: dispatch templates=",- STARTUP_MARKER,- ):- if token not in cpp:- die(f"post-patch verification failed: {token}")-- write(cpp_path, cpp)- print("OpenMW 0.50 OMWFX diagnostics: READY")- print(" logs capability + VFS discovery count")- print(" logs each configured technique load/compile/validity/GLSL/pass count")- print(" logs dirtyTechniques filtering inputs and final dispatch-template count")---if __name__ == "__main__":- main()diff --git a/android/buildscripts/patches/openmw050-final/apply-postprocessing-final.py b/android/buildscripts/patches/openmw050-final/apply-postprocessing-final.pydeleted file mode 100644index 07c7fb4..0000000--- a/android/buildscripts/patches/openmw050-final/apply-postprocessing-final.py+++ /dev/null@@ -1,472 +0,0 @@-#!/usr/bin/env python3-from __future__ import annotations--import sys-from pathlib import Path--MARKER = "Android post-processing startup stabilization: scheduling final chain rebuild after 4 completed draws at "-DEPTH_MARKER = "Android GLES post-processing depth fallback: sampling Tex_Depth directly"-WATER_MASK_MARKER = "Android WetWorld water alpha mask"--def die(msg: str) -> None:- raise SystemExit("ERROR: " + msg)--def read(path: Path) -> str:- if not path.is_file():- die(f"required OpenMW 0.50 source file is missing: {path}")- return path.read_text(encoding="utf-8")--def write(path: Path, text: str) -> None:- path.write_text(text.replace("\r\n", "\n"), encoding="utf-8", newline="\n")--def replace_once(text: str, old: str, new: str, label: str) -> str:- count = text.count(old)- if count != 1:- die(f"{label}: expected exactly one source anchor, found {count}")- return text.replace(old, new, 1)--def require(text: str, token: str, label: str) -> None:- if token not in text:- die(f"{label}: verification token missing: {token}")--def patch_header(path: Path) -> None:- text = read(path)- if "mAndroidPostProcessingCompletedDraws" in text and "signalAndroidPostProcessingStabilizeDraw" in text:- require(text, "#include <atomic>", "postprocessor.hpp")- require(text, "mAndroidPostProcessingStartupPending", "postprocessor.hpp")- return-- text = replace_once(- text,- "#include <array>\n#include <string>",- "#include <array>\n#include <atomic>\n#include <string>",- "postprocessor.hpp atomic include",- )-- text = replace_once(- text,- " void loadChain();\n void saveChain();\n\n private:",- """ void loadChain();- void saveChain();--#ifdef ANDROID- void signalAndroidPostProcessingWarmupDraw();- void signalAndroidPostProcessingStabilizeDraw();-#endif-- private:""",- "postprocessor.hpp Android signal methods",- )-- text = replace_once(- text,- """ bool mTriggerShaderReload = false;- bool mUsePostProcessing = false;-- bool mUBO = false;""",- """ bool mTriggerShaderReload = false;- bool mUsePostProcessing = false;--#ifdef ANDROID- std::atomic_bool mAndroidPostProcessingStartupPending{ false };- std::atomic_bool mAndroidPostProcessingWarmupDrawComplete{ false };- std::atomic_bool mAndroidPostProcessingStabilizePending{ false };- std::atomic_uint mAndroidPostProcessingCompletedDraws{ 0 };-#endif-- bool mUBO = false;""",- "postprocessor.hpp Android startup state",- )-- require(text, "mAndroidPostProcessingCompletedDraws", "postprocessor.hpp")- write(path, text)--def patch_cpp(path: Path) -> None:- text = read(path)- if MARKER in text:- for token in (- "class AndroidPostProcessingStartupDrawCallback",- "class AndroidPostProcessingStabilizeDrawCallback",- "signalAndroidPostProcessingWarmupDraw",- "signalAndroidPostProcessingStabilizeDraw",- "Android post-processing startup: waiting for one completed GL draw",- ):- require(text, token, "postprocessor.cpp")- return-- callbacks = """#ifdef ANDROID- class AndroidPostProcessingStartupDrawCallback : public osg::Camera::DrawCallback- {- public:- explicit AndroidPostProcessingStartupDrawCallback(MWRender::PostProcessor* postProcessor)- : mPostProcessor(postProcessor)- {- }-- void operator()(osg::RenderInfo&) const override- {- mPostProcessor->signalAndroidPostProcessingWarmupDraw();- }-- private:- MWRender::PostProcessor* mPostProcessor;- };-- class AndroidPostProcessingStabilizeDrawCallback : public osg::Camera::DrawCallback- {- public:- explicit AndroidPostProcessingStabilizeDrawCallback(MWRender::PostProcessor* postProcessor)- : mPostProcessor(postProcessor)- {- }-- void operator()(osg::RenderInfo&) const override- {- mPostProcessor->signalAndroidPostProcessingStabilizeDraw();- }-- private:- MWRender::PostProcessor* mPostProcessor;- };-#endif--"""- text = replace_once(- text,- " class HUDCullCallback : public SceneUtil::NodeCallback<HUDCullCallback, osg::Camera*, osgUtil::CullVisitor*>",- callbacks + " class HUDCullCallback : public SceneUtil::NodeCallback<HUDCullCallback, osg::Camera*, osgUtil::CullVisitor*>",- "postprocessor.cpp Android draw callbacks",- )-- text = replace_once(- text,- """ osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext();- osg::GLExtensions* ext = gc->getState()->get<osg::GLExtensions>();-- mWidth = gc->getTraits()->width;- mHeight = gc->getTraits()->height;-- if (!ext->glDisablei && ext->glDisableIndexedEXT)""",- " if (!ext->glDisablei && ext->glDisableIndexedEXT)",- "postprocessor.cpp move initial render-target size",- )-- text = replace_once(- text,- """ , mDistortionCallback(new DistortionCallback)- {- auto& shaderManager""",- """ , mDistortionCallback(new DistortionCallback)- {- // Android/GL4ES needs the real GraphicsContext dimensions before the- // HUD/post-processing cameras and ping-pong FBOs are constructed.- osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext();- osg::GLExtensions* ext = gc->getState()->get<osg::GLExtensions>();- mWidth = gc->getTraits()->width;- mHeight = gc->getTraits()->height;-- auto& shaderManager""",- "postprocessor.cpp early render-target size",- )-- startup = """#ifdef ANDROID- if (mUsePostProcessing)- {- mAndroidPostProcessingStabilizePending.store(true, std::memory_order_release);- mAndroidPostProcessingCompletedDraws.store(0, std::memory_order_release);- mViewer->getCamera()->setFinalDrawCallback(new AndroidPostProcessingStabilizeDrawCallback(this));- Log(Debug::Info) << "Android post-processing startup stabilization v14.0/OpenMW-0.50 armed";- }-- if (mUsePostProcessing)- {- mReload = false;- mUsePostProcessing = false;- mAndroidPostProcessingStartupPending.store(true, std::memory_order_release);- mAndroidPostProcessingWarmupDrawComplete.store(false, std::memory_order_release);- mHUDCamera->setFinalDrawCallback(new AndroidPostProcessingStartupDrawCallback(this));- Log(Debug::Info) << "Android post-processing startup: waiting for one completed GL draw";- }-#else- if (mUsePostProcessing)- enable();-#endif"""- text = replace_once(- text,- """ if (mUsePostProcessing)- enable();""",- startup,- "postprocessor.cpp deferred Android startup",- )-- text = replace_once(- text,- """ void PostProcessor::disable()- {- mUsePostProcessing = false;- mRendering.getSkyManager()->setSunglare(true);- }-- void PostProcessor::traverse""",- """ void PostProcessor::disable()- {-#ifdef ANDROID- mAndroidPostProcessingStabilizePending.store(false, std::memory_order_release);- mAndroidPostProcessingCompletedDraws.store(0, std::memory_order_release);- mAndroidPostProcessingStartupPending.store(false, std::memory_order_release);- mAndroidPostProcessingWarmupDrawComplete.store(false, std::memory_order_release);-#endif- mUsePostProcessing = false;- mRendering.getSkyManager()->setSunglare(true);- }--#ifdef ANDROID- void PostProcessor::signalAndroidPostProcessingWarmupDraw()- {- if (mAndroidPostProcessingStartupPending.load(std::memory_order_acquire))- mAndroidPostProcessingWarmupDrawComplete.store(true, std::memory_order_release);- }-- void PostProcessor::signalAndroidPostProcessingStabilizeDraw()- {- if (mAndroidPostProcessingStabilizePending.load(std::memory_order_acquire))- mAndroidPostProcessingCompletedDraws.fetch_add(1, std::memory_order_acq_rel);- }-#endif-- void PostProcessor::traverse""",- "postprocessor.cpp disable/signal methods",- )-- update_block = """ updateLiveReload();--#ifdef ANDROID- if (mUsePostProcessing && mAndroidPostProcessingStabilizePending.load(std::memory_order_acquire)- && mAndroidPostProcessingCompletedDraws.load(std::memory_order_acquire) >= 4)- {- mAndroidPostProcessingStabilizePending.store(false, std::memory_order_release);- mAndroidPostProcessingCompletedDraws.store(0, std::memory_order_release);-- if (const osg::Viewport* viewport = mViewer->getCamera()->getViewport())- {- const int width = static_cast<int>(viewport->width());- const int height = static_cast<int>(viewport->height());- if (width > 0 && height > 0)- setRenderTargetSize(width, height);- }-- mReload = true;- Log(Debug::Info)- << "Android post-processing startup stabilization: scheduling final chain rebuild after 4 completed draws at "- << mWidth << "x" << mHeight;- }-- if (mAndroidPostProcessingStartupPending.load(std::memory_order_acquire)- && mAndroidPostProcessingWarmupDrawComplete.exchange(false, std::memory_order_acq_rel))- {- if (const osg::Viewport* viewport = mViewer->getCamera()->getViewport())- {- const int width = static_cast<int>(viewport->width());- const int height = static_cast<int>(viewport->height());- if (width > 0 && height > 0)- setRenderTargetSize(width, height);- }-- mAndroidPostProcessingStartupPending.store(false, std::memory_order_release);- enable();- Log(Debug::Info) << "Android post-processing startup: GL warm-up complete, rebuilding chain at "- << mWidth << "x" << mHeight;- }-#endif-- reloadIfRequired();"""- text = replace_once(- text,- """ updateLiveReload();-- reloadIfRequired();""",- update_block,- "postprocessor.cpp startup update path",- )-- for token in (- MARKER,- "class AndroidPostProcessingStartupDrawCallback",- "class AndroidPostProcessingStabilizeDrawCallback",- "mWidth = gc->getTraits()->width;",- "Android post-processing startup stabilization v14.0/OpenMW-0.50 armed",- ):- require(text, token, "postprocessor.cpp")-- write(path, text)---def patch_android_depth(path: Path) -> None:- text = read(path)-- # OpenMW 0.50 normally exposes Tex_OpaqueDepth to post-processing.- # On Android GLES/GL4ES the separate opaque-depth copy is unreliable.- # The primary scene depth texture is sampleable and has been verified- # on-device, so bind it directly for Android only.- android_depth_block = """#ifdef ANDROID- // Android GLES/GL4ES: use the primary sampleable scene depth texture.- mCanvases[frameId]->setTextureDepth(getTexture(Tex_Depth, frameId));-#else- mCanvases[frameId]->setTextureDepth(getTexture(Tex_OpaqueDepth, frameId));-#endif"""-- direct_binding = "mCanvases[frameId]->setTextureDepth(getTexture(Tex_Depth, frameId));"-- if direct_binding not in text:- text = replace_once(- text,- " mCanvases[frameId]->setTextureDepth(getTexture(Tex_OpaqueDepth, frameId));",- android_depth_block,- "postprocessor.cpp Android GLES depth binding",- )-- if DEPTH_MARKER not in text:- anchor = """#ifdef ANDROID- ext->glDisablei = nullptr;-#endif-"""- replacement = anchor + """-#ifdef ANDROID- Log(Debug::Info) << "Android GLES post-processing depth fallback: sampling Tex_Depth directly";-#endif-"""- text = replace_once(- text,- anchor,- replacement,- "postprocessor.cpp Android depth runtime marker",- )-- require(text, direct_binding, "postprocessor.cpp")- require(text, DEPTH_MARKER, "postprocessor.cpp")- write(path, text)--def patch_water_alpha_mask(path: Path) -> None:- text = read(path)-- # WetWorld runs after water has already been composed into the scene colour.- # On Android the water surface does not provide a reliable per-pixel depth- # identity, so mark visible water in the scene alpha channel instead.- if WATER_MASK_MARKER in text:- require(text, "#include <osg/BlendFunc>", "water.cpp")- require(text, "osg::BlendFunc::ZERO, osg::BlendFunc::ZERO", "water.cpp")- return-- text = replace_once(- text,- "#include <osg/ClipNode>\n#include <osg/Depth>",- "#include <osg/BlendFunc>\n#include <osg/ClipNode>\n#include <osg/Depth>",- "water.cpp BlendFunc include",- )-- simple_anchor = """ osg::ref_ptr<osg::StateSet> stateset = SceneUtil::createSimpleWaterStateSet(alpha, MWRender::RenderBin_Water);-- node->setStateSet(stateset);"""- simple_replacement = """ osg::ref_ptr<osg::StateSet> stateset = SceneUtil::createSimpleWaterStateSet(alpha, MWRender::RenderBin_Water);--#ifdef ANDROID- // Android WetWorld water alpha mask: preserve normal RGB blending while- // forcing visible water pixels to alpha 0 in the scene colour target.- stateset->setAttributeAndModes(- new osg::BlendFunc(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA,- osg::BlendFunc::ZERO, osg::BlendFunc::ZERO),- osg::StateAttribute::ON);-#endif-- node->setStateSet(stateset);"""- text = replace_once(text, simple_anchor, simple_replacement, "water.cpp simple water alpha mask")-- shader_anchor = """ else- {- stateset->setMode(GL_BLEND, osg::StateAttribute::ON);- stateset->setRenderBinDetails(MWRender::RenderBin_Water, "RenderBin");"""- shader_replacement = """ else- {- stateset->setMode(GL_BLEND, osg::StateAttribute::ON);-#ifdef ANDROID- // Android WetWorld water alpha mask: RGB keeps the standard- // source-alpha blend, alpha is replaced with 0. Water shading and- // rain ripples remain untouched.- stateset->setAttributeAndModes(- new osg::BlendFunc(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA,- osg::BlendFunc::ZERO, osg::BlendFunc::ZERO),- osg::StateAttribute::ON);-#endif- stateset->setRenderBinDetails(MWRender::RenderBin_Water, "RenderBin");"""- text = replace_once(text, shader_anchor, shader_replacement, "water.cpp shader water alpha mask")-- define_anchor = """ defineMap["wobblyShores"] = Settings::water().mWobblyShores ? "1" : "0";-- Stereo::shaderStereoDefines(defineMap);"""- define_replacement = """ defineMap["wobblyShores"] = Settings::water().mWobblyShores ? "1" : "0";-#ifdef ANDROID- defineMap["wetWorldWaterMask"] = "1";-#else- defineMap["wetWorldWaterMask"] = "0";-#endif-- Stereo::shaderStereoDefines(defineMap);"""- text = replace_once(text, define_anchor, define_replacement, "water.cpp WetWorld shader define")-- require(text, WATER_MASK_MARKER, "water.cpp")- require(text, "osg::BlendFunc::ZERO, osg::BlendFunc::ZERO", "water.cpp")- write(path, text)---def patch_water_shader_alpha(path: Path) -> None:- text = read(path)-- if WATER_MASK_MARKER in text:- require(text, "#if @wetWorldWaterMask", "water.frag")- require(text, "gl_FragData[0].a = 0.0;", "water.frag")- return-- # With refraction enabled water is rendered without the transparent blend- # branch, so mark those water pixels directly in alpha. RGB stays unchanged.- text = replace_once(- text,- """ gl_FragData[0].rgb = mix(refraction, reflection, fresnel);- gl_FragData[0].a = 1.0;""",- """ gl_FragData[0].rgb = mix(refraction, reflection, fresnel);-#if @wetWorldWaterMask- // Android WetWorld water alpha mask. Only alpha is used as a post-process- // marker; RGB water shading, wave response and rain ripples are unchanged.- gl_FragData[0].a = 0.0;-#else- gl_FragData[0].a = 1.0;-#endif""",- "water.frag refraction alpha marker",- )-- require(text, WATER_MASK_MARKER, "water.frag")- require(text, "#if @wetWorldWaterMask", "water.frag")- require(text, "gl_FragData[0].a = 0.0;", "water.frag")- write(path, text)---def main() -> None:- if len(sys.argv) != 2:- die("usage: apply-postprocessing-final.py <OpenMW-source-dir>")-- root = Path(sys.argv[1]).resolve()- patch_header(root / "apps/openmw/mwrender/postprocessor.hpp")- cpp = root / "apps/openmw/mwrender/postprocessor.cpp"- patch_cpp(cpp)- patch_android_depth(cpp)- patch_water_alpha_mask(root / "apps/openmw/mwrender/water.cpp")- patch_water_shader_alpha(root / "files/shaders/compatibility/water.frag")-- print("OpenMW 0.50 Android post-processing final state: READY")- print(" early FBO size initialization: applied")- print(" one completed GL warm-up draw: applied")- print(" four-draw final chain stabilization: applied")- print(" Android GLES direct scene-depth binding: applied")- print(" WetWorld exact water alpha marker: applied")--if __name__ == "__main__":- main()diff --git a/android/buildscripts/patches/openmw050-final/apply-runtime-water-shader-sync.py b/android/buildscripts/patches/openmw050-final/apply-runtime-water-shader-sync.pydeleted file mode 100644index 564409c..0000000--- a/android/buildscripts/patches/openmw050-final/apply-runtime-water-shader-sync.py+++ /dev/null@@ -1,59 +0,0 @@-#!/usr/bin/env python3-from pathlib import Path-import sys--MARKER = 'Synced runtime water.frag for WetWorld mask'---def die(msg: str) -> None:- raise SystemExit('ERROR: ' + msg)---def main() -> None:- if len(sys.argv) != 2:- die('usage: apply-runtime-water-shader-sync.py <MainActivity.kt>')-- path = Path(sys.argv[1])- if not path.is_file():- die(f'MainActivity.kt not found: {path}')-- text = path.read_text(encoding='utf-8')- if MARKER in text:- required = [- '"shaders/compatibility/water.frag"',- 'assets.open(assetPath)',- 'privateTarget.copyTo(userTarget, overwrite = true)',- '@wetWorldWaterMask',- ]- for needle in required:- if needle not in text:- die(f'existing runtime water sync marker found but required code is missing: {needle}')- print('MainActivity runtime water shader sync: already applied')- return-- old = ''' // Core compatibility shaders come from the generated OpenMW resource tree.\n val coreRelativePaths = listOf(\n "shaders/compatibility/fullscreen_tri.vert",\n "shaders/compatibility/shadowcasting.vert"\n )\n\n coreRelativePaths.forEach { relativePath ->\n val source = File(Constants.RESOURCES, relativePath)\n val target = File(Constants.USER_FILE_STORAGE + "/resources/", relativePath)\n\n if (!source.isFile) {\n throw IOException("Missing Android compatibility shader: ${source.absolutePath}")\n }\n\n target.parentFile?.mkdirs()\n source.copyTo(target, overwrite = true)\n }\n'''-- new = ''' // Core compatibility shaders must be refreshed from the APK itself on every\n // development launch. VERSION_CODE can stay unchanged, so both the private\n // resource tree and the writable user mirror may otherwise keep stale files.\n // water.frag carries the Android WetWorld water-alpha marker from v14.5.5.\n val coreRelativePaths = listOf(\n "shaders/compatibility/fullscreen_tri.vert",\n "shaders/compatibility/shadowcasting.vert",\n "shaders/compatibility/water.frag"\n )\n\n coreRelativePaths.forEach { relativePath ->\n val assetPath = "libopenmw/resources/$relativePath"\n val privateTarget = File(Constants.RESOURCES, relativePath)\n val userTarget = File(Constants.USER_FILE_STORAGE + "/resources/", relativePath)\n\n privateTarget.parentFile?.mkdirs()\n assets.open(assetPath).use { input ->\n privateTarget.outputStream().use { output ->\n input.copyTo(output)\n }\n }\n\n userTarget.parentFile?.mkdirs()\n privateTarget.copyTo(userTarget, overwrite = true)\n\n if (relativePath == "shaders/compatibility/water.frag") {\n val hasWetWorldWaterMask = try {\n userTarget.readText().contains("@wetWorldWaterMask")\n } catch (e: IOException) {\n false\n }\n\n if (!hasWetWorldWaterMask) {\n throw IOException(\n "Runtime water.frag is missing the WetWorld water-mask marker: ${userTarget.absolutePath}"\n )\n }\n\n Log.i(\n TAG,\n "Synced runtime water.frag for WetWorld mask; marker=true; size=${userTarget.length()}"\n )\n }\n }\n'''-- count = text.count(old)- if count != 1:- die(f'expected exactly one legacy core shader sync block, found {count}')-- text = text.replace(old, new, 1)- path.write_text(text, encoding='utf-8')-- for needle in [- MARKER,- '"shaders/compatibility/water.frag"',- 'assets.open(assetPath)',- 'privateTarget.copyTo(userTarget, overwrite = true)',- '@wetWorldWaterMask',- ]:- if needle not in text:- die(f'post-patch verification failed: {needle}')-- print('MainActivity runtime water shader sync: applied')---if __name__ == '__main__':- main()diff --git a/android/buildscripts/patches/openmw050-final/remove-omwfx050-diagnostics.py b/android/buildscripts/patches/openmw050-final/remove-omwfx050-diagnostics.pydeleted file mode 100644index 9f8fac6..0000000--- a/android/buildscripts/patches/openmw050-final/remove-omwfx050-diagnostics.py+++ /dev/null@@ -1,157 +0,0 @@-#!/usr/bin/env python3-from __future__ import annotations--import sys-from pathlib import Path--MARKER = "OMWFX050-DIAG"--def die(msg: str) -> None:- raise SystemExit("ERROR: " + msg)--def replace_once(text: str, old: str, new: str, label: str) -> str:- count = text.count(old)- if count != 1:- die(f"{label}: expected exactly one diagnostic block, found {count}")- return text.replace(old, new, 1)--def main() -> None:- if len(sys.argv) != 2:- die("usage: remove-omwfx050-diagnostics.py <OpenMW-source-dir>")-- path = Path(sys.argv[1]).resolve() / "apps/openmw/mwrender/postprocessor.cpp"- if not path.is_file():- die(f"postprocessor.cpp not found: {path}")-- text = path.read_text(encoding="utf-8")-- if MARKER not in text:- print("OpenMW 0.50 OMWFX diagnostics: already absent")- return-- text = replace_once(- text,- """ mGLSLVersion = ext->glslLanguageVersion * 100;- mUBO = ext->isUniformBufferObjectSupported && mGLSLVersion >= 330;-#ifdef ANDROID- Log(Debug::Info) << "OMWFX050-DIAG: capability glsl=" << mGLSLVersion- << " ubo=" << mUBO- << " normalsSupported=" << mNormalsSupported- << " discoveredFiles=" << mTechniqueFiles.size();-#endif- mStateUpdater = new Fx::StateUpdater(mUBO);""",- """ mGLSLVersion = ext->glslLanguageVersion * 100;- mUBO = ext->isUniformBufferObjectSupported && mGLSLVersion >= 330;- mStateUpdater = new Fx::StateUpdater(mUBO);""",- "capability diagnostics",- )-- text = replace_once(- text,- """ const bool discovered = mTechniqueFiles.contains(path);- std::string name;- if (discovered)- name = mVFS->getStem(path);- else- name = path.stem();-- auto technique = std::make_shared<Fx::Technique>(*mVFS, *mRendering.getResourceSystem()->getImageManager(),- path, std::move(name), renderWidth(), renderHeight(), mUBO, mNormalsSupported);-- const bool compiled = technique->compile();-#ifdef ANDROID- Log(Debug::Info) << "OMWFX050-DIAG: load file=" << technique->getFileName()- << " name=" << technique->getName()- << " discovered=" << discovered- << " compiled=" << compiled- << " valid=" << technique->isValid()- << " status=" << static_cast<int>(technique->getStatus())- << " glsl=" << technique->getGLSLVersion()- << " passes=" << technique->getPasses().size();-#endif""",- """ std::string name;- if (mTechniqueFiles.contains(path))- name = mVFS->getStem(path);- else- name = path.stem();-- auto technique = std::make_shared<Fx::Technique>(*mVFS, *mRendering.getResourceSystem()->getImageManager(),- path, std::move(name), renderWidth(), renderHeight(), mUBO, mNormalsSupported);-- technique->compile();""",- "technique load diagnostics",- )-- text = replace_once(- text,- """#ifdef ANDROID- Log(Debug::Info) << "OMWFX050-DIAG: loadChain configuredCount="- << Settings::postProcessing().mChain.get().size();-#endif- for (const std::string& techniqueName : Settings::postProcessing().mChain.get())- {- if (techniqueName.empty())- continue;--#ifdef ANDROID- Log(Debug::Info) << "OMWFX050-DIAG: loadChain request=" << techniqueName;-#endif- mTechniques.push_back(loadTechnique(techniqueName));- }""",- """ for (const std::string& techniqueName : Settings::postProcessing().mChain.get())- {- if (techniqueName.empty())- continue;-- mTechniques.push_back(loadTechnique(techniqueName));- }""",- "chain diagnostics",- )-- text = replace_once(- text,- """ for (const auto& technique : mTechniques)- {-#ifdef ANDROID- Log(Debug::Info) << "OMWFX050-DIAG: dirty name=" << technique->getName()- << " file=" << technique->getFileName()- << " internal=" << technique->getInternal()- << " valid=" << technique->isValid()- << " status=" << static_cast<int>(technique->getStatus())- << " techniqueGlsl=" << technique->getGLSLVersion()- << " hardwareGlsl=" << mGLSLVersion- << " passes=" << technique->getPasses().size();-#endif- if (!technique->isValid())- continue;""",- """ for (const auto& technique : mTechniques)- {- if (!technique->isValid())- continue;""",- "dirty-technique diagnostics",- )-- text = replace_once(- text,- """ mCanvases[frameId]->setPasses(Fx::DispatchArray(mTemplateData));-#ifdef ANDROID- Log(Debug::Info) << "OMWFX050-DIAG: dispatch templates=" << mTemplateData.size()- << " frameId=" << frameId- << " usePostProcessing=" << mUsePostProcessing;-#endif-- if (auto hud = MWBase::Environment::get().getWindowManager()->getPostProcessorHud())""",- """ mCanvases[frameId]->setPasses(Fx::DispatchArray(mTemplateData));-- if (auto hud = MWBase::Environment::get().getWindowManager()->getPostProcessorHud())""",- "dispatch diagnostics",- )-- if MARKER in text:- die("diagnostic cleanup incomplete: OMWFX050-DIAG remains in postprocessor.cpp")-- path.write_text(text.replace("\r\n", "\n"), encoding="utf-8", newline="\n")- print("OpenMW 0.50 OMWFX diagnostics: REMOVED")--if __name__ == "__main__":- main()diff --git a/android/buildscripts/patches/openmw051-final/0001-ndk-r26-stringstream-compat.patch b/android/buildscripts/patches/openmw051-final/0001-ndk-r26-stringstream-compat.patchdeleted file mode 100644index 97c14ae..0000000--- a/android/buildscripts/patches/openmw051-final/0001-ndk-r26-stringstream-compat.patch+++ /dev/null@@ -1,13 +0,0 @@-diff --git a/components/misc/resourcehelpers.cpp b/components/misc/resourcehelpers.cpp---- a/components/misc/resourcehelpers.cpp-+++ b/components/misc/resourcehelpers.cpp-@@ -312,7 +312,8 @@ VFS::Path::Normalized Misc::ResourceHelpers::getLODMeshName(- {- std::stringstream patern;- patern << distantMeshPattern << "_" << l;-- const VFS::Path::Normalized meshName = getBestLODMeshName(resPath, vfs, patern.view());-+ const std::string paternString = patern.str();-+ const VFS::Path::Normalized meshName = getBestLODMeshName(resPath, vfs, paternString);- if (meshName != resPath)- return meshName;- }diff --git a/android/buildscripts/patches/openmw051-final/0002-static-osg-link.patch b/android/buildscripts/patches/openmw051-final/0002-static-osg-link.patchdeleted file mode 100644index ddfbde6..0000000--- a/android/buildscripts/patches/openmw051-final/0002-static-osg-link.patch+++ /dev/null@@ -1,17 +0,0 @@-diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt---- a/apps/openmw/CMakeLists.txt-+++ b/apps/openmw/CMakeLists.txt-@@ -207,6 +207,13 @@ endif()-- if (ANDROID)- target_link_libraries(openmw-lib EGL android log z)-+-+ if (BUILD_OPENMW)-+ # Force static OSG plugin objects into libopenmw.so on Android.-+ find_package(OSGPlugins REQUIRED COMPONENTS ${USED_OSG_PLUGINS})-+ list(APPEND OPENSCENEGRAPH_LIBRARIES ${OSGPlugins_LIBRARIES})-+ target_link_libraries(openmw ${OPENSCENEGRAPH_LIBRARIES} freetype jpeg png)-+ endif()- endif (ANDROID)-- if (USE_SYSTEM_TINYXML)diff --git a/android/buildscripts/patches/openmw051-final/apply-android-gl4es-core-inline.py b/android/buildscripts/patches/openmw051-final/apply-android-gl4es-core-inline.pydeleted file mode 100644index 57e26f7..0000000--- a/android/buildscripts/patches/openmw051-final/apply-android-gl4es-core-inline.py+++ /dev/null@@ -1,143 +0,0 @@-#!/usr/bin/env python3-from pathlib import Path-import sys--if len(sys.argv) != 2:- raise SystemExit('usage: apply-android-gl4es-core-inline.py <openmw-source-dir>')--root = Path(sys.argv[1])-vertex = root / 'files' / 'shaders' / 'lib' / 'core' / 'vertex.h.glsl'-fragment = root / 'files' / 'shaders' / 'lib' / 'core' / 'fragment.h.glsl'-MARKER = 'OPENMW_ANDROID_051_GL4ES_CORE_INLINE'--for path in (vertex, fragment):- if not path.is_file():- raise SystemExit(f'missing expected OpenMW 0.51 core shader header: {path}')--vertex_pristine = '''@link "lib/core/vertex.glsl" if !@useOVR_multiview-@link "lib/core/vertex_multiview.glsl" if @useOVR_multiview--vec4 modelToClip(vec4 pos);-vec4 modelToView(vec4 pos);-vec4 viewToClip(vec4 pos);-'''-vertex_android = '''// OPENMW_ANDROID_051_GL4ES_CORE_INLINE-// GL4ES/GLES2 compatibility: keep helper implementations in the consuming-// shader instead of linking a helper-only shader object without main().-uniform mat4 projectionMatrix;--vec4 modelToView(vec4 pos)-{- return gl_ModelViewMatrix * pos;-}--vec4 modelToClip(vec4 pos)-{- return projectionMatrix * modelToView(pos);-}--vec4 viewToClip(vec4 pos)-{- return projectionMatrix * pos;-}-'''--fragment_pristine = '''#ifndef OPENMW_FRAGMENT_H_GLSL-#define OPENMW_FRAGMENT_H_GLSL--@link "lib/core/fragment.glsl" if !@useOVR_multiview-@link "lib/core/fragment_multiview.glsl" if @useOVR_multiview--vec4 sampleReflectionMap(vec2 uv);--#if @waterRefraction-vec4 sampleRefractionMap(vec2 uv);-float sampleRefractionDepthMap(vec2 uv);-#endif--vec4 samplerLastShader(vec2 uv);--#if @skyBlending-vec3 sampleSkyColor(vec2 uv);-#endif--vec4 sampleOpaqueDepthTex(vec2 uv);--#endif // OPENMW_FRAGMENT_H_GLSL-'''-fragment_android = '''#ifndef OPENMW_FRAGMENT_H_GLSL-#define OPENMW_FRAGMENT_H_GLSL--// OPENMW_ANDROID_051_GL4ES_CORE_INLINE-// GL4ES/GLES2 compatibility: inline the helper implementations. The stock-// OpenMW 0.51 helper-link path creates helper-only shader objects which the tested-// Adreno GLES compiler rejects because they contain no main().-uniform sampler2D reflectionMap;--vec4 sampleReflectionMap(vec2 uv)-{- return texture2D(reflectionMap, uv);-}--#if @waterRefraction-uniform sampler2D refractionMap;-uniform highp sampler2D refractionDepthMap;--vec4 sampleRefractionMap(vec2 uv)-{- return texture2D(refractionMap, uv);-}--float sampleRefractionDepthMap(vec2 uv)-{- return texture2D(refractionDepthMap, uv).x;-}-#endif--uniform sampler2D lastShader;--vec4 samplerLastShader(vec2 uv)-{- return texture2D(lastShader, uv);-}--#if @skyBlending-uniform sampler2D sky;--vec3 sampleSkyColor(vec2 uv)-{- return texture2D(sky, uv).xyz;-}-#endif--uniform highp sampler2D opaqueDepthTex;--vec4 sampleOpaqueDepthTex(vec2 uv)-{- return texture2D(opaqueDepthTex, uv);-}--#endif // OPENMW_FRAGMENT_H_GLSL-'''--def apply_exact(path: Path, pristine: str, android: str) -> None:- text = path.read_text(encoding='utf-8').replace('\r\n', '\n')- if MARKER in text:- if text != android:- raise SystemExit(f'{path}: Patch-3 marker exists but file differs from expected Android form')- print(f'{path.relative_to(root)}: GL4ES core inlining already applied')- return- if text != pristine:- raise SystemExit(f'{path}: source does not match exact OpenMW 0.51 Final core header')- path.write_text(android, encoding='utf-8', newline='\n')- print(f'{path.relative_to(root)}: applied GL4ES core helper inlining')--apply_exact(vertex, vertex_pristine, vertex_android)-apply_exact(fragment, fragment_pristine, fragment_android)--for path in (vertex, fragment):- body = path.read_text(encoding='utf-8')- if MARKER not in body or '@link "lib/core/' in body:- raise SystemExit(f'{path}: GL4ES core-inline verification failed')--print('OpenMW 0.51 Android GL4ES core shader inlining: READY')diff --git a/android/buildscripts/patches/openmw051-final/apply-android-graphics-followup.py b/android/buildscripts/patches/openmw051-final/apply-android-graphics-followup.pydeleted file mode 100644index dcfa9ce..0000000--- a/android/buildscripts/patches/openmw051-final/apply-android-graphics-followup.py+++ /dev/null@@ -1,344 +0,0 @@-#!/usr/bin/env python3-from pathlib import Path-import sys--if len(sys.argv) != 2:- raise SystemExit('usage: apply-android-graphics-followup.py <openmw-source-dir>')--root = Path(sys.argv[1])-windowmanager = root / 'apps' / 'openmw' / 'mwgui' / 'windowmanagerimp.cpp'-settingswindow = root / 'apps' / 'openmw' / 'mwgui' / 'settingswindow.cpp'-nifloader = root / 'components' / 'nifosg' / 'nifloader.cpp'-pingpong_hpp = root / 'apps' / 'openmw' / 'mwrender' / 'pingpongcanvas.hpp'-pingpong_cpp = root / 'apps' / 'openmw' / 'mwrender' / 'pingpongcanvas.cpp'--RESOLUTION_MARKER = 'OPENMW_ANDROID_051_LOGICAL_RENDER_RESOLUTION'-GHOSTFENCE_MARKER = 'OPENMW_ANDROID_051_GHOSTFENCE_STABLE_ORDER'-GAMMA_MARKER = 'OPENMW_ANDROID_051_FINAL_GAMMA'--for path in (windowmanager, settingswindow, nifloader, pingpong_hpp, pingpong_cpp):- if not path.is_file():- raise SystemExit(f'missing expected OpenMW 0.51 source file: {path}')--def replace_once(text: str, old: str, new: str, label: str) -> str:- count = text.count(old)- if count != 1:- raise SystemExit(f'{label}: expected exactly one anchor, found {count}')- return text.replace(old, new, 1)--# Resolution-text = windowmanager.read_text(encoding='utf-8').replace('\r\n', '\n')-if RESOLUTION_MARKER not in text:- text = replace_once(- text,- ''' void WindowManager::windowResized(int x, int y)- {- Settings::video().mResolutionX.set(x);- Settings::video().mResolutionY.set(y);-- // We only want to process changes to window-size related settings.''',- ''' void WindowManager::windowResized(int x, int y)- {-#ifndef ANDROID- Settings::video().mResolutionX.set(x);- Settings::video().mResolutionY.set(y);-#else- // OPENMW_ANDROID_051_LOGICAL_RENDER_RESOLUTION- // SDL reports the physical Android Surface here. Do not overwrite the- // launcher-selected logical render size with that physical size.- (void)x;- (void)y;-#endif-- // We only want to process changes to window-size related settings.''',- 'windowmanager.cpp/logical render resolution',- )- windowmanager.write_text(text, encoding='utf-8', newline='\n')- print('Preserved launcher-selected logical render resolution across Android Surface resizes.')-else:- print('Android logical render-resolution preservation is already applied.')--text = settingswindow.read_text(encoding='utf-8').replace('\r\n', '\n')-if RESOLUTION_MARKER not in text:- text = replace_once(- text,- ''' int numDisplayModes = SDL_GetNumDisplayModes(screen);- std::vector<std::pair<int, int>> resolutions;- for (int i = 0; i < numDisplayModes; i++)''',- ''' int numDisplayModes = SDL_GetNumDisplayModes(screen);- std::vector<std::pair<int, int>> resolutions;-#ifdef ANDROID- // OPENMW_ANDROID_051_LOGICAL_RENDER_RESOLUTION- // Launcher render sizes are logical sizes and need not be physical SDL- // display modes. Put the configured size into the list explicitly.- const int configuredWidth = Settings::video().mResolutionX;- const int configuredHeight = Settings::video().mResolutionY;- if (configuredWidth > 0 && configuredHeight > 0)- resolutions.emplace_back(configuredWidth, configuredHeight);-#endif- for (int i = 0; i < numDisplayModes; i++)''',- 'settingswindow.cpp/configured Android resolution',- )- settingswindow.write_text(text, encoding='utf-8', newline='\n')- print('Added the launcher-selected Android render resolution to the in-game list.')-else:- print('Android in-game logical render-resolution listing is already applied.')--# Ghostfence-text = nifloader.read_text(encoding='utf-8').replace('\r\n', '\n')-if GHOSTFENCE_MARKER not in text:- text = replace_once(- text,- ''' if (specStrength != 1.f)- node->getOrCreateStateSet()->addUniform(new osg::Uniform("specStrength", specStrength));-- if (!mPushedSorter)''',- ''' if (specStrength != 1.f)- node->getOrCreateStateSet()->addUniform(new osg::Uniform("specStrength", specStrength));--#ifdef ANDROID- // OPENMW_ANDROID_051_GHOSTFENCE_STABLE_ORDER- // Keep the known vanilla Ghostfence translucent mesh family in a- // deterministic traversal order. Normalize case explicitly because- // game data may preserve the original NIF filename casing.- const std::string androidNifFilename- = Misc::StringUtils::lowerCase(mFilename.filename().value());- const bool stableGhostfenceOrder = androidNifFilename.starts_with("ex_gg_fence_")- || androidNifFilename == "ex_gg_particles_01.nif";- if (hasSortAlpha && stableGhostfenceOrder)- {- setBinTraversal(node->getOrCreateStateSet());- return;- }-#endif-- if (!mPushedSorter)''',- 'nifloader.cpp/Ghostfence stable alpha ordering',- )- nifloader.write_text(text, encoding='utf-8', newline='\n')- print('Applied targeted stable alpha ordering to Ghostfence fence/particle meshes.')-else:- print('Ghostfence stable alpha ordering is already applied.')--# Gamma-text = pingpong_hpp.read_text(encoding='utf-8').replace('\r\n', '\n')-if GAMMA_MARKER not in text:- text = replace_once(- text,- ''' osg::ref_ptr<osg::Program> mFallbackProgram;- osg::ref_ptr<osg::Program> mMultiviewResolveProgram;- osg::ref_ptr<osg::StateSet> mFallbackStateSet;- osg::ref_ptr<osg::StateSet> mMultiviewResolveStateSet;''',- ''' osg::ref_ptr<osg::Program> mFallbackProgram;- osg::ref_ptr<osg::Program> mMultiviewResolveProgram;- osg::ref_ptr<osg::StateSet> mFallbackStateSet;- osg::ref_ptr<osg::StateSet> mMultiviewResolveStateSet;-#ifdef ANDROID- // OPENMW_ANDROID_051_FINAL_GAMMA- osg::ref_ptr<osg::StateSet> mAndroidGammaStateSet;-#endif''',- 'pingpongcanvas.hpp/Android gamma state',- )- pingpong_hpp.write_text(text, encoding='utf-8', newline='\n')- print('Added Android final-gamma state to PingPongCanvas.')-else:- print('Android final-gamma state is already declared.')--text = pingpong_cpp.read_text(encoding='utf-8').replace('\r\n', '\n')-if GAMMA_MARKER not in text:- text = replace_once(- text,- # Isowind: anchored on <cassert> alone (Isowind includes <cmath> after it)- '''#include <cassert>-''',- '''#include <cassert>-#include <cstdlib>-#include <osg/Shader>-''',- 'pingpongcanvas.cpp/gamma includes',- )-- text = replace_once(- text,- ''' mFallbackStateSet->setAttributeAndModes(mFallbackProgram);- mFallbackStateSet->addUniform(new osg::Uniform("lastShader", 0));- mFallbackStateSet->addUniform(new osg::Uniform("scaling", osg::Vec2f(1, 1)));-- mMultiviewResolveProgram = shaderManager.getProgram("multiview_resolve");''',- ''' mFallbackStateSet->setAttributeAndModes(mFallbackProgram);- mFallbackStateSet->addUniform(new osg::Uniform("lastShader", 0));- mFallbackStateSet->addUniform(new osg::Uniform("scaling", osg::Vec2f(1, 1)));--#ifdef ANDROID- // OPENMW_ANDROID_051_FINAL_GAMMA- // OPENMW_GAMMA is supplied by the Android launcher. SDL gamma ramps are- // ineffective on Android, so gamma is applied once to the final image.- float androidGamma = 1.f;- if (const char* value = std::getenv("OPENMW_GAMMA"))- {- char* end = nullptr;- const float parsed = std::strtof(value, &end);- if (end != value && parsed >= 0.1f && parsed <= 5.f)- androidGamma = parsed;- }-- if (androidGamma != 1.f)- {- static const char* vertexSource = R"GLSL(#version 120-uniform vec2 scaling;-varying vec2 uv;-void main()-{- gl_Position = vec4(gl_Vertex.xy, 0.0, 1.0);- uv = (gl_Position.xy * 0.5 + 0.5) * scaling;-}-)GLSL";-- static const char* fragmentSource = R"GLSL(#version 120-uniform sampler2D lastShader;-uniform float androidGamma;-varying vec2 uv;-void main()-{- vec4 color = texture2D(lastShader, uv);- color.rgb = pow(max(color.rgb, vec3(0.0)), vec3(1.0 / androidGamma));- gl_FragColor = color;-}-)GLSL";-- osg::ref_ptr<osg::Program> gammaProgram = new osg::Program;- gammaProgram->addShader(new osg::Shader(osg::Shader::VERTEX, vertexSource));- gammaProgram->addShader(new osg::Shader(osg::Shader::FRAGMENT, fragmentSource));-- mAndroidGammaStateSet = new osg::StateSet;- mAndroidGammaStateSet->setAttributeAndModes(gammaProgram);- mAndroidGammaStateSet->addUniform(new osg::Uniform("lastShader", 0));- mAndroidGammaStateSet->addUniform(new osg::Uniform("scaling", osg::Vec2f(1.f, 1.f)));- mAndroidGammaStateSet->addUniform(new osg::Uniform("androidGamma", androidGamma));- }-#endif-- mMultiviewResolveProgram = shaderManager.getProgram("multiview_resolve");''',- 'pingpongcanvas.cpp/create Android gamma program',- )-- text = replace_once(- text,- ''' if (filtered.empty() || !mPostprocessing)- {- state.pushStateSet(mFallbackStateSet);''',- ''' if (filtered.empty() || !mPostprocessing)- {-#ifdef ANDROID- if (mAndroidGammaStateSet && !Stereo::getMultiview())- {- state.pushStateSet(mAndroidGammaStateSet);- state.apply();- state.applyTextureAttribute(0, mTextureScene);- finalViewport->apply(state); // Isowind: its name for the viewport (resolveViewport is a function there)- drawGeometry(renderInfo);- state.popStateSet();- return;- }-#endif- state.pushStateSet(mFallbackStateSet);''',- 'pingpongcanvas.cpp/no-postprocessing gamma resolve',- )-- text = replace_once(- text,- ''' auto buffer = buffers[0];-- int lastDraw = 0;- int lastShader = 0;''',- ''' auto buffer = buffers[0];-- int lastDraw = 0;- int lastShader = 0;-#ifdef ANDROID- bool androidGammaPending = false;-#endif''',- 'pingpongcanvas.cpp/gamma pending state',- )-- text = replace_once(- text,- ''' if (pass.mRenderTarget)- {- pass.mRenderTarget->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);-- lastApplied = pass.mRenderTarget->getHandle(state.getContextID());- }- else if (pass.mResolve && index == filtered.back())''',- '''#ifdef ANDROID- if (mAndroidGammaStateSet && !Stereo::getMultiview() && lastPass && index == filtered.back()- && !pass.mRenderTarget)- {- lastDraw = buffer[0];- lastShader = buffer[0];- mFbos[buffer[0] - GL_COLOR_ATTACHMENT0_EXT]->apply(- state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);- lastApplied = mFbos[buffer[0] - GL_COLOR_ATTACHMENT0_EXT]->getHandle(cid);- androidGammaPending = true;- }- else-#endif- if (pass.mRenderTarget)- {- pass.mRenderTarget->apply(state, osg::FrameBufferObject::DRAW_FRAMEBUFFER);-- lastApplied = pass.mRenderTarget->getHandle(state.getContextID());- }- else if (pass.mResolve && index == filtered.back())''',- 'pingpongcanvas.cpp/divert final pass for gamma',- )-- text = replace_once(- text,- ''' if (Stereo::getMultiview())- {- ext->glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, 0);''',- '''#ifdef ANDROID- if (androidGammaPending)- {- bindDestinationFbo();- if (!destinationFbo)- finalViewport->apply(state); // Isowind: its name for the viewport (resolveViewport is a function there)-- state.pushStateSet(mAndroidGammaStateSet);- state.apply();- state.applyTextureAttribute(PostProcessor::Unit_LastShader,- (osg::Texture*)mFbos[lastShader - GL_COLOR_ATTACHMENT0_EXT]- ->getAttachment(osg::Camera::COLOR_BUFFER0)- .getTexture());- drawGeometry(renderInfo);- state.popStateSet();- state.apply();-- lastApplied = destinationHandle;- }-#endif-- if (Stereo::getMultiview())- {- ext->glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, 0);''',- 'pingpongcanvas.cpp/final Android gamma resolve',- )-- pingpong_cpp.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android gamma as the final fullscreen resolve.')-else:- print('Android final gamma pass is already applied.')--checks = {- windowmanager: RESOLUTION_MARKER,- settingswindow: RESOLUTION_MARKER,- nifloader: GHOSTFENCE_MARKER,- pingpong_hpp: GAMMA_MARKER,- pingpong_cpp: GAMMA_MARKER,-}-for path, marker in checks.items():- if marker not in path.read_text(encoding='utf-8'):- raise SystemExit(f'{path}: expected marker {marker} is missing')--print('OpenMW 0.51 Android graphics follow-up fixes: READY')diff --git a/android/buildscripts/patches/openmw051-final/apply-android-graphics-followup2.py b/android/buildscripts/patches/openmw051-final/apply-android-graphics-followup2.pydeleted file mode 100644index 4d1e436..0000000--- a/android/buildscripts/patches/openmw051-final/apply-android-graphics-followup2.py+++ /dev/null@@ -1,187 +0,0 @@-#!/usr/bin/env python3-from pathlib import Path-import sys--if len(sys.argv) != 2:- raise SystemExit('usage: apply-android-graphics-followup2.py <openmw-source-dir>')--root = Path(sys.argv[1])-nifloader = root / 'components' / 'nifosg' / 'nifloader.cpp'-display = root / 'components' / 'misc' / 'display.cpp'--GHOST_MARKER = 'OPENMW_ANDROID_051_GHOSTFENCE_PARTICLE_STABLE_ORDER'-ASPECT_MARKER = 'OPENMW_ANDROID_051_COMMON_ASPECT_RATIO'-OLD_GHOST_MARKER = 'OPENMW_ANDROID_051_GHOSTFENCE_STABLE_ORDER'--for path in (nifloader, display):- if not path.is_file():- raise SystemExit(f'missing expected OpenMW 0.51 source file: {path}')--def replace_once(text: str, old: str, new: str, label: str) -> str:- count = text.count(old)- if count != 1:- raise SystemExit(f'{label}: expected exactly one anchor, found {count}')- return text.replace(old, new, 1)--# ----------------------------------------------------------------------------# Ghostfence:-# Remove Patch-42's first hypothesis (transparent render-bin traversal order).-# Device testing showed no change. The actual OSG ParticleSystem still performs-# camera-dependent SORT_BACK_TO_FRONT sorting internally, which that patch did-# not affect.-# ----------------------------------------------------------------------------text = nifloader.read_text(encoding='utf-8').replace('\r\n', '\n')--old_block = '''#ifdef ANDROID- // OPENMW_ANDROID_051_GHOSTFENCE_STABLE_ORDER- // Keep the known vanilla Ghostfence translucent mesh family in a- // deterministic traversal order. Normalize case explicitly because- // game data may preserve the original NIF filename casing.- const std::string androidNifFilename- = Misc::StringUtils::lowerCase(mFilename.filename().value());- const bool stableGhostfenceOrder = androidNifFilename.starts_with("ex_gg_fence_")- || androidNifFilename == "ex_gg_particles_01.nif";- if (hasSortAlpha && stableGhostfenceOrder)- {- setBinTraversal(node->getOrCreateStateSet());- return;- }-#endif--'''-if OLD_GHOST_MARKER in text:- if old_block not in text:- raise SystemExit('nifloader.cpp: old Patch-42 Ghostfence block marker found, but exact migration block differs')- text = text.replace(old_block, '', 1)- print('Removed the ineffective Patch-42 Ghostfence render-bin override.')--if GHOST_MARKER not in text:- text = replace_once(- text,- ''' osg::ref_ptr<ParticleSystem> partsys(new ParticleSystem);- partsys->setSortMode(osgParticle::ParticleSystem::SORT_BACK_TO_FRONT);-''',- ''' osg::ref_ptr<ParticleSystem> partsys(new ParticleSystem);-#ifdef ANDROID- // OPENMW_ANDROID_051_GHOSTFENCE_PARTICLE_STABLE_ORDER- // OSG normally re-sorts every particle by camera-space Z each frame.- // The Ghostfence uses dense/coincident translucent effect particles;- // tiny camera changes can therefore change their order and produce- // visible flicker. Keep creation/traversal order only for the vanilla- // Ghostfence effect family; all other particles retain upstream sorting.- const std::string androidParticleNifFilename- = Misc::StringUtils::lowerCase(mFilename.filename().value());- const bool stableGhostfenceParticles = androidParticleNifFilename.starts_with("ex_gg_fence_")- || androidParticleNifFilename == "ex_gg_particles_01.nif";- partsys->setSortMode(stableGhostfenceParticles ? osgParticle::ParticleSystem::NO_SORT- : osgParticle::ParticleSystem::SORT_BACK_TO_FRONT);-#else- partsys->setSortMode(osgParticle::ParticleSystem::SORT_BACK_TO_FRONT);-#endif-''',- 'nifloader.cpp/Ghostfence particle sorting',- )- print('Disabled camera-dependent particle sorting only for the Ghostfence effect family.')-else:- print('Ghostfence particle stable-order fix is already applied.')--nifloader.write_text(text, encoding='utf-8', newline='\n')--# ----------------------------------------------------------------------------# Resolution aspect label:-# OpenMW reports the exact reduced fraction. 854x480 => 427:240 even though it-# is the conventional integer approximation of 16:9 used for 480p. OpenMW-# already has several hand-written "usually referred as" corrections. Extend-# that idea on Android by snapping only close matches (<= 1%) to common ratios.-# ----------------------------------------------------------------------------text = display.read_text(encoding='utf-8').replace('\r\n', '\n')--if ASPECT_MARKER not in text:- text = replace_once(- text,- ''' else- {- // everything between 21:9 and 22:9- // is usually referred as 21:9- float ratio = static_cast<float>(xaspect) / yaspect;- if (ratio >= 21 / 9.f && ratio < 22 / 9.f)- {- xaspect = 21;- yaspect = 9;- }- }-''',- ''' else- {- float ratio = static_cast<float>(xaspect) / yaspect;--#ifdef ANDROID- // OPENMW_ANDROID_051_COMMON_ASPECT_RATIO- // Logical Android render sizes may use integer approximations of- // standard video modes, e.g. 854x480 is 427:240 mathematically but- // conventionally represents 16:9. Snap only very close matches so- // genuinely unusual aspect ratios keep their exact reduced value.- struct CommonAspect- {- int x;- int y;- };- static constexpr CommonAspect commonAspects[] = {- { 5, 4 },- { 4, 3 },- { 3, 2 },- { 16, 10 },- { 16, 9 },- { 18, 9 },- { 19, 9 },- { 20, 9 },- { 21, 9 },- { 32, 9 },- };-- const CommonAspect* bestAspect = nullptr;- float bestRelativeError = 0.01f;- for (const CommonAspect& candidate : commonAspects)- {- const float candidateRatio = static_cast<float>(candidate.x) / candidate.y;- const float relativeError = ratio > candidateRatio- ? (ratio - candidateRatio) / candidateRatio- : (candidateRatio - ratio) / candidateRatio;- if (relativeError < bestRelativeError)- {- bestRelativeError = relativeError;- bestAspect = &candidate;- }- }-- if (bestAspect)- {- xaspect = bestAspect->x;- yaspect = bestAspect->y;- }- else-#endif- {- // everything between 21:9 and 22:9- // is usually referred as 21:9- if (ratio >= 21 / 9.f && ratio < 22 / 9.f)- {- xaspect = 21;- yaspect = 9;- }- }- }-''',- 'display.cpp/common Android aspect-ratio approximation',- )- print('Added conventional aspect-ratio approximation for Android logical render sizes.')-else:- print('Android common aspect-ratio approximation is already applied.')--display.write_text(text, encoding='utf-8', newline='\n')--for path, marker in ((nifloader, GHOST_MARKER), (display, ASPECT_MARKER)):- if marker not in path.read_text(encoding='utf-8'):- raise SystemExit(f'{path}: expected marker {marker} is missing')--print('OpenMW 0.51 Android graphics follow-up 2: READY')diff --git a/android/buildscripts/patches/openmw051-final/apply-android-graphics-followup3.py b/android/buildscripts/patches/openmw051-final/apply-android-graphics-followup3.pydeleted file mode 100644index 0b7f3f6..0000000--- a/android/buildscripts/patches/openmw051-final/apply-android-graphics-followup3.py+++ /dev/null@@ -1,209 +0,0 @@-#!/usr/bin/env python3-from pathlib import Path-import sys--if len(sys.argv) != 2:- raise SystemExit("usage: apply-android-graphics-followup3.py <openmw-source-dir>")--root = Path(sys.argv[1])-settingswindow = root / "apps" / "openmw" / "mwgui" / "settingswindow.cpp"-nifloader = root / "components" / "nifosg" / "nifloader.cpp"--RES_MARKER = "OPENMW_ANDROID_051_ACTIVE_RENDER_RESOLUTION_ONLY"-DIAG_MARKER = "OPENMW_ANDROID_051_GHOSTFENCE_DEPTH_DIAG"-OLD_PARTICLE_MARKER = "OPENMW_ANDROID_051_GHOSTFENCE_PARTICLE_STABLE_ORDER"--for path in (settingswindow, nifloader):- if not path.is_file():- raise SystemExit(f"missing expected OpenMW 0.51 source file: {path}")--def replace_once(text: str, old: str, new: str, label: str) -> str:- count = text.count(old)- if count != 1:- raise SystemExit(f"{label}: expected exactly one anchor, found {count}")- return text.replace(old, new, 1)--text = settingswindow.read_text(encoding="utf-8").replace("\r\n", "\n")--if RES_MARKER not in text:- old = ''' const int screen = Settings::video().mScreen;- int numDisplayModes = SDL_GetNumDisplayModes(screen);- std::vector<std::pair<int, int>> resolutions;-#ifdef ANDROID- // OPENMW_ANDROID_051_LOGICAL_RENDER_RESOLUTION- // Launcher render sizes are logical sizes and need not be physical SDL- // display modes. Put the configured size into the list explicitly.- const int configuredWidth = Settings::video().mResolutionX;- const int configuredHeight = Settings::video().mResolutionY;- if (configuredWidth > 0 && configuredHeight > 0)- resolutions.emplace_back(configuredWidth, configuredHeight);-#endif- for (int i = 0; i < numDisplayModes; i++)- {- SDL_DisplayMode mode;- SDL_GetDisplayMode(screen, i, &mode);- resolutions.emplace_back(mode.w, mode.h);- }-'''- new = ''' std::vector<std::pair<int, int>> resolutions;-#ifdef ANDROID- // OPENMW_ANDROID_051_ACTIVE_RENDER_RESOLUTION_ONLY- // Android's physical panel mode is not OpenMW's logical render size.- // Expose only the actual launcher-selected render resolution.- const int configuredWidth = Settings::video().mResolutionX;- const int configuredHeight = Settings::video().mResolutionY;- if (configuredWidth > 0 && configuredHeight > 0)- resolutions.emplace_back(configuredWidth, configuredHeight);-#else- const int screen = Settings::video().mScreen;- int numDisplayModes = SDL_GetNumDisplayModes(screen);- for (int i = 0; i < numDisplayModes; i++)- {- SDL_DisplayMode mode;- SDL_GetDisplayMode(screen, i, &mode);- resolutions.emplace_back(mode.w, mode.h);- }-#endif-'''- text = replace_once(text, old, new, "settingswindow.cpp/active Android render resolution only")- settingswindow.write_text(text, encoding="utf-8", newline="\n")- print("Android in-game resolution list now exposes only the active render resolution.")-else:- print("Android active-render-resolution-only list is already applied.")--text = nifloader.read_text(encoding="utf-8").replace("\r\n", "\n")--old_particle = ''' osg::ref_ptr<ParticleSystem> partsys(new ParticleSystem);-#ifdef ANDROID- // OPENMW_ANDROID_051_GHOSTFENCE_PARTICLE_STABLE_ORDER- // OSG normally re-sorts every particle by camera-space Z each frame.- // The Ghostfence uses dense/coincident translucent effect particles;- // tiny camera changes can therefore change their order and produce- // visible flicker. Keep creation/traversal order only for the vanilla- // Ghostfence effect family; all other particles retain upstream sorting.- const std::string androidParticleNifFilename- = Misc::StringUtils::lowerCase(mFilename.filename().value());- const bool stableGhostfenceParticles = androidParticleNifFilename.starts_with("ex_gg_fence_")- || androidParticleNifFilename == "ex_gg_particles_01.nif";- partsys->setSortMode(stableGhostfenceParticles ? osgParticle::ParticleSystem::NO_SORT- : osgParticle::ParticleSystem::SORT_BACK_TO_FRONT);-#else- partsys->setSortMode(osgParticle::ParticleSystem::SORT_BACK_TO_FRONT);-#endif-'''-upstream_particle = ''' osg::ref_ptr<ParticleSystem> partsys(new ParticleSystem);- partsys->setSortMode(osgParticle::ParticleSystem::SORT_BACK_TO_FRONT);-'''--if OLD_PARTICLE_MARKER in text:- if old_particle not in text:- raise SystemExit("nifloader.cpp: Patch-43 particle marker exists but exact rollback block differs")- text = text.replace(old_particle, upstream_particle, 1)- print("Rolled back the device-negative Ghostfence particle NO_SORT experiment.")-else:- print("Ghostfence particle sorting is already at upstream behavior.")--# Patch 44 v1 accidentally inserted a Ghostfence UV diagnostic into the-# static handleMeshControllers() function. That function has no LoaderImpl-# instance and therefore cannot access mFilename. Remove that block first so-# this v2 patcher also repairs a source tree left behind by the failed v1 build.-broken_uv_diag = '''#ifdef ANDROID- const std::string androidDiagFilename- = Misc::StringUtils::lowerCase(mFilename.filename().value());- if (androidDiagFilename.starts_with("ex_gg_fence_"))- {- Log(Debug::Info) << "OpenMW 0.51 Ghostfence diag: UV controller file=" << mFilename- << " node=\"" << node->getName() << "\"";- }-#endif-'''-if broken_uv_diag in text:- text = text.replace(broken_uv_diag, "", 1)- print("Removed the invalid static UV-controller diagnostic from Patch 44 v1.")--if DIAG_MARKER not in text:- z_old = ''' case Nif::RC_NiZBufferProperty:- {- const Nif::NiZBufferProperty* zprop = static_cast<const Nif::NiZBufferProperty*>(property);- osg::StateSet* stateset = node->getOrCreateStateSet();- // The test function from this property seems to be ignored.- handleDepthFlags(stateset, zprop->depthTest(), zprop->depthWrite());- break;- }-'''- z_new = ''' case Nif::RC_NiZBufferProperty:- {- const Nif::NiZBufferProperty* zprop = static_cast<const Nif::NiZBufferProperty*>(property);-#ifdef ANDROID- // OPENMW_ANDROID_051_GHOSTFENCE_DEPTH_DIAG- const std::string androidDiagFilename- = Misc::StringUtils::lowerCase(mFilename.filename().value());- if (androidDiagFilename.starts_with("ex_gg_fence_"))- {- Log(Debug::Info) << "OpenMW 0.51 Ghostfence diag: zbuffer file=" << mFilename- << " node=\"" << node->getName() << "\""- << " depthTest=" << zprop->depthTest()- << " depthWrite=" << zprop->depthWrite();- }-#endif- osg::StateSet* stateset = node->getOrCreateStateSet();- // The test function from this property seems to be ignored.- handleDepthFlags(stateset, zprop->depthTest(), zprop->depthWrite());- break;- }-'''- text = replace_once(text, z_old, z_new, "nifloader.cpp/Ghostfence Z-buffer diagnostics")-- alpha_old = ''' case Nif::RC_NiAlphaProperty:- {- const Nif::NiAlphaProperty* alphaprop = static_cast<const Nif::NiAlphaProperty*>(property);- handleAlphaBlending(alphaprop->useAlphaBlending(), alphaprop->sourceBlendMode(),- alphaprop->destinationBlendMode(), !alphaprop->noSorter(), hasSortAlpha, *node);- handleAlphaTesting(alphaprop->useAlphaTesting(), getTestMode(alphaprop->alphaTestMode()),- alphaprop->mThreshold, *node);- break;- }-'''- alpha_new = ''' case Nif::RC_NiAlphaProperty:- {- const Nif::NiAlphaProperty* alphaprop = static_cast<const Nif::NiAlphaProperty*>(property);-#ifdef ANDROID- const std::string androidDiagFilename- = Misc::StringUtils::lowerCase(mFilename.filename().value());- if (androidDiagFilename.starts_with("ex_gg_fence_"))- {- Log(Debug::Info) << "OpenMW 0.51 Ghostfence diag: alpha file=" << mFilename- << " node=\"" << node->getName() << "\""- << " blend=" << alphaprop->useAlphaBlending()- << " src=" << alphaprop->sourceBlendMode()- << " dst=" << alphaprop->destinationBlendMode()- << " sorter=" << (!alphaprop->noSorter())- << " alphaTest=" << alphaprop->useAlphaTesting()- << " threshold=" << alphaprop->mThreshold;- }-#endif- handleAlphaBlending(alphaprop->useAlphaBlending(), alphaprop->sourceBlendMode(),- alphaprop->destinationBlendMode(), !alphaprop->noSorter(), hasSortAlpha, *node);- handleAlphaTesting(alphaprop->useAlphaTesting(), getTestMode(alphaprop->alphaTestMode()),- alphaprop->mThreshold, *node);- break;- }-'''- text = replace_once(text, alpha_old, alpha_new, "nifloader.cpp/Ghostfence alpha diagnostics")- print("Added Ghostfence-only Z-buffer/alpha diagnostics.")-else:- print("Ghostfence Z-buffer/alpha diagnostics are already applied.")--if "Ghostfence diag: UV controller" in text:- raise SystemExit("nifloader.cpp: invalid Patch-44-v1 UV diagnostic still remains")--nifloader.write_text(text, encoding="utf-8", newline="\n")--for path, marker in ((settingswindow, RES_MARKER), (nifloader, DIAG_MARKER)):- if marker not in path.read_text(encoding="utf-8"):- raise SystemExit(f"{path}: expected marker {marker} is missing")--if OLD_PARTICLE_MARKER in nifloader.read_text(encoding="utf-8"):- raise SystemExit("nifloader.cpp: obsolete Patch-43 Ghostfence particle override remains")--print("OpenMW 0.51 Android Patch 44 source update: READY")diff --git a/android/buildscripts/patches/openmw051-final/apply-android-graphics-followup4.py b/android/buildscripts/patches/openmw051-final/apply-android-graphics-followup4.pydeleted file mode 100644index cc65e08..0000000--- a/android/buildscripts/patches/openmw051-final/apply-android-graphics-followup4.py+++ /dev/null@@ -1,68 +0,0 @@-#!/usr/bin/env python3-from pathlib import Path-import sys--if len(sys.argv) != 2:- raise SystemExit("usage: apply-android-graphics-followup4.py <openmw-source-dir>")--root = Path(sys.argv[1])-nifloader = root / "components" / "nifosg" / "nifloader.cpp"--MARKER = "OPENMW_ANDROID_051_GHOSTFENCE_NO_DEPTH_WRITE"--if not nifloader.is_file():- raise SystemExit(f"missing expected OpenMW 0.51 source file: {nifloader}")--text = nifloader.read_text(encoding="utf-8").replace("\r\n", "\n")--if MARKER not in text:- anchor = ''' default:- break;- }- }-- // While NetImmerse and Gamebryo support specular lighting, Morrowind has its support disabled.-'''- replacement = ''' default:- break;- }- }--#ifdef ANDROID- // OPENMW_ANDROID_051_GHOSTFENCE_NO_DEPTH_WRITE- // The simplified Ghostfence barrier consists of several overlapping,- // alpha-blended meshes. The NIFs do not provide a NiZBufferProperty,- // so the inherited/default depth state can still write depth while- // these transparent layers are drawn. Keep normal depth testing- // against the world, but prevent the Ghostfence alpha layers from- // occluding one another through the depth buffer.- const std::string androidDrawableNifFilename- = Misc::StringUtils::lowerCase(mFilename.filename().value());- if (hasSortAlpha && androidDrawableNifFilename.starts_with("ex_gg_fence_s_"))- {- handleDepthFlags(node->getOrCreateStateSet(), true, false);- Log(Debug::Info) << "OpenMW 0.51 Ghostfence depth-write fix active: " << mFilename;- }-#endif-- // While NetImmerse and Gamebryo support specular lighting, Morrowind has its support disabled.-'''- count = text.count(anchor)- if count != 1:- raise SystemExit(- f"nifloader.cpp/Ghostfence depth-write anchor: expected exactly one match, found {count}"- )- text = text.replace(anchor, replacement, 1)- print("Applied Ghostfence alpha depth-write suppression.")-else:- print("Ghostfence alpha depth-write suppression is already applied.")--if MARKER not in text:- raise SystemExit("nifloader.cpp: Patch-45 marker missing after patch")-if 'hasSortAlpha && androidDrawableNifFilename.starts_with("ex_gg_fence_s_")' not in text:- raise SystemExit("nifloader.cpp: Patch-45 Ghostfence scope check missing")-if "handleDepthFlags(node->getOrCreateStateSet(), true, false);" not in text:- raise SystemExit("nifloader.cpp: Patch-45 depth-test/depth-write state missing")--nifloader.write_text(text, encoding="utf-8", newline="\n")-print("OpenMW 0.51 Android Patch 45 source update: READY")diff --git a/android/buildscripts/patches/openmw051-final/apply-android-launcher-audit.py b/android/buildscripts/patches/openmw051-final/apply-android-launcher-audit.pydeleted file mode 100644index 3a82f20..0000000--- a/android/buildscripts/patches/openmw051-final/apply-android-launcher-audit.py+++ /dev/null@@ -1,707 +0,0 @@-#!/usr/bin/env python3-from pathlib import Path-import re-import sys--if len(sys.argv) != 2:- raise SystemExit("usage: apply-android-launcher-audit.py <project-root>")--root = Path(sys.argv[1]).resolve()--main_activity = root / "app/src/main/java/ui/activity/MainActivity.kt"-game_activity = root / "app/src/main/java/ui/activity/GameActivity.kt"-fragment_settings = root / "app/src/main/java/ui/fragments/FragmentSettings.kt"-settings_activity = root / "app/src/main/java/ui/activity/SettingsActivity.kt"-settings_xml = root / "app/src/main/res/xml/settings.xml"-engine_xml = root / "app/src/main/res/xml/gs_engine.xml"-game_mechanics_xml = root / "app/src/main/res/xml/gs_game_mechanics.xml"-build_gradle = root / "app/build.gradle"--required = [- main_activity, game_activity, fragment_settings, settings_activity,- settings_xml, engine_xml, game_mechanics_xml, build_gradle,-]-for path in required:- if not path.is_file():- raise SystemExit(f"Patch 49 requires current OpenMW 0.51 project. Missing: {path}")--MARKER = "OPENMW_ANDROID_051_LAUNCHER_AUDIT_V1"--def read(path: Path) -> str:- return path.read_text(encoding="utf-8").replace("\r\n", "\n")--def write(path: Path, text: str) -> None:- path.write_text(text.replace("\r\n", "\n"), encoding="utf-8", newline="\n")--def replace_once(text: str, old: str, new: str, label: str) -> str:- count = text.count(old)- if count != 1:- raise SystemExit(f"{label}: expected exactly one anchor, found {count}")- return text.replace(old, new, 1)--def regex_once(text: str, pattern: str, repl: str, label: str, flags=0) -> str:- result, count = re.subn(pattern, repl, text, count=1, flags=flags)- if count != 1:- raise SystemExit(f"{label}: expected exactly one match, found {count}")- return result--def remove_preference_by_key(text: str, key: str, label: str) -> str:- pattern = rf'^[ \t]*<(?:ListPreference|CheckBoxPreference|EditTextPreference|Preference)\b[^>]*android:key="{re.escape(key)}"[^>]*/>[ \t]*\n?'- result, count = re.subn(pattern, "", text, count=1, flags=re.MULTILINE)- if count != 1:- raise SystemExit(f"{label}: expected preference {key!r}, found {count}")- return result--def replace_android_string(text: str, key: str, value: str, label: str) -> str:- pattern = rf'(<string\s+name="{re.escape(key)}"[^>]*>).*?(</string>)'- result, count = re.subn(- pattern,- lambda m: m.group(1) + value + m.group(2),- text,- count=1,- flags=re.DOTALL,- )- if count != 1:- raise SystemExit(f"{label}: string key {key!r} not found exactly once")- return result--def append_android_strings(text: str, pairs, label: str) -> str:- additions = []- for key, value in pairs:- if re.search(rf'<string\s+name="{re.escape(key)}"', text):- continue- additions.append(f' <string name="{key}">{value}</string>')- if not additions:- return text- if text.count("</resources>") != 1:- raise SystemExit(f"{label}: expected one </resources>")- return text.replace("</resources>", "\n".join(additions) + "\n</resources>", 1)--# ----------------------------------------------------------------------------# MainActivity: native OpenMW 0.51 Groundcover + safe performance defaults.-# ----------------------------------------------------------------------------text = read(main_activity)-if MARKER not in text:- text = replace_once(- text,- " migrateOpenMw051SettingsPreferences()\n",- " migrateOpenMw051SettingsPreferences()\n"- " migrateOpenMw051GroundcoverPreferences()\n",- "MainActivity/groundcover migration call",- )-- migration = r'''- /**- * OPENMW_ANDROID_051_LAUNCHER_AUDIT_V1- *- * OpenMW 0.51 no longer has the CaveBros Groundcover Paging/Instancing- * selector. Groundcover is a native instanced renderer controlled by- * [Groundcover] enabled, density and rendering distance.- *- * Import the old launcher choice once and then retire the legacy string key.- */- private fun migrateOpenMw051GroundcoverPreferences() {- val migrationKey = "migration_openmw051_groundcover_toggle_v1"- if (prefs.getBoolean(migrationKey, false)) {- return- }-- val settingsFile = File(Constants.USER_CONFIG, "settings.cfg")- val legacyMode = prefs.getString("gs_groundcover_handling", "0") ?: "0"- val configuredEnabled = readOpenMwSetting(- settingsFile,- "Groundcover",- "enabled"- )-- val groundcoverEnabled = when {- configuredEnabled.equals("true", ignoreCase = true) -> true- configuredEnabled.equals("false", ignoreCase = true) -> false- else -> legacyMode == "1" || legacyMode == "2"- }-- val groundcoverDensity = readOpenMwSetting(- settingsFile,- "Groundcover",- "density"- )?.toFloatOrNull()?.coerceIn(0.0f, 1.0f) ?: 1.0f-- val groundcoverRenderingDistance = readOpenMwSetting(- settingsFile,- "Groundcover",- "rendering distance"- )?.toFloatOrNull()?.coerceAtLeast(0.0f) ?: 6144.0f-- prefs.edit()- .putBoolean("gs_groundcover_enabled", groundcoverEnabled)- .putString(- "gs_groundcover_density",- String.format(Locale.ROOT, "%.2f", groundcoverDensity)- )- .putString(- "gs_groundcover_rendering_distance",- String.format(Locale.ROOT, "%.0f", groundcoverRenderingDistance)- )- .remove("gs_groundcover_handling")- .putBoolean(migrationKey, true)- .apply()-- Log.i(- TAG,- "Migrated OpenMW 0.51 Groundcover launcher settings: " +- "enabled=$groundcoverEnabled, " +- "density=$groundcoverDensity, " +- "renderingDistance=$groundcoverRenderingDistance"- )- }--'''- text = replace_once(- text,- " private fun controllerTriggerThresholds(): Pair<Int, Int> {\n",- migration + " private fun controllerTriggerThresholds(): Pair<Int, Int> {\n",- "MainActivity/insert groundcover migration",- )-- text = replace_once(- text,- ''' val groundcoverPointLighting =- prefs.getBoolean("gs_groundcover_point_lighting", true)-''',- ''' val groundcoverEnabled =- prefs.getBoolean("gs_groundcover_enabled", false)- val groundcoverDensity =- prefs.getString("gs_groundcover_density", "1.00")- ?.toFloatOrNull()- ?.coerceIn(0.0f, 1.0f)- ?: 1.0f- val groundcoverRenderingDistance =- prefs.getString("gs_groundcover_rendering_distance", "6144")- ?.toFloatOrNull()- ?.coerceAtLeast(0.0f)- ?: 6144.0f- val groundcoverPointLighting =- prefs.getBoolean("gs_groundcover_point_lighting", true)-''',- "MainActivity/groundcover values",- )-- text = replace_once(- text,- ''' linkedMapOf(- "point lighting" to if (groundcoverPointLighting) "true" else "false"- )-''',- ''' linkedMapOf(- "enabled" to if (groundcoverEnabled) "true" else "false",- "density" to String.format(Locale.ROOT, "%.2f", groundcoverDensity),- "rendering distance" to String.format(- Locale.ROOT,- "%.0f",- groundcoverRenderingDistance- ),- "point lighting" to if (groundcoverPointLighting) "true" else "false"- )-''',- "MainActivity/section-aware groundcover write",- )-- text = replace_once(- text,- ''' "cameraListener=$cameraListener, " +- "groundcoverPointLighting=$groundcoverPointLighting"-''',- ''' "cameraListener=$cameraListener, " +- "groundcoverEnabled=$groundcoverEnabled, " +- "groundcoverDensity=$groundcoverDensity, " +- "groundcoverRenderingDistance=$groundcoverRenderingDistance, " +- "groundcoverPointLighting=$groundcoverPointLighting"-''',- "MainActivity/groundcover log",- )-- text = regex_once(- text,- r'^[ \t]*"timeplayed"\s+to\s+if\(prefs\.getBoolean\("gs_add_time_to_saves", false\)\)\s+"true"\s+else\s+"false",?\n',- "",- "MainActivity/remove obsolete timeplayed",- flags=re.MULTILINE,- )- text = regex_once(- text,- r'^[ \t]*"enabled"\s+to\s+if\(prefs\.getString\("gs_groundcover_handling", "0"\)\s*==\s*"2"\)\s+"true"\s+else\s+"false",?\n',- "",- "MainActivity/remove legacy groundcover enabled",- flags=re.MULTILINE,- )- text = regex_once(- text,- r'^[ \t]*"paging"\s+to\s+if\(prefs\.getString\("gs_groundcover_handling", "0"\)\s*==\s*"1"\)\s+"true"\s+else\s+"false",?\n',- "",- "MainActivity/remove legacy groundcover paging",- flags=re.MULTILINE,- )-- text = replace_once(- text,- '"write to navmeshdb" to if(prefs.getBoolean("gs_write_navmesh", false)) "true" else "false"',- '"write to navmeshdb" to if(prefs.getBoolean("gs_write_navmesh", true)) "true" else "false"',- "MainActivity/navmesh disk-cache default",- )-- text = replace_once(- text,- '"preload num threads" to prefs.getString("gs_preload_threads", "1").toString()',- '''"preload num threads" to ((prefs.getString("gs_preload_threads", "2")- ?.toIntOrNull() ?: 2).coerceIn(1, 3)).toString()''',- "MainActivity/preload thread policy",- )- write(main_activity, text)--# ----------------------------------------------------------------------------# Engine page: native 0.51 Groundcover controls + proper navmesh default.-# ----------------------------------------------------------------------------text = read(engine_xml)-if 'android:key="gs_groundcover_enabled"' not in text:- match = re.search(- r'^[ \t]*<ListPreference\b[^>]*android:key="gs_groundcover_handling"[^>]*/>[ \t]*\n',- text,- flags=re.MULTILINE,- )- if not match:- raise SystemExit("gs_engine.xml: legacy Groundcover ListPreference not found")-- replacement = ''' <CheckBoxPreference android:key="gs_groundcover_enabled" android:title="@string/gs_groundcover_handling_title" android:summary="@string/gs_groundcover_handling_summary" android:defaultValue="false" />- <Preference android:key="gs_groundcover_density" android:title="@string/gs_groundcover_density_title" android:summary="@string/gs_groundcover_density_summary" android:dependency="gs_groundcover_enabled" />- <Preference android:key="gs_groundcover_rendering_distance" android:title="@string/gs_groundcover_rendering_distance_title" android:summary="@string/gs_groundcover_rendering_distance_summary" android:dependency="gs_groundcover_enabled" />-'''- text = text[:match.start()] + replacement + text[match.end():]-- text = replace_once(- text,- '<CheckBoxPreference android:key="gs_groundcover_point_lighting" android:title="@string/gs_groundcover_point_lighting_title" android:summary="@string/gs_groundcover_point_lighting_summary" android:defaultValue="true" />',- '<CheckBoxPreference android:key="gs_groundcover_point_lighting" android:title="@string/gs_groundcover_point_lighting_title" android:summary="@string/gs_groundcover_point_lighting_summary" android:defaultValue="true" android:dependency="gs_groundcover_enabled" />',- "gs_engine.xml/groundcover dependency",- )- text = replace_once(- text,- '<CheckBoxPreference android:key="gs_write_navmesh" android:title="@string/gs_write_navmesh_title" android:defaultValue="false" android:summary="@string/gs_write_navmesh_summary" />',- '<CheckBoxPreference android:key="gs_write_navmesh" android:title="@string/gs_write_navmesh_title" android:defaultValue="true" android:summary="@string/gs_write_navmesh_summary" />',- "gs_engine.xml/navmesh cache default",- )- write(engine_xml, text)--# ----------------------------------------------------------------------------# SettingsActivity: Groundcover sliders and official preload recommendation.-# ----------------------------------------------------------------------------text = read(settings_activity)-if MARKER not in text:- old_block = ''' if (pageResource == R.xml.gs_engine) {- updatePreference(preferenceScreen.sharedPreferences, "gs_build_navmesh")- normalizeIntegerPreference("gs_navmesh_threads", 1, 8, 1)- normalizeIntegerPreference("gs_physics_threads", 1, 8, 1)- normalizeIntegerPreference("gs_preload_threads", 1, 8, 1)-- listOf(- "gs_navmesh_threads",- "gs_physics_threads",- "gs_preload_threads"- ).forEach { key ->- findPreference(key).setOnPreferenceClickListener {- showSteppedSliderPreference(- key = key,- title = findPreference(key).title.toString(),- minimum = 1.0f,- maximum = 8.0f,- step = 1.0f,- defaultValue = 1.0f,- decimals = 0- )- true- }- }- }-'''- new_block = ''' if (pageResource == R.xml.gs_engine) {- // OPENMW_ANDROID_051_LAUNCHER_AUDIT_V1- updatePreference(preferenceScreen.sharedPreferences, "gs_build_navmesh")-- normalizeFloatPreference("gs_groundcover_density", 0.0f, 1.0f, 1.0f, 2)- normalizeFloatPreference(- "gs_groundcover_rendering_distance",- 1024.0f,- 8192.0f,- 6144.0f,- 0- )-- findPreference("gs_groundcover_density").setOnPreferenceClickListener {- showSteppedSliderPreference(- key = "gs_groundcover_density",- title = findPreference("gs_groundcover_density").title.toString(),- minimum = 0.0f,- maximum = 1.0f,- step = 0.05f,- defaultValue = 1.0f,- decimals = 2- )- true- }-- findPreference("gs_groundcover_rendering_distance").setOnPreferenceClickListener {- showSteppedSliderPreference(- key = "gs_groundcover_rendering_distance",- title = findPreference("gs_groundcover_rendering_distance").title.toString(),- minimum = 1024.0f,- maximum = 8192.0f,- step = 256.0f,- defaultValue = 6144.0f,- decimals = 0- )- true- }-- normalizeIntegerPreference("gs_navmesh_threads", 1, 8, 1)- normalizeIntegerPreference("gs_physics_threads", 1, 8, 1)- normalizeIntegerPreference("gs_preload_threads", 1, 3, 2)-- listOf(- "gs_navmesh_threads",- "gs_physics_threads"- ).forEach { key ->- findPreference(key).setOnPreferenceClickListener {- showSteppedSliderPreference(- key = key,- title = findPreference(key).title.toString(),- minimum = 1.0f,- maximum = 8.0f,- step = 1.0f,- defaultValue = 1.0f,- decimals = 0- )- true- }- }-- findPreference("gs_preload_threads").setOnPreferenceClickListener {- showSteppedSliderPreference(- key = "gs_preload_threads",- title = findPreference("gs_preload_threads").title.toString(),- minimum = 1.0f,- maximum = 3.0f,- step = 1.0f,- defaultValue = 2.0f,- decimals = 0- )- true- }- }-'''- text = replace_once(text, old_block, new_block, "SettingsActivity/engine settings block")- write(settings_activity, text)--# ----------------------------------------------------------------------------# Remove obsolete save-time toggle.-# ----------------------------------------------------------------------------text = read(game_mechanics_xml)-if 'android:key="gs_add_time_to_saves"' in text:- text = remove_preference_by_key(- text,- "gs_add_time_to_saves",- "gs_game_mechanics.xml/remove obsolete time-played toggle",- )- write(game_mechanics_xml, text)--# ----------------------------------------------------------------------------# Retire GLES1 selector; force tested GLES2/GL4ES final path.-# ----------------------------------------------------------------------------text = read(settings_xml)-if 'android:key="pref_graphicsLibrary_v2"' in text:- text = remove_preference_by_key(- text,- "pref_graphicsLibrary_v2",- "settings.xml/remove GLES1/GLES2 selector",- )- write(settings_xml, text)--text = read(game_activity)-if MARKER not in text:- text = replace_once(- text,- ' val graphicsLibrary = prefs!!.getString("pref_graphicsLibrary_v2", "")\n',- "",- "GameActivity/remove graphicsLibrary preference",- )- old = ''' System.loadLibrary("SDL2")- if (graphicsLibrary != "gles1") {- try {- Os.setenv("OPENMW_GLES_VERSION", "2", true)- Os.setenv("LIBGL_ES", "2", true)- } catch (e: ErrnoException) {- Log.e("OpenMW", "Failed setting environment variables.")- e.printStackTrace()- }-- }--'''- new = ''' System.loadLibrary("SDL2")-- // OPENMW_ANDROID_051_LAUNCHER_AUDIT_V1- // OpenMW 0.51 final and this port's GL4ES/OMWFX compatibility shaders- // use the GLES2 backend. The old GLES1 launcher selector is a CaveBros- // legacy path and is no longer exposed.- try {- Os.setenv("OPENMW_GLES_VERSION", "2", true)- Os.setenv("LIBGL_ES", "2", true)- } catch (e: ErrnoException) {- Log.e("OpenMW", "Failed setting GLES2 environment variables.")- e.printStackTrace()- }--'''- text = replace_once(text, old, new, "GameActivity/force GLES2")- write(game_activity, text)--text = read(fragment_settings)-old = ''' /**- * @brief Disable gamma preference if GLES1 is selected- */- private fun updateGammaState() {- val sharedPref = preferenceScreen.sharedPreferences- findPreference("pref_gamma").isEnabled =- sharedPref.getString("pref_graphicsLibrary_v2", "") != "gles1"--'''-if old in text:- new = ''' /**- * Update launcher controls whose availability depends on another option.- * GLES1 is no longer exposed by the OpenMW 0.51 Android launcher.- */- private fun updateGammaState() {- val sharedPref = preferenceScreen.sharedPreferences- findPreference("pref_gamma").isEnabled = true--'''- text = replace_once(text, old, new, "FragmentSettings/remove GLES1 gamma dependency")- write(fragment_settings, text)--# ----------------------------------------------------------------------------# Localisation + obsolete arrays cleanup.-# ----------------------------------------------------------------------------locale_text = {- "values": {- "title": "Groundcover",- "summary": "Enable OpenMW 0.51 native instanced groundcover rendering for mods loaded through the Groundcovers tab.",- "density_title": "Groundcover Density",- "density_summary": "Percentage of groundcover instances to render. 100% keeps the full mod density; lower values improve performance.",- "distance_title": "Groundcover Rendering Distance",- "distance_summary": "Distance at which groundcover is rendered. Larger values increase rendering cost.",- "preload": "Number of background threads used for preloading. OpenMW 0.51 recommends 2–3 on multicore systems; 4 or more is not recommended.",- },- "values-de": {- "title": "Bodenbewuchs",- "summary": "Aktiviert den nativen instanzierten Bodenbewuchs-Renderer von OpenMW 0.51 für Mods aus dem Reiter „Bodenbewuchs“.",- "density_title": "Bodenbewuchs-Dichte",- "density_summary": "Anteil der gerenderten Bodenbewuchs-Instanzen. 100 % erhält die vollständige Mod-Dichte; niedrigere Werte verbessern die Leistung.",- "distance_title": "Bodenbewuchs-Sichtweite",- "distance_summary": "Entfernung, bis zu der Bodenbewuchs gerendert wird. Größere Werte erhöhen den Renderaufwand.",- "preload": "Anzahl der Hintergrund-Threads zum Vorladen. OpenMW 0.51 empfiehlt auf Mehrkern-Systemen 2–3; 4 oder mehr werden nicht empfohlen.",- },- "values-fr": {- "title": "Végétation au sol",- "summary": "Active le rendu instancié natif d’OpenMW 0.51 pour les mods chargés via l’onglet de végétation au sol.",- "density_title": "Densité de la végétation au sol",- "density_summary": "Pourcentage d’instances de végétation affichées. 100 % conserve la densité complète du mod ; des valeurs plus basses améliorent les performances.",- "distance_title": "Distance d’affichage de la végétation",- "distance_summary": "Distance jusqu’à laquelle la végétation au sol est affichée. Des valeurs plus élevées augmentent le coût du rendu.",- "preload": "Nombre de threads d’arrière-plan utilisés pour le préchargement. OpenMW 0.51 recommande 2 à 3 threads sur les systèmes multicœurs ; 4 ou plus ne sont pas recommandés.",- },- "values-pl": {- "title": "Roślinność podłoża",- "summary": "Włącza natywne renderowanie instancjonowane OpenMW 0.51 dla modów wczytanych przez kartę roślinności podłoża.",- "density_title": "Gęstość roślinności podłoża",- "density_summary": "Procent renderowanych instancji roślinności. 100% zachowuje pełną gęstość moda; niższe wartości zwiększają wydajność.",- "distance_title": "Zasięg renderowania roślinności",- "distance_summary": "Odległość, do której renderowana jest roślinność podłoża. Większe wartości zwiększają koszt renderowania.",- "preload": "Liczba wątków w tle używanych do wstępnego ładowania. OpenMW 0.51 zaleca 2–3 na systemach wielordzeniowych; 4 lub więcej nie jest zalecane.",- },- "values-ru": {- "title": "Наземная растительность",- "summary": "Включает нативный инстансинг OpenMW 0.51 для модов, загруженных через вкладку наземной растительности.",- "density_title": "Плотность наземной растительности",- "density_summary": "Доля отображаемых экземпляров растительности. 100% сохраняет полную плотность мода; меньшие значения повышают производительность.",- "distance_title": "Дальность отрисовки растительности",- "distance_summary": "Расстояние, на котором отображается наземная растительность. Большие значения увеличивают нагрузку на рендеринг.",- "preload": "Количество фоновых потоков предварительной загрузки. OpenMW 0.51 рекомендует 2–3 на многоядерных системах; 4 и более не рекомендуются.",- },- "values-sv": {- "title": "Markvegetation",- "summary": "Aktiverar OpenMW 0.51:s inbyggda instansrendering för markvegetationsmoddar som lästs in via fliken för markvegetation.",- "density_title": "Markvegetationens täthet",- "density_summary": "Andel markvegetationsinstanser som ritas. 100 % behåller moddarnas fulla täthet; lägre värden förbättrar prestandan.",- "distance_title": "Ritavstånd för markvegetation",- "distance_summary": "Avståndet som markvegetation ritas på. Högre värden ökar renderingskostnaden.",- "preload": "Antal bakgrundstrådar för förinläsning. OpenMW 0.51 rekommenderar 2–3 på flerkärniga system; 4 eller fler rekommenderas inte.",- },-}--for dirname, tr in locale_text.items():- strings = root / f"app/src/main/res/{dirname}/strings.xml"- prefs_strings = root / f"app/src/main/res/{dirname}/launcher_preferences.xml"- if not strings.is_file() or not prefs_strings.is_file():- raise SystemExit(f"Patch 49 requires complete launcher locale: {dirname}")-- s = read(strings)- for array_name in (- "gs_groundcover_handling_entries",- "gs_groundcover_handling_values",- "pref_graphicsLibrary_entries",- "pref_graphicsLibrary_values",- ):- pattern = rf'\n?[ \t]*<string-array\s+name="{re.escape(array_name)}"[^>]*>.*?</string-array>[ \t]*'- s = re.sub(pattern, "", s, flags=re.DOTALL)- write(strings, s)-- p = read(prefs_strings)- p = replace_android_string(- p, "gs_groundcover_handling_title", tr["title"],- f"{dirname}/groundcover title"- )- p = replace_android_string(- p, "gs_groundcover_handling_summary", tr["summary"],- f"{dirname}/groundcover summary"- )- p = replace_android_string(- p, "gs_preload_threads_summary", tr["preload"],- f"{dirname}/preload summary"- )- p = append_android_strings(- p,- [- ("gs_groundcover_density_title", tr["density_title"]),- ("gs_groundcover_density_summary", tr["density_summary"]),- ("gs_groundcover_rendering_distance_title", tr["distance_title"]),- ("gs_groundcover_rendering_distance_summary", tr["distance_summary"]),- ],- f"{dirname}/new Groundcover strings",- )- write(prefs_strings, p)--# ----------------------------------------------------------------------------# Release verification gate.-# ----------------------------------------------------------------------------text = read(build_gradle)-if "OPENMW_ANDROID_051_LAUNCHER_AUDIT_GATE_V1" not in text:- text = replace_once(- text,- ''' !launcherMainActivity.contains('"gs_groundcover_point_lighting"') ||-''',- ''' !launcherMainActivity.contains('"gs_groundcover_point_lighting"') ||- !launcherMainActivity.contains('"gs_groundcover_enabled"') ||- !launcherMainActivity.contains('"gs_groundcover_density"') ||- !launcherMainActivity.contains('"gs_groundcover_rendering_distance"') ||- launcherMainActivity.contains('"paging" to if(prefs.getString("gs_groundcover_handling"') ||- launcherMainActivity.contains('"timeplayed" to') ||-''',- "build.gradle/MainActivity audit gate",- )-- text = replace_once(- text,- ''' hideOnScreenButtonsIndex <= onScreenControlsIndex) {-''',- ''' hideOnScreenButtonsIndex <= onScreenControlsIndex ||- launcherSettingsXml.contains('android:key="pref_graphicsLibrary_v2"')) {-''',- "build.gradle/remove GLES1 selector gate",- )-- old_engine_gate = ''' def launcherEngineXml = file('src/main/res/xml/gs_engine.xml').getText('UTF-8')- if (!launcherEngineXml.contains('android:key="gs_groundcover_point_lighting"') ||- !launcherEngineXml.contains('android:defaultValue="true"')) {- throw new GradleException(- 'OpenMW 0.51 Groundcover point-lighting control is missing.'- )- }-'''- new_engine_gate = ''' // OPENMW_ANDROID_051_LAUNCHER_AUDIT_GATE_V1- def launcherEngineXml = file('src/main/res/xml/gs_engine.xml').getText('UTF-8')- if (!launcherEngineXml.contains('android:key="gs_groundcover_enabled"') ||- !launcherEngineXml.contains('android:key="gs_groundcover_density"') ||- !launcherEngineXml.contains('android:key="gs_groundcover_rendering_distance"') ||- !launcherEngineXml.contains('android:key="gs_groundcover_point_lighting"') ||- launcherEngineXml.contains('android:key="gs_groundcover_handling"')) {- throw new GradleException(- 'OpenMW 0.51 native Groundcover launcher controls are incomplete or legacy Paging remains.'- )- }-- def launcherGameActivity = file('src/main/java/ui/activity/GameActivity.kt').getText('UTF-8')- if (!launcherGameActivity.contains('OPENMW_ANDROID_051_LAUNCHER_AUDIT_V1') ||- !launcherGameActivity.contains('Os.setenv("OPENMW_GLES_VERSION", "2", true)') ||- !launcherGameActivity.contains('Os.setenv("LIBGL_ES", "2", true)') ||- launcherGameActivity.contains('graphicsLibrary != "gles1"')) {- throw new GradleException(- 'OpenMW 0.51 Android final runtime must use the GLES2/GL4ES path.'- )- }-'''- text = replace_once(- text, old_engine_gate, new_engine_gate, "build.gradle/engine audit gate"- )- text = replace_once(- text,- " 'gs_groundcover_handling_entries',\n",- "",- "build.gradle/remove obsolete Groundcover localized array",- )- write(build_gradle, text)--# ----------------------------------------------------------------------------# Final verification.-# ----------------------------------------------------------------------------main = read(main_activity)-game = read(game_activity)-engine = read(engine_xml)-settings = read(settings_xml)-mechanics = read(game_mechanics_xml)-activity = read(settings_activity)-gradle = read(build_gradle)--checks = {- "MainActivity audit marker": MARKER in main,- "Groundcover migrated to boolean": '"gs_groundcover_enabled"' in main,- "Groundcover density mapped": '"density" to String.format' in main,- "Groundcover rendering distance mapped": '"rendering distance" to String.format' in main,- "Legacy Groundcover paging writer removed": '"paging" to if(prefs.getString("gs_groundcover_handling"' not in main,- "Obsolete timeplayed writer removed": '"timeplayed" to' not in main,- "Preload threads clamped 1..3": 'coerceIn(1, 3)' in main and '"gs_preload_threads", "2"' in main,- "Navmesh DB default true": 'prefs.getBoolean("gs_write_navmesh", true)' in main,- "Groundcover checkbox present": 'android:key="gs_groundcover_enabled"' in engine,- "Groundcover density control present": 'android:key="gs_groundcover_density"' in engine,- "Groundcover distance control present": 'android:key="gs_groundcover_rendering_distance"' in engine,- "Legacy Groundcover selector absent": 'android:key="gs_groundcover_handling"' not in engine,- "GLES1 selector absent": 'android:key="pref_graphicsLibrary_v2"' not in settings,- "GLES2 forced": MARKER in game and 'Os.setenv("LIBGL_ES", "2", true)' in game,- "Obsolete time-played checkbox absent": 'android:key="gs_add_time_to_saves"' not in mechanics,- "Preload slider max 3": 'maximum = 3.0f' in activity,- "Release audit gate present": 'OPENMW_ANDROID_051_LAUNCHER_AUDIT_GATE_V1' in gradle,-}-failed = [name for name, ok in checks.items() if not ok]-if failed:- raise SystemExit("Patch 49 verification failed:\n - " + "\n - ".join(failed))--print()-print("OpenMW 0.51 Patch 49 launcher audit/cleanup: PASS")-print("Groundcover: native 0.51 Off/On + Density + Rendering Distance")-print("Groundcover legacy Paging: removed")-print("Groundcover writes: section-aware [Groundcover]")-print("GLES1 launcher backend: removed; GLES2/GL4ES forced")-print("Obsolete Add Time Played option: removed")-print("Preload threads: 1-3, Android default 2")-print("Navmesh disk cache: OpenMW 0.51 default On")-print("Localized launcher strings: updated")-print("Native OpenMW library: unchanged")-print()-print("Build the APK normally in Android Studio.")diff --git a/android/buildscripts/patches/openmw051-final/apply-android-runtime-baseline.py b/android/buildscripts/patches/openmw051-final/apply-android-runtime-baseline.pydeleted file mode 100644index ff5b879..0000000--- a/android/buildscripts/patches/openmw051-final/apply-android-runtime-baseline.py+++ /dev/null@@ -1,1919 +0,0 @@-#!/usr/bin/env python3-from pathlib import Path-import sys--if len(sys.argv) != 2:- raise SystemExit('usage: apply-android-runtime-baseline.py <openmw-source-dir>')--root = Path(sys.argv[1])-engine = root / 'apps' / 'openmw' / 'engine.cpp'-androidmain = root / 'apps' / 'openmw' / 'androidmain.cpp'-loading = root / 'apps' / 'openmw' / 'mwgui' / 'loadingscreen.cpp'-windowmanager = root / 'apps' / 'openmw' / 'mwgui' / 'windowmanagerimp.cpp'-nifloader = root / 'components' / 'nifosg' / 'nifloader.cpp'-stateupdater = root / 'components' / 'sceneutil' / 'stateupdater.cpp'-objects_frag = root / 'files' / 'shaders' / 'compatibility' / 'objects.frag'-fog_glsl = root / 'files' / 'shaders' / 'compatibility' / 'fog.glsl'-shadow_fragment = root / 'files' / 'shaders' / 'compatibility' / 'shadows_fragment.glsl'-shadow_casting = root / 'files' / 'shaders' / 'compatibility' / 'shadowcasting.vert'-mwshadowtechnique = root / 'components' / 'sceneutil' / 'mwshadowtechnique.cpp'-shadow_manager = root / 'components' / 'sceneutil' / 'shadow.cpp'-postprocessor = root / 'apps' / 'openmw' / 'mwrender' / 'postprocessor.cpp'-postprocessor_hpp = root / 'apps' / 'openmw' / 'mwrender' / 'postprocessor.hpp'-renderingmanager = root / 'apps' / 'openmw' / 'mwrender' / 'renderingmanager.cpp'-renderingmanager_hpp = root / 'apps' / 'openmw' / 'mwrender' / 'renderingmanager.hpp'-fx_stateupdater_hpp = root / 'components' / 'fx' / 'stateupdater.hpp'-water_cpp = root / 'apps' / 'openmw' / 'mwrender' / 'water.cpp'-water_frag = root / 'files' / 'shaders' / 'compatibility' / 'water.frag'--for path in (engine, androidmain, loading, windowmanager, nifloader, stateupdater, objects_frag, fog_glsl,- shadow_fragment, shadow_casting, mwshadowtechnique, shadow_manager, postprocessor, postprocessor_hpp,- renderingmanager, renderingmanager_hpp, fx_stateupdater_hpp, water_cpp, water_frag):- if not path.is_file():- raise SystemExit(f'missing expected OpenMW 0.51 source file: {path}')--RUNTIME_MARKER = 'OPENMW_ANDROID_051_RUNTIME_BASELINE'---def replace_once(text: str, old: str, new: str, label: str) -> str:- count = text.count(old)- if count != 1:- raise SystemExit(f'{label}: expected exactly one anchor, found {count}')- return text.replace(old, new, 1)--# ----------------------------------------------------------------------------# Android Surface lifecycle bridge-# ----------------------------------------------------------------------------text = engine.read_text(encoding='utf-8')-if RUNTIME_MARKER not in text:- text = replace_once(- text,- 'void OMW::Engine::createWindow()\n{',- '''#ifdef ANDROID\n// OPENMW_ANDROID_051_RUNTIME_BASELINE\n// Shared with androidmain.cpp. Android can destroy/recreate the Surface while\n// the native OpenMW process and viewer remain alive.\nosg::ref_ptr<osgViewer::Viewer> g_viewer;\nbool g_androidWindowManagerReady = false;\n#endif\n\nvoid OMW::Engine::createWindow()\n{''',- 'engine/createWindow marker',- )-- text = replace_once(- text,- ''' mViewer->getEventQueue()->getCurrentEventState()->setWindowRectangle(\n 0, 0, graphicsWindow->getTraits()->width, graphicsWindow->getTraits()->height);\n}''',- ''' mViewer->getEventQueue()->getCurrentEventState()->setWindowRectangle(\n 0, 0, graphicsWindow->getTraits()->width, graphicsWindow->getTraits()->height);\n\n#ifdef ANDROID\n // Keep a strong viewer reference for the Java Surface lifecycle bridge.\n g_viewer = mViewer;\n#endif\n}''',- 'engine/viewer assignment',- )-- text = replace_once(- text,- ''' mEnvironment.setWindowManager(*mWindowManager);\n\n mInputManager = std::make_unique<MWInput::InputManager>''',- ''' mEnvironment.setWindowManager(*mWindowManager);\n#ifdef ANDROID\n g_androidWindowManagerReady = true;\n#endif\n\n mInputManager = std::make_unique<MWInput::InputManager>''',- 'engine/window manager ready',- )-- text = replace_once(- text,- ''' mLuaWorker->join();\n\n // Save user settings''',- ''' mLuaWorker->join();\n\n#ifdef ANDROID\n g_androidWindowManagerReady = false;\n g_viewer.release();\n#endif\n\n // Save user settings''',- 'engine/viewer release',- )-- engine.write_text(text, encoding='utf-8', newline='\n')- print('Applied OpenMW 0.51 Android Surface lifecycle bridge.')-else:- print('OpenMW 0.51 Android Surface lifecycle bridge is already applied.')--text = androidmain.read_text(encoding='utf-8')-if RUNTIME_MARKER not in text:- text = replace_once(- text,- '#include "SDL_main.h"\n',- '''#include "SDL_main.h"\n#include "mwbase/environment.hpp"\n#include "mwbase/windowmanager.hpp"\n''',- 'androidmain/OpenMW includes',- )- text = replace_once(- text,- '#include <SDL_gamecontroller.h>\n#include <SDL_mouse.h>\n',- '''#include <SDL_gamecontroller.h>\n#include <SDL_hints.h>\n#include <SDL_mouse.h>\n\n#include <osg/GraphicsContext>\n#include <osg/OperationThread>\n#include <osgViewer/Viewer>\n''',- 'androidmain/SDL+OSG includes',- )- text = replace_once(- text,- ''' "righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4");\n\n return 0;\n}\n''',- ''' "righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4");\n\n // OPENMW_ANDROID_051_RUNTIME_BASELINE\n // Do not stall the SDL thread while Android is paused. Surface ownership is\n // coordinated explicitly below with OSG's GraphicsContext operation queue.\n SDL_SetHint(SDL_HINT_ANDROID_BLOCK_ON_PAUSE, "0");\n SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");\n\n return 0;\n}\n\nextern osg::ref_ptr<osgViewer::Viewer> g_viewer;\nextern bool g_androidWindowManagerReady;\nstatic osg::GraphicsContext* g_androidContext = nullptr;\n\nclass CtxReleaseOperation : public osg::Operation\n{\npublic:\n CtxReleaseOperation()\n : osg::Operation("OpenMW Android release GL context", false)\n {\n }\n\n void operator()(osg::Object*) override\n {\n if (g_androidContext)\n g_androidContext->releaseContext();\n }\n};\n\nclass CtxAcquireOperation : public osg::Operation\n{\npublic:\n CtxAcquireOperation()\n : osg::Operation("OpenMW Android acquire GL context", false)\n {\n }\n\n void operator()(osg::Object*) override\n {\n if (g_androidContext)\n g_androidContext->makeCurrent();\n }\n};\n\nextern "C" void Java_org_libsdl_app_SDLActivity_omwSurfaceDestroyed(JNIEnv*, jclass)\n{\n if (!g_viewer)\n return;\n\n g_androidContext = g_viewer->getCamera()->getGraphicsContext();\n if (g_androidContext)\n g_androidContext->add(new CtxReleaseOperation());\n\n if (g_androidWindowManagerReady)\n MWBase::Environment::get().getWindowManager()->windowVisibilityChange(false);\n}\n\nextern "C" void Java_org_libsdl_app_SDLActivity_omwSurfaceRecreated(JNIEnv*, jclass)\n{\n if (!g_viewer)\n return;\n\n g_androidContext = g_viewer->getCamera()->getGraphicsContext();\n if (g_androidContext)\n g_androidContext->add(new CtxAcquireOperation());\n\n if (g_androidWindowManagerReady)\n MWBase::Environment::get().getWindowManager()->windowVisibilityChange(true);\n}\n''',- 'androidmain/runtime bridge',- )- androidmain.write_text(text, encoding='utf-8', newline='\n')- print('Applied OpenMW 0.51 Android JNI lifecycle hooks and SDL hints.')-else:- print('OpenMW 0.51 Android JNI lifecycle hooks are already applied.')--# ----------------------------------------------------------------------------# Initialize the native OpenMW 0.51 post-processing render-# size before any HUD viewport, texture, or FBO objects are created.-#-# Upstream 0.51 assigns mWidth/mHeight only after createObjectsForFrame(0/1).-# On Android/GL4ES this can create startup render targets from indeterminate-# dimensions. Keep desktop behaviour unchanged and move only the Android size-# acquisition to the beginning of the constructor. Header defaults add a safe-# zero baseline for all platforms without altering normal runtime dimensions.-# ----------------------------------------------------------------------------pp_init_marker = 'OPENMW_ANDROID_051_GATE_G_PP_INIT'-text = postprocessor_hpp.read_text(encoding='utf-8')-if pp_init_marker not in text:- text = replace_once(- text,- ''' int mGLSLVersion;- int mWidth;- int mHeight;- int mSamples;''',- ''' int mGLSLVersion;- // OPENMW_ANDROID_051_GATE_G_PP_INIT-#ifdef ANDROID- // Safe defaults; Android assigns the live GraphicsContext size before- // the first PP viewport/textures/FBOs are constructed.- int mWidth = 0;- int mHeight = 0;-#else- int mWidth;- int mHeight;-#endif- int mSamples;''',- 'postprocessor.hpp/safe render-size defaults',- )- postprocessor_hpp.write_text(text, encoding='utf-8', newline='\n')- print('Applied safe OpenMW 0.51 post-processing render-size defaults.')-else:- print('OpenMW 0.51 post-processing render-size defaults are already applied.')--text = postprocessor.read_text(encoding='utf-8')-if pp_init_marker not in text:- text = replace_once(- text,- '#include <thread>\n',- '#include <thread>\n#include <stdexcept>\n',- 'postprocessor.cpp/stdexcept include',- )- text = replace_once(- text,- # Isowind: anchored on the line alone (Isowind sets up its pixel art scale just before it)- ''' auto& shaderManager = mRendering.getResourceSystem()->getSceneManager()->getShaderManager();''',- '''#ifdef ANDROID- // OPENMW_ANDROID_051_GATE_G_PP_INIT- // Establish the actual Android render size before setViewport()- // and before createObjectsForFrame() allocates PP textures/FBOs.- osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext();- if (!gc || !gc->getTraits())- throw std::runtime_error("OpenMW Android: missing GraphicsContext traits for post-processing");- mWidth = gc->getTraits()->width;- mHeight = gc->getTraits()->height;- Log(Debug::Info) << "OpenMW 0.51 Android renderer: " << mWidth << "x" << mHeight- << ", Tex_Depth scene binding";-#endif-- auto& shaderManager = mRendering.getResourceSystem()->getSceneManager()->getShaderManager();''',- 'postprocessor.cpp/early Android render size',- )- text = replace_once(- text,- ''' osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext();- osg::GLExtensions* ext = gc->getState()->get<osg::GLExtensions>();-- mWidth = gc->getTraits()->width;- mHeight = gc->getTraits()->height;''',- '''#ifndef ANDROID- osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext();- mWidth = gc->getTraits()->width;- mHeight = gc->getTraits()->height;-#endif- osg::GLExtensions* ext = gc->getState()->get<osg::GLExtensions>();''',- 'postprocessor.cpp/reuse early Android GraphicsContext',- )- postprocessor.write_text(text, encoding='utf-8', newline='\n')- print('Applied early Android OpenMW 0.51 post-processing render-size initialization.')-else:- print('OpenMW 0.51 early post-processing render-size initialization is already applied.')--# ----------------------------------------------------------------------------# Android GLES/GL4ES post-processing scene depth.-#-# The OpenMW 0.50 Android runtime deliberately exposed Tex_Depth to OMWFX.-# Tex_OpaqueDepth relies on a depth-copy path which is not reliable on the-# GLES2/GL4ES backend. Without this routing, depth-shaped Godrays compile but-# receive an empty/stale mask and therefore evaluate to zero on device.-# Keep the upstream opaque-depth source on every non-Android platform.-# ----------------------------------------------------------------------------pp_scene_depth_marker = 'OPENMW_ANDROID_051_POSTPROCESSING_SCENE_DEPTH'-text = postprocessor.read_text(encoding='utf-8')-if pp_scene_depth_marker not in text:- text = replace_once(- text,- ' mCanvases[frameId]->setTextureDepth(getTexture(Tex_OpaqueDepth, frameId));',- '''#ifdef ANDROID- // OPENMW_ANDROID_051_POSTPROCESSING_SCENE_DEPTH- // The primary scene depth texture is directly sampleable on GLES2.- // Tex_OpaqueDepth depends on an unreliable GL4ES depth copy/blit.- mCanvases[frameId]->setTextureDepth(getTexture(Tex_Depth, frameId));-#else- mCanvases[frameId]->setTextureDepth(getTexture(Tex_OpaqueDepth, frameId));-#endif''',- 'postprocessor.cpp/Android OMWFX scene-depth binding',- )- postprocessor.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android OpenMW 0.51 direct scene-depth binding for OMWFX.')-else:- print('Android OpenMW 0.51 OMWFX scene-depth binding is already applied.')--# ----------------------------------------------------------------------------# Exact water exclusion for WetWorld.-#-# WetWorld reconstructs upward-facing surfaces from the scene depth texture.-# Transparent water does not own a reliable sampleable depth identity on the-# GLES2/GL4ES path, so reserve scene alpha 0 as an exact water marker. Normal-# RGB water shading, reflection/refraction and native rain ripples are kept.-# ----------------------------------------------------------------------------wetworld_water_marker = 'OPENMW_ANDROID_051_WETWORLD_WATER_MASK'-text = water_cpp.read_text(encoding='utf-8')-if wetworld_water_marker not in text:- text = replace_once(- text,- '#include <osg/ClipNode>\n#include <osg/Depth>',- '#include <osg/BlendFunc>\n#include <osg/ClipNode>\n#include <osg/Depth>',- 'water.cpp/WetWorld BlendFunc include',- )- text = replace_once(- text,- # Isowind: anchored on the line alone (Isowind's noCutaway uniform follows it)- ''' osg::ref_ptr<osg::StateSet> stateset = SceneUtil::createSimpleWaterStateSet(alpha, MWRender::RenderBin_Water);-''',- ''' osg::ref_ptr<osg::StateSet> stateset = SceneUtil::createSimpleWaterStateSet(alpha, MWRender::RenderBin_Water);--#ifdef ANDROID- // OPENMW_ANDROID_051_WETWORLD_WATER_MASK- // Preserve normal RGB blending and force only scene alpha to zero.- stateset->setAttributeAndModes(- new osg::BlendFunc(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA,- osg::BlendFunc::ZERO, osg::BlendFunc::ZERO),- osg::StateAttribute::ON);-#endif-''',- 'water.cpp/simple-water alpha marker',- )- text = replace_once(- text,- ''' else- {- stateset->setMode(GL_BLEND, osg::StateAttribute::ON);- stateset->setRenderBinDetails(MWRender::RenderBin_Water, "RenderBin");''',- ''' else- {- stateset->setMode(GL_BLEND, osg::StateAttribute::ON);-#ifdef ANDROID- // OPENMW_ANDROID_051_WETWORLD_WATER_MASK- // Preserve source-alpha RGB while reserving scene alpha 0.- stateset->setAttributeAndModes(- new osg::BlendFunc(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA,- osg::BlendFunc::ZERO, osg::BlendFunc::ZERO),- osg::StateAttribute::ON);-#endif- stateset->setRenderBinDetails(MWRender::RenderBin_Water, "RenderBin");''',- 'water.cpp/shader-water alpha marker',- )- text = replace_once(- text,- ''' defineMap["wobblyShores"] = Settings::water().mWobblyShores ? "1" : "0";-- Stereo::shaderStereoDefines(defineMap);''',- ''' defineMap["wobblyShores"] = Settings::water().mWobblyShores ? "1" : "0";-#ifdef ANDROID- defineMap["wetWorldWaterMask"] = "1";-#else- defineMap["wetWorldWaterMask"] = "0";-#endif-- Stereo::shaderStereoDefines(defineMap);''',- 'water.cpp/WetWorld shader define',- )- water_cpp.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android OpenMW 0.51 WetWorld water-alpha exclusion.')-else:- print('Android OpenMW 0.51 WetWorld water-alpha exclusion already applied.')--text = water_frag.read_text(encoding='utf-8')-if wetworld_water_marker not in text:- text = replace_once(- text,- ''' gl_FragData[0].rgb = mix(refraction, reflection, fresnel);- gl_FragData[0].a = 1.0;''',- ''' gl_FragData[0].rgb = mix(refraction, reflection, fresnel);-#if @wetWorldWaterMask- // OPENMW_ANDROID_051_WETWORLD_WATER_MASK- // Alpha is reserved as an exact post-processing water marker on Android.- // RGB shading and native rain-ripple lighting remain unchanged.- gl_FragData[0].a = 0.0;-#else- gl_FragData[0].a = 1.0;-#endif''',- 'water.frag/refraction alpha marker',- )- water_frag.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android OpenMW 0.51 WetWorld marker to water.frag.')-else:- print('Android OpenMW 0.51 water.frag WetWorld marker already applied.')--# ----------------------------------------------------------------------------# Loading screen: framebuffer copy is unreliable on Android/GL4ES. Keep the-# upstream implementation untouched on every non-Android platform.-# ----------------------------------------------------------------------------text = loading.read_text(encoding='utf-8')-loading_marker = 'OPENMW_ANDROID_051_LOADINGSCREEN_NO_FB_COPY'-if loading_marker not in text:- text = replace_once(- text,- ''' void LoadingScreen::setupCopyFramebufferToTextureCallback()\n {\n // Copy the current framebuffer onto a texture and display that texture as the background image''',- ''' void LoadingScreen::setupCopyFramebufferToTextureCallback()\n {\n#ifdef ANDROID\n // OPENMW_ANDROID_051_LOADINGSCREEN_NO_FB_COPY\n // glCopyTexImage2D from the live default framebuffer is unreliable on\n // the Android GL4ES path during loading transitions. Keep the normal\n // loading UI but skip only this scene-background capture.\n return;\n#endif\n\n // Copy the current framebuffer onto a texture and display that texture as the background image''',- 'loadingscreen/framebuffer copy',- )- loading.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android-only OpenMW 0.51 loading-screen framebuffer-copy workaround.')-else:- print('OpenMW 0.51 loading-screen framebuffer-copy workaround is already applied.')--# ----------------------------------------------------------------------------# Android menu cursor / absolute-touch compatibility.-#-# CaveBros' SDLSurface deliberately accepts a new touchscreen gesture only while-# SDL reports the mouse cursor as shown. OpenMW normally combines mCursorVisible-# with mCursorActive. Controller-menu navigation sets mCursorActive=false, which-# makes SDL hide the cursor and prevents absolute touch from waking the menu-# cursor again. The established 0.50 Android patch intentionally ignored only-# mCursorActive for this query. Preserve that behavior on Android while leaving-# every desktop platform on the upstream 0.51 semantics.-# ----------------------------------------------------------------------------text = windowmanager.read_text(encoding='utf-8')-cursor_marker = 'OPENMW_ANDROID_051_ABSOLUTE_TOUCH_CURSOR'-if cursor_marker not in text:- text = replace_once(- text,- ''' bool WindowManager::getCursorVisible()- {- return mCursorVisible && mCursorActive;- }''',- ''' bool WindowManager::getCursorVisible()- {-#ifdef ANDROID- // OPENMW_ANDROID_051_ABSOLUTE_TOUCH_CURSOR- // Keep SDL's menu cursor logically visible even while controller-menu- // navigation marks the MyGUI cursor inactive. The Android absolute-touch- // bridge uses SDL_ShowCursor(SDL_QUERY) to decide whether a finger-down- // may start a menu interaction.- return mCursorVisible;-#else- return mCursorVisible && mCursorActive;-#endif- }''',- 'windowmanager/Android absolute-touch cursor visibility',- )- windowmanager.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android-only OpenMW 0.51 absolute-touch menu cursor compatibility.')-else:- print('OpenMW 0.51 absolute-touch menu cursor compatibility is already applied.')--# ----------------------------------------------------------------------------# Patch 7: retire the negative Patch-6 NiFogProperty diagnostic and preserve-# upstream 0.51 NIF fog semantics. The device log showed no FogDiag hits for-# the affected exterior objects, so the diagnostic hypothesis was rejected.-# ----------------------------------------------------------------------------text = nifloader.read_text(encoding='utf-8')-fog_diag_marker = 'OPENMW_ANDROID_051_FOG_DIAG_INHERIT_DISABLED_NIF_FOG'-fog_diag_block = '''#ifdef ANDROID- if (!fogprop->enabled())- {- // OPENMW_ANDROID_051_FOG_DIAG_INHERIT_DISABLED_NIF_FOG- // Diagnostic A/B: do not install OpenMW's local no-fog- // override for an explicitly disabled NiFogProperty.- // With no local attribute installed, the node inherits- // the global world/view-distance fog from the scene root.- Log(Debug::Info)- << "[Android FogDiag] Inheriting global fog instead of disabled NiFogProperty: "- << mFilename;- break;- }-#endif- '''-if fog_diag_marker in text:- text = replace_once(text, fog_diag_block, '', 'nifloader/remove Patch-6 fog diagnostic')- nifloader.write_text(text, encoding='utf-8', newline='\n')- print('Removed rejected Patch-6 NiFogProperty diagnostic; restored upstream 0.51 behavior.')-else:- print('Patch-6 NiFogProperty diagnostic is not present (expected for clean 0.51 source).')--# ----------------------------------------------------------------------------# Patch 7: explicit Android/GL4ES object-fog uniforms.-#-# OpenMW 0.51 removed the exclusive FFP path, so ordinary NIFs now use the-# objects shader. On the GL4ES compatibility path, terrain fog is correct while-# objects can retain stale/incorrect gl_Fog built-ins. StateUpdater already owns-# the authoritative fog color/start/end values. Mirror those values into normal-# GLSL uniforms on Android and let ONLY objects.frag opt into them. Terrain stays-# on upstream gl_Fog as an A/B control.-# ----------------------------------------------------------------------------fog_uniform_marker = 'OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG_UNIFORMS'-text = stateupdater.read_text(encoding='utf-8')-if fog_uniform_marker not in text:- text = replace_once(- text,- ''' stateset->setAttributeAndModes(fog, osg::StateAttribute::ON);- if (mWireframe)''',- ''' stateset->setAttributeAndModes(fog, osg::StateAttribute::ON);-#ifdef ANDROID- // OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG_UNIFORMS- // GL4ES does not reliably propagate compatibility gl_Fog built-ins to- // every OpenMW 0.51 objects-program variant. Expose the same authoritative- // StateUpdater values as ordinary uniforms; only objects.frag consumes them.- stateset->addUniform(new osg::Uniform("omwFogColor", osg::Vec4f{}));- stateset->addUniform(new osg::Uniform("omwFogStart", 0.f));- stateset->addUniform(new osg::Uniform("omwFogEnd", 0.f));-#endif- if (mWireframe)''',- 'stateupdater/explicit Android object-fog uniform defaults',- )- text = replace_once(- text,- ''' fog->setColor(mFogColor);- fog->setStart(mFogStart);- fog->setEnd(mFogEnd);- }''',- ''' fog->setColor(mFogColor);- fog->setStart(mFogStart);- fog->setEnd(mFogEnd);-#ifdef ANDROID- stateset->getUniform("omwFogColor")->set(mFogColor);- stateset->getUniform("omwFogStart")->set(mFogStart);- stateset->getUniform("omwFogEnd")->set(mFogEnd);-#endif- }''',- 'stateupdater/explicit Android object-fog uniform updates',- )- stateupdater.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android/GL4ES explicit object-fog uniforms to StateUpdater.')-else:- print('Android/GL4ES explicit object-fog uniforms are already applied.')--object_fog_marker = 'OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG'-text = fog_glsl.read_text(encoding='utf-8')-if object_fog_marker not in text:- # Rewrite only the upstream fog-function body first, then prepend fallback- # macros. This deliberately leaves the fallback gl_Fog references intact.- text = text.replace('gl_Fog.start/2.0', 'OPENMW_FOG_START/2.0')- text = text.replace('gl_Fog.end - OPENMW_FOG_START/2.0', 'OPENMW_FOG_END - OPENMW_FOG_START/2.0')- text = text.replace('gl_Fog.start', 'OPENMW_FOG_START')- text = text.replace('gl_Fog.scale', 'OPENMW_FOG_SCALE')- text = text.replace('gl_Fog.color', 'OPENMW_FOG_COLOR')- text = '''// OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG-#ifdef OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG-uniform vec4 omwFogColor;-uniform float omwFogStart;-uniform float omwFogEnd;-#define OPENMW_FOG_START omwFogStart-#define OPENMW_FOG_END omwFogEnd-#define OPENMW_FOG_SCALE (1.0 / max(omwFogEnd - omwFogStart, 0.0001))-#define OPENMW_FOG_COLOR omwFogColor-#else-#define OPENMW_FOG_START gl_Fog.start-#define OPENMW_FOG_END gl_Fog.end-#define OPENMW_FOG_SCALE gl_Fog.scale-#define OPENMW_FOG_COLOR gl_Fog.color-#endif--''' + text- fog_glsl.write_text(text, encoding='utf-8', newline='\n')- print('Added explicit-fog compatibility path to fog.glsl; upstream path remains fallback.')-else:- print('Explicit-fog compatibility path is already present in fog.glsl.')--text = objects_frag.read_text(encoding='utf-8')-objects_fog_define = '#define OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG\n#include "fog.glsl"'-if objects_fog_define not in text:- text = replace_once(- text,- '#include "fog.glsl"',- '''// Android/GL4ES Patch 7: use authoritative OpenMW fog uniforms instead of-// compatibility gl_Fog built-ins for ordinary NIF/object shaders only.-#define OPENMW_ANDROID_051_GL4ES_EXPLICIT_OBJECT_FOG-#include "fog.glsl"''',- 'objects.frag/enable explicit Android object fog',- )- objects_frag.write_text(text, encoding='utf-8', newline='\n')- print('Enabled explicit Android/GL4ES fog path for objects.frag only.')-else:- print('objects.frag already enables explicit Android/GL4ES fog.')--# ----------------------------------------------------------------------------# Minimal GL4ES syntax compatibility only. Do NOT port the large 0.50 GL4ES-# shader rewrite here: 0.51 changed its shader architecture. These four default-# uniform initializers are independently known to be problematic on GLES/GL4ES.-# ----------------------------------------------------------------------------shader_replacements = {- root / 'files' / 'shaders' / 'compatibility' / 'fullscreen_tri.vert': [- ('uniform vec2 scaling = vec2(1.0, 1.0);', 'uniform vec2 scaling;'),- ],- root / 'files' / 'shaders' / 'compatibility' / 'shadowcasting.vert': [- ('uniform bool useDiffuseMapForShadowAlpha = true;', 'uniform bool useDiffuseMapForShadowAlpha;'),- ('uniform bool alphaTestShadows = true;', 'uniform bool alphaTestShadows;'),- ],- root / 'files' / 'shaders' / 'compatibility' / 'debug.vert': [- ('uniform bool useAdvancedShader = false;', 'uniform bool useAdvancedShader;'),- ],- root / 'files' / 'shaders' / 'compatibility' / 'debug.frag': [- ('uniform bool useAdvancedShader = false;', 'uniform bool useAdvancedShader;'),- ],-}--for path, replacements in shader_replacements.items():- if not path.is_file():- raise SystemExit(f'missing expected OpenMW 0.51 shader: {path}')- text = path.read_text(encoding='utf-8')- changed = False- for old, new in replacements:- if old in text:- text = text.replace(old, new)- changed = True- elif new not in text:- raise SystemExit(f'unexpected OpenMW 0.51 shader content in {path}: missing {old!r}')- if changed:- path.write_text(text, encoding='utf-8', newline='\n')- print(f'Removed GL4ES-hostile uniform initializer(s): {path.relative_to(root)}')--# ----------------------------------------------------------------------------# Patch 8: proven OpenMW-0.50 Android/GL4ES normal-transform compatibility.-#-# The 0.51 compatibility shaders still directly evaluate gl_NormalMatrix in-# stages where GL4ES/Adreno has historically produced unreliable results. Each-# affected shader already carries OpenMW's normalToViewMatrix varying. Reuse-# that path exactly as the stable 0.50 Android patch did. These substitutions-# are mathematically equivalent on desktop GL and intentionally do not change-# fog, texture sampling, material equations, object paging, or post processing.-# ----------------------------------------------------------------------------normal_transform_replacements = {- root / 'files' / 'shaders' / 'compatibility' / 'objects.vert': [- ('vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);',- 'vec3 viewNormal = normalToView(passNormal);'),- ],- root / 'files' / 'shaders' / 'compatibility' / 'objects.frag': [- ('vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);',- 'vec3 viewNormal = normalToView(normalize(passNormal));'),- ],- root / 'files' / 'shaders' / 'compatibility' / 'terrain.vert': [- ('vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);',- 'vec3 viewNormal = normalToView(passNormal);'),- ],- root / 'files' / 'shaders' / 'compatibility' / 'terrain.frag': [- ('vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);',- 'vec3 viewNormal = normalToView(normalize(passNormal));'),- ],- root / 'files' / 'shaders' / 'compatibility' / 'groundcover.vert': [- ('vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);',- 'vec3 viewNormal = normalToView(passNormal);'),- ],- root / 'files' / 'shaders' / 'compatibility' / 'bs' / 'default.vert': [- ('vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);',- 'vec3 viewNormal = normalToView(passNormal);'),- ],- root / 'files' / 'shaders' / 'compatibility' / 'bs' / 'default.frag': [- ('vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);',- 'vec3 viewNormal = normalToView(normalize(passNormal));'),- ],- root / 'files' / 'shaders' / 'compatibility' / 'bs' / 'nolighting.vert': [- ('vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);',- 'vec3 viewNormal = normalize((gl_NormalMatrix * gl_Normal).xyz);'),- ],-}--for path, replacements in normal_transform_replacements.items():- if not path.is_file():- raise SystemExit(f'missing expected OpenMW 0.51 normal-transform shader: {path}')- text = path.read_text(encoding='utf-8')- changed = False- for old, new in replacements:- if old in text:- if text.count(old) != 1:- raise SystemExit(f'unexpected duplicate normal-transform anchor in {path}: {old!r}')- text = text.replace(old, new, 1)- changed = True- elif new not in text:- raise SystemExit(f'unexpected OpenMW 0.51 normal-transform shader content in {path}: missing {old!r}')- if changed:- path.write_text(text, encoding='utf-8', newline='\n')- print(f'Applied Android/GL4ES normal-transform compatibility: {path.relative_to(root)}')--# ----------------------------------------------------------------------------# Patch 11: proven Android/GL4ES additive-fog compatibility.-#-# On the GLES2 wrapper, defining ADDITIVE_BLENDING for ordinary object shaders-# makes the fog helper multiply RGB toward black instead of blending toward the-# scene fog colour. The stable 0.50 Android shader patch deliberately omitted-# this define, and the 0.51 device A/B test confirmed it fixes black distant-# trees/rocks at every viewing distance. Preserve the proven behaviour here.-# ----------------------------------------------------------------------------additive_fog_marker = 'OPENMW_ANDROID_051_GL4ES_DISABLE_ADDITIVE_FOG'-text = objects_frag.read_text(encoding='utf-8')-if additive_fog_marker not in text:- text = replace_once(- text,- '''#if @additiveBlending-#define ADDITIVE_BLENDING-#endif''',- '''// OPENMW_ANDROID_051_GL4ES_DISABLE_ADDITIVE_FOG-// Android/GL4ES compatibility: do not select compatibility/fog.glsl's-// additive branch for ordinary objects; it fades object RGB toward black.-// This matches the proven OpenMW 0.50 Android GL4ES behaviour.''',- 'objects.frag/disable additive fog branch on Android compatibility path',- )- objects_frag.write_text(text, encoding='utf-8', newline='\n')- print('Applied proven Patch-11 Android/GL4ES additive-fog compatibility.')-elif '#define ADDITIVE_BLENDING' in text:- raise SystemExit('Patch-11 additive-fog marker exists but ADDITIVE_BLENDING is still defined')-else:- print('Patch-11 Android/GL4ES additive-fog compatibility is already applied.')--# ----------------------------------------------------------------------------# Patch 12 / Gate F: Android GLES2 shadow compatibility.-#-# GL4ES exposes OES_depth_texture on the GLES2 backend but not the desktop-# shadow-sampler path OpenMW 0.51 expects. The proven 0.50 Android solution uses-# raw sampler2D depth textures plus an explicit LEQUAL comparison. Android also-# lacks GL_DEPTH_CLAMP / ARB_clip_control. Android deliberately uses normal-# GLES2 clip-volume clipping for shadow casters; desktop retains depth clamp.-# ----------------------------------------------------------------------------shadow_compare_marker = 'OPENMW_ANDROID_051_GLES2_MANUAL_SHADOW_COMPARE'-shadow_pcf_marker = 'OPENMW_ANDROID_051_GLES2_QUALITY_PCF'-native_clip_marker = 'OPENMW_ANDROID_051_GLES2_NATIVE_SHADOW_CLIPPING'--shadow_pcf_header = '''#define SHADOWS @shadows_enabled--// OPENMW_ANDROID_051_GLES2_MANUAL_SHADOW_COMPARE-// GLES2/GL4ES: sample OES depth textures through sampler2D and perform-// the LEQUAL test explicitly; EXT_shadow_samplers is not available.-//-// OPENMW_ANDROID_051_GLES2_QUALITY_PCF-// The launcher specializes these two compile-time constants before each game-// start. Keeping the kernel compile-time avoids dynamic loops/branches on GLES2.-// Level 0 = legacy 1 tap, level 1 = 2x2 / 4 taps (Low),-// level 2 = 3x3 / 9 taps (Medium), level 3 = 4x4 / 16 taps (High).-#define OPENMW_ANDROID_SHADOW_PCF_LEVEL 2-#define OPENMW_ANDROID_SHADOW_MAP_RESOLUTION 4096.0-'''--shadow_pcf_compare = '''// OPENMW_ANDROID_051_GLES2_SHADOW_COORD_BOUNDS- // Raw GLES2 depth sampling must never compare receivers outside- // the valid projected shadow depth volume. Otherwise z > 1 can- // become a view-dependent full-shadow patch with CLAMP_TO_EDGE.- if (shadowSpaceCoords@shadow_texture_unit_index.w > 0.0 && shadowXYZ.z > 0.0 && shadowXYZ.z < 1.0)- {- vec2 shadowTexel = vec2(1.0 / OPENMW_ANDROID_SHADOW_MAP_RESOLUTION);- // OPENMW_ANDROID_051_GLES2_RECEIVER_DEPTH_BIAS- // Tiny manual receiver bias for the raw GLES2 depth compare.- // Normal offset removes the coarse terrain acne; this small- // residual bias moves only the comparison threshold enough- // to suppress the remaining fine hatch without visibly- // detaching shadows from their casters.- float receiverDepth = max(shadowXYZ.z - 0.00005, 0.0);-#if OPENMW_ANDROID_SHADOW_PCF_LEVEL == 0- // Legacy fallback: preserve the original single-tap GLES2 comparison.- shadowing = min(step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowXYZ.xy).r), shadowing);-#elif OPENMW_ANDROID_SHADOW_PCF_LEVEL == 1- // Low: 2x2 PCF. Four neighbouring depth comparisons- // provide the previous Medium profile at modest mobile GPU cost.- vec2 shadowUv = clamp(shadowXYZ.xy, shadowTexel, vec2(1.0) - shadowTexel);- float pcfShadow = 0.0;- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, -0.5)).r);- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, -0.5)).r);- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, 0.5)).r);- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, 0.5)).r);- shadowing = min(pcfShadow * 0.25, shadowing);-#elif OPENMW_ANDROID_SHADOW_PCF_LEVEL == 2- // Medium: full 3x3 PCF. Nine independent nearest-depth- // comparisons retain the previous High profile quality- // without re-enabling unstable multi-map cascades.- vec2 shadowUv = clamp(shadowXYZ.xy, shadowTexel, vec2(1.0) - shadowTexel);- float pcfShadow = 0.0;- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, -1.0)).r);- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.0, -1.0)).r);- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.0, -1.0)).r);- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, 0.0)).r);- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv).r);- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.0, 0.0)).r);- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, 1.0)).r);- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.0, 1.0)).r);- pcfShadow += step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.0, 1.0)).r);- shadowing = min(pcfShadow * (1.0 / 9.0), shadowing);-#else- // High: weighted 4x4 tent PCF at 4096. A regular box filter- // can reveal its sampling grid on gently sloped terrain.- // The separable 1-3-3-1 weights keep all 16 depth samples,- // favour the centre, and suppress visible hatch/banding.- // OPENMW_ANDROID_051_GLES2_TENT_PCF- vec2 shadowMargin = shadowTexel * 2.0;- vec2 shadowUv = clamp(shadowXYZ.xy, shadowMargin, vec2(1.0) - shadowMargin);- float pcfShadow = 0.0;- pcfShadow += 1.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.5, -1.5)).r);- pcfShadow += 3.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, -1.5)).r);- pcfShadow += 3.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, -1.5)).r);- pcfShadow += 1.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.5, -1.5)).r);- pcfShadow += 3.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.5, -0.5)).r);- pcfShadow += 9.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, -0.5)).r);- pcfShadow += 9.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, -0.5)).r);- pcfShadow += 3.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.5, -0.5)).r);- pcfShadow += 3.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.5, 0.5)).r);- pcfShadow += 9.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, 0.5)).r);- pcfShadow += 9.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, 0.5)).r);- pcfShadow += 3.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.5, 0.5)).r);- pcfShadow += 1.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.5, 1.5)).r);- pcfShadow += 3.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, 1.5)).r);- pcfShadow += 3.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, 1.5)).r);- pcfShadow += 1.0 * step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.5, 1.5)).r);- shadowing = min(pcfShadow * (1.0 / 64.0), shadowing);-#endif- }'''--text = shadow_fragment.read_text(encoding='utf-8')-shadow_text_changed = False-if shadow_compare_marker not in text:- text = replace_once(- text,- '#define SHADOWS @shadows_enabled\n',- shadow_pcf_header,- 'shadows_fragment/manual compare + quality PCF header',- )- text = replace_once(- text,- 'uniform sampler2DShadow shadowTexture@shadow_texture_unit_index;',- 'uniform sampler2D shadowTexture@shadow_texture_unit_index;',- 'shadows_fragment/sampler2DShadow',- )- text = replace_once(- text,- 'shadowing = min(shadow2DProj(shadowTexture@shadow_texture_unit_index, shadowSpaceCoords@shadow_texture_unit_index).r, shadowing);',- shadow_pcf_compare,- 'shadows_fragment/manual LEQUAL + quality PCF',- )- shadow_text_changed = True-elif shadow_pcf_marker not in text:- # Upgrade an already-patched Patch-12 receiver without disturbing the- # later orthographic/stability work in the same source tree.- old_header = '''#define SHADOWS @shadows_enabled--// OPENMW_ANDROID_051_GLES2_MANUAL_SHADOW_COMPARE-// GLES2/GL4ES: sample OES depth textures through sampler2D and perform-// the LEQUAL test explicitly; EXT_shadow_samplers is not available.-'''- old_compare = '''// OPENMW_ANDROID_051_GLES2_SHADOW_COORD_BOUNDS- // Raw GLES2 depth sampling must never compare receivers outside- // the valid projected shadow depth volume. Otherwise z > 1 can- // become a view-dependent full-shadow patch with CLAMP_TO_EDGE.- if (shadowSpaceCoords@shadow_texture_unit_index.w > 0.0 && shadowXYZ.z > 0.0 && shadowXYZ.z < 1.0)- shadowing = min(step(receiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowXYZ.xy).r), shadowing);'''- text = replace_once(- text,- old_header,- shadow_pcf_header,- 'shadows_fragment/upgrade quality PCF header',- )- text = replace_once(- text,- old_compare,- shadow_pcf_compare,- 'shadows_fragment/upgrade quality PCF compare',- )- shadow_text_changed = True--if shadow_text_changed:- shadow_fragment.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android GLES2 manual shadow comparison with quality-dependent PCF.')-elif shadow_pcf_marker in text:- print('Android GLES2 quality-dependent PCF shadow receiver is already applied.')--text = shadow_casting.read_text(encoding='utf-8')-if native_clip_marker not in text:- text = replace_once(- text,- ' gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n',- ''' gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;-- // OPENMW_ANDROID_051_GLES2_NATIVE_SHADOW_CLIPPING- // GL_DEPTH_CLAMP/ARB_clip_control are unavailable through the GLES2 backend.- // Deliberately use normal GLES2 near/far clipping here. Per-vertex Z- // clamping can collapse off-volume caster vertices onto a clip plane and- // produce large view-dependent triangular shadow projections.-''',- 'shadowcasting.vert/native GLES2 clipping marker',- )- shadow_casting.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android GLES2 native shadow-caster clipping marker.')--text = mwshadowtechnique.read_text(encoding='utf-8')-if shadow_compare_marker not in text:- # Internal OSG fallback shaders must compile on the same GLES2 path.- text = text.replace('sampler2DShadow', 'sampler2D')- text = text.replace(- 'shadow2DProj( shadowTexture, gl_TexCoord[1] ).r',- 'step(gl_TexCoord[1].z / gl_TexCoord[1].w, texture2D(shadowTexture, gl_TexCoord[1].xy / gl_TexCoord[1].w).r)',- )- text = text.replace(- 'shadow2DProj( shadowTexture0, gl_TexCoord[shadowTextureUnit0] ).r',- 'step(gl_TexCoord[shadowTextureUnit0].z / gl_TexCoord[shadowTextureUnit0].w, texture2D(shadowTexture0, gl_TexCoord[shadowTextureUnit0].xy / gl_TexCoord[shadowTextureUnit0].w).r)',- )- text = text.replace(- 'shadow2DProj( shadowTexture1, gl_TexCoord[shadowTextureUnit1] ).r',- 'step(gl_TexCoord[shadowTextureUnit1].z / gl_TexCoord[shadowTextureUnit1].w, texture2D(shadowTexture1, gl_TexCoord[shadowTextureUnit1].xy / gl_TexCoord[shadowTextureUnit1].w).r)',- )-- text = replace_once(- text,- ''' _texture->setInternalFormat(GL_DEPTH_COMPONENT);- _texture->setShadowComparison(true);- _texture->setShadowTextureMode(osg::Texture2D::LUMINANCE);- }-- _texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);- _texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);''',- ''' _texture->setInternalFormat(GL_DEPTH_COMPONENT);-#ifdef ANDROID- // OPENMW_ANDROID_051_GLES2_MANUAL_SHADOW_COMPARE- // Keep the depth texture in raw-sampling mode; receiver shaders perform- // the LEQUAL comparison explicitly. NEAREST avoids interpolating depth.- _texture->setShadowComparison(false);-#else- _texture->setShadowComparison(true);- _texture->setShadowTextureMode(osg::Texture2D::LUMINANCE);-#endif- }--#ifdef ANDROID- _texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST);- _texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST);-#else- _texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);- _texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);-#endif''',- 'mwshadowtechnique/raw depth texture sampling',- )-- text = replace_once(- text,- ''' _fallbackShadowMapTexture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST);- _fallbackShadowMapTexture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST);- _fallbackShadowMapTexture->setShadowComparison(true);- _fallbackShadowMapTexture->setShadowCompareFunc(osg::Texture::ShadowCompareFunc::ALWAYS);''',- ''' _fallbackShadowMapTexture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::NEAREST);- _fallbackShadowMapTexture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST);-#ifdef ANDROID- _fallbackShadowMapTexture->setShadowComparison(false);-#else- _fallbackShadowMapTexture->setShadowComparison(true);- _fallbackShadowMapTexture->setShadowCompareFunc(osg::Texture::ShadowCompareFunc::ALWAYS);-#endif''',- 'mwshadowtechnique/fallback shadow texture raw sampling',- )- mwshadowtechnique.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android GLES2 raw shadow texture mode to MWShadowTechnique.')--# Depth clamp is a separate compatibility requirement and must be applied even-# if a source tree already carries the manual-compare marker.-text = mwshadowtechnique.read_text(encoding='utf-8')-if native_clip_marker not in text:- text = replace_once(- text,- ''' osg::ref_ptr<osg::Depth> depth = new osg::Depth;- depth->setWriteMask(true);- osg::ref_ptr<osg::ClipControl> clipcontrol = new osg::ClipControl(osg::ClipControl::LOWER_LEFT, osg::ClipControl::NEGATIVE_ONE_TO_ONE);- _shadowCastingStateSet->setAttribute(clipcontrol, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);- _shadowCastingStateSet->setAttribute(depth, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);- _shadowCastingStateSet->setMode(GL_DEPTH_CLAMP, osg::StateAttribute::ON);''',- ''' osg::ref_ptr<osg::Depth> depth = new osg::Depth;- depth->setWriteMask(true);-#ifndef ANDROID- osg::ref_ptr<osg::ClipControl> clipcontrol = new osg::ClipControl(osg::ClipControl::LOWER_LEFT, osg::ClipControl::NEGATIVE_ONE_TO_ONE);- _shadowCastingStateSet->setAttribute(clipcontrol, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);-#endif- _shadowCastingStateSet->setAttribute(depth, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);-#ifndef ANDROID- _shadowCastingStateSet->setMode(GL_DEPTH_CLAMP, osg::StateAttribute::ON);-#else- // OPENMW_ANDROID_051_GLES2_NATIVE_SHADOW_CLIPPING- // Android/GL4ES intentionally uses normal GLES2 clip-volume clipping;- // do not emulate GL_DEPTH_CLAMP by clamping caster vertices in the shader.-#endif''',- 'mwshadowtechnique/desktop-only clip-control depth-clamp state',- )- mwshadowtechnique.write_text(text, encoding='utf-8', newline='\n')- print('Disabled desktop-only shadow clip-control/depth-clamp state on Android.')--text = shadow_manager.read_text(encoding='utf-8')-if shadow_compare_marker not in text:- text = replace_once(- text,- ''' osg::ref_ptr<osg::Image> fakeShadowMapImage = new osg::Image();- fakeShadowMapImage->allocateImage(1, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT);- *(float*)fakeShadowMapImage->data() = std::numeric_limits<float>::infinity();- osg::ref_ptr<osg::Texture> fakeShadowMapTexture = new osg::Texture2D(fakeShadowMapImage);''',- ''' osg::ref_ptr<osg::Image> fakeShadowMapImage = new osg::Image();-#ifdef ANDROID- // OPENMW_ANDROID_051_GLES2_MANUAL_SHADOW_COMPARE- // Raw sampler2D receivers need a white texel for an always-unshadowed- // fallback and must not rely on desktop depth-compare texture state.- fakeShadowMapImage->allocateImage(1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE);- fakeShadowMapImage->data()[0] = 0xFF;- fakeShadowMapImage->data()[1] = 0xFF;- fakeShadowMapImage->data()[2] = 0xFF;- fakeShadowMapImage->data()[3] = 0xFF;-#else- fakeShadowMapImage->allocateImage(1, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT);- *(float*)fakeShadowMapImage->data() = std::numeric_limits<float>::infinity();-#endif- osg::ref_ptr<osg::Texture> fakeShadowMapTexture = new osg::Texture2D(fakeShadowMapImage);''',- 'shadow.cpp/GLES2-safe fake shadow image',- )- text = replace_once(- text,- ''' fakeShadowMapTexture->setShadowComparison(true);- fakeShadowMapTexture->setShadowCompareFunc(osg::Texture::ShadowCompareFunc::ALWAYS);''',- '''#ifdef ANDROID- fakeShadowMapTexture->setShadowComparison(false);-#else- fakeShadowMapTexture->setShadowComparison(true);- fakeShadowMapTexture->setShadowCompareFunc(osg::Texture::ShadowCompareFunc::ALWAYS);-#endif''',- 'shadow.cpp/fake shadow texture comparison mode',- )- shadow_manager.write_text(text, encoding='utf-8', newline='\n')- print('Applied GLES2-safe white fallback shadow texture.')--# ----------------------------------------------------------------------------# Patch 12c: Android orthographic shadow projection.-# OpenMW 0.51 defaults to the camera/light-angle-dependent LiSPSM perspective-# path. On GL4ES/GLES2 keep the already proven one-map configuration but avoid-# that projection path; this also makes perspectiveShadowMaps=0 naturally.-# ----------------------------------------------------------------------------projection_marker = 'OPENMW_ANDROID_051_ORTHOGRAPHIC_SHADOW_MAP'-text = shadow_manager.read_text(encoding='utf-8')-if projection_marker not in text:- text = replace_once(- text,- ' mShadowSettings->setMultipleShadowMapHint(osgShadow::ShadowSettings::CASCADED);\n',- ''' mShadowSettings->setMultipleShadowMapHint(osgShadow::ShadowSettings::CASCADED);-#ifdef ANDROID- // OPENMW_ANDROID_051_ORTHOGRAPHIC_SHADOW_MAP- // GL4ES/GLES2 stability: avoid the view/light-angle-dependent LiSPSM- // perspective projection. Preserve the existing single map, distance,- // resolution and fade settings; only the shadow projection changes.- mShadowSettings->setShadowMapProjectionHint(osgShadow::ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP);-#endif-''',- 'shadow.cpp/Android orthographic shadow projection',- )- shadow_manager.write_text(text, encoding='utf-8', newline='\n')- print('Forced orthographic shadow projection on Android/GL4ES.')-else:- print('Android orthographic shadow projection is already applied.')--# ----------------------------------------------------------------------------# Patch 12e: stable camera-independent basis for Android orthographic sun maps.-# ----------------------------------------------------------------------------stable_ortho_basis_marker = 'OPENMW_ANDROID_051_STABLE_ORTHO_SHADOW_BASIS'-text = mwshadowtechnique.read_text(encoding='utf-8')-if stable_ortho_basis_marker not in text:- text = replace_once(- text,- ''' double dotProduct_v = positionedLight.lightDir * frustum.frustumCenterLine;- double gamma_v = acos(dotProduct_v);- if (gamma_v<osg::DegreesToRadians(settings->getPerspectiveShadowMapCutOffAngle()) || gamma_v>osg::DegreesToRadians(180.0-settings->getPerspectiveShadowMapCutOffAngle()))- {- OSG_INFO<<"View direction and Light direction below tolerance"<<std::endl;- osg::Vec3d viewSide = osg::Matrixd::transform3x3(frustum.modelViewMatrix, osg::Vec3d(1.0,0.0,0.0));- lightSide = positionedLight.lightDir ^ (viewSide ^ positionedLight.lightDir);- lightSide.normalize();- }- else- {- lightSide = positionedLight.lightDir ^ frustum.frustumCenterLine;- lightSide.normalize();- }-- osg::Vec3d lightUp = lightSide ^ positionedLight.lightDir;-''',- '''#ifdef ANDROID- if (settings->getShadowMapProjectionHint() == ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP- && positionedLight.directionalLight)- {- // OPENMW_ANDROID_051_STABLE_ORTHO_SHADOW_BASIS- // Keep the sun direction unchanged, but orient the orthographic shadow- // camera from a stable world axis instead of the main camera view.- // This avoids the lightDir x viewDir singularity/fallback flip when the- // player looks close to the sunlight direction.- const osg::Vec3d stableAxis = fabs(positionedLight.lightDir.z()) < 0.95- ? osg::Vec3d(0.0, 0.0, 1.0)- : osg::Vec3d(0.0, 1.0, 0.0);- lightSide = positionedLight.lightDir ^ stableAxis;- if (lightSide.length2() < 1e-12)- lightSide.set(1.0, 0.0, 0.0);- else- lightSide.normalize();- }- else-#endif- {- double dotProduct_v = positionedLight.lightDir * frustum.frustumCenterLine;- double gamma_v = acos(dotProduct_v);- if (gamma_v<osg::DegreesToRadians(settings->getPerspectiveShadowMapCutOffAngle()) || gamma_v>osg::DegreesToRadians(180.0-settings->getPerspectiveShadowMapCutOffAngle()))- {- OSG_INFO<<"View direction and Light direction below tolerance"<<std::endl;- osg::Vec3d viewSide = osg::Matrixd::transform3x3(frustum.modelViewMatrix, osg::Vec3d(1.0,0.0,0.0));- lightSide = positionedLight.lightDir ^ (viewSide ^ positionedLight.lightDir);- lightSide.normalize();- }- else- {- lightSide = positionedLight.lightDir ^ frustum.frustumCenterLine;- lightSide.normalize();- }- }-- osg::Vec3d lightUp = lightSide ^ positionedLight.lightDir;- lightUp.normalize();-''',- 'mwshadowtechnique.cpp/stable Android orthographic shadow basis',- )- mwshadowtechnique.write_text(text, encoding='utf-8', newline='\n')- print('Applied stable Android orthographic shadow-camera basis.')-else:- print('Stable Android orthographic shadow-camera basis is already applied.')--# ----------------------------------------------------------------------------# Patch 12g: keep Android orthographic directional shadow projection out of-# the final main-camera-frustum crop stage. Earlier caster-extents tightening-# remains enabled intentionally.-# ----------------------------------------------------------------------------no_main_frustum_crop_marker = 'OPENMW_ANDROID_051_ORTHO_NO_MAIN_FRUSTUM_CROP'-text = mwshadowtechnique.read_text(encoding='utf-8')-if no_main_frustum_crop_marker not in text:- text = replace_once(- text,- ''' if (settings->getMultipleShadowMapHint() == ShadowSettings::CASCADED)- {- cropShadowCameraToMainFrustum(frustum, camera, cascaseNear, cascadeFar, extraPlanes);- for (const auto& plane : extraPlanes)- local_polytope.getPlaneList().push_back(plane);- local_polytope.setupMask();- }- else- cropShadowCameraToMainFrustum(frustum, camera, reducedNear, reducedFar, extraPlanes);-''',- ''' if (settings->getMultipleShadowMapHint() == ShadowSettings::CASCADED)- {- cropShadowCameraToMainFrustum(frustum, camera, cascaseNear, cascadeFar, extraPlanes);- for (const auto& plane : extraPlanes)- local_polytope.getPlaneList().push_back(plane);- local_polytope.setupMask();- }- else- {-#ifdef ANDROID- if (settings->getShadowMapProjectionHint() == ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP- && pl.directionalLight)- {- // OPENMW_ANDROID_051_ORTHO_NO_MAIN_FRUSTUM_CROP- // Diagnostic A/B: keep the already-computed orthographic- // light-space projection intact instead of re-cropping it- // to the current main-camera frustum. This removes one- // remaining view-dependent shadow-camera transform while- // leaving ComputeLightSpaceBounds tightening untouched.- }- else-#endif- cropShadowCameraToMainFrustum(frustum, camera, reducedNear, reducedFar, extraPlanes);- }-''',- 'mwshadowtechnique.cpp/Android orthographic no-main-frustum-crop',- )- mwshadowtechnique.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android orthographic no-main-frustum-crop A/B.')-else:- print('Android orthographic no-main-frustum-crop A/B is already applied.')--# ----------------------------------------------------------------------------# Patch 12h: disable caster-extents projection tightening for Android-# orthographic directional shadows. Patch 12g remains separate and active.-# ----------------------------------------------------------------------------no_caster_bounds_tightening_marker = 'OPENMW_ANDROID_051_ORTHO_NO_CASTER_BOUNDS_TIGHTENING'-text = mwshadowtechnique.read_text(encoding='utf-8')-if no_caster_bounds_tightening_marker not in text:- text = replace_once(- text,- ''' if (/*numShadowMapsPerLight>1 &&*/ (_shadowedScene->getCastsShadowTraversalMask() & _worldMask) == 0)-''',- ''' bool tightenProjectionToCasterBounds- = (_shadowedScene->getCastsShadowTraversalMask() & _worldMask) == 0;-#ifdef ANDROID- if (settings->getShadowMapProjectionHint() == ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP- && pl.directionalLight)- {- // OPENMW_ANDROID_051_ORTHO_NO_CASTER_BOUNDS_TIGHTENING- // Diagnostic A/B: do not rescale the orthographic shadow- // projection to currently visible caster extents.- tightenProjectionToCasterBounds = false;- }-#endif- if (tightenProjectionToCasterBounds)-''',- 'mwshadowtechnique.cpp/Android orthographic no-caster-bounds-tightening',- )- mwshadowtechnique.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android orthographic no-caster-bounds-tightening A/B.')-else:- print('Android orthographic no-caster-bounds-tightening A/B is already applied.')--# ----------------------------------------------------------------------------# Patch 12i: fixed eye-anchored orthographic shadow volume for Android.-# ----------------------------------------------------------------------------fixed_eye_volume_marker = 'OPENMW_ANDROID_051_ORTHO_FIXED_EYE_VOLUME'-text = mwshadowtechnique.read_text(encoding='utf-8')-if fixed_eye_volume_marker not in text:- text = replace_once(- text,- ''' if (positionedLight.directionalLight)- {- double xMin=0.0, xMax=0.0;-''',- ''' if (positionedLight.directionalLight)- {-#ifdef ANDROID- if (settings->getShadowMapProjectionHint() == ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP)- {- // OPENMW_ANDROID_051_ORTHO_FIXED_EYE_VOLUME- // Diagnostic A/B: the Android shadow-camera volume follows only- // the camera position and sunlight direction, never the current- // look direction/FOV/frustum corners. This intentionally trades- // texel efficiency for a rotation-invariant shadow projection.- const double halfExtent = osg::maximum<double>(512.0, settings->getMaximumShadowMapDistance());- const double depthExtent = halfExtent * 2.0;- const osg::Vec3d anchor = frustum.eye;-- projectionMatrix.makeOrtho(- -halfExtent, halfExtent,- -halfExtent, halfExtent,- 0.0, depthExtent * 2.0);- viewMatrix.makeLookAt(- anchor - positionedLight.lightDir * depthExtent,- anchor + positionedLight.lightDir * depthExtent,- lightUp);- return true;- }-#endif- double xMin=0.0, xMax=0.0;-''',- 'mwshadowtechnique.cpp/fixed eye-anchored orthographic shadow volume',- )- mwshadowtechnique.write_text(text, encoding='utf-8', newline='\n')- print('Applied fixed eye-anchored Android orthographic shadow volume A/B.')-else:- print('Fixed eye-anchored Android orthographic shadow volume A/B is already applied.')--# ----------------------------------------------------------------------------# Patch 12j: correct Patch 12g for the actually active CASCADED one-map path.-# setupShadowSettings() sets CASCADED unconditionally, so bypass the final-# main-frustum crop for Android orthographic directional shadows regardless of-# the multiple-shadow-map hint.-# ----------------------------------------------------------------------------all_path_crop_bypass_marker = 'OPENMW_ANDROID_051_ORTHO_NO_MAIN_FRUSTUM_CROP_ALL_PATHS'-text = mwshadowtechnique.read_text(encoding='utf-8')-if all_path_crop_bypass_marker not in text:- text = replace_once(- text,- ''' if (settings->getMultipleShadowMapHint() == ShadowSettings::CASCADED)- {- cropShadowCameraToMainFrustum(frustum, camera, cascaseNear, cascadeFar, extraPlanes);- for (const auto& plane : extraPlanes)- local_polytope.getPlaneList().push_back(plane);- local_polytope.setupMask();- }- else- {-#ifdef ANDROID- if (settings->getShadowMapProjectionHint() == ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP- && pl.directionalLight)- {- // OPENMW_ANDROID_051_ORTHO_NO_MAIN_FRUSTUM_CROP- // Diagnostic A/B: keep the already-computed orthographic- // light-space projection intact instead of re-cropping it- // to the current main-camera frustum. This removes one- // remaining view-dependent shadow-camera transform while- // leaving ComputeLightSpaceBounds tightening untouched.- }- else-#endif- cropShadowCameraToMainFrustum(frustum, camera, reducedNear, reducedFar, extraPlanes);- }-''',- ''' bool bypassMainFrustumCrop = false;-#ifdef ANDROID- if (settings->getShadowMapProjectionHint() == ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP- && pl.directionalLight)- {- // OPENMW_ANDROID_051_ORTHO_NO_MAIN_FRUSTUM_CROP- // OPENMW_ANDROID_051_ORTHO_NO_MAIN_FRUSTUM_CROP_ALL_PATHS- // Patch 12j correction: setupShadowSettings() uses CASCADED- // even with exactly one shadow map, so the previous Patch 12g- // else-only bypass never affected our active path.- bypassMainFrustumCrop = true;- }-#endif- if (!bypassMainFrustumCrop)- {- if (settings->getMultipleShadowMapHint() == ShadowSettings::CASCADED)- {- cropShadowCameraToMainFrustum(frustum, camera, cascaseNear, cascadeFar, extraPlanes);- for (const auto& plane : extraPlanes)- local_polytope.getPlaneList().push_back(plane);- local_polytope.setupMask();- }- else- cropShadowCameraToMainFrustum(frustum, camera, reducedNear, reducedFar, extraPlanes);- }-''',- 'mwshadowtechnique.cpp/Android all-path no-main-frustum-crop correction',- )- mwshadowtechnique.write_text(text, encoding='utf-8', newline='\n')- print('Corrected Android orthographic main-frustum crop bypass for CASCADED one-map path.')-else:- print('Android all-path main-frustum crop bypass correction is already applied.')---# ----------------------------------------------------------------------------# Patch 26 / Gate H2g: Android CPU scene-ray sun occlusion for OMWFX.-# ----------------------------------------------------------------------------cpu_sun_occ_marker = 'OPENMW_ANDROID_051_CPU_SUN_OCCLUSION'--text = fx_stateupdater_hpp.read_text(encoding='utf-8')-if cpu_sun_occ_marker not in text:- text = replace_once(text,- ''' void setSunVis(float vis) { mData.get<SunVis>() = vis; }\n''',- ''' void setSunVis(float vis) { mData.get<SunVis>() = vis; }\n\n#ifdef ANDROID\n // OPENMW_ANDROID_051_CPU_SUN_OCCLUSION\n void setSunOcclusion(float visibility) { mData.get<SunOcclusion>() = visibility; }\n#endif\n''',- 'fx/stateupdater.hpp/sun-occlusion setter')- text = replace_once(text,- ''' struct SunVis : Std140::Float\n {\n static constexpr std::string_view sName = "sunVis";\n };\n\n struct WaterHeight : Std140::Float\n''',- ''' struct SunVis : Std140::Float\n {\n static constexpr std::string_view sName = "sunVis";\n };\n\n#ifdef ANDROID\n struct SunOcclusion : Std140::Float\n {\n static constexpr std::string_view sName = "sunOcclusion";\n };\n#endif\n\n struct WaterHeight : Std140::Float\n''',- 'fx/stateupdater.hpp/sun-occlusion field')- text = replace_once(text,- ''' RcpResolution, FogNear, FogFar, Near, Far, Fov, GameHour, SunVis, WaterHeight, IsWaterEnabled,\n SimulationTime, DeltaSimulationTime, FrameNumber, WindSpeed, WeatherTransition, WeatherID, NextWeatherID,\n''',- ''' RcpResolution, FogNear, FogFar, Near, Far, Fov, GameHour, SunVis,\n#ifdef ANDROID\n SunOcclusion,\n#endif\n WaterHeight, IsWaterEnabled, SimulationTime, DeltaSimulationTime, FrameNumber, WindSpeed, WeatherTransition,\n WeatherID, NextWeatherID,\n''',- 'fx/stateupdater.hpp/sun-occlusion UBO layout')- fx_stateupdater_hpp.write_text(text, encoding='utf-8', newline='\n')- print('Added Android OMWFX sunOcclusion state field.')-else:- print('Android OMWFX sunOcclusion field already applied.')--text = renderingmanager_hpp.read_text(encoding='utf-8')-if cpu_sun_occ_marker not in text:- text = replace_once(text,- ''' void updateTextureFiltering();\n void updateAmbient();\n void setFogColor(const osg::Vec4f& color);\n''',- ''' void updateTextureFiltering();\n void updateAmbient();\n void setFogColor(const osg::Vec4f& color);\n#ifdef ANDROID\n // OPENMW_ANDROID_051_CPU_SUN_OCCLUSION\n void updateAndroidSunOcclusion(float dt);\n#endif\n''',- 'renderingmanager.hpp/helper declaration')- text = replace_once(text,- ''' bool mUpdateProjectionMatrix = false;\n bool mNight = false;\n osg::Vec2f mProjectionOffset;\n''',- ''' bool mUpdateProjectionMatrix = false;\n bool mNight = false;\n#ifdef ANDROID\n // OPENMW_ANDROID_051_CPU_SUN_OCCLUSION\n osg::Vec3f mAndroidSunDiscDirection{ 0.f, 0.f, 1.f };\n float mAndroidSunOcclusion = 1.f;\n float mAndroidSunOcclusionTarget = 1.f;\n float mAndroidSunOcclusionRayTimer = 0.f;\n#endif\n osg::Vec2f mProjectionOffset;\n''',- 'renderingmanager.hpp/state')- renderingmanager_hpp.write_text(text, encoding='utf-8', newline='\n')- print('Added Android RenderingManager sun-occlusion state.')-else:- print('Android RenderingManager sun-occlusion state already applied.')--text = renderingmanager.read_text(encoding='utf-8')-if cpu_sun_occ_marker not in text:- text = replace_once(text,- ''' mPostProcessor = new PostProcessor(*this, viewer, mRootNode, resourceSystem->getVFS());\n resourceSystem->getSceneManager()->setOpaqueDepthTex(\n''',- ''' mPostProcessor = new PostProcessor(*this, viewer, mRootNode, resourceSystem->getVFS());\n#ifdef ANDROID\n // OPENMW_ANDROID_051_CPU_SUN_OCCLUSION\n mPostProcessor->getStateUpdater()->setSunOcclusion(1.f);\n#endif\n resourceSystem->getSceneManager()->setOpaqueDepthTex(\n''',- 'renderingmanager.cpp/default visibility')- text = replace_once(text,- ''' // This is based on the exterior sun orbit and won't make sense for interiors, see WeatherManager::update\n position.z() = 400.f - std::abs(position.x());\n\n // The sun is not always synchronized with the sunlight because reasons\n''',- ''' // This is based on the exterior sun orbit and won't make sense for interiors, see WeatherManager::update\n position.z() = 400.f - std::abs(position.x());\n\n#ifdef ANDROID\n // OPENMW_ANDROID_051_CPU_SUN_OCCLUSION\n // Sun::setDirection() normalizes this exact visual-disc direction.\n mAndroidSunDiscDirection = position;\n if (mAndroidSunDiscDirection.length2() > 0.000001f)\n mAndroidSunDiscDirection.normalize();\n#endif\n\n // The sun is not always synchronized with the sunlight because reasons\n''',- 'renderingmanager.cpp/visual sun direction')- text = replace_once(text,- ''' SkyManager* RenderingManager::getSkyManager()\n {\n return mSky.get();\n }\n\n void RenderingManager::update(float dt, bool paused)\n''',- ''' SkyManager* RenderingManager::getSkyManager()\n {\n return mSky.get();\n }\n\n#ifdef ANDROID\n void RenderingManager::updateAndroidSunOcclusion(float dt)\n {\n // OPENMW_ANDROID_051_CPU_SUN_OCCLUSION\n // Rate-limit the expensive scene-graph intersection to 20 Hz, then\n // smooth the scalar each rendered frame. castRay() already excludes\n // Sky/Effects/Water/Groundcover while retaining world blockers.\n const float safeDt = std::max(0.f, dt);\n mAndroidSunOcclusionRayTimer -= safeDt;\n\n const auto& postProcessingChain = Settings::postProcessing().mChain.get();\n const bool useAndroidSunOcclusion = Settings::postProcessing().mEnabled\n && std::find(postProcessingChain.begin(), postProcessingChain.end(), "lensflare_android_051_rayocc")\n != postProcessingChain.end();\n\n if (useAndroidSunOcclusion && mAndroidSunOcclusionRayTimer <= 0.f\n && mAndroidSunDiscDirection.length2() > 0.5f)\n {\n mAndroidSunOcclusionRayTimer = 0.05f;\n\n const osg::Vec3d& cameraPos = mCamera->getPosition();\n osg::Vec3f origin(static_cast<float>(cameraPos.x()), static_cast<float>(cameraPos.y()),\n static_cast<float>(cameraPos.z()));\n origin += mAndroidSunDiscDirection * 4.f;\n\n const float rayDistance = std::max(mViewDistance, 1000.f);\n const osg::Vec3f dest = origin + mAndroidSunDiscDirection * rayDistance;\n const RayResult hit = castRay(origin, dest, true, false);\n\n mAndroidSunOcclusionTarget = hit.mHit ? 0.f : 1.f;\n }\n else if (!useAndroidSunOcclusion)\n mAndroidSunOcclusionTarget = 1.f;\n\n const float responseSpeed = mAndroidSunOcclusionTarget < mAndroidSunOcclusion ? 18.f : 10.f;\n const float response = std::min(1.f, safeDt * responseSpeed);\n mAndroidSunOcclusion += (mAndroidSunOcclusionTarget - mAndroidSunOcclusion) * response;\n mAndroidSunOcclusion = std::max(0.f, std::min(1.f, mAndroidSunOcclusion));\n mPostProcessor->getStateUpdater()->setSunOcclusion(mAndroidSunOcclusion);\n }\n#endif\n\n void RenderingManager::update(float dt, bool paused)\n''',- 'renderingmanager.cpp/CPU ray helper')- text = replace_once(text,- ''' mCamera->update(dt, paused);\n\n bool isUnderwater = mWater->isUnderwater(mCamera->getPosition());\n''',- ''' mCamera->update(dt, paused);\n#ifdef ANDROID\n updateAndroidSunOcclusion(dt);\n#endif\n\n bool isUnderwater = mWater->isUnderwater(mCamera->getPosition());\n''',- 'renderingmanager.cpp/update order')- renderingmanager.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android CPU scene-ray sun occlusion.')-else:- print('Android CPU scene-ray sun occlusion already applied.')--# ----------------------------------------------------------------------------# Release logging cleanup.-#-# Migrate already-patched source trees as well as fresh 0.51 source trees.-# This deliberately changes logging only; renderer calculations, settings and-# update ordering remain untouched.-# ----------------------------------------------------------------------------release_log_marker = 'OpenMW 0.51 Android renderer:'--text = postprocessor.read_text(encoding='utf-8')-legacy_pp_pair = ''' Log(Debug::Info) << "OpenMW 0.51 Android Gate G PP init: " << mWidth << "x" << mHeight;- Log(Debug::Info) << "OpenMW 0.51 Android OMWFX depth: Tex_Depth direct scene binding";'''-release_pp_line = ''' Log(Debug::Info) << "OpenMW 0.51 Android renderer: " << mWidth << "x" << mHeight- << ", Tex_Depth scene binding";'''-if legacy_pp_pair in text:- text = text.replace(legacy_pp_pair, release_pp_line, 1)-elif 'OpenMW 0.51 Android Gate G PP init:' in text:- text = text.replace(- ' Log(Debug::Info) << "OpenMW 0.51 Android Gate G PP init: " << mWidth << "x" << mHeight;',- release_pp_line,- 1,- )-text = text.replace(- ' Log(Debug::Info) << "OpenMW 0.51 Android OMWFX depth: Tex_Depth direct scene binding";\n',- '',- 1,-)-postprocessor.write_text(text, encoding='utf-8', newline='\n')--text = mwshadowtechnique.read_text(encoding='utf-8')-text = text.replace(- ' OSG_NOTICE << "Android GLES2 manual shadow comparison enabled" << std::endl;\n',- '',-)-mwshadowtechnique.write_text(text, encoding='utf-8', newline='\n')--text = renderingmanager_hpp.read_text(encoding='utf-8')-text = text.replace(' int mAndroidSunOcclusionLastLoggedState = -1;\n', '', 1)-renderingmanager_hpp.write_text(text, encoding='utf-8', newline='\n')--text = renderingmanager.read_text(encoding='utf-8')-legacy_sun_log = ''' const int state = hit.mHit ? 1 : 0;- if (state != mAndroidSunOcclusionLastLoggedState)- {- Log(Debug::Info) << "OpenMW 0.51 Android sun-occlusion ray: "- << (hit.mHit ? "BLOCKED" : "CLEAR")- << (hit.mHit ? " ratio=" + std::to_string(hit.mRatio) : "");- mAndroidSunOcclusionLastLoggedState = state;- }-'''-text = text.replace(legacy_sun_log, '', 1)-renderingmanager.write_text(text, encoding='utf-8', newline='\n')--print('Applied OpenMW 0.51 Android release logging cleanup.')--# Final structural verification.-engine_text = engine.read_text(encoding='utf-8')-android_text = androidmain.read_text(encoding='utf-8')-loading_text = loading.read_text(encoding='utf-8')-windowmanager_text = windowmanager.read_text(encoding='utf-8')-nifloader_text = nifloader.read_text(encoding='utf-8')-stateupdater_text = stateupdater.read_text(encoding='utf-8')-objects_frag_text = objects_frag.read_text(encoding='utf-8')-fog_glsl_text = fog_glsl.read_text(encoding='utf-8')-shadow_fragment_text = shadow_fragment.read_text(encoding='utf-8')-shadow_casting_text = shadow_casting.read_text(encoding='utf-8')-mwshadowtechnique_text = mwshadowtechnique.read_text(encoding='utf-8')-shadow_manager_text = shadow_manager.read_text(encoding='utf-8')-postprocessor_text = postprocessor.read_text(encoding='utf-8')-postprocessor_hpp_text = postprocessor_hpp.read_text(encoding='utf-8')-renderingmanager_text = renderingmanager.read_text(encoding='utf-8')-renderingmanager_hpp_text = renderingmanager_hpp.read_text(encoding='utf-8')-fx_stateupdater_hpp_text = fx_stateupdater_hpp.read_text(encoding='utf-8')-water_cpp_text = water_cpp.read_text(encoding='utf-8')-water_frag_text = water_frag.read_text(encoding='utf-8')-if fog_diag_marker in nifloader_text:- raise SystemExit('OpenMW 0.51 Patch-6 fog diagnostic was not removed')-for marker, body in (- (RUNTIME_MARKER, engine_text),- (RUNTIME_MARKER, android_text),- (loading_marker, loading_text),- (cursor_marker, windowmanager_text),- (fog_uniform_marker, stateupdater_text),- (object_fog_marker, objects_frag_text),- (object_fog_marker, fog_glsl_text),- (additive_fog_marker, objects_frag_text),- (shadow_compare_marker, shadow_fragment_text),- (shadow_compare_marker, mwshadowtechnique_text),- (shadow_compare_marker, shadow_manager_text),- ('OPENMW_ANDROID_051_ORTHOGRAPHIC_SHADOW_MAP', shadow_manager_text),- (native_clip_marker, shadow_casting_text),- (native_clip_marker, mwshadowtechnique_text),- (pp_init_marker, postprocessor_text),- (pp_init_marker, postprocessor_hpp_text),- (pp_scene_depth_marker, postprocessor_text),- (cpu_sun_occ_marker, renderingmanager_text),- (cpu_sun_occ_marker, renderingmanager_hpp_text),- (cpu_sun_occ_marker, fx_stateupdater_hpp_text),- (wetworld_water_marker, water_cpp_text),- (wetworld_water_marker, water_frag_text),-):- if marker not in body:- raise SystemExit(f'OpenMW 0.51 Android runtime verification failed: missing {marker}')--for path, replacements in shader_replacements.items():- body = path.read_text(encoding='utf-8')- for old, new in replacements:- if old in body or new not in body:- raise SystemExit(f'OpenMW 0.51 GL4ES initializer verification failed: {path}')--for path, replacements in normal_transform_replacements.items():- body = path.read_text(encoding='utf-8')- for old, new in replacements:- if old in body or new not in body:- raise SystemExit(f'OpenMW 0.51 GL4ES normal-transform verification failed: {path}')--if '#define ADDITIVE_BLENDING' in objects_frag_text:- raise SystemExit('OpenMW 0.51 Patch-11 additive fog compatibility was lost')-if 'uniform sampler2DShadow' in shadow_fragment_text or 'shadow2DProj(' in shadow_fragment_text:- raise SystemExit('OpenMW 0.51 GLES2 shadow receiver still uses unsupported shadow samplers')-if 'sampler2DShadow' in mwshadowtechnique_text or 'shadow2DProj(' in mwshadowtechnique_text:- raise SystemExit('OpenMW 0.51 MWShadowTechnique fallback shaders still use unsupported shadow samplers')-if 'gl_Position.z = clamp(gl_Position.z, -gl_Position.w, gl_Position.w);' in shadow_casting_text:- raise SystemExit('OpenMW 0.51 Android shadow caster still contains per-vertex Z clamp emulation')--if stable_ortho_basis_marker not in mwshadowtechnique_text:- raise SystemExit('OpenMW 0.51 Android stable orthographic shadow basis is missing')--if no_main_frustum_crop_marker not in mwshadowtechnique.read_text(encoding='utf-8'):- raise SystemExit('OpenMW 0.51 Android orthographic no-main-frustum-crop marker is missing')--if no_caster_bounds_tightening_marker not in mwshadowtechnique.read_text(encoding='utf-8'):- raise SystemExit('OpenMW 0.51 Android orthographic no-caster-bounds-tightening marker is missing')--if 'OPENMW_ANDROID_051_ORTHO_NO_MAIN_FRUSTUM_CROP_ALL_PATHS' not in mwshadowtechnique.read_text(encoding='utf-8'):- raise SystemExit('OpenMW 0.51 Android all-path main-frustum-crop bypass correction is missing')--if 'setSunOcclusion(float visibility)' not in fx_stateupdater_hpp_text or 'sName = "sunOcclusion"' not in fx_stateupdater_hpp_text:- raise SystemExit('OpenMW 0.51 Android OMWFX sunOcclusion field is incomplete')-if 'const RayResult hit = castRay(origin, dest, true, false);' not in renderingmanager_text:- raise SystemExit('OpenMW 0.51 Android CPU sun-occlusion scene ray is missing')-if 'lensflare_android_051_rayocc' not in renderingmanager_text or 'mChain.get()' not in renderingmanager_text:- raise SystemExit('OpenMW 0.51 Android CPU sun-occlusion chain gate is missing')-if 'OpenMW 0.51 Android sun-occlusion ray:' in renderingmanager_text or 'mAndroidSunOcclusionLastLoggedState' in renderingmanager_hpp_text:- raise SystemExit('OpenMW 0.51 Android CPU sun-occlusion diagnostic logging was not removed')-if 'setTextureDepth(getTexture(Tex_Depth, frameId))' not in postprocessor_text:- raise SystemExit('OpenMW 0.51 Android direct OMWFX scene-depth binding is missing')-if release_log_marker not in postprocessor_text:- raise SystemExit('OpenMW 0.51 Android release renderer marker is missing')-if 'Gate G PP init' in postprocessor_text or 'OMWFX depth: Tex_Depth direct scene binding' in postprocessor_text:- raise SystemExit('OpenMW 0.51 Android legacy post-processing diagnostics were not removed')-if 'Android GLES2 manual shadow comparison enabled' in mwshadowtechnique_text:- raise SystemExit('OpenMW 0.51 Android repetitive shadow diagnostic was not removed')-if '#include <osg/BlendFunc>' not in water_cpp_text:- raise SystemExit('OpenMW 0.51 Android WetWorld BlendFunc include is missing')-if water_cpp_text.count('osg::BlendFunc::ZERO, osg::BlendFunc::ZERO') < 2:- raise SystemExit('OpenMW 0.51 Android WetWorld water-alpha blend routes are incomplete')-if 'defineMap["wetWorldWaterMask"] = "1";' not in water_cpp_text:- raise SystemExit('OpenMW 0.51 Android WetWorld shader define is missing')-if '#if @wetWorldWaterMask' not in water_frag_text or 'gl_FragData[0].a = 0.0;' not in water_frag_text:- raise SystemExit('OpenMW 0.51 Android WetWorld water.frag alpha marker is incomplete')-if 'rainCombined(position.xy/1000.0, waterTimer)' not in water_frag_text:- raise SystemExit('OpenMW 0.51 Android WetWorld water.frag lost native rain ripples')-camera_update = renderingmanager_text.find('mCamera->update(dt, paused);')-sun_occ_update = renderingmanager_text.find('updateAndroidSunOcclusion(dt);', camera_update)-underwater_update = renderingmanager_text.find('bool isUnderwater =', camera_update)-if not (camera_update >= 0 and camera_update < sun_occ_update < underwater_update):- raise SystemExit('OpenMW 0.51 Android CPU sun-occlusion update ordering is invalid')--print('OpenMW 0.51 Android runtime baseline patch: READY')-# ----------------------------------------------------------------------------# Android grazing-angle shadow fix V6.-# V3 texel-centre RPDB remains authoritative. V6 conditions triangle derivatives-# before cascade branches and corrects the per-tap plane mismatch one-sidedly.-# The vertex interface is unchanged; replace the V5 implementation in place.-# ----------------------------------------------------------------------------# OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V5-shadow_vertex_grazing_v5 = root / 'files' / 'shaders' / 'compatibility' / 'shadows_vertex.glsl'-shadow_fragment_grazing_v5 = root / 'files' / 'shaders' / 'compatibility' / 'shadows_fragment.glsl'--shadow_vertex_grazing_v5.write_text(r'''#define SHADOWS @shadows_enabled--#if SHADOWS- @foreach shadow_texture_unit_index @shadow_texture_unit_list- uniform mat4 shadowSpaceMatrix@shadow_texture_unit_index;- varying vec4 shadowSpaceCoords@shadow_texture_unit_index;- // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V1- // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3- // Local receiver-plane depth slope in normalized shadow UV coordinates.- // The fragment shader uses this to move each PCF comparison onto the- // expected depth of the same receiver plane instead of comparing every- // neighbour against the centre depth.- varying vec2 shadowReceiverPlaneSlope@shadow_texture_unit_index;--#if @perspectiveShadowMaps- uniform mat4 validRegionMatrix@shadow_texture_unit_index;- varying vec4 shadowRegionCoords@shadow_texture_unit_index;-#endif- @endforeach-- // Enabling this may reduce peter panning. Probably unnecessary.- const bool onlyNormalOffsetUV = false;-#endif // SHADOWS--#if SHADOWS-vec2 openmwAndroidReceiverPlaneSlope(mat4 shadowMatrix, vec4 shadowCoord, vec3 viewNormal)-{- // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V1- // Derivative-free receiver-plane depth bias for GLES2/GL4ES.- // Build two tangents on the receiver plane, project them into shadow- // coordinates and solve dz/du,dz/dv. This remains valid for the Android- // orthographic sun map and also handles homogeneous W conservatively.- float normalLength2 = dot(viewNormal, viewNormal);- if (normalLength2 < 1e-10 || abs(shadowCoord.w) < 1e-6)- return vec2(0.0);-- vec3 n = viewNormal * inversesqrt(normalLength2);- vec3 helperAxis = abs(n.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(0.0, 1.0, 0.0);- vec3 tangentA = normalize(cross(helperAxis, n));- vec3 tangentB = cross(n, tangentA);-- vec4 projectedA = shadowMatrix * vec4(tangentA, 0.0);- vec4 projectedB = shadowMatrix * vec4(tangentB, 0.0);-- float invW = 1.0 / shadowCoord.w;- float invW2 = invW * invW;- vec3 deltaA = projectedA.xyz * invW - shadowCoord.xyz * projectedA.w * invW2;- vec3 deltaB = projectedB.xyz * invW - shadowCoord.xyz * projectedB.w * invW2;-- float determinant = deltaA.x * deltaB.y - deltaB.x * deltaA.y;-- // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3- // Use a scale-independent conditioning test. With the Android orthographic- // shadow range, valid UV basis determinants are naturally around 1e-8, so- // the previous absolute 1e-8 cutoff discarded ordinary terrain slopes.- float determinantScale = length(deltaA.xy) * length(deltaB.xy);- if (determinantScale < 1e-16)- return vec2(0.0);-- float minimumDeterminant = determinantScale * 1e-5;- if (abs(determinant) < minimumDeterminant)- determinant = determinant < 0.0 ? -minimumDeterminant : minimumDeterminant;-- vec2 receiverSlope = vec2(- (deltaA.z * deltaB.y - deltaB.z * deltaA.y) / determinant,- (deltaB.z * deltaA.x - deltaA.z * deltaB.x) / determinant- );-- // Keep only the mathematically singular horizon case finite.- return clamp(receiverSlope, vec2(-128.0), vec2(128.0));-}-#endif--void setupShadowCoords(vec4 viewPos, vec3 viewNormal)-{-#if SHADOWS- vec4 shadowOffset;- @foreach shadow_texture_unit_index @shadow_texture_unit_list-#if @perspectiveShadowMaps- shadowRegionCoords@shadow_texture_unit_index = validRegionMatrix@shadow_texture_unit_index * viewPos;-#endif--#if @disableNormalOffsetShadows- shadowSpaceCoords@shadow_texture_unit_index = shadowSpaceMatrix@shadow_texture_unit_index * viewPos;-#else- shadowOffset = vec4(viewNormal * @shadowNormalOffset, 0.0);-- if (onlyNormalOffsetUV)- {- vec4 lightSpaceXY = viewPos + shadowOffset;- lightSpaceXY = shadowSpaceMatrix@shadow_texture_unit_index * lightSpaceXY;-- shadowSpaceCoords@shadow_texture_unit_index.xy = lightSpaceXY.xy;- }- else- {- vec4 offsetViewPosition = viewPos + shadowOffset;- shadowSpaceCoords@shadow_texture_unit_index = shadowSpaceMatrix@shadow_texture_unit_index * offsetViewPosition;- }-#endif-- shadowReceiverPlaneSlope@shadow_texture_unit_index = openmwAndroidReceiverPlaneSlope(- shadowSpaceMatrix@shadow_texture_unit_index,- shadowSpaceCoords@shadow_texture_unit_index,- viewNormal- );- @endforeach-#endif // SHADOWS-}-''', encoding='utf-8', newline='\n')-shadow_fragment_grazing_v5.write_text(r'''#define SHADOWS @shadows_enabled--// OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3-// OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V6-// V3 remains the primary plane. Geometry supplies a conditioned, one-sided-// correction measured at each sampled texel, with a bounded depth budget.-//-// OPENMW_ANDROID_051_GLES2_MANUAL_SHADOW_COMPARE-// GLES2/GL4ES: sample OES depth textures through sampler2D and perform-// the LEQUAL test explicitly; EXT_shadow_samplers is not available.-//-// OPENMW_ANDROID_051_GLES2_QUALITY_PCF-// The launcher specializes these two compile-time constants before each game-// start. Keeping the kernel compile-time avoids dynamic loops/branches on GLES2.-// Level 0 = legacy 1 tap, level 1 = 2x2 / 4 taps (Low),-// level 2 = 3x3 / 9 taps (Medium), level 3 = 4x4 / 16 taps (High).-// Level 4 = continuously weighted cubic 4x4 / 16 taps (Very High).-#define OPENMW_ANDROID_SHADOW_PCF_LEVEL 2-#define OPENMW_ANDROID_SHADOW_MAP_RESOLUTION 4096.0--#if SHADOWS- uniform float maximumShadowMapDistance;- uniform float shadowFadeStart;- @foreach shadow_texture_unit_index @shadow_texture_unit_list- uniform sampler2D shadowTexture@shadow_texture_unit_index;- varying vec4 shadowSpaceCoords@shadow_texture_unit_index;- // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V1- varying vec2 shadowReceiverPlaneSlope@shadow_texture_unit_index;--#if @perspectiveShadowMaps- varying vec4 shadowRegionCoords@shadow_texture_unit_index;-#endif- @endforeach-#endif // SHADOWS--float openmwAndroidReceiverDepthForOffset(float centerDepth, vec2 receiverPlaneSlope, vec2 texelSize, vec2 texelOffset)-{- // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V1- // Receiver-plane depth bias (RPDB): neighbouring PCF taps must compare- // against the depth of the same geometric plane at the neighbouring UV,- // not against the centre fragment depth. This is the key fix for long- // shadow-acne bands and terrain-triangle artifacts at grazing sun angles.- return clamp(centerDepth + dot(receiverPlaneSlope, texelSize * texelOffset), 0.0, 1.0);-}--vec2 openmwAndroidGeometricReceiverPlaneSlopeV6(vec3 shadowXYZ, vec2 stableSlope)-{- // Evaluate before distance/cascade branches. Normalize each derivative by- // its largest UV component before solving: an absolute determinant cutoff- // wrongly rejects valid small triangles and distant receivers.- vec3 dx = dFdx(shadowXYZ);- vec3 dy = dFdy(shadowXYZ);- float scaleX = max(abs(dx.x), abs(dx.y));- float scaleY = max(abs(dy.x), abs(dy.y));- dx /= max(scaleX, 1e-20);- dy /= max(scaleY, 1e-20);- float determinant = dx.x * dy.y - dy.x * dx.y;- float conditioning = abs(determinant) / max(length(dx.xy) * length(dy.xy), 1e-10);- if (scaleX < 1e-20 || scaleY < 1e-20 || conditioning <= 0.0001)- return stableSlope;-- vec2 slope = vec2(dx.z * dy.y - dy.z * dx.y,- dy.z * dx.x - dx.z * dy.x) / determinant;- // Ease back to the interpolated plane near a singular light projection,- // instead of switching abruptly between unrelated slopes at the horizon.- float reliability = smoothstep(0.0001, 0.01, conditioning);- return mix(stableSlope, clamp(slope, vec2(-128.0), vec2(128.0)), reliability);-}--float openmwAndroidConservativeReceiverDepthV6(- float centerDepth,- vec2 stableSlope,- vec2 geometricSlope,- vec2 texelSize,- vec2 totalTexelOffset)-{- // Smoothed rock normals are not the rasterized triangle plane. The V5- // fixed 0.00010 relief left a depth error at grazing angles, particularly- // at the outer PCF taps. Correct the actual signed error at this texel.- // Never raise the V3 comparison depth (the dark-facet regression in V4).- float stableDepth = openmwAndroidReceiverDepthForOffset(- centerDepth, stableSlope, texelSize, totalTexelOffset);- float geometricDepth = openmwAndroidReceiverDepthForOffset(- centerDepth, geometricSlope, texelSize, totalTexelOffset);- // Same maximum normalized-depth scale as the existing slope bias. The- // correction is zero when the planes agree; it is not a global offset or- // a sun-angle fade of real cast shadows. Singular projections use V3.- float oneSidedRelief = clamp(stableDepth - geometricDepth, 0.0, 0.0030);- return max(stableDepth - oneSidedRelief, 0.0);-}--float unshadowedLightRatio(float distance)-{- float shadowing = 1.0;-#if SHADOWS- // All derivative evaluations precede even the fade early-return and the- // cascade-selection branch, so neighbouring fragments share control flow.- @foreach shadow_texture_unit_index @shadow_texture_unit_list- float receiverW@shadow_texture_unit_index = shadowSpaceCoords@shadow_texture_unit_index.w;- vec3 receiverXYZ@shadow_texture_unit_index = shadowSpaceCoords@shadow_texture_unit_index.xyz /- (abs(receiverW@shadow_texture_unit_index) > 1e-6 ? receiverW@shadow_texture_unit_index : 1e-6);- vec2 receiverGeometry@shadow_texture_unit_index = openmwAndroidGeometricReceiverPlaneSlopeV6(- receiverXYZ@shadow_texture_unit_index, shadowReceiverPlaneSlope@shadow_texture_unit_index);- @endforeach-#if @limitShadowMapDistance- float fade = clamp((distance - shadowFadeStart) / (maximumShadowMapDistance - shadowFadeStart), 0.0, 1.0);- if (fade == 1.0)- return shadowing;-#endif- bool doneShadows = false;- @foreach shadow_texture_unit_index @shadow_texture_unit_list- if (!doneShadows)- {- vec3 shadowXYZ = receiverXYZ@shadow_texture_unit_index;- vec2 stableReceiverPlaneSlope = shadowReceiverPlaneSlope@shadow_texture_unit_index;- vec2 geometricReceiverPlaneSlope = receiverGeometry@shadow_texture_unit_index;-#if @perspectiveShadowMaps- vec3 shadowRegionXYZ = shadowRegionCoords@shadow_texture_unit_index.xyz / shadowRegionCoords@shadow_texture_unit_index.w;-#endif- if (all(lessThan(shadowXYZ.xy, vec2(1.0, 1.0))) && all(greaterThan(shadowXYZ.xy, vec2(0.0, 0.0))))- {- // OPENMW_ANDROID_051_GLES2_SHADOW_COORD_BOUNDS- // Raw GLES2 depth sampling must never compare receivers outside- // the valid projected shadow depth volume. Otherwise z > 1 can- // become a view-dependent full-shadow patch with CLAMP_TO_EDGE.- if (shadowSpaceCoords@shadow_texture_unit_index.w > 0.0 && shadowXYZ.z > 0.0 && shadowXYZ.z < 1.0)- {- vec2 shadowTexel = vec2(1.0 / OPENMW_ANDROID_SHADOW_MAP_RESOLUTION);- // OPENMW_ANDROID_051_GLES2_RECEIVER_DEPTH_BIAS- // Retain the proven tiny fixed safety bias, then add only a- // tightly capped slope-scaled residual for the centre sample.- // Most grazing-angle correction happens per PCF tap through- // receiver-plane depth reconstruction below, so this does not- // require the large global offsets that cause Peter Panning.- float receiverDepth = max(shadowXYZ.z - 0.00005, 0.0);- vec2 receiverPlaneSlope = stableReceiverPlaneSlope;- // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3- // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V6- // Bounded residual after exact texel-centre reconstruction.- float receiverSlopeFootprint =- (abs(receiverPlaneSlope.x) + abs(receiverPlaneSlope.y)) * shadowTexel.x;- float receiverSlopeBias = min(receiverSlopeFootprint * 0.35, 0.0030);- receiverDepth = max(receiverDepth - receiverSlopeBias, 0.0);-#if OPENMW_ANDROID_SHADOW_PCF_LEVEL == 0- // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3- vec2 shadowUv = (floor(shadowXYZ.xy * OPENMW_ANDROID_SHADOW_MAP_RESOLUTION) + vec2(0.5)) * shadowTexel;- shadowUv = clamp(shadowUv, shadowTexel, vec2(1.0) - shadowTexel);- vec2 anchorOffset = (shadowUv - shadowXYZ.xy) / shadowTexel;- float anchorReceiverDepth = openmwAndroidConservativeReceiverDepthV6(- receiverDepth,- receiverPlaneSlope,- geometricReceiverPlaneSlope,- shadowTexel,- anchorOffset);- shadowing = min(step(anchorReceiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv).r), shadowing);-#elif OPENMW_ANDROID_SHADOW_PCF_LEVEL == 1- // Low: anchor half-texel taps on a real texel boundary so- // all four lookups land at actual texel centres.- vec2 shadowUv = floor(- shadowXYZ.xy * OPENMW_ANDROID_SHADOW_MAP_RESOLUTION + vec2(0.5)) * shadowTexel;- shadowUv = clamp(shadowUv, shadowTexel, vec2(1.0) - shadowTexel);- vec2 anchorOffset = (shadowUv - shadowXYZ.xy) / shadowTexel;- float anchorReceiverDepth = openmwAndroidConservativeReceiverDepthV6(- receiverDepth,- receiverPlaneSlope,- geometricReceiverPlaneSlope,- shadowTexel,- anchorOffset);- float pcfShadow = 0.0;- pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-0.5, -0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, -0.5)).r);- pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.5, -0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, -0.5)).r);- pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-0.5, 0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, 0.5)).r);- pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.5, 0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, 0.5)).r);- shadowing = min(pcfShadow * 0.25, shadowing);-#elif OPENMW_ANDROID_SHADOW_PCF_LEVEL == 2- // Medium: snap the integer 3x3 kernel to the containing- // shadow texel centre and reconstruct depth from the original UV.- vec2 shadowUv = (floor(shadowXYZ.xy * OPENMW_ANDROID_SHADOW_MAP_RESOLUTION) + vec2(0.5)) * shadowTexel;- shadowUv = clamp(shadowUv, shadowTexel, vec2(1.0) - shadowTexel);- vec2 anchorOffset = (shadowUv - shadowXYZ.xy) / shadowTexel;- float anchorReceiverDepth = openmwAndroidConservativeReceiverDepthV6(- receiverDepth,- receiverPlaneSlope,- geometricReceiverPlaneSlope,- shadowTexel,- anchorOffset);- float pcfShadow = 0.0;- pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, -1.0)).r);- pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.0, -1.0)).r);- pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.0, -1.0)).r);- pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, 0.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, 0.0)).r);- pcfShadow += step(anchorReceiverDepth, texture2D(shadowTexture@shadow_texture_unit_index, shadowUv).r);- pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.0, 0.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.0, 0.0)).r);- pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, 1.0)).r);- pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.0, 1.0)).r);- pcfShadow += step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.0, 1.0)).r);- shadowing = min(pcfShadow * (1.0 / 9.0), shadowing);-#elif OPENMW_ANDROID_SHADOW_PCF_LEVEL == 3- // High: weighted 4x4 tent PCF at 4096.- // OPENMW_ANDROID_051_GLES2_TENT_PCF- // OPENMW_ANDROID_051_GRAZING_SHADOW_FIX_V3- // Anchor +/-0.5 and +/-1.5 samples on the nearest real- // texel boundary; all sixteen taps then hit distinct centres.- vec2 shadowMargin = shadowTexel * 2.0;- vec2 shadowUv = floor(- shadowXYZ.xy * OPENMW_ANDROID_SHADOW_MAP_RESOLUTION + vec2(0.5)) * shadowTexel;- shadowUv = clamp(shadowUv, shadowMargin, vec2(1.0) - shadowMargin);- vec2 anchorOffset = (shadowUv - shadowXYZ.xy) / shadowTexel;- float anchorReceiverDepth = openmwAndroidConservativeReceiverDepthV6(- receiverDepth,- receiverPlaneSlope,- geometricReceiverPlaneSlope,- shadowTexel,- anchorOffset);- float pcfShadow = 0.0;- pcfShadow += 1.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.5, -1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.5, -1.5)).r);- pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-0.5, -1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, -1.5)).r);- pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.5, -1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, -1.5)).r);- pcfShadow += 1.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.5, -1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.5, -1.5)).r);- pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.5, -0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.5, -0.5)).r);- pcfShadow += 9.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-0.5, -0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, -0.5)).r);- pcfShadow += 9.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.5, -0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, -0.5)).r);- pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.5, -0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.5, -0.5)).r);- pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.5, 0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.5, 0.5)).r);- pcfShadow += 9.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-0.5, 0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, 0.5)).r);- pcfShadow += 9.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.5, 0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, 0.5)).r);- pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.5, 0.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.5, 0.5)).r);- pcfShadow += 1.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.5, 1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.5, 1.5)).r);- pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-0.5, 1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-0.5, 1.5)).r);- pcfShadow += 3.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 0.5, 1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 0.5, 1.5)).r);- pcfShadow += 1.0 * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2( 1.5, 1.5)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2( 1.5, 1.5)).r);- shadowing = min(pcfShadow * (1.0 / 64.0), shadowing);-#else- // OPENMW_ANDROID_051_CONTINUOUS_TENT_PCF_V1- // OPENMW_ANDROID_051_CUBIC_PCF_16_V3- // Cubic B-spline reconstruction has continuous coverage- // AND continuous first derivatives across texel boundaries.- // 16 samples, like High; no 36-tap outer skirt or contrast- // sharpening. Keep each axis normalized to 9 for the- // existing runtime validation contract (2D divisor 81).- vec2 grid = clamp(shadowXYZ.xy * OPENMW_ANDROID_SHADOW_MAP_RESOLUTION - vec2(0.5),- vec2(1.0), vec2(OPENMW_ANDROID_SHADOW_MAP_RESOLUTION - 3.0));- vec2 cell = floor(grid);- vec2 f = grid - cell;- vec2 g = vec2(1.0) - f;- vec2 w0 = g * g * g * 1.5;- vec2 w1 = (3.0 * f * f * f - 6.0 * f * f + vec2(4.0)) * 1.5;- vec2 w2 = (-3.0 * f * f * f + 3.0 * f * f + 3.0 * f + vec2(1.0)) * 1.5;- vec2 w3 = f * f * f * 1.5;- vec2 shadowUv = (cell + vec2(0.5)) * shadowTexel;- vec2 anchorOffset = (shadowUv - shadowXYZ.xy) / shadowTexel;- float pcfShadow = 0.0;- pcfShadow += w0.x * w0.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, -1.0)).r);- pcfShadow += w1.x * w0.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(0.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(0.0, -1.0)).r);- pcfShadow += w2.x * w0.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(1.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(1.0, -1.0)).r);- pcfShadow += w3.x * w0.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(2.0, -1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(2.0, -1.0)).r);- pcfShadow += w0.x * w1.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, 0.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, 0.0)).r);- pcfShadow += w1.x * w1.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(0.0, 0.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(0.0, 0.0)).r);- pcfShadow += w2.x * w1.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(1.0, 0.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(1.0, 0.0)).r);- pcfShadow += w3.x * w1.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(2.0, 0.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(2.0, 0.0)).r);- pcfShadow += w0.x * w2.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, 1.0)).r);- pcfShadow += w1.x * w2.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(0.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(0.0, 1.0)).r);- pcfShadow += w2.x * w2.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(1.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(1.0, 1.0)).r);- pcfShadow += w3.x * w2.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(2.0, 1.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(2.0, 1.0)).r);- pcfShadow += w0.x * w3.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(-1.0, 2.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(-1.0, 2.0)).r);- pcfShadow += w1.x * w3.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(0.0, 2.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(0.0, 2.0)).r);- pcfShadow += w2.x * w3.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(1.0, 2.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(1.0, 2.0)).r);- pcfShadow += w3.x * w3.y * step(openmwAndroidConservativeReceiverDepthV6(receiverDepth, receiverPlaneSlope, geometricReceiverPlaneSlope, shadowTexel, anchorOffset + vec2(2.0, 2.0)), texture2D(shadowTexture@shadow_texture_unit_index, shadowUv + shadowTexel * vec2(2.0, 2.0)).r);- shadowing = min(pcfShadow * (1.0 / 81.0), shadowing);-#endif- }-- doneShadows = all(lessThan(shadowXYZ, vec3(0.95, 0.95, 1.0))) && all(greaterThan(shadowXYZ, vec3(0.05, 0.05, 0.0)));-#if @perspectiveShadowMaps- doneShadows = doneShadows && all(lessThan(shadowRegionXYZ, vec3(1.0, 1.0, 1.0))) && all(greaterThan(shadowRegionXYZ.xy, vec2(-1.0, -1.0)));-#endif- }- }- @endforeach-#if @limitShadowMapDistance- shadowing = mix(shadowing, 1.0, fade);-#endif-#endif // SHADOWS- return shadowing;-}--void applyShadowDebugOverlay()-{-#if SHADOWS && @useShadowDebugOverlay- bool doneOverlay = false;- float colourIndex = 0.0;- @foreach shadow_texture_unit_index @shadow_texture_unit_list- if (!doneOverlay)- {- vec3 shadowXYZ = shadowSpaceCoords@shadow_texture_unit_index.xyz / shadowSpaceCoords@shadow_texture_unit_index.w;-#if @perspectiveShadowMaps- vec3 shadowRegionXYZ = shadowRegionCoords@shadow_texture_unit_index.xyz / shadowRegionCoords@shadow_texture_unit_index.w;-#endif- if (all(lessThan(shadowXYZ.xy, vec2(1.0, 1.0))) && all(greaterThan(shadowXYZ.xy, vec2(0.0, 0.0))))- {- colourIndex = mod(@shadow_texture_unit_index.0, 3.0);- if (colourIndex < 1.0)- gl_FragData[0].x += 0.1;- else if (colourIndex < 2.0)- gl_FragData[0].y += 0.1;- else- gl_FragData[0].z += 0.1;-- doneOverlay = all(lessThan(shadowXYZ, vec3(0.95, 0.95, 1.0))) && all(greaterThan(shadowXYZ, vec3(0.05, 0.05, 0.0)));-#if @perspectiveShadowMaps- doneOverlay = doneOverlay && all(lessThan(shadowRegionXYZ.xyz, vec3(1.0, 1.0, 1.0))) && all(greaterThan(shadowRegionXYZ.xy, vec2(-1.0, -1.0)));-#endif- }- }- @endforeach-#endif // SHADOWS-}-''', encoding='utf-8', newline='\n')-print('Applied Android GLES2 conditioned grazing-angle shadow fix V6.')diff --git a/android/buildscripts/patches/openmw051-final/apply-ndk-r26-format.py b/android/buildscripts/patches/openmw051-final/apply-ndk-r26-format.pydeleted file mode 100644index e7111c8..0000000--- a/android/buildscripts/patches/openmw051-final/apply-ndk-r26-format.py+++ /dev/null@@ -1,103 +0,0 @@-#!/usr/bin/env python3-from pathlib import Path-import sys--if len(sys.argv) != 2:- raise SystemExit('usage: apply-ndk-r26-format.py <openmw-source-dir>')--root = Path(sys.argv[1])-cmake = root / 'CMakeLists.txt'-openmw_cmake = root / 'apps' / 'openmw' / 'CMakeLists.txt'--for path in (cmake, openmw_cmake):- if not path.is_file():- raise SystemExit(f'missing expected OpenMW 0.51 source file: {path}')--marker_compile = 'OPENMW_ANDROID_NDK_R26_EXPERIMENTAL_FORMAT'-marker_probe = 'OPENMW_ANDROID_NDK_R26_FORMAT_PROBE'-marker_link = 'OPENMW_ANDROID_NDK_R26_EXPERIMENTAL_FORMAT_LINK'--text = cmake.read_text(encoding='utf-8')-if marker_compile not in text:- needle = 'set(CMAKE_CXX_EXTENSIONS OFF)\n'- if text.count(needle) != 1:- raise SystemExit('could not locate unique CMAKE_CXX_EXTENSIONS anchor in OpenMW 0.51 CMakeLists.txt')- replacement = needle + r'''-# OPENMW_ANDROID_NDK_R26_EXPERIMENTAL_FORMAT-# Android NDK r26b ships a libc++ 17 snapshot whose <format> implementation is-# still hidden by _LIBCPP_HAS_NO_INCOMPLETE_FORMAT unless the libc++-# experimental-library gate is enabled. Keep the existing Android toolchain-# unchanged during the 0.51 migration and enable the vendor gate explicitly.-if (ANDROID AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")- add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-fexperimental-library>")-- # OPENMW_ANDROID_NDK_R26_FORMAT_PROBE- # Fail during CMake configuration, before the long OpenMW compile, unless- # this exact NDK can compile and link the formatting forms OpenMW uses.- include(CheckCXXSourceCompiles)- set(_openmw_saved_required_flags "${CMAKE_REQUIRED_FLAGS}")- set(_openmw_saved_required_libraries "${CMAKE_REQUIRED_LIBRARIES}")- set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fexperimental-library")- list(APPEND CMAKE_REQUIRED_LIBRARIES c++experimental)- check_cxx_source_compiles([=[- #include <format>- #include <string>- int main()- {- const std::string a = std::format("value={}", 42);- const std::string b = std::format("{:.3f}", 1.25f);- return (a.empty() || b.empty()) ? 1 : 0;- }- ]=] OPENMW_ANDROID_NDK_R26_STD_FORMAT_WORKS)- set(CMAKE_REQUIRED_FLAGS "${_openmw_saved_required_flags}")- set(CMAKE_REQUIRED_LIBRARIES "${_openmw_saved_required_libraries}")- unset(_openmw_saved_required_flags)- unset(_openmw_saved_required_libraries)-- if (NOT OPENMW_ANDROID_NDK_R26_STD_FORMAT_WORKS)- message(FATAL_ERROR- "Android NDK r26 std::format probe failed. The toolchain must support "- "-fexperimental-library and libc++experimental before OpenMW 0.51 can be built.")- endif()-endif()-'''- text = text.replace(needle, replacement, 1)- cmake.write_text(text, encoding='utf-8', newline='\n')- print('Applied Android NDK r26 std::format compile support (-fexperimental-library).')- print('Installed configure-time std::format compile/link probe.')-else:- print('Android NDK r26 std::format compile support is already applied.')- if marker_probe in text:- print('Android NDK r26 std::format configure-time probe is already applied.')- else:- raise SystemExit('format compile marker exists but configure-time probe marker is missing')--text = openmw_cmake.read_text(encoding='utf-8')-if marker_link not in text:- needle = ' target_link_libraries(openmw openmw-lib)\n'- if text.count(needle) != 1:- raise SystemExit('could not locate unique openmw target_link_libraries anchor in OpenMW 0.51 apps/openmw/CMakeLists.txt')- replacement = needle + r'''-- # OPENMW_ANDROID_NDK_R26_EXPERIMENTAL_FORMAT_LINK- # NDK r26b keeps the gated format implementation's out-of-line support in- # libc++experimental.a. Keep the extra library Android-only.- if (ANDROID)- target_link_libraries(openmw c++experimental)- endif()-'''- text = text.replace(needle, replacement, 1)- openmw_cmake.write_text(text, encoding='utf-8', newline='\n')- print('Linked Android OpenMW against libc++experimental for std::format.')-else:- print('Android libc++experimental std::format link support is already applied.')--verify_cmake = cmake.read_text(encoding='utf-8')-verify_openmw = openmw_cmake.read_text(encoding='utf-8')-for marker in (marker_compile, marker_probe):- if marker not in verify_cmake:- raise SystemExit(f'verification failed: {marker} missing')-if marker_link not in verify_openmw:- raise SystemExit('verification failed: Android libc++experimental link marker missing')--print('OpenMW 0.51 Android NDK r26 C++20 format compatibility: READY')diff --git a/android/buildscripts/patches/osg/0001-Replace-Atomic-impl-with-std-atomic.patch b/android/buildscripts/patches/osg/0001-Replace-Atomic-impl-with-std-atomic.patchdeleted file mode 100644index 69fdc9e..0000000--- a/android/buildscripts/patches/osg/0001-Replace-Atomic-impl-with-std-atomic.patch+++ /dev/null@@ -1,271 +0,0 @@-From e382015913fb2d7f0edc669409252028b719cf97 Mon Sep 17 00:00:00 2001-From: Ilya Zhuravlev <[email protected]>-Date: Sun, 10 Feb 2019 15:28:36 -0500-Subject: [PATCH 1/5] Replace Atomic impl with std::atomic------ include/OpenThreads/Atomic | 169 ++----------------------------- src/OpenThreads/common/Atomic.cpp | 2 +- 2 files changed, 11 insertions(+), 160 deletions(-)--diff --git a/include/OpenThreads/Atomic b/include/OpenThreads/Atomic-index ba6723354..da8db7227 100644---- a/include/OpenThreads/Atomic-+++ b/include/OpenThreads/Atomic-@@ -17,21 +17,7 @@- #include <OpenThreads/Config>- #include <OpenThreads/Exports>---#if defined(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)--# include <libkern/OSAtomic.h>--# define _OPENTHREADS_ATOMIC_USE_LIBRARY_ROUTINES--#elif defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS) && defined(__i386__)--# define _OPENTHREADS_ATOMIC_USE_LIBRARY_ROUTINES--#elif defined(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)--# define _OPENTHREADS_ATOMIC_USE_LIBRARY_ROUTINES--#elif defined(_OPENTHREADS_ATOMIC_USE_SUN)--# include <atomic.h>--# include "Mutex"--# include "ScopedLock"--#elif defined(_OPENTHREADS_ATOMIC_USE_MUTEX)--# include "Mutex"--# include "ScopedLock"--#endif-+#include <atomic>-- #if defined(_OPENTHREADS_ATOMIC_USE_LIBRARY_ROUTINES)- #define _OPENTHREADS_ATOMIC_INLINE-@@ -61,19 +47,7 @@ class OPENTHREAD_EXPORT_DIRECTIVE Atomic {- Atomic(const Atomic&);- Atomic& operator=(const Atomic&);---#if defined(_OPENTHREADS_ATOMIC_USE_MUTEX)-- mutable Mutex _mutex;--#endif--#if defined(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)-- volatile long _value;--#elif defined(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)-- volatile int32_t _value;--#elif defined(_OPENTHREADS_ATOMIC_USE_SUN)-- volatile uint_t _value;-- mutable Mutex _mutex; // needed for xor--#else-- volatile unsigned _value;--#endif-+ std::atomic<unsigned> _value;- };-- /**-@@ -95,10 +69,7 @@ private:- AtomicPtr(const AtomicPtr&);- AtomicPtr& operator=(const AtomicPtr&);---#if defined(_OPENTHREADS_ATOMIC_USE_MUTEX)-- mutable Mutex _mutex;--#endif-- void* volatile _ptr;-+ std::atomic<void*> _ptr;- };-- #if !defined(_OPENTHREADS_ATOMIC_USE_LIBRARY_ROUTINES)-@@ -106,178 +77,56 @@ private:- _OPENTHREADS_ATOMIC_INLINE unsigned- Atomic::operator++()- {--#if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)-- return __sync_add_and_fetch(&_value, 1);--#elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)-- return __add_and_fetch(&_value, 1);--#elif defined(_OPENTHREADS_ATOMIC_USE_SUN)-- return atomic_inc_uint_nv(&_value);--#elif defined(_OPENTHREADS_ATOMIC_USE_MUTEX)-- ScopedLock<Mutex> lock(_mutex);- return ++_value;--#else-- return ++_value;--#endif- }-- _OPENTHREADS_ATOMIC_INLINE unsigned- Atomic::operator--()- {--#if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)-- return __sync_sub_and_fetch(&_value, 1);--#elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)-- return __sub_and_fetch(&_value, 1);--#elif defined(_OPENTHREADS_ATOMIC_USE_SUN)-- return atomic_dec_uint_nv(&_value);--#elif defined(_OPENTHREADS_ATOMIC_USE_MUTEX)-- ScopedLock<Mutex> lock(_mutex);-- return --_value;--#else- return --_value;--#endif- }-- _OPENTHREADS_ATOMIC_INLINE unsigned- Atomic::AND(unsigned value)- {--#if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)-- return __sync_fetch_and_and(&_value, value);--#elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)-- return __and_and_fetch(&_value, value);--#elif defined(_OPENTHREADS_ATOMIC_USE_SUN)-- return atomic_and_uint_nv(&_value, value);--#elif defined(_OPENTHREADS_ATOMIC_USE_MUTEX)-- ScopedLock<Mutex> lock(_mutex);-- _value &= value;-- return _value;--#else-- _value &= value;-- return _value;--#endif-+ return (_value &= value);- }-- _OPENTHREADS_ATOMIC_INLINE unsigned- Atomic::OR(unsigned value)- {--#if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)-- return __sync_fetch_and_or(&_value, value);--#elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)-- return __or_and_fetch(&_value, value);--#elif defined(_OPENTHREADS_ATOMIC_USE_SUN)-- return atomic_or_uint_nv(&_value, value);--#elif defined(_OPENTHREADS_ATOMIC_USE_MUTEX)-- ScopedLock<Mutex> lock(_mutex);-- _value |= value;-- return _value;--#else-- _value |= value;-- return _value;--#endif-+ return (_value |= value);- }-- _OPENTHREADS_ATOMIC_INLINE unsigned- Atomic::XOR(unsigned value)- {--#if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)-- return __sync_fetch_and_xor(&_value, value);--#elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)-- return __xor_and_fetch(&_value, value);--#elif defined(_OPENTHREADS_ATOMIC_USE_SUN)-- ScopedLock<Mutex> lock(_mutex);-- _value ^= value;-- return _value;--#elif defined(_OPENTHREADS_ATOMIC_USE_MUTEX)-- ScopedLock<Mutex> lock(_mutex);-- _value ^= value;-- return _value;--#else-- _value ^= value;-- return _value;--#endif-+ return (_value ^= value);- }-- _OPENTHREADS_ATOMIC_INLINE unsigned- Atomic::exchange(unsigned value)- {--#if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)-- return __sync_lock_test_and_set(&_value, value);--#elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)-- return __compare_and_swap(&_value, _value, value);--#elif defined(_OPENTHREADS_ATOMIC_USE_SUN)-- return atomic_cas_uint(&_value, _value, value);--#elif defined(_OPENTHREADS_ATOMIC_USE_MUTEX)-- ScopedLock<Mutex> lock(_mutex);-- unsigned oldval = _value;-- _value = value;-- return oldval;--#else-- unsigned oldval = _value;-- _value = value;-- return oldval;--#endif-+ return _value.exchange(value);- }-- _OPENTHREADS_ATOMIC_INLINE- Atomic::operator unsigned() const- {--#if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)-- __sync_synchronize();-- return _value;--#elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)-- __synchronize();-- return _value;--#elif defined(_OPENTHREADS_ATOMIC_USE_SUN)-- membar_consumer(); // Hmm, do we need???-- return _value;--#elif defined(_OPENTHREADS_ATOMIC_USE_MUTEX)-- ScopedLock<Mutex> lock(_mutex);-- return _value;--#else- return _value;--#endif- }-- _OPENTHREADS_ATOMIC_INLINE bool- AtomicPtr::assign(void* ptrNew, const void* const ptrOld)- {--#if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)-- return __sync_bool_compare_and_swap(&_ptr, (void *)ptrOld, ptrNew);--#elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)-- return __compare_and_swap((unsigned long*)&_ptr, (unsigned long)ptrOld, (unsigned long)ptrNew);--#elif defined(_OPENTHREADS_ATOMIC_USE_SUN)-- return ptrOld == atomic_cas_ptr(&_ptr, const_cast<void*>(ptrOld), ptrNew);--#elif defined(_OPENTHREADS_ATOMIC_USE_MUTEX)-- ScopedLock<Mutex> lock(_mutex);-- if (_ptr != ptrOld)-- return false;-- _ptr = ptrNew;-- return true;--#else-- if (_ptr != ptrOld)-- return false;-- _ptr = ptrNew;-- return true;--#endif-+ void *old = (void*) ptrOld;-+ return _ptr.compare_exchange_strong(old, ptrNew);- }-- _OPENTHREADS_ATOMIC_INLINE void*- AtomicPtr::get() const- {--#if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)-- __sync_synchronize();-- return _ptr;--#elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)-- __synchronize();- return _ptr;--#elif defined(_OPENTHREADS_ATOMIC_USE_SUN)-- membar_consumer(); // Hmm, do we need???-- return _ptr;--#elif defined(_OPENTHREADS_ATOMIC_USE_MUTEX)-- ScopedLock<Mutex> lock(_mutex);-- return _ptr;--#else-- return _ptr;--#endif- }-- #endif // !defined(_OPENTHREADS_ATOMIC_USE_LIBRARY_ROUTINES)-diff --git a/src/OpenThreads/common/Atomic.cpp b/src/OpenThreads/common/Atomic.cpp-index 21c336435..84fec8e78 100644---- a/src/OpenThreads/common/Atomic.cpp-+++ b/src/OpenThreads/common/Atomic.cpp-@@ -25,6 +25,8 @@ namespace OpenThreads {-- #if defined(_OPENTHREADS_ATOMIC_USE_LIBRARY_ROUTINES)--+ #error Not supported.-+- // Non inline implementations for two special cases:- // * win32- // * i386 gcc----2.19.2-diff --git a/android/buildscripts/patches/osg/0002-BufferObject-make-numClients-atomic.patch b/android/buildscripts/patches/osg/0002-BufferObject-make-numClients-atomic.patchdeleted file mode 100644index 9027cc8..0000000--- a/android/buildscripts/patches/osg/0002-BufferObject-make-numClients-atomic.patch+++ /dev/null@@ -1,34 +0,0 @@-From 6245c7c8c9ff785ad7ab3a5b207adc63aea6f3f0 Mon Sep 17 00:00:00 2001-From: Ilya Zhuravlev <[email protected]>-Date: Sun, 10 Feb 2019 16:01:06 -0500-Subject: [PATCH 2/5] BufferObject: make numClients atomic--This is just to silence tsan in openmw, it is not the right way to do this.----- include/osg/BufferObject | 3 ++-- 1 file changed, 2 insertions(+), 1 deletion(-)--diff --git a/include/osg/BufferObject b/include/osg/BufferObject-index 3ec365544..cc4128aac 100644---- a/include/osg/BufferObject-+++ b/include/osg/BufferObject-@@ -22,6 +22,7 @@- #include <osg/FrameStamp>- #include <osg/GLObjects>--+#include <atomic>- #include <iosfwd>- #include <list>- #include <map>-@@ -590,7 +591,7 @@ protected:- osg::ref_ptr<BufferObject> _bufferObject;- osg::ref_ptr<ModifiedCallback> _modifiedCallback;--- unsigned int _numClients;-+ std::atomic<unsigned> _numClients;- };------2.19.2-diff --git a/android/buildscripts/patches/osg/0004-IncrementalCompileOperation-wrap-some-stuff-in-atomi.patch b/android/buildscripts/patches/osg/0004-IncrementalCompileOperation-wrap-some-stuff-in-atomi.patchdeleted file mode 100644index d843dfb..0000000--- a/android/buildscripts/patches/osg/0004-IncrementalCompileOperation-wrap-some-stuff-in-atomi.patch+++ /dev/null@@ -1,40 +0,0 @@-From f25d67c91a7d6c816d6be0fafcef636c61354937 Mon Sep 17 00:00:00 2001-From: Ilya Zhuravlev <[email protected]>-Date: Sun, 10 Feb 2019 19:30:55 -0500-Subject: [PATCH 4/5] IncrementalCompileOperation: wrap some stuff in atomic<>- to pacify tsan------ include/osgUtil/IncrementalCompileOperation | 6 ++++--- 1 file changed, 4 insertions(+), 2 deletions(-)--diff --git a/include/osgUtil/IncrementalCompileOperation b/include/osgUtil/IncrementalCompileOperation-index 25f141976..a4ffa3356 100644---- a/include/osgUtil/IncrementalCompileOperation-+++ b/include/osgUtil/IncrementalCompileOperation-@@ -14,6 +14,8 @@- #ifndef OSGUTIL_INCREMENTALCOMPILEOPERATOR- #define OSGUTIL_INCREMENTALCOMPILEOPERATOR--+#include <atomic>-+- #include <osgUtil/GLObjectsVisitor>- #include <osg/Geometry>--@@ -305,11 +307,11 @@ class OSGUTIL_EXPORT IncrementalCompileOperation : public osg::GraphicsOperation-- double _targetFrameRate;- double _minimumTimeAvailableForGLCompileAndDeletePerFrame;-- unsigned int _maximumNumOfObjectsToCompilePerFrame;-+ std::atomic<unsigned> _maximumNumOfObjectsToCompilePerFrame;- double _flushTimeRatio;- double _conservativeTimeRatio;--- unsigned int _currentFrameNumber;-+ std::atomic<unsigned> _currentFrameNumber;- unsigned int _compileAllTillFrameNumber;-- osg::ref_ptr<osg::Geometry> _forceTextureDownloadGeometry;----2.19.2-diff --git a/android/buildscripts/patches/osg/0005-CullSettings-make-inheritanceMask-atomic-to-silence-.patch b/android/buildscripts/patches/osg/0005-CullSettings-make-inheritanceMask-atomic-to-silence-.patchdeleted file mode 100644index 2755c3f..0000000--- a/android/buildscripts/patches/osg/0005-CullSettings-make-inheritanceMask-atomic-to-silence-.patch+++ /dev/null@@ -1,47 +0,0 @@-From e9e0ab48eab9f6b896d7ea1b6d602f8c8e001974 Mon Sep 17 00:00:00 2001-From: Ilya Zhuravlev <[email protected]>-Date: Sun, 10 Feb 2019 20:00:38 -0500-Subject: [PATCH 5/5] CullSettings: make inheritanceMask atomic to silence tsan------ include/osg/CullSettings | 3 ++-- src/osg/CullSettings.cpp | 2 +-- 2 files changed, 3 insertions(+), 2 deletions(-)--diff --git a/include/osg/CullSettings b/include/osg/CullSettings-index c61fe9138..6c72ef667 100644---- a/include/osg/CullSettings-+++ b/include/osg/CullSettings-@@ -14,6 +14,7 @@- #ifndef OSG_CULLSETTINGS- #define OSG_CULLSETTINGS 1--+#include <atomic>- #include <iosfwd>- #include <osg/Matrix>- #include <osg/ClearNode>-@@ -248,7 +249,7 @@ class OSG_EXPORT CullSettings-- protected:--- InheritanceMask _inheritanceMask;-+ std::atomic<InheritanceMask> _inheritanceMask;- InheritanceMaskActionOnAttributeSetting _inheritanceMaskActionOnAttributeSetting;-- ComputeNearFarMode _computeNearFar;-diff --git a/src/osg/CullSettings.cpp b/src/osg/CullSettings.cpp-index 800ada83c..5265dbd05 100644---- a/src/osg/CullSettings.cpp-+++ b/src/osg/CullSettings.cpp-@@ -52,7 +52,7 @@ void CullSettings::setDefaults()-- void CullSettings::setCullSettings(const CullSettings& rhs)- {-- _inheritanceMask = rhs._inheritanceMask;-+ _inheritanceMask = rhs._inheritanceMask.load();- _inheritanceMaskActionOnAttributeSetting = rhs._inheritanceMaskActionOnAttributeSetting;-- _computeNearFar = rhs._computeNearFar;----2.19.2-diff --git a/android/buildscripts/patches/osg/android-shadow-texture-compat.patch b/android/buildscripts/patches/osg/android-shadow-texture-compat.patchdeleted file mode 100644index 323f159..0000000--- a/android/buildscripts/patches/osg/android-shadow-texture-compat.patch+++ /dev/null@@ -1,22 +0,0 @@---- a/src/osg/Texture.cpp-+++ b/src/osg/Texture.cpp-@@ -2201,6 +2201,7 @@ void Texture::applyTexParameters(GLenum target, State& state) const- (target == GL_TEXTURE_2D || target == GL_TEXTURE_1D || target == GL_TEXTURE_RECTANGLE || target == GL_TEXTURE_CUBE_MAP || target == GL_TEXTURE_2D_ARRAY ) &&- _internalFormatType != SIGNED_INTEGER && _internalFormatType != UNSIGNED_INTEGER)- {-+#if !defined(ANDROID) && !defined(__ANDROID__)- if (_use_shadow_comparison)- {- glTexParameteri(target, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB);-@@ -2221,6 +2222,11 @@ void Texture::applyTexParameters(GLenum target, State& state) const- {- glTexParameteri(target, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE);- }-+#else-+ // OPENMW_ANDROID_GLES2_MANUAL_SHADOW_COMPARE-+ // GLES2 has no desktop ARB shadow-compare texture state. OpenMW samples-+ // OES depth textures normally and performs the comparison in GLSL.-+#endif- }- // if range is valid- if( _maxlod - _minlod >= 0)diff --git a/android/buildscripts/patches/osg/dae_collada.patch b/android/buildscripts/patches/osg/dae_collada.patchdeleted file mode 100644index 579700b..0000000--- a/android/buildscripts/patches/osg/dae_collada.patch+++ /dev/null@@ -1,22 +0,0 @@--diff --git a/CMakeModules/FindCOLLADA.cmake b/CMakeModules/FindCOLLADA.cmake-index 7c7d29053..82e45af3c 100644---- a/CMakeModules/FindCOLLADA.cmake-+++ b/CMakeModules/FindCOLLADA.cmake-@@ -19,7 +19,7 @@ SET( COLLADA_ENV_VAR_AVAILABLE $ENV{COLLADA_DIR} )- IF ( COLLADA_ENV_VAR_AVAILABLE )- SET(COLLADA_DOM_ROOT "$ENV{COLLADA_DIR}/dom" CACHE PATH "Location of Collada DOM directory" FORCE)- ELSE ()-- SET(COLLADA_DOM_ROOT "${ACTUAL_3DPARTY_DIR}/include/1.4/dom" CACHE PATH "Location of Collada DOM directory" FORCE)-+ SET(COLLADA_DOM_ROOT "${ACTUAL_3DPARTY_DIR}/include/collada-dom2.5/1.4/dom" CACHE PATH "Location of Collada DOM directory" FORCE)- ENDIF()---@@ -89,6 +89,7 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h- /opt/include- /usr/freeware/include- ${ACTUAL_3DPARTY_DIR}/include-+ ${ACTUAL_3DPARTY_DIR}/include/collada-dom2.5/- )-- FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARYdiff --git a/android/buildscripts/patches/osg/disable-polygon-offset.patch b/android/buildscripts/patches/osg/disable-polygon-offset.patchdeleted file mode 100644index f590577..0000000--- a/android/buildscripts/patches/osg/disable-polygon-offset.patch+++ /dev/null@@ -1,15 +0,0 @@-diff --git a/include/osg/PolygonOffset b/include/osg/PolygonOffset-index 15ad397e9..613222a03 100644---- a/include/osg/PolygonOffset-+++ b/include/osg/PolygonOffset-@@ -57,10 +57,6 @@ class OSG_EXPORT PolygonOffset : public StateAttribute- virtual bool getModeUsage(StateAttribute::ModeUsage& usage) const- {- usage.usesMode(GL_POLYGON_OFFSET_FILL);--#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)-- usage.usesMode(GL_POLYGON_OFFSET_LINE);-- usage.usesMode(GL_POLYGON_OFFSET_POINT);--#endif- return true;- }-diff --git a/android/buildscripts/patches/osg/fix-freetype-include-dirs.patch b/android/buildscripts/patches/osg/fix-freetype-include-dirs.patchdeleted file mode 100644index fcca956..0000000--- a/android/buildscripts/patches/osg/fix-freetype-include-dirs.patch+++ /dev/null@@ -1,13 +0,0 @@-diff --git a/CMakeModules/OsgAndroidMacroUtils.cmake b/CMakeModules/OsgAndroidMacroUtils.cmake-index 50c22e0f1..e8453208f 100644---- a/CMakeModules/OsgAndroidMacroUtils.cmake-+++ b/CMakeModules/OsgAndroidMacroUtils.cmake-@@ -163,7 +163,7 @@ MACRO(ANDROID_3RD_PARTY)- )- #set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libft2")- #set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${FREETYPE_DIR}/Android.mk \n")-- set(FREETYPE_INCLUDE_DIRS ${FREETYPE_DIR}/include ${FREETYPE_DIR}/include/freetype/config)-+ set(FREETYPE_INCLUDE_DIRS ${FREETYPE_DIR}/include ${FREETYPE_DIR}/include/freetype2)- if(FREETYPE_DIR)- message(STATUS "FREETYPE found ${FREETYPE_DIR}" )- set(FREETYPE_FOUND "Yes")diff --git a/android/buildscripts/patches/osg/force-add-plugins.patch b/android/buildscripts/patches/osg/force-add-plugins.patchdeleted file mode 100644index 92398c7..0000000--- a/android/buildscripts/patches/osg/force-add-plugins.patch+++ /dev/null@@ -1,29 +0,0 @@-diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt-index 277dbebd5..4ed55dacb 100644---- a/src/osgPlugins/CMakeLists.txt-+++ b/src/osgPlugins/CMakeLists.txt-@@ -111,7 +111,7 @@ ENDIF()- IF(GIFLIB_FOUND)- ADD_PLUGIN_DIRECTORY(gif)- ENDIF()--IF(PNG_FOUND AND ZLIB_FOUND)-+IF(PNG_FOUND)- ADD_PLUGIN_DIRECTORY(png)- ENDIF()- IF(TIFF_FOUND)-@@ -161,9 +161,13 @@ IF(NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE)- ENDIF()- ENDIF()---IF(COLLADA_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE)-+#fix me-+#IF(COLLADA_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE)-+# ADD_PLUGIN_DIRECTORY(dae)-+#ENDIF()-+-+ SET(COLLADA_DOM_2_4_OR_LATER TRUE)- ADD_PLUGIN_DIRECTORY(dae)--ENDIF()-- IF(FBX_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE)- ADD_PLUGIN_DIRECTORY(fbx)diff --git a/android/buildscripts/patches/osg/psa.patch b/android/buildscripts/patches/osg/psa.patchdeleted file mode 100644index cfedaaa..0000000--- a/android/buildscripts/patches/osg/psa.patch+++ /dev/null@@ -1,13 +0,0 @@-diff --git a/include/osg/Hint b/include/osg/Hint-index 274af53ce..222f74761 100644---- a/include/osg/Hint-+++ b/include/osg/Hint-@@ -68,6 +68,8 @@ public:-- virtual void apply(State& state) const;--+ static void GL4ES_SavePSA() { glHint(0xA10F, 0xA10F); };-+- protected:--diff --git a/android/buildscripts/patches/osg/remove-lib-prefix-from-plugins.patch b/android/buildscripts/patches/osg/remove-lib-prefix-from-plugins.patchdeleted file mode 100644index 3e4ad3a..0000000--- a/android/buildscripts/patches/osg/remove-lib-prefix-from-plugins.patch+++ /dev/null@@ -1,15 +0,0 @@-diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake-index 120f7f602..93f6cb4ec 100644---- a/CMakeModules/OsgMacroUtils.cmake-+++ b/CMakeModules/OsgMacroUtils.cmake-@@ -286,6 +286,10 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)- ADD_LIBRARY(${TARGET_TARGETNAME} STATIC ${TARGET_SRC} ${TARGET_H})- ENDIF(DYNAMIC_OPENSCENEGRAPH)--+ # XXX: remove the "lib" prefix e.g. "libosgdb_bmp.a" => "osgdb_bmp.a"-+ # for some reason this is only a problem on android-+ SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "")-+- IF(MSVC)- IF(NOT CMAKE24)- SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "${OSG_PLUGINS}") # Sets the ouput to be /osgPlugin-X.X.X ; also ensures the /Debug /Release are removeddiff --git a/android/buildscripts/patches/osg/remove-zlib-dependency.patch b/android/buildscripts/patches/osg/remove-zlib-dependency.patchdeleted file mode 100644index b156333..0000000--- a/android/buildscripts/patches/osg/remove-zlib-dependency.patch+++ /dev/null@@ -1,13 +0,0 @@-diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt-index 277dbebd5..4982847ce 100644---- a/src/osgPlugins/CMakeLists.txt-+++ b/src/osgPlugins/CMakeLists.txt-@@ -111,7 +111,7 @@ ENDIF()- IF(GIFLIB_FOUND)- ADD_PLUGIN_DIRECTORY(gif)- ENDIF()--IF(PNG_FOUND AND ZLIB_FOUND)-+IF(PNG_FOUND)- ADD_PLUGIN_DIRECTORY(png)- ENDIF()- IF(TIFF_FOUND)diff --git a/android/buildscripts/patches/sdl2-android-120hz-gyroscope.patch b/android/buildscripts/patches/sdl2-android-120hz-gyroscope.patchdeleted file mode 100644index dc88a11..0000000--- a/android/buildscripts/patches/sdl2-android-120hz-gyroscope.patch+++ /dev/null@@ -1,18 +0,0 @@-diff --git a/src/sensor/android/SDL_androidsensor.c b/src/sensor/android/SDL_androidsensor.c-index d7c0a7e2d..a8018d8a3 100644---- a/src/sensor/android/SDL_androidsensor.c-+++ b/src/sensor/android/SDL_androidsensor.c-@@ -149,7 +149,12 @@ SDL_ANDROID_SensorOpen(SDL_Sensor *sensor, int device_index)- return SDL_SetError("Couldn't enable sensor");- }--- /* FIXME: What rate should we set for this sensor? 60 FPS? Let's try the default rate for now... */-+ {-+ int delay = ASensor_getMinDelay(hwdata->asensor);-+ /* No need to update gyroscope faster than 120 Hz */-+ delay = SDL_max(delay, 8333);-+ ASensorEventQueue_setEventRate(hwdata->eventqueue, hwdata->asensor, delay);-+ }-- sensor->hwdata = hwdata;- return 0;diff --git a/android/buildscripts/patches/sdl2-disable-gamma-warning.patch b/android/buildscripts/patches/sdl2-disable-gamma-warning.patchdeleted file mode 100644index 3fc41d0..0000000--- a/android/buildscripts/patches/sdl2-disable-gamma-warning.patch+++ /dev/null@@ -1,13 +0,0 @@-diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c-index 371a6e54c..747c0b45c 100644---- a/src/video/SDL_video.c-+++ b/src/video/SDL_video.c-@@ -2623,7 +2623,7 @@ SDL_SetWindowGammaRamp(SDL_Window * window, const Uint16 * red,- CHECK_WINDOW_MAGIC(window, -1);-- if (!_this->SetWindowGammaRamp) {-- return SDL_Unsupported();-+ return 0/*SDL_Unsupported()*/;- }-- if (!window->gamma) {diff --git a/android/buildscripts/patches/zliblld.patch b/android/buildscripts/patches/zliblld.patchdeleted file mode 100644index 1fdeac6..0000000--- a/android/buildscripts/patches/zliblld.patch+++ /dev/null@@ -1,56 +0,0 @@-From 01253ecd7e0a01d311670f2d03c61b82fc12d338 Mon Sep 17 00:00:00 2001-From: Milan Bulat <[email protected]>-Date: Mon, 9 Oct 2023 17:04:51 +0400-Subject: [PATCH] Make the existence of gz_intmax() unconditional.--gz_intmax() is noted in zlib.map. This assures it's always there.----- gzguts.h | 6 +------ gzlib.c | 10 +++++------ 2 files changed, 6 insertions(+), 10 deletions(-)--diff --git a/gzguts.h b/gzguts.h-index f9375047e..adc2b34fe 100644---- a/gzguts.h-+++ b/gzguts.h-@@ -210,9 +210,5 @@ char ZLIB_INTERNAL *gz_strwinerror(DWORD error);- /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t- value -- needed when comparing unsigned to z_off64_t, which is signed- (possible z_off64_t types off_t, off64_t, and long are all signed) */--#ifdef INT_MAX--# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)--#else- unsigned ZLIB_INTERNAL gz_intmax(void);--# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())--#endif-+#define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())-diff --git a/gzlib.c b/gzlib.c-index 29fc4486f..9c103dbd1 100644---- a/gzlib.c-+++ b/gzlib.c-@@ -563,20 +563,20 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) {- #endif- }---#ifndef INT_MAX- /* portably return maximum value for an int (when limits.h presumed not- available) -- we need to do this to cover cases where 2's complement not- used, since C standard permits 1's complement and sign-bit representations,- otherwise we could just use ((unsigned)-1) >> 1 */- unsigned ZLIB_INTERNAL gz_intmax(void) {-- unsigned p, q;---- p = 1;-+#ifdef INT_MAX-+ return INT_MAX;-+#else-+ unsigned p = 1, q;- do {- q = p;- p <<= 1;- p++;- } while (p > q);- return q >> 1;--}- #endif-+}diff --git a/android/buildscripts/ssh-build.sh b/android/buildscripts/ssh-build.shdeleted file mode 100755index d47388c..0000000--- a/android/buildscripts/ssh-build.sh+++ /dev/null@@ -1,70 +0,0 @@-#!/bin/bash--set -e--REMOTE=$1-PEM=$2--CMAKE_VERSION="3.18.4"-CMAKE_HASH="149e0cee002e59e0bb84543cf3cb099f108c08390392605e944daeb6594cbc29"--if [[ $REMOTE = "" || $PEM = "" ]]; then- echo "Usage: ./ssh-build.sh HOST-IP PEM-FILE"- exit 1-fi--append() {- echo $1 >> tmp_script.sh-}--CMAKE_DIR="cmake-$CMAKE_VERSION-Linux-x86_64"-CMAKE_FILE="$CMAKE_DIR.tar.gz"--rm -rf ../app/src/main/jniLibs/-rm -rf ../app/wrap/--echo "==> Build on $1 using $2 as the key..."--echo "" > tmp_script.sh-append "#!/bin/bash"-append "set -e"-append "sudo apt -y update"-append "sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -yq"-append "sudo apt -y install build-essential gcc-multilib htop python unzip pkg-config p7zip-full"-append "sudo umount /mnt || true"-append "sudo mount -t tmpfs -o size=64G tmpfs /mnt"-append "wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/$CMAKE_FILE"-append "echo '$CMAKE_HASH $CMAKE_FILE' | sha256sum -c - || exit 1"-append "tar xvf $CMAKE_FILE"-append "cd /home/ubuntu/"-append "export PATH=/home/ubuntu/$CMAKE_DIR/bin/:\$PATH"-append "cd /mnt"-append "git clone https://github.com/xyzz/openmw-android.git"-append "cd openmw-android/buildscripts"-append "git checkout $(git rev-parse HEAD)"-append "time ./full-build.sh"-append "./package-symbols.sh"--echo "==> Uploading the script"--scp -i $PEM tmp_script.sh ubuntu@$REMOTE:/home/ubuntu/--echo "==> Running the script"-ssh -i $PEM -o ServerAliveInterval=60 ubuntu@$REMOTE "bash tmp_script.sh"--echo "==> Retrieving the libraries"-scp -r -i $PEM ubuntu@$REMOTE:/mnt/openmw-android/app/src/main/jniLibs ../app/src/main/--rm -rf ../app/src/main/assets/libopenmw/-echo "==> Retrieving the resources"-scp -r -i $PEM ubuntu@$REMOTE:/mnt/openmw-android/app/src/main/assets/libopenmw ../app/src/main/assets/--echo "==> Retrieving the symbols"-rm -f symbols.7z-scp -r -i $PEM ubuntu@$REMOTE:/mnt/openmw-android/buildscripts/symbols.7z .--echo "==> Extracting the symbols"-rm -rf symbols-7z x symbols.7z--echo "==> All OK!"diff --git a/android/buildscripts/tool/asan_symbolize.py b/android/buildscripts/tool/asan_symbolize.pydeleted file mode 100644index 8aca068..0000000--- a/android/buildscripts/tool/asan_symbolize.py+++ /dev/null@@ -1,490 +0,0 @@-#!/usr/bin/env python-#===- lib/asan/scripts/asan_symbolize.py -----------------------------------===#-#-# The LLVM Compiler Infrastructure-#-# This file is distributed under the University of Illinois Open Source-# License. See LICENSE.TXT for details.-#-#===------------------------------------------------------------------------===#-import argparse-import bisect-import getopt-import os-import re-import subprocess-import sys--symbolizers = {}-DEBUG = False-demangle = False-binutils_prefix = None-sysroot_path = None-binary_name_filter = None-fix_filename_patterns = None-logfile = sys.stdin-allow_system_symbolizer = True--# FIXME: merge the code that calls fix_filename().-def fix_filename(file_name):- if fix_filename_patterns:- for path_to_cut in fix_filename_patterns:- file_name = re.sub('.*' + path_to_cut, '', file_name)- file_name = re.sub('.*asan_[a-z_]*.cc:[0-9]*', '_asan_rtl_', file_name)- file_name = re.sub('.*crtstuff.c:0', '???:0', file_name)- return file_name--def sysroot_path_filter(binary_name):- return sysroot_path + os.path.basename(binary_name)--def guess_arch(addr):- # Guess which arch we're running. 10 = len('0x') + 8 hex digits.- if len(addr) > 10:- return 'x86_64'- else:- return 'i386'--class Symbolizer(object):- def __init__(self):- pass-- def symbolize(self, addr, binary, offset):- """Symbolize the given address (pair of binary and offset).-- Overriden in subclasses.- Args:- addr: virtual address of an instruction.- binary: path to executable/shared object containing this instruction.- offset: instruction offset in the @binary.- Returns:- list of strings (one string for each inlined frame) describing- the code locations for this instruction (that is, function name, file- name, line and column numbers).- """- return None---class LLVMSymbolizer(Symbolizer):- def __init__(self, symbolizer_path, default_arch, system, dsym_hints=[]):- super(LLVMSymbolizer, self).__init__()- self.symbolizer_path = symbolizer_path- self.default_arch = default_arch- self.system = system- self.dsym_hints = dsym_hints- self.pipe = self.open_llvm_symbolizer()-- def open_llvm_symbolizer(self):- cmd = [self.symbolizer_path,- '--use-symbol-table=true',- '--demangle=%s' % demangle,- '--functions=linkage',- '--inlining=true',- '--default-arch=%s' % self.default_arch]- if self.system == 'Darwin':- for hint in self.dsym_hints:- cmd.append('--dsym-hint=%s' % hint)- if DEBUG:- print ' '.join(cmd)- try:- result = subprocess.Popen(cmd, stdin=subprocess.PIPE,- stdout=subprocess.PIPE)- except OSError:- result = None- return result-- def symbolize(self, addr, binary, offset):- """Overrides Symbolizer.symbolize."""- if not self.pipe:- return None- result = []- try:- symbolizer_input = '"%s" %s' % (binary, offset)- if DEBUG:- print symbolizer_input- print >> self.pipe.stdin, symbolizer_input- while True:- function_name = self.pipe.stdout.readline().rstrip()- if not function_name:- break- file_name = self.pipe.stdout.readline().rstrip()- file_name = fix_filename(file_name)- if (not function_name.startswith('??') or- not file_name.startswith('??')):- # Append only non-trivial frames.- result.append('%s in %s %s' % (addr, function_name,- file_name))- except Exception:- result = []- if not result:- result = None- return result---def LLVMSymbolizerFactory(system, default_arch, dsym_hints=[]):- symbolizer_path = os.getenv('LLVM_SYMBOLIZER_PATH')- if not symbolizer_path:- symbolizer_path = os.getenv('ASAN_SYMBOLIZER_PATH')- if not symbolizer_path:- # Assume llvm-symbolizer is in PATH.- symbolizer_path = 'llvm-symbolizer'- return LLVMSymbolizer(symbolizer_path, default_arch, system, dsym_hints)---class Addr2LineSymbolizer(Symbolizer):- def __init__(self, binary):- super(Addr2LineSymbolizer, self).__init__()- self.binary = binary- self.pipe = self.open_addr2line()- self.output_terminator = -1-- def open_addr2line(self):- addr2line_tool = 'addr2line'- if binutils_prefix:- addr2line_tool = binutils_prefix + addr2line_tool- cmd = [addr2line_tool, '-fi']- if demangle:- cmd += ['--demangle']- cmd += ['-e', self.binary]- if DEBUG:- print ' '.join(cmd)- return subprocess.Popen(cmd,- stdin=subprocess.PIPE, stdout=subprocess.PIPE)-- def symbolize(self, addr, binary, offset):- """Overrides Symbolizer.symbolize."""- if self.binary != binary:- return None- lines = []- try:- print >> self.pipe.stdin, offset- print >> self.pipe.stdin, self.output_terminator- is_first_frame = True- while True:- function_name = self.pipe.stdout.readline().rstrip()- file_name = self.pipe.stdout.readline().rstrip()- if is_first_frame:- is_first_frame = False- elif function_name in ['', '??']:- assert file_name == function_name- break- lines.append((function_name, file_name));- except Exception:- lines.append(('??', '??:0'))- return ['%s in %s %s' % (addr, function, fix_filename(file)) for (function, file) in lines]--class UnbufferedLineConverter(object):- """- Wrap a child process that responds to each line of input with one line of- output. Uses pty to trick the child into providing unbuffered output.- """- def __init__(self, args, close_stderr=False):- # Local imports so that the script can start on Windows.- import pty- import termios- pid, fd = pty.fork()- if pid == 0:- # We're the child. Transfer control to command.- if close_stderr:- dev_null = os.open('/dev/null', 0)- os.dup2(dev_null, 2)- os.execvp(args[0], args)- else:- # Disable echoing.- attr = termios.tcgetattr(fd)- attr[3] = attr[3] & ~termios.ECHO- termios.tcsetattr(fd, termios.TCSANOW, attr)- # Set up a file()-like interface to the child process- self.r = os.fdopen(fd, "r", 1)- self.w = os.fdopen(os.dup(fd), "w", 1)-- def convert(self, line):- self.w.write(line + "\n")- return self.readline()-- def readline(self):- return self.r.readline().rstrip()---class DarwinSymbolizer(Symbolizer):- def __init__(self, addr, binary):- super(DarwinSymbolizer, self).__init__()- self.binary = binary- self.arch = guess_arch(addr)- self.open_atos()-- def open_atos(self):- if DEBUG:- print 'atos -o %s -arch %s' % (self.binary, self.arch)- cmdline = ['atos', '-o', self.binary, '-arch', self.arch]- self.atos = UnbufferedLineConverter(cmdline, close_stderr=True)-- def symbolize(self, addr, binary, offset):- """Overrides Symbolizer.symbolize."""- if self.binary != binary:- return None- atos_line = self.atos.convert('0x%x' % int(offset, 16))- while "got symbolicator for" in atos_line:- atos_line = self.atos.readline()- # A well-formed atos response looks like this:- # foo(type1, type2) (in object.name) (filename.cc:80)- match = re.match('^(.*) \(in (.*)\) \((.*:\d*)\)$', atos_line)- if DEBUG:- print 'atos_line: ', atos_line- if match:- function_name = match.group(1)- function_name = re.sub('\(.*?\)', '', function_name)- file_name = fix_filename(match.group(3))- return ['%s in %s %s' % (addr, function_name, file_name)]- else:- return ['%s in %s' % (addr, atos_line)]---# Chain several symbolizers so that if one symbolizer fails, we fall back-# to the next symbolizer in chain.-class ChainSymbolizer(Symbolizer):- def __init__(self, symbolizer_list):- super(ChainSymbolizer, self).__init__()- self.symbolizer_list = symbolizer_list-- def symbolize(self, addr, binary, offset):- """Overrides Symbolizer.symbolize."""- for symbolizer in self.symbolizer_list:- if symbolizer:- result = symbolizer.symbolize(addr, binary, offset)- if result:- return result- return None-- def append_symbolizer(self, symbolizer):- self.symbolizer_list.append(symbolizer)---def BreakpadSymbolizerFactory(binary):- suffix = os.getenv('BREAKPAD_SUFFIX')- if suffix:- filename = binary + suffix- if os.access(filename, os.F_OK):- return BreakpadSymbolizer(filename)- return None---def SystemSymbolizerFactory(system, addr, binary):- if system == 'Darwin':- return DarwinSymbolizer(addr, binary)- elif system == 'Linux' or system == 'FreeBSD':- return Addr2LineSymbolizer(binary)---class BreakpadSymbolizer(Symbolizer):- def __init__(self, filename):- super(BreakpadSymbolizer, self).__init__()- self.filename = filename- lines = file(filename).readlines()- self.files = []- self.symbols = {}- self.address_list = []- self.addresses = {}- # MODULE mac x86_64 A7001116478B33F18FF9BEDE9F615F190 t- fragments = lines[0].rstrip().split()- self.arch = fragments[2]- self.debug_id = fragments[3]- self.binary = ' '.join(fragments[4:])- self.parse_lines(lines[1:])-- def parse_lines(self, lines):- cur_function_addr = ''- for line in lines:- fragments = line.split()- if fragments[0] == 'FILE':- assert int(fragments[1]) == len(self.files)- self.files.append(' '.join(fragments[2:]))- elif fragments[0] == 'PUBLIC':- self.symbols[int(fragments[1], 16)] = ' '.join(fragments[3:])- elif fragments[0] in ['CFI', 'STACK']:- pass- elif fragments[0] == 'FUNC':- cur_function_addr = int(fragments[1], 16)- if not cur_function_addr in self.symbols.keys():- self.symbols[cur_function_addr] = ' '.join(fragments[4:])- else:- # Line starting with an address.- addr = int(fragments[0], 16)- self.address_list.append(addr)- # Tuple of symbol address, size, line, file number.- self.addresses[addr] = (cur_function_addr,- int(fragments[1], 16),- int(fragments[2]),- int(fragments[3]))- self.address_list.sort()-- def get_sym_file_line(self, addr):- key = None- if addr in self.addresses.keys():- key = addr- else:- index = bisect.bisect_left(self.address_list, addr)- if index == 0:- return None- else:- key = self.address_list[index - 1]- sym_id, size, line_no, file_no = self.addresses[key]- symbol = self.symbols[sym_id]- filename = self.files[file_no]- if addr < key + size:- return symbol, filename, line_no- else:- return None-- def symbolize(self, addr, binary, offset):- if self.binary != binary:- return None- res = self.get_sym_file_line(int(offset, 16))- if res:- function_name, file_name, line_no = res- result = ['%s in %s %s:%d' % (- addr, function_name, file_name, line_no)]- print result- return result- else:- return None---class SymbolizationLoop(object):- def __init__(self, binary_name_filter=None, dsym_hint_producer=None):- if sys.platform == 'win32':- # ASan on Windows uses dbghelp.dll to symbolize in-process, which works- # even in sandboxed processes. Nothing needs to be done here.- self.process_line = self.process_line_echo- else:- # Used by clients who may want to supply a different binary name.- # E.g. in Chrome several binaries may share a single .dSYM.- self.binary_name_filter = binary_name_filter- self.dsym_hint_producer = dsym_hint_producer- self.system = os.uname()[0]- if self.system not in ['Linux', 'Darwin', 'FreeBSD']:- raise Exception('Unknown system')- self.llvm_symbolizers = {}- self.last_llvm_symbolizer = None- self.dsym_hints = set([])- self.frame_no = 0- self.process_line = self.process_line_posix-- def symbolize_address(self, addr, binary, offset):- # On non-Darwin (i.e. on platforms without .dSYM debug info) always use- # a single symbolizer binary.- # On Darwin, if the dsym hint producer is present:- # 1. check whether we've seen this binary already; if so,- # use |llvm_symbolizers[binary]|, which has already loaded the debug- # info for this binary (might not be the case for- # |last_llvm_symbolizer|);- # 2. otherwise check if we've seen all the hints for this binary already;- # if so, reuse |last_llvm_symbolizer| which has the full set of hints;- # 3. otherwise create a new symbolizer and pass all currently known- # .dSYM hints to it.- if not binary in self.llvm_symbolizers:- use_new_symbolizer = True- if self.system == 'Darwin' and self.dsym_hint_producer:- dsym_hints_for_binary = set(self.dsym_hint_producer(binary))- use_new_symbolizer = bool(dsym_hints_for_binary - self.dsym_hints)- self.dsym_hints |= dsym_hints_for_binary- if self.last_llvm_symbolizer and not use_new_symbolizer:- self.llvm_symbolizers[binary] = self.last_llvm_symbolizer- else:- self.last_llvm_symbolizer = LLVMSymbolizerFactory(- self.system, guess_arch(addr), self.dsym_hints)- self.llvm_symbolizers[binary] = self.last_llvm_symbolizer- # Use the chain of symbolizers:- # Breakpad symbolizer -> LLVM symbolizer -> addr2line/atos- # (fall back to next symbolizer if the previous one fails).- if not binary in symbolizers:- symbolizers[binary] = ChainSymbolizer(- [BreakpadSymbolizerFactory(binary), self.llvm_symbolizers[binary]])- result = symbolizers[binary].symbolize(addr, binary, offset)- if result is None:- if not allow_system_symbolizer:- raise Exception('Failed to launch or use llvm-symbolizer.')- # Initialize system symbolizer only if other symbolizers failed.- symbolizers[binary].append_symbolizer(- SystemSymbolizerFactory(self.system, addr, binary))- result = symbolizers[binary].symbolize(addr, binary, offset)- # The system symbolizer must produce some result.- assert result- return result-- def get_symbolized_lines(self, symbolized_lines):- if not symbolized_lines:- return [self.current_line]- else:- result = []- for symbolized_frame in symbolized_lines:- result.append(' #%s %s' % (str(self.frame_no), symbolized_frame.rstrip()))- self.frame_no += 1- return result-- def process_logfile(self):- self.frame_no = 0- for line in logfile:- processed = self.process_line(line)- print '\n'.join(processed)-- def process_line_echo(self, line):- return [line.rstrip()]-- def process_line_posix(self, line):- self.current_line = line.rstrip()- #0 0x7f6e35cf2e45 (/blah/foo.so+0x11fe45)- stack_trace_line_format = (- '^.*wrap.sh.*( *#([0-9]+) *)(0x[0-9a-f]+) *\((.*)\+(0x[0-9a-f]+)\)')- match = re.match(stack_trace_line_format, line)- if not match:- return [self.current_line]- if DEBUG:- print line- _, frameno_str, addr, binary, offset = match.groups()- if frameno_str == '0':- # Assume that frame #0 is the first frame of new stack trace.- self.frame_no = 0- original_binary = binary- if self.binary_name_filter:- binary = self.binary_name_filter(binary)- symbolized_line = self.symbolize_address(addr, binary, offset)- if not symbolized_line:- if original_binary != binary:- symbolized_line = self.symbolize_address(addr, binary, offset)- return self.get_symbolized_lines(symbolized_line)---if __name__ == '__main__':- parser = argparse.ArgumentParser(- formatter_class=argparse.RawDescriptionHelpFormatter,- description='ASan symbolization script',- epilog='Example of use:\n'- 'asan_symbolize.py -c "$HOME/opt/cross/bin/arm-linux-gnueabi-" '- '-s "$HOME/SymbolFiles" < asan.log')- parser.add_argument('path_to_cut', nargs='*',- help='pattern to be cut from the result file path ')- parser.add_argument('-d','--demangle', action='store_true',- help='demangle function names')- parser.add_argument('-s', metavar='SYSROOT',- help='set path to sysroot for sanitized binaries')- parser.add_argument('-c', metavar='CROSS_COMPILE',- help='set prefix for binutils')- parser.add_argument('-l','--logfile', default=sys.stdin,- type=argparse.FileType('r'),- help='set log file name to parse, default is stdin')- args = parser.parse_args()- if args.path_to_cut:- fix_filename_patterns = args.path_to_cut- if args.demangle:- demangle = True- if args.s:- binary_name_filter = sysroot_path_filter- sysroot_path = args.s- if args.c:- binutils_prefix = args.c- if args.logfile:- logfile = args.logfile- else:- logfile = sys.stdin- loop = SymbolizationLoop(binary_name_filter)- loop.process_logfile()diff --git a/android/buildscripts/upload-symbols.py b/android/buildscripts/upload-symbols.pydeleted file mode 100644index 417294d..0000000--- a/android/buildscripts/upload-symbols.py+++ /dev/null@@ -1,119 +0,0 @@-#!/usr/bin/env python3--"""- Uploads native symbols to bugsnag.-"""--import os-import subprocess-import requests-import io-import datetime-from multiprocessing import Pool---def log(s):- print("[{}] {}".format(datetime.datetime.now(), s))---def find_version_code():- with open("../app/build.gradle", "r") as fin:- for line in fin.readlines():- line = line.strip()- if line.startswith("versionCode"):- return line.split()[1]---def find_app_id():- user_input = ""- while user_input not in ["y", "n"]:- user_input = input("Nightly? (y/n) ")- if user_input == "y":- return "is.xyz.omw_nightly"- return "is.xyz.omw"---def find_api_key():- with open("../app/src/main/java/utils/BugsnagApiKey.kt", "r") as fin:- for line in fin.readlines():- line = line.strip()- if line.startswith("const val API_KEY"):- return line.split(" = ")[1].replace('"', "")---def remove_if_exists(path):- if os.path.exists(path):- os.remove(path)---def do_symbol_file(args):- abi, so = args-- path = os.path.join("symbols", abi, so)-- log("[{}/{}] Generating symbols".format(abi, so))- filename = "{}_{}.txt".format(abi, so)- symbols_txt = os.path.join("tmp", filename)- symbols_gz = os.path.join("tmp", filename + ".gz")- remove_if_exists(symbols_txt)- remove_if_exists(symbols_gz)- with open(symbols_txt, "wb") as f:- subprocess.call(["objdump", "--dwarf=info", "--dwarf=rawline", os.path.join("symbols", abi, so)], stdout=f)-- log("[{}/{}] Compressing symbols".format(abi, so))- subprocess.check_output(["gzip", symbols_txt])-- files = {- 'soSymbolFile': (so + ".txt.gz", open(symbols_gz, "rb")),- 'apiKey': (None, api_key),- 'versionCode': (None, version_code),- 'appId': (None, app_id),- 'arch': (None, abi),- 'sharedObjectName': (None, so),- 'overwrite': (None, "1"),- }-- log("[{}/{}] Uploading ({:.2f} MB)".format(abi, so, os.path.getsize(symbols_gz) / 1024.0 / 1024.0))- response = requests.post('https://upload.bugsnag.com/', files=files)-- log("[{}/{}] Result: {} {}".format(abi, so, response.status_code, response.text))-- if response.status_code != 200:- raise RuntimeError("bugsnag api failed")-- remove_if_exists(symbols_txt)- remove_if_exists(symbols_gz)---def main():- global version_code- global app_id- global api_key-- version_code = find_version_code()- print("Version code: {}".format(version_code))-- app_id = find_app_id()- print("App ID: {}".format(app_id))-- api_key = find_api_key()- print("API key: {}".format(api_key))-- if len(api_key) == 0:- raise RuntimeError("No API key provided")-- print("")-- if not os.path.exists("tmp"):- os.makedirs("tmp")-- libraries = []- for abi in os.listdir("symbols"):- for so in os.listdir(os.path.join("symbols", abi)):- libraries.append((abi, so))-- with Pool(16) as p:- p.map(do_symbol_file, libraries)--if __name__ == "__main__":- main()diff --git a/android/gradle.properties b/android/gradle.propertiesdeleted file mode 100644index 1f65d0f..0000000--- a/android/gradle.properties+++ /dev/null@@ -1,9 +0,0 @@-android.enableJetifier=true-android.useAndroidX=true--# Preserve legacy resource behaviour while the old launcher is being stabilised.-android.nonTransitiveRClass=false-android.nonFinalResIds=false--kotlin.code.style=official-org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jardeleted file mode 100644index 8c0fb64..0000000Binary files a/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differdiff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.propertiesdeleted file mode 100644index 09523c0..0000000--- a/android/gradle/wrapper/gradle-wrapper.properties+++ /dev/null@@ -1,7 +0,0 @@-distributionBase=GRADLE_USER_HOME-distributionPath=wrapper/dists-distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip-networkTimeout=10000-validateDistributionUrl=true-zipStoreBase=GRADLE_USER_HOME-zipStorePath=wrapper/distsdiff --git a/android/gradlew b/android/gradlewdeleted file mode 100755index 91a7e26..0000000--- a/android/gradlew+++ /dev/null@@ -1,164 +0,0 @@-#!/usr/bin/env bash--##############################################################################-##-## Gradle start up script for UN*X-##-##############################################################################--# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.-DEFAULT_JVM_OPTS=""--APP_NAME="Gradle"-APP_BASE_NAME=`basename "$0"`--# Use the maximum available, or set MAX_FD != -1 to use that value.-MAX_FD="maximum"--warn ( ) {- echo "$*"-}--die ( ) {- echo- echo "$*"- echo- exit 1-}--# OS specific support (must be 'true' or 'false').-cygwin=false-msys=false-darwin=false-case "`uname`" in- CYGWIN* )- cygwin=true- ;;- Darwin* )- darwin=true- ;;- MINGW* )- msys=true- ;;-esac--# For Cygwin, ensure paths are in UNIX format before anything is touched.-if $cygwin ; then- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`-fi--# Attempt to set APP_HOME-# Resolve links: $0 may be a link-PRG="$0"-# Need this for relative symlinks.-while [ -h "$PRG" ] ; do- ls=`ls -ld "$PRG"`- link=`expr "$ls" : '.*-> \(.*\)$'`- if expr "$link" : '/.*' > /dev/null; then- PRG="$link"- else- PRG=`dirname "$PRG"`"/$link"- fi-done-SAVED="`pwd`"-cd "`dirname \"$PRG\"`/" >&--APP_HOME="`pwd -P`"-cd "$SAVED" >&---CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar--# Determine the Java command to use to start the JVM.-if [ -n "$JAVA_HOME" ] ; then- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then- # IBM's JDK on AIX uses strange locations for the executables- JAVACMD="$JAVA_HOME/jre/sh/java"- else- JAVACMD="$JAVA_HOME/bin/java"- fi- if [ ! -x "$JAVACMD" ] ; then- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME--Please set the JAVA_HOME variable in your environment to match the-location of your Java installation."- fi-else- JAVACMD="java"- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.--Please set the JAVA_HOME variable in your environment to match the-location of your Java installation."-fi--# Increase the maximum file descriptors if we can.-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then- MAX_FD_LIMIT=`ulimit -H -n`- if [ $? -eq 0 ] ; then- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then- MAX_FD="$MAX_FD_LIMIT"- fi- ulimit -n $MAX_FD- if [ $? -ne 0 ] ; then- warn "Could not set maximum file descriptor limit: $MAX_FD"- fi- else- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"- fi-fi--# For Darwin, add options to specify how the application appears in the dock-if $darwin; then- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""-fi--# For Cygwin, switch paths to Windows format before running java-if $cygwin ; then- APP_HOME=`cygpath --path --mixed "$APP_HOME"`- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`-- # We build the pattern for arguments to be converted via cygpath- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`- SEP=""- for dir in $ROOTDIRSRAW ; do- ROOTDIRS="$ROOTDIRS$SEP$dir"- SEP="|"- done- OURCYGPATTERN="(^($ROOTDIRS))"- # Add a user-defined pattern to the cygpath arguments- if [ "$GRADLE_CYGPATTERN" != "" ] ; then- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"- fi- # Now convert the arguments - kludge to limit ourselves to /bin/sh- i=0- for arg in "$@" ; do- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option-- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`- else- eval `echo args$i`="\"$arg\""- fi- i=$((i+1))- done- case $i in- (0) set -- ;;- (1) set -- "$args0" ;;- (2) set -- "$args0" "$args1" ;;- (3) set -- "$args0" "$args1" "$args2" ;;- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;- esac-fi--# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules-function splitJvmOpts() {- JVM_OPTS=("$@")-}-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"--exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"diff --git a/android/gradlew.bat b/android/gradlew.batdeleted file mode 100644index 8a0b282..0000000--- a/android/gradlew.bat+++ /dev/null@@ -1,90 +0,0 @@-@if "%DEBUG%" == "" @echo off-@rem ##########################################################################-@rem-@rem Gradle startup script for Windows-@rem-@rem ##########################################################################--@rem Set local scope for the variables with windows NT shell-if "%OS%"=="Windows_NT" setlocal--@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.-set DEFAULT_JVM_OPTS=--set DIRNAME=%~dp0-if "%DIRNAME%" == "" set DIRNAME=.-set APP_BASE_NAME=%~n0-set APP_HOME=%DIRNAME%--@rem Find java.exe-if defined JAVA_HOME goto findJavaFromJavaHome--set JAVA_EXE=java.exe-%JAVA_EXE% -version >NUL 2>&1-if "%ERRORLEVEL%" == "0" goto init--echo.-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.-echo.-echo Please set the JAVA_HOME variable in your environment to match the-echo location of your Java installation.--goto fail--:findJavaFromJavaHome-set JAVA_HOME=%JAVA_HOME:"=%-set JAVA_EXE=%JAVA_HOME%/bin/java.exe--if exist "%JAVA_EXE%" goto init--echo.-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%-echo.-echo Please set the JAVA_HOME variable in your environment to match the-echo location of your Java installation.--goto fail--:init-@rem Get command-line arguments, handling Windowz variants--if not "%OS%" == "Windows_NT" goto win9xME_args-if "%@eval[2+2]" == "4" goto 4NT_args--:win9xME_args-@rem Slurp the command line arguments.-set CMD_LINE_ARGS=-set _SKIP=2--:win9xME_args_slurp-if "x%~1" == "x" goto execute--set CMD_LINE_ARGS=%*-goto execute--:4NT_args-@rem Get arguments from the 4NT Shell from JP Software-set CMD_LINE_ARGS=%$--:execute-@rem Setup the command line--set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar--@rem Execute Gradle-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%--:end-@rem End local scope for the variables with windows NT shell-if "%ERRORLEVEL%"=="0" goto mainEnd--:fail-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of-rem the _cmd.exe /c_ return code!-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1-exit /b 1--:mainEnd-if "%OS%"=="Windows_NT" endlocal--:omegadiff --git a/android/settings.gradle b/android/settings.gradledeleted file mode 100644index 7127d8a..0000000--- a/android/settings.gradle+++ /dev/null@@ -1,2 +0,0 @@-include ':app'-include ':storagechooser'diff --git a/android/storagechooser/.gitignore b/android/storagechooser/.gitignoredeleted file mode 100644index 796b96d..0000000--- a/android/storagechooser/.gitignore+++ /dev/null@@ -1 +0,0 @@-/builddiff --git a/android/storagechooser/build.gradle b/android/storagechooser/build.gradledeleted file mode 100644index 9a9f530..0000000--- a/android/storagechooser/build.gradle+++ /dev/null@@ -1,45 +0,0 @@-apply plugin: 'com.android.library'--group = 'com.github.codekidX'--android {- namespace 'com.codekidlabs.storagechooser'- compileSdk 35-- defaultConfig {- minSdk 16- targetSdk 28-- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"- vectorDrawables.useSupportLibrary = true- }-- buildTypes {- release {- minifyEnabled false- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'- }- }-- compileOptions {- sourceCompatibility JavaVersion.VERSION_17- targetCompatibility JavaVersion.VERSION_17- }-}--dependencies {- implementation fileTree(dir: 'libs', include: ['*.jar'])-- implementation 'androidx.appcompat:appcompat:1.3.1'- implementation 'com.google.android.material:material:1.4.0'-- androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0') {- exclude group: 'com.android.support', module: 'support-annotations'- }-- testImplementation 'junit:junit:4.13.2'-}--// The original module contained old publication-only Javadoc tasks that used-// configurations.compile. That configuration no longer exists in modern Gradle.-// They are deliberately omitted because they are unrelated to building the app.diff --git a/android/storagechooser/gradle/wrapper/gradle-wrapper.jar b/android/storagechooser/gradle/wrapper/gradle-wrapper.jardeleted file mode 100644index 13372ae..0000000Binary files a/android/storagechooser/gradle/wrapper/gradle-wrapper.jar and /dev/null differdiff --git a/android/storagechooser/gradle/wrapper/gradle-wrapper.properties b/android/storagechooser/gradle/wrapper/gradle-wrapper.propertiesdeleted file mode 100644index 04e285f..0000000--- a/android/storagechooser/gradle/wrapper/gradle-wrapper.properties+++ /dev/null@@ -1,6 +0,0 @@-#Mon Dec 28 10:00:20 PST 2015-distributionBase=GRADLE_USER_HOME-distributionPath=wrapper/dists-zipStoreBase=GRADLE_USER_HOME-zipStorePath=wrapper/dists-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zipdiff --git a/android/storagechooser/gradlew b/android/storagechooser/gradlewdeleted file mode 100755index 9d82f78..0000000--- a/android/storagechooser/gradlew+++ /dev/null@@ -1,160 +0,0 @@-#!/usr/bin/env bash--##############################################################################-##-## Gradle start up script for UN*X-##-##############################################################################--# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.-DEFAULT_JVM_OPTS=""--APP_NAME="Gradle"-APP_BASE_NAME=`basename "$0"`--# Use the maximum available, or set MAX_FD != -1 to use that value.-MAX_FD="maximum"--warn ( ) {- echo "$*"-}--die ( ) {- echo- echo "$*"- echo- exit 1-}--# OS specific support (must be 'true' or 'false').-cygwin=false-msys=false-darwin=false-case "`uname`" in- CYGWIN* )- cygwin=true- ;;- Darwin* )- darwin=true- ;;- MINGW* )- msys=true- ;;-esac--# Attempt to set APP_HOME-# Resolve links: $0 may be a link-PRG="$0"-# Need this for relative symlinks.-while [ -h "$PRG" ] ; do- ls=`ls -ld "$PRG"`- link=`expr "$ls" : '.*-> \(.*\)$'`- if expr "$link" : '/.*' > /dev/null; then- PRG="$link"- else- PRG=`dirname "$PRG"`"/$link"- fi-done-SAVED="`pwd`"-cd "`dirname \"$PRG\"`/" >/dev/null-APP_HOME="`pwd -P`"-cd "$SAVED" >/dev/null--CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar--# Determine the Java command to use to start the JVM.-if [ -n "$JAVA_HOME" ] ; then- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then- # IBM's JDK on AIX uses strange locations for the executables- JAVACMD="$JAVA_HOME/jre/sh/java"- else- JAVACMD="$JAVA_HOME/bin/java"- fi- if [ ! -x "$JAVACMD" ] ; then- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME--Please set the JAVA_HOME variable in your environment to match the-location of your Java installation."- fi-else- JAVACMD="java"- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.--Please set the JAVA_HOME variable in your environment to match the-location of your Java installation."-fi--# Increase the maximum file descriptors if we can.-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then- MAX_FD_LIMIT=`ulimit -H -n`- if [ $? -eq 0 ] ; then- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then- MAX_FD="$MAX_FD_LIMIT"- fi- ulimit -n $MAX_FD- if [ $? -ne 0 ] ; then- warn "Could not set maximum file descriptor limit: $MAX_FD"- fi- else- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"- fi-fi--# For Darwin, add options to specify how the application appears in the dock-if $darwin; then- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""-fi--# For Cygwin, switch paths to Windows format before running java-if $cygwin ; then- APP_HOME=`cygpath --path --mixed "$APP_HOME"`- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`- JAVACMD=`cygpath --unix "$JAVACMD"`-- # We build the pattern for arguments to be converted via cygpath- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`- SEP=""- for dir in $ROOTDIRSRAW ; do- ROOTDIRS="$ROOTDIRS$SEP$dir"- SEP="|"- done- OURCYGPATTERN="(^($ROOTDIRS))"- # Add a user-defined pattern to the cygpath arguments- if [ "$GRADLE_CYGPATTERN" != "" ] ; then- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"- fi- # Now convert the arguments - kludge to limit ourselves to /bin/sh- i=0- for arg in "$@" ; do- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option-- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`- else- eval `echo args$i`="\"$arg\""- fi- i=$((i+1))- done- case $i in- (0) set -- ;;- (1) set -- "$args0" ;;- (2) set -- "$args0" "$args1" ;;- (3) set -- "$args0" "$args1" "$args2" ;;- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;- esac-fi--# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules-function splitJvmOpts() {- JVM_OPTS=("$@")-}-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"--exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"diff --git a/android/storagechooser/gradlew.bat b/android/storagechooser/gradlew.batdeleted file mode 100644index 8a0b282..0000000--- a/android/storagechooser/gradlew.bat+++ /dev/null@@ -1,90 +0,0 @@-@if "%DEBUG%" == "" @echo off-@rem ##########################################################################-@rem-@rem Gradle startup script for Windows-@rem-@rem ##########################################################################--@rem Set local scope for the variables with windows NT shell-if "%OS%"=="Windows_NT" setlocal--@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.-set DEFAULT_JVM_OPTS=--set DIRNAME=%~dp0-if "%DIRNAME%" == "" set DIRNAME=.-set APP_BASE_NAME=%~n0-set APP_HOME=%DIRNAME%--@rem Find java.exe-if defined JAVA_HOME goto findJavaFromJavaHome--set JAVA_EXE=java.exe-%JAVA_EXE% -version >NUL 2>&1-if "%ERRORLEVEL%" == "0" goto init--echo.-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.-echo.-echo Please set the JAVA_HOME variable in your environment to match the-echo location of your Java installation.--goto fail--:findJavaFromJavaHome-set JAVA_HOME=%JAVA_HOME:"=%-set JAVA_EXE=%JAVA_HOME%/bin/java.exe--if exist "%JAVA_EXE%" goto init--echo.-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%-echo.-echo Please set the JAVA_HOME variable in your environment to match the-echo location of your Java installation.--goto fail--:init-@rem Get command-line arguments, handling Windowz variants--if not "%OS%" == "Windows_NT" goto win9xME_args-if "%@eval[2+2]" == "4" goto 4NT_args--:win9xME_args-@rem Slurp the command line arguments.-set CMD_LINE_ARGS=-set _SKIP=2--:win9xME_args_slurp-if "x%~1" == "x" goto execute--set CMD_LINE_ARGS=%*-goto execute--:4NT_args-@rem Get arguments from the 4NT Shell from JP Software-set CMD_LINE_ARGS=%$--:execute-@rem Setup the command line--set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar--@rem Execute Gradle-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%--:end-@rem End local scope for the variables with windows NT shell-if "%ERRORLEVEL%"=="0" goto mainEnd--:fail-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of-rem the _cmd.exe /c_ return code!-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1-exit /b 1--:mainEnd-if "%OS%"=="Windows_NT" endlocal--:omegadiff --git a/android/storagechooser/proguard-rules.pro b/android/storagechooser/proguard-rules.prodeleted file mode 100644index a106de9..0000000--- a/android/storagechooser/proguard-rules.pro+++ /dev/null@@ -1,17 +0,0 @@-# Add project specific ProGuard rules here.-# By default, the flags in this file are appended to flags specified-# in C:\Users\Home\sdk/tools/proguard/proguard-android.txt-# You can edit the include path and order by changing the proguardFiles-# directive in build.gradle.-#-# For more details, see-# http://developer.android.com/guide/developing/tools/proguard.html--# Add any project specific keep options here:--# If your project uses WebView with JS, uncomment the following-# and specify the fully qualified class name to the JavaScript interface-# class:-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {-# public *;-#}diff --git a/android/storagechooser/src/androidTest/java/com/codekidlabs/storagechooser/ExampleInstrumentedTest.java b/android/storagechooser/src/androidTest/java/com/codekidlabs/storagechooser/ExampleInstrumentedTest.javadeleted file mode 100644index 0aa10fd..0000000--- a/android/storagechooser/src/androidTest/java/com/codekidlabs/storagechooser/ExampleInstrumentedTest.java+++ /dev/null@@ -1,26 +0,0 @@-package com.codekidlabs.storagechooser;--import android.content.Context;-import android.support.test.InstrumentationRegistry;-import android.support.test.runner.AndroidJUnit4;--import org.junit.Test;-import org.junit.runner.RunWith;--import static org.junit.Assert.assertEquals;--/**- * Instrumentation test, which will execute on an Android device.- *- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>- */-@RunWith(AndroidJUnit4.class)-public class ExampleInstrumentedTest {- @Test- public void useAppContext() throws Exception {- // Context of the app under test.- Context appContext = InstrumentationRegistry.getTargetContext();-- assertEquals("com.codekidlabs.storagechooser.test", appContext.getPackageName());- }-}diff --git a/android/storagechooser/src/main/AndroidManifest.xml b/android/storagechooser/src/main/AndroidManifest.xmldeleted file mode 100644index b2d3ea1..0000000--- a/android/storagechooser/src/main/AndroidManifest.xml+++ /dev/null@@ -1,2 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<manifest xmlns:android="http://schemas.android.com/apk/res/android" />diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/Content.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/Content.javadeleted file mode 100644index 637ba20..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/Content.java+++ /dev/null@@ -1,109 +0,0 @@-package com.codekidlabs.storagechooser;--/**- * Content class handles changes to dialog's view and whatever is in it- */--public class Content {-- private String selectLabel = "Select";- private String createLabel = "Create";- private String newFolderLabel = "New Folder";- private String cancelLabel = "Cancel";- private String overviewHeading = "Choose Storage";- private String internalStorageText = "Internal Storage";- private String freeSpaceText = "%s free";- private String folderCreatedToastText = "Folder Created";- private String folderErrorToastText = "Error occured while creating folder. Try again.";- private String textfieldHintText = "Folder Name";- private String textfieldErrorText = "Empty Folder Name";--- public String getSelectLabel() {- return selectLabel;- }-- public void setSelectLabel(String selectLabel) {- this.selectLabel = selectLabel;- }-- public String getCreateLabel() {- return createLabel;- }-- public void setCreateLabel(String createLabel) {- this.createLabel = createLabel;- }-- public String getNewFolderLabel() {- return newFolderLabel;- }-- public void setNewFolderLabel(String newFolderLabel) {- this.newFolderLabel = newFolderLabel;- }-- public String getCancelLabel() {- return cancelLabel;- }-- public void setCancelLabel(String cancelLabel) {- this.cancelLabel = cancelLabel;- }-- public String getOverviewHeading() {- return overviewHeading;- }-- public void setOverviewHeading(String overviewHeading) {- this.overviewHeading = overviewHeading;- }-- public String getInternalStorageText() {- return internalStorageText;- }-- public void setInternalStorageText(String internalStorageText) {- this.internalStorageText = internalStorageText;- }-- public String getFreeSpaceText() {- return freeSpaceText;- }-- public void setFreeSpaceText(String freeSpaceText) {- this.freeSpaceText = freeSpaceText;- }-- public String getFolderCreatedToastText() {- return folderCreatedToastText;- }-- public void setFolderCreatedToastText(String folderCreatedToastText) {- this.folderCreatedToastText = folderCreatedToastText;- }-- public String getFolderErrorToastText() {- return folderErrorToastText;- }-- public void setFolderErrorToastText(String folderErrorToastText) {- this.folderErrorToastText = folderErrorToastText;- }-- public String getTextfieldHintText() {- return textfieldHintText;- }-- public void setTextfieldHintText(String textfieldHintText) {- this.textfieldHintText = textfieldHintText;- }-- public String getTextfieldErrorText() {- return textfieldErrorText;- }-- public void setTextfieldErrorText(String textfieldErrorText) {- this.textfieldErrorText = textfieldErrorText;- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/StorageChooser.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/StorageChooser.javadeleted file mode 100644index 96ce896..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/StorageChooser.java+++ /dev/null@@ -1,436 +0,0 @@-package com.codekidlabs.storagechooser;--import android.app.Activity;-import android.app.Dialog;-import android.content.Context;-import android.content.SharedPreferences;-import android.os.Environment;-import android.util.Log;--import com.codekidlabs.storagechooser.fragments.ChooserDialogFragment;-import com.codekidlabs.storagechooser.models.Config;-import com.codekidlabs.storagechooser.utils.DiskUtil;--import java.util.ArrayList;-import java.util.List;--import androidx.annotation.Nullable;---public class StorageChooser {-- public static final String NONE = "none";- public static final String DIRECTORY_CHOOSER = "dir";- public static final String FILE_PICKER = "file";- public static Dialog dialog;- public static Config sConfig;- public static OnSelectListener onSelectListener;- public static OnCancelListener onCancelListener;- public static OnMultipleSelectListener onMultipleSelectListener;- public static String LAST_SESSION_PATH = null;- private final String TAG = this.getClass().getName();- private Activity chooserActivity;-- /**- * basic constructor of StorageChooser- *- * @param config to use with dialog window addition- */- StorageChooser(Activity activity, Config config) {- setsConfig(config);- setChooserActivity(activity);- }-- /**- * blank constructor of StorageChooser- * no params used only for internal library use- */- public StorageChooser() {- }-- public static Config getsConfig() {- return sConfig;- }-- public static void setsConfig(Config sConfig) {- StorageChooser.sConfig = sConfig;- }-- private static Dialog getStorageChooserDialog(Activity activity) {- return new Dialog(activity, R.style.DialogTheme);- }-- /**- * show() shows the storage chooser dialog- */- public void show() {- init();- }-- /**- * init() creates the storage chooser dialog- */- private void init() {- dialog = getStorageChooserDialog(getChooserActivity());-- // check if listeners are set to avoid crash- if (onSelectListener == null) {- onSelectListener = getDefaultOnSelectListener();- }- if (onCancelListener == null) {- onCancelListener = getDefaultOnCancelListener();- }- if (onMultipleSelectListener == null) {- onMultipleSelectListener = getDefaultMultipleSelectionListener();- }-- if (sConfig.isResumeSession() && StorageChooser.LAST_SESSION_PATH != null) {- DiskUtil.showSecondaryChooser(StorageChooser.LAST_SESSION_PATH, sConfig);- } else {-- // if dev needs to skip overview and the primary path is not mentioned the directory- // chooser or file picker will default to internal storage- if (sConfig.isSkipOverview()) {- if (sConfig.getPrimaryPath() == null) {-- // internal storage is always the first element (I took care of it :wink:)- String dirPath = Environment.getExternalStorageDirectory().getAbsolutePath();- DiskUtil.showSecondaryChooser(dirPath, sConfig);- } else {-- // path provided by dev is the goto path for chooser- DiskUtil.showSecondaryChooser(sConfig.getPrimaryPath(), sConfig);- }-- } else {- ChooserDialogFragment chooserDialogFragment = new ChooserDialogFragment();- chooserDialogFragment.show(sConfig.getFragmentManager(), "storagechooser_dialog");- }- }- }-- public void setOnSelectListener(OnSelectListener onSelectListener) {- StorageChooser.onSelectListener = onSelectListener;- }--- public void setOnCancelListener(OnCancelListener onCancelListener) {- StorageChooser.onCancelListener = onCancelListener;- }-- public void setOnMultipleSelectListener(OnMultipleSelectListener onMultipleSelectListener) {- StorageChooser.onMultipleSelectListener = onMultipleSelectListener;- }-- private Activity getChooserActivity() {- return chooserActivity;- }-- private void setChooserActivity(Activity chooserActivity) {- this.chooserActivity = chooserActivity;- }-- private OnSelectListener getDefaultOnSelectListener() {- return new OnSelectListener() {- @Override- public void onSelect(String path) {- Log.e(TAG, "You need to setup OnSelectListener from your side. OUTPUT: " + path);- }- };- }-- private OnCancelListener getDefaultOnCancelListener() {- return new OnCancelListener() {- @Override- public void onCancel() {- Log.e(TAG, "You need to setup OnCancelListener from your side. This is default OnCancelListener fired.");- }- };- }-- private OnMultipleSelectListener getDefaultMultipleSelectionListener() {- return new OnMultipleSelectListener() {- @Override- public void onDone(ArrayList<String> selectedFilePaths) {- Log.e(TAG, "You need to setup OnMultipleSelectListener from your side. This is default OnMultipleSelectListener fired.");- }- };- }-- public enum FileType {- VIDEO, AUDIO, DOCS, IMAGES, ARCHIVE- }-- public interface OnSelectListener {-- void onSelect(String path);- }-- public interface OnCancelListener {-- void onCancel();- }-- public interface OnMultipleSelectListener {- void onDone(ArrayList<String> selectedFilePaths);- }-- /**- * @class Builder- * - as the name suggests it gets all the configurations provided by the developer and- * passes them to the StorageChooser class using the constructor.- * <p>- * NOTE: The dialog is still not yet show even though the builder instance is present.- * show() is called seperately on the builder because it does not return a builder but- * triggers init() inside the StorageChooser class.- */- public static class Builder {-- Config devConfig;- private Activity mActivity;- private boolean mActionSave = false;- private boolean mShowMemoryBar = false;- private boolean mHideFreeSpaceLabel = false;- private boolean mAllowCustomPath = false;- private boolean mAllowAddFolder = false;- private boolean mShowHidden = false;- private boolean mSkipOverview = false;- private boolean mApplyMemoryThreshold = false;- private boolean mShowInGrid = false;- private boolean mResumeSession = false;- private boolean mHeadingFromAssets = false;- private boolean mListFromAssets = false;- private float mMemorybarHeight = 2f;- private String type;- private Content content;- private StorageChooser.Theme theme;- private StorageChooser.FileType filter;- private ArrayList<StorageChooser.FileType> multipleFilter;-- public Builder() {- devConfig = new Config();- }-- public Builder withActivity(Activity activity) {- mActivity = activity;- return this;- }-- public Builder withFragmentManager(android.app.FragmentManager fragmentManager) {- devConfig.setFragmentManager(fragmentManager);- return this;- }-- public Builder withMemoryBar(boolean memoryBarBoolean) {- mShowMemoryBar = memoryBarBoolean;- return this;- }-- public Builder hideFreeSpaceLabel(boolean hideFreeSpaceLabel) {- mHideFreeSpaceLabel = hideFreeSpaceLabel;- return this;- }-- public Builder setMemoryBarHeight(float height) {- this.mMemorybarHeight = height;- return this;- }-- public Builder withPredefinedPath(String path) {- devConfig.setPredefinedPath(path);- return this;- }-- public Builder applyMemoryThreshold(boolean applyThreshold) {- mApplyMemoryThreshold = applyThreshold;- return this;- }-- public Builder withThreshold(int size, String suffix) {- devConfig.setMemoryThreshold(size);- devConfig.setThresholdSuffix(suffix);- return this;- }-- public Builder withPreference(SharedPreferences sharedPreferences) {- devConfig.setPreference(sharedPreferences);- return this;- }-- public Builder actionSave(boolean save) {- mActionSave = save;- return this;- }-- public Builder setDialogTitle(String title) {- devConfig.setDialogTitle(title);- return this;- }-- public Builder setInternalStorageText(String storageNameText) {- devConfig.setInternalStorageText(storageNameText);- return this;- }-- public Builder allowCustomPath(boolean allowCustomPath) {- mAllowCustomPath = allowCustomPath;- return this;- }-- public Builder allowAddFolder(boolean addFolder) {- mAllowAddFolder = addFolder;- return this;- }-- public Builder showHidden(boolean showHiddenFolders) {- mShowHidden = showHiddenFolders;- return this;- }-- public Builder setType(String action) {- type = action;- return this;- }-- public Builder setTheme(StorageChooser.Theme theme) {- this.theme = theme;- return this;- }-- public Builder skipOverview(boolean skip, String primaryPath) {- mSkipOverview = skip;- devConfig.setPrimaryPath(primaryPath);- return this;- }-- public Builder skipOverview(boolean skip) {- mSkipOverview = skip;- return this;- }-- public Builder withContent(Content content) {- this.content = content;- return this;- }-- public Builder filter(@Nullable StorageChooser.FileType filter) {- this.filter = filter;- return this;- }-- public Builder crunch() {- devConfig.setCustomFilter(false);- return this;- }-- public Builder customFilter(List<String> formats) {- devConfig.setCustomFilter(true);- devConfig.setCustomEnum(formats);- return this;- }-- public Builder showFoldersInGrid(boolean showInGrid) {- devConfig.setGridView(showInGrid);- return this;- }-- public Builder shouldResumeSession(boolean resumeSession) {- this.mResumeSession = resumeSession;- return this;- }-- // typefaces- public Builder setHeadingTypeface(String path, boolean fromAssets) {- devConfig.setHeadingFont(path);- mHeadingFromAssets = fromAssets;- return this;- }-- public Builder setListTypeface(String path, boolean fromAssets) {- devConfig.setListFont(path);- mListFromAssets = fromAssets;- return this;- }-- public Builder disableMultiSelect() {- devConfig.setMultiSelect(false);- return this;- }--- public StorageChooser build() {- devConfig.setActionSave(mActionSave);- devConfig.setShowMemoryBar(mShowMemoryBar);- devConfig.setHideFreeSpaceLabel(mHideFreeSpaceLabel);- devConfig.setAllowCustomPath(mAllowCustomPath);- devConfig.setAllowAddFolder(mAllowAddFolder);- devConfig.setShowHidden(mShowHidden);- devConfig.setSkipOverview(mSkipOverview);- devConfig.setApplyThreshold(mApplyMemoryThreshold);- devConfig.setResumeSession(mResumeSession);- devConfig.setGridView(mShowInGrid);- devConfig.setContent(content);- devConfig.setSingleFilter(filter);- devConfig.setMemorybarHeight(mMemorybarHeight);- devConfig.setHeadingFromAssets(mHeadingFromAssets);- devConfig.setListFromAssets(mListFromAssets);-- type = (type == null) ? StorageChooser.NONE : type;- devConfig.setSecondaryAction(type);-- if (theme == null || theme.getScheme() == null) {- theme = new Theme(mActivity);- devConfig.setScheme(theme.getDefaultScheme());- } else {- devConfig.setScheme(theme.getScheme());- }-- return new StorageChooser(mActivity, devConfig);- }-- }-- public static class Theme {-- // Overview dialog colors- public static final int OVERVIEW_HEADER_INDEX = 0;- public static final int OVERVIEW_TEXT_INDEX = 1;- public static final int OVERVIEW_BG_INDEX = 2;- public static final int OVERVIEW_STORAGE_TEXT_INDEX = 3;- public static final int OVERVIEW_INDICATOR_INDEX = 4;- public static final int OVERVIEW_MEMORYBAR_INDEX = 5;- // Secondary dialog colors- public static final int SEC_FOLDER_TINT_INDEX = 6;- public static final int SEC_BG_INDEX = 7;- public static final int SEC_TEXT_INDEX = 8;- public static final int SEC_ADDRESS_TINT_INDEX = 9;- public static final int SEC_HINT_TINT_INDEX = 10;- public static final int SEC_SELECT_LABEL_INDEX = 11;- public static final int SEC_FOLDER_CREATION_BG_INDEX = 12;- public static final int SEC_DONE_FAB_INDEX = 13;- public static final int SEC_ADDRESS_BAR_BG = 14;- Context context;- int[] scheme;-- public Theme(Context context) {- this.context = context;- }-- public int[] getDefaultScheme() {- return context.getResources().getIntArray(R.array.default_light);- }-- public int[] getDefaultDarkScheme() {- return context.getResources().getIntArray(R.array.default_dark);- }--- public int[] getScheme() {- return scheme;- }-- public void setScheme(int[] scheme) {- this.scheme = scheme;- }- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/adapters/SecondaryChooserAdapter.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/adapters/SecondaryChooserAdapter.javadeleted file mode 100644index bf12b85..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/adapters/SecondaryChooserAdapter.java+++ /dev/null@@ -1,125 +0,0 @@-package com.codekidlabs.storagechooser.adapters;--import android.content.Context;-import android.text.SpannableStringBuilder;-import android.view.LayoutInflater;-import android.view.View;-import android.view.ViewGroup;-import android.widget.BaseAdapter;-import android.widget.ImageView;-import android.widget.TextView;--import com.codekidlabs.storagechooser.R;-import com.codekidlabs.storagechooser.StorageChooser;-import com.codekidlabs.storagechooser.fragments.ChooserDialogFragment;-import com.codekidlabs.storagechooser.utils.FileUtil;-import com.codekidlabs.storagechooser.utils.ResourceUtil;-import com.codekidlabs.storagechooser.utils.ThumbnailUtil;--import java.util.ArrayList;-import java.util.List;--public class SecondaryChooserAdapter extends BaseAdapter {-- public static boolean shouldEnable = true;- public ArrayList<Integer> selectedPaths;- public String prefixPath;- private List<String> storagesList;- private Context mContext;- private int[] scheme;- private ThumbnailUtil thumbnailUtil;- private ResourceUtil resourceUtil;-- private String listTypeface;- private boolean fromAssets;--- public SecondaryChooserAdapter(List<String> storagesList, Context mContext, int[] scheme,- String listTypeface, boolean fromAssets) {- this.storagesList = storagesList;- this.mContext = mContext;- this.scheme = scheme;- this.listTypeface = listTypeface;- this.fromAssets = fromAssets;-- // create instance once- thumbnailUtil = new ThumbnailUtil(mContext);- resourceUtil = new ResourceUtil(mContext);- selectedPaths = new ArrayList<>();- }-- @Override- public int getCount() {- return storagesList.size();- }-- @Override- public Object getItem(int i) {- return storagesList.get(i);- }-- @Override- public long getItemId(int i) {- return i;- }-- @Override- public View getView(int i, View view, ViewGroup viewGroup) {- LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);-- View rootView = inflater.inflate(R.layout.row_custom_paths, viewGroup, false);-- ImageView pathFolderIcon = rootView.findViewById(R.id.path_folder_icon);- if (FileUtil.isDir(prefixPath + "/" + storagesList.get(i))) {- applyFolderTint(pathFolderIcon);- }-- thumbnailUtil.init(pathFolderIcon, storagesList.get(i));-- TextView storageName = rootView.findViewById(R.id.storage_name);- storageName.setText(storagesList.get(i));-- if (listTypeface != null) {- storageName.setTypeface(ChooserDialogFragment.getSCTypeface(mContext, listTypeface,- fromAssets));- }--- storageName.setTextColor(scheme[StorageChooser.Theme.SEC_TEXT_INDEX]);-- if (selectedPaths.contains(i)) {- rootView.setBackgroundColor(resourceUtil.getPrimaryColorWithAlpha());- }-- return rootView;- }--- /**- * return the spannable index of character '('- *- * @param str SpannableStringBuilder to apply typeface changes- * @return index of '('- */- private int getSpannableIndex(SpannableStringBuilder str) {- return str.toString().indexOf("(") + 1;- }-- public String getPrefixPath() {- return prefixPath;- }-- public void setPrefixPath(String path) {- this.prefixPath = path;- }-- private void applyFolderTint(ImageView im) {- im.setColorFilter(scheme[StorageChooser.Theme.SEC_FOLDER_TINT_INDEX]);- }-- @Override- public boolean isEnabled(int position) {- return shouldEnable;- }--}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/adapters/StorageChooserListAdapter.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/adapters/StorageChooserListAdapter.javadeleted file mode 100644index aeadfca..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/adapters/StorageChooserListAdapter.java+++ /dev/null@@ -1,200 +0,0 @@-package com.codekidlabs.storagechooser.adapters;--import android.content.Context;-import android.graphics.Typeface;-import androidx.core.graphics.drawable.DrawableCompat;-import android.text.Spannable;-import android.text.SpannableStringBuilder;-import android.text.style.StyleSpan;-import android.util.Log;-import android.util.TypedValue;-import android.view.LayoutInflater;-import android.view.View;-import android.view.ViewGroup;-import android.view.animation.AccelerateDecelerateInterpolator;-import android.widget.BaseAdapter;-import android.widget.ProgressBar;-import android.widget.TextView;--import com.codekidlabs.storagechooser.Content;-import com.codekidlabs.storagechooser.R;-import com.codekidlabs.storagechooser.animators.MemorybarAnimation;-import com.codekidlabs.storagechooser.exceptions.MemoryNotAccessibleException;-import com.codekidlabs.storagechooser.fragments.ChooserDialogFragment;-import com.codekidlabs.storagechooser.models.Storages;-import com.codekidlabs.storagechooser.utils.MemoryUtil;--import java.util.List;--import static com.codekidlabs.storagechooser.StorageChooser.Theme.OVERVIEW_INDICATOR_INDEX;-import static com.codekidlabs.storagechooser.StorageChooser.Theme.OVERVIEW_MEMORYBAR_INDEX;-import static com.codekidlabs.storagechooser.StorageChooser.Theme.OVERVIEW_STORAGE_TEXT_INDEX;--public class StorageChooserListAdapter extends BaseAdapter {-- private static int memoryPercentile;- private List<Storages> storagesList;- private Context mContext;- private boolean shouldShowMemoryBar;- private boolean hideFreeSpaceLabel;- private ProgressBar memoryBar;- private int[] scheme;- private float memorybarHeight;- private String listTypeface;- private boolean fromAssets;- private Content mContent;--- public StorageChooserListAdapter(List<Storages> storagesList, Context mContext,- boolean shouldShowMemoryBar, boolean hideFreeSpaceLabel,- int[] scheme, float memorybarHeight, String listTypeface,- boolean fromAssets, Content content) {- this.storagesList = storagesList;- this.mContext = mContext;- this.shouldShowMemoryBar = shouldShowMemoryBar;- this.hideFreeSpaceLabel = hideFreeSpaceLabel;- this.scheme = scheme;- this.memorybarHeight = memorybarHeight;- this.listTypeface = listTypeface;- this.fromAssets = fromAssets;- this.mContent = content;- }-- @Override- public int getCount() {- return storagesList.size();- }-- @Override- public Object getItem(int i) {- return storagesList.get(i);- }-- @Override- public long getItemId(int i) {- return i;- }-- @Override- public View getView(int i, View view, ViewGroup viewGroup) {- memoryPercentile = -1;- LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);- View rootView = inflater.inflate(R.layout.row_storage, viewGroup, false);-- //for animation set current position to provide animation delay- TextView storageName = rootView.findViewById(R.id.storage_name);- TextView memoryStatus = rootView.findViewById(R.id.memory_status);- memoryBar = rootView.findViewById(R.id.memory_bar);-- // new scaled memorybar - following the new google play update!- memoryBar.setScaleY(memorybarHeight);-- Storages storages = storagesList.get(i);- final SpannableStringBuilder str = new SpannableStringBuilder(storages.getStorageTitle() + " (" + storages.getMemoryTotalSize() + ")");-- str.setSpan(new StyleSpan(Typeface.ITALIC), getSpannableIndex(str), str.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);- String availableText = String.format(mContent.getFreeSpaceText(), storages.getMemoryAvailableSize());- storageName.setText(str);-- storageName.setTextColor(scheme[OVERVIEW_STORAGE_TEXT_INDEX]);- memoryStatus.setText(availableText);-- if (listTypeface != null) {- storageName.setTypeface(ChooserDialogFragment.getSCTypeface(mContext, listTypeface,- fromAssets));- memoryStatus.setTypeface(ChooserDialogFragment.getSCTypeface(mContext, listTypeface,- fromAssets));- }-- memoryStatus.setTextColor(scheme[OVERVIEW_INDICATOR_INDEX]);- DrawableCompat.setTint(memoryBar.getProgressDrawable(), scheme[OVERVIEW_MEMORYBAR_INDEX]);-- try {- memoryPercentile = getPercentile(storages.getStoragePath());- } catch (MemoryNotAccessibleException e) {- e.printStackTrace();- }- // THE ONE AND ONLY MEMORY BAR- if (shouldShowMemoryBar && memoryPercentile != -1) {- memoryBar.setMax(100);- memoryBar.setProgress(memoryPercentile);- runMemorybarAnimation(i);- } else {- memoryBar.setVisibility(View.GONE);- }-- if (hideFreeSpaceLabel) {- memoryStatus.setVisibility(View.GONE);- storageName.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);- }-- return rootView;-- }-- private void runMemorybarAnimation(int pos) {- MemorybarAnimation animation = new MemorybarAnimation(memoryBar, 0, memoryPercentile);- animation.setDuration(500);- animation.setInterpolator(new AccelerateDecelerateInterpolator());-- if (pos > 0) {- animation.setStartOffset(300);- }-- memoryBar.startAnimation(animation);- }-- /**- * return the spannable index of character '('- *- * @param str SpannableStringBuilder to apply typeface changes- * @return index of '('- */- private int getSpannableIndex(SpannableStringBuilder str) {- return str.toString().indexOf("(") + 1;- }-- /**- * calculate percentage of memory left for memorybar- *- * @param path use same statfs- * @return integer value of the percentage with amount of storage used- */- private int getPercentile(String path) throws MemoryNotAccessibleException {- MemoryUtil memoryUtil = new MemoryUtil();- int percent;-- long availableMem = memoryUtil.getAvailableMemorySize(path);- long totalMem = memoryUtil.getTotalMemorySize(path);-- if (totalMem > 0) {- percent = (int) (100 - ((availableMem * 100) / totalMem));- } else {- throw new MemoryNotAccessibleException("Cannot compute memory for " + path);- }-- return percent;- }-- /**- * remove KiB,MiB,GiB text that we got from MemoryUtil.getAvailableMemorySize() &- * MemoryUtil.getTotalMemorySize()- *- * @param size String in the format of user readable string, with MB, GiB .. suffix- * @return integer value of the percentage with amount of storage used- */- private long getMemoryFromString(String size) {- long mem;-- if (size.contains("MiB")) {- mem = Integer.parseInt(size.replace(",", "").replace("MiB", ""));- } else if (size.contains("GiB")) {- mem = Integer.parseInt(size.replace(",", "").replace("GiB", ""));- } else {- mem = Integer.parseInt(size.replace(",", "").replace("KiB", ""));- }-- Log.d("TAG", "Memory:" + mem);- return mem;- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/animators/MemorybarAnimation.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/animators/MemorybarAnimation.javadeleted file mode 100644index 2e8ba0d..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/animators/MemorybarAnimation.java+++ /dev/null@@ -1,30 +0,0 @@-package com.codekidlabs.storagechooser.animators;--import android.view.animation.Animation;-import android.view.animation.Transformation;-import android.widget.ProgressBar;--/**- * display a nice animation when chooser dialog is shown- */--public class MemorybarAnimation extends Animation {-- private ProgressBar progressBar;- private float from;- private float to;--- public MemorybarAnimation(ProgressBar progressBar, int from, int to) {- this.progressBar = progressBar;- this.from = from;- this.to = to;- }-- @Override- protected void applyTransformation(float interpolatedTime, Transformation t) {- super.applyTransformation(interpolatedTime, t);- float animatedProgress = from + (to - from) * interpolatedTime;- progressBar.setProgress((int) animatedProgress);- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/exceptions/MemoryNotAccessibleException.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/exceptions/MemoryNotAccessibleException.javadeleted file mode 100644index 2db7475..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/exceptions/MemoryNotAccessibleException.java+++ /dev/null@@ -1,9 +0,0 @@-package com.codekidlabs.storagechooser.exceptions;---public class MemoryNotAccessibleException extends Exception {-- public MemoryNotAccessibleException(String message) {- super(message);- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/filters/UniversalFileFilter.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/filters/UniversalFileFilter.javadeleted file mode 100644index 16fcbff..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/filters/UniversalFileFilter.java+++ /dev/null@@ -1,213 +0,0 @@-package com.codekidlabs.storagechooser.filters;--import android.util.Log;--import com.codekidlabs.storagechooser.StorageChooser;--import java.io.File;-import java.io.FileFilter;-import java.util.ArrayList;-import java.util.List;--/**- * Created by codekid on 21/07/17.- */--public class UniversalFileFilter implements FileFilter {- protected static final String TAG = "UniversalFileFilter";- private final boolean allowDirectories = true;-- private StorageChooser.FileType fileType;- private boolean customEnumLock = false;- private List<String> customEnum;-- public UniversalFileFilter(StorageChooser.FileType fileType) {- this.fileType = fileType;- }-- public UniversalFileFilter(boolean customLock, List<String> customEnum) {- this.customEnumLock = customLock;- this.customEnum = customEnum;- }-- private String getFileExtension(File f) {- return getFileExtension(f.getName());- }-- private String getFileExtension(String fileName) {- int i = fileName.lastIndexOf('.');- if (i > 0) {- return fileName.substring(i + 1);- } else- return null;- }-- @Override- public boolean accept(File f) {- if (f.isHidden() || !f.canRead()) {- return false;- }-- if (f.isDirectory()) {- return findInDirectory(f);- }- return isFileExtension(f);- }-- private boolean isFileExtension(File f) {- String ext = getFileExtension(f);- if (ext == null) return false;- try {- if (customEnumLock) {- return customEnum.contains(ext);- } else {- if (getFormatExtention(ext) != null) {- return true;- }- }- } catch (IllegalArgumentException e) {- //Not known enum value- return false;- }- return false;- }-- private Object getFormatExtention(String ext) {- switch (fileType) {- case VIDEO:- return VideoFormat.valueOf(ext.toUpperCase());- case AUDIO:- return AudioFormat.valueOf(ext.toUpperCase());- case IMAGES:- return ImageFormat.valueOf(ext.toUpperCase());- case DOCS:- return DocsFormat.valueOf(ext.toUpperCase());- case ARCHIVE:- return ArchiveFormat.valueOf(ext.toUpperCase());- default:- return null;- }- }-- private boolean findInDirectory(File dir) {- if (!allowDirectories) {- return false;- } else {- final ArrayList<File> sub = new ArrayList<File>();- int indexInList = dir.listFiles(new FileFilter() {-- @Override- public boolean accept(File file) {- if (file.isFile()) {- if (file.getName().equals(".nomedia"))- return false;-- return isFileExtension(file);- } else if (file.isDirectory()) {- sub.add(file);- return false;- } else- return false;- }- }).length;-- if (indexInList > 0) {- Log.i(TAG, "findInDirectory => " + dir.getName() + " return true for => " + indexInList);- return true;- }-- for (File subDirectory : sub) {- if (findInDirectory(subDirectory)) {- Log.i(TAG, "findInDirectory => " + subDirectory.toString());- return true;- }- }- return false;- }- }-- /**- * ArchiveFormat for storage-chooser- */- public enum ArchiveFormat {- ZIP("zip"),- RAR("rar");-- private String filesuffix;-- ArchiveFormat(String filesuffix) {- this.filesuffix = filesuffix;- }-- }-- /**- * ImageFormat for storage-chooser- */- public enum ImageFormat {- JPG("jpg"),- JPEG("jpeg"),- PNG("png"),- TIFF("tiff"),- GIF("gif");-- private String filesuffix;-- ImageFormat(String filesuffix) {- this.filesuffix = filesuffix;- }- }-- /**- * VideoFormat for storage-chooser- */- public enum VideoFormat {- MP4("mp4"),- TS("ts"),- MKV("mkv"),- AVI("avi"),- FLV("flv");-- private String filesuffix;-- VideoFormat(String filesuffix) {- this.filesuffix = filesuffix;- }-- }-- /**- * AudioFormat for storage-chooser- */- public enum AudioFormat {- MP3("mp3"),- OGG("ogg");-- private String filesuffix;-- AudioFormat(String filesuffix) {- this.filesuffix = filesuffix;- }-- }-- /**- * DocsFormat for storage-chooser- */- public enum DocsFormat {- PDF("pdf"),- PPT("ppt"),- DOC("doc"),- DOCX("docx"),- EXCEL("xls");-- private String filesuffix;-- DocsFormat(String filesuffix) {- this.filesuffix = filesuffix;- }-- }-}--diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/fragments/ChooserDialogFragment.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/fragments/ChooserDialogFragment.javadeleted file mode 100644index 7329e03..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/fragments/ChooserDialogFragment.java+++ /dev/null@@ -1,311 +0,0 @@-package com.codekidlabs.storagechooser.fragments;--import android.app.Dialog;-import android.content.Context;-import android.content.DialogInterface;-import android.graphics.Typeface;-import android.os.Bundle;-import android.os.Environment;-import android.os.Handler;-import android.util.Log;-import android.view.LayoutInflater;-import android.view.View;-import android.view.ViewGroup;-import android.view.WindowManager;-import android.widget.AdapterView;-import android.widget.ListView;-import android.widget.TextView;-import android.widget.Toast;--import com.codekidlabs.storagechooser.Content;-import com.codekidlabs.storagechooser.R;-import com.codekidlabs.storagechooser.StorageChooser;-import com.codekidlabs.storagechooser.adapters.StorageChooserListAdapter;-import com.codekidlabs.storagechooser.models.Config;-import com.codekidlabs.storagechooser.models.Storages;-import com.codekidlabs.storagechooser.utils.DiskUtil;-import com.codekidlabs.storagechooser.utils.FileUtil;-import com.codekidlabs.storagechooser.utils.MemoryUtil;--import java.io.File;-import java.util.ArrayList;-import java.util.List;--import androidx.annotation.NonNull;-import androidx.annotation.Nullable;--import static com.codekidlabs.storagechooser.StorageChooser.Theme.OVERVIEW_BG_INDEX;-import static com.codekidlabs.storagechooser.StorageChooser.Theme.OVERVIEW_HEADER_INDEX;-import static com.codekidlabs.storagechooser.StorageChooser.Theme.OVERVIEW_TEXT_INDEX;---public class ChooserDialogFragment extends android.app.DialogFragment {-- private static final boolean BUILD_DEBUG = true;- private View mLayout;- private ViewGroup mContainer;-- private List<Storages> storagesList;- private List<String> customStoragesList;- private String TAG = "StorageChooser";- private MemoryUtil memoryUtil = new MemoryUtil();- private FileUtil fileUtil = new FileUtil();-- private Config mConfig;- private Content mContent;-- // day night flag- private int mChooserMode;-- // delaying secondary chooser- private Handler mHandler;-- @Nullable- @Override- public View onCreateView(LayoutInflater inflater, ViewGroup container,- Bundle savedInstanceState) {- mContainer = container;- if (getShowsDialog()) {- // one could return null here, or be nice and call super()- return super.onCreateView(inflater, container, savedInstanceState);- }- return getLayout(inflater, container);- }-- private View getLayout(LayoutInflater inflater, ViewGroup container) {- mConfig = StorageChooser.sConfig;- mHandler = new Handler();- // init storage-chooser content [localization]- if (mConfig.getContent() == null) {- mContent = new Content();- } else {- mContent = mConfig.getContent();- }- mLayout = inflater.inflate(R.layout.storage_list, container, false);- initListView(getActivity().getApplicationContext(), mLayout, mConfig.isShowMemoryBar());-- if (mContent.getOverviewHeading() != null) {- TextView dialogTitle = mLayout.findViewById(R.id.dialog_title);- dialogTitle.setTextColor(mConfig.getScheme()[OVERVIEW_TEXT_INDEX]);- dialogTitle.setText(mContent.getOverviewHeading());-- // set heading typeface- if(mConfig.getHeadingFont() != null) {- dialogTitle.setTypeface(getSCTypeface(getActivity().getApplicationContext(),- mConfig.getHeadingFont(),- mConfig.isHeadingFromAssets()));- }- }-- mLayout.findViewById(R.id.header_container).setBackgroundColor(- mConfig.getScheme()[OVERVIEW_HEADER_INDEX]);- mLayout.findViewById(R.id.overview_container).setBackgroundColor(- mConfig.getScheme()[OVERVIEW_BG_INDEX]);-- return mLayout;- }-- /**- * storage listView related code in this block- */- private void initListView(Context context, View view, boolean shouldShowMemoryBar) {- ListView listView = view.findViewById(R.id.storage_list_view);-- // we need to populate before to get the internal storage path in list- populateList();-- listView.setAdapter(new StorageChooserListAdapter(storagesList, context,- shouldShowMemoryBar, mConfig.isHideFreeSpaceLabel(), mConfig.getScheme(),- mConfig.getMemorybarHeight(), mConfig.getListFont(), mConfig.isListFromAssets(),- mContent));--- listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {- @Override- public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {- final String dirPath = evaluatePath(i);-- if (new File(dirPath).canRead()) {- // if allowCustomPath is called then directory chooser will be the default secondary dialog- if (mConfig.isAllowCustomPath()) {- // if developer wants to apply threshold- if (mConfig.isApplyThreshold()) {- startThresholdTest(i);- } else {-- if (BUILD_DEBUG) {- mHandler.postDelayed(new Runnable() {- @Override- public void run() {- DiskUtil.showSecondaryChooser(dirPath, mConfig);- }- }, 250);- } else {- DiskUtil.showSecondaryChooser(dirPath, mConfig);- }--- }- } else {- if (mConfig.isActionSave()) {- String preDef = mConfig.getPredefinedPath();- // if dev forgot or did not add '/' at start add it to avoid errors- String preDirPath = null;-- if (preDef != null) {- if (!preDef.startsWith("/")) {- preDef = "/" + preDef;- }- preDirPath = dirPath + preDef;- DiskUtil.saveChooserPathPreference(mConfig.getPreference(), preDirPath);- } else {- Log.w(TAG, "Predefined path is null set it by .withPredefinedPath() to builder. Saving root directory");- DiskUtil.saveChooserPathPreference(mConfig.getPreference(), preDirPath);- }- } else {- //Log.d("StorageChooser", "Chosen path: " + dirPath);- if (mConfig.isApplyThreshold()) {- startThresholdTest(i);- } else {- if (StorageChooser.onSelectListener != null) {- StorageChooser.onSelectListener.onSelect(dirPath);- }- }- }- }- ChooserDialogFragment.this.dismiss();- } else {- Toast.makeText(getActivity(), R.string.toast_not_readable, Toast.LENGTH_SHORT)- .show();- }- }- });-- }-- /**- * initiate to take threshold test- *- * @param position list click index- */-- private void startThresholdTest(int position) {- String thresholdSuffix = mConfig.getThresholdSuffix();-- // if threshold suffix is null then memory threshold is also null- if (thresholdSuffix != null) {- long availableMem = memoryUtil.getAvailableMemorySize(evaluatePath(position));--- if (doesPassThresholdTest((long) mConfig.getMemoryThreshold(), thresholdSuffix, availableMem)) {- String dirPath = evaluatePath(position);- DiskUtil.showSecondaryChooser(dirPath, mConfig);- } else {- String suffixedAvailableMem = String.valueOf(memoryUtil.suffixedSize(availableMem, thresholdSuffix)) + " " + thresholdSuffix;- Toast.makeText(getActivity().getApplicationContext(), getString(R.string.toast_threshold_breached, suffixedAvailableMem), Toast.LENGTH_SHORT).show();- }- } else {- // THROW: error in log- Log.e(TAG, "add .withThreshold(int size, String suffix) to your StorageChooser.Builder instance");- }- }--- /**- * evaluates path with respect to the list click position- *- * @param i position in list- * @return String with the required path for developers- */- private String evaluatePath(int i) {- if (i == 0) {- return Environment.getExternalStorageDirectory().getAbsolutePath();- } else {- return "/storage/" + storagesList.get(i).getStorageTitle();- }- }-- /**- * checks if available space in user's device is greater than the developer defined threshold- *- * @param threshold defined by the developer using Config.withThreshold()- * @param memorySuffix also defined in Config.withThreshold() - check in GB, MB, KB ?- * @param availableSpace statfs available mem in bytes (long)- * @return if available memory is more than threshold- */- private boolean doesPassThresholdTest(long threshold, String memorySuffix, long availableSpace) {- return memoryUtil.suffixedSize(availableSpace, memorySuffix) > threshold;- }-- /**- * populate storageList with necessary storages with filter applied- */- private void populateList() {- storagesList = new ArrayList<>();-- File storageDir = new File("/storage");- String internalStoragePath = Environment.getExternalStorageDirectory().getAbsolutePath();-- File[] volumeList = storageDir.listFiles();-- Storages storages = new Storages();-- // just add the internal storage and avoid adding emulated henceforth- storages.setStorageTitle(mContent.getInternalStorageText());-- storages.setStoragePath(internalStoragePath);- storages.setMemoryTotalSize(memoryUtil.formatSize(memoryUtil.getTotalMemorySize(internalStoragePath)));- storages.setMemoryAvailableSize(memoryUtil.formatSize(memoryUtil.getAvailableMemorySize(internalStoragePath)));- storagesList.add(storages);-- /* This is null on Android 11. Let's not crash here. */- if (volumeList == null)- return;-- for (File f : volumeList) {- if (!f.getName().equals(MemoryUtil.SELF_DIR_NAME)- && !f.getName().equals(MemoryUtil.EMULATED_DIR_KNOX)- && !f.getName().equals(MemoryUtil.EMULATED_DIR_NAME)- && !f.getName().equals(MemoryUtil.SDCARD0_DIR_NAME)- && !f.getName().equals(MemoryUtil.CONTAINER)) {- Storages sharedStorage = new Storages();- String fPath = f.getAbsolutePath();- sharedStorage.setStorageTitle(f.getName());- sharedStorage.setMemoryTotalSize(memoryUtil.formatSize(memoryUtil.getTotalMemorySize(fPath)));- sharedStorage.setMemoryAvailableSize(memoryUtil.formatSize(memoryUtil.getAvailableMemorySize(fPath)));- sharedStorage.setStoragePath(fPath);- storagesList.add(sharedStorage);- }- }-- }-- // Convinience methods-- public static Typeface getSCTypeface(Context context, String path, boolean assets) {- if (assets) {- return Typeface.createFromAsset(context.getAssets(),- path);- }- return Typeface.createFromFile(path);- }-- @Override- public void onCancel(DialogInterface dialog) {- super.onCancel(dialog);- StorageChooser.onCancelListener.onCancel();- }-- @NonNull- @Override- public Dialog onCreateDialog(Bundle savedInstanceState) {- Dialog d = StorageChooser.dialog;- d.setContentView(getLayout(LayoutInflater.from(getActivity().getApplicationContext()), mContainer));- WindowManager.LayoutParams lp = new WindowManager.LayoutParams();- lp.copyFrom(d.getWindow().getAttributes());- lp.width = WindowManager.LayoutParams.WRAP_CONTENT;- lp.height = WindowManager.LayoutParams.WRAP_CONTENT;- d.getWindow().setAttributes(lp);- return d;- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/fragments/SecondaryChooserFragment.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/fragments/SecondaryChooserFragment.javadeleted file mode 100644index 12fbdcb..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/fragments/SecondaryChooserFragment.java+++ /dev/null@@ -1,836 +0,0 @@-package com.codekidlabs.storagechooser.fragments;--import android.annotation.SuppressLint;-import android.app.Dialog;-import android.content.Context;-import android.content.DialogInterface;-import android.content.res.ColorStateList;-import android.graphics.drawable.Animatable;-import android.os.AsyncTask;-import android.os.Build;-import android.os.Bundle;-import android.os.Environment;-import android.os.Handler;-import android.util.Log;-import android.util.TypedValue;-import android.view.ContextThemeWrapper;-import android.view.LayoutInflater;-import android.view.View;-import android.view.ViewGroup;-import android.view.WindowManager;-import android.view.animation.Animation;-import android.view.animation.AnimationUtils;-import android.view.inputmethod.InputMethodManager;-import android.widget.AdapterView;-import android.widget.Button;-import android.widget.EditText;-import android.widget.ImageButton;-import android.widget.ImageView;-import android.widget.ListView;-import android.widget.ProgressBar;-import android.widget.RelativeLayout;-import android.widget.TextView;-import android.widget.Toast;--import com.codekidlabs.storagechooser.Content;-import com.codekidlabs.storagechooser.R;-import com.codekidlabs.storagechooser.StorageChooser;-import com.codekidlabs.storagechooser.adapters.SecondaryChooserAdapter;-import com.codekidlabs.storagechooser.filters.UniversalFileFilter;-import com.codekidlabs.storagechooser.models.Config;-import com.codekidlabs.storagechooser.utils.DiskUtil;-import com.codekidlabs.storagechooser.utils.FileUtil;-import com.codekidlabs.storagechooser.utils.ResourceUtil;-import com.google.android.material.floatingactionbutton.FloatingActionButton;--import java.io.File;-import java.util.ArrayList;-import java.util.Collections;-import java.util.Comparator;-import java.util.List;---import androidx.annotation.NonNull;-import androidx.annotation.Nullable;-import androidx.core.content.ContextCompat;--import static com.codekidlabs.storagechooser.StorageChooser.Theme;---public class SecondaryChooserFragment extends android.app.DialogFragment {-- private static final String INTERNAL_STORAGE_TITLE = "Internal Storage";- private static final String EXTERNAL_STORAGE_TITLE = "ExtSD";- private static final int FLAG_DISSMISS_NORMAL = 0;- private static final int FLAG_DISSMISS_INIT_DIALOG = 1;- private static boolean MODE_MULTIPLE = false;- private static String theSelectedPath = "";- private static String mAddressClippedPath = "";- private View mLayout;- private View mInactiveGradient;- private ViewGroup mContainer;- private TextView mPathChosen;- private ImageButton mBackButton;- private Button mSelectButton;- private Button mCreateButton;- private ImageView mNewFolderImageView;- private EditText mFolderNameEditText;- private FloatingActionButton mMultipleOnSelectButton;- private RelativeLayout mNewFolderView;- private ProgressBar mFilesProgress;- private String mBundlePath;- private ListView listView;- private boolean isOpen;- private List<String> customStoragesList;- private SecondaryChooserAdapter secondaryChooserAdapter;-- private FileUtil fileUtil;-- private int[] scheme;- private Config mConfig;- private Content mContent;- private Context mContext;- private Handler mHandler;- private ResourceUtil mResourceUtil;-- // multiple mode stuffs- private ArrayList<String> mMultipleModeList = new ArrayList<>();-- /**- * THE HOLY PLACE OF CLICK LISTENERS- */- private View.OnClickListener mSelectButtonClickListener = new View.OnClickListener() {- @Override- public void onClick(View view) {- if (mConfig.isActionSave()) {- DiskUtil.saveChooserPathPreference(mConfig.getPreference(), theSelectedPath);- } else {- Log.d("StorageChooser", "Chosen path: " + theSelectedPath);- }-- StorageChooser.onSelectListener.onSelect(theSelectedPath);- dissmissDialog(FLAG_DISSMISS_NORMAL);- }-- };- private View.OnClickListener mNewFolderButtonCloseListener = new View.OnClickListener() {- @Override- public void onClick(View view) {- hideAddFolderView();- hideKeyboard();- }- };- private View.OnClickListener mNewFolderButtonClickListener = new View.OnClickListener() {- @Override- public void onClick(View view) {- showAddFolderView();- }- };- private boolean keyboardToggle;- private final String TAG = "StorageChooser";- private boolean isFilePicker;- private View.OnClickListener mCreateButtonClickListener = new View.OnClickListener() {- @Override- public void onClick(View view) {- if (validateFolderName()) {- boolean success = FileUtil.createDirectory(mFolderNameEditText.getText().toString().trim(), theSelectedPath);- if (success) {- Toast.makeText(mContext, mContent.getFolderCreatedToastText(), Toast.LENGTH_SHORT).show();- trimPopulate(theSelectedPath);- hideKeyboard();- hideAddFolderView();- } else {- Toast.makeText(mContext, mContent.getFolderErrorToastText(), Toast.LENGTH_SHORT).show();- }- }- }- };- private AdapterView.OnItemClickListener mSingleModeClickListener = new AdapterView.OnItemClickListener() {- @Override- public void onItemClick(AdapterView<?> adapterView, View view, final int i, long l) {- mHandler.postDelayed(new Runnable() {- @Override- public void run() {- String jointPath = theSelectedPath + "/" + customStoragesList.get(i);- if (FileUtil.isDir(jointPath)) {- populateList("/" + customStoragesList.get(i));- } else {- StorageChooser.onSelectListener.onSelect(jointPath);- dissmissDialog(FLAG_DISSMISS_NORMAL);- }- }- }, 300);- }- };- private AdapterView.OnItemLongClickListener mLongClickListener = new AdapterView.OnItemLongClickListener() {- @Override- public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long l) {-- String jointPath = theSelectedPath + "/" + customStoragesList.get(i);-- if (!FileUtil.isDir(jointPath)) {- MODE_MULTIPLE = true;- listView.setOnItemClickListener(mMultipleModeClickListener);- handleListMultipleAction(i, view);- } else {- populateList("/" + customStoragesList.get(i));- }-- return true;- }- };--- private View.OnClickListener mBackButtonClickListener = new View.OnClickListener() {- @Override- public void onClick(View view) {- performBackAction();- }- };- private View.OnClickListener mMultipleModeDoneButtonClickListener = new View.OnClickListener() {- @Override- public void onClick(View view) {- StorageChooser.onMultipleSelectListener.onDone(mMultipleModeList);- bringBackSingleMode();- dissmissDialog(FLAG_DISSMISS_NORMAL);- }- };- private AdapterView.OnItemClickListener mMultipleModeClickListener = new AdapterView.OnItemClickListener() {- @Override- public void onItemClick(AdapterView<?> adapterView, View view, final int i, long l) {- String jointPath = theSelectedPath + "/" + customStoragesList.get(i);-- if (!FileUtil.isDir(jointPath)) {- handleListMultipleAction(i, view);- } else {- bringBackSingleMode();- populateList("/" + customStoragesList.get(i));- }-- }- };-- // ================ CLICK LISTENER END ==================-- private void showAddFolderView() {- mNewFolderView.setVisibility(View.VISIBLE);- Animation anim = AnimationUtils.loadAnimation(mContext, R.anim.anim_new_folder_view);- mNewFolderView.startAnimation(anim);- mInactiveGradient.startAnimation(anim);--- if (DiskUtil.isLollipopAndAbove()) {- mNewFolderImageView.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.drawable_plus_to_close));- // image button animation- Animatable animatable = (Animatable) mNewFolderImageView.getDrawable();- animatable.start();- }- mNewFolderImageView.setOnClickListener(mNewFolderButtonCloseListener);--// mNewFolderButton.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.window_close));-- //listview should not be clickable- SecondaryChooserAdapter.shouldEnable = false;- }-- private void hideAddFolderView() {- Animation anim = AnimationUtils.loadAnimation(mContext, R.anim.anim_close_folder_view);- mNewFolderView.startAnimation(anim);- mNewFolderView.setVisibility(View.INVISIBLE);-- if (DiskUtil.isLollipopAndAbove()) {- mNewFolderImageView.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.drawable_close_to_plus));- // image button animation- Animatable animatable = (Animatable) mNewFolderImageView.getDrawable();- animatable.start();- }- mNewFolderImageView.setOnClickListener(mNewFolderButtonClickListener);-- //listview should be clickable- SecondaryChooserAdapter.shouldEnable = true;-- mInactiveGradient.startAnimation(anim);- mInactiveGradient.setVisibility(View.INVISIBLE);--// mNewFolderButton.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.plus));- }-- private boolean isFolderViewVisible() {- return mNewFolderView.getVisibility() == View.VISIBLE;- }-- public void hideKeyboard() {- InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);- imm.hideSoftInputFromWindow(mFolderNameEditText.getWindowToken(), 0);-- }-- private void performBackAction() {- int slashIndex = theSelectedPath.lastIndexOf("/");-- if(slashIndex != -1) {- if (MODE_MULTIPLE) {- bringBackSingleMode();- secondaryChooserAdapter.notifyDataSetChanged();-- } else {- if (!mConfig.isSkipOverview()) {- if (theSelectedPath.equals(mBundlePath)) {- SecondaryChooserFragment.this.dismiss();-- //delay until close animation ends- mHandler.postDelayed(new Runnable() {- @Override- public void run() {- dissmissDialog(FLAG_DISSMISS_INIT_DIALOG);- }- }, 200);- } else {- theSelectedPath = theSelectedPath.substring(0, slashIndex);- StorageChooser.LAST_SESSION_PATH = theSelectedPath;- populateList("");- }- } else {- dissmissDialog(FLAG_DISSMISS_NORMAL);- }- }- } else {- // let's just say that there is no / in the path at any given point- // which is hard to imagine but.. what to do at that time ?- // we set it to bundle path until the issue is totally investigated- // TODO - dig deep about this condition !- theSelectedPath = mBundlePath;- StorageChooser.LAST_SESSION_PATH = theSelectedPath;- populateList("");- }-- }-- private void dissmissDialog(int flag) {-- switch (flag) {- case FLAG_DISSMISS_INIT_DIALOG:- ChooserDialogFragment c = new ChooserDialogFragment();- c.show(mConfig.getFragmentManager(), "storagechooser_dialog");- break;- case FLAG_DISSMISS_NORMAL:- StorageChooser.LAST_SESSION_PATH = theSelectedPath;- this.dismiss();- break;- }- }-- @Nullable- @Override- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {- mContainer = container;- if (getShowsDialog()) {- // one could return null here, or be nice and call super()- return super.onCreateView(inflater, container, savedInstanceState);- }- return getLayout(inflater, container);- }-- private View getLayout(LayoutInflater inflater, ViewGroup container) {- mConfig = StorageChooser.sConfig;- scheme = mConfig.getScheme();- mHandler = new Handler();-- // init storage-chooser content [localization]- if (mConfig.getContent() == null) {- mContent = new Content();- } else {- mContent = mConfig.getContent();- }-- final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(), R.style.DialogTheme);- LayoutInflater li = inflater.cloneInContext(contextThemeWrapper);-- mContext = getActivity().getApplicationContext();- mResourceUtil = new ResourceUtil(mContext);- mLayout = li.inflate(R.layout.custom_storage_list, container, false);-- initListView(mContext, mLayout, mConfig.isShowMemoryBar());-- initUI();- initNewFolderView();- updateUI();-- return mLayout;- }--- private void initUI() {-- mBackButton = mLayout.findViewById(R.id.back_button);- mSelectButton = mLayout.findViewById(R.id.select_button);- mMultipleOnSelectButton = mLayout.findViewById(R.id.multiple_selection_done_fab);-- mCreateButton = mLayout.findViewById(R.id.create_folder_button);-- mNewFolderView = mLayout.findViewById(R.id.new_folder_view);- mNewFolderView.setBackgroundColor(scheme[Theme.SEC_FOLDER_CREATION_BG_INDEX]);- mFolderNameEditText = mLayout.findViewById(R.id.et_folder_name);-- mInactiveGradient = mLayout.findViewById(R.id.inactive_gradient);-- (mLayout.findViewById(R.id.secondary_container)).setBackgroundColor(scheme[Theme.SEC_BG_INDEX]);-- }-- private void updateUI() {-- //at start dont show the new folder view unless user clicks on the add/plus button- mNewFolderView.setVisibility(View.INVISIBLE);- mInactiveGradient.setVisibility(View.INVISIBLE);--- mFolderNameEditText.setHint(mContent.getTextfieldHintText());-- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {- mFolderNameEditText.setHintTextColor(scheme[Theme.SEC_HINT_TINT_INDEX]);- }--- // set label of buttons [localization]- mSelectButton.setText(mContent.getSelectLabel());- mCreateButton.setText(mContent.getCreateLabel());--- // set colors- mSelectButton.setTextColor(scheme[Theme.SEC_SELECT_LABEL_INDEX]);- mPathChosen.setTextColor(scheme[Theme.SEC_ADDRESS_TINT_INDEX]);-- // set addressbar typeface- if (mConfig.getHeadingFont() != null) {- mPathChosen.setTypeface(ChooserDialogFragment.getSCTypeface(mContext,- mConfig.getHeadingFont(), mConfig.isHeadingFromAssets()));- }-- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {- mNewFolderImageView.setImageTintList(ColorStateList.valueOf(scheme[Theme.SEC_ADDRESS_TINT_INDEX]));- mBackButton.setImageTintList(ColorStateList.valueOf(scheme[Theme.SEC_ADDRESS_TINT_INDEX]));- }- mMultipleOnSelectButton.setBackgroundTintList(ColorStateList.valueOf(scheme[Theme.SEC_DONE_FAB_INDEX]));- mLayout.findViewById(R.id.custom_path_header).setBackgroundColor(scheme[Theme.SEC_ADDRESS_BAR_BG]);-- // ------ mBackButton.setOnClickListener(mBackButtonClickListener);- mSelectButton.setOnClickListener(mSelectButtonClickListener);- mCreateButton.setOnClickListener(mCreateButtonClickListener);- mMultipleOnSelectButton.setOnClickListener(mMultipleModeDoneButtonClickListener);-- if (mConfig.getSecondaryAction().equals(StorageChooser.FILE_PICKER)) {- mSelectButton.setVisibility(View.GONE);- setBottomNewFolderView();- }-- }-- private void setBottomNewFolderView() {- int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 80, getResources().getDisplayMetrics());- RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, height);- lp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);- mNewFolderView.setLayoutParams(lp);- }-- private void initNewFolderView() {-- RelativeLayout mNewFolderButtonHolder = mLayout.findViewById(R.id.new_folder_button_holder);-- mNewFolderImageView = mLayout.findViewById(R.id.new_folder_iv);- mNewFolderImageView.setOnClickListener(mNewFolderButtonClickListener);-- if (!mConfig.isAllowAddFolder()) {- mNewFolderButtonHolder.setVisibility(View.GONE);- }-- }--- /**- * storage listView related code in this block- */- private void initListView(Context context, View view, boolean shouldShowMemoryBar) {- listView = view.findViewById(R.id.storage_list_view);- mPathChosen = view.findViewById(R.id.path_chosen);- mFilesProgress = mLayout.findViewById(R.id.files_loader);- mFilesProgress.setIndeterminate(true);- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {- mFilesProgress.setIndeterminateTintList(ColorStateList.valueOf(scheme[Theme.OVERVIEW_MEMORYBAR_INDEX]));- }-- mBundlePath = this.getArguments().getString(DiskUtil.SC_PREFERENCE_KEY);- isFilePicker = this.getArguments().getBoolean(DiskUtil.SC_CHOOSER_FLAG, false);- populateList(mBundlePath);- secondaryChooserAdapter = new SecondaryChooserAdapter(customStoragesList, context, scheme,- mConfig.getListFont(), mConfig.isListFromAssets());- secondaryChooserAdapter.setPrefixPath(theSelectedPath);-- listView.setAdapter(secondaryChooserAdapter);- //listview should be clickable at first- SecondaryChooserAdapter.shouldEnable = true;- listView.setOnItemClickListener(mSingleModeClickListener);-- if (isFilePicker && mConfig.isMultiSelect()) {- listView.setOnItemLongClickListener(mLongClickListener);- }-- }-- /**- * handles actions in multiple mode- * like adding to list and setting background color- *- * @param i is position of list clicked- */- private void handleListMultipleAction(int i, View view) {- String jointPath = theSelectedPath + "/" + customStoragesList.get(i);-- // if this list path item is not selected before- if (!secondaryChooserAdapter.selectedPaths.contains(i)) {- view.setBackgroundColor(mResourceUtil.getPrimaryColorWithAlpha());-- secondaryChooserAdapter.selectedPaths.add(i);- mMultipleModeList.add(jointPath);-- } else {- //this item is selected before- secondaryChooserAdapter.selectedPaths.remove(secondaryChooserAdapter.selectedPaths.indexOf(i));- // reset bg to white- view.setBackgroundColor(scheme[Theme.SEC_BG_INDEX]);- mMultipleModeList.remove(mMultipleModeList.indexOf(jointPath));- }-- if (mMultipleOnSelectButton.getVisibility() != View.VISIBLE && MODE_MULTIPLE)- playTheMultipleButtonAnimation();-- if (listView.getOnItemLongClickListener() != null && MODE_MULTIPLE)- // long click listener in multiple mode ? haha nice joke- listView.setOnItemLongClickListener(null);-- if (mMultipleModeList.size() == 0)- bringBackSingleMode();- }--// private int getListIndex(int i) {-// for(int j=0; j<secondaryChooserAdapter.selectedPaths.size(); j++) {-// if()-// }-// }-- /**- * brings back the default state of storage-chooser- */- private void bringBackSingleMode() {- // if selected new directory end the multiple mode- MODE_MULTIPLE = false;- // set listview to single mode click- listView.setOnItemClickListener(mSingleModeClickListener);- // clear both path list and adapter item list- mMultipleModeList.clear();- secondaryChooserAdapter.selectedPaths.clear();- // remove access to done button- playTheMultipleButtonEndAnimation();- // aaaaaaaaand bring back long click listener- listView.setOnItemLongClickListener(mLongClickListener);- }--- /**- * evaluates path with respect to the list click position- *- * @param i position in list- */- private void evaluateAction(int i) {- String preDefPath = mConfig.getPredefinedPath();- boolean isCustom = mConfig.isAllowCustomPath();- if (preDefPath == null) {- Log.w(TAG, "No predefined path set");- } else if (isCustom) {- populateList("/" + customStoragesList.get(i));- }- }-- private boolean doesPassMemoryThreshold(long threshold, String memorySuffix, long availableSpace) {- return true;- }-- /**- * populate storageList with necessary storages with filter applied- *- * @param path defines the path for which list of folder is requested- */- private void populateList(String path) {- if (customStoragesList == null) {- customStoragesList = new ArrayList<>();- } else {- customStoragesList.clear();- }-- fileUtil = new FileUtil();- theSelectedPath = theSelectedPath + path;- if (secondaryChooserAdapter != null && secondaryChooserAdapter.getPrefixPath() != null) {- secondaryChooserAdapter.setPrefixPath(theSelectedPath);- }-- //if the path length is greater than that of the addressbar length- // we need to clip the starting part so that it fits the length and makes some room- int pathLength = theSelectedPath.length();- if (pathLength >= 25) {- // how many directories did user choose- int slashCount = getSlashCount(theSelectedPath);- if (slashCount > 2) {- mAddressClippedPath = theSelectedPath.substring(theSelectedPath.indexOf("/", theSelectedPath.indexOf("/") + 2), pathLength);- } else if (slashCount <= 2) {- mAddressClippedPath = theSelectedPath.substring(theSelectedPath.indexOf("/", theSelectedPath.indexOf("/") + 2), pathLength);- }- } else {- mAddressClippedPath = theSelectedPath;- }-- File[] volumeList;-- if (isFilePicker) {- if (mConfig.isCustomFilter()) {- // we need to start a async task here because the filter loops through all files- // and if the files are more it'll take ages and it'll cause ANR as this is- // running on main thread- new FileFilterTask(mConfig, true).execute();- } else {- if (mConfig.getSingleFilter() != null) {- new FileFilterTask(mConfig, false).execute();- } else {- volumeList = fileUtil.listFilesInDir(theSelectedPath);- setAdapterList(volumeList);- refreshList();- setBundlePathOnUpdate();- }- }- } else {- volumeList = fileUtil.listFilesAsDir(theSelectedPath);- setAdapterList(volumeList);- refreshList();- setBundlePathOnUpdate();- }-- playTheAddressBarAnimation();- }-- /**- * setBundlePathOnUpdate sets the mBundlePath on each list element change. Bundle path is used- * to change the main working directory of chooser.- */- public void setBundlePathOnUpdate() {- if (mConfig.isResumeSession() && StorageChooser.LAST_SESSION_PATH != null) {- if (StorageChooser.LAST_SESSION_PATH.startsWith(Environment.getExternalStorageDirectory().getAbsolutePath())) {- mBundlePath = Environment.getExternalStorageDirectory().getAbsolutePath();- } else {- mBundlePath = StorageChooser.LAST_SESSION_PATH.substring(StorageChooser.LAST_SESSION_PATH.indexOf("/", 16), StorageChooser.LAST_SESSION_PATH.length());- }- }- }-- /**- * Refreshes the list LOL. It checks if adapter is null and notifies change of list on each- * file list update.- */- public void refreshList() {- if (secondaryChooserAdapter != null) {- secondaryChooserAdapter.notifyDataSetChanged();- }- }-- /**- * Accepts a file list and sets it for use of storage chooser. Called before all refreshList()- *- * @param volumeList File list to be shown in storage chooser- */- public void setAdapterList(File[] volumeList) {- if (volumeList != null) {- for (File f : volumeList) {- if (mConfig.isShowHidden()) {- customStoragesList.add(f.getName());- } else {- if (!f.getName().startsWith(".")) {- customStoragesList.add(f.getName());- }- }- }-- Collections.sort(customStoragesList, new Comparator<String>() {- @Override- public int compare(String s1, String s2) {- return s1.compareToIgnoreCase(s2);- }- });- } else {- customStoragesList.clear();- }- }-- /**- * Unlike populate list trim populate only updates the list not the addressbar.- * This is used when creating new folder and update to list is required- *- * @param s is the path to be refreshed- */- private void trimPopulate(String s) {- if (customStoragesList == null) {- customStoragesList = new ArrayList<>();- } else {- customStoragesList.clear();- }- File[] volumeList;-- if (isFilePicker) {- volumeList = fileUtil.listFilesInDir(theSelectedPath);- } else {- volumeList = fileUtil.listFilesAsDir(theSelectedPath);- }-- Log.e("SCLib", theSelectedPath);- if (volumeList != null) {- for (File f : volumeList) {- if (!f.getName().startsWith(".")) {- customStoragesList.add(f.getName());- }- }-- Collections.sort(customStoragesList, new Comparator<String>() {- @Override- public int compare(String s1, String s2) {- return s1.compareToIgnoreCase(s2);- }- });- } else {- customStoragesList.clear();- }--- if (secondaryChooserAdapter != null) {- secondaryChooserAdapter.setPrefixPath(s);- secondaryChooserAdapter.notifyDataSetChanged();- }- }-- // ======================= ANIMATIONS =========================- private void playTheAddressBarAnimation() {- mPathChosen.setText(mAddressClippedPath);- Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.anim_address_bar);- mPathChosen.startAnimation(animation);- }--- private void playTheMultipleButtonAnimation() {- Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.anim_multiple_button);- mMultipleOnSelectButton.show();- mMultipleOnSelectButton.startAnimation(animation);- }--- private void playTheMultipleButtonEndAnimation() {- Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.anim_multiple_button_end);- mMultipleOnSelectButton.startAnimation(animation);- mMultipleOnSelectButton.hide();- }--- @NonNull- @Override- public Dialog onCreateDialog(Bundle savedInstanceState) {- Dialog d = StorageChooser.dialog;- if(getActivity() != null) {- d.setContentView(getLayout(LayoutInflater.from(getActivity().getApplicationContext()), mContainer));- }-- WindowManager.LayoutParams lp = new WindowManager.LayoutParams();- lp.copyFrom(d.getWindow().getAttributes());- lp.width = WindowManager.LayoutParams.MATCH_PARENT;- lp.height = WindowManager.LayoutParams.MATCH_PARENT;- d.getWindow().setAttributes(lp);- return d;- }-- @Override- public void onDismiss(DialogInterface dialog) {- super.onDismiss(dialog);- theSelectedPath = "";- mAddressClippedPath = "";- }-- @Override- public void onCancel(DialogInterface dialog) {- super.onCancel(dialog);- StorageChooser.LAST_SESSION_PATH = theSelectedPath;- theSelectedPath = "";- mAddressClippedPath = "";-- StorageChooser.onCancelListener.onCancel();- }-- private int getSlashCount(String path) {- int count = 0;-- for (char s : path.toCharArray()) {- if (s == '/') {- count++;- }- }- return count;- }-- /**- * Checks if edit text field is empty or not. Since there is only one edit text here no- * param is required for now.- */- private boolean validateFolderName() {- if (mFolderNameEditText.getText().toString().trim().isEmpty()) {- mFolderNameEditText.setError(mContent.getTextfieldErrorText());- return false;- }- return true;- }-- @SuppressLint("StaticFieldLeak")- class FileFilterTask extends AsyncTask<Void, String, Boolean> {-- private Config mConfig;- private boolean isMultiple;- private File[] fileList;-- FileFilterTask(Config mConfig, boolean isMultiple) {- this.mConfig = mConfig;- this.isMultiple = isMultiple;- }-- @Override- protected void onPreExecute() {- super.onPreExecute();- mFilesProgress.setVisibility(View.VISIBLE);- }-- @Override- protected Boolean doInBackground(Void... voids) {- if (isMultiple) {- UniversalFileFilter universalFileFilter =- new UniversalFileFilter(mConfig.isCustomFilter(), mConfig.getCustomEnum());- fileList = new File(theSelectedPath)- .listFiles(universalFileFilter);- } else {- fileList = new File(theSelectedPath).listFiles(new UniversalFileFilter(mConfig.getSingleFilter()));- }- return true;- }-- @Override- protected void onPostExecute(Boolean aBoolean) {- super.onPostExecute(aBoolean);- mFilesProgress.setVisibility(View.INVISIBLE);- setAdapterList(this.fileList);- refreshList();- setBundlePathOnUpdate();- }- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/models/Config.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/models/Config.javadeleted file mode 100644index 10bfb96..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/models/Config.java+++ /dev/null@@ -1,298 +0,0 @@-package com.codekidlabs.storagechooser.models;--import android.content.SharedPreferences;-import android.widget.ListView;--import com.codekidlabs.storagechooser.Content;-import com.codekidlabs.storagechooser.StorageChooser;--import java.util.ArrayList;-import java.util.List;--/**- * Model to save configs passed to the Builder without passing too many things to the constructor- * of its super class.- */-public class Config {-- private android.app.FragmentManager fragmentManager;- private String predefinedPath;- private boolean showMemoryBar;- private boolean hideFreeSpaceLabel;- private float memorybarHeight;- private boolean actionSave;- private SharedPreferences preference;- private int memoryThreshold;- private String thresholdSuffix;- private String dialogTitle;- private String internalStorageText;- private boolean allowCustomPath;- private boolean allowAddFolder;- private boolean showHidden;- private boolean skipOverview;- private boolean applyThreshold;- private String primaryPath;- private boolean isGridView;- private boolean resumeSession;- //typeface config- private String headingFont;- private String listFont;- private boolean headingFromAssets;- private boolean listFromAssets;-- //multi- private boolean multiSelect = true;-- private String secondaryAction;-- private Content content;- private int[] scheme;- private StorageChooser.FileType singleFilter;- private List<String> customEnum;- private boolean customFilter;--- public android.app.FragmentManager getFragmentManager() {- return fragmentManager;- }-- public void setFragmentManager(android.app.FragmentManager fragmentManager) {- this.fragmentManager = fragmentManager;- }-- public String getPredefinedPath() {- return predefinedPath;- }-- public void setPredefinedPath(String predefinedPath) {- this.predefinedPath = predefinedPath;- }-- public boolean isShowMemoryBar() {- return showMemoryBar;- }-- public void setShowMemoryBar(boolean showMemoryBar) {- this.showMemoryBar = showMemoryBar;- }-- public boolean isHideFreeSpaceLabel() {- return hideFreeSpaceLabel;- }-- public void setHideFreeSpaceLabel(boolean hideFreeSpaceLabel) {- this.hideFreeSpaceLabel = hideFreeSpaceLabel;- }-- public boolean isActionSave() {- return actionSave;- }-- public void setActionSave(boolean actionSave) {- this.actionSave = actionSave;- }-- public SharedPreferences getPreference() {- return preference;- }-- public void setPreference(SharedPreferences preference) {- this.preference = preference;- }-- public int getMemoryThreshold() {- return memoryThreshold;- }-- public void setMemoryThreshold(int memoryThreshold) {- this.memoryThreshold = memoryThreshold;- }-- public String getThresholdSuffix() {- return thresholdSuffix;- }-- public void setThresholdSuffix(String thresholdSuffix) {- this.thresholdSuffix = thresholdSuffix;- }-- public String getDialogTitle() {- return dialogTitle;- }-- public void setDialogTitle(String dialogTitle) {- this.dialogTitle = dialogTitle;- }-- public String getInternalStorageText() {- return internalStorageText;- }-- public void setInternalStorageText(String internalStorageText) {- this.internalStorageText = internalStorageText;- }-- public boolean isAllowCustomPath() {- return allowCustomPath;- }-- public void setAllowCustomPath(boolean allowCustomPath) {- this.allowCustomPath = allowCustomPath;- }-- public boolean isAllowAddFolder() {- return allowAddFolder;- }-- public void setAllowAddFolder(boolean allowAddFolder) {- this.allowAddFolder = allowAddFolder;- }-- public boolean isShowHidden() {- return showHidden;- }-- public void setShowHidden(boolean showHidden) {- this.showHidden = showHidden;- }--- public String getSecondaryAction() {- return secondaryAction;- }-- public void setSecondaryAction(String secondaryAction) {- this.secondaryAction = secondaryAction;- }--- public String getPrimaryPath() {- return primaryPath;- }-- public void setPrimaryPath(String primaryPath) {- this.primaryPath = primaryPath;- }-- public boolean isSkipOverview() {- return skipOverview;- }-- public void setSkipOverview(boolean skipOverview) {- this.skipOverview = skipOverview;- }-- public boolean isApplyThreshold() {- return applyThreshold;- }-- public void setApplyThreshold(boolean applyThreshold) {- this.applyThreshold = applyThreshold;- }--- public Content getContent() {- return content;- }-- public void setContent(Content content) {- this.content = content;- }--- public StorageChooser.FileType getSingleFilter() {- return singleFilter;- }-- public void setSingleFilter(StorageChooser.FileType singleFilter) {- this.singleFilter = singleFilter;- }-- public List<String> getCustomEnum() {- return customEnum;- }-- public void setCustomEnum(List<String> customEnum) {- this.customEnum = customEnum;- }-- public boolean isCustomFilter() {- return customFilter;- }-- public void setCustomFilter(boolean customFilter) {- this.customFilter = customFilter;- }-- public boolean isGridView() {- return isGridView;- }-- public void setGridView(boolean gridView) {- isGridView = gridView;- }-- public boolean isResumeSession() {- return resumeSession;- }-- public void setResumeSession(boolean resumeSession) {- this.resumeSession = resumeSession;- }-- public int[] getScheme() {- return scheme;- }-- public void setScheme(int[] scheme) {- this.scheme = scheme;- }-- public float getMemorybarHeight() {- return memorybarHeight;- }-- public void setMemorybarHeight(float memorybarHeight) {- this.memorybarHeight = memorybarHeight;- }-- public String getHeadingFont() {- return headingFont;- }-- public void setHeadingFont(String headingFont) {- this.headingFont = headingFont;- }-- public String getListFont() {- return listFont;- }-- public void setListFont(String listFont) {- this.listFont = listFont;- }-- public boolean isHeadingFromAssets() {- return headingFromAssets;- }-- public void setHeadingFromAssets(boolean headingFromAssets) {- this.headingFromAssets = headingFromAssets;- }-- public boolean isListFromAssets() {- return listFromAssets;- }-- public void setListFromAssets(boolean listFromAssets) {- this.listFromAssets = listFromAssets;- }-- public boolean isMultiSelect() {- return multiSelect;- }-- public void setMultiSelect(boolean multiSelect) {- this.multiSelect = multiSelect;- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/models/Storages.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/models/Storages.javadeleted file mode 100644index ced0018..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/models/Storages.java+++ /dev/null@@ -1,45 +0,0 @@-package com.codekidlabs.storagechooser.models;--/**- * A model that is used as the element to store any data regarding storage volumes/disks- */-public class Storages {-- String storageTitle;- String storagePath;- String memoryTotalSize;- String memoryAvailableSize;--- public String getStorageTitle() {- return storageTitle;- }-- public void setStorageTitle(String storageTitle) {- this.storageTitle = storageTitle;- }-- public String getStoragePath() {- return storagePath;- }-- public void setStoragePath(String storagePath) {- this.storagePath = storagePath;- }-- public String getMemoryTotalSize() {- return memoryTotalSize;- }-- public void setMemoryTotalSize(String memoryTotalSize) {- this.memoryTotalSize = memoryTotalSize;- }-- public String getMemoryAvailableSize() {- return memoryAvailableSize;- }-- public void setMemoryAvailableSize(String memoryAvailableSize) {- this.memoryAvailableSize = memoryAvailableSize;- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/DiskUtil.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/DiskUtil.javadeleted file mode 100644index 8ad2504..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/DiskUtil.java+++ /dev/null@@ -1,71 +0,0 @@-package com.codekidlabs.storagechooser.utils;---import android.content.SharedPreferences;-import android.os.Build;-import android.os.Bundle;-import android.util.Log;--import com.codekidlabs.storagechooser.StorageChooser;-import com.codekidlabs.storagechooser.fragments.SecondaryChooserFragment;-import com.codekidlabs.storagechooser.models.Config;--public class DiskUtil {-- public static final String IN_KB = "KiB";- public static final String IN_MB = "MiB";- public static final String IN_GB = "GiB";- public static final String SC_PREFERENCE_KEY = "storage_chooser_path";- public static java.lang.String SC_CHOOSER_FLAG = "storage_chooser_type";-- public static int getSdkVersion() {- return Build.VERSION.SDK_INT;- }-- public static void saveChooserPathPreference(SharedPreferences sharedPreferences, String path) {- try {- SharedPreferences.Editor editor = sharedPreferences.edit();- editor.putString(SC_PREFERENCE_KEY, path);- editor.apply();- } catch (NullPointerException e) {- Log.e("StorageChooser", "No sharedPreference was supplied. Supply sharedPreferencesObject via withPreference() or disable saving with actionSave(false)");- }- }-- public static boolean isLollipopAndAbove() {- return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;- }-- /**- * secondary choosers are dialogs apart from overview (CustomChooserFragment and FilePickerFragment)- * Configs :-- * setType()- * allowCustomPath()- *- * @param dirPath root path(starting-point) for the secondary choosers- * @param config configuration from developer- */-- public static void showSecondaryChooser(String dirPath, Config config) {-- Bundle bundle = new Bundle();- bundle.putString(DiskUtil.SC_PREFERENCE_KEY, dirPath);-- switch (config.getSecondaryAction()) {- case StorageChooser.NONE:- break;- case StorageChooser.DIRECTORY_CHOOSER:- bundle.putBoolean(DiskUtil.SC_CHOOSER_FLAG, false);- SecondaryChooserFragment c = new SecondaryChooserFragment();- c.setArguments(bundle);- c.show(config.getFragmentManager(), "custom_chooser");- break;- case StorageChooser.FILE_PICKER:- bundle.putBoolean(DiskUtil.SC_CHOOSER_FLAG, true);- SecondaryChooserFragment f = new SecondaryChooserFragment();- f.setArguments(bundle);- f.show(config.getFragmentManager(), "file_picker");- break;- }- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/FileUtil.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/FileUtil.javadeleted file mode 100644index e50bc4c..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/FileUtil.java+++ /dev/null@@ -1,72 +0,0 @@-package com.codekidlabs.storagechooser.utils;--import java.io.File;-import java.io.FileFilter;-import java.util.Arrays;-import java.util.List;--/**- * manages each and everything related to file api- */--public class FileUtil {-- public static boolean createDirectory(String name, String path) {- File dir = new File(path + "/" + name);- return dir.mkdirs();- }-- public static boolean isDir(String path) {- return new File(path).isDirectory();- }-- public File[] listFilesAsDir(String dirPath) {- return new File(dirPath).listFiles(new FileFilter() {- @Override- public boolean accept(File file) {- return file.isDirectory();- }- });- }-- public File[] listFilesInDir(String dirPath) {- return new File(dirPath).listFiles();- }-- public String[] arrangeAscending(String[] dirNames) {- Arrays.sort(dirNames);- return dirNames;- }-- /**- * Removes non-operationaal directories which are either used by only the system or- * not used by anyone- */- public void removeNonOperational(List<File> volumeList) {- // segregate the list-- for (int i = 0; i < volumeList.size(); i++) {- String volumeName = volumeList.get(i).getName();- if (volumeName.equals(MemoryUtil.SELF_DIR_NAME)) {- volumeList.remove(i);- }- if (volumeName.equals(MemoryUtil.EMULATED_DIR_NAME)) {- volumeList.remove(i);- }- if (volumeName.equals(MemoryUtil.EMULATED_DIR_KNOX)) {- volumeList.remove(i);- }- if (volumeName.equals(MemoryUtil.SDCARD0_DIR_NAME)) {- volumeList.remove(i);- }- }- }-- public String[] fileListToStringArray(List<String> dirNames) {- String[] dirList = new String[dirNames.size()];- for (int i = 0; i < dirNames.size(); i++) {- dirList[i] = dirNames.get(i);- }- return dirList;- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/MemoryUtil.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/MemoryUtil.javadeleted file mode 100644index d279bf9..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/MemoryUtil.java+++ /dev/null@@ -1,125 +0,0 @@-package com.codekidlabs.storagechooser.utils;---import android.os.StatFs;--import java.io.File;-import java.util.ArrayList;-import java.util.Collections;-import java.util.List;--public class MemoryUtil {-- public static final String SELF_DIR_NAME = "self";- public static final String EMULATED_DIR_NAME = "emulated";- public static final String EMULATED_DIR_KNOX = "knox-emulated";- public static final String SDCARD0_DIR_NAME = "sdcard0";- public static final String CONTAINER = "container";- private static final String ERROR = "error";-- public boolean isExternalStoragePresent() {- return getStorageListSize() != 1;- }-- /**- * Returns an the number of the files inside '/storage' directory- *- * @return int - number of storages present except the redundant once- */- public int getStorageListSize() {- File storageDir = new File("/storage");- List<File> volumeList = new ArrayList<>();- Collections.addAll(volumeList, storageDir.listFiles());- // segregate the list- for (int i = 0; i < volumeList.size(); i++) {- String storageName = volumeList.get(i).getName();- if (storageName.equals(SELF_DIR_NAME) ||- storageName.equals(EMULATED_DIR_KNOX) ||- storageName.equals(EMULATED_DIR_KNOX) ||- storageName.equals(SDCARD0_DIR_NAME) ||- storageName.equals(CONTAINER)) {- volumeList.remove(i);- }- }-- return volumeList.size();- }--- /**- * calculate available/free size of any directory- *- * @param path path of the storage- * @return size in bytes- */- public long getAvailableMemorySize(String path) {- File file = new File(path);- StatFs stat = new StatFs(file.getPath());- long blockSize = stat.getBlockSize();- long availableBlocks = stat.getAvailableBlocks();- return availableBlocks * blockSize;- }-- /**- * calculate total size of any directory- *- * @param path path of the storage- * @return size in bytes- */- public long getTotalMemorySize(String path) {- File file = new File(path);- StatFs stat = new StatFs(file.getPath());- long blockSize = stat.getBlockSize();- long totalBlocks = stat.getBlockCount();- return totalBlocks * blockSize;- }-- /**- * mainly to format the available bytes into user readable string- *- * @param size long - value gained from the getTotalMemorySize() and getAvailableMemorySize()- * using StatFs- * @return a formatted string with KiB, MiB, GiB suffix- */- public String formatSize(long size) {- String suffix = null;-- if (size >= 1024) {- suffix = "KiB";- size /= 1024;- if (size >= 1024) {- suffix = "MiB";- size /= 1024;- if (size >= 1024) {- suffix = "GiB";- size /= 1024;- }- }- }-- StringBuilder resultBuffer = new StringBuilder(Long.toString(size));-- int commaOffset = resultBuffer.length() - 3;- while (commaOffset > 0) {- resultBuffer.insert(commaOffset, ',');- commaOffset -= 3;- }-- if (suffix != null) resultBuffer.append(suffix);- return resultBuffer.toString();- }-- public long suffixedSize(long size, String suffix) {-- switch (suffix) {- case "KiB":- return size / 1024;- case "MiB":- return (long) (size / Math.pow(1024, 2));- case "GiB":- return (long) (size / Math.pow(1024, 3));- default:- return 0;- }- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/ResourceUtil.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/ResourceUtil.javadeleted file mode 100644index 5491b50..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/ResourceUtil.java+++ /dev/null@@ -1,29 +0,0 @@-package com.codekidlabs.storagechooser.utils;---import android.content.Context;-import androidx.core.content.ContextCompat;-import androidx.core.graphics.ColorUtils;--import com.codekidlabs.storagechooser.R;--public class ResourceUtil {-- private Context context;-- public ResourceUtil(Context context) {- this.context = context;- }-- public int getColor(int id) {- return ContextCompat.getColor(context, id);- }-- public int getAppliedAlpha(int color) {- return ColorUtils.setAlphaComponent(color, 50);- }-- public int getPrimaryColorWithAlpha() {- return getAppliedAlpha(getColor(R.color.colorPrimary));- }-}diff --git a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/ThumbnailUtil.java b/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/ThumbnailUtil.javadeleted file mode 100644index 36d249c..0000000--- a/android/storagechooser/src/main/java/com/codekidlabs/storagechooser/utils/ThumbnailUtil.java+++ /dev/null@@ -1,122 +0,0 @@-package com.codekidlabs.storagechooser.utils;--import android.content.Context;-import android.graphics.drawable.Drawable;-import androidx.core.content.ContextCompat;-import android.widget.ImageView;--import com.codekidlabs.storagechooser.R;--public class ThumbnailUtil {-- // Constant extensions- private static final String TEXT_FILE = "txt";- private static final String LOG_FILE = "log";- private static final String CSV_FILE = "csv";- private static final String PROP_FILE = "prop";- // video files- private static final String VIDEO_FILE = "mp4";- private static final String VIDEO_MOV_FILE = "mov";- private static final String VIDEO_AVI_FILE = "avi";- private static final String VIDEO_MKV_FILE = "mkv";- // audio files- private static final String AUDIO_FILE = "mp3";- // image files- private static final String JPEG_FILE = "jpeg";- private static final String JPG_FILE = "jpg";- private static final String PNG_FILE = "png";- private static final String GIF_FILE = "gif";- //archive files- private static final String APK_FILE = "apk";- private static final String ZIP_FILE = "zip";- private static final String RAR_FILE = "rar";- private static final String TAR_GZ_FILE = "gz";- private static final String TAR_FILE = "tar";- // office files- private static final String DOC_FILE = "doc";- private static final String PPT_FILE = "ppt";- private static final String EXCEL_FILE = "xls";- private static final String PDF_FILE = "pdf";- // font files- private static final String TTF_FILE = "ttf";- private static final String OTF_FILE = "otf";- // torrent files- private static final String TORRENtT_FILE = "torrent";- //web files- private static final String HTML_FILE = "html";- private static final String PHP_FILE = "php";- private static final String CSS_FILE = "css";- private static final String CR_DL_FILE = "crdownload";- private Context mContext;-- public ThumbnailUtil(Context mContext) {- this.mContext = mContext;- }-- public void init(ImageView imageView, String filePath) {- thumbnailPipe(imageView, filePath);- }-- private void thumbnailPipe(ImageView imageView, String filePath) {- String extension = getExtension(filePath);--- switch (extension) {- case TEXT_FILE:- case CSV_FILE:- case DOC_FILE:- case PROP_FILE:- case LOG_FILE:- imageView.setImageDrawable(getDrawableFromRes(R.drawable.doc));- break;- case VIDEO_FILE:- case VIDEO_AVI_FILE:- case VIDEO_MOV_FILE:- case VIDEO_MKV_FILE:- imageView.setImageDrawable(getDrawableFromRes(R.drawable.mov));- break;- case APK_FILE:- imageView.setImageDrawable(getDrawableFromRes(R.drawable.apk));- break;- case AUDIO_FILE:- imageView.setImageDrawable(getDrawableFromRes(R.drawable.music));- break;- case ZIP_FILE:- case RAR_FILE:- case TAR_FILE:- case TAR_GZ_FILE:- imageView.setImageDrawable(getDrawableFromRes(R.drawable.zip));- break;- case JPEG_FILE:- case JPG_FILE:- case PNG_FILE:- case GIF_FILE:- imageView.setImageDrawable(getDrawableFromRes(R.drawable.pic));- break;- case TTF_FILE:- case OTF_FILE:- imageView.setImageDrawable(getDrawableFromRes(R.drawable.font));- break;- case HTML_FILE:- case PHP_FILE:- case CSS_FILE:- case CR_DL_FILE:- imageView.setImageDrawable(getDrawableFromRes(R.drawable.web));- break;- case TORRENtT_FILE:- imageView.setImageDrawable(getDrawableFromRes(R.drawable.torrent));- break;- case PDF_FILE:- imageView.setImageDrawable(getDrawableFromRes(R.drawable.pdf));- break;- }- }-- private Drawable getDrawableFromRes(int id) {- return ContextCompat.getDrawable(mContext, id);- }-- private String getExtension(String path) {- return path.substring(path.lastIndexOf(".") + 1, path.length());- }-}diff --git a/android/storagechooser/src/main/res/anim/anim_address_bar.xml b/android/storagechooser/src/main/res/anim/anim_address_bar.xmldeleted file mode 100644index 932e910..0000000--- a/android/storagechooser/src/main/res/anim/anim_address_bar.xml+++ /dev/null@@ -1,15 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<set xmlns:android="http://schemas.android.com/apk/res/android"- android:fillAfter="true"- android:interpolator="@android:anim/linear_interpolator">-- <translate- android:duration="500"- android:fromYDelta="-20%p"- android:toYDelta="0%p" />-- <alpha- android:duration="400"- android:fromAlpha="0"- android:toAlpha="1" />-</set>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/anim/anim_close_folder_view.xml b/android/storagechooser/src/main/res/anim/anim_close_folder_view.xmldeleted file mode 100644index cabeeb7..0000000--- a/android/storagechooser/src/main/res/anim/anim_close_folder_view.xml+++ /dev/null@@ -1,10 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<set xmlns:android="http://schemas.android.com/apk/res/android"- android:fillAfter="true"- android:interpolator="@android:anim/accelerate_decelerate_interpolator">-- <alpha- android:duration="300"- android:fromAlpha="1"- android:toAlpha="0" />-</set>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/anim/anim_multiple_button.xml b/android/storagechooser/src/main/res/anim/anim_multiple_button.xmldeleted file mode 100644index 1202cce..0000000--- a/android/storagechooser/src/main/res/anim/anim_multiple_button.xml+++ /dev/null@@ -1,10 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<set xmlns:android="http://schemas.android.com/apk/res/android"- android:fillAfter="true"- android:interpolator="@android:anim/linear_interpolator">-- <translate- android:duration="500"- android:fromYDelta="50%p"- android:toYDelta="0%p" />-</set>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/anim/anim_multiple_button_end.xml b/android/storagechooser/src/main/res/anim/anim_multiple_button_end.xmldeleted file mode 100644index e441d03..0000000--- a/android/storagechooser/src/main/res/anim/anim_multiple_button_end.xml+++ /dev/null@@ -1,10 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<set xmlns:android="http://schemas.android.com/apk/res/android"- android:fillAfter="true"- android:interpolator="@android:anim/linear_interpolator">-- <translate- android:duration="500"- android:fromYDelta="0%p"- android:toYDelta="50%p" />-</set>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/anim/anim_new_folder_view.xml b/android/storagechooser/src/main/res/anim/anim_new_folder_view.xmldeleted file mode 100644index 46447bf..0000000--- a/android/storagechooser/src/main/res/anim/anim_new_folder_view.xml+++ /dev/null@@ -1,10 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<set xmlns:android="http://schemas.android.com/apk/res/android"- android:fillAfter="true"- android:interpolator="@android:anim/accelerate_decelerate_interpolator">-- <alpha- android:duration="300"- android:fromAlpha="0"- android:toAlpha="1" />-</set>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/animator/rotation.xml b/android/storagechooser/src/main/res/animator/rotation.xmldeleted file mode 100644index 244b236..0000000--- a/android/storagechooser/src/main/res/animator/rotation.xml+++ /dev/null@@ -1,5 +0,0 @@-<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"- android:duration="400"- android:propertyName="rotation"- android:valueFrom="0"- android:valueTo="135" />\ No newline at end of filediff --git a/android/storagechooser/src/main/res/animator/rotation_reverse.xml b/android/storagechooser/src/main/res/animator/rotation_reverse.xmldeleted file mode 100644index 68a9e95..0000000--- a/android/storagechooser/src/main/res/animator/rotation_reverse.xml+++ /dev/null@@ -1,5 +0,0 @@-<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"- android:duration="400"- android:propertyName="rotation"- android:valueFrom="135"- android:valueTo="0" />\ No newline at end of filediff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_black_18dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_check_black_18dp.pngdeleted file mode 100644index d337b9e..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_black_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_black_24dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_check_black_24dp.pngdeleted file mode 100644index 82c713c..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_black_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_black_36dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_check_black_36dp.pngdeleted file mode 100644index 10d365b..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_black_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_black_48dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_check_black_48dp.pngdeleted file mode 100644index 7e4fa28..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_black_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_grey600_18dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_check_grey600_18dp.pngdeleted file mode 100644index 8618287..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_grey600_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_grey600_24dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_check_grey600_24dp.pngdeleted file mode 100644index 699b818..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_grey600_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_grey600_36dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_check_grey600_36dp.pngdeleted file mode 100644index e82ac99..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_grey600_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_grey600_48dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_check_grey600_48dp.pngdeleted file mode 100644index ff88bb6..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_grey600_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_white_18dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_check_white_18dp.pngdeleted file mode 100644index 0f02b80..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_white_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_white_24dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_check_white_24dp.pngdeleted file mode 100644index 57c68b5..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_white_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_white_36dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_check_white_36dp.pngdeleted file mode 100644index 5e5e735..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_white_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_white_48dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_check_white_48dp.pngdeleted file mode 100644index f2459c8..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_check_white_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_black_18dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_black_18dp.pngdeleted file mode 100644index f09f863..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_black_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_black_24dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_black_24dp.pngdeleted file mode 100644index 132b997..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_black_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_black_36dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_black_36dp.pngdeleted file mode 100644index 9d889e7..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_black_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_black_48dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_black_48dp.pngdeleted file mode 100644index 84dbf6e..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_black_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_grey600_18dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_grey600_18dp.pngdeleted file mode 100644index 3de19e7..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_grey600_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_grey600_24dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_grey600_24dp.pngdeleted file mode 100644index 5830118..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_grey600_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_grey600_36dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_grey600_36dp.pngdeleted file mode 100644index 5416c67..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_grey600_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_grey600_48dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_grey600_48dp.pngdeleted file mode 100644index c065a72..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_grey600_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_white_18dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_white_18dp.pngdeleted file mode 100644index 376bb5f..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_white_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_white_24dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_white_24dp.pngdeleted file mode 100644index 5451a7e..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_white_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_white_36dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_white_36dp.pngdeleted file mode 100644index dcde744..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_white_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_white_48dp.png b/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_white_48dp.pngdeleted file mode 100644index bf1e764..0000000Binary files a/android/storagechooser/src/main/res/drawable-hdpi/ic_chevron_left_white_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_black_18dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_check_black_18dp.pngdeleted file mode 100644index 6b7927f..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_black_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_black_24dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_check_black_24dp.pngdeleted file mode 100644index 81aaa6c..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_black_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_black_36dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_check_black_36dp.pngdeleted file mode 100644index f94af19..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_black_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_black_48dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_check_black_48dp.pngdeleted file mode 100644index 5e27c79..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_black_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_grey600_18dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_check_grey600_18dp.pngdeleted file mode 100644index 7cab813..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_grey600_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_grey600_24dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_check_grey600_24dp.pngdeleted file mode 100644index 544ecb5..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_grey600_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_grey600_36dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_check_grey600_36dp.pngdeleted file mode 100644index 3b60d6a..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_grey600_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_grey600_48dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_check_grey600_48dp.pngdeleted file mode 100644index 51a14a0..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_grey600_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_white_18dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_check_white_18dp.pngdeleted file mode 100644index 4a3e3c3..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_white_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_white_24dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_check_white_24dp.pngdeleted file mode 100644index e4fddf5..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_white_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_white_36dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_check_white_36dp.pngdeleted file mode 100644index 1d931e1..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_white_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_white_48dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_check_white_48dp.pngdeleted file mode 100644index 5d9d2e9..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_check_white_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_black_18dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_black_18dp.pngdeleted file mode 100644index a33cc73..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_black_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_black_24dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_black_24dp.pngdeleted file mode 100644index 7c9fc9d..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_black_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_black_36dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_black_36dp.pngdeleted file mode 100644index 132b997..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_black_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_black_48dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_black_48dp.pngdeleted file mode 100644index 7d31cd8..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_black_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_grey600_18dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_grey600_18dp.pngdeleted file mode 100644index 4669b6d..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_grey600_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_grey600_24dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_grey600_24dp.pngdeleted file mode 100644index 5c26503..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_grey600_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_grey600_36dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_grey600_36dp.pngdeleted file mode 100644index 5830118..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_grey600_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_grey600_48dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_grey600_48dp.pngdeleted file mode 100644index 08ddc52..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_grey600_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_white_18dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_white_18dp.pngdeleted file mode 100644index 0d93ba0..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_white_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_white_24dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_white_24dp.pngdeleted file mode 100644index 03b3228..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_white_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_white_36dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_white_36dp.pngdeleted file mode 100644index 5451a7e..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_white_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_white_48dp.png b/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_white_48dp.pngdeleted file mode 100644index 9231b26..0000000Binary files a/android/storagechooser/src/main/res/drawable-mdpi/ic_chevron_left_white_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/apk.png b/android/storagechooser/src/main/res/drawable-nodpi/apk.pngdeleted file mode 100644index 4a29dd5..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/apk.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/doc.png b/android/storagechooser/src/main/res/drawable-nodpi/doc.pngdeleted file mode 100644index 45f5146..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/doc.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/excel.png b/android/storagechooser/src/main/res/drawable-nodpi/excel.pngdeleted file mode 100644index e36939d..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/excel.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/font.png b/android/storagechooser/src/main/res/drawable-nodpi/font.pngdeleted file mode 100644index 3ea7945..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/font.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/ic_folder_icon.png b/android/storagechooser/src/main/res/drawable-nodpi/ic_folder_icon.pngdeleted file mode 100644index f986d0a..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/ic_folder_icon.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/link.png b/android/storagechooser/src/main/res/drawable-nodpi/link.pngdeleted file mode 100644index d798cee..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/link.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/mov.png b/android/storagechooser/src/main/res/drawable-nodpi/mov.pngdeleted file mode 100644index 5516fab..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/mov.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/music.png b/android/storagechooser/src/main/res/drawable-nodpi/music.pngdeleted file mode 100644index c5c2dd5..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/music.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/pdf.png b/android/storagechooser/src/main/res/drawable-nodpi/pdf.pngdeleted file mode 100644index cb27870..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/pdf.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/pic.png b/android/storagechooser/src/main/res/drawable-nodpi/pic.pngdeleted file mode 100644index 159b2b8..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/pic.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/torrent.png b/android/storagechooser/src/main/res/drawable-nodpi/torrent.pngdeleted file mode 100644index 72bd6ff..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/torrent.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/web.png b/android/storagechooser/src/main/res/drawable-nodpi/web.pngdeleted file mode 100644index 2ead7d2..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/web.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-nodpi/zip.png b/android/storagechooser/src/main/res/drawable-nodpi/zip.pngdeleted file mode 100644index 5c41c58..0000000Binary files a/android/storagechooser/src/main/res/drawable-nodpi/zip.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-v21/drawable_close_to_plus.xml b/android/storagechooser/src/main/res/drawable-v21/drawable_close_to_plus.xmldeleted file mode 100644index b6de988..0000000--- a/android/storagechooser/src/main/res/drawable-v21/drawable_close_to_plus.xml+++ /dev/null@@ -1,6 +0,0 @@-<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"- android:drawable="@drawable/plus">- <target- android:name="rotationGroup"- android:animation="@animator/rotation_reverse" />-</animated-vector>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/drawable-v21/drawable_plus_to_close.xml b/android/storagechooser/src/main/res/drawable-v21/drawable_plus_to_close.xmldeleted file mode 100644index 86c3254..0000000--- a/android/storagechooser/src/main/res/drawable-v21/drawable_plus_to_close.xml+++ /dev/null@@ -1,6 +0,0 @@-<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"- android:drawable="@drawable/plus">- <target- android:name="rotationGroup"- android:animation="@animator/rotation" />-</animated-vector>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/drawable-v21/ripple.xml b/android/storagechooser/src/main/res/drawable-v21/ripple.xmldeleted file mode 100644index 714ff94..0000000--- a/android/storagechooser/src/main/res/drawable-v21/ripple.xml+++ /dev/null@@ -1,7 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<ripple xmlns:android="http://schemas.android.com/apk/res/android"- android:color="@color/colorPrimary">- <item android:id="@android:id/mask">- <color android:color="@color/colorPrimary" />- </item>-</ripple>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_black_18dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_black_18dp.pngdeleted file mode 100644index 1edcbf9..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_black_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_black_24dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_black_24dp.pngdeleted file mode 100644index c1c067b..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_black_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_black_36dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_black_36dp.pngdeleted file mode 100644index 9a34b05..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_black_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_black_48dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_black_48dp.pngdeleted file mode 100644index cb7e516..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_black_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_grey600_18dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_grey600_18dp.pngdeleted file mode 100644index bc9f374..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_grey600_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_grey600_24dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_grey600_24dp.pngdeleted file mode 100644index 82a3c33..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_grey600_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_grey600_36dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_grey600_36dp.pngdeleted file mode 100644index dd0a358..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_grey600_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_grey600_48dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_grey600_48dp.pngdeleted file mode 100644index ece8c52..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_grey600_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_white_18dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_white_18dp.pngdeleted file mode 100644index e95b5ed..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_white_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_white_24dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_white_24dp.pngdeleted file mode 100644index 4dd0e5c..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_white_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_white_36dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_white_36dp.pngdeleted file mode 100644index f0f8594..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_white_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_white_48dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_white_48dp.pngdeleted file mode 100644index e713bdb..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_check_white_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_black_18dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_black_18dp.pngdeleted file mode 100644index 132b997..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_black_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_black_24dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_black_24dp.pngdeleted file mode 100644index 7d31cd8..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_black_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_black_36dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_black_36dp.pngdeleted file mode 100644index 84dbf6e..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_black_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_black_48dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_black_48dp.pngdeleted file mode 100644index 6b9b2a6..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_black_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_grey600_18dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_grey600_18dp.pngdeleted file mode 100644index 5830118..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_grey600_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_grey600_24dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_grey600_24dp.pngdeleted file mode 100644index 08ddc52..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_grey600_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_grey600_36dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_grey600_36dp.pngdeleted file mode 100644index c065a72..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_grey600_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_grey600_48dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_grey600_48dp.pngdeleted file mode 100644index e408254..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_grey600_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_white_18dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_white_18dp.pngdeleted file mode 100644index 5451a7e..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_white_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_white_24dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_white_24dp.pngdeleted file mode 100644index 9231b26..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_white_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_white_36dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_white_36dp.pngdeleted file mode 100644index bf1e764..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_white_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_white_48dp.png b/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_white_48dp.pngdeleted file mode 100644index 0b21088..0000000Binary files a/android/storagechooser/src/main/res/drawable-xhdpi/ic_chevron_left_white_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_black_18dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_black_18dp.pngdeleted file mode 100644index fb8bf02..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_black_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_black_24dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_black_24dp.pngdeleted file mode 100644index fb1c3b2..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_black_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_black_36dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_black_36dp.pngdeleted file mode 100644index aba9e96..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_black_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_black_48dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_black_48dp.pngdeleted file mode 100644index 51d7bf8..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_black_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_grey600_18dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_grey600_18dp.pngdeleted file mode 100644index d88bdeb..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_grey600_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_grey600_24dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_grey600_24dp.pngdeleted file mode 100644index b7d6aa8..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_grey600_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_grey600_36dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_grey600_36dp.pngdeleted file mode 100644index 0a7e5d4..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_grey600_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_grey600_48dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_grey600_48dp.pngdeleted file mode 100644index d8f541a..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_grey600_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_white_18dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_white_18dp.pngdeleted file mode 100644index 9a61c18..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_white_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_white_24dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_white_24dp.pngdeleted file mode 100644index b453b31..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_white_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_white_36dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_white_36dp.pngdeleted file mode 100644index 4454350..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_white_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_white_48dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_white_48dp.pngdeleted file mode 100644index e6945ae..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_check_white_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_black_18dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_black_18dp.pngdeleted file mode 100644index 9d889e7..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_black_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_black_24dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_black_24dp.pngdeleted file mode 100644index 84dbf6e..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_black_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_black_36dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_black_36dp.pngdeleted file mode 100644index 4bd376b..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_black_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_black_48dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_black_48dp.pngdeleted file mode 100644index d8b2e2f..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_black_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_grey600_18dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_grey600_18dp.pngdeleted file mode 100644index 5416c67..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_grey600_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_grey600_24dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_grey600_24dp.pngdeleted file mode 100644index c065a72..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_grey600_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_grey600_36dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_grey600_36dp.pngdeleted file mode 100644index 9ebf0ec..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_grey600_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_grey600_48dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_grey600_48dp.pngdeleted file mode 100644index bb74287..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_grey600_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_white_18dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_white_18dp.pngdeleted file mode 100644index dcde744..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_white_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_white_24dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_white_24dp.pngdeleted file mode 100644index bf1e764..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_white_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_white_36dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_white_36dp.pngdeleted file mode 100644index 1eccfb2..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_white_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_white_48dp.png b/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_white_48dp.pngdeleted file mode 100644index 6f9ae7e..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxhdpi/ic_chevron_left_white_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_black_18dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_black_18dp.pngdeleted file mode 100644index e077199..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_black_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_black_24dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_black_24dp.pngdeleted file mode 100644index f1de2fb..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_black_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_black_36dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_black_36dp.pngdeleted file mode 100644index 5048941..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_black_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_black_48dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_black_48dp.pngdeleted file mode 100644index 3cf8f1b..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_black_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_grey600_18dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_grey600_18dp.pngdeleted file mode 100644index cdf5bf8..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_grey600_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_grey600_24dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_grey600_24dp.pngdeleted file mode 100644index 9d60007..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_grey600_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_grey600_36dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_grey600_36dp.pngdeleted file mode 100644index c79c250..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_grey600_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_grey600_48dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_grey600_48dp.pngdeleted file mode 100644index cc34065..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_grey600_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_white_18dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_white_18dp.pngdeleted file mode 100644index ea55336..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_white_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_white_24dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_white_24dp.pngdeleted file mode 100644index 3fb491f..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_white_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_white_36dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_white_36dp.pngdeleted file mode 100644index 6126715..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_white_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_white_48dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_white_48dp.pngdeleted file mode 100644index 6ab63e5..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_check_white_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_black_18dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_black_18dp.pngdeleted file mode 100644index 84dbf6e..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_black_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_black_24dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_black_24dp.pngdeleted file mode 100644index 6b9b2a6..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_black_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_black_36dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_black_36dp.pngdeleted file mode 100644index d8b2e2f..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_black_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_black_48dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_black_48dp.pngdeleted file mode 100644index 716579f..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_black_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_grey600_18dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_grey600_18dp.pngdeleted file mode 100644index c065a72..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_grey600_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_grey600_24dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_grey600_24dp.pngdeleted file mode 100644index e408254..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_grey600_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_grey600_36dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_grey600_36dp.pngdeleted file mode 100644index bb74287..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_grey600_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_grey600_48dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_grey600_48dp.pngdeleted file mode 100644index bd9511e..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_grey600_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_18dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_18dp.pngdeleted file mode 100644index bf1e764..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_18dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_24dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_24dp.pngdeleted file mode 100644index 0b21088..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_24dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_36dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_36dp.pngdeleted file mode 100644index 6f9ae7e..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_36dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_48dp.png b/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_48dp.pngdeleted file mode 100644index d8b7890..0000000Binary files a/android/storagechooser/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_48dp.png and /dev/null differdiff --git a/android/storagechooser/src/main/res/drawable/divider.xml b/android/storagechooser/src/main/res/drawable/divider.xmldeleted file mode 100644index a5c0576..0000000--- a/android/storagechooser/src/main/res/drawable/divider.xml+++ /dev/null@@ -1,11 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<inset xmlns:android="http://schemas.android.com/apk/res/android"- android:insetLeft="16dp"- android:insetRight="16dp">-- <shape>- <solid android:color="@color/colorListDivider" />- <corners android:radius="2.0dip" />- </shape>--</inset>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/drawable/path_layout_bg.xml b/android/storagechooser/src/main/res/drawable/path_layout_bg.xmldeleted file mode 100644index 4b30b3c..0000000--- a/android/storagechooser/src/main/res/drawable/path_layout_bg.xml+++ /dev/null@@ -1,5 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<shape xmlns:android="http://schemas.android.com/apk/res/android">- <solid android:color="@color/pathLayoutBgColor" />- <corners android:radius="2dp" />-</shape>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/drawable/plus.xml b/android/storagechooser/src/main/res/drawable/plus.xmldeleted file mode 100644index f5b85c1..0000000--- a/android/storagechooser/src/main/res/drawable/plus.xml+++ /dev/null@@ -1,15 +0,0 @@-<!-- drawable/plus.xml -->-<vector xmlns:android="http://schemas.android.com/apk/res/android"- android:width="24dp"- android:height="24dp"- android:viewportHeight="24"- android:viewportWidth="24">- <group- android:name="rotationGroup"- android:pivotX="12"- android:pivotY="12">- <path- android:fillColor="#fff"- android:pathData="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" />- </group>-</vector>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/layout-v21/custom_storage_list.xml b/android/storagechooser/src/main/res/layout-v21/custom_storage_list.xmldeleted file mode 100644index a9827cf..0000000--- a/android/storagechooser/src/main/res/layout-v21/custom_storage_list.xml+++ /dev/null@@ -1,168 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"- xmlns:app="http://schemas.android.com/apk/res-auto"- android:layout_width="match_parent"- android:layout_height="match_parent">-- <RelativeLayout- android:id="@+id/secondary_container"- android:layout_width="match_parent"- android:layout_height="match_parent">-- <RelativeLayout- android:id="@+id/custom_path_header"- android:layout_width="match_parent"- android:layout_height="60dp"- android:background="@color/colorPrimary">-- <LinearLayout- android:layout_width="match_parent"- android:layout_height="match_parent"- android:layout_centerInParent="true"- android:layout_margin="8dp"- android:background="@drawable/path_layout_bg"- android:orientation="horizontal">-- <RelativeLayout- android:id="@+id/back_button_holder"- android:layout_width="50dp"- android:layout_height="match_parent"- android:background="@color/chevronBgColor">-- <ImageButton- android:id="@+id/back_button"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_centerInParent="true"- android:background="@android:color/transparent"- android:src="@drawable/ic_chevron_left_white_24dp" />-- </RelativeLayout>--- <!-- address bar -->- <RelativeLayout- android:id="@+id/new_folder_button_holder"- android:layout_width="50dp"- android:layout_height="match_parent"- android:background="@color/chevronBgColor">-- <include layout="@layout/layout_new_folder_iv" />-- </RelativeLayout>--- <TextView- android:id="@+id/path_chosen"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_gravity="center_vertical"- android:layout_marginEnd="16dp"- android:layout_marginStart="16dp"- android:fontFamily="sans-serif-condensed"- android:text=""- android:textColor="@android:color/white"- android:textSize="16sp" />-- </LinearLayout>-- </RelativeLayout>-- <Button- android:id="@+id/select_button"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_alignParentBottom="true"- android:layout_alignParentEnd="true"- android:layout_alignParentRight="true"- android:layout_marginEnd="8dp"- android:layout_marginLeft="8dp"- android:layout_marginRight="8dp"- android:background="@android:color/transparent"- android:textColor="@color/colorPrimaryDark"- android:textStyle="bold" />-- <ListView- android:id="@+id/storage_list_view"- android:layout_width="match_parent"- android:layout_height="wrap_content"- android:layout_above="@id/select_button"- android:layout_below="@id/custom_path_header"- android:divider="@null"- android:listSelector="@drawable/ripple"- android:longClickable="true" />-- <ProgressBar- android:id="@+id/files_loader"- style="?android:progressBarStyleHorizontal"- android:layout_centerInParent="true"- android:layout_width="150dp"- android:layout_height="wrap_content"- android:visibility="invisible"- />--- <!-- create folder view -->- <RelativeLayout- android:id="@+id/new_folder_view"- android:layout_width="match_parent"- android:layout_height="80dp"- android:layout_above="@id/select_button"- android:background="@color/colorPrimary">-- <EditText- android:id="@+id/et_folder_name"- android:layout_width="match_parent"- android:layout_height="wrap_content"- android:layout_alignParentStart="true"- android:layout_centerVertical="true"- android:layout_margin="16dp"- android:layout_toStartOf="@+id/create_folder_button"- android:backgroundTint="@color/pathLayoutBgColor"- android:maxLength="50"- android:maxLines="1"- android:singleLine="true"- android:textColor="@android:color/white"- android:textColorHint="@color/chevronBgColor"- android:textSize="16sp" />-- <Button- android:id="@+id/create_folder_button"- android:layout_width="wrap_content"- android:layout_height="match_parent"- android:layout_alignParentEnd="true"- android:layout_alignParentRight="true"- android:layout_centerVertical="true"- android:layout_marginBottom="16dp"- android:layout_marginEnd="8dp"- android:layout_marginRight="8dp"- android:layout_marginTop="16dp"- android:background="@null"- android:textColor="@android:color/white" />-- </RelativeLayout>--- <!-- gradient view -->- <View- android:id="@+id/inactive_gradient"- android:layout_width="match_parent"- android:layout_height="match_parent"- android:layout_above="@id/new_folder_view"- android:layout_below="@id/custom_path_header"- android:background="@color/inactiveGradientColor" />-- <com.google.android.material.floatingactionbutton.FloatingActionButton- android:id="@+id/multiple_selection_done_fab"- app:fabSize="normal"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_alignParentBottom="true"- android:layout_alignParentEnd="true"- android:layout_margin="16dp"- app:srcCompat="@drawable/ic_check_white_24dp"- android:visibility="invisible" />-- </RelativeLayout>--</FrameLayout>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/layout-v21/layout_new_folder_iv.xml b/android/storagechooser/src/main/res/layout-v21/layout_new_folder_iv.xmldeleted file mode 100644index 1010fe4..0000000--- a/android/storagechooser/src/main/res/layout-v21/layout_new_folder_iv.xml+++ /dev/null@@ -1,7 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<ImageView xmlns:android="http://schemas.android.com/apk/res/android"- android:id="@+id/new_folder_iv"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_centerInParent="true"- android:src="@drawable/drawable_plus_to_close" />\ No newline at end of filediff --git a/android/storagechooser/src/main/res/layout/custom_storage_list.xml b/android/storagechooser/src/main/res/layout/custom_storage_list.xmldeleted file mode 100644index 76408af..0000000--- a/android/storagechooser/src/main/res/layout/custom_storage_list.xml+++ /dev/null@@ -1,172 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"- xmlns:app="http://schemas.android.com/apk/res-auto"- android:layout_width="match_parent"- android:layout_height="match_parent">-- <RelativeLayout- android:id="@+id/secondary_container"- android:layout_width="match_parent"- android:layout_height="match_parent">-- <RelativeLayout- android:id="@+id/custom_path_header"- android:layout_width="match_parent"- android:layout_height="60dp"- android:background="@color/colorPrimary">-- <LinearLayout- android:layout_width="match_parent"- android:layout_height="match_parent"- android:layout_centerInParent="true"- android:layout_margin="8dp"- android:background="@drawable/path_layout_bg"- android:orientation="horizontal">-- <RelativeLayout- android:id="@+id/back_button_holder"- android:layout_width="50dp"- android:layout_height="match_parent"- android:background="@color/chevronBgColor">-- <ImageButton- android:id="@+id/back_button"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_centerInParent="true"- android:background="@android:color/transparent"- android:src="@drawable/ic_chevron_left_white_24dp" />-- </RelativeLayout>--- <!-- address bar -->- <RelativeLayout- android:id="@+id/new_folder_button_holder"- android:layout_width="50dp"- android:layout_height="match_parent"- android:background="@color/chevronBgColor">-- <include layout="@layout/layout_new_folder_iv" />-- </RelativeLayout>--- <TextView- android:id="@+id/path_chosen"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_gravity="center_vertical"- android:layout_marginEnd="16dp"- android:layout_marginRight="16dp"- android:layout_marginStart="16dp"- android:layout_marginLeft="16dp"- android:fontFamily="sans-serif-condensed"- android:text=""- android:textColor="@android:color/white"- android:textSize="16sp" />-- </LinearLayout>-- </RelativeLayout>-- <Button- android:id="@+id/select_button"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_alignParentBottom="true"- android:layout_alignParentEnd="true"- android:layout_alignParentRight="true"- android:layout_marginEnd="8dp"- android:layout_marginLeft="8dp"- android:layout_marginRight="8dp"- android:background="@android:color/transparent"- android:textColor="@color/colorPrimaryDark"- android:textStyle="bold" />-- <ListView- android:id="@+id/storage_list_view"- android:layout_width="match_parent"- android:layout_height="wrap_content"- android:layout_above="@id/select_button"- android:layout_below="@id/custom_path_header"- android:divider="@null"- android:longClickable="true" />-- <ProgressBar- android:id="@+id/files_loader"- style="?android:progressBarStyleHorizontal"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_below="@+id/custom_path_header"- android:visibility="invisible"- />--- <!-- create folder view -->- <RelativeLayout- android:id="@+id/new_folder_view"- android:layout_width="match_parent"- android:layout_height="80dp"- android:layout_above="@id/select_button"- android:background="@color/colorPrimary">-- <EditText- android:id="@+id/et_folder_name"- android:layout_width="match_parent"- android:layout_height="wrap_content"- android:layout_alignParentLeft="true"- android:layout_alignParentStart="true"- android:layout_centerVertical="true"- android:layout_margin="16dp"- android:layout_toLeftOf="@+id/create_folder_button"- android:layout_toStartOf="@+id/create_folder_button"- android:backgroundTint="@color/pathLayoutBgColor"- android:maxLength="50"- android:maxLines="1"- android:singleLine="true"- android:textColor="@android:color/white"- android:textColorHint="@color/chevronBgColor"- android:textSize="16sp" />-- <Button- android:id="@+id/create_folder_button"- android:layout_width="wrap_content"- android:layout_height="match_parent"- android:layout_alignParentEnd="true"- android:layout_alignParentRight="true"- android:layout_centerVertical="true"- android:layout_marginBottom="16dp"- android:layout_marginEnd="8dp"- android:layout_marginRight="8dp"- android:layout_marginTop="16dp"- android:background="@null"- android:textColor="@android:color/white" />-- </RelativeLayout>--- <!-- gradient view -->- <View- android:id="@+id/inactive_gradient"- android:layout_width="match_parent"- android:layout_height="match_parent"- android:layout_above="@id/new_folder_view"- android:layout_below="@id/custom_path_header"- android:background="@color/inactiveGradientColor" />-- <com.google.android.material.floatingactionbutton.FloatingActionButton- android:id="@+id/multiple_selection_done_fab"- app:fabSize="normal"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_alignParentBottom="true"- android:layout_alignParentEnd="true"- android:layout_alignParentRight="true"- android:layout_margin="16dp"- android:src="@drawable/ic_check_white_24dp"- android:visibility="invisible" />-- </RelativeLayout>--</FrameLayout>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/layout/layout_new_folder_iv.xml b/android/storagechooser/src/main/res/layout/layout_new_folder_iv.xmldeleted file mode 100644index 0ced2f9..0000000--- a/android/storagechooser/src/main/res/layout/layout_new_folder_iv.xml+++ /dev/null@@ -1,8 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<ImageView xmlns:android="http://schemas.android.com/apk/res/android"- xmlns:app="http://schemas.android.com/apk/res-auto"- android:id="@+id/new_folder_iv"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_centerInParent="true"- app:srcCompat="@drawable/plus" />\ No newline at end of filediff --git a/android/storagechooser/src/main/res/layout/row_custom_paths.xml b/android/storagechooser/src/main/res/layout/row_custom_paths.xmldeleted file mode 100644index 06f899e..0000000--- a/android/storagechooser/src/main/res/layout/row_custom_paths.xml+++ /dev/null@@ -1,29 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"- android:layout_width="match_parent"- android:layout_height="match_parent">-- <ImageView- android:id="@+id/path_folder_icon"- android:layout_width="40dp"- android:layout_height="40dp"- android:layout_centerVertical="true"- android:layout_marginBottom="8dp"- android:layout_marginLeft="16dp"- android:layout_marginStart="16dp"- android:layout_marginTop="8dp"- android:src="@drawable/ic_folder_icon" />-- <TextView- android:id="@+id/storage_name"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_centerVertical="true"- android:layout_marginLeft="16dp"- android:layout_marginStart="16dp"- android:layout_marginTop="6dp"- android:layout_toEndOf="@id/path_folder_icon"- android:layout_toRightOf="@id/path_folder_icon"- android:textSize="16sp" />--</RelativeLayout>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/layout/row_paths.xml b/android/storagechooser/src/main/res/layout/row_paths.xmldeleted file mode 100644index 8d094ac..0000000--- a/android/storagechooser/src/main/res/layout/row_paths.xml+++ /dev/null@@ -1,12 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"- android:layout_width="match_parent"- android:layout_height="match_parent">-- <TextView- android:id="@+id/storage_name"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_margin="16dp" />--</RelativeLayout>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/layout/row_storage.xml b/android/storagechooser/src/main/res/layout/row_storage.xmldeleted file mode 100644index 8b37078..0000000--- a/android/storagechooser/src/main/res/layout/row_storage.xml+++ /dev/null@@ -1,29 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"- android:layout_width="match_parent"- android:layout_height="match_parent"- android:padding="16dp"- android:orientation="vertical">-- <TextView- android:id="@+id/storage_name"- android:layout_width="wrap_content"- android:layout_height="wrap_content" />-- <ProgressBar- android:id="@+id/memory_bar"- style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal"- android:layout_width="match_parent"- android:layout_height="wrap_content"- android:layout_marginTop="8dp" />-- <TextView- android:id="@+id/memory_status"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_gravity="end"- android:layout_marginTop="4dp"- android:textColor="@color/colorPrimaryDark"- android:textSize="13sp" />--</LinearLayout>diff --git a/android/storagechooser/src/main/res/layout/storage_list.xml b/android/storagechooser/src/main/res/layout/storage_list.xmldeleted file mode 100644index 51038ab..0000000--- a/android/storagechooser/src/main/res/layout/storage_list.xml+++ /dev/null@@ -1,40 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"- android:id="@+id/overview_container"- android:layout_width="match_parent"- android:layout_height="match_parent"- android:orientation="vertical">-- <RelativeLayout- android:id="@+id/header_container"- android:layout_width="match_parent"- android:layout_height="wrap_content"- android:background="@color/colorPrimary">-- <TextView- android:id="@+id/dialog_title"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:layout_centerInParent="true"- android:layout_marginBottom="32dp"- android:layout_marginEnd="16dp"- android:layout_marginLeft="16dp"- android:layout_marginRight="16dp"- android:layout_marginStart="16dp"- android:layout_marginTop="32dp"- android:fontFamily="sans-serif-condensed"- android:text="@string/choose_storage"- android:textAlignment="center"- android:textColor="@android:color/white"- android:textSize="17sp" />-- </RelativeLayout>-- <ListView- android:id="@+id/storage_list_view"- android:layout_width="match_parent"- android:layout_height="match_parent"- android:divider="@drawable/divider"- android:dividerHeight="0.5dp" />--</LinearLayout>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/values-de/strings.xml b/android/storagechooser/src/main/res/values-de/strings.xmldeleted file mode 100644index 7c9d0bc..0000000--- a/android/storagechooser/src/main/res/values-de/strings.xml+++ /dev/null@@ -1,11 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="app_name">Speicherauswahl</string>- <string name="choose_storage">Speicher auswählen</string>- <string name="choose_external_storage">Externen Speicher auswählen</string>- <string name="external_storage">Externer Speicher</string>- <string name="usb_storage">USB-Speicher</string>- <string name="text_freespace">%1$s frei</string>- <string name="toast_threshold_breached">%1$s reichen für den aktuellen Vorgang nicht aus. Bitte gib etwas Speicherplatz frei.</string>- <string name="toast_not_readable">Auf den ausgewählten Speicher kann nicht zugegriffen werden.</string>-</resources>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/values-fr/strings.xml b/android/storagechooser/src/main/res/values-fr/strings.xmldeleted file mode 100644index 735f60a..0000000--- a/android/storagechooser/src/main/res/values-fr/strings.xml+++ /dev/null@@ -1,11 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="app_name">Sélecteur de stockage</string>- <string name="choose_storage">Choisir le stockage</string>- <string name="choose_external_storage">Choisir le stockage externe</string>- <string name="external_storage">Stockage externe</string>- <string name="usb_storage">Stockage USB</string>- <string name="text_freespace">%1$s libres</string>- <string name="toast_threshold_breached">%1$s ne suffisent pas pour l’opération en cours. Veuillez libérer de l’espace.</string>- <string name="toast_not_readable">Le stockage sélectionné n’est pas accessible.</string>-</resources>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/values-night/colors.xml b/android/storagechooser/src/main/res/values-night/colors.xmldeleted file mode 100644index f66bd6e..0000000--- a/android/storagechooser/src/main/res/values-night/colors.xml+++ /dev/null@@ -1,12 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<resources>- <color name="colorPrimary">#2196F3</color>- <color name="colorPrimaryDark">#1976D2</color>- <color name="colorAccent">#FBC02D</color>-- <color name="memory_status_color">#de6565</color>- <color name="memory_bar_color">#7bde65</color>- <color name="new_folder_color">#c14b84</color>- <color name="select_color">#6b3fa1</color>- <color name="cancel_color">#3fa19f</color>-</resources>diff --git a/android/storagechooser/src/main/res/values-pl/strings.xml b/android/storagechooser/src/main/res/values-pl/strings.xmldeleted file mode 100644index bd3f5ea..0000000--- a/android/storagechooser/src/main/res/values-pl/strings.xml+++ /dev/null@@ -1,11 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="app_name">Wybór pamięci</string>- <string name="choose_storage">Wybierz pamięć</string>- <string name="choose_external_storage">Wybierz pamięć zewnętrzną</string>- <string name="external_storage">Pamięć zewnętrzna</string>- <string name="usb_storage">Pamięć USB</string>- <string name="text_freespace">%1$s wolne</string>- <string name="toast_threshold_breached">%1$s nie wystarczy do wykonania bieżącej operacji. Zwolnij trochę miejsca.</string>- <string name="toast_not_readable">Wybrana pamięć jest niedostępna.</string>-</resources>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/values-ru/strings.xml b/android/storagechooser/src/main/res/values-ru/strings.xmldeleted file mode 100644index 2994517..0000000--- a/android/storagechooser/src/main/res/values-ru/strings.xml+++ /dev/null@@ -1,11 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="app_name">Выбор хранилища</string>- <string name="choose_storage">Выбрать хранилище</string>- <string name="choose_external_storage">Выбрать внешнее хранилище</string>- <string name="external_storage">Внешнее хранилище</string>- <string name="usb_storage">USB-накопитель</string>- <string name="text_freespace">Свободно %1$s</string>- <string name="toast_threshold_breached">%1$s недостаточно для текущей операции. Освободите немного места.</string>- <string name="toast_not_readable">Выбранное хранилище недоступно.</string>-</resources>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/values-sv/strings.xml b/android/storagechooser/src/main/res/values-sv/strings.xmldeleted file mode 100644index 5e98116..0000000--- a/android/storagechooser/src/main/res/values-sv/strings.xml+++ /dev/null@@ -1,11 +0,0 @@-<?xml version='1.0' encoding='utf-8'?>-<resources>- <string name="app_name">Lagringsväljare</string>- <string name="choose_storage">Välj lagring</string>- <string name="choose_external_storage">Välj extern lagring</string>- <string name="external_storage">Extern lagring</string>- <string name="usb_storage">USB-lagring</string>- <string name="text_freespace">%1$s ledigt</string>- <string name="toast_threshold_breached">%1$s räcker inte för den aktuella åtgärden. Frigör lite lagringsutrymme.</string>- <string name="toast_not_readable">Den valda lagringen går inte att komma åt.</string>-</resources>\ No newline at end of filediff --git a/android/storagechooser/src/main/res/values/colors.xml b/android/storagechooser/src/main/res/values/colors.xmldeleted file mode 100644index 93ebea2..0000000--- a/android/storagechooser/src/main/res/values/colors.xml+++ /dev/null@@ -1,62 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<resources>- <color name="colorPrimary">#2d6c55</color>- <color name="colorPrimaryDark">#235644</color>- <color name="colorAccent">#ff9c40</color>-- <color name="colorCyanListClick">#d6c8f5f3</color>- <color name="colorListDivider">#89606060</color>-- <color name="pathLayoutBgColor">#70ffffff</color>- <color name="chevronBgColor">#50ffffff</color>- <color name="inactiveGradientColor">#53000000</color>-- <!-- dialog colors -->- <color name="memory_status_color">#de6565</color>- <color name="memory_bar_color">#7bde65</color>- <color name="new_folder_color">#c14b84</color>- <color name="select_color">#6b3fa1</color>- <color name="cancel_color">#3fa19f</color>-- <array name="default_light">- <!-- Overview -->- <item>@color/colorPrimary</item> <!-- Top Header bg -->- <item>@android:color/white</item> <!-- header text -->- <item>@android:color/white</item> <!-- list bg -->- <item>@android:color/black</item> <!-- storage list name text -->- <item>@color/colorPrimary</item> <!-- free space text -->- <item>@color/colorAccent</item> <!-- memory bar -->-- <!-- secondary dialog colors -->- <item>@color/colorPrimary</item> <!-- address bar bg -->- <item>@android:color/white</item> <!-- list bg -->- <item>@android:color/black</item> <!-- list text -->- <item>@android:color/white</item> <!-- address bar tint -->- <item>@color/chevronBgColor</item> <!-- new folder hint tint -->- <item>#da6c6c</item> <!-- select button color -->- <item>#da6c6c</item> <!-- new folder layour bg -->- <item>#da6c6c</item> <!-- new folder layour bg -->- <item>@color/colorPrimary</item> <!-- new folder layour bg -->- </array>-- <array name="default_dark">- <!-- Overview -->- <item>@color/colorPrimary</item> <!-- Top Header bg -->- <item>@android:color/white</item> <!-- header text -->- <item>@android:color/black</item> <!-- list bg -->- <item>@android:color/white</item> <!-- storage list name text -->- <item>#da6c6c</item> <!-- free space text -->- <item>@color/colorPrimary</item> <!-- memory bar -->-- <!-- secondary dialog colors -->- <item>@color/colorPrimary</item> <!-- address bar bg -->- <item>@android:color/black</item> <!-- list bg -->- <item>@android:color/white</item> <!-- list text -->- <item>@android:color/white</item> <!-- address bar tint -->- <item>@color/chevronBgColor</item> <!-- new folder hint tint -->- <item>#da6c6c</item> <!-- select button color -->- <item>#da6c6c</item> <!-- new folder layour bg -->- <item>#da6c6c</item> <!-- new multi fab -->- <item>#da6c6c</item> <!-- new multi fab -->- </array>-</resources>diff --git a/android/storagechooser/src/main/res/values/strings.xml b/android/storagechooser/src/main/res/values/strings.xmldeleted file mode 100644index d4ba44a..0000000--- a/android/storagechooser/src/main/res/values/strings.xml+++ /dev/null@@ -1,12 +0,0 @@-<resources>- <string name="app_name">Storage Chooser</string>- <string name="choose_storage">Choose Storage</string>- <string name="choose_external_storage">Choose External Storage</string>-- <string name="external_storage">External storage</string>- <!-- Usb storage descripton -->- <string name="usb_storage">USB storage</string>- <string name="text_freespace">%1$s free</string>- <string name="toast_threshold_breached">%1$s is not sufficient for current operation. Please clear out some space.</string>- <string name="toast_not_readable">The storage you have chosen is not accessible.</string>-</resources>diff --git a/android/storagechooser/src/main/res/values/styles.xml b/android/storagechooser/src/main/res/values/styles.xmldeleted file mode 100644index 5b58611..0000000--- a/android/storagechooser/src/main/res/values/styles.xml+++ /dev/null@@ -1,27 +0,0 @@-<resources>-- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">- <item name="colorPrimary">@color/colorPrimary</item>- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>- <item name="colorAccent">@color/colorAccent</item>- </style>-- <style name="DialogTheme" parent="Theme.AppCompat.Light.Dialog">- <item name="colorPrimary">@color/colorPrimary</item>- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>- <item name="colorAccent">@color/colorAccent</item>- <item name="windowActionBar">false</item>- <item name="windowNoTitle">true</item>- </style>-- <style name="EditTextHint" parent="TextAppearance.AppCompat">- <item name="android:textColor">@color/chevronBgColor</item>- <item name="android:textColorHint">@color/chevronBgColor</item>- <item name="android:textSize">12sp</item>- <item name="colorAccent">@color/pathLayoutBgColor</item>- <item name="colorControlNormal">@color/chevronBgColor</item>- <item name="colorControlHighlight">@color/pathLayoutBgColor</item>- <item name="colorControlActivated">@color/pathLayoutBgColor</item>- </style>--</resources>diff --git a/android/storagechooser/src/test/java/com/codekidlabs/storagechooser/ExampleUnitTest.java b/android/storagechooser/src/test/java/com/codekidlabs/storagechooser/ExampleUnitTest.javadeleted file mode 100644index 9489774..0000000--- a/android/storagechooser/src/test/java/com/codekidlabs/storagechooser/ExampleUnitTest.java+++ /dev/null@@ -1,17 +0,0 @@-package com.codekidlabs.storagechooser;--import org.junit.Test;--import static org.junit.Assert.assertEquals;--/**- * Example local unit test, which will execute on the development machine (host).- *- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>- */-public class ExampleUnitTest {- @Test- public void addition_isCorrect() throws Exception {- assertEquals(4, 2 + 2);- }-}\ No newline at end of filediff --git a/cmake/GitVersion.cmake b/cmake/GitVersion.cmakeindex dd6c2d2..e17b134 100644--- a/cmake/GitVersion.cmake+++ b/cmake/GitVersion.cmake@@ -8,8 +8,7 @@ execute_process (# Isowind: a hash of the engine's source rather than of the commit. Multiplayer only lets the same version play# together (the hash is part of the connection password), and this is the same wherever that source is built: here,-# from the snapshot commits pushed to GitHub, and from the Android build's export (android/buildscripts/CMakeLists.txt-# computes it the same way). Only the engine's folders count, so changes to the Android app, CI or Isowind's data+# and from the snapshot commits pushed to GitHub. Only the engine's folders count, so changes to CI or Isowind's data# files don't split players.execute_process (COMMAND ${GIT_EXECUTABLE} rev-parse HEAD:apps HEAD:components HEAD:files HEAD:extern HEAD:cmake HEAD:CMakeLists.txtdiff --git a/isowind/windows/make_package.ps1 b/isowind/windows/make_package.ps1index 5ad00af..a9656b8 100644--- a/isowind/windows/make_package.ps1+++ b/isowind/windows/make_package.ps1@@ -25,7 +25,7 @@ $bundledMods = Join-Path $root 'bundled-mods'$withMods = -not $NoMods -and (Test-Path $bundledMods)if ($withMods) { "With the bundled mods ($bundledMods)" } else { 'Without the bundled mods' }# Isowind's own files (the mod, pixel art shader and palettes, profiles, server scripts, readme), shared with the-# Linux and Android builds+# Linux build$isowind = Join-Path $src 'isowind'function Mirror($from, $to, [string[]]$extra = @()) {@@ -155,8 +155,8 @@ if ($LASTEXITCODE -ne 0) {}& git -C $src rev-parse --verify --quiet "$tag^{commit}" | Out-Nullif ($LASTEXITCODE -eq 0) {- & git -C $src add --intent-to-add -A -- . ':!MSVC2022_64' ':!deps' ':!android' ':!isowind' ':!.github'- & git -C $src diff $tag -- . ':!MSVC2022_64' ':!deps' ':!android' ':!isowind' ':!.github' | Set-Content -Encoding utf8 (Join-Path $source "isowind-$tag.patch")+ & git -C $src add --intent-to-add -A -- . ':!MSVC2022_64' ':!deps' ':!isowind' ':!.github'+ & git -C $src diff $tag -- . ':!MSVC2022_64' ':!deps' ':!isowind' ':!.github' | Set-Content -Encoding utf8 (Join-Path $source "isowind-$tag.patch")& git -C $src reset --quiet}else {