mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Simplified script VM:
- removed I_RET instruction, return is now implicit at end of script - I_POP is not a binary instruction. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@963 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -198,7 +198,6 @@ void ChoiceStyle::initImage() {
|
||||
// CALL 0
|
||||
// PUSH_CONST nil
|
||||
// OR_ELSE
|
||||
// RET
|
||||
intrusive_ptr<ScriptCustomCollection> lookup(new ScriptCustomCollection());
|
||||
FOR_EACH(ci, choice_images) {
|
||||
lookup->key_value[ci.first] = ci.second.getScriptP();
|
||||
@@ -210,7 +209,6 @@ void ChoiceStyle::initImage() {
|
||||
script.addInstruction(I_CALL, 0);
|
||||
script.addInstruction(I_PUSH_CONST, script_nil);
|
||||
script.addInstruction(I_BINARY, I_OR_ELSE);
|
||||
script.addInstruction(I_RET);
|
||||
}
|
||||
|
||||
int ChoiceStyle::update(Context& ctx) {
|
||||
|
||||
@@ -99,7 +99,6 @@ void Game::initCardListColorScript() {
|
||||
s.addInstruction(I_BINARY, I_MEMBER);
|
||||
s.addInstruction(I_PUSH_CONST, to_script(Color(0,0,0)));
|
||||
s.addInstruction(I_BINARY, I_OR_ELSE);
|
||||
s.addInstruction(I_RET);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,13 +56,11 @@ StatsDimension::StatsDimension(const Field& field)
|
||||
s.addInstruction(I_MEMBER_C, field.name);
|
||||
s.addInstruction(I_CALL, 1);
|
||||
s.addInstruction(I_NOP, SCRIPT_VAR_input);
|
||||
s.addInstruction(I_RET);
|
||||
} else {
|
||||
// initialize script, card.{field_name}
|
||||
Script& s = script.getScript();
|
||||
s.addInstruction(I_GET_VAR, SCRIPT_VAR_card);
|
||||
s.addInstruction(I_MEMBER_C, field.name);
|
||||
s.addInstruction(I_RET);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user