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