1. Paul Sexton
  2. cl-tcod


pa...@wormwood  committed 62a2188

Minor change to allow use with currently released 1.4.3b1 library (which lacks wrapper for put-char-ex).
Updated README.

  • Participants
  • Parent commits 5b0bce4
  • Branches default

Comments (0)

Files changed (2)


View file
 ("libtcod"), a portable truecolour console library intended for use with
 roguelike games.
-CL-TCOD consists of 2 files:
+CL-TCOD consists of the following files:
 1. TCOD.LISP, a lisp file which creates lisp bindings for C functions in the
    compiled libtcod library, using the "CFFI" lisp foreign function interface.
 2. TCOD.ASD, which allows TCOD to be easily loaded and used as a library by
    other common lisp programs, via the "ASDF" library-loading facility.
+3. TCOD-COLOURS.LISP, a lisp file containing definitions for all the colours
+   named in /etc/X11/rgb.txt; autogenerated using 'parse-rgb' (see below)
-CL-TCOD has been tested with SBCL 1.0.25, CLISP 2.44, and Clozure 1.3 on
-Linux. It should work on any common lisp implementation where CFFI works.
+4. PARSE-RGB.LISP, a lisp file containing code for parsing /etc/X11/rgb.txt
+   and generating tcod-colours.lisp
+5. PARSE-RGB.ASD, ASDF system definition file for PARSE-RGB.LISP
+CL-TCOD has been tested with SBCL 1.0.32, CLISP 2.48, and Clozure 1.4 on Linux;
+and with CLISP 2.48 on Windows XP. It should work on any common lisp
+implementation where CFFI works.
 **Note** that it has not been used on a Mac; if you do this you may need to
 tell CFFI what the name of the compiled libtcod library under MacOS is. To do
 1. Ensure you have a working common lisp installation. 
 2. Ensure the ASDF lisp library is installed.
 3. If CFFI is not installed (see above), download and install it somewhere ASDF can
-   find it.
+   find it. CFFI requires several third-party lisp libraries -- see the CFFI
+   documentation for more details.
 4. Put the CL-TCOD files in a directory where ASDF can find them.
 5. Make sure libtcod is installed and compiled. Make sure the libtcod
    dynamically linked library (.DLL or .SO file) is somewhere your lisp system
    (push #P"/my/libtcod/directory/" cffi:*foreign-library-directories*)
-6. Start lisp. Load ASDF, CFFI, and finally CL-TCOD:
+   *On windows*, DLL files should be put in one of the directories listed in the
+   "PATH" environment variable. You will need to put SDL.dll in the same place
+   if you don't already have SDL installed.
+   *On Linux*, you can usually put .SO files in /usr/local/lib/.
+   Use your package installer to install "libSDL".
+   Try running the libtcod demo programs to check everything works.
+6. Start lisp. Load ASDF, then CL-TCOD:
+   (load "/path/to/asdf/asdf.lisp")
    (asdf:oos 'asdf:load-op :tcod)
 7. Type something like the following commands at the lisp prompt to start using TCOD

File tcod.lisp

View file
 	(con console) (x :int) (y :int) (c :unsigned-char)
 	(fg colournum) (bg colournum))
+;; wrapper to TCOD_console_put_char_ex is currently only in SVN
+(unless (cffi:foreign-symbol-pointer "TCOD_console_put_char_ex_wrapper")
+  (defun console-put-char-ex (con x y c fg bg)
+    (console-set-fore con x y fg)
+    (console-set-back con x y fg)
+    (console-set-char con x y c)))
 ;;TCODLIB_API void TCOD_console_print_left(TCOD_console_t con,int x, int y,
 ;;                                         TCOD_bkgnd_flag_t flag,
 ;;                                         const char *fmt, ...); 
 ;;TCODLIB_API void TCOD_console_flush();
 (defcfun ("TCOD_console_flush" console-flush) :void)
-;; (sys-flush t) forces a redraw of the whole root console.
+;; (sys-flush t) forces an 'update' of the system timer, FPS, etc.
+;; If render is true, also forces an update of the root console.
 (defcfun ("TCOD_sys_flush" sys-flush) :void
-	(flag :boolean))
+	(render :boolean))
 ;;TCODLIB_API void TCOD_console_set_color_control(TCOD_colctrl_t con,
 ;;     TCOD_color_t fore, TCOD_color_t back);