New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dcparser: Updated out-of-panda dc_sort_inheritance_by_file variable to match PRC default #1473
base: master
Are you sure you want to change the base?
Conversation
…o match PRC default - See dcClass.cxx PRC variable for dc_sort_inheritance_by_file (defaults to true)
The description of the variable says this is a "temporary hack", and the past tense "sorted" suggests that the intended new behaviour is for it to be disabled, not enabled? See 14374ee for the relevant change. A cursory look at this change suggests that not sorting is the "new" behaviour.
Perhaps @drwrose might remember? |
This is a tricky issue. In my opinion, we should get rid of Here's a collection of "cases" that the setting has an effect on: In Panda3D, unnamed fields are only inherited when In Astron, unnamed fields are always inherited (they aren't even checked): https://github.com/Astron/Astron/blob/master/src/dclass/dc/Class.cpp#L46 In fact... none of my production DC files have any unnamed fields! (How do you even create an unnamed field?)
https://github.com/panda3d/panda3d/blob/master/direct/src/dcparser/dcClass.cxx#L608 I believe this is erroneous behavior. If
https://github.com/panda3d/panda3d/blob/master/direct/src/dcparser/dcFile.cxx#L432 In my opinion, we should remove Case 1: I believe unnamed fields should always be inherited. In fact, we shouldn't even check if it's unnamed or not. This is consistent with Astron. Case 2: I think it's fine to keep the fields sorted. If we remove this functionality, we would also have to update Astron. Case 3: I think we should fix this and this should definitely not rely on the variable. Case 4: DC hash should be always generated as if |
I'll trust your judgement on this, feel free to file PRs or open issues with the suggested changes. |
Issue description
Using dcparser out-of-panda with multiple .DC files results in a compatibility error as Panda sorts inheritance by file by default. In particular, field numbers do not match.
Solution description
See dcClass.cxx PRC variable for dc_sort_inheritance_by_file (defaults to true)
Checklist
I have done my best to ensure that…