Some cleanup - renamed CBaseEntity to CEntityTemplate, and removed JSInterface_BaseEntity.h and JSInterface_Entity.h (which were unused).

This was SVN commit r4091.
This commit is contained in:
Matei
2006-07-13 03:29:33 +00:00
parent eb467745b3
commit a56ec5bdcd
29 changed files with 174 additions and 240 deletions
+6 -6
View File
@@ -5,7 +5,7 @@
#include "maths/scripting/JSInterface_Vector3D.h"
#include "ps/Parser.h"
#include "ps/Player.h"
#include "simulation/BaseEntity.h"
#include "simulation/EntityTemplate.h"
#include "lib/sysdep/sysdep.h" // finite
#include <cfloat>
@@ -38,20 +38,20 @@ template<> JSObject* ToScript<CPlayer*>( CPlayer** Native )
return( ToScript<CPlayer>( *Native ) );
}
// CBaseEntity*
// CEntityTemplate*
template<> bool ToPrimitive<CBaseEntity*>( JSContext* cx, jsval v, CBaseEntity*& Storage )
template<> bool ToPrimitive<CEntityTemplate*>( JSContext* cx, jsval v, CEntityTemplate*& Storage )
{
if( !JSVAL_IS_OBJECT( v ) || ( v == JSVAL_NULL ) ) return( false );
CBaseEntity* Data = (CBaseEntity*)JS_GetInstancePrivate( cx, JSVAL_TO_OBJECT( v ), &CBaseEntity::JSI_class, NULL );
CEntityTemplate* Data = (CEntityTemplate*)JS_GetInstancePrivate( cx, JSVAL_TO_OBJECT( v ), &CEntityTemplate::JSI_class, NULL );
if( !Data ) return( false );
Storage = Data;
return( true );
}
template<> JSObject* ToScript<CBaseEntity*>( CBaseEntity** Native )
template<> JSObject* ToScript<CEntityTemplate*>( CEntityTemplate** Native )
{
return( ToScript<CBaseEntity>( *Native ) );
return( ToScript<CEntityTemplate>( *Native ) );
}
// CVector3D