aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/graphics.cpp
diff options
context:
space:
mode:
authorStrangerke2013-09-29 12:13:06 +0200
committerStrangerke2013-09-29 12:13:06 +0200
commitffbe4646c16b7620040c6b63d20779d5fa50bd6b (patch)
tree8eb7074e4e5139c4717aaee1be52679af02c9121 /engines/avalanche/graphics.cpp
parent1af03774ccda57e153b3d3664613818645f5f4ff (diff)
downloadscummvm-rg350-ffbe4646c16b7620040c6b63d20779d5fa50bd6b.tar.gz
scummvm-rg350-ffbe4646c16b7620040c6b63d20779d5fa50bd6b.tar.bz2
scummvm-rg350-ffbe4646c16b7620040c6b63d20779d5fa50bd6b.zip
AVALANCHE: move some more functions to Graphics
Diffstat (limited to 'engines/avalanche/graphics.cpp')
-rw-r--r--engines/avalanche/graphics.cpp49
1 files changed, 43 insertions, 6 deletions
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 2d0a45eaa0..f39cd6acc3 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -325,11 +325,11 @@ void Graphics::drawText(::Graphics::Surface &surface, const Common::String text,
}
void Graphics::drawNormalText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
- _vm->_graphics->drawText(_surface, text, font, fontHeight, x, y, color);
+ drawText(_surface, text, font, fontHeight, x, y, color);
}
void Graphics::drawScrollText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
- _vm->_graphics->drawText(_scrolls, text, font, fontHeight, x, y, color);
+ drawText(_scrolls, text, font, fontHeight, x, y, color);
}
void Graphics::drawDigit(int index, int x, int y) {
@@ -467,7 +467,7 @@ byte Graphics::getAlsoColor(int x1, int y1, int x2, int y2) {
byte returnColor = 0;
for (int16 i = x1; i <= x2; i++) {
for (int16 j = y1; j <= y2; j++) {
- byte actColor = *(byte *)_vm->_graphics->_magics.getBasePtr(i, j);
+ byte actColor = *(byte *)_magics.getBasePtr(i, j);
returnColor = MAX(returnColor, actColor);
}
}
@@ -508,6 +508,38 @@ void Graphics::drawPicture(::Graphics::Surface &target, const ::Graphics::Surfac
}
}
+void Graphics::drawCursor(byte pos) {
+ int pixPos = 24 + (pos * 8);
+ // Draw the '_' character.
+ for (int i = 0; i < 8; i++)
+ *(byte *)_surface.getBasePtr(pixPos + i, 168) = kColorWhite;
+}
+
+void Graphics::drawReadyLight(Color color) {
+ _surface.fillRect(Common::Rect(419, 195, 438, 197), color);
+}
+
+void Graphics::prepareBubble(int xc, int xw, int my, Common::Point points[3]) {
+ // Backup the screen before drawing the bubble.
+ _scrolls.copyFrom(_surface);
+
+ // The body of the bubble.
+ _scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw + 9, 7, _vm->_talkX + xw - 8 + xc, my + 1), _vm->_talkBackgroundColor);
+ _scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw - 1, 12, _vm->_talkX + xw + xc + 2, my - 4), _vm->_talkBackgroundColor);
+
+ // Top right corner of the bubble.
+ drawPieSlice(xc + _vm->_talkX + xw - 10, 11, 0, 90, 9, _vm->_talkBackgroundColor);
+ // Bottom right corner of the bubble.
+ drawPieSlice(xc + _vm->_talkX + xw - 10, my - 4, 270, 360, 9, _vm->_talkBackgroundColor);
+ // Top left corner of the bubble.
+ drawPieSlice(xc + _vm->_talkX - xw + 10, 11, 90, 180, 9, _vm->_talkBackgroundColor);
+ // Bottom left corner of the bubble.
+ drawPieSlice(xc + _vm->_talkX - xw + 10, my - 4, 180, 270, 9, _vm->_talkBackgroundColor);
+
+ // "Tail" of the speech bubble.
+ drawTriangle(points, _vm->_talkBackgroundColor);
+}
+
void Graphics::refreshScreen() {
// These cycles are for doubling the screen height.
for (uint16 y = 0; y < _screen.h / 2; y++) {
@@ -548,9 +580,8 @@ void Graphics::zoomOut(int16 x, int16 y) {
removeBackup();
}
-// Original name background()
-void Graphics::setBackgroundColor(Color x) {
- warning("STUB: setBackgroundColor(%d)", x);
+void Graphics::showScroll() {
+ _surface.copyFrom(_scrolls); // TODO: Rework it using getSubArea !!!!!!!
}
void Graphics::saveScreen() {
@@ -565,4 +596,10 @@ void Graphics::restoreScreen() {
_surface.copyFrom(_backup);
refreshScreen();
}
+
+// Original name background()
+void Graphics::setBackgroundColor(Color x) {
+ warning("STUB: setBackgroundColor(%d)", x);
+}
+
} // End of namespace Avalanche