mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 04:28:37 +00:00
MACVENTURE: re-use the read stream to reduce heap allocations
This commit is contained in:
parent
37de1b3146
commit
dc5d474160
@ -418,32 +418,29 @@ void Gui::loadBorder(Graphics::MacWindow *target, MVWindowType type, bool active
|
||||
|
||||
if (stream) {
|
||||
target->loadBorder(*stream, activeFlag, offsets);
|
||||
delete stream;
|
||||
}
|
||||
|
||||
if (canHaveTitle) {
|
||||
stream = _engine->getBorderFile(type, active);
|
||||
if (stream) {
|
||||
stream->seek(0);
|
||||
target->loadBorder(*stream, activeFlag | Graphics::kWindowBorderTitle, offsets);
|
||||
delete stream;
|
||||
}
|
||||
}
|
||||
|
||||
if (canHaveScrollbar) {
|
||||
stream = _engine->getBorderFile(type, active);
|
||||
if (stream) {
|
||||
stream->seek(0);
|
||||
target->loadBorder(*stream, activeFlag | Graphics::kWindowBorderScrollbar, offsets);
|
||||
delete stream;
|
||||
}
|
||||
}
|
||||
|
||||
if (canHaveTitle && canHaveScrollbar) {
|
||||
stream = _engine->getBorderFile(type, active);
|
||||
if (stream) {
|
||||
stream->seek(0);
|
||||
target->loadBorder(*stream, activeFlag | Graphics::kWindowBorderTitle | Graphics::kWindowBorderScrollbar, offsets);
|
||||
delete stream;
|
||||
}
|
||||
}
|
||||
delete stream;
|
||||
}
|
||||
|
||||
void Gui::loadGraphics() {
|
||||
|
Loading…
Reference in New Issue
Block a user