aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/game.h
AgeCommit message (Collapse)Author
2009-11-12Display/remove the inventory based on mouse "gestures"Robert Špalek
svn-id: r45855
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-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-08Removed almost all TODOs from the header filesRobert Špalek
svn-id: r45765
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-05Implemented proper walking.Robert Špalek
First shot, not debugged yet, but seems to work (even though a bit hairy)! svn-id: r45688
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-03Implement properly stayOn instead of using walkOnRobert Špalek
svn-id: r45641
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
2009-11-01Commented the rest of the loop() logicRobert Špalek
svn-id: r45606
2009-11-01Debugged computation and displaying of optimal walking pathsRobert Špalek
svn-id: r45597
2009-10-30Moved all one-line getters/setters to the header filesRobert Špalek
svn-id: r45524
2009-10-30Move WalkingMap instance to Game, and clean up parametersRobert Špalek
svn-id: r45516
2009-10-30Remove most of default parameter values.Robert Špalek
Also, add comments to the last commit. svn-id: r45511
2009-10-30Move WalkingMap into new module.Robert Špalek
Also, fix a bug when loading the default walking map (wasn't implemented) and setting font size. The reason I move this code into a new module is because I will augment it with other walking-related algorithms soon. svn-id: r45510
2009-10-29Implement flipping the QuickHero and SpeedText flags in GPL2.Robert Špalek
All GPL2 callbacks are now fully implemented. It remains to implement proper walking. svn-id: r45501
2009-10-29Fix several palette fading bugs.Robert Špalek
svn-id: r45497
2009-10-28Implement palette fadingRobert Špalek
svn-id: r45455
2009-10-22Implemented GPL2 commands for music.Robert Špalek
Debugged everything. svn-id: r45330
2009-10-13Set all sound/subtitle-related parameters from ConfMan.Robert Špalek
Made it intelligent so that when, for example, the dubbing file doesn't exist, we don't fail, but instead always show subtitles even if the GUI settings says dubbing only, etc. svn-id: r45002
2009-10-13Dubbing is played.Robert Špalek
I haven't implemented switching dubbing and subtitles on/off according to the config manager nor the speed of the subtitles, yet. svn-id: r45001
2009-10-12Dragon looks into the requested direction.Robert Špalek
Parsing _lookDir and _useDir, and passing it all the way around to walkHero(). Also, added playHeroAnimation() to reduce code duplication. svn-id: r44965
2009-10-12Implemented GPL commands JustTalk and JustStay.Robert Špalek
The basic commands are done. It remains to implement handling music (after we play it at all), fading palette, and controlling the quick-hero and speed-text flags (after I find out what they do). Now the dragon switches between talking and staying during dialogs. However, the left/right direction doesn't work yet, because we don't respect _lookDir and _useDir yet. svn-id: r44964
2009-10-12Reduced huge code duplication by introducing Game::stopObjectAnimations()Robert Špalek
svn-id: r44961
2009-10-12Disambiguated _anims.Robert Špalek
It's both a pointer to an AnimationManager and list of animation ID's fo each object. The latter renamed to _anim so that I can easily search for them. Also, fixed the bug promised in the previous commit. svn-id: r44960
2009-10-11Reduced code duplication and fixed one deletion bug.Robert Špalek
svn-id: r44959
2009-10-11Implemented a few more harmless GPL2 commandsRobert Špalek
svn-id: r44958
2009-10-08Change doxygen inline comments from "//!" to "///" as proposed on -develMax Horn
svn-id: r44802
2009-10-04Fixed two bugs concerning loading:Robert Špalek
1. a room need to be reloaded by force when the loaded game is in the same room as the game before the load 2. objects from the last room and their animations must be deallocated before I change the room number svn-id: r44638
2009-10-04Hack Game::_shouldExitLoop.Robert Špalek
Immediate exit needed when loading a savegame hurts waiting in an inner (strange) loop inside a GPL program, because animations don't progress at all. Reverted to the previous behavior and kept the immediate exit as a hack for loading the game. svn-id: r44590
2009-10-04Load inventory items properly after loading the game.Robert Špalek
This solution is quite hacky, but so is the rest of the code, before a future refactoring done one day. svn-id: r44588
2009-10-04Implemented rudimentary game loading/saving.Robert Špalek
Fixed many bugs in the boilerplate. Saving (only) things that really need to be saved. Loading seems to work modulo dialogs and (possibly) inventory. svn-id: r44586
2009-10-01Clean up room changing code and support returning from the map.Robert Špalek
Completely changed the interface, removing unused methods and attributes, renaming other ones to reflect what they do, and moving some methods into the private section. Code changing the location, originally scattered over many pieces of code, has been unified into one place. Remember the previous room when entering the map so that one can return there. Also, the event handler processes one event at a time, preventing lost clicks on touchpads. svn-id: r44508
2009-09-30Remove trailing whitespacesMax Horn
svn-id: r44493
2009-09-30- Adapt parts of the Draci code to match our code formatting guidelinesJohannes Schickel
- Remove use of tabs for formatting, now in nearly all cases tabs are only used for indentation - Use "uint" instead of "unsigned int" in the whole engine for consistency's sake - Strip some trailing tabs and leading whitespaces svn-id: r44478
2009-09-30Implemented the map room, entered when 'm' is pressed.Robert Špalek
svn-id: r44474
2009-09-29Clean up and unify positioning dragon's animationsRobert Špalek
svn-id: r44456
2009-09-29draci:Denis Kasak
* Added const to some methods of Game. * Removed some code cruft from Game::walkHero() (duplicate calculations and variables). * Fixed small bug which prevented talking text from being centered above the dragon. svn-id: r44455
2009-09-28draci: Added methods Game::positionAnimAsHero(), Game::getHeroX() and ↵Denis Kasak
Game::getHeroY() and implemented correct positioning of all dragon animations. Fixed exiting the inventory by right-clicking outside it. svn-id: r44453
2009-09-27Reduce code duplication when cleaning animationsRobert Špalek
svn-id: r44422
2009-09-25Added some more const's to the interface of Dragon HistoryRobert Špalek
svn-id: r44362
2009-09-25Add const's to many interfaces of engines/draci/Robert Špalek
svn-id: r44331
2009-08-17Removed public data variables of Game concerning dialogues and added ↵Denis Kasak
getters/setters. svn-id: r43492
2009-08-17Added inventory and item handling support (monster patch, sorry). Items were ↵Denis Kasak
previously called "icons" as in the original player. This commit also renamed every such instance to the proper "item". svn-id: r43487
2009-08-16Added struct GameItem.Denis Kasak
svn-id: r43424