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:
twanvl
2006-11-22 20:23:28 +00:00
parent 11a0276232
commit e2544e9d53
22 changed files with 349 additions and 127 deletions
+10 -2
View File
@@ -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(==);
+4
View File
@@ -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
+3
View File
@@ -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