ncannasse 11 лет назад
Родитель
Сommit
0045fdd2af
1 измененных файлов с 18 добавлено и 18 удалено
  1. 18 18
      h3d/pass/Border.hx

+ 18 - 18
h3d/pass/Border.hx

@@ -27,33 +27,33 @@ private class BorderShader extends hxsl.Shader {
 
 class Border extends ScreenFx<BorderShader> {
 
-	public function new( size : Int ) {
+	public function new( width : Int, height : Int, size : Int = 1 ) {
 		super(new BorderShader());
 
 		var bbuf = new hxd.FloatBuffer();
 		inline function add(x, y) {
-			bbuf.push((x / size) * 2 - 1);
-			bbuf.push(1 - (y / size) * 2);
+			bbuf.push((x / width) * 2 - 1);
+			bbuf.push(1 - (y / height) * 2);
 		}
 		add(0, 0);
-		add(size, 0);
-		add(0, 1);
-		add(size, 1);
-
-		add(0, 0);
-		add(1, 0);
+		add(width, 0);
 		add(0, size);
-		add(1, size);
+		add(width, size);
 
-		add(0, size-1);
-		add(size, size-1);
-		add(0, size);
-		add(size, size);
-
-		add(size-1, 0);
+		add(0, 0);
 		add(size, 0);
-		add(size-1, size);
-		add(size, size);
+		add(0, height);
+		add(size, height);
+
+		add(0, height-size);
+		add(width, height-size);
+		add(0, height);
+		add(width, height);
+
+		add(width-size, 0);
+		add(width, 0);
+		add(width-size, height);
+		add(width, height);
 
 		var plan = new h3d.prim.RawPrimitive(engine, bbuf, 2);
 		plan.buffer.flags.unset(Triangles);