mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-28 07:45:00 +00:00
Remove XEmacs and old Emacs compat code from gamegrid.el
* lisp/play/gamegrid.el (gamegrid-event-x, gamegrid-event-y) (gamegrid-make-glyph, image-size, gamegrid-initialize-display) (gamegrid-start-timer, gamegrid-set-timer) (gamegrid-kill-timer) (gamegrid-add-score-with-update-game-score-1) (gamegrid-add-score-insecure): Removed XEmacs compat code. (gamegrid-characterp, gamegrid-set-display-table): Removed functions.
This commit is contained in:
parent
ec45664d28
commit
1f6e6ee4f7
@ -240,20 +240,11 @@ format."
|
|||||||
|
|
||||||
;; ;;;;;;;;;;;;;;;; miscellaneous functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;;;;; miscellaneous functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(defsubst gamegrid-characterp (arg)
|
|
||||||
(if (fboundp 'characterp)
|
|
||||||
(characterp arg)
|
|
||||||
(integerp arg)))
|
|
||||||
|
|
||||||
(defsubst gamegrid-event-x (event)
|
(defsubst gamegrid-event-x (event)
|
||||||
(if (fboundp 'event-x)
|
(car (posn-col-row (event-end event))))
|
||||||
(event-x event)
|
|
||||||
(car (posn-col-row (event-end event)))))
|
|
||||||
|
|
||||||
(defsubst gamegrid-event-y (event)
|
(defsubst gamegrid-event-y (event)
|
||||||
(if (fboundp 'event-y)
|
(cdr (posn-col-row (event-end event))))
|
||||||
(event-y event)
|
|
||||||
(cdr (posn-col-row (event-end event)))))
|
|
||||||
|
|
||||||
;; ;;;;;;;;;;;;; display functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;; display functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
@ -365,7 +356,7 @@ format."
|
|||||||
(defun gamegrid-make-glyph (data-spec-list color-spec-list)
|
(defun gamegrid-make-glyph (data-spec-list color-spec-list)
|
||||||
(let ((data (gamegrid-match-spec-list data-spec-list))
|
(let ((data (gamegrid-match-spec-list data-spec-list))
|
||||||
(color (gamegrid-match-spec-list color-spec-list)))
|
(color (gamegrid-match-spec-list color-spec-list)))
|
||||||
(cond ((gamegrid-characterp data)
|
(cond ((characterp data)
|
||||||
(vector data))
|
(vector data))
|
||||||
((eq data 'colorize)
|
((eq data 'colorize)
|
||||||
(gamegrid-colorize-glyph color))
|
(gamegrid-colorize-glyph color))
|
||||||
@ -399,15 +390,6 @@ format."
|
|||||||
(t
|
(t
|
||||||
'emacs-tty)))
|
'emacs-tty)))
|
||||||
|
|
||||||
(defun gamegrid-set-display-table ()
|
|
||||||
(if (featurep 'xemacs)
|
|
||||||
(add-spec-to-specifier current-display-table
|
|
||||||
gamegrid-display-table
|
|
||||||
(current-buffer)
|
|
||||||
nil
|
|
||||||
'remove-locale)
|
|
||||||
(setq buffer-display-table gamegrid-display-table)))
|
|
||||||
|
|
||||||
(declare-function image-size "image.c" (spec &optional pixels frame))
|
(declare-function image-size "image.c" (spec &optional pixels frame))
|
||||||
|
|
||||||
(defun gamegrid-setup-default-font ()
|
(defun gamegrid-setup-default-font ()
|
||||||
@ -444,7 +426,7 @@ format."
|
|||||||
(aset gamegrid-face-table c face)
|
(aset gamegrid-face-table c face)
|
||||||
(aset gamegrid-display-table c glyph)))
|
(aset gamegrid-display-table c glyph)))
|
||||||
(gamegrid-setup-default-font)
|
(gamegrid-setup-default-font)
|
||||||
(gamegrid-set-display-table)
|
(setq buffer-display-table gamegrid-display-table)
|
||||||
(setq cursor-type nil))
|
(setq cursor-type nil))
|
||||||
|
|
||||||
|
|
||||||
@ -506,34 +488,19 @@ format."
|
|||||||
|
|
||||||
(defun gamegrid-start-timer (period func)
|
(defun gamegrid-start-timer (period func)
|
||||||
(setq gamegrid-timer
|
(setq gamegrid-timer
|
||||||
(if (featurep 'xemacs)
|
(run-with-timer period period func (current-buffer))))
|
||||||
(start-itimer "Gamegrid"
|
|
||||||
func
|
|
||||||
period
|
|
||||||
period
|
|
||||||
nil
|
|
||||||
t
|
|
||||||
(current-buffer))
|
|
||||||
(run-with-timer period
|
|
||||||
period
|
|
||||||
func
|
|
||||||
(current-buffer)))))
|
|
||||||
|
|
||||||
(defun gamegrid-set-timer (delay)
|
(defun gamegrid-set-timer (delay)
|
||||||
(if gamegrid-timer
|
(if gamegrid-timer
|
||||||
(if (fboundp 'set-itimer-restart)
|
(timer-set-time gamegrid-timer
|
||||||
(set-itimer-restart gamegrid-timer delay)
|
(list (aref gamegrid-timer 1)
|
||||||
(timer-set-time gamegrid-timer
|
(aref gamegrid-timer 2)
|
||||||
(list (aref gamegrid-timer 1)
|
(aref gamegrid-timer 3))
|
||||||
(aref gamegrid-timer 2)
|
delay)))
|
||||||
(aref gamegrid-timer 3))
|
|
||||||
delay))))
|
|
||||||
|
|
||||||
(defun gamegrid-kill-timer ()
|
(defun gamegrid-kill-timer ()
|
||||||
(if gamegrid-timer
|
(if gamegrid-timer
|
||||||
(if (featurep 'xemacs)
|
(cancel-timer gamegrid-timer))
|
||||||
(delete-itimer gamegrid-timer)
|
|
||||||
(cancel-timer gamegrid-timer)))
|
|
||||||
(setq gamegrid-timer nil))
|
(setq gamegrid-timer nil))
|
||||||
|
|
||||||
;; ;;;;;;;;;;;;;;; high score functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;;;; high score functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
@ -627,13 +594,7 @@ FILE is created there."
|
|||||||
(errbuf (generate-new-buffer " *update-game-score loss*"))
|
(errbuf (generate-new-buffer " *update-game-score loss*"))
|
||||||
(marker-string (concat
|
(marker-string (concat
|
||||||
(user-full-name)
|
(user-full-name)
|
||||||
" <"
|
" <" user-mail-address "> "
|
||||||
(cond ((fboundp 'user-mail-address)
|
|
||||||
(user-mail-address))
|
|
||||||
((boundp 'user-mail-address)
|
|
||||||
user-mail-address)
|
|
||||||
(t ""))
|
|
||||||
"> "
|
|
||||||
(current-time-string))))
|
(current-time-string))))
|
||||||
;; This can be called from a timer, so enable local quits.
|
;; This can be called from a timer, so enable local quits.
|
||||||
(with-local-quit
|
(with-local-quit
|
||||||
@ -681,11 +642,7 @@ FILE is created there."
|
|||||||
score
|
score
|
||||||
(current-time-string)
|
(current-time-string)
|
||||||
(user-full-name)
|
(user-full-name)
|
||||||
(cond ((fboundp 'user-mail-address)
|
user-mail-address))
|
||||||
(user-mail-address))
|
|
||||||
((boundp 'user-mail-address)
|
|
||||||
user-mail-address)
|
|
||||||
(t ""))))
|
|
||||||
(sort-fields 1 (point-min) (point-max))
|
(sort-fields 1 (point-min) (point-max))
|
||||||
(reverse-region (point-min) (point-max))
|
(reverse-region (point-min) (point-max))
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
|
Loading…
Reference in New Issue
Block a user