dinput: Improve linux effect debugging.

Based on ideas by Elias Vanderstuyft.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Bruno Jesus 2016-09-14 02:25:33 -03:00 committed by Alexandre Julliard
parent 5ab0126f1d
commit ab5ad7dc0b
1 changed files with 7 additions and 6 deletions

View File

@ -97,10 +97,10 @@ static void ff_dump_effect(struct ff_effect *effect)
if (effect->replay.length)
length = wine_dbg_sprintf("%u ms", effect->replay.length);
TRACE("type: 0x%x %s, id %d, direction 0x%x (angle: %.2f), time length %s, start delay %u ms\n",
TRACE("type 0x%x %s, id %d, direction 0x%x (source angle %.2f), time length %s, start delay %u ms\n",
effect->type, type, effect->id, effect->direction, angle, length, effect->replay.delay);
if (effect->trigger.button || effect->trigger.interval)
TRACE("trigger button %u, re-trigger interval %u ms\n",
TRACE(" -> trigger button %u, re-trigger interval %u ms\n",
effect->trigger.button, effect->trigger.interval);
if (effect->type == FF_PERIODIC)
@ -118,8 +118,9 @@ static void ff_dump_effect(struct ff_effect *effect)
FE(FF_CUSTOM);
}
#undef FE
TRACE(" -> waveform 0x%x %s, period %u, magnitude %d, offset %d, phase %u, custom len %d\n",
per->waveform, wave, per->period, per->magnitude, per->offset, per->phase, per->custom_len);
angle = ff_effect_direction_to_rad(per->phase) * 180 / M_PI;
TRACE(" -> waveform 0x%x %s, period %u ms, magnitude %d, offset %d, phase 0x%x (angle %.2f), custom len %d\n",
per->waveform, wave, per->period, per->magnitude, per->offset, per->phase, angle, per->custom_len);
env = &per->envelope;
}
else if (effect->type == FF_CONSTANT)
@ -137,7 +138,7 @@ static void ff_dump_effect(struct ff_effect *effect)
else if (effect->type == FF_RUMBLE)
{
struct ff_rumble_effect *rumble = &effect->u.rumble;
TRACE(" -> strong/weak magnitude %d/%d\n", rumble->strong_magnitude, rumble->weak_magnitude);
TRACE(" -> strong/weak magnitude %u/%u\n", rumble->strong_magnitude, rumble->weak_magnitude);
}
else if (effect->type == FF_SPRING || effect->type == FF_FRICTION ||
effect->type == FF_DAMPER || effect->type == FF_INERTIA)
@ -154,7 +155,7 @@ static void ff_dump_effect(struct ff_effect *effect)
}
if (env)
TRACE(" -> envelope attack length/level %u/%u, fade length/level %u/%u\n",
TRACE(" -> envelope attack length(ms)/level %u/%u, fade length(ms)/level %u/%u\n",
env->attack_length, env->attack_level, env->fade_length, env->fade_level);
}