Menu

Commit [r931]  Maximize  Restore  History

Making some incremental optimizations to net.blockout.meta.BlockGenerator.

Adding inner class BlockInfo which is essentially a net.blockout.Block except
that it's not subjected to as much heap allocation or error checking. Adding
function getBlockOrientationLookup() which returns a HashMap of String rotation
to BlockInfo object, which will be used in tandem with the other new function,
speedyFindRotatedBlock(), which is an attempt to improve upon the existing
function findRotatedBlock() as far as performance goes. Adding an internal
static HashMap named 's_rotationsCanonicalPlus' which maps the existing
canonical rotations, plus "x", "-x", "y", "-y", "z", or "-z" tacked onto each
(considers all permutations), mapping that to the actual canonical rotation.
This is used by simplifyCompositeRotation() which greatly speeds up its
performance in the most common use cases. A second two-arg
simplifyCompositeRotation() is needed, which allows this cache to be bypassed,
so that intialization calls can still be made with the use of that function,
before the extra cache is created.

nerius 2023-08-30

changed /blockout/src/net/blockout/meta/BlockGenerator.java
/blockout/src/net/blockout/meta/BlockGenerator.java Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.