187 Commits

Author SHA1 Message Date
wrenczes@gmail.com
d934d9d30f Fixed a compilation problem on PSP with the minpspw 11.1 SDK, which changed the definition of a u32 from unsigned long to unsigned int. 2011-03-28 04:40:44 +00:00
Xawotihs
f9be0a6341 - reworked completly the JNetwork, JSocket interface (had to ifdef out the PSP socket code)
- added 2 menus to wait for connection and wait for deck selection
- tested compilation on Qt Linux, Qt Windows and PSP
- deactivated everywhere (NETWORK_SUPPORT to activate).
2011-03-13 21:19:02 +00:00
wrenczes@gmail.com
baf0343063 Makefile changes in JGE to include the boost path. Added a missing include dependency on shared_ptr. 2011-03-02 09:26:31 +00:00
wrenczes@gmail.com
297f87eb04 Fixed relative path includes of JGE headers. 2011-03-02 09:04:31 +00:00
wrenczes@gmail.com
9901329caf Moved Threading.h into JGE so that it can be used at that level. 2011-03-02 08:14:47 +00:00
wrenczes@gmail.com
1c228aba7a Make the ToHex() util function always available, instead of debug only on win/linux. Useful for tracing addresses in psp log files... 2011-03-01 08:53:15 +00:00
wrenczes@gmail.com
f2cbd883a6 Apply LF line endings as an SVN property, this time on the JGE source files. 2011-01-28 06:03:52 +00:00
Ittobaal@gmail.com
7eaa30e996 add newline @ end of JLogger.h 2011-01-16 17:48:11 +00:00
Xawotihs
b3fb8022a0 Deactivated the QImage code as it causes problems on win7 and vista. This implies that the Qt version still depends on libjpeg, libpng and libgif 2010-12-23 07:57:50 +00:00
Xawotihs
7a0bf2c78c Changed the Qt images to load in buffers using dimensions multiple of power 2. Simplified the memory management as well. 2010-12-22 22:20:20 +00:00
Xawotihs
ae9ae7783b gcc does not like iomanip stuff without namespace around 2010-12-16 18:24:39 +00:00
wrenczes@gmail.com
87909bed08 Fix for issue 550, heap crashed game in turn 6.
The core problem I fixed was in CardView's (missing) destructor - on construction, a CardView will set itself as a member of its parent CardInstance, so it stands to reason that when it's about to be destroyed, it should do the inverse and remove itself in the same fashion from its parent.   This explains why weird graphic glitches were seen when casting Animate Dead on cards in a graveyard - the position data it was trying to use was already deleted from memory (a cardview is deleted on cleanup at the end of a turn if it's gone to the graveyard), but no one nulled out the deleted card view reference from the instance, so we'd access invalid data.

Some peripheral changes in this checkin:  two helper functions in CardGui (GetCenterX, GetCenterY)  that are part of my navigation patch are included.  They're unused in the current code base, so this has zero impact. (I'm only checking them in as it's more work than it's worth to refactor them into a separate changelist.  The core of the nav patch requires my mods to Closest.cpp / CardSelector.cpp to have any effect.)  I also included a helper function in the debug routines to spit out hex pointer addresses in trace outputs, which I used to chase down this bug.
2010-12-16 09:32:42 +00:00
Xawotihs
01ac3d1a55 - cleanup image dependencies in QT project 2010-12-11 22:46:15 +00:00
Xawotihs
488a055736 Added code to use Qt instead of libpng, libgif and libjpeg. Deactivated for the moment (works fine on Linux). 2010-12-04 14:19:09 +00:00
Xawotihs
fb75d31887 activated log on iOS 2010-12-04 14:15:29 +00:00
wrenczes@gmail.com
2693f35506 Fixed the graphics whiteout bug I introduced when switching profiles. When Refresh() was being called on the texture, the bitmap wasn't been re-transferred back into the openGL context.
While debugging this, I noticed a separate issue:  when changing profiles, we'd actually call refresh twice.  Removed the spurious call, as reloading profiles doesn't need to concern itself with the image cache - that's already covered by the game options menu.

