소스 검색

android dir moved to build

mikymod 13 년 전
부모
커밋
01251573cc
79개의 변경된 파일0개의 추가작업 그리고 975개의 파일을 삭제
  1. 0 7
      .gitignore
  2. 0 21
      android/AndroidManifest.xml
  3. 0 17
      android/ant.properties
  4. 0 92
      android/build.xml
  5. 0 132
      android/jni/Android.mk
  6. 0 3
      android/jni/Application.mk
  7. 0 1
      android/jni/Camera.cpp
  8. 0 1
      android/jni/Camera.h
  9. 0 1
      android/jni/Config.h
  10. 0 1
      android/jni/Crown.h
  11. 0 1
      android/jni/Data.h
  12. 0 1
      android/jni/Device.cpp
  13. 0 1
      android/jni/Device.h
  14. 0 1
      android/jni/EventBuffer.cpp
  15. 0 1
      android/jni/EventBuffer.h
  16. 0 1
      android/jni/Filesystem.cpp
  17. 0 1
      android/jni/Filesystem.h
  18. 0 1
      android/jni/Font.cpp
  19. 0 1
      android/jni/Font.h
  20. 0 1
      android/jni/FontManager.cpp
  21. 0 1
      android/jni/FontManager.h
  22. 0 1
      android/jni/Glyph.h
  23. 0 1
      android/jni/Image.cpp
  24. 0 1
      android/jni/Image.h
  25. 0 1
      android/jni/ImageLoader.cpp
  26. 0 1
      android/jni/ImageLoader.h
  27. 0 1
      android/jni/IndexBuffer.h
  28. 0 1
      android/jni/Log.cpp
  29. 0 1
      android/jni/Log.h
  30. 0 1
      android/jni/Material.cpp
  31. 0 1
      android/jni/Material.h
  32. 0 1
      android/jni/MaterialManager.cpp
  33. 0 1
      android/jni/MaterialManager.h
  34. 0 1
      android/jni/Mesh.cpp
  35. 0 1
      android/jni/Mesh.h
  36. 0 1
      android/jni/MeshChunk.cpp
  37. 0 1
      android/jni/MeshChunk.h
  38. 0 1
      android/jni/MeshLoader.h
  39. 0 1
      android/jni/MeshManager.cpp
  40. 0 1
      android/jni/MeshManager.h
  41. 0 1
      android/jni/MovableCamera.cpp
  42. 0 1
      android/jni/MovableCamera.h
  43. 0 1
      android/jni/OcclusionQuery.h
  44. 0 1
      android/jni/Pixel.cpp
  45. 0 1
      android/jni/Pixel.h
  46. 0 1
      android/jni/Renderer.cpp
  47. 0 1
      android/jni/Renderer.h
  48. 0 1
      android/jni/Resource.h
  49. 0 1
      android/jni/ResourceManager.cpp
  50. 0 1
      android/jni/ResourceManager.h
  51. 0 1
      android/jni/Skybox.cpp
  52. 0 1
      android/jni/Skybox.h
  53. 0 1
      android/jni/SpriteAnimator.cpp
  54. 0 1
      android/jni/SpriteAnimator.h
  55. 0 1
      android/jni/System.h
  56. 0 1
      android/jni/Terrain.cpp
  57. 0 1
      android/jni/Terrain.h
  58. 0 1
      android/jni/TextRenderer.cpp
  59. 0 1
      android/jni/TextRenderer.h
  60. 0 1
      android/jni/Texture.h
  61. 0 1
      android/jni/TextureManager.h
  62. 0 1
      android/jni/VertexBuffer.h
  63. 0 1
      android/jni/World.cpp
  64. 0 1
      android/jni/World.h
  65. 0 1
      android/jni/core
  66. 0 1
      android/jni/input
  67. 0 1
      android/jni/loaders
  68. 0 1
      android/jni/os
  69. 0 1
      android/jni/renderers
  70. 0 1
      android/jni/samples
  71. 0 1
      android/jni/windowing
  72. 0 20
      android/proguard-project.txt
  73. 0 14
      android/project.properties
  74. 0 12
      android/res/layout/main.xml
  75. 0 4
      android/res/values/strings.xml
  76. 0 196
      android/src/crown/android/CrownActivity.java
  77. 0 16
      android/src/crown/android/CrownEnum.java
  78. 0 25
      android/src/crown/android/CrownLib.java
  79. 0 351
      android/src/crown/android/CrownView.java

