Skip to content
Snippets Groups Projects
Commit df7edc16 authored by rswindell's avatar rswindell
Browse files

Re-ordered the property creation to put the more important fields first

(e.g. when JSON.stringifying).
Removed obj.fontname. We don't use it and it's just a copy of tinfos.
parent ba5b09f5
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,7 @@ function read(fname) ...@@ -67,7 +67,7 @@ function read(fname)
if(file.read(defs.id_length + defs.version_length) != 'SAUCE00') if(file.read(defs.id_length + defs.version_length) != 'SAUCE00')
return false; return false;
var obj = { comment:[], cols:0, rows:0, ice_color:false }; var obj = {};
obj.title = truncsp(file.read(35)); obj.title = truncsp(file.read(35));
obj.author = truncsp(file.read(20)); obj.author = truncsp(file.read(20));
obj.group = truncsp(file.read(20)); obj.group = truncsp(file.read(20));
...@@ -82,6 +82,12 @@ function read(fname) ...@@ -82,6 +82,12 @@ function read(fname)
var comments = file.readBin(1); var comments = file.readBin(1);
obj.tflags = file.readBin(1); obj.tflags = file.readBin(1);
obj.tinfos = truncsp(file.read(22)); obj.tinfos = truncsp(file.read(22));
obj.comment = [];
// Convenience fields
obj.cols = 0;
obj.rows = 0
obj.ice_color = false;
// Do some convenience field parsing/conversions here // Do some convenience field parsing/conversions here
obj.date = new Date(obj.date.substr(0, 4), parseInt(obj.date.substr(4,2))-1, obj.date.substr(6,2)); obj.date = new Date(obj.date.substr(0, 4), parseInt(obj.date.substr(4,2))-1, obj.date.substr(6,2));
...@@ -97,7 +103,6 @@ function read(fname) ...@@ -97,7 +103,6 @@ function read(fname)
obj.cols = obj.tinfo1; obj.cols = obj.tinfo1;
obj.rows = obj.tinfo2; obj.rows = obj.tinfo2;
} }
obj.fontname = obj.tinfos;
} }
// Read the Comment Block here // Read the Comment Block here
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment