mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Update preview/js/frameSheetModel.js
This commit is contained in:
parent
051bbff20f
commit
c1828a1a70
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
var FrameSheetModel = (function() {
|
var FrameSheetModel = (function() {
|
||||||
|
|
||||||
var inst;
|
var inst;
|
||||||
@ -16,8 +15,8 @@ var FrameSheetModel = (function() {
|
|||||||
|
|
||||||
var serializeFrame_ = function (frame) {
|
var serializeFrame_ = function (frame) {
|
||||||
var buffer = [];
|
var buffer = [];
|
||||||
var serializedLine = "";
|
|
||||||
for (var i = 0 ; i < frame.length ; i++) {
|
for (var i = 0 ; i < frame.length ; i++) {
|
||||||
|
var serializedLine = "";
|
||||||
for(var j = 0 ; j < frame[i].length ; j++) {
|
for(var j = 0 ; j < frame[i].length ; j++) {
|
||||||
if (typeof frame[i][j] == 'undefined' || frame[i][j] == 'tc') {
|
if (typeof frame[i][j] == 'undefined' || frame[i][j] == 'tc') {
|
||||||
serializedLine += "0"
|
serializedLine += "0"
|
||||||
@ -25,11 +24,7 @@ var FrameSheetModel = (function() {
|
|||||||
serializedLine += "1"
|
serializedLine += "1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i%2 == 1) {
|
buffer.push(parseInt(serializedLine, 2).toString(36));
|
||||||
console.log(i);
|
|
||||||
buffer.push(parseInt(serializedLine, 2).toString(36));
|
|
||||||
serializedLine = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return buffer.join(",");
|
return buffer.join(",");
|
||||||
|
Loading…
Reference in New Issue
Block a user