Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor path.cpp #79

Closed
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e8f15f6
copy bin to diablo dir on build
silverhammermba Jun 24, 2018
f5ed160
clean up path h func
silverhammermba Jun 24, 2018
c1ab257
simplify destination check
silverhammermba Jun 24, 2018
598c9a8
simplify base path finding function
silverhammermba Jun 24, 2018
4524730
correct comment
silverhammermba Jun 24, 2018
2448cd1
simplify variable usage in parent path function
silverhammermba Jun 24, 2018
e0ce383
update comments, clean up parent_path function
silverhammermba Jun 24, 2018
8814864
simplify new_step
silverhammermba Jun 24, 2018
d8bb583
simplify solid_pieces function
silverhammermba Jun 24, 2018
be17c53
slightly simplify use of path_2_nodes
silverhammermba Jun 25, 2018
b74cf38
replace path_2_nodes with a simple pointer
silverhammermba Jun 25, 2018
d03600a
simplify node getting functions
silverhammermba Jun 25, 2018
1bdb854
theory about how path_next_node works
silverhammermba Jun 25, 2018
d4d87cf
simplify set_coords, fix bug I introduced in next_node
silverhammermba Jun 25, 2018
f76ce09
moar comments
silverhammermba Jun 25, 2018
a5f7727
simplify some variable declarations
silverhammermba Jun 26, 2018
f18b95b
better names for things
silverhammermba Jun 26, 2018
97d7703
simplify parent variable usage
silverhammermba Jun 26, 2018
48ab200
simplify the reverse path walk
silverhammermba Jun 26, 2018
c988e81
simplify the path reversal
silverhammermba Jun 26, 2018
0c0d6c1
separate node count from path array
silverhammermba Jun 26, 2018
11fc274
undo makefile change
silverhammermba Jun 26, 2018
4adbbd9
Merge remote-tracking branch 'upstream/master' into path_refactor
silverhammermba Jun 26, 2018
e3e7411
make comment more confident
silverhammermba Jun 26, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
moar comments
silverhammermba committed Jun 25, 2018
commit f76ce0902b8185468f00f3ce897bb47bd11d8e8e
7 changes: 6 additions & 1 deletion Source/path.cpp
Original file line number Diff line number Diff line change
@@ -318,19 +318,24 @@ void __fastcall path_set_coords(PATHNODE *pPath)
}
}

/* push pPath onto the pnode_tblptr stack */
void __fastcall path_push_active_step(PATHNODE *pPath)
{
pnode_tblptr[gdwCurPathStep++] = pPath;
}

/* pop and return a node from the pnode_tblptr stack */
PATHNODE *__cdecl path_pop_active_step()
{
return pnode_tblptr[--gdwCurPathStep];
}

/* zero one of the 300 preallocated path nodes and return a pointer to it, or
* NULL if none are available
*/
PATHNODE *__cdecl path_new_step()
{
if ( pnode_vals[0] == 300 ) return 0;
if ( pnode_vals[0] == 300 ) return NULL;
PATHNODE* new_node = &path_nodes[pnode_vals[0]++];
memset(new_node, 0, sizeof(struct PATHNODE));
return new_node;