idTech4.Renderer.idGuiModel.DrawStretchPicture C# (CSharp) Method

DrawStretchPicture() public method

public DrawStretchPicture ( Vertex vertices, int indexes, idMaterial material, bool clip, float minX, float minY, float maxX, float maxY ) : void
vertices Vertex
indexes int
material idMaterial
clip bool
minX float
minY float
maxX float
maxY float
return void
		public void DrawStretchPicture(Vertex[] vertices, int[] indexes, idMaterial material, bool clip, float minX, float minY, float maxX, float maxY)
		{
			if((vertices == null) || (indexes == null) || (material == null))
			{
				return;
			}

			// break the current surface if we are changing to a new material
			if(material != _surface.Material)
			{
				if(_surface.VertexCount > 0)
				{
					AdvanceSurface();
				}

				_surface.Material = material;
				_surface.Material.EnsureNotPurged(); // in case it was a gui item started before a level change
			}

			clip = false;

			// add the verts and indexes to the current surface
			if(clip == true)
			{
				idConsole.WriteLine("idGuiModle.DrawStretchPicture clip");

				/*int i, j;

		// FIXME:	this is grim stuff, and should be rewritten if we have any significant
		//			number of guis asking for clipping
				 
		idFixedWinding w;
		for ( i = 0; i < indexCount; i += 3 ) {
			w.Clear();
			w.AddPoint(idVec5(dverts[dindexes[i]].xyz.x, dverts[dindexes[i]].xyz.y, dverts[dindexes[i]].xyz.z, dverts[dindexes[i]].st.x, dverts[dindexes[i]].st.y));
			w.AddPoint(idVec5(dverts[dindexes[i+1]].xyz.x, dverts[dindexes[i+1]].xyz.y, dverts[dindexes[i+1]].xyz.z, dverts[dindexes[i+1]].st.x, dverts[dindexes[i+1]].st.y));
			w.AddPoint(idVec5(dverts[dindexes[i+2]].xyz.x, dverts[dindexes[i+2]].xyz.y, dverts[dindexes[i+2]].xyz.z, dverts[dindexes[i+2]].st.x, dverts[dindexes[i+2]].st.y));

			for ( j = 0; j < 3; j++ ) {
				if ( w[j].x < min_x || w[j].x > max_x ||
					w[j].y < min_y || w[j].y > max_y ) {
					break;
				}
			}
			if ( j < 3 ) {
				idPlane p;
				p.Normal().y = p.Normal().z = 0.0f; p.Normal().x = 1.0f; p.SetDist( min_x );
				w.ClipInPlace( p );
				p.Normal().y = p.Normal().z = 0.0f; p.Normal().x = -1.0f; p.SetDist( -max_x );
				w.ClipInPlace( p );
				p.Normal().x = p.Normal().z = 0.0f; p.Normal().y = 1.0f; p.SetDist( min_y );
				w.ClipInPlace( p );
				p.Normal().x = p.Normal().z = 0.0f; p.Normal().y = -1.0f; p.SetDist( -max_y );
				w.ClipInPlace( p );
			}

			int	numVerts = verts.Num();
			verts.SetNum( numVerts + w.GetNumPoints(), false );
			for ( j = 0 ; j < w.GetNumPoints() ; j++ ) {
				idDrawVert *dv = &verts[numVerts+j];

				dv->xyz.x = w[j].x;
				dv->xyz.y = w[j].y;
				dv->xyz.z = w[j].z;
				dv->st.x = w[j].s;
				dv->st.y = w[j].t;
				dv->normal.Set(0, 0, 1);
				dv->tangents[0].Set(1, 0, 0);
				dv->tangents[1].Set(0, 1, 0);
			}
			surf->numVerts += w.GetNumPoints();

			for ( j = 2; j < w.GetNumPoints(); j++ ) {
				indexes.Append( numVerts - surf->firstVert );
				indexes.Append( numVerts + j - 1 - surf->firstVert );
				indexes.Append( numVerts + j - surf->firstVert );
				surf->numIndexes += 3;
			}
		}*/

			}
			else
			{
				int currentVertexCount = _vertices.Count;
				int currentIndexCount = _indexes.Count;
				int vertexCount = vertices.Length;
				int indexCount = indexes.Length;

				_surface.VertexCount += vertexCount;
				_surface.IndexCount += indexCount;

				for(int i = 0; i < indexCount; i++)
				{
					_indexes.Add(currentVertexCount + indexes[i] - _surface.FirstVertex);
				}

				_vertices.AddRange(vertices);
			}
		}

Same methods

idGuiModel::DrawStretchPicture ( float x, float y, float width, float height, float s, float t, float s2, float t2, idMaterial material ) : void