diff --git a/src/controller.h b/src/controller.h index f8138ca..669c1a1 100644 --- a/src/controller.h +++ b/src/controller.h @@ -946,7 +946,7 @@ struct Controller { vec3 center = getBoundingBox().center(); float maxAtt = 0.0f; - + /* if (room.flags.sky) { // TODO trace rooms up for sun light, add direct light projection sunLight.x = int32(center.x); sunLight.y = int32(center.y) - 8192; @@ -955,6 +955,8 @@ struct Controller { sunLight.radius = 1000 * 1024; targetLight = &sunLight; } else { + */ + { for (int i = 0; i < room.lightsCount; i++) { TR::Room::Light &light = room.lights[i]; if ((light.color.r | light.color.g | light.color.b) == 0) continue; diff --git a/src/debug.h b/src/debug.h index 94805e8..19aaa94 100644 --- a/src/debug.h +++ b/src/debug.h @@ -466,7 +466,7 @@ namespace Debug { Controller *controller = (Controller*)e.controller; if (!controller || controller->flags.invisible) return; - sprintf(buf, "%s (%d)", getEntityName(level, e), (int)e.type, i); + sprintf(buf, "%s (%d)", getEntityName(level, e), i); Debug::Draw::text(controller->pos + randf() * 64, controller->flags.active ? vec4(0, 0, 0.8f, 1) : vec4(0.8f, 0, 0, 1), buf); } diff --git a/src/game.h b/src/game.h index df65d6b..4647abd 100644 --- a/src/game.h +++ b/src/game.h @@ -106,7 +106,11 @@ namespace Game { Input::down[ikL] = false; } */ - Core::deltaTime = delta = min(0.2f, delta); + + if (!level->level.isCutsceneLevel()) + delta = min(0.2f, delta); + + Core::deltaTime = delta; UI::update(); while (delta > EPS) { diff --git a/src/lara.h b/src/lara.h index 718b084..659b046 100644 --- a/src/lara.h +++ b/src/lara.h @@ -409,7 +409,7 @@ struct Lara : Character { } void render(MeshBuilder *mesh) { - Core::active.shader->setParam(uBasis, basis[0], jointsCount); + Core::active.shader->setParam(uBasis, basis[0], jointsCount - 1); mesh->renderModel(lara->level->extra.braid); } @@ -2595,7 +2595,8 @@ struct Lara : Character { if (level->isCutsceneLevel()) { updateAnimation(true); - vec3 p = getPos(); + vec3 p = pos; + pos = getPos(); //checkRoom(); updateLights(); pos = p; diff --git a/src/level.h b/src/level.h index d3bf0eb..e14b039 100644 --- a/src/level.h +++ b/src/level.h @@ -68,10 +68,7 @@ struct Level : IGame { strcat(buf, "3/"); strcat(buf, TR::LEVEL_INFO[id].name); #ifdef __EMSCRIPTEN__ - if (level.version & TR::VER_TR3) - strcat(buf, ".TR2"); - else - strcat(buf, ".PSX"); + strcat(buf, ".PSX"); #else switch (level.version) { case TR::VER_TR1_PC : strcat(buf, ".PHD"); break; @@ -558,10 +555,11 @@ struct Level : IGame { case TR::VER_TR3_PSX : #ifndef __EMSCRIPTEN__ playAsync(Sound::openWAD(NULL, track), this); + return; #else sprintf(title, "audio/3/track_%02d.ogg", int(track)); #endif - return; + break; default : return; } diff --git a/src/platform/web/build.bat b/src/platform/web/build.bat index b44549c..d5df773 100644 --- a/src/platform/web/build.bat +++ b/src/platform/web/build.bat @@ -2,7 +2,7 @@ cls set SRC=main.cpp ../../libs/stb_vorbis/stb_vorbis.c set PROJ=OpenLara -set FLAGS=-O3 -Wno-deprecated-register --llvm-opts 2 -fmax-type-align=2 -std=c++11 -Wall -I../../ +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/TITLE.PSX --preload-file ./level/TITLEH.PCX --preload-file ./audio/dummy +call em++ %SRC% %FLAGS% -o %PROJ%.js --preload-file ./level/TITLE.PSX --preload-file ./level/TITLEH.PCX --preload-file ./audio/dummy --preload-file ./level/2/dummy --preload-file ./level/3/dummy --preload-file ./audio/2/dummy --preload-file ./audio/3/dummy gzip.exe -9 -f %PROJ%.data %PROJ%.js %PROJ%.js.mem \ No newline at end of file diff --git a/src/sound.h b/src/sound.h index 85a96d6..6beb565 100644 --- a/src/sound.h +++ b/src/sound.h @@ -682,7 +682,7 @@ namespace Sound { } Stream *openWAD(const char *name, int index = -1) { - Stream *stream = new Stream("cdaudio.wad"); + Stream *stream = new Stream("audio/3/cdaudio.wad"); if (stream->size) { struct Item { char name[260];