1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-14 00:54:05 +02:00

#23 fix PSX RNC images loader

This commit is contained in:
XProger
2018-02-26 04:06:46 +03:00
parent 60141f8681
commit 46ce65f8ec
3 changed files with 4 additions and 2 deletions

View File

@@ -4,5 +4,5 @@ set SRC=main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/tinf/tinflate.c
set PROJ=OpenLara
set FLAGS=-O3 -Wno-deprecated-register --llvm-opts 2 -fmax-type-align=2 -std=c++11 -s ALLOW_MEMORY_GROWTH=1 -Wall -I../../
echo.
call em++ %SRC% %FLAGS% -o %PROJ%.js --preload-file ./level/1/TITLE.PSX --preload-file ./level/1/AMERTIT.PNG --preload-file ./audio/1/dummy --preload-file ./audio/2/dummy --preload-file ./audio/3/dummy --preload-file ./level/2/dummy --preload-file ./level/3/dummy
call em++ %SRC% %FLAGS% -o %PROJ%.js --preload-file ./level/1/TITLE.PSX --preload-file ./audio/1/dummy --preload-file ./audio/2/dummy --preload-file ./audio/3/dummy --preload-file ./level/2/dummy --preload-file ./level/3/dummy
gzip.exe -9 -f %PROJ%.data %PROJ%.js %PROJ%.js.mem

View File

@@ -654,12 +654,13 @@ struct Texture {
BitStream bs(cdata, csize);
uint8 *dst = data;
uint8 *end = data + size;
uint32 length = 0;
uint16 offset = 0;
bs.readBits(2);
while (bs.data < bs.end || bs.index > 0) {
while (bs.data < bs.end && dst < end) {
if (!bs.readBit()) {
*dst++ = bs.readByte();
} else {

View File

@@ -1320,6 +1320,7 @@ struct BitStream {
}
uint8 readByte() {
ASSERT(data < end);
return *data++;
}
};