[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.148,2.149 charset.h,2.45,2.46 module.mk,1.55,1.56 nut_renderer.cpp,1.58,1.59 nut_renderer.h,1.23,1.24 scumm.cpp,1.545,1.546

Gregory Montoir cyx at users.sourceforge.net
Sat Jun 18 08:45:38 CEST 2005


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

Modified Files:
	charset.cpp charset.h module.mk nut_renderer.cpp 
	nut_renderer.h scumm.cpp 
Log Message:
fix compilation with DISABLE_SCUMM_7_8 defined

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.148
retrieving revision 2.149
diff -u -d -r2.148 -r2.149
--- charset.cpp	17 Jun 2005 20:23:12 -0000	2.148
+++ charset.cpp	18 Jun 2005 15:44:33 -0000	2.149
@@ -1603,6 +1603,7 @@
 	}
 }
 
+#ifndef DISABLE_SCUMM_7_8
 CharsetRendererNut::CharsetRendererNut(ScummEngine *vm)
 	 : CharsetRenderer(vm) {
 	_current = 0;
@@ -1712,6 +1713,7 @@
 	if (_str.bottom < shadow.bottom)
 		_str.bottom = shadow.bottom;
 }
+#endif
 
 void CharsetRendererNES::printChar(int chr) {
 	int width, height, origWidth, origHeight;

Index: charset.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.h,v
retrieving revision 2.45
retrieving revision 2.46
diff -u -d -r2.45 -r2.46
--- charset.h	4 Jun 2005 16:10:39 -0000	2.45
+++ charset.h	18 Jun 2005 15:44:40 -0000	2.46
@@ -187,6 +187,7 @@
 	int getCharWidth(byte chr) { return 8; }
 };
 
+#ifndef DISABLE_SCUMM_7_8
 class CharsetRendererNut : public CharsetRenderer {
 protected:
 	NutRenderer *_fr[5];
@@ -204,6 +205,7 @@
 	int getCharHeight(byte chr);
 	int getCharWidth(byte chr);
 };
+#endif
 
 } // End of namespace Scumm
 

Index: module.mk
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/module.mk,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- module.mk	18 May 2005 02:32:25 -0000	1.55
+++ module.mk	18 Jun 2005 15:44:40 -0000	1.56
@@ -20,7 +20,6 @@
 	scumm/help.o \
 	scumm/midiparser_ro.o \
 	scumm/midiparser_eup.o \
-	scumm/nut_renderer.o \
 	scumm/object.o \
 	scumm/palette.o \
 	scumm/player_mod.o \
@@ -52,6 +51,7 @@
 
 ifndef DISABLE_SCUMM_7_8
 MODULE_OBJS += \
+	scumm/nut_renderer.o \
 	scumm/script_v8.o \
 	scumm/imuse_digi/dimuse.o \
 	scumm/imuse_digi/dimuse_bndmgr.o \

Index: nut_renderer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/nut_renderer.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- nut_renderer.cpp	17 Jun 2005 18:10:50 -0000	1.58
+++ nut_renderer.cpp	18 Jun 2005 15:44:40 -0000	1.59
@@ -29,18 +29,14 @@
 
 NutRenderer::NutRenderer(ScummEngine *vm) :
 	_vm(vm),
-	_initialized(false),
 	_loaded(false),
 	_numChars(0) {
-
-	for (int i = 0; i < 256; i++)
-		_chars[i].src = NULL;
+	memset(_chars, 0, sizeof(_chars));
 }
 
 NutRenderer::~NutRenderer() {
 	for (int i = 0; i < _numChars; i++) {
-		if (_chars[i].src)
-			delete []_chars[i].src;
+		delete []_chars[i].src;
 	}
 }
 
@@ -104,6 +100,7 @@
 	}
 
 	_numChars = READ_LE_UINT16(dataSrc + 10);
+	assert(_numChars <= ARRAYSIZE(_chars));
 	uint32 offset = 0;
 	for (int l = 0; l < _numChars; l++) {
 		offset += READ_BE_UINT32(dataSrc + offset + 4) + 8;
@@ -127,7 +124,7 @@
 		// so there may appear some garbage. That's why we have to fill it
 		// with zeroes first.
 		memset(_chars[l].src, 0, srcSize);
-		
+
 		const uint8 *fobjptr = dataSrc + offset + 22;
 		switch (codec) {
 		case 1:

Index: nut_renderer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/nut_renderer.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- nut_renderer.h	17 Jun 2005 18:10:50 -0000	1.23
+++ nut_renderer.h	18 Jun 2005 15:44:40 -0000	1.24
@@ -18,7 +18,7 @@
  * $Header$
  */
 
-#ifndef NUT_RENDERER_H
+#if !defined(NUT_RENDERER_H) && !defined(DISABLE_SCUMM_7_8)
 #define NUT_RENDERER_H
 
 #include "common/file.h"
@@ -31,7 +31,6 @@
 class NutRenderer {
 protected:
 	ScummEngine *_vm;
-	bool _initialized;
 	bool _loaded;
 	int _numChars;
 	struct {
@@ -48,7 +47,7 @@
 public:
 	NutRenderer(ScummEngine *vm);
 	virtual ~NutRenderer();
-	int getNumChars() { return _numChars; }
+	int getNumChars() const { return _numChars; }
 
 	bool loadFont(const char *filename);
 

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.545
retrieving revision 1.546
diff -u -d -r1.545 -r1.546
--- scumm.cpp	14 Jun 2005 08:54:11 -0000	1.545
+++ scumm.cpp	18 Jun 2005 15:44:40 -0000	1.546
@@ -1492,8 +1492,10 @@
 		_charset = new CharsetRendererV2(this, _language);
 	else if (_version == 3)
 		_charset = new CharsetRendererV3(this);
+#ifndef DISABLE_SCUMM_7_8		
 	else if (_version == 8)
 		_charset = new CharsetRendererNut(this);
+#endif
 	else
 		_charset = new CharsetRendererClassic(this);
 





More information about the Scummvm-git-logs mailing list