1
0
forked from mirrors/0ad

Single pass player color rendering.

Falls back to a simpler formula when only 2 TMUs are available.
CRenderer is now a JS object called "renderer" for scripting.

This was SVN commit r2891.
This commit is contained in:
prefect
2005-10-10 14:15:28 +00:00
parent 868649d491
commit 6efb1e1c00
8 changed files with 179 additions and 107 deletions
+11
View File
@@ -1047,6 +1047,16 @@ JSBool GetGameView( JSContext* UNUSED(cx), JSObject* UNUSED(obj), jsval UNUSED(i
}
JSBool GetRenderer( JSContext* UNUSED(cx), JSObject* UNUSED(obj), jsval UNUSED(id), jsval* vp )
{
if (CRenderer::IsInitialised())
*vp = OBJECT_TO_JSVAL( g_Renderer.GetScript() );
else
*vp = JSVAL_NULL;
return( JS_TRUE );
}
enum ScriptGlobalTinyIDs
{
GLOBAL_SELECTION,
@@ -1070,6 +1080,7 @@ JSPropertySpec ScriptGlobalTable[] =
{ "localPlayer", 0, PERM , GetLocalPlayer, SetLocalPlayer },
{ "gaiaPlayer" , 0, PERM | CONST, GetGaiaPlayer, 0 },
{ "gameView" , 0, PERM | CONST, GetGameView, 0 },
{ "renderer" , 0, PERM | CONST, GetRenderer, 0 },
// end of table marker
{ 0, 0, 0, 0, 0 },