Commit Graph

119 Commits

Author SHA1 Message Date
Vittorio Alfieri
6c0740c78c Fixed primitives, avoided a crash when destroying "transforms" ability for cards in library, added random deck selection to Stone Hewer Basic mode, fixed random deck selection from Commander mode, improved exclusive color filter to include monocolored artifacts, added PSP_LARGE_MEMORY define to Makefile to allow more RAM for PSP version. 2021-12-02 18:55:53 +01:00
Vittorio Alfieri
f982124209 Added boast ability, refactored WParsedInt class (this class has been removed from AllAbilities.h file and it has been included into two dedicated .h and .cpp files), refactored all makefiles (Windows, Linux, PSP and Android) in order to to include the new .h and .cpp files added for WParsedInt class. 2021-01-18 17:11:09 +01:00
Vittorio Alfieri
21b5308420 Fixed code trying to make the 2 Players mode work better. 2021-01-03 01:07:18 +01:00
Rolzad73
715bedb71a - Travis PSP build broke, attempt to fix 2017-01-28 05:05:35 -05:00
Rolzad73
8fed9e47d1 - Travis PSP build broke, attempt to fix 2017-01-28 04:50:07 -05:00
Rolzad73
85f66a8fec X11 build fixups
- fixed -Werror=misleading-indentation warning
- fixed -Werror=nonnull-compare warning on xll and QT builds
- PNG_LIBPNG_VER backward compatibily changes
- giflib backward compatibily changes
- resolved some undefs for X11 build
- silenced some small compile warnings in JGE Makefile
- added -DTIXML_USE_STL to remaining build types (PSP had it added)
- fixed x11 Boost incompatibility issue part of #548
- reworked PrecompiledHeader.h platforms used
2017-01-28 04:19:46 -05:00
Tobias Loose
225dd23753 Fix makefile 2014-03-11 17:19:05 +01:00
Tobias Loose
9f1d225259 Add additional source files to various build systems 2013-12-05 23:06:30 +01:00
Tobias Loose
e8407caa2a Add TIXML_USE_STL compiler flag to psp makefile to make headers compatible 2013-11-29 13:34:35 +01:00
Tobias Loose
9c282aeb56 Remove CardEffect.o from Makefile 2013-11-20 12:02:33 +01:00
xawotihs
90652fa73d Fixed PSP build and integrates it with Travis CI 2013-11-09 19:40:01 +01:00
omegablast2002@yahoo.com
e709497f2e added interactivebutton to the make file, without it psp build was not happening.
corrected an issue by removing a constant, if you want it defined as a constant do so, however make sure when you build for psp the variable is actually still defined in the scope.
2012-02-01 19:05:20 +00:00
techdragon.nguyen@gmail.com
a36d886dd5 Added first draft of an interactive button. Needs to handle addition of images a little better
refined detailed info window for stats display
removed PSP button for Touch interfaces (currently only iOS and Android) on deck selection screens
to not break the core engine and reduce some more complex code, I created a new vector in the JController object. mButtons.  This vector will contain all the valid buttons for a given screen.  The appropriate Add/Remove methods have been updated to account for this new vector.
2012-01-25 18:35:24 +00:00
jean.chalard
07582eca45 Switch the default linux target to qt.
The old X11 version can still be built with make x11.
If this breaks some use cases, please tell me - it's hard to
predict. My minimal testing seems to indicate it works, and
make does the heavy lifting for us.
2011-12-18 12:40:47 +00:00
jean.chalard
d1a30f10a5 Add a rule to generate the qt Makefile 2011-12-18 12:15:50 +00:00
jean.chalard
d93fdb2d4a Fix the Linux build. 2011-12-18 09:40:35 +00:00
wagic.the.homebrew
6825082d6d - Add a simple macro system for auto lines (the goal is to help mostly with repetitive card auto lines such as the ones we have in MotD mod) Check the MotD mod for examples.
-- I added an AbilityParser.cpp file, mid term goal is to move AbilityFactory there, so that MTGAbility.cpp becomes a bit less big.
-- I tried to add the file reference in Makefiles, but only tested windows compilation so far
- Fixed bugs related to "castRestriction" variables in MTGAbility. these variables were declared in both the parent and children classes, leading to bugs and duplicate code/content

