first blood
8
.classpath
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry excluding=".svn/" kind="src" path="src"/>
|
||||||
|
<classpathentry excluding=".svn/" kind="src" path="gen"/>
|
||||||
|
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||||
|
<classpathentry kind="lib" path="C:/Workplace/Projects/Android/EngineWrapper/jar/EngineWrapper.jar"/>
|
||||||
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
</classpath>
|
33
.project
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>EngineWrapper</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
39
AndroidManifest.xml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
**
|
||||||
|
** Copyright 2009, 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.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:versionCode="1" android:versionName="1.0.0" package="fishrungames.crystalofrhylil">
|
||||||
|
<application
|
||||||
|
android:icon="@drawable/ic_menu_template" android:label="Crystal of Rhylil" android:debuggable="true">
|
||||||
|
<activity android:name="MainActivity"
|
||||||
|
android:screenOrientation="landscape"
|
||||||
|
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:noHistory="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
</application>
|
||||||
|
<uses-feature android:glEsVersion="0x00020000"/>
|
||||||
|
<uses-sdk android:minSdkVersion="8"/>
|
||||||
|
</manifest>
|
8
Readme.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Шаблон для приложения Android
|
||||||
|
Как установить:
|
||||||
|
1) Кинуть все содержимое в каталог Android/ВашеПриложение/
|
||||||
|
2) Придумать название приложению и название для package, вписать их в AndroidManifest.xml, в JniWrapper.java, MainActivity.java, правильно расположить java-файлы.
|
||||||
|
3) Придумать и ввести название своей Jni-библиотеки игры в Android.mk (LOCAL_MODULE : = MyAppLib), это же название библиотеки вбить в JniWrapper.java.
|
||||||
|
4) переименовать jni-методы в android_api.h/cpp в соответствии с названиями package.
|
||||||
|
5) Не забыть про иконки
|
||||||
|
6) Написать скрипт сборки и можно запускать!
|
BIN
assets/anim_tex.bmp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/button_normal.bmp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/button_pressed.bmp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/cave_hd.png
Normal file
After Width: | Height: | Size: 366 KiB |
BIN
assets/chips/chip1.png
Normal file
After Width: | Height: | Size: 60 KiB |
10
assets/chips/chip1.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<Animation>
|
||||||
|
<Frames>
|
||||||
|
<Frame><TexCoordFrom x='0' y='0.671875'/><TexCoordTo x='0.242188' y='1'/><TimePassed>83</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.242188' y='0.671875'/><TexCoordTo x='0.484375' y='1'/><TimePassed>166</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.484375' y='0.671875'/><TexCoordTo x='0.726562' y='1'/><TimePassed>250</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.726562' y='0.671875'/><TexCoordTo x='0.96875' y='1'/><TimePassed>333</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0' y='0.34375'/><TexCoordTo x='0.242188' y='0.671875'/><TimePassed>416</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.242188' y='0.34375'/><TexCoordTo x='0.484375' y='0.671875'/><TimePassed>500</TimePassed></Frame>
|
||||||
|
</Frames>
|
||||||
|
</Animation>
|
BIN
assets/chips/chip1_nmap.png
Normal file
After Width: | Height: | Size: 87 KiB |
BIN
assets/chips/chip1finish.bmp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/chips/chip1locked.bmp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/chips/chip2.png
Normal file
After Width: | Height: | Size: 94 KiB |
16
assets/chips/chip2.xml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<Animation>
|
||||||
|
<Frames>
|
||||||
|
<Frame><TexCoordFrom x='0' y='0.671875'/><TexCoordTo x='0.164062' y='1'/><TimePassed>83</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.164062' y='0.671875'/><TexCoordTo x='0.328125' y='1'/><TimePassed>166</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.328125' y='0.671875'/><TexCoordTo x='0.492188' y='1'/><TimePassed>250</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.492188' y='0.671875'/><TexCoordTo x='0.65625' y='1'/><TimePassed>333</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.65625' y='0.671875'/><TexCoordTo x='0.820312' y='1'/><TimePassed>416</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.820312' y='0.671875'/><TexCoordTo x='0.984375' y='1'/><TimePassed>500</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0' y='0.34375'/><TexCoordTo x='0.164062' y='0.671875'/><TimePassed>583</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.164062' y='0.34375'/><TexCoordTo x='0.328125' y='0.671875'/><TimePassed>666</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.328125' y='0.34375'/><TexCoordTo x='0.492188' y='0.671875'/><TimePassed>750</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.492188' y='0.34375'/><TexCoordTo x='0.65625' y='0.671875'/><TimePassed>833</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.65625' y='0.34375'/><TexCoordTo x='0.820312' y='0.671875'/><TimePassed>916</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.820312' y='0.34375'/><TexCoordTo x='0.984375' y='0.671875'/><TimePassed>1000</TimePassed></Frame>
|
||||||
|
</Frames>
|
||||||
|
</Animation>
|
BIN
assets/chips/chip2_nmap.png
Normal file
After Width: | Height: | Size: 229 KiB |
BIN
assets/chips/chip2finish.bmp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/chips/chip2locked.bmp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/chips/chip3.png
Normal file
After Width: | Height: | Size: 96 KiB |
16
assets/chips/chip3.xml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<Animation>
|
||||||
|
<Frames>
|
||||||
|
<Frame><TexCoordFrom x='0' y='0.671875'/><TexCoordTo x='0.171875' y='1'/><TimePassed>83</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.171875' y='0.671875'/><TexCoordTo x='0.34375' y='1'/><TimePassed>166</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.34375' y='0.671875'/><TexCoordTo x='0.515625' y='1'/><TimePassed>250</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.515625' y='0.671875'/><TexCoordTo x='0.6875' y='1'/><TimePassed>333</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.6875' y='0.671875'/><TexCoordTo x='0.859375' y='1'/><TimePassed>416</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0' y='0.34375'/><TexCoordTo x='0.171875' y='0.671875'/><TimePassed>500</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.171875' y='0.34375'/><TexCoordTo x='0.34375' y='0.671875'/><TimePassed>583</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.34375' y='0.34375'/><TexCoordTo x='0.515625' y='0.671875'/><TimePassed>666</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.515625' y='0.34375'/><TexCoordTo x='0.6875' y='0.671875'/><TimePassed>750</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.6875' y='0.34375'/><TexCoordTo x='0.859375' y='0.671875'/><TimePassed>833</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0' y='0.015625'/><TexCoordTo x='0.171875' y='0.34375'/><TimePassed>916</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.171875' y='0.015625'/><TexCoordTo x='0.34375' y='0.34375'/><TimePassed>1000</TimePassed></Frame>
|
||||||
|
</Frames>
|
||||||
|
</Animation>
|
BIN
assets/chips/chip3finish.bmp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/chips/chip3locked.bmp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/chips/chip4.bmp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/chips/chip4.png
Normal file
After Width: | Height: | Size: 101 KiB |
16
assets/chips/chip4.xml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<Animation>
|
||||||
|
<Frames>
|
||||||
|
<Frame><TexCoordFrom x='0' y='0.671875'/><TexCoordTo x='0.167969' y='1'/><TimePassed>83</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.167969' y='0.671875'/><TexCoordTo x='0.335938' y='1'/><TimePassed>166</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.335938' y='0.671875'/><TexCoordTo x='0.503906' y='1'/><TimePassed>250</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.503906' y='0.671875'/><TexCoordTo x='0.671875' y='1'/><TimePassed>333</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.671875' y='0.671875'/><TexCoordTo x='0.839844' y='1'/><TimePassed>416</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0' y='0.34375'/><TexCoordTo x='0.167969' y='0.671875'/><TimePassed>500</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.167969' y='0.34375'/><TexCoordTo x='0.335938' y='0.671875'/><TimePassed>583</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.335938' y='0.34375'/><TexCoordTo x='0.503906' y='0.671875'/><TimePassed>666</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.503906' y='0.34375'/><TexCoordTo x='0.671875' y='0.671875'/><TimePassed>750</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.671875' y='0.34375'/><TexCoordTo x='0.839844' y='0.671875'/><TimePassed>833</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0' y='0.015625'/><TexCoordTo x='0.167969' y='0.34375'/><TimePassed>916</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.167969' y='0.015625'/><TexCoordTo x='0.335938' y='0.34375'/><TimePassed>1000</TimePassed></Frame>
|
||||||
|
</Frames>
|
||||||
|
</Animation>
|
BIN
assets/chips/chip4finish.bmp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/chips/chip4locked.bmp
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
assets/console_bkg.bmp
Normal file
After Width: | Height: | Size: 102 B |
5
assets/fonts.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<Font>
|
||||||
|
<FontName>droid_sans14</FontName>
|
||||||
|
<BitmapFileName>fonts/droid_sans14_font_bitmap.bmp32</BitmapFileName>
|
||||||
|
<CharmapFileName>fonts/droid_sans14_font_charmap.txt</CharmapFileName>
|
||||||
|
</Font>
|
BIN
assets/fonts/droid_sans14_font_bitmap.bmp32
Normal file
After Width: | Height: | Size: 512 KiB |
95
assets/fonts/droid_sans14_font_charmap.txt
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
32 0.00976562 0.0195312 0 0.0546875 0 0 0.0078125
|
||||||
|
49 0.0195312 0.0195312 0.00390625 0.015625 0.0078125 0.0390625 0.015625
|
||||||
|
50 0.0371094 0.0195312 0.00195312 0.015625 0.0136719 0.0390625 0.015625
|
||||||
|
51 0.0605469 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625
|
||||||
|
52 0.0820312 0.0195312 0.00195312 0.015625 0.0136719 0.0390625 0.015625
|
||||||
|
53 0.105469 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625
|
||||||
|
54 0.126953 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625
|
||||||
|
55 0.148438 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625
|
||||||
|
56 0.169922 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625
|
||||||
|
57 0.191406 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625
|
||||||
|
48 0.212891 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.015625
|
||||||
|
97 0.234375 0.0195312 0.00195312 0.0234375 0.00976562 0.03125 0.0136719
|
||||||
|
98 0.253906 0.0195312 0.00195312 0.0117188 0.0117188 0.0429688 0.015625
|
||||||
|
99 0.275391 0.0195312 0.00195312 0.0234375 0.00976562 0.03125 0.0136719
|
||||||
|
100 0.294922 0.0195312 0.00195312 0.0117188 0.0117188 0.0429688 0.015625
|
||||||
|
101 0.316406 0.0195312 0.00195312 0.0234375 0.0117188 0.03125 0.015625
|
||||||
|
102 0.337891 0.0195312 0 0.0117188 0.00976562 0.0429688 0.0078125
|
||||||
|
103 0.357422 0.0195312 0.00195312 0.0234375 0.0136719 0.0429688 0.0136719
|
||||||
|
104 0.380859 0.0195312 0.00195312 0.0117188 0.0117188 0.0429688 0.015625
|
||||||
|
105 0.402344 0.0195312 0 0.0117188 0.00585938 0.0429688 0.0078125
|
||||||
|
106 0.417969 0.0195312 -0.00195312 0.0117188 0.0078125 0.0546875 0.0078125
|
||||||
|
107 0.435547 0.0195312 0.00195312 0.0117188 0.0136719 0.0429688 0.0136719
|
||||||
|
108 0.458984 0.0195312 0.00195312 0.0117188 0.00390625 0.0429688 0.0078125
|
||||||
|
109 0.472656 0.0195312 0.00195312 0.0234375 0.0214844 0.03125 0.0253906
|
||||||
|
110 0.503906 0.0195312 0.00195312 0.0234375 0.0117188 0.03125 0.015625
|
||||||
|
111 0.525391 0.0195312 0.00195312 0.0234375 0.0117188 0.03125 0.015625
|
||||||
|
112 0.546875 0.0195312 0.00195312 0.0234375 0.0117188 0.0429688 0.015625
|
||||||
|
113 0.568359 0.0195312 0.00195312 0.0234375 0.0117188 0.0429688 0.015625
|
||||||
|
114 0.589844 0.0195312 0.00195312 0.0234375 0.0078125 0.03125 0.00976562
|
||||||
|
115 0.607422 0.0195312 0 0.0234375 0.0117188 0.03125 0.0136719
|
||||||
|
116 0.628906 0.0195312 0 0.015625 0.00976562 0.0390625 0.00976562
|
||||||
|
117 0.648438 0.0195312 0.00195312 0.0234375 0.0117188 0.03125 0.015625
|
||||||
|
118 0.669922 0.0195312 -0.00195312 0.0234375 0.0175781 0.03125 0.0136719
|
||||||
|
119 0.697266 0.0195312 -0.00195312 0.0234375 0.0234375 0.03125 0.0195312
|
||||||
|
120 0.730469 0.0195312 0 0.0234375 0.0136719 0.03125 0.0136719
|
||||||
|
121 0.753906 0.0195312 -0.00195312 0.0234375 0.0175781 0.0429688 0.0136719
|
||||||
|
122 0.78125 0.0195312 0.00195312 0.0234375 0.0117188 0.03125 0.0136719
|
||||||
|
65 0.802734 0.0195312 -0.00195312 0.015625 0.0214844 0.0390625 0.0175781
|
||||||
|
66 0.833984 0.0195312 0.00195312 0.015625 0.0136719 0.0390625 0.0175781
|
||||||
|
67 0.857422 0.0195312 0.00195312 0.015625 0.0136719 0.0390625 0.015625
|
||||||
|
68 0.880859 0.0195312 0.00195312 0.015625 0.015625 0.0390625 0.0195312
|
||||||
|
69 0.90625 0.0195312 0.00195312 0.015625 0.00976562 0.0390625 0.0136719
|
||||||
|
70 0.925781 0.0195312 0.00195312 0.015625 0.0117188 0.0390625 0.0136719
|
||||||
|
71 0.947266 0.0195312 0.00195312 0.015625 0.015625 0.0390625 0.0195312
|
||||||
|
72 0.00976562 0.09375 0.00195312 0.015625 0.015625 0.0390625 0.0195312
|
||||||
|
73 0.0351562 0.09375 0 0.015625 0.00976562 0.0390625 0.00976562
|
||||||
|
74 0.0546875 0.09375 -0.00390625 0.015625 0.00976562 0.0507812 0.00585938
|
||||||
|
75 0.0742188 0.09375 0.00195312 0.015625 0.015625 0.0390625 0.015625
|
||||||
|
76 0.0996094 0.09375 0.00195312 0.015625 0.0117188 0.0390625 0.0136719
|
||||||
|
77 0.121094 0.09375 0.00195312 0.015625 0.0195312 0.0390625 0.0234375
|
||||||
|
78 0.150391 0.09375 0.00195312 0.015625 0.015625 0.0390625 0.0195312
|
||||||
|
79 0.175781 0.09375 0.00195312 0.015625 0.0175781 0.0390625 0.0214844
|
||||||
|
80 0.203125 0.09375 0.00195312 0.015625 0.0117188 0.0390625 0.015625
|
||||||
|
81 0.224609 0.09375 0.00195312 0.015625 0.0175781 0.046875 0.0214844
|
||||||
|
82 0.251953 0.09375 0.00195312 0.015625 0.0136719 0.0390625 0.015625
|
||||||
|
83 0.275391 0.09375 0 0.015625 0.0136719 0.0390625 0.0136719
|
||||||
|
84 0.298828 0.09375 0 0.015625 0.0136719 0.0390625 0.0136719
|
||||||
|
85 0.322266 0.09375 0.00195312 0.015625 0.015625 0.0390625 0.0195312
|
||||||
|
86 0.347656 0.09375 -0.00195312 0.015625 0.0195312 0.0390625 0.015625
|
||||||
|
87 0.376953 0.09375 -0.00195312 0.015625 0.0292969 0.0390625 0.0253906
|
||||||
|
88 0.416016 0.09375 -0.00195312 0.015625 0.0195312 0.0390625 0.015625
|
||||||
|
89 0.445312 0.09375 -0.00195312 0.015625 0.0175781 0.0390625 0.0136719
|
||||||
|
90 0.472656 0.09375 0.00195312 0.015625 0.0117188 0.0390625 0.015625
|
||||||
|
46 0.494141 0.09375 0.00195312 0.046875 0.00390625 0.0078125 0.0078125
|
||||||
|
44 0.507812 0.09375 0.00195312 0.046875 0.00390625 0.0117188 0.0078125
|
||||||
|
58 0.521484 0.09375 0.00195312 0.0234375 0.00390625 0.03125 0.0078125
|
||||||
|
59 0.535156 0.09375 0.00195312 0.0234375 0.00390625 0.0351562 0.0078125
|
||||||
|
64 0.548828 0.09375 0.00195312 0.015625 0.0195312 0.0429688 0.0234375
|
||||||
|
35 0.578125 0.09375 0 0.015625 0.015625 0.0390625 0.0175781
|
||||||
|
36 0.603516 0.09375 0.00195312 0.0117188 0.0117188 0.046875 0.015625
|
||||||
|
37 0.625 0.09375 0.00195312 0.015625 0.0195312 0.0390625 0.0234375
|
||||||
|
94 0.654297 0.09375 0 0.015625 0.0136719 0.0234375 0.0136719
|
||||||
|
38 0.677734 0.09375 0.00195312 0.015625 0.0175781 0.0390625 0.0195312
|
||||||
|
42 0.705078 0.09375 0 0.0117188 0.0136719 0.0234375 0.015625
|
||||||
|
33 0.728516 0.09375 0.00195312 0.015625 0.00390625 0.0390625 0.0078125
|
||||||
|
63 0.742188 0.09375 0 0.015625 0.00976562 0.0390625 0.0117188
|
||||||
|
40 0.761719 0.09375 0.00195312 0.015625 0.0078125 0.046875 0.0078125
|
||||||
|
41 0.779297 0.09375 0 0.015625 0.00585938 0.046875 0.0078125
|
||||||
|
91 0.794922 0.09375 0.00195312 0.015625 0.00585938 0.046875 0.0078125
|
||||||
|
93 0.810547 0.09375 0 0.015625 0.00585938 0.046875 0.0078125
|
||||||
|
123 0.826172 0.09375 0 0.015625 0.00976562 0.046875 0.00976562
|
||||||
|
125 0.845703 0.09375 0 0.015625 0.00976562 0.046875 0.00976562
|
||||||
|
60 0.865234 0.09375 0.00195312 0.0234375 0.0117188 0.0273438 0.015625
|
||||||
|
62 0.886719 0.09375 0.00195312 0.0234375 0.0117188 0.0273438 0.015625
|
||||||
|
95 0.908203 0.09375 0 0.0585938 0.0117188 0.00390625 0.0117188
|
||||||
|
45 0.929688 0.09375 0.00195312 0.0390625 0.00585938 0.0078125 0.00976562
|
||||||
|
43 0.945312 0.09375 0 0.0234375 0.0136719 0.0273438 0.015625
|
||||||
|
61 0.00976562 0.167969 0 0.0273438 0.0136719 0.0195312 0.015625
|
||||||
|
124 0.0332031 0.167969 0.00585938 0.0117188 0.00390625 0.0546875 0.0136719
|
||||||
|
92 0.046875 0.167969 -0.00195312 0.015625 0.0136719 0.0390625 0.00976562
|
||||||
|
47 0.0703125 0.167969 -0.00195312 0.015625 0.0136719 0.0390625 0.00976562
|
||||||
|
126 0.09375 0.167969 0.00195312 0.03125 0.0117188 0.0117188 0.015625
|
||||||
|
96 0.115234 0.167969 0.00585938 0.0117188 0.00585938 0.0078125 0.015625
|
||||||
|
34 0.130859 0.167969 0.00195312 0.015625 0.00976562 0.015625 0.0117188
|
||||||
|
39 0.150391 0.167969 0.00195312 0.015625 0.00390625 0.015625 0.00585938
|
44
assets/function_info_list.xml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<FunctionInfoList>
|
||||||
|
<Function>
|
||||||
|
<ShortName>p</ShortName>
|
||||||
|
<LongName>Print</LongName>
|
||||||
|
<ShortDescription>Print out string to console</ShortDescription>
|
||||||
|
<Description>This command prints out string to console. Example: p("Hello world");</Description>
|
||||||
|
</Function>
|
||||||
|
<Function>
|
||||||
|
<ShortName>help</ShortName>
|
||||||
|
<LongName>Help</LongName>
|
||||||
|
<ShortDescription>Print out all available functions to console</ShortDescription>
|
||||||
|
<Description>This command prints out all available functions to console with short description. Example: help();</Description>
|
||||||
|
</Function>
|
||||||
|
<Function>
|
||||||
|
<ShortName>man</ShortName>
|
||||||
|
<LongName>Manual</LongName>
|
||||||
|
<ShortDescription>Print out information about function</ShortDescription>
|
||||||
|
<Description>This command prints out all information about asked function. Example: man("p");</Description>
|
||||||
|
</Function>
|
||||||
|
<Function>
|
||||||
|
<ShortName>ptl</ShortName>
|
||||||
|
<LongName>PrintTextureList</LongName>
|
||||||
|
<ShortDescription>Print out list of all textures loaded</ShortDescription>
|
||||||
|
<Description>This command prints out list of textures that is loaded at this time with their ref count. Example: ptl();</Description>
|
||||||
|
</Function>
|
||||||
|
<Function>
|
||||||
|
<ShortName>pal</ShortName>
|
||||||
|
<LongName>PrintAnimationList</LongName>
|
||||||
|
<ShortDescription>Print out list of all animations loaded</ShortDescription>
|
||||||
|
<Description>This command prints out list of animations that is loaded at this time. Example: pal();</Description>
|
||||||
|
</Function>
|
||||||
|
<Function>
|
||||||
|
<ShortName>pwl</ShortName>
|
||||||
|
<LongName>PrintWidgetList</LongName>
|
||||||
|
<ShortDescription>Print out list of widgets registered in system</ShortDescription>
|
||||||
|
<Description>This command prints out list of widgets that is available at this time. Example: pwl();</Description>
|
||||||
|
</Function>
|
||||||
|
<Function>
|
||||||
|
<ShortName>mw</ShortName>
|
||||||
|
<LongName>MoveWidget</LongName>
|
||||||
|
<ShortDescription>Move widget on screen</ShortDescription>
|
||||||
|
<Description>This command immediately moves widgets on screen. First param is widget's name, last two params - distance for X and Y. Example: mw("StartButton", -5, 100.5);</Description>
|
||||||
|
</Function>
|
||||||
|
</FunctionInfoList>
|
47
assets/match3params.xml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<Match3Params>
|
||||||
|
<FieldWidth>7</FieldWidth>
|
||||||
|
<FieldHeight>7</FieldHeight>
|
||||||
|
<CellWidth>64.0</CellWidth>
|
||||||
|
<CellHeight>64.0</CellHeight>
|
||||||
|
<ChipLowestSpeed>-0.5</ChipLowestSpeed>
|
||||||
|
<ChipAcceleration>-0.0014</ChipAcceleration>
|
||||||
|
<ChipPositionEpsilon>1.0</ChipPositionEpsilon>
|
||||||
|
<ChipVelocityEpsilon>0.3</ChipVelocityEpsilon>
|
||||||
|
<ChipK>0.4</ChipK>
|
||||||
|
<ChipMatchTime>150</ChipMatchTime>
|
||||||
|
<ChipTypeCount>4</ChipTypeCount>
|
||||||
|
<ChipList>
|
||||||
|
<Chip>
|
||||||
|
<SelectedShaderName>DefaultShader</SelectedShaderName>
|
||||||
|
<SelectedTexName>chip1</SelectedTexName>
|
||||||
|
<SelectedNormTexName></SelectedNormTexName>
|
||||||
|
<FinishingTexName>chip1</FinishingTexName>
|
||||||
|
<SelectedAnimFileName>chips/chip1.xml</SelectedAnimFileName>
|
||||||
|
<FinishingAnimFileName>chips/chip1.xml</FinishingAnimFileName>
|
||||||
|
</Chip>
|
||||||
|
<Chip>
|
||||||
|
<SelectedShaderName>DefaultShader</SelectedShaderName>
|
||||||
|
<SelectedTexName>chip2</SelectedTexName>
|
||||||
|
<SelectedNormTexName></SelectedNormTexName>
|
||||||
|
<FinishingTexName>chip2</FinishingTexName>
|
||||||
|
<SelectedAnimFileName>chips/chip2.xml</SelectedAnimFileName>
|
||||||
|
<FinishingAnimFileName>chips/chip2.xml</FinishingAnimFileName>
|
||||||
|
</Chip>
|
||||||
|
<Chip>
|
||||||
|
<SelectedShaderName>DefaultShader</SelectedShaderName>
|
||||||
|
<SelectedTexName>chip3</SelectedTexName>
|
||||||
|
<SelectedNormTexName></SelectedNormTexName>
|
||||||
|
<FinishingTexName>chip3</FinishingTexName>
|
||||||
|
<SelectedAnimFileName>chips/chip3.xml</SelectedAnimFileName>
|
||||||
|
<FinishingAnimFileName>chips/chip3.xml</FinishingAnimFileName>
|
||||||
|
</Chip>
|
||||||
|
<Chip>
|
||||||
|
<SelectedShaderName>DefaultShader</SelectedShaderName>
|
||||||
|
<SelectedTexName>chip4</SelectedTexName>
|
||||||
|
<SelectedNormTexName></SelectedNormTexName>
|
||||||
|
<FinishingTexName>chip4</FinishingTexName>
|
||||||
|
<SelectedAnimFileName>chips/chip4.xml</SelectedAnimFileName>
|
||||||
|
<FinishingAnimFileName>chips/chip4.xml</FinishingAnimFileName>
|
||||||
|
</Chip>
|
||||||
|
</ChipList>
|
||||||
|
</Match3Params>
|
7
assets/shaders.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<Shaders>
|
||||||
|
<Shader>
|
||||||
|
<Name>DefaultShader</Name>
|
||||||
|
<VertexFileName>shaders/shader_vertex.txt</VertexFileName>
|
||||||
|
<FragmentFileName>shaders/shader_fragment.txt</FragmentFileName>
|
||||||
|
</Shader>
|
||||||
|
</Shaders>
|
35
assets/shaders/shader_bump_fragment.txt
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
precision lowp float;
|
||||||
|
uniform sampler2D Texture;
|
||||||
|
uniform sampler2D NormalMap;
|
||||||
|
uniform float Transparency;
|
||||||
|
varying vec2 texCoord;
|
||||||
|
varying vec2 posCoord;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
vec3 lightPos = vec3(400.0, 200.0, 200.0);
|
||||||
|
|
||||||
|
vec3 lVec = normalize(lightPos - vec3(posCoord, 0.0));
|
||||||
|
|
||||||
|
vec3 texParam = texture2D(NormalMap, texCoord.st).rgb;
|
||||||
|
vec3 normVec;
|
||||||
|
if (texParam.x == 0.0 && texParam.y == 0.0 && texParam.z == 0.0)
|
||||||
|
{
|
||||||
|
normVec = vec3(0.0,0.0,1.0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
normVec = (texture2D(NormalMap, texCoord.st).rgb - 0.5)* 2.0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
vec4 diffuse = vec4(1.0, 1.0, 1.0, 1.0) * max( dot(lVec, normVec), 0.0) * 0.5;
|
||||||
|
//vec4 diffuse = vec4(1.0, 1.0, 1.0, 1.0) * 0.5;
|
||||||
|
|
||||||
|
vec4 color = texture2D(Texture, texCoord).rgba * 0.5 + texture2D(Texture, texCoord).rgba * diffuse;
|
||||||
|
|
||||||
|
gl_FragColor = vec4(color.rgb, color.a * Transparency);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
14
assets/shaders/shader_bump_vertex.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
attribute vec3 vPosition;
|
||||||
|
attribute vec2 vTexCoord;
|
||||||
|
varying vec2 texCoord;
|
||||||
|
varying vec2 posCoord;
|
||||||
|
|
||||||
|
uniform mat4 ProjectionMatrix;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
//480x320
|
||||||
|
gl_Position = ProjectionMatrix * vec4(vPosition.xyz, 1.0);
|
||||||
|
posCoord = vPosition.xy;
|
||||||
|
texCoord = vTexCoord;
|
||||||
|
}
|
14
assets/shaders/shader_fragment.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
precision lowp float;
|
||||||
|
uniform sampler2D Texture;
|
||||||
|
uniform float Transparency;
|
||||||
|
varying vec2 texCoord;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
vec4 color = texture2D(Texture, texCoord).rgba;
|
||||||
|
|
||||||
|
gl_FragColor = vec4(color.rgb, color.a * Transparency);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
12
assets/shaders/shader_vertex.txt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
attribute vec3 vPosition;
|
||||||
|
attribute vec2 vTexCoord;
|
||||||
|
varying vec2 texCoord;
|
||||||
|
|
||||||
|
uniform mat4 ProjectionMatrix;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
//480x320
|
||||||
|
gl_Position = ProjectionMatrix * vec4(vPosition.xyz, 1.0);
|
||||||
|
texCoord = vTexCoord;
|
||||||
|
}
|
11
assets/test_animation.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<Animation>
|
||||||
|
<!--
|
||||||
|
<TexName>anim_tex.bmp</TexName>
|
||||||
|
<PosFrom x='100' y='100'/><PosTo x='200' y='200'/>-->
|
||||||
|
<Frames>
|
||||||
|
<Frame><TexCoordFrom x='0' y='0'/><TexCoordTo x='0.25' y='1'/><TimePassed>100</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.25' y='0'/><TexCoordTo x='0.5' y='1'/><TimePassed>200</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.5' y='0'/><TexCoordTo x='0.75' y='1'/><TimePassed>300</TimePassed></Frame>
|
||||||
|
<Frame><TexCoordFrom x='0.75' y='0'/><TexCoordTo x='1' y='1'/><TimePassed>400</TimePassed></Frame>
|
||||||
|
</Frames>
|
||||||
|
</Animation>
|
20
assets/textures.xml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<Textures>
|
||||||
|
<Texture><FileName>console_bkg.bmp</FileName></Texture>
|
||||||
|
<Texture><FileName>cave_hd.png</FileName><TexName>cave_hd</TexName></Texture>
|
||||||
|
<Texture><FileName>button_normal.bmp</FileName><TexName>button_normal</TexName></Texture>
|
||||||
|
<Texture><FileName>button_pressed.bmp</FileName><TexName>button_pressed</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip1.png</FileName><TexName>chip1</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip1_nmap.png</FileName><TexName>chip1_nmap</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip2.png</FileName><TexName>chip2</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip2_nmap.png</FileName><TexName>chip2_nmap</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip3.png</FileName><TexName>chip3</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip4.png</FileName><TexName>chip4</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip1locked.bmp</FileName><TexName>chip1locked</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip2locked.bmp</FileName><TexName>chip2locked</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip3locked.bmp</FileName><TexName>chip3locked</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip4locked.bmp</FileName><TexName>chip4locked</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip1finish.bmp</FileName><TexName>chip1finish</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip2finish.bmp</FileName><TexName>chip2finish</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip3finish.bmp</FileName><TexName>chip3finish</TexName></Texture>
|
||||||
|
<Texture><FileName>chips/chip4finish.bmp</FileName><TexName>chip4finish</TexName></Texture>
|
||||||
|
</Textures>
|
11
default.properties
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# This file is automatically generated by Android Tools.
|
||||||
|
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||||
|
#
|
||||||
|
# This file must be checked in Version Control Systems.
|
||||||
|
#
|
||||||
|
# To customize properties used by the Ant build system use,
|
||||||
|
# "build.properties", and override values to adapt the script to your
|
||||||
|
# project structure.
|
||||||
|
|
||||||
|
# Project target.
|
||||||
|
target=android-8
|
91
jni/Android.mk
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# Copyright (C) 2009 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
LPATH := $(call my-dir)
|
||||||
|
|
||||||
|
ENGINE_PATH = $(SalmonEnginePathCygwin)
|
||||||
|
|
||||||
|
BOOST_PATH = $(LibsPathCygwin)/boost_1_47_0
|
||||||
|
|
||||||
|
OGG_PATH = $(LibsPathCygwin)/libogg-1.3.0
|
||||||
|
|
||||||
|
VORBIS_PATH = $(LibsPathCygwin)/libvorbis-1.3.2
|
||||||
|
|
||||||
|
SQUIRREL_PATH = $(LibsPathCygwin)/sqplus
|
||||||
|
|
||||||
|
LIBPNG_PATH = $(LibsPathCygwin)/libpng_1.4.1_android
|
||||||
|
|
||||||
|
ZIP_PATH = $(LibsPathCygwin)/julienr-libzip-android/jni
|
||||||
|
|
||||||
|
#ENGINE_PATH = $(SalmonEnginePath)
|
||||||
|
|
||||||
|
#BOOST_PATH = $(LibsPath)/boost_1_47_0
|
||||||
|
|
||||||
|
#OGG_PATH = $(LibsPath)/libogg-1.3.0
|
||||||
|
|
||||||
|
#VORBIS_PATH = $(LibsPath)/libvorbis-1.3.2
|
||||||
|
|
||||||
|
#SQUIRREL_PATH = $(LibsPath)/sqplus
|
||||||
|
|
||||||
|
#LIBPNG_PATH = $(LibsPath)/libpng_1.4.1_android
|
||||||
|
|
||||||
|
#ZIP_PATH = $(LibsPath)/julienr-libzip-android/jni
|
||||||
|
|
||||||
|
#====== ENGINE AND LIBS =====================
|
||||||
|
|
||||||
|
include $(ENGINE_PATH)/Android_Engine.mk
|
||||||
|
|
||||||
|
|
||||||
|
#================= THE GAME =======================
|
||||||
|
|
||||||
|
|
||||||
|
LOCAL_PATH:= $(LPATH)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
#LOCAL_CFLAGS := -DTARGET_ANDROID -DTARGET_HALIBUT -g -ggdb -O0
|
||||||
|
LOCAL_CFLAGS := -DTARGET_ANDROID -DTARGET_HALIBUT
|
||||||
|
LOCAL_STATIC_LIBRARIES := boost
|
||||||
|
LOCAL_STATIC_LIBRARIES += squirrel
|
||||||
|
LOCAL_STATIC_LIBRARIES += png_lib
|
||||||
|
LOCAL_STATIC_LIBRARIES += zip
|
||||||
|
LOCAL_SHARED_LIBRARIES := HalibutEngine
|
||||||
|
LOCAL_SHARED_LIBRARIES += gnustl_shared
|
||||||
|
LOCAL_C_INCLUDES := $(ENGINE_PATH)
|
||||||
|
LOCAL_C_INCLUDES += $(BOOST_PATH)
|
||||||
|
LOCAL_C_INCLUDES += $(VORBIS_PATH)/include
|
||||||
|
LOCAL_C_INCLUDES += $(VORBIS_PATH)/include/vorbis
|
||||||
|
LOCAL_C_INCLUDES += $(VORBIS_PATH)/lib
|
||||||
|
LOCAL_C_INCLUDES += $(VORBIS_PATH)/lib/books
|
||||||
|
LOCAL_C_INCLUDES += $(VORBIS_PATH)/lib/modes
|
||||||
|
LOCAL_C_INCLUDES += $(OGG_PATH)/include
|
||||||
|
LOCAL_C_INCLUDES += $(OGG_PATH)/include/ogg
|
||||||
|
LOCAL_C_INCLUDES += $(SQUIRREL_PATH)/include
|
||||||
|
LOCAL_C_INCLUDES += $(SQUIRREL_PATH)/sqplus
|
||||||
|
LOCAL_C_INCLUDES += $(SQUIRREL_PATH)/squirrel
|
||||||
|
LOCAL_C_INCLUDES += $(SQUIRREL_PATH)/sqstdlib
|
||||||
|
LOCAL_C_INCLUDES += $(LIBPNG_PATH)
|
||||||
|
LOCAL_C_INCLUDES += $(ZIP_PATH)
|
||||||
|
LOCAL_MODULE := CrystalOfRhylilLib
|
||||||
|
LOCAL_SRC_FILES := main_code.cpp
|
||||||
|
LOCAL_SRC_FILES += android_api.cpp
|
||||||
|
LOCAL_SRC_FILES += match3/match3field.cpp
|
||||||
|
|
||||||
|
LOCAL_LDLIBS := -lGLESv2
|
||||||
|
#LOCAL_LDLIBS += -llog -Wl -g -ggdb -lz
|
||||||
|
LOCAL_LDLIBS += -llog -Wl -lz
|
||||||
|
|
||||||
|
include $(BUILD_SHARED_LIBRARY)
|
11
jni/Application.mk
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#APP_PLATFORM := android-9
|
||||||
|
|
||||||
|
#APP_STL := gnustl_static
|
||||||
|
#APP_STL := stlport_static
|
||||||
|
APP_STL := gnustl_shared
|
||||||
|
APP_CPPFLAGS += -fexceptions
|
||||||
|
APP_CPPFLAGS += -frtti
|
||||||
|
APP_OPTIM := debug
|
||||||
|
|
||||||
|
#APP_ABI := armeabi-v7a
|
||||||
|
|
150
jni/android_api.cpp
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
#include "android_api.h"
|
||||||
|
|
||||||
|
#include "main_code.h"
|
||||||
|
|
||||||
|
|
||||||
|
//#include "boost/shared_ptr.h"
|
||||||
|
|
||||||
|
const float CONST_MAXRIX_WIDTH = 800.f;
|
||||||
|
const float CONST_MAXRIX_HEIGHT = 480.f;
|
||||||
|
|
||||||
|
boost::mutex RenderMutex;
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Init(JNIEnv * env, jobject obj, jint width, jint height)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (App->Inited)
|
||||||
|
{
|
||||||
|
App->OuterDeinit(); //Clean up what is left at previous launch (if applicable)
|
||||||
|
}
|
||||||
|
|
||||||
|
App->OuterInit(width, height, CONST_MAXRIX_WIDTH, CONST_MAXRIX_HEIGHT);
|
||||||
|
|
||||||
|
App->Inited = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (ErrorCommon e)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_StopSounds(JNIEnv * env, jobject obj)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Update(JNIEnv * env, jobject obj, long dt)
|
||||||
|
{
|
||||||
|
RenderMutex.lock();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (App->Inited)
|
||||||
|
{
|
||||||
|
App->OuterDraw();
|
||||||
|
App->OuterUpdate(dt);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
|
RenderMutex.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT int JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_IsInited(JNIEnv * env, jobject obj)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (App->Inited)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Destroy(JNIEnv * env, jobject obj)
|
||||||
|
{
|
||||||
|
RenderMutex.lock();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (App->Inited)
|
||||||
|
{
|
||||||
|
App->Inited = false;
|
||||||
|
App->OuterDeinit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ErrorCommon e)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
RenderMutex.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapDown(JNIEnv * env, jobject obj, float x, float y, long time)
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
App->OuterOnTapDown(vec2(x*CONST_MAXRIX_WIDTH/HalibutRender->GetScreenWidth(), y*CONST_MAXRIX_HEIGHT/HalibutRender->GetScreenHeight()));
|
||||||
|
}
|
||||||
|
catch (ErrorCommon e)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapUp(JNIEnv * env, jobject obj, float x, float y, long time)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
App->OuterOnTapUp(vec2(x*CONST_MAXRIX_WIDTH/HalibutRender->GetScreenWidth(), y*CONST_MAXRIX_HEIGHT/HalibutRender->GetScreenHeight()));
|
||||||
|
}
|
||||||
|
catch (ErrorCommon e)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapMove(JNIEnv * env, jobject obj, float x, float y, long time)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnFling(JNIEnv * env, jobject obj, jfloat velocityX, jfloat velocityY, long time)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnScroll(JNIEnv * env, jobject obj, jfloat distanceX, jfloat distanceY, long time)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
App->OuterOnMove(vec2(distanceX*CONST_MAXRIX_WIDTH/HalibutRender->GetScreenWidth(), distanceY*CONST_MAXRIX_HEIGHT/HalibutRender->GetScreenHeight()));
|
||||||
|
}
|
||||||
|
catch (ErrorCommon e)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnKeyPress(JNIEnv * env, jobject obj, jint keyCode)
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
App->OnKeyPress(keyCode);
|
||||||
|
}
|
||||||
|
catch (ErrorCommon e)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
31
jni/android_api.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#ifndef ANDROID_API_H_INCLUDED
|
||||||
|
#define ANDROID_API_H_INCLUDED
|
||||||
|
|
||||||
|
#include <jni.h>
|
||||||
|
#include <android/log.h>
|
||||||
|
|
||||||
|
#include <GLES/gl.h>
|
||||||
|
#include <GLES2/gl2.h>
|
||||||
|
#include <GLES2/gl2ext.h>
|
||||||
|
|
||||||
|
#include "boost/shared_ptr.hpp"
|
||||||
|
|
||||||
|
#include "main_code.h"
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Init(JNIEnv * env, jobject obj, jint width, jint height);
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_StopSounds(JNIEnv * env, jobject obj);
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Update(JNIEnv * env, jobject obj, long dt);
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Destroy(JNIEnv * env, jobject obj);
|
||||||
|
JNIEXPORT int JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_IsInited(JNIEnv * env, jobject obj);
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapDown(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time);
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapUp(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time);
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapMove(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time);
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnFling(JNIEnv * env, jobject obj, jfloat velocityX, jfloat velocityY, long time);
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnScroll(JNIEnv * env, jobject obj, jfloat distanceX, jfloat distanceY, long time);
|
||||||
|
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnKeyPress(JNIEnv * env, jobject obj, jint keyCode);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
141
jni/main_code.cpp
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
#include "main_code.h"
|
||||||
|
|
||||||
|
#ifdef TARGET_ANDROID
|
||||||
|
#include "android_api.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
#include "include/Engine.h"
|
||||||
|
|
||||||
|
#include "main_code.h"
|
||||||
|
|
||||||
|
#ifndef TARGET_IOS
|
||||||
|
boost::shared_ptr<TMyApplication> App(new TMyApplication);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool animPaused = false;
|
||||||
|
|
||||||
|
struct TOnClickTest
|
||||||
|
{
|
||||||
|
void operator()()
|
||||||
|
{
|
||||||
|
|
||||||
|
//ResourceManager->ScriptManager.RunScript("5+5;");
|
||||||
|
|
||||||
|
if (animPaused)
|
||||||
|
{
|
||||||
|
//animPaused = false;
|
||||||
|
//ResourceManager->HalibutAnimationManager.StartAnimation("test_anim");
|
||||||
|
//ResourceManager->HalibutAnimationManager.ShowAnimation("test_anim");
|
||||||
|
//ResourceManager->SoundManager.PlayMusic("finalogg.ogg");
|
||||||
|
|
||||||
|
//App->Match3Controller.Match3Field->StartAnimateChip(4,1);
|
||||||
|
|
||||||
|
//App->Match3Controller.Match3Field->HighlightMatch3();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//animPaused = true;
|
||||||
|
//ResourceManager->HalibutAnimationManager.StopAnimation("test_anim");
|
||||||
|
//ResourceManager->HalibutAnimationManager.HideAnimation("test_anim");
|
||||||
|
//ResourceManager->SoundManager.StopMusic("finalogg.ogg");
|
||||||
|
//App->Match3Controller.Match3Field->StopAnimateChip(4,1);
|
||||||
|
//App->Match3Controller.Match3Field->HighlightMatch3();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//What to do on init
|
||||||
|
void TMyApplication::InnerInit()
|
||||||
|
{
|
||||||
|
#ifdef TARGET_ANDROID
|
||||||
|
ResourceManager->PathToResources = "";
|
||||||
|
#endif
|
||||||
|
#ifdef TARGET_WIN32
|
||||||
|
#ifdef DEBUG
|
||||||
|
ResourceManager->PathToResources = "../../assets/";
|
||||||
|
#else
|
||||||
|
ResourceManager->PathToResources = "res/";
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef TARGET_IOS
|
||||||
|
ResourceManager->PathToResources = "assets/";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
boost::shared_ptr<boost::property_tree::ptree> px = FileToPropertyTree("function_info_list.xml");
|
||||||
|
|
||||||
|
ResourceManager->ScriptManager.Serialize(*px);
|
||||||
|
|
||||||
|
px = FileToPropertyTree("shaders.xml");
|
||||||
|
ResourceManager->ShaderManager.Serialize(*px);
|
||||||
|
|
||||||
|
HalibutRender->PushShader("DefaultShader");
|
||||||
|
|
||||||
|
px = FileToPropertyTree("textures.xml");
|
||||||
|
ResourceManager->TexList.Serialize(*px);
|
||||||
|
|
||||||
|
px = FileToPropertyTree("fonts.xml");
|
||||||
|
ResourceManager->FontManager.Serialize(*px);
|
||||||
|
ResourceManager->FontManager.PushFont("droid_sans14");
|
||||||
|
|
||||||
|
|
||||||
|
ResourceManager->GUIManager.AddWidgetAndFill(boost::shared_ptr<TInstancingWidgetAncestor>(new TSquareButton),
|
||||||
|
"ololo", "group1",
|
||||||
|
boost::shared_ptr<TTriangleListFillerAncestor>(new TSquareButtonTriangleListFiller(vec2(100, 100), vec2(200, 200), "button_normal", "button_pressed")));
|
||||||
|
|
||||||
|
|
||||||
|
ResourceManager->GUIManager.AddWidgetAndFill(boost::shared_ptr<TInstancingWidgetAncestor>(new TSquareStatic),
|
||||||
|
"Background", "group1",
|
||||||
|
boost::shared_ptr<TSquareStaticTriangleListFiller>(new TSquareStaticTriangleListFiller(vec2(0, 0), vec2(800, 480), "cave_hd")));
|
||||||
|
|
||||||
|
|
||||||
|
ResourceManager->GUIManager.AddWidget(boost::shared_ptr<TInstancingWidgetAncestor>(new TMatch3Field(Match3Controller)),
|
||||||
|
"match3", "group1");
|
||||||
|
|
||||||
|
ResourceManager->GUIManager.MoveWidget("ololo", vec2(-100, 0));
|
||||||
|
|
||||||
|
TOnClickTest OnClickTest;
|
||||||
|
|
||||||
|
//ResourceManager->GUIManager.GetOnClickSignal("ololo").connect(OnClickTest);
|
||||||
|
|
||||||
|
//testAnimObject.Serialize(FileToPropertyTree("test_animation_xml.xml"));
|
||||||
|
|
||||||
|
//ResourceManager->HalibutAnimationManager.AddAnimationObject("test_anim", testAnimObject);
|
||||||
|
|
||||||
|
//ResourceManager->HalibutAnimationManager.StartAnimation("test_anim");
|
||||||
|
|
||||||
|
|
||||||
|
//ResourceManager->ShaderManager.AddShader("DefaultShader", "shader_vertex.txt", "shader_fragment.txt");
|
||||||
|
/*HalibutRender->PushShader("DefaultShader");
|
||||||
|
|
||||||
|
ResourceManager->TexList.AddTexture(CONST_CONSOLE_TEX_NAME);
|
||||||
|
|
||||||
|
ResourceManager->FontManager.AddFont("droid_sans14", "droid_sans14_font_bitmap.bmp32", "droid_sans14_font_charmap.txt");
|
||||||
|
ResourceManager->FontManager.PushFont("droid_sans14");*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//What to do on deinit
|
||||||
|
void TMyApplication::InnerDeinit()
|
||||||
|
{
|
||||||
|
Inited = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//What to do on draw
|
||||||
|
void TMyApplication::InnerDraw()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//What to do on update. timer means how many ms passed since last update
|
||||||
|
void TMyApplication::InnerUpdate(cardinal timer)
|
||||||
|
{
|
||||||
|
}
|
64
jni/main_code.h
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
#ifndef GL_CODE_H_INCLUDED
|
||||||
|
#define GL_CODE_H_INCLUDED
|
||||||
|
|
||||||
|
#ifdef TARGET_ANDROID
|
||||||
|
//#include "android_api.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "boost/shared_ptr.hpp"
|
||||||
|
/*#include "boost/thread/thread.hpp"
|
||||||
|
#include "boost/signal.hpp"
|
||||||
|
#include "boost/assign.hpp"
|
||||||
|
#include "boost/bind.hpp"
|
||||||
|
*/
|
||||||
|
#include "include/Engine.h"
|
||||||
|
|
||||||
|
#include "match3/match3field.h"
|
||||||
|
|
||||||
|
|
||||||
|
class TMatch3Controller
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
TMatch3Field* Match3Field;
|
||||||
|
|
||||||
|
|
||||||
|
TMatch3Controller()
|
||||||
|
: Match3Field(NULL)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//Application class
|
||||||
|
class TMyApplication : public TApplication
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool Inited;
|
||||||
|
|
||||||
|
TMatch3Controller Match3Controller;
|
||||||
|
|
||||||
|
TMyApplication() : Inited(false) { }
|
||||||
|
|
||||||
|
virtual void InnerInit();
|
||||||
|
//What to do on init
|
||||||
|
|
||||||
|
virtual void InnerDeinit();
|
||||||
|
//What to do on deinit
|
||||||
|
|
||||||
|
virtual void InnerDraw();
|
||||||
|
//What to do on draw
|
||||||
|
|
||||||
|
virtual void InnerUpdate(cardinal timer);
|
||||||
|
//What to do on update. timer means how many ms passed since last update
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifndef TARGET_IOS
|
||||||
|
extern boost::shared_ptr<TMyApplication> App;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
1329
jni/match3/match3field.cpp
Normal file
276
jni/match3/match3field.h
Normal file
@ -0,0 +1,276 @@
|
|||||||
|
#ifndef MATCH3FIELD_H_INCLUDED
|
||||||
|
#define MATCH3FIELD_H_INCLUDED
|
||||||
|
|
||||||
|
#include "include/Engine.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const cardinal CONST_MAX_FIELD_WIDTH = 11;
|
||||||
|
const cardinal CONST_MAX_FIELD_HEIGHT = 11;
|
||||||
|
|
||||||
|
|
||||||
|
const float CONST_MATCH3_CELL_WIDTH = 42.f;
|
||||||
|
const float CONST_MATCH3_CELL_HEIGHT = 42.f;
|
||||||
|
const float CONST_CHIP_LOWEST_SPEED = -0.5f;
|
||||||
|
const float CONST_CHIP_ACCELERATION = -0.0014f;
|
||||||
|
|
||||||
|
/*
|
||||||
|
const float CONST_MATCH3_CELL_WIDTH = 32.f;
|
||||||
|
const float CONST_MATCH3_CELL_HEIGHT = 32.f;
|
||||||
|
const float CONST_CHIP_LOWEST_SPEED = -0.3f;
|
||||||
|
const float CONST_CHIP_ACCELERATION = -0.001f;
|
||||||
|
*/
|
||||||
|
const cardinal CONST_MATCH_TIME = 150;
|
||||||
|
|
||||||
|
const float CONST_CHIP_POSITION_EPSILON = 1.f;
|
||||||
|
const float CONST_CHIP_VELOCITY_EPSILON = 0.3f;
|
||||||
|
|
||||||
|
|
||||||
|
const float CONST_CHIP_K = 0.4f;
|
||||||
|
|
||||||
|
const cardinal CONST_CHIP_TYPE_COUNT = 4;
|
||||||
|
|
||||||
|
|
||||||
|
struct TChipTemplateParams : public TSerializeInterface
|
||||||
|
{
|
||||||
|
THalibutExternalAnimObject SelectedTemplateAnimObject;
|
||||||
|
THalibutExternalAnimObject FinishingTemplateAnimObject;
|
||||||
|
TRenderParams SelectedRenderParams;
|
||||||
|
TRenderParams FinishingRenderParams;
|
||||||
|
|
||||||
|
virtual void Serialize(boost::property_tree::ptree& propertyTree);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct TMatch3FieldParams : public TSerializeInterface
|
||||||
|
{
|
||||||
|
cardinal FieldWidth;
|
||||||
|
cardinal FieldHeight;
|
||||||
|
float CellWidth;
|
||||||
|
float CellHeight;
|
||||||
|
float ChipLowestSpeed;
|
||||||
|
float ChipAcceleration;
|
||||||
|
|
||||||
|
float ChipPositionEpsilon;
|
||||||
|
float ChipVelocityEpsilon;
|
||||||
|
float ChipK;
|
||||||
|
cardinal ChipMatchTime;
|
||||||
|
|
||||||
|
cardinal ChipTypeCount;
|
||||||
|
|
||||||
|
std::vector<TChipTemplateParams> ChipTemplateParamsArr;
|
||||||
|
|
||||||
|
TMatch3FieldParams()
|
||||||
|
: FieldWidth(CONST_MAX_FIELD_WIDTH)
|
||||||
|
, FieldHeight(CONST_MAX_FIELD_HEIGHT)
|
||||||
|
, CellWidth(CONST_MATCH3_CELL_WIDTH)
|
||||||
|
, CellHeight(CONST_MATCH3_CELL_HEIGHT)
|
||||||
|
, ChipLowestSpeed(CONST_CHIP_LOWEST_SPEED)
|
||||||
|
, ChipAcceleration(CONST_CHIP_ACCELERATION)
|
||||||
|
, ChipPositionEpsilon(CONST_CHIP_POSITION_EPSILON)
|
||||||
|
, ChipVelocityEpsilon(CONST_CHIP_VELOCITY_EPSILON)
|
||||||
|
, ChipK(CONST_CHIP_K)
|
||||||
|
, ChipMatchTime(CONST_MATCH_TIME)
|
||||||
|
, ChipTypeCount(CONST_CHIP_TYPE_COUNT)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
virtual void Serialize(boost::property_tree::ptree& propertyTree);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct TChip
|
||||||
|
{
|
||||||
|
int ChipType; // -1 means empty field
|
||||||
|
std::string AnimName; //Generated automatically
|
||||||
|
|
||||||
|
TRenderPairList::iterator RenderPair;
|
||||||
|
|
||||||
|
cardinal VertexListShift;
|
||||||
|
|
||||||
|
float Velocity;
|
||||||
|
|
||||||
|
enum TChipState
|
||||||
|
{
|
||||||
|
CS_STANDBY,
|
||||||
|
CS_SWAPPING,
|
||||||
|
CS_FALLING,
|
||||||
|
CS_LOCKED,
|
||||||
|
CS_FINISHING,
|
||||||
|
CS_X,
|
||||||
|
} ChipState;
|
||||||
|
|
||||||
|
TChip(int chipType, TRenderPairList::iterator renderPair, cardinal vertexListShift, TChipState chipState = CS_FALLING);
|
||||||
|
|
||||||
|
~TChip();
|
||||||
|
|
||||||
|
vec2 GetLeftBottomPos();
|
||||||
|
void SetLeftBottomPos(vec2 newPos);
|
||||||
|
void MoveLeftBottomPos(vec2 shift);
|
||||||
|
|
||||||
|
static int StaticAnimationIndex;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TChipSwappingPair
|
||||||
|
{
|
||||||
|
float T;
|
||||||
|
ivec2 Chip1;
|
||||||
|
ivec2 Chip2;
|
||||||
|
|
||||||
|
vec2 Chip1RealPosFrom;
|
||||||
|
vec2 Chip2RealPosFrom;
|
||||||
|
|
||||||
|
bool IsReturning;
|
||||||
|
|
||||||
|
|
||||||
|
TChipSwappingPair(ivec2 chip1, ivec2 chip2, vec2 chip1PosFrom, vec2 chip2PosFrom)
|
||||||
|
: Chip1(chip1)
|
||||||
|
, Chip2(chip2)
|
||||||
|
, T(0)
|
||||||
|
, Chip1RealPosFrom(chip1PosFrom)
|
||||||
|
, Chip2RealPosFrom(chip2PosFrom)
|
||||||
|
, IsReturning(false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TChipDeletingData
|
||||||
|
{
|
||||||
|
float T;
|
||||||
|
ivec2 Chip;
|
||||||
|
vec2 Pos;
|
||||||
|
|
||||||
|
TChipDeletingData(ivec2 chip, vec2 pos)
|
||||||
|
: T(0.f)
|
||||||
|
, Chip(chip)
|
||||||
|
, Pos(pos)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class TMatch3Logic
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
|
cardinal ChipTypeCount;
|
||||||
|
|
||||||
|
std::vector<std::vector<TChip> > ChipMatrix;
|
||||||
|
std::vector<TChipSwappingPair> ChipSwappingPairVector;
|
||||||
|
std::vector<TChipDeletingData> ChipDeletingVector;
|
||||||
|
|
||||||
|
std::vector<TRenderPairList::iterator> RenderPairIteratorVector;
|
||||||
|
|
||||||
|
ivec2 selectedChip;
|
||||||
|
|
||||||
|
vec2 LeftBottomPosField;
|
||||||
|
|
||||||
|
TMatch3FieldParams Match3FieldParams;
|
||||||
|
|
||||||
|
void FillRandomChipMatrix(std::vector<TRenderPairList::iterator> renderPairIteratorVector, vec2 leftBottomPos);
|
||||||
|
|
||||||
|
vec2 GetExpectedLeftBottomPos(cardinal x, cardinal y);
|
||||||
|
|
||||||
|
void StartAnimateChip(cardinal x, cardinal y);
|
||||||
|
void StopAnimateChip(cardinal x, cardinal y);
|
||||||
|
|
||||||
|
bool ChipIsLocked(ivec2 chip);
|
||||||
|
bool ChipIsFinishing(ivec2 chip);
|
||||||
|
bool ChipIsStable(ivec2 chip);
|
||||||
|
bool ChipCanBeSelected(ivec2 chip);
|
||||||
|
bool ChipsCanBeSwapped(ivec2 p1, ivec2 p2);
|
||||||
|
|
||||||
|
bool ChipCanBeMatchedUp(ivec2 chip);
|
||||||
|
bool ChipCanBeMatchedDown(ivec2 chip);
|
||||||
|
bool ChipCanBeMatchedLeft(ivec2 chip);
|
||||||
|
bool ChipCanBeMatchedRight(ivec2 chip);
|
||||||
|
|
||||||
|
void UnmatchChips(std::vector<ivec2> chipList);
|
||||||
|
void UpdateChipPosition(cardinal dt);
|
||||||
|
void RemoveBubbles();
|
||||||
|
|
||||||
|
void ReplaceAnimation(ivec2 p);
|
||||||
|
|
||||||
|
void MoveVertexListShiftBack(TRenderPairList::iterator renderPairItr, cardinal moveFrom);
|
||||||
|
void MoveVertexCoordDown(TRenderPairList::iterator renderPairItr, cardinal moveFrom, float value);
|
||||||
|
|
||||||
|
void AddChipToUp(cardinal colNum, int chipType, vec2 spawnPos, TChip::TChipState chipState = TChip::CS_FALLING);
|
||||||
|
void InsertEmptyChip(cardinal colNum, cardinal rowNum, int chipType);
|
||||||
|
|
||||||
|
void UpdateChipSwapping(cardinal dt);
|
||||||
|
void TryMatchAllChips();
|
||||||
|
|
||||||
|
void DestroyChip(ivec2 p);
|
||||||
|
|
||||||
|
void ChangeChipType(ivec2 p);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
TMatch3Logic();
|
||||||
|
virtual ~TMatch3Logic();
|
||||||
|
|
||||||
|
void SelectChip(ivec2 pos);
|
||||||
|
void UnselectChip();
|
||||||
|
ivec2 GetSelectedChip();
|
||||||
|
|
||||||
|
std::vector<ivec2> GetAvailableMatchingChips();
|
||||||
|
|
||||||
|
void SwapChips(ivec2 p1, ivec2 p2, bool isReturning = false);
|
||||||
|
|
||||||
|
void ResetChipPos(ivec2 p);
|
||||||
|
|
||||||
|
void UpdateLogic(cardinal dt);
|
||||||
|
|
||||||
|
void HitFieldWithPattern(ivec2 pos, std::vector<std::vector<char> > pattern, std::vector<std::vector<char> > jumpingPattern);
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class TMatch3Controller;
|
||||||
|
|
||||||
|
class TMatch3Field : public TMatch3Logic, public TInstancingWidgetAncestor
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
void FillBasicChipMatrixAndTriangleList();
|
||||||
|
|
||||||
|
//TMatch3Controller& Match3Controller;
|
||||||
|
|
||||||
|
vec2 LastTappedPos;
|
||||||
|
vec2 LastMovePos;
|
||||||
|
|
||||||
|
ivec2 PosToChip(vec2 pos);
|
||||||
|
|
||||||
|
public:
|
||||||
|
TMatch3Field();
|
||||||
|
TMatch3Field(const TMatch3Field& m);
|
||||||
|
TMatch3Field& operator=(const TMatch3Field& m);
|
||||||
|
|
||||||
|
TMatch3Field(TMatch3Controller& match3Controller);
|
||||||
|
~TMatch3Field();
|
||||||
|
|
||||||
|
virtual void Update(cardinal dt);
|
||||||
|
virtual void OnTapDown(vec2 pos);
|
||||||
|
virtual void OnTapUp(vec2 pos);
|
||||||
|
virtual void OnMove(vec2 shift);
|
||||||
|
virtual bool CheckClick(vec2 mousePos);
|
||||||
|
|
||||||
|
void HighlightMatch3();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
BIN
res/drawable-hdpi/ic_menu_template.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
res/drawable-ldpi/ic_menu_template.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
res/drawable-mdpi/ic_menu_template.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
res/raw/music/shot.wav
Normal file
4
res/values/strings.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">AndroidJniTemplate</string>
|
||||||
|
</resources>
|
72
src/fishrungames/crystalofrhylil/GLView.java
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
package fishrungames.crystalofrhylil;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.opengl.GLSurfaceView;
|
||||||
|
|
||||||
|
import javax.microedition.khronos.egl.EGLConfig;
|
||||||
|
import javax.microedition.khronos.opengles.GL10;
|
||||||
|
|
||||||
|
import fishrungames.engine.GLViewAncestor;
|
||||||
|
|
||||||
|
class GLView extends GLViewAncestor
|
||||||
|
{
|
||||||
|
static long lastTimeStamp;
|
||||||
|
static boolean gameIsInited = false;
|
||||||
|
|
||||||
|
public GLView(Context context)
|
||||||
|
{
|
||||||
|
//Change this method? Don't forget to change method below!
|
||||||
|
super(context);
|
||||||
|
init(false, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GLView(Context context, boolean translucent, int depth, int stencil)
|
||||||
|
{
|
||||||
|
//Change this method? Don't forget to change method above!
|
||||||
|
super(context);
|
||||||
|
init(translucent, depth, stencil);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(boolean translucent, int depth, int stencil)
|
||||||
|
{
|
||||||
|
super.init(translucent, depth, stencil);
|
||||||
|
setRenderer(new Renderer());
|
||||||
|
Calendar c = Calendar.getInstance();
|
||||||
|
lastTimeStamp = c.getTimeInMillis();
|
||||||
|
gameIsInited = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class Renderer implements GLSurfaceView.Renderer
|
||||||
|
{
|
||||||
|
public void onDrawFrame(GL10 gl)
|
||||||
|
{
|
||||||
|
if (gameIsInited)
|
||||||
|
{
|
||||||
|
Calendar c = Calendar.getInstance();
|
||||||
|
|
||||||
|
long currentTimeStamp = c.getTimeInMillis();
|
||||||
|
|
||||||
|
JniWrapper.Update(currentTimeStamp - lastTimeStamp);
|
||||||
|
|
||||||
|
lastTimeStamp = currentTimeStamp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onSurfaceChanged(GL10 gl, int width, int height)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
//JniWrapper.Destroy();
|
||||||
|
|
||||||
|
JniWrapper.Init(width,height);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onSurfaceCreated(GL10 gl, EGLConfig config)
|
||||||
|
{
|
||||||
|
//Do nothing.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
26
src/fishrungames/crystalofrhylil/JniWrapper.java
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
package fishrungames.crystalofrhylil;
|
||||||
|
|
||||||
|
public class JniWrapper
|
||||||
|
{
|
||||||
|
static {
|
||||||
|
//System.loadLibrary("gnustl_shared");
|
||||||
|
//System.loadLibrary("HalibutEngine");
|
||||||
|
System.loadLibrary("CrystalOfRhylilLib");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static native void Init(int width, int height);
|
||||||
|
public static native void Update(long dt);
|
||||||
|
public static native void StopSounds();
|
||||||
|
public static native void Destroy();
|
||||||
|
public static native int IsInited();
|
||||||
|
public static native void OnTapDown(float x, float y, long time);
|
||||||
|
public static native void OnTapUp(float x, float y, long time);
|
||||||
|
public static native void OnTapMove(float x, float y, long time);
|
||||||
|
|
||||||
|
public static native void OnFling(float velocityX, float velocityY, long time);
|
||||||
|
public static native void OnScroll(float distanceX, float distanceY, long time);
|
||||||
|
|
||||||
|
public static native void OnKeyPress(int keyCode);
|
||||||
|
}
|
186
src/fishrungames/crystalofrhylil/MainActivity.java
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
package fishrungames.crystalofrhylil;
|
||||||
|
|
||||||
|
import fishrungames.engine.FileWrapper;
|
||||||
|
|
||||||
|
//Deprecated
|
||||||
|
//import fishrungames.crystalofrhylil.R;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import android.view.GestureDetector;
|
||||||
|
import android.view.GestureDetector.SimpleOnGestureListener;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
|
|
||||||
|
//Deprecated
|
||||||
|
//import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
|
||||||
|
public class MainActivity extends Activity
|
||||||
|
{
|
||||||
|
|
||||||
|
GLView mView;
|
||||||
|
|
||||||
|
boolean IsScrolling = false;
|
||||||
|
|
||||||
|
private GestureDetector gestureDetector;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle icicle)
|
||||||
|
{
|
||||||
|
super.onCreate(icicle);
|
||||||
|
|
||||||
|
gestureDetector = new GestureDetector(new MyGestureListener());
|
||||||
|
|
||||||
|
FileWrapper.LoadHalibutEngineLibrary();
|
||||||
|
FileWrapper.SetActivityInstance(this);
|
||||||
|
FileWrapper.SetupEnviroment();
|
||||||
|
/*
|
||||||
|
* Deprecated
|
||||||
|
*
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for (Field f : R.raw.class.getFields())
|
||||||
|
{
|
||||||
|
FileWrapper.AddToFileMap(f.getName(), f.getInt(null));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (IllegalArgumentException e)
|
||||||
|
{
|
||||||
|
FileWrapper.ConsoleOut("IllegalArgumentException\n");
|
||||||
|
onStop();
|
||||||
|
} catch (IllegalAccessException e)
|
||||||
|
{
|
||||||
|
FileWrapper.ConsoleOut("IllegalAccessException\n");
|
||||||
|
onStop();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
mView = new GLView(getApplication());
|
||||||
|
|
||||||
|
setContentView(mView);
|
||||||
|
|
||||||
|
String apkFilePath = null;
|
||||||
|
ApplicationInfo appInfo = null;
|
||||||
|
PackageManager packMgmr = this.getPackageManager();
|
||||||
|
try {
|
||||||
|
appInfo = packMgmr.getApplicationInfo("fishrungames.crystalofrhylil", 0);
|
||||||
|
} catch (NameNotFoundException e) {
|
||||||
|
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException("Unable to locate assets, aborting...");
|
||||||
|
}
|
||||||
|
apkFilePath = appInfo.sourceDir;
|
||||||
|
|
||||||
|
FileWrapper.SetupApkFilePath(apkFilePath);
|
||||||
|
//FileWrapper.ConsoleOut("Out of java\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause()
|
||||||
|
{
|
||||||
|
JniWrapper.Destroy();
|
||||||
|
super.onPause();
|
||||||
|
mView.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume()
|
||||||
|
{
|
||||||
|
//Don't write anything here!
|
||||||
|
super.onResume();
|
||||||
|
mView.onResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStop()
|
||||||
|
{
|
||||||
|
//Don't write anything here!
|
||||||
|
super.onStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean onKeyDown(int keyCode, KeyEvent event)
|
||||||
|
{
|
||||||
|
int ascii_keycode = keyCode;
|
||||||
|
|
||||||
|
if (keyCode == KeyEvent.KEYCODE_DEL)
|
||||||
|
{
|
||||||
|
ascii_keycode = 8; //Hack - getUnicodeChar does not recognize backspace
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ascii_keycode = event.getUnicodeChar();
|
||||||
|
}
|
||||||
|
|
||||||
|
JniWrapper.OnKeyPress(ascii_keycode);
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean onKeyUp(int keyCode, KeyEvent event)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean onTouchEvent(MotionEvent event)
|
||||||
|
{
|
||||||
|
if (gestureDetector.onTouchEvent(event))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getAction() == MotionEvent.ACTION_UP)
|
||||||
|
{
|
||||||
|
float x = event.getX();
|
||||||
|
float y = (float) mView.getHeight() - event.getY();
|
||||||
|
|
||||||
|
if (IsScrolling)
|
||||||
|
{
|
||||||
|
IsScrolling = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
JniWrapper.OnTapUp(x, y, event.getEventTime());
|
||||||
|
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyGestureListener extends SimpleOnGestureListener
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
|
||||||
|
float velocityY)
|
||||||
|
{
|
||||||
|
JniWrapper.OnFling(velocityX, velocityY, e2.getEventTime());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean onScroll(MotionEvent e1, MotionEvent e2,
|
||||||
|
float distanceX, float distanceY)
|
||||||
|
{
|
||||||
|
JniWrapper.OnScroll(distanceX, distanceY, e2.getEventTime());
|
||||||
|
IsScrolling = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean onDown(MotionEvent event)
|
||||||
|
{
|
||||||
|
|
||||||
|
float x = event.getX();
|
||||||
|
float y = (float) mView.getHeight() - event.getY();
|
||||||
|
|
||||||
|
JniWrapper.OnTapDown(x, y, event.getEventTime());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
34
windows/Crystal of Rhylil.sln
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||||
|
# Visual C++ Express 2010
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Halibut Engine", "..\..\..\Engine\Halibut Engine\Halibut Engine.vcxproj", "{4E274B19-10B2-4987-96C5-76F35A149502}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Crystal of Rhylil", "Crystal of Rhylil\Crystal of Rhylil.vcxproj", "{0080A3E1-DFBF-4557-B198-E6D5D7724393}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{4E274B19-10B2-4987-96C5-76F35A149502} = {4E274B19-10B2-4987-96C5-76F35A149502}
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug_nosound|Win32 = Debug_nosound|Win32
|
||||||
|
Debug|Win32 = Debug|Win32
|
||||||
|
Release|Win32 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{4E274B19-10B2-4987-96C5-76F35A149502}.Debug_nosound|Win32.ActiveCfg = Debug_nosound|Win32
|
||||||
|
{4E274B19-10B2-4987-96C5-76F35A149502}.Debug_nosound|Win32.Build.0 = Debug_nosound|Win32
|
||||||
|
{4E274B19-10B2-4987-96C5-76F35A149502}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{4E274B19-10B2-4987-96C5-76F35A149502}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{4E274B19-10B2-4987-96C5-76F35A149502}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{4E274B19-10B2-4987-96C5-76F35A149502}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
{0080A3E1-DFBF-4557-B198-E6D5D7724393}.Debug_nosound|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{0080A3E1-DFBF-4557-B198-E6D5D7724393}.Debug_nosound|Win32.Build.0 = Debug|Win32
|
||||||
|
{0080A3E1-DFBF-4557-B198-E6D5D7724393}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{0080A3E1-DFBF-4557-B198-E6D5D7724393}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{0080A3E1-DFBF-4557-B198-E6D5D7724393}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{0080A3E1-DFBF-4557-B198-E6D5D7724393}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
27
windows/Crystal of Rhylil/Crystal of Rhylil.filters
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Файлы исходного кода">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Заголовочные файлы">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Файлы ресурсов">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp">
|
||||||
|
<Filter>Файлы исходного кода</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="main.h">
|
||||||
|
<Filter>Заголовочные файлы</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
94
windows/Crystal of Rhylil/Crystal of Rhylil.vcxproj
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{0080A3E1-DFBF-4557-B198-E6D5D7724393}</ProjectGuid>
|
||||||
|
<RootNamespace>Template</RootNamespace>
|
||||||
|
<ProjectName>Crystal of Rhylil</ProjectName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<CharacterSet>NotSet</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>NotSet</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(SalmonEnginePath)include</IncludePath>
|
||||||
|
<LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;$(SalmonEnginePath)$(Configuration)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(SalmonEnginePath)include</IncludePath>
|
||||||
|
<LibraryPath>$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;$(SalmonEnginePath)$(Configuration)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>$(SalmonEnginePath);$(LibsPath)\boost_1_47_0;$(LibsPath)\openal\OpenAL11_windows_sdk;$(LibsPath)\libogg-1.3.0\include;$(LibsPath)\libvorbis-1.3.2\include;$(LibsPath)\sqplus\sqplus;$(LibsPath)\sqplus\include;$(SolutionDir)\..\jni;$(LibsPath)\DirectXsdk\Include;$(LibsPath)\lpng1510</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>TARGET_WIN32;TARGET_HALIBUT;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;DEBUG</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;opengl32.lib;glu32.lib;Halibut Engine.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;OpenAL32.lib;zlib.lib;libpng15.lib;sqplusD.lib;squirrelD.lib;sqdbglibD.lib;sqstdlibD.lib;dsound.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>$(LibsPath)\boost_1_47_0\boost_windows\libs_engine\$(Configuration);$(LibsPath)\libogg-1.3.0\win32\VS2010\Win32\$(Configuration);$(LibsPath)\libvorbis-1.3.2\win32\VS2010\Win32\$(Configuration);$(LibsPath)\openal\OpenAL11_windows_sdk\libs\Win32;$(LibsPath)\sqplus\lib;$(LibsPath)\DirectXsdk\Lib\x86;$(LibsPath)\lpng1510\projects\vstudio\Debug Library</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<AdditionalIncludeDirectories>$(SalmonEnginePath);$(LibsPath)\boost_1_47_0;$(LibsPath)\openal\OpenAL11_windows_sdk;$(LibsPath)\libogg-1.3.0\include;$(LibsPath)\libvorbis-1.3.2\include;$(LibsPath)\sqplus\sqplus;$(LibsPath)\sqplus\include;$(SolutionDir)\..\jni;$(LibsPath)\DirectXsdk\Include;$(LibsPath)\lpng1510</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>TARGET_WIN32;TARGET_HALIBUT;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;opengl32.lib;glu32.lib;Halibut Engine.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;OpenAL32.lib;zlib.lib;libpng15.lib;sqplus.lib;squirrel.lib;sqdbglib.lib;sqstdlib.lib;dsound.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>$(LibsPath)\boost_1_47_0\boost_windows\libs_engine\$(Configuration);$(LibsPath)\libogg-1.3.0\win32\VS2010\Win32\$(Configuration);$(LibsPath)\libvorbis-1.3.2\win32\VS2010\Win32\$(Configuration);$(LibsPath)\openal\OpenAL11_windows_sdk\libs\Win32;$(LibsPath)\sqplus\lib;$(LibsPath)\DirectXsdk\Lib\x86;$(LibsPath)\lpng1510\projects\vstudio\Release Library</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\..\jni\main_code.cpp" />
|
||||||
|
<ClCompile Include="..\..\jni\match3\match3field.cpp" />
|
||||||
|
<ClCompile Include="main.cpp">
|
||||||
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">TARGET_WIN32;HALIBUT_WIN32;DEBUG;WIN32_LEAN_AND_MEAN</PreprocessorDefinitions>
|
||||||
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TARGET_WIN32;HALIBUT_WIN32;WIN32_LEAN_AND_MEAN</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\..\jni\main_code.h" />
|
||||||
|
<ClInclude Include="..\..\jni\match3\match3field.h" />
|
||||||
|
<ClInclude Include="main.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
20
windows/Crystal of Rhylil/main.cpp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#include "main.h"
|
||||||
|
#include "include/Utils/Utils.h"
|
||||||
|
|
||||||
|
#include "boost/property_tree/ptree.hpp"
|
||||||
|
#include "boost/property_tree/xml_parser.hpp"
|
||||||
|
#include <set>
|
||||||
|
#include "boost/foreach.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
extern boost::shared_ptr<TMyApplication> App;
|
||||||
|
|
||||||
|
int APIENTRY WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst,
|
||||||
|
LPSTR lpszCmdLine, int nCmdShow)
|
||||||
|
{
|
||||||
|
App->Height = 480;
|
||||||
|
App->Width = 800;
|
||||||
|
|
||||||
|
//Start application
|
||||||
|
return MainLoop(*App);
|
||||||
|
}
|
6
windows/Crystal of Rhylil/main.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
/* Path to the engine */
|
||||||
|
#include "HalibutEngineWindows.h"
|
||||||
|
|
||||||
|
#include "../../jni/main_code.h"
|