aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2015-12-26 14:26:33 +0100
committerStrangerke2015-12-26 14:27:53 +0100
commit2560fdb19145cf3b035f6cb24b048adec1b656f1 (patch)
tree037ca62334b5fc3aab89101c56442794bb0fe9bf /engines
parentae519716a207b134e3c287dc53cadb4ef55a389a (diff)
downloadscummvm-rg350-2560fdb19145cf3b035f6cb24b048adec1b656f1.tar.gz
scummvm-rg350-2560fdb19145cf3b035f6cb24b048adec1b656f1.tar.bz2
scummvm-rg350-2560fdb19145cf3b035f6cb24b048adec1b656f1.zip
LAB: Make private some DispMan functions and variables, some renaming
Diffstat (limited to 'engines')
-rw-r--r--engines/lab/dispman.cpp12
-rw-r--r--engines/lab/dispman.h101
-rw-r--r--engines/lab/interface.cpp2
3 files changed, 56 insertions, 59 deletions
diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp
index a2c83f834b..2dde42ba9b 100644
--- a/engines/lab/dispman.cpp
+++ b/engines/lab/dispman.cpp
@@ -57,7 +57,7 @@ DisplayMan::DisplayMan(LabEngine *vm) : _vm(vm) {
_screenHeight = 0;
for (int i = 0; i < 256 * 3; i++)
- _curvgapal[i] = 0;
+ _curVgaPal[i] = 0;
}
DisplayMan::~DisplayMan() {
@@ -454,11 +454,11 @@ void DisplayMan::writeColorRegs(byte *buf, uint16 first, uint16 numReg) {
tmp[i] = (buf[i] << 2) | (buf[i] >> 4); // better results than buf[i] * 4
_vm->_system->getPaletteManager()->setPalette(tmp, first, numReg);
- memcpy(&(_curvgapal[first * 3]), buf, numReg * 3);
+ memcpy(&(_curVgaPal[first * 3]), buf, numReg * 3);
}
void DisplayMan::setPalette(void *newPal, uint16 numColors) {
- if (memcmp(newPal, _curvgapal, numColors * 3) != 0)
+ if (memcmp(newPal, _curVgaPal, numColors * 3) != 0)
writeColorRegs((byte *)newPal, 0, numColors);
}
@@ -469,7 +469,7 @@ byte *DisplayMan::getCurrentDrawingBuffer() {
return _displayBuffer;
}
-void DisplayMan::checkerboardEffect(uint16 penColor, uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
+void DisplayMan::checkerBoardEffect(uint16 penColor, uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
int w = x2 - x1 + 1;
int h = y2 - y1 + 1;
@@ -758,7 +758,7 @@ void DisplayMan::doTransWipe(const Common::String filename) {
}
if (j == 0)
- checkerboardEffect(0, 0, curY, _screenWidth - 1, curY + 1);
+ checkerBoardEffect(0, 0, curY, _screenWidth - 1, curY + 1);
else
rectFill(0, curY, _screenWidth - 1, curY + 1, 0);
curY += 4;
@@ -804,7 +804,7 @@ void DisplayMan::doTransWipe(const Common::String filename) {
if (j == 0) {
imSource.blitBitmap(0, curY, &imDest, 0, curY, _screenWidth, 2, false);
- checkerboardEffect(0, 0, curY, _screenWidth - 1, curY + 1);
+ checkerBoardEffect(0, 0, curY, _screenWidth - 1, curY + 1);
} else {
uint16 bitmapHeight = (curY == lastY) ? 1 : 2;
imSource.blitBitmap(0, curY, &imDest, 0, curY, _screenWidth, bitmapHeight, false);
diff --git a/engines/lab/dispman.h b/engines/lab/dispman.h
index 19d40b9227..6d70172f17 100644
--- a/engines/lab/dispman.h
+++ b/engines/lab/dispman.h
@@ -70,22 +70,12 @@ private:
*/
Common::String getWord(const char *mainBuffer);
- byte _curPen;
- Common::File *_curBitmap;
- byte _curvgapal[256 * 3];
-
-public:
- DisplayMan(LabEngine *lab);
- virtual ~DisplayMan();
-
- void loadPict(const Common::String filename);
- void loadBackPict(const Common::String fileName, uint16 *highPal);
+ void createBox(uint16 y2);
/**
- * Reads in a picture into the display bitmap.
+ * Sets up either a low-res or a high-res 256 color screen.
*/
- void readPict(const Common::String filename, bool playOnce = true, bool onlyDiffData = false, byte *memoryBuffer = nullptr);
- void freePict();
+ void createScreen(bool hiRes);
/**
* Scrolls the display to black.
@@ -109,6 +99,51 @@ public:
void doTransWipe(const Common::String filename);
/**
+ * Draws a vertical line.
+ */
+ void drawHLine(uint16 x, uint16 y1, uint16 y2, byte color);
+
+ /**
+ * Draws a horizontal line.
+ */
+ void drawVLine(uint16 x1, uint16 y, uint16 x2, byte color);
+
+ /**
+ * Draws the text to the screen.
+ */
+ void drawText(TextFont *tf, uint16 x, uint16 y, uint16 color, const Common::String text);
+
+ /**
+ * Gets a line of text for flowText; makes sure that its length is less than
+ * or equal to the maximum width.
+ */
+ Common::String getLine(TextFont *tf, const char **mainBuffer, uint16 lineWidth);
+
+ /**
+ * Returns the length of a text in the specified font.
+ */
+ uint16 textLength(TextFont *font, const Common::String text);
+
+ bool _actionMessageShown;
+ byte _curPen;
+ Common::File *_curBitmap;
+ byte _curVgaPal[256 * 3];
+ byte *_currentDisplayBuffer;
+
+public:
+ DisplayMan(LabEngine *lab);
+ virtual ~DisplayMan();
+
+ void loadPict(const Common::String filename);
+ void loadBackPict(const Common::String fileName, uint16 *highPal);
+
+ /**
+ * Reads in a picture into the display bitmap.
+ */
+ void readPict(const Common::String filename, bool playOnce = true, bool onlyDiffData = false, byte *memoryBuffer = nullptr);
+ void freePict();
+
+ /**
* Does a certain number of pre-programmed wipes.
*/
void doTransition(TransitionType transitionType, const Common::String filename);
@@ -127,7 +162,6 @@ public:
* Changes the entire screen to black.
*/
void blackAllScreen();
- void createBox(uint16 y2);
/**
* Draws the control panel display.
@@ -149,11 +183,6 @@ public:
void setActionMessage(bool val) { _actionMessageShown = val; }
/**
- * Sets the pen number to use on all the drawing operations.
- */
- void setPen(byte pennum);
-
- /**
* Fills in a rectangle.
*/
void rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte color);
@@ -178,23 +207,9 @@ public:
int flowText(TextFont *font, int16 spacing, byte penColor, byte backPen, bool fillBack,
bool centerh, bool centerv, bool output, Common::Rect textRect, const char *text, Image *targetImage = nullptr);
- /**
- * Draws a vertical line.
- */
- void drawHLine(uint16 x, uint16 y1, uint16 y2, byte color);
-
- /**
- * Draws a horizontal line.
- */
- void drawVLine(uint16 x1, uint16 y, uint16 x2, byte color);
void screenUpdate();
/**
- * Sets up either a low-res or a high-res 256 color screen.
- */
- void createScreen(bool hiRes);
-
- /**
* Converts a 16-color Amiga palette to a VGA palette, then sets
* the VGA palette.
*/
@@ -216,7 +231,7 @@ public:
/**
* Overlays a region on the screen using the desired pen color.
*/
- void checkerboardEffect(uint16 penColor, uint16 x1, uint16 y1, uint16 x2, uint16 y2);
+ void checkerBoardEffect(uint16 penColor, uint16 x1, uint16 y1, uint16 x2, uint16 y2);
/**
* Returns the base address of the current VGA display.
@@ -242,34 +257,16 @@ public:
void freeFont(TextFont **font);
/**
- * Returns the length of a text in the specified font.
- */
- uint16 textLength(TextFont *font, const Common::String text);
-
- /**
* Returns the height of a specified font.
*/
uint16 textHeight(TextFont *tf);
- /**
- * Draws the text to the screen.
- */
- void drawText(TextFont *tf, uint16 x, uint16 y, uint16 color, const Common::String text);
-
- /**
- * Gets a line of text for flowText; makes sure that its length is less than
- * or equal to the maximum width.
- */
- Common::String getLine(TextFont *tf, const char **mainBuffer, uint16 lineWidth);
-
bool _longWinInFront;
bool _lastMessageLong;
- bool _actionMessageShown;
uint32 _screenBytesPerPage;
int _screenWidth;
int _screenHeight;
byte *_displayBuffer;
- byte *_currentDisplayBuffer;
uint16 *_fadePalette;
};
diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp
index 507e0b27d5..7e57494390 100644
--- a/engines/lab/interface.cpp
+++ b/engines/lab/interface.cpp
@@ -78,7 +78,7 @@ void EventManager::drawButtonList(ButtonList *buttonList) {
void EventManager::toggleButton(Button *button, uint16 disabledPenColor, bool enable) {
if (!enable)
- _vm->_graphics->checkerboardEffect(disabledPenColor, button->_x, button->_y, button->_x + button->_image->_width - 1, button->_y + button->_image->_height - 1);
+ _vm->_graphics->checkerBoardEffect(disabledPenColor, button->_x, button->_y, button->_x + button->_image->_width - 1, button->_y + button->_image->_height - 1);
else
button->_image->drawImage(button->_x, button->_y);