mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-17 02:24:07 +02:00
Merge remote-tracking branch 'refs/remotes/XProger/master'
This commit is contained in:
@@ -2209,9 +2209,7 @@ struct Lara : Character {
|
|||||||
break;
|
break;
|
||||||
case STAND_GROUND :
|
case STAND_GROUND :
|
||||||
case STAND_HANG :
|
case STAND_HANG :
|
||||||
if (stand == STAND_GROUND && state != STATE_ROLL_1 && state != STATE_ROLL_2 && (pos - opos).length2() < 16)
|
if (opos.y - floor > (256 * 3 - 128) && state == STATE_RUN)
|
||||||
animation.setAnim(ANIM_STAND_NORMAL);
|
|
||||||
else if (opos.y - floor > (256 * 3 - 128) && state == STATE_RUN)
|
|
||||||
animation.setAnim(isLeftFoot ? ANIM_SMASH_RUN_LEFT : ANIM_SMASH_RUN_RIGHT);
|
animation.setAnim(isLeftFoot ? ANIM_SMASH_RUN_LEFT : ANIM_SMASH_RUN_RIGHT);
|
||||||
else if (stand == STAND_HANG)
|
else if (stand == STAND_HANG)
|
||||||
animation.setAnim(ANIM_HANG, -21);
|
animation.setAnim(ANIM_HANG, -21);
|
||||||
|
@@ -44,6 +44,8 @@
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
typedef unsigned __int64 uint64_t;
|
typedef unsigned __int64 uint64_t;
|
||||||
typedef signed __int64 int64_t;
|
typedef signed __int64 int64_t;
|
||||||
|
#elif defined(__x86_64__) && defined(__linux__)
|
||||||
|
#include <sys/types.h>
|
||||||
#else
|
#else
|
||||||
typedef unsigned long long uint64_t;
|
typedef unsigned long long uint64_t;
|
||||||
typedef signed long long int64_t;
|
typedef signed long long int64_t;
|
||||||
|
@@ -195,9 +195,21 @@ class Sound {
|
|||||||
int size = AudioTrack.getMinBufferSize(rate, AudioFormat.CHANNEL_OUT_STEREO, AudioFormat.ENCODING_PCM_16BIT);
|
int size = AudioTrack.getMinBufferSize(rate, AudioFormat.CHANNEL_OUT_STEREO, AudioFormat.ENCODING_PCM_16BIT);
|
||||||
//System.out.println(String.format("sound buffer size: %d", bufSize));
|
//System.out.println(String.format("sound buffer size: %d", bufSize));
|
||||||
buffer = new short[size / 2];
|
buffer = new short[size / 2];
|
||||||
|
|
||||||
|
try {
|
||||||
audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, 44100, AudioFormat.CHANNEL_OUT_STEREO,
|
audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, 44100, AudioFormat.CHANNEL_OUT_STEREO,
|
||||||
AudioFormat.ENCODING_PCM_16BIT, size, AudioTrack.MODE_STREAM);
|
AudioFormat.ENCODING_PCM_16BIT, size, AudioTrack.MODE_STREAM);
|
||||||
|
}catch (IllegalArgumentException e){
|
||||||
|
System.out.println("Error: buffer size is zero");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
audioTrack.play();
|
audioTrack.play();
|
||||||
|
}catch (NullPointerException e){
|
||||||
|
System.out.println("Error: audioTrack null pointer on start()");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
new Thread( new Runnable() {
|
new Thread( new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -220,17 +232,29 @@ class Sound {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void stop() {
|
void stop() {
|
||||||
|
try {
|
||||||
audioTrack.flush();
|
audioTrack.flush();
|
||||||
audioTrack.stop();
|
audioTrack.stop();
|
||||||
audioTrack.release();
|
audioTrack.release();
|
||||||
|
}catch (NullPointerException e){
|
||||||
|
System.out.println("Error: audioTrack null pointer on stop()");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void play() {
|
void play() {
|
||||||
|
try {
|
||||||
audioTrack.play();
|
audioTrack.play();
|
||||||
|
}catch (NullPointerException e){
|
||||||
|
System.out.println("Error: audioTrack null pointer on play()");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pause() {
|
void pause() {
|
||||||
|
try {
|
||||||
audioTrack.pause();
|
audioTrack.pause();
|
||||||
|
}catch (NullPointerException e){
|
||||||
|
System.out.println("Error: audioTrack null pointer on pause()");
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user