mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
DIRECTOR: Load Shared Cast from movie directory
This commit is contained in:
parent
f263ed4bb6
commit
693149ee56
@ -35,6 +35,7 @@
|
||||
#include "director/score.h"
|
||||
#include "director/sound.h"
|
||||
#include "director/lingo/lingo.h"
|
||||
#include "director/util.h"
|
||||
|
||||
namespace Director {
|
||||
|
||||
@ -153,6 +154,7 @@ Common::Error DirectorEngine::run() {
|
||||
//_mainArchive->openFile("bookshelf_example.mmm");
|
||||
|
||||
_currentScore = new Score(this);
|
||||
_currentPath = getPath(getEXEName());
|
||||
|
||||
if (getVersion() < 4) {
|
||||
if (getPlatform() == Common::kPlatformWindows) {
|
||||
@ -168,7 +170,7 @@ Common::Error DirectorEngine::run() {
|
||||
_sharedCastFile = "Shared.dir";
|
||||
}
|
||||
|
||||
loadSharedCastsFrom(_sharedCastFile);
|
||||
loadSharedCastsFrom(_currentPath + _sharedCastFile);
|
||||
|
||||
debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\nObtaining score name\n");
|
||||
loadInitialMovie(getEXEName());
|
||||
@ -208,6 +210,10 @@ Common::Error DirectorEngine::run() {
|
||||
|
||||
delete _currentScore;
|
||||
|
||||
_currentPath = getPath(_nextMovie.movie);
|
||||
|
||||
loadSharedCastsFrom(_currentPath + _sharedCastFile);
|
||||
|
||||
Archive *mov = openMainArchive(_nextMovie.movie);
|
||||
|
||||
if (!mov) {
|
||||
|
@ -105,6 +105,7 @@ public:
|
||||
const byte *getPalette() const { return _currentPalette; }
|
||||
uint16 getPaletteColorCount() const { return _currentPaletteLength; }
|
||||
void loadSharedCastsFrom(Common::String filename);
|
||||
void clearSharedCast();
|
||||
void loadPatterns();
|
||||
Graphics::MacPatterns &getPatterns();
|
||||
|
||||
@ -165,6 +166,7 @@ private:
|
||||
Lingo *_lingo;
|
||||
|
||||
Score *_currentScore;
|
||||
Common::String _currentPath;
|
||||
|
||||
Graphics::MacPatterns _director3Patterns;
|
||||
Graphics::MacPatterns _director3QuickDrawPatterns;
|
||||
|
@ -248,7 +248,26 @@ void DirectorEngine::loadMac(const Common::String movie) {
|
||||
}
|
||||
}
|
||||
|
||||
void DirectorEngine::clearSharedCast() {
|
||||
if (!_sharedScore)
|
||||
return;
|
||||
|
||||
delete _sharedScore;
|
||||
|
||||
delete _sharedDIB;
|
||||
delete _sharedSTXT;
|
||||
delete _sharedSound;
|
||||
delete _sharedBMP;
|
||||
}
|
||||
|
||||
void DirectorEngine::loadSharedCastsFrom(Common::String filename) {
|
||||
if (_sharedScore) {
|
||||
if (_sharedScore->_movieArchive->getFileName().equalsIgnoreCase(filename))
|
||||
return;
|
||||
}
|
||||
|
||||
clearSharedCast();
|
||||
|
||||
Archive *shardcst = createArchive();
|
||||
|
||||
debug(0, "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
|
||||
|
@ -142,4 +142,13 @@ Common::String convertPath(Common::String &path) {
|
||||
return res;
|
||||
}
|
||||
|
||||
Common::String getPath(Common::String path) {
|
||||
const char *s;
|
||||
if ((s = strrchr(path.c_str(), '/'))) {
|
||||
return Common::String(path.c_str(), s + 1);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
} // End of namespace Director
|
||||
|
@ -36,6 +36,8 @@ Common::String *toLowercaseMac(Common::String *s);
|
||||
|
||||
Common::String convertPath(Common::String &path);
|
||||
|
||||
Common::String getPath(Common::String path);
|
||||
|
||||
void processQuitEvent(); // events.cpp
|
||||
|
||||
} // End of namespace Director
|
||||
|
Loading…
Reference in New Issue
Block a user