[Scummvm-cvs-logs] CVS: scummvm/kyra kyra.cpp,1.40,1.41 kyra.h,1.15,1.16 screen.cpp,1.8,1.9 screen.h,1.5,1.6

Gregory Montoir cyx at users.sourceforge.net
Fri Sep 9 17:16:40 CEST 2005


Update of /cvsroot/scummvm/scummvm/kyra
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12196/kyra

Modified Files:
	kyra.cpp kyra.h screen.cpp screen.h 
Log Message:
fixed line breaks ; cleanup

Index: kyra.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/kyra.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- kyra.cpp	9 Sep 2005 21:13:43 -0000	1.40
+++ kyra.cpp	10 Sep 2005 00:15:40 -0000	1.41
@@ -189,9 +189,26 @@
 	_screen->loadFont(Screen::FID_8_FNT, _res->fileData("8FAT.FNT", &sz));
 	_screen->setScreenDim(0);
 	seq_intro();
+	startup();
+	mainLoop();
 	return 0;
 }
 
+void KyraEngine::startup() {
+	debug(9, "KyraEngine::startup()");
+	static const uint8 colorMap[] = { 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0 };
+	_screen->setTextColorMap(colorMap);
+	_screen->setFont(Screen::FID_6_FNT);
+	_screen->setAnimBlockPtr(3750);
+	memset(_flagsTable, 0, sizeof(_flagsTable));
+	// XXX
+}
+
+void KyraEngine::mainLoop() {
+	debug(9, "KyraEngine::mainLoop()");
+	// XXX
+}
+
 void KyraEngine::loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData) {
 	debug(9, "KyraEngine::copyBitmap('%s', %d, %d, 0x%X)", filename, tempPage, dstPage, palData);
 	uint32 fileSize;
@@ -238,7 +255,6 @@
 }
 
 int KyraEngine::getCharLength(const char *str, int len) {
-	debug(9, "KyraEngine::preprocessString('%s', %d)", str, len);
 	debug(9, "KyraEngine::getCharLength('%s', %d)", str, len);
 	int charsCount = 0;
 	if (*str) {
@@ -258,9 +274,10 @@
 int KyraEngine::dropCRIntoString(char *str, int offs) {
 	debug(9, "KyraEngine::dropCRIntoString('%s', %d)", str, offs);
 	int pos = 0;
+	str += offs;
 	while (*str) {
 		if (*str == ' ') {
-			*str = 0xD;
+			*str = '\r';
 			return pos;
 		}
 		++str;
@@ -275,7 +292,7 @@
 	strcpy(_talkBuffer, str);
 	char *p = _talkBuffer;
 	while (*p) {
-		if (*p == 0xD) {
+		if (*p == '\r') {
 			return _talkBuffer;
 		}
 		++p;
@@ -309,9 +326,9 @@
 	int currentLine = 0;
 	int pos = 0;
 	while (*str) {
-		if (*str == 0xD) {
+		if (*str == '\r') {
 			assert(currentLine < TALK_SUBSTRING_NUM);
-			_talkSubstrings[currentLine * TALK_SUBSTRING_LEN + pos] = 0;
+			_talkSubstrings[currentLine * TALK_SUBSTRING_LEN + pos] = '\0';
 			++currentLine;
 			pos = 0;
 		} else {
@@ -500,6 +517,7 @@
 	debug(9, "KyraEngine::seq_introStory()");
 	loadBitmap("MAIN_ENG.CPS", 3, 3, 0);
 	_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
+	// XXX wait 360 ticks
 }
 
 void KyraEngine::seq_introMalcomTree() {
@@ -512,12 +530,10 @@
 void KyraEngine::seq_introKallakWriting() {
 	debug(9, "KyraEngine::seq_introKallakWriting()");
 	seq_makeHandShapes();
-	uint8 *p = (uint8 *)malloc(5060);
-	_screen->setAnimBlockPtr(p, 5060);
+	_screen->setAnimBlockPtr(5060);
 	_screen->_charWidth = -2;
 	_screen->clearPage(3);
 	seq_playSpecialSequence(_seq_introData_KallakWriting, true);
-	free(p);
 	seq_freeHandShapes();
 }
 

Index: kyra.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/kyra.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- kyra.h	9 Sep 2005 21:13:43 -0000	1.15
+++ kyra.h	10 Sep 2005 00:15:40 -0000	1.16
@@ -63,11 +63,11 @@
 
 struct Room {
 	uint8 id;
-	uint16 room_north_exit;
-	uint16 room_east_exit;
-	uint16 room_south_exit;
-	uint16 room_west_exit;
-	uint8 items_table[12];
+	uint16 northExit;
+	uint16 eastExit;
+	uint16 southExit;
+	uint16 westExit;
+	uint8 itemsTable[12];
 };
 
 struct TalkCoords {
@@ -112,8 +112,9 @@
 	int go();
 	int init(GameDetector &detector);
 
+	void startup();
+	void mainLoop();
 	void loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData);
-
 	void setTalkCoords(uint16 y);
 	int getCenterStringX(const char *str, int x1, int x2);
 	int getCharLength(const char *str, int len);
@@ -156,6 +157,7 @@
 	uint16 _talkMessageY;
 	uint16 _talkMessageH;
 	bool _talkMessagePrinted;
+	uint8 _flagsTable[51];
 
 	bool _seq_copyViewOffs;
 	uint8 *_seq_handShapes[3];

Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/screen.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- screen.cpp	9 Sep 2005 21:13:43 -0000	1.8
+++ screen.cpp	10 Sep 2005 00:15:40 -0000	1.9
@@ -68,6 +68,8 @@
 	}
 	free(_currentPalette);
 	free(_screenPalette);
+	free(_decodeShapeBuffer);
+	free(_animBlockPtr);
 }
 
 void Screen::updateScreen() {
@@ -317,9 +319,9 @@
 	}
 }
 
-void Screen::setAnimBlockPtr(uint8 *p, int size) {
-	debug(9, "Screen::setAnimBlockPtr(0x%X, %d)", p, size);
-	_animBlockPtr = p;
+void Screen::setAnimBlockPtr(int size) {
+	debug(9, "Screen::setAnimBlockPtr(%d)", size);
+	_animBlockPtr = (uint8 *)malloc(size);
 	_animBlockSize = size;
 }
 

Index: screen.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/screen.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- screen.h	8 Sep 2005 19:09:52 -0000	1.5
+++ screen.h	10 Sep 2005 00:15:40 -0000	1.6
@@ -94,7 +94,7 @@
 	void copyCurPageBlock(int x, int y, int h, int w, uint8 *dst);
 	void shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPage, int ticks, bool transparent);
 	void fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum = -1);
-	void setAnimBlockPtr(uint8 *p, int size);
+	void setAnimBlockPtr(int size);
 	void setTextColorMap(const uint8 *cmap);
 	void setTextColor(const uint8 *cmap, int a, int b);
 	void loadFont(FontId fontId, uint8 *fontData);





More information about the Scummvm-git-logs mailing list