mikymod 12 лет назад
Родитель
Сommit
0c41b9cbbd
77 измененных файлов с 0 добавлено и 873 удалено
  1. 0 21
      android/AndroidManifest.xml
  2. 0 92
      android/build.xml
  3. 0 152
      android/jni/Android.mk
  4. 0 3
      android/jni/Application.mk
  5. 0 1
      android/jni/ArchiveResourceArchive.cpp
  6. 0 1
      android/jni/ArchiveResourceArchive.h
  7. 0 1
      android/jni/CMakeLists.txt
  8. 0 1
      android/jni/Camera.cpp
  9. 0 1
      android/jni/Camera.h
  10. 0 1
      android/jni/Config.h
  11. 0 1
      android/jni/Config.h.in
  12. 0 1
      android/jni/Crown.h
  13. 0 1
      android/jni/Device.cpp
  14. 0 1
      android/jni/Device.h
  15. 0 1
      android/jni/EventBuffer.cpp
  16. 0 1
      android/jni/EventBuffer.h
  17. 0 1
      android/jni/FPSSystem.cpp
  18. 0 1
      android/jni/FPSSystem.h
  19. 0 1
      android/jni/FileResourceArchive.cpp
  20. 0 1
      android/jni/FileResourceArchive.h
  21. 0 1
      android/jni/Filesystem.cpp
  22. 0 1
      android/jni/Filesystem.h
  23. 0 1
      android/jni/Font.cpp
  24. 0 1
      android/jni/Font.h
  25. 0 1
      android/jni/FontResource.cpp
  26. 0 1
      android/jni/FontResource.h
  27. 0 1
      android/jni/Glyph.h
  28. 0 1
      android/jni/Image.cpp
  29. 0 1
      android/jni/Image.h
  30. 0 1
      android/jni/JSONParser.cpp
  31. 0 1
      android/jni/JSONParser.h
  32. 0 1
      android/jni/Log.cpp
  33. 0 1
      android/jni/Log.h
  34. 0 1
      android/jni/MaterialResource.cpp
  35. 0 1
      android/jni/MaterialResource.h
  36. 0 1
      android/jni/MovableCamera.cpp
  37. 0 1
      android/jni/MovableCamera.h
  38. 0 1
      android/jni/Pixel.cpp
  39. 0 1
      android/jni/Pixel.h
  40. 0 1
      android/jni/PixelShaderResource.cpp
  41. 0 1
      android/jni/PixelShaderResource.h
  42. 0 1
      android/jni/Resource.h
  43. 0 1
      android/jni/ResourceArchive.h
  44. 0 1
      android/jni/ResourceLoader.cpp
  45. 0 1
      android/jni/ResourceLoader.h
  46. 0 1
      android/jni/ResourceManager.cpp
  47. 0 1
      android/jni/ResourceManager.h
  48. 0 1
      android/jni/ScriptResource.cpp
  49. 0 1
      android/jni/ScriptResource.h
  50. 0 1
      android/jni/Skybox.cpp
  51. 0 1
      android/jni/Skybox.h
  52. 0 1
      android/jni/System.h
  53. 0 1
      android/jni/Terrain.cpp
  54. 0 1
      android/jni/Terrain.h
  55. 0 1
      android/jni/TextResource.cpp
  56. 0 1
      android/jni/TextResource.h
  57. 0 1
      android/jni/TextureResource.cpp
  58. 0 1
      android/jni/TextureResource.h
  59. 0 1
      android/jni/VertexShaderResource.cpp
  60. 0 1
      android/jni/VertexShaderResource.h
  61. 0 1
      android/jni/World.cpp
  62. 0 1
      android/jni/World.h
  63. 0 1
      android/jni/core
  64. 0 1
      android/jni/game
  65. 0 1
      android/jni/input
  66. 0 1
      android/jni/network
  67. 0 1
      android/jni/os
  68. 0 1
      android/jni/renderers
  69. 0 1
      android/jni/samples
  70. 0 20
      android/proguard-project.txt
  71. 0 14
      android/project.properties
  72. 0 141
      android/src/crown/android/CrownActivity.java
  73. 0 16
      android/src/crown/android/CrownEnum.java
  74. 0 56
      android/src/crown/android/CrownLib.java
  75. 0 185
      android/src/crown/android/CrownSensor.java
  76. 0 44
      android/src/crown/android/CrownSurfaceView.java
  77. 0 64
      android/src/crown/android/CrownTouch.java

+ 0 - 21
android/AndroidManifest.xml

