Commit Graph

2443 Commits

Author SHA1 Message Date
wrenczes@gmail.com
f4fddda4ab Sidecar fix for the Deck menu hang bug: now the psp doesn't hang, but it goes to a crawl as we keep trying to reload the image on every render. Added a stopgap so that if we fail, we don't try to load the background anymore. To be reverted once we fix the PNG load failure on low memory. 2010-11-10 02:43:28 +00:00
wrenczes@gmail.com
eea91e9a1a Two changes here:
1) Consolidated the Loggers so that we only have one in JGE.  Added a helper constructor/destructor to the JLogger class so that you can instantiate one at the top of a function, it'll trace out a 'start' and 'end' message when it goes in & out of scope.
2) Fixed the crash part of a bug I've been chasing down where, on the psp, after saturating the cache, the game dies when trying to reload the background PNG image of the deck menu. We still need to fix the root cause of the failure (not enough memory to allocate a temporary buffer for the swizzle operation), but at least the psp doesn't lock up anymore.  I've also left behind all the log traces I inserted into the LoadPNG code, since we'll probably need them again.
2010-11-10 02:24:39 +00:00
techdragon.nguyen@gmail.com
2c3e1b551b 1) When "Cancel" from the 2nd deck selection was introduced, proper clean up was not implemented of the player information.
It was only handled at the end of the game or when somebody quit in the middle of a game.
    Nothing was done if somebody wanted to choose a differnet Player deck.
2) making clean up of objects a little more explicit in the mtggamezone and GameStateDuel objects
2010-11-10 00:56:30 +00:00
techdragon.nguyen@gmail.com
f176f7378d removed redundant delete of mPlayer[i]->game as it is already taken care of in the destructor for Player in the next line. 2010-11-10 00:53:56 +00:00
wrenczes@gmail.com
3eeb8a6465 - renamed WResourceManager::autoResize() to ResetCacheLimits(), since the function doesn't actually resize anything. It's merely setting clamping limits on when we should purge the cache.
- fixed the debug framerate calculation / drawing code (consolidated duplicated functions & variables mDelta vs a win-only mDeltaTime, no reason to have two), repositioned it to draw on the bottom left (it was colliding with other debug text for the cache info).
 - for debug testing purposes, added a #define override to force the image cache to work with less memory (I've picked 8 megs, which is what the psp seems to use - the normal default on win/linux is 20 megs).
2010-11-09 19:01:38 +00:00
techdragon.nguyen@gmail.com
c1f8e95a11 changed call to new to NEW 2010-11-09 12:29:33 +00:00
techdragon.nguyen@gmail.com
286d18847b code cleanup: removed dead code/ unused variables. 2010-11-09 12:19:17 +00:00
linshier
c71f8f4a46 Fixed traslation code of deck descriptions for new deckmenu. 2010-11-09 11:19:06 +00:00
techdragon.nguyen@gmail.com
164f2c5205 modified font size so deck name fits on screen when selecting deck for game play. 2010-11-09 05:45:24 +00:00
linshier
17c358cb12 Fixed a compiling error for GCC-4.4.5. 2010-11-09 02:57:52 +00:00
wagic.the.homebrew@gmail.com
09f01a9eae Erwan
-remove DOLOG committed by mistake
2010-11-08 13:46:21 +00:00
techdragon.nguyen@gmail.com
1e988ef6bb make rendering of retrieval and rendering of background more tightly bounded. 2010-11-08 13:41:32 +00:00
techdragon.nguyen@gmail.com
7fe03d52fd resolved linux compilation issues 2010-11-08 11:59:28 +00:00
techdragon.nguyen@gmail.com
23937f593e clean up of headers 2010-11-08 11:44:20 +00:00
techdragon.nguyen@gmail.com
7d25523a19 fixed line endings 2010-11-08 11:36:28 +00:00
techdragon.nguyen@gmail.com
8ba33c9b58 * updated title font size for deck selection screen to ensure it will always fit
* added deck name max pixel size to ensure no deck name overflows into borders of menu.
2010-11-08 11:15:16 +00:00
wrenczes
eec0c5b717 More theoretical fixes to the scroller. I didn't repro this on win, but I had a couple of cases on my psp - I suspect that the missing reset on the currentID counter was causing problems should the task list shrink after a duel. Also added a modulus calculation to make sure that we never go outside the bounds of the string vector. 2010-11-08 09:26:21 +00:00
wrenczes
52a2823f7b Fixed the build; line endings -> Unix. 2010-11-08 09:23:16 +00:00
wrenczes@gmail.com
6d8e7edcbf Improvements against http://code.google.com/p/wagic/issues/detail?id=50, Mana animation slows PSP down.
Two things: 1) there was an extremely inefficient implementation in the particle system of a queue where, when particles expired, each expired element would be copied over(replaced) by one at the rear of the container. Depending on the performance of the update, this could range anywhere from 100 to 500 (the max particle count) memcpy operations per update loop.  I replaced the flat array with a std::list, and simply pop the unneeded elements when they expire now.  This seems to shave ~30% off the time spent in the Update() call.

