29 #ifndef __SCRIPT_PROGRAM_H__
30 #define __SCRIPT_PROGRAM_H__
41 #define MAX_STRING_LEN 128
43 #define MAX_GLOBALS 296608 // in bytes
45 #define MAX_GLOBALS 196608 // in bytes
47 #define MAX_STRINGS 1024
50 #define MAX_FUNCS 3584
52 #define MAX_FUNCS 3072
56 #define MAX_STATEMENTS 131072 // statement_t - 18 bytes last I checked
58 #define MAX_STATEMENTS 81920 // statement_t - 18 bytes last I checked
62 ev_error = -1,
ev_void,
ev_scriptevent,
ev_namespace,
ev_string,
ev_float,
ev_vector,
ev_entity,
ev_field,
ev_function,
ev_virtualfunction,
ev_pointer,
ev_object,
ev_jumpoffset,
ev_argsize,
ev_boolean
71 const char *
Name(
void )
const;
131 void SetName(
const char *newname );
132 const char *
Name(
void )
const;
135 int Size(
void )
const;
181 bool SetType(
const char *typeName );
203 template<
class type, etype_t etype,
class returnType>
214 operator returnType()
const;
217 template<
class type, etype_t etype,
class returnType>
222 template<
class type, etype_t etype,
class returnType>
227 template<
class type, etype_t etype,
class returnType>
232 template<
class type, etype_t etype,
class returnType>
240 template<
class type, etype_t etype,
class returnType>
252 template<
class type, etype_t etype,
class returnType>
259 return (
const returnType )*
data;
262 return (
const returnType )0;
344 const char *
Name(
void )
const;
356 void SetString(
const char *
string,
bool constant );
487 void Startup(
const char *defaultScript );
void SetName(const char *newname)
GLsizei const GLfloat * value
byte * GetVariable(const char *name, etype_t etype) const
idVarDef * GetDefList(const char *name) const
bool CompileText(const char *source, const char *text, bool console)
assert(prefInfo.fullscreenBtn)
idScriptVariable< idStr, ev_string, const char * > idScriptString
idScriptVariable< float, ev_float, float > idScriptFloat
size_t Allocated(void) const
idTypeDef * GetTypeDef(void) const
int DepthOfScope(const idVarDef *otherScope) const
statement_t * AllocStatement(void)
void ReturnString(const char *string)
bool SetType(const char *typeName)
void Save(idSaveGame *savefile) const
const char * GetTypeName(void) const
statement_t & GetStatement(int index)
idVarDef * GetDef(const idTypeDef *type, const char *name, const idVarDef *scope) const
idList< idVarDefName * > varDefNames
void operator=(const idTypeDef &other)
void Disassemble(void) const
idTypeDef(const idTypeDef &other)
bool HasObject(void) const
const idEventDef * eventdef
idTypeDef type_scriptevent
int GetFilenum(const char *name)
void SetPointerType(idTypeDef *type)
void PrintInfo(idFile *file, int instructionPointer) const
void CompileFile(const char *filename)
void SetTypeDef(idTypeDef *_type)
GLuint GLuint GLsizei GLenum type
idCompileError(const char *text)
void AddDef(idVarDef *def)
int NumParameters(void) const
idScriptObject ** objectPtrPtr
const char * Name(void) const
const char * Name(void) const
void RemoveDef(idVarDef *def)
void FinishCompilation(void)
int GetLineNumberForStatement(int index)
const char * GlobalName(void) const
void FreeDef(idVarDef *d, const idVarDef *scope)
size_t Allocated(void) const
const function_t * GetFunction(int funcNumber) const
idStaticList< function_t, MAX_FUNCS > functions
idList< idVarDef * > varDefs
int GetReturnedInteger(void)
GLsizei GLsizei GLcharARB * source
idHashIndex varDefNameHash
void SetString(const char *string, bool constant)
const char * GetFilename(int num)
const char * GetParmName(int parmNumber) const
idTypeDef * TypeDef(void) const
void SetReturnType(idTypeDef *type)
union varEval_s varEval_t
idVarDef def_virtualfunction
void ReturnInteger(int value)
int GetFunctionNumber(const function_t *func) const
const function_t * CompileFunction(const char *functionName, const char *text)
void gameError(const char *fmt,...)
const char * Name(void) const
bool MatchesType(const idTypeDef &matchtype) const
idVarDef * AllocDef(idTypeDef *type, const char *name, idVarDef *scope, bool constant)
idTypeDef * ReturnType(void) const
void AddFunction(const function_t *func)
idList< idTypeDef * > parmTypes
idVarDefName(const char *n)
GLsizei GLsizei GLenum GLenum const GLvoid * data
void SetEntity(const char *name, idEntity *ent)
static void Copynz(char *dest, const char *src, int destsize)
initialized_t initialized
int NumFunctions(void) const
bool MatchesVirtualFunction(const idTypeDef &matchfunc) const
void AddField(idTypeDef *fieldtype, const char *name)
void AddDefToNameList(idVarDef *def, const char *name)
bool IsLinked(void) const
const function_t * GetConstructor(void) const
idTypeDef * GetParmType(int parmNumber) const
void ReturnFloat(float value)
GLubyte GLubyte GLubyte a
idTypeDef * SuperClass(void) const
byte variables[MAX_GLOBALS]
void ReturnEntity(idEntity *ent)
void SetFieldType(idTypeDef *type)
bool Inherits(const idTypeDef *basetype) const
idStaticList< statement_t, MAX_STATEMENTS > statements
idTypeDef * AllocType(idTypeDef &type)
idTypeDef * GetType(idTypeDef &type, bool allocate)
void SetName(const char *name)
idVarDef * FindFreeResultDef(idTypeDef *type, const char *name, idVarDef *scope, const idVarDef *a, const idVarDef *b)
void LinkTo(idScriptObject &obj, const char *name)
idList< const function_t * > functions
unsigned short linenumber
idTypeDef * FindType(const char *name)
void SetValue(const eval_t &value, bool constant)
const char * GetFilenameForStatement(int index)
void DisassembleStatement(idFile *file, int instructionPointer) const
const function_t * GetFunction(const char *name) const
idScriptVariable< idVec3, ev_vector, idVec3 > idScriptVector
idVarDef * GetDefs(void) const
const function_t * GetDestructor(void) const
void AddFunctionParm(idTypeDef *parmtype, const char *name)
idScriptVariable< int, ev_boolean, int > idScriptBool
idVarDef * Next(void) const
void ReturnVector(idVec3 const &vec)
struct statement_s statement_t
idTypeDef type_virtualfunction
idVarDef * returnStringDef
void Startup(const char *defaultScript)
idList< idTypeDef * > types
function_t * FindFunction(const char *name) const
idTypeDef * PointerType(void) const
idTypeDef type_jumpoffset
int GetFunctionIndex(const function_t *func)
int CalculateChecksum(void) const
function_t * GetFunction(int index)
idScriptVariable & operator=(const returnType &value)
idScriptVariable< float, ev_float, int > idScriptInt
function_t & AllocFunction(idVarDef *def)
idVarDef(idTypeDef *typeptr=NULL)
void BeginCompilation(void)
void Restore(idRestoreGame *savefile)
void Save(idSaveGame *savefile) const
const char * Name(void) const
bool Restore(idRestoreGame *savefile)
void SetFunction(function_t *func)
idStaticList< byte, MAX_GLOBALS > variableDefaults
void SetObject(idScriptObject *object)
idTypeDef * FieldType(void) const