Ejemplo n.º 1
0
// compute the separated DFS children for all nodes in ascending order of
// their lowpoint values in linear time
void BoyerMyrvoldInit::computeDFSChildLists() {
	// Bucketsort by lowpoint values
	BucketLowPoint blp(m_lowPoint);

	// copy all non-virtual nodes in a list and sort them with Bucketsort
	SListPure<node> allNodes;
	for (node v : m_g.nodes) {
		if (m_dfi[v] > 0)
			allNodes.pushBack(v);
	}
	allNodes.bucketSort(1, m_nodeFromDFI.high(), blp);

	// build DFS-child list
	for (node v : allNodes) {
		OGDF_ASSERT(m_dfi[v] > 0);

		// if node is not root: insert node after last element of parent's DFSChildList
		// to achieve constant time deletion later:
		// set a pointer for each node to predecessor of his representative in the list
		if (m_adjParent[v] != nullptr) {
			OGDF_ASSERT(m_realVertex[m_adjParent[v]->theNode()] != nullptr);

			m_pNodeInParent[v] = m_separatedDFSChildList[m_realVertex[m_adjParent[v]->theNode()]].pushBack(v);

			OGDF_ASSERT(m_pNodeInParent[v].valid());
			OGDF_ASSERT(v == *m_pNodeInParent[v]);
		}
		else m_pNodeInParent[v] = nullptr;
	}
}
Ejemplo n.º 2
0
int    load_map6(t_data *data)
{
  data->pos_bg.x = 0;
  data->pos_bg.y = 0;
  if ((data->fond = blp("pictures/map6/epitech_rouge.png")) == NULL)
    return (-1);
  if ((data->map.calq1 = blp("pictures/map6/epitech_jaune.png")) == NULL)
    return (-1);
  if ((data->map.calq2 = blp("pictures/map6/epitech_vert.png")) == NULL)
    return (-1);
  if (data->map.nbr == 7)
    load_map6_2(data);
  else
    load_map6_3(data);
  data->map.nbr = 6;
  data->fond->origin.x = data->player_move.x  - 515;
  data->map.calq1->origin.x = data->player_move.x  - 515;
  data->map.calq2->origin.x = data->player_move.x  - 515;
  aff_map6(data);
  return (0);
}
Ejemplo n.º 3
0
int    load_map4_2(t_data *data)
{
  data->map.nbr = 4;
  data->character_move->origin.y = 288;
  if ((data->fond = bunny_load_picture("pictures/map4/fond.png")) == NULL)
    return (-1);
  data->fond->scale.x = 1.03;
  data->fond->scale.y = 1.03;
  if ((data->map.elem1 = bunny_load_picture("pictures/map4/boat.png")) == NULL)
    return (-1);
  data->map.pos_elem1.x = -500;
  data->map.pos_elem1.y = -100;
  if ((data->map.calq1 = blp("pictures/map4/pecheur.png")) == NULL)
    return (-1);
  data->map.pos_calq1.x = 526;
  data->map.pos_calq1.y = 467 - 280;
  data->map.elem1->scale.x = 1.5;
  data->map.elem1->scale.y = 1.5;
  aff_map4(data);
  return (0);
}
Ejemplo n.º 4
0
int	init_inventory_2(t_data *data)
{
  if ((data->inv.select = blp("pictures/inventory/select.png")) == NULL)
    return (-1);
  if ((data->inv.bar = blp("pictures/inventory/bar.png")) == NULL)
    return (-1);
  if ((data->inv.item_min[0].item = blp("pictures/inventory/0.png")) == NULL)
    return (-1);
  data->inv.item_min[0].used = 0;
  if ((data->inv.item_min[1].item = blp("pictures/inventory/1.png")) == NULL)
    return (-1);
  data->inv.item_min[1].used = 0;
  if ((data->inv.item_min[2].item = blp("pictures/inventory/2.png")) == NULL)
    return (-1);
  data->inv.item_min[2].used = 0;
  if ((data->inv.item_min[3].item = blp("pictures/inventory/3.png")) == NULL)
    return (-1);
  data->inv.item_min[3].used = 0;
  if ((data->inv.item_min[4].item = blp("pictures/inventory/4.png")) == NULL)
    return (-1);
  return (0);
}
Ejemplo n.º 5
0
int	init_text(t_data *data)
{
  if ((data->text.pecheur[0] = blp("pictures/text/bonjour.png")) == NULL)
      return (-1);
  return (0);
}