| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
This plugging is quick and dirty, we can optimize it later. This part
of the code is performance sensitive. Even this plugging is much faster
than the old radius_iterator though: it did the full square, did double
squaring for every position in it, etc.
|
| |
|
|
|
|
|
| |
Most iterators that allow LOS checks typically have none, it'd be weird to
refer to that as "arena".
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had to rename distance() (in coord.h) to distance2() because it conflicts
with the STL function to compare 2 iterators. Not a bad change given how it
returns the square of the distance anyway.
I also had to rename the message global variable (in message.cc) to buffer.
I tried to fix and improve the coding style has much as I could, but I
probably missed a few given how huge and tedious it is.
I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool
and util/levcomp.*, because I have no clue about those.
|
|
|
|
|
| |
This is incomplete, partially because of me getting bored, partially because
of doubts about the point of leaving simple addition/etc in parentheses.
|
| |
|
|
|
|
|
|
|
| |
Having both it and LOS_RADIUS is misleading, especially as they're
arbitrarily used. This distinction doesn't make sense anyway, as any
LOS changes need to be done at runtime, only the max matters during
compilation.
|
|
|
|
|
|
|
|
|
| |
These accumulate but never get removed; no wonder compilation times keep
rising.
The includes.sh script has lots of false negatives (and positives...), and
can't check .h files which cause the biggest slowdown, it'd be nice to run
multidelta on those somehow.
|
|
|
|
|
|
|
|
|
|
|
| |
Its name suggests it's about line of effect, while in fact it's both effect
and sight. Thus, I've split its uses into LOS_SOLID and LOS_SOLID_SEE -- the
former is what LOS_SOLID was usually understood to mean, the latter is what it
actually was (being targettable with an arrow/beam).
The difference is: LOS_SOLID_SEE obeys clouds.
The name of the latter is abysmal -- if you have a better idea, please sed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
There were two functions: one used no cache and ignored clouds, another one
has a cache and accepts different LOS models.
I added a new cached model: LOS_SOLID (using opc_solid). All but one uses
of opc_fullyopaque (two-argument cell_see_cell()) were bugs to me, so they
were moved to a different model.
This makes Refrigeration not work through glass walls anymore (it still
works though clouds).
|
|
|
|
|
|
| |
There are two speed-ups:
* no need to check rays in the bounding square beyond a circle
* don't calculate both LOS_DEFAULT and LOS_NO_TRANS every time
|
|
|
|
|
|
|
|
|
|
| |
It's the biggest CPU hog on the sprint rest test, especially its unwoken
version.
Changes:
1. no use of iterators (the other biggest hog, which one deserves the title
is unclear due to them being entangled)
2. a π/4 optimization: no need to clear corners of a rectangle
|
|
|
|
|
|
|
|
|
|
| |
This should help against the signed char problems, and is good for
code readability. Now, if you have a char, it's either an untyped
in-memory byte, or a symbol inside a string. Small numbers are instead
[u]int8_t, ints, an enum type, or, in so many cases, bools.
I didn't touch any of the tiles code, as it's currently broken and I don't
want to risk making it unbroken harder.
|
|
|
|
| |
Surprisingly, this speeds things up by nearly 1%.
|
|
|
|
|
|
| |
This reverts commit 46bb005ece25b6dc17a2fa46bd2573687334e5af.
Too expensive with increase LOS calculations once monsters wake up.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Keep a count of how many LOS-affecting clouds change last turn,
and invalidate LOS at the start of manage_clouds if there were
more than 10 for now.
Additionally, keep track of whether LOS has been completely
invalidated, and skip all LOS invalidations as long as this
is the case.
This should be a safe change in terms of functionality, and
speed things up quite a bit provided that the cloud management
code doesn't cause LOS computations. (Forest fires currently
check player LOS for messaging, and gloom dissipation checks
halos, so if these are around, improvements may be limited.)
|
|
|
|
|
| |
This speeds up Sprint resting quite a bit for me. It's quite
likely that more could be done.
|
| |
|
|
|