Skip to content

Commit

Permalink
Merge pull request openfl#1 from openfl/master
Browse files Browse the repository at this point in the history
Sync with master
  • Loading branch information
muguangyi committed May 20, 2015
2 parents 822056b + 88020b0 commit a61e139
Show file tree
Hide file tree
Showing 98 changed files with 5,540 additions and 1,950 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ before_script:
- haxelib run munit gen

script:
- haxelib run lime test neko
#- haxelib run lime test neko
#- haxelib run lime test neko -Ddisable-cffi
- haxelib run lime build neko
- haxelib run lime build neko -Ddisable-cffi
- haxelib run lime test neko -Dlegacy
- haxelib run lime test neko -Dhybrid
- haxelib run munit test -as3 -norun
- haxelib run munit test -browser phantomjs
- haxelib run lime test linux
Expand Down
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,70 @@
3.0.6 (05/14/2015)
------------------

* Fix regression in event dispatch behavior


3.0.5 (05/13/2015)
------------------

* Improved formatting for thrown errors on HTML5
* Separated the behavior of event preventDefault from stopPropagation
* Fixed the event dispatch order for DisplayObjectContainer
* Fixed support for -Dhybrid using latest Lime release


3.0.4 (05/12/2015)
------------------

* Improved accuracy of HTML5 canvas Graphics renderer
* Added support for window hardware=false
* Added initial Cairo renderer support
* Made big improvements to HTML5 canvas TextField input
* Added MouseEvent.MOUSE_LEAVE event support
* Improved HTML5 canvas linear gradient support
* Improved Stage3D texture uploads
* Implemented BitmapData.getColorBoundsRect
* Improved checks for invalid BitmapData in Assets
* Improved beginBitmapFill for GL Graphics
* Improved pixel snapping support for GL rendering
* Improved cleanup of native sound channels
* Improved compatibility between Stage3D and internal GL rendering
* Fixed HTML5 canvas scrollRect
* Fixed handling of embedded fonts in some cases
* Fixed some issues with bounds calculations
* Fixed support for initial SoundTransform volume on native
* Improved non-blocking HTTPS support (legacy)


3.0.3 (04/21/2015)
------------------

* Improved hit test when there are interactive and non-interactive matches
* Improved accuracy of text metrics
* Improved accuracy of GL TextField glyph positioning
* Added wordWrap support to canvas TextField
* Added handling of stage.focus on mouse down
* Fixed the start time and loop count for native sounds
* Fixed the behavior of sprite.contains to loop recursively
* Fixed upside-down BitmapData in some cases when using GL bitmapData.draw
* Fixed layering of GL bitmapData.draw over existing BitmapData contents
* Improved performance of getRGBAPixels (legacy)


3.0.2 (04/15/2015)
------------------

* Improved handling of keyCode/charCode in keyboard events
* Improved the frame timing when using hybrid mode
* Improved the font lookup behavior of GL TextField
* Added better auto-size left support to GL TextField
* Added basic text line metrics in TextField
* Added support for compilation with -Ddisable-cffi
* Added dynamic DisplayObject field support for MovieClip
* Fixed UVs when using drawTiles with bitmapData.draw (GL)
* Fixed blendMode setting when using bitmapData.draw (GL)


3.0.1 (04/09/2015)
------------------

Expand Down
15 changes: 5 additions & 10 deletions haxe/Timer.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package haxe;
#if (macro || (!neko && !cpp))
#if (macro || (!neko && !cpp && !nodejs))


