Commit Graph

58 Commits

Author SHA1 Message Date
Johannes Schickel
df777fee2a DRACI: Make GPL headers consistent in themselves. 2014-02-18 02:39:34 +01:00
Matthew Hoops
9539017ee3 ALL: initialise -> initialize 2011-05-25 11:17:11 -04:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
cd6ee0589d JANITORIAL: Format forward declarations to follow convention 2011-04-28 12:20:34 +03:00
Max Horn
a008d14055 ENGINES: Do not use MemoryReadStream where (Seekable)ReadStream suffices; avoid using 'using'
svn-id: r54323
2010-11-18 16:38:03 +00:00
Max Horn
92c896d883 Patch #2973290: Semicolon cleanup
svn-id: r48359
2010-03-22 20:28:08 +00:00
Max Horn
f3420c6372 DRACI: Reduce header interdependencies; some cleanup
svn-id: r46320
2009-12-09 21:03:22 +00:00
Johannes Schickel
e3d1d914ac Attempt to fix MSVC warning C4121.
svn-id: r46299
2009-12-08 22:07:17 +00:00
Robert Špalek
d281fe4717 Added runWrapper() calling run() and some actions around it.
This simplifies a lot of code calling run().  Also, scripts called from the
inventory are now called with disabled mouse and title, as desired.

svn-id: r45848
2009-11-12 00:45:28 +00:00
Robert Špalek
e2ca397e63 Huge refactoring of data structures.
Replaced IDs of objects by pointers, which saves many lookups, each of which
is horribly ineffective.  Moved a lot of code into methods of structs now
turned into objects.

Tested the new code a lot and seems to work as well as the old code.

svn-id: r45799
2009-11-10 05:16:34 +00:00
Robert Špalek
ed348133d1 GPL2 callbacks accept const Array& instead of Queue&
svn-id: r45771
2009-11-09 04:27:08 +00:00
Robert Špalek
abbb3dccd7 Items put into inventory are placed correctly.
Also, named correctly GPL2 parameter types.

This fixes all FIXMEs

svn-id: r45762
2009-11-08 21:26:04 +00:00
Robert Špalek
4341a36641 Implement QuickHero walking.
Pressing Q during the game enables/disables faster walking; all animation
phases are flipped after one refresh instead of after given delay.

svn-id: r45748
2009-11-08 06:46:24 +00:00
Robert Špalek
0071829aee Implement properly stayOn instead of using walkOn
svn-id: r45641
2009-11-03 21:30:24 +00:00
Robert Špalek
403668898f Implement flipping the QuickHero and SpeedText flags in GPL2.
All GPL2 callbacks are now fully implemented.  It remains to implement
proper walking.

svn-id: r45501
2009-10-29 15:26:48 +00:00
Robert Špalek
c781f01321 Implement palette fading
svn-id: r45455
2009-10-28 07:34:17 +00:00
Robert Špalek
74da9e5e3b Fix Escape in the intro, and switching map and the inventory
svn-id: r45389
2009-10-26 04:59:52 +00:00
Robert Špalek
819449d099 Implemented GPL2 commands for music.
Debugged everything.

svn-id: r45330
2009-10-22 07:34:43 +00:00
Robert Špalek
1a4dcd3c82 Implemented GPL commands JustTalk and JustStay.
The basic commands are done.  It remains to implement handling music (after
we play it at all), fading palette, and controlling the quick-hero and
speed-text flags (after I find out what they do).

Now the dragon switches between talking and staying during dialogs.  However,
the left/right direction doesn't work yet, because we don't respect _lookDir
and _useDir yet.

svn-id: r44964
2009-10-12 01:16:13 +00:00
Robert Špalek
62cebbb51e Implemented a few more harmless GPL2 commands
svn-id: r44958
2009-10-11 23:28:40 +00:00
Filippos Karapetis
136dbba9c4 Fixed warning (GameObject is a struct)
svn-id: r44648
2009-10-05 07:00:59 +00:00
Robert Špalek
cc39c5022a Work-around a bug in the original game files.
svn-id: r44645
2009-10-04 22:55:54 +00:00
Max Horn
f242266f6d Change a couple places from 'end of namespace' to 'End of namespace', for consistency
svn-id: r44634
2009-10-04 21:26:33 +00:00
Max Horn
cc54ad650d Remove trailing whitespaces
svn-id: r44493
2009-09-30 16:04:21 +00:00
Johannes Schickel
c9ca057ae2 - Adapt parts of the Draci code to match our code formatting guidelines
- Remove use of tabs for formatting, now in nearly all cases tabs are only used for indentation
- Use "uint" instead of "unsigned int" in the whole engine for consistency's sake
- Strip some trailing tabs and leading whitespaces

