Commit Graph

40 Commits

Author SHA1 Message Date
Xawotihs@gmail.com
26ab65860e Fixed a gazillion of warnings occuring when compiling Wagic with Clang with Werror. 2013-06-09 21:16:39 +00:00
techdragon.nguyen@gmail.com
9faf2ffc72 reverted changes to the Scroll/OnScroll method signatures. 2012-01-27 23:47:02 +00:00
techdragon.nguyen@gmail.com
a2179017d4 Extended Scroll() and OnScroll() to also take in magnitude as one of its parameters. magnitude is currently used in the deck editor to figure out how many cards to rotate around per swipe as function of velocity and the number of cards displayed on the screen.
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)
2012-01-26 13:53:03 +00:00
Xawotihs
f68c106e7e - Modified gameObserver and related classes to be able to work with a precise JGE instance given at construction and not the static global one. That allows to run gameObserver without JGE instance (for example in a worker thread).
- 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
2011-11-13 22:36:34 +00:00
wagic.the.homebrew
9e572ee416 - Moved "game mode" types of awards outside of a code, and inside of a configuration file (rules/awards.dat). No code is required anymore to create such an award (momir, hermit basic, etc...)
- fixed compilation errors in GameObserver (windows)
2011-10-02 01:03:45 +00:00
techdragon.nguyen@gmail.com
5d09bb8a13 removed unused variables
moved debug framerate message to be 10px higher.  current position covers the credit count on the game shop screens.
changed hard coded numeric values for menu ids to Labels.  ( this was done only to GameStateAward )
2011-09-09 17:38:39 +00:00
omegablast2002@yahoo.com
1fefc33777 removed a compile error, variables that were unreferenced.
small add with big impact:
added the useage of castrestriction on triggers and activated abilities. 
this can be used to create such cards as library of alexandria. 
{t}:draw:1 restriction{type(*|myhand)~equalto~7}
and replace instances were we were putting false triggers on the stack from abilities which contained nested aslongas...
meaning cards like epic struggle, won't need to be triggered every turn even if you have no creatures...
for epic struggle here is an example of how to replace it
@each myupkeep restriction{type(creature|mybattlefield)~morethan~19}:wingame controller
any of the current cast and other restrictions can be used. this includes turn:1 <===and various others such as phase based checking.
syntax is 
restriction{ whatever casting/other restriction you want }
a nice quality of life fix for false triggers (which don't mean theyre incorrect, just annoying when they trigger when they will do nothing)
another example would be the triggers on cards like 
skullcage.
auto=@each opponent upkeep:aslongas(*|opponenthand) damage:2 opponent >4
auto=@each opponent upkeep:aslongas(*|opponenthand) damage:2 opponent <3
becomes
auto=@each opponent upkeep restriction{type(*|opponenthand)~morethan~4}:damage:2 opponent
auto=@each opponent upkeep restriction{type(*|opponenthand)~lessthan~3}:damage:2 opponent

now instead of triggering every opponent upkeep even without a resolve...it will only triggers when the restriction requirement is met.

enjoy :)
note:all test pass.
2011-09-09 10:34:05 +00:00
Xawotihs
c3d2b60a67 Fixed trophy card selection and scrolling with mouse and touch. 2011-09-06 21:08:25 +00:00
wagic.the.homebrew
33691d1f13 - Added ads support for Android
- basic "message" system between JGE and java through jni 
- Fixed pause/resume on android/sdl
2011-09-04 02:45:18 +00:00
Xawotihs
979840dd4e Fixed issue 676 (was not related to mouse support at all) 2011-07-08 21:26:21 +00:00
Xawotihs
4bf255596f Activated mouse tracking in option and award menus. Activated offset support in SimpleMenu, it should help for issue 674 2011-06-04 16:22:45 +00:00
omegablast2002@yahoo.com
0727343ebe first moved the def of handsize for a game into the rules.txt as discussed with wololo...
this update requires you to update your rules folder files!!!

2nd
added 2 new vanguard game modes.
Stone Hewer Basic - when ever a creature enters play, a random equipment with a converted mana cost less than or equal to that creature is put into play and attached to it.
this mode is unlockable, requirement = win a match where 10 or more equipment were in the battlefeild at the moment you won.

