diff options
author | Nicola Mettifogo | 2007-08-11 17:25:57 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-08-11 17:25:57 +0000 |
commit | b07f787f7ff49c0a88122cd60b6c73ae850adc26 (patch) | |
tree | 15b4120a5d1c7a1d828e9bc3333d4d411caf88a5 /engines/parallaction/parallaction_ns.cpp | |
parent | 81b864e9e8199b0102b122626badba059eb618d4 (diff) | |
download | scummvm-rg350-b07f787f7ff49c0a88122cd60b6c73ae850adc26.tar.gz scummvm-rg350-b07f787f7ff49c0a88122cd60b6c73ae850adc26.tar.bz2 scummvm-rg350-b07f787f7ff49c0a88122cd60b6c73ae850adc26.zip |
Moved core font management from Gfx to engine. Gfx still retains features related to displaying text on screen.
svn-id: r28530
Diffstat (limited to 'engines/parallaction/parallaction_ns.cpp')
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 947cb22a7f..0b088442e4 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -62,12 +62,46 @@ int Parallaction_ns::init() { } initResources(); + initFonts(); Parallaction::init(); return 0; } +Parallaction_ns::~Parallaction_ns() { + freeFonts(); +} + + +void Parallaction_ns::freeFonts() { + + delete _dialogueFont; + delete _labelFont; + delete _menuFont; + + return; +} + +void Parallaction_ns::renderLabel(Graphics::Surface *cnv, char *text) { + + if (_vm->getPlatform() == Common::kPlatformAmiga) { + cnv->create(_labelFont->getStringWidth(text) + 16, 10, 1); + + _labelFont->setColor(7); + _labelFont->drawString((byte*)cnv->pixels + 1, cnv->w, text); + _labelFont->drawString((byte*)cnv->pixels + 1 + cnv->w * 2, cnv->w, text); + _labelFont->drawString((byte*)cnv->pixels + cnv->w, cnv->w, text); + _labelFont->drawString((byte*)cnv->pixels + 2 + cnv->w, cnv->w, text); + _labelFont->setColor(1); + _labelFont->drawString((byte*)cnv->pixels + 1 + cnv->w, cnv->w, text); + } else { + cnv->create(_labelFont->getStringWidth(text), _labelFont->height(), 1); + _labelFont->drawString((byte*)cnv->pixels, cnv->w, text); + } + +} + void Parallaction_ns::callFunction(uint index, void* parm) { assert(index < 25); // magic value 25 is maximum # of callables for Nippon Safes |