166 Commits

Author SHA1 Message Date
xawotihs
00e076fca4 Fixed compilation with SDL/mingw 2025-05-11 17:08:37 +02:00
xawotihs
0023c4a086 Fixed compilation with latest mingw64 2025-04-25 18:48:02 +02:00
xawotihs
7c9fd90903 Merge branch 'master' into cmake 2025-04-22 20:37:50 +02:00
xawotihs
d95e9e1155 Fix compilation with latest cmake 2025-04-11 21:58:54 +02:00
Eduardo MG
d4cb3e8384 Merge pull request #1078 from fogobogo/cmake
Cmake update
2022-10-04 16:07:12 -05:00
fogobogo
d566524499 cmake build fixes
this brings the cmake branch in line with commit
8e551bb287 from the main branch.

This adds a few boons, most notably it allows compiling on Linux with
SDL2 instead of SDL.

That also allows for mouse support and can now be run without X, which
is mostly interesting in case you want to play some Wagic on say, a
Raspberry Pi.
2022-01-11 20:51:49 +01:00
fogobogo
f3bb5ccef9 Merge branch 'master' into cmake 2022-01-11 19:19:09 +01:00
xawotihs
4709295598 Adds ios cmake toolchain 2017-09-08 22:47:29 +02:00
Xawotihs
af0c423359 Switch back to java oracle 8 to build android app 2017-09-08 18:23:09 +02:00
Xawotihs
45253e0008 Reupdate pip calls to use them for osx as well 2017-09-08 17:56:20 +02:00
Xawotihs
e32e5c2a47 Readding sudo pip ... lalala ... 2017-09-07 22:12:25 +02:00
Xawotihs
3a4f9f06cb reordered pip install 2017-09-07 22:01:36 +02:00
Xawotihs
a563030440 Removing pip cache 2017-09-07 21:44:55 +02:00
Xawotihs
80d43896ff Reordered pip installs around 2017-09-07 20:56:37 +02:00
Xawotihs
1c5949411f Fixed some ] and space 2017-09-07 20:22:25 +02:00
Xawotihs
699b151939 With a couple of ; 2017-09-07 20:15:32 +02:00
Xawotihs
e6af1a08b9 Use sudo pip for Android and pip with linux without Android 2017-09-07 20:09:56 +02:00
Xawotihs
7eac02f8d4 Trying pip install without sudo 2017-09-06 19:44:00 +02:00
Xawotihs
58e70e2500 replacing sudo pip by sudo -H pip 2017-09-06 19:36:12 +02:00
Xawotihs
56ca2021dc Let's try with openjdk7 2017-09-06 19:18:13 +02:00
Xawotihs
e4e431dcee Let's try jdk_switcher 2017-09-06 00:21:24 +02:00
Xawotihs
abfff205ee Readding ant, it seems the android worker needs it 2017-09-06 00:05:16 +02:00
Xawotihs
6416e4e0d9 Removed ant installation 2017-09-05 23:37:47 +02:00
Xawotihs
86f4730db7 Removings traces and ant errors 2017-09-05 23:06:22 +02:00
Xawotihs
33a5479512 Sounds like JAVA_HOME is wrong, let's try to use the default one 2017-09-05 22:59:06 +02:00
Xawotihs
891859f4ca Let's display ant errors 2017-09-05 22:48:06 +02:00
Xawotihs
d5bfb8201b Some echo traces 2017-09-05 22:36:19 +02:00
Xawotihs
f49ef92f90 sudo required on linux 2017-09-05 22:26:38 +02:00
Xawotihs
02d004b5bf Fixed os in build matrix for Android 2017-09-05 22:11:24 +02:00
Xawotihs
55f8a8a1d0 Only used brew if osx is defined 2017-09-04 20:16:31 +02:00
Xawotihs
068a69c80b Adding ant as it somehow disappeared ... 2017-09-04 19:43:41 +02:00
Xawotihs
375e66489f Changed memory to be 16 MB 2017-09-03 23:55:43 +02:00
Xawotihs
cbbd034862 Removed chmod on binary 2017-09-03 14:44:45 +02:00
Xawotihs
f7fe948da5 Update psp sdk link, don't install theos for all mac builds 2017-09-03 14:21:15 +02:00
Xawotihs
478ce0863b Replace cmake installation script 2017-09-03 14:04:32 +02:00
Xawotihs
329011460f Update .travis.yml 2017-09-03 13:55:39 +02:00
xawotihs
48ec51a923 Shold fix travis script 2017-09-03 12:49:31 +02:00
xawotihs
9936962c56 Should fix cmake issues on linux 2017-09-03 12:44:30 +02:00
xawotihs
15111d1b20 Merge branch 'master' of https://github.com/WagicProject/wagic into cmake 2017-09-02 21:15:47 +02:00
Xawotihs
2b342ca33b Fixed typo 2016-07-05 23:57:53 +02:00
xawotihs
97e6df7f59 Should fix PSP artifact build and upload 2016-07-05 23:49:33 +02:00
xawotihs
a2bb67a828 Removed duplicate blacklist and added some cache 2016-07-04 23:21:34 +02:00
Xawotihs
d14e28d7b3 Should fix android package upload 2016-07-04 04:18:26 +02:00
xawotihs
0a0ee3cc98 Merge branch 'master' into cmake 2016-07-03 16:44:21 +02:00
Xawotihs
99e6a254e1 Update android package upload 2016-07-01 00:18:44 +02:00
Xawotihs
68714ebad8 Added android SDK tools to path 2016-06-30 23:08:56 +02:00
Xawotihs
48ef4144bc Update .travis.yml 2016-06-30 22:04:08 +02:00
Xawotihs
78a4da4945 Avoid rebuilding after targging 2016-06-30 22:01:17 +02:00
xawotihs
af0861877a Merge branch 'master' into cmake 2016-06-29 21:36:47 +02:00
xawotihs
a23b96ba75 Merge branch 'master' into cmake 2016-06-26 11:25:23 +02:00
Xawotihs
47704f7591 Changed git add cmd 2016-06-26 10:28:50 +02:00
Xawotihs
755f90f38b Updated repo cleanup 2016-06-25 22:53:18 +02:00
Xawotihs
8a56406c19 Added missing REPO variable 2016-06-25 21:03:43 +02:00
xawotihs
887ea94a4d Add execution right to the new script 2016-06-25 20:11:24 +02:00
xawotihs
499b3ddf3e Added a script to upload emscripten build automatically to gh_pages 2016-06-25 16:54:35 +02:00
xawotihs
83e55b1074 Merge branch 'cmake' of https://github.com/WagicProject/wagic into cmake 2016-06-25 11:50:54 +02:00
xawotihs
1f87ed77e4 Fixed windows package and but in SDL frontend 2016-06-25 11:50:07 +02:00
Xawotihs
93b7d210dc Should fix indentation issue 2016-06-24 19:32:32 +02:00
xawotihs
10d9d84f84 Fixed emscripten memory and updated python upload script to include cmake branch 2016-06-23 23:32:57 +02:00
xawotihs
fc9a4d5431 Removed redudant builds and removed -j4 to try to compile emscripten 2016-06-23 21:20:12 +02:00
Xawotihs
4b3a2531a6 Switched to debug emscripten build 2016-06-23 08:20:24 +02:00
Xawotihs
ed4871548e Decreased optimisation level to avoid crashes 2016-06-23 07:48:11 +02:00
xawotihs
1284b8da8b Should fix emscripten build in Travis 2016-06-22 22:19:09 +02:00
Xawotihs
95455603a1 Tries to build emscripten on linux as macosx fails 2016-06-21 23:45:37 +02:00
xawotihs
813c54a166 Removed GL_CLAMP usage, update of the Android cmake package file 2016-06-19 12:46:17 +02:00
xawotihs
fa2a2d51a5 Fixed Downloader. 2016-06-19 12:08:45 +02:00
xawotihs
4b68b636ce Merge branch 'master' into cmake 2016-06-19 11:39:56 +02:00
xawotihs
0a01b0af69 Tries to fix SDL and Qt builds, introduces Emscripten in Travis. 2016-06-19 10:25:22 +02:00
xawotihs
e4e809f3fe Emscripten seems to work, should also fix PSP and Qt builds 2016-06-19 00:41:35 +02:00
xawotihs
1667b79fa8 Improved Emscripten port... still not there yet. 2016-06-18 17:24:51 +02:00
Xawotihs
31272ff0fe Removed suspicious references to thirdparty libs 2016-06-11 14:29:48 +02:00
xawotihs
9335063d68 Should fix PSP build and Windows ZIP creation 2016-06-09 21:26:11 +02:00
xawotihs
39dfaf3acb Forgot this file 2016-06-08 23:47:53 +02:00
xawotihs
3e7ecd51fd Fixed windows SDL2 build, finished removing fmod dependency 2016-06-08 23:45:42 +02:00
xawotihs
c9ee4a304e Merge branch 'master' into cmake 2016-06-07 23:35:26 +02:00
xawotihs
2f1bf7bdbe Fixed iOS build 2016-06-07 23:31:42 +02:00
xawotihs
41890f6bb4 Removed main() function in zipFS 2016-06-07 22:49:59 +02:00
xawotihs
24cd7cab58 Merges iOS modifications with Windows modifications 2016-06-07 22:48:02 +02:00
xawotihs
473d9387d4 Removed references to fmod libs for Windows builds 2016-06-07 21:00:15 +02:00
Xawotihs
f5495adce1 Enable _DEBUG in debug only 2016-06-06 22:52:39 +02:00
Xawotihs
d802ec4b59 Fixed theos path 2016-06-04 22:05:04 +02:00
xawotihs
8f69e2a204 Should fix iOS build 2016-06-04 21:44:35 +02:00
xawotihs
c3fc579907 Pulled down update for SDL2 2016-05-29 18:01:51 +02:00
Xawotihs
cc06370bcd Update CMakeLists.txt 2015-11-24 00:14:48 +01:00
Xawotihs
ed15ec2469 Fixed issue in SDL2 replacement. 2015-11-23 10:15:47 +01:00
Xawotihs
3f7d5ff041 Decreased -j option for Android 2015-11-22 22:37:55 +01:00
Xawotihs
d5bcf40cbb Replaced SDL2 flavor when compiling for Android 2015-11-22 21:30:58 +01:00
ubuntu
49c196814f Couple of fixed around Android build with cmake. 2015-11-22 02:22:44 +01:00
Xawotihs
c4282ce936 Update android.toolchain.cmake 2015-11-21 14:02:06 +01:00
Xawotihs
cd1c09127f Removed dependencies on Boost on Android 2015-11-20 12:59:26 +01:00
xawotihs
9afebe0851 Removed sdl_main_android.cpp 2015-11-19 22:38:06 +01:00
Xawotihs
9a7382ea06 Added ANDROID_NDK variable for cmake toolchain 2015-11-18 23:57:55 +01:00
Xawotihs
7a7e723009 Fixed android cmake usage 2015-11-18 23:36:39 +01:00
Xawotihs
9d772284cc Removed any sudo actions on Android 2015-11-18 23:22:45 +01:00
Xawotihs
a981761deb Trying to activate android build in matrix 2015-11-18 22:59:17 +01:00
Xawotihs
fc13ffa242 Update appveyor.yml 2015-11-17 23:31:33 +01:00
Xawotihs
878b2cd639 Update FindOrBuild.cmake 2015-11-17 23:16:51 +01:00
Xawotihs
995922d2d7 Update appveyor.yml 2015-11-17 22:54:53 +01:00
Xawotihs
0d100aa9be Update appveyor.yml 2015-11-17 22:54:18 +01:00
Xawotihs
d4fabed317 Split android sdk update in 4 2015-11-17 22:01:54 +01:00
Xawotihs
9eff781103 Update travis-script.sh 2015-11-16 23:20:20 +01:00
Xawotihs
0353da3d27 Update travis-script.sh 2015-11-16 22:56:30 +01:00
xawotihs
3cbdc6e9fe Merge branch 'cmake' of https://github.com/WagicProject/wagic into cmake 2015-11-04 22:33:26 +01:00
xawotihs
ce71afd704 Tries to activate zlib compiling on mac 2015-11-04 22:32:49 +01:00
Xawotihs
603d491bed Without quotes 2015-11-03 23:06:14 +01:00
Xawotihs
20a792f135 Refering DXSDK and not windows SDK 2015-11-03 23:02:12 +01:00
xawotihs
87f5e7f3a6 Emscripten flavor now compiles correctly 2015-11-02 23:00:57 +01:00
xawotihs
e272925f3d Removed extra/stdint.h 2015-11-02 00:00:26 +01:00
xawotihs
19091ade7b Updated appveyor to use SDL2.0.3 release and not SDL head. 2015-11-01 23:51:07 +01:00
xawotihs
e62c065e2c Should fix git submodules 2015-11-01 23:34:03 +01:00
xawotihs
2312381b82 Updated git submodules 2015-11-01 23:26:03 +01:00
xawotihs
639942d444 Merge branch 'master' into cmake 2015-11-01 22:55:08 +01:00
xawotihs
55a5b9d0ba Now uses unofficial SDL mirror 2015-11-01 22:49:14 +01:00
Xawotihs
a33517e5d0 Added prefix variable so that QT5 is found with brew 2015-10-31 23:02:31 +01:00
Xawotihs
c981586bcf Moved apt-get of Qt into linux part 2015-10-31 21:45:36 +01:00
Xawotihs
b473238f02 Replaced all " 2015-10-31 21:02:29 +01:00
Xawotihs
1d9b92080f Missed on " 2015-10-31 20:56:23 +01:00
Xawotihs
7f89d4d39f Uses "" everywhere 2015-10-31 20:51:12 +01:00
Xawotihs
4f00ec2277 Added matrix subsection in env 2015-10-31 20:37:54 +01:00
Xawotihs
26db10a083 Removed empty lines 2015-10-31 20:32:18 +01:00
xawotihs
3ec2ceb725 Activate matrix and multi-os in travis 2015-10-31 20:15:47 +01:00
xawotihs
667ac39e06 Removed reference to x64 platform 2015-10-25 18:07:30 +01:00
xawotihs
993d62a8c8 Added checkout of modules 2015-10-25 17:59:40 +01:00
xawotihs
09a70d4573 Merge branch 'cmake' of https://github.com/WagicProject/wagic into cmake 2015-10-25 17:30:59 +01:00
xawotihs
3afa730751 Updated appveyor to use cmake 2015-10-25 17:29:33 +01:00
Xawotihs
3245ddbfe7 Reducing the -j parameter to try helping g++ internal compiler issues 2015-10-25 10:51:34 +01:00
xawotihs
def55943ed Activated building SDL2 directly from submodule on Unix as well 2015-10-25 10:18:21 +01:00
xawotihs
4accc9c018 Merge branch 'master' into cmake 2015-10-25 00:22:57 +02:00
xawotihs
579d612397 Worked on windows and emscripten builds, still not perfect. 2015-10-24 23:33:31 +02:00
Xawotihs
daabce1d2f Merge pull request #647 from ZobyTwo/opencv_leftovers
Remove some leftovers from OpenCV
2015-10-17 21:46:47 +02:00
Tobias Loose
5885829585 Remove some leftovers from OpenCV 2015-10-17 18:12:31 +02:00
xawotihs
3e7b9e68d5 Fixed compilation issue with Qt. 2015-10-13 23:32:56 +02:00
Xawotihs
4a52139457 Update g++ to 4.8 2015-10-13 23:04:58 +02:00
xawotihs
79ea403273 Commented out GLUT dependency 2015-10-11 15:54:32 +02:00
xawotihs
397d7fa6c8 Added build of SDL2 in UNIX config 2015-10-11 15:31:58 +02:00
xawotihs
ac787a6f51 Added SDL2DIR env variable. 2015-10-11 15:20:27 +02:00
xawotihs
0418e77d34 Removed tabs 2015-10-11 14:29:59 +02:00
xawotihs
a2c6a3669b Reactivated SDL2 download 2015-10-11 14:27:40 +02:00
xawotihs
b8d22240a8 Fixed typo 2015-10-11 14:21:09 +02:00
xawotihs
b458d570a1 Deactivated again Android build, added a SDL build 2015-10-11 14:15:43 +02:00
xawotihs
5022df0d14 Moved tgz unpackaging away from android SDK update. 2015-10-11 12:34:52 +02:00
xawotihs
220b48b144 Updated android SDK and build tools versions 2015-10-11 12:14:58 +02:00
xawotihs
8aeed46181 Reactivates android build 2015-10-11 11:54:40 +02:00
xawotihs
38b34eae2f Split macosx config from unix one. 2015-10-11 11:38:32 +02:00
xawotihs
648b21f972 Trying something else with new repositories 2015-10-11 10:38:40 +02:00
xawotihs
09717a966b Added install of cmake 3.3 on Travis. 2015-10-11 10:08:33 +02:00
xawotihs
eef46fe743 Revert previous change and just removed inline on the function 2015-10-10 18:41:43 +02:00
xawotihs
5f91566fa7 Move vrelptr implementation in header file so that it can be used outside of JGE lib 2015-10-10 18:35:33 +02:00
xawotihs
c83a476ebe Put SwizzlePlot in the WFont header. 2015-10-10 18:23:59 +02:00
xawotihs
954bba274c Tries to fix includes 2015-10-10 18:08:45 +02:00
xawotihs
d370a5c13d Fixed png include in JGE 2015-10-10 16:15:45 +02:00
xawotihs
181189bee0 Fixed boost include path 2015-10-10 16:05:34 +02:00
xawotihs
c678f5e85a Fixed vram 2015-10-10 15:32:01 +02:00
xawotihs
0fabf83c62 Fixed decoder_prx 2015-10-10 15:25:08 +02:00
xawotihs
b7e8d19290 Fix for travis build 2015-10-10 15:15:43 +02:00
Xawotihs
d0db71602a Deactive android build as travis does not like it those days 2015-10-10 14:51:40 +02:00
Xawotihs
112efddb4e Removed typo 2015-10-09 13:32:51 +02:00
Xawotihs
4cea81e564 Moved SDL2 download away from the Android SDK download 2015-10-09 07:56:44 +02:00
Xawotihs
3a40a34566 should fix script syntax 2015-10-08 23:33:17 +02:00
Xawotihs
a4ff87a7d5 Replaced libsdl2-dev dependency by a direct download 2015-10-08 23:29:47 +02:00
xawotihs
797077c47b Various fixes and activated cmake in travis. 2015-10-08 23:08:09 +02:00
xawotihs
075d950249 Got SDL2 version compiling on Mac. 2015-10-06 23:25:40 +02:00
xawotihs
22d14b2a4f - Updated SDL dependency to SDL2
- fixed compilation issues with cmake and visual studio 2015
2015-10-04 23:10:45 +02:00
xawotihs
4272e2e2b2 Activated zlib build only on windows 2015-09-28 19:39:26 +02:00
xawotihs
34279cfacf Additional work with cmake on Windows, still does not work 2015-09-27 23:23:31 +02:00
xawotihs
85f4a4c36a Started to merge @ZobyTwo cmake branch 2015-09-26 21:52:07 +02:00
3267 changed files with 11745 additions and 14209 deletions

9
.gitmodules vendored
View File

@@ -1,3 +1,12 @@
[submodule "thirdparty/zlib"]
path = thirdparty/zlib
url = https://github.com/madler/zlib
[submodule "thirdparty/SDL2"]
path = thirdparty/SDL2
url = https://github.com/libsdl-org/SDL
[submodule "docs/wiki"]
path = docs/wiki
url = https://github.com/WagicProject/wagic.wiki
[submodule "thirdparty/curl"]
path = thirdparty/curl
url = https://github.com/curl/curl.git

View File

