50 Commits

Author SHA1 Message Date
Willem Jan Palenstijn
89cd5e7416 SCI: Add GetAngle for SCI1 that matches SSCI
Thanks to waltervn for creating a scis test script to verify.
2013-01-24 22:10:20 +01:00
Filippos Karapetis
b95695719f SCI: Fix angle rounding in the SCI1 implementation of kGetAngle (bug #3601479)
Fixes bug #3601479 - "SCI KQ6: Castle walls - stuck in same room".
Many thanks to wjp for his help on the kGetAngle implementation
2013-01-22 00:56:46 +02:00
Filippos Karapetis
9568b78bab SCI: Use a simpler atan implementation for kGetAngle in SCI1 and newer games
SCI1 games (QFG2 and newer) use a simpler and more accurate atan implementation
for kGetAngle. This properly fixes bug #3540976.
2012-08-21 03:32:18 +03:00
Filippos Karapetis
078c09c13e SCI: Update comments in kGetAngleWorker() 2012-07-09 01:33:38 +03:00
Filippos Karapetis
262c7a1fb7 SCI: Fix a typo and add some comments to kGetAngleWorker() 2012-07-08 22:01:13 +03:00
Filippos Karapetis
4c43d6d85d SCI: Add a hack in kGetAngleWorker to fix bug #3540976
kGetAngle(Worker) has been implemented based on behavior observed
with a test program created with SCI Studio. However, the return values
have subtle differences from the original, which uses atan(). This
temporary hack will do for now till the implementation of kGetAngle is
done again. A simpler atan2-based implementation has also been added for
future reference
2012-07-08 16:15:43 +03:00
Filippos Karapetis
0b4802c24b SCI: Fixed bug #3413020 - "SCI: Longbow: Robin is stuck in the final monk chase scene"
Special thanks to wjp for his work on bisecting to find the regression and
for checking against the KQ5CD disasm
2011-09-23 00:22:44 +03:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
md5
0eb2c4709e SCI: Changed several places that use PI to use the standard M_PI instead 2011-03-19 02:22:06 +02:00
Filippos Karapetis
db133990e9 SCI: Properly cast the results of kTimesSin and kTimesCos to 16-bit integers
svn-id: r54042
2010-11-02 16:07:22 +00:00
Martin Kiewitz
4766cc5bb5 SCI: reuse kGetAngle from kDoAvoider
svn-id: r52560
2010-09-05 13:51:47 +00:00
Martin Kiewitz
3e427b725b SCI: added another comment to kRandom
about hoyle4

svn-id: r52246
2010-08-20 22:14:48 +00:00
Martin Kiewitz
1b9d95e43c SCI: kRandom now exactly behaving like sierra sci
hoyle4 and lsl5 door code work now

svn-id: r52244
2010-08-20 21:59:14 +00:00
Filippos Karapetis
f8957603e6 SCI: Fixed typos in kRandom()
svn-id: r52242
2010-08-20 21:05:56 +00:00
Filippos Karapetis
29adf97a14 SCI: Reverted kRandom to use unsigned integers again (used e.g. in LSL5) and added a temporary hack for the special case in Hoyle 4 (0x0, 0xFFFF), till we find out how this is handled correctly
svn-id: r52240
2010-08-20 21:02:24 +00:00
Filippos Karapetis
8d037cd5af SCI: Fixed bug #3039308 - "HOYLE4: Rules Dialog missing background"
svn-id: r52237
2010-08-20 18:52:21 +00:00
Torbjörn Andersson
b49761b6ea SCI: Change abs() to ABS()
I'm not sure why we define our own ABS(), but I assume we have some
compelling reason for it.

svn-id: r52105
2010-08-15 19:01:18 +00:00
Johannes Schickel
e29d6e681a SCI: Switch to Common::RandomSource.
Since I got no response to my mail to -devel, I just assume that there is
no specific reason for using rand() in SCI.

As explained in my mail to -devel about why SCI uses rand, this might allow
SCI to work with our event recording, when that ever gets finished.

I adapted kRandom so that it also supports negative random numbers. And
furthermore that the toNumber argument is smaller than the fromNumber
argument. I am not sure whether that really happens though, but it should
be safer to have this. I marked that place with an TODO/CHECKME.

svn-id: r51521
2010-07-30 22:47:01 +00:00
Martin Kiewitz
021c5d11db SCI: changed kRandom signature
accepts 1-3 parameters now for all SCI versions (shouldnt hurt and argc 3 will error() out anyway)
changed comments a bit

svn-id: r51438
2010-07-28 21:55:40 +00:00
Martin Kiewitz
abf53f839a SCI: implement additional variants of kRandom
fixes pq1vga poker game (bug #3036125)

svn-id: r51435
2010-07-28 21:47:15 +00:00
Martin Kiewitz
5c2489f153 SCI: removing hoyle workaround from kAbs & signature and adding it into workaround table
svn-id: r50790
2010-07-10 19:58:25 +00:00
Max Horn
8ae9774a00 SCI: Turn more warnings into errors.
If one of these is triggered for you, you can add an exception to
the error, together with a comment explaining why this exception
is necessary. Ideally after verifying that the cause is a script
bug and not a bug in our code...

svn-id: r50442
2010-06-28 12:29:06 +00:00
Martin Kiewitz
cf3a37585c SCI: making hack inside kAbs hoyle1 specific, added fixme
svn-id: r50309
2010-06-26 09:34:14 +00:00
Filippos Karapetis
894ba682cd Moved kMulDiv together with the rest of the math functions, and kPlayVMD together with the rest of the video playing functions
svn-id: r49920
2010-06-17 07:26:06 +00:00
Filippos Karapetis
b6c46c752c Moved getAngle() inside kmovement.cpp, the only place where it's actually used
svn-id: r45903
2009-11-14 17:53:30 +00:00
Walter van Niftrik
7f8a8732a1 SCI: Fix hoyle hack
svn-id: r45619
2009-11-02 23:06:30 +00:00
Max Horn
86b81c8eb6 SCI: Fix warning about double being silently converted to int
svn-id: r45262
2009-10-20 11:14:04 +00:00
Martin Kiewitz
bf4cf09eec SCI: kRandom behaviour fixed, fixes lsl5 patty random door code
svn-id: r45250
2009-10-19 19:38:42 +00:00
Filippos Karapetis
30084d72a5 Added a new special reg_t, SIGNAL_REG, for signaling when an error occurs (usually), or to signal success in some special occasions
svn-id: r44505
2009-09-30 23:00:03 +00:00
Filippos Karapetis
f9296a6445 - Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them

Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now

svn-id: r44461
2009-09-29 14:24:07 +00:00
Filippos Karapetis
180b3f1247 Create a define for the special "signal" offset used throughout the engine, and fixed the arbitrary 0 values from commit #44294, set when some math functions do invalid calculations
svn-id: r44359
2009-09-25 16:15:57 +00:00
Max Horn
4221773f6a SCI: Pedantic cleanup
svn-id: r44356
2009-09-25 13:01:35 +00:00
Max Horn
881eee8105 SCI: Fix spelling
svn-id: r44318
2009-09-24 22:10:39 +00:00
Johannes Schickel
f2a07d7ae9 Fix what looks like a typo in the condition, which checks for a divide by zero.
svn-id: r44306
2009-09-24 14:07:02 +00:00
Filippos Karapetis
fbe1586abc The maximum value that a signed 16-bit integer can hold is 32767, not 32768 (0x8000)
svn-id: r44294
2009-09-24 09:41:11 +00:00
Max Horn
6c44eafa97 SCI: funct_nr is not used in 99% of all opcodes -- hide it in those (to be removed eventually)
svn-id: r43905
2009-09-02 11:33:25 +00:00
Filippos Karapetis
3b687a7a04 Replaced KP_ALT, SKPV_OR_ALT and UKPV_OR_ALT
svn-id: r41340
2009-06-07 16:50:34 +00:00
Filippos Karapetis
744323ca33 Replaced/removed KP_UINT, KP_SINT, SKPV and UKPV as well as the VIEW_PRIORITY and PRIORITY_BAND_FIRST wrappers
svn-id: r41338
2009-06-07 15:53:30 +00:00
Max Horn
479751104f SCI: Renamed include/engine.h to engine/state.h; added a corresponding .cpp file with the EngineState constructor
svn-id: r38921
2009-02-27 02:23:40 +00:00
Max Horn
b5df97ad2b SCI: Moved kernel.h and kdebug.h from include/ to engine/; untangled header deps some more
svn-id: r38833
2009-02-24 05:51:55 +00:00
Max Horn
ff17899d8e SCI: Got rid of include/scitypes.h
svn-id: r38746
2009-02-21 21:16:41 +00:00
Jordi Vilalta Prat
3cc6cdf719 Replaced "typedef struct _state state_t" with "struct EngineState"
svn-id: r38678
2009-02-21 10:47:56 +00:00
Oystein Eftevaag
25f7c37171 Wrapped the SCI engine in the Sci namespace.
svn-id: r38676
2009-02-21 10:23:36 +00:00
Filippos Karapetis
ac716ad843 Started conversion of debug messages and debug levels to the ScummVM equivalents. Removed the "stubs" and "warnings" debug levels and replaced such kinds of messages with normal warnings
svn-id: r38617
2009-02-20 20:11:12 +00:00
Paweł Kołodziejski
f4719cf79c formating
svn-id: r38600
2009-02-20 16:22:09 +00:00
Eugene Sandulenko
22a009d3c6 Update headers. engine/
svn-id: r38408
2009-02-17 15:02:16 +00:00
Max Horn
57434d955f SCI: Run astyle to make the code be more compliant with our Code Formatting Guidelines: engine dir
svn-id: r38317
2009-02-15 22:28:12 +00:00
Paweł Kołodziejski
0724206156 fixed compilation and linking with msvc9
svn-id: r38232
2009-02-15 12:29:09 +00:00
Filippos Karapetis
25ddb00436 Silenced more warnings
svn-id: r38230
2009-02-15 12:23:16 +00:00
Eugene Sandulenko
e241843bec - Remove some unneeded files
- Mass rename .c to .cpp

svn-id: r38227
2009-02-15 11:39:07 +00:00