2) Hardcoded the number of emitters for the mana particles to 60 (the default in the psi file seems to be around 114).  This reduces the amount of iterations per tapped mana by just over half, which also helps the performance, and it's not really noticeable - the glow effect is a *tiny* bit more muted, but chances are, if you didn't read this comment, you probably wouldn't have noticed.

I've gone from having my psp start lagging noticeably at 8 tapped mana to about 12 - at this point, I think the bigger remaining lag is the fact that when there's a cache miss for a card image, we're doing synchronous i/o on the main thread - the framerate drop this causes is far more noticable than the mana particle lag.
2010-11-08 07:27:19 +00:00
techdragon.nguyen@gmail.com
61cc3692a5 promoted StatsWrapper struct into class
altered deck editor information display for statistics
2010-11-07 18:28:54 +00:00
wrenczes@gmail.com
2d31cbdaf5 Some tweaks to the fonts in the game deck selection screen - the 'wagic' green cursive font was a bit of an eyesore, and wasn't consistent color-wise with the other main font used for the stats & description. 2010-11-07 14:21:21 +00:00
wrenczes@gmail.com
a90d2ed2e7 Fixed two double->float conversion warnings. 2010-11-07 13:49:17 +00:00
wrenczes@gmail.com
7818277e3a Fixed a bug in the text scroller that caused it to display only the first item. 2010-11-07 13:03:36 +00:00
wrenczes@gmail.com
471cbd6ba4 More type conversion warning cleanup. 2010-11-07 12:09:04 +00:00
wrenczes@gmail.com
e717b2f260 Line endings -> Unix. 2010-11-07 12:02:55 +00:00
wrenczes@gmail.com
a053c0d59e More type conversion warning cleanup. 2010-11-07 12:00:23 +00:00
wagic.the.homebrew@gmail.com
5d907f5abe Erwan
- 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.
2010-11-07 09:26:29 +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
wagic.the.homebrew@gmail.com
416617fc0d Erwan
- fixed memory leak in AEquip/ATeach 
- Test suite now trims strings correctly (allows to have space between comma-separated card names)
- Added Paradise Mantle (for ATeach test)
- removed a missing wallpaper from wallpapers list
2010-11-07 02:27:54 +00:00
wrenczes@gmail.com
b2ee9c0f41 More VS 2010 solution files. The props file is required; the filter is a nice to have (ie, the solution file organization is broken out into a separate file now in 2010, whereas it used to be embedded in each vcproj file). 2010-11-07 02:12:50 +00:00
wrenczes@gmail.com
3c19533a4c Added the notion of a 'cancel' button, and unified all the 'cancel' menu IDs to be kCancelMenuID (ie -1). I've slaved the Menu button (ie Esc on win, 'Start' button on PSP) to this - the idea being, if you hit the Menu button to bring up a menu, hitting it again will dismiss it without doing anything, which is pretty standard behavior for most console/computer games. 2010-11-07 02:08:17 +00:00
techdragon.nguyen@gmail.com
b0c61049da tweaked menus a bit.
fixed possible NPE with background image retrieval
2010-11-06 10:05:54 +00:00
omegablast2002@yahoo.com
f5d7f03086 final fix for affinity, thanks mike for pointing it out. 2010-11-06 09:19:07 +00:00
omegablast2002@yahoo.com
ce1a079646 fixed another boo boo with affinity. *facepalm* 2010-11-06 09:04:44 +00:00
omegablast2002@yahoo.com
21dabf94c1 Simulacrum coded now
Issue: 502
2010-11-06 08:09:37 +00:00
omegablast2002@yahoo.com
6c616f2741 added pdcount varible. playerdamagecount for the turn. this is for Simulacrum style cards.
Issue: 502
2010-11-06 08:07:48 +00:00
omegablast2002@yahoo.com
ed03d2f3ef added optimizing of opponents hand if the opponent deck is listed as "easy". slight optimize if listed as "normal" none if listed as "hard" this provides slightly more challange from even poorly constructed Ai decks. taught Ai to pump creatures during combat, and more so if its heading directly at player, taught Ai that its better to use "becomes" and "transforms" during first main. this allow its to actually attack with the manlands ect.
new ability lord...teach(whatever[whatever]) ability.
teach is a targeted lord, it takes the cards current target and lords it the ability. im aware of a tiny memleak it contains, but the leak is happening on parser lvl, so i need more eyes to look at it. teach is ideally used for equipment, and was designed to fix issue 244 taught abilities are not given to the source cards.

