Beginnings of the "pass everything using a native type wrapper" console code.

- ConsoleValue class is now the base value class.
- ConsoleValueRef is now used to supply function parameters. Values are disposable.
- Script functions return values instead of just strings where possible.
- Variables can be disposable strings
- Bytecode changed

Fix the issues with console method parameters and fields which prevented missions from loading.
This commit is contained in:
James Urquhart 2012-09-23 09:59:48 +01:00
parent 394d87cd54
commit 38c8e52c1d
68 changed files with 1511 additions and 529 deletions

View file

@ -488,9 +488,9 @@ ConsoleMethod(Settings, findFirstValue, const char*, 2, 5, "settingObj.findFirst
if( argc == 3 )
return object->findFirstValue( argv[2] );
else if( argc == 4 )
return object->findFirstValue( argv[2], argv[3] );
return object->findFirstValue( argv[2], dAtob(argv[3]) );
else if( argc == 5 )
return object->findFirstValue( argv[2], argv[3], argv[4] );
return object->findFirstValue( argv[2], dAtob(argv[3]), dAtob(argv[4]) );
else
return "";
}
@ -691,8 +691,8 @@ ConsoleMethod(Settings, remove, void, 3, 4, "settingObj.remove(settingName, incl
}
else if(argc == 4)
{
object->remove( argv[2], argv[3] );
object->remove( argv[2], argv[3] );
object->remove( argv[2], dAtob(argv[3]) );
object->remove( argv[2], dAtob(argv[3]) );
}
}

View file

@ -566,7 +566,7 @@ ConsoleMethod( UndoManager, pushCompound, const char*, 2, 3, "( string name=\"\"
{
String name;
if( argc > 2 )
name = argv[ 2 ];
name = (String)argv[ 2 ];
CompoundUndoAction* action = object->pushCompound( name );
if( !action )