From 1f9497cb1fbfcc8c3ffd412ce450144983b2452d Mon Sep 17 00:00:00 2001 From: David Eriksson Date: Fri, 10 Oct 2003 13:01:14 +0000 Subject: Get Graphics object as parameter too. svn-id: r10719 --- queen/cutaway.cpp | 10 ++++------ queen/cutaway.h | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index 248acb952a..a3c3914d3d 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -57,27 +57,25 @@ namespace Queen { void Cutaway::run( const char *filename, char *nextFilename, + Graphics *graphics, Logic *logic, Resource *resource) { - Cutaway *cutaway = new Cutaway(filename, logic, resource); + Cutaway *cutaway = new Cutaway(filename, graphics,logic, resource); cutaway->run(nextFilename); delete cutaway; } Cutaway::Cutaway( const char *filename, + Graphics *graphics, Logic *logic, Resource *resource) -: _logic(logic), _resource(resource), _quit(false), _lastSong(0), _songBeforeComic(0) { - // XXX should not create this object ourselves - _graphics = new Graphics(resource); +: _graphics(graphics), _logic(logic), _resource(resource), _quit(false), _lastSong(0), _songBeforeComic(0) { memset(&_bankNames, 0, sizeof(_bankNames)); load(filename); } Cutaway::~Cutaway() { - // XXX only delete this if we created it - delete _graphics; delete[] _fileData; } diff --git a/queen/cutaway.h b/queen/cutaway.h index 2718cd773a..81e5100591 100644 --- a/queen/cutaway.h +++ b/queen/cutaway.h @@ -36,6 +36,7 @@ class Cutaway { static void run( const char *filename, char *nextFilename, + Graphics *graphics, Logic *logic, Resource *resource); private: @@ -181,6 +182,7 @@ class Cutaway { Cutaway( const char *filename, + Graphics *graphics, Logic *logic, Resource *resource); ~Cutaway(); -- cgit v1.2.3