From 10401e6b459e5eb765be3e105e60823cbae53ed1 Mon Sep 17 00:00:00 2001 From: Adam Le Doux Date: Fri, 29 Mar 2024 19:04:37 -0700 Subject: [PATCH] fix bug rendering exits and endings --- CHANGELOG.md | 4 ++++ editor/script/engine/renderer.js | 8 +++++++- editor/script/engine/world.js | 2 +- editor/script/system/system.js | 9 --------- package.json | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24a5e81d..57b07b08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 8.10 + +- fix: fix bug rendering exits and endings + ## 8.9 - new & updated russian translations by Paul Bid (павел бид) diff --git a/editor/script/engine/renderer.js b/editor/script/engine/renderer.js index c5f9594b..3ee1f5d8 100644 --- a/editor/script/engine/renderer.js +++ b/editor/script/engine/renderer.js @@ -135,7 +135,13 @@ this.GetFrameCount = function(drawingId) { // todo : forceReset option is hacky? this.ClearCache = function(forceReset) { if (forceReset === undefined || forceReset === true) { - bitsy.deleteAllTiles(); + // delete all tiles from system memory before clearing the cache + for (var cacheId in drawingCache.render) { + var tiles = drawingCache.render[cacheId]; + for (var i = 0; i < tiles.length; i++) { + bitsy.delete(tiles[i]); + } + } } drawingCache.render = {}; diff --git a/editor/script/engine/world.js b/editor/script/engine/world.js index be60154e..f5d83ff4 100644 --- a/editor/script/engine/world.js +++ b/editor/script/engine/world.js @@ -2,7 +2,7 @@ // is this the right place for this to live? var version = { major: 8, // major changes - minor: 9, // smaller changes + minor: 10, // smaller changes devBuildPhase: "RELEASE", }; function getEngineVersion() { diff --git a/editor/script/system/system.js b/editor/script/system/system.js index b932c46e..fafb56e9 100644 --- a/editor/script/system/system.js +++ b/editor/script/system/system.js @@ -637,15 +637,6 @@ function BitsySystem(name) { self._free(tile); }; - this.deleteAllTiles = function() { - if (tilePoolStart != null) { - for (var i = 0; i < tilePoolSize; i++) { - var tile = tilePoolStart + i; - this.delete(tile); - } - } - }; - this.fill = function(block, value) { var len = memory.blocks[block].length; for (var i = 0; i < len; i++) { diff --git a/package.json b/package.json index 55af4ecf..19cd3c90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitsy", - "version": "8.9.0", + "version": "8.10.0", "description": "make tiny games, worlds, and stories", "author": "Adam Le Doux", "devDependencies": {