1
0
Fork 0

Merge branch 'svn/trunk'

This commit is contained in:
Patryk Obara 2019-10-10 00:16:04 +02:00
commit 79fe83ede6
6 changed files with 35 additions and 22 deletions

View file

@ -67,7 +67,7 @@ struct JoyStick {
}
void transform_circular(){
float r = sqrt(xpos * xpos + ypos * ypos);
float r = sqrtf(xpos * xpos + ypos * ypos);
if (r == 0.0) {xfinal = xpos; yfinal = ypos; return;}
float deadzone_f = deadzone / 100.0f;
float s = 1.0f - deadzone_f;
@ -77,8 +77,8 @@ struct JoyStick {
}
float deadzonescale = (r - deadzone_f) / s; //r if deadzone=0;
float xa = fabs(xpos);
float ya = fabs(ypos);
float xa = fabsf(xpos);
float ya = fabsf(ypos);
float maxpos = (ya>xa?ya:xa);
xfinal = xpos * deadzonescale/maxpos;
yfinal = ypos * deadzonescale/maxpos;

View file

@ -278,7 +278,7 @@ static void PCSPEAKER_CallBack(Bitu len) {
index+=vol_len;
} else {
/* Check how long it will take to goto new level */
float vol_time=fabs(vol_diff)/SPKR_SPEED;
float vol_time=fabsf(vol_diff)/SPKR_SPEED;
if (vol_time<=vol_len) {
/* Volume reaches endpoint in this block, calc until that point */
value+=vol_time*spkr.volcur;