All pastes #980039 Raw Edit

Unbenannt

public text v1 · immutable
·published 2008-04-10 19:24 UTC
rendered paste body
void AStar::render(SceneState* state) //, SceneRenderImage*)
{
  if (!Con::getBoolVariable("$pref::AStar::Render", false))
	return;

  GFX->setTextureStageColorOp( 0, GFXTOPDisable ); // turn off texturing.
  GFX->disableShaders();

  int i;

  for (NMPoint* tmp = list; tmp; tmp = tmp->next) //iterate thru list
  {
	PrimBuild::begin( GFXLineList, 2 );
	PrimBuild::color4f( 0, 1, 0, 1 );
	PrimBuild::vertex3f(tmp->loc.x, tmp->loc.y, tmp->loc.z);
	PrimBuild::vertex3f(tmp->loc.x, tmp->loc.y, tmp->loc.z-1);
	PrimBuild::end();

	PrimBuild::color4f( 0, 0, 1, 1 );
	for (i=0; i<8; i++)
	{
	  if (!tmp->adjs[i])
		continue;

	  PrimBuild::begin( GFXLineList, 2 );
	  PrimBuild::vertex3f(tmp->loc.x, tmp->loc.y, tmp->loc.z);
	  PrimBuild::vertex3f(tmp->adjs[i]->loc.x, tmp->adjs[i]->loc.y, tmp->adjs[i]->loc.z-1);
	  PrimBuild::end();
	}
  }
}