Differences

This shows you the differences between the selected revision and the current
version of the page.


wmelite:building 2013/06/29 11:38 wmelite:building 2014/12/07 11:17 current
Line 1: Line 1:
====== Building WME Lite from sources ====== ====== Building WME Lite from sources ======
 +
 +===== Obtaining the source files =====
 +The source files are hosted at Bitbucket in a [[http://en.wikipedia.org/wiki/Mercurial|Mercurial]] repository: https://bitbucket.org/MnemonicWME/wmelite/
 +There are several ways of getting the sources.
 +  * Download a snapshot of the sources: Go to [[https://bitbucket.org/MnemonicWME/wmelite/downloads|downloads section]], open the "Branches" tab and click the "zip" link (or whatever format you prefer). This will download the latest version of source files in a zip file. Just unzip the file somewhere on your computer.
 +  * A better way is to clone the repository. That way you can easily update to newer version of the sources. To clone the repository, you will need a Mercurial client. There are many of them. If you prefer graphical programs, try either [[http://www.sourcetreeapp.com/|SourceTree]] (Windows and Mac) or [[http://tortoisehg.bitbucket.org/|TortoiseHG]] (Windows, Mac, Linux). Within the client choose the "Clone repository" command and enter the [[https://bitbucket.org/MnemonicWME/wmelite/|above URL]] as a source.
 +Once you've obtained the source files, you are ready to compile them into an executable. The following sections describe the process for the platforms WME Lite's been ported to so far. Remember that to actually test the game, you always need some WME game package (the .dcp file) which must be created using WME Project Manager on Windows.
Line 42: Line 49:
  * Go to the "linux" directory of the wmelite sources. If necessary, adapt include paths in the makefile.   * Go to the "linux" directory of the wmelite sources. If necessary, adapt include paths in the makefile.
  * Run "make wmelite" to build wmelite executable.   * Run "make wmelite" to build wmelite executable.
 +
===== Android ===== ===== Android =====
-  * Note: ARM is currently the only supported platform. There are no BASS libraries (yet) for X86 and MIPS.+  * Note: ARM and X86 are the currently supported platforms. There are no BASS libraries (yet) for MIPS. 
 + 
==== Building a game package from precompiled libraries ==== ==== Building a game package from precompiled libraries ====
  * Note: Before starting, make sure you are capable of building an Android app using one of the examples from the Android SDK.   * Note: Before starting, make sure you are capable of building an Android app using one of the examples from the Android SDK.
-  * If not already done, install the SDK platform for Android 2.3.3 (API 10). +  * If not already done, install the SDK platform for Android 3.1 (API 12). Depending on your config and/or build environment it might be necessary to install Android 2.3.3 (API 10) as well.
  * Obtain sources from Mercurial repository: https://bitbucket.org/MnemonicWME/wmelite   * Obtain sources from Mercurial repository: https://bitbucket.org/MnemonicWME/wmelite
  * Download dependencies for Android (dep_android_*.zip): https://bitbucket.org/MnemonicWME/wmelite/downloads   * Download dependencies for Android (dep_android_*.zip): https://bitbucket.org/MnemonicWME/wmelite/downloads
Line 54: Line 64:
  * Place your game files into the wmelite/android/assets/raw folder and rename them from ".dcp" to ".png". If you are going to distribute your game via the Google Play store, your game must not be bigger than 50 MB in total.   * Place your game files into the wmelite/android/assets/raw folder and rename them from ".dcp" to ".png". If you are going to distribute your game via the Google Play store, your game must not be bigger than 50 MB in total.
  * Change the package and class name of org/example/yourapppackagename/YourGameName.java located at wmelite/android/src/ into something meaningful for your game.   * Change the package and class name of org/example/yourapppackagename/YourGameName.java located at wmelite/android/src/ into something meaningful for your game.
-  * You need to change the AndroidManifest.xml as well, which is located at wmelite/android/, to reflect your changes. Edit ''package="org.libsdl.app"'' and ''android:name="SDLActivity"'' to match your changes.+  * You need to change the AndroidManifest.xml as well, which is located at wmelite/android/, to reflect your changes. Edit ''package="org.libsdl.app"'' and ''android:name="SDLActivity"'' to match your changes. Example: You changed org/example/yourapppackagename/YourGameName.java to com/mycompany/mygametype/MyGameName.java. Thus you need to fill in  ''package="com.mycompany.mygametype"'' and ''android:name="MyGameName"''.
  * Edit res/values/strings.xml located at wmelite/android/ to fill in the name of your app.   * Edit res/values/strings.xml located at wmelite/android/ to fill in the name of your app.
  * Modify the game package and file path to point at the asset directory. Edit org/deadcode/wmelite/WMELiteFunctions.java located at wmelite/android/ and change the return values of the ''getGamePackagePath()'' and ''getGameFilePath()'' from "/mnt/sdcard" to "asset://raw".   * Modify the game package and file path to point at the asset directory. Edit org/deadcode/wmelite/WMELiteFunctions.java located at wmelite/android/ and change the return values of the ''getGamePackagePath()'' and ''getGameFilePath()'' from "/mnt/sdcard" to "asset://raw".
  * If you use bitmap fonts with a different locale than "US-ASCII", fill in the proper locale in the functions ''getEncodedString()'' and ''getUTFString()''.   * If you use bitmap fonts with a different locale than "US-ASCII", fill in the proper locale in the functions ''getEncodedString()'' and ''getUTFString()''.
  * Build the Android app.   * Build the Android app.
 +
 +
==== Building dependencies from source ==== ==== Building dependencies from source ====
  * Make sure you have the Android NDK installed properly. Windows users will need to install Cygwin. The command ''ndk-build'' should be in your path.   * Make sure you have the Android NDK installed properly. Windows users will need to install Cygwin. The command ''ndk-build'' should be in your path.
-  * Obtain sources for the dependencies from Mercurial repository: https://bitbucket.org/hardcoredaniel/wmelite-dependencies-for-linux-and-android+  * Obtain sources for the dependencies from Mercurial repository: https://bitbucket.org/hcdaniel/wmelite-dependencies-for-linux-and-android
  * In the dependencies/ directory, sequentially enter the directories "FreeImage3154", "libfreetype-android" and "SDL". In each of them, call the ''build.sh'' script.   * In the dependencies/ directory, sequentially enter the directories "FreeImage3154", "libfreetype-android" and "SDL". In each of them, call the ''build.sh'' script.
  * Go to the prebuilt/ directory and call the ''copy_android_prebuilt_libs.sh'' script.   * Go to the prebuilt/ directory and call the ''copy_android_prebuilt_libs.sh'' script.
Line 69: Line 81:
  * All required libraries shall be available in the wmelite/android/libs directory. You may now proceed with building the game package.   * All required libraries shall be available in the wmelite/android/libs directory. You may now proceed with building the game package.
 +==== Testing with big game files and distribution ====
 +== Testing ==
 +  * To test your game, you can build an unmodified "SDLActivity" first and place all your files in "/mnt/sdcard/". This is recommended for testing only.
 +== Distribution via Google Play ==
 +  * If your app does not reach the 50MB limit, you can use the method described above, bundling your data together with the app.
 +  * If your app is bigger than 50MB, you can use the guide here http://developer.android.com/google/play/expansion-files.html to supply your data files separately to the app.
 +  * If you are going to host the data files yourself, you can of course implement your custom downloader.
 +== Stay "compatible" to regular WME ==
 +  * To avoid compiling different data packages for regular WME and WMElite, always distribute the fonts directly with the app. Then you can use the same data packages and it doesn't matter which method you use to distribute them.
 
wmelite/building.1372498739.txt.gz · Last modified: 2013/06/29 11:38 by hcdaniel
Recent changes RSS feed Creative Commons License Driven by DokuWiki