mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
DIRECTOR: Add duplicate lingo command
This commit is contained in:
committed by
Eugene Sandulenko
parent
0d4771c838
commit
5496db64fb
@@ -99,7 +99,10 @@ Cast::~Cast() {
|
||||
|
||||
if (_loadedCast)
|
||||
for (Common::HashMap<int, CastMember *>::iterator it = _loadedCast->begin(); it != _loadedCast->end(); ++it)
|
||||
delete it->_value;
|
||||
if (it->_value) {
|
||||
it->_value = nullptr;
|
||||
delete it->_value;
|
||||
}
|
||||
|
||||
for (Common::HashMap<uint16, CastMemberInfo *>::iterator it = _castsInfo.begin(); it != _castsInfo.end(); ++it)
|
||||
delete it->_value;
|
||||
|
||||
@@ -1738,9 +1738,27 @@ void LB::b_copyToClipBoard(int nargs) {
|
||||
}
|
||||
|
||||
void LB::b_duplicate(int nargs) {
|
||||
g_lingo->printSTUBWithArglist("b_duplicate", nargs);
|
||||
Datum to = g_lingo->pop();
|
||||
Datum from = g_lingo->pop();
|
||||
|
||||
g_lingo->dropStack(nargs);
|
||||
Frame *currentFrame = g_director->getCurrentMovie()->getScore()->_frames[g_director->getCurrentMovie()->getScore()->getCurrentFrame()];
|
||||
CastMember *castMember = g_director->getCurrentMovie()->getCastMember(from.asMemberID());
|
||||
auto channels = g_director->getCurrentMovie()->getScore()->_channels;
|
||||
|
||||
castMember->setModified(true);
|
||||
g_director->getCurrentMovie()->getCast()->_loadedCast->setVal(to.u.i, castMember);
|
||||
|
||||
for (uint16 i = 0; i < currentFrame->_sprites.size(); i++) {
|
||||
if (currentFrame->_sprites[i]->_castId == to.asMemberID())
|
||||
currentFrame->_sprites[i]->setCast(to.asMemberID());
|
||||
}
|
||||
|
||||
for (uint i = 0; i < channels.size(); i++) {
|
||||
if (channels[i]->_sprite->_castId == to.asMemberID()) {
|
||||
channels[i]->_sprite->setCast(to.asMemberID());
|
||||
channels[i]->_dirty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LB::b_editableText(int nargs) {
|
||||
|
||||
Reference in New Issue
Block a user