diff options
Diffstat (limited to 'engines/hugo/intro.cpp')
-rw-r--r-- | engines/hugo/intro.cpp | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/engines/hugo/intro.cpp b/engines/hugo/intro.cpp index 505e356049..26ef65edf8 100644 --- a/engines/hugo/intro.cpp +++ b/engines/hugo/intro.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -39,9 +39,10 @@ namespace Hugo { -IntroHandler::IntroHandler(HugoEngine *vm) : _vm(vm), _introX(0), _introY(0) { +IntroHandler::IntroHandler(HugoEngine *vm) : _vm(vm) { _introXSize = 0; _introTicks = 0; + _introX = _introY = nullptr; } IntroHandler::~IntroHandler() { @@ -74,6 +75,7 @@ void IntroHandler::loadIntroData(Common::SeekableReadStream &in) { void IntroHandler::freeIntroData() { free(_introX); free(_introY); + _introX = _introY = nullptr; } intro_v1d::intro_v1d(HugoEngine *vm) : IntroHandler(vm) { @@ -89,11 +91,7 @@ void intro_v1d::preNewGame() { void intro_v1d::introInit() { _introState = 0; _introTicks = 0; - _surf.w = 320; - _surf.h = 200; - _surf.pixels = _vm->_screen->getFrontBuffer(); - _surf.pitch = 320; - _surf.format = Graphics::PixelFormat::createFormatCLUT8(); + _surf.init(320, 200, 320, _vm->_screen->getFrontBuffer(), Graphics::PixelFormat::createFormatCLUT8()); _vm->_screen->displayList(kDisplayInit); } @@ -243,11 +241,7 @@ void intro_v2d::preNewGame() { void intro_v2d::introInit() { _vm->_screen->displayList(kDisplayInit); _vm->_file->readBackground(_vm->_numScreens - 1); // display splash screen - _surf.w = 320; - _surf.h = 200; - _surf.pixels = _vm->_screen->getFrontBuffer(); - _surf.pitch = 320; - _surf.format = Graphics::PixelFormat::createFormatCLUT8(); + _surf.init(320, 200, 320, _vm->_screen->getFrontBuffer(), Graphics::PixelFormat::createFormatCLUT8()); char buffer[128]; @@ -289,11 +283,7 @@ void intro_v3d::preNewGame() { void intro_v3d::introInit() { _vm->_screen->displayList(kDisplayInit); _vm->_file->readBackground(_vm->_numScreens - 1); // display splash screen - _surf.w = 320; - _surf.h = 200; - _surf.pixels = _vm->_screen->getFrontBuffer(); - _surf.pitch = 320; - _surf.format = Graphics::PixelFormat::createFormatCLUT8(); + _surf.init(320, 200, 320, _vm->_screen->getFrontBuffer(), Graphics::PixelFormat::createFormatCLUT8()); char buffer[128]; if (_vm->_boot._registered) |