示例#1
0
void GamePlay::levelLoadFromGrid(Grid* g)
{
	deleteGrid();
	grid=g->allocCopy();


}
示例#2
0
void Quad::setSegs(int x, int y, float dgox, float dgoy, float dgmx, float dgmy, float dgtm, bool dgo)
{
	deleteGrid();
	if (x == 0 || y == 0)
	{
		gridTimer = 0;
		xDivs = 0;
		yDivs = 0;
		doUpdateGrid = false;
	}
	else
	{
		this->drawGridOffsetX = dgox;
		this->drawGridOffsetY = dgoy;
		this->drawGridModX = dgmx;
		this->drawGridModY = dgmy;
		this->drawGridTimeMultiplier = dgtm;
		drawGridOut = dgo;
		xDivs = x;
		yDivs = y;

		createGrid(x, y);

		gridTimer = 0;
		
		doUpdateGrid = true;
	}
}
示例#3
0
void ParticleGrid::setViewport(const box2i &viewport)
{
    if (viewport != this->viewport) {
        this->viewport = viewport;
        deleteGrid();
    }
}
示例#4
0
void ParticleGrid::setParticleRadius(float radius)
{
    if (radius != this->radius) {
        this->radius = radius;
        deleteGrid();
    }
}
示例#5
0
void Quad::createGrid(int xd, int yd)
{
	deleteGrid();
	
	xDivs = xd;
	yDivs = yd;
	
	drawGrid = new Vector * [xDivs];
	for (int i = 0; i < xDivs; i++)
	{
		drawGrid[i] = new Vector [yDivs];
		for (int j = 0; j < yDivs; j++)
		{
			drawGrid[i][j].z = 1;
		}
	}
	
	resetGrid();
}
示例#6
0
void Element::setElementEffectByIndex(int eidx)
{
	deleteGrid();

	setBlendType(RenderObject::BLEND_DEFAULT);
	alpha.stop();
	alpha = 1;

	elementEffectIndex = eidx;

	ElementEffect e = dsq->getElementEffectByIndex(eidx);

	switch(e.type)
	{
	case EFX_SEGS:
	{
		setSegs(e.segsx, e.segsy, e.segs_dgox, e.segs_dgoy, e.segs_dgmx, e.segs_dgmy, e.segs_dgtm, e.segs_dgo);
		setStatic(false);
	}
	break;
	case EFX_ALPHA:
	{
		setBlendType(e.blendType);
		alpha = e.alpha;
		setStatic(false);
	}
	break;
	case EFX_WAVY:
	{
		/*
		char buf[256];
		sprintf(buf, "setting wavy segsy: %d radius: %d min: %d max: %d", e.segsy, e.wavy_radius, e.wavy_min, e.wavy_max);
		debugLog(buf);
		*/
		wavy.resize(e.segsy);
		float bity = float(getHeight())/float(e.segsy);
		for (int i = 0; i < wavy.size(); i++)
		{
			wavy[i] = Vector(0, -(i*bity));
		}
		//wavySave = wavy;
		wavyRadius = e.wavy_radius;
		wavyFlip = e.wavy_flip;
		wavyMin = bity;
		wavyMax = bity*1.2f;

		//wavyRadius = 8;

		createGrid(2, e.segsy);

		setGridFromWavy();

		//createGrid(8,8);
		/*
		wavyMin = e.wavy_min;
		wavyMax = e.wavy_max;
		*/
		setStatic(false);
	}
	break;
	default:
		setStatic(true);
	break;
	}
	elementEffectType = e.type;
}
示例#7
0
void Quad::destroy()
{
	deleteGrid();
	RenderObject::destroy();
}
示例#8
0
GamePlay::~GamePlay()
{
	deleteGrid();
	if (mesh!=NULL) delete mesh;
}
示例#9
0
ParticleGrid::~ParticleGrid()
{
    deleteGrid();
}