[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 52f1ba4237 366/472: Regenerate gradiate for walls
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 52f1ba4237 366/472: Regenerate gradiate for walls (#138) |
Date: |
Thu, 6 Jan 2022 21:59:40 -0500 (EST) |
branch: elpa/pacmacs
commit 52f1ba4237a369707ffae651c910c55f48b83f81
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Regenerate gradiate for walls (#138)
---
pacmacs-image.el | 32 +++++++++++++++++++++++---------
pacmacs.el | 2 +-
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/pacmacs-image.el b/pacmacs-image.el
index 8e67b91338..81c9635d92 100644
--- a/pacmacs-image.el
+++ b/pacmacs-image.el
@@ -33,10 +33,7 @@
;;; Code:
(require 'dash)
-
-(defconst pacmacs--wall-palette ["#1111bb"
- "#3333dd"
- "#5555ff"])
+(require 'color)
(defvar pacmacs--wall-blocks
(make-hash-table))
@@ -78,14 +75,22 @@
(format "\"%c c %s\",\n" (+ index ?a) color)))
(apply #'concat))))
-(defun pacmacs--bits-to-xpm (bits width height)
+(defun pacmacs--color-hex-gradient (start stop step-number)
+ (-map (-lambda (color)
+ (apply #'color-rgb-to-hex color))
+ (color-gradient
+ (color-name-to-rgb start)
+ (color-name-to-rgb stop)
+ step-number)))
+
+(defun pacmacs--bits-to-xpm (bits width height palette)
(concat
"/* XPM */\n"
"static char *tile[] = {\n"
"/**/\n"
- (format "\"%d %d %d 1\",\n" width height (1+ (length
pacmacs--wall-palette)))
+ (format "\"%d %d %d 1\",\n" width height (1+ (length palette)))
"\" c None\",\n"
- (pacmacs--generate-xpm-palette pacmacs--wall-palette)
+ (pacmacs--generate-xpm-palette palette)
"/* pixels */\n"
(mapconcat
(lambda (row)
@@ -121,7 +126,7 @@
cached-tile
(puthash cache-index
(let ((wall-block (make-vector width nil))
- (weight 3))
+ (weight 15))
(dotimes (i width)
(aset wall-block i (make-vector height nil)))
@@ -150,10 +155,19 @@
(when bottom
(pacmacs--put-horizontal-bar wall-block (- height weight)
width weight))
- (create-image (pacmacs--bits-to-xpm wall-block width height)
+ ;; (dotimes (row height)
+ ;; (dotimes (column width)
+ ;; (when (zerop (mod (+ row column) 2))
+ ;; (aset (aref wall-block row) column nil))))
+
+ (create-image (pacmacs--bits-to-xpm wall-block width height
+
(pacmacs--color-hex-gradient "#5555ff" "#000011"
+
weight))
'xpm t))
pacmacs--wall-blocks))))
+;; (clrhash pacmacs--wall-blocks)
+
(provide 'pacmacs-image)
;;; pacmacs-anim.el ends here
diff --git a/pacmacs.el b/pacmacs.el
index 03356b11d1..a7e3882b94 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -120,7 +120,7 @@
(defun pacmacs--load-current-level ()
(pacmacs--load-map (aref pacmacs-levels
- pacmacs-current-level)))
+ pacmacs-current-level)))
(defun pacmacs--load-next-level ()
(setq pacmacs-current-level
- [nongnu] elpa/pacmacs 9b714e4678 321/472: Fix pacmacs--track-object UT (#159), (continued)
- [nongnu] elpa/pacmacs 9b714e4678 321/472: Fix pacmacs--track-object UT (#159), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 16a6ac7e98 327/472: UT for pacmacs--render-track-board, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 729de2de92 329/472: Remove big from the first level (#162), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 556098da2e 337/472: Put big pills level before w/o BP ones (#162), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 151da84fdc 338/472: Remove replace-game-object function (#171), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs c4c2fbfa6f 347/472: Merge branch 'master' into unterrified-original-possition-171, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9375a8a3e7 351/472: Merge branch 'master' into unterrified-original-possition-171, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 51a2ac25fe 354/472: Merge pull request #175 from codingteam/maps-with-big-pills-162, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 470f11b433 357/472: Reset terrified timer on eating BP (#173), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 46219c3370 368/472: Smaller default weight for walls (#138), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 52f1ba4237 366/472: Regenerate gradiate for walls (#138),
ELPA Syncer <=
- [nongnu] elpa/pacmacs a36eb746ce 379/472: Fix put-wall-tile-corner UT (#138), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e0a315600b 383/472: Get rid of redundant code (#138), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs b19ed92514 389/472: Add UT for color-hex-gradient, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 56e280cd51 395/472: Add Usage section for att.el script, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 8ec58f38d9 394/472: Add Usage section for compile.el script, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs a9ab4c18c8 397/472: Merge pull request #190 from codingteam/usage-for-tools, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs bdbf7144d2 396/472: Move pacmacs-rr to top of README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 54e77a2d10 408/472: Use Emacs Widget Library to ask nickname (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 92eeeae98e 407/472: Ask for nickname at Game Over page (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 76f2dbe41b 409/472: Do nick padding inside of the widget (#134), ELPA Syncer, 2022/01/06