Пример #1
0
void Graph_RemoveID(World* inWorld, Graph *inGraph)
{
	if (!World_RemoveNode(inWorld, &inGraph->mNode)) {
		int err = kSCErr_Failed; // shouldn't happen..
		throw err;
	}

	HiddenWorld* hw = inWorld->hw;
	int id = hw->mHiddenID = (hw->mHiddenID - 8) | 0x80000000;
	inGraph->mNode.mID = id;
	inGraph->mNode.mHash = Hash(id);
    if (!World_AddNode(inWorld, &inGraph->mNode)) {
		scprintf("mysterious failure in Graph_RemoveID\n");
		Node_Delete(&inGraph->mNode);
		// enums are uncatchable. must throw an int.
		int err = kSCErr_Failed; // shouldn't happen..
		throw err;
    }

	//inWorld->hw->mRecentID = id;
}
Пример #2
0
void Node_RemoveID(Node *inNode)
{
	if (inNode->mID == 0) return; // failed
  
  World* world = inNode->mWorld;
	if (!World_RemoveNode(world, inNode)) {
		int err = kSCErr_Failed; // shouldn't happen..
		throw err;
	}
  
	HiddenWorld* hw = world->hw;
	int id = hw->mHiddenID = (hw->mHiddenID - 8) | 0x80000000;
	inNode->mID = id;
	inNode->mHash = Hash(id);
  if (!World_AddNode(world, inNode)) {
		scprintf("mysterious failure in Node_RemoveID\n");
		Node_Delete(inNode);
		// enums are uncatchable. must throw an int.
		int err = kSCErr_Failed; // shouldn't happen..
		throw err;
  }
  
	//inWorld->hw->mRecentID = id;
}