[Scummvm-cvs-logs] SF.net SVN: scummvm: [31566] scummvm/trunk/engines/kyra/text_v2.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sat Apr 19 00:23:32 CEST 2008


Revision: 31566
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31566&view=rev
Author:   lordhoto
Date:     2008-04-18 15:23:31 -0700 (Fri, 18 Apr 2008)

Log Message:
-----------
Cleanup.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/text_v2.cpp

Modified: scummvm/trunk/engines/kyra/text_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text_v2.cpp	2008-04-18 21:44:55 UTC (rev 31565)
+++ scummvm/trunk/engines/kyra/text_v2.cpp	2008-04-18 22:23:31 UTC (rev 31566)
@@ -430,19 +430,13 @@
 }
 
 void KyraEngine_v2::updateDlgBuffer() {
-	static const char DlgFileTemplate[] = "CH**-S**.DLG";
 	char filename[13];
-	filename[12] = 0;
-	memcpy(filename, DlgFileTemplate, 12);
 
 	static const char suffixTalkie[] = "EFG";
 	static const char suffixTowns[] = "G  J";
 	const char * suffix = _flags.isTalkie ? suffixTalkie : suffixTowns;
 
-	filename[2] = (char)((_currentChapter / 10 + 48) & 0xFF);
-	filename[3] = (char)((_currentChapter % 10 + 48) & 0xFF);
-
-	if (!(_flags.platform == Common::kPlatformPC && !_flags.isTalkie))
+	if (_flags.platform != Common::kPlatformPC || _flags.isTalkie)
 		filename[11] = suffix[_lang];
 
 	if (_currentChapter == _npcTalkChpIndex && _mainCharacter.dlgIndex == _npcTalkDlgIndex)
@@ -451,8 +445,7 @@
 	_npcTalkChpIndex = _currentChapter;
 	_npcTalkDlgIndex = _mainCharacter.dlgIndex;
 
-	filename[6] = (char)((_npcTalkDlgIndex / 10 + 48) & 0xFF);
-	filename[7] = (char)((_npcTalkDlgIndex % 10 + 48) & 0xFF);
+	snprintf(filename, 13, "CH%.02d-S%.02d.DLG", _currentChapter, _npcTalkDlgIndex);
 
 	if (_dlgBuffer)
 		delete [] _dlgBuffer;


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