Changes between Version 195 and Version 196 of AndroidPort


Ignore:
Timestamp:
Feb 1, 2012, 7:04:57 PM (12 years ago)
Author:
Anders Feder
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AndroidPort

    v195 v196  
    105105
    106106I think the best approach is to extend graphics/!ShaderProgram.cpp to support GLSL shaders (it was designed with that in mind, but I don't know if it'll actually work without some interface changes); then move all the renderer's existing fixed-function texture-environment setup code into ShaderProgramFFP.cpp and implement GLSL-based equivalents, so that most of the rest of the renderer code doesn't have to care whether it's using FFP or GLSL (it just uses the CShaderProgram interface). Also, change all immediate-mode drawing (glVertex3f etc) to vertex arrays. I think that should deal with the most serious problems, and the code would all be shared between GLES and desktop GL modes (no need for forking or #ifdefs etc) and can be tested with desktop GL. Then there's probably just lots of little issues remaining, which can be addressed as they occur.
     107
     108See [wiki:SLESPort].
    107109
    108110=== Other dependencies ===
     
    167169$ tar -xvf android-ndk-r5-crystax-2-linux-x86.tar.bz2
    168170}}}
    169 
    170171Now use the NDK to set up a standalone toolchain:
    171172
     
    173174$ ~/android/android-ndk-r5-crystax-2/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=$HOME/android/toolchain
    174175}}}
    175 
    176176You also must install a Java Development Kit (JDK) if you haven't already, e.g. [https://apps.ubuntu.com/cat/applications/oneiric/default-jdk/ the standard JDK from Ubuntu Software Center]:
    177177
     
    189189$ sudo apt-get install ia32-libs
    190190}}}
    191 
    192191=== Installing replacement libraries ===
    193192The game has a range of external dependencies. Each of these has to be compiled for the target device's processor architecture and installed in the compiler toolchain's SYSROOT, so we can link against them when building the game itself.
     
    199198$ tar -xvf MysticTreeGames-Boost-for-Android-70838fc.tar.gz
    200199}}}
    201 
    202200Now change directory to the directory that was unpacked, e.g.:
    203201
     
    205203$ cd MysticTreeGames-Boost-for-Android-70838fc
    206204}}}
    207 
    208205Then execute the following command to download the Boost C++ Libraries package and compile it for the target device:
    209206
     
    211208$ ./build-android.sh ~/android/android-ndk-r5-crystax-2
    212209}}}
    213 
    214210Copy the resulting headers and library files into the `usr` directory in the toolchain's SYSROOT:
    215211
     
    217213$ cp -r build/* ~/android/toolchain/sysroot/usr/
    218214}}}
    219 
    220 
    221215Set up the environment for cross-compiling using the standalone toolchain:
    222216
     
    242236$ export LDFLAGS="-L${NDK}/sources/crystax/libs/armeabi-v7a -lcrystax"
    243237}}}
    244 
    245238Download the development snapshot for SDL 1.3 from [http://www.libsdl.org/hg.php this page] to the working directory and then unpack it there, e.g.:
    246239
     
    249242$ tar -xvf SDL-1.3.tar.gz
    250243}}}
    251 
    252244Now change directory to the directory that was unpacked, e.g.:
    253245
     
    255247$ cd ~/android/SDL-1.3.0-6235
    256248}}}
    257 
    258249Then execute the following commands to compile the package for the target device:
    259250
     
    263254$ make install
    264255}}}
    265 
    266256Download the latest version of cURL from [http://curl.haxx.se/download.html this page] to the working directory and then unpack it there, e.g.:
    267257
     
    270260$ tar -xvf curl-7.24.0.tar.bz2
    271261}}}
    272 
    273262Now change directory to the directory that was unpacked, e.g.:
    274263
     
    276265$ cd ~/android/curl-7.24.0
    277266}}}
    278 
    279267Then execute the following commands to compile the package for the target device:
    280268
     
    284272$ make install
    285273}}}
    286 
    287274Download the latest version of libpng from [http://www.libpng.org/pub/png/libpng.html this page] to the working directory and then unpack it there, e.g.:
    288275
     
    291278$ tar -xvf libpng-1.5.7.tar.xz
    292279}}}
    293 
    294280Now change directory to the directory that was unpacked, e.g.:
    295281
     
    297283$ cd ~/android/libpng-1.5.7
    298284}}}
    299 
    300285Then execute the following commands to compile the package for the target device:
    301286
     
    305290$ make install
    306291}}}
    307 
    308292The game depends on libjpeg. We will use libjpeg-turbo, an ABI-compatible fork of libjpeg that adds support for SIMD processing, giving us maximal performance with the target processor's ARM NEON engine.
    309293
     
    314298$ tar -xvf libjpeg-turbo-1.1.1.tar.gz
    315299}}}
    316 
    317300Now change directory to the directory that was unpacked, e.g.:
    318301
     
    320303$ cd ~/android/libjpeg-turbo-1.1.1
    321304}}}
    322 
    323305Then execute the following commands to compile the package for the target device:
    324306
     
    328310$ make install
    329311}}}
    330 
    331312Download the latest version of libxml2 from [http://xmlsoft.org/downloads.html this page] to the working directory and then unpack it there, e.g.:
    332313
     
    335316$ tar -xvf libxml2-2.7.8.tar.gz
    336317}}}
    337 
    338318Now change directory to the directory that was unpacked, e.g.:
    339319
     
    341321$ cd ~/android/libxml2-2.7.8
    342322}}}
    343 
    344323Then execute the following command to configure the package for the target device:
    345324
     
    347326$ ./configure --host=$HOSTCONF --build=$BUILDCONF --prefix=$SYSROOT/usr --without-threads --without-iconv --without-python --enable-shared
    348327}}}
    349 
    350328Hand-edit the Makefile to remove `runtest$(EXEEXT)` and `testrecurse$(EXEEXT)` from the `noinst_PROGRAMS` definition, e.g.
    351329
     
    359337        runxmlconf$(EXEEXT)
    360338}}}
    361 
    362339Finally, execute the following commands to compile the package:
    363340
     
    366343$ make install
    367344}}}
    368 
    369345=== Building the game ===
    370346The native library (i.e. the actual game) is built using the standard Premake build system as follows.
    371347
    372 ''(Note: You currently need to reset your environment if it is still set up for cross-compiling from the previous section. Close any open terminal windows and open a new one.)
    373 ''
     348''(Note: You currently need to reset your environment if it is still set up for cross-compiling from the previous section. Close any open terminal windows and open a new one.) ''''''
    374349
    375350Download the game from SVN to any location, e.g.: