Item::Clone
-
- Halfling
- Posts: 51
- Joined: Thu Feb 14, 2019 11:27 am
- x 8
Item::Clone
The implementation of Item::clone is deactivated (if 0) in OgreItem.cpp.
Is this intentional? It is still in the header.
I am migrating an application to ogre-next and had Entity clone calls I wanted to change to Item clone calls and that resulted in broken linking.
Is this intentional? It is still in the header.
I am migrating an application to ogre-next and had Entity clone calls I wanted to change to Item clone calls and that resulted in broken linking.
-
- OGRE Team Member
- Posts: 5446
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1348
Re: Item::Clone
Hi!
There is no clone() functionality because maintaining the cloning process by hand was error prone (i.e. a variable could be missing, gets out of date, etc)
Thus it was postponed until it could be automated but we simply forgot about it.
Ironically we did get an automated solution now though. In Other/clone_datablock there is a python script which parses OgreHlmsUnlitDatablock and OgreHlmsPbsDatablock to automatically generate a clone implementation for HlmsUnlitDatablock & HlmsPbsDatablock respectively.
It could be adapted to do the same for OgreItem.h / Item
There is no clone() functionality because maintaining the cloning process by hand was error prone (i.e. a variable could be missing, gets out of date, etc)
Thus it was postponed until it could be automated but we simply forgot about it.
Ironically we did get an automated solution now though. In Other/clone_datablock there is a python script which parses OgreHlmsUnlitDatablock and OgreHlmsPbsDatablock to automatically generate a clone implementation for HlmsUnlitDatablock & HlmsPbsDatablock respectively.
It could be adapted to do the same for OgreItem.h / Item
-
- Halfling
- Posts: 51
- Joined: Thu Feb 14, 2019 11:27 am
- x 8
Re: Item::Clone
I reactivated and used the implementation with a little twist and it seemed to work.
I guess I will take another look at the results and see if something is going wrong for my current use case. Thanks for the tip.
Nice to hear that a general solution may be around the corner anyway.
Last part in my comment was that we still have a method prototype in the OgreItem.h.
Was it intentionally left in the header (cause at that time you wanted to make a Item::clone happen soon) or just an oversight. I am trying to understand the reasoning, cause I was very surprised by it.
I guess I will take another look at the results and see if something is going wrong for my current use case. Thanks for the tip.
Nice to hear that a general solution may be around the corner anyway.
Last part in my comment was that we still have a method prototype in the OgreItem.h.
Was it intentionally left in the header (cause at that time you wanted to make a Item::clone happen soon) or just an oversight. I am trying to understand the reasoning, cause I was very surprised by it.
-
- OGRE Team Member
- Posts: 5446
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1348
Re: Item::Clone
Just an oversightHilarius86 wrote: ↑Mon Jul 20, 2020 9:14 am Was it intentionally left in the header (cause at that time you wanted to make a Item::clone happen soon) or just an oversight.