27 | You can only do that if you get libtcod through svn. To do this, make sure you have svn installed (or any graphical client like tortoiseSvn on Windows) and type the following command :
28 |
svn co http://doryen.eptalys.net/svn-libtcod/trunk libtcod-1.5.0
29 | Now you have the developer version of libtcod in the libtcod-1.5.0 directory.
30 | You can use some predefined makefiles located in the makefiles directory. Check the README.txt in this directory to know which makefile you have to use.
31 | You can also use the autotools system if your OS support it. On linux, make sure the autoconf and libtool packages are installed. Go in the autotools directory and type :
32 |
autoreconf
33 | ./configure
34 | make
35 | This should produce the samples exe in autotools directory. Note that you have to run the samples from the main libtcod directory for them to be able to access the png they need :
36 |
11 |
18 | To compile the samples under OSX, use 'make -f makefile-samples-osx all'. For your own application, modify the makefile to include your c/cpp source files, and create a new executable target. For example, if your application is called 'MyRoguelike', and uses source files src1.c, src2.c and src3.c, you would add the following lines to the end of makefile-samples-osx.
19 |
20 |
25 |
26 | Build using 'make -f makefile-samples-osx myroguelike' to get a command-line build of your application. To create a double-clickable application, create a new Info.plist file for your binary (see the osx directory for examples), and add the following to the makefile:
27 |
28 |
34 |
35 | Build using 'make -f makefile-samples-osx myroguelike.app', and you should have a self-contained application bundle that will work on any OSX system.
36 |
37 |
38 | Important Note: If you need to access system information (resolution etc) via SDL before you call TCOD_sys_init(), you must explicitly call TCOD_sys_startup(), using code similar to the following:
39 |
40 |
This toolkit allows to easily calculate the potential visible set of map cells from the player position. A cell is potentially visible if the line of sight from the player to the cell in unobstructed.
25 |
26 |
27 |
35 |
36 |
40 |
41 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/midpoint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/midpoint.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/mingw1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/mingw1.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/mingw2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/mingw2.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/mingw3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/mingw3.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/mingw4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/mingw4.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/perlin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/perlin.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/simplex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/simplex.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/subcell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/subcell.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/subcell_comp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/subcell_comp.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/subcell_pyro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/subcell_pyro.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/terminal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/terminal.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/terminal8x8_aa_as.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/terminal8x8_aa_as.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/terminal8x8_gs_as.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/terminal8x8_gs_as.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/terminal8x8_gs_as2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/terminal8x8_gs_as2.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/terminal8x8_gs_ro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/terminal8x8_gs_ro.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/terminal8x8_gs_tc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/terminal8x8_gs_tc.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/turbulence_perlin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/turbulence_perlin.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/turbulence_simplex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/turbulence_simplex.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/turbulence_wavelet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/turbulence_wavelet.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/html2/wavelet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/html2/wavelet.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/img/breadcrumb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/img/breadcrumb.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/img/c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/img/c.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/img/cpp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/img/cpp.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/img/cs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/img/cs.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/img/gradient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/img/gradient.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/img/haschildren.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/img/haschildren.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/img/lua.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/img/lua.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/img/next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/img/next.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/img/prev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/img/prev.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/img/py.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/img/py.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/img/sidebar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/img/sidebar.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/img/sidebar_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/doc/img/sidebar_arrow.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/js/doctcod.js:
--------------------------------------------------------------------------------
1 | function enable(lang,onoff) {
2 | var plist=document.getElementsByTagName("P");
3 | for (var i=0; i < plist.length; i++) {
4 | var p = plist[i];
5 | if ( p.className == lang ) {
6 | p.style.display = (onoff ? "" : "none");
7 | }
8 | }
9 | }
10 |
11 | function link(page) {
12 | var chk_c=document.getElementById("chk_c");
13 | var chk_cpp=document.getElementById("chk_cpp");
14 | var chk_cs=document.getElementById("chk_cs");
15 | var chk_py=document.getElementById("chk_py");
16 | var chk_lua=document.getElementById("chk_lua");
17 | var url=page+'?c='+chk_c.checked+'&cpp='+chk_cpp.checked+'&cs='+chk_cs.checked+'&py='+chk_py.checked+'&lua='+chk_lua.checked;
18 | document.location=url;
19 | }
20 |
21 | function getParam(name) {
22 | // var regexS = "[\\?&]"+name+"=([^]*)";
23 | // var regex = new new RegExp( regexS );
24 | var v = window.location.href.split(/[?&]/);
25 | for (var i=0; i < v.length; i++ ) {
26 | var n = v[i].split(/[=#]/);
27 | if ( n.length >= 1 && n[0] == name ) return decodeURI(n[1]);
28 | }
29 | return "";
30 | }
31 |
32 | function initFilter() {
33 | var chk_c=document.getElementById("chk_c");
34 | var chk_cpp=document.getElementById("chk_cpp");
35 | var chk_cs=document.getElementById("chk_cs");
36 | var chk_py=document.getElementById("chk_py");
37 | var chk_lua=document.getElementById("chk_lua");
38 | chk_c.checked = (getParam("c") == "true");
39 | chk_cpp.checked = (getParam("cpp") == "true");
40 | chk_cs.checked = (getParam("cs") == "true");
41 | chk_py.checked = (getParam("py") == "true");
42 | chk_lua.checked = (getParam("lua") == "true");
43 | if (!chk_c.checked) enable("c",false);
44 | if (!chk_cpp.checked) enable("cpp",false);
45 | if (!chk_cs.checked) enable("cs",false);
46 | if (!chk_py.checked) enable("py",false);
47 | if (!chk_lua.checked) enable("lua",false);
48 | }
49 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/doc/js/shBrushBash.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/
4 | *
5 | * @version
6 | * 2.0.278 (February 03 2009)
7 | *
8 | * @author
9 | * Alex Gorbatchev
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2009 Alex Gorbatchev.
13 | *
14 | * Licensed under a GNU Lesser General Public License.
15 | * http://creativecommons.org/licenses/LGPL/2.1/
16 | *
17 | * SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
18 | * the source code in accordance with LGPL 2.1 license, however if you want to use
19 | * SyntaxHighlighter on your site or include it in your product, you must donate.
20 | * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
21 | */
22 | SyntaxHighlighter.brushes.Bash = function()
23 | {
24 | var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne gt lt ge le';
25 | var commands = 'alias apropos awk bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
26 | 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' +
27 | 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
28 | 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
29 | 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' +
30 | 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
31 | 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
32 | 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' +
33 | 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
34 | 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
35 | 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' +
36 | 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
37 | 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
38 | 'vi watch wc whereis which who whoami Wget xargs yes'
39 | ;
40 |
41 | this.regexList = [
42 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
43 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
44 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
45 | { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands
46 | ];
47 | }
48 |
49 | SyntaxHighlighter.brushes.Bash.prototype = new SyntaxHighlighter.Highlighter();
50 | SyntaxHighlighter.brushes.Bash.aliases = ['bash', 'shell'];
51 |
52 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/hmtool:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/hmtool
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/hmtool_debug:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/hmtool_debug
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/bresenham.h:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef _TCOD_BRESENHAM_H
29 | #define _TCOD_BRESENHAM_H
30 |
31 | typedef bool (*TCOD_line_listener_t) (int x, int y);
32 |
33 | TCODLIB_API void TCOD_line_init(int xFrom, int yFrom, int xTo, int yTo);
34 | TCODLIB_API bool TCOD_line_step(int *xCur, int *yCur); /* advance one step. returns true if we reach destination */
35 | /* atomic callback function. Stops when the callback returns false */
36 | TCODLIB_API bool TCOD_line(int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener);
37 |
38 | /* thread-safe versions */
39 | typedef struct {
40 | int stepx;
41 | int stepy;
42 | int e;
43 | int deltax;
44 | int deltay;
45 | int origx;
46 | int origy;
47 | int destx;
48 | int desty;
49 | } TCOD_bresenham_data_t;
50 |
51 | TCODLIB_API void TCOD_line_init_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_bresenham_data_t *data);
52 | TCODLIB_API bool TCOD_line_step_mt(int *xCur, int *yCur, TCOD_bresenham_data_t *data);
53 | TCODLIB_API bool TCOD_line_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener, TCOD_bresenham_data_t *data);
54 |
55 | #endif
56 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/fov.h:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef _TCOD_FOV_H
29 | #define _TCOD_FOV_H
30 |
31 | typedef void *TCOD_map_t;
32 |
33 | #include "fov_types.h"
34 |
35 | /* allocate a new map */
36 | TCODLIB_API TCOD_map_t TCOD_map_new(int width, int height);
37 | /* set all cells as solid rock (cannot see through nor walk) */
38 | TCODLIB_API void TCOD_map_clear(TCOD_map_t map, bool transparent, bool walkable);
39 | /* copy a map to another, reallocating it when needed */
40 | TCODLIB_API void TCOD_map_copy(TCOD_map_t source, TCOD_map_t dest);
41 | /* change a cell properties */
42 | TCODLIB_API void TCOD_map_set_properties(TCOD_map_t map, int x, int y, bool is_transparent, bool is_walkable);
43 | /* destroy a map */
44 | TCODLIB_API void TCOD_map_delete(TCOD_map_t map);
45 |
46 | /* calculate the field of view (potentially visible cells from player_x,player_y) */
47 | TCODLIB_API void TCOD_map_compute_fov(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls, TCOD_fov_algorithm_t algo);
48 | /* check if a cell is in the last computed field of view */
49 | TCODLIB_API bool TCOD_map_is_in_fov(TCOD_map_t map, int x, int y);
50 | TCODLIB_API void TCOD_map_set_in_fov(TCOD_map_t map, int x, int y, bool fov);
51 |
52 | /* retrieve properties from the map */
53 | TCODLIB_API bool TCOD_map_is_transparent(TCOD_map_t map, int x, int y);
54 | TCODLIB_API bool TCOD_map_is_walkable(TCOD_map_t map, int x, int y);
55 | TCODLIB_API int TCOD_map_get_width(TCOD_map_t map);
56 | TCODLIB_API int TCOD_map_get_height(TCOD_map_t map);
57 | TCODLIB_API int TCOD_map_get_nb_cells(TCOD_map_t map);
58 | #endif
59 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/fov_types.h:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef _TCOD_FOV_TYPES_H
29 | #define _TCOD_FOV_TYPES_H
30 |
31 | /* FOV_BASIC : http://roguebasin.roguelikedevelopment.org/index.php?title=Ray_casting
32 | FOV_DIAMOND : http://www.geocities.com/temerra/los_rays.html
33 | FOV_SHADOW : http://roguebasin.roguelikedevelopment.org/index.php?title=FOV_using_recursive_shadowcasting
34 | FOV_PERMISSIVE : http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View
35 | FOV_RESTRICTIVE : Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos) */
36 |
37 | typedef enum {
38 | FOV_BASIC,
39 | FOV_DIAMOND,
40 | FOV_SHADOW,
41 | FOV_PERMISSIVE_0,
42 | FOV_PERMISSIVE_1,
43 | FOV_PERMISSIVE_2,
44 | FOV_PERMISSIVE_3,
45 | FOV_PERMISSIVE_4,
46 | FOV_PERMISSIVE_5,
47 | FOV_PERMISSIVE_6,
48 | FOV_PERMISSIVE_7,
49 | FOV_PERMISSIVE_8,
50 | FOV_RESTRICTIVE,
51 | NB_FOV_ALGORITHMS } TCOD_fov_algorithm_t;
52 | #define FOV_PERMISSIVE(x) ((TCOD_fov_algorithm_t)(FOV_PERMISSIVE_0 + (x)))
53 |
54 | #endif /* _TCOD_FOV_TYPES_H */
55 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/button.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API Button : public Widget {
28 | public :
29 | Button(const char *label, const char *tip, widget_callback_t cbk, void *userData=NULL);
30 | Button(int x, int y, int width, int height, const char *label, const char *tip, widget_callback_t cbk, void *userData=NULL);
31 | virtual ~Button();
32 | void render();
33 | void setLabel(const char *newLabel);
34 | void computeSize();
35 | inline bool isPressed() { return pressed; }
36 | protected :
37 | bool pressed;
38 | char *label;
39 | widget_callback_t cbk;
40 |
41 | void onButtonPress();
42 | void onButtonRelease();
43 | void onButtonClick();
44 | void expand(int width, int height);
45 | };
46 |
47 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/container.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API Container : public Widget {
28 | public :
29 | Container(int x, int y, int w, int h) : Widget(x,y,w,h) {}
30 | virtual ~Container();
31 | void addWidget(Widget *wid);
32 | void removeWidget(Widget *wid);
33 | void setVisible(bool val);
34 | void render();
35 | void clear();
36 | void update(const TCOD_key_t k);
37 | protected :
38 | TCODList content;
39 | };
40 |
41 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/flatlist.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API FlatList : public TextBox {
28 | public :
29 | FlatList(int x,int y,int w, const char **list, const char *label, const char *tip=NULL);
30 | virtual ~FlatList();
31 | void render();
32 | void update(const TCOD_key_t k);
33 | void setCallback(void (*cbk)(Widget *wid, const char * val, void *data), void *data) { this->cbk=cbk; this->data=data;}
34 | void setValue(const char * value);
35 | void setList(const char **list);
36 | protected :
37 | const char **value;
38 | const char **list;
39 | bool onLeftArrow;
40 | bool onRightArrow;
41 | void (*cbk)(Widget *wid, const char *val, void *data);
42 | void *data;
43 |
44 | void valueToText();
45 | void textToValue();
46 | void onButtonClick();
47 | };
48 |
49 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/gui.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #ifndef _GUI_HPP
28 | #define _GUI_HPP
29 |
30 | #include "libtcod.hpp"
31 |
32 | #ifdef TCOD_VISUAL_STUDIO
33 | #pragma warning(disable:4996)
34 | #pragma warning(disable:4251)
35 | #endif
36 |
37 | // DLL export
38 | #ifdef TCOD_WINDOWS
39 | #ifdef LIBTCOD_GUI_EXPORTS
40 | #define TCODLIB_GUI_API __declspec(dllexport)
41 | #else
42 | #define TCODLIB_GUI_API __declspec(dllimport)
43 | #endif
44 | #else
45 | #define TCODLIB_GUI_API
46 | #endif
47 |
48 | #include "widget.hpp"
49 | #include "button.hpp"
50 | #include "radiobutton.hpp"
51 | #include "container.hpp"
52 | #include "label.hpp"
53 | #include "statusbar.hpp"
54 | #include "textbox.hpp"
55 | #include "flatlist.hpp"
56 | #include "slider.hpp"
57 | #include "togglebutton.hpp"
58 | #include "toolbar.hpp"
59 | #include "vbox.hpp"
60 | #include "hbox.hpp"
61 | #include "image.hpp"
62 |
63 | #endif
64 |
65 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/hbox.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API HBox : public VBox {
28 | public :
29 | HBox(int x, int y, int padding);
30 | void computeSize();
31 | };
32 |
33 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/image.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API Image : public Widget {
28 | public :
29 | Image(int x,int y,int w, int h, const char *tip=NULL);
30 | virtual ~Image();
31 | void setBackgroundColor(const TCODColor col);
32 | void render();
33 | protected :
34 | void expand(int width, int height);
35 |
36 | TCODColor back;
37 | };
38 |
39 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/label.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API Label : public Widget {
28 | public :
29 | Label(int x, int y, const char *label, const char *tip=NULL );
30 | void render();
31 | void computeSize();
32 | void setValue(const char *label) { this->label=label; }
33 | protected :
34 | const char *label;
35 |
36 | void expand(int width, int height);
37 | };
38 |
39 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/radiobutton.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API RadioButton : public Button {
28 | public :
29 | RadioButton(const char *label, const char *tip, widget_callback_t cbk, void *userData=NULL)
30 | : Button(label,tip,cbk,userData),group(defaultGroup) {}
31 | RadioButton(int x, int y, int width, int height, const char *label, const char *tip, widget_callback_t cbk, void *userData=NULL)
32 | : Button(x,y,width,height,label,tip,cbk,userData),group(defaultGroup) {}
33 |
34 | void setGroup(int group) { this->group=group; }
35 | void render();
36 | void select();
37 | void unSelect();
38 | static void unSelectGroup(int group);
39 | static void setDefaultGroup(int group) { defaultGroup=group; }
40 | protected :
41 | static int defaultGroup;
42 | int group;
43 | static RadioButton *groupSelect[512];
44 |
45 | void onButtonClick();
46 | };
47 |
48 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/slider.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API Slider : public TextBox {
28 | public :
29 | Slider(int x,int y,int w, float min, float max, const char *label, const char *tip=NULL);
30 | virtual ~Slider();
31 | void render();
32 | void update(const TCOD_key_t k);
33 | void setMinMax(float min, float max) { this->min=min;this->max=max; }
34 | void setCallback(void (*cbk)(Widget *wid, float val, void *data), void *data) { this->cbk=cbk; this->data=data;}
35 | void setFormat(const char *fmt);
36 | void setValue(float value);
37 | void setSensitivity(float sensitivity) { this->sensitivity=sensitivity;}
38 | protected :
39 | float min,max,value,sensitivity;
40 | bool onArrows;
41 | bool drag;
42 | int dragx;
43 | int dragy;
44 | float dragValue;
45 | char *fmt;
46 | void (*cbk)(Widget *wid, float val, void *data);
47 | void *data;
48 |
49 | void valueToText();
50 | void textToValue();
51 | void onButtonPress();
52 | void onButtonRelease();
53 | };
54 |
55 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/statusbar.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API StatusBar : public Widget {
28 | public :
29 | StatusBar(int x,int y,int w, int h):Widget(x,y,w,h) {}
30 | void render();
31 | };
32 |
33 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/textbox.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API TextBox : public Widget {
28 | public :
29 | TextBox(int x,int y,int w, int maxw, const char *label, const char *value, const char *tip=NULL);
30 | virtual ~TextBox();
31 | void render();
32 | void update(const TCOD_key_t k);
33 | void setText(const char *txt);
34 | const char *getValue() { return txt; }
35 | void setCallback(void (*cbk)(Widget *wid, char * val, void * data), void *data) { txtcbk=cbk; this->data=data; }
36 | static void setBlinkingDelay(float delay) { blinkingDelay=delay; }
37 | protected :
38 | static float blinkingDelay;
39 | char *label;
40 | char *txt;
41 | float blink;
42 | int pos, offset;
43 | int boxx,boxw,maxw;
44 | bool insert;
45 | void (*txtcbk)(Widget *wid, char * val, void *data);
46 | void *data;
47 |
48 | void onButtonClick();
49 | };
50 |
51 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/togglebutton.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API ToggleButton : public Button {
28 | public :
29 | ToggleButton(const char *label, const char *tip, widget_callback_t cbk, void *userData=NULL)
30 | :Button(label, tip, cbk, userData) {}
31 | ToggleButton(int x, int y, int width, int height, const char *label, const char *tip, widget_callback_t cbk, void *userData=NULL)
32 | :Button(x, y, width, height, label, tip, cbk, userData) {}
33 | void render();
34 | bool isPressed() { return pressed; }
35 | void setPressed(bool val) { pressed=val; }
36 | protected :
37 | void onButtonPress();
38 | void onButtonRelease();
39 | void onButtonClick();
40 | };
41 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/toolbar.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API ToolBar : public Container {
28 | public :
29 | ToolBar(int x, int y, const char *name, const char *tip=NULL);
30 | ToolBar(int x, int y, int w, const char *name, const char *tip=NULL);
31 | ~ToolBar();
32 | void render();
33 | void setName(const char *name);
34 | void addSeparator(const char *txt, const char *tip=NULL);
35 | void computeSize();
36 | protected :
37 | char *name;
38 | int fixedWidth;
39 | };
40 |
41 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/gui/vbox.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | class TCODLIB_GUI_API VBox : public Container {
28 | public :
29 | VBox(int x, int y, int padding) : Container(x,y,0,0),padding(padding) {}
30 | void computeSize();
31 | protected :
32 | int padding;
33 | };
34 |
35 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/libtcod.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef _LIBTCOD_HPP
29 | #define _LIBTCOD_HPP
30 |
31 | #include "libtcod.h"
32 | #include "list.hpp"
33 | #include "color.hpp"
34 | #include "console.hpp"
35 | #include "image.hpp"
36 | #include "sys.hpp"
37 | #include "mersenne.hpp"
38 | #include "mouse.hpp"
39 | #include "bresenham.hpp"
40 | #include "noise.hpp"
41 | #include "fov.hpp"
42 | #include "path.hpp"
43 | #include "lex.hpp"
44 | #include "parser.hpp"
45 | #include "tree.hpp"
46 | #include "bsp.hpp"
47 | #include "heightmap.hpp"
48 | #include "zip.hpp"
49 | #include "namegen.hpp"
50 | #include "txtfield.hpp"
51 | #endif
52 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/mersenne.h:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef _TCOD_RANDOM_H
29 | #define _TCOD_RANDOM_H
30 |
31 | #include "mersenne_types.h"
32 |
33 | typedef void *TCOD_random_t;
34 |
35 | TCODLIB_API TCOD_random_t TCOD_random_get_instance(void);
36 | TCODLIB_API TCOD_random_t TCOD_random_new(TCOD_random_algo_t algo);
37 | TCODLIB_API TCOD_random_t TCOD_random_save(TCOD_random_t mersenne);
38 | TCODLIB_API void TCOD_random_restore(TCOD_random_t mersenne, TCOD_random_t backup);
39 | TCODLIB_API TCOD_random_t TCOD_random_new_from_seed(TCOD_random_algo_t algo, uint32 seed);
40 | TCODLIB_API void TCOD_random_delete(TCOD_random_t mersenne);
41 |
42 | TCODLIB_API void TCOD_random_set_distribution (TCOD_random_t mersenne, TCOD_distribution_t distribution);
43 |
44 | TCODLIB_API int TCOD_random_get_int (TCOD_random_t mersenne, int min, int max);
45 | TCODLIB_API float TCOD_random_get_float (TCOD_random_t mersenne, float min, float max);
46 | TCODLIB_API double TCOD_random_get_double (TCOD_random_t mersenne, double min, double max);
47 |
48 | TCODLIB_API int TCOD_random_get_int_mean (TCOD_random_t mersenne, int min, int max, int mean);
49 | TCODLIB_API float TCOD_random_get_float_mean (TCOD_random_t mersenne, float min, float max, float mean);
50 | TCODLIB_API double TCOD_random_get_double_mean (TCOD_random_t mersenne, double min, double max, double mean);
51 |
52 | TCODLIB_API TCOD_dice_t TCOD_random_dice_new (const char * s);
53 | TCODLIB_API int TCOD_random_dice_roll (TCOD_random_t mersenne, TCOD_dice_t dice);
54 | TCODLIB_API int TCOD_random_dice_roll_s (TCOD_random_t mersenne, const char * s);
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/mersenne_types.h:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef _TCOD_RANDOM_TYPES_H
29 | #define _TCOD_RANDOM_TYPES_H
30 |
31 | /* dice roll */
32 | typedef struct {
33 | int nb_rolls;
34 | int nb_faces;
35 | float multiplier;
36 | float addsub;
37 | } TCOD_dice_t;
38 |
39 | /* PRNG algorithms */
40 | typedef enum {
41 | TCOD_RNG_MT,
42 | TCOD_RNG_CMWC
43 | } TCOD_random_algo_t;
44 |
45 | typedef enum {
46 | TCOD_DISTRIBUTION_LINEAR,
47 | TCOD_DISTRIBUTION_GAUSSIAN,
48 | TCOD_DISTRIBUTION_GAUSSIAN_RANGE,
49 | TCOD_DISTRIBUTION_GAUSSIAN_INVERSE,
50 | TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE
51 | } TCOD_distribution_t;
52 |
53 | #endif /* _TCOD_RANDOM_TYPES_H */
54 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/mouse.h:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef _TCOD_MOUSE_H
29 | #define _TCOD_MOUSE_H
30 |
31 | #include "mouse_types.h"
32 |
33 | TCODLIB_API void TCOD_mouse_show_cursor(bool visible);
34 | TCODLIB_API TCOD_mouse_t TCOD_mouse_get_status();
35 | TCODLIB_API bool TCOD_mouse_is_cursor_visible();
36 | TCODLIB_API void TCOD_mouse_move(int x, int y);
37 | TCODLIB_API void TCOD_mouse_includes_touch(bool enable);
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/mouse_types.h:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef _TCOD_MOUSE_TYPES_H
29 | #define _TCOD_MOUSE_TYPES_H
30 |
31 | /* mouse data */
32 | typedef struct {
33 | int x,y; /* absolute position */
34 | int dx,dy; /* movement since last update in pixels */
35 | int cx,cy; /* cell coordinates in the root console */
36 | int dcx,dcy; /* movement since last update in console cells */
37 | bool lbutton ; /* left button status */
38 | bool rbutton ; /* right button status */
39 | bool mbutton ; /* middle button status */
40 | bool lbutton_pressed ; /* left button pressed event */
41 | bool rbutton_pressed ; /* right button pressed event */
42 | bool mbutton_pressed ; /* middle button pressed event */
43 | bool wheel_up ; /* wheel up event */
44 | bool wheel_down ; /* wheel down event */
45 | } TCOD_mouse_t;
46 |
47 | #endif /* _TCOD_MOUSE_TYPES_H */
48 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/namegen.h:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | /*
28 | * Mingos' NameGen
29 | * This file was written by Dominik "Mingos" Marczuk.
30 | */
31 |
32 | #ifndef _TCOD_NAMEGEN_H
33 | #define _TCOD_NAMEGEN_H
34 |
35 | /* the generator typedef */
36 | typedef void * TCOD_namegen_t;
37 |
38 | /* parse a file with syllable sets */
39 | TCODLIB_API void TCOD_namegen_parse (const char * filename, TCOD_random_t random);
40 | /* generate a name */
41 | TCODLIB_API char * TCOD_namegen_generate (char * name, bool allocate);
42 | /* generate a name using a custom generation rule */
43 | TCODLIB_API char * TCOD_namegen_generate_custom (char * name, char * rule, bool allocate);
44 | /* retrieve the list of all available syllable set names */
45 | TCODLIB_API TCOD_list_t TCOD_namegen_get_sets (void);
46 | /* delete a generator */
47 | TCODLIB_API void TCOD_namegen_destroy (void);
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/noise.h:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef _TCOD_PERLIN_H
29 | #define _TCOD_PERLIN_H
30 |
31 | typedef void *TCOD_noise_t;
32 |
33 | typedef enum {
34 | TCOD_NOISE_PERLIN = 1,
35 | TCOD_NOISE_SIMPLEX = 2,
36 | TCOD_NOISE_WAVELET = 4,
37 | TCOD_NOISE_DEFAULT = 0
38 | } TCOD_noise_type_t;
39 |
40 | #include "noise_defaults.h"
41 |
42 | /* create a new noise object */
43 | TCODLIB_API TCOD_noise_t TCOD_noise_new(int dimensions, float hurst, float lacunarity, TCOD_random_t random);
44 |
45 | /* simplified API */
46 | TCODLIB_API void TCOD_noise_set_type (TCOD_noise_t noise, TCOD_noise_type_t type);
47 | TCODLIB_API float TCOD_noise_get_ex (TCOD_noise_t noise, float *f, TCOD_noise_type_t type);
48 | TCODLIB_API float TCOD_noise_get_fbm_ex (TCOD_noise_t noise, float *f, float octaves, TCOD_noise_type_t type);
49 | TCODLIB_API float TCOD_noise_get_turbulence_ex (TCOD_noise_t noise, float *f, float octaves, TCOD_noise_type_t type);
50 | TCODLIB_API float TCOD_noise_get (TCOD_noise_t noise, float *f);
51 | TCODLIB_API float TCOD_noise_get_fbm (TCOD_noise_t noise, float *f, float octaves);
52 | TCODLIB_API float TCOD_noise_get_turbulence (TCOD_noise_t noise, float *f, float octaves);
53 | /* delete the noise object */
54 | TCODLIB_API void TCOD_noise_delete(TCOD_noise_t noise);
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/noise_defaults.h:
--------------------------------------------------------------------------------
1 | #ifndef _TCOD_NOISE_DEFAULTS
2 | #define _TCOD_NOISE_DEFAULTS
3 |
4 | #define TCOD_NOISE_MAX_OCTAVES 128
5 | #define TCOD_NOISE_MAX_DIMENSIONS 4
6 | #define TCOD_NOISE_DEFAULT_HURST 0.5f
7 | #define TCOD_NOISE_DEFAULT_LACUNARITY 2.0f
8 |
9 | #endif /* _TCOD_NOISE_DEFAULTS */
10 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/tree.h:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef _TCOD_TREE_H
29 | #define _TCOD_TREE_H
30 |
31 | typedef struct _TCOD_tree_t {
32 | struct _TCOD_tree_t *next;
33 | struct _TCOD_tree_t *father;
34 | struct _TCOD_tree_t *sons;
35 | } TCOD_tree_t;
36 |
37 | TCODLIB_API TCOD_tree_t *TCOD_tree_new();
38 | TCODLIB_API void TCOD_tree_add_son(TCOD_tree_t *node, TCOD_tree_t *son);
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/tree.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef _TCOD_TREE_HPP
29 | #define _TCOD_TREE_HPP
30 |
31 | class TCODLIB_API TCODTree {
32 | public :
33 | TCODTree *next;
34 | TCODTree *father;
35 | TCODTree *sons;
36 |
37 | TCODTree() : next(NULL),father(NULL),sons(NULL){}
38 | void addSon(TCODTree *data) {
39 | data->father=this;
40 | TCODTree *lastson = sons;
41 | while ( lastson && lastson->next ) lastson=lastson->next;
42 | if ( lastson ) {
43 | lastson->next=data;
44 | } else {
45 | sons=data;
46 | }
47 | }
48 |
49 | };
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/txtfield.h:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 |
29 | #ifndef _TCOD_TEXT_H_
30 | #define _TCOD_TEXT_H_
31 |
32 | typedef void * TCOD_text_t;
33 |
34 | TCODLIB_API TCOD_text_t TCOD_text_init(int x, int y, int w, int h, int max_chars);
35 | TCODLIB_API TCOD_text_t TCOD_text_init2(int w, int h, int max_chars);
36 | TCODLIB_API void TCOD_text_set_pos(TCOD_text_t txt, int x, int y);
37 | TCODLIB_API void TCOD_text_set_properties(TCOD_text_t txt, int cursor_char, int blink_interval, const char * prompt, int tab_size);
38 | TCODLIB_API void TCOD_text_set_colors(TCOD_text_t txt, TCOD_color_t fore, TCOD_color_t back, float back_transparency);
39 | TCODLIB_API bool TCOD_text_update(TCOD_text_t txt, TCOD_key_t key);
40 | TCODLIB_API void TCOD_text_render(TCOD_text_t txt, TCOD_console_t con);
41 | TCODLIB_API const char * TCOD_text_get(TCOD_text_t txt);
42 | TCODLIB_API void TCOD_text_reset(TCOD_text_t txt);
43 | TCODLIB_API void TCOD_text_delete(TCOD_text_t txt);
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/include/txtfield.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #ifndef _TCOD_TEXT_HPP_
29 | #define _TCOD_TEXT_HPP_
30 |
31 | #include "color.hpp"
32 |
33 | class TCODLIB_API TCODText {
34 | public :
35 | TCODText(int x, int y, int w, int h, int max_chars);
36 | TCODText(int w, int h, int max_chars);
37 | ~TCODText();
38 | void setProperties(int cursor_char, int blink_interval, const char * prompt, int tab_size);
39 | void setColors(TCODColor fore, TCODColor back, float back_transparency);
40 | void setPos(int x, int y);
41 | bool update(TCOD_key_t key);
42 | void render(TCODConsole * con);
43 | const char *getText();
44 | void reset();
45 | protected :
46 | TCOD_text_t data;
47 | };
48 |
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/libtcod.cfg:
--------------------------------------------------------------------------------
1 | /*
2 | Use this file to customize the behaviour of libtcod,
3 | overriding what's defined in the sample/game code.
4 | The main goal of this file is to allow the player
5 | to tweak the game in case it doesn't work properly
6 | on his system and there are no options screen/config
7 | files available in the game.
8 | */
9 | libtcod {
10 | // uncomment to force the use of a specific renderer
11 | // renderer = "GLSL"
12 | // renderer = "OPENGL"
13 | //renderer = "SDL"
14 |
15 | // uncomment to force a specific fullscreen resolution
16 | /*
17 | fullscreen=true
18 | fullscreenWidth=1280
19 | fullscreenHeight=1024
20 | */
21 |
22 | // uncomment to use a custom font.
23 | /*
24 | font="data/fonts/terminal8x8_gs_as.png"
25 | fontInRow=false
26 | fontGreyscale=true
27 | fontTcodLayout=false
28 | fontNbCharHoriz=16
29 | fontNbCharVertic=16
30 | */
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/apfviewer.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "libtcod.hpp"
3 |
4 | static float version=1.0f;
5 |
6 | int main(int argc, char *argv[]) {
7 | TCODConsole * rootcon = NULL;
8 | TCOD_key_t keyPress;
9 | TCOD_renderer_t renderer = TCOD_RENDERER_SDL;
10 |
11 | int row=50;
12 | int col=80;
13 | if ( argc < 2) {
14 | printf ("apfviewer ...\nversion %g\n",version);
15 | return 1;
16 | }
17 | TCODConsole::initRoot(col,row,"apfviewer",false,renderer );
18 | TCODConsole con(1,1);
19 | for (int i=1; i < argc; i++) {
20 | if (strstr(argv[i],".asc")) con.loadAsc(argv[1]);
21 | else con.loadApf(argv[i]);
22 | delete TCODConsole::root;
23 | TCODConsole::root=NULL;
24 | TCODConsole::initRoot(con.getWidth(),con.getHeight(),argv[i],false,renderer );
25 | TCODConsole::blit(&con,0,0,0,0,TCODConsole::root,0,0);
26 | TCODConsole::root->flush();
27 | TCODSystem::waitForEvent(TCOD_EVENT_KEY_RELEASE|TCOD_EVENT_MOUSE_PRESS,NULL,NULL,true);
28 | }
29 |
30 | return 0;
31 | }
32 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/doctcod/page.tpl:
--------------------------------------------------------------------------------
1 |
2 |
3 | libtcod documentation | ${TITLE}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
libtcoddocumentation
12 |
13 |
14 | you are here: ${LOCATION}
15 | ${PREV_LINK} ${NEXT_LINK}
16 |
17 |
${FILTER_FORM}
18 |
19 |
${PAGE_TITLE}
20 | ${PAGE_CONTENT}
21 |
22 |
30 |
31 |
35 |
36 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/hmtool/README.txt:
--------------------------------------------------------------------------------
1 | libtcod height map tool
2 |
3 | Actually this is currently more a curiosity than a real useful tool.
4 | It allows you to tweak a heightmap by hand and generate the corresponding C,C++ or python code.
5 |
6 | The heightmap tool source code is public domain. Do whatever you want with it.
7 |
8 | NB : this tool has not been upgraded to the latest libtcod API so the generated code won't compile.
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/navier/main.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2010 Jice
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * The name of Jice may not be used to endorse or promote products
13 | * derived from this software without specific prior written permission.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY JICE ``AS IS'' AND ANY
16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | * DISCLAIMED. IN NO EVENT SHALL JICE BE LIABLE FOR ANY
19 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | */
26 | #include "libtcod.hpp"
27 |
28 |
29 | #define VERSION "0.1.1"
30 |
31 | // console size
32 | #define CON_W 80
33 | #define CON_H 50
34 |
35 | #define IN_RECTANGLE(x,y,w,h) ((unsigned)(x) < (unsigned)(w) && (unsigned)(y) < (unsigned)(h))
36 | #define SQRDIST(x1,y1,x2,y2) (((x1)-(x2))*((x1)-(x2))+((y1)-(y2))*((y1)-(y2)))
37 |
38 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/rad/README.txt:
--------------------------------------------------------------------------------
1 |
2 | Radiosity 0.1.0
3 |
4 | “Radiosity” engine
5 |
6 | Simple light diffusion using some sort of radiosity algorithm
7 | Not fast, not clean code… To be improved
8 |
9 | http://doryen.eptalys.net/demos/
10 |
11 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/rad/bsp_helper.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Umbra
3 | * Copyright (c) 2009, 2010 Mingos, Jice
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The names of Mingos or Jice may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY MINGOS & JICE ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL MINGOS OR JICE BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | class BspHelper : public ITCODBspCallback {
29 | public :
30 | BspHelper();
31 | int bspDepth;
32 | int minRoomSize;
33 | bool randomRoom;
34 | bool roomWalls;
35 | void createBspDungeon(TCODMap *map, TCODRandom *rng);
36 | // libtcod bsp callback stuff
37 | bool visitNode(TCODBsp *node, void *userData);
38 | private :
39 | void vline(TCODMap *map,int x, int y1, int y2);
40 | void vline_up(TCODMap *map,int x, int y);
41 | void vline_down(TCODMap *map,int x, int y);
42 | void hline(TCODMap *map,int x1, int y, int x2);
43 | void hline_left(TCODMap *map,int x, int y);
44 | void hline_right(TCODMap *map,int x, int y);
45 | };
46 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/rad/rad_shader.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Photon reactor
3 | * Copyright (c) 2011 Jice
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The names of Jice may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #include "libtcod.hpp"
29 | #include "rad_shader.hpp"
30 |
31 | void Shader::init(TCODMap *map) {
32 | this->map=map;
33 | int size=map->getWidth()*map->getHeight();
34 | lightmap=new TCODColor[size];
35 | }
36 |
37 | int Shader::addLight(int x, int y, int radius, const TCODColor &col) {
38 | int id=lights.size();
39 | Light l;
40 | l.x=x;
41 | l.y=y;
42 | l.radius=radius;
43 | l.col=col;
44 | lights.push(l);
45 | return id;
46 | }
47 |
48 | void Shader::updateLight(int id, int x, int y, int radius, const TCODColor &col) {
49 | Light *l=lights.begin()+id;
50 | l->x=x;
51 | l->y=y;
52 | l->radius=radius;
53 | l->col=col;
54 | }
55 |
56 |
57 | const TCODColor &Shader::getLightColor(int x, int y) {
58 | return lightmap[ x + y * map->getWidth()];
59 | }
60 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/rad/terminal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/samples/rad/terminal.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/ripples/main.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2010 Jice
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * The name of Jice may not be used to endorse or promote products
13 | * derived from this software without specific prior written permission.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY JICE ``AS IS'' AND ANY
16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | * DISCLAIMED. IN NO EVENT SHALL JICE BE LIABLE FOR ANY
19 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | */
26 | #include "libtcod.hpp"
27 | #include "util_ripples.hpp"
28 |
29 | #define VERSION "0.1.0"
30 |
31 | // console size
32 | #define CON_W 80
33 | #define CON_H 50
34 |
35 | #define IN_RECTANGLE(x,y,w,h) ((unsigned)(x) < (unsigned)(w) && (unsigned)(y) < (unsigned)(h))
36 | #define SQRDIST(x1,y1,x2,y2) (((x1)-(x2))*((x1)-(x2))+((y1)-(y2))*((y1)-(y2)))
37 |
38 | #ifndef NDEBUG
39 | #define DBG(x) printf x
40 | #else
41 | #define DBG(x)
42 | #endif
43 |
44 | extern TCODNoise noise3d;
45 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/ripples/util_ripples.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2010 Jice
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * The name of Jice may not be used to endorse or promote products
13 | * derived from this software without specific prior written permission.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY Jice ``AS IS'' AND ANY
16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | * DISCLAIMED. IN NO EVENT SHALL Jice BE LIABLE FOR ANY
19 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | struct WaterZone {
28 | float cumulatedElapsed; // to control the ripples framerate
29 | float *data; // water height data after update
30 | float *oldData; // water height data before update
31 | bool isActive; // not to use CPU is there are no ripples
32 | };
33 |
34 | class RippleManager {
35 | public :
36 | RippleManager(TCODMap *waterMap);
37 | void startRipple(int dungeonx, int dungeony);
38 | bool updateRipples(float elapsed);
39 | void renderRipples(const TCODImage *ground, TCODImage *groundWithRipples);
40 | protected :
41 | int width,height;
42 | WaterZone zone;
43 | void init(TCODMap *waterMap);
44 | float getData(int x, int y) const { return zone.data[x+y*width]; }
45 | };
46 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/weather/main.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2010 Jice
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * The name of Jice may not be used to endorse or promote products
13 | * derived from this software without specific prior written permission.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY JICE ``AS IS'' AND ANY
16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | * DISCLAIMED. IN NO EVENT SHALL JICE BE LIABLE FOR ANY
19 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | */
26 | #include "libtcod.hpp"
27 | #include "util_weather.hpp"
28 |
29 | #define VERSION "0.1.0"
30 |
31 | // console size
32 | #define CON_W 80
33 | #define CON_H 50
34 |
35 | #define IN_RECTANGLE(x,y,w,h) ((unsigned)(x) < (unsigned)(w) && (unsigned)(y) < (unsigned)(h))
36 | #define SQRDIST(x1,y1,x2,y2) (((x1)-(x2))*((x1)-(x2))+((y1)-(y2))*((y1)-(y2)))
37 |
38 | #ifndef NDEBUG
39 | #define DBG(x) printf x
40 | #else
41 | #define DBG(x)
42 | #endif
43 |
44 | extern TCODNoise noise1d;
45 | extern TCODNoise noise2d;
46 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/weather/util_weather.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2010 Jice
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * The name of Jice may not be used to endorse or promote products
13 | * derived from this software without specific prior written permission.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY JICE ``AS IS'' AND ANY
16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | * DISCLAIMED. IN NO EVENT SHALL JICE BE LIABLE FOR ANY
19 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | class Weather {
28 | public :
29 | void init(int width, int height);
30 | void update(float elapsed);
31 | float getCloud(int x, int y); // 0.0 : dark cloud, 1.0 : no cloud
32 | float getLightning(int x, int y); // 0.0 : no lightning. 1.0 : full lightning light
33 | bool hasRainDrop(); // call for each cell on the map
34 | // when scrolling the map on the game side
35 | void move(int dx, int dy);
36 | // description of current weather
37 | const char *getWeather();
38 | const TCODColor &getAmbientLightColor() { return ambientColor; }
39 | // timeInSecond : between 0 and 3600*24
40 | void calculateAmbient(float timeInSeconds);
41 | // how fast the weather is changing. 0 : never changes, 1 : default > 1 : faster...
42 | void setChangeFactor(float f) { changeFactor = f; }
43 | // 0 : bad weather. 1 : good weather
44 | float getIndicator() { return indicator; }
45 | // to alter the weather
46 | float getIndicatorDelta() { return indicatorDelta; }
47 | void setIndicatorDelta(float v) { indicatorDelta=CLAMP(-1.0f,1.0f,v); }
48 | protected :
49 | typedef struct {
50 | int posx,posy;
51 | float intensity; // 0-1
52 | float life; // in seconds
53 | int radius; // squared
54 | float noisex;
55 | } lightning_t;
56 |
57 | float indicator; // 0 : bad, 1 : good
58 | float indicatorDelta;
59 | float noisex,noisey; // position in the noise space
60 | float dx,dy; // sub cell cloud map position
61 | float changeFactor;
62 | TCODHeightMap *map;
63 | TCODList lightnings;
64 | TCODColor ambientColor;
65 | };
66 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/worldgen/README.txt:
--------------------------------------------------------------------------------
1 |
2 | World generator 0.1.0
3 |
4 | Fast (< 1 sec for a 400×400 map)
5 | Heightmap, precipitation map, latitude-dependant temperature map, biome map
6 | Rain erosion
7 | Rapidely Exploring Random Tree rivers
8 |
9 | http://doryen.eptalys.net/demos/
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/worldgen/main.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2010 Jice
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * The name of Jice may not be used to endorse or promote products
13 | * derived from this software without specific prior written permission.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY JICE ``AS IS'' AND ANY
16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | * DISCLAIMED. IN NO EVENT SHALL JICE BE LIABLE FOR ANY
19 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | */
26 | #include "libtcod.hpp"
27 | #include "util_worldgen.hpp"
28 |
29 | #define VERSION "0.1.0"
30 |
31 | // console size
32 | #define CON_W 80
33 | #define CON_H 50
34 |
35 | #define IN_RECTANGLE(x,y,w,h) ((unsigned)(x) < (unsigned)(w) && (unsigned)(y) < (unsigned)(h))
36 | #define SQRDIST(x1,y1,x2,y2) (((x1)-(x2))*((x1)-(x2))+((y1)-(y2))*((y1)-(y2)))
37 |
38 | #ifndef NDEBUG
39 | #define DBG(x) printf x
40 | #else
41 | #define DBG(x)
42 | #endif
43 |
44 | extern TCODNoise noise1d;
45 | extern TCODNoise noise2d;
46 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/worldgen/terminal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/samples/worldgen/terminal.png
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/worldgen/util_worldgen.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/samples/worldgen/util_worldgen.cpp
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples/worldgen/util_worldgen.hpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/samples/worldgen/util_worldgen.hpp
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples_c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/samples_c
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples_c_debug:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/samples_c_debug
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples_c_debug.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/samples_c_debug.exe
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples_cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/samples_cpp
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples_cpp_debug:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/samples_cpp_debug
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/samples_cpp_debug.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/samples_cpp_debug.exe
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/README.txt:
--------------------------------------------------------------------------------
1 | This is the Doryen library source code.
2 |
3 | libtcod.h and libtcod.hpp are the main headers, included respectively by
4 | the C and C++ programs that use libtcod.
5 |
6 | Each "toolkit" is in a separate file set. For each toolkit, you may have :
7 | * include/.h : the C header
8 | * include/.hpp : the C++ header
9 | * src/_c.c : the C source code that contains the actual implementation
10 | * src/.cpp : the C++ wrapper
11 |
12 | Current toolkits :
13 | bresenham : line drawing using the Bresenham algorithm.
14 | bsp : binary space partition tree module
15 | color : 24 bits colors operations.
16 | console : true color console emulator. It relies on some private functions of the sys toolkit.
17 | fov : field of view calculator.
18 | heightmap : heightmap toolkit.
19 | image : image manipulation. It relies on some private functions of the sys toolkit.
20 | list : a fast and lightweight generic container (faster than STL).
21 | mersenne : pseudorandom number generator using the Mersenne twister algorithm.
22 | mouse : mouse support.
23 | namegen : name generator
24 | noise : various noise generators.
25 | parser : config file parser.
26 | path : path finding module.
27 | sys : system specific functions.
28 | txtfield : work-in-progress text input utility
29 | zip : compression module
30 |
31 | Note that some of the sys toolkits rely on system dependant functions.
32 | They have currently a single working implementation relying on SDL : sys_sdl_c.c
33 | As it is heavily system dependant, the mouse C implementation is in sys_sdl_c.c.
34 | As of 1.4, the image load/save functions are isolated in sys_sdl_XXX.c,
35 | XXX being the image type (currently bmp and png).
36 | As of 1.5.1, sys_opengl_c.c contains OpenGL and GLSL renderers. Those two
37 | renderers are still dependant on SDL.
38 |
39 | libtcod_int.h contains everything that is exported by the toolkits
40 | (implemented in a toolkit and used in another one) but should not be seen
41 | by the user of the library.
42 |
43 | These are the private (or undocumented) modules :
44 | lex : a generic lexical parser.
45 | tree : a minimalist tree toolkit.
46 | sys : sys also contains an undocumented threading toolkit.
47 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/bresenham.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #include "libtcod.hpp"
29 |
30 | // ********** bresenham line drawing **********
31 | void TCODLine::init(int xFrom, int yFrom, int xTo, int yTo) {
32 | TCOD_line_init(xFrom,yFrom,xTo,yTo);
33 | }
34 |
35 | bool TCODLine::step(int *xCur, int *yCur) {
36 | return TCOD_line_step(xCur,yCur) != 0;
37 | }
38 |
39 | static TCODLineListener *listener=NULL;
40 |
41 | // C to C++ bridge
42 | extern "C" uint8 internalListener(int x,int y) {
43 | return listener->putPoint(x,y) ? 1 : 0;
44 | }
45 |
46 | bool TCODLine::line(int xFrom, int yFrom, int xTo, int yTo, TCODLineListener *plistener) {
47 | listener=plistener;
48 | return TCOD_line(xFrom,yFrom,xTo,yTo,internalListener) != 0;
49 | }
50 |
51 |
52 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/fov.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #include "libtcod.hpp"
28 | TCODMap::TCODMap(int width,int height) {
29 | data = TCOD_map_new(width,height);
30 | }
31 |
32 | void TCODMap::clear(bool transparent, bool walkable) {
33 | TCOD_map_clear(data,transparent,walkable);
34 | }
35 |
36 | void TCODMap::setProperties(int x, int y, bool isTransparent, bool isWalkable) {
37 | TCOD_map_set_properties(data,x,y,isTransparent,isWalkable);
38 | }
39 |
40 | void TCODMap::copy(const TCODMap *source) {
41 | TCOD_map_copy(source->data,data);
42 | }
43 |
44 | void TCODMap::computeFov(int x, int y, int maxRadius, bool light_walls, TCOD_fov_algorithm_t algo) {
45 | TCOD_map_compute_fov(data,x,y,maxRadius,light_walls, algo);
46 | }
47 |
48 | bool TCODMap::isInFov(int x, int y) const {
49 | return TCOD_map_is_in_fov(data,x,y) != 0;
50 | }
51 |
52 | void TCODMap::setInFov(int x,int y, bool fov) {
53 | TCOD_map_set_in_fov(data, x, y, fov);
54 | }
55 |
56 | bool TCODMap::isTransparent(int x, int y) const {
57 | return TCOD_map_is_transparent(data,x,y) != 0;
58 | }
59 |
60 | bool TCODMap::isWalkable(int x, int y) const {
61 | return TCOD_map_is_walkable(data,x,y) != 0;
62 | }
63 |
64 | int TCODMap::getWidth() const {
65 | return TCOD_map_get_width(data);
66 | }
67 |
68 | int TCODMap::getHeight() const {
69 | return TCOD_map_get_height(data);
70 | }
71 |
72 | int TCODMap::getNbCells() const {
73 | return TCOD_map_get_nb_cells(data);
74 | }
75 |
76 | TCODMap::~TCODMap() {
77 | TCOD_map_delete(data);
78 | }
79 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/gui/README.txt:
--------------------------------------------------------------------------------
1 | Those classes are a C++ widget toolkit built on top of libtcod.
2 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/gui/container.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #include "libtcod.hpp"
28 | #include "gui.hpp"
29 |
30 | Container::~Container() {
31 | content.clearAndDelete();
32 | }
33 |
34 | void Container::addWidget(Widget *wid) {
35 | content.push(wid);
36 | widgets.remove(wid);
37 | }
38 |
39 | void Container::removeWidget(Widget *wid) {
40 | content.remove(wid);
41 | }
42 |
43 | void Container::setVisible(bool val) {
44 | Widget::setVisible(val);
45 | }
46 |
47 | void Container::clear() {
48 | content.clearAndDelete();
49 | }
50 |
51 | void Container::render() {
52 | for ( Widget **wid=content.begin(); wid != content.end(); wid ++ ) {
53 | if ( (*wid)->isVisible() ) (*wid)->render();
54 | }
55 | }
56 |
57 | void Container::update(const TCOD_key_t k) {
58 | Widget::update(k);
59 | for ( Widget **wid=content.begin(); wid != content.end(); wid ++ ) {
60 | if ( (*wid)->isVisible() ) (*wid)->update(k);
61 | }
62 | }
63 |
64 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/gui/hbox.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #include "libtcod.hpp"
28 | #include "gui.hpp"
29 |
30 | HBox::HBox(int x, int y, int padding) : VBox(x,y,padding) {
31 | }
32 |
33 | void HBox::computeSize() {
34 | int curx=x;
35 | h=0;
36 | for (Widget **wid=content.begin(); wid != content.end(); wid ++ ) {
37 | if ( (*wid)->isVisible() ) {
38 | (*wid)->y=y;
39 | (*wid)->x=curx;
40 | (*wid)->computeSize();
41 | if ((*wid)->h > h) h=(*wid)->h;
42 | curx+=(*wid)->w+padding;
43 | }
44 | }
45 | w=curx-x;
46 | for (Widget **wid=content.begin(); wid != content.end(); wid ++ ) {
47 | if ( (*wid)->isVisible() ) {
48 | (*wid)->expand((*wid)->w,h);
49 | }
50 | }
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/gui/image.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #include "libtcod.hpp"
28 | #include "gui.hpp"
29 |
30 | Image::Image(int x,int y,int w, int h, const char *tip) : Widget(x,y,w,h), back(TCODColor::black) {
31 | if ( tip ) setTip(tip);
32 | }
33 |
34 | Image::~Image() {
35 | }
36 |
37 | void Image::render() {
38 | con->setDefaultBackground(back);
39 | con->rect(x,y,w,h,TCOD_BKGND_SET);
40 | }
41 |
42 | void Image::setBackgroundColor(const TCODColor col) {
43 | back=col;
44 | }
45 |
46 | void Image::expand(int width, int height) {
47 | if ( width > w ) w=width;
48 | if ( height > h ) h=height;
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/gui/label.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #include "libtcod.hpp"
28 | #include "gui.hpp"
29 |
30 | Label::Label(int x, int y, const char *label, const char *tip) : Widget(x,y,0,1) {
31 | this->label=label;
32 | if ( tip ) setTip(tip);
33 | }
34 |
35 | void Label::render() {
36 | con->setDefaultBackground(back);
37 | con->setDefaultForeground(fore);
38 | con->printEx(x,y,TCOD_BKGND_NONE,TCOD_LEFT,label);
39 | }
40 |
41 | void Label::computeSize() {
42 | if ( label ) w=strlen(label);
43 | else w=0;
44 | }
45 |
46 | void Label::expand(int width, int height) {
47 | if ( w < width ) w=width;
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/gui/radiobutton.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #include "libtcod.hpp"
28 | #include "gui.hpp"
29 |
30 | RadioButton *RadioButton::groupSelect[512];
31 | int RadioButton::defaultGroup=0;
32 | static bool init=false;
33 |
34 | void RadioButton::select() {
35 | if (!init) {
36 | memset(groupSelect,0,sizeof(RadioButton *)*512);
37 | init=true;
38 | }
39 | groupSelect[group]=this;
40 | }
41 |
42 | void RadioButton::unSelect() {
43 | if (!init) {
44 | memset(groupSelect,0,sizeof(RadioButton *)*512);
45 | init=true;
46 | }
47 | groupSelect[group]=NULL;
48 | }
49 |
50 | void RadioButton::unSelectGroup(int group) {
51 | groupSelect[group]=NULL;
52 | }
53 |
54 | void RadioButton::render() {
55 | Button::render();
56 | if ( groupSelect[group] == this ) {
57 | con->setChar(x,y,'>');
58 | }
59 | }
60 |
61 | void RadioButton::onButtonClick() {
62 | select();
63 | Button::onButtonClick();
64 | }
65 |
66 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/gui/statusbar.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #include "libtcod.hpp"
28 | #include "gui.hpp"
29 |
30 | void StatusBar::render() {
31 | con->setDefaultBackground(back);
32 | con->rect(x,y,w,h,true,TCOD_BKGND_SET);
33 | if ( focus && focus->tip ) {
34 | con->setDefaultForeground(fore);
35 | con->printRectEx(x+1,y,w,h,TCOD_BKGND_NONE,TCOD_LEFT,focus->tip);
36 | }
37 | }
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/gui/togglebutton.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #include
28 | #include "libtcod.hpp"
29 | #include "gui.hpp"
30 |
31 | void ToggleButton::render() {
32 | con->setDefaultBackground(mouseIn ? backFocus : back);
33 | con->setDefaultForeground(mouseIn ? foreFocus : fore);
34 | con->rect(x,y,w,h,true,TCOD_BKGND_SET);
35 | if ( label ) {
36 | con->printEx(x,y,TCOD_BKGND_NONE,TCOD_LEFT,"%c %s",pressed ? TCOD_CHAR_CHECKBOX_SET : TCOD_CHAR_CHECKBOX_UNSET, label);
37 | } else {
38 | con->printEx(x,y,TCOD_BKGND_NONE,TCOD_LEFT,"%c",pressed ? TCOD_CHAR_CHECKBOX_SET : TCOD_CHAR_CHECKBOX_UNSET);
39 | }
40 | }
41 |
42 | void ToggleButton::onButtonPress() {
43 | }
44 |
45 | void ToggleButton::onButtonRelease() {
46 | }
47 |
48 | void ToggleButton::onButtonClick() {
49 | pressed=!pressed;
50 | if ( cbk ) cbk(this,userData);
51 | }
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/gui/vbox.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #include "libtcod.hpp"
28 | #include "gui.hpp"
29 |
30 | void VBox::computeSize() {
31 | int cury=y;
32 | w=0;
33 | for (Widget **wid=content.begin(); wid != content.end(); wid ++ ) {
34 | if ( (*wid)->isVisible() ) {
35 | (*wid)->x=x;
36 | (*wid)->y=cury;
37 | (*wid)->computeSize();
38 | if ((*wid)->w > w) w=(*wid)->w;
39 | cury+=(*wid)->h+padding;
40 | }
41 | }
42 | h=cury-y;
43 | for (Widget **wid=content.begin(); wid != content.end(); wid ++ ) {
44 | if ( (*wid)->isVisible() ) {
45 | (*wid)->expand(w,(*wid)->h);
46 | }
47 | }
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/mersenne.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #include
28 | #include "libtcod.hpp"
29 | #include "libtcod_int.h"
30 |
31 | static TCODRandom *instance=(TCODRandom *)NULL;
32 |
33 | TCODRandom *TCODRandom::getInstance(void) {
34 | if (! instance ) {
35 | instance=new TCODRandom(TCOD_RNG_CMWC,true);
36 | }
37 | return instance;
38 | }
39 |
40 | TCODRandom::TCODRandom(TCOD_random_algo_t algo, bool allocate) {
41 | if ( allocate ) data = TCOD_random_new(algo);
42 | }
43 |
44 | TCODRandom::TCODRandom(uint32 seed, TCOD_random_algo_t algo) {
45 | data=TCOD_random_new_from_seed(algo, seed);
46 | }
47 |
48 | TCODRandom::~TCODRandom() {
49 | TCOD_random_delete(data);
50 | }
51 |
52 | TCODRandom *TCODRandom::save() const {
53 | TCODRandom *ret=new TCODRandom(((mersenne_data_t *)data)->algo,false);
54 | ret->data=TCOD_random_save(data);
55 | return ret;
56 | }
57 |
58 | void TCODRandom::restore(const TCODRandom *backup) {
59 | TCOD_random_restore(data,backup->data);
60 | }
61 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/mouse.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #include "libtcod.hpp"
28 |
29 | void TCODMouse::showCursor(bool visible) {
30 | TCOD_mouse_show_cursor(visible);
31 | }
32 |
33 | bool TCODMouse::isCursorVisible() {
34 | return TCOD_mouse_is_cursor_visible() != 0;
35 | }
36 |
37 | void TCODMouse::move(int x, int y) {
38 | TCOD_mouse_move(x,y);
39 | }
40 |
41 | TCOD_mouse_t TCODMouse::getStatus() {
42 | return TCOD_mouse_get_status();
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/namegen.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | /*
28 | * Mingos' NameGen
29 | * This file was written by Dominik "Mingos" Marczuk.
30 | */
31 |
32 | #include "libtcod.hpp"
33 |
34 | void TCODNamegen::parse (const char * filename, TCODRandom * random) {
35 | TCOD_namegen_parse (filename, random ? random->data : NULL);
36 | }
37 |
38 | char * TCODNamegen::generate (char * name, bool allocate) {
39 | return TCOD_namegen_generate (name, allocate);
40 | }
41 |
42 | char * TCODNamegen::generateCustom (char * name, char * rule, bool allocate) {
43 | return TCOD_namegen_generate_custom (name, rule, allocate);
44 | }
45 |
46 | TCOD_list_t TCODNamegen::getSets (void) {
47 | return TCOD_namegen_get_sets ();
48 | }
49 |
50 | void TCODNamegen::destroy (void) {
51 | TCOD_namegen_destroy ();
52 | }
53 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/sys_sdl_img_bmp.c:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #if defined (__HAIKU__) || defined (__ANDROID__)
29 | #include
30 | #elif defined(TCOD_SDL2)
31 | #include
32 | #else
33 | #include
34 | #endif
35 | #include "libtcod.h"
36 | #include "libtcod_int.h"
37 |
38 | bool TCOD_sys_check_bmp(const char *filename) {
39 | static uint8 magic_number[]={0x42, 0x4d};
40 | return TCOD_sys_check_magic_number(filename,sizeof(magic_number),magic_number);
41 | }
42 |
43 | SDL_Surface *TCOD_sys_read_bmp(const char *filename) {
44 | SDL_Surface *ret=SDL_LoadBMP(filename);
45 | if( !ret ) TCOD_fatal("SDL : %s",SDL_GetError());
46 | /* convert low color images to 24 bits */
47 | if ( ret->format->BytesPerPixel != 3 ) {
48 | Uint32 rmask,gmask,bmask;
49 | SDL_Surface * tmp;
50 | if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) {
51 | rmask=0xFF0000;
52 | gmask=0x00FF00;
53 | bmask=0x0000FF;
54 | } else {
55 | rmask=0x0000FF;
56 | gmask=0x00FF00;
57 | bmask=0xFF0000;
58 | }
59 | tmp=SDL_CreateRGBSurface(SDL_SWSURFACE,ret->w,ret->h,24, rmask, gmask, bmask, 0);
60 | SDL_BlitSurface(ret,NULL,tmp,NULL);
61 | SDL_FreeSurface(ret);
62 | ret=tmp;
63 | }
64 |
65 | return ret;
66 | }
67 |
68 | void TCOD_sys_write_bmp(const SDL_Surface *surf, const char *filename) {
69 | SDL_SaveBMP((SDL_Surface *)surf,filename);
70 | }
71 |
72 |
73 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/tree_c.c:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | #include
28 | #include "libtcod.h"
29 |
30 | TCOD_tree_t *TCOD_tree_new() {
31 | return (TCOD_tree_t *)calloc(1,sizeof(TCOD_tree_t));
32 | }
33 |
34 | void TCOD_tree_add_son(TCOD_tree_t *node, TCOD_tree_t *son) {
35 | TCOD_tree_t *lastson = node->sons;
36 | son->father=node;
37 | while ( lastson && lastson->next ) lastson=lastson->next;
38 | if ( lastson ) {
39 | lastson->next=son;
40 | } else {
41 | node->sons=son;
42 | }
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/txtfield.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * libtcod 1.5.2
3 | * Copyright (c) 2008,2009,2010,2012 Jice & Mingos
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * The name of Jice or Mingos may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #include "libtcod.hpp"
29 |
30 | TCODText::TCODText(int x, int y, int w, int h, int max_chars){
31 | data=TCOD_text_init(x,y,w,h,max_chars);
32 | }
33 |
34 | TCODText::TCODText(int w, int h, int max_chars){
35 | data=TCOD_text_init2(w,h,max_chars);
36 | }
37 |
38 | TCODText::~TCODText(){
39 | TCOD_text_delete(data);
40 | }
41 |
42 | void TCODText::setPos(int x, int y) {
43 | TCOD_text_set_pos(data,x,y);
44 | }
45 |
46 | void TCODText::setProperties(int cursor_char, int blink_interval, const char * prompt, int tab_size){
47 | TCOD_text_set_properties(data,cursor_char,blink_interval,prompt,tab_size);
48 | }
49 |
50 | void TCODText::setColors(TCODColor fore, TCODColor back, float back_transparency){
51 | TCOD_color_t foreground = {fore.r,fore.g,fore.b};
52 | TCOD_color_t background = {back.r,back.g,back.b};
53 | TCOD_text_set_colors(data,foreground,background,back_transparency);
54 | }
55 |
56 | bool TCODText::update(TCOD_key_t key){
57 | return TCOD_text_update(data,key) != 0;
58 | }
59 |
60 | void TCODText::render(TCODConsole * con){
61 | TCOD_text_render(data,con->data);
62 | }
63 |
64 | const char *TCODText::getText(){
65 | return TCOD_text_get(data);
66 | }
67 |
68 | void TCODText::reset(){
69 | TCOD_text_reset(data);
70 | }
71 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/zlib/compress.c:
--------------------------------------------------------------------------------
1 | /* compress.c -- compress a memory buffer
2 | * Copyright (C) 1995-2005 Jean-loup Gailly.
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | /* @(#) $Id$ */
7 |
8 | #define ZLIB_INTERNAL
9 | #include "zlib.h"
10 |
11 | /* ===========================================================================
12 | Compresses the source buffer into the destination buffer. The level
13 | parameter has the same meaning as in deflateInit. sourceLen is the byte
14 | length of the source buffer. Upon entry, destLen is the total size of the
15 | destination buffer, which must be at least 0.1% larger than sourceLen plus
16 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
17 |
18 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
19 | memory, Z_BUF_ERROR if there was not enough room in the output buffer,
20 | Z_STREAM_ERROR if the level parameter is invalid.
21 | */
22 | int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
23 | Bytef *dest;
24 | uLongf *destLen;
25 | const Bytef *source;
26 | uLong sourceLen;
27 | int level;
28 | {
29 | z_stream stream;
30 | int err;
31 |
32 | stream.next_in = (Bytef*)source;
33 | stream.avail_in = (uInt)sourceLen;
34 | #ifdef MAXSEG_64K
35 | /* Check for source > 64K on 16-bit machine: */
36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
37 | #endif
38 | stream.next_out = dest;
39 | stream.avail_out = (uInt)*destLen;
40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
41 |
42 | stream.zalloc = (alloc_func)0;
43 | stream.zfree = (free_func)0;
44 | stream.opaque = (voidpf)0;
45 |
46 | err = deflateInit(&stream, level);
47 | if (err != Z_OK) return err;
48 |
49 | err = deflate(&stream, Z_FINISH);
50 | if (err != Z_STREAM_END) {
51 | deflateEnd(&stream);
52 | return err == Z_OK ? Z_BUF_ERROR : err;
53 | }
54 | *destLen = stream.total_out;
55 |
56 | err = deflateEnd(&stream);
57 | return err;
58 | }
59 |
60 | /* ===========================================================================
61 | */
62 | int ZEXPORT compress (dest, destLen, source, sourceLen)
63 | Bytef *dest;
64 | uLongf *destLen;
65 | const Bytef *source;
66 | uLong sourceLen;
67 | {
68 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
69 | }
70 |
71 | /* ===========================================================================
72 | If the default memLevel or windowBits for deflateInit() is changed, then
73 | this function needs to be updated.
74 | */
75 | uLong ZEXPORT compressBound (sourceLen)
76 | uLong sourceLen;
77 | {
78 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
79 | (sourceLen >> 25) + 13;
80 | }
81 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/zlib/gzclose.c:
--------------------------------------------------------------------------------
1 | /* gzclose.c -- zlib gzclose() function
2 | * Copyright (C) 2004, 2010 Mark Adler
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | #include "gzguts.h"
7 |
8 | /* gzclose() is in a separate file so that it is linked in only if it is used.
9 | That way the other gzclose functions can be used instead to avoid linking in
10 | unneeded compression or decompression routines. */
11 | int ZEXPORT gzclose(file)
12 | gzFile file;
13 | {
14 | #ifndef NO_GZCOMPRESS
15 | gz_statep state;
16 |
17 | if (file == NULL)
18 | return Z_STREAM_ERROR;
19 | state = (gz_statep)file;
20 |
21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
22 | #else
23 | return gzclose_r(file);
24 | #endif
25 | }
26 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/zlib/inffast.h:
--------------------------------------------------------------------------------
1 | /* inffast.h -- header to use inffast.c
2 | * Copyright (C) 1995-2003, 2010 Mark Adler
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | /* WARNING: this file should *not* be used by applications. It is
7 | part of the implementation of the compression library and is
8 | subject to change. Applications should only use zlib.h.
9 | */
10 |
11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
12 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/src/zlib/uncompr.c:
--------------------------------------------------------------------------------
1 | /* uncompr.c -- decompress a memory buffer
2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly.
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | /* @(#) $Id$ */
7 |
8 | #define ZLIB_INTERNAL
9 | #include "zlib.h"
10 |
11 | /* ===========================================================================
12 | Decompresses the source buffer into the destination buffer. sourceLen is
13 | the byte length of the source buffer. Upon entry, destLen is the total
14 | size of the destination buffer, which must be large enough to hold the
15 | entire uncompressed data. (The size of the uncompressed data must have
16 | been saved previously by the compressor and transmitted to the decompressor
17 | by some mechanism outside the scope of this compression library.)
18 | Upon exit, destLen is the actual size of the compressed buffer.
19 |
20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
21 | enough memory, Z_BUF_ERROR if there was not enough room in the output
22 | buffer, or Z_DATA_ERROR if the input data was corrupted.
23 | */
24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen)
25 | Bytef *dest;
26 | uLongf *destLen;
27 | const Bytef *source;
28 | uLong sourceLen;
29 | {
30 | z_stream stream;
31 | int err;
32 |
33 | stream.next_in = (Bytef*)source;
34 | stream.avail_in = (uInt)sourceLen;
35 | /* Check for source > 64K on 16-bit machine: */
36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
37 |
38 | stream.next_out = dest;
39 | stream.avail_out = (uInt)*destLen;
40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
41 |
42 | stream.zalloc = (alloc_func)0;
43 | stream.zfree = (free_func)0;
44 |
45 | err = inflateInit(&stream);
46 | if (err != Z_OK) return err;
47 |
48 | err = inflate(&stream, Z_FINISH);
49 | if (err != Z_STREAM_END) {
50 | inflateEnd(&stream);
51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
52 | return Z_DATA_ERROR;
53 | return err;
54 | }
55 | *destLen = stream.total_out;
56 |
57 | err = inflateEnd(&stream);
58 | return err;
59 | }
60 |
--------------------------------------------------------------------------------
/src/libtcod-1.5.2/terminal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/freethenation/broguejs/c67d7001faa0c7aa597a4e982de28fa6b7043b7e/src/libtcod-1.5.2/terminal.png
--------------------------------------------------------------------------------
/src/platform/PlatformDefines.h:
--------------------------------------------------------------------------------
1 | /*
2 | * PlatformDefines.h
3 | * Brogue
4 | *
5 | * Created by Brian Walker on 5/22/10.
6 | * Copyright 2010. All rights reserved.
7 | *
8 | * This file is part of Brogue.
9 | *
10 | * Brogue is free software: you can redistribute it and/or modify
11 | * it under the terms of the GNU General Public License as published by
12 | * the Free Software Foundation, either version 3 of the License, or
13 | * (at your option) any later version.
14 | *
15 | * Brogue is distributed in the hope that it will be useful,
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | * GNU General Public License for more details.
19 | *
20 | * You should have received a copy of the GNU General Public License
21 | * along with Brogue. If not, see .
22 | */
23 |
24 | // Any platform-dependent defines that must be accessible in the game code
25 | // should go in here.
26 |
27 | #define BROGUE_LIBTCOD
28 | #define PLAY_AGAIN_STRING "Press space to play again."
29 |
30 |
--------------------------------------------------------------------------------
/src/platform/platform.h:
--------------------------------------------------------------------------------
1 | #include "Rogue.h"
2 |
3 | struct brogueConsole {
4 | void (*gameLoop)();
5 | boolean (*pauseForMilliseconds)(short milliseconds);
6 | void (*nextKeyOrMouseEvent)(rogueEvent *returnEvent, boolean textInput, boolean colorsDance);
7 | void (*plotChar)(uchar, short, short, short, short, short, short, short, short);
8 | void (*remap)(const char *, const char *);
9 | boolean (*modifierHeld)(int modifier);
10 | };
11 |
12 | void loadKeymap();
13 |
14 | #ifdef BROGUE_TCOD
15 | extern struct brogueConsole tcodConsole;
16 | #endif
17 |
18 | #ifdef BROGUE_CURSES
19 | extern struct brogueConsole cursesConsole;
20 | #endif
21 |
22 | #ifdef __EMSCRIPTEN__
23 | extern struct brogueConsole javascriptConsole;
24 | #endif
25 |
26 | extern struct brogueConsole currentConsole;
27 | extern boolean serverMode;
28 | extern boolean noMenu;
29 |
30 |
--------------------------------------------------------------------------------
/src/platform/term.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef _term_h_
3 | #define _term_h_
4 |
5 | #define TERM_NONE 0
6 | #define TERM_MOUSE 1
7 |
8 | typedef struct {float r, g, b;} fcolor;
9 | struct term_t {
10 | int (*start)();
11 | void (*end)();
12 | void (*put)(int x, int y, int ch, fcolor *fg, fcolor *bg);
13 | void (*refresh)();
14 | int (*getkey)();
15 | void (*wait)();
16 | int (*hasKey)();
17 | void (*title)(const char *);
18 | void (*resize)(int w, int h);
19 | int (*keycodeByName)(const char *);
20 |
21 | struct {
22 | int up, down, left, right, backspace, del, quit;
23 | } keys;
24 |
25 | int width, height;
26 | struct {
27 | int x, y;
28 | int isPressed, justPressed, justReleased, justMoved;
29 | int shift, control;
30 | } mouse;
31 | };
32 |
33 | extern struct term_t Term;
34 |
35 | #endif
36 |
37 |
--------------------------------------------------------------------------------