[Scummvm-cvs-logs] SF.net SVN: scummvm:[48699] scummvm/trunk/engines/sci/graphics/text16.cpp

Max Horn max at quendi.de
Mon Apr 19 11:15:06 CEST 2010


Am 18.04.2010 um 14:09 schrieb m_kiewitz at users.sourceforge.net:

> Revision: 48699
>          http://scummvm.svn.sourceforge.net/scummvm/?rev=48699&view=rev
> Author:   m_kiewitz
> Date:     2010-04-18 12:09:22 +0000 (Sun, 18 Apr 2010)
> 
> Log Message:
> -----------
> SCI: sierra sci reacts on 0xD and 0xA to end a line. We only reacted on 0xA and ignored 0xD before (fixes subtitles in multilingual games, because the official subtitle separator is 0xD'----'0xD)


Do you fall through there on purpose? Right now it looks to me as if you are looking for the sequence 0xD 0xA and if you encounter it, you increment curCharCount in total 3 +2 = 5 times: first you see the 0xD, and since it is followed by 0xA, you increment curCharCount twice, and one more time right after the switch statement. Then, you advance to the next char, which is 0xA, and you again increment curCharCount twice. 

Also, you add getCharWidth(0xD) and getCharWidth(0xA) to "width", is that safe / correct?

This code is really weird, and some brief comments explaining it, or as much as you know about it at least, would be really good :).

Bye,
Max

> 
> Modified Paths:
> --------------
>    scummvm/trunk/engines/sci/graphics/text16.cpp
> 
> Modified: scummvm/trunk/engines/sci/graphics/text16.cpp
> ===================================================================
> --- scummvm/trunk/engines/sci/graphics/text16.cpp	2010-04-18 10:15:56 UTC (rev 48698)
> +++ scummvm/trunk/engines/sci/graphics/text16.cpp	2010-04-18 12:09:22 UTC (rev 48699)
> @@ -179,9 +179,9 @@
> 			break;
> 
> 		case 0xD:
> -			curCharCount++;
> -			continue;
> -
> +			// Check, if 0xA is following, if so include it as well
> +			if ((*(unsigned char *)text) == 0xA)
> +				curCharCount++;
> 		case 0xA:
> 			curCharCount++;
> 		case 0:
> 
> 
> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
> 
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Scummvm-cvs-logs mailing list
> Scummvm-cvs-logs at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scummvm-cvs-logs
> 





More information about the Scummvm-git-logs mailing list