Skip to content

Commit

Permalink
DIRECTOR: Added image dumping at debug
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Aug 21, 2016
1 parent 9f05f78 commit fdd2c5f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions engines/director/director.cpp
Expand Up @@ -52,6 +52,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
_rnd("director") {
DebugMan.addDebugChannel(kDebugLingoExec, "lingoexec", "Lingo Execution");
DebugMan.addDebugChannel(kDebugLingoCompile, "lingocompile", "Lingo Compilation");
DebugMan.addDebugChannel(kDebugLoading, "loading", "Loading");

if (!_mixer->isReady())
error("Sound initialization failed");
Expand Down
7 changes: 7 additions & 0 deletions engines/director/director.h
Expand Up @@ -53,6 +53,13 @@ class Lingo;
class Score;
struct Cast;

enum {
kDebugLingoExec = 1 << 0,
kDebugLingoCompile = 1 << 1,
kDebugLoading = 1 << 2
};


class DirectorEngine : public ::Engine {
public:
DirectorEngine(OSystem *syst, const DirectorGameDescription *gameDesc);
Expand Down
5 changes: 0 additions & 5 deletions engines/director/lingo/lingo.h
Expand Up @@ -35,11 +35,6 @@

namespace Director {

enum {
kDebugLingoExec = 1 << 0,
kDebugLingoCompile = 1 << 1
};

enum LEvent {
kEventPrepareMovie,
kEventStartMovie,
Expand Down
8 changes: 8 additions & 0 deletions engines/director/score.cpp
Expand Up @@ -1340,6 +1340,14 @@ Image::ImageDecoder *Frame::getImageFrom(uint16 spriteId) {

if (_vm->_currentScore->getArchive()->hasResource(MKTAG('B', 'I', 'T', 'D'), imgId)) {
img = new Image::BitmapDecoder();

if (debugChannelSet(8, kDebugLoading)) {
Common::SeekableReadStream *s = _vm->_currentScore->getArchive()->getResource(MKTAG('B', 'I', 'T', 'D'), imgId);
byte buf[1024];
int n = s->read(buf, 1024);
Common::hexdump(buf, n);
}

img->loadStream(*_vm->_currentScore->getArchive()->getResource(MKTAG('B', 'I', 'T', 'D'), imgId));
return img;
}
Expand Down

0 comments on commit fdd2c5f

Please sign in to comment.