mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-15 01:24:35 +02:00
@@ -47,6 +47,7 @@ struct Camera : ICamera {
|
|||||||
if (owner->getEntity().type != TR::Entity::LARA && level->cameraFrames) {
|
if (owner->getEntity().type != TR::Entity::LARA && level->cameraFrames) {
|
||||||
state = STATE_CUTSCENE;
|
state = STATE_CUTSCENE;
|
||||||
room = level->entities[level->cutEntity].room;
|
room = level->entities[level->cutEntity].room;
|
||||||
|
timer = 0.0f;
|
||||||
} else
|
} else
|
||||||
state = STATE_FOLLOW;
|
state = STATE_FOLLOW;
|
||||||
destPos = owner->pos - owner->getDir() * 1024.0f;
|
destPos = owner->pos - owner->getDir() * 1024.0f;
|
||||||
@@ -144,6 +145,14 @@ struct Camera : ICamera {
|
|||||||
target = viewPoint;
|
target = viewPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void doCutscene(const vec3 &pos, float rotation) {
|
||||||
|
state = Camera::STATE_CUTSCENE;
|
||||||
|
level->cutMatrix.identity();
|
||||||
|
level->cutMatrix.rotateY(angle.y);
|
||||||
|
level->cutMatrix.setPos(pos);
|
||||||
|
timer = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void update() {
|
virtual void update() {
|
||||||
if (shake > 0.0f)
|
if (shake > 0.0f)
|
||||||
shake = max(0.0f, shake - Core::deltaTime);
|
shake = max(0.0f, shake - Core::deltaTime);
|
||||||
|
12
src/format.h
12
src/format.h
@@ -681,7 +681,7 @@ namespace TR {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool isBlock() const {
|
bool isBlock() const {
|
||||||
return type >= TR::Entity::BLOCK_1 && type <= TR::Entity::BLOCK_4;
|
return type >= BLOCK_1 && type <= BLOCK_4;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isLara() const {
|
bool isLara() const {
|
||||||
@@ -689,7 +689,7 @@ namespace TR {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool castShadow() const {
|
bool castShadow() const {
|
||||||
return isLara() || isEnemy() || isActor();
|
return isLara() || isEnemy() || isActor() || type == TRAP_DART;
|
||||||
}
|
}
|
||||||
|
|
||||||
void getAxis(int &dx, int &dz) {
|
void getAxis(int &dx, int &dz) {
|
||||||
@@ -1505,7 +1505,7 @@ namespace TR {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < spriteSequencesCount; i++)
|
for (int i = 0; i < spriteSequencesCount; i++)
|
||||||
if (spriteSequences[i].type == TR::Entity::GLYPH) {
|
if (spriteSequences[i].type == Entity::GLYPH) {
|
||||||
extra.glyphSeq = i;
|
extra.glyphSeq = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2041,8 +2041,8 @@ namespace TR {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int16 getModelIndex(Entity::Type type) const {
|
int16 getModelIndex(Entity::Type type) const {
|
||||||
if (type == TR::Entity::ENEMY_MUTANT_2 || type == TR::Entity::ENEMY_MUTANT_3)
|
if (type == Entity::ENEMY_MUTANT_2 || type == Entity::ENEMY_MUTANT_3)
|
||||||
type = TR::Entity::ENEMY_MUTANT_1; // hardcoded mutant models remapping
|
type = Entity::ENEMY_MUTANT_1; // hardcoded mutant models remapping
|
||||||
|
|
||||||
for (int i = 0; i < modelsCount; i++)
|
for (int i = 0; i < modelsCount; i++)
|
||||||
if (type == models[i].type)
|
if (type == models[i].type)
|
||||||
@@ -2056,7 +2056,7 @@ namespace TR {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int entityAdd(TR::Entity::Type type, int16 room, int32 x, int32 y, int32 z, angle rotation, int16 intensity) {
|
int entityAdd(Entity::Type type, int16 room, int32 x, int32 y, int32 z, angle rotation, int16 intensity) {
|
||||||
for (int i = entitiesBaseCount; i < entitiesCount; i++)
|
for (int i = entitiesBaseCount; i < entitiesCount; i++)
|
||||||
if (entities[i].type == Entity::NONE) {
|
if (entities[i].type == Entity::NONE) {
|
||||||
Entity &e = entities[i];
|
Entity &e = entities[i];
|
||||||
|
@@ -1506,10 +1506,7 @@ struct Lara : Character {
|
|||||||
|
|
||||||
if (item.type == TR::Entity::SCION_QUALOPEC) {
|
if (item.type == TR::Entity::SCION_QUALOPEC) {
|
||||||
animation.setAnim(level->models[TR::MODEL_LARA_SPEC].animation);
|
animation.setAnim(level->models[TR::MODEL_LARA_SPEC].animation);
|
||||||
((Camera*)level->cameraController)->state = Camera::STATE_CUTSCENE;
|
((Camera*)level->cameraController)->doCutscene(pos, angle.y);
|
||||||
level->cutMatrix.identity();
|
|
||||||
level->cutMatrix.rotateY(angle.y);
|
|
||||||
level->cutMatrix.setPos(pos);
|
|
||||||
} else
|
} else
|
||||||
state = STATE_PICK_UP;
|
state = STATE_PICK_UP;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user