aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2013-10-03 07:14:36 +0200
committerStrangerke2013-10-03 07:14:36 +0200
commit26626125d983d62132afb4b8649f65c11adfb565 (patch)
treed7c9fb73434413c80556d421b92ea06ad6a32024
parentefe6236e7ba901571123e11d4a2c9d36ba0a9069 (diff)
downloadscummvm-rg350-26626125d983d62132afb4b8649f65c11adfb565.tar.gz
scummvm-rg350-26626125d983d62132afb4b8649f65c11adfb565.tar.bz2
scummvm-rg350-26626125d983d62132afb4b8649f65c11adfb565.zip
AVALANCHE: Use Doxygen comments in Graphics
-rw-r--r--engines/avalanche/background.cpp4
-rw-r--r--engines/avalanche/graphics.cpp39
-rw-r--r--engines/avalanche/graphics.h14
3 files changed, 33 insertions, 24 deletions
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 99bb446d3f..cb280ba730 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -298,7 +298,7 @@ void Background::load(byte number) {
_vm->_graphics->getNaturalPicture(_sprites[i]);
else {
_sprites[i]._size = sprite._size;
- _sprites[i]._picture = _vm->_graphics->loadPictureRow(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1);
+ _sprites[i]._picture = _vm->_graphics->loadPictureRaw(f, _sprites[i]._xl * 8, _sprites[i]._yl + 1);
}
} else
_sprites[i]._x = kOnDisk;
@@ -339,7 +339,7 @@ void Background::draw(int16 destX, int16 destY, byte sprId) {
sprite._yl = f.readSint16LE();
sprite._size = f.readSint32LE();
f.skip(2); // Natural and Memorize are used in Load()
- sprite._picture = _vm->_graphics->loadPictureRow(f, sprite._xl * 8, sprite._yl + 1);
+ sprite._picture = _vm->_graphics->loadPictureRaw(f, sprite._xl * 8, sprite._yl + 1);
if (destX < 0) {
destX = sprite._x * 8;
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index a733dfa5f1..5e17dcda3e 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -455,8 +455,10 @@ void GraphicManager::drawDebugLines() {
}
}
+/**
+ * This function mimics Pascal's getimage().
+ */
Graphics::Surface GraphicManager::loadPictureGraphic(Common::File &file) {
- // This function mimics Pascal's getimage().
// The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1.
uint16 width = file.readUint16LE() + 1;
uint16 height = file.readUint16LE() + 1;
@@ -480,11 +482,13 @@ Graphics::Surface GraphicManager::loadPictureGraphic(Common::File &file) {
return picture;
}
-Graphics::Surface GraphicManager::loadPictureRow(Common::File &file, uint16 width, uint16 height) {
- // This function is our own creation, very much like the one above. The main differences are that
- // we don't read the width and the height from the file, the planes are in a different order
- // and we read the picture plane-by-plane.
-
+/**
+ * Reads Row-planar EGA data.
+ * This function is our own creation, very much like the one above. The main differences are that
+ * we don't read the width and the height from the file, the planes are in a different order
+ * and we read the picture plane-by-plane.
+ */
+Graphics::Surface GraphicManager::loadPictureRaw(Common::File &file, uint16 width, uint16 height) {
Graphics::Surface picture;
picture.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
@@ -580,6 +584,9 @@ void GraphicManager::drawReadyLight(Color color) {
_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
}
+/**
+ * This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll.
+ */
void GraphicManager::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
Common::File file;
Common::String filename = Common::String::format("%s.avd", fn.c_str());
@@ -588,7 +595,6 @@ void GraphicManager::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
error("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
// I know it looks very similar to the loadPicture methods, but in truth it's the combination of the two.
-
uint16 width = xl * 8;
uint16 height = yl;
@@ -614,6 +620,10 @@ void GraphicManager::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
file.close();
}
+/**
+ * Draws an icon to the current scroll.
+ * @remarks Originally called 'geticon'
+ */
void GraphicManager::drawIcon(int16 x, int16 y, byte which) {
Common::File file;
@@ -638,20 +648,19 @@ void GraphicManager::prepareBubble(int xc, int xw, int my, Common::Point points[
_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw + 9, 7, _vm->_talkX + xw - 8 + xc, my + 1), _talkBackgroundColor);
_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw - 1, 12, _vm->_talkX + xw + xc + 2, my - 4), _talkBackgroundColor);
- // Top right corner of the bubble.
+ // Top the 4 rounded corners of the bubble.
drawPieSlice(xc + _vm->_talkX + xw - 10, 11, 0, 90, 9, _talkBackgroundColor);
- // Bottom right corner of the bubble.
drawPieSlice(xc + _vm->_talkX + xw - 10, my - 4, 270, 360, 9, _talkBackgroundColor);
- // Top left corner of the bubble.
drawPieSlice(xc + _vm->_talkX - xw + 10, 11, 90, 180, 9, _talkBackgroundColor);
- // Bottom left corner of the bubble.
drawPieSlice(xc + _vm->_talkX - xw + 10, my - 4, 180, 270, 9, _talkBackgroundColor);
// "Tail" of the speech bubble.
drawTriangle(points, _talkBackgroundColor);
}
-// And set the background of the text to the desired color.
+/**
+ * Set the background of the text to the desired color.
+ */
void GraphicManager::wipeChar(int x, int y, Color color) {
for (int k = 0; k < 8; k++)
*(byte *)_surface.getBasePtr(x + k, y) = color;
@@ -679,13 +688,17 @@ void GraphicManager::refreshScreen() {
}
void GraphicManager::loadBackground(Common::File &file) {
- _background = loadPictureRow(file, kBackgroundWidth, kBackgroundHeight);
+ _background = loadPictureRaw(file, kBackgroundWidth, kBackgroundHeight);
}
void GraphicManager::refreshBackground() {
drawPicture(_surface, _background, 0, 10);
}
+/**
+ * Only used when entering the map.
+ * @remarks Originally called 'zoomout'
+ */
void GraphicManager::zoomOut(int16 x, int16 y) {
//setlinestyle(dottedln, 0, 1); TODO: Implement it with a dotted line style!!!
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 8a9d26cb99..9930e282f5 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -95,30 +95,26 @@ public:
// The caller has to .free() the returned Surfaces!!!
// Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
- Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data.
+ Graphics::Surface loadPictureRaw(Common::File &file, uint16 width, uint16 height);
void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y);
- void drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY); // Can't call .free() here. See showScore() for example.
-
+ void drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY);
void drawThinkPic(Common::String filename, int id);
void drawToolbar();
void drawCursor(byte pos);
void drawReadyLight(Color color);
- void drawSign(Common::String name, int16 xl, int16 yl, int16 y); // This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll.
- void drawIcon(int16 x, int16 y, byte which); // Draws an icon to the current scroll.
+ void drawSign(Common::String name, int16 xl, int16 yl, int16 y);
+ void drawIcon(int16 x, int16 y, byte which);
void drawScreenLine(int16 x, int16 y, int16 x2, int16 y2, Color color);
-
void prepareBubble(int xc, int xw, int my, Common::Point points[3]);
-
void refreshScreen();
void loadBackground(Common::File &file);
void refreshBackground();
void setBackgroundColor(Color x);
void setDialogColor(Color bg, Color text);
- void zoomOut(int16 x, int16 y); // Only used when entering the map.
+ void zoomOut(int16 x, int16 y);
void showScroll();
-
void getNaturalPicture(SpriteType &sprite);
void saveScreen();