29 #include "../../idlib/precompiled.h"
32 #include "../Game_local.h"
112 savefile->
ReadInt( func_index );
113 if ( func_index >= 0 ) {
129 savefile->
ReadInt( func_index );
130 if ( func_index >= 0 ) {
140 if ( funcname.
Length() ) {
190 char funcObject[ 1024 ];
199 if ( scopeDepth == -1 ) {
213 funcName = strstr( funcObject,
"::" );
219 funcName = funcObject;
246 switch( d->
Type() ) {
282 if ( !field || !obj ) {
286 switch ( field->
Type() ) {
288 out =
va(
"%d", *( reinterpret_cast<int *>( &obj->
data[ reg.
ptrOffset ] ) ) );
292 out =
va(
"%g", *( reinterpret_cast<float *>( &obj->
data[ reg.
ptrOffset ] ) ) );
411 for( i = top; i >= 0; i-- ) {
432 va_start( argptr, fmt );
457 va_start( argptr, fmt );
541 Push( self->entityNumber + 1 );
567 Error(
"call stack overflow" );
582 Error(
"NULL function" );
604 Error(
"EnterFuncton: locals stack overflow\n" );
628 Error(
"prog stack underflow" );
633 switch( returnDef->
Type() ) {
694 Error(
"NULL function" );
744 for( j = 0, i = 0, pos =
type_object.Size(); ( pos < argsize ) || ( format[ i ] != 0 ); i++ ) {
745 switch( format[ i ] ) {
753 ( *(
float * )&data[ i ] ) = *var.
floatPtr;
762 ( *(
const char ** )&data[ i ] ) = (
char * )&
localstack[ start + pos ];
768 if ( !( *(
idEntity ** )&data[ i ] ) ) {
769 Warning(
"Entity not found for event '%s'. Terminating thread.", evdef->
GetName() );
782 Error(
"trace type not supported from script for '%s' event.", evdef->
GetName() );
786 Error(
"Invalid arg format string for '%s' event.", evdef->
GetName() );
814 Error(
"idInterpreter::BeginMultiFrameEvent called with wrong entity" );
818 Error(
"idInterpreter::BeginMultiFrameEvent called with wrong event" );
834 Error(
"idInterpreter::EndMultiFrameEvent called with wrong event" );
865 Error(
"NULL function" );
874 for( j = 0, i = 0, pos = 0; ( pos < argsize ) || ( format[ i ] != 0 ); i++ ) {
875 switch( format[ i ] ) {
878 *(
int * )&data[ i ] =
int( *source.
floatPtr );
883 *(
float * )&data[ i ] = *source.
floatPtr;
892 *(
const char ** )&data[
i ] = (
char * )&
localstack[ start + pos ];
899 Warning(
"Entity not found for event '%s'. Terminating thread.", evdef->
GetName() );
912 Error(
"trace type not supported from script for '%s' event.", evdef->
GetName() );
916 Error(
"Invalid arg format string for '%s' event.", evdef->
GetName() );
964 Error(
"runaway loop error" );
1030 if ( *var_a.
intPtr == 0 ) {
1037 if ( *var_a.
intPtr != 0 ) {
1777 floatVal = *var_a.
intPtr;
1778 Push( *reinterpret_cast<int *>( &floatVal ) );
1829 Error(
"Bad opcode %i", st->
op );
static const float INFINITY
const function_t * GetCurrentFunction(void) const
byte localstack[LOCALSTACK_SIZE]
void WriteString(const char *string)
assert(prefInfo.fullscreenBtn)
int Cmp(const char *text) const
void WriteObject(const idClass *obj)
idTypeDef * GetTypeDef(void) const
void Printf(const char *fmt,...) const id_attribute((format(printf
void ReturnString(const char *string)
GLenum GLsizei GLenum format
statement_t & GetStatement(int index)
idVarDef * GetDef(const idTypeDef *type, const char *name, const idVarDef *scope) const
#define D_EVENT_ENTITY_NULL
void Set(const float x, const float y, const float z)
const char * GetThreadName(void)
void Write(const void *buffer, int len)
const idEventDef * eventdef
idVarDef def_object & type_object
void SetString(idVarDef *def, const char *from)
bool RespondsTo(const idEventDef &ev) const
void PushString(const char *string)
void EndMultiFrameEvent(idEntity *ent, const idEventDef *event)
void ReadBool(bool &value)
int CurrentLine(void) const
const char * Name(void) const
bool MultiFrameEventInProgress(void) const
void SetThreadName(const char *name)
void WriteBool(const bool value)
idCVar developer("developer","0", CVAR_GAME|CVAR_BOOL,"")
int GetLineNumberForStatement(int index)
const function_t * GetFunction(int funcNumber) const
void AppendString(idVarDef *def, const char *from)
GLsizei GLsizei GLcharARB * source
bool BeginMultiFrameEvent(idEntity *ent, const idEventDef *event)
void void Warning(const char *fmt,...) const id_attribute((format(printf
const char * GetFilename(int num)
const idEventDef * multiFrameEvent
const char * FloatToString(float value)
static const idEventDef * FindEvent(const char *name)
const char * GetName(void) const
idTypeDef * TypeDef(void) const
varEval_t GetVariable(idVarDef *def)
void ReturnInteger(int value)
void void Read(void *buffer, int len)
void CallEvent(const function_t *func, int argsize)
void ThreadCall(idInterpreter *source, const function_t *func, int args)
GLsizei GLsizei GLenum GLenum const GLvoid * data
void Error(const char *fmt,...) const id_attribute((format(printf
static void Copynz(char *dest, const char *src, int destsize)
idTypeDef * GetParmType(int parmNumber) const
void ReturnFloat(float value)
bool GetRegisterValue(const char *name, idStr &out, int scopeDepth)
void Save(idSaveGame *savefile) const
void ReturnEntity(idEntity *ent)
GLdouble GLdouble GLdouble top
bool Inherits(const idTypeDef *basetype) const
const char * ToString(int precision=2) const
void WriteInt(const int value)
const function_t * currentFunction
const char * GetString(idVarDef *def)
idThread * GetThread(void) const
idScriptObject * GetScriptObject(int entnum) const
unsigned short linenumber
const char * GetFilenameForStatement(int index)
void CallSysEvent(const function_t *func, int argsize)
void EnterObjectFunction(idEntity *self, const function_t *func, bool clearStack)
void EnterFunction(const function_t *func, bool clearStack)
const char * GetArgFormat(void) const
void void void DisplayInfo(void) const
void NextInstruction(int position)
void ReturnVector(idVec3 const &vec)
int vsprintf(idStr &string, const char *fmt, va_list argptr)
bool ProcessEventArgPtr(const idEventDef *ev, int *data)
const char * c_str(void) const
void StackTrace(void) const
void SetThread(idThread *pThread)
int GetCallstackDepth(void) const
const char * CurrentFile(void) const
idEntity * GetEntity(int entnum) const
int GetFunctionIndex(const function_t *func)
char GetReturnType(void) const
function_t * GetFunction(int index)
char * va(const char *fmt,...)
void LeaveFunction(idVarDef *returnDef)
virtual void Error(const char *fmt,...) id_attribute((format(printf
void Restore(idRestoreGame *savefile)
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
void ReadString(idStr &string)
const prstack_t * GetCallstack(void) const
void PopParms(int numParms)
void ReadObject(idClass *&obj)
idTypeDef * FieldType(void) const
prstack_t callStack[MAX_STACK_DEPTH]