aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2011-01-30 00:02:42 +0000
committerSven Hesse2011-01-30 00:02:42 +0000
commitc498d70dd206432fbceffaa4637b520b936cf3f5 (patch)
tree0c3d1c35a7e25b6c32c430af7a2a4f4fad46b95c /engines/gob
parent0793e5c0a3ac67f667773ec8ae489ad7531bdeb3 (diff)
downloadscummvm-rg350-c498d70dd206432fbceffaa4637b520b936cf3f5.tar.gz
scummvm-rg350-c498d70dd206432fbceffaa4637b520b936cf3f5.tar.bz2
scummvm-rg350-c498d70dd206432fbceffaa4637b520b936cf3f5.zip
GOB: Change SPRITES_COUNT into a const
svn-id: r55645
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/draw.cpp4
-rw-r--r--engines/gob/draw.h15
-rw-r--r--engines/gob/game.cpp2
-rw-r--r--engines/gob/save/savehandler.cpp4
4 files changed, 12 insertions, 13 deletions
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp
index 8b1d00b5d6..d9cd3fd83b 100644
--- a/engines/gob/draw.cpp
+++ b/engines/gob/draw.cpp
@@ -67,7 +67,7 @@ Draw::Draw(GobEngine *vm) : _vm(vm) {
for (int i = 0; i < kFontCount; i++)
_fonts[i] = 0;
- _spritesArray.resize(SPRITES_COUNT);
+ _spritesArray.resize(kSpritesCount);
_invalidatedCount = 0;
for (int i = 0; i < 30; i++) {
@@ -333,7 +333,7 @@ void Draw::initSpriteSurf(int16 index, int16 width, int16 height,
}
void Draw::freeSprite(int16 index) {
- assert(index < SPRITES_COUNT);
+ assert(index < kSpritesCount);
_spritesArray[index].reset();
diff --git a/engines/gob/draw.h b/engines/gob/draw.h
index ff6efdb45b..569f2ce526 100644
--- a/engines/gob/draw.h
+++ b/engines/gob/draw.h
@@ -30,8 +30,6 @@
namespace Gob {
-#define SPRITES_COUNT 100
-
#define RENDERFLAG_NOINVALIDATE 0x0001
#define RENDERFLAG_CAPTUREPUSH 0x0002
#define RENDERFLAG_COLLISIONS 0x0004
@@ -45,12 +43,13 @@ namespace Gob {
class Draw {
public:
- static const int kFontCount = 16;
- static const int kFrontSurface = 20;
- static const int kBackSurface = 21;
- static const int kAnimSurface = 22;
- static const int kCursorSurface = 23;
- static const int kCaptureSurface = 30;
+ static const int kSpritesCount = 100;
+ static const int kFontCount = 16;
+ static const int kFrontSurface = 20;
+ static const int kBackSurface = 21;
+ static const int kAnimSurface = 22;
+ static const int kCursorSurface = 23;
+ static const int kCaptureSurface = 30;
struct FontToSprite {
int8 sprite;
diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp
index 98e4d9b77b..d9d9b93c05 100644
--- a/engines/gob/game.cpp
+++ b/engines/gob/game.cpp
@@ -822,7 +822,7 @@ void Game::start() {
_vm->_draw->closeScreen();
- for (int i = 0; i < SPRITES_COUNT; i++)
+ for (int i = 0; i < Draw::kSpritesCount; i++)
_vm->_draw->freeSprite(i);
_vm->_draw->_scummvmCursor.reset();
}
diff --git a/engines/gob/save/savehandler.cpp b/engines/gob/save/savehandler.cpp
index 83f6e51cc5..e420761df5 100644
--- a/engines/gob/save/savehandler.cpp
+++ b/engines/gob/save/savehandler.cpp
@@ -258,7 +258,7 @@ bool TempSpriteHandler::load(int16 dataVar, int32 size, int32 offset) {
// Index sane?
int index = getIndex(size);
- if ((index < 0) || (index >= SPRITES_COUNT))
+ if ((index < 0) || (index >= Draw::kSpritesCount))
return false;
SurfacePtr sprite = _vm->_draw->_spritesArray[index];
@@ -333,7 +333,7 @@ SurfacePtr TempSpriteHandler::createSprite(int16 dataVar, int32 size, int32 offs
// Index sane?
int index = getIndex(size);
- if ((index < 0) || (index >= SPRITES_COUNT))
+ if ((index < 0) || (index >= Draw::kSpritesCount))
return sprt;
// Sprite exists?