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)
: CharsetRenderer(vm) {
_current = 0;
@ -1712,6 +1713,7 @@ void CharsetRendererNut::printChar(int chr) {
if (_str.bottom < shadow.bottom)
_str.bottom = shadow.bottom;
}
#endif
void CharsetRendererNES::printChar(int chr) {
int width, height, origWidth, origHeight;

View File

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

View File

@ -20,7 +20,6 @@ MODULE_OBJS := \
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 @@ MODULE_OBJS := \
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 \

View File

@ -29,18 +29,14 @@ namespace Scumm {
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 @@ bool NutRenderer::loadFont(const char *filename) {
}
_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 @@ bool NutRenderer::loadFont(const char *filename) {
// 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:

View File

@ -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 ScummEngine;
class NutRenderer {
protected:
ScummEngine *_vm;
bool _initialized;
bool _loaded;
int _numChars;
struct {
@ -48,7 +47,7 @@ protected:
public:
NutRenderer(ScummEngine *vm);
virtual ~NutRenderer();
int getNumChars() { return _numChars; }
int getNumChars() const { return _numChars; }
bool loadFont(const char *filename);

View File

@ -1492,8 +1492,10 @@ int ScummEngine::init(GameDetector &detector) {
_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);