@@ -187,8 +187,8 @@ class KeyFrames extends Mask {
case AnchorPoint:
var bmp = Std.instance(l.spr, h2d.Bitmap);
if( bmp != null ) {
- bmp.tile.dx = -Std.int(calcValue(0));
- bmp.tile.dy = -Std.int(calcValue(1));
+ bmp.tile.dx = -calcValue(0);
+ bmp.tile.dy = -calcValue(1);
}
case XPosition:
l.spr.x = calcValue(0);
@@ -511,7 +511,7 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I
target = new Tile(tex,0, 0, width, height);
engine.begin();
- engine.setRenderZone(Std.int(target.x), Std.int(target.y), Std.int(target.width), Std.int(target.height));
+ engine.setRenderZone(Std.int(target.x), Std.int(target.y), hxd.Math.ceil(target.width), hxd.Math.ceil(target.height));
var tex = target.getTexture();
engine.pushTarget(tex);
@@ -17,7 +17,7 @@ class Ambient extends AbstractMask {
inline function set_invert(v) return pass.shader.maskInvert = v;
override function draw( ctx : RenderContext, t : h2d.Tile ) {
- var out = ctx.textures.allocTarget("ambientTmp", Std.int(t.width), Std.int(t.height), false);
+ var out = ctx.textures.allocTarget("ambientTmp", hxd.Math.ceil(t.width), hxd.Math.ceil(t.height), false);
pass.apply(t.getTexture(), out, getMaskTexture(t), maskMatrix);
return h2d.Tile.fromTexture(out);
@@ -20,7 +20,7 @@ class Bloom extends Blur {
inline function set_power(v) return bloom.shader.power = v;
- var dst = ctx.textures.allocTarget("dest", Std.int(t.width), Std.int(t.height), false);
+ var dst = ctx.textures.allocTarget("dest", hxd.Math.ceil(t.width), hxd.Math.ceil(t.height), false);
h3d.pass.Copy.run(t.getTexture(), dst);
var blurred = super.draw(ctx, t);
bloom.shader.texture = blurred.getTexture();
@@ -16,7 +16,7 @@ class ColorMatrix extends Filter {
inline function set_matrix(m) return pass.matrix = m;
- var tout = ctx.textures.allocTarget("colorMatrixOut", Std.int(t.width), Std.int(t.height), false);
+ var tout = ctx.textures.allocTarget("colorMatrixOut", hxd.Math.ceil(t.width), hxd.Math.ceil(t.height), false);
pass.apply(t.getTexture(), tout);
return h2d.Tile.fromTexture(tout);
@@ -28,7 +28,7 @@ class Displacement extends Filter {
- var out = ctx.textures.allocTarget("displacementOutput", Std.int(t.width), Std.int(t.height), false);
+ var out = ctx.textures.allocTarget("displacementOutput", hxd.Math.ceil(t.width), hxd.Math.ceil(t.height), false);
ctx.engine.pushTarget(out);
var s = disp.shader;
s.texture = t.getTexture();
@@ -21,7 +21,7 @@ class DropShadow extends Glow {
setParams();
- var save = ctx.textures.allocTarget("glowSave", Std.int(t.width), Std.int(t.height), false);
+ var save = ctx.textures.allocTarget("glowSave", hxd.Math.ceil(t.width), hxd.Math.ceil(t.height), false);
h3d.pass.Copy.run(t.getTexture(), save, None);
pass.apply(ctx, save);
var dx = Math.round(Math.cos(angle) * distance);
@@ -25,7 +25,7 @@ class Glow extends Blur {
var tex = t.getTexture();
var old = tex.filter;
h3d.pass.Copy.run(tex, save, None);
tex.filter = Linear;
pass.apply(ctx, tex);
@@ -42,7 +42,7 @@ class Mask extends AbstractMask {
var mask = getMaskTexture(t);
if( mask == null )
throw "Mask should be rendered before masked object";
- var out = ctx.textures.allocTarget("maskTmp", Std.int(t.width), Std.int(t.height), false);
+ var out = ctx.textures.allocTarget("maskTmp", hxd.Math.ceil(t.width), hxd.Math.ceil(t.height), false);
pass.shader.texture = t.getTexture();
pass.shader.mask = getMaskTexture(t);
@@ -24,7 +24,7 @@ class Shader< T:h3d.shader.ScreenShader > extends Filter {
function get_shader() return pass.shader;
- var out = ctx.textures.allocTarget("shaderTmp", Std.int(t.width), Std.int(t.height), false);
+ var out = ctx.textures.allocTarget("shaderTmp", hxd.Math.ceil(t.width), hxd.Math.ceil(t.height), false);
Reflect.setField(shader, textureParam + "__", t.getTexture());
if( nearest ) t.getTexture().filter = Nearest;
@@ -154,7 +154,7 @@ class Benchmark extends h2d.Graphics {
function syncTip(s:StatsObject) {
tip.text = s.name+"( " + Std.int(s.time / 1e6) + "." + StringTools.lpad(""+(Std.int(s.time/1e4)%100),"0",2) + " ms " + s.drawCalls + " draws )";
var tw = tip.textWidth;
- var tx = s.xPos + ((s.xSize - tw) >> 1);
+ var tx = s.xPos + ((s.xSize - tw) * .5);
if( tx + tw > curWidth ) tx = curWidth - tw;
if( tx < 0 ) tx = 0;
if( hxd.Math.abs(tip.x - tx) > 5 ) tip.x = tx;
@@ -294,7 +294,7 @@ class Benchmark extends h2d.Graphics {
l.visible = true;
l.textColor = textColor;
l.text = s.name;
- l.x = xPos + ((xSize - l.textWidth) >> 1);
+ l.x = xPos + ((xSize - l.textWidth) * .5);
s.xPos = xPos;
@@ -112,7 +112,7 @@ class PadUI extends h2d.Object {
buttons = new Map();
- var x = 0;
+ var x = 0.;
for( n in ["A","B","X","Y","LB","RB","LT","RT","back","start","dpadUp","dpadDown","dpadLeft","dpadRight"] ){
var t = new h2d.Text(fnt,this);
x += 20;
@@ -120,7 +120,7 @@ class PadUI extends h2d.Object {
t.y = 140;
t.text = n;
t.alpha = 0.1;
- var bg = new h2d.Bitmap(h2d.Tile.fromColor(0xFFFFFF, t.textWidth, 8), t);
+ var bg = new h2d.Bitmap(h2d.Tile.fromColor(0xFFFFFF, hxd.Math.ceil(t.textWidth), 8), t);
bg.y = 10;
bg.alpha = 0;
buttons.set(n, { tf : t, bg : bg });