diff options
Diffstat (limited to 'engines/hugo/display.cpp')
-rw-r--r-- | engines/hugo/display.cpp | 99 |
1 files changed, 66 insertions, 33 deletions
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp index 2380ab9f30..0ac12076dc 100644 --- a/engines/hugo/display.cpp +++ b/engines/hugo/display.cpp @@ -61,13 +61,17 @@ void Screen::createPal() { g_system->setPalette(_vm->_palette, 0, NUM_COLORS); } +/** +* Create logical palette +*/ void Screen::initDisplay() { debugC(1, kDebugDisplay, "initDisplay"); - // Create logical palette createPal(); } -// Move an image from source to destination +/** +* Move an image from source to destination +*/ void Screen::moveImage(image_pt srcImage, uint16 x1, uint16 y1, uint16 dx, uint16 dy, uint16 width1, image_pt dstImage, uint16 x2, uint16 y2, uint16 width2) { debugC(3, kDebugDisplay, "moveImage(srcImage, %d, %d, %d, %d, %d, dstImage, %d, %d, %d)", x1, y1, dx, dy, width1, x2, y2, width2); @@ -91,15 +95,19 @@ void Screen::displayBackground() { g_system->copyRectToScreen(_frontBuffer, 320, 0, 0, 320, 200); } -// Blit the supplied rectangle from _frontBuffer to the screen +/** +* Blit the supplied rectangle from _frontBuffer to the screen +*/ void Screen::displayRect(int16 x, int16 y, int16 dx, int16 dy) { debugC(3, kDebugDisplay, "displayRect(%d, %d, %d, %d)", x, y, dx, dy); g_system->copyRectToScreen(&_frontBuffer[x + y * 320], 320, x, y, dx, dy); } +/** +* Change a color by remapping supplied palette index with new index +*/ void Screen::remapPal(uint16 oldIndex, uint16 newIndex) { -// Change a color by remapping supplied palette index with new index debugC(1, kDebugDisplay, "Remap_pal(%d, %d)", oldIndex, newIndex); warning("STUB: Remap_pal()"); @@ -121,16 +129,20 @@ void Screen::restorePal(Common::SeekableReadStream *f) { } -// Set the new background color +/** +* Set the new background color +*/ void Screen::setBackgroundColor(long color) { debugC(1, kDebugDisplay, "setBackgroundColor(%ld)", color); // How??? Translate existing pixels in dib before objects rendered? } -// Return the overlay state (Foreground/Background) of the currently -// processed object by looking down the current column for an overlay -// base bit set (in which case the object is foreground). +/** +* Return the overlay state (Foreground/Background) of the currently +* processed object by looking down the current column for an overlay +* base bit set (in which case the object is foreground). +*/ overlayState_t Screen::findOvl(seq_t *seq_p, image_pt dst_p, uint16 y) { debugC(4, kDebugDisplay, "findOvl"); @@ -144,8 +156,10 @@ overlayState_t Screen::findOvl(seq_t *seq_p, image_pt dst_p, uint16 y) { return BG; // No bits set, must be background } -// Merge an object frame into _frontBuffer at sx, sy and update rectangle list. -// If fore TRUE, force object above any overlay +/** +* Merge an object frame into _frontBuffer at sx, sy and update rectangle list. +* If fore TRUE, force object above any overlay +*/ void Screen::displayFrame(int sx, int sy, seq_t *seq, bool foreFl) { debugC(3, kDebugDisplay, "displayFrame(%d, %d, seq, %d)", sx, sy, (foreFl) ? 1 : 0); @@ -180,7 +194,9 @@ void Screen::displayFrame(int sx, int sy, seq_t *seq, bool foreFl) { displayList(D_ADD, sx, sy, seq->x2 + 1, seq->lines); } -// Merge rectangles A,B leaving result in B +/** +* Merge rectangles A,B leaving result in B +*/ void Screen::merge(rect_t *rectA, rect_t *rectB) { debugC(6, kDebugDisplay, "merge"); @@ -195,10 +211,12 @@ void Screen::merge(rect_t *rectA, rect_t *rectB) { rectB->dy = MAX(ya, yb) - rectB->y; } -// Coalesce the rectangles in the restore/add list into one unified -// blist. len is the sizes of alist or rlist. blen is current length -// of blist. bmax is the max size of the blist. Note that blist can -// have holes, in which case dx = 0. Returns used length of blist. +/** +* Coalesce the rectangles in the restore/add list into one unified +* blist. len is the sizes of alist or rlist. blen is current length +* of blist. bmax is the max size of the blist. Note that blist can +* have holes, in which case dx = 0. Returns used length of blist. +*/ int16 Screen::mergeLists(rect_t *list, rect_t *blist, int16 len, int16 blen, int16 bmax) { debugC(4, kDebugDisplay, "mergeLists"); @@ -233,8 +251,10 @@ int16 Screen::mergeLists(rect_t *list, rect_t *blist, int16 len, int16 blen, int return blen; } -// Process the display list -// Trailing args are int16 x,y,dx,dy for the D_ADD operation +/** +* Process the display list +* Trailing args are int16 x,y,dx,dy for the D_ADD operation +*/ void Screen::displayList(dupdate_t update, ...) { debugC(6, kDebugDisplay, "displayList"); @@ -295,13 +315,14 @@ void Screen::displayList(dupdate_t update, ...) { } } +/** +* Write supplied character (font data) at sx,sy in supplied color +* Font data as follows: +* *(fontdata+1) = Font Height (pixels) +* *(fontdata+1) = Font Width (pixels) +* *(fontdata+x) = Font Bitmap (monochrome) +*/ void Screen::writeChr(int sx, int sy, byte color, char *local_fontdata) { -// Write supplied character (font data) at sx,sy in supplied color -// Font data as follows: -// -// *(fontdata+1) = Font Height (pixels) -// *(fontdata+1) = Font Width (pixels) -// *(fontdata+x) = Font Bitmap (monochrome) debugC(2, kDebugDisplay, "writeChr(%d, %d, %d, %d)", sx, sy, color, local_fontdata[0]); byte height = local_fontdata[0]; @@ -320,7 +341,9 @@ void Screen::writeChr(int sx, int sy, byte color, char *local_fontdata) { } } -// Returns height of characters in current font +/** +* Returns height of characters in current font +*/ int16 Screen::fontHeight() { debugC(2, kDebugDisplay, "fontHeight"); @@ -328,8 +351,9 @@ int16 Screen::fontHeight() { return height[_fnt - FIRST_FONT]; } - -// Returns length of supplied string in pixels +/** +* Returns length of supplied string in pixels +*/ int16 Screen::stringLength(const char *s) { debugC(2, kDebugDisplay, "stringLength(%s)", s); @@ -341,15 +365,19 @@ int16 Screen::stringLength(const char *s) { return sum; } -// Return x which would center supplied string +/** +* Return x which would center supplied string +*/ int16 Screen::center(const char *s) { debugC(1, kDebugDisplay, "center(%s)", s); return (int16)((XPIX - stringLength(s)) >> 1); } -// Write string at sx,sy in supplied color in current font -// If sx == CENTER, center it +/** +* Write string at sx,sy in supplied color in current font +* If sx == CENTER, center it +*/ void Screen::writeStr(int16 sx, int16 sy, const char *s, byte color) { debugC(2, kDebugDisplay, "writeStr(%d, %d, %s, %d)", sx, sy, s, color); @@ -363,7 +391,9 @@ void Screen::writeStr(int16 sx, int16 sy, const char *s, byte color) { } } -// Shadowed version of writestr +/** +* Shadowed version of writestr +*/ void Screen::shadowStr(int16 sx, int16 sy, const char *s, byte color) { debugC(1, kDebugDisplay, "shadowStr(%d, %d, %s, %d)", sx, sy, s, color); @@ -374,9 +404,10 @@ void Screen::shadowStr(int16 sx, int16 sy, const char *s, byte color) { writeStr(sx, sy, s, color); } +/** Introduce user to the game +* DOS versions Only +*/ void Screen::userHelp() { -// Introduce user to the game -// DOS versions Only Utils::Box(BOX_ANY , "%s", "F1 - Press F1 again\n" " for instructions\n" @@ -440,7 +471,9 @@ void Screen::drawRectangle(bool filledFl, uint16 x1, uint16 y1, uint16 x2, uint1 } } -// Initialize screen components and display results +/** +* Initialize screen components and display results +*/ void Screen::initNewScreenDisplay() { displayList(D_INIT); setBackgroundColor(_TBLACK); |