Commit Graph

99 Commits

Author SHA1 Message Date
wrenczes@gmail.com
a06558be55 Some warning cleanup involving (seemlingly unintended) bool to int conversions. It seems that the original design intent was to pass down IDs to the base class JGuiObject, but certain classes broke the pattern with their constructors.
(One could argue that this ID is completely meaningless and could be entirely ripped out, as the IDs obviously never made it to their intended target...)
2011-06-02 05:33:45 +00:00
wrenczes@gmail.com
15fa0e6c34 Fixed a loud warning. 2011-05-28 02:28:07 +00:00
Xawotihs
f2a52edba7 - wait for SDL events intead of pooling them, this allow very smooth CPU usage
- added texture deactivate around each renderer call implemented in opengl es 1.1. It fixes a couple of artifacts but a couple are remaining
- added a compilation switch to allow simulation of opengl es 1.1 on desktop
2011-04-25 21:26:12 +00:00
Xawotihs
832904dce1 - Defined keys translation for SDL config
- Added boost thread files, that fixes all the threading/compiling/linking problems on Android ...
- Added opengles 1.1 code, there are still some bugs I need to tackle ... and I should realy split this file now !!!
- Added Android debug traces
- Hardcoded resources to "/sdcard/Wagic/Res" for the moment on Android
- Added a wagic SDL project for desktop, and the related SDL frontend used for Android. This frontend is currently mostly desktop based, it needs some work to be fully useable with touch and gesture on Android.
2011-04-23 21:30:36 +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
omegablast2002@yahoo.com
d06965d95e added tha menu constants variables to fix compiling on vc2008, i guess free version doesnt add it automatically or something becuase mike was able to compile without them 2011-04-20 20:40:28 +00:00
Xawotihs
40958170fa Fix to have r3450 at least compile on linux 64 bits 2011-04-19 19:04:12 +00:00
wrenczes@gmail.com
79835dda33 Slight modification to the DebugTrace calls so that if compiling against debug on psp, the call becomes std::cout. This allows the debug trace calls to mirror out to the console window that's running pspsh. 2011-04-19 04:48:42 +00:00
wrenczes@gmail.com
98220afb46 Something that's been bugging me for a while, and I finally decided to do something about it: fullscreen toggle never worked on Windows. I've now made the F key do a three-way toggle between lo-res (ie standard psp resolution), hi-res (psp resolution doubled, so 960 * 544), and fullscreen (well, not exactly fullscreen, it's a window sized to your desktop's work area; if you have a weird sized desktop, you might get clipping). 2011-04-11 00:30:50 +00:00
wrenczes@gmail.com
8add655df7 Formatting cleanup, modified a function to pass by const reference. 2011-03-31 11:08:58 +00:00
wrenczes@gmail.com
e7f2ae4e6e Added a Boost::recursive_mutex variant to the threading support. Also bumped up the default stack size of a worker thread to 256K, and moved the thread priority slightly down as 0x12 is pretty aggressive for a default value. 2011-03-31 10:37:41 +00:00
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