Skip to content

Commit

Permalink
FIX random getters naming
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed Dec 27, 2024
1 parent 0304cc1 commit 92c41ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/dn/heaps/assets/Aseprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ class AsepriteDictEntry {
}

/** Allocate a HSpriteBE **/
public inline function getRandomHspriteBE(sb:dn.heaps.slib.HSpriteBatch, frame=0, xr=0., yr=0., ?rndFunc:Int->Int) : dn.heaps.slib.HSpriteBE {
return lib.hbe_getRandom(sb, id, frame, xr,yr, rndFunc);
public inline function getRandomHspriteBE(sb:dn.heaps.slib.HSpriteBatch, ?rndFunc:Int->Int) : dn.heaps.slib.HSpriteBE {
return lib.hbe_getRandom(sb, id, rndFunc);
}

/** Allocate a Bitmap **/
Expand Down
12 changes: 11 additions & 1 deletion src/dn/heaps/slib/SpriteLib.hx
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,13 @@ class SpriteLib {
return new h2d.Bitmap( getTile(g,frame,px,py), p );
}

@:deprecated("Use getRandomBitmap() instead") @:noCompletion
public inline function getBitmapRandom(g:String, ?px:Float=0.0, ?py:Float=0.0, ?rndFunc, ?p:h2d.Object) : h2d.Bitmap {
return new h2d.Bitmap( getTileRandom(g,px,py,rndFunc), p );
return getBitmapRandom(g,px,py,rndFunc,p);
}

public inline function getRandomBitmap(g:String, ?px:Float=0.0, ?py:Float=0.0, ?rndFunc, ?p:h2d.Object) : h2d.Bitmap {
return new h2d.Bitmap( getRandomTile(g,px,py,rndFunc), p );
}

public inline function updTile(t:h2d.Tile, g:String, frame=0, px:Float=0.0, py:Float=0.0) : h2d.Tile {
Expand All @@ -458,7 +463,12 @@ class SpriteLib {
return t;
}

@:deprecated("Use getRandomTile() instead") @:noCompletion
public inline function getTileRandom(g:String, px:Float=0.0, py:Float=0.0, ?rndFunc) : h2d.Tile {
return getRandomTile(g,px,py,rndFunc);
}

public inline function getRandomTile(g:String, px:Float=0.0, py:Float=0.0, ?rndFunc) : h2d.Tile {
return getTile(g, getRandomFrame(g,rndFunc), px, py);
}

Expand Down

0 comments on commit 92c41ea

Please sign in to comment.