aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-08-06Added ability to end the currently executing GPL program before it finishes ↵Denis Kasak
via Script::endCurrentProgram(). svn-id: r43086
2009-08-06Enabled skipping the current line of text if a mouse click occurs.Denis Kasak
svn-id: r43085
2009-08-06Moved walkHero() (in the main loop) to the appropriate place (in ↵Denis Kasak
anticipation of a smart finding a walkable point) and disabled walking during script execution / inventory. svn-id: r43084
2009-08-06Turn off mouse cursor and disable titles when running look / use scripts.Denis Kasak
svn-id: r43083
2009-08-06Added method Mouse::isCursorOn().Denis Kasak
svn-id: r43082
2009-08-06Made the game behave properly and safe when clicking on objects multiple ↵Denis Kasak
times during talking or executing look/use scripts. Previously, the loop could be called nested arbitrarily many times. svn-id: r43081
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* Implemented the "escape room" feature of the original engine which lets a ↵Denis Kasak
user switch to another location (or skip the intro) by pressing ESC (the escRoom for every location is stored in the data files). * Reworked the left and right arrow key commands so they don't call changeRoom() themselves but instead schedule the room change via Game::setRoomNum(). In this way, changing rooms like that is still a hack but a bit more "natural", since the loop doesn't get skipped, the gate scripts get run, etc. svn-id: r43065
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-05* Changed title text to use the small instead of the big fontDenis Kasak
* Handled title positioning * Cleaned up the main loop a bit (comments, stylistic changes, shortened some lines, etc) * Fixed setting the dragon's feet position (the x coordinate should be at the midpoint of the animation) svn-id: r43059
2009-08-05Fixed second call to Surface::centerOnX() (should have been centerOnY()).Denis Kasak
svn-id: r43058
2009-08-04* Added Font::getLineWidth()Denis Kasak
* Changed Font::getStringWidth() and Font::getStringHeight() to return uint instead of int. * Made the Font::drawString() overload which accepts a Common::String the "default" one. The overload accepting a (byte *) now calls that one (it was the other way around before). * Added proper line centering to the Font::drawString() routine. svn-id: r43053
2009-08-04Refactored Script::talk() to use the new centering methods.Denis Kasak
svn-id: r43052
2009-08-04Added Surface methods centerOnX() and centerOnY().Denis Kasak
svn-id: r43051
2009-08-04* Reverted change that subtracts 1 from font colour indexes for various ↵Denis Kasak
speaking characters; they are 0-based after all. * Fixed font blitting algorithm to allow for both white fonts and transparency. svn-id: r43044
2009-08-03* Fixed bug which made characters talk with the wrong colour; the colour ↵Denis Kasak
indexes are indexed from 1 in the data files so we need to subtract 1. * Turned on font transparency again. svn-id: r43022
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-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-02* Fixed bug in Font::getStringWidth() which made it miscalculate string ↵Denis Kasak
widths (a temporary variable used for storing the width of the current line was not being reset). * Temporarily disabled font transparency because the dragon's text is rendered hollow (transparency inside glyph bodies). svn-id: r42993
2009-08-02Implemented the Talk GPL command.Denis Kasak
svn-id: r42992
2009-08-02Changed some uint16s to uints (to blend more naturally with the rest of the ↵Denis Kasak
engine). svn-id: r42991
2009-08-02Calculate the character length of Text objects (without the '|' separators) ↵Denis Kasak
when setting a new string. Implemented Text::getLength(). svn-id: r42990
2009-08-02Added the strings archive to DraciEngine.Denis Kasak
svn-id: r42989
2009-08-02Added a dedicated animation for speech text.Denis Kasak
svn-id: r42988
2009-08-01* Made the engine set the appropriate loop status before running a gate ↵Denis Kasak
program or entering the main loop * Removed hack which ran programs for all gates when the room was changed svn-id: r42977
2009-08-01When changing rooms, set the first two game variables to the new room and ↵Denis Kasak
gate number. Also, if the new room is the map room, set the appropriate coordinates for the dragon in the persons array. svn-id: r42972
2009-08-01* Added support for loop substatusDenis Kasak
* Set loop substatus to Ordinary when changing rooms svn-id: r42971
2009-08-01Added archives for item descriptions and images.Denis Kasak
svn-id: r42970
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-30Fixed sanity check in Animation::setCurrentFrame().Denis Kasak
svn-id: r42914
2009-07-30* Added Animation::setCurrentFrame()Denis Kasak
* Moved rewinding the animation to the beginning from Animation::nextFrame() to AnimationManager::stop() (fixes the owl animation) svn-id: r42913
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-29Explicitly set the kDragonObject enum constant value for clarity.Denis Kasak
svn-id: r42906
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-29Added support for animation callbacks and implemented a few callbacks ↵Denis Kasak
(doNothing, exitGameLoop, stopAnimation). svn-id: r42901
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-29Fixed text bugs related to the fact that some strings in the data files ↵Denis Kasak
don't end with '|' like they should. svn-id: r42897
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-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-29* Added method Animation::currentFrameNum()Denis Kasak
* Renamed Animation::getFramesNum() to Animation::getFrameCount() for clarity. svn-id: r42873
2009-07-27Enabled running of look/use scripts on left/right mouse button press for ↵Denis Kasak
testing (Warning: unstable in some places). svn-id: r42841
2009-07-27Added methods to Mouse for setting the state of the button.Denis Kasak
svn-id: r42840
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
2009-07-27Fixed one more bug related to animations having no frames.Denis Kasak
svn-id: r42838
2009-07-27Fixed segfault when the screen is deleted before animations (the Animation ↵Denis Kasak
destructor still needs to use the screen). svn-id: r42837
2009-07-27* Added AnimationManager::addText() for adding text animationsDenis Kasak
* Added AnimationManager::getTopAnimationID(x, y) which returns the ID of the top layer animation located on a point * Added Animation::getScale{X,Y}() * Fixed a few bugs related to animations sometimes having no frames svn-id: r42836
2009-07-27* Added Sprite::getPixel() (takes into account whether a sprite is mirrored ↵Denis Kasak
or scaled) * Made the Text class internally store a Common::String instead of a byte * svn-id: r42835