@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="crown.android"
-      android:versionCode="1"
-      android:versionName="1.0">
-    <uses-sdk
-        android:minSdkVersion="9"/>
-
-    <application android:label="Crown" >
-        <activity android:name="CrownActivity"
-                  android:label="Crown"
-				  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
-				  android:screenOrientation="landscape" 
-				  android:configChanges="orientation|keyboardHidden">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-</manifest> 

+ 0 - 92
android/build.xml

@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="crown" default="help">
-
-    <!-- The local.properties file is created and updated by the 'android' tool.
-         It contains the path to the SDK. It should *NOT* be checked into
-         Version Control Systems. -->
-    <property file="local.properties" />
-
-    <!-- The ant.properties file can be created by you. It is only edited by the
-         'android' tool to add properties to it.
-         This is the place to change some Ant specific build properties.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         For other overridable properties, look at the beginning of the rules
-         files in the SDK, at tools/ant/build.xml
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="ant.properties" />
-
-    <!-- if sdk.dir was not set from one of the property file, then
-         get it from the ANDROID_HOME env var.
-         This must be done before we load project.properties since
-         the proguard config can use sdk.dir -->
-    <property environment="env" />
-    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
-        <isset property="env.ANDROID_HOME" />
-    </condition>
-
-    <!-- The project.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-
-         This contains project specific properties such as project target, and library
-         dependencies. Lower level build properties are stored in ant.properties
-         (or in .classpath for Eclipse projects).
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <loadproperties srcFile="project.properties" />
-
-    <!-- quick check on sdk.dir -->
-    <fail
-            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
-            unless="sdk.dir"
-    />
-
-    <!--
-        Import per project custom build rules if present at the root of the project.
-        This is the place to put custom intermediary targets such as:
-            -pre-build
-            -pre-compile
-            -post-compile (This is typically used for code obfuscation.
-                           Compiled code location: ${out.classes.absolute.dir}
-                           If this is not done in place, override ${out.dex.input.absolute.dir})
-            -post-package
-            -post-build
-            -pre-clean
-    -->
-    <import file="custom_rules.xml" optional="true" />
-
-    <!-- Import the actual build file.
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <import> task.
-             - customize it to your needs.
-         - Customize the whole content of build.xml
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, replacing the <import> task.
-             - customize to your needs.
-
-         ***********************
-         ****** IMPORTANT ******
-         ***********************
-         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
-         in order to avoid having your file be overridden by tools such as "android update project"
-    -->
-    <!-- version-tag: 1 -->
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>

+ 0 - 152
android/jni/Android.mk

