mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
ASYLUM: clean up destructors
This commit is contained in:
parent
ca1d780730
commit
c81c046450
@ -219,9 +219,6 @@ Console::Console(AsylumEngine *engine) : _vm(engine) {
|
||||
|
||||
Console::~Console() {
|
||||
DebugMan.clearAllDebugChannels();
|
||||
|
||||
// Zero passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -38,11 +38,6 @@ namespace Asylum {
|
||||
Puzzle::Puzzle(AsylumEngine *engine): _vm(engine) {
|
||||
}
|
||||
|
||||
Puzzle::~Puzzle() {
|
||||
// Zero passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
void Puzzle::saveLoadWithSerializer(Common::Serializer &) {
|
||||
// By default, we do not save any data
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ struct GraphicQueueItem;
|
||||
class Puzzle : public EventHandler, public Common::Serializable {
|
||||
public:
|
||||
Puzzle(AsylumEngine *engine);
|
||||
virtual ~Puzzle();
|
||||
virtual ~Puzzle() {};
|
||||
|
||||
bool handleEvent(const AsylumEvent &evt);
|
||||
|
||||
|
@ -50,9 +50,6 @@ Puzzles::~Puzzles() {
|
||||
// Cleanup puzzles
|
||||
for (uint i = 0; i < ARRAYSIZE(_puzzles); i++)
|
||||
delete _puzzles[i];
|
||||
|
||||
// Zero passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
void Puzzles::reset() {
|
||||
|
@ -113,13 +113,6 @@ Actor::Actor(AsylumEngine *engine, ActorIndex index) : _vm(engine), _index(index
|
||||
_frameNumber = 0;
|
||||
}
|
||||
|
||||
Actor::~Actor() {
|
||||
// TODO destroy data
|
||||
|
||||
// Zero passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// Loading
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -85,7 +85,7 @@ struct ActorData : public Common::Serializable {
|
||||
class Actor : public Common::Serializable {
|
||||
public:
|
||||
Actor(AsylumEngine *engine, ActorIndex index);
|
||||
virtual ~Actor();
|
||||
virtual ~Actor() {};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Public variables & accessors
|
||||
|
@ -105,14 +105,6 @@ Encounter::Encounter(AsylumEngine *engine) : _vm(engine),
|
||||
load();
|
||||
}
|
||||
|
||||
Encounter::~Encounter() {
|
||||
// Pointing to existing data
|
||||
_item = NULL;
|
||||
|
||||
// Zero-out passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Data
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
class Encounter : public EventHandler {
|
||||
public:
|
||||
Encounter(AsylumEngine *engine);
|
||||
virtual ~Encounter();
|
||||
virtual ~Encounter() {};
|
||||
|
||||
void run(int32 encounterIndex, ObjectId objectId1, ObjectId objectId2, ActorIndex actorIndex);
|
||||
|
||||
|
@ -47,11 +47,6 @@ Object::Object(AsylumEngine *engine) : x(0), y(0), flags(0), actionType(0),
|
||||
memset(&_randomResourceIds, 0, sizeof(_randomResourceIds));
|
||||
}
|
||||
|
||||
Object::~Object() {
|
||||
// Zero passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// Loading & destroying
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
@ -39,7 +39,7 @@ class AsylumEngine;
|
||||
class Object : public Common::Serializable {
|
||||
public:
|
||||
Object(AsylumEngine *engine);
|
||||
virtual ~Object();
|
||||
virtual ~Object() {};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Public variables & accessors
|
||||
|
@ -218,12 +218,6 @@ ScriptManager::~ScriptManager() {
|
||||
|
||||
_scripts.clear();
|
||||
_queue.reset();
|
||||
|
||||
_currentScript = NULL;
|
||||
_currentQueueEntry = NULL;
|
||||
|
||||
// Zero-out passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
void ScriptManager::load(Common::SeekableReadStream *stream) {
|
||||
|
@ -71,12 +71,6 @@ Special::Special(AsylumEngine *engine) : _vm(engine) {
|
||||
_chapter5Counter = 0;
|
||||
}
|
||||
|
||||
Special::~Special() {
|
||||
// Zero-out passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
|
||||
void Special::run(Object* object, ActorIndex index) {
|
||||
switch (getWorld()->chapter) {
|
||||
default:
|
||||
|
@ -37,7 +37,7 @@ class Special {
|
||||
public:
|
||||
|
||||
Special(AsylumEngine *engine);
|
||||
virtual ~Special();
|
||||
~Special() {};
|
||||
|
||||
void run(Object* object, ActorIndex index);
|
||||
|
||||
|
@ -99,9 +99,6 @@ WorldStats::~WorldStats() {
|
||||
CLEAR_ARRAY(Object, objects);
|
||||
CLEAR_ARRAY(Actor, actors);
|
||||
CLEAR_ARRAY(ActionArea, actions);
|
||||
|
||||
// Zero-out passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
// Load necessary World Stats content
|
||||
|
@ -40,9 +40,6 @@ Cursor::Cursor(AsylumEngine *engine) : _vm(engine),
|
||||
|
||||
Cursor::~Cursor() {
|
||||
delete _cursorRes;
|
||||
|
||||
// Zero-out passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
void Cursor::hide() const {
|
||||
|
@ -37,9 +37,6 @@ GraphicResource::GraphicResource(AsylumEngine *engine, ResourceId id) : _vm(engi
|
||||
|
||||
GraphicResource::~GraphicResource() {
|
||||
clear();
|
||||
|
||||
// Zero passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
bool GraphicResource::load(ResourceId id) {
|
||||
|
@ -59,11 +59,6 @@ Savegame::Savegame(AsylumEngine *engine) : _vm(engine), _index(0), _valid(false)
|
||||
memset(&_savegameToScene, 0, sizeof(_savegameToScene));
|
||||
}
|
||||
|
||||
Savegame::~Savegame() {
|
||||
// Zero passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
bool Savegame::hasSavegames() const {
|
||||
for (uint i = 0; i < SAVEGAME_COUNT; i++)
|
||||
if (isSavegamePresent(getFilename(i)))
|
||||
|
@ -38,7 +38,7 @@ class AsylumEngine;
|
||||
class Savegame {
|
||||
public:
|
||||
Savegame(AsylumEngine *engine);
|
||||
~Savegame();
|
||||
~Savegame() {};
|
||||
|
||||
/**
|
||||
* Checks if saved games are present
|
||||
|
@ -66,12 +66,6 @@ Screen::~Screen() {
|
||||
_backBuffer.free();
|
||||
|
||||
clearTransTables();
|
||||
|
||||
_transTableBuffer = NULL;
|
||||
_transTable = NULL;
|
||||
|
||||
// Zero-out passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -44,10 +44,6 @@ Sound::Sound(AsylumEngine *engine, Audio::Mixer *mixer) : _vm(engine), _mixer(mi
|
||||
|
||||
Sound::~Sound() {
|
||||
cleanupQueue();
|
||||
|
||||
// Zero-out passed pointers
|
||||
_vm = NULL;
|
||||
_mixer = NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -40,15 +40,6 @@ Speech::Speech(AsylumEngine *engine): _vm(engine), _textData(0), _textDataPos(0)
|
||||
_textResourceId = kResourceNone;
|
||||
}
|
||||
|
||||
Speech::~Speech() {
|
||||
// Text resource data is disposed as part of the resource manager
|
||||
_textData = 0;
|
||||
_textDataPos = 0;
|
||||
|
||||
// Zero-out passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
ResourceId Speech::play(ResourceId soundResourceId, ResourceId textResourceId) {
|
||||
if (soundResourceId)
|
||||
if (getSound()->isPlaying(_soundResourceId))
|
||||
|
@ -34,7 +34,7 @@ class AsylumEngine;
|
||||
class Speech {
|
||||
public:
|
||||
Speech(AsylumEngine *engine);
|
||||
virtual ~Speech();
|
||||
~Speech() {};
|
||||
|
||||
/**
|
||||
* Play speech
|
||||
|
@ -40,9 +40,6 @@ Text::Text(AsylumEngine *engine) : _vm(engine) {
|
||||
|
||||
Text::~Text() {
|
||||
delete _fontResource;
|
||||
|
||||
// Zero-out passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
ResourceId Text::loadFont(ResourceId resourceId) {
|
||||
|
@ -73,11 +73,6 @@ Menu::Menu(AsylumEngine *vm): _vm(vm) {
|
||||
_prefixWidth = 0;
|
||||
}
|
||||
|
||||
Menu::~Menu() {
|
||||
// Zero-out passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Loading and setup
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -38,7 +38,7 @@ class Text;
|
||||
class Menu : public EventHandler {
|
||||
public:
|
||||
Menu(AsylumEngine *vm);
|
||||
~Menu();
|
||||
virtual ~Menu() {};
|
||||
|
||||
/**
|
||||
* Shows the menu
|
||||
|
@ -84,9 +84,6 @@ Scene::~Scene() {
|
||||
|
||||
delete _polygons;
|
||||
delete _ws;
|
||||
|
||||
// Zero passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
void Scene::enter(ResourcePackId packId) {
|
||||
|
@ -39,11 +39,6 @@ SceneTitle::SceneTitle(AsylumEngine *engine): _vm(engine),
|
||||
_start(0), _done(false), _spinnerFrameIndex(0), _spinnerProgress(0), _spinnerFrameCount(0) {
|
||||
}
|
||||
|
||||
SceneTitle::~SceneTitle() {
|
||||
// Zero passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
void SceneTitle::load() {
|
||||
_start = _vm->getTick();
|
||||
|
||||
|
@ -33,7 +33,7 @@ class GraphicResource;
|
||||
class SceneTitle {
|
||||
public:
|
||||
SceneTitle(AsylumEngine *engine);
|
||||
~SceneTitle();
|
||||
~SceneTitle() {};
|
||||
|
||||
void load();
|
||||
|
||||
|
@ -43,9 +43,6 @@ VideoPlayer::VideoPlayer(AsylumEngine *engine, Audio::Mixer *mixer) : _vm(engine
|
||||
|
||||
VideoPlayer::~VideoPlayer() {
|
||||
delete _smkDecoder;
|
||||
|
||||
// Zero-out passed pointers
|
||||
_vm = NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user