diff options
author | Nicola Mettifogo | 2007-08-11 13:07:21 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-08-11 13:07:21 +0000 |
commit | 8c2ae45ab443ac4b9d3d21341fbb74b44858fd8f (patch) | |
tree | 662ffb2e86c5781225e78122700b5a638dcce9be /engines | |
parent | 2c6c654435d94b523ac458fc18ebce46fdce1c21 (diff) | |
download | scummvm-rg350-8c2ae45ab443ac4b9d3d21341fbb74b44858fd8f.tar.gz scummvm-rg350-8c2ae45ab443ac4b9d3d21341fbb74b44858fd8f.tar.bz2 scummvm-rg350-8c2ae45ab443ac4b9d3d21341fbb74b44858fd8f.zip |
Overhaul of background/mask/path handling:
- added new BackgroundInfo structure
- added helper functions to aid management of BackgroundInfo. Engine is now responsible for allocation/deallocation.
- simplified loading and handling of background resources.
svn-id: r28524
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/disk.h | 29 | ||||
-rw-r--r-- | engines/parallaction/disk_br.cpp | 8 | ||||
-rw-r--r-- | engines/parallaction/disk_ns.cpp | 126 | ||||
-rw-r--r-- | engines/parallaction/graphics.cpp | 20 | ||||
-rw-r--r-- | engines/parallaction/location.cpp | 63 | ||||
-rw-r--r-- | engines/parallaction/menu.cpp | 26 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 8 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 19 | ||||
-rw-r--r-- | engines/parallaction/walk.cpp | 5 |
9 files changed, 154 insertions, 150 deletions
diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index d1bb404739..a52e9e1981 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -39,6 +39,7 @@ class Script; class Font; struct Cnv; +struct BackgroundInfo; class Disk { @@ -58,8 +59,8 @@ public: virtual Font* loadFont(const char* name) = 0; virtual Graphics::Surface* loadStatic(const char* name) = 0; virtual Cnv* loadFrames(const char* name) = 0; - virtual void loadSlide(const char *filename) = 0; - virtual void loadScenery(const char* background, const char* mask) = 0; + virtual BackgroundInfo* loadSlide(const char *filename) = 0; + virtual BackgroundInfo* loadScenery(const char* background, const char* mask, const char* path) = 0; virtual Table* loadTable(const char* name) = 0; virtual Common::SeekableReadStream* loadMusic(const char* name) = 0; virtual Common::ReadStream* loadSound(const char* name) = 0; @@ -128,10 +129,10 @@ private: Cnv* loadExternalCnv(const char *filename); Cnv* loadCnv(const char *filename); Graphics::Surface *loadExternalStaticCnv(const char *filename); - void loadBackground(const char *filename); - void loadMaskAndPath(const char *name); + BackgroundInfo* loadBackground(const char *filename); + void loadMaskAndPath(const char *name, BackgroundInfo *info); void parseDepths(Common::SeekableReadStream &stream); - void parseBackground(Common::SeekableReadStream &stream); + void parseBackground(Common::SeekableReadStream &stream, BackgroundInfo *info); Font *createFont(const char *name, Cnv* cnv); protected: @@ -150,8 +151,8 @@ public: Font* loadFont(const char* name); Graphics::Surface* loadStatic(const char* name); Cnv* loadFrames(const char* name); - void loadSlide(const char *filename); - void loadScenery(const char* background, const char* mask); + BackgroundInfo* loadSlide(const char *filename); + BackgroundInfo* loadScenery(const char* background, const char* mask, const char* path); Table* loadTable(const char* name); Common::SeekableReadStream* loadMusic(const char* name); Common::ReadStream* loadSound(const char* name); @@ -167,9 +168,9 @@ protected: void unpackBitmap(byte *dst, byte *src, uint16 numFrames, uint16 bytesPerPlane, uint16 height); Common::SeekableReadStream *openArchivedFile(const char* name, bool errorOnFileNotFound = false); Font *createFont(const char *name, Common::SeekableReadStream &stream); - void loadMask(const char *name); - void loadPath(const char *name); - void loadBackground(const char *name); + void loadMask(const char *name, BackgroundInfo* info); + void loadPath(const char *name, BackgroundInfo* info); + BackgroundInfo* loadBackground(const char *name); public: AmigaDisk_ns(Parallaction *vm); @@ -184,8 +185,8 @@ public: Font* loadFont(const char* name); Graphics::Surface* loadStatic(const char* name); Cnv* loadFrames(const char* name); - void loadSlide(const char *filename); - void loadScenery(const char* background, const char* mask); + BackgroundInfo* loadSlide(const char *filename); + BackgroundInfo* loadScenery(const char* background, const char* mask, const char* path); Table* loadTable(const char* name); Common::SeekableReadStream* loadMusic(const char* name); Common::ReadStream* loadSound(const char* name); @@ -218,8 +219,8 @@ public: Font* loadFont(const char* name); Graphics::Surface* loadStatic(const char* name); Cnv* loadFrames(const char* name); - void loadSlide(const char *filename); - void loadScenery(const char* background, const char* mask); + BackgroundInfo* loadSlide(const char *filename); + BackgroundInfo* loadScenery(const char* background, const char* mask, const char* path); Table* loadTable(const char* name); Common::SeekableReadStream* loadMusic(const char* name); Common::ReadStream* loadSound(const char* name); diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index 900a025756..dbdd308ad4 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -133,15 +133,15 @@ Cnv* DosDisk_br::loadFrames(const char* name) { // there are no Slide resources in Big Red Adventure -void DosDisk_br::loadSlide(const char *name) { +BackgroundInfo* DosDisk_br::loadSlide(const char *name) { debugC(5, kDebugDisk, "DosDisk_br::loadSlide"); - return; + return 0; } -void DosDisk_br::loadScenery(const char *name, const char *mask) { +BackgroundInfo* DosDisk_br::loadScenery(const char *name, const char *mask, const char* path) { debugC(5, kDebugDisk, "DosDisk_br::loadScenery"); - return; + return 0; } Table* DosDisk_br::loadTable(const char* name) { diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp index 6506ddd2ac..cfcb9552e4 100644 --- a/engines/parallaction/disk_ns.cpp +++ b/engines/parallaction/disk_ns.cpp @@ -562,7 +562,7 @@ void DosDisk_ns::parseDepths(Common::SeekableReadStream &stream) { } -void DosDisk_ns::parseBackground(Common::SeekableReadStream &stream) { +void DosDisk_ns::parseBackground(Common::SeekableReadStream &stream, BackgroundInfo *info) { byte tmp[3]; @@ -570,11 +570,9 @@ void DosDisk_ns::parseBackground(Common::SeekableReadStream &stream) { tmp[0] = stream.readByte(); tmp[1] = stream.readByte(); tmp[2] = stream.readByte(); - _vm->_gfx->_palette.setEntry(i, tmp[0], tmp[1], tmp[2]); + info->palette.setEntry(i, tmp[0], tmp[1], tmp[2]); } - _vm->_gfx->setPalette(_vm->_gfx->_palette); - parseDepths(stream); for (uint32 _si = 0; _si < 6; _si++) { @@ -587,30 +585,25 @@ void DosDisk_ns::parseBackground(Common::SeekableReadStream &stream) { } -void DosDisk_ns::loadBackground(const char *filename) { +BackgroundInfo* DosDisk_ns::loadBackground(const char *filename) { if (!_resArchive.openArchivedFile(filename)) errorFileNotFound(filename); - parseBackground(_resArchive); - - Graphics::Surface *bg = new Graphics::Surface; - bg->create(_vm->_screenWidth, _vm->_screenHeight, 1); + BackgroundInfo *info = new BackgroundInfo; + info->width = _vm->_screenWidth; // 320 + info->height = _vm->_screenHeight; // 200 - MaskBuffer *mask = new MaskBuffer; - mask->create(_vm->_screenWidth, _vm->_screenHeight); + parseBackground(_resArchive, info); - PathBuffer *path = new PathBuffer; - path->create(_vm->_screenWidth, _vm->_screenHeight); + info->bg.create(info->width, info->height, 1); + info->mask.create(info->width, info->height); + info->path.create(info->width, info->height); Graphics::PackBitsReadStream stream(_resArchive); - unpackBackground(&stream, (byte*)bg->pixels, mask->data, path->data); + unpackBackground(&stream, (byte*)info->bg.pixels, info->mask.data, info->path.data); - _vm->_gfx->setBackground(bg); - _vm->_gfx->setMask(mask); - _vm->setPath(path); - - return; + return info; } // @@ -619,46 +612,41 @@ void DosDisk_ns::loadBackground(const char *filename) { // mask and path are normally combined (via OR) into the background picture itself // read the comment on the top of this file for more // -void DosDisk_ns::loadMaskAndPath(const char *name) { +void DosDisk_ns::loadMaskAndPath(const char *name, BackgroundInfo *info) { char path[PATH_LEN]; sprintf(path, "%s.msk", name); if (!_resArchive.openArchivedFile(path)) errorFileNotFound(name); - MaskBuffer *mask = new MaskBuffer; - mask->create(_vm->_screenWidth, _vm->_screenHeight); - - PathBuffer *pathBuf = new PathBuffer; - pathBuf->create(_vm->_screenWidth, _vm->_screenHeight); - parseDepths(_resArchive); - _resArchive.read(pathBuf->data, pathBuf->size); - _resArchive.read(mask->data, mask->size); + info->path.create(info->width, info->height); + _resArchive.read(info->path.data, info->path.size); - _vm->_gfx->setMask(mask); - _vm->setPath(pathBuf); + info->mask.create(info->width, info->height); + _resArchive.read(info->mask.data, info->mask.size); return; } -void DosDisk_ns::loadSlide(const char *filename) { +BackgroundInfo* DosDisk_ns::loadSlide(const char *filename) { char path[PATH_LEN]; sprintf(path, "%s.slide", filename); - loadBackground(path); + return loadBackground(path); } -void DosDisk_ns::loadScenery(const char *name, const char *mask) { - char path[PATH_LEN]; - sprintf(path, "%s.dyn", name); - loadBackground(path); +BackgroundInfo* DosDisk_ns::loadScenery(const char *name, const char *mask, const char* path) { + char filename[PATH_LEN]; + sprintf(filename, "%s.dyn", name); + BackgroundInfo *info = loadBackground(filename); if (mask != NULL) { // load external masks and paths only for certain locations - loadMaskAndPath(mask); + loadMaskAndPath(mask, info); } + return info; } Table* DosDisk_ns::loadTable(const char* name) { @@ -1188,15 +1176,20 @@ public: }; -void AmigaDisk_ns::loadBackground(const char *name) { +BackgroundInfo* AmigaDisk_ns::loadBackground(const char *name) { Common::SeekableReadStream *s = openArchivedFile(name, true); - Graphics::Surface *surf = new Graphics::Surface; byte *pal; - BackgroundDecoder decoder(*s, *surf, pal, _vm->_gfx->_palettefx); + + BackgroundInfo* info = new BackgroundInfo; + + BackgroundDecoder decoder(*s, info->bg, pal, _vm->_gfx->_palettefx); decoder.decode(); + info->width = info->bg.w; + info->height = info->bg.h; + byte *p = pal; for (uint i = 0; i < 32; i++) { byte r = *p >> 2; @@ -1205,21 +1198,18 @@ void AmigaDisk_ns::loadBackground(const char *name) { p++; byte b = *p >> 2; p++; - _vm->_gfx->_palette.setEntry(i, r, g, b); - + info->palette.setEntry(i, r, g, b); } free(pal); - _vm->_gfx->setPalette(_vm->_gfx->_palette); - _vm->_gfx->setBackground(surf); delete s; - return; + return info; } -void AmigaDisk_ns::loadMask(const char *name) { +void AmigaDisk_ns::loadMask(const char *name, BackgroundInfo* info) { debugC(5, kDebugDisk, "AmigaDisk_ns::loadMask(%s)", name); char path[PATH_LEN]; @@ -1248,18 +1238,16 @@ void AmigaDisk_ns::loadMask(const char *name) { s->seek(0x126, SEEK_SET); // HACK: skipping IFF/ILBM header should be done by analysis, not magic Graphics::PackBitsReadStream stream(*s); - MaskBuffer *mask = new MaskBuffer; - mask->create(_vm->_screenWidth, _vm->_screenHeight); - stream.read(mask->data, mask->size); - buildMask(mask->data); - _vm->_gfx->setMask(mask); + info->mask.create(info->width, info->height); + stream.read(info->mask.data, info->mask.size); + buildMask(info->mask.data); delete s; return; } -void AmigaDisk_ns::loadPath(const char *name) { +void AmigaDisk_ns::loadPath(const char *name, BackgroundInfo* info) { char path[PATH_LEN]; sprintf(path, "%s.path", name); @@ -1273,49 +1261,49 @@ void AmigaDisk_ns::loadPath(const char *name) { Graphics::PackBitsReadStream stream(*s); - PathBuffer *buf = new PathBuffer; - buf->create(_vm->_screenWidth, _vm->_screenHeight); - stream.read(buf->data, buf->size); - _vm->setPath(buf); + info->path.create(info->width, info->height); + stream.read(info->path.data, info->path.size); delete s; return; } -void AmigaDisk_ns::loadScenery(const char* background, const char* mask) { +BackgroundInfo* AmigaDisk_ns::loadScenery(const char* background, const char* mask, const char* path) { debugC(1, kDebugDisk, "AmigaDisk_ns::loadScenery '%s', '%s'", background, mask); - char path[PATH_LEN]; - sprintf(path, "%s.bkgnd", background); + char filename[PATH_LEN]; + sprintf(filename, "%s.bkgnd", background); - loadBackground(path); + BackgroundInfo* info = loadBackground(filename); if (mask == NULL) { - loadMask(background); - loadPath(background); + loadMask(background, info); + loadPath(background, info); } else { - loadMask(mask); - loadPath(mask); + loadMask(mask, info); + loadPath(mask, info); } - return; + return info; } -void AmigaDisk_ns::loadSlide(const char *name) { +BackgroundInfo* AmigaDisk_ns::loadSlide(const char *name) { debugC(1, kDebugDisk, "AmigaDisk_ns::loadSlide '%s'", name); char path[PATH_LEN]; sprintf(path, "slides/%s", name); Common::SeekableReadStream *s = openArchivedFile(path, false); + + BackgroundInfo *info; if (s) - loadBackground(path); + info = loadBackground(path); else - loadBackground(name); + info = loadBackground(name); delete s; - return; + return info; } Cnv* AmigaDisk_ns::loadFrames(const char* name) { diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 80185ef73d..536ac76583 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -765,21 +765,11 @@ void Gfx::restoreBackground(const Common::Rect& r) { void Gfx::setBackground(Graphics::Surface *surface) { - if (_buffers[kBit2]) { - _buffers[kBit2]->free(); - delete _buffers[kBit2]; - } - _buffers[kBit2] = surface; copyScreen(kBit2, kBitBack); } void Gfx::setMask(MaskBuffer *buffer) { - if (_depthMask) { - _depthMask->free(); - delete _depthMask; - } - _depthMask = buffer; } @@ -882,21 +872,11 @@ Gfx::Gfx(Parallaction* vm) : Gfx::~Gfx() { - if (_depthMask) { - _depthMask->free(); - delete _depthMask; - } - _buffers[kBitFront]->free(); delete _buffers[kBitFront]; _buffers[kBitBack]->free(); delete _buffers[kBitBack]; - if (_buffers[kBit2]) { - _buffers[kBit2]->free(); - delete _buffers[kBit2]; - } - delete _fonts[kFontDialogue]; delete _fonts[kFontLabel]; delete _fonts[kFontMenu]; diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp index 9961a41652..a03c948ae8 100644 --- a/engines/parallaction/location.cpp +++ b/engines/parallaction/location.cpp @@ -235,6 +235,39 @@ void Parallaction::parseWalkNodes(Script& script, WalkNodeList &list) { } +void Parallaction::freeBackground() { + + if (!_backgroundInfo) + return; + + _backgroundInfo->bg.free(); + _backgroundInfo->mask.free(); + _backgroundInfo->path.free(); + delete _backgroundInfo; + + _backgroundInfo = 0; + +} + +void Parallaction::setBackground(const char *background, const char *mask, const char *path) { + + freeBackground(); + + _backgroundInfo = _disk->loadScenery(background, mask, path); + + _gfx->setPalette(_backgroundInfo->palette); + _gfx->_palette.clone(_backgroundInfo->palette); + _gfx->setBackground(&_backgroundInfo->bg); + + if (_backgroundInfo->mask.data) + _gfx->setMask(&_backgroundInfo->mask); + + if (_backgroundInfo->path.data) + setPath(&_backgroundInfo->path); + + return; +} + void Parallaction::switchBackground(const char* background, const char* mask) { // printf("switchBackground(%s)", name); @@ -253,7 +286,7 @@ void Parallaction::switchBackground(const char* background, const char* mask) { _gfx->updateScreen(); } - _disk->loadScenery(background, mask); + setBackground(background, mask, mask); return; } @@ -264,20 +297,21 @@ extern Job *_jEraseLabel; void Parallaction::showSlide(const char *name) { - _disk->loadSlide(name); - _gfx->setPalette(_gfx->_palette); - _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); - - debugC(1, kDebugLocation, "changeLocation: new background set"); + BackgroundInfo *info; - _gfx->setFont(kFontMenu); + info = _disk->loadSlide(name); - _gfx->displayCenteredString(14, _slideText[0]); // displays text on screen - _gfx->updateScreen(); - - waitUntilLeftClick(); + // TODO: avoid using screen buffers for displaying slides. Using a generic buffer + // allows for positioning of graphics as needed by Big Red Adventure. + // The main problem lies with menu, which relies on multiple buffers, mainly because + // it is crappy code. + _gfx->setBackground(&info->bg); + _gfx->setPalette(info->palette); + _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); - debugC(2, kDebugLocation, "changeLocation: intro text shown"); + info->bg.free(); + info->mask.free(); + info->path.free(); return; } @@ -340,6 +374,11 @@ void Parallaction::changeLocation(char *location) { if (list.size() > 1) { if (list[1] == "slide") { showSlide(list[0].c_str()); + _gfx->setFont(kFontMenu); + _gfx->displayCenteredString(14, _slideText[0]); // displays text on screen + _gfx->updateScreen(); + waitUntilLeftClick(); + list.remove_at(0); // removes slide name list.remove_at(0); // removes 'slide' } diff --git a/engines/parallaction/menu.cpp b/engines/parallaction/menu.cpp index ed065b4ae4..9718843bfc 100644 --- a/engines/parallaction/menu.cpp +++ b/engines/parallaction/menu.cpp @@ -128,15 +128,11 @@ void Menu::start() { void Menu::splash() { - _vm->_disk->loadSlide("intro"); - _vm->_gfx->setPalette(_vm->_gfx->_palette); - _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); + _vm->showSlide("intro"); _vm->_gfx->updateScreen(); g_system->delayMillis(2000); - _vm->_disk->loadSlide("minintro"); - _vm->_gfx->setPalette(_vm->_gfx->_palette); - _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); + _vm->showSlide("minintro"); _vm->_gfx->updateScreen(); g_system->delayMillis(2000); @@ -155,8 +151,8 @@ void Menu::newGame() { _vm->_disk->selectArchive("disk1"); - _vm->_disk->loadScenery("test", NULL); - _vm->_gfx->setPalette(_vm->_gfx->_palette); + _vm->setBackground("test", NULL, NULL); + _vm->_gfx->swapBuffers(); _vm->_gfx->displayCenteredString(50, v14[0]); @@ -200,11 +196,7 @@ uint16 Menu::chooseLanguage() { } // user can choose language in dos version - - _vm->_disk->loadSlide("lingua"); - _vm->_gfx->setPalette(_vm->_gfx->_palette); - _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); - + _vm->showSlide("lingua"); _vm->_gfx->displayString(60, 30, "SELECT LANGUAGE", 1); _vm->changeCursor(kCursorArrow); @@ -260,8 +252,7 @@ uint16 Menu::selectGame() { return 0; // can't load a savegame in demo versions } - _vm->_disk->loadSlide("restore"); - _vm->_gfx->setPalette(_vm->_gfx->_palette); + _vm->showSlide("restore"); uint16 _si = 0; uint16 _di = 3; @@ -353,10 +344,7 @@ void Menu::selectCharacter() { _vm->_disk->selectArchive((_vm->getFeatures() & GF_LANG_MULT) ? "disk1" : "disk0"); - _vm->_disk->loadSlide("password"); // loads background into kBitBack buffer - _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); // - - _vm->_gfx->setPalette(_vm->_gfx->_palette); + _vm->showSlide("password"); // loads background into kBitBack buffer while (true) { diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 35e29351ca..51811e3078 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -123,6 +123,8 @@ Parallaction::Parallaction(OSystem *syst) : Parallaction::~Parallaction() { delete _debugger; + freeBackground(); + delete _globalTable; delete _callableNames; @@ -131,11 +133,6 @@ Parallaction::~Parallaction() { delete _zoneTypeNames; delete _zoneFlagNames; - if (_pathBuffer) { - _pathBuffer->free(); - delete _pathBuffer; - } - _animations.remove(&_char._ani); freeLocation(); @@ -169,6 +166,7 @@ int Parallaction::init() { _location._comment = NULL; _location._endComment = NULL; + _backgroundInfo = 0; _screenPathWidth = _screenWidth / 8; _screenSize = _screenWidth * _screenHeight; _screenPathSize = _screenPathWidth * _screenHeight; diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 5c134ec3e7..56f3bf1b86 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -221,7 +221,6 @@ class Menu; class SoundMan; - struct Location { Common::Point _startPosition; @@ -281,6 +280,17 @@ public: int16 lookup(const char* s); }; +struct BackgroundInfo { + uint width; + uint height; + + Graphics::Surface bg; + MaskBuffer mask; + PathBuffer path; + + Palette palette; +}; + class Parallaction : public Engine { friend class Debugger; @@ -333,6 +343,10 @@ public: void sortAnimations(); void freeAnimations(); + void showSlide(const char *name); + void setBackground(const char *background, const char *mask, const char *path); + void freeBackground(); + Table *_globalTable; Table *_objectsNames; Table *_zoneTypeNames; @@ -421,6 +435,8 @@ protected: // data bool _hasLocationSound; char _locationSound[50]; + BackgroundInfo *_backgroundInfo; + protected: // members bool detectGame(void); @@ -441,7 +457,6 @@ protected: // members void doLocationEnterTransition(); void changeLocation(char *location); - void showSlide(const char *name); void resolveLocationForwards(); void switchBackground(const char* background, const char* mask); void freeLocation(); diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index 281f2388e4..872109b48b 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -422,11 +422,6 @@ void jobWalk(void *parm, Job *j) { void Parallaction::setPath(PathBuffer *buffer) { - if (_pathBuffer) { - _pathBuffer->free(); - delete _pathBuffer; - } - _pathBuffer = buffer; } |