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

@ -34,6 +34,7 @@
// Forward Refs
class SimObject;
class Semaphore;
class ConsoleValue;
/// Represents a queued event in the sim.
///
@ -82,6 +83,8 @@ public:
virtual void process(SimObject *object)=0;
};
class ConsoleValueRef;
/// Implementation of schedule() function.
///
/// This allows you to set a console function to be
@ -90,7 +93,7 @@ class SimConsoleEvent : public SimEvent
{
protected:
S32 mArgc;
char **mArgv;
ConsoleValueRef *mArgv;
bool mOnObject;
public:
@ -107,7 +110,7 @@ public:
///
/// @see Con::execute(S32 argc, const char *argv[])
/// @see Con::execute(SimObject *object, S32 argc, const char *argv[])
SimConsoleEvent(S32 argc, const char **argv, bool onObject);
SimConsoleEvent(S32 argc, ConsoleValueRef *argv, bool onObject);
~SimConsoleEvent();
virtual void process(SimObject *object);
@ -131,7 +134,7 @@ class SimConsoleThreadExecEvent : public SimConsoleEvent
SimConsoleThreadExecCallback *cb;
public:
SimConsoleThreadExecEvent(S32 argc, const char **argv, bool onObject, SimConsoleThreadExecCallback *callback);
SimConsoleThreadExecEvent(S32 argc, ConsoleValueRef *argv, bool onObject, SimConsoleThreadExecCallback *callback);
virtual void process(SimObject *object);
};