[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 528ca62e28 251/472: Merge branch 'drop-xbm-support
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 528ca62e28 251/472: Merge branch 'drop-xbm-support-141'. Close #141 |
Date: |
Thu, 6 Jan 2022 21:59:29 -0500 (EST) |
branch: elpa/pacmacs
commit 528ca62e2810f8c23bb8b812c24a575df2bf3f2c
Merge: 2b9811e71b 4a94a72dd4
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Merge branch 'drop-xbm-support-141'. Close #141
---
pacmacs-image.el | 33 +++++++++++++++++++++------------
pacmacs-render.el | 9 +++++----
pacmacs.el | 2 +-
test/pacmacs-image-test.el | 16 ----------------
4 files changed, 27 insertions(+), 33 deletions(-)
diff --git a/pacmacs-image.el b/pacmacs-image.el
index 8e444c8d11..1043589560 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,17 +152,10 @@
(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)
- (create-image
- (make-vector
- width (make-bool-vector height nil))
- 'xbm t :width width :height height))
-
(provide 'pacmacs-image)
;;; pacmacs-anim.el ends here
diff --git a/pacmacs-render.el b/pacmacs-render.el
index 0a7e6f4bad..3606baa326 100644
--- a/pacmacs-render.el
+++ b/pacmacs-render.el
@@ -36,13 +36,14 @@
(require 'pacmacs-anim)
(require 'pacmacs-board)
-(defvar pacmacs--empty-cell nil)
(defvar pacmacs--life-icon nil)
(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)))
+ (pacmacs-insert-image (pacmacs--create-wall-tile
+ 40 40
+ nil nil nil nil
+ nil nil nil nil)
+ '(0 0 40 40)))
(defun pacmacs--render-life-icon ()
(when (not pacmacs--life-icon)
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)
diff --git a/test/pacmacs-image-test.el b/test/pacmacs-image-test.el
index 6bf68f5a1c..aebc7999b6 100644
--- a/test/pacmacs-image-test.el
+++ b/test/pacmacs-image-test.el
@@ -36,22 +36,6 @@
(should (equal create-image-result
(pacmacs-create-color-block width height color))))))
-(ert-deftest pacmacs-create-transparent-block ()
- (let ((width 10)
- (height 20)
- (bool-vector-result 42)
- (make-vector-result 43)
- (create-image-result 44))
- (with-mock
- (mock (make-bool-vector height nil) => bool-vector-result :times 1)
- (mock (make-vector width bool-vector-result) => make-vector-result :times
1)
- (mock (create-image make-vector-result
- 'xbm t
- :width width
- :height height) => create-image-result :times 1)
- (should (equal create-image-result
- (pacmacs-create-transparent-block width height))))))
-
(ert-deftest pacmacs--put-bits-dot-test ()
(let ((input-bits (pacmacs--construct-2d-bool-vector
'((nil nil nil)
- [nongnu] elpa/pacmacs 05c88e5eef 100/472: UTs for pacmacs--object-at-p (#75), (continued)
- [nongnu] elpa/pacmacs 05c88e5eef 100/472: UTs for pacmacs--object-at-p (#75), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 01388a06a0 104/472: UTs for pacmacs--track-object (#75), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d9ddd5dab4 132/472: Refactor pacmacs--detect-ghost-collision (#97), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7601c1ae5c 143/472: Rename board vars to buffers (#105), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e69a35e2b3 168/472: Small typo in the README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 63e41ffe23 169/472: Fix the dev workflow in the README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9525cd168b 172/472: Update README about the pause feature, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 98599015bb 229/472: Fix UTs broken by #133 implementation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e294101a92 231/472: Fix Game Over sign for connected walls (#131), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs a7a4146732 234/472: Fix the wall corner gaps (#131), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 528ca62e28 251/472: Merge branch 'drop-xbm-support-141'. Close #141,
ELPA Syncer <=
- [nongnu] elpa/pacmacs 7d58295e93 281/472: Fix pacmacs--render-score-table function, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs c501625be6 282/472: Add Blinking Terrified Ghost animation. Close #155, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs da727a84c1 287/472: Double dash play state logic function (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d49e28e468 293/472: Remove pacmacs--opposite-direction-name (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e12ed88fe7 298/472: Generalize run-away-direction function (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs be52b6410f 294/472: UT for pacmacs--squared-distance (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0103a77462 302/472: Remove replace-filtered-game-objects (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ee76ee2dc0 299/472: UT for pacmacs--run-away-direction (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs cec13dd618 308/472: Fix Emacs 24.3 build fail (#159), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e662ec9be7 313/472: Disable Emacs 24.3 in the Travis build (#165), ELPA Syncer, 2022/01/06