diff options
author | Nicola Mettifogo | 2008-01-07 23:13:45 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2008-01-07 23:13:45 +0000 |
commit | c1c8b10fbe396a6669bbdee607fb4b86d3c1e120 (patch) | |
tree | fdc357dd958876c7b0e6f96f85708a941da7c8fe /engines | |
parent | 14d4a515f2318efbf3765193e185da2ee8736062 (diff) | |
download | scummvm-rg350-c1c8b10fbe396a6669bbdee607fb4b86d3c1e120.tar.gz scummvm-rg350-c1c8b10fbe396a6669bbdee607fb4b86d3c1e120.tar.bz2 scummvm-rg350-c1c8b10fbe396a6669bbdee607fb4b86d3c1e120.zip |
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
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/font.cpp | 42 |
1 files changed, 5 insertions, 37 deletions
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); |