Skip to content

Commit

Permalink
remove UInt
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Jun 6, 2012
1 parent 18b1f7d commit a5cbf64
Show file tree
Hide file tree
Showing 34 changed files with 154 additions and 154 deletions.
2 changes: 1 addition & 1 deletion cpp_build.build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
44
78
2 changes: 1 addition & 1 deletion cpp_build_tests.build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1
2
23 changes: 14 additions & 9 deletions manual-tests-src-cpp/TestMouseEvents.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package ;
import flash.display.Sprite;
import flash.events.MouseEvent;
import nme.display.Shape;
import temperate.core.CMath;
import temperate.minimal.MTween;

class TestMouseEvents extends Sprite
Expand All @@ -15,19 +17,22 @@ class TestMouseEvents extends Sprite
var sprite = new Sprite();
sprite.addEventListener(MouseEvent.CLICK, onClick);
addChild(sprite);
var g = sprite.graphics;
g.beginFill(0x808080);
g.drawRect(0, 0, 200, 200);
g.endFill();
drawRect(sprite.graphics, 0xff808080, 0, 0, 200, 200);

var sprite = new Sprite();
sprite.x = 100;
sprite.y = 100;
sprite.mouseEnabled = false;
addChild(sprite);
var g = sprite.graphics;
g.beginFill(0xff0000, .5);
g.drawRect(0, 0, 200, 200);
drawRect(sprite.graphics, 0x80ff0000, 100, 100, 200, 200);

var shape = new Shape();
addChild(shape);
drawRect(shape.graphics, 0x800000ff, 100, 0, 100, 100);
}

private function drawRect(g, color:Int, x:Float, y:Float, width:Float, height:Float):Void
{
g.beginFill(CMath.getColor(color), CMath.getAlpha(color));
g.drawRect(x, y, width, height);
g.endFill();
}

Expand Down
4 changes: 2 additions & 2 deletions manual-tests-src/TestMCursorManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class TestMCursorManager extends Sprite
//
//----------------------------------------------------------------------------------------------

function newTorus(color:UInt = 0x808080)
function newTorus(color:Int = 0x808080)
{
var torus = new Shape();
var g = torus.graphics;
Expand Down Expand Up @@ -316,7 +316,7 @@ class PriorityBlock extends CVBox
}
}

function newCircle(color:UInt = 0x808080)
function newCircle(color:Int = 0x808080)
{
var shape = new Shape();
var g = shape.graphics;
Expand Down
2 changes: 1 addition & 1 deletion manual-tests-src/TestRasterImageButton.hx
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class TestRasterImageButton extends Sprite
return button;
}

function newImage(width:Int, height:Int, color:UInt):DisplayObject
function newImage(width:Int, height:Int, color:Int):DisplayObject
{
var image = new Shape();
var g = image.graphics;
Expand Down
2 changes: 1 addition & 1 deletion manual-tests-src/TestTooltips.hx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class TestTooltips extends Sprite
return block;
}

function newBlock(x:Int, y:Int, width:Int, height:Int, color:UInt):Sprite
function newBlock(x:Int, y:Int, width:Int, height:Int, color:Int):Sprite
{
var block = new Sprite();
block.x = x;
Expand Down
2 changes: 1 addition & 1 deletion manual-tests-src/bitmaps/BitmapDataInlineSuite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class BitmapDataInlineSuite extends Sprite
addChild(bitmap);
}

