[Scummvm-cvs-logs] SF.net SVN: scummvm: [24777] scummvm/trunk/engines/touche
cyx at users.sourceforge.net
cyx at users.sourceforge.net
Thu Nov 23 23:25:05 CET 2006
Revision: 24777
http://svn.sourceforge.net/scummvm/?rev=24777&view=rev
Author: cyx
Date: 2006-11-23 14:25:04 -0800 (Thu, 23 Nov 2006)
Log Message:
-----------
minor cleanup, _spritesTable is no more static
Modified Paths:
--------------
scummvm/trunk/engines/touche/resource.cpp
scummvm/trunk/engines/touche/staticres.cpp
scummvm/trunk/engines/touche/touche.h
Modified: scummvm/trunk/engines/touche/resource.cpp
===================================================================
--- scummvm/trunk/engines/touche/resource.cpp 2006-11-23 22:12:23 UTC (rev 24776)
+++ scummvm/trunk/engines/touche/resource.cpp 2006-11-23 22:25:04 UTC (rev 24777)
@@ -129,9 +129,17 @@
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);
}
}
Modified: scummvm/trunk/engines/touche/staticres.cpp
===================================================================
--- scummvm/trunk/engines/touche/staticres.cpp 2006-11-23 22:12:23 UTC (rev 24776)
+++ scummvm/trunk/engines/touche/staticres.cpp 2006-11-23 22:25:04 UTC (rev 24777)
@@ -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,
Modified: scummvm/trunk/engines/touche/touche.h
===================================================================
--- scummvm/trunk/engines/touche/touche.h 2006-11-23 22:12:23 UTC (rev 24776)
+++ scummvm/trunk/engines/touche/touche.h 2006-11-23 22:25:04 UTC (rev 24777)
@@ -616,6 +616,7 @@
int _newSoundDelay;
int _newSoundPriority;
int _playSoundCounter;
+ bool _speechPlaying;
Audio::SoundHandle _sfxHandle;
Audio::SoundHandle _speechHandle;
@@ -701,12 +702,12 @@
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 @@
Common::Rect _dirtyRectsTable[NUM_DIRTY_RECTS];
int _dirtyRectsTableCount;
- static SpriteData _spritesTable[NUM_SPRITES];
static const uint8 _directionsTable[NUM_DIRECTIONS];
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list