Fixes for vdynamic return types

This commit is contained in:
Joshua Granick
2019-03-14 12:34:08 -07:00
parent a482c14d5c
commit 3b9ca3a770
11 changed files with 499 additions and 215 deletions

View File

@@ -1249,10 +1249,7 @@ class NativeCFFI
return 0;
}
@:hlNative("lime", "lime_window_get_display_mode") private static function lime_window_get_display_mode(handle:CFFIPointer):Dynamic
{
return null;
}
@:hlNative("lime", "lime_window_get_display_mode") private static function lime_window_get_display_mode(handle:CFFIPointer, result:DisplayMode):Void {}
@:hlNative("lime", "lime_window_get_height") private static function lime_window_get_height(handle:CFFIPointer):Int
{
@@ -1312,10 +1309,7 @@ class NativeCFFI
@:hlNative("lime", "lime_window_set_cursor") private static function lime_window_set_cursor(handle:CFFIPointer, cursor:Int):Void {}
@:hlNative("lime", "lime_window_set_display_mode") private static function lime_window_set_display_mode(handle:CFFIPointer,
displayMode:DisplayMode):DisplayMode
{
return null;
}
displayMode:DisplayMode, result:DisplayMode):Void {}
@:hlNative("lime", "lime_window_set_fullscreen") private static function lime_window_set_fullscreen(handle:CFFIPointer, fullscreen:Bool):Bool
{

View File

@@ -267,12 +267,16 @@ class NativeWindow
if (handle != null)
{
#if (!macro && lime_cffi)
#if hl
NativeCFFI.lime_window_get_display_mode(handle, displayMode);
#else
var data:Dynamic = NativeCFFI.lime_window_get_display_mode(handle);
displayMode.width = data.width;
displayMode.height = data.height;
displayMode.pixelFormat = data.pixelFormat;
displayMode.refreshRate = data.refreshRate;
#end
#end
}
return displayMode;
@@ -501,12 +505,16 @@ class NativeWindow
if (handle != null)
{
#if (!macro && lime_cffi)
#if hl
NativeCFFI.lime_window_set_display_mode(handle, value, displayMode);
#else
var data:Dynamic = NativeCFFI.lime_window_set_display_mode(handle, value);
displayMode.width = data.width;
displayMode.height = data.height;
displayMode.pixelFormat = data.pixelFormat;
displayMode.refreshRate = data.refreshRate;
#end
#end
}
return displayMode;

View File

@@ -170,7 +170,11 @@ class System
{
var display = new Display();
display.id = id;
#if hl
display.name = @:privateAccess String.fromUTF8(displayInfo.name);
#else
display.name = displayInfo.name;
#end
display.bounds = new Rectangle(displayInfo.bounds.x, displayInfo.bounds.y, displayInfo.bounds.width, displayInfo.bounds.height);
#if ios
@@ -195,7 +199,12 @@ class System
var displayMode;
for (mode in cast(displayInfo.supportedModes, Array<Dynamic>))
#if hl
var supportedModes:hl.NativeArray<Dynamic> = displayInfo.supportedModes;
#else
var supportedModes:Array<Dynamic> = displayInfo.supportedModes;
#end
for (mode in supportedModes)
{
displayMode = new DisplayMode(mode.width, mode.height, mode.refreshRate, mode.pixelFormat);
display.supportedModes.push(displayMode);

View File

@@ -104,6 +104,12 @@ class Font
#if (lime_cffi && !macro)
if (src == null) throw "Uninitialized font handle.";
var data:Dynamic = NativeCFFI.lime_font_outline_decompose(src, 1024 * 20);
#if hl
if (data != null) {
data.family_name = @:privateAccess String.fromUCS2(data.family_name);
data.style_name = @:privateAccess String.fromUTF8(data.style_name);
}
#end
return data;
#else
return null;