@@ -1,79 +1,159 @@
language: cpp
dist: xenial
branches:
only:
- master
except:
- latest-master
- latest-cmake
matrix:
include:
- os: linux
env: BUILD_TYPE=PSP
sudo: required
- os: linux
env: BUILD_TYPE=SDL
sudo: required
- os: linux
env: BUILD_TYPE=Qt
sudo: required
- os: osx
env: BUILD_TYPE=Qt
- os: osx
env: BUILD_TYPE=iOS
- os: linux
language: android
env: BUILD_TYPE=ANDROID
sudo: required
- os: osx
env: BUILD_TYPE=Emscripten
android:
components:
- platform-tools
- build-tools-23.0.1
- android-10
cache:
directories:
- opt/pspsdk
- android-ndk-r9
before_install:
- export BUILD_PSP=YES
- export BUILD_ANDROID=YES
- export BUILD_Qt=YES
- export BUILD_MAC=NO
- echo -e "machine github.com\n login $GH_TOKEN2" > ~/.netrc
- git lfs pull
# Only building on Mac when not handling pull request
# - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
# export BUILD_MAC=YES;
# fi
- sudo apt-get update -qq
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty universe" &&
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty main" &&
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test &&
sudo apt-get -qq update &&
sudo apt-get -qq install g++-4.8 &&
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update &&
brew install dpkg &&
pwd &&
ls;
fi
- if [ "$BUILD_TYPE" == "iOS" ]; then
curl -s -f -L https://raw.github.com/r-plus/dotfiles/master/install_theos.sh | bash &&
pwd &&
ls;
fi
# Building for PSP here
- if [ "$BUILD_PSP" == "YES" ]; then
- if [ "$BUILD_TYPE" == "PSP" ]; then
export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk" &&
export PSPSDK="$PSPDEV/psp/sdk" &&
export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin" &&
wget --no-check-certificate -O sdk.lzma http://downloads.sourceforge.net/project/minpspw/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma;
wget -O sdk.lzma https://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download;
fi
# Building for Android here
- if [ "$BUILD_TYPE" == "ANDROID" ]; then
export ANDROID="/usr/local/android-sdk-linux/tools/android" &&
export PATH=$PATH:"/usr/local/android-sdk-linux/tools" &&
wget https://dl.google.com/android/repository/android-ndk-r22-linux-x86_64.zip -nv &&
wget https://bitbucket.org/ewing/sdl_androidcmake/get/4e9e88c03f04.zip -nv;
fi
# Building for Qt here
- if [ "$BUILD_Qt" == "YES" ]; then
- if [ "$BUILD_TYPE" == "Qt" ] && [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew install qt5 &&
export QMAKE="qmake -qt=qt5";
fi
- if [ "$BUILD_TYPE" == "Qt" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu xenial universe" &&
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu xenial main" &&
sudo apt-get -qq update &&
sudo apt-get -qq install qt5-qmake qtbase5-dev qtdeclarative5-dev qttools5-dev qtmultimedia5-dev libqt5opengl5 libqt5opengl5-dev pulseaudio libpulse-dev &&
export QMAKE="qmake -qt=qt5";
fi
# Building for Android here
- if [ "$BUILD_ANDROID" == "YES" ]; then
export ANDROID="android-sdk-linux/tools/android" &&
if [ `uname -m` = x86_64 ]; then
sudo dpkg --add-architecture i386 && sudo apt-get update &&
sudo apt-get install -qq --force-yes libgd2-xpm-dev libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 jq ant; fi &&
wget https://dl.google.com/android/repository/android-ndk-r22-linux-x86_64.zip -nv &&
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz -nv;
# Building for SDL here
- if [ "$BUILD_TYPE" == "SDL" ]; then
export SDL2DIR="$TRAVIS_BUILD_DIR/thirdparty/SDL2";
fi
# Building for Emscripten here
- if [ "$BUILD_TYPE" == "Emscripten" ] && [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew install emscripten && export LLVM=/usr/local/opt/emscripten/libexec/llvm/bin && emcc;
fi
install:
- if [ "$BUILD_PSP" == "YES" ]; then
tar -x --xz -f sdk.lzma;
fi
- if [ "$BUILD_ANDROID" == "YES" ]; then
unzip android-ndk-r22-linux-x86_64.zip &&
tar -zxf android-sdk_r24.4.1-linux.tgz &&
$ANDROID list sdk --extended -a &&
echo yes | $ANDROID update sdk -a -t tools,platform-tools,build-tools-23.0.1,android-23 --no-ui --force --no-https;
sudo apt-get install openjdk-8-jdk;
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64;
export PATH=$JAVA_HOME/bin:$PATH;
fi
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
if [[ -z "$(ls -A ${DEPS_DIR}/cmake/bin)" ]]; then
CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
mkdir -p cmake && travis_retry wget --no-check-certificate --quiet -O - "${CMAKE_URL}" | tar --strip-components=1 -xz -C cmake
fi
export PATH="${DEPS_DIR}/cmake/bin:${PATH}"
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
if ! brew ls --version cmake &>/dev/null; then brew install cmake; fi
fi
- if [ "$BUILD_TYPE" == "PSP" ]; then
tar -x --xz -f sdk.lzma;
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_TYPE" == "ANDROID" ]; then
jdk_switcher use openjdk7 %%
tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 &&
export ANDROID_NDK=`pwd`/android-ndk-r9 &&
unzip 4e9e88c03f04.zip &&
rm -rf thirdparty/SDL2/* &&
mv ewing-sdl_androidcmake-4e9e88c03f04/* thirdparty/SDL2/ &&
sudo pip install cpp-coveralls &&
sudo apt-get install --force-yes -qq libtinyxml-dev libjpeg-dev libpng-dev libgif-dev libz-dev libboost-system-dev libboost-thread-dev libboost-date-time-dev ant;
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_TYPE" != "ANDROID" ]; then
jdk_switcher use openjdk7 &&
sudo pip install cpp-coveralls &&
sudo apt-get install --force-yes -qq libtinyxml-dev libjpeg-dev libpng-dev libgif-dev libz-dev libboost-system-dev libboost-thread-dev libboost-date-time-dev ant;
fi
- sudo pip install pyjavaproperties
- sudo pip install github3.py
env:
global:
# - JAVA_HOME=/usr/lib/jvm/java-7-oracle # Force set JVM version to comply with Travis Ant version (1.8.2)
- secure: "EBzr1+qjQsOhn0s+tcFmXR1jP9B0xiOSXuXbRXWZ1OEHNvp8+A5/pS84LYVFlaZqmxr5dApxvPtwhgLIUbQ3EPXm8LpC3KgSD4dS+9/QMbxhe5TK4oczgFRGcDTMJQZsCzhOh7hp3tbcbJg5Gp+VT7aFjFQSHDGwhzSJXsXwh/8="
- secure: "X5dTQfofqAutnXxmu11Ep2MQ5QYnMN8m0AITRtwymhEF2UclcOudI1+skPtuhAGbWQnSO+lhunV3cvMfw2/Ml3k/VDz6VdFSKFrzAu7ja1VLJfcxr7chi0s8q30pVBb66tGydjIBac3B+RQyqgmZQW1frbRrhC/kPFQ6wPWOJdQ="
- secure: "T97NUPnxCpVZ/c5HH0zfo0FO3DPSRMSmze58ubW5EUTZOjAMtEt+OFdsrNZvUTCugUj2M1agtonZbAbczpaAL+lgZcHDgXgWMkfO0pMnsWX1yyCNqMuE/iTMpJr/xsLQeyWlftWjJLsseQU45abZsd1XVmda/G+ZhrDLF1y55SA="
- curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
- sudo python2 get-pip.py
- sudo python2 -m pip install --upgrade pip
- sudo python2 -m pip install setuptools-rust
- sudo python2 -m pip install pyOpenSSL
- sudo python2 -m pip install pyjavaproperties
- sudo python2 -m pip install github3.py
- sudo python2 -m pip install cpp-coveralls
- sudo python2 -m pip install certifi
before_script:
- export REQUESTS_CA_BUNDLE=/usr/local/lib/python2.7/dist-packages/certifi/cacert.pem
script: "tools/travis-script.sh"
after_success:
- coveralls -b . -e JGE/src -e JGE/include -i projects/mtg/include -i projects/mtg/src --gcov-options '\-lp'
- export VERSION=$(grep "=" projects/mtg/build.number.properties | sed 's/.*=//' | tr -d '\n\t\r ')
- python2 tools/upload-binaries.py -t $GH_TOKEN2 -s $TRAVIS_COMMIT -l core.zip -r Wagic-core-$VERSION.zip -b $TRAVIS_BRANCH
- python2 tools/upload-binaries.py -t $GH_TOKEN2 -s $TRAVIS_COMMIT -l projects/mtg/Android/bin/Wagic-debug.apk -r Wagic-$VERSION.apk -b $TRAVIS_BRANCH
- python2 tools/upload-binaries.py -t $GH_TOKEN2 -s $TRAVIS_COMMIT -l projects/mtg/psprelease.zip -r WagicPSP-$VERSION.zip -b $TRAVIS_BRANCH
- python2 tools/upload-binaries.py -t $GH_TOKEN2 -s $TRAVIS_COMMIT -l qt-gui-build/linuxqtrelease.zip -r WagicLinux-$VERSION.zip -b $TRAVIS_BRANCH
- python2 tools/upload-binaries.py -t $GH_TOKEN2 -s $TRAVIS_COMMIT -l projects/mtg/CardImageLinks.csv -r CardImageLinks.csv -b $TRAVIS_BRANCH
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_TYPE" == "Qt" ]; then
coveralls -b . -e JGE/src -e JGE/include -i projects/mtg/include -i projects/mtg/src --gcov-options '\-lp';
fi
- if [ "$BUILD_TYPE" == "ANDROID" ]; then
python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH &&
python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l build_android/package/bin/Wagic_*.apk -r Wagic-android.apk -b $TRAVIS_BRANCH;
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_TYPE" == "PSP" ]; then
python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l build_psp/psprelease.zip -r Wagic-psp.zip -b $TRAVIS_BRANCH;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$BUILD_TYPE" == "iOS" ]; then
python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l net.wagic_0.19.2-1_iphoneos-arm.deb -r Wagic-iOS.deb -b $TRAVIS_BRANCH;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$BUILD_TYPE" == "Qt" ]; then
python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l build_qt_widget/wagic.dmg -r Wagic-macosx.dmg -b $TRAVIS_BRANCH;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] && [ "$BUILD_TYPE" == "Emscripten" ]; then
./tools/deploy-emscripten.sh;
fi

242
CMakeLists.txt Normal file
View File

@@ -0,0 +1,242 @@
cmake_minimum_required(VERSION 4.0)
if(CMAKE_MAJOR_VERSION STRGREATER 3)
cmake_policy(SET CMP0054 NEW)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeModules)
#this block will fix install prefixes to install everything in a subdirectory
#of cmake_binary_dir if we are on windows/android to make packaging more easy
if(NOT CMAKE_TOOLCHAIN_FILE)
if(WIN32)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Install directory")
else()
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Install directory")
endif()
else() #we are cross-compiling (psp/android)
#Android: set output folder for platform/android to pick up
set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH "library output root")
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Install directory")
endif()
#set available build types (debug/release)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
if(DEFINED CMAKE_BUILD_TYPE)
set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
endif()
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin" CACHE PATH "Application output directory")
project(wagic CXX C)
#todo: somehow determine wagics version
set(WAGIC_VERSION "0.19")
#add standard paths to search for libraries. borrowed from opencv
if(UNIX AND NOT ANDROID)
if(X86_64 OR CMAKE_SIZEOF_VOID_P EQUAL 8)
if(EXISTS /lib64)
list(APPEND CMAKE_LIBRARY_PATH /lib64)
else()
list(APPEND CMAKE_LIBRARY_PATH /lib)
endif()
if(EXISTS /usr/lib64)
list(APPEND CMAKE_LIBRARY_PATH /usr/lib64)
else()
list(APPEND CMAKE_LIBRARY_PATH /usr/lib)
endif()
elseif(X86 OR CMAKE_SIZEOF_VOID_P EQUAL 4)
if(EXISTS /lib32)
list(APPEND CMAKE_LIBRARY_PATH /lib32)
else()
list(APPEND CMAKE_LIBRARY_PATH /lib)
endif()
if(EXISTS /usr/lib32)
list(APPEND CMAKE_LIBRARY_PATH /usr/lib32)
else()
list(APPEND CMAKE_LIBRARY_PATH /usr/lib)
endif()
endif()
endif()
if(ANDROID OR PSP OR IOS)
#to allow finding of pathes/headers/libs within the source tree
#even if only search for target platform libs
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SOURCE_DIR} ${CMAKE_FIND_ROOT_PATH})
endif()
#also borrowed from opencv
if(MINGW)
if(EXISTS /mingw)
list(APPEND CMAKE_INCLUDE_PATH /mingw)
endif()
if(EXISTS /mingw32)
list(APPEND CMAKE_INCLUDE_PATH /mingw32)
endif()
if(EXISTS /mingw64)
list(APPEND CMAKE_INCLUDE_PATH /mingw64)
endif()
endif()
include(utils)
#select the target backend
if(PSP)
WAGIC_OPTION(backend_psp "build for psp" ON)
endif()
if(WIN32 OR ANDROID OR UNIX)
WAGIC_OPTION(backend_sdl "build for sdl" (WIN32 OR ANDROID OR EMSCRIPTEN))
endif()
if(NOT backend_sdl AND UNIX AND NOT ANDROID AND NOT IOS)
WAGIC_OPTION(backend_qt_console "build qt-console version with testsuit" ON)
WAGIC_OPTION(backend_qt_widget "build qt-widget version" OFF)
endif()
#third party build options
WAGIC_OPTION(BUILD_ZLIB "build zlib from source" ((NOT MINGW) AND (WIN32 OR APPLE)))
WAGIC_OPTION(BUILD_JPEG "build jpeg from source" (WIN32 OR APPLE OR PSP OR ANDROID OR EMSCRIPTEN))
WAGIC_OPTION(BUILD_PNG "build png from source" (WIN32 OR APPLE OR PSP OR ANDROID OR EMSCRIPTEN))
WAGIC_OPTION(BUILD_UNZIP "build unzip from source" ON)
WAGIC_OPTION(BUILD_TINYXML "build tinyxml from source" (WIN32 OR APPLE OR PSP OR ANDROID OR EMSCRIPTEN OR IOS))
WAGIC_OPTION(BUILD_ZIPFS "build zipfs from source" ON)
WAGIC_OPTION(BUILD_SDL2 "build SDL2 from source" (backend_sdl AND (UNIX OR WIN32 OR ANDROID) AND (NOT EMSCRIPTEN AND NOT IOS)))
#WAGIC_OPTION(BUILD_CURL "build curl from source" (backend_sdl AND WIN32))
#project options
if(ANDROID)
WAGIC_OPTION(BUILD_ANDROID_PACKAGE "put the compiled code in an android package" ON)
endif()
if(ANDROID)
set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
set(3P_LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/3rdparty/lib/${ANDROID_NDK_ABI_NAME}")
set(WAGIC_LIB_INSTALL_PATH sdk/native/libs/${ANDROID_NDK_ABI_NAME})
set(WAGIC_3P_LIB_INSTALL_PATH sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME})
set(WAGIC_CONFIG_INSTALL_PATH sdk/native/jni)
set(WAGIC_INCLUDE_INSTALL_PATH sdk/native/jni/include)
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/package/bin")
else()
set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")
set(3P_LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
set(WAGIC_LIB_INSTALL_PATH lib${LIB_SUFFIX})
set(WAGIC_3P_LIB_INSTALL_PATH share/wagic/3rdparty/${WAGIC_LIB_INSTALL_PATH})
set(WAGIC_INCLUDE_INSTALL_PATH "include")
set(WAGIC_CONFIG_INSTALL_PATH share/wagic)
endif()
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${WAGIC_LIB_INSTALL_PATH}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
#if no build type is specified, we assume debug
if(CMAKE_GENERATOR MATCHES "Makefiles|Ninja" AND "${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE Debug)
endif()
include(FindOrBuild)
#set platform dependend configurations
if(PSP)
FindOrBuildPSPSDK()
include(platforms/psp/configure.cmake)
elseif(EMSCRIPTEN)
include(platforms/emscripten/configure.cmake)
elseif(WIN32)
include(platforms/win/configure.cmake)
elseif(APPLE)
include(platforms/macosx/configure.cmake)
elseif(UNIX AND NOT ANDROID)
include(platforms/unix/configure.cmake)
elseif(ANDROID)
include(platforms/android/configure.cmake)
endif()
#set backend dependend configurations
if(backend_qt_console OR backend_qt_widget)
add_definitions(-DQT_CONFIG)
if(backend_qt_console)
add_definitions(-DTESTSUITE -D_DEBUG)
add_definitions(-DCONSOLE_CONFIG -DCAPTURE_STDERR)
endif()
elseif(backend_sdl)
add_definitions(-DSDL_CONFIG)
endif()
# find or build 3rd party libraries
FindOrBuildZLIB()
FindOrBuildOpenGL()
FindOrBuildTinyXML()
FindOrBuildZipFS()
FindOrBuildUNZIP()
FindOrBuildPNG()
FindOrBuildJPEG()
FindOrBuildBoost()
#FindOrBuildCurl()
if(PSP)
FindOrBuildGIF()
endif()
if(ANDROID)
FindOrBuildOpenSL()
endif()
if(backend_sdl)
FindOrBuildSDL2()
endif()
if(backend_psp)
FindOrBuildFreetype()
FindOrBuildHgeTools()
FindOrBuildMikMod()
endif()
if(backend_qt_console OR backend_qt_widget)
FindOrBuildQt()
endif()
if(ANDROID)
include(DetectAndroidSDK)
endif()
if(BUILD_ANDROID_PACKAGE)
find_package(Ant REQUIRED)
endif()
#add jge and mtg projects
add_subdirectory(JGE)
add_subdirectory(projects/mtg)
if(BUILD_ANDROID_PACKAGE)
add_subdirectory(platforms/android/package)
endif()
if(EMSCRIPTEN)
set(CMAKE_EXECUTABLE_SUFFIX ".html")
endif()
if(IOS)
list_add_prefix(JGE_SOURCES " JGE/")
list_add_prefix(MTG_generic_src " projects/mtg/")
list_add_prefix(JGE_INCLUDE_DIRS " -IJGE/")
list_add_prefix(MTG_INCLUDE_DIRS " -Iprojects/mtg/")
list_add_prefix(TINYXML_SRC " thirdparty/tinyxml/")
list_add_prefix(UNZIP_SRC " thirdparty/unzip/")
list_add_prefix(ZIPFS_SRC " thirdparty/zipFS/")
file(WRITE makefile.ios
"ARCHS= armv7 armv7s \n"
"include ${THEOS_PATH}/makefiles/common.mk\n"
"TARGET= iphone:clang:latest:8.0 \n"
"APPLICATION_NAME = " ${PROJECT_NAME} "\n"
${PROJECT_NAME} "_FILES =" ${ZIPFS_SRC} ${UNZIP_SRC} ${TINYXML_SRC} ${JGE_SOURCES} ${MTG_generic_src} " thirdparty/Boost/lib/pthread/once.cpp thirdparty/Boost/lib/pthread/thread.cpp\n"
${PROJECT_NAME} "_LDFLAGS = -lz\n"
${PROJECT_NAME} "_FRAMEWORKS = UIKit CoreGraphics OpenGLES Foundation CFNetwork MobileCoreServices AVFoundation OpenAL AudioToolbox QuartzCore SystemConfiguration\n"
"include ${THEOS_PATH}/makefiles/application.mk\n"
"ADDITIONAL_CFLAGS = " ${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} " -I" ${ZIPFS_INCLUDE_DIR} " -I" ${UNZIP_INCLUDE_DIR} " -I" ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} " -I" ${ZLIB_INCLUDE_DIRS} ${BOOST_INCLUDE_DIRS} " "
"-DIOS -D__arm__ -DTIXML_USE_STL -DVERSION=\"$(GIT_VERSION)\" "
"-Wno-parentheses-equality -Wno-delete-non-virtual-dtor "
"-Wno-tautological-undefined-compare -Wno-undefined-bool-conversion "
"-Wno-visibility -Wno-deprecated-declarations -Wno-non-literal-null-conversion "
"-Wno-format -Wno-distributed-object-modifiers -Wno-missing-braces -Wno-uninitialized "
"-Wno-unused-const-variable -Wno-unused-function -Wno-unknown-warning-option -Wno-unused-local-typedef "
"-x objective-c++ \n"
"_THEOS_TARGET_ONLY_OBJCFLAGS :=\"\"\n"
)
endif()

View File

@@ -0,0 +1,373 @@
if(EXISTS "${ANDROID_EXECUTABLE}")
set(ANDROID_SDK_DETECT_QUIET TRUE)
endif()
file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles_ENV_PATH)
file(TO_CMAKE_PATH "$ENV{HOME}" HOME_ENV_PATH)
if(CMAKE_HOST_WIN32)
set(ANDROID_SDK_OS windows)
elseif(CMAKE_HOST_APPLE)
set(ANDROID_SDK_OS macosx)
else()
set(ANDROID_SDK_OS linux)
endif()
#find android SDK: search in ANDROID_SDK first
find_host_program(ANDROID_EXECUTABLE
NAMES android.bat android
PATH_SUFFIXES tools
PATHS
ENV ANDROID_SDK
DOC "Android SDK location"
NO_DEFAULT_PATH
)
# Now search default paths
find_host_program(ANDROID_EXECUTABLE
NAMES android.bat android
PATH_SUFFIXES android-sdk-${ANDROID_SDK_OS}/tools
android-sdk-${ANDROID_SDK_OS}_x86/tools
android-sdk-${ANDROID_SDK_OS}_86/tools
android-sdk/tools
PATHS /opt
"${HOME_ENV_PATH}/NVPACK"
"$ENV{SystemDrive}/NVPACK"
"${ProgramFiles_ENV_PATH}/Android"
DOC "Android SDK location"
)
if(ANDROID_EXECUTABLE)
if(NOT ANDROID_SDK_DETECT_QUIET)
message(STATUS "Found android tool: ${ANDROID_EXECUTABLE}")
endif()
get_filename_component(ANDROID_SDK_TOOLS_PATH "${ANDROID_EXECUTABLE}" PATH)
#read source.properties
if(EXISTS "${ANDROID_SDK_TOOLS_PATH}/source.properties")
file(STRINGS "${ANDROID_SDK_TOOLS_PATH}/source.properties" ANDROID_SDK_TOOLS_SOURCE_PROPERTIES_LINES REGEX "^[ ]*[^#].*$")
foreach(line ${ANDROID_SDK_TOOLS_SOURCE_PROPERTIES_LINES})
string(REPLACE "\\:" ":" line ${line})
string(REPLACE "=" ";" line ${line})
list(GET line 0 line_name)
list(GET line 1 line_value)
string(REPLACE "." "_" line_name ${line_name})
SET(ANDROID_TOOLS_${line_name} "${line_value}" CACHE INTERNAL "from ${ANDROID_SDK_TOOLS_PATH}/source.properties")
MARK_AS_ADVANCED(ANDROID_TOOLS_${line_name})
endforeach()
endif()
#fix missing revision (SDK tools before r9 don't set revision number correctly)
if(NOT ANDROID_TOOLS_Pkg_Revision)
SET(ANDROID_TOOLS_Pkg_Revision "Unknown" CACHE INTERNAL "")
MARK_AS_ADVANCED(ANDROID_TOOLS_Pkg_Revision)
endif()
#fix missing description
if(NOT ANDROID_TOOLS_Pkg_Desc)
SET(ANDROID_TOOLS_Pkg_Desc "Android SDK Tools, revision ${ANDROID_TOOLS_Pkg_Revision}." CACHE INTERNAL "")
MARK_AS_ADVANCED(ANDROID_TOOLS_Pkg_Desc)
endif()
#warn about outdated SDK
if(NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
SET(ANDROID_TOOLS_Pkg_Desc "${ANDROID_TOOLS_Pkg_Desc} It is recommended to update your SDK tools to revision 14 or newer." CACHE INTERNAL "")
endif()
if(ANDROID_TOOLS_Pkg_Revision GREATER 13)
SET(ANDROID_PROJECT_PROPERTIES_FILE project.properties)
SET(ANDROID_ANT_PROPERTIES_FILE ant.properties)
else()
SET(ANDROID_PROJECT_PROPERTIES_FILE default.properties)
SET(ANDROID_ANT_PROPERTIES_FILE build.properties)
endif()
set(ANDROID_MANIFEST_FILE AndroidManifest.xml)
set(ANDROID_LIB_PROJECT_FILES build.xml local.properties proguard-project.txt ${ANDROID_PROJECT_PROPERTIES_FILE})
set(ANDROID_PROJECT_FILES ${ANDROID_LIB_PROJECT_FILES})
#get installed targets
if(ANDROID_TOOLS_Pkg_Revision GREATER 11)
execute_process(COMMAND ${ANDROID_EXECUTABLE} list target -c
RESULT_VARIABLE ANDROID_PROCESS
OUTPUT_VARIABLE ANDROID_SDK_TARGETS
ERROR_VARIABLE ANDROID_PROCESS_ERRORS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REGEX MATCHALL "[^\n]+" ANDROID_SDK_TARGETS "${ANDROID_SDK_TARGETS}")
else()
#old SDKs (r11 and older) don't provide compact list
execute_process(COMMAND ${ANDROID_EXECUTABLE} list target
RESULT_VARIABLE ANDROID_PROCESS
OUTPUT_VARIABLE ANDROID_SDK_TARGETS_FULL
ERROR_VARIABLE ANDROID_PROCESS_ERRORS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REGEX MATCHALL "(^|\n)id: [0-9]+ or \"([^\n]+[0-9+])\"(\n|$)" ANDROID_SDK_TARGETS_FULL "${ANDROID_SDK_TARGETS_FULL}")
SET(ANDROID_SDK_TARGETS "")
if(ANDROID_PROCESS EQUAL 0)
foreach(line ${ANDROID_SDK_TARGETS_FULL})
string(REGEX REPLACE "(^|\n)id: [0-9]+ or \"([^\n]+[0-9+])\"(\n|$)" "\\2" line "${line}")
list(APPEND ANDROID_SDK_TARGETS "${line}")
endforeach()
endif()
endif()
if(NOT ANDROID_PROCESS EQUAL 0)
message(ERROR "Failed to get list of installed Android targets.")
set(ANDROID_EXECUTABLE "ANDROID_EXECUTABLE-NOTFOUND")
endif()
# clear ANDROID_SDK_TARGET if no target is provided by user
if(NOT ANDROID_SDK_TARGET)
set(ANDROID_SDK_TARGET "" CACHE STRING "Android SDK target for the Wagic Java API and samples")
endif()
if(ANDROID_SDK_TARGETS)
set_property( CACHE ANDROID_SDK_TARGET PROPERTY STRINGS ${ANDROID_SDK_TARGETS} )
endif()
endif(ANDROID_EXECUTABLE)
# finds minimal installed SDK target compatible with provided names or API levels
# usage:
# get_compatible_android_api_level(VARIABLE [level1] [level2] ...)
macro(android_get_compatible_target VAR)
set(${VAR} "${VAR}-NOTFOUND")
if(ANDROID_SDK_TARGETS)
list(GET ANDROID_SDK_TARGETS 0 __lvl)
string(REGEX MATCH "[0-9]+$" __lvl "${__lvl}")
#find minimal level mathing to all provided levels
foreach(lvl ${ARGN})
string(REGEX MATCH "[0-9]+$" __level "${lvl}")
if(__level GREATER __lvl)
set(__lvl ${__level})
endif()
endforeach()
#search for compatible levels
foreach(lvl ${ANDROID_SDK_TARGETS})
string(REGEX MATCH "[0-9]+$" __level "${lvl}")
if(__level EQUAL __lvl)
#look for exact match
foreach(usrlvl ${ARGN})
if("${usrlvl}" STREQUAL "${lvl}")
set(${VAR} "${lvl}")
break()
endif()
endforeach()
if("${${VAR}}" STREQUAL "${lvl}")
break() #exact match was found
elseif(NOT ${VAR})
set(${VAR} "${lvl}")
endif()
elseif(__level GREATER __lvl)
if(NOT ${VAR})
set(${VAR} "${lvl}")
endif()
break()
endif()
endforeach()
unset(__lvl)
unset(__level)
endif()
endmacro()
unset(__android_project_chain CACHE)
# add_android_project(target_name ${path} NATIVE_DEPS opencv_core LIBRARY_DEPS ${Wagic_BINARY_DIR} SDK_TARGET 11)
macro(add_android_project target path)
# parse arguments
set(android_proj_arglist NATIVE_DEPS LIBRARY_DEPS SDK_TARGET IGNORE_JAVA IGNORE_MANIFEST)
set(__varname "android_proj_")
foreach(v ${android_proj_arglist})
set(${__varname}${v} "")
endforeach()
foreach(arg ${ARGN})
set(__var "${__varname}")
foreach(v ${android_proj_arglist})
if("${v}" STREQUAL "${arg}")
set(__varname "android_proj_${v}")
break()
endif()
endforeach()
if(__var STREQUAL __varname)
list(APPEND ${__var} "${arg}")
endif()
endforeach()
# get compatible SDK target
android_get_compatible_target(android_proj_sdk_target ${ANDROID_NATIVE_API_LEVEL} ${android_proj_SDK_TARGET})
if(NOT android_proj_sdk_target)
message(WARNING "Can not find any SDK target compatible with: ${ANDROID_NATIVE_API_LEVEL} ${android_proj_SDK_TARGET}
The project ${target} will not be build")
endif()
# check native dependencies
if(android_proj_IGNORE_JAVA)
ocv_check_dependencies(${android_proj_NATIVE_DEPS})
else()
ocv_check_dependencies(${android_proj_NATIVE_DEPS} opencv_java)
endif()
if(EXISTS "${path}/jni/Android.mk" )
# find if native_app_glue is used
file(STRINGS "${path}/jni/Android.mk" NATIVE_APP_GLUE REGEX ".*(call import-module,android/native_app_glue)" )
if(NATIVE_APP_GLUE)
if(ANDROID_NATIVE_API_LEVEL LESS 9 OR NOT EXISTS "${ANDROID_NDK}/sources/android/native_app_glue")
set(OCV_DEPENDENCIES_FOUND FALSE)
endif()
endif()
endif()
if(OCV_DEPENDENCIES_FOUND AND android_proj_sdk_target AND ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND ANDROID_TOOLS_Pkg_Revision GREATER 13 AND EXISTS "${path}/${ANDROID_MANIFEST_FILE}")
project(${target})
set(android_proj_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build")
# get project sources
file(GLOB_RECURSE android_proj_files RELATIVE "${path}" "${path}/res/*" "${path}/src/*")
if(NOT android_proj_IGNORE_MANIFEST)
list(APPEND android_proj_files ${ANDROID_MANIFEST_FILE})
endif()
# copy sources out from the build tree
set(android_proj_file_deps "")
foreach(f ${android_proj_files})
add_custom_command(
OUTPUT "${android_proj_bin_dir}/${f}"
COMMAND ${CMAKE_COMMAND} -E copy "${path}/${f}" "${android_proj_bin_dir}/${f}"
MAIN_DEPENDENCY "${path}/${f}"
COMMENT "Copying ${f}")
list(APPEND android_proj_file_deps "${path}/${f}" "${android_proj_bin_dir}/${f}")
endforeach()
set(android_proj_lib_deps_commands "")
set(android_proj_target_files ${ANDROID_PROJECT_FILES})
ocv_list_add_prefix(android_proj_target_files "${android_proj_bin_dir}/")
# process Android library dependencies
foreach(dep ${android_proj_LIBRARY_DEPS})
file(RELATIVE_PATH __dep "${android_proj_bin_dir}" "${dep}")
list(APPEND android_proj_lib_deps_commands
COMMAND ${ANDROID_EXECUTABLE} --silent update project --path "${android_proj_bin_dir}" --library "${__dep}")
endforeach()
# fix Android project
add_custom_command(
OUTPUT ${android_proj_target_files}
COMMAND ${CMAKE_COMMAND} -E remove ${android_proj_target_files}
COMMAND ${ANDROID_EXECUTABLE} --silent update project --path "${android_proj_bin_dir}" --target "${android_proj_sdk_target}" --name "${target}"
${android_proj_lib_deps_commands}
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}"
DEPENDS "${path}/${ANDROID_MANIFEST_FILE}"
COMMENT "Updating Android project at ${path}. SDK target: ${android_proj_sdk_target}"
)
list(APPEND android_proj_file_deps ${android_proj_target_files})
# build native part
file(GLOB_RECURSE android_proj_jni_files "${path}/jni/*.c" "${path}/jni/*.h" "${path}/jni/*.cpp" "${path}/jni/*.hpp")
ocv_list_filterout(android_proj_jni_files "\\\\.svn")
if(android_proj_jni_files AND EXISTS ${path}/jni/Android.mk AND NOT DEFINED JNI_LIB_NAME)
# find local module name in Android.mk file to build native lib
file(STRINGS "${path}/jni/Android.mk" JNI_LIB_NAME REGEX "LOCAL_MODULE[ ]*:=[ ]*.*" )
string(REGEX REPLACE "LOCAL_MODULE[ ]*:=[ ]*([a-zA-Z_][a-zA-Z_0-9]*)[ ]*" "\\1" JNI_LIB_NAME "${JNI_LIB_NAME}")
if(JNI_LIB_NAME)
ocv_include_modules_recurse(${android_proj_NATIVE_DEPS})
ocv_include_directories("${path}/jni")
if(NATIVE_APP_GLUE)
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
list(APPEND android_proj_jni_files ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
ocv_warnings_disable(CMAKE_C_FLAGS -Wstrict-prototypes -Wunused-parameter -Wmissing-prototypes)
set(android_proj_NATIVE_DEPS ${android_proj_NATIVE_DEPS} android)
endif()
add_library(${JNI_LIB_NAME} MODULE ${android_proj_jni_files})
target_link_libraries(${JNI_LIB_NAME} ${OPENCV_LINKER_LIBS} ${android_proj_NATIVE_DEPS})
set_target_properties(${JNI_LIB_NAME} PROPERTIES
OUTPUT_NAME "${JNI_LIB_NAME}"
LIBRARY_OUTPUT_DIRECTORY "${android_proj_bin_dir}/libs/${ANDROID_NDK_ABI_NAME}"
)
get_target_property(android_proj_jni_location "${JNI_LIB_NAME}" LOCATION)
if (NOT (CMAKE_BUILD_TYPE MATCHES "debug"))
add_custom_command(TARGET ${JNI_LIB_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} --strip-unneeded "${android_proj_jni_location}")
endif()
endif()
endif()
# build java part
if(android_proj_IGNORE_JAVA)
add_custom_command(
OUTPUT "${android_proj_bin_dir}/bin/${target}-debug.apk"
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug
COMMAND ${CMAKE_COMMAND} -E touch "${android_proj_bin_dir}/bin/${target}-debug.apk" # needed because ant does not update the timestamp of updated apk
WORKING_DIRECTORY "${android_proj_bin_dir}"
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}"
DEPENDS ${android_proj_file_deps} ${JNI_LIB_NAME})
else()
add_custom_command(
OUTPUT "${android_proj_bin_dir}/bin/${target}-debug.apk"
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug
COMMAND ${CMAKE_COMMAND} -E touch "${android_proj_bin_dir}/bin/${target}-debug.apk" # needed because ant does not update the timestamp of updated apk
WORKING_DIRECTORY "${android_proj_bin_dir}"
MAIN_DEPENDENCY "${android_proj_bin_dir}/${ANDROID_MANIFEST_FILE}"
DEPENDS "${Wagic_BINARY_DIR}/bin/classes.jar.dephelper" opencv_java # as we are part of Wagic we can just force this dependency
DEPENDS ${android_proj_file_deps} ${JNI_LIB_NAME})
endif()
unset(JNI_LIB_NAME)
add_custom_target(${target} ALL SOURCES "${android_proj_bin_dir}/bin/${target}-debug.apk" )
if(NOT android_proj_IGNORE_JAVA)
add_dependencies(${target} opencv_java)
endif()
if(android_proj_native_deps)
add_dependencies(${target} ${android_proj_native_deps})
endif()
if(__android_project_chain)
add_dependencies(${target} ${__android_project_chain})
endif()
set(__android_project_chain ${target} CACHE INTERNAL "auxiliary variable used for Android progects chaining")
# put the final .apk to the Wagic's bin folder
add_custom_command(TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${android_proj_bin_dir}/bin/${target}-debug.apk" "${Wagic_BINARY_DIR}/bin/${target}.apk")
if(INSTALL_ANDROID_EXAMPLES AND "${target}" MATCHES "^example-")
#apk
install(FILES "${Wagic_BINARY_DIR}/bin/${target}.apk" DESTINATION "samples" COMPONENT main)
get_filename_component(sample_dir "${path}" NAME)
#java part
list(REMOVE_ITEM android_proj_files ${ANDROID_MANIFEST_FILE})
foreach(f ${android_proj_files} ${ANDROID_MANIFEST_FILE})
get_filename_component(install_subdir "${f}" PATH)
install(FILES "${android_proj_bin_dir}/${f}" DESTINATION "samples/${sample_dir}/${install_subdir}" COMPONENT main)
endforeach()
#jni part + eclipse files
file(GLOB_RECURSE jni_files RELATIVE "${path}" "${path}/jni/*" "${path}/.cproject")
ocv_list_filterout(jni_files "\\\\.svn")
foreach(f ${jni_files} ".classpath" ".project" ".settings/org.eclipse.jdt.core.prefs")
get_filename_component(install_subdir "${f}" PATH)
install(FILES "${path}/${f}" DESTINATION "samples/${sample_dir}/${install_subdir}" COMPONENT main)
endforeach()
#update proj
if(android_proj_lib_deps_commands)
set(inst_lib_opt " --library ../../sdk/java")
endif()
install(CODE "EXECUTE_PROCESS(COMMAND ${ANDROID_EXECUTABLE} --silent update project --path . --target \"${android_proj_sdk_target}\" --name \"${target}\" ${inst_lib_opt}
WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/samples/${sample_dir}\"
)" COMPONENT main)
#empty 'gen'
install(CODE "MAKE_DIRECTORY(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/samples/${sample_dir}/gen\")" COMPONENT main)
endif()
endif()
endmacro()

View File

@@ -0,0 +1,13 @@
find_host_program(ANT_EXECUTABLE "ant")
if(ANT_EXECUTABLE)
set(ANT_FOUND ON)
else()
set(ANT_FOUND OFF)
endif()
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ANT REQUIRED_VARS ANT_EXECUTABLE)
mark_as_advanced(ANT_EXECUTABLE ANT_FOUND)

View File

@@ -0,0 +1,29 @@
# - Find OpenSL (actually OpenSLES)
# Find the OpenSLES includes and libraries
#
# OPENSL_INCLUDE_DIR - where to find dsound.h
# OPENSL_LIBRARIES - List of libraries when using dsound.
# OPENSL_FOUND - True if dsound found.
if(OPENSL_INCLUDE_DIR)
# Already in cache, be silent
set(OPENSL_FIND_QUIETLY TRUE)
endif(OPENSL_INCLUDE_DIR)
find_path(OPENSL_INCLUDE_DIR SLES/OpenSLES.h)
find_library(OPENSL_LIBRARY NAMES OpenSLES)
# Handle the QUIETLY and REQUIRED arguments and set OPENSL_FOUND to TRUE if
# all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OPENSL DEFAULT_MSG
OPENSL_INCLUDE_DIR OPENSL_LIBRARY)
if(OPENSL_FOUND)
set(OPENSL_LIBRARIES ${OPENSL_LIBRARY})
else(OPENSL_FOUND)
set(OPENSL_LIBRARIES)
endif(OPENSL_FOUND)
mark_as_advanced(OPENSL_INCLUDE_DIR OPENSL_LIBRARY)

View File

@@ -0,0 +1,267 @@
macro(FindOrBuildZipFS)
if(BUILD_ZIPFS)
add_subdirectory(
${CMAKE_SOURCE_DIR}/thirdparty/zipFS
${CMAKE_BINARY_DIR}/thirdparty/zipFS)
set(ZIPFS_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/zipFS)
set(ZIPFS_LIBRARY zipFS)
else()
message(WARNING "ZIPFS must get build")
endif()
endmacro()
macro(FindOrBuildTinyXML)
if(BUILD_TINYXML)
add_definitions(-DTIXML_USE_STL)
add_subdirectory(
${CMAKE_SOURCE_DIR}/thirdparty/tinyxml
${CMAKE_BINARY_DIR}/thirdparty/tinyxml)
set(TINYXML_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/tinyxml)
set(TINYXML_LIBRARIES tinyxml)
else()
find_package(TinyXML REQUIRED)
endif()
endmacro()
macro(FindOrBuildSDL2)
if(BUILD_SDL2)
if(WIN32)
#SDL2 DirectX build is somehow broken...
set(SDL_AUDIO FALSE)
set(SDL_JOYSTICK FALSE)
set(SDL_HAPTIC FALSE)
# Forcing static build on Windows as SDL2main is often needed and easier to link statically.
# Set SDL_SHARED to OFF *before* adding the subdirectory to influence its build.
set(SDL_SHARED OFF CACHE BOOL "Build SDL2 as a static library" FORCE)
endif()
# Add the subdirectory. This creates targets like SDL2::SDL2, SDL2::SDL2-static, SDL2::SDL2main
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/SDL2 ${CMAKE_BINARY_DIR}/thirdparty/SDL2)
set(SDL2_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/SDL2/include ${CMAKE_BINARY_DIR}/thirdparty/SDL2)
# Linking against SDL2::SDL2 below handles includes automatically.
if(EMSCRIPTEN)
# Emscripten typically uses static linking
set(SDL2_LIBRARY SDL2::SDL2-static) # Use the CMake target
else()
# Link against SDL2 (shared or static based on SDL_SHARED) and SDL2main
# SDL2::SDL2 resolves to the correct shared/static target.
# SDL2::SDL2main is needed on many platforms, especially Windows.
set(SDL2_LIBRARY SDL2::SDL2 SDL2::SDL2main) # Use the CMake targets
endif()
elseif(NOT EMSCRIPTEN)
# If not building from source, use the find_package module
find_package(SDL2)
endif()
endmacro()
macro(FindOrBuildUNZIP)
if(BUILD_UNZIP)
add_subdirectory(
${CMAKE_SOURCE_DIR}/thirdparty/unzip
${CMAKE_BINARY_DIR}/thirdparty/unzip)
set(UNZIP_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/unzip)
set(UNZIP_LIBRARY unzip)
else()
message(WARNING "UNZIP must get build")
endif()
endmacro()
macro(FindOrBuildBoost)
if(PSP OR UNIX OR WIN32 OR IOS)
#the psp build does not need more than a few headers
#todo: remove from the repository
set(BOOST_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/Boost)
# elseif(WIN32)
#set BOOST_ROOT to the root of boost
# set(Boost_USE_STATIC_LIBS ON)
# set(Boost_USE_MULTITHREADED ON)
# set(BOOST_ROOT $ENV{BOOST_ROOT})
# set(BOOST_LIBRARYDIR ${BOOST_ROOT}/libs)
# set(BOOST_INCLUDEDIR ${BOOST_ROOT})
# find_package(Boost COMPONENTS system thread date_time REQUIRED)
# if(NOT Boost_FOUND)
# message("Set the BOOST_ROOT environment variable to point to your boost installation.")
# message("We need system thread and date_time compiled static libs")
# message("These libs are compiler specific.")
# endif()
# elseif(UNIX AND NOT ANDROID)
# find_package(Boost COMPONENTS system thread date_time REQUIRED)
elseif(ANDROID)
#this is a hack. we compile a few boost libds directly into
#the application. we should require static libs for android
#to be available. maybe we could add the build option to
#download and build a compatible boost version
find_path(BOOST_INCLUDE_DIRS NAMES bind.hpp HINTS $ENV{ANDROID_BOOST_ROOT} PATH_SUFFIXES boost)
if(BOOST_INCLUDE_DIRS)
get_filename_component(BOOST_INCLUDE_DIRS ${BOOST_INCLUDE_DIRS} PATH)
set(ANDROID_BOOST_PTHREAD_SRC_DIR ${BOOST_INCLUDE_DIRS}/libs/thread/src/pthread)
set(ANDROID_BOOST_SYSTEM_SRC_DIR ${BOOST_INCLUDE_DIRS}/libs/system/src/)
else()
message(SEND_ERROR "We require a few boost sources to get compiled into wagic. Please point the ANDROID_BOOST_ROOT environment variable to a boost-source copy root.")
endif()
endif()
endmacro()
macro(FindOrBuildZLIB)
if(BUILD_ZLIB)
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/zlib ${CMAKE_BINARY_DIR}/thirdparty/zlib)
set(ZLIB_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/zlib)
set(ZLIB_LIBRARIES ZLIB::ZLIBSTATIC)
else()
if(WIN32 AND NOT MINGW)
set(ZLIB_ROOT ${CMAKE_SOURCE_DIR}/thirdparty/binary/win)
find_package(ZLIB)
else()
if(MINGW)
set(ZLIB_USE_STATIC_LIBS TRUE)
find_package(ZLIB REQUIRED)
else()
if(backend_qt_console OR backend_qt_widget OR EMSCRIPTEN)
set(ZLIB_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/zlib)
else()
find_package(ZLIB)
endif()
endif()
endif()
endif()
endmacro()
macro(FindOrBuildGIF)
if(BUILD_GIF)
message(WARNING "GIF sources are currently not included within the wagic tree")
else()
if(PSP)
find_package(GIF)
endif()
endif()
endmacro()
macro(FindOrBuildJPEG)
if(BUILD_JPEG)
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/libjpeg ${CMAKE_BINARY_DIR}/thirdparty/libjpeg)
set(JPEG_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/libjpeg)
set(JPEG_LIBRARY jpeg)
else()
if(WIN32)
#findJPEG does currently not provide prefix vars to guide it
find_path(JPEG_INCLUDE_DIR jpeglib.h HINTS ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/include)
find_library(JPEG_LIBRARY NAMES libjpeg-static-mt HINTS ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/lib)
if(JPEG_INCLUDE_DIR AND JPEG_LIBRARY)
set(JPEG_FOUND ON)
mark_as_advanced(JPEG_INCLUDE_DIR JPEG_LIBRARY)
else()
message(FATAL_ERROR "Could not find JPEG on windows")
endif()
else()
find_package(JPEG)
endif()
endif()
endmacro()
macro(FindOrBuildPNG)
if(BUILD_PNG)
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/libpng ${CMAKE_BINARY_DIR}/thirdparty/libpng)
set(PNG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/libpng)
# find_path(PNG_INCLUDE_DIRS NAMES png.h HINTS ${CMAKE_SOURCE_DIR}/thirdparty/libpng)
set(PNG_LIBRARIES png)
else()
if(WIN32)
#findPNG does currently not provide prefix vars. so we find
find_path(PNG_INCLUDE_DIRS png.h HINTS ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/include)
find_library(PNG_LIBRARIES libpng HINTS ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/lib)
if (PNG_LIBRARIES AND PNG_INCLUDE_DIRS)
set(PNG_FOUND ON)
mark_as_advanced(PNG_INCLUDE_DIRS PNG_LIBRARIES)
else()
message(FATAL_ERROR "Could not find PNG on windows")
endif()
else()
find_package(PNG)
endif()
endif()
endmacro()
macro(FindOrBuildCurl)
if(BUILD_CURL)
add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/curl ${CMAKE_BINARY_DIR}/thirdparty/curl)
set(CURL curl_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/curl)
set(CURL_LIBRARIES curl)
else()
if(WIN32)
#findPNG does currently not provide prefix vars. so we find
find_path(CURL CURL_INCLUDE_DIRS curl.h HINTS ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/include)
find_library(CURL_LIBRARIES libcurl HINTS ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/lib)
if (CURL_LIBRARIES AND CURL_INCLUDE_DIRS)
set(CURL_FOUND ON)
mark_as_advanced(CURL_INCLUDE_DIRS CURL_LIBRARIES)
else()
message(FATAL_ERROR "Could not find CURL on windows")
endif()
else()
find_package(CURL)
endif()
endif()
endmacro()
macro(FindOrBuildFreetype)
if(PSP)
set(ENV{FREETYPE_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/include)
set(ENV{FREETYPE_LIBRARIES} freetype)
endif()
endmacro()
macro(FindOrBuildHgeTools)
if(PSP)
find_library(HGETOOLS_LIBRARY NAMES hgetools HINTS "${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/lib")
set(HGETOOLS_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/include")
endif()
endmacro()
macro(FindOrBuildMikMod)
if(PSP)
find_library(MIKMOD_LIBRARY NAMES mikmod HINTS "${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/lib")
set(MIKMOD_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/include")
endif()
endmacro()
macro(FindOrBuildQt)
if(backend_qt_console)
add_definitions(-DCONSOLE_CONFIG -DTESTSUITE)
find_package(Qt5Core REQUIRED)
find_package(Qt5 COMPONENTS Core Network Multimedia REQUIRED)
elseif(backend_qt_widget)
add_definitions(-DQT_WIDGET)
find_package(OpenGL REQUIRED)
find_package(X11 REQUIRED)
find_package(Qt5 COMPONENTS Core Gui OpenGL Network Multimedia REQUIRED)
endif()
# include(${QT_USE_FILE})
endmacro()
macro(FindOrBuildOpenGL)
if(backend_sdl OR backend_qt_console OR backend_qt_widget)
if(ANDROID)
#find openglesv on android
set(OPENGL_LIBRARIES "-ldl -lGLESv1_CM -lGLESv2 -llog -landroid")
elseif(EMSCRIPTEN)
set(OPENGL_LIBRARIES "")
else()
find_package(OpenGL)
# find_package(GLUT)
endif()
endif()
endmacro()
macro(FindOrBuildOpenSL)
find_package(OpenSL)
endmacro()
macro(FindOrBuildPSPSDK)
find_package(PSPSDK COMPONENTS psppower pspmpeg pspaudiocodec pspaudiolib pspaudio pspmp3 pspgum pspgu psprtc pspfpu REQUIRED)
endmacro()

View File

@@ -0,0 +1,62 @@
# - Try to find PSPSDK
# Once done this will define
# PSPSDK_FOUND - System has PSPSDK
# PSPSDK_INCLUDE_DIR - The PSPSDK include directories
# PSPSDK_LIB - The libraries requested with the components field
# PSPSDK_REQUIRED_LIB - The libriries the PSPSDK needs always
# PSPSDK_CFLAGS - The CFLAGS to use
# PSPSDK_PATH - The output of psp-config --pspsdk-path
# PSPSDK_PREFIX - The output of psp-config --psp-prefix
# PSPSDK_CXX_COMPILER - The PSPSDK CXX Compilers path
# PSPSDK_CXX_LINKER - The PSPSDK CXX Linker command
# PSPSDK_FIXUP_IMPORTS_COMMAND - psp-fixup-imports command
# PSPSDK_PRXGEN_COMMAND - psp-prxgen command
# PSPSDK_PACK_PBP_COMMAND - pack-pbp command
# PSPSDK_MKSFO_COMMAND - mksfo command
#find the psp-config progams absolute path
#psp-config needs to be reachable via the system shell (PATH)
find_program(PSP_CONFIG_PROGRAM psp-config)
#TODO: check if something is REQUIRED and throw errors instead of messages
if(PSP_CONFIG_PROGRAM)
find_program(PSPSDK_CXX_COMPILER psp-g++)
find_program(PSPSDK_CXX_LINKER psp-gcc)
find_program(PSPSDK_FIXUP_IMPORTS_COMMAND psp-fixup-imports)
find_program(PSPSDK_PRXGEN_COMMAND psp-prxgen)
find_program(PSPSDK_PACK_PBP_COMMAND pack-pbp)
find_program(PSPSDK_MKSFO_COMMAND mksfo)
#ask psp-config for the
execute_process(COMMAND psp-config --pspsdk-path OUTPUT_VARIABLE PSPSDK_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND psp-config --psp-prefix OUTPUT_VARIABLE PSPSDK_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
set(PSPSDK_INCLUDE_DIR "${PSPSDK_PATH}/include")
foreach(_COMPONENT ${PSPSDK_FIND_COMPONENTS})
find_library(PSPSDK_${_COMPONENT} NAMES ${_COMPONENT})
if(NOT PSPSDK_${_COMPONENT})
message(SEND_ERROR "PSPSDK: ${_COMPONENT} not found")
else()
set(PSPSDK_LIB ${PSPSDK_LIB} ${PSPSDK_${_COMPONENT}})
endif()
endforeach()
#find libs which pspsdk does require to link even if the programs does not need one of them directly
foreach(_COMPONENT pspdebug pspdisplay pspge pspctrl pspsdk c pspnet pspnet_inet pspnet_apctl pspnet_resolver psputility pspuser)
find_library(PSPSDK_${_COMPONENT} NAMES ${_COMPONENT})
if(NOT PSPSDK_${_COMPONENT})
message(SEND_ERROR "PSPSDK: ${_COMPONENT} not found")
else()
set(PSPSDK_REQUIRED_LIB ${PSPSDK_REQUIRED_LIB} ${PSPSDK_${_COMPONENT}})
endif()
endforeach()
endif()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(PSPSDK DEFAULT_MSG
PSPSDK_CXX_LINKER PSPSDK_CXX_COMPILER PSPSDK_PATH PSPSDK_PREFIX PSPSDK_LIB PSPSDK_REQUIRED_LIB PSPSDK_INCLUDE_DIR)
mark_as_advanced(PSPSDK_CXX_LINKER PSPSDK_CXX_COMPILER PSPSDK_PATH PSPSDK_PREFIX PSPSDK_LIB PSPSDK_REQUIRED_LIB PSPSDK_INCLUDE_DIR)

181
CMakeModules/FindSDL2.cmake Normal file
View File

@@ -0,0 +1,181 @@
# Locate SDL2 library
# This module defines
# SDL2_LIBRARY, the name of the library to link against
# SDL2_FOUND, if false, do not try to link to SDL2
# SDL2_INCLUDE_DIR, where to find SDL.h
#
# This module responds to the the flag:
# SDL2_BUILDING_LIBRARY
# If this is defined, then no SDL2_main will be linked in because
# only applications need main().
# Otherwise, it is assumed you are building an application and this
# module will attempt to locate and set the the proper link flags
# as part of the returned SDL2_LIBRARY variable.
#
# Don't forget to include SDL2main.h and SDL2main.m your project for the
# OS X framework based version. (Other versions link to -lSDL2main which
# this module will try to find on your behalf.) Also for OS X, this
# module will automatically add the -framework Cocoa on your behalf.
#
#
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
# as appropriate. These values are used to generate the final SDL2_LIBRARY
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
#
#
# $SDL2DIR is an environment variable that would
# correspond to the ./configure --prefix=$SDL2DIR
# used in building SDL2.
# l.e.galup 9-20-02
#
# Modified by Eric Wing.
# Added code to assist with automated building by using environmental variables
# and providing a more controlled/consistent search behavior.
# Added new modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
# Also corrected the header search path to follow "proper" SDL2 guidelines.
# Added a search for SDL2main which is needed by some platforms.
# Added a search for threads which is needed by some platforms.
# Added needed compile switches for MinGW.
#
# On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# SDL2_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL2/SDL.h to just SDL.h
# This needed to change because "proper" SDL2 convention
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL2/ (see FreeBSD).
#
# Ported by Johnny Patterson. This is a literal port for SDL2 of the FindSDL.cmake
# module with the minor edit of changing "SDL" to "SDL2" where necessary. This
# was not created for redistribution, and exists temporarily pending official
# SDL2 CMake modules.
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES include/SDL2 include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/include/SDL2
/usr/include/SDL2
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
)
FIND_LIBRARY(SDL2_LIBRARY_TEMP
NAMES SDL2
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib64 lib
PATHS
/sw
/opt/local
/opt/csw
/opt
)
#MESSAGE("SDL2_LIBRARY_TEMP is ${SDL2_LIBRARY_TEMP}")
IF(NOT SDL2_BUILDING_LIBRARY)
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
# seem to provide SDL2main for compatibility even though they don't
# necessarily need it.
FIND_LIBRARY(SDL2MAIN_LIBRARY
NAMES SDL2main
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib64 lib
PATHS
/sw
/opt/local
/opt/csw
/opt
)
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# SDL2 may require threads on your system.
# The Apple build may not need an explicit flag because one of the
# frameworks may already provide it.
# But for non-OSX systems, I will use the CMake Threads package.
IF(NOT APPLE)
FIND_PACKAGE(Threads)
ENDIF(NOT APPLE)
# MinGW needs an additional library, mwindows
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows
# (Actually on second look, I think it only needs one of the m* libraries.)
IF(MINGW)
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
ENDIF(MINGW)
SET(SDL2_FOUND "NO")
IF(SDL2_LIBRARY_TEMP)
# For SDL2main
IF(NOT SDL2_BUILDING_LIBRARY)
IF(SDL2MAIN_LIBRARY)
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(SDL2MAIN_LIBRARY)
ENDIF(NOT SDL2_BUILDING_LIBRARY)
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
# CMake doesn't display the -framework Cocoa string in the UI even
# though it actually is there if I modify a pre-used variable.
# I think it has something to do with the CACHE STRING.
# So I use a temporary variable until the end so I can set the
# "real" variable in one-shot.
IF(APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
ENDIF(APPLE)
# For threads, as mentioned Apple doesn't need this.
# In fact, there seems to be a problem if I used the Threads package
# and try using this line, so I'm just skipping it entirely for OS X.
IF(NOT APPLE)
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
ENDIF(NOT APPLE)
# For MinGW library
IF(MINGW)
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
ENDIF(MINGW)
# Set the final string here so the GUI reflects the final state.
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
SET(SDL2_FOUND "YES")
ENDIF(SDL2_LIBRARY_TEMP)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
mark_as_advanced(SDL2MAIN_LIBRARY SDL2_LIBRARY SDL2_INCLUDE_DIR)

26
CMakeModules/FindTinyXML.cmake Executable file
View File

@@ -0,0 +1,26 @@
# - Find TinyXML
# Find the native TinyXML includes and library
#
# TINYXML_FOUND - True if TinyXML found.
# TINYXML_INCLUDE_DIR - where to find tinyxml.h, etc.
# TINYXML_LIBRARIES - List of libraries when using TinyXML.
#
IF( TINYXML_INCLUDE_DIR )
# Already in cache, be silent
SET( TinyXML_FIND_QUIETLY TRUE )
ENDIF( TINYXML_INCLUDE_DIR )
FIND_PATH( TINYXML_INCLUDE_DIR "tinyxml.h"
PATH_SUFFIXES "tinyxml" )
FIND_LIBRARY( TINYXML_LIBRARIES
NAMES "tinyxml"
PATH_SUFFIXES "tinyxml" )
# handle the QUIETLY and REQUIRED arguments and set TINYXML_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE( "FindPackageHandleStandardArgs" )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( "TinyXML" DEFAULT_MSG TINYXML_INCLUDE_DIR TINYXML_LIBRARIES )
MARK_AS_ADVANCED( TINYXML_INCLUDE_DIR TINYXML_LIBRARIES )

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,48 @@
include(CMakeForceCompiler)
# this one is important
SET(CMAKE_SYSTEM_NAME "Generic")
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
set (CMAKE_SYSTEM_NAME Generic)
# Just point to anything that exists.
# We don't need CMake to generate proper build files.
set(CMAKE_C_COMPILER ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CXX_COMPILER ${CMAKE_CURRENT_SOURCE_DIR})
# Skip the platform compiler checks
set (CMAKE_CXX_COMPILER_WORKS TRUE)
set (CMAKE_C_COMPILER_WORKS TRUE)
#how libraries look
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
SET(CMAKE_SYSTEM_INCLUDE_PATH
${THEOS_PATH}/include
${CMAKE_INSTALL_PREFIX}/include
${CMAKE_SYSTEM_INCLUDE_PATH})
# where is the target environment
SET(CMAKE_SYSTEM_LIBRARY_PATH
${THEOS_PATH}/lib
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_SYSTEM_LIBRARY_PATH})
SET(CMAKE_FIND_ROOT_PATH
${CMAKE_SOURCE_DIR}
${THEOS_PATH}
${THEOS_PATH}/lib
${THEOS_PATH}/include
)
# search for programs in the build host directories
# for libraries and headers in the target directories and then in the host
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY FIRST)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE FIRST)
set(IOS 1)

View File

@@ -0,0 +1,333 @@
# This file is part of the ios-cmake project. It was retrieved from
# https://github.com/cristeab/ios-cmake.git, which is a fork of
# https://code.google.com/p/ios-cmake/. Which in turn is based off of
# the Platform/Darwin.cmake and Platform/UnixPaths.cmake files which
# are included with CMake 2.8.4
#
# The ios-cmake project is licensed under the new BSD license.
#
# Copyright (c) 2014, Bogdan Cristea and LTE Engineering Software,
# Kitware, Inc., Insight Software Consortium. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# This file is based off of the Platform/Darwin.cmake and
# Platform/UnixPaths.cmake files which are included with CMake 2.8.4
# It has been altered for iOS development.
#
# Updated by Alex Stewart (alexs.mac@gmail.com).
# The following variables control the behaviour of this toolchain:
#
# IOS_PLATFORM: OS (default) or SIMULATOR or SIMULATOR64
# OS = Build for iPhoneOS.
# SIMULATOR = Build for x86 i386 iPhone Simulator.
# SIMULATOR64 = Build for x86 x86_64 iPhone Simulator.
# CMAKE_OSX_SYSROOT: Path to the iOS SDK to use. By default this is
# automatically determined from IOS_PLATFORM and xcodebuild, but
# can also be manually specified (although this should not be required).
# CMAKE_IOS_DEVELOPER_ROOT: Path to the Developer directory for the iOS platform
# being compiled for. By default this is automatically determined from
# CMAKE_OSX_SYSROOT, but can also be manually specified (although this should
# not be required).
# ENABLE_BITCODE: (true|false) Enables or disables bitcode support. Default true
#
# This toolchain defines the following variables for use externally:
#
# XCODE_VERSION: Version number (not including Build version) of Xcode detected.
# IOS_SDK_VERSION: Version of iOS SDK being used.
# CMAKE_OSX_ARCHITECTURES: Architectures being compiled for (generated from
# IOS_PLATFORM).
#
# This toolchain defines the following macros for use externally:
#
# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE XCODE_VARIANT)
# A convenience macro for setting xcode specific properties on targets.
# Available variants are: All, Release, RelWithDebInfo, Debug, MinSizeRel
# example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1" "all").
#
# find_host_package (PROGRAM ARGS)
# A macro used to find executable programs on the host system, not within the
# iOS environment. Thanks to the android-cmake project for providing the
# command.
# Fix for PThread library not in path
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(CMAKE_USE_PTHREADS_INIT 1)
# Get the Xcode version being used.
execute_process(COMMAND xcodebuild -version
OUTPUT_VARIABLE XCODE_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX MATCH "Xcode [0-9\\.]+" XCODE_VERSION "${XCODE_VERSION}")
string(REGEX REPLACE "Xcode ([0-9\\.]+)" "\\1" XCODE_VERSION "${XCODE_VERSION}")
message(STATUS "Building with Xcode version: ${XCODE_VERSION}")
# Default to building for iPhoneOS if not specified otherwise, and we cannot
# determine the platform from the CMAKE_OSX_ARCHITECTURES variable. The use
# of CMAKE_OSX_ARCHITECTURES is such that try_compile() projects can correctly
# determine the value of IOS_PLATFORM from the root project, as
# CMAKE_OSX_ARCHITECTURES is propagated to them by CMake.
if (NOT DEFINED IOS_PLATFORM)
if (CMAKE_OSX_ARCHITECTURES)
if (CMAKE_OSX_ARCHITECTURES MATCHES ".*arm.*")
set(IOS_PLATFORM "OS")
elseif (CMAKE_OSX_ARCHITECTURES MATCHES "i386")
set(IOS_PLATFORM "SIMULATOR")
elseif (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
set(IOS_PLATFORM "SIMULATOR64")
endif()
endif()
if (NOT IOS_PLATFORM)
set(IOS_PLATFORM "OS")
endif()
endif()
set(IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING
"Type of iOS platform for which to build.")
# Determine the platform name and architectures for use in xcodebuild commands
# from the specified IOS_PLATFORM name.
if (IOS_PLATFORM STREQUAL "OS")
set(XCODE_IOS_PLATFORM iphoneos)
set(IOS_ARCH armv7 armv7s arm64)
elseif (IOS_PLATFORM STREQUAL "SIMULATOR")
set(XCODE_IOS_PLATFORM iphonesimulator)
set(IOS_ARCH i386)
elseif(IOS_PLATFORM STREQUAL "SIMULATOR64")
set(XCODE_IOS_PLATFORM iphonesimulator)
set(IOS_ARCH x86_64)
else()
message(FATAL_ERROR "Invalid IOS_PLATFORM: ${IOS_PLATFORM}")
endif()
message(STATUS "Configuring iOS build for platform: ${IOS_PLATFORM}, "
"architecture(s): ${IOS_ARCH}")
# If user did not specify the SDK root to use, then query xcodebuild for it.
if (NOT CMAKE_OSX_SYSROOT)
execute_process(COMMAND xcodebuild -version -sdk ${XCODE_IOS_PLATFORM} Path
OUTPUT_VARIABLE CMAKE_OSX_SYSROOT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT} for platform: ${IOS_PLATFORM}")
endif()
if (NOT EXISTS ${CMAKE_OSX_SYSROOT})
message(FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} "
"does not exist.")
endif()
# Specify minimum version of deployment target.
if (NOT DEFINED IOS_DEPLOYMENT_TARGET)
# Unless specified, SDK version 8.0 is used by default as minimum target version.
set(IOS_DEPLOYMENT_TARGET "8.0"
CACHE STRING "Minimum iOS version to build for." )
message(STATUS "Using the default min-version since IOS_DEPLOYMENT_TARGET not provided!")
endif()
# Use bitcode or not
if (NOT DEFINED ENABLE_BITCODE)
# Unless specified, enable bitcode support by default
set(ENABLE_BITCODE TRUE CACHE BOOL "Wheter or not to enable bitcode")
message(STATUS "Enabling bitcode support by default. ENABLE_BITCODE not provided!")
endif()
# Get the SDK version information.
execute_process(COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version SDKVersion
OUTPUT_VARIABLE IOS_SDK_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Find the Developer root for the specific iOS platform being compiled for
# from CMAKE_OSX_SYSROOT. Should be ../../ from SDK specified in
# CMAKE_OSX_SYSROOT. There does not appear to be a direct way to obtain
# this information from xcrun or xcodebuild.
if (NOT CMAKE_IOS_DEVELOPER_ROOT)
get_filename_component(IOS_PLATFORM_SDK_DIR ${CMAKE_OSX_SYSROOT} PATH)
get_filename_component(CMAKE_IOS_DEVELOPER_ROOT ${IOS_PLATFORM_SDK_DIR} PATH)
endif()
if (NOT EXISTS ${CMAKE_IOS_DEVELOPER_ROOT})
message(FATAL_ERROR "Invalid CMAKE_IOS_DEVELOPER_ROOT: "
"${CMAKE_IOS_DEVELOPER_ROOT} does not exist.")
endif()
# Find the C & C++ compilers for the specified SDK.
if (NOT CMAKE_C_COMPILER)
execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find clang
OUTPUT_VARIABLE CMAKE_C_COMPILER
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Using C compiler: ${CMAKE_C_COMPILER}")
endif()
if (NOT CMAKE_CXX_COMPILER)
execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find clang++
OUTPUT_VARIABLE CMAKE_CXX_COMPILER
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Using CXX compiler: ${CMAKE_CXX_COMPILER}")
endif()
# Find (Apple's) libtool.
execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find libtool
OUTPUT_VARIABLE IOS_LIBTOOL
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Using libtool: ${IOS_LIBTOOL}")
# Configure libtool to be used instead of ar + ranlib to build static libraries.
# This is required on Xcode 7+, but should also work on previous versions of
# Xcode.
set(CMAKE_C_CREATE_STATIC_LIBRARY
"${IOS_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"${IOS_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
# Get the version of Darwin (OS X) of the host.
execute_process(COMMAND uname -r
OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Standard settings.
set(CMAKE_SYSTEM_NAME Darwin CACHE INTERNAL "")
set(CMAKE_SYSTEM_VERSION ${IOS_SDK_VERSION} CACHE INTERNAL "")
set(UNIX TRUE CACHE BOOL "")
set(APPLE TRUE CACHE BOOL "")
set(IOS TRUE CACHE BOOL "")
set(CMAKE_AR ar CACHE FILEPATH "" FORCE)
set(CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE)
# Force unset of OS X-specific deployment target (otherwise autopopulated),
# required as of cmake 2.8.10.
set(CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING
"Must be empty for iOS builds." FORCE)
# Set the architectures for which to build.
set(CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE STRING "Build architecture for iOS")
# Skip the platform compiler checks for cross compiling.
set(CMAKE_CXX_COMPILER_FORCED TRUE)
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_C_COMPILER_FORCED TRUE)
set(CMAKE_C_COMPILER_WORKS TRUE)
# All iOS/Darwin specific settings - some may be redundant.
set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
set(CMAKE_SHARED_MODULE_PREFIX "lib")
set(CMAKE_SHARED_MODULE_SUFFIX ".so")
set(CMAKE_MODULE_EXISTS 1)
set(CMAKE_DL_LIBS "")
set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
message(STATUS "Building for minimum iOS version: ${IOS_DEPLOYMENT_TARGET}"
" (SDK version: ${IOS_SDK_VERSION})")
# Note that only Xcode 7+ supports the newer more specific:
# -m${XCODE_IOS_PLATFORM}-version-min flags, older versions of Xcode use:
# -m(ios/ios-simulator)-version-min instead.
if (IOS_PLATFORM STREQUAL "OS")
if (XCODE_VERSION VERSION_LESS 7.0)
set(XCODE_IOS_PLATFORM_VERSION_FLAGS
"-mios-version-min=${IOS_DEPLOYMENT_TARGET}")
else()
# Xcode 7.0+ uses flags we can build directly from XCODE_IOS_PLATFORM.
set(XCODE_IOS_PLATFORM_VERSION_FLAGS
"-m${XCODE_IOS_PLATFORM}-version-min=${IOS_DEPLOYMENT_TARGET}")
endif()
else()
# SIMULATOR or SIMULATOR64 both use -mios-simulator-version-min.
set(XCODE_IOS_PLATFORM_VERSION_FLAGS
"-mios-simulator-version-min=${IOS_DEPLOYMENT_TARGET}")
endif()
message(STATUS "Version flags set to: ${XCODE_IOS_PLATFORM_VERSION_FLAGS}")
if (ENABLE_BITCODE)
set(BITCODE "-fembed-bitcode")
message(STATUS "Enabling bitcode support.")
else()
set(BITCODE "")
message(STATUS "Disabling bitcode support.")
endif()
set(CMAKE_C_FLAGS
"${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE} -fobjc-abi-version=2 -fobjc-arc ${CMAKE_C_FLAGS}")
# Hidden visibilty is required for C++ on iOS.
set(CMAKE_CXX_FLAGS
"${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE} -fvisibility=hidden -fvisibility-inlines-hidden -fobjc-abi-version=2 -fobjc-arc ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -fomit-frame-pointer -ffast-math ${BITCODE} ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_C_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
set(CMAKE_CXX_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
# In order to ensure that the updated compiler flags are used in try_compile()
# tests, we have to forcibly set them in the CMake cache, not merely set them
# in the local scope.
list(APPEND VARS_TO_FORCE_IN_CACHE
CMAKE_C_FLAGS
CMAKE_CXX_FLAGS
CMAKE_CXX_RELEASE
CMAKE_C_LINK_FLAGS
CMAKE_CXX_LINK_FLAGS)
foreach(VAR_TO_FORCE ${VARS_TO_FORCE_IN_CACHE})
set(${VAR_TO_FORCE} "${${VAR_TO_FORCE}}" CACHE STRING "" FORCE)
endforeach()
set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_names")
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names")
set(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
# Hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old
# build tree (where install_name_tool was hardcoded) and where
# CMAKE_INSTALL_NAME_TOOL isn't in the cache and still cmake didn't fail in
# CMakeFindBinUtils.cmake (because it isn't rerun) hardcode
# CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did
# before, Alex.
if (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool)
endif (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
# Set the find root to the iOS developer roots and to user defined paths.
set(CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_OSX_SYSROOT}
${CMAKE_PREFIX_PATH} CACHE string "iOS find search path root" FORCE)
# Default to searching for frameworks first.
set(CMAKE_FIND_FRAMEWORK FIRST)
# Set up the default search directories for frameworks.
set(CMAKE_SYSTEM_FRAMEWORK_PATH
${CMAKE_OSX_SYSROOT}/System/Library/Frameworks
${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks
${CMAKE_OSX_SYSROOT}/Developer/Library/Frameworks)
# Only search the specified iOS SDK, not the remainder of the host filesystem.
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# This little macro lets you set any XCode specific property.
macro(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE XCODE_RELVERSION)
set(XCODE_RELVERSION_I "${XCODE_RELVERSION}")
if (XCODE_RELVERSION_I STREQUAL "All")
set_property(TARGET ${TARGET} PROPERTY
XCODE_ATTRIBUTE_${XCODE_PROPERTY} "${XCODE_VALUE}")
else()
set_property(TARGET ${TARGET} PROPERTY
XCODE_ATTRIBUTE_${XCODE_PROPERTY}[variant=${XCODE_RELVERSION_I}] "${XCODE_VALUE}")
endif()
endmacro(set_xcode_property)
# This macro lets you find executable programs on the host system.
macro(find_host_package)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
set(IOS FALSE)
find_package(${ARGN})
set(IOS TRUE)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endmacro(find_host_package)

View File

@@ -0,0 +1,62 @@
include(CMakeForceCompiler)
# this one is important
SET(CMAKE_SYSTEM_NAME "Generic")
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
find_program(PSP_CONFIG_PROGRAM psp-config)
execute_process(COMMAND psp-config --pspsdk-path OUTPUT_VARIABLE PSPSDK_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND psp-config --psp-prefix OUTPUT_VARIABLE PSPSDK_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
# specify compiler and linker:
find_program(PSP_GPP psp-g++)
find_program(PSP_GCC psp-gcc)
CMAKE_FORCE_C_COMPILER(${PSP_GCC} GNU)
CMAKE_FORCE_CXX_COMPILER(${PSP_GPP} GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -G0")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
set(CMAKE_CXX_LINK_EXECUTABLE "${PSP_GCC} <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
#how libraries look
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
# where is the target environment
SET(CMAKE_SYSTEM_INCLUDE_PATH
${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/include
${PSPSDK_PATH}/include
${PSPSDK_PREFIX}/include
${CMAKE_INSTALL_PREFIX}/include
${CMAKE_SYSTEM_INCLUDE_PATH})
SET(CMAKE_SYSTEM_LIBRARY_PATH
${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/lib
${PSPSDK_PATH}/lib
${PSPSDK_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_SYSTEM_LIBRARY_PATH})
SET(CMAKE_FIND_ROOT_PATH
${CMAKE_SOURCE_DIR}/thirdparty/binary/psp
${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/lib
${CMAKE_SOURCE_DIR}/thirdparty/binary/psp/include
${PSPSDK_PATH}
${PSPSDK_PATH}/lib
${PSPSDK_PATH}/include
${PSPSDK_PREFIX}
${PSPSDK_PREFIX}/lib
${PSPSDK_PREFIX}/include
)
# search for programs in the build host directories
# for libraries and headers in the target directories and then in the host
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY FIRST)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE FIRST)
set(PSP 1)

57
CMakeModules/utils.cmake Normal file
View File

@@ -0,0 +1,57 @@
macro(WAGIC_OPTION variable description value)
set(__value ${value})
set(__condition "")
set(__varname "__value")
foreach(arg ${ARGN})
if(arg STREQUAL "IF" OR arg STREQUAL "if")
set(__varname "__condition")
else()
list(APPEND ${__varname} ${arg})
endif()
endforeach()
unset(__varname)
if("${__condition}" STREQUAL "")
set(__condition 2 GREATER 1)
endif()
if(${__condition})
if("${__value}" MATCHES ";")
if(${__value})
option(${variable} "${description}" ON)
else()
option(${variable} "${description}" OFF)
endif()
elseif(DEFINED ${__value})
if(${__value})
option(${variable} "${description}" ON)
else()
option(${variable} "${description}" OFF)
endif()
else()
option(${variable} "${description}" ${__value})
endif()
else()
unset(${variable} CACHE)
endif()
unset(__condition)
unset(__value)
endmacro()
# add prefix to each item in the list
macro(list_add_prefix LST PREFIX)
set(__tmp "")
foreach(item ${${LST}})
list(APPEND __tmp "${PREFIX}${item}")
endforeach()
set(${LST} ${__tmp})
unset(__tmp)
endmacro()
macro(find_host_program)
set(_find_program ${CMAKE_FIND_ROOT_PATH_MODE_PROGRAM})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
find_program(${ARGN})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${_find_program})
unset(_find_program)
endmacro()

165
JGE/CMakeLists.txt Normal file
View File

@@ -0,0 +1,165 @@
#the sources, jge will need always
set(JGE_generic_src
src/Encoding.cpp
src/JAnimator.cpp
src/JApp.cpp
src/JDistortionMesh.cpp
src/JFileSystem.cpp
src/JGameObject.cpp
src/JGE.cpp
src/JGui.cpp
src/JLogger.cpp
src/JLBFont.cpp
src/JOBJModel.cpp
src/JParticle.cpp
src/JParticleEffect.cpp
src/JParticleEmitter.cpp
src/JParticleSystem.cpp
src/JResourceManager.cpp
src/JSpline.cpp
src/JSprite.cpp
src/Vector2D.cpp)
set(JGE_hge_src
src/hge/hgecolor.cpp
src/hge/hgedistort.cpp
src/hge/hgefont.cpp
src/hge/hgeparticle.cpp
src/hge/hgerect.cpp
src/hge/hgevector.cpp)
#the sources we need to get graphical output desktops
#used by qt-widget build option
set(JGE_graphics_src
src/Downloader.cpp
include/Downloader.h
src/JMD2Model.cpp
src/pc/JGfx.cpp)
#the sources we need to fake graphical output on desktops
#these are used for the console-only testsuit
set(JGE_console_src
src/OutputCapturer.cpp
src/JGfx-fake.cpp)
#the sources we need on linux
set(JGE_linux_src
src/JNetwork.cpp
src/pc/JSocket.cpp
src/pc/JSfx.cpp)
set(JGE_android_src
src/JNetwork.cpp
src/JSocket.cpp
src/android/JSfx.cpp)
#the sources we need if we compile for psp
#note: main.cpp contains the main-function.
#the other main functions reside in projects/mtg to reduce cross-library dependencies.
#there may be a way to get all main-functions into the same project
set(JGE_psp_src
src/JNetwork.cpp
src/JSocket.cpp
src/JGfx.cpp
src/JSfx.cpp
src/JAudio.cpp
src/JMP3.cpp
src/decoder_prx.cpp
src/main.cpp
src/vram.cpp)
set(JGE_ios_src
src/iOS/main.m
src/iOS/wagicAppDelegate.m
src/iOS/ES2Renderer.m
src/iOS/EAGLView.m
src/iOS/EAGLViewController.m
src/iOS/JSfx.cpp)
set(JGE_windows_src
src/JNetwork.cpp
src/pc/JSocket.cpp
src/windows/JSfx.cpp)
set(JGE_INCLUDE_DIRS include include/hge)
set(EXTRA_INCLUDE_DIR ../projects/mtg/extra)
#turn moc on
if(backend_qt_console OR backend_qt_widget)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC TRUE)
endif()
if(backend_qt_console)
if(UNIX AND NOT ANDROID)
set(JGE_INTERNAL_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR}
${UNZIP_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default ${Qt5Core_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS})
set(JGE_SOURCES ${JGE_generic_src} ${JGE_console_src} ${JGE_linux_src} ${JGE_hge_src})
set(JGE_LINK_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Multimedia_LIBRARIES} ${ZIPFS_LIBRARY} ${UNZIP_LIRARY}
${JPEG_LIBRARIES} ${PNG_LIBRARIES})
else()
message(FATAL_ERROR "qt builds of jge platforms other than linux are not supported")
endif()
endif()
if(backend_qt_widget)
if(UNIX AND NOT ANDROID)
set(JGE_INTERNAL_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR}
${UNZIP_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default ${Qt5Core_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} )
set(JGE_SOURCES ${JGE_generic_src} ${JGE_graphics_src} ${JGE_linux_src} ${JGE_hge_src})
set(JGE_LINK_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Multimedia_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${ZIPFS_LIBRARY} ${UNZIP_LIRARY}
${JPEG_LIBRARIES} ${PNG_LIBRARIES})
else()
message(FATAL_ERROR "qt builds of jge platforms other than linux are not supported")
endif()
endif()
if(backend_sdl)
if((UNIX OR EMSCRIPTEN) AND NOT ANDROID)
set(JGE_INTERNAL_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR}
${SDL2_INCLUDE_DIR} ${UNZIP_INCLUDE_DIR} ${PNG_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
set(JGE_SOURCES ${JGE_generic_src} ${JGE_graphics_src} ${JGE_linux_src} ${JGE_hge_src})
set(JGE_LINK_LIBRARIES ${ZIPFS_LIBRARY} ${UNZIP_LIRARY} ${JPEG_LIBRARY}
${PNG_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
elseif(ANDROID)
set(JGE_INTERNAL_INCLUDE_DIRS ${BOOST_INCLUDE_DIRS} ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR}
${SDL2_INCLUDE_DIR} ${UNZIP_INCLUDE_DIR} ${PNG_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR}
${OPENSL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
set(JGE_SOURCES ${JGE_generic_src} ${JGE_android_src} ${JGE_graphics_src} ${JGE_hge_src})
set(JGE_LINK_LIBRARIES ${ZIPFS_LIBRARY} ${UNZIP_LIRARY} ${JPEG_LIBRARY} ${PNG_LIBRARIES}
${OPENSL_LIBRARIES})
elseif(WIN32)
set(JGE_INTERNAL_INCLUDE_DIRS ${EXTRA_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR} ${SDL2_INCLUDE_DIR}
${UNZIP_INCLUDE_DIR} ${PNG_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/include)
set(JGE_SOURCES ${JGE_generic_src} ${JGE_graphics_src} ${JGE_windows_src} ${JGE_hge_src})
set(JGE_LINK_LIBRARIES ${ZIPFS_LIBRARY} ${UNZIP_LIRARY} ${JPEG_LIBRARY} ${PNG_LIBRARIES})
set(JGE_LINK_DIRECTORIES ${Boost_LIBRARY_DIR})
endif()
endif()
if(backend_psp)
if(PSP)
#${PSPSDK_PATH}/include should be in system pathes
set(JGE_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/psp/include ${TINYXML_INCLUDE_DIR}
${ZIPFS_INCLUDE_DIR} ${UNZIP_INCLUDE_DIR} ${BOOST_INCLUDE_DIRS} ${GIF_INCLUDE_DIR} ${PNG_INCLUDE_DIRS} )
set(JGE_SOURCES ${JGE_generic_src} ${JGE_psp_src} ${JGE_hge_src})
set(JGE_LINK_LIBRARIES ${TINYXML_LIBRARIES} ${ZIPFS_LIBRARY} ${UNZIP_LIRARY})
else()
message(FATAL_ERROR "use the cross-compile toolchain to build as the psp target")
endif()
endif()
if(IOS)
set(JGE_SOURCES ${JGE_generic_src} ${JGE_ios_src} ${JGE_hge_src} src/pc/JGfx.cpp)
set(JGE_SOURCES ${JGE_SOURCES} PARENT_SCOPE)
set(JGE_INCLUDE_DIRS ${JGE_INCLUDE_DIRS} src/iOS PARENT_SCOPE)
set(JGE_LINK_LIBRARIES ${TINYXML_LIBRARIES} ${ZIPFS_LIBRARY} ${UNZIP_LIRARY})
endif()
add_library(jge STATIC ${JGE_SOURCES})
include_directories(${JGE_INTERNAL_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS})
target_link_libraries(jge ${JGE_LINK_LIBRARIES})
link_directories(${JGE_LINK_DIRECTORIES})
set(${JGE_LIBRARIES} jge)

View File

@@ -25,6 +25,7 @@ std::string ToHex(T* pointer)
#ifdef LINUX
#define OutputDebugString(val) (std::cerr << val);
#define OutputDebugStringA(val) (std::cerr << val);
#endif
#ifdef _DEBUG

View File

@@ -41,7 +41,7 @@ class DownloadRequest
private slots:
#endif
void fileDownloaded();
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
void downloadProgress(int64_t bytesReceived, int64_t bytesTotal);
#ifdef QT_CONFIG
signals:
@@ -72,7 +72,13 @@ protected:
QNetworkReply* mNetworkReply;
static QNetworkAccessManager networkAccessManager;
#endif
#ifdef __EMSCRIPTEN__
static void onLoadCb(unsigned int handle, DownloadRequest* req, const char *buffer, unsigned int size);
static void onErrorCb(unsigned int handle, DownloadRequest* req, int errorCode, const char* errorText);
static void onProgressCb(unsigned int handle, DownloadRequest* req, int bytesReceived, int bytesTotal);
#endif
void processError(int errorCode, const char* errorText);
void processBufferDownloaded(unsigned int size, const char*buffer);
public:
DownloadRequest(string localPath="",

View File

@@ -31,7 +31,7 @@ typedef u32 LocalKeySym;
#elif defined(SDL_CONFIG)
#include <SDL.h>
typedef SDLKey LocalKeySym;
typedef SDL_Keycode LocalKeySym;
#define LOCAL_KEY_NONE SDLK_UNKNOWN
#elif defined(WIN32)

View File

@@ -16,7 +16,7 @@
#include <string.h>
#include <stdarg.h>
#if (!defined IOS) && (!defined ANDROID) && (!defined QT_CONFIG)
#if (!defined IOS) && (!defined ANDROID) && (!defined QT_CONFIG) && (!defined SDL_CONFIG)
#include <gif_lib.h>
#endif //IOS ANDROID
@@ -567,7 +567,7 @@ private:
#if (!defined IOS) && (!defined QT_CONFIG)
void LoadJPG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
int LoadPNG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
#if (!defined ANDROID) && (!defined QT_CONFIG)
#if (!defined ANDROID) && (!defined QT_CONFIG) && (!defined SDL_CONFIG)
void LoadGIF(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
int image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bgcolor, InputFunc readFunc,int mode = 0, int TextureFormat = TEXTURE_FORMAT);
#endif // (ANDROID) How can we get gif support for android ?

View File

@@ -42,9 +42,9 @@ private:
// convert the socket into non-blocking state
bool SetNonBlocking(int sock);
// socket handle
#ifdef WIN32
#if (defined WIN32) && (!defined __GNUG__)
SOCKET mfd;
#elif LINUX || PSP
#elif LINUX || PSP || __GNUG__
int mfd;
#endif
};

View File

@@ -18,20 +18,20 @@
#include "JTypes.h"
#ifdef ANDROID
#include <SLES/OpenSLES.h>
#include "SLES/OpenSLES_Android.h"
#elif defined USE_PHONON
#elif defined(USE_PHONON)
#include <phonon/AudioOutput>
#include <phonon/MediaObject>
#elif (defined QT_CONFIG)
#elif defined (QT_CONFIG)
#include "QMediaPlayer"
#include "QMediaPlaylist"
#include "QSoundEffect"
#elif defined WIN32
#elif defined(WIN32)
#include <windows.h>
#define WITH_FMOD
//#define WITH_FMOD
#elif defined (PSP)
#include <pspgu.h>
#include <pspkernel.h>
@@ -48,7 +48,7 @@
#endif
#ifdef WITH_FMOD
#include "../Dependencies/include/fmod.h"
#include "fmod.h"
#endif
//------------------------------------------------------------------------------------------------
@@ -79,20 +79,26 @@ public slots:
std::string filename;
std::string key;
std::string ext;
void* mTrack;
#elif defined WITH_FMOD
FSOUND_SAMPLE* mTrack; // MP3 needed to be of "sample" type for FMOD, FMUSIC_MODULE is for MODs
void* mTrack;
#elif defined ANDROID
SLObjectItf playerObject;
SLPlayItf playInterface;
SLSeekItf seekInterface;
SLVolumeItf musicVolumeInterface;
void* mTrack;
#elif (defined QT_CONFIG)
QMediaPlaylist* playlist;
QMediaPlayer* player;
string fullpath;
#else
void* mTrack;
#endif //WITH_FMOD
void* mTrack;
#elif (defined WIN32)
std::string filename;
void* mTrack;
#endif
//#endif //WITH_FMOD
};
@@ -107,28 +113,30 @@ public:
unsigned long fileSize();
#if (defined QT_CONFIG) && (!defined USE_PHONON)
QMediaPlayer* effect;
void* mSample;
void* mSample;
#elif defined (PSP)
WAVDATA *mSample;
WAVDATA* mSample;
#elif defined (IOS)
std::string filename;
std::string key;
std::string ext;
void* mSample;
void* mSample;
#elif defined (WITH_FMOD)
FSOUND_SAMPLE *mSample;
#elif defined (USE_PHONON)
Phonon::AudioOutput* mOutput;
Phonon::MediaObject* mMediaObject;
void* mSample;
void* mSample;
#elif defined ANDROID
SLObjectItf playerObject;
SLPlayItf playInterface;
SLVolumeItf sampleVolumeInterface;
void* mSample;
void* mSample;
#elif (defined WIN32)
std::string filename;
void* mSample;
#else
void* mSample;
void* mSample;
#endif
};

View File

@@ -26,8 +26,16 @@
#include "JAudio.h"
#else
#include <stdint.h>
//#define __STDC_LIMIT_MACROS
#ifdef IOS
#include <tr1/cstdint>
#else
#include <cstdint>
#endif
//#include <stdint.h>
//the MSC version might only define _MSC_STDINT_H_
//and that might cause redefinition of standard types
//#define _STDINT_H_
#endif
@@ -104,6 +112,7 @@ enum {
#endif // CONSOLE_CONFIG
#if (defined WIN32) && (!defined LINUX)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#if defined(LINUX) && (!defined WIN32) || defined(IOS) || defined (ANDROID)
@@ -140,9 +149,14 @@ typedef uint32_t u32;
#include <GLES/gl.h>
#include <GLES/glext.h>
#elif defined (WIN32) || defined (LINUX)
#if defined(__APPLE__)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
#endif
#else
#include <QtOpenGL>
#endif

View File

@@ -0,0 +1,29 @@
#ifndef PRECOMPILEDHEADER_H
#define PRECOMPILEDHEADER_H
#include <algorithm>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <sstream>
#include <string>
#include <vector>
#include "DebugRoutines.h"
#include <assert.h>
#include "JGE.h"
#include "JFileSystem.h"
#include "JLogger.h"
//#ifndef WP8
//#include <boost/shared_ptr.hpp>
//#endif
#if defined (WP8) || defined (IOS) || defined (ANDROID) || defined (QT_CONFIG) || defined (SDL_CONFIG)
#define TOUCH_ENABLED
#endif
#endif //PRECOMPILEDHEADER_H

View File

@@ -1,7 +1,7 @@
#ifndef THREADING_H
#define THREADING_H
#if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L)
#if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L) && !(_MSC_VER >= 1700)
#include <boost/date_time.hpp>
#ifdef WIN32
@@ -537,7 +537,7 @@ namespace boost
}
}
#elif (__cplusplus > 199711L)
#elif (__cplusplus > 199711L) || (_MSC_VER >= 1700)
#include <thread>
#include <mutex>

View File

@@ -33,6 +33,7 @@ extern "C" {
#endif
void* vrelptr( void *ptr ); // make a pointer relative to memory base address (ATTENTION: A NULL rel ptr is not illegal/invalid!)
void* vabsptr( void *ptr ); // make a pointer absolute (default return type of valloc)
void* valloc( size_t size );

View File

@@ -7,6 +7,9 @@
#ifdef QT_CONFIG
QNetworkAccessManager DownloadRequest::networkAccessManager;
#endif
#ifdef __EMSCRIPTEN__
#include "emscripten.h"
#endif
DownloadRequest::DownloadRequest(string localPath,
string remoteResourceURL,
@@ -48,15 +51,71 @@ void DownloadRequest::startGet()
JFileSystem::GetInstance()->Remove(getTempLocalPath());
JFileSystem::GetInstance()->openForWrite(mFile, getTempLocalPath());
#ifdef QT_CONFIG
connect(mNetworkReply, SIGNAL(downloadProgress(qint64, qint64)),
SLOT(downloadProgress(qint64, qint64)));
connect(mNetworkReply, SIGNAL(downloadProgress(int64_t, int64_t)),
SLOT(downloadProgress(int64_t, int64_t)));
connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded()));
#endif
#ifdef __EMSCRIPTEN__
emscripten_async_wget2_data(mRemoteResourceURL.c_str(), "GET", 0, this, 1,
(em_async_wget2_data_onload_func)DownloadRequest::onLoadCb,
(em_async_wget2_data_onerror_func)DownloadRequest::onErrorCb,
(em_async_wget2_data_onprogress_func)DownloadRequest::onProgressCb);
#endif
}
#ifdef __EMSCRIPTEN__
void DownloadRequest::onLoadCb(unsigned int handle, DownloadRequest* req, const char *buffer, unsigned int size)
{
DebugTrace("DownloadRequest::onLoadCb: " << size);
req->processBufferDownloaded(size, buffer);
Downloader::GetInstance()->Update();
}
void DownloadRequest::onErrorCb(unsigned int handle, DownloadRequest* req, int errorCode, const char* errorText)
{
DebugTrace("DownloadRequest::onErrorCb");
req->processError(errorCode, errorText);
Downloader::GetInstance()->Update();
}
void DownloadRequest::onProgressCb(unsigned int handle, DownloadRequest* req, int bytesReceived, int bytesTotal)
{
DebugTrace("DownloadRequest::onProgressCb");
req->DownloadRequest::downloadProgress(bytesReceived, bytesTotal);
}
#endif
void DownloadRequest::processError(int errorCode, const char* errorText)
{
DebugTrace(errorText);
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
mFile.close();
JFileSystem::GetInstance()->Remove(getTempLocalPath());
}
void DownloadRequest::processBufferDownloaded(unsigned int size, const char*buffer)
{
if(mFile.is_open())
{
mTotalSize = size;
mFile.write(buffer, size);
mFile.close();
if(!JFileSystem::GetInstance()->Rename(getTempLocalPath(), mLocalPath)) {
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
return;
}
}
mDownloadStatus = DownloadRequest::DOWNLOADED;
}
void DownloadRequest::fileDownloaded()
{
do {
#ifdef QT_CONFIG
do {
QByteArray eTagByteArray = mNetworkReply->rawHeader("ETag");
if(!eTagByteArray.isEmpty()) {
string oldETag = mETag;
@@ -67,10 +126,7 @@ void DownloadRequest::fileDownloaded()
// let's check some error
if(mNetworkReply->error() != QNetworkReply::NoError) {
DebugTrace(mNetworkReply->errorString().toStdString());
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
mFile.close();
JFileSystem::GetInstance()->Remove(getTempLocalPath());
processError((int)mNetworkReply->error(), mNetworkReply->errorString().toStdString().c_str());
break;
}
@@ -89,35 +145,31 @@ void DownloadRequest::fileDownloaded()
return;
}
if(mFile.is_open())
{
QByteArray byteArray = mNetworkReply->readAll();
mFile.write(byteArray.constData(), byteArray.size());
mFile.close();
if(!JFileSystem::GetInstance()->Rename(getTempLocalPath(), mLocalPath)) {
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
break;
}
}
mDownloadStatus = DownloadRequest::DOWNLOADED;
QByteArray byteArray = mNetworkReply->readAll();
processBufferDownloaded(byteArray.size(), byteArray.constData());
} while(0);
Downloader::GetInstance()->Update();
mNetworkReply->deleteLater();
mNetworkReply->deleteLater();
emit statusChanged((int)mDownloadStatus);
#endif
}
void DownloadRequest::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
void DownloadRequest::downloadProgress(int64_t bytesReceived, int64_t bytesTotal)
{
QByteArray byteArray = mNetworkReply->readAll();
#ifdef QT_CONFIG
QByteArray byteArray = mNetworkReply->readAll();
mFile.write(byteArray.constData(), byteArray.size());
#endif
mCurrentSize = bytesReceived;
mTotalSize = bytesTotal;
int percent = 0;
if(bytesTotal)
percent = (bytesReceived/bytesTotal)*100;
#ifdef QT_CONFIG
emit percentChanged(percent);
#endif
}
Downloader* Downloader::mInstance = 0;

View File

@@ -15,7 +15,7 @@
#include "../include/JSprite.h"
#include "../include/JAnimator.h"
#include "tinyxml/tinyxml.h"
#include "tinyxml.h"
//////////////////////////////////////////////////////////////////////////

View File

@@ -16,14 +16,7 @@ User folder is the only one that is really needed to guarantee both read and wri
The content that users should not be touching.
*/
#if defined (ANDROID)
#include "PrecompiledHeader.h"
#endif //ANDROID
#if defined (LINUX)
#include "../../projects/mtg/include/PrecompiledHeader.h"
#endif //LINUX
#include "dirent.h"
#ifdef WIN32
#pragma warning(disable : 4786)
@@ -37,7 +30,8 @@ The content that users should not be touching.
#include "../include/JGE.h"
#include "../include/JFileSystem.h"
#include "../include/JLogger.h"
#include <dirent.h>
#include "DebugRoutines.h"
#ifdef QT_CONFIG
#include <QDir>
@@ -130,6 +124,10 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
userPath = [[documentsDirectory stringByAppendingString: @"/User/"] cStringUsingEncoding:1];
systemPath = [[documentsDirectory stringByAppendingString: @"/Res/"] cStringUsingEncoding:1];
#elif defined (__EMSCRIPTEN__)
systemPath = "/";
DebugTrace("User path " << userPath);
DebugTrace("System path " << systemPath);
#elif defined (ANDROID)
userPath = JGE::GetInstance()->getFileUserFolderPath();
systemPath = JGE::GetInstance()->getFileSystemLocation();
@@ -146,9 +144,9 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
userPath = QDir::toNativeSeparators(dir.absolutePath()).toStdString();
systemPath = QDir::toNativeSeparators(sysDir.absolutePath()).toStdString();
DebugTrace("User path " << userPath);
DebugTrace("System path " << systemPath);
DebugTrace("Current path " << QDir::currentPath().toStdString());
DebugTrace("User path " + userPath);
DebugTrace("System path " + systemPath);
DebugTrace("Current path " + QDir::currentPath().toStdString());
#else
//Find the Res.txt file and matching Res folders for backwards compatibility
ifstream mfile("Res.txt");
@@ -304,6 +302,7 @@ void JFileSystem::DetachZipFile()
bool JFileSystem::openForRead(izfstream & File, const string & FilePath) {
DebugTrace("JFileSystem::openForRead " << FilePath);
File.open(FilePath.c_str(), mUserFS);
if (File)
return true;
@@ -414,7 +413,6 @@ bool JFileSystem::OpenFile(const string &filename)
mCurrentFileInZip = &(it2->second);
mFileSize = it2->second.m_Size;
return true;
}

View File

@@ -34,7 +34,7 @@
//////////////////////////////////////////////////////////////////////////
#if defined (WIN32) // WIN32 specific code
#include "../../Dependencies/include/fmod.h"
#include "fmod.h"
u8 JGE::GetAnalogX()
{
@@ -54,7 +54,7 @@ u8 JGE::GetAnalogY()
#elif defined (LINUX) // Unix specific code
#include <sys/time.h>
#ifdef WITH_FMOD
#include "../Dependencies/include/fmod.h"
#include "fmod.h"
#endif //WITH_FMOD

View File

@@ -10,6 +10,7 @@
#include <pspaudio.h>
#include <pspmp3.h>
#include <psputility.h>
#include <unistd.h>
#else
#define PSP_AUDIO_VOLUME_MAX 100

View File

@@ -42,7 +42,7 @@ bool JNetwork::isConnected(){
void JNetwork::getServerIp(string& aString)
{
#ifdef WIN32
#if (defined WIN32) && (!defined __GNUG__)
char ac[80];
if (gethostname(ac, sizeof(ac)) == SOCKET_ERROR) {
DebugTrace("Error " << WSAGetLastError() <<

View File

@@ -19,7 +19,7 @@
#include "../include/JFileSystem.h"
#include "../include/JResourceManager.h"
#include "tinyxml/tinyxml.h"
#include "tinyxml.h"
//-------------------------------------------------------------------------------------

View File

@@ -14,9 +14,9 @@
#include "../include/JResourceManager.h"
#include "../include/JFileSystem.h"
#include "../include/JLBFont.h"
#include "tinyxml/tinyxml.h"
#include "tinyxml.h"
#if defined (_DEBUG) && defined (WIN32) && (!defined LINUX)
#if defined (_DEBUG) && defined (WIN32) && (!defined LINUX) && (!defined __GNUG__)
#include "crtdbg.h"
#define NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#else

View File

@@ -13,7 +13,7 @@
#include "../include/JFileSystem.h"
#include "../include/JSpline.h"
#include "tinyxml/tinyxml.h"
#include "tinyxml.h"
#define SMALL_NUMBER 0.0001f

View File

@@ -19,7 +19,8 @@
*
*/
#include "../include/decoder_prx.h"
#include "decoder_prx.h"
#include <psputility.h>
char *prx_static_init()
{

View File

@@ -12,7 +12,7 @@
#if (!defined IOS) && (!defined QT_CONFIG)
#ifdef WIN32
#pragma warning(disable : 4786)
#pragma comment( lib, "giflib.lib" )
//#pragma comment( lib, "giflib.lib" )
#endif
#include <png.h>
@@ -35,7 +35,7 @@ extern "C" {
#include "../../include/JFileSystem.h"
#include "../../include/JAssert.h"
#if (defined WIN32) && (!defined QT_CONFIG)
#if (defined WIN32) && (!defined QT_CONFIG) && (!defined SDL_CONFIG)
#ifndef __attribute__
#define __attribute__((a))
#endif
@@ -1665,7 +1665,7 @@ static void jpeg_mem_src(j_decompress_ptr cinfo, byte *mem, int len)
cinfo->src->resync_to_restart = jpeg_resync_to_restart;
cinfo->src->term_source = jpg_null;
cinfo->src->bytes_in_buffer = len;
cinfo->src->next_input_byte = mem;
cinfo->src->next_input_byte = (const JOCTET*)mem;
}
/*
@@ -1702,7 +1702,7 @@ void JRenderer::LoadJPG(TextureInfo &textureInfo, const char *filename, int mode
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_decompress(&cinfo);
jpeg_mem_src(&cinfo, rawdata, rawsize);
jpeg_mem_src(&cinfo, (byte*)rawdata, rawsize);
// Process JPEG header
jpeg_read_header(&cinfo, true);
@@ -1740,7 +1740,7 @@ void JRenderer::LoadJPG(TextureInfo &textureInfo, const char *filename, int mode
// Pass sizes to output
// Allocate Scanline buffer
scanline = (byte *)malloc(cinfo.output_width * 3);
scanline = (BYTE *)malloc(cinfo.output_width * 3);
if(!scanline)
{
//// ri.Con_Printf(PRINT_ALL, "Insufficient RAM for JPEG scanline buffer\n");

View File

@@ -75,7 +75,7 @@ static int __largest_block = __MEM_BLOCKS;
static int __mem_free = __MEM_BLOCKS;
inline void* vrelptr( void *ptr )
void* vrelptr( void *ptr )
{
return (void*)((unsigned int)ptr & ~__MEM_START);
}

182
JGE/src/windows/JSfx.cpp Normal file
View File

@@ -0,0 +1,182 @@
#include <Windows.h>
#include <Mmsystem.h>
#include <mciapi.h>
//these two headers are already included in the <Windows.h> header
#pragma comment(lib, "Winmm.lib")
#include "DebugRoutines.h"
#include "../../include/JSoundSystem.h"
#include "../../include/JFileSystem.h"
//////////////////////////////////////////////////////////////////////////
JMusic::JMusic()
:
mTrack(0)
{
}
void JMusic::Update(){
}
int JMusic::getPlayTime(){
return 0;
}
JMusic::~JMusic()
{
}
//////////////////////////////////////////////////////////////////////////
JSample::JSample()
{
}
JSample::~JSample()
{
}
unsigned long JSample::fileSize()
{
return 0;
}
//////////////////////////////////////////////////////////////////////////
JSoundSystem* JSoundSystem::mInstance = NULL;
JSoundSystem* JSoundSystem::GetInstance()
{
if (mInstance == NULL)
{
mInstance = new JSoundSystem();
mInstance->InitSoundSystem();
}
return mInstance;
}
void JSoundSystem::Destroy()
{
if (mInstance)
{
mInstance->DestroySoundSystem();
delete mInstance;
mInstance = NULL;
}
}
JSoundSystem::JSoundSystem()
{
mVolume = 0;
mSampleVolume = 0;
}
JSoundSystem::~JSoundSystem()
{
}
void JSoundSystem::InitSoundSystem()
{
}
void JSoundSystem::DestroySoundSystem()
{
}
JMusic *JSoundSystem::LoadMusic(const char *fileName)
{
JMusic* music = NULL;
music = new JMusic();
if (music)
{
music->filename = JFileSystem::GetInstance()->GetResourceFile(fileName);
std::string aString = "open \"" + music->filename + "\" type mpegvideo alias mp3";
mciSendString(aString.c_str(), NULL, 0, NULL);
music->mTrack = (void*)-1;
}
return music;
}
void JSoundSystem::PlayMusic(JMusic *music, bool looping)
{
if (music && music->mTrack)
{
if(looping)
mciSendString("play mp3 repeat", NULL, 0, NULL);
else
mciSendString("play mp3", NULL, 0, NULL);
}
}
void JSoundSystem::StopMusic(JMusic *music)
{
if (music && music->mTrack)
{
mciSendString("stop mp3", NULL, 0, NULL);
}
}
void JSoundSystem::PauseMusic(JMusic *music)
{
if (music && music->mTrack)
{
mciSendString("pause mp3", NULL, 0, NULL);
}
}
void JSoundSystem::ResumeMusic(JMusic *music)
{
if (music && music->mTrack)
{
mciSendString("resume mp3", NULL, 0, NULL);
}
}
void JSoundSystem::SetVolume(int volume)
{
SetMusicVolume(volume);
SetSfxVolume(volume);
}
void JSoundSystem::SetMusicVolume(int volume)
{
mVolume = volume;
}
void JSoundSystem::SetSfxVolume(int volume)
{
mSampleVolume = volume;
SetMusicVolume(mVolume);
}
JSample *JSoundSystem::LoadSample(const char *fileName)
{
JSample* sample = NULL;
sample = new JSample();
if (sample)
{
sample->filename = JFileSystem::GetInstance()->GetResourceFile(fileName);
}
return sample;
}
void JSoundSystem::PlaySample(JSample *sample)
{
if(sample)
{
sndPlaySound(sample->filename.c_str(), SND_FILENAME | SND_ASYNC);
}
}

View File

@@ -17,6 +17,7 @@ skip_tags: true
#---------------------------------#
environment:
DXSDK_DIR: "C:/Program Files (x86)/Microsoft DirectX SDK/"
GH_TOKEN:
secure: dYnBDQkiY5oVjIlswzBX9BJigNtBGXgGlp1tK3XbHzrDEDrs2vaKD5m+Oz5OSz1C
@@ -26,6 +27,10 @@ install:
- powershell -Command "& {C:/Python27/python.exe C:/get-pip.py}"
- "C:/Python27/Scripts/pip.exe install pyjavaproperties"
- "C:/Python27/Scripts/pip.exe install github3.py"
- git submodule update --init --recursive
- cd thirdparty/SDL2
# - git checkout release-2.0.3
- cd ../..
#---------------------------------#
# build configuration #
@@ -34,8 +39,16 @@ install:
# build Configuration, i.e. Debug, Release, etc.
configuration: Release
# scripts to run before build
before_build:
- echo Running cmake...
- mkdir build
- cd build
- cmake -Dbackend_sdl=ON ..
- cd ..
build:
project: projects/mtg/mtg_vs2010.sln # path to Visual Studio solution or project
project: build/wagic.sln # path to Visual Studio solution or project
#---------------------------------#
# tests configuration #
@@ -61,7 +74,7 @@ artifacts:
# scripts to run before deployment
before_deploy:
- cd projects/mtg/bin
- "C:/Python27/python.exe createWindowsZip.py"
- "C:/Python27/python.exe createWindowsZip.py -b ../../../build"
- cd ../../..
# scripts to run after deployment

View File

@@ -0,0 +1,3 @@
add_definitions(-DANDROID -DLINUX)
add_definitions(-D_STLP_USE_SIMPLE_NODE_ALLOC -D__arm__ -D_REENTRANT -D_GLIBCXX__PTHREADS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0192" android:versionName="@string/app_version" package="net.wagic.app">
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application android:debuggable="true" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:label="@string/app_name" android:name="org.libsdl.app.SDLActivity" android:screenOrientation="sensorLandscape">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:name="com.google.ads.AdActivity" android:screenOrientation="sensorLandscape"/>
</application>
<uses-sdk android:minSdkVersion="@ANDROID_NATIVE_API_LEVEL@" android:targetSdkVersion="@ANDROID_NATIVE_API_LEVEL@"/>
</manifest>

View File

@@ -0,0 +1,121 @@
if(NOT ANDROID_PACKAGE_RELEASE)
set(ANDROID_PACKAGE_RELEASE 1)
endif()
if(NOT ANDROID_PACKAGE_PLATFORM)
if(ARMEABI_V7A)
if(NEON)
set(ANDROID_PACKAGE_PLATFORM armv7a_neon)
else()
set(ANDROID_PACKAGE_PLATFORM armv7a)
endif()
elseif(ARMEABI_V6)
set(ANDROID_PACKAGE_PLATFORM armv6)
elseif(ARMEABI)
set(ANDROID_PACKAGE_PLATFORM armv5)
elseif(X86)
set(ANDROID_PACKAGE_PLATFORM x86)
elseif(MIPS)
set(ANDROID_PACKAGE_PLATFORM mips)
else()
message(ERROR "Can not automatically determine the value for ANDROID_PACKAGE_PLATFORM")
endif()
endif()
if(NOT ANDROID_PACKAGE_PLATFORM_NAME)
if(ARMEABI_V7A)
if(NEON)
set(ANDROID_PACKAGE_PLATFORM_NAME "armeabi-v7a with NEON")
else()
set(ANDROID_PACKAGE_PLATFORM_NAME "armeabi-v7a")
endif()
elseif(ARMEABI_V6)
set(ANDROID_PACKAGE_PLATFORM_NAME "armeabi-v6")
elseif(ARMEABI)
set(ANDROID_PACKAGE_PLATFORM_NAME "armeabi")
elseif(X86)
set(ANDROID_PACKAGE_PLATFORM_NAME "x86")
elseif(MIPS)
set(ANDROID_PACKAGE_PLATFORM_NAME "mips")
else()
message(ERROR "Can not automatically determine the value for ANDROID_PACKAGE_PLATFORM_NAME")
endif()
endif()
if("${ANDROID_NATIVE_API_LEVEL}" MATCHES "[1-9][0-9]*$")
set(ANDROID_SDK_VERSION ${CMAKE_MATCH_0})
endif()
if(NOT ANDROID_SDK_VERSION GREATER 7)
set(ANDROID_SDK_VERSION 8)
endif()
set(PACKAGE_DIR "${CMAKE_BINARY_DIR}/package")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/AndroidManifest.xml"
"${PACKAGE_DIR}/AndroidManifest.xml" @ONLY)
#configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build.xml"
# "${PACKAGE_DIR}/build.xml" COPYONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/res/values/strings.xml"
"${PACKAGE_DIR}/res/values/strings.xml" COPYONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/res/drawable-hdpi/icon.png"
"${PACKAGE_DIR}/res/drawable-hdpi/icon.png" COPYONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/res/drawable-ldpi/icon.png"
"${PACKAGE_DIR}/res/drawable-ldpi/icon.png" COPYONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/res/drawable-mdpi/icon.png"
"${PACKAGE_DIR}/res/drawable-mdpi/icon.png" COPYONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/res/layout/main.xml"
"${PACKAGE_DIR}/res/layout/main.xml" COPYONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assets/_keystore/wagic-release.keystore"
"${PACKAGE_DIR}/assets/_keystore/wagic-release.keystore" COPYONLY)
string( REGEX MATCH "[0-9]+" ANDROID_NATIVE_API_LEVEL_NUMBER "${ANDROID_NATIVE_API_LEVEL}" )
set(target_name "Wagic_${WAGIC_VERSION}_binary_pack_${ANDROID_PACKAGE_PLATFORM}")
get_target_property(wagic_location wagic LOCATION)
string(TOLOWER ${CMAKE_BUILD_TYPE} android_build_type)
set(android_proj_target_files ${ANDROID_PROJECT_FILES})
list_add_prefix(android_proj_target_files "${PACKAGE_DIR}/")
set(APK_NAME "${PACKAGE_DIR}/bin/${target_name}-${android_build_type}-unsigned.apk")
file(GLOB camera_wrappers "${OpenCV_SOURCE_DIR}/3rdparty/lib/${ANDROID_NDK_ABI_NAME}/libnative_camera_r*.so")
set(CAMERA_LIB_COMMANDS "")
foreach(wrapper ${camera_wrappers})
list(APPEND CAMERA_LIB_COMMANDS COMMAND ${CMAKE_COMMAND} -E copy "${wrapper}" "${PACKAGE_DIR}/libs/${ANDROID_NDK_ABI_NAME}/")
endforeach()
add_custom_command(
OUTPUT "${APK_NAME}"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PACKAGE_DIR}/libs"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PACKAGE_DIR}/bin"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PACKAGE_DIR}/gen"
COMMAND ${CMAKE_COMMAND} -E remove ${android_proj_target_files}
COMMAND ${CMAKE_COMMAND} -E make_directory "${PACKAGE_DIR}/src"
COMMAND ${CMAKE_COMMAND} -E make_directory "${PACKAGE_DIR}/libs/${ANDROID_NDK_ABI_NAME}/"
# COMMAND ${CMAKE_COMMAND} -E copy "${SDL2_LIBRARY}" "${PACKAGE_DIR}/libs/${ANDROID_NDK_ABI_NAME}/"
# COMMAND ${CMAKE_COMMAND} -E copy "${ZLIB_LIBRARY}" "${PACKAGE_DIR}/libs/${ANDROID_NDK_ABI_NAME}/"
# COMMAND ${CMAKE_COMMAND} -E copy "${OPENSL_LIBRARY}" "${PACKAGE_DIR}/libs/${ANDROID_NDK_ABI_NAME}/"
COMMAND ${CMAKE_COMMAND} -E copy "${wagic_location}" "${PACKAGE_DIR}/libs/${ANDROID_NDK_ABI_NAME}/"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/src" "${PACKAGE_DIR}/src"
# COMMAND ${ANDROID_EXECUTABLE} --silent update project --path "${PACKAGE_DIR}" --target "android-${ANDROID_NATIVE_API_LEVEL}" --name "${target_name}"
COMMAND ${ANDROID_EXECUTABLE} --silent update project --path "${PACKAGE_DIR}" --target "android-10" --name "${target_name}"
COMMAND ${ANT_EXECUTABLE} -noinput -k ${android_build_type}
COMMAND ${CMAKE_COMMAND} -E touch "${APK_NAME}"
WORKING_DIRECTORY "${PACKAGE_DIR}"
MAIN_DEPENDENCY "${PACKAGE_DIR}/${ANDROID_MANIFEST_FILE}"
DEPENDS
"${PACKAGE_DIR}/res/values/strings.xml"
"${PACKAGE_DIR}/res/layout/main.xml"
"${PACKAGE_DIR}/res/drawable-mdpi/icon.png"
"${PACKAGE_DIR}/res/drawable-ldpi/icon.png"
"${PACKAGE_DIR}/res/drawable-hdpi/icon.png"
"${PACKAGE_DIR}/${ANDROID_MANIFEST_FILE}"
wagic
)
install(FILES "${APK_NAME}" DESTINATION "apk/" COMPONENT main)
add_custom_target(android_package ALL SOURCES "${APK_NAME}" )
add_dependencies(android_package wagic)

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

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

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Wagic</string>
<string name="app_version">0.19.2</string>
<string name="info_text">Wagic v0.19.2\\nAll Rights Reserved.</string>
</resources>

View File

@@ -0,0 +1,174 @@
package net.wagic.utils;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
import android.os.Environment;
import android.util.Log;
public class StorageOptions
{
private static ArrayList<String> mMounts = new ArrayList<String>();
private static ArrayList<String> mVold = new ArrayList<String>();
public static String[] labels;
public static String[] paths;
public static int count = 0;
public static String defaultMountPoint;
public static void determineStorageOptions()
{
initializeMountPoints();
readMountsFile();
readVoldFile();
compareMountsWithVold();
testAndCleanMountsList();
setProperties();
}
private static void initializeMountPoints()
{
try
{
defaultMountPoint = Environment.getExternalStorageDirectory().getCanonicalPath();
} catch (Exception ioEx)
{
// an error occurred trying to get the canonical path, use '/mnt/sdcard' instead
defaultMountPoint = "/mnt/sdcard";
}
}
private static void readMountsFile()
{
/*
* Scan the /proc/mounts file and look for lines like this: /dev/block/vold/179:1 /mnt/sdcard vfat
* rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0602,dmask=0602,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
*
* When one is found, split it into its elements and then pull out the path to the that mount point and add it to the arraylist
*/
try
{
Scanner scanner = new Scanner(new File("/proc/mounts"));
while (scanner.hasNext())
{
String line = scanner.nextLine();
if (line.startsWith("/dev/block/vold/"))
{
String[] lineElements = line.split(" ");
lineElements[1].replaceAll(":.*$", "");
mMounts.add(lineElements[1]);
}
}
} catch (FileNotFoundException fnfex)
{
// if proc/mount doesn't exist we just use
Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
mMounts.add(defaultMountPoint);
} catch (Exception e)
{
Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file");
mMounts.add(defaultMountPoint);
}
}
private static void readVoldFile()
{
/*
* Scan the /system/etc/vold.fstab file and look for lines like this: dev_mount sdcard /mnt/sdcard 1 /devices/platform/s3c-sdhci.0/mmc_host/mmc0
*
* When one is found, split it into its elements and then pull out the path to the that mount point and add it to the arraylist
*/
try
{
Scanner scanner = new Scanner(new File("/system/etc/vold.fstab"));
while (scanner.hasNext())
{
String line = scanner.nextLine();
if (line.startsWith("dev_mount"))
{
String[] lineElements = line.split(" ");
lineElements[2] = lineElements[2].replaceAll(":.*$", "");
mVold.add(lineElements[2]);
}
}
} catch (FileNotFoundException fnfex)
{
// if vold.fstab doesn't exist we use the value gathered from the Environment
Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
mMounts.add(defaultMountPoint);
} catch (Exception e)
{
Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file");
mMounts.add(defaultMountPoint);
}
}
private static void compareMountsWithVold()
{
/*
* Sometimes the two lists of mount points will be different. We only want those mount points that are in both list.
*
* Compare the two lists together and remove items that are not in both lists.
*/
for (int i = 0; i < mMounts.size(); i++)
{
String mount = mMounts.get(i);
if (!mVold.contains(mount))
mMounts.remove(i--);
}
// don't need this anymore, clear the vold list to reduce memory
// use and to prepare it for the next time it's needed.
mVold.clear();
}
private static void testAndCleanMountsList()
{
/*
* Now that we have a cleaned list of mount paths Test each one to make sure it's a valid and available path. If it is not, remove it from the list.
*/
for (int i = 0; i < mMounts.size(); i++)
{
String mount = mMounts.get(i);
File root = new File(mount);
if (!root.exists() || !root.isDirectory() || !root.canWrite())
mMounts.remove(i--);
}
}
private static void setProperties()
{
/*
* At this point all the paths in the list should be valid. Build the public properties.
*/
ArrayList<String> mLabels = new ArrayList<String>();
int i = 1;
for (String path : mMounts)
{ // TODO: /mnt/sdcard is assumed to always mean internal storage. Use this comparison until there is a better way to do this
if ("/mnt/sdcard".equalsIgnoreCase(path))
mLabels.add("Built-in Storage");
else
mLabels.add("External SD Card " + i++);
}
labels = new String[mLabels.size()];
mLabels.toArray(labels);
paths = new String[mMounts.size()];
mMounts.toArray(paths);
count = Math.min(labels.length, paths.length);
// don't need this anymore, clear the mounts list to reduce memory
// use and to prepare it for the next time it's needed.
mMounts.clear();
}
}

View File

@@ -0,0 +1,771 @@
package org.libsdl.app;
import java.util.Arrays;
import android.app.*;
import android.content.*;
import android.view.*;
import android.view.inputmethod.BaseInputConnection;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import android.widget.AbsoluteLayout;
import android.os.*;
import android.util.Log;
import android.graphics.*;
import android.media.*;
import android.hardware.*;
/**
SDL Activity
*/
public class SDLActivity extends Activity {
private static final String TAG = "SDL";
// Keep track of the paused state
public static boolean mIsPaused = false, mIsSurfaceReady = false, mHasFocus = true;
// Main components
protected static SDLActivity mSingleton;
protected static SDLSurface mSurface;
protected static View mTextEdit;
protected static ViewGroup mLayout;
// This is what SDL runs in. It invokes SDL_main(), eventually
protected static Thread mSDLThread;
// Audio
protected static Thread mAudioThread;
protected static AudioTrack mAudioTrack;
// Load the .so
static {
System.loadLibrary("SDL2");
//System.loadLibrary("SDL2_image");
//System.loadLibrary("SDL2_mixer");
//System.loadLibrary("SDL2_net");
//System.loadLibrary("SDL2_ttf");
System.loadLibrary("wagic");
}
// Setup
@Override
protected void onCreate(Bundle savedInstanceState) {
//Log.v("SDL", "onCreate()");
super.onCreate(savedInstanceState);
// So we can call stuff from static callbacks
mSingleton = this;
// Set up the surface
mSurface = new SDLSurface(getApplication());
mLayout = new AbsoluteLayout(this);
mLayout.addView(mSurface);
setContentView(mLayout);
}
// Events
@Override
protected void onPause() {
Log.v("SDL", "onPause()");
super.onPause();
SDLActivity.handlePause();
}
@Override
protected void onResume() {
Log.v("SDL", "onResume()");
super.onResume();
SDLActivity.handleResume();
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
Log.v("SDL", "onWindowFocusChanged(): " + hasFocus);
SDLActivity.mHasFocus = hasFocus;
if (hasFocus) {
SDLActivity.handleResume();
}
}
@Override
public void onLowMemory() {
Log.v("SDL", "onLowMemory()");
super.onLowMemory();
SDLActivity.nativeLowMemory();
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.v("SDL", "onDestroy()");
// Send a quit message to the application
SDLActivity.nativeQuit();
// Now wait for the SDL thread to quit
if (mSDLThread != null) {
try {
mSDLThread.join();
} catch(Exception e) {
Log.v("SDL", "Problem stopping thread: " + e);
}
mSDLThread = null;
//Log.v("SDL", "Finished waiting for SDL thread");
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
int keyCode = event.getKeyCode();
// Ignore certain special keys so they're handled by Android
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN ||
keyCode == KeyEvent.KEYCODE_VOLUME_UP ||
keyCode == KeyEvent.KEYCODE_CAMERA ||
keyCode == 168 || /* API 11: KeyEvent.KEYCODE_ZOOM_IN */
keyCode == 169 /* API 11: KeyEvent.KEYCODE_ZOOM_OUT */
) {
return false;
}
return super.dispatchKeyEvent(event);
}
/** Called by onPause or surfaceDestroyed. Even if surfaceDestroyed
* is the first to be called, mIsSurfaceReady should still be set
* to 'true' during the call to onPause (in a usual scenario).
*/
public static void handlePause() {
if (!SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady) {
SDLActivity.mIsPaused = true;
SDLActivity.nativePause();
mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, false);
}
}
/** Called by onResume or surfaceCreated. An actual resume should be done only when the surface is ready.
* Note: Some Android variants may send multiple surfaceChanged events, so we don't need to resume
* every time we get one of those events, only if it comes after surfaceDestroyed
*/
public static void handleResume() {
if (SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady && SDLActivity.mHasFocus) {
SDLActivity.mIsPaused = false;
SDLActivity.nativeResume();
mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);
}
}
// Messages from the SDLMain thread
static final int COMMAND_CHANGE_TITLE = 1;
static final int COMMAND_UNUSED = 2;
static final int COMMAND_TEXTEDIT_HIDE = 3;
protected static final int COMMAND_USER = 0x8000;
/**
* This method is called by SDL if SDL did not handle a message itself.
* This happens if a received message contains an unsupported command.
* Method can be overwritten to handle Messages in a different class.
* @param command the command of the message.
* @param param the parameter of the message. May be null.
* @return if the message was handled in overridden method.
*/
protected boolean onUnhandledMessage(int command, Object param) {
return false;
}
/**
* A Handler class for Messages from native SDL applications.
* It uses current Activities as target (e.g. for the title).
* static to prevent implicit references to enclosing object.
*/
protected static class SDLCommandHandler extends Handler {
@Override
public void handleMessage(Message msg) {
Context context = getContext();
if (context == null) {
Log.e(TAG, "error handling message, getContext() returned null");
return;
}
switch (msg.arg1) {
case COMMAND_CHANGE_TITLE:
if (context instanceof Activity) {
((Activity) context).setTitle((String)msg.obj);
} else {
Log.e(TAG, "error handling message, getContext() returned no Activity");
}
break;
case COMMAND_TEXTEDIT_HIDE:
if (mTextEdit != null) {
mTextEdit.setVisibility(View.GONE);
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(mTextEdit.getWindowToken(), 0);
}
break;
default:
if ((context instanceof SDLActivity) && !((SDLActivity) context).onUnhandledMessage(msg.arg1, msg.obj)) {
Log.e(TAG, "error handling message, command is " + msg.arg1);
}
}
}
}
// Handler for the messages
Handler commandHandler = new SDLCommandHandler();
// Send a message from the SDLMain thread
boolean sendCommand(int command, Object data) {
Message msg = commandHandler.obtainMessage();
msg.arg1 = command;
msg.obj = data;
return commandHandler.sendMessage(msg);
}
// C functions we call
public static native void nativeInit();
public static native void nativeLowMemory();
public static native void nativeQuit();
public static native void nativePause();
public static native void nativeResume();
public static native void onNativeResize(int x, int y, int format);
public static native void onNativeKeyDown(int keycode);
public static native void onNativeKeyUp(int keycode);
public static native void onNativeKeyboardFocusLost();
public static native void onNativeTouch(int touchDevId, int pointerFingerId,
int action, float x,
float y, float p);
public static native void onNativeAccel(float x, float y, float z);
public static native void onNativeSurfaceChanged();
public static native void onNativeSurfaceDestroyed();
public static native void nativeFlipBuffers();
public static void flipBuffers() {
SDLActivity.nativeFlipBuffers();
}
public static boolean setActivityTitle(String title) {
// Called from SDLMain() thread and can't directly affect the view
return mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title);
}
public static boolean sendMessage(int command, int param) {
return mSingleton.sendCommand(command, Integer.valueOf(param));
}
public static Context getContext() {
return mSingleton;
}
static class ShowTextInputTask implements Runnable {
/*
* This is used to regulate the pan&scan method to have some offset from
* the bottom edge of the input region and the top edge of an input
* method (soft keyboard)
*/
static final int HEIGHT_PADDING = 15;
public int x, y, w, h;
public ShowTextInputTask(int x, int y, int w, int h) {
this.x = x;
this.y = y;
this.w = w;
this.h = h;
}
@Override
public void run() {
AbsoluteLayout.LayoutParams params = new AbsoluteLayout.LayoutParams(
w, h + HEIGHT_PADDING, x, y);
if (mTextEdit == null) {
mTextEdit = new DummyEdit(getContext());
mLayout.addView(mTextEdit, params);
} else {
mTextEdit.setLayoutParams(params);
}
mTextEdit.setVisibility(View.VISIBLE);
mTextEdit.requestFocus();
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(mTextEdit, 0);
}
}
public static boolean showTextInput(int x, int y, int w, int h) {
// Transfer the task to the main thread as a Runnable
return mSingleton.commandHandler.post(new ShowTextInputTask(x, y, w, h));
}
public static Surface getNativeSurface() {
return SDLActivity.mSurface.getNativeSurface();
}
// Audio
public static int audioInit(int sampleRate, boolean is16Bit, boolean isStereo, int desiredFrames) {
int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO : AudioFormat.CHANNEL_CONFIGURATION_MONO;
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
Log.v("SDL", "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
// Let the user pick a larger buffer if they really want -- but ye
// gods they probably shouldn't, the minimums are horrifyingly high
// latency already
desiredFrames = Math.max(desiredFrames, (AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat) + frameSize - 1) / frameSize);
if (mAudioTrack == null) {
mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate,
channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM);
// Instantiating AudioTrack can "succeed" without an exception and the track may still be invalid
// Ref: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/AudioTrack.java
// Ref: http://developer.android.com/reference/android/media/AudioTrack.html#getState()
if (mAudioTrack.getState() != AudioTrack.STATE_INITIALIZED) {
Log.e("SDL", "Failed during initialization of Audio Track");
mAudioTrack = null;
return -1;
}
mAudioTrack.play();
}
Log.v("SDL", "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer");
return 0;
}
public static void audioWriteShortBuffer(short[] buffer) {
for (int i = 0; i < buffer.length; ) {
int result = mAudioTrack.write(buffer, i, buffer.length - i);
if (result > 0) {
i += result;
} else if (result == 0) {
try {
Thread.sleep(1);
} catch(InterruptedException e) {
// Nom nom
}
} else {
Log.w("SDL", "SDL audio: error return from write(short)");
return;
}
}
}
public static void audioWriteByteBuffer(byte[] buffer) {
for (int i = 0; i < buffer.length; ) {
int result = mAudioTrack.write(buffer, i, buffer.length - i);
if (result > 0) {
i += result;
} else if (result == 0) {
try {
Thread.sleep(1);
} catch(InterruptedException e) {
// Nom nom
}
} else {
Log.w("SDL", "SDL audio: error return from write(byte)");
return;
}
}
}
public static void audioQuit() {
if (mAudioTrack != null) {
mAudioTrack.stop();
mAudioTrack = null;
}
}
// Input
/**
* @return an array which may be empty but is never null.
*/
public static int[] inputGetInputDeviceIds(int sources) {
int[] ids = InputDevice.getDeviceIds();
int[] filtered = new int[ids.length];
int used = 0;
for (int i = 0; i < ids.length; ++i) {
InputDevice device = InputDevice.getDevice(ids[i]);
if ((device != null) && ((device.getSources() & sources) != 0)) {
filtered[used++] = device.getId();
}
}
return Arrays.copyOf(filtered, used);
}
}
/**
Simple nativeInit() runnable
*/
class SDLMain implements Runnable {
@Override
public void run() {
// Runs SDL_main()
SDLActivity.nativeInit();
//Log.v("SDL", "SDL thread terminated");
}
}
/**
SDLSurface. This is what we draw on, so we need to know when it's created
in order to do anything useful.
Because of this, that's where we set up the SDL thread
*/
class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
View.OnKeyListener, View.OnTouchListener, SensorEventListener {
// Sensors
protected static SensorManager mSensorManager;
protected static Display mDisplay;
// Keep track of the surface size to normalize touch events
protected static float mWidth, mHeight;
// Startup
public SDLSurface(Context context) {
super(context);
getHolder().addCallback(this);
setFocusable(true);
setFocusableInTouchMode(true);
requestFocus();
setOnKeyListener(this);
setOnTouchListener(this);
mDisplay = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
// Some arbitrary defaults to avoid a potential division by zero
mWidth = 1.0f;
mHeight = 1.0f;
}
public Surface getNativeSurface() {
return getHolder().getSurface();
}
// Called when we have a valid drawing surface
@Override
public void surfaceCreated(SurfaceHolder holder) {
Log.v("SDL", "surfaceCreated()");
holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
}
// Called when we lose the surface
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
Log.v("SDL", "surfaceDestroyed()");
// Call this *before* setting mIsSurfaceReady to 'false'
SDLActivity.handlePause();
SDLActivity.mIsSurfaceReady = false;
SDLActivity.onNativeSurfaceDestroyed();
}
// Called when the surface is resized
@Override
public void surfaceChanged(SurfaceHolder holder,
int format, int width, int height) {
Log.v("SDL", "surfaceChanged()");
int sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 by default
switch (format) {
case PixelFormat.A_8:
Log.v("SDL", "pixel format A_8");
break;
case PixelFormat.LA_88:
Log.v("SDL", "pixel format LA_88");
break;
case PixelFormat.L_8:
Log.v("SDL", "pixel format L_8");
break;
case PixelFormat.RGBA_4444:
Log.v("SDL", "pixel format RGBA_4444");
sdlFormat = 0x15421002; // SDL_PIXELFORMAT_RGBA4444
break;
case PixelFormat.RGBA_5551:
Log.v("SDL", "pixel format RGBA_5551");
sdlFormat = 0x15441002; // SDL_PIXELFORMAT_RGBA5551
break;
case PixelFormat.RGBA_8888:
Log.v("SDL", "pixel format RGBA_8888");
sdlFormat = 0x16462004; // SDL_PIXELFORMAT_RGBA8888
break;
case PixelFormat.RGBX_8888:
Log.v("SDL", "pixel format RGBX_8888");
sdlFormat = 0x16261804; // SDL_PIXELFORMAT_RGBX8888
break;
case PixelFormat.RGB_332:
Log.v("SDL", "pixel format RGB_332");
sdlFormat = 0x14110801; // SDL_PIXELFORMAT_RGB332
break;
case PixelFormat.RGB_565:
Log.v("SDL", "pixel format RGB_565");
sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565
break;
case PixelFormat.RGB_888:
Log.v("SDL", "pixel format RGB_888");
// Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
sdlFormat = 0x16161804; // SDL_PIXELFORMAT_RGB888
break;
default:
Log.v("SDL", "pixel format unknown " + format);
break;
}
mWidth = width;
mHeight = height;
SDLActivity.onNativeResize(width, height, sdlFormat);
Log.v("SDL", "Window size:" + width + "x"+height);
// Set mIsSurfaceReady to 'true' *before* making a call to handleResume
SDLActivity.mIsSurfaceReady = true;
SDLActivity.onNativeSurfaceChanged();
if (SDLActivity.mSDLThread == null) {
// This is the entry point to the C app.
// Start up the C app thread and enable sensor input for the first time
SDLActivity.mSDLThread = new Thread(new SDLMain(), "SDLThread");
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
SDLActivity.mSDLThread.start();
}
}
// unused
@Override
public void onDraw(Canvas canvas) {}
// Key events
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
//Log.v("SDL", "key down: " + keyCode);
SDLActivity.onNativeKeyDown(keyCode);
return true;
}
else if (event.getAction() == KeyEvent.ACTION_UP) {
//Log.v("SDL", "key up: " + keyCode);
SDLActivity.onNativeKeyUp(keyCode);
return true;
}
return false;
}
// Touch events
@Override
public boolean onTouch(View v, MotionEvent event) {
final int touchDevId = event.getDeviceId();
final int pointerCount = event.getPointerCount();
// touchId, pointerId, action, x, y, pressure
int actionPointerIndex = (event.getAction() & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent.ACTION_POINTER_ID_SHIFT; /* API 8: event.getActionIndex(); */
int pointerFingerId = event.getPointerId(actionPointerIndex);
int action = (event.getAction() & MotionEvent.ACTION_MASK); /* API 8: event.getActionMasked(); */
float x = event.getX(actionPointerIndex) / mWidth;
float y = event.getY(actionPointerIndex) / mHeight;
float p = event.getPressure(actionPointerIndex);
if (action == MotionEvent.ACTION_MOVE && pointerCount > 1) {
// TODO send motion to every pointer if its position has
// changed since prev event.
for (int i = 0; i < pointerCount; i++) {
pointerFingerId = event.getPointerId(i);
x = event.getX(i) / mWidth;
y = event.getY(i) / mHeight;
p = event.getPressure(i);
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
}
} else {
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
}
return true;
}
// Sensor events
public void enableSensor(int sensortype, boolean enabled) {
// TODO: This uses getDefaultSensor - what if we have >1 accels?
if (enabled) {
mSensorManager.registerListener(this,
mSensorManager.getDefaultSensor(sensortype),
SensorManager.SENSOR_DELAY_GAME, null);
} else {
mSensorManager.unregisterListener(this,
mSensorManager.getDefaultSensor(sensortype));
}
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
// TODO
}
@Override
public void onSensorChanged(SensorEvent event) {
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
float x, y;
switch (mDisplay.getRotation()) {
case Surface.ROTATION_90:
x = -event.values[1];
y = event.values[0];
break;
case Surface.ROTATION_270:
x = event.values[1];
y = -event.values[0];
break;
case Surface.ROTATION_180:
x = -event.values[1];
y = -event.values[0];
break;
default:
x = event.values[0];
y = event.values[1];
break;
}
SDLActivity.onNativeAccel(-x / SensorManager.GRAVITY_EARTH,
y / SensorManager.GRAVITY_EARTH,
event.values[2] / SensorManager.GRAVITY_EARTH - 1);
}
}
}
/* This is a fake invisible editor view that receives the input and defines the
* pan&scan region
*/
class DummyEdit extends View implements View.OnKeyListener {
InputConnection ic;
public DummyEdit(Context context) {
super(context);
setFocusableInTouchMode(true);
setFocusable(true);
setOnKeyListener(this);
}
@Override
public boolean onCheckIsTextEditor() {
return true;
}
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
// This handles the hardware keyboard input
if (event.isPrintingKey()) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);
}
return true;
}
if (event.getAction() == KeyEvent.ACTION_DOWN) {
SDLActivity.onNativeKeyDown(keyCode);
return true;
} else if (event.getAction() == KeyEvent.ACTION_UP) {
SDLActivity.onNativeKeyUp(keyCode);
return true;
}
return false;
}
//
@Override
public boolean onKeyPreIme (int keyCode, KeyEvent event) {
// As seen on StackOverflow: http://stackoverflow.com/questions/7634346/keyboard-hide-event
// FIXME: Discussion at http://bugzilla.libsdl.org/show_bug.cgi?id=1639
// FIXME: This is not a 100% effective solution to the problem of detecting if the keyboard is showing or not
// FIXME: A more effective solution would be to change our Layout from AbsoluteLayout to Relative or Linear
// FIXME: And determine the keyboard presence doing this: http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android
// FIXME: An even more effective way would be if Android provided this out of the box, but where would the fun be in that :)
if (event.getAction()==KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
if (SDLActivity.mTextEdit != null && SDLActivity.mTextEdit.getVisibility() == View.VISIBLE) {
SDLActivity.onNativeKeyboardFocusLost();
}
}
return super.onKeyPreIme(keyCode, event);
}
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
ic = new SDLInputConnection(this, true);
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
| 33554432 /* API 11: EditorInfo.IME_FLAG_NO_FULLSCREEN */;
return ic;
}
}
class SDLInputConnection extends BaseInputConnection {
public SDLInputConnection(View targetView, boolean fullEditor) {
super(targetView, fullEditor);
}
@Override
public boolean sendKeyEvent(KeyEvent event) {
/*
* This handles the keycodes from soft keyboard (and IME-translated
* input from hardkeyboard)
*/
int keyCode = event.getKeyCode();
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (event.isPrintingKey()) {
commitText(String.valueOf((char) event.getUnicodeChar()), 1);
}
SDLActivity.onNativeKeyDown(keyCode);
return true;
} else if (event.getAction() == KeyEvent.ACTION_UP) {
SDLActivity.onNativeKeyUp(keyCode);
return true;
}
return super.sendKeyEvent(event);
}
@Override
public boolean commitText(CharSequence text, int newCursorPosition) {
nativeCommitText(text.toString(), newCursorPosition);
return super.commitText(text, newCursorPosition);
}
@Override
public boolean setComposingText(CharSequence text, int newCursorPosition) {
nativeSetComposingText(text.toString(), newCursorPosition);
return super.setComposingText(text, newCursorPosition);
}
public native void nativeCommitText(String text, int newCursorPosition);
public native void nativeSetComposingText(String text, int newCursorPosition);
}

