mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 15:40:43 +00:00
Refactor smooth animation logic in TerritoryWebGLRenderer
- Updated seed validation checks to simplify smooth animation handling. - Adjusted comments for clarity regarding seed conditions and animation behavior. - Enhanced performance by skipping unnecessary computations when seed data is invalid.
This commit is contained in:
@@ -3204,9 +3204,10 @@ export class TerritoryWebGLRenderer {
|
||||
bool hasOldSeed = seedOld.x >= 0.0;
|
||||
bool hasNewSeed = seedNew.x >= 0.0;
|
||||
|
||||
// If neither seed is valid, this tile is far from any change - skip smooth logic
|
||||
if (!hasOldSeed && !hasNewSeed) {
|
||||
// Just use the current color, no animation needed
|
||||
// If either seed is invalid, we can't compute meaningful distances
|
||||
// for smooth animation - just use the current color
|
||||
if (!hasOldSeed || !hasNewSeed) {
|
||||
// Skip smooth animation - show current state
|
||||
} else {
|
||||
float oldDistance = hasOldSeed
|
||||
? max(length(seedOld - mapCoord) - 0.5, 0.0)
|
||||
|
||||
Reference in New Issue
Block a user