diff --git a/bin/OpenLara.exe b/bin/OpenLara.exe index 506bddc..6e40e4b 100644 Binary files a/bin/OpenLara.exe and b/bin/OpenLara.exe differ diff --git a/src/lara.h b/src/lara.h index 9088e7c..1dc696d 100644 --- a/src/lara.h +++ b/src/lara.h @@ -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 diff --git a/src/level.h b/src/level.h index 32bb50d..3544342 100644 --- a/src/level.h +++ b/src/level.h @@ -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); diff --git a/src/mesh.h b/src/mesh.h index 2c99554..f1e4a2b 100644 --- a/src/mesh.h +++ b/src/mesh.h @@ -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) {