Code: Select all
Node* newNodesUncle = newNode->getParent()->getParent()->getLeftChild();
-Abel
Code: Select all
Node* newNodesUncle = newNode->getParent()->getParent()->getLeftChild();
Code: Select all
Node* newNodesUncle = newNode->getParent()->getParent()->getLeftChild();
Code: Select all
Node* newNodesUncle1 = newNode->getParent();
Node* newNodesUncle2 = newNodesUncle1->getParent();
Node* newNodesUncle3 = newNodesUncle2->getLeftChild();
Code: Select all
Program received signal SIGSEGV, Segmentation fault.
0x0040c2e4 in irr::core::map<int, modules::MaterialInteraction>::RBTree<int, mod
ules::MaterialInteraction>::getLeftChild() const (this=0x0)
at libraries/irrlicht-1.4/irrMap.h:52
52 RBTree* getLeftChild() const { return LeftChild; }
Code: Select all
(gdb) backtrace
#0 0x0040c220 in irr::core::map<int, modules::MaterialInteraction>::RBTree<int,
modules::MaterialInteraction>::getLeftChild() const (this=0x0)
at libraries/irrlicht-1.4/irrMap.h:52
#1 0x00407117 in irr::core::map<int, modules::MaterialInteraction>::insert(int
const&, modules::MaterialInteraction const&) (this=0x3d43d0,
keyNew=@0x4aa6fc0, v=@0x22f7cc) at libraries/irrlicht-1.4/irrMap.h:593
#2 0x00406c60 in irr::core::map<int, modules::MaterialInteraction>::set(int con
st&, modules::MaterialInteraction const&) (this=0x3d43d0, k=@0x4aa6fc0,
v=@0x22f7cc) at libraries/irrlicht-1.4/irrMap.h:636
Code: Select all
RBTree* getLeftChild() const { return LeftChild; }
Code: Select all
#ifndef SLOWMAP_H
#define SLOWMAP_H
// This is just hacked up quickly as there seemed to be some bug with
// Irrlicht's map class. Hopefully that will get fixed then should
// change back to using map.
template <class KeyType, class ValueType>
class SlowMap
{
struct KeyMap
{
KeyType key;
ValueType value;
};
core::array<KeyMap> mappings;
public:
void set(KeyType key, ValueType value)
{
for (u16 i = 0; i < mappings.size(); i ++)
{
if (mappings[i].key == key)
{
mappings[i].value = value;
return;
}
}
KeyMap mapping;
mapping.key = key;
mapping.value = value;
mappings.push_back(mapping);
}
bool insert(KeyType key, ValueType value)
{
for (u16 i = 0; i < mappings.size(); i ++)
{
if (mappings[i].key == key)
return false;
}
KeyMap mapping;
mapping.key = key;
mapping.value = value;
mappings.push_back(mapping);
return true;
}
void clear()
{
mappings.clear();
}
void remove(KeyType key)
{
for (u16 i = 0; i < mappings.size(); i ++)
{
if (mappings[i].key == key)
{
mappings.erase(i);
return;
}
}
}
ValueType operator[](KeyType key)
{
for (u16 i = 0; i < mappings.size(); i ++)
{
if (mappings[i].key == key)
return mappings[i].value;
}
throw (const char *)"SlowMap: key not found.";
}
};
#endif