+ 0 - 7
.gitignore

@@ -1,11 +1,4 @@
 # Ignore build directory
 /build
 
-# Ignore Android stuff
-/android/assets
-/android/bin
-/android/gen
-/android/libs
-/android/obj
-/android/local.properties
 

+ 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="@string/app_name" >
-        <activity android:name="CrownActivity"
-                  android:label="@string/app_name"
-				  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 - 17
android/ant.properties

@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked into Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-#  'source.dir' for the location of your java source folder and
-#  'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-#  'key.store' for the location of your keystore and
-#  'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-

+ 0 - 92
android/build.xml

@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="android" 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 - 132
android/jni/Android.mk

@@ -1,132 +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    := crown
-LOCAL_SRC_FILES :=\
-	core/bv/Circle.cpp\
-	core/bv/Frustum.cpp\
-	core/bv/Rect.cpp\
-	core/containers/Generic.cpp\
-	core/containers/Str.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/MallocAllocator.cpp\
-	core/streams/FileStream.cpp\
-	core/streams/MemoryStream.cpp\
-	core/streams/Stream.cpp\
-\
-	input/EventDispatcher.cpp\
-	input/InputManager.cpp\
-\
-	loaders/BMPImageLoader.cpp\
-	loaders/TGAImageLoader.cpp\
-\
-	os/OS.cpp\
-	os/android/AndroidOS.cpp\
-	os/android/AndroidInput.cpp\
-	os/android/AndroidDevice.cpp\
-	os/android/File.cpp\
-\
-	Filesystem.cpp\
-\
-	renderers/gles/GLESIndexBuffer.cpp\
-	renderers/gles/GLESRenderer.cpp\
-	renderers/gles/GLESTexture.cpp\
-	renderers/gles/GLESTextureManager.cpp\
-	renderers/gles/GLESUtils.cpp\
-	renderers/gles/GLESVertexBuffer.cpp\
-\
-	Camera.cpp\
-	Device.cpp\
-	Font.cpp\
-	FontManager.cpp\
-	Image.cpp\
-	ImageLoader.cpp\
-	Log.cpp\
-	Material.cpp\
-	MaterialManager.cpp\
-	MeshChunk.cpp\
-	Mesh.cpp\
-	MeshManager.cpp\
-	MovableCamera.cpp\
-	Pixel.cpp\
-	Renderer.cpp\
-	ResourceManager.cpp\
-	Skybox.cpp\
-\
-
-LOCAL_C_INCLUDES	:=\
-	$(LOCAL_PATH)/core\
-	$(LOCAL_PATH)/core/math\
-	$(LOCAL_PATH)/core/compressors\
-	$(LOCAL_PATH)/core/containers\
-	$(LOCAL_PATH)/core/bv\
-	$(LOCAL_PATH)/core/mem\
-	$(LOCAL_PATH)/core/streams\
-	$(LOCAL_PATH)/loaders\
-	$(LOCAL_PATH)/os\
-	$(LOCAL_PATH)/os/android\
-	$(LOCAL_PATH)/renderers\
-	$(LOCAL_PATH)/things\
-	$(LOCAL_PATH)/filesystem\
-	$(LOCAL_PATH)/renderers/gl\
-	$(LOCAL_PATH)/renderers/gles\
-	$(LOCAL_PATH)/renderers/gles/egl\
-	$(LOCAL_PATH)/input\
-
-LOCAL_CPPFLAGS	:= -g -fexceptions
-LOCAL_LDLIBS	:= -llog -landroid -lGLESv1_CM
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE    := triangle
-LOCAL_SRC_FILES := samples/triangle.cpp
-
-LOCAL_C_INCLUDES	:=\
-	$(LOCAL_PATH)/core\
-	$(LOCAL_PATH)/core/math\
-	$(LOCAL_PATH)/core/containers\
-	$(LOCAL_PATH)/core/bv\
-	$(LOCAL_PATH)/core/mem\
-	$(LOCAL_PATH)/core/streams\
-	$(LOCAL_PATH)/loaders\
-	$(LOCAL_PATH)/os\
-	$(LOCAL_PATH)/os/android\
-	$(LOCAL_PATH)/renderers\
-	$(LOCAL_PATH)/filesystem\
-	$(LOCAL_PATH)/renderers/gles\
-	$(LOCAL_PATH)/renderers/gles/egl\
-	$(LOCAL_PATH)/input\
-	$(LOCAL_PATH)/samples\
-
-LOCAL_CPPFLAGS	:= -g -fexceptions
-LOCAL_LDLIBS	:= -llog -landroid -lGLESv1_CM -lz
-LOCAL_STATIC_LIBRARIES := crown
-#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/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/Crown.h

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

