Commit Graph

95 Commits

Author SHA1 Message Date
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
linshier
6bde3d0ee6 moved the translator init code earlier; added some translation support for the code of r2517 and r2907; updated some Chinese translation. 2011-01-31 14:21:46 +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
wrenczes@gmail.com
e5edf779f5 Reworked a patch sent to us (http://wololo.net/forum/viewtopic.php?f=15&t=2464) that replaces the text symbols for the psp buttons with the actual icons. While at it, I found a bunch of issues with the ActionStack's render code (ie when you get the popup menu to interrupt a spell being played & the like) - the bounding rect actually went above the screen's region, clipping problems (the interrupt text was previously drawing over the interrupt effect), alignment problems when the avatar was being drawn, vertical text alignment, fudged alignment numbers for the quads that didn't make any sense, etc.
I also tweaked slightly the psp icons to center the symbols, as they were too much to the right.  (Be sure to copy the updated graphics/iconspsp.png to your Res folder.)
2011-01-13 09:56:55 +00:00
wrenczes@gmail.com
1b876d61af Issue 494: "Valuable Collection" trophy is gone?
The check to give the award was lost in some of Jeck's reorg work (R1825), as ShopItem was deprecated & folded into GameStateShop. While at it, I took the liberty to delete ShopItem.h/cpp since they're not used.
2010-12-04 09:46:31 +00:00
wrenczes@gmail.com
720ee30c9a Fix for issue 518, Shop "background light" image "candle effect" not working. Basically some bad math made the alpha clamp all the time at its max value of 50. Now we pick a random number distribution between -25 and + 25 for the alpha offset value. 2010-12-02 07:42:32 +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
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
wagic.the.homebrew@gmail.com
b934f0a5ab Erwan
- reimplement r2609 with inheritance, and cleaned up the function code.
2010-11-14 01:35:26 +00:00
omegablast2002@yahoo.com
2c1e18050c had to add this to prevent crashing in the shop from buying a booster, i understand the need to reduce code but does every single function have to share every other classes functions? this was originally supposed to be a tiny change, but there was no way to define the difference between the card display used by shop and the ones used by grave and library. 2010-11-12 19:12:19 +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
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
8908e86857 removed some compiler warnings
changed variables to float where appropriate
2010-11-05 08:07:50 +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
wrenczes@gmail.com
5aa3dc6fd3 Refactoring of some of the font management in WResourceManager. This change looks bigger than it actually is - most of the touched files are simply renaming of some font enums that I moved out of MTGDefinitions into the resource manager header files. The main points of this change: collapsing the font containers into a single map, eliminating duplicated functions, and migrating the font building logic into the resource manager class. GameApp doesn't need to know anything about the fonts it uses, and likewise, font users don't need to know what the name of their chosen font is, just the FONT_TYPE enum.
(I did a cursory check to make sure chinese still displays correctly - at a glance, I'm seeing what looks correct to someone who doesn't read the language :) )
2010-10-19 07:51:32 +00:00
wagic.the.homebrew@gmail.com
c3c5d893d1 Erwan
- attempt at fixing some crashes in shop (related to bad usage of the cache)
- Fix typo reported with Qumulox
2010-10-03 07:36:01 +00:00
wagic.the.homebrew@gmail.com
bdc43052d3 Erwan
- support for tinyCrops see http://wololo.net/forum/viewtopic.php?f=15&t=2197
- card images can now be named after the card's name (ex: sets/10E/Ancestor's Chosen.jpg , or sets/10E/10E.zip:Ancestor's Chosen.jpg)
- yet another attempt at fixing tokens in the shop
2010-09-20 07:10:21 +00:00
wagic.the.homebrew@gmail.com
3965505b15 wololo
- Adding DJardin's port to N900
2010-09-16 13:12:05 +00:00
wagic.jeck
6063ddcf55 Jeck - Note to self: next time you write a unit test, check it better. 2010-09-12 05:10:10 +00:00
wagic.jeck
8114944db9 Jeck - Added theme substyles, which are chosen dynamically based on the player's deck composition. Also added lazy unit test for booster packs, though there should be a better way to framework this. 2010-08-28 10:51:38 +00:00
wagic.the.homebrew@gmail.com
f40af0b1cb Erwan
- Chinese patch by linshier
2010-07-31 14:41:04 +00:00
wagic.the.homebrew@gmail.com
1332842025 Erwan
- bug fix in JGE++ audio (improve HBL compatibility)
- Added new rewards in story mode: random card, card (either by "name" or id), specific set
- Story mode: added possibility to choose music, and bg for duel.
-- See "01. Where it all begins" for examples of new features
2010-07-19 13:44:26 +00:00
salmelo16
fa4ed3d3f5 Stop rarity=t cards from appearing in the shop. 2010-04-24 03:59:44 +00:00
wagic.the.homebrew@gmail.com
fa0d98988d Erwan
- quick patches, attempt at fixing a few crashes
2010-03-13 08:48:40 +00:00
wagic.the.homebrew@gmail.com
cf1e419aaf Erwan
- fix for issue 348
- Fix a bug when going out of the deck editor then back to it again would show an incorrect color icon instead of nothing
- Fix a bug where the AI tries to play a spell with a target instead of just checking if it can play it. (visually, this showed as the AI tapping mana, then "freezing" for a few seconds with some cards grayed out on the battlefield)
2010-03-04 11:43:22 +00:00
wagic.jeck
25e6906149 Jeck - More deck editor fixes, linked in prior coded subtype filter. 2010-02-19 21:54:39 +00:00
wagic.jeck
afffd4509f Jeck - fixed issue 354, cleaned up mixed boosters, fixed a few issues with pack loading (slot pools weren't working), fixed TSP boosters to use 'S' rarity, removed some unused code. 2010-02-19 20:10:30 +00:00
wagic.jeck
ce2f8aebea Jeck - fix to issue 347. 2010-02-17 19:29:22 +00:00
wagic.jeck
8b1a812e02 Jeck - Normal and Hard economic difficulty no longer display visible prices before the player asks about a card. This allows Wololo's clever pricing algorithm to work :) 2010-02-17 19:02:35 +00:00
wagic.jeck
a123cebfe5 Jeck - Fixed an error with packs, fixed basic info in deck editor, removed duplicated code in DeckDataWrapper. 2010-02-17 03:10:56 +00:00
wagic.jeck
92979fb184 Jeck - Linked task menu into shop's r-trigger. 2010-02-15 22:02:28 +00:00
jean.chalard
56ce4a14ae J :
* Create the subsystem for keybindings.
2010-02-14 13:21:12 +00:00
wagic.jeck
ab34fc16f9 Jeck - Added custom booster packs (see miki), numerous small fixes. Once we hit feature-freeze I'll be reviewing this stuff in depth, as again there's likely a lot of room for cleaning... just wanted to get it in first :).
I cut some bits out that weren't ready for SVN, hopefully I've committed everything correctly.
2010-02-11 18:32:44 +00:00
wagic.jeck
cf03d4cc64 Jeck - fix to issue 318. 2010-02-10 15:48:38 +00:00
wagic.jeck
4189c238b9 Jeck - Fix for issue 315. 2010-02-10 15:36:09 +00:00
wagic.jeck
3d6829a7d1 Jeck - fix for issue 317. 2010-02-10 14:50:01 +00:00
wagic.jeck
e59aca67b7 Jeck - Fix for issue 320, also fix for countByName. 2010-02-10 14:46:10 +00:00
wagic.jeck
9806edc6d0 Jeck - Fix for issue 316 (shop selection not cyclical). 2010-02-10 14:03:08 +00:00
wagic.jeck
5444c4e507 Jeck - Changed filter pricing scheme- filter tax is now inversely proportional to the amount of results. Added preliminary "economic difficulty" option. Note that it requires difficulty modes to be unlocked (at least to appear in the gui). Should we make it available from the start? 2010-02-09 16:23:29 +00:00
wagic.jeck
2508a64634 Jeck - Completing a collection using the cheat profile now also unlocks all sets in trophy room. 2010-02-08 23:53:04 +00:00
wagic.jeck
251f89d7b9 Jeck - Consolidated card price functions from deckviewer/shop into PriceList. Also moved price discount hash variable. (As of around r1825, price discount has been based on (mtgid + static int randomKey) % 20. randomKey updates at the end of any won game, making prices for a given fixed between visits to the shop on the same "day") 2010-02-08 20:13:48 +00:00
wagic.jeck
5a597dfc65 Jeck - Fix to shop. 2010-02-08 09:37:32 +00:00
wagic.jeck
e96d4b9a07 Jeck - Cleaned up and reordered some menus, fixed potential heap corruption in GameStateShop. 2010-02-08 08:54:55 +00:00
wagic.jeck
513795b316 Jeck - Fix for booster pack purchases not saving. 2010-02-08 02:16:39 +00:00
wagic.jeck
bdf958de34 Jeck - Daily build, fixed alignment issue in shop prices. 2010-02-08 01:35:16 +00:00
wagic.jeck
83e2b04547 Jeck - Added full filtering system to deck editor and shop. I've spent 24hours on pure debugging, but there are likely a couple bugs I've missed. So please, if you find something, make an issue of it! :P Also split OptionItem classes into separate files, and added support for mixed-set boosters (which I think are way, way cool). 2010-02-08 01:03:07 +00:00
wagic.the.homebrew@gmail.com
ab9366f035 Erwan
- fix issue 310 (exalted)
- fix issue 312 (heap corruption)
2010-02-04 13:28:04 +00:00
wagic.jeck
d37d080752 Jeck - More minor fixes. 2010-02-03 14:45:05 +00:00