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
Standardize TypedWritable #1630
Comments
Thank you for sharing your frustrations. We can't use a vtable call for The reason why we do need a separate virtual For the default TextureStage, it is important that it is always resolved to the singleton default TextureStage, so checking the field and returning this pointer in I wasn't aware of the existence of those templates or documentation files. I agree we need to update or remove them, and also update the remaining cases of factory functions that are not called Please note the existence of this document, which contains my own notes as I wrote my own bam writer library, though it looks like you might already be largely past the point where this might be useful. |
Ah, right. The only reason I could see keeping registration in each cxx is to keep all class-specific behavior there, but now that every registered function is called
Makes sense, I haven't looked into runtime behavior much yet.
Saves me the work of having to go through each bam revision when adding crate documentation, thanks! |
I've been implementing BAM support recently and with that, I've hit a lot of flaws in documentation of how it actually works. There's putil/typedWritable.C.template and putil/typedWritable.h.template but they haven't been touched since Panda3D was originally open sourced, and in the first handful of commits,
make_Generic
shifted tomake_from_bam
, but a lot of objects were never updated, including the supposed templates.You can see which ones use
make_from_bam
and which use the older style by searching forregister_factory
, which brings up a lot of objects that haven't been touched since the initial revision 24 years ago. There's also this documentation that doesn't even get the name of the template file right.While I'm here, do we even need
register_with_read_factory
if we have to initialize it manually instead of using a vtable call? The majority ofregister_with_read_factory
functions only have a single registration, there's only 3 I saw that need multiple.If you combine all registrations into the config files, you only have to call
BamReader::get_factory()
once per config instead of once per registry function. Either way, you need to refer to individual classes, so you may as well just refer to their functions you're trying to register instead of having a one-liner function in 200+ different files.I've just found it hard to track down where each object is reading data from the BamReader, you have to look at
fillin
but it's not always called when reading a BAM file so you have to look formake_from_bam
but it's not always called that so you have to look atregister_with_read_factory
. I don't want three layers of abstraction for every object I look at, I want one.The text was updated successfully, but these errors were encountered: