Skip to content

Commit

Permalink
improve registerScriptWrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
irov committed Dec 7, 2023
1 parent 5589aa8 commit 8d86f42
Show file tree
Hide file tree
Showing 18 changed files with 141 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public MengineActivity() {

@Override
protected String[] getLibraries() {
return new String[]{
return new String[] {
"SDL2"
};
}
Expand Down
20 changes: 18 additions & 2 deletions src/Environment/Python/PythonScriptWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,32 @@ namespace Mengine
{
//////////////////////////////////////////////////////////////////////////
template<class T>
void registerScriptWrapping( pybind::kernel_interface * _kernel, const ConstString & _type, const DocumentInterfacePtr & _doc )
void registerScriptWrapping( pybind::kernel_interface * _kernel, const DocumentInterfacePtr & _doc )
{
const ConstString & type = T::getFactorableType();

VOCABULARY_SET( ScriptWrapperInterface, STRINGIZE_STRING_LOCAL( "ScriptWrapping" ), type, Helper::makeFactorableUnique<PythonScriptWrapper<T>>( _doc, _kernel ), _doc );
}
//////////////////////////////////////////////////////////////////////////
template<class T>
void registerScriptWrappingEx( pybind::kernel_interface * _kernel, const ConstString & _type, const DocumentInterfacePtr & _doc )
{
VOCABULARY_SET( ScriptWrapperInterface, STRINGIZE_STRING_LOCAL( "ScriptWrapping" ), _type, Helper::makeFactorableUnique<PythonScriptWrapper<T>>( _doc, _kernel ), _doc );
}
//////////////////////////////////////////////////////////////////////////
MENGINE_INLINE void unregisterScriptWrapping( const ConstString & _type )
MENGINE_INLINE void unregisterScriptWrappingEx( const ConstString & _type )
{
VOCABULARY_REMOVE( STRINGIZE_STRING_LOCAL( "ScriptWrapping" ), _type );
}
//////////////////////////////////////////////////////////////////////////
template<class T>
void unregisterScriptWrapping()
{
const ConstString & type = T::getFactorableType();

VOCABULARY_REMOVE( STRINGIZE_STRING_LOCAL( "ScriptWrapping" ), type );
}
//////////////////////////////////////////////////////////////////////////
}
//////////////////////////////////////////////////////////////////////////
}
8 changes: 4 additions & 4 deletions src/Frameworks/PythonFramework/EngineScriptEmbedding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4653,8 +4653,8 @@ namespace Mengine

m_implement = nodeScriptMethod;

Helper::registerScriptWrapping<PythonValueFollowerLinear>( _kernel, STRINGIZE_STRING_LOCAL( "PythonValueFollowerLinear" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<PythonValueFollowerAcceleration>( _kernel, STRINGIZE_STRING_LOCAL( "PythonValueFollowerAcceleration" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<PythonValueFollowerLinear>( _kernel, MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<PythonValueFollowerAcceleration>( _kernel, MENGINE_DOCUMENT_FACTORABLE );

if( PROTOTYPE_SERVICE()
->addPrototype( STRINGIZE_STRING_LOCAL( "Affector" ), STRINGIZE_STRING_LOCAL( "PythonValueFollowerLinear" ), Helper::makeFactorableUnique<ScriptablePrototypeGenerator<PythonValueFollowerLinear, 32>>( MENGINE_DOCUMENT_FACTORABLE ) ) == false )
Expand Down Expand Up @@ -4726,8 +4726,8 @@ namespace Mengine

m_implement = nullptr;

Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "PythonValueFollowerLinear" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "PythonValueFollowerAcceleration" ) );
Helper::unregisterScriptWrapping<PythonValueFollowerLinear>();
Helper::unregisterScriptWrapping<PythonValueFollowerAcceleration>();

PROTOTYPE_SERVICE()
->removePrototype( STRINGIZE_STRING_LOCAL( "Affector" ), STRINGIZE_STRING_LOCAL( "PythonValueFollowerLinear" ), nullptr );
Expand Down
12 changes: 6 additions & 6 deletions src/Frameworks/PythonFramework/EntityScriptEmbedding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@ namespace Mengine

m_implement = entityScriptMethod;

Helper::registerScriptWrapping<Arrow>( _kernel, STRINGIZE_STRING_LOCAL( "Arrow" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<Entity>( _kernel, STRINGIZE_STRING_LOCAL( "Entity" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<Scene>( _kernel, STRINGIZE_STRING_LOCAL( "Scene" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<Arrow>( _kernel, MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<Entity>( _kernel, MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<Scene>( _kernel, MENGINE_DOCUMENT_FACTORABLE );

return true;
}
Expand All @@ -416,9 +416,9 @@ namespace Mengine

m_implement = nullptr;

Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "Arrow" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "Entity" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "Scene" ) );
Helper::unregisterScriptWrapping<Arrow>();
Helper::unregisterScriptWrapping<Entity>();
Helper::unregisterScriptWrapping<Scene>();
}
//////////////////////////////////////////////////////////////////////////
}
31 changes: 16 additions & 15 deletions src/Frameworks/PythonFramework/NodeScriptEmbedding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,13 +1129,17 @@ namespace Mengine
;
}

Helper::registerScriptWrappingEx<Node>( _kernel, STRINGIZE_STRING_LOCAL( "Node" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrappingEx<Resource>( _kernel, STRINGIZE_STRING_LOCAL( "Resource" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrappingEx<Layer>( _kernel, STRINGIZE_STRING_LOCAL( "Layer" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrappingEx<HotSpot>( _kernel, STRINGIZE_STRING_LOCAL( "HotSpot" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrappingEx<Surface>( _kernel, STRINGIZE_STRING_LOCAL( "Surface" ), MENGINE_DOCUMENT_FACTORABLE );

#define SCRIPT_CLASS_WRAPPING( Class )\
Helper::registerScriptWrapping<Class>(_kernel, STRINGIZE_STRING_LOCAL(#Class), MENGINE_DOCUMENT_FACTORABLE)
Helper::registerScriptWrapping<Class>(_kernel, MENGINE_DOCUMENT_FACTORABLE)

SCRIPT_CLASS_WRAPPING( Node );
SCRIPT_CLASS_WRAPPING( Layer );
SCRIPT_CLASS_WRAPPING( Layer2D );
SCRIPT_CLASS_WRAPPING( HotSpot );

SCRIPT_CLASS_WRAPPING( HotSpotPolygon );
SCRIPT_CLASS_WRAPPING( HotSpotGlobal );
SCRIPT_CLASS_WRAPPING( HotSpotCircle );
Expand Down Expand Up @@ -1171,7 +1175,6 @@ namespace Mengine
SCRIPT_CLASS_WRAPPING( RenderCameraProjection );
SCRIPT_CLASS_WRAPPING( RenderCameraOrthogonalTarget );

SCRIPT_CLASS_WRAPPING( Resource );
SCRIPT_CLASS_WRAPPING( ResourceImage );
SCRIPT_CLASS_WRAPPING( ResourceImageData );
SCRIPT_CLASS_WRAPPING( ResourceImageDefault );
Expand All @@ -1192,7 +1195,6 @@ namespace Mengine
SCRIPT_CLASS_WRAPPING( ResourceTestPick );
SCRIPT_CLASS_WRAPPING( ResourceHIT );

SCRIPT_CLASS_WRAPPING( Surface );
SCRIPT_CLASS_WRAPPING( SurfaceSound );
SCRIPT_CLASS_WRAPPING( SurfaceImage );
SCRIPT_CLASS_WRAPPING( SurfaceImageSequence );
Expand All @@ -1210,13 +1212,16 @@ namespace Mengine
{
MENGINE_UNUSED( _kernel );

Helper::unregisterScriptWrappingEx( STRINGIZE_STRING_LOCAL( "Node" ) );
Helper::unregisterScriptWrappingEx( STRINGIZE_STRING_LOCAL( "Resource" ) );
Helper::unregisterScriptWrappingEx( STRINGIZE_STRING_LOCAL( "Layer" ) );
Helper::unregisterScriptWrappingEx( STRINGIZE_STRING_LOCAL( "HotSpot" ) );
Helper::unregisterScriptWrappingEx( STRINGIZE_STRING_LOCAL( "Surface" ) );

#define UNSCRIPT_CLASS_WRAPPING( Class )\
Helper::unregisterScriptWrapping(STRINGIZE_STRING_LOCAL(#Class))
Helper::unregisterScriptWrapping<Class>()

UNSCRIPT_CLASS_WRAPPING( Node );
UNSCRIPT_CLASS_WRAPPING( Layer );
UNSCRIPT_CLASS_WRAPPING( Layer2D );
UNSCRIPT_CLASS_WRAPPING( HotSpot );
UNSCRIPT_CLASS_WRAPPING( HotSpotPolygon );
UNSCRIPT_CLASS_WRAPPING( HotSpotGlobal );
UNSCRIPT_CLASS_WRAPPING( HotSpotCircle );
Expand Down Expand Up @@ -1244,8 +1249,6 @@ namespace Mengine
UNSCRIPT_CLASS_WRAPPING( ShapeQuadFixed );
UNSCRIPT_CLASS_WRAPPING( ShapeQuadFlex );

UNSCRIPT_CLASS_WRAPPING( Graphics );

UNSCRIPT_CLASS_WRAPPING( Window );

UNSCRIPT_CLASS_WRAPPING( RenderViewport );
Expand All @@ -1254,10 +1257,9 @@ namespace Mengine
UNSCRIPT_CLASS_WRAPPING( RenderCameraProjection );
UNSCRIPT_CLASS_WRAPPING( RenderCameraOrthogonalTarget );

UNSCRIPT_CLASS_WRAPPING( Resource );
UNSCRIPT_CLASS_WRAPPING( ResourceImage );
UNSCRIPT_CLASS_WRAPPING( ResourceImageEmpty );
UNSCRIPT_CLASS_WRAPPING( ResourceImageData );
UNSCRIPT_CLASS_WRAPPING( ResourceImageData );
UNSCRIPT_CLASS_WRAPPING( ResourceImageDefault );
UNSCRIPT_CLASS_WRAPPING( ResourceMusic );
UNSCRIPT_CLASS_WRAPPING( ResourceImageSequence );
Expand All @@ -1275,7 +1277,6 @@ namespace Mengine
UNSCRIPT_CLASS_WRAPPING( ResourceTestPick );
UNSCRIPT_CLASS_WRAPPING( ResourceHIT );

UNSCRIPT_CLASS_WRAPPING( Surface );
UNSCRIPT_CLASS_WRAPPING( SurfaceSound );
UNSCRIPT_CLASS_WRAPPING( SurfaceImage );
UNSCRIPT_CLASS_WRAPPING( SurfaceImageSequence );
Expand Down
2 changes: 1 addition & 1 deletion src/Kernel/RenderCameraOrthogonalTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Mengine
, protected BaseUpdation
, protected BaseTransformation
{
DECLARE_FACTORABLE( RenderCameraOrthogonal );
DECLARE_FACTORABLE( RenderCameraOrthogonalTarget );
DECLARE_VISITABLE( Node );
DECLARE_UPDATABLE();
DECLARE_TRANSFORMABLE();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ namespace Mengine
.def_call( &AndroidNativePythonFunctorBoolean::call )
;

Helper::registerScriptWrapping<AndroidNativePythonFunctorVoid>( _kernel, STRINGIZE_STRING_LOCAL( "AndroidNativePythonFunctorVoid" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<AndroidNativePythonFunctorBoolean>( _kernel, STRINGIZE_STRING_LOCAL( "AndroidNativePythonFunctorBoolean" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<AndroidNativePythonFunctorVoid>( _kernel, MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<AndroidNativePythonFunctorBoolean>( _kernel, MENGINE_DOCUMENT_FACTORABLE );

if( PROTOTYPE_SERVICE()
->addPrototype( STRINGIZE_STRING_LOCAL( "AndroidNativePython" ), STRINGIZE_STRING_LOCAL( "AndroidNativePythonFunctorVoid" ), Helper::makeFactorableUnique<ScriptablePrototypeGenerator<AndroidNativePythonFunctorVoid, 32>>( MENGINE_DOCUMENT_FACTORABLE ) ) == false )
Expand All @@ -145,8 +145,8 @@ namespace Mengine
_kernel->remove_scope<AndroidNativePythonFunctorVoid>();
_kernel->remove_scope<AndroidNativePythonFunctorBoolean>();

Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "AndroidNativePythonFunctorVoid" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "AndroidNativePythonFunctorBoolean" ) );
Helper::unregisterScriptWrapping<AndroidNativePythonFunctorVoid>();
Helper::unregisterScriptWrapping<AndroidNativePythonFunctorBoolean>();

PROTOTYPE_SERVICE()
->removePrototype( STRINGIZE_STRING_LOCAL( "AndroidNativePython" ), STRINGIZE_STRING_LOCAL( "AndroidNativePythonFunctorVoid" ), nullptr );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ namespace Mengine

pybind::def_function( _kernel, "createAreaOfInterestZone", &Detail::s_createAreaOfInterestZone );

Helper::registerScriptWrapping<NodeAreaOfInterestTrigger>( _kernel, STRINGIZE_STRING_LOCAL( "NodeAreaOfInterestTrigger" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<NodeAreaOfInterestActor>( _kernel, STRINGIZE_STRING_LOCAL( "NodeAreaOfInterestActor" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<NodeAreaOfInterestTrigger>( _kernel, MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<NodeAreaOfInterestActor>( _kernel, MENGINE_DOCUMENT_FACTORABLE );

return true;
}
Expand All @@ -139,8 +139,8 @@ namespace Mengine
_kernel->remove_scope<NodeAreaOfInterestTrigger>();
_kernel->remove_scope<NodeAreaOfInterestActor>();

Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "NodeAreaOfInterestTrigger" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "NodeAreaOfInterestActor" ) );
Helper::unregisterScriptWrapping<NodeAreaOfInterestTrigger>();
Helper::unregisterScriptWrapping<NodeAreaOfInterestActor>();
}
}

20 changes: 11 additions & 9 deletions src/Plugins/AstralaxPlugin/AstralaxScriptEmbedding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,25 @@ namespace Mengine
.def_static_native_kernel( "setEventListener", &Detail::s_AstralaxEmitter_setEventListener )
;

Helper::registerScriptWrapping<AstralaxEmitter>( _kernel, STRINGIZE_STRING_LOCAL( "ParticleEmitter2" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<AstralaxEmitter>( _kernel, STRINGIZE_STRING_LOCAL( "AstralaxEmitter" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<ResourceAstralax>( _kernel, STRINGIZE_STRING_LOCAL( "ResourceAstralax" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<ResourceAstralax>( _kernel, STRINGIZE_STRING_LOCAL( "ResourceParticle" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrappingEx<AstralaxEmitter>( _kernel, STRINGIZE_STRING_LOCAL( "ParticleEmitter2" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrappingEx<ResourceAstralax>( _kernel, STRINGIZE_STRING_LOCAL( "ResourceParticle" ), MENGINE_DOCUMENT_FACTORABLE );

Helper::registerScriptWrapping<AstralaxEmitter>( _kernel, MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<ResourceAstralax>( _kernel, MENGINE_DOCUMENT_FACTORABLE );

return true;
}
//////////////////////////////////////////////////////////////////////////
void AstralaxScriptEmbedding::eject( pybind::kernel_interface * _kernel )
{
_kernel->remove_scope<ResourceAstralax>();
_kernel->remove_scope<AstralaxEmitter>();
_kernel->remove_scope<ResourceAstralax>();

Helper::unregisterScriptWrappingEx( STRINGIZE_STRING_LOCAL( "ParticleEmitter2" ) );
Helper::unregisterScriptWrappingEx( STRINGIZE_STRING_LOCAL( "ResourceParticle" ) );

Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "ParticleEmitter2" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "AstralaxEmitter" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "ResourceAstralax" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "ResourceParticle" ) );
Helper::unregisterScriptWrapping<AstralaxEmitter>();
Helper::unregisterScriptWrapping<ResourceAstralax>();
}
//////////////////////////////////////////////////////////////////////////
}
28 changes: 14 additions & 14 deletions src/Plugins/DevToDebugPlugin/DevToDebugScriptEmbedding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,13 @@ namespace Mengine
.def_static_args( "setChangeEvent", &Detail::s_DevToDebugWidgetSelector_setChangeEvent )
;

Helper::registerScriptWrapping<DevToDebugTab>( _kernel, STRINGIZE_STRING_LOCAL( "DevToDebugTab" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugWidgetText>( _kernel, STRINGIZE_STRING_LOCAL( "DevToDebugWidgetText" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugWidgetButton>( _kernel, STRINGIZE_STRING_LOCAL( "DevToDebugWidgetButton" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugWidgetCheckbox>( _kernel, STRINGIZE_STRING_LOCAL( "DevToDebugWidgetCheckbox" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugWidgetCommandLine>( _kernel, STRINGIZE_STRING_LOCAL( "DevToDebugWidgetCommandLine" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugWidgetRadioButton>( _kernel, STRINGIZE_STRING_LOCAL( "DevToDebugWidgetRadioButton" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugWidgetSelector>( _kernel, STRINGIZE_STRING_LOCAL( "DevToDebugWidgetSelector" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugTab>( _kernel, MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugWidgetText>( _kernel, MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugWidgetButton>( _kernel, MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugWidgetCheckbox>( _kernel, MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugWidgetCommandLine>( _kernel, MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugWidgetRadioButton>( _kernel, MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<DevToDebugWidgetSelector>( _kernel, MENGINE_DOCUMENT_FACTORABLE );

return true;
}
Expand All @@ -510,13 +510,13 @@ namespace Mengine
_kernel->remove_from_module( "createDevToDebugWidgetRadioButton", nullptr );
_kernel->remove_from_module( "createDevToDebugWidgetSelector", nullptr );

Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "DevToDebugTab" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "DevToDebugWidgetText" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "DevToDebugWidgetButton" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "DevToDebugWidgetCheckbox" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "DevToDebugWidgetCommandLine" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "DevToDebugWidgetRadioButton" ) );
Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "DevToDebugWidgetSelector" ) );
Helper::unregisterScriptWrapping<DevToDebugTab>();
Helper::unregisterScriptWrapping<DevToDebugWidgetText>();
Helper::unregisterScriptWrapping<DevToDebugWidgetButton>();
Helper::unregisterScriptWrapping<DevToDebugWidgetCheckbox>();
Helper::unregisterScriptWrapping<DevToDebugWidgetCommandLine>();
Helper::unregisterScriptWrapping<DevToDebugWidgetRadioButton>();
Helper::unregisterScriptWrapping<DevToDebugWidgetSelector>();
}
//////////////////////////////////////////////////////////////////////////
}
4 changes: 2 additions & 2 deletions src/Plugins/GraphicsPlugin/GraphicsScriptEmbedding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace Mengine
.def( "clear", &Graphics::clear )
;

Helper::registerScriptWrapping<Graphics>( _kernel, STRINGIZE_STRING_LOCAL( "Graphics" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<Graphics>( _kernel, MENGINE_DOCUMENT_FACTORABLE );

return true;
}
Expand All @@ -64,6 +64,6 @@ namespace Mengine
{
_kernel->remove_scope<Graphics>();

Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "Graphics" ) );
Helper::unregisterScriptWrapping<Graphics>();
}
}
4 changes: 2 additions & 2 deletions src/Plugins/JSONPlugin/JSONScriptEmbedding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace Mengine
.def_static_kernel( "getJSON", &Helper::s_getJSON )
;

Helper::registerScriptWrapping<ResourceJSON>( _kernel, STRINGIZE_STRING_LOCAL( "ResourceJSON" ), MENGINE_DOCUMENT_FACTORABLE );
Helper::registerScriptWrapping<ResourceJSON>( _kernel, MENGINE_DOCUMENT_FACTORABLE );

return true;
}
Expand All @@ -122,7 +122,7 @@ namespace Mengine
{
_kernel->remove_scope<ResourceJSON>();

Helper::unregisterScriptWrapping( STRINGIZE_STRING_LOCAL( "ResourceJSON" ) );
Helper::unregisterScriptWrapping<ResourceJSON>();
}
//////////////////////////////////////////////////////////////////////////
}
Loading

0 comments on commit 8d86f42

Please sign in to comment.