Commit Graph

28 Commits

Author SHA1 Message Date
Anthony Calosa
cd1b629191 Fix Segmentation Fault & Formatting 2015-11-10 11:58:36 +08:00
Tobias Loose
f68568cc1e Replace strcmp with c++ equivalent when comparing std::strings. 2013-11-28 16:42:29 +01:00
wagic.the.homebrew
4c42636bd5 - Fixed issues and memory leaks related to decks unlocking
- Fixed an issue where a GameObserver could be null for some mana costs associated to a targetChooser
2011-10-22 13:38:43 +00:00
wagic.the.homebrew
7beb958067 Adding a way to mark decks as "locked" based on options requirements (option on or off). Can be used for example to lock a deck until a specific set is not unlocked. Works for both player decks (could be used for premade?) and AI decks. 2011-05-06 06:40:00 +00:00
techdragon.nguyen@gmail.com
8af5870d48 * Added new options parameter. "SaveDetailedDeckInfo". This will force the system to save all
deck files in long format.  This is not configurable from the game.  It must be set manually
     inside options.txt.
     ie.  saveDetailedDeckInfo=1

* added extra debug information (line number inside text file) when card parser fails to recognize a line.
    - modified return value from "processConfLine()" to return 0 only when a true error occurs and print out
         "MTGDeck: Bad Line:
         [<line no>]: <line with error>"
    - processConfLine will now return 1 for lines starting with "#".  Previously it returned 0 which is incorrect
         as comments should not be considered as errors.

* removed DeckMetaDataList class from code.  This was duplicating the DeckMetaData storage in DeckManager
* new feature for deck selection screens.
   - player decks will now have an indication of what mana color it consists of.
   - Ai decks will show symbols once the player has played against the AI deck at least once.
   -- This is made possible with a new meta data inside each deck file.
        MANA:<string representing color switches - 0/1 >
2011-01-31 10:04:18 +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
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
96cdb7353a fixed line endings
fixed horizontal scrolling to be controlled by a function of dt as per linshier suggestion.
  * this allows compatibility for multi-byte character sets
2010-11-30 12:15:32 +00:00
wagic.the.homebrew@gmail.com
52fce24bf8 Erwan
- Added AI Decks unlock system. Please update your graphics folder, and crossing fingers that Ilya B. is still around as I don't have the correct fonts.
2010-11-28 04:15:58 +00:00
techdragon.nguyen@gmail.com
e39c94756b added border to extra details popup as per design at
http://wololo.net/forum/viewtopic.php?f=37&t=2380
and
http://wololo.net/forum/viewtopic.php?f=37&t=2382
2010-11-23 14:02:02 +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
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
linshier
c71f8f4a46 Fixed traslation code of deck descriptions for new deckmenu. 2010-11-09 11:19:06 +00:00
wrenczes@gmail.com
b14e3808db Minor code cleanup - pass by reference instead of value; instead of creating temp char arrays on each deck loop while building deck metadata, use an ostringstream when needed. 2010-11-07 03:55:56 +00:00
techdragon.nguyen@gmail.com
6c1497bbd5 Revamped Deck Selection Screen using abrasax's design as a template.
TODO:  
     change literals to use constants, 
     refactor the rendering code for the menu to have be leaner.
     add text scroller to list all the tasks. 
         * 1st implementation will list all the tasks.dat  
         * 2nd round will try to get the scroller to only display relevant tasks to ai

Special thanks to wololo and MootPoint for helping me hammer this out.  To abrasax, for the initial design of the layout.
2010-11-01 08:22:55 +00:00
wrenczes
d5f3e4cfea Enabled precompiled headers for the build. This cuts the win compile time in debug by at least half on my laptop; on the psp compile, it shaves it down by ~ 45 seconds. I only did a cursory inspection of what to add to PrecompiledHeader.h, there's probably more that we can throw in there for more incremental speed improvements.
Also fixed the project includes so that we don't need to always use the indirect include path, ie:
#include "../include/foo.h" -> #include "foo.h"

I'm don't know much about make files - if I busted the linux build, mea culpa, but I think we're okay on that front too.  For future reference, here's the most straightforward link on the topic of adding pch support to make files:

