From 97ef7c2a34c4077d6d046f0aabce7e1dde04e092 Mon Sep 17 00:00:00 2001 From: Paweł Kołodziejski Date: Sun, 1 Sep 2002 16:37:08 +0000 Subject: more resolution fixes svn-id: r4895 --- gui/dialog.cpp | 2 +- gui/gui.cpp | 14 +++++++------- gui/newgui.cpp | 34 +++++++++++++++++----------------- 3 files changed, 25 insertions(+), 25 deletions(-) (limited to 'gui') diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 2caf5f541e..3e14209fe2 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -54,7 +54,7 @@ void Dialog::setupScreenBuf() { // Create _screenBuf if it doesn't already exist if (!_screenBuf) - _screenBuf = new byte[320*200]; + _screenBuf = new byte[g_scumm->_realWidth * g_scumm->_realHeight]; // Draw the fixed parts of the dialog: background and border. _gui->blendRect(_x, _y, _w, _h, _gui->_bgcolor); diff --git a/gui/gui.cpp b/gui/gui.cpp index 2a7fa3db25..8e118ed792 100644 --- a/gui/gui.cpp +++ b/gui/gui.cpp @@ -361,7 +361,7 @@ void Gui::drawChar(const char str, int xx, int yy) if (color) ptr[x] = _color; } - ptr += 320; + ptr += _s->_realWidth; } _color = tempc; @@ -491,7 +491,7 @@ void Gui::drawWidget(const GuiWidget *w) ptr[x2] = color; mask >>= 4; } - ptr += 320; + ptr += _s->_realWidth; } } } @@ -515,7 +515,7 @@ void Gui::widgetClear(const GuiWidget *wid) if (wid->_flags & GWF_BORDER) { // Inset by 1 pixel in all directions - ptr += 320 + 1; + ptr += _s->_realWidth + 1; w -= 2; h -= 2; } @@ -523,7 +523,7 @@ void Gui::widgetClear(const GuiWidget *wid) while (h--) { for (i = 0; i < w; i++) ptr[i] = _bgcolor; - ptr += 320; + ptr += _s->_realWidth; } } @@ -554,8 +554,8 @@ byte *Gui::getBasePtr(int x, int y) if (_vs == NULL) return NULL; - return _vs->screenPtr + x + (y - _vs->topline) * 320 + - _s->_screenStartStrip * 8 + (_s->camera._cur.y - 100) * 320; + return _vs->screenPtr + x + (y - _vs->topline) * _s->_realWidth + + _s->_screenStartStrip * 8 + (_s->camera._cur.y - (_s->_realHeight / 2)) * _s->_realWidth; } void Gui::line(int x, int y, int x2, int y2, byte color) @@ -577,7 +577,7 @@ void Gui::line(int x, int y, int x2, int y2, byte color) /* vertical line */ while (y++ <= y2) { *ptr = color; - ptr += 320; + ptr += _s->_realWidth; } } else if (y == y2) { /* horizontal line */ diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 605cc0bb6e..2ad2c26afe 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -307,8 +307,8 @@ byte *NewGui::getBasePtr(int x, int y) if (vs == NULL) return NULL; - return vs->screenPtr + x + (y - vs->topline) * 320 + - _s->_screenStartStrip * 8 + (_s->camera._cur.y - 100) * 320; + return vs->screenPtr + x + (y - vs->topline) * _s->_realWidth + + _s->_screenStartStrip * 8 + (_s->camera._cur.y - (_s->_realHeight / 2)) * _s->_realWidth; } void NewGui::box(int x, int y, int width, int height) @@ -343,7 +343,7 @@ void NewGui::line(int x, int y, int x2, int y2, byte color) /* vertical line */ while (y++ <= y2) { *ptr = color; - ptr += 320; + ptr += _s->_realWidth; } } else if (y == y2) { /* horizontal line */ @@ -363,7 +363,7 @@ void NewGui::blendRect(int x, int y, int w, int h, byte color) for (int i = 0; i < w; i++) { ptr[i] = Blend(ptr[i], color, _s->_currentPalette); } - ptr += 320; + ptr += _s->_realWidth; } } @@ -377,7 +377,7 @@ void NewGui::fillRect(int x, int y, int w, int h, byte color) for (int i = 0; i < w; i++) { ptr[i] = color; } - ptr += 320; + ptr += _s->_realWidth; } } @@ -392,7 +392,7 @@ void NewGui::checkerRect(int x, int y, int w, int h, byte color) if ((h ^ i) & 1) ptr[i] = color; } - ptr += 320; + ptr += _s->_realWidth; } } @@ -407,12 +407,12 @@ void NewGui::frameRect(int x, int y, int w, int h, byte color) for (i = 0; i < w; i++, ptr++) *ptr = color; ptr--; - for (i = 0; i < h; i++, ptr += 320) + for (i = 0; i < h; i++, ptr += _s->_realWidth) *ptr = color; ptr = basePtr; - for (i = 0; i < h; i++, ptr += 320) + for (i = 0; i < h; i++, ptr += _s->_realWidth) *ptr = color; - ptr -= 320; + ptr -= _s->_realWidth; for (i = 0; i < w; i++, ptr++) *ptr = color; } @@ -450,7 +450,7 @@ void NewGui::drawChar(const char str, int xx, int yy) if (color) ptr[x] = _color; } - ptr += 320; + ptr += _s->_realWidth; } _color = tempc; @@ -502,13 +502,13 @@ void NewGui::drawBitmap(uint32 bitmap[8], int x, int y, byte color) ptr[x2] = color; mask >>= 4; } - ptr += 320; + ptr += _s->_realWidth; } } void NewGui::blitTo(byte buffer[320*200], int x, int y, int w, int h) { - byte *dstPtr = buffer + x + y*320; + byte *dstPtr = buffer + x + y * _s->_realWidth; byte *srcPtr = getBasePtr(x, y); if (srcPtr == NULL) return; @@ -517,14 +517,14 @@ void NewGui::blitTo(byte buffer[320*200], int x, int y, int w, int h) for (int i = 0; i < w; i++) { *dstPtr++ = *srcPtr++; } - dstPtr += 320 - w; - srcPtr += 320 - w; + dstPtr += _s->_realWidth - w; + srcPtr += _s->_realWidth - w; } } void NewGui::blitFrom(byte buffer[320*200], int x, int y, int w, int h) { - byte *srcPtr = buffer + x + y*320; + byte *srcPtr = buffer + x + y * _s->_realWidth; byte *dstPtr = getBasePtr(x, y); if (dstPtr == NULL) return; @@ -533,8 +533,8 @@ void NewGui::blitFrom(byte buffer[320*200], int x, int y, int w, int h) for (int i = 0; i < w; i++) { *dstPtr++ = *srcPtr++; } - dstPtr += 320 - w; - srcPtr += 320 - w; + dstPtr += _s->_realWidth - w; + srcPtr += _s->_realWidth - w; } } -- cgit v1.2.3