-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
109 lines (85 loc) · 2.75 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html>
<head>
<title>SSBP - Viewer</title>
<style type="text/css">
input[type=file] {
display: block;
}
#dump {
width:45%;
height: 500px;
overflow: scroll;
display: inline-block;
}
.player-container {
width: 45%;
height: 512px;
border: 1px solid;
display: inline-block;
}
</style>
<script type="text/javascript" src="./lib/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="./lib/fileManager.js"></script>
<script type="text/javascript" src="./lib/ssbpManager.js"></script>
<script>
var $fM = lib.fileManager;
var $ssbpM = lib.ssbpManager;
var player;
function writeDump(msg){
var $d = $("#dump");
$d.html($d.text()+msg+"\n");
}
function toHex(num){
return "0x"+num.toString(16).toUpperCase();
}
function prettyPrintObj(obj, space){
if(space === undefined) space = "\t";
return JSON.stringify(obj, null, space)
}
function mainEntry(){
// test functions
writeDump("DATA = " + toHex($ssbpM.getSSBPData()));
writeDump("VERSION = " + toHex($ssbpM.getSSBPVersion()));
writeDump("Flags = " + toHex($ssbpM.getSSBPFlags()));
writeDump("IMG Base Dir = '" + $ssbpM.getImageBaseDir()+"' (" + toHex($ssbpM.getStringAddressImageBaseDir()) + ")");
writeDump("@Cells = " + toHex($ssbpM.getStartCellAddress()));
writeDump("@animePacks = " + toHex($ssbpM.getStartAnimePackAdress()));
writeDump("@effectFileList = " + toHex($ssbpM.getStartAdressEffectFileList()));
writeDump("num Cells = " + $ssbpM.getNumCells());
writeDump("num animepacks = " + $ssbpM.getNumAnimePacks());
writeDump("num effect file list = " + $ssbpM.getNumEffectFileList());
writeDump("CELLS = " +prettyPrintObj($ssbpM.getCells(), ' '));
writeDump("A.PACKS = " +prettyPrintObj($ssbpM.getAnimePacks(), ' '));
writeDump("Eff.FILES = " +prettyPrintObj($ssbpM.getEffectFiles(), ' '));
var cellCache = $ssbpM.cellCache.init('./');
$ssbpM.effectCache.init('./', cellCache);
$ssbpM.animeCache.init();
player = new $ssbpM.Player($('.player-container'));
}
$(function(){
var fileManagerOptions = {
serverSide : false,
onLoadFile: function(file){
//types: text, dataUrl, arrayBuffer
console.log(file,"READED");
$ssbpM.init(file.getContent());
mainEntry();
},
onSendProgress: function(event){
var sended = event.loaded;
var total = event.total;
},
onSendSuccess: function(data){},
onSendError: function(){},
};
$fM.registerEvents(fileManagerOptions);
});
</script>
</head>
<body>
<input type="file" name="ssbp">
<pre id="dump"></pre>
<div class="player-container"></div>
</body>
</html>