-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
73 lines (69 loc) · 3.76 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Bloodwych Data Viewer by DrSnuggles</title>
<link href="css/style.css" type="text/css" rel="stylesheet"/>
<script src="https://drsnuggles.github.io/IFF/js/iff.js"></script>
<script src="https://drsnuggles.github.io/IFF/js/8svx.js"></script>
<script src="./js/bwgfx.js"></script>
</head>
<body>
<script>
// prepare body
var gfx = ['Airbourne Fireball','Airbourne Spells','Avatars Large','Bed','Behemoth','Beholder','Body Parts','Button Highlights','Crab','Crab Claw','Dragon','Dragon Claw','Entropy','Fairy','Floor Ceiling','Font','Head Parts','Large Doorway','MainWalls','Objects On Floor','Pad','Pillar','Pit','Pockets','Pointers','Portcullis','Scroll_Edge_Bottom','Scroll_Edge_Left','Scroll_Edge_Right','Scroll_Edge_Top','Shelf','Shield Bottom','Shield Classes','Shield Top','Shield_Avatars','Shield_Clicked','Sign','Sign Overlay','Slots','Stairs Down','Stairs Up','Summon','Switches','WoodDoors','WoodWall'];
var html = ['<select id="dataselect" onchange="Load(this.value)">','<optgroup label="GFX">'];
for (var i = 0, n = gfx.length; i < n; i++) {
html.push('<option value="data/bw-gfx/',gfx[i],'">',gfx[i],'</option>');
}
html.push('</optgroup>');
html.push('<optgroup label="SFX">');
for (var i = 1; i < 6; i++) {
html.push('<option value="data/bw-sfx/sample',i,'.sound">sample',i,'</option>');
}
html.push('</optgroup>');
html.push('</select>');
html.push('<select id="colsetselect" onchange="BWGFX.render()" title="Colour sets">');
html.push('<option value="13">RAW</option>');
html.push('<option value="0">0: Grey</option>');
html.push('<option value="1">1: Light Blue</option>');
html.push('<option value="2">2: Light Green</option>');
html.push('<option value="3">3: Brownish Red</option>');
html.push('<option value="4">4: Red</option>');
html.push('<option value="5">5: Light Orange</option>');
html.push('<option value="6">6: Yellowy White</option>');
html.push('<option value="7">7: Golden Orange</option>');
html.push('<option value="8">8: Darker Grey</option>');
html.push('<option value="9">9: Light Blue/Yellow</option>');
html.push('<option value="10">A: Green/Yellow</option>');
html.push('<option value="11">B: Darker Blue/Grey</option>');
html.push('<option value="12">C: Blue/Yellow</option>');
html.push('</select>');
html.push('AntiAlias<input type="checkbox" id="cb_alias" onchange="GFXcanvas.classList.toggle(\'aa\')" title="AntiAlias">');
html.push(' <span id="dbg_DIM">32x32</span>');
html.push('<input type="color" title="Background color" id="col_bg" oninput="BWGFX.render()" value="#C00080"/>');
html.push('<button onclick="BWGFX.save()" title="Save">Save</button>');
html.push('<br/><input type="range" id="range_width" value="32" min="8" max="320" step="8" oninput="BWGFX.render()" title="Width in pixel" style="width:50%;"/>');
html.push('<br/><input type="range" value="1" min="0.1" max="4" step="0.01" ondblclick="this.value=GFXcanvas.style.scale=1" oninput="GFXcanvas.style.scale = this.value" title="Scale" style="width:50%;"/>');
html.push('<div id="info"><br/></div>');
html.push('<br/><canvas id="GFXcanvas" width="32" height="32"></canvas>');
document.body.innerHTML = html.join('');
dataselect.selectedIndex = 10; // Behemoth = 4
colsetselect.selectedIndex = 12;
Load(dataselect.value);
//
// how to use
//
function Load(url) {
info.innerHTML = "";
if (url.indexOf("/bw-sfx/") > 0 ) {
// old IFF/8SVX playback
IFF.load(url);
} else {
// new Atari ST Bloodwych gfx viewer
BWGFX.load(url, GFXcanvas);
}
}
</script>
</body>
</html>