Compare commits

...

172 Commits

Author SHA1 Message Date
xawotihs 81770a8bc4 Uses 4 processes for building and activate build on specific branch independant of tags 2014-12-04 21:19:52 +01:00
xawotihs 34972176fe Limiting the builds to 2 simultaneous processes 2014-12-04 07:50:13 +01:00
xawotihs 600aa45ff7 Merge branch 'master' into auto_releases 2014-12-04 00:07:12 +01:00
Xawotihs 56ccebb720 Merge pull request #605 from kevlahnota/master
added guild keywords, added specific life cost
2014-12-03 07:37:55 +01:00
Anthony Calosa 8ef3789970 reverted sacred foundry 2014-12-03 07:54:13 +08:00
Anthony Calosa ed7769c373 Revert "update sacred_foundry_i275.txt"
This reverts commit 5745006c35.
2014-12-03 07:47:00 +08:00
Anthony Calosa 5745006c35 update sacred_foundry_i275.txt 2014-12-02 19:19:05 +08:00
Anthony Calosa 16b243c52a Added bng cards to the main primitives. Removed bngGods.txt 2014-12-02 10:39:53 +08:00
Anthony Calosa bc91eaf5ca updated card primitives that supports specific life cost 2014-11-29 07:10:02 +08:00
Anthony Calosa 6962d1e888 added cards, needs more testing before merging with the main primitives 2014-11-29 06:58:33 +08:00
Anthony Calosa 4d1e8dfb36 Update bngGods.txt
9/15/2013 	The type-changing ability that can make the God not be a creature functions only on the battlefield. It’s always a creature card in other zones, regardless of your devotion to its color.
2014-11-28 15:31:24 +08:00
Anthony Calosa 6ff6f95044 added Xenagos, God of Revels and Phenax, God of Deception for test purpose. 2014-11-28 14:34:37 +08:00
Anthony Calosa 5369983b35 Added BNG set 2014-11-28 14:19:04 +08:00
Anthony Calosa 46a8041c48 Added guild keyword gruul test for Xenagos, God of Revels. You must have Born of the gods set (BNG) 2014-11-28 14:00:58 +08:00
Anthony Calosa 84185a7c78 Added specific life cost test for griselbrand. Pls read note. 2014-11-28 13:35:13 +08:00
Anthony Calosa 4f41248978 Added specific life cost. if we use {l}{l}{l} to pay 3 life, and you have 2 life, you cannot afford to pay the cost but instead the game allows it. if we use specific life cost like: {l:3}, the restriction works. 2014-11-27 14:38:55 +08:00
Anthony Calosa 92d52a78be Update ExtraCost.cpp 2014-11-27 14:33:43 +08:00
Anthony Calosa a76594046b Update ExtraCost.h 2014-11-27 14:31:25 +08:00
kevlahnota 2214ec66f1 Update AllAbilities.h
keywords for the "gods", "azorius" returns value of devotion to blue and white. ex. auto=azorius/dimir ueot
2014-11-27 11:31:19 +08:00
xawotihs b8da46ac18 Fixed phonon support. 2014-11-23 16:27:18 +01:00
xawotihs d656730d3a Fixed phonon support 2014-11-23 16:24:36 +01:00
xawotihs 2f230e4b38 Added buyback.txt to the list of automatic tests 2014-11-23 16:23:18 +01:00
xawotihs 494f64acbd Merge branch 'apollovy-master' 2014-11-23 14:32:02 +01:00
xawotihs 50978200d4 Merge branch 'master' of https://github.com/apollovy/wagic into apollovy-master 2014-11-23 14:30:17 +01:00
xawotihs a38e1daec7 Updated Android build tools to 21.1.1 2014-11-23 12:44:22 +01:00
Yuriy A. Apollov 57a26b4583 Add test for buyback case. 2014-11-18 06:58:38 +03:00
Yuriy A. Apollov c018c8fcd1 Fix buyback payed once stayed forever. 2014-11-18 06:51:40 +03:00
xawotihs 3ba4aca8bc Fixed stupid bug in python release creation 2014-08-25 22:16:12 +02:00
xawotihs 870f6e3b58 Fixed python typo 2014-08-25 00:27:40 +02:00
xawotihs 83e0869548 Updated python upload code to re-create new release 'latest-master' for each master commit 2014-08-25 00:02:46 +02:00
xawotihs 90b08db038 Updated travis to use python uploading script 2014-08-24 19:45:18 +02:00
xawotihs c888e143a1 Fixed python typo 2014-08-24 18:46:42 +02:00
xawotihs 4e727bc164 Fixed python typo 2014-08-24 18:23:08 +02:00
xawotihs b37afadb01 Fixed typo. 2014-08-24 17:59:04 +02:00
xawotihs 2c2744f6fb Fixed python issue 2014-08-24 17:40:05 +02:00
xawotihs db2b2fa3b5 Replaced \ by / 2014-08-24 17:07:00 +02:00
xawotihs 0127f7aab9 Tries to activate automatic artifact deployment to github release from appveyor 2014-08-24 16:07:26 +02:00
Xawotihs ce41791fa4 Remove broken comments 2014-08-23 09:36:46 +02:00
Xawotihs ec4be4f6b1 Uses real python path 2014-08-23 00:53:33 +02:00
Xawotihs f82d89b3db Removed empty environment section 2014-08-23 00:47:30 +02:00
xawotihs 202175f2a7 First appveyor script and python windows package build file 2014-08-22 23:26:03 +02:00
xawotihs b91a9aeed4 Fixed another shell issue 2014-08-06 00:10:40 +02:00
xawotihs 6a1534750f Fixed another shell issue in travis file 2014-08-05 23:44:51 +02:00
xawotihs 1cb20e4138 Fixed same shell issue in travis file 2014-08-05 23:38:10 +02:00
xawotihs 8458745bc4 Fixed shell issue 2014-08-05 23:33:38 +02:00
xawotihs 2d61ff6e2e Trying matrix build 2014-08-05 23:22:45 +02:00
xawotihs c5fe5243a9 Adding tags again. 2014-08-04 23:47:56 +02:00
xawotihs a6a25be3d3 Regenerate token 2014-08-04 23:23:05 +02:00
xawotihs 63694785c6 Reencrypted token 2014-08-04 22:57:30 +02:00
xawotihs c68f83491e Without CR in the middle of the encrypted token 2014-08-04 18:54:35 +02:00
xawotihs 257082ea02 Uses new secure token. 2014-08-04 17:52:06 +02:00
xawotihs e5fe25dfba Tries to fix auth token and various other fixes. 2014-08-03 22:22:34 +02:00
xawotihs 93ba3d107d Removed tags 2014-08-03 21:52:52 +02:00
xawotihs fcf0078f26 Fixes some formatting issue. 2014-08-03 21:28:12 +02:00
xawotihs d8c1933abc Activated travis github deployment support 2014-08-03 21:02:31 +02:00
xawotihs d7628b3eb2 Fixed console with Qtmultimedia 2014-08-03 12:20:45 +02:00
Xawotihs 7560db571c Trying without HTTPS to speed up SDK update 2014-08-03 11:43:55 +02:00
Xawotihs 775143355d Add lib pulse-dev 2014-08-03 01:51:41 +02:00
Xawotihs 846ba30821 Tries to fix android sdk update issue 2014-08-03 01:34:53 +02:00
Xawotihs ad88592229 Replaced pulse-dev with pulseaudio 2014-08-02 23:44:40 +02:00
Xawotihs 6b90956af1 Adding pulse 2014-08-02 23:35:25 +02:00
Xawotihs 26e905a36e Update Androi build tools to 20.0.0 2014-08-02 23:16:22 +02:00
xawotihs 1a9ff38f0c Merge branch 'qtMultimedia' of https://github.com/WagicProject/wagic into qtMultimedia 2014-08-02 21:07:12 +02:00
xawotihs 8b22d032cd Fixed QT version needed for pixelRatio API 2014-08-02 21:05:55 +02:00
Xawotihs 8d58baf4a3 adding qtmultimedia in apt-get 2014-08-02 19:38:11 +02:00
Xawotihs a447a0c9af Trying with --all 2014-08-02 19:22:38 +02:00
xawotihs 555fb3ae93 Updated Qt building scripts to use qt5 qmake and no fmod 2014-08-02 18:54:28 +02:00
Xawotihs 7053531a4d Added qmake qt5 configuration 2014-08-02 18:37:53 +02:00
Xawotihs 7d4e5177b9 Reordered actions from install to before_install 2014-08-02 18:15:45 +02:00
Xawotihs 06f30eca3a Upgraded travis to use qt5 2014-08-02 17:50:45 +02:00
xawotihs ac5c14b977 Fixed QtMultimedia port, replaced QSoundEffect by QMediaPlayer as all codecs were not supported by first class. 2014-08-02 17:12:19 +02:00
xawotihs c3d810bd3b Merge branch 'master' into qtMultimedia 2014-08-02 16:16:19 +02:00
xawotihs 1e24f25c18 Fixed repository against Qt5.3.1 2014-08-02 15:56:52 +02:00
xawotihs 28db884498 Cleaned up cross-compiling travis stuff 2014-07-26 19:45:59 +02:00
xawotihs 36ecc1ffef Cleaned up cross-compiling travis stuff 2014-07-26 19:38:14 +02:00
Xawotihs 9ec6803a02 Merge pull request #602 from WagicProject/feature/ios-update-xcode5.1
Feature/ios update xcode5.1
2014-07-24 23:08:39 +02:00
xawotihs e87996a7f2 Deactivate window cross-compiling build 2014-07-23 23:20:54 +02:00
xawotihs f2a5273029 Activating logs on android issue 2014-07-23 22:22:06 +02:00
xawotihs 9bc750da9a Upgrade Android SDK to r23.0.2 2014-07-23 22:05:02 +02:00
Xawotihs 539c5bd18a Trying to fix android build 2014-07-23 20:53:25 +02:00
Xawotihs bdc1ada090 Update README.md
Added build status on AppVeyor
2014-07-23 00:17:07 +02:00
Michael Nguyen 2efc24a1ce Merge branch 'develop' into feature/ios-update-xcode5.1 2014-04-13 11:50:16 -07:00
Michael Nguyen 63561e6122 update Xcode build preferences as recommended by XCode. 2014-04-13 11:39:40 -07:00
Michael Nguyen d2390b1227 updated project file for iOS to work with current codebase
- added missing source/headers (GameView.h, CarouselView.h, etc )
- removed dependency on admob static library
- removed CardEffect.h and CardEffect.cpp from project reference
- removed -no_implicit_dylibs flag (apparently no longer supported)
- added -fno-objc-arc (turns off ARC compilation for entire project)
- added -DTIXML_USE_STL
2014-04-13 08:34:21 -07:00
Michael Nguyen d0799ea3f2 updating to latest code from master
Merge branch 'master' into develop
2014-04-13 08:26:53 -07:00
Xawotihs 44cbfbb1fb Merge pull request #601 from ZobyTwo/cleanup_3
Remove dead code and fix circular initialization
2014-03-13 20:20:12 +01:00
Tobias Loose b078dd1f6a Fix android makefile 2014-03-11 17:31:25 +01:00
Tobias Loose 225dd23753 Fix makefile 2014-03-11 17:19:05 +01:00
Rolzad73 51b4755242 Update README.md
Added sample play-through video link
2014-02-05 23:39:57 -05:00
Tobias Loose 8f233b3027 Avoid circular initialization 2014-02-03 19:44:51 +01:00
Tobias Loose 197540763e Remove unused Effects.h/.cpp and class Effect
There was an empty vector of effect* in PlayGuiObject.
2014-02-03 13:52:40 +01:00
xawotihs 5d7667dc01 Cleaned Phonon vs QtMultimedia config 2014-01-31 21:53:27 +01:00
xawotihs 18383579e9 Fixed android compilation 2014-01-27 06:31:23 +01:00
xawotihs 03d4f8ffa1 Added Qt Multimedia support in order to replace Phonon. Currently does not work on Mac. 2014-01-26 23:56:15 +01:00
xawotihs 30d92eb68c Should fix issue #497 with the broken freezing the game. 2014-01-18 22:50:16 +01:00
xawotihs 6e6a0fd5c2 OMG I so hate shells 2014-01-18 16:00:14 +01:00
xawotihs cd4a980182 More debug 2014-01-18 15:26:09 +01:00
xawotihs aad54fd98d Adds debug in build script 2014-01-18 14:57:23 +01:00
xawotihs 6b7a49506c Should fix the stringifying issue 2014-01-18 14:23:26 +01:00
xawotihs 7ecf67c176 And again 2014-01-18 13:37:43 +01:00
xawotihs 77aeb2d0ac Fixed release name 2014-01-18 13:29:50 +01:00
xawotihs 7a9f989104 Adds some URL error log 2014-01-18 12:46:27 +01:00
xawotihs ae06bebd24 Merge branch 'github_downloader' 2014-01-18 12:11:08 +01:00
xawotihs 042fb7b376 Tries to fix Android compilation 2014-01-18 11:18:27 +01:00
xawotihs c3583ade01 Updated resource name and URL for android project 2014-01-17 23:25:48 +01:00
xawotihs f97d9805dd Removed build number in released filename and added computation of resource URL based on release name. 2014-01-17 21:50:10 +01:00
xawotihs 1d33de59a9 Fixed compilation issue 2014-01-12 22:56:53 +01:00
xawotihs 0c4b09891b Removed hardcoded testing values and used 32 bits file size instead of 64 bits. 2014-01-12 22:40:45 +01:00
xawotihs 25955303e7 Adds a Downloader component to JGE able to download and cache files. 2014-01-12 22:16:35 +01:00
Rolzad73 27b75eecb0 Merge pull request #600 from WagicProject/android_build_update
update android build tools version
2014-01-09 12:33:11 -08:00
Rolzad73 e40921cf13 update android build tools version 2014-01-09 14:57:06 -05:00
Rolzad73 083cebcc7e updated credits text 2014-01-09 14:46:58 -05:00
Rolzad73 a722736335 Merge pull request #599 from WagicProject/android_travis_explicit
Attempt to make android tools fetching for TravisCI explicit and futureproof
2014-01-08 08:40:47 -08:00
Rolzad73 c483c20c81 attempt to make android tools fetching for TravisCI explicit and futureproof 2014-01-08 11:14:47 -05:00
Dmitry Panin dec1caa43c Revert "Fixed issue with multiple basic abilities in TargetChooser"
This reverts commit d9816c7ad0.
2014-01-04 18:40:59 -08:00
Dmitry Panin 9526e22118 Fixed grave pact 2014-01-04 18:14:15 -08:00
Dmitry Panin d9816c7ad0 Fixed issue with multiple basic abilities in TargetChooser
E.g. card create[trample;haste] wasn't handled properly
2014-01-04 18:13:22 -08:00
Dmitry Panin 8e327a27df Fixed formatting 2014-01-04 18:13:22 -08:00
xawotihs 43fe67d7d8 Adds executioners_swing tests in _tests.txt 2013-12-31 18:38:30 +01:00
Xawotihs a63991bb4e Merge pull request #598 from bjornsnoen/master
Damager keyword
2013-12-31 09:11:20 -08:00
xawotihs b09db0c60f Removed c++11 warning. 2013-12-22 21:26:06 +01:00
Bjørn Snoen 928ca3497a More code compliance. New tests. 2013-12-21 19:31:32 +01:00
Bjørn Snoen 60219411f6 Coding style compliance 2013-12-21 14:33:44 +01:00
Bjørn Snoen 642f5bb515 Fixed indentation mistakes 2013-12-21 11:18:18 +01:00
Bjørn Snoen 20e878a102 Made damager keyword work. Fixed Executioner's Swing in mtg.txt 2013-12-21 11:05:15 +01:00
xawotihs da31371d86 Include c++11 threading 2013-12-20 18:39:02 +01:00
xawotihs 0df408793a Tries to fix android sdk installation in Travis 2013-12-20 14:09:30 +01:00
xawotihs 9630bcd56b Removed file wrongly added. 2013-12-20 12:37:25 +01:00
xawotihs 3c38e21b25 Merge branch 'master' into Qt5.2_macx 2013-12-20 11:14:10 +01:00
xawotihs caec886e22 Fixed issues found by XCode. 2013-12-20 00:24:08 +01:00
Dmitry Panin 927f8955e9 Merge pull request #596 from bjornsnoen/master
Fix a rarity mistake and a grammatical error
2013-12-19 02:44:38 -08:00
Bjørn Snoen d4e0296d2b Fixed wrong rarity on millstone in M14 2013-12-18 09:37:20 +01:00
Bjørn Snoen 8eb664f93d Fixed grammatical then/than error. 2013-12-18 05:50:30 +01:00
xawotihs b180c3d1a7 Fixed Qt5 mingw32 build 2013-12-16 22:11:28 +01:00
Dmitry Panin db9f18a644 Added _cards.dat for M14 (taken from forum) 2013-12-15 22:39:08 +04:00
xawotihs 95805ea387 Fixed QT mingw cross compile with QT4.8 2013-12-15 00:26:04 +01:00
xawotihs 4765890d0a Fixed mouse input with retina display 2013-12-14 23:46:23 +01:00
Xawotihs 2e13f29945 Update README.md 2013-12-14 19:13:26 +01:00
xawotihs 22b1c3b5d8 Fixed zip permission while rezipping PSP package 2013-12-14 14:40:26 +01:00
xawotihs c7bae65697 Fixed core unzip 2013-12-14 13:18:11 +01:00
xawotihs 2381f0306c Fixed paths 2013-12-14 12:06:51 +01:00
xawotihs b12e15e4ff Tries to arrange a bit the PSP binary package to make it more usual for users. 2013-12-14 11:55:12 +01:00
xawotihs 9e21751e12 Fixed windows build upload 2013-12-13 22:54:40 +01:00
xawotihs db60c38eda Added windows build 2013-12-13 23:07:17 +01:00
xawotihs 1a4327a2e6 Fixed mingw32 build linking 2013-12-13 21:54:43 +01:00
xawotihs 88095c67b8 Fixed mingw32 compilation 2013-12-13 21:27:40 +01:00
xawotihs ec34380668 Fixed mingw gcc package name 2013-12-13 00:12:32 +01:00
xawotihs 89dcd6c71d Added some windows cross compiling of the Qt flavor. 2013-12-12 17:54:43 -05:00
Dmitry Panin fd3cf574cf Remove previous tag "latest-master" before uploading new one 2013-12-12 21:08:39 +04:00
Dmitry Panin f21452feec Fixed some Cards:
Rune-Tail, Kitsune Ascendant
Shifting Sky
Flourishing Defenses (thanks to Shadowfireomega)
2013-12-12 20:11:35 +04:00
Dmitry Panin 0f85471216 Enabled automatic releases for each commit in master 2013-12-12 02:20:14 +04:00
Tobias Loose 5d92553017 Fix bug where the phase wheel got out of sync
The phase wheel messures phases within another unit and not
mtg phases. It is important to map between those
2013-12-11 01:53:05 +01:00
xawotihs f0e6d820c7 Fixed GuiPhaseBar logics. 2013-12-10 22:23:28 +01:00
xawotihs 545fc21260 Merge branch 'more_easing' of https://github.com/ZobyTwo/wagic into ZobyTwo-more_easing 2013-12-10 20:35:47 +01:00
Xawotihs 8b68568106 Merge pull request #585 from bjornsnoen/master
Added Avatar Tokens created by Ajani Goldmane.
2013-12-10 11:12:33 -08:00
xawotihs 739a5d9e2b Removed env traces and change the secure token as it was exposed. 2013-12-09 22:39:25 +01:00
Tobias Loose 4c627f74b6 Add easing to GuiPhaseBar, simplify math a bit. 2013-12-09 22:20:43 +01:00
Tobias Loose 1e610ff653 Add InQuadEasing and OutQuadEasing and make tasklists...
easing more natural
2013-12-09 22:20:43 +01:00
Tobias Loose 5d6557a49f Add easing to task list and fix a bug where
opening the task list a second time was not possible
2013-12-09 22:20:43 +01:00
xawotihs 7528329a58 Add more debug in travis script 2013-12-09 21:54:55 +01:00
xawotihs c62597dce5 Add some debugging to Travis script 2013-12-09 21:43:26 +01:00
Xawotihs d8dfcdba67 Merge pull request #583 from ZobyTwo/deck_viewer_1
Cleanup, usability fixes and source code documentation for DeckView.h and GridDeckView.h
2013-12-09 11:51:40 -08:00
Bjørn Snoen 7b5f00260b Added Avatar Tokens created by Ajani Goldmane. 2013-12-09 16:55:31 +01:00
Tobias Loose f9dc551942 Fix logic error in grid view 2013-12-08 23:05:06 +01:00
Tobias Loose 718ceca919 Do not allow that the selection moves outside in grid view. 2013-12-08 22:43:03 +01:00
xawotihs 89fb76a8e7 Updated scripts to remove any modified artifacts from Res directory.
Not doing it causes side effects on the testsuite.
2013-12-08 12:16:25 +01:00
Tobias Loose 1cc65ab611 Enable rotating over multiple filters, add src code doc 2013-12-08 12:03:13 +01:00
xawotihs 3b22354ad9 Fixed testsuite 2013-12-08 11:36:18 +01:00
Tobias Loose 2b9977a334 Rename methods for consistency and add source code doc
to DeckView.h
2013-12-08 10:48:15 +01:00
Tobias Loose 12c5f31562 Add a buttonMode to grid view to enable it on pointerless devices. 2013-12-08 09:11:44 +01:00
xawotihs 8cfd887375 Fixed upload script 2013-12-08 01:10:29 +01:00
Michael Nguyen a8cff5ed8e Merge branch 'master' into develop 2013-11-28 02:19:41 -08:00
92 changed files with 5763 additions and 740 deletions
+65 -21
View File
@@ -1,24 +1,68 @@
language: cpp language: cpp
before_install:
- export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk"
- export PSPSDK="$PSPDEV/psp/sdk"
- export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin"
- export ANDROID="android-sdk-linux/tools/android"
install:
- sudo apt-get update -qq
- if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch jq; fi
- wget -O sdk.lzma http://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download
- tar -x --xz -f sdk.lzma
- wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv
- wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv
- tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2
- tar -zxf android-sdk_r22-linux.tgz
- $ANDROID list sdk -a
- echo yes | $ANDROID update sdk -a --filter 1,2,4,18 --no-ui --force > log.txt
- sudo pip install pyjavaproperties
script: ./travis-script.sh
env: env:
global: global:
secure: YocijVYZa1oDPviFubPIpmBmXyw0gQ7D0YA6tC01wExXvY+8tGUh1HQ5uXn8LotRZ+Ob5HLHDaCzkKWF8+57ILSMeHrnf6tcRyyeO7wjNY9P7WvSZyCjvqnWzsUN9tiMmsEzhTz2MaUgsY6ocB/4nbWZwfQvL7z+s7z41R4J1I4= secure: "fJgWlCFbde96OSQNGKUmowGX+ERPeqP+n1EOMf1+FJzOU4DdkTLRAlV5+5qnEX9jB/3mWN6iPpmG1qEz/SdDG3KHxJYs4ZU/Lu485O24zZ/+GdYBNsrvhPD9ckPGEMLDa1foEVTDnW0Dlkz3BCFcszjhtXGUJv7v6Pj6LRk1Mg8="
script: "./travis-script.sh" matrix:
after_success: ./upload-binaries.sh - BUILD_TYPE=PSP
- BUILD_TYPE=Android
- BUILD_TYPE=Qt
branches:
except:
- latest-master
before_install:
- sudo apt-get update -qq
# Building for PSP here
- 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 -O sdk.lzma http://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="android-sdk-linux/tools/android" &&
if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch jq; fi &&
wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv &&
wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz -nv;
fi
# Building for Qt here
- if [ "$BUILD_TYPE" == "Qt" ]; then
sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa &&
sudo apt-get update -qq &&
sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev qttools5-dev qtmultimedia5-dev pulseaudio libpulse-dev &&
export QMAKE="qmake -qt=qt5";
fi
install:
# Building for PSP here
- if [ "$BUILD_TYPE" == "PSP" ]; then
tar -x --xz -f sdk.lzma;
fi
- if [ "$BUILD_TYPE" == "Android" ]; then
tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 &&
tar -zxf android-sdk_r23.0.2-linux.tgz &&
$ANDROID list sdk --extended -a &&
echo yes | $ANDROID update sdk --filter tools,platform-tools,build-tools-21.1.1,android-10 --no-ui --force --no-https;
fi
- sudo pip install pyjavaproperties
- sudo pip install github3.py
script: ./travis-script.sh
matrix:
fast_finish: true
deploy:
provider: releases
api-key:
secure: "gzfDEihpfTmoO6CSjTNpHSlLTPtQUZUqTlmD91CQby6+znDsOy4xsqj10MNXe+l/3KYny1DtM48nxNKeVjsyeYg66TTzKsrgMVzt6Ah5CBhSXO99/TiaMJmSXmMO7GGfKDct190Dqej1gbR7AMd38DOYe2vpR0LX+Lf3gzDVLoU="
file:
- ${TRAVIS_BUILD_DIR}/core.zip
- ${TRAVIS_BUILD_DIR}/projects/mtg/Android/bin/Wagic-debug.apk
- ${TRAVIS_BUILD_DIR}/projects/mtg/psprelease.zip
skip_cleanup: true
on:
repo: WagicProject/wagic
tags: false
branch: auto_releases
+128
View File
@@ -0,0 +1,128 @@
#ifndef DOWNLOADER_H
#define DOWNLOADER_H
//-------------------------------------------------------------------------------------
//
// This class handles download of remote resources (any kind of file)
// All the resources are stored locally in the userPath
// For every resources, the downloader verifies if the resource was modifed
// on the server before downloading the update. The Downloader maintains a catalogue
// of resource downloaded to be able to check if they need to be updated.
//
// The interface can be used completly synchronously by the application and some
// context or message loop is needed in the implementation of this interface
//
// Note that the Downloader could in theory by implemented on top of JNetwork.
//
//-------------------------------------------------------------------------------------
#include <string>
#include <ostream>
#include <istream>
#include <fstream>
#include <map>
#include "Threading.h"
#ifdef QT_CONFIG
#include <QObject>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkAccessManager>
#endif
using namespace std;
class DownloadRequest
#ifdef QT_CONFIG
: public QObject
#endif
{
#ifdef QT_CONFIG
Q_OBJECT
private slots:
#endif
void fileDownloaded();
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
#ifdef QT_CONFIG
signals:
void percentChanged(int percent);
void statusChanged(int);
#endif
public:
typedef enum {
NOT_PRESENT,
DOWNLOADING,
DOWNLOADED,
DOWNLOAD_ERROR
} DownloadStatus;
protected:
string mLocalPath;
string mRemoteResourceURL;
// previous one is the original, next one can change after redirection
string mRequestedRemoteResourceURL;
string mETag;
DownloadStatus mDownloadStatus;
bool mUpgradeAvailable;
size_t mTotalSize;
size_t mCurrentSize;
ofstream mFile;
#ifdef QT_CONFIG
QNetworkReply* mNetworkReply;
static QNetworkAccessManager networkAccessManager;
#endif
public:
DownloadRequest(string localPath="",
string remoteResourceURL="",
string ETag = "",
DownloadStatus downloadStatus=NOT_PRESENT,
size_t totalSize = 0,
size_t currentSize = 0);
~DownloadRequest();
static bool NetworkIsAccessible();
string getTempLocalPath() const { return (mLocalPath+".tmp"); };
string getLocalPath() const { return mLocalPath; };
string getRemoteResource() const { return mRemoteResourceURL; };
string getETag() const { return mETag; };
void startGet();
void startHead();
DownloadStatus getDownloadStatus() const { return mDownloadStatus; };
bool upgradeAvailable() const { return mUpgradeAvailable; };
void getSizes(size_t& totalSize, size_t&currentSize) {
totalSize = mTotalSize;
currentSize = mCurrentSize;
};
friend ostream& operator<<(ostream& out, const DownloadRequest& d);
friend istream& operator>>(istream&, DownloadRequest&);
friend class Downloader;
};
class Downloader
{
protected:
Downloader(string globalRemoteURL="", string localCacheRecords="");
virtual ~Downloader();
static Downloader* mInstance;
string mGlobalRemoteURL;
string mLocalCacheRecords;
boost::mutex mMutex;
map<string, DownloadRequest*> mRequestMap;
public:
static Downloader* GetInstance();
static void Release();
void Update();
DownloadRequest* Get(string localPath, string remoteResourceURL="");
friend ostream& operator<<(ostream& out, const Downloader& d);
friend istream& operator>>(istream&, Downloader&);
};
#endif // DOWNLOADER_H
-1
View File
@@ -297,7 +297,6 @@ public:
private: private:
float mTimer; float mTimer;
float mFrameTime; float mFrameTime;
JAnimator* mAnimator;
vector<JAnimatorObject *> mObjects; vector<JAnimatorObject *> mObjects;
}; };
-1
View File
@@ -37,7 +37,6 @@ private:
float mTexY; float mTexY;
float mTexWidth; float mTexWidth;
float mTexHeight; float mTexHeight;
JTexture* mTexture;
JQuad* mQuad; JQuad* mQuad;
+2 -1
View File
@@ -128,6 +128,7 @@ public:
bool readIntoString(const string & FilePath, string & target); bool readIntoString(const string & FilePath, string & target);
bool openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode = ios_base::out ); bool openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode = ios_base::out );
bool Rename(string from, string to); bool Rename(string from, string to);
bool Remove(string aFile);
//Returns true if strFilename exists somewhere in the fileSystem //Returns true if strFilename exists somewhere in the fileSystem
bool FileExists(const string& strFilename); bool FileExists(const string& strFilename);
@@ -163,4 +164,4 @@ protected:
#endif #endif
+125 -113
View File
@@ -23,28 +23,32 @@
#include "SLES/OpenSLES_Android.h" #include "SLES/OpenSLES_Android.h"
#elif defined USE_PHONON #elif defined USE_PHONON
#include <phonon/AudioOutput> #include <phonon/AudioOutput>
#include <phonon/MediaObject> #include <phonon/MediaObject>
#elif (defined QT_CONFIG)
#include "QMediaPlayer"
#include "QMediaPlaylist"
#include "QSoundEffect"
#elif defined WIN32 #elif defined WIN32
#include <windows.h> #include <windows.h>
#define WITH_FMOD #define WITH_FMOD
#elif defined (PSP) #elif defined (PSP)
#include <pspgu.h> #include <pspgu.h>
#include <pspkernel.h> #include <pspkernel.h>
#include <pspdisplay.h> #include <pspdisplay.h>
#include <pspdebug.h> #include <pspdebug.h>
#include <pspctrl.h> #include <pspctrl.h>
#include <time.h> #include <time.h>
#include <string.h> #include <string.h>
#include <pspaudiolib.h> #include <pspaudiolib.h>
#include <psprtc.h> #include <psprtc.h>
#include "JAudio.h" #include "JAudio.h"
#include "JMP3.h" #include "JMP3.h"
#endif #endif
#ifdef WITH_FMOD #ifdef WITH_FMOD
#include "../Dependencies/include/fmod.h" #include "../Dependencies/include/fmod.h"
#endif #endif
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
@@ -67,7 +71,7 @@ public:
#ifdef USE_PHONON #ifdef USE_PHONON
Phonon::AudioOutput* mOutput; Phonon::AudioOutput* mOutput;
Phonon::MediaObject* mMediaObject; Phonon::MediaObject* mMediaObject;
public slots: public slots:
void seekAtTheBegining(); void seekAtTheBegining();
#elif defined (PSP) #elif defined (PSP)
JMP3* mTrack; JMP3* mTrack;
@@ -82,6 +86,10 @@ public:
SLPlayItf playInterface; SLPlayItf playInterface;
SLSeekItf seekInterface; SLSeekItf seekInterface;
SLVolumeItf musicVolumeInterface; SLVolumeItf musicVolumeInterface;
#elif (defined QT_CONFIG)
QMediaPlaylist* playlist;
QMediaPlayer* player;
string fullpath;
#else #else
void* mTrack; void* mTrack;
#endif //WITH_FMOD #endif //WITH_FMOD
@@ -92,13 +100,15 @@ public:
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
class JSample class JSample
{ {
public: public:
JSample(); JSample();
~JSample(); ~JSample();
unsigned long fileSize(); unsigned long fileSize();
#if (defined QT_CONFIG) && (!defined USE_PHONON)
#if defined (PSP) QMediaPlayer* effect;
void* mSample;
#elif defined (PSP)
WAVDATA *mSample; WAVDATA *mSample;
#elif defined (IOS) #elif defined (IOS)
std::string filename; std::string filename;
@@ -133,126 +143,128 @@ class JSoundSystem
public: public:
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Get the singleton instance /// Get the singleton instance
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
static JSoundSystem* GetInstance(); static JSoundSystem* GetInstance();
static void Destroy(); static void Destroy();
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Load music. /// Load music.
/// ///
/// @note MP3 is the only supported format for the moment. /// @note MP3 is the only supported format for the moment.
/// ///
/// @param filename - Name of the music file. /// @param filename - Name of the music file.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
JMusic *LoadMusic(const char *fileName); JMusic *LoadMusic(const char *fileName);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Delete music from memory. /// Delete music from memory.
/// ///
/// @param music - Music to be deleted. /// @param music - Music to be deleted.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
//void FreeMusic(JMusic *music); //void FreeMusic(JMusic *music);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Play music. /// Play music.
/// ///
/// @param music - Music to be played. /// @param music - Music to be played.
/// @param looping - Play the music in a loop. /// @param looping - Play the music in a loop.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void PlayMusic(JMusic *music, bool looping = false); void PlayMusic(JMusic *music, bool looping = false);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Stop playing. /// Stop playing.
/// ///
/// @param music - Music to be stopped. /// @param music - Music to be stopped.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void StopMusic(JMusic *music); void StopMusic(JMusic *music);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Resume playing. /// Resume playing.
/// ///
/// @param music - Music to be resumed. /// @param music - Music to be resumed.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void ResumeMusic(JMusic *music); void ResumeMusic(JMusic *music);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Pause playing. /// Pause playing.
/// ///
/// @param music - Music to be paused. /// @param music - Music to be paused.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void PauseMusic(JMusic *music); void PauseMusic(JMusic *music);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Load sound effect. /// Load sound effect.
/// ///
/// @note WAV sound effect only. /// @note WAV sound effect only.
/// ///
/// @param fileName - Sound effect for loading. /// @param fileName - Sound effect for loading.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
JSample *LoadSample(const char *fileName); JSample *LoadSample(const char *fileName);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Delete sound effect from memory. /// Delete sound effect from memory.
/// ///
/// @param sample - Sound to be deleted. /// @param sample - Sound to be deleted.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
//void FreeSample(JSample *sample); //void FreeSample(JSample *sample);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Play sound effect. /// Play sound effect.
/// ///
/// @param sample - Sound for playing. /// @param sample - Sound for playing.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void PlaySample(JSample *sample); void PlaySample(JSample *sample);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Set volume for audio playback. /// Set volume for audio playback.
/// ///
/// @param volume - New volume. /// @param volume - New volume.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void SetVolume(int volume); void SetVolume(int volume);
void SetMusicVolume(int volume); void SetMusicVolume(int volume);
void SetSfxVolume(int volume); void SetSfxVolume(int volume);
int mChannel; int mChannel;
protected: protected:
JSoundSystem(); JSoundSystem();
~JSoundSystem(); ~JSoundSystem();
void InitSoundSystem(); void InitSoundSystem();
void DestroySoundSystem(); void DestroySoundSystem();
private: private:
#if (defined PSP || defined ANDROID)
JMusic *mCurrentMusic; JMusic *mCurrentMusic;
JSample *mCurrentSample; JSample *mCurrentSample;
#endif
int mVolume; int mVolume;
int mMusicVolume; int mMusicVolume;
int mSampleVolume; int mSampleVolume;
static JSoundSystem* mInstance; static JSoundSystem* mInstance;
}; };
#endif #endif
+89 -15
View File
@@ -1,7 +1,7 @@
#ifndef THREADING_H #ifndef THREADING_H
#define THREADING_H #define THREADING_H
#if !defined(PSP) && !defined(QT_CONFIG) #if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L)
#include <boost/date_time.hpp> #include <boost/date_time.hpp>
#ifdef WIN32 #ifdef WIN32
@@ -14,7 +14,7 @@
#endif #endif
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#elif !defined(QT_CONFIG) #elif defined(PSP)
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
@@ -26,7 +26,7 @@
namespace boost namespace boost
{ {
/** /**
** PSP specific variant of a boost mutex & scoped_lock ** PSP specific variant of a boost mutex & scoped_lock
*/ */
template <class Mutex> template <class Mutex>
@@ -60,7 +60,7 @@ namespace boost
{ {
sceKernelDeleteSema(mID); sceKernelDeleteSema(mID);
} }
void lock() void lock()
{ {
int result = sceKernelWaitSema(mID, 1, 0); int result = sceKernelWaitSema(mID, 1, 0);
@@ -142,7 +142,7 @@ namespace boost
} }
} }
int mID; int mID;
int mThreadID; int mThreadID;
volatile int mRecursionCount; volatile int mRecursionCount;
@@ -164,7 +164,7 @@ namespace boost
/** /**
** Emulating boost::thread configuration glue, with some shortcuts ** Emulating boost::thread configuration glue, with some shortcuts
** This detail namespace is a distillation of boost's thread.hpp, thread_data.hpp. ** This detail namespace is a distillation of boost's thread.hpp, thread_data.hpp.
*/ */
namespace detail namespace detail
@@ -212,13 +212,13 @@ namespace boost
** **
** The intent of its usage is this form only: ** The intent of its usage is this form only:
** mWorkerThread = boost::thread(ThreadProc, this); ** mWorkerThread = boost::thread(ThreadProc, this);
** where ThreadProc is a static member function of the 'this' class,eg: ** where ThreadProc is a static member function of the 'this' class,eg:
** static void FOO::ThreadProc(void* inParam) ** static void FOO::ThreadProc(void* inParam)
** { ** {
** FOO* instance = reinterpret_cast<FOO*>(inParam); ** FOO* instance = reinterpret_cast<FOO*>(inParam);
** // now you have class instance data available... ** // now you have class instance data available...
** } ** }
** **
** Any other variant of a thread proc with more than one param is unimplemented. ** Any other variant of a thread proc with more than one param is unimplemented.
*/ */
class thread class thread
@@ -227,7 +227,7 @@ namespace boost
** Helper class for sceKernelStartThread, which passes args by value, not by reference ** Helper class for sceKernelStartThread, which passes args by value, not by reference
** We use this struct to wrap any pointers that we want to pass to the worker thread. ** We use this struct to wrap any pointers that we want to pass to the worker thread.
*/ */
struct CallbackData struct CallbackData
{ {
CallbackData(detail::thread_data_ptr inThreadInfo) CallbackData(detail::thread_data_ptr inThreadInfo)
: mThreadInfo(inThreadInfo) : mThreadInfo(inThreadInfo)
@@ -307,7 +307,7 @@ namespace boost
} }
} }
#elif defined(QT_CONFIG) #elif defined(QT_CONFIG) && (__cplusplus <= 199711L)
#include <QMutex> #include <QMutex>
#include <QThread> #include <QThread>
@@ -537,6 +537,80 @@ namespace boost
} }
} }
#elif (__cplusplus > 199711L)
#include <thread>
#include <mutex>
namespace boost
{
typedef std::thread thread;
template <class Mutex>
struct unique_lock
{
unique_lock(Mutex& inMutex) : mMutex(&inMutex)
{
mMutex->lock();
}
~unique_lock()
{
mMutex->unlock();
}
Mutex* mMutex;
};
class mutex
{
public:
typedef unique_lock<mutex> scoped_lock;
mutex()
: mQMutex()
{
}
~mutex()
{
}
void lock()
{
mQMutex.lock();
}
void unlock()
{
mQMutex.unlock();
}
std::mutex mQMutex;
private:
mutex(mutex const&);
mutex& operator=(mutex const&);
};
namespace posix_time
{
typedef unsigned int milliseconds;
}
/**
** boost's platform neutral sleep call.
*/
namespace this_thread
{
inline void sleep(boost::posix_time::milliseconds const& time)
{
std::this_thread::sleep_for(std::chrono::milliseconds(time));
}
}
}
#endif #endif
#endif // THREADING_H #endif // THREADING_H
+15
View File
@@ -136,6 +136,20 @@ signals:
private slots: private slots:
private: private:
int lastPosx(){
#if QT_VERSION >= 0x050100
return m_lastPos.x()*devicePixelRatio();
#else
return m_lastPos.x();
#endif
}
int lastPosy(){
#if QT_VERSION >= 0x050100
return m_lastPos.y()*devicePixelRatio();
#else
return m_lastPos.y();
#endif
}
void timerEvent( QTimerEvent* ); void timerEvent( QTimerEvent* );
void doAndEnqueue(JButton action) { void doAndEnqueue(JButton action) {
m_engine->HoldKey_NoRepeat(action); m_engine->HoldKey_NoRepeat(action);
@@ -154,6 +168,7 @@ private:
int m_timerId; int m_timerId;
bool m_active; bool m_active;
QRect m_viewPort; QRect m_viewPort;
QPoint m_lastPos;
#ifdef QT_WIDGET #ifdef QT_WIDGET
#if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID) #if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID)
int mMouseDownX; int mMouseDownX;
+298
View File
@@ -0,0 +1,298 @@
#include "DebugRoutines.h"
#include "JFileSystem.h"
#include "Downloader.h"
#define RECORDS_DEFAULT_FILE "cache/records.txt"
#ifdef QT_CONFIG
QNetworkAccessManager DownloadRequest::networkAccessManager;
#endif
DownloadRequest::DownloadRequest(string localPath,
string remoteResourceURL,
string ETag,
DownloadStatus downloadStatus,
size_t totalSize,
size_t currentSize):
mLocalPath(localPath),
mRemoteResourceURL(remoteResourceURL),
mRequestedRemoteResourceURL(remoteResourceURL),
mETag(ETag),
mDownloadStatus(downloadStatus),
mUpgradeAvailable(false),
mTotalSize(totalSize),
mCurrentSize(currentSize)
{
}
DownloadRequest::~DownloadRequest()
{
}
void DownloadRequest::startHead()
{
#ifdef QT_CONFIG
QNetworkRequest request(QUrl(QString(mRequestedRemoteResourceURL.c_str())));
request.setRawHeader("If-None-Match", mETag.c_str());
mNetworkReply = networkAccessManager.head(request);
connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded()));
#endif
}
void DownloadRequest::startGet()
{
#ifdef QT_CONFIG
mNetworkReply = networkAccessManager.get(QNetworkRequest(QUrl(QString(mRequestedRemoteResourceURL.c_str()))));
#endif
mFile.close();
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(finished()), SLOT(fileDownloaded()));
#endif
}
void DownloadRequest::fileDownloaded()
{
do {
QByteArray eTagByteArray = mNetworkReply->rawHeader("ETag");
if(!eTagByteArray.isEmpty()) {
string oldETag = mETag;
mETag = QString(eTagByteArray).toStdString();
if(oldETag!="" && oldETag != mETag)
mUpgradeAvailable = true;
}
// let's check some error
if(mNetworkReply->error() != QNetworkReply::NoError) {
DebugTrace(mNetworkReply->errorString().toStdString());
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
mFile.close();
JFileSystem::GetInstance()->Remove(getTempLocalPath());
break;
}
// check if we're getting redirected
QVariant redirectionTarget = mNetworkReply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if (!redirectionTarget.isNull()) {
QUrl newUrl = QUrl(mRequestedRemoteResourceURL.c_str()).resolved(redirectionTarget.toUrl());
DebugTrace(string("Redirect to ")+ newUrl.toString().toStdString());
mRequestedRemoteResourceURL = newUrl.toString().toStdString();
mNetworkReply->deleteLater();
if(mFile.is_open())
startGet();
else
startHead();
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;
} while(0);
Downloader::GetInstance()->Update();
mNetworkReply->deleteLater();
emit statusChanged((int)mDownloadStatus);
}
void DownloadRequest::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
{
QByteArray byteArray = mNetworkReply->readAll();
mFile.write(byteArray.constData(), byteArray.size());
mCurrentSize = bytesReceived;
mTotalSize = bytesTotal;
int percent = 0;
if(bytesTotal)
percent = (bytesReceived/bytesTotal)*100;
emit percentChanged(percent);
}
Downloader* Downloader::mInstance = 0;
Downloader::Downloader(string globalRemoteURL, string localcacheRecords):
mGlobalRemoteURL(globalRemoteURL),
mLocalCacheRecords(localcacheRecords)
{
JFileSystem::GetInstance()->MakeDir("cache");
izfstream downloadRecords;
if(mLocalCacheRecords.empty())
mLocalCacheRecords = RECORDS_DEFAULT_FILE;
if(JFileSystem::GetInstance()->openForRead(downloadRecords, mLocalCacheRecords))
{// File exists, let's read it.
downloadRecords >> (*this);
}
JFileSystem::GetInstance()->CloseFile();
}
Downloader::~Downloader()
{
map<string, DownloadRequest*>::iterator ite;
for(ite = mRequestMap.begin(); ite != mRequestMap.end(); ite++)
{
delete (*ite).second;
}
mRequestMap.erase(mRequestMap.begin(), mRequestMap.end());
}
Downloader* Downloader::GetInstance()
{
if(!mInstance)
{
mInstance = new Downloader();
}
return mInstance;
}
void Downloader::Release()
{
if(mInstance)
{
delete mInstance;
mInstance = 0;
}
}
bool DownloadRequest::NetworkIsAccessible()
{
bool result = false;
#ifdef QT_CONFIG
networkAccessManager.setNetworkAccessible(QNetworkAccessManager::Accessible);
result = networkAccessManager.networkAccessible();
#endif
return result;
}
DownloadRequest* Downloader::Get(string localPath, string remoteResourceURL)
{
map<string, DownloadRequest*>::iterator ite = mRequestMap.find(localPath);
if(ite == mRequestMap.end())
{ // request does not exist, let's create it
DownloadRequest* request = new DownloadRequest(localPath, remoteResourceURL);
std::pair<std::map<string,DownloadRequest*>::iterator,bool> ret;
ret = mRequestMap.insert ( std::pair<string,DownloadRequest*>(localPath, request) );
if (ret.second==false) {
DebugTrace("Downloader::Get Error inserting request in Map");
return 0;
}
ite = ret.first;
}
// Now, we can check the server
if((*ite).second->getDownloadStatus() == DownloadRequest::NOT_PRESENT ||
(*ite).second->upgradeAvailable())
{ // File is not here or an update is available, let's get it
(*ite).second->startGet();
(*ite).second->mDownloadStatus = DownloadRequest::DOWNLOADING;
}
else if ((*ite).second->getDownloadStatus() == DownloadRequest::DOWNLOADED)
{ // File is here, let's check if there is some update without blocking the playback
(*ite).second->startHead();
}
return (*ite).second;
}
void Downloader::Update()
{
ofstream downloadRecords;
if(JFileSystem::GetInstance()->openForWrite(downloadRecords, mLocalCacheRecords))
{
downloadRecords << (*this);
}
downloadRecords.close();
}
ostream& operator<<(ostream& out, const DownloadRequest& d)
{
// HEAD request fails, so this line erase cache record after upgrade check :(
// if(d.getDownloadStatus() == DownloadRequest::DOWNLOADED)
{
out << "localPath=" << d.mLocalPath << endl;
out << "remoteResource=" << d.mRemoteResourceURL << endl;
out << "ETag=" << d.mETag << endl;
out << "upgradeAvailable=" << d.mUpgradeAvailable <<endl;
}
return out;
}
istream& operator>>(istream& in, DownloadRequest& d)
{
string s;
while(std::getline(in, s))
{
size_t limiter = s.find("=");
string areaS;
if (limiter != string::npos)
{
areaS = s.substr(0, limiter);
if (areaS.compare("localPath") == 0)
{
d.mLocalPath = s.substr(limiter + 1);
}
else if (areaS.compare("remoteResource") == 0)
{
d.mRemoteResourceURL = s.substr(limiter + 1);
d.mRequestedRemoteResourceURL = d.mRemoteResourceURL;
}
else if (areaS.compare("ETag") == 0)
{
d.mETag = s.substr(limiter + 1);
d.mDownloadStatus = DownloadRequest::DOWNLOADED;
}
else if (areaS.compare("upgradeAvailable") == 0)
{
d.mUpgradeAvailable = (bool)atoi(s.substr(limiter + 1).c_str());
break;
}
}
}
return in;
}
ostream& operator<<(ostream& out, const Downloader& d)
{
map<string, DownloadRequest*>::const_iterator ite;
for(ite = d.mRequestMap.begin(); ite != d.mRequestMap.end(); ite++)
{
out << (*(*ite).second) << endl;
}
return out;
}
istream& operator>>(istream& in, Downloader& d)
{
while(!in.eof())
{
DownloadRequest* downloadRequest = new DownloadRequest();
in >> (*downloadRequest);
if(!downloadRequest->getLocalPath().empty() &&
!downloadRequest->getRemoteResource().empty() &&
!downloadRequest->getETag().empty()) {
d.mRequestMap[downloadRequest->getLocalPath()] = downloadRequest;
} else {
delete downloadRequest;
}
}
return in;
}
+11 -1
View File
@@ -313,11 +313,15 @@ bool JFileSystem::readIntoString(const string & FilePath, string & target)
int fileSize = GetFileSize(file); int fileSize = GetFileSize(file);
#ifndef __MINGW32__
try { try {
#endif
target.resize((std::string::size_type) fileSize); target.resize((std::string::size_type) fileSize);
#ifndef __MINGW32__
} catch (bad_alloc&) { } catch (bad_alloc&) {
return false; return false;
} }
#endif
if (fileSize) if (fileSize)
@@ -553,7 +557,13 @@ bool JFileSystem::Rename(string _from, string _to)
string from = mUserFSPath + _from; string from = mUserFSPath + _from;
string to = mUserFSPath + _to; string to = mUserFSPath + _to;
std::remove(to.c_str()); std::remove(to.c_str());
return rename(from.c_str(), to.c_str()) ? true: false; return (rename(from.c_str(), to.c_str()) == 0);
}
bool JFileSystem::Remove(string aFile)
{
string toRemove = mUserFSPath + aFile;
return (std::remove(toRemove.c_str()) == 0);
} }
int JFileSystem::GetFileSize(izfstream & file) int JFileSystem::GetFileSize(izfstream & file)
+18 -11
View File
@@ -9,11 +9,11 @@
#include <QtDeclarative> #include <QtDeclarative>
#include "qmlapplicationviewer.h" #include "qmlapplicationviewer.h"
#endif //QT_WIDGET #endif //QT_WIDGET
#include "filedownloader.h" #include "Downloader.h"
#include "GameApp.h" #include "GameApp.h"
#include "corewrapper.h" #include "corewrapper.h"
QWidget* g_glwidget = NULL; WagicCore* g_glwidget = NULL;
static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] = static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] =
{ {
@@ -69,18 +69,25 @@ int main(int argc, char* argv[])
#endif //QT_WIDGET #endif //QT_WIDGET
if(argc >= 2 && string(argv[1]) == "testsuite")
{
int result = 0;
result += WagicCore::runTestSuite();
return result;
}
app->setApplicationName(WagicCore::getApplicationName()); app->setApplicationName(WagicCore::getApplicationName());
FileDownloader fileDownloader(USERDIR, WAGIC_RESOURCE_NAME); DownloadRequest* downloadRequest = NULL;
#ifdef WAGIC_RESOURCE_URL
Downloader*downloader = Downloader::GetInstance();
downloadRequest = downloader->Get(
"core.zip",
WAGIC_RESOURCE_URL
);
#endif
#ifdef QT_WIDGET #ifdef QT_WIDGET
g_glwidget = new WagicCore(); g_glwidget = new WagicCore();
g_glwidget->connect(&fileDownloader, SIGNAL(finished(int)), SLOT(start(int))); if(!downloadRequest || downloadRequest->getDownloadStatus() == DownloadRequest::DOWNLOADED)
{
g_glwidget->start(0);
}
else
{
g_glwidget->connect(downloadRequest, SIGNAL(statusChanged(int)), SLOT(start(int)));
}
#else #else
qmlRegisterType<WagicCore>("CustomComponents", 1, 0, "WagicCore"); qmlRegisterType<WagicCore>("CustomComponents", 1, 0, "WagicCore");
+14 -1
View File
@@ -78,7 +78,20 @@ extern "C" void Java_org_libsdl_app_SDLActivity_nativeResume(
{ {
if (!g_engine) if (!g_engine)
return; return;
g_engine->Resume(); g_engine->Resume();
}
#include "Wagic_Version.h"
extern "C" jstring Java_org_libsdl_app_SDLActivity_getResourceName(
JNIEnv* env, jclass cls)
{
return env->NewStringUTF (WAGIC_RESOURCE_NAME);
}
extern "C" jstring Java_org_libsdl_app_SDLActivity_getResourceUrl(
JNIEnv* env, jclass cls)
{
return env->NewStringUTF (WAGIC_RESOURCE_URL);
} }
#endif #endif
+125 -77
View File
@@ -22,6 +22,8 @@
JMusic::JMusic() JMusic::JMusic()
#ifdef USE_PHONON #ifdef USE_PHONON
: mOutput(0), mMediaObject(0) : mOutput(0), mMediaObject(0)
#elif defined QT_CONFIG
: playlist(0), player(0)
#endif #endif
{ {
} }
@@ -40,11 +42,16 @@ int JMusic::getPlayTime(){
JMusic::~JMusic() JMusic::~JMusic()
{ {
#ifdef USE_PHONON #if defined USE_PHONON
if(mOutput) if(mOutput)
delete mOutput; delete mOutput;
if(mMediaObject) if(mMediaObject)
delete mMediaObject; delete mMediaObject;
#elif defined QT_CONFIG
if(player)
delete player;
if(playlist)
delete playlist;
#elif defined WITH_FMOD #elif defined WITH_FMOD
JSoundSystem::GetInstance()->StopMusic(this); JSoundSystem::GetInstance()->StopMusic(this);
if (mTrack) FSOUND_Sample_Free(mTrack); if (mTrack) FSOUND_Sample_Free(mTrack);
@@ -69,7 +76,10 @@ JSample::JSample()
JSample::~JSample() JSample::~JSample()
{ {
#ifdef USE_PHONON #if (defined QT_CONFIG) && (!defined USE_PHONON)
if(effect)
delete effect;
#elif USE_PHONON
if(mOutput) if(mOutput)
delete mOutput; delete mOutput;
if(mMediaObject) if(mMediaObject)
@@ -144,65 +154,84 @@ void JSoundSystem::DestroySoundSystem()
JMusic *JSoundSystem::LoadMusic(const char *fileName) JMusic *JSoundSystem::LoadMusic(const char *fileName)
{ {
#ifdef USE_PHONON JMusic* music = NULL;
JMusic* music = new JMusic(); #if (defined QT_CONFIG) && (!defined USE_PHONON)
if (music) music = new JMusic();
{ if (music)
music->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
music->mMediaObject = new Phonon::MediaObject(0);
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
music->mMediaObject->setCurrentSource(QString(fullpath.c_str()));
Phonon::Path mediapath = Phonon::createPath(music->mMediaObject, music->mOutput);
Q_ASSERT(mediapath.isValid());
}
return music;
#elif (defined WITH_FMOD)
JMusic* music = new JMusic();
if (music)
{ {
JFileSystem* fileSystem = JFileSystem::GetInstance(); music->player = new QMediaPlayer;
if (fileSystem->OpenFile(fileName)) music->player->setVolume(100);
{ music->playlist = new QMediaPlaylist;
int size = fileSystem->GetFileSize(); music->fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
char *buffer = new char[size]; music->playlist->addMedia(QUrl::fromLocalFile(music->fullpath.c_str()));
fileSystem->ReadFile(buffer, size); music->playlist->setCurrentIndex(0);
music->mTrack = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size); }
#elif defined USE_PHONON
delete[] buffer; music = new JMusic();
fileSystem->CloseFile(); if (music)
} {
music->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
music->mMediaObject = new Phonon::MediaObject(0);
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
music->mMediaObject->setCurrentSource(QString(fullpath.c_str()));
Phonon::Path mediapath = Phonon::createPath(music->mMediaObject, music->mOutput);
Q_ASSERT(mediapath.isValid());
}
#elif (defined WITH_FMOD)
music = new JMusic();
if (music)
{
JFileSystem* fileSystem = JFileSystem::GetInstance();
if (fileSystem->OpenFile(fileName))
{
int size = fileSystem->GetFileSize();
char *buffer = new char[size];
fileSystem->ReadFile(buffer, size);
music->mTrack = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size);
delete[] buffer;
fileSystem->CloseFile();
}
} }
return music;
#else #else
cerr << fileName << endl; cerr << fileName << endl;
return NULL;
#endif #endif
return music;
} }
void JSoundSystem::PlayMusic(JMusic *music, bool looping) void JSoundSystem::PlayMusic(JMusic *music, bool looping)
{ {
#ifdef USE_PHONON #if (defined QT_CONFIG) && (!defined USE_PHONON)
if (music && music->mMediaObject && music->mOutput) if(music && music->player && music->playlist)
{
if(looping)
{ {
music->mMediaObject->connect(music->mMediaObject, SIGNAL(aboutToFinish()), music, SLOT(seekAtTheBegining())); if(looping)
music->playlist->setPlaybackMode(QMediaPlaylist::Loop);
music->player->setPlaylist(music->playlist);
music->player->play();
} }
music->mOutput->setVolume((qreal)mVolume*0.01); #elif USE_PHONON
music->mMediaObject->play(); if (music && music->mMediaObject && music->mOutput)
}
#elif (defined WITH_FMOD)
if (music && music->mTrack)
{ {
mChannel = FSOUND_PlaySound(mChannel, music->mTrack); if(looping)
SetMusicVolume(mVolume); {
music->mMediaObject->connect(music->mMediaObject, SIGNAL(aboutToFinish()), music, SLOT(seekAtTheBegining()));
}
music->mOutput->setVolume((qreal)mVolume*0.01);
music->mMediaObject->play();
if (looping) }
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_NORMAL); #elif (defined WITH_FMOD)
else if (music && music->mTrack)
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_OFF); {
mChannel = FSOUND_PlaySound(mChannel, music->mTrack);
SetMusicVolume(mVolume);
if (looping)
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_NORMAL);
else
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_OFF);
} }
#else #else
music = 0; music = 0;
@@ -213,7 +242,12 @@ void JSoundSystem::PlayMusic(JMusic *music, bool looping)
void JSoundSystem::StopMusic(JMusic *music) void JSoundSystem::StopMusic(JMusic *music)
{ {
#ifdef USE_PHONON #if (defined QT_CONFIG) && (!defined USE_PHONON)
if (music && music->player && music->playlist)
{
music->player->stop();
}
#elif defined USE_PHONON
if (music && music->mMediaObject && music->mOutput) if (music && music->mMediaObject && music->mOutput)
{ {
music->mMediaObject->stop(); music->mMediaObject->stop();
@@ -264,47 +298,61 @@ void JSoundSystem::SetSfxVolume(int volume){
JSample *JSoundSystem::LoadSample(const char *fileName) JSample *JSoundSystem::LoadSample(const char *fileName)
{ {
#if (defined USE_PHONON) JSample* sample = NULL;
JSample* sample = new JSample(); #if (defined QT_CONFIG) && (!defined USE_PHONON)
if (sample) sample = new JSample();
{ if (sample)
sample->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
sample->mMediaObject = new Phonon::MediaObject(0);
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
sample->mMediaObject->setCurrentSource(QString(fullpath.c_str()));
Phonon::Path mediapath = Phonon::createPath(sample->mMediaObject, sample->mOutput);
Q_ASSERT(mediapath.isValid());
}
return sample;
#elif (defined WITH_FMOD)
JSample* sample = new JSample();
if (sample)
{ {
JFileSystem* fileSystem = JFileSystem::GetInstance(); string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
if (fileSystem->OpenFile(fileName)) sample->effect = new QMediaPlayer;
{ sample->effect->setMedia(QUrl::fromLocalFile(fullpath.c_str()));
int size = fileSystem->GetFileSize(); sample->effect->setVolume(100);
char *buffer = new char[size]; sample->mSample = &(sample->effect);
fileSystem->ReadFile(buffer, size); }
sample->mSample = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size); #elif (defined USE_PHONON)
sample = new JSample();
if (sample)
{
sample->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
sample->mMediaObject = new Phonon::MediaObject(0);
string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName);
sample->mMediaObject->setCurrentSource(QString(fullpath.c_str()));
Phonon::Path mediapath = Phonon::createPath(sample->mMediaObject, sample->mOutput);
Q_ASSERT(mediapath.isValid());
}
#elif (defined WITH_FMOD)
sample = new JSample();
if (sample)
{
JFileSystem* fileSystem = JFileSystem::GetInstance();
if (fileSystem->OpenFile(fileName))
{
int size = fileSystem->GetFileSize();
char *buffer = new char[size];
fileSystem->ReadFile(buffer, size);
sample->mSample = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size);
delete[] buffer; delete[] buffer;
fileSystem->CloseFile(); fileSystem->CloseFile();
}else }else
sample->mSample = NULL; sample->mSample = NULL;
} }
return sample;
#else #else
cerr << fileName << endl; cerr << fileName << endl;
return NULL;
#endif #endif
return sample;
} }
void JSoundSystem::PlaySample(JSample *sample) void JSoundSystem::PlaySample(JSample *sample)
{ {
#ifdef USE_PHONON #if (defined QT_CONFIG) && (!defined USE_PHONON)
if(sample)
{
sample->effect->play();
}
#elif defined USE_PHONON
if (sample && sample->mMediaObject && sample->mOutput) if (sample && sample->mMediaObject && sample->mOutput)
{ {
sample->mOutput->setVolume((qreal)mSampleVolume*0.01); sample->mOutput->setVolume((qreal)mSampleVolume*0.01);
+28 -28
View File
@@ -418,29 +418,29 @@ void WagicCore::mousePressEvent(QMouseEvent *event)
{ {
if(event->button() == Qt::LeftButton) if(event->button() == Qt::LeftButton)
{ {
QPoint lastPos = event->pos(); m_lastPos = event->pos();
// this is intended to convert window coordinate into game coordinate. // this is intended to convert window coordinate into game coordinate.
// this is correct only if the game and window have the same aspect ratio, otherwise, it's just wrong // this is correct only if the game and window have the same aspect ratio, otherwise, it's just wrong
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth(); int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight(); int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
if (lastPos.y() >= m_viewPort.top() && if (lastPosy() >= m_viewPort.top() &&
lastPos.y() <= m_viewPort.bottom() && lastPosy() <= m_viewPort.bottom() &&
lastPos.x() <= m_viewPort.right() && lastPosx() <= m_viewPort.right() &&
lastPos.x() >= m_viewPort.left()) { lastPosx() >= m_viewPort.left()) {
m_engine->LeftClicked( m_engine->LeftClicked(
((lastPos.x()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth, ((lastPosx()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth,
((lastPos.y()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight); ((lastPosy()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight);
#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN) && (!defined Q_WS_ANDROID) #if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN) && (!defined Q_WS_ANDROID)
m_engine->HoldKey_NoRepeat(JGE_BTN_OK); m_engine->HoldKey_NoRepeat(JGE_BTN_OK);
#else #else
mMouseDownX = lastPos.x(); mMouseDownX = lastPosx();
mMouseDownY = lastPos.y(); mMouseDownY = lastPosy();
mLastFingerDownTime = g_startTimer.elapsed(); mLastFingerDownTime = g_startTimer.elapsed();
#endif #endif
} else if(lastPos.y()<m_viewPort.top()) { } else if(lastPosy()<m_viewPort.top()) {
m_engine->HoldKey_NoRepeat(JGE_BTN_MENU); m_engine->HoldKey_NoRepeat(JGE_BTN_MENU);
} else if(lastPos.y()>m_viewPort.bottom()) { } else if(lastPosy()>m_viewPort.bottom()) {
m_engine->HoldKey_NoRepeat(JGE_BTN_NEXT); m_engine->HoldKey_NoRepeat(JGE_BTN_NEXT);
} }
event->accept(); event->accept();
@@ -465,33 +465,33 @@ void WagicCore::mouseReleaseEvent(QMouseEvent *event)
{ {
if(event->button() == Qt::LeftButton) if(event->button() == Qt::LeftButton)
{ {
QPoint lastPos = event->pos(); m_lastPos = event->pos();
if (lastPos.y() >= m_viewPort.top() && if (lastPosy() >= m_viewPort.top() &&
lastPos.y() <= m_viewPort.bottom() && lastPosy() <= m_viewPort.bottom() &&
lastPos.x() <= m_viewPort.right() && lastPosx() <= m_viewPort.right() &&
lastPos.x() >= m_viewPort.left()) { lastPosx() >= m_viewPort.left()) {
#if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID) #if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID)
if(g_startTimer.elapsed() - mLastFingerDownTime <= kTapEventTimeout ) if(g_startTimer.elapsed() - mLastFingerDownTime <= kTapEventTimeout )
{ {
if(abs(mMouseDownX - lastPos.x()) < kHitzonePliancy && if(abs(mMouseDownX - lastPosx()) < kHitzonePliancy &&
abs(mMouseDownY - lastPos.y()) < kHitzonePliancy) abs(mMouseDownY - lastPosy()) < kHitzonePliancy)
{ {
m_engine->HoldKey_NoRepeat(JGE_BTN_OK); m_engine->HoldKey_NoRepeat(JGE_BTN_OK);
} }
} }
else if (g_startTimer.elapsed() - mLastFingerDownTime >= kSwipeEventMinDuration) else if (g_startTimer.elapsed() - mLastFingerDownTime >= kSwipeEventMinDuration)
{ // Let's swipe { // Let's swipe
m_engine->Scroll(lastPos.x()-mMouseDownX, lastPos.y()-mMouseDownY); m_engine->Scroll(lastPosx()-mMouseDownX, lastPosy()-mMouseDownY);
} }
#else #else
//#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN) //#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN)
m_engine->ReleaseKey(JGE_BTN_OK); m_engine->ReleaseKey(JGE_BTN_OK);
#endif #endif
m_engine->ReleaseKey(JGE_BTN_MENU); m_engine->ReleaseKey(JGE_BTN_MENU);
} else if(lastPos.y() < m_viewPort.top()) { } else if(lastPosy() < m_viewPort.top()) {
m_engine->ReleaseKey(JGE_BTN_MENU); m_engine->ReleaseKey(JGE_BTN_MENU);
} else if(lastPos.y() > m_viewPort.bottom()) { } else if(lastPosy() > m_viewPort.bottom()) {
m_engine->ReleaseKey(JGE_BTN_NEXT); m_engine->ReleaseKey(JGE_BTN_NEXT);
} }
event->accept(); event->accept();
@@ -517,15 +517,15 @@ void WagicCore::mouseMoveEvent(QMouseEvent *event)
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth(); int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight(); int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
QPoint lastPos = event->pos(); m_lastPos = event->pos();
if (lastPos.y() >= m_viewPort.top() && if (lastPosy() >= m_viewPort.top() &&
lastPos.y() <= m_viewPort.bottom() && lastPosy() <= m_viewPort.bottom() &&
lastPos.x() <= m_viewPort.right() && lastPosx() <= m_viewPort.right() &&
lastPos.x() >= m_viewPort.left()) { lastPosx() >= m_viewPort.left()) {
m_engine->LeftClicked( m_engine->LeftClicked(
((lastPos.x()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth, ((lastPosx()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth,
((lastPos.y()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight); ((lastPosy()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight);
event->accept(); event->accept();
} else { } else {
super::mouseMoveEvent(event); super::mouseMoveEvent(event);
+2
View File
@@ -106,6 +106,7 @@ public:
virtual int overflow(int c = EOF); virtual int overflow(int c = EOF);
virtual int underflow(); virtual int underflow();
virtual int sync(); virtual int sync();
using std::streambuf::setbuf;
virtual std::streambuf * setbuf(char * pr, int nLength); virtual std::streambuf * setbuf(char * pr, int nLength);
virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode); virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode);
@@ -131,6 +132,7 @@ public:
virtual int overflow(int c = EOF); virtual int overflow(int c = EOF);
virtual int underflow(); virtual int underflow();
virtual int sync(); virtual int sync();
using std::streambuf::setbuf;
virtual std::streambuf * setbuf(char * pr, int nLength); virtual std::streambuf * setbuf(char * pr, int nLength);
virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode); virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode);
+8 -1
View File
@@ -2,6 +2,8 @@
[![Build Status](https://travis-ci.org/WagicProject/wagic.png?branch=master)](https://travis-ci.org/WagicProject/wagic) [![Build Status](https://travis-ci.org/WagicProject/wagic.png?branch=master)](https://travis-ci.org/WagicProject/wagic)
[![Build status](https://ci.appveyor.com/api/projects/status/7j4fbr6m62aqej59/branch/master)](https://ci.appveyor.com/project/xawotihs/wagic/branch/master)
## Description ## Description
@@ -16,6 +18,11 @@ Wagic, the Homebrew, is a C++ game engine that allows to play card games against
It is highly customizable and allows the player to tweak the rules / create their own cards, their own themes, etc... It is highly customizable and allows the player to tweak the rules / create their own cards, their own themes, etc...
Info, Downloads, and more at http://wololo.net Info, downloads, discussions and more at http://wololo.net/forum/index.php
-![alt text](http://wololo.net/wagic/wp-content/uploads/2009/10/shop.jpg "Screenshot") -![alt text](http://wololo.net/wagic/wp-content/uploads/2009/10/shop.jpg "Screenshot")
### Sample round play-through video
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/WUFSAPZuDIk/0.jpg)](http://www.youtube.com/watch?v=WUFSAPZuDIk)
+68
View File
@@ -0,0 +1,68 @@
# Notes:
# - Minimal appveyor.yml file is an empty file. All sections are optional.
# - Indent each level of configuration with 2 spaces. Do not use tabs!
# - All section names are case-sensitive.
# - Section names should be unique on each level.
#---------------------------------#
# environment configuration #
#---------------------------------#
environment:
GH_TOKEN:
secure: dYnBDQkiY5oVjIlswzBX9BJigNtBGXgGlp1tK3XbHzrDEDrs2vaKD5m+Oz5OSz1C
# scripts that run after cloning repository
install:
- ps: (new-object net.webclient).DownloadFile('https://raw.github.com/pypa/pip/master/contrib/get-pip.py', 'C:/get-pip.py')
- "C:/Python27/python.exe C:/get-pip.py"
- "C:/Python27/Scripts/pip.exe install pyjavaproperties"
- "C:/Python27/Scripts/pip.exe install github3.py"
#---------------------------------#
# build configuration #
#---------------------------------#
# build Configuration, i.e. Debug, Release, etc.
configuration: Release
build:
project: projects/mtg/mtg_vs2010.sln # path to Visual Studio solution or project
#---------------------------------#
# tests configuration #
#---------------------------------#
# to disable automatic tests
test: off
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
# pushing windows package
- path: projects\mtg\bin\Wagic-windows*.zip
#---------------------------------#
# deployment configuration #
#---------------------------------#
# scripts to run before deployment
before_deploy:
- cd projects/mtg/bin
- "C:/Python27/python.exe createWindowsZip.py"
- cd ../../..
# scripts to run after deployment
after_deploy:
# to run your custom scripts instead of provider deployments
deploy_script:
- "C:/Python27/python.exe upload-binaries.py -t %GH_TOKEN% -s %APPVEYOR_REPO_COMMIT% -l projects/mtg/bin/Wagic-windows.zip -r Wagic-windows.zip -b %APPVEYOR_REPO_BRANCH%"
# to disable deployment
#deploy: off
-1
View File
@@ -57,7 +57,6 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \
$(MTG_PATH)/src/DeckMetaData.cpp \ $(MTG_PATH)/src/DeckMetaData.cpp \
$(MTG_PATH)/src/DeckStats.cpp \ $(MTG_PATH)/src/DeckStats.cpp \
$(MTG_PATH)/src/DuelLayers.cpp \ $(MTG_PATH)/src/DuelLayers.cpp \
$(MTG_PATH)/src/Effects.cpp \
$(MTG_PATH)/src/ExtraCost.cpp \ $(MTG_PATH)/src/ExtraCost.cpp \
$(MTG_PATH)/src/GameApp.cpp \ $(MTG_PATH)/src/GameApp.cpp \
$(MTG_PATH)/src/GameLauncher.cpp \ $(MTG_PATH)/src/GameLauncher.cpp \
@@ -80,7 +80,6 @@ public class SDLActivity extends Activity implements OnKeyListener
public Boolean mErrorHappened = false; public Boolean mErrorHappened = false;
public final static String RES_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/"; public final static String RES_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
public static String RES_FILENAME = "core_0184.zip"; public static String RES_FILENAME = "core_0184.zip";
public static final String RES_URL = "http://wagic.googlecode.com/files/";
public String systemFolder = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/"; public String systemFolder = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
private String userFolder; private String userFolder;
@@ -307,7 +306,7 @@ public class SDLActivity extends Activity implements OnKeyListener
private void startDownload() private void startDownload()
{ {
String url = RES_URL + RES_FILENAME; String url = getResourceUrl();
if (!checkStorageState()) if (!checkStorageState())
{ {
Log.e(TAG, "Error in initializing storage space."); Log.e(TAG, "Error in initializing storage space.");
@@ -437,7 +436,7 @@ public class SDLActivity extends Activity implements OnKeyListener
mContext = this.getApplicationContext(); mContext = this.getApplicationContext();
// get the current version of the app to set the core filename // get the current version of the app to set the core filename
String versionCodeString = getApplicationCode(); String versionCodeString = getApplicationCode();
RES_FILENAME = "core_" + versionCodeString + ".zip"; RES_FILENAME = getResourceName();
StorageOptions.determineStorageOptions(); StorageOptions.determineStorageOptions();
checkStorageLocationPreference(); checkStorageLocationPreference();
@@ -525,6 +524,9 @@ public class SDLActivity extends Activity implements OnKeyListener
} }
// C functions we call // C functions we call
public static native String getResourceUrl();
public static native String getResourceName();
public static native void nativeInit(); public static native void nativeInit();
public static native void nativeQuit(); public static native void nativeQuit();
+2 -2
View File
@@ -6,7 +6,7 @@ OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o\
objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o\ objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o\
objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o\ objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o\
objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o\ objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o\
objs/Effects.o objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\ objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\
objs/GameObserver.o objs/GameOptions.o objs/GameState.o\ objs/GameObserver.o objs/GameOptions.o objs/GameState.o\
objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\ objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\
objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\ objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\
@@ -128,7 +128,7 @@ clean:
endif endif
define compile define compile
$(CXX) -c $(CXXFLAGS) $< -o $@ $(CXX) -c $(CXXFLAGS) $< -o $@
endef endef
PrecompiledHeader.h.gch: ../../projects/mtg/include/PrecompiledHeader.h PrecompiledHeader.h.gch: ../../projects/mtg/include/PrecompiledHeader.h
+23 -13
View File
@@ -7,10 +7,13 @@ from optparse import OptionParser
def createResZipFile(filename): def createResZipFile(filename):
utilities = ZipUtilities() utilities = ZipUtilities()
rename = False
if not os.path.isfile('settings/options.txt'): if not os.path.isfile('settings/options.txt'):
os.rename('settings/options.orig.txt', 'settings/options.txt') os.rename('settings/options.orig.txt', 'settings/options.txt')
remame = True
if not os.path.isfile('player/options.txt'): if not os.path.isfile('player/options.txt'):
os.rename('player/options.orig.txt', 'player/options.txt') os.rename('player/options.orig.txt', 'player/options.txt')
rename = True
zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED) zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED)
utilities.addFolderToZip(zip_file, 'themes') utilities.addFolderToZip(zip_file, 'themes')
@@ -25,6 +28,10 @@ def createResZipFile(filename):
utilities.addFolderToZip(zip_file, 'campaigns') utilities.addFolderToZip(zip_file, 'campaigns')
utilities.addFolderToZip(zip_file, 'ai') utilities.addFolderToZip(zip_file, 'ai')
zip_file.close() zip_file.close()
if rename:
os.rename('settings/options.txt', 'settings/options.orig.txt')
os.rename('player/options.txt', 'player/options.orig.txt')
def getFilename(): def getFilename():
p = Properties(); p = Properties();
@@ -37,16 +44,18 @@ def getFilename():
def createStandardResFile(): def createStandardResFile(filename):
print "Creating Standard Resource File" print('Creating Standard Resource File')
filename = getFilename() + '.zip' if not filename:
filename = getFilename() + '.zip'
createResZipFile( filename ) createResZipFile( filename )
print >> sys.stderr, 'Created Resource Package for Standard Distribution: {0}'.format( filename) print >> sys.stderr, 'Created Resource Package for Standard Distribution: {0}'.format( filename)
def createIosResFile(): def createIosResFile(filename):
print 'Preparing Resource Package for iOS' print('Preparing Resource Package for iOS')
utilities = ZipUtilities() utilities = ZipUtilities()
filename = getFilename() + '_iOS.zip' if not filename:
filename = getFilename() + '_iOS.zip'
#createResZipFile( filename ) #createResZipFile( filename )
zip_file = zipfile.ZipFile(filename, 'a', zipfile.ZIP_STORED) zip_file = zipfile.ZipFile(filename, 'a', zipfile.ZIP_STORED)
zip_file.write("../../iOS/Res/rules/modrules.xml", "rules/modrules.xml", zipfile.ZIP_STORED) zip_file.write("../../iOS/Res/rules/modrules.xml", "rules/modrules.xml", zipfile.ZIP_STORED)
@@ -71,10 +80,10 @@ class ZipUtilities:
if file != '.svn': if file != '.svn':
full_path = os.path.join(folder, file) full_path = os.path.join(folder, file)
if os.path.isfile(full_path): if os.path.isfile(full_path):
print 'File added: ' + str(full_path) print('File added: ' + str(full_path))
zip_file.write(full_path) zip_file.write(full_path)
elif os.path.isdir(full_path): elif os.path.isdir(full_path):
print 'Entering folder: ' + str(full_path) print('Entering folder: ' + str(full_path))
self.addFolderToZip(zip_file, full_path) self.addFolderToZip(zip_file, full_path)
@@ -83,16 +92,17 @@ def main():
parser = OptionParser() parser = OptionParser()
parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform") parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform")
parser.add_option("-n", "--name", help="NAME: specify resource file name", metavar="NAME", dest="name")
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
if (options.platform): if (options.platform):
if (options.platform == "ios"): if (options.platform == "ios"):
createIosResFile() createIosResFile(options.name)
else: else:
createStandardResFile() createStandardResFile(options.name)
else: else:
createStandardResFile() createStandardResFile(options.name)
if __name__ == "__main__": if __name__ == "__main__":
main() main()
+846
View File
@@ -0,0 +1,846 @@
[meta]
author=Wagic Team
name=Born of the Gods
year=2014
block=Theros
[/meta]
[card]
primitive=Acolyte's Reward
id=378373
rarity=U
[/card]
[card]
primitive=Aerie Worshippers
id=378402
rarity=U
[/card]
[card]
primitive=Akroan Conscriptor
id=378459
rarity=U
[/card]
[card]
primitive=Akroan Phalanx
id=378374
rarity=U
[/card]
[card]
primitive=Akroan Skyguard
id=378375
rarity=C
[/card]
[card]
primitive=Arbiter of the Ideal
id=378403
rarity=R
[/card]
[card]
primitive=Archetype of Aggression
id=378460
rarity=U
[/card]
[card]
primitive=Archetype of Courage
id=378376
rarity=U
[/card]
[card]
primitive=Archetype of Endurance
id=378488
rarity=U
[/card]
[card]
primitive=Archetype of Finality
id=378430
rarity=U
[/card]
[card]
primitive=Archetype of Imagination
id=378404
rarity=U
[/card]
[card]
primitive=Ashiok's Adept
id=378431
rarity=U
[/card]
[card]
primitive=Aspect of Hydra
id=378489
rarity=C
[/card]
[card]
primitive=Asphyxiate
id=378432
rarity=C
[/card]
[card]
primitive=Astral Cornucopia
id=378529
rarity=R
[/card]
[card]
primitive=Bile Blight
id=378433
rarity=U
[/card]
[card]
primitive=Black Oak of Odunos
id=378434
rarity=U
[/card]
[card]
primitive=Bolt of Keranos
id=378461
rarity=C
[/card]
[card]
primitive=Brimaz, King of Oreskos
id=378377
rarity=M
[/card]
[card]
primitive=Champion of Stray Souls
id=378435
rarity=M
[/card]
[card]
primitive=Charging Badger
id=378490
rarity=C
[/card]
[card]
primitive=Chorus of the Tides
id=378405
rarity=C
[/card]
[card]
primitive=Chromanticore
id=378516
rarity=M
[/card]
[card]
primitive=Claim of Erebos
id=378436
rarity=C
[/card]
[card]
primitive=Courser of Kruphix
id=378491
rarity=R
[/card]
[card]
primitive=Crypsis
id=378406
rarity=C
[/card]
[card]
primitive=Culling Mark
id=378492
rarity=C
[/card]
[card]
primitive=Cyclops of One-Eyed Pass
id=378462
rarity=C
[/card]
[card]
primitive=Dawn to Dusk
id=378378
rarity=U
[/card]
[card]
primitive=Deepwater Hypnotist
id=378407
rarity=C
[/card]
[card]
primitive=Divination
id=378408
rarity=C
[/card]
[card]
primitive=Drown in Sorrow
id=378437
rarity=U
[/card]
[card]
primitive=Eater of Hope
id=378438
rarity=R
[/card]
[card]
primitive=Eidolon of Countless Battles
id=378379
rarity=R
[/card]
[card]
primitive=Elite Skirmisher
id=378380
rarity=C
[/card]
[card]
primitive=Ephara, God of the Polis
id=378517
rarity=M
[/card]
[card]
primitive=Ephara's Enlightenment
id=378518
rarity=U
[/card]
[card]
primitive=Ephara's Radiance
id=378381
rarity=C
[/card]
[card]
primitive=Epiphany Storm
id=378463
rarity=C
[/card]
[card]
primitive=Eternity Snare
id=378409
rarity=U
[/card]
[card]
primitive=Evanescent Intellect
id=378410
rarity=C
[/card]
[card]
primitive=Everflame Eidolon
id=378464
rarity=U
[/card]
[card]
primitive=Excoriate
id=378382
rarity=C
[/card]
[card]
primitive=Eye Gouge
id=378439
rarity=C
[/card]
[card]
primitive=Fall of the Hammer
id=378465
rarity=C
[/card]
[card]
primitive=Fanatic of Xenagos
id=378519
rarity=U
[/card]
[card]
primitive=Fate Unraveler
id=378440
rarity=R
[/card]
[card]
primitive=Fated Conflagration
id=378466
rarity=R
[/card]
[card]
primitive=Fated Infatuation
id=378411
rarity=R
[/card]
[card]
primitive=Fated Intervention
id=378493
rarity=R
[/card]
[card]
primitive=Fated Retribution
id=378383
rarity=R
[/card]
[card]
primitive=Fated Return
id=378441
rarity=R
[/card]
[card]
primitive=Fearsome Temper
id=378467
rarity=C
[/card]
[card]
primitive=Felhide Brawler
id=378442
rarity=C
[/card]
[card]
primitive=Felhide Spiritbinder
id=378468
rarity=R
[/card]
[card]
primitive=Flame-Wreathed Phoenix
id=378469
rarity=M
[/card]
[card]
primitive=Flitterstep Eidolon
id=378412
rarity=U
[/card]
[card]
primitive=Floodtide Serpent
id=378413
rarity=C
[/card]
[card]
primitive=Forgestoker Dragon
id=378470
rarity=R
[/card]
[card]
primitive=Forlorn Pseudamma
id=378443
rarity=U
[/card]
[card]
primitive=Forsaken Drifters
id=378444
rarity=U
[/card]
[card]
primitive=Ghostblade Eidolon
id=378384
rarity=U
[/card]
[card]
primitive=Gild
id=378445
rarity=R
[/card]
[card]
primitive=Gold
id=-378445
rarity=T
[/card]
[card]
primitive=Glimpse the Sun God
id=378385
rarity=U
[/card]
[card]
primitive=God-Favored General
id=378386
rarity=U
[/card]
[card]
primitive=Gorgon's Head
id=378530
rarity=U
[/card]
[card]
primitive=Graverobber Spider
id=378494
rarity=U
[/card]
[card]
primitive=Great Hart
id=378387
rarity=C
[/card]
[card]
primitive=Griffin Dreamfinder
id=378388
rarity=C
[/card]
[card]
primitive=Grisly Transformation
id=378446
rarity=C
[/card]
[card]
primitive=Herald of Torment
id=378447
rarity=R
[/card]
[card]
primitive=Hero of Iroas
id=378389
rarity=R
[/card]
[card]
primitive=Hero of Leina Tower
id=378495
rarity=R
[/card]
[card]
primitive=Heroes' Podium
id=378531
rarity=R
[/card]
[card]
primitive=Hold at Bay
id=378390
rarity=C
[/card]
[card]
primitive=Hunter's Prowess
id=378496
rarity=R
[/card]
[card]
primitive=Impetuous Sunchaser
id=378471
rarity=C
[/card]
[card]
primitive=Karametra, God of Harvests
id=378520
rarity=M
[/card]
[card]
primitive=Karametra's Favor
id=378497
rarity=C
[/card]
[card]
primitive=Kiora, the Crashing Wave
id=378521
rarity=M
[/card]
[card]
primitive=Kiora's Prevention
id=37852101
rarity=T
[/card]
[card]
primitive=Kiora's Kraken
id=-378521
rarity=T
[/card]
[card]
primitive=Kiora's Follower
id=378522
rarity=U
[/card]
[card]
primitive=Kragma Butcher
id=378472
rarity=C
[/card]
[card]
primitive=Kraken of the Straits
id=378414
rarity=U
[/card]
[card]
primitive=Lightning Volley
id=378473
rarity=U
[/card]
[card]
primitive=Loyal Pegasus
id=378391
rarity=C
[/card]
[card]
primitive=Marshmist Titan
id=378448
rarity=C
[/card]
[card]
primitive=Meletis Astronomer
id=378415
rarity=U
[/card]
[card]
primitive=Mindreaver
id=378416
rarity=R
[/card]
[card]
primitive=Mischief and Mayhem
id=378498
rarity=U
[/card]
[card]
primitive=Mogis, God of Slaughter
id=378523
rarity=M
[/card]
[card]
primitive=Mortal's Ardor
id=378392
rarity=C
[/card]
[card]
primitive=Mortal's Resolve
id=378499
rarity=C
[/card]
[card]
primitive=Necrobite
id=378449
rarity=C
[/card]
[card]
primitive=Nessian Demolok
id=378500
rarity=U
[/card]
[card]
primitive=Nessian Wilds Ravager
id=378501
rarity=R
[/card]
[card]
primitive=Noble Quarry
id=378502
rarity=U
[/card]
[card]
primitive=Nullify
id=378417
rarity=C
[/card]
[card]
primitive=Nyxborn Eidolon
id=378450
rarity=C
[/card]
[card]
primitive=Nyxborn Rollicker
id=378474
rarity=C
[/card]
[card]
primitive=Nyxborn Shieldmate
id=378393
rarity=C
[/card]
[card]
primitive=Nyxborn Triton
id=378418
rarity=C
[/card]
[card]
primitive=Nyxborn Wolf
id=378503
rarity=C
[/card]
[card]
primitive=Odunos River Trawler
id=378451
rarity=U
[/card]
[card]
primitive=Oracle of Bones
id=378475
rarity=R
[/card]
[card]
primitive=Oracle's Insight
id=378419
rarity=U
[/card]
[card]
primitive=Oreskos Sun Guide
id=378394
rarity=C
[/card]
[card]
primitive=Ornitharch
id=378395
rarity=U
[/card]
[card]
primitive=Pain Seer
id=378452
rarity=R
[/card]
[card]
primitive=Peregrination
id=378504
rarity=U
[/card]
[card]
primitive=Perplexing Chimera
id=378420
rarity=R
[/card]
[card]
primitive=Pharagax Giant
id=378476
rarity=C
[/card]
[card]
primitive=Phenax, God of Deception
id=378524
rarity=M
[/card]
[card]
primitive=Pheres-Band Raiders
id=378505
rarity=U
[/card]
[card]
primitive=Pheres-Band Tromper
id=378506
rarity=C
[/card]
[card]
primitive=Pillar of War
id=378532
rarity=U
[/card]
[card]
primitive=Pinnacle of Rage
id=378477
rarity=U
[/card]
[card]
primitive=Plea for Guidance
id=378396
rarity=R
[/card]
[card]
primitive=Ragemonger
id=378525
rarity=U
[/card]
[card]
primitive=Raised by Wolves
id=378507
rarity=U
[/card]
[card]
primitive=Reap what is Sown
id=378526
rarity=U
[/card]
[card]
primitive=Reckless Reveler
id=378478
rarity=C
[/card]
[card]
primitive=Retraction Helix
id=378421
rarity=C
[/card]
[card]
primitive=Revoke Existence
id=378397
rarity=C
[/card]
[card]
primitive=Rise to the Challenge
id=378479
rarity=C
[/card]
[card]
primitive=Sanguimancy
id=378453
rarity=U
[/card]
[card]
primitive=Satyr Firedancer
id=378480
rarity=R
[/card]
[card]
primitive=Satyr Nyx-Smith
id=378481
rarity=U
[/card]
[card]
primitive=Satyr Wayfinder
id=378508
rarity=C
[/card]
[card]
primitive=Scourge of Skola Vale
id=378509
rarity=R
[/card]
[card]
primitive=Scouring Sands
id=378482
rarity=C
[/card]
[card]
primitive=Searing Blood
id=378483
rarity=U
[/card]
[card]
primitive=Servant of Tymaret
id=378454
rarity=C
[/card]
[card]
primitive=Setessan Oathsworn
id=378510
rarity=C
[/card]
[card]
primitive=Setessan Starbreaker
id=378511
rarity=C
[/card]
[card]
primitive=Shrike Harpy
id=378455
rarity=U
[/card]
[card]
primitive=Silent Sentinel
id=378398
rarity=R
[/card]
[card]
primitive=Siren of the Fanged Coast
id=378422
rarity=U
[/card]
[card]
primitive=Siren of the Silent Song
id=378527
rarity=U
[/card]
[card]
primitive=Siren Song Lyre
id=378533
rarity=U
[/card]
[card]
primitive=Skyreaping
id=378512
rarity=U
[/card]
[card]
primitive=Snake of the Golden Grove
id=378513
rarity=C
[/card]
[card]
primitive=Sphinx's Disciple
id=378423
rarity=C
[/card]
[card]
primitive=Spirit of the Labyrinth
id=378399
rarity=R
[/card]
[card]
primitive=Spiteful Returned
id=378456
rarity=U
[/card]
[card]
primitive=Springleaf Drum
id=378534
rarity=U
[/card]
[card]
primitive=Stormcaller of Keranos
id=378484
rarity=U
[/card]
[card]
primitive=Stratus Walk
id=378424
rarity=C
[/card]
[card]
primitive=Sudden Storm
id=378425
rarity=C
[/card]
[card]
primitive=Sunbond
id=378400
rarity=U
[/card]
[card]
primitive=Swordwise Centaur
id=378514
rarity=C
[/card]
[card]
primitive=Temple of Enlightenment
id=378535
rarity=R
[/card]
[card]
primitive=Temple of Malice
id=378536
rarity=R
[/card]
[card]
primitive=Temple of Plenty
id=378537
rarity=R
[/card]
[card]
primitive=Thassa's Rebuff
id=378426
rarity=U
[/card]
[card]
primitive=Thunder Brute
id=378485
rarity=U
[/card]
[card]
primitive=Thunderous Might
id=378486
rarity=U
[/card]
[card]
primitive=Tromokratis
id=378427
rarity=R
[/card]
[card]
primitive=Unravel the AEther
id=378515
rarity=U
[/card]
[card]
primitive=Vanguard of Brimaz
id=378401
rarity=U
[/card]
[card]
primitive=Vortex Elemental
id=378428
rarity=U
[/card]
[card]
primitive=Warchanter of Mogis
id=378457
rarity=C
[/card]
[card]
primitive=Weight of the Underworld
id=378458
rarity=C
[/card]
[card]
primitive=Whelming Wave
id=378429
rarity=R
[/card]
[card]
primitive=Whims of the Fates
id=378487
rarity=R
[/card]
[card]
primitive=Xenagos, God of Revels
id=378528
rarity=M
[/card]
+5
View File
@@ -1513,3 +1513,8 @@ primitive=Zephyr Net
id=142357 id=142357
rarity=C rarity=C
[/card] [/card]
[card]
primitive=Avatar Token
id=-140233
rarity=T
[/card]
+5
View File
@@ -1248,3 +1248,8 @@ primitive=Zombie Goliath
id=190545 id=190545
rarity=C rarity=C
[/card] [/card]
[card]
primitive=Avatar Token
id=-191239
rarity=T
[/card]
+6 -1
View File
@@ -1257,4 +1257,9 @@ rarity=U
primitive=Yavimaya Wurm primitive=Yavimaya Wurm
id=205221 id=205221
rarity=C rarity=C
[/card] [/card]
[card]
primitive=Avatar Token
id=-205957
rarity=T
[/card]
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+4
View File
@@ -204,6 +204,7 @@ brass_man.txt
brass_man_i161.txt brass_man_i161.txt
briarhorn.txt briarhorn.txt
bringer_of_the_red_dawn.txt bringer_of_the_red_dawn.txt
buyback.txt
cage_of_hands.txt cage_of_hands.txt
Call_to_Heel_1.txt Call_to_Heel_1.txt
Call_to_Heel_2.txt Call_to_Heel_2.txt
@@ -308,6 +309,9 @@ evil_presence3.txt
evil_presence_i647.txt evil_presence_i647.txt
evil_presence_i647_2.txt evil_presence_i647_2.txt
exaltedsourcekilled.txt exaltedsourcekilled.txt
executioners_swing.txt
executioners_swing2.txt
executioners_swing3.txt
explore.txt explore.txt
Faceless_Butcher.txt Faceless_Butcher.txt
fading.txt fading.txt
+30
View File
@@ -0,0 +1,30 @@
# Cast card once with buyback and second time without.
# The card must be in the graveyard, not in the hand
[INIT]
FIRSTMAIN
[PLAYER1]
hand:Capsize
manapool:{5}{U}{U}{U}{U}
[PLAYER2]
inplay:Swamp,Island
[DO]
Capsize
# pay buyback
choice 1
Swamp
Capsize
Island
[ASSERT]
FIRSTMAIN
[PLAYER1]
graveyard:Capsize
[PLAYER2]
hand:Swamp,Island
[END]
@@ -0,0 +1,42 @@
#NAME: Executioner's Swing
#DESC: Checks targetability
#DESC: Test that can target creature that damaged creature this turn
[INIT]
combatattackers
[PLAYER1]
inplay:Grizzly Bears
[PLAYER2]
inplay:Flying Men,Swamp,Plains
hand:Executioner's Swing
[DO]
Grizzly Bears
next
Flying Men
next
next
next
# second main
# kill bear
yes
Swamp
Plains
Executioner's Swing
Grizzly Bears
endinterruption
[ASSERT]
secondmain
[PLAYER1]
graveyard:Grizzly Bears
[PLAYER2]
graveyard:Executioner's Swing,Flying Men
inplay:Plains,Swamp
[END]
@@ -0,0 +1,42 @@
#NAME: Executioner's Swing
#DESC: Checks targetability
#DESC: Test that can target creature that damaged player
[INIT]
combatattackers
[PLAYER1]
inplay:Grizzly Bears
[PLAYER2]
inplay:Swamp,Plains
hand:Executioner's Swing
[DO]
Grizzly Bears
next
next
next
next
# second main
# kill bear
yes
Swamp
Plains
Executioner's Swing
Grizzly Bears
endinterruption
[ASSERT]
secondmain
[PLAYER1]
graveyard:Grizzly Bears
[PLAYER2]
graveyard:Executioner's Swing
inplay:Plains,Swamp
life:18
[END]
@@ -0,0 +1,34 @@
#NAME: Executioner's Swing
#DESC: Checks targetability
#DESC: Prove that can't target passive creature
[INIT]
secondmain
[PLAYER1]
inplay:Grizzly Bears
[PLAYER2]
manapool:{B}{W}
hand:Executioner's Swing
[DO]
# attempt to kill bear
yes
Swamp
Plains
Executioner's Swing
Grizzly Bears
endinterruption
[ASSERT]
secondmain
[PLAYER1]
inplay:Grizzly Bears
[PLAYER2]
hand:Executioner's Swing
manapool:{W}{B}
[END]
+24
View File
@@ -0,0 +1,24 @@
#Testing Griselbrand with the new specific life cost {L:7}
#Player has 8 life and you cannot use the ability the second time if you cannot pay life.
#Must change griselbrand code to {L:7}:draw:7 instead of {L}{L}{L}{L}{L}{L}{L}:draw:7
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:Griselbrand
life:8
library:forest,forest,forest,forest,forest,forest,forest,plains,mountain,mountain,mountain,mountain,mountain,mountain,island
[PLAYER2]
life:20
[DO]
Griselbrand
Griselbrand
[ASSERT]
FIRSTMAIN
[PLAYER1]
inplay:Griselbrand
life:1
hand:mountain,mountain,mountain,mountain,mountain,mountain,island
library:forest,forest,forest,forest,forest,forest,forest,plains
[PLAYER2]
life:20
[END]
@@ -0,0 +1,38 @@
#Testing guild keyword gruul for Xenagos, God of Revels. You must have Born of the gods set (BNG)
#[card]
#name=Xenagos, God of Revels
#abilities=indestructible
#auto=@each my combatbegins:name(haste and +x/+x) target(other creature|mybattlefield) transforms((,newability[haste],newability[power/power])) ueot
#auto=this(variable{gruul}>6) transforms((Creature))
#text=Indestructible -- As long as your devotion to red and green is less than seven, Xenagos isn't a creature. -- At the beginning of combat on your turn, another target creature you control gains haste and gets +X/+X until end of turn, where X is that creature's power.
#mana={3}{R}{G}
#type=Legendary Enchantment
#subtype=God
#power=6
#toughness=5
#[/card]
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:378528
hand:19869
life:20
manapool:{G}{G}{G}{G}{G}
[PLAYER2]
life:20
[DO]
19869
next
choice 0
19869
next
19869
eot
[ASSERT]
UNTAP
[PLAYER1]
inplay:378528,19869
life:20
[PLAYER2]
life:12
[END]
+73
View File
@@ -0,0 +1,73 @@
import sys
import os
import zipfile
from pyjavaproperties import Properties
from optparse import OptionParser
def createWindowsZipFile(filename):
utilities = ZipUtilities()
zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED)
zip_file.write('../../../LICENSE')
zip_file.write('libpng13.dll')
zip_file.write('SDL.dll')
zip_file.write('fmod.dll')
zip_file.write('zlib1.dll')
zip_file.write('Wagic.exe')
zip_file.write('Res/' + getFilename('core') + '.zip')
zip_file.close()
def getFilename(filename):
p = Properties();
p.load(open('../build.number.properties'));
minor = p['build.minor'];
major = p['build.major'];
point = p['build.point'];
filename = filename + '-' + major + minor + point
return filename
def createStandardResFile():
print "Creating Resource File"
cmd = 'python createResourceZip.py -n ' + getFilename('core') + '.zip'
os.chdir("Res")
os.system(cmd)
os.chdir("..")
print "Creating Windows Package File"
filename = 'Wagic-windows.zip'
createWindowsZipFile( filename )
print >> sys.stderr, 'Created Windows Package: {0}'.format( filename)
class ZipUtilities:
def toZip(self, file, filename):
zip_file = zipfile.ZipFile(filename, 'w')
if os.path.isfile(file):
zip_file.write(file)
else:
self.addFolderToZip(zip_file, file)
zip_file.close()
def addFolderToZip(self, zip_file, folder):
zip_file.writestr(folder + '/', '')
for file in os.listdir(folder):
if file != '.svn':
full_path = os.path.join(folder, file)
if os.path.isfile(full_path):
print 'File added: ' + str(full_path)
zip_file.write(full_path)
elif os.path.isdir(full_path):
print 'Entering folder: ' + str(full_path)
self.addFolderToZip(zip_file, full_path)
def main():
## using optparse instead of argParse for now since python 2.7 may not be installed.
parser = OptionParser()
parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform")
(options, args) = parser.parse_args()
createStandardResFile()
if __name__ == "__main__":
main()
+4 -2
View File
@@ -3,7 +3,7 @@
<property file="build.properties" /> <property file="build.properties" />
<property file="build.number.properties" /> <property file="build.number.properties" />
<property environment="env"/> <property environment="env"/>
<path id="groovy.class.path" > <path id="groovy.class.path" >
<fileset dir="${groovy.dir}" /> <fileset dir="${groovy.dir}" />
</path> </path>
@@ -90,7 +90,9 @@ Author: Michael Nguyen
#define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR) #define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
#define WAGIC_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION) #define WAGIC_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION)
#define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION) #define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION)
#define WAGIC_RESOURCE_NAME WAGIC_CORE_VERSION_STRING ".zip" #define WAGIC_RESOURCE_NAME "Wagic-core.zip"
#define WAGIC_RELEASE_NAME "${env.RELEASE_NAME}"
#define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases/download/" WAGIC_RELEASE_NAME "/" WAGIC_RESOURCE_NAME
#endif #endif
+1 -1
View File
@@ -72,7 +72,7 @@ public:
} }
Interruptible(GameObserver* observer, int inID = 0, bool hasFocus = false) Interruptible(GameObserver* observer, int inID = 0, bool hasFocus = false)
: PlayGuiObject(40, x, y, inID, hasFocus), Targetable(observer), state(NOT_RESOLVED), display(0), source(NULL) : PlayGuiObject(40, 0.0f, 0.0f, inID, hasFocus), Targetable(observer), state(NOT_RESOLVED), display(0), source(NULL)
{ {
} }
+200
View File
@@ -172,6 +172,206 @@ private:
{ {
intValue = target->getManaCost()->getConvertedCost(); intValue = target->getManaCost()->getConvertedCost();
} }
else if (s == "azorius")//devotion blue white
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 2);
intValue += zone->countTotalManaSymbols(dtc, 5);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "boros")//devotion red white
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 3);
intValue += zone->countTotalManaSymbols(dtc, 5);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "dimir")//devotion blue black
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 2);
intValue += zone->countTotalManaSymbols(dtc, 4);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "golgari")//devotion to green black
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 1);
intValue += zone->countTotalManaSymbols(dtc, 4);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "gruul")//devotion to green red
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 1);
intValue += zone->countTotalManaSymbols(dtc, 3);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "izzet")//devotion to red blue
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 2);
intValue += zone->countTotalManaSymbols(dtc, 3);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "orzhov")//devotion to white black
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 4);
intValue += zone->countTotalManaSymbols(dtc, 5);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "rakdos")//devotion to red black
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 3);
intValue += zone->countTotalManaSymbols(dtc, 4);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "selesnya")//devotion to green white
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 1);
intValue += zone->countTotalManaSymbols(dtc, 5);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "simic")//devotion to green blue
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 1);
intValue += zone->countTotalManaSymbols(dtc, 2);
}
}
}
SAFE_DELETE(dtc);
}
else if (s.find("type:") != string::npos) else if (s.find("type:") != string::npos)
{ {
size_t begins = s.find("type:"); size_t begins = s.find("type:");
+1
View File
@@ -64,6 +64,7 @@ class CardDescriptor: public MTGCardInstance
string compareName; string compareName;
int CDopponentDamaged; int CDopponentDamaged;
int CDcontrollerDamaged; int CDcontrollerDamaged;
int CDdamager;
}; };
#endif #endif
+7 -4
View File
@@ -11,6 +11,7 @@ private:
static const float x_center; static const float x_center;
static const float right_border; static const float right_border;
static const float slide_animation_duration; static const float slide_animation_duration;
static const float scroll_animation_duration;
public: public:
CarouselDeckView(); CarouselDeckView();
@@ -18,19 +19,21 @@ public:
void Reset(); void Reset();
void UpdateViewState(float dt); void UpdateViewState(float dt);
void UpdateCardPosition(CardRep &rep, int index); void UpdateCardPosition(int index);
void renderCard(int index) void renderCard(int index)
{ {
int alpha = (int) (255 * (getCardRep(index).scale + 1.0 - max_scale)); int alpha = (int) (255 * (mCards[index].scale + 1.0 - max_scale));
DeckView::renderCard(index, alpha); DeckView::renderCard(index, alpha);
} }
void Render(); void Render();
bool ButtonPressed(Buttons button);
MTGCard * Click(int x, int y); MTGCard * Click(int x, int y);
MTGCard * Click();
void changePosition(int offset); void changePositionAnimated(int offset);
void changeFilter(int offset); void changeFilterAnimated(int offset);
MTGCard *getActiveCard(); MTGCard *getActiveCard();
private: private:
+190 -12
View File
@@ -9,55 +9,233 @@
#include "WResourceManager.h" #include "WResourceManager.h"
#include "Pos.h" #include "Pos.h"
/*! \brief A abstract base class for deck views
*
* The deck editor uses a deck view to present the cards
* e.g. in a circular "Carousel" layout or in a flat grid
* layout. Both layouts inherit this base class to ensure
* a common interface which the deck editor can rely on.
*/
class DeckView class DeckView
{ {
protected: protected:
/*! \brief defines the delay until additional card informations get shown
*
* \note I am not entirely sure about that
*/
static const float no_user_activity_show_card_delay; static const float no_user_activity_show_card_delay;
public: /*! \brief Represents a card for internal use in the deck view
*
* It stores positional information and a pointer to the actual card structure.
*/
struct CardRep{ struct CardRep{
float x; float x;
float y; float y;
float scale; float scale;
MTGCard * card; MTGCard * card;
}; };
public:
/*! \brief Defines if the filter needs an update
*
* The owner of the deck that is shown is responsible for updating the filters.
*/
bool dirtyFilters; bool dirtyFilters;
/*! \brief Defines if the card positions need an update
*
* If the card positions are dirty, UpdateCardPosition will get called on
* all cards during Update(float dt);
*
* \see Update
* \see UpdateCardPosition
*/
bool dirtyCardPos; bool dirtyCardPos;
/*! \brief Constructs the view and initializes datamembers
*
* It sets the dirty states to true, the currently shown deck to NULL and selects filter 0.
*
* \param numberOfCards the number of cards the view handles (this includes hidden cards for caching)
*/
DeckView(int numberOfCards); DeckView(int numberOfCards);
/*! \brief Does nothing but is needed to ensure proper deletion of derived classes.
*/
virtual ~DeckView(); virtual ~DeckView();
/*! \brief Resets nearly all datamembers to their initial values
*
* Does not reset mCards.
*/
virtual void Reset(); virtual void Reset();
//advances the view and card representations /*! \brief Advances the view by dt time units
*
* This method calls UpdateViewState unconditionally and UpdateCardPosition on every card
* if dirtyCardPos is set. It then resets dirtyCardPos.
*
* \param dt the number of time units to advance
* \see UpdateViewState
* \see UpdateCardPosition
*/
void Update(float dt); void Update(float dt);
virtual void SetDeck(DeckDataWrapper *toShow);
/*! \brief Sets the deck that this view shows
*
* This method replaces the currently shown deck with toShow, sets all dirty states and
* reloads the mtg cards. No ownership changes.
*
* \param toShow the deck to show
* \see reloadIndexes
*/
void SetDeck(DeckDataWrapper *toShow);
/*! \brief Returns a pointer to the current deck.
*/
DeckDataWrapper *deck(); DeckDataWrapper *deck();
void SwitchFilter(int delta);
void SwitchPosition(int delta); /*! \brief Performs an immediate switch of the filter without animations
*
* This method rotates the currently selected filter by delta and sets dirtyFilters.
*
* \param delta the filter to select relatively to the currently selected filter
* \see dirtyFilters
*/
void changeFilter(int delta);
/*! \brief Performs an immediate switch of the position without animations
*
* If the i-th card stored in mCards points to the j-th card in the deck, it will point
* to the (j+delta)-th card after this method is called. No dirty states are set.
*
* \param delta the number of cards to advances
* \see mCards
*/
void changePosition(int delta);
/*! \brief Returns the number of the currently selected filter
*
* \return the currently selected filter
*/
int filter(); int filter();
/*! \brief Reloads the mtg card pointers of mCards from the deck
*
* This is called when: We change the position in the deck or the deck structure changes
* (due to filtering or addition or removal of cards).
*/
void reloadIndexes(); void reloadIndexes();
/*! \brief Returns the current position in the deck
*/
int getPosition(); int getPosition();
/*! \brief Renders the view
*/
virtual void Render() = 0; virtual void Render() = 0;
/*! \brief Reacts to selections by a pointer device (e. g. mouse, touch)
*
* If the selection in view internal i. e. a card got selected, there is
* no outside action performed and this method will return NULL. If a action got
* triggered i. e. a selected card was activated, it returns that card
* for further handling by the caller.
*
* \param x the x coordinate of the pointer during the action
* \param y the y coordinate of the pointer during the action
* \returns the card the action corresponds to
*/
virtual MTGCard * Click(int x, int y) = 0; virtual MTGCard * Click(int x, int y) = 0;
bool ButtonPressed(Buttons button);
/*! \brief Reacts to selections by pointerless devices (e. g. buttons)
*
* \see Click(int x, int y)
* \returns the card the actions corresponds to
*/
virtual MTGCard * Click() = 0;
/*! \brief Handles ordinary button presses
*
* \param the pressed JButton
* \returns true if the view reacted to the button and false otherwise
*/
virtual bool ButtonPressed(Buttons button) = 0;
/*! \brief Returns the currently active card
*/
virtual MTGCard *getActiveCard() = 0; virtual MTGCard *getActiveCard() = 0;
virtual void changePosition(int offset) = 0;
virtual void changeFilter(int offset) = 0; /*! \brief Changes the position by a given offset
*
* Advances the view by offset cards and animates the change.
*
* \param offset the number of positions to advance
*/
virtual void changePositionAnimated(int offset) = 0;
/*! \brief Changes the filter by a given offset
*
* Rotates the selected filter by the given offset and animates the change.
*/
virtual void changeFilterAnimated(int offset) = 0;
protected: protected:
/*! \brief The number of time units since an user activity occurred
*/
float last_user_activity; float last_user_activity;
/*! \brief The currently selected filter
*/
int mFilter; int mFilter;
/*! \brief The currently selected deck
*
* This class does not take ownership of the deck
*/
DeckDataWrapper *mCurrentDeck; DeckDataWrapper *mCurrentDeck;
/*! \brief The card positions and pointers
*/
vector<CardRep> mCards; vector<CardRep> mCards;
CardRep& getCardRep(unsigned int index); /*! \brief Renders a card with given alpha value
*
* \param index of the card in mCards to render
* \param alpha the alpha value of the card
* \param asThumbnail renders the thumbnail image of the card if set to true
*
* \see mCards
*/
void renderCard(int index, int alpha, bool asThumbnail = false); void renderCard(int index, int alpha, bool asThumbnail = false);
/*! \brief Returns the index in mCards of the card that is nearest to the given point
*
* \note This method uses the euclidian distance to the center of the card
*
* \param x the reference points x coordinate
* \param y the reference points y coordinate
* \returns the index of the nearest card to the reference point and -1 of mCards is empty
*/
int getCardIndexNextTo(int x, int y); int getCardIndexNextTo(int x, int y);
private: private:
/*! \brief Updates the state of the view e. g. view transitions
*
* \param dt the passes time since the last update
*/
virtual void UpdateViewState(float dt) = 0; virtual void UpdateViewState(float dt) = 0;
virtual void UpdateCardPosition(CardRep& rep, int index) = 0;
/*! \brief Updates the given card reps positional members
*
* This method is called from Update when dirtyCardPos is set
*
* \param index the index in mCards of the card to update
*
* \see Update
* \see mCards
*/
virtual void UpdateCardPosition(int index) = 0;
}; };
#endif // _DECK_VIEW_H_ #endif // _DECK_VIEW_H_
+45 -1
View File
@@ -95,7 +95,7 @@ public:
*/ */
void update(float dt) void update(float dt)
{ {
if(duration > 0) if(time_acc < duration)
{ {
time_acc += dt; time_acc += dt;
@@ -167,6 +167,50 @@ public:
} }
}; };
/*! \brief This class defines an easing with quadratic acceleration
*/
class InQuadEasing : public Easing
{
public:
/*! \brief Calls Easing::Easing(val).
*
* \see Easing::Easing(float& val)
*/
InQuadEasing(float& val): Easing(val) {}
/*! \brief Implements the value calculation.
*
* \see Easing::updateValue()
*/
void updateValue()
{
float time_tmp = time_acc / duration;
value = delta_value * time_tmp * time_tmp + start_value;
}
};
/*! \brief This class defines an easing with quadratic decceleration
*/
class OutQuadEasing : public Easing
{
public:
/*! \brief Calls Easing::Easing(val).
*
* \see Easing::Easing(float& val)
*/
OutQuadEasing(float& val): Easing(val) {}
/*! \brief Implements the value calculation.
*
* \see Easing::updateValue()
*/
void updateValue()
{
float time_tmp = time_acc / duration;
value = (-delta_value) * time_tmp * (time_tmp - 2.0f) + start_value;
}
};
/*! \brief This class defines an easing with quadratic acceleration and decceleration. /*! \brief This class defines an easing with quadratic acceleration and decceleration.
*/ */
class InOutQuadEasing : public Easing class InOutQuadEasing : public Easing
-13
View File
@@ -1,13 +0,0 @@
#ifndef _EFFECTS_H_
#define _EFFECTS_H_
#include <JGui.h>
class Effect: public JGuiObject
{
static int id_counter;
public:
Effect() : JGuiObject(++id_counter) {};
};
#endif // _EFFECTS_H_
+13
View File
@@ -90,6 +90,19 @@ public:
virtual LifeCost * clone() const; virtual LifeCost * clone() const;
}; };
//Specific life cost
class SpecificLifeCost : public ExtraCost
{
private:
int slc;
public:
SpecificLifeCost(TargetChooser *_tc = NULL, int slc = 0);
virtual int canPay();
virtual int doPay();
virtual SpecificLifeCost * clone() const;
};
//phyrexian mana //phyrexian mana
class LifeorManaCost : public ExtraCost class LifeorManaCost : public ExtraCost
{ {
-1
View File
@@ -17,7 +17,6 @@ private:
WSrcCards * setSrc; WSrcCards * setSrc;
SimpleMenu * menu; SimpleMenu * menu;
bool showMenu; bool showMenu;
bool showAlt;
bool saveMe; bool saveMe;
int mState; int mState;
int mDetailItem; int mDetailItem;
-1
View File
@@ -65,7 +65,6 @@ private:
JQuadPtr pspIcons[8]; JQuadPtr pspIcons[8];
WSrcCards * srcCards; WSrcCards * srcCards;
TaskList * taskList; TaskList * taskList;
float mElapsed;
WGuiMenu * shopMenu; WGuiMenu * shopMenu;
WGuiFilters * filterMenu; //Filter menu slides in sideways from right, or up from bottom. WGuiFilters * filterMenu; //Filter menu slides in sideways from right, or up from bottom.
WGuiCardImage * bigDisplay; WGuiCardImage * bigDisplay;
+122 -6
View File
@@ -4,6 +4,15 @@
#include "DeckView.h" #include "DeckView.h"
#include "Easing.h" #include "Easing.h"
/*! \brief Implements a grid view
*
* This view displays 12 cards in two rows as thumbnails. The currently
* selected card is dislayed bigger than the rest and uses the fullsize
* image. Scrolling the view horizontally and toggeling filters is
* animated and uses quadratic easing.
*
* It also implements a button mode for pointerless devices.
*/
class GridDeckView : public DeckView class GridDeckView : public DeckView
{ {
private: private:
@@ -12,27 +21,134 @@ private:
static const float card_scale_small; static const float card_scale_small;
static const float card_scale_big; static const float card_scale_big;
public: public:
/*! \brief Constructs a grid view with no decks set
*/
GridDeckView(); GridDeckView();
/*! \brief Does nothing but is needed to ensure proper deletion of derived classes.
*/
virtual ~GridDeckView(); virtual ~GridDeckView();
/*! \brief Resets almost all member variables but mRows and mCols
*/
void Reset(); void Reset();
/*! \brief Advances scrolling and sliding animations
*
* \param dt the time since the last update
*
* \see DeckView::UpdateViewState()
*/
void UpdateViewState(float dt); void UpdateViewState(float dt);
void UpdateCardPosition(CardRep &rep, int index);
/*! \brief Updates the cards position
*
* \see DeckView::UpdateCardPosition()
*/
void UpdateCardPosition(int index);
/*! \brief Renders the view
*
* This method prefetches all rendered cards as thumbnails except the
* selected card to reduce cache pressure.
*/
void Render(); void Render();
/*! \brief Handles button presses
*
* The mapping is as follows:
* JGE_BTN_LEFT moves the position to the left if not in button mode
* moves the selection otherwise
* JGE_BTN_RIGHT move the position to the right if not in button mode
* moves the selection otherwise
* JGE_BTN_UP select the previous filter if not in button mode
* moves the selection otherwise
* JGE_BTN_DOWN select the next filter if not in button mode
* moves the selection otherwise
* JGE_BTN_CTRL deactivate button mode
*
* \param button the pressed button
* \returns if the view handled the button
*/
bool ButtonPressed(Buttons button);
/*! \brief Handles clicks and triggers scrolling and the selection of cards
*
* This method deactivates the button mode and searches for the nearest
* card to the given position. If this card is in column 0 or 1 it scrolls
* left. If it is in column (mCols-1) or (mCols-2) it scrolls to the right.
* In any other case, it selects the card.
*
* \param x the clicks x coordinate
* \param y the clicks y coordinate
*
* \return selected card c if c was already selected and no animation is running, NULL otherwise
*/
MTGCard * Click(int x, int y); MTGCard * Click(int x, int y);
void changePosition(int offset); /*! \brief Handles pointerless clicks (JGE_BTN_OK)
void changeFilter(int offset); *
* If no card is selected, this method activates button mode and selects a card.
*
* \returns selected card, NULL otherwise
*/
MTGCard * Click();
/*! \brief Scrolls the view horizontally
*
* \param offset the number of columns to scroll
*/
void changePositionAnimated(int offset);
/*! \brief Rotates the selected filter and slides vertically
*
* \param the number of filters to rotate
*/
void changeFilterAnimated(int offset);
/*! \brief Returns the currently selected card
*
* \returns card c if c is selected and in column 4 to 6 and NULL otherwise*/
MTGCard *getActiveCard(); MTGCard *getActiveCard();
private: private:
int mCols; /*! \brief The amount of columns (visible and hidden)
int mRows; */
float mScrollOffset, mSlideOffset; const int mCols;
/*! \brief The amount of rows
*/
const int mRows;
/*! \brief The current scrolling offset
*/
float mScrollOffset;
/*! \brief The current sliding offset
*/
float mSlideOffset;
/*! \brief The easing functor that gets applied while scrolling
*/
InOutQuadEasing mScrollEasing; InOutQuadEasing mScrollEasing;
/*! \brief The easing functor that gets applied while sliding
*/
InOutQuadEasing mSlideEasing; InOutQuadEasing mSlideEasing;
/*! \brief The current selected card index
*/
int mCurrentSelection; int mCurrentSelection;
/*! \brief Stores if we are in button mode.
*/
bool mButtonMode;
/*! \brief Moves the card selection by an offset.
*
* \param offset the offset to move the selection
* \param alignIfOutOfBounds the view will scroll if the selection moves out of bound if set to true
*/
void moveSelection(int offset, bool alignIfOutOfBounds);
}; };
#endif //_GRID_DECK_VIEW_H #endif //_GRID_DECK_VIEW_H
+13 -3
View File
@@ -4,15 +4,25 @@
#include "GuiLayers.h" #include "GuiLayers.h"
#include "PhaseRing.h" #include "PhaseRing.h"
#include "WEvent.h" #include "WEvent.h"
#include "PlayGuiObject.h"
#include "Easing.h"
class GuiPhaseBar: public GuiLayer, public PlayGuiObject class GuiPhaseBar: public GuiLayer, public PlayGuiObject
{ {
protected: private:
Phase* phase; static const float zoom_big;
static const float zoom_small;
static const float step;
int displayedPhaseId;
float angle; float angle;
float zoomFactor; float zoomFactor;
DuelLayers* mpDuelLayers; OutQuadEasing angleEasing;
InOutQuadEasing zoomFactorEasing;
DuelLayers* mpDuelLayers;
void DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale);
public: public:
GuiPhaseBar(DuelLayers* duelLayers); GuiPhaseBar(DuelLayers* duelLayers);
~GuiPhaseBar(); ~GuiPhaseBar();
-1
View File
@@ -47,7 +47,6 @@ protected:
{ {
static const float HEIGHT; static const float HEIGHT;
unsigned attackers; unsigned attackers;
unsigned blockers;
unsigned currentAttacker; unsigned currentAttacker;
float height; float height;
+1
View File
@@ -65,6 +65,7 @@ public:
bool wasDealtDamage; bool wasDealtDamage;
bool damageToOpponent; bool damageToOpponent;
bool damageToController; bool damageToController;
bool damageToCreature;
bool mPropertiesChangedSinceLastUpdate; bool mPropertiesChangedSinceLastUpdate;
int reduxamount; int reduxamount;
int flanked; int flanked;
-2
View File
@@ -12,7 +12,6 @@
#define GUI_OPPONENTHAND 5 #define GUI_OPPONENTHAND 5
#include <JGui.h> #include <JGui.h>
#include "Effects.h"
#include "WEvent.h" #include "WEvent.h"
#include "Pos.h" #include "Pos.h"
@@ -65,7 +64,6 @@ public:
} }
; ;
virtual ~PlayGuiObject() {}; virtual ~PlayGuiObject() {};
vector<Effect*> effects;
}; };
#endif #endif
-1
View File
@@ -20,7 +20,6 @@ class SimplePopup: public JGuiController
private: private:
float mWidth, mX, mY; float mWidth, mX, mY;
int mMaxLines; int mMaxLines;
int mFontId;
DeckMetaData * mDeckInformation; DeckMetaData * mDeckInformation;
string mTitle; string mTitle;
WFont *mTextFont; WFont *mTextFont;
+11 -2
View File
@@ -2,8 +2,15 @@
#define TASK_H #define TASK_H
#include <vector> #include <vector>
#include <string>
#include "Easing.h"
using namespace std;
class GameObserver; class GameObserver;
class JQuad;
class JTexture;
// Task type constant // Task type constant
@@ -72,8 +79,11 @@ class TaskList
{ {
protected: protected:
string fileName; string fileName;
float vPos; float vPos;
float mElapsed; OutQuadEasing vPosInEasing;
InQuadEasing vPosOutEasing;
int mState; int mState;
JQuad * mBg[9]; JQuad * mBg[9];
JTexture * mBgTex; JTexture * mBgTex;
@@ -97,7 +107,6 @@ public:
{ {
return mState; return mState;
} }
;
void addTask(string params, bool rand = false); void addTask(string params, bool rand = false);
void addTask(Task *task); void addTask(Task *task);
void addRandomTask(int diff = 100); void addRandomTask(int diff = 100);
+4 -4
View File
@@ -1,12 +1,12 @@
#ifndef WRESOURCE_FWD_H #ifndef WRESOURCE_FWD_H
#define WRESOURCE_FWD_H #define WRESOURCE_FWD_H
#ifndef WP8 #if (__cplusplus > 199711L)
#include <boost/shared_ptr.hpp>
typedef boost::shared_ptr<JQuad> JQuadPtr;
#else
#include <memory> #include <memory>
typedef std::shared_ptr<JQuad> JQuadPtr; typedef std::shared_ptr<JQuad> JQuadPtr;
#else
#include <boost/shared_ptr.hpp>
typedef boost::shared_ptr<JQuad> JQuadPtr;
#endif #endif
#endif #endif
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef _DEBUG_H_ #ifndef _DEBUG_H_
#define _DEBUG_H_ #define _DEBUG_H_
#if ((defined WIN32) || (defined WP8)) #if ((defined WIN32) || (defined WP8)) && !defined(__MINGW32__)
#define snprintf sprintf_s #define snprintf sprintf_s
#endif #endif
+1 -1
View File
@@ -314,7 +314,7 @@ bool AIHints::canWeCombo(GameObserver* observer,MTGCardInstance * card,AIPlayerB
int comboPartsRestriction = 0; int comboPartsRestriction = 0;
if(gotCombo) if(gotCombo)
return gotCombo;//because more then one might be possible at any time. return gotCombo;//because more than one might be possible at any time.
if (hints[i]->hold.size()) if (hints[i]->hold.size())
{ {
for(unsigned int hPart = 0; hPart < hints[i]->hold.size(); hPart++) for(unsigned int hPart = 0; hPart < hints[i]->hold.size(); hPart++)
+2 -2
View File
@@ -445,7 +445,7 @@ int OrderedAIAction::getEfficiency()
} }
if ((drawer->getNumCards() >= p->game->library->nb_cards && (Targetable*)p == drawer->getTarget()) || (p->game->hand->nb_cards > 10 && (Targetable*)p == drawer->getTarget())) if ((drawer->getNumCards() >= p->game->library->nb_cards && (Targetable*)p == drawer->getTarget()) || (p->game->hand->nb_cards > 10 && (Targetable*)p == drawer->getTarget()))
{ {
//if the amount im drawing will mill me to death or i have more then 10 cards in hand, eff is 0; //if the amount im drawing will mill me to death or i have more than 10 cards in hand, eff is 0;
efficiency = 0; efficiency = 0;
} }
break; break;
@@ -853,7 +853,7 @@ ManaCost * AIPlayerBaka::getPotentialMana(MTGCardInstance * target)
if (card == target) if (card == target)
used[card] = true; //http://code.google.com/p/wagic/issues/detail?id=76 used[card] = true; //http://code.google.com/p/wagic/issues/detail?id=76
if (!used[card] && amp->isReactingToClick(card) && amp->output->getConvertedCost() == 1) if (!used[card] && amp->isReactingToClick(card) && amp->output->getConvertedCost() == 1)
{//ai can't use cards which produce more then 1 converted while using the old pMana method. {//ai can't use cards which produce more than 1 converted while using the old pMana method.
result->add(amp->output); result->add(amp->output);
used[card] = true; used[card] = true;
} }
+6 -9
View File
@@ -1994,28 +1994,23 @@ int AADynamic::resolve()
break; break;
case DYNAMIC_ABILITY_WHO_ITSELF: case DYNAMIC_ABILITY_WHO_ITSELF:
source = ((MTGCardInstance *) _target); source = ((MTGCardInstance *) _target);
_target = _target;
break; break;
case DYNAMIC_ABILITY_WHO_TARGETCONTROLLER: case DYNAMIC_ABILITY_WHO_TARGETCONTROLLER:
_target = _target;
secondaryTarget = ((MTGCardInstance *) _target)->controller(); secondaryTarget = ((MTGCardInstance *) _target)->controller();
break; break;
case DYNAMIC_ABILITY_WHO_TARGETOPPONENT: case DYNAMIC_ABILITY_WHO_TARGETOPPONENT:
_target = _target;
secondaryTarget = ((MTGCardInstance *) _target)->controller()->opponent(); secondaryTarget = ((MTGCardInstance *) _target)->controller()->opponent();
break; break;
case DYNAMIC_ABILITY_WHO_TOSOURCE: case DYNAMIC_ABILITY_WHO_TOSOURCE:
tosrc = true; tosrc = true;
break; break;
case DYNAMIC_ABILITY_WHO_SOURCECONTROLLER: case DYNAMIC_ABILITY_WHO_SOURCECONTROLLER:
_target = _target;
secondaryTarget = ((MTGCardInstance *) OriginalSrc)->controller(); secondaryTarget = ((MTGCardInstance *) OriginalSrc)->controller();
break; break;
case DYNAMIC_ABILITY_WHO_SOURCEOPPONENT: case DYNAMIC_ABILITY_WHO_SOURCEOPPONENT:
secondaryTarget = OriginalSrc->controller()->opponent(); secondaryTarget = OriginalSrc->controller()->opponent();
break; break;
default: default:
_target = _target;
break; break;
} }
if(amountsource == DYNAMIC_MYSELF_AMOUNT) if(amountsource == DYNAMIC_MYSELF_AMOUNT)
@@ -4728,14 +4723,15 @@ void AVanishing::Update(float dt)
int AVanishing::resolve() int AVanishing::resolve()
{ {
return 1; return 1;
} }
const string AVanishing::getMenuText() const string AVanishing::getMenuText()
{ {
if(counterName.find("fade") != string::npos) if (counterName.find("fade") != string::npos)
return "Fading"; {
return "Fading";
}
return "Vanishing"; return "Vanishing";
} }
@@ -5708,7 +5704,8 @@ void ATutorialMessage::Update(float dt)
mElapsed += dt; mElapsed += dt;
IconButtonsController::Update(dt); if(!mUserCloseRequest)
IconButtonsController::Update(dt);
if (mIsImage) if (mIsImage)
return; return;
+19 -7
View File
@@ -23,6 +23,7 @@ CardDescriptor::CardDescriptor()
colorComparisonMode = COMPARISON_NONE; colorComparisonMode = COMPARISON_NONE;
CDopponentDamaged = 0; CDopponentDamaged = 0;
CDcontrollerDamaged = 0; CDcontrollerDamaged = 0;
CDdamager = 0;
} }
int CardDescriptor::init() int CardDescriptor::init()
@@ -226,16 +227,27 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
{ {
match = NULL; match = NULL;
} }
if(CDopponentDamaged == -1 || CDopponentDamaged == 1)
{ if ((CDdamager == -1 && (card->damageToOpponent || card->damageToController || card->damageToCreature))
Player * p = card->controller()->opponent();//controller()->opponent(); || (CDdamager == 1 && !(card->damageToOpponent || card->damageToController || card->damageToCreature)))
if ((CDopponentDamaged == -1 && card->damageToOpponent && card->controller() == p) || (CDopponentDamaged == 1 && !card->damageToOpponent && card->controller() == p)
|| (CDopponentDamaged == -1 && card->damageToController && card->controller() == p->opponent()) || (CDopponentDamaged == 1 && !card->damageToController && card->controller() == p->opponent()))
{ {
match = NULL; match = NULL;
} }
if ((CDcontrollerDamaged == -1 && card->damageToController && card->controller() == p) || (CDcontrollerDamaged == 1 && !card->damageToController && card->controller() == p)
|| (CDcontrollerDamaged == -1 && card->damageToOpponent && card->controller() == p->opponent()) || (CDcontrollerDamaged == 1 && !card->damageToOpponent && card->controller() == p->opponent())) if(CDopponentDamaged == -1 || CDopponentDamaged == 1)
{
Player * p = card->controller()->opponent();//controller()->opponent();
if ((CDopponentDamaged == -1 && card->damageToOpponent && card->controller() == p)
|| (CDopponentDamaged == 1 && !card->damageToOpponent && card->controller() == p)
|| (CDopponentDamaged == -1 && card->damageToController && card->controller() == p->opponent())
|| (CDopponentDamaged == 1 && !card->damageToController && card->controller() == p->opponent()))
{
match = NULL;
}
if ((CDcontrollerDamaged == -1 && card->damageToController && card->controller() == p)
|| (CDcontrollerDamaged == 1 && !card->damageToController && card->controller() == p)
|| (CDcontrollerDamaged == -1 && card->damageToOpponent && card->controller() == p->opponent())
|| (CDcontrollerDamaged == 1 && !card->damageToOpponent && card->controller() == p->opponent()))
{ {
match = NULL; match = NULL;
} }
+12
View File
@@ -1224,6 +1224,18 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
cd.CDcontrollerDamaged = 1; cd.CDcontrollerDamaged = 1;
} }
} }
//creature dealt damage to anything
else if (attribute.find("damager") != string::npos)
{
if (minus)
{
cd.CDdamager = -1;
}
else
{
cd.CDdamager = 1;
}
}
else if (attribute.find("multicolor") != string::npos) else if (attribute.find("multicolor") != string::npos)
{ {
//card is multicolored? //card is multicolored?
+59 -25
View File
@@ -4,6 +4,7 @@ const float CarouselDeckView::max_scale = 0.96f;
const float CarouselDeckView::x_center = 180; const float CarouselDeckView::x_center = 180;
const float CarouselDeckView::right_border = SCREEN_WIDTH + 180; const float CarouselDeckView::right_border = SCREEN_WIDTH + 180;
const float CarouselDeckView::slide_animation_duration = 0.6f; const float CarouselDeckView::slide_animation_duration = 0.6f;
const float CarouselDeckView::scroll_animation_duration = 0.3f;
CarouselDeckView::CarouselDeckView() : CarouselDeckView::CarouselDeckView() :
DeckView(10), mScrollOffset(0), mSlideOffset(0), mScrollEasing(mScrollOffset), mSlideEasing(mSlideOffset) DeckView(10), mScrollOffset(0), mSlideOffset(0), mScrollEasing(mScrollOffset), mSlideEasing(mSlideOffset)
@@ -21,12 +22,12 @@ void CarouselDeckView::UpdateViewState(float dt)
if(mScrollOffset <= -1.0f) if(mScrollOffset <= -1.0f)
{ {
SwitchPosition(-1); changePosition(-1);
mScrollEasing.translate(1.0f); mScrollEasing.translate(1.0f);
} }
else if(mScrollOffset >= 1.0f) else if(mScrollOffset >= 1.0f)
{ {
SwitchPosition(1); changePosition(1);
mScrollEasing.translate(-1.0f); mScrollEasing.translate(-1.0f);
} }
@@ -43,7 +44,7 @@ void CarouselDeckView::UpdateViewState(float dt)
if(mSlideOffset < -1.0f) if(mSlideOffset < -1.0f)
{ {
mSlideEasing.translate(2.0f); mSlideEasing.translate(2.0f);
SwitchFilter(1); changeFilter(1);
} }
} }
else if(mSlideOffset > mSlideEasing.start_value) else if(mSlideOffset > mSlideEasing.start_value)
@@ -52,7 +53,7 @@ void CarouselDeckView::UpdateViewState(float dt)
if(mSlideOffset > 1.0f) if(mSlideOffset > 1.0f)
{ {
mSlideEasing.translate(-2.0f); mSlideEasing.translate(-2.0f);
SwitchFilter(-1); changeFilter(-1);
} }
} }
@@ -60,8 +61,10 @@ void CarouselDeckView::UpdateViewState(float dt)
} }
} }
void CarouselDeckView::UpdateCardPosition(CardRep &rep, int index) void CarouselDeckView::UpdateCardPosition(int index)
{ {
CardRep &rep = mCards[index];
float rotation = mScrollOffset + 8 - index; float rotation = mScrollOffset + 8 - index;
rep.x = x_center + cos((rotation) * M_PI / 12) * (right_border - x_center); rep.x = x_center + cos((rotation) * M_PI / 12) * (right_border - x_center);
@@ -84,13 +87,13 @@ void CarouselDeckView::Render()
// in a different order, ie the center card should appear first, then the adjacent ones // in a different order, ie the center card should appear first, then the adjacent ones
if (WResourceManager::Instance()->IsThreaded()) if (WResourceManager::Instance()->IsThreaded())
{ {
WResourceManager::Instance()->RetrieveCard(getCardRep(0).card); WResourceManager::Instance()->RetrieveCard(mCards[0].card);
WResourceManager::Instance()->RetrieveCard(getCardRep(3).card); WResourceManager::Instance()->RetrieveCard(mCards[3].card);
WResourceManager::Instance()->RetrieveCard(getCardRep(4).card); WResourceManager::Instance()->RetrieveCard(mCards[4].card);
WResourceManager::Instance()->RetrieveCard(getCardRep(2).card); WResourceManager::Instance()->RetrieveCard(mCards[2].card);
WResourceManager::Instance()->RetrieveCard(getCardRep(5).card); WResourceManager::Instance()->RetrieveCard(mCards[5].card);
WResourceManager::Instance()->RetrieveCard(getCardRep(1).card); WResourceManager::Instance()->RetrieveCard(mCards[1].card);
WResourceManager::Instance()->RetrieveCard(getCardRep(6).card); WResourceManager::Instance()->RetrieveCard(mCards[6].card);
} }
renderCard(6); renderCard(6);
@@ -118,6 +121,31 @@ void CarouselDeckView::Render()
} }
} }
bool CarouselDeckView::ButtonPressed(Buttons button)
{
switch(button)
{
case JGE_BTN_LEFT:
changePositionAnimated(-1);
last_user_activity = 0;
break;
case JGE_BTN_RIGHT:
changePositionAnimated(1);
last_user_activity = 0;
break;
case JGE_BTN_UP:
changeFilterAnimated(1);
last_user_activity = 0;
break;
case JGE_BTN_DOWN:
changeFilterAnimated(-1);
last_user_activity = 0;
break;
default:
return false;
}
return true;
}
MTGCard * CarouselDeckView::Click(int x, int y) MTGCard * CarouselDeckView::Click(int x, int y)
{ {
int n = getCardIndexNextTo(x, y); int n = getCardIndexNextTo(x, y);
@@ -132,35 +160,41 @@ MTGCard * CarouselDeckView::Click(int x, int y)
} }
else else
{ {
changePosition(n - 2); changePositionAnimated(n - 2);
} }
} }
return NULL; return NULL;
} }
void CarouselDeckView::changePosition(int offset) MTGCard *CarouselDeckView::Click()
{ {
mScrollEasing.start((float)offset, (float)(0.3f*abs(offset))); if(mSlideEasing.finished() && mScrollEasing.finished())
{
return getActiveCard();
}
else
{
return NULL;
}
}
void CarouselDeckView::changePositionAnimated(int offset)
{
if(mScrollEasing.finished())
mScrollEasing.start((float)offset, (float)(scroll_animation_duration * abs(offset)));
last_user_activity = 0; last_user_activity = 0;
} }
void CarouselDeckView::changeFilter(int offset) void CarouselDeckView::changeFilterAnimated(int offset)
{ {
if(offset < 0) if(mSlideEasing.finished())
{ mSlideEasing.start(2.0f * float(offset), float(slide_animation_duration * abs(offset)));
mSlideEasing.start(-2.0f, slide_animation_duration);
}
else if(offset > 0)
{
mSlideEasing.start(2.0f, slide_animation_duration);
}
last_user_activity = 0; last_user_activity = 0;
} }
MTGCard *CarouselDeckView::getActiveCard() MTGCard *CarouselDeckView::getActiveCard()
{ {
return getCardRep(2).card; return mCards[2].card;
} }
+1 -1
View File
@@ -386,7 +386,7 @@ void Credits::computeTournament(GameObserver* g, GameApp * _app,bool tournament,
} }
if (mGamesWon>mGamesPlayed*0.80 && mGamesWon<mGamesPlayed) if (mGamesWon>mGamesPlayed*0.80 && mGamesWon<mGamesPlayed)
{ {
CreditBonus * b = NEW CreditBonus(250, _("Won more then 80 percentage of games")); CreditBonus * b = NEW CreditBonus(250, _("Won more than 80 percentage of games"));
bonus.push_back(b); bonus.push_back(b);
} }
+3 -1
View File
@@ -192,8 +192,10 @@ int Damage::resolve()
//return the left over amount after effects have been applied to them. //return the left over amount after effects have been applied to them.
a = target->dealDamage(damage); a = target->dealDamage(damage);
target->damageCount += damage;//the amount must be the actual damage so i changed this from 1 to damage, this fixes pdcount and odcount target->damageCount += damage;//the amount must be the actual damage so i changed this from 1 to damage, this fixes pdcount and odcount
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE) if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE){
((MTGCardInstance*)target)->wasDealtDamage = true; ((MTGCardInstance*)target)->wasDealtDamage = true;
((MTGCardInstance*)source)->damageToCreature = true;
}
if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER) if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
{ {
if(target == source->controller()) if(target == source->controller())
+5 -36
View File
@@ -35,38 +35,12 @@ void DeckView::Update(float dt)
{ {
for(unsigned int i = 0; i < mCards.size(); ++i) for(unsigned int i = 0; i < mCards.size(); ++i)
{ {
UpdateCardPosition(mCards[i], i); UpdateCardPosition(i);
} }
dirtyCardPos = false; dirtyCardPos = false;
} }
} }
bool DeckView::ButtonPressed(Buttons button)
{
switch(button)
{
case JGE_BTN_LEFT:
changePosition(-1);
last_user_activity = 0;
break;
case JGE_BTN_RIGHT:
changePosition(1);
last_user_activity = 0;
break;
case JGE_BTN_UP:
changeFilter(1);
last_user_activity = 0;
break;
case JGE_BTN_DOWN:
changeFilter(-1);
last_user_activity = 0;
break;
default:
return false;
}
return true;
}
void DeckView::SetDeck(DeckDataWrapper *toShow) void DeckView::SetDeck(DeckDataWrapper *toShow)
{ {
mCurrentDeck = toShow; mCurrentDeck = toShow;
@@ -80,14 +54,14 @@ DeckDataWrapper* DeckView::deck()
return mCurrentDeck; return mCurrentDeck;
} }
void DeckView::SwitchFilter(int delta) void DeckView::changeFilter(int delta)
{ {
unsigned int FilterCount = Constants::NB_Colors + 1; unsigned int FilterCount = Constants::NB_Colors + 1;
mFilter = (FilterCount + mFilter + delta) % FilterCount; mFilter = (FilterCount + mFilter + delta) % FilterCount;
dirtyFilters = true; dirtyFilters = true;
} }
void DeckView::SwitchPosition(int delta) void DeckView::changePosition(int delta)
{ {
for(int i = 0; i < delta; ++i) for(int i = 0; i < delta; ++i)
{ {
@@ -118,16 +92,11 @@ void DeckView::reloadIndexes()
} }
} }
DeckView::CardRep& DeckView::getCardRep(unsigned int index)
{
return mCards[index];
}
void DeckView::renderCard(int index, int alpha, bool asThumbnail) void DeckView::renderCard(int index, int alpha, bool asThumbnail)
{ {
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT); WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
const CardRep& cardPosition = getCardRep(index); const CardRep& cardPosition = mCards[index];
if (!cardPosition.card) return; if (!cardPosition.card) return;
@@ -213,7 +182,7 @@ int DeckView::getCardIndexNextTo(int x, int y)
for(unsigned int i = 0; i < mCards.size(); i++) for(unsigned int i = 0; i < mCards.size(); i++)
{ {
const CardRep& cardPosition = getCardRep(i); const CardRep& cardPosition = mCards[i];
float dx = (x - cardPosition.x); float dx = (x - cardPosition.x);
float dy = (y - cardPosition.y); float dy = (y - cardPosition.y);
-3
View File
@@ -1,3 +0,0 @@
#include "../include/Effects.h"
int Effect::id_counter = 0;
+38
View File
@@ -151,6 +151,44 @@ int LifeCost::doPay()
return 1; return 1;
} }
//Specific life cost
SpecificLifeCost * SpecificLifeCost::clone() const
{
SpecificLifeCost * ec = NEW SpecificLifeCost(*this);
if (tc)
ec->tc = tc->clone();
return ec;
}
SpecificLifeCost::SpecificLifeCost(TargetChooser *_tc, int slc)
: ExtraCost("Life", _tc), slc(slc)
{
}
int SpecificLifeCost::canPay()
{
MTGCardInstance * _target = (MTGCardInstance *) target;
if(_target->controller()->life >= slc)
{
return 1;
}
return 0;
}
int SpecificLifeCost::doPay()
{
if (!target)
return 0;
MTGCardInstance * _target = (MTGCardInstance *) target;
_target->controller()->loseLife(slc);
target = NULL;
if (tc)
tc->initTargets();
return 1;
}
//life or Mana cost //life or Mana cost
LifeorManaCost * LifeorManaCost::clone() const LifeorManaCost * LifeorManaCost::clone() const
{ {
+1
View File
@@ -795,6 +795,7 @@ void GameObserver::gameStateBasedEffects()
c->wasDealtDamage = false; c->wasDealtDamage = false;
c->damageToController = false; c->damageToController = false;
c->damageToOpponent = false; c->damageToOpponent = false;
c->damageToCreature = false;
c->isAttacking = NULL; c->isAttacking = NULL;
} }
for (int t = 0; t < nbcards; t++) for (int t = 0; t < nbcards; t++)
+28 -17
View File
@@ -407,9 +407,8 @@ void GameStateDeckViewer::Update(float dt)
case JGE_BTN_RIGHT: case JGE_BTN_RIGHT:
case JGE_BTN_UP: case JGE_BTN_UP:
case JGE_BTN_DOWN: case JGE_BTN_DOWN:
if(last_user_activity > 0.2) if(mView->ButtonPressed(button))
{ {
mView->ButtonPressed(button);
last_user_activity = 0; last_user_activity = 0;
mStage = STAGE_WAITING; mStage = STAGE_WAITING;
} }
@@ -443,19 +442,21 @@ void GameStateDeckViewer::Update(float dt)
int x, y; int x, y;
if (mEngine->GetLeftClickCoordinates(x, y)) if (mEngine->GetLeftClickCoordinates(x, y))
{ {
last_user_activity = 0;
mEngine->LeftClickedProcessed(); mEngine->LeftClickedProcessed();
if(mView->Click(x, y) == mView->getActiveCard()) if(mView->Click(x, y) != NULL)
{ {
addRemove(mView->getActiveCard()); addRemove(mView->getActiveCard());
} }
} }
else else
{ {
last_user_activity = 0; if(mView->Click() != NULL)
addRemove(mView->getActiveCard()); {
addRemove(mView->getActiveCard());
}
} }
last_user_activity = 0;
mStage = STAGE_WAITING; mStage = STAGE_WAITING;
break; break;
} }
@@ -468,17 +469,20 @@ void GameStateDeckViewer::Update(float dt)
buildEditorMenu(); buildEditorMenu();
break; break;
case JGE_BTN_CTRL: case JGE_BTN_CTRL:
mStage = STAGE_FILTERS; if(!mView->ButtonPressed(JGE_BTN_CTRL))
if (!filterMenu)
{ {
filterMenu = NEW WGuiFilters("Filter by...", NULL); mStage = STAGE_FILTERS;
if (source) if (!filterMenu)
SAFE_DELETE(source); {
source = NEW WSrcDeckViewer(myDeck, myCollection); filterMenu = NEW WGuiFilters("Filter by...", NULL);
filterMenu->setSrc(source); if (source)
if (mView->deck() != myDeck) source->swapSrc(); SAFE_DELETE(source);
source = NEW WSrcDeckViewer(myDeck, myCollection);
filterMenu->setSrc(source);
if (mView->deck() != myDeck) source->swapSrc();
}
filterMenu->Entering(JGE_BTN_NONE);
} }
filterMenu->Entering(JGE_BTN_NONE);
break; break;
case JGE_BTN_PREV: case JGE_BTN_PREV:
if (last_user_activity < NO_USER_ACTIVITY_HELP_DELAY) if (last_user_activity < NO_USER_ACTIVITY_HELP_DELAY)
@@ -1527,11 +1531,18 @@ void GameStateDeckViewer::OnScroll(int inXVelocity, int inYVelocity)
{ {
//FIXME: this 500 is a bit arbitrary //FIXME: this 500 is a bit arbitrary
int numCards = (magnitude / 500) % 8; int numCards = (magnitude / 500) % 8;
mView->changePosition(flickRight ? numCards : - numCards); mView->changePositionAnimated(flickRight ? numCards : - numCards);
} }
} }
else else
mView->changeFilter(flickUp ? 1 : -1); {
if(abs(inYVelocity) > 300)
{
//FIXME: this 500 is a bit arbitrary
int numFilters = (magnitude / 500);
mView->changeFilterAnimated(flickUp ? numFilters : - numFilters);
}
}
last_user_activity = 0; last_user_activity = 0;
} }
+1 -1
View File
@@ -796,7 +796,7 @@ void GameStateDuel::Update(float dt)
if (game->didWin()) if (game->didWin())
{ {
//the following section will be called only in a classic or demo gamemode and if a tournament or match with more then one game is activ //the following section will be called only in a classic or demo gamemode and if a tournament or match with more than one game is activ
if ( (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)&& mParent->players[1] == PLAYER_TYPE_CPU && (tournament->isTournament() || tournament->getGamesToPlay()>1 )) if ( (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)&& mParent->players[1] == PLAYER_TYPE_CPU && (tournament->isTournament() || tournament->getGamesToPlay()>1 ))
{ {
setGamePhase(DUEL_STATE_SHOW_SCORE); setGamePhase(DUEL_STATE_SHOW_SCORE);
+17 -12
View File
@@ -215,34 +215,39 @@ void GameStateOptions::Render()
const char * const CreditsText[] = { const char * const CreditsText[] = {
"Wagic, The Homebrew?! by Wololo", "Wagic, The Homebrew?! by Wololo",
"", "",
"updates, new cards, and more on http://wololo.net/wagic", "Updates, new cards, and more on http://wololo.net/wagic",
"Many thanks to the people who help this project", "Many thanks to the people who help this project",
"", "",
"", "",
"Art: Ilya B, Julio, Jeck, J, Kaioshin, Lakeesha", "Art:",
"Ilya B, Julio, Jeck, J, Kaioshin, Lakeesha",
"Check themeinfo.txt for the full credits of each theme!", "Check themeinfo.txt for the full credits of each theme!",
"", "",
"Dev Team:", "Dev Team:",
"Abrasax, Almosthumane, Daddy32, DJardin, Dr.Solomat,", "Abrasax, Almosthumane, Daddy32, DJardin, Dr.Solomat, J, Jeck,",
"J, Jeck, kevlahnota, Leungclj, linshier, Mootpoint, Mnguyen,", "kevlahnota, Leungclj, linshier, Mootpoint, Mnguyen, Psyringe,",
"Psyringe, Salmelo, Superhiro, Wololo, Yeshua, Zethfox", "Rolzad73, Salmelo, Superhiro, Wololo, Yeshua, Zethfox",
"", "",
"Music by Celestial Aeon Project, http://www.jamendo.com", "Music by Celestial Aeon Project, http://www.jamendo.com",
"", "",
"Deck Builders: Abrasax, AzureKnight, colarchon", "Deck Builders:",
"Excessum, Hehotfarv, Jeremy, Jog1118, JonyAS", "Abrasax, AzureKnight, colarchon, Excessum, Hehotfarv,",
"Lachaux, Link17, Muddobbers, Nakano, Niegen", "Jeremy, Jog1118, JonyAS, Lachaux, Link17, Muddobbers,",
"Kaioshin, Psyringe, r1c47, Superhiro, Szei", "Nakano, Niegen, Kaioshin, Psyringe, r1c47, Superhiro,",
"Thanatos02, Whismer, Wololo", "Szei, Thanatos02, Whismer, Wololo",
"", "",
"Thanks also go to Dr.Watson, Orine, Raphael, Sakya, Tyranid", "Thanks also go to Dr.Watson, Orine, Raphael, Sakya, Tyranid",
"for their help.", "for their help.",
"", "",
"Thanks to everyone who contributes code/content on the forums!", "Thanks to everyone who contributes code/content on the forums!",
"", "",
"Developed with the JGE++ Library (http://code.google.com/p/wagic)", "",
"Source:",
"http://code.google.com/p/wagic (2009-2013)",
"https://github.com/WagicProject/wagic (2013- )",
"",
"Developed with the JGE++ Library",
"SFX From www.soundsnap.com", "SFX From www.soundsnap.com",
"", "",
"", "",
"This work is not related to or endorsed by Wizards of the Coast, Inc", "This work is not related to or endorsed by Wizards of the Coast, Inc",
+2 -6
View File
@@ -102,7 +102,6 @@ void GameStateShop::Start()
bListCards = false; bListCards = false;
mTouched = false; mTouched = false;
mStage = STAGE_FADE_IN; mStage = STAGE_FADE_IN;
mElapsed = 0;
needLoad = true; needLoad = true;
booster = NULL; booster = NULL;
srcCards = NEW WSrcUnlockedCards(0); srcCards = NEW WSrcUnlockedCards(0);
@@ -427,7 +426,7 @@ void GameStateShop::End()
{ {
save(); save();
JRenderer::GetInstance()->EnableVSync(false); JRenderer::GetInstance()->EnableVSync(false);
mElapsed = 0;
SAFE_DELETE(shopMenu); SAFE_DELETE(shopMenu);
SAFE_DELETE(bigDisplay); SAFE_DELETE(bigDisplay);
SAFE_DELETE(srcCards); SAFE_DELETE(srcCards);
@@ -469,9 +468,6 @@ void GameStateShop::Update(float dt)
if (lightAlpha > 50) if (lightAlpha > 50)
lightAlpha = 50; lightAlpha = 50;
if (mStage != STAGE_FADE_IN)
mElapsed += dt;
JButton btn; JButton btn;
switch (mStage) switch (mStage)
{ {
@@ -496,7 +492,7 @@ void GameStateShop::Update(float dt)
} }
break; break;
case STAGE_SHOP_TASKS: case STAGE_SHOP_TASKS:
if (menu) if (menu && !menu->isClosed())
{ {
menu->Update(dt); menu->Update(dt);
return; return;
+109 -24
View File
@@ -7,7 +7,8 @@ const float GridDeckView::card_scale_big = 0.7f;
GridDeckView::GridDeckView() GridDeckView::GridDeckView()
: DeckView(16), mCols(8), mRows(2), mScrollOffset(0), mSlideOffset(0), : DeckView(16), mCols(8), mRows(2), mScrollOffset(0), mSlideOffset(0),
mScrollEasing(mScrollOffset), mSlideEasing(mSlideOffset), mCurrentSelection(-1) mScrollEasing(mScrollOffset), mSlideEasing(mSlideOffset), mCurrentSelection(-1),
mButtonMode(false)
{ {
} }
@@ -23,6 +24,7 @@ void GridDeckView::Reset()
mScrollEasing.finish(); mScrollEasing.finish();
mCurrentSelection = 0; mCurrentSelection = 0;
mButtonMode = false;
DeckView::Reset(); DeckView::Reset();
} }
@@ -35,15 +37,15 @@ void GridDeckView::UpdateViewState(float dt)
if(mScrollOffset <= -1.0f) if(mScrollOffset <= -1.0f)
{ {
SwitchPosition(2); changePosition(2);
moveSelection(-2, false);
mScrollEasing.translate(1.0f); mScrollEasing.translate(1.0f);
mCurrentSelection = (mCurrentSelection >= 6) ? mCurrentSelection - 2 : -1;
} }
else if(mScrollOffset >= 1.0f) else if(mScrollOffset >= 1.0f)
{ {
SwitchPosition(-2); changePosition(-2);
moveSelection(2, false);
mScrollEasing.translate(-1.0f); mScrollEasing.translate(-1.0f);
mCurrentSelection = (mCurrentSelection >= 0 && mCurrentSelection < 10) ? mCurrentSelection + 2 : -1;
} }
dirtyCardPos = true; dirtyCardPos = true;
@@ -56,20 +58,22 @@ void GridDeckView::UpdateViewState(float dt)
if(mSlideOffset < -1.0f) if(mSlideOffset < -1.0f)
{ {
mSlideEasing.translate(2.0f); mSlideEasing.translate(2.0f);
SwitchFilter(1); changeFilter(1);
} }
else if(mSlideOffset > 1.0f) else if(mSlideOffset > 1.0f)
{ {
mSlideEasing.translate(-2.0f); mSlideEasing.translate(-2.0f);
SwitchFilter(-1); changeFilter(-1);
} }
dirtyCardPos = true; dirtyCardPos = true;
} }
} }
void GridDeckView::UpdateCardPosition(CardRep &rep, int index) void GridDeckView::UpdateCardPosition(int index)
{ {
CardRep &rep = mCards[index];
int col = index / mRows; int col = index / mRows;
int row = index % mRows; int row = index % mRows;
float colWidth = SCREEN_WIDTH_F / (mCols - 3); float colWidth = SCREEN_WIDTH_F / (mCols - 3);
@@ -119,7 +123,7 @@ void GridDeckView::Render()
{ {
if (WResourceManager::Instance()->IsThreaded()) if (WResourceManager::Instance()->IsThreaded())
{ {
WResourceManager::Instance()->RetrieveCard(getCardRep(i).card, RETRIEVE_THUMB); WResourceManager::Instance()->RetrieveCard(mCards[i].card, RETRIEVE_THUMB);
} }
renderCard(i, 255, true); renderCard(i, 255, true);
} }
@@ -127,7 +131,7 @@ void GridDeckView::Render()
{ {
if (WResourceManager::Instance()->IsThreaded()) if (WResourceManager::Instance()->IsThreaded())
{ {
WResourceManager::Instance()->RetrieveCard(getCardRep(i).card); WResourceManager::Instance()->RetrieveCard(mCards[i].card);
} }
} }
} }
@@ -138,10 +142,50 @@ void GridDeckView::Render()
} }
} }
bool GridDeckView::ButtonPressed(Buttons button)
{
switch(button)
{
case JGE_BTN_LEFT:
if(mButtonMode && mScrollEasing.finished()) moveSelection(-2, true);
else if(!mButtonMode) changePositionAnimated(-1);
last_user_activity = 0;
break;
case JGE_BTN_RIGHT:
if(mButtonMode && mScrollEasing.finished()) moveSelection(2, true);
else if(!mButtonMode) changePositionAnimated(1);
last_user_activity = 0;
break;
case JGE_BTN_UP:
if(mButtonMode && mScrollEasing.finished()) moveSelection(-1, true);
else if(!mButtonMode) changeFilterAnimated(1);
last_user_activity = 0;
break;
case JGE_BTN_DOWN:
if(mButtonMode && mScrollEasing.finished()) moveSelection(1, true);
else if(!mButtonMode) changeFilterAnimated(-1);
last_user_activity = 0;
break;
case JGE_BTN_CTRL:
if(mButtonMode)
{
mButtonMode = false;
dirtyCardPos = true;
mCurrentSelection = -1;
}
else return false;
break;
default:
return false;
}
return true;
}
MTGCard * GridDeckView::Click(int x, int y) MTGCard * GridDeckView::Click(int x, int y)
{ {
int n = getCardIndexNextTo(x, y); int n = getCardIndexNextTo(x, y);
last_user_activity = 0; last_user_activity = 0;
mButtonMode = false;
if(mScrollEasing.finished() && mSlideEasing.finished()) if(mScrollEasing.finished() && mSlideEasing.finished())
{ //clicked and no animations running { //clicked and no animations running
@@ -151,11 +195,11 @@ MTGCard * GridDeckView::Click(int x, int y)
} }
else if(n < 4) else if(n < 4)
{ {
changePosition(-1); changePositionAnimated(-1);
} }
else if(n >= 12) else if(n >= 12)
{ {
changePosition(1); changePositionAnimated(1);
} }
else else
{ {
@@ -167,28 +211,43 @@ MTGCard * GridDeckView::Click(int x, int y)
return NULL; return NULL;
} }
void GridDeckView::changePosition(int offset) MTGCard * GridDeckView::Click()
{ {
mScrollEasing.start(-1.0f * offset, scroll_animation_duration * abs(offset)); if(mScrollEasing.finished() && mSlideEasing.finished())
{
MTGCard *active = getActiveCard();
if(active != NULL)
{
return active;
}
else
{
mButtonMode = true;
dirtyCardPos = true;
mCurrentSelection = 4;
}
}
return NULL;
}
void GridDeckView::changePositionAnimated(int offset)
{
if(mScrollEasing.finished())
mScrollEasing.start(-1.0f * offset, scroll_animation_duration * abs(offset));
last_user_activity = 0; last_user_activity = 0;
} }
void GridDeckView::changeFilter(int offset) void GridDeckView::changeFilterAnimated(int offset)
{ {
if(offset < 0) if(mSlideEasing.finished())
{ mSlideEasing.start(2.0f * offset, float(slide_animation_duration * abs(offset)));
mSlideEasing.start(-2.0f, slide_animation_duration);
}
else if(offset > 0)
{
mSlideEasing.start(2.0f, slide_animation_duration);
}
last_user_activity = 0; last_user_activity = 0;
} }
MTGCard* GridDeckView::getActiveCard() MTGCard* GridDeckView::getActiveCard()
{ {
if(mCurrentSelection >= 0 && mCurrentSelection < int(mCards.size())) if(mCurrentSelection >= 4 && mCurrentSelection < int(mCards.size())-4)
{ {
return mCards[mCurrentSelection].card; return mCards[mCurrentSelection].card;
} }
@@ -197,3 +256,29 @@ MTGCard* GridDeckView::getActiveCard()
return NULL; return NULL;
} }
} }
void GridDeckView::moveSelection(int offset, bool alignIfOutOfBounds)
{
mCurrentSelection += offset;
if(alignIfOutOfBounds)
{
if(mCurrentSelection < 4)
{
changePositionAnimated(-1);
}
else if(mCurrentSelection >= 12)
{
changePositionAnimated(1);
}
}
else
{
if(mCurrentSelection < 4 || mCurrentSelection >= 12)
{
mCurrentSelection = -1;
}
}
dirtyCardPos = true;
}
+52 -57
View File
@@ -24,26 +24,28 @@
}; };
*/ */
const float GuiPhaseBar::zoom_big = (float)(1.5 * 1.4);
const float GuiPhaseBar::zoom_small = 1.5;
const float GuiPhaseBar::step = M_PI/6.0f;
namespace namespace
{ {
//width and height of the phase symbol textures
const float kWidth = 28; const float kWidth = 28;
const float kHeight = kWidth; const float kHeight = kWidth;
const unsigned kPhases = 12; const unsigned kPhases = NB_MTG_PHASES - 2; //there are two phases we do not show
}
const float ICONSCALE = 1.5; void GuiPhaseBar::DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale)
const float CENTER = SCREEN_HEIGHT_F / 2 + 10; {
inQuad->SetTextureRect(phaseId * (kWidth + 1), 0, kWidth, kHeight);
void DrawGlyph(JQuad* inQuad, int inGlyph, float inY, float, unsigned int inP, float inScale) JRenderer::GetInstance()->RenderQuad(inQuad, x, y - scale * kWidth/2, 0.0f, scale, scale);
{
float xPos = static_cast<float> ((inP + inGlyph * (int) (kWidth + 1)) % (kPhases * (int) (kWidth + 1)));
inQuad->SetTextureRect(xPos, 0, kWidth, kHeight);
JRenderer::GetInstance()->RenderQuad(inQuad, 0, inY, 0.0, inScale, inScale);
}
} }
GuiPhaseBar::GuiPhaseBar(DuelLayers* duelLayers) : GuiPhaseBar::GuiPhaseBar(DuelLayers* duelLayers) :
GuiLayer(duelLayers->getObserver()), PlayGuiObject(0, 0, 106, 0, false), GuiLayer(duelLayers->getObserver()), PlayGuiObject(80, 0, 106, 0, false),
phase(NULL), angle(0.0f), zoomFactor(ICONSCALE), mpDuelLayers(duelLayers) displayedPhaseId(0), angle(0.0f), zoomFactor(zoom_small), angleEasing(angle),
zoomFactorEasing(zoomFactor), mpDuelLayers(duelLayers)
{ {
if(duelLayers->getObserver()->getResourceManager()) if(duelLayers->getObserver()->getResourceManager())
{ {
@@ -57,10 +59,7 @@ GuiPhaseBar::GuiPhaseBar(DuelLayers* duelLayers) :
GameApp::systemError = "Error loading phasebar texture : " __FILE__; GameApp::systemError = "Error loading phasebar texture : " __FILE__;
} }
zoom = ICONSCALE;
mpDuelLayers->getCardSelector()->Add(this); mpDuelLayers->getCardSelector()->Add(this);
} }
GuiPhaseBar::~GuiPhaseBar() GuiPhaseBar::~GuiPhaseBar()
@@ -69,32 +68,27 @@ GuiPhaseBar::~GuiPhaseBar()
void GuiPhaseBar::Update(float dt) void GuiPhaseBar::Update(float dt)
{ {
if (angle > 3 * dt) angleEasing.update(dt);
angle -= 3 * dt;
else
angle = 0;
if (dt > 0.05f) dt = 0.05f; if(angle <= -step)
if(zoomFactor + 0.05f < zoom)
{ {
zoomFactor += dt; displayedPhaseId = (displayedPhaseId + 1) % kPhases;
} angleEasing.translate(step);
else if (zoomFactor - 0.05f > zoom)
{
zoomFactor -= dt;
} }
zoomFactorEasing.update(dt);
} }
void GuiPhaseBar::Entering() void GuiPhaseBar::Entering()
{ {
mHasFocus = true; mHasFocus = true;
zoom = 1.4f*ICONSCALE; zoomFactorEasing.start(zoom_big, 0.3f);
} }
bool GuiPhaseBar::Leaving(JButton) bool GuiPhaseBar::Leaving(JButton)
{ {
mHasFocus = false; mHasFocus = false;
zoom = ICONSCALE; zoomFactorEasing.start(zoom_small, 0.6f);
return true; return true;
} }
@@ -102,41 +96,28 @@ void GuiPhaseBar::Render()
{ {
JQuadPtr quad = WResourceManager::Instance()->GetQuad("phasebar"); JQuadPtr quad = WResourceManager::Instance()->GetQuad("phasebar");
//uncomment to draw a hideous line across hires screens. //uncomment to draw a hideous line across hires screens.
// JRenderer::GetInstance()->DrawLine(0, CENTER, SCREEN_WIDTH, CENTER, ARGB(255, 255, 255, 255)); // JRenderer::GetInstance()->DrawLine(0, CENTER, SCREEN_WIDTH, CENTER, ARGB(255, 255, 255, 255));
unsigned int p = (phase->id + kPhases - 4) * (int) (kWidth + 1); const float radius = 25 * zoomFactor;
float centerYPosition = CENTER + (kWidth / 2) * angle * zoomFactor / (M_PI / 6) - zoomFactor * kWidth / 4;
float yPos = centerYPosition;
float scale = 0;
for (int glyph = 3; glyph < 6; ++glyph)
{
scale = zoomFactor * sinf(angle + glyph * M_PI / 6) / 2;
DrawGlyph(quad.get(), glyph, yPos, angle, p, scale);
yPos += kWidth * scale;
}
yPos = centerYPosition; for(int i = 0; i < 6; ++i)
for (int glyph = 2; glyph > 0; --glyph)
{ {
scale = zoomFactor * sinf(angle + glyph * M_PI / 6) / 2; //the position of the glyphe in the circle
yPos -= kWidth * scale; const float circPos = (i - 2) * step + angle;
DrawGlyph(quad.get(), glyph, yPos, angle, p, scale); const float glyphY = this->y + this->mHeight / 2 + sin(circPos) * radius;
}
if (angle > 0) //the scale is computed so that the glyphes touch each other
{ //hint: sin(circPos + PI/2) = cos(circPos)
scale = zoomFactor * sinf(angle) / 2; const float glyphScale = float(zoomFactor * cosf(circPos) * 0.5f);
yPos -= kWidth * scale;
float xPos = static_cast<float> (p % (kPhases * (int) (kWidth + 1))); DrawGlyph(quad.get(), (displayedPhaseId - 2 + i + kPhases) % kPhases, 0, glyphY, glyphScale);
quad->SetTextureRect(xPos, kHeight, kWidth, kHeight);
JRenderer::GetInstance()->RenderQuad(quad.get(), 0, yPos, 0.0, scale, scale);
} }
//print phase name //print phase name
WFont * font = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT); WFont * font = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
string currentP = _("your turn"); string currentP = _("your turn");
string interrupt = ""; string interrupt = "";
if (observer->currentPlayer == mpDuelLayers->getRenderedPlayerOpponent()) if (observer->currentPlayer == mpDuelLayers->getRenderedPlayerOpponent())
{ {
currentP = _("opponent's turn"); currentP = _("opponent's turn");
} }
@@ -147,7 +128,7 @@ void GuiPhaseBar::Render()
} }
if (observer->currentlyActing() != observer->currentPlayer) if (observer->currentlyActing() != observer->currentPlayer)
{ {
if (observer->currentPlayer == mpDuelLayers->getRenderedPlayer()) if (observer->currentPlayer == mpDuelLayers->getRenderedPlayer())
{ {
interrupt = _(" - ") + _("opponent plays"); interrupt = _(" - ") + _("opponent plays");
} }
@@ -159,7 +140,9 @@ void GuiPhaseBar::Render()
char buf[200]; char buf[200];
//running this string through translate returns gibberish even though we defined the variables in the lang.txt //running this string through translate returns gibberish even though we defined the variables in the lang.txt
string phaseNameToTranslate = observer->phaseRing->phaseName(phase->id); //the conversion from phase bar phases to mtg phases is x%kPhases + 1
//todo: just to this when the displayedPhaseId updates
string phaseNameToTranslate = observer->phaseRing->phaseName(displayedPhaseId%kPhases + 1);
phaseNameToTranslate = _(phaseNameToTranslate); phaseNameToTranslate = _(phaseNameToTranslate);
sprintf(buf, _("(%s%s) %s").c_str(), currentP.c_str(), interrupt.c_str(),phaseNameToTranslate.c_str()); sprintf(buf, _("(%s%s) %s").c_str(), currentP.c_str(), interrupt.c_str(),phaseNameToTranslate.c_str());
font->DrawString(buf, SCREEN_WIDTH - 5, 2, JGETEXT_RIGHT); font->DrawString(buf, SCREEN_WIDTH - 5, 2, JGETEXT_RIGHT);
@@ -170,8 +153,20 @@ int GuiPhaseBar::receiveEventMinus(WEvent *e)
WEventPhaseChange *event = dynamic_cast<WEventPhaseChange*> (e); WEventPhaseChange *event = dynamic_cast<WEventPhaseChange*> (e);
if (event) if (event)
{ {
angle = M_PI / 6; //convert the mtg phase to the phases of the phase wheel
phase = event->to; //the mapping is
//0 -> none
//1..12 -> 0..11
//13 -> none
int targetPhase = event->to->id;
if(targetPhase != 0 && targetPhase != 13)
{
targetPhase -= 1;
int phasesToAnimate = (targetPhase - displayedPhaseId + kPhases) % kPhases;
angleEasing.start(float(phasesToAnimate * (- step)), 0.3f * float(sqrt(float(phasesToAnimate))));
}
} }
return 1; return 1;
} }
+1 -1
View File
@@ -103,7 +103,7 @@ inline float GuiPlay::VertStack::nextX()
} }
GuiPlay::BattleField::BattleField() : GuiPlay::BattleField::BattleField() :
attackers(0), blockers(0), height(0.0), red(0), colorFlow(0) attackers(0), height(0.0), red(0), colorFlow(0)
{ {
} }
const float GuiPlay::BattleField::HEIGHT = 80.0f; const float GuiPlay::BattleField::HEIGHT = 80.0f;
+1 -2
View File
@@ -4276,8 +4276,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell)
if (card->hasType(Subtypes::TYPE_INSTANT) || card->hasType(Subtypes::TYPE_SORCERY)) if (card->hasType(Subtypes::TYPE_INSTANT) || card->hasType(Subtypes::TYPE_SORCERY))
{ {
MTGPlayerCards * zones = card->owner->game; MTGPlayerCards * zones = card->owner->game;
if(card->getCurrentZone())
card->currentZone->owner->game;//grab it from where ever it is.
MTGPlayerCards * Endzones = card->owner->game;//put them in thier owners respective zones as per rules. MTGPlayerCards * Endzones = card->owner->game;//put them in thier owners respective zones as per rules.
if (card->basicAbilities[(int)Constants::EXILEDEATH]) if (card->basicAbilities[(int)Constants::EXILEDEATH])
{ {
@@ -4286,6 +4284,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell)
} }
else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_BUYBACK] > 0) else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_BUYBACK] > 0)
{ {
card->alternateCostPaid[ManaCost::MANA_PAID_WITH_BUYBACK] = 0;
zones->putInZone(card, zones->stack, Endzones->hand); zones->putInZone(card, zones->stack, Endzones->hand);
} }
else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_FLASHBACK] > 0) else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_FLASHBACK] > 0)
+1
View File
@@ -158,6 +158,7 @@ void MTGCardInstance::initMTGCI()
auras = 0; auras = 0;
damageToOpponent = false; damageToOpponent = false;
damageToController = false; damageToController = false;
damageToCreature = false;
wasDealtDamage = false; wasDealtDamage = false;
isDualWielding = false; isDualWielding = false;
suspended = false; suspended = false;
+1 -1
View File
@@ -146,7 +146,7 @@ int MTGEventBonus::receiveEvent(WEvent * event)
} }
//////bonus for having a LOT of specific type. //////bonus for having a LOT of specific type.
//not else'd becuase it is possible for a card to contain //not else'd becuase it is possible for a card to contain
//more then one of the types, and for more then one to trigger. //more than one of the types, and for more than one to trigger.
if(e->card->hasType(Subtypes::TYPE_ARTIFACT)) if(e->card->hasType(Subtypes::TYPE_ARTIFACT))
toys[currentPlayer->getId()]++; toys[currentPlayer->getId()]++;
if(e->card->isCreature()) if(e->card->isCreature())
+10 -1
View File
@@ -159,10 +159,19 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
{ //Mill to exile yourself as a cost (Library 2 Exile) { //Mill to exile yourself as a cost (Library 2 Exile)
manaCost->addExtraCost(NEW MillExileCost(tc)); manaCost->addExtraCost(NEW MillExileCost(tc));
} }
else else if (value == "l")
{ //Life cost { //Life cost
manaCost->addExtraCost(NEW LifeCost(tc)); manaCost->addExtraCost(NEW LifeCost(tc));
} }
else
{ //Specific Life cost
vector<string>valSplit = parseBetween(value,"l:"," ",false);
if (valSplit.size()) {
WParsedInt* lifetopay = NEW WParsedInt(valSplit[1], NULL, c);
manaCost->addExtraCost(NEW SpecificLifeCost(tc,lifetopay->getValue()));
SAFE_DELETE(lifetopay);
}
}
break; break;
case 'd': //DiscardRandom cost case 'd': //DiscardRandom cost
if (value == "d") if (value == "d")
-4
View File
@@ -38,13 +38,9 @@ void PlayGuiObject::Update(float dt)
if (mHeight < defaultHeight) mHeight = defaultHeight; if (mHeight < defaultHeight) mHeight = defaultHeight;
} }
wave = (wave + 2 * (int) (100 * dt)) % 255; wave = (wave + 2 * (int) (100 * dt)) % 255;
for (vector<Effect*>::iterator it = effects.begin(); it != effects.end(); ++it)
(*it)->Update(dt);
Pos::Update(dt); Pos::Update(dt);
} }
void PlayGuiObject::Render() void PlayGuiObject::Render()
{ {
for (vector<Effect*>::iterator it = effects.begin(); it != effects.end(); ++it)
(*it)->Render();
} }
+1 -1
View File
@@ -15,7 +15,7 @@
#include <iomanip> #include <iomanip>
SimplePopup::SimplePopup(int id, JGuiListener* listener, const int fontId, const char * _title, DeckMetaData* deckMetaData, MTGAllCards * collection, float cancelX, float cancelY) : SimplePopup::SimplePopup(int id, JGuiListener* listener, const int fontId, const char * _title, DeckMetaData* deckMetaData, MTGAllCards * collection, float cancelX, float cancelY) :
JGuiController(JGE::GetInstance(), id, listener), mFontId(fontId), mCollection(collection) JGuiController(JGE::GetInstance(), id, listener), mCollection(collection)
{ {
mX = 19; mX = 19;
mY = 66; mY = 66;
+12
View File
@@ -485,6 +485,18 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
cd->CDcontrollerDamaged = 1; cd->CDcontrollerDamaged = 1;
} }
} }
//creature dealt damage to anything
else if (attribute.find("damager") != string::npos)
{
if (minus)
{
cd->CDdamager = -1;
}
else
{
cd->CDdamager = 1;
}
}
else if (attribute.find("multicolor") != string::npos) else if (attribute.find("multicolor") != string::npos)
{ {
//card is multicolored? //card is multicolored?
+18 -14
View File
@@ -258,9 +258,10 @@ Task* Task::createFromStr(const string params, bool rand)
/*---------------- TaskList -----------------*/ /*---------------- TaskList -----------------*/
TaskList::TaskList(string _fileName) TaskList::TaskList(string _fileName):
fileName(_fileName), vPos(-SCREEN_HEIGHT), vPosInEasing(vPos), vPosOutEasing(vPos)
{ {
fileName = _fileName;
if (fileName == "") if (fileName == "")
{ {
fileName = options.profileFile(PLAYER_TASKS).c_str(); fileName = options.profileFile(PLAYER_TASKS).c_str();
@@ -378,9 +379,10 @@ void TaskList::removeTask(Task *task)
void TaskList::Start() void TaskList::Start()
{ {
vPos = -SCREEN_HEIGHT; //Offscreen
mElapsed = 0;
mState = TASKS_IN; mState = TASKS_IN;
vPos = -SCREEN_HEIGHT; //Offscreen
vPosInEasing.start(0.0f, 1.0f);
if (!mBgTex) if (!mBgTex)
{ {
mBgTex = WResourceManager::Instance()->RetrieveTexture("taskboard.png", RETRIEVE_LOCK); mBgTex = WResourceManager::Instance()->RetrieveTexture("taskboard.png", RETRIEVE_LOCK);
@@ -410,7 +412,7 @@ void TaskList::Start()
void TaskList::End() void TaskList::End()
{ {
mState = TASKS_OUT; mState = TASKS_OUT;
mElapsed = 0; vPosOutEasing.start(float(-SCREEN_HEIGHT), 0.9f);
} }
void TaskList::passOneDay() void TaskList::passOneDay()
@@ -451,21 +453,23 @@ int TaskList::getTaskCount()
void TaskList::Update(float dt) void TaskList::Update(float dt)
{ {
mElapsed += dt; if(!vPosInEasing.finished())
if (mState == TASKS_IN && vPos < 0)
{ {
vPos = -SCREEN_HEIGHT + (SCREEN_HEIGHT * mElapsed / 0.75f); //Todo: more physical drop-in. vPosInEasing.update(dt);
if (vPos >= 0)
if(vPosInEasing.finished())
{ {
vPos = 0;
mState = TaskList::TASKS_ACTIVE; mState = TaskList::TASKS_ACTIVE;
} }
} }
else if (mState == TASKS_OUT && vPos > -SCREEN_HEIGHT) else if(!vPosOutEasing.finished())
{ {
vPos = -(SCREEN_HEIGHT * mElapsed / 0.75f); vPosOutEasing.update(dt);
if (vPos <= -SCREEN_HEIGHT) mState = TASKS_INACTIVE;
if(vPosOutEasing.finished())
{
mState = TASKS_INACTIVE;
}
} }
} }
+1 -2
View File
@@ -493,7 +493,6 @@
<ClInclude Include="include\DeckView.h" /> <ClInclude Include="include\DeckView.h" />
<ClInclude Include="include\DuelLayers.h" /> <ClInclude Include="include\DuelLayers.h" />
<ClInclude Include="include\Easing.h" /> <ClInclude Include="include\Easing.h" />
<ClInclude Include="include\Effects.h" />
<ClInclude Include="include\ExtraCost.h" /> <ClInclude Include="include\ExtraCost.h" />
<ClInclude Include="include\GameApp.h" /> <ClInclude Include="include\GameApp.h" />
<ClInclude Include="include\GameObserver.h" /> <ClInclude Include="include\GameObserver.h" />
@@ -592,4 +591,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>
+1 -4
View File
@@ -417,9 +417,6 @@
<ClInclude Include="include\DuelLayers.h"> <ClInclude Include="include\DuelLayers.h">
<Filter>inc</Filter> <Filter>inc</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="include\Effects.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="include\ExtraCost.h"> <ClInclude Include="include\ExtraCost.h">
<Filter>inc</Filter> <Filter>inc</Filter>
</ClInclude> </ClInclude>
@@ -725,4 +722,4 @@
<Filter>res</Filter> <Filter>res</Filter>
</ResourceCompile> </ResourceCompile>
</ItemGroup> </ItemGroup>
</Project> </Project>
+4 -2
View File
@@ -5,7 +5,7 @@ addExclusiveBuilds(graphics, Graphics, console, Console)
INCLUDEPATH += ../../JGE/include/qt INCLUDEPATH += ../../JGE/include/qt
CONFIG(console, graphics|console){ CONFIG(console, graphics|console){
QT += core network QT += core network multimedia
QT -= gui QT -= gui
DEFINES += CONSOLE_CONFIG DEFINES += CONSOLE_CONFIG
@@ -17,7 +17,7 @@ else:CONFIG(graphics, graphics|console){
folder_01.source = qml/QmlWagic folder_01.source = qml/QmlWagic
folder_01.target = /usr/share folder_01.target = /usr/share
DEPLOYMENTFOLDERS = folder_01 DEPLOYMENTFOLDERS = folder_01
QT += core gui opengl network QT += core gui opengl network multimedia
QT -= declarative quick qml QT -= declarative quick qml
#maemo5:DEFINES += QT_WIDGET #maemo5:DEFINES += QT_WIDGET
DEFINES += QT_WIDGET DEFINES += QT_WIDGET
@@ -46,6 +46,7 @@ CONFIG(graphics, graphics|console){
../../JGE/src/qt/corewrapper.cpp\ ../../JGE/src/qt/corewrapper.cpp\
../../JGE/src/Qtmain.cpp\ ../../JGE/src/Qtmain.cpp\
../../JGE/src/JMD2Model.cpp\ ../../JGE/src/JMD2Model.cpp\
../../JGE/src/pc/JSfx.cpp\
../../JGE/src/pc/JGfx.cpp ../../JGE/src/pc/JGfx.cpp
} }
else:CONFIG(console, graphics|console){ else:CONFIG(console, graphics|console){
@@ -54,6 +55,7 @@ else:CONFIG(console, graphics|console){
SOURCES += \ SOURCES += \
../../JGE/src/OutputCapturer.cpp\ ../../JGE/src/OutputCapturer.cpp\
../../JGE/src/pc/JSfx.cpp\
../../JGE/src/JGfx-fake.cpp\ ../../JGE/src/JGfx-fake.cpp\
../../JGE/src/Qtconsole.cpp\ ../../JGE/src/Qtconsole.cpp\
} }
+11 -10
View File
@@ -4,13 +4,14 @@ TEMPLATE = app
#!macx:CONFIG += precompile_header #!macx:CONFIG += precompile_header
unix|macx:QMAKE_CXXFLAGS += -Wno-unused-parameter unix|macx:QMAKE_CXXFLAGS += -Wno-unused-parameter
unix:!macx:QMAKE_CXXFLAGS += -Wno-unused-but-set-parameter unix:!*macx*:QMAKE_CXXFLAGS += -Wno-unused-but-set-parameter
unix:!macx:QMAKE_CXXFLAGS += -Wno-unused-but-set-variable unix:!*macx*:QMAKE_CXXFLAGS += -Wno-unused-but-set-variable
unix|macx:QMAKE_CXXFLAGS += -Wno-unused-value unix|*macx*:QMAKE_CXXFLAGS += -Wno-unused-value
unix:!macx:QMAKE_CXXFLAGS += -Wno-unused-local-typedefs unix:!*macx*:QMAKE_CXXFLAGS += -Wno-unused-local-typedefs
unix:!macx:!maemo5:!symbian:QMAKE_CXXFLAGS += -Werror unix:!*macx*:!maemo5:!symbian:QMAKE_CXXFLAGS += -Werror
windows:DEFINES += _CRT_SECURE_NO_WARNINGS windows:DEFINES += _CRT_SECURE_NO_WARNINGS
windows|winrt:DEFINES += NOMINMAX
unix|macx:DEFINES += LINUX unix|macx:DEFINES += LINUX
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
DEFINES += _DEBUG DEFINES += _DEBUG
@@ -27,10 +28,12 @@ windows{
# INCLUDEPATH += /usr/i686-w64-mingw32/sys-root/mingw/include/c++ # INCLUDEPATH += /usr/i686-w64-mingw32/sys-root/mingw/include/c++
LIBS += -L/usr/i686-w64-mingw32/sys-root/mingw/lib LIBS += -L/usr/i686-w64-mingw32/sys-root/mingw/lib
LIBS += -lwsock32 LIBS += -lwsock32
DEFINES += FORCE_GL2
} }
*-msvc* { *-msvc* {
INCLUDEPATH += extra INCLUDEPATH += extra
DEFINES += WIN32 DEFINES += WIN32
DEFINES += FORCE_GL2
} }
} }
macx:INCLUDEPATH += /opt/include macx:INCLUDEPATH += /opt/include
@@ -40,8 +43,7 @@ INCLUDEPATH += ../../Boost
INCLUDEPATH += include INCLUDEPATH += include
unix:!symbian:LIBS += -lz unix:!symbian:LIBS += -lz
win32:LIBS += ../../JGE/Dependencies/lib/fmodvc.lib windows:LIBS += ../../JGE/Dependencies/lib/zlibd.lib
win32:LIBS += ../../JGE/Dependencies/lib/zlibd.lib
PRECOMPILED_HEADER = include/PrecompiledHeader.h PRECOMPILED_HEADER = include/PrecompiledHeader.h
#DEFINES += TRACK_OBJECT_USAGE #DEFINES += TRACK_OBJECT_USAGE
@@ -79,7 +81,6 @@ SOURCES += \
src/DeckStats.cpp\ src/DeckStats.cpp\
src/DeckView.cpp\ src/DeckView.cpp\
src/DuelLayers.cpp\ src/DuelLayers.cpp\
src/Effects.cpp\
src/ExtraCost.cpp\ src/ExtraCost.cpp\
src/GameApp.cpp\ src/GameApp.cpp\
src/GameLauncher.cpp\ src/GameLauncher.cpp\
@@ -270,7 +271,6 @@ HEADERS += \
include/WResourceManager.h\ include/WResourceManager.h\
include/DuelLayers.h\ include/DuelLayers.h\
include/GuiStatic.h\ include/GuiStatic.h\
include/Effects.h\
include/StyleManager.h\ include/StyleManager.h\
include/WFont.h\ include/WFont.h\
include/DeckManager.h\ include/DeckManager.h\
@@ -282,6 +282,7 @@ HEADERS += \
# JGE, could probably be moved outside # JGE, could probably be moved outside
SOURCES += \ SOURCES += \
../../JGE/src/Downloader.cpp\
../../JGE/src/Encoding.cpp\ ../../JGE/src/Encoding.cpp\
../../JGE/src/JAnimator.cpp\ ../../JGE/src/JAnimator.cpp\
../../JGE/src/JApp.cpp\ ../../JGE/src/JApp.cpp\
@@ -301,7 +302,6 @@ SOURCES += \
../../JGE/src/JSpline.cpp\ ../../JGE/src/JSpline.cpp\
../../JGE/src/JNetwork.cpp\ ../../JGE/src/JNetwork.cpp\
../../JGE/src/pc/JSocket.cpp\ ../../JGE/src/pc/JSocket.cpp\
../../JGE/src/pc/JSfx.cpp\
../../JGE/src/JSprite.cpp\ ../../JGE/src/JSprite.cpp\
../../JGE/src/Vector2D.cpp\ ../../JGE/src/Vector2D.cpp\
../../JGE/src/tinyxml/tinystr.cpp\ ../../JGE/src/tinyxml/tinystr.cpp\
@@ -319,6 +319,7 @@ SOURCES += \
../../JGE/src/zipFS/zstream.cpp ../../JGE/src/zipFS/zstream.cpp
HEADERS += \ HEADERS += \
../../JGE/include/Downloader.h\
../../JGE/include/Threading.h\ ../../JGE/include/Threading.h\
../../JGE/include/decoder_prx.h\ ../../JGE/include/decoder_prx.h\
../../JGE/include/DebugRoutines.h\ ../../JGE/include/DebugRoutines.h\
+32 -48
View File
@@ -67,7 +67,6 @@
12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; }; 12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; };
12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; }; 12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; };
12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F61291C60500B9016A /* CardDisplay.cpp */; }; 12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F61291C60500B9016A /* CardDisplay.cpp */; };
12059DAB14980B7300DAC43B /* CardEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F71291C60500B9016A /* CardEffect.cpp */; };
12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F81291C60500B9016A /* CardGui.cpp */; }; 12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F81291C60500B9016A /* CardGui.cpp */; };
12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; }; 12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; };
12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; }; 12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; };
@@ -85,7 +84,6 @@
12059DBA14980B7300DAC43B /* DeckMetaData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377061291C60500B9016A /* DeckMetaData.cpp */; }; 12059DBA14980B7300DAC43B /* DeckMetaData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377061291C60500B9016A /* DeckMetaData.cpp */; };
12059DBB14980B7300DAC43B /* DeckStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377071291C60500B9016A /* DeckStats.cpp */; }; 12059DBB14980B7300DAC43B /* DeckStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377071291C60500B9016A /* DeckStats.cpp */; };
12059DBC14980B7300DAC43B /* DuelLayers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377081291C60500B9016A /* DuelLayers.cpp */; }; 12059DBC14980B7300DAC43B /* DuelLayers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377081291C60500B9016A /* DuelLayers.cpp */; };
12059DBD14980B7300DAC43B /* Effects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377091291C60500B9016A /* Effects.cpp */; };
12059DBE14980B7300DAC43B /* ExtraCost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770A1291C60500B9016A /* ExtraCost.cpp */; }; 12059DBE14980B7300DAC43B /* ExtraCost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770A1291C60500B9016A /* ExtraCost.cpp */; };
12059DBF14980B7300DAC43B /* GameApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770B1291C60500B9016A /* GameApp.cpp */; }; 12059DBF14980B7300DAC43B /* GameApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770B1291C60500B9016A /* GameApp.cpp */; };
12059DC014980B7300DAC43B /* GameLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770C1291C60500B9016A /* GameLauncher.cpp */; }; 12059DC014980B7300DAC43B /* GameLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770C1291C60500B9016A /* GameLauncher.cpp */; };
@@ -198,7 +196,6 @@
12059E4A14980B7300DAC43B /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 12D095E014417D0500F69056 /* libstdc++.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 12059E4A14980B7300DAC43B /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 12D095E014417D0500F69056 /* libstdc++.dylib */; settings = {ATTRIBUTES = (Weak, ); }; };
12059E4B14980B7300DAC43B /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 12211EBA14934A2C00641703 /* CFNetwork.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 12059E4B14980B7300DAC43B /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 12211EBA14934A2C00641703 /* CFNetwork.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
12059E4C14980B7300DAC43B /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 12211EB814934A1800641703 /* MobileCoreServices.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 12059E4C14980B7300DAC43B /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 12211EB814934A1800641703 /* MobileCoreServices.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
12059E4D14980B7300DAC43B /* libGoogleAdMobAds.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED379148BAE7B00C58E83 /* libGoogleAdMobAds.a */; settings = {ATTRIBUTES = (Weak, ); }; };
12059E4E14980B7300DAC43B /* libc++abi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1216D632148F7411000F2295 /* libc++abi.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 12059E4E14980B7300DAC43B /* libc++abi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1216D632148F7411000F2295 /* libc++abi.dylib */; settings = {ATTRIBUTES = (Weak, ); }; };
12059E4F14980B7300DAC43B /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED50F148BCC1900C58E83 /* libsqlite3.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 12059E4F14980B7300DAC43B /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED50F148BCC1900C58E83 /* libsqlite3.dylib */; settings = {ATTRIBUTES = (Weak, ); }; };
12059E5014980B7300DAC43B /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 129654D0148A52730031100B /* iAd.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 12059E5014980B7300DAC43B /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 129654D0148A52730031100B /* iAd.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
@@ -217,7 +214,6 @@
12059E5D14980B7300DAC43B /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED50B148BCBBC00C58E83 /* MapKit.framework */; }; 12059E5D14980B7300DAC43B /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED50B148BCBBC00C58E83 /* MapKit.framework */; };
12059E5E14980B7300DAC43B /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED518148BF0E000C58E83 /* MediaPlayer.framework */; }; 12059E5E14980B7300DAC43B /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED518148BF0E000C58E83 /* MediaPlayer.framework */; };
1216D633148F7411000F2295 /* libc++abi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1216D632148F7411000F2295 /* libc++abi.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 1216D633148F7411000F2295 /* libc++abi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1216D632148F7411000F2295 /* libc++abi.dylib */; settings = {ATTRIBUTES = (Weak, ); }; };
1216D634148F747D000F2295 /* libGoogleAdMobAds.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED379148BAE7B00C58E83 /* libGoogleAdMobAds.a */; settings = {ATTRIBUTES = (Weak, ); }; };
12211E7914931CBB00641703 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2814931CBB00641703 /* ASIAuthenticationDialog.m */; }; 12211E7914931CBB00641703 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2814931CBB00641703 /* ASIAuthenticationDialog.m */; };
12211E7A14931CBB00641703 /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2B14931CBB00641703 /* ASIDataCompressor.m */; }; 12211E7A14931CBB00641703 /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2B14931CBB00641703 /* ASIDataCompressor.m */; };
12211E7B14931CBB00641703 /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2D14931CBB00641703 /* ASIDataDecompressor.m */; }; 12211E7B14931CBB00641703 /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2D14931CBB00641703 /* ASIDataDecompressor.m */; };
@@ -285,6 +281,9 @@
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; }; 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; };
28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; }; 28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; };
751E1F1518FAE53E001B1E16 /* CarouselDeckView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 751E1F1218FAE53E001B1E16 /* CarouselDeckView.cpp */; };
751E1F1618FAE53E001B1E16 /* DeckView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 751E1F1318FAE53E001B1E16 /* DeckView.cpp */; };
751E1F1718FAE53E001B1E16 /* GridDeckView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 751E1F1418FAE53E001B1E16 /* GridDeckView.cpp */; };
75D209D3181D54FD009916AC /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D1181D54FD009916AC /* Default-568h@2x.png */; }; 75D209D3181D54FD009916AC /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D1181D54FD009916AC /* Default-568h@2x.png */; };
75D209D4181D54FD009916AC /* wagic-80x80.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D2181D54FD009916AC /* wagic-80x80.png */; }; 75D209D4181D54FD009916AC /* wagic-80x80.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D2181D54FD009916AC /* wagic-80x80.png */; };
CE97CD1E1295AB4300FDFD3B /* SimplePopup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE97CD1D1295AB4300FDFD3B /* SimplePopup.cpp */; }; CE97CD1E1295AB4300FDFD3B /* SimplePopup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE97CD1D1295AB4300FDFD3B /* SimplePopup.cpp */; };
@@ -307,7 +306,6 @@
CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; }; CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; };
CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; }; CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; };
CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F61291C60500B9016A /* CardDisplay.cpp */; }; CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F61291C60500B9016A /* CardDisplay.cpp */; };
CEA377611291C60500B9016A /* CardEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F71291C60500B9016A /* CardEffect.cpp */; };
CEA377621291C60500B9016A /* CardGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F81291C60500B9016A /* CardGui.cpp */; }; CEA377621291C60500B9016A /* CardGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F81291C60500B9016A /* CardGui.cpp */; };
CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; }; CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; };
CEA377641291C60500B9016A /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; }; CEA377641291C60500B9016A /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; };
@@ -325,7 +323,6 @@
CEA377701291C60500B9016A /* DeckMetaData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377061291C60500B9016A /* DeckMetaData.cpp */; }; CEA377701291C60500B9016A /* DeckMetaData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377061291C60500B9016A /* DeckMetaData.cpp */; };
CEA377711291C60500B9016A /* DeckStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377071291C60500B9016A /* DeckStats.cpp */; }; CEA377711291C60500B9016A /* DeckStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377071291C60500B9016A /* DeckStats.cpp */; };
CEA377721291C60500B9016A /* DuelLayers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377081291C60500B9016A /* DuelLayers.cpp */; }; CEA377721291C60500B9016A /* DuelLayers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377081291C60500B9016A /* DuelLayers.cpp */; };
CEA377731291C60500B9016A /* Effects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377091291C60500B9016A /* Effects.cpp */; };
CEA377741291C60500B9016A /* ExtraCost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770A1291C60500B9016A /* ExtraCost.cpp */; }; CEA377741291C60500B9016A /* ExtraCost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770A1291C60500B9016A /* ExtraCost.cpp */; };
CEA377751291C60500B9016A /* GameApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770B1291C60500B9016A /* GameApp.cpp */; }; CEA377751291C60500B9016A /* GameApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770B1291C60500B9016A /* GameApp.cpp */; };
CEA377761291C60500B9016A /* GameLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770C1291C60500B9016A /* GameLauncher.cpp */; }; CEA377761291C60500B9016A /* GameLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770C1291C60500B9016A /* GameLauncher.cpp */; };
@@ -578,6 +575,13 @@
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
751E1F0E18FAE52D001B1E16 /* CarouselDeckView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CarouselDeckView.h; sourceTree = "<group>"; };
751E1F0F18FAE52D001B1E16 /* DeckView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeckView.h; sourceTree = "<group>"; };
751E1F1018FAE52D001B1E16 /* Easing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Easing.h; sourceTree = "<group>"; };
751E1F1118FAE52D001B1E16 /* GridDeckView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GridDeckView.h; sourceTree = "<group>"; };
751E1F1218FAE53E001B1E16 /* CarouselDeckView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CarouselDeckView.cpp; sourceTree = "<group>"; };
751E1F1318FAE53E001B1E16 /* DeckView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeckView.cpp; sourceTree = "<group>"; };
751E1F1418FAE53E001B1E16 /* GridDeckView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GridDeckView.cpp; sourceTree = "<group>"; };
75D209D1181D54FD009916AC /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = SOURCE_ROOT; }; 75D209D1181D54FD009916AC /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = SOURCE_ROOT; };
75D209D2181D54FD009916AC /* wagic-80x80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "wagic-80x80.png"; sourceTree = SOURCE_ROOT; }; 75D209D2181D54FD009916AC /* wagic-80x80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "wagic-80x80.png"; sourceTree = SOURCE_ROOT; };
8D1107310486CEB800E47090 /* wagic-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "wagic-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; }; 8D1107310486CEB800E47090 /* wagic-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "wagic-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
@@ -609,7 +613,6 @@
CEA3768C1291C60500B9016A /* AllAbilities.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = AllAbilities.h; sourceTree = "<group>"; }; CEA3768C1291C60500B9016A /* AllAbilities.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = AllAbilities.h; sourceTree = "<group>"; };
CEA3768D1291C60500B9016A /* CardDescriptor.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDescriptor.h; sourceTree = "<group>"; }; CEA3768D1291C60500B9016A /* CardDescriptor.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDescriptor.h; sourceTree = "<group>"; };
CEA3768E1291C60500B9016A /* CardDisplay.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDisplay.h; sourceTree = "<group>"; }; CEA3768E1291C60500B9016A /* CardDisplay.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDisplay.h; sourceTree = "<group>"; };
CEA3768F1291C60500B9016A /* CardEffect.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardEffect.h; sourceTree = "<group>"; };
CEA376901291C60500B9016A /* CardGui.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardGui.h; sourceTree = "<group>"; }; CEA376901291C60500B9016A /* CardGui.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardGui.h; sourceTree = "<group>"; };
CEA376911291C60500B9016A /* CardPrimitive.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardPrimitive.h; sourceTree = "<group>"; }; CEA376911291C60500B9016A /* CardPrimitive.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardPrimitive.h; sourceTree = "<group>"; };
CEA376921291C60500B9016A /* CardSelector.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardSelector.h; sourceTree = "<group>"; }; CEA376921291C60500B9016A /* CardSelector.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardSelector.h; sourceTree = "<group>"; };
@@ -627,7 +630,6 @@
CEA3769E1291C60500B9016A /* DeckMetaData.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DeckMetaData.h; sourceTree = "<group>"; }; CEA3769E1291C60500B9016A /* DeckMetaData.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DeckMetaData.h; sourceTree = "<group>"; };
CEA3769F1291C60500B9016A /* DeckStats.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DeckStats.h; sourceTree = "<group>"; }; CEA3769F1291C60500B9016A /* DeckStats.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DeckStats.h; sourceTree = "<group>"; };
CEA376A01291C60500B9016A /* DuelLayers.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DuelLayers.h; sourceTree = "<group>"; }; CEA376A01291C60500B9016A /* DuelLayers.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DuelLayers.h; sourceTree = "<group>"; };
CEA376A11291C60500B9016A /* Effects.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = Effects.h; sourceTree = "<group>"; };
CEA376A21291C60500B9016A /* ExtraCost.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = ExtraCost.h; sourceTree = "<group>"; }; CEA376A21291C60500B9016A /* ExtraCost.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = ExtraCost.h; sourceTree = "<group>"; };
CEA376A31291C60500B9016A /* GameApp.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = GameApp.h; sourceTree = "<group>"; }; CEA376A31291C60500B9016A /* GameApp.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = GameApp.h; sourceTree = "<group>"; };
CEA376A41291C60500B9016A /* GameObserver.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = GameObserver.h; sourceTree = "<group>"; }; CEA376A41291C60500B9016A /* GameObserver.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = GameObserver.h; sourceTree = "<group>"; };
@@ -711,7 +713,6 @@
CEA376F41291C60500B9016A /* AllAbilities.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = AllAbilities.cpp; sourceTree = "<group>"; }; CEA376F41291C60500B9016A /* AllAbilities.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = AllAbilities.cpp; sourceTree = "<group>"; };
CEA376F51291C60500B9016A /* CardDescriptor.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDescriptor.cpp; sourceTree = "<group>"; }; CEA376F51291C60500B9016A /* CardDescriptor.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDescriptor.cpp; sourceTree = "<group>"; };
CEA376F61291C60500B9016A /* CardDisplay.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDisplay.cpp; sourceTree = "<group>"; }; CEA376F61291C60500B9016A /* CardDisplay.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDisplay.cpp; sourceTree = "<group>"; };
CEA376F71291C60500B9016A /* CardEffect.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardEffect.cpp; sourceTree = "<group>"; };
CEA376F81291C60500B9016A /* CardGui.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardGui.cpp; sourceTree = "<group>"; }; CEA376F81291C60500B9016A /* CardGui.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardGui.cpp; sourceTree = "<group>"; };
CEA376F91291C60500B9016A /* CardPrimitive.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardPrimitive.cpp; sourceTree = "<group>"; }; CEA376F91291C60500B9016A /* CardPrimitive.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardPrimitive.cpp; sourceTree = "<group>"; };
CEA376FA1291C60500B9016A /* CardSelector.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardSelector.cpp; sourceTree = "<group>"; }; CEA376FA1291C60500B9016A /* CardSelector.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardSelector.cpp; sourceTree = "<group>"; };
@@ -729,7 +730,6 @@
CEA377061291C60500B9016A /* DeckMetaData.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DeckMetaData.cpp; sourceTree = "<group>"; }; CEA377061291C60500B9016A /* DeckMetaData.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DeckMetaData.cpp; sourceTree = "<group>"; };
CEA377071291C60500B9016A /* DeckStats.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DeckStats.cpp; sourceTree = "<group>"; }; CEA377071291C60500B9016A /* DeckStats.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DeckStats.cpp; sourceTree = "<group>"; };
CEA377081291C60500B9016A /* DuelLayers.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DuelLayers.cpp; sourceTree = "<group>"; }; CEA377081291C60500B9016A /* DuelLayers.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DuelLayers.cpp; sourceTree = "<group>"; };
CEA377091291C60500B9016A /* Effects.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = Effects.cpp; sourceTree = "<group>"; };
CEA3770A1291C60500B9016A /* ExtraCost.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = ExtraCost.cpp; sourceTree = "<group>"; }; CEA3770A1291C60500B9016A /* ExtraCost.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = ExtraCost.cpp; sourceTree = "<group>"; };
CEA3770B1291C60500B9016A /* GameApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = GameApp.cpp; sourceTree = "<group>"; }; CEA3770B1291C60500B9016A /* GameApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = GameApp.cpp; sourceTree = "<group>"; };
CEA3770C1291C60500B9016A /* GameLauncher.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = GameLauncher.cpp; sourceTree = "<group>"; }; CEA3770C1291C60500B9016A /* GameLauncher.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = GameLauncher.cpp; sourceTree = "<group>"; };
@@ -890,7 +890,6 @@
12059E4A14980B7300DAC43B /* libstdc++.dylib in Frameworks */, 12059E4A14980B7300DAC43B /* libstdc++.dylib in Frameworks */,
12059E4B14980B7300DAC43B /* CFNetwork.framework in Frameworks */, 12059E4B14980B7300DAC43B /* CFNetwork.framework in Frameworks */,
12059E4C14980B7300DAC43B /* MobileCoreServices.framework in Frameworks */, 12059E4C14980B7300DAC43B /* MobileCoreServices.framework in Frameworks */,
12059E4D14980B7300DAC43B /* libGoogleAdMobAds.a in Frameworks */,
12059E4E14980B7300DAC43B /* libc++abi.dylib in Frameworks */, 12059E4E14980B7300DAC43B /* libc++abi.dylib in Frameworks */,
12059E4F14980B7300DAC43B /* libsqlite3.dylib in Frameworks */, 12059E4F14980B7300DAC43B /* libsqlite3.dylib in Frameworks */,
12059E5014980B7300DAC43B /* iAd.framework in Frameworks */, 12059E5014980B7300DAC43B /* iAd.framework in Frameworks */,
@@ -922,7 +921,6 @@
12D095E114417D0500F69056 /* libstdc++.dylib in Frameworks */, 12D095E114417D0500F69056 /* libstdc++.dylib in Frameworks */,
12211EBB14934A2C00641703 /* CFNetwork.framework in Frameworks */, 12211EBB14934A2C00641703 /* CFNetwork.framework in Frameworks */,
12211EB914934A1900641703 /* MobileCoreServices.framework in Frameworks */, 12211EB914934A1900641703 /* MobileCoreServices.framework in Frameworks */,
1216D634148F747D000F2295 /* libGoogleAdMobAds.a in Frameworks */,
1216D633148F7411000F2295 /* libc++abi.dylib in Frameworks */, 1216D633148F7411000F2295 /* libc++abi.dylib in Frameworks */,
128ED510148BCC1900C58E83 /* libsqlite3.dylib in Frameworks */, 128ED510148BCC1900C58E83 /* libsqlite3.dylib in Frameworks */,
129654D1148A52740031100B /* iAd.framework in Frameworks */, 129654D1148A52740031100B /* iAd.framework in Frameworks */,
@@ -1284,6 +1282,10 @@
CEA376851291C60500B9016A /* include */ = { CEA376851291C60500B9016A /* include */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
751E1F0E18FAE52D001B1E16 /* CarouselDeckView.h */,
751E1F0F18FAE52D001B1E16 /* DeckView.h */,
751E1F1018FAE52D001B1E16 /* Easing.h */,
751E1F1118FAE52D001B1E16 /* GridDeckView.h */,
12272FC114CD558C00192DC7 /* SimpleButton.h */, 12272FC114CD558C00192DC7 /* SimpleButton.h */,
12CCA032144A05DF00E343A0 /* AbilityParser.h */, 12CCA032144A05DF00E343A0 /* AbilityParser.h */,
127694891441274D0088F6D3 /* AIPlayerBaka.h */, 127694891441274D0088F6D3 /* AIPlayerBaka.h */,
@@ -1306,7 +1308,6 @@
CEA3768C1291C60500B9016A /* AllAbilities.h */, CEA3768C1291C60500B9016A /* AllAbilities.h */,
CEA3768D1291C60500B9016A /* CardDescriptor.h */, CEA3768D1291C60500B9016A /* CardDescriptor.h */,
CEA3768E1291C60500B9016A /* CardDisplay.h */, CEA3768E1291C60500B9016A /* CardDisplay.h */,
CEA3768F1291C60500B9016A /* CardEffect.h */,
CEA376901291C60500B9016A /* CardGui.h */, CEA376901291C60500B9016A /* CardGui.h */,
CEA376911291C60500B9016A /* CardPrimitive.h */, CEA376911291C60500B9016A /* CardPrimitive.h */,
CEA376921291C60500B9016A /* CardSelector.h */, CEA376921291C60500B9016A /* CardSelector.h */,
@@ -1324,7 +1325,6 @@
CEA3769E1291C60500B9016A /* DeckMetaData.h */, CEA3769E1291C60500B9016A /* DeckMetaData.h */,
CEA3769F1291C60500B9016A /* DeckStats.h */, CEA3769F1291C60500B9016A /* DeckStats.h */,
CEA376A01291C60500B9016A /* DuelLayers.h */, CEA376A01291C60500B9016A /* DuelLayers.h */,
CEA376A11291C60500B9016A /* Effects.h */,
CEA376A21291C60500B9016A /* ExtraCost.h */, CEA376A21291C60500B9016A /* ExtraCost.h */,
CEA376A31291C60500B9016A /* GameApp.h */, CEA376A31291C60500B9016A /* GameApp.h */,
CEA376A41291C60500B9016A /* GameObserver.h */, CEA376A41291C60500B9016A /* GameObserver.h */,
@@ -1408,6 +1408,9 @@
CEA376ED1291C60500B9016A /* src */ = { CEA376ED1291C60500B9016A /* src */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
751E1F1218FAE53E001B1E16 /* CarouselDeckView.cpp */,
751E1F1318FAE53E001B1E16 /* DeckView.cpp */,
751E1F1418FAE53E001B1E16 /* GridDeckView.cpp */,
12CCA02F144A05D100E343A0 /* AbilityParser.cpp */, 12CCA02F144A05D100E343A0 /* AbilityParser.cpp */,
12769483144127380088F6D3 /* AIPlayerBaka.cpp */, 12769483144127380088F6D3 /* AIPlayerBaka.cpp */,
12769484144127380088F6D3 /* AIPlayerBakaB.cpp */, 12769484144127380088F6D3 /* AIPlayerBakaB.cpp */,
@@ -1427,7 +1430,6 @@
CEA376F41291C60500B9016A /* AllAbilities.cpp */, CEA376F41291C60500B9016A /* AllAbilities.cpp */,
CEA376F51291C60500B9016A /* CardDescriptor.cpp */, CEA376F51291C60500B9016A /* CardDescriptor.cpp */,
CEA376F61291C60500B9016A /* CardDisplay.cpp */, CEA376F61291C60500B9016A /* CardDisplay.cpp */,
CEA376F71291C60500B9016A /* CardEffect.cpp */,
CEA376F81291C60500B9016A /* CardGui.cpp */, CEA376F81291C60500B9016A /* CardGui.cpp */,
CEA376F91291C60500B9016A /* CardPrimitive.cpp */, CEA376F91291C60500B9016A /* CardPrimitive.cpp */,
CEA376FA1291C60500B9016A /* CardSelector.cpp */, CEA376FA1291C60500B9016A /* CardSelector.cpp */,
@@ -1445,7 +1447,6 @@
CEA377061291C60500B9016A /* DeckMetaData.cpp */, CEA377061291C60500B9016A /* DeckMetaData.cpp */,
CEA377071291C60500B9016A /* DeckStats.cpp */, CEA377071291C60500B9016A /* DeckStats.cpp */,
CEA377081291C60500B9016A /* DuelLayers.cpp */, CEA377081291C60500B9016A /* DuelLayers.cpp */,
CEA377091291C60500B9016A /* Effects.cpp */,
CEA3770A1291C60500B9016A /* ExtraCost.cpp */, CEA3770A1291C60500B9016A /* ExtraCost.cpp */,
CEA3770B1291C60500B9016A /* GameApp.cpp */, CEA3770B1291C60500B9016A /* GameApp.cpp */,
CEA3770C1291C60500B9016A /* GameLauncher.cpp */, CEA3770C1291C60500B9016A /* GameLauncher.cpp */,
@@ -1703,7 +1704,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = { 29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 0430; LastUpgradeCheck = 0510;
}; };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "wagic" */; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "wagic" */;
compatibilityVersion = "Xcode 3.2"; compatibilityVersion = "Xcode 3.2";
@@ -1827,7 +1828,6 @@
12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */, 12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */,
12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */, 12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */,
12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */, 12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */,
12059DAB14980B7300DAC43B /* CardEffect.cpp in Sources */,
12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */, 12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */,
12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */, 12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */,
12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */, 12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */,
@@ -1845,7 +1845,6 @@
12059DBA14980B7300DAC43B /* DeckMetaData.cpp in Sources */, 12059DBA14980B7300DAC43B /* DeckMetaData.cpp in Sources */,
12059DBB14980B7300DAC43B /* DeckStats.cpp in Sources */, 12059DBB14980B7300DAC43B /* DeckStats.cpp in Sources */,
12059DBC14980B7300DAC43B /* DuelLayers.cpp in Sources */, 12059DBC14980B7300DAC43B /* DuelLayers.cpp in Sources */,
12059DBD14980B7300DAC43B /* Effects.cpp in Sources */,
12059DBE14980B7300DAC43B /* ExtraCost.cpp in Sources */, 12059DBE14980B7300DAC43B /* ExtraCost.cpp in Sources */,
12059DBF14980B7300DAC43B /* GameApp.cpp in Sources */, 12059DBF14980B7300DAC43B /* GameApp.cpp in Sources */,
12059DC014980B7300DAC43B /* GameLauncher.cpp in Sources */, 12059DC014980B7300DAC43B /* GameLauncher.cpp in Sources */,
@@ -2009,7 +2008,6 @@
CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */, CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */,
CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */, CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */,
CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */, CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */,
CEA377611291C60500B9016A /* CardEffect.cpp in Sources */,
CEA377621291C60500B9016A /* CardGui.cpp in Sources */, CEA377621291C60500B9016A /* CardGui.cpp in Sources */,
CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */, CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */,
CEA377641291C60500B9016A /* CardSelector.cpp in Sources */, CEA377641291C60500B9016A /* CardSelector.cpp in Sources */,
@@ -2027,7 +2025,6 @@
CEA377701291C60500B9016A /* DeckMetaData.cpp in Sources */, CEA377701291C60500B9016A /* DeckMetaData.cpp in Sources */,
CEA377711291C60500B9016A /* DeckStats.cpp in Sources */, CEA377711291C60500B9016A /* DeckStats.cpp in Sources */,
CEA377721291C60500B9016A /* DuelLayers.cpp in Sources */, CEA377721291C60500B9016A /* DuelLayers.cpp in Sources */,
CEA377731291C60500B9016A /* Effects.cpp in Sources */,
CEA377741291C60500B9016A /* ExtraCost.cpp in Sources */, CEA377741291C60500B9016A /* ExtraCost.cpp in Sources */,
CEA377751291C60500B9016A /* GameApp.cpp in Sources */, CEA377751291C60500B9016A /* GameApp.cpp in Sources */,
CEA377761291C60500B9016A /* GameLauncher.cpp in Sources */, CEA377761291C60500B9016A /* GameLauncher.cpp in Sources */,
@@ -2057,6 +2054,7 @@
CEA3778F1291C60500B9016A /* ManaCostHybrid.cpp in Sources */, CEA3778F1291C60500B9016A /* ManaCostHybrid.cpp in Sources */,
CEA377901291C60500B9016A /* MenuItem.cpp in Sources */, CEA377901291C60500B9016A /* MenuItem.cpp in Sources */,
CEA377911291C60500B9016A /* MTGAbility.cpp in Sources */, CEA377911291C60500B9016A /* MTGAbility.cpp in Sources */,
751E1F1718FAE53E001B1E16 /* GridDeckView.cpp in Sources */,
CEA377931291C60500B9016A /* MTGCard.cpp in Sources */, CEA377931291C60500B9016A /* MTGCard.cpp in Sources */,
CEA377941291C60500B9016A /* MTGCardInstance.cpp in Sources */, CEA377941291C60500B9016A /* MTGCardInstance.cpp in Sources */,
CEA377951291C60500B9016A /* MTGDeck.cpp in Sources */, CEA377951291C60500B9016A /* MTGDeck.cpp in Sources */,
@@ -2095,6 +2093,7 @@
CEA377BA1291C60500B9016A /* utils.cpp in Sources */, CEA377BA1291C60500B9016A /* utils.cpp in Sources */,
CEA377BB1291C60500B9016A /* WCachedResource.cpp in Sources */, CEA377BB1291C60500B9016A /* WCachedResource.cpp in Sources */,
CEA377BC1291C60500B9016A /* WDataSrc.cpp in Sources */, CEA377BC1291C60500B9016A /* WDataSrc.cpp in Sources */,
751E1F1618FAE53E001B1E16 /* DeckView.cpp in Sources */,
CEA377BD1291C60500B9016A /* WEvent.cpp in Sources */, CEA377BD1291C60500B9016A /* WEvent.cpp in Sources */,
CEA377BE1291C60500B9016A /* WFilter.cpp in Sources */, CEA377BE1291C60500B9016A /* WFilter.cpp in Sources */,
CEA377BF1291C60500B9016A /* WFont.cpp in Sources */, CEA377BF1291C60500B9016A /* WFont.cpp in Sources */,
@@ -2104,6 +2103,7 @@
CE9A478512B514BA00C9F38A /* EAGLView.m in Sources */, CE9A478512B514BA00C9F38A /* EAGLView.m in Sources */,
CE9A478612B514BA00C9F38A /* EAGLViewController.m in Sources */, CE9A478612B514BA00C9F38A /* EAGLViewController.m in Sources */,
CE9A478912B514BA00C9F38A /* ES2Renderer.m in Sources */, CE9A478912B514BA00C9F38A /* ES2Renderer.m in Sources */,
751E1F1518FAE53E001B1E16 /* CarouselDeckView.cpp in Sources */,
CE9A478A12B514BA00C9F38A /* main.m in Sources */, CE9A478A12B514BA00C9F38A /* main.m in Sources */,
CE9A478D12B514BA00C9F38A /* wagicAppDelegate.m in Sources */, CE9A478D12B514BA00C9F38A /* wagicAppDelegate.m in Sources */,
CE9E71DD1375A58600759DDC /* thread.cpp in Sources */, CE9E71DD1375A58600759DDC /* thread.cpp in Sources */,
@@ -2152,10 +2152,6 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES; ALWAYS_SEARCH_USER_PATHS = YES;
ARCHS = (
armv6,
"$(ARCHS_STANDARD_32_BIT)",
);
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
@@ -2205,10 +2201,6 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
armv6,
"$(ARCHS_STANDARD_32_BIT)",
);
CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
@@ -2252,10 +2244,6 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES; ALWAYS_SEARCH_USER_PATHS = YES;
ARCHS = (
armv6,
"$(ARCHS_STANDARD_32_BIT)",
);
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
@@ -2291,10 +2279,7 @@
"\"$(SRCROOT)/../../admobsdk/iOS/GoogleAdMobAdsSDKiOS-5.0.5\"", "\"$(SRCROOT)/../../admobsdk/iOS/GoogleAdMobAdsSDKiOS-5.0.5\"",
); );
"New Setting" = ""; "New Setting" = "";
OTHER_LDFLAGS = ( OTHER_LDFLAGS = "-Wl";
"-no_implicit_dylibs",
"-Wl",
);
PRODUCT_NAME = wagic; PRODUCT_NAME = wagic;
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
@@ -2307,10 +2292,6 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
armv6,
"$(ARCHS_STANDARD_32_BIT)",
);
CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
@@ -2339,10 +2320,7 @@
"$(inherited)", "$(inherited)",
"\"$(SRCROOT)/../../admobsdk/iOS/GoogleAdMobAdsSDKiOS-5.0.5\"", "\"$(SRCROOT)/../../admobsdk/iOS/GoogleAdMobAdsSDKiOS-5.0.5\"",
); );
OTHER_LDFLAGS = ( OTHER_LDFLAGS = "-Wl";
"-no_implicit_dylibs",
"-Wl",
);
PRODUCT_NAME = wagic; PRODUCT_NAME = wagic;
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
@@ -2354,7 +2332,6 @@
C01FCF4F08A954540054247B /* Debug */ = { C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEPLOYMENT_LOCATION = NO; DEPLOYMENT_LOCATION = NO;
@@ -2365,6 +2342,11 @@
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../Boost/boost; HEADER_SEARCH_PATHS = ../../Boost/boost;
IPHONEOS_DEPLOYMENT_TARGET = 5.1; IPHONEOS_DEPLOYMENT_TARGET = 5.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-DTIXML_USE_STL",
"-fno-objc-arc",
);
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@@ -2374,7 +2356,6 @@
C01FCF5008A954540054247B /* Release */ = { C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
GCC_C_LANGUAGE_STANDARD = c99; GCC_C_LANGUAGE_STANDARD = c99;
@@ -2382,7 +2363,10 @@
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../Boost/boost; HEADER_SEARCH_PATHS = ../../Boost/boost;
IPHONEOS_DEPLOYMENT_TARGET = 5.1; IPHONEOS_DEPLOYMENT_TARGET = 5.1;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_CFLAGS = (
"-DNS_BLOCK_ASSERTIONS=1",
"-DTIXML_USE_STL=1",
);
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos; SDKROOT = iphoneos;
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0500" LastUpgradeVersion = "0510"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0500" LastUpgradeVersion = "0510"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
+96 -36
View File
@@ -1,46 +1,106 @@
#!/bin/sh -ex #!/bin/sh -ex
# let's dump some info to debug a bit
echo ls = `ls`
echo pwd = `pwd`
# computing potential release name
echo TRAVIS_PULL_REQUEST = $TRAVIS_PULL_REQUEST
echo TRAVIS_BRANCH = $TRAVIS_BRANCH
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
if [ "$TRAVIS_BRANCH" = "alphas" ]; then
export RELEASE_NAME="alpha-${TRAVIS_BUILD_NUMBER}"
else if [ "$TRAVIS_BRANCH" = "master" ]; then
export RELEASE_NAME="latest-master"
fi
fi
fi
echo RELEASE_NAME = $RELEASE_NAME
# updating versions with the TRAVIS build numbers # updating versions with the TRAVIS build numbers
cd projects/mtg/ cd projects/mtg/
ant update > error.txt ant update > error.txt
cd ../.. cd ../..
# we're building a PSP binary here # we create resource package
cd JGE
make -j 8
cd ..
cd projects/mtg
mkdir objs
make -j 8
mkdir psprelease
mv EBOOT.PBP psprelease/
mv wagic.elf psprelease/
mv wagic.prx psprelease/
zip psprelease.zip -r psprelease/
cd ../..
# we're building an Android binary here
android-ndk-r9/ndk-build -C projects/mtg/Android -j8
$ANDROID list targets
$ANDROID update project -t 1 -p projects/mtg/Android
ant debug -f projects/mtg/Android/build.xml
# we're building a Qt version with GUI here
mkdir qt-gui-build
cd qt-gui-build
qmake ../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics
make -j 8
cd ..
# let's try an Intel linux binary in debug text-mode-only
qmake projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug DEFINES+=CAPTURE_STDERR
make -j 8
# Now we run the testsuite
./wagic
# And we create resource package (not before testsuite, it mofifies resources)
cd projects/mtg/bin/Res cd projects/mtg/bin/Res
python createResourceZip.py python createResourceZip.py
mv core_*.zip core.zip # if we let the zip here, Wagic will use it in the testsuite
# and we'll get 51 failed test cases
mv core_*.zip ../../../../core.zip
cd ../../../.. cd ../../../..
# we're building a PSP binary here
if [ "$BUILD_TYPE" = "PSP" ]; then
# let's dump some info to debug a bit
echo PSPDEV = $PSPDEV
echo psp-config = `psp-config --psp-prefix`
cd JGE
make -j 4
cd ..
cd projects/mtg
mkdir objs
make -j 4
mkdir WTH
mkdir WTH/Res
mv EBOOT.PBP WTH/
mv ../../JGE/exceptionHandler/prx/exception.prx WTH/
cp ../../core.zip WTH/Res
cd WTH/Res
unzip core.zip
rm core.zip
cd ..
chmod -R 775 Res
cd ..
zip psprelease.zip -r WTH/
cd ../..
fi
# we're building an Android binary here
if [ "$BUILD_TYPE" = "Android" ]; then
android-ndk-r9/ndk-build -C projects/mtg/Android -j4
$ANDROID list targets
$ANDROID update project -t 1 -p projects/mtg/Android
ant debug -f projects/mtg/Android/build.xml
fi
if [ "$BUILD_TYPE" = "Qt" ]; then
# we're building a Qt version with GUI here
mkdir qt-gui-build
cd qt-gui-build
$QMAKE ../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics
make -j 4
cd ..
# let's try an Intel linux binary in debug text-mode-only
$QMAKE projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug DEFINES+=CAPTURE_STDERR
make -j 4
# we're cross-compiling a Qt Windows version here,
# PATH is only set here to prevent colision
# export PATH="$PATH:/opt/mingw32/bin"
# mkdir build
# cd build
# mkdir win-cross
# cd win-cross
# /opt/mingw32/bin/qmake ../../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics
# make -j 4
# cd release
# cp ../../../projects/mtg/bin/fmod.dll .
# cp /opt/mingw32/bin/QtCore4.dll .
# cp /opt/mingw32/bin/QtGui4.dll .
# cp /opt/mingw32/bin/QtNetwork4.dll .
# cp /opt/mingw32/bin/QtOpenGL4.dll .
# cp ../../../projects/mtg/bin/zlib1.dll .
# cp /opt/mingw32/bin/libpng15-15.dll .
# cd ..
# zip win-cross.zip -r release/
# cd ../..
# Now we run the testsuite (Res needs to be in the working directory)
cd projects/mtg
../../wagic
cd ../..
fi
+66
View File
@@ -0,0 +1,66 @@
import sys
import os
import zipfile
from pyjavaproperties import Properties
from optparse import OptionParser
from github3 import login
def checkRelease(repository, remote):
release = None
for r in repository.iter_releases():
if r.name == 'latest-master' :
release = r
for a in r.assets :
if a.name == remote :
# need to delete the old release
r.delete()
# need also to delete the tag (reference)
ref = repository.ref('tags/latest-master')
ref.delete()
release = None
if release is None:
# now, we recreate a new one
release = repository.create_release('latest-master', 'master', 'latest-master',
'Latest successful builds of the master branch automatically uploaded by Travis or AppVeyor CI.',
False,
True)
return release
def suffixFilename(filename, build):
p = Properties();
p.load(open('projects/mtg/build.number.properties'));
minor = p['build.minor'];
major = p['build.major'];
point = p['build.point'];
name, extension = os.path.splitext(filename)
filename = name + '-' + major + minor + point + '-' + build + extension
return filename
def main():
parser = OptionParser()
parser.add_option("-t", "--token", help="TOKEN: specify authentication token to use", metavar="TOKEN", dest="token")
parser.add_option("-s", "--sha", help="SHA: specify commit SHA", metavar="SHA", dest="sha")
parser.add_option("-l", "--local", help="FILE: specify local file path to upload", metavar="LOCAL", dest="local")
parser.add_option("-r", "--remote", help="NAME: specify remote asset name in the release.", metavar="REMOTE", dest="remote")
parser.add_option("-b", "--branch", help="BRANCH: specify branch of the commit", metavar="BRANCH", dest="branch")
(options, args) = parser.parse_args()
if (options.token and options.sha and options.local and options.remote and options.branch == 'master'):
gh = login(token = options.token)
else:
parser.print_help()
return
repository = gh.repository('WagicProject', 'wagic')
r = checkRelease(repository, options.remote)
filename = options.remote
with open(options.local, 'rb') as fd:
r.upload_asset('application/zip', filename , fd)
if __name__ == "__main__":
main()
+74 -6
View File
@@ -2,29 +2,97 @@ if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
if [ "$TRAVIS_BRANCH" == "alphas" ]; then if [ "$TRAVIS_BRANCH" == "alphas" ]; then
echo -e "Creating a release\n" echo -e "Creating a release\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \ curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-d '{"tag_name": "alpha-'${TRAVIS_BUILD_NUMBER}'", "target_commitish": "master", "name": "Alpha release number '${TRAVIS_BUILD_NUMBER}'", "body": "Automatic alpha release generated by Travis CI'", "draft": false, "prerelease": true}' "https://api.github.com/repos/WagicProject/wagic/releases" > json.txt -d '{"tag_name": "alpha-'${TRAVIS_BUILD_NUMBER}'", "target_commitish": "master", "name": "Alpha release number '${TRAVIS_BUILD_NUMBER}'", "body": "Automatic alpha release generated by Travis CI", "draft": false, "prerelease": true}' "https://api.github.com/repos/WagicProject/wagic/releases" > json.txt
export IDDI=`cat json.txt | jq '.id'` IDDI=`cat json.txt | jq '.id'`
echo -e "Uploading Core resources\n" echo -e "Uploading Core resources\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \ curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \ -H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \ -H "Content-Type: application/zip" \
--data-binary @projects/mtg/bin/Res/core.zip \ --data-binary @core.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core-${TRAVIS_BUILD_NUMBER}.zip" "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core.zip"
echo -e "Uploading android package\n" echo -e "Uploading android package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \ curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \ -H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \ -H "Content-Type: application/zip" \
--data-binary @projects/mtg/Android/bin/Wagic-debug.apk \ --data-binary @projects/mtg/Android/bin/Wagic-debug.apk \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android-${TRAVIS_BUILD_NUMBER}.apk" "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android.apk"
echo -e "Uploading PSP package\n" echo -e "Uploading PSP package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \ curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \ -H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \ -H "Content-Type: application/zip" \
--data-binary @projects/mtg/psprelease.zip \ --data-binary @projects/mtg/psprelease.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp-${TRAVIS_BUILD_NUMBER}.zip" "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp.zip"
# echo -e "Uploading Windows package\n"
# curl -X POST -H "Authorization: token ${GH_TOKEN}" \
# -H "Accept: application/vnd.github.manifold-preview" \
# -H "Content-Type: application/zip" \
# --data-binary @build/win-cross/win-cross.zip \
# "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-windows.zip"
echo -e "Done uploading\n"
fi
fi
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
if [ "$TRAVIS_BRANCH" == "master" ]; then
# get info about all releases
echo -e "Getting info about previous releases"
curl -X GET -H "Authorization: token ${GH_TOKEN}" \
"https://api.github.com/repos/WagicProject/wagic/releases" > json.txt
# extract info only about only "latest-release" tag
cat json.txt |jq 'map(select (.tag_name == "latest-master"))' > latest.txt
# get id of release
ID_TO_DELETE=`cat latest.txt |jq '.[0].id'`
# delete previous release
echo -e "Deleting release number ${ID_TO_DELETE}"
curl -X DELETE -H "Authorization: token ${GH_TOKEN}" \
"https://api.github.com/repos/WagicProject/wagic/releases/${ID_TO_DELETE}"
# delete previous tag
curl -X DELETE -H "Authorization: token ${GH_TOKEN}" \
"https://api.github.com/repos/WagicProject/wagic/git/refs/tags/latest-master"
echo -e "Creating a release\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-d '{"tag_name": "latest-master", "target_commitish": "master", "name": "master-'${TRAVIS_BUILD_NUMBER}'", "body": "Automatic release based on latest commit to master branch generated by Travis CI", "draft": false, "prerelease": true}' "https://api.github.com/repos/WagicProject/wagic/releases" > json.txt
IDDI=`cat json.txt | jq '.id'`
echo -e "Uploading Core resources\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \
--data-binary @core.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core.zip"
echo -e "Uploading android package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \
--data-binary @projects/mtg/Android/bin/Wagic-debug.apk \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android.apk"
echo -e "Uploading PSP package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \
--data-binary @projects/mtg/psprelease.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp.zip"
# echo -e "Uploading Windows package\n"
# curl -X POST -H "Authorization: token ${GH_TOKEN}" \
# -H "Accept: application/vnd.github.manifold-preview" \
# -H "Content-Type: application/zip" \
# --data-binary @build/win-cross/win-cross.zip \
# "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-windows.zip"
echo -e "Done uploading\n" echo -e "Done uploading\n"
fi fi