Beispiel #1
0
void Shapes::CreateShape(ShapesType type, float resolution)
{
	type_ = type;
	is_quad_ = false;

	switch (type_)
	{
	case DISC:
		InitDisc(resolution);
		break;
	case SPHERE:
		InitSphere(resolution);
		is_quad_ = true;
		break;
	case CUBE_ST:
		InitCube();
		is_quad_ = true;
		break;
	case CUBE_CT:
		InitCube(false);
		is_quad_ = true;
		break;
	case PLANE:
		InitPlane();
		is_quad_ = true;
		break;
	case PLANE_TILED:
		InitPlane(resolution);
		is_quad_ = true;
		break;
	case PLANE_BIG:
		InitBigPlane(resolution);
		is_quad_ = true;
		break;
	case SPHERE_HALF_UV:
		InitSphere(resolution);
		is_quad_ = true;
		break;
	default:
		break;
	}
}
Beispiel #2
0
int InitDie(struct dieInfo * p_die,struct ftlInfo *ftl){
	unsigned int i;
	struct planeInfo * p_plane;

	p_die->token = 0;
	
	p_die->plane = (struct planeInfo*)malloc(ftl->parameter->plane_die * sizeof(struct planeInfo));
	AllocAssert(p_die->plane,"p_die->plane");
	memset(p_die->plane,0,ftl->parameter->plane_die * sizeof(struct planeInfo));

	for (i = 0; i<ftl->parameter->plane_die; i++)
	{
		p_plane = &(p_die->plane[i]);
		InitPlane(p_plane,ftl->parameter );
	}

	return XST_SUCCESS;

}