diff options
Diffstat (limited to 'engines/drascula/graphics.cpp')
-rw-r--r-- | engines/drascula/graphics.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 3bdf724670..fe954279c3 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -82,7 +82,7 @@ void DrasculaEngine::moveCursor() { } else if (!_menuScreen && _color != kColorLightGreen) color_abc(kColorLightGreen); if (_hasName && !_menuScreen) - centerText(textName, mouseX, mouseY); + centerText(textName, _mouseX, _mouseY); if (_menuScreen) showMenu(); else if (_menuBar) @@ -132,7 +132,7 @@ void DrasculaEngine::showFrame(Common::SeekableReadStream *stream, bool firstFra byte *prevFrame = (byte *)malloc(64000); Graphics::Surface *screenSurf = _system->lockScreen(); - byte *screenBuffer = (byte *)screenSurf->pixels; + byte *screenBuffer = (byte *)screenSurf->getPixels(); uint16 screenPitch = screenSurf->pitch; for (int y = 0; y < 200; y++) { memcpy(prevFrame+y*320, screenBuffer+y*screenPitch, 320); @@ -336,7 +336,7 @@ void DrasculaEngine::centerText(const char *message, int textX, int textY) { // original starts printing 4 lines above textY int y = CLIP<int>(textY - (4 * CHAR_HEIGHT), 0, 320); - strcpy(msg, message); + Common::strlcpy(msg, message, 200); // If the message fits on screen as-is, just print it here if (textFitsCentered(msg, textX)) { @@ -363,8 +363,8 @@ void DrasculaEngine::centerText(const char *message, int textX, int textY) { while (curWord != NULL) { // Check if the word and the current line fit on screen if (tmpMessageLine[0] != '\0') - strcat(tmpMessageLine, " "); - strcat(tmpMessageLine, curWord); + Common::strlcat(tmpMessageLine, " ", 200); + Common::strlcat(tmpMessageLine, curWord, 200); if (textFitsCentered(tmpMessageLine, textX)) { // Line fits, so add the word to the current message line strcpy(messageLine, tmpMessageLine); @@ -374,8 +374,8 @@ void DrasculaEngine::centerText(const char *message, int textX, int textY) { // If it goes off screen, print_abc will adjust it x = CLIP<int>(textX - strlen(messageLine) * CHAR_WIDTH / 2, 60, 255); print_abc(messageLine, x, y + curLine * CHAR_HEIGHT); - strcpy(messageLine, curWord); - strcpy(tmpMessageLine, curWord); + Common::strlcpy(messageLine, curWord, 200); + Common::strlcpy(tmpMessageLine, curWord, 200); curLine++; } @@ -417,8 +417,8 @@ void DrasculaEngine::screenSaver() { delete stream; updateEvents(); - xr = mouseX; - yr = mouseY; + xr = _mouseX; + yr = _mouseY; while (!shouldQuit()) { // efecto(bgSurface); @@ -449,7 +449,7 @@ void DrasculaEngine::screenSaver() { int x1_, y1_, off1, off2; Graphics::Surface *screenSurf = _system->lockScreen(); - byte *screenBuffer = (byte *)screenSurf->pixels; + byte *screenBuffer = (byte *)screenSurf->getPixels(); uint16 screenPitch = screenSurf->pitch; for (int i = 0; i < 200; i++) { for (int j = 0; j < 320; j++) { @@ -480,18 +480,18 @@ void DrasculaEngine::screenSaver() { // end of efecto() updateEvents(); - if (rightMouseButton == 1 || leftMouseButton == 1) + if (_rightMouseButton == 1 || _leftMouseButton == 1) break; - if (mouseX != xr) + if (_mouseX != xr) break; - if (mouseY != yr) + if (_mouseY != yr) break; } // fin_ghost(); free(copia); free(ghost); - loadPic(roomNumber, bgSurface, HALF_PAL); + loadPic(_roomNumber, bgSurface, HALF_PAL); showCursor(); } @@ -538,7 +538,7 @@ int DrasculaEngine::playFrameSSN(Common::SeekableReadStream *stream) { waitFrameSSN(); Graphics::Surface *screenSurf = _system->lockScreen(); - byte *screenBuffer = (byte *)screenSurf->pixels; + byte *screenBuffer = (byte *)screenSurf->getPixels(); uint16 screenPitch = screenSurf->pitch; if (FrameSSN) mixVideo(screenBuffer, screenSurface, screenPitch); @@ -557,7 +557,7 @@ int DrasculaEngine::playFrameSSN(Common::SeekableReadStream *stream) { free(BufferSSN); waitFrameSSN(); Graphics::Surface *screenSurf = _system->lockScreen(); - byte *screenBuffer = (byte *)screenSurf->pixels; + byte *screenBuffer = (byte *)screenSurf->getPixels(); uint16 screenPitch = screenSurf->pitch; if (FrameSSN) mixVideo(screenBuffer, screenSurface, screenPitch); |