Like this: void addObject (const MWWorld::Ptr& ptr, const MWWorld::Class& _class)? Then call insertObjectRendering() inside.
What about insertObject(), just call it directly from insertCellRefList()?
EDIT: Got addobject working. Now I just need to know if I need another function like this for insertObject()
MWRender Refactoring
Re: MWRender Refactoring
There is already an addObject function in RenderingManager. You already fixed the signature. Further changes are not required. Just use it. The implementation of this function will more or less be the same as what you tried to do about rendering in the Scene class.
I think I should explain the design once more:
The RenderingInterface is a privileged interface for use exclusively by the MWClass hierarchy. It exposes some implementation details that are needed by MWClass. This is a more narrowly defined opening in the encapsulation than you can achieve with an ordinary friend declaration.
This is the only place where implementation details of mwrender are accessed from outside of mwrender. Everything else should be run through RenderingManager. If you are not mwrender than the other classes of mwrender (Objects and such) don't exist for you (and unless you are in MWClass that includes RenderingInterface).
I think I should explain the design once more:
The RenderingInterface is a privileged interface for use exclusively by the MWClass hierarchy. It exposes some implementation details that are needed by MWClass. This is a more narrowly defined opening in the encapsulation than you can achieve with an ordinary friend declaration.
This is the only place where implementation details of mwrender are accessed from outside of mwrender. Everything else should be run through RenderingManager. If you are not mwrender than the other classes of mwrender (Objects and such) don't exist for you (and unless you are in MWClass that includes RenderingInterface).
Re: MWRender Refactoring
Ok, I just committed more code that I would like you to look at.
Re: MWRender Refactoring
Looks good. We should be near the point now where the new mwrender system compiles and at least partially runs.
Re: MWRender Refactoring
Okay, committed some more stuff. Player had to be changed slightly. OpenMW compiles and links properly. I have not tried running the executable, I imagine since so much has been changed it may crash. I hope it won't.
Re: MWRender Refactoring
If it doesn't crash, you're a god. When I was writing the game I was writing (in LUA ) my first runs after major code changes were always "find the crash" runs.jhooks1 wrote:I imagine since so much has been changed it may crash. I hope it won't.
Re: MWRender Refactoring
So far it runs, but the scene is not flipped right. Also, crashes on cell change.
Re: MWRender Refactoring
I don't understand what you mean with that.but the scene is not flipped right
Re: MWRender Refactoring
It means that everything is slanted sideways. I think the problem is that mwRoot needs to be passed into objects and that should fix it.
Re: MWRender Refactoring
It seems we are creating a separate root node in RenderingManager, which sits below the actual OGRE root node. Did the old code do the same? I remember it differently, but I could be wrong about it.
One easy fix you could try is to remove this additional node (mwRoot) altogether and instead rotate the OGRE root node.
One easy fix you could try is to remove this additional node (mwRoot) altogether and instead rotate the OGRE root node.