support esoteric RLE icons

looking at you katamari damacy
This commit is contained in:
yellows111 2023-10-17 23:35:03 +01:00
parent 4e27fcdc94
commit 0569aa7b0b
2 changed files with 18 additions and 9 deletions

View File

@ -37,6 +37,12 @@ function uncompressTexture(texData) {
let offset = 0; let offset = 0;
for (let index = 0; index < 16384; index++) { for (let index = 0; index < 16384; index++) {
currentValue = u16le(offset); currentValue = u16le(offset);
if(currentValue === 0) {
// if this is specifically a katamari 1 or 2 icon, skip this byte
// because it's formatted like that for some reason
offset += 2;
currentValue = u16le(offset);
}
offset += 2; offset += 2;
if (currentValue >= 0xff00) { if (currentValue >= 0xff00) {
//do a raw copy //do a raw copy

View File

@ -11,14 +11,14 @@
#title1, #title2 { #title1, #title2 {
color: yellow; color: yellow;
text-align: right; text-align: right;
/*text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;*/ line-height: 0.50em;
right: 8px;
position: relative;
margin: 0;
} }
#version {position: fixed;bottom:4px;right:4px} #version {position: fixed;bottom:4px;right:4px}
#advanced {display: none} #advanced {display: none}
#iconcanvas {position: absolute; left: 8px} #iconcanvas {position: absolute; left: 8px}
#titlebox {width: 99%;position: absolute;}
input[type="file"] {line-height: 2em;}
#version {text-shadow: 1px 1px 2px black;}
</style> </style>
<meta data-comment="WebGL Shader: Icon"> <meta data-comment="WebGL Shader: Icon">
<script type="text/plain" id="shader-icon-v"> <script type="text/plain" id="shader-icon-v">
@ -87,9 +87,10 @@
<label for="showExtractedInputOption">show other import options</label> <label for="showExtractedInputOption">show other import options</label>
<input id="showExtractedInputOption" type="checkbox"></input> <input id="showExtractedInputOption" type="checkbox"></input>
<hr> <hr>
<br> <div id="titlebox">
<h1 id="title1">&#xFF2E;&#xFF4F;&#x3000;&#xFF26;&#xFF49;&#xFF4C;&#xFF45;</h1> <h1 id="title1">&#xFF2E;&#xFF4F;&#x3000;&#xFF26;&#xFF49;&#xFF4C;&#xFF45;</h1>
<h1 id="title2">&#xFF2C;&#xFF4F;&#xFF41;&#xFF44;&#xFF45;&#xFF44;</h1> <h1 id="title2">&#xFF2C;&#xFF4F;&#xFF41;&#xFF44;&#xFF45;&#xFF44;</h1>
</div>
<span>Background/icon preview:</span><br> <span>Background/icon preview:</span><br>
<canvas id="bgcanvas" width="360" height="360"></canvas> <canvas id="bgcanvas" width="360" height="360"></canvas>
<canvas id="iconcanvas" width="360" height="360"></canvas> <canvas id="iconcanvas" width="360" height="360"></canvas>
@ -116,7 +117,7 @@
<br> <br>
<p> <p>
<span>Date created: </span><span id="dateCreated">--:--:-- --/--/----</span><span> UTC+09:00</span> <span>Date created: </span><span id="dateCreated">--:--:-- --/--/----</span><span> UTC+09:00</span>
<br> <span> | </span>
<span>Date modified: </span><span id="dateModified">--:--:-- --/--/----</span><span> UTC+09:00</span> <span>Date modified: </span><span id="dateModified">--:--:-- --/--/----</span><span> UTC+09:00</span>
</p> </p>
<p> <p>
@ -252,6 +253,8 @@
if(!!filebox.files.length) {filebox.onchange();} if(!!filebox.files.length) {filebox.onchange();}
if(!!iconbox.files.length) {iconbox.onchange();} if(!!iconbox.files.length) {iconbox.onchange();}
if(!!psubox.files.length) {psubox.onchange();} if(!!psubox.files.length) {psubox.onchange();}
if(!!psvbox.files.length) {psvbox.onchange();}
if(!!spsbox.files.length) {spsbox.onchange();}
} }
filebox = document.getElementById("input"); filebox = document.getElementById("input");
filebox.onchange = function(e) { filebox.onchange = function(e) {
@ -447,7 +450,7 @@
document.getElementById("showExtractedInputOption").onchange = function(e) { document.getElementById("showExtractedInputOption").onchange = function(e) {
document.getElementById("advanced").style.display = ((e.target.checked) ? "block" : "none"); document.getElementById("advanced").style.display = ((e.target.checked) ? "block" : "none");
} }
//todo: Animation parsing, animation tweening, whatever's going on with texture type 15 //todo: Animation parsing, animation tweening
</script> </script>
<span id="version">icondumper2 <span id="iconjsVersion">(unknown icon.js version)</span> [C: <span id="clientVersion">Loading...</span>] - &copy; 2023 yellows111</span> <span id="version">icondumper2 <span id="iconjsVersion">(unknown icon.js version)</span> [C: <span id="clientVersion">Loading...</span>] - &copy; 2023 yellows111</span>
<script>document.getElementById("iconjsVersion").textContent = ICONJS_VERSION;</script> <script>document.getElementById("iconjsVersion").textContent = ICONJS_VERSION;</script>