forced Ai to pay for sunburst correctly. it was choosing to pay with all of one type of mana. now it pays either max or 1 from max sunburst.

added a tiny double check for Ai to try and find something to use if it suddenly has mana in its pool. it is only a single check in a turn, but i notice it actually does slightly improve the usages of dark ritual and foreach mana producers. ideally i wanted it to check EVERYTIME. but i could not achieve it without putting the game in danger of looping. so once is better then none :/

fixed a bug with affinity where it was not counting duel lands, this is becuase of not setting it up correctly for lands with multiple types SORRY!
2010-11-06 06:59:43 +00:00
techdragon.nguyen@gmail.com
0c34d7a04f removed dead code
reformatted statements
removed unnecessary debug statements
fixed a few floating point warnings
2010-11-06 03:49:15 +00:00
techdragon.nguyen@gmail.com
8908e86857 removed some compiler warnings
changed variables to float where appropriate
2010-11-05 08:07:50 +00:00
Xawotihs
91cf0c8d37 Added missing files 2010-11-05 07:26:01 +00:00
techdragon.nguyen@gmail.com
842596d4fc fixed sun titan and primeval titan card definitions.
**  Sun Titan: missing exclusion of instants and sorceries for special ability
**  Primeval titan: fixed token placement so that tokens went into exile and not the graveyard
2010-11-04 09:37:25 +00:00
techdragon.nguyen@gmail.com
2d9c2b3341 removed extra "." from TextScroller text as reported in forums
following up on wrenczes cleanup,
   changing ints to floats
   fixing calculations such as ( 16.0 / <some float>) to ( 16.0f / <some float>) to remove compiler warnings.
2010-11-04 09:18:12 +00:00
wrenczes@gmail.com
ab49a0c6e1 Added new files to the VS2010 sln; Fixed a bunch of int to float warnings.
Minor note to others:  if you're writing drawing code, the coordinate system in JGE uses floats, so don't bother with ints for x/y coords & the like.  You're forcing the processor to do float to long conversions for nothing.
2010-11-04 04:33:04 +00:00
techdragon.nguyen@gmail.com
dd163c8807 ***Note***
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.
2010-11-03 16:49:39 +00:00
techdragon.nguyen@gmail.com
b7a2196878 fixed signed vs unsigned comparison that caused psp build to fail 2010-11-03 16:16:53 +00:00
techdragon.nguyen@gmail.com
4a3d7faf0a added Reward and Expiration to task list
moved text scroller into DeckMenu class since it is specific to DeckMenu and not GameStateDuel
added new util function "wordWrap"
2010-11-03 00:15:12 +00:00
wrenczes@gmail.com
685626128a Minor refactor of AACloner::resolve() - two code paths were complete duplicates except for the MTGCard*. 2010-11-02 09:26:37 +00:00
wrenczes@gmail.com
eef54c259b Fixed a compile warning treated as an error on psp - switched an int loop var to size_t. 2010-11-02 07:05:04 +00:00
wrenczes@gmail.com
8cb0cf1dae Fixed a crash in the vertical text scroller. Mike, pls review. 2010-11-02 05:50:07 +00:00
wrenczes@gmail.com
4288e7c236 Normalizing line endings to Unix style, per coding guidelines. 2010-11-02 05:29:20 +00:00