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

wmelite:building 2013/05/24 22:18 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 20: Line 27:
  * Copy your game package (data.dcp) to **xcode/wmelite** directory (note: if your game package uses a different name or if you need to use multiple .dcp files, you will have to modify the xcode project).   * Copy your game package (data.dcp) to **xcode/wmelite** directory (note: if your game package uses a different name or if you need to use multiple .dcp files, you will have to modify the xcode project).
  * Open the project file (xcode/wmelite/wmelite.xcodeproj) in XCode and compile.   * Open the project file (xcode/wmelite/wmelite.xcodeproj) in XCode and compile.
Line 31: Line 39:
  * Open the project file (xcode-ios/wmelite/wmelite.xcodeproj) in XCode and compile.   * Open the project file (xcode-ios/wmelite/wmelite.xcodeproj) in XCode and compile.
 +===== Linux =====
 +  * Note: Building wmelite is only supported for 32 bit architectures. For 64 bit you are on your own (for now).
 +  * Obtain sources from Mercurial repository: https://bitbucket.org/MnemonicWME/wmelite
 +  * Install libfreetype and libfreeimage (including the corresponding development packages) from your distribution's package manager.
 +  * Obtain a SDL2.0 snapshot from here: http://www.libsdl.org/hg.php Build and install by following the instructions on the website.
 +  * Obtain the BASS libraries from here: http://www.un4seen.com/ Put "bass.h" in /usr/local/include/bass and "libbass.so" in /usr/local/lib. Execute "ldconfig" as root.
 +  * Go to the "linux" directory of the wmelite sources. If necessary, adapt include paths in the makefile.
 +  * Run "make wmelite" to build wmelite executable.
 +===== Android =====
 +  * Note: ARM and X86 are the currently supported platforms. There are no BASS libraries (yet) for MIPS.
 +==== 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.
 +  * 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
 +  * Download dependencies for Android (dep_android_*.zip): https://bitbucket.org/MnemonicWME/wmelite/downloads
 +  * Unpack dependencies into the wmelite/android folder.
 +  * 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.
 +  * 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.
 +  * 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()''.
 +  * Build the Android app.
 +==== 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.
 +  * 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.
 +  * Go to the prebuilt/ directory and call the ''copy_android_prebuilt_libs.sh'' script.
 +  * Copy the dependencies/ and prebuilt/ directories to the place where you put the wmelite sources obtained from here: https://bitbucket.org/MnemonicWME/wmelite
 +  * Go to the android/ directory in the wmelite sources and call the ''build.sh'' script.
 +  * 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.1369426695.txt.gz · Last modified: 2013/05/24 22:18 by mnemonic
Recent changes RSS feed Creative Commons License Driven by DokuWiki