diff options
author | Hinsbart <liu.gam3@gmail.com> | 2016-04-22 21:44:56 +0200 |
---|---|---|
committer | Hinsbart <liu.gam3@gmail.com> | 2016-04-23 15:26:07 +0200 |
commit | 9201b5a27c0672bc249d2ba2a1e26f08b16b5536 (patch) | |
tree | 058e48561f9ad7c4ad99acfdadcf7b85b544e2a0 /core/io | |
parent | 7d89a8b7481c1e172958010366b3735b6d000591 (diff) |
Encode axis_value in Variant for InputEvent::JOYSTICK_MOTION.
Fixes a bug that caused InputMap actions which have been set to joystick axes
not to work correctly on exported builds as the axis_value property wouldn't be serialized into engine.cfb.
See recent discussion in #49 (Post 121+)
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/marshalls.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 1733aecd46..60617e1237 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -438,8 +438,9 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * case InputEvent::JOYSTICK_MOTION: { ie.joy_motion.axis=decode_uint32(&buf[12]); + ie.joy_motion.axis_value=decode_float(&buf[16]); if (r_len) - (*r_len)+=4; + (*r_len)+=8; } break; } @@ -1154,8 +1155,9 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { int axis = ie.joy_motion.axis; encode_uint32(axis,&buf[llen]); + encode_float(ie.joy_motion.axis_value, &buf[llen+4]); } - llen+=4; + llen+=8; } break; } |