Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2006, 1:16:23 PM (18 years ago)
Author:
bensch
Message:

adapted many classes to the new ClassID System, now comes the hard part… Scripting… then Network… wow this will be so bad :/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/graphics/render2D/element_2d.cc

    r9406 r9685  
    2929#include "graphics_engine.h"
    3030#include "util/loading/load_param.h"
    31 #include "class_list.h"
    3231
    3332#include "color.h"
     
    3534#include "shell_command.h"
    3635SHELL_COMMAND(debug, Element2D, debug2D);
     36
     37NewObjectListDefinition(Element2D);
    3738
    3839
     
    4647Element2D::Element2D (Element2D* parent, E2D_LAYER layer, short nodeFlags)
    4748{
    48   this->setClassID(CL_ELEMENT_2D, "Element2D");
     49  this->registerObject(this, Element2D::_objectList);
    4950
    5051  this->setVisibility(true);
     
    268269void Element2D::setBindNode(const std::string& bindNode)
    269270{
    270   const PNode* tmpBindNode = dynamic_cast<const PNode*>(ClassList::getObject(bindNode, CL_PARENT_NODE));
     271  const PNode* tmpBindNode = PNode::objectList().getObject(bindNode);
    271272  if (tmpBindNode != NULL)
    272273    this->bindNode = tmpBindNode;
     
    640641void Element2D::addChild2D (const std::string& childName)
    641642{
    642   Element2D* childNode = dynamic_cast<Element2D*>(ClassList::getObject(childName, CL_ELEMENT_2D));
     643  Element2D* childNode = Element2D::objectList().getObject(childName);
    643644  if (childNode != NULL)
    644645    this->addChild2D(childNode);
     
    718719void Element2D::setParent2D (const std::string& parentName)
    719720{
    720   Element2D* parentNode = dynamic_cast<Element2D*>(ClassList::getObject(parentName, CL_ELEMENT_2D));
     721  Element2D* parentNode = Element2D::objectList().getObject(parentName);
    721722  if (parentNode != NULL)
    722723    parentNode->addChild2D(this);
     
    771772void Element2D::setParentSoft2D(const std::string& parentName, float bias)
    772773{
    773   Element2D* parentNode = dynamic_cast<Element2D*>(ClassList::getObject(parentName, CL_ELEMENT_2D));
     774  Element2D* parentNode = Element2D::objectList().getObject(parentName);
    774775  if (parentNode != NULL)
    775776    this->setParentSoft2D(parentNode, bias);
Note: See TracChangeset for help on using the changeset viewer.