136 friend class ScriptThread;
142 ScriptThread *m_Thread;
152 unsigned char *m_PrevCodePos;
153 unsigned char *m_CodePos;
158 unsigned char m_ThreadState;
171 void error(
const char *format, ...);
173 template<
bool bMethod = false,
bool bReturn = false>
174 void executeCommand(
Listener *listener, op_parmNum_t iParamCount, op_evName_t eventnum);
175 template<
bool bReturn>
177 bool executeGetter(
Listener *listener, op_evName_t eventName);
178 bool executeSetter(
Listener *listener, op_evName_t eventName);
182 void loadTopInternal(
Listener *listener);
184 template<
bool noTop = false>
186 template<
bool noTop = false>
188 void loadStoreTop(
Listener *listener);
195 unsigned char *ProgBuffer();
199 void *
operator new(
size_t size);
200 void operator delete(
void *ptr);
203 ScriptVM(
ScriptClass *scriptClass,
unsigned char *pCodePos, ScriptThread *thread);
209 void LeaveFunction();
215 void NotifyDelete(
void);
216 void Resume(qboolean bForce =
false);
219 str Filename(
void)
const;
220 str Label(
void)
const;
224 bool IsSuspended(
void);
226 int ThreadState(
void);
228 void EventGoto(
Event *ev);
229 bool EventThrow(
Event *ev);
231 bool CanScriptTracePrint(
void);
232 void ScriptTrace1()
const;
233 void ScriptTrace2()
const;
234 const char *GetSourcePos()
const;
237 void jump(
unsigned int offset);
238 void jumpBack(
unsigned int offset);
239 void jumpBool(
unsigned int offset,
bool booleanValue);
240 bool jumpVar(
unsigned int offset,
bool booleanValue);
241 void doJumpIf(
bool booleanValue);
242 bool doJumpVarIf(
bool booleanValue);
244 void fetchOpcodeValue(
void *outValue,
size_t size);
245 void fetchActualOpcodeValue(
void *outValue,
size_t size);
251 fetchOpcodeValue(&value,
sizeof(T));
256 T fetchOpcodeValue(
size_t offset)
259 fetchOpcodeValue(&value,
sizeof(T));
264 T fetchActualOpcodeValue()
267 fetchActualOpcodeValue(&value,
sizeof(T));
271 void execCmdCommon(op_parmNum_t param);
272 void execCmdMethodCommon(op_parmNum_t param);
273 void execMethodCommon(op_parmNum_t param);