1815 Commits

Author SHA1 Message Date
Eduardo
8b620627d9 Major Corrections to WAR and removing crashing cards
Cards that check the colors of mana that lands on the opponent battlefield crashes the game, hard to reproduce but happens often enought that I decided to remove them.

Minor fixes in set and Major fixes in WAR primitives
2019-05-01 17:19:01 -05:00
Eduardo
d943778309 Double face cards should be marked as tokens 2019-05-01 17:09:27 -05:00
Eduardo
06cb835a5b Teaching AI proliferate and shocklands
Some minor changes, corrections to XLN and C17, changing name of game mode from horde to tribal wars
2019-05-01 17:00:48 -05:00
Eduardo
f1a529576e Preparing for a release, bug fixes and adjustments to game modes
Updating macros and new cards marked as borderline
2019-04-25 18:03:41 -05:00
Eduardo MG
1af3cff419 Uploading sets since Amonkhet until War of the spark
These are graded as borderline, each set has it's individual txt file, not integrated to the main mtg.txt to make them easier to manage, with the appropiate tools and more testing the files can be integrated. 

Includes standard sets(expansions) and supplemental products(masters sets, commander) since Amonkhet.
2019-04-25 17:53:49 -05:00
Eduardo
5db6b807ba Set limited game mode, AI changes, primitives and _cards.dat corrections
New set limited ,where you get a deck two random sets.

Still playing with the AI values and hueristics.

Cards fixes. Masters Edition should be named ME1 and the Mythic Edition is MED, the cards multiverse ids are still the same so the decks and references should not change.
2019-04-20 15:51:52 -05:00
Eduardo MG
1c6b0bdfd5 New game modes
Rules for several new game modes and rules

horde, get a random tribe and summon a creature from your deck each turn
paradise, lands tap for all mana
false god, exchange permanents at upkeep
morinfen, lose 1 life for every permanent you control at upkeep, starts at 50 life
2019-04-20 12:25:58 -05:00
Eduardo
3dfcc65fa6 Bug fix for the biggest crash and fixes to the primitives
I figured a while ago that the cause of the crash was a rendering issue, not an engine issue, since you could copy spells in the stack if you didn't targeted them. The crash was most likely in ActionStack, just had to follow the trace. It doesn't affect anithing else, that line was trying to render something in the stack that's a permanent but it always had bad ptrs.
2019-04-17 20:28:43 -05:00
Eduardo
c3937ce517 Fixing primitives and mayor bugs report
Game crashes when AI plays a card with cost {X} and that targets a player, this cards can be coded around that restriction and still work as per the rules.

The BIGGEST BUG the game has now is that crashes occur when a PERMANENT TARGETS A SPELL IN THE STACK, sometimes the AI can make this cards work (WTH!?) but never the player.

Effects like mirari and similar could be coded so that you don't target the spell but trigger and copy the source of the trigger, look at the code of mirari for this to be more clear.

This effect used to work for many many years I remember  Glen Elendra Archmage being one of my favorite cards back in the day. This bug has been present since god knows when, as early as october 2016: https://wololo.net/forum/viewtopic.php?f=4&t=66296&start=150#p98160

Also freaking Lemures caused the AI to just keep repeating the effect so I put a limit on activations on them.
2019-04-14 21:56:20 -05:00
Eduardo
ab1fbaa806 New game modes, bug fixes in primitives, improving AI, new planeswalkers type rule
New rules based on vanguard, 3 new random game modes, one is tribal and one uses any card in the game.

Several corrections and bugs fixes. Cards with x in their cost and that can target any player used to crash the game.

Teaching AI new things and changing values of efficiency.

You can have multiple "Jace" planeswalkers, you can't have two of the exact same name (no two Jace, the mind sculptor).
2019-04-14 19:57:01 -05:00
Eduardo
6eca5bea2f Last March Update
Some bug fixing to the primitives, the fetchlands are so buggy that I restored to a simple version

Some minor UI improvements
2019-03-31 20:53:13 -06:00
Rolzad73
e4d73d95ec - removing debug info after travis build fix 2019-03-27 22:50:10 -04:00
Rolzad73
363383df6d - try to fix travis build travis script debug pt 7 (groovy, Java 8 incompatibility) 2019-03-27 22:15:48 -04:00
Rolzad73
0d05804376 - try to fix travis build travis script debug pt 6 (ant error log too long) 2019-03-27 22:04:11 -04:00
Rolzad73
cdd36a404b - try to fix travis build travis script debug pt 5 2019-03-27 21:42:37 -04:00
Rolzad73
64c509980c - fix bad commit travis.yml 2019-03-27 21:39:38 -04:00
Rolzad73
46ba018201 - try to fix travis build travis script debug pt 4 2019-03-27 21:37:38 -04:00
Rolzad73
0cb931e6e2 - try to fix travis build travis script debug pt 3 2019-03-27 21:25:26 -04:00
Rolzad73
58af6f73d9 - try to fix travis build travis script debug pt 2 2019-03-27 21:12:46 -04:00
Rolzad73
e81f1299cb - try to fix travis build travis script debug 2019-03-27 21:03:40 -04:00
Rolzad73
9b5f9684b0 - try to fix travis build android dependancies pt 3 2019-03-27 20:48:21 -04:00
Rolzad73
d934c0948c - try to fix travis build android dependancies pt 2 2019-03-27 20:45:05 -04:00
Rolzad73
917a3a88df - try to fix travis build android dependancies 2019-03-27 20:38:51 -04:00
Rolzad73
dc5b8a8c52 - try to fix travis build 2019-03-27 15:50:08 -04:00
Eduardo MG
d2b44e652b Uploading a couple of years of sets
RNA Guild Kit		Set Code: GK2
Ravnica Allegiance	Set Code: RNA
Ultimate Box Topper Set Code: PUMA
Ultimate Masters	Set Code: UMA
GRN Guild Kit		Set Code: GK1
Guilds of Ravnica	Set Code: GRN
Commander 2018	Set Code: C18
Core Set 2019		Set Code: M19
Signature 
Spellbook: Jace	Set Code: SS1
Battlebond 		Set Code: BBD
Commander Anthology 
Volume II			Set Code: CM2
Dominaria		Set Code: DOM
Duel Decks: Elves 	
vs. Inventors		Set Code: DDU
Masters 25 		Set Code: A25
Rivals of Ixalan	Set Code: RIX
Unstable			Set Code: UST
Explorers of Ixalan   Set Code: E02
From the Vault: 
Transform		Set Code: V17
Iconic Masters		Set Code: IMA
Duel Decks: Merfolk
vs. Goblins		Set Code: DDT
Ixalan			Set Code: XLN
Commander 2017	Set Code: C17
Hour of Devastation Set Code: HOU
Archenemy: Nicol 
Bolas			Set Code: E01
Commander Anthology	Set Code: CMA
Amonkhet			Set Code: AKH
Amonkhet 
Invocations			Set Code: MP2
Duel Decks: Mind 
vs. Might			        Set Code: DDS
Modern Masters 2017	Set Code: MM3
2019-03-26 20:35:45 -06:00
Eduardo
1ce3b469e7 Update primitives
Added the supertype Legendary to Planeswalkers.

When you pay life the code should be {L:1}  not just {L} or else the cards ave very buggy.

Several bug fixes, card corrections and typos.
2019-03-26 16:50:34 -06:00
Anthony Calosa
07e6d90c98 Merge pull request #975 from kevlahnota/master
Some fixes
2017-08-06 13:33:07 +08:00
Anthony Calosa
85231cda01 Fix Nissa's Chosen
Code seems workaround, it needs hardcoded...
2017-08-05 22:09:49 +08:00
Anthony Calosa
8549b7b1b4 Interrupt targetted abilities
This should have an option...
2017-08-05 18:52:27 +08:00
Anthony Calosa
9f58ef9916 small fixes for primitives 2017-08-05 18:16:47 +08:00
Anthony Calosa
c734ee9fd1 Add exert Indicator
"*" signifies exert
2017-08-05 18:16:24 +08:00
Anthony Calosa
77d87902d9 Add restriction for exert
hasexerted and notexerted
2017-08-05 18:15:44 +08:00
Anthony Calosa
b5c8656ac9 Fix Blink 2017-08-05 18:15:13 +08:00
Anthony Calosa
28f6b73da6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-08-03 20:03:26 +08:00
Anthony Calosa
521b505543 Merge pull request #974 from kevlahnota/master
Fix morbid
2017-08-03 19:54:35 +08:00
Anthony Calosa
c5a3310103 quick Fix for zerodead 2017-08-03 18:32:16 +08:00
Anthony Calosa
0c053c713a fix morbid
also added zerodead restriction - returns true if you dont have any
creature that died this turn
2017-08-03 18:27:45 +08:00
Anthony Calosa
bc06f93aae Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-08-03 15:52:56 +08:00
Anthony Calosa
8e919aeeb1 Merge pull request #973 from kevlahnota/master
Support for AKH/HOU Mechanics
2017-08-03 10:36:15 +08:00
Anthony Calosa
6bd09e42e0 Add support for Amonkhet Mechanics
and fix some cards.
Added exerted trigger, event and add removemc keyword inside transforms
ability so we can soft code Embalm and Eternalize...
2017-08-03 09:49:37 +08:00
Anthony Calosa
1f670b9919 Merge pull request #12 from WagicProject/master
Update unsuported cards, set a condition for showing poison counters …
2017-08-03 09:16:30 +08:00
punkeduard
c805a58fb0 Update unsuported cards, set a condition for showing poison counters and energy counter, added tribal al card type check, show the amount o 2017-08-02 18:42:52 -05:00
Anthony Calosa
34517004df Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-05-09 12:38:59 +08:00
Anthony Calosa
b0506bcd96 Merge pull request #968 from kevlahnota/master
readded fixes by punkeduard
2017-05-09 12:29:16 +08:00
Anthony Calosa
7a3a6c04a6 readded fixes by punkeduard 2017-05-09 12:28:07 +08:00
Anthony Calosa
54e4b08e1f Merge pull request #11 from WagicProject/master
test pull
2017-05-09 12:25:45 +08:00
Anthony Calosa
67c22c5186 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-05-09 12:09:12 +08:00
punkeduard
87aba86fa8 Revert "Fixing bugs in the primitives"
This reverts commit 665f8ce755.
2017-05-08 22:17:27 -05:00
Rolzad73
28ea300f42 - fix forward declaration 2017-05-08 19:39:32 -04:00
Rolzad73
858c26b46a Merge pull request #966 from WagicProject/key_bind_changes
Key bind changes
2017-05-08 19:03:03 -04:00
Rolzad73
70a6c7149c - semi cleanup 2017-05-08 19:01:41 -04:00
Rolzad73
b4a34216c8 - updated Qt keybinding translation 2017-05-08 18:58:47 -04:00
Anthony Calosa
3868f4eb98 Merge pull request #965 from kevlahnota/master
Minor Corrections
2017-05-08 12:15:44 +08:00
Anthony Calosa
44304ee5b3 minor corrections 2017-05-08 11:41:00 +08:00
Anthony Calosa
9f4b8d65c8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-05-08 11:33:57 +08:00
punkeduard
665f8ce755 Fixing bugs in the primitives
Daring Sleuth was crashing the game in the collection
2017-05-03 14:42:10 -05:00
Anthony Calosa
e1d5348f23 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-20 11:37:01 +08:00
Anthony Calosa
b596dc9eea Merge pull request #964 from kevlahnota/master
Add some cards
2017-03-20 06:09:04 +08:00
Anthony Calosa
eb8370b86b add some cards
also added countb() - countedbamount..
2017-03-19 21:57:59 +08:00
Anthony Calosa
fa69686f0a Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-19 08:59:21 +08:00
Rolzad73
3fe5372d28 non-commit to test build 2017-03-18 11:27:20 -04:00
Anthony Calosa
3058d42b49 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-16 20:58:36 +08:00
Anthony Calosa
4975ee0028 Merge pull request #963 from kevlahnota/master
Bushido, Modular points
2017-03-16 17:53:14 +08:00
Anthony Calosa
d4e1d809f3 Bushido & Modular
add Bushido and Modular points
2017-03-16 16:58:56 +08:00
Anthony Calosa
44cb0d995e support some cards discarded by opponent 2017-03-16 10:58:27 +08:00
Anthony Calosa
c73d08187b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-16 06:11:27 +08:00
Anthony Calosa
4382c34539 Merge pull request #962 from kevlahnota/master
minor fixes
2017-03-15 12:54:44 +08:00
Anthony Calosa
cb173b7bf9 update unsupported 2017-03-15 11:46:47 +08:00
Anthony Calosa
b5d4674471 unused variable 2017-03-15 11:23:53 +08:00
Anthony Calosa
be1803dfb6 unearth rule 2017-03-15 06:35:30 +08:00
Anthony Calosa
417c1af21e hide action stack
if there's a human player and a menu object
2017-03-15 06:31:39 +08:00
Anthony Calosa
00bccd02da Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-15 06:16:46 +08:00
punkeduard
8596443da5 Fixing card primitives
Add flying to an angel and corrected some values on mana costs
2017-03-14 12:53:29 -06:00
Anthony Calosa
a2eda76a26 fix prefetch options 2017-03-14 17:06:14 +08:00
Anthony Calosa
b4e25838bd update targetchooser 2017-03-14 09:15:14 +08:00
Anthony Calosa
44d703887c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-14 09:12:05 +08:00
Anthony Calosa
29fd3e4c96 Merge pull request #961 from kevlahnota/master
Totem Armor
2017-03-14 05:39:38 +08:00
Anthony Calosa
0778b13e2b Totem Armor 2017-03-14 03:40:29 +08:00
Anthony Calosa
bef1f6d8b8 aura parent 2017-03-13 18:16:22 +08:00
Anthony Calosa
d6a0b04930 Partial fix for Cards with Bestow
missing was to seperate the mode as aura enchantment or enchantment
creature when cast and update the cost
2017-03-13 13:32:43 +08:00
Anthony Calosa
87ae60f323 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-12 22:14:59 +08:00
Anthony Calosa
85df061701 Merge pull request #960 from kevlahnota/master
Update Rules
2017-03-12 12:14:09 +08:00
Anthony Calosa
4ed44c638f Update Rules
Also fix stack display and removed unnecessary code (border for card is
targetted/targetter since we used forcedborder in actionstack). Also
fixed some cards
2017-03-12 10:53:39 +08:00
Anthony Calosa
54f0cd7864 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-12 07:36:00 +08:00
Rolzad73
4f523b1b9b Non-commit to test build system 2017-03-11 12:01:07 -05:00
Anthony Calosa
d492481a4f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-11 22:10:28 +08:00
Anthony Calosa
3975a45858 Merge pull request #959 from kevlahnota/master
Hide action stack & Sorted Filter
2017-03-11 10:48:17 +08:00
Anthony Calosa
5f2fbb370c fix 2017-03-11 07:57:54 +08:00
Anthony Calosa
d9bd6bbb32 cascade, cascade 2017-03-10 19:25:54 +08:00
Anthony Calosa
31814bda37 sort filter 2017-03-10 19:24:49 +08:00
Anthony Calosa
8f61b590f8 Hide Action stack if there's a menu object 2017-03-10 19:24:39 +08:00
Anthony Calosa
37642c1f78 rageform
rageform, lightform & cloudform support. withenchant is for only these
cards...
2017-03-10 14:14:02 +08:00
Anthony Calosa
8ea7b4d4cb Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-10 13:43:31 +08:00
Anthony Calosa
245f5c6e93 Merge pull request #958 from kevlahnota/master
Ripple Cards
2017-03-10 12:58:02 +08:00
Anthony Calosa
88d1c29621 safe delete 2017-03-10 08:49:35 +08:00
Anthony Calosa
44926393ac Ripple cards 2017-03-10 07:19:29 +08:00
Anthony Calosa
5d790c9406 moved lastcontroller override 2017-03-10 07:19:15 +08:00
Anthony Calosa
66261b0f51 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-10 07:08:56 +08:00
Anthony Calosa
e99a9abacd Merge pull request #957 from kevlahnota/master
Provoke
2017-03-09 19:34:10 +08:00
Anthony Calosa
b01c1455f5 Provoke
also add aicode for Amplify cards
2017-03-09 18:37:55 +08:00
Anthony Calosa
650d794eec Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-09 14:33:29 +08:00
Anthony Calosa
acf74e7f6e Merge pull request #956 from kevlahnota/master
Manifest Cards & corrections
2017-03-09 09:07:45 +08:00
Anthony Calosa
53f0c2421d manifest support
also fix guiplay
2017-03-09 07:44:06 +08:00
Anthony Calosa
01d46615a7 fix credits 2017-03-09 02:01:08 +08:00
Anthony Calosa
57f55e4270 corrections 2017-03-08 22:44:34 +08:00
Anthony Calosa
5c159e86d7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-08 20:52:04 +08:00
Anthony Calosa
fb03037923 Merge pull request #955 from kevlahnota/master
Adjust stack display & game credits
2017-03-08 16:14:09 +08:00
Anthony Calosa
ff6e4aec9a adjust stack display & game credits
the stack will display the latest object always on TOP so we can see
which will resolve first, the last to resolve will always be on
bottom... also increase credit bonus. default is 500 credits and for
momir will be 800 credits.
2017-03-08 13:38:19 +08:00
Anthony Calosa
c78db0eb26 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-08 05:46:00 +08:00
Anthony Calosa
324e206b74 Merge pull request #954 from kevlahnota/master
Deck Sideboard and Wish Cards
2017-03-08 02:37:09 +08:00
Anthony Calosa
030dca051a support for wish cards and deck sideboard 2017-03-07 23:42:34 +08:00
Anthony Calosa
24e3fd3267 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-07 15:47:18 +08:00
Anthony Calosa
a28f6b1194 Merge pull request #953 from kevlahnota/master
Etched Affinity stalling the game
2017-03-07 05:32:38 +08:00
Anthony Calosa
38e97aa79f fix etched affinity stalling the game
add an alias for glimmervoid and removed the hold combo hint for
glimmervoid, just tried etched affinity vs etched affinity on demo for
50 games... it doesn't stall anymore. it seems there's a conflict
somewhere parsing hint combo? not really sure... also in momir the ai
don't click choose a color command, noticed on lotus cobra so i changed
the chooseacolor to abilty$! add{mana} ...
2017-03-06 17:52:44 +08:00
Anthony Calosa
8adfd1b10b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-06 12:52:58 +08:00
Anthony Calosa
ffda7a53fe Merge pull request #952 from kevlahnota/master
Prefetching as options
2017-03-06 11:19:53 +08:00
Anthony Calosa
20ddd9157f prefetching options 2017-03-06 10:41:52 +08:00
Anthony Calosa
a3f329bd7a Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-06 10:40:25 +08:00
Anthony Calosa
13c6837b60 Merge pull request #951 from kevlahnota/master
Show large images on grid deck view user option
2017-03-06 06:25:03 +08:00
Anthony Calosa
84fe9fbc74 highlight border fix
all selected/targeted cards ar bordered red while the source is green
border
2017-03-05 22:38:53 +08:00
Anthony Calosa
e5ec92ac2a corrected order of options 2017-03-05 22:09:12 +08:00
Anthony Calosa
12155f9390 forgot this 2017-03-05 21:56:54 +08:00
Anthony Calosa
00da0bd0d1 seperate tabs
Misc setting that I added
2017-03-05 21:28:18 +08:00
Anthony Calosa
4bf5943ac5 show large images on grid deck view user option
also forced border targets and target source
2017-03-05 19:43:49 +08:00
Anthony Calosa
f205de7205 minor fix 2017-03-04 09:15:50 +08:00
Anthony Calosa
f782c535f9 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-04 06:49:06 +08:00
Anthony Calosa
030d6bc4bb Merge pull request #950 from kevlahnota/master
Swap zones - exile and library for opponent
2017-03-04 05:42:34 +08:00
Anthony Calosa
9c10574e49 replaced some overlay 2017-03-04 04:24:40 +08:00
Anthony Calosa
9512e5c3db fix overlapping of phaseinfo/phase bar
the opponent cards will stack according to handsize
2017-03-04 04:24:10 +08:00
Anthony Calosa
8686fef96a enstacking of card during combat
during combat damage, the cards will not move/enstack so we can see what
happened to those creatures...
2017-03-04 04:23:19 +08:00
Anthony Calosa
06285c11c7 swap zone position for opponent
swap position of opponent exile zone and opponent library zone, since a
lot of codes use reveal for library, and hand, it's much easier to
target the exile . Also cards that display from the top of library is
not blocked anymore.
2017-03-04 04:21:43 +08:00
Anthony Calosa
3b58790c96 Add files via upload 2017-03-04 02:34:33 +08:00
Anthony Calosa
a8b494f960 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-04 02:28:51 +08:00
Anthony Calosa
72c6f448d0 Merge pull request #949 from kevlahnota/master
Support for playing the top card of library
2017-03-03 22:57:37 +08:00
Anthony Calosa
ce3c75817c draw line when attacking planeswalker 2017-03-03 22:20:38 +08:00
Anthony Calosa
56c943d6d1 bug fix
reset will attack player/planeswalker
2017-03-03 22:20:13 +08:00
Anthony Calosa
21b0b4c524 Play the Top Card of Library 2017-03-03 18:49:36 +08:00
Anthony Calosa
51daf691b3 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-03 11:20:39 +08:00
punkeduard
e889aff42c Merge branch 'refs/heads/Mine' 2017-03-02 20:37:48 -06:00
punkeduard
df07b6dc9e Corrected some text on cards primitives 2017-03-02 20:34:30 -06:00
Anthony Calosa
63c15b54d6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-03 06:31:41 +08:00
Anthony Calosa
b76a231083 Merge pull request #948 from kevlahnota/master
Attack Menu
2017-03-03 06:06:57 +08:00
Anthony Calosa
e0f58e1916 attack/block cost value 2017-03-03 00:39:23 +08:00
Anthony Calosa
78bfa604e2 tidy up attack menu 2017-03-02 21:46:29 +08:00
Anthony Calosa
dcbe0c40b0 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-02 18:59:07 +08:00
Anthony Calosa
f384d75de8 Merge pull request #947 from kevlahnota/master
Fix Aura/Equipment on Illegal Objects
2017-03-02 16:51:11 +08:00
Anthony Calosa
cf6084071b fix aura attached on illegal objects
704.5n If an Aura is attached to an illegal object or player, or is not
attached to an object or player, that Aura is put into its owner’s
graveyard.

704.5p If an Equipment or Fortification is attached to an illegal
permanent, it becomes unattached from that permanent. It remains on the
battlefield.

704.5q If a creature is attached to an object or player, it becomes
unattached and remains on the battlefield. Similarly, if a permanent
that’s neither an Aura, an Equipment, nor a Fortification is attached to
an object or player, it becomes unattached and remains on the
battlefield.
2017-03-02 14:26:06 +08:00
Anthony Calosa
0150796064 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-02 14:10:01 +08:00
Anthony Calosa
f91186ffa4 Merge pull request #946 from kevlahnota/master
lastcontroller & card update
2017-03-02 10:50:43 +08:00
Anthony Calosa
ba73da321b minor 2017-03-02 07:56:41 +08:00
Anthony Calosa
8ae3e1ea98 quick fix 2017-03-01 21:13:47 +08:00
Anthony Calosa
fa5b075af5 update lords
lastcontroller override
2017-03-01 20:51:06 +08:00
Anthony Calosa
a66fced2f7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-01 18:51:26 +08:00
Anthony Calosa
33492602fb Merge pull request #945 from kevlahnota/master
Updated attack rule & revert some activated "lord" to use "all"
2017-03-01 18:49:02 +08:00
Anthony Calosa
b7dae1025b Refactored PW Attack Rule 2017-03-01 17:53:40 +08:00
Anthony Calosa
7627a00dce arboria 2017-03-01 16:09:31 +08:00
Anthony Calosa
d761bac85c revert pw attack rule
need to refactor this as this cause crashes on android when you cast a
planeswalker
2017-03-01 16:07:12 +08:00
Anthony Calosa
3bf1cca118 removed this 2017-03-01 14:15:57 +08:00
Anthony Calosa
cdb056e8ba forgot this 2017-03-01 10:45:17 +08:00
Anthony Calosa
e47256eae7 update cant attack rule
If it says cant attack or cant attack You or PlanesWalker, creatures
cant attack a player or planeswalker, If it says cant attack You,
creatures cant attack a player only but can attack a PlanesWalker
2017-03-01 10:35:47 +08:00
Anthony Calosa
5f1874edae planeswalker attack 2017-03-01 06:36:10 +08:00
Anthony Calosa
22376e873e corrections
seems lord is persistent now
2017-02-28 21:45:34 +08:00
Anthony Calosa
02d882a7c3 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-28 18:22:59 +08:00
Anthony Calosa
d878e0c450 Merge pull request #944 from kevlahnota/master
Momir Indicator (non PSP)
2017-02-28 18:12:40 +08:00
Anthony Calosa
1430cfd6b4 momir indicator (non PSP)
green + can play a land, red + means you already played a land/ or cant
play a land anymore. also some minor fix
2017-02-28 17:32:01 +08:00
Anthony Calosa
5a3493c0c9 update spelltargettype 2017-02-28 16:19:59 +08:00
Anthony Calosa
911f8f6de6 update scry then draw
also moved "show token in editor" in general settings
2017-02-28 10:41:46 +08:00
Anthony Calosa
fe8fbd058b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-28 06:50:13 +08:00
Anthony Calosa
c4529a0949 Merge pull request #943 from kevlahnota/master
Filter View
2017-02-28 06:23:21 +08:00
Anthony Calosa
6ec3a68f0a update some cards 2017-02-27 22:52:33 +08:00
Anthony Calosa
458731778d add options show tokens
you can display tokens in editor (show tokens and choose 0 manacost) but
you can't add them, useful for tracking missing images...
2017-02-27 21:50:15 +08:00
Anthony Calosa
64547271dc Filter View
Tokens are excluded in deck editor, filter and adjust filter menu
2017-02-27 13:21:35 +08:00
Anthony Calosa
9e584951ac Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-27 06:50:31 +08:00
Anthony Calosa
c859fdd08e Merge pull request #942 from kevlahnota/master
Crash fix and some card update
2017-02-27 00:34:16 +08:00
Anthony Calosa
1380ee6f20 equal
typo fix
2017-02-26 23:21:23 +08:00
Anthony Calosa
2da2272a53 update some cards 2017-02-26 23:13:45 +08:00
Anthony Calosa
17b6996ae4 tokens
cant buy and/or add tokens in deck editor and shop...
also adjust filter menu
2017-02-26 21:21:11 +08:00
Anthony Calosa
0f82b6efba crash fix mana ability filter 2017-02-26 15:22:16 +08:00
Anthony Calosa
178fcb9717 update some cycled cards 2017-02-26 09:38:11 +08:00
Anthony Calosa
19f0c653d1 add 1k to steal credits
maxglee profile
2017-02-26 09:36:32 +08:00
Anthony Calosa
7dc76876e4 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-25 20:48:07 +08:00
Anthony Calosa
60457886cc Merge pull request #941 from kevlahnota/master
Customlen
2017-02-25 12:19:25 +08:00
Anthony Calosa
ec078b6ccc customLen
for formatting text on booster shop, we pass the desired length from
getformatted text with noremove(no removal of {}) enabled, if its not
enabled then default the value to zero(passing zero means use the
default values)
2017-02-25 07:27:57 +08:00
Anthony Calosa
ec730a4383 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-25 07:22:27 +08:00
Anthony Calosa
b2b3255f59 Merge pull request #940 from kevlahnota/master
Booster Shop
2017-02-24 22:21:22 +08:00
Anthony Calosa
df925cfcb0 booster shop enhancement 2017-02-24 21:45:43 +08:00
Anthony Calosa
5b96f30b1a reversed 2017-02-24 18:22:01 +08:00
Anthony Calosa
8feb870c8f shop enhancements 2017-02-24 17:29:59 +08:00
Anthony Calosa
d0b2340a73 crash fix in buying booster
this should be in game only
2017-02-24 15:04:12 +08:00
Anthony Calosa
efac298eb0 revert jtypes 2017-02-24 15:03:28 +08:00
Anthony Calosa
453c5b0d6e Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-24 10:06:00 +08:00
Anthony Calosa
816010582a Merge pull request #939 from kevlahnota/master
Update some cards
2017-02-24 08:55:00 +08:00
Anthony Calosa
a260eb11a8 crash fix 2017-02-24 07:25:38 +08:00
Anthony Calosa
b1d271f1c2 add forced interrupt 2017-02-24 07:25:19 +08:00
Anthony Calosa
3faa959c09 updated some cards 2017-02-24 06:02:00 +08:00
Anthony Calosa
a12a5e1637 test swap 2017-02-23 19:05:37 +08:00
Anthony Calosa
7c6d59a292 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-23 19:04:15 +08:00
Anthony Calosa
9836d8595c Merge pull request #938 from kevlahnota/master
Refactor efficiency
2017-02-23 18:17:15 +08:00
Anthony Calosa
c9d5dfaf1b minor adjustments 2017-02-23 18:16:23 +08:00
Anthony Calosa
028f6cbb4e u32 2017-02-23 17:11:42 +08:00
Anthony Calosa
c56d1b0bec pixel type
psp
2017-02-23 16:33:38 +08:00
Anthony Calosa
2e61f6c13d test pixel_type 2017-02-23 16:08:04 +08:00
Anthony Calosa
8437467320 refactor revealed efficiency
it's based now on actual aicode if it's available.
2017-02-23 14:10:27 +08:00
Anthony Calosa
039be43c2b set the current controller to do action
let the controller of the action do the abilty, also fix casted cards
that's been casted using castcard and be put into its owner's graveyard
2017-02-23 14:04:16 +08:00
Anthony Calosa
a1af7d9b9f add black border option
if enabled, all cards will have black border
2017-02-23 08:38:15 +08:00
Anthony Calosa
4ce37964f4 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-22 22:26:28 +08:00
Anthony Calosa
c1cdfa78d3 Merge pull request #937 from kevlahnota/master
update some cards
2017-02-22 22:06:31 +08:00
Anthony Calosa
ff4911116c update some cards
removed phasedout trigger
add phasedoutbonus - ability
2017-02-22 18:25:39 +08:00
Anthony Calosa
bb9d98cc0c AI ignore sphinx of jwar isle 2017-02-20 23:23:13 +08:00
Anthony Calosa
2d93d9b3cc moved this block for PSP
maybe we can fix the GUI for psp, low priority for now
2017-02-20 22:08:09 +08:00
Anthony Calosa
1c60ba6e7f crash fix
when you generate a castcard, then exit the game, an exception occurs to
SAFE_DELETE(cards[i]->previous) && SAFE_DELETE(cards[i]) in
mtggamezones.cpp line 548 and 549.
2017-02-20 22:06:56 +08:00
Anthony Calosa
11b3989615 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-20 10:08:28 +08:00
Anthony Calosa
c9f26a48c7 Merge pull request #936 from kevlahnota/master
update some cards
2017-02-19 23:23:06 +08:00
Anthony Calosa
75cbaf0f06 update mana producer
change && to andability
2017-02-19 22:44:33 +08:00
Anthony Calosa
de1dc6828d try to fix phase name
sometimes its invalid phase name
2017-02-19 22:11:54 +08:00
Anthony Calosa
e6bf23e536 add saclands cost
sacrifice all lands {saclands} cost
2017-02-19 22:11:16 +08:00
Anthony Calosa
5b16ff4a69 bypass update when reveal display is still active 2017-02-19 21:11:24 +08:00
Anthony Calosa
ed42c3fd29 support andability in mana producer
so cards that parse mana abilities can be read (reflecting pool. etc..
fixes issue #700 but we need to update the code from add{mana} && do
something to add{mana} and!( do something)! )
2017-02-19 21:11:02 +08:00
Anthony Calosa
9cd67eedc1 refactor canproducemana 2017-02-19 21:08:07 +08:00
Anthony Calosa
acc589bdb6 universal border 2017-02-19 10:16:25 +08:00
Anthony Calosa
2d78512ca2 bypass gamestate check
when there is an opened display for reveal... it will update after its
finished...
2017-02-19 10:14:43 +08:00
Anthony Calosa
84023a5f66 test fix 2017-02-18 21:36:38 +08:00
Anthony Calosa
443f378d1b updated some card
a lot of cards needs update though...
2017-02-18 21:20:45 +08:00
Anthony Calosa
d4989d7576 replaced alphabeta 2017-02-17 21:31:41 +08:00
Anthony Calosa
860b0b64e3 Adjust Extracost string 2017-02-17 19:17:23 +08:00
Anthony Calosa
ba40253a46 Phase out Event & Trigger 2017-02-17 14:25:33 +08:00
Anthony Calosa
95b81b6425 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-17 05:26:28 +08:00
Anthony Calosa
b664c2bed1 Merge pull request #935 from kevlahnota/master
Some New Changes
2017-02-16 22:33:58 +08:00
Anthony Calosa
c6c4c17b30 try to fix parenthesis
:(
2017-02-16 21:57:17 +08:00
Anthony Calosa
5e46016c4d added new legend & pw rule, trigger & event
added new pw & legend rule (i just leave the old rules behind and
disabled it), added phasesin, faceup, copiedacard event, added facedup &
phasedin trigger.
2017-02-16 21:26:03 +08:00
Anthony Calosa
da874738d6 castcard generated card 2017-02-16 17:10:06 +08:00
Anthony Calosa
0a68a056d8 refactor canproducemana 2017-02-16 16:55:13 +08:00
Anthony Calosa
5a3a32462d first set of changes
updated some cards
2017-02-16 02:44:42 +08:00
Anthony Calosa
c70762f871 readded modified rule 2017-02-16 02:39:03 +08:00
Anthony Calosa
6c28496dd8 reduced efficiency 2017-02-16 00:42:54 +08:00
Anthony Calosa
90ed6e1fdd chooseacolor indicator
replaced text with color filled rectangle
2017-02-16 00:28:07 +08:00
Anthony Calosa
60d7675a36 necroed
hide cards using necroed
also fix castcard target if its a land.
2017-02-15 10:27:56 +08:00
Anthony Calosa
a9b42127d1 added mypos
mypos returns cards zpos (zone position)
2017-02-15 07:30:13 +08:00
Anthony Calosa
01fdcfdfec zpos and zone display
added zone position (adjust dynamically), also inverts the display of
the zone so we always get the top/recent one... the library zpos is
inverted so if we choose to target the top 5 zpos like
target(*[zpos>=5|mylibrary), it will do from top to bottom... this is
only for AI so we can add alternate code for them since they cant use
reveal atm, we can make them target within allowed range...
Also this commit disabled the  new legend and planeswalker rule since it
conflicts with reveal ability, unless I/We figure it out, I recommend to
use the old one...
2017-02-14 22:30:50 +08:00
Anthony Calosa
2d383e237f hiddenview
if the target is in library and the source has the hiddenface ability
then hide it
2017-02-14 05:09:28 +08:00
Anthony Calosa
143b3d98b1 modified guiopponenthand 2017-02-13 20:11:07 +08:00
Anthony Calosa
6f4377de76 Inverted this
we transform with no value.. get the value first then transform it to
lower...
2017-02-13 17:54:55 +08:00
Anthony Calosa
722056e78a moved this 2017-02-13 10:43:22 +08:00
Anthony Calosa
21710ddfb3 refactor AAMover getmenu text 2017-02-13 09:35:05 +08:00
Anthony Calosa
13f590c6a2 hiddenface
if the source has hiddenface ability then all of its targets will not
show on the stack ability, useful for cards like demonic tutor etc...
2017-02-13 08:26:06 +08:00
Anthony Calosa
d604ae2d77 add gravecast restriction
if gravecast then do something
-> translates when this card was cast from a graveyard
2017-02-13 07:49:37 +08:00
Anthony Calosa
7a35c253cb refine display 2017-02-12 19:43:10 +08:00
Anthony Calosa
b5129f702e add multi target quads
stack displays target quads up to 10 targets. also displays actual
number of targets...
2017-02-12 10:29:13 +08:00
Anthony Calosa
6b1e51b4f6 revised masks 2017-02-12 07:08:31 +08:00
Anthony Calosa
3776bff594 add effeciency to use the reveal ability
aicode overrides this on resolve and it seems most cards that have this
has possitive effect
2017-02-11 22:04:20 +08:00
Anthony Calosa
3afcc7fdf9 fix hang aicode ability controller
aicode should be dedicated for AI only...
2017-02-11 18:25:45 +08:00
Anthony Calosa
e74921cbdf fix crash for multiple andAbility 2017-02-11 16:17:31 +08:00
Anthony Calosa
e9c33e3bea revised shocklands 2017-02-11 01:28:14 +08:00
Anthony Calosa
36d4db49ca bug fix 2017-02-11 00:04:17 +08:00
Anthony Calosa
2c40c77403 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-11 00:02:22 +08:00
Anthony Calosa
15febaf851 Merge pull request #934 from kevlahnota/master
Crash fix
2017-02-10 23:02:33 +08:00
Anthony Calosa
02dce1af2e crash fix
transform getaicustomcode to lower
2017-02-10 21:00:18 +08:00
Anthony Calosa
5915ceb0a5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-10 17:36:55 +08:00
Anthony Calosa
d6f666d9a0 Merge pull request #933 from kevlahnota/master
added AER Cards
2017-02-10 16:53:28 +08:00
Anthony Calosa
37fa69fc39 added AER cards 2017-02-10 16:10:15 +08:00
Anthony Calosa
8e47927805 some corrections 2017-02-10 16:03:03 +08:00
Anthony Calosa
f1c1161da5 added AER set 2017-02-10 16:02:29 +08:00
Anthony Calosa
392382e3e3 missing AER 2017-02-10 16:00:03 +08:00
Anthony Calosa
d6403918b6 crash fix
corrected some cards that crashes the game
2017-02-10 13:57:46 +08:00
Anthony Calosa
fc9b0b233c add attacker mask 2017-02-10 10:50:09 +08:00
Anthony Calosa
f16755b86b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-10 09:20:00 +08:00
Anthony Calosa
f45e975b14 add remake keyword
alternative for becomes for use inside transforms...
ex. emblem transforms((,newability[target(land)
remake(creature:1/2:red)])) forever dontremove
2017-02-09 22:38:00 +08:00
Anthony Calosa
b3de6a283d Merge pull request #932 from kevlahnota/master
Some bug fixes
2017-02-09 21:48:51 +08:00
Anthony Calosa
7fa204fc9c forgot to change this 2017-02-09 19:15:32 +08:00
Anthony Calosa
f284a9691b some fixes
fixes fabricate
fixes lorded lands
add propagate keyword (like proliferate but it increases all counters)
cards with proliferate can choose a player now
2017-02-09 15:22:10 +08:00
Anthony Calosa
9bb63a68f5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-08 21:34:15 +08:00
Rolzad73
77d20e89c8 - fixed upload-binaries error from bad debug trace 2017-02-07 20:58:32 -05:00
Anthony Calosa
66f664207a Merge pull request #931 from kevlahnota/master
Changes
2017-02-07 22:12:39 +08:00
Anthony Calosa
bac69f95d8 some changes
change keyword "makecardt" alternative token creator to "create" keyword
add lifeleech - gain life lost with target
2017-02-07 21:22:49 +08:00
Anthony Calosa
75e372ac9b adjust enstack attackers
so we have small room for the phase wheel for touch enabled device
2017-02-07 17:00:37 +08:00
Anthony Calosa
ef31192f33 modified flickleft for android
if you flick/swipe left or right when the closedhand option is visible
in Android, you simulate scroll up/down.
example scenario at opponent's turn with a spell on the stack, swipe
down to interrupt then do something, if you open a zone like library or
graveyard or exile and you want to interract from the zone there (like
casting spell or doing ability from that zone, you can flick left or
right to close that zone so you can tap for mana or any other extra
costs for that spell, you can open the zone if possible just by tapping
it like it used to.)
2017-02-07 16:59:19 +08:00
Anthony Calosa
fde707b726 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-07 16:52:04 +08:00
Anthony Calosa
e158e95245 Merge pull request #930 from kevlahnota/master
auto close
2017-02-07 14:08:54 +08:00
Anthony Calosa
5b23cc2e33 auto close 2017-02-07 13:10:58 +08:00
Anthony Calosa
c72cdff0f1 Merge pull request #929 from kevlahnota/master
Some Bug Fixes
2017-02-06 22:25:59 +08:00
Anthony Calosa
831c8f73b0 some bug fixes
fix where the copier is treated as the same copied card, also fixes the
display ability of momir (forced), disabled reveal for AI if aicode is
not found (should add alternate for ai).
2017-02-06 21:48:41 +08:00
Anthony Calosa
2dc6c62acb Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-06 21:47:48 +08:00
Anthony Calosa
9e1d1a056c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-06 05:56:00 +08:00
Rolzad73
9a32ae2c6d Merge pull request #928 from WagicProject/appveyor_testing
Just adding some console output to Appveyor build
2017-02-05 16:23:10 -05:00
Anthony Calosa
b1a2003a84 Merge pull request #927 from kevlahnota/master
Modified Momir
2017-02-05 22:57:38 +08:00
Anthony Calosa
e2c1d62552 modified Momir 2017-02-05 22:14:20 +08:00
Anthony Calosa
db0f6d6c0b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-05 21:08:37 +08:00
Xawotihs
bc44ee8056 And again 2017-02-05 11:48:30 +01:00
Xawotihs
65a9bd55d8 Tries to fix iOS/MacOSX builds 2017-02-05 11:03:51 +01:00
Anthony Calosa
2aa0668c28 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-05 16:45:13 +08:00
Rolzad73
9f5e37a03c - added even more meaning to release upload script case 2017-02-05 01:13:38 -05:00
Rolzad73
f27763870c Merge pull request #926 from WagicProject/qt_test_crash_fix
small QT build CI fix
2017-02-05 01:00:52 -05:00
Rolzad73
ab22e02db8 - cleaned up error msg bug 2017-02-05 00:38:37 -05:00
Rolzad73
257afd3525 - added more meaning to release upload script case 2017-02-05 00:29:00 -05:00
Rolzad73
eec38de558 - testing appveyor env vars 2017-02-05 00:04:47 -05:00
Rolzad73
35de677999 - stop mysterious ~QNetworkConfiguration() SIGSEGV issue at end of console testsuite run 2017-02-04 23:09:13 -05:00
Anthony Calosa
8b9dfdf96d bug fix 2017-02-05 08:07:12 +08:00
Anthony Calosa
c830ef88ca Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-05 07:11:05 +08:00
Anthony Calosa
ba0daed776 Merge pull request #924 from kevlahnota/master
Refactor countManaProducedby
2017-02-05 06:38:05 +08:00
Anthony Calosa
f37d946b4e Removed unused variable 2017-02-04 23:33:08 +08:00
Anthony Calosa
477419cc32 Refactor countManaProducedby
cards that uses this should not crash anymore with lorded mana producer
from instants like rain of filth...
2017-02-04 22:37:21 +08:00
Anthony Calosa
70e8d1c4b3 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-04 20:47:05 +08:00
Rolzad73
732f795be4 - fixing last commit broke no QT builds 2017-02-03 21:05:14 -05:00
Rolzad73
00536fa3d9 - Qthread include fix for console QT build method and QT TESTSUITE target 2017-02-03 19:42:55 -05:00
Anthony Calosa
042f00cc58 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-03 22:31:33 +08:00
Anthony Calosa
acef89ea03 Merge pull request #923 from kevlahnota/master
Revert Functionality
2017-02-03 21:46:21 +08:00
Anthony Calosa
d7770d285f not needed anymore 2017-02-03 20:55:32 +08:00
Anthony Calosa
7932941a01 Revert Functionality
AACopier and AACloner should work with andAbility now...
2017-02-03 20:45:46 +08:00
Anthony Calosa
c4eac5e62b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-03 15:55:27 +08:00
Anthony Calosa
763bd60e74 Merge pull request #922 from kevlahnota/master
Some Fixes
2017-02-03 15:12:17 +08:00
Anthony Calosa
3fa52e7ac5 corrections 2017-02-03 14:26:26 +08:00
Anthony Calosa
9104afdef7 Cleanup 2017-02-03 10:39:45 +08:00
Anthony Calosa
942c95e736 revised copier copied abilities
the clone should copy original abilities only
2017-02-03 10:31:10 +08:00
Anthony Calosa
dc696a0f45 fix random segmentation fault
should fix the crash -> rain of filth in test suite
2017-02-03 10:30:14 +08:00
Anthony Calosa
d26e9da6c4 add some restrictions 2017-02-03 07:59:13 +08:00
Anthony Calosa
ea09b1f6bc Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-03 02:35:24 +08:00
Rolzad73
da033eb28e Merge pull request #919 from WagicProject/key_bind_changes
key binding related
2017-02-02 11:18:46 -05:00
Rolzad73
b2a0ccba05 - removed leftover trace log 2017-02-02 10:08:58 -05:00
Anthony Calosa
3f146c94e5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-02 13:46:21 +08:00
Anthony Calosa
9d92bdcd75 Merge pull request #918 from kevlahnota/master
Refactor PW Rule & some bug fixes
2017-02-02 13:21:57 +08:00
Anthony Calosa
6354d8ccca revised pw rule
also fixed where planeswalker can use its ability after it was
transformed/flipped by activation ex. Garruk Relentless... You can’t
activate a loyalty ability of Garruk Relentless and later that turn
after he transforms activate a loyalty ability of Garruk, the
Veil-Cursed.
2017-02-02 11:58:51 +08:00
Rolzad73
1d0237f15d - added ability to reload default key bindings
- reverted keybindings display back to action names instead of PSP key equivalent (see commit commit 168154b52d)
2017-02-01 22:53:01 -05:00
Anthony Calosa
c535d033ec fix Dark Depths
there should a window for the triggered sacrifice and legend rule.
2017-02-02 11:08:17 +08:00
Anthony Calosa
fcf900c5e0 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-02 11:05:20 +08:00
Anthony Calosa
c265ce8222 Bug Correction
PermanentAbility to ListMaintainerAbility in Legend Rule, it seems It's
finally fixed even with a lot of targetchooser and copy effects.
2017-02-02 09:58:38 +08:00
Anthony Calosa
658b90067a Merge pull request #917 from kevlahnota/master
Crew Bonus & Bug Fix
2017-02-02 03:09:11 +08:00
Anthony Calosa
80b6496780 bug fix 2017-02-01 22:37:00 +08:00
Anthony Calosa
711934a249 Crew Corrections 2017-02-01 18:40:09 +08:00
Anthony Calosa
ea5e397595 Crew Ability Cost & Crewbonus
Revised cards to use {crew(targetchooser)} (modified taptargetcost) so
it can use crewbonus ability from other creatures.
2017-02-01 17:11:55 +08:00
Anthony Calosa
c8dc416071 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-01 17:08:02 +08:00
Anthony Calosa
30026fc307 Merge pull request #916 from kevlahnota/master
refactor Legend Rule and other Bug fixes
2017-02-01 10:40:02 +08:00
Anthony Calosa
7b0fdcd721 refactor Legendary Rule 2017-02-01 09:49:36 +08:00
Anthony Calosa
c0afb3b95e added WEventGameStateBasedChecked 2017-02-01 09:48:40 +08:00
Anthony Calosa
5504bf23d1 corrected dimir doppelganger 2017-02-01 09:47:31 +08:00
Anthony Calosa
28b51d3335 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-01 09:33:35 +08:00
Rolzad73
fb91726c35 Merge pull request #915 from WagicProject/test_suite_function_fix
- fixed small compiling error for a function in testsuite
2017-01-31 13:10:19 -05:00
Anthony Calosa
a97a7edca6 minor refactor 2017-01-31 22:01:19 +08:00
Anthony Calosa
92b4909fc8 add some cards 2017-01-31 21:19:34 +08:00
Anthony Calosa
3998c21178 fix persist on copied card 2017-01-31 20:11:59 +08:00
Anthony Calosa
41d925d7c9 add support for activated copier
thespian stage etc...
2017-01-31 20:11:09 +08:00
Anthony Calosa
7029636291 some corrections 2017-01-31 04:16:47 +08:00
Rolzad73
a916c1067f - fixed small compiling error for a function in testsuite
- indentation formatting on DebugRoutines
2017-01-30 14:02:25 -05:00
Anthony Calosa
7322d4da8b fix castcard opponent spell
the casted non-permanent card from opponent will now move to its owner
graveyard...
2017-01-30 07:09:21 +08:00
Anthony Calosa
31f15b12cb Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-01-29 20:16:09 +08:00
Anthony Calosa
4d3e463aba Merge pull request #913 from kevlahnota/master
Revised AACopier and Fix Legend Rule
2017-01-29 17:17:04 +08:00
Anthony Calosa
166526dbbe Fix Legend Rule
Should fix the the move to graveyard effect with targetchooser
ability...
2017-01-29 16:30:13 +08:00
Anthony Calosa
348ada3f0d revised aacopier
I think we still need to change legend to a trigger once it detects
multiple legends in play then trigger it at once with targetchooser to
select which cards to sacrifice as state based... vector of  unique
names or id or mtgcardinstance?
2017-01-29 16:09:49 +08:00
Anthony Calosa
2c5f6d8332 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-01-29 10:29:10 +08:00
Anthony Calosa
e128d548f4 disable andAbility for aacopier
so it will not conflict with original legend rule...
2017-01-29 10:27:18 +08:00
Rolzad73
bb2ab1c1fe Merge pull request #911 from Rolzad73/x11_fixes
X11 build fixes
2017-01-28 13:17:50 -05:00
Rolzad73
715bedb71a - Travis PSP build broke, attempt to fix 2017-01-28 05:05:35 -05:00
Rolzad73
8fed9e47d1 - Travis PSP build broke, attempt to fix 2017-01-28 04:50:07 -05:00
Rolzad73
89f8f7e25e Merge pull request #910 from WagicProject/travis_edit
Test travis QT build artifact zipped for upload
2017-01-28 04:43:06 -05:00
Rolzad73
7bbba293a6 - reverted Travis test 2017-01-28 04:42:42 -05:00
Rolzad73
d57a694d3c - last commit small clean 2017-01-28 04:32:39 -05:00
Rolzad73
f31d5c04c8 - revert android gamepad log change for mergable x11 fixes 2017-01-28 04:29:47 -05:00
Rolzad73
85f66a8fec X11 build fixups
- fixed -Werror=misleading-indentation warning
- fixed -Werror=nonnull-compare warning on xll and QT builds
- PNG_LIBPNG_VER backward compatibily changes
- giflib backward compatibily changes
- resolved some undefs for X11 build
- silenced some small compile warnings in JGE Makefile
- added -DTIXML_USE_STL to remaining build types (PSP had it added)
- fixed x11 Boost incompatibility issue part of #548
- reworked PrecompiledHeader.h platforms used
2017-01-28 04:19:46 -05:00
Rolzad73
48ec606bc5 - attempt to break build upload sequence 2017-01-28 04:09:03 -05:00
Rolzad73
75cc809b16 - travis QT build artifact zipped for upload 2017-01-28 02:16:03 -05:00
Anthony Calosa
2a27a491e7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-01-28 13:23:44 +08:00
Anthony Calosa
3e75d70632 revert this
I introduce more bugs than helped. I think there's alternative method
for this,,,
2017-01-28 13:23:30 +08:00
Anthony Calosa
cf2d094df6 Merge pull request #905 from kevlahnota/master
Added KLD primitives
2017-01-28 12:41:10 +08:00
Rolzad73
18a7955240 Merge pull request #907 from WagicProject/travis_edit
attempt to add release upload from Travis CI for QT Linux variant
2017-01-27 23:36:51 -05:00
Rolzad73
22ebc27997 - attempt to add release upload from Travis CI for QT Linux variant 2017-01-27 22:57:21 -05:00
Anthony Calosa
c53ee24b5b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-01-28 07:38:50 +08:00
Anthony Calosa
25e681c04a test fix ensnaring bridge 2017-01-28 07:38:45 +08:00
Anthony Calosa
365e0b49ae cleanup 2017-01-28 07:38:27 +08:00
Rolzad73
e3dc78b28e - created proper branch on separate fork for dev work 2017-01-27 11:58:59 -05:00
Rolzad73
e3319f6fe4 Merge pull request #2 from WagicProject/master
Pulling changes from original project to forked version
2017-01-27 11:34:01 -05:00
Rolzad73
0a9b006a94 Merge pull request #906 from Rolzad73/master
Merge pull request #1 from WagicProject/master
2017-01-27 11:28:28 -05:00
Anthony Calosa
5692be3b66 remove 2 duplicate
Stone Quarry & Woodland Stream
2017-01-27 23:25:48 +08:00
Anthony Calosa
6ea5dea849 Added KLD primitives 2017-01-27 23:19:01 +08:00
Anthony Calosa
8debcf0fa2 KLD missing cards 2017-01-27 23:18:28 +08:00
Anthony Calosa
1cf4845cb2 added KLD set 2017-01-27 23:17:15 +08:00
Anthony Calosa
b9d1292add Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-01-27 22:15:27 +08:00
Anthony Calosa
19063fd8db some refactor
change some card from using "all" to "lord"
2017-01-27 22:15:03 +08:00
Rolzad73
76cf732100 Merge pull request #904 from WagicProject/build_clean
Simple build.xml cleanup
2017-01-26 23:17:13 -05:00
Anthony Calosa
30a7eef611 some corrections 2017-01-27 11:01:28 +08:00
Rolzad73
99f0020583 fix build.xml wrap error 2017-01-26 20:48:38 -05:00
Rolzad73
f2e0da47ed - minor whitespace and duplicate task (build.meego.changelog) cleanup of mtg ant build file 2017-01-26 20:05:19 -05:00
Anthony Calosa
ca66a428d8 C16 missing list 2017-01-27 06:18:36 +08:00
Anthony Calosa
f077a4e074 Merge pull request #903 from kevlahnota/master
KLD & AER support
2017-01-27 06:00:58 +08:00
Anthony Calosa
e46631a960 Merge branch 'master' of https://github.com/kevlahnota/wagic 2017-01-26 23:18:43 +08:00
Anthony Calosa
2da1957c70 Added C16 primitives 2017-01-26 23:18:37 +08:00
Anthony Calosa
ad6c48688d Added C16 set 2017-01-26 23:18:34 +08:00
Anthony Calosa
71da7fb384 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-01-26 23:11:52 +08:00
Anthony Calosa
0159e0e41e added some fixes 2017-01-26 22:34:07 +08:00
Anthony Calosa
457a3fdc7a Merge pull request #902 from WagicProject/travis_java_build_fix
Travis java build fix
2017-01-26 21:28:17 +08:00
Anthony Calosa
8507c0138d crash fix
when loading collection and shop
2017-01-26 21:02:12 +08:00
Anthony Calosa
4f7901b946 minor refactor 2017-01-26 21:01:45 +08:00
Anthony Calosa
e239dc039b fix phaseinfo/fakebar graphics
it should look nice now.. :)
2017-01-26 18:33:04 +08:00
Anthony Calosa
1428eeba06 fix copier token image 2017-01-26 15:32:17 +08:00
Anthony Calosa
adcf6fb86d refactor some equipments 2017-01-26 09:45:18 +08:00
Anthony Calosa
de2d663968 unattach animated equipment
another bug found is when the equipment becomes a creature, its ability
is granted to itself...
2017-01-26 02:12:02 +08:00
Anthony Calosa
60f6c683a3 test fix equipment
also added some primitive fixes, added macro for fabricate
2017-01-25 18:29:27 +08:00
Rolzad73
f8009672e9 - Travis build fix cleanup 2017-01-24 15:30:34 -05:00
Rolzad73
9fe5ac1994 - attempt forced JVM version setting for travis build 2017-01-24 14:51:03 -05:00
Rolzad73
58efb51c07 - attempt forced JDK version setting for travis build 2017-01-24 13:56:40 -05:00
Anthony Calosa
5c3a064746 aicode and revised legendary rule
added aicode for cards that uses reveal. since reveal cancels for ai,
aicode is the alternative code. use basic code only.
aicode=activate dosomething...
aicode - use with caution, its very basic atm and you must test each
card that uses it as it can cause crash.
legendary rule moved to game state based effect so it will not conflict
with cards with copy effects and andability. the legendary check applies
only when  legendrule is found.
2017-01-24 16:10:35 +08:00
Anthony Calosa
94aefa6dba notany attribute
anytypeofmana makes manacost colorless... wip
2017-01-23 18:32:58 +08:00
Anthony Calosa
7f6e96459c added "energized" event
energizedof(player):do something
energizedfoeof(player):do something
also some fixes in the primitives
2017-01-23 11:41:19 +08:00
Anthony Calosa
6fe57be115 fix for cards with restrictions 2017-01-22 00:14:46 +08:00
Anthony Calosa
37b3f28065 additional fixes 2017-01-21 04:30:00 +08:00
Anthony Calosa
0b9468da1b add EXP
Zendikar Expeditions
2017-01-20 16:49:00 +08:00
Anthony Calosa
e558f21ebc add penergy & oenergy
count energy counters available
2017-01-20 15:39:27 +08:00
Anthony Calosa
71c1512ef2 some fixes
primitve corrections
2017-01-20 15:37:36 +08:00
Anthony Calosa
d03ebdace8 Support for KLD and AER
Kaladesh & Aether Revolt
2017-01-18 22:13:51 +08:00
Anthony Calosa
d86b9119a4 fix castcard interaction to reveal window
uses afterrevealed and becomes
2017-01-17 18:24:50 +08:00
Anthony Calosa
0ab872e152 Additional primitive fixes 2017-01-16 06:48:07 +08:00
Anthony Calosa
5e7f81678d Added some fixes by Toben
thanks Toben
2017-01-14 10:33:49 +08:00
Anthony Calosa
ff510248e9 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-09-08 06:01:40 +08:00
Anthony Calosa
bba5d4380d Merge pull request #897 from kevlahnota/master
revised tnum attribute
2016-09-08 05:53:32 +08:00
Anthony Calosa
39ad95d4db revised tnum attribute
so it can be used inside makecardt, also
2016-09-08 05:13:52 +08:00
Anthony Calosa
e9adde8ac6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-09-06 21:29:55 +08:00
Anthony Calosa
8fc120d9f9 Merge pull request #895 from kevlahnota/master
revised "steal" ability
2016-09-06 16:38:39 +08:00
Anthony Calosa
7f8339aedf revised "steal" ability
steal - gain control of target/s until it leaves battlefield or  its
current controller loses control of the "stealer"...
2016-09-06 15:47:09 +08:00
Anthony Calosa
d2183f3b91 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-09-06 15:08:32 +08:00
Anthony Calosa
11b4aa7308 Merge pull request #894 from kevlahnota/master
Sorted & Updated Primitives
2016-09-05 19:44:42 +08:00
Anthony Calosa
51481daf03 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-09-05 18:20:14 +08:00
Anthony Calosa
1bdd0f6e26 Sorted & Updated Primitives,
also added some cards
2016-09-05 18:20:05 +08:00
Anthony Calosa
1de492973e update missing cards by sets 2016-09-05 17:54:41 +08:00
Anthony Calosa
eea96dac73 Added CNS 2016-09-05 15:25:17 +08:00
Anthony Calosa
ebc378a620 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-09-05 15:22:42 +08:00
Anthony Calosa
3d08ca0cc1 Merge pull request #893 from kevlahnota/master
revised "colorless" attribute in targetchooser
2016-09-04 14:35:48 +08:00
Anthony Calosa
f11cc41df8 revised "colorless" attribute in targetchooser
also fix worldly tutor
2016-09-04 13:14:19 +08:00
Anthony Calosa
19ce59b1b4 Merge pull request #890 from kevlahnota/master
Add some C15 cards
2016-09-03 22:38:38 +08:00
Anthony Calosa
5101ac9d8e add some C15 cards 2016-09-03 21:38:24 +08:00
Anthony Calosa
5149882bb5 Add files via upload 2016-09-02 23:49:03 +08:00
Anthony Calosa
26222ee853 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-09-02 10:12:55 +08:00
Anthony Calosa
0394e2cda9 Add files via upload 2016-09-02 10:12:42 +08:00
Anthony Calosa
501b310efa add some C14 cards 2016-09-02 10:11:51 +08:00
Anthony Calosa
53e0b1b81c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-09-01 19:19:17 +08:00
Anthony Calosa
81be616847 Merge pull request #888 from kevlahnota/master
Add some missing cards from CMD
2016-08-31 16:19:33 +08:00
Anthony Calosa
b9b2c9afb0 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-08-31 14:03:36 +08:00
Anthony Calosa
848cd9a485 Add files via upload 2016-08-31 14:03:22 +08:00
Anthony Calosa
75921e1130 add some cards from CMD to C13 2016-08-31 14:02:16 +08:00
Anthony Calosa
0b14639c66 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-31 01:48:52 +08:00
Anthony Calosa
5c54f85de4 Merge pull request #887 from kevlahnota/master
Add some cards from BFZ to EMN
2016-08-31 01:30:36 +08:00
Anthony Calosa
0202313bc8 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-08-31 00:01:00 +08:00
Anthony Calosa
2671826b19 add some cards from BFZ to EMN 2016-08-31 00:00:43 +08:00
Anthony Calosa
7dc89ad090 Add files via upload 2016-08-31 00:00:16 +08:00
Anthony Calosa
c54f0ea329 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-30 22:04:00 +08:00
Anthony Calosa
d90f3ce309 Merge pull request #886 from kevlahnota/master
Add some cards from KTK block
2016-08-30 18:23:50 +08:00
Anthony Calosa
bcc6ced47c Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-08-30 17:37:45 +08:00
Anthony Calosa
1b5c61a285 added some cards from KTK sets
Also fix typos reported by sage. Thanks.
2016-08-30 17:37:38 +08:00
Anthony Calosa
ca95192de3 Add files via upload 2016-08-30 17:37:35 +08:00
Anthony Calosa
c2e04443e3 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-30 07:40:47 +08:00
Anthony Calosa
f4f8c94c6a Merge pull request #885 from kevlahnota/master
add custom name for generic reveal ability
2016-08-29 22:42:35 +08:00
Anthony Calosa
f957fca162 add custom name for generic reveal 2016-08-29 20:58:55 +08:00
Anthony Calosa
9671711bf5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-29 09:05:15 +08:00
zethfoxster
ea3d4c67f8 Merge pull request #883 from zethfoxster/master
getting master
2016-08-28 10:05:51 -04:00
Anthony Calosa
cab1f59181 Merge pull request #882 from kevlahnota/master
Add missing cards from THS
2016-08-28 14:39:25 +08:00
Anthony Calosa
8c01611850 Add files via upload 2016-08-28 12:42:31 +08:00
Anthony Calosa
d6b682ab88 update/fix some card codes
also add some missing cards from THS block
2016-08-28 12:41:41 +08:00
zethfoxster
d2beaa0ab9 Merge pull request #51 from WagicProject/master
getting master
2016-08-27 14:19:59 -04:00
Anthony Calosa
ce0fafd45b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-27 20:28:26 +08:00
Anthony Calosa
c0dbd00b74 Merge pull request #881 from kevlahnota/master
fix halfup logic when used on negation
2016-08-27 20:16:31 +08:00
Anthony Calosa
a556aed34f Add files via upload 2016-08-27 19:32:48 +08:00
Anthony Calosa
8d19ee8ab3 add some missing cards 2016-08-27 19:31:27 +08:00
Anthony Calosa
8c4c80731c fix halfup logic when used on negation
halfup is computation is correct but when used in negation, you must use
the halfdown, example if you have 5 life and you pay half your life
rounded up, you must have 3 life, so life:-halfdownlifetotal. if you use
halfup you will lose 3 life...
2016-08-27 16:23:42 +08:00
Anthony Calosa
de6619b383 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-27 16:17:44 +08:00
Anthony Calosa
941dc253fb Merge pull request #880 from kevlahnota/master
fix some cards and add some missing
2016-08-27 15:55:54 +08:00
Anthony Calosa
25705a6b02 Add files via upload 2016-08-27 14:58:09 +08:00
Anthony Calosa
4d56269130 fix some cards and add some missing
it seems " add " inside name causes issue when parsed (cause crash in
deck editor like arlinn kord), renaming it fixes it...
2016-08-27 14:56:54 +08:00
zethfoxster
96236df293 Merge pull request #50 from WagicProject/master
getting master
2016-08-26 18:55:33 -04:00
Anthony Calosa
f447482e32 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-26 18:02:27 +08:00
Anthony Calosa
401b8fc496 Merge pull request #878 from kevlahnota/master
Add some cards (various from SHM to ROE)
2016-08-26 16:11:38 +08:00
Anthony Calosa
2e2a2aaf03 cleanup card.dat 2016-08-26 15:33:38 +08:00
Anthony Calosa
66c2ab38ed fix some cards 2016-08-26 14:20:02 +08:00
Anthony Calosa
6e0b7e2c23 add missing break 2016-08-26 14:20:02 +08:00
Anthony Calosa
f335623f69 update missing cards by sets
Shadowmoor, Alara, Zendikar blocks
2016-08-26 12:11:28 +08:00
Anthony Calosa
f8369ee39a add some missing cards
from SHM to ROE
2016-08-26 11:31:48 +08:00
Anthony Calosa
2a1bacdfa4 add "abilitycontroller" for dynamicability
for use inside ability$! dynamicability<who> !$ who
2016-08-26 11:23:52 +08:00
Anthony Calosa
a93dd6586d Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-25 22:26:56 +08:00
Anthony Calosa
f3dd1be125 rebounded trigger
for use with rebound cards only
2016-08-25 22:25:34 +08:00
Anthony Calosa
5b49530df9 add reset alternate cost paid 2016-08-25 22:22:55 +08:00
zethfoxster
00555e3c75 Merge pull request #49 from WagicProject/master
getting master
2016-08-24 21:13:03 -04:00
Anthony Calosa
972746d388 Merge pull request #877 from kevlahnota/master
Fix enters tapped cards, add some missing cards from LRW
2016-08-25 04:23:23 +08:00
Anthony Calosa
db3aaf96c7 add LRW & MOR missing cards by sets 2016-08-25 03:42:24 +08:00
Anthony Calosa
e12c87b869 add some missing cards from lorwyn
also fix card enters tapped
2016-08-25 03:40:38 +08:00
Anthony Calosa
ad80b000c9 find missing art on stored source card
when tokencreator is used inside ability$!!$ who, try to get the token
images and id from stored source
2016-08-25 03:40:38 +08:00
Anthony Calosa
9bcc54c56c add "recent" & "raidcount"
the recent attribute is to parse new cards entered play, then turns
itself to 0 if some stuff happened since it's already in play...
2016-08-25 03:40:38 +08:00
Anthony Calosa
3e6d207bf0 Merge pull request #876 from kevlahnota/master
Add some missing cards
2016-08-25 01:06:23 +08:00
Anthony Calosa
6c836e0fde update missing cards by sets
from ravnica to timespiral blocks
2016-08-25 00:23:24 +08:00
Anthony Calosa
5f9e123571 added some cards
from ravnica, ice age and time spiral blocks
2016-08-25 00:21:48 +08:00
Anthony Calosa
20ba624de2 commented out this
commented out the the spelltargettypes (I think I added these before for
debugging purposes)
2016-08-25 00:20:52 +08:00
Anthony Calosa
12426cf8a7 added nonplaynonexile
for use inside transforms since we cant use commas
2016-08-25 00:20:18 +08:00
Anthony Calosa
1cd6f00c59 add manapool count
also add getStringValue for menutext
2016-08-25 00:17:16 +08:00
Anthony Calosa
365d5784b7 Merge pull request #875 from kevlahnota/master
update PPR
2016-08-23 12:22:37 +08:00
Anthony Calosa
a90cddf589 update PPR
also fix cards  "when you cast" triggers, They must trigger when cast,
not when it resolves...
2016-08-23 11:27:40 +08:00
zethfoxster
5f71017142 Merge pull request #48 from WagicProject/master
getting master
2016-08-22 21:31:19 -04:00
Anthony Calosa
c81402b8ce Merge pull request #874 from kevlahnota/master
Add some cards from SOK
2016-08-23 07:27:20 +08:00
Anthony Calosa
6122410db1 Add files via upload 2016-08-23 06:51:22 +08:00
Anthony Calosa
42e240c9ab add some cards from kamigawa 2016-08-23 06:49:57 +08:00
Anthony Calosa
01459b7759 Merge pull request #873 from kevlahnota/master
Fix granted flashback, add flashback indicator
2016-08-22 11:33:33 +08:00
Anthony Calosa
cd2f4480f4 alternate token creator
uses ":" instead of comma, makecardt(name:type:p/t:ability:color) ex.
makecardt(Eldrazi Horrors:Creature Eldrazi Horror:3/2:haste:battleready)
2016-08-22 10:21:00 +08:00
Anthony Calosa
ce92679be0 add AACloner andAbility 2016-08-22 10:18:23 +08:00
Anthony Calosa
e9705b2cc5 fix crash temporary flashback
should fix snapcaster mages ability and the likes
2016-08-22 10:17:48 +08:00
Anthony Calosa
a2007dd59e border indicator flashback 2016-08-22 10:17:05 +08:00
Anthony Calosa
d6052b718e Merge pull request #872 from kevlahnota/master
cleanup
2016-08-22 09:18:11 +08:00
Anthony Calosa
6bfc79fb03 test
test if the name is the cause of this...
2016-08-22 08:30:13 +08:00
Anthony Calosa
e9a5f30c71 cleanup 2016-08-22 07:36:23 +08:00
Anthony Calosa
9a61b7f13b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-22 07:27:34 +08:00
Anthony Calosa
2073f3d7ed Merge pull request #870 from kevlahnota/master
Battleready token for Hanweir
2016-08-21 22:13:00 +08:00
Anthony Calosa
774cd46892 Hanweir the Writhing Township token
battleready and fix Make Mischief
2016-08-21 22:10:14 +08:00
Anthony Calosa
f593ee7c9f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-21 14:13:25 +08:00
Anthony Calosa
47d35446e2 Merge pull request #869 from kevlahnota/master
Add some cards & fix
2016-08-21 13:10:59 +08:00
Anthony Calosa
3e16969808 update missing cards by sets
ODY to 5DN
2016-08-21 12:28:02 +08:00
Anthony Calosa
3e95f5cd05 add some cards 2016-08-21 12:26:21 +08:00
Anthony Calosa
15a8437d79 check imprinted card
fix crash
2016-08-21 11:28:17 +08:00
Anthony Calosa
6a213bffa6 Domain count 2016-08-21 11:27:50 +08:00
Anthony Calosa
5be01a7577 add percentage on awards 2016-08-21 08:56:39 +08:00
zethfoxster
89b8eabe0c Merge pull request #47 from WagicProject/master
getting master
2016-08-20 13:54:25 -04:00
Anthony Calosa
3cecc34a9c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-20 17:54:42 +08:00
Anthony Calosa
9e76214be8 Merge pull request #867 from kevlahnota/master
Added some cards from INV & MRQ
2016-08-20 16:46:48 +08:00
Anthony Calosa
5b059f974f update missing cards by sets 2016-08-20 16:07:11 +08:00
Anthony Calosa
ecb4f64f91 added some cards
I think I added abilitycontroller before, I just forgot to add a card
that can use it (Gerrard's Verdict)
2016-08-20 16:04:17 +08:00
zethfoxster
992121c659 Merge pull request #46 from WagicProject/master
getting master
2016-08-19 21:25:18 -04:00
Anthony Calosa
cbc41214d8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-20 04:32:19 +08:00
Anthony Calosa
53c7a81666 Merge pull request #866 from kevlahnota/master
change naming convention
2016-08-20 04:03:53 +08:00
Anthony Calosa
a63065b44f try to fix 2016-08-20 03:04:58 +08:00
Anthony Calosa
cec4494ce6 fix can produce mana
limited for land...
2016-08-20 00:21:58 +08:00
Anthony Calosa
60411027ca change plandtype & olandtype parsing 2016-08-19 23:34:01 +08:00
Anthony Calosa
8d7b9293b5 change naming convention
to avoid confusion
2016-08-19 20:29:41 +08:00
Anthony Calosa
2133dfd80c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-19 18:53:27 +08:00
Anthony Calosa
1a75f51aa6 Merge pull request #865 from kevlahnota/master
update missing cards by sets
2016-08-19 18:51:13 +08:00
Anthony Calosa
2a8c036c63 moved rayne to borderline
@targeted needs update for player targets
2016-08-19 18:18:18 +08:00
Anthony Calosa
c90f357bff added myzones & oppzones 2016-08-19 18:08:36 +08:00
Anthony Calosa
4d381452b5 added rath & artifact cycle in missing cards 2016-08-19 18:07:08 +08:00
zethfoxster
087b53c1c5 Merge pull request #45 from WagicProject/master
getting master
2016-08-18 23:08:21 -04:00
Anthony Calosa
58a2769f2b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-19 07:22:52 +08:00
Anthony Calosa
ce38c3e5c5 Merge pull request #864 from kevlahnota/master
re added my previous changes
2016-08-18 21:48:19 +08:00
Anthony Calosa
12f7d5e4b6 added missing cards by sets
todo... since i'll recheck all expansions
2016-08-18 21:43:54 +08:00
Anthony Calosa
fd703dd4d1 re added my previous changes 2016-08-18 21:40:38 +08:00
Anthony Calosa
3ef4c1f6e0 Merge pull request #863 from kevlahnota/master
Added the Missing EMN and other cards
2016-08-18 20:04:19 +08:00
Anthony Calosa
0e95444552 added the EMN cards 2016-08-18 20:02:02 +08:00
Anthony Calosa
aca90db2c2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-18 19:13:41 +08:00
Anthony Calosa
09edd055e6 Merge pull request #862 from kevlahnota/master
"blocked" attribute & add some cards
2016-08-18 18:55:28 +08:00
Anthony Calosa
892ef6b1b3 Add CD Blocked & some cards
cd "blocked" should fix Smite , Tattermunge Witch
2016-08-18 17:57:14 +08:00
Anthony Calosa
ed838815ef Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-18 06:19:42 +08:00
Anthony Calosa
8d8c4d1a95 Merge pull request #861 from kevlahnota/master
Balance cards & Kozilek
2016-08-17 20:50:03 +08:00
Anthony Calosa
debdf917ea Added "Balance" cards & Fix Kozilek
Added Balance, Balancing Act, Natural Balance & Restore Balance. Fix
Kozilek, the Great Distortion autostack ability
2016-08-17 20:48:51 +08:00
Anthony Calosa
f03961bc19 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-17 18:42:43 +08:00
Anthony Calosa
fb4572264d Merge pull request #860 from kevlahnota/master
Fixed OGW cards & Sorted Primitives
2016-08-17 05:27:08 +08:00
Anthony Calosa
d7445a70f9 Fix OGW cards & Sorted Primitives
todo recheck BFZ
2016-08-17 04:49:50 +08:00
Anthony Calosa
78bcf9a738 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-17 04:24:53 +08:00
zethfoxster
d71c85412f Merge pull request #859 from zethfoxster/master
pushing to master
2016-08-16 13:38:42 -04:00
zethfoxster
f5c9ab72ef adding eldrich moon cards, and part 1 of my unsupport scan through...these are not sorted and are added at the bottom.
there are way more in unsupported that need checking, im going through it slowly but thought i should add this
2016-08-16 13:34:14 -04:00
zethfoxster
5c4cd74c39 Merge pull request #44 from WagicProject/master
getting master
2016-08-16 13:29:59 -04:00
Anthony Calosa
5a1daf5dc9 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-16 18:32:43 +08:00
Anthony Calosa
4de2a45195 Merge pull request #858 from kevlahnota/master
add CD geared attribute
2016-08-16 17:28:01 +08:00
Anthony Calosa
91d3a6ecb7 Minor Cleanup 2016-08-16 16:11:44 +08:00
Anthony Calosa
763918e129 added CD geared attribute 2016-08-16 15:42:22 +08:00
Anthony Calosa
525c166f62 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-16 14:30:02 +08:00
Anthony Calosa
6b2ed24fc3 Merge pull request #857 from kevlahnota/master
Fixed some cards
2016-08-16 13:17:07 +08:00
Anthony Calosa
1eae3a032f Fixed some cards
replaced @lifed with @lifeof, had to hardcode conduit of ruin...
2016-08-16 12:17:53 +08:00
zethfoxster
755cfe19d5 Merge pull request #43 from WagicProject/master
getting master
2016-08-14 22:58:36 -04:00
Anthony Calosa
559331cf82 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-15 10:29:03 +08:00
Anthony Calosa
18fddb1537 Merge pull request #856 from kevlahnota/master
adjust p/t & fix copying animated land
2016-08-14 22:11:53 +08:00
Anthony Calosa
861620cb6e fix AI deck129 invalid mtgid 2016-08-14 21:53:54 +08:00
Anthony Calosa
568f3ae94f fix copying man lands 2016-08-14 21:26:33 +08:00
Anthony Calosa
0af00a313e adjust p/t box when tapped only 2016-08-14 21:26:19 +08:00
Anthony Calosa
ff52f020e2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-14 21:21:22 +08:00
Anthony Calosa
55bf7bcbda Merge pull request #855 from kevlahnota/master
Minimal Graphics mod
2016-08-14 15:51:32 +08:00
Anthony Calosa
bccb740c45 Minimal mod card scale
it's a minimal graphics mod so it's easier to debug. It's a smaller card
scale of big render so we have more space to view in game.
2016-08-14 14:59:49 +08:00
Anthony Calosa
b7307adc10 fix copier copying a copier 2016-08-14 14:28:14 +08:00
Anthony Calosa
edb71dcef0 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-14 09:32:42 +08:00
Anthony Calosa
7ddf232615 Merge pull request #854 from kevlahnota/master
Re upload sets
2016-08-14 09:27:41 +08:00
Anthony Calosa
a7cdb0a514 re upload sets 2016-08-14 09:24:15 +08:00
Anthony Calosa
7157e571c8 fateshaper flying 2016-08-14 09:22:11 +08:00
Anthony Calosa
d073b7b3c0 remove sets with no carriage returns
will reupload the new ones
2016-08-14 09:21:47 +08:00
zethfoxster
27d67398fb Merge pull request #42 from WagicProject/master
getting master
2016-08-13 12:49:52 -04:00
Anthony Calosa
cc6ced9197 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-13 23:31:50 +08:00
Anthony Calosa
712e42c71f Merge pull request #853 from kevlahnota/master
Carriage Returns
2016-08-13 23:29:09 +08:00
Anthony Calosa
53efc96e30 add carriage returns
it's not visible but instead of lf, replaced it with crlf
2016-08-13 23:26:58 +08:00
Anthony Calosa
5b2ac0f022 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-13 23:20:37 +08:00
Anthony Calosa
b5cdcc29bc Merge pull request #852 from kevlahnota/master
Revert my Graphic changes and other fixes
2016-08-13 21:41:56 +08:00
Anthony Calosa
df3e6e5fb7 fix flip and image 2016-08-13 21:14:43 +08:00
Anthony Calosa
27145bdabe revised fix for copier 2016-08-13 20:12:55 +08:00
Anthony Calosa
71aedfd96d this must be copy 2016-08-13 17:39:11 +08:00
Anthony Calosa
8530292fef Revert my Graphic changes
I think it's the one who cause those crashes
2016-08-13 16:45:46 +08:00
Anthony Calosa
f1bc268f58 add mycastingzone & oppcastingzone
to simplify code
2016-08-13 10:55:58 +08:00
Anthony Calosa
2e79f5a369 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-12 20:47:48 +08:00
Anthony Calosa
1427b1709a Merge pull request #851 from kevlahnota/master
remove changes AACopier
2016-08-12 20:14:51 +08:00
Anthony Calosa
960d4d35fb remove my changes in aacopier
since I introduce a weird crash bug with it.
2016-08-12 17:14:52 +08:00
Anthony Calosa
7a467ce860 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-12 17:01:42 +08:00
Anthony Calosa
cd46314b4e Merge pull request #850 from kevlahnota/master
Fix Deathbringer Liege
2016-08-12 16:26:25 +08:00
Anthony Calosa
9c81acff53 Fix Deathbringer Liege 2016-08-12 16:25:37 +08:00
zethfoxster
d8b2e2873b Merge pull request #41 from WagicProject/master
getting master
2016-08-11 23:27:16 -04:00
Anthony Calosa
98cd6675d9 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-12 10:00:11 +08:00
Anthony Calosa
002085ad32 Merge pull request #849 from kevlahnota/master
Add Game/Player Info
2016-08-12 09:18:32 +08:00
Anthony Calosa
2e525dfdcc exclude card that copied a token.
I added a new search for tokens just below this
2016-08-12 07:44:59 +08:00
Anthony Calosa
a378e3a72d fix extracosts on cumulative upcost
since Manacost::copy copies, extracost, if this is enabled, extracost is
doubled. tested with Aboroth
2016-08-12 07:43:39 +08:00
Anthony Calosa
7e14b2fc5a exception testsuite
the current implementation was clone must be recognized by id in the
scripted test.
2016-08-11 21:05:00 +08:00
Anthony Calosa
51016f9258 revised AACopier 2016-08-11 18:52:18 +08:00
Anthony Calosa
adad723110 game mode info 2016-08-11 14:26:41 +08:00
Anthony Calosa
a10e7ab279 Revert "copy/flip limit"
This reverts commit 0c124327de.
2016-08-11 11:03:37 +08:00
Anthony Calosa
0c124327de copy/flip limit
if the copy/flip is activated, it means it's already in the battlefield,
so "enters the battlefield" must not trigger...
2016-08-10 19:49:31 +08:00
zethfoxster
6c5f706064 Merge pull request #40 from WagicProject/master
getting master
2016-08-09 22:14:58 -04:00
Anthony Calosa
2422e72713 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-10 09:51:23 +08:00
Anthony Calosa
e49e4a5e67 Merge pull request #848 from kevlahnota/master
Fix SOI cards
2016-08-10 08:28:52 +08:00
Anthony Calosa
14d8d65de0 asflash
spellmastery is for alternate cost, added asflash... so cards that find
cards with flash don't find asflash...
2016-08-10 07:31:15 +08:00
Anthony Calosa
d3305cadb6 quick sliver typo 2016-08-10 07:18:46 +08:00
Anthony Calosa
17c28ca584 revised Quick Sliver & Shimmer Myr 2016-08-10 06:39:09 +08:00
Anthony Calosa
151905c5f3 Transform Trigger, Turnlimit for TrCardAddedtoZone
Cleaned primitives, and fix SOI cards (remove workarounds) todo(recheck
BFZ and OGW)
2016-08-10 01:54:24 +08:00
Anthony Calosa
ab49ea07e8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-09 13:28:52 +08:00
Anthony Calosa
8e436e6b55 Merge pull request #847 from kevlahnota/master
Fix Hint
2016-08-09 04:56:06 +08:00
Anthony Calosa
de5414ec19 Fix Etched Affinity Combo
Fix Glimmervoid Combo Hint
2016-08-09 02:58:48 +08:00
Anthony Calosa
e5d71579af Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-09 02:57:43 +08:00
Anthony Calosa
5ec4c9714c Merge pull request #846 from kevlahnota/master
adjust rendered card
2016-08-09 01:15:18 +08:00
Anthony Calosa
eafb2558c2 adjust rendered card 2016-08-09 00:38:33 +08:00
Anthony Calosa
4cefcb26c2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-08 20:28:53 +08:00
Anthony Calosa
8a86e7d0f7 Merge pull request #845 from kevlahnota/master
border & mask
2016-08-08 18:45:44 +08:00
Anthony Calosa
b20fb61e1c border & mask
add border to alternate render, fix mask shadow
2016-08-08 18:13:00 +08:00
Anthony Calosa
feeed99c62 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-08 18:11:48 +08:00
Anthony Calosa
aa5008f865 Merge pull request #844 from kevlahnota/master
Fix cards reported on forums
2016-08-08 15:44:57 +08:00
Anthony Calosa
c4ce2aa977 fix Forgotten Creation and Fable of Wolf And Owl
Forgotten Creation typo and Fable of Wolf and Owl ability clashing
2016-08-08 15:42:35 +08:00
Anthony Calosa
7cc31a473c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-08 15:41:33 +08:00
Anthony Calosa
a8193012aa Merge pull request #843 from kevlahnota/master
tnum:number parameter for token images
2016-08-08 15:11:18 +08:00
Anthony Calosa
eb0ecedecf revised token id (tnum:num parameter)
this should not conflict like earlier version.
ex:
[card]
name=Fable of Wolf and Owl
auto=@movedTo(*[green]|mystack):may token(Wolf,Creature
Wolf,2/2,green,tnum:11)
auto=@movedTo(*[blue]|mystack):may token(Bird,Creature
Bird,1/1,flying,blue,tnum:12)
text=Whenever you cast a green spell, you may put a 2/2 green Wolf
creature token onto the battlefield. -- Whenever you cast a blue spell,
you may put a 1/1 blue Bird creature token with flying onto the
battlefield.
mana={3}{GU}{GU}{GU}
type=Enchantment
[/card]
tnum uses -source id  & tnum (concatenated)
2016-08-08 13:49:24 +08:00
Anthony Calosa
de44abd529 Revert "fix token names with ",""
This reverts commit 65ef1f384c.
2016-08-08 11:29:04 +08:00
Anthony Calosa
9807ca99f9 Revert "multi tokens images on same source"
This reverts commit 8c9d2d6f1d.
2016-08-08 11:20:25 +08:00
Anthony Calosa
8c9d2d6f1d multi tokens images on same source
you can specifiy tnum:number on token parameters and it will concatenate
the default token id and the specified number. example: token(Saproling,
Creature Saproling, 1/1, green, tnum:15) if the source id is 12345, the
default token id will be -12345, concat tnum, id will be -1234515 and
the game will try to find the image 1234515t.jpg
2016-08-08 10:37:27 +08:00
Anthony Calosa
65ef1f384c fix token names with "," 2016-08-08 10:15:50 +08:00
Anthony Calosa
bf2cc36719 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-08 09:30:33 +08:00
Anthony Calosa
34ffe7eefa Merge pull request #842 from kevlahnota/master
resized avatar
2016-08-07 22:37:57 +08:00
Anthony Calosa
b756c8b9ec resize avatar 2016-08-07 22:33:40 +08:00
Anthony Calosa
19a98c9ad6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-07 22:26:39 +08:00
Anthony Calosa
e159025ebb Merge pull request #841 from kevlahnota/master
Fix Master Transmuter & Westvale Abbey
2016-08-07 19:46:56 +08:00
Anthony Calosa
05e81ad923 Fix Westvale Abbey and Master Transmuter 2016-08-07 19:42:56 +08:00
Anthony Calosa
8e1a0eb20f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-07 15:29:23 +08:00
Anthony Calosa
a881b8fa5a Merge pull request #840 from kevlahnota/master
Minor adjustment
2016-08-07 14:08:51 +08:00
Anthony Calosa
6982030013 Minor adjustment 2016-08-07 14:08:09 +08:00
Anthony Calosa
01da4c6af5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-07 14:06:22 +08:00
Anthony Calosa
a42805d4cc Merge pull request #839 from kevlahnota/master
Fix Enstack Attackers
2016-08-07 13:24:54 +08:00
Anthony Calosa
01145c4581 new adjustments 2016-08-07 13:24:14 +08:00
Anthony Calosa
4d1dfb58ff Fix Enstack Attackers
If you have 40+ tokens as attackers in play, stack them on the attackers
tightly...
2016-08-07 11:49:57 +08:00
Anthony Calosa
43f44a4142 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-07 11:47:32 +08:00
Anthony Calosa
b314d3cafe Merge pull request #838 from kevlahnota/master
corrected typo
2016-08-07 11:21:43 +08:00
Anthony Calosa
9bbf28e44b correction 2016-08-07 11:21:07 +08:00
Anthony Calosa
d995d25f69 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-07 10:37:31 +08:00
Anthony Calosa
1f58b8e6a7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-07 10:30:42 +08:00
Anthony Calosa
eeb881cdc2 Merge pull request #837 from kevlahnota/master
AACopier andAbility support
2016-08-07 10:29:06 +08:00
Anthony Calosa
807874ce5d add andAbility support for AACopier
the granted ability must exists only if you copy a card, if you don't
copy any card, the source doesn't have any granted abillities.
2016-08-07 10:15:11 +08:00
punkeduard
213d11c8e9 Changes to primitives
name=Ojutai, Soul of Winter
name=Atarka, World Render
name=Kolaghan, the Storm's Fury
name=Savageborn Hydra
2016-08-06 21:03:23 -05:00
Anthony Calosa
dfd0761506 Corrected cards reported from forums 2016-08-07 09:59:59 +08:00
Anthony Calosa
4c30086896 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-06 21:28:57 +08:00
Anthony Calosa
1efdca399e Merge pull request #836 from kevlahnota/master
re enabled token quads
2016-08-06 20:29:09 +08:00
Anthony Calosa
4f27c8051a forgot these 2016-08-06 19:55:18 +08:00
Anthony Calosa
d43693fef0 when ingame, try finding the quad
for copier/cloner when copying token generated cards...
2016-08-06 19:41:34 +08:00
Anthony Calosa
88f0202b16 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-06 19:06:57 +08:00
Anthony Calosa
be98e0b543 Update CardGui.cpp
Disabled temporary...
2016-08-06 01:40:21 -05:00
Rolzad73
8a907bb3f3 Merge pull request #835 from WagicProject/android_tweaks
Android tweaks
2016-08-06 00:25:36 -04:00
Anthony Calosa
1b34a478a1 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-06 08:04:15 +08:00
Anthony Calosa
cda0bba555 Merge pull request #834 from kevlahnota/master
Copied token images
2016-08-05 22:26:57 +08:00
Anthony Calosa
dae1b10de1 Copied Token Image
If the image is not found, try finding the token counterpart by Id
2016-08-05 21:52:46 +08:00
Rolzad73
0c4e72ece2 - attempt to fix storage location list issue on Android 4.3+ 2016-08-04 14:53:52 -04:00
Rolzad73
77dfd51b28 - Android debug logging organization 2016-08-04 13:15:49 -04:00
Rolzad73
b601a549d0 - added option for Android x86 build types 2016-08-04 11:26:41 -04:00
Anthony Calosa
c4907edd76 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-04 21:19:32 +08:00
Anthony Calosa
dcf4148d75 Merge pull request #831 from kevlahnota/master
fix code monk token
2016-08-04 21:02:34 +08:00
Anthony Calosa
8afeef568f update ability
prowess +1/+1 is ueot
2016-08-04 20:55:36 +08:00
Rolzad73
dd5635d9cd - only minor whitespace formatting Android 2016-08-04 08:32:17 -04:00
Rolzad73
62a6ddf3ca - update android gitignore
- update android launcher icons
2016-08-04 08:02:32 -04:00
Anthony Calosa
195daa97f3 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-04 13:59:34 +08:00
Anthony Calosa
b1c5c87443 Merge pull request #830 from kevlahnota/master
Fix AttackCost & BlockCost, Add nonCombatDamage count
2016-08-04 12:16:48 +08:00
Anthony Calosa
1ab88940f9 add nonCombatDamage count 2016-08-04 09:56:53 +08:00
Anthony Calosa
8ba97b8a74 Fix attackcost & blockcost
thanks zeth
2016-08-04 09:50:09 +08:00
Anthony Calosa
e7f5442a64 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-04 09:29:45 +08:00
Rolzad73
066dd866b1 - reverting debuggable attribute removal 2016-08-03 20:36:34 -04:00
Anthony Calosa
fa0722a9e2 Merge pull request #828 from kevlahnota/master
some card corrections
2016-08-04 05:50:00 +08:00
Anthony Calosa
5f276f6b22 blockcost and attackcost
counter{1%1} -> value
2016-08-04 05:46:23 +08:00
Anthony Calosa
c45b5751af cantattack
change some cards since -cantattack overrides cantattack. If there is an
effect that makes creatures can't attack, you can just activate the
ability to remove -cantattack...
2016-08-04 05:41:22 +08:00
Rolzad73
161802cf9d minor Android tweaks
- removed ads reference no longer used in manifest
- removed redundant android:debuggable attribute
- cleared EGL debug warning log spamming issue #581
2016-08-03 16:01:43 -04:00
Anthony Calosa
0679832b04 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-04 03:20:24 +08:00
Anthony Calosa
b20d6f8820 Merge pull request #827 from kevlahnota/master
TokenAndAbility for AACloner & AACopier
2016-08-04 03:17:26 +08:00
Anthony Calosa
52fb40d543 AACloner & AACopier TokenAndAbility
if the token has andAbility, the cloner/copier also has that andAbility
also...
2016-08-04 02:12:59 +08:00
Anthony Calosa
067279d2e8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-04 02:02:12 +08:00
Anthony Calosa
a0bbed6c6c Merge pull request #826 from kevlahnota/master
fix crash when copying tokens
2016-08-04 00:41:31 +08:00
Anthony Calosa
9371125eb0 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-04 00:40:01 +08:00
Anthony Calosa
0a0f6cdce9 fix crash
wrong parenthesis
2016-08-04 00:36:49 +08:00
Rolzad73
fc350be3a1 Update README.md 2016-08-03 12:36:25 -04:00
Anthony Calosa
be731a99c0 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-03 23:09:13 +08:00
Anthony Calosa
c65fd1d7ae Merge pull request #825 from kevlahnota/master
corrections
2016-08-03 23:06:45 +08:00
Anthony Calosa
be899159f3 correction 2016-08-03 23:03:32 +08:00
Anthony Calosa
2400e6578b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-03 22:34:05 +08:00
Anthony Calosa
1aac2b8e75 Update AllAbilities.cpp
Try to fix IOS/MAC compilation
2016-08-03 21:23:38 +08:00
Anthony Calosa
c7581220b8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-03 20:40:12 +08:00
Anthony Calosa
f3968215e0 Merge pull request #824 from kevlahnota/master
andAbility on ATokenCreator, Extend AAFlip
2016-08-03 18:46:46 +08:00
Anthony Calosa
56a8011b78 revert 2016-08-03 18:44:41 +08:00
Anthony Calosa
adccae7937 switched places 2016-08-03 18:11:29 +08:00
Anthony Calosa
1c63c1937a Update some cards 2016-08-03 16:28:49 +08:00
Anthony Calosa
4753f7bb51 andAbility on ATokenCreator, Extend AAFlip, 2016-08-03 16:10:53 +08:00
Anthony Calosa
d7fec7d10a Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-02 12:34:06 +08:00
Anthony Calosa
3c90a29b1e Merge pull request #823 from kevlahnota/master
Border size and color, Copier/Token Indicator
2016-08-01 23:17:12 +08:00
Anthony Calosa
98de361bf4 change comment
enable the indicator at all modes...
2016-08-01 22:34:28 +08:00
Anthony Calosa
c1df10e064 Minor Proportioning 2016-08-01 22:17:53 +08:00
Anthony Calosa
3743e0bc03 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-01 21:40:22 +08:00
Anthony Calosa
12e6a4d0ae Merge pull request #822 from kevlahnota/master
Some Corrections
2016-08-01 15:32:07 +08:00
Anthony Calosa
969511953a vector count of abilities
remove unused ones
2016-08-01 14:45:57 +08:00
Anthony Calosa
223e2e04b0 Correction 2016-08-01 11:44:07 +08:00
Anthony Calosa
0b0368ffcc Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-01 08:23:16 +08:00
Anthony Calosa
9e4684b524 Merge pull request #821 from kevlahnota/master
Fix transforms for non-permanent
2016-08-01 06:52:38 +08:00
Anthony Calosa
d825c7e4ea parenthesis 2016-08-01 04:49:04 +08:00
Anthony Calosa
c38c996773 Revised "putinplay" in castcard 2016-08-01 04:43:54 +08:00
Anthony Calosa
71a9ef00ee Support transforms for nonpermanent
fix startled awake to persistent nightmare
2016-08-01 03:52:10 +08:00
Anthony Calosa
89a30ae5ee Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-01 03:02:01 +08:00
zethfoxster
94bd0e057b Merge pull request #39 from WagicProject/master
getting master
2016-07-31 10:46:46 -04:00
Anthony Calosa
0efc6338bb Merge pull request #820 from kevlahnota/master
Fix Cloner
2016-07-31 21:38:10 +08:00
Anthony Calosa
3b98da1d86 Fix Cloner ability 2016-07-31 18:46:07 +08:00
Anthony Calosa
6927c68811 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-31 18:06:12 +08:00
Anthony Calosa
f0909ba3a0 Merge pull request #819 from kevlahnota/master
minor fix
2016-07-31 13:30:15 +08:00
Anthony Calosa
2f7d2873f7 @at to @each 2016-07-31 13:28:55 +08:00
Anthony Calosa
7a6b6aa335 Change copier copy 2016-07-31 13:24:18 +08:00
Anthony Calosa
2861ef0c73 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-31 13:13:26 +08:00
Anthony Calosa
059fc06f3a Merge pull request #818 from kevlahnota/master
Fix Chandra, Flamecaller & Cryptolith Rite
2016-07-31 08:20:09 +08:00
Anthony Calosa
a971576de0 Fix Chandra, Cryptolith Rite 2016-07-31 08:16:25 +08:00
Anthony Calosa
a4e059e3ec Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-31 08:14:28 +08:00
Anthony Calosa
07408b7bc3 Merge pull request #817 from kevlahnota/master
Added EMA & Revert Stormtide Leviathan code
2016-07-31 08:09:09 +08:00
Anthony Calosa
9722f7b71e Added Eternal Masters 2016-07-31 08:06:53 +08:00
Anthony Calosa
45d8413d59 Revert Stormtide Leviathan code 2016-07-31 07:58:26 +08:00
Anthony Calosa
5c400457a9 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-31 07:32:08 +08:00
zethfoxster
3e9ee5890f Merge pull request #816 from zethfoxster/master
add some handling of reveal to avoid a crash in demo for AI.
2016-07-30 10:51:26 -04:00
zethfoxster
1acdb40498 add some handling of reveal to avoid a crash in demo for AI. 2016-07-30 10:50:31 -04:00
zethfoxster
1dc0b00133 Merge pull request #815 from zethfoxster/master
same applies for scry
2016-07-30 10:20:48 -04:00
zethfoxster
f2208389bd same applies for scry 2016-07-30 10:20:19 -04:00
zethfoxster
ab92c3e15b Merge pull request #814 from zethfoxster/master
pushing to master
2016-07-30 10:14:54 -04:00
zethfoxster
018e35295a fixed a crash in revealing, not sure why I thought it was a good idea to test testdestroy something that I just removed from the game. if anyone can find another crash with it, let me know which card causes it. 2016-07-30 10:13:58 -04:00
zethfoxster
2c9e90eee0 Merge pull request #38 from WagicProject/master
getting master
2016-07-30 08:29:45 -04:00
Anthony Calosa
847f21f7dc Merge pull request #813 from kevlahnota/master
Centered Power/Toughness
2016-07-30 15:05:57 +08:00
Anthony Calosa
b90dfbe3b0 Centered P/T inside P/T box 2016-07-30 15:04:34 +08:00
Anthony Calosa
c230794c82 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-30 15:03:08 +08:00
Anthony Calosa
7f83aa7253 Merge pull request #812 from kevlahnota/master
small adjustment
2016-07-30 12:14:24 +08:00
Anthony Calosa
1039815017 small adjustment
meld card have a little space between. reduce render big display.
2016-07-30 10:21:39 +08:00
Anthony Calosa
2c43eac80d Merge pull request #811 from kevlahnota/master
change enstack & scale
2016-07-30 09:18:44 +08:00
Anthony Calosa
4aa6ad3203 small scale 2016-07-30 08:13:30 +08:00
Anthony Calosa
730b05ad1b change enstack attackers
their x position is the same in their "default" horizontal stack, so
when attacking it always start at left side, not in the middle. Please
report if you have bugs...
2016-07-30 07:07:35 +08:00
Anthony Calosa
5a7b2c5029 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-30 07:02:49 +08:00
zethfoxster
7ae551de9d Merge pull request #37 from WagicProject/master
getting master
2016-07-29 17:44:56 -04:00
Anthony Calosa
96dd3faef0 Merge pull request #810 from kevlahnota/master
Meld card size
2016-07-30 03:49:06 +08:00
Anthony Calosa
ffdc8cd9ff meld card size 2016-07-30 03:05:24 +08:00
Anthony Calosa
8256ac3bee Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-30 01:41:43 +08:00
Anthony Calosa
037ab83519 Merge pull request #809 from kevlahnota/master
Border corrections
2016-07-30 00:10:28 +08:00
Anthony Calosa
a56e77310d Border Corrections
Removed other border render, and use the one in cardgui::drawcard...
2016-07-29 23:10:01 +08:00
Anthony Calosa
5350fb7f5d Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-29 18:47:51 +08:00
Anthony Calosa
9161f89057 Merge pull request #808 from kevlahnota/master
alphabeta border & scale
2016-07-29 18:40:38 +08:00
Anthony Calosa
1d2abeb20b Minor Border changes
Also added copier values if it has copied a token or not...
2016-07-29 18:37:03 +08:00
Anthony Calosa
833c21192a Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-29 18:30:20 +08:00
Anthony Calosa
86168e454f Merge pull request #807 from kevlahnota/master
Add test and Fix unused variable error
2016-07-29 08:11:05 +08:00
Anthony Calosa
a20c2ce29a Unused variable 2016-07-29 07:30:20 +08:00
Anthony Calosa
874b27c56d Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-29 07:00:46 +08:00
Anthony Calosa
a7dc44e4e1 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-29 07:00:07 +08:00
zethfoxster
047d08882e Merge pull request #806 from zethfoxster/master
pushing to master
2016-07-28 18:55:03 -04:00
zethfoxster
52df1ad963 the fix for the sacrifice trigger was a ton easier than expected.
treat it like a spell. 
the card after contains all the info we need to determine if it should trigger.
2016-07-28 18:48:47 -04:00
Anthony Calosa
c2cec37928 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-29 06:36:51 +08:00
Anthony Calosa
239a186b36 Update _tests.txt 2016-07-28 21:36:21 +08:00
Anthony Calosa
5aeb2ebc05 Create TirelessGraf.txt 2016-07-28 21:35:43 +08:00
zethfoxster
a7e87aaae5 Merge pull request #36 from WagicProject/master
Getting master
2016-07-28 09:11:55 -04:00
zethfoxster
eb545eca57 Merge pull request #804 from zethfoxster/master
Merge pull request #35 from WagicProject/master
2016-07-28 08:02:00 -04:00
Anthony Calosa
44ab1827bf Merge pull request #803 from kevlahnota/master
Update test and Corrected Graf Mole
2016-07-28 19:39:05 +08:00
Anthony Calosa
96b4f024b4 Update test and Corrected Graf Mole 2016-07-28 19:34:50 +08:00
Anthony Calosa
b070035770 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-28 19:28:05 +08:00
Anthony Calosa
1b0c3d8c00 Merge pull request #802 from kevlahnota/master
Attempt to fix my mess
2016-07-28 19:25:42 +08:00
Anthony Calosa
2e71cb08d0 I hope this is correct 2016-07-28 19:24:01 +08:00
Anthony Calosa
3da5d12bee Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-28 17:31:51 +08:00
Anthony Calosa
e8019bbb92 Merge pull request #801 from kevlahnota/master
Fix Compilation and add Tireless Tracker Test
2016-07-28 17:09:34 +08:00
Anthony Calosa
30dab27202 Fix Compilation 2016-07-28 16:38:16 +08:00
Anthony Calosa
cc7077d783 Fix compilation and add Tireless Tracker test 2016-07-28 16:37:38 +08:00
Anthony Calosa
fda7e9f39d Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-28 11:20:40 +08:00
zethfoxster
e178533493 Merge pull request #35 from WagicProject/master
getting master
2016-07-27 23:04:19 -04:00
zethfoxster
e3ad9296bc Merge pull request #800 from zethfoxster/master
getting master
2016-07-27 23:03:37 -04:00
Anthony Calosa
01042a62ae Merge pull request #799 from kevlahnota/master
revert
2016-07-28 10:30:49 +08:00
Anthony Calosa
7bd940ddb3 Revert "revised legendary"
This reverts commit 193d7accb4.
2016-07-28 10:28:54 +08:00
Anthony Calosa
f168702aad Revert "moved sac event"
This reverts commit 2a33c0c375.
2016-07-28 10:28:27 +08:00
Anthony Calosa
2a33c0c375 moved sac event 2016-07-28 10:26:25 +08:00
zethfoxster
eea240d7f2 changing some of the logic to the previous fixes, we want to avoid using code that looks for specific card names.
currently we have kamiflip as the only defined flip type as it is treated differently from the others. 
but we have room for more if needed now
doublefaced=kamiflip
sets the flip type of a card to the kamiflip style cards. since this is defined on cardprimitive level now, we might be able to do something different from the flipping animation. who knows.

commented out the forcing token triggers, it bypass targetchooser check. still working on a fix for this coming soon.
2016-07-27 20:03:25 -04:00
zethfoxster
afb98a374c updated codes for changes 2016-07-27 19:58:32 -04:00
Anthony Calosa
ed0d28eaf6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-28 07:02:36 +08:00
Anthony Calosa
50345101e5 Merge pull request #798 from kevlahnota/master
Revised Legendary
2016-07-28 06:44:14 +08:00
zethfoxster
c0e4010c88 Merge pull request #34 from WagicProject/master
getting master
2016-07-27 18:42:54 -04:00
Anthony Calosa
193d7accb4 revised legendary 2016-07-28 06:42:47 +08:00
Anthony Calosa
a9be34c627 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-28 06:33:30 +08:00
Anthony Calosa
0e14226968 Merge pull request #797 from kevlahnota/master
Alpha-Beta Small-Inner Border
2016-07-27 18:13:11 +08:00
Anthony Calosa
068b03a0bb Alpha-Beta small inner border 2016-07-27 17:12:11 +08:00
Anthony Calosa
b99f9ae752 alpha beta small border 2016-07-27 17:10:26 +08:00
Anthony Calosa
3519871f80 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-27 17:07:24 +08:00
Anthony Calosa
e9db853f28 Merge pull request #796 from kevlahnota/master
Fix Flip/Transform Cards, Fix Copier
2016-07-27 16:07:05 +08:00
Anthony Calosa
a6fdd89e1d Fix Copier 2016-07-27 15:19:11 +08:00
Anthony Calosa
b8bfe7acc1 Fix Flip/Transform Cards
If the card is a copier or a token, it cannot be transformed since it's
not a double face card. Also the copied card must be the "active" part
of a double faced card. Flip cards (kamigawa block) is not restricted by
this since its a single sided card. If the transformed card is cda, take
any damage into account (PT bonus is already in effect for cda)..
2016-07-27 14:39:39 +08:00
Anthony Calosa
dd5d5589ff Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-27 12:41:38 +08:00
zethfoxster
7d460e093c Merge pull request #795 from zethfoxster/master
pushing to master
2016-07-26 22:47:07 -04:00
zethfoxster
54e86915b0 Merge pull request #33 from WagicProject/master
getting master
2016-07-26 22:46:06 -04:00
Anthony Calosa
ab2effd776 Merge pull request #794 from kevlahnota/master
Event for token sacrifice
2016-07-27 09:19:16 +08:00
zethfoxster
4f0da67a83 fixed a condition where scry core wasnt triggering its after effect 2016-07-26 19:35:10 -04:00
Anthony Calosa
014ca36a4a force event for token sacrifice 2016-07-27 07:11:30 +08:00
Anthony Calosa
2971e64182 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-27 07:11:10 +08:00
Anthony Calosa
d7737c13ff Merge pull request #793 from kevlahnota/master
Fix CDA vs Flip/Transforms
2016-07-27 07:07:47 +08:00
Anthony Calosa
eebcc9c925 Fix CDAACTIVE & transformed card colors
cdaactive has its own computation, so exclude it on flip/transform cards
ability
2016-07-27 06:31:03 +08:00
Anthony Calosa
0c90b39a96 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-27 02:57:42 +08:00
Anthony Calosa
4f3f96337f Merge pull request #792 from kevlahnota/master
Fix Legendary (Mirror Gallery) & Enters Tapped cards
2016-07-27 02:34:56 +08:00
Anthony Calosa
e855ca72aa Fix Mirror Gallery & enters "tapped" cards
If Mirror Gallery leaves play, you must check for legendary status.
Fix some cards that enters tapped.
2016-07-27 01:44:18 +08:00
Anthony Calosa
8ff47bf8e2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-26 23:18:35 +08:00
Anthony Calosa
9d75f69a79 Merge pull request #791 from kevlahnota/master
granted flashback
2016-07-26 11:21:28 +08:00
Anthony Calosa
ae33977e10 Add Snapcaster Mage Ability
tempflashback - flashback using manacost
2016-07-26 09:56:13 +08:00
Anthony Calosa
07b5f35b98 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-26 09:39:47 +08:00
Anthony Calosa
c4acf006dd Merge pull request #790 from kevlahnota/master
Clue tokens
2016-07-26 09:27:24 +08:00
Anthony Calosa
12b80307a7 Update Living_Death.txt
Use Living Death and Clone
2016-07-26 08:51:46 +08:00
Anthony Calosa
43fd399d10 Update _tests.txt 2016-07-26 07:46:18 +08:00
Anthony Calosa
cc5d8940bf Clue tokens 2016-07-26 07:43:13 +08:00
Anthony Calosa
09ed1ab683 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-25 10:42:49 +08:00
Anthony Calosa
26c85fd18a added Eldritch Moon 2016-07-25 06:32:49 +08:00
Anthony Calosa
894615bee6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-25 05:15:38 +08:00
zethfoxster
aeed094be0 Merge pull request #789 from zethfoxster/master
big whoops here, this would be a disastrous change.
2016-07-24 11:12:45 -04:00
zethfoxster
61068ee166 big whoops here, this would be a disastrous change. 2016-07-24 11:12:13 -04:00
zethfoxster
bdce25cb8c Merge pull request #788 from zethfoxster/master
pushing to master
2016-07-24 11:09:18 -04:00
zethfoxster
6a71bf5653 Merge pull request #32 from WagicProject/master
getting master
2016-07-24 11:08:51 -04:00
zethfoxster
3007ddc093 added oplifetotal...or readded, i swear this was already in a long time ago when I added lifetotal as a variable. either way. 2016-07-24 11:08:08 -04:00
Anthony Calosa
4495e1649f Merge pull request #787 from kevlahnota/master
Little border adjustments
2016-07-24 21:19:57 +08:00
Anthony Calosa
f960cdea9b A little border adjustment
no more very thin borders on awards and in game...
2016-07-24 20:25:20 +08:00
Anthony Calosa
b70b2a65bc Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-24 20:20:31 +08:00
Anthony Calosa
4a73e90da8 remove test
temporarily
2016-07-24 20:19:58 +08:00
Anthony Calosa
fc59bef156 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-24 19:41:58 +08:00
zethfoxster
512f4ca4e4 Merge pull request #786 from zethfoxster/master
pushing to master
2016-07-24 07:33:17 -04:00
zethfoxster
f254ca57c6 Merge pull request #31 from WagicProject/master
getting master
2016-07-24 07:32:06 -04:00
Anthony Calosa
5e35dac1da Update Living_Death.txt 2016-07-24 17:51:26 +08:00
Anthony Calosa
44cbd408ce Update _tests.txt 2016-07-24 14:25:08 +08:00
Anthony Calosa
6fbe9de1a8 Create Living_Death.txt 2016-07-24 14:24:11 +08:00
Anthony Calosa
3b1410f913 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-24 14:21:15 +08:00
Anthony Calosa
f9265923a9 Merge pull request #784 from kevlahnota/master
Border Adjustment & Added repeat depleter/ingest cards
2016-07-24 13:29:26 +08:00
Anthony Calosa
3282848631 Normalized Big Quad Border
Hopefully all Big Quads have identical border sizes: In Game, Deck
Editor Carousel and Trophies .
2016-07-24 13:12:40 +08:00
Anthony Calosa
f142363bfa smaller scaled big quad and forced border
Ingame big quads are scaled smaller
2016-07-24 12:40:41 +08:00
Anthony Calosa
c0e9800179 added scalpelexis, sphinx's tutelage, grindstone, primal surge 2016-07-24 12:31:16 +08:00
Anthony Calosa
97308ca31c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-24 11:24:02 +08:00
zethfoxster
02992954c2 Merge pull request #30 from WagicProject/master
getting master
2016-07-23 09:19:12 -04:00
Anthony Calosa
78d4f178a3 Merge pull request #783 from kevlahnota/master
Fix Flying vs Moat (multiples of them). Fixes issue #526
2016-07-23 10:16:47 +08:00
Anthony Calosa
fe577d9dd0 fix flying and multiple moat in play
putrid imp that gains temporary flying cant attack if the opponent has
multiple moat in play, this should fix it.
2016-07-23 09:45:12 +08:00
Anthony Calosa
007010067b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-23 09:06:56 +08:00
zethfoxster
bc2d8dab31 corrected my logic for emerge, originally I thought the cost was the same as the original cost, while coding i noticed it can have a completely different cost than the real manacost.
moved the extra cost check for "offerings" to a location before canafford in alternative reacttoclick, the reason for this is that the 2 offering cost we have handle the can afford calls, and even cast the card in the dopay. not placing this before it causes the card to not react to click if there is a different manacost attached to the emerge/kill 
test codes below.
mana={g}{g}{g}
other={emerge}(r}{4} name(emerge)

mana={6}
other={k(giant|mybattlefield)}

fixed memleaks in killoffering code.

note to devs, remember to make diff costs a variable that you can safe_delete, it creates a manacost object that will become a leak otherwise.
do not use it directly as a function.
source->controller()->getManaPool()->canAfford(source->getManaCost()->Diff(target->getManaCost()))
this will leave a memleak every single time ai checks this cost, or a player accesses the cost even if you cant pay it.
2016-07-22 19:10:06 -04:00
zethfoxster
296f8645fb Merge pull request #782 from zethfoxster/master
pushing to master
2016-07-22 18:05:35 -04:00
zethfoxster
2d76c8ff0d Merge pull request #29 from WagicProject/master
getting master
2016-07-22 18:05:16 -04:00
zethfoxster
0a3d9f9876 flipped the logic of the 2 deck editor menu buttons left and right, it was a nightmare making an ai deck with the tiny buttons to navigate. having my finger slip slightly off the button made it travel the opposite direction from the button, which was confusing and felt very buggy. 2016-07-22 17:46:52 -04:00
Anthony Calosa
2a1d0b19ce Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-22 21:35:23 +08:00
Anthony Calosa
a99c57ab1a Merge pull request #780 from kevlahnota/master
OK quad and COMBATTOUGHNESS for attackers/blockers
2016-07-22 16:34:15 +08:00
Anthony Calosa
6832049ccc reserve size 2016-07-22 16:00:29 +08:00
Anthony Calosa
6d72753216 OK quad and COMBATTOUGHNESS for attackers/blockers
support doubled res for OK quad, AI should consider toughness as power
if it has COMBATTOUGHNESS ability
2016-07-22 15:38:38 +08:00
Anthony Calosa
b6b3898536 Merge pull request #10 from WagicProject/master
pull from master
2016-07-22 14:20:39 +08:00
Anthony Calosa
99922d38e2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-22 14:15:50 +08:00
zethfoxster
161623a8d2 Merge pull request #779 from zethfoxster/master
pushing to master
2016-07-21 22:31:17 -04:00
zethfoxster
155a7a6582 Merge pull request #28 from WagicProject/master
getting master
2016-07-21 22:29:58 -04:00
zethfoxster
6aafe9dee0 added lifegain and oplifegain variable used the same as lifelost, but stores the value of life gained this turn. 2016-07-21 21:11:15 -04:00
zethfoxster
680c9d64cb Merge pull request #778 from zethfoxster/master
getting master
2016-07-21 20:47:28 -04:00
zethfoxster
ca395492d5 added meld(cardname)
added meldfrom(cardname|cardname) helper class.

auto={0}:target(arbor colossus|mybattlefield) meld(Arc Runner)
auto=meldfrom(arbor elf|Arbor Colossus)
2016-07-21 20:46:53 -04:00
Anthony Calosa
ea920d352f Merge pull request #777 from kevlahnota/master
Award images
2016-07-21 15:50:58 -05:00
Anthony Calosa
0c0031455b Add files via upload 2016-07-21 15:49:32 -05:00
Anthony Calosa
a8a9893ce4 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-22 04:22:34 +08:00
Anthony Calosa
5143743661 unlocked images 2016-07-21 22:58:27 +08:00
Anthony Calosa
88a42b25cc Add files via upload 2016-07-21 02:39:51 -05:00
Anthony Calosa
b371bf6efa Merge pull request #776 from kevlahnota/master
psp fix 3
2016-07-21 02:37:47 -05:00
Anthony Calosa
3bc7ed6f8c Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-21 15:36:22 +08:00
Anthony Calosa
f996510969 psp fix 3 2016-07-21 15:36:16 +08:00
Anthony Calosa
58fd119636 Add files via upload 2016-07-21 02:36:16 -05:00
Anthony Calosa
f275792604 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-21 15:23:17 +08:00
zethfoxster
9f8ead5e4e added other={cost}
other={emerge}
2016-07-20 20:06:18 -04:00
zethfoxster
a35ccbbe5b Merge pull request #775 from zethfoxster/master
pushing to master
2016-07-20 19:01:10 -04:00
zethfoxster
9a60a8838f Merge pull request #27 from WagicProject/master
getting master
2016-07-20 19:00:08 -04:00
zethfoxster
bb9e02da6b fixed a debug assert i introduced. 2016-07-20 18:58:29 -04:00
Anthony Calosa
0fd0c5ecc1 Merge pull request #774 from kevlahnota/master
psp fix 2
2016-07-20 17:36:02 -05:00
Anthony Calosa
c89961ebf0 Add files via upload 2016-07-20 17:35:03 -05:00
Anthony Calosa
0f81e82206 psp fix 2 2016-07-21 06:34:14 +08:00
Anthony Calosa
7c7c8c4f34 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-21 06:02:56 +08:00
xawotihs
3d7362aa9d Merge branch 'master' of https://github.com/WagicProject/wagic 2016-07-20 22:16:23 +01:00
Anthony Calosa
f3061a2526 Merge pull request #773 from kevlahnota/master
Semicolon
2016-07-20 11:40:24 -05:00
Anthony Calosa
2657af1aef semicolon 2016-07-21 00:38:01 +08:00
Anthony Calosa
dd03ed4b30 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-21 00:37:50 +08:00
Anthony Calosa
64c6b05963 Merge pull request #772 from kevlahnota/master
try to fix psp
2016-07-20 19:19:56 +08:00
Anthony Calosa
05017b0236 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-20 19:17:36 +08:00
Anthony Calosa
efd9cce4ef try to fix psp platform 2016-07-20 19:16:48 +08:00
Anthony Calosa
144c78fa4b Add files via upload 2016-07-20 19:12:06 +08:00
Anthony Calosa
3147aa539c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-20 09:42:16 +08:00
zethfoxster
ad4532932b Merge pull request #771 from zethfoxster/master
pushing to master
2016-07-19 20:44:40 -04:00
zethfoxster
ffac3462af Merge pull request #26 from WagicProject/master
Merge pull request #770 from zethfoxster/master
2016-07-19 20:44:06 -04:00
zethfoxster
7c163592b5 removed the changes I made to selectAbility and created a new function which handles sending an ability and card to have AI do the ability of that card.
found a selectability call after blockers that was the cause of a race condition debug assert, but most importantly, the reason AI would sometimes block a creature, then immediately decide not to block. causing it to sometimes take preventable damage, and sometime cause AI to stack a ton of blockers on a single card even tho it did not have a chance to actually kill the creature.
this is still a thing, but wont happen so grossly incorrect now.
2016-07-19 20:16:22 -04:00
xawotihs
a6211e371e Revert usage of ant release and remove the DEBUG define in the NDK makefile to remove the testsuite 2016-07-19 22:24:26 +01:00
Xawotihs
775085eca1 Uses now *ant release* to build the APK 2016-07-19 21:30:08 +01:00
xawotihs
b3d580cada Changed Android app manifest to be not debuggable. 2016-07-19 21:03:24 +01:00
Anthony Calosa
37987ddb57 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-19 10:47:53 +08:00
zethfoxster
a56ab4f561 Merge pull request #770 from zethfoxster/master
pushing to master
2016-07-18 22:30:53 -04:00
zethfoxster
6f649bd680 Merge pull request #25 from WagicProject/master
getting master
2016-07-18 22:30:30 -04:00
zethfoxster
6316577ec7 taught AI basic attack and block cost.
added functionality to send specific abilities to AI "selectAbility" to have it find mana, targets, and use a selected ability at our command.
2016-07-18 22:03:16 -04:00
Anthony Calosa
61cd74fcd0 revert psp cache 2016-07-19 09:52:18 +08:00
zethfoxster
37fd0ebbd2 readded the "fakebar" size adjustments based on string lengths.
in debug there is a strange line drawn sometimes on screen, like the buttons on main screen, this is not present in release builds, I'm guessing its some kind of debug related thing with JGE and quads.
2016-07-18 19:02:03 -04:00
zethfoxster
8e987a6718 Merge pull request #769 from zethfoxster/master
pushing to master
2016-07-18 17:24:15 -04:00
zethfoxster
520be9dbe8 Merge pull request #24 from WagicProject/master
getting master
2016-07-18 17:23:54 -04:00
zethfoxster
322e6f7edf Merge pull request #768 from kevlahnota/master
Some changes on Deck Editor & Others
2016-07-18 17:22:16 -04:00
Anthony Calosa
b6eea6fe2e Some Changes to Deck Editor and Others
Some Deck Editor changes
2016-07-19 04:33:23 +08:00
Anthony Calosa
dc84c50ea8 add deck editor graphics 2016-07-19 03:32:22 +08:00
Anthony Calosa
07d7df7271 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-18 23:33:26 +08:00
Anthony Calosa
5b9f3c70dc Merge pull request #767 from kevlahnota/master
minor changes
2016-07-18 14:26:31 +08:00
Anthony Calosa
bd36590084 offquad for offset bg 2016-07-18 13:52:28 +08:00
Anthony Calosa
4e64ff4ff9 center menu title 2016-07-18 13:51:49 +08:00
Anthony Calosa
2dd882a7a5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-18 13:51:19 +08:00
Anthony Calosa
fe4c102c7d Merge pull request #766 from kevlahnota/master
psp cache
2016-07-18 12:47:01 +08:00
Anthony Calosa
1380bc9940 psp cache 2016-07-18 12:44:19 +08:00
Anthony Calosa
5cc549ad3a Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-18 11:11:51 +08:00
Anthony Calosa
75395f6622 Merge pull request #765 from kevlahnota/master
Fix Deck Menu layer, Change Main Menu Layout, Fix Crash cdaactive on tokens
2016-07-18 11:04:51 +08:00
Anthony Calosa
c9576e260e fix blinking menu item 2016-07-18 11:04:14 +08:00
Anthony Calosa
362d692879 cleanup 2016-07-18 10:53:07 +08:00
Anthony Calosa
acbaa69305 use previous "phaseinfo" as fakebar 2016-07-18 10:38:47 +08:00
Anthony Calosa
592a48c725 add fakebar 2016-07-18 10:38:47 +08:00
zethfoxster
bfaaf7d893 travis int order 2016-07-17 22:37:32 -04:00
zethfoxster
9e73dc9c00 add support for repeater deplete cards.
Scalpelexis
Sphinx's Tutelage
Grindstone
normally I aim for much bigger card groups, but this was requested by one of the only 2 active members we have on the forum.
I'll have the card code for these cards ready when I code eldrich moon set.

to use, use it like any normal depelte except add
name
color
to the front, 
name deplete:4 targetsZone(player)
this will repeat this until the player depletes cards that dont have atleast 2 with the same name.
color deplete:2 target(player)
this will continue to deplete until the player depletes a set of cards that dont share a color with each other lands not included when checking colors.
enjoy.
2016-07-17 22:24:53 -04:00
Anthony Calosa
d37aac0c71 added fakebar.png 2016-07-18 10:15:22 +08:00
Anthony Calosa
8314d4c9ae update GameStateMenu
as Zeth suggested
2016-07-18 09:24:28 +08:00
Anthony Calosa
d860954c32 fix crash with cdaactive and token
cdaactive is forcedalive, if the token dies, forcedestroy it, token/s go
to garbage
2016-07-18 07:32:02 +08:00
Anthony Calosa
0b4b085095 fix layer order 2016-07-18 07:28:31 +08:00
Anthony Calosa
c0334d0c94 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-18 06:07:38 +08:00
zethfoxster
6acd897e16 Merge pull request #23 from WagicProject/master
getting master
2016-07-17 10:39:10 -04:00
Anthony Calosa
2adfc55339 Merge pull request #763 from kevlahnota/master
stats to the right
2016-07-17 20:07:28 +08:00
Anthony Calosa
208b4f68b5 added statsholder 2016-07-17 19:05:00 +08:00
Anthony Calosa
33fd704a00 move stats to the right in deck menu 2016-07-17 19:03:55 +08:00
Anthony Calosa
6d8ece6822 change avatar holder bg color 2016-07-17 19:02:45 +08:00
Anthony Calosa
6b5cbd5f11 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-17 17:35:36 +08:00
Anthony Calosa
ea6017511b Merge pull request #762 from kevlahnota/master
large icons for Android
2016-07-17 15:39:58 +08:00
Anthony Calosa
2477b8a3ea large icons for Android 2016-07-17 15:39:10 +08:00
Anthony Calosa
cdd1075384 Merge pull request #761 from kevlahnota/master
phaseinfo & backdropframe & backdrop
2016-07-17 15:22:58 +08:00
Anthony Calosa
c61c17f19c increased cache 2016-07-17 15:05:53 +08:00
Anthony Calosa
774b79f07e seperated backdrop and backdropframe 2016-07-17 14:44:37 +08:00
Anthony Calosa
002172281b added backdrop frame 2016-07-17 14:42:16 +08:00
zethfoxster
4e9d4bfaf6 minor changes to ai 2016-07-17 02:19:58 -04:00
Anthony Calosa
894e9f244f added phaseinfo graphic 2016-07-17 14:13:57 +08:00
Anthony Calosa
189b45ab9b new backdrop 2016-07-17 14:12:47 +08:00
Anthony Calosa
b0912de788 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-17 14:11:54 +08:00
Anthony Calosa
f435946f66 seperated backdrop and phase info graphic 2016-07-17 14:11:49 +08:00
Anthony Calosa
64d91ccaab Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-17 12:52:12 +08:00
Anthony Calosa
e97fbb2784 Update DeckImporter.java 2016-07-17 11:47:06 +08:00
zethfoxster
0029e0ed43 Merge pull request #22 from WagicProject/master
getting master
2016-07-16 23:13:59 -04:00
Anthony Calosa
088f235f29 Merge pull request #760 from kevlahnota/master
revert build.xml
2016-07-17 08:55:34 +08:00
Anthony Calosa
dd5aa90498 revert build.xml 2016-07-17 08:54:26 +08:00
Anthony Calosa
c866e5dd45 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-17 08:54:01 +08:00
Anthony Calosa
6e8f74af15 Merge pull request #759 from kevlahnota/master
centered unlock awards and double res shop
2016-07-17 08:36:18 +08:00
Anthony Calosa
d70fd8c208 test build number 2016-07-17 08:35:14 +08:00
Anthony Calosa
9551c9bed4 upped build number
don't know if we can compute travis build number minus the last build of
this
2016-07-17 08:02:04 +08:00
Anthony Calosa
06740564f8 centered unlock awards and double res shop
400x100 base scale for the xxx_unlocked.png
2016-07-17 07:42:46 +08:00
Anthony Calosa
ef94c31d42 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-17 06:28:17 +08:00
zethfoxster
093b370903 Merge pull request #758 from zethfoxster/master
stupid case for travis
2016-07-16 16:31:56 -04:00
zethfoxster
542845667a stupid case for travis 2016-07-16 15:59:45 -04:00
zethfoxster
8ce08bc4f4 Merge pull request #757 from zethfoxster/master
more fixes
2016-07-16 14:47:12 -04:00
zethfoxster
69158d55c1 more fixes 2016-07-16 14:46:40 -04:00
zethfoxster
d9a794e186 Merge pull request #756 from zethfoxster/master
pushing to master
2016-07-16 14:44:16 -04:00
zethfoxster
6cc146c0a5 Merge pull request #21 from WagicProject/master
getting master
2016-07-16 14:43:45 -04:00
Anthony Calosa
b490328a45 Merge pull request #755 from kevlahnota/master
backdrop & taskboard
2016-07-16 22:08:13 +08:00
zethfoxster
30df5226df Merge pull request #20 from WagicProject/master
getting master
2016-07-16 09:39:26 -04:00
Anthony Calosa
c8369ce316 replaced backdrop and taskboard 2016-07-16 21:30:09 +08:00
Anthony Calosa
ffb7e5d573 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-16 21:00:14 +08:00
Anthony Calosa
3d41531a84 Merge pull request #754 from kevlahnota/master
support doubled res for awards
2016-07-16 19:50:20 +08:00
Anthony Calosa
f0fa6986d7 support double res award
the 203.f height and 268.f is reserved for small award images, if you
want double res, make the award in scale of 171x192 (example 342x384)
2016-07-16 14:49:57 +08:00
Anthony Calosa
d908606527 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-16 13:30:55 +08:00
Anthony Calosa
886a26aa20 Merge pull request #753 from kevlahnota/master
First set of Graphic Changes ... use default theme
2016-07-16 10:19:37 +08:00
Anthony Calosa
bc77ff45cd Create readme.txt 2016-07-16 09:44:42 +08:00
Anthony Calosa
c1fb884dcd moved old themes 2016-07-16 09:38:20 +08:00
Anthony Calosa
26992828f0 Add files via upload 2016-07-16 09:36:22 +08:00
Anthony Calosa
07670c6bc5 Create readme.txt 2016-07-16 09:32:15 +08:00
Anthony Calosa
b2bc6b7740 remove old theme 2016-07-16 09:25:21 +08:00
Anthony Calosa
c617ede243 First set of Graphic changes
TODO: generate a graph/stats on deck menu to the right, update other
graphics, move detailed info on the right of deck menu...
2016-07-16 09:16:07 +08:00
Anthony Calosa
0d7600d62c revert wallpapers 2016-07-16 09:08:38 +08:00
Anthony Calosa
7a0ef10f9f add new graphics 2016-07-16 09:06:38 +08:00
zethfoxster
2fc52c9abd changed suspend to use castcard. 2016-07-14 21:25:04 -04:00
zethfoxster
9a56817bf8 fixed a bug I introduced 2016-07-14 20:44:21 -04:00
zethfoxster
e81346f881 more work on cascade, I think I figured out what was causing a weird crash. 2016-07-14 20:28:19 -04:00
zethfoxster
01fd8fa406 recoded cascade, the logic was incorrect. also the ability was coded incorrectly. ALL the cards get exiled, then placed on the bottom, the card that cost less is also exiled then MAY be cast otherwise its placed in the library bottom with the rest.
I also now tell AI to ALWAYS use cast card if available. as the effects are always better.
2016-07-13 23:57:30 -04:00
Anthony Calosa
f09e0db311 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-14 10:51:23 +08:00
zethfoxster
5dc72e88fe Merge pull request #19 from WagicProject/master
getting master
2016-07-13 20:08:23 -04:00
Anthony Calosa
169e2b8477 change path again 2016-07-14 01:13:43 +08:00
Anthony Calosa
9fe5ec6068 removed old path 2016-07-14 00:59:46 +08:00
Anthony Calosa
d4e0ca3f03 try to fix build 2016-07-14 00:57:50 +08:00
Anthony Calosa
7690a27e60 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-13 18:50:51 +08:00
Anthony Calosa
748d9ef65d Merge pull request #752 from kevlahnota/master
menubar
2016-07-13 15:25:18 +08:00
Anthony Calosa
d88db28da8 menubar graphic 2016-07-13 14:27:33 +08:00
Anthony Calosa
e95b9f57fa menubar 2016-07-13 14:25:57 +08:00
Anthony Calosa
6c14aa49ea Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-13 13:50:18 +08:00
Anthony Calosa
1859fc87ae Merge pull request #751 from kevlahnota/master
adjust simple menu & textscroller
2016-07-13 13:11:39 +08:00
Anthony Calosa
6c9d2e5db7 tooltip graphic 2016-07-13 13:09:34 +08:00
Anthony Calosa
d6d147187d add tooltip on textscroller 2016-07-13 13:07:29 +08:00
Anthony Calosa
ab75c1d5e2 adjust simple menu
adjust simple menu and fix some cards
2016-07-13 11:43:00 +08:00
Anthony Calosa
992178eb9a Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-12 21:40:16 +08:00
Anthony Calosa
f61ce2884a Merge pull request #9 from WagicProject/master
pull
2016-07-12 21:40:03 +08:00
Anthony Calosa
21db8852d6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-12 21:34:30 +08:00
zethfoxster
2900c1f914 Merge pull request #750 from zethfoxster/master
Pushing fixes
2016-07-12 09:01:04 -04:00
zethfoxster
8dd7bd8912 Merge pull request #18 from WagicProject/master
Getting master
2016-07-12 09:00:25 -04:00
Anthony Calosa
c6f1784d9d Merge pull request #749 from kevlahnota/master
small adjustment
2016-07-12 19:27:57 +08:00
Anthony Calosa
684cb086cc rounded 2016-07-12 17:51:48 +08:00
Anthony Calosa
d2d8b06d97 lowered value 2016-07-12 17:44:57 +08:00
Anthony Calosa
4d346e0ca7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-12 17:43:47 +08:00
Anthony Calosa
a6cbd10f3b Merge pull request #748 from kevlahnota/master
Update some items
2016-07-12 16:34:16 +08:00
Anthony Calosa
416a49d87f Update some items 2016-07-12 15:49:43 +08:00
zethfoxster
f438548e5c teaching ai to select X on the menu again. 2016-07-11 23:46:03 -04:00
zethfoxster
cc75fc42db fixed a memleak that triggered with cards like vise, we were leaving this funtion without deleting an event that was not being sent. 2016-07-11 19:32:57 -04:00
zethfoxster
66e01b12f8 Merge pull request #17 from WagicProject/master
getting master
2016-07-11 18:53:15 -04:00
Anthony Calosa
b3045726fb Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-12 06:22:49 +08:00
Anthony Calosa
9b2b541e4d Merge pull request #747 from kevlahnota/master
try to fix failed logic here
2016-07-12 05:30:58 +08:00
Anthony Calosa
2d763d106d try to fix failed logic here 2016-07-12 02:27:06 +08:00
Anthony Calosa
37d2feeaa5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-11 20:01:38 +08:00
Anthony Calosa
66a33cd56e Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-11 19:56:57 +08:00
Anthony Calosa
ae07844a71 a little bit smaller 2016-07-11 19:56:39 +08:00
Anthony Calosa
e00484775e Merge pull request #745 from kevlahnota/master
Add Missing Devoid Cards and change Simple Menu
2016-07-11 19:54:37 +08:00
Anthony Calosa
ed871db1f3 use regular images in grid deck view
i did search for psp-2000 and it has 64mb ram vs psp-1000 32mb ram. use
lowres images for psp to be safe.
2016-07-11 19:16:47 +08:00
Anthony Calosa
3c4f3146c4 fix cards that move on top of library
seems when you search your library, after you put it on top, it shuffles
also the chosen card.
2016-07-11 18:39:21 +08:00
Anthony Calosa
5cde230723 Fix Crash when importing deck
removed "sideboard"
2016-07-11 16:35:57 +08:00
Anthony Calosa
6d4a068453 SImple Menu 2016-07-11 13:54:08 +08:00
Anthony Calosa
248e8e6beb Added some missing Devoid cards 2016-07-11 10:49:43 +08:00
Anthony Calosa
4db11ba324 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-11 08:43:52 +08:00
Anthony Calosa
a97f862641 Merge pull request #744 from kevlahnota/master
Add support for reducing hybrid costs
2016-07-11 08:33:15 +08:00
Anthony Calosa
69db7f7384 Add support for reducing Hybrid cost
it doesn't remove the hybrid icons but it reduces the cost.
2016-07-11 07:55:12 +08:00
Anthony Calosa
a72fb6f01a Merge pull request #8 from WagicProject/master
pull from master
2016-07-11 07:47:58 +08:00
zethfoxster
53766b99c9 Merge pull request #743 from zethfoxster/master
pushing to master
2016-07-10 14:05:51 -04:00
zethfoxster
1b54cf56e0 auto close graveyard when delving and we have exiled enough to pay for the card. 2016-07-10 14:04:27 -04:00
zethfoxster
05a553ffdc Merge pull request #16 from WagicProject/master
getting master
2016-07-10 13:46:43 -04:00
Anthony Calosa
d6ea80843f Merge pull request #742 from kevlahnota/master
Updated Primitives, Corrected Names, Updated Unsupported
2016-07-10 18:08:00 +08:00
Anthony Calosa
8c2ce43053 Cleaned Unsupported 2016-07-10 17:04:04 +08:00
Anthony Calosa
34b33798a7 Corrected some card names 2016-07-10 16:44:39 +08:00
Anthony Calosa
adbef081d0 Update primitives
forcedalive now means forcedalive even when the cards is not in play.
Cloudshift ability is move to exile and move to your battlefield, blink
cannot be used since it moves to exile and then moves to owner
battlefield...
2016-07-10 15:42:36 +08:00
Anthony Calosa
5eb3a86467 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-10 08:59:10 +08:00
Anthony Calosa
bef2b34faa Merge pull request #7 from WagicProject/master
pull changes from master
2016-07-10 08:57:20 +08:00
zethfoxster
7516b44804 Merge pull request #741 from zethfoxster/master
pushing to master
2016-07-09 20:22:52 -04:00
zethfoxster
8b70f5a114 added isochron and spell binder 2016-07-09 20:21:40 -04:00
zethfoxster
c4581a8889 added imprintedcard as a usable name for castcard 2016-07-09 20:20:55 -04:00
zethfoxster
fdde5b7fe9 ok round 3 2016-07-09 18:57:01 -04:00
zethfoxster
d1bc246a35 Merge pull request #740 from zethfoxster/master
Master
2016-07-09 18:30:16 -04:00
zethfox
262779b515 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-09 18:28:08 -04:00
zethfox
78e4407c71 Revert "edge case fix, the issue arises from castcard but I'm fixing it at a higher level since init to zone should always have a valid "player 1" in its first constructor."
This reverts commit d247c53136.
2016-07-09 18:21:52 -04:00
zethfoxster
d247c53136 edge case fix, the issue arises from castcard but I'm fixing it at a higher level since init to zone should always have a valid "player 1" in its first constructor. 2016-07-09 17:55:08 -04:00
zethfoxster
bca9381903 Merge pull request #739 from zethfoxster/master
unused variables.
2016-07-09 13:13:36 -04:00
zethfoxster
a8cbdafe6e unused variables. 2016-07-09 13:12:58 -04:00
zethfoxster
e595f141c1 Merge pull request #738 from zethfoxster/master
pushing to master
2016-07-09 13:09:03 -04:00
zethfoxster
4aa43de54d Merge pull request #15 from WagicProject/master
getting master
2016-07-09 13:06:46 -04:00
zethfoxster
2e92838364 fixed an issue with dredge, where dredge is offered even though theres only one dredger on cards that draw multiple. 2016-07-09 11:38:25 -04:00
Anthony Calosa
283cb64a01 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-09 21:20:31 +08:00
zethfoxster
517fd2d4f4 Merge pull request #737 from zethfoxster/master
merging to master
2016-07-09 09:11:33 -04:00
zethfoxster
3467c976a9 Merge pull request #14 from WagicProject/master
getting master
2016-07-09 08:54:13 -04:00
Anthony Calosa
f3166406ec Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-09 19:56:14 +08:00
Anthony Calosa
b5b930dddb Merge pull request #736 from kevlahnota/master
Add moveto(previousbattlefield) test
2016-07-09 17:31:37 +08:00
Anthony Calosa
11c10f526a Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-09 16:51:11 +08:00
Anthony Calosa
cf362f1a6a Update _tests.txt 2016-07-09 16:50:45 +08:00
Anthony Calosa
3b2ea8ea98 Create previousbattlefield.txt 2016-07-09 16:50:07 +08:00
zethfoxster
f82bc39473 ok found the massive draw, it was trenisphere. the card lords every single card in the game a mana modifier. affinity normally didnt see these issues cause the cards effected are just either in your hand or the source themselves. but when trin was put in play it would cause 120 cards to have to update thier cost, which can not be done in acceptible cpu time. anyways, this should solve the issue.
that card is a desaster, please do not add any more code to support it, though with it in its current state im wondering why its not in supported and is placed in borderline.
2016-07-09 01:24:55 -04:00
zethfoxster
b5976035e3 actually i changed my mind, instead lets update affinity after events are processed, that should take into account cards untapping,moving, ect.... 2016-07-09 00:58:19 -04:00
zethfoxster
14f65c55b5 going to try only updating affinity() when cards move from anywhere to anywhere to help minimize the calls to this function. this atleast allows me to debug albeit slowly the follow issue ive been working to fix. not sure when this was introduced but it was not happening when i first coded this function. manacost->copy() did not slow the game to a crawl.
anyways, trinisphere and any card containing 
other={H(land[basic]|mybattlefield)}{1} name(Pay /1/ and Return a Basic Land to Hand)

cost such as this with a CD tc.
2016-07-09 00:48:08 -04:00
zethfoxster
ee91e0698d corrected some logic with computenewcost.
there is a bug im working on with newaffinity and cards that contain targetchoosers with CD tcs. 

experimental change also added with lords. im making the abilities grants by lord forcedalive until the lord is removed from game.
some instances of forcedalive in master primitives did not contain abilities which resolved, meaning they would contenue even though the source had left play.
2016-07-09 00:11:21 -04:00
Anthony Calosa
aa23537354 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-09 06:50:31 +08:00
zethfoxster
242c7b623f Merge pull request #13 from WagicProject/master
getting master
2016-07-08 17:54:14 -04:00
zethfoxster
c0c52e57df what a dumb typo. surprised it was in the engine that way for so long. 2016-07-08 17:48:27 -04:00
Anthony Calosa
dff938e802 Merge pull request #732 from kevlahnota/master
"previousbattlefield" for mover
2016-07-09 04:33:41 +08:00
Anthony Calosa
847e9dffc2 revised 2016-07-08 22:57:47 +08:00
Anthony Calosa
10d81bd47a try to fix segmentation fault 2016-07-08 18:46:07 +08:00
Anthony Calosa
3aa64697d2 "previousbattlefield" for mover 2016-07-08 17:39:47 +08:00
Anthony Calosa
fecaf64eec Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-08 17:30:51 +08:00
Anthony Calosa
20cb8e4ead Merge pull request #731 from kevlahnota/master
Softcoded some cards alias
2016-07-08 16:20:33 +08:00
Anthony Calosa
cb6e5a5e54 Update changes 2016-07-08 15:47:01 +08:00
Anthony Calosa
366de00950 Softcoded some card alias 2016-07-08 15:32:13 +08:00
Anthony Calosa
f80b7a32c1 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-08 12:48:55 +08:00
Anthony Calosa
67f3d956f4 Merge pull request #730 from kevlahnota/master
Updated Primitives
2016-07-08 11:47:37 +08:00
Anthony Calosa
607301b35d Update _tests.txt
added test for lifetap vs shocklands
2016-07-08 10:19:29 +08:00
Anthony Calosa
9f5c3e9942 Create lifetap2.txt 2016-07-08 10:18:00 +08:00
Anthony Calosa
d34ecff3aa Updated Primitives
for cards that use tap(noevent)
2016-07-08 10:02:54 +08:00
zethfoxster
0ff7e54ff4 this is a good enough fix as waste is colorless which is artifact, and all we do is barrow the kbitmask from land. 2016-07-07 20:47:25 -04:00
Anthony Calosa
c4e508a090 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-08 08:37:09 +08:00
zethfoxster
58f15184b8 Merge pull request #729 from zethfoxster/master
pushing to master
2016-07-07 20:17:16 -04:00
zethfoxster
61d22eb498 added a modifier for "tap" for cards that say "enters the battlefield tapped", they are supposed to be tapped when put in play, which mean they should not trigger @tapped(.
for cards with the line or options "do/pay MANA or this card enters the battlefield tapped"
simply change it to tap(noevent)
it will simulate the card being placed into play already tapped.
2016-07-07 19:02:41 -04:00
zethfoxster
34d10bba3c Merge pull request #12 from WagicProject/master
getting master
2016-07-07 18:14:06 -04:00
Anthony Calosa
5ba8cc3439 Merge pull request #727 from kevlahnota/master
Sorted Primitives and Cleanup Tabs
2016-07-07 14:02:33 +08:00
Anthony Calosa
4da7f77089 Cleanup tabs 2016-07-07 13:25:36 +08:00
Anthony Calosa
c544206437 Sorted Primitives 2016-07-07 13:10:30 +08:00
Anthony Calosa
7a65a7da1e Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-07 12:18:54 +08:00
zethfoxster
014a153e49 Merge pull request #726 from zethfoxster/master
push to master
2016-07-06 23:07:23 -04:00
zethfoxster
066c40d9c1 close library, exile, or graveyard after we "move" cards from it. 2016-07-06 22:04:59 -04:00
Anthony Calosa
5f7f4a23aa Merge pull request #6 from WagicProject/master
pull from master
2016-07-07 09:19:21 +08:00
Anthony Calosa
e39dee6e1d Revert "Zeth Fixes"
This reverts commit 78d3828f1e.
2016-07-07 09:16:03 +08:00
Anthony Calosa
cf71f84e49 Revert "Sorted Primitives"
This reverts commit 2f4c00c602.
2016-07-07 09:15:57 +08:00
zethfoxster
8265253388 fixed a issue with dredge where it was entering the stack even tho dredging itself is a replacement effect. 2016-07-06 20:26:18 -04:00
zethfoxster
b1293b70cf Merge pull request #725 from zethfoxster/master
push to wagicproject
2016-07-06 19:40:38 -04:00
zethfoxster
7b8b197a35 another fix 2016-07-06 19:08:41 -04:00
zethfoxster
867e1b8731 fixes 2016-07-06 18:24:45 -04:00
zethfoxster
5cdcf47994 merged my changes to the base 2016-07-06 18:08:33 -04:00
zethfoxster
a500920bb2 Merge pull request #11 from WagicProject/master
got it
2016-07-06 17:57:38 -04:00
zethfoxster
a748e0337d trying to get my commit in 2016-07-06 17:56:17 -04:00
Anthony Calosa
2f4c00c602 Sorted Primitives 2016-07-06 16:09:54 +08:00
Anthony Calosa
78d3828f1e Zeth Fixes
Memleaks and others
2016-07-06 16:05:29 +08:00
Anthony Calosa
4505f51fbd Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-06 13:13:40 +08:00
zethfoxster
2ca7b2310b trying to manuelly add changes 2016-07-06 00:43:11 -04:00
zethfoxster
861366dd71 Fixed the memleaks caused by computeNewCost, moved them to gameobserver where affinity takes place, removed repeative code that was in game observer, moved the game observer components into computenewcost, removed the calls for "new mana" in all alternative play type that were added with this function. 2016-07-06 00:02:15 -04:00
Anthony Calosa
4cada08cbe Merge pull request #723 from kevlahnota/master
Deckstats Mana Rendering and Others
2016-07-06 09:09:32 +08:00
Anthony Calosa
1d80d97d22 Shackled highlight border 2016-07-06 07:55:10 +08:00
Anthony Calosa
935849142c replaced alias with shackler 2016-07-06 06:37:27 +08:00
zethfoxster
4e048f775d Merge pull request #8 from WagicProject/master
getting master
2016-07-05 18:37:14 -04:00
Anthony Calosa
f45adb5b9e removed alias 1111 2016-07-06 06:28:42 +08:00
Anthony Calosa
d4cc7ca232 removed alias that display chosen color 2016-07-06 06:21:45 +08:00
Anthony Calosa
51d06d8234 removed alias for overload 2016-07-06 05:23:25 +08:00
Anthony Calosa
16f7ae54b8 Fix Deck Mana Symbol Rendering
deckmanaColors was increased to 7, made this >=6 so it's compatible with
old deck stats
2016-07-06 04:26:01 +08:00
Anthony Calosa
e15734d17e White border for Deckmaster Set 2016-07-06 04:24:07 +08:00
Anthony Calosa
2cb773dd48 Added Yisan and Zameck 2016-07-06 04:23:46 +08:00
Anthony Calosa
09672ce89b Added Delver of Secrets & Tasigur 2016-07-05 23:33:55 +08:00
Anthony Calosa
c476262288 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-05 17:21:59 +08:00
Anthony Calosa
84c73bb11f Merge pull request #722 from kevlahnota/master
Added some missing reveal cards
2016-07-05 17:09:50 +08:00
Anthony Calosa
f8b5519ced Added some reveal cards 2016-07-05 15:13:19 +08:00
Anthony Calosa
01b7f36750 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-05 11:50:50 +08:00
Anthony Calosa
759c5222ac Merge pull request #721 from kevlahnota/master
Added C15 and MMA
2016-07-05 10:55:05 +08:00
Anthony Calosa
9847edbce1 Added MMA 2016-07-05 10:07:07 +08:00
Anthony Calosa
19789b6d90 Added Commander 2015 set 2016-07-05 08:22:43 +08:00
Anthony Calosa
7b2ba7f3b1 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-05 08:20:13 +08:00
Anthony Calosa
9a5ed11c83 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-05 06:34:36 +08:00
Anthony Calosa
3fc8b6fc5c Merge pull request #720 from kevlahnota/master
Add missing cards that uses producecolor
2016-07-05 06:27:19 +08:00
zethfoxster
c018e3dcc2 fixed a ton of memleaks, narrowed down the memleaks to just the computeNewCost function.
still working on a fix for this.
2016-07-04 15:13:35 -04:00
zethfoxster
2b8f1b350c added bonus events for eldrazi and werewolves 2016-07-04 11:18:07 -04:00
zethfoxster
806c82c30c Merge pull request #7 from WagicProject/master
getting master
2016-07-04 10:46:36 -04:00
zethfoxster
76f1591b58 removed WParsedInt "morethanfour", "plusone","plustwo","plusthree"
added 2 things
first plus/plusend, minus/minusend
written many ways damage:type:*:myhandminus2minusend
would deal damage equal to the cards in my hand -2
damage:type:creature:mybattlefieldplustype:creature:opponentbattlefieldplusend
damage equal to the number of creatures in my battlefield plus the number of creatures in opponents battlefield.

now there are special cases where we need to know the value BEFORE applying multipliers. life: is one of them. I added "math/mathend"

auto=@each opponent upkeep:target(opponent) life:-mathtype:*:myhandminustype:*:opponenthandminusendmathend opponent
in the example above, without "math" the "-" would be used for the first section of the minus parsed int, instead of being applied as a multiplier for the total of the number.

this is extremely flexible, and can contain any Wparsed int in both parts, you can add or subtract and use the differences between to values as the value of the parsedInt.
2016-07-04 10:43:07 -04:00
Xawotihs
2a5fc931b6 Should fix pull request Travis error 2016-07-04 16:09:46 +02:00
Anthony Calosa
a392e631d0 Update cards that has both tap and sacrifice 2016-07-04 21:30:42 +08:00
Anthony Calosa
f3da8f7353 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-04 21:07:58 +08:00
Anthony Calosa
fda4d43678 added missing cards Mirari's Wake and the likes 2016-07-04 19:55:19 +08:00
Anthony Calosa
a09868c397 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-04 19:54:32 +08:00
zethfoxster
fdddee415f Merge pull request #6 from WagicProject/master
getting master
2016-07-04 07:04:41 -04:00
Anthony Calosa
d239048817 Added V15 2016-07-04 18:58:41 +08:00
Anthony Calosa
88e146f4ba Added CMA 2016-07-04 18:56:07 +08:00
Anthony Calosa
a709a7fec0 Merge pull request #719 from kevlahnota/master
Fixed Madness, Removed Duplicates, Updated Unsupported, Sorted Primitives & Updated Premium Deck Series
2016-07-04 14:32:18 +08:00
Anthony Calosa
8d5d7bdf8d Update changelog 2016-07-04 14:30:10 +08:00
Anthony Calosa
ffe3317228 Updated and Cleaned Unsupported 2016-07-04 13:28:14 +08:00
Anthony Calosa
71adcb338d Fixed Madness moveto(ownergraveyard) and Remove Duplicates 2016-07-04 12:06:29 +08:00
Anthony Calosa
62b46f6ef5 remove Duplicate 2016-07-04 11:16:12 +08:00
Anthony Calosa
65149ece6c Sorted Primitivs
7-14-2016
2016-07-04 10:34:33 +08:00
Anthony Calosa
b0318f6939 Updated Premium Series 2016-07-04 10:27:08 +08:00
Anthony Calosa
b98fe6bda5 Merge pull request #5 from WagicProject/master
pull new changes from zeth
2016-07-04 10:12:16 +08:00
Anthony Calosa
6e6274a2dd Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-04 09:52:48 +08:00
zethfoxster
52988f154b Merge pull request #717 from zethfoxster/master
Fails but I have no idea why
2016-07-03 21:49:40 -04:00
zethfoxster
b590ea8caa Merge pull request #5 from WagicProject/master
getting master
2016-07-03 21:38:54 -04:00
Anthony Calosa
3c7570aab9 Merge pull request #715 from kevlahnota/master
Updated Sets
2016-07-04 06:18:59 +08:00
Anthony Calosa
3b8c92f5c2 Updated Planechase, Archenemy, Chronicles, Commander 2016-07-04 06:16:57 +08:00
Anthony Calosa
164cf79613 added MM2 2016-07-04 05:37:11 +08:00
zethfoxster
a216a6989b more fixes 2016-07-03 17:07:22 -04:00
zethfoxster
050bf5f73c updated test for new X rules. 2016-07-03 15:24:05 -04:00
Anthony Calosa
8ff94669f2 added C14 2016-07-03 19:39:18 +08:00
zethfoxster
775f9eb6b3 unused variable 2016-07-02 23:44:14 -04:00
zethfoxster
aeff6b60e9 forgot to remove this. 2016-07-02 23:20:51 -04:00
zethfoxster
94989a1109 Merge pull request #4 from WagicProject/master
get master
2016-07-02 23:07:40 -04:00
Anthony Calosa
e1c6c4e6b6 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-03 10:46:11 +08:00
Anthony Calosa
48bd49cf2f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-03 10:45:26 +08:00
zethfoxster
385a48bb43 fixed a bug where {t}{s(creature|mybattlefield)} or similar cost were not allowed to select the source to pay for the cost.
as long as the cost are not similar, the source is a valid target.
{s}{s(creature|mybattlefield)}
or
{t}{t(creature)}
or when the card states specifically that the source is not valid such as 
"{t},sacrifice another creature you control:draw a card"
2016-07-02 22:39:45 -04:00
Anthony Calosa
ad2b9a3640 Added Zendikar vs Eldrazi 2016-07-03 09:22:41 +08:00
Anthony Calosa
df249895e6 Added C13 2016-07-03 09:19:43 +08:00
zethfoxster
c7005ef933 cards for commit 2016-07-02 21:08:24 -04:00
zethfoxster
2489be93a3 added setting the value of X as you cast a spell with X.
this does not cover abilities yet.
2016-07-02 13:38:07 -04:00
zethfoxster
fa916c4fab Merge pull request #3 from WagicProject/master
updating from master
2016-07-02 09:08:13 -04:00
Anthony Calosa
a8fcb909fe Added Deckmasters 2016-07-02 20:41:59 +08:00
Anthony Calosa
1262c5e8ff Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-02 20:20:18 +08:00
Anthony Calosa
6edc3bcd02 Merge pull request #714 from kevlahnota/master
Updated Masters, Beginners, Duels and Vault Sets
2016-07-02 19:52:24 +08:00
Anthony Calosa
4e9e709816 Updated Vaults Block 2016-07-02 18:57:52 +08:00
Anthony Calosa
d24bc0cf94 Added V14 2016-07-02 18:57:24 +08:00
Anthony Calosa
a4bb0f40cc Added From the Vault Legends 2016-07-02 18:42:32 +08:00
Anthony Calosa
37d7693e3c Added Elspeth vs Kiora 2016-07-02 18:28:56 +08:00
Anthony Calosa
9fd1c4bb0a Added Speed vs Cunning 2016-07-02 18:21:28 +08:00
Anthony Calosa
9561cea8f9 Added Jace vs Vraska 2016-07-02 18:17:51 +08:00
Anthony Calosa
cfdfe6e567 Updated Duel Decks 2016-07-02 18:06:53 +08:00
Anthony Calosa
c3736f8dd8 Added Heroes vs Monsters 2016-07-02 18:03:40 +08:00
Anthony Calosa
6232c2e894 Added Sorin vs Tibalt 2016-07-02 17:54:54 +08:00
Anthony Calosa
a2cce876db Updated Beatdown and Battle Royale 2016-07-02 16:46:09 +08:00
Anthony Calosa
d3791e1316 Updated Un-Serious Sets 2016-07-02 09:49:34 +08:00
Anthony Calosa
9cbbdc422f Updated Beginner Sets 2016-07-02 09:40:04 +08:00
zethfoxster
f76c28fa64 convoke
other={convoke} name(Convoke)
delve
other={delve}
they might be able to be added directly to the real manacost.

added an ability that grants an ability while the source remains tapped
grant ability grantend...

added dethrone
abilities=dethrone

added support of multitargeting to extra cost, it acts the same as normal multitargeting, repeats dopay() the effects for each.
2016-07-01 21:29:51 -04:00
Anthony Calosa
cabc3e2441 Updated Masters Block 2016-07-02 09:12:43 +08:00
Anthony Calosa
f208e755c2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-02 07:32:27 +08:00
zethfoxster
9841ce32ae Merge pull request #2 from WagicProject/master
get master
2016-07-01 17:01:15 -04:00
Anthony Calosa
4f6456635e Merge pull request #713 from kevlahnota/master
Cleaned and Sorted all Core and Expansion Sets
2016-07-01 22:44:52 +08:00
Anthony Calosa
6dc69ded22 parse "total" cards in set infor 2016-07-01 22:09:08 +08:00
Anthony Calosa
6ce67a95a2 transformed cards as tokens
so they cannot be bought in the deck editor
2016-07-01 22:03:01 +08:00
Anthony Calosa
6cc943d15d Update Shadows over Innistrad Meta 2016-07-01 21:25:42 +08:00
Anthony Calosa
b23314b408 Updated Battle for Zendikar Block 2016-07-01 21:21:48 +08:00
Anthony Calosa
9c32e4d66a Updated Khans of Tarkir Block 2016-07-01 21:16:09 +08:00
Anthony Calosa
1b9ddabcab Updated Theros Block 2016-07-01 20:59:04 +08:00
Anthony Calosa
6259333a70 Updated Return to Ravnica Block 2016-07-01 20:46:18 +08:00
Anthony Calosa
bedb28c073 Update Innistrad Block 2016-07-01 20:29:32 +08:00
Anthony Calosa
65d93267a9 Updated Scars of Mirrodin Block 2016-07-01 19:37:16 +08:00
Anthony Calosa
6ee041b374 Updated Zendikar Block 2016-07-01 19:29:08 +08:00
Anthony Calosa
c46a6d3440 Updated Shards of Alara Block 2016-07-01 19:16:59 +08:00
Anthony Calosa
92fc016f20 Updated Shadowmoor Block 2016-07-01 19:05:39 +08:00
Anthony Calosa
8983ee5239 Updated Lorwyn Block 2016-07-01 19:00:16 +08:00
Anthony Calosa
45291b4f05 Updated Time Spiral Block 2016-07-01 18:52:35 +08:00
Anthony Calosa
6cfbdf2f30 Updated Ice Age Block 2016-07-01 18:12:21 +08:00
Anthony Calosa
44613dc416 token 2016-07-01 17:46:46 +08:00
Anthony Calosa
1f95ff0fe7 Updated Ravnica Block 2016-07-01 17:45:02 +08:00
Anthony Calosa
a939021304 Updated Kamigawa Block 2016-07-01 17:24:32 +08:00
Anthony Calosa
fc88d9b248 Updated Mirrodin Block 2016-07-01 15:45:26 +08:00
Anthony Calosa
46e268e4e3 Updated Onslaught Block 2016-07-01 15:33:09 +08:00
Anthony Calosa
f9f8ccc088 Updated Odyssey Block 2016-07-01 15:16:28 +08:00
Anthony Calosa
78c8e64e81 Updated Invasion Block 2016-07-01 10:14:57 +08:00
Anthony Calosa
ba54bd43aa Update Masque Block 2016-07-01 10:03:57 +08:00
Anthony Calosa
f61542ea6b Updated Urza's Block 2016-07-01 09:54:24 +08:00
Anthony Calosa
21b162b192 Updated Rath Cycle 2016-07-01 09:41:27 +08:00
Anthony Calosa
91e7af4867 Updated Mirage Block 2016-07-01 07:40:58 +08:00
Anthony Calosa
89968bf449 Updated Early Sets 2016-07-01 07:29:36 +08:00
Anthony Calosa
7f2f68ec58 Update all Core Sets 2016-07-01 07:05:47 +08:00
zethfoxster
a5ebfd56e1 Merge pull request #1 from WagicProject/master
trying to update fork to have changes from master
2016-06-30 19:03:06 -04:00
Anthony Calosa
19cb8e3301 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-01 04:53:05 +08:00
Anthony Calosa
a2014be118 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-01 03:40:53 +08:00
Anthony Calosa
3cde9a654b Merge pull request #712 from kevlahnota/master
Soulbond Pair Indicator
2016-07-01 03:40:06 +08:00
Anthony Calosa
2f277171d1 Soulbond Pair Indicator
Border Indicator for Paired Cards
2016-07-01 03:05:27 +08:00
Anthony Calosa
43dba06074 Merge pull request #711 from kevlahnota/master
Sorted Primitives
2016-07-01 03:04:27 +08:00
Anthony Calosa
c0737c40a7 Update Changes 2016-07-01 01:01:45 +08:00
Anthony Calosa
beb2eb99fb Sorted Primitives
I sorted this programmatically so the other comments are removed except
for AUTO_DEFINE
2016-06-30 23:04:35 +08:00
Anthony Calosa
62a52745df Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-30 21:36:53 +08:00
Anthony Calosa
25e156297b Merge pull request #710 from kevlahnota/master
Add Vedalken Shackles Ability
2016-06-30 16:59:25 +08:00
Anthony Calosa
fd2aa5d046 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-30 16:21:30 +08:00
Anthony Calosa
547a9fcc17 Add Support for Vedlaken Shackles and the likes
the alias 50120 is there to prevent untap  during untap phase and the
canuntap restriction will trigger if it's possible to untap ie tha card
doesn't have doesnotuntap,, or frozen or is tapped.
2016-06-30 16:18:39 +08:00
Anthony Calosa
90ea36d0fe Update CHANGELOG.md 2016-06-30 15:15:50 +08:00
Anthony Calosa
c3467f7204 Merge pull request #709 from kevlahnota/master
Fix Cascade, Crash fix on lastController and some corrections
2016-06-30 15:10:06 +08:00
Anthony Calosa
e6aafbc8a6 lastController defined when creating copies of itself 2016-06-30 14:06:21 +08:00
Anthony Calosa
76bb777f4d Fix crash when lastController is null 2016-06-30 12:19:58 +08:00
Anthony Calosa
39f6867ab0 Fix Cascade 2016-06-30 09:26:00 +08:00
Anthony Calosa
fbaef2f103 some corrections 2016-06-30 09:21:13 +08:00
Anthony Calosa
db19fa507e Merge pull request #708 from kevlahnota/master
Try to fix IOS Builds
2016-06-29 15:11:14 +08:00
Anthony Calosa
27fd1942d0 Try to Fix IOS Build 2016-06-29 15:03:36 +08:00
Anthony Calosa
975df3625d Corrections 2016-06-29 15:03:24 +08:00
Anthony Calosa
92a37e1e44 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-29 13:09:46 +08:00
Anthony Calosa
cd33754a3c Merge pull request #707 from kevlahnota/master
Updated Primitives and Hide Highlight Border
2016-06-29 12:17:43 +08:00
Anthony Calosa
69d92bc0ea Unused Variable
MTGRules.cpp:1361:11: error: unused variable ‘player’
[-Werror=unused-variable]
2016-06-29 11:38:51 +08:00
Anthony Calosa
6d09c12f93 Try to fix compilation 2016-06-29 11:08:55 +08:00
Anthony Calosa
ba0f4dbcf5 Update changes 2016-06-29 10:54:44 +08:00
Anthony Calosa
e1bf3b4b82 Updated Primitives
Updated cards that use reveal keywords, Updated Borderline and
Unsupported
2016-06-29 10:45:35 +08:00
Anthony Calosa
d647309587 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-29 09:57:00 +08:00
Anthony Calosa
140ee7b183 Hide Highlight Border
When revealing cards, Hide Highlight Border
2016-06-29 08:59:58 +08:00
zethfoxster
745eaf8a17 the following adds 965 cards primitives, I did not alphabetically sort these and can not justify alphabetical sorting as it has no effect on the game engine. 2016-06-28 20:58:52 -04:00
Anthony Calosa
b16e70c363 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-29 08:26:31 +08:00
zethfoxster
6ee00c138c Pretty huge patch here(sorry old habits never die :( )
lots of changes, many bug fixes,
first
added auto=count(targetchooser)
and countedamount wparsed int
they work together for cards where it is difficult to get working without knowing in advance how many we had ie: exile blah creatures, for each creature you exiled do effect.
auto=count(creature|mybattlefield)
auto=moveto(exile)
auto=draw:countedamount
it takes into account token creatures, which our old methods did not.

second, added "freeze" which is a "frozen" that automatically taps your target for you, for use when nesting or whenever needed where it was difficult to nest the ability with tap included.

added devotion for "iroas"

added reveal:x and scry x
reveal contains optionone/optiononeend ; optiontwo/optiontwoend ; repeat; afterrevealed/afterrevealed end.

this ability has heavy use of targetListIsSet(<amount>) and upto:amount, you MUST be certain that all cards being revealed have an action that removes them from reveal either in the first, second, or 3rd ability.
there are over 300 examples in the new card code, the ability is VERY easy to understand.

scry contains automatic put on top, put on bottom, then scrycore/scrycoreend which is an ability to fire.
it also contains keywords, dontshow which is nested in scrycore, scry reveals, puts on top or bottom, then reveal AGAIN, and does an effect, dontshow eliminates the 2nd revealing.
is also contains "delayed" keyword, which delays the ability until AFTER the core fires.

added bestow. update rules mtg.txt!!!!
examples are in primitives, every bestow card was supported.

added a new lord based on varibles and restrictions
while(restriction{morbid})
while(varible:blah)
this simplifies and expands on this(, allowing you to even use while(cantarget together and check if a card is targetable by the variable. examples are in primitives

added token(by card name)
auto=token(Eldrazi Scion) 
will search primitives and card dats for this card and give it to you as a token.
valid card dat info is still required.

added variable delirium
added restriction madnessplayed to allow checking if the card was played with madness.

added restriction "geared" for checking if a card has equipment on it.

added abilities words
skulk

menace <--cant be blocked except by 2 or more, if you dont block it with 2 or more we automatically unassign the single blocker and the creature is considered not blocked.

nosolo <--cant attack alone

mustblock <---if you dont assign as a blocker, we assign automatically the first thing it can block legally.

changed iscolorless back to "colorless"

enjoy, cards coming soon, theyre coded but im debating on not alpha sorting, cards being added this patch 965 uniques.

there is a section of the commit which was just VS2016 normalizing line ends, sorry if it makes it a cluster mess.
2016-06-28 18:40:55 -04:00
Anthony Calosa
0a4da47492 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-27 15:34:49 +08:00
Anthony Calosa
9439b347c9 Merge pull request #705 from kevlahnota/master
CardID Indicator, Add Missing Tokens, Support Importing dck for Android
2016-06-27 09:04:16 +08:00
Anthony Calosa
e24eb30c98 Update Changelog 2016-06-27 09:02:43 +08:00
Anthony Calosa
f53573261e missing tokens 2016-06-27 08:44:13 +08:00
Anthony Calosa
d5b8337121 support importing forge decks 2016-06-26 19:26:52 +08:00
Anthony Calosa
b816facf44 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-26 07:57:52 +08:00
Anthony Calosa
a6a5cf8755 Card Id Indicator
Indicates Card Id, Useful for cards/tokens to determine their correct Id
in the primitives. Its much easier to fix missing images. Update your
modrules.xml
2016-06-26 07:56:07 +08:00
Anthony Calosa
83f7ed56fa Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-26 06:00:07 +08:00
Anthony Calosa
e88edd11af Merge pull request #4 from WagicProject/master
pull 4
2016-06-25 21:20:24 +08:00
Anthony Calosa
0b1be02c38 Update CHANGELOG.md
up to latest commit 6/23/16
2016-06-25 20:52:17 +08:00
Anthony Calosa
b98b8b6f2e Update CHANGELOG.md 2016-06-25 20:32:42 +08:00
Anthony Calosa
154358efd4 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-23 21:14:09 +08:00
Anthony Calosa
63c710047b Merge pull request #704 from kevlahnota/master
Fix  producecolor:color
2016-06-23 18:22:57 +08:00
Anthony Calosa
d0f4eeff1f Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-23 17:44:58 +08:00
Anthony Calosa
4d3277f41b fix produce color
when you produce the chosen color, add mana of that color.
2016-06-23 17:44:50 +08:00
Anthony Calosa
7c9d52abbf Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-23 15:50:58 +08:00
Anthony Calosa
cf6eccf565 Update _cards.dat 2016-06-23 05:30:40 +08:00
Anthony Calosa
1499baf8d9 Merge pull request #703 from kevlahnota/master
Change Basic Land Rarity for Modern sets
2016-06-22 20:56:46 +08:00
Anthony Calosa
37a0e95675 Rarity for Basic Lands
Changed to L rarity
2016-06-22 20:39:00 +08:00
Anthony Calosa
fd62705fd7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-22 17:36:39 +08:00
Anthony Calosa
dc5fc2b544 add "files" path
try to fix saving profiles on forcemounted path. Transfer your wagic/res to /Android/data/net.wagic.app/files
2016-06-22 17:00:30 +08:00
Anthony Calosa
70165a8c62 Merge pull request #702 from kevlahnota/master
BFZ, OGW, SOI _cards.dat
2016-06-22 09:14:32 +08:00
Anthony Calosa
68f888baf0 Update _cards.dat 2016-06-22 08:52:12 +08:00
Anthony Calosa
3a8bc599ee Update _cards.dat 2016-06-22 08:51:26 +08:00
Anthony Calosa
9d79021678 Update _cards.dat 2016-06-22 08:28:42 +08:00
Anthony Calosa
7d339ccc23 add soi tokens 2016-06-22 07:04:06 +08:00
Anthony Calosa
3dd839c8bf add plant token 2016-06-21 21:31:51 +08:00
Anthony Calosa
7db5b6fbda added bfz tokens 2016-06-21 21:27:22 +08:00
Anthony Calosa
1b7d199744 Create _cards.dat 2016-06-21 18:37:29 +08:00
Anthony Calosa
6bac099369 Create _cards.dat 2016-06-21 18:34:54 +08:00
Anthony Calosa
d5cc1b970f Create _cards.dat 2016-06-21 18:29:02 +08:00
Anthony Calosa
06f8fb0406 Merge pull request #3 from WagicProject/master
Pull
2016-06-21 18:25:02 +08:00
Anthony Calosa
7b6de7bbd8 Update StorageOptions.java
forcemount if you have forcemount file
2016-06-20 03:03:35 +08:00
zethfoxster
503159ff6f adding hints that seemed to have disappeared 2016-06-19 09:25:41 -04:00
Anthony Calosa
c22c674de1 Merge pull request #701 from kevlahnota/master
Some Fix
2016-06-18 22:36:52 +08:00
Anthony Calosa
de3ce6f676 add description 2016-06-18 21:58:24 +08:00
Anthony Calosa
cd34c4ebdf Modified test
Replenish + other enchantments
2016-06-18 21:55:14 +08:00
Anthony Calosa
ba0cab3743 Revert test 2016-06-18 21:21:08 +08:00
Anthony Calosa
a73030ac9b Overlooked this
Should be fine now, reverted the test
2016-06-18 21:20:30 +08:00
Anthony Calosa
f57bba22cc Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-18 20:22:55 +08:00
Anthony Calosa
e315cad0f5 Revert to previous 2016-06-18 20:22:50 +08:00
Anthony Calosa
3f40a6db4b Update Replenish.txt 2016-06-18 20:06:36 +08:00
Anthony Calosa
eb99680986 Modified 2016-06-18 19:55:58 +08:00
Anthony Calosa
2aa4f2da2d Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-18 12:41:29 +08:00
Anthony Calosa
a48568526b Update _tests.txt 2016-06-18 12:39:20 +08:00
Anthony Calosa
7247abd5f1 Create Show_and_Tell.txt 2016-06-18 12:38:30 +08:00
Anthony Calosa
bae2502d8f Create Replenish.txt 2016-06-18 12:37:52 +08:00
Anthony Calosa
cd645b33b2 Fix for Aura's that are put into play 2016-06-18 12:31:23 +08:00
Anthony Calosa
07ad69c08f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-18 09:12:02 +08:00
Anthony Calosa
6bc7de3370 Minor Fix 2016-06-18 09:11:57 +08:00
Anthony Calosa
f3ca247865 Merge pull request #699 from kevlahnota/master
Force Mounting 2
2016-06-17 17:47:43 +08:00
Anthony Calosa
0167cf052d Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-17 17:03:52 +08:00
Anthony Calosa
9a3b3013a3 Update SDLActivity.java 2016-06-17 17:03:37 +08:00
Anthony Calosa
0f9bbc1561 Update DeckImporter.java 2016-06-17 17:00:44 +08:00
Anthony Calosa
3ef6b3a76a Force Mounting 2
If you have root then most likely you have write access to secondary storage. If not then use the app-specific folder. You may create the folder via built-in file manager > Android/data/net.wagic.app/files/Wagic/Res
2016-06-17 16:58:15 +08:00
Anthony Calosa
3c7ccddfcc Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-17 07:48:15 +08:00
Anthony Calosa
42019917ce Merge pull request #698 from kevlahnota/master
Common color
2016-06-16 19:17:29 +08:00
Anthony Calosa
68b632857d Most Common Color 2016-06-16 18:14:48 +08:00
Anthony Calosa
eaf7b72dc7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-16 17:30:07 +08:00
Anthony Calosa
ff9cc83ef0 Merge pull request #697 from kevlahnota/master
Import Deck Options
2016-06-16 12:14:09 +08:00
Anthony Calosa
4e3dffad98 Import deck options 2016-06-16 11:37:25 +08:00
Anthony Calosa
7662d974b9 Deck Importer 2016-06-16 11:36:23 +08:00
Anthony Calosa
a78bdc4912 Force Mounting
Force mounting sdcard0 and sdcard1 if possible for kitkat and above
2016-06-16 11:31:20 +08:00
Anthony Calosa
6b84de3ccd Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-16 11:29:28 +08:00
Anthony Calosa
fda537635e Merge pull request #696 from kevlahnota/master
Imprint Class
2016-06-16 10:18:01 +08:00
Anthony Calosa
c633ceb695 Current Imprinted card only 2016-06-16 09:48:20 +08:00
Anthony Calosa
a4c536740e Revised Imprint 2016-06-16 09:14:37 +08:00
Anthony Calosa
923ebbc3c8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-16 07:15:35 +08:00
Anthony Calosa
9d79a85b96 Imprint Class 2016-06-16 07:15:24 +08:00
Anthony Calosa
7b972142ba Merge pull request #695 from kevlahnota/master
Block Cost Rule
2016-06-15 23:09:56 +08:00
Anthony Calosa
b38275123a Block Cost Rule
Update rules folder
2016-06-15 22:26:55 +08:00
Anthony Calosa
a2249a7392 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-15 19:08:51 +08:00
Anthony Calosa
c0a6fd2288 Merge pull request #694 from kevlahnota/master
Some changes
2016-06-14 21:31:28 +08:00
Anthony Calosa
149af25d22 fix unused variable error 2016-06-14 20:50:31 +08:00
Anthony Calosa
b33ae0c92f Revised 2016-06-14 19:40:28 +08:00
Anthony Calosa
1f54c7933b Attack Cost Rule
Update your rules folder
2016-06-14 19:40:02 +08:00
Anthony Calosa
26346f5a42 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-14 19:18:33 +08:00
Anthony Calosa
dbf78e2bae Split Cant pay life and Cant sacrifice 2016-06-14 10:06:37 +08:00
Anthony Calosa
9c9da27938 Merge pull request #693 from kevlahnota/master
Fix possible attacker
2016-06-13 20:52:22 +08:00
Anthony Calosa
41e97134ef Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-13 19:40:02 +08:00
Anthony Calosa
97186361a1 Corrections
Fix if you have a defender that can attack, it ,must be a possible
attacker.
2016-06-13 19:39:26 +08:00
Anthony Calosa
2db6635d73 Merge pull request #692 from kevlahnota/master
Some Corrections
2016-06-13 15:57:44 +08:00
Anthony Calosa
9ac1540cdc Corrections 2016-06-13 15:27:33 +08:00
Anthony Calosa
70c0957248 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-12 10:38:55 +08:00
Anthony Calosa
c045811350 Merge pull request #690 from kevlahnota/master
Refactor & Devotion
2016-06-11 22:15:45 +08:00
Anthony Calosa
70bc60104f try to fix compilation
../projects/mtg/include/AllAbilities.h:706: error: suggest explicit
braces to avoid ambiguous 'else'
2016-06-11 21:44:33 +08:00
Anthony Calosa
0f74558892 Refactor & Fix Devotion
Fix Devotion Count example you have Mogis, God of Slaughter(2 B R),
Ashenmoor  Liege(1 B/R B/R B/R), and Rakdos Cackler (B/R) - will be 6
Devotion to Red and Black, since you count the symbol, B/R (hybrid mana)
should return as 1.
2016-06-11 20:39:56 +08:00
Anthony Calosa
4e3543ace7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-11 20:32:24 +08:00
Anthony Calosa
1924ab09da Merge pull request #688 from kevlahnota/master
Fix leak
2016-06-10 14:03:30 +08:00
Anthony Calosa
a74e543429 Fix leak 2016-06-10 13:25:24 +08:00
Anthony Calosa
00f67a57cf Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-10 11:43:52 +08:00
Anthony Calosa
2244e62897 Merge pull request #687 from kevlahnota/master
Combat Toughness
2016-06-10 07:45:17 +08:00
Anthony Calosa
1569353779 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-10 07:05:42 +08:00
Anthony Calosa
40bb9e2c37 Combat Toughness
Assign combat damage equal to its tougness...
Doran, the Siege Tower
2016-06-10 07:05:29 +08:00
Anthony Calosa
c87e2b99d7 Update _tests.txt 2016-06-10 07:04:26 +08:00
Anthony Calosa
4934699ecd Create Doran.txt 2016-06-10 07:03:47 +08:00
Anthony Calosa
c85f3aa7f7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-10 07:02:30 +08:00
Anthony Calosa
7ea2086ec9 Merge pull request #686 from kevlahnota/master
Removed Unhinged & Unglued from Unsupported
2016-06-10 01:33:14 +08:00
Anthony Calosa
480e0ce9fa removed unhinged, unglued cards 2016-06-10 01:22:53 +08:00
Anthony Calosa
fe14fd0a58 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-09 21:58:48 +08:00
Anthony Calosa
e02e835053 copied abilities 2016-06-09 21:58:22 +08:00
Anthony Calosa
26d88e15c6 Merge pull request #685 from kevlahnota/master
Imprint
2016-06-09 21:05:47 +08:00
Anthony Calosa
5a9c13da86 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-09 20:06:50 +08:00
Anthony Calosa
3ee341cc4e Clone
Fix for issue #448
2016-06-09 20:06:39 +08:00
Anthony Calosa
b9f6a5ab0e Update _tests.txt
test for Clone vs Thistledown Liege
2016-06-09 20:06:09 +08:00
Anthony Calosa
ea03350ab9 Create clone4.txt
Test for issue #448
2016-06-09 20:05:04 +08:00
Anthony Calosa
06fdf3f0a5 Imprint
todo others...
2016-06-09 15:35:59 +08:00
Anthony Calosa
76e7827ebf Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-08 21:57:30 +08:00
Anthony Calosa
6c6f1f23ee Merge pull request #684 from kevlahnota/master
Madness
2016-06-08 11:06:20 +08:00
Anthony Calosa
8c47b666c5 Madness
Added Madness
2016-06-08 10:45:19 +08:00
Anthony Calosa
bad1fc9e09 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-08 08:36:54 +08:00
Anthony Calosa
e4817038c3 Merge pull request #683 from kevlahnota/master
Fix Damage Render
2016-06-07 19:02:03 +08:00
Anthony Calosa
d8e28dad7f Fix damage render 2016-06-07 18:20:30 +08:00
Anthony Calosa
2c7921479a Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-07 17:22:15 +08:00
Anthony Calosa
22a0f945b6 Merge pull request #681 from kevlahnota/master
Couldn't find a way to reduce kicker & multikicker without crashing. Returning to previous will get the bug that you can't activate any ability if you paid a kicker with the options "Choice Offer" or manually. Copying the kicker from put into play fixes it.
2016-06-06 18:16:28 +08:00
Anthony Calosa
1faf2e0694 Cleanup 2016-06-06 17:01:21 +08:00
Anthony Calosa
0376d094cc Apex Hawks is 2/2 Flyer
So it enters with two +1/+1 making it a 4/4 Flyer...
2016-06-06 11:19:30 +08:00
Anthony Calosa
873db7ef27 Revised Kicker 2016-06-06 11:16:32 +08:00
Anthony Calosa
ecd4de48eb Apex Hawks is a 2/2 Flyer
![Apex
Hawks](http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=382214&type=card)
2016-06-06 11:11:45 +08:00
Anthony Calosa
fb132173bd Kicker
TODO: Auto kicker and Affinity in Kicker....
2016-06-05 20:34:39 +08:00
Anthony Calosa
7ae8434ba3 Correction 2016-06-05 20:32:33 +08:00
Anthony Calosa
edf33d85b0 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-05 19:29:39 +08:00
Anthony Calosa
2ae0a651b8 Cloner/Copier produces same tokens as the copied cards 2016-06-05 17:58:49 +08:00
Anthony Calosa
a4c7da6e20 Merge pull request #680 from kevlahnota/master
Morph, Overload and PayZero costs changes
2016-06-05 14:34:04 +08:00
Anthony Calosa
fbfc712d4c Morph 2016-06-05 13:57:57 +08:00
Anthony Calosa
5196424fbe Overload and PayZero are affected by cost increaser 2016-06-05 13:15:30 +08:00
Anthony Calosa
cd83cfdc87 Removed
Forced Castcard, Suspend and other without paying manacost using these
must be recomputed for costs...
2016-06-05 13:01:55 +08:00
Anthony Calosa
52de1e7b02 Trinisphere
TODO: Morph and Kicker... Morph can be done but how to implement the
increased total cost with kicker? multi kicker? manual kicker??? Count
the mana pool if you can pay the cost+kicker if less than 3 increase
it???
2016-06-05 12:39:11 +08:00
Anthony Calosa
acfdab7dbb Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-05 11:07:15 +08:00
Anthony Calosa
c7731a1bb2 Merge pull request #679 from kevlahnota/master
Updated Missing/Unsupported Cards
2016-06-05 10:54:36 +08:00
Anthony Calosa
f3c31697c8 Updated unsupported , missing
includes missing cards from primitives (borderline, crappy, other cards)
2016-06-05 10:46:54 +08:00
Anthony Calosa
7b6d14779f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-05 05:49:14 +08:00
Anthony Calosa
233cc24c9a Merge pull request #678 from kevlahnota/master
Affinity affects other costs
2016-06-04 23:32:53 +08:00
Anthony Calosa
87515de57f Affinity affects other costs
Affinity should affect other costs such as flashback, buyback,  to cast
since its also a cost reducer...
2016-06-04 21:50:49 +08:00
Anthony Calosa
719a8b3420 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-04 21:34:42 +08:00
Anthony Calosa
6726166d2b Revert
there are cards that can be cast from lbrary
2016-06-04 12:09:48 +08:00
Anthony Calosa
ecc5720007 Merge pull request #677 from kevlahnota/master
Add Sphere of Resistance test
2016-06-04 08:49:43 +08:00
Anthony Calosa
1400f33f64 Update _tests.txt 2016-06-04 08:48:19 +08:00
Anthony Calosa
edb1374c32 Create Sphere_of_Resistance.txt 2016-06-04 08:47:06 +08:00
Anthony Calosa
f1c21dc9a2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-04 08:34:13 +08:00
Anthony Calosa
680ad99c9f Merge pull request #676 from kevlahnota/master
Cost Increaser & Reducer Fix
2016-06-04 00:08:08 +08:00
Anthony Calosa
375589c73d Fix unused variable
AllAbilities.cpp:4172:23: error: unused variable ‘_target’
[-Werror=unused-variable]
2016-06-03 23:28:04 +08:00
Anthony Calosa
ce8e117b0b Fix Cost Increaser, Cost Reducer
Should fix most of them.  TODO: Trinisphere and Morph...
2016-06-03 22:32:10 +08:00
Anthony Calosa
4e12de1629 Merge pull request #2 from WagicProject/master
pull
2016-06-03 21:01:33 +08:00
Anthony Calosa
bd76d40518 Merge pull request #674 from kevlahnota/master
Add Cascade cards
2016-06-03 15:39:17 +08:00
Anthony Calosa
723516f56c Cascade cards 2016-06-03 15:37:17 +08:00
Anthony Calosa
771755c96b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-03 13:23:04 +08:00
Anthony Calosa
0026153a2c Update GameObserver.cpp 2016-06-03 13:21:31 +08:00
Anthony Calosa
f7e0deafca Merge pull request #673 from kevlahnota/master
Fix Cant life change and Seperated Cascade from Depleter class.
2016-06-03 12:19:25 +08:00
Anthony Calosa
be53c68d28 unused variable
AllAbilities.cpp:275:17: error: unused variable ‘counter’
[-Werror=unused-variable]
2016-06-03 11:36:40 +08:00
Anthony Calosa
62fa9acc9f Cascade Class
seperate cascade and fix cant life change :)
2016-06-03 10:40:38 +08:00
Anthony Calosa
0493c4063f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-03 06:11:47 +08:00
xawotihs
956d0a736d Should fix Macosx build 2016-06-02 20:57:09 +02:00
Anthony Calosa
52dfe654b5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-02 21:25:58 +08:00
Anthony Calosa
5437bbaf2e Merge pull request #672 from kevlahnota/master
Cascade
2016-06-02 21:11:53 +08:00
Anthony Calosa
f4c17aaf45 Cascade 2016-06-02 20:39:21 +08:00
Anthony Calosa
20e365ea9c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-02 20:36:00 +08:00
Anthony Calosa
b407701d94 Merge pull request #671 from kevlahnota/master
Cant life change
2016-06-02 12:51:29 +08:00
Anthony Calosa
ed6755496f parenthesis
try to fix psp build
2016-06-02 12:13:23 +08:00
Anthony Calosa
4530115506 whitespace 2016-06-02 09:13:39 +08:00
Anthony Calosa
aabb905313 Cant life change 2016-06-02 09:10:30 +08:00
Anthony Calosa
aaf2d271bc Merge pull request #1 from WagicProject/master
added abilities= keyword "devoid"
2016-06-02 08:50:37 +08:00
zethfoxster
1369a08863 added abilities= keyword "devoid"
abilities=haste,flying,devoid
would make a flying haste colorless creature.
2016-06-01 18:47:19 -04:00
Anthony Calosa
ac9dfd570a minor skip phase
if there is no possible attacker then skip phase
2016-06-01 18:04:15 +08:00
Anthony Calosa
5cd5f4b38e Fix crash for Deck Menu
Old save with stats should work 👍
2016-06-01 18:03:04 +08:00
Anthony Calosa
57c7796424 Add "Snow" Cards 2016-06-01 12:53:33 +08:00
Anthony Calosa
dd6c1c3d01 Merge branch 'master' of https://github.com/WagicProject/wagic 2016-06-01 10:00:04 +08:00
Anthony Calosa
712fc26d56 Update test
colorless mana changes
2016-06-01 09:55:50 +08:00
Anthony Calosa
fd89d51f84 tidying up 2016-06-01 09:32:28 +08:00
Anthony Calosa
9e50187740 re add the comparison 2016-06-01 09:26:58 +08:00
Anthony Calosa
a36b47e500 try to fix psp compilation
travis error:
../projects/mtg/src/ManaCost.cpp:263:23: error: unused variable
‘counterCheck’ [-Werror=unused-variable]
2016-06-01 09:14:47 +08:00
Anthony Calosa
a454c3e564 Snow
Mana produced by snow permanent
2016-06-01 08:31:19 +08:00
zethfoxster
26b30cb20d ok sorry about the confusion, so the issue was with {1}{c} and how its handled. we only need to replace the adding of colorless in the manapool, the old colorless is still very very valid and should be left in place as is.
{1} can be paid with anything
{c} is a mana supertype, it pays for diamond and colorless. 
however all card such as "sol ring" now add diamond instead of old colorless.

reverted waste to {c}, but moved it under counters to avoid crashes. parse for a counter if its not a counter than parse {c} otherwise we would end up with case where it was parsing {c} instead of building counters or vice versa.
2016-05-31 18:41:36 -04:00
zethfoxster
7639e18c39 whoops heres the other half. tested with following arbor elf test card
[card]
name=Arbor Elf
auto={0}:add{1}
auto={0}:add{r}
auto={0}:name(waste) add{waste}
auto={waste}:life:1
auto={3}:damage:1
auto={1}{waste}:moveto(mybattlefield) target(<2>*|mylibrary)
text={T}: Untap target Forest.
mana={0}
type=Creature
subtype=Elf Druid
power=12
toughness=12
[/card]
2016-05-30 17:46:51 -04:00
zethfoxster
80d0ee4dc3 defining "colorless" waste land mana. 2016-05-30 17:45:21 -04:00
zethfoxster
8a6b4a49f5 deckstats crash when "unlock cards" is used #668 2016-05-30 01:04:55 -04:00
Anthony Calosa
00adb20dc7 super rare loop in ai combos and fix #667
thanks zeth
2016-05-30 01:17:53 +08:00
Anthony Calosa
22d4cbbd1e add "colorless" manacost
The symbol {C} will be used going forward to represent one colorless
mana. The numerical and variable mana symbols ({1}, {2}, and so on,
including {X}) will still be used, but only to represent costs that can
be paid with any type of mana.

example card: To cast Spatial Contortion, you pay two mana: one generic
(that's the {1}) and one colorless (that's the {C}). The generic mana
cost can be paid with any type of mana—that means any color or
colorless. But the {C} is different. That can be paid only with
colorless mana.
2016-05-30 01:16:19 +08:00
Anthony Calosa
1d81c12150 count valid targets any creature 2016-05-29 20:04:51 +08:00
Anthony Calosa
0fed1ba1ab count valid targets
count creature/s that are valid target/s
2016-05-29 19:38:00 +08:00
Anthony Calosa
c472a0215d Bug Fix
Fix send to library as a cost and add support for moving a card to
graveyard as a cost(cards like Void Attendant from Battle for Zendikar)
2016-05-29 17:56:33 +08:00
Anthony Calosa
506adf63c9 fix type
Ajani Steadfast forcefield for play and planeswalker only..
2016-05-29 14:41:31 +08:00
Anthony Calosa
d4715ddc81 ajani steadfast
ajani steadfast emblem
2016-05-29 14:31:29 +08:00
Anthony Calosa
d7fd36ddeb Indicator
Green border indicator for pay zero, can play from exile or can play
from graveyard cards...
2016-05-29 14:29:34 +08:00
Anthony Calosa
e45290e834 Ral Zarek
Fix Loyalty Counter
2016-05-29 12:14:56 +08:00
Xawotihs
e0cf5aa602 Reversed android and Qt apt stuff 2016-05-28 20:18:41 +02:00
Xawotihs
555cf9016f Moved -qq options 2016-05-28 19:47:33 +02:00
Xawotihs
d6ab2e15bf Removed comment 2016-05-28 19:15:21 +02:00
Xawotihs
95cec88742 Replaced Qt ppa 2016-05-28 19:13:45 +02:00
Anthony Calosa
18430dca25 Fix summoning sickness
Cards like control magic (using alias=1194) always resets the summoning sickness, commenting this solves the problem...
2016-05-28 13:47:03 +08:00
Anthony Calosa
8a374f53bc Update appveyor.yml
try to fix appveyor
2016-05-27 10:59:31 +08:00
Anthony Calosa
7a34543004 Nasty memleak crashing devices and its fix. #664
thanks zethfox
2016-05-26 09:42:17 +08:00
Rolzad73
9568fe7d4d Merge pull request #1 from WagicProject/master
Update fork with original
2016-04-14 11:36:57 -04:00
Anthony Calosa
f5d00ddbef Merge pull request #661 from kevlahnota/master
changed alias
2015-11-13 06:48:18 +08:00
Anthony Calosa
cccc21c035 changed alias 2015-11-13 05:45:17 +08:00
Anthony Calosa
090f365cee Merge pull request #660 from kevlahnota/master
Overload Cost
2015-11-10 12:57:56 +08:00
Anthony Calosa
cd1b629191 Fix Segmentation Fault & Formatting 2015-11-10 11:58:36 +08:00
Anthony Calosa
406f68ac5b Overload Cards
the alias is for the Overload Check and Alternate Cost Restriction...
???Bestow???
2015-11-09 19:04:31 +08:00
Anthony Calosa
c6e76d78a2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-08 21:33:38 +08:00
Anthony Calosa
0d480a67d8 Merge pull request #659 from kevlahnota/master
commented to restart build...
2015-11-08 20:59:03 +08:00
Anthony Calosa
4f9f84fc6a comment unsupported 2015-11-08 20:56:31 +08:00
Anthony Calosa
0f725a02db Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-08 20:56:10 +08:00
Anthony Calosa
71fdbb6564 Merge pull request #658 from kevlahnota/master
produce mana for lands you/opponent could produce
2015-11-08 19:15:28 +08:00
Anthony Calosa
a22991758f mana producer for lands you/opponent could produce
reflecting pool, exotic orchard...
2015-11-08 18:18:33 +08:00
Anthony Calosa
3404eb708d Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-07 21:06:40 +08:00
Anthony Calosa
c9439efcf8 Merge pull request #657 from kevlahnota/master
Aluren & Omniscience
2015-11-07 19:40:53 +08:00
Anthony Calosa
6f4cf9e941 Aluren & Omniscience
MayAbility + resolve instead of
MenuAbility + addtogame for dredge???
2015-11-07 19:16:31 +08:00
Anthony Calosa
c99216c053 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-07 19:13:36 +08:00
Anthony Calosa
e592c331f9 Merge pull request #656 from kevlahnota/master
Manacost Changes, Anyzone for CDA, PayZero Cost
2015-11-07 14:41:25 +08:00
Anthony Calosa
efdc4071da comment 2015-11-07 10:45:54 +08:00
Anthony Calosa
e35c9f6087 AI plays zerocast cards, Update Rules folder!
Its basic pay zero for now...
Omniscience is possible :)
2015-11-07 09:59:30 +08:00
Anthony Calosa
71390046f5 anyzone for cdaactive
should handle most of them except sewer nemesis, chameleon colossus
2015-11-06 19:47:30 +08:00
Anthony Calosa
1c8852a7a2 Manacost Changes
todo: kicker (other possible additional costs?) and change rule keyword
to payzerorule...
2015-11-05 23:25:39 +08:00
Anthony Calosa
536a0e429a AI considers playing from exile and graveyard 2015-11-05 07:17:58 +08:00
Anthony Calosa
4f54e30e0e Libraryeater and Canplayfromexile
extend canplayfromgraveyard with canplayfromexile
libraryeater for undead alchemist
2015-11-05 07:16:49 +08:00
Anthony Calosa
525453d677 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-05 07:13:09 +08:00
Anthony Calosa
6fb4dbdc7b Merge pull request #655 from kevlahnota/master
chooseacolor indicator, increased/reduced cost affects retrace,buyback,flashback
cast in graveyard that have spelltarget types "target=" fix
2015-11-04 07:06:47 +08:00
Anthony Calosa
60ba4e3eeb altercost should affect retrace, flashback, buyback costs 2015-11-04 06:41:59 +08:00
Anthony Calosa
58b032627e Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-02 12:21:40 +08:00
Anthony Calosa
7ffab1a821 moved activated copy cards to borderline
the default function of copy function triggers abilities as it comes
onto the battlefield, but these cards are already inplay with their copy
abilities and the enters the battlefield abilities of the copied cards
must not trigger.
2015-11-02 12:21:35 +08:00
Anthony Calosa
7303c7c253 chooseacolor indicator on some cards
alias = 0000 plus chooseacolor ability...
2015-11-02 00:15:58 +08:00
Anthony Calosa
4557748c29 Merge pull request #654 from kevlahnota/master
bug fix
2015-11-02 00:10:02 +08:00
Anthony Calosa
d3cb13cfd8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-01 22:36:21 +08:00
Anthony Calosa
1bd3b7743b bug fix 2015-11-01 21:59:54 +08:00
Anthony Calosa
591f7205ed Merge pull request #653 from kevlahnota/master
Exile Zone, Altercost and Hand modifier
2015-10-31 15:46:21 +08:00
Anthony Calosa
3a9b4f3491 parenthesis... 2015-10-31 15:23:39 +08:00
Anthony Calosa
896b12c16b werror init on psp compilation 2015-10-31 15:01:29 +08:00
Anthony Calosa
ba7355a831 moved rebound cards to borderline
until castcard supports increased cost due to altercost...
2015-10-31 11:38:35 +08:00
Anthony Calosa
c580d89c94 Altercost, Exile Zone & Handsize Modifier 2015-10-31 10:59:37 +08:00
Anthony Calosa
8793feb9ba Altercost
Altercost alter cards to be cast...
Removed Trinisphere temporarily...
2015-10-30 07:11:16 +08:00
Anthony Calosa
40db1180df pay zero
todo: all zones
2015-10-29 06:38:59 +08:00
Anthony Calosa
d2f3e2cd60 Castcard, Rebound and other fixes 2015-10-27 19:44:22 +08:00
Anthony Calosa
56fc735b36 Parenthesis
Try to fix PSP compilation
2015-10-27 07:05:57 +08:00
Anthony Calosa
bd5449a9a2 updated old tests
the new exile zone is utilized in comparing the number of cards it
has(since its enabled and viewable, the value is now counted)
2015-10-27 06:35:22 +08:00
Anthony Calosa
4853c8d314 Exile Corrections
Todo: Update tests to include exile card count...
2015-10-27 01:03:24 +08:00
Anthony Calosa
cdf94b281f exile zone
enabled exile zones for both players
2015-10-26 19:14:50 +08:00
Anthony Calosa
8eeaa40cec Merge branch 'master' of https://github.com/kevlahnota/wagic 2015-10-26 06:52:15 +08:00
Anthony Calosa
cf0f9d43fa exile zone
player only, todo opponent and ability activation for exile
2015-10-26 06:50:19 +08:00
Anthony Calosa
0594822872 added card equipped event 2015-10-25 17:55:45 +08:00
Anthony Calosa
46d1e2e703 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-25 12:04:32 +08:00
Anthony Calosa
dd14ee7156 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-23 18:40:08 +08:00
Anthony Calosa
bab0d40c87 Merge pull request #652 from kevlahnota/master
Puresteel Paladin support
2015-10-23 17:07:24 +08:00
Anthony Calosa
378a54fb62 puresteel paladin support
rehook and newhook for equipments inplay...
retarget and newtarget don't support stonehewer basic because the card
is refreshed and stone hewer basic creates equipment/s as tokens...
2015-10-23 15:25:30 +08:00
Anthony Calosa
2d5d367ee6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-22 19:22:13 +08:00
Anthony Calosa
638c721d32 Merge pull request #651 from kevlahnota/master
added trigger keyword/s to parse current opponent and current controller correctly
2015-10-22 18:20:13 +08:00
Anthony Calosa
f464623d17 curiosity...
2/1/2007 You draw one card each time the enchanted creature damages the
opponent. This is not one card per point of damage.
2/1/2007 If put on your opponent's creature, you do not draw a card when
that creature damages you. The creature has to damage your opponent in
order to have this work.
2/1/2007 Drawing a card is optional. If you forget, you can't go back
later and do it, even if it is something you normally do.
9/22/2011 "You" refers to the controller of Curiosity, which may be
different from the controller of the enchanted creature."An opponent"
refers to an opponent of Curiosity's controller.
9/22/2011 Any damage dealt by the enchanted creature to an opponent will
cause Curiosity to trigger, not just combat damage.
9/22/2011 Curiosity doesn't trigger if the enchanted creature deals
damage to a planeswalker controlled by an opponent.
2015-10-22 17:33:45 +08:00
Anthony Calosa
fe86514fb8 updated primitives @damageof/@damagefoeof 2015-10-22 14:20:52 +08:00
Anthony Calosa
704f7f4494 TrDamaged changes
@damaged/combatdamaged/noncombatdamaged(who) -> static version
@damageof/combatdamageof/noncombatdamageof(player) -> current controller
of the card
@damagefoeof/combatdamagefoeof/noncombatdamagefoeof(player) -> current
opponent of the card

combat/noncombat damaged - done...
TODO: @damaged cards
2015-10-21 22:03:21 +08:00
Anthony Calosa
3b0cd389e5 TrLifeGained changes
@lifed/lifeloss(who) -> static version
@lifeof/lifelostof(player) -> current controller of the card
@lifefoeof/lifelostfoeof(player) -> current opponent of the card
2015-10-21 12:25:08 +08:00
Anthony Calosa
21eea225af TrcardDrawn changes
@drawn(who) -> static version
@drawof(player) -> current controller of the card
@drawfoeof(player) -> current opponent of the card
2015-10-21 10:16:19 +08:00
Anthony Calosa
743c2a6a5e Update _tests.txt 2015-10-21 10:08:55 +08:00
Anthony Calosa
abcb511a57 Create ExchangeController.txt
the current trigger check is static... fix is on the way :)
2015-10-21 10:07:31 +08:00
Anthony Calosa
3669bab210 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-21 10:02:44 +08:00
Anthony Calosa
88b9f83d79 Merge pull request #650 from kevlahnota/master
Persist & Undying ability revised
2015-10-20 22:58:57 +08:00
Anthony Calosa
2178018b18 Persist and Undying goes to the stack 2015-10-20 21:56:49 +08:00
Anthony Calosa
ae4d245232 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-20 19:14:55 +08:00
Anthony Calosa
509b21153f Merge pull request #649 from kevlahnota/master
Persist/Undying Fix, Raid support
2015-10-20 12:02:47 +08:00
Anthony Calosa
7810c65862 added Raid support
thisturn(creature[attacking]|mybattlefield)~morethan~0 only triggers
once... use raid keyword... if raid then blah...
2015-10-20 11:09:57 +08:00
Anthony Calosa
9f8d2b2d46 take 2 2015-10-19 21:48:59 +08:00
Anthony Calosa
3bcb2985f9 try to fix compile error on psp 2015-10-19 20:15:51 +08:00
Anthony Calosa
0d8b2f4a01 persist/undying fix
persist/undying wont trigger when there is a replacement effect for
cards that goes to graveyard like leyline of the void. support  for
anafenza the foremost.
2015-10-19 19:43:07 +08:00
Anthony Calosa
b060c4205c targetter, targetted reset 2015-10-19 11:10:49 +08:00
Anthony Calosa
f90775153c Revert "TrcardDrawn, TrDamaged, TrLifeGained"
This reverts commit c7535e38dc.
2015-10-19 10:19:14 +08:00
Anthony Calosa
17a2d9b4d8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-19 07:13:28 +08:00
Anthony Calosa
14a68d6ed4 Merge pull request #648 from kevlahnota/master
protection from colored spells & forced menuicons for PSP
2015-10-19 00:11:59 +08:00
Anthony Calosa
c7535e38dc TrcardDrawn, TrDamaged, TrLifeGained
Added trigger restriction for "@trigger(player)
restriction{opponenttrigger/controllertrigger}"

Restriction for:
@drawn
@damaged(combat and noncombat)
@lifed/lifeloss

Why?

When using @drawn trigger like Underworld Dreams
auto=@drawn(opponent):life:-1 opponent

If you take control of Underworld Dreams from an opponent, the
targetchooser for "opponent" is not updated and you are still the
opponent of Underworld Dreams even you take control of it(It is right if
you are the chosen opponent from cards like Black Vise, The Rack, etc...
The chosen opponent never changes. But cards that don't define a chosen
player an "opponent" like Underworld Dreams when an exchanged control
happens, the opponent of the card is the opponent of the one who
controls the card). :P

The new correct code for Underworld Dreams:
auto=@drawn(player) restriction{opponenttrigger}:life:-1 opponent
2015-10-18 22:38:41 +08:00
Anthony Calosa
8c4fabb89a menuicons forced for PSP build 2015-10-18 15:55:10 +08:00
Anthony Calosa
1ad1bf7942 protection from colored spells 2015-10-18 00:20:32 +08:00
Anthony Calosa
4e115a2326 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-17 22:41:54 +08:00
Anthony Calosa
6900e60df0 Merge pull request #646 from kevlahnota/master
Fix issue #473, #784
2015-10-17 21:37:23 +08:00
Anthony Calosa
61881ad656 Fix issue #473 and #784
It seems when a zonechange event from inplay to inplay (player or
opponent), the card->view item values is recalculated... so it destroys
the GUI like missing card image, or moving it far off the screen... To
reproduce, cast Splinter Twin to Conquering Manticore and gain control
the same creature about 2 or 3 times...
2015-10-17 19:44:21 +08:00
Anthony Calosa
d1e64a410b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-17 16:38:54 +08:00
Anthony Calosa
5e5de03055 Merge pull request #645 from kevlahnota/master
revert guiplay, castcard(putinplay) correction and modified AAcopier
2015-10-17 09:26:58 +08:00
Anthony Calosa
f4bdfa43ca Copied Morphed card 2015-10-16 18:50:05 +08:00
Anthony Calosa
5ede956e7f Reverted GuiPlay
reverted stacking issue
2015-10-16 18:19:42 +08:00
Anthony Calosa
1cd27210ac Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-16 18:19:05 +08:00
Anthony Calosa
2819ec01af token is excluded...
for ABlink
2015-10-16 17:02:37 +08:00
Anthony Calosa
ca113497b2 Merge pull request #644 from kevlahnota/master
Bug Fix: Planeswalker Rule, Populate & ABlink return to play ability for Aura cards
2015-10-15 20:01:00 +08:00
Anthony Calosa
15725c0302 bug fix populate absolute value
forgot to add abs when adding negative bonuses...
2015-10-15 18:03:26 +08:00
Anthony Calosa
851bd88de6 Fix Planeswalker Rule & ABlink 2015-10-15 12:23:32 +08:00
Anthony Calosa
a207936231 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-15 12:22:47 +08:00
Anthony Calosa
9cb40e41fa Merge pull request #643 from kevlahnota/master
Bug Fix: legend rule, profile stat on main menu and aura curse update on player target
2015-10-14 23:24:41 +08:00
Anthony Calosa
0f0bdd7d13 Fix Aura Curse
Aura Curse that targets a player should update its position after
casting.
2015-10-14 22:14:13 +08:00
Anthony Calosa
297206b054 Fix update profile stat after buying cards
profile stats on the upper left of main menu should update after buying
some cards :)
2015-10-14 21:33:12 +08:00
Anthony Calosa
626f0677f7 Fix profile status on upper left of main menu
The profile status on the upper left of main menu should update now when
changing user profiles...:)
2015-10-14 21:26:22 +08:00
Anthony Calosa
7b5b25d113 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-14 20:04:35 +08:00
Anthony Calosa
3635137906 fix legend rule
704.5k If a player controls two or more legendary permanents with the
same name, that player
chooses one of them, and the rest are put into their owners’ graveyards.
This is called the
“legend rule.”

bury is destroy without regenerate, so when two legends of the same name
has indestructible, bury will have no effect... I changed it to put into
owners graveyard instead using mover...
2015-10-14 20:04:29 +08:00
Anthony Calosa
7ea02a316e Merge pull request #642 from kevlahnota/master
urza lands fix, polished action stack & static mana display
2015-10-13 21:19:47 +08:00
Anthony Calosa
9a66b0c6e4 some fix and polished static mana and action stack
I moved the target quad near the source card and moved the action string
forward so there is no overlapping of action string and the target quad
if the action string is too long...
2015-10-13 19:27:25 +08:00
Anthony Calosa
8fe5000ce1 polished action stack 2015-10-12 19:54:03 +08:00
Anthony Calosa
82fac5f80e Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-12 13:02:57 +08:00
Anthony Calosa
94620504da fix urza lands
the alias is used for checking of "urzatron". revised this because when
using if then else in the activation makes the mana ability goes to the
stack
2015-10-12 13:00:05 +08:00
Anthony Calosa
59cab65fcf Merge pull request #641 from kevlahnota/master
Fix crash bug, support doubled res texture for background, avatars, menutitle
2015-10-12 06:46:53 +08:00
Anthony Calosa
c7b9e6f9b8 fix avatar scaling on guicombat, border on combat 2015-10-11 23:04:28 +08:00
Anthony Calosa
4c86cae7fe disabled wood & gold texture, backdrop size 480x272
blending of wood and/or gold texture on some resolutions(mobile,
tablets, etc) draws line which can be distracting. The backdrop is now
full size of PSP resolution (480x272, 2x res can be loaded like 960x544)
2015-10-11 14:29:36 +08:00
Anthony Calosa
6376596e49 increase battlefield "hot area" size, opponent phase ring uses darker glyph vs human 2015-10-10 20:54:41 +08:00
Anthony Calosa
91053965be Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-10 20:52:37 +08:00
Xawotihs
4f9ee17ff9 Everywhere 2015-10-10 14:35:53 +02:00
Xawotihs
2461b39fb7 Update android SDK to 24.3.4 to try fixing travis 2015-10-10 14:35:22 +02:00
Anthony Calosa
ff7634a8ac Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-10 20:30:19 +08:00
Xawotihs
6c41ae8e8e Update android build tools to 23.0.1 to try fixing travis 2015-10-10 14:19:22 +02:00
Anthony Calosa
52803cf57c fix crash bug when buying a card pack
This fixes the shop crashing the game when you buy a card packs in the
shop. The targeting indicator looks at the stack so it needs to be
enabled only when you're in the "game"...
2015-10-10 04:59:22 +08:00
Anthony Calosa
03f5ba430c resized
doubled res... you need to replace this with a higher detailed icons...
2015-10-09 21:46:25 +08:00
Anthony Calosa
91e317a497 added placeholder for large icons 2015-10-09 21:17:46 +08:00
Anthony Calosa
a0b4d0f348 added scaling of background 2015-10-09 21:06:58 +08:00
Anthony Calosa
674f4d5062 transformed Planeswalker
When a Planeswalker transforms into a creature, it should be inline on
the battlefield positions along with other creatures.
2015-10-08 11:24:04 +08:00
Anthony Calosa
5cc2f5b645 border p/t 2015-10-08 09:51:52 +08:00
Anthony Calosa
3ca8aefad7 fix bug where walls that can attack activated vs moat in play 2015-10-07 20:59:17 +08:00
Anthony Calosa
1d1b663f55 menutitle scaling
can load 2x res...
2015-10-07 18:10:00 +08:00
Anthony Calosa
6a64b09452 replaced fillroundrect border 2015-10-07 18:08:00 +08:00
Anthony Calosa
c2c9e180ea code cleanup 2015-10-07 11:06:59 +08:00
Anthony Calosa
fb89183767 support scaling of avatar texture - multiples of 35x50
default was 35x50 avatar texture, if using 3x  (105x150), it will scale
it :)
2015-10-07 10:57:08 +08:00
Anthony Calosa
45b570b6f7 border highlighter 2015-10-07 10:53:11 +08:00
Anthony Calosa
8e8e5d8da8 Merge remote-tracking branch 'WagicProject/master' 2015-10-06 10:57:26 +08:00
Anthony Calosa
f59a7872b3 Merge pull request #640 from kevlahnota/master
fix alpha/transparency on rendered border
2015-10-06 10:53:49 +08:00
Anthony Calosa
022c6fccf5 Merge remote-tracking branch 'WagicProject/master' 2015-10-06 10:52:08 +08:00
Anthony Calosa
b750cf1f33 fix alpha/transparency on rendered border 2015-10-06 10:47:08 +08:00
Anthony Calosa
5495d772ea Merge pull request #639 from kevlahnota/master
Visual Targeting Indicator, Borders
2015-10-06 01:21:29 +08:00
Anthony Calosa
664589c642 Visual Targeting Indicator, Borders 2015-10-05 22:03:30 +08:00
Anthony Calosa
6e9c965279 Merge remote-tracking branch 'WagicProject/master' 2015-10-03 21:50:02 +08:00
Anthony Calosa
87e9ed8191 Merge pull request #638 from kevlahnota/master
reverted build
2015-10-03 21:43:01 +08:00
Anthony Calosa
a5a0aa859a reverted build 2015-10-03 21:39:54 +08:00
Anthony Calosa
78693685d8 Merge pull request #637 from kevlahnota/master
revised producemana, added producecolor
2015-10-03 11:27:28 +08:00
Anthony Calosa
f39d4a688a build number 2015-10-03 08:54:18 +08:00
Anthony Calosa
0c30a4ba53 High Tide fix 2015-10-03 08:15:05 +08:00
Anthony Calosa
7db8b89b89 Merge remote-tracking branch 'WagicProject/master' 2015-10-03 07:37:04 +08:00
Anthony Calosa
ec4a9ead74 revised produceextra, added producecolor
producecolor:color look for the mana color when engaged
produceextra:selectmana acts like tappedformana(mytgt) so the ability
must be on the source
produceextra:{color}  ability on the otherhand, the ability must be on
the target
2015-10-03 07:36:52 +08:00
Anthony Calosa
d31f112967 Merge pull request #636 from kevlahnota/master
LKI for power,  toughness and basic abilities,  produceextra ability, stack and life check, reduceto ability
2015-10-02 01:12:38 +08:00
Anthony Calosa
4098c306e2 removed unused variable. 2015-10-01 22:56:42 +08:00
Anthony Calosa
ddee2c08e2 added stack check, modified life check
if activating ability, playing a land or casting sorcery spell at
sorcery level(timing restriction), if the stack is not empty, don't
allow it. Modified the life state check, if any of the players would
lose the game, allow the gamestateeffects to check... added
reduceto:value for ali from cairo...
2015-10-01 22:25:26 +08:00
Anthony Calosa
e1c02c8bf5 produceextra, lki(last known information) for power, toughness and basic abilities 2015-09-30 23:45:54 +08:00
Anthony Calosa
956d21d431 Merge remote-tracking branch 'WagicProject/master' 2015-09-29 22:29:08 +08:00
Anthony Calosa
8b3f474bca Merge pull request #635 from kevlahnota/master
Fix Recover Cards, Cloner, Copier, and Preliminary support for Madness, added converge keyword
2015-09-29 21:29:38 +08:00
Anthony Calosa
8eddcfb639 added converge keyword
converge returns the number of colors spent when casting the spell.
example you pay {2}{W}{W}{R}{B}, converge returns 3, white, black and
red colors spent with...
2015-09-29 15:09:29 +08:00
Anthony Calosa
9b79602134 Moved modifiedbAbi block 2015-09-29 14:31:31 +08:00
Anthony Calosa
0bab560e89 Fix Cloner and Copier abilities 2015-09-29 10:42:29 +08:00
Anthony Calosa
6458b46437 Merge remote-tracking branch 'WagicProject/master' 2015-09-28 21:27:48 +08:00
Anthony Calosa
021343ca02 fix for recover cards, preliminary support for madness 2015-09-28 21:27:27 +08:00
Anthony Calosa
86a5890c36 Merge pull request #634 from kevlahnota/master
life indicators and fix init of vars
2015-09-27 10:12:57 +08:00
Anthony Calosa
04e53f2002 increase the players life indicator(scale to 1.3f), fix init vars
increase the life indicator for players to 1.3f, life indicator for
players changes color according to its value. fix init for vars(should
fix gravecardtypes for tarmogoyf and pbasiclandtypes )
2015-09-27 09:52:35 +08:00
Anthony Calosa
5dccd4b05f Merge remote-tracking branch 'WagicProject/master' 2015-09-27 08:56:31 +08:00
xawotihs
9e77899535 Adds missing breaking macosx compilation without boost 2015-09-26 09:44:11 +02:00
Xawotihs
4185923d04 Replaced C++ types by C ones 2015-09-25 21:46:37 +02:00
Xawotihs
a19ccb6b49 Should fix g++ compilation issue 2015-09-25 21:01:09 +02:00
xawotihs
5ae9d42480 Fixed compilation issue with clang 2015-09-25 20:21:10 +02:00
xawotihs
f282a3346c Merge branch 'no-boost' of https://github.com/WagicProject/wagic into no-boost 2015-09-25 20:04:42 +02:00
Anthony Calosa
ac8881a097 Merge pull request #633 from kevlahnota/master
Ingest and other card fixes...
2015-09-25 19:26:48 +08:00
Anthony Calosa
41daa83e3e Merge remote-tracking branch 'WagicProject/master' 2015-09-25 17:39:48 +08:00
Anthony Calosa
2869460a7f Fixed some card primitives, added support for "other" parsing power, toughness and converted cost, added Ingest
Ingest -> topcard of library to exile
Usage ingest:value
ingest:20 will send the top 20 cards of library to exile
2015-09-25 17:39:35 +08:00
xawotihs
0f168922d8 Fixed compilation issue of config without Qt 2015-09-24 23:47:16 +02:00
xawotihs
b8b5362ba5 Removed dependency on boost when Qt is used. 2015-09-24 23:20:52 +02:00
Anthony Calosa
b4e0f2c991 Merge pull request #632 from kevlahnota/master
Added bypass for notatarget(it should bypass protection and shroud), extend castcard to support putinplay for aura(since aura must have target chooser when put into play by other means), added state based action for aura with invalid targets(ex. local enchantments that enchant creature, then the creature it enchants loses creature types like man lands ... mutavault.)
2015-09-24 19:55:13 +08:00
Anthony Calosa
201b6d9cfa bypassTC turn off 2015-09-24 14:45:26 +08:00
Anthony Calosa
a6ec3e0a68 added type check on aura if the card it enchant is legal 2015-09-24 14:14:00 +08:00
Anthony Calosa
64578787a0 NULL check 2015-09-24 12:14:58 +08:00
Anthony Calosa
d068388e7f added aura targets for castcard putinplay
the special putinplay keyword for castcard is used for aura so we can
"retarget" their intended targets but without casting them instead they
are put onto the battlefield and the ability is not targetted 👍

303.4c If an Aura is enchanting an illegal object or player as defined
by its enchant ability and other
applicable effects, the object it was attached to no longer exists, or
the player it was attached to
has left the game, the Aura is put into its owner’s graveyard. (This is
a state-based action. See
rule 704.)

303.4f If an Aura is entering the battlefield under a player’s control
by any means other than by
resolving as an Aura spell, and the effect putting it onto the
battlefield doesn’t specify the object
or player the Aura will enchant, that player chooses what it will
enchant as the Aura enters the
battlefield. The player must choose a legal object or player according
to the Aura’s enchant
ability and any other applicable effects.
2015-09-24 09:53:10 +08:00
Anthony Calosa
606d18aa6e bypassTC on playertarget 2015-09-24 06:24:17 +08:00
Anthony Calosa
106bcec7cf bypass targetchooser 2015-09-24 06:02:46 +08:00
Anthony Calosa
179e973b4e typo 2015-09-23 21:44:29 +08:00
Anthony Calosa
2223cd4f30 modified castcard to support put into play
for reanimated aura
2015-09-23 21:36:05 +08:00
Anthony Calosa
7db5345f9a attempt to fix "notatarget"
notatarget must be allowed to target untargettable cards.
2015-09-23 12:14:47 +08:00
Anthony Calosa
df659f648e Merge remote-tracking branch 'WagicProject/master' 2015-09-22 21:18:02 +08:00
Anthony Calosa
d7fd079ec4 Merge pull request #631 from kevlahnota/master
Auraward,  unattach event and statebased action for protection from quality
2015-09-22 20:29:28 +08:00
Anthony Calosa
800172f93e Update _tests.txt 2015-09-22 19:49:20 +08:00
Anthony Calosa
2fbfdbcb03 lowercase 2015-09-22 19:48:13 +08:00
Anthony Calosa
ae59e75be1 Create pledge_protection.txt 2015-09-22 19:46:18 +08:00
Anthony Calosa
f01268ef76 Merge remote-tracking branch 'WagicProject/master' 2015-09-22 17:12:00 +08:00
Anthony Calosa
4b9f94c9ae added auraward, added event for unattach, added statebased check for protection from quality
auraward -> an exception for protection from quality used for aura, like
flickering ward
added event for unattach
added state based check for protection from quality.
702.16c A permanent or player with protection can’t be enchanted by
Auras that have the stated
quality. Such Auras attached to the permanent or player with protection
will be put into their
owners’ graveyards as a state-based action.

702.16d A permanent with protection can’t be equipped by Equipment that
have the stated quality
or fortified by Fortifications that have the stated quality. Such
Equipment or Fortifications
become unattached from that permanent as a state-based action, but
remain on the battlefield.
2015-09-22 17:11:40 +08:00
Anthony Calosa
33868eef88 fix typo 2015-09-22 08:18:24 +08:00
Anthony Calosa
11bd885fb4 Merge remote-tracking branch 'WagicProject/master' 2015-09-22 08:14:36 +08:00
Anthony Calosa
0e73168803 Merge pull request #630 from kevlahnota/master
Added ORI cards, Removed Workarounds, Added support for Can't Gain life... spellmastery keyword is used for alternative cost so cards with spellmastery can be cast as though it had flash (substance)...
2015-09-22 07:55:13 +08:00
Anthony Calosa
1eeb42a88d fixed lavinia of the tenth 2015-09-22 07:08:27 +08:00
Anthony Calosa
9ad852558c Merge remote-tracking branch 'WagicProject/master' 2015-09-22 06:55:36 +08:00
Anthony Calosa
227a262e01 added ORI cards :)
revised the keyword:
myname -> returns the number for each instance of the card name you
control.
allmyname -> returns the number for each instance of the card name in
play.
2015-09-22 06:53:55 +08:00
Anthony Calosa
0abd368ccc I think Akroan Conscriptor is supported 2015-09-21 21:38:23 +08:00
Anthony Calosa
f757dcab74 update invigorate and wall of shards
if players can't gain life, you cannot pay costs that have an opponent
gain life also...
2015-09-21 21:25:41 +08:00
Anthony Calosa
28f758e421 Removed Workarounds, Added support for Can't Gain life...
spellmastery - can play as though had flash used in conjunction for
alternative cost.
nolifegain, nolifegainopponent - cannot gain life.
2015-09-21 15:22:28 +08:00
Anthony Calosa
6fba81d7c8 Merge pull request #629 from kevlahnota/master
added M15 cards :)
2015-09-21 13:59:27 +08:00
Anthony Calosa
8543977a2f Merge branch 'master' of https://github.com/kevlahnota/wagic 2015-09-21 12:00:50 +08:00
Anthony Calosa
7b3da0e2c2 added M15 cards :)
added M15 cards and support for cards that use startinglife
keyword(Resolute Archangel)
2015-09-21 12:00:34 +08:00
Anthony Calosa
b16b37e757 Merge remote-tracking branch 'WagicProject/master' 2015-09-21 12:00:24 +08:00
Anthony Calosa
726b087d0d Create _cards.dat 2015-09-21 12:00:02 +08:00
Anthony Calosa
c3fb08da59 Merge pull request #628 from kevlahnota/master
Reverted Random, Disable Indicators on Gametype that is not Classic
2015-09-20 22:48:46 +08:00
Anthony Calosa
725a285e7f Reverted Random 2015-09-20 22:28:08 +08:00
Anthony Calosa
9bf329bd17 I just found this out....
Make the indicator for classic game type. Maybe there is another way to
produce cards by using the function from castcard...
2015-09-20 19:53:49 +08:00
Anthony Calosa
0517a73bfe Merge remote-tracking branch 'WagicProject/master' 2015-09-20 17:37:43 +08:00
Anthony Calosa
a432f5cc3a Merge pull request #627 from kevlahnota/master
PT colors, Token and Cloner Indicators
2015-09-20 15:28:54 +08:00
Anthony Calosa
72b119d622 fix bad lines 2015-09-20 15:25:01 +08:00
Anthony Calosa
18f09ab2ef %c to %s 2015-09-20 14:26:40 +08:00
Anthony Calosa
5985c518f6 buff.c_str() 2015-09-20 14:17:43 +08:00
Anthony Calosa
0dc4dbe642 Merge remote-tracking branch 'WagicProject/master' 2015-09-20 13:19:15 +08:00
Anthony Calosa
0e90426cff Support for Silumgar Assassin, Minor PT color and Token, Clone Indicators
When a creature is damaged and has critical life, PT turns to
red(critical life is 2 and below), if a card has a powered down status
like from -1/-1 counter, the PT turns to thistle, if powered up above 4,
the PT turns into yellow, default is white. legendary eldrazi pt is
violet. Token Indicator is T, and C for cards with copy abilities(so we
can differentiate them from originals), TC for both token and copy cat
cards.
2015-09-20 13:19:03 +08:00
Anthony Calosa
900d045cf0 Merge pull request #626 from kevlahnota/master
PT Switch like Layer 7e and Token Indicator
2015-09-20 00:04:25 +08:00
Anthony Calosa
e9c4d70126 Update _tests.txt 2015-09-19 23:31:18 +08:00
Anthony Calosa
5c93d3e7c4 Create PTswitch.txt 2015-09-19 23:30:11 +08:00
Anthony Calosa
c372ffa111 Switching PT, Token Indicator
Added Switching PT like Layer 7e, Token Indicator for cloned Cards
2015-09-19 23:25:33 +08:00
Anthony Calosa
8e15ad7ed0 Merge remote-tracking branch 'WagicProject/master' 2015-09-19 23:21:22 +08:00
Anthony Calosa
a6f3fb19c8 Merge pull request #624 from kevlahnota/master
Token Cloning fix and colored PT
2015-09-19 15:29:40 +08:00
Anthony Calosa
64c6d19ae7 lowest is 0, typo... 2015-09-19 13:28:14 +08:00
Anthony Calosa
c9d9d3d4d3 Random
I have a profile with 100+ decks and it seems with the previous code,
the random deck seems not random.
2015-09-19 13:05:16 +08:00
Anthony Calosa
e25b78953c other indicators must be somewhere else 2015-09-19 10:29:02 +08:00
Anthony Calosa
81f0c916f5 readjustment 2015-09-19 08:04:26 +08:00
Anthony Calosa
ef690f6438 update pt colors 2015-09-19 07:50:04 +08:00
Anthony Calosa
11124205e5 basic color code on PT
if a creature was damaged or has a negative toughness bonus, the pt
changes to crimson red, if the creature was not damaged and has power
buff, the color changes to spring green, normal was default white.
2015-09-18 20:16:28 +08:00
Anthony Calosa
6cd0474eca Bug Fix on Cloning Tokens 2015-09-18 19:56:02 +08:00
Anthony Calosa
bd89710478 Merge remote-tracking branch 'WagicProject/master' 2015-09-18 11:45:29 +08:00
Anthony Calosa
fc54822b97 Merge pull request #623 from kevlahnota/master
CDA and X manacost on stack
2015-09-18 06:10:24 +08:00
Anthony Calosa
13bb6dbe93 Update Token.cpp
Fix typo
2015-09-18 06:03:53 +08:00
Anthony Calosa
8c9a98e3e9 Update _tests.txt 2015-09-18 05:31:13 +08:00
Anthony Calosa
7ce05fb4fc CDA test # 2 2015-09-18 05:27:48 +08:00
Anthony Calosa
53153b237c CDA test # 1
Testing layer 7a, 7b and 7c :)
2015-09-17 22:50:21 +08:00
Anthony Calosa
478dea6af4 Tidy up a little... 2015-09-17 21:30:55 +08:00
Anthony Calosa
e097d38347 Updated CDA cards 2015-09-17 18:39:33 +08:00
Anthony Calosa
6cba14181d support "other" in type:* parsing
if a card with a cleric subtype has an autoline like this:
othertype:cleric:battlefield, means that the targetchooser excludes that
card, only the other "cleric" are counted.
2015-09-17 11:16:29 +08:00
Anthony Calosa
76c48a8c4e Merge pull request #1 from WagicProject/master
Merged from WagicProject:master
2015-09-17 05:52:33 +08:00
Anthony Calosa
425b51de08 Fix for token cloning
Some tokens when cloned produces miscalculated PT(Using foreach,
aslongas and others that needs CDA). This should fix the issue. TODO:
add tests and updated mtg.txt ...
2015-09-16 20:36:58 +08:00
Anthony Calosa
8e057379ce Finally Fixed... :)
The issue last commit was the toughness is refreshed and the damage is
not reflected. This commit fixes the bug. Yey...
2015-09-16 10:45:43 +08:00
Anthony Calosa
db649ddc96 Added Update on CDA
This controls whether to update Power and Toughness if we are setting
base PT or not. If we are setting base PT update the CDA but it will not
be applied since we have an effect that sets PT to a default base. If
there are no effect that sets base PT, apply it on CDA using
current/updated PT. The buffs are not affected. Yeah...
2015-09-16 09:34:32 +08:00
Anthony Calosa
6aab17d0b3 CDA complete
This fixes the bug I introduced lst time. The damage was not taking into
account, but this time the damage reflects...
TODO/TOFOLLOW: update test and update all cards that uses CDA :)
2015-09-16 06:42:02 +08:00
Xawotihs
fdfb8e0c34 Should fix package upload 2015-09-15 07:58:24 +02:00
Anthony Calosa
72aaa18a35 CDA
CDA works by using "cdaactive" keyword on PT changes. Instead of
granting bonus, we modify the orig power and toughness since they are
dynamic PT. cdaactive are for cards like maro, tarmogoyf, etc. To
Follow/To Do: Additional Tests and other bug fix
2015-09-15 06:35:07 +08:00
xawotihs
07e1c139ba Restored .travis file back to its original state 2015-09-14 23:55:33 +02:00
xawotihs
7df76697e1 Added iOS package upload after successfull build 2015-09-14 23:50:19 +02:00
xawotihs
743b260813 Adds control file 2015-09-13 23:50:21 +02:00
xawotihs
24187b8413 Enable usage of iOS resources from both xcode and theos makefile. Creates iOS package. 2015-09-13 20:54:25 +02:00
xawotihs
acfd0bf104 Merge branch 'master' into iOS-Build 2015-09-13 18:42:31 +02:00
Anthony Calosa
59792b3456 X in manacost is always 0 except on the stack 2015-09-12 19:58:09 +08:00
Anthony Calosa
fb9b0b8166 Added Konda's Banner 2015-09-12 19:37:35 +08:00
Anthony Calosa
11d68c0e27 Separated PT Modifiers, Fixed Changeling, Modified Counter as a cost
CDA Todo
2015-09-12 12:03:52 +08:00
Xawotihs
8b287cca0c Merge pull request #621 from kevlahnota/master
fixed Miscalculated PT, added Offering
2015-09-11 10:02:43 +02:00
Anthony Calosa
38145957af Update _tests.txt 2015-09-11 11:09:02 +08:00
Anthony Calosa
69bdac52c7 Create PT_M15_errata2.txt
Additional test
2015-09-11 11:07:48 +08:00
Anthony Calosa
10d7690ca6 Update PT_M15_errata.txt 2015-09-11 11:05:52 +08:00
Anthony Calosa
b33a999458 Finally PT Calculation is fixed :)
I didn't take into account that the new bonus must be calculated on the
event the effect was destroyed... silly me... 🉑
2015-09-11 10:53:36 +08:00
Anthony Calosa
d3a7ff7e11 reinitialize counters on destroy 2015-09-10 06:04:43 +08:00
Anthony Calosa
c1e9fad271 added basepower and basetoughness
added these two so if we want to access original power and toughness, we
can point to origpower and origtoughness respectively.
2015-09-10 05:26:09 +08:00
Anthony Calosa
9d668342be PT should work fine now... 2015-09-10 00:26:20 +08:00
Anthony Calosa
62dd54c886 Base Power/Toughness Template as of M15
208.4. Effects that set a creature’s power and/or toughness to specific
values may refer to that creature’s
“base power,” “base toughness,” or “base power and toughness.” Other
continuous effects may
further modify the creature’s power and toughness. See rule 613,
“Interaction of Continuous
Effects.”
2015-09-09 22:18:13 +08:00
Anthony Calosa
93ed2b3bff added test 2015-09-09 22:17:37 +08:00
Anthony Calosa
acb0aa0532 Merge remote-tracking branch 'WagicProject/master' 2015-09-08 19:19:31 +08:00
Anthony Calosa
ef707e6d5d added basic offering support
usage tap lands to produce mana then sacrifice an offering... example
you have Guttersnipe in play, it has a mana cost of {2}{R}, and you have
Patron of the Akki in hand that costs {4}{R}{R}. You need to produce
{2}{R} mana first before casting Patron of the Akki, then choose
Guttersnipe as an offering.
2015-09-08 12:26:03 +08:00
Xawotihs
56413c372f Merge pull request #619 from kevlahnota/master
added support for cards like leyline of the void, rest in peace, etc...
2015-09-07 20:09:36 +02:00
Anthony Calosa
a57e919e44 commented out unused variable... 2015-09-07 19:53:16 +08:00
Anthony Calosa
5bdb80db35 added DTK cards :) 2015-09-07 19:52:53 +08:00
Anthony Calosa
3f63997694 morethanfourcards for cards like black vise 2015-09-07 13:40:28 +08:00
Anthony Calosa
022a15a5e9 added epic cards, fixed maxcast bug
maxcast(*)0 - checks for the current action player of that turn, but
when you passes the turn to the opponent, you can cast instant or cards
with flash instead because you are not the current player, it mustcheck
the controller of the card with play restriction if he can play it or
not whether it your turn or the opponents turn.
2015-09-07 10:09:34 +08:00
xawotihs
a6c331042a Removed minizip directory, moved ZipArchive, updated xcode project and iOS makefile 2015-09-06 21:12:15 +02:00
Xawotihs
17f5d8f0c2 Fixed reachability include path 2015-09-05 09:21:42 +02:00
Anthony Calosa
45b880ef76 updated test 2015-09-05 07:23:35 +08:00
Anthony Calosa
da34530d98 added test for Gravebane Zombie 2015-09-05 07:20:28 +08:00
Anthony Calosa
bcb75dac65 updated test 2015-09-05 06:50:33 +08:00
Anthony Calosa
74bba5263a added test for leyline of the void and rest in peace and darksteel colossus 2015-09-05 06:44:10 +08:00
Anthony Calosa
7878252692 support for Rest in Peace
tokens are not cards...
a little dirty...
2015-09-04 23:45:16 +08:00
Anthony Calosa
7af6b31cca Merge remote-tracking branch 'WagicProject/master' 2015-09-04 23:41:37 +08:00
Anthony Calosa
11a9766ba0 adds support for darksteel colossus, gravebane zombie 2015-09-04 16:47:11 +08:00
Anthony Calosa
5175f439a0 add support for yawgmoth's agenda and other similar cards 2015-09-04 12:05:19 +08:00
Anthony Calosa
cbb603818a correction for untap cost
602.5a comprehensive rule as of  6/1/2014
2015-09-04 12:04:17 +08:00
xawotihs
7020121274 Merge branch 'master' into iOS-build 2015-09-04 00:04:59 +02:00
xawotihs
54f7030d68 Moved reachability files 2015-09-04 00:03:47 +02:00
Xawotihs
b9e23fcf95 Merge pull request #618 from kevlahnota/master
Life state check and multicolor attribute
2015-09-03 20:33:01 +02:00
Anthony Calosa
42d0480f77 refactored lifestate check 2015-09-03 20:12:09 +08:00
Anthony Calosa
886eaa4002 Update _tests.txt 2015-09-03 20:10:19 +08:00
Anthony Calosa
fd02e9ab22 Rename projects/mtg/bin/Res/test/bugs/exquisite_blood_i953.txt to projects/mtg/bin/Res/test/exquisite_blood_i953.txt 2015-09-03 20:07:31 +08:00
Anthony Calosa
9fb460c176 life state check on trigger
life state check when players gain or lose life
bugs\exquisite_blood_i953.txt will stop looping
as long as the conditions are met on the check
2015-09-03 07:01:45 +08:00
Anthony Calosa
cbb753ae75 Merge remote-tracking branch 'WagicProject/master' 2015-09-03 06:57:42 +08:00
Anthony Calosa
b2b54b7c5b attribute -multicolor will return single colored cards
use iscolorless to find colorless... :)
2015-08-31 22:03:41 +08:00
Anthony Calosa
29ac95362d multicolor correction
not multicolored is single colored or monocolored not colorless...
colorless has no color...
2015-08-31 19:06:51 +08:00
Xawotihs
9d2d6addb1 Merge pull request #617 from kevlahnota/master
additional test for sac event
2015-08-31 10:45:05 +02:00
Anthony Calosa
7c3f15f79b updated some cards
reflects the changes i made earlier, you can see the steps while running
them in test mode... mortician beetle, thraximundar and savra queen of
the golgari.
2015-08-31 07:51:12 +08:00
Xawotihs
c8e4ec14f0 Update Wagic_Version.h 2015-08-30 23:39:13 +02:00
Xawotihs
e1793fe276 Removed error on unknown warning option 2015-08-30 22:39:44 +02:00
Anthony Calosa
a7bb43278f fix bad lines 2015-08-31 01:51:36 +08:00
Xawotihs
58b5e99979 Fixed typo 2015-08-30 18:17:41 +02:00
Anthony Calosa
915befbb3a update savra 2015-08-30 23:59:05 +08:00
Xawotihs
4cf3f1bcd5 Should fix relative paths 2015-08-30 17:55:02 +02:00
xawotihs
bfeeaeabfb replaced .travis.yml for easier test and added the iOS makefile 2015-08-30 17:27:19 +02:00
Anthony Calosa
410f2d4e69 updated tests 2015-08-30 23:04:50 +08:00
Anthony Calosa
474ad5c0fe additional test for sacrificed event 2015-08-30 23:04:42 +08:00
Anthony Calosa
c2b359ceed Update _tests.txt
Added PTInstant test
2015-08-29 09:42:18 +08:00
Anthony Calosa
5af7de61d0 Added test for power toughness modifier
soul warden must be sent to graveyard due to last gasp before tundra wolves resolves and put onto the battlefield.
2015-08-29 09:35:51 +08:00
Anthony Calosa
7436bf9e64 added ORI _cards.dat 2015-08-27 11:07:18 +08:00
Anthony Calosa
588f7fe2fb remove token workaround 2015-08-26 23:40:30 +08:00
Xawotihs
30f5a49988 Merge pull request #614 from kevlahnota/master
added FRF
2015-08-24 17:56:32 +02:00
Anthony Calosa
2998e95a3b tokenizer should work now for cloning ability
Populate(Put a token onto the battlefield that's a copy of a creature
token you control.)
2015-08-24 22:39:54 +08:00
Anthony Calosa
ac29367ff8 update _tests.txt 2015-08-24 10:05:05 +08:00
Anthony Calosa
dbd7f82eab added tokenizer test 2015-08-24 10:03:34 +08:00
xawotihs
e28dd11b63 Merge branch 'master' into iOS-Build 2015-08-23 22:35:54 +02:00
xawotihs
907274f9bd Fixed cross-compiling with theos 2015-08-23 21:23:55 +02:00
Anthony Calosa
176b74489e added parallel lives
support token doubler... :)
2015-08-23 21:56:23 +08:00
Anthony Calosa
f940f8e303 some corrections
added Induce Paranoia, Draining Whelk
2015-08-22 23:40:31 +08:00
Anthony Calosa
2679213121 added FRF 2015-08-21 17:38:15 +08:00
Anthony Calosa
59c0cf467f serum powder code
serum powder second ability...
Any time you could mulligan and Serum Powder is in your hand, you may
exile all the cards from your hand, then draw that many cards.
2015-08-20 23:11:44 +08:00
Anthony Calosa
5a2637856f Merge remote-tracking branch 'WagicProject/master' 2015-08-20 23:09:12 +08:00
Anthony Calosa
26ecb199d3 Merge remote-tracking branch 'WagicProject/master' 2015-08-20 23:00:56 +08:00
Xawotihs
62d42fb61f Removed local check of mac branch 2015-08-17 23:53:11 +02:00
Xawotihs
19c96e496b More debug 2015-08-17 23:03:53 +02:00
Xawotihs
e982ba50be Removed a suspicous $ from the mac script 2015-08-17 22:27:39 +02:00
Xawotihs
27ad956034 More debug of the mac script 2015-08-17 21:57:29 +02:00
Xawotihs
8c6f694645 Replaced suspicious test 2015-08-16 21:11:41 +02:00
Xawotihs
8ce85636d9 More debug 2015-08-16 20:52:10 +02:00
Xawotihs
07683480b4 build => release => tag => build ... 2015-08-16 18:41:36 +02:00
Xawotihs
7d8fdbfd58 Restored branch removal and added some debug 2015-08-16 18:24:57 +02:00
Xawotihs
2a1cb03484 OMG what a stupid typo 2015-08-16 18:02:22 +02:00
Anthony Calosa
baa90fb605 added Ral Zarek 2015-08-16 14:57:34 +08:00
Anthony Calosa
1b67b736df Merge remote-tracking branch 'WagicProject/master' 2015-08-16 14:29:44 +08:00
Anthony Calosa
e6514a8b33 added gravecrawler
gravecrawler is supported :)
2015-08-16 14:17:26 +08:00
Xawotihs
636b07b350 Try to fix macosx branch deletion 2015-08-15 23:29:47 +02:00
Xawotihs
4b5478530c Merge pull request #612 from kevlahnota/master
Support of "formidable" abilities, added JOU, THS, M14 and fixed various cards.
2015-08-15 21:00:12 +02:00
Anthony Calosa
4a721a7e18 added KTK cards 2015-08-15 23:41:31 +08:00
Anthony Calosa
2470629afd Merge remote-tracking branch 'WagicProject/master' 2015-08-15 22:23:00 +08:00
Anthony Calosa
ccdd16bbc7 Used proper constant 2015-08-15 19:13:48 +08:00
Anthony Calosa
9cf6e621ab Removes viewing of tokens (rarity with T) on Spoiler 2015-08-15 14:51:26 +08:00
Anthony Calosa
94a97a3032 give credits
thanks KF1 and Tacoghandi
2015-08-15 08:18:35 +08:00
Anthony Calosa
f4ef7b9851 added M14 cards 2015-08-15 08:17:21 +08:00
Anthony Calosa
c2be7dd025 Fix M14 card dat 2015-08-15 08:07:36 +08:00
Anthony Calosa
b51dfc7733 added THS cards 2015-08-14 13:19:05 +08:00
Anthony Calosa
9999820a8f added missing cards from theros block 2015-08-13 23:19:20 +08:00
Anthony Calosa
10bc8283ed added JOU cards 2015-08-12 22:40:24 +08:00
Anthony Calosa
66f3ba5a7b removed id collision
avatar token already defined below ajani goldmane
2015-08-12 21:38:19 +08:00
Anthony Calosa
07f0175c5e fix bad line 2015-08-12 21:33:46 +08:00
Anthony Calosa
7376ac382f added missing copy cards 2015-08-12 20:53:30 +08:00
Anthony Calosa
3646219da4 Added missing devotion cards 2015-08-12 20:46:23 +08:00
Anthony Calosa
bfbc073593 added cards 2015-08-12 20:23:46 +08:00
Anthony Calosa
307be96fd6 Added Formidable cards 2015-08-12 20:16:07 +08:00
Anthony Calosa
22f4f21619 Added missing sets 2015-08-12 18:20:03 +08:00
Anthony Calosa
1738e216d0 Delete JOU 2015-08-12 18:05:45 +08:00
Anthony Calosa
567650357f Create JOU 2015-08-12 18:03:46 +08:00
Anthony Calosa
32de6ac124 Minor primitives correction
corrected some typo and added some cards
2015-08-12 17:32:42 +08:00
Anthony Calosa
60f3c87de1 Count Total Power of Creatures you control
example usage:  auto={4}{G}:4/4
restriction{compare(powertotalinplay)~morethan~7}
2015-08-10 22:44:27 +08:00
Xawotihs
d9561118bc Update appveyor.yml
Skip building macosx environment on windows
2015-07-20 22:32:25 +02:00
Xawotihs
228e5342fb Merge pull request #609 from WagicProject/CI-fixes
Ci fixes
2015-07-11 23:47:44 +02:00
Xawotihs
8574154071 Update .travis.yml 2015-07-11 21:58:30 +02:00
Xawotihs
80379ecde5 Update .travis.yml 2015-07-11 21:52:20 +02:00
Xawotihs
31b8ad248f Update .travis.yml
Fixed references to SDK package
2015-07-11 20:03:37 +02:00
Xawotihs
2d02f97f7f Update .travis.yml
Updated android SDK to 24.3.3
2015-07-11 18:51:11 +02:00
Xawotihs
6a37b5e461 Update .travis.yml
And a last one.
2015-07-11 18:36:34 +02:00
Xawotihs
38ed60bf63 Update .travis.yml
Add some \ to try fixing the script
2015-07-11 18:27:23 +02:00
Xawotihs
e664ecfaf5 Update .travis.yml
Updated android build tools to 22.0.1
2015-07-11 18:05:39 +02:00
Xawotihs
e2814c04f4 Merge pull request #607 from WagicProject/coverage
Adds test code coverage support
2014-12-31 13:57:14 +01:00
Xawotihs
8c2836b0c2 Update README.md
Added coverage status
2014-12-29 15:04:00 +01:00
Xawotihs
fcfab4c756 Update .travis.yml
Removed traces
2014-12-27 13:43:38 +01:00
Xawotihs
ddd59c489a Update .travis.yml
trying to fix gcov root
2014-12-27 12:17:03 +01:00
xawotihs
db922a0e77 Activated perf logs with qt console config 2014-12-27 11:47:54 +01:00
Xawotihs
793c4d1d7d Update .travis.yml
Added some traces
2014-12-27 10:39:16 +01:00
Xawotihs
24eab33b6d Update .travis.yml
updating coveralls options
2014-12-27 02:07:38 +01:00
Xawotihs
4985323ad9 Update .travis.yml
Tweaked coveralls config
2014-12-27 01:29:58 +01:00
Xawotihs
9fc551982b Update .travis.yml
Updated android sdk version
2014-12-26 21:23:11 +01:00
xawotihs
8ee67b5af8 Adds coverage support 2014-12-21 22:49:47 +01:00
xawotihs
78ad22479c Added changelog file 2014-12-09 22:18:51 +01:00
Xawotihs
2041aa45f0 Reactivated PSP build 2014-12-08 20:52:04 +01:00
xawotihs
c8b0ce9669 added sudo to install python packages on macosx 2014-12-08 00:10:48 +01:00
xawotihs
11eb6de57e Changed token and redirect push output 2014-12-07 23:33:46 +01:00
xawotihs
c451234bd5 Moved definition of origin 2014-12-07 22:47:04 +01:00
xawotihs
b56862fcf8 Added python dependencies, replaced token and removed "x" option in shell scripts 2014-12-07 22:26:39 +01:00
xawotihs
21a6da91ca Added git remote URL as HTTPS 2014-12-07 21:48:50 +01:00
xawotihs
410108a005 Added email and name to enable git commit 2014-12-07 21:06:53 +01:00
xawotihs
51d5b166a6 Deactivated PSP build and refactored build conditions 2014-12-07 20:29:27 +01:00
xawotihs
1f77243881 Fixed mac build script 2014-12-07 19:48:53 +01:00
xawotihs
f63afb2dd6 Merge branch 'mac-build' 2014-12-07 17:55:25 +01:00
xawotihs
dbe1c6e2ae Moved mac travis file outside of script and update oauth token 2014-12-07 17:26:32 +01:00
xawotihs
6a37425a38 Changed number of processes to 4 2014-12-07 16:48:57 +01:00
xawotihs
02efa4745f Fixed access to mac script and added mac branch to the list of branch authorized to upload binaries 2014-12-07 16:39:15 +01:00
xawotihs
e78754bcd5 Fixed mac script call 2014-12-07 16:24:39 +01:00
xawotihs
16dcf3cc5e - Moved scripts in tools directory
- Added a Mac cross-compiling script
2014-12-07 16:02:56 +01:00
xawotihs
03d168f972 Added MacOS bundle creation in Qt .pro file 2014-12-06 15:13:45 +01:00
Xawotihs
6f6c8b0eb6 Merge pull request #606 from kevlahnota/master
Fix for guild_keywords Devotion, added some "Chroma" cards
2014-12-05 07:47:37 +01:00
Anthony Calosa
fa14219e12 Fix for Devotion, added some "Chroma" cards 2014-12-05 10:18:05 +08:00
Xawotihs
15cd86fad1 Add traces at the end of the upload 2014-12-04 22:51:38 +01:00
Xawotihs
56ccebb720 Merge pull request #605 from kevlahnota/master
added guild keywords, added specific life cost
2014-12-03 07:37:55 +01:00
Anthony Calosa
8ef3789970 reverted sacred foundry 2014-12-03 07:54:13 +08:00
Anthony Calosa
ed7769c373 Revert "update sacred_foundry_i275.txt"
This reverts commit 5745006c35.
2014-12-03 07:47:00 +08:00
Anthony Calosa
5745006c35 update sacred_foundry_i275.txt 2014-12-02 19:19:05 +08:00
Anthony Calosa
16b243c52a Added bng cards to the main primitives. Removed bngGods.txt 2014-12-02 10:39:53 +08:00
Anthony Calosa
bc91eaf5ca updated card primitives that supports specific life cost 2014-11-29 07:10:02 +08:00
Anthony Calosa
6962d1e888 added cards, needs more testing before merging with the main primitives 2014-11-29 06:58:33 +08:00
Anthony Calosa
4d1e8dfb36 Update bngGods.txt
9/15/2013 	The type-changing ability that can make the God not be a creature functions only on the battlefield. It’s always a creature card in other zones, regardless of your devotion to its color.
2014-11-28 15:31:24 +08:00
Anthony Calosa
6ff6f95044 added Xenagos, God of Revels and Phenax, God of Deception for test purpose. 2014-11-28 14:34:37 +08:00
Anthony Calosa
5369983b35 Added BNG set 2014-11-28 14:19:04 +08:00
Anthony Calosa
46a8041c48 Added guild keyword gruul test for Xenagos, God of Revels. You must have Born of the gods set (BNG) 2014-11-28 14:00:58 +08:00
Anthony Calosa
84185a7c78 Added specific life cost test for griselbrand. Pls read note. 2014-11-28 13:35:13 +08:00
Anthony Calosa
4f41248978 Added specific life cost. if we use {l}{l}{l} to pay 3 life, and you have 2 life, you cannot afford to pay the cost but instead the game allows it. if we use specific life cost like: {l:3}, the restriction works. 2014-11-27 14:38:55 +08:00
Anthony Calosa
92d52a78be Update ExtraCost.cpp 2014-11-27 14:33:43 +08:00
Anthony Calosa
a76594046b Update ExtraCost.h 2014-11-27 14:31:25 +08:00
kevlahnota
2214ec66f1 Update AllAbilities.h
keywords for the "gods", "azorius" returns value of devotion to blue and white. ex. auto=azorius/dimir ueot
2014-11-27 11:31:19 +08:00
953 changed files with 183693 additions and 62209 deletions

View File

@@ -4,35 +4,65 @@ branches:
- latest-master
before_install:
- export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk"
- export PSPSDK="$PSPDEV/psp/sdk"
- export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin"
- export ANDROID="android-sdk-linux/tools/android"
- sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa
- sudo apt-get update -qq
- if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch jq; fi
- sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev qttools5-dev qtmultimedia5-dev pulseaudio libpulse-dev
- export QMAKE="qmake -qt=qt5"
- 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
- wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv
- wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz -nv
- export BUILD_PSP=YES
- export BUILD_ANDROID=YES
- export BUILD_Qt=YES
- export BUILD_MAC=NO
# Only building on Mac when not handling pull request
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
export BUILD_MAC=YES;
fi
- sudo apt-get update -qq
# 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://downloads.sourceforge.net/project/minpspw/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma;
fi
# Building for Qt here
- if [ "$BUILD_Qt" == "YES" ]; then
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty universe" &&
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty main" &&
sudo apt-get -qq update &&
sudo apt-get -qq install qt5-qmake qtbase5-dev qtdeclarative5-dev qttools5-dev qtmultimedia5-dev pulseaudio libpulse-dev &&
export QMAKE="qmake -qt=qt5";
fi
# Building for Android here
- if [ "$BUILD_ANDROID" == "YES" ]; then
export ANDROID="android-sdk-linux/tools/android" &&
if [ `uname -m` = x86_64 ]; then
sudo dpkg --add-architecture i386 && sudo apt-get update &&
sudo apt-get install -qq --force-yes libgd2-xpm-dev libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 jq; 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.4-linux.tgz -nv;
fi
install:
- tar -x --xz -f sdk.lzma
- tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2
- tar -zxf android-sdk_r23.0.2-linux.tgz
- $ANDROID list sdk --extended -a
- echo yes | $ANDROID update sdk --filter tools,platform-tools,build-tools-21.1.1,android-10 --no-ui --force --no-https
- 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.4-linux.tgz &&
$ANDROID list sdk --extended -a &&
echo yes | $ANDROID update sdk -a -t tools,platform-tools,build-tools-23.0.1,android-10 --no-ui --force --no-https;
fi
- sudo pip install pyjavaproperties
- sudo pip install github3.py
- sudo pip install cpp-coveralls
env:
global:
secure: "fJgWlCFbde96OSQNGKUmowGX+ERPeqP+n1EOMf1+FJzOU4DdkTLRAlV5+5qnEX9jB/3mWN6iPpmG1qEz/SdDG3KHxJYs4ZU/Lu485O24zZ/+GdYBNsrvhPD9ckPGEMLDa1foEVTDnW0Dlkz3BCFcszjhtXGUJv7v6Pj6LRk1Mg8="
- 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: "./travis-script.sh"
script: "tools/travis-script.sh"
after_success:
- python upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH
- python 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 upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/psprelease.zip -r Wagic-psp.zip -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 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
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l qt-gui-build/linuxqtrelease.zip -r Wagic-linux-QT.zip -b $TRAVIS_BRANCH

221
CHANGELOG.md Normal file
View File

@@ -0,0 +1,221 @@
# Changelog
## [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
- *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:* added guild keywords, added specific life cost [\#605](https://github.com/WagicProject/wagic/pull/605) ([kevlahnota](https://github.com/kevlahnota))
- *Merged pull-request:* Buyback issue and a fix [\#604](https://github.com/WagicProject/wagic/pull/604) ([apollovy](https://github.com/apollovy))
- *Merged pull-request:* Feature/ios update xcode5.1 [\#602](https://github.com/WagicProject/wagic/pull/602) ([mjnguyen](https://github.com/mjnguyen))
- *Merged pull-request:* Remove dead code and fix circular initialization [\#601](https://github.com/WagicProject/wagic/pull/601) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* update android build tools version [\#600](https://github.com/WagicProject/wagic/pull/600) ([Rolzad73](https://github.com/Rolzad73))
- *Merged pull-request:* Attempt to make android tools fetching for TravisCI explicit and futureproof [\#599](https://github.com/WagicProject/wagic/pull/599) ([Rolzad73](https://github.com/Rolzad73))
- *Merged pull-request:* Damager keyword [\#598](https://github.com/WagicProject/wagic/pull/598) ([bjornsnoen](https://github.com/bjornsnoen))
- *Merged pull-request:* Fix a rarity mistake and a grammatical error [\#596](https://github.com/WagicProject/wagic/pull/596) ([bjornsnoen](https://github.com/bjornsnoen))
- *Merged pull-request:* Fix bug where the phase wheel got out of sync [\#588](https://github.com/WagicProject/wagic/pull/588) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* More easing [\#586](https://github.com/WagicProject/wagic/pull/586) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* Added Avatar Tokens created by Ajani Goldmane. [\#585](https://github.com/WagicProject/wagic/pull/585) ([bjornsnoen](https://github.com/bjornsnoen))
- *Merged pull-request:* Cleanup, usability fixes and source code documentation for DeckView.h and GridDeckView.h [\#583](https://github.com/WagicProject/wagic/pull/583) ([ZobyTwo](https://github.com/ZobyTwo))
- *Fixed bug:* Blight does not destroy at the end of turn but right now [\#592](https://github.com/WagicProject/wagic/issues/592)
- *Fixed bug:* game freezes on Android when the phone returns from "sleep mode" [\#544](https://github.com/WagicProject/wagic/issues/544)
- *Fixed bug:* Android port needs to be able to respond to attaching/detaching devices to it [\#522](https://github.com/WagicProject/wagic/issues/522)
## [alpha-195] (https://github.com/WagicProject/wagic/tree/alpha-195)
#### 07/12/13
- *Merged pull-request:* Reset positions and filters when reopening the editor [\#578](https://github.com/WagicProject/wagic/pull/578) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* Deck viewer [\#577](https://github.com/WagicProject/wagic/pull/577) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* Do not specify the system directory in JGE [\#576](https://github.com/WagicProject/wagic/pull/576) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* Changed Travis build file to use Android API 10 and Android build tools 18.1.1 [\#575](https://github.com/WagicProject/wagic/pull/575) ([Rolzad73](https://github.com/Rolzad73))
- *Merged pull-request:* Feature/play from grave [\#574](https://github.com/WagicProject/wagic/pull/574) ([pankdm](https://github.com/pankdm))
- *Merged pull-request:* Fix Valgrind warnings appearing during the test suit. [\#573](https://github.com/WagicProject/wagic/pull/573) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* Strings 2 [\#572](https://github.com/WagicProject/wagic/pull/572) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* Android travis ci [\#570](https://github.com/WagicProject/wagic/pull/570) ([xawotihs](https://github.com/xawotihs))
- *Merged pull-request:* Android NDK build fix [\#569](https://github.com/WagicProject/wagic/pull/569) ([Rolzad73](https://github.com/Rolzad73))
- *Merged pull-request:* Add a few namespaces and fix header guards. [\#564](https://github.com/WagicProject/wagic/pull/564) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* Updated deckmenu.cpp to properly render deck description and summary [\#562](https://github.com/WagicProject/wagic/pull/562) ([citiral](https://github.com/citiral))
- *Merged pull-request:* Fix some valgrind memcheck warnings. However there remains one... [\#561](https://github.com/WagicProject/wagic/pull/561) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* Remove some dead code [\#560](https://github.com/WagicProject/wagic/pull/560) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* Show output only for failing tests [\#559](https://github.com/WagicProject/wagic/pull/559) ([pankdm](https://github.com/pankdm))
- *Merged pull-request:* Defines/Typos [\#557](https://github.com/WagicProject/wagic/pull/557) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* Simplify Damage::resolve a bit [\#556](https://github.com/WagicProject/wagic/pull/556) ([ZobyTwo](https://github.com/ZobyTwo))
- *Merged pull-request:* Fix cranial plating [\#555](https://github.com/WagicProject/wagic/pull/555) ([pankdm](https://github.com/pankdm))
- *Merged pull-request:* Android cleanup [\#1](https://github.com/WagicProject/wagic/pull/1) ([Rolzad73](https://github.com/Rolzad73))
- *Fixed bug:* Iona and Nin don't work [\#527](https://github.com/WagicProject/wagic/issues/527)
- *Closed issue:* Less verbose output of tests at Travis [\#558](https://github.com/WagicProject/wagic/issues/558)
## [wagic-0.19.2] (https://github.com/WagicProject/wagic/tree/wagic-v0.19.2)
#### 28/10/13

View File

@@ -77,6 +77,13 @@ SDL_AtomicTryLock(SDL_SpinLock *lock)
: "=&r" (result) : "r" (1), "r" (lock) : "cc", "memory");
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
/* Need CPU instructions for spinlock here! */
__need_spinlock_implementation__

View File

@@ -150,7 +150,7 @@ console_main(int argc, char *argv[])
/* This is where execution begins [windowed apps] */
int WINAPI
WinMain(HINSTANCE hInst,HINSTANCE hPrev,LPSTR szCmdLine,int sw)
WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int sw)
{
char **argv;
int argc;

View File

@@ -77,11 +77,10 @@
#ifdef XP_MAC /* Macintosh */
#define ALIGN_TYPE long /* for sane memory alignment */
#define NO_GETENV /* we do have the function, but it's dead */
#endif /* XP_MAC */
#define NO_GETENV /* we don't care of that feature */
#endif /* JPEG_INTERNALS */

View File

@@ -1,196 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1DE5241B-2F18-4662-A196-F5C2A26CE5D6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>libjpeg</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110_wp80</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="jcapimin.c" />
<ClCompile Include="jcapistd.c" />
<ClCompile Include="jccoefct.c" />
<ClCompile Include="jccolor.c" />
<ClCompile Include="jcdctmgr.c" />
<ClCompile Include="jchuff.c" />
<ClCompile Include="jcinit.c" />
<ClCompile Include="jcmainct.c" />
<ClCompile Include="jcmarker.c" />
<ClCompile Include="jcmaster.c" />
<ClCompile Include="jcomapi.c" />
<ClCompile Include="jcparam.c" />
<ClCompile Include="jcphuff.c" />
<ClCompile Include="jcprepct.c" />
<ClCompile Include="jcsample.c" />
<ClCompile Include="jdapimin.c" />
<ClCompile Include="jdapistd.c" />
<ClCompile Include="jdatadst.c" />
<ClCompile Include="jdatasrc.c" />
<ClCompile Include="jdcoefct.c" />
<ClCompile Include="jdcolor.c" />
<ClCompile Include="jddctmgr.c" />
<ClCompile Include="jdhuff.c" />
<ClCompile Include="jdinput.c" />
<ClCompile Include="jdmainct.c" />
<ClCompile Include="jdmarker.c" />
<ClCompile Include="jdmaster.c" />
<ClCompile Include="jdmerge.c" />
<ClCompile Include="jdphuff.c" />
<ClCompile Include="jdpostct.c" />
<ClCompile Include="jdsample.c" />
<ClCompile Include="jerror.c" />
<ClCompile Include="jfdctflt.c" />
<ClCompile Include="jfdctfst.c" />
<ClCompile Include="jfdctint.c" />
<ClCompile Include="jidctflt.c" />
<ClCompile Include="jidctfst.c" />
<ClCompile Include="jidctint.c" />
<ClCompile Include="jidctred.c" />
<ClCompile Include="jmemmgr.c" />
<ClCompile Include="jmemnobs.c" />
<ClCompile Include="jquant1.c" />
<ClCompile Include="jquant2.c" />
<ClCompile Include="jutils.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="jchuff.h" />
<ClInclude Include="jconfig.h" />
<ClInclude Include="jdct.h" />
<ClInclude Include="jdhuff.h" />
<ClInclude Include="jerror.h" />
<ClInclude Include="jinclude.h" />
<ClInclude Include="jmemsys.h" />
<ClInclude Include="jmorecfg.h" />
<ClInclude Include="jpegint.h" />
<ClInclude Include="jpeglib.h" />
<ClInclude Include="jversion.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,165 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{6BEE6FBA-C260-4A82-A8DA-6463F4FFA470}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>libpng</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110_wp80</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../zlib</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../zlib</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../zlib</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../zlib</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="png.c" />
<ClCompile Include="pngerror.c" />
<ClCompile Include="pnggccrd.c" />
<ClCompile Include="pngget.c" />
<ClCompile Include="pngmem.c" />
<ClCompile Include="pngpread.c" />
<ClCompile Include="pngread.c" />
<ClCompile Include="pngrio.c" />
<ClCompile Include="pngrtran.c" />
<ClCompile Include="pngrutil.c" />
<ClCompile Include="pngset.c" />
<ClCompile Include="pngtrans.c" />
<ClCompile Include="pngvcrd.c" />
<ClCompile Include="pngwio.c" />
<ClCompile Include="pngwrite.c" />
<ClCompile Include="pngwtran.c" />
<ClCompile Include="pngwutil.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="png.h" />
<ClInclude Include="pngconf.h" />
<ClInclude Include="pngusr.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,249 +0,0 @@
cmake_minimum_required(VERSION 2.4.4)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
project(zlib C)
set(VERSION "1.2.8")
option(ASM686 "Enable building i686 assembly implementation")
option(AMD64 "Enable building amd64 assembly implementation")
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages")
set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
include(CheckTypeSize)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckCSourceCompiles)
enable_testing()
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_H)
#
# Check to see if we have large file support
#
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
# We add these other definitions here because CheckTypeSize.cmake
# in CMake 2.4.x does not automatically do so and we want
# compatibility with CMake 2.4.x.
if(HAVE_SYS_TYPES_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
endif()
if(HAVE_STDINT_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
endif()
if(HAVE_STDDEF_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
endif()
check_type_size(off64_t OFF64_T)
if(HAVE_OFF64_T)
add_definitions(-D_LARGEFILE64_SOURCE=1)
endif()
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
#
# Check for fseeko
#
check_function_exists(fseeko HAVE_FSEEKO)
if(NOT HAVE_FSEEKO)
add_definitions(-DNO_FSEEKO)
endif()
#
# Check for unistd.h
#
check_include_file(unistd.h Z_HAVE_UNISTD_H)
if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
endif()
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
# If we're doing an out of source build and the user has a zconf.h
# in their source tree...
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
message(STATUS "Renaming")
message(STATUS " ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h")
message(STATUS "to 'zconf.h.included' because this file is included with zlib")
message(STATUS "but CMake generates it automatically in the build directory.")
file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.included)
endif()
endif()
set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
${ZLIB_PC} @ONLY)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
#============================================================================
# zlib
#============================================================================
set(ZLIB_PUBLIC_HDRS
${CMAKE_CURRENT_BINARY_DIR}/zconf.h
zlib.h
)
set(ZLIB_PRIVATE_HDRS
crc32.h
deflate.h
gzguts.h
inffast.h
inffixed.h
inflate.h
inftrees.h
trees.h
zutil.h
)
set(ZLIB_SRCS
adler32.c
compress.c
crc32.c
deflate.c
gzclose.c
gzlib.c
gzread.c
gzwrite.c
inflate.c
infback.c
inftrees.c
inffast.c
trees.c
uncompr.c
zutil.c
)
if(NOT MINGW)
set(ZLIB_DLL_SRCS
win32/zlib1.rc # If present will override custom build rule below.
)
endif()
if(CMAKE_COMPILER_IS_GNUCC)
if(ASM686)
set(ZLIB_ASMS contrib/asm686/match.S)
elseif (AMD64)
set(ZLIB_ASMS contrib/amd64/amd64-match.S)
endif ()
if(ZLIB_ASMS)
add_definitions(-DASMV)
set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)
endif()
endif()
if(MSVC)
if(ASM686)
ENABLE_LANGUAGE(ASM_MASM)
set(ZLIB_ASMS
contrib/masmx86/inffas32.asm
contrib/masmx86/match686.asm
)
elseif (AMD64)
ENABLE_LANGUAGE(ASM_MASM)
set(ZLIB_ASMS
contrib/masmx64/gvmat64.asm
contrib/masmx64/inffasx64.asm
)
endif()
if(ZLIB_ASMS)
add_definitions(-DASMV -DASMINF)
endif()
endif()
# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
"\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
if(MINGW)
# This gets us DLL resource information when compiling on MinGW.
if(NOT CMAKE_RC_COMPILER)
set(CMAKE_RC_COMPILER windres.exe)
endif()
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
COMMAND ${CMAKE_RC_COMPILER}
-D GCC_WINDRES
-I ${CMAKE_CURRENT_SOURCE_DIR}
-I ${CMAKE_CURRENT_BINARY_DIR}
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
endif(MINGW)
add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
set_target_properties(zlib PROPERTIES SOVERSION 1)
if(NOT CYGWIN)
# This property causes shared libraries on Linux to have the full version
# encoded into their final filename. We disable this on Cygwin because
# it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll
# seems to be the default.
#
# This has no effect with MSVC, on that platform the version info for
# the DLL comes from the resource file win32/zlib1.rc
set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
endif()
if(UNIX)
# On unix-like platforms the library is almost always called libz
set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
if(NOT APPLE)
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
elseif(BUILD_SHARED_LIBS AND WIN32)
# Creates zlib1.dll when building shared library version
set_target_properties(zlib PROPERTIES SUFFIX "1.dll")
endif()
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
install(TARGETS zlib zlibstatic
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION "${INSTALL_INC_DIR}")
endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
install(FILES zlib.3 DESTINATION "${INSTALL_MAN_DIR}/man3")
endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
install(FILES ${ZLIB_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}")
endif()
#============================================================================
# Example binaries
#============================================================================
add_executable(example test/example.c)
target_link_libraries(example zlib)
add_test(example example)
add_executable(minigzip test/minigzip.c)
target_link_libraries(minigzip zlib)
if(HAVE_OFF64_T)
add_executable(example64 test/example.c)
target_link_libraries(example64 zlib)
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
add_test(example64 example64)
add_executable(minigzip64 test/minigzip.c)
target_link_libraries(minigzip64 zlib)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()

File diff suppressed because it is too large Load Diff

View File

@@ -1,368 +0,0 @@
Frequently Asked Questions about zlib
If your question is not there, please check the zlib home page
http://zlib.net/ which may have more recent information.
The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
1. Is zlib Y2K-compliant?
Yes. zlib doesn't handle dates.
2. Where can I get a Windows DLL version?
The zlib sources can be compiled without change to produce a DLL. See the
file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the
precompiled DLL are found in the zlib web site at http://zlib.net/ .
3. Where can I get a Visual Basic interface to zlib?
See
* http://marknelson.us/1997/01/01/zlib-engine/
* win32/DLL_FAQ.txt in the zlib distribution
4. compress() returns Z_BUF_ERROR.
Make sure that before the call of compress(), the length of the compressed
buffer is equal to the available size of the compressed buffer and not
zero. For Visual Basic, check that this parameter is passed by reference
("as any"), not by value ("as long").
5. deflate() or inflate() returns Z_BUF_ERROR.
Before making the call, make sure that avail_in and avail_out are not zero.
When setting the parameter flush equal to Z_FINISH, also make sure that
avail_out is big enough to allow processing all pending input. Note that a
Z_BUF_ERROR is not fatal--another call to deflate() or inflate() can be
made with more input or output space. A Z_BUF_ERROR may in fact be
unavoidable depending on how the functions are used, since it is not
possible to tell whether or not there is more output pending when
strm.avail_out returns with zero. See http://zlib.net/zlib_how.html for a
heavily annotated example.
6. Where's the zlib documentation (man pages, etc.)?
It's in zlib.h . Examples of zlib usage are in the files test/example.c
and test/minigzip.c, with more in examples/ .
7. Why don't you use GNU autoconf or libtool or ...?
Because we would like to keep zlib as a very small and simple package.
zlib is rather portable and doesn't need much configuration.
8. I found a bug in zlib.
Most of the time, such problems are due to an incorrect usage of zlib.
Please try to reproduce the problem with a small program and send the
corresponding source to us at zlib@gzip.org . Do not send multi-megabyte
data files without prior agreement.
9. Why do I get "undefined reference to gzputc"?
If "make test" produces something like
example.o(.text+0x154): undefined reference to `gzputc'
check that you don't have old files libz.* in /usr/lib, /usr/local/lib or
/usr/X11R6/lib. Remove any old versions, then do "make install".
10. I need a Delphi interface to zlib.
See the contrib/delphi directory in the zlib distribution.
11. Can zlib handle .zip archives?
Not by itself, no. See the directory contrib/minizip in the zlib
distribution.
12. Can zlib handle .Z files?
No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt
the code of uncompress on your own.
13. How can I make a Unix shared library?
By default a shared (and a static) library is built for Unix. So:
make distclean
./configure
make
14. How do I install a shared zlib library on Unix?
After the above, then:
make install
However, many flavors of Unix come with a shared zlib already installed.
Before going to the trouble of compiling a shared version of zlib and
trying to install it, you may want to check if it's already there! If you
can #include <zlib.h>, it's there. The -lz option will probably link to
it. You can check the version at the top of zlib.h or with the
ZLIB_VERSION symbol defined in zlib.h .
15. I have a question about OttoPDF.
We are not the authors of OttoPDF. The real author is on the OttoPDF web
site: Joel Hainley, jhainley@myndkryme.com.
16. Can zlib decode Flate data in an Adobe PDF file?
Yes. See http://www.pdflib.com/ . To modify PDF forms, see
http://sourceforge.net/projects/acroformtool/ .
17. Why am I getting this "register_frame_info not found" error on Solaris?
After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib
generates an error such as:
ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so:
symbol __register_frame_info: referenced symbol not found
The symbol __register_frame_info is not part of zlib, it is generated by
the C compiler (cc or gcc). You must recompile applications using zlib
which have this problem. This problem is specific to Solaris. See
http://www.sunfreeware.com for Solaris versions of zlib and applications
using zlib.
18. Why does gzip give an error on a file I make with compress/deflate?
The compress and deflate functions produce data in the zlib format, which
is different and incompatible with the gzip format. The gz* functions in
zlib on the other hand use the gzip format. Both the zlib and gzip formats
use the same compressed data format internally, but have different headers
and trailers around the compressed data.
19. Ok, so why are there two different formats?
The gzip format was designed to retain the directory information about a
single file, such as the name and last modification date. The zlib format
on the other hand was designed for in-memory and communication channel
applications, and has a much more compact header and trailer and uses a
faster integrity check than gzip.
20. Well that's nice, but how do I make a gzip file in memory?
You can request that deflate write the gzip format instead of the zlib
format using deflateInit2(). You can also request that inflate decode the
gzip format using inflateInit2(). Read zlib.h for more details.
21. Is zlib thread-safe?
Yes. However any library routines that zlib uses and any application-
provided memory allocation routines must also be thread-safe. zlib's gz*
functions use stdio library routines, and most of zlib's functions use the
library memory allocation routines by default. zlib's *Init* functions
allow for the application to provide custom memory allocation routines.
Of course, you should only operate on any given zlib or gzip stream from a
single thread at a time.
22. Can I use zlib in my commercial application?
Yes. Please read the license in zlib.h.
23. Is zlib under the GNU license?
No. Please read the license in zlib.h.
24. The license says that altered source versions must be "plainly marked". So
what exactly do I need to do to meet that requirement?
You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In
particular, the final version number needs to be changed to "f", and an
identification string should be appended to ZLIB_VERSION. Version numbers
x.x.x.f are reserved for modifications to zlib by others than the zlib
maintainers. For example, if the version of the base zlib you are altering
is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and
ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also
update the version strings in deflate.c and inftrees.c.
For altered source distributions, you should also note the origin and
nature of the changes in zlib.h, as well as in ChangeLog and README, along
with the dates of the alterations. The origin should include at least your
name (or your company's name), and an email address to contact for help or
issues with the library.
Note that distributing a compiled zlib library along with zlib.h and
zconf.h is also a source distribution, and so you should change
ZLIB_VERSION and ZLIB_VERNUM and note the origin and nature of the changes
in zlib.h as you would for a full source distribution.
25. Will zlib work on a big-endian or little-endian architecture, and can I
exchange compressed data between them?
Yes and yes.
26. Will zlib work on a 64-bit machine?
Yes. It has been tested on 64-bit machines, and has no dependence on any
data types being limited to 32-bits in length. If you have any
difficulties, please provide a complete problem report to zlib@gzip.org
27. Will zlib decompress data from the PKWare Data Compression Library?
No. The PKWare DCL uses a completely different compressed data format than
does PKZIP and zlib. However, you can look in zlib's contrib/blast
directory for a possible solution to your problem.
28. Can I access data randomly in a compressed stream?
No, not without some preparation. If when compressing you periodically use
Z_FULL_FLUSH, carefully write all the pending data at those points, and
keep an index of those locations, then you can start decompression at those
points. You have to be careful to not use Z_FULL_FLUSH too often, since it
can significantly degrade compression. Alternatively, you can scan a
deflate stream once to generate an index, and then use that index for
random access. See examples/zran.c .
29. Does zlib work on MVS, OS/390, CICS, etc.?
It has in the past, but we have not heard of any recent evidence. There
were working ports of zlib 1.1.4 to MVS, but those links no longer work.
If you know of recent, successful applications of zlib on these operating
systems, please let us know. Thanks.
30. Is there some simpler, easier to read version of inflate I can look at to
understand the deflate format?
First off, you should read RFC 1951. Second, yes. Look in zlib's
contrib/puff directory.
31. Does zlib infringe on any patents?
As far as we know, no. In fact, that was originally the whole point behind
zlib. Look here for some more information:
http://www.gzip.org/#faq11
32. Can zlib work with greater than 4 GB of data?
Yes. inflate() and deflate() will process any amount of data correctly.
Each call of inflate() or deflate() is limited to input and output chunks
of the maximum value that can be stored in the compiler's "unsigned int"
type, but there is no limit to the number of chunks. Note however that the
strm.total_in and strm_total_out counters may be limited to 4 GB. These
counters are provided as a convenience and are not used internally by
inflate() or deflate(). The application can easily set up its own counters
updated after each call of inflate() or deflate() to count beyond 4 GB.
compress() and uncompress() may be limited to 4 GB, since they operate in a
single call. gzseek() and gztell() may be limited to 4 GB depending on how
zlib is compiled. See the zlibCompileFlags() function in zlib.h.
The word "may" appears several times above since there is a 4 GB limit only
if the compiler's "long" type is 32 bits. If the compiler's "long" type is
64 bits, then the limit is 16 exabytes.
33. Does zlib have any security vulnerabilities?
The only one that we are aware of is potentially in gzprintf(). If zlib is
compiled to use sprintf() or vsprintf(), then there is no protection
against a buffer overflow of an 8K string space (or other value as set by
gzbuffer()), other than the caller of gzprintf() assuring that the output
will not exceed 8K. On the other hand, if zlib is compiled to use
snprintf() or vsnprintf(), which should normally be the case, then there is
no vulnerability. The ./configure script will display warnings if an
insecure variation of sprintf() will be used by gzprintf(). Also the
zlibCompileFlags() function will return information on what variant of
sprintf() is used by gzprintf().
If you don't have snprintf() or vsnprintf() and would like one, you can
find a portable implementation here:
http://www.ijs.si/software/snprintf/
Note that you should be using the most recent version of zlib. Versions
1.1.3 and before were subject to a double-free vulnerability, and versions
1.2.1 and 1.2.2 were subject to an access exception when decompressing
invalid compressed data.
34. Is there a Java version of zlib?
Probably what you want is to use zlib in Java. zlib is already included
as part of the Java SDK in the java.util.zip package. If you really want
a version of zlib written in the Java language, look on the zlib home
page for links: http://zlib.net/ .
35. I get this or that compiler or source-code scanner warning when I crank it
up to maximally-pedantic. Can't you guys write proper code?
Many years ago, we gave up attempting to avoid warnings on every compiler
in the universe. It just got to be a waste of time, and some compilers
were downright silly as well as contradicted each other. So now, we simply
make sure that the code always works.
36. Valgrind (or some similar memory access checker) says that deflate is
performing a conditional jump that depends on an uninitialized value.
Isn't that a bug?
No. That is intentional for performance reasons, and the output of deflate
is not affected. This only started showing up recently since zlib 1.2.x
uses malloc() by default for allocations, whereas earlier versions used
calloc(), which zeros out the allocated memory. Even though the code was
correct, versions 1.2.4 and later was changed to not stimulate these
checkers.
37. Will zlib read the (insert any ancient or arcane format here) compressed
data format?
Probably not. Look in the comp.compression FAQ for pointers to various
formats and associated software.
38. How can I encrypt/decrypt zip files with zlib?
zlib doesn't support encryption. The original PKZIP encryption is very
weak and can be broken with freely available programs. To get strong
encryption, use GnuPG, http://www.gnupg.org/ , which already includes zlib
compression. For PKZIP compatible "encryption", look at
http://www.info-zip.org/
39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings?
"gzip" is the gzip format, and "deflate" is the zlib format. They should
probably have called the second one "zlib" instead to avoid confusion with
the raw deflate compressed data format. While the HTTP 1.1 RFC 2616
correctly points to the zlib specification in RFC 1950 for the "deflate"
transfer encoding, there have been reports of servers and browsers that
incorrectly produce or expect raw deflate data per the deflate
specification in RFC 1951, most notably Microsoft. So even though the
"deflate" transfer encoding using the zlib format would be the more
efficient approach (and in fact exactly what the zlib format was designed
for), using the "gzip" transfer encoding is probably more reliable due to
an unfortunate choice of name on the part of the HTTP 1.1 authors.
Bottom line: use the gzip format for HTTP 1.1 encoding.
40. Does zlib support the new "Deflate64" format introduced by PKWare?
No. PKWare has apparently decided to keep that format proprietary, since
they have not documented it as they have previous compression formats. In
any case, the compression improvements are so modest compared to other more
modern approaches, that it's not worth the effort to implement.
41. I'm having a problem with the zip functions in zlib, can you help?
There are no zip functions in zlib. You are probably using minizip by
Giles Vollant, which is found in the contrib directory of zlib. It is not
part of zlib. In fact none of the stuff in contrib is part of zlib. The
files in there are not supported by the zlib authors. You need to contact
the authors of the respective contribution for help.
42. The match.asm code in contrib is under the GNU General Public License.
Since it's part of zlib, doesn't that mean that all of zlib falls under the
GNU GPL?
No. The files in contrib are not part of zlib. They were contributed by
other authors and are provided as a convenience to the user within the zlib
distribution. Each item in contrib has its own license.
43. Is zlib subject to export controls? What is its ECCN?
zlib is not subject to export controls, and so is classified as EAR99.
44. Can you please sign these lengthy legal documents and fax them back to us
so that we can use your software in our product?
No. Go away. Shoo.

View File

@@ -1,68 +0,0 @@
CMakeLists.txt cmake build file
ChangeLog history of changes
FAQ Frequently Asked Questions about zlib
INDEX this file
Makefile dummy Makefile that tells you to ./configure
Makefile.in template for Unix Makefile
README guess what
configure configure script for Unix
make_vms.com makefile for VMS
test/example.c zlib usages examples for build testing
test/minigzip.c minimal gzip-like functionality for build testing
test/infcover.c inf*.c code coverage for build coverage testing
treebuild.xml XML description of source file dependencies
zconf.h.cmakein zconf.h template for cmake
zconf.h.in zconf.h template for configure
zlib.3 Man page for zlib
zlib.3.pdf Man page in PDF format
zlib.map Linux symbol information
zlib.pc.in Template for pkg-config descriptor
zlib.pc.cmakein zlib.pc template for cmake
zlib2ansi perl script to convert source files for C++ compilation
amiga/ makefiles for Amiga SAS C
as400/ makefiles for AS/400
doc/ documentation for formats and algorithms
msdos/ makefiles for MSDOS
nintendods/ makefile for Nintendo DS
old/ makefiles for various architectures and zlib documentation
files that have not yet been updated for zlib 1.2.x
qnx/ makefiles for QNX
watcom/ makefiles for OpenWatcom
win32/ makefiles for Windows
zlib public header files (required for library use):
zconf.h
zlib.h
private source files used to build the zlib library:
adler32.c
compress.c
crc32.c
crc32.h
deflate.c
deflate.h
gzclose.c
gzguts.h
gzlib.c
gzread.c
gzwrite.c
infback.c
inffast.c
inffast.h
inffixed.h
inflate.c
inflate.h
inftrees.c
inftrees.h
trees.c
trees.h
uncompr.c
zutil.c
zutil.h
source files for sample programs
See examples/README.examples
unsupported contributions by third parties
See contrib/README.contrib

View File

@@ -1,5 +0,0 @@
all:
-@echo "Please use ./configure first. Thank you."
distclean:
make -f Makefile.in distclean

View File

@@ -1,288 +0,0 @@
# Makefile for zlib
# Copyright (C) 1995-2013 Jean-loup Gailly, Mark Adler
# For conditions of distribution and use, see copyright notice in zlib.h
# To compile and test, type:
# ./configure; make test
# Normally configure builds both a static and a shared library.
# If you want to build just a static library, use: ./configure --static
# To use the asm code, type:
# cp contrib/asm?86/match.S ./match.S
# make LOC=-DASMV OBJA=match.o
# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
# make install
# To install in $HOME instead of /usr/local, use:
# make install prefix=$HOME
CC=cc
CFLAGS=-O
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
#CFLAGS=-g -DDEBUG
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
# -Wstrict-prototypes -Wmissing-prototypes
SFLAGS=-O
LDFLAGS=
TEST_LDFLAGS=-L. libz.a
LDSHARED=$(CC)
CPP=$(CC) -E
STATICLIB=libz.a
SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.2.8
SHAREDLIBM=libz.so.1
LIBS=$(STATICLIB) $(SHAREDLIBV)
AR=ar
ARFLAGS=rc
RANLIB=ranlib
LDCONFIG=ldconfig
LDSHAREDLIBC=-lc
TAR=tar
SHELL=/bin/sh
EXE=
prefix = /usr/local
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
sharedlibdir = ${libdir}
includedir = ${prefix}/include
mandir = ${prefix}/share/man
man3dir = ${mandir}/man3
pkgconfigdir = ${libdir}/pkgconfig
OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
OBJC = $(OBJZ) $(OBJG)
PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo
PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo
PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG)
# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
OBJA =
PIC_OBJA =
OBJS = $(OBJC) $(OBJA)
PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
all: static shared
static: example$(EXE) minigzip$(EXE)
shared: examplesh$(EXE) minigzipsh$(EXE)
all64: example64$(EXE) minigzip64$(EXE)
check: test
test: all teststatic testshared
teststatic: static
@TMPST=tmpst_$$; \
if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
echo ' *** zlib test OK ***'; \
else \
echo ' *** zlib test FAILED ***'; false; \
fi; \
rm -f $$TMPST
testshared: shared
@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
TMPSH=tmpsh_$$; \
if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
echo ' *** zlib shared test OK ***'; \
else \
echo ' *** zlib shared test FAILED ***'; false; \
fi; \
rm -f $$TMPSH
test64: all64
@TMP64=tmp64_$$; \
if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
echo ' *** zlib 64-bit test OK ***'; \
else \
echo ' *** zlib 64-bit test FAILED ***'; false; \
fi; \
rm -f $$TMP64
infcover.o: test/infcover.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -c -o $@ test/infcover.c
infcover: infcover.o libz.a
$(CC) $(CFLAGS) -o $@ infcover.o libz.a
cover: infcover
rm -f *.gcda
./infcover
gcov inf*.c
libz.a: $(OBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
match.o: match.S
$(CPP) match.S > _match.s
$(CC) -c _match.s
mv _match.o match.o
rm -f _match.s
match.lo: match.S
$(CPP) match.S > _match.s
$(CC) -c -fPIC _match.s
mv _match.o match.lo
rm -f _match.s
example.o: test/example.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -c -o $@ test/example.c
minigzip.o: test/minigzip.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c
example64.o: test/example.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/example.c
minigzip64.o: test/minigzip.c zlib.h zconf.h
$(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/minigzip.c
.SUFFIXES: .lo
.c.lo:
-@mkdir objs 2>/dev/null || test -d objs
$(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
-@mv objs/$*.o $@
placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
rm -f $(SHAREDLIB) $(SHAREDLIBM)
ln -s $@ $(SHAREDLIB)
ln -s $@ $(SHAREDLIBM)
-@rmdir objs
example$(EXE): example.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
minigzip$(EXE): minigzip.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
examplesh$(EXE): example.o $(SHAREDLIBV)
$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
example64$(EXE): example64.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
minigzip64$(EXE): minigzip64.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
install-libs: $(LIBS)
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
-@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
-@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
-@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
cp $(STATICLIB) $(DESTDIR)$(libdir)
chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
-@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1
-@if test -n "$(SHAREDLIBV)"; then \
cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \
echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \
chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \
rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
($(LDCONFIG) || true) >/dev/null 2>&1; \
fi
cp zlib.3 $(DESTDIR)$(man3dir)
chmod 644 $(DESTDIR)$(man3dir)/zlib.3
cp zlib.pc $(DESTDIR)$(pkgconfigdir)
chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
# The ranlib in install is needed on NeXTSTEP which checks file times
# ldconfig is for Linux
install: install-libs
-@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
cp zlib.h zconf.h $(DESTDIR)$(includedir)
chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
uninstall:
cd $(DESTDIR)$(includedir) && rm -f zlib.h zconf.h
cd $(DESTDIR)$(libdir) && rm -f libz.a; \
if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
fi
cd $(DESTDIR)$(man3dir) && rm -f zlib.3
cd $(DESTDIR)$(pkgconfigdir) && rm -f zlib.pc
docs: zlib.3.pdf
zlib.3.pdf: zlib.3
groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf
zconf.h.cmakein: zconf.h.in
-@ TEMPFILE=zconfh_$$; \
echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
sed -f $$TEMPFILE zconf.h.in > zconf.h.cmakein &&\
touch -r zconf.h.in zconf.h.cmakein &&\
rm $$TEMPFILE
zconf: zconf.h.in
cp -p zconf.h.in zconf.h
mostlyclean: clean
clean:
rm -f *.o *.lo *~ \
example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
example64$(EXE) minigzip64$(EXE) \
infcover \
libz.* foo.gz so_locations \
_match.s maketree contrib/infback9/*.o
rm -rf objs
rm -f *.gcda *.gcno *.gcov
rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
maintainer-clean: distclean
distclean: clean zconf zconf.h.cmakein docs
rm -f Makefile zlib.pc configure.log
-@rm -f .DS_Store
-@printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile
-@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile
-@touch -r Makefile.in Makefile
tags:
etags *.[ch]
depend:
makedepend -- $(CFLAGS) -- *.[ch]
# DO NOT DELETE THIS LINE -- make depend depends on it.
adler32.o zutil.o: zutil.h zlib.h zconf.h
gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h
compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h
crc32.o: zutil.h zlib.h zconf.h crc32.h
deflate.o: deflate.h zutil.h zlib.h zconf.h
infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
adler32.lo zutil.lo: zutil.h zlib.h zconf.h
gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h gzguts.h
compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h
crc32.lo: zutil.h zlib.h zconf.h crc32.h
deflate.lo: deflate.h zutil.h zlib.h zconf.h
infback.lo inflate.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
inffast.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inftrees.lo: zutil.h zlib.h zconf.h inftrees.h
trees.lo: deflate.h zutil.h zlib.h zconf.h trees.h

View File

@@ -1,115 +0,0 @@
ZLIB DATA COMPRESSION LIBRARY
zlib 1.2.8 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
rfc1952 (gzip format).
All functions of the compression library are documented in the file zlib.h
(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
of the library is given in the file test/example.c which also tests that
the library is working correctly. Another example is given in the file
test/minigzip.c. The compression library itself is composed of all source
files in the root directory.
To compile all files and run the test program, follow the instructions given at
the top of Makefile.in. In short "./configure; make test", and if that goes
well, "make install" should work for most flavors of Unix. For Windows, use
one of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use
make_vms.com.
Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
<info@winimage.com> for the Windows DLL version. The zlib home page is
http://zlib.net/ . Before reporting a problem, please check this site to
verify that you have the latest version of zlib; otherwise get the latest
version and check whether the problem still exists or not.
PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available at
http://marknelson.us/1997/01/01/zlib-engine/ .
The changes made in version 1.2.8 are documented in the file ChangeLog.
Unsupported third party contributions are provided in directory contrib/ .
zlib is available in Java using the java.util.zip package, documented at
http://java.sun.com/developer/technicalArticles/Programming/compression/ .
A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
at CPAN (Comprehensive Perl Archive Network) sites, including
http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
available in Python 1.5 and later versions, see
http://docs.python.org/library/zlib.html .
zlib is built into tcl: http://wiki.tcl.tk/4610 .
An experimental package to read and write files in .zip format, written on top
of zlib by Gilles Vollant <info@winimage.com>, is available in the
contrib/minizip directory of zlib.
Notes for some targets:
- For Windows DLL versions, please see win32/DLL_FAQ.txt
- For 64-bit Irix, deflate.c must be compiled without any optimization. With
-O, one libpng test fails. The test works in 32 bit mode (with the -n32
compiler flag). The compiler bug has been reported to SGI.
- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
when compiled with cc.
- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is
necessary to get gzprintf working correctly. This is done by configure.
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
other compilers. Use "make test" to check your compiler.
- gzdopen is not supported on RISCOS or BEOS.
- For PalmOs, see http://palmzlib.sourceforge.net/
Acknowledgments:
The deflate format used by zlib was defined by Phil Katz. The deflate and
zlib specifications were written by L. Peter Deutsch. Thanks to all the
people who reported problems and suggested various improvements in zlib; they
are too numerous to cite here.
Copyright notice:
(C) 1995-2013 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
If you use the zlib library in a product, we would appreciate *not* receiving
lengthy legal documents to sign. The sources are provided for free but without
warranty of any kind. The library has been entirely written by Jean-loup
Gailly and Mark Adler; it does not include third-party code.
If you redistribute modified sources, we would appreciate that you include in
the file ChangeLog history information documenting your changes. Please read
the FAQ for more information on the distribution of modified source versions.

View File

@@ -1,29 +0,0 @@
========================================================================
STATIC LIBRARY : zlib Project Overview
========================================================================
AppWizard has created this zlib library project for you.
No source files were created as part of your project.
zlib.vcxproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
zlib.vcxproj.filters
This is the filters file for VC++ projects generated using an Application Wizard.
It contains information about the association between the files in your project
and the filters. This association is used in the IDE to show grouping of files with
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
"Source Files" filter).
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

View File

@@ -1,179 +0,0 @@
/* adler32.c -- compute the Adler-32 checksum of a data stream
* Copyright (C) 1995-2011 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#include "zutil.h"
#define local static
local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
#define BASE 65521 /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;}
#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
#define DO16(buf) DO8(buf,0); DO8(buf,8);
/* use NO_DIVIDE if your processor does not do division in hardware --
try it both ways to see which is faster */
#ifdef NO_DIVIDE
/* note that this assumes BASE is 65521, where 65536 % 65521 == 15
(thank you to John Reiser for pointing this out) */
# define CHOP(a) \
do { \
unsigned long tmp = a >> 16; \
a &= 0xffffUL; \
a += (tmp << 4) - tmp; \
} while (0)
# define MOD28(a) \
do { \
CHOP(a); \
if (a >= BASE) a -= BASE; \
} while (0)
# define MOD(a) \
do { \
CHOP(a); \
MOD28(a); \
} while (0)
# define MOD63(a) \
do { /* this assumes a is not negative */ \
z_off64_t tmp = a >> 32; \
a &= 0xffffffffL; \
a += (tmp << 8) - (tmp << 5) + tmp; \
tmp = a >> 16; \
a &= 0xffffL; \
a += (tmp << 4) - tmp; \
tmp = a >> 16; \
a &= 0xffffL; \
a += (tmp << 4) - tmp; \
if (a >= BASE) a -= BASE; \
} while (0)
#else
# define MOD(a) a %= BASE
# define MOD28(a) a %= BASE
# define MOD63(a) a %= BASE
#endif
/* ========================================================================= */
uLong ZEXPORT adler32(adler, buf, len)
uLong adler;
const Bytef *buf;
uInt len;
{
unsigned long sum2;
unsigned n;
/* split Adler-32 into component sums */
sum2 = (adler >> 16) & 0xffff;
adler &= 0xffff;
/* in case user likes doing a byte at a time, keep it fast */
if (len == 1) {
adler += buf[0];
if (adler >= BASE)
adler -= BASE;
sum2 += adler;
if (sum2 >= BASE)
sum2 -= BASE;
return adler | (sum2 << 16);
}
/* initial Adler-32 value (deferred check for len == 1 speed) */
if (buf == Z_NULL)
return 1L;
/* in case short lengths are provided, keep it somewhat fast */
if (len < 16) {
while (len--) {
adler += *buf++;
sum2 += adler;
}
if (adler >= BASE)
adler -= BASE;
MOD28(sum2); /* only added so many BASE's */
return adler | (sum2 << 16);
}
/* do length NMAX blocks -- requires just one modulo operation */
while (len >= NMAX) {
len -= NMAX;
n = NMAX / 16; /* NMAX is divisible by 16 */
do {
DO16(buf); /* 16 sums unrolled */
buf += 16;
} while (--n);
MOD(adler);
MOD(sum2);
}
/* do remaining bytes (less than NMAX, still just one modulo) */
if (len) { /* avoid modulos if none remaining */
while (len >= 16) {
len -= 16;
DO16(buf);
buf += 16;
}
while (len--) {
adler += *buf++;
sum2 += adler;
}
MOD(adler);
MOD(sum2);
}
/* return recombined sums */
return adler | (sum2 << 16);
}
/* ========================================================================= */
local uLong adler32_combine_(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off64_t len2;
{
unsigned long sum1;
unsigned long sum2;
unsigned rem;
/* for negative len, return invalid adler32 as a clue for debugging */
if (len2 < 0)
return 0xffffffffUL;
/* the derivation of this formula is left as an exercise for the reader */
MOD63(len2); /* assumes len2 >= 0 */
rem = (unsigned)len2;
sum1 = adler1 & 0xffff;
sum2 = rem * sum1;
MOD(sum2);
sum1 += (adler2 & 0xffff) + BASE - 1;
sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
if (sum1 >= BASE) sum1 -= BASE;
if (sum1 >= BASE) sum1 -= BASE;
if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);
if (sum2 >= BASE) sum2 -= BASE;
return sum1 | (sum2 << 16);
}
/* ========================================================================= */
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off_t len2;
{
return adler32_combine_(adler1, adler2, len2);
}
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off64_t len2;
{
return adler32_combine_(adler1, adler2, len2);
}

View File

@@ -1,80 +0,0 @@
/* compress.c -- compress a memory buffer
* Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#define ZLIB_INTERNAL
#include "zlib.h"
/* ===========================================================================
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
length of the source buffer. Upon entry, destLen is the total size of the
destination buffer, which must be at least 0.1% larger than sourceLen plus
12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
int level;
{
z_stream stream;
int err;
stream.next_in = (z_const Bytef *)source;
stream.avail_in = (uInt)sourceLen;
#ifdef MAXSEG_64K
/* Check for source > 64K on 16-bit machine: */
if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
#endif
stream.next_out = dest;
stream.avail_out = (uInt)*destLen;
if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
stream.zalloc = (alloc_func)0;
stream.zfree = (free_func)0;
stream.opaque = (voidpf)0;
err = deflateInit(&stream, level);
if (err != Z_OK) return err;
err = deflate(&stream, Z_FINISH);
if (err != Z_STREAM_END) {
deflateEnd(&stream);
return err == Z_OK ? Z_BUF_ERROR : err;
}
*destLen = stream.total_out;
err = deflateEnd(&stream);
return err;
}
/* ===========================================================================
*/
int ZEXPORT compress (dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
{
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
}
/* ===========================================================================
If the default memLevel or windowBits for deflateInit() is changed, then
this function needs to be updated.
*/
uLong ZEXPORT compressBound (sourceLen)
uLong sourceLen;
{
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13;
}

View File

@@ -1,831 +0,0 @@
#!/bin/sh
# configure script for zlib.
#
# Normally configure builds both a static and a shared library.
# If you want to build just a static library, use: ./configure --static
#
# To impose specific compiler or flags or install directory, use for example:
# prefix=$HOME CC=cc CFLAGS="-O4" ./configure
# or for csh/tcsh users:
# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
# Incorrect settings of CC or CFLAGS may prevent creating a shared library.
# If you have problems, try without defining CC and CFLAGS before reporting
# an error.
# start off configure.log
echo -------------------- >> configure.log
echo $0 $* >> configure.log
date >> configure.log
# set command prefix for cross-compilation
if [ -n "${CHOST}" ]; then
uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`"
CROSS_PREFIX="${CHOST}-"
fi
# destination name for static library
STATICLIB=libz.a
# extract zlib version numbers from zlib.h
VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < zlib.h`
VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
# establish commands for library building
if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
AR=${AR-"${CROSS_PREFIX}ar"}
test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
else
AR=${AR-"ar"}
test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
fi
ARFLAGS=${ARFLAGS-"rc"}
if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log
else
RANLIB=${RANLIB-"ranlib"}
fi
if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
NM=${NM-"${CROSS_PREFIX}nm"}
test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log
else
NM=${NM-"nm"}
fi
# set defaults before processing command line options
LDCONFIG=${LDCONFIG-"ldconfig"}
LDSHAREDLIBC="${LDSHAREDLIBC--lc}"
ARCHS=
prefix=${prefix-/usr/local}
exec_prefix=${exec_prefix-'${prefix}'}
libdir=${libdir-'${exec_prefix}/lib'}
sharedlibdir=${sharedlibdir-'${libdir}'}
includedir=${includedir-'${prefix}/include'}
mandir=${mandir-'${prefix}/share/man'}
shared_ext='.so'
shared=1
solo=0
cover=0
zprefix=0
zconst=0
build64=0
gcc=0
old_cc="$CC"
old_cflags="$CFLAGS"
OBJC='$(OBJZ) $(OBJG)'
PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
# leave this script, optionally in a bad way
leave()
{
if test "$*" != "0"; then
echo "** $0 aborting." | tee -a configure.log
fi
rm -f $test.[co] $test $test$shared_ext $test.gcno ./--version
echo -------------------- >> configure.log
echo >> configure.log
echo >> configure.log
exit $1
}
# process command line options
while test $# -ge 1
do
case "$1" in
-h* | --help)
echo 'usage:' | tee -a configure.log
echo ' configure [--const] [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]' | tee -a configure.log
echo ' [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
echo ' [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log
exit 0 ;;
-p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
-e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
-l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;;
--sharedlibdir=*) sharedlibdir=`echo $1 | sed 's/.*=//'`; shift ;;
-i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;;
-u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;;
-p* | --prefix) prefix="$2"; shift; shift ;;
-e* | --eprefix) exec_prefix="$2"; shift; shift ;;
-l* | --libdir) libdir="$2"; shift; shift ;;
-i* | --includedir) includedir="$2"; shift; shift ;;
-s* | --shared | --enable-shared) shared=1; shift ;;
-t | --static) shared=0; shift ;;
--solo) solo=1; shift ;;
--cover) cover=1; shift ;;
-z* | --zprefix) zprefix=1; shift ;;
-6* | --64) build64=1; shift ;;
-a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
--sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
--localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
-c* | --const) zconst=1; shift ;;
*)
echo "unknown option: $1" | tee -a configure.log
echo "$0 --help for help" | tee -a configure.log
leave 1;;
esac
done
# temporary file name
test=ztest$$
# put arguments in log, also put test file in log if used in arguments
show()
{
case "$*" in
*$test.c*)
echo === $test.c === >> configure.log
cat $test.c >> configure.log
echo === >> configure.log;;
esac
echo $* >> configure.log
}
# check for gcc vs. cc and set compile and link flags based on the system identified by uname
cat > $test.c <<EOF
extern int getchar();
int hello() {return getchar();}
EOF
test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
cc=${CC-${CROSS_PREFIX}gcc}
cflags=${CFLAGS-"-O3"}
# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
case "$cc" in
*gcc*) gcc=1 ;;
*clang*) gcc=1 ;;
esac
case `$cc -v 2>&1` in
*gcc*) gcc=1 ;;
esac
show $cc -c $test.c
if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
echo ... using gcc >> configure.log
CC="$cc"
CFLAGS="${CFLAGS--O3} ${ARCHS}"
SFLAGS="${CFLAGS--O3} -fPIC"
LDFLAGS="${LDFLAGS} ${ARCHS}"
if test $build64 -eq 1; then
CFLAGS="${CFLAGS} -m64"
SFLAGS="${SFLAGS} -m64"
fi
if test "${ZLIBGCCWARN}" = "YES"; then
if test "$zconst" -eq 1; then
CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST"
else
CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
fi
fi
if test -z "$uname"; then
uname=`(uname -s || echo unknown) 2>/dev/null`
fi
case "$uname" in
Linux* | linux* | GNU | GNU/* | solaris*)
LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;;
*BSD | *bsd* | DragonFly)
LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"}
LDCONFIG="ldconfig -m" ;;
CYGWIN* | Cygwin* | cygwin* | OS/2*)
EXE='.exe' ;;
MINGW* | mingw*)
# temporary bypass
rm -f $test.[co] $test $test$shared_ext
echo "Please use win32/Makefile.gcc instead." | tee -a configure.log
leave 1
LDSHARED=${LDSHARED-"$cc -shared"}
LDSHAREDLIBC=""
EXE='.exe' ;;
QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
# (alain.bonnefoy@icbt.com)
LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;;
HP-UX*)
LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
case `(uname -m || echo unknown) 2>/dev/null` in
ia64)
shared_ext='.so'
SHAREDLIB='libz.so' ;;
*)
shared_ext='.sl'
SHAREDLIB='libz.sl' ;;
esac ;;
Darwin* | darwin*)
shared_ext='.dylib'
SHAREDLIB=libz$shared_ext
SHAREDLIBV=libz.$VER$shared_ext
SHAREDLIBM=libz.$VER1$shared_ext
LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
if libtool -V 2>&1 | grep Apple > /dev/null; then
AR="libtool"
else
AR="/usr/bin/libtool"
fi
ARFLAGS="-o" ;;
*) LDSHARED=${LDSHARED-"$cc -shared"} ;;
esac
else
# find system name and corresponding cc options
CC=${CC-cc}
gcc=0
echo ... using $CC >> configure.log
if test -z "$uname"; then
uname=`(uname -sr || echo unknown) 2>/dev/null`
fi
case "$uname" in
HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
CFLAGS=${CFLAGS-"-O"}
# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
LDSHARED=${LDSHARED-"ld -b"}
case `(uname -m || echo unknown) 2>/dev/null` in
ia64)
shared_ext='.so'
SHAREDLIB='libz.so' ;;
*)
shared_ext='.sl'
SHAREDLIB='libz.sl' ;;
esac ;;
IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
CFLAGS=${CFLAGS-"-ansi -O2"}
LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
CFLAGS=${CFLAGS-"-O -std1"}
LDFLAGS="${LDFLAGS} -Wl,-rpath,."
LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"} ;;
OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
CFLAGS=${CFLAGS-"-O -std1"}
LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
QNX*) SFLAGS=${CFLAGS-"-4 -O"}
CFLAGS=${CFLAGS-"-4 -O"}
LDSHARED=${LDSHARED-"cc"}
RANLIB=${RANLIB-"true"}
AR="cc"
ARFLAGS="-A" ;;
SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
CFLAGS=${CFLAGS-"-O3"}
LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
SunOS\ 5* | solaris*)
LDSHARED=${LDSHARED-"cc -G -h libz$shared_ext.$VER1"}
SFLAGS=${CFLAGS-"-fast -KPIC"}
CFLAGS=${CFLAGS-"-fast"}
if test $build64 -eq 1; then
# old versions of SunPRO/Workshop/Studio don't support -m64,
# but newer ones do. Check for it.
flag64=`$CC -flags | egrep -- '^-m64'`
if test x"$flag64" != x"" ; then
CFLAGS="${CFLAGS} -m64"
SFLAGS="${SFLAGS} -m64"
else
case `(uname -m || echo unknown) 2>/dev/null` in
i86*)
SFLAGS="$SFLAGS -xarch=amd64"
CFLAGS="$CFLAGS -xarch=amd64" ;;
*)
SFLAGS="$SFLAGS -xarch=v9"
CFLAGS="$CFLAGS -xarch=v9" ;;
esac
fi
fi
;;
SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
CFLAGS=${CFLAGS-"-O2"}
LDSHARED=${LDSHARED-"ld"} ;;
SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
UNIX_System_V\ 4.2.0)
SFLAGS=${CFLAGS-"-KPIC -O"}
CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -G"} ;;
UNIX_SV\ 4.2MP)
SFLAGS=${CFLAGS-"-Kconform_pic -O"}
CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -G"} ;;
OpenUNIX\ 5)
SFLAGS=${CFLAGS-"-KPIC -O"}
CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -G"} ;;
AIX*) # Courtesy of dbakker@arrayasolutions.com
SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
LDSHARED=${LDSHARED-"xlc -G"} ;;
# send working options for other systems to zlib@gzip.org
*) SFLAGS=${CFLAGS-"-O"}
CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -shared"} ;;
esac
fi
# destination names for shared library if not defined above
SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
echo >> configure.log
# define functions for testing compiler and library characteristics and logging the results
cat > $test.c <<EOF
#error error
EOF
if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
try()
{
show $*
test "`( $* ) 2>&1 | tee -a configure.log`" = ""
}
echo - using any output from compiler to indicate an error >> configure.log
else
try()
{
show $*
( $* ) >> configure.log 2>&1
ret=$?
if test $ret -ne 0; then
echo "(exit code "$ret")" >> configure.log
fi
return $ret
}
fi
tryboth()
{
show $*
got=`( $* ) 2>&1`
ret=$?
printf %s "$got" >> configure.log
if test $ret -ne 0; then
return $ret
fi
test "$got" = ""
}
cat > $test.c << EOF
int foo() { return 0; }
EOF
echo "Checking for obsessive-compulsive compiler options..." >> configure.log
if try $CC -c $CFLAGS $test.c; then
:
else
echo "Compiler error reporting is too harsh for $0 (perhaps remove -Werror)." | tee -a configure.log
leave 1
fi
echo >> configure.log
# see if shared library build supported
cat > $test.c <<EOF
extern int getchar();
int hello() {return getchar();}
EOF
if test $shared -eq 1; then
echo Checking for shared library support... | tee -a configure.log
# we must test in two steps (cc then ld), required at least on SunOS 4.x
if try $CC -w -c $SFLAGS $test.c &&
try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
elif test -z "$old_cc" -a -z "$old_cflags"; then
echo No shared library support. | tee -a configure.log
shared=0;
else
echo 'No shared library support; try without defining CC and CFLAGS' | tee -a configure.log
shared=0;
fi
fi
if test $shared -eq 0; then
LDSHARED="$CC"
ALL="static"
TEST="all teststatic"
SHAREDLIB=""
SHAREDLIBV=""
SHAREDLIBM=""
echo Building static library $STATICLIB version $VER with $CC. | tee -a configure.log
else
ALL="static shared"
TEST="all teststatic testshared"
fi
# check for underscores in external names for use by assembler code
CPP=${CPP-"$CC -E"}
case $CFLAGS in
*ASMV*)
echo >> configure.log
show "$NM $test.o | grep _hello"
if test "`$NM $test.o | grep _hello | tee -a configure.log`" = ""; then
CPP="$CPP -DNO_UNDERLINE"
echo Checking for underline in external names... No. | tee -a configure.log
else
echo Checking for underline in external names... Yes. | tee -a configure.log
fi ;;
esac
echo >> configure.log
# check for large file support, and if none, check for fseeko()
cat > $test.c <<EOF
#include <sys/types.h>
off64_t dummy = 0;
EOF
if try $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c; then
CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
ALL="${ALL} all64"
TEST="${TEST} test64"
echo "Checking for off64_t... Yes." | tee -a configure.log
echo "Checking for fseeko... Yes." | tee -a configure.log
else
echo "Checking for off64_t... No." | tee -a configure.log
echo >> configure.log
cat > $test.c <<EOF
#include <stdio.h>
int main(void) {
fseeko(NULL, 0, 0);
return 0;
}
EOF
if try $CC $CFLAGS -o $test $test.c; then
echo "Checking for fseeko... Yes." | tee -a configure.log
else
CFLAGS="${CFLAGS} -DNO_FSEEKO"
SFLAGS="${SFLAGS} -DNO_FSEEKO"
echo "Checking for fseeko... No." | tee -a configure.log
fi
fi
echo >> configure.log
# check for strerror() for use by gz* functions
cat > $test.c <<EOF
#include <string.h>
#include <errno.h>
int main() { return strlen(strerror(errno)); }
EOF
if try $CC $CFLAGS -o $test $test.c; then
echo "Checking for strerror... Yes." | tee -a configure.log
else
CFLAGS="${CFLAGS} -DNO_STRERROR"
SFLAGS="${SFLAGS} -DNO_STRERROR"
echo "Checking for strerror... No." | tee -a configure.log
fi
# copy clean zconf.h for subsequent edits
cp -p zconf.h.in zconf.h
echo >> configure.log
# check for unistd.h and save result in zconf.h
cat > $test.c <<EOF
#include <unistd.h>
int main() { return 0; }
EOF
if try $CC -c $CFLAGS $test.c; then
sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
mv zconf.temp.h zconf.h
echo "Checking for unistd.h... Yes." | tee -a configure.log
else
echo "Checking for unistd.h... No." | tee -a configure.log
fi
echo >> configure.log
# check for stdarg.h and save result in zconf.h
cat > $test.c <<EOF
#include <stdarg.h>
int main() { return 0; }
EOF
if try $CC -c $CFLAGS $test.c; then
sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
mv zconf.temp.h zconf.h
echo "Checking for stdarg.h... Yes." | tee -a configure.log
else
echo "Checking for stdarg.h... No." | tee -a configure.log
fi
# if the z_ prefix was requested, save that in zconf.h
if test $zprefix -eq 1; then
sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h
mv zconf.temp.h zconf.h
echo >> configure.log
echo "Using z_ prefix on all symbols." | tee -a configure.log
fi
# if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists
if test $solo -eq 1; then
sed '/#define ZCONF_H/a\
#define Z_SOLO
' < zconf.h > zconf.temp.h
mv zconf.temp.h zconf.h
OBJC='$(OBJZ)'
PIC_OBJC='$(PIC_OBJZ)'
fi
# if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
if test $cover -eq 1; then
CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
if test -n "$GCC_CLASSIC"; then
CC=$GCC_CLASSIC
fi
fi
echo >> configure.log
# conduct a series of tests to resolve eight possible cases of using "vs" or "s" printf functions
# (using stdarg or not), with or without "n" (proving size of buffer), and with or without a
# return value. The most secure result is vsnprintf() with a return value. snprintf() with a
# return value is secure as well, but then gzprintf() will be limited to 20 arguments.
cat > $test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
#include "zconf.h"
int main()
{
#ifndef STDC
choke me
#endif
return 0;
}
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
echo >> configure.log
cat > $test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
int mytest(const char *fmt, ...)
{
char buf[20];
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
return 0;
}
int main()
{
return (mytest("Hello%d\n", 1));
}
EOF
if try $CC $CFLAGS -o $test $test.c; then
echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
echo >> configure.log
cat >$test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
int mytest(const char *fmt, ...)
{
int n;
char buf[20];
va_list ap;
va_start(ap, fmt);
n = vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
return n;
}
int main()
{
return (mytest("Hello%d\n", 1));
}
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for return value of vsnprintf()... Yes." | tee -a configure.log
else
CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
echo "Checking for return value of vsnprintf()... No." | tee -a configure.log
echo " WARNING: apparently vsnprintf() does not return a value. zlib" | tee -a configure.log
echo " can build but will be open to possible string-format security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
fi
else
CFLAGS="$CFLAGS -DNO_vsnprintf"
SFLAGS="$SFLAGS -DNO_vsnprintf"
echo "Checking for vsnprintf() in stdio.h... No." | tee -a configure.log
echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a configure.log
echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
echo >> configure.log
cat >$test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
int mytest(const char *fmt, ...)
{
int n;
char buf[20];
va_list ap;
va_start(ap, fmt);
n = vsprintf(buf, fmt, ap);
va_end(ap);
return n;
}
int main()
{
return (mytest("Hello%d\n", 1));
}
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for return value of vsprintf()... Yes." | tee -a configure.log
else
CFLAGS="$CFLAGS -DHAS_vsprintf_void"
SFLAGS="$SFLAGS -DHAS_vsprintf_void"
echo "Checking for return value of vsprintf()... No." | tee -a configure.log
echo " WARNING: apparently vsprintf() does not return a value. zlib" | tee -a configure.log
echo " can build but will be open to possible string-format security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
fi
fi
else
echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()." | tee -a configure.log
echo >> configure.log
cat >$test.c <<EOF
#include <stdio.h>
int mytest()
{
char buf[20];
snprintf(buf, sizeof(buf), "%s", "foo");
return 0;
}
int main()
{
return (mytest());
}
EOF
if try $CC $CFLAGS -o $test $test.c; then
echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
echo >> configure.log
cat >$test.c <<EOF
#include <stdio.h>
int mytest()
{
char buf[20];
return snprintf(buf, sizeof(buf), "%s", "foo");
}
int main()
{
return (mytest());
}
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for return value of snprintf()... Yes." | tee -a configure.log
else
CFLAGS="$CFLAGS -DHAS_snprintf_void"
SFLAGS="$SFLAGS -DHAS_snprintf_void"
echo "Checking for return value of snprintf()... No." | tee -a configure.log
echo " WARNING: apparently snprintf() does not return a value. zlib" | tee -a configure.log
echo " can build but will be open to possible string-format security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
fi
else
CFLAGS="$CFLAGS -DNO_snprintf"
SFLAGS="$SFLAGS -DNO_snprintf"
echo "Checking for snprintf() in stdio.h... No." | tee -a configure.log
echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a configure.log
echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
echo >> configure.log
cat >$test.c <<EOF
#include <stdio.h>
int mytest()
{
char buf[20];
return sprintf(buf, "%s", "foo");
}
int main()
{
return (mytest());
}
EOF
if try $CC -c $CFLAGS $test.c; then
echo "Checking for return value of sprintf()... Yes." | tee -a configure.log
else
CFLAGS="$CFLAGS -DHAS_sprintf_void"
SFLAGS="$SFLAGS -DHAS_sprintf_void"
echo "Checking for return value of sprintf()... No." | tee -a configure.log
echo " WARNING: apparently sprintf() does not return a value. zlib" | tee -a configure.log
echo " can build but will be open to possible string-format security" | tee -a configure.log
echo " vulnerabilities." | tee -a configure.log
fi
fi
fi
# see if we can hide zlib internal symbols that are linked between separate source files
if test "$gcc" -eq 1; then
echo >> configure.log
cat > $test.c <<EOF
#define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
int ZLIB_INTERNAL foo;
int main()
{
return 0;
}
EOF
if tryboth $CC -c $CFLAGS $test.c; then
CFLAGS="$CFLAGS -DHAVE_HIDDEN"
SFLAGS="$SFLAGS -DHAVE_HIDDEN"
echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log
else
echo "Checking for attribute(visibility) support... No." | tee -a configure.log
fi
fi
# show the results in the log
echo >> configure.log
echo ALL = $ALL >> configure.log
echo AR = $AR >> configure.log
echo ARFLAGS = $ARFLAGS >> configure.log
echo CC = $CC >> configure.log
echo CFLAGS = $CFLAGS >> configure.log
echo CPP = $CPP >> configure.log
echo EXE = $EXE >> configure.log
echo LDCONFIG = $LDCONFIG >> configure.log
echo LDFLAGS = $LDFLAGS >> configure.log
echo LDSHARED = $LDSHARED >> configure.log
echo LDSHAREDLIBC = $LDSHAREDLIBC >> configure.log
echo OBJC = $OBJC >> configure.log
echo PIC_OBJC = $PIC_OBJC >> configure.log
echo RANLIB = $RANLIB >> configure.log
echo SFLAGS = $SFLAGS >> configure.log
echo SHAREDLIB = $SHAREDLIB >> configure.log
echo SHAREDLIBM = $SHAREDLIBM >> configure.log
echo SHAREDLIBV = $SHAREDLIBV >> configure.log
echo STATICLIB = $STATICLIB >> configure.log
echo TEST = $TEST >> configure.log
echo VER = $VER >> configure.log
echo Z_U4 = $Z_U4 >> configure.log
echo exec_prefix = $exec_prefix >> configure.log
echo includedir = $includedir >> configure.log
echo libdir = $libdir >> configure.log
echo mandir = $mandir >> configure.log
echo prefix = $prefix >> configure.log
echo sharedlibdir = $sharedlibdir >> configure.log
echo uname = $uname >> configure.log
# udpate Makefile with the configure results
sed < Makefile.in "
/^CC *=/s#=.*#=$CC#
/^CFLAGS *=/s#=.*#=$CFLAGS#
/^SFLAGS *=/s#=.*#=$SFLAGS#
/^LDFLAGS *=/s#=.*#=$LDFLAGS#
/^LDSHARED *=/s#=.*#=$LDSHARED#
/^CPP *=/s#=.*#=$CPP#
/^STATICLIB *=/s#=.*#=$STATICLIB#
/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
/^AR *=/s#=.*#=$AR#
/^ARFLAGS *=/s#=.*#=$ARFLAGS#
/^RANLIB *=/s#=.*#=$RANLIB#
/^LDCONFIG *=/s#=.*#=$LDCONFIG#
/^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC#
/^EXE *=/s#=.*#=$EXE#
/^prefix *=/s#=.*#=$prefix#
/^exec_prefix *=/s#=.*#=$exec_prefix#
/^libdir *=/s#=.*#=$libdir#
/^sharedlibdir *=/s#=.*#=$sharedlibdir#
/^includedir *=/s#=.*#=$includedir#
/^mandir *=/s#=.*#=$mandir#
/^OBJC *=/s#=.*#= $OBJC#
/^PIC_OBJC *=/s#=.*#= $PIC_OBJC#
/^all: */s#:.*#: $ALL#
/^test: */s#:.*#: $TEST#
" > Makefile
# create zlib.pc with the configure results
sed < zlib.pc.in "
/^CC *=/s#=.*#=$CC#
/^CFLAGS *=/s#=.*#=$CFLAGS#
/^CPP *=/s#=.*#=$CPP#
/^LDSHARED *=/s#=.*#=$LDSHARED#
/^STATICLIB *=/s#=.*#=$STATICLIB#
/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
/^AR *=/s#=.*#=$AR#
/^ARFLAGS *=/s#=.*#=$ARFLAGS#
/^RANLIB *=/s#=.*#=$RANLIB#
/^EXE *=/s#=.*#=$EXE#
/^prefix *=/s#=.*#=$prefix#
/^exec_prefix *=/s#=.*#=$exec_prefix#
/^libdir *=/s#=.*#=$libdir#
/^sharedlibdir *=/s#=.*#=$sharedlibdir#
/^includedir *=/s#=.*#=$includedir#
/^mandir *=/s#=.*#=$mandir#
/^LDFLAGS *=/s#=.*#=$LDFLAGS#
" | sed -e "
s/\@VERSION\@/$VER/g;
" > zlib.pc
# done
leave 0

View File

@@ -1,425 +0,0 @@
/* crc32.c -- compute the CRC-32 of a data stream
* Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*
* Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
* CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
* tables for updating the shift register in one step with three exclusive-ors
* instead of four steps with four exclusive-ors. This results in about a
* factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
*/
/* @(#) $Id$ */
/*
Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
protection on the static variables used to control the first-use generation
of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should
first call get_crc_table() to initialize the tables before allowing more than
one thread to use crc32().
DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h.
*/
#ifdef MAKECRCH
# include <stdio.h>
# ifndef DYNAMIC_CRC_TABLE
# define DYNAMIC_CRC_TABLE
# endif /* !DYNAMIC_CRC_TABLE */
#endif /* MAKECRCH */
#include "zutil.h" /* for STDC and FAR definitions */
#define local static
/* Definitions for doing the crc four data bytes at a time. */
#if !defined(NOBYFOUR) && defined(Z_U4)
# define BYFOUR
#endif
#ifdef BYFOUR
local unsigned long crc32_little OF((unsigned long,
const unsigned char FAR *, unsigned));
local unsigned long crc32_big OF((unsigned long,
const unsigned char FAR *, unsigned));
# define TBLS 8
#else
# define TBLS 1
#endif /* BYFOUR */
/* Local functions for crc concatenation */
local unsigned long gf2_matrix_times OF((unsigned long *mat,
unsigned long vec));
local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2));
#ifdef DYNAMIC_CRC_TABLE
local volatile int crc_table_empty = 1;
local z_crc_t FAR crc_table[TBLS][256];
local void make_crc_table OF((void));
#ifdef MAKECRCH
local void write_table OF((FILE *, const z_crc_t FAR *));
#endif /* MAKECRCH */
/*
Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
Polynomials over GF(2) are represented in binary, one bit per coefficient,
with the lowest powers in the most significant bit. Then adding polynomials
is just exclusive-or, and multiplying a polynomial by x is a right shift by
one. If we call the above polynomial p, and represent a byte as the
polynomial q, also with the lowest power in the most significant bit (so the
byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
where a mod b means the remainder after dividing a by b.
This calculation is done using the shift-register method of multiplying and
taking the remainder. The register is initialized to zero, and for each
incoming bit, x^32 is added mod p to the register if the bit is a one (where
x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
x (which is shifting right by one and adding x^32 mod p if the bit shifted
out is a one). We start with the highest power (least significant bit) of
q and repeat for all eight bits of q.
The first table is simply the CRC of all possible eight bit values. This is
all the information needed to generate CRCs on data a byte at a time for all
combinations of CRC register values and incoming bytes. The remaining tables
allow for word-at-a-time CRC calculation for both big-endian and little-
endian machines, where a word is four bytes.
*/
local void make_crc_table()
{
z_crc_t c;
int n, k;
z_crc_t poly; /* polynomial exclusive-or pattern */
/* terms of polynomial defining this crc (except x^32): */
static volatile int first = 1; /* flag to limit concurrent making */
static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
/* See if another task is already doing this (not thread-safe, but better
than nothing -- significantly reduces duration of vulnerability in
case the advice about DYNAMIC_CRC_TABLE is ignored) */
if (first) {
first = 0;
/* make exclusive-or pattern from polynomial (0xedb88320UL) */
poly = 0;
for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++)
poly |= (z_crc_t)1 << (31 - p[n]);
/* generate a crc for every 8-bit value */
for (n = 0; n < 256; n++) {
c = (z_crc_t)n;
for (k = 0; k < 8; k++)
c = c & 1 ? poly ^ (c >> 1) : c >> 1;
crc_table[0][n] = c;
}
#ifdef BYFOUR
/* generate crc for each value followed by one, two, and three zeros,
and then the byte reversal of those as well as the first table */
for (n = 0; n < 256; n++) {
c = crc_table[0][n];
crc_table[4][n] = ZSWAP32(c);
for (k = 1; k < 4; k++) {
c = crc_table[0][c & 0xff] ^ (c >> 8);
crc_table[k][n] = c;
crc_table[k + 4][n] = ZSWAP32(c);
}
}
#endif /* BYFOUR */
crc_table_empty = 0;
}
else { /* not first */
/* wait for the other guy to finish (not efficient, but rare) */
while (crc_table_empty)
;
}
#ifdef MAKECRCH
/* write out CRC tables to crc32.h */
{
FILE *out;
out = fopen("crc32.h", "w");
if (out == NULL) return;
fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
fprintf(out, "local const z_crc_t FAR ");
fprintf(out, "crc_table[TBLS][256] =\n{\n {\n");
write_table(out, crc_table[0]);
# ifdef BYFOUR
fprintf(out, "#ifdef BYFOUR\n");
for (k = 1; k < 8; k++) {
fprintf(out, " },\n {\n");
write_table(out, crc_table[k]);
}
fprintf(out, "#endif\n");
# endif /* BYFOUR */
fprintf(out, " }\n};\n");
fclose(out);
}
#endif /* MAKECRCH */
}
#ifdef MAKECRCH
local void write_table(out, table)
FILE *out;
const z_crc_t FAR *table;
{
int n;
for (n = 0; n < 256; n++)
fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ",
(unsigned long)(table[n]),
n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
}
#endif /* MAKECRCH */
#else /* !DYNAMIC_CRC_TABLE */
/* ========================================================================
* Tables of CRC-32s of all single-byte values, made by make_crc_table().
*/
#include "crc32.h"
#endif /* DYNAMIC_CRC_TABLE */
/* =========================================================================
* This function can be used by asm versions of crc32()
*/
const z_crc_t FAR * ZEXPORT get_crc_table()
{
#ifdef DYNAMIC_CRC_TABLE
if (crc_table_empty)
make_crc_table();
#endif /* DYNAMIC_CRC_TABLE */
return (const z_crc_t FAR *)crc_table;
}
/* ========================================================================= */
#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
/* ========================================================================= */
unsigned long ZEXPORT crc32(crc, buf, len)
unsigned long crc;
const unsigned char FAR *buf;
uInt len;
{
if (buf == Z_NULL) return 0UL;
#ifdef DYNAMIC_CRC_TABLE
if (crc_table_empty)
make_crc_table();
#endif /* DYNAMIC_CRC_TABLE */
#ifdef BYFOUR
if (sizeof(void *) == sizeof(ptrdiff_t)) {
z_crc_t endian;
endian = 1;
if (*((unsigned char *)(&endian)))
return crc32_little(crc, buf, len);
else
return crc32_big(crc, buf, len);
}
#endif /* BYFOUR */
crc = crc ^ 0xffffffffUL;
while (len >= 8) {
DO8;
len -= 8;
}
if (len) do {
DO1;
} while (--len);
return crc ^ 0xffffffffUL;
}
#ifdef BYFOUR
/* ========================================================================= */
#define DOLIT4 c ^= *buf4++; \
c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
/* ========================================================================= */
local unsigned long crc32_little(crc, buf, len)
unsigned long crc;
const unsigned char FAR *buf;
unsigned len;
{
register z_crc_t c;
register const z_crc_t FAR *buf4;
c = (z_crc_t)crc;
c = ~c;
while (len && ((ptrdiff_t)buf & 3)) {
c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
len--;
}
buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
while (len >= 32) {
DOLIT32;
len -= 32;
}
while (len >= 4) {
DOLIT4;
len -= 4;
}
buf = (const unsigned char FAR *)buf4;
if (len) do {
c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
} while (--len);
c = ~c;
return (unsigned long)c;
}
/* ========================================================================= */
#define DOBIG4 c ^= *++buf4; \
c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
/* ========================================================================= */
local unsigned long crc32_big(crc, buf, len)
unsigned long crc;
const unsigned char FAR *buf;
unsigned len;
{
register z_crc_t c;
register const z_crc_t FAR *buf4;
c = ZSWAP32((z_crc_t)crc);
c = ~c;
while (len && ((ptrdiff_t)buf & 3)) {
c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
len--;
}
buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
buf4--;
while (len >= 32) {
DOBIG32;
len -= 32;
}
while (len >= 4) {
DOBIG4;
len -= 4;
}
buf4++;
buf = (const unsigned char FAR *)buf4;
if (len) do {
c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
} while (--len);
c = ~c;
return (unsigned long)(ZSWAP32(c));
}
#endif /* BYFOUR */
#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */
/* ========================================================================= */
local unsigned long gf2_matrix_times(mat, vec)
unsigned long *mat;
unsigned long vec;
{
unsigned long sum;
sum = 0;
while (vec) {
if (vec & 1)
sum ^= *mat;
vec >>= 1;
mat++;
}
return sum;
}
/* ========================================================================= */
local void gf2_matrix_square(square, mat)
unsigned long *square;
unsigned long *mat;
{
int n;
for (n = 0; n < GF2_DIM; n++)
square[n] = gf2_matrix_times(mat, mat[n]);
}
/* ========================================================================= */
local uLong crc32_combine_(crc1, crc2, len2)
uLong crc1;
uLong crc2;
z_off64_t len2;
{
int n;
unsigned long row;
unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */
unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */
/* degenerate case (also disallow negative lengths) */
if (len2 <= 0)
return crc1;
/* put operator for one zero bit in odd */
odd[0] = 0xedb88320UL; /* CRC-32 polynomial */
row = 1;
for (n = 1; n < GF2_DIM; n++) {
odd[n] = row;
row <<= 1;
}
/* put operator for two zero bits in even */
gf2_matrix_square(even, odd);
/* put operator for four zero bits in odd */
gf2_matrix_square(odd, even);
/* apply len2 zeros to crc1 (first square will put the operator for one
zero byte, eight zero bits, in even) */
do {
/* apply zeros operator for this bit of len2 */
gf2_matrix_square(even, odd);
if (len2 & 1)
crc1 = gf2_matrix_times(even, crc1);
len2 >>= 1;
/* if no more bits set, then done */
if (len2 == 0)
break;
/* another iteration of the loop with odd and even swapped */
gf2_matrix_square(odd, even);
if (len2 & 1)
crc1 = gf2_matrix_times(odd, crc1);
len2 >>= 1;
/* if no more bits set, then done */
} while (len2 != 0);
/* return combined crc */
crc1 ^= crc2;
return crc1;
}
/* ========================================================================= */
uLong ZEXPORT crc32_combine(crc1, crc2, len2)
uLong crc1;
uLong crc2;
z_off_t len2;
{
return crc32_combine_(crc1, crc2, len2);
}
uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
uLong crc1;
uLong crc2;
z_off64_t len2;
{
return crc32_combine_(crc1, crc2, len2);
}

View File

@@ -1,441 +0,0 @@
/* crc32.h -- tables for rapid CRC calculation
* Generated automatically by crc32.c
*/
local const z_crc_t FAR crc_table[TBLS][256] =
{
{
0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
0x2d02ef8dUL
#ifdef BYFOUR
},
{
0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
0x9324fd72UL
},
{
0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
0xbe9834edUL
},
{
0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
0xde0506f1UL
},
{
0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
0x8def022dUL
},
{
0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
0x72fd2493UL
},
{
0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
0xed3498beUL
},
{
0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
0xf10605deUL
#endif
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,346 +0,0 @@
/* deflate.h -- internal compression state
* Copyright (C) 1995-2012 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
/* @(#) $Id$ */
#ifndef DEFLATE_H
#define DEFLATE_H
#include "zutil.h"
/* define NO_GZIP when compiling if you want to disable gzip header and
trailer creation by deflate(). NO_GZIP would be used to avoid linking in
the crc code when it is not needed. For shared libraries, gzip encoding
should be left enabled. */
#ifndef NO_GZIP
# define GZIP
#endif
/* ===========================================================================
* Internal compression state.
*/
#define LENGTH_CODES 29
/* number of length codes, not counting the special END_BLOCK code */
#define LITERALS 256
/* number of literal bytes 0..255 */
#define L_CODES (LITERALS+1+LENGTH_CODES)
/* number of Literal or Length codes, including the END_BLOCK code */
#define D_CODES 30
/* number of distance codes */
#define BL_CODES 19
/* number of codes used to transfer the bit lengths */
#define HEAP_SIZE (2*L_CODES+1)
/* maximum heap size */
#define MAX_BITS 15
/* All codes must not exceed MAX_BITS bits */
#define Buf_size 16
/* size of bit buffer in bi_buf */
#define INIT_STATE 42
#define EXTRA_STATE 69
#define NAME_STATE 73
#define COMMENT_STATE 91
#define HCRC_STATE 103
#define BUSY_STATE 113
#define FINISH_STATE 666
/* Stream status */
/* Data structure describing a single value and its code string. */
typedef struct ct_data_s {
union {
ush freq; /* frequency count */
ush code; /* bit string */
} fc;
union {
ush dad; /* father node in Huffman tree */
ush len; /* length of bit string */
} dl;
} FAR ct_data;
#define Freq fc.freq
#define Code fc.code
#define Dad dl.dad
#define Len dl.len
typedef struct static_tree_desc_s static_tree_desc;
typedef struct tree_desc_s {
ct_data *dyn_tree; /* the dynamic tree */
int max_code; /* largest code with non zero frequency */
static_tree_desc *stat_desc; /* the corresponding static tree */
} FAR tree_desc;
typedef ush Pos;
typedef Pos FAR Posf;
typedef unsigned IPos;
/* A Pos is an index in the character window. We use short instead of int to
* save space in the various tables. IPos is used only for parameter passing.
*/
typedef struct internal_state {
z_streamp strm; /* pointer back to this zlib stream */
int status; /* as the name implies */
Bytef *pending_buf; /* output still pending */
ulg pending_buf_size; /* size of pending_buf */
Bytef *pending_out; /* next pending byte to output to the stream */
uInt pending; /* nb of bytes in the pending buffer */
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
gz_headerp gzhead; /* gzip header information to write */
uInt gzindex; /* where in extra, name, or comment */
Byte method; /* can only be DEFLATED */
int last_flush; /* value of flush param for previous deflate call */
/* used by deflate.c: */
uInt w_size; /* LZ77 window size (32K by default) */
uInt w_bits; /* log2(w_size) (8..16) */
uInt w_mask; /* w_size - 1 */
Bytef *window;
/* Sliding window. Input bytes are read into the second half of the window,
* and move to the first half later to keep a dictionary of at least wSize
* bytes. With this organization, matches are limited to a distance of
* wSize-MAX_MATCH bytes, but this ensures that IO is always
* performed with a length multiple of the block size. Also, it limits
* the window size to 64K, which is quite useful on MSDOS.
* To do: use the user input buffer as sliding window.
*/
ulg window_size;
/* Actual size of window: 2*wSize, except when the user input buffer
* is directly used as sliding window.
*/
Posf *prev;
/* Link to older string with same hash index. To limit the size of this
* array to 64K, this link is maintained only for the last 32K strings.
* An index in this array is thus a window index modulo 32K.
*/
Posf *head; /* Heads of the hash chains or NIL. */
uInt ins_h; /* hash index of string to be inserted */
uInt hash_size; /* number of elements in hash table */
uInt hash_bits; /* log2(hash_size) */
uInt hash_mask; /* hash_size-1 */
uInt hash_shift;
/* Number of bits by which ins_h must be shifted at each input
* step. It must be such that after MIN_MATCH steps, the oldest
* byte no longer takes part in the hash key, that is:
* hash_shift * MIN_MATCH >= hash_bits
*/
long block_start;
/* Window position at the beginning of the current output block. Gets
* negative when the window is moved backwards.
*/
uInt match_length; /* length of best match */
IPos prev_match; /* previous match */
int match_available; /* set if previous match exists */
uInt strstart; /* start of string to insert */
uInt match_start; /* start of matching string */
uInt lookahead; /* number of valid bytes ahead in window */
uInt prev_length;
/* Length of the best match at previous step. Matches not greater than this
* are discarded. This is used in the lazy match evaluation.
*/
uInt max_chain_length;
/* To speed up deflation, hash chains are never searched beyond this
* length. A higher limit improves compression ratio but degrades the
* speed.
*/
uInt max_lazy_match;
/* Attempt to find a better match only when the current match is strictly
* smaller than this value. This mechanism is used only for compression
* levels >= 4.
*/
# define max_insert_length max_lazy_match
/* Insert new strings in the hash table only if the match length is not
* greater than this length. This saves time but degrades compression.
* max_insert_length is used only for compression levels <= 3.
*/
int level; /* compression level (1..9) */
int strategy; /* favor or force Huffman coding*/
uInt good_match;
/* Use a faster search when the previous match is longer than this */
int nice_match; /* Stop searching when current match exceeds this */
/* used by trees.c: */
/* Didn't use ct_data typedef below to suppress compiler warning */
struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
struct tree_desc_s l_desc; /* desc. for literal tree */
struct tree_desc_s d_desc; /* desc. for distance tree */
struct tree_desc_s bl_desc; /* desc. for bit length tree */
ush bl_count[MAX_BITS+1];
/* number of codes at each bit length for an optimal tree */
int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
int heap_len; /* number of elements in the heap */
int heap_max; /* element of largest frequency */
/* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
* The same heap array is used to build all trees.
*/
uch depth[2*L_CODES+1];
/* Depth of each subtree used as tie breaker for trees of equal frequency
*/
uchf *l_buf; /* buffer for literals or lengths */
uInt lit_bufsize;
/* Size of match buffer for literals/lengths. There are 4 reasons for
* limiting lit_bufsize to 64K:
* - frequencies can be kept in 16 bit counters
* - if compression is not successful for the first block, all input
* data is still in the window so we can still emit a stored block even
* when input comes from standard input. (This can also be done for
* all blocks if lit_bufsize is not greater than 32K.)
* - if compression is not successful for a file smaller than 64K, we can
* even emit a stored file instead of a stored block (saving 5 bytes).
* This is applicable only for zip (not gzip or zlib).
* - creating new Huffman trees less frequently may not provide fast
* adaptation to changes in the input data statistics. (Take for
* example a binary file with poorly compressible code followed by
* a highly compressible string table.) Smaller buffer sizes give
* fast adaptation but have of course the overhead of transmitting
* trees more frequently.
* - I can't count above 4
*/
uInt last_lit; /* running index in l_buf */
ushf *d_buf;
/* Buffer for distances. To simplify the code, d_buf and l_buf have
* the same number of elements. To use different lengths, an extra flag
* array would be necessary.
*/
ulg opt_len; /* bit length of current block with optimal trees */
ulg static_len; /* bit length of current block with static trees */
uInt matches; /* number of string matches in current block */
uInt insert; /* bytes at end of window left to insert */
#ifdef DEBUG
ulg compressed_len; /* total bit length of compressed file mod 2^32 */
ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
#endif
ush bi_buf;
/* Output buffer. bits are inserted starting at the bottom (least
* significant bits).
*/
int bi_valid;
/* Number of valid bits in bi_buf. All bits above the last valid bit
* are always zero.
*/
ulg high_water;
/* High water mark offset in window for initialized bytes -- bytes above
* this are set to zero in order to avoid memory check warnings when
* longest match routines access bytes past the input. This is then
* updated to the new high water mark.
*/
} FAR deflate_state;
/* Output a byte on the stream.
* IN assertion: there is enough room in pending_buf.
*/
#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
/* Minimum amount of lookahead, except at the end of the input file.
* See deflate.c for comments about the MIN_MATCH+1.
*/
#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
/* In order to simplify the code, particularly on 16 bit machines, match
* distances are limited to MAX_DIST instead of WSIZE.
*/
#define WIN_INIT MAX_MATCH
/* Number of bytes after end of data in window to initialize in order to avoid
memory checker errors from longest match routines */
/* in trees.c */
void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
ulg stored_len, int last));
void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s));
void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
ulg stored_len, int last));
#define d_code(dist) \
((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
/* Mapping from a distance to a distance code. dist is the distance - 1 and
* must not have side effects. _dist_code[256] and _dist_code[257] are never
* used.
*/
#ifndef DEBUG
/* Inline versions of _tr_tally for speed: */
#if defined(GEN_TREES_H) || !defined(STDC)
extern uch ZLIB_INTERNAL _length_code[];
extern uch ZLIB_INTERNAL _dist_code[];
#else
extern const uch ZLIB_INTERNAL _length_code[];
extern const uch ZLIB_INTERNAL _dist_code[];
#endif
# define _tr_tally_lit(s, c, flush) \
{ uch cc = (c); \
s->d_buf[s->last_lit] = 0; \
s->l_buf[s->last_lit++] = cc; \
s->dyn_ltree[cc].Freq++; \
flush = (s->last_lit == s->lit_bufsize-1); \
}
# define _tr_tally_dist(s, distance, length, flush) \
{ uch len = (length); \
ush dist = (distance); \
s->d_buf[s->last_lit] = dist; \
s->l_buf[s->last_lit++] = len; \
dist--; \
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
s->dyn_dtree[d_code(dist)].Freq++; \
flush = (s->last_lit == s->lit_bufsize-1); \
}
#else
# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
# define _tr_tally_dist(s, distance, length, flush) \
flush = _tr_tally(s, distance, length)
#endif
#endif /* DEFLATE_H */

View File

@@ -1,25 +0,0 @@
/* gzclose.c -- zlib gzclose() function
* Copyright (C) 2004, 2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "gzguts.h"
/* gzclose() is in a separate file so that it is linked in only if it is used.
That way the other gzclose functions can be used instead to avoid linking in
unneeded compression or decompression routines. */
int ZEXPORT gzclose(file)
gzFile file;
{
#ifndef NO_GZCOMPRESS
gz_statep state;
if (file == NULL)
return Z_STREAM_ERROR;
state = (gz_statep)file;
return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
#else
return gzclose_r(file);
#endif
}

View File

@@ -1,209 +0,0 @@
/* gzguts.h -- zlib internal header definitions for gz* operations
* Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#ifdef _LARGEFILE64_SOURCE
# ifndef _LARGEFILE_SOURCE
# define _LARGEFILE_SOURCE 1
# endif
# ifdef _FILE_OFFSET_BITS
# undef _FILE_OFFSET_BITS
# endif
#endif
#ifdef HAVE_HIDDEN
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
#else
# define ZLIB_INTERNAL
#endif
#include <stdio.h>
#include "zlib.h"
#ifdef STDC
# include <string.h>
# include <stdlib.h>
# include <limits.h>
#endif
#include <fcntl.h>
#ifdef _WIN32
# include <stddef.h>
#endif
#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
# include <io.h>
#endif
#ifdef WINAPI_FAMILY
# define open _open
# define read _read
# define write _write
# define close _close
#endif
#ifdef NO_DEFLATE /* for compatibility with old definition */
# define NO_GZCOMPRESS
#endif
#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
# ifndef HAVE_VSNPRINTF
# define HAVE_VSNPRINTF
# endif
#endif
#if defined(__CYGWIN__)
# ifndef HAVE_VSNPRINTF
# define HAVE_VSNPRINTF
# endif
#endif
#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410)
# ifndef HAVE_VSNPRINTF
# define HAVE_VSNPRINTF
# endif
#endif
#ifndef HAVE_VSNPRINTF
# ifdef MSDOS
/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
but for now we just assume it doesn't. */
# define NO_vsnprintf
# endif
# ifdef __TURBOC__
# define NO_vsnprintf
# endif
# ifdef WIN32
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
# if !defined(vsnprintf) && !defined(NO_vsnprintf)
# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
# define vsnprintf _vsnprintf
# endif
# endif
# endif
# ifdef __SASC
# define NO_vsnprintf
# endif
# ifdef VMS
# define NO_vsnprintf
# endif
# ifdef __OS400__
# define NO_vsnprintf
# endif
# ifdef __MVS__
# define NO_vsnprintf
# endif
#endif
/* unlike snprintf (which is required in C99, yet still not supported by
Microsoft more than a decade later!), _snprintf does not guarantee null
termination of the result -- however this is only used in gzlib.c where
the result is assured to fit in the space provided */
#ifdef _MSC_VER
# define snprintf _snprintf
#endif
#ifndef local
# define local static
#endif
/* compile with -Dlocal if your debugger can't find static symbols */
/* gz* functions always use library allocation functions */
#ifndef STDC
extern voidp malloc OF((uInt size));
extern void free OF((voidpf ptr));
#endif
/* get errno and strerror definition */
#if defined UNDER_CE
# include <windows.h>
# define zstrerror() gz_strwinerror((DWORD)GetLastError())
#else
# ifndef NO_STRERROR
# include <errno.h>
# define zstrerror() strerror(errno)
# else
# define zstrerror() "stdio error (consult errno)"
# endif
#endif
/* provide prototypes for these when building zlib without LFS */
#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
#endif
/* default memLevel */
#if MAX_MEM_LEVEL >= 8
# define DEF_MEM_LEVEL 8
#else
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
#endif
/* default i/o buffer size -- double this for output when reading (this and
twice this must be able to fit in an unsigned type) */
#define GZBUFSIZE 8192
/* gzip modes, also provide a little integrity check on the passed structure */
#define GZ_NONE 0
#define GZ_READ 7247
#define GZ_WRITE 31153
#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */
/* values for gz_state how */
#define LOOK 0 /* look for a gzip header */
#define COPY 1 /* copy input directly */
#define GZIP 2 /* decompress a gzip stream */
/* internal gzip file state data structure */
typedef struct {
/* exposed contents for gzgetc() macro */
struct gzFile_s x; /* "x" for exposed */
/* x.have: number of bytes available at x.next */
/* x.next: next output data to deliver or write */
/* x.pos: current position in uncompressed data */
/* used for both reading and writing */
int mode; /* see gzip modes above */
int fd; /* file descriptor */
char *path; /* path or fd for error messages */
unsigned size; /* buffer size, zero if not allocated yet */
unsigned want; /* requested buffer size, default is GZBUFSIZE */
unsigned char *in; /* input buffer */
unsigned char *out; /* output buffer (double-sized when reading) */
int direct; /* 0 if processing gzip, 1 if transparent */
/* just for reading */
int how; /* 0: get header, 1: copy, 2: decompress */
z_off64_t start; /* where the gzip data started, for rewinding */
int eof; /* true if end of input file reached */
int past; /* true if read requested past end */
/* just for writing */
int level; /* compression level */
int strategy; /* compression strategy */
/* seek request */
z_off64_t skip; /* amount to skip (already rewound if backwards) */
int seek; /* true if seek request pending */
/* error information */
int err; /* error code */
char *msg; /* error message */
/* zlib inflate or deflate stream */
z_stream strm; /* stream structure in-place (not a pointer) */
} gz_state;
typedef gz_state FAR *gz_statep;
/* shared functions */
void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
#if defined UNDER_CE
char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
#endif
/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
value -- needed when comparing unsigned to z_off64_t, which is signed
(possible z_off64_t types off_t, off64_t, and long are all signed) */
#ifdef INT_MAX
# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
#else
unsigned ZLIB_INTERNAL gz_intmax OF((void));
# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
#endif

View File

@@ -1,634 +0,0 @@
/* gzlib.c -- zlib functions common to reading and writing gzip files
* Copyright (C) 2004, 2010, 2011, 2012, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "PrecompiledHeader.h"
#include "gzguts.h"
#if defined(_WIN32) && !defined(__BORLANDC__)
# define LSEEK _lseeki64
#else
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
# define LSEEK lseek64
#else
# define LSEEK lseek
#endif
#endif
/* Local functions */
local void gz_reset OF((gz_statep));
local gzFile gz_open OF((const void *, int, const char *));
#if defined UNDER_CE
/* Map the Windows error number in ERROR to a locale-dependent error message
string and return a pointer to it. Typically, the values for ERROR come
from GetLastError.
The string pointed to shall not be modified by the application, but may be
overwritten by a subsequent call to gz_strwinerror
The gz_strwinerror function does not change the current setting of
GetLastError. */
char ZLIB_INTERNAL *gz_strwinerror (error)
DWORD error;
{
static char buf[1024];
wchar_t *msgbuf;
DWORD lasterr = GetLastError();
DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_ALLOCATE_BUFFER,
NULL,
error,
0, /* Default language */
(LPVOID)&msgbuf,
0,
NULL);
if (chars != 0) {
/* If there is an \r\n appended, zap it. */
if (chars >= 2
&& msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') {
chars -= 2;
msgbuf[chars] = 0;
}
if (chars > sizeof (buf) - 1) {
chars = sizeof (buf) - 1;
msgbuf[chars] = 0;
}
wcstombs(buf, msgbuf, chars + 1);
LocalFree(msgbuf);
}
else {
sprintf(buf, "unknown win32 error (%ld)", error);
}
SetLastError(lasterr);
return buf;
}
#endif /* UNDER_CE */
/* Reset gzip file state */
local void gz_reset(state)
gz_statep state;
{
state->x.have = 0; /* no output data available */
if (state->mode == GZ_READ) { /* for reading ... */
state->eof = 0; /* not at end of file */
state->past = 0; /* have not read past end yet */
state->how = LOOK; /* look for gzip header */
}
state->seek = 0; /* no seek request pending */
gz_error(state, Z_OK, NULL); /* clear error */
state->x.pos = 0; /* no uncompressed data yet */
state->strm.avail_in = 0; /* no input data yet */
}
/* Open a gzip file either by name or file descriptor. */
local gzFile gz_open(path, fd, mode)
const void *path;
int fd;
const char *mode;
{
gz_statep state;
size_t len;
int oflag;
#ifdef O_CLOEXEC
int cloexec = 0;
#endif
#ifdef O_EXCL
int exclusive = 0;
#endif
/* check input */
if (path == NULL)
return NULL;
/* allocate gzFile structure to return */
state = (gz_statep)malloc(sizeof(gz_state));
if (state == NULL)
return NULL;
state->size = 0; /* no buffers allocated yet */
state->want = GZBUFSIZE; /* requested buffer size */
state->msg = NULL; /* no error message yet */
/* interpret mode */
state->mode = GZ_NONE;
state->level = Z_DEFAULT_COMPRESSION;
state->strategy = Z_DEFAULT_STRATEGY;
state->direct = 0;
while (*mode) {
if (*mode >= '0' && *mode <= '9')
state->level = *mode - '0';
else
switch (*mode) {
case 'r':
state->mode = GZ_READ;
break;
#ifndef NO_GZCOMPRESS
case 'w':
state->mode = GZ_WRITE;
break;
case 'a':
state->mode = GZ_APPEND;
break;
#endif
case '+': /* can't read and write at the same time */
free(state);
return NULL;
case 'b': /* ignore -- will request binary anyway */
break;
#ifdef O_CLOEXEC
case 'e':
cloexec = 1;
break;
#endif
#ifdef O_EXCL
case 'x':
exclusive = 1;
break;
#endif
case 'f':
state->strategy = Z_FILTERED;
break;
case 'h':
state->strategy = Z_HUFFMAN_ONLY;
break;
case 'R':
state->strategy = Z_RLE;
break;
case 'F':
state->strategy = Z_FIXED;
break;
case 'T':
state->direct = 1;
break;
default: /* could consider as an error, but just ignore */
;
}
mode++;
}
/* must provide an "r", "w", or "a" */
if (state->mode == GZ_NONE) {
free(state);
return NULL;
}
/* can't force transparent read */
if (state->mode == GZ_READ) {
if (state->direct) {
free(state);
return NULL;
}
state->direct = 1; /* for empty file */
}
/* save the path name for error messages */
#ifdef _WIN32
if (fd == -2) {
len = wcstombs(NULL, path, 0);
if (len == (size_t)-1)
len = 0;
}
else
#endif
len = strlen((const char *)path);
state->path = (char *)malloc(len + 1);
if (state->path == NULL) {
free(state);
return NULL;
}
#ifdef _WIN32
if (fd == -2)
if (len)
wcstombs(state->path, path, len + 1);
else
*(state->path) = 0;
else
#endif
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(state->path, len + 1, "%s", (const char *)path);
#else
strcpy(state->path, path);
#endif
/* compute the flags for open() */
oflag =
#ifdef O_LARGEFILE
O_LARGEFILE |
#endif
#ifdef O_BINARY
O_BINARY |
#endif
#ifdef O_CLOEXEC
(cloexec ? O_CLOEXEC : 0) |
#endif
(state->mode == GZ_READ ?
O_RDONLY :
(O_WRONLY | O_CREAT |
#ifdef O_EXCL
(exclusive ? O_EXCL : 0) |
#endif
(state->mode == GZ_WRITE ?
O_TRUNC :
O_APPEND)));
/* open the file with the appropriate flags (or just use fd) */
state->fd = fd > -1 ? fd : (
#ifdef _WIN32
fd == -2 ? _wopen(path, oflag, 0666) :
#endif
open((const char *)path, oflag, 0666));
if (state->fd == -1) {
free(state->path);
free(state);
return NULL;
}
if (state->mode == GZ_APPEND)
state->mode = GZ_WRITE; /* simplify later checks */
/* save the current position for rewinding (only if reading) */
if (state->mode == GZ_READ) {
state->start = LSEEK(state->fd, 0, SEEK_CUR);
if (state->start == -1) state->start = 0;
}
/* initialize stream */
gz_reset(state);
/* return stream */
return (gzFile)state;
}
/* -- see zlib.h -- */
gzFile ZEXPORT gzopen(path, mode)
const char *path;
const char *mode;
{
return gz_open(path, -1, mode);
}
/* -- see zlib.h -- */
gzFile ZEXPORT gzopen64(path, mode)
const char *path;
const char *mode;
{
return gz_open(path, -1, mode);
}
/* -- see zlib.h -- */
gzFile ZEXPORT gzdopen(fd, mode)
int fd;
const char *mode;
{
char *path; /* identifier for error messages */
gzFile gz;
if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
return NULL;
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd); /* for debugging */
#else
sprintf(path, "<fd:%d>", fd); /* for debugging */
#endif
gz = gz_open(path, fd, mode);
free(path);
return gz;
}
/* -- see zlib.h -- */
#ifdef _WIN32
gzFile ZEXPORT gzopen_w(path, mode)
const wchar_t *path;
const char *mode;
{
return gz_open(path, -2, mode);
}
#endif
/* -- see zlib.h -- */
int ZEXPORT gzbuffer(file, size)
gzFile file;
unsigned size;
{
gz_statep state;
/* get internal structure and check integrity */
if (file == NULL)
return -1;
state = (gz_statep)file;
if (state->mode != GZ_READ && state->mode != GZ_WRITE)
return -1;
/* make sure we haven't already allocated memory */
if (state->size != 0)
return -1;
/* check and set requested size */
if (size < 2)
size = 2; /* need two bytes to check magic header */
state->want = size;
return 0;
}
/* -- see zlib.h -- */
int ZEXPORT gzrewind(file)
gzFile file;
{
gz_statep state;
/* get internal structure */
if (file == NULL)
return -1;
state = (gz_statep)file;
/* check that we're reading and that there's no error */
if (state->mode != GZ_READ ||
(state->err != Z_OK && state->err != Z_BUF_ERROR))
return -1;
/* back up and start over */
if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
return -1;
gz_reset(state);
return 0;
}
/* -- see zlib.h -- */
z_off64_t ZEXPORT gzseek64(file, offset, whence)
gzFile file;
z_off64_t offset;
int whence;
{
unsigned n;
z_off64_t ret;
gz_statep state;
/* get internal structure and check integrity */
if (file == NULL)
return -1;
state = (gz_statep)file;
if (state->mode != GZ_READ && state->mode != GZ_WRITE)
return -1;
/* check that there's no error */
if (state->err != Z_OK && state->err != Z_BUF_ERROR)
return -1;
/* can only seek from start or relative to current position */
if (whence != SEEK_SET && whence != SEEK_CUR)
return -1;
/* normalize offset to a SEEK_CUR specification */
if (whence == SEEK_SET)
offset -= state->x.pos;
else if (state->seek)
offset += state->skip;
state->seek = 0;
/* if within raw area while reading, just go there */
if (state->mode == GZ_READ && state->how == COPY &&
state->x.pos + offset >= 0) {
ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
if (ret == -1)
return -1;
state->x.have = 0;
state->eof = 0;
state->past = 0;
state->seek = 0;
gz_error(state, Z_OK, NULL);
state->strm.avail_in = 0;
state->x.pos += offset;
return state->x.pos;
}
/* calculate skip amount, rewinding if needed for back seek when reading */
if (offset < 0) {
if (state->mode != GZ_READ) /* writing -- can't go backwards */
return -1;
offset += state->x.pos;
if (offset < 0) /* before start of file! */
return -1;
if (gzrewind(file) == -1) /* rewind, then skip to offset */
return -1;
}
/* if reading, skip what's in output buffer (one less gzgetc() check) */
if (state->mode == GZ_READ) {
n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > offset ?
(unsigned)offset : state->x.have;
state->x.have -= n;
state->x.next += n;
state->x.pos += n;
offset -= n;
}
/* request skip (if not zero) */
if (offset) {
state->seek = 1;
state->skip = offset;
}
return state->x.pos + offset;
}
/* -- see zlib.h -- */
z_off_t ZEXPORT gzseek(file, offset, whence)
gzFile file;
z_off_t offset;
int whence;
{
z_off64_t ret;
ret = gzseek64(file, (z_off64_t)offset, whence);
return ret == (z_off_t)ret ? (z_off_t)ret : -1;
}
/* -- see zlib.h -- */
z_off64_t ZEXPORT gztell64(file)
gzFile file;
{
gz_statep state;
/* get internal structure and check integrity */
if (file == NULL)
return -1;
state = (gz_statep)file;
if (state->mode != GZ_READ && state->mode != GZ_WRITE)
return -1;
/* return position */
return state->x.pos + (state->seek ? state->skip : 0);
}
/* -- see zlib.h -- */
z_off_t ZEXPORT gztell(file)
gzFile file;
{
z_off64_t ret;
ret = gztell64(file);
return ret == (z_off_t)ret ? (z_off_t)ret : -1;
}
/* -- see zlib.h -- */
z_off64_t ZEXPORT gzoffset64(file)
gzFile file;
{
z_off64_t offset;
gz_statep state;
/* get internal structure and check integrity */
if (file == NULL)
return -1;
state = (gz_statep)file;
if (state->mode != GZ_READ && state->mode != GZ_WRITE)
return -1;
/* compute and return effective offset in file */
offset = LSEEK(state->fd, 0, SEEK_CUR);
if (offset == -1)
return -1;
if (state->mode == GZ_READ) /* reading */
offset -= state->strm.avail_in; /* don't count buffered input */
return offset;
}
/* -- see zlib.h -- */
z_off_t ZEXPORT gzoffset(file)
gzFile file;
{
z_off64_t ret;
ret = gzoffset64(file);
return ret == (z_off_t)ret ? (z_off_t)ret : -1;
}
/* -- see zlib.h -- */
int ZEXPORT gzeof(file)
gzFile file;
{
gz_statep state;
/* get internal structure and check integrity */
if (file == NULL)
return 0;
state = (gz_statep)file;
if (state->mode != GZ_READ && state->mode != GZ_WRITE)
return 0;
/* return end-of-file state */
return state->mode == GZ_READ ? state->past : 0;
}
/* -- see zlib.h -- */
const char * ZEXPORT gzerror(file, errnum)
gzFile file;
int *errnum;
{
gz_statep state;
/* get internal structure and check integrity */
if (file == NULL)
return NULL;
state = (gz_statep)file;
if (state->mode != GZ_READ && state->mode != GZ_WRITE)
return NULL;
/* return error information */
if (errnum != NULL)
*errnum = state->err;
return state->err == Z_MEM_ERROR ? "out of memory" :
(state->msg == NULL ? "" : state->msg);
}
/* -- see zlib.h -- */
void ZEXPORT gzclearerr(file)
gzFile file;
{
gz_statep state;
/* get internal structure and check integrity */
if (file == NULL)
return;
state = (gz_statep)file;
if (state->mode != GZ_READ && state->mode != GZ_WRITE)
return;
/* clear error and end-of-file */
if (state->mode == GZ_READ) {
state->eof = 0;
state->past = 0;
}
gz_error(state, Z_OK, NULL);
}
/* Create an error message in allocated memory and set state->err and
state->msg accordingly. Free any previous error message already there. Do
not try to free or allocate space if the error is Z_MEM_ERROR (out of
memory). Simply save the error message as a static string. If there is an
allocation failure constructing the error message, then convert the error to
out of memory. */
void ZLIB_INTERNAL gz_error(state, err, msg)
gz_statep state;
int err;
const char *msg;
{
/* free previously allocated message and clear */
if (state->msg != NULL) {
if (state->err != Z_MEM_ERROR)
free(state->msg);
state->msg = NULL;
}
/* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */
if (err != Z_OK && err != Z_BUF_ERROR)
state->x.have = 0;
/* set error code, and if no message, then done */
state->err = err;
if (msg == NULL)
return;
/* for an out of memory error, return literal string when requested */
if (err == Z_MEM_ERROR)
return;
/* construct error message with path */
if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
NULL) {
state->err = Z_MEM_ERROR;
return;
}
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
"%s%s%s", state->path, ": ", msg);
#else
strcpy(state->msg, state->path);
strcat(state->msg, ": ");
strcat(state->msg, msg);
#endif
return;
}
#ifndef INT_MAX
/* portably return maximum value for an int (when limits.h presumed not
available) -- we need to do this to cover cases where 2's complement not
used, since C standard permits 1's complement and sign-bit representations,
otherwise we could just use ((unsigned)-1) >> 1 */
unsigned ZLIB_INTERNAL gz_intmax()
{
unsigned p, q;
p = 1;
do {
q = p;
p <<= 1;
p++;
} while (p > q);
return q >> 1;
}
#endif

View File

@@ -1,594 +0,0 @@
/* gzread.c -- zlib functions for reading gzip files
* Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "gzguts.h"
/* Local functions */
local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *));
local int gz_avail OF((gz_statep));
local int gz_look OF((gz_statep));
local int gz_decomp OF((gz_statep));
local int gz_fetch OF((gz_statep));
local int gz_skip OF((gz_statep, z_off64_t));
/* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from
state->fd, and update state->eof, state->err, and state->msg as appropriate.
This function needs to loop on read(), since read() is not guaranteed to
read the number of bytes requested, depending on the type of descriptor. */
local int gz_load(state, buf, len, have)
gz_statep state;
unsigned char *buf;
unsigned len;
unsigned *have;
{
int ret;
*have = 0;
do {
ret = read(state->fd, buf + *have, len - *have);
if (ret <= 0)
break;
*have += ret;
} while (*have < len);
if (ret < 0) {
gz_error(state, Z_ERRNO, zstrerror());
return -1;
}
if (ret == 0)
state->eof = 1;
return 0;
}
/* Load up input buffer and set eof flag if last data loaded -- return -1 on
error, 0 otherwise. Note that the eof flag is set when the end of the input
file is reached, even though there may be unused data in the buffer. Once
that data has been used, no more attempts will be made to read the file.
If strm->avail_in != 0, then the current data is moved to the beginning of
the input buffer, and then the remainder of the buffer is loaded with the
available data from the input file. */
local int gz_avail(state)
gz_statep state;
{
unsigned got;
z_streamp strm = &(state->strm);
if (state->err != Z_OK && state->err != Z_BUF_ERROR)
return -1;
if (state->eof == 0) {
if (strm->avail_in) { /* copy what's there to the start */
unsigned char *p = state->in;
unsigned const char *q = strm->next_in;
unsigned n = strm->avail_in;
do {
*p++ = *q++;
} while (--n);
}
if (gz_load(state, state->in + strm->avail_in,
state->size - strm->avail_in, &got) == -1)
return -1;
strm->avail_in += got;
strm->next_in = state->in;
}
return 0;
}
/* Look for gzip header, set up for inflate or copy. state->x.have must be 0.
If this is the first time in, allocate required memory. state->how will be
left unchanged if there is no more input data available, will be set to COPY
if there is no gzip header and direct copying will be performed, or it will
be set to GZIP for decompression. If direct copying, then leftover input
data from the input buffer will be copied to the output buffer. In that
case, all further file reads will be directly to either the output buffer or
a user buffer. If decompressing, the inflate state will be initialized.
gz_look() will return 0 on success or -1 on failure. */
local int gz_look(state)
gz_statep state;
{
z_streamp strm = &(state->strm);
/* allocate read buffers and inflate memory */
if (state->size == 0) {
/* allocate buffers */
state->in = (unsigned char *)malloc(state->want);
state->out = (unsigned char *)malloc(state->want << 1);
if (state->in == NULL || state->out == NULL) {
if (state->out != NULL)
free(state->out);
if (state->in != NULL)
free(state->in);
gz_error(state, Z_MEM_ERROR, "out of memory");
return -1;
}
state->size = state->want;
/* allocate inflate memory */
state->strm.zalloc = Z_NULL;
state->strm.zfree = Z_NULL;
state->strm.opaque = Z_NULL;
state->strm.avail_in = 0;
state->strm.next_in = Z_NULL;
if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) { /* gunzip */
free(state->out);
free(state->in);
state->size = 0;
gz_error(state, Z_MEM_ERROR, "out of memory");
return -1;
}
}
/* get at least the magic bytes in the input buffer */
if (strm->avail_in < 2) {
if (gz_avail(state) == -1)
return -1;
if (strm->avail_in == 0)
return 0;
}
/* look for gzip magic bytes -- if there, do gzip decoding (note: there is
a logical dilemma here when considering the case of a partially written
gzip file, to wit, if a single 31 byte is written, then we cannot tell
whether this is a single-byte file, or just a partially written gzip
file -- for here we assume that if a gzip file is being written, then
the header will be written in a single operation, so that reading a
single byte is sufficient indication that it is not a gzip file) */
if (strm->avail_in > 1 &&
strm->next_in[0] == 31 && strm->next_in[1] == 139) {
inflateReset(strm);
state->how = GZIP;
state->direct = 0;
return 0;
}
/* no gzip header -- if we were decoding gzip before, then this is trailing
garbage. Ignore the trailing garbage and finish. */
if (state->direct == 0) {
strm->avail_in = 0;
state->eof = 1;
state->x.have = 0;
return 0;
}
/* doing raw i/o, copy any leftover input to output -- this assumes that
the output buffer is larger than the input buffer, which also assures
space for gzungetc() */
state->x.next = state->out;
if (strm->avail_in) {
memcpy(state->x.next, strm->next_in, strm->avail_in);
state->x.have = strm->avail_in;
strm->avail_in = 0;
}
state->how = COPY;
state->direct = 1;
return 0;
}
/* Decompress from input to the provided next_out and avail_out in the state.
On return, state->x.have and state->x.next point to the just decompressed
data. If the gzip stream completes, state->how is reset to LOOK to look for
the next gzip stream or raw data, once state->x.have is depleted. Returns 0
on success, -1 on failure. */
local int gz_decomp(state)
gz_statep state;
{
int ret = Z_OK;
unsigned had;
z_streamp strm = &(state->strm);
/* fill output buffer up to end of deflate stream */
had = strm->avail_out;
do {
/* get more input for inflate() */
if (strm->avail_in == 0 && gz_avail(state) == -1)
return -1;
if (strm->avail_in == 0) {
gz_error(state, Z_BUF_ERROR, "unexpected end of file");
break;
}
/* decompress and handle errors */
ret = inflate(strm, Z_NO_FLUSH);
if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
gz_error(state, Z_STREAM_ERROR,
"internal error: inflate stream corrupt");
return -1;
}
if (ret == Z_MEM_ERROR) {
gz_error(state, Z_MEM_ERROR, "out of memory");
return -1;
}
if (ret == Z_DATA_ERROR) { /* deflate stream invalid */
gz_error(state, Z_DATA_ERROR,
strm->msg == NULL ? "compressed data error" : strm->msg);
return -1;
}
} while (strm->avail_out && ret != Z_STREAM_END);
/* update available output */
state->x.have = had - strm->avail_out;
state->x.next = strm->next_out - state->x.have;
/* if the gzip stream completed successfully, look for another */
if (ret == Z_STREAM_END)
state->how = LOOK;
/* good decompression */
return 0;
}
/* Fetch data and put it in the output buffer. Assumes state->x.have is 0.
Data is either copied from the input file or decompressed from the input
file depending on state->how. If state->how is LOOK, then a gzip header is
looked for to determine whether to copy or decompress. Returns -1 on error,
otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the
end of the input file has been reached and all data has been processed. */
local int gz_fetch(state)
gz_statep state;
{
z_streamp strm = &(state->strm);
do {
switch(state->how) {
case LOOK: /* -> LOOK, COPY (only if never GZIP), or GZIP */
if (gz_look(state) == -1)
return -1;
if (state->how == LOOK)
return 0;
break;
case COPY: /* -> COPY */
if (gz_load(state, state->out, state->size << 1, &(state->x.have))
== -1)
return -1;
state->x.next = state->out;
return 0;
case GZIP: /* -> GZIP or LOOK (if end of gzip stream) */
strm->avail_out = state->size << 1;
strm->next_out = state->out;
if (gz_decomp(state) == -1)
return -1;
}
} while (state->x.have == 0 && (!state->eof || strm->avail_in));
return 0;
}
/* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */
local int gz_skip(state, len)
gz_statep state;
z_off64_t len;
{
unsigned n;
/* skip over len bytes or reach end-of-file, whichever comes first */
while (len)
/* skip over whatever is in output buffer */
if (state->x.have) {
n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ?
(unsigned)len : state->x.have;
state->x.have -= n;
state->x.next += n;
state->x.pos += n;
len -= n;
}
/* output buffer empty -- return if we're at the end of the input */
else if (state->eof && state->strm.avail_in == 0)
break;
/* need more data to skip -- load up output buffer */
else {
/* get more output, looking for header if required */
if (gz_fetch(state) == -1)
return -1;
}
return 0;
}
/* -- see zlib.h -- */
int ZEXPORT gzread(file, buf, len)
gzFile file;
voidp buf;
unsigned len;
{
unsigned got, n;
gz_statep state;
z_streamp strm;
/* get internal structure */
if (file == NULL)
return -1;
state = (gz_statep)file;
strm = &(state->strm);
/* check that we're reading and that there's no (serious) error */
if (state->mode != GZ_READ ||
(state->err != Z_OK && state->err != Z_BUF_ERROR))
return -1;
/* since an int is returned, make sure len fits in one, otherwise return
with an error (this avoids the flaw in the interface) */
if ((int)len < 0) {
gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
return -1;
}
/* if len is zero, avoid unnecessary operations */
if (len == 0)
return 0;
/* process a skip request */
if (state->seek) {
state->seek = 0;
if (gz_skip(state, state->skip) == -1)
return -1;
}
/* get len bytes to buf, or less than len if at the end */
got = 0;
do {
/* first just try copying data from the output buffer */
if (state->x.have) {
n = state->x.have > len ? len : state->x.have;
memcpy(buf, state->x.next, n);
state->x.next += n;
state->x.have -= n;
}
/* output buffer empty -- return if we're at the end of the input */
else if (state->eof && strm->avail_in == 0) {
state->past = 1; /* tried to read past end */
break;
}
/* need output data -- for small len or new stream load up our output
buffer */
else if (state->how == LOOK || len < (state->size << 1)) {
/* get more output, looking for header if required */
if (gz_fetch(state) == -1)
return -1;
continue; /* no progress yet -- go back to copy above */
/* the copy above assures that we will leave with space in the
output buffer, allowing at least one gzungetc() to succeed */
}
/* large len -- read directly into user buffer */
else if (state->how == COPY) { /* read directly */
if (gz_load(state, (unsigned char *)buf, len, &n) == -1)
return -1;
}
/* large len -- decompress directly into user buffer */
else { /* state->how == GZIP */
strm->avail_out = len;
strm->next_out = (unsigned char *)buf;
if (gz_decomp(state) == -1)
return -1;
n = state->x.have;
state->x.have = 0;
}
/* update progress */
len -= n;
buf = (char *)buf + n;
got += n;
state->x.pos += n;
} while (len);
/* return number of bytes read into user buffer (will fit in int) */
return (int)got;
}
/* -- see zlib.h -- */
#ifdef Z_PREFIX_SET
# undef z_gzgetc
#else
# undef gzgetc
#endif
int ZEXPORT gzgetc(file)
gzFile file;
{
int ret;
unsigned char buf[1];
gz_statep state;
/* get internal structure */
if (file == NULL)
return -1;
state = (gz_statep)file;
/* check that we're reading and that there's no (serious) error */
if (state->mode != GZ_READ ||
(state->err != Z_OK && state->err != Z_BUF_ERROR))
return -1;
/* try output buffer (no need to check for skip request) */
if (state->x.have) {
state->x.have--;
state->x.pos++;
return *(state->x.next)++;
}
/* nothing there -- try gzread() */
ret = gzread(file, buf, 1);
return ret < 1 ? -1 : buf[0];
}
int ZEXPORT gzgetc_(file)
gzFile file;
{
return gzgetc(file);
}
/* -- see zlib.h -- */
int ZEXPORT gzungetc(c, file)
int c;
gzFile file;
{
gz_statep state;
/* get internal structure */
if (file == NULL)
return -1;
state = (gz_statep)file;
/* check that we're reading and that there's no (serious) error */
if (state->mode != GZ_READ ||
(state->err != Z_OK && state->err != Z_BUF_ERROR))
return -1;
/* process a skip request */
if (state->seek) {
state->seek = 0;
if (gz_skip(state, state->skip) == -1)
return -1;
}
/* can't push EOF */
if (c < 0)
return -1;
/* if output buffer empty, put byte at end (allows more pushing) */
if (state->x.have == 0) {
state->x.have = 1;
state->x.next = state->out + (state->size << 1) - 1;
state->x.next[0] = c;
state->x.pos--;
state->past = 0;
return c;
}
/* if no room, give up (must have already done a gzungetc()) */
if (state->x.have == (state->size << 1)) {
gz_error(state, Z_DATA_ERROR, "out of room to push characters");
return -1;
}
/* slide output data if needed and insert byte before existing data */
if (state->x.next == state->out) {
unsigned char *src = state->out + state->x.have;
unsigned char *dest = state->out + (state->size << 1);
while (src > state->out)
*--dest = *--src;
state->x.next = dest;
}
state->x.have++;
state->x.next--;
state->x.next[0] = c;
state->x.pos--;
state->past = 0;
return c;
}
/* -- see zlib.h -- */
char * ZEXPORT gzgets(file, buf, len)
gzFile file;
char *buf;
int len;
{
unsigned left, n;
char *str;
unsigned char *eol;
gz_statep state;
/* check parameters and get internal structure */
if (file == NULL || buf == NULL || len < 1)
return NULL;
state = (gz_statep)file;
/* check that we're reading and that there's no (serious) error */
if (state->mode != GZ_READ ||
(state->err != Z_OK && state->err != Z_BUF_ERROR))
return NULL;
/* process a skip request */
if (state->seek) {
state->seek = 0;
if (gz_skip(state, state->skip) == -1)
return NULL;
}
/* copy output bytes up to new line or len - 1, whichever comes first --
append a terminating zero to the string (we don't check for a zero in
the contents, let the user worry about that) */
str = buf;
left = (unsigned)len - 1;
if (left) do {
/* assure that something is in the output buffer */
if (state->x.have == 0 && gz_fetch(state) == -1)
return NULL; /* error */
if (state->x.have == 0) { /* end of file */
state->past = 1; /* read past end */
break; /* return what we have */
}
/* look for end-of-line in current output buffer */
n = state->x.have > left ? left : state->x.have;
eol = (unsigned char *)memchr(state->x.next, '\n', n);
if (eol != NULL)
n = (unsigned)(eol - state->x.next) + 1;
/* copy through end-of-line, or remainder if not found */
memcpy(buf, state->x.next, n);
state->x.have -= n;
state->x.next += n;
state->x.pos += n;
left -= n;
buf += n;
} while (left && eol == NULL);
/* return terminated string, or if nothing, end of file */
if (buf == str)
return NULL;
buf[0] = 0;
return str;
}
/* -- see zlib.h -- */
int ZEXPORT gzdirect(file)
gzFile file;
{
gz_statep state;
/* get internal structure */
if (file == NULL)
return 0;
state = (gz_statep)file;
/* if the state is not known, but we can find out, then do so (this is
mainly for right after a gzopen() or gzdopen()) */
if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0)
(void)gz_look(state);
/* return 1 if transparent, 0 if processing a gzip stream */
return state->direct;
}
/* -- see zlib.h -- */
int ZEXPORT gzclose_r(file)
gzFile file;
{
int ret, err;
gz_statep state;
/* get internal structure */
if (file == NULL)
return Z_STREAM_ERROR;
state = (gz_statep)file;
/* check that we're reading */
if (state->mode != GZ_READ)
return Z_STREAM_ERROR;
/* free memory and close file */
if (state->size) {
inflateEnd(&(state->strm));
free(state->out);
free(state->in);
}
err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
gz_error(state, Z_OK, NULL);
free(state->path);
ret = close(state->fd);
free(state);
return ret ? Z_ERRNO : err;
}

View File

@@ -1,578 +0,0 @@
/* gzwrite.c -- zlib functions for writing gzip files
* Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "PrecompiledHeader.h"
#include "gzguts.h"
/* Local functions */
local int gz_init OF((gz_statep));
local int gz_comp OF((gz_statep, int));
local int gz_zero OF((gz_statep, z_off64_t));
/* Initialize state for writing a gzip file. Mark initialization by setting
state->size to non-zero. Return -1 on failure or 0 on success. */
local int gz_init(state)
gz_statep state;
{
int ret;
z_streamp strm = &(state->strm);
/* allocate input buffer */
state->in = (unsigned char *)malloc(state->want);
if (state->in == NULL) {
gz_error(state, Z_MEM_ERROR, "out of memory");
return -1;
}
/* only need output buffer and deflate state if compressing */
if (!state->direct) {
/* allocate output buffer */
state->out = (unsigned char *)malloc(state->want);
if (state->out == NULL) {
free(state->in);
gz_error(state, Z_MEM_ERROR, "out of memory");
return -1;
}
/* allocate deflate memory, set up for gzip compression */
strm->zalloc = Z_NULL;
strm->zfree = Z_NULL;
strm->opaque = Z_NULL;
ret = deflateInit2(strm, state->level, Z_DEFLATED,
MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
if (ret != Z_OK) {
free(state->out);
free(state->in);
gz_error(state, Z_MEM_ERROR, "out of memory");
return -1;
}
}
/* mark state as initialized */
state->size = state->want;
/* initialize write buffer if compressing */
if (!state->direct) {
strm->avail_out = state->size;
strm->next_out = state->out;
state->x.next = strm->next_out;
}
return 0;
}
/* Compress whatever is at avail_in and next_in and write to the output file.
Return -1 if there is an error writing to the output file, otherwise 0.
flush is assumed to be a valid deflate() flush value. If flush is Z_FINISH,
then the deflate() state is reset to start a new gzip stream. If gz->direct
is true, then simply write to the output file without compressing, and
ignore flush. */
local int gz_comp(state, flush)
gz_statep state;
int flush;
{
int ret, got;
unsigned have;
z_streamp strm = &(state->strm);
/* allocate memory if this is the first time through */
if (state->size == 0 && gz_init(state) == -1)
return -1;
/* write directly if requested */
if (state->direct) {
got = write(state->fd, strm->next_in, strm->avail_in);
if (got < 0 || (unsigned)got != strm->avail_in) {
gz_error(state, Z_ERRNO, zstrerror());
return -1;
}
strm->avail_in = 0;
return 0;
}
/* run deflate() on provided input until it produces no more output */
ret = Z_OK;
do {
/* write out current buffer contents if full, or if flushing, but if
doing Z_FINISH then don't write until we get to Z_STREAM_END */
if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
(flush != Z_FINISH || ret == Z_STREAM_END))) {
have = (unsigned)(strm->next_out - state->x.next);
if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
(unsigned)got != have)) {
gz_error(state, Z_ERRNO, zstrerror());
return -1;
}
if (strm->avail_out == 0) {
strm->avail_out = state->size;
strm->next_out = state->out;
}
state->x.next = strm->next_out;
}
/* compress */
have = strm->avail_out;
ret = deflate(strm, flush);
if (ret == Z_STREAM_ERROR) {
gz_error(state, Z_STREAM_ERROR,
"internal error: deflate stream corrupt");
return -1;
}
have -= strm->avail_out;
} while (have);
/* if that completed a deflate stream, allow another to start */
if (flush == Z_FINISH)
deflateReset(strm);
/* all done, no errors */
return 0;
}
/* Compress len zeros to output. Return -1 on error, 0 on success. */
local int gz_zero(state, len)
gz_statep state;
z_off64_t len;
{
int first;
unsigned n;
z_streamp strm = &(state->strm);
/* consume whatever's left in the input buffer */
if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
return -1;
/* compress len zeros (len guaranteed > 0) */
first = 1;
while (len) {
n = GT_OFF(state->size) || (z_off64_t)state->size > len ?
(unsigned)len : state->size;
if (first) {
memset(state->in, 0, n);
first = 0;
}
strm->avail_in = n;
strm->next_in = state->in;
state->x.pos += n;
if (gz_comp(state, Z_NO_FLUSH) == -1)
return -1;
len -= n;
}
return 0;
}
/* -- see zlib.h -- */
int ZEXPORT gzwrite(file, buf, len)
gzFile file;
voidpc buf;
unsigned len;
{
unsigned put = len;
gz_statep state;
z_streamp strm;
/* get internal structure */
if (file == NULL)
return 0;
state = (gz_statep)file;
strm = &(state->strm);
/* check that we're writing and that there's no error */
if (state->mode != GZ_WRITE || state->err != Z_OK)
return 0;
/* since an int is returned, make sure len fits in one, otherwise return
with an error (this avoids the flaw in the interface) */
if ((int)len < 0) {
gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
return 0;
}
/* if len is zero, avoid unnecessary operations */
if (len == 0)
return 0;
/* allocate memory if this is the first time through */
if (state->size == 0 && gz_init(state) == -1)
return 0;
/* check for seek request */
if (state->seek) {
state->seek = 0;
if (gz_zero(state, state->skip) == -1)
return 0;
}
/* for small len, copy to input buffer, otherwise compress directly */
if (len < state->size) {
/* copy to input buffer, compress when full */
do {
unsigned have, copy;
if (strm->avail_in == 0)
strm->next_in = state->in;
have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
copy = state->size - have;
if (copy > len)
copy = len;
memcpy(state->in + have, buf, copy);
strm->avail_in += copy;
state->x.pos += copy;
buf = (const char *)buf + copy;
len -= copy;
if (len && gz_comp(state, Z_NO_FLUSH) == -1)
return 0;
} while (len);
}
else {
/* consume whatever's left in the input buffer */
if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
return 0;
/* directly compress user buffer to file */
strm->avail_in = len;
strm->next_in = (z_const Bytef *)buf;
state->x.pos += len;
if (gz_comp(state, Z_NO_FLUSH) == -1)
return 0;
}
/* input was all buffered or compressed (put will fit in int) */
return (int)put;
}
/* -- see zlib.h -- */
int ZEXPORT gzputc(file, c)
gzFile file;
int c;
{
unsigned have;
unsigned char buf[1];
gz_statep state;
z_streamp strm;
/* get internal structure */
if (file == NULL)
return -1;
state = (gz_statep)file;
strm = &(state->strm);
/* check that we're writing and that there's no error */
if (state->mode != GZ_WRITE || state->err != Z_OK)
return -1;
/* check for seek request */
if (state->seek) {
state->seek = 0;
if (gz_zero(state, state->skip) == -1)
return -1;
}
/* try writing to input buffer for speed (state->size == 0 if buffer not
initialized) */
if (state->size) {
if (strm->avail_in == 0)
strm->next_in = state->in;
have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
if (have < state->size) {
state->in[have] = c;
strm->avail_in++;
state->x.pos++;
return c & 0xff;
}
}
/* no room in buffer or not initialized, use gz_write() */
buf[0] = c;
if (gzwrite(file, buf, 1) != 1)
return -1;
return c & 0xff;
}
/* -- see zlib.h -- */
int ZEXPORT gzputs(file, str)
gzFile file;
const char *str;
{
int ret;
unsigned len;
/* write string */
len = (unsigned)strlen(str);
ret = gzwrite(file, str, len);
return ret == 0 && len != 0 ? -1 : ret;
}
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
#include <stdarg.h>
/* -- see zlib.h -- */
int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va)
{
int size, len;
gz_statep state;
z_streamp strm;
/* get internal structure */
if (file == NULL)
return -1;
state = (gz_statep)file;
strm = &(state->strm);
/* check that we're writing and that there's no error */
if (state->mode != GZ_WRITE || state->err != Z_OK)
return 0;
/* make sure we have some buffer space */
if (state->size == 0 && gz_init(state) == -1)
return 0;
/* check for seek request */
if (state->seek) {
state->seek = 0;
if (gz_zero(state, state->skip) == -1)
return 0;
}
/* consume whatever's left in the input buffer */
if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
return 0;
/* do the printf() into the input buffer, put length in len */
size = (int)(state->size);
state->in[size - 1] = 0;
#ifdef NO_vsnprintf
# ifdef HAS_vsprintf_void
(void)vsprintf((char *)(state->in), format, va);
for (len = 0; len < size; len++)
if (state->in[len] == 0) break;
# else
len = vsprintf((char *)(state->in), format, va);
# endif
#else
# ifdef HAS_vsnprintf_void
(void)vsnprintf((char *)(state->in), size, format, va);
len = strlen((char *)(state->in));
# else
len = vsnprintf((char *)(state->in), size, format, va);
# endif
#endif
/* check that printf() results fit in buffer */
if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
return 0;
/* update buffer and position, defer compression until needed */
strm->avail_in = (unsigned)len;
strm->next_in = state->in;
state->x.pos += len;
return len;
}
int ZEXPORTVA gzprintf(gzFile file, const char *format, ...)
{
va_list va;
int ret;
va_start(va, format);
ret = gzvprintf(file, format, va);
va_end(va);
return ret;
}
#else /* !STDC && !Z_HAVE_STDARG_H */
/* -- see zlib.h -- */
int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
gzFile file;
const char *format;
int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
{
int size, len;
gz_statep state;
z_streamp strm;
/* get internal structure */
if (file == NULL)
return -1;
state = (gz_statep)file;
strm = &(state->strm);
/* check that can really pass pointer in ints */
if (sizeof(int) != sizeof(void *))
return 0;
/* check that we're writing and that there's no error */
if (state->mode != GZ_WRITE || state->err != Z_OK)
return 0;
/* make sure we have some buffer space */
if (state->size == 0 && gz_init(state) == -1)
return 0;
/* check for seek request */
if (state->seek) {
state->seek = 0;
if (gz_zero(state, state->skip) == -1)
return 0;
}
/* consume whatever's left in the input buffer */
if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
return 0;
/* do the printf() into the input buffer, put length in len */
size = (int)(state->size);
state->in[size - 1] = 0;
#ifdef NO_snprintf
# ifdef HAS_sprintf_void
sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
for (len = 0; len < size; len++)
if (state->in[len] == 0) break;
# else
len = sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
# endif
#else
# ifdef HAS_snprintf_void
snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6, a7, a8,
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
len = strlen((char *)(state->in));
# else
len = snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6,
a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18,
a19, a20);
# endif
#endif
/* check that printf() results fit in buffer */
if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)
return 0;
/* update buffer and position, defer compression until needed */
strm->avail_in = (unsigned)len;
strm->next_in = state->in;
state->x.pos += len;
return len;
}
#endif
/* -- see zlib.h -- */
int ZEXPORT gzflush(file, flush)
gzFile file;
int flush;
{
gz_statep state;
/* get internal structure */
if (file == NULL)
return -1;
state = (gz_statep)file;
/* check that we're writing and that there's no error */
if (state->mode != GZ_WRITE || state->err != Z_OK)
return Z_STREAM_ERROR;
/* check flush parameter */
if (flush < 0 || flush > Z_FINISH)
return Z_STREAM_ERROR;
/* check for seek request */
if (state->seek) {
state->seek = 0;
if (gz_zero(state, state->skip) == -1)
return -1;
}
/* compress remaining data with requested flush */
gz_comp(state, flush);
return state->err;
}
/* -- see zlib.h -- */
int ZEXPORT gzsetparams(file, level, strategy)
gzFile file;
int level;
int strategy;
{
gz_statep state;
z_streamp strm;
/* get internal structure */
if (file == NULL)
return Z_STREAM_ERROR;
state = (gz_statep)file;
strm = &(state->strm);
/* check that we're writing and that there's no error */
if (state->mode != GZ_WRITE || state->err != Z_OK)
return Z_STREAM_ERROR;
/* if no change is requested, then do nothing */
if (level == state->level && strategy == state->strategy)
return Z_OK;
/* check for seek request */
if (state->seek) {
state->seek = 0;
if (gz_zero(state, state->skip) == -1)
return -1;
}
/* change compression parameters for subsequent input */
if (state->size) {
/* flush previous input with previous parameters before changing */
if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1)
return state->err;
deflateParams(strm, level, strategy);
}
state->level = level;
state->strategy = strategy;
return Z_OK;
}
/* -- see zlib.h -- */
int ZEXPORT gzclose_w(file)
gzFile file;
{
int ret = Z_OK;
gz_statep state;
/* get internal structure */
if (file == NULL)
return Z_STREAM_ERROR;
state = (gz_statep)file;
/* check that we're writing */
if (state->mode != GZ_WRITE)
return Z_STREAM_ERROR;
/* check for seek request */
if (state->seek) {
state->seek = 0;
if (gz_zero(state, state->skip) == -1)
ret = state->err;
}
/* flush, free memory, and close file */
if (gz_comp(state, Z_FINISH) == -1)
ret = state->err;
if (state->size) {
if (!state->direct) {
(void)deflateEnd(&(state->strm));
free(state->out);
}
free(state->in);
}
gz_error(state, Z_OK, NULL);
free(state->path);
if (close(state->fd) == -1)
ret = Z_ERRNO;
free(state);
return ret;
}

View File

@@ -1,640 +0,0 @@
/* infback.c -- inflate using a call-back interface
* Copyright (C) 1995-2011 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/*
This code is largely copied from inflate.c. Normally either infback.o or
inflate.o would be linked into an application--not both. The interface
with inffast.c is retained so that optimized assembler-coded versions of
inflate_fast() can be used with either inflate.c or infback.c.
*/
#include "zutil.h"
#include "inftrees.h"
#include "inflate.h"
#include "inffast.h"
/* function prototypes */
local void fixedtables OF((struct inflate_state FAR *state));
/*
strm provides memory allocation functions in zalloc and zfree, or
Z_NULL to use the library memory allocation functions.
windowBits is in the range 8..15, and window is a user-supplied
window and output buffer that is 2**windowBits bytes.
*/
int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)
z_streamp strm;
int windowBits;
unsigned char FAR *window;
const char *version;
int stream_size;
{
struct inflate_state FAR *state;
if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
stream_size != (int)(sizeof(z_stream)))
return Z_VERSION_ERROR;
if (strm == Z_NULL || window == Z_NULL ||
windowBits < 8 || windowBits > 15)
return Z_STREAM_ERROR;
strm->msg = Z_NULL; /* in case we return an error */
if (strm->zalloc == (alloc_func)0) {
#ifdef Z_SOLO
return Z_STREAM_ERROR;
#else
strm->zalloc = zcalloc;
strm->opaque = (voidpf)0;
#endif
}
if (strm->zfree == (free_func)0)
#ifdef Z_SOLO
return Z_STREAM_ERROR;
#else
strm->zfree = zcfree;
#endif
state = (struct inflate_state FAR *)ZALLOC(strm, 1,
sizeof(struct inflate_state));
if (state == Z_NULL) return Z_MEM_ERROR;
Tracev((stderr, "inflate: allocated\n"));
strm->state = (struct internal_state FAR *)state;
state->dmax = 32768U;
state->wbits = windowBits;
state->wsize = 1U << windowBits;
state->window = window;
state->wnext = 0;
state->whave = 0;
return Z_OK;
}
/*
Return state with length and distance decoding tables and index sizes set to
fixed code decoding. Normally this returns fixed tables from inffixed.h.
If BUILDFIXED is defined, then instead this routine builds the tables the
first time it's called, and returns those tables the first time and
thereafter. This reduces the size of the code by about 2K bytes, in
exchange for a little execution time. However, BUILDFIXED should not be
used for threaded applications, since the rewriting of the tables and virgin
may not be thread-safe.
*/
local void fixedtables(state)
struct inflate_state FAR *state;
{
#ifdef BUILDFIXED
static int virgin = 1;
static code *lenfix, *distfix;
static code fixed[544];
/* build fixed huffman tables if first call (may not be thread safe) */
if (virgin) {
unsigned sym, bits;
static code *next;
/* literal/length table */
sym = 0;
while (sym < 144) state->lens[sym++] = 8;
while (sym < 256) state->lens[sym++] = 9;
while (sym < 280) state->lens[sym++] = 7;
while (sym < 288) state->lens[sym++] = 8;
next = fixed;
lenfix = next;
bits = 9;
inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
/* distance table */
sym = 0;
while (sym < 32) state->lens[sym++] = 5;
distfix = next;
bits = 5;
inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
/* do this just once */
virgin = 0;
}
#else /* !BUILDFIXED */
# include "inffixed.h"
#endif /* BUILDFIXED */
state->lencode = lenfix;
state->lenbits = 9;
state->distcode = distfix;
state->distbits = 5;
}
/* Macros for inflateBack(): */
/* Load returned state from inflate_fast() */
#define LOAD() \
do { \
put = strm->next_out; \
left = strm->avail_out; \
next = strm->next_in; \
have = strm->avail_in; \
hold = state->hold; \
bits = state->bits; \
} while (0)
/* Set state from registers for inflate_fast() */
#define RESTORE() \
do { \
strm->next_out = put; \
strm->avail_out = left; \
strm->next_in = next; \
strm->avail_in = have; \
state->hold = hold; \
state->bits = bits; \
} while (0)
/* Clear the input bit accumulator */
#define INITBITS() \
do { \
hold = 0; \
bits = 0; \
} while (0)
/* Assure that some input is available. If input is requested, but denied,
then return a Z_BUF_ERROR from inflateBack(). */
#define PULL() \
do { \
if (have == 0) { \
have = in(in_desc, &next); \
if (have == 0) { \
next = Z_NULL; \
ret = Z_BUF_ERROR; \
goto inf_leave; \
} \
} \
} while (0)
/* Get a byte of input into the bit accumulator, or return from inflateBack()
with an error if there is no input available. */
#define PULLBYTE() \
do { \
PULL(); \
have--; \
hold += (unsigned long)(*next++) << bits; \
bits += 8; \
} while (0)
/* Assure that there are at least n bits in the bit accumulator. If there is
not enough available input to do that, then return from inflateBack() with
an error. */
#define NEEDBITS(n) \
do { \
while (bits < (unsigned)(n)) \
PULLBYTE(); \
} while (0)
/* Return the low n bits of the bit accumulator (n < 16) */
#define BITS(n) \
((unsigned)hold & ((1U << (n)) - 1))
/* Remove n bits from the bit accumulator */
#define DROPBITS(n) \
do { \
hold >>= (n); \
bits -= (unsigned)(n); \
} while (0)
/* Remove zero to seven bits as needed to go to a byte boundary */
#define BYTEBITS() \
do { \
hold >>= bits & 7; \
bits -= bits & 7; \
} while (0)
/* Assure that some output space is available, by writing out the window
if it's full. If the write fails, return from inflateBack() with a
Z_BUF_ERROR. */
#define ROOM() \
do { \
if (left == 0) { \
put = state->window; \
left = state->wsize; \
state->whave = left; \
if (out(out_desc, put, left)) { \
ret = Z_BUF_ERROR; \
goto inf_leave; \
} \
} \
} while (0)
/*
strm provides the memory allocation functions and window buffer on input,
and provides information on the unused input on return. For Z_DATA_ERROR
returns, strm will also provide an error message.
in() and out() are the call-back input and output functions. When
inflateBack() needs more input, it calls in(). When inflateBack() has
filled the window with output, or when it completes with data in the
window, it calls out() to write out the data. The application must not
change the provided input until in() is called again or inflateBack()
returns. The application must not change the window/output buffer until
inflateBack() returns.
in() and out() are called with a descriptor parameter provided in the
inflateBack() call. This parameter can be a structure that provides the
information required to do the read or write, as well as accumulated
information on the input and output such as totals and check values.
in() should return zero on failure. out() should return non-zero on
failure. If either in() or out() fails, than inflateBack() returns a
Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it
was in() or out() that caused in the error. Otherwise, inflateBack()
returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
error, or Z_MEM_ERROR if it could not allocate memory for the state.
inflateBack() can also return Z_STREAM_ERROR if the input parameters
are not correct, i.e. strm is Z_NULL or the state was not initialized.
*/
int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)
z_streamp strm;
in_func in;
void FAR *in_desc;
out_func out;
void FAR *out_desc;
{
struct inflate_state FAR *state;
z_const unsigned char FAR *next; /* next input */
unsigned char FAR *put; /* next output */
unsigned have, left; /* available input and output */
unsigned long hold; /* bit buffer */
unsigned bits; /* bits in bit buffer */
unsigned copy; /* number of stored or match bytes to copy */
unsigned char FAR *from; /* where to copy match bytes from */
code here; /* current decoding table entry */
code last; /* parent table entry */
unsigned len; /* length to copy for repeats, bits to drop */
int ret; /* return code */
static const unsigned short order[19] = /* permutation of code lengths */
{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
/* Check that the strm exists and that the state was initialized */
if (strm == Z_NULL || strm->state == Z_NULL)
return Z_STREAM_ERROR;
state = (struct inflate_state FAR *)strm->state;
/* Reset the state */
strm->msg = Z_NULL;
state->mode = TYPE;
state->last = 0;
state->whave = 0;
next = strm->next_in;
have = next != Z_NULL ? strm->avail_in : 0;
hold = 0;
bits = 0;
put = state->window;
left = state->wsize;
/* Inflate until end of block marked as last */
for (;;)
switch (state->mode) {
case TYPE:
/* determine and dispatch block type */
if (state->last) {
BYTEBITS();
state->mode = DONE;
break;
}
NEEDBITS(3);
state->last = BITS(1);
DROPBITS(1);
switch (BITS(2)) {
case 0: /* stored block */
Tracev((stderr, "inflate: stored block%s\n",
state->last ? " (last)" : ""));
state->mode = STORED;
break;
case 1: /* fixed block */
fixedtables(state);
Tracev((stderr, "inflate: fixed codes block%s\n",
state->last ? " (last)" : ""));
state->mode = LEN; /* decode codes */
break;
case 2: /* dynamic block */
Tracev((stderr, "inflate: dynamic codes block%s\n",
state->last ? " (last)" : ""));
state->mode = TABLE;
break;
case 3:
strm->msg = (char *)"invalid block type";
state->mode = BAD;
}
DROPBITS(2);
break;
case STORED:
/* get and verify stored block length */
BYTEBITS(); /* go to byte boundary */
NEEDBITS(32);
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
strm->msg = (char *)"invalid stored block lengths";
state->mode = BAD;
break;
}
state->length = (unsigned)hold & 0xffff;
Tracev((stderr, "inflate: stored length %u\n",
state->length));
INITBITS();
/* copy stored block from input to output */
while (state->length != 0) {
copy = state->length;
PULL();
ROOM();
if (copy > have) copy = have;
if (copy > left) copy = left;
zmemcpy(put, next, copy);
have -= copy;
next += copy;
left -= copy;
put += copy;
state->length -= copy;
}
Tracev((stderr, "inflate: stored end\n"));
state->mode = TYPE;
break;
case TABLE:
/* get dynamic table entries descriptor */
NEEDBITS(14);
state->nlen = BITS(5) + 257;
DROPBITS(5);
state->ndist = BITS(5) + 1;
DROPBITS(5);
state->ncode = BITS(4) + 4;
DROPBITS(4);
#ifndef PKZIP_BUG_WORKAROUND
if (state->nlen > 286 || state->ndist > 30) {
strm->msg = (char *)"too many length or distance symbols";
state->mode = BAD;
break;
}
#endif
Tracev((stderr, "inflate: table sizes ok\n"));
/* get code length code lengths (not a typo) */
state->have = 0;
while (state->have < state->ncode) {
NEEDBITS(3);
state->lens[order[state->have++]] = (unsigned short)BITS(3);
DROPBITS(3);
}
while (state->have < 19)
state->lens[order[state->have++]] = 0;
state->next = state->codes;
state->lencode = (code const FAR *)(state->next);
state->lenbits = 7;
ret = inflate_table(CODES, state->lens, 19, &(state->next),
&(state->lenbits), state->work);
if (ret) {
strm->msg = (char *)"invalid code lengths set";
state->mode = BAD;
break;
}
Tracev((stderr, "inflate: code lengths ok\n"));
/* get length and distance code code lengths */
state->have = 0;
while (state->have < state->nlen + state->ndist) {
for (;;) {
here = state->lencode[BITS(state->lenbits)];
if ((unsigned)(here.bits) <= bits) break;
PULLBYTE();
}
if (here.val < 16) {
DROPBITS(here.bits);
state->lens[state->have++] = here.val;
}
else {
if (here.val == 16) {
NEEDBITS(here.bits + 2);
DROPBITS(here.bits);
if (state->have == 0) {
strm->msg = (char *)"invalid bit length repeat";
state->mode = BAD;
break;
}
len = (unsigned)(state->lens[state->have - 1]);
copy = 3 + BITS(2);
DROPBITS(2);
}
else if (here.val == 17) {
NEEDBITS(here.bits + 3);
DROPBITS(here.bits);
len = 0;
copy = 3 + BITS(3);
DROPBITS(3);
}
else {
NEEDBITS(here.bits + 7);
DROPBITS(here.bits);
len = 0;
copy = 11 + BITS(7);
DROPBITS(7);
}
if (state->have + copy > state->nlen + state->ndist) {
strm->msg = (char *)"invalid bit length repeat";
state->mode = BAD;
break;
}
while (copy--)
state->lens[state->have++] = (unsigned short)len;
}
}
/* handle error breaks in while */
if (state->mode == BAD) break;
/* check for end-of-block code (better have one) */
if (state->lens[256] == 0) {
strm->msg = (char *)"invalid code -- missing end-of-block";
state->mode = BAD;
break;
}
/* build code tables -- note: do not change the lenbits or distbits
values here (9 and 6) without reading the comments in inftrees.h
concerning the ENOUGH constants, which depend on those values */
state->next = state->codes;
state->lencode = (code const FAR *)(state->next);
state->lenbits = 9;
ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
&(state->lenbits), state->work);
if (ret) {
strm->msg = (char *)"invalid literal/lengths set";
state->mode = BAD;
break;
}
state->distcode = (code const FAR *)(state->next);
state->distbits = 6;
ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
&(state->next), &(state->distbits), state->work);
if (ret) {
strm->msg = (char *)"invalid distances set";
state->mode = BAD;
break;
}
Tracev((stderr, "inflate: codes ok\n"));
state->mode = LEN;
case LEN:
/* use inflate_fast() if we have enough input and output */
if (have >= 6 && left >= 258) {
RESTORE();
if (state->whave < state->wsize)
state->whave = state->wsize - left;
inflate_fast(strm, state->wsize);
LOAD();
break;
}
/* get a literal, length, or end-of-block code */
for (;;) {
here = state->lencode[BITS(state->lenbits)];
if ((unsigned)(here.bits) <= bits) break;
PULLBYTE();
}
if (here.op && (here.op & 0xf0) == 0) {
last = here;
for (;;) {
here = state->lencode[last.val +
(BITS(last.bits + last.op) >> last.bits)];
if ((unsigned)(last.bits + here.bits) <= bits) break;
PULLBYTE();
}
DROPBITS(last.bits);
}
DROPBITS(here.bits);
state->length = (unsigned)here.val;
/* process literal */
if (here.op == 0) {
Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
"inflate: literal '%c'\n" :
"inflate: literal 0x%02x\n", here.val));
ROOM();
*put++ = (unsigned char)(state->length);
left--;
state->mode = LEN;
break;
}
/* process end of block */
if (here.op & 32) {
Tracevv((stderr, "inflate: end of block\n"));
state->mode = TYPE;
break;
}
/* invalid code */
if (here.op & 64) {
strm->msg = (char *)"invalid literal/length code";
state->mode = BAD;
break;
}
/* length code -- get extra bits, if any */
state->extra = (unsigned)(here.op) & 15;
if (state->extra != 0) {
NEEDBITS(state->extra);
state->length += BITS(state->extra);
DROPBITS(state->extra);
}
Tracevv((stderr, "inflate: length %u\n", state->length));
/* get distance code */
for (;;) {
here = state->distcode[BITS(state->distbits)];
if ((unsigned)(here.bits) <= bits) break;
PULLBYTE();
}
if ((here.op & 0xf0) == 0) {
last = here;
for (;;) {
here = state->distcode[last.val +
(BITS(last.bits + last.op) >> last.bits)];
if ((unsigned)(last.bits + here.bits) <= bits) break;
PULLBYTE();
}
DROPBITS(last.bits);
}
DROPBITS(here.bits);
if (here.op & 64) {
strm->msg = (char *)"invalid distance code";
state->mode = BAD;
break;
}
state->offset = (unsigned)here.val;
/* get distance extra bits, if any */
state->extra = (unsigned)(here.op) & 15;
if (state->extra != 0) {
NEEDBITS(state->extra);
state->offset += BITS(state->extra);
DROPBITS(state->extra);
}
if (state->offset > state->wsize - (state->whave < state->wsize ?
left : 0)) {
strm->msg = (char *)"invalid distance too far back";
state->mode = BAD;
break;
}
Tracevv((stderr, "inflate: distance %u\n", state->offset));
/* copy match from window to output */
do {
ROOM();
copy = state->wsize - state->offset;
if (copy < left) {
from = put + copy;
copy = left - copy;
}
else {
from = put - state->offset;
copy = left;
}
if (copy > state->length) copy = state->length;
state->length -= copy;
left -= copy;
do {
*put++ = *from++;
} while (--copy);
} while (state->length != 0);
break;
case DONE:
/* inflate stream terminated properly -- write leftover output */
ret = Z_STREAM_END;
if (left < state->wsize) {
if (out(out_desc, state->window, state->wsize - left))
ret = Z_BUF_ERROR;
}
goto inf_leave;
case BAD:
ret = Z_DATA_ERROR;
goto inf_leave;
default: /* can't happen, but makes compilers happy */
ret = Z_STREAM_ERROR;
goto inf_leave;
}
/* Return unused input */
inf_leave:
strm->next_in = next;
strm->avail_in = have;
return ret;
}
int ZEXPORT inflateBackEnd(strm)
z_streamp strm;
{
if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
return Z_STREAM_ERROR;
ZFREE(strm, strm->state);
strm->state = Z_NULL;
Tracev((stderr, "inflate: end\n"));
return Z_OK;
}

View File

@@ -1,340 +0,0 @@
/* inffast.c -- fast decoding
* Copyright (C) 1995-2008, 2010, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
#include "inftrees.h"
#include "inflate.h"
#include "inffast.h"
#ifndef ASMINF
/* Allow machine dependent optimization for post-increment or pre-increment.
Based on testing to date,
Pre-increment preferred for:
- PowerPC G3 (Adler)
- MIPS R5000 (Randers-Pehrson)
Post-increment preferred for:
- none
No measurable difference:
- Pentium III (Anderson)
- M68060 (Nikl)
*/
#ifdef POSTINC
# define OFF 0
# define PUP(a) *(a)++
#else
# define OFF 1
# define PUP(a) *++(a)
#endif
/*
Decode literal, length, and distance codes and write out the resulting
literal and match bytes until either not enough input or output is
available, an end-of-block is encountered, or a data error is encountered.
When large enough input and output buffers are supplied to inflate(), for
example, a 16K input buffer and a 64K output buffer, more than 95% of the
inflate execution time is spent in this routine.
Entry assumptions:
state->mode == LEN
strm->avail_in >= 6
strm->avail_out >= 258
start >= strm->avail_out
state->bits < 8
On return, state->mode is one of:
LEN -- ran out of enough output space or enough available input
TYPE -- reached end of block code, inflate() to interpret next block
BAD -- error in block data
Notes:
- The maximum input bits used by a length/distance pair is 15 bits for the
length code, 5 bits for the length extra, 15 bits for the distance code,
and 13 bits for the distance extra. This totals 48 bits, or six bytes.
Therefore if strm->avail_in >= 6, then there is enough input to avoid
checking for available input while decoding.
- The maximum bytes that a single length/distance pair can output is 258
bytes, which is the maximum length that can be coded. inflate_fast()
requires strm->avail_out >= 258 for each loop to avoid checking for
output space.
*/
void ZLIB_INTERNAL inflate_fast(strm, start)
z_streamp strm;
unsigned start; /* inflate()'s starting value for strm->avail_out */
{
struct inflate_state FAR *state;
z_const unsigned char FAR *in; /* local strm->next_in */
z_const unsigned char FAR *last; /* have enough input while in < last */
unsigned char FAR *out; /* local strm->next_out */
unsigned char FAR *beg; /* inflate()'s initial strm->next_out */
unsigned char FAR *end; /* while out < end, enough space available */
#ifdef INFLATE_STRICT
unsigned dmax; /* maximum distance from zlib header */
#endif
unsigned wsize; /* window size or zero if not using window */
unsigned whave; /* valid bytes in the window */
unsigned wnext; /* window write index */
unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
unsigned long hold; /* local strm->hold */
unsigned bits; /* local strm->bits */
code const FAR *lcode; /* local strm->lencode */
code const FAR *dcode; /* local strm->distcode */
unsigned lmask; /* mask for first level of length codes */
unsigned dmask; /* mask for first level of distance codes */
code here; /* retrieved table entry */
unsigned op; /* code bits, operation, extra bits, or */
/* window position, window bytes to copy */
unsigned len; /* match length, unused bytes */
unsigned dist; /* match distance */
unsigned char FAR *from; /* where to copy match from */
/* copy state to local variables */
state = (struct inflate_state FAR *)strm->state;
in = strm->next_in - OFF;
last = in + (strm->avail_in - 5);
out = strm->next_out - OFF;
beg = out - (start - strm->avail_out);
end = out + (strm->avail_out - 257);
#ifdef INFLATE_STRICT
dmax = state->dmax;
#endif
wsize = state->wsize;
whave = state->whave;
wnext = state->wnext;
window = state->window;
hold = state->hold;
bits = state->bits;
lcode = state->lencode;
dcode = state->distcode;
lmask = (1U << state->lenbits) - 1;
dmask = (1U << state->distbits) - 1;
/* decode literals and length/distances until end-of-block or not enough
input data or output space */
do {
if (bits < 15) {
hold += (unsigned long)(PUP(in)) << bits;
bits += 8;
hold += (unsigned long)(PUP(in)) << bits;
bits += 8;
}
here = lcode[hold & lmask];
dolen:
op = (unsigned)(here.bits);
hold >>= op;
bits -= op;
op = (unsigned)(here.op);
if (op == 0) { /* literal */
Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
"inflate: literal '%c'\n" :
"inflate: literal 0x%02x\n", here.val));
PUP(out) = (unsigned char)(here.val);
}
else if (op & 16) { /* length base */
len = (unsigned)(here.val);
op &= 15; /* number of extra bits */
if (op) {
if (bits < op) {
hold += (unsigned long)(PUP(in)) << bits;
bits += 8;
}
len += (unsigned)hold & ((1U << op) - 1);
hold >>= op;
bits -= op;
}
Tracevv((stderr, "inflate: length %u\n", len));
if (bits < 15) {
hold += (unsigned long)(PUP(in)) << bits;
bits += 8;
hold += (unsigned long)(PUP(in)) << bits;
bits += 8;
}
here = dcode[hold & dmask];
dodist:
op = (unsigned)(here.bits);
hold >>= op;
bits -= op;
op = (unsigned)(here.op);
if (op & 16) { /* distance base */
dist = (unsigned)(here.val);
op &= 15; /* number of extra bits */
if (bits < op) {
hold += (unsigned long)(PUP(in)) << bits;
bits += 8;
if (bits < op) {
hold += (unsigned long)(PUP(in)) << bits;
bits += 8;
}
}
dist += (unsigned)hold & ((1U << op) - 1);
#ifdef INFLATE_STRICT
if (dist > dmax) {
strm->msg = (char *)"invalid distance too far back";
state->mode = BAD;
break;
}
#endif
hold >>= op;
bits -= op;
Tracevv((stderr, "inflate: distance %u\n", dist));
op = (unsigned)(out - beg); /* max distance in output */
if (dist > op) { /* see if copy from window */
op = dist - op; /* distance back in window */
if (op > whave) {
if (state->sane) {
strm->msg =
(char *)"invalid distance too far back";
state->mode = BAD;
break;
}
#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
if (len <= op - whave) {
do {
PUP(out) = 0;
} while (--len);
continue;
}
len -= op - whave;
do {
PUP(out) = 0;
} while (--op > whave);
if (op == 0) {
from = out - dist;
do {
PUP(out) = PUP(from);
} while (--len);
continue;
}
#endif
}
from = window - OFF;
if (wnext == 0) { /* very common case */
from += wsize - op;
if (op < len) { /* some from window */
len -= op;
do {
PUP(out) = PUP(from);
} while (--op);
from = out - dist; /* rest from output */
}
}
else if (wnext < op) { /* wrap around window */
from += wsize + wnext - op;
op -= wnext;
if (op < len) { /* some from end of window */
len -= op;
do {
PUP(out) = PUP(from);
} while (--op);
from = window - OFF;
if (wnext < len) { /* some from start of window */
op = wnext;
len -= op;
do {
PUP(out) = PUP(from);
} while (--op);
from = out - dist; /* rest from output */
}
}
}
else { /* contiguous in window */
from += wnext - op;
if (op < len) { /* some from window */
len -= op;
do {
PUP(out) = PUP(from);
} while (--op);
from = out - dist; /* rest from output */
}
}
while (len > 2) {
PUP(out) = PUP(from);
PUP(out) = PUP(from);
PUP(out) = PUP(from);
len -= 3;
}
if (len) {
PUP(out) = PUP(from);
if (len > 1)
PUP(out) = PUP(from);
}
}
else {
from = out - dist; /* copy direct from output */
do { /* minimum length is three */
PUP(out) = PUP(from);
PUP(out) = PUP(from);
PUP(out) = PUP(from);
len -= 3;
} while (len > 2);
if (len) {
PUP(out) = PUP(from);
if (len > 1)
PUP(out) = PUP(from);
}
}
}
else if ((op & 64) == 0) { /* 2nd level distance code */
here = dcode[here.val + (hold & ((1U << op) - 1))];
goto dodist;
}
else {
strm->msg = (char *)"invalid distance code";
state->mode = BAD;
break;
}
}
else if ((op & 64) == 0) { /* 2nd level length code */
here = lcode[here.val + (hold & ((1U << op) - 1))];
goto dolen;
}
else if (op & 32) { /* end-of-block */
Tracevv((stderr, "inflate: end of block\n"));
state->mode = TYPE;
break;
}
else {
strm->msg = (char *)"invalid literal/length code";
state->mode = BAD;
break;
}
} while (in < last && out < end);
/* return unused bytes (on entry, bits < 8, so in won't go too far back) */
len = bits >> 3;
in -= len;
bits -= len << 3;
hold &= (1U << bits) - 1;
/* update state and return */
strm->next_in = in + OFF;
strm->next_out = out + OFF;
strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
strm->avail_out = (unsigned)(out < end ?
257 + (end - out) : 257 - (out - end));
state->hold = hold;
state->bits = bits;
return;
}
/*
inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
- Using bit fields for code structure
- Different op definition to avoid & for extra bits (do & for table bits)
- Three separate decoding do-loops for direct, window, and wnext == 0
- Special case for distance > 1 copies to do overlapped load and store copy
- Explicit branch predictions (based on measured branch probabilities)
- Deferring match copy and interspersed it with decoding subsequent codes
- Swapping literal/length else
- Swapping window/direct else
- Larger unrolled copy loops (three is about right)
- Moving len -= 3 statement into middle of loop
*/
#endif /* !ASMINF */

View File

@@ -1,11 +0,0 @@
/* inffast.h -- header to use inffast.c
* Copyright (C) 1995-2003, 2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));

View File

@@ -1,94 +0,0 @@
/* inffixed.h -- table for decoding fixed codes
* Generated automatically by makefixed().
*/
/* WARNING: this file should *not* be used by applications.
It is part of the implementation of this library and is
subject to change. Applications should only use zlib.h.
*/
static const code lenfix[512] = {
{96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
{0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
{0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
{0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
{0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
{21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
{0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
{0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
{18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
{0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
{0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
{0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
{20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
{0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
{0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
{0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
{16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
{0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
{0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
{0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
{0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
{0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
{0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
{0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
{17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
{0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
{0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
{0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
{19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
{0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
{0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
{0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
{16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
{0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
{0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
{0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
{0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
{20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
{0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
{0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
{17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
{0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
{0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
{0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
{20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
{0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
{0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
{0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
{16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
{0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
{0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
{0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
{0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
{0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
{0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
{0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
{16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
{0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
{0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
{0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
{19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
{0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
{0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
{0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
{16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
{0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
{0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
{0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
{0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
{64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
{0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
{0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
{18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
{0,9,255}
};
static const code distfix[32] = {
{16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
{21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
{18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
{19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
{16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
{22,5,193},{64,5,0}
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,122 +0,0 @@
/* inflate.h -- internal inflate state definition
* Copyright (C) 1995-2009 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
/* define NO_GZIP when compiling if you want to disable gzip header and
trailer decoding by inflate(). NO_GZIP would be used to avoid linking in
the crc code when it is not needed. For shared libraries, gzip decoding
should be left enabled. */
#ifndef NO_GZIP
# define GUNZIP
#endif
/* Possible inflate modes between inflate() calls */
typedef enum {
HEAD, /* i: waiting for magic header */
FLAGS, /* i: waiting for method and flags (gzip) */
TIME, /* i: waiting for modification time (gzip) */
OS, /* i: waiting for extra flags and operating system (gzip) */
EXLEN, /* i: waiting for extra length (gzip) */
EXTRA, /* i: waiting for extra bytes (gzip) */
NAME, /* i: waiting for end of file name (gzip) */
COMMENT, /* i: waiting for end of comment (gzip) */
HCRC, /* i: waiting for header crc (gzip) */
DICTID, /* i: waiting for dictionary check value */
DICT, /* waiting for inflateSetDictionary() call */
TYPE, /* i: waiting for type bits, including last-flag bit */
TYPEDO, /* i: same, but skip check to exit inflate on new block */
STORED, /* i: waiting for stored size (length and complement) */
COPY_, /* i/o: same as COPY below, but only first time in */
COPY, /* i/o: waiting for input or output to copy stored block */
TABLE, /* i: waiting for dynamic block table lengths */
LENLENS, /* i: waiting for code length code lengths */
CODELENS, /* i: waiting for length/lit and distance code lengths */
LEN_, /* i: same as LEN below, but only first time in */
LEN, /* i: waiting for length/lit/eob code */
LENEXT, /* i: waiting for length extra bits */
DIST, /* i: waiting for distance code */
DISTEXT, /* i: waiting for distance extra bits */
MATCH, /* o: waiting for output space to copy string */
LIT, /* o: waiting for output space to write literal */
CHECK, /* i: waiting for 32-bit check value */
LENGTH, /* i: waiting for 32-bit length (gzip) */
DONE, /* finished check, done -- remain here until reset */
BAD, /* got a data error -- remain here until reset */
MEM, /* got an inflate() memory error -- remain here until reset */
SYNC /* looking for synchronization bytes to restart inflate() */
} inflate_mode;
/*
State transitions between above modes -
(most modes can go to BAD or MEM on error -- not shown for clarity)
Process header:
HEAD -> (gzip) or (zlib) or (raw)
(gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
HCRC -> TYPE
(zlib) -> DICTID or TYPE
DICTID -> DICT -> TYPE
(raw) -> TYPEDO
Read deflate blocks:
TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
STORED -> COPY_ -> COPY -> TYPE
TABLE -> LENLENS -> CODELENS -> LEN_
LEN_ -> LEN
Read deflate codes in fixed or dynamic block:
LEN -> LENEXT or LIT or TYPE
LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
LIT -> LEN
Process trailer:
CHECK -> LENGTH -> DONE
*/
/* state maintained between inflate() calls. Approximately 10K bytes. */
struct inflate_state {
inflate_mode mode; /* current inflate mode */
int last; /* true if processing last block */
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
int havedict; /* true if dictionary provided */
int flags; /* gzip header method and flags (0 if zlib) */
unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */
unsigned long check; /* protected copy of check value */
unsigned long total; /* protected copy of output count */
gz_headerp head; /* where to save gzip header information */
/* sliding window */
unsigned wbits; /* log base 2 of requested window size */
unsigned wsize; /* window size or zero if not using window */
unsigned whave; /* valid bytes in the window */
unsigned wnext; /* window write index */
unsigned char FAR *window; /* allocated sliding window, if needed */
/* bit accumulator */
unsigned long hold; /* input bit accumulator */
unsigned bits; /* number of bits in "in" */
/* for string and stored block copying */
unsigned length; /* literal or length of data to copy */
unsigned offset; /* distance back to copy string from */
/* for table and code decoding */
unsigned extra; /* extra bits needed */
/* fixed and dynamic code tables */
code const FAR *lencode; /* starting table for length/literal codes */
code const FAR *distcode; /* starting table for distance codes */
unsigned lenbits; /* index bits for lencode */
unsigned distbits; /* index bits for distcode */
/* dynamic table building */
unsigned ncode; /* number of code length code lengths */
unsigned nlen; /* number of length code lengths */
unsigned ndist; /* number of distance code lengths */
unsigned have; /* number of code lengths in lens[] */
code FAR *next; /* next available space in codes[] */
unsigned short lens[320]; /* temporary storage for code lengths */
unsigned short work[288]; /* work area for code table building */
code codes[ENOUGH]; /* space for code tables */
int sane; /* if false, allow invalid distance too far */
int back; /* bits back of last unprocessed length/lit */
unsigned was; /* initial length of match */
};

View File

@@ -1,306 +0,0 @@
/* inftrees.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
#include "inftrees.h"
#define MAXBITS 15
const char inflate_copyright[] =
" inflate 1.2.8 Copyright 1995-2013 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
include such an acknowledgment, I would appreciate that you keep this
copyright string in the executable of your product.
*/
/*
Build a set of tables to decode the provided canonical Huffman code.
The code lengths are lens[0..codes-1]. The result starts at *table,
whose indices are 0..2^bits-1. work is a writable array of at least
lens shorts, which is used as a work area. type is the type of code
to be generated, CODES, LENS, or DISTS. On return, zero is success,
-1 is an invalid code, and +1 means that ENOUGH isn't enough. table
on return points to the next available entry's address. bits is the
requested root table index bits, and on return it is the actual root
table index bits. It will differ if the request is greater than the
longest code or if it is less than the shortest code.
*/
int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
codetype type;
unsigned short FAR *lens;
unsigned codes;
code FAR * FAR *table;
unsigned FAR *bits;
unsigned short FAR *work;
{
unsigned len; /* a code's length in bits */
unsigned sym; /* index of code symbols */
unsigned min, max; /* minimum and maximum code lengths */
unsigned root; /* number of index bits for root table */
unsigned curr; /* number of index bits for current table */
unsigned drop; /* code bits to drop for sub-table */
int left; /* number of prefix codes available */
unsigned used; /* code entries in table used */
unsigned huff; /* Huffman code */
unsigned incr; /* for incrementing code, index */
unsigned fill; /* index for replicating entries */
unsigned low; /* low bits for current root entry */
unsigned mask; /* mask for low root bits */
code here; /* table entry for duplication */
code FAR *next; /* next available space in table */
const unsigned short FAR *base; /* base value table to use */
const unsigned short FAR *extra; /* extra bits table to use */
int end; /* use base and extra for symbol > end */
unsigned short count[MAXBITS+1]; /* number of codes of each length */
unsigned short offs[MAXBITS+1]; /* offsets in table for each length */
static const unsigned short lbase[31] = { /* Length codes 257..285 base */
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577, 0, 0};
static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
28, 28, 29, 29, 64, 64};
/*
Process a set of code lengths to create a canonical Huffman code. The
code lengths are lens[0..codes-1]. Each length corresponds to the
symbols 0..codes-1. The Huffman code is generated by first sorting the
symbols by length from short to long, and retaining the symbol order
for codes with equal lengths. Then the code starts with all zero bits
for the first code of the shortest length, and the codes are integer
increments for the same length, and zeros are appended as the length
increases. For the deflate format, these bits are stored backwards
from their more natural integer increment ordering, and so when the
decoding tables are built in the large loop below, the integer codes
are incremented backwards.
This routine assumes, but does not check, that all of the entries in
lens[] are in the range 0..MAXBITS. The caller must assure this.
1..MAXBITS is interpreted as that code length. zero means that that
symbol does not occur in this code.
The codes are sorted by computing a count of codes for each length,
creating from that a table of starting indices for each length in the
sorted table, and then entering the symbols in order in the sorted
table. The sorted table is work[], with that space being provided by
the caller.
The length counts are used for other purposes as well, i.e. finding
the minimum and maximum length codes, determining if there are any
codes at all, checking for a valid set of lengths, and looking ahead
at length counts to determine sub-table sizes when building the
decoding tables.
*/
/* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
for (len = 0; len <= MAXBITS; len++)
count[len] = 0;
for (sym = 0; sym < codes; sym++)
count[lens[sym]]++;
/* bound code lengths, force root to be within code lengths */
root = *bits;
for (max = MAXBITS; max >= 1; max--)
if (count[max] != 0) break;
if (root > max) root = max;
if (max == 0) { /* no symbols to code at all */
here.op = (unsigned char)64; /* invalid code marker */
here.bits = (unsigned char)1;
here.val = (unsigned short)0;
*(*table)++ = here; /* make a table to force an error */
*(*table)++ = here;
*bits = 1;
return 0; /* no symbols, but wait for decoding to report error */
}
for (min = 1; min < max; min++)
if (count[min] != 0) break;
if (root < min) root = min;
/* check for an over-subscribed or incomplete set of lengths */
left = 1;
for (len = 1; len <= MAXBITS; len++) {
left <<= 1;
left -= count[len];
if (left < 0) return -1; /* over-subscribed */
}
if (left > 0 && (type == CODES || max != 1))
return -1; /* incomplete set */
/* generate offsets into symbol table for each length for sorting */
offs[1] = 0;
for (len = 1; len < MAXBITS; len++)
offs[len + 1] = offs[len] + count[len];
/* sort symbols by length, by symbol order within each length */
for (sym = 0; sym < codes; sym++)
if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
/*
Create and fill in decoding tables. In this loop, the table being
filled is at next and has curr index bits. The code being used is huff
with length len. That code is converted to an index by dropping drop
bits off of the bottom. For codes where len is less than drop + curr,
those top drop + curr - len bits are incremented through all values to
fill the table with replicated entries.
root is the number of index bits for the root table. When len exceeds
root, sub-tables are created pointed to by the root entry with an index
of the low root bits of huff. This is saved in low to check for when a
new sub-table should be started. drop is zero when the root table is
being filled, and drop is root when sub-tables are being filled.
When a new sub-table is needed, it is necessary to look ahead in the
code lengths to determine what size sub-table is needed. The length
counts are used for this, and so count[] is decremented as codes are
entered in the tables.
used keeps track of how many table entries have been allocated from the
provided *table space. It is checked for LENS and DIST tables against
the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
the initial root table size constants. See the comments in inftrees.h
for more information.
sym increments through all symbols, and the loop terminates when
all codes of length max, i.e. all codes, have been processed. This
routine permits incomplete codes, so another loop after this one fills
in the rest of the decoding tables with invalid code markers.
*/
/* set up for code type */
switch (type) {
case CODES:
base = extra = work; /* dummy value--not used */
end = 19;
break;
case LENS:
base = lbase;
base -= 257;
extra = lext;
extra -= 257;
end = 256;
break;
default: /* DISTS */
base = dbase;
extra = dext;
end = -1;
}
/* initialize state for loop */
huff = 0; /* starting code */
sym = 0; /* starting code symbol */
len = min; /* starting code length */
next = *table; /* current table to fill in */
curr = root; /* current table index bits */
drop = 0; /* current bits to drop from code for index */
low = (unsigned)(-1); /* trigger new sub-table when len > root */
used = 1U << root; /* use root table entries */
mask = used - 1; /* mask for comparing low */
/* check available table space */
if ((type == LENS && used > ENOUGH_LENS) ||
(type == DISTS && used > ENOUGH_DISTS))
return 1;
/* process all codes and make table entries */
for (;;) {
/* create table entry */
here.bits = (unsigned char)(len - drop);
if ((int)(work[sym]) < end) {
here.op = (unsigned char)0;
here.val = work[sym];
}
else if ((int)(work[sym]) > end) {
here.op = (unsigned char)(extra[work[sym]]);
here.val = base[work[sym]];
}
else {
here.op = (unsigned char)(32 + 64); /* end of block */
here.val = 0;
}
/* replicate for those indices with low len bits equal to huff */
incr = 1U << (len - drop);
fill = 1U << curr;
min = fill; /* save offset to next table */
do {
fill -= incr;
next[(huff >> drop) + fill] = here;
} while (fill != 0);
/* backwards increment the len-bit code huff */
incr = 1U << (len - 1);
while (huff & incr)
incr >>= 1;
if (incr != 0) {
huff &= incr - 1;
huff += incr;
}
else
huff = 0;
/* go to next symbol, update count, len */
sym++;
if (--(count[len]) == 0) {
if (len == max) break;
len = lens[work[sym]];
}
/* create new sub-table if needed */
if (len > root && (huff & mask) != low) {
/* if first time, transition to sub-tables */
if (drop == 0)
drop = root;
/* increment past last table */
next += min; /* here min is 1 << curr */
/* determine length of next table */
curr = len - drop;
left = (int)(1 << curr);
while (curr + drop < max) {
left -= count[curr + drop];
if (left <= 0) break;
curr++;
left <<= 1;
}
/* check for enough space */
used += 1U << curr;
if ((type == LENS && used > ENOUGH_LENS) ||
(type == DISTS && used > ENOUGH_DISTS))
return 1;
/* point entry in root table to sub-table */
low = huff & mask;
(*table)[low].op = (unsigned char)curr;
(*table)[low].bits = (unsigned char)root;
(*table)[low].val = (unsigned short)(next - *table);
}
}
/* fill in remaining table entry if code is incomplete (guaranteed to have
at most one remaining entry, since if the code is incomplete, the
maximum code length that was allowed to get this far is one bit) */
if (huff != 0) {
here.op = (unsigned char)64; /* invalid code marker */
here.bits = (unsigned char)(len - drop);
here.val = (unsigned short)0;
next[huff] = here;
}
/* set return parameters */
*table += used;
*bits = root;
return 0;
}

View File

@@ -1,62 +0,0 @@
/* inftrees.h -- header to use inftrees.c
* Copyright (C) 1995-2005, 2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
/* Structure for decoding tables. Each entry provides either the
information needed to do the operation requested by the code that
indexed that table entry, or it provides a pointer to another
table that indexes more bits of the code. op indicates whether
the entry is a pointer to another table, a literal, a length or
distance, an end-of-block, or an invalid code. For a table
pointer, the low four bits of op is the number of index bits of
that table. For a length or distance, the low four bits of op
is the number of extra bits to get after the code. bits is
the number of bits in this code or part of the code to drop off
of the bit buffer. val is the actual byte to output in the case
of a literal, the base length or distance, or the offset from
the current table to the next table. Each entry is four bytes. */
typedef struct {
unsigned char op; /* operation, extra bits, table bits */
unsigned char bits; /* bits in this part of the code */
unsigned short val; /* offset in table or code value */
} code;
/* op values as set by inflate_table():
00000000 - literal
0000tttt - table link, tttt != 0 is the number of table index bits
0001eeee - length or distance, eeee is the number of extra bits
01100000 - end of block
01000000 - invalid code
*/
/* Maximum size of the dynamic table. The maximum number of code structures is
1444, which is the sum of 852 for literal/length codes and 592 for distance
codes. These values were found by exhaustive searches using the program
examples/enough.c found in the zlib distribtution. The arguments to that
program are the number of symbols, the initial root table size, and the
maximum bit length of a code. "enough 286 9 15" for literal/length codes
returns returns 852, and "enough 30 6 15" for distance codes returns 592.
The initial root table size (9 or 6) is found in the fifth argument of the
inflate_table() calls in inflate.c and infback.c. If the root table size is
changed, then these maximum sizes would be need to be recalculated and
updated. */
#define ENOUGH_LENS 852
#define ENOUGH_DISTS 592
#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
/* Type of code to build for inflate_table() */
typedef enum {
CODES,
LENS,
DISTS
} codetype;
int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
unsigned codes, code FAR * FAR *table,
unsigned FAR *bits, unsigned short FAR *work));

View File

@@ -1,116 +0,0 @@
<?xml version="1.0" ?>
<package name="zlib" version="1.2.8">
<library name="zlib" dlversion="1.2.8" dlname="z">
<property name="description"> zip compression library </property>
<property name="include-target-dir" value="$(@PACKAGE/install-includedir)" />
<!-- fixme: not implemented yet -->
<property name="compiler/c/inline" value="yes" />
<include-file name="zlib.h" scope="public" mode="644" />
<include-file name="zconf.h" scope="public" mode="644" />
<source name="adler32.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
</source>
<source name="compress.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
</source>
<source name="crc32.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
<depend name="crc32.h" />
</source>
<source name="gzclose.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
<depend name="gzguts.h" />
</source>
<source name="gzlib.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
<depend name="gzguts.h" />
</source>
<source name="gzread.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
<depend name="gzguts.h" />
</source>
<source name="gzwrite.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
<depend name="gzguts.h" />
</source>
<source name="uncompr.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
</source>
<source name="deflate.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
<depend name="zutil.h" />
<depend name="deflate.h" />
</source>
<source name="trees.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
<depend name="zutil.h" />
<depend name="deflate.h" />
<depend name="trees.h" />
</source>
<source name="zutil.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
<depend name="zutil.h" />
</source>
<source name="inflate.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
<depend name="zutil.h" />
<depend name="inftrees.h" />
<depend name="inflate.h" />
<depend name="inffast.h" />
</source>
<source name="infback.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
<depend name="zutil.h" />
<depend name="inftrees.h" />
<depend name="inflate.h" />
<depend name="inffast.h" />
</source>
<source name="inftrees.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
<depend name="zutil.h" />
<depend name="inftrees.h" />
</source>
<source name="inffast.c">
<depend name="zlib.h" />
<depend name="zconf.h" />
<depend name="zutil.h" />
<depend name="inftrees.h" />
<depend name="inflate.h" />
<depend name="inffast.h" />
</source>
</library>
</package>
<!--
CFLAGS=-O
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
#CFLAGS=-g -DDEBUG
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
# -Wstrict-prototypes -Wmissing-prototypes
# OBJA =
# to use the asm code: make OBJA=match.o
#
match.o: match.S
$(CPP) match.S > _match.s
$(CC) -c _match.s
mv _match.o match.o
rm -f _match.s
-->

File diff suppressed because it is too large Load Diff

View File

@@ -1,128 +0,0 @@
/* header created automatically with -DGEN_TREES_H */
local const ct_data static_ltree[L_CODES+2] = {
{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
};
local const ct_data static_dtree[D_CODES] = {
{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
};
const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
};
const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {
0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
};
local const int base_length[LENGTH_CODES] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
64, 80, 96, 112, 128, 160, 192, 224, 0
};
local const int base_dist[D_CODES] = {
0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
};

View File

@@ -1,59 +0,0 @@
/* uncompr.c -- decompress a memory buffer
* Copyright (C) 1995-2003, 2010 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#define ZLIB_INTERNAL
#include "zlib.h"
/* ===========================================================================
Decompresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total
size of the destination buffer, which must be large enough to hold the
entire uncompressed data. (The size of the uncompressed data must have
been saved previously by the compressor and transmitted to the decompressor
by some mechanism outside the scope of this compression library.)
Upon exit, destLen is the actual size of the compressed buffer.
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer, or Z_DATA_ERROR if the input data was corrupted.
*/
int ZEXPORT uncompress (dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
{
z_stream stream;
int err;
stream.next_in = (z_const Bytef *)source;
stream.avail_in = (uInt)sourceLen;
/* Check for source > 64K on 16-bit machine: */
if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
stream.next_out = dest;
stream.avail_out = (uInt)*destLen;
if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
stream.zalloc = (alloc_func)0;
stream.zfree = (free_func)0;
err = inflateInit(&stream);
if (err != Z_OK) return err;
err = inflate(&stream, Z_FINISH);
if (err != Z_STREAM_END) {
inflateEnd(&stream);
if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
return Z_DATA_ERROR;
return err;
}
*destLen = stream.total_out;
err = inflateEnd(&stream);
return err;
}

View File

@@ -1,511 +0,0 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2013 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#ifndef ZCONF_H
#define ZCONF_H
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
* Even better than compiling with -DZ_PREFIX would be to use configure to set
* this permanently in zconf.h using "./configure --zprefix".
*/
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
# define Z_PREFIX_SET
/* all linked symbols */
# define _dist_code z__dist_code
# define _length_code z__length_code
# define _tr_align z__tr_align
# define _tr_flush_bits z__tr_flush_bits
# define _tr_flush_block z__tr_flush_block
# define _tr_init z__tr_init
# define _tr_stored_block z__tr_stored_block
# define _tr_tally z__tr_tally
# define adler32 z_adler32
# define adler32_combine z_adler32_combine
# define adler32_combine64 z_adler32_combine64
# ifndef Z_SOLO
# define compress z_compress
# define compress2 z_compress2
# define compressBound z_compressBound
# endif
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
# define deflate z_deflate
# define deflateBound z_deflateBound
# define deflateCopy z_deflateCopy
# define deflateEnd z_deflateEnd
# define deflateInit2_ z_deflateInit2_
# define deflateInit_ z_deflateInit_
# define deflateParams z_deflateParams
# define deflatePending z_deflatePending
# define deflatePrime z_deflatePrime
# define deflateReset z_deflateReset
# define deflateResetKeep z_deflateResetKeep
# define deflateSetDictionary z_deflateSetDictionary
# define deflateSetHeader z_deflateSetHeader
# define deflateTune z_deflateTune
# define deflate_copyright z_deflate_copyright
# define get_crc_table z_get_crc_table
# ifndef Z_SOLO
# define gz_error z_gz_error
# define gz_intmax z_gz_intmax
# define gz_strwinerror z_gz_strwinerror
# define gzbuffer z_gzbuffer
# define gzclearerr z_gzclearerr
# define gzclose z_gzclose
# define gzclose_r z_gzclose_r
# define gzclose_w z_gzclose_w
# define gzdirect z_gzdirect
# define gzdopen z_gzdopen
# define gzeof z_gzeof
# define gzerror z_gzerror
# define gzflush z_gzflush
# define gzgetc z_gzgetc
# define gzgetc_ z_gzgetc_
# define gzgets z_gzgets
# define gzoffset z_gzoffset
# define gzoffset64 z_gzoffset64
# define gzopen z_gzopen
# define gzopen64 z_gzopen64
# ifdef _WIN32
# define gzopen_w z_gzopen_w
# endif
# define gzprintf z_gzprintf
# define gzvprintf z_gzvprintf
# define gzputc z_gzputc
# define gzputs z_gzputs
# define gzread z_gzread
# define gzrewind z_gzrewind
# define gzseek z_gzseek
# define gzseek64 z_gzseek64
# define gzsetparams z_gzsetparams
# define gztell z_gztell
# define gztell64 z_gztell64
# define gzungetc z_gzungetc
# define gzwrite z_gzwrite
# endif
# define inflate z_inflate
# define inflateBack z_inflateBack
# define inflateBackEnd z_inflateBackEnd
# define inflateBackInit_ z_inflateBackInit_
# define inflateCopy z_inflateCopy
# define inflateEnd z_inflateEnd
# define inflateGetHeader z_inflateGetHeader
# define inflateInit2_ z_inflateInit2_
# define inflateInit_ z_inflateInit_
# define inflateMark z_inflateMark
# define inflatePrime z_inflatePrime
# define inflateReset z_inflateReset
# define inflateReset2 z_inflateReset2
# define inflateSetDictionary z_inflateSetDictionary
# define inflateGetDictionary z_inflateGetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateUndermine z_inflateUndermine
# define inflateResetKeep z_inflateResetKeep
# define inflate_copyright z_inflate_copyright
# define inflate_fast z_inflate_fast
# define inflate_table z_inflate_table
# ifndef Z_SOLO
# define uncompress z_uncompress
# endif
# define zError z_zError
# ifndef Z_SOLO
# define zcalloc z_zcalloc
# define zcfree z_zcfree
# endif
# define zlibCompileFlags z_zlibCompileFlags
# define zlibVersion z_zlibVersion
/* all zlib typedefs in zlib.h and zconf.h */
# define Byte z_Byte
# define Bytef z_Bytef
# define alloc_func z_alloc_func
# define charf z_charf
# define free_func z_free_func
# ifndef Z_SOLO
# define gzFile z_gzFile
# endif
# define gz_header z_gz_header
# define gz_headerp z_gz_headerp
# define in_func z_in_func
# define intf z_intf
# define out_func z_out_func
# define uInt z_uInt
# define uIntf z_uIntf
# define uLong z_uLong
# define uLongf z_uLongf
# define voidp z_voidp
# define voidpc z_voidpc
# define voidpf z_voidpf
/* all zlib structs in zlib.h and zconf.h */
# define gz_header_s z_gz_header_s
# define internal_state z_internal_state
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
# define MSDOS
#endif
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
# define OS2
#endif
#if defined(_WINDOWS) && !defined(WINDOWS)
# define WINDOWS
#endif
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
# ifndef WIN32
# define WIN32
# endif
#endif
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
# ifndef SYS16BIT
# define SYS16BIT
# endif
# endif
#endif
/*
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
* than 64k bytes at a time (needed on systems with 16-bit int).
*/
#ifdef SYS16BIT
# define MAXSEG_64K
#endif
#ifdef MSDOS
# define UNALIGNED_OK
#endif
#ifdef __STDC_VERSION__
# ifndef STDC
# define STDC
# endif
# if __STDC_VERSION__ >= 199901L
# ifndef STDC99
# define STDC99
# endif
# endif
#endif
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
# define STDC
#endif
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
# define STDC
#endif
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
# define STDC
#endif
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
# define STDC
#endif
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
# define STDC
#endif
#ifndef STDC
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
# define const /* note: need a more gentle solution here */
# endif
#endif
#if defined(ZLIB_CONST) && !defined(z_const)
# define z_const const
#else
# define z_const
#endif
/* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
# define NO_DUMMY_DECL
#endif
/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K
# define MAX_MEM_LEVEL 8
# else
# define MAX_MEM_LEVEL 9
# endif
#endif
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
* created by gzip. (Files created by minigzip can still be extracted by
* gzip.)
*/
#ifndef MAX_WBITS
# define MAX_WBITS 15 /* 32K LZ77 window */
#endif
/* The memory requirements for deflate are (in bytes):
(1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits
that is, 32K for windowBits=15 (default value) plus a few kilobytes
for small objects.
*/
/* Type declarations */
#ifndef OF /* function prototypes */
# ifdef STDC
# define OF(args) args
# else
# define OF(args) ()
# endif
#endif
#ifndef Z_ARG /* function prototypes for stdarg */
# if defined(STDC) || defined(Z_HAVE_STDARG_H)
# define Z_ARG(args) args
# else
# define Z_ARG(args) ()
# endif
#endif
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
* just define FAR to be empty.
*/
#ifdef SYS16BIT
# if defined(M_I86SM) || defined(M_I86MM)
/* MSC small or medium model */
# define SMALL_MEDIUM
# ifdef _MSC_VER
# define FAR _far
# else
# define FAR far
# endif
# endif
# if (defined(__SMALL__) || defined(__MEDIUM__))
/* Turbo C small or medium model */
# define SMALL_MEDIUM
# ifdef __BORLANDC__
# define FAR _far
# else
# define FAR far
# endif
# endif
#endif
#if defined(WINDOWS) || defined(WIN32)
/* If building or using zlib as a DLL, define ZLIB_DLL.
* This is not mandatory, but it offers a little performance increase.
*/
# ifdef ZLIB_DLL
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
# ifdef ZLIB_INTERNAL
# define ZEXTERN extern __declspec(dllexport)
# else
# define ZEXTERN extern __declspec(dllimport)
# endif
# endif
# endif /* ZLIB_DLL */
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
* define ZLIB_WINAPI.
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
*/
# ifdef ZLIB_WINAPI
# ifdef FAR
# undef FAR
# endif
# include <windows.h>
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
# define ZEXPORT WINAPI
# ifdef WIN32
# define ZEXPORTVA WINAPIV
# else
# define ZEXPORTVA FAR CDECL
# endif
# endif
#endif
#if defined (__BEOS__)
# ifdef ZLIB_DLL
# ifdef ZLIB_INTERNAL
# define ZEXPORT __declspec(dllexport)
# define ZEXPORTVA __declspec(dllexport)
# else
# define ZEXPORT __declspec(dllimport)
# define ZEXPORTVA __declspec(dllimport)
# endif
# endif
#endif
#ifndef ZEXTERN
# define ZEXTERN extern
#endif
#ifndef ZEXPORT
# define ZEXPORT
#endif
#ifndef ZEXPORTVA
# define ZEXPORTVA
#endif
#ifndef FAR
# define FAR
#endif
#if !defined(__MACTYPES__)
typedef unsigned char Byte; /* 8 bits */
#endif
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
#ifdef SMALL_MEDIUM
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define Bytef Byte FAR
#else
typedef Byte FAR Bytef;
#endif
typedef char FAR charf;
typedef int FAR intf;
typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
#ifdef STDC
typedef void const *voidpc;
typedef void FAR *voidpf;
typedef void *voidp;
#else
typedef Byte const *voidpc;
typedef Byte FAR *voidpf;
typedef Byte *voidp;
#endif
#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
# include <limits.h>
# if (UINT_MAX == 0xffffffffUL)
# define Z_U4 unsigned
# elif (ULONG_MAX == 0xffffffffUL)
# define Z_U4 unsigned long
# elif (USHRT_MAX == 0xffffffffUL)
# define Z_U4 unsigned short
# endif
#endif
#ifdef Z_U4
typedef Z_U4 z_crc_t;
#else
typedef unsigned long z_crc_t;
#endif
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H
#endif
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_STDARG_H
#endif
#ifdef STDC
# ifndef Z_SOLO
# include <sys/types.h> /* for off_t */
# endif
#endif
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
# ifndef Z_SOLO
# include <stdarg.h> /* for va_list */
# endif
#endif
#ifdef _WIN32
# ifndef Z_SOLO
# include <stddef.h> /* for wchar_t */
# endif
#endif
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
* though the former does not conform to the LFS document), but considering
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
* equivalently requesting no 64-bit operations
*/
#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
# undef _LARGEFILE64_SOURCE
#endif
#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
# define Z_HAVE_UNISTD_H
#endif
#ifndef Z_SOLO
# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# ifdef VMS
# include <unixio.h> /* for off_t */
# endif
# ifndef z_off_t
# define z_off_t off_t
# endif
# endif
#endif
#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
# define Z_LFS64
#endif
#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
# define Z_LARGE64
#endif
#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
# define Z_WANT64
#endif
#if !defined(SEEK_SET) && !defined(Z_SOLO)
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
# define z_off_t long
#endif
#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
# define z_off64_t __int64
# else
# define z_off64_t z_off_t
# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
#pragma map(deflateInit_,"DEIN")
#pragma map(deflateInit2_,"DEIN2")
#pragma map(deflateEnd,"DEEND")
#pragma map(deflateBound,"DEBND")
#pragma map(inflateInit_,"ININ")
#pragma map(inflateInit2_,"ININ2")
#pragma map(inflateEnd,"INEND")
#pragma map(inflateSync,"INSY")
#pragma map(inflateSetDictionary,"INSEDI")
#pragma map(compressBound,"CMBND")
#pragma map(inflate_table,"INTABL")
#pragma map(inflate_fast,"INFA")
#pragma map(inflate_copyright,"INCOPY")
#endif
#endif /* ZCONF_H */

View File

@@ -1,513 +0,0 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2013 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#ifndef ZCONF_H
#define ZCONF_H
#cmakedefine Z_PREFIX
#cmakedefine Z_HAVE_UNISTD_H
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
* Even better than compiling with -DZ_PREFIX would be to use configure to set
* this permanently in zconf.h using "./configure --zprefix".
*/
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
# define Z_PREFIX_SET
/* all linked symbols */
# define _dist_code z__dist_code
# define _length_code z__length_code
# define _tr_align z__tr_align
# define _tr_flush_bits z__tr_flush_bits
# define _tr_flush_block z__tr_flush_block
# define _tr_init z__tr_init
# define _tr_stored_block z__tr_stored_block
# define _tr_tally z__tr_tally
# define adler32 z_adler32
# define adler32_combine z_adler32_combine
# define adler32_combine64 z_adler32_combine64
# ifndef Z_SOLO
# define compress z_compress
# define compress2 z_compress2
# define compressBound z_compressBound
# endif
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
# define deflate z_deflate
# define deflateBound z_deflateBound
# define deflateCopy z_deflateCopy
# define deflateEnd z_deflateEnd
# define deflateInit2_ z_deflateInit2_
# define deflateInit_ z_deflateInit_
# define deflateParams z_deflateParams
# define deflatePending z_deflatePending
# define deflatePrime z_deflatePrime
# define deflateReset z_deflateReset
# define deflateResetKeep z_deflateResetKeep
# define deflateSetDictionary z_deflateSetDictionary
# define deflateSetHeader z_deflateSetHeader
# define deflateTune z_deflateTune
# define deflate_copyright z_deflate_copyright
# define get_crc_table z_get_crc_table
# ifndef Z_SOLO
# define gz_error z_gz_error
# define gz_intmax z_gz_intmax
# define gz_strwinerror z_gz_strwinerror
# define gzbuffer z_gzbuffer
# define gzclearerr z_gzclearerr
# define gzclose z_gzclose
# define gzclose_r z_gzclose_r
# define gzclose_w z_gzclose_w
# define gzdirect z_gzdirect
# define gzdopen z_gzdopen
# define gzeof z_gzeof
# define gzerror z_gzerror
# define gzflush z_gzflush
# define gzgetc z_gzgetc
# define gzgetc_ z_gzgetc_
# define gzgets z_gzgets
# define gzoffset z_gzoffset
# define gzoffset64 z_gzoffset64
# define gzopen z_gzopen
# define gzopen64 z_gzopen64
# ifdef _WIN32
# define gzopen_w z_gzopen_w
# endif
# define gzprintf z_gzprintf
# define gzvprintf z_gzvprintf
# define gzputc z_gzputc
# define gzputs z_gzputs
# define gzread z_gzread
# define gzrewind z_gzrewind
# define gzseek z_gzseek
# define gzseek64 z_gzseek64
# define gzsetparams z_gzsetparams
# define gztell z_gztell
# define gztell64 z_gztell64
# define gzungetc z_gzungetc
# define gzwrite z_gzwrite
# endif
# define inflate z_inflate
# define inflateBack z_inflateBack
# define inflateBackEnd z_inflateBackEnd
# define inflateBackInit_ z_inflateBackInit_
# define inflateCopy z_inflateCopy
# define inflateEnd z_inflateEnd
# define inflateGetHeader z_inflateGetHeader
# define inflateInit2_ z_inflateInit2_
# define inflateInit_ z_inflateInit_
# define inflateMark z_inflateMark
# define inflatePrime z_inflatePrime
# define inflateReset z_inflateReset
# define inflateReset2 z_inflateReset2
# define inflateSetDictionary z_inflateSetDictionary
# define inflateGetDictionary z_inflateGetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateUndermine z_inflateUndermine
# define inflateResetKeep z_inflateResetKeep
# define inflate_copyright z_inflate_copyright
# define inflate_fast z_inflate_fast
# define inflate_table z_inflate_table
# ifndef Z_SOLO
# define uncompress z_uncompress
# endif
# define zError z_zError
# ifndef Z_SOLO
# define zcalloc z_zcalloc
# define zcfree z_zcfree
# endif
# define zlibCompileFlags z_zlibCompileFlags
# define zlibVersion z_zlibVersion
/* all zlib typedefs in zlib.h and zconf.h */
# define Byte z_Byte
# define Bytef z_Bytef
# define alloc_func z_alloc_func
# define charf z_charf
# define free_func z_free_func
# ifndef Z_SOLO
# define gzFile z_gzFile
# endif
# define gz_header z_gz_header
# define gz_headerp z_gz_headerp
# define in_func z_in_func
# define intf z_intf
# define out_func z_out_func
# define uInt z_uInt
# define uIntf z_uIntf
# define uLong z_uLong
# define uLongf z_uLongf
# define voidp z_voidp
# define voidpc z_voidpc
# define voidpf z_voidpf
/* all zlib structs in zlib.h and zconf.h */
# define gz_header_s z_gz_header_s
# define internal_state z_internal_state
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
# define MSDOS
#endif
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
# define OS2
#endif
#if defined(_WINDOWS) && !defined(WINDOWS)
# define WINDOWS
#endif
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
# ifndef WIN32
# define WIN32
# endif
#endif
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
# ifndef SYS16BIT
# define SYS16BIT
# endif
# endif
#endif
/*
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
* than 64k bytes at a time (needed on systems with 16-bit int).
*/
#ifdef SYS16BIT
# define MAXSEG_64K
#endif
#ifdef MSDOS
# define UNALIGNED_OK
#endif
#ifdef __STDC_VERSION__
# ifndef STDC
# define STDC
# endif
# if __STDC_VERSION__ >= 199901L
# ifndef STDC99
# define STDC99
# endif
# endif
#endif
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
# define STDC
#endif
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
# define STDC
#endif
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
# define STDC
#endif
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
# define STDC
#endif
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
# define STDC
#endif
#ifndef STDC
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
# define const /* note: need a more gentle solution here */
# endif
#endif
#if defined(ZLIB_CONST) && !defined(z_const)
# define z_const const
#else
# define z_const
#endif
/* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
# define NO_DUMMY_DECL
#endif
/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K
# define MAX_MEM_LEVEL 8
# else
# define MAX_MEM_LEVEL 9
# endif
#endif
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
* created by gzip. (Files created by minigzip can still be extracted by
* gzip.)
*/
#ifndef MAX_WBITS
# define MAX_WBITS 15 /* 32K LZ77 window */
#endif
/* The memory requirements for deflate are (in bytes):
(1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits
that is, 32K for windowBits=15 (default value) plus a few kilobytes
for small objects.
*/
/* Type declarations */
#ifndef OF /* function prototypes */
# ifdef STDC
# define OF(args) args
# else
# define OF(args) ()
# endif
#endif
#ifndef Z_ARG /* function prototypes for stdarg */
# if defined(STDC) || defined(Z_HAVE_STDARG_H)
# define Z_ARG(args) args
# else
# define Z_ARG(args) ()
# endif
#endif
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
* just define FAR to be empty.
*/
#ifdef SYS16BIT
# if defined(M_I86SM) || defined(M_I86MM)
/* MSC small or medium model */
# define SMALL_MEDIUM
# ifdef _MSC_VER
# define FAR _far
# else
# define FAR far
# endif
# endif
# if (defined(__SMALL__) || defined(__MEDIUM__))
/* Turbo C small or medium model */
# define SMALL_MEDIUM
# ifdef __BORLANDC__
# define FAR _far
# else
# define FAR far
# endif
# endif
#endif
#if defined(WINDOWS) || defined(WIN32)
/* If building or using zlib as a DLL, define ZLIB_DLL.
* This is not mandatory, but it offers a little performance increase.
*/
# ifdef ZLIB_DLL
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
# ifdef ZLIB_INTERNAL
# define ZEXTERN extern __declspec(dllexport)
# else
# define ZEXTERN extern __declspec(dllimport)
# endif
# endif
# endif /* ZLIB_DLL */
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
* define ZLIB_WINAPI.
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
*/
# ifdef ZLIB_WINAPI
# ifdef FAR
# undef FAR
# endif
# include <windows.h>
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
# define ZEXPORT WINAPI
# ifdef WIN32
# define ZEXPORTVA WINAPIV
# else
# define ZEXPORTVA FAR CDECL
# endif
# endif
#endif
#if defined (__BEOS__)
# ifdef ZLIB_DLL
# ifdef ZLIB_INTERNAL
# define ZEXPORT __declspec(dllexport)
# define ZEXPORTVA __declspec(dllexport)
# else
# define ZEXPORT __declspec(dllimport)
# define ZEXPORTVA __declspec(dllimport)
# endif
# endif
#endif
#ifndef ZEXTERN
# define ZEXTERN extern
#endif
#ifndef ZEXPORT
# define ZEXPORT
#endif
#ifndef ZEXPORTVA
# define ZEXPORTVA
#endif
#ifndef FAR
# define FAR
#endif
#if !defined(__MACTYPES__)
typedef unsigned char Byte; /* 8 bits */
#endif
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
#ifdef SMALL_MEDIUM
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define Bytef Byte FAR
#else
typedef Byte FAR Bytef;
#endif
typedef char FAR charf;
typedef int FAR intf;
typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
#ifdef STDC
typedef void const *voidpc;
typedef void FAR *voidpf;
typedef void *voidp;
#else
typedef Byte const *voidpc;
typedef Byte FAR *voidpf;
typedef Byte *voidp;
#endif
#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
# include <limits.h>
# if (UINT_MAX == 0xffffffffUL)
# define Z_U4 unsigned
# elif (ULONG_MAX == 0xffffffffUL)
# define Z_U4 unsigned long
# elif (USHRT_MAX == 0xffffffffUL)
# define Z_U4 unsigned short
# endif
#endif
#ifdef Z_U4
typedef Z_U4 z_crc_t;
#else
typedef unsigned long z_crc_t;
#endif
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H
#endif
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_STDARG_H
#endif
#ifdef STDC
# ifndef Z_SOLO
# include <sys/types.h> /* for off_t */
# endif
#endif
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
# ifndef Z_SOLO
# include <stdarg.h> /* for va_list */
# endif
#endif
#ifdef _WIN32
# ifndef Z_SOLO
# include <stddef.h> /* for wchar_t */
# endif
#endif
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
* though the former does not conform to the LFS document), but considering
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
* equivalently requesting no 64-bit operations
*/
#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
# undef _LARGEFILE64_SOURCE
#endif
#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
# define Z_HAVE_UNISTD_H
#endif
#ifndef Z_SOLO
# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# ifdef VMS
# include <unixio.h> /* for off_t */
# endif
# ifndef z_off_t
# define z_off_t off_t
# endif
# endif
#endif
#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
# define Z_LFS64
#endif
#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
# define Z_LARGE64
#endif
#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
# define Z_WANT64
#endif
#if !defined(SEEK_SET) && !defined(Z_SOLO)
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
# define z_off_t long
#endif
#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
# define z_off64_t __int64
# else
# define z_off64_t z_off_t
# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
#pragma map(deflateInit_,"DEIN")
#pragma map(deflateInit2_,"DEIN2")
#pragma map(deflateEnd,"DEEND")
#pragma map(deflateBound,"DEBND")
#pragma map(inflateInit_,"ININ")
#pragma map(inflateInit2_,"ININ2")
#pragma map(inflateEnd,"INEND")
#pragma map(inflateSync,"INSY")
#pragma map(inflateSetDictionary,"INSEDI")
#pragma map(compressBound,"CMBND")
#pragma map(inflate_table,"INTABL")
#pragma map(inflate_fast,"INFA")
#pragma map(inflate_copyright,"INCOPY")
#endif
#endif /* ZCONF_H */

View File

@@ -1,511 +0,0 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2013 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#ifndef ZCONF_H
#define ZCONF_H
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
* Even better than compiling with -DZ_PREFIX would be to use configure to set
* this permanently in zconf.h using "./configure --zprefix".
*/
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
# define Z_PREFIX_SET
/* all linked symbols */
# define _dist_code z__dist_code
# define _length_code z__length_code
# define _tr_align z__tr_align
# define _tr_flush_bits z__tr_flush_bits
# define _tr_flush_block z__tr_flush_block
# define _tr_init z__tr_init
# define _tr_stored_block z__tr_stored_block
# define _tr_tally z__tr_tally
# define adler32 z_adler32
# define adler32_combine z_adler32_combine
# define adler32_combine64 z_adler32_combine64
# ifndef Z_SOLO
# define compress z_compress
# define compress2 z_compress2
# define compressBound z_compressBound
# endif
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
# define deflate z_deflate
# define deflateBound z_deflateBound
# define deflateCopy z_deflateCopy
# define deflateEnd z_deflateEnd
# define deflateInit2_ z_deflateInit2_
# define deflateInit_ z_deflateInit_
# define deflateParams z_deflateParams
# define deflatePending z_deflatePending
# define deflatePrime z_deflatePrime
# define deflateReset z_deflateReset
# define deflateResetKeep z_deflateResetKeep
# define deflateSetDictionary z_deflateSetDictionary
# define deflateSetHeader z_deflateSetHeader
# define deflateTune z_deflateTune
# define deflate_copyright z_deflate_copyright
# define get_crc_table z_get_crc_table
# ifndef Z_SOLO
# define gz_error z_gz_error
# define gz_intmax z_gz_intmax
# define gz_strwinerror z_gz_strwinerror
# define gzbuffer z_gzbuffer
# define gzclearerr z_gzclearerr
# define gzclose z_gzclose
# define gzclose_r z_gzclose_r
# define gzclose_w z_gzclose_w
# define gzdirect z_gzdirect
# define gzdopen z_gzdopen
# define gzeof z_gzeof
# define gzerror z_gzerror
# define gzflush z_gzflush
# define gzgetc z_gzgetc
# define gzgetc_ z_gzgetc_
# define gzgets z_gzgets
# define gzoffset z_gzoffset
# define gzoffset64 z_gzoffset64
# define gzopen z_gzopen
# define gzopen64 z_gzopen64
# ifdef _WIN32
# define gzopen_w z_gzopen_w
# endif
# define gzprintf z_gzprintf
# define gzvprintf z_gzvprintf
# define gzputc z_gzputc
# define gzputs z_gzputs
# define gzread z_gzread
# define gzrewind z_gzrewind
# define gzseek z_gzseek
# define gzseek64 z_gzseek64
# define gzsetparams z_gzsetparams
# define gztell z_gztell
# define gztell64 z_gztell64
# define gzungetc z_gzungetc
# define gzwrite z_gzwrite
# endif
# define inflate z_inflate
# define inflateBack z_inflateBack
# define inflateBackEnd z_inflateBackEnd
# define inflateBackInit_ z_inflateBackInit_
# define inflateCopy z_inflateCopy
# define inflateEnd z_inflateEnd
# define inflateGetHeader z_inflateGetHeader
# define inflateInit2_ z_inflateInit2_
# define inflateInit_ z_inflateInit_
# define inflateMark z_inflateMark
# define inflatePrime z_inflatePrime
# define inflateReset z_inflateReset
# define inflateReset2 z_inflateReset2
# define inflateSetDictionary z_inflateSetDictionary
# define inflateGetDictionary z_inflateGetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateUndermine z_inflateUndermine
# define inflateResetKeep z_inflateResetKeep
# define inflate_copyright z_inflate_copyright
# define inflate_fast z_inflate_fast
# define inflate_table z_inflate_table
# ifndef Z_SOLO
# define uncompress z_uncompress
# endif
# define zError z_zError
# ifndef Z_SOLO
# define zcalloc z_zcalloc
# define zcfree z_zcfree
# endif
# define zlibCompileFlags z_zlibCompileFlags
# define zlibVersion z_zlibVersion
/* all zlib typedefs in zlib.h and zconf.h */
# define Byte z_Byte
# define Bytef z_Bytef
# define alloc_func z_alloc_func
# define charf z_charf
# define free_func z_free_func
# ifndef Z_SOLO
# define gzFile z_gzFile
# endif
# define gz_header z_gz_header
# define gz_headerp z_gz_headerp
# define in_func z_in_func
# define intf z_intf
# define out_func z_out_func
# define uInt z_uInt
# define uIntf z_uIntf
# define uLong z_uLong
# define uLongf z_uLongf
# define voidp z_voidp
# define voidpc z_voidpc
# define voidpf z_voidpf
/* all zlib structs in zlib.h and zconf.h */
# define gz_header_s z_gz_header_s
# define internal_state z_internal_state
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
# define MSDOS
#endif
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
# define OS2
#endif
#if defined(_WINDOWS) && !defined(WINDOWS)
# define WINDOWS
#endif
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
# ifndef WIN32
# define WIN32
# endif
#endif
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
# ifndef SYS16BIT
# define SYS16BIT
# endif
# endif
#endif
/*
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
* than 64k bytes at a time (needed on systems with 16-bit int).
*/
#ifdef SYS16BIT
# define MAXSEG_64K
#endif
#ifdef MSDOS
# define UNALIGNED_OK
#endif
#ifdef __STDC_VERSION__
# ifndef STDC
# define STDC
# endif
# if __STDC_VERSION__ >= 199901L
# ifndef STDC99
# define STDC99
# endif
# endif
#endif
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
# define STDC
#endif
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
# define STDC
#endif
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
# define STDC
#endif
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
# define STDC
#endif
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
# define STDC
#endif
#ifndef STDC
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
# define const /* note: need a more gentle solution here */
# endif
#endif
#if defined(ZLIB_CONST) && !defined(z_const)
# define z_const const
#else
# define z_const
#endif
/* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
# define NO_DUMMY_DECL
#endif
/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K
# define MAX_MEM_LEVEL 8
# else
# define MAX_MEM_LEVEL 9
# endif
#endif
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
* created by gzip. (Files created by minigzip can still be extracted by
* gzip.)
*/
#ifndef MAX_WBITS
# define MAX_WBITS 15 /* 32K LZ77 window */
#endif
/* The memory requirements for deflate are (in bytes):
(1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits
that is, 32K for windowBits=15 (default value) plus a few kilobytes
for small objects.
*/
/* Type declarations */
#ifndef OF /* function prototypes */
# ifdef STDC
# define OF(args) args
# else
# define OF(args) ()
# endif
#endif
#ifndef Z_ARG /* function prototypes for stdarg */
# if defined(STDC) || defined(Z_HAVE_STDARG_H)
# define Z_ARG(args) args
# else
# define Z_ARG(args) ()
# endif
#endif
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
* just define FAR to be empty.
*/
#ifdef SYS16BIT
# if defined(M_I86SM) || defined(M_I86MM)
/* MSC small or medium model */
# define SMALL_MEDIUM
# ifdef _MSC_VER
# define FAR _far
# else
# define FAR far
# endif
# endif
# if (defined(__SMALL__) || defined(__MEDIUM__))
/* Turbo C small or medium model */
# define SMALL_MEDIUM
# ifdef __BORLANDC__
# define FAR _far
# else
# define FAR far
# endif
# endif
#endif
#if defined(WINDOWS) || defined(WIN32)
/* If building or using zlib as a DLL, define ZLIB_DLL.
* This is not mandatory, but it offers a little performance increase.
*/
# ifdef ZLIB_DLL
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
# ifdef ZLIB_INTERNAL
# define ZEXTERN extern __declspec(dllexport)
# else
# define ZEXTERN extern __declspec(dllimport)
# endif
# endif
# endif /* ZLIB_DLL */
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
* define ZLIB_WINAPI.
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
*/
# ifdef ZLIB_WINAPI
# ifdef FAR
# undef FAR
# endif
# include <windows.h>
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
# define ZEXPORT WINAPI
# ifdef WIN32
# define ZEXPORTVA WINAPIV
# else
# define ZEXPORTVA FAR CDECL
# endif
# endif
#endif
#if defined (__BEOS__)
# ifdef ZLIB_DLL
# ifdef ZLIB_INTERNAL
# define ZEXPORT __declspec(dllexport)
# define ZEXPORTVA __declspec(dllexport)
# else
# define ZEXPORT __declspec(dllimport)
# define ZEXPORTVA __declspec(dllimport)
# endif
# endif
#endif
#ifndef ZEXTERN
# define ZEXTERN extern
#endif
#ifndef ZEXPORT
# define ZEXPORT
#endif
#ifndef ZEXPORTVA
# define ZEXPORTVA
#endif
#ifndef FAR
# define FAR
#endif
#if !defined(__MACTYPES__)
typedef unsigned char Byte; /* 8 bits */
#endif
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
#ifdef SMALL_MEDIUM
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define Bytef Byte FAR
#else
typedef Byte FAR Bytef;
#endif
typedef char FAR charf;
typedef int FAR intf;
typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
#ifdef STDC
typedef void const *voidpc;
typedef void FAR *voidpf;
typedef void *voidp;
#else
typedef Byte const *voidpc;
typedef Byte FAR *voidpf;
typedef Byte *voidp;
#endif
#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
# include <limits.h>
# if (UINT_MAX == 0xffffffffUL)
# define Z_U4 unsigned
# elif (ULONG_MAX == 0xffffffffUL)
# define Z_U4 unsigned long
# elif (USHRT_MAX == 0xffffffffUL)
# define Z_U4 unsigned short
# endif
#endif
#ifdef Z_U4
typedef Z_U4 z_crc_t;
#else
typedef unsigned long z_crc_t;
#endif
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H
#endif
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_STDARG_H
#endif
#ifdef STDC
# ifndef Z_SOLO
# include <sys/types.h> /* for off_t */
# endif
#endif
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
# ifndef Z_SOLO
# include <stdarg.h> /* for va_list */
# endif
#endif
#ifdef _WIN32
# ifndef Z_SOLO
# include <stddef.h> /* for wchar_t */
# endif
#endif
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
* though the former does not conform to the LFS document), but considering
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
* equivalently requesting no 64-bit operations
*/
#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
# undef _LARGEFILE64_SOURCE
#endif
#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
# define Z_HAVE_UNISTD_H
#endif
#ifndef Z_SOLO
# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# ifdef VMS
# include <unixio.h> /* for off_t */
# endif
# ifndef z_off_t
# define z_off_t off_t
# endif
# endif
#endif
#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
# define Z_LFS64
#endif
#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
# define Z_LARGE64
#endif
#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
# define Z_WANT64
#endif
#if !defined(SEEK_SET) && !defined(Z_SOLO)
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
# define z_off_t long
#endif
#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
# define z_off64_t __int64
# else
# define z_off64_t z_off_t
# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
#pragma map(deflateInit_,"DEIN")
#pragma map(deflateInit2_,"DEIN2")
#pragma map(deflateEnd,"DEEND")
#pragma map(deflateBound,"DEBND")
#pragma map(inflateInit_,"ININ")
#pragma map(inflateInit2_,"ININ2")
#pragma map(inflateEnd,"INEND")
#pragma map(inflateSync,"INSY")
#pragma map(inflateSetDictionary,"INSEDI")
#pragma map(compressBound,"CMBND")
#pragma map(inflate_table,"INTABL")
#pragma map(inflate_fast,"INFA")
#pragma map(inflate_copyright,"INCOPY")
#endif
#endif /* ZCONF_H */

View File

@@ -1,151 +0,0 @@
.TH ZLIB 3 "28 Apr 2013"
.SH NAME
zlib \- compression/decompression library
.SH SYNOPSIS
[see
.I zlib.h
for full description]
.SH DESCRIPTION
The
.I zlib
library is a general purpose data compression library.
The code is thread safe, assuming that the standard library functions
used are thread safe, such as memory allocation routines.
It provides in-memory compression and decompression functions,
including integrity checks of the uncompressed data.
This version of the library supports only one compression method (deflation)
but other algorithms may be added later
with the same stream interface.
.LP
Compression can be done in a single step if the buffers are large enough
or can be done by repeated calls of the compression function.
In the latter case,
the application must provide more input and/or consume the output
(providing more output space) before each call.
.LP
The library also supports reading and writing files in
.IR gzip (1)
(.gz) format
with an interface similar to that of stdio.
.LP
The library does not install any signal handler.
The decoder checks the consistency of the compressed data,
so the library should never crash even in the case of corrupted input.
.LP
All functions of the compression library are documented in the file
.IR zlib.h .
The distribution source includes examples of use of the library
in the files
.I test/example.c
and
.IR test/minigzip.c,
as well as other examples in the
.IR examples/
directory.
.LP
Changes to this version are documented in the file
.I ChangeLog
that accompanies the source.
.LP
.I zlib
is available in Java using the java.util.zip package:
.IP
http://java.sun.com/developer/technicalArticles/Programming/compression/
.LP
A Perl interface to
.IR zlib ,
written by Paul Marquess (pmqs@cpan.org),
is available at CPAN (Comprehensive Perl Archive Network) sites,
including:
.IP
http://search.cpan.org/~pmqs/IO-Compress-Zlib/
.LP
A Python interface to
.IR zlib ,
written by A.M. Kuchling (amk@magnet.com),
is available in Python 1.5 and later versions:
.IP
http://docs.python.org/library/zlib.html
.LP
.I zlib
is built into
.IR tcl:
.IP
http://wiki.tcl.tk/4610
.LP
An experimental package to read and write files in .zip format,
written on top of
.I zlib
by Gilles Vollant (info@winimage.com),
is available at:
.IP
http://www.winimage.com/zLibDll/minizip.html
and also in the
.I contrib/minizip
directory of the main
.I zlib
source distribution.
.SH "SEE ALSO"
The
.I zlib
web site can be found at:
.IP
http://zlib.net/
.LP
The data format used by the zlib library is described by RFC
(Request for Comments) 1950 to 1952 in the files:
.IP
http://tools.ietf.org/html/rfc1950 (for the zlib header and trailer format)
.br
http://tools.ietf.org/html/rfc1951 (for the deflate compressed data format)
.br
http://tools.ietf.org/html/rfc1952 (for the gzip header and trailer format)
.LP
Mark Nelson wrote an article about
.I zlib
for the Jan. 1997 issue of Dr. Dobb's Journal;
a copy of the article is available at:
.IP
http://marknelson.us/1997/01/01/zlib-engine/
.SH "REPORTING PROBLEMS"
Before reporting a problem,
please check the
.I zlib
web site to verify that you have the latest version of
.IR zlib ;
otherwise,
obtain the latest version and see if the problem still exists.
Please read the
.I zlib
FAQ at:
.IP
http://zlib.net/zlib_faq.html
.LP
before asking for help.
Send questions and/or comments to zlib@gzip.org,
or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
.SH AUTHORS
Version 1.2.8
Copyright (C) 1995-2013 Jean-loup Gailly (jloup@gzip.org)
and Mark Adler (madler@alumni.caltech.edu).
.LP
This software is provided "as-is,"
without any express or implied warranty.
In no event will the authors be held liable for any damages
arising from the use of this software.
See the distribution directory with respect to requirements
governing redistribution.
The deflate format used by
.I zlib
was defined by Phil Katz.
The deflate and
.I zlib
specifications were written by L. Peter Deutsch.
Thanks to all the people who reported problems and suggested various
improvements in
.IR zlib ;
who are too numerous to cite here.
.LP
UNIX manual page by R. P. C. Rodgers,
U.S. National Library of Medicine (rodgers@nlm.nih.gov).
.\" end of man page

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,83 +0,0 @@
ZLIB_1.2.0 {
global:
compressBound;
deflateBound;
inflateBack;
inflateBackEnd;
inflateBackInit_;
inflateCopy;
local:
deflate_copyright;
inflate_copyright;
inflate_fast;
inflate_table;
zcalloc;
zcfree;
z_errmsg;
gz_error;
gz_intmax;
_*;
};
ZLIB_1.2.0.2 {
gzclearerr;
gzungetc;
zlibCompileFlags;
} ZLIB_1.2.0;
ZLIB_1.2.0.8 {
deflatePrime;
} ZLIB_1.2.0.2;
ZLIB_1.2.2 {
adler32_combine;
crc32_combine;
deflateSetHeader;
inflateGetHeader;
} ZLIB_1.2.0.8;
ZLIB_1.2.2.3 {
deflateTune;
gzdirect;
} ZLIB_1.2.2;
ZLIB_1.2.2.4 {
inflatePrime;
} ZLIB_1.2.2.3;
ZLIB_1.2.3.3 {
adler32_combine64;
crc32_combine64;
gzopen64;
gzseek64;
gztell64;
inflateUndermine;
} ZLIB_1.2.2.4;
ZLIB_1.2.3.4 {
inflateReset2;
inflateMark;
} ZLIB_1.2.3.3;
ZLIB_1.2.3.5 {
gzbuffer;
gzoffset;
gzoffset64;
gzclose_r;
gzclose_w;
} ZLIB_1.2.3.4;
ZLIB_1.2.5.1 {
deflatePending;
} ZLIB_1.2.3.5;
ZLIB_1.2.5.2 {
deflateResetKeep;
gzgetc_;
inflateResetKeep;
} ZLIB_1.2.5.1;
ZLIB_1.2.7.1 {
inflateGetDictionary;
gzvprintf;
} ZLIB_1.2.5.2;

View File

@@ -1,13 +0,0 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@INSTALL_LIB_DIR@
sharedlibdir=@INSTALL_LIB_DIR@
includedir=@INSTALL_INC_DIR@
Name: zlib
Description: zlib compression library
Version: @VERSION@
Requires:
Libs: -L${libdir} -L${sharedlibdir} -lz
Cflags: -I${includedir}

View File

@@ -1,13 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
sharedlibdir=@sharedlibdir@
includedir=@includedir@
Name: zlib
Description: zlib compression library
Version: @VERSION@
Requires:
Libs: -L${libdir} -L${sharedlibdir} -lz
Cflags: -I${includedir}

View File

@@ -1,153 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{6CD25DC7-5D2C-48FB-B10B-345F1A13E3F3}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>zlib</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110_wp80</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="adler32.c" />
<ClCompile Include="crc32.c" />
<ClCompile Include="inffast.c" />
<ClCompile Include="inflate.c" />
<ClCompile Include="inftrees.c" />
<ClCompile Include="zutil.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="crc32.h" />
<ClInclude Include="inffast.h" />
<ClInclude Include="inffixed.h" />
<ClInclude Include="inflate.h" />
<ClInclude Include="inftrees.h" />
<ClInclude Include="zutil.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="adler32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="crc32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="inffast.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="inflate.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="inftrees.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="zutil.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="crc32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inffast.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inffixed.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inflate.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inftrees.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zutil.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,152 +0,0 @@
#!/usr/bin/perl
# Transform K&R C function definitions into ANSI equivalent.
#
# Author: Paul Marquess
# Version: 1.0
# Date: 3 October 2006
# TODO
#
# Asumes no function pointer parameters. unless they are typedefed.
# Assumes no literal strings that look like function definitions
# Assumes functions start at the beginning of a line
use strict;
use warnings;
local $/;
$_ = <>;
my $sp = qr{ \s* (?: /\* .*? \*/ )? \s* }x; # assume no nested comments
my $d1 = qr{ $sp (?: [\w\*\s]+ $sp)* $sp \w+ $sp [\[\]\s]* $sp }x ;
my $decl = qr{ $sp (?: \w+ $sp )+ $d1 }xo ;
my $dList = qr{ $sp $decl (?: $sp , $d1 )* $sp ; $sp }xo ;
while (s/^
( # Start $1
( # Start $2
.*? # Minimal eat content
( ^ \w [\w\s\*]+ ) # $3 -- function name
\s* # optional whitespace
) # $2 - Matched up to before parameter list
\( \s* # Literal "(" + optional whitespace
( [^\)]+ ) # $4 - one or more anythings except ")"
\s* \) # optional whitespace surrounding a Literal ")"
( (?: $dList )+ ) # $5
$sp ^ { # literal "{" at start of line
) # Remember to $1
//xsom
)
{
my $all = $1 ;
my $prefix = $2;
my $param_list = $4 ;
my $params = $5;
StripComments($params);
StripComments($param_list);
$param_list =~ s/^\s+//;
$param_list =~ s/\s+$//;
my $i = 0 ;
my %pList = map { $_ => $i++ }
split /\s*,\s*/, $param_list;
my $pMatch = '(\b' . join('|', keys %pList) . '\b)\W*$' ;
my @params = split /\s*;\s*/, $params;
my @outParams = ();
foreach my $p (@params)
{
if ($p =~ /,/)
{
my @bits = split /\s*,\s*/, $p;
my $first = shift @bits;
$first =~ s/^\s*//;
push @outParams, $first;
$first =~ /^(\w+\s*)/;
my $type = $1 ;
push @outParams, map { $type . $_ } @bits;
}
else
{
$p =~ s/^\s+//;
push @outParams, $p;
}
}
my %tmp = map { /$pMatch/; $_ => $pList{$1} }
@outParams ;
@outParams = map { " $_" }
sort { $tmp{$a} <=> $tmp{$b} }
@outParams ;
print $prefix ;
print "(\n" . join(",\n", @outParams) . ")\n";
print "{" ;
}
# Output any trailing code.
print ;
exit 0;
sub StripComments
{
no warnings;
# Strip C & C++ coments
# From the perlfaq
$_[0] =~
s{
/\* ## Start of /* ... */ comment
[^*]*\*+ ## Non-* followed by 1-or-more *'s
(
[^/*][^*]*\*+
)* ## 0-or-more things which don't start with /
## but do end with '*'
/ ## End of /* ... */ comment
| ## OR C++ Comment
// ## Start of C++ comment //
[^\n]* ## followed by 0-or-more non end of line characters
| ## OR various things which aren't comments:
(
" ## Start of " ... " string
(
\\. ## Escaped char
| ## OR
[^"\\] ## Non "\
)*
" ## End of " ... " string
| ## OR
' ## Start of ' ... ' string
(
\\. ## Escaped char
| ## OR
[^'\\] ## Non '\
)*
' ## End of ' ... ' string
| ## OR
. ## Anything other char
[^/"'\\]* ## Chars which doesn't start a comment, string or escape
)
}{$2}gxs;
}

View File

@@ -1,324 +0,0 @@
/* zutil.c -- target dependent utility functions for the compression library
* Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#include "zutil.h"
#ifndef Z_SOLO
# include "gzguts.h"
#endif
#ifndef NO_DUMMY_DECL
struct internal_state {int dummy;}; /* for buggy compilers */
#endif
z_const char * const z_errmsg[10] = {
"need dictionary", /* Z_NEED_DICT 2 */
"stream end", /* Z_STREAM_END 1 */
"", /* Z_OK 0 */
"file error", /* Z_ERRNO (-1) */
"stream error", /* Z_STREAM_ERROR (-2) */
"data error", /* Z_DATA_ERROR (-3) */
"insufficient memory", /* Z_MEM_ERROR (-4) */
"buffer error", /* Z_BUF_ERROR (-5) */
"incompatible version",/* Z_VERSION_ERROR (-6) */
""};
const char * ZEXPORT zlibVersion()
{
return ZLIB_VERSION;
}
uLong ZEXPORT zlibCompileFlags()
{
uLong flags;
flags = 0;
switch ((int)(sizeof(uInt))) {
case 2: break;
case 4: flags += 1; break;
case 8: flags += 2; break;
default: flags += 3;
}
switch ((int)(sizeof(uLong))) {
case 2: break;
case 4: flags += 1 << 2; break;
case 8: flags += 2 << 2; break;
default: flags += 3 << 2;
}
switch ((int)(sizeof(voidpf))) {
case 2: break;
case 4: flags += 1 << 4; break;
case 8: flags += 2 << 4; break;
default: flags += 3 << 4;
}
switch ((int)(sizeof(z_off_t))) {
case 2: break;
case 4: flags += 1 << 6; break;
case 8: flags += 2 << 6; break;
default: flags += 3 << 6;
}
#ifdef DEBUG
flags += 1 << 8;
#endif
#if defined(ASMV) || defined(ASMINF)
flags += 1 << 9;
#endif
#ifdef ZLIB_WINAPI
flags += 1 << 10;
#endif
#ifdef BUILDFIXED
flags += 1 << 12;
#endif
#ifdef DYNAMIC_CRC_TABLE
flags += 1 << 13;
#endif
#ifdef NO_GZCOMPRESS
flags += 1L << 16;
#endif
#ifdef NO_GZIP
flags += 1L << 17;
#endif
#ifdef PKZIP_BUG_WORKAROUND
flags += 1L << 20;
#endif
#ifdef FASTEST
flags += 1L << 21;
#endif
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
# ifdef NO_vsnprintf
flags += 1L << 25;
# ifdef HAS_vsprintf_void
flags += 1L << 26;
# endif
# else
# ifdef HAS_vsnprintf_void
flags += 1L << 26;
# endif
# endif
#else
flags += 1L << 24;
# ifdef NO_snprintf
flags += 1L << 25;
# ifdef HAS_sprintf_void
flags += 1L << 26;
# endif
# else
# ifdef HAS_snprintf_void
flags += 1L << 26;
# endif
# endif
#endif
return flags;
}
#ifdef DEBUG
# ifndef verbose
# define verbose 0
# endif
int ZLIB_INTERNAL z_verbose = verbose;
void ZLIB_INTERNAL z_error (m)
char *m;
{
fprintf(stderr, "%s\n", m);
exit(1);
}
#endif
/* exported to allow conversion of error code to string for compress() and
* uncompress()
*/
const char * ZEXPORT zError(err)
int err;
{
return ERR_MSG(err);
}
#if defined(_WIN32_WCE)
/* The Microsoft C Run-Time Library for Windows CE doesn't have
* errno. We define it as a global variable to simplify porting.
* Its value is always 0 and should not be used.
*/
int errno = 0;
#endif
#ifndef HAVE_MEMCPY
void ZLIB_INTERNAL zmemcpy(dest, source, len)
Bytef* dest;
const Bytef* source;
uInt len;
{
if (len == 0) return;
do {
*dest++ = *source++; /* ??? to be unrolled */
} while (--len != 0);
}
int ZLIB_INTERNAL zmemcmp(s1, s2, len)
const Bytef* s1;
const Bytef* s2;
uInt len;
{
uInt j;
for (j = 0; j < len; j++) {
if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
}
return 0;
}
void ZLIB_INTERNAL zmemzero(dest, len)
Bytef* dest;
uInt len;
{
if (len == 0) return;
do {
*dest++ = 0; /* ??? to be unrolled */
} while (--len != 0);
}
#endif
#ifndef Z_SOLO
#ifdef SYS16BIT
#ifdef __TURBOC__
/* Turbo C in 16-bit mode */
# define MY_ZCALLOC
/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
* and farmalloc(64K) returns a pointer with an offset of 8, so we
* must fix the pointer. Warning: the pointer must be put back to its
* original form in order to free it, use zcfree().
*/
#define MAX_PTR 10
/* 10*64K = 640K */
local int next_ptr = 0;
typedef struct ptr_table_s {
voidpf org_ptr;
voidpf new_ptr;
} ptr_table;
local ptr_table table[MAX_PTR];
/* This table is used to remember the original form of pointers
* to large buffers (64K). Such pointers are normalized with a zero offset.
* Since MSDOS is not a preemptive multitasking OS, this table is not
* protected from concurrent access. This hack doesn't work anyway on
* a protected system like OS/2. Use Microsoft C instead.
*/
voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
{
voidpf buf = opaque; /* just to make some compilers happy */
ulg bsize = (ulg)items*size;
/* If we allocate less than 65520 bytes, we assume that farmalloc
* will return a usable pointer which doesn't have to be normalized.
*/
if (bsize < 65520L) {
buf = farmalloc(bsize);
if (*(ush*)&buf != 0) return buf;
} else {
buf = farmalloc(bsize + 16L);
}
if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
table[next_ptr].org_ptr = buf;
/* Normalize the pointer to seg:0 */
*((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
*(ush*)&buf = 0;
table[next_ptr++].new_ptr = buf;
return buf;
}
void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
{
int n;
if (*(ush*)&ptr != 0) { /* object < 64K */
farfree(ptr);
return;
}
/* Find the original pointer */
for (n = 0; n < next_ptr; n++) {
if (ptr != table[n].new_ptr) continue;
farfree(table[n].org_ptr);
while (++n < next_ptr) {
table[n-1] = table[n];
}
next_ptr--;
return;
}
ptr = opaque; /* just to make some compilers happy */
Assert(0, "zcfree: ptr not found");
}
#endif /* __TURBOC__ */
#ifdef M_I86
/* Microsoft C in 16-bit mode */
# define MY_ZCALLOC
#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
# define _halloc halloc
# define _hfree hfree
#endif
voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
{
if (opaque) opaque = 0; /* to make compiler happy */
return _halloc((long)items, size);
}
void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
{
if (opaque) opaque = 0; /* to make compiler happy */
_hfree(ptr);
}
#endif /* M_I86 */
#endif /* SYS16BIT */
#ifndef MY_ZCALLOC /* Any system without a special alloc function */
#ifndef STDC
extern voidp malloc OF((uInt size));
extern voidp calloc OF((uInt items, uInt size));
extern void free OF((voidpf ptr));
#endif
voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
voidpf opaque;
unsigned items;
unsigned size;
{
if (opaque) items += size - size; /* make compiler happy */
return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
(voidpf)calloc(items, size);
}
void ZLIB_INTERNAL zcfree (opaque, ptr)
voidpf opaque;
voidpf ptr;
{
free(ptr);
if (opaque) return; /* make compiler happy */
}
#endif /* MY_ZCALLOC */
#endif /* !Z_SOLO */

View File

@@ -1,253 +0,0 @@
/* zutil.h -- internal interface and configuration of the compression library
* Copyright (C) 1995-2013 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
/* @(#) $Id$ */
#ifndef ZUTIL_H
#define ZUTIL_H
#ifdef HAVE_HIDDEN
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
#else
# define ZLIB_INTERNAL
#endif
#include "zlib.h"
#if defined(STDC) && !defined(Z_SOLO)
# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
# include <stddef.h>
# endif
# include <string.h>
# include <stdlib.h>
#endif
#ifdef Z_SOLO
typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */
#endif
#ifndef local
# define local static
#endif
/* compile with -Dlocal if your debugger can't find static symbols */
typedef unsigned char uch;
typedef uch FAR uchf;
typedef unsigned short ush;
typedef ush FAR ushf;
typedef unsigned long ulg;
extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
/* (size given to avoid silly warnings with Visual C++) */
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
#define ERR_RETURN(strm,err) \
return (strm->msg = ERR_MSG(err), (err))
/* To be used only when the state is known to be valid */
/* common constants */
#ifndef DEF_WBITS
# define DEF_WBITS MAX_WBITS
#endif
/* default windowBits for decompression. MAX_WBITS is for compression only */
#if MAX_MEM_LEVEL >= 8
# define DEF_MEM_LEVEL 8
#else
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
#endif
/* default memLevel */
#define STORED_BLOCK 0
#define STATIC_TREES 1
#define DYN_TREES 2
/* The three kinds of block type */
#define MIN_MATCH 3
#define MAX_MATCH 258
/* The minimum and maximum match lengths */
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
/* target dependencies */
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
# define OS_CODE 0x00
# ifndef Z_SOLO
# if defined(__TURBOC__) || defined(__BORLANDC__)
# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
/* Allow compilation with ANSI keywords only enabled */
void _Cdecl farfree( void *block );
void *_Cdecl farmalloc( unsigned long nbytes );
# else
# include <alloc.h>
# endif
# else /* MSC or DJGPP */
# include <malloc.h>
# endif
# endif
#endif
#ifdef AMIGA
# define OS_CODE 0x01
#endif
#if defined(VAXC) || defined(VMS)
# define OS_CODE 0x02
# define F_OPEN(name, mode) \
fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
#endif
#if defined(ATARI) || defined(atarist)
# define OS_CODE 0x05
#endif
#ifdef OS2
# define OS_CODE 0x06
# if defined(M_I86) && !defined(Z_SOLO)
# include <malloc.h>
# endif
#endif
#if defined(MACOS) || defined(TARGET_OS_MAC)
# define OS_CODE 0x07
# ifndef Z_SOLO
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
# include <unix.h> /* for fdopen */
# else
# ifndef fdopen
# define fdopen(fd,mode) NULL /* No fdopen() */
# endif
# endif
# endif
#endif
#ifdef TOPS20
# define OS_CODE 0x0a
#endif
#ifdef WIN32
# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */
# define OS_CODE 0x0b
# endif
#endif
#ifdef __50SERIES /* Prime/PRIMOS */
# define OS_CODE 0x0f
#endif
#if defined(_BEOS_) || defined(RISCOS)
# define fdopen(fd,mode) NULL /* No fdopen() */
#endif
#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
# if defined(_WIN32_WCE)
# define fdopen(fd,mode) NULL /* No fdopen() */
# ifndef _PTRDIFF_T_DEFINED
typedef int ptrdiff_t;
# define _PTRDIFF_T_DEFINED
# endif
# else
# define fdopen(fd,type) _fdopen(fd,type)
# endif
#endif
#if defined(__BORLANDC__) && !defined(MSDOS)
#pragma warn -8004
#pragma warn -8008
#pragma warn -8066
#endif
/* provide prototypes for these when building zlib without LFS */
#if !defined(_WIN32) && \
(!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
#endif
/* common defaults */
#ifndef OS_CODE
# define OS_CODE 0x03 /* assume Unix */
#endif
#ifndef F_OPEN
# define F_OPEN(name, mode) fopen((name), (mode))
#endif
/* functions */
#if defined(pyr) || defined(Z_SOLO)
# define NO_MEMCPY
#endif
#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
/* Use our own functions for small and medium model with MSC <= 5.0.
* You may have to use the same strategy for Borland C (untested).
* The __SC__ check is for Symantec.
*/
# define NO_MEMCPY
#endif
#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
# define HAVE_MEMCPY
#endif
#ifdef HAVE_MEMCPY
# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
# define zmemcpy _fmemcpy
# define zmemcmp _fmemcmp
# define zmemzero(dest, len) _fmemset(dest, 0, len)
# else
# define zmemcpy memcpy
# define zmemcmp memcmp
# define zmemzero(dest, len) memset(dest, 0, len)
# endif
#else
void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
#endif
/* Diagnostic functions */
#ifdef DEBUG
# include <stdio.h>
extern int ZLIB_INTERNAL z_verbose;
extern void ZLIB_INTERNAL z_error OF((char *m));
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
#else
# define Assert(cond,msg)
# define Trace(x)
# define Tracev(x)
# define Tracevv(x)
# define Tracec(c,x)
# define Tracecv(c,x)
#endif
#ifndef Z_SOLO
voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
unsigned size));
void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
#endif
#define ZALLOC(strm, items, size) \
(*((strm)->zalloc))((strm)->opaque, (items), (size))
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
/* Reverse the bytes in a 32-bit value */
#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
(((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
#endif /* ZUTIL_H */

View File

@@ -1,602 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Profile|ARM">
<Configuration>Profile</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Profile|Win32">
<Configuration>Profile</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{89159C26-2282-404A-A194-103B0A49DF7B}</ProjectGuid>
<RootNamespace>JGE</RootNamespace>
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>8.1</ApplicationTypeRevision>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<WindowsAppContainer>true</WindowsAppContainer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<WindowsAppContainer>true</WindowsAppContainer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<WindowsAppContainer>true</WindowsAppContainer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WindowsAppContainer>true</WindowsAppContainer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<WindowsAppContainer>true</WindowsAppContainer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<WindowsAppContainer>true</WindowsAppContainer>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\projects\mtg\mtg.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\projects\mtg\mtg.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\projects\mtg\mtg.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\projects\mtg\mtg.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\projects\mtg\mtg.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\projects\mtg\mtg.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\JGE</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\JGE\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\JGE</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(Platform)\$(Configuration)\JGE</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">
<TargetName>JGE</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">
<TargetName>JGE</TargetName>
<IntDir>$(Platform)\$(Configuration)\JGE</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>JGE</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\JGE\</OutDir>
<TargetName>JGE</TargetName>
<IntDir>$(Platform)\$(Configuration)\JGE</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>JGE</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<TargetName>JGE</TargetName>
<IntDir>$(Platform)\$(Configuration)\JGE</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TIXML_USE_STL;WP8;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderOutputFile>.\Release/JGE.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreSpecificDefaultLibraries>LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TIXML_USE_STL;WP8;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderOutputFile>.\Release/JGE.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreSpecificDefaultLibraries>LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>src/DirectX;src/zipFS;Dependencies/SDL/include;Dependencies/include;../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TIXML_USE_STL;WP8;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderOutputFile>.\Debug/JGE.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>TIXML_USE_STL;WP8;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderOutputFile>.\Debug/JGE.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>src/DirectX;src/zipFS;Dependencies/SDL/include;Dependencies/include;../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">
<ClCompile>
<Optimization>Full</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TIXML_USE_STL;WP8;WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_HAS_ITERATOR_DEBBUGING=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderOutputFile>.\Release/JGE.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreSpecificDefaultLibraries>LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">
<ClCompile>
<Optimization>Full</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TIXML_USE_STL;WP8;WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_HAS_ITERATOR_DEBBUGING=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderOutputFile>.\Release/JGE.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreSpecificDefaultLibraries>LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\corewrapper.cpp" />
<ClCompile Include="src\DirectX\CommonStates.cpp" />
<ClCompile Include="src\DirectX\SpriteBatch.cpp" />
<ClCompile Include="src\DirectX\VertexTypes.cpp" />
<ClCompile Include="src\Encoding.cpp" />
<ClCompile Include="src\JAnimator.cpp" />
<ClCompile Include="src\JApp.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="src\JDistortionMesh.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="src\JGameObject.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="src\JGE.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
</ClCompile>
<ClCompile Include="src\JGui.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="src\JLBFont.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="src\JLogger.cpp" />
<ClCompile Include="src\JOBJModel.cpp" />
<ClCompile Include="src\JParticle.cpp" />
<ClCompile Include="src\JParticleEffect.cpp" />
<ClCompile Include="src\JParticleEmitter.cpp" />
<ClCompile Include="src\JParticleSystem.cpp" />
<ClCompile Include="src\JResourceManager.cpp" />
<ClCompile Include="src\JSpline.cpp" />
<ClCompile Include="src\JSprite.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="src\tinyxml\tinyxmlparser.cpp" />
<ClCompile Include="src\Vector2D.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Profile|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="src\hge\hgecolor.cpp" />
<ClCompile Include="src\hge\hgedistort.cpp" />
<ClCompile Include="src\hge\hgefont.cpp" />
<ClCompile Include="src\hge\hgeparticle.cpp" />
<ClCompile Include="src\hge\hgepmanager.cpp" />
<ClCompile Include="src\hge\hgerect.cpp" />
<ClCompile Include="src\hge\hgevector.cpp" />
<ClCompile Include="src\tinyxml\tinystr.cpp" />
<ClCompile Include="src\tinyxml\tinyxml.cpp" />
<ClCompile Include="src\tinyxml\tinyxmlerror.cpp" />
<ClCompile Include="src\DirectX\JSfx.cpp" />
<ClCompile Include="src\zipFS\zfsystem.cpp" />
<ClCompile Include="src\zipFS\ziphdr.cpp" />
<ClCompile Include="src\zipFS\zstream.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\corewrapper.h" />
<ClInclude Include="include\DebugRoutines.h" />
<ClInclude Include="include\decoder_prx.h" />
<ClInclude Include="include\Encoding.h" />
<ClInclude Include="include\JAnimator.h" />
<ClInclude Include="include\JApp.h" />
<ClInclude Include="include\JAssert.h" />
<ClInclude Include="include\JAudio.h" />
<ClInclude Include="include\JDistortionMesh.h" />
<ClInclude Include="include\JFileSystem.h" />
<ClInclude Include="include\JGameLauncher.h" />
<ClInclude Include="include\JGameObject.h" />
<ClInclude Include="include\JGE.h" />
<ClInclude Include="include\JGui.h" />
<ClInclude Include="include\JLBFont.h" />
<ClInclude Include="include\JLogger.h" />
<ClInclude Include="include\JOBJModel.h" />
<ClInclude Include="include\JParticle.h" />
<ClInclude Include="include\JParticleEffect.h" />
<ClInclude Include="include\JParticleEmitter.h" />
<ClInclude Include="include\JParticleSystem.h" />
<ClInclude Include="include\JRenderer.h" />
<ClInclude Include="include\JResourceManager.h" />
<ClInclude Include="include\JSoundSystem.h" />
<ClInclude Include="include\JSpline.h" />
<ClInclude Include="include\JSprite.h" />
<ClInclude Include="include\JTypes.h" />
<ClInclude Include="include\Threading.h" />
<ClInclude Include="include\Vector2D.h" />
<ClInclude Include="include\Vector3D.h" />
<ClInclude Include="include\vram.h" />
<ClInclude Include="include\hge\hgecolor.h" />
<ClInclude Include="include\hge\hgedistort.h" />
<ClInclude Include="include\hge\hgefont.h" />
<ClInclude Include="include\hge\hgeparticle.h" />
<ClInclude Include="include\hge\hgerect.h" />
<ClInclude Include="include\hge\hgevector.h" />
<ClInclude Include="src\DirectX\AlignedNew.h" />
<ClInclude Include="src\DirectX\CommonStates.h" />
<ClInclude Include="src\DirectX\ConstantBuffer.h" />
<ClInclude Include="src\DirectX\DemandCreate.h" />
<ClInclude Include="src\DirectX\DirectXHelpers.h" />
<ClInclude Include="src\DirectX\PlatformHelpers.h" />
<ClInclude Include="src\DirectX\SharedResourcePool.h" />
<ClInclude Include="src\DirectX\SpriteBatch.h" />
<ClInclude Include="src\DirectX\VertexTypes.h" />
<ClInclude Include="src\tinyxml\tinystr.h" />
<ClInclude Include="src\tinyxml\tinyxml.h" />
<ClInclude Include="src\zipFS\fileio.h" />
<ClInclude Include="src\zipFS\static_assert.h" />
<ClInclude Include="src\zipFS\stdafx.h" />
<ClInclude Include="src\zipFS\zfsystem.h" />
<ClInclude Include="src\zipFS\ziphdr.h" />
<ClInclude Include="src\zipFS\zstream.h" />
<ClInclude Include="src\zipFS\zstream_zlib.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -156,7 +156,6 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Dependencies\SDL\src\main\windows\SDL_windows_main.c" />
<ClCompile Include="src\corewrapper.cpp" />
<ClCompile Include="src\Encoding.cpp" />
<ClCompile Include="src\JAnimator.cpp" />
<ClCompile Include="src\JApp.cpp">
@@ -299,7 +298,6 @@
<ClCompile Include="src\zipFS\zstream.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\corewrapper.h" />
<ClInclude Include="include\DebugRoutines.h" />
<ClInclude Include="include\decoder_prx.h" />
<ClInclude Include="include\Encoding.h" />

View File

@@ -32,6 +32,7 @@ HGE_OBJS = src/hge/hgecolor.o src/hge/hgeparticle.o \
CXXFLAGS = -W -Wall -Werror -Wno-unused
CXXFLAGS += -DTIXML_USE_STL
CXXFLAGS += -Wno-deprecated-declarations -Wno-sign-compare
ifdef DEBUG
CXXFLAGS += -ggdb3
@@ -82,7 +83,7 @@ ifeq ($(TARGET_ARCHITECTURE),linux)
OBJS = $(GENERIC_OBJS) $(LINUX_OBJS)
TARGET_LIB = libjge.a
TARGET_HGE = libhgetools.a
INCDIR = $(shell freetype-config --cflags 2> /dev/null) -I/usr/X11/include -I../Boost -Isrc/zipFS -Iinclude/
INCDIR = $(shell freetype-config --cflags 2> /dev/null) -I/usr/X11/include -I/usr/include/boost -Isrc/zipFS -Iinclude/
CXXFLAGS += -DLINUX $(FMOD)
CXXFLAGS += $(INCDIR)
LIBDIR = lib/linux

View File

@@ -18,12 +18,12 @@ using namespace std;
template <class T>
std::string ToHex(T* pointer)
{
std::ostringstream stream;
stream << hex << showbase << setfill('0') << setw(8) << (uint64_t) pointer;
return stream.str();
std::ostringstream stream;
stream << hex << showbase << setfill('0') << setw(8) << (uint64_t) pointer;
return stream.str();
}
#if defined(LINUX) && !defined(OutputDebugString)
#ifdef LINUX
#define OutputDebugString(val) (std::cerr << val);
#endif
@@ -42,9 +42,9 @@ std::string ToHex(T* pointer)
#else // CAPTURE_STDERR
#define DebugTrace(inString) \
{ \
std::ostringstream stream; \
stream << inString; \
qDebug("%s", stream.str().c_str()); \
std::ostringstream stream; \
stream << inString; \
qDebug("%s", stream.str().c_str()); \
}
#endif // CAPTURE_STDERR
@@ -52,16 +52,16 @@ std::string ToHex(T* pointer)
#include <android/log.h>
#define DebugTrace(inString) \
{ \
std::ostringstream stream; \
stream << inString; \
__android_log_write(ANDROID_LOG_DEBUG, "Wagic", stream.str().c_str());\
std::ostringstream stream; \
stream << inString; \
__android_log_write(ANDROID_LOG_DEBUG, "Wagic", stream.str().c_str());\
}
#else
#define DebugTrace(inString) \
{ \
std::ostringstream stream; \
stream << inString << std::endl; \
OutputDebugStringA(stream.str().c_str()); \
OutputDebugStringA(stream.str().c_str()); \
}
#endif // QT_CONFIG
#endif // Win32, Linux
@@ -71,7 +71,7 @@ std::string ToHex(T* pointer)
#ifndef DebugTrace
#define DebugTrace(inString) \
{ \
std::cerr << inString << std::endl; \
std::cerr << inString << std::endl; \
}
#endif //DEBUG
#endif

View File

@@ -178,8 +178,6 @@ private:
float mSpacing;
PIXEL_TYPE mColor;
int mBlend;
int mBase;
};

View File

@@ -16,7 +16,7 @@
#include <string.h>
#include <stdarg.h>
#if (!defined IOS) && (!defined ANDROID) && (!defined QT_CONFIG) && (!defined WP8)
#if (!defined IOS) && (!defined ANDROID) && (!defined QT_CONFIG)
#include <gif_lib.h>
#endif //IOS ANDROID
@@ -24,7 +24,9 @@
#if defined (WIN32)
#include <windows.h>
#elif defined (PSP)
#include <pspgu.h>
@@ -51,20 +53,13 @@
#define COSF(x) cosf(x*DEG2RAD)
#endif
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || ((defined WIN32) && !defined(WP8))
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32)
typedef struct
{
GLfloat m[4][4];
} ESMatrix;
#endif // (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
#ifdef WP8
namespace DirectX {
class SpriteBatch;
};
#endif
//////////////////////////////////////////////////////////////////////////
/// A collection of core rendering functions.
///
@@ -73,23 +68,18 @@ class JRenderer
{
protected:
JRenderer();
~JRenderer();
void InitRenderer();
void DestroyRenderer();
JRenderer();
~JRenderer();
void InitRenderer();
void DestroyRenderer();
float mWindowWidth;
float mWindowHeight;
float mLeft;
float mTop;
float mRight;
float mBottom;
float mActualWidth;
float mActualHeight;
public:
#if defined (PSP)
int PixelSize(int textureMode);
int PixelSize(int textureMode);
#endif
//////////////////////////////////////////////////////////////////////////
@@ -539,44 +529,28 @@ public:
//////////////////////////////////////////////////////////////////////////
void SetImageFilter(JImageFilter* imageFilter);
//////////////////////////////////////////////////////////////////////////
/// To be called each time the containing window size changes.
///
/// @param window - pointer to some platform specific window object.
/// @param inWidth - new width of the window.
/// @param inHeight - new height of the window.
///
//////////////////////////////////////////////////////////////////////////
void OnWindowsSizeChanged(void* window, float inWidth, float inHeight);
/**
/**
** Set/Get methods for the actual display screen size.
*/
inline void SetViewPort(float inLeft, float inTop, float inRight, float inBottom)
{
mLeft = inLeft;
mTop = inTop;
mRight = inRight;
mBottom = inBottom;
}
*/
inline void SetActualWidth(float inWidth)
{
mActualWidth = inWidth;
}
inline void GetViewPort(float& outLeft, float& outTop, float& outRight, float& outBottom)
{
outLeft = mLeft;
outTop = mTop;
outRight = mRight;
outBottom = mBottom;
}
inline void SetActualHeight(float inHeight)
{
mActualHeight = inHeight;
}
inline float GetActualWidth()
{
return (mRight - mLeft);
}
inline float GetActualWidth()
{
return mActualWidth;
}
inline float GetActualHeight()
{
return (mBottom - mTop);
}
inline float GetActualHeight()
{
return mActualHeight;
}
private:
@@ -590,10 +564,10 @@ private:
bool mVRAM;
};
#if (!defined IOS) && (!defined QT_CONFIG)
#if (!defined IOS) && (!defined QT_CONFIG)
void LoadJPG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
int LoadPNG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
#if (!defined ANDROID) && (!defined QT_CONFIG) && (!defined WP8)
#if (!defined ANDROID) && (!defined QT_CONFIG)
void LoadGIF(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
int image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bgcolor, InputFunc readFunc,int mode = 0, int TextureFormat = TEXTURE_FORMAT);
#endif // (ANDROID) How can we get gif support for android ?
@@ -601,62 +575,46 @@ private:
static JRenderer* mInstance;
#ifdef WP8
Microsoft::WRL::ComPtr<ID3D11Device1> m_d3dDevice;
Microsoft::WRL::ComPtr<ID3D11DeviceContext1> m_d3dContext;
D3D_FEATURE_LEVEL m_featureLevel;
Microsoft::WRL::ComPtr<IDXGISwapChain1> m_swapChain;
Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_renderTargetView;
Microsoft::WRL::ComPtr<ID3D11DepthStencilView> m_depthStencilView;
Microsoft::WRL::ComPtr<IUnknown> m_Window;
ID3D11Buffer* m_vertexBuffer;
ID3D11Buffer* m_indexBuffer;
DirectX::SpriteBatch* m_spriteBatch;
#elif (!defined PSP) && (!defined WP8) && (!defined CONSOLE_CONFIG)
#if (!defined PSP)
GLuint mCurrentTex;
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32)
// MVP matrix
ESMatrix theMvpMatrix;
#if ((defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32)) && (!defined CONSOLE_CONFIG)
// MVP matrix
ESMatrix theMvpMatrix;
// Handle to a program object
GLuint prog1;
// Attribute locations
GLint prog1_positionLoc;
GLint prog1_colorLoc;
// Uniform locations
GLint prog1_mvpLoc;
// Handle to a program object
GLuint prog1;
// Attribute locations
GLint prog1_positionLoc;
GLint prog1_colorLoc;
// Uniform locations
GLint prog1_mvpLoc;
// Handle to a program object
GLuint prog2;
// Sampler location
GLint prog2_samplerLoc;
// Attribute locations
GLint prog2_positionLoc;
GLint prog2_texCoordLoc;
GLint prog2_colorLoc;
// MVP matrix
ESMatrix prog2_mvpMatrix;
// Uniform locations
GLint prog2_mvpLoc;
// Handle to a program object
GLuint prog2;
// Sampler location
GLint prog2_samplerLoc;
// Attribute locations
GLint prog2_positionLoc;
GLint prog2_texCoordLoc;
GLint prog2_colorLoc;
// Uniform locations
GLint prog2_mvpLoc;
#endif // (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
#elif (defined PSP)
void *fbp0, *fbp1, *zbp;
PIXEL_TYPE* mVRAM;
int mCurrentTex;
int mCurrentBlend;
int mCurrentTextureFormat;
#else
void *fbp0, *fbp1, *zbp;
PIXEL_TYPE* mVRAM;
int mCurrentTex;
int mCurrentBlend;
int mCurrentTextureFormat;
#endif
#ifdef PSP
bool mVsync;
int mTexCounter;
#endif
int mSwizzle;
int mTexCounter;
int mCurrentTextureFilter;
int mCurrTexBlendSrc;

View File

@@ -1,7 +1,8 @@
#ifndef _JSOCKET_H_
#define _JSOCKET_H_
#include <string>
#include <queue>
#include "Threading.h"
using namespace std;
#define SERVER_PORT 5001

View File

@@ -258,7 +258,9 @@ private:
#endif
int mVolume;
#ifndef IOS
int mMusicVolume;
#endif
int mSampleVolume;

View File

@@ -18,12 +18,11 @@ using namespace std;
#define MID_POINT_THRESHOLD 1.0f
//////////////////////////////////////////////////////////////////////////
/// Position of a single dot on screen.
///
//////////////////////////////////////////////////////////////////////////
class Point
class JPoint
{
public:
@@ -34,13 +33,13 @@ public:
/// @param _y - Y position.
///
//////////////////////////////////////////////////////////////////////////
Point(float _x, float _y) { x = _x; y = _y; }
JPoint(float _x, float _y) { x = _x; y = _y; }
//////////////////////////////////////////////////////////////////////////
/// Constructor, set position to default (0.0f, 0.0f)
///
//////////////////////////////////////////////////////////////////////////
Point() { x = 0.0f; y = 0.0f; }
JPoint() { x = 0.0f; y = 0.0f; }
float x; ///< X position.
float y; ///< Y position.
@@ -95,7 +94,7 @@ public:
/// @param pt - Control point.
///
//////////////////////////////////////////////////////////////////////////
void AddControlPoint(const Point &pt);
void AddControlPoint(const JPoint &pt);
//////////////////////////////////////////////////////////////////////////
/// Get a control point of the spline.
@@ -105,7 +104,7 @@ public:
/// @return Control point.
///
//////////////////////////////////////////////////////////////////////////
void GetControlPoint(Point &point, int index);
void GetControlPoint(JPoint &point, int index);
//////////////////////////////////////////////////////////////////////////
/// Work out all pixels of the spline.
@@ -128,7 +127,7 @@ public:
/// @return Position of the desire point.
///
//////////////////////////////////////////////////////////////////////////
void PointOnCurve(Point &out, float t, const Point &p0, const Point &p1, const Point &p2, const Point &p3);
void PointOnCurve(JPoint &out, float t, const JPoint &p0, const JPoint &p1, const JPoint &p2, const JPoint &p3);
//////////////////////////////////////////////////////////////////////////
/// Get a number of pixels for this spline.
@@ -146,7 +145,7 @@ public:
/// @return Position of the desire point.
///
//////////////////////////////////////////////////////////////////////////
void GetPixel(Point &point, int index);
void GetPixel(JPoint &point, int index);
//////////////////////////////////////////////////////////////////////////
/// Render the spline to screen.
@@ -156,8 +155,8 @@ public:
private:
vector<Point> mMidPoints;
vector<Point> mPixels;
vector<JPoint> mMidPoints;
vector<JPoint> mPixels;
int mCount;
};

View File

@@ -25,57 +25,10 @@
#include <psprtc.h>
#include "JAudio.h"
#elif defined WP8
#if !defined(WIN32_LEAN_AND_MEAN)
#define WIN32_LEAN_AND_MEAN
#endif
#if !defined(NOMINMAX)
#define NOMINMAX
#endif
#if defined(_XBOX_ONE) && defined(_TITLE)
#include <d3d11_x.h>
#define DCOMMON_H_INCLUDED
#define NO_D3D11_DEBUG_NAME
#else
#include <d3d11_1.h>
#endif
#include <DirectXMath.h>
#include <DirectXPackedVector.h>
#include <DirectXCollision.h>
#include <algorithm>
#include <array>
#include <exception>
#include <malloc.h>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <vector>
// VS 2010's stdint.h conflicts with intsafe.h
#pragma warning(push)
#pragma warning(disable : 4005)
#include <stdint.h>
#include <intsafe.h>
#pragma warning(pop)
#include <wrl.h>
namespace DirectX
{
#if (DIRECTX_MATH_VERSION < 305) && !defined(XM_CALLCONV)
#define XM_CALLCONV __fastcall
typedef const XMVECTOR& HXMVECTOR;
typedef const XMMATRIX& FXMMATRIX;
#endif
}
#else
#include <stdint.h>
#endif
#ifndef __GNUC__
@@ -86,10 +39,10 @@ namespace DirectX
#define MAX_CHANNEL 128
enum {
JGE_ERR_CANT_OPEN_FILE = -1,
JGE_ERR_PNG = -2,
JGE_ERR_MALLOC_FAILED = -4,
JGE_ERR_GENERIC = -5,
JGE_ERR_CANT_OPEN_FILE = -1,
JGE_ERR_PNG = -2,
JGE_ERR_MALLOC_FAILED = -4,
JGE_ERR_GENERIC = -5,
};
#ifdef PSP
@@ -121,43 +74,44 @@ enum {
#define SCREEN_WIDTH_F 480.0f
#define SCREEN_HEIGHT_F 272.0f
#ifdef CONSOLE_CONFIG
#define DEFAULT_BLEND 0
#define BLEND_OPTION_ADD 0
#define BLEND_OPTION_BLEND 0
#define BLEND_ZERO 0
#define BLEND_ONE 0
#define BLEND_SRC_COLOR 0
#define BLEND_ONE_MINUS_SRC_COLOR 0
#define BLEND_SRC_ALPHA 0
#define BLEND_ONE_MINUS_SRC_ALPHA 0
#define BLEND_DST_ALPHA 0
#define BLEND_ONE_MINUS_DST_ALPHA 0
#define BLEND_DST_COLOR 0
#define BLEND_ONE_MINUS_DST_COLOR 0
#define BLEND_SRC_ALPHA_SATURATE 0
#define GU_PSM_5551 0
#define DEFAULT_BLEND 0
#define BLEND_OPTION_ADD 0
#define BLEND_OPTION_BLEND 0
#define BLEND_ZERO 0
#define BLEND_ONE 0
#define BLEND_SRC_COLOR 0
#define BLEND_ONE_MINUS_SRC_COLOR 0
#define BLEND_SRC_ALPHA 0
#define BLEND_ONE_MINUS_SRC_ALPHA 0
#define BLEND_DST_ALPHA 0
#define BLEND_ONE_MINUS_DST_ALPHA 0
#define BLEND_DST_COLOR 0
#define BLEND_ONE_MINUS_DST_COLOR 0
#define BLEND_SRC_ALPHA_SATURATE 0
#define GU_PSM_5551 0
#else
#ifdef WIN32
// #define DEFAULT_BLEND BLEND_DEFAULT
// #define BLEND_OPTION_ADD BLEND_COLORADD
// #define BLEND_OPTION_BLEND (BLEND_COLORADD | BLEND_ALPHABLEND | BLEND_NOZWRITE)
#else
#define DEFAULT_BLEND GU_TFX_MODULATE
#define BLEND_OPTION_ADD GU_TFX_ADD
#define BLEND_OPTION_BLEND GU_TFX_BLEND
#define DEFAULT_BLEND GU_TFX_MODULATE
#define BLEND_OPTION_ADD GU_TFX_ADD
#define BLEND_OPTION_BLEND GU_TFX_BLEND
#endif
#endif // CONSOLE_CONFIG
#if ((defined WIN32) || (defined WP8)) && (!defined LINUX)
#if (defined WIN32) && (!defined LINUX)
#include <windows.h>
#endif
#if defined(LINUX) && (!defined WIN32) || defined(IOS) || defined (ANDROID)
typedef uint8_t byte;
typedef uint32_t DWORD;
typedef uint8_t BYTE;
typedef uint8_t byte;
typedef uint32_t DWORD;
typedef uint8_t BYTE;
#ifndef IOS
typedef bool BOOL;
typedef bool BOOL;
#endif
#endif
@@ -178,16 +132,16 @@ typedef uint32_t u32;
#ifndef CONSOLE_CONFIG
#ifndef QT_CONFIG
#if defined (IOS)
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#import <OpenGLES/ES1/gl.h>
# import <OpenGLES/ES1/glext.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#elif defined (ANDROID)
#include <GLES/gl.h>
#include <GLES/glext.h>
#elif (defined (WIN32) && !defined (WP8)) || defined (LINUX)
#include <GL/gl.h>
#include <GL/glu.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
#elif defined (WIN32) || defined (LINUX)
#include <GL/gl.h>
#include <GL/glu.h>
#endif
#else
#include <QtOpenGL>
@@ -288,7 +242,7 @@ typedef struct
ScePspFVector3 pos;
} PSPVertex3D;
#elif (!defined WP8)
#else //non PSP
#define BLEND_ZERO GL_ZERO
@@ -307,56 +261,13 @@ typedef struct
#define GU_PSM_5551 0
#define GU_PSM_4444 0
#define GU_PSM_5650 0
#else // WP8
#define BLEND_ZERO 0
#define BLEND_ONE 0
#define BLEND_SRC_COLOR 0
#define BLEND_ONE_MINUS_SRC_COLOR 0
#define BLEND_SRC_ALPHA 0
#define BLEND_ONE_MINUS_SRC_ALPHA 0
#define BLEND_DST_ALPHA 0
#define BLEND_ONE_MINUS_DST_ALPHA 0
#define BLEND_DST_COLOR 0
#define BLEND_ONE_MINUS_DST_COLOR 0
#define BLEND_SRC_ALPHA_SATURATE 0
#define TEXTURE_FORMAT 0
#define GU_PSM_8888 0
#define GU_PSM_5551 0
#define GU_PSM_4444 0
#define GU_PSM_5650 0
#endif
#else // CONSOLE_CONFIG
#else
typedef uint32_t GLuint;
typedef float GLfloat;
#endif //CONSOLE_CONFIG
typedef enum Buttons
{
JGE_BTN_NONE = 0, // No button pressed
JGE_BTN_QUIT, // Home on PSP
JGE_BTN_MENU, // Start on PSP
JGE_BTN_CTRL, // Select
JGE_BTN_POWER, // Hold
JGE_BTN_SOUND, // Music note
JGE_BTN_RIGHT,
JGE_BTN_LEFT,
JGE_BTN_UP,
JGE_BTN_DOWN,
JGE_BTN_OK, // Circle in Japan, Cross in Europe
JGE_BTN_CANCEL, // Triangle
JGE_BTN_PRI, // Square (primary)
JGE_BTN_SEC, // Cross or Circle (secondary)
JGE_BTN_PREV, // Left trigger
JGE_BTN_NEXT, // Right trigger
JGE_BTN_FULLSCREEN, // Switch to fullscreen (obviously, PC only)
JGE_BTN_MAX = JGE_BTN_FULLSCREEN + 1
} JButton;
//------------------------------------------------------------------------------------------------
struct Vertex
{
@@ -440,14 +351,11 @@ public:
int mFilter;
#if defined (PSP)
#if defined (PSP)
int mTextureFormat;
int mTexId;
bool mInVideoRAM;
PIXEL_TYPE* mBits;
#elif defined (WP8)
ID3D11ShaderResourceView* mTexId;
u8* mBuffer;
#else
GLuint mTexId;
u8* mBuffer;
@@ -628,5 +536,28 @@ public:
};
typedef enum Buttons
{
JGE_BTN_NONE = 0, // No button pressed
JGE_BTN_QUIT, // Home on PSP
JGE_BTN_MENU, // Start on PSP
JGE_BTN_CTRL, // Select
JGE_BTN_POWER, // Hold
JGE_BTN_SOUND, // Music note
JGE_BTN_RIGHT,
JGE_BTN_LEFT,
JGE_BTN_UP,
JGE_BTN_DOWN,
JGE_BTN_OK, // Circle in Japan, Cross in Europe
JGE_BTN_CANCEL, // Triangle
JGE_BTN_PRI, // Square (primary)
JGE_BTN_SEC, // Cross or Circle (secondary)
JGE_BTN_PREV, // Left trigger
JGE_BTN_NEXT, // Right trigger
JGE_BTN_FULLSCREEN, // Switch to fullscreen (obviously, PC only)
JGE_BTN_MAX = JGE_BTN_FULLSCREEN + 1
} JButton;
#endif

View File

@@ -1,7 +1,7 @@
#ifndef THREADING_H
#define THREADING_H
#if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L) && !(_MSC_VER >= 1700)
#if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L)
#include <boost/date_time.hpp>
#ifdef WIN32
@@ -311,9 +311,7 @@ namespace boost
#include <QMutex>
#include <QThread>
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <QSharedPointer>
#include "../include/JLogger.h"
@@ -420,23 +418,25 @@ namespace boost
virtual void run() = 0;
};
typedef boost::shared_ptr<detail::thread_data_base> thread_data_ptr;
template<typename F>
typedef QSharedPointer<detail::thread_data_base> thread_data_ptr;
template<typename F, typename A1>
class thread_data : public detail::thread_data_base
{
public:
thread_data(F f_) : f(f_)
thread_data(F f_, A1 a1_) : f(f_), a1(a1_)
{
}
void run()
{
f();
f(a1);
}
private:
F f;
A1 a1;
void operator=(thread_data&);
thread_data(thread_data&);
@@ -493,7 +493,7 @@ namespace boost
}
template <class F,class A1>
thread(F f, A1 a1) : mThreadInfo(make_thread_info(boost::bind(boost::type<void>(), f, a1)))
thread(F f, A1 a1) : mThreadInfo(make_thread_info(f, a1))
{
mpThread = new threadImpl(mThreadInfo);
LOG("Calling start func");
@@ -510,10 +510,10 @@ namespace boost
}
private:
template<typename F>
static inline detail::thread_data_ptr make_thread_info(F f)
template<typename F, typename A1>
static inline detail::thread_data_ptr make_thread_info(F f, A1 a1)
{
return detail::thread_data_ptr(new detail::thread_data<F>(f));
return detail::thread_data_ptr(new detail::thread_data<F, A1>(f, a1));
}
detail::thread_data_ptr mThreadInfo;
@@ -537,7 +537,7 @@ namespace boost
}
}
#elif (__cplusplus > 199711L) || (_MSC_VER >= 1700)
#elif (__cplusplus > 199711L)
#include <thread>
#include <mutex>

View File

@@ -1,98 +0,0 @@
#ifndef COREWRAPPER_H
#define COREWRAPPER_H
#include "../include/JGE.h"
#include "../include/JTypes.h"
#include "../include/JApp.h"
#include "../include/JFileSystem.h"
#include "../include/JRenderer.h"
#include "../include/JGameLauncher.h"
#ifdef QT_CONFIG
#include <QTime>
#endif
class WagicCore
{
private:
public:
explicit WagicCore();
virtual ~WagicCore();
void initApp();
void doOK() {
doAndEnqueue(JGE_BTN_OK);
};
void doNext() {
doAndEnqueue(JGE_BTN_PREV);
};
void doCancel() {
doAndEnqueue(JGE_BTN_SEC);
};
void doMenu() {
doAndEnqueue(JGE_BTN_MENU);
};
void done() {
while(m_buttonQueue.size())
{
m_engine->ReleaseKey(m_buttonQueue.front());
m_buttonQueue.pop();
}
m_engine->ResetInput();
};
void doScroll(int x, int y) {
m_engine->Scroll(x, y);
};
int getNominalHeight(){ return SCREEN_HEIGHT;};
int getNominalWidth(){ return SCREEN_WIDTH;};
float getNominalRatio() { return ((float)SCREEN_WIDTH / (float)SCREEN_HEIGHT);};
bool getActive() { return m_active; };
void setActive(bool active);
void onKeyDown(LocalKeySym);
void onKeyUp(LocalKeySym);
void onWindowResize(void* window, float width, float height);
void onWheelChanged(int deltaX, int deltaY);
static char* getApplicationName() {
return JGameLauncher::GetName();
};
typedef enum {
LEFT,
MIDLE,
RIGHT
} PointerId;
bool onPointerPressed(PointerId, int, int);
bool onPointerReleased(PointerId, int, int);
bool onPointerMoved(PointerId, int, int);
bool onUpdate();
bool onRender();
void registerDefaultBindings();
static WagicCore* getInstance() { return s_instance; };
char *GetName(){ return m_launcher->GetName();};
#ifdef QT_CONFIG
QTime startTime;
#endif
private:
void doAndEnqueue(JButton action) {
m_engine->HoldKey_NoRepeat(action);
m_buttonQueue.push(action);
}
private:
friend int JGEGetTime();
static WagicCore* s_instance;
JGE* m_engine;
JApp* m_app;
JGameLauncher* m_launcher;
int64_t m_lastTickCount;
std::queue<JButton> m_buttonQueue;
bool m_active;
int mMouseDownX;
int mMouseDownY;
int mLastFingerDownTime;
};
#endif // COREWRAPPER_H

View File

@@ -1,7 +1,5 @@
#ifndef QTCOREWRAPPER_H
#define QTCOREWRAPPER_H
#include "../include/corewrapper.h"
#ifndef COREWRAPPER_H
#define COREWRAPPER_H
#include <QObject>
#include <QElapsedTimer>
@@ -9,6 +7,12 @@
#include <QtDeclarative>
#include <QGraphicsItem>
#endif //QT_WIDGET
#include "../include/JGE.h"
#include "../include/JTypes.h"
#include "../include/JApp.h"
#include "../include/JFileSystem.h"
#include "../include/JRenderer.h"
#include "../include/JGameLauncher.h"
#if (defined Q_WS_MAEMO_5)
// For screen on/off events support
@@ -19,11 +23,23 @@
#include <QDBusInterface>
#endif //Q_WS_MAEMO_5
class WagicWrapper
{
public:
WagicWrapper();
virtual ~WagicWrapper();
private:
JGE* m_engine;
JApp* m_app;
JGameLauncher* m_launcher;
};
#ifdef QT_WIDGET
class QtWagicCore : public QGLWidget
class WagicCore : public QGLWidget
#else
class QtWagicCore : public QDeclarativeItem
class WagicCore : public QDeclarativeItem
#endif
{
private:
@@ -32,6 +48,7 @@ private:
#else
typedef QDeclarativeItem super;
#endif //QT_WIDGET
void initApp();
public:
Q_OBJECT
@@ -42,30 +59,36 @@ public:
public:
explicit QtWagicCore(super *parent = 0);
virtual ~QtWagicCore();
explicit WagicCore(super *parent = 0);
virtual ~WagicCore();
static int runTestSuite();
Q_INVOKABLE void doOK() {
m_Wagic.doOK();
doAndEnqueue(JGE_BTN_OK);
};
Q_INVOKABLE void doNext() {
m_Wagic.doNext();
doAndEnqueue(JGE_BTN_PREV);
};
Q_INVOKABLE void doCancel() {
m_Wagic.doCancel();
doAndEnqueue(JGE_BTN_SEC);
};
Q_INVOKABLE void doMenu() {
m_Wagic.doMenu();
doAndEnqueue(JGE_BTN_MENU);
};
Q_INVOKABLE void done() {
m_Wagic.done();
while(m_buttonQueue.size())
{
m_engine->ReleaseKey(m_buttonQueue.front());
m_buttonQueue.pop();
}
m_engine->ResetInput();
};
Q_INVOKABLE void pixelInput(int x, int y);
Q_INVOKABLE qint64 getTick() {
return g_startTimer.elapsed();
};
Q_INVOKABLE void doScroll(int x, int y, int) {
m_Wagic.doScroll(x, y);
m_engine->Scroll(x, y);
};
int getNominalHeight(){ return SCREEN_HEIGHT;};
int getNominalWidth(){ return SCREEN_WIDTH;};
@@ -128,14 +151,20 @@ private:
#endif
}
void timerEvent( QTimerEvent* );
void doAndEnqueue(JButton action) {
m_engine->HoldKey_NoRepeat(action);
m_buttonQueue.push(action);
}
public:
// used mainly to mesure the delta between 2 updates
static QElapsedTimer g_startTimer;
private:
WagicCore m_Wagic;
JGE* m_engine;
JApp* m_app;
JGameLauncher* m_launcher;
qint64 m_lastTickCount;
std::queue<JButton> m_buttonQueue;
int m_timerId;
bool m_active;
QRect m_viewPort;
@@ -157,4 +186,4 @@ private:
QML_DECLARE_TYPE(WagicCore)
#endif //QT_WIDGET
#endif // QTCOREWRAPPER_H
#endif // COREWRAPPER_H

BIN
JGE/lib/linux/libhgetools.a Normal file

Binary file not shown.

BIN
JGE/lib/linux/libjge.a Normal file

Binary file not shown.

View File

@@ -1,67 +0,0 @@
//--------------------------------------------------------------------------------------
// File: AlignedNew.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#include <malloc.h>
#include <exception>
namespace DirectX
{
// Derive from this to customize operator new and delete for
// types that have special heap alignment requirements.
//
// Example usage:
//
// __declspec(align(16)) struct MyAlignedType : public AlignedNew<MyAlignedType>
template<typename TDerived>
struct AlignedNew
{
// Allocate aligned memory.
static void* operator new (size_t size)
{
const size_t alignment = __alignof(TDerived);
static_assert(alignment > 8, "AlignedNew is only useful for types with > 8 byte alignment. Did you forget a __declspec(align) on TDerived?");
void* ptr = _aligned_malloc(size, alignment);
if (!ptr)
throw std::bad_alloc();
return ptr;
}
// Free aligned memory.
static void operator delete (void* ptr)
{
_aligned_free(ptr);
}
// Array overloads.
static void* operator new[] (size_t size)
{
return operator new(size);
}
static void operator delete[] (void* ptr)
{
operator delete(ptr);
}
};
}

View File

@@ -1,373 +0,0 @@
//--------------------------------------------------------------------------------------
// File: CommonStates.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
//#include "pch.h"
#include <wrl.h>
#include <wrl/client.h>
using namespace Microsoft::WRL;
#include "CommonStates.h"
#include "DemandCreate.h"
#include "DirectXHelpers.h"
#include "SharedResourcePool.h"
using namespace DirectX;
using namespace Microsoft::WRL;
// Internal state object implementation class. Only one of these helpers is allocated
// per D3D device, even if there are multiple public facing CommonStates instances.
class CommonStates::Impl
{
public:
Impl(_In_ ID3D11Device* device)
: device(device)
{ }
HRESULT CreateBlendState(D3D11_BLEND srcBlend, D3D11_BLEND destBlend, _Out_ ID3D11BlendState** pResult);
HRESULT CreateDepthStencilState(bool enable, bool writeEnable, _Out_ ID3D11DepthStencilState** pResult);
HRESULT CreateRasterizerState(D3D11_CULL_MODE cullMode, D3D11_FILL_MODE fillMode, _Out_ ID3D11RasterizerState** pResult);
HRESULT CreateSamplerState(D3D11_FILTER filter, D3D11_TEXTURE_ADDRESS_MODE addressMode, _Out_ ID3D11SamplerState** pResult);
ComPtr<ID3D11Device> device;
ComPtr<ID3D11BlendState> opaque;
ComPtr<ID3D11BlendState> alphaBlend;
ComPtr<ID3D11BlendState> additive;
ComPtr<ID3D11BlendState> nonPremultiplied;
ComPtr<ID3D11DepthStencilState> depthNone;
ComPtr<ID3D11DepthStencilState> depthDefault;
ComPtr<ID3D11DepthStencilState> depthRead;
ComPtr<ID3D11RasterizerState> cullNone;
ComPtr<ID3D11RasterizerState> cullClockwise;
ComPtr<ID3D11RasterizerState> cullCounterClockwise;
ComPtr<ID3D11RasterizerState> wireframe;
ComPtr<ID3D11SamplerState> pointWrap;
ComPtr<ID3D11SamplerState> pointClamp;
ComPtr<ID3D11SamplerState> linearWrap;
ComPtr<ID3D11SamplerState> linearClamp;
ComPtr<ID3D11SamplerState> anisotropicWrap;
ComPtr<ID3D11SamplerState> anisotropicClamp;
std::mutex mutex;
static SharedResourcePool<ID3D11Device*, Impl> instancePool;
};
// Global instance pool.
SharedResourcePool<ID3D11Device*, CommonStates::Impl> CommonStates::Impl::instancePool;
// Helper for creating blend state objects.
HRESULT CommonStates::Impl::CreateBlendState(D3D11_BLEND srcBlend, D3D11_BLEND destBlend, _Out_ ID3D11BlendState** pResult)
{
D3D11_BLEND_DESC desc;
ZeroMemory(&desc, sizeof(desc));
desc.RenderTarget[0].BlendEnable = (srcBlend != D3D11_BLEND_ONE) ||
(destBlend != D3D11_BLEND_ZERO);
desc.RenderTarget[0].SrcBlend = desc.RenderTarget[0].SrcBlendAlpha = srcBlend;
desc.RenderTarget[0].DestBlend = desc.RenderTarget[0].DestBlendAlpha = destBlend;
desc.RenderTarget[0].BlendOp = desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
HRESULT hr = device->CreateBlendState(&desc, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DirectXTK:CommonStates");
return hr;
}
// Helper for creating depth stencil state objects.
HRESULT CommonStates::Impl::CreateDepthStencilState(bool enable, bool writeEnable, _Out_ ID3D11DepthStencilState** pResult)
{
D3D11_DEPTH_STENCIL_DESC desc;
ZeroMemory(&desc, sizeof(desc));
desc.DepthEnable = enable;
desc.DepthWriteMask = writeEnable ? D3D11_DEPTH_WRITE_MASK_ALL : D3D11_DEPTH_WRITE_MASK_ZERO;
desc.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;
desc.StencilEnable = false;
desc.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK;
desc.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
desc.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
desc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
desc.FrontFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
desc.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP;
desc.BackFace = desc.FrontFace;
HRESULT hr = device->CreateDepthStencilState(&desc, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DirectXTK:CommonStates");
return hr;
}
// Helper for creating rasterizer state objects.
HRESULT CommonStates::Impl::CreateRasterizerState(D3D11_CULL_MODE cullMode, D3D11_FILL_MODE fillMode, _Out_ ID3D11RasterizerState** pResult)
{
D3D11_RASTERIZER_DESC desc;
ZeroMemory(&desc, sizeof(desc));
desc.CullMode = cullMode;
desc.FillMode = fillMode;
desc.DepthClipEnable = true;
desc.MultisampleEnable = true;
HRESULT hr = device->CreateRasterizerState(&desc, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DirectXTK:CommonStates");
return hr;
}
// Helper for creating sampler state objects.
HRESULT CommonStates::Impl::CreateSamplerState(D3D11_FILTER filter, D3D11_TEXTURE_ADDRESS_MODE addressMode, _Out_ ID3D11SamplerState** pResult)
{
D3D11_SAMPLER_DESC desc;
ZeroMemory(&desc, sizeof(desc));
desc.Filter = filter;
desc.AddressU = addressMode;
desc.AddressV = addressMode;
desc.AddressW = addressMode;
desc.MaxAnisotropy = (device->GetFeatureLevel() > D3D_FEATURE_LEVEL_9_1) ? 16 : 2;
desc.MaxLOD = FLT_MAX;
desc.ComparisonFunc = D3D11_COMPARISON_NEVER;
HRESULT hr = device->CreateSamplerState(&desc, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DirectXTK:CommonStates");
return hr;
}
//--------------------------------------------------------------------------------------
// CommonStates
//--------------------------------------------------------------------------------------
// Public constructor.
CommonStates::CommonStates(_In_ ID3D11Device* device)
: pImpl(Impl::instancePool.DemandCreate(device))
{
}
// Move constructor.
CommonStates::CommonStates(CommonStates&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
// Move assignment.
CommonStates& CommonStates::operator= (CommonStates&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
// Public destructor.
CommonStates::~CommonStates()
{
}
//--------------------------------------------------------------------------------------
// Blend states
//--------------------------------------------------------------------------------------
ID3D11BlendState* CommonStates::Opaque() const
{
return DemandCreate(pImpl->opaque, pImpl->mutex, [&](ID3D11BlendState** pResult)
{
return pImpl->CreateBlendState(D3D11_BLEND_ONE, D3D11_BLEND_ZERO, pResult);
});
}
ID3D11BlendState* CommonStates::AlphaBlend() const
{
return DemandCreate(pImpl->alphaBlend, pImpl->mutex, [&](ID3D11BlendState** pResult)
{
return pImpl->CreateBlendState(D3D11_BLEND_ONE, D3D11_BLEND_INV_SRC_ALPHA, pResult);
});
}
ID3D11BlendState* CommonStates::Additive() const
{
return DemandCreate(pImpl->additive, pImpl->mutex, [&](ID3D11BlendState** pResult)
{
return pImpl->CreateBlendState(D3D11_BLEND_SRC_ALPHA, D3D11_BLEND_ONE, pResult);
});
}
ID3D11BlendState* CommonStates::NonPremultiplied() const
{
return DemandCreate(pImpl->nonPremultiplied, pImpl->mutex, [&](ID3D11BlendState** pResult)
{
return pImpl->CreateBlendState(D3D11_BLEND_SRC_ALPHA, D3D11_BLEND_INV_SRC_ALPHA, pResult);
});
}
//--------------------------------------------------------------------------------------
// Depth stencil states
//--------------------------------------------------------------------------------------
ID3D11DepthStencilState* CommonStates::DepthNone() const
{
return DemandCreate(pImpl->depthNone, pImpl->mutex, [&](ID3D11DepthStencilState** pResult)
{
return pImpl->CreateDepthStencilState(false, false, pResult);
});
}
ID3D11DepthStencilState* CommonStates::DepthDefault() const
{
return DemandCreate(pImpl->depthDefault, pImpl->mutex, [&](ID3D11DepthStencilState** pResult)
{
return pImpl->CreateDepthStencilState(true, true, pResult);
});
}
ID3D11DepthStencilState* CommonStates::DepthRead() const
{
return DemandCreate(pImpl->depthRead, pImpl->mutex, [&](ID3D11DepthStencilState** pResult)
{
return pImpl->CreateDepthStencilState(true, false, pResult);
});
}
//--------------------------------------------------------------------------------------
// Rasterizer states
//--------------------------------------------------------------------------------------
ID3D11RasterizerState* CommonStates::CullNone() const
{
return DemandCreate(pImpl->cullNone, pImpl->mutex, [&](ID3D11RasterizerState** pResult)
{
return pImpl->CreateRasterizerState(D3D11_CULL_NONE, D3D11_FILL_SOLID, pResult);
});
}
ID3D11RasterizerState* CommonStates::CullClockwise() const
{
return DemandCreate(pImpl->cullClockwise, pImpl->mutex, [&](ID3D11RasterizerState** pResult)
{
return pImpl->CreateRasterizerState(D3D11_CULL_FRONT, D3D11_FILL_SOLID, pResult);
});
}
ID3D11RasterizerState* CommonStates::CullCounterClockwise() const
{
return DemandCreate(pImpl->cullCounterClockwise, pImpl->mutex, [&](ID3D11RasterizerState** pResult)
{
return pImpl->CreateRasterizerState(D3D11_CULL_BACK, D3D11_FILL_SOLID, pResult);
});
}
ID3D11RasterizerState* CommonStates::Wireframe() const
{
return DemandCreate(pImpl->wireframe, pImpl->mutex, [&](ID3D11RasterizerState** pResult)
{
return pImpl->CreateRasterizerState(D3D11_CULL_BACK, D3D11_FILL_WIREFRAME, pResult);
});
}
//--------------------------------------------------------------------------------------
// Sampler states
//--------------------------------------------------------------------------------------
ID3D11SamplerState* CommonStates::PointWrap() const
{
return DemandCreate(pImpl->pointWrap, pImpl->mutex, [&](ID3D11SamplerState** pResult)
{
return pImpl->CreateSamplerState(D3D11_FILTER_MIN_MAG_MIP_POINT, D3D11_TEXTURE_ADDRESS_WRAP, pResult);
});
}
ID3D11SamplerState* CommonStates::PointClamp() const
{
return DemandCreate(pImpl->pointClamp, pImpl->mutex, [&](ID3D11SamplerState** pResult)
{
return pImpl->CreateSamplerState(D3D11_FILTER_MIN_MAG_MIP_POINT, D3D11_TEXTURE_ADDRESS_CLAMP, pResult);
});
}
ID3D11SamplerState* CommonStates::LinearWrap() const
{
return DemandCreate(pImpl->linearWrap, pImpl->mutex, [&](ID3D11SamplerState** pResult)
{
return pImpl->CreateSamplerState(D3D11_FILTER_MIN_MAG_MIP_LINEAR, D3D11_TEXTURE_ADDRESS_WRAP, pResult);
});
}
ID3D11SamplerState* CommonStates::LinearClamp() const
{
return DemandCreate(pImpl->linearClamp, pImpl->mutex, [&](ID3D11SamplerState** pResult)
{
return pImpl->CreateSamplerState(D3D11_FILTER_MIN_MAG_MIP_LINEAR, D3D11_TEXTURE_ADDRESS_CLAMP, pResult);
});
}
ID3D11SamplerState* CommonStates::AnisotropicWrap() const
{
return DemandCreate(pImpl->anisotropicWrap, pImpl->mutex, [&](ID3D11SamplerState** pResult)
{
return pImpl->CreateSamplerState(D3D11_FILTER_ANISOTROPIC, D3D11_TEXTURE_ADDRESS_WRAP, pResult);
});
}
ID3D11SamplerState* CommonStates::AnisotropicClamp() const
{
return DemandCreate(pImpl->anisotropicClamp, pImpl->mutex, [&](ID3D11SamplerState** pResult)
{
return pImpl->CreateSamplerState(D3D11_FILTER_ANISOTROPIC, D3D11_TEXTURE_ADDRESS_CLAMP, pResult);
});
}

View File

@@ -1,70 +0,0 @@
//--------------------------------------------------------------------------------------
// File: CommonStates.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#if defined(_XBOX_ONE) && defined(_TITLE)
#include <d3d11_x.h>
#else
#include <d3d11_1.h>
#endif
#include <memory>
namespace DirectX
{
class CommonStates
{
public:
explicit CommonStates(_In_ ID3D11Device* device);
CommonStates(CommonStates&& moveFrom);
CommonStates& operator= (CommonStates&& moveFrom);
virtual ~CommonStates();
// Blend states.
ID3D11BlendState* __cdecl Opaque() const;
ID3D11BlendState* __cdecl AlphaBlend() const;
ID3D11BlendState* __cdecl Additive() const;
ID3D11BlendState* __cdecl NonPremultiplied() const;
// Depth stencil states.
ID3D11DepthStencilState* __cdecl DepthNone() const;
ID3D11DepthStencilState* __cdecl DepthDefault() const;
ID3D11DepthStencilState* __cdecl DepthRead() const;
// Rasterizer states.
ID3D11RasterizerState* __cdecl CullNone() const;
ID3D11RasterizerState* __cdecl CullClockwise() const;
ID3D11RasterizerState* __cdecl CullCounterClockwise() const;
ID3D11RasterizerState* __cdecl Wireframe() const;
// Sampler states.
ID3D11SamplerState* __cdecl PointWrap() const;
ID3D11SamplerState* __cdecl PointClamp() const;
ID3D11SamplerState* __cdecl LinearWrap() const;
ID3D11SamplerState* __cdecl LinearClamp() const;
ID3D11SamplerState* __cdecl AnisotropicWrap() const;
ID3D11SamplerState* __cdecl AnisotropicClamp() const;
private:
// Private implementation.
class Impl;
std::shared_ptr<Impl> pImpl;
// Prevent copying.
CommonStates(CommonStates const&);
CommonStates& operator= (CommonStates const&);
};
}

View File

@@ -1,85 +0,0 @@
//--------------------------------------------------------------------------------------
// File: ConstantBuffer.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#include "DirectXHelpers.h"
#include "PlatformHelpers.h"
namespace DirectX
{
// Strongly typed wrapper around a D3D constant buffer.
template<typename T>
class ConstantBuffer
{
public:
// Constructor.
ConstantBuffer() {}
explicit ConstantBuffer(_In_ ID3D11Device* device)
{
Create( device );
}
void Create(_In_ ID3D11Device* device)
{
D3D11_BUFFER_DESC desc = { 0 };
desc.ByteWidth = sizeof(T);
desc.Usage = D3D11_USAGE_DYNAMIC;
desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
ThrowIfFailed(
device->CreateBuffer(&desc, nullptr, mConstantBuffer.ReleaseAndGetAddressOf() )
);
SetDebugObjectName(mConstantBuffer.Get(), "DirectXTK");
}
// Writes new data into the constant buffer.
void SetData(_In_ ID3D11DeviceContext* deviceContext, T const& value)
{
assert( mConstantBuffer.Get() != 0 );
D3D11_MAPPED_SUBRESOURCE mappedResource;
ThrowIfFailed(
deviceContext->Map(mConstantBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource)
);
*(T*)mappedResource.pData = value;
deviceContext->Unmap(mConstantBuffer.Get(), 0);
}
// Looks up the underlying D3D constant buffer.
ID3D11Buffer* GetBuffer()
{
return mConstantBuffer.Get();
}
private:
// The underlying D3D object.
Microsoft::WRL::ComPtr<ID3D11Buffer> mConstantBuffer;
// Prevent copying.
ConstantBuffer(ConstantBuffer const&);
ConstantBuffer& operator= (ConstantBuffer const&);
};
}

View File

@@ -1,51 +0,0 @@
//--------------------------------------------------------------------------------------
// File: DemandCreate.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#include "PlatformHelpers.h"
namespace DirectX
{
// Helper for lazily creating a D3D resource.
template<typename T, typename TCreateFunc>
static T* DemandCreate(Microsoft::WRL::ComPtr<T>& comPtr, std::mutex& mutex, TCreateFunc createFunc)
{
T* result = comPtr.Get();
// Double-checked lock pattern.
MemoryBarrier();
if (!result)
{
std::lock_guard<std::mutex> lock(mutex);
result = comPtr.Get();
if (!result)
{
// Create the new object.
ThrowIfFailed(
createFunc(&result)
);
MemoryBarrier();
comPtr.Attach(result);
}
}
return result;
}
}

View File

@@ -1,120 +0,0 @@
//--------------------------------------------------------------------------------------
// File: DirectXHelpers.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#if defined(_XBOX_ONE) && defined(_TITLE)
#include <d3d11_x.h>
#define NO_D3D11_DEBUG_NAME
#else
#include <d3d11_1.h>
#endif
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
#pragma comment(lib,"dxguid.lib")
#endif
#include <exception>
#pragma warning(push)
#pragma warning(disable : 4005)
#include <stdint.h>
#pragma warning(pop)
//
// The core Direct3D headers provide the following helper C++ classes
// CD3D11_RECT
// CD3D11_BOX
// CD3D11_DEPTH_STENCIL_DESC
// CD3D11_BLEND_DESC, CD3D11_BLEND_DESC1
// CD3D11_RASTERIZER_DESC, CD3D11_RASTERIZER_DESC1
// CD3D11_BUFFER_DESC
// CD3D11_TEXTURE1D_DESC
// CD3D11_TEXTURE2D_DESC
// CD3D11_TEXTURE3D_DESC
// CD3D11_SHADER_RESOURCE_VIEW_DESC
// CD3D11_RENDER_TARGET_VIEW_DESC
// CD3D11_VIEWPORT
// CD3D11_DEPTH_STENCIL_VIEW_DESC
// CD3D11_UNORDERED_ACCESS_VIEW_DESC
// CD3D11_SAMPLER_DESC
// CD3D11_QUERY_DESC
// CD3D11_COUNTER_DESC
//
namespace DirectX
{
// simliar to std::lock_guard for exception-safe Direct3D 11 resource locking
class MapGuard : public D3D11_MAPPED_SUBRESOURCE
{
public:
MapGuard( _In_ ID3D11DeviceContext* context,
_In_ ID3D11Resource *resource,
_In_ UINT subresource,
_In_ D3D11_MAP mapType,
_In_ UINT mapFlags )
: mContext(context), mResource(resource), mSubresource(subresource)
{
HRESULT hr = mContext->Map( resource, subresource, mapType, mapFlags, this );
if (FAILED(hr))
{
throw std::exception();
}
}
~MapGuard()
{
mContext->Unmap( mResource, mSubresource );
}
uint8_t* get() const
{
return reinterpret_cast<uint8_t*>( pData );
}
uint8_t* get(size_t slice) const
{
return reinterpret_cast<uint8_t*>( pData ) + ( slice * DepthPitch );
}
uint8_t* scanline(size_t row) const
{
return reinterpret_cast<uint8_t*>( pData ) + ( row * RowPitch );
}
uint8_t* scanline(size_t slice, size_t row) const
{
return reinterpret_cast<uint8_t*>( pData ) + ( slice * DepthPitch ) + ( row * RowPitch );
}
private:
ID3D11DeviceContext* mContext;
ID3D11Resource* mResource;
UINT mSubresource;
MapGuard(MapGuard const&);
MapGuard& operator= (MapGuard const&);
};
// Helper sets a D3D resource name string (used by PIX and debug layer leak reporting).
template<UINT TNameLength>
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_z_ const char (&name)[TNameLength])
{
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, name);
#else
UNREFERENCED_PARAMETER(resource);
UNREFERENCED_PARAMETER(name);
#endif
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,153 +0,0 @@
//-------------------------------------------------------------------------------------
//
// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows.
//
// Licensed under the BSD license, see LICENSE in JGE root for details.
//
// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) <jhkhui@gmail.com>
//
//-------------------------------------------------------------------------------------
#include "DebugRoutines.h"
#include "../../include/JSoundSystem.h"
#include "../../include/JFileSystem.h"
//////////////////////////////////////////////////////////////////////////
JMusic::JMusic()
{
}
void JMusic::Update(){
}
int JMusic::getPlayTime(){
return 0;
}
JMusic::~JMusic()
{
}
//////////////////////////////////////////////////////////////////////////
JSample::JSample()
{
}
JSample::~JSample()
{
}
unsigned long JSample::fileSize()
{
return 0;
}
//////////////////////////////////////////////////////////////////////////
JSoundSystem* JSoundSystem::mInstance = NULL;
JSoundSystem* JSoundSystem::GetInstance()
{
if (mInstance == NULL)
{
mInstance = new JSoundSystem();
mInstance->InitSoundSystem();
}
return mInstance;
}
void JSoundSystem::Destroy()
{
if (mInstance)
{
mInstance->DestroySoundSystem();
delete mInstance;
mInstance = NULL;
}
}
JSoundSystem::JSoundSystem()
{
mVolume = 0;
mSampleVolume = 0;
}
JSoundSystem::~JSoundSystem()
{
}
void JSoundSystem::InitSoundSystem()
{
}
void JSoundSystem::DestroySoundSystem()
{
}
JMusic *JSoundSystem::LoadMusic(const char *fileName)
{
cerr << fileName << endl;
return NULL;
}
void JSoundSystem::PlayMusic(JMusic *music, bool looping)
{
music = 0;
looping = false;
}
void JSoundSystem::StopMusic(JMusic *music)
{
music = 0;
}
void JSoundSystem::PauseMusic(JMusic *music)
{
StopMusic(music);
}
void JSoundSystem::ResumeMusic(JMusic *music)
{
PlayMusic(music);
}
void JSoundSystem::SetVolume(int volume)
{
SetMusicVolume(volume);
SetSfxVolume(volume);
}
void JSoundSystem::SetMusicVolume(int volume)
{
mVolume = volume;
}
void JSoundSystem::SetSfxVolume(int volume)
{
//this sets the volume to all channels then reverts back the volume for music..
//that's a bit dirty but it works
mSampleVolume = volume;
SetMusicVolume(mVolume);
}
JSample *JSoundSystem::LoadSample(const char *fileName)
{
cerr << fileName << endl;
return NULL;
}
void JSoundSystem::PlaySample(JSample *sample)
{
sample = 0;
}

View File

@@ -1,110 +0,0 @@
//--------------------------------------------------------------------------------------
// File: PlatformHelpers.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#pragma warning(disable : 4324 4481)
#include <exception>
namespace DirectX
{
// Helper utility converts D3D API failures into exceptions.
inline void ThrowIfFailed(HRESULT hr)
{
if (FAILED(hr))
{
throw std::exception();
}
}
// Helper for output debug tracing
inline void DebugTrace( _In_z_ _Printf_format_string_ const char* format, ... )
{
#ifdef _DEBUG
va_list args;
va_start( args, format );
char buff[1024]={0};
vsprintf_s( buff, format, args );
OutputDebugStringA( buff );
#else
UNREFERENCED_PARAMETER( format );
#endif
}
// Helper smart-pointers
struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } };
typedef public std::unique_ptr<void, handle_closer> ScopedHandle;
inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; }
}
#if (defined(_MSC_VER) && (_MSC_VER < 1610)) || defined(DIRECTX_EMULATE_MUTEX)
// Emulate the C++0x mutex and lock_guard types when building with Visual Studio versions < 2012.
namespace std
{
class mutex
{
public:
mutex() { InitializeCriticalSection(&mCriticalSection); }
~mutex() { DeleteCriticalSection(&mCriticalSection); }
void lock() { EnterCriticalSection(&mCriticalSection); }
void unlock() { LeaveCriticalSection(&mCriticalSection); }
bool try_lock() { return TryEnterCriticalSection(&mCriticalSection) != 0; }
private:
CRITICAL_SECTION mCriticalSection;
mutex(mutex const&);
mutex& operator= (mutex const&);
};
template<typename Mutex>
class lock_guard
{
public:
typedef Mutex mutex_type;
explicit lock_guard(mutex_type& mutex)
: mMutex(mutex)
{
mMutex.lock();
}
~lock_guard()
{
mMutex.unlock();
}
private:
mutex_type& mMutex;
lock_guard(lock_guard const&);
lock_guard& operator= (lock_guard const&);
};
}
#else // _MSC_VER < 1610
#include <mutex>
#endif

View File

@@ -1,137 +0,0 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0
dcl t1.xy
dcl_2d s0
texld r0, t1, s0
mul r0, r0, t0
mov oC0, r0
// approximately 3 instruction slots used (1 texture, 2 arithmetic)
ps_4_0
dcl_constantbuffer cb0[1], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 1
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
mul o0.xyzw, r0.xyzw, v0.xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE SpriteEffect_SpritePixelShader[] =
{
68, 88, 66, 67, 62, 231,
156, 88, 145, 159, 172, 51,
164, 207, 207, 254, 124, 230,
155, 106, 1, 0, 0, 0,
232, 1, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
184, 0, 0, 0, 100, 1,
0, 0, 180, 1, 0, 0,
65, 111, 110, 57, 128, 0,
0, 0, 128, 0, 0, 0,
0, 2, 255, 255, 88, 0,
0, 0, 40, 0, 0, 0,
0, 0, 40, 0, 0, 0,
40, 0, 0, 0, 40, 0,
1, 0, 36, 0, 0, 0,
40, 0, 0, 0, 0, 0,
0, 2, 255, 255, 31, 0,
0, 2, 0, 0, 0, 128,
0, 0, 15, 176, 31, 0,
0, 2, 0, 0, 0, 128,
1, 0, 3, 176, 31, 0,
0, 2, 0, 0, 0, 144,
0, 8, 15, 160, 66, 0,
0, 3, 0, 0, 15, 128,
1, 0, 228, 176, 0, 8,
228, 160, 5, 0, 0, 3,
0, 0, 15, 128, 0, 0,
228, 128, 0, 0, 228, 176,
1, 0, 0, 2, 0, 8,
15, 128, 0, 0, 228, 128,
255, 255, 0, 0, 83, 72,
68, 82, 164, 0, 0, 0,
64, 0, 0, 0, 41, 0,
0, 0, 89, 0, 0, 4,
70, 142, 32, 0, 0, 0,
0, 0, 1, 0, 0, 0,
90, 0, 0, 3, 0, 96,
16, 0, 0, 0, 0, 0,
88, 24, 0, 4, 0, 112,
16, 0, 0, 0, 0, 0,
85, 85, 0, 0, 98, 16,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 98, 16,
0, 3, 50, 16, 16, 0,
1, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 104, 0,
0, 2, 1, 0, 0, 0,
69, 0, 0, 9, 242, 0,
16, 0, 0, 0, 0, 0,
70, 16, 16, 0, 1, 0,
0, 0, 70, 126, 16, 0,
0, 0, 0, 0, 0, 96,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 242, 32,
16, 0, 0, 0, 0, 0,
70, 14, 16, 0, 0, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
72, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0,
56, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
62, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 3, 3, 0, 0,
67, 79, 76, 79, 82, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 171, 79, 83,
71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 84,
97, 114, 103, 101, 116, 0,
171, 171
};

View File

@@ -1,213 +0,0 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xy 1 NONE float xy
// SV_Position 0 xyzw 2 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xy 1 NONE float xy
// SV_Position 0 xyzw 2 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 4 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
dcl_texcoord v0
dcl_texcoord1 v1
dcl_texcoord2 v2
mul r0, v2.y, c2
mad r0, v2.x, c1, r0
mad r0, v2.z, c3, r0
mad r0, v2.w, c4, r0
mad oPos.xy, r0.w, c0, r0
mov oPos.zw, r0
mov oT0, v0
mov oT1.xy, v1
// approximately 8 instruction slots used
vs_4_0
dcl_constantbuffer cb0[4], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_input v2.xyzw
dcl_output o0.xyzw
dcl_output o1.xy
dcl_output_siv o2.xyzw, position
dcl_temps 1
mov o0.xyzw, v0.xyzw
mov o1.xy, v1.xyxx
mul r0.xyzw, v2.yyyy, cb0[1].xyzw
mad r0.xyzw, v2.xxxx, cb0[0].xyzw, r0.xyzw
mad r0.xyzw, v2.zzzz, cb0[2].xyzw, r0.xyzw
mad o2.xyzw, v2.wwww, cb0[3].xyzw, r0.xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE SpriteEffect_SpriteVertexShader[] =
{
68, 88, 66, 67, 53, 15,
108, 68, 10, 30, 79, 231,
153, 9, 61, 10, 198, 154,
8, 125, 1, 0, 0, 0,
60, 3, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
28, 1, 0, 0, 84, 2,
0, 0, 200, 2, 0, 0,
65, 111, 110, 57, 228, 0,
0, 0, 228, 0, 0, 0,
0, 2, 254, 255, 176, 0,
0, 0, 52, 0, 0, 0,
1, 0, 36, 0, 0, 0,
48, 0, 0, 0, 48, 0,
0, 0, 36, 0, 1, 0,
48, 0, 0, 0, 0, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 31, 0,
0, 2, 5, 0, 0, 128,
0, 0, 15, 144, 31, 0,
0, 2, 5, 0, 1, 128,
1, 0, 15, 144, 31, 0,
0, 2, 5, 0, 2, 128,
2, 0, 15, 144, 5, 0,
0, 3, 0, 0, 15, 128,
2, 0, 85, 144, 2, 0,
228, 160, 4, 0, 0, 4,
0, 0, 15, 128, 2, 0,
0, 144, 1, 0, 228, 160,
0, 0, 228, 128, 4, 0,
0, 4, 0, 0, 15, 128,
2, 0, 170, 144, 3, 0,
228, 160, 0, 0, 228, 128,
4, 0, 0, 4, 0, 0,
15, 128, 2, 0, 255, 144,
4, 0, 228, 160, 0, 0,
228, 128, 4, 0, 0, 4,
0, 0, 3, 192, 0, 0,
255, 128, 0, 0, 228, 160,
0, 0, 228, 128, 1, 0,
0, 2, 0, 0, 12, 192,
0, 0, 228, 128, 1, 0,
0, 2, 0, 0, 15, 224,
0, 0, 228, 144, 1, 0,
0, 2, 1, 0, 3, 224,
1, 0, 228, 144, 255, 255,
0, 0, 83, 72, 68, 82,
48, 1, 0, 0, 64, 0,
1, 0, 76, 0, 0, 0,
89, 0, 0, 4, 70, 142,
32, 0, 0, 0, 0, 0,
4, 0, 0, 0, 95, 0,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 95, 0,
0, 3, 50, 16, 16, 0,
1, 0, 0, 0, 95, 0,
0, 3, 242, 16, 16, 0,
2, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0,
0, 3, 50, 32, 16, 0,
1, 0, 0, 0, 103, 0,
0, 4, 242, 32, 16, 0,
2, 0, 0, 0, 1, 0,
0, 0, 104, 0, 0, 2,
1, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
54, 0, 0, 5, 50, 32,
16, 0, 1, 0, 0, 0,
70, 16, 16, 0, 1, 0,
0, 0, 56, 0, 0, 8,
242, 0, 16, 0, 0, 0,
0, 0, 86, 21, 16, 0,
2, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
1, 0, 0, 0, 50, 0,
0, 10, 242, 0, 16, 0,
0, 0, 0, 0, 6, 16,
16, 0, 2, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
70, 14, 16, 0, 0, 0,
0, 0, 50, 0, 0, 10,
242, 0, 16, 0, 0, 0,
0, 0, 166, 26, 16, 0,
2, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
2, 0, 0, 0, 70, 14,
16, 0, 0, 0, 0, 0,
50, 0, 0, 10, 242, 32,
16, 0, 2, 0, 0, 0,
246, 31, 16, 0, 2, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 3, 0,
0, 0, 70, 14, 16, 0,
0, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
108, 0, 0, 0, 3, 0,
0, 0, 8, 0, 0, 0,
80, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
86, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 3, 3, 0, 0,
95, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 15, 15, 0, 0,
67, 79, 76, 79, 82, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 83, 86, 95,
80, 111, 115, 105, 116, 105,
111, 110, 0, 171, 79, 83,
71, 78, 108, 0, 0, 0,
3, 0, 0, 0, 8, 0,
0, 0, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 86, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 3, 12,
0, 0, 95, 0, 0, 0,
0, 0, 0, 0, 1, 0,
0, 0, 3, 0, 0, 0,
2, 0, 0, 0, 15, 0,
0, 0, 67, 79, 76, 79,
82, 0, 84, 69, 88, 67,
79, 79, 82, 68, 0, 83,
86, 95, 80, 111, 115, 105,
116, 105, 111, 110, 0, 171
};

View File

@@ -1,108 +0,0 @@
//--------------------------------------------------------------------------------------
// File: SharedResourcePool.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#include <map>
#include <memory>
#include "PlatformHelpers.h"
namespace DirectX
{
// Pool manager ensures that only a single TData instance is created for each unique TKey.
// This is used to avoid duplicate resource creation, so that for instance a caller can
// create any number of SpriteBatch instances, but these can internally share shaders and
// vertex buffer if more than one SpriteBatch uses the same underlying D3D device.
template<typename TKey, typename TData>
class SharedResourcePool
{
public:
SharedResourcePool()
: mResourceMap(std::make_shared<ResourceMap>())
{ }
// Allocates or looks up the shared TData instance for the specified key.
std::shared_ptr<TData> DemandCreate(TKey key)
{
std::lock_guard<std::mutex> lock(mResourceMap->mutex);
// Return an existing instance?
auto pos = mResourceMap->find(key);
if (pos != mResourceMap->end())
{
auto existingValue = pos->second.lock();
if (existingValue)
return existingValue;
else
mResourceMap->erase(pos);
}
// Allocate a new instance.
auto newValue = std::make_shared<WrappedData>(key, mResourceMap);
mResourceMap->insert(std::make_pair(key, newValue));
return newValue;
}
private:
// Keep track of all allocated TData instances.
struct ResourceMap : public std::map<TKey, std::weak_ptr<TData>>
{
std::mutex mutex;
};
std::shared_ptr<ResourceMap> mResourceMap;
// Wrap TData with our own subclass, so we can hook the destructor
// to remove instances from our pool before they are freed.
struct WrappedData : public TData
{
WrappedData(TKey key, std::shared_ptr<ResourceMap> const& resourceMap)
: mKey(key),
mResourceMap(resourceMap),
TData(key)
{ }
~WrappedData()
{
std::lock_guard<std::mutex> lock(mResourceMap->mutex);
auto pos = mResourceMap->find(mKey);
// Check for weak reference expiry before erasing, in case DemandCreate runs on
// a different thread at the same time as a previous instance is being destroyed.
// We mustn't erase replacement objects that have just been added!
if (pos != mResourceMap->end() && pos->second.expired())
{
mResourceMap->erase(pos);
}
}
TKey mKey;
std::shared_ptr<ResourceMap> mResourceMap;
};
// Prevent copying.
SharedResourcePool(SharedResourcePool const&);
SharedResourcePool& operator= (SharedResourcePool const&);
};
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,110 +0,0 @@
//--------------------------------------------------------------------------------------
// File: SpriteBatch.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#if defined(_XBOX_ONE) && defined(_TITLE)
#include <d3d11_x.h>
#else
#include <d3d11_1.h>
#endif
#include <DirectXMath.h>
#include <DirectXColors.h>
#include <functional>
#include <memory>
// VS 2010 doesn't support explicit calling convention for std::function
#ifndef DIRECTX_STD_CALLCONV
#if defined(_MSC_VER) && (_MSC_VER < 1700)
#define DIRECTX_STD_CALLCONV
#else
#define DIRECTX_STD_CALLCONV __cdecl
#endif
#endif
namespace DirectX
{
#if (DIRECTX_MATH_VERSION < 305) && !defined(XM_CALLCONV)
#define XM_CALLCONV __fastcall
typedef const XMVECTOR& HXMVECTOR;
typedef const XMMATRIX& FXMMATRIX;
#endif
enum SpriteSortMode
{
SpriteSortMode_Deferred,
SpriteSortMode_Immediate,
SpriteSortMode_Texture,
SpriteSortMode_BackToFront,
SpriteSortMode_FrontToBack,
};
enum SpriteEffects
{
SpriteEffects_None = 0,
SpriteEffects_FlipHorizontally = 1,
SpriteEffects_FlipVertically = 2,
SpriteEffects_FlipBoth = SpriteEffects_FlipHorizontally | SpriteEffects_FlipVertically,
};
class SpriteBatch
{
public:
explicit SpriteBatch(_In_ ID3D11DeviceContext* deviceContext);
SpriteBatch(SpriteBatch&& moveFrom);
SpriteBatch& operator= (SpriteBatch&& moveFrom);
virtual ~SpriteBatch();
// Begin/End a batch of sprite drawing operations.
void XM_CALLCONV Begin(SpriteSortMode sortMode = SpriteSortMode_Deferred, _In_opt_ ID3D11BlendState* blendState = nullptr, _In_opt_ ID3D11SamplerState* samplerState = nullptr, _In_opt_ ID3D11DepthStencilState* depthStencilState = nullptr, _In_opt_ ID3D11RasterizerState* rasterizerState = nullptr,
_In_opt_ std::function<void DIRECTX_STD_CALLCONV()> setCustomShaders = nullptr, FXMMATRIX transformMatrix = MatrixIdentity);
void __cdecl End();
// Draw overloads specifying position, origin and scale as XMFLOAT2.
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, XMFLOAT2 const& position, FXMVECTOR color = Colors::White);
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, XMFLOAT2 const& position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color = Colors::White, float rotation = 0, XMFLOAT2 const& origin = Float2Zero, float scale = 1, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, XMFLOAT2 const& position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color, float rotation, XMFLOAT2 const& origin, XMFLOAT2 const& scale, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
// Draw overloads specifying position, origin and scale via the first two components of an XMVECTOR.
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, FXMVECTOR position, FXMVECTOR color = Colors::White);
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, FXMVECTOR position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color = Colors::White, float rotation = 0, FXMVECTOR origin = g_XMZero, float scale = 1, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, FXMVECTOR position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color, float rotation, FXMVECTOR origin, GXMVECTOR scale, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
// Draw overloads specifying position as a RECT.
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, RECT const& destinationRectangle, FXMVECTOR color = Colors::White);
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, RECT const& destinationRectangle, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color = Colors::White, float rotation = 0, XMFLOAT2 const& origin = Float2Zero, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
// Rotation mode to be applied to the sprite transformation
void __cdecl SetRotation( DXGI_MODE_ROTATION mode );
DXGI_MODE_ROTATION __cdecl GetRotation() const;
// Set viewport for sprite transformation
void __cdecl SetViewport( const D3D11_VIEWPORT& viewPort );
private:
// Private implementation.
class Impl;
std::unique_ptr<Impl> pImpl;
static const XMMATRIX MatrixIdentity;
static const XMFLOAT2 Float2Zero;
// Prevent copying.
SpriteBatch(SpriteBatch const&);
SpriteBatch& operator= (SpriteBatch const&);
};
}

View File

@@ -1,166 +0,0 @@
//--------------------------------------------------------------------------------------
// File: VertexTypes.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
//#include "pch.h"
#if !defined(WIN32_LEAN_AND_MEAN)
#define WIN32_LEAN_AND_MEAN
#endif
#if !defined(NOMINMAX)
#define NOMINMAX
#endif
#include <wrl.h>
#include <wrl/client.h>
using namespace Microsoft::WRL;
#include "VertexTypes.h"
#include <DirectXPackedVector.h>
using namespace DirectX;
using namespace DirectX::PackedVector;
//--------------------------------------------------------------------------------------
// Vertex struct holding position and color information.
const D3D11_INPUT_ELEMENT_DESC VertexPositionColor::InputElements[] =
{
{ "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
static_assert( sizeof(VertexPositionColor) == 28, "Vertex struct/layout mismatch" );
//--------------------------------------------------------------------------------------
// Vertex struct holding position and texture mapping information.
const D3D11_INPUT_ELEMENT_DESC VertexPositionTexture::InputElements[] =
{
{ "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
static_assert( sizeof(VertexPositionTexture) == 20, "Vertex struct/layout mismatch" );
//--------------------------------------------------------------------------------------
// Vertex struct holding position and normal vector.
const D3D11_INPUT_ELEMENT_DESC VertexPositionNormal::InputElements[] =
{
{ "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
static_assert( sizeof(VertexPositionNormal) == 24, "Vertex struct/layout mismatch" );
//--------------------------------------------------------------------------------------
// Vertex struct holding position, color, and texture mapping information.
const D3D11_INPUT_ELEMENT_DESC VertexPositionColorTexture::InputElements[] =
{
{ "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
static_assert( sizeof(VertexPositionColorTexture) == 36, "Vertex struct/layout mismatch" );
//--------------------------------------------------------------------------------------
// Vertex struct holding position, normal vector, and color information.
const D3D11_INPUT_ELEMENT_DESC VertexPositionNormalColor::InputElements[] =
{
{ "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
static_assert( sizeof(VertexPositionNormalColor) == 40, "Vertex struct/layout mismatch" );
//--------------------------------------------------------------------------------------
// Vertex struct holding position, normal vector, and texture mapping information.
const D3D11_INPUT_ELEMENT_DESC VertexPositionNormalTexture::InputElements[] =
{
{ "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
static_assert( sizeof(VertexPositionNormalTexture) == 32, "Vertex struct/layout mismatch" );
//--------------------------------------------------------------------------------------
// Vertex struct holding position, normal vector, color, and texture mapping information.
const D3D11_INPUT_ELEMENT_DESC VertexPositionNormalColorTexture::InputElements[] =
{
{ "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
static_assert( sizeof(VertexPositionNormalColorTexture) == 48, "Vertex struct/layout mismatch" );
//--------------------------------------------------------------------------------------
// Vertex struct for Visual Studio Shader Designer (DGSL) holding position, normal,
// tangent, color (RGBA), and texture mapping information
const D3D11_INPUT_ELEMENT_DESC VertexPositionNormalTangentColorTexture::InputElements[] =
{
{ "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TANGENT", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
static_assert( sizeof(VertexPositionNormalTangentColorTexture) == 52, "Vertex struct/layout mismatch" );
void XM_CALLCONV VertexPositionNormalTangentColorTexture::SetColor( FXMVECTOR icolor )
{
XMUBYTEN4 rgba;
XMStoreUByteN4( &rgba, icolor );
this->color = rgba.v;
}
//--------------------------------------------------------------------------------------
// Vertex struct for Visual Studio Shader Designer (DGSL) holding position, normal,
// tangent, color (RGBA), texture mapping information, and skinning weights
const D3D11_INPUT_ELEMENT_DESC VertexPositionNormalTangentColorTextureSkinning::InputElements[] =
{
{ "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TANGENT", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "BLENDINDICES",0, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "BLENDWEIGHT", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
static_assert( VertexPositionNormalTangentColorTextureSkinning::InputElementCount == VertexPositionNormalTangentColorTexture::InputElementCount + 2, "layout mismatch");
static_assert( sizeof(VertexPositionNormalTangentColorTextureSkinning) == 60, "Vertex struct/layout mismatch" );
void VertexPositionNormalTangentColorTextureSkinning::SetBlendIndices( XMUINT4 const& iindices )
{
this->indices = ( (iindices.w & 0xff) << 24 ) | ( (iindices.z & 0xff) << 16 ) | ( (iindices.y & 0xff) << 8 ) | ( iindices.x & 0xff );
}
void XM_CALLCONV VertexPositionNormalTangentColorTextureSkinning::SetBlendWeights( FXMVECTOR iweights )
{
XMUBYTEN4 packed;
XMStoreUByteN4( &packed, iweights );
this->weights = packed.v;
}

View File

@@ -1,331 +0,0 @@
//--------------------------------------------------------------------------------------
// File: VertexTypes.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#if defined(_XBOX_ONE) && defined(_TITLE)
#include <d3d11_x.h>
#else
#include <d3d11_1.h>
#endif
#include <DirectXMath.h>
namespace DirectX
{
#if (DIRECTX_MATH_VERSION < 305) && !defined(XM_CALLCONV)
#define XM_CALLCONV __fastcall
typedef const XMVECTOR& HXMVECTOR;
typedef const XMMATRIX& FXMMATRIX;
#endif
// Vertex struct holding position and color information.
struct VertexPositionColor
{
VertexPositionColor()
{ }
VertexPositionColor(XMFLOAT3 const& position, XMFLOAT4 const& color)
: position(position),
color(color)
{ }
VertexPositionColor(FXMVECTOR position, FXMVECTOR color)
{
XMStoreFloat3(&this->position, position);
XMStoreFloat4(&this->color, color);
}
XMFLOAT3 position;
XMFLOAT4 color;
static const int InputElementCount = 2;
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
};
// Vertex struct holding position and texture mapping information.
struct VertexPositionTexture
{
VertexPositionTexture()
{ }
VertexPositionTexture(XMFLOAT3 const& position, XMFLOAT2 const& textureCoordinate)
: position(position),
textureCoordinate(textureCoordinate)
{ }
VertexPositionTexture(FXMVECTOR position, FXMVECTOR textureCoordinate)
{
XMStoreFloat3(&this->position, position);
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
}
XMFLOAT3 position;
XMFLOAT2 textureCoordinate;
static const int InputElementCount = 2;
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
};
// Vertex struct holding position and normal vector.
struct VertexPositionNormal
{
VertexPositionNormal()
{ }
VertexPositionNormal(XMFLOAT3 const& position, XMFLOAT3 const& normal)
: position(position),
normal(normal)
{ }
VertexPositionNormal(FXMVECTOR position, FXMVECTOR normal)
{
XMStoreFloat3(&this->position, position);
XMStoreFloat3(&this->normal, normal);
}
XMFLOAT3 position;
XMFLOAT3 normal;
static const int InputElementCount = 2;
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
};
// Vertex struct holding position, color, and texture mapping information.
struct VertexPositionColorTexture
{
VertexPositionColorTexture()
{ }
VertexPositionColorTexture(XMFLOAT3 const& position, XMFLOAT4 const& color, XMFLOAT2 const& textureCoordinate)
: position(position),
color(color),
textureCoordinate(textureCoordinate)
{ }
VertexPositionColorTexture(FXMVECTOR position, FXMVECTOR color, FXMVECTOR textureCoordinate)
{
XMStoreFloat3(&this->position, position);
XMStoreFloat4(&this->color, color);
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
}
XMFLOAT3 position;
XMFLOAT4 color;
XMFLOAT2 textureCoordinate;
static const int InputElementCount = 3;
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
};
// Vertex struct holding position, normal vector, and color information.
struct VertexPositionNormalColor
{
VertexPositionNormalColor()
{ }
VertexPositionNormalColor(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& color)
: position(position),
normal(normal),
color(color)
{ }
VertexPositionNormalColor(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR color)
{
XMStoreFloat3(&this->position, position);
XMStoreFloat3(&this->normal, normal);
XMStoreFloat4(&this->color, color);
}
XMFLOAT3 position;
XMFLOAT3 normal;
XMFLOAT4 color;
static const int InputElementCount = 3;
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
};
// Vertex struct holding position, normal vector, and texture mapping information.
struct VertexPositionNormalTexture
{
VertexPositionNormalTexture()
{ }
VertexPositionNormalTexture(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT2 const& textureCoordinate)
: position(position),
normal(normal),
textureCoordinate(textureCoordinate)
{ }
VertexPositionNormalTexture(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR textureCoordinate)
{
XMStoreFloat3(&this->position, position);
XMStoreFloat3(&this->normal, normal);
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
}
XMFLOAT3 position;
XMFLOAT3 normal;
XMFLOAT2 textureCoordinate;
static const int InputElementCount = 3;
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
};
// Vertex struct holding position, normal vector, color, and texture mapping information.
struct VertexPositionNormalColorTexture
{
VertexPositionNormalColorTexture()
{ }
VertexPositionNormalColorTexture(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& color, XMFLOAT2 const& textureCoordinate)
: position(position),
normal(normal),
color(color),
textureCoordinate(textureCoordinate)
{ }
VertexPositionNormalColorTexture(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR color, CXMVECTOR textureCoordinate)
{
XMStoreFloat3(&this->position, position);
XMStoreFloat3(&this->normal, normal);
XMStoreFloat4(&this->color, color);
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
}
XMFLOAT3 position;
XMFLOAT3 normal;
XMFLOAT4 color;
XMFLOAT2 textureCoordinate;
static const int InputElementCount = 4;
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
};
// Vertex struct for Visual Studio Shader Designer (DGSL) holding position, normal,
// tangent, color (RGBA), and texture mapping information
struct VertexPositionNormalTangentColorTexture
{
VertexPositionNormalTangentColorTexture()
{ }
XMFLOAT3 position;
XMFLOAT3 normal;
XMFLOAT4 tangent;
uint32_t color;
XMFLOAT2 textureCoordinate;
VertexPositionNormalTangentColorTexture(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& tangent, uint32_t rgba, XMFLOAT2 const& textureCoordinate)
: position(position),
normal(normal),
tangent(tangent),
color(rgba),
textureCoordinate(textureCoordinate)
{
}
VertexPositionNormalTangentColorTexture(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR tangent, uint32_t rgba, CXMVECTOR textureCoordinate)
: color(rgba)
{
XMStoreFloat3(&this->position, position);
XMStoreFloat3(&this->normal, normal);
XMStoreFloat4(&this->tangent, tangent);
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
}
VertexPositionNormalTangentColorTexture(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& tangent, XMFLOAT4 const& color, XMFLOAT2 const& textureCoordinate)
: position(position),
normal(normal),
tangent(tangent),
textureCoordinate(textureCoordinate)
{
SetColor( color );
}
VertexPositionNormalTangentColorTexture(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR tangent, CXMVECTOR color, CXMVECTOR textureCoordinate)
{
XMStoreFloat3(&this->position, position);
XMStoreFloat3(&this->normal, normal);
XMStoreFloat4(&this->tangent, tangent);
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
SetColor( color );
}
void __cdecl SetColor( XMFLOAT4 const& icolor ) { SetColor( XMLoadFloat4( &icolor ) ); }
void XM_CALLCONV SetColor( FXMVECTOR icolor );
static const int InputElementCount = 5;
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
};
// Vertex struct for Visual Studio Shader Designer (DGSL) holding position, normal,
// tangent, color (RGBA), texture mapping information, and skinning weights
struct VertexPositionNormalTangentColorTextureSkinning : public VertexPositionNormalTangentColorTexture
{
VertexPositionNormalTangentColorTextureSkinning()
{ }
uint32_t indices;
uint32_t weights;
VertexPositionNormalTangentColorTextureSkinning(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& tangent, uint32_t rgba,
XMFLOAT2 const& textureCoordinate, XMUINT4 const& indices, XMFLOAT4 const& weights)
: VertexPositionNormalTangentColorTexture(position,normal,tangent,rgba,textureCoordinate)
{
SetBlendIndices( indices );
SetBlendWeights( weights );
}
VertexPositionNormalTangentColorTextureSkinning(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR tangent, uint32_t rgba, CXMVECTOR textureCoordinate,
XMUINT4 const& indices, CXMVECTOR weights)
: VertexPositionNormalTangentColorTexture(position,normal,tangent,rgba,textureCoordinate)
{
SetBlendIndices( indices );
SetBlendWeights( weights );
}
VertexPositionNormalTangentColorTextureSkinning(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& tangent, XMFLOAT4 const& color,
XMFLOAT2 const& textureCoordinate, XMUINT4 const& indices, XMFLOAT4 const& weights)
: VertexPositionNormalTangentColorTexture(position,normal,tangent,color,textureCoordinate)
{
SetBlendIndices( indices );
SetBlendWeights( weights );
}
VertexPositionNormalTangentColorTextureSkinning(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR tangent, CXMVECTOR color, CXMVECTOR textureCoordinate,
XMUINT4 const& indices, CXMVECTOR weights)
: VertexPositionNormalTangentColorTexture(position,normal,tangent,color,textureCoordinate)
{
SetBlendIndices( indices );
SetBlendWeights( weights );
}
void __cdecl SetBlendIndices( XMUINT4 const& iindices );
void __cdecl SetBlendWeights( XMFLOAT4 const& iweights ) { SetBlendWeights( XMLoadFloat4( &iweights ) ); }
void XM_CALLCONV SetBlendWeights( FXMVECTOR iweights );
static const int InputElementCount = 7;
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
};
}

View File

@@ -16,9 +16,14 @@ User folder is the only one that is really needed to guarantee both read and wri
The content that users should not be touching.
*/
#ifndef PSP
#if defined (ANDROID)
#include "PrecompiledHeader.h"
#endif //PSP
#endif //ANDROID
#if defined (LINUX)
#include "../../projects/mtg/include/PrecompiledHeader.h"
#endif //LINUX
#ifdef WIN32
#pragma warning(disable : 4786)
@@ -32,11 +37,18 @@ The content that users should not be touching.
#include "../include/JGE.h"
#include "../include/JFileSystem.h"
#include "../include/JLogger.h"
#include <dirent.h>
#ifdef QT_CONFIG
#include <QDir>
#endif
/*
#ifdef IOS
#include <Foundation/Foundation.h>
#endif
*/
JFileSystem* JFileSystem::mInstance = NULL;
JZipCache::JZipCache()
@@ -136,17 +148,6 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
DebugTrace("User path " << userPath);
DebugTrace("System path " << systemPath);
DebugTrace("Current path " << QDir::currentPath().toStdString());
#elif defined (WP8)
char buff[500];
// auto appInstallDirectory = Windows::Storage::KnownFolders::DocumentsLibrary::get()->Path;
auto appInstallDirectory = Windows::ApplicationModel::Package::Current->InstalledLocation->Path;
WideCharToMultiByte(CP_ACP, 0, appInstallDirectory->Data(), -1, buff, appInstallDirectory->Length()+1, NULL, NULL);
systemPath = buff;
systemPath += "\\Assets\\";
auto localfolder = Windows::Storage::ApplicationData::Current->LocalFolder->Path;
WideCharToMultiByte(CP_ACP, 0, localfolder->Data(), -1, buff, localfolder->Length()+1, NULL, NULL);
userPath = buff;
#else
//Find the Res.txt file and matching Res folders for backwards compatibility
ifstream mfile("Res.txt");

View File

@@ -10,7 +10,7 @@
// Should we add PrecompiledHeader.h to more platforms here? PSP Doesn't support it in JGE (erwan 2011/12/11)
#if defined (IOS) || defined (ANDROID) || defined (WP8)
#if defined (IOS) || defined (ANDROID)
#include "PrecompiledHeader.h"
#endif
@@ -249,6 +249,7 @@ u32 JGE::BindKey(LocalKeySym sym, JButton button)
u32 JGE::UnbindKey(LocalKeySym sym, JButton button)
{
for (keycodes_it it = keyBinds.begin(); it != keyBinds.end(); )
{
if (sym == it->first && button == it->second)
{
keycodes_it er = it;
@@ -256,7 +257,8 @@ u32 JGE::UnbindKey(LocalKeySym sym, JButton button)
keyBinds.erase(er);
}
else ++it;
return keyBinds.size();
}
return keyBinds.size();
}
u32 JGE::UnbindKey(LocalKeySym sym)

View File

@@ -117,23 +117,16 @@ void JRenderer::Destroy()
}
}
JRenderer::JRenderer() :
mLeft(0.0f),
mTop(0.0f),
mRight(SCREEN_WIDTH_F),
mBottom(SCREEN_HEIGHT_F)
JRenderer::JRenderer() : mActualWidth(SCREEN_WIDTH_F), mActualHeight(SCREEN_HEIGHT_F)
{
}
JRenderer::~JRenderer()
{
}
void JRenderer::OnWindowsSizeChanged(void* window, float inWidth, float inHeight)
{
}
void JRenderer::InitRenderer()
{
mCurrentTextureFilter = TEX_FILTER_NONE;
@@ -143,6 +136,7 @@ void JRenderer::InitRenderer()
mCurrTexBlendDest = BLEND_ONE_MINUS_SRC_ALPHA;
// mLineWidth = 1.0f;
mCurrentTex = -1;
mFOV = 75.0f;
#ifdef USING_MATH_TABLE
@@ -179,6 +173,8 @@ void JRenderer::EnableTextureFilter(bool flag)
mCurrentTextureFilter = TEX_FILTER_LINEAR;
else
mCurrentTextureFilter = TEX_FILTER_NEAREST;
mCurrentTex = -1;
}
void Swap(float *a, float *b)

View File

@@ -8,9 +8,7 @@
//
//-------------------------------------------------------------------------------------
#if defined (IOS) || defined (ANDROID) || defined (WP8)
#include "PrecompiledHeader.h"
#endif
#include "../include/JLBFont.h"
#include "../include/JFileSystem.h"

View File

@@ -4,12 +4,13 @@
*/
#if (defined WIN32) && (!defined QT_CONFIG)
#pragma comment(lib,"ws2_32.lib")
#include <winsock2.h>
#elif defined (LINUX)
#elif defined (PSP)
#include "../include/DebugRoutines.h"
#include "../include/JNetwork.h"
#if defined (WIN32) || defined (LINUX)
#else
#ifdef NETWORK_SUPPORT
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspsdk.h>
@@ -28,11 +29,9 @@
#endif
#endif
#include "../include/JNetwork.h"
#include <sstream>
#include "../include/JSocket.h"
#include "../include/DebugRoutines.h"
map<string, JNetwork::CommandStruc> JNetwork::sCommandMap;

View File

@@ -19,6 +19,7 @@
#include <errno.h>
#endif
#include "../include/JGE.h"
#include "../include/JSocket.h"
JSocket::JSocket(){

View File

@@ -71,7 +71,7 @@ bool JSpline::Load(const char *filename, float xscale, float yscale)
element->QueryFloatAttribute("x", &xx);
element->QueryFloatAttribute("y", &yy);
Point pt(xx*xscale, yy*yscale);
JPoint pt(xx*xscale, yy*yscale);
AddControlPoint(pt);
}
@@ -84,7 +84,7 @@ bool JSpline::Load(const char *filename, float xscale, float yscale)
void JSpline::PointOnCurve(Point &out, float t, const Point &p0, const Point &p1, const Point &p2, const Point &p3)
void JSpline::PointOnCurve(JPoint &out, float t, const JPoint &p0, const JPoint &p1, const JPoint &p2, const JPoint &p3)
{
float t2 = t * t;
float t3 = t2 * t;
@@ -113,8 +113,8 @@ void JSpline::GeneratePixels()
x = mMidPoints[1].x;
y = mMidPoints[1].y;
Point newPt(x, y);
Point extraPt;
JPoint newPt(x, y);
JPoint extraPt;
mPixels.push_back(newPt);
@@ -151,13 +151,13 @@ void JSpline::GeneratePixels()
}
void JSpline::AddControlPoint(const Point &pt)
void JSpline::AddControlPoint(const JPoint &pt)
{
mMidPoints.push_back(pt);
}
void JSpline::GetControlPoint(Point &point, int index)
void JSpline::GetControlPoint(JPoint &point, int index)
{
if (index < (int)mMidPoints.size())
{
@@ -167,7 +167,7 @@ void JSpline::GetControlPoint(Point &point, int index)
}
void JSpline::GetPixel(Point &point, int index)
void JSpline::GetPixel(JPoint &point, int index)
{
if (index < (int)mPixels.size())
{

View File

@@ -5,7 +5,6 @@
#include "../include/JRenderer.h"
#include "../include/JGameLauncher.h"
#include "corewrapper.h"
#include "TestSuiteAI.h"
#include "GameOptions.h"
#include "MTGDeck.h"
@@ -13,18 +12,83 @@
#include <QCoreApplication>
#include <QElapsedTimer>
class WagicWrapper
{
public:
WagicWrapper();
virtual ~WagicWrapper();
public:
// used mainly to mesure the delta between 2 updates
static QElapsedTimer g_startTimer;
private:
JGE* m_engine;
JApp* m_app;
JGameLauncher* m_launcher;
};
QElapsedTimer WagicWrapper::g_startTimer;
int JGEGetTime()
{
return (int)WagicWrapper::g_startTimer.elapsed();
}
bool JGEToggleFullscreen()
{
return true;
}
void JGECreateDefaultBindings()
{
}
WagicWrapper::WagicWrapper()
{
m_launcher = new JGameLauncher();
u32 flags = m_launcher->GetInitFlags();
if ((flags&JINIT_FLAG_ENABLE3D)!=0)
{
JRenderer::Set3DFlag(true);
}
JGECreateDefaultBindings();
m_engine = JGE::GetInstance();
m_app = m_launcher->GetGameApp();
m_app->Create();
m_engine->SetApp(m_app);
JRenderer::GetInstance()->Enable2D();
g_startTimer.restart();
}
WagicWrapper::~WagicWrapper()
{
if(m_launcher)
{
delete m_launcher;
m_launcher = NULL;
}
if(m_engine)
m_engine->SetApp(NULL);
if (m_app)
{
m_app->Destroy();
delete m_app;
m_app = NULL;
}
JGE::Destroy();
m_engine = NULL;
}
int main(int argc, char* argv[])
{
QCoreApplication a(argc, argv);
int result = 0;
WagicCore* wagicCore = new WagicCore();
wagicCore->initApp();
WagicWrapper* wagicCore = new WagicWrapper();
MTGCollection()->loadFolder("sets/primitives/");
MTGCollection()->loadFolder("sets/", "_cards.dat");
options.reloadProfile();

View File

@@ -11,11 +11,35 @@
#endif //QT_WIDGET
#include "Downloader.h"
#include "GameApp.h"
#include "qtcorewrapper.h"
#include "corewrapper.h"
QtWagicCore* g_glwidget = NULL;
WagicCore* g_glwidget = NULL;
static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] =
{
{ Qt::Key_Enter, JGE_BTN_MENU },
{ Qt::Key_Return, JGE_BTN_MENU },
{ Qt::Key_Escape, JGE_BTN_MENU },
{ Qt::Key_Backspace, JGE_BTN_CTRL },
{ Qt::Key_Up, JGE_BTN_UP },
{ Qt::Key_Down, JGE_BTN_DOWN },
{ Qt::Key_Left, JGE_BTN_LEFT },
{ Qt::Key_Right, JGE_BTN_RIGHT },
{ Qt::Key_Space, JGE_BTN_OK },
{ Qt::Key_Tab, JGE_BTN_CANCEL },
{ Qt::Key_J, JGE_BTN_PRI },
{ Qt::Key_K, JGE_BTN_SEC },
{ Qt::Key_Q, JGE_BTN_PREV },
{ Qt::Key_A, JGE_BTN_NEXT },
// fullscreen management seems somehow broken in JGE, it works fine with Qt directly
// { Qt::Key_F, JGE_BTN_FULLSCREEN },
};
void JGECreateDefaultBindings()
{
for (signed int i = sizeof(gDefaultBindings)/sizeof(gDefaultBindings[0]) - 1; i >= 0; --i)
JGE::BindKey(gDefaultBindings[i].keysym, gDefaultBindings[i].keycode);
}
bool JGEToggleFullscreen()
{
@@ -30,6 +54,11 @@ bool JGEToggleFullscreen()
return true;
}
int JGEGetTime()
{
return (int)WagicCore::g_startTimer.elapsed();
}
int main(int argc, char* argv[])
{
QScopedPointer<QApplication> app
@@ -50,7 +79,7 @@ int main(int argc, char* argv[])
);
#endif
#ifdef QT_WIDGET
g_glwidget = new QtWagicCore();
g_glwidget = new WagicCore();
if(!downloadRequest || downloadRequest->getDownloadStatus() == DownloadRequest::DOWNLOADED)
{
g_glwidget->start(0);

View File

@@ -15,7 +15,6 @@
#include "../include/JRenderer.h"
#include "../include/JGameLauncher.h"
#include "DebugRoutines.h"
#include "corewrapper.h"
#include <stdexcept>
#include <iostream>
#include <math.h>
@@ -48,7 +47,9 @@ const int kTapEventTimeout = 250;
uint64_t lastTickCount;
JGE* g_engine = NULL;
JApp* g_app = NULL;
JGameLauncher* g_launcher = NULL;
#ifdef ANDROID
JNIEnv * mJNIEnv = NULL;
jclass * mJNIClass = NULL;
@@ -65,15 +66,19 @@ extern "C" void Java_org_libsdl_app_SDLActivity_nativePause(
JNIEnv* env, jclass cls)
{
DebugTrace("Attempt pause");
WagicCore::getInstance()->setActive(false);
DebugTrace("Pause done");
if (!g_engine)
return;
g_engine->Pause();
DebugTrace("Pause done");
}
// Resume
extern "C" void Java_org_libsdl_app_SDLActivity_nativeResume(
JNIEnv* env, jclass cls)
{
WagicCore::getInstance()->setActive(true);
if (!g_engine)
return;
g_engine->Resume();
}
#include "Wagic_Version.h"
@@ -97,6 +102,7 @@ public: /* For easy interfacing with JGE static functions */
bool Running;
SDL_Window* window;
SDL_Surface* Surf_Display;
SDL_Rect viewPort;
Uint32 lastMouseUpTime;
Uint32 lastFingerDownTime;
int windowed_w;
@@ -106,7 +112,6 @@ public: /* For easy interfacing with JGE static functions */
int mMouseDownX;
int mMouseDownY;
WagicCore m_Wagic;
public:
SdlApp() : Surf_Display(NULL), window(NULL), lastMouseUpTime(0), lastFingerDownTime(0), Running(true), mMouseDownX(0), mMouseDownY(0)
@@ -124,13 +129,16 @@ public:
while(Running)
{
for (int x = 0; x < 5 && SDL_WaitEventTimeout(&Event, 10); ++x)
if (g_engine)
{
if(m_Wagic.getActive())
OnEvent(&Event);
for (int x = 0; x < 5 && SDL_WaitEventTimeout(&Event, 10); ++x)
{
if(!g_engine->IsPaused())
OnEvent(&Event);
}
if(!g_engine->IsPaused())
OnUpdate();
}
if(m_Wagic.getActive())
OnUpdate();
}
OnCleanup();
@@ -143,7 +151,44 @@ public:
void OnResize(int width, int height)
{
m_Wagic.onWindowResize((void*)0, (float)width, (float)height);
DebugTrace("OnResize Width " << width << " height " << height);
if ((GLfloat)width / (GLfloat)height <= ACTUAL_RATIO)
{
viewPort.x = 0;
viewPort.y = -(static_cast<int>(width / ACTUAL_RATIO) - height) / 2;
viewPort.w = width;
viewPort.h = static_cast<int>(width / ACTUAL_RATIO);
}
else
{
viewPort.x = -(static_cast<int>(height * ACTUAL_RATIO) - width) / 2;
viewPort.y = 0;
viewPort.w = static_cast<int>(height * ACTUAL_RATIO);
viewPort.h = height;
}
glViewport(viewPort.x, viewPort.y, viewPort.w, viewPort.h);
JRenderer::GetInstance()->SetActualWidth(static_cast<float>(viewPort.w));
JRenderer::GetInstance()->SetActualHeight(static_cast<float>(viewPort.h));
glScissor(0, 0, width, height);
#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
glMatrixMode (GL_PROJECTION); // Select The Projection Matrix
glLoadIdentity (); // Reset The Projection Matrix
#if (defined GL_VERSION_ES_CM_1_1)
glOrthof(0.0f, (float) (viewPort.w)-1.0f, 0.0f, (float) (viewPort.h)-1.0f, -1.0f, 1.0f);
#else
gluOrtho2D(0.0f, (float) (viewPort.w)-1.0f, 0.0f, (float) (viewPort.h)-1.0f);
#endif
glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix
glLoadIdentity (); // Reset The Modelview Matrix
glDisable (GL_DEPTH_TEST);
#endif
}
void OnKeyPressed(const SDL_KeyboardEvent& event);
@@ -222,7 +267,7 @@ public:
case SDL_JOYBALLMOTION:
DebugTrace("Flick gesture detected, x: " << Event->jball.xrel << ", y: " << Event->jball.yrel);
m_Wagic.onWheelChanged(Event->jball.xrel, Event->jball.yrel);
g_engine->Scroll(Event->jball.xrel, Event->jball.yrel);
break;
}
}
@@ -236,6 +281,57 @@ public:
}
};
static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] =
{
/* windows controls */
{ SDLK_LCTRL, JGE_BTN_CTRL },
{ SDLK_RCTRL, JGE_BTN_CTRL },
{ SDLK_RETURN, JGE_BTN_MENU },
{ SDLK_KP_ENTER, JGE_BTN_MENU },
{ SDLK_ESCAPE, JGE_BTN_MENU },
{ SDLK_UP, JGE_BTN_UP },
{ SDLK_DOWN, JGE_BTN_DOWN },
{ SDLK_LEFT, JGE_BTN_LEFT },
{ SDLK_RIGHT, JGE_BTN_RIGHT },
{ SDLK_w, JGE_BTN_UP },
{ SDLK_s, JGE_BTN_DOWN },
{ SDLK_a, JGE_BTN_LEFT },
{ SDLK_d, JGE_BTN_RIGHT },
{ SDLK_q, JGE_BTN_PREV },
{ SDLK_e, JGE_BTN_NEXT },
{ SDLK_i, JGE_BTN_CANCEL },
{ SDLK_l, JGE_BTN_OK },
{ SDLK_SPACE, JGE_BTN_OK },
{ SDLK_k, JGE_BTN_SEC },
{ SDLK_j, JGE_BTN_PRI },
{ SDLK_b, JGE_BTN_SOUND },
{ SDLK_f, JGE_BTN_FULLSCREEN },
/* old Qt ones, basically modified to comply with the N900 keyboard
{ SDLK_a, JGE_BTN_NEXT },
{ SDLK_TAB, JGE_BTN_CANCEL },
{ SDLK_q, JGE_BTN_PREV },
{ SDLK_BACKSPACE, JGE_BTN_CTRL },
*/
/* Android customs */
{ SDLK_AC_BACK, JGE_BTN_MENU },
/* Android/maemo volume button mapping */
{ SDLK_VOLUMEUP, JGE_BTN_PREV },
{ SDLK_VOLUMEDOWN, JGE_BTN_SEC},
};
void JGECreateDefaultBindings()
{
for (signed int i = sizeof(gDefaultBindings)/sizeof(gDefaultBindings[0]) - 1; i >= 0; --i)
g_engine->BindKey(gDefaultBindings[i].keysym, gDefaultBindings[i].keycode);
}
int JGEGetTime()
{
return (int)SDL_GetTicks();
}
bool JGEToggleFullscreen()
{
//cycle between the display modes
@@ -283,11 +379,70 @@ bool JGEToggleFullscreen()
return true;
}
bool InitGame(void)
{
g_engine = JGE::GetInstance();
g_app = g_launcher->GetGameApp();
g_app->Create();
g_engine->SetApp(g_app);
#ifdef ANDROID
DebugTrace("Can I Set JNI Params ?");
if (mJNIEnv)
DebugTrace("mJNIEnv is ok");
if (mJNIEnv && mJNIClass)
{
DebugTrace("Setting JNI Params");
g_engine->SetJNIEnv(mJNIEnv, *mJNIClass);
}
#endif
JRenderer::GetInstance()->Enable2D();
lastTickCount = JGEGetTime();
return true;
}
void DestroyGame(void)
{
g_engine->SetApp(NULL);
if (g_app)
{
g_app->Destroy();
delete g_app;
g_app = NULL;
}
JGE::Destroy();
g_engine = NULL;
}
void SdlApp::OnUpdate()
{
Running = m_Wagic.onUpdate();
if(Running)
m_Wagic.onRender();
static int tickCount = 0;
tickCount = JGEGetTime();
int64_t dt = (tickCount - lastTickCount);
lastTickCount = tickCount;
if(g_engine->IsDone())
{
SDL_Event event;
event.user.type = SDL_QUIT;
SDL_PushEvent(&event);
}
try
{
g_engine->SetDelta((float)dt / 1000.0f);
g_engine->Update((float)dt / 1000.0f);
}
catch(out_of_range& oor)
{
cerr << oor.what();
}
if(g_engine)
g_engine->Render();
SDL_GL_SwapBuffers();
}
@@ -296,17 +451,28 @@ void SdlApp::OnKeyPressed(const SDL_KeyboardEvent& event)
{
if (event.type == SDL_KEYDOWN)
{
m_Wagic.onKeyDown((LocalKeySym)event.keysym.sym);
g_engine->HoldKey_NoRepeat((LocalKeySym)event.keysym.sym);
}
else if(event.type == SDL_KEYUP)
{
m_Wagic.onKeyUp((LocalKeySym)event.keysym.sym);
g_engine->ReleaseKey((LocalKeySym)event.keysym.sym);
}
}
void SdlApp::OnMouseMoved(const SDL_MouseMotionEvent& event)
{
m_Wagic.onPointerMoved(WagicCore::LEFT, event.x, event.y);
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
if (event.y >= viewPort.y &&
event.y <= viewPort.y + viewPort.h &&
event.x >= viewPort.x &&
event.x <= viewPort.x + viewPort.w)
{
g_engine->LeftClicked(
((event.x-viewPort.x)*SCREEN_WIDTH)/actualWidth,
((event.y-viewPort.y)*SCREEN_HEIGHT)/actualHeight);
}
}
void SdlApp::OnMouseDoubleClicked(const SDL_MouseButtonEvent& event)
@@ -314,16 +480,13 @@ void SdlApp::OnMouseDoubleClicked(const SDL_MouseButtonEvent& event)
#if (defined ANDROID) || (defined IOS)
if(event.button == SDL_BUTTON_LEFT) /* Left button */
{
m_Wagic.doOK();
g_engine->HoldKey_NoRepeat(JGE_BTN_OK);
}
#endif
}
void SdlApp::OnMouseWheel(int x, int y)
{
m_Wagic.onWheelChanged(x, y);
/*
if(!x && y)
{ // Vertical wheel
if(y > 0)
@@ -342,7 +505,7 @@ void SdlApp::OnMouseWheel(int x, int y)
else
{
g_engine->HoldKey_NoRepeat(JGE_BTN_RIGHT);
}*/
}
}
void SdlApp::OnMouseClicked(const SDL_MouseButtonEvent& event)
@@ -351,30 +514,70 @@ void SdlApp::OnMouseClicked(const SDL_MouseButtonEvent& event)
{
if (event.button == SDL_BUTTON_LEFT) /* Left button */
{
m_Wagic.onPointerPressed(WagicCore::LEFT, event.x, event.y);
// this is intended to convert window coordinate into game coordinate.
// this is correct only if the game and window have the same aspect ratio, otherwise, it's just wrong
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
if (event.y >= viewPort.y &&
event.y <= viewPort.y + viewPort.h &&
event.x >= viewPort.x &&
event.x <= viewPort.x + viewPort.w)
{
g_engine->LeftClicked(
((event.x-viewPort.x)*SCREEN_WIDTH)/actualWidth,
((event.y-viewPort.y)*SCREEN_HEIGHT)/actualHeight);
#if (!defined ANDROID) && (!defined IOS)
g_engine->HoldKey_NoRepeat(JGE_BTN_OK);
#endif
}
else if(event.y < viewPort.y)
{
g_engine->HoldKey_NoRepeat(JGE_BTN_MENU);
}
else if(event.y > viewPort.y + viewPort.h)
{
g_engine->HoldKey_NoRepeat(JGE_BTN_NEXT);
}
}
else if(event.button == SDL_BUTTON_RIGHT) /* Right button */
{
m_Wagic.onPointerPressed(WagicCore::RIGHT, event.x, event.y);
{ /* next phase please */
g_engine->HoldKey_NoRepeat(JGE_BTN_PREV);
}
else if(event.button == SDL_BUTTON_MIDDLE) /* Middle button */
{
m_Wagic.onPointerPressed(WagicCore::MIDLE, event.x, event.y);
{ /* interrupt please */
g_engine->HoldKey_NoRepeat(JGE_BTN_SEC);
}
}
else if (event.type == SDL_MOUSEBUTTONUP)
{
if(event.button == SDL_BUTTON_LEFT)
{
m_Wagic.onPointerReleased(WagicCore::LEFT, event.x, event.y);
if (event.y >= viewPort.y &&
event.y <= viewPort.y + viewPort.h &&
event.x >= viewPort.x &&
event.x <= viewPort.x + viewPort.w)
{
#if (!defined ANDROID) && (!defined IOS)
g_engine->ReleaseKey(JGE_BTN_OK);
#endif
}
else if(event.y < viewPort.y)
{
g_engine->ReleaseKey(JGE_BTN_MENU);
}
else if(event.y > viewPort.y + viewPort.h)
{
g_engine->ReleaseKey(JGE_BTN_NEXT);
}
}
else if(event.button == SDL_BUTTON_RIGHT)
{
m_Wagic.onPointerReleased(WagicCore::RIGHT, event.x, event.y);
{ /* next phase please */
g_engine->ReleaseKey(JGE_BTN_PREV);
}
else if(event.button == SDL_BUTTON_MIDDLE)
{
m_Wagic.onPointerReleased(WagicCore::MIDLE, event.x, event.y);
{ /* interrupt please */
g_engine->ReleaseKey(JGE_BTN_SEC);
}
}
}
@@ -385,18 +588,44 @@ void SdlApp::OnTouchEvent(const SDL_TouchFingerEvent& event)
// should be ignored, and will come through instead as a multigesture event
if (event.fingerId == 0)
{
if (event.type == SDL_FINGERDOWN)
if (event.y >= viewPort.y &&
event.y <= viewPort.y + viewPort.h &&
event.x >= viewPort.x &&
event.x <= viewPort.x + viewPort.w)
{
m_Wagic.onPointerPressed(WagicCore::LEFT, event.x, event.y);
}
else if (event.type == SDL_FINGERUP)
{
m_Wagic.onPointerReleased(WagicCore::LEFT, event.x, event.y);
}
else
{
m_Wagic.onPointerMoved(WagicCore::LEFT, event.x, event.y);
}
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
Uint32 eventTime = SDL_GetTicks();
if (event.type == SDL_FINGERDOWN)
{
mMouseDownX = event.x;
mMouseDownY = event.y;
lastFingerDownTime = eventTime;
}
#if (defined ANDROID) || (defined IOS)
if (event.type == SDL_FINGERUP)
{
if (eventTime - lastFingerDownTime <= kTapEventTimeout)
{
// treat an up finger within 50 pixels of the down finger coords as a double click event
if (abs(mMouseDownX - event.x) < kHitzonePliancy && abs(mMouseDownY - event.y) < kHitzonePliancy)
{
DebugTrace("Pressing OK BUtton");
g_engine->HoldKey_NoRepeat(JGE_BTN_OK);
}
}
}
else
#endif
g_engine->LeftClicked(
((event.x - viewPort.x) * SCREEN_WIDTH) / actualWidth,
((event.y - viewPort.y) * SCREEN_HEIGHT) / actualHeight);
}
}
}
@@ -449,9 +678,52 @@ bool SdlApp::OnInit()
#endif
return false;
}
SDL_WM_SetCaption(m_Wagic.GetName(), "");
SDL_WM_SetCaption(g_launcher->GetName(), "");
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background (yes that's the way fuckers)
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0)
#if (defined GL_ES_VERSION_2_0)
glClearDepthf(1.0f); // Depth Buffer Setup
#else
glClearDepth(1.0f); // Depth Buffer Setup
#endif// (defined GL_ES_VERSION_2_0)
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing (Less Or Equal)
glEnable(GL_DEPTH_TEST); // Enable Depth Testing
#else
#if (defined GL_VERSION_ES_CM_1_1)
glClearDepthf(1.0f); // Depth Buffer Setup
#else
glClearDepth(1.0f); // Depth Buffer Setup
#endif
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing (Less Or Equal)
glEnable(GL_DEPTH_TEST); // Enable Depth Testing
glShadeModel(GL_SMOOTH); // Select Smooth Shading
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Set Perspective Calculations To Most Accurate
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); // Set Line Antialiasing
glEnable(GL_LINE_SMOOTH); // Enable it!
glEnable(GL_TEXTURE_2D);
#endif
glEnable(GL_CULL_FACE); // do not calculate inside of poly's
glFrontFace(GL_CCW); // counter clock-wise polygons are out
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_SCISSOR_TEST); // Enable Clipping
JGECreateDefaultBindings();
if (!InitGame())
{
cerr << "Could not init the game\n";
return false;
}
m_Wagic.initApp();
OnResize(window_w, window_h);
return true;
@@ -474,12 +746,27 @@ int main(int argc, char* argv[])
DebugTrace("I R in da native");
g_launcher = new JGameLauncher();
u32 flags = g_launcher->GetInitFlags();
if ((flags&JINIT_FLAG_ENABLE3D)!=0)
{
JRenderer::Set3DFlag(true);
}
g_SdlApp = new SdlApp();
int result = g_SdlApp->OnExecute();
if (g_launcher)
delete g_launcher;
if(g_SdlApp)
delete g_SdlApp;
// Shutdown
DestroyGame();
return result;
}

View File

@@ -1,351 +0,0 @@
#include <wrl/client.h>
#include <memory>
#include <agile.h>
#include "corewrapper.h"
using namespace Windows::ApplicationModel;
using namespace Windows::ApplicationModel::Core;
using namespace Windows::ApplicationModel::Activation;
using namespace Windows::UI::Core;
using namespace Windows::System;
using namespace Windows::Foundation;
using namespace Windows::Graphics::Display;
// Helper class for basic timing.
ref class BasicTimer sealed
{
public:
// Initializes internal timer values.
BasicTimer()
{
if (!QueryPerformanceFrequency(&m_frequency))
{
throw ref new Platform::FailureException();
}
Reset();
}
// Reset the timer to initial values.
void Reset()
{
Update();
m_startTime = m_currentTime;
m_total = 0.0f;
m_delta = 1.0f / 60.0f;
}
// Update the timer's internal values.
void Update()
{
if (!QueryPerformanceCounter(&m_currentTime))
{
throw ref new Platform::FailureException();
}
m_total = static_cast<float>(
static_cast<double>(m_currentTime.QuadPart - m_startTime.QuadPart) /
static_cast<double>(m_frequency.QuadPart)
);
if (m_lastTime.QuadPart == m_startTime.QuadPart)
{
// If the timer was just reset, report a time delta equivalent to 60Hz frame time.
m_delta = 1.0f / 60.0f;
}
else
{
m_delta = static_cast<float>(
static_cast<double>(m_currentTime.QuadPart - m_lastTime.QuadPart) /
static_cast<double>(m_frequency.QuadPart)
);
}
m_lastTime = m_currentTime;
}
// Duration in seconds between the last call to Reset() and the last call to Update().
property float Total
{
float get() { return m_total; }
}
// Duration in seconds between the previous two calls to Update().
property float Delta
{
float get() { return m_delta; }
}
private:
LARGE_INTEGER m_frequency;
LARGE_INTEGER m_currentTime;
LARGE_INTEGER m_startTime;
LARGE_INTEGER m_lastTime;
float m_total;
float m_delta;
};
ref class WagicApp sealed : public Windows::ApplicationModel::Core::IFrameworkView
{
public:
WagicApp();
// IFrameworkView Methods.
virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
virtual void Load(Platform::String^ entryPoint);
virtual void Run();
virtual void Uninitialize();
protected:
// Event Handlers.
void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
void OnLogicalDpiChanged(Platform::Object^ sender);
void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
void OnResuming(Platform::Object^ sender, Platform::Object^ args);
void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
void OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
void OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
void OnPointerWheelChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
private:
WagicCore m_Wagic;
Platform::Agile<CoreWindow> m_window;
bool m_windowClosed;
bool m_windowVisible;
};
ref class WagicAppSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
{
public:
virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
};
WagicApp::WagicApp() :
m_windowClosed(false),
m_windowVisible(true)
{
}
void WagicApp::Initialize(CoreApplicationView^ applicationView)
{
applicationView->Activated +=
ref new TypedEventHandler<CoreApplicationView^, IActivatedEventArgs^>(this, &WagicApp::OnActivated);
CoreApplication::Suspending +=
ref new EventHandler<SuspendingEventArgs^>(this, &WagicApp::OnSuspending);
CoreApplication::Resuming +=
ref new EventHandler<Platform::Object^>(this, &WagicApp::OnResuming);
}
void WagicApp::SetWindow(CoreWindow^ window)
{
m_window = window;
window->VisibilityChanged +=
ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &WagicApp::OnVisibilityChanged);
window->Closed +=
ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &WagicApp::OnWindowClosed);
window->PointerPressed +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &WagicApp::OnPointerPressed);
window->PointerMoved +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &WagicApp::OnPointerMoved);
window->KeyDown +=
ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &WagicApp::OnKeyDown);
window->KeyDown +=
ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &WagicApp::OnKeyUp);
window->PointerWheelChanged +=
ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &WagicApp::OnPointerWheelChanged);
#if !(WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
window->PointerCursor = ref new CoreCursor(CoreCursorType::Arrow, 0);
window->SizeChanged +=
ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &WagicApp::OnWindowSizeChanged);
#endif
static const float dipsPerInch = 96.0f;
m_Wagic.initApp();
m_Wagic.onWindowResize(
(void*)window,
floor(window->Bounds.Width * DisplayProperties::LogicalDpi / dipsPerInch + 0.5f),
floor(window->Bounds.Height * DisplayProperties::LogicalDpi / dipsPerInch + 0.5f));
/*
window->VisibilityChanged +=
ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &App::OnVisibilityChanged);
window->Closed +=
ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &App::OnWindowClosed);
DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
DisplayInformation::DisplayContentsInvalidated +=
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnDisplayContentsInvalidated);
#if !(WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
window->SizeChanged +=
ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &App::OnWindowSizeChanged);
currentDisplayInformation->DpiChanged +=
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnDpiChanged);
currentDisplayInformation->OrientationChanged +=
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnOrientationChanged);
// Désactivez tout retour visuel du pointeur pour de meilleures performances tactiles.
// Ceci n'est pas pris en charge sur les applications Windows Phone.
auto pointerVisualizationSettings = PointerVisualizationSettings::GetForCurrentView();
pointerVisualizationSettings->IsContactFeedbackEnabled = false;
pointerVisualizationSettings->IsBarrelButtonFeedbackEnabled = false;
#endif
m_deviceResources->SetWindow(window);
*/
}
void WagicApp::Load(Platform::String^ entryPoint)
{
}
void WagicApp::Run()
{
BasicTimer^ timer = ref new BasicTimer();
while (!m_windowClosed)
{
if (m_windowVisible)
{
timer->Update();
CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
if(m_Wagic.onUpdate())
m_Wagic.onRender();
else
m_windowClosed = true;
}
else
{
CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
}
}
CoreApplication::Exit();
}
void WagicApp::Uninitialize()
{
}
void WagicApp::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args)
{
m_Wagic.onWindowResize((void*)sender, args->Size.Width, args->Size.Height);
}
void WagicApp::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args)
{
m_windowVisible = args->Visible;
}
void WagicApp::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
{
m_windowClosed = true;
}
void WagicApp::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args)
{
WagicCore::PointerId pointerId = WagicCore::LEFT;
if(args->CurrentPoint->Properties->IsLeftButtonPressed)
{
pointerId = WagicCore::LEFT;
}
else if (args->CurrentPoint->Properties->IsRightButtonPressed)
{
pointerId = WagicCore::RIGHT;
}
else if (args->CurrentPoint->Properties->IsMiddleButtonPressed)
{
pointerId = WagicCore::MIDLE;
}
m_Wagic.onPointerPressed(pointerId, (int)args->CurrentPoint->Position.X, (int)args->CurrentPoint->Position.Y);
}
void WagicApp::OnPointerMoved(CoreWindow^ sender, PointerEventArgs^ args)
{
m_Wagic.onPointerMoved(WagicCore::LEFT, (int)args->CurrentPoint->Position.X, (int)args->CurrentPoint->Position.Y);
}
void WagicApp::OnKeyDown(CoreWindow^ sender, KeyEventArgs^ args)
{
WPARAM param = (WPARAM) args->VirtualKey;
m_Wagic.onKeyDown(param);
m_Wagic.onUpdate();
}
void WagicApp::OnKeyUp(CoreWindow^ sender, KeyEventArgs^ args)
{
WPARAM param = (WPARAM) args->VirtualKey;
m_Wagic.onKeyUp(param);
}
void WagicApp::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ args)
{
if(args->CurrentPoint->Properties->IsHorizontalMouseWheel)
m_Wagic.onWheelChanged(3*args->CurrentPoint->Properties->MouseWheelDelta, 0);
else
m_Wagic.onWheelChanged(0, 3*args->CurrentPoint->Properties->MouseWheelDelta);
}
void WagicApp::OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args)
{
CoreWindow::GetForCurrentThread()->Activate();
}
void WagicApp::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args)
{
// Save app state asynchronously after requesting a deferral. Holding a deferral
// indicates that the application is busy performing suspending operations. Be
// aware that a deferral may not be held indefinitely. After about five seconds,
// the app will be forced to exit.
SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral();
}
void WagicApp::OnResuming(Platform::Object^ sender, Platform::Object^ args)
{
// Restore any data or state that was unloaded on suspend. By default, data
// and state are persisted when resuming from suspend. Note that this event
// does not occur if the app was previously terminated.
}
IFrameworkView^ WagicAppSource::CreateView()
{
return ref new WagicApp();
}
[Platform::MTAThread]
int main(Platform::Array<Platform::String^>^)
{
auto wagicAppSource = ref new WagicAppSource();
CoreApplication::Run(wagicAppSource);
return 0;
}
bool JGEToggleFullscreen()
{
return true;
}

View File

@@ -185,9 +185,9 @@ static const int doubleBufferAttributes[] = {
GLX_RED_SIZE, 1, /* the maximum number of bits per component */
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
None
0L /* None */
};
static Bool WaitForNotify(Display *dpy, XEvent *event, XPointer arg)
static int WaitForNotify(Display *dpy, XEvent *event, XPointer 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))
switch (event.type)
{
case KeyPress:
case 2: /* KeyPress */
{
const KeySym sym = XKeycodeToKeysym(gXDisplay, event.xkey.keycode, 1);
g_engine->HoldKey_NoRepeat(sym);
}
break;
case KeyRelease:
case 3: /* KeyRelease */
g_engine->ReleaseKey(XKeycodeToKeysym(gXDisplay, event.xkey.keycode, 1));
break;
case ConfigureNotify:

View File

@@ -1,377 +0,0 @@
#include "corewrapper.h"
#define ACTUAL_SCREEN_WIDTH (SCREEN_WIDTH)
#define ACTUAL_SCREEN_HEIGHT (SCREEN_HEIGHT)
#define ACTUAL_RATIO ((float)ACTUAL_SCREEN_WIDTH / (float)ACTUAL_SCREEN_HEIGHT)
// in pixels
#define kHitzonePliancy 50
// tick value equates to ms
#define kTapEventTimeout 250
// swipe duration
#define kSwipeEventMinDuration 250
// swipe distance in pixel (from top to down)
#define kSwipeMinDistance 200
WagicCore* WagicCore::s_instance = 0;
WagicCore::WagicCore() :
m_engine(0), m_app(0), m_launcher(0), m_active(false)
{
#ifdef QT_CONFIG
startTime = QTime::currentTime();
#endif //QT_CONFIG
s_instance = this;
m_lastTickCount = JGEGetTime();
}
void WagicCore::initApp()
{
if(!m_engine)
{
m_launcher = new JGameLauncher();
u32 flags = m_launcher->GetInitFlags();
if ((flags&JINIT_FLAG_ENABLE3D)!=0)
{
JRenderer::Set3DFlag(true);
}
JGECreateDefaultBindings();
m_engine = JGE::GetInstance();
m_app = m_launcher->GetGameApp();
m_app->Create();
m_engine->SetApp(m_app);
JRenderer::GetInstance()->Enable2D();
setActive(true);
}
}
WagicCore::~WagicCore()
{
if(m_launcher)
{
delete m_launcher;
m_launcher = NULL;
}
if(m_engine)
m_engine->SetApp(NULL);
if (m_app)
{
m_app->Destroy();
delete m_app;
m_app = NULL;
}
JGE::Destroy();
m_engine = NULL;
}
bool WagicCore::onUpdate()
{
bool result = false;
int64_t tickCount;
int64_t dt;
tickCount = JGEGetTime();
dt = (tickCount - m_lastTickCount);
m_lastTickCount = tickCount;
if(m_engine && !m_engine->IsDone())
{
m_engine->SetDelta((float)dt / 1000.0f);
m_engine->Update((float)dt / 1000.0f);
done();
result = true;
}
return result;
}
void WagicCore::setActive(bool active)
{
if(!m_engine) return;
if(!m_active && active)
{
m_engine->Resume();
m_active = active;
}
else if(m_active && !active)
{
m_engine->Pause();
m_active = active;
}
}
bool WagicCore::onRender()
{
bool result = false;
if(m_engine)
{
m_engine->Render();
result = true;
}
return result;
}
void WagicCore::onWindowResize(void* window, float width, float height)
{
float left, top, right, bottom;
if ((float)width / (float)height <= ACTUAL_RATIO)
{
left = 0;
top = (float)(-((width/ACTUAL_RATIO)-height)/2);
right = width;
bottom = (-((width/ACTUAL_RATIO)-height)/2 + width / ACTUAL_RATIO);
}
else
{
left = (-(height*ACTUAL_RATIO-width)/2);
top = (0);
right = (-(height*ACTUAL_RATIO-width)/2 + height * ACTUAL_RATIO);
bottom = height;
}
JRenderer::GetInstance()->SetViewPort(left, top, right, bottom);
JRenderer::GetInstance()->OnWindowsSizeChanged(window, width, height);
}
void WagicCore::onKeyDown(LocalKeySym key)
{
m_engine->HoldKey_NoRepeat(key);
}
void WagicCore::onKeyUp(LocalKeySym key)
{
m_engine->ReleaseKey(key);
}
void WagicCore::onWheelChanged(int deltaX, int deltaY)
{
m_engine->Scroll(deltaX, deltaY);
}
bool WagicCore::onPointerPressed(WagicCore::PointerId pointer, int x, int y)
{
bool result = false;
float left, top, right, bottom;
if(pointer == LEFT)
{
// this is intended to convert window coordinate into game coordinate.
// this is correct only if the game and window have the same aspect ratio, otherwise, it's just wrong
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
JRenderer::GetInstance()->GetViewPort(left, top, right, bottom);
if ( y >= top &&
y <= bottom &&
x <= right &&
x >= left) {
m_engine->LeftClicked(
(int)((x-left)*SCREEN_WIDTH)/actualWidth,
(int)((y-top)*SCREEN_HEIGHT)/actualHeight);
#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN) && (!defined ANDROID) && (!defined IOS)
m_engine->HoldKey_NoRepeat(JGE_BTN_OK);
#else
mMouseDownX = x;
mMouseDownY = y;
mLastFingerDownTime = JGEGetTime();
#endif
result = true;
} else if(y<top) {
m_engine->HoldKey_NoRepeat(JGE_BTN_MENU);
result = true;
} else if(y>bottom) {
m_engine->HoldKey_NoRepeat(JGE_BTN_NEXT);
result = true;
}
}
else if(pointer == RIGHT)
{ /* next phase please */
m_engine->HoldKey_NoRepeat(JGE_BTN_PREV);
result = true;
}
else if(pointer == MIDLE)
{ /* interrupt please */
m_engine->HoldKey_NoRepeat(JGE_BTN_SEC);
result = true;
}
return result;
}
bool WagicCore::onPointerReleased(WagicCore::PointerId pointer, int x, int y)
{
bool result = false;
float left, top, right, bottom;
JRenderer::GetInstance()->GetViewPort(left, top, right, bottom);
if(pointer == LEFT)
{
if (y >= top &&
y <= bottom &&
x <= right &&
x >= left) {
#if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined ANDROID) || (defined IOS)
if(JGEGetTime() - mLastFingerDownTime <= kTapEventTimeout )
{
if(abs(mMouseDownX - x) < kHitzonePliancy &&
abs(mMouseDownY - y) < kHitzonePliancy)
{
m_engine->HoldKey_NoRepeat(JGE_BTN_OK);
}
}
else if (JGEGetTime() - mLastFingerDownTime >= kSwipeEventMinDuration)
{ // Let's swipe
m_engine->Scroll(x-mMouseDownX, y-mMouseDownY);
}
#else
m_engine->ReleaseKey(JGE_BTN_OK);
#endif
m_engine->ReleaseKey(JGE_BTN_MENU);
} else if(y < top) {
m_engine->ReleaseKey(JGE_BTN_MENU);
} else if(y > bottom) {
m_engine->ReleaseKey(JGE_BTN_NEXT);
}
result = true;
}
else if(pointer == RIGHT)
{ /* next phase please */
m_engine->ReleaseKey(JGE_BTN_PREV);
result = true;
}
else if(pointer == MIDLE)
{ /* interrupt please */
m_engine->ReleaseKey(JGE_BTN_SEC);
result = true;
}
return result;
}
bool WagicCore::onPointerMoved(WagicCore::PointerId pointer, int x, int y)
{
bool result = false;
float left, top, right, bottom;
JRenderer::GetInstance()->GetViewPort(left, top, right, bottom);
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
if (y >= top &&
y <= bottom &&
x <= right &&
x >= left) {
m_engine->LeftClicked(
(int)((x-left)*SCREEN_WIDTH)/actualWidth,
(int)((y-top)*SCREEN_HEIGHT)/actualHeight);
result = true;
}
return result;
}
static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] =
#ifdef SDL_CONFIG
{
/* windows controls */
{ SDLK_LCTRL, JGE_BTN_CTRL },
{ SDLK_RCTRL, JGE_BTN_CTRL },
{ SDLK_RETURN, JGE_BTN_MENU },
{ SDLK_KP_ENTER, JGE_BTN_MENU },
{ SDLK_ESCAPE, JGE_BTN_MENU },
{ SDLK_UP, JGE_BTN_UP },
{ SDLK_DOWN, JGE_BTN_DOWN },
{ SDLK_LEFT, JGE_BTN_LEFT },
{ SDLK_RIGHT, JGE_BTN_RIGHT },
{ SDLK_z, JGE_BTN_UP },
{ SDLK_d, JGE_BTN_RIGHT },
{ SDLK_s, JGE_BTN_DOWN },
{ SDLK_q, JGE_BTN_LEFT },
{ SDLK_a, JGE_BTN_PREV },
{ SDLK_e, JGE_BTN_NEXT },
{ SDLK_i, JGE_BTN_CANCEL },
{ SDLK_l, JGE_BTN_OK },
{ SDLK_SPACE, JGE_BTN_OK },
{ SDLK_k, JGE_BTN_SEC },
{ SDLK_j, JGE_BTN_PRI },
{ SDLK_f, JGE_BTN_FULLSCREEN },
/* Android customs */
{ SDLK_AC_BACK, JGE_BTN_MENU },
/* Android/maemo volume button mapping */
{ SDLK_VOLUMEUP, JGE_BTN_PREV },
{ SDLK_VOLUMEDOWN, JGE_BTN_SEC},
};
#elif defined QT_CONFIG
{
{ Qt::Key_Enter, JGE_BTN_MENU },
{ Qt::Key_Return, JGE_BTN_MENU },
{ Qt::Key_Escape, JGE_BTN_MENU },
{ Qt::Key_Backspace, JGE_BTN_CTRL },
{ Qt::Key_Up, JGE_BTN_UP },
{ Qt::Key_Down, JGE_BTN_DOWN },
{ Qt::Key_Left, JGE_BTN_LEFT },
{ Qt::Key_Right, JGE_BTN_RIGHT },
{ Qt::Key_Space, JGE_BTN_OK },
{ Qt::Key_Tab, JGE_BTN_CANCEL },
{ Qt::Key_J, JGE_BTN_PRI },
{ Qt::Key_K, JGE_BTN_SEC },
{ Qt::Key_Q, JGE_BTN_PREV },
{ Qt::Key_A, JGE_BTN_NEXT },
// fullscreen management seems somehow broken in JGE, it works fine with Qt directly
// { Qt::Key_F, JGE_BTN_FULLSCREEN },
};
#else
{
{ VK_CONTROL, JGE_BTN_CTRL },
{ VK_RETURN, JGE_BTN_MENU },
{ VK_ESCAPE, JGE_BTN_MENU },
{ VK_UP, JGE_BTN_UP },
{ VK_RIGHT, JGE_BTN_RIGHT },
{ VK_DOWN, JGE_BTN_DOWN },
{ VK_LEFT, JGE_BTN_LEFT },
{ 'Z', JGE_BTN_UP },
{ 'D', JGE_BTN_RIGHT },
{ 'S', JGE_BTN_DOWN },
{ 'Q', JGE_BTN_LEFT },
{ 'A', JGE_BTN_PREV },
{ 'E', JGE_BTN_NEXT },
{ 'I', JGE_BTN_CANCEL },
{ 'L', JGE_BTN_OK },
{ VK_SPACE, JGE_BTN_OK },
{ 'K', JGE_BTN_SEC },
{ 'J', JGE_BTN_PRI },
{ 'F', JGE_BTN_FULLSCREEN },
};
#endif
void WagicCore::registerDefaultBindings()
{
for (signed int i = sizeof(gDefaultBindings)/sizeof(gDefaultBindings[0]) - 1; i >= 0; --i)
m_engine->BindKey(gDefaultBindings[i].keysym, gDefaultBindings[i].keycode);
}
void JGECreateDefaultBindings()
{
WagicCore::getInstance()->registerDefaultBindings();
}
int JGEGetTime()
{
#ifdef SDL_CONFIG
return (int)SDL_GetTicks();
#elif defined QT_CONFIG
return WagicCore::s_instance->startTime.msecsTo(QTime::currentTime());
#elif defined WP8
return (int)GetTickCount64();
#endif
}

View File

@@ -96,7 +96,8 @@ hgeParticleSystem::hgeParticleSystem(hgeParticleSystemInfo *psi)
{
//hge=hgeCreate(HGE_VERSION);
memcpy(&info, psi, sizeof(hgeParticleSystemInfo));
if (psi)
memcpy(&info, psi, sizeof(hgeParticleSystemInfo));
vecLocation.x=vecPrevLocation.x=0.0f;
vecLocation.y=vecPrevLocation.y=0.0f;

View File

@@ -10,5 +10,6 @@ void resumeGame();
@property (nonatomic, retain) id eaglView;
@property (nonatomic, retain) UITextField *inputField;
@property (nonatomic, assign) BOOL bannerIsVisible;
- (void)toggleKeyboardWithState: (NSString *) initialText;
@end

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