aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/game.h
AgeCommit message (Collapse)Author
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
2009-08-15Removed _roomChange hack since it's no longer needed.Denis Kasak
svn-id: r43392
2009-08-15* Implemented LoadPalette, SetPalette and BlackPalette GPL commands.Denis Kasak
* Used a more natural condition (whether the scheduled room number is different from the current room number) instead of the _roomChange hack. svn-id: r43391
2009-08-12* Split loop status and substatus into two different enums since they are ↵Denis Kasak
two separate concepts * Fixed slight glitch where object titles (which normally disappear when objects are used/looked at) reappeared for a moment after the script has finished svn-id: r43305
2009-08-11Added dialogue support.Denis Kasak
svn-id: r43253
2009-08-09* Implemented Game::loadWalkingMap().Denis Kasak
* Extracted title updating from the main loop to a new method, Game::updateTitle(). * Added Game::updateCursor(). * Restructured the main loop to fix many subtle bugs and enable some new functionality concerning object scripts (like support for room-global use scripts). * Added support for tracking currently selected icons (items, probably should be renamed). * Changed walkDir, lookDir and useDir members of GameObject to int and adjusted them for zero-based indexing. * Added Game::getCurrentIcon(). * Return from WalkingMap::findNearestWalkable immediately if the starting point is walkable. svn-id: r43160
2009-08-08* Implemented WalkingMap::findNearestWalkable() which mimics a heuristic ↵Denis Kasak
from the original game that attempts to find walkable spots near the given point * Implemented moving to the right place when looking / using objects. svn-id: r43125
2009-08-05* Made some type changes to struct/class members in game.cpp (uint -> int ↵Denis Kasak
and uint16 -> uint) * Added enum constant kNoEscRoom for rooms that have no escape room defined * Fixed crash when ESC is pressed in rooms which have no escape room defined * Renamed kNotFound (used as a return value for Game::getObjectWithAnimation) to kObjectNotFound for clarity. svn-id: r43072
2009-08-05* Added kTitleColour = 255 enum constant used in the following item.Denis Kasak
* Added proper colouring of the title animation fonts * Added Game::getEscRoom(). svn-id: r43063
2009-08-02* Fixed bug when reading in persons data. I was reading in coordinates as ↵Denis Kasak
bytes and font colour as int16; it should be the other way around. * Handled the kStatusTalk loop substatus properly inside Game::loop(). * Made Game::walkHero() set the person coordinates for the dragon after it warps him to a new location * Added Game::getPerson() method (used by Script::talk()) * Added Game::setSpeechTick() method (set by Script::talk() and used inside the loop to determine when to switch to new text). svn-id: r42994
2009-08-01* Added support for loop substatusDenis Kasak
* Set loop substatus to Ordinary when changing rooms svn-id: r42971
2009-07-31* Added Game::runGateProgram()Denis Kasak
* Added a separate mechanism to Game to keep track both of the current room number and the next room/gate. Periodically, I check whether the new room differs from the old one and, if it does, I do the change. Doing it any other would is nearly impossible because of the way the original scripts were written. * Added GPL command Script::newRoom(). Rooms can now be traversed by clicking on their exits. Also, the intro animation partly works. Some parts go by far too soon. I assume this is because the engine still lacks a dialogue GPL command. * Fixed bug where the gates array of a room was not cleared between uses. * Save old jump value when we enter Script::run() and restore it in the end (mimicking the original engine). * Fixed small bug where the gate was supposed to be stored as the first in-game variable and not the room number. svn-id: r42957
2009-07-30* Woops, Game::getRoomNum() was already implemented. Removed the superfluous ↵Denis Kasak
implementation. * Set the first two game variables to the gate and room number in Game::init() * Fixed compilation svn-id: r42916
2009-07-30* Added support for keeping track of gates (exits from rooms)Denis Kasak
* Added getters and setters for current room and gate numbers svn-id: r42915
2009-07-29Explicitly set the kDragonObject enum constant value for clarity.Denis Kasak
svn-id: r42906
2009-07-29* Made Game::loop() exit conditionally depending on whether the internal ↵Denis Kasak
Game::_shouldExitLoop variable is set. * Added mechanisms for signalling whether the main game loop should exit or not (Game::setExitLoop() and Game::shouldExitLoop()) svn-id: r42899
2009-07-29* Moved event handling to DraciEngine::handleEvents()Denis Kasak
* Added Game::start() method which is called from DraciEngine::go() * Made Game::loop() suitable for calling from other places (like GPL scripts) by handling events, redrawing the screen, etc from inside. This way it doesn't freeze the game if it doesn't return immediately. * Added Game::shouldQuit() and Game::setQuit() which can be used to signal the engine to quit. * Fixed race condition related to mouse buttons not getting released. * Instead of deleting frames for the title animation and adding a new one, reset the text for its frame. svn-id: r42875
2009-07-27* Added Game::getObjectWithAnimation() which finds the object that owns an ↵Denis Kasak
animation with a certain ID * Made GameObjects track their titles as Strings rather than byte * * Made the engine display the title of the object under the cursor (added a special animation ID for that, kTitleText) svn-id: r42839