From 4b528585e448106d29b7edd1b3af1b39b9b89a0c Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 24 Jan 2003 23:19:42 +0000 Subject: [PATCH] remove legacy gsg factory code --- panda/src/display/config_display.cxx | 2 - panda/src/display/graphicsStateGuardian.cxx | 39 ------------------- panda/src/display/graphicsStateGuardian.h | 28 ------------- panda/src/dxgsg7/dxGraphicsStateGuardian7.cxx | 15 ------- panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 14 ------- panda/src/glgsg/config_glgsg.cxx | 4 -- panda/src/glgsg/glGraphicsStateGuardian.cxx | 15 ------- 7 files changed, 117 deletions(-) diff --git a/panda/src/display/config_display.cxx b/panda/src/display/config_display.cxx index e1ab9e8966..3184bbc694 100644 --- a/panda/src/display/config_display.cxx +++ b/panda/src/display/config_display.cxx @@ -91,8 +91,6 @@ init_libdisplay() { initialized = true; GraphicsStateGuardian::init_type(); - GraphicsStateGuardian::GsgParam::init_type(); - GraphicsStateGuardian::GsgWindow::init_type(); SavedFrameBuffer::init_type(); GraphicsPipe::init_type(); GraphicsWindow::init_type(); diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 2c68908194..32048a9c49 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -74,30 +74,6 @@ PStatCollector GraphicsStateGuardian::_render_states_unused_pcollector("RenderSt #endif TypeHandle GraphicsStateGuardian::_type_handle; -TypeHandle GraphicsStateGuardian::GsgWindow::_type_handle; - -GraphicsStateGuardian::GsgFactory *GraphicsStateGuardian::_factory = NULL; - -GraphicsStateGuardian::GsgWindow::~GsgWindow(void) {} - -TypeHandle GraphicsStateGuardian::GsgWindow::get_class_type(void) { - return _type_handle; -} - -void GraphicsStateGuardian::GsgWindow::init_type(void) { - GsgParam::init_type(); - register_type(_type_handle, "GraphicsStateGuardian::GsgWindow", - GsgParam::get_class_type()); -} - -TypeHandle GraphicsStateGuardian::GsgWindow::get_type(void) const { - return get_class_type(); -} - -TypeHandle GraphicsStateGuardian::GsgWindow::force_init_type(void) { - init_type(); - return get_class_type(); -} //////////////////////////////////////////////////////////////////// // Function: GraphicsStateGuardian::Constructor @@ -1574,18 +1550,3 @@ traverse_prepared_textures(bool (*pertex_callbackfn)(TextureContext *,void *),vo return; } } - -//////////////////////////////////////////////////////////////////// -// Function: GraphicsStateGuardian::get_factory -// Access: Public, Static -// Description: Returns the factory object that can be used to -// register new kinds of GraphicsStateGuardian objects that may -// be created. -//////////////////////////////////////////////////////////////////// -GraphicsStateGuardian::GsgFactory &GraphicsStateGuardian:: -get_factory() { - if (_factory == (GsgFactory *)NULL) { - _factory = new GsgFactory; - } - return (*_factory); -} diff --git a/panda/src/display/graphicsStateGuardian.h b/panda/src/display/graphicsStateGuardian.h index 93fb935f4b..d7143bcd94 100644 --- a/panda/src/display/graphicsStateGuardian.h +++ b/panda/src/display/graphicsStateGuardian.h @@ -327,34 +327,6 @@ private: public: void traverse_prepared_textures(bool (*pertex_callbackfn)(TextureContext *,void *),void *callback_arg); -// factory stuff -public: - typedef Factory GsgFactory; - typedef FactoryParam GsgParam; - - // Make a factory parameter type for the window pointer - class EXPCL_PANDA GsgWindow : public GsgParam { - public: - INLINE GsgWindow(GraphicsWindow* w) : GsgParam(), _w(w) {} - virtual ~GsgWindow(void); - INLINE GraphicsWindow* get_window(void) { return _w; } - public: - static TypeHandle get_class_type(void); - static void init_type(void); - virtual TypeHandle get_type(void) const; - virtual TypeHandle force_init_type(void); - private: - GraphicsWindow* _w; - static TypeHandle _type_handle; - - INLINE GsgWindow(void) : GsgParam() {} - }; - - static GsgFactory &get_factory(); - -private: - static GsgFactory *_factory; - public: INLINE GraphicsWindow* get_window(void) const { return _win; } diff --git a/panda/src/dxgsg7/dxGraphicsStateGuardian7.cxx b/panda/src/dxgsg7/dxGraphicsStateGuardian7.cxx index a5406459c7..a074a645a6 100644 --- a/panda/src/dxgsg7/dxGraphicsStateGuardian7.cxx +++ b/panda/src/dxgsg7/dxGraphicsStateGuardian7.cxx @@ -4726,21 +4726,6 @@ restore_frame_buffer(SavedFrameBuffer *frame_buffer) { return; } -// factory and type stuff - -GraphicsStateGuardian *DXGraphicsStateGuardian7:: -make_DXGraphicsStateGuardian(const FactoryParams ¶ms) { - GraphicsStateGuardian::GsgWindow *win_param; - if (!get_param_into(win_param, params)) { - dxgsg7_cat.error() - << "No window specified for gsg creation!" << endl; - return NULL; - } - - GraphicsWindow *win = win_param->get_window(); - return new DXGraphicsStateGuardian7(win); -} - TypeHandle DXGraphicsStateGuardian7::get_type(void) const { return get_class_type(); } diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index 148cd53d99..de3047cc93 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -4508,20 +4508,6 @@ restore_frame_buffer(SavedFrameBuffer *frame_buffer) { return; } -// factory and type stuff - -GraphicsStateGuardian *DXGraphicsStateGuardian8:: -make_DXGraphicsStateGuardian8(const FactoryParams ¶ms) { - GraphicsStateGuardian::GsgWindow *win_param; - if (!get_param_into(win_param, params)) { - dxgsg8_cat.error() << "No window specified for gsg creation!" << endl; - return NULL; - } - - GraphicsWindow *win = win_param->get_window(); - return new DXGraphicsStateGuardian8(win); -} - TypeHandle DXGraphicsStateGuardian8::get_type(void) const { return get_class_type(); } diff --git a/panda/src/glgsg/config_glgsg.cxx b/panda/src/glgsg/config_glgsg.cxx index 3f141ad275..5c0b5e73e5 100644 --- a/panda/src/glgsg/config_glgsg.cxx +++ b/panda/src/glgsg/config_glgsg.cxx @@ -110,8 +110,4 @@ init_libglgsg() { GLSavedFrameBuffer::init_type(); GLTextureContext::init_type(); GLGeomNodeContext::init_type(); - - GraphicsStateGuardian::get_factory().register_factory - (GLGraphicsStateGuardian::get_class_type(), - GLGraphicsStateGuardian::make_GlGraphicsStateGuardian); } diff --git a/panda/src/glgsg/glGraphicsStateGuardian.cxx b/panda/src/glgsg/glGraphicsStateGuardian.cxx index 3e42b1a342..c987576c3a 100644 --- a/panda/src/glgsg/glGraphicsStateGuardian.cxx +++ b/panda/src/glgsg/glGraphicsStateGuardian.cxx @@ -3971,21 +3971,6 @@ save_mipmap_images(Texture *tex) { } #endif // NDEBUG -// factory and type stuff - -GraphicsStateGuardian *GLGraphicsStateGuardian:: -make_GlGraphicsStateGuardian(const FactoryParams ¶ms) { - GraphicsStateGuardian::GsgWindow *win_param; - if (!get_param_into(win_param, params)) { - glgsg_cat.error() - << "No window specified for gsg creation!" << endl; - return NULL; - } - - GraphicsWindow *win = win_param->get_window(); - return new GLGraphicsStateGuardian(win); -} - TypeHandle GLGraphicsStateGuardian::get_type(void) const { return get_class_type(); }