mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
implemented resampled text ("high quality")
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@87 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+10
-2
@@ -285,14 +285,22 @@ void instrBinary (BinaryInstructionType i, ScriptValueP& a, const ScriptValueP&
|
||||
a = toScript((String)*a + (String)*b);
|
||||
} else if (at == SCRIPT_DOUBLE || bt == SCRIPT_DOUBLE) {
|
||||
a = toScript((double)*a + (double)*b);
|
||||
} else {
|
||||
} else if (at == SCRIPT_INT || bt == SCRIPT_INT) {
|
||||
a = toScript((int)*a + (int)*b);
|
||||
} else {
|
||||
a = toScript((String)*a + (String)*b);
|
||||
}
|
||||
break;
|
||||
case I_SUB: OPERATOR_DI(-);
|
||||
case I_MUL: OPERATOR_DI(*);
|
||||
case I_DIV: OPERATOR_DI(/);
|
||||
case I_MOD: // fmod
|
||||
case I_MOD:
|
||||
if (at == SCRIPT_DOUBLE || bt == SCRIPT_DOUBLE) {
|
||||
a = toScript(fmod((double)*a, (double)*b));
|
||||
} else {
|
||||
a = toScript((int)*a % (int)*b);
|
||||
}
|
||||
break;
|
||||
case I_AND: OPERATOR_I(&&);
|
||||
case I_OR: OPERATOR_I(||);
|
||||
case I_EQ: OPERATOR_SDI(==);
|
||||
|
||||
@@ -52,6 +52,10 @@ void OptionalScript::initDependencies(Context& ctx, const Dependency& dep) const
|
||||
}
|
||||
}
|
||||
|
||||
Script& OptionalScript::getScript() {
|
||||
if (!script) script = new_intrusive<Script>();
|
||||
return *script;
|
||||
}
|
||||
|
||||
// custom reflection, different for each type
|
||||
|
||||
|
||||
@@ -73,6 +73,9 @@ class OptionalScript {
|
||||
/// Initialize things this script depends on by adding dep to their list of dependent scripts
|
||||
void initDependencies(Context&, const Dependency& dep) const;
|
||||
|
||||
/// Get access to the script, be careful
|
||||
Script& getScript();
|
||||
|
||||
protected:
|
||||
ScriptP script; ///< The script, may be null if there is no script
|
||||
String unparsed; ///< Unparsed script, for writing back to a file
|
||||
|
||||
Reference in New Issue
Block a user