MWRender Refactoring

Everything about development and the OpenMW source code.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: MWRender Refactoring

Post by jhooks1 »

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()
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: MWRender Refactoring

Post by Zini »

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).
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: MWRender Refactoring

Post by jhooks1 »

Ok, I just committed more code that I would like you to look at.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: MWRender Refactoring

Post by Zini »

Looks good. We should be near the point now where the new mwrender system compiles and at least partially runs.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: MWRender Refactoring

Post by jhooks1 »

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.
User avatar
raevol
Posts: 3093
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: MWRender Refactoring

Post by raevol »

jhooks1 wrote:I imagine since so much has been changed it may crash. I hope it won't.
If it doesn't crash, you're a god. :P When I was writing the game I was writing (in LUA :P ) my first runs after major code changes were always "find the crash" runs.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: MWRender Refactoring

Post by jhooks1 »

So far it runs, but the scene is not flipped right. Also, crashes on cell change.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: MWRender Refactoring

Post by Zini »

but the scene is not flipped right
I don't understand what you mean with that.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: MWRender Refactoring

Post by jhooks1 »

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.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: MWRender Refactoring

Post by Zini »

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.
Post Reply