Skip to content

Commit 4c395e6

Browse files
committed
Use __used rather than __lastFrameVisited
1 parent 7fb871f commit 4c395e6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/base/TilesRendererBase.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ import { UNLOADED, LOADING, PARSING, LOADED, FAILED } from './constants.js';
1414
*/
1515
const priorityCallback = ( a, b ) => {
1616

17-
if ( a.__lastFrameVisited !== b.__lastFrameVisited ) {
18-
19-
// the lastFrameVisited tracks the last frame where a tile was used
20-
return a.__lastFrameVisited - b.__lastFrameVisited;
21-
22-
} else if ( a.__inFrustum !== b.__inFrustum ) {
17+
if ( a.__inFrustum !== b.__inFrustum ) {
2318

2419
// prioritize loading whatever is in the frame
2520
return a.__inFrustum ? 1 : - 1;
2621

27-
} else if ( a.__error !== b.__error ) {
22+
} else if ( a.__used !== b.__used ) {
23+
24+
// prioritize tiles that were used most recently
25+
return a.__used ? 1 : - 1;
26+
27+
} if ( a.__error !== b.__error ) {
2828

2929
// tiles which have greater error next
3030
return a.__error - b.__error;

0 commit comments

Comments
 (0)