private void RenderGrowableHeight(GUIHost host, int x, int y, int Width, int Height) { if (Height < growableheightparams.minimum_height_pixels) { RenderNormalSprite(host, x, y, Width, Height); } else { if (texture == uint.MaxValue) { return; } Simple2DRenderer simpleRenderer = host.GetSimpleRenderer(); simpleRenderer.SetCurrentTexture(texture); cur_quad.x0 = x; cur_quad.y0 = y; cur_quad.x1 = x + Width; cur_quad.y1 = y + Height; Simple2DRenderer.TexturedQuad curQuad1 = cur_quad; Simple2DRenderer.TexturedQuad curQuad2 = cur_quad; Simple2DRenderer.TexturedQuad curQuad3 = cur_quad; curQuad1.v1 = curQuad1.v0 + growableheightparams.topbordersize_texels; curQuad1.y1 = curQuad1.y0 + growableheightparams.topbordersize_pixels; curQuad3.v0 = curQuad3.v1 - growableheightparams.bottombordersize_texels; curQuad3.y0 = curQuad3.y1 - growableheightparams.bottombordersize_pixels; curQuad2.y0 = curQuad1.y1; curQuad2.v0 = curQuad1.v1; curQuad2.y1 = curQuad3.y0; curQuad2.v1 = curQuad3.v0; simpleRenderer.DrawQuad(curQuad1); simpleRenderer.DrawQuad(curQuad2); simpleRenderer.DrawQuad(curQuad3); } }
private void RenderGrowableWidth(GUIHost host, int x, int y, int Width, int Height) { if (Width < growablewidthparams.minimum_width_pixels) { RenderNormalSprite(host, x, y, Width, Height); } else { if (texture == uint.MaxValue) { return; } Simple2DRenderer simpleRenderer = host.GetSimpleRenderer(); simpleRenderer.SetCurrentTexture(texture); cur_quad.x0 = x; cur_quad.y0 = y; cur_quad.x1 = x + Width; cur_quad.y1 = y + Height; Simple2DRenderer.TexturedQuad curQuad1 = cur_quad; Simple2DRenderer.TexturedQuad curQuad2 = cur_quad; Simple2DRenderer.TexturedQuad curQuad3 = cur_quad; curQuad1.u1 = curQuad1.u0 + growablewidthparams.leftbordersize_texels; curQuad1.x1 = curQuad1.x0 + growablewidthparams.leftbordersize_pixels; curQuad3.u0 = curQuad3.u1 - growablewidthparams.rightbordersize_texels; curQuad3.x0 = curQuad3.x1 - growablewidthparams.rightbordersize_pixels; curQuad2.x0 = curQuad1.x1; curQuad2.u0 = curQuad1.u1; curQuad2.x1 = curQuad3.x0; curQuad2.u1 = curQuad3.u0; simpleRenderer.DrawQuad(curQuad1); simpleRenderer.DrawQuad(curQuad2); simpleRenderer.DrawQuad(curQuad3); } }
private void RenderNormalSprite(GUIHost host, int x, int y, int Width, int Height) { if (texture == uint.MaxValue) { return; } Simple2DRenderer simpleRenderer = host.GetSimpleRenderer(); simpleRenderer.SetCurrentTexture(texture); cur_quad.x0 = x; cur_quad.y0 = y; cur_quad.x1 = x + Width; cur_quad.y1 = y + Height; simpleRenderer.DrawQuad(cur_quad); }
private void RenderGrowable(GUIHost host, int x, int y, int Width, int Height) { if (Width < growablewidthparams.minimum_width_pixels || Height < growableheightparams.minimum_height_pixels) { RenderNormalSprite(host, x, y, Width, Height); } else { if (texture == uint.MaxValue) { return; } Simple2DRenderer simpleRenderer = host.GetSimpleRenderer(); simpleRenderer.SetCurrentTexture(texture); cur_quad.x0 = x; cur_quad.y0 = y; cur_quad.x1 = x + Width; cur_quad.y1 = y + Height; Simple2DRenderer.TexturedQuad curQuad1 = cur_quad; Simple2DRenderer.TexturedQuad curQuad2 = cur_quad; Simple2DRenderer.TexturedQuad curQuad3 = cur_quad; curQuad1.u1 = curQuad1.u0 + growablewidthparams.leftbordersize_texels; curQuad1.x1 = curQuad1.x0 + growablewidthparams.leftbordersize_pixels; curQuad3.u0 = curQuad3.u1 - growablewidthparams.rightbordersize_texels; curQuad3.x0 = curQuad3.x1 - growablewidthparams.rightbordersize_pixels; curQuad2.x0 = curQuad1.x1; curQuad2.u0 = curQuad1.u1; curQuad2.x1 = curQuad3.x0; curQuad2.u1 = curQuad3.u0; Simple2DRenderer.TexturedQuad curQuad4 = cur_quad; Simple2DRenderer.TexturedQuad curQuad5 = cur_quad; Simple2DRenderer.TexturedQuad curQuad6 = cur_quad; curQuad4.v1 = curQuad4.v0 + growableheightparams.topbordersize_texels; curQuad4.y1 = curQuad4.y0 + growableheightparams.topbordersize_pixels; curQuad6.v0 = curQuad6.v1 - growableheightparams.bottombordersize_texels; curQuad6.y0 = curQuad6.y1 - growableheightparams.bottombordersize_pixels; curQuad5.y0 = curQuad4.y1; curQuad5.v0 = curQuad4.v1; curQuad5.y1 = curQuad6.y0; curQuad5.v1 = curQuad6.v0; Simple2DRenderer.TexturedQuad textured_quad1 = curQuad1; Simple2DRenderer.TexturedQuad textured_quad2 = curQuad2; Simple2DRenderer.TexturedQuad textured_quad3 = curQuad3; textured_quad1.v0 = textured_quad2.v0 = textured_quad3.v0 = curQuad4.v0; textured_quad1.v1 = textured_quad2.v1 = textured_quad3.v1 = curQuad4.v1; textured_quad1.y0 = textured_quad2.y0 = textured_quad3.y0 = curQuad4.y0; textured_quad1.y1 = textured_quad2.y1 = textured_quad3.y1 = curQuad4.y1; Simple2DRenderer.TexturedQuad textured_quad4 = curQuad1; Simple2DRenderer.TexturedQuad textured_quad5 = curQuad2; Simple2DRenderer.TexturedQuad textured_quad6 = curQuad3; textured_quad4.v0 = textured_quad5.v0 = textured_quad6.v0 = curQuad6.v0; textured_quad4.v1 = textured_quad5.v1 = textured_quad6.v1 = curQuad6.v1; textured_quad4.y0 = textured_quad5.y0 = textured_quad6.y0 = curQuad6.y0; textured_quad4.y1 = textured_quad5.y1 = textured_quad6.y1 = curQuad6.y1; curQuad1.v0 = curQuad2.v0 = curQuad3.v0 = curQuad5.v0; curQuad1.v1 = curQuad2.v1 = curQuad3.v1 = curQuad5.v1; curQuad1.y0 = curQuad2.y0 = curQuad3.y0 = curQuad5.y0; curQuad1.y1 = curQuad2.y1 = curQuad3.y1 = curQuad5.y1; curQuad1.color = cur_quad.color; curQuad2.color = cur_quad.color; curQuad3.color = cur_quad.color; textured_quad1.color = cur_quad.color; textured_quad2.color = cur_quad.color; textured_quad3.color = cur_quad.color; textured_quad4.color = cur_quad.color; textured_quad5.color = cur_quad.color; textured_quad6.color = cur_quad.color; simpleRenderer.DrawQuad(curQuad1); simpleRenderer.DrawQuad(curQuad2); simpleRenderer.DrawQuad(curQuad3); simpleRenderer.DrawQuad(textured_quad1); simpleRenderer.DrawQuad(textured_quad2); simpleRenderer.DrawQuad(textured_quad3); simpleRenderer.DrawQuad(textured_quad4); simpleRenderer.DrawQuad(textured_quad5); simpleRenderer.DrawQuad(textured_quad6); } }