Commit Graph

84 Commits

Author SHA1 Message Date
Littleboy
b694a78f62 ANALYSIS: Add static casts to is* functions
This fixes a potential problem with passing char values that would be sign-extended and yield unexpected results.
See http://msdn.microsoft.com/en-us/library/ms245348.aspx
2011-06-23 08:52:52 -04:00
Max Horn
88913c0139 ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
  git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-06-20 00:59:48 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
David Turner
00d78dd3d5 PARALLACTION: Fix for DoorData Memory Leak in Big Red Adventure.
svn-id: r55232
2011-01-13 21:58:54 +00:00
Nicola Mettifogo
466479eb77 Added a parser for kZoneNone zones/animations in BRA.
The only thing it does is parsing a possible command list, which is enough to support the script bug in "scende2". See ticket #3005384.

svn-id: r49628
2010-06-13 09:07:15 +00:00
Nicola Mettifogo
f84b232443 Add a parser for HEAR zones in BRA, and handle the relative MUSIC command. Patch 3003382 by fuzzie, with enhancements.
svn-id: r49105
2010-05-19 17:16:15 +00:00
Nicola Mettifogo
83c8679127 Moved parser functions arrays to file scope, as they were tripping up the obsolete gcc used for the BeOS/Haiku port. If anybody can work out a better solution please apply it, because this makes me sick.
svn-id: r42793
2009-07-26 08:37:03 +00:00
Torbjörn Andersson
0999534749 The error() and warning() functions add ! and newline automatically. (I didn't
look at debug() and debugC(), since I'm really bored with this now. :-)

svn-id: r41061
2009-05-31 10:02:16 +00:00
Nicola Mettifogo
20bdfe4173 Moved background and character loading code from LocationParser_br to the engine for BRA.
svn-id: r39814
2009-04-03 17:09:12 +00:00
Max Horn
fb6d0a7119 PARALLACTION: Fix silly Mingw 'shadowed declaration' warnings
svn-id: r39809
2009-04-03 14:53:15 +00:00
Nicola Mettifogo
5fa83a26e6 Implemented IFCHAR command. This makes part 3 of BRA completely explorable.
svn-id: r39742
2009-03-29 14:09:24 +00:00
Nicola Mettifogo
666f0720ab (Re)link bounding animations after location has been completely parsed. This avoids problems due to forward references.
svn-id: r39740
2009-03-29 13:56:16 +00:00
Nicola Mettifogo
28465d73bb Merged CommandData into Command.
svn-id: r39732
2009-03-29 10:18:09 +00:00
Nicola Mettifogo
0998f53cb0 Refactored the zone type parsers.
svn-id: r39650
2009-03-23 23:17:33 +00:00
Nicola Mettifogo
d82aea1e54 Turned ZoneTypes into a regular numeric id (no more a bitfield).
svn-id: r39648
2009-03-23 22:34:46 +00:00
Nicola Mettifogo
2223627c75 Merged GetData, HearData, SpeakData, PathData, ExamineData, MergeData into TypeData struct. This simplifies life a bit especially in the parsers.
svn-id: r39645
2009-03-23 20:41:54 +00:00
Nicola Mettifogo
8cebcaf017 Pushed down dependencies from parser.h
svn-id: r39636
2009-03-23 17:42:08 +00:00
Nicola Mettifogo
d18274d0ee Implemented all variants of IF script instruction. Program class has been changed to store an Array of instruction instead of a List, so that references to instructions are integers.
svn-id: r39631
2009-03-23 11:38:09 +00:00
Nicola Mettifogo
739181c3b7 Postpone loading of mask and path data on BRA. This fixed locations in which mask and path are defined before the screen bitmap.
svn-id: r39512
2009-03-18 10:55:05 +00:00
Nicola Mettifogo
6398e56d09 Added midi support to BRA. So far music starts, but related script commands haven't been implemented yet.
svn-id: r39397
2009-03-14 17:02:28 +00:00
Nicola Mettifogo
33a8fe7a7e Initialize and save zones flags and follower position when a location switch occurs.
svn-id: r39064
2009-03-02 08:36:42 +00:00
Nicola Mettifogo
44906f574f The engine has now to build the drawing list for the graphic department, instead of setting visibility flags; the new field _prog has been added to GfxObj to help sorting the list.
The outcome is that cleaning up unused resources on location switches is now easier to manage, and less error prone.

svn-id: r38928
2009-02-27 08:56:19 +00:00
Nicola Mettifogo
88efc8603e Removed null*Ptr dummy objects, using SharedPtr's reset method to null pointers instead.
svn-id: r38897
2009-02-26 10:44:01 +00:00
Nicola Mettifogo
93666ef53c Updated all for(;;) loops to use prefix increment on iterators.
svn-id: r38876
2009-02-25 08:53:58 +00:00
Nicola Mettifogo
6334125d1c Implemented follower support, except that:
* follower is forgotten when location changes (see freeLocation)
* the final walking frame is screwed

svn-id: r38838
2009-02-24 11:20:45 +00:00
Nicola Mettifogo
e3afa772e2 Cleanup.
svn-id: r38817
2009-02-23 12:17:25 +00:00
Nicola Mettifogo
d1b71335d6 Fixed support for walking zones in BRA:
* patches are not applied if the zone is not visible when loading 
* when applying a patch, always overwrite the existing data instead of OR'ing

svn-id: r36209
2009-02-03 10:42:27 +00:00
Nicola Mettifogo
e5d75d1f7b Fixed regression from revision 35765. Mask and path patches were destroyed before getting a chance to be used.
svn-id: r35835
2009-01-12 13:14:09 +00:00
Nicola Mettifogo
f1ad8b6934 Extended PathBuffer to support BRA.
svn-id: r35766
2009-01-07 08:16:18 +00:00
Nicola Mettifogo
21fae9d029 * moved more mask management to BackgroundInfo
* simplified mask management for client code
* reduced the clutter into graphics.h by moving the implementations of BackgroundInfo, MaskBuffer and PathBuffer to graphics.cpp
* preparation for the full implementation of BRA's PathBuffer

svn-id: r35765
2009-01-07 07:35:11 +00:00
Nicola Mettifogo
f2b495ba2d Implemented counters in BRA. Only valid answer options are shown, and counter calculations in scripts are performed.
svn-id: r35723
2009-01-04 14:23:20 +00:00
Nicola Mettifogo
b2d7ae871b Dropped the script preprocessor introduced to fix the broken scripts. The parser has evolved in the meantime and can deal with it accordingly.
svn-id: r35700
2009-01-03 14:03:12 +00:00
Nicola Mettifogo
025b2a93e9 Moved mask creation/handling to Gfx.
svn-id: r35447
2008-12-20 08:15:09 +00:00
Nicola Mettifogo
774773b7cd Reduced code duplication when manipulating Animations, and cleanup.
svn-id: r35408
2008-12-17 11:15:47 +00:00
Nicola Mettifogo
e98bc7e402 Removed some unused code.
svn-id: r35357
2008-12-14 10:08:31 +00:00
Nicola Mettifogo
3eeece6a25 * cleanup
* moved find routines from Parallaction to Location

svn-id: r34940
2008-11-08 15:02:19 +00:00
Nicola Mettifogo
fc4256ca85 Fixed error in parsing.
svn-id: r34093
2008-08-22 06:32:12 +00:00
Nicola Mettifogo
7891e5afce Implemented raster operation for masks and postponed blitting of zones after everything in the location has been loaded. This fixes the remaining problems with animations not being masked by items.
svn-id: r33903
2008-08-15 15:08:08 +00:00
Nicola Mettifogo
05a021fd95 Added routines to load and handle item masks: animation are now correctly hidden when they are behind any object. The masks of items that are not explicitly activated (even if visible) still are handled (e.g. the crown in the museum is not visible in the foreground).
svn-id: r33900
2008-08-15 14:25:43 +00:00
Nicola Mettifogo
22eaffcb34 Updated layer calculation: animations are now hidden properly by background elements (but not items yet).
svn-id: r33894
2008-08-15 08:44:41 +00:00
Nicola Mettifogo
0606fef24e Made coordinates and frame number protected into Zone and Animation, and changed client code to use get/set. This will allow various simplifications (e.g. when calculating Z), and is a step towards correct handling of interactive zones of Zone/Animation in BRA.
svn-id: r33892
2008-08-15 04:30:45 +00:00
Nicola Mettifogo
c70d09bc26 Made scripts access Animation fields via accessors and mutators, instead of using raw pointers.
svn-id: r33891
2008-08-15 03:59:45 +00:00
Nicola Mettifogo
2679f6ce7a Disabled lip syncing code in BRA, since I couldn't find any scripts actually using it. Some warnings have been added as a sentinel.
svn-id: r33890
2008-08-15 03:36:01 +00:00
Nicola Mettifogo
ea2a2cbb7c Simplified handling of script variables (especially locals).
svn-id: r33889
2008-08-15 02:52:42 +00:00
Nicola Mettifogo
86079c20f5 Fixed issues detected by DrMcCoy's obnoxious compiler. ;)
svn-id: r33511
2008-08-02 02:43:05 +00:00
Nicola Mettifogo
15aada52c4 * Added a preprocessor to deal with the crappy location scripts in BRA.
* Added some comments on how the parser and related code should be changed to make things smoother.

svn-id: r33509
2008-08-02 02:24:36 +00:00
Nicola Mettifogo
f5b7004fae * Removed references to the current _backgroundInfo from parser code.
* Re-enabled masks (in BRA DOS).

svn-id: r33474
2008-07-31 15:15:42 +00:00
Nicola Mettifogo
6ed4beb1bf Made changing of background more flexible, in that the engine can now configure its BackgroundInfo before passing it to Gfx.
svn-id: r33469
2008-07-31 12:50:43 +00:00
Nicola Mettifogo
591973c827 Changed Gfx::_backgroundInfo to be a pointer. This temporarily kills all z-buffering.
svn-id: r33468
2008-07-31 12:26:12 +00:00