@@ -1,152 +0,0 @@
-# Copyright (C) 2010 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := luajit-5.1
-LOCAL_SRC_FILES := libluajit-5.1.so
-include $(PREBUILT_SHARED_LIBRARY)
-
-#####################################
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE    := crown
-LOCAL_SRC_FILES :=\
-	core/bv/Circle.cpp\
-	core/bv/Frustum.cpp\
-	core/bv/Rect.cpp\
-	core/compressors/ZipCompressor.cpp\
-	core/containers/Generic.cpp\
-	core/filesystem/BinaryReader.cpp\
-	core/filesystem/BinaryWriter.cpp\
-	core/filesystem/DiskFile.cpp\
-	core/filesystem/File.cpp\
-	core/filesystem/Filesystem.cpp\
-	core/filesystem/MemoryFile.cpp\
-	core/filesystem/TextReader.cpp\
-	core/filesystem/TextWriter.cpp\
-	core/math/Color4.cpp\
-	core/math/Mat3.cpp\
-	core/math/Mat4.cpp\
-	core/math/MathUtils.cpp\
-	core/math/Plane.cpp\
-	core/math/Quat.cpp\
-	core/math/Shape.cpp\
-	core/math/Vec2.cpp\
-	core/math/Vec3.cpp\
-	core/math/Vec4.cpp\
-	core/mem/Allocator.cpp\
-	core/mem/HeapAllocator.cpp\
-	core/mem/LinearAllocator.cpp\
-	core/mem/ProxyAllocator.cpp\
-	core/mem/StackAllocator.cpp\
-	core/mem/Memory.cpp\
-	core/settings/FloatSetting.cpp\
-	core/settings/IntSetting.cpp\
-	core/settings/StringSetting.cpp\
-	core/Args.cpp\
-	core/Log.cpp\
-\
-	input/Accelerometer.cpp\
-	input/Keyboard.cpp\
-	input/Mouse.cpp\
-	input/Touch.cpp\
-	input/EventDispatcher.cpp\
-	input/InputManager.cpp\
-\
-	lua/LuaStack.cpp\
-	lua/LuaEnvironment.cpp\
-	lua/AccelerometerBinds.cpp\
-	lua/CameraBinds.cpp\
-	lua/DeviceBinds.cpp\
-	lua/KeyboardBinds.cpp\
-	lua/Mat4Binds.cpp\
-	lua/MathBinds.cpp\
-	lua/MouseBinds.cpp\
-	lua/QuatBinds.cpp\
-	lua/TouchBinds.cpp\
-	lua/Vec2Binds.cpp\
-	lua/Vec3Binds.cpp\
-\
-	network/BitMessage.cpp\
-\
-	os/OS.cpp\
-	os/android/AndroidOS.cpp\
-	os/android/AndroidDevice.cpp\
-	os/android/OsWindow.cpp\
-	os/android/OsFile.cpp\
-	os/posix/Thread.cpp\
-	os/posix/Mutex.cpp\
-	os/posix/Cond.cpp\
-	os/posix/TCPSocket.cpp\
-	os/posix/UDPSocket.cpp\
-\
-	renderers/gles/GLESRenderer.cpp\
-	renderers/gles/GLESUtils.cpp\
-	renderers/gles/egl/GLContext.cpp\
-	renderers/DebugRenderer.cpp\
-	renderers/PixelFormat.cpp\
-	renderers/VertexFormat.cpp\
-\
-	ArchiveBundle.cpp\
-	Camera.cpp\
-	Device.cpp\
-	FileBundle.cpp\
-	FontResource.cpp\
-	FPSSystem.cpp\
-	JSONParser.cpp\
-	MaterialResource.cpp\
-	PixelShaderResource.cpp\
-	ResourceManager.cpp\
-	TextResource.cpp\
-	TextureResource.cpp\
-	VertexShaderResource.cpp\
-	Game.cpp\
-\
-
-LOCAL_C_INCLUDES	:=\
-	$(LOCAL_PATH)/\
-	$(LOCAL_PATH)/core\
-	$(LOCAL_PATH)/core/bv\
-	$(LOCAL_PATH)/core/compressors\
-	$(LOCAL_PATH)/core/containers\
-	$(LOCAL_PATH)/core/filesystem\
-	$(LOCAL_PATH)/core/math\
-	$(LOCAL_PATH)/core/mem\
-	$(LOCAL_PATH)/core/filesystem\
-	$(LOCAL_PATH)/core/settings\
-	$(LOCAL_PATH)/core/strings\
-	$(LOCAL_PATH)/input\
-	$(LOCAL_PATH)/lua\
-	$(LOCAL_PATH)/network\
-	$(LOCAL_PATH)/os\
-	$(LOCAL_PATH)/os/android\
-	$(LOCAL_PATH)/renderers\
-	$(LOCAL_PATH)/renderers/gles\
-	$(LOCAL_PATH)/renderers/gles/egl\
-	$(LOCAL_PATH)/samples\
-	$(LOCAL_PATH)/third/luajit/include/luajit-2.0\
-\
-
-LOCAL_CPPFLAGS	:= -g -fexceptions
-LOCAL_LDLIBS	:= -llog -landroid -lEGL -lGLESv2 -lz 
-LOCAL_SHARED_LIBRARIES := luajit-5.1
-LOCAL_STATIC_LIBRARIES := android_native_app_glue
-include $(BUILD_SHARED_LIBRARY)
-
-$(call import-module,android/native_app_glue)
-

+ 0 - 3
android/jni/Application.mk

@@ -1,3 +0,0 @@
-APP_PLATFORM := android-9
-APP_STL := gnustl_static
-APP_ABI := armeabi-v7a

+ 0 - 1
android/jni/ArchiveResourceArchive.cpp

@@ -1 +0,0 @@
-../../src/ArchiveResourceArchive.cpp

+ 0 - 1
android/jni/ArchiveResourceArchive.h

@@ -1 +0,0 @@
-../../src/ArchiveResourceArchive.h

+ 0 - 1
android/jni/CMakeLists.txt

@@ -1 +0,0 @@
-../../src/CMakeLists.txt

+ 0 - 1
android/jni/Camera.cpp

@@ -1 +0,0 @@
-../../src/Camera.cpp

+ 0 - 1
android/jni/Camera.h

@@ -1 +0,0 @@
-../../src/Camera.h

+ 0 - 1
android/jni/Config.h

@@ -1 +0,0 @@
-../../src/Config.h

