mirror of
https://github.com/libretro/scummvm.git
synced 2025-05-13 09:36:21 +00:00
DIRECTOR: Add initial code for QuickTime video
This commit is contained in:
parent
5bbfea01fe
commit
f675f9be93
@ -87,11 +87,11 @@ Common::Error DirectorEngine::run() {
|
||||
_mainArchive = new RIFFArchive();
|
||||
_mainArchive->openFile("bookshelf_example.mmm");
|
||||
|
||||
Score score(this);
|
||||
debug(0, "Score name %s", score.getMacName().c_str());
|
||||
_currentScore = new Score(this);
|
||||
debug(0, "Score name %s", _currentScore->getMacName().c_str());
|
||||
|
||||
score.loadArchive();
|
||||
score.startLoop();
|
||||
_currentScore->loadArchive();
|
||||
_currentScore->startLoop();
|
||||
|
||||
if (getPlatform() == Common::kPlatformWindows)
|
||||
loadEXE();
|
||||
|
@ -61,6 +61,7 @@ public:
|
||||
DirectorSound *getSoundManager() const { return _soundManager; }
|
||||
Archive *getMainArchive() const { return _mainArchive; }
|
||||
Lingo *getLingo() const { return _lingo; }
|
||||
Score *getCurrentScore() const { return _currentScore; }
|
||||
void setPalette(byte *palette, uint16 count);
|
||||
bool hasFeature(EngineFeature f) const;
|
||||
const byte *getPalette() const { return _currentPalette; }
|
||||
@ -89,6 +90,7 @@ private:
|
||||
byte *_currentPalette;
|
||||
uint16 _currentPaletteLength;
|
||||
Lingo *_lingo;
|
||||
Score *_currentScore;
|
||||
};
|
||||
|
||||
} // End of namespace Director
|
||||
|
@ -4,6 +4,7 @@ MODULE_OBJS = \
|
||||
detection.o \
|
||||
dib.o \
|
||||
director.o \
|
||||
movie.o \
|
||||
resource.o \
|
||||
score.o \
|
||||
sound.o \
|
||||
|
66
engines/director/movie.cpp
Normal file
66
engines/director/movie.cpp
Normal file
@ -0,0 +1,66 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* Additional copyright for this file:
|
||||
* Copyright (C) 1995-1997 Presto Studios, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "video/qt_decoder.h"
|
||||
#include "director/movie.h"
|
||||
#include "director/score.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/system.h"
|
||||
namespace Director {
|
||||
|
||||
Movie::Movie(Common::String fileName, DirectorEngine *vm) {
|
||||
_vm = vm;
|
||||
_currentVideo = new Video::QuickTimeDecoder();
|
||||
if (!_currentVideo->loadFile(fileName)) {
|
||||
warning("Can not open file %s", fileName.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void Movie::play(Common::Point dest) {
|
||||
|
||||
_currentVideo->start();
|
||||
|
||||
uint16 width = _currentVideo->getWidth();
|
||||
uint16 height = _currentVideo->getHeight();
|
||||
|
||||
while (!_currentVideo->endOfVideo()) {
|
||||
if (_currentVideo->needsUpdate()) {
|
||||
const Graphics::Surface *frame = _currentVideo->decodeNextFrame();
|
||||
g_system->copyRectToScreen(frame->getPixels(), frame->pitch, dest.x, dest.y, width, height);
|
||||
g_system->updateScreen();
|
||||
}
|
||||
g_system->delayMillis(10);
|
||||
_vm->getCurrentScore()->processEvents();
|
||||
}
|
||||
}
|
||||
|
||||
void Movie::stop() {
|
||||
_currentVideo->stop();
|
||||
}
|
||||
|
||||
Movie::~Movie() {
|
||||
delete _currentVideo;
|
||||
}
|
||||
|
||||
} //End of namespace Director
|
51
engines/director/movie.h
Normal file
51
engines/director/movie.h
Normal file
@ -0,0 +1,51 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* Additional copyright for this file:
|
||||
* Copyright (C) 1995-1997 Presto Studios, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DIRECTOR_MOVIE_H
|
||||
#define DIRECTOR_MOVIE_H
|
||||
|
||||
#include "common/str.h"
|
||||
#include "common/rect.h"
|
||||
#include "graphics/managed_surface.h"
|
||||
#include "director/director.h"
|
||||
|
||||
namespace Video {
|
||||
class VideoDecoder;
|
||||
}
|
||||
|
||||
namespace Director {
|
||||
|
||||
class Movie {
|
||||
public:
|
||||
Movie(Common::String fileName, DirectorEngine *vm);
|
||||
~Movie();
|
||||
void play(Common::Point dest);
|
||||
void stop();
|
||||
|
||||
private:
|
||||
Video::VideoDecoder *_currentVideo;
|
||||
DirectorEngine *_vm;
|
||||
};
|
||||
} //End of namespace Director
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user