11070 Commits

Author SHA1 Message Date
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
Denis Kasak
36fd17d499 Changed Font::fillScreen() to accept a uint8 instead of a uint16.
svn-id: r41780
2009-06-22 20:18:53 +00:00
Denis Kasak
f5e39fa61d * Expanded docs for the Sprite class
* Added Surface and Screen docs
* Small documentation fixes

svn-id: r41779
2009-06-22 20:13:25 +00:00
Denis Kasak
8c3e1b0e8d Documentation fix for the Font class.
svn-id: r41776
2009-06-22 19:32:47 +00:00
Denis Kasak
a4693b8639 Replaced return values with Common::k*Error constants.
svn-id: r41775
2009-06-22 19:31:18 +00:00
Denis Kasak
f15adff4d8 Updated the demo animation to use the new Surface features (transparency, dirty rects). Changed background to light grey. A transparent string is now drawn over the dragon sprite.
svn-id: r41658
2009-06-19 00:15:28 +00:00
Denis Kasak
adef44e451 * Made the Screen class use the new Surface class.
* Added Screen::drawRect() method.
* Added support for updating dirty rectangles.

svn-id: r41657
2009-06-19 00:13:05 +00:00
Denis Kasak
9d0b940af3 Added support for the new Surface class to Font (transparency, marking dirty rectangles).
svn-id: r41656
2009-06-19 00:09:36 +00:00
Denis Kasak
fc461246cf Made the Surface class compile.
svn-id: r41655
2009-06-19 00:06:11 +00:00
Denis Kasak
1fe88abf6b Added Sprite::draw() method for drawing sprites to a Surface.
svn-id: r41654
2009-06-19 00:00:31 +00:00
Denis Kasak
a6355466d0 Added Surface class.
svn-id: r41653
2009-06-18 23:55:35 +00:00
Eugene Sandulenko
fbec4434e5 Turned constants into enum in order to remove need of prototypes.
svn-id: r41623
2009-06-18 05:30:21 +00:00
Denis Kasak
0ff3c1945f Changed _screenWidth and _screenHeight from member variables to constants because the screen size doesn't change.
svn-id: r41620
2009-06-18 00:33:16 +00:00
Denis Kasak
efef9e4eff Added kNumColours constant and replaced magic numbers with it.
svn-id: r41617
2009-06-17 23:11:24 +00:00
Denis Kasak
1712db9112 Added default parameter to Screen::setPaletteEmpty() so it clears all colours by default.
svn-id: r41614
2009-06-17 21:29:05 +00:00
Denis Kasak
491800c19a Changed the _font DraciEngine member from a Font instance to a pointer to an 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-17 21:07:59 +00:00
Denis Kasak
17133fdfa0 Fixed typo.
svn-id: r41608
2009-06-17 14:31:21 +00:00
Eugene Sandulenko
569fe88041 Added prefices to safeguard defines in order to minimize risk of name clash.
svn-id: r41605
2009-06-17 05:18:48 +00:00
Denis Kasak
997b37eff1 Began work on the Screen class. Modified the demo animation to use the it.
svn-id: r41604
2009-06-17 04:48:48 +00:00
Denis Kasak
7420c1bfb6 Added include guards.
svn-id: r41600
2009-06-17 03:14:22 +00:00
Denis Kasak
8249d24a63 Changing font colour constants to an enum.
svn-id: r41553
2009-06-15 17:14:38 +00:00
Denis Kasak
ca7d400dc3 Submitting changes to DraciEngine::go() mentioned in the last commit but omitted by accident. Removed superfluous BArchive::closeArchive() calls.
svn-id: r41552
2009-06-15 17:12:21 +00:00
Denis Kasak
30ef3a1223 Added BArchive::isOpen() method. Modified DraciEngine::go() to use it. Updated BArchive docs.
svn-id: r41550
2009-06-15 17:08:39 +00:00
Denis Kasak
a8c784245c Fixed a memory leak in BArchive::openArchive(). A buffer wasn't being freed.
svn-id: r41535
2009-06-15 03:53:03 +00:00
Denis Kasak
ea3cf31938 Close a file after we're done using it.
svn-id: r41534
2009-06-15 03:50:45 +00:00
Denis Kasak
326cf7e735 Added support for DFW format archives. Rewrote some BArchive methods to be 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-15 03:48:16 +00:00
Denis Kasak
a3a9f5c790 Added const to reference parameters of Font::drawString() and Font::getStringWidth().
svn-id: r41530
2009-06-15 00:31:25 +00:00
Denis Kasak
910991ddde Converted default font colours from static members of Font to constants. Moved the initializer list of the Font constructor to the constructor body (for readability).
svn-id: r41529
2009-06-15 00:29:05 +00:00
Denis Kasak
b942082da4 Removed superfluous return from the Sprite constructor.
svn-id: r41525
2009-06-14 19:06:46 +00:00
Denis Kasak
718f84fb97 Added a Font _font variable to the engine instance. Fixed font colour 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
2009-06-14 18:59:31 +00:00
Denis Kasak
149b45f7a5 Renamed DraciFont class to Font to be more consistent with the rest of the classes and other engines.
svn-id: r41523
2009-06-14 16:33:20 +00:00
Denis Kasak
15a35e359d Changed DraciFont API to accept const Strings when loading fonts and added constants for font types.
svn-id: r41522
2009-06-14 16:21:44 +00:00
Denis Kasak
7e7e96e77d Replaced a call to getEventManager() with Engine::_eventMan.
svn-id: r41518
2009-06-14 14:12:28 +00:00
Eugene Sandulenko
f6f7a1e31a Whitespce fixes
svn-id: r41514
2009-06-14 13:51:07 +00:00