Commit 7ebf963 1 parent bace600 commit 7ebf963 Copy full SHA for 7ebf963
File tree 3 files changed +13
-16
lines changed
3 files changed +13
-16
lines changed Original file line number Diff line number Diff line change 8
8
" mattj1"
9
9
],
10
10
"releasenote" : " First haxelib release." ,
11
- "version" : " 0.0 .0" ,
11
+ "version" : " 0.1 .0" ,
12
12
"url" : " http://github.com/mattj1/luxe-ascii/" ,
13
13
"dependencies" : {
14
14
"luxe" : " *" ,
Original file line number Diff line number Diff line change @@ -42,29 +42,22 @@ class REXLoader {
42
42
return textBuffer ;
43
43
}
44
44
45
-
46
-
47
45
public static function load (path : String ): TextBuffer {
48
46
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 ;
50
55
51
56
var bytes : Bytes = Bytes .alloc (compressed_bytes .length );
52
57
for (i in 0 ... compressed_bytes .length ) {
53
58
bytes .set (i , compressed_bytes [i ]);
54
59
}
55
60
56
- trace (" compressed_bytes: " + compressed_bytes );
57
-
58
61
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
-
69
62
}
70
63
}
Original file line number Diff line number Diff line change @@ -62,6 +62,10 @@ class TextBuffer {
62
62
// Draw a TextBuffer onto this one at (xPos, yPos), taking into account transparency.
63
63
public function blit (t : TextBuffer , xPos : Int , yPos : Int ) {
64
64
65
+ if (t == null ) {
66
+ return ;
67
+ }
68
+
65
69
var dx : Int , dy : Int ;
66
70
var src_data : CharAttr , dst_data : CharAttr ;
67
71
You can’t perform that action at this time.
0 commit comments