Hermit Druid basic- in this game mode, during each of the players upkeeps, a random land card from their deck is placed into the battlefield, these do not count against your 1 land per turn limit.
to unlock this, win any match with less then 10 lands.
2011-05-23 11:46:04 +00:00
wrenczes@gmail.com
fc0a59a14e Moved GameOptions.h into the precompiled header. Shaves almost 20 seconds off my build times. 2011-04-20 07:50:00 +00:00
Xawotihs
b7b584113b - Moved the card collection out of the GameApp class to clean up the dependencies
- 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
2011-02-06 11:35:40 +00:00
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
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
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
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
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
ac435980ce Erwan
- Attempt at solving issue 247 (missing background image for trophy room). I think I attempted that a while ago and it caused some crashes, so let's revert this change if this happens
2010-09-26 06:22:46 +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
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
76f012cc99 Jeck - More fixes to r1827. 2010-02-08 09:05:09 +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
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.jeck
fa57de0418 Jeck - Final fix for issue 258. Added missing NO_TRANSLATE flag. 2010-02-01 21:26:49 +00:00
wagic.jeck
46215a2bc0 Jeck - Updated the WGui/OptionItem classes to all use ReadButton. Also updated daily build. 2010-02-01 20:58:52 +00:00
wagic.jeck
0a863bcbad Jeck - [JGE recompile needed] Shop cleanup, Interface enhancements.
Added basic transition system that works with GameApp's phases. Currently does a fade-out between elements, which works well in some places and not-so-well in others. We'll definitely want to think about where and where not to use it... they'd work a lot better if we could spawn a thread to handle loading the next state while transitioning.

Also cleaned up the shop a bit, so it uses ReadButton() instead of GetButtonClick()-- hence the slight change to JGE. Added a tiled image for the task board, which loads conservatively (I tried 128x128, but it didn't look as good).
2010-02-01 18:27:25 +00:00
wagic.jeck
cf2dfec105 Jeck - Changes to WGui, potential fix to issue 258 (please verify). 2010-01-31 21:38:07 +00:00
wagic.jeck
c8cae60071 Jeck - Fix memory leak in collection stats page. Thanks, Psyringe! 2010-01-31 15:59:29 +00:00
wagic.jeck
bd0e139e6d Jeck - Minor update to trophy room, moved metadata into cards.dat
* updated daily build
* Card spoiler now sorts by collector's number.
* Metadata looks for "[m" (for speed reasons), I've been using "[meta]" in files. No sets currently use metadata.
2010-01-05 23:32:31 +00:00
wagic.the.homebrew@gmail.com
05a72de5bc Erwan
- Card Primitives system. Check Royal Assassin in RV, 10E, M10
- Please review, is sets/primitives a good directory? Should we rename MTGCard into "CardPrint"? 
- Unfortunately for now it is not possible to "override" a Primitive. A card that links to a primitive but also defines new "values" will create its own data and ignore the data in the "linked" primitive for the time being. I hope to solve that at some point...
2009-12-27 12:14:36 +00:00
wagic.the.homebrew@gmail.com
35745a55ef Erwan
- Loading the "awardback.jpg" file in 16bits instead of 32. This should extremely reduce the probability of crashes (issue 247)
- Added some error debug message for the test suite when a card cannot be found
2009-12-17 13:09:47 +00:00
wagic.jeck
b7b48a0ab3 Jeck - "Fix" to issue 247 (see issue for notes), added additional award ("Collection valued over 10,000 credits"), minor enhancement to trophy room UI (floating "O - Details" notification).
The new award will need some art before we ship, but it won't take too much work to add that :)
2009-12-15 18:03:42 +00:00
wagic.jeck
b766dd6e4a Jeck - Fixes for how options handle first boot, should resolve trophy room issue (no unlocked set on first boot). 2009-12-13 15:00:53 +00:00
wagic.jeck
608255e251 Jeck - Fix signed/unsigned in AllAbilities (please review), bug fixes for trophy room (new status now saves). 2009-12-13 14:36:58 +00:00
wagic.the.homebrew@gmail.com
ee3286ff2a Erwan
-Fix issue 206 (rain of filth)
2009-12-13 09:33:51 +00:00
wagic.jeck
2387cd23f3 Jeck - Yes, I really did just do this twice. Another missing file from r1640. 2009-12-12 11:26:50 +00:00