From b373ab1a38bf4de8da1eda5af4d7abea50e1ea80 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Thu, 23 Nov 2006 22:25:04 +0000 Subject: minor cleanup, _spritesTable is no more static svn-id: r24777 --- engines/touche/resource.cpp | 12 ++++++++++-- engines/touche/staticres.cpp | 10 ---------- engines/touche/touche.h | 4 ++-- 3 files changed, 12 insertions(+), 14 deletions(-) (limited to 'engines') diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp index f0edfcf5f6..3a0f4dad3f 100644 --- a/engines/touche/resource.cpp +++ b/engines/touche/resource.cpp @@ -129,9 +129,17 @@ void ToucheEngine::res_allocateTables() { if (!_iconData) { error("Unable to allocate memory for object data"); } + + static const int initialSpriteSizeTable[NUM_SPRITES] = { + 0x34BC0, 0x1E848, 0x1E848, 0x23A50, + 0x1E848, 0x23940, 0x1E848 + }; + memset(_spritesTable, 0, sizeof(_spritesTable)); for (int i = 0; i < NUM_SPRITES; ++i) { - _spritesTable[i].ptr = (uint8 *)malloc(_spritesTable[i].size); - if (!_spritesTable[i].ptr) { + SpriteData *spr = &_spritesTable[i]; + spr->size = initialSpriteSizeTable[i]; + spr->ptr = (uint8 *)malloc(spr->size); + if (!spr->ptr) { error("Unable to allocate memory for sprite %d", i); } } diff --git a/engines/touche/staticres.cpp b/engines/touche/staticres.cpp index 7e460ffe55..1104ec6b5f 100644 --- a/engines/touche/staticres.cpp +++ b/engines/touche/staticres.cpp @@ -27,16 +27,6 @@ namespace Touche { -SpriteData ToucheEngine::_spritesTable[NUM_SPRITES] = { - { 0x34BC0, 0, 0, 0, 0, 0 }, - { 0x1E848, 0, 0, 0, 0, 0 }, - { 0x1E848, 0, 0, 0, 0, 0 }, - { 0x23A50, 0, 0, 0, 0, 0 }, - { 0x1E848, 0, 0, 0, 0, 0 }, - { 0x23940, 0, 0, 0, 0, 0 }, // room sprite 1 - { 0x1E848, 0, 0, 0, 0, 0 } // room sprite 2 -}; - const uint8 ToucheEngine::_directionsTable[NUM_DIRECTIONS] = { 0x7F, 0x7F, 0x7F, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, diff --git a/engines/touche/touche.h b/engines/touche/touche.h index 9284374b19..b7caa3723c 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -616,6 +616,7 @@ protected: int _newSoundDelay; int _newSoundPriority; int _playSoundCounter; + bool _speechPlaying; Audio::SoundHandle _sfxHandle; Audio::SoundHandle _speechHandle; @@ -701,12 +702,12 @@ protected: uint8 *_mouseData; uint8 *_iconData; + SpriteData _spritesTable[NUM_SPRITES]; SequenceEntry _sequenceEntryTable[NUM_SEQUENCES]; int _currentBitmapWidth; int _currentBitmapHeight; int _currentImageWidth; int _currentImageHeight; - bool _speechPlaying; int _roomWidth; uint8 *_programTextDataPtr; @@ -732,7 +733,6 @@ protected: Common::Rect _dirtyRectsTable[NUM_DIRTY_RECTS]; int _dirtyRectsTableCount; - static SpriteData _spritesTable[NUM_SPRITES]; static const uint8 _directionsTable[NUM_DIRECTIONS]; }; -- cgit v1.2.3