• botch: PathNode fix/optimization
    0 replies, posted
[B]Revision 916[/B] [INDENT]PathNode fix/optimization Issue was on disconnect CPathNodeManager would cause a crash because it would double delete things. fix was to replace all the new and delete calls that would just stick the pointers into a vector with using a list (non pointer) now clearing the list deallocated all CNodeInfo 's. While I was in there I optimized the functions a bit inside PathNode.cpp ( mainly using squared distance vs regular distance for comparing ). Also added m_Index to CNodeInfo which can be used to avoid reprocessing data when doing a double iteration on nodes. Examples in the code. I found a few things that stuck out to me too as a little awkward. Marked them with INSPECT in the code. might be worth looking at. at any rate calling disconnect doesn't give a crash anymore. the CNodeINfo::Pair struct can probably be done away with but kept it in because i want to go over later how it can be used to optimize more. otherwise theres 16bits unused in CNodeInfo because of m_Index being a unsigned short and alignment being 32. Doesn't seem like IntFlags is being used currently, maybe it could be ShortFlags ? after defining that i mean.[/INDENT][B]Changed Files:[/B] [LIST] [*]trunk/Source/worldcommon/PathNode.cpp [*]trunk/Source/worldcommon/PathNode.h [/LIST] Committed By [B]Pat Glynn[/B]
Sorry, you need to Log In to post a reply to this thread.