View File

@@ -0,0 +1,8 @@
set(CMAKE_CXX_FLAGS "-s USE_SDL=2 -s USE_ZLIB=1 -s FULL_ES2=1 -std=c++11 -s TOTAL_MEMORY=16777216 -O0 --preload-file ../../../projects/mtg/bin/Res@/")
#set(CMAKE_CXX_FLAGS "-s USE_SDL=2 -s FULL_ES2=1 -std=c++11 -g4 -s ALLOW_MEMORY_GROWTH=1 --preload-file ../../../projects/mtg/bin/Res@/")
set(CMAKE_EXECUTABLE_SUFFIX ".html")
add_definitions(-DLINUX)
add_definitions(-D_DEBUG)
add_definitions(-DUSERDIR=".wagic")
add_definitions(-DRESDIR="/")
add_definitions(-DGL_ES_VERSION_2_0)

View File

@@ -0,0 +1,5 @@
add_definitions(-DLINUX)
add_definitions(-DUSERDIR=".wagic")
add_definitions(-DRESDIR="Res")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++0x")
set(CMAKE_PREFIX_PATH "/usr/local/opt/qt5")

View File

@@ -0,0 +1,5 @@
add_definitions(-DPSP -G0)
add_definitions(-D_PSP_FW_VERSION=371)
add_definitions(-DDEVHOOK -DPSPFW3XX)
include_directories(${PSPSDK_PATH}/include)

