[Scummvm-cvs-logs] SF.net SVN: scummvm:[54042]	scummvm/trunk/engines/sci/engine/kmath.cpp
    thebluegr at users.sourceforge.net 
    thebluegr at users.sourceforge.net
       
    Tue Nov  2 17:07:23 CET 2010
    
    
  
Revision: 54042
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54042&view=rev
Author:   thebluegr
Date:     2010-11-02 16:07:22 +0000 (Tue, 02 Nov 2010)
Log Message:
-----------
SCI: Properly cast the results of kTimesSin and kTimesCos to 16-bit integers
Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kmath.cpp
Modified: scummvm/trunk/engines/sci/engine/kmath.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmath.cpp	2010-11-02 11:20:43 UTC (rev 54041)
+++ scummvm/trunk/engines/sci/engine/kmath.cpp	2010-11-02 16:07:22 UTC (rev 54042)
@@ -126,14 +126,14 @@
 	int angle = argv[0].toSint16();
 	int factor = argv[1].toSint16();
 
-	return make_reg(0, (int)(factor * sin(angle * PI / 180.0)));
+	return make_reg(0, (int16)(factor * sin(angle * PI / 180.0)));
 }
 
 reg_t kTimesCos(EngineState *s, int argc, reg_t *argv) {
 	int angle = argv[0].toSint16();
 	int factor = argv[1].toSint16();
 
-	return make_reg(0, (int)(factor * cos(angle * PI / 180.0)));
+	return make_reg(0, (int16)(factor * cos(angle * PI / 180.0)));
 }
 
 reg_t kCosDiv(EngineState *s, int argc, reg_t *argv) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
    
    
More information about the Scummvm-git-logs
mailing list