mirror of
https://github.com/XProger/OpenLara.git
synced 2025-01-17 21:09:00 +01:00
This commit is contained in:
parent
ce83f7a333
commit
ab89e08549
BIN
bin/OpenLara.exe
BIN
bin/OpenLara.exe
Binary file not shown.
13
src/lara.h
13
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
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user