+ 0 - 1
android/jni/Config.h.in

@@ -1 +0,0 @@
-../../src/Config.h.in

+ 0 - 1
android/jni/Crown.h

@@ -1 +0,0 @@
-../../src/Crown.h

+ 0 - 1
android/jni/Device.cpp

@@ -1 +0,0 @@
-../../src/Device.cpp

+ 0 - 1
android/jni/Device.h

@@ -1 +0,0 @@
-../../src/Device.h

+ 0 - 1
android/jni/EventBuffer.cpp

@@ -1 +0,0 @@
-../../src/EventBuffer.cpp

+ 0 - 1
android/jni/EventBuffer.h

@@ -1 +0,0 @@
-../../src/EventBuffer.h

+ 0 - 1
android/jni/FPSSystem.cpp

@@ -1 +0,0 @@
-../../src/FPSSystem.cpp

+ 0 - 1
android/jni/FPSSystem.h

@@ -1 +0,0 @@
-../../src/FPSSystem.h

+ 0 - 1
android/jni/FileResourceArchive.cpp

@@ -1 +0,0 @@
-../../src/FileResourceArchive.cpp

+ 0 - 1
android/jni/FileResourceArchive.h

@@ -1 +0,0 @@
-../../src/FileResourceArchive.h

+ 0 - 1
android/jni/Filesystem.cpp

@@ -1 +0,0 @@
-../../src/Filesystem.cpp

+ 0 - 1
android/jni/Filesystem.h

@@ -1 +0,0 @@
-../../src/Filesystem.h

+ 0 - 1
android/jni/Font.cpp

@@ -1 +0,0 @@
-../../src/Font.cpp

+ 0 - 1
android/jni/Font.h

@@ -1 +0,0 @@
-../../src/Font.h

+ 0 - 1
android/jni/FontResource.cpp

@@ -1 +0,0 @@
-../../src/FontResource.cpp

+ 0 - 1
android/jni/FontResource.h

@@ -1 +0,0 @@
-../../src/FontResource.h

+ 0 - 1
android/jni/Glyph.h

@@ -1 +0,0 @@
-../../src/Glyph.h

+ 0 - 1
android/jni/Image.cpp

@@ -1 +0,0 @@
-../../src/Image.cpp

+ 0 - 1
android/jni/Image.h

@@ -1 +0,0 @@
-../../src/Image.h

+ 0 - 1
android/jni/JSONParser.cpp

@@ -1 +0,0 @@
-../../src/JSONParser.cpp

+ 0 - 1
android/jni/JSONParser.h

@@ -1 +0,0 @@
-../../src/JSONParser.h

+ 0 - 1
android/jni/Log.cpp

@@ -1 +0,0 @@
-../../src/Log.cpp

+ 0 - 1
android/jni/Log.h

@@ -1 +0,0 @@
-../../src/Log.h

+ 0 - 1
android/jni/MaterialResource.cpp

@@ -1 +0,0 @@
-../../src/MaterialResource.cpp

+ 0 - 1
android/jni/MaterialResource.h

@@ -1 +0,0 @@
-../../src/MaterialResource.h

+ 0 - 1
android/jni/MovableCamera.cpp

@@ -1 +0,0 @@
-../../src/MovableCamera.cpp

+ 0 - 1
android/jni/MovableCamera.h

@@ -1 +0,0 @@
-../../src/MovableCamera.h

+ 0 - 1
android/jni/Pixel.cpp

@@ -1 +0,0 @@
-../../src/Pixel.cpp

+ 0 - 1
android/jni/Pixel.h

@@ -1 +0,0 @@
-../../src/Pixel.h

+ 0 - 1
android/jni/PixelShaderResource.cpp

@@ -1 +0,0 @@
-../../src/PixelShaderResource.cpp

+ 0 - 1
android/jni/PixelShaderResource.h

@@ -1 +0,0 @@
-../../src/PixelShaderResource.h

+ 0 - 1
android/jni/Resource.h

@@ -1 +0,0 @@
-../../src/Resource.h

+ 0 - 1
android/jni/ResourceArchive.h

@@ -1 +0,0 @@
-../../src/ResourceArchive.h

+ 0 - 1
android/jni/ResourceLoader.cpp

@@ -1 +0,0 @@
-../../src/ResourceLoader.cpp

+ 0 - 1
android/jni/ResourceLoader.h

@@ -1 +0,0 @@
-../../src/ResourceLoader.h

+ 0 - 1
android/jni/ResourceManager.cpp

