From 9576e415e2779011ecfca77a2f9642c011a928a2 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 20 Jul 2011 14:27:36 +0200 Subject: CGE: Clean up Square class --- engines/cge/cge_main.cpp | 16 +++------------- engines/cge/cge_main.h | 8 +++++++- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp index 4b1b0b695e..3ebec73030 100644 --- a/engines/cge/cge_main.cpp +++ b/engines/cge/cge_main.cpp @@ -449,17 +449,7 @@ void CGEEngine::loadMapping() { } } -class SQUARE : public Sprite { -public: - SQUARE(CGEEngine *vm); - virtual void touch(uint16 mask, int x, int y); -private: - CGEEngine *_vm; -}; - - -SQUARE::SQUARE(CGEEngine *vm) - : Sprite(vm, NULL), _vm(vm) { +Square::Square(CGEEngine *vm) : Sprite(vm, NULL), _vm(vm) { _flags._kill = true; _flags._bDel = false; @@ -470,7 +460,7 @@ SQUARE::SQUARE(CGEEngine *vm) } -void SQUARE::touch(uint16 mask, int x, int y) { +void Square::touch(uint16 mask, int x, int y) { Sprite::touch(mask, x, y); if (mask & L_UP) { XZ(_x + x, _y + y).cell() = 0; @@ -482,7 +472,7 @@ void SQUARE::touch(uint16 mask, int x, int y) { void CGEEngine::setMapBrick(int x, int z) { debugC(1, kCGEDebugEngine, "CGEEngine::setMapBrick(%d, %d)", x, z); - SQUARE *s = new SQUARE(this); + Square *s = new Square(this); if (s) { static char n[] = "00:00"; s->gotoxy(x * MAP_XGRID, MAP_TOP + z * MAP_ZGRID); diff --git a/engines/cge/cge_main.h b/engines/cge/cge_main.h index 40e6d88668..103c718759 100644 --- a/engines/cge/cge_main.h +++ b/engines/cge/cge_main.h @@ -103,7 +103,6 @@ namespace CGE { #define HEROFUN0 (40 * 12) #define HEROFUN1 ( 2 * 12) #define PAIN (_vm->_flag[0]) -//#define FINIS (_vm->_flag[3]) class System : public Sprite { @@ -121,6 +120,13 @@ private: CGEEngine *_vm; }; +class Square : public Sprite { +public: + Square(CGEEngine *vm); + virtual void touch(uint16 mask, int x, int y); +private: + CGEEngine *_vm; +}; extern Vga *_vga; extern Heart *_heart; -- cgit v1.2.3