[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 359a0facc5 140/472: Optimize empty cell rendering
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 359a0facc5 140/472: Optimize empty cell rendering |
Date: |
Thu, 6 Jan 2022 21:59:19 -0500 (EST) |
branch: elpa/pacmacs
commit 359a0facc5f5ef75d7fd2ae347a26d9d503b1a5b
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Optimize empty cell rendering
---
pacmacs.el | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/pacmacs.el b/pacmacs.el
index 0bf81b8ce2..e109270cab 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -59,7 +59,7 @@
(defvar pacmacs-wall-cells nil)
(defvar pacmacs-pills nil)
-(defvar pacmacs-empty-cell nil)
+(defvar pacmacs--empty-cell nil)
(defvar pacmacs-board nil)
(defvar pacmacs-track-board nil)
@@ -205,13 +205,10 @@
(plist-put pacmacs-life-icon :current-frame 2))
(pacmacs-render-anim pacmacs-life-icon))
-(defun pacmacs--make-empty-cell ()
- (if pacmacs-empty-cell
- pacmacs-empty-cell
- (setq pacmacs-empty-cell
- (list :current-animation
- (pacmacs-make-anim (list (pacmacs-make-frame '(0 0 40 40) 100))
- (pacmacs-create-transparent-block 40
40))))))
+(defun pacmacs--render-empty-cell ()
+ (when (not pacmacs--empty-cell)
+ (setq pacmacs--empty-cell (pacmacs-create-transparent-block 40 40)))
+ (pacmacs-insert-image pacmacs--empty-cell '(0 0 40 40)))
(defun pacmacs-step-object (game-object)
(plist-bind ((row :row)
@@ -371,8 +368,10 @@
(pacmacs-insert-image sprite-sheet current-frame)))
(defun pacmacs-render-object (anim-object)
- (let* ((anim (plist-get anim-object :current-animation)))
- (pacmacs-render-anim anim)))
+ (if anim-object
+ (let* ((anim (plist-get anim-object :current-animation)))
+ (pacmacs-render-anim anim))
+ (pacmacs--render-empty-cell)))
(defun pacmacs--put-object (anim-object)
(when anim-object
@@ -432,7 +431,7 @@
(when pacmacs-debug-output
(pacmacs-render-track-board))
- (pacmacs--fill-board pacmacs-board (pacmacs--make-empty-cell))
+ (pacmacs--fill-board pacmacs-board nil)
(dolist (pill pacmacs-pills)
(pacmacs--put-object pill))
- [nongnu] elpa/pacmacs de66c1ce17 112/472: Refactor out pacmacs--step-point (#74), (continued)
- [nongnu] elpa/pacmacs de66c1ce17 112/472: Refactor out pacmacs--step-point (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs b0561eb59f 111/472: Refactor pacmacs--cell-tracked-p (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 317f9b85b7 114/472: Refactor pacmacs--track-point (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 5233bac0c5 105/472: UT for pacmacs--put-object-test (#75), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d2c449734e 124/472: Merge branch 'pacman-death-69'. Close #69, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 1ed9c057cc 127/472: Add padding above the lives, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9e7f67e368 126/472: Implement live mechanics. Close #86, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 86d701a167 131/472: Introduce pacmacs--load-next-level, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 3d49405193 136/472: Reset the score on start, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs a0e3b6fe73 138/472: Implement level is beaten state. Close #99, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 359a0facc5 140/472: Optimize empty cell rendering,
ELPA Syncer <=
- [nongnu] elpa/pacmacs 420dbec3e6 150/472: Register score on Game Over (#92), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 6f174d6239 156/472: Access resources in more general way (#95), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 330c69201f 160/472: Fix UTs, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 131a070556 163/472: Merge pull request #110 from syohex/fix-package, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs bb622648e3 162/472: Add Package-Requires header for dependencies, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0c0aee723a 170/472: Fix regexp bug in pacmacs--levelname-from-filename, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs f28d928e89 177/472: Update README.md, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 8b44939a29 179/472: Merge pull request #121 from kRITZCREEK/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 368609060e 182/472: Add Win animation for Ghost. Close #90, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2c1881afdf 185/472: Compile the project on CI (#123), ELPA Syncer, 2022/01/06