aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/draci.cpp
AgeCommit message (Collapse)Author
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-02Added the strings archive to DraciEngine.Denis Kasak
svn-id: r42989
2009-08-01Added archives for item descriptions and images.Denis Kasak
svn-id: r42970
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-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-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-22Check whether the walking map overlay is already in the desired state so we ↵Denis Kasak
don't start/stop it over and over. svn-id: r42651
2009-07-20Made 'show walking map overlay' setting persist when changing rooms.Denis Kasak
svn-id: r42628
2009-07-18* Added support for "walking" with the hero (i.e. moving the sprite to ↵Denis Kasak
locations allowed by the walking map) * Enabled drawing the walking map with the 'w' hotkey for testing svn-id: r42581
2009-07-18Removed room switching hack from Mouse and re-added it to DraciEngine::go() ↵Denis Kasak
(right arrow switches to the next room, left to the previous. svn-id: r42577
2009-07-17Added sanity checks for all archives (whether opening succeeded).Denis Kasak
svn-id: r42547
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-16* Added WalkingMaps classDenis Kasak
* Added DraciEngine::walkingMapsArchive * Made Game::loadRoom() read in the current walking map svn-id: r42541
2009-07-16Added _iconsArchive to DraciEngine and modified the Mouse class to use it.Denis Kasak
svn-id: r42535
2009-07-16Added proper cursor state handling (when in rooms that don't use the mouse). ↵Denis Kasak
Added a HACK note for running the gates' scripts. svn-id: r42532
2009-07-15Renamed Font::setFont() to loadFont(). Removed DraciEngine::_font and added ↵Denis Kasak
_smallFont and _bigFont so each font can be handled separately. svn-id: r42514
2009-07-08Made the engine clear some more caches when it changes rooms (room, sprites ↵Denis Kasak
and palette caches). Made the DraciEngine destructor delete the rooms, overlays and animations archives. svn-id: r42250
2009-07-05Renaming Animation -> AnimationManager and AnimObj -> Animation in light of ↵Denis Kasak
the new API change. svn-id: r42133
2009-07-04* Added Game::init() and moved some functionality from Game::Game to it ↵Denis Kasak
(loading objects, changing rooms) * Made Game::load*(), Game::getObject() and Game::changeRoom() methods public * Stopped specifying Z coordinate when creating some Sprites (which I forgot in my previous commit) svn-id: r42101
2009-07-04Added _animationsArchive member to DraciEngine.Denis Kasak
svn-id: r42091
2009-07-04Restructured Script so I can start adding callbacks to GPL commands (added ↵Denis Kasak
DraciEngine * member to Script, added Script::setupCommandList() which initialises the command list array, added Script::dummy() callback for the Load command for testing). svn-id: r42090
2009-07-03Enabled loading room number 1 as a test.Denis Kasak
svn-id: r42071
2009-07-03Added two more debug levels (logic and animation).Denis Kasak
svn-id: r42065
2009-07-03Removed demo code so I can start working on the real intro.Denis Kasak
svn-id: r42063
2009-07-02Added rooms and overlays archives.Denis Kasak
svn-id: r42035
2009-07-02DraciEngine now opens and stores pointers to essential archives. Changed ↵Denis Kasak
code that used those archives to use that instead of opening them manually. Replaced BArchive::operator[] functionality with BArchive::getFile() to prevent ugliness when accessing archives via pointers. svn-id: r42031
2009-07-01Made Text objects calculate their widths and heights properly.Denis Kasak
svn-id: r41998
2009-07-01Made coordinate specification mandatory when constructing objects of type ↵Denis Kasak
Sprite and Class. Made transforming from columnwise a default (since it was done most of the time anyway). Changed coordinates to use uint instead of uint16. svn-id: r41996
2009-07-01Modified Sprite, Text and Drawable to handle data hiding properly since ↵Denis Kasak
they're no longer just C-like struct containers. Implemented getters/setters accordingly and changed existing code that used those classes. svn-id: r41995
2009-07-01Added Text::setText() and Text::setColour() methods. Changed demo animation ↵Denis Kasak
to use them. svn-id: r41984
2009-07-01Changed intro animation to render text via the new Text class.Denis Kasak
svn-id: r41983
2009-06-28Changed Script::run() to accept a GPL2Program struct instead of a byte ↵Denis Kasak
pointer and a length. Also, Script::run() now executes the GPL program until a gplend instruction rather than to the end of the whole program. Modified GameObject according to the new changes. svn-id: r41927
2009-06-28Removed disassembling of the GPL script for the first game location from ↵Denis Kasak
Draci::init(). svn-id: r41926
2009-06-27Added Script instance to DraciEngine. Restored disassembling of a demo ↵Denis Kasak
script on engine startup (previously via gpldisasm(), now via _script->run()). svn-id: r41921
2009-06-27Put all GPL interpreter related routines inside a Script class.Denis Kasak
svn-id: r41919
2009-06-27Added Game's constructor. Added the Person struct and made Game constructor ↵Denis Kasak
read in the list of persons from INIT.DFW. Added Game instance to DraciEngine. svn-id: r41907
2009-06-25Made the DraciEngine destructor free _font and _mouse.Denis Kasak
svn-id: r41872
2009-06-25Renamed *cursorNum identifiers in Mouse to *cursorType for consistency.Denis Kasak
svn-id: r41866
2009-06-25Implemented some more methods in Mouse so all mouse-related events are ↵Denis Kasak
handled through it. svn-id: r41861
2009-06-24Started work on the Mouse class.Denis Kasak
svn-id: r41840
2009-06-22Replaced return values with Common::k*Error constants.Denis Kasak
svn-id: r41775
2009-06-19Updated the demo animation to use the new Surface features (transparency, ↵Denis Kasak
dirty rects). Changed background to light grey. A transparent string is now drawn over the dragon sprite. svn-id: r41658
2009-06-18Changed _screenWidth and _screenHeight from member variables to constants ↵Denis Kasak
because the screen size doesn't change. svn-id: r41620
2009-06-17Added kNumColours constant and replaced magic numbers with it.Denis Kasak
svn-id: r41617
2009-06-17Changed the _font DraciEngine member from a Font instance to a pointer to an ↵Denis Kasak
instance. This way the default constructor is invoked in DraciEngine::init() and can properly initialize the fonts because the game data paths are set. svn-id: r41612
2009-06-17Began work on the Screen class. Modified the demo animation to use the it.Denis Kasak
svn-id: r41604
2009-06-15Submitting changes to DraciEngine::go() mentioned in the last commit but ↵Denis Kasak
omitted by accident. Removed superfluous BArchive::closeArchive() calls. svn-id: r41552
2009-06-15Added support for DFW format archives. Rewrote some BArchive methods to be ↵Denis Kasak
able to seamlessly handle both BAR and DFW archives. Modified the BAFile struct to support both types of files. Tested it by enabling the mouse in the event loop (the cursor was stored in a DFW file). Added and rewrote docs to reflect the changes. svn-id: r41533
2009-06-14Added a Font _font variable to the engine instance. Fixed font colour ↵Denis Kasak
handling by replacing the appropriate colours before drawing. Added Font::setColour() method for changing the current font colour. Added include guards to draci/font.h. Moved kFontBig and kFontSmall constants to draci/font.cpp to prevent redefinition errors. svn-id: r41524