Get Graphics object as parameter too.

svn-id: r10719
This commit is contained in:
David Eriksson 2003-10-10 13:01:14 +00:00
parent c11ebb33b6
commit 1f9497cb1f
2 changed files with 6 additions and 6 deletions

View File

@ -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;
}

View File

@ -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();