|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002874||FSSCP||Pilot data||public||2013-05-16 03:25||2013-08-14 15:32|
|Platform||x64||OS||Windows 7||OS Version|
|Target Version||Fixed in Version|
|Summary||0002874: Pilot conversion not preserving axis mappings|
|Description||Conversion from Inferno pilots to the new pilot code is not preserving the mappings for the axis controls, resulting in them being set to their defaults regardless of how the Inferno pilot is configured.|
|Steps To Reproduce||1. Create a new pilot in FSO 3.6.18 or any build that uses the Inferno pilot code.|
2. In the control configuration screen, change one or more of the mappings for the last five controls in the Ship category. Save your changes.
3. Exit FSO.
4. Load the pilot created earlier in FSO 3.7.0 or any nightly build that uses the new pilot code.
5. Check the control settings that you changed in step 2.
|Tags||No tags attached.|
|Noticed this while going through the controls code... I didn't really see anything in there that would suggest that the analog controls were being saved. Since it's along my alley, I'll see if I can whip up a quick patch soonish.|
Tracked down the problem to the conversion process. A necessary index of how many joystick axis was not included in the converted .plr file, thereby preventing the reading of the file and forcing the joystick axes to default values.
Attached patch includes a fix to the include the needed index, as well as a new warning when a section was not completely read, which should help track down any future data corruptions of this nature.
Tested & works as expected with x/y/z/Rz axis on my joystick.
I only have one question about the patch, you've changed the PLR from using an int to a ushort to store NUM_JOY_AXIS_ACTIONS, this will probably cause 3.6.19 -> 3.7.0RC2 pilots joystick controls config to be read incorrectly after the patch is applied? Perhaps the file version should be bumped and appropriate version handling added, otherwise just stick with the int? (or just accept the breakage & move on, as the new-pilotfile feature hasn't been in an official release yet :D)
Last edited: 2013-08-11 08:19
hmm, We probably could keep the int without too much of a loss. It's only 2 bytes more than the ushort, but the embedded engineer in me keeps shaking his head.
Uploaded another version of the patch that keeps the int instead of using the ushort. Pro's outweigh the con's, and I don't think many people are going to miss the 2 bytes.
|Looks good, go ahead & commit :)|
|Fix committed to trunk@9748.|
fs2open: trunk r9748
Timestamp: 2013-08-14 16:43:39
|fix for mantis 2874: Pilot conversion not preserving axis mappings. Also adds a warning that is activated whenever the pilot loading process has to skip bytes of "extra/unknown data" in a section.|
|mod - /trunk/fs2_open/code/pilotfile/pilotfile_convert.h|
|mod - /trunk/fs2_open/code/pilotfile/plr.cpp|
|mod - /trunk/fs2_open/code/pilotfile/plr_convert.cpp|
|2013-05-16 03:25||Yarn||New Issue|
|2013-05-18 11:37||z64555||Note Added: 0015068|
|2013-07-19 22:58||niffiwan||Relationship added||related to 0002901|
|2013-08-10 07:59||z64555||File Added: mantis_2874.patch|
|2013-08-10 07:59||z64555||Note Added: 0015221|
|2013-08-10 08:00||z64555||Assigned To||=> z64555|
|2013-08-10 08:00||z64555||Status||new => code review|
|2013-08-11 06:51||niffiwan||Note Added: 0015227|
|2013-08-11 08:07||z64555||Note Added: 0015228|
|2013-08-11 08:16||z64555||File Added: mantis_2874_1.patch|
|2013-08-11 08:18||z64555||Note Edited: 0015228||View Revisions|
|2013-08-11 08:19||z64555||Note Edited: 0015228||View Revisions|
|2013-08-11 16:31||niffiwan||Note Added: 0015229|
|2013-08-14 15:32||z64555||Changeset attached||=> fs2open trunk r9748|
|2013-08-14 15:32||z64555||Note Added: 0015237|
|2013-08-14 15:32||z64555||Status||code review => resolved|
|2013-08-14 15:32||z64555||Resolution||open => fixed|