Replaced polyfills with real implementations
This commit is contained in:
@@ -555,10 +555,4 @@ fn generateSnapshotAt(x: int, y: int) {
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//polyfill
|
||||
fn sign(x) {
|
||||
if (x > 0) return 1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ fn setTilemap(node: opaque, t: [int]) {
|
||||
tilemap = t;
|
||||
|
||||
//create a child as a render target
|
||||
var child = node.loadChild("scripts:/tilemap/renderer-child.toy");
|
||||
var child = node.loadChildNode("scripts:/tilemap/renderer-child.toy");
|
||||
child.createNodeTexture(CELL_WIDTH * CELL_COUNT_X * TILE_PIXEL_WIDTH, CELL_HEIGHT * CELL_COUNT_Y * TILE_PIXEL_HEIGHT);
|
||||
setRenderTarget(child);
|
||||
|
||||
@@ -66,11 +66,3 @@ fn setTilemap(node: opaque, t: [int]) {
|
||||
//reset the render target to the screen
|
||||
setRenderTarget(null);
|
||||
}
|
||||
|
||||
//polyfills
|
||||
fn loadChild(parent: opaque, fname: string) {
|
||||
//TODO: add this to the API proper
|
||||
var child: opaque = loadNode(fname);
|
||||
parent.pushNode(child);
|
||||
return child;
|
||||
}
|
||||
Reference in New Issue
Block a user