diff options
Diffstat (limited to 'engines/hdb/gfx.cpp')
-rw-r--r-- | engines/hdb/gfx.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp index 6c743ea55e..987a567e3c 100644 --- a/engines/hdb/gfx.cpp +++ b/engines/hdb/gfx.cpp @@ -38,7 +38,7 @@ Gfx::Gfx() { _tLookupArray = NULL; _starsInfo.active = false; _gfxCache = new Common::Array<GfxCache *>; - _globalSurface.create(kScreenWidth, kScreenHeight, g_hdb->_format); + _globalSurface.create(g_hdb->_screenWidth, g_hdb->_screenHeight, g_hdb->_format); _pointerDisplayable = 1; _sines = new Common::SineTable(360); _cosines = new Common::CosineTable(360); @@ -87,9 +87,9 @@ bool Gfx::init() { setCursor(0, 0); _eLeft = 0; - _eRight = kScreenWidth; + _eRight = g_hdb->_screenWidth; _eTop = 0; - _eBottom = kScreenHeight; + _eBottom = g_hdb->_screenHeight; // Load Game Font if (!loadFont("normalprop")) @@ -234,7 +234,7 @@ double Gfx::getCos(int index) { } void Gfx::fillScreen(uint32 color) { - _globalSurface.fillRect(Common::Rect(kScreenWidth, kScreenHeight), color); + _globalSurface.fillRect(Common::Rect(g_hdb->_screenWidth, g_hdb->_screenHeight), color); g_system->fillScreen(color); } @@ -246,10 +246,10 @@ void Gfx::updateVideo() { g_hdb->checkProgress(); - int left = kScreenWidth / 2 - g_hdb->_progressGfx->_width / 2; + int left = g_hdb->_screenWidth / 2 - g_hdb->_progressGfx->_width / 2; Common::Rect clip(g_hdb->_progressGfx->getSurface()->getBounds()); - clip.moveTo(left, kProgressY); + clip.moveTo(left, g_hdb->_progressY); clip.clip(g_hdb->_gfx->_globalSurface.getBounds()); if (!clip.isEmpty()) { g_system->copyRectToScreen(g_hdb->_gfx->_globalSurface.getBasePtr(clip.left, clip.top), g_hdb->_gfx->_globalSurface.pitch, clip.left, clip.top, clip.width(), clip.height()); @@ -304,8 +304,8 @@ void Gfx::updateFade() { return; Graphics::ManagedSurface fadeBuffer1, fadeBuffer2; - fadeBuffer1.create(kScreenWidth, kScreenHeight, g_hdb->_format); - fadeBuffer2.create(kScreenWidth, kScreenHeight, g_hdb->_format); + fadeBuffer1.create(g_hdb->_screenWidth, g_hdb->_screenHeight, g_hdb->_format); + fadeBuffer2.create(g_hdb->_screenWidth, g_hdb->_screenHeight, g_hdb->_format); fadeBuffer2.blitFrom(_globalSurface); @@ -320,9 +320,9 @@ void Gfx::updateFade() { if (!_fadeInfo.isBlack) { // Black Fade - for (int y = 0; y < kScreenHeight; y++) { + for (int y = 0; y < g_hdb->_screenHeight; y++) { ptr = (uint16 *)fadeBuffer1.getBasePtr(0, y); - for (int x = 0; x < kScreenWidth; x++) { + for (int x = 0; x < g_hdb->_screenWidth; x++) { value = *ptr; if (value) { g_hdb->_format.colorToRGB(value, r, g, b); @@ -337,9 +337,9 @@ void Gfx::updateFade() { } else { // White Fade - for (int y = 0; y < kScreenHeight; y++) { + for (int y = 0; y < g_hdb->_screenHeight; y++) { ptr = (uint16 *)fadeBuffer1.getBasePtr(0, y); - for (int x = 0; x < kScreenWidth; x++) { + for (int x = 0; x < g_hdb->_screenWidth; x++) { value = *ptr; g_hdb->_format.colorToRGB(value, r, g, b); r += (255 - r) * (256 - _fadeInfo.curStep) / 256; @@ -400,8 +400,8 @@ void Gfx::updateFade() { void Gfx::turnOnSnow() { _snowInfo.active = true; for (int i = 0; i < MAX_SNOW; i++) { - _snowInfo.x[i] = g_hdb->_rnd->getRandomNumber(kScreenWidth - 1); - _snowInfo.y[i] = g_hdb->_rnd->getRandomNumber(kScreenHeight - 1); + _snowInfo.x[i] = g_hdb->_rnd->getRandomNumber(g_hdb->_screenWidth - 1); + _snowInfo.y[i] = g_hdb->_rnd->getRandomNumber(g_hdb->_screenHeight - 1); _snowInfo.yv[i] = g_hdb->_rnd->getRandomNumber(2) + 1; _snowInfo.xvindex[i] = g_hdb->_rnd->getRandomNumber(MAX_SNOW_XV - 1); } @@ -642,8 +642,8 @@ void Gfx::setSky(int skyIndex) { void Gfx::setup3DStars() { for (int i = 0; i < kNum3DStars; i++) { - _stars3D[i].x = g_hdb->_rnd->getRandomNumber(kScreenWidth - 1); - _stars3D[i].y = g_hdb->_rnd->getRandomNumber(kScreenHeight - 1); + _stars3D[i].x = g_hdb->_rnd->getRandomNumber(g_hdb->_screenWidth - 1); + _stars3D[i].y = g_hdb->_rnd->getRandomNumber(g_hdb->_screenHeight - 1); _stars3D[i].speed = g_hdb->_rnd->getRandomNumber(255); _stars3D[i].speed >>= 1; _stars3D[i].color = _stars3D[i].speed / 64; @@ -652,8 +652,8 @@ void Gfx::setup3DStars() { void Gfx::setup3DStarsLeft() { for (int i = 0; i < kNum3DStars; i++) { - _stars3DSlow[i].x = g_hdb->_rnd->getRandomNumber(kScreenWidth - 1); - _stars3DSlow[i].y = g_hdb->_rnd->getRandomNumber(kScreenHeight - 1); + _stars3DSlow[i].x = g_hdb->_rnd->getRandomNumber(g_hdb->_screenWidth - 1); + _stars3DSlow[i].y = g_hdb->_rnd->getRandomNumber(g_hdb->_screenHeight - 1); _stars3DSlow[i].speed = ((double) (1 + g_hdb->_rnd->getRandomNumber(4))) / 6.0; _stars3DSlow[i].color = (int) (_stars3DSlow[i].speed * 4.00); } @@ -664,7 +664,7 @@ void Gfx::draw3DStars() { for (int i = 0; i < kNum3DStars; i++) { _starField[_stars3D[i].color]->drawMasked((int)_stars3D[i].x, (int)_stars3D[i].y); _stars3D[i].y += (_stars3D[i].speed >> 5) + 1; - if (_stars3D[i].y > kScreenHeight) { + if (_stars3D[i].y > g_hdb->_screenHeight) { _stars3D[i].y = 0; } } @@ -676,7 +676,7 @@ void Gfx::draw3DStarsLeft() { _starField[_stars3DSlow[i].color]->drawMasked((int)_stars3DSlow[i].x, (int)_stars3DSlow[i].y); _stars3DSlow[i].x -= _stars3DSlow[i].speed; if (_stars3DSlow[i].x < 0) { - _stars3DSlow[i].x = kScreenWidth - 1; + _stars3DSlow[i].x = g_hdb->_screenWidth - 1; } } } @@ -690,8 +690,8 @@ void Gfx::drawSky() { draw3DStarsLeft(); } else if (tile == _tileSkyClouds) { static int offset = 0, wait = 0; - for (int j = -64; j < kScreenHeight; j += 64) { - for (int i = -64; i < kScreenWidth; i += 64) { + for (int j = -64; j < g_hdb->_screenHeight; j += 64) { + for (int i = -64; i < g_hdb->_screenWidth; i += 64) { if (_skyClouds) _skyClouds->draw(i + offset, j + offset); } @@ -719,8 +719,8 @@ void Gfx::drawSnow() { if (_snowInfo.xvindex[i] == MAX_SNOW_XV) _snowInfo.xvindex[i] = 0; if (_snowInfo.x[i] < 0) - _snowInfo.x[i] = kScreenWidth - 1; - if (_snowInfo.y[i] > kScreenHeight - 1) + _snowInfo.x[i] = g_hdb->_screenWidth - 1; + if (_snowInfo.y[i] > g_hdb->_screenHeight - 1) _snowInfo.y[i] = 0; } } @@ -848,10 +848,10 @@ void Gfx::drawText(const char *string) { // Advance the cursor _cursorX += width + _fontHeader.kerning + kFontIncrement; - if (_cursorX > kScreenWidth) { + if (_cursorX > g_hdb->_screenWidth) { _cursorX = 0; _cursorY += _fontHeader.height + _fontHeader.leading; - if (_cursorY + _fontHeader.height > kScreenHeight) + if (_cursorY + _fontHeader.height > g_hdb->_screenHeight) _cursorY = 0; } } @@ -926,7 +926,7 @@ void Gfx::centerPrint(const char *string) { totalWidth += _charInfoBlocks[string[i]]->width; } - setCursor(kScreenWidth / 2 - totalWidth / 2, _cursorX); + setCursor(g_hdb->_screenWidth / 2 - totalWidth / 2, _cursorX); drawText(string); } @@ -1037,7 +1037,7 @@ void Gfx::drawBonusStars() { void Gfx::drawDebugInfo(Tile *_debugLogo, int fps) { char buff[64]; - _debugLogo->drawMasked(kScreenWidth - 32, 0); + _debugLogo->drawMasked(g_hdb->_screenWidth - 32, 0); // Draw FPS setCursor(0, 0); |