From cc9ff9b8829fb3c9e26544d688764c16cefb7604 Mon Sep 17 00:00:00 2001 From: underscorediscovery Date: Wed, 11 Dec 2013 21:59:10 -0330 Subject: [PATCH] Wrapper; Window; passing all of the window flags for config. Wrapper; Float32Array; The constructor was using length as a bytelength, instead of vert length (to match the webGL spec) --- lime/Lime.hx | 2 +- lime/WindowHandler.hx | 16 ++++++++-------- lime/utils/ArrayBufferView.hx | 3 +-- lime/utils/Float32Array.hx | 8 ++++---- templates/haxe/ApplicationMain.hx | 2 +- templates/html5/haxe/ApplicationMain.hx | 13 ++++++++++--- 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/lime/Lime.hx b/lime/Lime.hx index 98c8e6a56..79740cf59 100644 --- a/lime/Lime.hx +++ b/lime/Lime.hx @@ -64,7 +64,7 @@ class Lime { config = _config; host = _main_; - _debug(':: lime :: initializing -'); + _debug(':: lime :: initializing - '); _debug(':: lime :: Creating window at ' + config.width + 'x' + config.height); //default to 60 fps diff --git a/lime/WindowHandler.hx b/lime/WindowHandler.hx index 7337f2989..982ec1e5e 100644 --- a/lime/WindowHandler.hx +++ b/lime/WindowHandler.hx @@ -38,14 +38,14 @@ class WindowHandler { //optional flags - ( lib.config.fullscreen ? Window.FULLSCREEN : 0) | - ( lib.config.borderless ? Window.BORDERLESS : 0) | - ( lib.config.resizable ? Window.RESIZABLE : 0) | - ( lib.config.AA ? Window.HW_AA : 0) | - ( lib.config.AA_HIRES ? Window.HW_AA_HIRES : 0) | - ( lib.config.depth_buffer ? Window.DEPTH_BUFFER : 0) | - ( lib.config.stencil_buffer ? Window.STENCIL_BUFFER : 0) | - ( lib.config.vsync ? Window.VSYNC : 0), + ( lib.config.fullscreen ? Window.FULLSCREEN : 0) | + ( lib.config.borderless ? Window.BORDERLESS : 0) | + ( lib.config.resizable ? Window.RESIZABLE : 0) | + ( lib.config.antialiasing == 2 ? Window.HW_AA : 0) | + ( lib.config.antialiasing == 4 ? Window.HW_AA_HIRES : 0) | + ( lib.config.depth_buffer ? Window.DEPTH_BUFFER : 0) | + ( lib.config.stencil_buffer ? Window.STENCIL_BUFFER : 0) | + ( lib.config.vsync ? Window.VSYNC : 0), lib.config.title, //title null //icon diff --git a/lime/utils/ArrayBufferView.hx b/lime/utils/ArrayBufferView.hx index 2f8ce4c52..1e19bb835 100644 --- a/lime/utils/ArrayBufferView.hx +++ b/lime/utils/ArrayBufferView.hx @@ -56,9 +56,8 @@ package lime.utils; byteLength = buffer.length - byteOffset; } else { - + byteLength = length; - if (byteLength + byteOffset > buffer.length) { throw ("Invalid buffer length"); diff --git a/lime/utils/Float32Array.hx b/lime/utils/Float32Array.hx index dc8902c9d..2bf64abb3 100644 --- a/lime/utils/Float32Array.hx +++ b/lime/utils/Float32Array.hx @@ -19,14 +19,14 @@ package lime.utils; public function new (bufferOrArray:Dynamic, start:Int = 0, length:Null = null) { BYTES_PER_ELEMENT = 4; - + if (Std.is (bufferOrArray, Int)) { super (Std.int (bufferOrArray) * BYTES_PER_ELEMENT); this.length = bufferOrArray; } else if (Std.is (bufferOrArray, Array)) { - + var floats:Array = bufferOrArray; if (length != null) { @@ -56,8 +56,8 @@ package lime.utils; } } else { - - super (bufferOrArray, start, length); + + super (bufferOrArray, start, length << 2 ); if ((byteLength & 0x03) > 0) { diff --git a/templates/haxe/ApplicationMain.hx b/templates/haxe/ApplicationMain.hx index 1fd55216e..b062d1c46 100644 --- a/templates/haxe/ApplicationMain.hx +++ b/templates/haxe/ApplicationMain.hx @@ -17,7 +17,7 @@ class ApplicationMain { fullscreen : ::WIN_FULLSCREEN::, resizable : ::WIN_RESIZABLE::, borderless : ::WIN_BORDERLESS::, - aliasing : ::WIN_ANTIALIASING::, + antialiasing : ::WIN_ANTIALIASING::, stencil_buffer : ::WIN_STENCIL_BUFFER::, depth_buffer : ::WIN_DEPTH_BUFFER::, vsync : ::WIN_VSYNC::, diff --git a/templates/html5/haxe/ApplicationMain.hx b/templates/html5/haxe/ApplicationMain.hx index 79d542507..8ac278a34 100755 --- a/templates/html5/haxe/ApplicationMain.hx +++ b/templates/html5/haxe/ApplicationMain.hx @@ -16,9 +16,16 @@ //Create the config from the project.nmml info var config = { - width : ::WIN_WIDTH::, - height : ::WIN_HEIGHT::, - title : "::APP_TITLE::" + fullscreen : ::WIN_FULLSCREEN::, + resizable : ::WIN_RESIZABLE::, + borderless : ::WIN_BORDERLESS::, + antialiasing : ::WIN_ANTIALIASING::, + stencil_buffer : ::WIN_STENCIL_BUFFER::, + depth_buffer : ::WIN_DEPTH_BUFFER::, + vsync : ::WIN_VSYNC::, + width : ::WIN_WIDTH::, + height : ::WIN_HEIGHT::, + title : "::APP_TITLE::" }; //Start up