private function sourceToString(source:Array<UInt>):String
private function sourceToString(source:Array<Int>):String
{
var text = "[";
var first = true;
Expand Down
8 changes: 4 additions & 4 deletions manual-tests-src/bitmaps/BitmapDataInliner.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import flash.display.BitmapData;

class BitmapDataInliner
{
public static function encode(bd:BitmapData):Array<UInt>
public static function encode(bd:BitmapData):Array<Int>
{
var array:Array<UInt> = [];
var array:Array<Int> = [];
var width = bd.width;
var height = bd.height;
var i = 0;
Expand All @@ -17,14 +17,14 @@ class BitmapDataInliner
}
}
var i = 0;
var result:Array<UInt> = [];
var result:Array<Int> = [];
result[i++] = width;
result[i++] = height;
var isSummState = false;
var countIndex = 0;
var j = 0;
var length = array.length;
var oldColor:UInt = 0x000000;
var oldColor:Int = 0x000000;
while (true)
{
if (isSummState)
Expand Down
4 changes: 2 additions & 2 deletions manual-tests-src/windowApplication/ColorsWindow.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import temperate.minimal.windows.AMWindow;
class ColorsWindow extends AMWindow<Dynamic>
{
var _editorState:EditorState;
var _colors:CButtonSelector<UInt>;
var _colors:CButtonSelector<Int>;

public function new(editorState:EditorState)
{
Expand All @@ -29,7 +29,7 @@ class ColorsWindow extends AMWindow<Dynamic>
_colors = new CButtonSelector(editorState.color, true);
_colors.addEventListener(Event.CHANGE, onColorChange);
var glow:Array<BitmapFilter> = [ new GlowFilter(0xffffff, 1, 4, 4, 10, 1, true) ];
var colors:Array<UInt> = [
var colors:Array<Int> = [
0xeeeeee, 0x000000, 0xff0000, 0x00ff00, 0x0000ff,
0xffff00, 0x00ffff, 0x808080, 0x800000, 0x008000,
0x808000, 0x008080, 0x00ff80, 0x80ff00, 0xff80ff];
Expand Down
4 changes: 2 additions & 2 deletions manual-tests-src/windowApplication/EditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class EditorState

public var colorChanged(default, null):CSignal < Void->Void > ;

public var color(get_color, set_color):UInt;
var _color:UInt;
public var color(get_color, set_color):Int;
var _color:Int;
function get_color()
{
return _color;
Expand Down
4 changes: 2 additions & 2 deletions manual-tests-src/windowApplication/Primitive.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ enum Primitive
LINE_TO(x:Float, y:Float);
ELLIPSE(x:Float, y:Float, width:Float, height:Float);
RECT(x:Float, y:Float, width:Float, height:Float);
LINE_STYLE(color:UInt);
TF(x:Float, y:Float, width:Float, height:Float, text:String, color:UInt);
LINE_STYLE(color:Int);
TF(x:Float, y:Float, width:Float, height:Float, text:String, color:Int);
}
5 changes: 0 additions & 5 deletions src/UInt.hx

This file was deleted.

10 changes: 5 additions & 5 deletions src/temperate/core/CGraphicsUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CGraphicsUtil

public static function drawRoundRectBorder(
g:Graphics,
x:Float, y:Float, width:Float, height:Float, radius:Float, color:UInt, alpha:Float,
x:Float, y:Float, width:Float, height:Float, radius:Float, color:Int, alpha:Float,
thickness:Int):Void
{
var x1 = x + width;
Expand Down Expand Up @@ -63,7 +63,7 @@ class CGraphicsUtil

public static function drawBottomRightBorder(
g:Graphics,
x:Float, y:Float, width:Float, height:Float, radius:Float, color:UInt, alpha:Float,
x:Float, y:Float, width:Float, height:Float, radius:Float, color:Int, alpha:Float,
thickness:Int, inner:Bool):Void
{
var x1 = x + width;
Expand Down Expand Up @@ -111,7 +111,7 @@ class CGraphicsUtil

public static function drawTopLeftBorder(
g:Graphics,
x:Float, y:Float, width:Float, height:Float, radius:Float, color:UInt, alpha:Float,
x:Float, y:Float, width:Float, height:Float, radius:Float, color:Int, alpha:Float,
thickness:Int, inner:Bool):Void
{
var x1 = x + width;
Expand Down Expand Up @@ -151,7 +151,7 @@ class CGraphicsUtil
public static function drawCircleBorder(
g:Graphics,
x:Float, y:Float, radius:Float, thickness:Int,
color:UInt, alpha:Float):Void
color:Int, alpha:Float):Void
{
g.beginFill(color, alpha);
draw1per8SegmentBorder(g, 0, 4, x, y, radius, thickness);
Expand All @@ -164,7 +164,7 @@ class CGraphicsUtil
public static function drawCircleGradientBorder(
g:Graphics,
x:Float, y:Float, radius:Float, thickness:Int,
colors:Array<UInt>, alphas:Array<Float>, ratios:Array<UInt>, matrix:Matrix):Void
colors:Array<Int>, alphas:Array<Float>, ratios:Array<Int>, matrix:Matrix):Void
{
g.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, matrix);
draw1per8SegmentBorder(g, 0, 4, x, y, radius, thickness);
Expand Down
12 changes: 6 additions & 6 deletions src/temperate/core/CMath.hx
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,22 @@ class CMath
return x > 0 ? x : -x;
}

inline public static function getAlpha(color:UInt):Float
inline public static function getAlpha(color:Int):Float
{
return (color >>> 24) / 0xff;
}

inline public static function getColor(color:UInt):UInt
inline public static function getColor(color:Int):Int
{
return color & 0x00ffffff;
}

inline public static function applyAlpha(colorPart:UInt, alphaPart:Float):UInt
inline public static function applyAlpha(colorPart:Int, alphaPart:Float):Int
{
return (Std.int(0xff * alphaPart) << 24) | (0x00ffffff & colorPart);
}

public static function toFixed(x:Float, fractionDigits:UInt):String
public static function toFixed(x:Float, fractionDigits:Int):String
{
#if flash9
return untyped x.toFixed(fractionDigits);
Expand Down Expand Up @@ -109,13 +109,13 @@ class CMath
#end
}

public static function toLimitDigits(x:Float, maxDigits:UInt):String
public static function toLimitDigits(x:Float, maxDigits:Int):String
{
var k = Math.round(Math.pow(10, maxDigits));
return Std.string(Math.round(x * k) / k);
}

public static function toHex(x:UInt):String
public static function toHex(x:Int):String
{
#if flash9
return untyped x.toString(16);
Expand Down
16 changes: 8 additions & 8 deletions src/temperate/debug/FPSMonitor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class FPSMonitor extends Sprite
static var TEXT_HEIGHT = 18;
static var UPDATE_DELAY = 100;
static var MEMORY_MULTIPLIER = 1 / (1024 * 1024);
static var MAX_MEMORY_STOCK:UInt = 100 * 1024;
static var MAX_MEMORY_STOCK:Int = 100 * 1024;

var _width:Int;
var _height:Int;
Expand Down Expand Up @@ -57,21 +57,21 @@ class FPSMonitor extends Sprite
var _tfFps:TextField;
var _memoryPlot:PlotBitmap;
var _fpsPlot:PlotBitmap;
var _bgColor:UInt;
var _memoryColor:UInt;
var _fpsColor:UInt;
var _bgColor:Int;
var _memoryColor:Int;
var _fpsColor:Int;

public function setColors(bgColor:UInt, memoryColor:UInt, fpsColor:UInt)
public function setColors(bgColor:Int, memoryColor:Int, fpsColor:Int)
{
_bgColor = bgColor;
_memoryColor = memoryColor;
_fpsColor = fpsColor;
return this;
}

var _settedFpsColor:UInt;
var _settedFpsColor:Int;

public function setSettedFpsColor(settedFpsColor:UInt)
public function setSettedFpsColor(settedFpsColor:Int)
{
_settedFpsColor = settedFpsColor;
return this;
Expand Down Expand Up @@ -160,7 +160,7 @@ class FPSMonitor extends Sprite

var _framePlotTimes:Array<Int>;
var _frameDigitTimes:Array<Int>;
var _maxMemory:UInt;
var _maxMemory:Int;

function calculateFps(time:Int, times:Array<Int>, framesBase:Int)
{
Expand Down
6 changes: 3 additions & 3 deletions src/temperate/debug/PlotBitmap.hx
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ class PlotBitmap extends Bitmap

var _endRect:Rectangle;

public function plot(value:Float, color:UInt)
public function plot(value:Float, color:Int)
{
_bd.setPixel32(_width - 1, Std.int(_height * (1 - value / _maxValue)), color);
}

public var onTextChange:PlotBitmap->TextField->Void;

public var text(default, null):String;
public var textColor(default, null):UInt;
public var textColor(default, null):Int;

public var textAlignX:Float;
public var textAlignY:Float;

var _tf:TextField;

public function setTextColor(color:UInt)
public function setTextColor(color:Int)
{
textColor = color;
if (_tf != null)
Expand Down
4 changes: 2 additions & 2 deletions src/temperate/minimal/MSeparator.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class MSeparator extends CSeparator
shadowColor = 0xff808080;
}

public var lightColor:UInt;
public var shadowColor:UInt;
public var lightColor:Int;
public var shadowColor:Int;

override function getLineWidth()
{
Expand Down
10 changes: 5 additions & 5 deletions src/temperate/minimal/charts/AMChart.hx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class AMChart extends CSprite
}
}

function getLabelText(index:UInt):String
function getLabelText(index:Int):String
{
var result = null;
if (_labels != null)
Expand Down Expand Up @@ -366,8 +366,8 @@ class AMChart extends CSprite
postponeSize();
}

public var lineColor(get_lineColor, set_lineColor):UInt;
var _lineColor:UInt;
public var lineColor(get_lineColor, set_lineColor):Int;
var _lineColor:Int;
function get_lineColor()
{
return _lineColor;
Expand Down Expand Up @@ -417,8 +417,8 @@ class AMChart extends CSprite
return _bgColor;
}

public var borderColor(get_borderColor, set_borderColor):UInt;
var _borderColor:UInt;
public var borderColor(get_borderColor, set_borderColor):Int;
var _borderColor:Int;
function get_borderColor()
{
return _borderColor;
Expand Down
Loading

0 comments on commit a5cbf64

Please sign in to comment.