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)
- 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.
- 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
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
-- 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.
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.
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.
- 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.
- 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
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.
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.
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.
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.
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.
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.
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.
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.
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.
- Added a possibility to put a file "Res.txt" instead of the folder "Res". The file Res.txt is a simple 1 line text file, telling where to find the Res folder, terminated by "/". For example: "../../wagic_res".
This addresses issue 428 . This could also help us in the future, to develop mods.
please copy "DeckEditorMenuBackdrop.png" into your PSP folder. Otherwise you will have a crash when you start up!
ChangesLog:
minor refactoring of DeckMenu
added a new DeckEditorMenu which is derived from DeckMenu. This customizes the deck editor menus with the exception of the confirmation screens (yes/no)
Still more work to be done to round out some font issues.
TODO:
put more information text in bottom row of menu.
reorganize statistical data to allow more info to be shown.