+ 0 - 1
android/jni/Data.h

@@ -1 +0,0 @@
-../../src/Data.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/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/FontManager.cpp

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

+ 0 - 1
android/jni/FontManager.h

@@ -1 +0,0 @@
-../../src/FontManager.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/ImageLoader.cpp

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

+ 0 - 1
android/jni/ImageLoader.h

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

+ 0 - 1
android/jni/IndexBuffer.h

@@ -1 +0,0 @@
-../../src/IndexBuffer.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/Material.cpp

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

+ 0 - 1
android/jni/Material.h

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

+ 0 - 1
android/jni/MaterialManager.cpp

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

+ 0 - 1
android/jni/MaterialManager.h

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

+ 0 - 1
android/jni/Mesh.cpp

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

+ 0 - 1
android/jni/Mesh.h

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

+ 0 - 1
android/jni/MeshChunk.cpp

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

+ 0 - 1
android/jni/MeshChunk.h

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

+ 0 - 1
android/jni/MeshLoader.h

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

+ 0 - 1
android/jni/MeshManager.cpp

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

+ 0 - 1
android/jni/MeshManager.h

@@ -1 +0,0 @@
-../../src/MeshManager.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/OcclusionQuery.h

@@ -1 +0,0 @@
-../../src/OcclusionQuery.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/Renderer.cpp

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

+ 0 - 1
android/jni/Renderer.h

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

+ 0 - 1
android/jni/Resource.h

@@ -1 +0,0 @@
-../../src/Resource.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/Skybox.cpp

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

+ 0 - 1
android/jni/Skybox.h

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

+ 0 - 1
android/jni/SpriteAnimator.cpp

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

+ 0 - 1
android/jni/SpriteAnimator.h

@@ -1 +0,0 @@
-../../src/SpriteAnimator.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/TextRenderer.cpp

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

+ 0 - 1
android/jni/TextRenderer.h

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

+ 0 - 1
android/jni/Texture.h

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

+ 0 - 1
android/jni/TextureManager.h

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

+ 0 - 1
android/jni/VertexBuffer.h

@@ -1 +0,0 @@
-../../src/VertexBuffer.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/input

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

+ 0 - 1
android/jni/loaders

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

+ 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/android/

+ 0 - 1
android/jni/windowing

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

+ 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-8

+ 0 - 12
android/res/layout/main.xml

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<TextView  
-    android:layout_width="fill_parent" 
-    android:layout_height="wrap_content" 
-    />
-</LinearLayout>
-

+ 0 - 4
android/res/values/strings.xml

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="app_name">CrownActivity</string>
-</resources>

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

