1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-12 08:04:09 +02:00

#15 fix level loading

This commit is contained in:
XProger
2017-09-14 05:20:33 +03:00
parent 25cbe7f592
commit 22f4f16f05
2 changed files with 6 additions and 4 deletions

View File

@@ -62,7 +62,10 @@ struct Level : IGame {
buf[0] = 0;
strcat(buf, "level/");
strcat(buf, TR::LEVEL_INFO[id].name);
strcat(buf, ".PSX");
switch (level.version) {
case TR::VER_TR1_PC : strcat(buf, ".PHD"); break;
case TR::VER_TR1_PSX : strcat(buf, ".PSX"); break;
}
new Stream(buf, loadAsync);
}
@@ -585,7 +588,7 @@ struct Level : IGame {
}
// repack texture tiles
Atlas *tiles = new Atlas(level.objectTexturesCount + level.spriteTexturesCount + 3, &level, fillCallback);
Atlas *tiles = new Atlas(level.objectTexturesCount + level.spriteTexturesCount + 4, &level, fillCallback);
// add textures
int texIdx = level.version == TR::VER_TR1_PSX ? 256 : 0; // skip palette color for PSX version
for (int i = texIdx; i < level.objectTexturesCount; i++) {

View File

@@ -103,11 +103,10 @@
<span id="info">
<input type="file" id="browseFile" style="display:none" accept=".phd,.psx" onchange="readLevel(event)" />
<!-- <label for="browseFile">Browse Level</label> -->
<input type="button" value="Browse Level" onclick="document.getElementById('browseFile').click();" /> (.PHD, .PSX)
<p style="margin:8px">
OpenLara on <a target="_blank" href="https://github.com/XProger/OpenLara">github</a> & <a target="_blank" href="https://www.facebook.com/OpenLaraTR">facebook</a><br>
<br><i>last update: 13.09.2017</i><br>
<br><i>last update: 14.09.2017</i><br>
</p>
</span>