예제 #1
0
CQuad *CLayerQuads::NewQuad()
{
	m_pEditor->m_Map.m_Modified = true;

	CQuad *q = &m_lQuads[m_lQuads.add(CQuad())];

	q->m_PosEnv = -1;
	q->m_ColorEnv = -1;
	q->m_PosEnvOffset = 0;
	q->m_ColorEnvOffset = 0;
	int x = 0, y = 0;
	q->m_aPoints[0].x = x;
	q->m_aPoints[0].y = y;
	q->m_aPoints[1].x = x+64;
	q->m_aPoints[1].y = y;
	q->m_aPoints[2].x = x;
	q->m_aPoints[2].y = y+64;
	q->m_aPoints[3].x = x+64;
	q->m_aPoints[3].y = y+64;

	q->m_aPoints[4].x = x+32; // pivot
	q->m_aPoints[4].y = y+32;

	for(int i = 0; i < 5; i++)
	{
		q->m_aPoints[i].x <<= 10;
		q->m_aPoints[i].y <<= 10;
	}


	q->m_aTexcoords[0].x = 0;
	q->m_aTexcoords[0].y = 0;

	q->m_aTexcoords[1].x = 1<<10;
	q->m_aTexcoords[1].y = 0;

	q->m_aTexcoords[2].x = 0;
	q->m_aTexcoords[2].y = 1<<10;

	q->m_aTexcoords[3].x = 1<<10;
	q->m_aTexcoords[3].y = 1<<10;

	q->m_aColors[0].r = 255; q->m_aColors[0].g = 255; q->m_aColors[0].b = 255; q->m_aColors[0].a = 255;
	q->m_aColors[1].r = 255; q->m_aColors[1].g = 255; q->m_aColors[1].b = 255; q->m_aColors[1].a = 255;
	q->m_aColors[2].r = 255; q->m_aColors[2].g = 255; q->m_aColors[2].b = 255; q->m_aColors[2].a = 255;
	q->m_aColors[3].r = 255; q->m_aColors[3].g = 255; q->m_aColors[3].b = 255; q->m_aColors[3].a = 255;

	return q;
}
예제 #2
0
CQuad *CLayerQuads::NewQuad()
{
	m_pEditor->m_Map.m_Modified = true;

	CQuad *q = &m_lQuads[m_lQuads.add(CQuad())];

	q->m_PosEnv = -1;
	q->m_ColorEnv = -1;
	q->m_PosEnvOffset = 0;
	q->m_ColorEnvOffset = 0;
	int x = 0, y = 0;
	q->m_aPoints[0].x = i2fx(x);
	q->m_aPoints[0].y = i2fx(y);
	q->m_aPoints[1].x = i2fx(x+64);
	q->m_aPoints[1].y = i2fx(y);
	q->m_aPoints[2].x = i2fx(x);
	q->m_aPoints[2].y = i2fx(y+64);
	q->m_aPoints[3].x = i2fx(x+64);
	q->m_aPoints[3].y = i2fx(y+64);

	q->m_aPoints[4].x = i2fx(x+32); // pivot
	q->m_aPoints[4].y = i2fx(y+32);

	q->m_aTexcoords[0].x = i2fx(0);
	q->m_aTexcoords[0].y = i2fx(0);

	q->m_aTexcoords[1].x = i2fx(1);
	q->m_aTexcoords[1].y = i2fx(0);

	q->m_aTexcoords[2].x = i2fx(0);
	q->m_aTexcoords[2].y = i2fx(1);

	q->m_aTexcoords[3].x = i2fx(1);
	q->m_aTexcoords[3].y = i2fx(1);

	q->m_aColors[0].r = 255; q->m_aColors[0].g = 255; q->m_aColors[0].b = 255; q->m_aColors[0].a = 255;
	q->m_aColors[1].r = 255; q->m_aColors[1].g = 255; q->m_aColors[1].b = 255; q->m_aColors[1].a = 255;
	q->m_aColors[2].r = 255; q->m_aColors[2].g = 255; q->m_aColors[2].b = 255; q->m_aColors[2].a = 255;
	q->m_aColors[3].r = 255; q->m_aColors[3].g = 255; q->m_aColors[3].b = 255; q->m_aColors[3].a = 255;

	return q;
}
예제 #3
0
	void CQuad::draw(const CRectf & vPos, const CRectf & tPos)
	{
		CQuad(vPos, tPos).draw();
	}