[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 1b2ca64cd1 157/472: Merge branch 'resource-packagi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 1b2ca64cd1 157/472: Merge branch 'resource-packaging-95'. Close #95 |
Date: |
Thu, 6 Jan 2022 21:59:21 -0500 (EST) |
branch: elpa/pacmacs
commit 1b2ca64cd1c68be1325ff39b231111fdeeacb010
Merge: 5db26b2e3d 6f174d6239
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Merge branch 'resource-packaging-95'. Close #95
---
Cask | 5 ++++-
pacmacs-anim.el | 6 ++++--
pacmacs-image.el | 3 +--
pacmacs-utils.el | 5 +++++
pacmacs.el | 9 +++++++--
5 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/Cask b/Cask
index 96dab180fa..f8e4ebb2a5 100644
--- a/Cask
+++ b/Cask
@@ -3,7 +3,10 @@
(package-file "pacmacs.el")
-(files "*.el")
+(files "*.el"
+ ("maps" "maps/*.txt")
+ ("sprites" "sprites/*.json")
+ ("sprites" "sprites/*.xpm"))
(depends-on "dash")
(depends-on "dash-functional")
diff --git a/pacmacs-anim.el b/pacmacs-anim.el
index e33f7dcf83..007837fbd1 100644
--- a/pacmacs-anim.el
+++ b/pacmacs-anim.el
@@ -49,8 +49,10 @@
:duration duration))
(defun pacmacs-load-anim (animation-name)
- (let* ((aseprite-json-file (format "sprites/%s.json" animation-name))
- (sprite-sheet-file (format "sprites/%s.xpm" animation-name))
+ (let* ((aseprite-json-file (pacmacs--find-resource-file
+ (format "sprites/%s.json" animation-name)))
+ (sprite-sheet-file (pacmacs--find-resource-file
+ (format "sprites/%s.xpm" animation-name)))
(aseprite-json (json-read-file aseprite-json-file))
(aseprite-frames (cdr (assoc 'frames aseprite-json)))
(sprite-sheet (pacmacs-load-image sprite-sheet-file)))
diff --git a/pacmacs-image.el b/pacmacs-image.el
index b2d3f69f08..be0d5fdbd5 100644
--- a/pacmacs-image.el
+++ b/pacmacs-image.el
@@ -33,8 +33,7 @@
;;; Code:
(defun pacmacs-load-image (filename)
- (create-image (concat default-directory filename)
- 'xpm nil :heuristic-mask t))
+ (create-image filename 'xpm nil :heuristic-mask t))
(defun pacmacs-insert-image (resource resource-vector)
(insert-image resource " " nil resource-vector))
diff --git a/pacmacs-utils.el b/pacmacs-utils.el
index ad5b31aa2a..19fb56a68a 100644
--- a/pacmacs-utils.el
+++ b/pacmacs-utils.el
@@ -32,6 +32,8 @@
;;; Code:
+(defconst pacmacs--base (file-name-directory load-file-name))
+
(defmacro plist-bind (keys expr &rest body)
(declare (indent 2) (debug (sexp form &rest form)))
(let ((expr-name (gensym)))
@@ -50,6 +52,9 @@ side-effects."
(plist-put plist property
(funcall transformer value))))
+(defun pacmacs--find-resource-file (filename)
+ (expand-file-name filename pacmacs--base))
+
(defun pacmacs--direction-vector (direction)
(let ((direction-table (list 'left (cons 0 -1)
'right (cons 0 1)
diff --git a/pacmacs.el b/pacmacs.el
index 057a0aea6b..e16b9a36bb 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -42,6 +42,7 @@
(require 'pacmacs-image)
(require 'pacmacs-utils)
(require 'pacmacs-render)
+(require 'pacmacs-score)
(defconst pacmacs-buffer-name "*Pacmacs*")
(defconst pacmacs-tick-duration-ms 100)
@@ -457,14 +458,18 @@
(pacmacs--switch-direction pacmacs-player-state 'right)))
(defun pacmacs--get-list-of-levels ()
- (->> (directory-files "./maps/")
+ (->> (directory-files (pacmacs--find-resource-file "./maps/"))
(-map #'pacmacs--levelname-from-filename)
(-remove #'null)
(-sort #'string-lessp)
(apply #'vector)))
(defun pacmacs-load-map (map-name)
- (let* ((lines (split-string (pacmacs--file-content (format "maps/%s.txt"
map-name)) "\n" t))
+ (let* ((lines (split-string (->> map-name
+ (format "./maps/%s.txt")
+ (pacmacs--find-resource-file)
+ (pacmacs--file-content))
+ "\n" t))
(board-width (apply 'max (mapcar #'length lines)))
(board-height (length lines)))
(setq pacmacs-board-width board-width)
- [nongnu] elpa/pacmacs 286eb99ae0 130/472: Implement prepare phase. Close #80, (continued)
- [nongnu] elpa/pacmacs 286eb99ae0 130/472: Implement prepare phase. Close #80, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d14cdd38e3 135/472: Fix last eaten pill visibility. Close #96, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9cb186f10a 137/472: Refactor pacmacs-inversed-direction-table out. Close #103, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 91c317819c 123/472: Implement basic death mechanics (#69), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs be91d566cb 139/472: Implement Game Over state. Close #94, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs b8cd22229d 142/472: Introduce pacmacs--anim-object-list-next-frame, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 91e432111b 145/472: Implement basic score table mechnism (#92), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7058b61e47 146/472: Implement adding entries to score table (#92), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e032089ab4 151/472: Render score table on Game Over screen (#92), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs a7b0530f65 152/472: Merge branch 'score-table-92'. Close #92, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 1b2ca64cd1 157/472: Merge branch 'resource-packaging-95'. Close #95,
ELPA Syncer <=
- [nongnu] elpa/pacmacs 48ecc5cee9 159/472: Don't fail if the score file doesn't exist, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 10b8a997dd 037/472: More precise instructions in README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7e04991d4e 030/472: Add UT for pacman-compare-aseprite-frames function (#22), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 327332d32d 036/472: Update README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 68f876d0ba 043/472: Merge pull request #29 from rexim/license-28, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 298b950310 062/472: Rename pacman-resources to pacman-image (#51), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e9703e9ba2 061/472: Rename function for loading images (#51), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0a65793037 071/472: Use plist-bind for pacman-anim-object-next-frame (#54), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7f706e2159 074/472: Add UTs for plist-map (#54), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 69d47fbb9a 075/472: Merge branch 'pacman-utils-ut-54'. Close #54, ELPA Syncer, 2022/01/06