Commit Graph

153 Commits

Author SHA1 Message Date
omegablast2002@yahoo.com
2fa626b80e adding more strings to translation 2013-01-05 00:38:12 +00:00
omegablast2002@yahoo.com
a3848e06f4 fix for that stupid bug where cards get added randomly while quickly going through your collection by pressing cards quickly.
basically if the last tap was less then .05 don't automatically register it as "addremovecard".
2012-04-07 14:13:00 +00:00
wagic.the.homebrew
3ba22cd615 Changes to Deck Editor:
- Removed one "stats" button as well as the "menu" button. The goal is to let the screen "breathe" and show cards as much as possible.
-- Removing the "menu" button is also in line with all other screens of the game, where that button never appears.
- With the same goal, the "XXX of XXX cards" text is now displayed only when scrolling
2012-03-21 14:41:38 +00:00
omegablast2002@yahoo.com
97bd418aac in this commit, if we move a card from the library to the library then we were intending on placing that card on top of the library.
taught ai when not to play a planeswalker, told ai to look for planeswalkers as a card type to play.
fixed a crash related to tokens and cardgui..tokens dont have models....
made a 1 line change to deckveiwer that makes it usable on touch devices and improves the overall look and feel of deckveiwer....
2012-03-13 16:20:19 +00:00
techdragon.nguyen@gmail.com
fc08b2cfa3 modified buttons for touch interfaces. The help screen has been modified to have all PSP button information removed. The layout of the buttons have been moved as has the size of the buttons. 2012-02-23 16:24:06 +00:00
rodrigodemoura@gmail.com
45b4272c5e Include the Phyrexian mana display. Include more features in modrules.xml: Now is possible to change font color, Size. Include icon tag. Is possible select position to show the icon, size and where the image is stored
<item name="icon">
 <position x="0" y="25"/>
 <iconposition x="1" y="2"/> 
 <filename>menuicons.png</filename> 
 <sizeicon>5<sizeicon>
</item>
Issue: 663
2012-02-13 15:28:55 +00:00
techdragon.nguyen@gmail.com
2eec7f9a6d fixed calculation for magnitude. cut and paste error.. 2012-02-05 03:25:59 +00:00
Xawotihs@gmail.com
8e8a0d6eeb - Removed useless filter swiping interface
- Removed pointless #ifdef IOS ... it was perfectly OK before the IOS code. Basically if you don't understand the code AND if you cannot test it, you should not modify it =(
- Readded a gard against short horizontal swipe. There were removed cause there are some gards in the iOS frontend ...
- Note that all this code use non-normalized coordinates, so something should be done in this sense in the frontends...
2012-02-04 23:25:58 +00:00
techdragon.nguyen@gmail.com
fb43b9012b sync swipe motion in deck viewer act accordingly to a swipe/pan on corresponding platform (iOS vs everything else) 2012-01-30 10:23:40 +00:00
techdragon.nguyen@gmail.com
b44f3088c2 refined button placement
added SDL_CONFIG to list of conditions in which ot enable touch buttons
2012-01-30 09:23:56 +00:00
techdragon.nguyen@gmail.com
969e6ac5e6 added more buttons to deck editor to cover all the functionality. Need to remove the PSP directions from the slide-in menus 2012-01-30 04:23:11 +00:00
techdragon.nguyen@gmail.com
9faf2ffc72 reverted changes to the Scroll/OnScroll method signatures. 2012-01-27 23:47:02 +00:00
techdragon.nguyen@gmail.com
85451f69ee vs 2010 update for deck editor changes as well as SDL update 2012-01-26 14:54:07 +00:00
techdragon.nguyen@gmail.com
a2179017d4 Extended Scroll() and OnScroll() to also take in magnitude as one of its parameters. magnitude is currently used in the deck editor to figure out how many cards to rotate around per swipe as function of velocity and the number of cards displayed on the screen.
fixed a compiler warning in SimplePopup in the constructor declaration
===DECK Editor changes ===
Added two touch buttons , one for "Sell Card", the other to switch between Deck and Collection.
changed swipe Left/Right to rotate card collection; removing the previous action which was to swap between deck/collection viewing

