Commit Graph

3512 Commits

Author SHA1 Message Date
wrenczes@gmail.com
bd56723bc0 Checkpoint on a utility helper class. Basically, if you have a class that you want to count the numbers of instances, you do this:
class Foo
#ifdef TRACK_OBJECT_USAGE
      : public InstanceCounter<Foo>
#endif

Then, use this macro somewhere in the class body:
SUPPORT_OBJECT_ANALYTICS(Foo)

Lastly, add whatever information you want to trace out to the function ObjectAnalytics::DumpStatistics().

Here's a sample of the output of what I've instrumented so far:

-----------------------------------------------------------
Object Usage Stats

CardPrimitive current count: 7899
CardPrimitive current byte usage: 2053740
CardPrimitive max count: 7908
CardPrimitive max byte usage: 2056080

MTGCard current count: 13973
MTGCard current byte usage: 670704
MTGCard max count: 13982
MTGCard max byte usage: 671136

MTGCardInstance current count: 180
MTGCardInstance current byte usage: 172080
MTGCardInstance max count: 189
MTGCardInstance max byte usage: 180684

-----------------------------------------------------------
2011-04-23 05:16:53 +00:00
wagic.the.homebrew
8e4de36588 - unsupported.txt cleanup + conflicts cleanup (had to partly comment out some cards for which we don't have a clean solution yet, "multipart cards" are basically 2 cards that share the same Multiverse ID, such as "Day // night" ) 2011-04-23 04:55:00 +00:00
wagic.the.homebrew
fafa785778 - Cleaned up "borderline" primitives, split into borderline and crappy, which is closer to the way I intended the system to work initially.
- moved mtg_todo.dat into "unsupported.txt"...there are many parsing issues that I need to solve, but give it a try (set the grade level to "unsupported" in your advanced options, and restart the game) , it bumps the number of unique cards to almost 12000 :) (of course, these new cards don't work, that's the point of the "unsupported" grade)
2011-04-23 04:01:42 +00:00
omegablast2002@yahoo.com
4c127f1a59 flipped the default avatar so evil twins stare at each other instead of away from :D 2011-04-22 19:11:47 +00:00
wrenczes@gmail.com
224b140f9f First pass at reducing the overall memory footprint: moved GetFormattedText() out of CardPrimitives and into MTGCard. The idea being, only keep the formatted text around for cards that are actually in use.
Also fixed a subtle memory pooling issue in the RenderCountersBig() routine:  if you're in regular card display mode, the idea is that formatted text is only fetched if you flip into alternate render mode.  However, in this function, if counters are being drawn, it would fetch the formatted text in order to determine where to draw the counters, EVEN IF the counters count was zero.  So it had nothing to draw, but it meanwhile pooled the formatted strings into memory anyway.
2011-04-22 16:04:41 +00:00
wrenczes@gmail.com
58e340f30c Removed the precompiled header include from JSocket, as the precompiled header is actually in the mtg project and this is cross pollination. Moreover, mtg specific header changes that we might put in the precompiled header will cause this file in JGE to recompile each time. If we think it'll improve things, we could put in a separate precompiled header in JGE, but I'm not sure it's enough of a gain to bother. 2011-04-22 14:59:10 +00:00
wrenczes@gmail.com
cca2fb92ec Optimized a heavily thrashing reallocation (temporary string construct) inside the resource manager. (Also contains a few more PSPENV->PSP consolidations, this should have been part of my last submit) 2011-04-22 13:33:42 +00:00
wrenczes@gmail.com
ae227a7cb8 Minor project cleanup:
- Consolidated duplicate PSP / PSPENV defines;
- removed some ancillary file crap from the 2010 projects;
- pulled 1xx references from the makefiles;
- consolidated multiple #defines for OutputDebugString into one header (previously was split between config.h & DebugRoutines.h).
2011-04-22 13:12:36 +00:00
omegablast2002@yahoo.com
1827e99780 fixed a typo in liquid metal coating. 2011-04-22 12:00:03 +00:00
omegablast2002@yahoo.com
feee31a360 updated kicker test by adding "choice 1" pay kicker, it will have no effect on "always pay" option, but if a player has "offer choice" they will still pass... 2011-04-22 11:18:47 +00:00
omegablast2002@yahoo.com
ad56dfa8d0 3 things here
first as requested, kicker will now act like the other cost, offering a menu choice, heres the catch tho, 
it was also thought up that we should maintain the "pay automatically" method of it as it feels more natural to some(even tho as per MTG rules its supposed to be a choice).
so here is what i did that i hope satisfies everyone, i added a new menu option under advanced tab..."kicker payment" with 2 setting, by defualt "always pay" but also an option to "always offer choice"...

