Exemple #1
0
SceneLoader::SceneLoader(const char * fileName):
  doc(fileName)
{
  // Read string from file
	bool loadOkay = doc.LoadFile();

	if ( !loadOkay )
	{
	  // fazer subclassing ?classe exception para dar mais informações...
		throw Excepcao();
	}

	this->mat_base=new Material();

	this->mat_base->ambient[0]=0.6;
	this->mat_base->ambient[1]=0.6;
	this->mat_base->ambient[2]=0.6;
	this->mat_base->ambient[3]=1.0;
	this->mat_base->diffuse[0]=0.6;
	this->mat_base->diffuse[1]=0.6;
	this->mat_base->diffuse[2]=0.6;
	this->mat_base->diffuse[3]=1.0;
	this->mat_base->id="_base";
	this->mat_base->specular[0]=0.4;
	this->mat_base->specular[1]=0.4;
	this->mat_base->specular[2]=0.4;
	this->mat_base->specular[3]=1.0;
	this->mat_base->shininess[0]=128.0; 

	this->no_tex=new Texture();

	this->no_tex->id="NO_TEXTURE";

	this->root = doc.RootElement();
}
Exemple #2
0
int VerificaDisparo ( char *comando,CoordenadaS *coord)
{	
	if(comando[0]<'A' || comando[0]>'J' || comando[1] < 0 || comando[1] > 9)
		{Excepcao("Comando invalido"); 
		return 0;}
		
	coord->row = comando[0]-'A';	 /*Passar para o valor  numerico correcto */
	coord->col = comando[1];
	return 1;
}