get rid of VirtScreen::scrollable
svn-id: r12173
This commit is contained in:
parent
f5f357498f
commit
2ecf66d561
3 changed files with 7 additions and 22 deletions
|
@ -1085,7 +1085,7 @@ void CharsetRendererClassic::printChar(int chr) {
|
|||
|
||||
_vm->markRectAsDirty(vs->number, _left, _left + width, drawTop, drawTop + height + offsY, 0);
|
||||
|
||||
if (vs->number != kMainVirtScreen)
|
||||
if (!vs->hasTwoBuffers)
|
||||
_blitAlso = false;
|
||||
if (vs->number == kMainVirtScreen && !_ignoreCharsetMask)
|
||||
_hasMask = true;
|
||||
|
|
|
@ -217,12 +217,11 @@ void ScummEngine::initVirtScreen(VirtScreenNumber slot, int number, int top, int
|
|||
vs->topline = top;
|
||||
vs->height = height;
|
||||
vs->hasTwoBuffers = twobufs;
|
||||
vs->scrollable = scrollable;
|
||||
vs->xstart = 0;
|
||||
vs->backBuf = NULL;
|
||||
|
||||
size = vs->width * vs->height;
|
||||
if (vs->scrollable) {
|
||||
if (scrollable) {
|
||||
// Allow enough spaces so that rooms can be up to 4 resp. 8 screens
|
||||
// wide. To achieve (horizontal!) scrolling, we use a neat trick:
|
||||
// only the offset into the screen buffer (xstart) is changed. That way
|
||||
|
@ -936,13 +935,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi
|
|||
|
||||
_vertStripNextInc = height * vs->width - 1;
|
||||
|
||||
sx = x;
|
||||
// FIXME / TODO: This is the only place vs->scrollable is ever checked, and
|
||||
// I think we can simply remove the condition and always use xstart - it
|
||||
// should always be 0 for any non-scrolling virtual screen, after all.
|
||||
assert(vs->scrollable || !vs->xstart);
|
||||
if (vs->scrollable)
|
||||
sx -= vs->xstart / 8;
|
||||
sx = x - vs->xstart / 8;
|
||||
|
||||
//
|
||||
// Since V3, all graphics data was encoded in strips, which is very efficient
|
||||
|
|
16
scumm/gfx.h
16
scumm/gfx.h
|
@ -75,8 +75,8 @@ enum VirtScreenNumber {
|
|||
* It seems that it is not used at all by ScummVM, so we probably could just
|
||||
* get rid of it and save a couple kilobytes of RAM.
|
||||
*
|
||||
* Each of these virtual screens has a fixed number or id (see also the
|
||||
* VirtScreenNumber enum).
|
||||
* Each of these virtual screens has a fixed number or id (see also
|
||||
* \ref VirtScreenNumber).
|
||||
*/
|
||||
struct VirtScreen {
|
||||
/**
|
||||
|
@ -101,18 +101,10 @@ struct VirtScreen {
|
|||
/** Height of the virtual screen. */
|
||||
uint16 height;
|
||||
|
||||
/**
|
||||
* Flag indicating that this virtual screen allows (horizontal) scrolling.
|
||||
* This is always only true for the main screen (stage)! After all, verbs
|
||||
* and the conversation text box don't have to scroll.
|
||||
* @todo Get rid of this, there is only one place where it is used,
|
||||
* and there it is trivial to remove the usage.
|
||||
*/
|
||||
bool scrollable;
|
||||
|
||||
/**
|
||||
* Horizontal scroll offset, tells how far the screen is scrolled to the
|
||||
* right. Only used for the main screen.
|
||||
* right. Only used for the main screen. After all, verbs and the
|
||||
* conversation text box don't have to scroll.
|
||||
*/
|
||||
uint16 xstart;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue