From 454e7b8ac6adc76a24d5a6e2ea00f75628c038df Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 26 Jun 2016 11:35:16 +0200 Subject: [PATCH] small init changes --- src/matfx.cpp | 31 ++++++++++++++++++++++++------- src/skin.cpp | 31 ++++++++++++++++++++++++------- 2 files changed, 48 insertions(+), 14 deletions(-) diff --git a/src/matfx.cpp b/src/matfx.cpp index bc393c1..90cd454 100644 --- a/src/matfx.cpp +++ b/src/matfx.cpp @@ -8,6 +8,7 @@ #include "rwplg.h" #include "rwpipeline.h" #include "rwobjects.h" +#include "rwengine.h" #include "rwplugins.h" #include "ps2/rwps2.h" #include "ps2/rwps2plg.h" @@ -409,14 +410,9 @@ MatFX::enableEffects(Atomic *atomic) atomic->pipeline = matFXGlobals.pipelines[rw::platform]; } -void -registerMatFXPlugin(void) +static void* +matfxOpen(void*, int32, int32) { - ObjPipeline *defpipe = new ObjPipeline(PLATFORM_NULL); - defpipe->pluginID = 0; //ID_MATFX; - defpipe->pluginData = 0; - for(uint i = 0; i < nelem(matFXGlobals.pipelines); i++) - matFXGlobals.pipelines[i] = defpipe; matFXGlobals.pipelines[PLATFORM_PS2] = ps2::makeMatFXPipeline(); matFXGlobals.pipelines[PLATFORM_XBOX] = @@ -429,6 +425,27 @@ registerMatFXPlugin(void) wdgl::makeMatFXPipeline(); matFXGlobals.pipelines[PLATFORM_GL3] = gl3::makeMatFXPipeline(); +} + +static void* +matfxClose(void*, int32, int32) +{ +} + +void +registerMatFXPlugin(void) +{ + // init dummy pipelines + ObjPipeline *defpipe = new ObjPipeline(PLATFORM_NULL); + defpipe->pluginID = 0; //ID_MATFX; + defpipe->pluginData = 0; + for(uint i = 0; i < nelem(matFXGlobals.pipelines); i++) + matFXGlobals.pipelines[i] = defpipe; + + // TODO: call platform specific init functions? + // have platform specific open functions? + + Engine::registerPlugin(0, ID_MATFX, matfxOpen, matfxClose); matFXGlobals.atomicOffset = Atomic::registerPlugin(sizeof(int32), ID_MATFX, diff --git a/src/skin.cpp b/src/skin.cpp index 95e752c..a3df575 100644 --- a/src/skin.cpp +++ b/src/skin.cpp @@ -8,6 +8,7 @@ #include "rwplg.h" #include "rwpipeline.h" #include "rwobjects.h" +#include "rwengine.h" #include "rwplugins.h" #include "ps2/rwps2.h" #include "ps2/rwps2plg.h" @@ -226,14 +227,9 @@ skinRights(void *object, int32, int32, uint32) Skin::setPipeline((Atomic*)object, 1); } -void -registerSkinPlugin(void) +static void* +skinOpen(void*, int32, int32) { - ObjPipeline *defpipe = new ObjPipeline(PLATFORM_NULL); - defpipe->pluginID = ID_SKIN; - defpipe->pluginData = 1; - for(uint i = 0; i < nelem(skinGlobals.pipelines); i++) - skinGlobals.pipelines[i] = defpipe; skinGlobals.pipelines[PLATFORM_PS2] = ps2::makeSkinPipeline(); skinGlobals.pipelines[PLATFORM_XBOX] = @@ -246,6 +242,27 @@ registerSkinPlugin(void) wdgl::makeSkinPipeline(); skinGlobals.pipelines[PLATFORM_GL3] = gl3::makeSkinPipeline(); +} + +static void* +skinClose(void*, int32, int32) +{ +} + +void +registerSkinPlugin(void) +{ + // init dummy pipelines + ObjPipeline *defpipe = new ObjPipeline(PLATFORM_NULL); + defpipe->pluginID = ID_SKIN; + defpipe->pluginData = 1; + for(uint i = 0; i < nelem(skinGlobals.pipelines); i++) + skinGlobals.pipelines[i] = defpipe; + + // TODO: call platform specific init functions? + // have platform specific open functions? + + Engine::registerPlugin(0, ID_SKIN, skinOpen, skinClose); skinGlobals.offset = Geometry::registerPlugin(sizeof(Skin*), ID_SKIN, createSkin,