36 Commits

Author SHA1 Message Date
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
71c7ae9fbb CINE: Extend "labyrinthCheat" console command to cover Operation Stealth Scene 8 (Rats' Maze).
These arcade puzzles are hard, but solvable. This command is intended to aid debugging and rapid playtesting.

svn-id: r55198
2011-01-11 01:35:38 +00:00
David Turner
d54fa49b5f CINE: Add console command "labyrinthCheat" to help with Operation Stealth Playtesting.
This command activates a cheat for the Operation Stealth Scene 6 arcade section i.e. Chased by Guards in Labyrinths in Otto's Mansion. These puzzles are quite hard and thus discourage playtesting beyond this point, especially since it is not possible to save (This may be a bug compared to the original interpreter).

Also, added extra debug output to aid script debug output.

svn-id: r55189
2011-01-09 18:12:30 +00:00
David Turner
f96c8f6e39 CINE: Fix CollisionPage Uninitialised Reads in Operation Stealth.
The collisionPage is only initialised with values when loadCtFw() / loadCtOS() is called.
However, currently during the display of the Delphine Software Logo in Operation Stealth,
checkCollision() is called, but the collisionPage has not been loaded.
To fix the invalid reads, have added code to set the page to zero after allocation.
Shouldn't cause any issues to FW as this will load over the top anyway.

Have also added debug output around this behaviour so that if this is not sufficient i.e. a collision page load is actually missing, then this will aid investigation.

svn-id: r55071
2010-12-31 09:14:49 +00:00
David Turner
fef667cbe9 CINE: Fixed mismatched deallocation in ScriptVars reported by Valgrind.
svn-id: r55058
2010-12-29 09:50:48 +00:00
Max Horn
3534cff8ef ALL: Fix indention (whitespaces -> tabs)
svn-id: r53738
2010-10-23 15:46:50 +00:00
Eugene Sandulenko
327d30d719 CINE: eliminate global variables
svn-id: r51937
2010-08-09 11:38:01 +00:00
Max Horn
37b7be4519 CINE: Change Doxygen commands to match our CFC
svn-id: r48764
2010-04-21 21:22:43 +00:00
Max Horn
51933629d1 Changed foo(void) to foo() in almost all non-backend source files
svn-id: r45616
2009-11-02 21:54:57 +00:00
Johannes Schickel
8daf7fbba8 Changed some type names to match our coding guidelines.
svn-id: r44224
2009-09-20 23:34:48 +00:00
Johannes Schickel
4e4074f393 Fix valgrind warning inside "saturatedAddColor", when using the same palette object as both source and destination.
svn-id: r44094
2009-09-15 00:03:21 +00:00
Kari Salminen
9b2104db32 Workaround for bug #2848940 (ScummVM crashes with Future wars): getZoneFromPositionRaw accessed data outside its 320x200 buffer because Y values in range 200-232 were given to it. Original doesn't properly handle this either so trying this workaround of returning zero for positions outside the 320x200 buffer. Hopefully nothing else breaks in Future Wars because of this (More testing is direly needed!).
svn-id: r43920
2009-09-03 20:56:44 +00:00
Kari Salminen
e5c2275e80 Fix for bug #2669415 (FW: half walking speed in a screen).
svn-id: r42439
2009-07-13 16:52:09 +00:00
Eugene Sandulenko
d5b9437fb3 Fix bug #2055836: "FW: Music is not restarted when loading a saved game"
svn-id: r40465
2009-05-11 19:31:55 +00:00
Johannes Schickel
da3516248c Fixed compilation (along with it const correctness).
svn-id: r38287
2009-02-15 20:19:06 +00:00
Chris Apers
3ceb1482db Quick dirty hack to make the engine run again on PalmOS
svn-id: r38278
2009-02-15 18:53:27 +00:00
Max Horn
ac59693be2 A ton of code formatting fixes; also fixed warnings about single line loops like 'while(cond);' by inserting newlines
svn-id: r36127
2009-01-29 05:26:12 +00:00
Kari Salminen
c501ef1450 Cleanup (Removed an extra 'return 0').
svn-id: r34826
2008-10-19 08:52:04 +00:00
Kari Salminen
cc82aeb18d Workaround for bug #2054882 (FW: Impossible to survive entering monastery (regression)):
For Future Wars o1_compareGlobalVar now compares global variable 255 to be equal to everything.
The scripts probably tested global variable 255 for equality with some value (Maybe 143?)
to see whether copy protection was properly passed.

svn-id: r33950
2008-08-16 22:15:57 +00:00
Kari Salminen
f5e9a3e185 Tiny comment update to loadCt-opcodes: Load collision table data.
svn-id: r33670
2008-08-06 20:58:02 +00:00
Kari Salminen
a10753e2a1 Renamed page3Raw to collisionPage so it's more apparent what it does.
svn-id: r33669
2008-08-06 20:54:38 +00:00
Kari Salminen
66fc0d6a25 Add 320x200 screen bounds checking to Operation Stealth's checkCollision function.
Fixes teleporting bug when getting out of the water after first arcade sequence.
The player previously got teleported to the beach near the hotel. Now it doesn't happen.
The player is still caught motionless and can't move after this fix though...

svn-id: r33668
2008-08-06 20:47:59 +00:00
Max Horn
0be985ce83 Changed class File (and derived classes) to only support read-only access; added a new class DumpFile for writing
svn-id: r33412
2008-07-29 16:09:10 +00:00
Kari Salminen
d83c6d7d68 Added purgeSeqList function (Used in mainloop now). Let's see if this helps any...
Renamed functions:
* addScriptToList0 -> addScriptToGlobalScripts
* executeList0     -> executeGlobalScripts
* executeList1     -> executeObjectScripts
* purgeList1       -> purgeObjectScripts (Also added a clarifying TODO to this function)
* purgeList0       -> purgeGlobalScripts (Also added a clarifying TODO to this function)

svn-id: r33409
2008-07-29 13:44:14 +00:00
Kari Salminen
d2639f0c84 Fixed crash when running Operation Stealth introduced in r33339 (There are actually 256 global variables although only 255 of them are saved and loaded from savegames. The last one is VAR_BYPASS_PROTECTION and it is written to in the mainLoop so that's why there was a crash).
svn-id: r33380
2008-07-28 16:46:20 +00:00
Kari Salminen
55bf215ba4 Renamed opcodes 0x49 and 0x68:
- Opcode 0x49: setDefaultMenuColor2 -> setDefaultMenuBgColor
- Opcode 0x68: setDefaultMenuColor  -> setPlayerCommandPosY

svn-id: r33240
2008-07-23 14:19:31 +00:00
Kari Salminen
2a90435e5d Fix for bug #2019355 (FW: broken compatibility with 0.11.1 saves):
- Changed savegame loading related functions to use SeekableReadStream
  rather than InSaveFile so MemoryReadStream can be used transparently.
- Fixed loadResourcesFromSave to load multiframe animations correctly
  and to load 0.11.0/0.11.1 Future Wars savegames which used a slightly
  different format.
- Added a savegame format detector that tries to detect between the old
  Future Wars savegame format, the new one and a broken revision of the
  new one.
- Changed makeLoad to first load the savegame fully into memory and only
  then handle it (If the savegame's packed then it's unpacked first). If
  the packed savegame can't tell its unpacked size (i.e. it's using zlib
  format) then we'll try to load up to 256kB of the savegame data.
Thanks to wjp for his help with nailing this release critical bug.

svn-id: r33192
2008-07-22 10:15:58 +00:00
Kari Salminen
60357650e0 Fix for bug #2016647 (FW: crash with italian amiga version).
- Consists of a workaround for a script bug that used local
  variable 251 when it should've used global variable 251.
- Also added a fix for a crash when failing copy protection
  in Amiga or Atari ST versions of Future Wars.
NOTE: That any of the Amiga or Atari ST versions of Future Wars
haven't crashed right in the beginning before seems like plain
luck because accessing local variable 251 is out of bounds!

svn-id: r33068
2008-07-14 23:10:51 +00:00
Kari Salminen
e415a97fe5 Removed TODO from checkCollision: Updating zoneQuery each time checkCollision is called seems to be fine.
svn-id: r32852
2008-06-30 18:15:34 +00:00
Kari Salminen
68c598a3f3 Comments update.
svn-id: r32801
2008-06-26 15:16:15 +00:00
Kari Salminen
1d71ab7e1f Fix for GCC warning (Warned about testing x >= 0 when x is unsigned and therefore the test is always true).
svn-id: r32791
2008-06-25 22:13:18 +00:00
Kari Salminen
1339a55389 Implemented support for zoneQuery (Operation Stealth specific).
Fixed opcodes (related to zoneQuery):
- 0x08: o1_checkCollision
- 0x9A: o2_wasZoneChecked
NOTE: Savegame support for the zoneQuery data is broken

svn-id: r32790
2008-06-25 21:57:08 +00:00
Kari Salminen
b6b1b864be Checked that opcodes 0x71-0x73 really do nothing else but read the parameters in PC versions of Future Wars and Operation Stealth. Maybe they're used in the Amiga versions?
svn-id: r32396
2008-05-30 11:12:14 +00:00
Kari Salminen
94d1e7effb Implemented opcodes 0x04 (o1_mulObjectParam) and 0x05 (o1_divObjectParam).
svn-id: r32393
2008-05-30 10:43:21 +00:00
Eugene Sandulenko
f2d72d9473 Patch #1969189: "CinE renderer rewrite"
svn-id: r32257
2008-05-24 22:11:41 +00:00
Eugene Sandulenko
57a9ef3a8f Patch #1941066: "CinE sprite overlay rewrite" courtsey of next_ghost
svn-id: r31651
2008-04-21 20:51:17 +00:00