Commit Graph

332 Commits

Author SHA1 Message Date
Xawotihs
84a074aede Added action logging during attack/block of the AI player. To do that, I wrapped some of the direct access from the player to the action layer into the game observer.
First version where I managed to finish a normal game while undoing several actions until the end. There are still some problems in direct damage spells and interruption management. I added several assert in the code to catch them.
2011-10-16 22:16:47 +00:00
techdragon.nguyen@gmail.com
28069e980b modified iOS touch algorithm to match Android deployment. 2011-10-15 13:48:57 +00:00
techdragon.nguyen@gmail.com
6f10ef8425 fixed last check in. Test suite passes. Added comments on possible null pointer exceptions.
Updated XCode project file to include AIPlayerBaka classes.
Added test suite to iOS build
2011-10-09 05:51:45 +00:00
techdragon.nguyen@gmail.com
fbe2e44814 fixed memory leak in double tap gesture
fixed some compiler warnings
removed dead and useless code
2011-10-08 00:56:07 +00:00
Xawotihs
35030ca2ce - Fixed buggy implementation of JGEGetTime on Qt
- cleanup up link between wheelmouse and scroll events
- added support for pause/resume
2011-09-25 14:20:55 +00:00
wagic.the.homebrew
fe88b747c0 - fix for ACounterTracker (this fixes the ability - it wasn't working before - as well as the memory leak)
- fix "release" build in VC++
- Let AI play creatures with ACounterTracker by making that ability a "positive" one (used for MotD)
2011-09-23 10:24:20 +00:00
Xawotihs
bb65d2dc12 - various compilations fixes for Symbian
- small cleanups of the TestSuite and Player classes
2011-09-19 19:49:45 +00:00
wagic.the.homebrew
c96d2fea55 Fix for issue 734 (creating profile on a fresh install is completely broken.) 2011-09-17 08:42:13 +00:00
wrenczes@gmail.com
f46ec14ce6 Fix for the mouse lag on windows. The issue with the mouse events lagging badly is that the while loop on SDL_WaitEventTimeout means that we'll wait consecutively 10 ms per mouse event, so we get flooded & never call onUpdate until the mouse stops moving. Replaced the gate with a simple for loop that guarantees that we call onUpdate at least once every 50 ms. We can try to tweak the value for better framerates, but this value seemed to be in the right ballpark. 2011-09-11 02:41:14 +00:00
techdragon.nguyen@gmail.com
4e963c168f added gesture recognizers for all keys.
refactored some of the initialization code
left place holder for Zoom in/out with pinch recognizer.  The idea here is to make a virtual function like OnScroll for Zoom so we can take care of the zoom features natively.
reorganized some of the method declarations.
2011-09-09 19:03:45 +00:00
Xawotihs
98709e661e Modified the running loop to avoid consumming 100% CPU in pause on Android. 2011-09-06 14:03:27 +00:00
Xawotihs
507552133d Android sound support using openSL ES. Now depends on SDK version 9. 2011-09-04 13:52:39 +00:00
techdragon.nguyen@gmail.com
ad72c0ddc3 adjusted controls for Touch interface on iOS.
* Single Tap now implemented
* Touch and Hold (2 secs) to pop up menu
* added a pan gesture to simulate flicking up/down and left/right
* removed dependency on binding keys to game for iOS devices. (perhaps extend this to all touch devices.)
* flicking motion needs to be expanded to allow for smooth scrolling. Right now every flick is equivalent to going one slot up/down/left/right.
2011-09-04 08:31:36 +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
024c30d909 Added user and system path for QT_CONFIG, added meego policy file, updated meego rules file, removed now useless Meego Res.txt file 2011-08-21 18:55:16 +00:00
wagic.the.homebrew
cb0f2b373f - Fix a bug where JFileSystem would return duplicate results in function scanfolder (can lead to "card id collision" in the previous builds) 2011-08-21 12:53:57 +00:00
wagic.the.homebrew
87d60cd79e - Improper GetfileInstance calls were preventing from correctly initializing the JGEFileSystem (Todo: init earlier, prevent from calling GetfileInstance if not initialized ?)
- fixed a problem with the test suite
2011-08-21 10:04:38 +00:00
wagic.the.homebrew
37c6b06ee0 - removed broken support for non "stored" zip files for card images 2011-08-21 09:43:00 +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
Xawotihs
2c34a88ff0 Reuse swipe code of Android with Qt, associate "swipe left" to "other cards" in the shop. 2011-08-14 18:13:28 +00:00
Xawotihs
c188b4d104 Fixed "Werror" related compilation problems on Linux and Meego. 2011-08-14 18:09:02 +00:00
Xawotihs
30f8304918 Meego harmattan support, swipe down for cancel/interrupt, swipe up for next phase/combat assignment, tap&hold for menu, deactivate refresh when windows is not active. 2011-08-11 22:26:07 +00:00
Xawotihs
88157d7c95 Fixed compilation problems in non-PSP, non-FMOD, non-Phonon cases 2011-08-10 20:56:51 +00:00
Xawotihs
59b7432e74 Fixed builds broken in r3807 2011-07-21 19:44:52 +00:00
Xawotihs
e09fe7570e Fixed Phonon sound support. 2011-07-19 21:28:46 +00:00
Xawotihs
9dccc885d6 Updated the Qt project to work on Desktop/Maemo/Meego/Symbian. Removed all dependencies except Qt and OpenGl. 2011-07-17 18:18:17 +00:00
wagic.the.homebrew
3148a25f3a - Manual cache cleanup in the menu to help a bit with issue 693. This is unfortunately not enough, we are dealing with ram fragmentation problems here :( 2011-07-10 13:51:39 +00:00
wagic.the.homebrew
acca910248 - Fix for issue 699 (sound effects stop working after a few minutes on the PSP) 2011-07-10 07:51:03 +00:00
wagic.the.homebrew
0661918ed6 - Additional fix for issue 465
-- The problem was that the previous fix for keybindings actually fixed dead code for the PSP version... the real call to Defaultbindings was still happening in JGE's code...so the fix made the call twice.
-- Note: shouldn't we use ResetBindings instead of JGECreateDefaultBindings? The former resets the bindings before assigning the default ones...
2011-07-10 06:52:07 +00:00
jean.chalard
93d96fe52b Revert a careless change
Seems I did something wrong with SVN. Revert the changed parts
that should not have been changed.
2011-07-07 03:41:51 +00:00
jean.chalard
c5cd81f6a1 Fix the double key bindings problem.
The problem was, the game would initialize first, reading the
keybindings from the configuration, and THEN set up the default key
bindings.
I think this affects only PSP, X, SDL and Qt. A quick scan of the
windows version code looks to me that the order is correct and the
problem should not exist, but I may be mistaken. The iPhone version
looks to me like it has no keybindings at all, though the call is
there ; I put the call in the right order so that the problem does
not happen in the future if we implement some key bindings for it.
If someone can check for windows...
2011-07-07 03:35:26 +00:00
Xawotihs
bfa9b6c813 Fixed issue 691. 2011-07-01 21:59:35 +00:00
Xawotihs
8f9619e21a Added support for wheel mouse events 2011-06-27 21:18:16 +00:00
wrenczes@gmail.com
741f662bb0 Tied in my recent Android flick gesture addition to a Scroll() function. GameState now has a virtual function OnScroll() call that, by default is a no-op; each game state can choose to override how to respond to flick gestures. I've added one such override in the Deck Editor so that a flick up/down acts like the psp button up/down for scrolling between color filters. 2011-06-15 09:52:11 +00:00
wrenczes@gmail.com
e1dc1afa74 Another usability improvement to the touch interface: added a timer for the delta between finger down/up. A 'tap' has to be under a 1/4 second for it to act as a double-click. 2011-06-15 09:01:26 +00:00
wrenczes@gmail.com
9e6154076b Added the concept of a 'flick' gesture. This uses the VelocityTracker object in Android and passes the velocity info down as an SDL joystick trackball event. We can then reinterpret this event in whatever way we like, such as up/down swipes in the deck editor (that was my initial thought, at any rate).
TBD:  right now every up finger generates this event.  We probably want to throttle it to only be an event if the velocity exceeds some arbitrary threshold;  similarly, if we generate a flick event, we probably don't want to simultaneously generate a finger up action (ie JGE_BTN_OK).
2011-06-11 10:30:38 +00:00
wrenczes@gmail.com
b2eaa3cb8d Multiple finger events now translate correctly into an SDL_MULTIGESTURE. I still haven't mapped this into anything meaningful, but all least the wiring is now present. 2011-06-11 09:03:21 +00:00
wrenczes@gmail.com
56a8bed0e3 More work on Android touch events. Fixed the issues I was having with busted float coords, and added some logic for a different way to deal with selection. Doubleclicking is no longer required; instead, if you generate a finger up event within 50 pixels of where you fingered down, this will be treated as an JGE_BTN_OK event. I think this feels more natural, as you can drag around in a menu or to various cards; then when you find your selection, simply touching it again once triggers the selection. 2011-06-11 06:59:32 +00:00
wrenczes
97dfc9f4bc Fix up passing by address on the float values. This is leftover crud from my attempts to pass float* instead of by value. I still can't make sense of what's wrong with the FingerDown calls - the mouse calls pass values in correctly, but the touch calls seem to corrupt the stack. 2011-06-08 09:57:43 +00:00
wrenczes@gmail.com
c859d35c0b More incremental work on getting touch commands on Android. I've pinpointed a nasty problem that looks possibly like a compiler bug - the float values that are passed into SDL_SendFingerDown() are coming out junk on the other end. Probably an extra push of something on the stack, as when I tried using pointers to floats instead, the y value showed up in the x position. 2011-06-07 16:43:44 +00:00
wrenczes
f7cad41013 Checkpoint on getting touch events to come through SDL. This (deliberately) breaks the mouse emulation & cripples input on Android, as those calls are being replaced with real finger down/up/motion commands instead. More to come... 2011-06-07 00:32:26 +00:00
wrenczes
92dd1f2d40 Cleanup - unused files. 2011-06-07 00:27:13 +00:00
wrenczes@gmail.com
bed971c84c Last of my warning cleanup - as of this revision, all warnings in the windows build are gone. I've turned on the 'treat warnings as errors' option in the mtg project to mirror our makefile behaviour on psp. 2011-06-03 01:07:48 +00:00
wrenczes@gmail.com
5b8ecd0cf7 More warning cleanup - converted certain class functions to return bool instead of int where appropriate. Also fixed the sdl update() tickCount assignment that I just broke in my last checkin. 2011-06-02 07:01:42 +00:00
wrenczes@gmail.com
4018d17370 more compiler warning cleanup. 2011-06-02 05:48:37 +00:00
wrenczes@gmail.com
382fb5969d Reverted out changes to JFileSystem - WIP, not meant for the tree yet. 2011-06-02 05:39:06 +00:00
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
0476eaf5f3 Reimplemented the 3 way 'F' toggle for psp size / double psp size / fullscreen in the SDL code path. 2011-05-28 07:13:13 +00:00
wrenczes@gmail.com
15fa0e6c34 Fixed a loud warning. 2011-05-28 02:28:07 +00:00
Xawotihs
58577bb7ec Fixed SDL full screen mode. Couple of cleanups. 2011-05-27 20:56:50 +00:00