path grid recrod

Everything about development and the OpenMW source code.
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: path grid recrod

Post by corristo »

I'm not deferring path grid loading.

See update about lookup & structure
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: path grid recrod

Post by Zini »

Then you have an unnecessary ESM_Context member in your struct.

Also, I would use vectors for points and edges. In it's current state the pathgrid struct will not work, because it is violating the rule of three. We generally don't want to see new[]/delete[] in OpenMW.
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: path grid recrod

Post by corristo »

thanks for pointing out!
I'll use vector.
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: path grid recrod

Post by corristo »

What if I'd break cell_store.hpp & reclists.hpp into header & implementation files?
Recompiling a lot of code after every change in header is a pain.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: path grid recrod

Post by Zini »

Almost everything in there is a template, so that is not possible.
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: path grid recrod

Post by corristo »

oh, ok.
Forgot about that feature of C++.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: path grid recrod

Post by Zini »

I see two more problems with your code.

1. You still have redundant pointCount and edgeCount members in the PathGrid struct. Remove these, please.

2. You are storing a pointer to the PathGrid in the CellStore. Please don't! The CellStore is only for mutable cell data.
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: path grid recrod

Post by corristo »

1. Fixed, but not pushed.
2. So I should retrieve path grid from esm store every time?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: path grid recrod

Post by Zini »

Yes.
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: path grid recrod

Post by corristo »

Encountered strange bug =\
I'm passing reference to ESMStore to Debugging, so I can get pathgrids from it on demand.
ESMStore always passed by reference, but somehow it duplicated, and Debugging refers to copy and almost any operation on PathgridList maps (intGrids & extGrids) leads to crash.

I've tried different approach: I'm passing reference to Environment to Debugging, and using mEnvironment.mWorld->getStore. This way it works ok.

It would be awesome if someone can review and find where I'm screwed up.

see RenderingManager & Debugging classes.

commit with workaround

commit with bug
Post Reply