2004-05-30 02:46:58 +02:00
|
|
|
|
|
|
|
#ifndef _SCRIPTGLUE_H_
|
|
|
|
#define _SCRIPTGLUE_H_
|
|
|
|
|
|
|
|
#include "ScriptingHost.h"
|
|
|
|
|
2004-09-05 13:28:59 +02:00
|
|
|
typedef JSBool JSFunc(JSContext* /*context*/, JSObject* /*globalObject*/, unsigned int /*argc*/, jsval* /*argv*/, jsval* /*rval*/);
|
|
|
|
|
2004-07-07 20:27:25 +02:00
|
|
|
// Functions to be called from Javascript:
|
2004-05-30 02:46:58 +02:00
|
|
|
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc WriteLog;
|
2004-07-07 20:27:25 +02:00
|
|
|
|
2004-10-07 21:23:35 +02:00
|
|
|
// Entity
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc getEntityByHandle;
|
|
|
|
JSFunc getEntityTemplate;
|
2005-03-30 18:14:19 +02:00
|
|
|
JSBool GetEntitySet( JSContext* context, JSObject* globalObject, jsval id, jsval* vp );
|
2004-10-07 21:23:35 +02:00
|
|
|
|
2005-01-18 01:46:18 +01:00
|
|
|
// Player
|
2005-03-30 18:14:19 +02:00
|
|
|
JSBool GetPlayerSet( JSContext* context, JSObject* globalObject, jsval id, jsval* vp );
|
|
|
|
JSBool GetLocalPlayer( JSContext* context, JSObject* globalObject, jsval id, jsval* vp );
|
|
|
|
JSBool SetLocalPlayer( JSContext* context, JSObject* globalObject, jsval id, jsval* vp );
|
|
|
|
JSBool GetGaiaPlayer( JSContext* context, JSObject* globalObject, jsval id, jsval* vp );
|
2005-04-22 09:12:55 +02:00
|
|
|
// JSBool SetGaiaPlayer( JSContext* context, JSObject* globalObject, jsval argv, jsval* vp );
|
|
|
|
|
|
|
|
// Events system
|
|
|
|
JSFunc AddGlobalHandler;
|
|
|
|
JSFunc RemoveGlobalHandler;
|
2005-03-29 00:13:47 +02:00
|
|
|
|
|
|
|
// Camera
|
|
|
|
JSFunc setCameraTarget;
|
2005-01-18 01:46:18 +01:00
|
|
|
|
2004-10-07 21:23:35 +02:00
|
|
|
// Timer
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc setTimeout;
|
|
|
|
JSFunc setInterval;
|
|
|
|
JSFunc cancelInterval;
|
2004-06-11 00:24:03 +02:00
|
|
|
|
2004-10-07 21:23:35 +02:00
|
|
|
// Debug
|
|
|
|
JSBool forceGC( JSContext* context, JSObject* globalObject, unsigned int argc, jsval* argv, jsval* rval );
|
|
|
|
|
2004-07-11 18:22:35 +02:00
|
|
|
// Returns the sort-of-global object associated with the current GUI
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc getGUIGlobal;
|
2004-07-11 18:22:35 +02:00
|
|
|
|
2004-07-07 20:27:25 +02:00
|
|
|
// Returns the global object, e.g. for setting global variables.
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc getGlobal;
|
2004-07-09 14:44:12 +02:00
|
|
|
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc setCursor;
|
2004-07-31 14:45:30 +02:00
|
|
|
|
2005-05-18 07:32:09 +02:00
|
|
|
JSBool GetGameView( JSContext* context, JSObject* globalObject, jsval id, jsval* vp );
|
2004-11-11 08:09:32 +01:00
|
|
|
JSFunc GetGameObject;
|
2005-01-19 23:32:25 +01:00
|
|
|
JSFunc createServer;
|
2005-01-17 05:52:02 +01:00
|
|
|
JSFunc createClient;
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc startGame;
|
|
|
|
JSFunc endGame;
|
2004-08-05 15:07:51 +02:00
|
|
|
|
2004-08-21 13:45:01 +02:00
|
|
|
// Replaces the current language (locale) with a new one
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc loadLanguage;
|
|
|
|
|
|
|
|
// Returns the current language's name, in the same form as passed to loadLanguage
|
|
|
|
JSFunc getLanguageID;
|
|
|
|
|
|
|
|
JSFunc getFPS;
|
2005-01-18 01:46:18 +01:00
|
|
|
JSFunc getCursorPosition;
|
2004-11-15 23:30:01 +01:00
|
|
|
JSFunc v3dist;
|
2004-08-21 13:45:01 +02:00
|
|
|
|
2005-05-18 07:32:09 +02:00
|
|
|
JSFunc issueCommand;
|
|
|
|
|
2004-08-30 13:20:59 +02:00
|
|
|
// Returns a string that says when ScriptGlue.cpp was last recompiled
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc buildTime;
|
2004-08-30 13:20:59 +02:00
|
|
|
|
2004-07-09 14:44:12 +02:00
|
|
|
// Tells the main loop to stop looping
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc exitProgram;
|
2004-07-07 20:27:25 +02:00
|
|
|
|
2004-07-15 21:29:56 +02:00
|
|
|
// Crashes.
|
2004-09-05 13:28:59 +02:00
|
|
|
JSFunc crash;
|
2004-07-15 21:29:56 +02:00
|
|
|
|
2005-03-29 22:50:04 +02:00
|
|
|
// Tries to print the amount of remaining video memory.
|
|
|
|
JSFunc vmem;
|
|
|
|
|
|
|
|
// You don't want to use this
|
|
|
|
JSFunc _rewriteMaps;
|
2004-08-14 13:21:29 +02:00
|
|
|
|
2004-06-09 16:02:40 +02:00
|
|
|
extern JSFunctionSpec ScriptFunctionTable[];
|
2004-07-20 21:30:35 +02:00
|
|
|
extern JSPropertySpec ScriptGlobalTable[];
|
2004-05-30 02:46:58 +02:00
|
|
|
|
|
|
|
#endif
|