2nd, minor tweaks to player avatar, every tme i saw it i was like "i need to do something about that", the avatar getting completely sucked into the corner just looked bad imo, so i about doubled the "inactive" size, so it looks a little more uniform with the opponents avatar. also move the library and grave icons just a thin hair to the left so they don't grossly overlap the players avatar as much when active, and increased the dark box theyre contained in my just a few pixels.

3rd, something else thats really bothered me to no end was that the title text of simple menus which display the cards name which owns the box was using small face font, which on pc was *barely* ok...but on psp(smaller devices) looks like white smears and dots. i changed it to share the font and size used inside the menubox itself, the end result is a lot nicer look...and alot easier to read on psp. now if only we can convince wololo that "spades" is alot like a lava lamp, cool at first, but *extremely* dated. the menu box should have a much slicker look, maybe rounded corners instead and lose the street light poles?

minor fix for phaseaction, becuase of the nature of this ability finding a happy safe medium without losing function is tough. hopefully this corrects it for good.

dropped cast methods menutext returns to lower case, for uniformity.
2011-04-22 11:17:20 +00:00
wrenczes@gmail.com
7203ce9436 Style formatting - no code changes here. 2011-04-22 04:31:55 +00:00
wrenczes@gmail.com
b4e3608412 Fixed a subtle bug with the Random player deck choice - I kept getting my first deck every time. It turns out that the 'random' implementation was actually multiplying the random seed by a value of 1001, which isn't prime - I have seven player decks on my one dev system, which divides neatly into that multiplier.
Removed the multiplier, as it's unnecessary.
2011-04-22 00:44:13 +00:00
wrenczes@gmail.com
223b067234 Removed what looks like a leftover temporary trace. 2011-04-22 00:09:10 +00:00
wrenczes@gmail.com
5e6c0c612e Fixed the breakage in the Deck Editor Menu, where the app would hang, looping on trying to word wrap a string. Erwan, pls review. Char is signed here, I'm not sure what the compiler warning was that you saw - NDK related? Does it treat all chars as unsigned? 2011-04-21 23:51:05 +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
solo81@web.de
8f51c1d1fe Removed a test relict from Fieldmist Borderpost. 2011-04-21 15:19:01 +00:00
wagic.the.homebrew
6f5919ed06 Reverting r3496 to fix failing tests 2011-04-21 15:16:22 +00:00
solo81@web.de
1d295c0cef Fixed Fieldmist Borderpost. 2011-04-21 15:10:05 +00:00
guzhenjie1@gmail.com
dca61d1ab0 Corrected Sporoloth Ancient. 2011-04-21 14:30:11 +00:00
wagic.the.homebrew
8ff6839c8d Some preparation work for new platform support.
- Added a "PSP" compile-time define to clean up some compile time checks (replaced !WIN32 && !LINUX && !IOS with PSP) 
-- Wil, I am aware that this is redundant with the PSPENV variable you introduced recently, I think we can clean that up easily
-- This looks like lots of changes, but most of the time I just moved some blocks here and there
-- tested on VC 2010, PSP, and a bit of NDK
-- I might have broken maemo, iOS, or Linux compilation, can you guys check?
- Fixed some warnings reported by NDK
- NDK still does not compile because recent boost additions (mutex, etc...) are apparently not supported
2011-04-21 13:16:11 +00:00
solo81@web.de
5eb36fecc0 Fixed Neurok Invisimancer, Poultice Sliver and Fledgling Griffin. 2011-04-21 12:47:23 +00:00
solo81@web.de
0a6a5697f5 Updated all other cards with "other=cost". Same improvement as in last revision. 2011-04-21 12:24:10 +00:00
solo81@web.de
2139291115 Updated all cards with Evoke by adding "name(Evoke)" to their "other=..." line. This small addition makes the choice menu of those cards more readable. 2011-04-21 11:47:07 +00:00
solo81@web.de
35dde15fc6 Reverted rev3497. 2011-04-21 11:36:02 +00:00
solo81@web.de
4db75ac2fe Updated all cards with Kicker.
You now always have the choice if you wanna pay the Kicker cost or not.
2011-04-21 10:20: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
techdragon.nguyen@gmail.com
8ed84aa97d Issue 634:
Fixed.  Had to clear the DeckManager whenever the player deck selection screen is displayed.
TODO: Need to implement a caching mechanism that caches the deck information based on deck selection and not a global one.
Currently DeckManager is effectively treating the DeckMetaData as global data.

