console: wip texture decode API

This commit is contained in:
James Gray
2015-07-23 18:52:57 -05:00
parent 99b3219b45
commit 9b7a3da5d8
2 changed files with 9 additions and 4 deletions

View File

@@ -1029,7 +1029,11 @@ class Image {
#if 1
cpp.NativeArray.setSize (data, w*h*4);
var size = w * h * 4;
cpp.NativeArray.setSize (data, size);
td.decode (cpp.Pointer.arrayElem (data, 0), size);
/*
{
var dest:cpp.Pointer<cpp.UInt32> = cast cpp.Pointer.arrayElem (data, 0);
var src:cpp.Pointer<cpp.UInt32> = cast td.pointer;
@@ -1038,6 +1042,7 @@ class Image {
dest[i] = src[i];
}
}
*/
td.release ();
#else

View File

@@ -19,13 +19,14 @@ extern class TextureData {
public var width (get, never):Int;
public var height (get, never):Int;
public var pointer (get, never):Pointer<UInt8>;
// fromFile loads texture data from the named file.
@:native("lime::ConsoleTextureData::fromFile")
public static function fromFile (name:String):TextureData;
// decode does any decompression or whatever is necessary to output lime's
// standard RGBA.
public function decode (dest:Pointer<UInt8>, destSize:Int):Void;
// release releases the texture data.
public function release ():Void;
@@ -34,7 +35,6 @@ extern class TextureData {
private function get_valid ():Bool;
private function get_width ():Int;
private function get_height ():Int;
private function get_pointer ():Pointer<UInt8>;
}