summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsm0a9f4 <sm0a9f4@1dde52a2-2b62-11df-8484-2f92f965d510>2010-04-02 17:29:14 +0000
committersm0a9f4 <sm0a9f4@1dde52a2-2b62-11df-8484-2f92f965d510>2010-04-02 17:29:14 +0000
commit3c1e67e433728684b5f228c5d4f3e5b1457bb271 (patch)
tree5028242fc17648eadbb8f4d0224952da1159f9b3
parent661a7f102c1d996e7391e01e679cf49d4e8695e7 (diff)
downloadreplicaisland-3c1e67e433728684b5f228c5d4f3e5b1457bb271.tar.gz
- Stop using VBOs when rendering with software (no speed improvement, and there are bugs in 1.5 and 1.6 software renderers related to freeing VBOs). This should fix the Cliq and other non-accelerated platforms.
- Fix Memory #034 to restore missing spike tiles. Also move a gem to make that level a little easier. - Add configurable keyboard setup UI, push configured keys through to game thread. - Add tilt sensitivity slider UI, hook up to game thread - Add "what's new" ticker to main menu - Fix Kabocha spelling error - Fix out-dated or missing copyright headers (Eclipse seems to have automagically removed a bunch of them--thanks eclipse!) git-svn-id: http://replicaisland.googlecode.com/svn/trunk@4 1dde52a2-2b62-11df-8484-2f92f965d510
-rw-r--r--AndroidManifest.xml2
-rw-r--r--res/anim/fade_in.xml7
-rw-r--r--res/drawable/key_config_border.xml11
-rw-r--r--res/drawable/key_config_border_active.xml11
-rw-r--r--res/layout/key_config.xml107
-rw-r--r--res/layout/mainmenu.xml41
-rw-r--r--res/layout/slider_preference.xml23
-rw-r--r--res/raw/level_4_4_underground.binbin30078 -> 30078 bytes
-rw-r--r--res/values/arrays.xml90
-rw-r--r--res/values/attrs.xml14
-rw-r--r--res/values/kabocha.xml2
-rw-r--r--res/values/strings.xml26
-rw-r--r--res/xml/preferences.xml35
-rw-r--r--src/com/replica/replicaisland/AABoxCollisionVolume.java2
-rw-r--r--src/com/replica/replicaisland/AllocationGuard.java2
-rw-r--r--src/com/replica/replicaisland/AndouKun.java19
-rw-r--r--src/com/replica/replicaisland/AnimationComponent.java2
-rw-r--r--src/com/replica/replicaisland/AnimationFrame.java2
-rw-r--r--src/com/replica/replicaisland/AnimationPlayerActivity.java2
-rw-r--r--src/com/replica/replicaisland/AttackAtDistanceComponent.java2
-rw-r--r--src/com/replica/replicaisland/BackgroundCollisionComponent.java2
-rw-r--r--src/com/replica/replicaisland/BaseObject.java2
-rw-r--r--src/com/replica/replicaisland/BufferLibrary.java18
-rw-r--r--src/com/replica/replicaisland/ButtonAnimationComponent.java2
-rw-r--r--src/com/replica/replicaisland/ButtonConstants.java3
-rw-r--r--src/com/replica/replicaisland/CameraBiasComponent.java17
-rw-r--r--src/com/replica/replicaisland/CameraSystem.java2
-rw-r--r--src/com/replica/replicaisland/ChangeComponentsComponent.java2
-rw-r--r--src/com/replica/replicaisland/ChannelSystem.java2
-rw-r--r--src/com/replica/replicaisland/CollisionParameters.java2
-rw-r--r--src/com/replica/replicaisland/CollisionSystem.java2
-rw-r--r--src/com/replica/replicaisland/CollisionVolume.java2
-rw-r--r--src/com/replica/replicaisland/ContextParameters.java2
-rw-r--r--src/com/replica/replicaisland/ConversationDialogActivity.java2
-rw-r--r--src/com/replica/replicaisland/ConversationUtils.java2
-rw-r--r--src/com/replica/replicaisland/CustomToastSystem.java17
-rw-r--r--src/com/replica/replicaisland/DebugLog.java18
-rw-r--r--src/com/replica/replicaisland/DebugSystem.java17
-rw-r--r--src/com/replica/replicaisland/DiaryActivity.java18
-rw-r--r--src/com/replica/replicaisland/DoorAnimationComponent.java18
-rw-r--r--src/com/replica/replicaisland/DrawableBitmap.java2
-rw-r--r--src/com/replica/replicaisland/DrawableFactory.java2
-rw-r--r--src/com/replica/replicaisland/DrawableObject.java2
-rw-r--r--src/com/replica/replicaisland/DynamicCollisionComponent.java2
-rw-r--r--src/com/replica/replicaisland/EnemyAnimationComponent.java2
-rw-r--r--src/com/replica/replicaisland/EventRecorder.java18
-rw-r--r--src/com/replica/replicaisland/FadeDrawableComponent.java3
-rw-r--r--src/com/replica/replicaisland/FixedAnimationComponent.java2
-rw-r--r--src/com/replica/replicaisland/FixedSizeArray.java2
-rw-r--r--src/com/replica/replicaisland/GLErrorLogger.java18
-rw-r--r--src/com/replica/replicaisland/GLSurfaceView.java2
-rw-r--r--src/com/replica/replicaisland/Game.java17
-rw-r--r--src/com/replica/replicaisland/GameComponent.java2
-rw-r--r--src/com/replica/replicaisland/GameComponentPool.java2
-rw-r--r--src/com/replica/replicaisland/GameFlowEvent.java18
-rw-r--r--src/com/replica/replicaisland/GameObject.java2
-rw-r--r--src/com/replica/replicaisland/GameObjectCollisionSystem.java2
-rw-r--r--src/com/replica/replicaisland/GameObjectFactory.java2
-rw-r--r--src/com/replica/replicaisland/GameObjectManager.java2
-rw-r--r--src/com/replica/replicaisland/GameRenderer.java10
-rw-r--r--src/com/replica/replicaisland/GameThread.java105
-rw-r--r--src/com/replica/replicaisland/GenericAnimationComponent.java2
-rw-r--r--src/com/replica/replicaisland/GhostComponent.java2
-rw-r--r--src/com/replica/replicaisland/GravityComponent.java2
-rw-r--r--src/com/replica/replicaisland/Grid.java2
-rw-r--r--src/com/replica/replicaisland/HitPlayerComponent.java2
-rw-r--r--src/com/replica/replicaisland/HitPoint.java3
-rw-r--r--src/com/replica/replicaisland/HitPointPool.java18
-rw-r--r--src/com/replica/replicaisland/HitReactionComponent.java2
-rw-r--r--src/com/replica/replicaisland/HotSpotSystem.java2
-rw-r--r--src/com/replica/replicaisland/HudSystem.java2
-rw-r--r--src/com/replica/replicaisland/InputSystem.java19
-rw-r--r--src/com/replica/replicaisland/Interpolator.java2
-rw-r--r--src/com/replica/replicaisland/InventoryComponent.java2
-rw-r--r--src/com/replica/replicaisland/KeyboardConfigDialogPreference.java239
-rw-r--r--src/com/replica/replicaisland/LaunchProjectileComponent.java2
-rw-r--r--src/com/replica/replicaisland/LauncherComponent.java2
-rw-r--r--src/com/replica/replicaisland/Lerp.java3
-rw-r--r--src/com/replica/replicaisland/LevelBuilder.java2
-rw-r--r--src/com/replica/replicaisland/LevelSelectActivity.java2
-rw-r--r--src/com/replica/replicaisland/LevelSystem.java2
-rw-r--r--src/com/replica/replicaisland/LevelTree.java2
-rw-r--r--src/com/replica/replicaisland/LifetimeComponent.java2
-rw-r--r--src/com/replica/replicaisland/MainLoop.java2
-rw-r--r--src/com/replica/replicaisland/MainMenuActivity.java19
-rw-r--r--src/com/replica/replicaisland/MotionBlurComponent.java16
-rw-r--r--src/com/replica/replicaisland/MovementComponent.java2
-rw-r--r--src/com/replica/replicaisland/NPCAnimationComponent.java2
-rw-r--r--src/com/replica/replicaisland/NPCComponent.java16
-rw-r--r--src/com/replica/replicaisland/ObjectManager.java2
-rw-r--r--src/com/replica/replicaisland/ObjectPool.java3
-rw-r--r--src/com/replica/replicaisland/ObjectRegistry.java2
-rw-r--r--src/com/replica/replicaisland/OpenGLSystem.java2
-rw-r--r--src/com/replica/replicaisland/OrbitalMagnetComponent.java2
-rw-r--r--src/com/replica/replicaisland/PatrolComponent.java2
-rw-r--r--src/com/replica/replicaisland/PhasedObject.java2
-rw-r--r--src/com/replica/replicaisland/PhasedObjectManager.java5
-rw-r--r--src/com/replica/replicaisland/PhysicsComponent.java3
-rw-r--r--src/com/replica/replicaisland/PlaySingleSoundComponent.java2
-rw-r--r--src/com/replica/replicaisland/PlayerComponent.java16
-rw-r--r--src/com/replica/replicaisland/PopOutComponent.java2
-rw-r--r--src/com/replica/replicaisland/QuickSorter.java16
-rw-r--r--src/com/replica/replicaisland/RenderComponent.java2
-rw-r--r--src/com/replica/replicaisland/RenderSystem.java2
-rw-r--r--src/com/replica/replicaisland/ScrollableBitmap.java2
-rw-r--r--src/com/replica/replicaisland/ScrollerComponent.java2
-rw-r--r--src/com/replica/replicaisland/SelectDialogComponent.java2
-rw-r--r--src/com/replica/replicaisland/SetPreferencesActivity.java9
-rw-r--r--src/com/replica/replicaisland/ShellSorter.java16
-rw-r--r--src/com/replica/replicaisland/SimpleCollisionComponent.java2
-rw-r--r--src/com/replica/replicaisland/SimplePhysicsComponent.java2
-rw-r--r--src/com/replica/replicaisland/SleeperComponent.java2
-rw-r--r--src/com/replica/replicaisland/SliderPreference.java126
-rw-r--r--src/com/replica/replicaisland/SolidSurfaceComponent.java2
-rw-r--r--src/com/replica/replicaisland/SortConstants.java16
-rw-r--r--src/com/replica/replicaisland/Sorter.java18
-rw-r--r--src/com/replica/replicaisland/SoundSystem.java16
-rw-r--r--src/com/replica/replicaisland/SphereCollisionVolume.java2
-rw-r--r--src/com/replica/replicaisland/SpriteAnimation.java2
-rw-r--r--src/com/replica/replicaisland/SpriteComponent.java2
-rw-r--r--src/com/replica/replicaisland/StandardSorter.java16
-rw-r--r--src/com/replica/replicaisland/TObjectPool.java2
-rw-r--r--src/com/replica/replicaisland/Texture.java2
-rw-r--r--src/com/replica/replicaisland/TextureLibrary.java2
-rw-r--r--src/com/replica/replicaisland/TheSourceComponent.java16
-rw-r--r--src/com/replica/replicaisland/TiledBackgroundVertexGrid.java2
-rw-r--r--src/com/replica/replicaisland/TiledVertexGrid.java16
-rw-r--r--src/com/replica/replicaisland/TiledWorld.java2
-rw-r--r--src/com/replica/replicaisland/TimeSystem.java2
-rw-r--r--src/com/replica/replicaisland/Utils.java2
-rw-r--r--src/com/replica/replicaisland/Vector2.java2
-rw-r--r--src/com/replica/replicaisland/VectorPool.java2
-rw-r--r--src/com/replica/replicaisland/VibrationSystem.java3
-rw-r--r--src/com/replica/replicaisland/YesNoDialogPreference.java16
134 files changed, 1305 insertions, 204 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index f16dd96..755f286 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.replica.replicaisland" android:versionName="1.0" android:versionCode="8">
+ package="com.replica.replicaisland" android:versionName="1.2" android:versionCode="10">
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
diff --git a/res/anim/fade_in.xml b/res/anim/fade_in.xml
new file mode 100644
index 0000000..db8e228
--- /dev/null
+++ b/res/anim/fade_in.xml
@@ -0,0 +1,7 @@
+<alpha xmlns:android="http://schemas.android.com/apk/res/android"
+ android:interpolator="@android:anim/accelerate_interpolator"
+ android:fromAlpha="0.0"
+ android:toAlpha="1.0"
+ android:duration="5000"
+ android:startOffset="5000"
+ android:fillAfter="true"/> \ No newline at end of file
diff --git a/res/drawable/key_config_border.xml b/res/drawable/key_config_border.xml
new file mode 100644
index 0000000..ad973cc
--- /dev/null
+++ b/res/drawable/key_config_border.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+
+<solid android:color="#99999999"/>
+<padding
+ android:left="7dp"
+ android:top="7dp"
+ android:right="7dp"
+ android:bottom="7dp" />
+<corners android:radius="10dp" />
+</shape> \ No newline at end of file
diff --git a/res/drawable/key_config_border_active.xml b/res/drawable/key_config_border_active.xml
new file mode 100644
index 0000000..2c38fe0
--- /dev/null
+++ b/res/drawable/key_config_border_active.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+
+<solid android:color="#99FF7700"/>
+<padding
+ android:left="7dp"
+ android:top="7dp"
+ android:right="7dp"
+ android:bottom="7dp" />
+<corners android:radius="10dp" />
+</shape> \ No newline at end of file
diff --git a/res/layout/key_config.xml b/res/layout/key_config.xml
new file mode 100644
index 0000000..23d2579
--- /dev/null
+++ b/res/layout/key_config.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <ScrollView
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_height="fill_parent" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:paddingLeft="20dp" android:paddingRight="20dp">
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_height="fill_parent" android:paddingTop="20dp" android:layout_width="wrap_content">
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:paddingBottom="10dp">
+ <TextView android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/preference_key_config_left" android:layout_width="50dp"/>
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:gravity="center"
+ android:background="@drawable/key_config_border"
+ android:id="@+id/left_border" android:layout_width="120dp">
+ <TextView android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_width="wrap_content"
+ android:text="A"
+ android:id="@+id/key_left"/>
+ </LinearLayout>
+ </LinearLayout>
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:paddingBottom="10dp">
+ <TextView android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/preference_key_config_right" android:layout_width="50dp"/>
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="wrap_content"
+ android:background="@drawable/key_config_border"
+ android:layout_gravity="center_vertical"
+ android:gravity="center"
+ android:id="@+id/right_border" android:layout_width="120dp">
+ <TextView android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_width="wrap_content"
+ android:text="A"
+ android:id="@+id/key_right"/>
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_height="fill_parent" android:paddingTop="20dp" android:layout_width="wrap_content">
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:paddingBottom="10dp">
+ <TextView android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/preference_key_config_jump" android:layout_marginLeft="50dp" android:layout_width="50dp"/>
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="wrap_content"
+ android:background="@drawable/key_config_border"
+ android:layout_gravity="center_vertical"
+ android:gravity="center"
+ android:id="@+id/jump_border" android:layout_width="120dp">
+ <TextView android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_width="wrap_content"
+ android:text="A"
+ android:id="@+id/key_jump"/>
+ </LinearLayout>
+ </LinearLayout>
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:paddingBottom="10dp">
+ <TextView android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/preference_key_config_attack" android:layout_marginLeft="50dp" android:layout_width="50dp"/>
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="wrap_content"
+ android:background="@drawable/key_config_border"
+ android:layout_gravity="center_vertical"
+ android:gravity="center"
+ android:id="@+id/attack_border" android:layout_width="120dp">
+ <TextView android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_width="wrap_content"
+ android:text="A"
+ android:id="@+id/key_attack"/>
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+ </ScrollView>
+</FrameLayout>
+ \ No newline at end of file
diff --git a/res/layout/mainmenu.xml b/res/layout/mainmenu.xml
index ac27198..34cd0fa 100644
--- a/res/layout/mainmenu.xml
+++ b/res/layout/mainmenu.xml
@@ -12,25 +12,21 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_x="0dp"
- android:layout_y="0dp"
- />
+ android:layout_y="0dp" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_x="0dp"
android:layout_y="20dp"
- android:gravity="center_horizontal"
- >
+ android:gravity="center_horizontal" >
<ImageView
android:id="@+id/mainMenuTitle"
android:src="@drawable/title"
android:adjustViewBounds="true"
android:layout_width="336dp"
android:layout_height="153dp"
- android:gravity="center_horizontal"
-
- />
+ android:gravity="center_horizontal" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
@@ -48,13 +44,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
- android:clickable="true"
- />
+ android:clickable="true"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="20dip"
- xmlns:android="http://schemas.android.com/apk/res/android"
- />
+ xmlns:android="http://schemas.android.com/apk/res/android"/>
<ImageView
android:id="@+id/optionButton"
@@ -62,14 +56,29 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
- android:clickable="true"
- />
+ android:clickable="true"/>
<LinearLayout
android:layout_width="fill_parent"
- android:layout_height="40dip"
- xmlns:android="http://schemas.android.com/apk/res/android"
- />
+ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="20dip"/>
+
+ <TextView
+ android:layout_gravity="bottom|fill_horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:ellipsize="marquee"
+ android:background="#99000000"
+ android:textColor= "#FFFFFF"
+ android:textColorHighlight="#FFFFFF"
+ android:text="@string/whats_new_ticker"
+ android:lines="1"
+ android:marqueeRepeatLimit="marquee_forever"
+ android:textSize="14sp"
+ android:fadingEdge="horizontal"
+ android:fadingEdgeLength="5dp"
+ android:focusable="false"
+ android:id="@+id/ticker"
+ android:singleLine="true"/>
</LinearLayout>
</AbsoluteLayout> \ No newline at end of file
diff --git a/res/layout/slider_preference.xml b/res/layout/slider_preference.xml
new file mode 100644
index 0000000..0206eee
--- /dev/null
+++ b/res/layout/slider_preference.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal">
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/min"
+ android:text="Min"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"/>
+ <SeekBar xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/slider"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical" android:layout_width="250dp" android:layout_margin="10dp"/>
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/max"
+ android:text="Max"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_vertical"/>
+</LinearLayout>
diff --git a/res/raw/level_4_4_underground.bin b/res/raw/level_4_4_underground.bin
index cc1e555..f90f98e 100644
--- a/res/raw/level_4_4_underground.bin
+++ b/res/raw/level_4_4_underground.bin
Binary files differ
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
new file mode 100644
index 0000000..ff25763
--- /dev/null
+++ b/res/values/arrays.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources>
+ <!-- This came right out of frameworks/base/include/ui/KeycodeLabels.h -->
+ <string-array name="keycode_labels">
+ <item>SOFT LEFT</item>
+ <item>SOFT RIGHT</item>
+ <item>HOME</item>
+ <item>BACK</item>
+ <item>CALL</item>
+ <item>ENDCALL</item>
+ <item>0</item>
+ <item>1</item>
+ <item>2</item>
+ <item>3</item>
+ <item>4</item>
+ <item>5</item>
+ <item>6</item>
+ <item>7</item>
+ <item>8</item>
+ <item>9</item>
+ <item>STAR</item>
+ <item>POUND</item>
+ <item>DPAD UP</item>
+ <item>DPAD DOWN</item>
+ <item>DPAD LEFT</item>
+ <item>DPAD RIGHT</item>
+ <item>DPAD CENTER</item>
+ <item>VOLUME UP</item>
+ <item>VOLUME DOWN</item>
+ <item>POWER</item>
+ <item>CAMERA</item>
+ <item>CLEAR</item>
+ <item>A</item>
+ <item>B</item>
+ <item>C</item>
+ <item>D</item>
+ <item>E</item>
+ <item>F</item>
+ <item>G</item>
+ <item>H</item>
+ <item>I</item>
+ <item>J</item>
+ <item>K</item>
+ <item>L</item>
+ <item>M</item>
+ <item>N</item>
+ <item>O</item>
+ <item>P</item>
+ <item>Q</item>
+ <item>R</item>
+ <item>S</item>
+ <item>T</item>
+ <item>U</item>
+ <item>V</item>
+ <item>W</item>
+ <item>X</item>
+ <item>Y</item>
+ <item>Z</item>
+ <item>COMMA</item>
+ <item>PERIOD</item>
+ <item>ALT LEFT</item>
+ <item>ALT RIGHT</item>
+ <item>SHIFT LEFT</item>
+ <item>SHIFT RIGHT</item>
+ <item>TAB</item>
+ <item>SPACE</item>
+ <item>SYM</item>
+ <item>EXPLORER</item>
+ <item>ENVELOPE</item>
+ <item>ENTER</item>
+ <item>DEL</item>
+ <item>GRAVE</item>
+ <item>MINUS</item>
+ <item>EQUALS</item>
+ <item>LEFT BRACKET</item>
+ <item>RIGHT BRACKET</item>
+ <item>BACKSLASH</item>
+ <item>SEMICOLON</item>
+ <item>APOSTROPHE</item>
+ <item>SLASH</item>
+ <item>AT</item>
+ <item>NUM</item>
+ <item>HEADSETHOOK</item>
+ <item>FOCUS</item>
+ <item>PLUS</item>
+ <item>MENU</item>
+ <item>NOTIFICATION</item>
+ <item>SEARCH</item>
+ </string-array>
+</resources> \ No newline at end of file
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
new file mode 100644
index 0000000..8c6d235
--- /dev/null
+++ b/res/values/attrs.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources>
+ <declare-styleable name = "SliderPreference">
+ <attr name="minText" format = "string"/>
+ <attr name="maxText" format = "string"/>
+ </declare-styleable>
+
+ <declare-styleable name = "KeyConfigPreference">
+ <attr name="leftKey" format = "string"/>
+ <attr name="rightKey" format = "string"/>
+ <attr name="jumpKey" format = "string"/>
+ <attr name="attackKey" format = "string"/>
+ </declare-styleable>
+</resources> \ No newline at end of file
diff --git a/res/values/kabocha.xml b/res/values/kabocha.xml
index f77de48..58086a8 100644
--- a/res/values/kabocha.xml
+++ b/res/values/kabocha.xml
@@ -4,7 +4,7 @@
<!-- Kabocha Dialog Entries -->
<string name="Kabocha_0_2_1_1">
-System check looks good, unit tests are passing, boostrap is complete! Oh jolly, he’s responding!
+System check looks good, unit tests are passing, bootstrap is complete! Oh jolly, he’s responding!
</string>
<string name="Kabocha_0_2_1_2">
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2aca4da..fd6575b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -32,6 +32,21 @@
<string name="preference_enable_tilt_controls">Tilt Controls</string>
<string name="preference_enable_tilt_controls_summary">EXPERIMENTAL! Tilt the phone left and right to drive the Android around. Good for devices with no trackball or d-pad.</string>
+<string name="preference_tilt_sensitivity">Tilt Sensitivity</string>
+<string name="preference_tilt_sensitivity_summary">Adjusts the sensitivity of the tilt controls.</string>
+<string name="preference_tilt_min">Slow</string>
+<string name="preference_tilt_max">Fast</string>
+
+<string name="preference_key_config">Configure Keyboard</string>
+<string name="preference_key_config_summary">Customize keys for phones with hard keyboards.</string>
+<string name="preference_key_config_dialog_title">Configure Keyboard</string>
+<string name="preference_key_config_dialog_ok">Save</string>
+<string name="preference_key_config_dialog_cancel">Cancel</string>
+<string name="preference_key_config_left">Left</string>
+<string name="preference_key_config_right">Right</string>
+<string name="preference_key_config_jump">Jump</string>
+<string name="preference_key_config_attack">Attack</string>
+
<string name="preference_enable_statistics">Report Play Statistics</string>
<string name="preference_enable_statistics_summary">Sends anonymous play statistics to a server to help us make this game more fun.</string>
@@ -42,6 +57,8 @@
<string name="preference_visit_site">Go to the Replica Island web site</string>
<string name="preference_thanks_title">Special Thanks</string>
<string name="preference_thanks_summary">Special Thanks to Adrian Havill, Casey Richardson, Jason Chen, Tim Mansfield, and the Android Team for their support of this project.</string>
+<string name="preference_licence_title">License</string>
+<string name="preference_licence_summary">Portions of this game are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.</string>
<string name="saved_game_erased_notification">Saved Game Erased</string>
@@ -57,9 +74,10 @@
<string name="whats_new_dialog_ok">Rock on!</string>
<string name="whats_new_dialog_message">Thanks for downloading Replica Island.\n\n
<b>New in this version:</b>\n
-\t• Control customization (Droid users, try turning Click To Attack off in the options screen)\n
-\t• Experimental Tilt controls (for devices without a trackball or dpad)\n
-\t• Various compatibility fixes (fixed drawing problems on the Cliq).
+\t• Crash fixes and general stability improvements. \n
+\t• Keyboard configuration for devices with hard keyboards. \n
+\t• Tilt control sensitivity controls. \n
+\t• Fixed missing graphics on confusing Memory #034 puzzle. \n
\n
\n
This is an open source project. If you are interested in how it works, or would like to use it to make your
@@ -69,6 +87,8 @@ own games, check out the source at our web site, replicaisland.net.
Also note that this game sends anonymous play statistics back to a server. If you’d rather not
allow that, you can turn it off in the options screen.</string>
+<string name="whats_new_ticker">New in this version: Crash fixes, fixes to the confusing Memory #034 puzzle, configurable controls, configurable tilt sensitivity.</string>
+
<!-- Toast Messages -->
<string name="memory_playback_start">MEMORY PLAYBACK START</string>
<string name="memory_playback_complete">MEMORY PLAYBACK COMPLETE</string>
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
index ff8ea0f..9fea04e 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/preferences.xml
@@ -30,7 +30,8 @@
/>
<PreferenceScreen
- android:title="@string/preference_configure_controls">
+ android:title="@string/preference_configure_controls"
+ xmlns:replica="http://schemas.android.com/apk/res/com.replica.replicaisland">
<CheckBoxPreference
android:key="enableClickAttack"
android:title="@string/preference_enable_click_attack"
@@ -39,6 +40,21 @@
android:defaultValue="true"
android:persistent="true"
/>
+
+ <com.replica.replicaisland.KeyboardConfigDialogPreference
+ android:key="keyconfig"
+ android:title="@string/preference_key_config"
+ android:summary="@string/preference_key_config_summary"
+ android:dialogLayout="@layout/key_config"
+ android:dialogTitle="@string/preference_key_config_dialog_title"
+ android:negativeButtonText="@string/preference_key_config_dialog_cancel"
+ android:positiveButtonText="@string/preference_key_config_dialog_ok"
+ replica:leftKey="keyLeft"
+ replica:rightKey="keyRight"
+ replica:jumpKey="keyJump"
+ replica:attackKey="keyAttack"
+ />
+
<CheckBoxPreference
android:key="enableTiltControls"
android:title="@string/preference_enable_tilt_controls"
@@ -47,6 +63,17 @@
android:defaultValue="false"
android:persistent="true"
/>
+
+ <com.replica.replicaisland.SliderPreference
+ android:key="tiltSensitivity"
+ android:defaultValue="50"
+ android:title="@string/preference_tilt_sensitivity"
+ android:summary="@string/preference_tilt_sensitivity_summary"
+ replica:maxText="@string/preference_tilt_max"
+ replica:minText="@string/preference_tilt_min"
+ android:persistent="true"
+ android:dependency="enableTiltControls"/>
+
</PreferenceScreen>
</PreferenceCategory>
@@ -96,6 +123,12 @@
android:summary="@string/preference_thanks_summary"
android:enabled="false"
android:selectable="false" />
+
+ <Preference
+ android:title="@string/preference_licence_title"
+ android:summary="@string/preference_licence_summary"
+ android:enabled="false"
+ android:selectable="false" />
</PreferenceCategory>
diff --git a/src/com/replica/replicaisland/AABoxCollisionVolume.java b/src/com/replica/replicaisland/AABoxCollisionVolume.java
index f0f33c4..5c1d14b 100644
--- a/src/com/replica/replicaisland/AABoxCollisionVolume.java
+++ b/src/com/replica/replicaisland/AABoxCollisionVolume.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/AllocationGuard.java b/src/com/replica/replicaisland/AllocationGuard.java
index 22bd269..e5f187d 100644
--- a/src/com/replica/replicaisland/AllocationGuard.java
+++ b/src/com/replica/replicaisland/AllocationGuard.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/AndouKun.java b/src/com/replica/replicaisland/AndouKun.java
index c06bb8d..eb08bd0 100644
--- a/src/com/replica/replicaisland/AndouKun.java
+++ b/src/com/replica/replicaisland/AndouKun.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -65,6 +65,12 @@ public class AndouKun extends Activity implements SensorEventListener {
public static final String PREFERENCE_STATS_ENABLED = "enableStats";
public static final String PREFERENCE_CLICK_ATTACK = "enableClickAttack";
public static final String PREFERENCE_TILT_CONTROLS = "enableTiltControls";
+ public static final String PREFERENCE_TILT_SENSITIVITY = "tiltSensitivity";
+
+ public static final String PREFERENCE_LEFT_KEY = "keyLeft";
+ public static final String PREFERENCE_RIGHT_KEY = "keyRight";
+ public static final String PREFERENCE_ATTACK_KEY = "keyAttack";
+ public static final String PREFERENCE_JUMP_KEY = "keyJump";
public static final String PREFERENCE_NAME = "ReplicaIslandPrefs";
@@ -72,7 +78,7 @@ public class AndouKun extends Activity implements SensorEventListener {
// If the version is a negative number, debug features (logging and a debug menu)
// are enabled.
- public static final int VERSION = 9;
+ public static final int VERSION = 10;
private GLSurfaceView mGLSurfaceView;
private Game mGame;
@@ -248,9 +254,16 @@ public class AndouKun extends Activity implements SensorEventListener {
final boolean soundEnabled = prefs.getBoolean(PREFERENCE_SOUND_ENABLED, true);
final boolean clickAttack = prefs.getBoolean(PREFERENCE_CLICK_ATTACK, true);
final boolean tiltControls = prefs.getBoolean(PREFERENCE_TILT_CONTROLS, false);
+ final int tiltSensitivity = prefs.getInt(PREFERENCE_TILT_SENSITIVITY, 50);
+
+ final int leftKey = prefs.getInt(PREFERENCE_LEFT_KEY, KeyEvent.KEYCODE_DPAD_LEFT);
+ final int rightKey = prefs.getInt(PREFERENCE_RIGHT_KEY, KeyEvent.KEYCODE_DPAD_RIGHT);
+ final int jumpKey = prefs.getInt(PREFERENCE_JUMP_KEY, KeyEvent.KEYCODE_SPACE);
+ final int attackKey = prefs.getInt(PREFERENCE_ATTACK_KEY, KeyEvent.KEYCODE_SHIFT_LEFT);
mGame.setSoundEnabled(soundEnabled);
- mGame.setControlOptions(clickAttack, tiltControls);
+ mGame.setControlOptions(clickAttack, tiltControls, tiltSensitivity);
+ mGame.setKeyConfig(leftKey, rightKey, jumpKey, attackKey);
if (mSensorManager != null) {
Sensor orientation = mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);
diff --git a/src/com/replica/replicaisland/AnimationComponent.java b/src/com/replica/replicaisland/AnimationComponent.java
index 778c463..70ecf04 100644
--- a/src/com/replica/replicaisland/AnimationComponent.java
+++ b/src/com/replica/replicaisland/AnimationComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/AnimationFrame.java b/src/com/replica/replicaisland/AnimationFrame.java
index 7b4e2f5..3ca3191 100644
--- a/src/com/replica/replicaisland/AnimationFrame.java
+++ b/src/com/replica/replicaisland/AnimationFrame.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/AnimationPlayerActivity.java b/src/com/replica/replicaisland/AnimationPlayerActivity.java
index 532224f..02fd89d 100644
--- a/src/com/replica/replicaisland/AnimationPlayerActivity.java
+++ b/src/com/replica/replicaisland/AnimationPlayerActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/AttackAtDistanceComponent.java b/src/com/replica/replicaisland/AttackAtDistanceComponent.java
index 47437e2..de52c45 100644
--- a/src/com/replica/replicaisland/AttackAtDistanceComponent.java
+++ b/src/com/replica/replicaisland/AttackAtDistanceComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/BackgroundCollisionComponent.java b/src/com/replica/replicaisland/BackgroundCollisionComponent.java
index d3b99f1..40f491b 100644
--- a/src/com/replica/replicaisland/BackgroundCollisionComponent.java
+++ b/src/com/replica/replicaisland/BackgroundCollisionComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/BaseObject.java b/src/com/replica/replicaisland/BaseObject.java
index 4c27c14..28b83f7 100644
--- a/src/com/replica/replicaisland/BaseObject.java
+++ b/src/com/replica/replicaisland/BaseObject.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/BufferLibrary.java b/src/com/replica/replicaisland/BufferLibrary.java
index 96ccd8d..2c82ce8 100644
--- a/src/com/replica/replicaisland/BufferLibrary.java
+++ b/src/com/replica/replicaisland/BufferLibrary.java
@@ -1,4 +1,20 @@
-package com.replica.replicaisland;
+/*
+ * 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.
+ */
+
+ package com.replica.replicaisland;
import javax.microedition.khronos.opengles.GL10;
diff --git a/src/com/replica/replicaisland/ButtonAnimationComponent.java b/src/com/replica/replicaisland/ButtonAnimationComponent.java
index 77758af..5bdb771 100644
--- a/src/com/replica/replicaisland/ButtonAnimationComponent.java
+++ b/src/com/replica/replicaisland/ButtonAnimationComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/ButtonConstants.java b/src/com/replica/replicaisland/ButtonConstants.java
index a4e3819..bfde6ed 100644
--- a/src/com/replica/replicaisland/ButtonConstants.java
+++ b/src/com/replica/replicaisland/ButtonConstants.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-
package com.replica.replicaisland;
public final class ButtonConstants {
diff --git a/src/com/replica/replicaisland/CameraBiasComponent.java b/src/com/replica/replicaisland/CameraBiasComponent.java
index e3dba63..e2540b1 100644
--- a/src/com/replica/replicaisland/CameraBiasComponent.java
+++ b/src/com/replica/replicaisland/CameraBiasComponent.java
@@ -1,4 +1,19 @@
-package com.replica.replicaisland;
+/*
+ * 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.
+ */
+ package com.replica.replicaisland;
public class CameraBiasComponent extends GameComponent {
public CameraBiasComponent() {
diff --git a/src/com/replica/replicaisland/CameraSystem.java b/src/com/replica/replicaisland/CameraSystem.java
index 6ac9694..08a824c 100644
--- a/src/com/replica/replicaisland/CameraSystem.java
+++ b/src/com/replica/replicaisland/CameraSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/ChangeComponentsComponent.java b/src/com/replica/replicaisland/ChangeComponentsComponent.java
index 9127d81..4087d3e 100644
--- a/src/com/replica/replicaisland/ChangeComponentsComponent.java
+++ b/src/com/replica/replicaisland/ChangeComponentsComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/ChannelSystem.java b/src/com/replica/replicaisland/ChannelSystem.java
index 7b0d6e1..e2a769e 100644
--- a/src/com/replica/replicaisland/ChannelSystem.java
+++ b/src/com/replica/replicaisland/ChannelSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/CollisionParameters.java b/src/com/replica/replicaisland/CollisionParameters.java
index b9071fe..43975c9 100644
--- a/src/com/replica/replicaisland/CollisionParameters.java
+++ b/src/com/replica/replicaisland/CollisionParameters.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/CollisionSystem.java b/src/com/replica/replicaisland/CollisionSystem.java
index dd6dd5a..0f6772e 100644
--- a/src/com/replica/replicaisland/CollisionSystem.java
+++ b/src/com/replica/replicaisland/CollisionSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/CollisionVolume.java b/src/com/replica/replicaisland/CollisionVolume.java
index 122bbd6..fb3d612 100644
--- a/src/com/replica/replicaisland/CollisionVolume.java
+++ b/src/com/replica/replicaisland/CollisionVolume.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/ContextParameters.java b/src/com/replica/replicaisland/ContextParameters.java
index 4d20c23..c2689ab 100644
--- a/src/com/replica/replicaisland/ContextParameters.java
+++ b/src/com/replica/replicaisland/ContextParameters.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/ConversationDialogActivity.java b/src/com/replica/replicaisland/ConversationDialogActivity.java
index 0bb3975..18c5805 100644
--- a/src/com/replica/replicaisland/ConversationDialogActivity.java
+++ b/src/com/replica/replicaisland/ConversationDialogActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/ConversationUtils.java b/src/com/replica/replicaisland/ConversationUtils.java
index 9cfe9e2..23c4a7a 100644
--- a/src/com/replica/replicaisland/ConversationUtils.java
+++ b/src/com/replica/replicaisland/ConversationUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/CustomToastSystem.java b/src/com/replica/replicaisland/CustomToastSystem.java
index 1959434..c16330b 100644
--- a/src/com/replica/replicaisland/CustomToastSystem.java
+++ b/src/com/replica/replicaisland/CustomToastSystem.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
+
+
package com.replica.replicaisland;
import android.content.Context;
diff --git a/src/com/replica/replicaisland/DebugLog.java b/src/com/replica/replicaisland/DebugLog.java
index 0cb1477..1612cfd 100644
--- a/src/com/replica/replicaisland/DebugLog.java
+++ b/src/com/replica/replicaisland/DebugLog.java
@@ -1,4 +1,20 @@
-package com.replica.replicaisland;
+/*
+ * 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.
+ */
+
+ package com.replica.replicaisland;
import android.util.Log;
diff --git a/src/com/replica/replicaisland/DebugSystem.java b/src/com/replica/replicaisland/DebugSystem.java
index e53af79..76ddf9b 100644
--- a/src/com/replica/replicaisland/DebugSystem.java
+++ b/src/com/replica/replicaisland/DebugSystem.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
+
+
package com.replica.replicaisland;
public final class DebugSystem extends BaseObject {
diff --git a/src/com/replica/replicaisland/DiaryActivity.java b/src/com/replica/replicaisland/DiaryActivity.java
index 7de529c..5a2778c 100644
--- a/src/com/replica/replicaisland/DiaryActivity.java
+++ b/src/com/replica/replicaisland/DiaryActivity.java
@@ -1,4 +1,20 @@
-package com.replica.replicaisland;
+/*
+ * 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.
+ */
+
+ package com.replica.replicaisland;
import android.app.Activity;
import android.content.Intent;
diff --git a/src/com/replica/replicaisland/DoorAnimationComponent.java b/src/com/replica/replicaisland/DoorAnimationComponent.java
index 2f8c8b9..ab4990e 100644
--- a/src/com/replica/replicaisland/DoorAnimationComponent.java
+++ b/src/com/replica/replicaisland/DoorAnimationComponent.java
@@ -1,4 +1,20 @@
-package com.replica.replicaisland;
+/*
+ * 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.
+ */
+
+ package com.replica.replicaisland;
import com.replica.replicaisland.SoundSystem.Sound;
diff --git a/src/com/replica/replicaisland/DrawableBitmap.java b/src/com/replica/replicaisland/DrawableBitmap.java
index 1c951d4..82ea742 100644
--- a/src/com/replica/replicaisland/DrawableBitmap.java
+++ b/src/com/replica/replicaisland/DrawableBitmap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/DrawableFactory.java b/src/com/replica/replicaisland/DrawableFactory.java
index b9a33dc..7c2f14c 100644
--- a/src/com/replica/replicaisland/DrawableFactory.java
+++ b/src/com/replica/replicaisland/DrawableFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/DrawableObject.java b/src/com/replica/replicaisland/DrawableObject.java
index 1cb4af4..53603a5 100644
--- a/src/com/replica/replicaisland/DrawableObject.java
+++ b/src/com/replica/replicaisland/DrawableObject.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/DynamicCollisionComponent.java b/src/com/replica/replicaisland/DynamicCollisionComponent.java
index b82fd79..05fbb6d 100644
--- a/src/com/replica/replicaisland/DynamicCollisionComponent.java
+++ b/src/com/replica/replicaisland/DynamicCollisionComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/EnemyAnimationComponent.java b/src/com/replica/replicaisland/EnemyAnimationComponent.java
index 340b2ea..527af52 100644
--- a/src/com/replica/replicaisland/EnemyAnimationComponent.java
+++ b/src/com/replica/replicaisland/EnemyAnimationComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/EventRecorder.java b/src/com/replica/replicaisland/EventRecorder.java
index 4f2bec6..a8e4d4b 100644
--- a/src/com/replica/replicaisland/EventRecorder.java
+++ b/src/com/replica/replicaisland/EventRecorder.java
@@ -1,4 +1,20 @@
-package com.replica.replicaisland;
+/*
+ * 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.
+ */
+
+ package com.replica.replicaisland;
public class EventRecorder extends BaseObject {
private Vector2 mLastDeathPosition = new Vector2();
diff --git a/src/com/replica/replicaisland/FadeDrawableComponent.java b/src/com/replica/replicaisland/FadeDrawableComponent.java
index 2b35dc6..bfcb301 100644
--- a/src/com/replica/replicaisland/FadeDrawableComponent.java
+++ b/src/com/replica/replicaisland/FadeDrawableComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-
package com.replica.replicaisland;
public class FadeDrawableComponent extends GameComponent {
diff --git a/src/com/replica/replicaisland/FixedAnimationComponent.java b/src/com/replica/replicaisland/FixedAnimationComponent.java
index ccc46c4..a3a476d 100644
--- a/src/com/replica/replicaisland/FixedAnimationComponent.java
+++ b/src/com/replica/replicaisland/FixedAnimationComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/FixedSizeArray.java b/src/com/replica/replicaisland/FixedSizeArray.java
index c1cb4bf..471a5da 100644
--- a/src/com/replica/replicaisland/FixedSizeArray.java
+++ b/src/com/replica/replicaisland/FixedSizeArray.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/GLErrorLogger.java b/src/com/replica/replicaisland/GLErrorLogger.java
index 7d84d47..198e342 100644
--- a/src/com/replica/replicaisland/GLErrorLogger.java
+++ b/src/com/replica/replicaisland/GLErrorLogger.java
@@ -1,4 +1,20 @@
-package com.replica.replicaisland;
+/*
+ * 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.
+ */
+
+ package com.replica.replicaisland;
import java.nio.Buffer;
import java.nio.FloatBuffer;
diff --git a/src/com/replica/replicaisland/GLSurfaceView.java b/src/com/replica/replicaisland/GLSurfaceView.java
index 4430ae2..e56f62a 100644
--- a/src/com/replica/replicaisland/GLSurfaceView.java
+++ b/src/com/replica/replicaisland/GLSurfaceView.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/Game.java b/src/com/replica/replicaisland/Game.java
index a6cbf44..228b5fa 100644
--- a/src/com/replica/replicaisland/Game.java
+++ b/src/com/replica/replicaisland/Game.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -485,9 +485,12 @@ public class Game extends AllocationGuard {
BaseObject.sSystemRegistry.soundSystem.setSoundEnabled(soundEnabled);
}
- public void setControlOptions(boolean clickAttack, boolean tiltControls) {
- BaseObject.sSystemRegistry.inputSystem.setClickActive(clickAttack);
+ public void setControlOptions(boolean clickAttack, boolean tiltControls, int tiltSensitivity) {
+ if (mGameThread != null) {
+ mGameThread.setClickActive(clickAttack);
+ }
BaseObject.sSystemRegistry.inputSystem.setUseOrientationForRoll(tiltControls);
+ BaseObject.sSystemRegistry.inputSystem.setOrientationSensitivityModifier((tiltSensitivity / 100.0f));
}
public float getGameTime() {
@@ -502,4 +505,12 @@ public class Game extends AllocationGuard {
return (mRunning && mGameThread != null && mGameThread.getPaused());
}
+ public void setKeyConfig(int leftKey, int rightKey, int jumpKey,
+ int attackKey) {
+ if (mGameThread != null) {
+ mGameThread.setKeyConfig(leftKey, rightKey, jumpKey, attackKey);
+ }
+
+ }
+
}
diff --git a/src/com/replica/replicaisland/GameComponent.java b/src/com/replica/replicaisland/GameComponent.java
index 099c04f..aba2179 100644
--- a/src/com/replica/replicaisland/GameComponent.java
+++ b/src/com/replica/replicaisland/GameComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/GameComponentPool.java b/src/com/replica/replicaisland/GameComponentPool.java
index 6270570..de43d07 100644
--- a/src/com/replica/replicaisland/GameComponentPool.java
+++ b/src/com/replica/replicaisland/GameComponentPool.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/GameFlowEvent.java b/src/com/replica/replicaisland/GameFlowEvent.java
index a7acf8f..4a6dbd3 100644
--- a/src/com/replica/replicaisland/GameFlowEvent.java
+++ b/src/com/replica/replicaisland/GameFlowEvent.java
@@ -1,4 +1,20 @@
-package com.replica.replicaisland;
+/*
+ * 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.
+ */
+
+ package com.replica.replicaisland;
import android.content.Context;
diff --git a/src/com/replica/replicaisland/GameObject.java b/src/com/replica/replicaisland/GameObject.java
index 392486a..49841b4 100644
--- a/src/com/replica/replicaisland/GameObject.java
+++ b/src/com/replica/replicaisland/GameObject.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/GameObjectCollisionSystem.java b/src/com/replica/replicaisland/GameObjectCollisionSystem.java
index aa5f9a1..eb89090 100644
--- a/src/com/replica/replicaisland/GameObjectCollisionSystem.java
+++ b/src/com/replica/replicaisland/GameObjectCollisionSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/GameObjectFactory.java b/src/com/replica/replicaisland/GameObjectFactory.java
index 6dd8d1a..da9ca3d 100644
--- a/src/com/replica/replicaisland/GameObjectFactory.java
+++ b/src/com/replica/replicaisland/GameObjectFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/GameObjectManager.java b/src/com/replica/replicaisland/GameObjectManager.java
index bea2861..409c60e 100644
--- a/src/com/replica/replicaisland/GameObjectManager.java
+++ b/src/com/replica/replicaisland/GameObjectManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/GameRenderer.java b/src/com/replica/replicaisland/GameRenderer.java
index 3acd198..215492f 100644
--- a/src/com/replica/replicaisland/GameRenderer.java
+++ b/src/com/replica/replicaisland/GameRenderer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -102,17 +102,21 @@ public class GameRenderer implements GLSurfaceView.Renderer {
String extensions = gl.glGetString(GL10.GL_EXTENSIONS);
String version = gl.glGetString(GL10.GL_VERSION);
+ String renderer = gl.glGetString(GL10.GL_RENDERER);
+ boolean isSoftwareRenderer = renderer.contains("PixelFlinger");
boolean isOpenGL10 = version.contains("1.0");
boolean supportsDrawTexture = extensions.contains("draw_texture");
// VBOs are standard in GLES1.1
- boolean supportsVBOs = !isOpenGL10 || extensions.contains("vertex_buffer_object");
+ // No use using VBOs when software renderering, esp. since older versions of the software renderer
+ // had a crash bug related to freeing VBOs.
+ boolean supportsVBOs = !isSoftwareRenderer && (!isOpenGL10 || extensions.contains("vertex_buffer_object"));
ContextParameters params = BaseObject.sSystemRegistry.contextParameters;
params.supportsDrawTexture = supportsDrawTexture;
params.supportsVBOs = supportsVBOs;
hackBrokenDevices();
- DebugLog.i("Graphics Support", version + ": " +(supportsDrawTexture ? "draw texture," : "") + (supportsVBOs ? "vbos" : ""));
+ DebugLog.i("Graphics Support", version + " (" + renderer + "): " +(supportsDrawTexture ? "draw texture," : "") + (supportsVBOs ? "vbos" : ""));
mGame.onSurfaceCreated();
diff --git a/src/com/replica/replicaisland/GameThread.java b/src/com/replica/replicaisland/GameThread.java
index d8e75aa..3b3534d 100644
--- a/src/com/replica/replicaisland/GameThread.java
+++ b/src/com/replica/replicaisland/GameThread.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -51,7 +51,15 @@ public class GameThread implements Runnable {
private boolean mKeyUpUp;
private boolean mKeyTouchUp;
private boolean mKeyClickUp;
+
+ private boolean mClickActive;
+ // Configurable key codes
+ private int mLeftKey = KeyEvent.KEYCODE_DPAD_LEFT;
+ private int mRightKey = KeyEvent.KEYCODE_DPAD_RIGHT;
+ private int mJumpKey = KeyEvent.KEYCODE_SPACE;
+ private int mAttackKey = KeyEvent.KEYCODE_SHIFT_LEFT;
+
private ObjectManager mGameRoot;
private GameRenderer mRenderer;
private Object mInputLock;
@@ -60,6 +68,7 @@ public class GameThread implements Runnable {
private boolean mPaused = false;
private int mProfileFrames;
private long mProfileTime;
+
private static final float PROFILE_REPORT_DELAY = 3.0f;
public GameThread(GameRenderer renderer) {
@@ -287,34 +296,19 @@ public class GameThread implements Runnable {
public boolean keydownEvent(int keycode) {
boolean ateKey = true;
synchronized (mInputLock) {
- switch (keycode) {
- case KeyEvent.KEYCODE_DPAD_LEFT:
- mKeyLeft = true;
- break;
- case KeyEvent.KEYCODE_DPAD_RIGHT:
- mKeyRight = true;
- break;
- case KeyEvent.KEYCODE_DPAD_UP:
- mKeyUp = true;
- break;
- case KeyEvent.KEYCODE_DPAD_DOWN:
- mKeyDown = true;
- break;
- case KeyEvent.KEYCODE_DPAD_CENTER:
- mKeyClick = true;
- break;
- case KeyEvent.KEYCODE_SPACE:
- mKeyTouch = true;
- break;
- case KeyEvent.KEYCODE_B:
- mKeyClick = true;
- break;
- case KeyEvent.KEYCODE_A:
- mKeyTouch = true;
- break;
- default:
- ateKey = false;
- }
+ if (keycode == mLeftKey) {
+ mKeyLeft = true;
+ } else if (keycode == mRightKey) {
+ mKeyRight = true;
+ } else if (keycode == mJumpKey) {
+ mKeyTouch = true;
+ } else if (keycode == mAttackKey) {
+ mKeyClick = true;
+ } else if (mClickActive && keycode == KeyEvent.KEYCODE_DPAD_CENTER) {
+ mKeyClick = true;
+ } else {
+ ateKey = false;
+ }
mKeyInputReceived = ateKey;
}
@@ -324,37 +318,36 @@ public class GameThread implements Runnable {
public boolean keyupEvent(int keycode) {
boolean ateKey = true;
synchronized (mInputLock) {
- switch (keycode) {
- case KeyEvent.KEYCODE_DPAD_LEFT:
- mKeyLeftUp = true;
- break;
- case KeyEvent.KEYCODE_DPAD_RIGHT:
- mKeyRightUp = true;
- break;
- case KeyEvent.KEYCODE_DPAD_UP:
- mKeyUpUp = true;
- break;
- case KeyEvent.KEYCODE_DPAD_DOWN:
- mKeyDownUp = true;
- break;
- case KeyEvent.KEYCODE_DPAD_CENTER:
- mKeyClickUp = true;
- break;
- case KeyEvent.KEYCODE_SPACE:
- mKeyTouchUp = true;
- break;
- case KeyEvent.KEYCODE_B:
- mKeyClickUp = true;
- break;
- case KeyEvent.KEYCODE_A:
- mKeyTouchUp = true;
- break;
- default:
- ateKey = false;
+ if (keycode == mLeftKey) {
+ mKeyLeftUp = true;
+ } else if (keycode == mRightKey) {
+ mKeyRightUp = true;
+ } else if (keycode == mJumpKey) {
+ mKeyTouchUp = true;
+ } else if (keycode == mAttackKey) {
+ mKeyClickUp = true;
+ } else if (mClickActive && keycode == KeyEvent.KEYCODE_DPAD_CENTER) {
+ mKeyClickUp = true;
+ } else {
+ ateKey = false;
}
mKeyInputReceived = ateKey;
}
return ateKey;
}
+
+ public void setKeyConfig(int leftKey, int rightKey, int jumpKey,
+ int attackKey) {
+ synchronized (mInputLock) {
+ mLeftKey = leftKey;
+ mRightKey = rightKey;
+ mJumpKey = jumpKey;
+ mAttackKey = attackKey;
+ }
+ }
+
+ public void setClickActive(boolean clickAttack) {
+ mClickActive = clickAttack;
+ }
}
diff --git a/src/com/replica/replicaisland/GenericAnimationComponent.java b/src/com/replica/replicaisland/GenericAnimationComponent.java
index cbebee4..fcab7dd 100644
--- a/src/com/replica/replicaisland/GenericAnimationComponent.java
+++ b/src/com/replica/replicaisland/GenericAnimationComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/GhostComponent.java b/src/com/replica/replicaisland/GhostComponent.java
index 8be11c3..9d02edb 100644
--- a/src/com/replica/replicaisland/GhostComponent.java
+++ b/src/com/replica/replicaisland/GhostComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/GravityComponent.java b/src/com/replica/replicaisland/GravityComponent.java
index b8545fb..048c136 100644
--- a/src/com/replica/replicaisland/GravityComponent.java
+++ b/src/com/replica/replicaisland/GravityComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/Grid.java b/src/com/replica/replicaisland/Grid.java
index 0a94c7f..783c1bb 100644
--- a/src/com/replica/replicaisland/Grid.java
+++ b/src/com/replica/replicaisland/Grid.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/HitPlayerComponent.java b/src/com/replica/replicaisland/HitPlayerComponent.java
index 7e51689..91e3f19 100644
--- a/src/com/replica/replicaisland/HitPlayerComponent.java
+++ b/src/com/replica/replicaisland/HitPlayerComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/HitPoint.java b/src/com/replica/replicaisland/HitPoint.java
index e44f86e..990568d 100644
--- a/src/com/replica/replicaisland/HitPoint.java
+++ b/src/com/replica/replicaisland/HitPoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-
package com.replica.replicaisland;
public class HitPoint extends AllocationGuard {
diff --git a/src/com/replica/replicaisland/HitPointPool.java b/src/com/replica/replicaisland/HitPointPool.java
index 98470fa..fc101a7 100644
--- a/src/com/replica/replicaisland/HitPointPool.java
+++ b/src/com/replica/replicaisland/HitPointPool.java
@@ -1,4 +1,20 @@
-package com.replica.replicaisland;
+/*
+ * 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.
+ */
+
+ package com.replica.replicaisland;
public class HitPointPool extends TObjectPool<HitPoint> {
diff --git a/src/com/replica/replicaisland/HitReactionComponent.java b/src/com/replica/replicaisland/HitReactionComponent.java
index a56dff0..58485b4 100644
--- a/src/com/replica/replicaisland/HitReactionComponent.java
+++ b/src/com/replica/replicaisland/HitReactionComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/HotSpotSystem.java b/src/com/replica/replicaisland/HotSpotSystem.java
index 247fbe6..7f1656b 100644
--- a/src/com/replica/replicaisland/HotSpotSystem.java
+++ b/src/com/replica/replicaisland/HotSpotSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/HudSystem.java b/src/com/replica/replicaisland/HudSystem.java
index e122d18..44af450 100644
--- a/src/com/replica/replicaisland/HudSystem.java
+++ b/src/com/replica/replicaisland/HudSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/InputSystem.java b/src/com/replica/replicaisland/InputSystem.java
index 025871e..c0e2272 100644
--- a/src/com/replica/replicaisland/InputSystem.java
+++ b/src/com/replica/replicaisland/InputSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -152,7 +152,8 @@ public class InputSystem extends BaseObject {
}
private final static float KEY_ROLL_SPEED = 0.25f;
- private final static float TILT_ROLL_SPEED = 5.0f;
+ private final static float TILT_ROLL_SPEED = 1.0f;
+ private final static float TILT_ROLL_MODIFIER = 8.0f;
private final static float DPAD_TIMEOUT = -1.0f; //2.0f;
private final static float ROLL_TIMEOUT = 0.1f;
private final static int ROLL_HISTORY_SIZE = 10;
@@ -173,7 +174,7 @@ public class InputSystem extends BaseObject {
private Vector2 mCurrentRollDirection = new Vector2();
private boolean mUseOrientationForRoll = false; // If true, pipes tilt into the directional pad.
-
+ private float mOrientationSensitivityModifier = 0.5f;
public InputSystem() {
super();
@@ -272,7 +273,9 @@ public class InputSystem extends BaseObject {
}
//roll(smoothedPitch * TILT_ROLL_SPEED, smoothedRoll * TILT_ROLL_SPEED);
- mDirectionalPad.press(time.getGameTime(), smoothedPitch * TILT_ROLL_SPEED, smoothedRoll * TILT_ROLL_SPEED);
+ mDirectionalPad.press(time.getGameTime(),
+ smoothedPitch * (TILT_ROLL_SPEED + (TILT_ROLL_MODIFIER * mOrientationSensitivityModifier)),
+ smoothedRoll * (TILT_ROLL_SPEED + (TILT_ROLL_MODIFIER * mOrientationSensitivityModifier)));
}
}
@@ -406,12 +409,12 @@ public class InputSystem extends BaseObject {
return mOrientationSensor.getY();
}
- public void setClickActive(boolean active) {
- mClick.setActive(active);
- }
-
public void setUseOrientationForRoll(boolean rollWithOrientation) {
mUseOrientationForRoll = rollWithOrientation;
}
+
+ public void setOrientationSensitivityModifier(float modifier) {
+ mOrientationSensitivityModifier = modifier;
+ }
}
diff --git a/src/com/replica/replicaisland/Interpolator.java b/src/com/replica/replicaisland/Interpolator.java
index 4e5fc3c..fbe12a1 100644
--- a/src/com/replica/replicaisland/Interpolator.java
+++ b/src/com/replica/replicaisland/Interpolator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/InventoryComponent.java b/src/com/replica/replicaisland/InventoryComponent.java
index ae23b7c..d5d704c 100644
--- a/src/com/replica/replicaisland/InventoryComponent.java
+++ b/src/com/replica/replicaisland/InventoryComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/KeyboardConfigDialogPreference.java b/src/com/replica/replicaisland/KeyboardConfigDialogPreference.java
new file mode 100644
index 0000000..13c90ad
--- /dev/null
+++ b/src/com/replica/replicaisland/KeyboardConfigDialogPreference.java
@@ -0,0 +1,239 @@
+/*
+ * 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.
+ */
+
+package com.replica.replicaisland;
+
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.SharedPreferences;
+import android.content.DialogInterface.OnKeyListener;
+import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.preference.DialogPreference;
+import android.util.AttributeSet;
+import android.view.KeyEvent;
+import android.view.View;
+import android.widget.TextView;
+
+
+public class KeyboardConfigDialogPreference extends DialogPreference implements OnKeyListener {
+ private SharedPreferences mSharedPrefs;
+ private Context mContext;
+ private String mLeftPrefKey;
+ private String mRightPrefKey;
+ private String mJumpPrefKey;
+ private String mAttackPrefKey;
+ private String[] mKeyLabels;
+ private int mListeningId = 0;
+ private View mLeftBorder;
+ private View mRightBorder;
+ private View mJumpBorder;
+ private View mAttackBorder;
+ private Drawable mUnselectedBorder;
+ private Drawable mSelectedBorder;
+ private int mLeftKeyCode;
+ private int mRightKeyCode;
+ private int mJumpKeyCode;
+ private int mAttackKeyCode;
+ private TextView mLeftText;
+ private TextView mRightText;
+ private TextView mJumpText;
+ private TextView mAttackText;
+
+ private class ConfigClickListener implements View.OnClickListener {
+ private int mId;
+ public ConfigClickListener(int id) {
+ mId = id;
+ }
+
+ public void onClick(View v) {
+ selectId(mId);
+ }
+
+ }
+
+ public KeyboardConfigDialogPreference(Context context, AttributeSet attrs) {
+ this(context, attrs, android.R.attr.dialogPreferenceStyle);
+ }
+
+ public KeyboardConfigDialogPreference(Context context, AttributeSet attrs,
+ int defStyle) {
+ super(context, attrs, defStyle);
+
+ TypedArray a = context.obtainStyledAttributes(attrs,
+ R.styleable.KeyConfigPreference, defStyle, 0);
+ mLeftPrefKey = a.getString(R.styleable.KeyConfigPreference_leftKey);
+ mRightPrefKey = a.getString(R.styleable.KeyConfigPreference_rightKey);
+ mJumpPrefKey = a.getString(R.styleable.KeyConfigPreference_jumpKey);
+ mAttackPrefKey = a.getString(R.styleable.KeyConfigPreference_attackKey);
+
+ a.recycle();
+ }
+
+ public KeyboardConfigDialogPreference(Context context) {
+ this(context, null);
+ }
+
+ @Override
+ protected void onBindDialogView(View view) {
+ super.onBindDialogView(view);
+ if (mSharedPrefs != null) {
+ mLeftKeyCode = mSharedPrefs.getInt(mLeftPrefKey, KeyEvent.KEYCODE_DPAD_LEFT);
+ mRightKeyCode = mSharedPrefs.getInt(mRightPrefKey, KeyEvent.KEYCODE_DPAD_RIGHT);
+ mJumpKeyCode = mSharedPrefs.getInt(mJumpPrefKey, KeyEvent.KEYCODE_SPACE);
+ mAttackKeyCode = mSharedPrefs.getInt(mAttackPrefKey, KeyEvent.KEYCODE_SHIFT_LEFT);
+
+
+ mLeftText = (TextView)view.findViewById(R.id.key_left);
+ mLeftText.setText(getKeyLabel(mLeftKeyCode));
+
+ mRightText = (TextView)view.findViewById(R.id.key_right);
+ mRightText.setText(getKeyLabel(mRightKeyCode));
+
+ mJumpText = (TextView)view.findViewById(R.id.key_jump);
+ mJumpText.setText(getKeyLabel(mJumpKeyCode));
+
+ mAttackText = (TextView)view.findViewById(R.id.key_attack);
+ mAttackText.setText(getKeyLabel(mAttackKeyCode));
+
+ mLeftBorder = view.findViewById(R.id.left_border);
+ mRightBorder = view.findViewById(R.id.right_border);
+ mJumpBorder = view.findViewById(R.id.jump_border);
+ mAttackBorder = view.findViewById(R.id.attack_border);
+
+ mLeftBorder.setOnClickListener(new ConfigClickListener(R.id.key_left));
+ mRightBorder.setOnClickListener(new ConfigClickListener(R.id.key_right));
+ mJumpBorder.setOnClickListener(new ConfigClickListener(R.id.key_jump));
+ mAttackBorder.setOnClickListener(new ConfigClickListener(R.id.key_attack));
+
+ mUnselectedBorder = mContext.getResources().getDrawable(R.drawable.key_config_border);
+ mSelectedBorder = mContext.getResources().getDrawable(R.drawable.key_config_border_active);
+ }
+
+ mListeningId = 0;
+
+
+ }
+
+ @Override
+ protected void showDialog(Bundle state) {
+ super.showDialog(state);
+ getDialog().setOnKeyListener(this);
+ getDialog().takeKeyEvents(true);
+ }
+
+ protected String getKeyLabel(int keycode) {
+ String result = "Unknown Key";
+ if (mKeyLabels == null) {
+ mKeyLabels = mContext.getResources().getStringArray(R.array.keycode_labels);
+ }
+
+ if (keycode > 0 && keycode < mKeyLabels.length) {
+ result = mKeyLabels[keycode - 1];
+ }
+ return result;
+ }
+
+ public void selectId(int id) {
+ if (mListeningId != 0) {
+ // unselect the current box
+ View border = getConfigViewById(mListeningId);
+ border.setBackgroundDrawable(mUnselectedBorder);
+ }
+
+ if (id == mListeningId || id == 0) {
+ mListeningId = 0; // toggle off and end.
+ } else {
+ // select the new box
+ View border = getConfigViewById(id);
+ border.setBackgroundDrawable(mSelectedBorder);
+ mListeningId = id;
+ }
+ }
+
+ private View getConfigViewById(int id) {
+ View config = null;
+ switch(id) {
+ case R.id.key_left:
+ config = mLeftBorder;
+ break;
+ case R.id.key_right:
+ config = mRightBorder;
+ break;
+ case R.id.key_jump:
+ config = mJumpBorder;
+ break;
+ case R.id.key_attack:
+ config = mAttackBorder;
+ break;
+ }
+
+ return config;
+ }
+
+ @Override
+ protected void onDialogClosed(boolean positiveResult) {
+ super.onDialogClosed(positiveResult);
+
+ if (positiveResult) {
+ // save changes
+ SharedPreferences.Editor editor = mSharedPrefs.edit();
+ editor.putInt(mLeftPrefKey, mLeftKeyCode);
+ editor.putInt(mRightPrefKey, mRightKeyCode);
+ editor.putInt(mJumpPrefKey, mJumpKeyCode);
+ editor.putInt(mAttackPrefKey, mAttackKeyCode);
+ editor.commit();
+ }
+ }
+
+ public void setPrefs(SharedPreferences sharedPreferences) {
+ mSharedPrefs = sharedPreferences;
+ }
+
+ public void setContext(Context context) {
+ mContext = context;
+ }
+
+ public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
+ boolean eatKey = false;
+ if (mListeningId != 0) {
+ eatKey = true;
+ switch (mListeningId) {
+ case R.id.key_left:
+ mLeftText.setText(getKeyLabel(keyCode));
+ mLeftKeyCode = keyCode;
+ break;
+ case R.id.key_right:
+ mRightText.setText(getKeyLabel(keyCode));
+ mRightKeyCode = keyCode;
+ break;
+ case R.id.key_jump:
+ mJumpText.setText(getKeyLabel(keyCode));
+ mJumpKeyCode = keyCode;
+ break;
+ case R.id.key_attack:
+ mAttackText.setText(getKeyLabel(keyCode));
+ mAttackKeyCode = keyCode;
+ break;
+ }
+
+ selectId(0); // deselect the current config box;
+ }
+ return eatKey;
+ }
+
+}
diff --git a/src/com/replica/replicaisland/LaunchProjectileComponent.java b/src/com/replica/replicaisland/LaunchProjectileComponent.java
index ac8de8e..5ea17aa 100644
--- a/src/com/replica/replicaisland/LaunchProjectileComponent.java
+++ b/src/com/replica/replicaisland/LaunchProjectileComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/LauncherComponent.java b/src/com/replica/replicaisland/LauncherComponent.java
index 79497ec..640d4e7 100644
--- a/src/com/replica/replicaisland/LauncherComponent.java
+++ b/src/com/replica/replicaisland/LauncherComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/Lerp.java b/src/com/replica/replicaisland/Lerp.java
index c6f1ae4..4bf9504 100644
--- a/src/com/replica/replicaisland/Lerp.java
+++ b/src/com/replica/replicaisland/Lerp.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-
package com.replica.replicaisland;
public final class Lerp {
diff --git a/src/com/replica/replicaisland/LevelBuilder.java b/src/com/replica/replicaisland/LevelBuilder.java
index 08f2248..33752fc 100644
--- a/src/com/replica/replicaisland/LevelBuilder.java
+++ b/src/com/replica/replicaisland/LevelBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/LevelSelectActivity.java b/src/com/replica/replicaisland/LevelSelectActivity.java
index ba0c76a..72243e6 100644
--- a/src/com/replica/replicaisland/LevelSelectActivity.java
+++ b/src/com/replica/replicaisland/LevelSelectActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/LevelSystem.java b/src/com/replica/replicaisland/LevelSystem.java
index d3be014..3b76ecd 100644
--- a/src/com/replica/replicaisland/LevelSystem.java
+++ b/src/com/replica/replicaisland/LevelSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/LevelTree.java b/src/com/replica/replicaisland/LevelTree.java
index 00df0d7..72844a8 100644
--- a/src/com/replica/replicaisland/LevelTree.java
+++ b/src/com/replica/replicaisland/LevelTree.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/LifetimeComponent.java b/src/com/replica/replicaisland/LifetimeComponent.java
index 72f9aa0..09532e3 100644
--- a/src/com/replica/replicaisland/LifetimeComponent.java
+++ b/src/com/replica/replicaisland/LifetimeComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/MainLoop.java b/src/com/replica/replicaisland/MainLoop.java
index ad31b5c..4417e9b 100644
--- a/src/com/replica/replicaisland/MainLoop.java
+++ b/src/com/replica/replicaisland/MainLoop.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/MainMenuActivity.java b/src/com/replica/replicaisland/MainMenuActivity.java
index 6ef6289..d7ed560 100644
--- a/src/com/replica/replicaisland/MainMenuActivity.java
+++ b/src/com/replica/replicaisland/MainMenuActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -34,9 +34,11 @@ public class MainMenuActivity extends Activity {
private View mStartButton;
private View mOptionsButton;
private View mBackground;
+ private View mTicker;
private Animation mButtonFlickerAnimation;
private Animation mFadeOutAnimation;
private Animation mAlternateFadeOutAnimation;
+ private Animation mFadeInAnimation;
private final static int WHATS_NEW_DIALOG = 0;
@@ -50,6 +52,7 @@ public class MainMenuActivity extends Activity {
mFadeOutAnimation.setAnimationListener(new StartActivityAfterAnimation(i));
mBackground.startAnimation(mFadeOutAnimation);
mOptionsButton.startAnimation(mAlternateFadeOutAnimation);
+ mTicker.startAnimation(mAlternateFadeOutAnimation);
mPaused = true;
}
}
@@ -64,6 +67,7 @@ public class MainMenuActivity extends Activity {
mFadeOutAnimation.setAnimationListener(new StartActivityAfterAnimation(i));
mBackground.startAnimation(mFadeOutAnimation);
mStartButton.startAnimation(mAlternateFadeOutAnimation);
+ mTicker.startAnimation(mAlternateFadeOutAnimation);
mPaused = true;
}
}
@@ -91,12 +95,20 @@ public class MainMenuActivity extends Activity {
mButtonFlickerAnimation = AnimationUtils.loadAnimation(this, R.anim.button_flicker);
mFadeOutAnimation = AnimationUtils.loadAnimation(this, R.anim.fade_out);
mAlternateFadeOutAnimation = AnimationUtils.loadAnimation(this, R.anim.fade_out);
+ mFadeInAnimation = AnimationUtils.loadAnimation(this, R.anim.fade_in);
if (!LevelTree.isLoaded()) {
LevelTree.loadLevelTree(R.xml.level_tree, this);
LevelTree.loadAllDialog(this);
}
+ mTicker = findViewById(R.id.ticker);
+ if (mTicker != null) {
+ mTicker.setFocusable(true);
+ mTicker.requestFocus();
+ mTicker.setSelected(true);
+ }
+
// Keep the volume control type consistent across all activities.
setVolumeControlStream(AudioManager.STREAM_MUSIC);
@@ -179,6 +191,11 @@ public class MainMenuActivity extends Activity {
mBackground.clearAnimation();
}
+ if (mTicker != null) {
+ mTicker.clearAnimation();
+ mTicker.setAnimation(mFadeInAnimation);
+ }
+
}
diff --git a/src/com/replica/replicaisland/MotionBlurComponent.java b/src/com/replica/replicaisland/MotionBlurComponent.java
index 556002b..878fffc 100644
--- a/src/com/replica/replicaisland/MotionBlurComponent.java
+++ b/src/com/replica/replicaisland/MotionBlurComponent.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
package com.replica.replicaisland;
public class MotionBlurComponent extends GameComponent {
diff --git a/src/com/replica/replicaisland/MovementComponent.java b/src/com/replica/replicaisland/MovementComponent.java
index 11fecac..6dcd09f 100644
--- a/src/com/replica/replicaisland/MovementComponent.java
+++ b/src/com/replica/replicaisland/MovementComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/NPCAnimationComponent.java b/src/com/replica/replicaisland/NPCAnimationComponent.java
index 3ee1e46..f1fa369 100644
--- a/src/com/replica/replicaisland/NPCAnimationComponent.java
+++ b/src/com/replica/replicaisland/NPCAnimationComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/NPCComponent.java b/src/com/replica/replicaisland/NPCComponent.java
index b5a9592..e660e1e 100644
--- a/src/com/replica/replicaisland/NPCComponent.java
+++ b/src/com/replica/replicaisland/NPCComponent.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
package com.replica.replicaisland;
import com.replica.replicaisland.CollisionParameters.HitType;
diff --git a/src/com/replica/replicaisland/ObjectManager.java b/src/com/replica/replicaisland/ObjectManager.java
index de6dc28..957ae86 100644
--- a/src/com/replica/replicaisland/ObjectManager.java
+++ b/src/com/replica/replicaisland/ObjectManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/ObjectPool.java b/src/com/replica/replicaisland/ObjectPool.java
index 6a33b47..f4a0176 100644
--- a/src/com/replica/replicaisland/ObjectPool.java
+++ b/src/com/replica/replicaisland/ObjectPool.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package com.replica.replicaisland;
/**
diff --git a/src/com/replica/replicaisland/ObjectRegistry.java b/src/com/replica/replicaisland/ObjectRegistry.java
index 9758625..cc14803 100644
--- a/src/com/replica/replicaisland/ObjectRegistry.java
+++ b/src/com/replica/replicaisland/ObjectRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/OpenGLSystem.java b/src/com/replica/replicaisland/OpenGLSystem.java
index b69cb74..632c7ba 100644
--- a/src/com/replica/replicaisland/OpenGLSystem.java
+++ b/src/com/replica/replicaisland/OpenGLSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/OrbitalMagnetComponent.java b/src/com/replica/replicaisland/OrbitalMagnetComponent.java
index 7f26468..52b9336 100644
--- a/src/com/replica/replicaisland/OrbitalMagnetComponent.java
+++ b/src/com/replica/replicaisland/OrbitalMagnetComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/PatrolComponent.java b/src/com/replica/replicaisland/PatrolComponent.java
index 3b32cff..adbb642 100644
--- a/src/com/replica/replicaisland/PatrolComponent.java
+++ b/src/com/replica/replicaisland/PatrolComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/PhasedObject.java b/src/com/replica/replicaisland/PhasedObject.java
index 87e0201..f7611ad 100644
--- a/src/com/replica/replicaisland/PhasedObject.java
+++ b/src/com/replica/replicaisland/PhasedObject.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/PhasedObjectManager.java b/src/com/replica/replicaisland/PhasedObjectManager.java
index db04733..a20ed34 100644
--- a/src/com/replica/replicaisland/PhasedObjectManager.java
+++ b/src/com/replica/replicaisland/PhasedObjectManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -13,7 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
+
package com.replica.replicaisland;
import java.util.Comparator;
diff --git a/src/com/replica/replicaisland/PhysicsComponent.java b/src/com/replica/replicaisland/PhysicsComponent.java
index 3d6716c..958283a 100644
--- a/src/com/replica/replicaisland/PhysicsComponent.java
+++ b/src/com/replica/replicaisland/PhysicsComponent.java
@@ -1,6 +1,5 @@
-
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/PlaySingleSoundComponent.java b/src/com/replica/replicaisland/PlaySingleSoundComponent.java
index ab0f52d..99e85e5 100644
--- a/src/com/replica/replicaisland/PlaySingleSoundComponent.java
+++ b/src/com/replica/replicaisland/PlaySingleSoundComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/PlayerComponent.java b/src/com/replica/replicaisland/PlayerComponent.java
index dc31181..e43b13d 100644
--- a/src/com/replica/replicaisland/PlayerComponent.java
+++ b/src/com/replica/replicaisland/PlayerComponent.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
package com.replica.replicaisland;
import com.replica.replicaisland.CollisionParameters.HitType;
diff --git a/src/com/replica/replicaisland/PopOutComponent.java b/src/com/replica/replicaisland/PopOutComponent.java
index e3d0ed4..2f5fda1 100644
--- a/src/com/replica/replicaisland/PopOutComponent.java
+++ b/src/com/replica/replicaisland/PopOutComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/QuickSorter.java b/src/com/replica/replicaisland/QuickSorter.java
index 7c753a0..2a40eba 100644
--- a/src/com/replica/replicaisland/QuickSorter.java
+++ b/src/com/replica/replicaisland/QuickSorter.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
package com.replica.replicaisland;
import java.util.Comparator;
diff --git a/src/com/replica/replicaisland/RenderComponent.java b/src/com/replica/replicaisland/RenderComponent.java
index 9f09bad..ed1d722 100644
--- a/src/com/replica/replicaisland/RenderComponent.java
+++ b/src/com/replica/replicaisland/RenderComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/RenderSystem.java b/src/com/replica/replicaisland/RenderSystem.java
index 114dce8..349d53d 100644
--- a/src/com/replica/replicaisland/RenderSystem.java
+++ b/src/com/replica/replicaisland/RenderSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/ScrollableBitmap.java b/src/com/replica/replicaisland/ScrollableBitmap.java
index 1340b0e..37da470 100644
--- a/src/com/replica/replicaisland/ScrollableBitmap.java
+++ b/src/com/replica/replicaisland/ScrollableBitmap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/ScrollerComponent.java b/src/com/replica/replicaisland/ScrollerComponent.java
index bc1460e..42dd05d 100644
--- a/src/com/replica/replicaisland/ScrollerComponent.java
+++ b/src/com/replica/replicaisland/ScrollerComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/SelectDialogComponent.java b/src/com/replica/replicaisland/SelectDialogComponent.java
index 1760359..ba360ca 100644
--- a/src/com/replica/replicaisland/SelectDialogComponent.java
+++ b/src/com/replica/replicaisland/SelectDialogComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/SetPreferencesActivity.java b/src/com/replica/replicaisland/SetPreferencesActivity.java
index f480fe0..6e9d2f6 100644
--- a/src/com/replica/replicaisland/SetPreferencesActivity.java
+++ b/src/com/replica/replicaisland/SetPreferencesActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -40,6 +40,13 @@ public class SetPreferencesActivity extends PreferenceActivity implements
YesNoDialogPreference yesNo = (YesNoDialogPreference)eraseGameButton;
yesNo.setListener(this);
}
+
+ Preference configureKeyboardPref = getPreferenceManager().findPreference("keyconfig");
+ if (configureKeyboardPref != null) {
+ KeyboardConfigDialogPreference config = (KeyboardConfigDialogPreference)configureKeyboardPref;
+ config.setPrefs(getSharedPreferences(AndouKun.PREFERENCE_NAME, MODE_PRIVATE));
+ config.setContext(this);
+ }
}
public void onDialogClosed(boolean positiveResult) {
diff --git a/src/com/replica/replicaisland/ShellSorter.java b/src/com/replica/replicaisland/ShellSorter.java
index ccd5416..c1f7255 100644
--- a/src/com/replica/replicaisland/ShellSorter.java
+++ b/src/com/replica/replicaisland/ShellSorter.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
package com.replica.replicaisland;
import java.util.Comparator;
diff --git a/src/com/replica/replicaisland/SimpleCollisionComponent.java b/src/com/replica/replicaisland/SimpleCollisionComponent.java
index da48e2b..9c43e52 100644
--- a/src/com/replica/replicaisland/SimpleCollisionComponent.java
+++ b/src/com/replica/replicaisland/SimpleCollisionComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/SimplePhysicsComponent.java b/src/com/replica/replicaisland/SimplePhysicsComponent.java
index 79b85bd..8ecd46a 100644
--- a/src/com/replica/replicaisland/SimplePhysicsComponent.java
+++ b/src/com/replica/replicaisland/SimplePhysicsComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/SleeperComponent.java b/src/com/replica/replicaisland/SleeperComponent.java
index 2e672fa..e4852c6 100644
--- a/src/com/replica/replicaisland/SleeperComponent.java
+++ b/src/com/replica/replicaisland/SleeperComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/SliderPreference.java b/src/com/replica/replicaisland/SliderPreference.java
new file mode 100644
index 0000000..1b02ca5
--- /dev/null
+++ b/src/com/replica/replicaisland/SliderPreference.java
@@ -0,0 +1,126 @@
+/*
+ * 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.
+ */
+
+package com.replica.replicaisland;
+
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.SeekBar;
+import android.widget.TextView;
+import android.widget.SeekBar.OnSeekBarChangeListener;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.preference.Preference;
+
+public class SliderPreference extends Preference implements OnSeekBarChangeListener {
+ private final static int MAX_SLIDER_VALUE = 100;
+ private final static int INITIAL_VALUE = 50;
+
+ private int mValue = INITIAL_VALUE;
+ private String mMinText;
+ private String mMaxText;
+
+
+ public SliderPreference(Context context) {
+ super(context);
+ }
+
+ public SliderPreference(Context context, AttributeSet attrs) {
+ this(context, attrs, android.R.attr.preferenceStyle);
+ }
+
+ public SliderPreference(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+
+ TypedArray a = context.obtainStyledAttributes(attrs,
+ R.styleable.SliderPreference, defStyle, 0);
+ mMinText = a.getString(R.styleable.SliderPreference_minText);
+ mMaxText = a.getString(R.styleable.SliderPreference_maxText);
+
+ a.recycle();
+ }
+
+ @Override
+ protected View onCreateView(ViewGroup parent){
+ View shell = super.onCreateView(parent);
+
+ ViewGroup widget = (ViewGroup)shell.findViewById(android.R.id.widget_frame);
+
+ View root = LayoutInflater.from(getContext()).inflate(
+ R.layout.slider_preference, widget, true);
+
+ if (mMinText != null) {
+ TextView minText = (TextView)root.findViewById(R.id.min);
+ minText.setText(mMinText);
+ }
+
+ if (mMaxText != null) {
+ TextView minText = (TextView)root.findViewById(R.id.max);
+ minText.setText(mMaxText);
+ }
+
+ SeekBar bar = (SeekBar)root.findViewById(R.id.slider);
+ bar.setMax(MAX_SLIDER_VALUE);
+ bar.setProgress(mValue);
+ bar.setOnSeekBarChangeListener(this);
+
+ return shell;
+ }
+
+ public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {
+
+ if(!callChangeListener(progress)){
+ seekBar.setProgress(mValue);
+ return;
+ }
+
+ seekBar.setProgress(progress);
+ mValue = progress;
+ persistInt(mValue);
+
+ notifyChanged();
+ }
+
+ public void onStartTrackingTouch(SeekBar seekBar) {
+ }
+
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ }
+
+
+ @Override
+ protected Object onGetDefaultValue(TypedArray ta,int index){
+ int dValue = (int)ta.getInt(index, INITIAL_VALUE);
+
+ return (int)Utils.clamp(dValue, 0, MAX_SLIDER_VALUE);
+ }
+
+
+ @Override
+ protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
+ mValue = defaultValue != null ? (Integer)defaultValue : INITIAL_VALUE;
+
+ if (!restoreValue) {
+ persistInt(mValue);
+ } else {
+ mValue = getPersistedInt(mValue);
+ }
+ }
+
+
+} \ No newline at end of file
diff --git a/src/com/replica/replicaisland/SolidSurfaceComponent.java b/src/com/replica/replicaisland/SolidSurfaceComponent.java
index 65654b9..fb71f10 100644
--- a/src/com/replica/replicaisland/SolidSurfaceComponent.java
+++ b/src/com/replica/replicaisland/SolidSurfaceComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/SortConstants.java b/src/com/replica/replicaisland/SortConstants.java
index 85d8773..4fd6f26 100644
--- a/src/com/replica/replicaisland/SortConstants.java
+++ b/src/com/replica/replicaisland/SortConstants.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
package com.replica.replicaisland;
public class SortConstants {
diff --git a/src/com/replica/replicaisland/Sorter.java b/src/com/replica/replicaisland/Sorter.java
index ab2c605..8f9a9a3 100644
--- a/src/com/replica/replicaisland/Sorter.java
+++ b/src/com/replica/replicaisland/Sorter.java
@@ -1,4 +1,20 @@
-package com.replica.replicaisland;
+/*
+ * 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.
+ */
+
+ package com.replica.replicaisland;
import java.util.Comparator;
diff --git a/src/com/replica/replicaisland/SoundSystem.java b/src/com/replica/replicaisland/SoundSystem.java
index 99888ce..84c2226 100644
--- a/src/com/replica/replicaisland/SoundSystem.java
+++ b/src/com/replica/replicaisland/SoundSystem.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
package com.replica.replicaisland;
import java.util.Comparator;
diff --git a/src/com/replica/replicaisland/SphereCollisionVolume.java b/src/com/replica/replicaisland/SphereCollisionVolume.java
index 016dcfc..184536c 100644
--- a/src/com/replica/replicaisland/SphereCollisionVolume.java
+++ b/src/com/replica/replicaisland/SphereCollisionVolume.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/SpriteAnimation.java b/src/com/replica/replicaisland/SpriteAnimation.java
index db47ff4..4f5c018 100644
--- a/src/com/replica/replicaisland/SpriteAnimation.java
+++ b/src/com/replica/replicaisland/SpriteAnimation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/SpriteComponent.java b/src/com/replica/replicaisland/SpriteComponent.java
index 8fef472..5a96cc8 100644
--- a/src/com/replica/replicaisland/SpriteComponent.java
+++ b/src/com/replica/replicaisland/SpriteComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/StandardSorter.java b/src/com/replica/replicaisland/StandardSorter.java
index 09e9998..dd3d700 100644
--- a/src/com/replica/replicaisland/StandardSorter.java
+++ b/src/com/replica/replicaisland/StandardSorter.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
package com.replica.replicaisland;
import java.util.Arrays;
diff --git a/src/com/replica/replicaisland/TObjectPool.java b/src/com/replica/replicaisland/TObjectPool.java
index 9970735..5558fb9 100644
--- a/src/com/replica/replicaisland/TObjectPool.java
+++ b/src/com/replica/replicaisland/TObjectPool.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/Texture.java b/src/com/replica/replicaisland/Texture.java
index 5bfc65b..bc92aa9 100644
--- a/src/com/replica/replicaisland/Texture.java
+++ b/src/com/replica/replicaisland/Texture.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/TextureLibrary.java b/src/com/replica/replicaisland/TextureLibrary.java
index b21804d..e025443 100644
--- a/src/com/replica/replicaisland/TextureLibrary.java
+++ b/src/com/replica/replicaisland/TextureLibrary.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/TheSourceComponent.java b/src/com/replica/replicaisland/TheSourceComponent.java
index f3b365b..a3a2feb 100644
--- a/src/com/replica/replicaisland/TheSourceComponent.java
+++ b/src/com/replica/replicaisland/TheSourceComponent.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
package com.replica.replicaisland;
import com.replica.replicaisland.GameObject.ActionType;
diff --git a/src/com/replica/replicaisland/TiledBackgroundVertexGrid.java b/src/com/replica/replicaisland/TiledBackgroundVertexGrid.java
index fdcf506..de16f18 100644
--- a/src/com/replica/replicaisland/TiledBackgroundVertexGrid.java
+++ b/src/com/replica/replicaisland/TiledBackgroundVertexGrid.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/TiledVertexGrid.java b/src/com/replica/replicaisland/TiledVertexGrid.java
index 7d48003..5d6af48 100644
--- a/src/com/replica/replicaisland/TiledVertexGrid.java
+++ b/src/com/replica/replicaisland/TiledVertexGrid.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
package com.replica.replicaisland;
import javax.microedition.khronos.opengles.GL10;
diff --git a/src/com/replica/replicaisland/TiledWorld.java b/src/com/replica/replicaisland/TiledWorld.java
index 215d0b0..73c8d6b 100644
--- a/src/com/replica/replicaisland/TiledWorld.java
+++ b/src/com/replica/replicaisland/TiledWorld.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/TimeSystem.java b/src/com/replica/replicaisland/TimeSystem.java
index c4306b8..c610cb3 100644
--- a/src/com/replica/replicaisland/TimeSystem.java
+++ b/src/com/replica/replicaisland/TimeSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/Utils.java b/src/com/replica/replicaisland/Utils.java
index a84e6d4..97b62d1 100644
--- a/src/com/replica/replicaisland/Utils.java
+++ b/src/com/replica/replicaisland/Utils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/Vector2.java b/src/com/replica/replicaisland/Vector2.java
index c3f7958..7bc09e4 100644
--- a/src/com/replica/replicaisland/Vector2.java
+++ b/src/com/replica/replicaisland/Vector2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/VectorPool.java b/src/com/replica/replicaisland/VectorPool.java
index 9d0db3b..6873432 100644
--- a/src/com/replica/replicaisland/VectorPool.java
+++ b/src/com/replica/replicaisland/VectorPool.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
diff --git a/src/com/replica/replicaisland/VibrationSystem.java b/src/com/replica/replicaisland/VibrationSystem.java
index 5a80117..124b8e8 100644
--- a/src/com/replica/replicaisland/VibrationSystem.java
+++ b/src/com/replica/replicaisland/VibrationSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package com.replica.replicaisland;
import android.os.Vibrator;
diff --git a/src/com/replica/replicaisland/YesNoDialogPreference.java b/src/com/replica/replicaisland/YesNoDialogPreference.java
index c65170e..1ed7e54 100644
--- a/src/com/replica/replicaisland/YesNoDialogPreference.java
+++ b/src/com/replica/replicaisland/YesNoDialogPreference.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
package com.replica.replicaisland;
import android.content.Context;