diff --git a/test.txt b/test.txt deleted file mode 100644 index 35f7388..0000000 Binary files a/test.txt and /dev/null differ diff --git a/vif.js b/vif.js index f3a3d0b..ced7100 100644 --- a/vif.js +++ b/vif.js @@ -22,7 +22,7 @@ JVIV = function() { help_text.setColor("#FFFFFF"); events = new CBDL.Event(["keydown", "keyup"], document.body); events.addEvent(["resize"], window); - vif_loader = new VL.Loader('test.txt'); + vif_loader = new VL.Loader('test.vif'); (loop = new CBDL.Loop(this, onLoop)).start(); }; var offset = 0; @@ -45,8 +45,6 @@ JVIV = function() { var current_mod = 1; function onLoop(loop_time) { - debug_text.setText(debug_string); - help_text.setText(help_string); if (state == 0) { if (vif_loader.state == 1) { display.Fill(100, 50, 50); @@ -187,6 +185,7 @@ JVIV = function() { voxel_count++; } debug_string += "v:"+voxel_count+" "; + debug_text.setText(debug_string); }; }; CBDL.extend(CBDL.App, JVIV); @@ -199,7 +198,21 @@ Returns 1 on failure, 0 on success VL.Loader = function(vif_file) { this.state = 0; this.raw_data = []; - var iframe = document.createElement('iframe'); + var req = new XMLHttpRequest(); + req.open('GET', vif_file, true); + req.overrideMimeType('text\/plain; charset=x-user-defined') + CBDL.addEvent(req, 'load', (function(req, scope) { + return function() { + data = this.responseText; + for(var i=0;i