Sfoglia il codice sorgente

use native format for 2d content

Nicolas Cannasse 4 anni fa
parent
commit
3c8e99a6c8
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 1 1
      h2d/Tile.hx
  2. 1 1
      hxd/res/FontBuilder.hx

+ 1 - 1
h2d/Tile.hx

@@ -423,7 +423,7 @@ class Tile {
 	**/
 	public static function fromPixels( pixels : hxd.Pixels ) : Tile {
 		var pix2 = pixels.makeSquare(true);
-		var t = h3d.mat.Texture.fromPixels(pix2);
+		var t = h3d.mat.Texture.fromPixels(pix2, h3d.mat.Texture.nativeFormat);
 		if( pix2 != pixels ) pix2.dispose();
 		return new Tile(t, 0, 0, pixels.width, pixels.height);
 	}

+ 1 - 1
hxd/res/FontBuilder.hx

@@ -120,7 +120,7 @@ class FontBuilder {
 		}
 
 		if( innerTex == null ) {
-			innerTex = h3d.mat.Texture.fromPixels(pixels);
+			innerTex = h3d.mat.Texture.fromPixels(pixels, h3d.mat.Texture.nativeFormat);
 			font.tile = h2d.Tile.fromTexture(innerTex);
 			for( t in all )
 				t.setTexture(innerTex);