mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-15 09:34:18 +02:00
Merge remote-tracking branch 'refs/remotes/XProger/master'
This commit is contained in:
@@ -82,7 +82,8 @@ struct Collision {
|
||||
inf.floor = info.floor;
|
||||
inf.ceiling = info.ceiling;
|
||||
|
||||
if ((info.ceiling == info.floor) || (info.floor - info.ceiling < height) || (py - info.floor > maxAscent) || (info.floor - py > maxDescent) || (info.ceiling > py)) {
|
||||
if ((info.ceiling == info.floor) || (info.floor - info.ceiling < height) || (py - info.floor > maxAscent) || (info.floor - py > maxDescent) || (info.ceiling > py) ||
|
||||
(maxAscent == maxDescent && (maxAscent <= 256 + 128) && (abs(info.slantX) > 2 || abs(info.slantZ) > 2))) {
|
||||
this->side = side;
|
||||
return true;
|
||||
}
|
||||
|
@@ -246,9 +246,9 @@ namespace Input {
|
||||
vec2 center = vec2(Core::width - offset * 0.7f, Core::height - offset * 0.7f);
|
||||
|
||||
btnPos[bWeapon] = center;
|
||||
btnPos[bJump] = center + vec2(cos(-PI * 0.5f), sin(-PI * 0.5f)) * radius;
|
||||
btnPos[bAction] = center + vec2(cos(-PI * 3.0f / 4.0f), sin(-PI * 3.0f / 4.0f)) * radius;
|
||||
btnPos[bWalk] = center + vec2(cos(-PI), sin(-PI)) * radius;
|
||||
btnPos[bJump] = center + vec2(cosf(-PI * 0.5f), sinf(-PI * 0.5f)) * radius;
|
||||
btnPos[bAction] = center + vec2(cosf(-PI * 3.0f / 4.0f), sinf(-PI * 3.0f / 4.0f)) * radius;
|
||||
btnPos[bWalk] = center + vec2(cosf(-PI), sinf(-PI)) * radius;
|
||||
btnRadius = Core::height * (25.0f / 1080.0f);
|
||||
|
||||
// touch update
|
||||
|
16
src/lara.h
16
src/lara.h
@@ -422,7 +422,7 @@ struct Lara : Character {
|
||||
|
||||
if (level->extra.braid > -1)
|
||||
braid = new Braid(this, vec3(-4.0f, 24.0f, -48.0f));
|
||||
//reset(15, vec3(70067, -256, 29104), -0.68f); // level 2 (pool)
|
||||
|
||||
#ifdef _DEBUG
|
||||
//reset(14, vec3(40448, 3584, 60928), PI * 0.5f, true); // gym (pool)
|
||||
|
||||
@@ -432,7 +432,7 @@ struct Lara : Character {
|
||||
//reset(43, vec3(31400, -2560, 25200), PI); // level 2 (reach)
|
||||
//reset(16, vec3(60907, 0, 39642), PI * 3 / 2); // level 2 (hang & climb)
|
||||
//reset(19, vec3(60843, 1024, 30557), PI); // level 2 (block)
|
||||
reset(1, vec3(62630, -1280, 19633), 0); // level 2 (dark medikit)
|
||||
//reset(1, vec3(62630, -1280, 19633), 0); // level 2 (dark medikit)
|
||||
//reset(7, vec3(64108, -512, 16514), -PI * 0.5f); // level 2 (bat trigger)
|
||||
//reset(15, vec3(70082, -512, 26935), PI * 0.5f); // level 2 (bear)
|
||||
//reset(63, vec3(31390, -2048, 33472), 0.0f); // level 2 (trap floor)
|
||||
@@ -1645,9 +1645,12 @@ struct Lara : Character {
|
||||
if ((input & (FORTH | WALK)) == (FORTH | WALK)) return STATE_SWAN_DIVE;
|
||||
}
|
||||
} else
|
||||
if (state != STATE_SWAN_DIVE && state != STATE_REACH && state != STATE_FALL && state != STATE_UP_JUMP && state != STATE_BACK_JUMP && state != STATE_LEFT_JUMP && state != STATE_RIGHT_JUMP)
|
||||
if (state != STATE_SWAN_DIVE && state != STATE_FAST_DIVE && state != STATE_REACH && state != STATE_FALL && state != STATE_UP_JUMP && state != STATE_BACK_JUMP && state != STATE_LEFT_JUMP && state != STATE_RIGHT_JUMP)
|
||||
return animation.setAnim(ANIM_FALL);
|
||||
|
||||
if (state == STATE_SWAN_DIVE)
|
||||
return STATE_FAST_DIVE;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -1764,7 +1767,10 @@ struct Lara : Character {
|
||||
float ext = angle.y;
|
||||
|
||||
if (input & FORTH) {
|
||||
res = STATE_WALK;
|
||||
if (state == STATE_BACK)
|
||||
res = STATE_STOP;
|
||||
else
|
||||
res = STATE_WALK;
|
||||
} else if (input & BACK) {
|
||||
res = STATE_BACK;
|
||||
ext += PI;
|
||||
@@ -1888,7 +1894,7 @@ struct Lara : Character {
|
||||
return animation.setAnim(ANIM_WATER_FALL); // TODO: wronng animation
|
||||
}
|
||||
|
||||
if (state == STATE_SWAN_DIVE) {
|
||||
if (state == STATE_SWAN_DIVE || state == STATE_FAST_DIVE) {
|
||||
angle.x = -PI * 0.5f;
|
||||
game->waterDrop(pos, 128.0f, 0.2f);
|
||||
Sprite::add(game, TR::Entity::WATER_SPLASH, getRoomIndex(), (int)pos.x, (int)pos.y, (int)pos.z);
|
||||
|
@@ -514,7 +514,7 @@ struct MeshBuilder {
|
||||
|
||||
// circle
|
||||
vec2 pos(32767.0f, 0.0f);
|
||||
vec2 cs(cos(PI2 / CIRCLE_SEGS), sin(PI2 / CIRCLE_SEGS));
|
||||
vec2 cs(cosf(PI2 / CIRCLE_SEGS), sinf(PI2 / CIRCLE_SEGS));
|
||||
|
||||
for (int i = 0; i < CIRCLE_SEGS; i++) {
|
||||
Vertex &v = vertices[vCount + i];
|
||||
|
@@ -88,8 +88,8 @@ namespace Sound {
|
||||
float k = -10.0f / (44100.0f * rt60);
|
||||
|
||||
for (int i = 0; i < MAX_FDN; i++) {
|
||||
absCoeff[i][0] = pow(10.0f, FDN[i] * k);
|
||||
absCoeff[i][1] = 1.0f - (2.0f / (1.0f + pow(absCoeff[i][0], 1.0f - 1.0f / 0.15f)));
|
||||
absCoeff[i][0] = powf(10.0f, FDN[i] * k);
|
||||
absCoeff[i][1] = 1.0f - (2.0f / (1.0f + powf(absCoeff[i][0], 1.0f - 1.0f / 0.15f)));
|
||||
}
|
||||
};
|
||||
|
||||
|
52
src/ui.h
52
src/ui.h
@@ -194,32 +194,32 @@ namespace UI {
|
||||
mesh->addBar(buffer.indices, buffer.vertices, buffer.iCount, buffer.vCount, type, pos, vec2(size.x * value, size.y), 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
const char *helpText = \
|
||||
"Controls gamepad, touch and keyboard:@"\
|
||||
" H - Show or hide this help@"\
|
||||
" TAB - Inventory@"\
|
||||
" LEFT - Left@"\
|
||||
" RIGHT - Right@"\
|
||||
" UP - Run@"\
|
||||
" DOWN - Back@"\
|
||||
" SHIFT - Walk@"\
|
||||
" SPACE - Draw Weapon@"\
|
||||
" CTRL - Action@"\
|
||||
" ALT - Jump@"\
|
||||
" Z - Step Left@"\
|
||||
" X - Step Right@"\
|
||||
" A - Roll@"\
|
||||
" C - Look # not implemented #@"\
|
||||
" V - First Person View@"
|
||||
" R - slow motion@"\
|
||||
" T - fast motion@"\
|
||||
" ALT + ENTER - Fullscreen@@"\
|
||||
"Actions:@"\
|
||||
" Out of water - Run + Action@"\
|
||||
" Handstand - Run + Walk@"\
|
||||
" Swan dive - Run + Walk + jump@"\
|
||||
" DOZY on - Look + Step Right + Action + Jump@"\
|
||||
" DOZY off - Walk@";
|
||||
const char *helpText =
|
||||
"Controls gamepad, touch and keyboard:@"
|
||||
" H - Show or hide this help@"
|
||||
" TAB - Inventory@"
|
||||
" LEFT - Left@"
|
||||
" RIGHT - Right@"
|
||||
" UP - Run@"
|
||||
" DOWN - Back@"
|
||||
" SHIFT - Walk@"
|
||||
" SPACE - Draw Weapon@"
|
||||
" CTRL - Action@"
|
||||
" ALT - Jump@"
|
||||
" Z - Step Left@"
|
||||
" X - Step Right@"
|
||||
" A - Roll@"
|
||||
" C - Look # not implemented #@"
|
||||
" V - First Person View@"
|
||||
" R - slow motion@"
|
||||
" T - fast motion@"
|
||||
" ALT + ENTER - Fullscreen@@"
|
||||
"Actions:@"
|
||||
" Out of water - Run + Action@"
|
||||
" Handstand - Run + Walk@"
|
||||
" Swan dive - Run + Walk + jump@"
|
||||
" DOZY on - Look + Step Right + Action + Jump@"
|
||||
" DOZY off - Walk@";
|
||||
|
||||
void renderHelp() {
|
||||
if (showHelp)
|
||||
|
Reference in New Issue
Block a user