mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-09 22:56:53 +02:00
fix switch button animation and alignment (TR2, TR3); minor fixes
This commit is contained in:
10
src/format.h
10
src/format.h
@@ -1032,6 +1032,10 @@ namespace TR {
|
||||
0, 100, 80, ::Box(vec3(-1024, -1024, -1024), vec3(1024, 1024, 512)), true, true
|
||||
};
|
||||
|
||||
Limit SWITCH_BUTTON = {
|
||||
0, 300, 30, ::Box(vec3(-200, 0, 290), vec3(200, 0, 512)), true, true
|
||||
};
|
||||
|
||||
Limit PICKUP = {
|
||||
0, -100, 180, ::Box(vec3(-256, -100, -256), vec3(256, 100, 100)), false, true
|
||||
};
|
||||
@@ -3052,11 +3056,13 @@ namespace TR {
|
||||
}
|
||||
|
||||
// turn off interpolation for some entities
|
||||
if (id == LVL_TR2_CUT_1)
|
||||
for (int i = 0; i < entitiesBaseCount; i++) {
|
||||
Entity &e = entities[i];
|
||||
if (e.type == Entity::CUT_6 || e.type == Entity::CUT_8 || e.type == Entity::CUT_9) {
|
||||
if ((id == LVL_TR2_CUT_1 && (e.type == Entity::CUT_6 || e.type == Entity::CUT_8 || e.type == Entity::CUT_9)) ||
|
||||
e.type == Entity::SWITCH_BUTTON) {
|
||||
|
||||
e.flags.smooth = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -961,12 +961,12 @@ struct Inventory {
|
||||
|
||||
void update() {
|
||||
if (titleTimer > 1.0f && (
|
||||
Input::state[0][cInventory] || Input::state[0][cAction] || Input::state[0][cJump] ||
|
||||
Input::state[1][cInventory] || Input::state[1][cAction] || Input::state[1][cJump] ||
|
||||
Input::down[ikCtrl] || Input::down[ikEnter] || Input::down[ikAlt]))
|
||||
Input::state[0][cInventory] || Input::state[0][cAction] ||
|
||||
Input::state[1][cInventory] || Input::state[1][cAction] ||
|
||||
Input::down[ikCtrl]))
|
||||
{
|
||||
if (video) {
|
||||
if (video->time > 0.5f)
|
||||
if (video->time > 0.75f)
|
||||
skipVideo();
|
||||
} else if (titleTimer > 1.0f && titleTimer < 2.5f)
|
||||
titleTimer = 1.0f;
|
||||
|
@@ -1814,7 +1814,7 @@ struct Lara : Character {
|
||||
Switch *controller = (Switch*)level->entities[info.trigCmd[cmdIndex++].args].controller;
|
||||
|
||||
if (controller->flags.state != TR::Entity::asActive) {
|
||||
limit = state == STATE_STOP ? &TR::Limits::SWITCH : &TR::Limits::SWITCH_UNDERWATER;
|
||||
limit = state == STATE_STOP ? (controller->getEntity().type == TR::Entity::SWITCH_BUTTON ? &TR::Limits::SWITCH_BUTTON : &TR::Limits::SWITCH) : &TR::Limits::SWITCH_UNDERWATER;
|
||||
if (checkInteraction(controller, limit, Input::state[camera->cameraIndex][cAction])) {
|
||||
actionState = (controller->state == Switch::STATE_DOWN && stand == STAND_GROUND) ? STATE_SWITCH_UP : STATE_SWITCH_DOWN;
|
||||
|
||||
|
@@ -659,9 +659,9 @@ struct Video {
|
||||
Y[i] = clamp(luma + offsetLUT[diff] * signLUT[sign][i], 0U, 63U);
|
||||
|
||||
} else {
|
||||
if (bs.readBit()) {
|
||||
|
||||
if (bs.readBit())
|
||||
luma = bs.readBit() ? bs.read(6) : ((luma + lumaLUT[bs.read(3)]) & 63);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
Y[i] = luma;
|
||||
|
Reference in New Issue
Block a user