浏览代码

signed zero handling

arpruss 8 年之前
父节点
当前提交
2c97ad46fa
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      split.html

+ 6 - 3
split.html

@@ -36,9 +36,12 @@ function getString(view, position, length) {
 
 
 function getVector(view, position) {
 function getVector(view, position) {
     if (ASCII_MODE) {
     if (ASCII_MODE) {
-        x = view.getUint32(position, true);
-        y = view.getUint32(position+4, true);
-        z = view.getUint32(position+8, true);
+        function fixZero(a) {
+            return a == 0x80000000 ? 0 : a;
+        }
+        x = fixZero(view.getUint32(position, true));
+        y = fixZero(view.getUint32(position+4, true));
+        z = fixZero(view.getUint32(position+8, true));
         return x.toString(16)+":"+y.toString(16)+":"+z.toString(16);
         return x.toString(16)+":"+y.toString(16)+":"+z.toString(16);
     }
     }