diff options
author | Max Horn | 2010-06-28 11:20:51 +0000 |
---|---|---|
committer | Max Horn | 2010-06-28 11:20:51 +0000 |
commit | 7e0240ab14d29401877ff0c4d827be859e13ea58 (patch) | |
tree | b00341ab66488210b3087973bb001b12749f7432 /engines | |
parent | 2c01d10a36f50da6c8bdcfe70558f7d9a2e56324 (diff) | |
download | scummvm-rg350-7e0240ab14d29401877ff0c4d827be859e13ea58.tar.gz scummvm-rg350-7e0240ab14d29401877ff0c4d827be859e13ea58.tar.bz2 scummvm-rg350-7e0240ab14d29401877ff0c4d827be859e13ea58.zip |
SCI: Comment cleanup
svn-id: r50423
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/graphics/cursor.cpp | 12 | ||||
-rw-r--r-- | engines/sci/graphics/screen.cpp | 26 | ||||
-rw-r--r-- | engines/sci/graphics/screen.h | 34 |
3 files changed, 47 insertions, 25 deletions
diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index c5f4de9cf5..20472d14c4 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -205,7 +205,7 @@ void GfxCursor::kernelSetMacCursor(GuiResourceId viewNum, int loopNum, int celNu // See http://developer.apple.com/legacy/mac/library/documentation/mac/QuickDraw/QuickDraw-402.html // for more information. - // View 998 seems to be a fake resource used to call for for the Mac CURS resources + // View 998 seems to be a fake resource used to call for the Mac CURS resources. // For other resources, they're still in the views, so use them. if (viewNum != 998) { kernelSetView(viewNum, loopNum, celNum, hotspot); @@ -255,10 +255,12 @@ void GfxCursor::kernelSetMacCursor(GuiResourceId viewNum, int loopNum, int celNu } void GfxCursor::setPosition(Common::Point pos) { - // Don't set position, when cursor is not visible - // This fixes eco quest 1 (floppy) right at the start, which is setting mouse cursor to 0, 0 all the time during the - // intro. It's escapeable (now) by moving to the left or top, but it's getting on your nerves. - // This could theoretically break some things, although sierra normally sets position only when showing the cursor. + // Don't set position, when cursor is not visible. + // This fixes eco quest 1 (floppy) right at the start, which is setting + // mouse cursor to (0,0) all the time during the intro. It's escapeable + // (now) by moving to the left or top, but it's getting on your nerves. This + // could theoretically break some things, although sierra normally sets + // position only when showing the cursor. if (!_isVisible) return; diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 519020f3a1..fa1f7019fd 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -106,8 +106,8 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) { _unditherState = true; if (_resMan->isVGA() || (_resMan->isAmiga32color())) { - // It's not 100% accurate to set white to be 255 for amiga 32-color games - // 255 is defined as white in our sci at all times, so it doesnt matter + // It is not 100% accurate to set white to be 255 for Amiga 32-color games. + // But 255 is defined as white in our SCI at all times, so it doesn't matter. _colorWhite = 255; if (getSciVersion() >= SCI_VERSION_1_1) _colorDefaultVectorData = 255; @@ -167,7 +167,10 @@ void GfxScreen::copyRectToScreen(const Common::Rect &rect) { } } -// This copies a rect to screen w/o scaling adjustment and is only meant to be used on hires graphics used in upscaled hires mode +/** + * This copies a rect to screen w/o scaling adjustment and is only meant to be + * used on hires graphics used in upscaled hires mode. + */ void GfxScreen::copyDisplayRectToScreen(const Common::Rect &rect) { if (!_upscaledHires) error("copyDisplayRectToScreen: not in upscaled hires mode"); @@ -218,15 +221,21 @@ void GfxScreen::putPixel(int x, int y, byte drawMask, byte color, byte priority, _controlScreen[offset] = control; } -// This will just change a pixel directly on displayscreen. Its supposed to get only used on upscaled-Hires games where -// hires content needs to get drawn ONTO the upscaled display screen (like japanese fonts, hires portraits, etc.) +/** + * This will just change a pixel directly on displayscreen. It is supposed to be + * only used on upscaled-Hires games where hires content needs to get drawn ONTO + * the upscaled display screen (like japanese fonts, hires portraits, etc.). + */ void GfxScreen::putPixelOnDisplay(int x, int y, byte color) { int offset = y * _displayWidth + x; _displayScreen[offset] = color; } -// Sierra's Bresenham line drawing -// WARNING: Do not just blindly replace this with Graphics::drawLine(), as it seems to create issues with flood fill +/** + * Sierra's Bresenham line drawing. + * WARNING: Do not replace this with Graphics::drawLine(), as this causes issues + * with flood fill, due to small difference in the Bresenham logic. + */ void GfxScreen::drawLine(Common::Point startPoint, Common::Point endPoint, byte color, byte priority, byte control) { int16 left = startPoint.x; int16 top = startPoint.y; @@ -289,7 +298,8 @@ void GfxScreen::drawLine(Common::Point startPoint, Common::Point endPoint, byte } } -// We put hires kanji chars onto upscaled background, so we need to adjust coordinates. Caller gives use low-res ones +// We put hires kanji chars onto upscaled background, so we need to adjust +// coordinates. Caller gives use low-res ones. void GfxScreen::putKanjiChar(Graphics::FontSJIS *commonFont, int16 x, int16 y, uint16 chr, byte color) { byte *displayPtr = _displayScreen + y * _displayWidth * 2 + x * 2; // we don't use outline, so color 0 is actually not used diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h index c1e10fabc8..03dfd3529c 100644 --- a/engines/sci/graphics/screen.h +++ b/engines/sci/graphics/screen.h @@ -55,9 +55,12 @@ enum { }; /** - * Screen class, actually creates 3 (4) screens internally - which is visual/display (for the user), - * priority (contains priority information) and control (contains control information). Handles all operations to it - * and copies parts of visual/display screen to the actual screen, so the user can really see it. + * Screen class, actually creates 3 (4) screens internally: + * - visual/display (for the user), + * - priority (contains priority information) and + * - control (contains control information). + * Handles all operations to it and copies parts of visual/display screen to + * the actual screen, so the user can really see it. */ class GfxScreen { public: @@ -85,10 +88,10 @@ public: void drawLine(int16 left, int16 top, int16 right, int16 bottom, byte color, byte prio, byte control) { drawLine(Common::Point(left, top), Common::Point(right, bottom), color, prio, control); } - int getUpscaledHires() { + int getUpscaledHires() const { return _upscaledHires; } - bool getUnditherState() { + bool getUnditherState() const { return _unditherState; } void putKanjiChar(Graphics::FontSJIS *commonFont, int16 x, int16 y, uint16 chr, byte color); @@ -140,27 +143,34 @@ private: bool _unditherState; int16 _unditherMemorial[SCI_SCREEN_UNDITHERMEMORIAL_SIZE]; - // these screens have the real resolution of the game engine (320x200 for SCI0/SCI1/SCI11 games, 640x480 for SCI2 games) - // SCI0 games will be dithered in here at any time + // These screens have the real resolution of the game engine (320x200 for + // SCI0/SCI1/SCI11 games, 640x480 for SCI2 games). SCI0 games will be + // dithered in here at any time. byte *_visualScreen; byte *_priorityScreen; byte *_controlScreen; - // this screen is the one that is actually displayed to the user. It may be 640x400 for japanese SCI1 games - // SCI0 games may be undithered in here. Only read from this buffer for Save/ShowBits usage. + // This screen is the one that is actually displayed to the user. It may be + // 640x400 for japanese SCI1 games. SCI0 games may be undithered in here. + // Only read from this buffer for Save/ShowBits usage. byte *_displayScreen; Common::Rect getScaledRect(Common::Rect rect); ResourceManager *_resMan; - // this is a pointer to the currently active screen (changing it only required for debug purposes) + /** + * Pointer to the currently active screen (changing it only required for + * debug purposes). + */ byte *_activeScreen; - // this variable defines, if upscaled hires is active and what upscaled mode is used + // This variable defines, if upscaled hires is active and what upscaled mode + // is used. int _upscaledHires; - // this here holds a translation for vertical coordinates between native (visual) and actual (display) screen + // This here holds a translation for vertical coordinates between native + // (visual) and actual (display) screen. int _upscaledMapping[SCI_SCREEN_UPSCALEDMAXHEIGHT + 1]; }; |