Note: GameStateDeckViewer isn't a JGuiController so can't leverage off the mButtons vector.  Thus, the buttons have to be handled by this class separately. (setButtonState, userPressedButton)
2012-01-26 13:53:03 +00:00
techdragon.nguyen@gmail.com
b03449cbf6 Implemented directional controls on Filters so that you can now navigate the Filters menu on Touch interfaces for the Deck Editor and Shop screens. It's not the best implementation but it at least works across all platforms. swipe will now move the highlighted cursor to the correct direction.
in release builds, test suite will now be disabled
2012-01-03 17:53:51 +00:00
wagic.the.homebrew
c9fd53808f - fix compilation issue on psp
- attempt at reducing loading times on the PSP: I merged a few graphics files together, removed some unused calls from the initialization functions, and moved some other ones to have a more lazy approach. The PSP version remains fairly slow in some parts (especially loading, but also entering the shop, or starting a new game), so I will try to reduce file access as much as possible in the days to come. Not a release blocker IMO though, but I4d sure love if it were faster.
- uppercased "Track1.mp3" to be in line with the actual filename. Most likely this had been broken forever on case-sensitive OSes
- I removed costly calls from the textscroller. I believe it wasn't very useful in its previous state. Now it's only "advertising" for unlockable stuff, which I think is ok (and allows to refresh it every time the menu is loaded)
- As a counterpart, added a "% complete" progress bar in the menu, something I wanted to add a while ago.
2011-12-11 13:48:24 +00:00
wagic.the.homebrew
69a0323c86 - Added cache for the count of AI decks, to reduce file access especially on victory screen. This fixes some massive lags on the PSP when winning a game
- bumped version number to 0.17
- removed some dead code in utils.h
2011-12-07 14:34:59 +00:00
Xawotihs
f68c106e7e - Modified gameObserver and related classes to be able to work with a precise JGE instance given at construction and not the static global one. That allows to run gameObserver without JGE instance (for example in a worker thread).
- Added an "ACTION_LOGGING_TESTING" mode in the gameObserver. When this is defined, the game reloads itself in every update. I want to use that to track undo problems. Be aware that it kills performances and crashes with the testsuite if you want to activate it.
- Various cleanup/refactor of the game observer.
- Added a gameObserver == operator to compare two games
- Added player mode to the player serialization
- Added a multi-threaded mode to AI_CHANGE_TESTING. For the moment it's only useable with Qt. If you want to use it without, just defined a thread_count higher than 1.
- Refactored random generator class to use list intead of queue
- Defined a specific type for interrupt decision instead of int
2011-11-13 22:36:34 +00:00
rodrigodemoura@gmail.com
e6b199f599 Modifications to make the game more generic.
Included in a new modrules.xml tags.
 <cardgui>
   <background> Stores information concerning the colors </ background>
   <renderbig> Stores information to draw the card </ renderbig>
  <rendertinycrop> Stores information to draw the card </ rendertinycrop>
 </ cardgui>

 Change the variables array for vectors