// Original haxe.Timer class
Expand Down Expand Up @@ -41,7 +41,7 @@ package haxe;
the child class.
**/
class Timer {
#if (flash || js || java)
#if (flash || js || java || python)

#if (flash || js)
private var id : Null<Int>;
Expand All @@ -62,12 +62,9 @@ class Timer {
The accuracy of this may be platform-dependent.
**/
public function new( time_ms : Int ){
#if flash9
#if flash
var me = this;
id = untyped __global__["flash.utils.setInterval"](function() { me.run(); },time_ms);
#elseif flash
var me = this;
id = untyped _global["setInterval"](function() { me.run(); },time_ms);
#elseif js
var me = this;
id = untyped setInterval(function() me.run(),time_ms);
Expand All @@ -89,10 +86,8 @@ class Timer {
#if (flash || js)
if( id == null )
return;
#if flash9
#if flash
untyped __global__["flash.utils.clearInterval"](id);
#elseif flash
untyped _global["clearInterval"](id);
#elseif js
untyped clearInterval(id);
#end
Expand Down Expand Up @@ -190,7 +185,7 @@ private class TimerTask extends java.util.TimerTask {
this.timer = timer;
}

@:overload public function run():Void {
@:overload override public function run():Void {
timer.run();
}
}
Expand Down
4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"tags": [],
"description": "The \"Open Flash Library\" for fast 2D development",
"version": "3.0.1",
"releasenote": "Improved -Dhybrid support",
"version": "3.0.6",
"releasenote": "Minor fix",
"contributors": [ "singmajesty" ]
}
9 changes: 6 additions & 3 deletions openfl/Assets.hx
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ class Assets {

#else

return (bitmapData != null);
return (bitmapData != null && #if !lime_hybrid bitmapData.__image != null #else bitmapData.__handle != null #end);

#end
#end
Expand All @@ -442,7 +442,7 @@ class Assets {
private static function isValidSound (sound:Sound):Bool {

#if (tools && !display)
#if (cpp || neko)
#if (cpp || neko || nodejs)

return true;
//return (sound.__handle != null && sound.__handle != 0);
Expand Down Expand Up @@ -1325,7 +1325,10 @@ class Assets {

case EConst(CString(filePath)):

path = Context.resolvePath (filePath);
path = filePath;
if (!sys.FileSystem.exists(filePath)) {
path = Context.resolvePath (filePath);
}

default:

Expand Down
6 changes: 3 additions & 3 deletions openfl/Lib.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import openfl.display.MovieClip;
import openfl.display.Stage;
import openfl.net.URLRequest;

#if js
#if (js && html5)
import js.Browser;
#end

Expand Down Expand Up @@ -96,7 +96,7 @@ import js.Browser;

}

#if js
#if (js && html5)
Browser.window.open (request.url, target);
#elseif flash
return flash.Lib.getURL (request, target);
Expand All @@ -120,7 +120,7 @@ import js.Browser;

public static function preventDefaultTouchMove ():Void {

#if js
#if (js && html5)
Browser.document.addEventListener ("touchmove", function (evt:js.html.Event):Void {

evt.preventDefault ();
Expand Down
8 changes: 7 additions & 1 deletion openfl/_internal/aglsl/AGLSLParser.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ class AGLSLParser {

#if html5
header += "precision highp float;\n";
#elseif (android || ios)
if (desc.header.type == "vertex") {

header += "precision highp float;\n";

}
#end

var tag = desc.header.type.charAt (0); //TODO
Expand Down Expand Up @@ -395,4 +401,4 @@ class AGLSLParser {
}


}
}
45 changes: 45 additions & 0 deletions openfl/_internal/renderer/AbstractMaskManager.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package openfl._internal.renderer;


import openfl.display.*;
import openfl.geom.*;

@:access(openfl.display.DisplayObject)
@:keep


class AbstractMaskManager {


private var renderSession:RenderSession;


public function new (renderSession:RenderSession) {

this.renderSession = renderSession;

}


public function pushMask (mask:DisplayObject):Void {



}


public function pushRect (rect:Rectangle, transform:Matrix):Void {



}


public function popMask ():Void {



}


}
7 changes: 7 additions & 0 deletions openfl/_internal/renderer/AbstractRenderer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ class AbstractRenderer {



}


public function setViewport (x:Int, y:Int, width:Int, height:Int):Void {



}


Expand Down
18 changes: 7 additions & 11 deletions openfl/_internal/renderer/RenderSession.hx
Original file line number Diff line number Diff line change
@@ -1,50 +1,46 @@
package openfl._internal.renderer; #if !flash


import lime.graphics.CairoRenderContext;
import lime.graphics.CanvasRenderContext;
import lime.graphics.DOMRenderContext;
import lime.graphics.GLRenderContext;
import lime.math.Matrix4;
import lime.graphics.opengl.GLFramebuffer;
import openfl._internal.renderer.opengl.utils.BlendModeManager;
import openfl._internal.renderer.opengl.utils.FilterManager;
import openfl._internal.renderer.opengl.utils.MaskManager;
import openfl._internal.renderer.opengl.utils.ShaderManager;
import openfl._internal.renderer.opengl.utils.SpriteBatch;
import openfl._internal.renderer.opengl.utils.StencilManager;
import openfl.display.BlendMode;
import openfl.geom.Matrix;
import openfl.geom.Point;


class RenderSession {


public var cairo:CairoRenderContext;
public var context:CanvasRenderContext;
public var element:DOMRenderContext;
public var gl:GLRenderContext;
//public var glProgram:ShaderProgram;
//public var mask:Bool;
//public var maskManager:MaskManager;
public var projectionMatrix:Matrix4;
public var renderer:AbstractRenderer;
//public var scaleMode:ScaleMode;
public var roundPixels:Bool;
public var transformProperty:String;
public var transformOriginProperty:String;
public var vendorPrefix:String;
public var z:Int;
//public var smoothProperty:Null<Bool> = null;
public var projectionMatrix:Matrix;

public var drawCount:Int;
public var currentBlendMode:BlendMode;
public var projection:Point;
public var offset:Point;

public var shaderManager:ShaderManager;
public var maskManager:#if neko MaskManager #else Dynamic #end;
public var maskManager:AbstractMaskManager;
public var filterManager:FilterManager;
public var blendModeManager:BlendModeManager;
public var spriteBatch:SpriteBatch;
public var stencilManager:StencilManager;
public var defaultFramebuffer:GLFramebuffer;


public function new () {
Expand Down
Loading

0 comments on commit a61e139

Please sign in to comment.