@@ -1,196 +0,0 @@
-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 crown.android.CrownEnum;
-
-/**
-*	BootStrap of Android Application
-*/
-public class CrownActivity extends Activity
-{
-	// debug
-	public static String TAG = "CrownActivity";
-
-	// Resource attributes
-    static AssetManager assetManager;
-
-	// Graphic attributes
-	private CrownView mView;
-
-	// Input attributes
-	private static SensorManager sm;
-	private Sensor sensor;
-
-	/**
-	*
-	*/
-    public void onCreate(Bundle savedInstanceState)
-    {
-        super.onCreate(savedInstanceState);
-		// init AssetManager
-		assetManager = getAssets();
-		CrownLib.initAssetManager(assetManager);
-        // Init GLSurfaceView for rendering
-        mView = new CrownView(getApplication());
-		setContentView(mView);
-		// init SensorManager -> accelerometer
-	    sm = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
-	    sensor = sm.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
-		Log.i(TAG, "onCreate called.");
-    }
-
-	/**
-	*
-	*/
-	public void onStart()
-	{
-		super.onStart();
-		Log.i(TAG, "onStart called.");
-	}
-
-	/**
-	*
-	*/
-	public void onRestart()
-	{
-		super.onRestart();
-		Log.i(TAG, "onRestart called.");
-	}
-
-	/**
-	*
-	*/
-	public void onResume()
-	{
-		super.onResume();
-        mView.onResume();
-		
-		Log.i(TAG, "onResume called.");
-		// init accelerometer
-		if (sensor != null) 
-		{
-		  sm.registerListener(sensorEventListener, sensor, SensorManager.SENSOR_DELAY_NORMAL);
-		  Log.i(TAG, "ACCELEROMETER sensor registered.");
-		} 
-		else 
-		{
-		  Log.e(TAG, "ACCELEROMETER sensor cannot be registered. The application will be terminated.");
-		  finish();
-		}
-	}
-
-	/**
-	*
-	*/
-	public void onPause()
-	{
-		super.onPause();
-        mView.onPause();
-		Log.i(TAG, "onPause called.");
-	}
-
-	/**
-	*
-	*/
-	public void onStop()
-	{
-		super.onStop();
-		Log.i(TAG, "onStop called.");
-		// dismise accelerometer
-		sm.unregisterListener(sensorEventListener);
-	}
-
-	/**
-	*
-	*/
-	public void onDestroy()
-	{
-		super.onDestroy();
-		Log.i(TAG, "onDestroy called.");
-
-		//CrownLib.shutdown();
-	}
-
-	/**
-	*	Callback method which takes touch data and 
-	*	sends them to Crown.
-	*/
-	public boolean onTouchEvent(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:
-			{
-//				Log.i(TAG, "event: ACTION_DOWN_" + pointerId + ", x=" + x + " y=" + y);
-				CrownLib.pushEvent(CrownEnum.OSET_TOUCH_DOWN, pointerId, (int) x,(int) y, 0);
-				break;			
-			}
-
-			case MotionEvent.ACTION_UP:
-			case MotionEvent.ACTION_POINTER_UP:
-			{
-//				Log.i(TAG, "event = ACTION_UP_" + pointerId + ", x=" + x + " y=" + y);
-				CrownLib.pushEvent(CrownEnum.OSET_TOUCH_UP, pointerId, (int) x,(int) y, 0);
-				break;			
-			}
-			
-			case MotionEvent.ACTION_MOVE:
-			{
-				for (int index = 0; index < pointerCount; index++)
-				{
-//					Log.i(TAG, "event = ACTION_MOVE_" + event.getPointerId(index) + " X=" + (int)event.getX(index) + " Y=" + (int)event.getY(index));
-					CrownLib.pushEvent(CrownEnum.OSET_TOUCH_MOVE, event.getPointerId(index), (int)event.getX(index),(int)event.getY(index), 0);
-				}
-
-				break;
-			}
-		}
-
-		return true;
-	}
-
-	/**
-	*	Listener which embed callback methods for
-	*	accelerometer data
-	*/
-  	private SensorEventListener sensorEventListener = new SensorEventListener() 
-	{
-    	@Override
-    	public void onAccuracyChanged(Sensor sensor, int accuracy) 
-		{
-    	}
-
-    	@Override
-    	public void onSensorChanged(SensorEvent event) 
-		{
-     	 	float x = event.values[0];
-			float y = event.values[1];
-			float z = event.values[2];
-
-//			Log.i(TAG, "X:" + x + "Y:" + y + "Z:" + z);
-			CrownLib.pushEvent(11,(int) x,(int) y, (int)z, 0);
-    	}
-  	};
-}

+ 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 - 25
android/src/crown/android/CrownLib.java

@@ -1,25 +0,0 @@
-package crown.android;
-
-import android.content.res.AssetManager;
-
-public class CrownLib
-{
-	static 
-	{
-		System.loadLibrary("crown");
-		System.loadLibrary("triangle");
-	}
-	
-//	// Device functions
-	public static native void init();
-	public static native void frame();
-	public static native void shutdown();
-
-	// AssetManager functions
-	public static native void initAssetManager(AssetManager assetManager);
-
-	// InputManager functions
-	public static native void pushEvent(int type, int a, int b, int c, int d);
-
-
-}

+ 0 - 351
android/src/crown/android/CrownView.java