*some minor tweaks to how deck information is managed/created
2011-04-21 08:32:32 +00:00
techdragon.nguyen@gmail.com
29eea1d39c fixed a memory leak. Not sure how it got introduced but the destructor for DeckManager now does the heavy lifting for memory cleanup and not the static method EndInstance().
reorganized DeckMetaData method LoadDeck so that it appears underneath the constructor.
2011-04-21 06:35:44 +00:00
wrenczes@gmail.com
cc55042477 Formatting cleanup. No code changes here. 2011-04-21 06:14:54 +00:00
wrenczes@gmail.com
d212f08618 Added a missing forward class declaration to fix the psp build. I'm surprised that VS2010 didn't complain... 2011-04-21 05:51:21 +00:00
wrenczes@gmail.com
920282017b Added ManaCost & ExtraCost to the startup traces of certain class sizes. 2011-04-21 03:22:09 +00:00
wrenczes@gmail.com
7bf6374fc7 Another minor change to eliminate an unneeded #include. 2011-04-21 03:21:15 +00:00
wrenczes@gmail.com
39870c91f6 Removed GameApp.h from GameOptions.h - this should help prevent the precompiled header from rebuilding constantly when any header is touched, as GameApp.h ends up pulling virtually every other header by some level of indirection. We really need though to sit down at some point & refactor the inclusion tree. It's a big yarn ball at the moment. 2011-04-21 02:35:51 +00:00
techdragon.nguyen@gmail.com
3bef78be82 simplified some logic for evil twin 2011-04-20 23:34:33 +00:00
techdragon.nguyen@gmail.com
935c3da4b5 synced evil twin avatar ingame with one from deck selection.
TODO: make the "evil twin" look more different than just a mirror image.
2011-04-20 23:29:41 +00:00
omegablast2002@yahoo.com
64ec306cf6 added grade crappy to the discarders using random discard added to borderline.txt...to avoid the confusion that those cards might actually be fully supported. 2011-04-20 22:20:34 +00:00
wrenczes@gmail.com
8e6a3e64f0 Apparently the code police weren't satisfied... :) Eliminating the duplicate ints & extra assignments. 2011-04-20 22:09:40 +00:00
omegablast2002@yahoo.com
2a4a01da5e changed it to modulo to please the code police.... 2011-04-20 21:47:02 +00:00
omegablast2002@yahoo.com
6fe3411656 whoops brackets wrapped the wrong spot. 2011-04-20 21:29:48 +00:00
omegablast2002@yahoo.com
561054ba34 added a true method to recycle our 100 avatar images, and made sure they stay in line with the menu image if theyre over 100. 2011-04-20 21:21:12 +00:00
wrenczes@gmail.com
f805d195ad Fixed the build. 2011-04-20 21:07:44 +00:00
wrenczes@gmail.com
babda2bc0f Some minor tweaks to make the image prefetching feel less flickery : when a card goes from a player's library into their hand, trigger a prefetch of the image. Also do the same thing when the AI decides on what card to play and creates an action. The idea being, new cards in play will probably want to be viewed by the player (and in the case of the AI playing a spell, we automatically show the image during the interrupt window before it comes into play). This makes for a much smoother gameplay - we have to get the image at some point anyway, and by doing it before we get to the render call, we no longer have the back card image pop up briefly. 2011-04-20 21:07:24 +00:00
omegablast2002@yahoo.com
d06965d95e added tha menu constants variables to fix compiling on vc2008, i guess free version doesnt add it automatically or something becuase mike was able to compile without them 2011-04-20 20:40:28 +00:00
omegablast2002@yahoo.com
15e8a91ba8 removed the premade evil twin avatar. 2011-04-20 20:26:28 +00:00
omegablast2002@yahoo.com
a02a09444b back thumb scaled for avatar slot 2011-04-20 20:25:52 +00:00
omegablast2002@yahoo.com
b2ef742ec8 ok made minor changes to mikes last commit, instead of loading "nothing" im making it load a card back instead, that black hole drove me nuts....second instead of loading a premade "evil twin" i made it load what ever the users avatar was flipped horizontally. didn't tint it red becuase i am not that attuned to the graphics side of wagic. 2011-04-20 20:24:53 +00:00
Xawotihs
78e34386ee Android cross-compiling fixes regarding constants 2011-04-20 20:14:25 +00:00
techdragon.nguyen@gmail.com
2fdc80aee1 Synchronized avatar images to be loaded correctly on first display of the opponent selection.
* changed how the avatar images are assigned since how they were before was incorrect.  They are now assigned upon instantiation of the meta file.  Not when the stats are calculated.  
* Added new image for "Evil Twin".  This is a horizontally flipped image of the original player avatar with a red background.  Please feel free to edit the image.
* removed display of avatar image on menu items in deck selection that are not deck related. (ie "Cancel", "Back to Main Menu", etc)  "New Deck" also does not have an image since no deck really exists yet so no avatar.  

Issue: 622
2011-04-20 17:51:40 +00:00
omegablast2002@yahoo.com
ba7640079c move reducedCost and increasedCost out of cardprimitives and into MTGCardInstance 2011-04-20 12:14:27 +00:00