Compare commits
12 Commits
travis_mac
...
minmax
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab34d0d366 | ||
|
|
963ab2840b | ||
|
|
a25b010429 | ||
|
|
504160a740 | ||
|
|
5061f7c37f | ||
|
|
165eb699e8 | ||
|
|
33760f4066 | ||
|
|
656ab78cf5 | ||
|
|
541698f98e | ||
|
|
746a486e7a | ||
|
|
261a6e4780 | ||
|
|
a683f5a2b7 |
72
.travis.yml
@@ -1,30 +1,60 @@
|
|||||||
language: objective-c
|
language: cpp
|
||||||
|
branches:
|
||||||
|
except:
|
||||||
|
- latest-master
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- brew update
|
- export BUILD_PSP=YES
|
||||||
- brew install qt5
|
- export BUILD_ANDROID=YES
|
||||||
|
- export BUILD_Qt=YES
|
||||||
|
- export BUILD_MAC=YES
|
||||||
|
- sudo apt-get update -qq
|
||||||
|
# Building for PSP here
|
||||||
|
- if [ "$BUILD_PSP" == "YES" ]; 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_ANDROID" == "YES" ]; 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_r24.3.3-linux.tgz -nv;
|
||||||
|
fi
|
||||||
|
# Building for Qt here
|
||||||
|
- if [ "$BUILD_Qt" == "YES" ]; 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:
|
||||||
|
- if [ "$BUILD_PSP" == "YES" ]; then
|
||||||
|
tar -x --xz -f sdk.lzma;
|
||||||
|
fi
|
||||||
|
- if [ "$BUILD_ANDROID" == "YES" ]; then
|
||||||
|
tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 &&
|
||||||
|
tar -zxf android-sdk_r24.3.3-linux.tgz &&
|
||||||
|
$ANDROID list sdk --extended -a &&
|
||||||
|
echo yes | $ANDROID update sdk -a -t tools,platform-tools,build-tools-22.0.1,android-10 --no-ui --force --no-https;
|
||||||
|
fi
|
||||||
- sudo pip install pyjavaproperties
|
- sudo pip install pyjavaproperties
|
||||||
- sudo pip install github3.py
|
- sudo pip install github3.py
|
||||||
- brew install dpkg ldid
|
- sudo pip install cpp-coveralls
|
||||||
#- curl -s -f -L https://raw.github.com/r-plus/dotfiles/master/install_theos.sh | bash
|
|
||||||
- mkdir theos
|
|
||||||
- cd theos
|
|
||||||
- git clone --recursive https://github.com/theos/theos.git
|
|
||||||
- export THEOS="$TRAVIS_BUILD_DIR/theos"
|
|
||||||
- cd ..
|
|
||||||
- pwd
|
|
||||||
- ls
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
secure: "EBzr1+qjQsOhn0s+tcFmXR1jP9B0xiOSXuXbRXWZ1OEHNvp8+A5/pS84LYVFlaZqmxr5dApxvPtwhgLIUbQ3EPXm8LpC3KgSD4dS+9/QMbxhe5TK4oczgFRGcDTMJQZsCzhOh7hp3tbcbJg5Gp+VT7aFjFQSHDGwhzSJXsXwh/8="
|
- secure: "EBzr1+qjQsOhn0s+tcFmXR1jP9B0xiOSXuXbRXWZ1OEHNvp8+A5/pS84LYVFlaZqmxr5dApxvPtwhgLIUbQ3EPXm8LpC3KgSD4dS+9/QMbxhe5TK4oczgFRGcDTMJQZsCzhOh7hp3tbcbJg5Gp+VT7aFjFQSHDGwhzSJXsXwh/8="
|
||||||
|
- secure: "X5dTQfofqAutnXxmu11Ep2MQ5QYnMN8m0AITRtwymhEF2UclcOudI1+skPtuhAGbWQnSO+lhunV3cvMfw2/Ml3k/VDz6VdFSKFrzAu7ja1VLJfcxr7chi0s8q30pVBb66tGydjIBac3B+RQyqgmZQW1frbRrhC/kPFQ6wPWOJdQ="
|
||||||
|
- secure: "T97NUPnxCpVZ/c5HH0zfo0FO3DPSRMSmze58ubW5EUTZOjAMtEt+OFdsrNZvUTCugUj2M1agtonZbAbczpaAL+lgZcHDgXgWMkfO0pMnsWX1yyCNqMuE/iTMpJr/xsLQeyWlftWjJLsseQU45abZsd1XVmda/G+ZhrDLF1y55SA="
|
||||||
|
|
||||||
script:
|
script: "tools/travis-script.sh"
|
||||||
- /usr/local/opt/qt5/bin/qmake projects/mtg/wagic-qt.pro CONFIG+=graphics
|
|
||||||
- make -j 4 dmg
|
|
||||||
- cd projects/mtg/iOS
|
|
||||||
- make -j 4 package
|
|
||||||
- cd ../../..
|
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l wagic.dmg -r Wagic-macosx.dmg -b $TRAVIS_BRANCH
|
- coveralls -b . -e JGE/src -e JGE/include -i projects/mtg/include -i projects/mtg/src --gcov-options '\-lp'
|
||||||
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/iOS/net.wagic_0.19.2-1_iphoneos-arm.deb -r Wagic-iOS.deb -b $TRAVIS_BRANCH
|
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH
|
||||||
|
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/Android/bin/Wagic-debug.apk -r Wagic-android.apk -b $TRAVIS_BRANCH
|
||||||
|
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/psprelease.zip -r Wagic-psp.zip -b $TRAVIS_BRANCH
|
||||||
|
|||||||
141
CHANGELOG.md
@@ -1,147 +1,6 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [latest-master] (https://github.com/WagicProject/wagic/tree/latest-master)
|
## [latest-master] (https://github.com/WagicProject/wagic/tree/latest-master)
|
||||||
#### 8/3/16
|
|
||||||
- *Merged pull-request:* andAbility on ATokenCreator, Extend AAFlip [#\824] (https://github.com/WagicProject/wagic/pull/824) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 7/31/16
|
|
||||||
- *Merged pull-request:* Fix Chandra, Flamecaller & Cryptolith Rite [#\818] (https://github.com/WagicProject/wagic/pull/818) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 7/28/16
|
|
||||||
- *Merged pull-request:* changing some of the logic to the previous fixes, we want to avoid using code that looks for specific card names. [#\800] (https://github.com/WagicProject/wagic/pull/800) ([zethfoxster](https://github.com/zethfoxster))
|
|
||||||
|
|
||||||
#### 7/26/16
|
|
||||||
- *Merged pull-request:* granted flashback [#\791] (https://github.com/WagicProject/wagic/pull/791) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 7/23/16
|
|
||||||
- *Merged pull-request:* Fix Flying vs Moat (multiples of them). Fixes issue #526 [#\783] (https://github.com/WagicProject/wagic/pull/783) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 7/19/16
|
|
||||||
- *Merged pull-request:* pushing to master [#\770] (https://github.com/WagicProject/wagic/pull/770) ([zethfoxster](https://github.com/zethfoxster))
|
|
||||||
|
|
||||||
#### 7/18/16
|
|
||||||
- *Merged pull-request:* Fix Deck Menu layer, Change Main Menu Layout, Fix Crash cdaactive on tokens [#\765] (https://github.com/WagicProject/wagic/pull/765) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 7/12/16
|
|
||||||
- *Merged pull-request:* Pushing fixes [#\750] (https://github.com/WagicProject/wagic/pull/750) ([zethfoxster](https://github.com/zethfoxster))
|
|
||||||
|
|
||||||
- *Merged pull-request:* try to fix failed logic here [#\747] (https://github.com/WagicProject/wagic/pull/747) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 7/9/16
|
|
||||||
- *Merged pull-request:* pushing to master [#\738] (https://github.com/WagicProject/wagic/pull/738) ([zethfoxster](https://github.com/zethfoxster))
|
|
||||||
|
|
||||||
- *Merged pull-request:* Sorted Primitives and Cleanup Tabs [#\736] (https://github.com/WagicProject/wagic/pull/736) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 7/7/16
|
|
||||||
- *Merged pull-request:* Sorted Primitives and Cleanup Tabs [#\727] (https://github.com/WagicProject/wagic/pull/719) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
- *Merged pull-request:* push to wagicproject [#\725] (https://github.com/WagicProject/wagic/pull/725) ([zethfoxster](https://github.com/zethfoxster))
|
|
||||||
|
|
||||||
#### 7/4/16
|
|
||||||
- *Merged pull-request:* Sorted Primitives & Updated Premium Deck Series [#\719] (https://github.com/WagicProject/wagic/pull/719) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
- *Merged pull-request:* Fails but I have no idea why [#\717] (https://github.com/WagicProject/wagic/pull/717) ([zethfoxster](https://github.com/zethfoxster))
|
|
||||||
|
|
||||||
- *Merged pull-request:* Updated Sets [#\715] (https://github.com/WagicProject/wagic/pull/715) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 7/2/16
|
|
||||||
- *Merged pull-request:* Updated Masters, Beginners, Duels and Vault Sets [#\714] (https://github.com/WagicProject/wagic/pull/714) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 7/1/16
|
|
||||||
- *Merged pull-request:* Cleaned and Sorted all Core and Expansion Sets [#\713] (https://github.com/WagicProject/wagic/pull/713) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
- *Merged pull-request:* Soulbond Pair Indicator [#\712] (https://github.com/WagicProject/wagic/pull/712) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 6/30/16
|
|
||||||
- *Merged pull-request:* Sorted Primitives [#\711] (https://github.com/WagicProject/wagic/pull/711) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
- *Merged pull-request:* Add Shackle Ability [#\710] (https://github.com/WagicProject/wagic/pull/710) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
- *Merged pull-request:* Fix Cascade, Crash fix on lastController and some corrections [#\709] (https://github.com/WagicProject/wagic/pull/709) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 6/29/16
|
|
||||||
- *Merged pull-request:* Updated Primitives and Hide Highlight Border [#\707] (https://github.com/WagicProject/wagic/pull/707) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
- *Committed:* Pretty huge patch here(sorry old habits never die :( ) [#\6ee00c1] (https://github.com/WagicProject/wagic/commit/6ee00c138ce374d54cb3ee034575ce440288ca0e) ([zethfoxster](https://github.com/zethfoxster))
|
|
||||||
|
|
||||||
#### 6/23/16
|
|
||||||
- *Merged pull-request:* Fix producecolor:color [#\704] (https://github.com/WagicProject/wagic/pull/704) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 6/17/16
|
|
||||||
- *Merged pull-request:* Force Mounting 2 [#\699] (https://github.com/WagicProject/wagic/pull/699) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 6/16/16
|
|
||||||
- *Merged pull-request:* Import Deck Options [#\697] (https://github.com/WagicProject/wagic/pull/697) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 6/11/16
|
|
||||||
- *Merged pull-request:* Refactor & Devotion [#\690] (https://github.com/WagicProject/wagic/pull/690) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 6/9/16
|
|
||||||
- *Closed issue:* Clone goes to graveyard before being able to copy anything [\#546](https://github.com/WagicProject/wagic/issues/546)
|
|
||||||
|
|
||||||
- *Closed issue:* Blinking an aura causes freeze [\#541](https://github.com/WagicProject/wagic/issues/541)
|
|
||||||
|
|
||||||
- *Closed issue:* Profile name at upper left side is not being updated correctly [\#469](https://github.com/WagicProject/wagic/issues/469)
|
|
||||||
|
|
||||||
- *Closed issue:* Giving card C protection from X does not remove cards attached to C which have quality X [\#464](https://github.com/WagicProject/wagic/issues/464)
|
|
||||||
|
|
||||||
- *Closed issue:* (graphical glitch) wood / gold textures [\#461](https://github.com/WagicProject/wagic/issues/461)
|
|
||||||
|
|
||||||
- *Closed issue:* Clone does not get all P/T bonuses [\#448](https://github.com/WagicProject/wagic/issues/448)
|
|
||||||
|
|
||||||
- *Closed issue:* Card "threaten" messes up the GUI [\#473](https://github.com/WagicProject/wagic/issues/473)
|
|
||||||
|
|
||||||
#### 6/7/16
|
|
||||||
- *Closed issue:* Emrakul isn't killed by creatures with deathtouch [\#597](https://github.com/WagicProject/wagic/issues/597)
|
|
||||||
|
|
||||||
#### 6/3/16
|
|
||||||
- *Merged pull-request:* Cost Increaser & Reducer Fix [#\676] (https://github.com/WagicProject/wagic/pull/676) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 5/30/16
|
|
||||||
- *Fixed Bug:* deckstats crash when "unlock cards" is used [#\668] (https://github.com/WagicProject/wagic/issues/668) ([zethfoxster](https://github.com/zethfoxster))
|
|
||||||
|
|
||||||
#### 5/26/16
|
|
||||||
- *Closed issue:* Nasty memleak crashing devices and its fix. [#\664] (https://github.com/WagicProject/wagic/issues/664) ([zethfoxster](https://github.com/zethfoxster))
|
|
||||||
|
|
||||||
#### 11/08/15
|
|
||||||
- *Merged pull-request:* produce mana for lands you/opponent could produce [#\658] (https://github.com/WagicProject/wagic/pull/658) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 11/07/15
|
|
||||||
- *Merged pull-request:* Manacost Changes, Anyzone for CDA, PayZero Cost [#\656] (https://github.com/WagicProject/wagic/pull/656) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 10/31/15
|
|
||||||
- *Merged pull-request:* Exile Zone, Altercost and Hand modifier [#\653] (https://github.com/WagicProject/wagic/pull/653) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 10/17/15
|
|
||||||
- *Merged pull-request:* Fix issue #473 #784 [#\646] (https://github.com/WagicProject/wagic/pull/646) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 10/15/15
|
|
||||||
- *Merged pull-request:* Bug Fix: Planeswalker Rule & ABlink return to play ability for Aura cards [#\644] (https://github.com/WagicProject/wagic/pull/644) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 10/14/15
|
|
||||||
- *Merged pull-request:* Fix Legend Rule [#\643] (https://github.com/WagicProject/wagic/pull/643) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 10/12/15
|
|
||||||
- *Merged pull-request:* Fix crash bug, support doubled res texture for background, avatars, menutitle [#\641] (https://github.com/WagicProject/wagic/pull/641) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 10/02/15
|
|
||||||
- *Merged pull-request:* LKI for power, toughness and basic abilities, produceextra ability [#\636] (https://github.com/WagicProject/wagic/pull/636) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 09/29/15
|
|
||||||
- *Merged pull-request:* Fix Recover Cards, Cloner, Copier, and Preliminary support for Madness [#\635] (https://github.com/WagicProject/wagic/pull/635) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 09/22/15
|
|
||||||
- *Merged pull-request:* Auraward, unattach event and statebased action for protection from quality [#\631] (https://github.com/WagicProject/wagic/pull/631) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 09/19/15
|
|
||||||
- *Merged pull-request:* PT Switch like Layer 7e and Token Indicator [#\626] (https://github.com/WagicProject/wagic/pull/626) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 09/18/15
|
|
||||||
- *Merged pull-request:* Token Cloning fix and colored PT [#\624] (https://github.com/WagicProject/wagic/pull/624) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 09/15/15
|
|
||||||
- *Merged pull-request:* CDA and X manacost on stack [\#623] (https://github.com/WagicProject/wagic/pull/623) ([kevlahnota](https://github.com/kevlahnota))
|
|
||||||
|
|
||||||
#### 08/12/14
|
#### 08/12/14
|
||||||
- *Merged pull-request:* Fix for guild_keywords Devotion, added some "Chroma" cards [\#606](https://github.com/WagicProject/wagic/pull/606) ([kevlahnota](https://github.com/kevlahnota))
|
- *Merged pull-request:* Fix for guild_keywords Devotion, added some "Chroma" cards [\#606](https://github.com/WagicProject/wagic/pull/606) ([kevlahnota](https://github.com/kevlahnota))
|
||||||
|
|
||||||
|
|||||||
@@ -77,13 +77,6 @@ SDL_AtomicTryLock(SDL_SpinLock *lock)
|
|||||||
: "=&r" (result) : "r" (1), "r" (lock) : "cc", "memory");
|
: "=&r" (result) : "r" (1), "r" (lock) : "cc", "memory");
|
||||||
return (result == 0);
|
return (result == 0);
|
||||||
|
|
||||||
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
|
||||||
int result;
|
|
||||||
__asm__ __volatile__(
|
|
||||||
"lock ; xchgl %0, (%1)\n"
|
|
||||||
: "=r" (result) : "r" (lock), "0" (1) : "cc", "memory");
|
|
||||||
return (result == 0);
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
/* Need CPU instructions for spinlock here! */
|
/* Need CPU instructions for spinlock here! */
|
||||||
__need_spinlock_implementation__
|
__need_spinlock_implementation__
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ HGE_OBJS = src/hge/hgecolor.o src/hge/hgeparticle.o \
|
|||||||
|
|
||||||
CXXFLAGS = -W -Wall -Werror -Wno-unused
|
CXXFLAGS = -W -Wall -Werror -Wno-unused
|
||||||
CXXFLAGS += -DTIXML_USE_STL
|
CXXFLAGS += -DTIXML_USE_STL
|
||||||
CXXFLAGS += -Wno-deprecated-declarations -Wno-sign-compare
|
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef DEBUG
|
||||||
CXXFLAGS += -ggdb3
|
CXXFLAGS += -ggdb3
|
||||||
@@ -83,7 +82,7 @@ ifeq ($(TARGET_ARCHITECTURE),linux)
|
|||||||
OBJS = $(GENERIC_OBJS) $(LINUX_OBJS)
|
OBJS = $(GENERIC_OBJS) $(LINUX_OBJS)
|
||||||
TARGET_LIB = libjge.a
|
TARGET_LIB = libjge.a
|
||||||
TARGET_HGE = libhgetools.a
|
TARGET_HGE = libhgetools.a
|
||||||
INCDIR = $(shell freetype-config --cflags 2> /dev/null) -I/usr/X11/include -I/usr/include/boost -Isrc/zipFS -Iinclude/
|
INCDIR = $(shell freetype-config --cflags 2> /dev/null) -I/usr/X11/include -I../Boost -Isrc/zipFS -Iinclude/
|
||||||
CXXFLAGS += -DLINUX $(FMOD)
|
CXXFLAGS += -DLINUX $(FMOD)
|
||||||
CXXFLAGS += $(INCDIR)
|
CXXFLAGS += $(INCDIR)
|
||||||
LIBDIR = lib/linux
|
LIBDIR = lib/linux
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ using namespace std;
|
|||||||
template <class T>
|
template <class T>
|
||||||
std::string ToHex(T* pointer)
|
std::string ToHex(T* pointer)
|
||||||
{
|
{
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
stream << hex << showbase << setfill('0') << setw(8) << (uint64_t) pointer;
|
stream << hex << showbase << setfill('0') << setw(8) << (uint64_t) pointer;
|
||||||
return stream.str();
|
return stream.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
@@ -42,9 +42,9 @@ std::string ToHex(T* pointer)
|
|||||||
#else // CAPTURE_STDERR
|
#else // CAPTURE_STDERR
|
||||||
#define DebugTrace(inString) \
|
#define DebugTrace(inString) \
|
||||||
{ \
|
{ \
|
||||||
std::ostringstream stream; \
|
std::ostringstream stream; \
|
||||||
stream << inString; \
|
stream << inString; \
|
||||||
qDebug("%s", stream.str().c_str()); \
|
qDebug("%s", stream.str().c_str()); \
|
||||||
}
|
}
|
||||||
#endif // CAPTURE_STDERR
|
#endif // CAPTURE_STDERR
|
||||||
|
|
||||||
@@ -52,16 +52,16 @@ std::string ToHex(T* pointer)
|
|||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#define DebugTrace(inString) \
|
#define DebugTrace(inString) \
|
||||||
{ \
|
{ \
|
||||||
std::ostringstream stream; \
|
std::ostringstream stream; \
|
||||||
stream << inString; \
|
stream << inString; \
|
||||||
__android_log_write(ANDROID_LOG_DEBUG, "Wagic", stream.str().c_str());\
|
__android_log_write(ANDROID_LOG_DEBUG, "Wagic", stream.str().c_str());\
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define DebugTrace(inString) \
|
#define DebugTrace(inString) \
|
||||||
{ \
|
{ \
|
||||||
std::ostringstream stream; \
|
std::ostringstream stream; \
|
||||||
stream << inString << std::endl; \
|
stream << inString << std::endl; \
|
||||||
OutputDebugStringA(stream.str().c_str()); \
|
OutputDebugStringA(stream.str().c_str()); \
|
||||||
}
|
}
|
||||||
#endif // QT_CONFIG
|
#endif // QT_CONFIG
|
||||||
#endif // Win32, Linux
|
#endif // Win32, Linux
|
||||||
@@ -71,7 +71,7 @@ std::string ToHex(T* pointer)
|
|||||||
#ifndef DebugTrace
|
#ifndef DebugTrace
|
||||||
#define DebugTrace(inString) \
|
#define DebugTrace(inString) \
|
||||||
{ \
|
{ \
|
||||||
std::cerr << inString << std::endl; \
|
std::cerr << inString << std::endl; \
|
||||||
}
|
}
|
||||||
#endif //DEBUG
|
#endif //DEBUG
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -178,6 +178,8 @@ private:
|
|||||||
float mSpacing;
|
float mSpacing;
|
||||||
|
|
||||||
PIXEL_TYPE mColor;
|
PIXEL_TYPE mColor;
|
||||||
|
int mBlend;
|
||||||
|
|
||||||
int mBase;
|
int mBase;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -598,6 +598,8 @@ private:
|
|||||||
GLint prog2_positionLoc;
|
GLint prog2_positionLoc;
|
||||||
GLint prog2_texCoordLoc;
|
GLint prog2_texCoordLoc;
|
||||||
GLint prog2_colorLoc;
|
GLint prog2_colorLoc;
|
||||||
|
// MVP matrix
|
||||||
|
ESMatrix prog2_mvpMatrix;
|
||||||
// Uniform locations
|
// Uniform locations
|
||||||
GLint prog2_mvpLoc;
|
GLint prog2_mvpLoc;
|
||||||
|
|
||||||
@@ -610,11 +612,13 @@ private:
|
|||||||
int mCurrentTextureFormat;
|
int mCurrentTextureFormat;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PSP
|
|
||||||
bool mVsync;
|
bool mVsync;
|
||||||
int mTexCounter;
|
|
||||||
#endif
|
|
||||||
int mSwizzle;
|
int mSwizzle;
|
||||||
|
int mTexCounter;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int mCurrentTextureFilter;
|
int mCurrentTextureFilter;
|
||||||
|
|
||||||
int mCurrTexBlendSrc;
|
int mCurrTexBlendSrc;
|
||||||
|
|||||||
@@ -258,9 +258,7 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int mVolume;
|
int mVolume;
|
||||||
#ifndef IOS
|
|
||||||
int mMusicVolume;
|
int mMusicVolume;
|
||||||
#endif
|
|
||||||
int mSampleVolume;
|
int mSampleVolume;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,11 +18,12 @@ using namespace std;
|
|||||||
|
|
||||||
#define MID_POINT_THRESHOLD 1.0f
|
#define MID_POINT_THRESHOLD 1.0f
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Position of a single dot on screen.
|
/// Position of a single dot on screen.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
class JPoint
|
class Point
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -33,13 +34,13 @@ public:
|
|||||||
/// @param _y - Y position.
|
/// @param _y - Y position.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
JPoint(float _x, float _y) { x = _x; y = _y; }
|
Point(float _x, float _y) { x = _x; y = _y; }
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Constructor, set position to default (0.0f, 0.0f)
|
/// Constructor, set position to default (0.0f, 0.0f)
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
JPoint() { x = 0.0f; y = 0.0f; }
|
Point() { x = 0.0f; y = 0.0f; }
|
||||||
|
|
||||||
float x; ///< X position.
|
float x; ///< X position.
|
||||||
float y; ///< Y position.
|
float y; ///< Y position.
|
||||||
@@ -94,7 +95,7 @@ public:
|
|||||||
/// @param pt - Control point.
|
/// @param pt - Control point.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void AddControlPoint(const JPoint &pt);
|
void AddControlPoint(const Point &pt);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Get a control point of the spline.
|
/// Get a control point of the spline.
|
||||||
@@ -104,7 +105,7 @@ public:
|
|||||||
/// @return Control point.
|
/// @return Control point.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void GetControlPoint(JPoint &point, int index);
|
void GetControlPoint(Point &point, int index);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Work out all pixels of the spline.
|
/// Work out all pixels of the spline.
|
||||||
@@ -127,7 +128,7 @@ public:
|
|||||||
/// @return Position of the desire point.
|
/// @return Position of the desire point.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void PointOnCurve(JPoint &out, float t, const JPoint &p0, const JPoint &p1, const JPoint &p2, const JPoint &p3);
|
void PointOnCurve(Point &out, float t, const Point &p0, const Point &p1, const Point &p2, const Point &p3);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Get a number of pixels for this spline.
|
/// Get a number of pixels for this spline.
|
||||||
@@ -145,7 +146,7 @@ public:
|
|||||||
/// @return Position of the desire point.
|
/// @return Position of the desire point.
|
||||||
///
|
///
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
void GetPixel(JPoint &point, int index);
|
void GetPixel(Point &point, int index);
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
/// Render the spline to screen.
|
/// Render the spline to screen.
|
||||||
@@ -155,8 +156,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
vector<JPoint> mMidPoints;
|
vector<Point> mMidPoints;
|
||||||
vector<JPoint> mPixels;
|
vector<Point> mPixels;
|
||||||
int mCount;
|
int mCount;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -311,7 +311,9 @@ namespace boost
|
|||||||
|
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QSharedPointer>
|
|
||||||
|
#include <boost/bind.hpp>
|
||||||
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
#include "../include/JLogger.h"
|
#include "../include/JLogger.h"
|
||||||
|
|
||||||
@@ -418,25 +420,23 @@ namespace boost
|
|||||||
virtual void run() = 0;
|
virtual void run() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef boost::shared_ptr<detail::thread_data_base> thread_data_ptr;
|
||||||
|
|
||||||
typedef QSharedPointer<detail::thread_data_base> thread_data_ptr;
|
template<typename F>
|
||||||
|
|
||||||
template<typename F, typename A1>
|
|
||||||
class thread_data : public detail::thread_data_base
|
class thread_data : public detail::thread_data_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
thread_data(F f_, A1 a1_) : f(f_), a1(a1_)
|
thread_data(F f_) : f(f_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void run()
|
void run()
|
||||||
{
|
{
|
||||||
f(a1);
|
f();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
F f;
|
F f;
|
||||||
A1 a1;
|
|
||||||
|
|
||||||
void operator=(thread_data&);
|
void operator=(thread_data&);
|
||||||
thread_data(thread_data&);
|
thread_data(thread_data&);
|
||||||
@@ -493,7 +493,7 @@ namespace boost
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class F,class A1>
|
template <class F,class A1>
|
||||||
thread(F f, A1 a1) : mThreadInfo(make_thread_info(f, a1))
|
thread(F f, A1 a1) : mThreadInfo(make_thread_info(boost::bind(boost::type<void>(), f, a1)))
|
||||||
{
|
{
|
||||||
mpThread = new threadImpl(mThreadInfo);
|
mpThread = new threadImpl(mThreadInfo);
|
||||||
LOG("Calling start func");
|
LOG("Calling start func");
|
||||||
@@ -510,10 +510,10 @@ namespace boost
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename F, typename A1>
|
template<typename F>
|
||||||
static inline detail::thread_data_ptr make_thread_info(F f, A1 a1)
|
static inline detail::thread_data_ptr make_thread_info(F f)
|
||||||
{
|
{
|
||||||
return detail::thread_data_ptr(new detail::thread_data<F, A1>(f, a1));
|
return detail::thread_data_ptr(new detail::thread_data<F>(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
detail::thread_data_ptr mThreadInfo;
|
detail::thread_data_ptr mThreadInfo;
|
||||||
|
|||||||
@@ -16,14 +16,9 @@ User folder is the only one that is really needed to guarantee both read and wri
|
|||||||
The content that users should not be touching.
|
The content that users should not be touching.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined (ANDROID)
|
#ifndef PSP
|
||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
#endif //ANDROID
|
#endif //PSP
|
||||||
|
|
||||||
#if defined (LINUX)
|
|
||||||
#include "../../projects/mtg/include/PrecompiledHeader.h"
|
|
||||||
#endif //LINUX
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#pragma warning(disable : 4786)
|
#pragma warning(disable : 4786)
|
||||||
@@ -43,12 +38,6 @@ The content that users should not be touching.
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
#ifdef IOS
|
|
||||||
#include <Foundation/Foundation.h>
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
|
|
||||||
JFileSystem* JFileSystem::mInstance = NULL;
|
JFileSystem* JFileSystem::mInstance = NULL;
|
||||||
|
|
||||||
JZipCache::JZipCache()
|
JZipCache::JZipCache()
|
||||||
|
|||||||
@@ -249,7 +249,6 @@ u32 JGE::BindKey(LocalKeySym sym, JButton button)
|
|||||||
u32 JGE::UnbindKey(LocalKeySym sym, JButton button)
|
u32 JGE::UnbindKey(LocalKeySym sym, JButton button)
|
||||||
{
|
{
|
||||||
for (keycodes_it it = keyBinds.begin(); it != keyBinds.end(); )
|
for (keycodes_it it = keyBinds.begin(); it != keyBinds.end(); )
|
||||||
{
|
|
||||||
if (sym == it->first && button == it->second)
|
if (sym == it->first && button == it->second)
|
||||||
{
|
{
|
||||||
keycodes_it er = it;
|
keycodes_it er = it;
|
||||||
@@ -257,8 +256,7 @@ u32 JGE::UnbindKey(LocalKeySym sym, JButton button)
|
|||||||
keyBinds.erase(er);
|
keyBinds.erase(er);
|
||||||
}
|
}
|
||||||
else ++it;
|
else ++it;
|
||||||
}
|
return keyBinds.size();
|
||||||
return keyBinds.size();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 JGE::UnbindKey(LocalKeySym sym)
|
u32 JGE::UnbindKey(LocalKeySym sym)
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ bool JSpline::Load(const char *filename, float xscale, float yscale)
|
|||||||
element->QueryFloatAttribute("x", &xx);
|
element->QueryFloatAttribute("x", &xx);
|
||||||
element->QueryFloatAttribute("y", &yy);
|
element->QueryFloatAttribute("y", &yy);
|
||||||
|
|
||||||
JPoint pt(xx*xscale, yy*yscale);
|
Point pt(xx*xscale, yy*yscale);
|
||||||
AddControlPoint(pt);
|
AddControlPoint(pt);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ bool JSpline::Load(const char *filename, float xscale, float yscale)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void JSpline::PointOnCurve(JPoint &out, float t, const JPoint &p0, const JPoint &p1, const JPoint &p2, const JPoint &p3)
|
void JSpline::PointOnCurve(Point &out, float t, const Point &p0, const Point &p1, const Point &p2, const Point &p3)
|
||||||
{
|
{
|
||||||
float t2 = t * t;
|
float t2 = t * t;
|
||||||
float t3 = t2 * t;
|
float t3 = t2 * t;
|
||||||
@@ -113,8 +113,8 @@ void JSpline::GeneratePixels()
|
|||||||
x = mMidPoints[1].x;
|
x = mMidPoints[1].x;
|
||||||
y = mMidPoints[1].y;
|
y = mMidPoints[1].y;
|
||||||
|
|
||||||
JPoint newPt(x, y);
|
Point newPt(x, y);
|
||||||
JPoint extraPt;
|
Point extraPt;
|
||||||
|
|
||||||
mPixels.push_back(newPt);
|
mPixels.push_back(newPt);
|
||||||
|
|
||||||
@@ -151,13 +151,13 @@ void JSpline::GeneratePixels()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSpline::AddControlPoint(const JPoint &pt)
|
void JSpline::AddControlPoint(const Point &pt)
|
||||||
{
|
{
|
||||||
mMidPoints.push_back(pt);
|
mMidPoints.push_back(pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSpline::GetControlPoint(JPoint &point, int index)
|
void JSpline::GetControlPoint(Point &point, int index)
|
||||||
{
|
{
|
||||||
if (index < (int)mMidPoints.size())
|
if (index < (int)mMidPoints.size())
|
||||||
{
|
{
|
||||||
@@ -167,7 +167,7 @@ void JSpline::GetControlPoint(JPoint &point, int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSpline::GetPixel(JPoint &point, int index)
|
void JSpline::GetPixel(Point &point, int index)
|
||||||
{
|
{
|
||||||
if (index < (int)mPixels.size())
|
if (index < (int)mPixels.size())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ WagicWrapper::~WagicWrapper()
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
QCoreApplication a(argc, argv);
|
||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
WagicWrapper* wagicCore = new WagicWrapper();
|
WagicWrapper* wagicCore = new WagicWrapper();
|
||||||
MTGCollection()->loadFolder("sets/primitives/");
|
MTGCollection()->loadFolder("sets/primitives/");
|
||||||
|
|||||||
@@ -293,18 +293,17 @@ static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[]
|
|||||||
{ SDLK_DOWN, JGE_BTN_DOWN },
|
{ SDLK_DOWN, JGE_BTN_DOWN },
|
||||||
{ SDLK_LEFT, JGE_BTN_LEFT },
|
{ SDLK_LEFT, JGE_BTN_LEFT },
|
||||||
{ SDLK_RIGHT, JGE_BTN_RIGHT },
|
{ SDLK_RIGHT, JGE_BTN_RIGHT },
|
||||||
{ SDLK_w, JGE_BTN_UP },
|
{ SDLK_z, JGE_BTN_UP },
|
||||||
{ SDLK_s, JGE_BTN_DOWN },
|
|
||||||
{ SDLK_a, JGE_BTN_LEFT },
|
|
||||||
{ SDLK_d, JGE_BTN_RIGHT },
|
{ SDLK_d, JGE_BTN_RIGHT },
|
||||||
{ SDLK_q, JGE_BTN_PREV },
|
{ SDLK_s, JGE_BTN_DOWN },
|
||||||
|
{ SDLK_q, JGE_BTN_LEFT },
|
||||||
|
{ SDLK_a, JGE_BTN_PREV },
|
||||||
{ SDLK_e, JGE_BTN_NEXT },
|
{ SDLK_e, JGE_BTN_NEXT },
|
||||||
{ SDLK_i, JGE_BTN_CANCEL },
|
{ SDLK_i, JGE_BTN_CANCEL },
|
||||||
{ SDLK_l, JGE_BTN_OK },
|
{ SDLK_l, JGE_BTN_OK },
|
||||||
{ SDLK_SPACE, JGE_BTN_OK },
|
{ SDLK_SPACE, JGE_BTN_OK },
|
||||||
{ SDLK_k, JGE_BTN_SEC },
|
{ SDLK_k, JGE_BTN_SEC },
|
||||||
{ SDLK_j, JGE_BTN_PRI },
|
{ SDLK_j, JGE_BTN_PRI },
|
||||||
{ SDLK_b, JGE_BTN_SOUND },
|
|
||||||
{ SDLK_f, JGE_BTN_FULLSCREEN },
|
{ SDLK_f, JGE_BTN_FULLSCREEN },
|
||||||
|
|
||||||
/* old Qt ones, basically modified to comply with the N900 keyboard
|
/* old Qt ones, basically modified to comply with the N900 keyboard
|
||||||
|
|||||||
@@ -185,9 +185,9 @@ static const int doubleBufferAttributes[] = {
|
|||||||
GLX_RED_SIZE, 1, /* the maximum number of bits per component */
|
GLX_RED_SIZE, 1, /* the maximum number of bits per component */
|
||||||
GLX_GREEN_SIZE, 1,
|
GLX_GREEN_SIZE, 1,
|
||||||
GLX_BLUE_SIZE, 1,
|
GLX_BLUE_SIZE, 1,
|
||||||
0L /* None */
|
None
|
||||||
};
|
};
|
||||||
static int WaitForNotify(Display *dpy, XEvent *event, XPointer arg)
|
static Bool WaitForNotify(Display *dpy, XEvent *event, XPointer arg)
|
||||||
{
|
{
|
||||||
return (event->type == MapNotify) && (event->xmap.window == (Window) arg);
|
return (event->type == MapNotify) && (event->xmap.window == (Window) arg);
|
||||||
}
|
}
|
||||||
@@ -387,13 +387,13 @@ int main(int argc, char* argv[])
|
|||||||
if (XCheckWindowEvent(gXDisplay, gXWindow, KeyPressMask | KeyReleaseMask | StructureNotifyMask, &event))
|
if (XCheckWindowEvent(gXDisplay, gXWindow, KeyPressMask | KeyReleaseMask | StructureNotifyMask, &event))
|
||||||
switch (event.type)
|
switch (event.type)
|
||||||
{
|
{
|
||||||
case 2: /* KeyPress */
|
case KeyPress:
|
||||||
{
|
{
|
||||||
const KeySym sym = XKeycodeToKeysym(gXDisplay, event.xkey.keycode, 1);
|
const KeySym sym = XKeycodeToKeysym(gXDisplay, event.xkey.keycode, 1);
|
||||||
g_engine->HoldKey_NoRepeat(sym);
|
g_engine->HoldKey_NoRepeat(sym);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3: /* KeyRelease */
|
case KeyRelease:
|
||||||
g_engine->ReleaseKey(XKeycodeToKeysym(gXDisplay, event.xkey.keycode, 1));
|
g_engine->ReleaseKey(XKeycodeToKeysym(gXDisplay, event.xkey.keycode, 1));
|
||||||
break;
|
break;
|
||||||
case ConfigureNotify:
|
case ConfigureNotify:
|
||||||
|
|||||||
@@ -10,6 +10,5 @@ void resumeGame();
|
|||||||
@property (nonatomic, retain) id eaglView;
|
@property (nonatomic, retain) id eaglView;
|
||||||
@property (nonatomic, retain) UITextField *inputField;
|
@property (nonatomic, retain) UITextField *inputField;
|
||||||
@property (nonatomic, assign) BOOL bannerIsVisible;
|
@property (nonatomic, assign) BOOL bannerIsVisible;
|
||||||
- (void)toggleKeyboardWithState: (NSString *) initialText;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -53,28 +53,28 @@
|
|||||||
|
|
||||||
- (void)viewWillAppear:(BOOL)animated {
|
- (void)viewWillAppear:(BOOL)animated {
|
||||||
NSLog(@"EAGL ViewController - view Will Appear");
|
NSLog(@"EAGL ViewController - view Will Appear");
|
||||||
[(id)self.view resumeGame];
|
[self.view resumeGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)viewWillDisappear:(BOOL)animated
|
- (void)viewWillDisappear:(BOOL)animated
|
||||||
{
|
{
|
||||||
[(id)self.view pauseGame];
|
[self.view pauseGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)pauseGame
|
- (void)pauseGame
|
||||||
{
|
{
|
||||||
[(id)self.view pauseGame];
|
[self.view pauseGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)resumeGame
|
- (void)resumeGame
|
||||||
{
|
{
|
||||||
[(id)self.view resumeGame];
|
[self.view resumeGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)endGame
|
- (void)endGame
|
||||||
{
|
{
|
||||||
[(id)self.view endGame];
|
[self.view endGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidAppear:(BOOL)animated {
|
- (void)viewDidAppear:(BOOL)animated {
|
||||||
|
|||||||
@@ -337,7 +337,7 @@
|
|||||||
|
|
||||||
- (void)applicationWillTerminate:(UIApplication *)application
|
- (void)applicationWillTerminate:(UIApplication *)application
|
||||||
{
|
{
|
||||||
[(id)self.glViewController.view destroyGame];
|
[self.glViewController.view destroyGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)initializeKeyboard: (id) initialState
|
- (void)initializeKeyboard: (id) initialState
|
||||||
|
|||||||
@@ -1804,7 +1804,7 @@ static void PNGCustomReadDataFn(png_structp png_ptr, png_bytep data, png_size_t
|
|||||||
{
|
{
|
||||||
png_size_t check;
|
png_size_t check;
|
||||||
|
|
||||||
JFileSystem *fileSystem = (JFileSystem*)png_get_io_ptr(png_ptr);
|
JFileSystem *fileSystem = (JFileSystem*)png_ptr->io_ptr;
|
||||||
|
|
||||||
check = fileSystem->ReadFile(data, length);
|
check = fileSystem->ReadFile(data, length);
|
||||||
|
|
||||||
@@ -1887,7 +1887,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
|
|||||||
//fclose(fp);
|
//fclose(fp);
|
||||||
fileSystem->CloseFile();
|
fileSystem->CloseFile();
|
||||||
|
|
||||||
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
|
||||||
|
|
||||||
return JGE_ERR_PNG;
|
return JGE_ERR_PNG;
|
||||||
}
|
}
|
||||||
@@ -1896,15 +1896,11 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
|
|||||||
|
|
||||||
png_set_sig_bytes(png_ptr, sig_read);
|
png_set_sig_bytes(png_ptr, sig_read);
|
||||||
png_read_info(png_ptr, info_ptr);
|
png_read_info(png_ptr, info_ptr);
|
||||||
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL);
|
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, int_p_NULL, int_p_NULL);
|
||||||
png_set_strip_16(png_ptr);
|
png_set_strip_16(png_ptr);
|
||||||
png_set_packing(png_ptr);
|
png_set_packing(png_ptr);
|
||||||
if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png_ptr);
|
if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png_ptr);
|
||||||
#if PNG_LIBPNG_VER >= 10400
|
|
||||||
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr);
|
|
||||||
#else
|
|
||||||
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr);
|
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr);
|
||||||
#endif
|
|
||||||
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);
|
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);
|
||||||
png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
|
png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
|
||||||
|
|
||||||
@@ -1914,7 +1910,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
|
|||||||
//fclose(fp);
|
//fclose(fp);
|
||||||
fileSystem->CloseFile();
|
fileSystem->CloseFile();
|
||||||
|
|
||||||
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
|
||||||
return JGE_ERR_MALLOC_FAILED;
|
return JGE_ERR_MALLOC_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1936,7 +1932,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
|
|||||||
|
|
||||||
for (y = 0; y < (int)height; y++)
|
for (y = 0; y < (int)height; y++)
|
||||||
{
|
{
|
||||||
png_read_row(png_ptr, (BYTE*) line, NULL);
|
png_read_row(png_ptr, (BYTE*) line, png_bytep_NULL);
|
||||||
for (x = 0; x < (int)width; x++)
|
for (x = 0; x < (int)width; x++)
|
||||||
{
|
{
|
||||||
DWORD color32 = line[x];
|
DWORD color32 = line[x];
|
||||||
@@ -1959,7 +1955,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
|
|||||||
free (line);
|
free (line);
|
||||||
|
|
||||||
png_read_end(png_ptr, info_ptr);
|
png_read_end(png_ptr, info_ptr);
|
||||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
|
||||||
|
|
||||||
fileSystem->CloseFile();
|
fileSystem->CloseFile();
|
||||||
|
|
||||||
@@ -2002,15 +1998,8 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
GifFileType *GifFileIn = NULL;
|
GifFileType *GifFileIn = NULL;
|
||||||
ColorMapObject *palette;
|
ColorMapObject *palette;
|
||||||
int ExtCode;
|
int ExtCode;
|
||||||
|
|
||||||
#if GIFLIB_MAJOR >= 5
|
|
||||||
if ((GifFileIn = DGifOpen(handle, readFunc, NULL)) == NULL)
|
|
||||||
return 1;
|
|
||||||
#else
|
|
||||||
if ((GifFileIn = DGifOpen(handle, readFunc)) == NULL)
|
if ((GifFileIn = DGifOpen(handle, readFunc)) == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
|
||||||
|
|
||||||
*bgcolor = 0;
|
*bgcolor = 0;
|
||||||
textureInfo.mWidth = 0;
|
textureInfo.mWidth = 0;
|
||||||
textureInfo.mHeight = 0;
|
textureInfo.mHeight = 0;
|
||||||
@@ -2019,11 +2008,7 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
do {
|
do {
|
||||||
if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR)
|
if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR)
|
||||||
{
|
{
|
||||||
#if GIFLIB_MAJOR >= 5
|
|
||||||
DGifCloseFile(GifFileIn, NULL);
|
|
||||||
#else
|
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
#endif
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2032,20 +2017,12 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
{
|
{
|
||||||
if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
|
if (DGifGetImageDesc(GifFileIn) == GIF_ERROR)
|
||||||
{
|
{
|
||||||
#if GIFLIB_MAJOR >= 5
|
|
||||||
DGifCloseFile(GifFileIn, NULL);
|
|
||||||
#else
|
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
#endif
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if((palette = (GifFileIn->SColorMap != NULL) ? GifFileIn->SColorMap : GifFileIn->Image.ColorMap) == NULL)
|
if((palette = (GifFileIn->SColorMap != NULL) ? GifFileIn->SColorMap : GifFileIn->Image.ColorMap) == NULL)
|
||||||
{
|
{
|
||||||
#if GIFLIB_MAJOR >= 5
|
|
||||||
DGifCloseFile(GifFileIn, NULL);
|
|
||||||
#else
|
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
#endif
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
textureInfo.mWidth = GifFileIn->Image.Width;
|
textureInfo.mWidth = GifFileIn->Image.Width;
|
||||||
@@ -2053,11 +2030,7 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
*bgcolor = gif_color32(GifFileIn->SBackGroundColor);
|
*bgcolor = gif_color32(GifFileIn->SBackGroundColor);
|
||||||
if((LineIn = (GifRowType) malloc(GifFileIn->Image.Width * sizeof(GifPixelType))) == NULL)
|
if((LineIn = (GifRowType) malloc(GifFileIn->Image.Width * sizeof(GifPixelType))) == NULL)
|
||||||
{
|
{
|
||||||
#if GIFLIB_MAJOR >= 5
|
|
||||||
DGifCloseFile(GifFileIn, NULL);
|
|
||||||
#else
|
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
#endif
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
textureInfo.mTexWidth = getNextPower2(GifFileIn->Image.Width);
|
textureInfo.mTexWidth = getNextPower2(GifFileIn->Image.Width);
|
||||||
@@ -2067,11 +2040,7 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
if((p32 = (DWORD *)malloc(sizeof(PIXEL_TYPE) * textureInfo.mTexWidth * textureInfo.mTexHeight)) == NULL)
|
if((p32 = (DWORD *)malloc(sizeof(PIXEL_TYPE) * textureInfo.mTexWidth * textureInfo.mTexHeight)) == NULL)
|
||||||
{
|
{
|
||||||
free((void *)LineIn);
|
free((void *)LineIn);
|
||||||
#if GIFLIB_MAJOR >= 5
|
|
||||||
DGifCloseFile(GifFileIn, NULL);
|
|
||||||
#else
|
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
#endif
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
DWORD * curr = p32;
|
DWORD * curr = p32;
|
||||||
@@ -2083,11 +2052,7 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
{
|
{
|
||||||
free((void *)p32);
|
free((void *)p32);
|
||||||
free((void *)LineIn);
|
free((void *)LineIn);
|
||||||
#if GIFLIB_MAJOR >= 5
|
|
||||||
DGifCloseFile(GifFileIn, NULL);
|
|
||||||
#else
|
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
#endif
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
for (GifWord j = 0; j < GifFileIn->Image.Width; j ++)
|
for (GifWord j = 0; j < GifFileIn->Image.Width; j ++)
|
||||||
@@ -2116,11 +2081,7 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
}
|
}
|
||||||
if(LineIn != NULL)
|
if(LineIn != NULL)
|
||||||
free((void *)LineIn);
|
free((void *)LineIn);
|
||||||
#if GIFLIB_MAJOR >= 5
|
|
||||||
DGifCloseFile(GifFileIn, NULL);
|
|
||||||
#else
|
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
#endif
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
while (Extension != NULL) {
|
while (Extension != NULL) {
|
||||||
@@ -2133,11 +2094,7 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
}
|
}
|
||||||
if(LineIn != NULL)
|
if(LineIn != NULL)
|
||||||
free((void *)LineIn);
|
free((void *)LineIn);
|
||||||
#if GIFLIB_MAJOR >= 5
|
|
||||||
DGifCloseFile(GifFileIn, NULL);
|
|
||||||
#else
|
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
#endif
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2152,11 +2109,7 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
|
|||||||
|
|
||||||
if(LineIn != NULL)
|
if(LineIn != NULL)
|
||||||
free((void *)LineIn);
|
free((void *)LineIn);
|
||||||
#if GIFLIB_MAJOR >= 5
|
|
||||||
DGifCloseFile(GifFileIn, NULL);
|
|
||||||
#else
|
|
||||||
DGifCloseFile(GifFileIn);
|
DGifCloseFile(GifFileIn);
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,9 @@ void JMusic::seekAtTheBegining()
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
JSample::JSample()
|
JSample::JSample()
|
||||||
#ifdef USE_PHONON
|
#ifdef QT_CONFIG
|
||||||
|
: effect(0)
|
||||||
|
#elif (defined USE_PHONON)
|
||||||
: mOutput(0), mMediaObject(0)
|
: mOutput(0), mMediaObject(0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@@ -77,9 +79,11 @@ JSample::JSample()
|
|||||||
JSample::~JSample()
|
JSample::~JSample()
|
||||||
{
|
{
|
||||||
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||||
if(effect)
|
if(effect) {
|
||||||
delete effect;
|
delete effect;
|
||||||
#elif USE_PHONON
|
effect = 0;
|
||||||
|
}
|
||||||
|
#elif (defined USE_PHONON)
|
||||||
if(mOutput)
|
if(mOutput)
|
||||||
delete mOutput;
|
delete mOutput;
|
||||||
if(mMediaObject)
|
if(mMediaObject)
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#elif LINUX
|
#elif LINUX
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|||||||
@@ -87,13 +87,13 @@ static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned lon
|
|||||||
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
|
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
static int crypthead(
|
static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
|
||||||
const char *passwd, /* password string */
|
const char *passwd; /* password string */
|
||||||
unsigned char *buf, /* where to write header */
|
unsigned char *buf; /* where to write header */
|
||||||
int bufSize,
|
int bufSize;
|
||||||
unsigned long* pkeys,
|
unsigned long* pkeys;
|
||||||
const unsigned long* pcrc_32_tab,
|
const unsigned long* pcrc_32_tab;
|
||||||
unsigned long crcForCrypting)
|
unsigned long crcForCrypting;
|
||||||
{
|
{
|
||||||
int n; /* index in random header */
|
int n; /* index in random header */
|
||||||
int t; /* temporary */
|
int t; /* temporary */
|
||||||
|
|||||||
@@ -65,10 +65,10 @@ int ZCALLBACK ferror_file_func OF((
|
|||||||
voidpf stream));
|
voidpf stream));
|
||||||
|
|
||||||
|
|
||||||
voidpf ZCALLBACK fopen_file_func (
|
voidpf ZCALLBACK fopen_file_func (opaque, filename, mode)
|
||||||
voidpf opaque,
|
voidpf opaque;
|
||||||
const char* filename,
|
const char* filename;
|
||||||
int mode)
|
int mode;
|
||||||
{
|
{
|
||||||
FILE* file = NULL;
|
FILE* file = NULL;
|
||||||
const char* mode_fopen = NULL;
|
const char* mode_fopen = NULL;
|
||||||
@@ -87,11 +87,11 @@ voidpf ZCALLBACK fopen_file_func (
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uLong ZCALLBACK fread_file_func (
|
uLong ZCALLBACK fread_file_func (opaque, stream, buf, size)
|
||||||
voidpf opaque,
|
voidpf opaque;
|
||||||
voidpf stream,
|
voidpf stream;
|
||||||
void* buf,
|
void* buf;
|
||||||
uLong size)
|
uLong size;
|
||||||
{
|
{
|
||||||
uLong ret;
|
uLong ret;
|
||||||
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
|
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
|
||||||
@@ -99,31 +99,31 @@ uLong ZCALLBACK fread_file_func (
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uLong ZCALLBACK fwrite_file_func (
|
uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size)
|
||||||
voidpf opaque,
|
voidpf opaque;
|
||||||
voidpf stream,
|
voidpf stream;
|
||||||
const void* buf,
|
const void* buf;
|
||||||
uLong size)
|
uLong size;
|
||||||
{
|
{
|
||||||
uLong ret;
|
uLong ret;
|
||||||
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
|
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
long ZCALLBACK ftell_file_func (
|
long ZCALLBACK ftell_file_func (opaque, stream)
|
||||||
voidpf opaque,
|
voidpf opaque;
|
||||||
voidpf stream)
|
voidpf stream;
|
||||||
{
|
{
|
||||||
long ret;
|
long ret;
|
||||||
ret = ftell((FILE *)stream);
|
ret = ftell((FILE *)stream);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
long ZCALLBACK fseek_file_func (
|
long ZCALLBACK fseek_file_func (opaque, stream, offset, origin)
|
||||||
voidpf opaque,
|
voidpf opaque;
|
||||||
voidpf stream,
|
voidpf stream;
|
||||||
uLong offset,
|
uLong offset;
|
||||||
int origin)
|
int origin;
|
||||||
{
|
{
|
||||||
int fseek_origin=0;
|
int fseek_origin=0;
|
||||||
long ret;
|
long ret;
|
||||||
@@ -145,26 +145,26 @@ long ZCALLBACK fseek_file_func (
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZCALLBACK fclose_file_func (
|
int ZCALLBACK fclose_file_func (opaque, stream)
|
||||||
voidpf opaque,
|
voidpf opaque;
|
||||||
voidpf stream)
|
voidpf stream;
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
ret = fclose((FILE *)stream);
|
ret = fclose((FILE *)stream);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZCALLBACK ferror_file_func (
|
int ZCALLBACK ferror_file_func (opaque, stream)
|
||||||
voidpf opaque,
|
voidpf opaque;
|
||||||
voidpf stream)
|
voidpf stream;
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
ret = ferror((FILE *)stream);
|
ret = ferror((FILE *)stream);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fill_fopen_filefunc (
|
void fill_fopen_filefunc (pzlib_filefunc_def)
|
||||||
zlib_filefunc_def* pzlib_filefunc_def)
|
zlib_filefunc_def* pzlib_filefunc_def;
|
||||||
{
|
{
|
||||||
pzlib_filefunc_def->zopen_file = fopen_file_func;
|
pzlib_filefunc_def->zopen_file = fopen_file_func;
|
||||||
pzlib_filefunc_def->zread_file = fread_file_func;
|
pzlib_filefunc_def->zread_file = fread_file_func;
|
||||||
|
|||||||
@@ -168,7 +168,10 @@ local int unzlocal_getByte OF((
|
|||||||
voidpf filestream,
|
voidpf filestream,
|
||||||
int *pi));
|
int *pi));
|
||||||
|
|
||||||
local int unzlocal_getByte(const zlib_filefunc_def* pzlib_filefunc_def,voidpf filestream,int *pi)
|
local int unzlocal_getByte(pzlib_filefunc_def,filestream,pi)
|
||||||
|
const zlib_filefunc_def* pzlib_filefunc_def;
|
||||||
|
voidpf filestream;
|
||||||
|
int *pi;
|
||||||
{
|
{
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1);
|
int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1);
|
||||||
@@ -195,7 +198,10 @@ local int unzlocal_getShort OF((
|
|||||||
voidpf filestream,
|
voidpf filestream,
|
||||||
uLong *pX));
|
uLong *pX));
|
||||||
|
|
||||||
local int unzlocal_getShort (const zlib_filefunc_def* pzlib_filefunc_def,voidpf filestream,uLong *pX)
|
local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX)
|
||||||
|
const zlib_filefunc_def* pzlib_filefunc_def;
|
||||||
|
voidpf filestream;
|
||||||
|
uLong *pX;
|
||||||
{
|
{
|
||||||
uLong x ;
|
uLong x ;
|
||||||
int i;
|
int i;
|
||||||
@@ -220,7 +226,10 @@ local int unzlocal_getLong OF((
|
|||||||
voidpf filestream,
|
voidpf filestream,
|
||||||
uLong *pX));
|
uLong *pX));
|
||||||
|
|
||||||
local int unzlocal_getLong (const zlib_filefunc_def* pzlib_filefunc_def,voidpf filestream,uLong *pX)
|
local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX)
|
||||||
|
const zlib_filefunc_def* pzlib_filefunc_def;
|
||||||
|
voidpf filestream;
|
||||||
|
uLong *pX;
|
||||||
{
|
{
|
||||||
uLong x ;
|
uLong x ;
|
||||||
int i;
|
int i;
|
||||||
@@ -250,7 +259,9 @@ local int unzlocal_getLong (const zlib_filefunc_def* pzlib_filefunc_def,voidpf f
|
|||||||
|
|
||||||
|
|
||||||
/* My own strcmpi / strcasecmp */
|
/* My own strcmpi / strcasecmp */
|
||||||
local int strcmpcasenosensitive_internal (const char* fileName1,const char* fileName2)
|
local int strcmpcasenosensitive_internal (fileName1,fileName2)
|
||||||
|
const char* fileName1;
|
||||||
|
const char* fileName2;
|
||||||
{
|
{
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
@@ -291,7 +302,10 @@ local int strcmpcasenosensitive_internal (const char* fileName1,const char* file
|
|||||||
(like 1 on Unix, 2 on Windows)
|
(like 1 on Unix, 2 on Windows)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
extern int ZEXPORT unzStringFileNameCompare (const char* fileName1,const char* fileName2,int iCaseSensitivity)
|
extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity)
|
||||||
|
const char* fileName1;
|
||||||
|
const char* fileName2;
|
||||||
|
int iCaseSensitivity;
|
||||||
{
|
{
|
||||||
if (iCaseSensitivity==0)
|
if (iCaseSensitivity==0)
|
||||||
iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE;
|
iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE;
|
||||||
@@ -314,7 +328,9 @@ local uLong unzlocal_SearchCentralDir OF((
|
|||||||
const zlib_filefunc_def* pzlib_filefunc_def,
|
const zlib_filefunc_def* pzlib_filefunc_def,
|
||||||
voidpf filestream));
|
voidpf filestream));
|
||||||
|
|
||||||
local uLong unzlocal_SearchCentralDir(const zlib_filefunc_def* pzlib_filefunc_def,voidpf filestream)
|
local uLong unzlocal_SearchCentralDir(pzlib_filefunc_def,filestream)
|
||||||
|
const zlib_filefunc_def* pzlib_filefunc_def;
|
||||||
|
voidpf filestream;
|
||||||
{
|
{
|
||||||
unsigned char* buf;
|
unsigned char* buf;
|
||||||
uLong uSizeFile;
|
uLong uSizeFile;
|
||||||
@@ -378,7 +394,9 @@ local uLong unzlocal_SearchCentralDir(const zlib_filefunc_def* pzlib_filefunc_de
|
|||||||
Else, the return value is a unzFile Handle, usable with other function
|
Else, the return value is a unzFile Handle, usable with other function
|
||||||
of this unzip package.
|
of this unzip package.
|
||||||
*/
|
*/
|
||||||
extern unzFile ZEXPORT unzOpen2 (const char *path, zlib_filefunc_def* pzlib_filefunc_def)
|
extern unzFile ZEXPORT unzOpen2 (path, pzlib_filefunc_def)
|
||||||
|
const char *path;
|
||||||
|
zlib_filefunc_def* pzlib_filefunc_def;
|
||||||
{
|
{
|
||||||
unz_s us;
|
unz_s us;
|
||||||
unz_s *s;
|
unz_s *s;
|
||||||
@@ -479,7 +497,8 @@ extern unzFile ZEXPORT unzOpen2 (const char *path, zlib_filefunc_def* pzlib_file
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern unzFile ZEXPORT unzOpen (const char *path)
|
extern unzFile ZEXPORT unzOpen (path)
|
||||||
|
const char *path;
|
||||||
{
|
{
|
||||||
return unzOpen2(path, NULL);
|
return unzOpen2(path, NULL);
|
||||||
}
|
}
|
||||||
@@ -489,7 +508,8 @@ extern unzFile ZEXPORT unzOpen (const char *path)
|
|||||||
If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
|
If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
|
||||||
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
|
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
|
||||||
return UNZ_OK if there is no problem. */
|
return UNZ_OK if there is no problem. */
|
||||||
extern int ZEXPORT unzClose (unzFile file)
|
extern int ZEXPORT unzClose (file)
|
||||||
|
unzFile file;
|
||||||
{
|
{
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
if (file==NULL)
|
if (file==NULL)
|
||||||
@@ -509,7 +529,9 @@ extern int ZEXPORT unzClose (unzFile file)
|
|||||||
Write info about the ZipFile in the *pglobal_info structure.
|
Write info about the ZipFile in the *pglobal_info structure.
|
||||||
No preparation of the structure is needed
|
No preparation of the structure is needed
|
||||||
return UNZ_OK if there is no problem. */
|
return UNZ_OK if there is no problem. */
|
||||||
extern int ZEXPORT unzGetGlobalInfo (unzFile file,unz_global_info *pglobal_info)
|
extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info)
|
||||||
|
unzFile file;
|
||||||
|
unz_global_info *pglobal_info;
|
||||||
{
|
{
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
if (file==NULL)
|
if (file==NULL)
|
||||||
@@ -523,7 +545,9 @@ extern int ZEXPORT unzGetGlobalInfo (unzFile file,unz_global_info *pglobal_info)
|
|||||||
/*
|
/*
|
||||||
Translate date/time from Dos format to tm_unz (readable more easilty)
|
Translate date/time from Dos format to tm_unz (readable more easilty)
|
||||||
*/
|
*/
|
||||||
local void unzlocal_DosDateToTmuDate (uLong ulDosDate, tm_unz* ptm)
|
local void unzlocal_DosDateToTmuDate (ulDosDate, ptm)
|
||||||
|
uLong ulDosDate;
|
||||||
|
tm_unz* ptm;
|
||||||
{
|
{
|
||||||
uLong uDate;
|
uLong uDate;
|
||||||
uDate = (uLong)(ulDosDate>>16);
|
uDate = (uLong)(ulDosDate>>16);
|
||||||
@@ -550,16 +574,21 @@ local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file,
|
|||||||
char *szComment,
|
char *szComment,
|
||||||
uLong commentBufferSize));
|
uLong commentBufferSize));
|
||||||
|
|
||||||
local int unzlocal_GetCurrentFileInfoInternal (
|
local int unzlocal_GetCurrentFileInfoInternal (file,
|
||||||
unzFile file,
|
pfile_info,
|
||||||
unz_file_info *pfile_info,
|
pfile_info_internal,
|
||||||
unz_file_info_internal *pfile_info_internal,
|
szFileName, fileNameBufferSize,
|
||||||
char *szFileName,
|
extraField, extraFieldBufferSize,
|
||||||
uLong fileNameBufferSize,
|
szComment, commentBufferSize)
|
||||||
void *extraField,
|
unzFile file;
|
||||||
uLong extraFieldBufferSize,
|
unz_file_info *pfile_info;
|
||||||
char *szComment,
|
unz_file_info_internal *pfile_info_internal;
|
||||||
uLong commentBufferSize)
|
char *szFileName;
|
||||||
|
uLong fileNameBufferSize;
|
||||||
|
void *extraField;
|
||||||
|
uLong extraFieldBufferSize;
|
||||||
|
char *szComment;
|
||||||
|
uLong commentBufferSize;
|
||||||
{
|
{
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
unz_file_info file_info;
|
unz_file_info file_info;
|
||||||
@@ -717,15 +746,19 @@ local int unzlocal_GetCurrentFileInfoInternal (
|
|||||||
No preparation of the structure is needed
|
No preparation of the structure is needed
|
||||||
return UNZ_OK if there is no problem.
|
return UNZ_OK if there is no problem.
|
||||||
*/
|
*/
|
||||||
extern int ZEXPORT unzGetCurrentFileInfo (
|
extern int ZEXPORT unzGetCurrentFileInfo (file,
|
||||||
unzFile file,
|
pfile_info,
|
||||||
unz_file_info *pfile_info,
|
szFileName, fileNameBufferSize,
|
||||||
char *szFileName,
|
extraField, extraFieldBufferSize,
|
||||||
uLong fileNameBufferSize,
|
szComment, commentBufferSize)
|
||||||
void *extraField,
|
unzFile file;
|
||||||
uLong extraFieldBufferSize,
|
unz_file_info *pfile_info;
|
||||||
char *szComment,
|
char *szFileName;
|
||||||
uLong commentBufferSize)
|
uLong fileNameBufferSize;
|
||||||
|
void *extraField;
|
||||||
|
uLong extraFieldBufferSize;
|
||||||
|
char *szComment;
|
||||||
|
uLong commentBufferSize;
|
||||||
{
|
{
|
||||||
return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL,
|
return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL,
|
||||||
szFileName,fileNameBufferSize,
|
szFileName,fileNameBufferSize,
|
||||||
@@ -737,7 +770,8 @@ extern int ZEXPORT unzGetCurrentFileInfo (
|
|||||||
Set the current file of the zipfile to the first file.
|
Set the current file of the zipfile to the first file.
|
||||||
return UNZ_OK if there is no problem
|
return UNZ_OK if there is no problem
|
||||||
*/
|
*/
|
||||||
extern int ZEXPORT unzGoToFirstFile (unzFile file)
|
extern int ZEXPORT unzGoToFirstFile (file)
|
||||||
|
unzFile file;
|
||||||
{
|
{
|
||||||
int err=UNZ_OK;
|
int err=UNZ_OK;
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
@@ -758,7 +792,8 @@ extern int ZEXPORT unzGoToFirstFile (unzFile file)
|
|||||||
return UNZ_OK if there is no problem
|
return UNZ_OK if there is no problem
|
||||||
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
|
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
|
||||||
*/
|
*/
|
||||||
extern int ZEXPORT unzGoToNextFile (unzFile file)
|
extern int ZEXPORT unzGoToNextFile (file)
|
||||||
|
unzFile file;
|
||||||
{
|
{
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
int err;
|
int err;
|
||||||
@@ -791,7 +826,10 @@ extern int ZEXPORT unzGoToNextFile (unzFile file)
|
|||||||
UNZ_OK if the file is found. It becomes the current file.
|
UNZ_OK if the file is found. It becomes the current file.
|
||||||
UNZ_END_OF_LIST_OF_FILE if the file is not found
|
UNZ_END_OF_LIST_OF_FILE if the file is not found
|
||||||
*/
|
*/
|
||||||
extern int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity)
|
extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity)
|
||||||
|
unzFile file;
|
||||||
|
const char *szFileName;
|
||||||
|
int iCaseSensitivity;
|
||||||
{
|
{
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
int err;
|
int err;
|
||||||
@@ -867,7 +905,9 @@ typedef struct unz_file_pos_s
|
|||||||
} unz_file_pos;
|
} unz_file_pos;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern int ZEXPORT unzGetFilePos(unzFile file, unz_file_pos* file_pos)
|
extern int ZEXPORT unzGetFilePos(file, file_pos)
|
||||||
|
unzFile file;
|
||||||
|
unz_file_pos* file_pos;
|
||||||
{
|
{
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
|
|
||||||
@@ -883,7 +923,9 @@ extern int ZEXPORT unzGetFilePos(unzFile file, unz_file_pos* file_pos)
|
|||||||
return UNZ_OK;
|
return UNZ_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ZEXPORT unzGoToFilePos(unzFile file, unz_file_pos*file_pos)
|
extern int ZEXPORT unzGoToFilePos(file, file_pos)
|
||||||
|
unzFile file;
|
||||||
|
unz_file_pos* file_pos;
|
||||||
{
|
{
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
int err;
|
int err;
|
||||||
@@ -917,11 +959,13 @@ extern int ZEXPORT unzGoToFilePos(unzFile file, unz_file_pos*file_pos)
|
|||||||
store in *piSizeVar the size of extra info in local header
|
store in *piSizeVar the size of extra info in local header
|
||||||
(filename and size of extra field data)
|
(filename and size of extra field data)
|
||||||
*/
|
*/
|
||||||
local int unzlocal_CheckCurrentFileCoherencyHeader (
|
local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
|
||||||
unz_s* s,
|
poffset_local_extrafield,
|
||||||
uInt* piSizeVar,
|
psize_local_extrafield)
|
||||||
uLong *poffset_local_extrafield,
|
unz_s* s;
|
||||||
uInt *psize_local_extrafield)
|
uInt* piSizeVar;
|
||||||
|
uLong *poffset_local_extrafield;
|
||||||
|
uInt *psize_local_extrafield;
|
||||||
{
|
{
|
||||||
uLong uMagic,uData,uFlags;
|
uLong uMagic,uData,uFlags;
|
||||||
uLong size_filename;
|
uLong size_filename;
|
||||||
@@ -1006,12 +1050,12 @@ local int unzlocal_CheckCurrentFileCoherencyHeader (
|
|||||||
Open for reading data the current file in the zipfile.
|
Open for reading data the current file in the zipfile.
|
||||||
If there is no error and the file is opened, the return value is UNZ_OK.
|
If there is no error and the file is opened, the return value is UNZ_OK.
|
||||||
*/
|
*/
|
||||||
extern int ZEXPORT unzOpenCurrentFile3 (
|
extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password)
|
||||||
unzFile file,
|
unzFile file;
|
||||||
int* method,
|
int* method;
|
||||||
int* level,
|
int* level;
|
||||||
int raw,
|
int raw;
|
||||||
const char* password)
|
const char* password;
|
||||||
{
|
{
|
||||||
int err=UNZ_OK;
|
int err=UNZ_OK;
|
||||||
uInt iSizeVar;
|
uInt iSizeVar;
|
||||||
@@ -1092,7 +1136,7 @@ extern int ZEXPORT unzOpenCurrentFile3 (
|
|||||||
pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
|
pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
|
||||||
pfile_in_zip_read_info->stream.zfree = (free_func)0;
|
pfile_in_zip_read_info->stream.zfree = (free_func)0;
|
||||||
pfile_in_zip_read_info->stream.opaque = (voidpf)0;
|
pfile_in_zip_read_info->stream.opaque = (voidpf)0;
|
||||||
pfile_in_zip_read_info->stream.next_in = (Bytef*)0;
|
pfile_in_zip_read_info->stream.next_in = (voidpf)0;
|
||||||
pfile_in_zip_read_info->stream.avail_in = 0;
|
pfile_in_zip_read_info->stream.avail_in = 0;
|
||||||
|
|
||||||
err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS);
|
err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS);
|
||||||
@@ -1151,21 +1195,24 @@ extern int ZEXPORT unzOpenCurrentFile3 (
|
|||||||
return UNZ_OK;
|
return UNZ_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ZEXPORT unzOpenCurrentFile (unzFile file)
|
extern int ZEXPORT unzOpenCurrentFile (file)
|
||||||
|
unzFile file;
|
||||||
{
|
{
|
||||||
return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL);
|
return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password)
|
extern int ZEXPORT unzOpenCurrentFilePassword (file, password)
|
||||||
|
unzFile file;
|
||||||
|
const char* password;
|
||||||
{
|
{
|
||||||
return unzOpenCurrentFile3(file, NULL, NULL, 0, password);
|
return unzOpenCurrentFile3(file, NULL, NULL, 0, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ZEXPORT unzOpenCurrentFile2 (
|
extern int ZEXPORT unzOpenCurrentFile2 (file,method,level,raw)
|
||||||
unzFile file,
|
unzFile file;
|
||||||
int* method,
|
int* method;
|
||||||
int* level,
|
int* level;
|
||||||
int raw)
|
int raw;
|
||||||
{
|
{
|
||||||
return unzOpenCurrentFile3(file, method, level, raw, NULL);
|
return unzOpenCurrentFile3(file, method, level, raw, NULL);
|
||||||
}
|
}
|
||||||
@@ -1180,10 +1227,10 @@ extern int ZEXPORT unzOpenCurrentFile2 (
|
|||||||
return <0 with error code if there is an error
|
return <0 with error code if there is an error
|
||||||
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
|
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
|
||||||
*/
|
*/
|
||||||
extern int ZEXPORT unzReadCurrentFile(
|
extern int ZEXPORT unzReadCurrentFile (file, buf, len)
|
||||||
unzFile file,
|
unzFile file;
|
||||||
voidp buf,
|
voidp buf;
|
||||||
unsigned len)
|
unsigned len;
|
||||||
{
|
{
|
||||||
int err=UNZ_OK;
|
int err=UNZ_OK;
|
||||||
uInt iRead = 0;
|
uInt iRead = 0;
|
||||||
@@ -1341,7 +1388,8 @@ extern int ZEXPORT unzReadCurrentFile(
|
|||||||
/*
|
/*
|
||||||
Give the current position in uncompressed data
|
Give the current position in uncompressed data
|
||||||
*/
|
*/
|
||||||
extern z_off_t ZEXPORT unztell (unzFile file)
|
extern z_off_t ZEXPORT unztell (file)
|
||||||
|
unzFile file;
|
||||||
{
|
{
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
file_in_zip_read_info_s* pfile_in_zip_read_info;
|
file_in_zip_read_info_s* pfile_in_zip_read_info;
|
||||||
@@ -1360,7 +1408,8 @@ extern z_off_t ZEXPORT unztell (unzFile file)
|
|||||||
/*
|
/*
|
||||||
return 1 if the end of file was reached, 0 elsewhere
|
return 1 if the end of file was reached, 0 elsewhere
|
||||||
*/
|
*/
|
||||||
extern int ZEXPORT unzeof (unzFile file)
|
extern int ZEXPORT unzeof (file)
|
||||||
|
unzFile file;
|
||||||
{
|
{
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
file_in_zip_read_info_s* pfile_in_zip_read_info;
|
file_in_zip_read_info_s* pfile_in_zip_read_info;
|
||||||
@@ -1392,10 +1441,10 @@ extern int ZEXPORT unzeof (unzFile file)
|
|||||||
the return value is the number of bytes copied in buf, or (if <0)
|
the return value is the number of bytes copied in buf, or (if <0)
|
||||||
the error code
|
the error code
|
||||||
*/
|
*/
|
||||||
extern int ZEXPORT unzGetLocalExtrafield (
|
extern int ZEXPORT unzGetLocalExtrafield (file,buf,len)
|
||||||
unzFile file,
|
unzFile file;
|
||||||
voidp buf,
|
voidp buf;
|
||||||
unsigned len)
|
unsigned len;
|
||||||
{
|
{
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
file_in_zip_read_info_s* pfile_in_zip_read_info;
|
file_in_zip_read_info_s* pfile_in_zip_read_info;
|
||||||
@@ -1443,7 +1492,8 @@ extern int ZEXPORT unzGetLocalExtrafield (
|
|||||||
Close the file in zip opened with unzipOpenCurrentFile
|
Close the file in zip opened with unzipOpenCurrentFile
|
||||||
Return UNZ_CRCERROR if all the file was read but the CRC is not good
|
Return UNZ_CRCERROR if all the file was read but the CRC is not good
|
||||||
*/
|
*/
|
||||||
extern int ZEXPORT unzCloseCurrentFile (unzFile file)
|
extern int ZEXPORT unzCloseCurrentFile (file)
|
||||||
|
unzFile file;
|
||||||
{
|
{
|
||||||
int err=UNZ_OK;
|
int err=UNZ_OK;
|
||||||
|
|
||||||
@@ -1485,11 +1535,12 @@ extern int ZEXPORT unzCloseCurrentFile (unzFile file)
|
|||||||
uSizeBuf is the size of the szComment buffer.
|
uSizeBuf is the size of the szComment buffer.
|
||||||
return the number of byte copied or an error code <0
|
return the number of byte copied or an error code <0
|
||||||
*/
|
*/
|
||||||
extern int ZEXPORT unzGetGlobalComment (
|
extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf)
|
||||||
unzFile file,
|
unzFile file;
|
||||||
char *szComment,
|
char *szComment;
|
||||||
uLong uSizeBuf)
|
uLong uSizeBuf;
|
||||||
{
|
{
|
||||||
|
int err=UNZ_OK;
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
uLong uReadThis ;
|
uLong uReadThis ;
|
||||||
if (file==NULL)
|
if (file==NULL)
|
||||||
@@ -1516,7 +1567,8 @@ extern int ZEXPORT unzGetGlobalComment (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Additions by RX '2004 */
|
/* Additions by RX '2004 */
|
||||||
extern uLong ZEXPORT unzGetOffset (unzFile file)
|
extern uLong ZEXPORT unzGetOffset (file)
|
||||||
|
unzFile file;
|
||||||
{
|
{
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
|
|
||||||
@@ -1531,9 +1583,9 @@ extern uLong ZEXPORT unzGetOffset (unzFile file)
|
|||||||
return s->pos_in_central_dir;
|
return s->pos_in_central_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ZEXPORT unzSetOffset (
|
extern int ZEXPORT unzSetOffset (file, pos)
|
||||||
unzFile file,
|
unzFile file;
|
||||||
uLong pos)
|
uLong pos;
|
||||||
{
|
{
|
||||||
unz_s* s;
|
unz_s* s;
|
||||||
int err;
|
int err;
|
||||||
|
|||||||
@@ -172,7 +172,8 @@ local linkedlist_datablock_internal* allocate_new_datablock()
|
|||||||
return ldi;
|
return ldi;
|
||||||
}
|
}
|
||||||
|
|
||||||
local void free_datablock(linkedlist_datablock_internal* ldi)
|
local void free_datablock(ldi)
|
||||||
|
linkedlist_datablock_internal* ldi;
|
||||||
{
|
{
|
||||||
while (ldi!=NULL)
|
while (ldi!=NULL)
|
||||||
{
|
{
|
||||||
@@ -182,24 +183,24 @@ local void free_datablock(linkedlist_datablock_internal* ldi)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local void init_linkedlist(
|
local void init_linkedlist(ll)
|
||||||
linkedlist_data* ll)
|
linkedlist_data* ll;
|
||||||
{
|
{
|
||||||
ll->first_block = ll->last_block = NULL;
|
ll->first_block = ll->last_block = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
local void free_linkedlist(
|
local void free_linkedlist(ll)
|
||||||
linkedlist_data* ll)
|
linkedlist_data* ll;
|
||||||
{
|
{
|
||||||
free_datablock(ll->first_block);
|
free_datablock(ll->first_block);
|
||||||
ll->first_block = ll->last_block = NULL;
|
ll->first_block = ll->last_block = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
local int add_data_in_datablock(
|
local int add_data_in_datablock(ll,buf,len)
|
||||||
linkedlist_data* ll,
|
linkedlist_data* ll;
|
||||||
const void* buf,
|
const void* buf;
|
||||||
uLong len)
|
uLong len;
|
||||||
{
|
{
|
||||||
linkedlist_datablock_internal* ldi;
|
linkedlist_datablock_internal* ldi;
|
||||||
const unsigned char* from_copy;
|
const unsigned char* from_copy;
|
||||||
@@ -262,11 +263,11 @@ local int add_data_in_datablock(
|
|||||||
|
|
||||||
local int ziplocal_putValue OF((const zlib_filefunc_def* pzlib_filefunc_def,
|
local int ziplocal_putValue OF((const zlib_filefunc_def* pzlib_filefunc_def,
|
||||||
voidpf filestream, uLong x, int nbByte));
|
voidpf filestream, uLong x, int nbByte));
|
||||||
local int ziplocal_putValue (
|
local int ziplocal_putValue (pzlib_filefunc_def, filestream, x, nbByte)
|
||||||
const zlib_filefunc_def* pzlib_filefunc_def,
|
const zlib_filefunc_def* pzlib_filefunc_def;
|
||||||
voidpf filestream,
|
voidpf filestream;
|
||||||
uLong x,
|
uLong x;
|
||||||
int nbByte)
|
int nbByte;
|
||||||
{
|
{
|
||||||
unsigned char buf[4];
|
unsigned char buf[4];
|
||||||
int n;
|
int n;
|
||||||
@@ -290,10 +291,10 @@ local int ziplocal_putValue (
|
|||||||
}
|
}
|
||||||
|
|
||||||
local void ziplocal_putValue_inmemory OF((void* dest, uLong x, int nbByte));
|
local void ziplocal_putValue_inmemory OF((void* dest, uLong x, int nbByte));
|
||||||
local void ziplocal_putValue_inmemory (
|
local void ziplocal_putValue_inmemory (dest, x, nbByte)
|
||||||
void* dest,
|
void* dest;
|
||||||
uLong x,
|
uLong x;
|
||||||
int nbByte)
|
int nbByte;
|
||||||
{
|
{
|
||||||
unsigned char* buf=(unsigned char*)dest;
|
unsigned char* buf=(unsigned char*)dest;
|
||||||
int n;
|
int n;
|
||||||
@@ -314,9 +315,9 @@ local void ziplocal_putValue_inmemory (
|
|||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
local uLong ziplocal_TmzDateToDosDate(
|
local uLong ziplocal_TmzDateToDosDate(ptm,dosDate)
|
||||||
const tm_zip* ptm,
|
const tm_zip* ptm;
|
||||||
uLong dosDate)
|
uLong dosDate;
|
||||||
{
|
{
|
||||||
uLong year = (uLong)ptm->tm_year;
|
uLong year = (uLong)ptm->tm_year;
|
||||||
if (year>1980)
|
if (year>1980)
|
||||||
@@ -336,10 +337,10 @@ local int ziplocal_getByte OF((
|
|||||||
voidpf filestream,
|
voidpf filestream,
|
||||||
int *pi));
|
int *pi));
|
||||||
|
|
||||||
local int ziplocal_getByte(
|
local int ziplocal_getByte(pzlib_filefunc_def,filestream,pi)
|
||||||
const zlib_filefunc_def* pzlib_filefunc_def,
|
const zlib_filefunc_def* pzlib_filefunc_def;
|
||||||
voidpf filestream,
|
voidpf filestream;
|
||||||
int *pi)
|
int *pi;
|
||||||
{
|
{
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1);
|
int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1);
|
||||||
@@ -366,10 +367,10 @@ local int ziplocal_getShort OF((
|
|||||||
voidpf filestream,
|
voidpf filestream,
|
||||||
uLong *pX));
|
uLong *pX));
|
||||||
|
|
||||||
local int ziplocal_getShort (
|
local int ziplocal_getShort (pzlib_filefunc_def,filestream,pX)
|
||||||
const zlib_filefunc_def* pzlib_filefunc_def,
|
const zlib_filefunc_def* pzlib_filefunc_def;
|
||||||
voidpf filestream,
|
voidpf filestream;
|
||||||
uLong *pX)
|
uLong *pX;
|
||||||
{
|
{
|
||||||
uLong x ;
|
uLong x ;
|
||||||
int i;
|
int i;
|
||||||
@@ -394,10 +395,10 @@ local int ziplocal_getLong OF((
|
|||||||
voidpf filestream,
|
voidpf filestream,
|
||||||
uLong *pX));
|
uLong *pX));
|
||||||
|
|
||||||
local int ziplocal_getLong (
|
local int ziplocal_getLong (pzlib_filefunc_def,filestream,pX)
|
||||||
const zlib_filefunc_def* pzlib_filefunc_def,
|
const zlib_filefunc_def* pzlib_filefunc_def;
|
||||||
voidpf filestream,
|
voidpf filestream;
|
||||||
uLong *pX)
|
uLong *pX;
|
||||||
{
|
{
|
||||||
uLong x ;
|
uLong x ;
|
||||||
int i;
|
int i;
|
||||||
@@ -436,9 +437,9 @@ local uLong ziplocal_SearchCentralDir OF((
|
|||||||
const zlib_filefunc_def* pzlib_filefunc_def,
|
const zlib_filefunc_def* pzlib_filefunc_def,
|
||||||
voidpf filestream));
|
voidpf filestream));
|
||||||
|
|
||||||
local uLong ziplocal_SearchCentralDir(
|
local uLong ziplocal_SearchCentralDir(pzlib_filefunc_def,filestream)
|
||||||
const zlib_filefunc_def* pzlib_filefunc_def,
|
const zlib_filefunc_def* pzlib_filefunc_def;
|
||||||
voidpf filestream)
|
voidpf filestream;
|
||||||
{
|
{
|
||||||
unsigned char* buf;
|
unsigned char* buf;
|
||||||
uLong uSizeFile;
|
uLong uSizeFile;
|
||||||
@@ -495,11 +496,11 @@ local uLong ziplocal_SearchCentralDir(
|
|||||||
#endif /* !NO_ADDFILEINEXISTINGZIP*/
|
#endif /* !NO_ADDFILEINEXISTINGZIP*/
|
||||||
|
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
extern zipFile ZEXPORT zipOpen2 (
|
extern zipFile ZEXPORT zipOpen2 (pathname, append, globalcomment, pzlib_filefunc_def)
|
||||||
const char *pathname,
|
const char *pathname;
|
||||||
int append,
|
int append;
|
||||||
zipcharpc* globalcomment,
|
zipcharpc* globalcomment;
|
||||||
zlib_filefunc_def* pzlib_filefunc_def)
|
zlib_filefunc_def* pzlib_filefunc_def;
|
||||||
{
|
{
|
||||||
zip_internal ziinit;
|
zip_internal ziinit;
|
||||||
zip_internal* zi;
|
zip_internal* zi;
|
||||||
@@ -614,7 +615,7 @@ extern zipFile ZEXPORT zipOpen2 (
|
|||||||
|
|
||||||
if (size_comment>0)
|
if (size_comment>0)
|
||||||
{
|
{
|
||||||
ziinit.globalcomment = (char*)ALLOC(size_comment+1);
|
ziinit.globalcomment = ALLOC(size_comment+1);
|
||||||
if (ziinit.globalcomment)
|
if (ziinit.globalcomment)
|
||||||
{
|
{
|
||||||
size_comment = ZREAD(ziinit.z_filefunc, ziinit.filestream,ziinit.globalcomment,size_comment);
|
size_comment = ZREAD(ziinit.z_filefunc, ziinit.filestream,ziinit.globalcomment,size_comment);
|
||||||
@@ -679,30 +680,35 @@ extern zipFile ZEXPORT zipOpen2 (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern zipFile ZEXPORT zipOpen (
|
extern zipFile ZEXPORT zipOpen (pathname, append)
|
||||||
const char *pathname,
|
const char *pathname;
|
||||||
int append)
|
int append;
|
||||||
{
|
{
|
||||||
return zipOpen2(pathname,append,NULL,NULL);
|
return zipOpen2(pathname,append,NULL,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ZEXPORT zipOpenNewFileInZip3 (
|
extern int ZEXPORT zipOpenNewFileInZip3 (file, filename, zipfi,
|
||||||
zipFile file,
|
extrafield_local, size_extrafield_local,
|
||||||
const char* filename,
|
extrafield_global, size_extrafield_global,
|
||||||
const zip_fileinfo* zipfi,
|
comment, method, level, raw,
|
||||||
const void* extrafield_local,
|
windowBits, memLevel, strategy,
|
||||||
uInt size_extrafield_local,
|
password, crcForCrypting)
|
||||||
const void* extrafield_global,
|
zipFile file;
|
||||||
uInt size_extrafield_global,
|
const char* filename;
|
||||||
const char* comment,
|
const zip_fileinfo* zipfi;
|
||||||
int method,
|
const void* extrafield_local;
|
||||||
int level,
|
uInt size_extrafield_local;
|
||||||
int raw,
|
const void* extrafield_global;
|
||||||
int windowBits,
|
uInt size_extrafield_global;
|
||||||
int memLevel,
|
const char* comment;
|
||||||
int strategy,
|
int method;
|
||||||
const char* password,
|
int level;
|
||||||
uLong crcForCrypting)
|
int raw;
|
||||||
|
int windowBits;
|
||||||
|
int memLevel;
|
||||||
|
int strategy;
|
||||||
|
const char* password;
|
||||||
|
uLong crcForCrypting;
|
||||||
{
|
{
|
||||||
zip_internal* zi;
|
zip_internal* zi;
|
||||||
uInt size_filename;
|
uInt size_filename;
|
||||||
@@ -890,18 +896,21 @@ extern int ZEXPORT zipOpenNewFileInZip3 (
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ZEXPORT zipOpenNewFileInZip2(
|
extern int ZEXPORT zipOpenNewFileInZip2(file, filename, zipfi,
|
||||||
zipFile file,
|
extrafield_local, size_extrafield_local,
|
||||||
const char* filename,
|
extrafield_global, size_extrafield_global,
|
||||||
const zip_fileinfo* zipfi,
|
comment, method, level, raw)
|
||||||
const void* extrafield_local,
|
zipFile file;
|
||||||
uInt size_extrafield_local,
|
const char* filename;
|
||||||
const void* extrafield_global,
|
const zip_fileinfo* zipfi;
|
||||||
uInt size_extrafield_global,
|
const void* extrafield_local;
|
||||||
const char* comment,
|
uInt size_extrafield_local;
|
||||||
int method,
|
const void* extrafield_global;
|
||||||
int level,
|
uInt size_extrafield_global;
|
||||||
int raw)
|
const char* comment;
|
||||||
|
int method;
|
||||||
|
int level;
|
||||||
|
int raw;
|
||||||
{
|
{
|
||||||
return zipOpenNewFileInZip3 (file, filename, zipfi,
|
return zipOpenNewFileInZip3 (file, filename, zipfi,
|
||||||
extrafield_local, size_extrafield_local,
|
extrafield_local, size_extrafield_local,
|
||||||
@@ -911,17 +920,20 @@ extern int ZEXPORT zipOpenNewFileInZip2(
|
|||||||
NULL, 0);
|
NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ZEXPORT zipOpenNewFileInZip (
|
extern int ZEXPORT zipOpenNewFileInZip (file, filename, zipfi,
|
||||||
zipFile file,
|
extrafield_local, size_extrafield_local,
|
||||||
const char* filename,
|
extrafield_global, size_extrafield_global,
|
||||||
const zip_fileinfo* zipfi,
|
comment, method, level)
|
||||||
const void* extrafield_local,
|
zipFile file;
|
||||||
uInt size_extrafield_local,
|
const char* filename;
|
||||||
const void* extrafield_global,
|
const zip_fileinfo* zipfi;
|
||||||
uInt size_extrafield_global,
|
const void* extrafield_local;
|
||||||
const char* comment,
|
uInt size_extrafield_local;
|
||||||
int method,
|
const void* extrafield_global;
|
||||||
int level)
|
uInt size_extrafield_global;
|
||||||
|
const char* comment;
|
||||||
|
int method;
|
||||||
|
int level;
|
||||||
{
|
{
|
||||||
return zipOpenNewFileInZip2 (file, filename, zipfi,
|
return zipOpenNewFileInZip2 (file, filename, zipfi,
|
||||||
extrafield_local, size_extrafield_local,
|
extrafield_local, size_extrafield_local,
|
||||||
@@ -929,8 +941,8 @@ extern int ZEXPORT zipOpenNewFileInZip (
|
|||||||
comment, method, level, 0);
|
comment, method, level, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
local int zipFlushWriteBuffer(
|
local int zipFlushWriteBuffer(zi)
|
||||||
zip_internal* zi)
|
zip_internal* zi;
|
||||||
{
|
{
|
||||||
int err=ZIP_OK;
|
int err=ZIP_OK;
|
||||||
|
|
||||||
@@ -951,10 +963,10 @@ local int zipFlushWriteBuffer(
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ZEXPORT zipWriteInFileInZip (
|
extern int ZEXPORT zipWriteInFileInZip (file, buf, len)
|
||||||
zipFile file,
|
zipFile file;
|
||||||
const void* buf,
|
const void* buf;
|
||||||
unsigned len)
|
unsigned len;
|
||||||
{
|
{
|
||||||
zip_internal* zi;
|
zip_internal* zi;
|
||||||
int err=ZIP_OK;
|
int err=ZIP_OK;
|
||||||
@@ -966,9 +978,9 @@ extern int ZEXPORT zipWriteInFileInZip (
|
|||||||
if (zi->in_opened_file_inzip == 0)
|
if (zi->in_opened_file_inzip == 0)
|
||||||
return ZIP_PARAMERROR;
|
return ZIP_PARAMERROR;
|
||||||
|
|
||||||
zi->ci.stream.next_in = (Bytef*)buf;
|
zi->ci.stream.next_in = (void*)buf;
|
||||||
zi->ci.stream.avail_in = len;
|
zi->ci.stream.avail_in = len;
|
||||||
zi->ci.crc32 = crc32(zi->ci.crc32,(const Bytef*)buf,len);
|
zi->ci.crc32 = crc32(zi->ci.crc32,buf,len);
|
||||||
|
|
||||||
while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0))
|
while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0))
|
||||||
{
|
{
|
||||||
@@ -1016,10 +1028,10 @@ extern int ZEXPORT zipWriteInFileInZip (
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ZEXPORT zipCloseFileInZipRaw (
|
extern int ZEXPORT zipCloseFileInZipRaw (file, uncompressed_size, crc32)
|
||||||
zipFile file,
|
zipFile file;
|
||||||
uLong uncompressed_size,
|
uLong uncompressed_size;
|
||||||
uLong crc32)
|
uLong crc32;
|
||||||
{
|
{
|
||||||
zip_internal* zi;
|
zip_internal* zi;
|
||||||
uLong compressed_size;
|
uLong compressed_size;
|
||||||
@@ -1112,15 +1124,15 @@ extern int ZEXPORT zipCloseFileInZipRaw (
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ZEXPORT zipCloseFileInZip (
|
extern int ZEXPORT zipCloseFileInZip (file)
|
||||||
zipFile file)
|
zipFile file;
|
||||||
{
|
{
|
||||||
return zipCloseFileInZipRaw (file,0,0);
|
return zipCloseFileInZipRaw (file,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int ZEXPORT zipClose (
|
extern int ZEXPORT zipClose (file, global_comment)
|
||||||
zipFile file,
|
zipFile file;
|
||||||
const char* global_comment)
|
const char* global_comment;
|
||||||
{
|
{
|
||||||
zip_internal* zi;
|
zip_internal* zi;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ filesystem * filesystem::pCurrentFS = NULL;
|
|||||||
std::vector<filesystem::pooledBuffer *> filesystem::m_Buffers;
|
std::vector<filesystem::pooledBuffer *> filesystem::m_Buffers;
|
||||||
|
|
||||||
static const int STORED = 0;
|
static const int STORED = 0;
|
||||||
|
static const int DEFLATED = 8;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Construction/Destruction
|
// Construction/Destruction
|
||||||
@@ -631,8 +632,8 @@ streamoff filesystem::CentralDirZipped(std::istream & File, std::streamoff begin
|
|||||||
std::streamoff eof = begin + size;
|
std::streamoff eof = begin + size;
|
||||||
|
|
||||||
// Look for the "end of central dir" header. Start minimum 22 bytes before end.
|
// Look for the "end of central dir" header. Start minimum 22 bytes before end.
|
||||||
if (! File.seekg(eof - 22, ios::beg))
|
if (! File.seekg(eof - 22, ios::beg))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
streamoff EndPos;
|
streamoff EndPos;
|
||||||
streamoff StartPos = File.tellg();
|
streamoff StartPos = File.tellg();
|
||||||
|
|||||||
@@ -258,8 +258,8 @@ inline void izfstream::open(const char * FilePath, filesystem * pFS) {
|
|||||||
if (pFS)
|
if (pFS)
|
||||||
m_pFS = pFS;
|
m_pFS = pFS;
|
||||||
|
|
||||||
if (m_pFS != NULL)
|
if (m_pFS != NULL)
|
||||||
m_pFS->Open(* this, FilePath);
|
m_pFS->Open(* this, FilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void izfstream::close() {
|
inline void izfstream::close() {
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ bool zbuffer::use(std::streamoff Offset, std::streamoff Size)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
//Don't use a buffer already used;
|
//Don't use a buffer already used;
|
||||||
if (m_Used)
|
if (m_Used)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// adjust file position
|
// adjust file position
|
||||||
if (! m_ZipFile.seekg(Offset, ios::beg))
|
if (! m_ZipFile.seekg(Offset, ios::beg))
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ It is highly customizable and allows the player to tweak the rules / create thei
|
|||||||
|
|
||||||
Info, downloads, discussions and more at http://wololo.net/forum/index.php
|
Info, downloads, discussions and more at http://wololo.net/forum/index.php
|
||||||
|
|
||||||

|
-
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ environment:
|
|||||||
|
|
||||||
# scripts that run after cloning repository
|
# scripts that run after cloning repository
|
||||||
install:
|
install:
|
||||||
- ps: (new-object net.webclient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', 'C:/get-pip.py')
|
- 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/python.exe C:/get-pip.py"
|
||||||
- "C:/Python27/Scripts/pip.exe install pyjavaproperties"
|
- "C:/Python27/Scripts/pip.exe install pyjavaproperties"
|
||||||
- "C:/Python27/Scripts/pip.exe install github3.py"
|
- "C:/Python27/Scripts/pip.exe install github3.py"
|
||||||
|
|||||||
1
projects/mtg/Android/.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
/gen
|
/gen
|
||||||
/bin
|
/bin
|
||||||
/libs
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0201" android:versionName="@string/app_version" package="net.wagic.app">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0192" android:versionName="@string/app_version" package="net.wagic.app">
|
||||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||||
<application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
<application android:debuggable="true" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
||||||
<activity android:debuggable="false" android:configChanges="keyboard|keyboardHidden|orientation" android:label="@string/app_name" android:name="org.libsdl.app.SDLActivity" android:screenOrientation="sensorLandscape">
|
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:label="@string/app_name" android:name="org.libsdl.app.SDLActivity" android:screenOrientation="sensorLandscape">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:name="com.google.ads.AdActivity" android:screenOrientation="sensorLandscape"/>
|
||||||
</application>
|
</application>
|
||||||
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10"/>
|
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10"/>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ SDL_PATH := $(JGE_PATH)/Dependencies/SDL
|
|||||||
BOOST_PATH := $(MY_WAGIC_ROOT)/Boost
|
BOOST_PATH := $(MY_WAGIC_ROOT)/Boost
|
||||||
JPEG_PATH := $(JGE_PATH)/Dependencies/libjpeg
|
JPEG_PATH := $(JGE_PATH)/Dependencies/libjpeg
|
||||||
PNG_PATH := $(JGE_PATH)/Dependencies/libpng
|
PNG_PATH := $(JGE_PATH)/Dependencies/libpng
|
||||||
|
DEBUG ?= DEBUG
|
||||||
|
|
||||||
LOCAL_CFLAGS += -DLINUX -DANDROID -DSDL_CONFIG
|
LOCAL_CFLAGS += -DLINUX -DANDROID -DSDL_CONFIG -D_$(DEBUG)
|
||||||
LOCAL_CFLAGS += -D_STLP_USE_SIMPLE_NODE_ALLOC -DTIXML_USE_STL
|
LOCAL_CFLAGS += -D_STLP_USE_SIMPLE_NODE_ALLOC -DTIXML_USE_STL
|
||||||
LOCAL_CFLAGS += -D__arm__ -D_REENTRANT -D_GLIBCXX__PTHREADS
|
LOCAL_CFLAGS += -D__arm__ -D_REENTRANT -D_GLIBCXX__PTHREADS
|
||||||
LOCAL_STATIC_LIBRARIES := libpng libjpeg
|
LOCAL_STATIC_LIBRARIES := libpng libjpeg
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
APP_PROJECT_PATH := $(call my-dir)/..
|
APP_PROJECT_PATH := $(call my-dir)/..
|
||||||
APP_CPPFLAGS += -frtti -fexceptions
|
APP_CPPFLAGS += -frtti -fexceptions
|
||||||
APP_ABI := armeabi armeabi-v7a
|
APP_ABI := armeabi armeabi-v7a
|
||||||
#APP_ABI := x86 # mainly for emulators
|
|
||||||
APP_STL := gnustl_static
|
APP_STL := gnustl_static
|
||||||
APP_MODULES := libpng libjpeg main SDL
|
APP_MODULES := libpng libjpeg main SDL
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 60 KiB |
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Wagic</string>
|
<string name="app_name">Wagic</string>
|
||||||
<string name="app_version">0.20.1</string>
|
<string name="app_version">0.19.2</string>
|
||||||
<string name="info_text">Wagic v0.20.1\\nAll Rights Reserved.</string>
|
<string name="info_text">Wagic v0.19.2\\nAll Rights Reserved.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,275 +0,0 @@
|
|||||||
package net.wagic.utils;
|
|
||||||
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.FileReader;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Scanner;
|
|
||||||
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
public class DeckImporter
|
|
||||||
{
|
|
||||||
public static String importDeck( File f, String mypath, String activePath )
|
|
||||||
{
|
|
||||||
String message = "";
|
|
||||||
String deck = "";
|
|
||||||
String deckname = "";
|
|
||||||
String prefix = "#SB:";
|
|
||||||
int cardcount = 0;
|
|
||||||
if(f.exists() && !f.isDirectory())
|
|
||||||
{
|
|
||||||
deckname = f.getName();
|
|
||||||
int pos = deckname.lastIndexOf(".");
|
|
||||||
if (pos > 0)
|
|
||||||
{
|
|
||||||
deckname = deckname.substring(0, pos);
|
|
||||||
}
|
|
||||||
deck += "#NAME:"+deckname+"\n";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Scanner scanner = new Scanner(new File(mypath));
|
|
||||||
if (scanner.hasNext())
|
|
||||||
{
|
|
||||||
while (scanner.hasNext())
|
|
||||||
{
|
|
||||||
String line = scanner.nextLine();
|
|
||||||
line = line.trim();
|
|
||||||
if (!line.equals("") && cardcount < 61) // don't write out blank lines
|
|
||||||
{
|
|
||||||
String[] slines = line.split("\\s+");
|
|
||||||
String arranged = "";
|
|
||||||
for (int idx = 1; idx < slines.length; idx++)
|
|
||||||
{
|
|
||||||
arranged += slines[idx] + " ";
|
|
||||||
}
|
|
||||||
if ((isNumeric(slines[0])) && arranged != null)
|
|
||||||
{
|
|
||||||
if (slines[1] != null && slines[1].startsWith("["))
|
|
||||||
{
|
|
||||||
arranged = arranged.substring(5);
|
|
||||||
slines[1] = slines[1].replaceAll("\\[", "").replaceAll("\\]", "");
|
|
||||||
deck += arranged + " (" + renameSet(slines[1]) + ") * " + slines[0] + "\n";
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
deck += arranged + "(*) * " + slines[0] + "\n";
|
|
||||||
}
|
|
||||||
cardcount += Integer.parseInt(slines[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File profile = new File(activePath + "/Res/settings/options.txt");
|
|
||||||
if (profile.exists() && !profile.isDirectory())
|
|
||||||
{
|
|
||||||
String profileName = getActiveProfile(profile);
|
|
||||||
if (profileName != "Missing!")
|
|
||||||
{
|
|
||||||
File rootProfiles = new File(activePath + "/Res/profiles/" + profileName);
|
|
||||||
if (rootProfiles.exists() && rootProfiles.isDirectory())
|
|
||||||
{
|
|
||||||
//save deck
|
|
||||||
int countdeck = 1;
|
|
||||||
File[] files = rootProfiles.listFiles();
|
|
||||||
for (int i = 0; i < files.length; i++)
|
|
||||||
{//check if there is available deck...
|
|
||||||
if (files[i].getName().startsWith("deck"))
|
|
||||||
countdeck++;
|
|
||||||
}
|
|
||||||
File toSave = new File(rootProfiles + "/deck" + countdeck + ".txt");
|
|
||||||
try
|
|
||||||
{
|
|
||||||
FileOutputStream fop = new FileOutputStream(toSave);
|
|
||||||
|
|
||||||
// if file doesn't exists, then create it
|
|
||||||
if (!toSave.exists())
|
|
||||||
{
|
|
||||||
toSave.createNewFile();
|
|
||||||
}
|
|
||||||
// get the content in bytes
|
|
||||||
byte[] contentInBytes = deck.getBytes();
|
|
||||||
fop.write(contentInBytes);
|
|
||||||
fop.flush();
|
|
||||||
fop.close();
|
|
||||||
message = "Import Deck Success!\n" + cardcount + " total cards in this deck\n\n" + deck;
|
|
||||||
} catch (IOException e)
|
|
||||||
{
|
|
||||||
message = e.getMessage();
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
message = "Missing Folder!";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
message = "Invalid Profile!";
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
message = "No errors, and file EMPTY";
|
|
||||||
}
|
|
||||||
} catch (IOException e)
|
|
||||||
{
|
|
||||||
message = e.getMessage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean isNumeric(String input)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Integer.parseInt(input);
|
|
||||||
}
|
|
||||||
catch(NumberFormatException ex)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String getActiveProfile(File mypath)
|
|
||||||
{
|
|
||||||
String name = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Scanner scanner = new Scanner(new File(mypath.toString()));
|
|
||||||
if (scanner.hasNext())
|
|
||||||
{
|
|
||||||
String line = scanner.nextLine();
|
|
||||||
name = line.substring(8);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return "Missing!";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(IOException e)
|
|
||||||
{
|
|
||||||
return "Missing!";
|
|
||||||
}
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String renameSet(String set)
|
|
||||||
{
|
|
||||||
if (set == "")
|
|
||||||
return "*";
|
|
||||||
if (set == "AL")
|
|
||||||
return "ALL";
|
|
||||||
if (set == "AQ")
|
|
||||||
return "ATQ";
|
|
||||||
if (set == "AP")
|
|
||||||
return "APC";
|
|
||||||
if (set == "AN")
|
|
||||||
return "ARN";
|
|
||||||
if (set == "AE")
|
|
||||||
return "ARC";
|
|
||||||
if (set == "BR")
|
|
||||||
return "BRB";
|
|
||||||
if (set == "BD")
|
|
||||||
return "BTD";
|
|
||||||
if (set == "CH")
|
|
||||||
return "CHR";
|
|
||||||
if (set == "6E")
|
|
||||||
return "6ED";
|
|
||||||
if (set == "CS")
|
|
||||||
return "CSP";
|
|
||||||
if (set == "DS")
|
|
||||||
return "DST";
|
|
||||||
if (set == "D2")
|
|
||||||
return "DD2";
|
|
||||||
if (set == "8E")
|
|
||||||
return "8ED";
|
|
||||||
if (set == "EX")
|
|
||||||
return "EXO";
|
|
||||||
if (set == "FE")
|
|
||||||
return "FEM";
|
|
||||||
if (set == "FD")
|
|
||||||
return "5DN";
|
|
||||||
if (set == "5E")
|
|
||||||
return "5ED";
|
|
||||||
if (set == "4E")
|
|
||||||
return "4ED";
|
|
||||||
if (set == "GP")
|
|
||||||
return "GPT";
|
|
||||||
if (set == "HL")
|
|
||||||
return "HML";
|
|
||||||
if (set == "IA")
|
|
||||||
return "ICE";
|
|
||||||
if (set == "IN")
|
|
||||||
return "INV";
|
|
||||||
if (set == "JU")
|
|
||||||
return "JUD";
|
|
||||||
if (set == "LG")
|
|
||||||
return "LEG";
|
|
||||||
if (set == "LE")
|
|
||||||
return "LGN";
|
|
||||||
if (set == "A")
|
|
||||||
return "LEA";
|
|
||||||
if (set == "B")
|
|
||||||
return "LEB";
|
|
||||||
if (set == "MM")
|
|
||||||
return "MMQ";
|
|
||||||
if (set == "MI")
|
|
||||||
return "MIR";
|
|
||||||
if (set == "MR")
|
|
||||||
return "MRD";
|
|
||||||
if (set == "NE")
|
|
||||||
return "NEM";
|
|
||||||
if (set == "9E")
|
|
||||||
return "9ED";
|
|
||||||
if (set == "OD")
|
|
||||||
return "ODY";
|
|
||||||
if (set == "ON")
|
|
||||||
return "ONS";
|
|
||||||
if (set == "PS")
|
|
||||||
return "PLS";
|
|
||||||
if (set == "PT")
|
|
||||||
return "POR";
|
|
||||||
if (set == "P2")
|
|
||||||
return "P02";
|
|
||||||
if (set == "P3")
|
|
||||||
return "PTK";
|
|
||||||
if (set == "PR")
|
|
||||||
return "PPR";
|
|
||||||
if (set == "PY")
|
|
||||||
return "PCY";
|
|
||||||
if (set == "R")
|
|
||||||
return "RV";
|
|
||||||
if (set == "SC")
|
|
||||||
return "SCG";
|
|
||||||
if (set == "7E")
|
|
||||||
return "7ED";
|
|
||||||
if (set == "ST")
|
|
||||||
return "S99";
|
|
||||||
if (set == "ST2K")
|
|
||||||
return "S00";
|
|
||||||
if (set == "SH")
|
|
||||||
return "STH";
|
|
||||||
if (set == "TE")
|
|
||||||
return "TMP";
|
|
||||||
if (set == "DK")
|
|
||||||
return "DRK";
|
|
||||||
if (set == "TO")
|
|
||||||
return "TOR";
|
|
||||||
if (set == "UG")
|
|
||||||
return "UGL";
|
|
||||||
if (set == "U")
|
|
||||||
return "2ED";
|
|
||||||
if (set == "UD")
|
|
||||||
return "UDS";
|
|
||||||
if (set == "UL")
|
|
||||||
return "ULG";
|
|
||||||
if (set == "US")
|
|
||||||
return "USG";
|
|
||||||
if (set == "VI")
|
|
||||||
return "VIS";
|
|
||||||
if (set == "WL")
|
|
||||||
return "WTH";
|
|
||||||
else
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,16 +5,11 @@ import java.io.FileNotFoundException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import android.os.Build;
|
|
||||||
|
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class StorageOptions
|
public class StorageOptions
|
||||||
{
|
{
|
||||||
private static final String TAG = StorageOptions.class.getCanonicalName();
|
|
||||||
private static ArrayList<String> mMounts = new ArrayList<String>();
|
private static ArrayList<String> mMounts = new ArrayList<String>();
|
||||||
private static ArrayList<String> mVold = new ArrayList<String>();
|
private static ArrayList<String> mVold = new ArrayList<String>();
|
||||||
|
|
||||||
@@ -26,14 +21,8 @@ public class StorageOptions
|
|||||||
public static void determineStorageOptions()
|
public static void determineStorageOptions()
|
||||||
{
|
{
|
||||||
initializeMountPoints();
|
initializeMountPoints();
|
||||||
if (findForcemount()){
|
|
||||||
readMountsFileTest();
|
|
||||||
}
|
|
||||||
readMountsFile();
|
readMountsFile();
|
||||||
readVoldFile();
|
readVoldFile();
|
||||||
if (findForcemount()){
|
|
||||||
removeDuplicates(mMounts);
|
|
||||||
}
|
|
||||||
compareMountsWithVold();
|
compareMountsWithVold();
|
||||||
testAndCleanMountsList();
|
testAndCleanMountsList();
|
||||||
setProperties();
|
setProperties();
|
||||||
@@ -51,42 +40,6 @@ public class StorageOptions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void readMountsFileTest()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Test mountpoints storage -kevlahnota
|
|
||||||
*/
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Scanner scanner = new Scanner(new File("/proc/mounts"));
|
|
||||||
while (scanner.hasNext())
|
|
||||||
{
|
|
||||||
String line = scanner.nextLine();
|
|
||||||
if (line.startsWith("/"))
|
|
||||||
{
|
|
||||||
String[] lineElements = line.split("\\s+");
|
|
||||||
if ("vfat".equals(lineElements[2]) || "fuse".equals(lineElements[2]) || "sdcardfs".equals(lineElements[2]))
|
|
||||||
{
|
|
||||||
File mountPoint = new File(lineElements[1]);
|
|
||||||
if (!lineElements[1].equals(defaultMountPoint))
|
|
||||||
if (mountPoint.isDirectory() && mountPoint.canRead())
|
|
||||||
mMounts.add(lineElements[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (FileNotFoundException fnfex)
|
|
||||||
{
|
|
||||||
// if proc/mount doesn't exist we just use
|
|
||||||
Log.i(TAG, fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
|
||||||
mMounts.add(defaultMountPoint);
|
|
||||||
} catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.e(TAG, e.getMessage() + ": unknown exception while reading mounts file");
|
|
||||||
mMounts.add(defaultMountPoint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void readMountsFile()
|
private static void readMountsFile()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -112,11 +65,11 @@ public class StorageOptions
|
|||||||
} catch (FileNotFoundException fnfex)
|
} catch (FileNotFoundException fnfex)
|
||||||
{
|
{
|
||||||
// if proc/mount doesn't exist we just use
|
// if proc/mount doesn't exist we just use
|
||||||
Log.i(TAG, fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||||
mMounts.add(defaultMountPoint);
|
mMounts.add(defaultMountPoint);
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.e(TAG, e.getMessage() + ": unknown exception while reading mounts file");
|
Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file");
|
||||||
mMounts.add(defaultMountPoint);
|
mMounts.add(defaultMountPoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,48 +98,28 @@ public class StorageOptions
|
|||||||
} catch (FileNotFoundException fnfex)
|
} catch (FileNotFoundException fnfex)
|
||||||
{
|
{
|
||||||
// if vold.fstab doesn't exist we use the value gathered from the Environment
|
// if vold.fstab doesn't exist we use the value gathered from the Environment
|
||||||
Log.i(TAG, fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
Log.i(StorageOptions.class.getCanonicalName(), fnfex.getMessage() + ": assuming " + defaultMountPoint + " is the only mount point");
|
||||||
mMounts.add(defaultMountPoint);
|
mMounts.add(defaultMountPoint);
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.e(TAG, e.getMessage() + ": unknown exception while reading vold.fstab file");
|
Log.e(StorageOptions.class.getCanonicalName(), e.getMessage() + ": unknown exception while reading mounts file");
|
||||||
mMounts.add(defaultMountPoint);
|
mMounts.add(defaultMountPoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ArrayList<String> removeDuplicates(ArrayList<String> list)
|
|
||||||
{
|
|
||||||
ArrayList<String> result = new ArrayList<String>();
|
|
||||||
|
|
||||||
HashSet<String> set = new HashSet<String>();
|
|
||||||
|
|
||||||
for (String item : list)
|
|
||||||
{
|
|
||||||
if (!set.contains(item))
|
|
||||||
{
|
|
||||||
result.add(item);
|
|
||||||
set.add(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void compareMountsWithVold()
|
private static void compareMountsWithVold()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Sometimes the two lists of mount points will be different. We only want those mount points that are in both list.
|
* Sometimes the two lists of mount points will be different. We only want those mount points that are in both list.
|
||||||
*
|
*
|
||||||
* Compare the two lists together and remove items that are not in both lists.
|
* Compare the two lists together and remove items that are not in both lists.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (mVold.size() > 0)
|
for (int i = 0; i < mMounts.size(); i++)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < mMounts.size(); i++)
|
String mount = mMounts.get(i);
|
||||||
{
|
if (!mVold.contains(mount))
|
||||||
String mount = mMounts.get(i);
|
mMounts.remove(i--);
|
||||||
if (!mVold.contains(mount))
|
|
||||||
mMounts.remove(i--);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't need this anymore, clear the vold list to reduce memory
|
// don't need this anymore, clear the vold list to reduce memory
|
||||||
@@ -199,60 +132,18 @@ public class StorageOptions
|
|||||||
/*
|
/*
|
||||||
* Now that we have a cleaned list of mount paths Test each one to make sure it's a valid and available path. If it is not, remove it from the list.
|
* Now that we have a cleaned list of mount paths Test each one to make sure it's a valid and available path. If it is not, remove it from the list.
|
||||||
*/
|
*/
|
||||||
int t = 0;
|
|
||||||
for (int i = 0; i < mMounts.size(); i++)
|
for (int i = 0; i < mMounts.size(); i++)
|
||||||
{
|
{
|
||||||
t++;
|
|
||||||
String mount = mMounts.get(i);
|
String mount = mMounts.get(i);
|
||||||
File root = new File(mount);
|
File root = new File(mount);
|
||||||
if (!root.exists() || !root.isDirectory() || !root.canWrite())
|
if (!root.exists() || !root.isDirectory() || !root.canWrite())
|
||||||
mMounts.remove(i--);
|
mMounts.remove(i--);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t == 0 && Build.VERSION.SDK_INT >= 16 && findForcemount())
|
|
||||||
{
|
|
||||||
//if none is found lets force it for Jellybean and above...
|
|
||||||
if (System.getenv("EXTERNAL_STORAGE") != null)
|
|
||||||
{
|
|
||||||
File root = new File(System.getenv("EXTERNAL_STORAGE"));
|
|
||||||
if (root.exists() && root.isDirectory() && root.canWrite())
|
|
||||||
{
|
|
||||||
if(!isRooted())
|
|
||||||
{
|
|
||||||
File folder = new File(System.getenv("EXTERNAL_STORAGE")+"/Android/data/net.wagic.app/files");
|
|
||||||
folder.mkdirs();
|
|
||||||
mMounts.add(folder.toString());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mMounts.add(System.getenv("EXTERNAL_STORAGE"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (System.getenv("SECONDARY_STORAGE") != null)
|
|
||||||
{
|
|
||||||
File root = new File(System.getenv("SECONDARY_STORAGE"));
|
|
||||||
if (root.exists() && root.isDirectory() && root.canWrite())
|
|
||||||
{
|
|
||||||
if(!isRooted())
|
|
||||||
{
|
|
||||||
File folder = new File(System.getenv("SECONDARY_STORAGE")+"/Android/data/net.wagic.app/files");
|
|
||||||
folder.mkdirs();
|
|
||||||
mMounts.add(folder.toString());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mMounts.add(System.getenv("SECONDARY_STORAGE"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setProperties()
|
private static void setProperties()
|
||||||
{
|
{
|
||||||
Log.d(TAG, "setProperties()");
|
|
||||||
/*
|
/*
|
||||||
* At this point all the paths in the list should be valid. Build the public properties.
|
* At this point all the paths in the list should be valid. Build the public properties.
|
||||||
*/
|
*/
|
||||||
@@ -260,29 +151,14 @@ public class StorageOptions
|
|||||||
ArrayList<String> mLabels = new ArrayList<String>();
|
ArrayList<String> mLabels = new ArrayList<String>();
|
||||||
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
if(findForcemount()){
|
for (String path : mMounts)
|
||||||
for (String path : mMounts)
|
{ // TODO: /mnt/sdcard is assumed to always mean internal storage. Use this comparison until there is a better way to do this
|
||||||
{//with forcemount menu
|
if ("/mnt/sdcard".equalsIgnoreCase(path))
|
||||||
if ("/mnt/sdcard".equalsIgnoreCase(path) || "/storage/sdcard0".equalsIgnoreCase(path))
|
mLabels.add("Built-in Storage");
|
||||||
mLabels.add("Internal SD " + "[" + path + "]");
|
else
|
||||||
else if (path.contains("emulated"))
|
mLabels.add("External SD Card " + i++);
|
||||||
mLabels.add("Emulated SD " + " [" + path + "]");
|
|
||||||
else
|
|
||||||
mLabels.add("External SD " + " [" + path + "]");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
for (String path : mMounts)
|
|
||||||
{
|
|
||||||
// TODO: /mnt/sdcard is assumed to always mean internal storage. Use this comparison until there is a better way to do this
|
|
||||||
if ("/mnt/sdcard".equalsIgnoreCase(path))
|
|
||||||
mLabels.add("Built-in Storage");
|
|
||||||
else
|
|
||||||
mLabels.add("External SD Card " + i++);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
labels = new String[mLabels.size()];
|
labels = new String[mLabels.size()];
|
||||||
mLabels.toArray(labels);
|
mLabels.toArray(labels);
|
||||||
|
|
||||||
@@ -295,119 +171,4 @@ public class StorageOptions
|
|||||||
// use and to prepare it for the next time it's needed.
|
// use and to prepare it for the next time it's needed.
|
||||||
mMounts.clear();
|
mMounts.clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
private static boolean isExternalStorageReadOnly() {
|
|
||||||
String extStorageState = Environment.getExternalStorageState();
|
|
||||||
if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(extStorageState)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean isExternalStorageAvailable() {
|
|
||||||
String extStorageState = Environment.getExternalStorageState();
|
|
||||||
if (Environment.MEDIA_MOUNTED.equals(extStorageState)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the device is rooted.
|
|
||||||
*
|
|
||||||
* @return <code>true</code> if the device is rooted, <code>false</code> otherwise.
|
|
||||||
*/
|
|
||||||
public static boolean isRooted()
|
|
||||||
{
|
|
||||||
// get from build info
|
|
||||||
String buildTags = android.os.Build.TAGS;
|
|
||||||
if (buildTags != null && buildTags.contains("test-keys"))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if /system/app/Superuser.apk is present
|
|
||||||
try
|
|
||||||
{
|
|
||||||
File file = new File("/system/app/Superuser.apk");
|
|
||||||
if (file.exists())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch (Exception e1)
|
|
||||||
{
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
File file = new File("/system/app/Superuser/Superuser.apk");
|
|
||||||
if (file.exists())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch (Exception e1)
|
|
||||||
{
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
//SuperSU
|
|
||||||
try
|
|
||||||
{
|
|
||||||
File file = new File("/system/app/SuperSU.apk");
|
|
||||||
if (file.exists())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch (Exception e1)
|
|
||||||
{
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
File file = new File("/system/app/SuperSU/SuperSU.apk");
|
|
||||||
if (file.exists())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch (Exception e1)
|
|
||||||
{
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
// try executing commands
|
|
||||||
return canExecuteCommand("/system/xbin/which su")
|
|
||||||
|| canExecuteCommand("/system/bin/which su") || canExecuteCommand("which su");
|
|
||||||
}
|
|
||||||
|
|
||||||
// executes a command on the system
|
|
||||||
private static boolean canExecuteCommand(String command)
|
|
||||||
{
|
|
||||||
boolean executedSuccesfully;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Runtime.getRuntime().exec(command);
|
|
||||||
executedSuccesfully = true;
|
|
||||||
} catch (Exception e)
|
|
||||||
{
|
|
||||||
executedSuccesfully = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return executedSuccesfully;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean findForcemount()
|
|
||||||
{
|
|
||||||
Log.d(TAG, "findForcemount()");
|
|
||||||
try
|
|
||||||
{
|
|
||||||
File file = new File(System.getenv("EXTERNAL_STORAGE") + "/forcemount");
|
|
||||||
if (file.exists())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.w(TAG, e.getMessage());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +1,12 @@
|
|||||||
package org.libsdl.app;
|
package org.libsdl.app;
|
||||||
|
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.FileReader;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Scanner;
|
|
||||||
|
|
||||||
import javax.microedition.khronos.egl.EGL10;
|
import javax.microedition.khronos.egl.EGL10;
|
||||||
import javax.microedition.khronos.egl.EGLConfig;
|
import javax.microedition.khronos.egl.EGLConfig;
|
||||||
@@ -22,7 +16,6 @@ import javax.microedition.khronos.egl.EGLSurface;
|
|||||||
|
|
||||||
import net.wagic.app.R;
|
import net.wagic.app.R;
|
||||||
import net.wagic.utils.StorageOptions;
|
import net.wagic.utils.StorageOptions;
|
||||||
import net.wagic.utils.DeckImporter;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -66,11 +59,9 @@ import android.widget.FrameLayout.LayoutParams;
|
|||||||
*/
|
*/
|
||||||
public class SDLActivity extends Activity implements OnKeyListener
|
public class SDLActivity extends Activity implements OnKeyListener
|
||||||
{
|
{
|
||||||
private static final String TAG = SDLActivity.class.getCanonicalName();
|
|
||||||
|
|
||||||
//import deck globals
|
// TAG used for debugging in DDMS
|
||||||
public ArrayList<String> myresult = new ArrayList<String>();
|
public static String TAG = Activity.class.getCanonicalName();
|
||||||
public String myclickedItem = "";
|
|
||||||
|
|
||||||
// Main components
|
// Main components
|
||||||
private static SDLActivity mSingleton;
|
private static SDLActivity mSingleton;
|
||||||
@@ -209,60 +200,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
|
|
||||||
setStorage.create().show();
|
setStorage.create().show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void importDeckOptions()
|
|
||||||
{
|
|
||||||
AlertDialog.Builder importDeck = new AlertDialog.Builder(this);
|
|
||||||
importDeck.setTitle("Choose Deck to Import:");
|
|
||||||
File root = new File(System.getenv("EXTERNAL_STORAGE")+"/Download");
|
|
||||||
File[] files = root.listFiles();
|
|
||||||
for( File f : files)
|
|
||||||
{
|
|
||||||
if( !myresult.contains(f.toString()) && (f.toString().contains(".txt")||f.toString().contains(".dck")||f.toString().contains(".dec")))
|
|
||||||
myresult.add(f.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
//get first item?
|
|
||||||
if(!myresult.isEmpty())
|
|
||||||
myclickedItem = myresult.get(0).toString();
|
|
||||||
|
|
||||||
importDeck.setSingleChoiceItems(myresult.toArray(new String[myresult.size()]), 0, new DialogInterface.OnClickListener()
|
|
||||||
{
|
|
||||||
public void onClick(DialogInterface dialog, int item)
|
|
||||||
{
|
|
||||||
myclickedItem = myresult.get(item).toString();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
importDeck.setPositiveButton("Import Deck", new DialogInterface.OnClickListener()
|
|
||||||
{
|
|
||||||
public void onClick(DialogInterface dialog, int which)
|
|
||||||
{
|
|
||||||
processSelectedDeck( myclickedItem );
|
|
||||||
if (mSurface == null)
|
|
||||||
mSingleton.initializeGame();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
importDeck.create().show();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void processSelectedDeck(String mypath)
|
|
||||||
{
|
|
||||||
AlertDialog.Builder infoDialog = new AlertDialog.Builder(this);
|
|
||||||
infoDialog.setTitle("Imported Deck:");
|
|
||||||
String activePath = sdcardPath;
|
|
||||||
if(activePath == ""){
|
|
||||||
activePath = internalPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
File f = new File(mypath);
|
|
||||||
//Call the deck importer....
|
|
||||||
String state = DeckImporter.importDeck(f, mypath, activePath);
|
|
||||||
infoDialog.setMessage(state);
|
|
||||||
infoDialog.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkStorageLocationPreference()
|
private void checkStorageLocationPreference()
|
||||||
{
|
{
|
||||||
SharedPreferences settings = getSharedPreferences(kWagicSharedPreferencesKey, MODE_PRIVATE);
|
SharedPreferences settings = getSharedPreferences(kWagicSharedPreferencesKey, MODE_PRIVATE);
|
||||||
@@ -349,7 +287,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
updateStorageLocations();
|
updateStorageLocations();
|
||||||
} catch (Exception ioex)
|
} catch (Exception ioex)
|
||||||
{
|
{
|
||||||
Log.e(TAG, "An error occurred in setting up the storage locations.");
|
Log.e("SDL", "An error occurred in setting up the storage locations.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,8 +334,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
public boolean onCreateOptionsMenu(Menu menu)
|
public boolean onCreateOptionsMenu(Menu menu)
|
||||||
{
|
{
|
||||||
SubMenu settingsMenu = menu.addSubMenu(Menu.NONE, 1, 1, "Settings");
|
SubMenu settingsMenu = menu.addSubMenu(Menu.NONE, 1, 1, "Settings");
|
||||||
menu.add(Menu.NONE, 2, 2, "Import");
|
menu.add(Menu.NONE, 2, 2, "About");
|
||||||
menu.add(Menu.NONE, 3, 3, "About");
|
|
||||||
settingsMenu.add(kStorageDataOptionsMenuId, kStorageDataOptionsMenuId, Menu.NONE, "Storage Data Options");
|
settingsMenu.add(kStorageDataOptionsMenuId, kStorageDataOptionsMenuId, Menu.NONE, "Storage Data Options");
|
||||||
// buildStorageOptionsMenu(settingsMenu);
|
// buildStorageOptionsMenu(settingsMenu);
|
||||||
|
|
||||||
@@ -413,9 +350,6 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
{
|
{
|
||||||
displayStorageOptions();
|
displayStorageOptions();
|
||||||
} else if (itemId == 2)
|
} else if (itemId == 2)
|
||||||
{
|
|
||||||
importDeckOptions();
|
|
||||||
} else if (itemId == 3)
|
|
||||||
{
|
{
|
||||||
// display some info about the app
|
// display some info about the app
|
||||||
AlertDialog.Builder infoDialog = new AlertDialog.Builder(this);
|
AlertDialog.Builder infoDialog = new AlertDialog.Builder(this);
|
||||||
@@ -494,12 +428,14 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState)
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
//Log.d(TAG, "onCreate()");
|
// Log.v("SDL", "onCreate()");
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
// So we can call stuff from static callbacks
|
// So we can call stuff from static callbacks
|
||||||
mSingleton = this;
|
mSingleton = this;
|
||||||
mContext = this.getApplicationContext();
|
mContext = this.getApplicationContext();
|
||||||
|
// get the current version of the app to set the core filename
|
||||||
|
String versionCodeString = getApplicationCode();
|
||||||
RES_FILENAME = getResourceName();
|
RES_FILENAME = getResourceName();
|
||||||
|
|
||||||
StorageOptions.determineStorageOptions();
|
StorageOptions.determineStorageOptions();
|
||||||
@@ -527,7 +463,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
@Override
|
@Override
|
||||||
protected void onPause()
|
protected void onPause()
|
||||||
{
|
{
|
||||||
// Log.d(TAG, "onPause()");
|
// Log.v("SDL", "onPause()");
|
||||||
super.onPause();
|
super.onPause();
|
||||||
SDLActivity.nativePause();
|
SDLActivity.nativePause();
|
||||||
}
|
}
|
||||||
@@ -535,7 +471,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume()
|
protected void onResume()
|
||||||
{
|
{
|
||||||
// Log.d(TAG, "onResume()");
|
// Log.v("SDL", "onResume()");
|
||||||
super.onResume();
|
super.onResume();
|
||||||
SDLActivity.nativeResume();
|
SDLActivity.nativeResume();
|
||||||
}
|
}
|
||||||
@@ -543,7 +479,8 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroy()
|
public void onDestroy()
|
||||||
{
|
{
|
||||||
// Log.d(TAG, "onDestroy()");
|
// Log.v("SDL", "onDestroy()");
|
||||||
|
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
mSurface.onDestroy();
|
mSurface.onDestroy();
|
||||||
}
|
}
|
||||||
@@ -654,7 +591,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
|
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
|
||||||
int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
|
int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
|
||||||
|
|
||||||
// Log.d(TAG, "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + ((float)sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
|
// Log.v("SDL", "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + ((float)sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
|
||||||
|
|
||||||
// Let the user pick a larger buffer if they really want -- but ye
|
// Let the user pick a larger buffer if they really want -- but ye
|
||||||
// gods they probably shouldn't, the minimums are horrifyingly high
|
// gods they probably shouldn't, the minimums are horrifyingly high
|
||||||
@@ -665,7 +602,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
|
|
||||||
audioStartThread();
|
audioStartThread();
|
||||||
|
|
||||||
// Log.d(TAG, "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + ((float)mAudioTrack.getSampleRate() / 1000f) +
|
// Log.v("SDL", "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + ((float)mAudioTrack.getSampleRate() / 1000f) +
|
||||||
// "kHz, " + desiredFrames + " frames buffer");
|
// "kHz, " + desiredFrames + " frames buffer");
|
||||||
|
|
||||||
if (is16Bit)
|
if (is16Bit)
|
||||||
@@ -713,7 +650,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
Log.w(TAG, "SDL audio: error return from write(short)");
|
Log.w("SDL", "SDL audio: error return from write(short)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -738,7 +675,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
Log.w(TAG, "SDL audio: error return from write(short)");
|
Log.w("SDL", "SDL audio: error return from write(short)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -753,11 +690,11 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
mAudioThread.join();
|
mAudioThread.join();
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.e(TAG, "Problem stopping audio thread: " + e);
|
Log.v("SDL", "Problem stopping audio thread: " + e);
|
||||||
}
|
}
|
||||||
mAudioThread = null;
|
mAudioThread = null;
|
||||||
|
|
||||||
// Log.d(TAG, "Finished waiting for audio thread");
|
// Log.v("SDL", "Finished waiting for audio thread");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAudioTrack != null)
|
if (mAudioTrack != null)
|
||||||
@@ -769,7 +706,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
|
|
||||||
class DownloadFileAsync extends AsyncTask<String, Integer, Long>
|
class DownloadFileAsync extends AsyncTask<String, Integer, Long>
|
||||||
{
|
{
|
||||||
private final String TAG = DownloadFileAsync.class.getCanonicalName();
|
final String TAG1 = DownloadFileAsync.class.getCanonicalName();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPreExecute()
|
protected void onPreExecute()
|
||||||
@@ -788,6 +725,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
// Prepare the sdcard folders in order to download the resource file
|
// Prepare the sdcard folders in order to download the resource file
|
||||||
//
|
//
|
||||||
@@ -808,7 +746,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
conexion.connect();
|
conexion.connect();
|
||||||
|
|
||||||
int lengthOfFile = conexion.getContentLength();
|
int lengthOfFile = conexion.getContentLength();
|
||||||
// Log.d(TAG, " Length of file: " + lengthOfFile);
|
// Log.d("Wagic - " + TAG1, " Length of file: " + lengthOfFile);
|
||||||
|
|
||||||
input = new BufferedInputStream(url.openStream());
|
input = new BufferedInputStream(url.openStream());
|
||||||
// create a File object for the output file
|
// create a File object for the output file
|
||||||
@@ -831,8 +769,8 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
{
|
{
|
||||||
String errorMessage = "An error happened while downloading the resources. It could be that our server is temporarily down, that your device is not connected to a network, or that we cannot write to " + mSingleton.getSystemStorageLocation() + ". Please check your phone settings and try again. For more help please go to http://wagic.net";
|
String errorMessage = "An error happened while downloading the resources. It could be that our server is temporarily down, that your device is not connected to a network, or that we cannot write to " + mSingleton.getSystemStorageLocation() + ". Please check your phone settings and try again. For more help please go to http://wagic.net";
|
||||||
mSingleton.downloadError(errorMessage);
|
mSingleton.downloadError(errorMessage);
|
||||||
Log.e(TAG, errorMessage);
|
Log.e(TAG1, errorMessage);
|
||||||
Log.e(TAG, e.getMessage());
|
Log.e(TAG1, e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return Long.valueOf(totalBytes);
|
return Long.valueOf(totalBytes);
|
||||||
@@ -842,7 +780,7 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
{
|
{
|
||||||
if (progress[0] != mProgressDialog.getProgress())
|
if (progress[0] != mProgressDialog.getProgress())
|
||||||
{
|
{
|
||||||
// Log.d(TAG, "current progress : " + progress[0]);
|
// Log.d("Wagic - " + TAG1, "current progress : " + progress[0]);
|
||||||
mProgressDialog.setProgress(progress[0]);
|
mProgressDialog.setProgress(progress[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -915,7 +853,6 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
*/
|
*/
|
||||||
class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnKeyListener, View.OnTouchListener, SensorEventListener
|
class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnKeyListener, View.OnTouchListener, SensorEventListener
|
||||||
{
|
{
|
||||||
private static final String TAG = SDLSurface.class.getCanonicalName();
|
|
||||||
|
|
||||||
// This is what SDL runs in. It invokes SDL_main(), eventually
|
// This is what SDL runs in. It invokes SDL_main(), eventually
|
||||||
private Thread mSDLThread;
|
private Thread mSDLThread;
|
||||||
@@ -955,7 +892,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
|
|
||||||
SDLActivity.nativeQuit();
|
SDLActivity.nativeQuit();
|
||||||
|
|
||||||
Log.d(TAG, "SDL thread terminated");
|
Log.v("SDL", "SDL thread terminated");
|
||||||
|
|
||||||
// On exit, tear everything down for a fresh restart next time.
|
// On exit, tear everything down for a fresh restart next time.
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
@@ -982,7 +919,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
// Called when we have a valid drawing surface
|
// Called when we have a valid drawing surface
|
||||||
public void surfaceCreated(SurfaceHolder holder)
|
public void surfaceCreated(SurfaceHolder holder)
|
||||||
{
|
{
|
||||||
//Log.d(TAG, "surfaceCreated()");
|
Log.v("SDL", "surfaceCreated()");
|
||||||
|
|
||||||
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
|
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
|
||||||
}
|
}
|
||||||
@@ -1002,18 +939,18 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
mSDLThread.join();
|
mSDLThread.join();
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.e(TAG, "Problem stopping thread: " + e);
|
Log.v("SDL", "Problem stopping thread: " + e);
|
||||||
}
|
}
|
||||||
mSDLThread = null;
|
mSDLThread = null;
|
||||||
|
|
||||||
// Log.d(TAG, "Finished waiting for SDL thread");
|
// Log.v("SDL", "Finished waiting for SDL thread");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when we lose the surface
|
// Called when we lose the surface
|
||||||
public void surfaceDestroyed(SurfaceHolder holder)
|
public void surfaceDestroyed(SurfaceHolder holder)
|
||||||
{
|
{
|
||||||
Log.d(TAG, "surfaceDestroyed()");
|
Log.v("SDL", "surfaceDestroyed()");
|
||||||
synchronized (mSemSurface)
|
synchronized (mSemSurface)
|
||||||
{
|
{
|
||||||
mSurfaceValid = false;
|
mSurfaceValid = false;
|
||||||
@@ -1025,51 +962,51 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
// Called when the surface is resized
|
// Called when the surface is resized
|
||||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
|
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
|
||||||
{
|
{
|
||||||
Log.d(TAG, "surfaceChanged()");
|
Log.d("SDL", "surfaceChanged()");
|
||||||
|
|
||||||
int sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565 by default
|
int sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565 by default
|
||||||
switch (format)
|
switch (format)
|
||||||
{
|
{
|
||||||
case PixelFormat.A_8:
|
case PixelFormat.A_8:
|
||||||
Log.d("TAG", "pixel format A_8");
|
Log.d("SDL", "pixel format A_8");
|
||||||
break;
|
break;
|
||||||
case PixelFormat.LA_88:
|
case PixelFormat.LA_88:
|
||||||
Log.d("TAG", "pixel format LA_88");
|
Log.d("SDL", "pixel format LA_88");
|
||||||
break;
|
break;
|
||||||
case PixelFormat.L_8:
|
case PixelFormat.L_8:
|
||||||
Log.d("TAG", "pixel format L_8");
|
Log.d("SDL", "pixel format L_8");
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGBA_4444:
|
case PixelFormat.RGBA_4444:
|
||||||
Log.d("TAG", "pixel format RGBA_4444");
|
Log.d("SDL", "pixel format RGBA_4444");
|
||||||
sdlFormat = 0x85421002; // SDL_PIXELFORMAT_RGBA4444
|
sdlFormat = 0x85421002; // SDL_PIXELFORMAT_RGBA4444
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGBA_5551:
|
case PixelFormat.RGBA_5551:
|
||||||
Log.d(TAG, "pixel format RGBA_5551");
|
Log.d("SDL", "pixel format RGBA_5551");
|
||||||
sdlFormat = 0x85441002; // SDL_PIXELFORMAT_RGBA5551
|
sdlFormat = 0x85441002; // SDL_PIXELFORMAT_RGBA5551
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGBA_8888:
|
case PixelFormat.RGBA_8888:
|
||||||
Log.d(TAG, "pixel format RGBA_8888");
|
Log.d("SDL", "pixel format RGBA_8888");
|
||||||
sdlFormat = 0x86462004; // SDL_PIXELFORMAT_RGBA8888
|
sdlFormat = 0x86462004; // SDL_PIXELFORMAT_RGBA8888
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGBX_8888:
|
case PixelFormat.RGBX_8888:
|
||||||
Log.d(TAG, "pixel format RGBX_8888");
|
Log.d("SDL", "pixel format RGBX_8888");
|
||||||
sdlFormat = 0x86262004; // SDL_PIXELFORMAT_RGBX8888
|
sdlFormat = 0x86262004; // SDL_PIXELFORMAT_RGBX8888
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGB_332:
|
case PixelFormat.RGB_332:
|
||||||
Log.d(TAG, "pixel format RGB_332");
|
Log.d("SDL", "pixel format RGB_332");
|
||||||
sdlFormat = 0x84110801; // SDL_PIXELFORMAT_RGB332
|
sdlFormat = 0x84110801; // SDL_PIXELFORMAT_RGB332
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGB_565:
|
case PixelFormat.RGB_565:
|
||||||
Log.d(TAG, "pixel format RGB_565");
|
Log.d("SDL", "pixel format RGB_565");
|
||||||
sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565
|
sdlFormat = 0x85151002; // SDL_PIXELFORMAT_RGB565
|
||||||
break;
|
break;
|
||||||
case PixelFormat.RGB_888:
|
case PixelFormat.RGB_888:
|
||||||
Log.d(TAG, "pixel format RGB_888");
|
Log.d("SDL", "pixel format RGB_888");
|
||||||
// Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
|
// Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead?
|
||||||
sdlFormat = 0x86161804; // SDL_PIXELFORMAT_RGB888
|
sdlFormat = 0x86161804; // SDL_PIXELFORMAT_RGB888
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Log.d(TAG, "pixel format unknown " + format);
|
Log.d("SDL", "pixel format unknown " + format);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SDLActivity.onNativeResize(width, height, sdlFormat);
|
SDLActivity.onNativeResize(width, height, sdlFormat);
|
||||||
@@ -1086,10 +1023,11 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
// EGL functions
|
// EGL functions
|
||||||
public boolean initEGL(int majorVersion, int minorVersion)
|
public boolean initEGL(int majorVersion, int minorVersion)
|
||||||
{
|
{
|
||||||
Log.d(TAG, "Starting up OpenGL ES " + majorVersion + "." + minorVersion);
|
Log.d("SDL", "Starting up OpenGL ES " + majorVersion + "." + minorVersion);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
EGL10 egl = (EGL10) EGLContext.getEGL();
|
EGL10 egl = (EGL10) EGLContext.getEGL();
|
||||||
|
|
||||||
EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
|
EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
|
||||||
@@ -1115,7 +1053,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
int[] num_config = new int[1];
|
int[] num_config = new int[1];
|
||||||
if (!egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config) || num_config[0] == 0)
|
if (!egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config) || num_config[0] == 0)
|
||||||
{
|
{
|
||||||
Log.e(TAG, "No EGL config available");
|
Log.e("SDL", "No EGL config available");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mEGLConfig = configs[0];
|
mEGLConfig = configs[0];
|
||||||
@@ -1123,7 +1061,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
EGLContext ctx = egl.eglCreateContext(dpy, mEGLConfig, EGL10.EGL_NO_CONTEXT, null);
|
EGLContext ctx = egl.eglCreateContext(dpy, mEGLConfig, EGL10.EGL_NO_CONTEXT, null);
|
||||||
if (ctx == EGL10.EGL_NO_CONTEXT)
|
if (ctx == EGL10.EGL_NO_CONTEXT)
|
||||||
{
|
{
|
||||||
Log.e(TAG, "Couldn't create context");
|
Log.e("SDL", "Couldn't create context");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1137,10 +1075,10 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
|
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.e(TAG, e + "");
|
Log.e("SDL", e + "");
|
||||||
for (StackTraceElement s : e.getStackTrace())
|
for (StackTraceElement s : e.getStackTrace())
|
||||||
{
|
{
|
||||||
Log.e(TAG, s.toString());
|
Log.e("SDL", s.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1155,6 +1093,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
EGL10 egl = (EGL10) EGLContext.getEGL();
|
EGL10 egl = (EGL10) EGLContext.getEGL();
|
||||||
if (mEGLSurface != null)
|
if (mEGLSurface != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unbind and destroy the old EGL surface, if there is one.
|
* Unbind and destroy the old EGL surface, if there is one.
|
||||||
*/
|
*/
|
||||||
@@ -1168,7 +1107,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
mEGLSurface = egl.eglCreateWindowSurface(mEGLDisplay, mEGLConfig, holder, null);
|
mEGLSurface = egl.eglCreateWindowSurface(mEGLDisplay, mEGLConfig, holder, null);
|
||||||
if (mEGLSurface == EGL10.EGL_NO_SURFACE)
|
if (mEGLSurface == EGL10.EGL_NO_SURFACE)
|
||||||
{
|
{
|
||||||
Log.e(TAG, "Couldn't create surface");
|
Log.e("SDL", "Couldn't create surface");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1177,7 +1116,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
*/
|
*/
|
||||||
if (!egl.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext))
|
if (!egl.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext))
|
||||||
{
|
{
|
||||||
Log.e(TAG, "Couldn't make context current");
|
Log.e("SDL", "Couldn't make context current");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1189,6 +1128,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
// EGL buffer flip
|
// EGL buffer flip
|
||||||
public void flipEGL()
|
public void flipEGL()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!mSurfaceValid)
|
if (!mSurfaceValid)
|
||||||
{
|
{
|
||||||
createSurface(this.getHolder());
|
createSurface(this.getHolder());
|
||||||
@@ -1198,7 +1138,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
{
|
{
|
||||||
EGL10 egl = (EGL10) EGLContext.getEGL();
|
EGL10 egl = (EGL10) EGLContext.getEGL();
|
||||||
|
|
||||||
egl.eglWaitNative(EGL10.EGL_CORE_NATIVE_ENGINE, null);
|
egl.eglWaitNative(EGL10.EGL_NATIVE_RENDERABLE, null);
|
||||||
|
|
||||||
// drawing here
|
// drawing here
|
||||||
|
|
||||||
@@ -1208,12 +1148,13 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
|
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.e(TAG, "flipEGL(): " + e);
|
Log.e("SDL", "flipEGL(): " + e);
|
||||||
for (StackTraceElement s : e.getStackTrace())
|
for (StackTraceElement s : e.getStackTrace())
|
||||||
{
|
{
|
||||||
Log.e(TAG, s.toString());
|
Log.e("SDL", s.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Key events
|
// Key events
|
||||||
@@ -1224,15 +1165,14 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
|
|
||||||
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)
|
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN)
|
if (event.getAction() == KeyEvent.ACTION_DOWN)
|
||||||
{
|
{
|
||||||
// Log.d(TAG, "key down: " + keyCode);
|
// Log.d("SDL", "key down: " + keyCode);
|
||||||
SDLActivity.onNativeKeyDown(keyCode);
|
SDLActivity.onNativeKeyDown(keyCode);
|
||||||
return true;
|
return true;
|
||||||
} else if (event.getAction() == KeyEvent.ACTION_UP)
|
} else if (event.getAction() == KeyEvent.ACTION_UP)
|
||||||
{
|
{
|
||||||
// Log.d(TAG, "key up: " + keyCode);
|
// Log.d("SDL", "key up: " + keyCode);
|
||||||
SDLActivity.onNativeKeyUp(keyCode);
|
SDLActivity.onNativeKeyUp(keyCode);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1243,6 +1183,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
// Touch events
|
// Touch events
|
||||||
public boolean onTouch(View v, MotionEvent event)
|
public boolean onTouch(View v, MotionEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int index = 0; index < event.getPointerCount(); ++index)
|
for (int index = 0; index < event.getPointerCount(); ++index)
|
||||||
{
|
{
|
||||||
int action = event.getActionMasked();
|
int action = event.getActionMasked();
|
||||||
@@ -1309,4 +1250,3 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, View.OnK
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 820 KiB After Width: | Height: | Size: 820 KiB |
|
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 235 KiB |
|
Before Width: | Height: | Size: 630 KiB After Width: | Height: | Size: 630 KiB |
|
Before Width: | Height: | Size: 233 KiB After Width: | Height: | Size: 233 KiB |
|
Before Width: | Height: | Size: 417 KiB After Width: | Height: | Size: 417 KiB |
|
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 235 KiB |
|
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 235 KiB |
@@ -59,6 +59,7 @@ endif
|
|||||||
|
|
||||||
ifeq ($(TARGET_ARCHITECTURE),psp)
|
ifeq ($(TARGET_ARCHITECTURE),psp)
|
||||||
DEFAULT_RULE = 3xx
|
DEFAULT_RULE = 3xx
|
||||||
|
TARGET_ARCHITECTURE = psp
|
||||||
PSP_FW_VERSION=371
|
PSP_FW_VERSION=371
|
||||||
BUILD_PRX = 1
|
BUILD_PRX = 1
|
||||||
SIGN_PRX = 1
|
SIGN_PRX = 1
|
||||||
@@ -73,36 +74,19 @@ PSP_EBOOT_PIC1 = pic1.png
|
|||||||
INCDIR = ../../JGE/include ../../JGE/src/zipFS ../../JGE/include/psp ../../JGE/include/psp/freetype2 ../../JGE/src ../../projects/mtg/include ../../Boost
|
INCDIR = ../../JGE/include ../../JGE/src/zipFS ../../JGE/include/psp ../../JGE/include/psp/freetype2 ../../JGE/src ../../projects/mtg/include ../../Boost
|
||||||
LIBDIR = ../../JGE/lib/psp
|
LIBDIR = ../../JGE/lib/psp
|
||||||
CFLAGS = -O2 -G0 -DPSPFW3XX -DDEVHOOK -DUSE_PRECOMPILED_HEADERS=1 -DPSP -DTIXML_USE_STL
|
CFLAGS = -O2 -G0 -DPSPFW3XX -DDEVHOOK -DUSE_PRECOMPILED_HEADERS=1 -DPSP -DTIXML_USE_STL
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
ifeq ($(MAKECMDGOALS),x11)
|
|
||||||
|
|
||||||
OBJS += objs/TestSuiteAI.o
|
|
||||||
INCDIR = -I../../JGE/include -I../../JGE/src -I/usr/X11/include -I../../projects/mtg/include -I/usr/include/boost -I../../JGE/src/zipFS
|
|
||||||
LIBDIR = -L../../JGE/lib/linux -L../../JGE -L/usr/X11/lib
|
|
||||||
LIBS = -ljge -lfreetype -ljpeg -lgif -lpng -lz -lm -lstdc++ -lhgetools -lGL -lGLU -lX11 -lpthread $(FMOD)
|
|
||||||
CFLAGS = $(INCDIR) -DLINUX -DUSE_PRECOMPILED_HEADERS=1 -DTIXML_USE_STL -Wno-nonnull-compare
|
|
||||||
|
|
||||||
ASFLAGS = $(CXXFLAGS)
|
|
||||||
|
|
||||||
all: $(DEFAULT_RULE)
|
|
||||||
else
|
|
||||||
|
|
||||||
OBJS += objs/TestSuiteAI.o
|
OBJS += objs/TestSuiteAI.o
|
||||||
INCDIR = -I../../JGE/include -I../../JGE/src -I/usr/X11/include -I../../projects/mtg/include -I../../Boost -I../../JGE/src/zipFS
|
INCDIR = -I../../JGE/include -I../../JGE/src -I/usr/X11/include -I../../projects/mtg/include -I../../Boost -I../../JGE/src/zipFS
|
||||||
LIBDIR = -L../../JGE/lib/linux -L../../JGE -L/usr/X11/lib -L../../Boost/lib
|
LIBDIR = -L../../JGE/lib/linux -L../../JGE -L/usr/X11/lib -L../../Boost/lib
|
||||||
LIBS = -ljge -lfreetype -ljpeg -lgif -lpng -lz -lm -lstdc++ -lhgetools -lGL -lGLU -lX11 -lboost_thread $(FMOD)
|
LIBS = -ljge -lfreetype -ljpeg -lgif -lpng -lz -lm -lstdc++ -lhgetools -lGL -lGLU -lX11 -lboost_thread $(FMOD)
|
||||||
CFLAGS = $(INCDIR) -DLINUX -DUSE_PRECOMPILED_HEADERS=1 -Wno-nonnull-compare
|
CFLAGS = $(INCDIR) -DLINUX -DUSE_PRECOMPILED_HEADERS=1
|
||||||
|
|
||||||
ASFLAGS = $(CXXFLAGS)
|
ASFLAGS = $(CXXFLAGS)
|
||||||
|
|
||||||
all: $(DEFAULT_RULE)
|
all: $(DEFAULT_RULE)
|
||||||
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS := -Wall -W -Werror -Wno-unused -Wno-deprecated-declarations $(CFLAGS)
|
CFLAGS := -Wall -W -Wno-unused $(CFLAGS)
|
||||||
CXXFLAGS += $(CFLAGS)
|
CXXFLAGS += $(CFLAGS)
|
||||||
# -fno-exceptions
|
# -fno-exceptions
|
||||||
|
|
||||||
@@ -126,6 +110,8 @@ debug: all
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(TARGET): Makefile.$(TARGET_ARCHITECTURE) $(OBJS) ../../JGE/lib/linux/libjge.a
|
$(TARGET): Makefile.$(TARGET_ARCHITECTURE) $(OBJS) ../../JGE/lib/linux/libjge.a
|
||||||
$(CXX) -o $(TARGET) $(OBJS) $(LIBS) $(LIBDIR)
|
$(CXX) -o $(TARGET) $(OBJS) $(LIBS) $(LIBDIR)
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
maxGrade=0: Borderline (99% OK)
|
|
||||||
keybindings_sdl=13:2,27:2,32:10,97:7,98:5,100:6,101:15,102:16,105:11,106:12,107:13,108:10,113:14,115:9,119:8,1073741903:6,1073741904:7,1073741905:9,1073741906:8,1073741912:2,1073741952:14,1073741953:13,1073742048:3,1073742052:3,1073742094:2
|
|
||||||
aidecks=10
|
|
||||||
@@ -1,11 +1,5 @@
|
|||||||
#NAME:Kill by Numbers
|
#NAME:Kill by Numbers
|
||||||
#DESC:They just keep multiplying.
|
#DESC:They just keep multiplying.
|
||||||
#HINT:castpriority(enchantment,instant,sorcery,artifact,creature)
|
|
||||||
#HINT:dontattackwith(Rhys the Redeemed)
|
|
||||||
#HINT:dontblockwith(Rhys the Redeemed)
|
|
||||||
#HINT:dontattackwith(Kazandu Tuskcaller)
|
|
||||||
#HINT:dontblockwith(Kazandu Tuskcaller)
|
|
||||||
|
|
||||||
Mox Emerald (LEA) *2
|
Mox Emerald (LEA) *2
|
||||||
Mox Pearl (LEA) *2
|
Mox Pearl (LEA) *2
|
||||||
Forest (LEA) *15
|
Forest (LEA) *15
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#NAME:Etched Affinity
|
#NAME:Etched Affinity
|
||||||
#DESC:Modern URB Aggro
|
#DESC:Modern URB Aggro
|
||||||
#HINT:dontattackwith(creature[power<=0])
|
#HINT:dontattackwith(creature[power<=0])
|
||||||
|
#HINT:combo hold(Glimmervoid|myhand)^until(artifact|mybattlefield)^cast(Glimmervoid|myhand)^totalmananeeded({0})
|
||||||
#HINT:combo hold(Galvanic Blast|myhand)^cast(Galvanic Blast|myhand)^restriction{type(artifact|mybattlefield)~morethan~2,turn:3}^totalmananeeded({R})
|
#HINT:combo hold(Galvanic Blast|myhand)^cast(Galvanic Blast|myhand)^restriction{type(artifact|mybattlefield)~morethan~2,turn:3}^totalmananeeded({R})
|
||||||
|
|
||||||
#25 creatures
|
#25 creatures
|
||||||
|
|||||||
@@ -23,23 +23,23 @@
|
|||||||
369072
|
369072
|
||||||
|
|
||||||
#4 x Armada Wurm (RTR), {2}{g}{g}{w}{w}, Creature Wurm, 5/5, trample;
|
#4 x Armada Wurm (RTR), {2}{g}{g}{w}{w}, Creature Wurm, 5/5, trample;
|
||||||
253587
|
999009
|
||||||
253587
|
999009
|
||||||
253587
|
999009
|
||||||
253587
|
999009
|
||||||
|
|
||||||
#2 x Precinct Captain (RTR), {w}{w}, Creature Human Soldier, 2/2, first strike;
|
#2 x Precinct Captain (RTR), {w}{w}, Creature Human Soldier, 2/2, first strike;
|
||||||
270792
|
999171
|
||||||
270792
|
999171
|
||||||
|
|
||||||
#4 x Wayfaring Temple (RTR), {1}{g}{w}, Creature Elemental, 0/0,
|
#4 x Wayfaring Temple (RTR), {1}{g}{w}, Creature Elemental, 0/0,
|
||||||
253539
|
999260
|
||||||
253539
|
999260
|
||||||
253539
|
999260
|
||||||
253539
|
999260
|
||||||
|
|
||||||
#1 x Worldspine Wurm (RTR), {8}{g}{g}{g}, Creature Wurm, 15/15, trample;
|
#1 x Worldspine Wurm (RTR), {8}{g}{g}{g}, Creature Wurm, 15/15, trample;
|
||||||
253575
|
999262
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -57,14 +57,14 @@
|
|||||||
369060
|
369060
|
||||||
|
|
||||||
#2 x Chromatic Lantern (RTR), {3}, Artifact,
|
#2 x Chromatic Lantern (RTR), {3}, Artifact,
|
||||||
290542
|
999039
|
||||||
290542
|
999039
|
||||||
|
|
||||||
#4 x Growing Ranks (RTR), {2}{g/w}{g/w}, Enchantment,
|
#4 x Growing Ranks (RTR), {2}{g/w}{g/w}, Enchantment,
|
||||||
270957
|
999106
|
||||||
270957
|
999106
|
||||||
270957
|
999106
|
||||||
270957
|
999106
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -84,26 +84,26 @@
|
|||||||
369018
|
369018
|
||||||
|
|
||||||
#4 x Forest (RTR), Basic Land Forest,
|
#4 x Forest (RTR), Basic Land Forest,
|
||||||
289326
|
999086
|
||||||
289326
|
999086
|
||||||
289326
|
999086
|
||||||
289326
|
999086
|
||||||
|
|
||||||
#4 x Plains (RTR), Basic Land Plains,
|
#4 x Plains (RTR), Basic Land Plains,
|
||||||
289310
|
999168
|
||||||
289310
|
999168
|
||||||
289310
|
999168
|
||||||
289310
|
999168
|
||||||
|
|
||||||
#2 x Temple Garden (RTR), Land Forest Plains,
|
#2 x Temple Garden (RTR), Land Forest Plains,
|
||||||
253681
|
999238
|
||||||
253681
|
999238
|
||||||
|
|
||||||
#4 x Plains (RTR), Basic Land Plains,
|
#4 x Plains (RTR), Basic Land Plains,
|
||||||
289309
|
999265
|
||||||
289309
|
999265
|
||||||
289309
|
999265
|
||||||
289309
|
999265
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 522 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 233 KiB |
|
Before Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 140 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 405 KiB After Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 177 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 489 KiB After Width: | Height: | Size: 115 KiB |