@@ -1,351 +0,0 @@
-package crown.android;
-
-import android.content.Context;
-import android.graphics.PixelFormat;
-import android.opengl.GLSurfaceView;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.KeyEvent;
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.egl.EGLContext;
-import javax.microedition.khronos.egl.EGLDisplay;
-import javax.microedition.khronos.opengles.GL10;
-
-
-/**
-*	This class provides a GL context used by 
-*	Crown for rendering
-*/
-class CrownView extends GLSurfaceView 
-{
-    private static String TAG = "CrownView";
-
-    private static final boolean DEBUG = false;
-
-	/**
-	*	Constructor
-	*/
-    public CrownView(Context context) 
-	{
-        super(context);
-        init(false, 0, 0);
-    }
-
-	/**
-	*	Constructor
-	*/
-    public CrownView(Context context, boolean translucent, int depth, int stencil) 
-	{
-        super(context);
-        init(translucent, depth, stencil);
-    }
-
-	/**
-	*	
-	*/
-    private void init(boolean translucent, int depth, int stencil) 
-	{
-
-        /* By default, GLSurfaceView() creates a RGB_565 opaque surface.
-         * If we want a translucent one, we should change the surface's
-         * format here, using PixelFormat.TRANSLUCENT for GL Surfaces
-         * is interpreted as any 32-bit surface with alpha by SurfaceFlinger.
-         */
-        if (translucent) 
-		{
-            this.getHolder().setFormat(PixelFormat.TRANSLUCENT);
-        }
-
-        /* Setup the context factory for 2.0 rendering.
-         * See ContextFactory class definition below
-         */
-        setEGLContextFactory(new ContextFactory());
-
-        /* We need to choose an EGLConfig that matches the format of
-         * our surface exactly. This is going to be done in our
-         * custom config chooser. See ConfigChooser class definition
-         * below.
-         */
-        setEGLConfigChooser( translucent ?
-                             new ConfigChooser(8, 8, 8, 8, depth, stencil) :
-                             new ConfigChooser(5, 6, 5, 0, depth, stencil) );
-
-        /* Set the renderer responsible for frame rendering */
-        setRenderer(new Renderer());
-    }
-
-	/**
-	* 	ContextFactory generate a EGL context that will be used by Crown
-	*/
-    private static class ContextFactory implements GLSurfaceView.EGLContextFactory 
-	{
-        private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
-
-        public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) 
-		{
-            Log.w(TAG, "creating EGL context");
-
-            checkEglError("Before eglCreateContext", egl);
-
-			// Create OpenGL|ES 1.1 context
-            int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 1, EGL10.EGL_NONE };
-			// Create OpenGL|ES 2 context
-//          int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
-
-            EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
-
-            checkEglError("After eglCreateContext", egl);
-
-            return context;
-        }
-
-        public void destroyContext(EGL10 egl, EGLDisplay display, EGLContext context) 
-		{
-            egl.eglDestroyContext(display, context);
-        }
-    }
-
-	/**
-	*	check EGL fails
-	*/
-    private static void checkEglError(String prompt, EGL10 egl) 
-	{
-        int error;
-        while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) 
-		{
-            Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error));
-        }
-    }
-
-	/**
-	*	ConfigChooser is used to set EGL configuration
-	*/
-    private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser 
-	{
-
-        public ConfigChooser(int r, int g, int b, int a, int depth, int stencil) 
-		{
-            mRedSize = r;
-            mGreenSize = g;
-            mBlueSize = b;
-            mAlphaSize = a;
-            mDepthSize = depth;
-            mStencilSize = stencil;
-        }
-
-		// Choose OpenGL|ES 1 bit
-        private static int EGL_OPENGL_ES_BIT = 1;
-		// Choose OpenGl|ES 2 bit
-//        private static int EGL_OPENGL_ES_BIT = 4;
-        private static int[] s_configAttribs2 =
-        {
-            EGL10.EGL_RED_SIZE, 4,
-            EGL10.EGL_GREEN_SIZE, 4,
-            EGL10.EGL_BLUE_SIZE, 4,
-            EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
-            EGL10.EGL_NONE
-        };
-
-        public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) 
-		{
-			Log.i(TAG, "JAVA CHOOSE CONFIG CALLED.");
-            /* Get the number of minimally matching EGL configurations
-             */
-            int[] num_config = new int[1];
-            egl.eglChooseConfig(display, s_configAttribs2, null, 0, num_config);
-
-            int numConfigs = num_config[0];
-
-            if (numConfigs <= 0) 
-			{
-                throw new IllegalArgumentException("No configs match configSpec");
-            }
-
-            /* Allocate then read the array of minimally matching EGL configs
-             */
-            EGLConfig[] configs = new EGLConfig[numConfigs];
-            egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config);
-
-            if (DEBUG) 
-			{
-                 printConfigs(egl, display, configs);
-            }
-            /* Now return the "best" one
-             */
-            return chooseConfig(egl, display, configs);
-        }
-
-        public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display, EGLConfig[] configs) 
-		{
-            for(EGLConfig config : configs) 
-			{
-                int d = findConfigAttrib(egl, display, config,
-                        EGL10.EGL_DEPTH_SIZE, 0);
-                int s = findConfigAttrib(egl, display, config,
-                        EGL10.EGL_STENCIL_SIZE, 0);
-
-                // We need at least mDepthSize and mStencilSize bits
-                if (d < mDepthSize || s < mStencilSize)
-                    continue;
-
-                // We want an *exact* match for red/green/blue/alpha
-                int r = findConfigAttrib(egl, display, config,
-                        EGL10.EGL_RED_SIZE, 0);
-                int g = findConfigAttrib(egl, display, config,
-                            EGL10.EGL_GREEN_SIZE, 0);
-                int b = findConfigAttrib(egl, display, config,
-                            EGL10.EGL_BLUE_SIZE, 0);
-                int a = findConfigAttrib(egl, display, config,
-                        EGL10.EGL_ALPHA_SIZE, 0);
-
-                if (r == mRedSize && g == mGreenSize && b == mBlueSize && a == mAlphaSize)
-				{
-                    return config;	
-				}
-            }
-            return null;
-        }
-
-        private int findConfigAttrib(EGL10 egl, EGLDisplay display, EGLConfig config, int attribute, int defaultValue) 
-		{
-            if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) 
-			{
-                return mValue[0];
-            }
-            return defaultValue;
-        }
-
-        private void printConfigs(EGL10 egl, EGLDisplay display, EGLConfig[] configs) 
-		{
-//            int numConfigs = configs.length;
-//            Log.w(TAG, String.format("%d configurations", numConfigs));
-//            for (int i = 0; i < numConfigs; i++) 
-//			{
-//                Log.w(TAG, String.format("Configuration %d:\n", i));
-//                printConfig(egl, display, configs[i]);
-//            }
-        }
-
-        private void printConfig(EGL10 egl, EGLDisplay display, EGLConfig config) 
-		{
-//            int[] attributes = {
-//				                    EGL10.EGL_BUFFER_SIZE,
-//            				        EGL10.EGL_ALPHA_SIZE,
-//                    				EGL10.EGL_BLUE_SIZE,
-//                   					EGL10.EGL_GREEN_SIZE,
-//                    				EGL10.EGL_RED_SIZE,
-//                    				EGL10.EGL_DEPTH_SIZE,
-//                   	 				EGL10.EGL_STENCIL_SIZE,
-//                    				EGL10.EGL_CONFIG_CAVEAT,
-//                    				EGL10.EGL_CONFIG_ID,
-//                    				EGL10.EGL_LEVEL,
-//                    				EGL10.EGL_MAX_PBUFFER_HEIGHT,
-//                    				EGL10.EGL_MAX_PBUFFER_PIXELS,
-//                    				EGL10.EGL_MAX_PBUFFER_WIDTH,
-//                    				EGL10.EGL_NATIVE_RENDERABLE,
-//								    EGL10.EGL_NATIVE_VISUAL_ID,
-//								    EGL10.EGL_NATIVE_VISUAL_TYPE,
-//								    0x3030, // EGL10.EGL_PRESERVED_RESOURCES,
-//								    EGL10.EGL_SAMPLES,
-//								    EGL10.EGL_SAMPLE_BUFFERS,
-//								    EGL10.EGL_SURFACE_TYPE,
-//								    EGL10.EGL_TRANSPARENT_TYPE,
-//								    EGL10.EGL_TRANSPARENT_RED_VALUE,
-//								    EGL10.EGL_TRANSPARENT_GREEN_VALUE,
-//								    EGL10.EGL_TRANSPARENT_BLUE_VALUE,
-//								    0x3039, // EGL10.EGL_BIND_TO_TEXTURE_RGB,
-//								    0x303A, // EGL10.EGL_BIND_TO_TEXTURE_RGBA,
-//								    0x303B, // EGL10.EGL_MIN_SWAP_INTERVAL,
-//								    0x303C, // EGL10.EGL_MAX_SWAP_INTERVAL,
-//								    EGL10.EGL_LUMINANCE_SIZE,
-//								    EGL10.EGL_ALPHA_MASK_SIZE,
-//								    EGL10.EGL_COLOR_BUFFER_TYPE,
-//								    EGL10.EGL_RENDERABLE_TYPE,
-//								    0x3042 // EGL10.EGL_CONFORMANT
-//            };
-//            String[] names = {
-//								    "EGL_BUFFER_SIZE",
-//								    "EGL_ALPHA_SIZE",
-//								    "EGL_BLUE_SIZE",
-//								    "EGL_GREEN_SIZE",
-//								    "EGL_RED_SIZE",
-//								    "EGL_DEPTH_SIZE",
-//								    "EGL_STENCIL_SIZE",
-//								    "EGL_CONFIG_CAVEAT",
-//								    "EGL_CONFIG_ID",
-//								    "EGL_LEVEL",
-//								    "EGL_MAX_PBUFFER_HEIGHT",
-//								    "EGL_MAX_PBUFFER_PIXELS",
-//								    "EGL_MAX_PBUFFER_WIDTH",
-//								    "EGL_NATIVE_RENDERABLE",
-//								    "EGL_NATIVE_VISUAL_ID",
-//								    "EGL_NATIVE_VISUAL_TYPE",
-//								    "EGL_PRESERVED_RESOURCES",
-//								    "EGL_SAMPLES",
-//								    "EGL_SAMPLE_BUFFERS",
-//								    "EGL_SURFACE_TYPE",
-//								    "EGL_TRANSPARENT_TYPE",
-//								    "EGL_TRANSPARENT_RED_VALUE",
-//								    "EGL_TRANSPARENT_GREEN_VALUE",
-//								    "EGL_TRANSPARENT_BLUE_VALUE",
-//								    "EGL_BIND_TO_TEXTURE_RGB",
-//								    "EGL_BIND_TO_TEXTURE_RGBA",
-//								    "EGL_MIN_SWAP_INTERVAL",
-//								    "EGL_MAX_SWAP_INTERVAL",
-//								    "EGL_LUMINANCE_SIZE",
-//								    "EGL_ALPHA_MASK_SIZE",
-//								    "EGL_COLOR_BUFFER_TYPE",
-//								    "EGL_RENDERABLE_TYPE",
-//								    "EGL_CONFORMANT"
-//            };
-
-//            int[] value = new int[1];
-//            for (int i = 0; i < attributes.length; i++) 
-//			{
-//                int attribute = attributes[i];
-//                String name = names[i];
-//                if ( egl.eglGetConfigAttrib(display, config, attribute, value))
-//				{
-//                    Log.w(TAG, String.format("  %s: %d\n", name, value[0]));
-//                } 
-//				else 
-//				{
-//                    // Log.w(TAG, String.format("  %s: failed\n", name));
-//                    while (egl.eglGetError() != EGL10.EGL_SUCCESS);
-//                }
-//            }
-        }
-
-        // Subclasses can adjust these values:
-        protected int mRedSize;
-        protected int mGreenSize;
-        protected int mBlueSize;
-        protected int mAlphaSize;
-        protected int mDepthSize;
-        protected int mStencilSize;
-        private int[] mValue = new int[1];
-    }
-	
-	/**
-	*	Renderer wraps Crown rendering functions
-	*/
-    private static class Renderer implements GLSurfaceView.Renderer
-	{
-        public void onDrawFrame(GL10 gl)
-		{
-			CrownLib.frame();
-        }
-
-        public void onSurfaceChanged(GL10 gl, int width, int height)
-		{
-			CrownLib.init();
-        }
-
-        public void onSurfaceCreated(GL10 gl, EGLConfig config)
-		{
-
-        }
-    }
-}