From c1c8b10fbe396a6669bbdee607fb4b86d3c1e120 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Mon, 7 Jan 2008 23:13:45 +0000 Subject: Merged dos monospaced fonts subclasses into parent class. Handling is the same, and readability is more important than performance, especially when you call a routine only twice. svn-id: r30335 --- engines/parallaction/font.cpp | 42 +++++------------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) (limited to 'engines') diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp index d0f863ee86..07e736a6d3 100644 --- a/engines/parallaction/font.cpp +++ b/engines/parallaction/font.cpp @@ -307,21 +307,6 @@ protected: return _data->_height; } - -public: - DosMonospacedFont(Cnv *cnv) : DosFont(cnv) { - _width = 8; - } - -}; - -class DosMenuFont : public DosMonospacedFont { - -public: - DosMenuFont(Cnv *cnv) : DosMonospacedFont(cnv) { - } - -protected: uint16 drawChar(char c) { byte *src = _data->getFramePtr(c); @@ -342,31 +327,14 @@ protected: return _width; } -}; - - -class DosLabelFont : public DosMonospacedFont { - public: - DosLabelFont(Cnv *cnv) : DosMonospacedFont(cnv) { + DosMonospacedFont(Cnv *cnv) : DosFont(cnv) { + _width = 8; } -protected: - uint16 drawChar(char c) { - - byte *src = _data->getFramePtr(c); - byte *dst = _cp; +}; - for (uint16 i = 0; i < height(); i++) { - memcpy(dst, src, _width); - dst += _bufPitch; - src += _pitch; - } - return _width; - } - -}; class AmigaFont : public Font { @@ -552,10 +520,10 @@ Font *DosDisk_ns::createFont(const char *name, Cnv* cnv) { f = new DosDialogueFont(cnv); else if (!scumm_stricmp(name, "topaz")) - f = new DosLabelFont(cnv); + f = new DosMonospacedFont(cnv); else if (!scumm_stricmp(name, "slide")) - f = new DosMenuFont(cnv); + f = new DosMonospacedFont(cnv); else error("unknown dos font '%s'", name); -- cgit v1.2.3