Fix bug: webgl 'manual instanced rendering' return -> continue, do not count as drawn index.

This commit is contained in:
Aiosa 2024-11-26 14:08:32 +01:00
parent 17f13885c7
commit ef7628f098

View File

@ -374,13 +374,13 @@
// iterate over tiles and add data for each one to the buffers // iterate over tiles and add data for each one to the buffers
for(let tileIndex = 0; tileIndex < tilesToDraw.length; tileIndex++){ for(let tileIndex = 0; tileIndex < tilesToDraw.length; tileIndex++){
let tile = tilesToDraw[tileIndex].tile; let tile = tilesToDraw[tileIndex].tile;
let indexInDrawArray = tileIndex % maxTextures;
let numTilesToDraw = indexInDrawArray + 1;
const textureInfo = this.getDataToDraw(tile); const textureInfo = this.getDataToDraw(tile);
if (!textureInfo) { if (!textureInfo) {
return; continue;
} }
let indexInDrawArray = tileIndex % maxTextures;
let numTilesToDraw = indexInDrawArray + 1;
this._getTileData(tile, tiledImage, textureInfo, overallMatrix, indexInDrawArray, texturePositionArray, textureDataArray, matrixArray, opacityArray); this._getTileData(tile, tiledImage, textureInfo, overallMatrix, indexInDrawArray, texturePositionArray, textureDataArray, matrixArray, opacityArray);
if( (numTilesToDraw === maxTextures) || (tileIndex === tilesToDraw.length - 1)){ if( (numTilesToDraw === maxTextures) || (tileIndex === tilesToDraw.length - 1)){