svn-id: r44478
2009-09-30 10:45:14 +00:00
Robert Špalek
42e3c63b11 get rid of static Common::String's
svn-id: r44431
2009-09-28 02:54:38 +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
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
Robert Špalek
f51c81f344 Add const's to many interfaces of engines/draci/
svn-id: r44331
2009-09-25 08:13:39 +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
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
ee7b9271a2 Implemented GPL command WalkOnPlay.
svn-id: r43255
2009-08-11 04:18:14 +00:00
Denis Kasak
51cc821619 Added dialogue support.
svn-id: r43253
2009-08-11 04:03:22 +00:00
Denis Kasak
b9a9a5ef88 Implemented GPL function Script::funcObjStat().
svn-id: r43176
2009-08-09 16:58:04 +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
18b5d7ce33 Implemented Script::testExpression().
svn-id: r43129
2009-08-08 15:55:19 +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
6bd1cfa1bd Implemented the Talk GPL command.
svn-id: r42992
2009-08-02 05:12:42 +00:00
Denis Kasak
18a8b5b3af * Added Game::runGateProgram()
* Added a separate mechanism to Game to keep track both of the current room number and the next room/gate. Periodically, I check whether the new room differs from the old one and, if it does, I do the change. Doing it any other would is nearly impossible because of the way the original scripts were written.
* Added GPL command Script::newRoom(). Rooms can now be traversed by clicking on their exits. Also, the intro animation partly works. Some parts go by far too soon. I assume this is because the engine still lacks a dialogue GPL command.
* Fixed bug where the gates array of a room was not cleared between uses.
* Save old jump value when we enter Script::run() and restore it in the end (mimicking the original engine).
* Fixed small bug where the gate was supposed to be stored as the first in-game variable and not the room number.

svn-id: r42957
2009-07-31 04:32:33 +00:00
Denis Kasak
393cd99a62 * Implemented the StartPlay and Play GPL commands properly
* Changed Script::load() to use the new animation callbacks

svn-id: r42902
2009-07-29 19:41:30 +00:00
Denis Kasak
dd9303d27e * Implemented GPL function ActPhase (as Script::funcActPhase())
* Trivial implementation of the Play GPL command
* Fixed Script::load() to load animation IDs to objects in increasing order (needed by funcActPhase())

svn-id: r42874
2009-07-29 01:02:50 +00:00
Denis Kasak
20baaf93f5 * Moved walking code to Game::walkHero().
* Implemented WalkOn GPL command.
* Temporarily remaped StayOn and WalkOnPlay to WalkOn (for testing).

svn-id: r42735
2009-07-25 04:36:43 +00:00
Denis Kasak
ed59a12d53 Implemented ExecUse, ExecLook and ExecInit GPL commands.
svn-id: r42732
2009-07-25 03:37:22 +00:00
Denis Kasak
b7e97efb7f * Added handlers for the ObjStat and ObjStat_On GPL commands
* Removed temporary hack I accidentally committed

svn-id: r42730
2009-07-25 02:23:00 +00:00
Denis Kasak
c1ad0c3926 * Added tracking and deleting animations by index (which represents the order in which they were loaded). This is needed by some GPL commands.
* Added Game::getNumObjects() which returns the number of objects in the game
* Fixed segfault (accessing a null Animation *)
* Added some docs to various things

svn-id: r42683
2009-07-24 05:00:53 +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
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
bab9293f97 Implementend F_Not GPL function.
svn-id: r42245
2009-07-07 21:24:39 +00:00
Denis Kasak
b2c24dd640 Implemented Script::funcRandom (GPL function).
svn-id: r42191
2009-07-06 19:26:53 +00:00
Denis Kasak
edaaca97f9 Set up GPL functions properly (the math evaluator now calls the handler if its implemented).
svn-id: r42188
2009-07-06 18:49:51 +00:00