@@ -1 +0,0 @@
-../../src/ResourceManager.cpp

+ 0 - 1
android/jni/ResourceManager.h

@@ -1 +0,0 @@
-../../src/ResourceManager.h

+ 0 - 1
android/jni/ScriptResource.cpp

@@ -1 +0,0 @@
-../../src/ScriptResource.cpp

+ 0 - 1
android/jni/ScriptResource.h

@@ -1 +0,0 @@
-../../src/ScriptResource.h

+ 0 - 1
android/jni/Skybox.cpp

@@ -1 +0,0 @@
-../../src/Skybox.cpp

+ 0 - 1
android/jni/Skybox.h

@@ -1 +0,0 @@
-../../src/Skybox.h

+ 0 - 1
android/jni/System.h

@@ -1 +0,0 @@
-../../src/System.h

+ 0 - 1
android/jni/Terrain.cpp

@@ -1 +0,0 @@
-../../src/Terrain.cpp

+ 0 - 1
android/jni/Terrain.h

@@ -1 +0,0 @@
-../../src/Terrain.h

+ 0 - 1
android/jni/TextResource.cpp

@@ -1 +0,0 @@
-../../src/TextResource.cpp

+ 0 - 1
android/jni/TextResource.h

@@ -1 +0,0 @@
-../../src/TextResource.h

+ 0 - 1
android/jni/TextureResource.cpp

@@ -1 +0,0 @@
-../../src/TextureResource.cpp

+ 0 - 1
android/jni/TextureResource.h

@@ -1 +0,0 @@
-../../src/TextureResource.h

+ 0 - 1
android/jni/VertexShaderResource.cpp

@@ -1 +0,0 @@
-../../src/VertexShaderResource.cpp

+ 0 - 1
android/jni/VertexShaderResource.h

@@ -1 +0,0 @@
-../../src/VertexShaderResource.h

+ 0 - 1
android/jni/World.cpp

@@ -1 +0,0 @@
-../../src/World.cpp

+ 0 - 1
android/jni/World.h

@@ -1 +0,0 @@
-../../src/World.h

+ 0 - 1
android/jni/core

@@ -1 +0,0 @@
-../../src/core

+ 0 - 1
android/jni/game

@@ -1 +0,0 @@
-../../game

+ 0 - 1
android/jni/input

@@ -1 +0,0 @@
-../../src/input

+ 0 - 1
android/jni/network

@@ -1 +0,0 @@
-../../src/network

+ 0 - 1
android/jni/os

@@ -1 +0,0 @@
-../../src/os

+ 0 - 1
android/jni/renderers

@@ -1 +0,0 @@
-../../src/renderers

+ 0 - 1
android/jni/samples

@@ -1 +0,0 @@
-../../samples/

+ 0 - 20
android/proguard-project.txt

@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# 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 *;
-#}

+ 0 - 14
android/project.properties

@@ -1,14 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-17

+ 0 - 141
android/src/crown/android/CrownActivity.java

@@ -1,141 +0,0 @@
-/*
-Copyright (c) 2013 Daniele Bartolini, Michele Rossi
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-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.
-*/
-package crown.android;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.WindowManager;
-import android.view.MotionEvent;
-import android.hardware.Sensor;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.SensorManager;
-import android.content.Context;
-import android.widget.Toast;
-import android.content.res.AssetManager;
-import android.view.Surface;
-import android.view.SurfaceView;
-import android.view.SurfaceHolder;
-
-import crown.android.CrownEnum;
-
-/**
-*	BootStrap of Android Application
-*/
-public class CrownActivity extends Activity
-{
-
-	// Debug
-	public static String TAG = "CrownActivity";
-
-	// Resource attributes
-    static AssetManager 		mAssetManager;
-
-	// Input attributes
-	private CrownTouch 			mTouch;
-	private CrownSensor			mSensor;
-
-	// Graphic attributes
-	static CrownSurfaceView		mWindow;
-
-//-----------------------------------------------------------------------------
-    public void onCreate(Bundle savedInstanceState)
-    {
-        super.onCreate(savedInstanceState);
-
-		// init AssetManager
-		mAssetManager = getAssets();
-		CrownLib.initAssetManager(mAssetManager);
-
-		// init Native Window
-        mWindow = new CrownSurfaceView(this);
-        setContentView(mWindow);
-
-		// Init Input
-		mTouch = new CrownTouch(this);
-		mSensor = new CrownSensor(this);
-    }
-
-//-----------------------------------------------------------------------------
-	public void onStart()
-	{
-		super.onStart();
-
-	}
-
-//-----------------------------------------------------------------------------
-	public void onRestart()
-	{
-		super.onRestart();
-	}
-
-//-----------------------------------------------------------------------------
-	public void onResume()
-	{
-		super.onResume();
-		
-		// init accelerometer
-		if (!mSensor.startListening(this))
-		{
-			finish();
-		}
-	}
-
-//-----------------------------------------------------------------------------
-	public void onPause()
-	{
-		super.onPause();
-	}
-
-//-----------------------------------------------------------------------------
-	public void onStop()
-	{
-		super.onStop();
-
-		// stop accelerometer
-		mSensor.stopListening();
-	}
-
-//-----------------------------------------------------------------------------
-	public void onDestroy()
-	{
-		super.onDestroy();
-	}
-
-//-----------------------------------------------------------------------------
-	public boolean onTouchEvent(MotionEvent event)
-	{
-		mTouch.onTouch(event);
-        return super.onTouchEvent(event);
-	}
-
-//-----------------------------------------------------------------------------
-	public boolean hasMultiTouchSupport(Context context)
-	{
-		return context.getPackageManager().hasSystemFeature("android.hardware.touchscreen.multitouch");
-	}
-}

