Mercurial > fife-parpg
comparison engine/core/view/renderers/genericrenderer.cpp @ 25:fc6713d72b80
add setter for nodes
author | spq@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 11 Jul 2008 11:25:11 +0000 |
parents | cb87d40e9342 |
children | 70f41ea8e7db |
comparison
equal
deleted
inserted
replaced
24:cb87d40e9342 | 25:fc6713d72b80 |
---|---|
64 } | 64 } |
65 GenericRendererNode::~GenericRendererNode() { | 65 GenericRendererNode::~GenericRendererNode() { |
66 } | 66 } |
67 | 67 |
68 void GenericRendererNode::setAttached(Instance* attached_instance, const Location &relative_location, const Point &relative_point) { | 68 void GenericRendererNode::setAttached(Instance* attached_instance, const Location &relative_location, const Point &relative_point) { |
69 m_instance = attached_instance; | |
70 m_location = relative_location; | |
71 m_point = relative_point; | |
69 } | 72 } |
70 void GenericRendererNode::setAttached(Instance* attached_instance, const Location &relative_location) { | 73 void GenericRendererNode::setAttached(Instance* attached_instance, const Location &relative_location) { |
74 m_instance = attached_instance; | |
75 m_location = relative_location; | |
71 } | 76 } |
72 void GenericRendererNode::setAttached(Instance* attached_instance, const Point &relative_point) { | 77 void GenericRendererNode::setAttached(Instance* attached_instance, const Point &relative_point) { |
78 m_instance = attached_instance; | |
79 m_point = relative_point; | |
73 } | 80 } |
74 void GenericRendererNode::setAttached(Instance* attached_instance) { | 81 void GenericRendererNode::setAttached(Instance* attached_instance) { |
82 m_instance = attached_instance; | |
75 } | 83 } |
76 void GenericRendererNode::setAttached(const Location &attached_location, const Point &relative_point) { | 84 void GenericRendererNode::setAttached(const Location &attached_location, const Point &relative_point) { |
85 m_instance = NULL; | |
86 m_location = attached_location; | |
87 m_point = relative_point; | |
77 } | 88 } |
78 void GenericRendererNode::setAttached(const Location &attached_location) { | 89 void GenericRendererNode::setAttached(const Location &attached_location) { |
90 m_instance = NULL; | |
91 m_location = attached_location; | |
79 } | 92 } |
80 void GenericRendererNode::setAttached(const Point &attached_point) { | 93 void GenericRendererNode::setAttached(const Point &attached_point) { |
94 m_instance = NULL; | |
95 m_location = NULL; | |
96 m_point = attached_point; | |
81 } | 97 } |
82 | 98 |
83 void GenericRendererNode::setRelative(const Location &relative_location) { | 99 void GenericRendererNode::setRelative(const Location &relative_location) { |
100 if(m_instance == NULL) { | |
101 throw NotSupported("No instance attached."); | |
102 } | |
103 m_location = relative_location; | |
84 } | 104 } |
85 void GenericRendererNode::setRelative(const Location &relative_location, Point relative_point) { | 105 void GenericRendererNode::setRelative(const Location &relative_location, Point relative_point) { |
106 if(m_instance == NULL) { | |
107 throw NotSupported("No instance attached."); | |
108 } | |
109 m_location = relative_location; | |
110 m_point = relative_point; | |
86 } | 111 } |
87 void GenericRendererNode::setRelative(const Point &relative_point) { | 112 void GenericRendererNode::setRelative(const Point &relative_point) { |
113 if(m_instance == NULL or m_location == NULL) { | |
114 throw NotSupported("No instance or location attached."); | |
115 } | |
116 m_point = relative_point; | |
88 } | 117 } |
89 | 118 |
90 Instance* GenericRendererNode::getAttachedInstance() { | 119 Instance* GenericRendererNode::getAttachedInstance() { |
91 if(m_instance == NULL) { | 120 if(m_instance == NULL) { |
92 throw NotSupported("No instance attached."); | 121 throw NotSupported("No instance attached."); |