1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-01-17 21:09:00 +01:00

#3 fix frames for stop, ascent, descent animations; #23 fix negate ambient

This commit is contained in:
XProger 2017-02-10 02:28:39 +03:00
parent ce83f7a333
commit ab89e08549
4 changed files with 14 additions and 6 deletions

Binary file not shown.

View File

@ -41,6 +41,9 @@ struct Lara : Character {
// http://www.tombraiderforums.com/showthread.php?t=148859
enum {
ANIM_STAND_LEFT = 2,
ANIM_STAND_RIGHT = 3,
ANIM_STAND = 11,
ANIM_CLIMB_JUMP = 26,
@ -259,7 +262,7 @@ struct Lara : Character {
float DAMPING = 1.5f;
if (lara->getRoom().flags.water) {
ACCEL *= -1.0f;
ACCEL *= -0.5f;
DAMPING = 4.0f;
}
@ -1957,7 +1960,11 @@ struct Lara : Character {
default : ;
}
bool isLeftFoot = animation.framesCount / 2 > animation.frameIndex;
int rightStart = 0;
if (state == STATE_RUN) rightStart = 6;
if (state == STATE_WALK) rightStart = 13;
if (state == STATE_BACK) rightStart = 28;
bool isLeftFoot = animation.frameIndex < rightStart || animation.frameIndex > (rightStart + animation.framesCount / 2);
if (!canPassGap) {
pos = p; // TODO: use smart ejection
@ -1988,7 +1995,7 @@ struct Lara : Character {
else if (stand == STAND_HANG)
animation.setAnim(ANIM_HANG, -21);
else if (state != STATE_ROLL_1 && state != STATE_ROLL_2)
animation.setAnim(ANIM_STAND);
animation.setAnim((state == STATE_RUN || state == STATE_WALK) ? (isLeftFoot ? ANIM_STAND_LEFT : ANIM_STAND_RIGHT) : ANIM_STAND);
velocity.x = velocity.z = 0.0f;
break;
default : ;// no smash animation

View File

@ -148,7 +148,8 @@ struct Level : IGame {
TR::Color32 color;
glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &color);
colors[j] = vec3(powf(color.r / 255.0f, 2.2f), powf(color.g / 255.0f, 2.2f), powf(color.b / 255.0f, 2.2f)); // to linear space
colors[j] = vec3(color.r / 255.0f, color.g / 255.0f, color.b / 255.0f);
colors[j] *= colors[j]; // to "linear" space
}
Core::setTarget(NULL);
@ -1425,7 +1426,7 @@ struct Level : IGame {
// Debug::Level::entities(level);
/*
static int dbg_ambient = 0;
dbg_ambient = int(time * 2) % 4;
dbg_ambient = int(params.time * 2) % 4;
shadow->unbind(sShadow);
atlas->bind(sDiffuse);

View File

@ -123,7 +123,7 @@ float intensityf(int lighting) {
if (lighting < 0) return 1.0f;
float lum = 1.0f - (lighting >> 5) / 255.0f;
//return powf(lum, 2.2f); // gamma to linear space
return lum * lum;
return lum * lum; // gamma to "linear" space
}
uint8 intensity(int lighting) {