示例#1
0
/**
 *  erzeugt die Terrain-Vertices.
 *
 *  @author OLiver
 */
void TerrainRenderer::GenerateVertices(const GameWorldViewer& gwv)
{
    vertices.clear();
    vertices.resize(width * height);

    // Terrain generieren
    for(MapCoord y = 0; y < height; ++y)
    {
        for(MapCoord x = 0; x < width; ++x)
        {
            MapPoint pt(x, y);
            UpdateVertexPos(pt, gwv);
            UpdateVertexColor(pt, gwv);
            UpdateVertexTerrain(pt, gwv);
        }
    }

    // Ränder generieren
    for(MapCoord y = 0; y < height; ++y)
    {
        for(MapCoord x = 0; x < width; ++x)
        {
            MapPoint pt(x, y);
            UpdateBorderVertex(pt, gwv);
        }
    }
}
/**
 *  erzeugt die Terrain-Vertices.
 *
 *  @author OLiver
 */
void TerrainRenderer::GenerateVertices(const GameWorldViewer * gwv)
{
	delete[] vertices;
	vertices = new Vertex[width * height];
	memset(vertices, 0, sizeof(Vertex) * width * height);

	// Terrain generieren
	for(unsigned short y = 0; y < height; ++y)
	{
		for(unsigned short x = 0; x < width; ++x)
		{
			UpdateVertexPos(x,y,gwv);
			UpdateVertexColor(x,y,gwv);
			UpdateVertexTerrain(x,y,gwv);
		}
	}

	// Ränder generieren
	for(unsigned short y = 0; y < height; ++y)
	{
		for(unsigned short x = 0; x < width; ++x)
		{
			UpdateBorderVertex(x,y,gwv);
		}
	}
}
示例#3
0
/**
 *  erzeugt die Terrain-Vertices.
 *
 *  @author OLiver
 */
void TerrainRenderer::GenerateVertices(const GameWorldViewer* gwv)
{
    delete[] vertices;
    vertices = new Vertex[width * height];
    memset(vertices, 0, sizeof(Vertex) * width * height);

    // Terrain generieren
    for(MapCoord y = 0; y < height; ++y)
    {
        for(MapCoord x = 0; x < width; ++x)
        {
            MapPoint pt(x, y);
            UpdateVertexPos(pt, gwv);
            UpdateVertexColor(pt, gwv);
            UpdateVertexTerrain(pt, gwv);
        }
    }

    // Ränder generieren
    for(MapCoord y = 0; y < height; ++y)
    {
        for(MapCoord x = 0; x < width; ++x)
        {
            MapPoint pt(x, y);
            UpdateBorderVertex(pt, gwv);
        }
    }
}