Skip to content

Commit

Permalink
PEGASUS: Remove unused movie direct draw mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Hoops committed Oct 8, 2011
1 parent 8a717d2 commit 188d951
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 28 deletions.
26 changes: 6 additions & 20 deletions engines/pegasus/movie.cpp
Expand Up @@ -34,7 +34,6 @@ namespace Pegasus {

Movie::Movie(const tDisplayElementID id) : Animation(id) {
_video = 0;
_directDraw = false;
setScale(600);
}

Expand All @@ -50,7 +49,6 @@ void Movie::releaseMovie() {
_video = 0;
disposeAllCallBacks();
deallocateSurface();
// TODO: Decrease global direct draw counter
}
}

Expand All @@ -75,31 +73,19 @@ void Movie::initFromMovieFile(const Common::String &fileName, bool transparent)
setStop(_video->getDuration() * getScale() / 1000, getScale());
}

void Movie::setDirectDraw(const bool flag) {
_directDraw = flag;
// TODO: Increase/decrease the global direct draw counter
}

void Movie::redrawMovieWorld() {
if (_video) {
const Graphics::Surface *frame = _video->decodeNextFrame();

if (!frame)
return;

if (_directDraw) {
// Copy to the screen
Common::Rect bounds;
getBounds(bounds);
g_system->copyRectToScreen((byte *)frame->pixels, frame->pitch, bounds.left, bounds.top, frame->w, frame->h);
} else {
// Copy to the surface using _movieBox
uint16 width = MIN<int>(frame->w, _movieBox.width());
uint16 height = MIN<int>(frame->h, _movieBox.height());

for (uint16 y = 0; y < height; y++)
memcpy((byte *)_surface->getBasePtr(_movieBox.left, _movieBox.top + y), (const byte *)frame->getBasePtr(0, y), width * frame->format.bytesPerPixel);
}
// Copy to the surface using _movieBox
uint16 width = MIN<int>(frame->w, _movieBox.width());
uint16 height = MIN<int>(frame->h, _movieBox.height());

for (uint16 y = 0; y < height; y++)
memcpy((byte *)_surface->getBasePtr(_movieBox.left, _movieBox.top + y), (const byte *)frame->getBasePtr(0, y), width * frame->format.bytesPerPixel);

triggerRedraw();
}
Expand Down
13 changes: 5 additions & 8 deletions engines/pegasus/movie.h
Expand Up @@ -45,18 +45,16 @@ class Movie : public Animation, public PixelImage {
virtual void initFromMovieFile(const Common::String &fileName, bool transparent = false);

bool isMovieValid() { return _video != 0; }

virtual void releaseMovie();

virtual void draw(const Common::Rect &);
virtual void redrawMovieWorld();

void setDirectDraw(const bool);


virtual void setTime(const TimeValue, const TimeScale = 0);

virtual void setRate(const Common::Rational);

virtual void start();
virtual void stop();
virtual void resume();
Expand All @@ -74,7 +72,6 @@ class Movie : public Animation, public PixelImage {

protected:
Video::SeekableVideoDecoder *_video;
bool _directDraw;
Common::Rect _movieBox;
};

Expand Down

0 comments on commit 188d951

Please sign in to comment.