2011-10-13 12:25:58 +00:00
Xawotihs
b2c5df2cd3 Modified the touch/mouse management in the editor to simply select the touched card. I also added a binding to switch between deck and collection with an horizontal swipe. 2011-09-05 22:04:10 +00:00
wagic.the.homebrew
33691d1f13 - Added ads support for Android
- basic "message" system between JGE and java through jni 
- Fixed pause/resume on android/sdl
2011-09-04 02:45:18 +00:00
wagic.the.homebrew
e27cf56fa2 - Support for Zip Filesystem. It is now possible to zip the entire Res folder ("store" method preferred, zip so that the root of the zip has ai, player, etc...) in one single file for read only. Write access is done in another folder (hardcoded to be User/ for now, can be updated depending on platforms, etc...
-- zipFS has several limitations...
--- in a general way, seekg doesn't work... so getting a file's size needs to be done through JFileSystem.
--- getLine on files open with zipFS doesn't work so great. Not sure if it is a normal issue because files are open in binary or not... JFileSystem therefore offers a "readIntoString" function that needs to be used instead of the usual "getline" technique. However getLine can then be used on a stream connected to the string.

-- tested on Windows and PSP, I also made sure android still works, but haven't tested zip support on Android.
-- I tried to maintain backwards compatibility, but this might break on some platforms, if I broke some platforms and you can't find a way to fix them, please contact me and we'll figure something out
-- This removes wagic::ifstream. I didn't reimplement the securities that were involved in this, apologies for that. Might be useful to reimplement such securities in JFileSystem
-- I haven't tested options/profiles in a deep way, it is possible I broke that.
2011-08-21 09:04:59 +00:00
wrenczes@gmail.com
463a64521f Switched another case of the psp icons to (explicitly) use the managed cache. 2011-07-07 08:26:01 +00:00
wrenczes@gmail.com
741f662bb0 Tied in my recent Android flick gesture addition to a Scroll() function. GameState now has a virtual function OnScroll() call that, by default is a no-op; each game state can choose to override how to respond to flick gestures. I've added one such override in the Deck Editor so that a flick up/down acts like the psp button up/down for scrolling between color filters. 2011-06-15 09:52:11 +00:00
wrenczes@gmail.com
90b1058ad5 More warning cleanup (type to type conversion warnings). 2011-06-02 06:14:28 +00:00
wrenczes@gmail.com
56ab3ac5cf Minor code cleanup: removed a path to fetch thumbnails in the non-threaded code - at this point, it's trying to draw in text mode, so this shouldn't be here (it was always stepped over because of the options flag, so it was never executing anyway). 2011-04-25 05:26:46 +00:00
wrenczes@gmail.com
aaa169f86c Consolidated some loose strings into constant declarations in order to reduce allocation thrashing on temporary string constructs. I'm sure there are more, but "back_thumb", "back", and "backdrop.jpg" were the ones that showed up most in memory profiling. 2011-04-21 22:48:22 +00:00
wagic.the.homebrew
6f5919ed06 Reverting r3496 to fix failing tests 2011-04-21 15:16:22 +00:00
techdragon.nguyen@gmail.com
8bf983e2e5 Flagged numerous peices of code that have local variables that are masking either member variables or variables scoped outside the current scope.
I've marked all the ones I found with the following TODO comment:

TODO: C6246: <blah blah>

a few in particular are the ones related to "oneShot" and "_target".  These are local variables that are declared that
mask either a method parameter or a member variable.
2011-04-21 10:04:32 +00:00
wrenczes@gmail.com
7a10993114 *POSSIBLY DESTABLIZING CHANGE, PLS PING ME IF YOU SEE ISSUES*
Turned on the threaded card fetching code for win/linux.  PSP runs unthreaded.   There's an easy toggle for switching which mode the app runs in: check out WResourceManager's constructor.

To fully appreciate the difference, try going into the deck editor without these changes, and use the arrow keys to navigate around (esp. up/down, as it loads 7 cards at a time).  Then try again with these mods, you'll see the cards flicker briefly to the back card image and then load as they scroll onto the screen.
2011-04-19 07:12:05 +00:00
wagic.the.homebrew@gmail.com
e867881e16 - Fix issue 552 (Card images too big in deck editor)
- Moved big picture display a bit down ingame
- Temporarily Reinstantiated "back quad shows first" in deck editor, see my comments in http://code.google.com/p/wagic/source/detail?r=3008
-- This is only temporary, and pending the final Thread work, but I'm afraid this won't make it to 0.15. It is possible to get the previous behavior back with a simple define, in case we want it for windows.
2011-04-03 06:07:23 +00:00
techdragon.nguyen@gmail.com
1b5a379387 added empty string check when save and quiting from the deck editor.
Issue: 3052
2011-02-08 06:30:18 +00:00
Xawotihs
b7b584113b - Moved the card collection out of the GameApp class to clean up the dependencies
- Added method to build a card collection independently of the GUI to ease my unitary test application
- Added part of some network GUI I'm working on, it's #ifdef out, I'm only committing this part to ease later merges
- Added the beginning of a serialization code of the Player and related classes used for network support
- various other minor cleanup
2011-02-06 11:35:40 +00:00
techdragon.nguyen@gmail.com
91a2cb9c90 fixed deck renaming to make changes immediate. 2011-02-05 22:21:49 +00:00
wrenczes@gmail.com
76cba56a1c Resuming on my threading support work with the card caching mechanism. This change unfortunately touches quite a few files, but I needed to get it out of the way before things got out of hand: one significant hurdle is the assumed lifetime of a JQuad pointer. In a single threaded model, the life time of the pointer is clear: you fetch it into the cache, the cache makes room, you use the pointer immediately. In a multithreaded context however, it's unsafe, as the drawing thread can request a few JQuads, and the cache operating on a separate thread can potentially bounce a JQuad out of the cache before the draw routine is done using it, which ends up in an access violation when you attempt to draw using an invalidated quad pointer. To prevent this, the bulk of this change swaps out the use of naked JQuad* pointers in the code with a JQuadPtr, which is basically a typedef to a boost shared_ptr<JQuad>.
This btw points out another circular dependancy between the texture and the JQuad - a texture owns a bunch of JQuads, yet the renderer uses JQuads and always assumes that the texture is valid.  We're going to need to add more defensiveness to JGE to protect against this.

Other changes in this check-in:  WResourceManager doesn't derive from JResourceManager anymore.  It actually didn't require anything from the base, so I killed the dependency.  Also cleaned up the notion of a WTrackedQuad in the WCachedResource - it didn't need a separate class, just a better container.

I've build this & tested against PSP, win, linux, QT (linux).  I haven't tried against iOS and QT Win, or Maemo.  If these other platforms are broken, I apologize in advance! - I'm hoping it should be fairly simple to put them back into play.
2011-02-01 10:37:21 +00:00
wrenczes@gmail.com
6675a7da31 Implemented a lazy load pattern for the deck stats - when the DeckMenu is displaying decks, it calls LoadStats() for only the ones visible in the list. This helps reduces the lag that occurs each time we attempt to load all the AI decks during match selection.
This still could be improved - DeckMetaData's constructor loads an MTGDeck object to parse out the name of a deck from its file.  This means that we crack open 106 files on the first attempt to show the list of opponent decks. I started optimizing this, but reverted, as the list itself is sorted alphabetically.  Currently, with these mods, it's still taking 4 1/2 seconds on my psp to load the opponent list on the first go around.

While at it, did some cleanup - removed the need for passing around a player pointer in some of the DeckStat functions, etc.
2011-01-30 13:06:21 +00:00
wrenczes@gmail.com
3187487987 Minor tweaks to Mike's map of maps cache work on stats. Mostly these changes are stylistic changes that favor more terse code, but there was one bug where a double-delete was happening - GameStateDeckViewer used to allocate its own StatsWrapper, and deleted it as part of teardown - now that the allocation is owned by the deck stats instance, it's not allowed to do the deletion anymore.
I'll also note that the mods I did to getDeckMetaDataById() are completely unnecessary - pragmatically speaking, it's doing the same thing.  The only difference is that I'm using std::find_if instead of brute iterator manipulation, and I'm using a predicate function.  For a simple check like this, it's kind of pointless, but if you need to do more complex comparisons, predicate operators can become quite powerful.
2011-01-28 10:21:23 +00:00
wrenczes@gmail.com
32cabc15c2 Forcing LF as the line ending style through SVN properties. No actual code changes here. 2011-01-28 06:00:51 +00:00
techdragon.nguyen@gmail.com
ce7745bfa6 First attempt to reduce load time of player deck selection screens.
This change makes use of caching the DeckStats and DeckStatsWrappers into singleton caches that
get flushed when you quit the game.  The initial load time will be significant as lazy loading has not
been coded yet for the ai decks.

TODO: lazy load the player and ai decks as they appear on the screen.  Currently, each screen loads
all decks.
2011-01-27 16:13:40 +00:00
techdragon.nguyen@gmail.com
1be97b76f8 code cleanup. No code changes
- removed unused variables
- added line breaks between methods (not everywhere just where i saw it while removing unused variables)
2011-01-16 07:49:34 +00:00
techdragon.nguyen@gmail.com
afdeae6901 fixed some formatting issues.
changed conditional for lord and thises evaluation from hardcoded value to length of the array being evaluated.  This doesn't change current functionality, but minimizes code change if these arrays were ever to change in size.
2010-12-16 12:53:48 +00:00
wrenczes@gmail.com
65e38b0694 Another change that looks bigger than it is: changed out the global extern WResourceManager to a real singleton. This means that it's no longer being init'ed at static initialization time, and we can debug construction/destruction properly; it's also safer in a multithreaded context. 2010-12-01 08:22:17 +00:00
techdragon.nguyen@gmail.com
b46112dfcd reverting change made in r2701
The conditions on which to "updateStats" during the rebuilding of filters needed to be updated.  stw is NULL
when rebuilding the filters due to a "UNLOCK CARDS" action.  Thus the call to stw->updateStats throws a NPE.
stw is not null only when a deck has been selected to edit.  Otherwise, it makes no sense to actually update the
stats of a non-selected deck.
2010-11-29 11:50:12 +00:00
Xawotihs
fcd2f61c39 Fixed psp warning 2010-11-21 08:51:05 +00:00
Xawotihs
2b6469e391 Mouse support in deck editor 2010-11-20 21:30:15 +00:00
techdragon.nguyen@gmail.com
f684795810 refactored menu classes
fixed some layout issues with detailed info popup
changed requirements for detailed info popup button to be determined by the number of wins aginst AI deck instead of just the number of games.
2010-11-19 04:19:03 +00:00
techdragon.nguyen@gmail.com
4aaa93439a code clean up. removed unneeded methods for stats generation
synced stats info for mana curve on detailed display on deck selection screen so only up to
   Constants::STATS_MAX_MANA_COST+1 is used instead of the currently hard coded 15.
2010-11-19 03:18:48 +00:00
techdragon.nguyen@gmail.com
2a8f8074e6 New descriptive text popup feature for deck selection
http://wololo.net/forum/viewtopic.php?f=13&t=2423
2010-11-18 15:48:48 +00:00
techdragon.nguyen@gmail.com
acd7bb1aa4 reformatting code according to guidelines defined at
http://wololo.net/forum/viewtopic.php?f=35&t=2235&start=10
2010-11-16 00:55:16 +00:00
wrenczes@gmail.com
27fd107208 1st step in refactoring some of the card rendering logic - currently, each 'client' has duplicated code having to deal with how to render the full card graphic vs text mode vs using a 'back' image if a card isn't found. This is a first pass at consolidating some of that logic to one location - the ultimate goal being, eventually, the resource cache will actually own the notion of whether it's handing out a real card image or a default filler if the card isn't available, and the client code rendering the card should be oblivious.
In this change, I made the CardGui's RenderBig() and AlternateRender() functions protected; anyone wanting to render a card simply calls RenderCard(), and the card drawing mode is passed along as a param.
2010-11-14 08:15:26 +00:00