104 Commits

Author SHA1 Message Date
Denis Kasak
4465ecf123 Added deconstructor for Animation. Made Animation objects delete their frames when deleteAll() or deleteAnimation() are called.
svn-id: r42073
2009-07-03 18:19:51 +00:00
Denis Kasak
c651d1c2e2 Made Game::changeRoom() clear the overlaysArchive cache when it's done loading overlays.
svn-id: r42072
2009-07-03 18:17:05 +00:00
Denis Kasak
1853d594b8 Enabled loading room number 1 as a test.
svn-id: r42071
2009-07-03 17:55:28 +00:00
Denis Kasak
4ba1ea8adf Added support for loading room overlays to Game::changeRoom().
svn-id: r42070
2009-07-03 17:54:13 +00:00
Denis Kasak
22cfdf01ee Made the animation engine compile.
svn-id: r42069
2009-07-03 17:53:05 +00:00
Denis Kasak
c178409b56 Implemented beginning of the animation engine.
svn-id: r42068
2009-07-03 17:50:22 +00:00
Denis Kasak
90e6ff9d8a Added support for mirrored sprites.
svn-id: r42067
2009-07-03 17:39:13 +00:00
Denis Kasak
8e9771d15c Added bool parameter markDirty to Sprite::draw() and Text::draw() to specify whether to mark a dirty rect for a particular draw (also added such support to the Font class since it's needed by Text). Made spacing parameters for Text instances mandatory.
svn-id: r42066
2009-07-03 16:41:11 +00:00
Denis Kasak
52642e2dc9 Added two more debug levels (logic and animation).
svn-id: r42065
2009-07-03 16:35:04 +00:00
Denis Kasak
b232202b33 Removed demo code so I can start working on the real intro.
svn-id: r42063
2009-07-03 16:29:56 +00:00
Denis Kasak
8bba3e6f10 Added Game::changeRoom() method and Game::_currentRoom.
svn-id: r42036
2009-07-02 20:29:14 +00:00
Denis Kasak
cac39d8295 Added rooms and overlays archives.
svn-id: r42035
2009-07-02 19:57:09 +00:00
Denis Kasak
4a4aab83d0 Fixed typo.
svn-id: r42034
2009-07-02 19:54:18 +00:00
Denis Kasak
b0334e102f Added struct Room.
svn-id: r42033
2009-07-02 19:47:25 +00:00
Denis Kasak
be3c0461d6 DraciEngine now opens and stores pointers to essential archives. Changed 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-02 16:15:32 +00:00
Denis Kasak
936e5f4c5e Merged the info available from _objectStatus with the GameObject struct. Made Game keep a list of all the game's objects. Added Game::getObject() method for fetching a pointer to a particular object. Changed Game::loadObject() to not accept a pointer to a GameObject struct anymore.
svn-id: r42026
2009-07-02 15:08:42 +00:00
Denis Kasak
35a677fb08 Added BArchive::clearCache() method for clearing the data cache of opened files.
svn-id: r42019
2009-07-02 10:39:51 +00:00
Denis Kasak
fed2281125 Make the meta engine pass the pointer to the detected version and not the whole ADGameDescription table.
svn-id: r42018
2009-07-02 10:31:56 +00:00
Denis Kasak
d47ab6ae98 Added empty animation.cpp and animation.h files.
svn-id: r42000
2009-07-01 16:20:47 +00:00
Denis Kasak
58c1591ae0 Added Text::setSpacing() method.
svn-id: r41999
2009-07-01 16:15:06 +00:00
Denis Kasak
1373eeea12 Made Text objects calculate their widths and heights properly.
svn-id: r41998
2009-07-01 16:14:04 +00:00
Denis Kasak
1402a3f5fe Removed declaration of Screen::drawSprite() which is now obsolete.
svn-id: r41997
2009-07-01 16:01:07 +00:00
Denis Kasak
cfadb6cc3d Made coordinate specification mandatory when constructing objects of type 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-01 16:00:27 +00:00
Denis Kasak
f0fcd7fd8e Modified Sprite, Text and Drawable to handle data hiding properly since 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-01 15:22:36 +00:00
Denis Kasak
4895993588 Added Text::setText() and Text::setColour() methods. Changed demo animation to use them.
svn-id: r41984
2009-07-01 01:43:20 +00:00
Denis Kasak
4c86646db6 Changed intro animation to render text via the new Text class.
svn-id: r41983
2009-07-01 01:25:48 +00:00
Denis Kasak
d7f8cbf170 Added text position specification to Text constructor.
svn-id: r41982
2009-07-01 01:18:22 +00:00
Denis Kasak
78d5b96f51 Added Text as a subclass of Drawable. Fixed syntax error in font.cpp
svn-id: r41981
2009-07-01 01:11:48 +00:00
Denis Kasak
49e1a07f27 Added Font::drawString overload that takes in a pointer to a byte buffer and a length instead of a Common::String. Changed the former drawString to be a wrapper for the new one.
svn-id: r41980
2009-07-01 01:02:48 +00:00
Denis Kasak
85a5871873 Added the Drawable abstract base class and made Sprite inherit from it.
svn-id: r41979
2009-06-30 22:31:29 +00:00
Denis Kasak
138d17bbab Changed some data members in Draci::GameInfo from uint32 to uint16 (previously I thought that the 'word' type in the original engine was 32 bits). Removed a FIXME concerning struct size mismatch (matches when the previous sentence is taken into account). GameInfo::_numDialogBlocks is now calculated, not read in (it wasn't stored in the data files at all).
svn-id: r41966
2009-06-29 22:27:38 +00:00
Denis Kasak
63aa2b7aaf Account for endianess properly when reading in game variables.
svn-id: r41965
2009-06-29 22:20:30 +00:00
Denis Kasak
6a78781889 Added an offset parameter to Script::run() so we can specify where to start the GPL program execution. Also, the init script for the dragon object is now run inside Game::Game().
svn-id: r41928
2009-06-28 16:28:16 +00:00
Denis Kasak
f61b2d289d Changed Script::run() to accept a GPL2Program struct instead of a byte 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-28 16:19:10 +00:00
Denis Kasak
948bf2cfcc Removed disassembling of the GPL script for the first game location from Draci::init().
svn-id: r41926
2009-06-28 15:28:20 +00:00
Denis Kasak
d28bbe51bf Added struct GameObject (such structs are stored in OBJEKTY.DFW and used for in-game objects' info). Added Game::loadObject() for loading such objects into memory. Made Game's constructor load the object for the main hero.
svn-id: r41925
2009-06-28 13:10:53 +00:00
Denis Kasak
1e70f25fcf Added Script instance to DraciEngine. Restored disassembling of a demo script on engine startup (previously via gpldisasm(), now via _script->run()).
svn-id: r41921
2009-06-27 15:26:33 +00:00
Denis Kasak
4c524f5e0a Renamed Script::gpldisasm() to Script::run().
svn-id: r41920
2009-06-27 15:19:03 +00:00
Denis Kasak
97dde5e1ed Put all GPL interpreter related routines inside a Script class.
svn-id: r41919
2009-06-27 15:17:26 +00:00
Denis Kasak
2e30fae261 Renamed gpldisasm.* to script.* in anticipation of using it as a script intepreter.
svn-id: r41918
2009-06-27 15:00:14 +00:00
Denis Kasak
746e2214ee Extended Game to load all info from INIT.DFW (general game info, dialog offsets, variables, item status, object status).
svn-id: r41908
2009-06-27 05:10:24 +00:00
Denis Kasak
0430939006 Added Game's constructor. Added the Person struct and made Game constructor read in the list of persons from INIT.DFW. Added Game instance to DraciEngine.
svn-id: r41907
2009-06-27 01:04:24 +00:00
Denis Kasak
c1644493b8 Added empty Game class.
svn-id: r41906
2009-06-26 23:34:06 +00:00
Denis Kasak
9911026816 Oops, really fixed typo.
svn-id: r41874
2009-06-25 18:06:35 +00:00
Denis Kasak
09313ccebb Fixed typo.
svn-id: r41873
2009-06-25 17:56:14 +00:00
Denis Kasak
a1b02870d8 Made the DraciEngine destructor free _font and _mouse.
svn-id: r41872
2009-06-25 16:02:00 +00:00
Denis Kasak
566dd20e4f Renamed *cursorNum identifiers in Mouse to *cursorType for consistency.
svn-id: r41866
2009-06-25 15:08:49 +00:00
Denis Kasak
d6729f3804 Added transformToRows() static method to Sprite. Modified Sprite constructors to use it.
svn-id: r41865
2009-06-25 14:03:57 +00:00
Denis Kasak
02dadc70fc Implemented some more methods in Mouse so all mouse-related events are handled through it.
svn-id: r41861
2009-06-25 11:02:10 +00:00
Denis Kasak
c87f05b14c Started work on the Mouse class.
svn-id: r41840
2009-06-24 23:58:30 +00:00