Also did some minor formatting / cleanup in the JGfx code for PSP - stubbed out a bunch of JLOG calls I had put in while debugging the PNG loading code.
2010-12-02 04:04:03 +00:00
wrenczes@gmail.com
a0427d99df These files were meant to be part of the previous checkin. I blame AnkhSVN yet again. Someone needs to write a Subversion tool with proper changelist support! 2010-12-01 07:20:26 +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
Xawotihs
3725958fc3 Fix mouse support in menus and first screen 2010-11-20 00:33:37 +00:00
Xawotihs
8339cdd3b3 iOS compilation fixes 2010-11-19 23:16:31 +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
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
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
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
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
wrenczes
858950fb9d Incremental fix on my Navigator work - switched out global to JGE vars actualWidth/Height to be real accessible members of the JRenderer instance, so that we can actually access what the real display width is from within the MTG project. This makes the fix for enchantment zone targetting work when the window is resized on Win32. 2010-11-02 04:07:25 +00:00
wrenczes@gmail.com
832f11c153 Switched the managed JQuad container implementation from a vector to a map. This speeds up the cache lookup time from O(n) to O(log n). Hard to see a noticeable difference on win, but it definitely feels snappier on my psp, for instance, when browsing your library for a card, or your graveyard, etc.
I'm also noticing that the GetQuad(int) variant never seems to get hit, so I suspect that the ID lookup map is redundant.  I left it alone as the JResourceManager base class forces the need for the function; I need to spend more time looking at just how much of JResourceManager we actually use at this point.
2010-10-17 16:54:08 +00:00
Xawotihs
75b8a0c328 Added support for left mouse click 2010-10-10 21:57:27 +00:00
Xawotihs
fb484f0f00 Removed X dependency when compiled with Qt 2010-10-07 21:40:09 +00:00
wrenczes@gmail.com
9c982475fe Some minor casting issues that trip up the 0.9.6 pspsdk when compiling. 2010-10-06 09:22:44 +00:00
wagic.the.homebrew@gmail.com
3965505b15 wololo
- Adding DJardin's port to N900
2010-09-16 13:12:05 +00:00
wagic.the.homebrew@gmail.com
fd8645d1a4 Erwan
- JGE updates : main accepts argv/argc. Compilation variables for MP3 and Network support
- Minor fix in Wagic (potentially fixes crashes when using activated abilities several times in onr turn. Couldn't reproduce the issue)
2010-07-11 10:56:12 +00:00
wagic.the.homebrew@gmail.com
0149512412 Erwan
- fixed bugs introduced in revision 2034 (Giant Growth)
- Extended Story mode xml: much easier to write basic thing, font selection, possibility to position answers, answers now in correct order
- moved story in the menu because it is not major for now
2010-05-06 13:47:56 +00:00
wagic.the.homebrew@gmail.com
b0e92d68a8 Erwan
-missing files (JLogger)
2010-04-26 22:47:46 +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
jean.chalard
c2549af81d J :
* Make the FULLSCREEN function bindable on platforms that support it.
* Linux has F as default binding.
* Windows support is not implemented, but is there ; applications will
  just not suggest it under windows for the moment.
2010-02-28 12:31:51 +00:00
jean.chalard
4248ddd3a0 J :
* Preparation for auto-repeat-stopping code.
2010-02-25 20:00:53 +00:00
jean.chalard
79d142f968 J :
* Some cosmetic cleanup.
* Have the unix version report analog control the same way the
  windows version does.
* Move back Run() into JGE::Run(). The code for ::Run() is still
  inside main.cpp.
  - This fixes the "blinking screen problem", issue 341. I think.
  - I have no idea WHY it does, but it's better than not fixing it.
  - Run() would be better in ::Run() in main.cpp than in JGE, should
    be moved back when we know more about the problem.
2010-02-24 18:28:36 +00:00
jean.chalard
39c5a3d465 J :
* Fix u32 into JButtons.
* Add a few comments.
* Remove useless variables.
2010-02-24 17:28:17 +00:00
jean.chalard
ad933ecdf6 J :
* Change the name of a define to harmonize stuff.
2010-02-18 20:09:19 +00:00
jean.chalard
3c1377fe47 J :
* Re-add the ReadLocalKey function that I had forgotten to
  re-implement with the key bindings.
2010-02-18 07:18:21 +00:00
jean.chalard
4f0a2794d1 J :
* Remove useless, deprecated, and ill-willed files
2010-02-14 14:02:08 +00:00
jean.chalard
56ce4a14ae J :
* Create the subsystem for keybindings.
2010-02-14 13:21:12 +00:00
wagic.the.homebrew@gmail.com
3f06c9b6c9 Erwan
- put sound back on WIN32 platform (J please review)
- Added menu text for token abilities (needs testing)
2010-02-06 03:21:38 +00:00
jean.chalard
23ddb6f7e2 J :
* Add a newline
2010-02-02 10:56:45 +00:00
jean.chalard
4f0a264146 J :
* Add a method to abstract the file size.
2010-02-02 09:11:44 +00:00
jean.chalard
02e3932017 J :
* Fix linux compilation that had been broken by the last update.
2010-02-02 08:34:54 +00:00
jean.chalard
18c18822c9 J :
* This update has Wagic compile and work under Darwin 64-bits.
  - Linux 64-bits is expected to compile and work from now on, but
    was not tested. As with before, Linux 64 bits can still run
    the 32 bits version.
  - Darwin version is not using Carbon but X emulation.
  - 64-bits versions have no sound because there is no 64-bits
    version of fmod.
  - Windows 64-bits probably does not compile. Windows 64-bits can
    still run the 32 bits version.
  - Darwin 32-bits probably does not work at the moment because the
    libfmod requires another name to work on Macs, but as 64-bits
    disables it it works.
  - Other unix flavors are expected to work as long as they have
    a working OpenGL library, X11, and *either* 64-bits *or* a
    working fmod. Thus in the practice Tru64, Irix and the like
    probably work, as should FreeBSD and other BSDs in 64 bits
    versions, but 32 bits versions will search for a non-existing
    fmod. All of this is pure conjecture and none was tested.
  - All 64-bits versions have no sound.
  - The mac version does not display the particles at the moment.
    This is not critical, but the cause is unknown yet. I would
    like to know if other 64 bits unices share the same bug or if
    it is mac-specific.
* Test is needed in particular to see whether the program still
  compiles and works in Linux and PSP. Windows is probably all
  right, but compiling PSP in windows may be broken by this
  update.
2010-02-02 08:27:10 +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