Denis Kasak
1ec375bbd5
Added capability for reading in Pascal 6-byte floats and made Game::loadRoom() read in pers0 and persStep correctly.
...
svn-id: r42612
2009-07-19 13:28:05 +00:00
Denis Kasak
cb185f18cd
Fixed bug which caused the dragon to be animated with the wrong Z coordinate for short periods of time when moved to a new location.
...
svn-id: r42586
2009-07-18 12:08:18 +00:00
Denis Kasak
a44cda5525
Fixed bug which caused animations to sometimes be played too fast if the engine was busier than usual (like when redrawing the whole screen when returning from minimized state).
...
svn-id: r42585
2009-07-18 05:21:01 +00:00
Denis Kasak
128fe6ea21
Made the engine handle the Z coordinate for the hero properly.
...
svn-id: r42584
2009-07-18 03:20:26 +00:00
Denis Kasak
10e9a780ce
Made the engine stop the dragon animation when the room changes.
...
svn-id: r42583
2009-07-18 03:12:12 +00:00
Denis Kasak
18fda1b2f3
Fixed a bug where the cursor was not shown when the first room is loaded and has mouse enabled.
...
svn-id: r42582
2009-07-18 03:05:20 +00:00
Denis Kasak
94417e7743
* Added support for "walking" with the hero (i.e. moving the sprite to locations allowed by the walking map)
...
* Enabled drawing the walking map with the 'w' hotkey for testing
svn-id: r42581
2009-07-18 03:00:12 +00:00
Denis Kasak
3cde84fec4
Fixed bug where certain animations were played very fast when not played immediately when they are created.
...
svn-id: r42580
2009-07-18 02:58:11 +00:00
Denis Kasak
adf9e91e1f
* Added Animation::getFrame()
...
* Added support for sorting animations when Z is changed later on (AnimationManager::sortAnimations())
* Added support for relative coordinates (Animation::setRelative())
* Fixed bug where AnimationManager::deleteOverlays() deleted all animations
svn-id: r42579
2009-07-18 02:53:37 +00:00
Denis Kasak
8e1f296308
Removed room switching hack from Mouse and re-added it to DraciEngine::go() (right arrow switches to the next room, left to the previous.
...
svn-id: r42577
2009-07-18 01:11:45 +00:00
Denis Kasak
aa82c39857
* Made Game::changeRoom() clear some more archives
...
* Modified the engine to leverage BArchive's memory management capabilities by using its pointers to data directly instead of copying
* Removed GameObject destructor (not needed because of the above change)
* Changed some more data members from uint16 to uint
svn-id: r42555
2009-07-17 01:20:51 +00:00
Denis Kasak
16530846ac
* Renamed BAFile::closeFile() to close()
...
* Fixed leak in BArchive::loadFileDFW()
svn-id: r42554
2009-07-17 01:05:13 +00:00
Denis Kasak
8018216dea
* Renamed Room::_numMasks to _numOverlays for consistency.
...
* Fixed unsigned to signed comparison.
svn-id: r42549
2009-07-17 00:27:21 +00:00
Denis Kasak
cfa4d5eba0
Added sanity checks for all archives (whether opening succeeded).
...
svn-id: r42547
2009-07-17 00:24:56 +00:00
Denis Kasak
e419110569
* Added Game::loop()
...
* Added WalkingMap::isWalkable()
* Renamed remaining _priority identifiers to _z which were left by mistake in the previous commit
svn-id: r42546
2009-07-17 00:20:57 +00:00
Denis Kasak
c420a4fba1
Renamed GameObject::_priority to _z.
...
svn-id: r42542
2009-07-16 18:39:39 +00:00
Denis Kasak
652acfc4ca
* Added WalkingMaps class
...
* Added DraciEngine::walkingMapsArchive
* Made Game::loadRoom() read in the current walking map
svn-id: r42541
2009-07-16 18:31:15 +00:00
Denis Kasak
e031709989
Added _iconsArchive to DraciEngine and modified the Mouse class to use it.
...
svn-id: r42535
2009-07-16 16:06:29 +00:00
Denis Kasak
3d36ad3e67
Fixed loading the location's walking map index (needed to subtract 1).
...
svn-id: r42534
2009-07-16 15:00:46 +00:00
Denis Kasak
1bf574aaa9
Added proper cursor state handling (when in rooms that don't use the mouse). Added a HACK note for running the gates' scripts.
...
svn-id: r42532
2009-07-16 12:07:41 +00:00
Denis Kasak
ffffc1bea4
* Changed Game members _numMasks, _init, _look, _use and _canUse from uint16 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
2009-07-15 19:06:24 +00:00
Denis Kasak
a4a3ad123c
Renamed Font::setFont() to loadFont(). Removed DraciEngine::_font and added _smallFont and _bigFont so each font can be handled separately.
...
svn-id: r42514
2009-07-15 18:16:54 +00:00
Denis Kasak
4ef46f4bb0
Adjusted levels for some Game debug messages and added some new ones.
...
svn-id: r42489
2009-07-14 19:13:49 +00:00
Denis Kasak
6d51a3ead4
* Fixed bug in Animation which made the first frame of an animation being drawn after it's stopped
...
* Fixed debugging info when starting and stopping animations
svn-id: r42485
2009-07-14 18:11:33 +00:00
Denis Kasak
d5e1611846
Renamed GameInfo::_currentRoom to _startRoom to better reflect its purpose.
...
svn-id: r42465
2009-07-14 00:51:35 +00:00
Denis Kasak
25b884512d
Made Game allocate its _info member statically instead of dinamically.
...
svn-id: r42464
2009-07-14 00:41:17 +00:00
Denis Kasak
04e4bfdbbe
* Implemented the following GPL functions: IsIcoOn, IcoStat, IsObjOn, IsObjOff, IsObjAway
...
* Changed GameObject::_location to an int since we sometimes use location -1.
* Some more uint <-> int changes to prevent comparisons between signed and unsigned.
svn-id: r42452
2009-07-13 19:53:53 +00:00
Denis Kasak
f8c20b9e9c
Renamed Game::_itemStatus to _iconStatus. Added an assert to check if the number of icons is correct.
...
svn-id: r42449
2009-07-13 19:24:22 +00:00
Denis Kasak
f655999c15
Fixed bug in the NoScene logo room; the screen surface is now cleared between scene redraws (filled with the colour 0) to fix artifacts when animating the logo.
...
svn-id: r42448
2009-07-13 19:11:24 +00:00
Denis Kasak
224d8c087a
Added Surface::fill() method and made Screen::fillScreen() use that instead of filling the surface manually. Changed Surface to use uint instead of uint8 throughout.
...
svn-id: r42447
2009-07-13 19:08:04 +00:00
Denis Kasak
77a810c0c9
Moved the delay mechanism from Animation to Drawable since each frame in an animation can have a different delay.
...
svn-id: r42427
2009-07-12 19:32:01 +00:00
Denis Kasak
eef64cc737
Enabled some more rooms in the demo and disabled loading the former distributor logo.
...
svn-id: r42426
2009-07-12 19:02:08 +00:00
Denis Kasak
d369a257d1
Enabled clearing the screen when the room changes since some rooms do not draw anything on some parts of the screen.
...
svn-id: r42425
2009-07-12 19:00:24 +00:00
Denis Kasak
a41d36de0f
Fixed bug in the GPL math evaluator (GPL function results were not pushed onto the evaluation stack).
...
svn-id: r42424
2009-07-12 18:55:44 +00:00
Denis Kasak
6b2991f488
Made Script::run() seek in SEEK_CUR mode when jumping instead of the default SEEK_SET. It also now checks whether there is a non-zero jump value set before doing the jump.
...
svn-id: r42254
2009-07-08 06:14:17 +00:00
Denis Kasak
0ec737db69
Stopped doing a screen update immediately after changing the palette. This caused a noisy effect when changing rooms because the palette was changed before the new scene was loaded.
...
svn-id: r42251
2009-07-08 00:48:03 +00:00
Denis Kasak
32d692aea6
Made the engine clear some more caches when it changes rooms (room, sprites and palette caches). Made the DraciEngine destructor delete the rooms, overlays and animations archives.
...
svn-id: r42250
2009-07-08 00:40:22 +00:00
Denis Kasak
d8c33f6836
* Implemented GPL jumps
...
* Implemented c_If, c_Goto and c_Let opcodes
* Changed the interpreter to work with signed ints instead of uints (the interpreter uses negative values sometimes)
* Fixed documentation of Script::run() which said it is a disassembler (forgot to change it earlier)
svn-id: r42249
2009-07-08 00:34:53 +00:00
Denis Kasak
68ec1350c0
Fixed two mismatched (de)allocations in BArchive and BAFile.
...
svn-id: r42247
2009-07-07 21:46:34 +00:00
Denis Kasak
dd955bb08e
* Made Game::_variables private and, instead, added Game::{get,set}Variable() methods.
...
* Removed obsolete comment about the cyclic field not being used in Game::loadAnimation()
svn-id: r42246
2009-07-07 21:30:36 +00:00
Denis Kasak
bab9293f97
Implementend F_Not GPL function.
...
svn-id: r42245
2009-07-07 21:24:39 +00:00
Denis Kasak
586af0ab42
* From Game::GameObject removed the following _idxSeq, _numSeq, _animObj, _seqTab (not used anymore), added Common::Array<int> _anims.
...
* Handled cylic animations properly
* Handled the Z coordinate properly
svn-id: r42244
2009-07-07 21:18:28 +00:00
Denis Kasak
9246e9cf4a
* Added some more animation debug info
...
* Reordered Animation::nextFrame() a bit to make sure the timings are correct (particularly the last frame)
* Added checks to AnimationManager::play() and AnimationManager::stop() so it doesn't dereference a null pointer.
svn-id: r42243
2009-07-07 21:11:36 +00:00
Denis Kasak
b6b1402368
* Changed Game::_variables to public since the GPL interpreter needs to use it and made it int instead of uint16
...
* Implemented variable accessing by the math evaluator
* Fixed bug from previous commit (should have used && when checking for ending instructions, not ||)
svn-id: r42242
2009-07-07 20:57:14 +00:00
Denis Kasak
318d406242
Made GPL interpreter exit on both gplend and exit instructions.
...
svn-id: r42241
2009-07-07 20:46:26 +00:00
Denis Kasak
d37d49e50c
Removed testing hack from Game::init() that displayed the dragon in the upper left corner. Replaced some more instances of magic numbers with kDragonObject. Made Game::init() a bit more readable.
...
svn-id: r42237
2009-07-07 19:53:40 +00:00
Denis Kasak
fd2ab9e3c0
Added enum constant for the dragon object (kDragonObject) and made Script::start() a bit more readable.
...
svn-id: r42236
2009-07-07 19:50:12 +00:00
Denis Kasak
c258eefc82
Made AnimationManager::getAnimation() return NULL when an animation is not found instead of Common::List<>::end().
...
svn-id: r42228
2009-07-07 15:39:18 +00:00
Denis Kasak
d519626c55
Added const keyword to "transparent" local variable in Sprite::draw() and removed leading underscore.
...
svn-id: r42227
2009-07-07 15:37:50 +00:00
Denis Kasak
4cfdf8c855
Shortened AnimationManager::{play,stop}(). Removed some excessive newlines.
...
svn-id: r42226
2009-07-07 15:35:35 +00:00