Clamping on the border of the screen works precisely. When switched to the
inventory, titles of game items are displayed instead of a (sticky) title of
the last object before entering the inventory. Put some const's where
appropriate.
svn-id: r44550
Completely changed the interface, removing unused methods and attributes,
renaming other ones to reflect what they do, and moving some methods into the
private section. Code changing the location, originally scattered over many
pieces of code, has been unified into one place. Remember the previous room
when entering the map so that one can return there.
Also, the event handler processes one event at a time, preventing lost clicks
on touchpads.
svn-id: r44508
- 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
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
* 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
* 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
* 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
* 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
* 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
* 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
* Added support for setting loop status to Game.
* Made some GPL commands check whether we are in the correct loop status before executing.
svn-id: r42731
* 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
* 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
* 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
* 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
* Implemented variable accessing by the math evaluator
* Fixed bug from previous commit (should have used && when checking for ending instructions, not ||)
svn-id: r42242