View File

@@ -0,0 +1,4 @@
add_definitions(-DLINUX)
add_definitions(-DUSERDIR=".wagic")
add_definitions(-DRESDIR="Res")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")

View File

@@ -0,0 +1,3 @@
add_definitions(-DWIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")

View File

@@ -307,18 +307,16 @@ public class SDLActivity extends Activity implements OnKeyListener {
importDeck.setTitle("Choose Deck to Import:");
File root = new File(System.getenv("EXTERNAL_STORAGE") + "/Download");
File[] files = root.listFiles();
File[] files = root.listFiles();
if (files != null) {
for (File f : files) {
if (!myresult.contains(f.toString()) &&
(f.toString().contains(".txt") ||
f.toString().contains(".dck") ||
f.toString().contains(".dec"))) {
myresult.add(f.toString());
}
}
}
for (File f : files) {
if (!myresult.contains(f.toString()) &&
(f.toString().contains(".txt") ||
f.toString().contains(".dck") ||
f.toString().contains(".dec"))) {
myresult.add(f.toString());
}
}
//get first item?
if (!myresult.isEmpty()) {
@@ -1117,49 +1115,24 @@ public class SDLActivity extends Activity implements OnKeyListener {
}
// Setup
private void enterImmersiveMode() {
final View decorView = getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
);
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
enterImmersiveMode();
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
protected void onCreate(Bundle savedInstanceState) {
//Log.d(TAG, "onCreate()");
super.onCreate(savedInstanceState);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
setContentView(R.layout.main);
// Enable immersive mode
enterImmersiveMode();
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
// So we can call stuff from static callbacks
mSingleton = this;
mContext = this.getApplicationContext();
RES_FILENAME = getResourceName();
StorageOptions.determineStorageOptions(mContext);
checkStorageLocationPreference();
prepareOptionMenu(null);
}
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll()
.build();
StrictMode.setThreadPolicy(policy);
setContentView(R.layout.main);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
// So we can call stuff from static callbacks
mSingleton = this;
mContext = this.getApplicationContext();
RES_FILENAME = getResourceName();
StorageOptions.determineStorageOptions(mContext);
checkStorageLocationPreference();
prepareOptionMenu(null);
}
public void forceResDownload(final File oldRes) {
AlertDialog.Builder resChooser = new AlertDialog.Builder(this);

244
projects/mtg/CMakeLists.txt Normal file
View File

@@ -0,0 +1,244 @@
#MTGs common sources
set(MTG_generic_src
src/AbilityParser.cpp
src/ActionElement.cpp
src/ActionLayer.cpp
src/ActionStack.cpp
src/AIHints.cpp
src/AIMomirPlayer.cpp
src/AIPlayer.cpp
src/AIPlayerBaka.cpp
src/AIStats.cpp
src/AllAbilities.cpp
src/CardDescriptor.cpp
src/CardDisplay.cpp
src/CardGui.cpp
src/CardPrimitive.cpp
src/CardSelector.cpp
src/CardSelectorSingleton.cpp
src/CarouselDeckView.cpp
src/Closest.cpp
src/Counters.cpp
src/Credits.cpp
src/Damage.cpp
src/DamagerDamaged.cpp
src/DeckDataWrapper.cpp
src/DeckEditorMenu.cpp
src/DeckManager.cpp
src/DeckMenu.cpp
src/DeckMenuItem.cpp
src/DeckMetaData.cpp
src/DeckStats.cpp
src/DeckView.cpp
src/DuelLayers.cpp
src/ExtraCost.cpp
src/GameApp.cpp
src/GameLauncher.cpp
src/GameObserver.cpp
src/GameOptions.cpp
src/GameStateAwards.cpp
src/GameState.cpp
src/GameStateDeckViewer.cpp
src/GameStateDuel.cpp
src/GameStateMenu.cpp
src/GameStateOptions.cpp
src/GameStateShop.cpp
src/GameStateStory.cpp
src/GameStateTransitions.cpp
src/GridDeckView.cpp
src/GuiAvatars.cpp
src/GuiBackground.cpp
src/GuiCardsController.cpp
src/GuiCombat.cpp
src/GuiFrame.cpp
src/GuiHand.cpp
src/GuiLayers.cpp
src/GuiMana.cpp
src/GuiPhaseBar.cpp
src/GuiPlay.cpp
src/GuiStatic.cpp
src/IconButton.cpp
src/InteractiveButton.cpp
src/ManaCost.cpp
src/ManaCostHybrid.cpp
src/MenuItem.cpp
src/ModRules.cpp
src/MTGAbility.cpp
src/MTGCard.cpp
src/MTGCardInstance.cpp
src/MTGDeck.cpp
src/MTGDefinitions.cpp
src/MTGGamePhase.cpp
src/MTGGameZones.cpp
src/MTGPack.cpp
src/MTGRules.cpp
src/ObjectAnalytics.cpp
src/OptionItem.cpp
src/PhaseRing.cpp
src/Player.cpp
src/PlayerData.cpp
src/PlayGuiObject.cpp
src/PlayGuiObjectController.cpp
src/PlayRestrictions.cpp
src/Pos.cpp
src/PriceList.cpp
src/ReplacementEffects.cpp
src/Rules.cpp
src/SimpleMenu.cpp
src/SimpleMenuItem.cpp
src/SimpleButton.cpp
src/SimplePad.cpp
src/SimplePopup.cpp
src/StoryFlow.cpp
src/Subtypes.cpp
src/StyleManager.cpp
src/TargetChooser.cpp
src/TargetsList.cpp
src/Tasks.cpp
src/TextScroller.cpp
src/ThisDescriptor.cpp
src/Token.cpp
src/Translate.cpp
src/TranslateKeys.cpp
src/Trash.cpp
src/utils.cpp
src/WCachedResource.cpp
src/WDataSrc.cpp
src/WEvent.cpp
src/WFilter.cpp
src/WFont.cpp
src/WGui.cpp
src/WResourceManager.cpp
src/WParsedInt.cpp
)
set(MTG_network_src src/NetworkPlayer.cpp)
#the sources we need if we compile a graphical qt version
#TODO: add declarative version since this only works with QWidget right now
set(MTG_qt_graphic_src
src/qt/filedownloader.cpp
src/qt/corewrapper.cpp
include/qt/corewrapper.h #so automoc finds it
include/qt/filedownloader.h
src/Qtmain.cpp)
#the sources we need to compile the testsuit
set(MTG_qt_console_src
src/Qtconsole.cpp
src/TestSuiteAI.cpp)
set(MTG_sdl_src
src/SDLmain.cpp)
set(MTG_android_sdl_src
src/SDLmain.cpp)
set(MTG_iOS_src
iOS/UI/WagicDownloadProgressViewController.m
iOS/asi-http-request/ASIAuthenticationDialog.m
iOS/asi-http-request/ASIDataCompressor.m
iOS/asi-http-request/ASIDataDecompressor.m
iOS/asi-http-request/ASIDownloadCache.m
iOS/asi-http-request/ASIFormDataRequest.m
iOS/asi-http-request/ASIHTTPRequest.m
iOS/asi-http-request/ASIInputStream.m
iOS/asi-http-request/ASINetworkQueue.m
iOS/SoundManager/SoundManager.m
iOS/SoundManager/MyOpenALSupport.c
iOS/Reachability/Reachability/Reachability.m
iOS/ZipArchive/ZipArchive.mm)
set(MTG_iOS_INCLUDE_DIRS iOS/UI iOS/Reachability/Reachability iOS/asi-http-request iOS/ZipArchive iOS/SoundManager)
set(MTG_INCLUDE_DIRS include include/qt)
set(JGE_INCLUDE_DIRS ../../JGE/include ../../JGE/include/hge)
set(JGE_LIBRARY jge)
set(EXTRA_INCLUDE_DIR extra)
#turn moc on
if(backend_qt_console OR backend_qt_widget)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC TRUE)
endif()
if(backend_qt_console)
if(UNIX AND NOT ANDROID)
include_directories(${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${ZIPFS_INCLUDE_DIR} ${Qt5Core_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS}
${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default)
add_executable(wagic ${MTG_generic_src} ${MTG_qt_console_src} ${MTG_network_src})
target_link_libraries(wagic ${JGE_LIBRARY} ${Qt5Core_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS} ${TINYXML_LIBRARIES}
${HGE_LIBRARY} ${ZLIB_LIBRARIES})
else()
message(FATAL_ERROR "qt-console builds are only supported on unix platforms")
endif()
elseif(backend_qt_widget)
if(UNIX AND NOT ANDROID)
include_directories(${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${ZIPFS_INCLUDE_DIR} ${Qt5Core_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS}
${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default)
add_executable(wagic ${MTG_generic_src} ${MTG_qt_graphic_src} ${MTG_network_src})
target_link_libraries(wagic ${JGE_LIBRARY} ${Qt5Core_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS} ${OPENGL_LIBRARIES} ${TINYXML_LIBRARIES}
${HGE_LIBRARY} ${ZLIB_LIBRARIES})# ${X11_LIBRARIES})
else()
message(FATAL_ERROR "qt-widget builds are only supported on unix platforms")
endif()
elseif(backend_sdl)
if((UNIX OR EMSCRIPTEN) AND NOT ANDROID)
include_directories(${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR} ${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
add_executable(wagic ${MTG_generic_src} ${MTG_sdl_src} ${MTG_network_src} src/TestSuiteAI.cpp src/AIPlayerBakaB.cpp)
target_link_libraries(wagic ${JGE_LIBRARY} ${SDL2_LIBRARY} ${OPENGL_LIBRARIES} ${TINYXML_LIBRARIES} ${HGE_LIBRARY} ${ZLIB_LIBRARIES})
elseif(ANDROID)
include_directories(${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR} ${BOOST_INCLUDE_DIRS} ${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR})
#we should try to get rid of this hack
add_library(wagic SHARED ${MTG_generic_src} ${MTG_network_src} ${MTG_android_sdl_src} src/TestSuiteAI.cpp)
target_link_libraries(wagic ${JGE_LIBRARY} ${SDL2_LIBRARY} ${OPENGL_LIBRARIES} ${TINYXML_LIBRARIES} ${HGE_LIBRARY} ${ZLIB_LIBRARIES})
elseif(WIN32)
include_directories(${EXTRA_INCLUDE_DIR} ${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR}
${Boost_INCLUDE_DIRS} ${UNZIP_INCLUDE_DIR} ${HGE_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
add_executable(wagic ${MTG_generic_src} ${MTG_sdl_src} src/TestSuiteAI.cpp src/AIPlayerBakaB.cpp)
link_directories(${Boost_LIBRARY_DIR} ${SDL2_LIBRARY_DIR})
target_link_libraries(wagic PRIVATE
${JGE_LIBRARY}
${PNG_LIBRARIES} # Explicitly link libpng
${ZIPFS_LIBRARY} # Explicitly link libzipFS
${SDL2_LIBRARY}
${OPENGL_LIBRARIES}
${TINYXML_LIBRARIES}
${HGE_LIBRARY}
${BOOST_date_time}
${ZLIB_LIBRARIES} # Ensure zlib is linked
)
endif()
elseif(backend_psp)
if(PSP)
#${PSPSDK_PATH}/include
include_directories(${MTG_INCLUDE_DIRS} ${JGE_INCLUDE_DIRS} ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR}
${UNZIP_INCLUDE_DIR} ${BOOST_INCLUDE_DIRS} ${GIF_INCLUDE_DIR} ${HGETOOLS_INCLUDE_DIRS})
add_executable(wagic ${MTG_generic_src} ${MTG_network_src})
target_link_libraries(wagic ${JGE_LIBRARY} ${PSPSDK_LIB} ${HGETOOLS_LIBRARY} ${FREETYPE_LIB} ${JPEG_LIBRARY}
${GIF_LIBRARIES} ${PNG_LIBRARIES} z m ${MIKMOD_LIBRARY} ${TINYXML_LIBRARIES}
stdc++ ${PSPSDK_REQUIRED_LIB})
set(PRXSPECS_FILE "${PSPSDK_PATH}/lib/prxspecs")
set(LINKFILE_FILE "${PSPSDK_PATH}/lib/linkfile.prx")
get_property(wagic_elf_location TARGET wagic PROPERTY LOCATION)
get_filename_component(wagic_elf_directory ${wagic_elf_location} PATH)
set_target_properties(wagic PROPERTIES LINK_FLAGS "-specs=${PRXSPECS_FILE} -Wl,-q,-T${LINKFILE_FILE}")
add_custom_command(TARGET wagic POST_BUILD
COMMAND ${PSPSDK_MKSFO_COMMAND} ARGS "'Wagic, the Homebrew?!'" "${wagic_elf_directory}/PARAM.SFO"
COMMAND ${PSPSDK_FIXUP_IMPORTS_COMMAND} ARGS ${wagic_elf_location}
COMMAND ${PSPSDK_PRXGEN_COMMAND} ARGS ${wagic_elf_location} "${wagic_elf_directory}/wagic.prx"
COMMAND ${PSPSDK_PACK_PBP_COMMAND} ARGS ${wagic_elf_directory}/EBOOT.PBP ${wagic_elf_directory}/PARAM.SFO ${CMAKE_CURRENT_SOURCE_DIR}/icon.png NULL ${CMAKE_CURRENT_SOURCE_DIR}/pic0.png ${CMAKE_CURRENT_SOURCE_DIR}/pic1.png NULL "${wagic_elf_directory}/wagic.prx" NULL)
else()
message(FATAL_ERROR "use the cross-compile toolchain to build as the psp target")
endif()
endif()
if(IOS)
set(MTG_generic_src ${MTG_generic_src} ${MTG_iOS_src} PARENT_SCOPE)
set(MTG_INCLUDE_DIRS ${MTG_INCLUDE_DIRS} ${MTG_iOS_INCLUDE_DIRS} PARENT_SCOPE)
endif()

File diff suppressed because it is too large Load Diff

View File

@@ -1,38 +1,63 @@
#NAME:Nightmare
#DESC:'All evil is as a nightmare'
#DESC:Thomas Carlyle
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Air Elemental (RV) (*) * 2
Animate Dead (RV) (*) * 2
Bad Moon (RV) (*) * 2
Bog Wraith (RV) (*) * 2
Cursed Land (RV) (*) * 1
El-Hajjaj (RV) (*) * 2
Fear (RV) (*) * 1
Hypnotic Specter (RV) (*) * 2
# RV Islands
1392
1392
1392
1392
1393
1393
1393
1393
1394
1394
1394
1394
Lifetap (RV) (*) * 2
Lord of Atlantis (RV) (*) * 2
Mahamoti Djinn (RV) (*) * 2
Merfolk of the Pearl Trident (RV) (*) * 4
Nightmare (RV) (*) * 4
Obsianus Golem (RV) (*) * 2
Scathe Zombies (RV) (*) * 3
# RV Islands
#DESC:I had a terrible Nightmare once
#DESC:and then a second
#DESC:and a third
#DESC:and then I won.
#2x Obsianus Golem
1129
1129
#2x animate dead
1143
1143
#2x Bad Moon
1144
1144
#2x Bog Wraith
1146
1146
#1x Cursed Land
1148
#1x Fear
1161
#2x El-Hajjâj
1158
1158
#2x Hypnotic Specter
1165
1165
#4x Nightmare
1170
1170
1170
1170
#3x Scathe Zombie
1177
1177
1177
#1x Unholy Strength
1183
#1x Wall of Bone
1184
#1x Zombie Master
1188
#2x Air Elemental
1189
1189
#2x Lifetap
1205
1205
#2x Lord of Atlantis
1206
1206
#2x Mahamoti Djinn
1208
1208
#4x Merfolk of the Pearl Trident
1210
1210
1210
1210
# Swamp (RV)
1373
1373
1373
@@ -45,6 +70,16 @@ Scathe Zombies (RV) (*) * 3
1375
1375
1375
Unholy Strength (RV)(*) * 1
Wall of Bone (RV) (*) * 1
Zombie Master (RV) (*) * 1
# Island (RV)
1392
1392
1392
1392
1393
1393
1393
1393
1394
1394
1394
1394

View File

@@ -1,24 +1,30 @@
#NAME:Howlings
#DESC:'What the howling deep down
#DESC:there conceals, no blessed
#DESC:living soul can tell'
#DESC:Friedrich Schiller
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Black Vise (MPS) * 4
#DESC:Supported by elemental rage
#DESC:goblins descend from the mountains
#DESC:to conquer the lands below.
# (PSY) added 2 Mountains, 1 Black Vise, 1 Howling Mine
# (would've been better to add creatures, but all creatures in the
# deck were already at 4 pieces))
# Land(s)
Mountain (8ED) * 20
# Creature(s)
Goblin King (8ED) * 4
Goblin Mountaineer (9ED) * 4
Goblin Piker (9ED) * 4
Goblin Striker (MRD) * 4
Hearthfire Hobgoblin (EVE) * 4
Howling Mine (8ED) * 3
Lightning Bolt (M10) * 4
Mountain (10E) * 4
Mountain (7ED) * 4
Mountain (8ED) * 4
Mountain (9ED) * 4
Mountain (M10) * 4
Raging Goblin (8ED) * 4
Spark Elemental (5DN) * 4
# Artifact(s)
Black Vise (V10) * 4
Howling Mine (8ED) * 3
# Instant(s)
Lightning Bolt (M10) * 4
# Sorcery(s)
Wheel of Fortune (VMA) * 1

View File

@@ -1,24 +1,79 @@
#NAME:Alliance
#DESC:Order, honor and community
#DESC:are preserved by the
#DESC:noble warriors and the
#DESC:towering castles of Bant
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Deft Duelist (ALA) * 4
Elvish Archers (RV) * 4
Forest (10E) * 4
Forest (ALA) * 3
Island (10E) * 3
Island (ALA) * 3
Plains (10E) * 4
Plains (ALA) * 3
Rhox War Monk (ALA) * 4
Savannah Lions (RV) * 4
Scryb Sprites (RV) * 4
Steward of Valeron (ALA) * 4
Swords to Plowshares (RV) * 4
Tundra Wolves (10E) * 4
Unsummon (RV) * 4
Waveskimmer Aven (ALA) * 4
#DESC:In the castle of Bant,
#DESC:the call to battle
#DESC:echoes the prayer of Asha.
#DESC:Prepare to face Bant's light!
#4x unsummon
1229
1229
1229
1229
#4x Elvish Archer {1}{G}, 2/1 first strike
1242
1242
1242
1242
#4x Scryb Sprites, Faerie, {G}, 1/1 flying
1264
1264
1264
1264
#4x Savannah Lion, {W},2/1
1365
1365
1365
1365
#4x Sword to plowshares {W}
1367
1367
1367
1367
#4x Tundra Wolves {W} - 1/1, first strike
129604
129604
129604
129604
#4x Waveskimmer Aven - Creature Bird Soldier - {2}{G}{W}{U} - 2/4 Flying Exalted
174955
174955
174955
174955
#4x Rhox War monk - Creature {G}{W}{U} - 3/4 Lifelink
174957
174957
174957
174957
#4x Deft duelist - Creature {W}{U} - 2/1 First Strike,Shroud
175121
175121
175121
175121
#4x Steward of Valeron - Creature — Human Druid Knight - {W}{G} - 2/2 {T}:add {G}
175134
175134
175134
175134
#7x plains 10E
129683
129683
129683
129683
129683
129683
129683
#7x Forest 10E
129562
129562
129562
129562
129562
129562
129562
#6x Island 10E
129609
129609
129609
129609
129609
129609

View File

@@ -1,26 +1,79 @@
#Plain black deck
#NAME:Terror
#DESC:'They groaned, they stirred,
#DESC:They groaned, they stirred,
#DESC:they all uprose,
#DESC:Nor spake, nor moved their eyes;
#DESC:It had been strange,
#DESC:even in a dream,
#DESC:To have seen those dead men rise'
#DESC:Samuel Taylor Coleridge
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Bad Moon (RV) * 4
Black Knight (RV) * 4
Black Vise (RV) * 4
Bog Wraith (10E) * 4
Hypnotic Specter (10E) * 4
Severed Legion (10E) * 4
Swamp (10E) * 4
Swamp (4ED) * 4
Swamp (9ED) * 4
Swamp (M10) * 4
Swamp (RV) * 4
Terror (10E) * 4
Unholy Strength (10E) * 4
Will-o'-the-Wisp (RV) * 4
Zombie Master (RV) * 4
#DESC:To have seen those dead men rise
#4x Hypnotic Specter
129600
129600
129600
129600
#4x Terror
135199
135199
135199
135199
#4x Bad moon
1144
1144
1144
1144
#4x Severed Legion
129693
129693
129693
129693
#4x Unholy Strength
129780
129780
129780
129780
#4x Black Vise
1097
1097
1097
1097
#4x Black Knight
1145
1145
1145
1145
#4x Bog Wraith
129491
129491
129491
129491
#4x Will-o'-the-Wisp
1187
1187
1187
1187
#4x Zombie Master
1188
1188
1188
1188
#20 x Swamp
1373
1373
1373
1373
1373
1373
1373
1373
1373
1373
1373
1373
1373
1373
1373
1373
1373
1373
1373
1373

View File

@@ -1,24 +1,79 @@
#NAME:Jungle
#DESC:In the heart of the jungle
#DESC:there are wild beasts
#DESC:both cunning and fierce
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Forest (10E) * 2
Forest (RV) * 4
Kird Ape (RV) * 4
Lightning Bolt (RV) * 4
Mountain (10E) * 4
Mountain (RAV) * 1
Mountain (RV) * 4
Plains (10E) * 4
Plains (RAV) * 1
Plains (RV) * 4
Savannah Lions (RV) * 4
Scryb Sprites (RV) * 4
Spark Elemental (10E) * 4
Swords to Plowshares (RV) * 4
Tundra Wolves (10E) * 4
Watchwolf (RAV) * 4
Woolly Thoctar (ALA) * 4
#DESC:Creatures of the mountains,
#DESC:forests, and plains,
#DESC:are ready to take their revenge.
# (PSY) added 1x Tundra Wolves, 1x Scryb Sprites, 1x Forest, 1x Mountain, to bring card count to 60
#Spark Elemental
129577
129577
129577
129577
#Tundra Wolves
129604
129604
129604
129604
#Watchwolf
83625
83625
83625
83625
#Wooly Thoctar
175062
175062
175062
175062
#Scryb Sprites
1264
1264
1264
1264
#Lightning Bolt
1303
1303
1303
1303
#Kird Ape
1302
1302
1302
1302
#Savannah Lions
1365
1365
1365
1365
#Swords to Plowshares
1367
1367
1367
1367
#Forest6
1388
1388
1388
1388
1388
1388
#Plains9
1397
1397
1397
1397
1397
1397
1397
1397
1397
#Mountain9
1390
1390
1390
1390
1390
1390
1390
1390
1390

View File

@@ -1,25 +1,86 @@
#NAME:Deep Blue
#DESC:'Here have we war for war,
#DESC:and blood for blood,
#DESC:Controlment for controlment'
#DESC:William Shakespeare
#DESC:"Are you sure you want to
#DESC: send that mighty creature
#DESC: into the battle?
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Air Elemental (10E) * 2
Boomerang (10E) * 4
Control Magic (RV) * 4
Coral Merfolk (M10) * 3
Counsel of the Soratami (10E) * 4
Gravelgill Axeshark (SHM) * 4
Island (10E) * 4
Island (4ED) * 4
Island (6ED) * 4
Island (9ED) * 4
Island (M10) * 4
Island (RV) * 4
Lord of Atlantis (RV) * 4
Mahamoti Djinn (10E) * 2
Merfolk of the Pearl Trident (RV) * 3
Persuasion (10E) * 2
Unsummon (10E) * 4
#DESC: You realize it might end up
#DESC: fighting against you, right?
#DESC:
#DESC: It's not like I did not warn
#DESC: you with that Boomerang ..."
#Blue Deck, with Persusasion
#24 Islands
158237
158237
158237
158237
158237
158237
158237
157875
157875
157875
157875
157875
157875
157875
157883
157883
157883
157883
157883
157883
157883
# (PSY) Actually these were only 21 Islands, adding 3 more:
158237
157875
157883
#3Jhessian Lookout
# (PSY) These were listed under "Islands"
176428
176428
176428
#4persusasion
129900
129900
129900
129900
#2Control Magic
1194
1194
#4Boomerang
129494
129494
129494
129494
#4Lord of Atlantis
1206
1206
1206
1206
#2Merfolk
# (PSY) Adding 1 to bring card count to 60
1210
1210
1210
#4Gravelgill
141935
141935
141935
141935
#4Unsummon
136218
136218
136218
136218
#4Counsel of the Soratami
134757
134757
134757
134757
#2Air Elemental
129459
129459
#2 Mahamoti djinn
129633
129633

View File

@@ -1,6 +1,6 @@
#NAME:Rats!
#DESC:'They fought the dogs,
#DESC: and killed the cats,
#DESC:"They fought the dogs,
#DESC: and killed the cats,
#DESC:And bit the babies in the cradles,
#DESC:And ate the cheeses out of the vats
#DESC:And licked the soup
@@ -10,19 +10,10 @@
#DESC:And even spoiled the women's chats,
#DESC:By drowning their speaking
#DESC:With shrieking and squeaking
#DESC:In fifty different sharps and flats.'
#DESC:Robert Browning
#HINT:combo hold(Fear|myhand)^until(Relentless Rats|mybattlefield)^cast(Fear|myhand) targeting(Relentless Rats|mybattlefield)^totalmananeeded({B}{B})
Ascendant Evincar (10E) * 2
Fear (10E) * 4
Oona's Gatewarden (SHM) * 4
Plague Beetle (10E) * 4
Plague Rats (RV) * 4
Rain of Tears (10E) * 4
Relentless Rats (10E) * 4
Relentless Rats (M10) * 4
Relentless Rats (M11) * 4
# SHM Swamps
#DESC:In fifty different sharps and flats."
#Black Deck, Rats
#26 Swamps
157886
157886
157886
157886
@@ -31,6 +22,12 @@ Relentless Rats (M11) * 4
157871
157871
157871
157871
157871
157871
158239
158239
158239
158239
158239
158239
@@ -39,6 +36,47 @@ Relentless Rats (M11) * 4
157889
157889
157889
Swamp (ALA) * 4
Swamp (10E) * 4
Swamp (M10) * 2
157889
157889
157889
#4plague rats
1173
1173
1173
1173
#4plague beetle
129678
129678
129678
129678
#12 relentless rats
135236
135236
135236
135236
135236
135236
135236
135236
135236
135236
135236
135236
#4Oona's Gatewarden
141975
141975
141975
141975
#4Fear
129544
129544
129544
129544
#Ascendant Evincar
106525
106525
#4rain of tears
135220
135220
135220
135220

View File

@@ -1,7 +1,7 @@
#NAME:Tobias Commander
#DESC:A master of strategy, Tobias
#DESC:Andrion helped engineer the
#DESC:rise of the Sheoltun Empire
#DESC:Tobias Andrion considers himself
#DESC:a master of strategy. Can you
#DESC:defeat him?
#DESC:
#DESC:Win Wagic duels to unlock
#DESC:more Commander opponents
@@ -10,6 +10,7 @@
#DESC:(mtggoldfish.com)
#DESC:Built for Wagic by Bob
#HINT:castpriority(commander,*)
Acrobatic Maneuver (*) * 1
Aethersnipe (*) * 1
Alabaster Dragon (*) * 1

View File

@@ -1,24 +1,77 @@
#NAME:Faeries
#DESC:Be warned, those are not butterflies!
#DESC:Faeries love pranks and games
#DESC:of deception
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Briarberry Cohort (SHM) * 4
Cloud Sprite (10E) * 4
Control Magic (RV) * 4
Faerie Swarm (SHM) * 2
Glen Elendra Liege (SHM) * 4
Island (10E) * 4
Island (LRW) * 4
Island (M10) * 4
Island (RV) * 4
Island (SHM) * 4
Mahamoti Djinn (10E) * 2
Oona's Gatewarden (SHM) * 4
Persuasion (10E) * 2
Plumeveil (SHM) * 4
Scion of Oona (LRW) * 4
Sentinels of Glen Elendra (LRW) * 2
Wasp Lancer (SHM) * 4
#DESC:Or ... the dangerous kind.
#Plain blue deck
#4 x Control Magic, {2}{U}{U}, Enchant creature
1194
1194
1194
1194
#2x Mahamoti Djinn
129633
129633
#2x Persuasion, {3}{U}{U}, Enchant creature, control magic
129900
129900
#4x Cloud Sprite,{U}, Creature Faerie,1/1,flying cloud
132069
132069
132069
132069
#2x Sentinels of glen Elendra,{3}{U}, Creature Faerie Soldier,2/3,flash flying
139426
139426
#4x Scien of Oona, Creature Faerie Soldier,1/1,flash flying,lord(faerie|myinplay)1/1
139741
139741
139741
139741
#4x Oona's Gatewarden, {BU},Creature Faerie Soldier,2/1,flying defender wihter
141975
141975
141975
141975
#4x Briaberry Cohort,{1}{U} Creature Faerie Soldier,1/1, flying +1/+1 aslongas(*[blue]|myinplay)
146043
146043
146043
146043
#4x Glen Elendra Liege,{1}{UB}{UB}{UB}, Creature Faerie Knight, flying 2/3 lord(creature[black;blue]|myinplay) 1/1
146743
146743
146743
146743
#4x Wasp Lancer, {UB}{UB}{UB}, Creature Faerie Soldier,3/2,flying
153967
153967
153967
153967
#4x Plumeveil,{UW}{UW}{UW}, Creature Elemental,4/4,flash flying defender
153980
153980
153980
153980
#2x Faerie Swarm, {3}{U}, Creature Faerie,*/*,flying,foreach(*[blue]|myinplay)1/1
158685
158685
#20 x Island (10E)
129606
129606
129606
129606
129606
129606
129606
129606
129606
129606
129606
129606
129606
129606
129606
129606
129606
129606
129606
129606

View File

@@ -1,22 +1,78 @@
#NAME:Kithkin
#DESC:Quick, agile and cooperative,
#DESC:the Kithkin value community,
#DESC:simplicity and honesty.
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Armored Ascension (SHM) * 4
Ballynock Cohort (SHM) * 4
Cenn's Heir (LRW) * 4
Field Marshal (10E) * 4
Glorious Anthem (10E) * 4
Goldmeadow Dodger (LRW) * 4
Mobilization (10E) * 4
Plains (10E) * 4
Plains (9ED) * 4
Plains (LRW) * 4
Plains (M10) * 4
Plains (SHM) * 4
Thistledown Liege (SHM) * 4
Wizened Cenn (LRW) * 4
Zealous Guardian (SHM) * 4
#DESC:Led by the Cenn,
#DESC:united by the thoughtweft,
#DESC:challenge just one
#DESC:champion of Goldmeadow,
#DESC:and you will face
#DESC:the entire cla-chan!
#4x Glorious Anthem, {1}{W}{W}, Enchantment, Creatures you control get +1/+1
129572
129572
129572
129572
#4x Wizened Cenn,{W}{W}, Creature - Kithkin Cleric,2/2, other kithin get +1/+1
139716
139716
139716
139716
#4x Zealous Guardian,{WU}, Creature - Kithkin Soldier,1/1,flash
142028
142028
142028
142028
#4x Ballynock Cohort,{2}{W},Creature - Kithkin Soldier,2/2,First strike, get +1/+1 aslongas you control another white creature
142045
142045
142045
142045
#4x Armored Ascension,{3}{W},Enchant creature, +1/+1 for each plains and flying
146041
146041
146041
146041
#4x Thistledown Liege,{1}{WU}{WU}{WU}, 1/3, creature - Kithkin Knight, give +1/+1 to blue and white creature you control
147409
147409
147409
147409
#4x Kihtkin Shielddare, {1}{W},1/1 creature - Kithkin soldier, {t}{W}:target blocking creature gets +2/+2
158238
158238
158238
158238
#4x Goldmeadow Harrier, {W},1/1 creature - Kithkin soldier,{W}:tap target creature
139397
139397
139397
139397
#4x Field Marshall, {1}{W}{W}, 2/2 creature - Human soldier, Other Soldier creatures get +1/+1 and have first strike
135258
135258
135258
135258
#4x Mobilization, {2}{W}, enchantment, Soldier creatures have vigilance, {2}{W}:Put a 1/1 white Soldier creature token into play
129716
129716
129716
129716
#20x Plains (10E)
129683
129683
129683
129683
129683
129683
129683
129683
129683
129683
129683
129683
129683
129683
129683
129683
129683
129683
129683
129683

View File

@@ -1,23 +1,77 @@
#NAME:Wilt-Leaf Liege
#DESC:The Wilt-Leaf Wood is sickly,
#DESC:but the Elven lords jealously
#DESC:guard its remaining beauties.
#DESC:And here you thought you would enjoy
#DESC:a little trip in the forest...
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Blanchwood Armor (10E) * 4
Cylian Elf (ALA) * 4
Dauntless Dourbark (LRW) * 2
Elvish Archers (RV) * 4
Elvish Champion (10E) * 4
Forest (10E) * 4
Forest (ALA) * 4
Forest (LRW) * 4
Forest (RV) * 4
Forest (SHM) * 4
Imperious Perfect (LRW) * 4
Safehold Elite (SHM) * 4
Twinblade Slasher (EVE) * 4
Wildslayer Elves (SHM) * 2
Wilt-Leaf Cavaliers (SHM) * 4
Wilt-Leaf Liege (SHM) * 4
#DESC:Who said only Goblins were nasty?
#4x Elvish Archers,{1}{G},2/1,Creature Elf,first strike
1242
1242
1242
1242
#4x Elvish Champion,{1}{G}{G},2/2,Creature Elf,Other elf gets +1/+1 and forestwalk
129534
129534
129534
129534
#4x Blanchwood Armor,{2}{G}, Enchant Creature, give +1/+1 foreach forest you control
135267
135267
135267
135267
#2x Wildslayer Elves, {3}{G},3/3, Creature Elf Warrior, Wither
135436
135436
#4x Inperious Perfect,{2}{G}, 2/2 Creature Elf Warrior, gives +1/+1 other elf you control +token 1/1 elf for {T}{G}
139683
139683
139683
139683
#2x Dauntless Dourbark,{3}{G},*/*,Creature Treefolk warrior, power/toughness = nb of forest you control
141851
141851
#4x Safehold Elite, {1}{WG},2/2, Creature Elf Scout, Persist
146077
146077
146077
146077
#4x Boartusk Liege, {1}{RG}{RG}{RG},3/4, Creature Goblin Knight, tramples & Gives +1/+1 to red&green creatures you control
147428
147428
147428
147428
#4x Twinblade Slasher,{G},1/1,Creature Elf Warrior, wither {1}{G}:+2/+2 only once per turn
153436
153436
153436
153436
#4X Wilt-Leaf Cavaliers,{WG}{WG}{WG}, 3/4, Creature Elf Knight, Vigilance
153962
153962
153962
153962
#4x Cylian Elf,{1}{G},2/2,Creature Elf Scout
174935
174935
174935
174935
#20x Forest
129560
129560
129560
129560
129560
129560
129560
129560
129560
129560
129560
129560
129560
129560
129560
129560
129560
129560
129560
129560

View File

@@ -1,17 +1,66 @@
#NAME:Taiga
#DESC:Beware the fires deep in
#DESC:the boreal forest
#DESC:The forces of fire and nature unite.
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Cockatrice (RV) (*) * 2
Craw Wurm (RV) (*) * 3
Earth Elemental (RV) (*) * 2
Elvish Archers (RV) (*) * 2
Firebreathing (RV) (*) * 1
Fire Elemental (RV) (*) * 2
Flashfires (RV) (*) * 2
# RV Forests
#DESC:Can you withstand
#DESC:their combined fervor?
#2x Cockatrice
1238
1238
#3x Craw Wurm
1239
1239
1239
#2x Elvish Archers
1242
1242
#2x Giant Spider
1249
1249
#2x Grizzly Bears
1250
1250
#2x Scryb Sprites
1264
1264
#2x Shanodin Dryads
1265
1265
#1x Tranquility
1270
#1x Tsunami
1271
#2x Earth Elemental
1287
1287
#2x Fire Elemental
1290
1290
#1x Flashfires
1293
#3x Goblin King
1296
1296
1296
#2x Hill Giant
1299
1299
#4x Mons's Goblin Raiders
1308
1308
1308
1308
#2x Orcish Oriflamme
1310
1310
1310
# (PSY) Power Surge not available any more, replaced with a third Orcish Oriflamme
#1x Power Surge
#1311
#1x Wheel of Fortune
1326
#1x White Ward
1371
#Forest (RV)
1386
1386
1386
@@ -24,12 +73,7 @@ Flashfires (RV) (*) * 2
1388
1388
1388
Giant Spider (RV) (*) * 2
Goblin King (RV) (*) * 3
Grizzly Bears (RV) (*) * 2
Hill Giant (RV) (*) * 2
Mons's Goblin Raiders (RV) (*) * 4
# RV Mountains
#Mountain
1389
1389
1389
@@ -42,9 +86,3 @@ Mons's Goblin Raiders (RV) (*) * 4
1391
1391
1391
Orcish Oriflamme (RV) (*) * 2
Scryb Sprites (RV) (*) * 2
Shanodin Dryads (RV) (*) * 2
Tranquility (RV) (*) * 1
Tsunami (RV) (*) * 1
Wheel of Fortune (RV) (*) * 1

View File

@@ -1,25 +1,79 @@
#NAME:Bad Moon
#DESC:'Happiness never flourishes
#DESC:by the light of the moon.'
#DESC:Friedrich Schiller
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
#HINT:alwaysattackwith(Erg Raiders)
Ascendant Evincar (10E) * 2
Bad Moon (RV) * 4
Black Knight (RV) * 4
Erg Raiders (RV) * 4
Eyeblight's Ending (LRW) * 2
Glen Elendra Liege (SHM) * 4
Hypnotic Specter (10E) * 4
Nyxathid (CFX) * 4
Oona's Gatewarden (SHM) * 4
Swamp (10E) * 4
Swamp (M10) * 4
Swamp (LRW) * 4
Swamp (RV) * 4
Swamp (SHM) * 4
Terror (10E) * 2
Unholy Strength (10E) * 4
Wasp Lancer (SHM) * 2
#DESC:The night falls down,
#DESC:the trouble begins.
#DESC:The specter of evil,
#DESC:will bring you back
#DESC:to black!
#4x Bad Moon,{1}{B}, Enchantment, all black creature gets +1/+1
1144
1144
1144
1144
#4x Black knight,{B}{B}, Creature Knight,2/2, first strike protection from white
1145
1145
1145
1145
#4x Erg Raiders,{1}{B},2/3, does 2 damage to controller if you do not attack with
1159
1159
1159
1159
#2x Ascendant Evincar,{4}{B}{B},3/3, Legendary Creature Vampire,Flying all black creature get +1/+1 other -1/-1
106525
106525
#4x Hypnotic Specter,{1}{B}{B},2/2, Creature Specter, Flying opponent discard a card if damaged by HS
129600
129600
129600
129600
#4x Unholy Strengh, {B}, Enchant creature, gives +2/+1
129780
129780
129780
129780
#2x terror, {1}{B}, bury target non black, non artifact creature
135199
135199
#2xEyeblight's Ending,{2}{B},destroy target non-elf creature
139449
139449
#4x Oona's Gatewarden, {UB},2/1, flying defender wither
141975
141975
141975
141975
#4x Glen Elendra Liege,{1}{UB}{UB}{UB}, Creature Faerie Knight, flying 2/3 lord(creature[black;blue]|myinplay) 1/1
146743
146743
146743
146743
#2x Wasp Lancer, {UB}{UB}{UB}, Creature Faerie Soldier,3/2,flying
153967
153967
#4x Nyxathid,{1}{B}{B}, Creature Elemental, pow/thg = 7-nb cards opponent
186616
186616
186616
186616
#20x Swamp (10E)
129754
129754
129754
129754
129754
129754
129754
129754
129754
129754
129754
129754
129754
129754
129754
129754
129754
129754
129754
129754

View File

@@ -1,25 +1,80 @@
#NAME:Goblin Gang
#DESC:'We must not look at goblin men,
#DESC:We must not buy their fruits:
#DESC:Who knows upon what soil they fed
#DESC:Their hungry thirsty roots?'
#DESC:Christina Rossetti
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Bloodmark Mentor (SHM) * 2
Boartusk Liege (SHM) * 4
Boggart Ram-Gang (SHM) * 4
Goblin Gang Leader (ANB) * 2
Goblin King (10E) * 4
Lightning Bolt (RV) * 4
Mountain (10E) * 4
Mountain (ANB) * 4
Mountain (POR) * 4
Mountain (RV) * 4
Mountain (SHM) * 4
Orcish Oriflamme (RV) * 4
Raging Goblin (1OE) * 4
Scuzzback Scrapper (SHM) * 4
Spark Elemental (10E) * 4
Volcanic Hammer (POR) * 4
#NAME:Burning
#DESC:Better be prepared,
#DESC:to burn the midnight oil.
#DESC:The goblin brashness
#DESC:will make you boil.
#DESC:And you will end
#DESC:burning with a low flame ...
#2 x Bloodmark Mentor
142062
142062
#4x Scuzzback Scrapper
142052
142052
142052
142052
#4x Goblin king (10E)
129578
129578
129578
129578
#4x Volcanic hammer
4366
4366
4366
4366
#4x Boggart Ram-Gang
153970
153970
153970
153970
#4x Lightning Bolt
1303
1303
1303
1303
#4x orcish oriflame
1310
1310
1310
1310
#4x Raging goblin
129688
129688
129688
129688
#4xBoartusk Liege
147428
147428
147428
147428
#2x Siege Gang Commander
130539
130539
#4x Spark elemental
129577
129577
129577
129577
#20x Mountain
129650
129650
129650
129650
129650
129650
129650
129650
129650
129650
129650
129650
129650
129650
129650
129650
129650
129650
129650
129650

View File

@@ -1,27 +1,83 @@
#NAME:Giants!
#DESC:'Who shall place
#DESC:A limit to the giant's
#DESC:unchained strength?'
#DESC:William Cullen Bryant
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
#DESC:
#DESC:Deck for Wagic by Bob
#HINT:dontattackwith(Mogg Sentry)
Blind-Spot Giant (LRW) * 4
Borderland Behemoth (MOR) * 2
Calamity Bearer (KHM) * 4
Inferno Titan (M11) * 3
Mogg Sentry (9ED) * 4
Mountain (9ED) * 4
Mountain (FDN) * 4
Mountain (LRW) * 4
Mountain (M11) * 4
Mountain (RAV) * 4
Mountain (SHM) * 4
Mountain (TMP) * 4
Skyraker Giant (FDN) * 4
Stinkdrinker Daredevil (LRW) * 4
Sunrise Sovereign (LRW) * 3
Universal Automaton (MH1) * 4
#DESC:It's actually very hard to miss a giant.
#DESC:You don't even have to aim your blow well.
#DESC:The hard part
#DESC:is to get into striking range.
#Mogg Fanatic
4832
4832
4832
4832
#Kithkin Greatheart 1W
146444
146444
146444
146444
#Ballyknock Cohort
142045
142045
142045
142045
#Sunrise Sovereign 5R
139667
139667
139667
139667
#Axegrinder Giant
145976
145976
145976
145976
#Blind Spot Giant
146597
146597
146597
146597
#Borderland Behemoth
153102
153102
#Oathsworn Giant {4}{W}{W} - 3/4 giant - lord creature|myinplay 0/2 vigilance other
89012
89012
#Pyroclasm
129801
129801
129801
129801
#Wall of Stone
1325
1325
1325
1325
#Smash
130532
#Kitchen Finks
141976
141976
141976
#Mountain
143626
143626
143626
143627
143627
143627
143631
143631
143631
143623
143623
143623
#Plains
143630
143630
143630
143620
143620
143620
143622
143622
143622
143621
143621
143621

View File

@@ -1,29 +1,77 @@
#NAME:Selesnya Conclave
#DESC:Some say that the
#DESC:Conclave's peaceful ways
#DESC:hide sinister coercion
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
#DESC:
#DESC:Deck by superhiro,
#DESC:refined by Bob
Anthem of Champions (FDN) * 4
Carven Caryatid (RAV) * 4
Courier Hawk (RAV) * 2
Faithful Watchdog (MH3) * 2
Fists of Ironwood (RAV) * 4
Forest (FDN) * 4
Forest (GRN) * 4
Forest (RAV) * 4
Goliath Spider (RAV) * 2
Nightguard Patrol (RAV) * 3
Plains (FDN) * 4
Plains (GRN) * 4
Plains (RAV) * 4
Scion of the Wild (RAV) * 3
Tolsimir Wolfblood (RAV) * 2
Vernadi Shieldmate (GRN) * 2
Veteran Armorer (RAV) * 2
Voice of Resurgence (MM3) * 2
Watchwolf (RAV) * 4
#NAME:Selesnya
#DESC:Do you dare arming yourself
#DESC:against the conclave?
#Carven Caryatid
89048
89048
89048
89048
#Courier Hawk
87913
87913
#Fists of Ironwood
83672
83672
83672
83672
#Goliath Spider
88959
88959
#Nightguard Patrol
87975
87975
87975
#Scion of the Wild
83647
83647
83647
#Selesnya Guildmage
87988
87988
87988
87988
#Tolsimir Wolfblood
89110
89110
#Veteran Armorer
87950
87950
#Knight of the Skyward Eye
175047
175047
#Watchwolf
83625
83625
83625
83625
#Glorious Anthem
129572
129572
129572
129572
#Forest
95097
95097
95097
95106
95106
95106
95099
95099
95099
95098
95098
95098
#Plains
95112
95112
95112
95108
95108
95108
95115
95115
95115
95105
95105
95105

View File

@@ -1,24 +1,41 @@
#NAME:Soldiers
#DESC:We stand together, strong and true,
#DESC:A wall of swords and shields.
#DESC:We will not stop,
#DESC:We will not break,
#DESC:And never will we yield.
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Balefire Liege (EVE) * 4
Captain of the Watch (M10) * 4
Elite Vanguard (M10) * 4
Glorious Anthem (USG) * 4
Honor of the Pure (M10) *4
Plains (M10) * 4
Plains (M11) * 4
Plains (M12) * 4
Plains (M13) * 4
Plains (RAV) * 4
Plains (USG) * 4
Rhox Pikemaster (M10) * 4
Veteran Armorer (RAV) * 4
Veteran Armorsmith (M10) * 4
Veteran Swordsmith (M10) * 4
#DESC:We stand together
#DESC:Man by man
#DESC:A marching wall of swords and shields
#DESC:We will not stop
#DESC:We will not bend
#DESC:And never, never will we yield.
Rhox Pikemaster *4
Veteran Armorsmith *4
Veteran Swordsmith *4
Captain of the Watch *4
Elite Vanguard *4
Honor of the Pure *4
Glorious Anthem *4
Veteran Armorer *4
Balefire Liege *4
#Plains
191382
191382
191382
191382
191382
191382
191395
191395
191395
191395
191395
191395
191396
191396
191396
191396
191396
191396
191385
191385
191385
191385
191385
191385

View File

@@ -1,29 +1,72 @@
#NAME:Dark Elves
#DESC:The elves who wandered
#DESC:too deeply in the forest
#DESC:were unable to escape
#DESC:its shadows.
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
#DESC:
#DESC:Original deck concept by
#DESC:Nakano, deck refined by Bob
Drider (AFR) * 2
Elderfang Disciple (KHM) * 4
Eyeblight Cullers (CMR) * 2
Eyeblight's Ending (LRW) * 4
Infestation Sage (FDN) * 4
Nadier, Agent of the Duskenel (CMR) * 2
Nadier's Nightblade (CMR) * 4
Prowess of the Fair (LRW) * 4
Ruthless Winnower (KHC) * 2
Swamp (CLB) * 4
Swamp (ELD) * 2
Swamp (FDN) * 4
Swamp (KHM) * 4
Swamp (LRW) * 4
Swamp (MKM) * 4
Thornbow Archer (MB1) * 4
Unscrupulous Agent (MKM) * 4
Viconia, Drow Apostate (CLB) * 2
#NAME:Lafiel
#DESC:Meet the army of the influential
#DESC:elven princess Lafiel.
#DESC:Don't be fooled by their beauty
#DESC:or you will lose
#DESC:more than just your mind!
#(Wagic 0.81 Deck & Avatar by Nakano)
#v0.1 / 01.09.2009
# Initial release
#v0.2 / 02.09.2009
# - Swamp (10E) *1 = 0
# - Algae Gharial (ALA) *3 = 0
# - Centaur Glade (ONS) *1 = 0
# - Farhaven Elf (SHM) *2 = 0
# + Forest (10E) *1 = 12
# + Birds of Paradise (RAV) *2 = 3
# + Civic Wayfinder (10E) *2 = 4
# + Regal Force (EVE) *1 = 2
# + Lorescale Coatl (ARB) *2 = 4
#Mana (16)
Forest (10E) *12
Island (10E) *2
Mountain (10E) *2
#Green (30)
Birds of Paradise (RAV) *3
Blanchwood Armor (USG) *1
Civic Wayfinder (10E) *4
Cloudcrown Oak (LRW) *2
Collective Unconscious (MRQ) *1
Druid of the Anima (ALA) *2
Elvish Piper (10E) *1
Elvish Promenade (LRW) *1
Howl of the Night Pack (SHM) *1
Immaculate Magistrate (LRW) *1
Imperious Perfect (LRW) *1
Juvenile Gloomwidow (SHM) *1
Llanowar Elves (10E) *1
Lys Alana Huntmaster (LRW) *1
Nomadic Elf (INV) *1
Primal Rage (10E) *1
Primordial Sage (RAV) *1
Regal Force (EVE) *2
Spidersilk Armor (MRQ) *1
Thicket Basilisk (RV) *1
Wellwisher (ONS) *2
#Blue (1)
Levitation (M10) *1
#Red (6)
Battle Squadron (MRQ) *1
Dragon Fodder (ALA) *1
Keldon Warlord (RV) *1
Lava Axe (POR) *1
Pyroclasm (ICE) *2
#Black (1)
Prowess of the Fair (LRW) *1
#Multicolor (4)
Lorescale Coatl (ARB) *4
#Artifact (2)
Obelisk of Bant (ALA) *1
Obelisk of Grixis (ALA) *1
#MANA + GREEN + BLUE + RED + BLACK + MULTI + ARTIFACT
#16 + 30 + 1 + 6 + 1 + 4 + 2 =60

View File

@@ -1,6 +1,7 @@
#NAME:Atarka Commander
#DESC:Savage and ferocious, Atarka
#DESC:is universally feared
#DESC:Atarka's dragons bring death
#DESC:from the air. Can you defeat
#DESC:her?
#DESC:
#DESC:Win Wagic duels to unlock
#DESC:more Commander opponents

View File

@@ -1,27 +1,84 @@
#NAME:Undead Infiltrator
#DESC:The dead rise up from
#DESC:the darkest depths
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Deepchannel Mentor (SHM) * 1
Glen Elendra Liege (SHM) * 4
Inkfathom Infiltrator (SHM) * 2
Island (10E) * 4
Island (RV) * 4
Island (SHM) * 2
Lord of Atlantis (RV) * 4
Lord of the Undead (10E) * 4
Marauding Knight (INV) * 2
Metathran Zombie (INV) * 2
Oona's Gatewarden (SHM) * 4
Sanguine Guard (USG) * 2
Swamp (10E) * 4
Swamp (RV) * 4
Swamp (SHM) * 2
Underground Sea (RV) * 2
Vodalian Zombie (INV) * 4
Walking Dead (LEG) * 2
Wasp Lancer (SHM) * 1
Zombie Master (RV) * 2
Zombie Outlander (CRX) * 4
#DESC:You may be prepared
#DESC:for an army of zombies
#DESC:rising from the graves.
#DESC:But did also expect them
#DESC:to crawl
#DESC:out of the sea?
#4x Glen Elendra Liege {1}{UB}{UB}{UB} - flying lord black/blue creature +1/+1
146743
146743
146743
146743
#4x Lord of atlantis -{U}{U} 1/1 Lord merfolk +1/+1
1206
1206
1206
1206
#4x Lord of the Undead - {1}{B}{B} - 2/2 Lord zombie +1/+1
129629
129629
129629
129629
#2x Sanguine Guard {1}{B}{B} - Zombie 2/2 first strike {1}{B}:regenerate
5627
5627
#2x Walking dead {1}{B} - 1/1 zombie, {B}:regenerate
1466
1466
#4x Oona's Gatewarden {BU} - defender flying faerie 2/1 wither
141975
141975
141975
141975
#2x Marauding Knight, Zombie {2}{B}{B}, protection from white 2/2 +1/+1 for each plains|opponentinplay
23053
23053
#2x Methatran Zombie, {1}{U}, 1/1
22973
22973
#2x Inkfathom Infiltrator {UB}{UB} - Merfolk 2/1 cantblock, unblockable
154401
154401
#2x Stillmoon Cavalier {1}{WB}{WB} - Zombie knight 2/1 protection from white and black {WB}:flying {WB}:first strike
153037
153037
#4x Vodalian zombie {B}{U}, zombie merfolk 2/2 protection from green
23159
23159
23159
23159
#1x Wasp lancer {BU}{BU}{BU} 3/2 faerie flying
153967
#1x Deepchanel Mentor {5}{U}, 2/2 merfolk lord blue creature:unblockable
141981
#2x Zombie master {1}{B}{B} - 2/3 zombie lord swampwalk {B}:regenerate
1188
1188
#4x Zombie outlander {B}{U} - 2/2 protection from green
185138
185138
185138
185138
#Island
129606
129606
129606
129606
129607
129607
129608
129608
129609
129609
#Swamp
129754
129754
129754
129754
129755
129755
129756
129756
129757
129757

View File

@@ -1,28 +1,90 @@
#NAME:Depletion
#DESC:The cruellest fate for a
#DESC:spellcaster is to stand
#DESC:helpless as your power
#DESC:drains away.
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Animate Dead (RV) * 4
Control Magic (RV) * 2
Dreamborn Muse (10E) * 2
Forced Fruition (LRW) * 2
Glen Elendra Liege (SHM) * 2
Glimpse the Unthinkable (RAV) * 4
Howling Mine (10E) * 2
Island (10E) * 4
Island (LRW) * 4
Island (SHM) * 4
Memory Erosion (ALA) * 2
Mortivore (10E) * 2
Oona's Gatewarden (SHM) * 4
Swamp (10E) * 4
Swamp (LRW) * 4
Swamp (SHM) * 4
Terror (10E) * 2
Tome Scour (M10) * 4
Traumatize (10E) * 3
Underground Sea (RV) * 1
#DESC:More than one mage
#DESC:has been driven insane by
#DESC:the howl of the mine,
#DESC:Dreamborn Muse's voice,
#DESC:and Mortivore's breath.
#DESC:Prepare to discover the truth
#DESC:of the House Dimir.
# (PSY) added 2x Swamp, 2x Island, 1x Psychic Drain,
# 1x Forced Fruition, 1x Tome Scour, 1x Traumatize,
# to bring card count to 60.
#4x Animate Dead
1143
1143
1143
1143
#2x Control Magic
1194
1194
#3x Tome Scour
191598
191598
191598
#4x Glimpse the Unthinkable
83597
83597
83597
83597
#2x Psychic Drain
89114
89114
#2x Forced Fruition
146166
146166
#2x Howling Mine
129598
129598
#2x Memory Erosion
175108
175108
#2x Mortivore
129648
129648
#2x Terror
135199
135199
#2x Dreamborn Muse
135246
135246
#3x Traumatize
129774
129774
129774
#4x Oona's Gatewarden
141975
141975
141975
141975
#2x Glen Elendra Liege
146743
146743
#12x Swamp
129754
129754
129754
129754
129755
129755
129755
129755
129757
129757
129757
129757
#12x Island
129607
129607
129608
129608
129608
129608
129609
129609
129609
129609
129609
129609

View File

@@ -1,23 +1,79 @@
#NAME:Vigilant Watch
#DESC:Eyes ever wakeful,
#DESC:eyes ever watchful.
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Akrasan Squire (ALA) * 4
Armored Ascension (SHM) * 4
Aven Squire (CFX) * 2
Aven Trailblazer (CFX) * 2
Ballynock Cohort (SHM) * 4
Castle (RV) * 2
Field Marshal (10E) * 4
Glorious Anthem (10E) * 4
Mobilization (10E) * 4
Plains (10E) * 4
Plains (ALA) * 4
Plains (RAV) * 4
Plains (SHM) * 4
Plains (USG) * 4
Serra Zealot (USG) * 2
Soltari Foot Soldier (TMP) * 4
Veteran Armorer (RAV) * 4
#DESC:A single soldier may sleep,
#DESC:but the squad never does.
#DESC:Vigilant and watchful
#DESC:they will be ready to fight
#DESC:as soon as you arrive.
#4x Akrasan Squire - human soldier {W}, 1/1 exalted
174963
174963
174963
174963
#4x Armored Ascension - {3}{W} - enchant creature - +1/+1 for each plains
146041
146041
146041
146041
#2x Aven Squire - Bird soldier {1}{W},1/1 flying,exalted
184992
184992
#4x Veteran Armorer - {1}{W} - 2/2 creature you control get +0/+1
87950
87950
87950
87950
#4x Ballynock Cohort, Kithkin Soldier {2}{W}, 2/2, first strike +1/+1 as long as you control another white creature.
142045
142045
142045
142045
#2x Aven Trailblazer, {2}{W} 2/*, bird soldier flying, domain (toughness = basic land you control)
180278
180278
#2x Castle {3}{W} - Enchantment, untapped creature you control get +0/+2
1334
1334
#4x Field Marshal {1}{W}{W} - 2/2 - other soldier get +1/+1 and first strike
135258
135258
135258
135258
#4x Glorious Anthem {1}{W}{W} - Enchantment - creature you control get +1/++
129572
129572
129572
129572
#2x Serra Zealot {W} - 1/1 - First strike
5707
5707
#4x Mobilization {2}{W} - Soldier get vigilance - {2}{W} put a 1/1 soldier in play
129716
129716
129716
129716
#20x plains
1395
1395
1395
1395
129680
129680
129680
129680
129681
129681
129681
129681
129682
129682
129682
129682
129683
129683
129683
129683
#4x Soltari Foot Soldier, {W}, 1/1 shadow
4901
4901
4901
4901

View File

@@ -1,33 +1,39 @@
#NAME:Savannah
#DESC:Beasts stalk their prey
#DESC:among the tall grasses
#DESC:
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Armageddon (VMA) * 1
Black Vise (V10) * 2
Builder's Blessing (AVR) * 2
#DESC:United against the terrible
#DESC:Phyrexian Fate,
#DESC:there is no time for dispute
#DESC:or rivalries
#DESC:in Eladamri and Gerrard's army
# (PSY) 2x Benalish Hero not available any more, removed (deck has still >60 cards)
# (PSY) 2x Mesa Pegasus not available any more, removed (deck has still >60 cards)
# Land(s)
Forest (8ED) * 13
Plains (8ED) * 9
# Creature(s)
Cockatrice (TSB) * 2
Craw Wurm (9ED) * 2
Crusade (DDF) * 2
Forest (8ED) * 4
Forest (9ED) * 4
Forest (MRD) * 1
Forest (ONS) * 4
Giant Spider (AKH) * 2
Grizzly Bears (8ED) * 2
Jukai Messenger (CHK) * 4
Kessig Recluse (DKA) * 2
Living Lands (ME4) * 1
Plains (8ED) * 4
Plains (9ED) * 1
Plains (ONS) * 4
Rhox Charger (ALA) * 1
Spitting Spider (8ED) * 2
Ronom Unicorn (CSP) * 2
Savannah Lions (A25) * 2
Scute Mob (ZEN) * 3
Serra Angel (M13) * 2
Spitting Spider (8ED) * 2
Jukai Messenger (CHK) * 4
Kessig Recluse (DKA) * 2
Rhox Charger (ALA) * 1
# Artifact(s)
Black Vise (V10) * 2
The Rack (DPA) * 2
# Enchantment(s)
Builder's Blessing (AVR) * 2
Crusade (DDF) * 2
Living Lands (ME4) * 1
# Sorcery(s)
Armageddon (VMA) * 1
Wrath of God (8ED) * 2

View File

@@ -1,27 +1,31 @@
#NAME:Imperious Vanguard
#DESC:Elves beyond number
#DESC:from the forest
#DESC:without end.
#DESC:An endless stream
#DESC:of elvish warriors
#DESC:will overwhelm you,
#DESC:powered by an unceasing
#DESC:supply of mana.
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
#HINT:combo hold(Elvish Promenade|myhand)^cast(Elvish Promenade|myhand)^restriction{type(creature|mybattlefield)~morethan~1}^totalmananeeded({3}{G})
#HINT:combo hold(Overrun|myhand)^cast(Overrun|myhand)^restriction{type(creature|mybattlefield)~morethan~2}^totalmananeeded({2}{G}{G}{G})
#DESC:Flee!
#DESC:
#DESC:You have no chance!
# Land(s)
Forest (M12) * 20
Gaea's Cradle (PRM) * 1
Pendelhaven (A25) * 1
# Creature(s)
Drove of Elves (SHM) * 1
Elvish Archdruid (M10) * 4
Elvish Hexhunter (SHM) * 4
Elvish Promenade (LRW) * 4
Elvish Vanguard (EMA) * 4
Elvish Visionary (ALA) * 4
Forest (10E) * 4
Forest (9ED) * 4
Forest (LRW) * 4
Forest (M10) * 4
Forest (M12) * 4
Gaea's Cradle (PRM) * 1
Heedless One (ONS) * 3
Heedless One (PSAL) * 3
Imperious Perfect (LRW) * 4
Llanowar Elves (9ED) * 4
Overrun (10E) * 2
Pendelhaven (A25) * 1
Wellwisher (C14) * 4
# Sorcery(s)
Elvish Promenade (LRW) * 4
Overrun (10E) * 2

View File

@@ -1,23 +1,28 @@
#NAME:Angelic Sigil
#DESC:'Every crime has in the
#DESC:moment of its perpetration
#DESC:its own avenging angel'
#DESC:Friedrich Schiller
#HINT:combo hold(Wrath of God|myhand)^cast(Wrath of God|myhand)^restriction{type(creature|opponentbattlefield)~morethan~2}^totalmananeeded({2}{W}{W})
#NAME:Angelism
#DESC:An army of angels
#DESC:will sweep through your defenses
#DESC:while all your forces can do
#DESC:is watch and gape in awe.
# Land(s)
Plains (M15) * 19
Quicksand (WWK) * 4
Serra's Sanctum (*) * 1
# Creature(s)
Kitchen Finks (SHM) * 4
Mesa Enchantress (PLC) * 4
# Enchantment(s)
Angelic Chorus (10E) * 3
Cage of Hands (CHK) * 3
Honor of the Pure (M10) * 4
Kitchen Finks (SHM) * 4
Mesa Enchantress (PLC) * 4
Moat (PRM) * 3
Pacifism (A25) * 4
Plains (10E) * 4
Plains (M10) * 4
Plains (M11) * 4
Plains (M12) * 3
Plains (M15) * 4
Plains (BBD) * 4
Serra's Sanctum (USG) * 1
Sigil of the Empty Throne (CFX) * 4
Swords to Plowshares (BBD) * 4
# Instant(s)
Swords to Plowshares (DDF) * 4
# Sorcery(s)
Wrath of God (10E) * 3

View File

@@ -1,23 +1,26 @@
#NAME:Armored Ascent
#DESC:'The armourers, accomplishing the
#DESC:knights, / With busy hammers
#DESC:closing rivets up, / Give
#DESC:dreadful note of preparation.'
#DESC:William Shakespeare
Armored Ascension (SHM) * 2
Crusade (LEA) * 4
Disenchant (TPR) * 3
Glorious Anthem (8ED) * 4
Honor of the Pure (M10) * 4
#DESC:They may look weak
#DESC:and barely present,
#DESC:but if you let them grow
#DESC:they will crush your army.
# Land(s)
Plains (M21) * 23
# Creature(s)
Kitchen Finks (SHM) * 3
Knight of Meadowgrain (LRW) * 4
Paladin en-Vec (10E) * 2
Plains (10E) * 4
Plains (8ED) * 3
Plains (LRW) * 4
Plains (M10) * 4
Plains (M21) * 4
Plains (SHM) * 4
Spectral Procession (SHM) * 4
Stillmoon Cavalier (EVE) * 3
Swords to Plowshares (BBD) * 4
# Enchantment(s)
Armored Ascension (SHM) * 2
Crusade (DDF) * 4
Glorious Anthem (8ED) * 4
Honor of the Pure (M10) * 4
# Instant(s)
Disenchant (TPR) * 3
Swords to Plowshares (DDF) * 4
# Sorcery(s)
Spectral Procession (SHM) * 4

View File

@@ -1,19 +1,27 @@
#NAME:Spectral Rack
#DESC:Spectral illusions are
#DESC:still real terrors
Black Knight (M10) * 4
Doom Blade (M10) * 4
#DESC:"We will clear your mind
#DESC: until nothing is left.
#DESC: And we will grow stronger
#DESC: as you keep losing
#DESC: your thoughts."
# Land(s)
Gargoyle Castle (M10) * 4
Hymn to Tourach (V13) * 4
Swamp (M21) * 19
Volrath's Stronghold (TPR) * 1
# Creature(s)
Black Knight (M10) * 4
Graveborn Muse (10E) * 4
Hypnotic Specter (M10) * 4
Nyxathid (CFX) * 4
Skullslither Worm (J22) * 4
Swamp (10E) * 4
Swamp (ISD) * 4
Swamp (M10) * 4
Swamp (M21) * 4
Swamp (TSP) * 3
Tendrils of Corruption (TSP) * 4
# Artifact(s)
The Rack (DPA) * 4
Victim of Night (ISD) * 4
Volrath's Stronghold (TPR) * 1
# Instant(s)
Doom Blade (M10) * 4
Last Gasp (RAV) * 4
Tendrils of Corruption (TSP) * 4
# Sorcery(s)
Hymn to Tourach (V13) * 4

View File

@@ -1,7 +1,7 @@
#NAME:Ragavan Commander
#DESC:Ragavan the pirate steals
#DESC:more than just treasure
#DESC:from his enemies
#DESC:Ragavan's pirates steal both
#DESC:treasure and your spells!
#DESC:Can you defeat him?
#DESC:
#DESC:Win Wagic duels to unlock
#DESC:more Commander opponents

View File

@@ -1,23 +1,64 @@
#NAME:Mighty Slivers
#DESC:The hive mind of the Slivers
#DESC:erases any difference
#DESC:between the one and the many.
Bonesplitter Sliver (TSP) * 4
Forest (8ED) * 4
Forest (TMP) * 4
Forest (TSP) * 4
Fury Sliver (TSP) * 2
Gemhide Sliver (TSP) * 4
Heart Sliver (H09) * 2
Horned Sliver (TPR) * 3
Island (8ED) * 4
Island (TMP) * 1
Might Sliver (TSP) * 4
#NAME:Might Sliver
#
#DESC:Beware! Beware!
#DESC:They are everywhere!
#DESC:Even in the air
#DESC:and under the ground.
#DESC:The whole world has turned
#DESC:into a squirming mass
#DESC:of these small, yet dangerous
#DESC:... things ...
# Land(s)
Forest (8ED) * 12
Island (8ED) * 3
Mountain (8ED) * 6
Mountain (TMP) * 4
Muscle Sliver (H09) * 4
Shifting Sliver (LGN) * 2
Spinneret Sliver (TSP) * 3
Striking Sliver (M14) * 3
Two-Headed Sliver (TSP) * 1
Winged Sliver (H09) * 3
Plains (8ED) * 3
# Creature(s)
Bonesplitter Sliver (TSP) * 4 # nice cumulative +2/+0 bonus
Crystalline Sliver (H09) * 1 # Shroud is nice, especially in a deck with no non-creature spells
Fury Sliver (TSP) * 2 # gives double strike, only 2 because it's a 6-drop creature
Gemhide Sliver (TSP) * 4 # Additional mana source to get Might Slivers out faster
Heart Sliver (H09) * 2 # gives Haste
Horned Sliver (TPR) * 3 # gives Trample, also 2/2 isn't bad for a 3-drop creature that others will pump
Might Sliver (TSP) * 4 # nice cumulative +2/+2 bonus
Muscle Sliver (H09) * 4 # cheap and the +1/+1 bonus is cumulative and can't be misused by the AI
Shadow Sliver (TSP) * 1 # might be great or bad - thrown in as an element of surprise
Spined Sliver (H09) * 2 # gives Rampage
Spinneret Sliver (TSP) * 3 # 2/2 Sliver for only 2 mana, also gives Reach to all slivers, which is good because we only have
# # two Winged Slivers in the deck, and those might not even be played because we have few Islands.
Talon Sliver (*) * 3 # gives First Strike
Watcher Sliver (TSP) * 1 # nice cumulative +0/+2 bonus, but too expensive to have more of them, and we have 3 plains in the deck
Winged Sliver (H09) * 2 # gives Flying
# Cards considered, but not included:
# Basal Sliver - AI too eager to sacrifice
# Clot Sliver - would be the only black sliver left after Basal
# Sliver was taken out; also: AI not too smart with regeneration
# Sedge Sliver - no swamps in deck (since all black slivers were
# taken out)
# Firewake Sliver - AI too eager to sacrifice
# Mnemonic Sliver - AI too eager to sacrifice
# Telekinetic Sliver - AI doesn't make smart tapping definitions
# Quilled Sliver - AI can't target ability in a smart way
# Armored Sliver - AI can't decide well when to use ability
# Barbed Sliver - AI can't decide well when to use ability
# Venser's Sliver - doesn't strengthen other slivers
# Sliversmith - doesn't profit from other slivers. Its tokens
# do, but the AI isn't smart in deciding which cards to discard
# Metallic Sliver - is cheap, but doesn't strengthen other slivers
# Victual Sliver - AI too eager to sacrifice
# Battering Sliver - effect already provided by cheaper Horned Sl.
# Sliver Queen - AI can't handle 5-color deck
# Reflex Sliver - Heart Sliver has same effect for lower cost
# Sinew Sliver - good +1/+1 bonus, but only few plains in this
# deck, and red/green slivers provide same or similar effects
# Synchronous Sliver - Vigilance is nice, but sliver is blue and
# pretty expensive
#
# Cards removed from the deck:
# 20 dual lands - AI only uses the first "auto" rule for each
# dual land. Therefore none of the chosen lands produced green
# mana, the AI treated most dual lands as islands, and the deck
# never got sliver production started.

View File

@@ -1,28 +1,38 @@
#NAME:Master of Ether
#DESC:Surrounded by the things I built,
#DESC:my power grows boundlessly
Academy Ruins (TSP) * 1
Akroma's Memorial (FUT) * 2
Ancient Den (MRD) * 2
Cathodion (C14) * 4
Coiled Tinviper (TPR) * 1
Glaze Fiend (ALA) * 2
Great Furnace (MRD) * 2
Island (10E) * 4
Island (MRD) * 2
Master of Etherium (ALA) * 4
Mox Jet (2ED) * 1
Mox Sapphire (2ED) * 1
Nuisance Engine (MRD) * 4
Ornithopter (MRD) * 4
Salvage Slasher (CFX) * 2
Scarecrone (EVE) * 2
#DESC:"Surrounded by the things I built
#DESC: my power will grow
#DESC: boundlessly."
# Cards considered, but not included:
# Gaea's Cradle - would make the deck even stronger, but doesn't
# fit the theme.
#
# Cards removed from the deck:
# Sculpting Steel - reported to lead to crashes
# Land(s)
Ancient Den (MRD) * 4 # 20 artifact lands for huge bonuses on Master of Etherium and Tolarian Academy.
Great Furnace (MRD) * 4
Seat of the Synod (MRD) * 4
Silver Myr (MRD) * 4
Steel Wall (MRD) * 2
Swamp (10E) * 2
Tolarian Academy (VMA) * 1
Tree of Tales (MRD) * 1
Tree of Tales (MRD) * 4
Vault of Whispers (MRD) * 4
Vedalken Archmage (MRD) * 2
Yotian Soldier (MRD) * 2
Academy Ruins (TSP) * 1 # brings back artifacts
Tolarian Academy (VMA) * 1 # Generates massive amounts of mana in this deck - which the AI usually wastes.
Island (10E) * 3
# Creature(s)
Cathodion (C14) * 4 # 3-drop 3/3 creature without a down-side since manaburn was abolished
Coiled Tinviper (TPR) * 1 # first strike attacker
Glaze Fiend (ALA) * 2 # temp. bonus for playing artifacts
Master of Etherium (ALA) * 4 # gets stronger with every artifact
Ornithopter (MRD) * 4 # cheap artifact, later air defense
Salvage Slasher (CFX) * 2 # grows stronger with artifacts in graveyard - nice effect if opponent has destroyed all artifacts
Scarecrone (EVE) * 2 # brings back artifacts
Silver Myr (MRD) * 4 # artifact source of blue mana (which is needed for the 6 Vedalken)
Steel Wall (MRD) * 2 # mainly for defending
Vedalken Archmage (MRD) * 2 # draws card when summoning artifact
Yotian Soldier (MRD) * 2 # cheap defender
# Artifact(s)
Akroma's Memorial (FUT) * 2 # massive bonuses incl. Trample
Nuisance Engine (MRD) * 4 # create more cheap artifacts

View File

@@ -1,30 +1,28 @@
#NAME:Kinsbaile Cavalier
#DESC:The knights on their steeds
#DESC:and the knights from the sky
#DESC:unite in the pursuit of honor
Armored Ascension (M10) * 2 #
#DESC:unite
#DESC:in their crusade for honor
Blessing (RV) * 2 #
Crusade (RV) * 4 #
Crusading Knight (INV) * 1 #
Flagstones of Trokair (TSP) * 2 #
Honor of the Pure (M10) * 4 #
Kabira Crossroads (ZEN) * 2 #
Kinsbaile Cavalier (MOR) * 3 #
Knight of Meadowgrain (LRW) * 2 #
Leonin Skyhunter (MRD) * 1 #
Lost Order of Jarkeld (ICE) * 2 #
Northern Paladin (RV) * 1 #
Lost Order of Jarkeld (ICE) * 2 #
Order of the Sacred Torch (ICE) * 1 #
Soltari Crusader (TMP) * 1 #
Crusading Knight (INV) * 1 #
Leonin Skyhunter (MRD) * 1 #
Flagstones of Trokair (TSP) * 2 #
Paladin en-Vec (10E) * 2 #
Plains (LRW) * 4 #
Plains (M10) * 4 #
Plains (10E) * 4 #
Plains (RV) * 4 #
Plains (TSP) * 4 #
Plover Knights (LRW) * 1 #
Sigiled Paladin (ALA) * 1 #
Plains (10E) *16 #
Skyhunter Patrol (10E) * 1 #
Skyhunter Prowler (10E) * 2 #
Soltari Crusader (TMP) * 1 #
White Knight (M10) * 2 #
Plover Knights (LRW) * 1 #
Knight of Meadowgrain (LRW) * 2 #
Kinsbaile Cavalier (MOR) * 3 #
Wilt-Leaf Cavaliers (SHM) * 3 #
Kabira Crossroads (ZEN) * 2 #
Sigiled Paladin (ALA) * 1 #
White Knight (M10) * 2 #
Honor of the Pure (M10) * 4 #
Plains (M10) * 4 #
Armored Ascension (M10) * 2 #

View File

@@ -1,25 +1,26 @@
#NAME:Bad Dreams
#DESC:'For in that sleep of death
#DESC:what dreams may come / When
#DESC:we have shuffled off this
#DESC:mortal coil'
#DESC:William Shakespeare
#HINT:combo hold(Damnation|myhand)^cast(Damnation|myhand)^restriction{type(creature|opponentbattlefield)~morethan~1}^totalmananeeded({2}{B}{B})
#HINT:combo hold(Infest|myhand)^cast(Infest|myhand)^restriction{type(creature|opponentbattlefield)~morethan~1}^totalmananeeded({1}{B}{B})
#DESC:If you ever thought
#DESC: that YOU had bad dreams ...
#DESC:Wait until you meet these.
# Land(s)
Mountain (M10) * 8
Swamp (M10) * 16
# Artifact(s)
Black Vise (V10) * 1
Damnation (PLC) * 4
Font of Mythos (CFX) * 2
Howling Mine (8ED) * 4
Infest (ALA) * 4
Lightning Bolt (M10) * 4
Mountain (8ED) * 4
Mountain (M10) * 4
# Enchantment(s)
Spiteful Visions (SHM) * 4
Sudden Impact (8ED) * 4
Swamp (10E) * 4
Swamp (8ED) * 4
Swamp (9ED) * 4
Swamp (M10) * 4
Terminate (ARB) * 4
Underworld Dreams (8ED) * 4
# Instant(s)
Lightning Bolt (M10) * 4
Sudden Impact (8ED) * 4
Terminate (ARB) * 4
# Sorcery(s)
Damnation (PLC) * 4
Infest (ALA) * 4
Wheel of Fortune (VMA) * 1

View File

@@ -1,23 +1,72 @@
#NAME:Ball Lightning
#DESC:'Brief as the lightning
#DESC:in the collied night /
#DESC:That, in a spleen, unfolds
#DESC:both heaven and earth'
#DESC:William Shakespeare
#HINT:alwaysattackwith(Ball Lightning)
Ball Lightning (M10) *4
Beacon of Destruction (10E) *2
Fire Tempest (POR) *2
Flame Burst (ODY) *4
Flame Javelin (SHM) *4
Howling Mine (10E) *4
Kindle (TMP) *4
Lava Spike (CHK) *4
Lightning Bolt (M10) *4
Mountain (10E) *4
Mountain (CHK) *4
Mountain (M10) *4
Mountain (ODY) *4
Mountain (POR) *4
Mountain (TMP) *4
Volcanic Hammer (POR) *4
#
#DESC:"You are nothing
#DESC: But more fuel
#DESC: For my insatiable
#DESC: Rage!"
#
Ball Lightning (M10) *4
Beacon of Destruction (10E) *2 # 28 direct damage spells
Flame Burst (ODY) *4
Flame Javelin (SHM) *4
Kindle (TMP) *4
Lava Spike (CHK) *4
Lightning Bolt (M10) *4
Fire Tempest (POR) *2
Volcanic Hammer (POR) *4
Howling Mine (10E) *4 # accelerates the game, makes more
# # damage spells available
Mountain (10E) *24
# Cards considered, but not included:
# Sonic Burst - 4 damage is nice, discarding a card is not.
# Shock - nice damage per cost ratio, but 2 damage is too little,
# especially since the AI likes to use it on creatures with
# toughness >2
# Steam Blast - nice effect on all creatures and players, but
# damage amplitude of 2 is just a bit too little.
#
# Blaze - AI currently casts spells with "X" cost for too weak an
# effect
# Char - damage per cost ratio too low, and damages caster as well
# Earthquake - difficult to fine-tune for the AI: too little mana
# and the effect might be wasted, too much mana and the effect
# might be dangerous for the AI and its creatures as well.
# Fault Line - more expensive than Earthquake for same effect
# Fire Tempest - very expensive, and too dangerous for the AI
# Fireball - AI doesn't choose targets well
# Flamewave Invoker - ability too expensive compared to Beacon of
# Destruction
# Lava Axe - Too expensive for one-time use, esp. since red mana
# acceleration is currently not possible
# Lightning Blast - Too expensive
# Puncture Blast - damage per cost ratio too low. Wither damage
# would help against big creatures, but so do the walls, and the
# opponent hopefully won't last long enough to bring many big
# creatures out anyway.
# Puncture Bolt - effect too weak
# Scorching Spear - effect too weak
# Zap - too little damage, the AI often uses it on a creature
# that doesn't get killed by it, so the card is wasted.
# Jayemdae Tome - casting cost and ability cost too expensive in
# that deck; Howling Mine serves the same purpose, and hopefully
# the opponent will be dead before he can make much use of the
# cards he draws.
# Cards removed from the deck:
# none
# Notes:
#
# The AI doesn't target the damage spells well, often wasting them
# on creatures that are tough enough to survive the damage, or
# casting them on creatures when it could have won they game by
# targeting the opponent.
#
# The AI sometimes casts Ball Lightning and then doesn't attack
# with it, effectively wasting the card.

View File

@@ -1,23 +1,64 @@
#NAME:Plateau
#DESC:There are no hiding places
#DESC:on the high steppes beyond
#DESC:the mountain passes
#DESC:
#DESC:Win matches to unlock more
#DESC:opponents, sets and game modes
Boros Recruit (RAV) * 4
Bull Cerodon (ALA) * 3
Castle (RV) * 2
Cerodon Yearling (ARB) * 2
Crusade (RV) * 1
Fire Elemental (RV) * 2
Goblin King (10E) * 2
Hearthfire Hobgoblin (EVE) * 2
Hill Giant (RV) * 1
Keldon Warlord (RV) * 1
Lightning Helix (RAV) * 4
Mons's Goblin Raiders (RV) * 1
# RV Mountains
#DESC:In the highland of Boros
#DESC:Angels, elementals and goblins
#DESC:are preparing for battle.
#DESC:Beware, the crusade is coming...
#4x Lightning Helix {W}{R} - does 3 damage and you gain 3 life replacement for #2x Black Vise (1097) and #2x The Rack (1139)
87908
87908
87908
87908
# (PSY) added a third Bull Cerodon to bring the deck to 60 cards
#2x Bull Cerodon replacement for #3x Earth Elementat {3}{R}{R} -4/5 (1287)
174952
174952
174952
#2x Fire Elemental {3}{R}{R} - 5/4
1290
1290
#2 x Nobilis of War {RW}{RW}{RW}{RW}{RW} replacement for 2x Fire elemental (1290)
154258
154258
#2x Goblin king (replaced Rv version 1296 with 10E)
129578
129578
#4 x Boros Recruit - {WR} - Goblin 1/1 first strike - Replace 2x Goblin Baloon brigade (1295) and 2 x Benalish Hero {W} -1/1 banding (1330)
88992
88992
88992
88992
#1x Mons Goblin Raide (1308)
1308
#2x Skyknight Legionnaire replacement for #2x Granite Gargoyle {2}{R} - 2/2 flying {R}:0/1 1297
109082
109082
#1x Orcish Oriflame
1310
#2x Castle {3}{W} - untapped creature get 0/2
1334
1334
#1x Crusade White creature get +1/+1 {W}{W}
1341
#2x Cerodon Yearling {R}{W} vigilance haste 2/2 replacement for pearled Unicord 2/2 {2}{W} (1356)
180604
180604
#2x Serra Angel {3}{W}{W} - 4/4 flying,vigilance
1366
1366
#2x Wall of sword {3}{W} 3/5 flying defender
1369
1369
#2x White knight 2/2 first strike, protection from black
1370
1370
#1x Hill Giant {3}{R} - 3/3
1299
#2x Hearthfire Hobgoblin replacement for - 1x Hurloon Minotaur - {1}{R}{R} - 2/3 - 1300 and 1xEarth Elementat {3}{R}{R} -4/5 - 1287
157201
157201
#1x Keldon Warlord
1301
#Moutains
1389
1389
1389
@@ -30,9 +71,7 @@ Mons's Goblin Raiders (RV) * 1
1391
1391
1391
Nobilis of War (EVE) * 2
Orcish Oriflamme (RV) * 1
# RV Plains
#Plains
1395
1395
1395
@@ -45,7 +84,3 @@ Orcish Oriflamme (RV) * 1
1397
1397
1397
Serra Angel (RV) * 2
Skyknight Legionnaire (RAV) * 2
Wall of Swords (RV) * 2
White knight (RV) * 2

View File

@@ -1,23 +1,76 @@
#NAME:Undead Lords
#DESC:Can you smell the sweet perfume
#DESC:of festering flesh and rotting bones?
Beacon of Unrest (10E) *1
Butcher Ghoul (AVR) * 2
Cemetery Reaper (M10) *4
Death Baron (ALA) *4
Diregraf Colossus (SOI) * 1
Champion of the Perished (MID) *4
Geralf's Messenger (DKA) * 1
Lord of the Undead (10E) *4
Scarscale Ritual (SHM) *4
Severed Legion (10E) *1
Soulless One (ONS) *4
Swamp (10E) *4
Swamp (ALA) *4
Swamp (M10) *4
Swamp (RAV) *4
Swamp (RV) *4
Swamp (SHM) *4
Walking Dead (LEG) *2
Vengeful Dead (SCG) * 2
Zombie Master (RV) *2
#
#DESC:"Can you smell the sweet perfume
#DESC: Of festering flesh and rotting bones?
#DESC:
#DESC: Rejoice if you like it
#DESC: Because soon, soon
#DESC: You will be part of my army."
#
Lord of the Undead (10E) *4 # strengthens and raises zombies
Cemetery Reaper (M10) *4 # strengthens zombies
Death Baron (ALA) *4 # strengthens zombies +deathtouch
Soulless One (ONS) *4 # gets powerful with lots of zombies
Walking Dead (LEG) *2 # cheap early defense
Zombie Master (RV) *2 # for Swampwalk, zombie regeneration,
# # and 2/3 isn't bad either
Severed Legion (10E) *1 # \
Warpath Ghoul (M10) *1 # > some expensive zombies
Mass of Ghouls (FUT) *1 # /
Dreadwing (CFX) *2 # \ 6 cheap zombies - neither can
Hate Weaver (10E) *2 # > use its abilities. These are
Roofstalker Wight (RAV) *2 # / just temporary solutions to
# # rack zombie numbers up for the
# # Soulless One.
Beacon of Unrest (10E) *1 # More raising of zombies
Scarscale Ritual (SHM) *4 # Card drawer
Dark Ritual (RV) *4
Swamp (10E) *22
# Cards considered, but not included:
# Shepherd of the Rot - *much* too dangerous for the AI in this
# deck
# Graveborn Muse - dito
# Empty the Catacombs - would weaken the Soulless One
# Dauthi Ghoul - too expensive for a 1/1 creature in a
# non-shadow deck
# Zombify - too expensive, a Zombie deck has cheaper means
# Cruel Revival - too expensive
# Dreg Reaver - Mass of Ghouls better for same cost
# Zombie Goliath - Mass of Ghouls better for same cost
# Gluttonous Zombie - Mass of Ghouls has better power, fear
# won't work against black or artifacts
# Dross Prowler - Severed Legion better for same cost
# Scathe Zombies - Severed Legion better for same cost
# Bog Raiders - Swampwalk provided by Zombie Master, so B.R. is
# weaker than Severed Legion for same cost
# Phyrexian Ghoul - AI can't handle sacrifice decisions well
# Nantuko Husk - dito
# Recover - too expensive
# Disentomb - the Lord of the Undead will do most of the Raising
# Raise Undead - dito
# Tortured Existence - dito
# Dross Crocodile - too expensive
# Gravedigger - too expensive
# Spineless Thug - cheap, but can't block
# Feeding Frenzy - nice but too expensive
# Sadistic Glee - AI casts it on opponent's creatures
# Unholy Grotto, Volrath's Stronghold - would weaken Soulless One
# Haunted Crossroads - would weaken Soulless One
# Cards removed from the deck:
# Accursed Centaur - sacrifices itself
# Dark Ritual - AI doesn't use the mana
# Notes:
#
# Slow buildup, and no synergy until the 3-drop creatures come in.
# Would profit a lot from Dark Ritual if it worked.

View File

@@ -1,25 +1,48 @@
#NAME:Zuberi's Flock
#DESC:There is no sight more awesome
#DESC:than the battle flight of the
#DESC:griffins. Zuberi's golden
#DESC:feathers dazzle their foes with
#DESC:the brightness of a second sun.
#HINT:combo hold(Moat|myhand)^cast(Moat|myhand)^restriction{type(Moat|mybattlefield)~lessthan~1}^totalmananeeded({2}{W}{W})
Courier Hawk (RAV) * 2
Diving Griffin (8ED) * 4
Fearless Fledgling (ZNR) * 2
Honor of the Pure (M10) * 4
Moat (LEG) * 4
Plains (10E) * 4
Plains (8ED) * 4
Plains (M10) * 4
Plains (MIR) * 4
Plains (RAV) * 4
Plains (SHM) * 4
Silverbeak Griffin (M19) * 4
Suntail Hawk (10E) * 4
Sunspire Griffin (RTR) * 4
Swords to Plowshares (RV) * 2
Windbrisk Raptor (SHM) * 1
Zeriam, Golden Wind (DMC) * 3
Zuberi, Golden Feather (MIR) * 2
#
#DESC: Winged fighters
#DESC: for honor and justice
#DESC: cross the chasm
#DESC: to take their revenge
#
Zuberi, Golden Feather (MIR) *2
Suntail Hawk (10E) *4 # cheap flyer
Courier Hawk (RAV) *4 # cheap flyer
Wild Griffin (10E) *3 # balanced 3-drop flyer
Griffin Sentinel (M10) *3 # defensive 3-drop flyer
Razorfoot Griffin (M10) *2 # offensive 4-drop flyer
Ekundu Griffin (MIR) *2 # same as Razorfoot Griffin
Spotted Griffin (POR) *2 # defensive 4-drop flyer
Divebomber Griffin (RAV) *1 # only 1, AI doesn't use ability
Windbrisk Raptor (SHM) *1 # not a griffin, but a bird, and
# # fits well as an endgame surprise
Moat (LEG) *4 # 4 because it's important for this
# # deck to keep strong attackers away
Blessing (RV) *2 # \ 6 enchantments to reinforce the
Holy Strength (10E) *2 # > holy nature of the griffins -
Honor of the Pure (M10) *2 # / and the creatures need buffs
Swords to Plowshares (RV) *2 # reinforces the aggresiveness of
# # the griffin theme, and stalls the
# # the game until Moat comes in
Plains (10E) *24
# Cards considered, but not included:
# Loyal Gyrfalcon - too expensive for a non-griffin in this deck
# Crusade - Weaker than Honor of the Pure
# Cards removed from the deck:
# Welkin Hawk - not a griffin, and can crash the game in 0.8.1
# Righteousness - AI doesn't use it
# Teremko Griffin - Banding removed from Wagic
# Notes:
# Flavor deck, might be more competitive if it included bird
# soldiers and global enchantments (Crusade, Glorious Anthem), but
# I wanted to limit the theme of this deck to "animal" griffins
# and birds, which excluded the "civilized" Aven and the more
# civilized enchantments.

View File

@@ -1,28 +1,58 @@
#NAME:Viashino Warriors
#DESC:Descended from dragons, the
#DESC:Viashino are agile, aggressive
#DESC:and deadly
#HINT:alwaysattackwith(Archwing Dragon)
#HINT:alwaysattackwith(Viashino Cutthroat)
#HINT:alwaysattackwith(Viashino Sandscout)
#HINT:alwaysattackwith(Viashino Sandstalker)
Archetype of Aggression (BNG) *2
Archwing Dragon (AVR) *2
Bloodmark Mentor (SHM) *3
Impact Tremors (DTK) *4
Mountain (10E) *1
Mountain (AVR) *4
Mountain (INV) *4
Mountain (MIR) *4
Mountain (RAV) *4
Mountain (SHM) *4
Mountain (USG) *4
Purphoros, God of the Forge (THS) * 2
Rage Reflection (SHM) *1
Viashino Cutthroat (ULG) *2
Viashino Pyromancer (FGN) *4
Viashino Sandscout (10E) *4
Viashino Sandstalker (VIS) *3
Viashino Spearhunter (M10) *4
Viashino Warrior (MIR) *2
Viashino Weaponsmith (USG) *2
#NAME:Viashino Warrior
#
#DESC:"With claws and swords and flames
#DESC: we fiercely protect
#DESC: those we revere"
Viashino Slasher (RAV) *4 # cheap Viashino
Viashino Slaughtermaster (CFX) *4 # cheap Viashino
Viashino Spearhunter (M10) *4 # first strike
Viashino Grappler (INV) *4 # high power but very vulnerable
Viashino Warrior (MIR) *2 # attacker
Viashino Weaponsmith (USG) *2 # attacker
Viashino Fangtail (RAV) *3 # attacker
Furnace Whelp (10E) *2 # not a Viashino, but having
# # two flyers helps the deck
Firebreathing (10E) *4 # fiery breath for the dragons'
# # descendants - also allows to
# # use spare mana, although the
# # AI rarely does that.
Flaming Sword (MRQ) *2 # fiery weapons as well
Emblem of the Warmind (FUT) *2 # gives Haste
Beacon of Destruction (10E) *1 # repeated fire blasts
Rage Reflection (SHM) *1 # double strike
Dragon Roost (10E) *1 # endgame surprise - produces
# # red dragons
Mountain (10E) *24
# Cards considered, but not included:
# Burning Cloak - AI would kill its own creatures
# Canyon Drake - flyers would be nice, but too expensive
# Crown of Flames - Firebreathing is more foolproof for the AI
# Dragon Whelp - Furnace Whelp is more foolproof
# Desert Drake - Furnace Whelp is better for the same cost
# Immolation - AI can't decide whether it'll help or destroy the
# enchanted creature
# Lizard warrior - is not a viashino, and a viashino with
# identical values exists
# Mass Hysteria - Emblem of the Warmind fits the theme better and
# doesn't help the enemy
# Pyroclasm - AI would kill its own creatures
# Viashino Skeleton - other viashinos wouldn't associate with it
# Kindled Fury - lasts only until end of turn, often wasted by AI
# Double Cleave - lasts only until end of turn, often wasted by AI
# Reflexes - first strike already provided by Flaming Sword
# Cards removed from the deck:
# Bravado - AI casts it on opponent's creatures
# Seething Song - mana acceleration would be great, bit the AI
# doesn't use the mana
# Viashino Sandscout - AI doesn't understand that it will return
# to owner's hand, may enchant it
# Viashino Bladescout - removed from Wagic
# Notes:
# Flavor deck.

View File

@@ -1,23 +1,61 @@
#NAME:Heartmender
#DESC:Life will always endure,
#DESC:no matter the odds,
#DESC:no matter the cost.
#HINT:combo hold(Worldly Tutor|myhand)^cast(Worldly Tutor|myhand) targeting(Heartmender|mylibrary)^totalmananeeded({G})
#HINT:alwaysattackwith(Scuzzback Marauders)
Forest (MIR) *2
Forest (MRQ) *4
Forest (10E) *4
Forest (SHM) *4
Heartmender (SHM) *4
Kitchen Finks (SHM) *4
Lingering Tormentor (EVE) *4
Putrid Goblin (MH1) *2
Raise Dead (9ED) *2
Rendclaw Trow (EVE) *4
Safehold Elite (SHM) *4
Scuzzback Marauders (SHM) *4
Swamp (MRQ) *4
Swamp (10E) *4
Swamp (SHM) *2
Vine Trellis (MRQ) *4
Worldly Tutor (MIR) *4
#
#DESC:"No matter who
#DESC: No matter what
#DESC: We heal.
#DESC: The good and the bad
#DESC: The calm and the mad
#DESC: The live and the dead
#DESC: We heal."
Heartmender (SHM) *4 # continuously removes -1/-1 counters
# # from all others
Kitchen Finks (SHM) *4 # brings 2 life everytime it persists
Safehold Elite (SHM) *4 # cheap early defense
Lingering Tormentor (EVE) *4 # attacker with Fear
Rendclaw Trow (EVE) *4 # has Wither
Gravelgill Axeshark (SHM) *3 # 3/3 creature
Scuzzback Marauders (SHM) *3 # 5/2 attacker
Restless Apparition (EVE) *2 # can get +3/+3 bonus, but does the
# # AI use that ability?
Vine Trellis (MRQ) *4 # cheap defender and mana source
Animate Dead (RV) *4 # to bring back creatures that were
# # killed before the Heartmenders came
# # online
Forest (10E) *12
Swamp (10E) *12
# Cards considered, but not included:
# Kithkin Spellduster - has Persist, but is expensive & needs W
# River Kelpie - has Persist, but is expensive & needs blue mana
# Rattleblaze Scarecrow - too expensive for conditional persist
# Wingrattle Scarecrow - only conditional persist
# Gaea's Cradle - AI doesn't use the mana, bad thematic fit
# Cauldron Haze - effect only til end of turn, too short
# Trapjaw Kelpie - very expensive, AI doesn't use flash
# Sadistic Glee - Might help in a deck where so many creatures go
# to the Graveyard, then again it might not if it's the
# enchanted creature that dies. The point is currently moot
# though since the AI casts the spell on its opponents anyway
# Vulturous Zombie - no Persist, too expensive
# Infest - perhaps too dangerous as long as no Heartmender in play
# Harbinger of Night - definitely too dangerous
# Cards removed from the deck:
# none
# Notes:
# Doesn't perform as well as I'd like it to. The deck is very
# dependent on the Heartmenders, and sometimes they take a long
# time to come out. Suggestions?
#
# Animate Dead seems to choose targets randomly and sometimes
# picks bad ones. But it still works well in this deck if it
# targets creatures with Persist, because when these get killed
# while they are animated dead, they return from the graveyard
# without the animation enchantment. It would be nice if "Animate
# Dead" could prioritize the Kitchen Finks as targets.

View File

@@ -1,27 +1,58 @@
#NAME:Faerie Archmage
#DESC:Never mistake a faerie's
#DESC:mischief for mere
#DESC:playfulness.
#NAME:Fairy Archmage
#
#DESC:"Now we're here
#DESC: Now we're there
#DESC: Now we're gone
#DESC: Now we're back
#DESC:
#DESC:Deck for Wagic by Bob
#HINT:combo hold(Archmage of Echoes|myhand)^cast(Archmage of Echoes|myhand)^restriction{type(Archmage of Echoes|mybattlefield)~lessthan~1}^totalmananeeded({4}{U})
#HINT:combo hold(Shadow Puppeteers|myhand)^cast(Shadow Puppeteers|myhand)^restriction{type(Shadow Puppeteers|mybattlefield)~lessthan~1}^totalmananeeded({6}{U})
Arcane Denial (WOC) * 2
Archmage of Echoes (WOC) *4
Counterspell (DSC) *2
Faerie Bladecrafter (WOC) *4
Faerie Miscreant (M20) *4
Go for the Throat (BRO) * 2
Island (ELD) *4
Island (FDN) *4
Island (LRW) *4
Island (WOE) *4
Obyra, Dreaming Duelist (WOE) *2
Oona's Gatewarden (SHM) *3
Scion of Oona (LRW) *4
Shadow Puppeteers (WOC) *2
Sleep-Cursed Faerie (WOE) *2
Surveilling Sprite (RAV) * 3
Swamp (ELD) *2
Swamp (LRW) *4
Swamp (WOE) *4
#DESC: But what happened to your defenses?"
Glen Elendra Archmage (EVE) *4 # ability is currently buggy ...
Heartmender (SHM) *4 # continuously removes -1/-1 counters
# # from all others
Kitchen Finks (SHM) *4 # brings 2 life everytime it persists
Safehold Elite (SHM) *4 # cheap early defense
Gravelgill Axeshark (SHM) *2 # 3/3 creature
Kithkin Spellduster (EVE) *2 # Enchantment removal
Restless Apparition (EVE) *4 # can get +3/+3 bonus
River Kelpie (SHM) *2 # card drawer, only *2 to prevent the
# # AI from decking itself out
Oona's Gatewarden (SHM) *4 # good cheap defense & fits the theme
Plumeveil (SHM) *2 # great defense & fits the theme
Wrath of God (10E) *4 # destroys all creatures
Plains (10E) *14
Island (10E) *10
# Cards considered, but not included:
# Rendclaw Trow - has persist & wither, but needs BG mana
# Lingering Tormentor - has persist * Fear, but needs B mana
# Scuzzback Marauders - has persist & high attack, but needs BR
# mana. High attack not necessary once Wrath of God is cast
# Rattleblaze Scarecrow - too expensive for conditional persist
# Wingrattle Scarecrow - only conditional persist
# Gaea's Cradle - AI doesn't use the mana, dubious thematic fit
# Cauldron Haze - effect only til end of turn, too short
# Trapjaw Kelpie - very expensive, AI doesn't use flash
# Cards removed from the deck:
# none
# Notes:
# The AI seemed pretty reluctant to cast Wrath in the test runs,
# although it did use the card from time to time
#
# River Kelpie: The AI is in danger of decking itself out if it
# has many Wither creatures, 2 Kelpies, and casts Wrath of God.
# I already reduced the Kelpies after the AI had to draw 40 cards
# in one test run, but even 2 may be too much. Will have to be
# watched.
#
# Restless Apparition: May actually prevent the Heartmender and
# Wrath of God from being played if the AI uses its plains to pump
# the apparition before checking whether it could use those plains
# to play spells. This will have to be watched too.

View File

@@ -1,27 +1,46 @@
#NAME:Snake Pit
#DESC:The serpents move unseen
#DESC:through the marsh, waiting
#DESC:to strike with venomous
#DESC:malice
#HINT:combo hold(Blot Out|myhand)^cast(Blot Out|myhand)^restriction{type(creature|opponentbattlefield)~morethan~1}^totalmananeeded({2}{B})
#HINT:alwaysattackwith(Filth)
Anaconda (POR) *3
Archetype of Finality (BNG) *1
Blot Out (MAT) * 2
Fell (BLB) *4
Filth (JUD) *2
Forest (10E) *4
Forest (POR) *4
Forest (RAV) *4
Gift of the Viper (MH3) *3
Marsh Boa (PCY) *4
Mire Boa (TSR) *4
Moss Viper (THB) *4
Orochi Sustainer (CHK) *2
Persistent Constrictor (DSC) *2
Seshiro the Anointed (CHK) *2
Swamp (10E) *1
Swamp (POR) *4
Swamp (RAV) *4
Urborg, Tomb of Yawgmoth (LTC) *3
Zodiac Snake (PTK) *3
#
#DESC:"Ssalute our ssinuossity
#DESC: Love our lithenesss
#DESC: Enjoy our embrace
#DESC:
#DESC: Care for a kisss?
#DESC: Ssoon you will ssleep ..."
Orochi Sustainer (CHK) *3 # Orochi Snake Shaman
Sachi, Daughter of Seshiro (CHK) *2 # toughness bonus to snakes
Anaconda (POR) *1 # 18 snakes
Anaconda (UZS) *2
River Boa (ZEN) *3
Hornet Cobra (LEG) *3
Python (POR) *3
Skeletal Snake (POR) *1
Mold Adder (M10) *2 # only good against 2 colors
Boa Constrictor (MRQ) *1 # AI can't handle ability
Serpent Warrior (POR) *1 # AI doesn't realize the life loss
Serpent Assassin (POR) *3
Weakness (M10) *2 # 10 spells to simulate poison effects
Paralyze (RV) *2
Last Gasp (RAV) *1
Venomous Fangs (USG) *4
Fevered Convulsions (TMP) *1
Snake Pit (MRQ) *1
Forest (10E) *11
Swamp (10E) *13
# Cards considered, but not included:
# Creakwood Liege - not a snake
# Coiled Tinviper - mechanical snake, bad thematic fit
# Plague Wind - considered as endgame surprise, but doesn't fit
# the theme well enough
# Notes:
# I haven't found any information about the Orochi, so I can't
# tell whether they fit to the rest of the cards apart from the
# fact that they are snakes. If they don't fit, replacement
# suggestions are welcome.

View File

@@ -1,11 +1,4 @@
#NAME:Tatyova Commander
#DESC:Years of study attuned
#DESC:Tatyova to the magic
#DESC:of the coastal woodlands
#DESC:
#DESC:Win Wagic duels to unlock
#DESC:more Commander opponents
#DESC:
#DESC:The Tatyova Commander Deck
#DESC:Refined for Wagic by Bob
#HINT:castpriority(commander,*)

Some files were not shown because too many files have changed in this diff Show More