Commit Graph

218 Commits

Author SHA1 Message Date
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
3cb652087d iOS frontend and XCode project 2010-12-12 15:58:47 +00:00
Xawotihs
01ac3d1a55 - cleanup image dependencies in QT project 2010-12-11 22:46:15 +00:00
Xawotihs
594b3abf1e Qt project fixes on Mac 2010-12-06 22:30:25 +00:00
Xawotihs
e8f5d2d349 iOS texture management fixes 2010-12-06 22:25:28 +00:00
Xawotihs
13f467a9ef Activated QT image support, removed freetype, jpeg, png, gif libs dependencies in the Qt project. 2010-12-06 20:06:03 +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
92bbb78ed1 Fix for [PSP|PC]ability menus and card view switch causes a crash. This broke as a side effect to the addition of the 'details' option that Mike added - the ActionStack had very rigid interpretations of what a valid control ID would be (either -1, or a valid id in its container). As kInfoMenuID is assigned a value of -200, this would crash when attempting to look up that index value in the vector.
I've patched the problem so that ActionLayer checks for a valid ID before doing anything, and does a no-op for IDs it doesn't know how to handle. However, this only fixes the problem during gameplay.  It's quite possible that hitting the triangle button in other places in the app might equally cause a crash.


Issue: 544
2010-12-04 04:25:43 +00:00
wrenczes@gmail.com
4b7e024ce6 added DebugRoutines.h to the JGE VS2010 project. 2010-12-03 09:51:12 +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
linshier
aa6aa20ba5 Fixed left offset parameter handling for center/right align string drawing. A brief note about string drawing, offset and display width is added in the WFont.h 2010-12-01 08:01:13 +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
3a927dace9 Scope checkGlError() calls to be only active in debug targets (no-op in release). 2010-12-01 05:28:01 +00:00
Xawotihs
4f54425fb3 Added return and esc key as binding to MENU 2010-11-27 16:08:11 +00:00
Xawotihs
4951442499 Improved texture loading on iOS 2010-11-25 23:18:57 +00:00
Xawotihs
8d758d4775 Changed fps on desktop to run at 200 fps, changed mobile to start in
fullscreen
2010-11-22 22:58:57 +00:00
linshier
4c7b4f4df9 Fixed texture binding in JRenderer. Note that if we want to bind or rebind a texture, we should set mCurrentTex to the target texture id first. Otherwise, it can cause some display bugs in some situation as BindTexture() tracks down the mCurrentTex for an optimization. 2010-11-21 16:09:45 +00:00
linshier
bf3d01ae74 Added linebreak support for JTTFont in JGE. 2010-11-20 15:40:53 +00:00
linshier
deea874591 Fixed the setsize bug for JTTFont in JGE. 2010-11-20 15:24:11 +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
wrenczes@gmail.com
76d5b57c1e More VS2010 configuration changes - includes a boost include/lib path (not currently in the trunk), and new file additions/deletions. 2010-11-19 07:14:19 +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
8ad597f565 Fixed the swizzle functions for the PNG loading support in JGE. (This is a psp-only fix, it has no impact on the win build.)
This is the main fix for the situation where we try to load PNGs after the image cache has been saturated - instead of requiring 1 Meg as a temporary buffer to perform the swizzle operation on a full image (ie 512 * 512 texture size), these mods allow the swizzle to work in line with a temp buffer of  512 * 8 lines (ie 16K of memory).  I also fixed a case where the swizzle didn't operate correctly on PNGs that weren't an even multiplier height of 8 - we'd drop the remaining lines on the floor, creating garbage lines at the bottom of those images.
2010-11-10 23:50:26 +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
3525696523 Fixed the build - missing file from my last submit. 2010-11-09 23:17:40 +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
Xawotihs
1bde7b1dea Make it at least compile ... 2010-11-05 07:20:01 +00:00
wrenczes
5799ebb0e2 Same actualWidth/Height changes for QTmain. 2010-11-02 04:08:05 +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
Xawotihs
44e097e88c reduced framerate to 30 fps, stopped refreshing the UI when the window is hidden or when the screen is off. 2010-10-19 22:09:16 +00:00
wrenczes@gmail.com
d35367503d Modifications required to build against the latest (0.10.0) PSPSDK. Note that this is a breaking change, these mods are not backwards compatible with the 0.8.9 version of the PSPSDK.
To download the latest Minimalist SDK, go here:

http://sourceforge.net/projects/minpspw/
2010-10-19 08:45:36 +00:00
Xawotihs
0789d6e7e9 Activates mouse tracking 2010-10-18 20:25:01 +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
wrenczes@gmail.com
7e780e18c1 For the windows version, if running with fullscreen disabled, center the main window instead of creating it top-left all the time.
Also renamed WindowRect to windowRect & PixelFormat to pixelFormat for consistency with other locally declared variables.  (Uppercase should be reserved for class names, ie WindowRect is the class/struct, windowRect is an local object in your code.)
2010-10-16 15:28:41 +00:00
wrenczes@gmail.com
0ef555dca9 Minor tweaks to the VS2010 project files, including turning down the code analysis verbosity. 2010-10-16 15:20:27 +00:00
Xawotihs
0abe60542a Fixed Qt project on windows 2010-10-16 12:19:44 +00:00
Xawotihs
e342103204 Added support for left mouse click and zoom buttons 2010-10-10 21:58:02 +00:00
Xawotihs
75b8a0c328 Added support for left mouse click 2010-10-10 21:57:27 +00:00
Xawotihs
7439d81454 Work around issue 457, not fully fixed. 2010-10-09 10:36:42 +00:00
Xawotihs
fcb8aeaa28 Added error handling and moved glEnable(GL_TEXTURE_2D) to fix issue 484 2010-10-09 10:18:59 +00:00
Xawotihs
977257aee3 moved glEnable(GL_TEXTURE_2D) to fix issue 484 2010-10-09 10:08:59 +00:00
Xawotihs
fb484f0f00 Removed X dependency when compiled with Qt 2010-10-07 21:40:09 +00:00
wrenczes@gmail.com
df2b145a42 Minor project changes - use a vsprops file to locate the extra includes instead of requiring folks to manually copy dirent.h & stdint.h into your VC include dir. 2010-10-07 04:06:16 +00:00