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

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

[nongnu] elpa/pacmacs 9e7685b818 248/472: Drop XBM support for wall tile


From: ELPA Syncer
Subject: [nongnu] elpa/pacmacs 9e7685b818 248/472: Drop XBM support for wall tiles (#141)
Date: Thu, 6 Jan 2022 21:59:28 -0500 (EST)

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

    Drop XBM support for wall tiles (#141)
---
 pacmacs-image.el | 27 +++++++++++++++++++++------
 pacmacs.el       |  2 +-
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/pacmacs-image.el b/pacmacs-image.el
index 8e444c8d11..dc3c518432 100644
--- a/pacmacs-image.el
+++ b/pacmacs-image.el
@@ -80,8 +80,24 @@
                            (if bit 1 0))))
     result))
 
-(defun pacmacs--create-wall-tile (width
-                                  height color
+(defun pacmacs--bits-to-xpm (bits width height)
+  (concat
+   "/* XPM */\n"
+   "static char *tile[] = {\n"
+   "/**/\n"
+   (format "\"%d %d 2 1\",\n" width height)
+   "\"  c None\",\n"
+   "\". c #5555ff\",\n"
+   "/* pixels */\n"
+   (mapconcat
+    (lambda (row)
+      (format "\"%s\""
+       (mapconcat (-lambda (bit) (if bit "." " ")) row "")))
+    bits
+    ",\n")
+   "\n};"))
+
+(defun pacmacs--create-wall-tile (width height
 
                                   bottom right
                                   top left
@@ -110,7 +126,7 @@
                      (weight 3))
 
                  (dotimes (i width)
-                   (aset wall-block i (make-bool-vector height nil)))
+                   (aset wall-block i (make-vector height nil)))
 
                  (when left-upper
                    (pacmacs--put-bits-dot wall-block 0 0 weight))
@@ -136,9 +152,8 @@
                  (when bottom
                    (pacmacs--put-horizontal-bar wall-block (- height weight) 
width weight))
 
-                 (create-image wall-block 'xbm t :width width :height height
-                               :foreground color
-                               :background nil))
+                 (create-image (pacmacs--bits-to-xpm wall-block width height)
+                               'xpm t))
                pacmacs--wall-blocks))))
 
 (defun pacmacs-create-transparent-block (width height)
diff --git a/pacmacs.el b/pacmacs.el
index 4075f944d5..ffd3103b74 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -512,7 +512,7 @@
 
 (defun pacmacs--wall-tile-at (row column)
   (apply #'pacmacs--create-wall-tile
-         40 40 "#5555ff"
+         40 40
          (-map (-lambda ((row . column))
                  (not (pacmacs--wall-at-p row column)))
                (append (pacmacs--possible-side-ways row column)



reply via email to

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