The test suite passes
2011-10-15 16:19:29 +00:00
wagic.the.homebrew
fbfac78b09 - Split AIPlayer and AIPlayerBaka in 2 files. Moved all "AI" specific code into AIPlayerBaka, as much as possible.
-- This is a copy/paste and shouldn't have any impact on the logic. I just moved some functions from AIPlayer to AIPlayerBaka
- Added back the possibility to select a different Resource folder with file Res.txt
- Fix a crash when a token id does not exist
2011-09-20 03:06:06 +00:00
wagic.the.homebrew
e27cf56fa2 - Support for Zip Filesystem. It is now possible to zip the entire Res folder ("store" method preferred, zip so that the root of the zip has ai, player, etc...) in one single file for read only. Write access is done in another folder (hardcoded to be User/ for now, can be updated depending on platforms, etc...
-- zipFS has several limitations...
--- in a general way, seekg doesn't work... so getting a file's size needs to be done through JFileSystem.
--- getLine on files open with zipFS doesn't work so great. Not sure if it is a normal issue because files are open in binary or not... JFileSystem therefore offers a "readIntoString" function that needs to be used instead of the usual "getline" technique. However getLine can then be used on a stream connected to the string.

-- tested on Windows and PSP, I also made sure android still works, but haven't tested zip support on Android.
-- I tried to maintain backwards compatibility, but this might break on some platforms, if I broke some platforms and you can't find a way to fix them, please contact me and we'll figure something out
-- This removes wagic::ifstream. I didn't reimplement the securities that were involved in this, apologies for that. Might be useful to reimplement such securities in JFileSystem
-- I haven't tested options/profiles in a deep way, it is possible I broke that.
2011-08-21 09:04:59 +00:00
wagic.the.homebrew
bf4e0d8908 - minor tweaks:
-- Res is the default folder in Res.txt, in case it exists, to avoid confusion when debugging
-- added sign_prx in the makefile, harmless if you have the default build.mak, but signs the app for you if you have the correct files
-- uninitialized variable warning fixed in Rules.cpp
2011-07-10 07:55:08 +00:00
wagic.the.homebrew
52b83a135c - Added TutorialMessage ability
-- Tutorial Messages are an ability like any other, except it can only be displayed once. Subsequent calls are ignored, the ability is removed from the game as soon as it is added
-- This allows to add event triggered messages ingame. Messages are either text, or images (I don't have an image sample, but rules/classic.txt has a few examples that might help)
-- only tested on Windows, although I made sure the PSP version compiles. Hopefully I also made the necessary for it to work in the touch version (touching the screen should be enough to close the tuto message)
-- Room for improvement: possibility to choose a title in text mode, possibility to have some messages depending on others (e.g.: don't show message X until message Y has been shown), improve some of the abilities and triggers to give more flexibility, add events outside of game, to allow tuto messages in deck creator, etc...
2011-07-03 08:47:51 +00:00
wagic.the.homebrew
691a1e1b91 - Fixed a Bug where AI would not block any attacker in Demo mode (bug introduced in r2759)
- Fixed a Bug where AI would not correctly assign blockers if the first attacker is super strong.
- Added a hack to prevent AI from an infinite loop while choosing a target. There are edge cases where the AI gets to choose the targets for a TargetChooser that doesn't belong to it. I couldn't dig too long for the root cause, so I added a "return 0" when the case happens. Should probably open a ticket
- Added a "Hint" System in AI decks, to help the AI with its strategy. This is not really usable yet, it only works with abilities (not cards to play), and I only added some basic code for counters and tokens. This can probably be extended, but let's wait until we see it working on that other game I'm working on, before rushing into adding hints to all AI decks...
- minor cleanup of AI Code
2011-05-05 14:27:46 +00:00
wagic.the.homebrew
cd07248df5 UPDATE YOUR rules FOLDER!!!
- This is some Work in progress to make Wagic less "game" dependent.
This change especially is an attempt at moving away from some dangerous patents owned by some company.
It introduces "modrules.xml", a global configuration file describing dynamic settings for any given Wagic mod. It is very basic for now, but allows to customize a bit. In particular, it allows to remove the concept of shop and deck editor from the game, dynamically generate the main menu, and represent card activation with a mask rather than a rotation.
I have a sample in progress which I hope to submit in the days to come, a proof of concept (nothing fancy yet) for another type of game using these ideas, as well as a few other things I introduced recently.
In the future, I am hoping to extend modrules.xml so that it entirely describes the rules of a given card game. the other files in rules.txt will describe "extensions" to the core rules, just like they do right now, so this new file does not make them obsolete.


- Also fixed minor bugs I stumbled upon while developing
2011-04-29 17:30:57 +00:00
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
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
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
wrenczes@gmail.com
ab133e9f98 Err, stupid of me. Now passing in the PSPENV flag correctly... 2011-04-19 05:49:37 +00:00
wrenczes@gmail.com
7e884b53f9 Added a PSPENV environment variable to the psp make files. Also fixed a minor compile bug where the debug flag for psp forced JLOG support, which in turn enabled a JGE_LOG_FILE macro that has long since been removed from the code. 2011-04-19 04:35:42 +00:00
wagic.the.homebrew@gmail.com
60017a6652 Erwan
- replaced variables canPutLandsIntoPlay and landsPlayerCanStillPlay with a PlayRestrictions class.
- Added  seenThisTurn(TargetChooser * tc) in MTGGameZones, which allows to count how many cards matching a targetChooser have been in a given zone in the current turn. With minor work, this can probably be reused by the ability parser for some cards that need to count how many **** where played or put on the stack during a turn.
-- for example player->game->stack->seenThisTurn([put a TypeTargetChooser("creature") here]) would give you the number of creature spells cast by the player this turn.
- This is the first step of a refactor that aims at removing all the adhoc variables for "cant cast". I plan to get rid of the following variables in Player.h (and the associated code, which hopefully will become smaller):  
    int castedspellsthisturn;
    bool onlyonecast;
    int castcount;
    bool nocreatureinstant;
    bool nospellinstant;
    bool onlyoneinstant;
    bool castrestrictedcreature;
    bool castrestrictedspell;
    bool onlyoneboth;
    bool bothrestrictedspell;
    bool bothrestrictedcreature;

They will be replaced by the PlayRestrictions system, and hopefully I'll have time to update the parser to make this more generic as well.
My initial goal with this change was to move the limit of 1 land per turn outside of the code, and make it an external rule in Rules/mtg.txt. I have yet to do it.
2011-02-12 16:31:07 +00:00
wrenczes@gmail.com
df77cc584f Err, sorry, that's not fair - I was forcing this pspsdk change on everyone. Put it back to off by default - to turn on the signing, simply uncomment SIGN_PRX = 1 in the makefile. 2011-01-19 11:05:42 +00:00
wrenczes@gmail.com
0b16401c88 Some tweaks to support automatic signing of the wagic eboot on psp. To use, you'll need to unzip the mods I made into your pspsdk folder - you should end up with two utils in the bin folder, and some slight mods to the build.mak file (under pspsdk/psp/sdk/lib/).
(Erwan, pls give this a sanity check for me).

Nice side effect:  running the signed version seems to clear up a crash I'd get when putting my psp into sleep mode in the middle of a match.
2011-01-19 11:03:09 +00:00
wrenczes
ed321e2df5 Linux specific changes to allow linking against Boost::threads. Not used by the current build. Also turned off 'unused' warnings in QTCreator to match more closely the warnings that we pay attention to in the psp build. 2010-12-06 07:44:16 +00:00
linshier
c51321d292 Fixed makefile for Boost including on linux. 2010-11-20 15:13:16 +00:00
wrenczes@gmail.com
0c4b43a491 Added an additional clean option for stale versions of the precompiled header that might have been orphaned in the include folder. 2010-11-20 07:08:25 +00:00
wrenczes@gmail.com
e0872b852d Fixed the PSP build. Turns out that the make file wasn't properly cleaning out the .pch file when running make clean. Also renamed JgeRect to JRect for consistency with other class definitions in JTypes. 2010-11-20 06:34:13 +00:00
techdragon.nguyen@gmail.com
2a8f8074e6 New descriptive text popup feature for deck selection
http://wololo.net/forum/viewtopic.php?f=13&t=2423
2010-11-18 15:48:48 +00:00
jean.chalard
1317eb0d29 J :
* Add multilingual support for utf-8.
* Use japanese as a test case (removing the old tentative support).
* A number of shortcomings affect this code.
  + Bugs :
    - This splits algorithms used to determine the length of a string
      and to render it in two: either the string starts with an ascii
      char and the monobyte, variable-space algorithm is used, or it
      does not and a multibyte but fixed-space algorithm is used.
      This shortcoming also exists in the code to support chinese.
    - From the above comes the biggest limitation: any string that
      starts with an ascii character but include non-ascii characters
      will not be rendered correctly.
    - This does not and cannot support chars outside the BMP. This
      probably won't matter, ever.
  + Todos, fixmes, wishlist :
    - Single-width characters with diacritics are reported as
      double-space chars. It doesn't matter too much at the moment, but
      should be fixed in the future.
    - Font support currently only includes japanese.
  + Performance and compatibility notes :
    - Chinese code has not been switched to utf-8, to maintain backward
      compatibility. We should switch it at some point in the future,
      but ponder the right way to do it first.
    - Retaining the support for chinese with a non-international
      charset hurts performance (by making some methods uselessly
      virtual).
* Still, this generally works and is extensible (it can be used to
  implement korean, traditional chinese, etc, without any more code).
  Implementing languages with diacritics needs an improvement of the
  bool doubleWidthChar() method.
2010-11-14 16:24:29 +00:00
wrenczes@gmail.com
fe9c43bc81 Fixed the makefile - the precompiled header additions I previously made wasn't quite syntactically correct, causing unnecessary rebuilds of untouched object files. Now only touched cpps will be rebuilt as expected. 2010-11-13 08:53:22 +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
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
a458da051d refactored how manaredux coding works
replaced literals with constants in some places.
migrated some abilities out of headers and into implementation files.
2010-11-01 13:04:06 +00:00
techdragon.nguyen@gmail.com
911189da3d added DeckMenu and DeckMenuItem to the object list. 2010-11-01 11:01:08 +00:00
wrenczes@gmail.com
5a1e8e6ffe More reorganization work around CardSelector and the singleton pattern. Broke the source for the singleton into its own separate source file, to keep things clean. Also broke apart a circular header dependency: CardSelector defines and uses a SelectorZone, which is a member inside of CardView. CardView in turn is used heavily by CardSelector. Instead SelectorZone is now defined within CardView (where it's set & controlled anyway).
I've also added my current work on the zone navigation system (class Navigator) - it's currently turned off for now (the override for this is inside of CardSelectorSingleton's Instance() call, simply comment out the NEW CardSelector and uncomment out the NEW Navigator line.)  It's functional, but I want to do more testing before considering wiring it into the game options or something similar.  (Also, note that it currently doesn't support the mouse functionality added by DJardin.)

Lastly, there's a bug crash fix in ActionStack that I tripped across while testing - basically, an illegal index value would have us walk off the bounds of a vector.
2010-10-31 07:50:53 +00:00
linshier
eb043eba5d Fixed Makefile for Linux 2010-10-24 07:20:52 +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
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.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
d756005093 Erwan
- fix for issue 390 (tokens available in shop)
- added "log" features in makefile
2010-06-12 06:06:27 +00:00
wagic.the.homebrew@gmail.com
a3cbbedd3c Erwan
- fix issue 392 (broken tests)
- Fix a bunch of memory leaks (guys please be careful!)
- Added Logging facility in JGE
- HBL Compatibility (cleaned up some code with MP3 in JGE)
- Added "winGame" ability. Currently used mostly by the story mode, but some cards could probably need it too
- Improved story mode and uncommented it from the source.
-- The current campaign is of course very basic, anybody who wants to improve it or create other ones feel free to do so
-- TODO (short term): save progress, rewards system, improve tutorial campaign
-- I'll talk a bit more about this on the forums/email after a night of sleep
2010-04-26 14:27:34 +00:00