+ 0 - 16
android/src/crown/android/CrownEnum.java

@@ -1,16 +0,0 @@
-package crown.android;
-
-public class CrownEnum
-{
-	// OSEventType enum in OS.h
-	public static int OSET_NONE				= 0;
-	public static int OSET_KEY_PRESS		= 1;
-	public static int OSET_KEY_RELEASE		= 2;
-	public static int OSET_BUTTON_PRESS		= 3;
-	public static int OSET_BUTTON_RELEASE	= 4;
-	public static int OSET_MOTION_NOTIFY	= 5;
-	public static int OSET_TOUCH_DOWN 		= 6;
-	public static int OSET_TOUCH_MOVE		= 7;
-	public static int OSET_TOUCH_UP			= 8;
-	public static int OSET_ACCELEROMETER	= 9; 
-}

+ 0 - 56
android/src/crown/android/CrownLib.java

@@ -1,56 +0,0 @@
-/*
-Copyright (c) 2013 Daniele Bartolini, Michele Rossi
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-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.
-*/
-package crown.android;
-
-import android.content.res.AssetManager;
-import android.view.Surface;
-
-public class CrownLib
-{
-	static 
-	{
-		System.loadLibrary("luajit-5.1");
-		System.loadLibrary("crown");
-	}
-	
-	// Device functions
-	public static native void 		init();
-	public static native void 		frame();
-	public static native void 		shutdown();
-	public static native boolean 	isInit();
-	public static native boolean	isRunning();
-
-	// AssetManager functions
-	public static native void 		initAssetManager(AssetManager assetManager);
-
-	// InputManager functions
-	public static native void 		pushIntEvent(int type, int a, int b, int c, int d);
-	public static native void 		pushFloatEvent(int type, float a, float b, float c, float d);
-
-	// Window functions
-	public static native void		setWindow(Surface window);
-	public static native void 		setDisplaySize(int width, int height);
-}

+ 0 - 185
android/src/crown/android/CrownSensor.java

