Skip to content

Commit 7ebf963

Browse files
Matt JohnsonMatt Johnson
Matt Johnson
authored and
Matt Johnson
committed
Bug fixes, changed haxelib version to 0.1.0.
1 parent bace600 commit 7ebf963

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

haxelib.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"mattj1"
99
],
1010
"releasenote": "First haxelib release.",
11-
"version": "0.0.0",
11+
"version": "0.1.0",
1212
"url": "http://github.com/mattj1/luxe-ascii/",
1313
"dependencies": {
1414
"luxe": "*",

luxe_ascii/REXLoader.hx

+8-15
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,22 @@ class REXLoader {
4242
return textBuffer;
4343
}
4444

45-
46-
4745
public static function load(path:String):TextBuffer {
4846

49-
var compressed_bytes:Uint8Array = Luxe.resources.bytes(path).asset.bytes;
47+
var resource = Luxe.resources.bytes(path);
48+
49+
if(resource == null) {
50+
trace("REXLoader: Could not load " + path);
51+
return null;
52+
}
53+
54+
var compressed_bytes:Uint8Array = resource.asset.bytes;
5055

5156
var bytes:Bytes = Bytes.alloc(compressed_bytes.length);
5257
for(i in 0 ... compressed_bytes.length) {
5358
bytes.set(i, compressed_bytes[i]);
5459
}
5560

56-
trace("compressed_bytes: " + compressed_bytes);
57-
5861
return toTextBuffer(REXPaintLoader.loadXP(bytes));
59-
60-
// var rexPaintFile:REXPaintFile = {};
61-
// rexPaintFile.layers = new Array<REXPaintLayer>();
62-
63-
// var layer:REXPaintLayer;
64-
65-
// trace("compressed_bytes: " + compressed_bytes);
66-
// trace("compressed_bytes.bytes: " + compressed_bytes.bytes); // Uint8Array
67-
// trace(compressed_bytes.bytes.length); // 242
68-
6962
}
7063
}

luxe_ascii/TextBuffer.hx

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ class TextBuffer {
6262
// Draw a TextBuffer onto this one at (xPos, yPos), taking into account transparency.
6363
public function blit(t:TextBuffer, xPos:Int, yPos:Int) {
6464

65+
if(t == null) {
66+
return;
67+
}
68+
6569
var dx:Int, dy:Int;
6670
var src_data:CharAttr, dst_data:CharAttr;
6771

0 commit comments

Comments
 (0)