added menumode script function; added global variable handling in compiler and interpreter (openmw context still ignores global variables)

This commit is contained in:
Marc Zinnschlag 2010-07-04 12:29:28 +02:00
parent cdcc244fc5
commit f9c1548f80
20 changed files with 418 additions and 11 deletions

View file

@ -243,16 +243,29 @@ namespace Compiler
mFirst = false;
if (mNextOperand)
{
char type = mLocals.getType (name);
{
std::string name2 = toLower (name);
char type = mLocals.getType (name2);
if (type!=' ')
{
Generator::fetchLocal (mCode, type, mLocals.getIndex (name));
Generator::fetchLocal (mCode, type, mLocals.getIndex (name2));
mNextOperand = false;
mOperands.push_back (type=='f' ? 'f' : 'l');
return true;
}
type = getContext().getGlobalType (name2);
if (type!=' ')
{
Generator::fetchGlobal (mCode, mLiterals, type, name2);
mNextOperand = false;
mOperands.push_back (type=='f' ? 'f' : 'l');
return true;
}
}
else
{
@ -281,6 +294,16 @@ namespace Compiler
mNextOperand = false;
return true;
}
else if (keyword==Scanner::K_menumode)
{
mTokenLoc = loc;
Generator::menuMode (mCode);
mOperands.push_back ('l');
mNextOperand = false;
return true;
}
else
{
// check for custom extensions