aboutsummaryrefslogtreecommitdiff
path: root/engines/cge
diff options
context:
space:
mode:
authorPaul Gilbert2011-07-10 10:07:35 +1000
committerPaul Gilbert2011-07-10 10:07:35 +1000
commit47b17cd1cec22dfaafe80ce23805587d3a6e4821 (patch)
tree5d384fa34da224c75ab816076e20934a8ad1f196 /engines/cge
parent622dc2d503c247e750d82fb9dea885bcf14881ed (diff)
downloadscummvm-rg350-47b17cd1cec22dfaafe80ce23805587d3a6e4821.tar.gz
scummvm-rg350-47b17cd1cec22dfaafe80ce23805587d3a6e4821.tar.bz2
scummvm-rg350-47b17cd1cec22dfaafe80ce23805587d3a6e4821.zip
CGE: Create Spike class to encapsulate the SP spite array
Diffstat (limited to 'engines/cge')
-rw-r--r--engines/cge/cge.cpp5
-rw-r--r--engines/cge/cge_main.cpp1
-rw-r--r--engines/cge/cge_main.h1
-rw-r--r--engines/cge/text.cpp2
-rw-r--r--engines/cge/vga13h.cpp10
-rw-r--r--engines/cge/vga13h.h6
6 files changed, 17 insertions, 8 deletions
diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp
index 6dbe12d9c6..1df0165e5d 100644
--- a/engines/cge/cge.cpp
+++ b/engines/cge/cge.cpp
@@ -69,9 +69,6 @@ void CGEEngine::setup() {
Talk::init();
// Initialise sprite arrays used by game objects
- SP[0] = new Bitmap("SPK_L", true);
- SP[1] = new Bitmap("SPK_R", true);
- SP[2] = NULL;
LI[0] = new Bitmap("LITE0", true);
LI[1] = new Bitmap("LITE1", true);
LI[2] = new Bitmap("LITE2", true);
@@ -153,8 +150,6 @@ CGEEngine::~CGEEngine() {
delete _infoLine;
delete _cavLight;
delete _debugLine;
- delete SP[0];
- delete SP[1];
delete LI[0];
delete LI[1];
delete LI[2];
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index 4632caabfa..452791b99e 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -75,7 +75,6 @@ InfoLine *_infoLine;
Sprite *_cavLight;
InfoLine *_debugLine;
-BMP_PTR SP[3];
BMP_PTR LI[5];
Snail *_snail;
diff --git a/engines/cge/cge_main.h b/engines/cge/cge_main.h
index d7594c94d9..9706e4c0ec 100644
--- a/engines/cge/cge_main.h
+++ b/engines/cge/cge_main.h
@@ -180,7 +180,6 @@ extern InfoLine *_infoLine;
extern Sprite *_cavLight;
extern InfoLine *_debugLine;
extern BMP_PTR MC[3];
-extern BMP_PTR SP[3];
extern BMP_PTR LI[5];
extern Snail *_snail;
extern Snail *_snail_;
diff --git a/engines/cge/text.cpp b/engines/cge/text.cpp
index c1d32d15cd..63d618b5d5 100644
--- a/engines/cge/text.cpp
+++ b/engines/cge/text.cpp
@@ -183,7 +183,7 @@ void Text::say(const char *txt, Sprite *spr) {
bool east = spr->_flags._east;
int x = (east) ? (spr->_x + spr->_w - 2) : (spr->_x + 2);
int y = spr->_y + 2;
- Sprite *spike = new Sprite(_vm, SP);
+ Sprite *spike = new Spike(_vm);
uint16 sw = spike->_w;
if (east) {
diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp
index 1f12dd8aa9..ce4465a416 100644
--- a/engines/cge/vga13h.cpp
+++ b/engines/cge/vga13h.cpp
@@ -1380,4 +1380,14 @@ CavLight::CavLight(CGEEngine *vm): Sprite(vm, NULL) {
setShapeList(PR);
}
+Spike::Spike(CGEEngine *vm): Sprite(vm, NULL) {
+ // Set the sprite list
+ BMP_PTR *SP = new BMP_PTR[2];
+ SP[0] = new Bitmap("SPK_L", true);
+ SP[1] = new Bitmap("SPK_R", true);
+ SP[2] = NULL;
+
+ setShapeList(SP);
+}
+
} // End of namespace CGE
diff --git a/engines/cge/vga13h.h b/engines/cge/vga13h.h
index 6ee4c6f320..ec8b81fe0b 100644
--- a/engines/cge/vga13h.h
+++ b/engines/cge/vga13h.h
@@ -316,6 +316,12 @@ public:
CavLight(CGEEngine *vm);
};
+class Spike: public Sprite {
+public:
+ Spike(CGEEngine *vm);
+};
+
+
Dac mkDac(uint8 r, uint8 g, uint8 b);
Rgb mkRgb(uint8 r, uint8 g, uint8 b);