Permalink
Browse files

Fix build breaks.

  • Loading branch information...
1 parent d1016d5 commit 98a025fa3e6283dce6c8b17177c3c29165e76cef @seanzipline seanzipline committed Mar 22, 2012
View
@@ -1,14 +1,15 @@
Project structure:
3rdparty - All of the 3rd party libraries we use.
-android - The Android reference projects.
+ant - Android reference projects.
distribute - The files and set up used to create the SDK installers and other distributable packages
samples - Lua and tools samples as well as some development test/experiment scripts.
+scons - Google Chrome
src - Moai source code and headers.
test - Lua stress tests for Moai. These were written to crash Moai. We'll be fixing Moai to handle more user errors gracefully (instead of crash) as the project develops.
vs2008 - Visual Studio 2008 reference projects.
vs2010 - Visual Studio 2010 reference projects.
-xcode - Mac OSX and iPhone projects.
+xcode - Mac OSX and iOS reference projects.
Developing on Windows:
@@ -23,7 +24,7 @@ If these two environment variables are set up correctly, you can run each sample
Developing on Mac:
-Open xcode/osx/MoaiSample.xcodeproj. Make sure a 32-bit architecture is selected (64-bit not yet officially supported). Build moai as a command line utility.
+Open xcode/osx/MoaiSample.xcodeproj. Make sure a 32-bit architecture is selected (64-bit not yet officially supported). The 'moai' project builds moai, a command line Moai host based on GLUT.
To try out the samples, configure Xcode's debug working directory and command line parameters. Set the working directory to the directory of the sample you want to try, relative to the Xcode project (for example '../../samples/basics/anim-basic'). Set the command line parameters to '../../config/config.lua main.lua'.
@@ -35,14 +36,4 @@ Developing for iOS:
Use xcode/ios/MoaiSample.xcodeproj. This sample project includes the Lua and image found in samples/basics/anim-basic. The Moai runtime is implemented in an OpenGL view. Look at AppDelegate to see how it is used.
-As Moai is written in C++, we've generally preferred Objective-C++ for our work. To make dealing with Apple's reference counting easier, we use a smart pointer called RefPtr <>. If you're planning to extend MoaiView and don't mind using Objective-C++, try it out for yourself.
-
-Developing on Linux:
-
- $ cmake .
- $ make
-
-Installing the dependencies on Ubuntu:
-
- $ sudo apt-get install cmake libcurl4-openssl-dev libfreetype6-dev \
- liblua5.1-0-dev libpng12-dev freeglut3-dev libxi-dev libxmu-dev
+As Moai is written in C++, we've generally preferred Objective-C++ for our work. To make dealing with Apple's reference counting easier, we use a smart pointer called RefPtr <>. If you're planning to extend MoaiView and don't mind using Objective-C++, try it out for yourself.
@@ -25,7 +25,7 @@
# (this list is created by make-host.sh using command-line
# information)
# available: facebook, tapjoy, adcolony, crittercism, google-push,
-# google-billing
+# google-billing, miscellaneous (required by google-billing)
#----------------------------------------------------------------#
requires=( @REQUIRED_LIBS@ )
View
@@ -52,6 +52,8 @@
arm_arch="armeabi armeabi-v7a"
fi
+ should_clean=false
+
# if libmoai already exists, find out which package it was build for
if [ -f libs/package.txt ]; then
existing_arm_mode=$( sed -n '1p' libs/package.txt )
@@ -62,40 +64,38 @@
existing_google_billing_flags=$( sed -n '6p' libs/package.txt )
existing_crittercism_flags=$( sed -n '7p' libs/package.txt )
existing_adcolony_flags=$( sed -n '8p' libs/package.txt )
- fi
- should_clean=false
-
- if [ x"$existing_arm_mode" != x"$arm_mode" ]; then
- should_clean=true
- fi
+ if [ x"$existing_arm_mode" != x"$arm_mode" ]; then
+ should_clean=true
+ fi
- if [ x"$existing_arm_arch" != x"$arm_arch" ]; then
- should_clean=true
- fi
+ if [ x"$existing_arm_arch" != x"$arm_arch" ]; then
+ should_clean=true
+ fi
- if [ x"$existing_app_platform" != x"$app_platform" ]; then
- should_clean=true
- fi
+ if [ x"$existing_app_platform" != x"$app_platform" ]; then
+ should_clean=true
+ fi
- if [ x"$existing_tapjoy_flags" != x"$tapjoy_flags" ]; then
- should_clean=true
- fi
+ if [ x"$existing_tapjoy_flags" != x"$tapjoy_flags" ]; then
+ should_clean=true
+ fi
- if [ x"$existing_google_push_flags" != x"$google_push_flags" ]; then
- should_clean=true
- fi
+ if [ x"$existing_google_push_flags" != x"$google_push_flags" ]; then
+ should_clean=true
+ fi
- if [ x"$existing_google_billing_flags" != x"$google_billing_flags" ]; then
- should_clean=true
- fi
+ if [ x"$existing_google_billing_flags" != x"$google_billing_flags" ]; then
+ should_clean=true
+ fi
- if [ x"$existing_crittercism_flags" != x"$crittercism_flags" ]; then
- should_clean=true
- fi
+ if [ x"$existing_crittercism_flags" != x"$crittercism_flags" ]; then
+ should_clean=true
+ fi
- if [ x"$existing_adcolony_flags" != x"$adcolony_flags" ]; then
- should_clean=true
+ if [ x"$existing_adcolony_flags" != x"$adcolony_flags" ]; then
+ should_clean=true
+ fi
fi
if [ x"$should_clean" = xtrue ]; then
@@ -77,6 +77,7 @@
MY_HEADER_SEARCH_PATHS += $(MY_MOAI_ROOT)/3rdparty/luasocket-2.0.2/src
MY_HEADER_SEARCH_PATHS += $(MY_MOAI_ROOT)/3rdparty/luasql-2.2.0/src
MY_HEADER_SEARCH_PATHS += $(MY_MOAI_ROOT)/3rdparty/openssl-1.0.0d/include-android
+ MY_HEADER_SEARCH_PATHS += $(MY_MOAI_ROOT)/3rdparty/ooid-0.99
MY_HEADER_SEARCH_PATHS += $(MY_MOAI_ROOT)/3rdparty/sqlite-3.6.16
MY_HEADER_SEARCH_PATHS += $(MY_MOAI_ROOT)/3rdparty/tinyxml
MY_HEADER_SEARCH_PATHS += $(MY_MOAI_ROOT)/3rdparty/tlsf-2.0
@@ -90,17 +91,13 @@
LOCAL_C_INCLUDES := $(MY_HEADER_SEARCH_PATHS)
LOCAL_SRC_FILES += src/moai.cpp
- LOCAL_SRC_FILES += $(MY_MOAI_ROOT)/src/aku/pch.cpp
- LOCAL_SRC_FILES += $(MY_MOAI_ROOT)/src/aku/AKU.cpp
- LOCAL_SRC_FILES += $(MY_MOAI_ROOT)/src/aku/AKU-luaext.cpp
- LOCAL_SRC_FILES += $(MY_MOAI_ROOT)/src/aku/AKU-untz.cpp
#----------------------------------------------------------------#
# libraries
#----------------------------------------------------------------#
+ LOCAL_STATIC_LIBRARIES += libaku
LOCAL_STATIC_LIBRARIES += libmoaicore
- LOCAL_STATIC_LIBRARIES += libuslsext
LOCAL_STATIC_LIBRARIES += libuslscore
LOCAL_STATIC_LIBRARIES += libmoaiext-android
@@ -151,5 +148,6 @@
include vorbis/Android.mk
include zipfs/Android.mk
+ include aku/Android.mk
include moaicore/Android.mk
include uslscore/Android.mk
@@ -0,0 +1,22 @@
+#================================================================#
+# Copyright (c) 2010-2011 Zipline Games, Inc.
+# All Rights Reserved.
+# http://getmoai.com
+#================================================================#
+
+ include $(CLEAR_VARS)
+
+ include OptionalComponentsDefined.mk
+
+ LOCAL_MODULE := aku
+ LOCAL_ARM_MODE := $(MY_ARM_MODE)
+ LOCAL_CFLAGS := $(DISABLE_TAPJOY) $(DISABLE_NOTIFICATIONS) $(DISABLE_BILLING) $(DISABLE_CRITTERCISM) $(DISABLE_ADCOLONY)
+ LOCAL_CFLAGS += -include $(MY_MOAI_ROOT)/src/zipfs/zipfs_replace.h
+
+ LOCAL_C_INCLUDES := $(MY_HEADER_SEARCH_PATHS)
+ LOCAL_SRC_FILES += $(MY_MOAI_ROOT)/src/aku/pch.cpp
+ LOCAL_SRC_FILES += $(MY_MOAI_ROOT)/src/aku/AKU.cpp
+ LOCAL_SRC_FILES += $(MY_MOAI_ROOT)/src/aku/AKU-luaext.cpp
+ LOCAL_SRC_FILES += $(MY_MOAI_ROOT)/src/aku/AKU-untz.cpp
+
+ include $(BUILD_STATIC_LIBRARY)
@@ -9,6 +9,8 @@
#include <moaicore/moaicore.h>
+#include <lua-headers/moai_lua.h>
+
#include <moaiext-android/moaiext-android.h>
#include <moaiext-android/moaiext-jni.h>
@@ -263,18 +265,13 @@
//----------------------------------------------------------------//
extern "C" void Java_com_ziplinegames_moai_Moai_AKUInit ( JNIEnv* env, jclass obj ) {
- MOAIApp::Affirm ();
- REGISTER_LUA_CLASS ( MOAIApp );
-
-#ifndef DISABLE_TAPJOY
- MOAITapjoyAndroid::Affirm ();
- REGISTER_LUA_CLASS ( MOAITapjoyAndroid );
+#ifndef DISABLE_ADCOLONY
+ MOAIAdColonyAndroid::Affirm ();
+ REGISTER_LUA_CLASS ( MOAIAdColonyAndroid );
#endif
-#ifndef DISABLE_NOTIFICATIONS
- MOAINotificationsAndroid::Affirm ();
- REGISTER_LUA_CLASS ( MOAINotificationsAndroid );
-#endif
+ MOAIAppAndroid::Affirm ();
+ REGISTER_LUA_CLASS ( MOAIAppAndroid );
#ifndef DISABLE_BILLING
MOAIBillingAndroid::Affirm ();
@@ -286,17 +283,25 @@
REGISTER_LUA_CLASS ( MOAICrittercismAndroid );
#endif
-#ifndef DISABLE_ADCOLONY
- MOAIAdColonyAndroid::Affirm ();
- REGISTER_LUA_CLASS ( MOAIAdColonyAndroid );
-#endif
+ MOAIFacebookAndroid::Affirm ();
+ REGISTER_LUA_CLASS ( MOAIDialogAndroid );
#ifndef DISABLE_FACEBOOK
MOAIFacebookAndroid::Affirm ();
REGISTER_LUA_CLASS ( MOAIFacebookAndroid );
#endif
- AKUInit ();
+#ifndef DISABLE_NOTIFICATIONS
+ MOAINotificationsAndroid::Affirm ();
+ REGISTER_LUA_CLASS ( MOAINotificationsAndroid );
+#endif
+
+#ifndef DISABLE_TAPJOY
+ MOAITapjoyAndroid::Affirm ();
+ REGISTER_LUA_CLASS ( MOAITapjoyAndroid );
+#endif
+
+ AKURunBytecode ( moai_lua, moai_lua_SIZE );
inputQueue = new LockingQueue < InputEvent > ();
}
@@ -350,7 +355,7 @@
AKUReserveInputDeviceSensors ( deviceId, total );
}
-
+
//----------------------------------------------------------------//
extern "C" void Java_com_ziplinegames_moai_Moai_AKURunScript ( JNIEnv* env, jclass obj, jstring jfilename ) {
@@ -364,7 +369,7 @@
//----------------------------------------------------------------//
extern "C" void Java_com_ziplinegames_moai_Moai_AKUSetConnectionType ( JNIEnv* env, jclass obj, jlong connectionType ) {
- MOAIEnvironment::Get ().SetConnectionType ( connectionType );
+ MOAIEnvironment::Get ().SetValue ( MOAI_ENV_connectionType, ( int )connectionType );
}
//----------------------------------------------------------------//
@@ -389,18 +394,20 @@
JNI_GET_CSTRING ( josVersion, osVersion );
JNI_GET_CSTRING ( judid, udid );
- MOAIEnvironment::Get ().SetAppDisplayName ( appName );
- MOAIEnvironment::Get ().SetAppID ( appId );
- MOAIEnvironment::Get ().SetAppVersion ( appVersion );
- MOAIEnvironment::Get ().SetCPUABI ( abi );
- MOAIEnvironment::Get ().SetDevBrand ( devBrand );
- MOAIEnvironment::Get ().SetDevName ( devName );
- MOAIEnvironment::Get ().SetDevManufacturer ( devManufacturer );
- MOAIEnvironment::Get ().SetDevModel ( devModel );
- MOAIEnvironment::Get ().SetDevProduct ( devProduct );
- MOAIEnvironment::Get ().SetOSBrand ( osBrand );
- MOAIEnvironment::Get ().SetOSVersion ( osVersion );
- MOAIEnvironment::Get ().SetUDID ( udid );
+ MOAIEnvironment& environment = MOAIEnvironment::Get ();
+
+ environment.SetValue ( MOAI_ENV_appDisplayName, appName );
+ environment.SetValue ( MOAI_ENV_appID, appId );
+ environment.SetValue ( MOAI_ENV_appVersion, appVersion );
+ environment.SetValue ( MOAI_ENV_cpuabi, abi );
+ environment.SetValue ( MOAI_ENV_devBrand, devBrand );
+ environment.SetValue ( MOAI_ENV_devName, devName );
+ environment.SetValue ( MOAI_ENV_devManufacturer, devManufacturer );
+ environment.SetValue ( MOAI_ENV_devModel, devModel );
+ environment.SetValue ( MOAI_ENV_devProduct, devProduct );
+ environment.SetValue ( MOAI_ENV_osBrand, osBrand );
+ environment.SetValue ( MOAI_ENV_osVersion, osVersion );
+ environment.SetValue ( MOAI_ENV_udid, udid );
JNI_RELEASE_CSTRING ( jappName, appName );
JNI_RELEASE_CSTRING ( jappId, appId );
@@ -413,15 +420,15 @@
JNI_RELEASE_CSTRING ( jdevProduct, devProduct );
JNI_RELEASE_CSTRING ( josBrand, osBrand );
JNI_RELEASE_CSTRING ( josVersion, osVersion );
- JNI_RELEASE_CSTRING ( judid, udid );
+ JNI_RELEASE_CSTRING ( judid, udid );
}
//----------------------------------------------------------------//
extern "C" void Java_com_ziplinegames_moai_Moai_AKUSetDocumentDirectory ( JNIEnv* env, jclass obj, jstring jpath ) {
JNI_GET_CSTRING ( jpath, path );
- MOAIEnvironment::Get ().SetDocumentDirectory ( path );
+ MOAIEnvironment::Get ().SetValue ( MOAI_ENV_documentDirectory, path );
JNI_RELEASE_CSTRING ( jpath, path );
}
@@ -12,40 +12,10 @@ cd ../3rdparty/glut-3.7.6-bin
cp -R * ../../distribute/moai-sdk/3rdparty/glut-3.7.6
cd ../../distribute
-mkdir -p moai-sdk/samples/android
-cd ../samples/android
-cp -R * ../../distribute/moai-sdk/samples/android
-cd ../../distribute
-
-mkdir -p moai-sdk/samples/basics
-cd ../samples/basics
-cp -R * ../../distribute/moai-sdk/samples/basics
-cd ../../distribute
-
-mkdir -p moai-sdk/samples/chrome
-cd ../samples/chrome
-cp -R * ../../distribute/moai-sdk/samples/chrome
-cd ../../distribute
-
-mkdir -p moai-sdk/samples/config
-cd ../samples/config
-cp -R * ../../distribute/moai-sdk/samples/config
-cd ../../distribute
-
-mkdir -p moai-sdk/samples/contrib
-cd ../samples/contrib
-cp -R * ../../distribute/moai-sdk/samples/contrib
-cd ../../distribute
-
-mkdir -p moai-sdk/samples/flash
-cd ../samples/flash
-cp -R * ../../distribute/moai-sdk/samples/flash
-cd ../../distribute
-
-mkdir -p moai-sdk/samples/ios
-cd ../samples/ios
-cp -R * ../../distribute/moai-sdk/samples/ios
-cd ../../distribute
+mkdir -p moai-sdk/samples
+pushd ../samples > /dev/null
+ find . -name ".?*" -type d -prune -o -name "test" -type d -prune -o -name "tutorials" -type d -prune -o -name "replace-run-bat-files.bat" -type f -prune -o -type f -print0 | cpio -pmd0 --quiet ../distribute/moai-sdk/samples
+popd > /dev/null
mkdir -p moai-sdk/include/aku
cp -R ../src/aku/*.h moai-sdk/include/aku
@@ -74,13 +44,13 @@ cd ../../distribute
# android host
mkdir -p moai-sdk/hosts/ant
-cp moai-sdk/hosts/ant/settings-local.sh moai-sdk/hosts/ant/settings-local.sh.backup
-cd ../ant
-./make-host.sh -p com.getmoai.samples -s
-cd untitled-host
-cp -R . ../../distribute/moai-sdk/hosts/ant
-cd ../../distribute
-mv moai-sdk/hosts/ant/settings-local.sh.backup moai-sdk/hosts/ant/settings-local.sh
+pushd ../ant > /dev/null
+ ./make-host.sh -p com.getmoai.samples -s
+ pushd untitled-host > /dev/null
+ find . -name ".?*" -type d -prune -o -name "settings-local.sh" -type f -prune -o -type f -print0 | cpio -pmd0 --quiet ../../distribute/moai-sdk/hosts/ant
+ popd > /dev/null
+popd > /dev/null
+
# ios host
mkdir -p moai-sdk/hosts/xcode/ios/Classes
Oops, something went wrong.

0 comments on commit 98a025f

Please sign in to comment.