@@ -1,185 +0,0 @@
-package crown.android;
-
-import java.util.List;
-import java.lang.Math;
-
-import android.content.Context;
-import android.util.Log;
-import android.hardware.Sensor;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.SensorManager;
-
-import crown.android.CrownEnum;
-
-
-/**
-*	CrownSensor manage sensors for Android Devices.
-*/
-public class CrownSensor
-{
-    private final float MIN_VALUE = -1.0f;
-    private final float MAX_VALUE = 1.0f;
-    private final static float RAD2DEG = (float) (180.0f / Math.PI);
-
-    private SensorManager sensorManager;
-    private Sensor mAccelerometerSensor;
-    private Sensor mCompassSensor;
-    private SensorEventListener mAccelerometerEventListener;
-    private SensorEventListener mCompassEventListener;
-    private boolean isAccelerometerAvailable;
-    private boolean isCompassAvailable;
-
-    private float[] mRotationMatrix;
-    private float[] mGravity;
-    private float[] mLastGravity;
-    private float[] mBufferedAccelGData;
-    private float[] mGeoMagn;
-    private float[] mBufferedMagnetData;
-    private float[] mOrientation;
-
-    private float[] mRotAngle;
- 
-
-//-----------------------------------------------------------------------------------
-    public CrownSensor(Context context)
-    {
-        mRotationMatrix = new float[16];
-        mGravity = new float[3];
-        mLastGravity = new float[3];
-        mGeoMagn = new float[3];
-        mOrientation = new float[3];
-        mRotAngle = new float[3];
-
-        isAccelerometerAvailable = context.getPackageManager().hasSystemFeature("android.hardware.sensor.accelerometer");
-        isCompassAvailable = context.getPackageManager().hasSystemFeature("android.hardware.sensor.compass");
-
-        if (hasAccelerometerSupport())
-        {
-            mAccelerometerEventListener = new SensorEventListener()
-            {
-                public void onAccuracyChanged(Sensor sensor, int accuracy) 
-                {
-                }
-
-                public void onSensorChanged(SensorEvent event)
-                {
-                    mGravity[0] = (mGravity[0] * 2 + event.values[0]) * 0.33334f * RAD2DEG;
-                    mGravity[1] = (mGravity[1] * 2 + event.values[1]) * 0.33334f * RAD2DEG;
-                    mGravity[2] = (mGravity[2] * 2 + event.values[2]) * 0.33334f * RAD2DEG;
-
-                    norm();
-
-                    CrownLib.pushFloatEvent(CrownEnum.OSET_ACCELEROMETER, mGravity[0], mGravity[1], mGravity[2], 0.0f);
-                }
-            };           
-        }
-
-        if (hasCompassSupport())
-        {
-            mCompassEventListener = new SensorEventListener()
-            {
-                public void onAccuracyChanged(Sensor sensor, int accuracy) 
-                {
-                }
-
-                public void onSensorChanged(SensorEvent event)
-                {
-                    mGeoMagn[0] = (mGeoMagn[0] + event.values[0]) * 0.5f;
-                    mGeoMagn[1] = (mGeoMagn[1] + event.values[1]) * 0.5f;
-                    mGeoMagn[2] = (mGeoMagn[2] + event.values[2]) * 0.5f; 
-
-                    // CrownLib.pushFloatEvent(CrownEnum.OSET_ACCELEROMETER, mGeoMagn[0], mGeoMagn[1], mGeoMagn[2], 0.0f);
-                }                
-            };
-        }
-    }
-
-//-----------------------------------------------------------------------------------
-    public boolean startListening(Context context)
-    {
-        sensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
-
-        mAccelerometerSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
-        mCompassSensor = sensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
-
-        sensorManager.registerListener(mAccelerometerEventListener, mAccelerometerSensor, SensorManager.SENSOR_DELAY_GAME);
-        sensorManager.registerListener(mCompassEventListener, mCompassSensor, SensorManager.SENSOR_DELAY_GAME);
-
-        return true;
-    }
-
-//-----------------------------------------------------------------------------------
-    public void stopListening()
-    {
-    	sensorManager.unregisterListener(mAccelerometerEventListener);
-        sensorManager.unregisterListener(mCompassEventListener);
-    }
-
-//-----------------------------------------------------------------------------------
-    public boolean hasAccelerometerSupport()
-    {
-        return isAccelerometerAvailable;       
-    }
-
-//-----------------------------------------------------------------------------------
-    public boolean hasCompassSupport()
-    {   
-        return isCompassAvailable;
-    }
-
- //-----------------------------------------------------------------------------------
-//     private void lowPassFiltering(float x, float y, float z)
-//     {
-//         float updateFreq = 30; // match this to your update speed
-//         float cutOffFreq = 0.9f;
-//         float timeRC = 1.0f / cutOffFreq;
-//         float dt = 1.0f / updateFreq;
-//         float filterConstant = timeRC / (dt + timeRC);
-//         float alpha = filterConstant;                 
-//         float kAccelerometerMinStep = 0.033f;
-//         float kAccelerometerNoiseAttenuation = 3.0f;
-
-//         float d = clamp((Math.abs(norm(mGravity[0], mGravity[1], mGravity[2]) - norm(x, y, z)) / kAccelerometerMinStep - 1.0f), MIN_VALUE, MAX_VALUE);
-//         alpha = d * filterConstant / kAccelerometerNoiseAttenuation + (1.0f - d) * filterConstant;
-
-//         mGravity[0] = (float) (alpha * (mGravity[0] + x - mLastGravity[0]));
-//         mGravity[1] = (float) (alpha * (mGravity[1] + y - mLastGravity[1]));
-//         mGravity[2] = (float) (alpha * (mGravity[2] + z - mLastGravity[2]));
-
-//         mLastGravity[0] = mGravity[0];
-//         mLastGravity[1] = mGravity[1];
-//         mLastGravity[2] = mGravity[2];
-//     }
-
-//-----------------------------------------------------------------------------------
-    private float clamp(float v, float min, float max)
-    {
-        if (v < min)
-        {
-            v = min;
-        }
-        else if (v > max)
-        {
-            v = max;
-        }
-
-        return v;
-    }
-
-//-----------------------------------------------------------------------------------
-    private void norm()
-    {
-        float v = mGravity[0] * mGravity[0] + mGravity[1] * mGravity[1] + mGravity[2] * mGravity[2];
-        float magnitude = (float)Math.sqrt(v);
-        float invMagnitude = 1 / magnitude;
-
-        mGravity[0] *= invMagnitude;
-        mGravity[1] *= invMagnitude;
-        mGravity[2] *= invMagnitude;
-
-        mGravity[0] = clamp(mGravity[0], MIN_VALUE, MAX_VALUE);
-        mGravity[1] = clamp(mGravity[1], MIN_VALUE, MAX_VALUE);
-        mGravity[2] = clamp(mGravity[2], MIN_VALUE, MAX_VALUE);
-    }
-}

