fix compilation with DISABLE_SCUMM_7_8 defined

svn-id: r18409
This commit is contained in:
Gregory Montoir 2005-06-18 15:44:40 +00:00
parent b03de44db4
commit 04eba089f6
6 changed files with 13 additions and 11 deletions

View File

@ -1603,6 +1603,7 @@ void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con
} }
} }
#ifndef DISABLE_SCUMM_7_8
CharsetRendererNut::CharsetRendererNut(ScummEngine *vm) CharsetRendererNut::CharsetRendererNut(ScummEngine *vm)
: CharsetRenderer(vm) { : CharsetRenderer(vm) {
_current = 0; _current = 0;
@ -1712,6 +1713,7 @@ void CharsetRendererNut::printChar(int chr) {
if (_str.bottom < shadow.bottom) if (_str.bottom < shadow.bottom)
_str.bottom = shadow.bottom; _str.bottom = shadow.bottom;
} }
#endif
void CharsetRendererNES::printChar(int chr) { void CharsetRendererNES::printChar(int chr) {
int width, height, origWidth, origHeight; int width, height, origWidth, origHeight;

View File

@ -187,6 +187,7 @@ public:
int getCharWidth(byte chr) { return 8; } int getCharWidth(byte chr) { return 8; }
}; };
#ifndef DISABLE_SCUMM_7_8
class CharsetRendererNut : public CharsetRenderer { class CharsetRendererNut : public CharsetRenderer {
protected: protected:
NutRenderer *_fr[5]; NutRenderer *_fr[5];
@ -204,6 +205,7 @@ public:
int getCharHeight(byte chr); int getCharHeight(byte chr);
int getCharWidth(byte chr); int getCharWidth(byte chr);
}; };
#endif
} // End of namespace Scumm } // End of namespace Scumm

View File

@ -20,7 +20,6 @@ MODULE_OBJS := \
scumm/help.o \ scumm/help.o \
scumm/midiparser_ro.o \ scumm/midiparser_ro.o \
scumm/midiparser_eup.o \ scumm/midiparser_eup.o \
scumm/nut_renderer.o \
scumm/object.o \ scumm/object.o \
scumm/palette.o \ scumm/palette.o \
scumm/player_mod.o \ scumm/player_mod.o \
@ -52,6 +51,7 @@ MODULE_OBJS := \
ifndef DISABLE_SCUMM_7_8 ifndef DISABLE_SCUMM_7_8
MODULE_OBJS += \ MODULE_OBJS += \
scumm/nut_renderer.o \
scumm/script_v8.o \ scumm/script_v8.o \
scumm/imuse_digi/dimuse.o \ scumm/imuse_digi/dimuse.o \
scumm/imuse_digi/dimuse_bndmgr.o \ scumm/imuse_digi/dimuse_bndmgr.o \

View File

@ -29,18 +29,14 @@ namespace Scumm {
NutRenderer::NutRenderer(ScummEngine *vm) : NutRenderer::NutRenderer(ScummEngine *vm) :
_vm(vm), _vm(vm),
_initialized(false),
_loaded(false), _loaded(false),
_numChars(0) { _numChars(0) {
memset(_chars, 0, sizeof(_chars));
for (int i = 0; i < 256; i++)
_chars[i].src = NULL;
} }
NutRenderer::~NutRenderer() { NutRenderer::~NutRenderer() {
for (int i = 0; i < _numChars; i++) { for (int i = 0; i < _numChars; i++) {
if (_chars[i].src) delete []_chars[i].src;
delete []_chars[i].src;
} }
} }
@ -104,6 +100,7 @@ bool NutRenderer::loadFont(const char *filename) {
} }
_numChars = READ_LE_UINT16(dataSrc + 10); _numChars = READ_LE_UINT16(dataSrc + 10);
assert(_numChars <= ARRAYSIZE(_chars));
uint32 offset = 0; uint32 offset = 0;
for (int l = 0; l < _numChars; l++) { for (int l = 0; l < _numChars; l++) {
offset += READ_BE_UINT32(dataSrc + offset + 4) + 8; offset += READ_BE_UINT32(dataSrc + offset + 4) + 8;
@ -127,7 +124,7 @@ bool NutRenderer::loadFont(const char *filename) {
// so there may appear some garbage. That's why we have to fill it // so there may appear some garbage. That's why we have to fill it
// with zeroes first. // with zeroes first.
memset(_chars[l].src, 0, srcSize); memset(_chars[l].src, 0, srcSize);
const uint8 *fobjptr = dataSrc + offset + 22; const uint8 *fobjptr = dataSrc + offset + 22;
switch (codec) { switch (codec) {
case 1: case 1:

View File

@ -18,7 +18,7 @@
* $Header$ * $Header$
*/ */
#ifndef NUT_RENDERER_H #if !defined(NUT_RENDERER_H) && !defined(DISABLE_SCUMM_7_8)
#define NUT_RENDERER_H #define NUT_RENDERER_H
#include "common/file.h" #include "common/file.h"
@ -31,7 +31,6 @@ class ScummEngine;
class NutRenderer { class NutRenderer {
protected: protected:
ScummEngine *_vm; ScummEngine *_vm;
bool _initialized;
bool _loaded; bool _loaded;
int _numChars; int _numChars;
struct { struct {
@ -48,7 +47,7 @@ protected:
public: public:
NutRenderer(ScummEngine *vm); NutRenderer(ScummEngine *vm);
virtual ~NutRenderer(); virtual ~NutRenderer();
int getNumChars() { return _numChars; } int getNumChars() const { return _numChars; }
bool loadFont(const char *filename); bool loadFont(const char *filename);

View File

@ -1492,8 +1492,10 @@ int ScummEngine::init(GameDetector &detector) {
_charset = new CharsetRendererV2(this, _language); _charset = new CharsetRendererV2(this, _language);
else if (_version == 3) else if (_version == 3)
_charset = new CharsetRendererV3(this); _charset = new CharsetRendererV3(this);
#ifndef DISABLE_SCUMM_7_8
else if (_version == 8) else if (_version == 8)
_charset = new CharsetRendererNut(this); _charset = new CharsetRendererNut(this);
#endif
else else
_charset = new CharsetRendererClassic(this); _charset = new CharsetRendererClassic(this);