aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/game.cpp
AgeCommit message (Collapse)Author
2010-01-25Strip trailing spaces/tabs.Johannes Schickel
svn-id: r47541
2010-01-10Handle properly shouldQuit()Robert Špalek
svn-id: r47215
2009-12-09Silence gcc warning.Johannes Schickel
svn-id: r46326
2009-12-09DRACI: Reduce header interdependencies; some cleanupMax Horn
svn-id: r46320
2009-11-30Removed <cmath> includes since a) not a part of Symbian OS b) Compiles fine ↵Lars Persson
without it (at least with Symbian OS GCCE 3.4.3 and CW 2) svn-id: r46213
2009-11-28Hopefully fix switching to the map right after switching the locationRobert Špalek
It seems that the mouse was simply on the below line and triggered the switch to the map without the user realizing. svn-id: r46171
2009-11-22Move setIsReloaded(false) in enterNewRoom() to the right place.Robert Špalek
Last commit moved it below, but that cancelled GPL2 programs run right after loading the game. svn-id: r46099
2009-11-22Remove obsolete and unneeded logic bypassing reloading a location.Robert Špalek
I have tested that this could only possibly happen when the game has been loaded with last location being the map. Then pressing Escape calls enterNewRoom() and this superfluous optimization takes place. It is harmless to simply reload the map. After having removed it, enterNewRoom() needs not return any return value, because the test at the tail can be done by the caller. I have then restructured the code a little to make it cleaner. svn-id: r46098
2009-11-22Further cleaned up the hack with removing old animations.Robert Špalek
Now only a long-term (complete rewrite) TODO is left in the code, but nothing urgent to solve. svn-id: r46097
2009-11-22Make sure hands are empty after loading the gameRobert Špalek
(otherwise we could have in our hands an unreachable object). This works thanks to moving clearing _currentItem into putItem(), which gets called in inventoryReload(). svn-id: r46096
2009-11-22Clearing object animations in a cleaner wayRobert Špalek
Verified that we really do not need object animations even if they are in a different location, and clearing them thus regardless of their location. Although the game was not crashing due to previous work-arounds at this moment, this cleanup obliterates the most horrible hack and makes sure animations will never get stale. svn-id: r46095
2009-11-22Fixed assert() on already loaded animationRobert Špalek
Now the game seems fully playable with crazy loading all the time, even though it is a hacky solution. Updated the TODOs svn-id: r46094
2009-11-22Updated an urgent TODO to make the game playableRobert Špalek
svn-id: r46070
2009-11-22Fix SIGSEGV by an absolutely brutally horrible hackRobert Špalek
I have thoroughly documented why this hack is needed and added ideas how to fix it properly. svn-id: r46068
2009-11-22Opening the inventory stops hero walkingRobert Špalek
(otherwise the relative animation would repeat itself unhandled until the hero disappears from the screen.) svn-id: r46058
2009-11-22Fix positioning of one-time hero animations.Robert Špalek
With the previous code, the position of the animation was doubled (due to counting the position twice, the second time being a relative shift), which put it mostly outside the screen. This is because one-time hero animations are actually stored using absolute coordinates. svn-id: r46057
2009-11-21Fixed re-entering the same room using a different gateRobert Špalek
svn-id: r46044
2009-11-12Handled loading/saving from the map locationRobert Špalek
svn-id: r45876
2009-11-12Implementing switching to/from the map room by mouseRobert Špalek
svn-id: r45872
2009-11-12Display/remove the inventory based on mouse "gestures"Robert Špalek
svn-id: r45855
2009-11-12Removed 2 TODOsRobert Špalek
svn-id: r45851
2009-11-12Added runWrapper() calling run() and some actions around it.Robert Špalek
This simplifies a lot of code calling run(). Also, scripts called from the inventory are now called with disabled mouse and title, as desired. svn-id: r45848
2009-11-11Cleaned up searching the closest point.Robert Špalek
The old comments were completely misleading although the algorithm was good. svn-id: r45824
2009-11-10Fixed walking to unreachable positionsRobert Špalek
svn-id: r45823
2009-11-10Fixed two bugs.Robert Špalek
Putting items back to the inventory into clipped coordinates, and exiting running GPL2 programs when the game engine it to be interrupted. svn-id: r45822
2009-11-10Huge refactoring of data structures.Robert Špalek
Replaced IDs of objects by pointers, which saves many lookups, each of which is horribly ineffective. Moved a lot of code into methods of structs now turned into objects. Tested the new code a lot and seems to work as well as the old code. svn-id: r45799
2009-11-08Fixed aligning items in the inventoryRobert Špalek
svn-id: r45764
2009-11-08Items put into inventory are placed correctly.Robert Špalek
Also, named correctly GPL2 parameter types. This fixes all FIXMEs svn-id: r45762
2009-11-08Fix running clearing IsReloaded().Robert Špalek
Currently, if gate programs used loop(), they exitted immediately due to not having cleared this flag. svn-id: r45753
2009-11-08Fix enabling mouse cursor when entering a room.Robert Špalek
It used to have a wrong palette. svn-id: r45749
2009-11-08Do not immediately clear the path when it has just 1 vertex.Robert Špalek
This fixes the previous bugfix, which causes that I could not re-run the same program (e.g., by repeatedly clicking on the hollow tree) if the hero did not move at least one pixel. svn-id: r45747
2009-11-08Tuned Z-coordinate of the dragon.Robert Špalek
Adding +1 made the dragon sometimes flip before an object when it should have been behind. svn-id: r45745
2009-11-08Debugged smooth walking except for 1 bug.Robert Špalek
Adjusting to the edge is done such that it respects slight sideways movements of the dragon. Fixed rounding issues in the whole game. Improved debug messages. Made sure that the dragon does not turn like crazy around when clicking on the same pixel: the final point is always the clicked one although the middle points made by shifted to make the animations smooth, and preserve the dragons direction if he has not walked. There is a bug with running turning animations as they seem to disappear for 1 frame and have incorrect Z coordinate. Will investigate it next. svn-id: r45742
2009-11-07Debugged updating the position of the hero during walking.Robert Špalek
I project the hero immediately to the end of each edge for the time being though. svn-id: r45722
2009-11-07Add helper functions to retrieve dragon position from the animation.Robert Špalek
To implement proper walking, I have to respect the relative shifts defined by the sprites as opposed to apply some constant velocity. svn-id: r45714
2009-11-07The hero turns the right direction after walkingRobert Špalek
svn-id: r45713
2009-11-07Implemented relative animations.Robert Špalek
In these animations, each sprite can specify a relative shift with respect to the previous sprite. Moving animations (such as walking of the dragon) are easily described in this framework. I have sort of hacked their support and it seems to work. The current walking code does not interact with the new code yet, but it will be easy to do. svn-id: r45712
2009-11-07Done research on ignored animation flags and commented the codeRobert Špalek
svn-id: r45711
2009-11-06Add safe-guard against collision of animation IDs.Robert Špalek
When debugging another issue, I preloaded all animations, and horrible things happened that I debugged for a few hours. svn-id: r45695
2009-11-05Fixed several gross walking bugs.Robert Špalek
- SIGSEGV by not stopping walking when changing rooms - reset of the mouse cursor and object title during gate scripts - updating the previous animation phase, also when starting new animation - swapped up and down animations svn-id: r45690
2009-11-05Implemented proper walking.Robert Špalek
First shot, not debugged yet, but seems to work (even though a bit hairy)! svn-id: r45688
2009-11-04Properly animate the last phase of the walk before running callbacksRobert Špalek
svn-id: r45649
2009-11-04Implemented and debugged the walking framework.Robert Špalek
The hero does not walk yet (it still teleports to the target immediately), but that is just because the actual walking algorithm is left trivial first. However, the main game loop, callbacks, and waiting all already work with the general framework. svn-id: r45648
2009-11-03Created walking-callback infrastructure and converted the code to use itRobert Špalek
svn-id: r45644
2009-11-03Implement properly stayOn instead of using walkOnRobert Špalek
svn-id: r45641
2009-11-03Let setPath() store path with pixel precision, and update the map sprite ↵Robert Špalek
when reloaded svn-id: r45640
2009-11-03Greatly improved the quality of obliqueing the shortest path.Robert Špalek
The current algorithm is much better than the original player'ss one and it find really nice curved paths. Also, started preparing interface for actually walking along this path. svn-id: r45622
2009-11-02Little clean-up after the refactoring.Robert Špalek
svn-id: r45609
2009-11-02Split loop() into several cleaned helper methodsRobert Špalek
svn-id: r45608
2009-11-02Refactored running loop().Robert Špalek
- shouldExitLoop() is a bool again and introduced new flag isReloaded() instead of adding special hacky value 2 - loop() accepts 2 parameters: loop substatus and shouldExit flag, because each caller previously had to set and restore these manually. loop() now also tests whether the substatuses are properly nested. reordered the loop-exitting code. - renamed loop substatuses to logical names - enterNewRoom() returns bool whether loop() should continue so that start() doesn't have to test and clear shouldEndProgram(). it doesn't need force_reload as a parameter anymore. - dialog selections use new inner substatus instead of outer substatus, for consistency svn-id: r45607