http://www.mercs-eng.com/~hulud/index.php?2008/06/13/6-writing-a-good-makefile-for-a-c-project
2010-10-24 05:55:24 +00:00
linshier
d8122e441e Tweaked translation codes for deck and opponents choosing menus. 2010-09-29 08:18:09 +00:00
techdragon.nguyen
5eab87345a initializespatch fix for issue 459. This patch encapsulates the metadata object more and initializes the stat values. 2010-09-24 11:27:34 +00:00
omegablast2002@yahoo.com
5939cbded8 added MnGuyens further improved menu handling and extra options. 2010-09-17 06:34:12 +00:00
linshier
16fe2d8a4f Fixed bug for translated deck descriptions in DeckManager. 2010-09-13 10:59:59 +00:00
omegablast2002@yahoo.com
b2d93e5c70 added a few tweaks MNguyen sent me for his deck manager 2010-09-09 06:46:01 +00:00
omegablast2002@yahoo.com
79ea200d97 Added MNGuyen's improved and alphabatized deck handling(noticeable speed increase btween menus) and almosthumane's automated pass phase option. 2010-09-08 11:44:11 +00:00
wagic.the.homebrew@gmail.com
f40af0b1cb Erwan
- Chinese patch by linshier
2010-07-31 14:41:04 +00:00
jean.chalard
5a2bae75d5 J :
* Add newlines at end of files. This is for better portability.
* Fix a direct reference to g++ in the makefile
2010-02-02 10:19:43 +00:00
wagic.the.homebrew@gmail.com
26f96c3443 Erwan
- cache system for Deck Meta Data. let's improve it as needs arise
2010-01-15 12:19:47 +00:00
wagic.the.homebrew@gmail.com
01c949f881 Erwan
- Fixed a few tranlsation issues in the code
- Updated French translation
2009-10-31 07:58:21 +00:00
wagic.jeck
f220d2e9b9 Jeck - Cache and resource manager merged, streamlined.
This is pretty major, so there'll probably be something wrong with it... even though I did spend a few hours looking.
NOTES:
 * If you've Retrieved it, don't delete it--- Use resources.Release(Whatever). 
    Textures automatically release subordinate quads.
 * Most of the time, use resources.RetrieveQuad to grab a quad. Should handle everything for you.
    RetrieveQuad will load the required texture, if needed.
    Only managed resources have a resource name ("back", "simon", etc). 
    Managed resources can be retrieved with GetTexture/GetQuad/GetWhatever.
    Non managed quads lookup by position/dimensions, defaulting to the whole texture.
 * Use resources.RetrieveTexture only when you need to do something special to it. 
    Calling retrieve texture with RETRIEVE_MANAGE will permanently add a texture to the manager
    RETRIEVE_LOCK and RETRIEVE_VRAM will lock a texture. It will not leave the cache until
    Release(JTexture*) is called, or as a last resort during cache overflow.
 * Try to only store (as a class member) pointers to textures retrieved with RETRIEVE_MANAGE. 
    All others may become invalid, although locked textures do have a high degree of stability. It's
    pretty safe to store a locked texture if you're not going to load much between uses.

There's a lot going on here, so I might have missed something... but it runs through the test suite alright.

TODO: 
 * When called without any arguments, RetrieveQuad sometimes leaves a thin border around the image. 
    This can be bypassed by specifying a quad one or two pixels less than the image size. Why?
 * I've had a crash while runing the Demo mode, something to do with receiveEventMinus? 
    This hasn't exactly reproduced on a clean SVN copy, (being a hang, rather than a crash) so 
    I've probably done something to worsen the problem somehow? I'll look into it tomorrow.
 * Clean up lock/unlock system, memory usage. Streamline interface, consider phasing out calls using GetWhatever() format.
2009-09-03 09:28:16 +00:00
wagic.the.homebrew@gmail.com
951065a59c Erwan
- no more 5 decks limitation for Player
- Player decks can be given a name/description the same way we do for the AI. No PSP Gui for that yet though, has to be done outside of Wagic (PSPWrite ?)
2009-07-16 11:48:59 +00:00