+ 0 - 44
android/src/crown/android/CrownSurfaceView.java

@@ -1,44 +0,0 @@
-package crown.android;
-
-import android.content.Context;
-import android.view.Surface;
-import android.view.SurfaceView;
-import android.view.SurfaceHolder;
-
-public class CrownSurfaceView extends SurfaceView implements SurfaceHolder.Callback
-{
-//-----------------------------------------------------------------------------
-	public CrownSurfaceView(Context context)
-	{
-		super(context);
-		this.getHolder().addCallback(this);
-	}
-
-//-----------------------------------------------------------------------------
-    @Override
-    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) 
-    {    
-    	if (CrownLib.isRunning())
-    	{
-    		CrownLib.frame();
-    	}
-    }
-
-//-----------------------------------------------------------------------------
-    @Override
-    public void surfaceCreated(SurfaceHolder holder) 
-    {
-        CrownLib.setWindow(holder.getSurface());
-    	CrownLib.init();
-    }
-
-//-----------------------------------------------------------------------------
-    @Override
-    public void surfaceDestroyed(SurfaceHolder holder) 
-    {  
-    	if (CrownLib.isInit())
-    	{
-    		CrownLib.shutdown();
-    	}
-    }
-}

+ 0 - 64
android/src/crown/android/CrownTouch.java

@@ -1,64 +0,0 @@
-package crown.android;
-
-import android.content.Context;
-import android.util.Log;
-import android.view.MotionEvent;
-
-
-/**
-* CrownTouch manages touch and gesture events passing them to Crown Engine
-*/
-
-//TODO: gestures doesn't work...fix them
-public class CrownTouch
-{
-	private boolean 				isListening;
-
-//-----------------------------------------------------------------------------------
-	public CrownTouch(Context context)
-	{
-		isListening = false;
-	}
-
-//-----------------------------------------------------------------------------------
-	public void onTouch(MotionEvent event)
-	{
-		final int pointerIndex = event.getActionIndex();
-		final int pointerCount = event.getPointerCount();
-
-		final int pointerId = event.getPointerId(pointerIndex);
-		final float x = event.getX(pointerIndex);
-		final float y = event.getY(pointerIndex);
-
-		final int actionMasked = event.getActionMasked();
-
-		switch (actionMasked) 
-		{	
-			case MotionEvent.ACTION_DOWN:
-			case MotionEvent.ACTION_POINTER_DOWN:
-			{
-				CrownLib.pushIntEvent(CrownEnum.OSET_TOUCH_DOWN, pointerId, (int)x, (int)y, 0);
-				break;			
-			}
-
-			case MotionEvent.ACTION_UP:
-			case MotionEvent.ACTION_POINTER_UP:
-			case MotionEvent.ACTION_OUTSIDE:
-			case MotionEvent.ACTION_CANCEL:
-			{
-				CrownLib.pushIntEvent(CrownEnum.OSET_TOUCH_UP, pointerId, (int)x, (int)y, 0);
-				break;			
-			}
-			
-			case MotionEvent.ACTION_MOVE:
-			{
-				for (int index = 0; index < pointerCount; index++)
-				{
-					CrownLib.pushIntEvent(CrownEnum.OSET_TOUCH_MOVE, event.getPointerId(index), (int)event.getX(index), (int)event.getY(index), 0);
-				}
-
-				break;
-			}
-		}
-	}
-}