console: wip texture decode API
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user