diff --git a/makepanda/makepanda.vcproj b/makepanda/makepanda.vcproj index f533c17448..a787653e1e 100755 --- a/makepanda/makepanda.vcproj +++ b/makepanda/makepanda.vcproj @@ -2371,12 +2371,9 @@ - - - diff --git a/panda/src/display/displayRegion.I b/panda/src/display/displayRegion.I index 6004791d31..8982461879 100644 --- a/panda/src/display/displayRegion.I +++ b/panda/src/display/displayRegion.I @@ -883,3 +883,9 @@ INLINE int DisplayRegionPipelineReader:: get_pixel_height(int i) const { return _cdata->_regions[i]._pixels[3] - _cdata->_regions[i]._pixels[2]; } + +INLINE ostream & +operator << (ostream &out, const DisplayRegion &dr) { + dr.output(out); + return out; +} diff --git a/panda/src/display/displayRegion.h b/panda/src/display/displayRegion.h index 742cf22bd4..091f17e13f 100644 --- a/panda/src/display/displayRegion.h +++ b/panda/src/display/displayRegion.h @@ -16,7 +16,7 @@ #include "pandabase.h" -#include "displayRegionBase.h" +#include "typedReferenceCount.h" #include "drawableRegion.h" #include "referenceCount.h" #include "nodePath.h" @@ -54,7 +54,7 @@ class CullTraverser; * DisplayRegions like panes of glass, usually for layering 2-d interfaces on * top of a 3-d scene. */ -class EXPCL_PANDA_DISPLAY DisplayRegion : public DisplayRegionBase, public DrawableRegion { +class EXPCL_PANDA_DISPLAY DisplayRegion : public TypedReferenceCount, public DrawableRegion { protected: DisplayRegion(GraphicsOutput *window, const LVecBase4 &dimensions); @@ -285,9 +285,9 @@ public: return _type_handle; } static void init_type() { - DisplayRegionBase::init_type(); + TypedReferenceCount::init_type(); register_type(_type_handle, "DisplayRegion", - DisplayRegionBase::get_class_type()); + TypedReferenceCount::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); @@ -374,6 +374,8 @@ private: static TypeHandle _type_handle; }; +INLINE ostream &operator << (ostream &out, const DisplayRegion &dr); + #include "displayRegion.I" #endif /* DISPLAYREGION_H */ diff --git a/panda/src/gsgbase/config_gsgbase.cxx b/panda/src/gsgbase/config_gsgbase.cxx index b4d6dc90c1..2e5ce60aa9 100644 --- a/panda/src/gsgbase/config_gsgbase.cxx +++ b/panda/src/gsgbase/config_gsgbase.cxx @@ -12,7 +12,6 @@ */ #include "config_gsgbase.h" -#include "displayRegionBase.h" #include "graphicsOutputBase.h" #include "graphicsStateGuardianBase.h" @@ -21,7 +20,6 @@ Configure(config_gsgbase); ConfigureFn(config_gsgbase) { - DisplayRegionBase::init_type(); GraphicsOutputBase::init_type(); GraphicsStateGuardianBase::init_type(); } diff --git a/panda/src/gsgbase/displayRegionBase.I b/panda/src/gsgbase/displayRegionBase.I deleted file mode 100644 index a945da7eb3..0000000000 --- a/panda/src/gsgbase/displayRegionBase.I +++ /dev/null @@ -1,25 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file displayRegionBase.I - * @author drose - * @date 2009-02-20 - */ - -/** - * - */ -INLINE DisplayRegionBase:: -DisplayRegionBase() { -} - -INLINE ostream & -operator << (ostream &out, const DisplayRegionBase &dr) { - dr.output(out); - return out; -} diff --git a/panda/src/gsgbase/displayRegionBase.cxx b/panda/src/gsgbase/displayRegionBase.cxx deleted file mode 100644 index b3573b9e68..0000000000 --- a/panda/src/gsgbase/displayRegionBase.cxx +++ /dev/null @@ -1,24 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file displayRegionBase.cxx - * @author drose - * @date 2009-02-20 - */ - -#include "displayRegionBase.h" - -TypeHandle DisplayRegionBase::_type_handle; - - -/** - * - */ -DisplayRegionBase:: -~DisplayRegionBase() { -} diff --git a/panda/src/gsgbase/displayRegionBase.h b/panda/src/gsgbase/displayRegionBase.h deleted file mode 100644 index 71302281f8..0000000000 --- a/panda/src/gsgbase/displayRegionBase.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file displayRegionBase.h - * @author drose - * @date 2009-02-20 - */ - -#ifndef DISPLAYREGIONBASE_H -#define DISPLAYREGIONBASE_H - -#include "pandabase.h" - -#include "typedReferenceCount.h" - -/** - * An abstract base class for DisplayRegion, mainly so we can store - * DisplayRegion pointers in a Camera. - */ -class EXPCL_PANDA_GSGBASE DisplayRegionBase : public TypedReferenceCount { -protected: - INLINE DisplayRegionBase(); - -public: - virtual ~DisplayRegionBase(); - -PUBLISHED: - virtual void output(ostream &out) const=0; - -public: - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - TypedReferenceCount::init_type(); - register_type(_type_handle, "DisplayRegionBase", - TypedReferenceCount::get_class_type()); - } - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - -private: - static TypeHandle _type_handle; -}; - -INLINE ostream &operator << (ostream &out, const DisplayRegionBase &dr); - -#include "displayRegionBase.I" - -#endif diff --git a/panda/src/gsgbase/p3gsgbase_composite1.cxx b/panda/src/gsgbase/p3gsgbase_composite1.cxx index 5a6cec2b95..b7bcd1368e 100644 --- a/panda/src/gsgbase/p3gsgbase_composite1.cxx +++ b/panda/src/gsgbase/p3gsgbase_composite1.cxx @@ -1,6 +1,5 @@ #include "config_gsgbase.cxx" -#include "displayRegionBase.cxx" #include "graphicsOutputBase.cxx" #include "graphicsStateGuardianBase.cxx" diff --git a/panda/src/pgraph/camera.I b/panda/src/pgraph/camera.I index 7da5a9d4c9..0cfcd6277d 100644 --- a/panda/src/pgraph/camera.I +++ b/panda/src/pgraph/camera.I @@ -54,7 +54,7 @@ get_scene() const { /** * Returns the number of display regions associated with the camera. */ -INLINE int Camera:: +INLINE size_t Camera:: get_num_display_regions() const { return _display_regions.size(); } @@ -62,9 +62,9 @@ get_num_display_regions() const { /** * Returns the nth display region associated with the camera. */ -INLINE DisplayRegionBase *Camera:: -get_display_region(int n) const { - nassertr(n >= 0 && n < (int)_display_regions.size(), (DisplayRegionBase *)NULL); +INLINE DisplayRegion *Camera:: +get_display_region(size_t n) const { + nassertr(n < (int)_display_regions.size(), nullptr); return _display_regions[n]; } diff --git a/panda/src/pgraph/camera.cxx b/panda/src/pgraph/camera.cxx index d15e9a2bf3..aabf56eda2 100644 --- a/panda/src/pgraph/camera.cxx +++ b/panda/src/pgraph/camera.cxx @@ -236,7 +236,7 @@ cleanup_aux_scene_data(Thread *current_thread) { * camera. This is only intended to be called from the DisplayRegion. */ void Camera:: -add_display_region(DisplayRegionBase *display_region) { +add_display_region(DisplayRegion *display_region) { _display_regions.push_back(display_region); } @@ -245,7 +245,7 @@ add_display_region(DisplayRegionBase *display_region) { * by the camera. This is only intended to be called from the DisplayRegion. */ void Camera:: -remove_display_region(DisplayRegionBase *display_region) { +remove_display_region(DisplayRegion *display_region) { DisplayRegions::iterator dri = find(_display_regions.begin(), _display_regions.end(), display_region); if (dri != _display_regions.end()) { diff --git a/panda/src/pgraph/camera.h b/panda/src/pgraph/camera.h index 826000fbae..f983773846 100644 --- a/panda/src/pgraph/camera.h +++ b/panda/src/pgraph/camera.h @@ -25,7 +25,8 @@ #include "pointerTo.h" #include "pmap.h" #include "auxSceneData.h" -#include "displayRegionBase.h" + +class DisplayRegion; /** * A node that can be positioned around in the scene graph to represent a @@ -52,8 +53,8 @@ PUBLISHED: INLINE const NodePath &get_scene() const; MAKE_PROPERTY(scene, get_scene, set_scene); - INLINE int get_num_display_regions() const; - INLINE DisplayRegionBase *get_display_region(int n) const; + INLINE size_t get_num_display_regions() const; + INLINE DisplayRegion *get_display_region(size_t n) const; MAKE_SEQ(get_display_regions, get_num_display_regions, get_display_region); MAKE_SEQ_PROPERTY(display_regions, get_num_display_regions, get_display_region); @@ -98,8 +99,8 @@ PUBLISHED: int cleanup_aux_scene_data(Thread *current_thread = Thread::get_current_thread()); private: - void add_display_region(DisplayRegionBase *display_region); - void remove_display_region(DisplayRegionBase *display_region); + void add_display_region(DisplayRegion *display_region); + void remove_display_region(DisplayRegion *display_region); bool _active; NodePath _scene; @@ -110,7 +111,7 @@ private: DrawMask _camera_mask; PN_stdfloat _lod_scale; - typedef pvector DisplayRegions; + typedef pvector DisplayRegions; DisplayRegions _display_regions; CPT(RenderState) _initial_state;