From 1602cb29db937fb6519fdb4a78fbdd2ffe221a91 Mon Sep 17 00:00:00 2001 From: XProger Date: Thu, 23 May 2019 03:42:41 +0300 Subject: [PATCH] fix CUT_4 scion rendering --- src/controller.h | 4 +++- src/core.h | 2 +- src/format.h | 4 ++-- src/level.h | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/controller.h b/src/controller.h index a141de8..199e0be 100644 --- a/src/controller.h +++ b/src/controller.h @@ -1324,7 +1324,9 @@ struct Controller { } mat4 getMatrix() { - if (level->isCutsceneLevel() && (getEntity().isActor() || getEntity().isLara())) + const TR::Entity &e = getEntity(); + + if (level->isCutsceneLevel() && (e.isActor() || e.isLara()) && e.type != TR::Entity::CUT_4) return level->cutMatrix; if (!lockMatrix) { diff --git a/src/core.h b/src/core.h index d42d900..c9f72cd 100644 --- a/src/core.h +++ b/src/core.h @@ -122,7 +122,7 @@ #include "utils.h" // muse be equal with base shader -#define SHADOW_TEX_SIZE 1024 +#define SHADOW_TEX_SIZE 2048 extern void* osMutexInit (); extern void osMutexFree (void *obj); diff --git a/src/format.h b/src/format.h index 04dc506..10a71de 100644 --- a/src/format.h +++ b/src/format.h @@ -1993,7 +1993,7 @@ namespace TR { && type != ENEMY_MUMMY && type != ENEMY_NATLA) opaque = true; - if (type == SWITCH || type == SWITCH_WATER) + if (type == SWITCH || type == SWITCH_WATER || type == CUT_1) opaque = true; if ((type >= PUZZLE_HOLE_1 && type <= PUZZLE_HOLE_4) || type == LIGHTNING) opaque = false; @@ -3793,7 +3793,7 @@ namespace TR { if (isCutsceneLevel()) { for (int i = 0; i < entitiesBaseCount; i++) { Entity &e = entities[i]; - if ((((version & VER_TR1)) && e.isActor()) || + if ((((version & VER_TR1)) && e.type == Entity::CUT_1) || (((version & (VER_TR2 | VER_TR3))) && e.isLara())) { cutEntity = i; break; diff --git a/src/level.h b/src/level.h index 140e933..ab3c2ea 100644 --- a/src/level.h +++ b/src/level.h @@ -1949,7 +1949,7 @@ struct Level : IGame { if (isModel) { // model ASSERT(controller->intensity >= 0.0f); - setMainLight(controller); + setMainLight(level.isCutsceneLevel() ? player : controller); setRoomParams(roomIndex, type, 1.0f, controller->intensity, controller->specular, 1.0f, mesh->transparent == 1); vec3 pos = controller->getPos();