emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/pacmacs d7c9d248e6 385/472: Pass wall bits to create-wall-


From: ELPA Syncer
Subject: [nongnu] elpa/pacmacs d7c9d248e6 385/472: Pass wall bits to create-wall-tile as list (#138)
Date: Thu, 6 Jan 2022 21:59:41 -0500 (EST)

branch: elpa/pacmacs
commit d7c9d248e60d3e4a9525bb44e80980ad96a6c4d1
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>

    Pass wall bits to create-wall-tile as list (#138)
---
 pacmacs-image.el  | 15 ++++++---------
 pacmacs-render.el |  3 +--
 pacmacs.el        | 12 ++++++------
 3 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/pacmacs-image.el b/pacmacs-image.el
index 90b92757f4..6f2e3d25aa 100644
--- a/pacmacs-image.el
+++ b/pacmacs-image.el
@@ -201,15 +201,12 @@
       (pacmacs--put-wall-tile-corner wall-tile (- height weight) (- width 
weight) weight
                                      (pacmacs--two-weights-to-color nil nil t 
weight)))))
 
-(defun pacmacs--create-wall-tile (width height
-                                        bottom right
-                                        top left
-                                        left-upper right-upper
-                                        left-bottom right-bottom)
-  (let* ((wall-bits (list bottom right top left
-                          left-upper right-upper
-                          left-bottom right-bottom))
-         (cache-index (-> wall-bits
+(defun pacmacs--create-wall-tile (width height wall-bits)
+  "Creates a wall tile based on the WALL-BITS.
+WALL-BITS go as follow (bottom right top left left-upper
+right-upper left-bottom right-bottom). WIDTH and HEIGHT are the
+size of the tile. All the created tiles are cached."
+  (let* ((cache-index (-> wall-bits
                           (pacmacs--normalize-wall-bits)
                           (pacmacs--bit-list-to-integer))))
     (-if-let (cached-tile (gethash cache-index pacmacs--wall-tiles-cache))
diff --git a/pacmacs-render.el b/pacmacs-render.el
index bf303db5bc..274a16a1d6 100644
--- a/pacmacs-render.el
+++ b/pacmacs-render.el
@@ -41,8 +41,7 @@
 (defun pacmacs--render-empty-cell ()
   (pacmacs-insert-image (pacmacs--create-wall-tile
                          40 40
-                         nil nil nil nil
-                         nil nil nil nil)
+                         (make-list 8 nil))
                         '(0 0 40 40)))
 
 (defun pacmacs--render-life-icon ()
diff --git a/pacmacs.el b/pacmacs.el
index 71aa2cc8e0..eb5e387172 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -666,12 +666,12 @@
        (apply #'vector)))
 
 (defun pacmacs--wall-tile-at (row column)
-  (apply #'pacmacs--create-wall-tile
-         40 40
-         (-map (-lambda ((row . column))
-                 (not (pacmacs--wall-at-p row column)))
-               (append (pacmacs--possible-side-ways row column)
-                       (pacmacs--possible-diagonal-ways row column)))))
+  (pacmacs--create-wall-tile
+   40 40
+   (-map (-lambda ((row . column))
+           (not (pacmacs--wall-at-p row column)))
+         (append (pacmacs--possible-side-ways row column)
+                 (pacmacs--possible-diagonal-ways row column)))))
 
 (defun pacmacs--load-map (map-name)
   (let* ((lines (split-string (->> map-name



reply via email to

[Prev in Thread] Current Thread [Next in Thread]