guts of nhl_abs_coord; convert a coordinate relative to a map or room * into an absolute coordinate in svl.level.locations. * * If there is no enclosing map or room, the coordinates are assumed to be * absolute already. * * Part of the reason this is a function is to make it clearer in the calling * code that this conversion is what is intended. * * NOTE: if the coordinates are going to g
| 4769 | * doesn't is the input coordinates being negative. get_location will treat |
| 4770 | * that as "level designer wants a random coordinate".) */ |
| 4771 | void |
| 4772 | cvt_to_abscoord(coordxy *x, coordxy *y) |
| 4773 | { |
| 4774 | /* since commit 99715e0, xstart and ystart are only relevant in mklev when |
| 4775 | * maps are being used, and 0 otherwise. It is possible in the future that |
| 4776 | * map positions and dimensions can be saved and retrieved outside of |
| 4777 | * mklev which would reintroduce nonzero xstart/ystart/xsiz/ysiz, but |
| 4778 | * this is not currently implemented, so this function can be assumed to |
| 4779 | * have no effect outside of mklev. |
| 4780 | */ |
| 4781 | if (gc.coder && gc.coder->croom) { |
| 4782 | *x += gc.coder->croom->lx; |
| 4783 | *y += gc.coder->croom->ly; |
| 4784 | } else { |
| 4785 | *x += gx.xstart; |
| 4786 | *y += gy.ystart; |
| 4787 | } |
| 4788 | } |
| 4789 | |
| 4790 | /* inverse of cvt_to_abscoord; turn an absolute svl.level.locations coordinate |
| 4791 | * into one relative to the current map or room. */ |
no outgoing calls
no test coverage detected