Robert Špalek
a04881072a
Reduce code duplication when cleaning animations
...
svn-id: r44422
2009-09-27 21:25:34 +00:00
Robert Špalek
caa3b6707e
Improved the interface of Sprite and Animation concerning relative coordinates and scaling.
...
It is no longer needed to modify the underlying animations when drawing them
on the screen or testing pixels in them. Read access is enough, because
the displacement of the object is passed as a parameter.
Added some more const's where they logically belong.
svn-id: r44419
2009-09-27 20:49:59 +00:00
Robert Špalek
cf1031fc63
Fix renumbering of animation indexes
...
svn-id: r44414
2009-09-27 18:51:07 +00:00
Robert Špalek
fc2bb50600
Remove memory leak in animation manager. Get rid of 1 non-const reference parameter.
...
svn-id: r44413
2009-09-27 18:11:06 +00:00
Denis Kasak
27a638fa82
draci: Fixed bug in Surface::centerOn{X,Y}() which made it return a negative coordinate for strings that are too long. Resolves the crash caused by the English data files containing strings which are improperly line-breaked. Ideally, the engine should do the line-breaking itself when the string does not fit.
...
svn-id: r44376
2009-09-26 13:47:32 +00:00
Robert Špalek
431780297e
Added some more const's to the interface of Dragon History
...
svn-id: r44362
2009-09-25 17:33:00 +00:00
Filippos Karapetis
e296cef9be
Created a macro for lround(), for non-C99 compilers, and used that in places where lround() is used
...
svn-id: r44337
2009-09-25 09:48:43 +00:00
Robert Špalek
f51c81f344
Add const's to many interfaces of engines/draci/
...
svn-id: r44331
2009-09-25 08:13:39 +00:00
Filippos Karapetis
a74a9c6c01
Silenced some warnings
...
svn-id: r44329
2009-09-25 07:06:55 +00:00
Filippos Karapetis
7106caca81
Replaced the C99 lround() with floor(), to get draci to compile under non-C99 compilers (e.g. VS)
...
svn-id: r44328
2009-09-25 07:05:26 +00:00
Robert Špalek
edd338b229
Make engines/draci/ compilable after merging from a branch
...
svn-id: r44327
2009-09-25 06:43:33 +00:00
Denis Kasak
be0cfa50f2
Removed public data variables of Game concerning dialogues and added getters/setters.
...
svn-id: r43492
2009-08-17 19:37:55 +00:00
Denis Kasak
85bf130a50
Enabled hotkey 'i' for accessing or exiting the inventory.
...
svn-id: r43488
2009-08-17 18:51:45 +00:00
Denis Kasak
b0fea939f4
Added inventory and item handling support (monster patch, sorry). Items were previously called "icons" as in the original player. This commit also renamed every such instance to the proper "item".
...
svn-id: r43487
2009-08-17 18:50:38 +00:00
Denis Kasak
e5774d2881
* Added pause support for animations.
...
* Added AnimationManager::addItem() for adding inventory items animations.
svn-id: r43486
2009-08-17 18:47:17 +00:00
Denis Kasak
680bed134b
* Set the _x and _y position for the mouse only when an EVENT_MOUSEMOVE happens.
...
* Stop calling Mouse::setPosition() on EVENT_MOUSEMOVE since it's not needed (the engine warps the mouse automatically; I still left the method for situations when we want to warp the mouse explicitly).
svn-id: r43484
2009-08-17 18:23:05 +00:00
Denis Kasak
74d4392a78
Added struct GameItem.
...
svn-id: r43424
2009-08-16 04:21:17 +00:00
Denis Kasak
1c0df34b4d
Removed _roomChange hack since it's no longer needed.
...
svn-id: r43392
2009-08-15 02:53:14 +00:00
Denis Kasak
abf10049bb
* Implemented LoadPalette, SetPalette and BlackPalette GPL commands.
...
* Used a more natural condition (whether the scheduled room number is different from the current room number) instead of the _roomChange hack.
svn-id: r43391
2009-08-15 02:42:34 +00:00
Denis Kasak
fad77de234
Sped up the game during dialogues by not updating every drawn char separately but the whole string at once. Also removed the markDirty parameter from Font::drawChar() since it's not needed anymore.
...
svn-id: r43368
2009-08-14 16:12:17 +00:00
Denis Kasak
87e64d27f7
Fixed bug which made the dragon's spoken line in a dialogue end too quickly.
...
svn-id: r43365
2009-08-14 13:17:53 +00:00
Denis Kasak
3022c623d6
Stopped returning from Animation::nextFrame() early even if the animation has only one frame because such animations may need to have callbacks called too. Fixes intro freeze during mother's lecture.
...
svn-id: r43313
2009-08-12 07:37:08 +00:00
Denis Kasak
8ca10ac3b0
Fixed dialogues logic (some indexes were calculated erroneously +/- 1).
...
svn-id: r43312
2009-08-12 07:34:31 +00:00
Denis Kasak
c57515b5f8
Moved setting inactive dialogue option colour to an else branch.
...
svn-id: r43311
2009-08-12 05:38:15 +00:00
Denis Kasak
45e4f88e4e
Removed unnecessary else branch in the part of the loop handling substatus Talk.
...
svn-id: r43310
2009-08-12 05:35:08 +00:00
Denis Kasak
e526983dbe
Fixed erroneous comment mentioning gates in Game::runDialogueProg().
...
svn-id: r43309
2009-08-12 05:22:50 +00:00
Denis Kasak
534158af87
* When setting the first two game variables (room and gate), first convert them back to 1-based indexing so they play well with the rest of the scripts. This fixes a number of bugs, e.g. the dragon now appears automatically when the game starts and the question mark animation in the intro is played / stopped at an appropriate time.
...
* Removed hack from Script::start() which loaded animation 657 before playing it to stop a crash. The fix above seems to fix this bug as well.
svn-id: r43308
2009-08-12 05:20:25 +00:00
Denis Kasak
303085c66b
Whenever we enter the top-level loop, disable exiting by default (fixes the high-five scene between Bert and Eveline which ended too fast).
...
svn-id: r43306
2009-08-12 04:22:47 +00:00
Denis Kasak
6693b22851
* Split loop status and substatus into two different enums since they are two separate concepts
...
* Fixed slight glitch where object titles (which normally disappear when objects are used/looked at) reappeared for a moment after the script has finished
svn-id: r43305
2009-08-12 04:18:45 +00:00
Denis Kasak
100603e683
Fixed Script::walkOnPlay() (was setting loop status whereas it was substatus that needed to be set).
...
svn-id: r43297
2009-08-12 01:03:54 +00:00
Denis Kasak
3b0895dd2f
Added some debug info for loop statuses and dialogues.
...
svn-id: r43295
2009-08-12 00:56:44 +00:00
Denis Kasak
9093e179cc
Added dialogue selection colouring.
...
svn-id: r43256
2009-08-11 04:53:30 +00:00
Denis Kasak
ee7b9271a2
Implemented GPL command WalkOnPlay.
...
svn-id: r43255
2009-08-11 04:18:14 +00:00
Denis Kasak
0daad90685
Fix intro crash because of bug in the data files.
...
svn-id: r43254
2009-08-11 04:14:38 +00:00
Denis Kasak
51cc821619
Added dialogue support.
...
svn-id: r43253
2009-08-11 04:03:22 +00:00
Denis Kasak
d59d03e52f
Multiply itemID by two before using it as an index into the item image archive because every item has a highlighted and a non-highlighted version.
...
svn-id: r43185
2009-08-09 20:33:58 +00:00
Denis Kasak
b9a9a5ef88
Implemented GPL function Script::funcObjStat().
...
svn-id: r43176
2009-08-09 16:58:04 +00:00
Denis Kasak
abedc7e9bb
Moved cursor state setting (when entering a new room) from Game::loadRoom() to Game::start() (just after running the gate program). This fixes a black cursor bug when the game starts (the cursor should not be even displayed then).
...
svn-id: r43162
2009-08-09 04:24:52 +00:00
Denis Kasak
f68ceeb88c
* Implemented GPL functions Script::funcActIco() and Script::funcIsIcoAct().
...
* Implemented GPL commands Script::loadMap() and Script::roomMap().
* Added temporary HACK to change some speech texts to use the small font because some strings overflow the screen (as stored in the data files).
svn-id: r43161
2009-08-09 04:12:36 +00:00
Denis Kasak
eeb72e3d0d
* Implemented Game::loadWalkingMap().
...
* Extracted title updating from the main loop to a new method, Game::updateTitle().
* Added Game::updateCursor().
* Restructured the main loop to fix many subtle bugs and enable some new functionality concerning object scripts (like support for room-global use scripts).
* Added support for tracking currently selected icons (items, probably should be renamed).
* Changed walkDir, lookDir and useDir members of GameObject to int and adjusted them for zero-based indexing.
* Added Game::getCurrentIcon().
* Return from WalkingMap::findNearestWalkable immediately if the starting point is walkable.
svn-id: r43160
2009-08-09 04:09:24 +00:00
Denis Kasak
e46abf1643
Added Text::setFont().
...
svn-id: r43159
2009-08-09 03:59:39 +00:00
Denis Kasak
295ab7e6ff
Added Mouse::loadItemCursor(). Removed hotspot FIXME as all cursors seem to use the same hotspot (the center of the sprite).
...
svn-id: r43158
2009-08-09 03:58:03 +00:00
Denis Kasak
c193c80e67
* Test whether an object can be used by evaluating its canUse script (warning: this will break many things currently working until I implement IsIcoAct in my next few commits).
...
* Removed old HACK note because look / use scripts are now more properly implemented.
svn-id: r43130
2009-08-08 16:17:21 +00:00
Denis Kasak
18b5d7ce33
Implemented Script::testExpression().
...
svn-id: r43129
2009-08-08 15:55:19 +00:00
Denis Kasak
d2f7268171
Removed TODO concerning the nearest walkable point feature and reworded some obsolete documentation.
...
svn-id: r43128
2009-08-08 15:53:47 +00:00
Denis Kasak
19d5d66fd7
* Implemented WalkingMap::findNearestWalkable() which mimics a heuristic from the original game that attempts to find walkable spots near the given point
...
* Implemented moving to the right place when looking / using objects.
svn-id: r43125
2009-08-08 12:31:49 +00:00
Denis Kasak
fc6ff00cbc
Implemented Surface::getRect().
...
svn-id: r43109
2009-08-08 03:17:18 +00:00
Denis Kasak
58c56e28b9
Fixed the 'ESC room' feature to work as intended.
...
svn-id: r43087
2009-08-06 07:42:14 +00:00
Denis Kasak
907a35c929
Added ability to end the currently executing GPL program before it finishes via Script::endCurrentProgram().
...
svn-id: r43086
2009-08-06 07:40:14 +00:00
Denis Kasak
3ce16763c7
Enabled skipping the current line of text if a mouse click occurs.
...
svn-id: r43085
2009-08-06 05:17:18 +00:00