diff --git a/direct/src/showbase/EventManager.py b/direct/src/showbase/EventManager.py index 8e08fcdbfe..c29cb0b05b 100644 --- a/direct/src/showbase/EventManager.py +++ b/direct/src/showbase/EventManager.py @@ -5,8 +5,8 @@ __all__ = ['EventManager'] from MessengerGlobal import * from direct.directnotify.DirectNotifyGlobal import * +from direct.task.TaskManagerGlobal import taskMgr from panda3d.core import PStatCollector, EventQueue, EventHandler -from panda3d.core import EventStorePandaNode class EventManager: @@ -15,11 +15,6 @@ class EventManager: # delayed import, since this is imported by the Toontown Launcher # before the complete PandaModules have been downloaded. PStatCollector = None - - # for efficiency, only call import once per module - EventStorePandaNode = None - EventQueue = None - EventHandler = None def __init__(self, eventQueue = None): """ @@ -76,15 +71,8 @@ class EventManager: return None else: # Must be some user defined type, return the ptr - # which will be downcast to that type - ptr = eventParameter.getPtr() - - if isinstance(ptr, EventStorePandaNode): - # Actually, it's a kludgey wrapper around a PandaNode - # pointer. Return the node. - ptr = ptr.getValue() - - return ptr + # which will be downcast to that type. + return eventParameter.getPtr() def processEvent(self, event): """ @@ -195,11 +183,7 @@ class EventManager: # Otherwise, we need our own event handler. self.eventHandler = EventHandler(self.eventQueue) - # Should be safe to import the global taskMgr by now. - from direct.task.TaskManagerGlobal import taskMgr taskMgr.add(self.eventLoopTask, 'eventManager') def shutdown(self): - # Should be safe to import the global taskMgr by now. - from direct.task.TaskManagerGlobal import taskMgr taskMgr.remove('eventManager') diff --git a/panda/src/pgraph/Sources.pp b/panda/src/pgraph/Sources.pp index b03f0386aa..55e210ea99 100644 --- a/panda/src/pgraph/Sources.pp +++ b/panda/src/pgraph/Sources.pp @@ -46,7 +46,6 @@ depthOffsetAttrib.I depthOffsetAttrib.h \ depthTestAttrib.I depthTestAttrib.h \ depthWriteAttrib.I depthWriteAttrib.h \ - eventStorePandaNode.I eventStorePandaNode.h \ findApproxLevelEntry.I findApproxLevelEntry.h \ findApproxPath.I findApproxPath.h \ fog.I fog.h \ @@ -155,7 +154,6 @@ depthOffsetAttrib.cxx \ depthTestAttrib.cxx \ depthWriteAttrib.cxx \ - eventStorePandaNode.cxx \ findApproxLevelEntry.cxx \ findApproxPath.cxx \ fog.cxx \ @@ -258,7 +256,6 @@ depthOffsetAttrib.I depthOffsetAttrib.h \ depthTestAttrib.I depthTestAttrib.h \ depthWriteAttrib.I depthWriteAttrib.h \ - eventStorePandaNode.I eventStorePandaNode.h \ fog.I fog.h \ fogAttrib.I fogAttrib.h \ geomDrawCallbackData.I geomDrawCallbackData.h \ diff --git a/panda/src/pgraph/config_pgraph.cxx b/panda/src/pgraph/config_pgraph.cxx index dbb1b7a6d5..18b85ea77c 100644 --- a/panda/src/pgraph/config_pgraph.cxx +++ b/panda/src/pgraph/config_pgraph.cxx @@ -37,7 +37,6 @@ #include "depthOffsetAttrib.h" #include "depthTestAttrib.h" #include "depthWriteAttrib.h" -#include "eventStorePandaNode.h" #include "findApproxLevelEntry.h" #include "fog.h" #include "fogAttrib.h" @@ -414,7 +413,6 @@ init_libpgraph() { DepthOffsetAttrib::init_type(); DepthTestAttrib::init_type(); DepthWriteAttrib::init_type(); - EventStorePandaNode::init_type(); FindApproxLevelEntry::init_type(); Fog::init_type(); FogAttrib::init_type(); diff --git a/panda/src/pgraph/eventStorePandaNode.I b/panda/src/pgraph/eventStorePandaNode.I deleted file mode 100644 index d2b2db4ada..0000000000 --- a/panda/src/pgraph/eventStorePandaNode.I +++ /dev/null @@ -1,48 +0,0 @@ -// Filename: eventStorePandaNode.I -// Created by: drose (13Sep06) -// -//////////////////////////////////////////////////////////////////// -// -// 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." -// -//////////////////////////////////////////////////////////////////// - - -//////////////////////////////////////////////////////////////////// -// Function: EventStorePandaNode::Constructor -// Access: Published -// Description: -//////////////////////////////////////////////////////////////////// -INLINE EventStorePandaNode:: -EventStorePandaNode(const PandaNode *value) : - _value((PandaNode *)value) -{ -} - -//////////////////////////////////////////////////////////////////// -// Function: EventStorePandaNode::set_value -// Access: Published -// Description: Changes the value stored in the parameter. It is -// dangerous to do this for a parameter already added to -// an event, since the parameters may be shared. -//////////////////////////////////////////////////////////////////// -INLINE void EventStorePandaNode:: -set_value(const PandaNode *value) { - _value = (PandaNode *)value; -} - - -//////////////////////////////////////////////////////////////////// -// Function: EventStorePandaNode::get_value -// Access: Published -// Description: Retrieves the value stored in the parameter. -//////////////////////////////////////////////////////////////////// -INLINE PandaNode *EventStorePandaNode:: -get_value() const { - return _value; -} diff --git a/panda/src/pgraph/eventStorePandaNode.cxx b/panda/src/pgraph/eventStorePandaNode.cxx deleted file mode 100644 index 0bd66804ea..0000000000 --- a/panda/src/pgraph/eventStorePandaNode.cxx +++ /dev/null @@ -1,41 +0,0 @@ -// Filename: eventStorePandaNode.cxx -// Created by: drose (13Sep06) -// -//////////////////////////////////////////////////////////////////// -// -// 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." -// -//////////////////////////////////////////////////////////////////// - -#include "eventStorePandaNode.h" - -TypeHandle EventStorePandaNode::_type_handle; - -//////////////////////////////////////////////////////////////////// -// Function: EventStorePandaNode::Destructor -// Access: Published, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -EventStorePandaNode:: -~EventStorePandaNode() { -} - -//////////////////////////////////////////////////////////////////// -// Function: EventStorePandaNode::output -// Access: Published, Virtual -// Description: -//////////////////////////////////////////////////////////////////// -void EventStorePandaNode:: -output(ostream &out) const { - if (_value == (PandaNode *)NULL) { - out << "(empty)"; - - } else { - out << *_value; - } -} diff --git a/panda/src/pgraph/eventStorePandaNode.h b/panda/src/pgraph/eventStorePandaNode.h deleted file mode 100644 index b71636c79c..0000000000 --- a/panda/src/pgraph/eventStorePandaNode.h +++ /dev/null @@ -1,60 +0,0 @@ -// Filename: eventStorePandaNode.h -// Created by: drose (13Sep06) -// -//////////////////////////////////////////////////////////////////// -// -// 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." -// -//////////////////////////////////////////////////////////////////// - -#ifndef EVENTSTOREPANDANODE_H -#define EVENTSTOREPANDANODE_H - -#include "pandabase.h" -#include "eventParameter.h" -#include "pandaNode.h" - -//////////////////////////////////////////////////////////////////// -// Class : EventStorePandaNode -// Description : A class object for storing specifically objects of -// type PandaNode. -//////////////////////////////////////////////////////////////////// -class EXPCL_PANDA_PGRAPH EventStorePandaNode : public ParamValueBase { -PUBLISHED: - INLINE EventStorePandaNode(const PandaNode *value); - virtual ~EventStorePandaNode(); - - INLINE void set_value(const PandaNode *value); - INLINE PandaNode *get_value() const; - - virtual void output(ostream &out) const; - -public: - PT(PandaNode) _value; - -public: - virtual TypeHandle get_type() const { - return get_class_type(); - } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} - static TypeHandle get_class_type() { - return _type_handle; - } - static void init_type() { - ParamValueBase::init_type(); - register_type(_type_handle, "EventStorePandaNode", - ParamValueBase::get_class_type()); - } - -private: - static TypeHandle _type_handle; -}; - -#include "eventStorePandaNode.I" - -#endif diff --git a/panda/src/pgraph/p3pgraph_composite2.cxx b/panda/src/pgraph/p3pgraph_composite2.cxx index a3980ff748..e6407dbd54 100644 --- a/panda/src/pgraph/p3pgraph_composite2.cxx +++ b/panda/src/pgraph/p3pgraph_composite2.cxx @@ -13,7 +13,6 @@ #include "depthTestAttrib.cxx" #include "depthWriteAttrib.cxx" #include "alphaTestAttrib.cxx" -#include "eventStorePandaNode.cxx" #include "findApproxPath.cxx" #include "findApproxLevelEntry.cxx" #include "fog.cxx"