langband-cvs Mailing List for Langband (Page 2)
Status: Alpha
Brought to you by:
stig
You can subscribe to this list here.
2002 |
Jan
|
Feb
(328) |
Mar
(2) |
Apr
(9) |
May
(118) |
Jun
(60) |
Jul
(241) |
Aug
(115) |
Sep
(156) |
Oct
(263) |
Nov
(258) |
Dec
(236) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(491) |
Feb
(470) |
Mar
(218) |
Apr
(357) |
May
(300) |
Jun
(240) |
Jul
(19) |
Aug
(58) |
Sep
(21) |
Oct
(36) |
Nov
(32) |
Dec
|
From: Stig E S. <st...@us...> - 2003-11-19 19:00:59
|
Update of /cvsroot/langband/langband In directory sc8-pr-cvs1:/tmp/cvs-serv27305 Modified Files: Tag: v017_loop_experiment_2 window.lisp print.lisp global.lisp Log Message: tweaks Index: window.lisp =================================================================== RCS file: /cvsroot/langband/langband/window.lisp,v retrieving revision 1.34.2.6 retrieving revision 1.34.2.7 diff -C2 -d -r1.34.2.6 -r1.34.2.7 *** window.lisp 6 Oct 2003 00:24:07 -0000 1.34.2.6 --- window.lisp 19 Nov 2003 19:00:53 -0000 1.34.2.7 *************** *** 344,349 **** (text-paint-value colour val) (progn ! (error "FUCK") ! (logior colour (if (characterp val) (char-code val) val)))))) (setf (window-coord win +foreground+ x y) pval) (paint-coord win x y +winflag-delay-paint+)) --- 344,351 ---- (text-paint-value colour val) (progn ! (error "Crazy colour ~s for win/write-char" colour) ! ;;(logior colour (if (characterp val) (char-code val) val)) ! ) ! ))) (setf (window-coord win +foreground+ x y) pval) (paint-coord win x y +winflag-delay-paint+)) Index: print.lisp =================================================================== RCS file: /cvsroot/langband/langband/print.lisp,v retrieving revision 1.118.4.7 retrieving revision 1.118.4.8 diff -C2 -d -r1.118.4.7 -r1.118.4.8 *** print.lisp 16 Nov 2003 13:49:50 -0000 1.118.4.7 --- print.lisp 19 Nov 2003 19:00:54 -0000 1.118.4.8 *************** *** 27,31 **** (setf (field-printer.handler info) handler (field-printer.window-key info) window) ! (warn "handling ~s ~s ~s" key window handler) (setf (gethash key *printfield-info*) info) --- 27,31 ---- (setf (field-printer.handler info) handler (field-printer.window-key info) window) ! ;;(warn "handling ~s ~s ~s" key window handler) (setf (gethash key *printfield-info*) info) *************** *** 108,112 **** (field-printer.col info) col-counter) ! (warn "row is ~s for ~s" row-counter the-key) (incf row-counter num-rows) --- 108,112 ---- (field-printer.col info) col-counter) ! ;;(warn "row is ~s for ~s" row-counter the-key) (incf row-counter num-rows) Index: global.lisp =================================================================== RCS file: /cvsroot/langband/langband/global.lisp,v retrieving revision 1.323.2.14 retrieving revision 1.323.2.15 diff -C2 -d -r1.323.2.14 -r1.323.2.15 *** global.lisp 14 Oct 2003 16:36:52 -0000 1.323.2.14 --- global.lisp 19 Nov 2003 19:00:54 -0000 1.323.2.15 *************** *** 109,113 **** (defun fetch-event (event-obj only-poll) ! (let ((listen-arg (if only-poll 1 0)) (read-obj nil)) --- 109,116 ---- (defun fetch-event (event-obj only-poll) ! "Tries to fetch a new event in EVENT-OBJ. if ONLY-POLL is true it will ! just do a quick poll, not wait for an event. Returns (updated) EVENT-OBJ ! when a new event was found, otherwise returns NIL." ! (let ((listen-arg (if only-poll 1 0)) (read-obj nil)) *************** *** 1674,1679 **** (text-paint-value colour x) (progn ! (error "FUCK 2") ! (logior colour (if (characterp x) (char-code x) x)) )))) (setf (window-coord win +foreground+ i row) pval) --- 1677,1682 ---- (text-paint-value colour x) (progn ! (error "Found very odd colour value ~s in output-string!" colour) ! ;;(logior colour (if (characterp x) (char-code x) x)) )))) (setf (window-coord win +foreground+ i row) pval) |
From: Stig E S. <st...@us...> - 2003-11-16 13:50:33
|
Update of /cvsroot/langband/langband/config In directory sc8-pr-cvs1:/tmp/cvs-serv19381/config Modified Files: Tag: v017_loop_experiment_2 theme.lisp Log Message: tweaks, what the heck Index: theme.lisp =================================================================== RCS file: /cvsroot/langband/langband/config/theme.lisp,v retrieving revision 1.25.4.7 retrieving revision 1.25.4.8 diff -C2 -d -r1.25.4.7 -r1.25.4.8 *** theme.lisp 14 Oct 2003 16:34:55 -0000 1.25.4.7 --- theme.lisp 16 Nov 2003 13:49:50 -0000 1.25.4.8 *************** *** 135,138 **** --- 135,139 ---- :tile-height gfxtiles.height :font ("vga8x16.hex") + :background 5 ;; in backgrounds file, only when wid/hgt is like gfxtiles ;;:font "lettergo.ttf" :gfx-tiles? true) |
From: Stig E S. <st...@us...> - 2003-11-16 13:50:33
|
Update of /cvsroot/langband/langband In directory sc8-pr-cvs1:/tmp/cvs-serv19381 Modified Files: Tag: v017_loop_experiment_2 base.lisp classes.lisp loop.lisp package.lisp print.lisp themes.lisp util.lisp Log Message: tweaks, what the heck Index: base.lisp =================================================================== RCS file: /cvsroot/langband/langband/base.lisp,v retrieving revision 1.173.2.8 retrieving revision 1.173.2.9 diff -C2 -d -r1.173.2.8 -r1.173.2.9 *** base.lisp 23 Sep 2003 15:08:17 -0000 1.173.2.8 --- base.lisp 16 Nov 2003 13:49:50 -0000 1.173.2.9 *************** *** 156,160 **** "keeps track of mapping from key to object-types, used by factories.") ! (defvar *engine-version* "0.1.6" "A version specifier that can be used for display and listings, not useful for internal code.") (defvar *engine-num-version* 125 "A numeric version for the engine that can --- 156,160 ---- "keeps track of mapping from key to object-types, used by factories.") ! (defvar *engine-version* "0.1.7" "A version specifier that can be used for display and listings, not useful for internal code.") (defvar *engine-num-version* 125 "A numeric version for the engine that can *************** *** 175,178 **** --- 175,181 ---- (defvar *message-handler* nil "An object of class message-handler that handles handling and display of messages.") + + (defvar *printfield-info* (make-hash-table :test #'eq)) + (defvar *printfield-hooks* (make-hash-table :test #'eq)) ;; these specify how many possible windows there are Index: classes.lisp =================================================================== RCS file: /cvsroot/langband/langband/classes.lisp,v retrieving revision 1.148.2.17 retrieving revision 1.148.2.18 diff -C2 -d -r1.148.2.17 -r1.148.2.18 *** classes.lisp 22 Sep 2003 21:47:58 -0000 1.148.2.17 --- classes.lisp 16 Nov 2003 13:49:50 -0000 1.148.2.18 *************** *** 1759,1760 **** --- 1759,1769 ---- no user-attention. Less choppy gameplay and if you have a few lines in the message window you're unlikely to miss much.")) + + (defstruct (field-printer (:copier nil) + (:conc-name field-printer.)) + key + col + row + window-key + handler) + Index: loop.lisp =================================================================== RCS file: /cvsroot/langband/langband/loop.lisp,v retrieving revision 1.277.2.25 retrieving revision 1.277.2.26 diff -C2 -d -r1.277.2.25 -r1.277.2.26 *** loop.lisp 14 Oct 2003 16:36:52 -0000 1.277.2.25 --- loop.lisp 16 Nov 2003 13:49:50 -0000 1.277.2.26 *************** *** 21,41 **** (defun %load-window-textures (variant) (let ((idx 50)) ! (loop for x across *windows* for i from 0 do ! (when x ! (when-bind (bgfile (window.backgroundfile x)) ! (incf idx) ! (org.langband.ffi:c-load-texture& idx ! (concatenate 'string *engine-data-dir* "graphics/" bgfile) ! (window.pixel-width x) (window.pixel-height x) 0) ! (setf (window.background x) idx) ! ;; c-side needs negative value for bad values ! (org.langband.ffi:c-add-frame-bg! i idx) ! (register-image& variant bgfile idx) ! ;;(print x) )) ))) - --- 21,49 ---- (defun %load-window-textures (variant) (let ((idx 50)) ! (loop for win across *windows* for i from 0 do ! (when win ! (when-bind (bgfile (window.backgroundfile win)) ! (cond ((stringp bgfile) ! (incf idx) ! (org.langband.ffi:c-load-texture& idx ! (concatenate 'string *engine-data-dir* ! "graphics/" bgfile) ! (window.pixel-width win) ! (window.pixel-height win) 0) ! (setf (window.background win) idx) ! ;; c-side needs negative value for bad values ! (org.langband.ffi:c-add-frame-bg! i idx) ! (register-image& variant bgfile idx)) ! ! ;; colour with background from background tilefile ! ((non-negative-integer? bgfile) ! (colour-window win bgfile)) ! (t ! (warn "Don't know how to handle background ~s for window ~s" ! bgfile i))) )) ))) Index: package.lisp =================================================================== RCS file: /cvsroot/langband/langband/package.lisp,v retrieving revision 1.109.2.14 retrieving revision 1.109.2.15 diff -C2 -d -r1.109.2.14 -r1.109.2.15 *** package.lisp 14 Oct 2003 16:36:52 -0000 1.109.2.14 --- package.lisp 16 Nov 2003 13:49:50 -0000 1.109.2.15 *************** *** 880,883 **** --- 880,884 ---- #:window-allows-gfx-tiles? #:window-coord + #:window.backgroundfile #:window.disabled? #:window.height Index: print.lisp =================================================================== RCS file: /cvsroot/langband/langband/print.lisp,v retrieving revision 1.118.4.6 retrieving revision 1.118.4.7 diff -C2 -d -r1.118.4.6 -r1.118.4.7 *** print.lisp 14 Oct 2003 16:36:52 -0000 1.118.4.6 --- print.lisp 16 Nov 2003 13:49:50 -0000 1.118.4.7 *************** *** 19,32 **** (in-package :org.langband.engine) - (defstruct (field-printer (:copier nil) - (:conc-name field-printer.)) - key - col - row - window-key - handler) - - (defvar *printfield-info* (make-hash-table :test #'eq)) - (defvar *printfield-hooks* (make-hash-table :test #'eq)) (defun define-printfield-handler (key window handler &key hook-on-redraw) --- 19,22 ---- Index: themes.lisp =================================================================== RCS file: /cvsroot/langband/langband/themes.lisp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** themes.lisp 13 Oct 2003 15:26:26 -0000 1.1.2.2 --- themes.lisp 16 Nov 2003 13:49:50 -0000 1.1.2.3 *************** *** 235,238 **** --- 235,240 ---- ((stringp background) (setf (window.backgroundfile sub) background)) + ((non-negative-integer? background) ;; this is an offset in background tilefile + (setf (window.backgroundfile sub) background)) (t (signal-condition 'illegal-ui-theme-data :id (theme.key theme) Index: util.lisp =================================================================== RCS file: /cvsroot/langband/langband/util.lisp,v retrieving revision 1.123.2.32 retrieving revision 1.123.2.33 diff -C2 -d -r1.123.2.32 -r1.123.2.33 *** util.lisp 14 Oct 2003 16:36:52 -0000 1.123.2.32 --- util.lisp 16 Nov 2003 13:49:50 -0000 1.123.2.33 *************** *** 887,890 **** --- 887,891 ---- (col-y (floor colour-idx 5))) + ;;(warn "Colour ~s win with ~s ~s" win col-x col-y) (loop for y from row below (+ hgt row) do (loop for x from col below (+ wid col) do *************** *** 893,896 **** --- 894,898 ---- (incf tile-idx (rem x 2)) (incf tile-idx (* 10 (rem y 2))) + ;;(warn "(x,y ~s,~s) (col-x,col-y ~s,~s) -> idx is ~s " x y col-x col-y tile-idx) (setf (window-coord win +background+ x y) (tile-paint-value +tilefile-backgrounds+ tile-idx)) ))) *************** *** 898,911 **** (defun colour-window (win colour-idx) (colour-area win colour-idx 0 0 (window.width win) (window.height win))) (defun update-button-row (variant player) (declare (ignorable player)) ! (when (is-frame-shown? variant +tiledfields-frame+) (let ((win (get-window +tiledfields-frame+))) (colour-window win 0))) ! (loop for x being the hash-values of *printfield-info* --- 900,916 ---- (defun colour-window (win colour-idx) + "Tries to colour the window with a background from the background tilefile." (colour-area win colour-idx 0 0 (window.width win) (window.height win))) (defun update-button-row (variant player) + "deprecated.. remove eventually." (declare (ignorable player)) ! ! #|| (when (is-frame-shown? variant +tiledfields-frame+) (let ((win (get-window +tiledfields-frame+))) (colour-window win 0))) ! ||# (loop for x being the hash-values of *printfield-info* |
From: Stig E S. <st...@us...> - 2003-11-16 13:50:33
|
Update of /cvsroot/langband/langband/data/graphics/tiles In directory sc8-pr-cvs1:/tmp/cvs-serv19381/data/graphics/tiles Modified Files: Tag: v017_loop_experiment_2 buttons.png Log Message: tweaks, what the heck Index: buttons.png =================================================================== RCS file: /cvsroot/langband/langband/data/graphics/tiles/buttons.png,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 Binary files /tmp/cvs1y1mFG and /tmp/cvse7jk7c differ |
From: Stig E S. <st...@us...> - 2003-11-16 13:50:14
|
Update of /cvsroot/langband/langband/variants/vanilla/config In directory sc8-pr-cvs1:/tmp/cvs-serv19349/variants/vanilla/config Modified Files: Tag: v017_loop_experiment_2 print.lisp Log Message: tweak Index: print.lisp =================================================================== RCS file: /cvsroot/langband/langband/variants/vanilla/config/Attic/print.lisp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** print.lisp 14 Oct 2003 17:26:09 -0000 1.1.2.4 --- print.lisp 16 Nov 2003 13:49:30 -0000 1.1.2.5 *************** *** 74,78 **** +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) ! (let ((bg-texture 0) (hptext-colour +term-l-blue+) (hp-colour +term-white+) --- 74,80 ---- +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) ! (let ((bg-texture (cond ((non-negative-integer? (window.backgroundfile win)) ! (window.backgroundfile win)) ! (t 0))) (hptext-colour +term-l-blue+) (hp-colour +term-white+) *************** *** 106,110 **** +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) ! (let ((bg-texture 0) (hptext-colour +term-l-blue+) (hp-colour +term-white+) --- 108,114 ---- +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) ! (let ((bg-texture (cond ((non-negative-integer? (window.backgroundfile win)) ! (window.backgroundfile win)) ! (t 0))) (hptext-colour +term-l-blue+) (hp-colour +term-white+) |
From: Stig E S. <st...@us...> - 2003-11-16 13:47:10
|
Update of /cvsroot/langband/langband In directory sc8-pr-cvs1:/tmp/cvs-serv18938 Modified Files: Tag: v017_loop_experiment_2 langband-engine.asd Log Message: tweak Index: langband-engine.asd =================================================================== RCS file: /cvsroot/langband/langband/langband-engine.asd,v retrieving revision 1.63.2.3 retrieving revision 1.63.2.4 diff -C2 -d -r1.63.2.3 -r1.63.2.4 *** langband-engine.asd 20 Oct 2003 12:31:00 -0000 1.63.2.3 --- langband-engine.asd 16 Nov 2003 13:46:28 -0000 1.63.2.4 *************** *** 36,42 **** :licence "GPL" :properties ((#:author-email . "st...@la...") ! (#:date . "Summer 2003") (#:licencefile . "COPYING") ! ((#:albert #:output-dir) . "albert-docs/") ((#:albert #:formats) . ("docbook")) ((#:albert #:docbook #:template) . "book") --- 36,42 ---- :licence "GPL" :properties ((#:author-email . "st...@la...") ! (#:date . "Autumn 2003") (#:licencefile . "COPYING") ! ((#:albert #:output-dir) . "Docs-Langband/") ((#:albert #:formats) . ("docbook")) ((#:albert #:docbook #:template) . "book") |
From: Stig E S. <st...@us...> - 2003-11-16 13:46:34
|
Update of /cvsroot/langband/langband/tools In directory sc8-pr-cvs1:/tmp/cvs-serv18846 Modified Files: Tag: v017_loop_experiment_2 docme.lisp Log Message: tweak Index: docme.lisp =================================================================== RCS file: /cvsroot/langband/langband/tools/docme.lisp,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -C2 -d -r1.10.2.1 -r1.10.2.2 *** docme.lisp 20 Oct 2003 12:31:00 -0000 1.10.2.1 --- docme.lisp 16 Nov 2003 13:45:45 -0000 1.10.2.2 *************** *** 1,4 **** --- 1,7 ---- (in-package :cl-user) + (setf cl:*load-verbose* nil + cl:*load-print* nil) + (setf asdf:*central-registry* (cons "../albert/" asdf:*central-registry*)) *************** *** 77,82 **** t) ! (setf (albert:albert-setting '("albert" "presentation" "only-exported")) t) ;;(setf (albert:albert-setting '("albert" "submarine-quiet")) t) ;;(setf (albert:albert-setting '("albert" "verbose")) t) --- 80,89 ---- t) + (defmethod lisp2csf:analyse-object ((objtype (eql 'def-exportconst)) obj) + (lisp2csf:analyse-object 'cl:export (list 'export (list (second obj)))) + (lisp2csf:analyse-object 'cl:defconstant (list 'defconstant (second obj) (third obj)))) ! ! ;;(setf (albert:albert-setting '("albert" "presentation" "only-exported")) t) ;;(setf (albert:albert-setting '("albert" "submarine-quiet")) t) ;;(setf (albert:albert-setting '("albert" "verbose")) t) |
From: Stig E S. <st...@us...> - 2003-10-21 00:31:36
|
Update of /cvsroot/langband/langband In directory sc8-pr-cvs1:/tmp/cvs-serv5956 Modified Files: Tag: v017_loop_experiment_2 .cvsignore Log Message: tweak Index: .cvsignore =================================================================== RCS file: /cvsroot/langband/langband/.cvsignore,v retrieving revision 1.33 retrieving revision 1.33.4.1 diff -C2 -d -r1.33 -r1.33.4.1 *** .cvsignore 5 May 2003 17:27:59 -0000 1.33 --- .cvsignore 21 Oct 2003 00:29:28 -0000 1.33.4.1 *************** *** 37,40 **** --- 37,41 ---- dumps whatever + albert-docs *.csf *.sdoc |
From: Stig E S. <st...@us...> - 2003-10-20 17:44:41
|
Update of /cvsroot/langband/langband In directory sc8-pr-cvs1:/tmp/cvs-serv18927 Modified Files: Tag: v017_loop_experiment_2 langband-engine.system langband-engine.asd Log Message: tweak Index: langband-engine.system =================================================================== RCS file: /cvsroot/langband/langband/langband-engine.system,v retrieving revision 1.94.2.1 retrieving revision 1.94.2.2 diff -C2 -d -r1.94.2.1 -r1.94.2.2 *** langband-engine.system 14 Oct 2003 16:35:20 -0000 1.94.2.1 --- langband-engine.system 20 Oct 2003 12:31:00 -0000 1.94.2.2 *************** *** 52,56 **** (:file "sys" :depends-on ("package")) ) ! :depeneds-on (btypes)) (:module foreign --- 52,56 ---- (:file "sys" :depends-on ("package")) ) ! :depends-on (btypes)) (:module foreign Index: langband-engine.asd =================================================================== RCS file: /cvsroot/langband/langband/langband-engine.asd,v retrieving revision 1.63.2.2 retrieving revision 1.63.2.3 diff -C2 -d -r1.63.2.2 -r1.63.2.3 *** langband-engine.asd 14 Oct 2003 16:35:20 -0000 1.63.2.2 --- langband-engine.asd 20 Oct 2003 12:31:00 -0000 1.63.2.3 *************** *** 37,40 **** --- 37,41 ---- :properties ((#:author-email . "st...@la...") (#:date . "Summer 2003") + (#:licencefile . "COPYING") ((#:albert #:output-dir) . "albert-docs/") ((#:albert #:formats) . ("docbook")) |
From: Stig E S. <st...@us...> - 2003-10-20 13:05:50
|
Update of /cvsroot/langband/langband/tools In directory sc8-pr-cvs1:/tmp/cvs-serv18927/tools Modified Files: Tag: v017_loop_experiment_2 docme.lisp Log Message: tweak Index: docme.lisp =================================================================== RCS file: /cvsroot/langband/langband/tools/docme.lisp,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** docme.lisp 1 Jul 2003 23:10:25 -0000 1.10 --- docme.lisp 20 Oct 2003 12:31:00 -0000 1.10.2.1 *************** *** 78,82 **** ! (defun dble () --- 78,84 ---- ! (setf (albert:albert-setting '("albert" "presentation" "only-exported")) t) ! ;;(setf (albert:albert-setting '("albert" "submarine-quiet")) t) ! ;;(setf (albert:albert-setting '("albert" "verbose")) t) (defun dble () |
From: Stig E S. <st...@us...> - 2003-10-14 17:26:15
|
Update of /cvsroot/langband/langband/variants/vanilla/config In directory sc8-pr-cvs1:/tmp/cvs-serv19307/variants/vanilla/config Modified Files: Tag: v017_loop_experiment_2 print.lisp Log Message: tweaking Index: print.lisp =================================================================== RCS file: /cvsroot/langband/langband/variants/vanilla/config/Attic/print.lisp,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** print.lisp 14 Oct 2003 17:04:13 -0000 1.1.2.3 --- print.lisp 14 Oct 2003 17:26:09 -0000 1.1.2.4 *************** *** 84,96 **** (setf (idx-value (+ 0 10)) cur-hp ! (idx-value (+ 0 10 100)) "HP") (setf (window-coord win +foreground+ (+ col 0) (+ row 0)) (idx-paint-value hptext-colour (+ 100 10)) (window-coord win +foreground+ (+ col 1) (+ row 0)) (idx-paint-value hp-colour (+ 0 10))) (colour-area win bg-texture col row 2 2) ;; assuming we have a 2x2 area ! (paint-coord win (+ col 0) (+ row 0) +winflag-normal-paint+) ! (paint-coord win (+ col 1) (+ row 0) +winflag-normal-paint+) )) --- 84,102 ---- (setf (idx-value (+ 0 10)) cur-hp ! (idx-value (+ 0 10 100)) "HP" ! (idx-value (+ 0 11)) max-hp ! (idx-value (+ 0 11 100)) "Max") ! (setf (window-coord win +foreground+ (+ col 0) (+ row 0)) (idx-paint-value hptext-colour (+ 100 10)) (window-coord win +foreground+ (+ col 1) (+ row 0)) (idx-paint-value hp-colour (+ 0 10))) + (setf (window-coord win +foreground+ (+ col 0) (+ row 1)) (idx-paint-value hptext-colour (+ 100 11)) + (window-coord win +foreground+ (+ col 1) (+ row 1)) (idx-paint-value hp-colour (+ 0 11))) + (colour-area win bg-texture col row 2 2) ;; assuming we have a 2x2 area ! ;;(paint-coord win (+ col 0) (+ row 0) +winflag-normal-paint+) ! ;;(paint-coord win (+ col 1) (+ row 0) +winflag-normal-paint+) )) |
From: Stig E S. <st...@us...> - 2003-10-14 17:26:15
|
Update of /cvsroot/langband/langband/zterm In directory sc8-pr-cvs1:/tmp/cvs-serv19307/zterm Modified Files: Tag: v017_loop_experiment_2 main-sdl.c Log Message: tweaking Index: main-sdl.c =================================================================== RCS file: /cvsroot/langband/langband/zterm/main-sdl.c,v retrieving revision 1.113.2.7 retrieving revision 1.113.2.8 diff -C2 -d -r1.113.2.7 -r1.113.2.8 *** main-sdl.c 14 Oct 2003 17:02:58 -0000 1.113.2.7 --- main-sdl.c 14 Oct 2003 17:26:09 -0000 1.113.2.8 *************** *** 861,865 **** } ! DBGPUT("Doing idx %u with attr %u -> '%s' %d.\n", idx, attr, value, valuelen); // we assume that the size is 32 now --- 861,865 ---- } ! //DBGPUT("Doing idx %u with attr %u -> '%s' %d.\n", idx, attr, value, valuelen); // we assume that the size is 32 now |
From: Stig E S. <st...@us...> - 2003-10-14 17:04:18
|
Update of /cvsroot/langband/langband/variants/vanilla/config In directory sc8-pr-cvs1:/tmp/cvs-serv14800/variants/vanilla/config Modified Files: Tag: v017_loop_experiment_2 print.lisp Log Message: tweak Index: print.lisp =================================================================== RCS file: /cvsroot/langband/langband/variants/vanilla/config/Attic/print.lisp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** print.lisp 14 Oct 2003 16:36:53 -0000 1.1.2.2 --- print.lisp 14 Oct 2003 17:04:13 -0000 1.1.2.3 *************** *** 32,36 **** (idx-value (+ i 100)) (get-stat-name-from-num i)) ! (setf (window-coord win +foreground+ (+ col 0) (+ row i)) (idx-paint-value +term-dark+ (+ 100 i)) (window-coord win +foreground+ (+ col 1) (+ row i)) (idx-paint-value +term-white+ (+ 0 i))) --- 32,36 ---- (idx-value (+ i 100)) (get-stat-name-from-num i)) ! (setf (window-coord win +foreground+ (+ col 0) (+ row i)) (idx-paint-value +term-l-blue+ (+ 100 i)) (window-coord win +foreground+ (+ col 1) (+ row i)) (idx-paint-value +term-white+ (+ 0 i))) *************** *** 62,66 **** (setf (window-coord win +foreground+ (+ col 0) (+ row 0)) (idx-paint-value +term-l-blue+ (+ 100 9)) ! (window-coord win +foreground+ (+ col 1) (+ row 0)) (idx-paint-value +term-l-green+ (+ 0 9))) ;;(paint-coord win (+ col 0) (+ row 0) +winflag-normal-paint+) --- 62,66 ---- (setf (window-coord win +foreground+ (+ col 0) (+ row 0)) (idx-paint-value +term-l-blue+ (+ 100 9)) ! (window-coord win +foreground+ (+ col 1) (+ row 0)) (idx-paint-value +term-white+ (+ 0 9))) ;;(paint-coord win (+ col 0) (+ row 0) +winflag-normal-paint+) |
From: Stig E S. <st...@us...> - 2003-10-14 17:03:03
|
Update of /cvsroot/langband/langband/zterm In directory sc8-pr-cvs1:/tmp/cvs-serv14484/zterm Modified Files: Tag: v017_loop_experiment_2 main-sdl.c Log Message: non-consing idx painting Index: main-sdl.c =================================================================== RCS file: /cvsroot/langband/langband/zterm/main-sdl.c,v retrieving revision 1.113.2.6 retrieving revision 1.113.2.7 diff -C2 -d -r1.113.2.6 -r1.113.2.7 *** main-sdl.c 14 Oct 2003 16:34:55 -0000 1.113.2.6 --- main-sdl.c 14 Oct 2003 17:02:58 -0000 1.113.2.7 *************** *** 883,899 **** { int curx = xadj; int cury = yadj; int i = 0; - - SDL_Rect dest, source; ! SDL_Surface *scratch = SDL_CreateRGBSurface(SDL_SWSURFACE, lf->tile_width, lf->tile_height,8,0,0,0,0); ! SDL_SetAlpha(scratch, SDL_RLEACCEL, SDL_ALPHA_OPAQUE); ! SDL_SetColors(scratch, &(sdl_colour_data[attr & 0xf]), 0xff, 1); ! SDL_SetColorKey(scratch, SDL_SRCCOLORKEY, 0); - // now we need to do the digits // we gamble on hex --- 883,906 ---- { + + int basex = destx + lf->xoffset; + int basey = desty + lf->yoffset; int curx = xadj; int cury = yadj; int i = 0; ! SDL_Rect dest, source; // adjusted rect ! dest.x = basex + curx; ! dest.y = basey + cury; ! dest.w = font_width; ! dest.h = font_height; ! ! // dr is the tile target, unmodified ! dr.x = basex; ! dr.y = basey; ! dr.w = lf->tile_width; ! dr.h = lf->tile_height; // now we need to do the digits // we gamble on hex *************** *** 903,976 **** source.y = 0; // adjusted ! dest.x = curx; ! dest.y = cury; ! dest.w = font_width; ! dest.h = font_height; for (i=0; i < valuelen; i++) { source.y = ((int)value[i]) * font_height; // hex is vertical ! dest.x = curx + i * font_width; // blit to scratch ! SDL_BlitSurface(fd->theFont, &source, scratch, &dest); ! /* ! DBGPUT("Blit to %d,%d,%d,%d from %d,%d,%d,%d.\n", ! dest.x, dest.y, dest.w, dest.h, ! source.x, source.y, source.w, source.h); ! */ } - - orig = scratch; ! /* ! SDL_Surface *ptr = fd->theFont; ! fprintf(stdout, "Compare %u,%u,%u,%u,%u vs %u,%u,%u,%u,%u.\n", ! scratch->flags, ! scratch->format->BitsPerPixel, ! scratch->format->BytesPerPixel, ! scratch->format->alpha, ! scratch->format->colorkey, ! ptr->flags, ! ptr->format->BitsPerPixel, ! ptr->format->BytesPerPixel, ! ptr->format->alpha, ! ptr->format->colorkey); ! ! for (i=0; i < 10; i++) { ! ! fprintf(stdout, "Compare %d,%d,%d vs %d,%d,%d.\n", ! scratch->format->palette->colors[i].r, ! scratch->format->palette->colors[i].g, ! scratch->format->palette->colors[i].b, ! ptr->format->palette->colors[i].r, ! ptr->format->palette->colors[i].g, ! ptr->format->palette->colors[i].b); } ! */ ! ! ! //SDL_SaveBMP(fd->theFont, "font.bmp"); ! //SDL_SaveBMP(scratch, "hop.bmp"); ! } - //DBGPUT("1. Char = %c, attr = %d\n", thechar, attr); - - dr.x = destx + lf->xoffset; - dr.y = desty + lf->yoffset; - dr.w = lf->tile_width; - dr.h = lf->tile_height; - - //DBGPUT("2. Char = %c, attr = %d\n", thechar, attr); - - sr.w = lf->tile_width; - sr.h = lf->tile_height; - - sr.x = 0; - sr.y = 0; - - - - // adjust coords, get a scratch, write/blit to a scratch, then blit the scratch. - } else { // ERROR! --- 910,940 ---- source.y = 0; // adjusted ! ! // need colour right ! SDL_SetColors(fd->theFont, &(sdl_colour_data[attr & 0xf]), 0xff, 1); ! // SDL_SetColors(fd->face, &(sdl_colour_data[a&0xf]), 0xff, 1); ! SDL_SetColorKey(fd->theFont, SDL_SRCCOLORKEY, 0); ! ! //DBGPUT("2. Char = %c, attr = %d\n", thechar, attr); ! ! if (flags & ALSO_CLEAR_BG) { ! SDL_FillRect(wc->face, &dr, 0); ! } ! for (i=0; i < valuelen; i++) { source.y = ((int)value[i]) * font_height; // hex is vertical ! dest.x = basex+ curx + i * font_width; // blit to scratch ! SDL_BlitSurface(fd->theFont, &source, wc->face, &dest); } ! if (!(flags & DONT_PAINT)) { ! SDL_UpdateRect(wc->face, dr.x, dr.y, dr.w, dr.h); } ! return 0; } } + else { // ERROR! |
From: Stig E S. <st...@us...> - 2003-10-14 16:36:58
|
Update of /cvsroot/langband/langband In directory sc8-pr-cvs1:/tmp/cvs-serv9136 Modified Files: Tag: v017_loop_experiment_2 constants.lisp generics.lisp global.lisp loop.lisp print.lisp util.lisp package.lisp Log Message: tweaked how printouts and hooks for redraws work.. complete revamp Index: constants.lisp =================================================================== RCS file: /cvsroot/langband/langband/constants.lisp,v retrieving revision 1.111.2.10 retrieving revision 1.111.2.11 diff -C2 -d -r1.111.2.10 -r1.111.2.11 *** constants.lisp 13 Oct 2003 15:26:25 -0000 1.111.2.10 --- constants.lisp 14 Oct 2003 16:36:52 -0000 1.111.2.11 *************** *** 75,78 **** --- 75,80 ---- (define-redraw-key [misc] "...") (define-redraw-key [level] "...") + (define-redraw-key [race] "...") + (define-redraw-key [class] "...") (define-redraw-key [xp] "...") (define-redraw-key [armour] "...") *************** *** 283,286 **** --- 285,289 ---- (def-exportconst +max-winrow+ 1024 "What is the maximum expected number of rows in a window.") + (def-exportconst +winflag-normal-paint+ #x00) (def-exportconst +winflag-clear-bg+ #x01) (def-exportconst +winflag-delay-paint+ #x02) Index: generics.lisp =================================================================== RCS file: /cvsroot/langband/langband/generics.lisp,v retrieving revision 1.138.2.1 retrieving revision 1.138.2.2 diff -C2 -d -r1.138.2.1 -r1.138.2.2 *** generics.lisp 23 Sep 2003 09:32:52 -0000 1.138.2.1 --- generics.lisp 14 Oct 2003 16:36:52 -0000 1.138.2.2 *************** *** 719,725 **** - (defgeneric print-speed (variant player setting) - (:documentation "prints speed-info.")) - (defgeneric gain-power-level! (variant player) (:documentation "The player just gained a level.")) --- 719,722 ---- *************** *** 736,742 **** (defgeneric print-misc-info (variant player setting) (:documentation "Tries to print misc-info about a player to a clear window.")) - - (defgeneric print-armour-class (variant player setting) - (:documentation "Tries to print armour class data in the left column.")) (defgeneric print-hunger (variant player setting) --- 733,736 ---- Index: global.lisp =================================================================== RCS file: /cvsroot/langband/langband/global.lisp,v retrieving revision 1.323.2.13 retrieving revision 1.323.2.14 diff -C2 -d -r1.323.2.13 -r1.323.2.14 *** global.lisp 13 Oct 2003 15:26:26 -0000 1.323.2.13 --- global.lisp 14 Oct 2003 16:36:52 -0000 1.323.2.14 *************** *** 1436,1441 **** "Checks if the given frame is shown." (declare (ignore variant)) ! (let ((shown? nil)) ! (when-bind (win (get-window frame)) (setf shown? (and (not (window.disabled? win)) (window.visible? win)))) ;;(warn "basic frame: ~s" shown?) --- 1436,1444 ---- "Checks if the given frame is shown." (declare (ignore variant)) ! (let ((shown? nil) ! (win nil)) ! (unless (eq frame nil) ! (setf win (get-window frame))) ! (when win (setf shown? (and (not (window.disabled? win)) (window.visible? win)))) ;;(warn "basic frame: ~s" shown?) Index: loop.lisp =================================================================== RCS file: /cvsroot/langband/langband/loop.lisp,v retrieving revision 1.277.2.24 retrieving revision 1.277.2.25 diff -C2 -d -r1.277.2.24 -r1.277.2.25 *** loop.lisp 13 Oct 2003 15:45:17 -0000 1.277.2.24 --- loop.lisp 14 Oct 2003 16:36:52 -0000 1.277.2.25 *************** *** 45,50 **** (when (not (any-redraws? player)) (return-from redraw-stuff nil)) ! (let ((retval nil) ! (pr-set nil)) (when (want-redraw? player '[map]) --- 45,49 ---- (when (not (any-redraws? player)) (return-from redraw-stuff nil)) ! (let ((retval nil)) (when (want-redraw? player '[map]) *************** *** 72,79 **** (when (want-redraw? player '[misc]) (reset-redraw! player '[misc]) ! (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) ! ! (print-field (get-race-name player) 0 (setting-lookup pr-set "race") +charinfo-frame+) ! (print-field (get-class-name player) 0 (setting-lookup pr-set "class") +charinfo-frame+) (setf retval t)) --- 71,76 ---- (when (want-redraw? player '[misc]) (reset-redraw! player '[misc]) ! (trigger-printfield-hooks& variant dungeon player '[race]) ! (trigger-printfield-hooks& variant dungeon player '[class]) (setf retval t)) *************** *** 81,86 **** (when (want-redraw? player '[level]) (reset-redraw! player '[level]) - (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) - (print-level variant player pr-set) (trigger-printfield-hooks& variant dungeon player '[level]) (setf retval t)) --- 78,81 ---- *************** *** 88,93 **** (when (want-redraw? player '[xp]) (reset-redraw! player '[xp]) - (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) - (print-xp variant player pr-set) (trigger-printfield-hooks& variant dungeon player '[xp]) (setf retval t)) --- 83,86 ---- *************** *** 95,101 **** (when (want-redraw? player '[stats]) (reset-redraw! player '[stats]) - (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) - (dotimes (i (variant.stat-length variant)) - (print-stat player pr-set i)) ;; probably not optimal handling (trigger-printfield-hooks& variant dungeon player '[stats]) (setf retval t)) --- 88,91 ---- *************** *** 103,108 **** (when (want-redraw? player '[armour]) (reset-redraw! player '[armour]) - (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) - (print-armour-class variant player pr-set) (trigger-printfield-hooks& variant dungeon player '[armour]) (setf retval t)) --- 93,96 ---- *************** *** 110,115 **** (when (want-redraw? player '[hp]) (reset-redraw! player '[hp]) - (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) - (print-hit-points variant player pr-set) (trigger-printfield-hooks& variant dungeon player '[hp]) (setf retval t)) --- 98,101 ---- *************** *** 117,122 **** (when (want-redraw? player '[gold]) (reset-redraw! player '[gold]) - (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) - (print-gold variant player pr-set) (trigger-printfield-hooks& variant dungeon player '[gold]) (setf retval t)) --- 103,106 ---- *************** *** 146,151 **** (when (want-redraw? player '[speed]) (reset-redraw! player '[speed]) - (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) - (print-speed variant player pr-set) (trigger-printfield-hooks& variant dungeon player '[speed]) (setf retval t)) --- 130,133 ---- *************** *** 648,656 **** (when (basic-frame-shown? var-obj) (when-bind (win (get-window +charinfo-frame+)) ! (refresh-window win))) (when (is-frame-shown? var-obj +tiledfields-frame+) (when-bind (win (get-window +tiledfields-frame+)) ! (refresh-window win))) (cond ((> (get-creature-energy front) +energy-normal-action+) ;; he or she can do an action --- 630,638 ---- (when (basic-frame-shown? var-obj) (when-bind (win (get-window +charinfo-frame+)) ! (refresh-window win +winflag-delay-paint+))) (when (is-frame-shown? var-obj +tiledfields-frame+) (when-bind (win (get-window +tiledfields-frame+)) ! (refresh-window win +winflag-delay-paint+))) (cond ((> (get-creature-energy front) +energy-normal-action+) ;; he or she can do an action Index: print.lisp =================================================================== RCS file: /cvsroot/langband/langband/print.lisp,v retrieving revision 1.118.4.5 retrieving revision 1.118.4.6 diff -C2 -d -r1.118.4.5 -r1.118.4.6 *** print.lisp 6 Oct 2003 00:24:07 -0000 1.118.4.5 --- print.lisp 14 Oct 2003 16:36:52 -0000 1.118.4.6 *************** *** 19,27 **** (in-package :org.langband.engine) ;; very very inefficient, and wrong.. should use padding (defun print-number (term colour number padding row col) ;; hack ! (let ((win (aref *windows* term))) ;;(output-string! win col row colour (format nil "~vd" padding number)) (win/format win col row colour "~v" padding number) ;; padding number)) --- 19,134 ---- (in-package :org.langband.engine) + (defstruct (field-printer (:copier nil) + (:conc-name field-printer.)) + key + col + row + window-key + handler) + + (defvar *printfield-info* (make-hash-table :test #'eq)) + (defvar *printfield-hooks* (make-hash-table :test #'eq)) + + (defun define-printfield-handler (key window handler &key hook-on-redraw) + (let ((info (gethash key *printfield-info*))) + (unless (field-printer-p info) + (setf info (make-field-printer :key key))) + + (setf (field-printer.handler info) handler + (field-printer.window-key info) window) + (warn "handling ~s ~s ~s" key window handler) + (setf (gethash key *printfield-info*) info) + + (when hook-on-redraw + (pushnew info (gethash hook-on-redraw *printfield-hooks*))) + + info)) + + (defun trigger-printfield-hooks& (variant dungeon player key) + "Triggers any registered printfield hooks for given key." + (when-bind (triggers (gethash key *printfield-hooks*)) + ;;(warn "TRIGGERS ~s" triggers) + (assert (consp triggers)) + (dolist (trigger triggers) + (trigger-printfield variant dungeon player trigger)) + t)) + + + (defun trigger-printfield (variant dungeon player printfield) + + (let ((win (get-window (field-printer.window-key printfield)))) + + (when (and (is-frame-shown? variant win) + (functionp (field-printer.handler printfield)) + (non-negative-integer? (field-printer.col printfield)) + (non-negative-integer? (field-printer.row printfield))) + + ;; call the handler + (funcall (field-printer.handler printfield) win + (field-printer.col printfield) + (field-printer.row printfield) + variant player dungeon)))) + + + ;; hack + (defmacro printfield-handler (arguments &body body) + (assert (= (length arguments) 6)) + (let ((def `(lambda ,arguments + (declare (ignorable ,@arguments)) + ,@body))) + ;; (warn "Def is ~s" def) + `(function ,def))) + + + (defun register-field-order (window order) + "Registers the order of fields that need printing for + a certain window. <nothing> is a magic constant." + (declare (ignorable window)) + (let ((row-counter 0) + (col-counter 0)) + + (dolist (i order) + (let ((the-key nil) + (num-rows 1)) + (cond + ((consp i) + (destructuring-bind (key &key (rows 1)) i + (if (or (eq nil key) (eq key '<nothing>)) + (setf the-key nil + row-counter (+ rows row-counter)) + (setf the-key key + num-rows rows)))) + + ((symbolp i) + (if (or (eq i nil) (eq i '<nothing>)) + (setf the-key nil + row-counter (+ 1 row-counter)) + (setf the-key i + num-rows 1))) + (t + (error "Don't know how to treat printfield-order ~s" i))) + + (when the-key + (let ((info (gethash the-key *printfield-info*))) + (unless (field-printer-p info) + (setf info (make-field-printer :key the-key))) + + (assert (non-negative-integer? num-rows)) + (setf (field-printer.row info) row-counter + (field-printer.col info) col-counter) + + (warn "row is ~s for ~s" row-counter the-key) + (incf row-counter num-rows) + + (setf (gethash the-key *printfield-info*) info) + )))) + + *printfield-info*)) + ;; very very inefficient, and wrong.. should use padding (defun print-number (term colour number padding row col) ;; hack ! (let ((win (get-window term))) ;;(output-string! win col row colour (format nil "~vd" padding number)) (win/format win col row colour "~v" padding number) ;; padding number)) *************** *** 34,38 **** (defun print-stat-value (term colour stat row col) ! (let ((win (aref *windows* term))) ;; a bit ugly but we avoid consing (cond ((>= stat 118) --- 141,145 ---- (defun print-stat-value (term colour stat row col) ! (let ((win (get-window term))) ;; a bit ugly but we avoid consing (cond ((>= stat 118) *************** *** 51,216 **** t)) - - #|| - (output-string! (aref *windows* term) - col row colour (cond ((>= stat 118) - (format nil "18/~3,'0d" (- stat 18))) - ((> stat 18) - (format nil " 18/~2,'0d" (- stat 18))) - (t - (format nil " ~2d" stat) - ))) - - (win/format (aref *windows* term) col row colour " ~2d" stat)) - ||# - - (defun print-field (str x y term) - "Print string at given coordinates in light-blue." - ;; clear and then write - - (with-frame (term) - (put-coloured-str! +term-white+ " " x y) - (put-coloured-str! +term-l-blue+ str x y))) - - - (defun print-stat (player setting num) - "Prints stats in the left frame." - - (let* ((stat-val (svref (player.active-stats player) num)) - (max-val (svref (player.modbase-stats player) num)) - (reduced-stat-p (> max-val stat-val)) - (row (setting-lookup setting "stat")) - (col 0) - (name (get-stat-name-from-num num)) - (term +charinfo-frame+) - (win (aref *windows* term)) - ) - - ;; maybe add the reduced-stat code later - (output-string! win col (+ num row) +term-white+ name) - - (print-stat-value +charinfo-frame+ (if reduced-stat-p +term-yellow+ +term-l-green+) - stat-val (+ row num) (+ col 5)) - - )) - - - (defun print-level (variant player setting) - "Prints level in the left frame." - - (when (basic-frame-shown? variant) - (let* ((lev (player.power-lvl player)) - (row (setting-lookup setting "level")) - (lower-lvl-p (< lev (player.max-level player)))) - - (output-string! +charinfo-frame+ 0 row +term-white+ "Level") - - (print-number +charinfo-frame+ (if lower-lvl-p +term-yellow+ +term-l-green+) - lev 6 row 5) - t))) - - (defun print-xp (variant player setting) - "Prints xp in the left frame." - - (when (basic-frame-shown? variant) - (let* ((xp (player.current-xp player)) - (row (setting-lookup setting "xp")) - (lower-xp-p (< xp (player.maximum-xp player)))) - - (output-string! +charinfo-frame+ 0 row +term-white+ "Xp") - - (print-number +charinfo-frame+ (if lower-xp-p +term-yellow+ +term-l-green+) - xp 8 row 3) - - t))) - - - (defun print-gold (variant player setting) - "Prints gold to left frame." - - (when (basic-frame-shown? variant) - (let ((gold (player.gold player)) - (row (setting-lookup setting "gold"))) - - (output-string! +charinfo-frame+ 0 row +term-white+ "Au") - - (print-number +charinfo-frame+ +term-l-green+ gold 9 row 2) - - t))) - - - (defmethod print-armour-class ((variant variant) (player player) setting) - "Prints AC to left frame." - - (when (basic-frame-shown? variant) - - (let* ((perc (player.perceived-abilities player)) - (ac (+ (get-armour-rating perc) - (get-armour-modifier perc))) - (row (setting-lookup setting "ac"))) - - (output-string! +charinfo-frame+ 0 row +term-white+ "Armour") - - (print-number +charinfo-frame+ +term-l-green+ - ac 5 row 6) - t))) - - - (defmethod print-hit-points (variant player setting) - "Prints hit-points info to left frame." - - (when (basic-frame-shown? variant) - - (let ((cur-hp (current-hp player)) - (max-hp (maximum-hp player)) - (row (setting-lookup setting "hp")) - ) - - (output-string! +charinfo-frame+ 0 row +term-white+ "HP") - - (print-number +charinfo-frame+ (cond ((>= cur-hp max-hp) +term-l-green+) - ((> cur-hp (int-/ (* max-hp *hitpoint-warning*) 10)) +term-yellow+) - (t +term-red+)) - cur-hp 5 row 2) - - #|| - ;; max - (print-number +charinfo-frame+ +term-l-green+ - max-hp - 5 - (car cur-set) - (+ (cdr cur-set) 7)) - - ;; cur - - - (setf (window-coord (aref *windows* +charinfo-frame+) +foreground+ 8 (car cur-set)) - (text-paint-value +term-l-green+ #\/)) - ||# - - (let ((win (aref *windows* +charinfo-frame+)) - (colour +term-l-green+)) - (win/format win 7 row colour "/~v" 3 max-hp)) - ))) - - (defmethod print-speed ((variant variant) (player player) setting) - - (when (basic-frame-shown? variant) - - (let ((win (get-window +charinfo-frame+)) - (factor (- (player.speed player) +speed-base+)) - (row (setting-lookup setting "speed"))) - - (cond ((= factor 0) - (output-string! win 0 row +term-white+ " ")) - (t - (let ((colour (if (minusp factor) +term-yellow+ +term-l-green+)) - (*winformat-forced-numbersign* t)) - (output-string! win 0 row +term-white+ "Speed") - (win/format win 8 row colour "~v" 3 factor) - ))) - t))) - - (defmethod print-hunger ((variant variant) (player player) setting) --- 158,161 ---- *************** *** 236,257 **** (return-from print-basic-frame nil)) ! (let ((pr-set (get-setting variant :basic-frame-printing)) ! (stat-len (variant.stat-length variant))) ! ! (print-field (get-race-name player) 0 (setting-lookup pr-set "race") +charinfo-frame+) ! (print-field (get-class-name player) 0 (setting-lookup pr-set "class") +charinfo-frame+) ! ! (print-level variant player pr-set) ! (print-xp variant player pr-set) ! ! (dotimes (i stat-len) ! (print-stat player pr-set i)) ! ! (print-armour-class variant player pr-set) ! (print-hit-points variant player pr-set) ! ! (print-speed variant player pr-set) ! ! (print-gold variant player pr-set)) #|| --- 181,196 ---- (return-from print-basic-frame nil)) ! (trigger-printfield-hooks& variant dungeon player '[race]) ! (trigger-printfield-hooks& variant dungeon player '[class]) ! (trigger-printfield-hooks& variant dungeon player '[level]) ! (trigger-printfield-hooks& variant dungeon player '[stats]) ! (trigger-printfield-hooks& variant dungeon player '[armour]) ! (trigger-printfield-hooks& variant dungeon player '[hp]) ! (trigger-printfield-hooks& variant dungeon player '[gold]) ! (trigger-printfield-hooks& variant dungeon player '[xp]) ! (trigger-printfield-hooks& variant dungeon player '[speed]) ! ! (print-depth variant *level* nil) ! t) #|| *************** *** 271,275 **** ;; ADD LATER ! (print-depth variant *level* nil)) --- 210,214 ---- ;; ADD LATER ! Index: util.lisp =================================================================== RCS file: /cvsroot/langband/langband/util.lisp,v retrieving revision 1.123.2.31 retrieving revision 1.123.2.32 diff -C2 -d -r1.123.2.31 -r1.123.2.32 *** util.lisp 13 Oct 2003 15:26:26 -0000 1.123.2.31 --- util.lisp 14 Oct 2003 16:36:52 -0000 1.123.2.32 *************** *** 882,989 **** t))) - (defstruct (field-printer (:copier nil) - (:conc-name field-printer.)) - key - col - row - window-key - handler) - - (defvar *printfield-info* (make-hash-table :test #'eq)) - (defvar *printfield-hooks* (make-hash-table :test #'eq)) - - (defun define-printfield-handler (key window handler &key hook-on-redraw) - (let ((info (gethash key *printfield-info*))) - (unless (field-printer-p info) - (setf info (make-field-printer :key key))) - - (setf (field-printer.handler info) handler - (field-printer.window-key info) window) - (warn "handling ~s ~s ~s" key window handler) - (setf (gethash key *printfield-info*) info) - - (when hook-on-redraw - (pushnew info (gethash hook-on-redraw *printfield-hooks*))) - - info)) - - (defun trigger-printfield-hooks& (variant dungeon player key) - "Triggers any registered printfield hooks for given key." - (when-bind (triggers (gethash key *printfield-hooks*)) - ;;(warn "TRIGGERS ~s" triggers) - (assert (consp triggers)) - (dolist (trigger triggers) - (trigger-printfield variant dungeon player trigger)) - t)) - - - (defun trigger-printfield (variant dungeon player printfield) - - (let ((win (get-window (field-printer.window-key printfield)))) - - (when (and (is-frame-shown? variant win) - (functionp (field-printer.handler printfield)) - (non-negative-integer? (field-printer.col printfield)) - (non-negative-integer? (field-printer.row printfield))) - - ;; call the handler - (funcall (field-printer.handler printfield) win - (field-printer.col printfield) - (field-printer.row printfield) - variant player *dungeon*)))) - - - ;; hack - (defmacro printfield-handler (arguments &body body) - (assert (= (length arguments) 6)) - (let ((def `(lambda ,arguments - (declare (ignorable ,@arguments)) - ,@body))) - ;; (warn "Def is ~s" def) - `(function ,def))) - - - (defun register-printfield-order (order) - "Registers the order of fields that need printing. <nothing> is a - magic constant." - (let ((row-counter 0) - (col-counter 0)) - - (dolist (i order) - (let ((the-key nil) - (num-rows 1)) - (cond - ((consp i) - (destructuring-bind (key &key (rows 1)) i - (if (or (eq nil key) (eq key '<nothing>)) - (setf the-key nil - row-counter (+ rows row-counter)) - (setf the-key key - num-rows rows)))) - - ((symbolp i) - (if (or (eq i nil) (eq i '<nothing>)) - (setf the-key nil - row-counter (+ 1 row-counter)) - (setf the-key i - num-rows 1))) - (t - (error "Don't know how to treat printfield-order ~s" i))) - - (when the-key - (let ((info (gethash the-key *printfield-info*))) - (unless (field-printer-p info) - (setf info (make-field-printer :key the-key))) - - (assert (non-negative-integer? num-rows)) - (setf (field-printer.row info) row-counter - (field-printer.col info) col-counter) - - (incf row-counter num-rows) - - (setf (gethash the-key *printfield-info*) info) - )))) - - *printfield-info*)) (defun colour-area (win colour-idx col row wid hgt) --- 882,885 ---- *************** *** 1009,1026 **** (when (is-frame-shown? variant +tiledfields-frame+) - (let (;;(stat-len (variant.stat-length variant)) - (win (get-window +tiledfields-frame+))) - (colour-window win 0) - (loop for x being the hash-values of *printfield-info* - do - (progn - ;;(format t "~&~s ~a ~a~%" (button-info-key x) (button-info-col x) (button-info-row x)) - (when (and (functionp (field-printer.handler x)) - (non-negative-integer? (field-printer.col x)) - (non-negative-integer? (field-printer.row x))) - (funcall (field-printer.handler x) win (field-printer.col x) (field-printer.row x) - variant player *dungeon*)) - )) --- 905,927 ---- (when (is-frame-shown? variant +tiledfields-frame+) + (let ((win (get-window +tiledfields-frame+))) + (colour-window win 0))) + + + (loop for x being the hash-values of *printfield-info* + do + (when (is-frame-shown? variant (field-printer.window-key x)) + ;;(format t "~&~s ~a ~a~%" (button-info-key x) (button-info-col x) (button-info-row x)) + (when (and (functionp (field-printer.handler x)) + (non-negative-integer? (field-printer.col x)) + (non-negative-integer? (field-printer.row x))) + (funcall (field-printer.handler x) (get-window (field-printer.window-key x)) + (field-printer.col x) (field-printer.row x) + variant player *dungeon*) + ))) + + (refresh-window +tiledfields-frame+) + (refresh-window +charinfo-frame+)) *************** *** 1088,1094 **** ;;(setf (window-coord win +foreground+ 0 row) 0) ;;(tile-paint-value 10 10)) ! (refresh-window win) ! ! ))) (defmethod switch-inventory-view (variant player &key wanted-view) --- 989,993 ---- ;;(setf (window-coord win +foreground+ 0 row) 0) ;;(tile-paint-value 10 10)) ! (defmethod switch-inventory-view (variant player &key wanted-view) Index: package.lisp =================================================================== RCS file: /cvsroot/langband/langband/package.lisp,v retrieving revision 1.109.2.13 retrieving revision 1.109.2.14 diff -C2 -d -r1.109.2.13 -r1.109.2.14 *** package.lisp 13 Oct 2003 15:26:26 -0000 1.109.2.13 --- package.lisp 14 Oct 2003 16:36:52 -0000 1.109.2.14 *************** *** 48,52 **** #:*windows* #:*winformat-padchar* ! ;; classes/structs types --- 48,52 ---- #:*windows* #:*winformat-padchar* ! #:*winformat-forced-numbersign* ;; classes/structs types *************** *** 368,371 **** --- 368,372 ---- #:floor.name #:floor.numeric-id + #:flush-coords #:flush-messages! #:flush-window *************** *** 386,389 **** --- 387,391 ---- #:get-attribute-value #:get-character-picture + #:get-class-name #:get-class-tile #:get-coord-trigger *************** *** 440,443 **** --- 442,446 ---- #:get-power-of-attack #:get-price + #:get-race-name #:get-ranged-attack-skill #:get-resistance-table ;; returns table *************** *** 681,685 **** --- 684,690 ---- #:player.leaving? #:player.max-depth + #:player.max-level #:player.maximum-xp + #:player.modbase-stats #:player.monster-knowledge #:player.name *************** *** 699,707 **** #:positive-integer? #:possible-identify! - #:print-armour-class #:print-basic-frame #:print-depth #:print-extra-frame-content - #:print-hit-points #:print-hunger #:print-map --- 704,710 ---- *************** *** 711,715 **** #:print-number #:print-resistance-table ! #:print-speed #:print-text! #:print-tomb --- 714,718 ---- #:print-number #:print-resistance-table ! #:print-stat-value #:print-text! #:print-tomb *************** *** 757,765 **** #:regenerate-hp! #:register-event& #:register-help-topic& #:register-information& #:register-level! #:register-level-builder! - #:register-printfield-order #:register-slot-order& #:register-variant& --- 760,768 ---- #:regenerate-hp! #:register-event& + #:register-field-order #:register-help-topic& #:register-information& #:register-level! #:register-level-builder! #:register-slot-order& #:register-variant& *************** *** 827,830 **** --- 830,835 ---- #:tile-paint-value #:trap-effect + #:trigger-printfield + #:trigger-printfield-hooks& #:trigger-special-ability #:trigger-visual-event *************** *** 963,966 **** --- 968,987 ---- #:<unique> + ;; printfield names + #:-basic/race- + #:-basic/class- + #:-basic/level- + #:-basic/xp- + #:-basic/gold- + #:-basic/stats- + #:-basic/armour- + #:-basic/hitpoints- + #:-basic/speed- + #:-basic/hunger- + #:-tiled/stats- + #:-tiled/level- + #:-tiled/armour- + #:-tiled/hitpoints- + #:*visevents* #:visual-event |
From: Stig E S. <st...@us...> - 2003-10-14 16:36:58
|
Update of /cvsroot/langband/langband/variants/vanilla/config In directory sc8-pr-cvs1:/tmp/cvs-serv9136/variants/vanilla/config Modified Files: Tag: v017_loop_experiment_2 print.lisp Log Message: tweaked how printouts and hooks for redraws work.. complete revamp Index: print.lisp =================================================================== RCS file: /cvsroot/langband/langband/variants/vanilla/config/Attic/print.lisp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** print.lisp 13 Oct 2003 15:24:14 -0000 1.1.2.1 --- print.lisp 14 Oct 2003 16:36:53 -0000 1.1.2.2 *************** *** 15,38 **** (in-package :org.langband.vanilla) ! (register-printfield-order '((-stats- :rows 6) ! <nothing> ;; defaults to 1 row ! -level- ;; defaults to 1 row, too ! -ac- ! (-hitpoints- :rows 2) ! (-mana- :rows 2))) ! (define-printfield-handler '-stats- +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) ! (dotimes (i (variant.stat-length variant)) ! (setf (idx-value (+ i 0)) (svref (player.active-stats player) i) ! (idx-value (+ i 100)) (get-stat-name-from-num i)) ! ! (setf (window-coord win +foreground+ (+ col 0) (+ row i)) (idx-paint-value +term-l-blue+ (+ 100 i)) ! (window-coord win +foreground+ (+ col 1) (+ row i)) (idx-paint-value +term-white+ (+ 0 i))) ! )) :hook-on-redraw '[stats]) ! (define-printfield-handler '-level- +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) --- 15,44 ---- (in-package :org.langband.vanilla) ! ;; overrides the one in engine ! (register-field-order +tiledfields-frame+ ! '((-tiled/stats- :rows 6) ! <nothing> ;; defaults to 1 row ! -tiled/level- ;; defaults to 1 row, too ! -tiled/armour- ! (-tiled/hitpoints- :rows 2) ! (-tiled/mana- :rows 2))) ! (define-printfield-handler '-tiled/stats- +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) ! (let ((stat-len (variant.stat-length variant))) ! (dotimes (i stat-len) ! (setf (idx-value (+ i 0)) (svref (player.active-stats player) i) ! (idx-value (+ i 100)) (get-stat-name-from-num i)) ! ! (setf (window-coord win +foreground+ (+ col 0) (+ row i)) (idx-paint-value +term-dark+ (+ 100 i)) ! (window-coord win +foreground+ (+ col 1) (+ row i)) (idx-paint-value +term-white+ (+ 0 i))) ! ! (paint-coord win (+ col 0) (+ row i) +winflag-normal-paint+) ! (paint-coord win (+ col 1) (+ row i) +winflag-normal-paint+) ! ))) :hook-on-redraw '[stats]) ! (define-printfield-handler '-tiled/level- +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) *************** *** 42,49 **** (setf (window-coord win +foreground+ (+ col 0) (+ row 0)) (idx-paint-value +term-l-blue+ (+ 100 8)) (window-coord win +foreground+ (+ col 1) (+ row 0)) (idx-paint-value +term-white+ (+ 0 8))) ) :hook-on-redraw '[level]) ! (define-printfield-handler '-ac- +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) --- 48,58 ---- (setf (window-coord win +foreground+ (+ col 0) (+ row 0)) (idx-paint-value +term-l-blue+ (+ 100 8)) (window-coord win +foreground+ (+ col 1) (+ row 0)) (idx-paint-value +term-white+ (+ 0 8))) + (paint-coord win (+ col 0) (+ row 0) +winflag-normal-paint+) + (paint-coord win (+ col 1) (+ row 0) +winflag-normal-paint+) + ) :hook-on-redraw '[level]) ! (define-printfield-handler '-tiled/armour- +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) *************** *** 53,61 **** (setf (window-coord win +foreground+ (+ col 0) (+ row 0)) (idx-paint-value +term-l-blue+ (+ 100 9)) ! (window-coord win +foreground+ (+ col 1) (+ row 0)) (idx-paint-value +term-white+ (+ 0 9))) ) :hook-on-redraw '[armour]) ! (define-printfield-handler '-hitpoints- +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) --- 62,75 ---- (setf (window-coord win +foreground+ (+ col 0) (+ row 0)) (idx-paint-value +term-l-blue+ (+ 100 9)) ! (window-coord win +foreground+ (+ col 1) (+ row 0)) (idx-paint-value +term-l-green+ (+ 0 9))) ! ! ;;(paint-coord win (+ col 0) (+ row 0) +winflag-normal-paint+) ! ;;(paint-coord win (+ col 1) (+ row 0) +winflag-normal-paint+) ! ;;(warn "did tiled armour") ! ;;(flush-coords win col row 2 1) ) :hook-on-redraw '[armour]) ! (define-printfield-handler '-tiled/hitpoints- +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) *************** *** 76,84 **** (colour-area win bg-texture col row 2 2) ;; assuming we have a 2x2 area )) :hook-on-redraw '[hp]) ! (define-printfield-handler '-mana- +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) --- 90,101 ---- (colour-area win bg-texture col row 2 2) ;; assuming we have a 2x2 area + + (paint-coord win (+ col 0) (+ row 0) +winflag-normal-paint+) + (paint-coord win (+ col 1) (+ row 0) +winflag-normal-paint+) )) :hook-on-redraw '[hp]) ! (define-printfield-handler '-tiled/mana- +tiledfields-frame+ (printfield-handler (win col row variant player dungeon) *************** *** 104,105 **** --- 121,244 ---- :hook-on-redraw '[mana]) + ;; basic frame! + + (define-printfield-handler '-basic/level- + +charinfo-frame+ + (printfield-handler (win col row variant player dungeon) + (let* ((lev (player.power-lvl player)) + (lower-lvl-p (< lev (player.max-level player)))) + + ;;(warn "basic level") + (output-string! win 0 row +term-white+ "Level") + + (print-number win (if lower-lvl-p +term-yellow+ +term-l-green+) + lev 6 row 5))) + :hook-on-redraw '[level]) + + (define-printfield-handler '-basic/hitpoints- + +charinfo-frame+ + (printfield-handler (win col row variant player dungeon) + + (let ((cur-hp (current-hp player)) + (max-hp (maximum-hp player)) + ) + ;;(warn "basic hp") + (output-string! win 0 row +term-white+ "HP") + + (print-number win (cond ((>= cur-hp max-hp) +term-l-green+) + ((> cur-hp (int-/ (* max-hp *hitpoint-warning*) 10)) +term-yellow+) + (t +term-red+)) + cur-hp 5 row 2) + (win/format win 7 row +term-l-green+ "/~v" 3 max-hp) + t)) + + :hook-on-redraw '[hp]) + + (define-printfield-handler '-basic/armour- + +charinfo-frame+ + (printfield-handler (win col row variant player dungeon) + (let* ((perc (player.perceived-abilities player)) + (ac (+ (get-armour-rating perc) + (get-armour-modifier perc)))) + + (output-string! win 0 row +term-white+ "Armour") + + (print-number win +term-l-green+ ac 5 row 6) + t)) + :hook-on-redraw '[armour]) + + (define-printfield-handler '-basic/gold- + +charinfo-frame+ + (printfield-handler (win col row variant player dungeon) + (let ((gold (player.gold player))) + (output-string! win 0 row +term-white+ "Au") + (print-number win +term-l-green+ gold 9 row 2) + t)) + :hook-on-redraw '[gold]) + + (define-printfield-handler '-basic/xp- + +charinfo-frame+ + (printfield-handler (win col row variant player dungeon) + (let* ((xp (player.current-xp player)) + (lower-xp-p (< xp (player.maximum-xp player)))) + + (output-string! win 0 row +term-white+ "Xp") + + (print-number win (if lower-xp-p +term-yellow+ +term-l-green+) xp 8 row 3) + t)) + + :hook-on-redraw '[xp]) + + (define-printfield-handler '-basic/race- + +charinfo-frame+ + (printfield-handler (win col row variant player dungeon) + (output-string! win col row +term-white+ " ") + (output-string! win col row +term-l-blue+ (get-race-name player)) + t) + + :hook-on-redraw '[race]) + + (define-printfield-handler '-basic/class- + +charinfo-frame+ + (printfield-handler (win col row variant player dungeon) + (output-string! win col row +term-white+ " ") + (output-string! win col row +term-l-blue+ (get-class-name player)) + t) + + :hook-on-redraw '[class]) + + (define-printfield-handler '-basic/stats- + +charinfo-frame+ + (printfield-handler (win col row variant player dungeon) + (let ((stat-len (variant.stat-length variant))) + (dotimes (num stat-len) + (let* ((stat-val (svref (player.active-stats player) num)) + (max-val (svref (player.modbase-stats player) num)) + (reduced-stat-p (> max-val stat-val)) + (name (get-stat-name-from-num num)) + ) + + ;; maybe add the reduced-stat code later + (output-string! win col (+ num row) +term-white+ name) + + (print-stat-value win (if reduced-stat-p +term-yellow+ +term-l-green+) + stat-val (+ row num) (+ col 5)) + )))) + + :hook-on-redraw '[stats]) + + (define-printfield-handler '-basic/speed- + +charinfo-frame+ + (printfield-handler (win col row variant player dungeon) + (let ((factor (- (player.speed player) +speed-base+))) + (cond ((= factor 0) + (output-string! win 0 row +term-white+ " ")) + (t + (let ((colour (if (minusp factor) +term-yellow+ +term-l-green+)) + (*winformat-forced-numbersign* t)) + (output-string! win 0 row +term-white+ "Speed") + (win/format win 8 row colour "~v" 3 factor) + ))) + )) + + :hook-on-redraw '[speed]) |
From: Stig E S. <st...@us...> - 2003-10-14 16:36:57
|
Update of /cvsroot/langband/langband/variants/vanilla In directory sc8-pr-cvs1:/tmp/cvs-serv9136/variants/vanilla Modified Files: Tag: v017_loop_experiment_2 print.lisp Log Message: tweaked how printouts and hooks for redraws work.. complete revamp Index: print.lisp =================================================================== RCS file: /cvsroot/langband/langband/variants/vanilla/print.lisp,v retrieving revision 1.46.2.4 retrieving revision 1.46.2.5 diff -C2 -d -r1.46.2.4 -r1.46.2.5 *** print.lisp 6 Oct 2003 00:24:08 -0000 1.46.2.4 --- print.lisp 14 Oct 2003 16:36:53 -0000 1.46.2.5 *************** *** 68,72 **** (print-cut variant player pr-set) (print-hunger variant player pr-set) ! (print-speed variant player pr-set) (print-stun variant player pr-set) --- 68,72 ---- (print-cut variant player pr-set) (print-hunger variant player pr-set) ! (trigger-printfield-hooks& variant dungeon player '[speed]) (print-stun variant player pr-set) |
From: Stig E S. <st...@us...> - 2003-10-14 16:36:57
|
Update of /cvsroot/langband/langband/config In directory sc8-pr-cvs1:/tmp/cvs-serv9136/config Modified Files: Tag: v017_loop_experiment_2 settings.lisp Log Message: tweaked how printouts and hooks for redraws work.. complete revamp Index: settings.lisp =================================================================== RCS file: /cvsroot/langband/langband/config/settings.lisp,v retrieving revision 1.10.4.1 retrieving revision 1.10.4.2 diff -C2 -d -r1.10.4.1 -r1.10.4.2 *** settings.lisp 6 Oct 2003 00:24:08 -0000 1.10.4.1 --- settings.lisp 14 Oct 2003 16:36:53 -0000 1.10.4.2 *************** *** 93,96 **** --- 93,97 ---- + ;; obsolete!! (define-settings '("basic-frame-locations") "name" "Basic frame locations" *************** *** 111,112 **** --- 112,136 ---- ) + (register-field-order +charinfo-frame+ + '(<nothing> + -basic/race- + -basic/class- + <nothing> + -basic/level- + -basic/xp- + -basic/gold- + <nothing> + (-basic/stats- :rows 6) + <nothing> + -basic/armour- + -basic/hitpoints- + <nothing> + -basic/speed- + -basic/hunger-)) + + (register-field-order +tiledfields-frame+ + '((-tiled/stats- :rows 6) + <nothing> ;; defaults to 1 row + -tiled/level- ;; defaults to 1 row, too + -tiled/armour- + (-tiled/hitpoints- :rows 2))) |
From: Stig E S. <st...@us...> - 2003-10-14 16:35:24
|
Update of /cvsroot/langband/langband In directory sc8-pr-cvs1:/tmp/cvs-serv8860 Modified Files: Tag: v017_loop_experiment_2 langband-engine.asd langband-engine.system Log Message: tweak Index: langband-engine.asd =================================================================== RCS file: /cvsroot/langband/langband/langband-engine.asd,v retrieving revision 1.63.2.1 retrieving revision 1.63.2.2 diff -C2 -d -r1.63.2.1 -r1.63.2.2 *** langband-engine.asd 20 Aug 2003 09:34:41 -0000 1.63.2.1 --- langband-engine.asd 14 Oct 2003 16:35:20 -0000 1.63.2.2 *************** *** 109,113 **** "classes" "dungeon" "player")) (:file "project" :depends-on ("base" "generics" "player" "object" "dungeon" "combat")) ! (:file "util" :depends-on ("dungeon" "classes" "global" "generics" "generate" "project" "building")) (:file "stores" :depends-on ("building" "generics" "equipment" "character" "util")) --- 109,113 ---- "classes" "dungeon" "player")) (:file "project" :depends-on ("base" "generics" "player" "object" "dungeon" "combat")) ! (:file "util" :depends-on ("constants" "dungeon" "classes" "global" "generics" "generate" "project" "building")) (:file "stores" :depends-on ("building" "generics" "equipment" "character" "util")) Index: langband-engine.system =================================================================== RCS file: /cvsroot/langband/langband/langband-engine.system,v retrieving revision 1.94 retrieving revision 1.94.2.1 diff -C2 -d -r1.94 -r1.94.2.1 *** langband-engine.system 23 Jun 2003 13:44:13 -0000 1.94 --- langband-engine.system 14 Oct 2003 16:35:20 -0000 1.94.2.1 *************** *** 97,101 **** "classes" "dungeon" "player")) (:file "project" :depends-on ("base" "generics" "player" "object" "dungeon" "combat")) ! (:file "util" :depends-on ("dungeon" "classes" "global" "generics" "generate" "building" "project")) (:file "stores" :depends-on ("building" "generics" "equipment" "character" "util")) --- 97,101 ---- "classes" "dungeon" "player")) (:file "project" :depends-on ("base" "generics" "player" "object" "dungeon" "combat")) ! (:file "util" :depends-on ("constants" "dungeon" "classes" "global" "generics" "generate" "building" "project")) (:file "stores" :depends-on ("building" "generics" "equipment" "character" "util")) |
From: Stig E S. <st...@us...> - 2003-10-14 16:35:01
|
Update of /cvsroot/langband/langband/zterm In directory sc8-pr-cvs1:/tmp/cvs-serv8725/zterm Modified Files: Tag: v017_loop_experiment_2 main-sdl.c Log Message: tweak Index: main-sdl.c =================================================================== RCS file: /cvsroot/langband/langband/zterm/main-sdl.c,v retrieving revision 1.113.2.5 retrieving revision 1.113.2.6 diff -C2 -d -r1.113.2.5 -r1.113.2.6 *** main-sdl.c 13 Oct 2003 15:23:31 -0000 1.113.2.5 --- main-sdl.c 14 Oct 2003 16:34:55 -0000 1.113.2.6 *************** *** 861,865 **** } ! //DBGPUT("Doing idx %u with attr %u -> '%s' %d.\n", idx, attr, value, valuelen); // we assume that the size is 32 now --- 861,865 ---- } ! DBGPUT("Doing idx %u with attr %u -> '%s' %d.\n", idx, attr, value, valuelen); // we assume that the size is 32 now *************** *** 920,923 **** --- 920,925 ---- } + orig = scratch; + /* SDL_Surface *ptr = fd->theFont; *************** *** 949,953 **** //SDL_SaveBMP(fd->theFont, "font.bmp"); //SDL_SaveBMP(scratch, "hop.bmp"); ! orig = scratch; } //DBGPUT("1. Char = %c, attr = %d\n", thechar, attr); --- 951,955 ---- //SDL_SaveBMP(fd->theFont, "font.bmp"); //SDL_SaveBMP(scratch, "hop.bmp"); ! } //DBGPUT("1. Char = %c, attr = %d\n", thechar, attr); |
From: Stig E S. <st...@us...> - 2003-10-14 16:35:01
|
Update of /cvsroot/langband/langband/config In directory sc8-pr-cvs1:/tmp/cvs-serv8725/config Modified Files: Tag: v017_loop_experiment_2 theme.lisp Log Message: tweak Index: theme.lisp =================================================================== RCS file: /cvsroot/langband/langband/config/theme.lisp,v retrieving revision 1.25.4.6 retrieving revision 1.25.4.7 diff -C2 -d -r1.25.4.6 -r1.25.4.7 *** theme.lisp 13 Oct 2003 15:26:25 -0000 1.25.4.6 --- theme.lisp 14 Oct 2003 16:34:55 -0000 1.25.4.7 *************** *** 44,49 **** (charinfo :key +charinfo-frame+ :x 0 :y 12 ! :disabled? true ! ;;:disabled? false :width (* 12 (var charinfo tile-width)) ;; we need 13 columns :height (- (var msg y-offset) (var charinfo y-offset) (var infodisp height)) --- 44,49 ---- (charinfo :key +charinfo-frame+ :x 0 :y 12 ! ;;:disabled? true ! :disabled? false :width (* 12 (var charinfo tile-width)) ;; we need 13 columns :height (- (var msg y-offset) (var charinfo y-offset) (var infodisp height)) |
From: Stig E S. <st...@us...> - 2003-10-13 15:45:29
|
Update of /cvsroot/langband/langband In directory sc8-pr-cvs1:/tmp/cvs-serv4888 Modified Files: Tag: v017_loop_experiment_2 loop.lisp Log Message: tweak Index: loop.lisp =================================================================== RCS file: /cvsroot/langband/langband/loop.lisp,v retrieving revision 1.277.2.23 retrieving revision 1.277.2.24 diff -C2 -d -r1.277.2.23 -r1.277.2.24 *** loop.lisp 13 Oct 2003 15:26:26 -0000 1.277.2.23 --- loop.lisp 13 Oct 2003 15:45:17 -0000 1.277.2.24 *************** *** 83,86 **** --- 83,87 ---- (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) (print-level variant player pr-set) + (trigger-printfield-hooks& variant dungeon player '[level]) (setf retval t)) *************** *** 89,92 **** --- 90,94 ---- (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) (print-xp variant player pr-set) + (trigger-printfield-hooks& variant dungeon player '[xp]) (setf retval t)) *************** *** 96,99 **** --- 98,102 ---- (dotimes (i (variant.stat-length variant)) (print-stat player pr-set i)) ;; probably not optimal handling + (trigger-printfield-hooks& variant dungeon player '[stats]) (setf retval t)) *************** *** 102,105 **** --- 105,109 ---- (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) (print-armour-class variant player pr-set) + (trigger-printfield-hooks& variant dungeon player '[armour]) (setf retval t)) *************** *** 115,118 **** --- 119,123 ---- (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) (print-gold variant player pr-set) + (trigger-printfield-hooks& variant dungeon player '[gold]) (setf retval t)) *************** *** 120,123 **** --- 125,129 ---- (reset-redraw! player '[depth]) (print-depth variant (dungeon.depth dungeon) nil) + (trigger-printfield-hooks& variant dungeon player '[depth]) (setf retval t)) *************** *** 125,128 **** --- 131,135 ---- (reset-redraw! player '[health]) ;; fix + (trigger-printfield-hooks& variant dungeon player '[health]) (setf retval t)) *************** *** 141,144 **** --- 148,152 ---- (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) (print-speed variant player pr-set) + (trigger-printfield-hooks& variant dungeon player '[speed]) (setf retval t)) |
Update of /cvsroot/langband/langband In directory sc8-pr-cvs1:/tmp/cvs-serv1177 Modified Files: Tag: v017_loop_experiment_2 constants.lisp package.lisp global.lisp util.lisp loop.lisp themes.lisp Log Message: renamed old buttonsframe to tiledfields-frame, also changed old button fields to print-fields, added hook and window support to the printfields Index: constants.lisp =================================================================== RCS file: /cvsroot/langband/langband/constants.lisp,v retrieving revision 1.111.2.9 retrieving revision 1.111.2.10 diff -C2 -d -r1.111.2.9 -r1.111.2.10 *** constants.lisp 6 Oct 2003 00:54:41 -0000 1.111.2.9 --- constants.lisp 13 Oct 2003 15:26:25 -0000 1.111.2.10 *************** *** 266,270 **** (def-exportconst +dialogue-frame+ 7) (def-exportconst +infodisp-frame+ 8) ! (def-exportconst +buttons-frame+ 9) (def-exportconst +frametype-active+ 0) --- 266,270 ---- (def-exportconst +dialogue-frame+ 7) (def-exportconst +infodisp-frame+ 8) ! (def-exportconst +tiledfields-frame+ 9) (def-exportconst +frametype-active+ 0) *************** *** 301,304 **** --- 301,305 ---- (def-exportconst +tilefile-buttons+ 38) (def-exportconst +tilefile-crosshairs+ 40) + (def-exportconst +tilefile-backgrounds+ 44) ;; 64x64 tiles! ;;; these are for the gfxtile system: Index: package.lisp =================================================================== RCS file: /cvsroot/langband/langband/package.lisp,v retrieving revision 1.109.2.12 retrieving revision 1.109.2.13 diff -C2 -d -r1.109.2.12 -r1.109.2.13 *** package.lisp 12 Oct 2003 14:22:53 -0000 1.109.2.12 --- package.lisp 13 Oct 2003 15:26:26 -0000 1.109.2.13 *************** *** 271,275 **** #:define-attack-description #:define-basic-flavour - #:define-button-handler #:define-character-class #:define-character-race --- 271,274 ---- *************** *** 287,290 **** --- 286,290 ---- #:define-object-kind #:define-object-type + #:define-printfield-handler #:define-redraw-key #:define-room *************** *** 703,707 **** #:print-depth #:print-extra-frame-content - #:print-handler #:print-hit-points #:print-hunger --- 703,706 ---- *************** *** 715,718 **** --- 714,718 ---- #:print-text! #:print-tomb + #:printfield-handler #:process-single-monster! #:process-world& *************** *** 756,760 **** #:refresh-window #:regenerate-hp! - #:register-button-order #:register-event& #:register-help-topic& --- 756,759 ---- *************** *** 762,765 **** --- 761,765 ---- #:register-level! #:register-level-builder! + #:register-printfield-order #:register-slot-order& #:register-variant& Index: global.lisp =================================================================== RCS file: /cvsroot/langband/langband/global.lisp,v retrieving revision 1.323.2.12 retrieving revision 1.323.2.13 diff -C2 -d -r1.323.2.12 -r1.323.2.13 *** global.lisp 6 Oct 2003 00:24:07 -0000 1.323.2.12 --- global.lisp 13 Oct 2003 15:26:26 -0000 1.323.2.13 *************** *** 1711,1715 **** ;:; also *map-frame* (defvar *regular-frameset* (list +message-frame+ +charinfo-frame+ +infodisp-frame+ ! +misc-frame+ +inv-frame+ +buttons-frame+)) (defun %switch-in-window (win) --- 1711,1715 ---- ;:; also *map-frame* (defvar *regular-frameset* (list +message-frame+ +charinfo-frame+ +infodisp-frame+ ! +misc-frame+ +inv-frame+ +tiledfields-frame+)) (defun %switch-in-window (win) *************** *** 1739,1743 **** (deactivate-window +charinfo-frame+) (deactivate-window *map-frame*) ! (deactivate-window +buttons-frame+) (activate-window +dialogue-frame+) (paint-window +dialogue-frame+) --- 1739,1743 ---- (deactivate-window +charinfo-frame+) (deactivate-window *map-frame*) ! (deactivate-window +tiledfields-frame+) (activate-window +dialogue-frame+) (paint-window +dialogue-frame+) *************** *** 1754,1758 **** (paint-window win))) ! (when-bind (win (get-window +buttons-frame+)) (unless (window.disabled? win) (activate-window win) --- 1754,1758 ---- (paint-window win))) ! (when-bind (win (get-window +tiledfields-frame+)) (unless (window.disabled? win) (activate-window win) Index: util.lisp =================================================================== RCS file: /cvsroot/langband/langband/util.lisp,v retrieving revision 1.123.2.30 retrieving revision 1.123.2.31 diff -C2 -d -r1.123.2.30 -r1.123.2.31 *** util.lisp 12 Oct 2003 14:22:43 -0000 1.123.2.30 --- util.lisp 13 Oct 2003 15:26:26 -0000 1.123.2.31 *************** *** 882,906 **** t))) ! (defstruct button-info key col row handler) ! (defvar *button-info* (make-hash-table :test #'eq)) ! (defun define-button-handler (key handler) ! (let ((button-info (gethash key *button-info*))) ! (unless (button-info-p button-info) ! (setf button-info (make-button-info :key key))) ! (setf (button-info-handler button-info) handler) ! (warn "handling ~s ~s" key handler) ! (setf (gethash key *button-info*) button-info) ! button-info)) ;; hack ! (defmacro print-handler (arguments &body body) (assert (= (length arguments) 6)) (let ((def `(lambda ,arguments --- 882,939 ---- t))) ! (defstruct (field-printer (:copier nil) ! (:conc-name field-printer.)) key col row + window-key handler) ! (defvar *printfield-info* (make-hash-table :test #'eq)) ! (defvar *printfield-hooks* (make-hash-table :test #'eq)) ! (defun define-printfield-handler (key window handler &key hook-on-redraw) ! (let ((info (gethash key *printfield-info*))) ! (unless (field-printer-p info) ! (setf info (make-field-printer :key key))) ! (setf (field-printer.handler info) handler ! (field-printer.window-key info) window) ! (warn "handling ~s ~s ~s" key window handler) ! (setf (gethash key *printfield-info*) info) ! ! (when hook-on-redraw ! (pushnew info (gethash hook-on-redraw *printfield-hooks*))) ! info)) ! ! (defun trigger-printfield-hooks& (variant dungeon player key) ! "Triggers any registered printfield hooks for given key." ! (when-bind (triggers (gethash key *printfield-hooks*)) ! ;;(warn "TRIGGERS ~s" triggers) ! (assert (consp triggers)) ! (dolist (trigger triggers) ! (trigger-printfield variant dungeon player trigger)) ! t)) ! ! ! (defun trigger-printfield (variant dungeon player printfield) ! ! (let ((win (get-window (field-printer.window-key printfield)))) ! ! (when (and (is-frame-shown? variant win) ! (functionp (field-printer.handler printfield)) ! (non-negative-integer? (field-printer.col printfield)) ! (non-negative-integer? (field-printer.row printfield))) ! ! ;; call the handler ! (funcall (field-printer.handler printfield) win ! (field-printer.col printfield) ! (field-printer.row printfield) ! variant player *dungeon*)))) ! ;; hack ! (defmacro printfield-handler (arguments &body body) (assert (= (length arguments) 6)) (let ((def `(lambda ,arguments *************** *** 911,915 **** ! (defun register-button-order (order) (let ((row-counter 0) (col-counter 0)) --- 944,950 ---- ! (defun register-printfield-order (order) ! "Registers the order of fields that need printing. <nothing> is a ! magic constant." (let ((row-counter 0) (col-counter 0)) *************** *** 918,948 **** (let ((the-key nil) (num-rows 1)) ! (cond ((eq i '-nothing-) ! (incf row-counter 1)) ! ((consp i) (destructuring-bind (key &key (rows 1)) i ! (setf the-key key ! num-rows rows))) ((symbolp i) ! (setf the-key i ! num-rows 1)) (t ! (error "Don't know how to treat button-order ~s" i))) ! ! (let ((button-info (gethash the-key *button-info*))) ! (unless (button-info-p button-info) ! (setf button-info (make-button-info :key the-key))) ! ! (assert (non-negative-integer? num-rows)) ! (setf (button-info-row button-info) row-counter ! (button-info-col button-info) col-counter) ! ! (incf row-counter num-rows) ! (setf (gethash the-key *button-info*) button-info) ! ))) ! *button-info*)) (defun colour-area (win colour-idx col row wid hgt) --- 953,989 ---- (let ((the-key nil) (num-rows 1)) ! (cond ((consp i) (destructuring-bind (key &key (rows 1)) i ! (if (or (eq nil key) (eq key '<nothing>)) ! (setf the-key nil ! row-counter (+ rows row-counter)) ! (setf the-key key ! num-rows rows)))) ! ((symbolp i) ! (if (or (eq i nil) (eq i '<nothing>)) ! (setf the-key nil ! row-counter (+ 1 row-counter)) ! (setf the-key i ! num-rows 1))) (t ! (error "Don't know how to treat printfield-order ~s" i))) ! ! (when the-key ! (let ((info (gethash the-key *printfield-info*))) ! (unless (field-printer-p info) ! (setf info (make-field-printer :key the-key))) ! ! (assert (non-negative-integer? num-rows)) ! (setf (field-printer.row info) row-counter ! (field-printer.col info) col-counter) ! ! (incf row-counter num-rows) ! (setf (gethash the-key *printfield-info*) info) ! )))) ! *printfield-info*)) (defun colour-area (win colour-idx col row wid hgt) *************** *** 956,960 **** (incf tile-idx (rem x 2)) (incf tile-idx (* 10 (rem y 2))) ! (setf (window-coord win +background+ x y) (tile-paint-value 44 tile-idx)) ))) win)) --- 997,1001 ---- (incf tile-idx (rem x 2)) (incf tile-idx (* 10 (rem y 2))) ! (setf (window-coord win +background+ x y) (tile-paint-value +tilefile-backgrounds+ tile-idx)) ))) win)) *************** *** 967,983 **** (declare (ignorable player)) ! (when (is-frame-shown? variant +buttons-frame+) (let (;;(stat-len (variant.stat-length variant)) ! (win (get-window +buttons-frame+))) (colour-window win 0) ! (loop for x being the hash-values of *button-info* do (progn ;;(format t "~&~s ~a ~a~%" (button-info-key x) (button-info-col x) (button-info-row x)) ! (when (and (functionp (button-info-handler x)) ! (non-negative-integer? (button-info-col x)) ! (non-negative-integer? (button-info-row x))) ! (funcall (button-info-handler x) win (button-info-col x) (button-info-row x) variant player *dungeon*)) )) --- 1008,1024 ---- (declare (ignorable player)) ! (when (is-frame-shown? variant +tiledfields-frame+) (let (;;(stat-len (variant.stat-length variant)) ! (win (get-window +tiledfields-frame+))) (colour-window win 0) ! (loop for x being the hash-values of *printfield-info* do (progn ;;(format t "~&~s ~a ~a~%" (button-info-key x) (button-info-col x) (button-info-row x)) ! (when (and (functionp (field-printer.handler x)) ! (non-negative-integer? (field-printer.col x)) ! (non-negative-integer? (field-printer.row x))) ! (funcall (field-printer.handler x) win (field-printer.col x) (field-printer.row x) variant player *dungeon*)) )) Index: loop.lisp =================================================================== RCS file: /cvsroot/langband/langband/loop.lisp,v retrieving revision 1.277.2.22 retrieving revision 1.277.2.23 diff -C2 -d -r1.277.2.22 -r1.277.2.23 *** loop.lisp 5 Oct 2003 08:05:00 -0000 1.277.2.22 --- loop.lisp 13 Oct 2003 15:26:26 -0000 1.277.2.23 *************** *** 108,111 **** --- 108,112 ---- (unless pr-set (setf pr-set (get-setting variant :basic-frame-printing))) (print-hit-points variant player pr-set) + (trigger-printfield-hooks& variant dungeon player '[hp]) (setf retval t)) *************** *** 636,641 **** --- 637,647 ---- (refresh-window *map-frame*) + ;; fix! (when (basic-frame-shown? var-obj) (when-bind (win (get-window +charinfo-frame+)) + (refresh-window win))) + + (when (is-frame-shown? var-obj +tiledfields-frame+) + (when-bind (win (get-window +tiledfields-frame+)) (refresh-window win))) Index: themes.lisp =================================================================== RCS file: /cvsroot/langband/langband/themes.lisp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** themes.lisp 22 Sep 2003 13:53:19 -0000 1.1.2.1 --- themes.lisp 13 Oct 2003 15:26:26 -0000 1.1.2.2 *************** *** 71,76 **** ((eq var '+infodisp-frame+) +infodisp-frame+) ! ((eq var '+buttons-frame+) ! +buttons-frame+) (t --- 71,76 ---- ((eq var '+infodisp-frame+) +infodisp-frame+) ! ((eq var '+tiledfields-frame+) ! +tiledfields-frame+) (t |
From: Stig E S. <st...@us...> - 2003-10-13 15:26:34
|
Update of /cvsroot/langband/langband/config In directory sc8-pr-cvs1:/tmp/cvs-serv1177/config Modified Files: Tag: v017_loop_experiment_2 theme.lisp Log Message: renamed old buttonsframe to tiledfields-frame, also changed old button fields to print-fields, added hook and window support to the printfields Index: theme.lisp =================================================================== RCS file: /cvsroot/langband/langband/config/theme.lisp,v retrieving revision 1.25.4.5 retrieving revision 1.25.4.6 diff -C2 -d -r1.25.4.5 -r1.25.4.6 *** theme.lisp 12 Oct 2003 14:24:17 -0000 1.25.4.5 --- theme.lisp 13 Oct 2003 15:26:25 -0000 1.25.4.6 *************** *** 67,71 **** (gfxmap :key +gfxmap-frame+ :x (var charinfo width) :y 0 ! :width (- window.width (var buttons width) (var charinfo width)) :height (- (var msg y-offset) (var gfxmap y-offset)) :tile-width gfxtiles.width --- 67,71 ---- (gfxmap :key +gfxmap-frame+ :x (var charinfo width) :y 0 ! :width (- window.width (var tiledfields width) (var charinfo width)) :height (- (var msg y-offset) (var gfxmap y-offset)) :tile-width gfxtiles.width *************** *** 75,79 **** (asciimap :key +asciimap-frame+ :x (var charinfo width) :y 0 ! :width (- window.width (var buttons width) (var charinfo width)) ;;688 :height (- (var msg y-offset) (var asciimap y-offset)) :font "vga8x16.hex" --- 75,79 ---- (asciimap :key +asciimap-frame+ :x (var charinfo width) :y 0 ! :width (- window.width (var tiledfields width) (var charinfo width)) ;;688 :height (- (var msg y-offset) (var asciimap y-offset)) :font "vga8x16.hex" *************** *** 83,87 **** (msg :key +message-frame+ :x 0 :y (- window.height (+ (var msg height) (var inventory height) (var misc height))) ! :width (- window.width (var buttons width)) :height (* (var msg tile-height) 3) ;; how many rows? ;;:background "textures/bumpi.png" --- 83,87 ---- (msg :key +message-frame+ :x 0 :y (- window.height (+ (var msg height) (var inventory height) (var misc height))) ! :width (- window.width (var tiledfields width)) :height (* (var msg tile-height) 3) ;; how many rows? ;;:background "textures/bumpi.png" *************** *** 95,99 **** (misc :key +misc-frame+ :x 0 :y (- window.height (+ (var inventory height) (var misc height))) ! :width (- window.width (var buttons width)) :height (var misc tile-height) ;;:background "textures/bumpi.png" --- 95,99 ---- (misc :key +misc-frame+ :x 0 :y (- window.height (+ (var inventory height) (var misc height))) ! :width (- window.width (var tiledfields width)) :height (var misc tile-height) ;;:background "textures/bumpi.png" *************** *** 124,131 **** :gfx-tiles? false) ! (buttons :key +buttons-frame+ :disabled? false ;;:disabled? true ! :x (- window.width (var buttons width)) :y 0 :width (* 2 gfxtiles.width) --- 124,131 ---- :gfx-tiles? false) ! (tiledfields :key +tiledfields-frame+ :disabled? false ;;:disabled? true ! :x (- window.width (var tiledfields width)) :y 0 :width (* 2 gfxtiles.width) |
From: Stig E S. <st...@us...> - 2003-10-13 15:24:58
|
Update of /cvsroot/langband/langband/variants/vanilla/config In directory sc8-pr-cvs1:/tmp/cvs-serv843/config Modified Files: Tag: v017_loop_experiment_2 defines.lisp Log Message: moved code to separate file Index: defines.lisp =================================================================== RCS file: /cvsroot/langband/langband/variants/vanilla/config/defines.lisp,v retrieving revision 1.43.2.2 retrieving revision 1.43.2.3 diff -C2 -d -r1.43.2.2 -r1.43.2.3 *** defines.lisp 12 Oct 2003 14:21:59 -0000 1.43.2.2 --- defines.lisp 13 Oct 2003 15:24:47 -0000 1.43.2.3 *************** *** 186,265 **** (engine-gfx "tiles/backgrounds.png") )) - - (register-button-order '((-stats- :rows 6) - <nothing> ;; defaults to 1 row - -level- ;; defaults to 1 row, too - -ac- - (-hitpoints- :rows 2) - (-mana- :rows 2))) - - (define-button-handler '-stats- - (print-handler (win col row variant player dungeon) - (dotimes (i (variant.stat-length variant)) - (setf (idx-value (+ i 0)) (svref (player.active-stats player) i) - (idx-value (+ i 100)) (get-stat-name-from-num i)) - - (setf (window-coord win +foreground+ (+ col 0) (+ row i)) (idx-paint-value +term-l-blue+ (+ 100 i)) - (window-coord win +foreground+ (+ col 1) (+ row i)) (idx-paint-value +term-white+ (+ 0 i))) - ))) - - (define-button-handler '-level- - (print-handler (win col row variant player dungeon) - (setf (idx-value (+ 0 8)) (player.power-lvl player) - (idx-value (+ 0 8 100)) "Lvl") - - (setf (window-coord win +foreground+ (+ col 0) (+ row 0)) (idx-paint-value +term-l-blue+ (+ 100 8)) - (window-coord win +foreground+ (+ col 1) (+ row 0)) (idx-paint-value +term-white+ (+ 0 8))) - )) - - (define-button-handler '-ac- - (print-handler (win col row variant player dungeon) - (setf (idx-value (+ 0 9)) (+ (get-armour-rating (player.perceived-abilities player)) - (get-armour-modifier (player.perceived-abilities player))) - (idx-value (+ 0 9 100)) "AC") - - (setf (window-coord win +foreground+ (+ col 0) (+ row 0)) (idx-paint-value +term-l-blue+ (+ 100 9)) - (window-coord win +foreground+ (+ col 1) (+ row 0)) (idx-paint-value +term-white+ (+ 0 9))) - )) - - (define-button-handler '-hitpoints- - (print-handler (win col row variant player dungeon) - (let ((bg-texture 0) - (hptext-colour +term-l-blue+) - (hp-colour +term-white+) - (max-hp (maximum-hp player)) - (cur-hp (current-hp player))) - - (when (< (* 2 cur-hp) max-hp) - (setf bg-texture 2)) - - (setf (idx-value (+ 0 10)) cur-hp - (idx-value (+ 0 10 100)) "HP") - - (setf (window-coord win +foreground+ (+ col 0) (+ row 0)) (idx-paint-value hptext-colour (+ 100 10)) - (window-coord win +foreground+ (+ col 1) (+ row 0)) (idx-paint-value hp-colour (+ 0 10))) - - (colour-area win bg-texture col row 2 2) ;; assuming we have a 2x2 area - - ))) - - (define-button-handler '-mana- - (print-handler (win col row variant player dungeon) - (let ((bg-texture 0) - (hptext-colour +term-l-blue+) - (hp-colour +term-white+) - (max-mana (maximum-mana player)) - (cur-mana (current-mana player))) - - (when (< (* 2 cur-mana) max-mana) - (setf bg-texture 2)) - - (setf (idx-value (+ 0 12)) cur-mana - (idx-value (+ 0 12 100)) "MP") - - (setf (window-coord win +foreground+ (+ col 0) (+ row 0)) (idx-paint-value hptext-colour (+ 100 12)) - (window-coord win +foreground+ (+ col 1) (+ row 0)) (idx-paint-value hp-colour (+ 0 12))) - - (colour-area win bg-texture col row 2 2) ;; assuming we have a 2x2 area - - ))) --- 186,187 ---- |