aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/script.cpp
AgeCommit message (Collapse)Author
2009-10-04Work-around a bug in the original game files.Robert Špalek
svn-id: r44645
2009-10-04Change a couple places from 'end of namespace' to 'End of namespace', for ↵Max Horn
consistency svn-id: r44634
2009-10-03Fixed positioning and update of the title under the mouse pointer.Robert Špalek
Clamping on the border of the screen works precisely. When switched to the inventory, titles of game items are displayed instead of a (sticky) title of the last object before entering the inventory. Put some const's where appropriate. svn-id: r44550
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-30Fix code formatting (esp. 'if(' -> 'if (' etc., but also indention and other ↵Max Horn
things) svn-id: r44495
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-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-28Added const's to getPalette() and several uses of getObject()Robert Špalek
svn-id: r44434
2009-09-28Make getFile() return a const pointer and clean-up all uses of it.Robert Špalek
svn-id: r44433
2009-09-28get rid of static Common::String'sRobert Špalek
svn-id: r44431
2009-09-27Improved the interface of Sprite and Animation concerning relative ↵Robert Špalek
coordinates and scaling. It is no longer needed to modify the underlying animations when drawing them on the screen or testing pixels in them. Read access is enough, because the displacement of the object is passed as a parameter. Added some more const's where they logically belong. svn-id: r44419
2009-09-27Remove memory leak in animation manager. Get rid of 1 non-const reference ↵Robert Špalek
parameter. svn-id: r44413
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-09-25Silenced some warningsFilippos Karapetis
svn-id: r44329
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-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-14Fixed bug which made the dragon's spoken line in a dialogue end too quickly.Denis Kasak
svn-id: r43365
2009-08-12Fixed dialogues logic (some indexes were calculated erroneously +/- 1).Denis Kasak
svn-id: r43312
2009-08-12* When setting the first two game variables (room and gate), first convert ↵Denis Kasak
them back to 1-based indexing so they play well with the rest of the scripts. This fixes a number of bugs, e.g. the dragon now appears automatically when the game starts and the question mark animation in the intro is played / stopped at an appropriate time. * Removed hack from Script::start() which loaded animation 657 before playing it to stop a crash. The fix above seems to fix this bug as well. svn-id: r43308
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-12Fixed Script::walkOnPlay() (was setting loop status whereas it was substatus ↵Denis Kasak
that needed to be set). svn-id: r43297
2009-08-11Implemented GPL command WalkOnPlay.Denis Kasak
svn-id: r43255
2009-08-11Fix intro crash because of bug in the data files.Denis Kasak
svn-id: r43254
2009-08-11Added dialogue support.Denis Kasak
svn-id: r43253
2009-08-09Implemented GPL function Script::funcObjStat().Denis Kasak
svn-id: r43176
2009-08-09* Implemented GPL functions Script::funcActIco() and Script::funcIsIcoAct().Denis Kasak
* Implemented GPL commands Script::loadMap() and Script::roomMap(). * Added temporary HACK to change some speech texts to use the small font because some strings overflow the screen (as stored in the data files). svn-id: r43161
2009-08-08Implemented Script::testExpression().Denis Kasak
svn-id: r43129
2009-08-06Added ability to end the currently executing GPL program before it finishes ↵Denis Kasak
via Script::endCurrentProgram(). svn-id: r43086
2009-08-05Fixed second call to Surface::centerOnX() (should have been centerOnY()).Denis Kasak
svn-id: r43058
2009-08-04Refactored Script::talk() to use the new centering methods.Denis Kasak
svn-id: r43052
2009-08-03Fixed bug in the math expression evaluator; when evaluating operators, ↵Denis Kasak
operands were being popped from the stack in the wrong order. svn-id: r43019
2009-08-02Implemented the Talk GPL command.Denis Kasak
svn-id: r42992
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-29Removed some garbage I accidentally pasted into a comment.Denis Kasak
svn-id: r42909
2009-07-29* Removed some code I forgot to remove in Game::startPlay() (a call to ↵Denis Kasak
AnimationManager::play()) * Fixed logic checking for object visibility in various GPL commands (I originally misinterpreted the original engine code). svn-id: r42908
2009-07-29* Implemented the StartPlay and Play GPL commands properlyDenis Kasak
* Changed Script::load() to use the new animation callbacks svn-id: r42902
2009-07-29* Implemented GPL function ActPhase (as Script::funcActPhase())Denis Kasak
* Trivial implementation of the Play GPL command * Fixed Script::load() to load animation IDs to objects in increasing order (needed by funcActPhase()) svn-id: r42874
2009-07-25* Moved walking code to Game::walkHero().Denis Kasak
* Implemented WalkOn GPL command. * Temporarily remaped StayOn and WalkOnPlay to WalkOn (for testing). svn-id: r42735
2009-07-25Made Script::run() manually mark the last animation index before it executes ↵Denis Kasak
a program. This is done to prevent Release wreaking havoc if it is unpaired (i.e. if the script forgot to call a Mark first). svn-id: r42733
2009-07-25Implemented ExecUse, ExecLook and ExecInit GPL commands.Denis Kasak
svn-id: r42732
2009-07-25* Added DraciEngine::_initArchive and made Game use it. Fixes a memory bug ↵Denis Kasak
because Game uses pointers from the init archive which should outlive it (but didn't previously). * Added support for setting loop status to Game. * Made some GPL commands check whether we are in the correct loop status before executing. svn-id: r42731
2009-07-25* Added handlers for the ObjStat and ObjStat_On GPL commandsDenis Kasak
* Removed temporary hack I accidentally committed svn-id: r42730
2009-07-24Temporary mapped GPL command StartPlay to handler for Start and reenabled ↵Denis Kasak
gates' scripts (for added effects and testing). svn-id: r42684
2009-07-24* Added tracking and deleting animations by index (which represents the ↵Denis Kasak
order in which they were loaded). This is needed by some GPL commands. * Added Game::getNumObjects() which returns the number of objects in the game * Fixed segfault (accessing a null Animation *) * Added some docs to various things svn-id: r42683
2009-07-17* Added Game::loop()Denis Kasak
* Added WalkingMap::isWalkable() * Renamed remaining _priority identifiers to _z which were left by mistake in the previous commit svn-id: r42546
2009-07-15* Changed Game members _numMasks, _init, _look, _use and _canUse from uint16 ↵Denis Kasak
to int * Modified Game::loadRoom to load gates and execute their scripts * The first room loaded is now Game::_info._startRoom instead of 0 * Fixed reading of _pers0 and _persStep from the data files (they are 6 instead of 12 bytes) * Added more debug info to Script and Game svn-id: r42515