├── .cargo └── config ├── .gitignore ├── .travis.yml ├── COPYING.txt ├── Cargo.toml ├── Makefile ├── README.md ├── angband16x16.bmp ├── appveyor.yml ├── arial10x10.png ├── consolas10x10_gs_tc.png ├── data ├── img │ ├── circle.png │ └── skull.png └── namegen │ ├── README.txt │ ├── jice_celtic.cfg │ ├── jice_fantasy.cfg │ ├── jice_mesopotamian.cfg │ ├── jice_norse.cfg │ ├── jice_region.cfg │ ├── jice_town.cfg │ ├── mingos_demon.cfg │ ├── mingos_dwarf.cfg │ ├── mingos_norse.cfg │ ├── mingos_standard.cfg │ └── mingos_town.cfg ├── examples ├── astar-path-finding.rs ├── blit.rs ├── chars.rs ├── colors.rs ├── custom_character_mapping.rs ├── dijkstra-path-finding.rs ├── fov.rs ├── keyboard.rs ├── minimal.rs ├── mouse.rs ├── namegen.rs ├── print_macros.rs ├── samples.rs ├── shapes.rs └── text.rs ├── fonts ├── README.txt ├── arial10x10.png ├── arial12x12.png ├── arial8x8.png ├── caeldera8x8_gs_tc.png ├── celtic_garamond_10x10_gs_tc.png ├── consolas10x10_gs_tc.png ├── consolas12x12_gs_tc.png ├── consolas8x8_gs_tc.png ├── consolas_unicode_10x10.png ├── consolas_unicode_12x12.png ├── consolas_unicode_16x16.png ├── consolas_unicode_8x8.png ├── courier10x10_aa_tc.png ├── courier12x12_aa_tc.png ├── courier8x8_aa_tc.png ├── dejavu10x10_gs_tc.png ├── dejavu12x12_gs_tc.png ├── dejavu16x16_gs_tc.png ├── dejavu8x8_gs_tc.png ├── dejavu_wide12x12_gs_tc.png ├── dejavu_wide16x16_gs_tc.png ├── dundalk12x12_gs_tc.png ├── lucida10x10_gs_tc.png ├── lucida12x12_gs_tc.png ├── lucida8x8_gs_tc.png ├── prestige10x10_gs_tc.png ├── prestige12x12_gs_tc.png ├── prestige8x8_gs_tc.png ├── terminal10x10_gs_tc.png ├── terminal10x16_gs_ro.png ├── terminal10x16_gs_tc.png ├── terminal10x18_gs_ro.png ├── terminal12x12_gs_ro.png ├── terminal16x16_gs_ro.png ├── terminal7x7_gs_tc.png ├── terminal8x12_gs_ro.png ├── terminal8x12_gs_tc.png ├── terminal8x14_gs_ro.png ├── terminal8x8_aa_as.png ├── terminal8x8_aa_ro.png ├── terminal8x8_aa_tc.png ├── terminal8x8_gs_as.png ├── terminal8x8_gs_ro.png └── terminal8x8_gs_tc.png ├── precompiled ├── i686-pc-windows-gnu │ └── .gitkeep ├── i686-unknown-linux-gnu │ └── .gitkeep └── x86_64-unknown-linux-gnu │ └── .gitkeep ├── src ├── bindings.rs ├── bsp.rs ├── chars.rs ├── colors.rs ├── console.rs ├── console_macros.rs ├── heightmap.rs ├── image.rs ├── input.rs ├── lib.rs ├── line.rs ├── macros.rs ├── map.rs ├── namegen.rs ├── noise.rs ├── pathfinding.rs ├── random.rs ├── rustc_serialize_impls.rs └── system.rs ├── tcod_sys ├── Cargo.toml ├── build.rs ├── lib.rs └── libtcod │ ├── LIBTCOD-CREDITS.txt │ ├── LIBTCOD-LICENSE.txt │ ├── README-linux-SDL2.md │ ├── README.md │ ├── dependencies │ └── SDL2-2.0.7 │ │ ├── BUGS.txt │ │ ├── COPYING.txt │ │ ├── CREDITS.txt │ │ ├── README-SDL.txt │ │ ├── README.txt │ │ ├── WhatsNew.txt │ │ ├── include │ │ ├── SDL.h │ │ ├── SDL_assert.h │ │ ├── SDL_atomic.h │ │ ├── SDL_audio.h │ │ ├── SDL_bits.h │ │ ├── SDL_blendmode.h │ │ ├── SDL_clipboard.h │ │ ├── SDL_config.h │ │ ├── SDL_cpuinfo.h │ │ ├── SDL_egl.h │ │ ├── SDL_endian.h │ │ ├── SDL_error.h │ │ ├── SDL_events.h │ │ ├── SDL_filesystem.h │ │ ├── SDL_gamecontroller.h │ │ ├── SDL_gesture.h │ │ ├── SDL_haptic.h │ │ ├── SDL_hints.h │ │ ├── SDL_joystick.h │ │ ├── SDL_keyboard.h │ │ ├── SDL_keycode.h │ │ ├── SDL_loadso.h │ │ ├── SDL_log.h │ │ ├── SDL_main.h │ │ ├── SDL_messagebox.h │ │ ├── SDL_mouse.h │ │ ├── SDL_mutex.h │ │ ├── SDL_name.h │ │ ├── SDL_opengl.h │ │ ├── SDL_opengl_glext.h │ │ ├── SDL_opengles.h │ │ ├── SDL_opengles2.h │ │ ├── SDL_opengles2_gl2.h │ │ ├── SDL_opengles2_gl2ext.h │ │ ├── SDL_opengles2_gl2platform.h │ │ ├── SDL_opengles2_khrplatform.h │ │ ├── SDL_pixels.h │ │ ├── SDL_platform.h │ │ ├── SDL_power.h │ │ ├── SDL_quit.h │ │ ├── SDL_rect.h │ │ ├── SDL_render.h │ │ ├── SDL_revision.h │ │ ├── SDL_rwops.h │ │ ├── SDL_scancode.h │ │ ├── SDL_shape.h │ │ ├── SDL_stdinc.h │ │ ├── SDL_surface.h │ │ ├── SDL_system.h │ │ ├── SDL_syswm.h │ │ ├── SDL_test.h │ │ ├── SDL_test_assert.h │ │ ├── SDL_test_common.h │ │ ├── SDL_test_compare.h │ │ ├── SDL_test_crc32.h │ │ ├── SDL_test_font.h │ │ ├── SDL_test_fuzzer.h │ │ ├── SDL_test_harness.h │ │ ├── SDL_test_images.h │ │ ├── SDL_test_log.h │ │ ├── SDL_test_md5.h │ │ ├── SDL_test_memory.h │ │ ├── SDL_test_random.h │ │ ├── SDL_thread.h │ │ ├── SDL_timer.h │ │ ├── SDL_touch.h │ │ ├── SDL_types.h │ │ ├── SDL_version.h │ │ ├── SDL_video.h │ │ ├── SDL_vulkan.h │ │ ├── begin_code.h │ │ └── close_code.h │ │ └── lib │ │ ├── i686-pc-windows-gnu │ │ ├── SDL2.dll │ │ ├── libSDL2.a │ │ ├── libSDL2.dll.a │ │ ├── libSDL2.la │ │ ├── libSDL2_test.a │ │ ├── libSDL2_test.la │ │ ├── libSDL2main.a │ │ ├── libSDL2main.la │ │ └── pkgconfig │ │ │ └── sdl2.pc │ │ ├── i686-pc-windows-msvc │ │ ├── SDL2.dll │ │ ├── SDL2.lib │ │ ├── SDL2main.lib │ │ └── SDL2test.lib │ │ ├── x86_64-pc-windows-gnu │ │ ├── SDL2.dll │ │ ├── libSDL2.a │ │ ├── libSDL2.dll.a │ │ ├── libSDL2.la │ │ ├── libSDL2_test.a │ │ ├── libSDL2_test.la │ │ ├── libSDL2main.a │ │ ├── libSDL2main.la │ │ └── pkgconfig │ │ │ └── sdl2.pc │ │ └── x86_64-pc-windows-msvc │ │ ├── SDL2.dll │ │ ├── SDL2.lib │ │ ├── SDL2main.lib │ │ └── SDL2test.lib │ ├── include │ ├── bresenham.h │ ├── bresenham.hpp │ ├── bsp.h │ ├── bsp.hpp │ ├── color.h │ ├── color.hpp │ ├── console.h │ ├── console.hpp │ ├── console_types.h │ ├── external │ │ └── pstdint.h │ ├── fov.h │ ├── fov.hpp │ ├── fov_types.h │ ├── heightmap.h │ ├── heightmap.hpp │ ├── howto.hpp │ ├── image.h │ ├── image.hpp │ ├── lex.h │ ├── lex.hpp │ ├── libtcod.h │ ├── libtcod.hpp │ ├── libtcod_int.h │ ├── libtcod_portability.h │ ├── libtcod_utility.h │ ├── libtcod_version.h │ ├── list.h │ ├── list.hpp │ ├── mersenne.h │ ├── mersenne.hpp │ ├── mersenne_types.h │ ├── mouse.h │ ├── mouse.hpp │ ├── mouse_types.h │ ├── namegen.h │ ├── namegen.hpp │ ├── noise.h │ ├── noise.hpp │ ├── noise_defaults.h │ ├── parser.h │ ├── parser.hpp │ ├── path.h │ ├── path.hpp │ ├── sys.h │ ├── sys.hpp │ ├── tree.h │ ├── tree.hpp │ ├── txtfield.h │ ├── txtfield.hpp │ ├── wrappers.h │ ├── zip.h │ └── zip.hpp │ ├── libtcod-CHANGELOG.txt │ ├── libtcod.cfg │ └── src │ ├── README.txt │ ├── bresenham.cpp │ ├── bresenham_c.c │ ├── bsp.cpp │ ├── bsp_c.c │ ├── color.cpp │ ├── color_c.c │ ├── console.cpp │ ├── console_c.c │ ├── console_rexpaint.c │ ├── fov.cpp │ ├── fov_c.c │ ├── fov_circular_raycasting.c │ ├── fov_diamond_raycasting.c │ ├── fov_permissive2.c │ ├── fov_recursive_shadowcasting.c │ ├── fov_restrictive.c │ ├── heightmap.cpp │ ├── heightmap_c.c │ ├── image.cpp │ ├── image_c.c │ ├── lex.cpp │ ├── lex_c.c │ ├── list_c.c │ ├── mersenne.cpp │ ├── mersenne_c.c │ ├── mouse.cpp │ ├── namegen.cpp │ ├── namegen_c.c │ ├── noise.cpp │ ├── noise_c.c │ ├── parser.cpp │ ├── parser_c.c │ ├── path.cpp │ ├── path_c.c │ ├── png │ ├── lodepng.c │ └── lodepng.h │ ├── sys.cpp │ ├── sys_c.c │ ├── sys_opengl_c.c │ ├── sys_sdl2_c.c │ ├── sys_sdl_c.c │ ├── sys_sdl_img_bmp.c │ ├── sys_sdl_img_png.c │ ├── tree_c.c │ ├── txtfield.cpp │ ├── txtfield_c.c │ ├── wrappers.c │ ├── zip.cpp │ ├── zip_c.c │ └── zlib │ ├── adler32.c │ ├── compress.c │ ├── crc32.c │ ├── crc32.h │ ├── deflate.c │ ├── deflate.h │ ├── gzclose.c │ ├── gzguts.h │ ├── gzlib.c │ ├── gzread.c │ ├── gzwrite.c │ ├── infback.c │ ├── inffast.c │ ├── inffast.h │ ├── inffixed.h │ ├── inflate.c │ ├── inflate.h │ ├── inftrees.c │ ├── inftrees.h │ ├── trees.c │ ├── trees.h │ ├── uncompr.c │ ├── zconf.h │ ├── zlib.h │ ├── zutil.c │ └── zutil.h └── terminal.png /.cargo/config: -------------------------------------------------------------------------------- 1 | # Using binary distribution of libtcod instead of building it from source: 2 | # For more info, read: http://doc.crates.io/build-script.html and http://doc.crates.io/config.html 3 | # 4 | # In general, you download your the compiled libraries (libtcod.so/dll/ and 5 | # libtcodgui.so/dll), put them into `precompiled/$target` and uncomment the 6 | # corresponding section below. 7 | 8 | 9 | # 64-bit Linux: 10 | # 11 | # Download this: http://roguecentral.org/doryen/?file_id=28 12 | # Copy libtcod.so and libtcodgui.so to: precompiled/x86_64-unknown-linux-gnu 13 | # You may also need to create libtcod.so.1 and libtcodgui.so.1 because reasons? 14 | # Uncomment this section: 15 | # 16 | # [target.x86_64-unknown-linux-gnu.tcod] 17 | # rustc-flags = "-L precompiled/x86_64-unknown-linux-gnu -l tcod" 18 | 19 | 20 | # 32-bit Linux: 21 | # 22 | # Download this: http://roguecentral.org/doryen/?file_id=26 23 | # Copy libtcod.so and libtcodgui.so to: precompiled/i686-unknown-linux-gnu 24 | # You may also need to create libtcod.so.1 and libtcodgui.so.1 because reasons? 25 | # Uncomment this section: 26 | # 27 | # [target.i686-unknown-linux-gnu.tcod] 28 | # rustc-flags = "-L precompiled/i686-unknown-linux-gnu -l tcod" 29 | 30 | 31 | # Windows: 32 | # 33 | # Download this: http://roguecentral.org/doryen/?file_id=27 34 | # Copy libtcod-mingw.dll, libtcod-gui-mingw.dll and SDL.dll to: precompiled/i686-pc-windows-gnu 35 | # You must also create libtcod.dll and libtcod-gui.dll because reasons? 36 | # Uncomment this section: 37 | # 38 | # [target.i686-pc-windows-gnu.tcod] 39 | # rustc-flags = "-L precompiled/i686-pc-windows-gnu -l tcod" 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *~ 3 | *# 4 | *.a 5 | *.o 6 | *.so 7 | *.dylib 8 | *.swp 9 | *.dSYM 10 | *.dll 11 | *.rlib 12 | *.dummy 13 | *.exe 14 | *-test 15 | /bin/main 16 | /bin/test-internal 17 | /bin/test-external 18 | /doc/ 19 | /target/ 20 | /build/ 21 | /.rust/ 22 | rusti.sh 23 | watch.sh 24 | /examples/** 25 | !/examples/*.rs 26 | !/examples/*.txt 27 | !/examples/assets/ 28 | *Cargo.lock 29 | /tcod_sys/target/ 30 | !/tcod_sys/libtcod/SDL*.dll 31 | !/tcod_sys/libtcod/dependencies/** 32 | .vscode/tasks.json 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: rust 2 | os: 3 | - linux 4 | - osx 5 | rust: 6 | - nightly 7 | - stable 8 | matrix: 9 | allow_failures: 10 | - os: linux 11 | rust: nightly 12 | - os: osx 13 | rust: nightly 14 | before_install: 15 | - '[ "$TRAVIS_OS_NAME" = linux ] && sudo apt-get update -qq || brew update' 16 | install: 17 | - '[ "$TRAVIS_OS_NAME" = linux ] && sudo apt-get install -y libsdl2-dev libegl1-mesa-dev libgles2-mesa-dev || brew install sdl2' 18 | script: 19 | - cargo build --verbose 20 | - cargo test --verbose 21 | - cargo test --features "rustc-serialize serde" --verbose 22 | - cargo test --release 23 | after_success: ! '[ $TRAVIS_BRANCH = master ] && 24 | 25 | [ "$TRAVIS_OS_NAME" = linux ] && 26 | 27 | [ $TRAVIS_PULL_REQUEST = false ] && 28 | 29 | cargo doc && 30 | 31 | echo '''' > target/doc/index.html 32 | && 33 | 34 | git config --global user.email "travis@travis-ci.org" && 35 | 36 | git config --global user.name "travis-ci" && 37 | 38 | sudo pip install ghp-import && 39 | 40 | ghp-import -n target/doc && 41 | 42 | git push -fq https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages 43 | 44 | ' 45 | env: 46 | global: 47 | - secure: h21kqC5s6iVs4p5n9KFZ5ZTWtPF8nGVFpaPP6t/1Sg+xMaHMDyr/sBYI1gsNGTXrVsiP2Zs6cRTBEbX12PVL6MXFgKpdhKG1+lBCMk6HxU8/W2UHCh6Y38+W4Ybyv5fuoWqkUOX3yODNkRZWrqNhdm8lCdE2uGczkIKPi7hDYMM= 48 | -------------------------------------------------------------------------------- /COPYING.txt: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2014 Tomas Sedovic 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tcod" 3 | description = "The Rust bindings for the Doryen library (a.k.a. libtcod)." 4 | version = "0.15.0" 5 | homepage = "https://github.com/tomassedovic/tcod-rs" 6 | repository = "https://github.com/tomassedovic/tcod-rs" 7 | documentation = "http://tomassedovic.github.io/tcod-rs/tcod/index.html" 8 | readme = "README.md" 9 | keywords = ["gamedev", "roguelike", "libtcod"] 10 | license = "WTFPL" 11 | authors = ["Tomas Sedovic ", 12 | "Bastien Léonard ", 13 | "Darren Kaste ", 14 | "Edu Garcia ", 15 | "Guillermo Galizzi ", 16 | "Gustorn ", 17 | "Jared McFarland ", 18 | "Jonny Gilchrist (@jgilchrist)", 19 | "LaylConway ", 20 | "lucanLepus (@lucanLepus)", 21 | "Moredread ", 22 | "Nikita Pekin", 23 | "Niko Lepka @ElectricCoffee ", 24 | "Noah Ryan @nsmryan ", 25 | "Paul Sanford ", 26 | "Pranz ", 27 | "Zoltán Nagy @abesto "] 28 | 29 | [badges] 30 | maintenance = { status = "deprecated" } 31 | 32 | [lib] 33 | name = "tcod" 34 | path = "src/lib.rs" 35 | 36 | [dependencies] 37 | bitflags = "0.1" 38 | lazy_static = "1.4" 39 | rustc-serialize = { optional = true, version = "0.3" } 40 | serde = { optional = true, version = "1.0" } 41 | serde_derive = { optional = true, version = "1.0" } 42 | 43 | [features] 44 | 45 | serialization = ["serde", "serde_derive"] 46 | 47 | [dependencies.tcod-sys] 48 | path = "tcod_sys" 49 | version = "5.0.0" 50 | 51 | [dev-dependencies] 52 | rand = "0.3" 53 | serde_json = "1.0" 54 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | cargo build 3 | 4 | test: 5 | cargo test --features "rustc-serialize_impls" 6 | 7 | package: clean 8 | cargo package --manifest-path tcod_sys/Cargo.toml 9 | cargo package 10 | 11 | clean: 12 | git clean -x -f -d 13 | 14 | .PHONY: build test package clean 15 | -------------------------------------------------------------------------------- /angband16x16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/angband16x16.bmp -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | matrix: 3 | - TARGET: x86_64-pc-windows-msvc 4 | ARCH: amd64 5 | VS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat 6 | - TARGET: i686-pc-windows-msvc 7 | ARCH: x86 8 | VS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat 9 | - TARGET: x86_64-pc-windows-gnu 10 | MSYS_BITS: 64 11 | - TARGET: i686-pc-windows-gnu 12 | MSYS_BITS: 32 13 | install: 14 | - ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe" 15 | - rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust" 16 | - if defined VS call "%VS%" %ARCH% 17 | - set PATH=%PATH%;C:\Program Files (x86)\Rust\bin 18 | - if defined MSYS_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS_BITS%\bin 19 | - set RUST_BACKTRACE=1 20 | - rustc -V 21 | - cargo -V 22 | 23 | build: false 24 | 25 | test_script: 26 | - cargo test 27 | - cargo test --release 28 | -------------------------------------------------------------------------------- /arial10x10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/arial10x10.png -------------------------------------------------------------------------------- /consolas10x10_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/consolas10x10_gs_tc.png -------------------------------------------------------------------------------- /data/img/circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/data/img/circle.png -------------------------------------------------------------------------------- /data/img/skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/data/img/skull.png -------------------------------------------------------------------------------- /data/namegen/jice_celtic.cfg: -------------------------------------------------------------------------------- 1 | //Celtic names from Jice's "The Cave" 2 | name "Celtic male" { 3 | syllablesStart = "Aen, Agno, All, Ba, Beo, Brig, Ci, Cre, Dan, Del, Ela, Eo, En, Er, Et, In, Io, Morr, Nem, Nu, Og, Or, Ta" 4 | syllablesMiddle = "a, ar, ba, bo, ch, d, ig" 5 | syllablesEnd = "aid, ain, an, and, th, ed, eth, gus, lam, lor, man, od, t, thach" 6 | rules = "$s$m$e, $s$e" 7 | } 8 | 9 | name "Celtic female" { 10 | syllablesStart = "Aen, Agno, All, Ba, Beo, Brig, Ci, Cre, Dan, Del, Ela, Eo, En, Er, Et, In, Io, Morr, Nem, Nu, Og, Or, Ta" 11 | syllablesMiddle = "a, ar, ba, bo, ch, d, ig" 12 | syllablesEnd = "ai, an, da, id, iu, ma, me, na, ne, tha" 13 | rules = "$s$m$e, $s$e" 14 | } 15 | 16 | -------------------------------------------------------------------------------- /data/namegen/jice_fantasy.cfg: -------------------------------------------------------------------------------- 1 | //Fantasy names from Jice's "The Cave" 2 | name "Fantasy male" { 3 | syllablesStart = "Aer, An, Ar, Ban, Bar, Ber, Beth, Bett, Cut, Dan, Dar, Dell, Der, Edr, Er, Eth, Ett, Fin, Ian, Iarr, Ill, Jed, Kan, Kar, Ker, Kurr, Kyr, Man, Mar, Mer, Mir, Tsal, Tser, Tsir, Van, Var, Yur, Yyr" 4 | syllablesMiddle = "al, an, ar, el, en, ess, ian, onn, or" 5 | syllablesEnd = "ai, an, ar, ath, en, eo, ian, is, u, or" 6 | illegal = "orar, arrar" 7 | rules = "$s$m$e, $s$e" 8 | } 9 | 10 | name "Fantasy female" { 11 | syllablesStart = "Aer, An, Ar, Ban, Bar, Ber, Beth, Bett, Cut, Dan, Dar, Dell, Der, Edr, Er, Eth, Ett, Fin, Ian, Iarr, Ill, Jed, Kan, Kar, Ker, Kurr, Kyr, Man, Mar, Mer, Mir, Tsal, Tser, Tsir, Van, Var, Yur, Yyr" 12 | syllablesMiddle = "al, an, ar, el, en, ess, ian, onn, or" 13 | syllablesEnd = "a, ae, aelle, ai, ea, i, ia, u, wen, wyn" 14 | illegal = "arrar" 15 | rules = "$s$m$e, $s$e" 16 | } 17 | 18 | -------------------------------------------------------------------------------- /data/namegen/jice_mesopotamian.cfg: -------------------------------------------------------------------------------- 1 | //Mesopotamian names from Jice's "The Cave" 2 | name "Mesopotamian male" { 3 | syllablesStart = "A, Ann, Ash, E', En, Er, Gil, In, Ir, Ish, Mar, Ni, Nin, Re, Ti, Ur" 4 | syllablesMiddle = "am, an, du, esh, gam, gir, ka, ki, li, un, ur, ta" 5 | syllablesEnd = "aki, al, ar, at, du, eph, esh, il, im, ki, nu, uk, ur, uz" 6 | illegal = "aa, e'e" 7 | rules = "$s$m$e, $s$e" 8 | } 9 | 10 | name "Mesopotamian female" { 11 | syllablesStart = "A, Ann, Ash, E', En, Er, Gil, In, Ir, Ish, Mar, Ni, Nin, Re, Ti, Ur" 12 | syllablesMiddle = "am, an, du, esh, gam, gir, ka, ki, li, un, ur, ta" 13 | syllablesEnd = "ag, il, la, na, sag, su, ta" 14 | illegal = "aa, e'e" 15 | rules = "$s$m$e, $s$e" 16 | } 17 | 18 | -------------------------------------------------------------------------------- /data/namegen/jice_norse.cfg: -------------------------------------------------------------------------------- 1 | //Norse names from Jice's "The Cave" 2 | name "Norse male" { 3 | syllablesStart = "Al, Ae, As, Bi, Fen, Ha, Hag, Ho, Hu, Iv, Jot, Ma, Mio, Mu, Nid, Ors, Ra, Sta, Svar, Tys, Vae, Van, Vol, Y, Ygg" 4 | syllablesMiddle = "an, ar, ba, da, dra, gar, na, tal" 5 | syllablesEnd = "ad, ald, agr, ar, ard, eyr, far, frost, heim, hogg, in, mir, nar, nir, or, osk, rir, sil, sir, ttir, urd" 6 | illegal = "yor, yar, yad, yin" 7 | rules = "$s$m$e, $s$e" 8 | } 9 | 10 | name "Norse female" { 11 | syllablesStart = "Al, Ae, As, Bi, Fen, Ha, Hag, Ho, Hu, Iv, Jot, Ma, Mio, Mu, Nid, Ors, Ra, Sta, Svar, Tys, Vae, Van, Vol, Y, Ygg" 12 | syllablesMiddle = "an, ar, ba, da, dra, gar, na, tal" 13 | syllablesEnd = "a, la, li, va" 14 | illegal = "raa, ya, aea, aea" 15 | rules = "$s$m$e, $s$e" 16 | } 17 | 18 | -------------------------------------------------------------------------------- /data/namegen/jice_region.cfg: -------------------------------------------------------------------------------- 1 | //Region names from Jice's "The Cave" 2 | name "region" { 3 | syllablesStart = "Act, Afr, Ag, Agr, Alb, Am, An, Angl, Ant, As, Asys, Asis, At, Atl, Brund, Cath, Cor, Dan, Eb, Eg, Er, Esc, Esp, Est, Eth, Eur, Flor, It, Lyr, Mal, Mir, Myr, Nor, Pel, Rom, Seg, Sib, Sylv, Terr, Tir, Tr, Tyr, Xan" 4 | syllablesMiddle = "ad, ag, al, an, and, ant, anth, ar, ard, as, at, atr, eg, en, ent, ern, et, ian, in, itr, on, op, ov, ur, ymn, yr" 5 | syllablesEnd = "a, aia, ana, as, ea, ene, eos, esia, ia, iad, ias, is, ium, ius, on, ona, or, ova, um, us, ya" 6 | rules = "$s$m$e, $s$e" 7 | } 8 | -------------------------------------------------------------------------------- /data/namegen/jice_town.cfg: -------------------------------------------------------------------------------- 1 | //Town names from Jice's "The Cave" 2 | name "town" { 3 | syllablesStart = "Ael, Ash, Barrow, Bel, Black, Clear, Cold, Crystal, Deep, Edge, Falcon, Fair, Fall, Glass, Gold, Ice, Iron, Mill, Moon, Mor, Ray, Red, Rock, Rose, Shadow, Silver, Spell, Spring, Stone, Strong, Summer, Swyn, Wester, Winter" 4 | syllablesEnd = "ash, burn, barrow, bridge, castle, cliff, coast, crest, dale, dell, dor, fall, field, ford, fort, gate, haven, hill, hold, hollow, iron, lake, marsh, mill, mist, mount, moor, pond, shade, shore, summer, town, wick" 5 | rules = "$s$e" 6 | } 7 | -------------------------------------------------------------------------------- /data/namegen/mingos_demon.cfg: -------------------------------------------------------------------------------- 1 | //Demon names 2 | name "demon male" { 3 | phonemesVocals = "a, e, i, o, u" 4 | syllablesStart = "Aam, Ab, Ad, Ahr, Alas, Al-A'w, All, Al-M, Ap, As, Ast, Az, Bal, Bal S, Bag, Balb, Ban, Bansh, Baph, Barb, Bath, Bazt, Be'L, Beel, Beelz, Bel, Belph, Ber, Bh, Bifr, Biul, Bush, Caac, Cagn, Caim, Chalk, Char, Chem, Coal, Dag, Dant, Decer, Demog, Dev, Dj, Dragh, Elig, Emp, Errt, Etr, Ett, Eur, Euryn, Gorg, Graph, Grig, Haag, Halph, Haur, Hoeth, Ifr, Inc, Ibl, Ith, Kabh, Kas, Kokb', Kray, Lab, Lam, Lech, Leg, Lil, Lioth, Lix, Luc, Mal, Malph, Mamm, March, Mast, Math, Meph, Merm, Mol, Murm, Naam, Naph, Nek, Neph, Neq, Nix, Noud, Onom, Onos, Orc, Orob, Oul, Paim, Phen, Pont, Proc, Rah, Rak, Raksh, Ram, Rang, Raum, Raz, Rimm, Rub, Rus, Sabn, Salps, Sam, Sat, Sc, Scarm, Seer, Sem, Set, Shait, Shax, Shed, Shez, Sidr, Sitr, Sth, Succ, Surg, Tann, Tart, Tch, Teer, Thamm, Thub, Tlal, Tsab, Val, Vap, Vass, Vep, Verr, Vin, Vol, Vual, Xaph, Xiph, Xitr, Zaeb, Zim, Ziz, Zaln" 5 | syllablesMiddle = "b'ae, ba, be, chi, dra, du, ga, ghi, go, lia, ma, mba, mu, n'e, na, nti, nzu, phe, pho, r'e, rba, rgo, ssa, thi, tryu, ttu, tzi, v-e, vna, xra, ya" 6 | syllablesEnd = "b'ael, bel, bub, bur, bus, ces, chus, dai, ddon, des, dhaka, el, fer, flas, gion, gon, gor, klet, kor, ksha, kuth, laas, lech, les, lion, lith, loch, lsu, mael, math, mejes, meus, mon, moth, mmut, mosh, nai, nar, neus, nex, nias, nnin, nomos, phas, r'el, raal, rept, res, rgon, riax, rith, rius, rous, rus, ruth, sias, stor, swath, tath, than, the, thra, tryus, tura, vart, ztuk" 7 | rules = "$s$v$35m$10m$e" 8 | } 9 | 10 | name "demon female" { 11 | phonemesVocals = "a, e, i, o, u" 12 | syllablesStart = "Aam, Ab, Ad, Ahr, Alas, Al-A'w, All, Al-M, Ap, As, Ast, Az, Bal, Bal S, Bag, Balb, Ban, Bansh, Baph, Barb, Bath, Bazt, Be'L, Beel, Beelz, Bel, Belph, Ber, Bh, Bifr, Biul, Bush, Caac, Cagn, Caim, Chalk, Char, Chem, Coal, Dag, Dant, Decer, Demog, Dev, Dj, Dragh, Elig, Emp, Errt, Etr, Ett, Eur, Euryn, Gorg, Graph, Grig, Haag, Halph, Haur, Hoeth, Ifr, Inc, Ibl, Ith, Kabh, Kas, Kokb', Kray, Lab, Lam, Lech, Leg, Lil, Lioth, Lix, Luc, Mal, Malph, Mamm, March, Mast, Math, Meph, Merm, Mol, Murm, Naam, Naph, Nek, Neph, Neq, Nix, Noud, Onom, Onos, Orc, Orob, Oul, Paim, Phen, Pont, Proc, Rah, Rak, Raksh, Ram, Rang, Raum, Raz, Rimm, Rub, Rus, Sabn, Salps, Sam, Sat, Sc, Scarm, Seer, Sem, Set, Shait, Shax, Shed, Shez, Sidr, Sitr, Sth, Succ, Surg, Tann, Tart, Tch, Teer, Thamm, Thub, Tlal, Tsab, Val, Vap, Vass, Vep, Verr, Vin, Vol, Vual, Xaph, Xiph, Xitr, Zaeb, Zim, Ziz, Zaln" 13 | syllablesMiddle = "b'ae, ba, be, chi, dra, du, ga, ghi, go, lia, ma, mba, mu, n'e, na, nti, nzu, phe, pho, r'e, rba, rgo, ssa, thi, tryu, ttu, tzi, v-e, vna, xra, ya" 14 | syllablesEnd = "b'a, bel, bua, bure, buth, cess, chia, dai, ddea, dea, dhaka, el, fea, fla, gia, goa, gora, klath, kore, ksha, kua, laal, lexa, less, lia, lith, loth, lsa, mara, math, maja, mea, moa, moth, mmuth, mosh, na, nai, neuth, nex, nia, nnine, nomoa, pha, r'el, raala, repte, reshe, rgona, riaxe, rith, rish, rothe, rushe, ruth, sia, stora, swath, tath, thann, the, thra, trya, tura, varte, ztura" 15 | rules = "$s$v$35m$10m$e" 16 | } 17 | -------------------------------------------------------------------------------- /data/namegen/mingos_dwarf.cfg: -------------------------------------------------------------------------------- 1 | //dwarf names 2 | name "dwarf male" { 3 | syllablesStart = "A, An, Ba, Bi, Bo, Bom, Da, Dar, De, Do, Du, Due, Duer, Dwa, Fa, Fal, Fi, Fre, Fun, Ga, Gar, Gim, Glo, Go, Gom, Gro, Gwar, Ib, Jor, Ka, Ki, Kil, Lo, Mar, Na, Nal, O, Ras, Ren, Ro, Ta, Tar, Tel, Thi, Tho, Thon, Thra, Tor, Von, We, Wer, Yen, Yur" 4 | syllablesEnd = "bil, bin, bur, char, den, dir, dur, fri, fur, in, li, lin, mil, mur, ni, nur, ran, ri, ril, rimm, rin, thur, tri, ulf, un, ur, vi, vil, vim, vin, vri" 5 | rules = "$s$e" 6 | illegal = "rur, ueu" 7 | } 8 | 9 | name "dwarf female" { 10 | syllablesStart = "A, An, Ba, Bi, Bo, Bom, Da, Dar, De, Do, Du, Due, Duer, Dwa, Fa, Fal, Fi, Fre, Fun, Ga, Gar, Gim, Glo, Go, Gom, Gro, Gwar, Ib, Jor, Ka, Ki, Kil, Lo, Mar, Na, Nal, O, Ras, Ren, Ro, Ta, Tar, Tel, Thi, Tho, Thon, Thra, Tor, Von, We, Wer, Yen, Yur" 11 | syllablesEnd = "al, ali, ba, bida, bra, da, deth, di, fra, gret, hild, iess, kala, la, laani, li, lona, ma, mae, mala, na, nuda, ra, ta, tala, tu, tuna, vada, vara, ya" 12 | rules = "$s$e" 13 | illegal = "dueal, frefra, grogret" 14 | } 15 | 16 | //surnames have semantic information. Here, they're separated into three 17 | //somewhat coherent sets and either is chosen 18 | name "dwarf surname" { 19 | //1st set - smith & Mr.Muscle surnames 20 | syllablesPre = "Boulder, Bronze, Coal, Copper, Gem, Granite, Hammer, Iron, Marble, Metal, Rock, Steel, Stone, Thunder" 21 | syllablesPost = "bender, breaker, carver, club, crusher, cutter, digger, fist, foot, forger, heart, smasher, smith" 22 | //2nd set - warrior surnames 23 | syllablesStart = "Bear, Boar, Dragon, Giant, Goblin, Elf, Ettin, Foe, Kobold, Ogre, Orc,Spider, Troll, Wolf" 24 | syllablesEnd = "bane, basher, _Battler, _Beheader, boxer, _Butcher, choker, cleaver, crusher, cutter, doom, eater, _Executioner, _Fighter, _Garrotter, grapple, _Gutter, hammer, killer, mauler, masher, ripper, slasher, slayer, slicer, smasher, _Strangler, striker, _Wrestler" 25 | //3rd set - heroic and general 26 | phonemesVocals = "Black, Blood, Bronze, Fire, Firm, Grey, Hard, Ice, Iron, Moon, Oak, Onyx, Red, Steel, Stone, Strong, Thunder, White" 27 | phonemesConsonants = "axe, beard, blade, brand, cheek, fist, foot, hair, hammer, hand, head, heart, pick, shield, spear, spike, sword" 28 | rules = "$P$p, $s$e, $v$c" 29 | } -------------------------------------------------------------------------------- /data/namegen/mingos_standard.cfg: -------------------------------------------------------------------------------- 1 | //Names based on syllables from J.R.R. Tolkien's and David Eddings' novels. 2 | name "male" { 3 | phonemesVocals = "a, e, i, o, u, y" 4 | phonemesConsonants = "b, c, ch, ck, cz, d, dh, f, g, gh, h, j, k, kh, l, m, n, p, ph, q, r, rh, s, sh, t, th, ts, tz, v, w, x, z, zh" 5 | syllablesStart = "Aer, Al, Am, An, Ar, Arm, Arth, B, Bal, Bar, Be, Bel, Ber, Bok, Bor, Bran, Breg, Bren, Brod, Cam, Chal, Cham, Ch, Cuth, Dag, Daim, Dair, Del, Dr, Dur, Duv, Ear, Elen, Er, Erel, Erem, Fal, Ful, Gal, G, Get, Gil, Gor, Grin, Gun, H, Hal, Han, Har, Hath, Hett, Hur, Iss, Khel, K, Kor, Lel, Lor, M, Mal, Man, Mard, N, Ol, Radh, Rag, Relg, Rh, Run, Sam, Tarr, T, Tor, Tul, Tur, Ul, Ulf, Unr, Ur, Urth, Yar, Z, Zan, Zer" 6 | syllablesMiddle = "de, do, dra, du, duna, ga, go, hara, kaltho, la, latha, le, ma, nari, ra, re, rego, ro, rodda, romi, rui, sa, to, ya, zila" 7 | syllablesEnd = "bar, bers, blek, chak, chik, dan, dar, das, dig, dil, din, dir, dor, dur, fang, fast, gar, gas, gen, gorn, grim, gund, had, hek, hell, hir, hor, kan, kath, khad, kor, lach, lar, ldil, ldir, leg, len, lin, mas, mnir, ndil, ndur, neg, nik, ntir, rab, rach, rain, rak, ran, rand, rath, rek, rig, rim, rin, rion, sin, sta, stir, sus, tar, thad, thel, tir, von, vor, yon, zor" 8 | rules = "$s$v$35m$10m$e" 9 | } 10 | 11 | name "female" { 12 | phonemesVocals = "a, e, i, o, u, y" 13 | syllablesStart = "Ad, Aer, Ar, Bel, Bet, Beth, Ce'N, Cyr, Eilin, El, Em, Emel, G, Gl, Glor, Is, Isl, Iv, Lay, Lis, May, Ner, Pol, Por, Sal, Sil, Vel, Vor, X, Xan, Xer, Yv, Zub" 14 | syllablesMiddle = "bre, da, dhe, ga, lda, le, lra, mi, ra, ri, ria, re, se, ya" 15 | syllablesEnd = "ba, beth, da, kira, laith, lle, ma, mina, mira, na, nn, nne, nor, ra, rin, ssra, ta, th, tha, thra, tira, tta, vea, vena, we, wen, wyn" 16 | rules = "$s$v$35m$10m$e" 17 | } 18 | -------------------------------------------------------------------------------- /data/namegen/mingos_town.cfg: -------------------------------------------------------------------------------- 1 | //Town names. The town name construction is based on real British town names, 2 | //although many starting syllables are made up. 3 | name "Mingos town" { 4 | syllablesPre = "East, Fort, Great, High, Lower, Middle, Mount, New, North, Old, Royal, Saint, South, Upper, West" 5 | syllablesStart = "Ales, Apple, Ash, Bald, Bay, Bed, Bell, Birdling, Black, Blue, Bow, Bran, Brass, Bright, Brown, Bruns, Bulls, Camp, Cherry, Clark, Clarks, Clay, Clear, Copper, Corn, Cross, Crystal, Dark, Deep, Deer, Drac, Eagle, Earth, Elk, Elles, Elm, Ester, Ewes, Fair, Falcon, Ferry, Fire, Fleet, Fox, Gold, Grand, Green, Grey, Guild, Hammer, Hart, Hawks, Hay, Haze, Hazel, Hemlock, Ice, Iron, Kent, Kings, Knox, Layne, Lint, Lor, Mable, Maple, Marble, Mare, Marsh, Mist, Mor, Mud, Nor, Oak, Orms, Ox, Oxen, Pear, Pine, Pitts, Port, Purple, Red, Rich, Roch, Rock, Rose, Ross, Rye, Salis, Salt, Shadow, Silver, Skeg, Smith, Snow, Sows, Spring, Spruce, Staff, Star, Steel, Still, Stock, Stone, Strong, Summer, Swan, Swine, Sword, Yellow, Val, Wart, Water, Well, Wheat, White, Wild, Winter, Wolf, Wool, Wor" 6 | syllablesEnd = "bank, borne, borough, brook, burg, burgh, bury, castle, cester, cliff, crest, croft, dale, dam, dorf, edge, field, ford, gate, grad, hall, ham, hollow, holm, hurst, keep, kirk, land, ley, lyn, mere, mill, minster, mont, moor, mouth, ness, pool, river, shire, shore, side, stead, stoke, ston, thorpe, ton, town, vale, ville, way, wich, wick, wood, worth" 7 | syllablesPost = "Annex, Barrens, Barrow, Corner, Cove, Crossing, Dell, Dales, Estates, Forest, Furnace, Grove, Haven, Heath, Hill, Junction, Landing, Meadow, Park, Plain, Point, Reserve, Retreat, Ridge, Springs, View, Village, Wells, Woods" 8 | rules = "$15P_$s$e_$15p" 9 | } 10 | -------------------------------------------------------------------------------- /examples/astar-path-finding.rs: -------------------------------------------------------------------------------- 1 | extern crate tcod; 2 | 3 | use tcod::pathfinding::AStar; 4 | 5 | fn create_path() -> AStar<'static> { 6 | let chess_board: [[i32; 8]; 8] = [ 7 | [1, 0, 1, 0, 1, 0, 1, 0], 8 | [0, 1, 0, 1, 0, 1, 0, 1], 9 | [1, 0, 1, 0, 1, 0, 1, 0], 10 | [0, 1, 0, 1, 0, 1, 0, 1], 11 | [1, 0, 1, 0, 1, 0, 1, 0], 12 | [0, 1, 0, 1, 0, 1, 0, 1], 13 | [1, 0, 1, 0, 1, 0, 1, 0], 14 | [0, 1, 0, 1, 0, 1, 0, 1], 15 | ]; 16 | // Movement like in Checkers: you can only move to the square of the same colour 17 | let can_move = move |from: (i32, i32), to: (i32, i32)| -> f32 { 18 | let (fx, fy) = from; 19 | let (tx, ty) = to; 20 | if chess_board[fy as usize][fx as usize] == chess_board[ty as usize][tx as usize] { 21 | 1.0 22 | } else { 23 | 0.0 24 | } 25 | }; 26 | AStar::new_from_callback(8, 8, can_move, 1.0) 27 | } 28 | 29 | fn main() { 30 | let mut path = create_path(); 31 | assert_eq!(path.find((0, 0), (1, 1)), true); 32 | assert_eq!(path.len(), 1); 33 | assert_eq!(path.is_empty(), false); 34 | assert_eq!(path.find((0, 0), (0, 1)), false); 35 | assert_eq!(path.len(), 0); 36 | assert_eq!(path.is_empty(), true); 37 | 38 | assert_eq!(path.find((0, 0), (0, 6)), true); 39 | assert_eq!(path.len(), 6); 40 | assert_eq!(path.origin(), (0, 0)); 41 | assert_eq!(path.destination(), (0, 6)); 42 | 43 | // Explore the path: 44 | assert_eq!(path.get(0), Some((1, 1))); 45 | assert_eq!(path.get(1), Some((0, 2))); 46 | assert_eq!(path.get(2), Some((1, 3))); 47 | assert_eq!(path.get(3), Some((0, 4))); 48 | assert_eq!(path.get(4), Some((1, 5))); 49 | assert_eq!(path.get(5), Some((0, 6))); 50 | 51 | // Make sure we don't segfault on invalid index 52 | assert_eq!(path.get(-1), None); 53 | assert_eq!(path.get(6), None); 54 | assert_eq!(path.get(7), None); 55 | 56 | 57 | // Walk the path (consuming it): 58 | for pos in path.walk() { 59 | println!("Walking to {:?}", pos); 60 | } 61 | 62 | assert_eq!(path.len(), 0); 63 | assert_eq!(path.is_empty(), true); 64 | // Note: origin has moved to the destination: 65 | assert_eq!(path.origin(), (0, 6)); 66 | assert_eq!(path.destination(), (0, 6)); 67 | assert_eq!(path.get(0), None); 68 | } 69 | -------------------------------------------------------------------------------- /examples/blit.rs: -------------------------------------------------------------------------------- 1 | extern crate tcod; 2 | 3 | use tcod::console; 4 | use tcod::{Console, RootConsole, OffscreenConsole, Color}; 5 | 6 | 7 | fn main() { 8 | let mut root = RootConsole::initializer() 9 | .size(80, 50) 10 | .title("Using blit with libtcod") 11 | .init(); 12 | 13 | let mut direct: OffscreenConsole = OffscreenConsole::new(20, 20); 14 | let mut boxed_direct: Box = Box::new(OffscreenConsole::new(20, 20)); 15 | let mut trait_object: &dyn Console = &OffscreenConsole::new(20, 20); 16 | let mut boxed_trait: Box = Box::new(OffscreenConsole::new(20, 20)); 17 | 18 | 19 | root.set_default_background(Color::DARKEST_GREEN); 20 | 21 | direct.set_default_background(Color::RED); 22 | boxed_direct.set_default_background(Color::WHITE); 23 | trait_object.set_default_background(Color::BLACK); 24 | boxed_trait.set_default_background(Color::BLUE); 25 | 26 | root.clear(); 27 | 28 | direct.clear(); 29 | boxed_direct.clear(); 30 | trait_object.clear(); 31 | boxed_trait.clear(); 32 | 33 | 34 | console::blit(&direct, (0, 0), (20, 20), &mut root, (0, 0), 1.0, 1.0); 35 | console::blit(&boxed_direct, (0, 0), (20, 20), &mut root, (20, 0), 1.0, 1.0); 36 | console::blit(&trait_object, (0, 0), (20, 20), &mut root, (0, 20), 1.0, 1.0); 37 | console::blit(&boxed_trait, (0, 0), (20, 20), &mut root, (20, 20), 1.0, 1.0); 38 | 39 | root.flush(); 40 | root.wait_for_keypress(true); 41 | } 42 | -------------------------------------------------------------------------------- /examples/chars.rs: -------------------------------------------------------------------------------- 1 | extern crate tcod; 2 | 3 | use tcod::{Console, RootConsole}; 4 | use tcod::chars; 5 | 6 | fn main() { 7 | let mut root = RootConsole::initializer() 8 | .size(80, 50) 9 | .title("Example of libtcod's special chars") 10 | .init(); 11 | 12 | root.clear(); 13 | 14 | // The top half of the box 15 | root.set_char(40, 25, chars::HLINE); 16 | root.set_char(41, 25, chars::NE); 17 | root.set_char(41, 26, chars::VLINE); 18 | root.set_char(41, 27, chars::SE); 19 | 20 | // Draw the heart: 21 | root.set_char(40, 26, chars::HEART); 22 | 23 | // The bottom half of the box 24 | root.set_char(40, 27, chars::HLINE); 25 | root.set_char(39, 27, chars::SW); 26 | root.set_char(39, 26, chars::VLINE); 27 | root.set_char(39, 25, chars::NW); 28 | 29 | root.flush(); 30 | root.wait_for_keypress(true); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /examples/colors.rs: -------------------------------------------------------------------------------- 1 | extern crate tcod; 2 | 3 | use tcod::{Console, RootConsole, Color, BackgroundFlag}; 4 | use tcod::colors; 5 | 6 | 7 | fn main() { 8 | let mut con = RootConsole::initializer() 9 | .size(80, 50) 10 | .title("Using colours with libtcod") 11 | .init(); 12 | con.set_default_background(Color::DARKEST_GREEN); 13 | con.set_default_foreground(Color::LIGHTER_AZURE); 14 | 15 | con.clear(); 16 | // Uses the default foreground and background: 17 | con.put_char(40, 25, '@', BackgroundFlag::Set); 18 | // Custom foreground and background: 19 | con.put_char_ex(42, 25, '!', Color{r: 240, g: 13, b: 20}, Color{r: 0, g: 0, b: 0}); 20 | 21 | let black = Color::new(0, 0, 0); 22 | let red = Color::new(200, 0, 0); 23 | 24 | con.put_char_ex(30, 30, '.', black, red); 25 | con.put_char_ex(32, 30, '.', black, red * Color::new(200, 0, 0)); 26 | con.put_char_ex(34, 30, '.', black, red * 0.3); 27 | con.put_char_ex(36, 30, '.', black, red + Color::new(25, 60, 0)); 28 | con.put_char_ex(36, 30, '.', black, red - Color::new(25, 60, 0)); 29 | con.put_char_ex(38, 30, '.', black, colors::lerp(red, black, 0.8)); 30 | 31 | let (h, s, v) = red.hsv(); 32 | println!("Red colour's hue: {}, saturation: {}, value: {}", h, s, v); 33 | 34 | con.flush(); 35 | 36 | // Press any key to exit: 37 | con.wait_for_keypress(true); 38 | } 39 | -------------------------------------------------------------------------------- /examples/custom_character_mapping.rs: -------------------------------------------------------------------------------- 1 | extern crate tcod; 2 | 3 | use tcod::{Console, RootConsole, FontLayout, FontType}; 4 | 5 | const FLOOR_TILE: char = 1 as char; 6 | const WALL_TILE: char = 2 as char; 7 | const HERO_TILE: char = 3 as char; 8 | const CHEST_TILE: char = 4 as char; 9 | const ENEMY_1_TILE: char = 5 as char; 10 | const ENEMY_2_TILE: char = 6 as char; 11 | 12 | const MAP_WIDTH: i32 = 80; 13 | const MAP_HEIGHT: i32 = 50; 14 | 15 | const ROOM_WIDTH: i32 = 20; 16 | const ROOM_HEIGHT: i32 = 15; 17 | 18 | fn main() { 19 | let mut root = RootConsole::initializer() 20 | .font("angband16x16.bmp", FontLayout::Tcod) 21 | .font_type(FontType::Greyscale) 22 | .font_dimensions(32, 60) // angband16x16.bmp has 32 columns & 60 rows of 23 | // characters 24 | .size(MAP_WIDTH, MAP_HEIGHT) 25 | .title("Using custom character mapping with libtcod") 26 | .init(); 27 | 28 | // map ASCII_CODE to character in font at position X, Y 29 | root.map_ascii_code_to_font(FLOOR_TILE as i32, 4, 0); 30 | root.map_ascii_code_to_font(WALL_TILE as i32, 13, 0); 31 | root.map_ascii_code_to_font(HERO_TILE as i32, 1, 18); 32 | root.map_ascii_code_to_font(CHEST_TILE as i32, 26, 4); 33 | root.map_ascii_code_to_font(ENEMY_1_TILE as i32, 15, 33); 34 | root.map_ascii_code_to_font(ENEMY_2_TILE as i32, 0, 48); 35 | 36 | root.clear(); 37 | 38 | // fill map with wall tiles 39 | for x in 0..MAP_WIDTH { 40 | for y in 0..MAP_HEIGHT { 41 | root.set_char(x, y, WALL_TILE); 42 | } 43 | } 44 | 45 | let (starting_x, starting_y) = (30, 10); 46 | let (middle_x, middle_y) = ( 47 | starting_x + (ROOM_WIDTH / 2), 48 | starting_y + (ROOM_HEIGHT / 2), 49 | ); 50 | 51 | // draw room 52 | for x in starting_x..starting_x + ROOM_WIDTH { 53 | for y in starting_y..starting_y + ROOM_HEIGHT { 54 | root.set_char(x, y, FLOOR_TILE); 55 | } 56 | } 57 | 58 | // place special tiles 59 | root.set_char(middle_x, middle_y + 2, HERO_TILE); 60 | root.set_char(middle_x, middle_y - 3, ENEMY_1_TILE); 61 | root.set_char(middle_x - 3, middle_y - 3, ENEMY_1_TILE); 62 | root.set_char(middle_x + 3, middle_y - 3, ENEMY_1_TILE); 63 | root.set_char(middle_x - 2, middle_y - 5, ENEMY_2_TILE); 64 | root.set_char(middle_x + 2, middle_y - 5, ENEMY_2_TILE); 65 | root.set_char(middle_x, middle_y - 7, CHEST_TILE); 66 | 67 | root.flush(); 68 | root.wait_for_keypress(true); 69 | } 70 | -------------------------------------------------------------------------------- /examples/dijkstra-path-finding.rs: -------------------------------------------------------------------------------- 1 | extern crate tcod; 2 | 3 | use tcod::pathfinding::Dijkstra; 4 | 5 | fn create_path() -> Dijkstra<'static> { 6 | let chess_board: [[i32; 8]; 8] = [ 7 | [1, 0, 1, 0, 1, 0, 1, 0], 8 | [0, 1, 0, 1, 0, 1, 0, 1], 9 | [1, 0, 1, 0, 1, 0, 1, 0], 10 | [0, 1, 0, 1, 0, 1, 0, 1], 11 | [1, 0, 1, 0, 1, 0, 1, 0], 12 | [0, 1, 0, 1, 0, 1, 0, 1], 13 | [1, 0, 1, 0, 1, 0, 1, 0], 14 | [0, 1, 0, 1, 0, 1, 0, 1], 15 | ]; 16 | // Movement like in Checkers: you can only move to the square of the same colour 17 | let can_move = move |from: (i32, i32), to: (i32, i32)| -> f32 { 18 | let (fx, fy) = from; 19 | let (tx, ty) = to; 20 | if chess_board[fy as usize][fx as usize] == chess_board[ty as usize][tx as usize] { 21 | 1.0 22 | } else { 23 | 0.0 24 | } 25 | }; 26 | Dijkstra::new_from_callback(8, 8, can_move, 1.0) 27 | } 28 | 29 | fn walk_from(path: &mut Dijkstra, origin: (i32, i32)) { 30 | path.find(origin); 31 | path.reverse(); 32 | println!("Starting from: {:?}", origin); 33 | for pos in path.walk() { 34 | println!("Walking to: {:?}", pos); 35 | } 36 | println!("Arrived at the destination!\n"); 37 | } 38 | 39 | 40 | fn main() { 41 | let mut path = create_path(); 42 | let destination = (0, 0); 43 | path.compute_grid(destination); 44 | 45 | // Let's find multiple paths leading to (0, 0) 46 | walk_from(&mut path, (4, 6)); 47 | walk_from(&mut path, (0, 6)); 48 | walk_from(&mut path, (0, 0)); 49 | walk_from(&mut path, (6, 2)); 50 | } 51 | -------------------------------------------------------------------------------- /examples/fov.rs: -------------------------------------------------------------------------------- 1 | extern crate rand; 2 | extern crate tcod; 3 | 4 | use tcod::{Console, RootConsole, BackgroundFlag, Map}; 5 | use tcod::map::FovAlgorithm; 6 | 7 | // We'll use a basic structure to define our tiles. 8 | #[derive(Copy, Clone)] 9 | pub struct Tile { 10 | ch: char, 11 | x: i32, 12 | y: i32, 13 | } 14 | 15 | fn main() { 16 | let mut root = RootConsole::initializer().size(40, 40) .title("FOV example").init(); 17 | 18 | let mut map = Map::new(40,40); 19 | let mut tiles = Vec::new(); 20 | 21 | root.clear(); 22 | 23 | // Set the map. 24 | for x in 0..40 { 25 | for y in 0..40 { 26 | // Place some walls randomly. 27 | if rand::random() { 28 | tiles.push(Tile{x:x, y:y, ch: '#' }); 29 | // Mark this place as non transparent, and non walkable. 30 | map.set(x,y,false,false); 31 | } else { 32 | tiles.push(Tile{x:x, y:y, ch: '.'}); 33 | // Mark this place as transparent and walkable. 34 | map.set(x,y,true,true); 35 | } 36 | } 37 | } 38 | 39 | // Compute the FOV starting from the coordinates 20,20. Where we'll put the '@' 40 | // Use a max_radius of 10 and light the walls. 41 | map.compute_fov(20,20, 10, true, FovAlgorithm::Basic); 42 | 43 | for tile in tiles.iter() { 44 | if map.is_in_fov(tile.x, tile.y) { 45 | root.put_char(tile.x,tile.y,tile.ch, BackgroundFlag::Set); 46 | } 47 | } 48 | 49 | root.put_char(20,20, '@', BackgroundFlag::Set); 50 | 51 | root.flush(); 52 | //Press any key to exit. 53 | root.wait_for_keypress(true); 54 | } 55 | -------------------------------------------------------------------------------- /examples/keyboard.rs: -------------------------------------------------------------------------------- 1 | extern crate tcod; 2 | 3 | use tcod::{Console, RootConsole, BackgroundFlag}; 4 | use tcod::input::Key; 5 | use tcod::input::KeyCode::{Up, Down, Left, Right, Escape}; 6 | 7 | fn main() { 8 | let mut con = RootConsole::initializer() 9 | .size(80, 50) 10 | .title("libtcod Rust tutorial") 11 | .init(); 12 | 13 | let mut x = 40; 14 | let mut y = 25; 15 | while !con.window_closed() { 16 | con.clear(); 17 | con.put_char(x, y, '@', BackgroundFlag::Set); 18 | con.flush(); 19 | let keypress = con.wait_for_keypress(true); 20 | // libtcod 1.5.1 has a bug where `wait_for_keypress` emits two events: 21 | // one for key down and one for key up. So we ignore the "key up" ones. 22 | if keypress.pressed { 23 | match keypress { 24 | Key { code: Escape, .. } => break, 25 | Key { code: Up, .. } => y -= 1, 26 | Key { code: Down, .. } => y += 1, 27 | Key { code: Left, .. } => x -= 1, 28 | Key { code: Right, .. } => x += 1, 29 | _ => {} 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /examples/minimal.rs: -------------------------------------------------------------------------------- 1 | extern crate tcod; 2 | 3 | use tcod::RootConsole; 4 | 5 | fn main() { 6 | let mut root = RootConsole::initializer().size(80, 50).title("Minimal libtcod loop").init(); 7 | 8 | while !root.window_closed() { 9 | root.flush(); 10 | let key = root.wait_for_keypress(true); 11 | println!("Pressed key: {:?}", key); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/mouse.rs: -------------------------------------------------------------------------------- 1 | extern crate tcod; 2 | 3 | use tcod::input as input; 4 | use tcod::{Console, RootConsole, BackgroundFlag}; 5 | 6 | fn main() { 7 | let mut con = RootConsole::initializer() 8 | .size(80, 50) 9 | .title("Move the cursor inside the window") 10 | .init(); 11 | 12 | let mut x = 40; 13 | let mut y = 25; 14 | 15 | while !con.window_closed() { 16 | 17 | loop { 18 | match input::check_for_event(input::KEY | input::MOUSE) { 19 | None => { 20 | break; 21 | } 22 | Some((_, event)) => { 23 | match event { 24 | input::Event::Key(ref key_state) => { 25 | println!("{:?}", key_state); 26 | }, 27 | input::Event::Mouse(ref mouse_state) => { 28 | x = mouse_state.cx as i32; 29 | y = mouse_state.cy as i32; 30 | println!("{:?}", mouse_state); 31 | } 32 | } 33 | } 34 | } 35 | } 36 | 37 | con.clear(); 38 | con.put_char(x, y, '@', BackgroundFlag::Set); 39 | con.flush(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /examples/namegen.rs: -------------------------------------------------------------------------------- 1 | extern crate tcod; 2 | 3 | use tcod::namegen::Namegen; 4 | use tcod::random::{Rng, Algo}; 5 | 6 | fn setup_namegen() -> Namegen { 7 | let rng = Rng::new(Algo::MT); 8 | let mut namegen = Namegen::new().unwrap(); 9 | namegen.parse_with_rng("data/namegen/mingos_standard.cfg", &rng); 10 | namegen 11 | } 12 | 13 | fn main() { 14 | let namegen = setup_namegen(); 15 | println!("{}", namegen.generate("male").unwrap()); 16 | } 17 | -------------------------------------------------------------------------------- /examples/print_macros.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | extern crate tcod; 3 | 4 | use tcod::{Console, RootConsole, BackgroundFlag, TextAlignment}; 5 | 6 | fn main() { 7 | let mut root = RootConsole::initializer().size(80, 50).title("Displaying text").init(); 8 | 9 | // No optional parameters 10 | tcod_print!(root, At(1, 1), "Any text params may be {}", "formatted with println! formatting"); 11 | 12 | // One optional parameter 13 | tcod_print!(root, At(1, 3), Wrap(6, 2), "Simple wrap"); 14 | tcod_print!(root, At(1, 6), Bg(BackgroundFlag::None), "No background flag"); 15 | tcod_print!(root, At(75, 8), Align(TextAlignment::Right), "Right align"); 16 | 17 | 18 | // Two optional parameters. The optional parameters may be given in any order 19 | tcod_print!(root, At(1, 10), Wrap(6, 2), Bg(BackgroundFlag::None), "Bg and wrap"); 20 | tcod_print!(root, At(70, 12), Align(TextAlignment::Right), Wrap(6, 3), "Align and wrap"); 21 | 22 | // Three optional parameters 23 | tcod_print!(root, At(40, 25), Wrap(10, 10), Bg(BackgroundFlag::None), Align(TextAlignment::Center), 24 | "This text is printed with every optional parameter, format: {} {}", "string", 1); 25 | 26 | root.flush(); 27 | root.wait_for_keypress(true); 28 | } 29 | -------------------------------------------------------------------------------- /examples/shapes.rs: -------------------------------------------------------------------------------- 1 | extern crate tcod; 2 | 3 | use tcod::{Console, RootConsole, Color, BackgroundFlag}; 4 | 5 | fn main() { 6 | let mut root = RootConsole::initializer() 7 | .size(80, 50) 8 | .title("Example of libtcod's special chars") 9 | .init(); 10 | 11 | while !root.window_closed() { 12 | root.set_default_background(Color::BLACK); 13 | 14 | root.clear(); 15 | 16 | root.set_default_background(Color{r: 255, g: 0, b: 255}); 17 | 18 | root.rect(5, 5, 10, 5, false, BackgroundFlag::Set); 19 | 20 | root.horizontal_line(30, 2, 15, BackgroundFlag::Default); 21 | root.vertical_line(28, 4, 9, BackgroundFlag::Default); 22 | root.horizontal_line(30, 14, 15, BackgroundFlag::Set); 23 | root.vertical_line(46, 4, 9, BackgroundFlag::Set); 24 | 25 | root.print_frame(15, 25, 35, 10, false, BackgroundFlag::Set, Some("Hello World!")); 26 | 27 | root.flush(); 28 | root.wait_for_keypress(true); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/text.rs: -------------------------------------------------------------------------------- 1 | extern crate tcod; 2 | 3 | use tcod::{Console, RootConsole, BackgroundFlag, TextAlignment}; 4 | 5 | fn main() { 6 | let mut root = RootConsole::initializer().size(80, 50).title("Displaying text").init(); 7 | 8 | root.print_ex(1, 1, BackgroundFlag::None, TextAlignment::Left, 9 | b"Ascii text aligned to left.\xf8"); 10 | root.print_ex(78, 1, BackgroundFlag::None, TextAlignment::Right, 11 | "Unicode text aligned to right.\u{f8}"); 12 | root.print_ex(40, 15, BackgroundFlag::None, TextAlignment::Center, 13 | "And this bit of text is centered."); 14 | root.print_ex(40, 19, BackgroundFlag::None, TextAlignment::Center, 15 | "Press any key to quit."); 16 | 17 | let wrapped_text = "This text is wrapped to form X lines: https://xkcd.com/688/"; 18 | let lines = root.get_height_rect(10, 25, 22, 10, wrapped_text); 19 | root.print_rect(10, 25, 22, 10, wrapped_text.replace("X", &lines.to_string())); 20 | root.flush(); 21 | root.wait_for_keypress(true); 22 | } 23 | -------------------------------------------------------------------------------- /fonts/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains antialiased fonts for libtcod. 2 | These fonts are in public domain. 3 | 4 | The file names are composed with : 5 | __.png 6 | : aa 32 bits png with alpha channel 7 | gs 24 bits or greyscale PNG 8 | : as standard ASCII layout 9 | ro standard ASCII layout in row 10 | tc TCOD layout 11 | 12 | The terminal8x8 font is provided is every possible format as en example. 13 | You can try them with the provided samples : 14 | 15 | ./samples_c -font fonts/terminal8x8_aa_as.png -font-nb-char 16 16 16 | ./samples_c -font fonts/terminal8x8_aa_ro.png -font-nb-char 16 16 -font-in-row 17 | ./samples_c -font fonts/terminal8x8_aa_tc.png -font-nb-char 32 8 -font-tcod 18 | ./samples_c -font fonts/terminal8x8_gs_as.png -font-nb-char 16 16 -font-greyscale 19 | ./samples_c -font fonts/terminal8x8_gs_ro.png -font-nb-char 16 16 -font-greyscale -font-in-row 20 | ./samples_c -font fonts/terminal8x8_gs_tc.png -font-nb-char 32 8 -font-greyscale -font-tcod 21 | 22 | The libtcod 1.3.2 (non antialiased) terminal font is still there and still works : 23 | ./samples_c -font terminal.png -font-nb-char 16 16 24 | 25 | All other fonts are provided only in gs_tc format (greyscale, TCOD layout). 26 | To try them : 27 | 28 | Terminal fonts with different size (you can use them as template to create new fonts) : 29 | ./samples_c -font fonts/terminal7x7_gs_tc.png -font-nb-char 32 8 -font-greyscale -font-tcod 30 | ./samples_c -font fonts/terminal10x10_gs_tc.png -font-nb-char 32 8 -font-greyscale -font-tcod 31 | 32 | Custom fonts : 33 | ./samples_c -font fonts/caeldera8x8_gs_tc.png -font-nb-char 32 8 -font-greyscale -font-tcod 34 | ./samples_c -font fonts/lucida8x8_gs_tc.png -font-nb-char 32 8 -font-greyscale -font-tcod 35 | ./samples_c -font fonts/celtic_garamond_10x10_gs_tc.png -font-nb-char 32 8 -font-greyscale -font-tcod 36 | ./samples_c -font fonts/dundalk12x12_gs_tc.png -font-nb-char 32 8 -font-greyscale -font-tcod 37 | -------------------------------------------------------------------------------- /fonts/arial10x10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/arial10x10.png -------------------------------------------------------------------------------- /fonts/arial12x12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/arial12x12.png -------------------------------------------------------------------------------- /fonts/arial8x8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/arial8x8.png -------------------------------------------------------------------------------- /fonts/caeldera8x8_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/caeldera8x8_gs_tc.png -------------------------------------------------------------------------------- /fonts/celtic_garamond_10x10_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/celtic_garamond_10x10_gs_tc.png -------------------------------------------------------------------------------- /fonts/consolas10x10_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/consolas10x10_gs_tc.png -------------------------------------------------------------------------------- /fonts/consolas12x12_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/consolas12x12_gs_tc.png -------------------------------------------------------------------------------- /fonts/consolas8x8_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/consolas8x8_gs_tc.png -------------------------------------------------------------------------------- /fonts/consolas_unicode_10x10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/consolas_unicode_10x10.png -------------------------------------------------------------------------------- /fonts/consolas_unicode_12x12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/consolas_unicode_12x12.png -------------------------------------------------------------------------------- /fonts/consolas_unicode_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/consolas_unicode_16x16.png -------------------------------------------------------------------------------- /fonts/consolas_unicode_8x8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/consolas_unicode_8x8.png -------------------------------------------------------------------------------- /fonts/courier10x10_aa_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/courier10x10_aa_tc.png -------------------------------------------------------------------------------- /fonts/courier12x12_aa_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/courier12x12_aa_tc.png -------------------------------------------------------------------------------- /fonts/courier8x8_aa_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/courier8x8_aa_tc.png -------------------------------------------------------------------------------- /fonts/dejavu10x10_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/dejavu10x10_gs_tc.png -------------------------------------------------------------------------------- /fonts/dejavu12x12_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/dejavu12x12_gs_tc.png -------------------------------------------------------------------------------- /fonts/dejavu16x16_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/dejavu16x16_gs_tc.png -------------------------------------------------------------------------------- /fonts/dejavu8x8_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/dejavu8x8_gs_tc.png -------------------------------------------------------------------------------- /fonts/dejavu_wide12x12_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/dejavu_wide12x12_gs_tc.png -------------------------------------------------------------------------------- /fonts/dejavu_wide16x16_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/dejavu_wide16x16_gs_tc.png -------------------------------------------------------------------------------- /fonts/dundalk12x12_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/dundalk12x12_gs_tc.png -------------------------------------------------------------------------------- /fonts/lucida10x10_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/lucida10x10_gs_tc.png -------------------------------------------------------------------------------- /fonts/lucida12x12_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/lucida12x12_gs_tc.png -------------------------------------------------------------------------------- /fonts/lucida8x8_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/lucida8x8_gs_tc.png -------------------------------------------------------------------------------- /fonts/prestige10x10_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/prestige10x10_gs_tc.png -------------------------------------------------------------------------------- /fonts/prestige12x12_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/prestige12x12_gs_tc.png -------------------------------------------------------------------------------- /fonts/prestige8x8_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/prestige8x8_gs_tc.png -------------------------------------------------------------------------------- /fonts/terminal10x10_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal10x10_gs_tc.png -------------------------------------------------------------------------------- /fonts/terminal10x16_gs_ro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal10x16_gs_ro.png -------------------------------------------------------------------------------- /fonts/terminal10x16_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal10x16_gs_tc.png -------------------------------------------------------------------------------- /fonts/terminal10x18_gs_ro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal10x18_gs_ro.png -------------------------------------------------------------------------------- /fonts/terminal12x12_gs_ro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal12x12_gs_ro.png -------------------------------------------------------------------------------- /fonts/terminal16x16_gs_ro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal16x16_gs_ro.png -------------------------------------------------------------------------------- /fonts/terminal7x7_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal7x7_gs_tc.png -------------------------------------------------------------------------------- /fonts/terminal8x12_gs_ro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal8x12_gs_ro.png -------------------------------------------------------------------------------- /fonts/terminal8x12_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal8x12_gs_tc.png -------------------------------------------------------------------------------- /fonts/terminal8x14_gs_ro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal8x14_gs_ro.png -------------------------------------------------------------------------------- /fonts/terminal8x8_aa_as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal8x8_aa_as.png -------------------------------------------------------------------------------- /fonts/terminal8x8_aa_ro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal8x8_aa_ro.png -------------------------------------------------------------------------------- /fonts/terminal8x8_aa_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal8x8_aa_tc.png -------------------------------------------------------------------------------- /fonts/terminal8x8_gs_as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal8x8_gs_as.png -------------------------------------------------------------------------------- /fonts/terminal8x8_gs_ro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal8x8_gs_ro.png -------------------------------------------------------------------------------- /fonts/terminal8x8_gs_tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/fonts/terminal8x8_gs_tc.png -------------------------------------------------------------------------------- /precompiled/i686-pc-windows-gnu/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/precompiled/i686-pc-windows-gnu/.gitkeep -------------------------------------------------------------------------------- /precompiled/i686-unknown-linux-gnu/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/precompiled/i686-unknown-linux-gnu/.gitkeep -------------------------------------------------------------------------------- /precompiled/x86_64-unknown-linux-gnu/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/precompiled/x86_64-unknown-linux-gnu/.gitkeep -------------------------------------------------------------------------------- /src/bindings.rs: -------------------------------------------------------------------------------- 1 | pub extern crate tcod_sys as ffi; 2 | 3 | pub use std::ffi::{CStr, CString}; 4 | pub use std::os::raw::{c_char, c_int, c_float, c_uint, c_void, c_uchar}; 5 | 6 | use std::mem::transmute; 7 | use super::input::KeyCode; 8 | 9 | #[allow(non_camel_case_types)] 10 | pub type c_bool = c_uchar; 11 | 12 | pub trait AsNative { 13 | unsafe fn as_native(&self) -> &T; 14 | unsafe fn as_native_mut(&mut self) -> &mut T; 15 | } 16 | 17 | pub trait FromNative { 18 | unsafe fn from_native(input: T) -> Self; 19 | } 20 | 21 | impl<'a, T, U: AsNative + ?Sized> AsNative for &'a U { 22 | unsafe fn as_native(&self) -> &T { 23 | (**self).as_native() 24 | } 25 | 26 | unsafe fn as_native_mut(&mut self) -> &mut T { 27 | unimplemented!(); 28 | } 29 | } 30 | 31 | impl + ?Sized> AsNative for Box { 32 | unsafe fn as_native(&self) -> &T { 33 | (**self).as_native() 34 | } 35 | 36 | unsafe fn as_native_mut(&mut self) -> &mut T { 37 | (**self).as_native_mut() 38 | } 39 | } 40 | 41 | pub fn keycode_from_native(input: self::ffi::TCOD_keycode_t) -> Option { 42 | match input as u32 { 43 | x @ 0 ..= 66 => Some(unsafe { transmute(x) }), 44 | _ => None 45 | } 46 | } 47 | 48 | #[test] 49 | fn test_keycodes() { 50 | assert!(keycode_from_native(self::ffi::TCOD_keycode_t::TCODK_NONE).unwrap() == KeyCode::NoKey); 51 | assert!(keycode_from_native(self::ffi::TCOD_keycode_t::TCODK_6).unwrap() == KeyCode::Number6); 52 | assert!(keycode_from_native(self::ffi::TCOD_keycode_t::TCODK_TEXT).unwrap() == KeyCode::Text); 53 | } 54 | -------------------------------------------------------------------------------- /src/chars.rs: -------------------------------------------------------------------------------- 1 | pub const HLINE: char = '\u{c4}'; 2 | pub const VLINE: char = '\u{b3}'; 3 | pub const NE: char = '\u{bf}'; 4 | pub const NW: char = '\u{da}'; 5 | pub const SE: char = '\u{d9}'; 6 | pub const SW: char = '\u{c0}'; 7 | pub const TEEW: char = '\u{b4}'; 8 | pub const TEEE: char = '\u{c3}'; 9 | pub const TEEN: char = '\u{c1}'; 10 | pub const TEES: char = '\u{c2}'; 11 | pub const CROSS: char = '\u{c5}'; 12 | pub const DHLINE: char = '\u{cd}'; 13 | pub const DVLINE: char = '\u{ba}'; 14 | pub const DNE: char = '\u{bb}'; 15 | pub const DNW: char = '\u{c9}'; 16 | pub const DSE: char = '\u{bc}'; 17 | pub const DSW: char = '\u{c8}'; 18 | pub const DTEEW: char = '\u{b9}'; 19 | pub const DTEEE: char = '\u{cc}'; 20 | pub const DTEEN: char = '\u{ca}'; 21 | pub const DTEES: char = '\u{cb}'; 22 | pub const DCROSS: char = '\u{ce}'; 23 | pub const BLOCK1: char = '\u{b0}'; 24 | pub const BLOCK2: char = '\u{b1}'; 25 | pub const BLOCK3: char = '\u{b2}'; 26 | pub const ARROW_N: char = '\u{18}'; 27 | pub const ARROW_S: char = '\u{19}'; 28 | pub const ARROW_E: char = '\u{1a}'; 29 | pub const ARROW_W: char = '\u{1b}'; 30 | pub const ARROW2_N: char = '\u{1e}'; 31 | pub const ARROW2_S: char = '\u{1f}'; 32 | pub const ARROW2_E: char = '\u{10}'; 33 | pub const ARROW2_W: char = '\u{11}'; 34 | pub const DARROW_H: char = '\u{1d}'; 35 | pub const DARROW_V: char = '\u{12}'; 36 | pub const CHECKBOX_UNSET: char = '\u{e0}'; 37 | pub const CHECKBOX_SET: char = '\u{e1}'; 38 | pub const RADIO_UNSET: char = '\u{09}'; 39 | pub const RADIO_SET: char = '\u{0a}'; 40 | pub const SUBP_NW: char = '\u{e2}'; 41 | pub const SUBP_NE: char = '\u{e3}'; 42 | pub const SUBP_N: char = '\u{e4}'; 43 | pub const SUBP_SE: char = '\u{e5}'; 44 | pub const SUBP_DIAG: char = '\u{e6}'; 45 | pub const SUBP_E: char = '\u{e7}'; 46 | pub const SUBP_SW: char = '\u{e8}'; 47 | pub const SMILIE: char = '\u{01}'; 48 | pub const SMILIE_INV: char = '\u{02}'; 49 | pub const HEART: char = '\u{03}'; 50 | pub const DIAMOND: char = '\u{04}'; 51 | pub const CLUB: char = '\u{05}'; 52 | pub const SPADE: char = '\u{06}'; 53 | pub const BULLET: char = '\u{07}'; 54 | pub const BULLET_INV: char = '\u{08}'; 55 | pub const MALE: char = '\u{0b}'; 56 | pub const FEMALE: char = '\u{0c}'; 57 | pub const NOTE: char = '\u{0d}'; 58 | pub const NOTE_DOUBLE: char = '\u{0e}'; 59 | pub const LIGHT: char = '\u{0f}'; 60 | pub const EXCLAM_DOUBLE: char = '\u{13}'; 61 | pub const PILCROW: char = '\u{14}'; 62 | pub const SECTION: char = '\u{15}'; 63 | pub const POUND: char = '\u{9c}'; 64 | pub const MULTIPLICATION: char = '\u{9e}'; 65 | pub const FUNCTION: char = '\u{9f}'; 66 | pub const RESERVED: char = '\u{a9}'; 67 | pub const HALF: char = '\u{ab}'; 68 | pub const ONE_QUARTER: char = '\u{ac}'; 69 | pub const COPYRIGHT: char = '\u{b8}'; 70 | pub const CENT: char = '\u{bd}'; 71 | pub const YEN: char = '\u{be}'; 72 | pub const CURRENCY: char = '\u{cf}'; 73 | pub const THREE_QUARTERS: char = '\u{f3}'; 74 | pub const DIVISION: char = '\u{f6}'; 75 | pub const GRADE: char = '\u{f8}'; 76 | pub const UMLAUT: char = '\u{f9}'; 77 | pub const POW1: char = '\u{fb}'; 78 | pub const POW3: char = '\u{fc}'; 79 | pub const POW2: char = '\u{fd}'; 80 | pub const BULLET_SQUARE: char = '\u{fe}'; 81 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | //! libtcod bindings for Rust 2 | //! 3 | //! ## Description 4 | //! [libtcod a.k.a. "The Doryen Library"](http://roguecentral.org/doryen/libtcod/) is a 5 | //! free, fast, portable and uncomplicated API for roguelike developpers providing lots of 6 | //! useful functions, such as: 7 | //! 8 | //! * Text-based graphics API 9 | //! * Colors 10 | //! * Keyboard and mouse input 11 | //! * Path finding 12 | //! * Field of View 13 | //! * Portability (works on Windows, Linux and OS X) 14 | //! 15 | //! For the full set of features see the [libtcod features page](http://roguecentral.org/doryen/libtcod/features/). 16 | //! 17 | //! All raw bindings are available via the `tcod-sys` crate, however the `tcod-rs` library aims to 18 | //! provide safe, Rust-style wrappers for most of `libtcod`. These wrappers are not yet complete, 19 | //! however. 20 | //! 21 | //! ### Features already implemented: 22 | //! 23 | //! * Colors 24 | //! * Console 25 | //! * Most of the System layer 26 | //! * Field of View 27 | //! * Map 28 | //! * Pathfinding 29 | //! * Line toolkit 30 | //! * Noise 31 | //! * BSP Toolkit 32 | //! 33 | //! ### Features that are not planned to be implemented: 34 | //! This are features that Rust already provides a good (and in most casese more idiomatic) 35 | //! solution for: 36 | //! 37 | //! * Filesystem utilities 38 | //! * Containers 39 | //! * Pseudorandom generators 40 | //! * Compression utilities 41 | //! 42 | 43 | #[macro_use] extern crate bitflags; 44 | #[macro_use] extern crate lazy_static; 45 | #[cfg(feature = "rustc-serialize")] extern crate rustc_serialize; 46 | #[cfg(feature = "serialization")] extern crate serde; 47 | #[macro_use] 48 | #[cfg(feature = "serialization")] extern crate serde_derive; 49 | 50 | #[cfg(test)] extern crate serde_json; 51 | 52 | #[macro_use] 53 | mod macros; 54 | 55 | pub use bindings::{AsNative, FromNative}; 56 | pub use colors::Color; 57 | pub use console::{Console, RootInitializer, BackgroundFlag, Renderer, FontLayout, FontType, TextAlignment}; 58 | pub use map::Map; 59 | 60 | pub mod bsp; 61 | pub mod chars; 62 | pub mod colors; 63 | pub mod console; 64 | pub mod heightmap; 65 | pub mod image; 66 | pub mod input; 67 | pub mod line; 68 | pub mod map; 69 | pub mod namegen; 70 | pub mod noise; 71 | pub mod pathfinding; 72 | pub mod random; 73 | pub mod system; 74 | 75 | mod bindings; 76 | #[macro_use] 77 | mod console_macros; 78 | #[cfg(feature = "rustc-serialize")] 79 | mod rustc_serialize_impls; 80 | 81 | pub type RootConsole = console::Root; 82 | pub type OffscreenConsole = console::Offscreen; 83 | -------------------------------------------------------------------------------- /src/macros.rs: -------------------------------------------------------------------------------- 1 | macro_rules! native_enum_convert { 2 | ($From: ident, $To: ident) => { 3 | impl From<$From> for $To { 4 | fn from(other: $From) -> $To { 5 | unsafe { 6 | ::std::mem::transmute::<$From, $To>(other) 7 | } 8 | } 9 | } 10 | }; 11 | } -------------------------------------------------------------------------------- /src/rustc_serialize_impls.rs: -------------------------------------------------------------------------------- 1 | use super::Color; 2 | use rustc_serialize::{Encodable, Encoder, Decodable, Decoder}; 3 | 4 | impl Encodable for Color { 5 | fn encode(&self, s: &mut S) -> Result<(), S::Error> { 6 | s.emit_struct("Color", 3, |s| { 7 | try!{ s.emit_struct_field("r", 0, |s| self.r.encode(s)) }; 8 | try!{ s.emit_struct_field("g", 1, |s| self.g.encode(s)) }; 9 | try!{ s.emit_struct_field("b", 2, |s| self.b.encode(s)) }; 10 | Ok(()) 11 | }) 12 | } 13 | } 14 | 15 | #[cfg(feature = "rustc-serialize")] 16 | impl Decodable for Color { 17 | fn decode(d: &mut D) -> Result { 18 | d.read_struct("Color", 3, |d| { 19 | let r = try!(d.read_struct_field("r", 0, |d| d.read_u8())); 20 | let g = try!(d.read_struct_field("g", 1, |d| d.read_u8())); 21 | let b = try!(d.read_struct_field("b", 2, |d| d.read_u8())); 22 | Ok(Color{r: r, g: g, b: b}) 23 | }) 24 | } 25 | } 26 | 27 | 28 | 29 | #[cfg(test)] 30 | mod test { 31 | use ::Color; 32 | use ::rustc_serialize::json; 33 | 34 | #[test] 35 | fn color_encode() { 36 | let encoded = json::encode(&Color{r: 1, g: 2, b: 3}).unwrap(); 37 | assert_eq!("{\"r\":1,\"g\":2,\"b\":3}", encoded); 38 | } 39 | 40 | #[test] 41 | fn color_decode() { 42 | let decoded: Color = json::decode("{\"r\":1,\"g\":2,\"b\":3}").unwrap(); 43 | assert_eq!(Color{r: 1, g: 2, b: 3}, decoded); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/system.rs: -------------------------------------------------------------------------------- 1 | use std::str; 2 | use std::ptr; 3 | use std::time::Duration; 4 | 5 | use std::ffi::{CStr, CString}; 6 | use std::path::Path; 7 | use bindings::ffi; 8 | 9 | pub fn set_fps(fps: i32) { 10 | assert!(fps >= 0); 11 | unsafe { 12 | ffi::TCOD_sys_set_fps(fps) 13 | } 14 | } 15 | 16 | pub fn get_fps() -> i32 { 17 | let result = unsafe { 18 | ffi::TCOD_sys_get_fps() 19 | }; 20 | assert!(result >= 0); 21 | result 22 | } 23 | 24 | pub fn get_last_frame_length() -> f32 { 25 | unsafe { 26 | ffi::TCOD_sys_get_last_frame_length() 27 | } 28 | } 29 | 30 | pub fn sleep(time: Duration) { 31 | let duration_ms = (time.as_secs() * 1000) as u32 + (time.subsec_nanos() / 1_000_000); 32 | unsafe { 33 | ffi::TCOD_sys_sleep_milli(duration_ms); 34 | } 35 | } 36 | 37 | pub fn get_elapsed_time() -> Duration { 38 | let ms: u32 = unsafe { 39 | ffi::TCOD_sys_elapsed_milli() 40 | }; 41 | Duration::from_millis(ms as u64) 42 | } 43 | 44 | pub fn save_screenshot

(path: P) where P: AsRef { 45 | let filename = path.as_ref().to_str().expect("Invalid screenshot path"); 46 | let c_path = CString::new(filename).unwrap(); 47 | unsafe { 48 | ffi::TCOD_sys_save_screenshot(c_path.as_ptr()); 49 | } 50 | } 51 | 52 | pub fn save_screenshot_auto() { 53 | unsafe { 54 | ffi::TCOD_sys_save_screenshot(ptr::null()); 55 | } 56 | } 57 | 58 | pub fn force_fullscreen_resolution(width: i32, height: i32) { 59 | assert!(width > 0 && height > 0); 60 | unsafe { 61 | ffi::TCOD_sys_force_fullscreen_resolution(width, height); 62 | } 63 | } 64 | 65 | pub fn get_current_resolution() -> (i32, i32) { 66 | let mut width: i32 = 0; 67 | let mut height: i32 = 0; 68 | unsafe { 69 | ffi::TCOD_sys_get_current_resolution(&mut width, &mut height); 70 | } 71 | (width, height) 72 | } 73 | 74 | pub fn get_fullscreen_offset() -> (i32, i32) { 75 | let mut x: i32 = 0; 76 | let mut y: i32 = 0; 77 | unsafe { 78 | ffi::TCOD_sys_get_fullscreen_offsets(&mut x, &mut y); 79 | } 80 | (x, y) 81 | } 82 | 83 | pub fn get_char_size() -> (i32, i32) { 84 | let mut width: i32 = 0; 85 | let mut height: i32 = 0; 86 | unsafe { 87 | ffi::TCOD_sys_get_char_size(&mut width, &mut height); 88 | } 89 | (width, height) 90 | } 91 | 92 | pub fn set_clipboard(value: T) where T: AsRef { 93 | let c_str = CString::new(value.as_ref().as_bytes()).unwrap(); 94 | unsafe { 95 | ffi::TCOD_sys_clipboard_set(c_str.as_ptr()); 96 | } 97 | } 98 | 99 | pub fn get_clipboard() -> String { 100 | unsafe { 101 | let c_ptr = ffi::TCOD_sys_clipboard_get(); 102 | let c_str = CStr::from_ptr(c_ptr).to_bytes(); 103 | str::from_utf8(c_str).unwrap().to_owned() 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /tcod_sys/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tcod-sys" 3 | description = "Raw FFI bindings & build script to link against libtcod." 4 | version = "5.0.1" 5 | license = "WTFPL" 6 | homepage = "https://github.com/tomassedovic/tcod-rs" 7 | repository = "https://github.com/tomassedovic/tcod-rs/tree/master/tcod-sys" 8 | authors = ["tomas@sedovic.cz"] 9 | links = "tcod" 10 | build = "build.rs" 11 | exclude = [ 12 | "libtcod/lib/libz.a" 13 | ] 14 | 15 | [lib] 16 | name = "tcod_sys" 17 | path = "lib.rs" 18 | 19 | [features] 20 | dynlib = [] 21 | 22 | [build-dependencies] 23 | cc = "1.0" 24 | pkg-config = "0.3" 25 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/LIBTCOD-CREDITS.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/LIBTCOD-CREDITS.txt -------------------------------------------------------------------------------- /tcod_sys/libtcod/LIBTCOD-LICENSE.txt: -------------------------------------------------------------------------------- 1 | * libtcod 1.6.3 2 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 3 | * All rights reserved. 4 | * 5 | * libtcod 'The Doryen library' is a cross-platform C/C++ library for roguelike 6 | * developers. 7 | * Its source code is available from : 8 | * http://doryen.eptalys.net/libtcod 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * * Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * * The name of Jice or Mingos may not be used to endorse or promote products 18 | * derived from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``AS IS'' AND ANY 21 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL JICE OR MINGOS BE LIABLE FOR ANY 24 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/README-linux-SDL2.md: -------------------------------------------------------------------------------- 1 | Building Libtcod 1.6 on Linux with SDL2 2 | ======================================= 3 | 4 | The following instructions have been tested on 32 and 64-bit versions of Ubuntu 14.04 and Fedora 22. 5 | 6 | Dependencies 7 | ------------ 8 | 9 | For Ubuntu 14.04, install these dependencies: 10 | 11 | $ sudo apt-get install curl build-essential make cmake autoconf automake libtool mercurial libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev 12 | 13 | For Fedora 22: 14 | 15 | $ sudo dnf -v groupinstall "C Development Tools and Libraries" 16 | $ sudo dnf install mercurial alsa-lib-devel audiofile-devel mesa-libGL-devel mesa-libGLU-devel mesa-libEGL-devel mesa-libGLES-devel libXext-devel libX11-devel libXi-devel libXrandr-devel libXrender-devel dbus-devel libXScrnSaver-devel libusb-devel pulseaudio-libs-devel libXinerama-devel libXcursor-devel systemd-devel 17 | 18 | 19 | Building SDL2 20 | ------------- 21 | 22 | It is recommended strongly that you install SDL2 using your package manager. However, if you are unable to work out the package name, then you can take the harder route and build it yourself. 23 | 24 | Download the supported SDL2 revision, build and install it if you must: 25 | 26 | $ curl -o sdl.tar.gz http://hg.libsdl.org/SDL/archive/007dfe83abf8.tar.gz 27 | $ tar -xf sdl.tar.gz 28 | $ cd SDL-007dfe83abf8/ 29 | $ mkdir -p build 30 | $ cd build 31 | $ ../configure 32 | $ make 33 | $ sudo make install 34 | 35 | This will place the libraries at `/usr/local/lib/` and the development headers at `/usr/local/include/SDL2/`. 36 | 37 | 38 | Building Libtcod 1.6 39 | -------------------- 40 | Download the latest libtcod version, build it and install it: 41 | 42 | $ hg clone https://bitbucket.org/libtcod/libtcod 43 | $ cd libtcod/build/autotools 44 | $ autoreconf -i # if building from hg 45 | $ ./configure CFLAGS='-O2' 46 | $ make 47 | 48 | This will place the libraries in the top level of the libtcod checkout directory. 49 | 50 | Note that the same makefile is used for 32 and 64 bit distributions. 51 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/BUGS.txt: -------------------------------------------------------------------------------- 1 | 2 | Bugs are now managed in the SDL bug tracker, here: 3 | 4 | https://bugzilla.libsdl.org/ 5 | 6 | You may report bugs there, and search to see if a given issue has already 7 | been reported, discussed, and maybe even fixed. 8 | 9 | 10 | You may also find help at the SDL forums/mailing list: 11 | 12 | https://discourse.libsdl.org/ 13 | 14 | Bug reports are welcome here, but we really appreciate if you use Bugzilla, as 15 | bugs discussed on the mailing list may be forgotten or missed. 16 | 17 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/COPYING.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/CREDITS.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer CREDITS 3 | Thanks to everyone who made this possible, including: 4 | 5 | * Cliff Matthews, for giving me a reason to start this project. :) 6 | -- Executor rocks! *grin* 7 | 8 | * Ryan Gordon for helping everybody out and keeping the dream alive. :) 9 | 10 | * Gabriel Jacobo for his work on the Android port and generally helping out all around. 11 | 12 | * Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches. 13 | 14 | * Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code. 15 | 16 | * Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve. 17 | 18 | * Alfred Reynolds for the game controller API and general (in)sanity 19 | 20 | * Jørgen Tjernø for numerous magical Mac OS X fixes. 21 | 22 | * Pierre-Loup Griffais for his deep knowledge of OpenGL drivers. 23 | 24 | * Julian Winter for the SDL 2.0 website. 25 | 26 | * Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides. 27 | 28 | * Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010. 29 | 30 | * Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010. 31 | 32 | * Jim Grandpre for his work on multi-touch and gesture recognition during 33 | the Google Summer of Code 2010. 34 | 35 | * Edgar "bobbens" Simo for his force feedback API development during the 36 | Google Summer of Code 2008. 37 | 38 | * Aaron Wishnick for his work on audio resampling and pitch shifting during 39 | the Google Summer of Code 2008. 40 | 41 | * Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the 42 | Google Summer of Code 2008. 43 | 44 | * Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation. 45 | 46 | * Everybody at Loki Software, Inc. for their great contributions! 47 | 48 | And a big hand to everyone else who has contributed over the years. 49 | 50 | THANKS! :) 51 | 52 | -- Sam Lantinga 53 | 54 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/README-SDL.txt: -------------------------------------------------------------------------------- 1 | 2 | Please distribute this file with the SDL runtime environment: 3 | 4 | The Simple DirectMedia Layer (SDL for short) is a cross-platform library 5 | designed to make it easy to write multi-media software, such as games 6 | and emulators. 7 | 8 | The Simple DirectMedia Layer library source code is available from: 9 | https://www.libsdl.org/ 10 | 11 | This library is distributed under the terms of the zlib license: 12 | http://www.zlib.net/zlib_license.html 13 | 14 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | 4 | (SDL) 5 | 6 | Version 2.0 7 | 8 | --- 9 | https://www.libsdl.org/ 10 | 11 | Simple DirectMedia Layer is a cross-platform development library designed 12 | to provide low level access to audio, keyboard, mouse, joystick, and graphics 13 | hardware via OpenGL and Direct3D. It is used by video playback software, 14 | emulators, and popular games including Valve's award winning catalog 15 | and many Humble Bundle games. 16 | 17 | More extensive documentation is available in the docs directory, starting 18 | with README.md 19 | 20 | Enjoy! 21 | Sam Lantinga (slouken@libsdl.org) 22 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_clipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_clipboard.h 24 | * 25 | * Include file for SDL clipboard handling 26 | */ 27 | 28 | #ifndef SDL_clipboard_h_ 29 | #define SDL_clipboard_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | /** 42 | * \brief Put UTF-8 text into the clipboard 43 | * 44 | * \sa SDL_GetClipboardText() 45 | */ 46 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); 47 | 48 | /** 49 | * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() 50 | * 51 | * \sa SDL_SetClipboardText() 52 | */ 53 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); 54 | 55 | /** 56 | * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty 57 | * 58 | * \sa SDL_GetClipboardText() 59 | */ 60 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); 61 | 62 | 63 | /* Ends C function definitions when using C++ */ 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | #include "close_code.h" 68 | 69 | #endif /* SDL_clipboard_h_ */ 70 | 71 | /* vi: set ts=4 sw=4 expandtab: */ 72 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_error.h 24 | * 25 | * Simple error message routines for SDL. 26 | */ 27 | 28 | #ifndef SDL_error_h_ 29 | #define SDL_error_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Public functions */ 40 | /* SDL_SetError() unconditionally returns -1. */ 41 | extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 42 | extern DECLSPEC const char *SDLCALL SDL_GetError(void); 43 | extern DECLSPEC void SDLCALL SDL_ClearError(void); 44 | 45 | /** 46 | * \name Internal error functions 47 | * 48 | * \internal 49 | * Private error reporting function - used internally. 50 | */ 51 | /* @{ */ 52 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) 53 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) 54 | #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) 55 | typedef enum 56 | { 57 | SDL_ENOMEM, 58 | SDL_EFREAD, 59 | SDL_EFWRITE, 60 | SDL_EFSEEK, 61 | SDL_UNSUPPORTED, 62 | SDL_LASTERROR 63 | } SDL_errorcode; 64 | /* SDL_Error() unconditionally returns -1. */ 65 | extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); 66 | /* @} *//* Internal error functions */ 67 | 68 | /* Ends C function definitions when using C++ */ 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | #include "close_code.h" 73 | 74 | #endif /* SDL_error_h_ */ 75 | 76 | /* vi: set ts=4 sw=4 expandtab: */ 77 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_gesture.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_gesture.h 24 | * 25 | * Include file for SDL gesture event handling. 26 | */ 27 | 28 | #ifndef SDL_gesture_h_ 29 | #define SDL_gesture_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "SDL_touch.h" 36 | 37 | 38 | #include "begin_code.h" 39 | /* Set up for C function definitions, even when using C++ */ 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef Sint64 SDL_GestureID; 45 | 46 | /* Function prototypes */ 47 | 48 | /** 49 | * \brief Begin Recording a gesture on the specified touch, or all touches (-1) 50 | * 51 | * 52 | */ 53 | extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); 54 | 55 | 56 | /** 57 | * \brief Save all currently loaded Dollar Gesture templates 58 | * 59 | * 60 | */ 61 | extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); 62 | 63 | /** 64 | * \brief Save a currently loaded Dollar Gesture template 65 | * 66 | * 67 | */ 68 | extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); 69 | 70 | 71 | /** 72 | * \brief Load Dollar Gesture templates from a file 73 | * 74 | * 75 | */ 76 | extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); 77 | 78 | 79 | /* Ends C function definitions when using C++ */ 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #include "close_code.h" 84 | 85 | #endif /* SDL_gesture_h_ */ 86 | 87 | /* vi: set ts=4 sw=4 expandtab: */ 88 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_loadso.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_loadso.h 24 | * 25 | * System dependent library loading routines 26 | * 27 | * Some things to keep in mind: 28 | * \li These functions only work on C function names. Other languages may 29 | * have name mangling and intrinsic language support that varies from 30 | * compiler to compiler. 31 | * \li Make sure you declare your function pointers with the same calling 32 | * convention as the actual library function. Your code will crash 33 | * mysteriously if you do not do this. 34 | * \li Avoid namespace collisions. If you load a symbol from the library, 35 | * it is not defined whether or not it goes into the global symbol 36 | * namespace for the application. If it does and it conflicts with 37 | * symbols in your code or other shared libraries, you will not get 38 | * the results you expect. :) 39 | */ 40 | 41 | #ifndef SDL_loadso_h_ 42 | #define SDL_loadso_h_ 43 | 44 | #include "SDL_stdinc.h" 45 | #include "SDL_error.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /** 54 | * This function dynamically loads a shared object and returns a pointer 55 | * to the object handle (or NULL if there was an error). 56 | * The 'sofile' parameter is a system dependent name of the object file. 57 | */ 58 | extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); 59 | 60 | /** 61 | * Given an object handle, this function looks up the address of the 62 | * named function in the shared object and returns it. This address 63 | * is no longer valid after calling SDL_UnloadObject(). 64 | */ 65 | extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, 66 | const char *name); 67 | 68 | /** 69 | * Unload a shared object from memory. 70 | */ 71 | extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); 72 | 73 | /* Ends C function definitions when using C++ */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | #include "close_code.h" 78 | 79 | #endif /* SDL_loadso_h_ */ 80 | 81 | /* vi: set ts=4 sw=4 expandtab: */ 82 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDLname_h_ 23 | #define SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifdef __IPHONEOS__ 30 | #include 31 | #include 32 | #else 33 | #include 34 | #include 35 | #endif 36 | 37 | #ifndef APIENTRY 38 | #define APIENTRY 39 | #endif 40 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles2.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifndef _MSC_VER 30 | 31 | #ifdef __IPHONEOS__ 32 | #include 33 | #include 34 | #else 35 | #include 36 | #include 37 | #include 38 | #endif 39 | 40 | #else /* _MSC_VER */ 41 | 42 | /* OpenGL ES2 headers for Visual Studio */ 43 | #include "SDL_opengles2_khrplatform.h" 44 | #include "SDL_opengles2_gl2platform.h" 45 | #include "SDL_opengles2_gl2.h" 46 | #include "SDL_opengles2_gl2ext.h" 47 | 48 | #endif /* _MSC_VER */ 49 | 50 | #ifndef APIENTRY 51 | #define APIENTRY GL_APIENTRY 52 | #endif 53 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | /*#include */ 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_power.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_power_h_ 23 | #define SDL_power_h_ 24 | 25 | /** 26 | * \file SDL_power.h 27 | * 28 | * Header for the SDL power management routines. 29 | */ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \brief The basic state for the system's power supply. 41 | */ 42 | typedef enum 43 | { 44 | SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ 45 | SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ 46 | SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ 47 | SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ 48 | SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ 49 | } SDL_PowerState; 50 | 51 | 52 | /** 53 | * \brief Get the current power supply details. 54 | * 55 | * \param secs Seconds of battery life left. You can pass a NULL here if 56 | * you don't care. Will return -1 if we can't determine a 57 | * value, or we're not running on a battery. 58 | * 59 | * \param pct Percentage of battery life left, between 0 and 100. You can 60 | * pass a NULL here if you don't care. Will return -1 if we 61 | * can't determine a value, or we're not running on a battery. 62 | * 63 | * \return The state of the battery (if any). 64 | */ 65 | extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); 66 | 67 | /* Ends C function definitions when using C++ */ 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | #include "close_code.h" 72 | 73 | #endif /* SDL_power_h_ */ 74 | 75 | /* vi: set ts=4 sw=4 expandtab: */ 76 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_quit.h 24 | * 25 | * Include file for SDL quit event handling. 26 | */ 27 | 28 | #ifndef SDL_quit_h_ 29 | #define SDL_quit_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | /** 35 | * \file SDL_quit.h 36 | * 37 | * An ::SDL_QUIT event is generated when the user tries to close the application 38 | * window. If it is ignored or filtered out, the window will remain open. 39 | * If it is not ignored or filtered, it is queued normally and the window 40 | * is allowed to close. When the window is closed, screen updates will 41 | * complete, but have no effect. 42 | * 43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 44 | * and SIGTERM (system termination request), if handlers do not already 45 | * exist, that generate ::SDL_QUIT events as well. There is no way 46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal 47 | * handler in your application will override the default generation of 48 | * quit events for that signal. 49 | * 50 | * \sa SDL_Quit() 51 | */ 52 | 53 | /* There are no functions directly affecting the quit event */ 54 | 55 | #define SDL_QuitRequested() \ 56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) 57 | 58 | #endif /* SDL_quit_h_ */ 59 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "hg-11645:2088cd828335" 2 | #define SDL_REVISION_NUMBER 11645 3 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_h_ 31 | #define SDL_test_h_ 32 | 33 | #include "SDL.h" 34 | #include "SDL_test_assert.h" 35 | #include "SDL_test_common.h" 36 | #include "SDL_test_compare.h" 37 | #include "SDL_test_crc32.h" 38 | #include "SDL_test_font.h" 39 | #include "SDL_test_fuzzer.h" 40 | #include "SDL_test_harness.h" 41 | #include "SDL_test_images.h" 42 | #include "SDL_test_log.h" 43 | #include "SDL_test_md5.h" 44 | #include "SDL_test_memory.h" 45 | #include "SDL_test_random.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /* Global definitions */ 54 | 55 | /* 56 | * Note: Maximum size of SDLTest log message is less than SDL's limit 57 | * to ensure we can fit additional information such as the timestamp. 58 | */ 59 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_test_compare.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_compare.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines comparison functions (i.e. for surfaces). 33 | 34 | */ 35 | 36 | #ifndef SDL_test_compare_h_ 37 | #define SDL_test_compare_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "SDL_test_images.h" 42 | 43 | #include "begin_code.h" 44 | /* Set up for C function definitions, even when using C++ */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * \brief Compares a surface and with reference image data for equality 51 | * 52 | * \param surface Surface used in comparison 53 | * \param referenceSurface Test Surface used in comparison 54 | * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. 55 | * 56 | * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. 57 | */ 58 | int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); 59 | 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_compare_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_test_font.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_font.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_font_h_ 31 | #define SDL_test_font_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | #define FONT_CHARACTER_SIZE 8 42 | 43 | /** 44 | * \brief Draw a string in the currently set font. 45 | * 46 | * \param renderer The renderer to draw on. 47 | * \param x The X coordinate of the upper left corner of the character. 48 | * \param y The Y coordinate of the upper left corner of the character. 49 | * \param c The character to draw. 50 | * 51 | * \returns Returns 0 on success, -1 on failure. 52 | */ 53 | int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c); 54 | 55 | /** 56 | * \brief Draw a string in the currently set font. 57 | * 58 | * \param renderer The renderer to draw on. 59 | * \param x The X coordinate of the upper left corner of the string. 60 | * \param y The Y coordinate of the upper left corner of the string. 61 | * \param s The string to draw. 62 | * 63 | * \returns Returns 0 on success, -1 on failure. 64 | */ 65 | int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s); 66 | 67 | 68 | /** 69 | * \brief Cleanup textures used by font drawing functions. 70 | */ 71 | void SDLTest_CleanupTextDrawing(void); 72 | 73 | /* Ends C function definitions when using C++ */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | #include "close_code.h" 78 | 79 | #endif /* SDL_test_font_h_ */ 80 | 81 | /* vi: set ts=4 sw=4 expandtab: */ 82 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_test_images.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_images.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines some images for tests. 33 | 34 | */ 35 | 36 | #ifndef SDL_test_images_h_ 37 | #define SDL_test_images_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "begin_code.h" 42 | /* Set up for C function definitions, even when using C++ */ 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /** 48 | *Type for test images. 49 | */ 50 | typedef struct SDLTest_SurfaceImage_s { 51 | int width; 52 | int height; 53 | unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ 54 | const char *pixel_data; 55 | } SDLTest_SurfaceImage_t; 56 | 57 | /* Test images */ 58 | SDL_Surface *SDLTest_ImageBlit(void); 59 | SDL_Surface *SDLTest_ImageBlitColor(void); 60 | SDL_Surface *SDLTest_ImageBlitAlpha(void); 61 | SDL_Surface *SDLTest_ImageBlitBlendAdd(void); 62 | SDL_Surface *SDLTest_ImageBlitBlend(void); 63 | SDL_Surface *SDLTest_ImageBlitBlendMod(void); 64 | SDL_Surface *SDLTest_ImageBlitBlendNone(void); 65 | SDL_Surface *SDLTest_ImageBlitBlendAll(void); 66 | SDL_Surface *SDLTest_ImageFace(void); 67 | SDL_Surface *SDLTest_ImagePrimitives(void); 68 | SDL_Surface *SDLTest_ImagePrimitivesBlend(void); 69 | 70 | /* Ends C function definitions when using C++ */ 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | #include "close_code.h" 75 | 76 | #endif /* SDL_test_images_h_ */ 77 | 78 | /* vi: set ts=4 sw=4 expandtab: */ 79 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_test_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_log.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | * 32 | * Wrapper to log in the TEST category 33 | * 34 | */ 35 | 36 | #ifndef SDL_test_log_h_ 37 | #define SDL_test_log_h_ 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority. 47 | * 48 | * \param fmt Message to be logged 49 | */ 50 | void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 51 | 52 | /** 53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. 54 | * 55 | * \param fmt Message to be logged 56 | */ 57 | void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 58 | 59 | /* Ends C function definitions when using C++ */ 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #include "close_code.h" 64 | 65 | #endif /* SDL_test_log_h_ */ 66 | 67 | /* vi: set ts=4 sw=4 expandtab: */ 68 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_memory.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_memory_h_ 31 | #define SDL_test_memory_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | /** 41 | * \brief Start tracking SDL memory allocations 42 | * 43 | * \note This should be called before any other SDL functions for complete tracking coverage 44 | */ 45 | int SDLTest_TrackAllocations(); 46 | 47 | /** 48 | * \brief Print a log of any outstanding allocations 49 | * 50 | * \note This can be called after SDL_Quit() 51 | */ 52 | void SDLTest_LogAllocations(); 53 | 54 | 55 | /* Ends C function definitions when using C++ */ 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | #include "close_code.h" 60 | 61 | #endif /* SDL_test_memory_h_ */ 62 | 63 | /* vi: set ts=4 sw=4 expandtab: */ 64 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_touch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_touch.h 24 | * 25 | * Include file for SDL touch event handling. 26 | */ 27 | 28 | #ifndef SDL_touch_h_ 29 | #define SDL_touch_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "begin_code.h" 36 | /* Set up for C function definitions, even when using C++ */ 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef Sint64 SDL_TouchID; 42 | typedef Sint64 SDL_FingerID; 43 | 44 | typedef struct SDL_Finger 45 | { 46 | SDL_FingerID id; 47 | float x; 48 | float y; 49 | float pressure; 50 | } SDL_Finger; 51 | 52 | /* Used as the device ID for mouse events simulated with touch input */ 53 | #define SDL_TOUCH_MOUSEID ((Uint32)-1) 54 | 55 | 56 | /* Function prototypes */ 57 | 58 | /** 59 | * \brief Get the number of registered touch devices. 60 | */ 61 | extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); 62 | 63 | /** 64 | * \brief Get the touch ID with the given index, or 0 if the index is invalid. 65 | */ 66 | extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); 67 | 68 | /** 69 | * \brief Get the number of active fingers for a given touch device. 70 | */ 71 | extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); 72 | 73 | /** 74 | * \brief Get the finger object of the given touch, with the given index. 75 | */ 76 | extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); 77 | 78 | /* Ends C function definitions when using C++ */ 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #include "close_code.h" 83 | 84 | #endif /* SDL_touch_h_ */ 85 | 86 | /* vi: set ts=4 sw=4 expandtab: */ 87 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/include/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #undef _begin_code_h 30 | 31 | /* Reset structure packing at previous byte alignment */ 32 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 33 | #ifdef __BORLANDC__ 34 | #pragma nopackwarning 35 | #endif 36 | #pragma pack(pop) 37 | #endif /* Compiler needs structure packing set */ 38 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/SDL2.dll -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/libSDL2.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/libSDL2.a -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/libSDL2.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/libSDL2.dll.a -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/libSDL2.la: -------------------------------------------------------------------------------- 1 | # libSDL2.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='../bin/SDL2.dll' 9 | 10 | # Names of this library. 11 | library_names='libSDL2.dll.a' 12 | 13 | # The name of the static archive. 14 | old_library='libSDL2.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags='' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs=' -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libSDL2. 26 | current=7 27 | age=7 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/Users/slouken/release/SDL/SDL2-2.0.7/i686-w64-mingw32/lib' 42 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/libSDL2_test.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/libSDL2_test.a -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/libSDL2_test.la: -------------------------------------------------------------------------------- 1 | # libSDL2_test.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='' 9 | 10 | # Names of this library. 11 | library_names='' 12 | 13 | # The name of the static archive. 14 | old_library='libSDL2_test.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags='' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs='' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libSDL2_test. 26 | current=0 27 | age=0 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/Users/slouken/release/SDL/SDL2-2.0.7/i686-w64-mingw32/lib' 42 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/libSDL2main.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/libSDL2main.a -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/libSDL2main.la: -------------------------------------------------------------------------------- 1 | # libSDL2main.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='' 9 | 10 | # Names of this library. 11 | library_names='' 12 | 13 | # The name of the static archive. 14 | old_library='libSDL2main.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags='' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs='' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libSDL2main. 26 | current=0 27 | age=0 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/Users/slouken/release/SDL/SDL2-2.0.7/i686-w64-mingw32/lib' 42 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-gnu/pkgconfig/sdl2.pc: -------------------------------------------------------------------------------- 1 | # sdl pkg-config source file 2 | 3 | prefix=/usr/local/i686-w64-mingw32 4 | exec_prefix=${prefix} 5 | libdir=${exec_prefix}/lib 6 | includedir=${prefix}/include 7 | 8 | Name: sdl2 9 | Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. 10 | Version: 2.0.7 11 | Requires: 12 | Conflicts: 13 | Libs: -L${libdir} -lmingw32 -lSDL2main -lSDL2 -mwindows 14 | Libs.private: -lmingw32 -lSDL2main -lSDL2 -mwindows -Wl,--no-undefined -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -static-libgcc 15 | Cflags: -I${includedir}/SDL2 -Dmain=SDL_main 16 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-msvc/SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-msvc/SDL2.dll -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-msvc/SDL2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-msvc/SDL2.lib -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-msvc/SDL2main.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-msvc/SDL2main.lib -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-msvc/SDL2test.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/i686-pc-windows-msvc/SDL2test.lib -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/SDL2.dll -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/libSDL2.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/libSDL2.a -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/libSDL2.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/libSDL2.dll.a -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/libSDL2.la: -------------------------------------------------------------------------------- 1 | # libSDL2.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='../bin/SDL2.dll' 9 | 10 | # Names of this library. 11 | library_names='libSDL2.dll.a' 12 | 13 | # The name of the static archive. 14 | old_library='libSDL2.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags='' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs=' -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libSDL2. 26 | current=7 27 | age=7 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/Users/slouken/release/SDL/SDL2-2.0.7/x86_64-w64-mingw32/lib' 42 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/libSDL2_test.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/libSDL2_test.a -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/libSDL2_test.la: -------------------------------------------------------------------------------- 1 | # libSDL2_test.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='' 9 | 10 | # Names of this library. 11 | library_names='' 12 | 13 | # The name of the static archive. 14 | old_library='libSDL2_test.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags='' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs='' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libSDL2_test. 26 | current=0 27 | age=0 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/Users/slouken/release/SDL/SDL2-2.0.7/x86_64-w64-mingw32/lib' 42 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/libSDL2main.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/libSDL2main.a -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/libSDL2main.la: -------------------------------------------------------------------------------- 1 | # libSDL2main.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='' 9 | 10 | # Names of this library. 11 | library_names='' 12 | 13 | # The name of the static archive. 14 | old_library='libSDL2main.a' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags='' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs='' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libSDL2main. 26 | current=0 27 | age=0 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/Users/slouken/release/SDL/SDL2-2.0.7/x86_64-w64-mingw32/lib' 42 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-gnu/pkgconfig/sdl2.pc: -------------------------------------------------------------------------------- 1 | # sdl pkg-config source file 2 | 3 | prefix=/usr/local/x86_64-w64-mingw32 4 | exec_prefix=${prefix} 5 | libdir=${exec_prefix}/lib 6 | includedir=${prefix}/include 7 | 8 | Name: sdl2 9 | Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. 10 | Version: 2.0.7 11 | Requires: 12 | Conflicts: 13 | Libs: -L${libdir} -lmingw32 -lSDL2main -lSDL2 -mwindows 14 | Libs.private: -lmingw32 -lSDL2main -lSDL2 -mwindows -Wl,--no-undefined -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -static-libgcc 15 | Cflags: -I${includedir}/SDL2 -Dmain=SDL_main 16 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-msvc/SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-msvc/SDL2.dll -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-msvc/SDL2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-msvc/SDL2.lib -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-msvc/SDL2main.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-msvc/SDL2main.lib -------------------------------------------------------------------------------- /tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-msvc/SDL2test.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/tcod_sys/libtcod/dependencies/SDL2-2.0.7/lib/x86_64-pc-windows-msvc/SDL2test.lib -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/bresenham.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | #include "libtcod_portability.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | typedef bool (*TCOD_line_listener_t) (int x, int y); 37 | 38 | TCODLIB_API void TCOD_line_init(int xFrom, int yFrom, int xTo, int yTo); 39 | TCODLIB_API bool TCOD_line_step(int *xCur, int *yCur); /* advance one step. returns true if we reach destination */ 40 | /* atomic callback function. Stops when the callback returns false */ 41 | TCODLIB_API bool TCOD_line(int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener); 42 | 43 | /* thread-safe versions */ 44 | typedef struct { 45 | int stepx; 46 | int stepy; 47 | int e; 48 | int deltax; 49 | int deltay; 50 | int origx; 51 | int origy; 52 | int destx; 53 | int desty; 54 | } TCOD_bresenham_data_t; 55 | 56 | TCODLIB_API void TCOD_line_init_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_bresenham_data_t *data); 57 | TCODLIB_API bool TCOD_line_step_mt(int *xCur, int *yCur, TCOD_bresenham_data_t *data); 58 | TCODLIB_API bool TCOD_line_mt(int xFrom, int yFrom, int xTo, int yTo, TCOD_line_listener_t listener, TCOD_bresenham_data_t *data); 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | #endif 63 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/fov.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | #include "libtcod_portability.h" 32 | #include "fov_types.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | /* allocate a new map */ 38 | TCODLIB_API TCOD_map_t TCOD_map_new(int width, int height); 39 | /* set all cells as solid rock (cannot see through nor walk) */ 40 | TCODLIB_API void TCOD_map_clear(TCOD_map_t map, bool transparent, bool walkable); 41 | /* copy a map to another, reallocating it when needed */ 42 | TCODLIB_API void TCOD_map_copy(TCOD_map_t source, TCOD_map_t dest); 43 | /* change a cell properties */ 44 | TCODLIB_API void TCOD_map_set_properties(TCOD_map_t map, int x, int y, bool is_transparent, bool is_walkable); 45 | /* destroy a map */ 46 | TCODLIB_API void TCOD_map_delete(TCOD_map_t map); 47 | 48 | /* calculate the field of view (potentially visible cells from player_x,player_y) */ 49 | 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); 50 | /* check if a cell is in the last computed field of view */ 51 | TCODLIB_API bool TCOD_map_is_in_fov(TCOD_map_t map, int x, int y); 52 | TCODLIB_API void TCOD_map_set_in_fov(TCOD_map_t map, int x, int y, bool fov); 53 | 54 | /* retrieve properties from the map */ 55 | TCODLIB_API bool TCOD_map_is_transparent(TCOD_map_t map, int x, int y); 56 | TCODLIB_API bool TCOD_map_is_walkable(TCOD_map_t map, int x, int y); 57 | TCODLIB_API int TCOD_map_get_width(TCOD_map_t map); 58 | TCODLIB_API int TCOD_map_get_height(TCOD_map_t map); 59 | TCODLIB_API int TCOD_map_get_nb_cells(TCOD_map_t map); 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #endif 64 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/fov_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | typedef void *TCOD_map_t; 35 | 36 | /* FOV_BASIC : http://roguebasin.roguelikedevelopment.org/index.php?title=Ray_casting 37 | FOV_DIAMOND : http://www.geocities.com/temerra/los_rays.html 38 | FOV_SHADOW : http://roguebasin.roguelikedevelopment.org/index.php?title=FOV_using_recursive_shadowcasting 39 | FOV_PERMISSIVE : http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View 40 | FOV_RESTRICTIVE : Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos) */ 41 | 42 | typedef enum { 43 | FOV_BASIC, 44 | FOV_DIAMOND, 45 | FOV_SHADOW, 46 | FOV_PERMISSIVE_0, 47 | FOV_PERMISSIVE_1, 48 | FOV_PERMISSIVE_2, 49 | FOV_PERMISSIVE_3, 50 | FOV_PERMISSIVE_4, 51 | FOV_PERMISSIVE_5, 52 | FOV_PERMISSIVE_6, 53 | FOV_PERMISSIVE_7, 54 | FOV_PERMISSIVE_8, 55 | FOV_RESTRICTIVE, 56 | NB_FOV_ALGORITHMS } TCOD_fov_algorithm_t; 57 | #define FOV_PERMISSIVE(x) ((TCOD_fov_algorithm_t)(FOV_PERMISSIVE_0 + (x))) 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | #endif /* _TCOD_FOV_TYPES_H */ 63 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/lex.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | * This is a libtcod internal module. 29 | * Use at your own risks... 30 | */ 31 | #ifndef _TCOD_LEX_HPP 32 | #define _TCOD_LEX_HPP 33 | 34 | #include "lex.h" 35 | 36 | class TCODLIB_API TCODLex { 37 | public : 38 | TCODLex(); 39 | TCODLex( const char **symbols, const char **keywords, const char *simpleComment="//", 40 | const char *commentStart="/*", const char *commentStop="*/", const char *javadocCommentStart="/**", 41 | const char *stringDelim="\"", int flags=TCOD_LEX_FLAG_NESTING_COMMENT); 42 | ~TCODLex(); 43 | 44 | void setDataBuffer(char *dat); 45 | bool setDataFile(const char *filename); 46 | 47 | int parse(void); 48 | int parseUntil(int tokenType); 49 | int parseUntil(const char *tokenValue); 50 | 51 | bool expect(int tokenType); 52 | bool expect(int tokenType,const char *tokenValue); 53 | 54 | void savepoint(TCODLex *savept); 55 | void restore(TCODLex *savept); 56 | char *getLastJavadoc(); 57 | 58 | int getFileLine() { return ((TCOD_lex_t *)data)->file_line; } 59 | int getTokenType() { return ((TCOD_lex_t *)data)->token_type; } 60 | int getTokenIntVal() { return ((TCOD_lex_t *)data)->token_int_val; } 61 | int getTokenIdx() { return ((TCOD_lex_t *)data)->token_idx; } 62 | float getTokenFloatVal() { return ((TCOD_lex_t *)data)->token_float_val; } 63 | char *getToken() { return ((TCOD_lex_t *)data)->tok; } 64 | char getStringLastDelimiter() { return ((TCOD_lex_t *)data)->lastStringDelim; } 65 | char *getPos() { return ((TCOD_lex_t *)data)->pos; } 66 | char *getBuf() { return ((TCOD_lex_t *)data)->buf; } 67 | char *getFilename() { return ((TCOD_lex_t *)data)->filename; } 68 | char *getLastJavadocComment() { return ((TCOD_lex_t *)data)->last_javadoc_comment; } 69 | static const char *getTokenName(int tokenType) { return TCOD_lex_get_token_name(tokenType); } 70 | protected : 71 | void *data; 72 | }; 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/libtcod.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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_H 29 | #define _LIBTCOD_H 30 | 31 | #include "libtcod_portability.h" 32 | #include "libtcod_utility.h" 33 | #include "libtcod_version.h" 34 | 35 | #include "bresenham.h" 36 | #include "bsp.h" 37 | #include "color.h" 38 | #include "console.h" 39 | #include "fov.h" 40 | #include "heightmap.h" 41 | #include "image.h" 42 | #include "lex.h" 43 | #include "list.h" 44 | #include "mersenne.h" 45 | #include "mouse.h" 46 | #include "namegen.h" 47 | #include "noise.h" 48 | #include "path.h" 49 | #include "parser.h" 50 | #include "sys.h" 51 | #include "tree.h" 52 | #include "txtfield.h" 53 | #include "zip.h" 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/libtcod.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | 33 | #include "bresenham.hpp" 34 | #include "bsp.hpp" 35 | #include "color.hpp" 36 | #include "console.hpp" 37 | #include "fov.hpp" 38 | #include "heightmap.hpp" 39 | #include "image.hpp" 40 | #include "lex.hpp" 41 | #include "list.hpp" 42 | #include "mersenne.hpp" 43 | #include "mouse.hpp" 44 | #include "namegen.hpp" 45 | #include "noise.hpp" 46 | #include "parser.hpp" 47 | #include "path.hpp" 48 | #include "sys.hpp" 49 | #include "tree.hpp" 50 | #include "txtfield.hpp" 51 | #include "zip.hpp" 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/libtcod_utility.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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 14 | * products derived from this software without specific prior written 15 | * permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | #ifndef LIBTCOD_UTILITY_H 29 | #define LIBTCOD_UTILITY_H 30 | /****************************************** 31 | utility macros 32 | ******************************************/ 33 | #define MAX(a,b) (((a)>(b))?(a):(b)) 34 | #define MIN(a,b) (((a)<(b))?(a):(b)) 35 | #define ABS(a) ((a)<0?-(a):(a)) 36 | #define CLAMP(a, b, x) ((x) < (a) ? (a) : ((x) > (b) ? (b) : (x))) 37 | #define LERP(a, b, x) ( (a) + (x) * ((b) - (a)) ) 38 | 39 | #endif -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/libtcod_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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 14 | * products derived from this software without specific prior written 15 | * permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY JICE, MINGOS AND RMTEW ``AS IS'' AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL JICE, MINGOS OR RMTEW BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | #ifndef LIBTCOD_VERSION_H 29 | #define LIBTCOD_VERSION_H 30 | 31 | #define TCOD_HEXVERSION 0x010603 32 | #define TCOD_STRVERSION "1.6.3" 33 | #define TCOD_TECHVERSION 0x01060300 34 | 35 | #define TCOD_STRVERSIONNAME "libtcod "TCOD_STRVERSION 36 | 37 | #endif /* LIBTCOD_VERSION_H */ 38 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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_LIST_H 29 | #define _TCOD_LIST_H 30 | 31 | #include "libtcod_portability.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | typedef void *TCOD_list_t; 38 | 39 | TCODLIB_API TCOD_list_t TCOD_list_new(void); 40 | TCODLIB_API TCOD_list_t TCOD_list_allocate(int nb_elements); 41 | TCODLIB_API TCOD_list_t TCOD_list_duplicate(TCOD_list_t l); 42 | TCODLIB_API void TCOD_list_delete(TCOD_list_t l); 43 | TCODLIB_API void TCOD_list_push(TCOD_list_t l, const void * elt); 44 | TCODLIB_API void * TCOD_list_pop(TCOD_list_t l); 45 | TCODLIB_API void * TCOD_list_peek(TCOD_list_t l); 46 | TCODLIB_API void TCOD_list_add_all(TCOD_list_t l, TCOD_list_t l2); 47 | TCODLIB_API void * TCOD_list_get(TCOD_list_t l,int idx); 48 | TCODLIB_API void TCOD_list_set(TCOD_list_t l,const void *elt, int idx); 49 | TCODLIB_API void ** TCOD_list_begin(TCOD_list_t l); 50 | TCODLIB_API void ** TCOD_list_end(TCOD_list_t l); 51 | TCODLIB_API void TCOD_list_reverse(TCOD_list_t l); 52 | TCODLIB_API void **TCOD_list_remove_iterator(TCOD_list_t l, void **elt); 53 | TCODLIB_API void TCOD_list_remove(TCOD_list_t l, const void * elt); 54 | TCODLIB_API void **TCOD_list_remove_iterator_fast(TCOD_list_t l, void **elt); 55 | TCODLIB_API void TCOD_list_remove_fast(TCOD_list_t l, const void * elt); 56 | TCODLIB_API bool TCOD_list_contains(TCOD_list_t l,const void * elt); 57 | TCODLIB_API void TCOD_list_clear(TCOD_list_t l); 58 | TCODLIB_API void TCOD_list_clear_and_delete(TCOD_list_t l); 59 | TCODLIB_API int TCOD_list_size(TCOD_list_t l); 60 | TCODLIB_API void ** TCOD_list_insert_before(TCOD_list_t l,const void *elt,int before); 61 | TCODLIB_API bool TCOD_list_is_empty(TCOD_list_t l); 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #endif 66 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/mersenne.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 "libtcod_portability.h" 32 | #include "mersenne_types.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | TCODLIB_API TCOD_random_t TCOD_random_get_instance(void); 38 | TCODLIB_API TCOD_random_t TCOD_random_new(TCOD_random_algo_t algo); 39 | TCODLIB_API TCOD_random_t TCOD_random_save(TCOD_random_t mersenne); 40 | TCODLIB_API void TCOD_random_restore(TCOD_random_t mersenne, TCOD_random_t backup); 41 | TCODLIB_API TCOD_random_t TCOD_random_new_from_seed(TCOD_random_algo_t algo, uint32_t seed); 42 | TCODLIB_API void TCOD_random_delete(TCOD_random_t mersenne); 43 | 44 | TCODLIB_API void TCOD_random_set_distribution (TCOD_random_t mersenne, TCOD_distribution_t distribution); 45 | 46 | TCODLIB_API int TCOD_random_get_int (TCOD_random_t mersenne, int min, int max); 47 | TCODLIB_API float TCOD_random_get_float (TCOD_random_t mersenne, float min, float max); 48 | TCODLIB_API double TCOD_random_get_double (TCOD_random_t mersenne, double min, double max); 49 | 50 | TCODLIB_API int TCOD_random_get_int_mean (TCOD_random_t mersenne, int min, int max, int mean); 51 | TCODLIB_API float TCOD_random_get_float_mean (TCOD_random_t mersenne, float min, float max, float mean); 52 | TCODLIB_API double TCOD_random_get_double_mean (TCOD_random_t mersenne, double min, double max, double mean); 53 | 54 | TCODLIB_API TCOD_dice_t TCOD_random_dice_new (const char * s); 55 | TCODLIB_API int TCOD_random_dice_roll (TCOD_random_t mersenne, TCOD_dice_t dice); 56 | TCODLIB_API int TCOD_random_dice_roll_s (TCOD_random_t mersenne, const char * s); 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | #endif 61 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/mersenne_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | typedef void *TCOD_random_t; 32 | 33 | /* dice roll */ 34 | typedef struct { 35 | int nb_rolls; 36 | int nb_faces; 37 | float multiplier; 38 | float addsub; 39 | } TCOD_dice_t; 40 | 41 | /* PRNG algorithms */ 42 | typedef enum { 43 | TCOD_RNG_MT, 44 | TCOD_RNG_CMWC 45 | } TCOD_random_algo_t; 46 | 47 | typedef enum { 48 | TCOD_DISTRIBUTION_LINEAR, 49 | TCOD_DISTRIBUTION_GAUSSIAN, 50 | TCOD_DISTRIBUTION_GAUSSIAN_RANGE, 51 | TCOD_DISTRIBUTION_GAUSSIAN_INVERSE, 52 | TCOD_DISTRIBUTION_GAUSSIAN_RANGE_INVERSE 53 | } TCOD_distribution_t; 54 | #endif /* _TCOD_RANDOM_TYPES_H */ 55 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/mouse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 "libtcod_portability.h" 32 | 33 | #ifdef TCOD_CONSOLE_SUPPORT 34 | 35 | #include "mouse_types.h" 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | TCODLIB_API void TCOD_mouse_show_cursor(bool visible); 41 | TCODLIB_API TCOD_mouse_t TCOD_mouse_get_status(void); 42 | TCODLIB_API bool TCOD_mouse_is_cursor_visible(void); 43 | TCODLIB_API void TCOD_mouse_move(int x, int y); 44 | TCODLIB_API void TCOD_mouse_includes_touch(bool enable); 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* TCOD_CONSOLE_SUPPORT */ 50 | 51 | #endif /* _TCOD_MOUSE_H */ 52 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/mouse_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | #include "libtcod_portability.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* mouse data */ 37 | typedef struct { 38 | int x,y; /* absolute position */ 39 | int dx,dy; /* movement since last update in pixels */ 40 | int cx,cy; /* cell coordinates in the root console */ 41 | int dcx,dcy; /* movement since last update in console cells */ 42 | bool lbutton ; /* left button status */ 43 | bool rbutton ; /* right button status */ 44 | bool mbutton ; /* middle button status */ 45 | bool lbutton_pressed ; /* left button pressed event */ 46 | bool rbutton_pressed ; /* right button pressed event */ 47 | bool mbutton_pressed ; /* middle button pressed event */ 48 | bool wheel_up ; /* wheel up event */ 49 | bool wheel_down ; /* wheel down event */ 50 | } TCOD_mouse_t; 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | #endif /* _TCOD_MOUSE_TYPES_H */ 55 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/namegen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | #include "libtcod_portability.h" 36 | #include "list.h" 37 | #include "mersenne.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | /* the generator typedef */ 43 | typedef void * TCOD_namegen_t; 44 | 45 | /* parse a file with syllable sets */ 46 | TCODLIB_API void TCOD_namegen_parse (const char * filename, TCOD_random_t random); 47 | /* generate a name */ 48 | TCODLIB_API char * TCOD_namegen_generate (char * name, bool allocate); 49 | /* generate a name using a custom generation rule */ 50 | TCODLIB_API char * TCOD_namegen_generate_custom (char * name, char * rule, bool allocate); 51 | /* retrieve the list of all available syllable set names */ 52 | TCODLIB_API TCOD_list_t TCOD_namegen_get_sets (void); 53 | /* delete a generator */ 54 | TCODLIB_API void TCOD_namegen_destroy (void); 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | #endif 59 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/noise.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | #include "libtcod_portability.h" 32 | #include "mersenne_types.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | typedef void *TCOD_noise_t; 38 | 39 | typedef enum { 40 | TCOD_NOISE_PERLIN = 1, 41 | TCOD_NOISE_SIMPLEX = 2, 42 | TCOD_NOISE_WAVELET = 4, 43 | TCOD_NOISE_DEFAULT = 0 44 | } TCOD_noise_type_t; 45 | 46 | #include "noise_defaults.h" 47 | 48 | /* create a new noise object */ 49 | TCODLIB_API TCOD_noise_t TCOD_noise_new(int dimensions, float hurst, float lacunarity, TCOD_random_t random); 50 | 51 | /* simplified API */ 52 | TCODLIB_API void TCOD_noise_set_type (TCOD_noise_t noise, TCOD_noise_type_t type); 53 | TCODLIB_API float TCOD_noise_get_ex (TCOD_noise_t noise, float *f, TCOD_noise_type_t type); 54 | TCODLIB_API float TCOD_noise_get_fbm_ex (TCOD_noise_t noise, float *f, float octaves, TCOD_noise_type_t type); 55 | TCODLIB_API float TCOD_noise_get_turbulence_ex (TCOD_noise_t noise, float *f, float octaves, TCOD_noise_type_t type); 56 | TCODLIB_API float TCOD_noise_get (TCOD_noise_t noise, float *f); 57 | TCODLIB_API float TCOD_noise_get_fbm (TCOD_noise_t noise, float *f, float octaves); 58 | TCODLIB_API float TCOD_noise_get_turbulence (TCOD_noise_t noise, float *f, float octaves); 59 | /* delete the noise object */ 60 | TCODLIB_API void TCOD_noise_delete(TCOD_noise_t noise); 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | #endif 65 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/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 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/tree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | #include "libtcod_portability.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | typedef struct _TCOD_tree_t { 37 | struct _TCOD_tree_t *next; 38 | struct _TCOD_tree_t *father; 39 | struct _TCOD_tree_t *sons; 40 | } TCOD_tree_t; 41 | 42 | TCODLIB_API TCOD_tree_t *TCOD_tree_new(void); 43 | TCODLIB_API void TCOD_tree_add_son(TCOD_tree_t *node, TCOD_tree_t *son); 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif 48 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/tree.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | #include "tree.h" 32 | 33 | class TCODLIB_API TCODTree { 34 | public : 35 | TCODTree *next; 36 | TCODTree *father; 37 | TCODTree *sons; 38 | 39 | TCODTree() : next(NULL),father(NULL),sons(NULL){} 40 | void addSon(TCODTree *data) { 41 | data->father=this; 42 | TCODTree *lastson = sons; 43 | while ( lastson && lastson->next ) lastson=lastson->next; 44 | if ( lastson ) { 45 | lastson->next=data; 46 | } else { 47 | sons=data; 48 | } 49 | } 50 | 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/txtfield.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | #include "libtcod_portability.h" 33 | 34 | #ifdef TCOD_CONSOLE_SUPPORT 35 | 36 | #include "color.h" 37 | #include "console_types.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | typedef void * TCOD_text_t; 43 | 44 | TCODLIB_API TCOD_text_t TCOD_text_init(int x, int y, int w, int h, int max_chars); 45 | TCODLIB_API TCOD_text_t TCOD_text_init2(int w, int h, int max_chars); 46 | TCODLIB_API void TCOD_text_set_pos(TCOD_text_t txt, int x, int y); 47 | TCODLIB_API void TCOD_text_set_properties(TCOD_text_t txt, int cursor_char, int blink_interval, const char * prompt, int tab_size); 48 | TCODLIB_API void TCOD_text_set_colors(TCOD_text_t txt, TCOD_color_t fore, TCOD_color_t back, float back_transparency); 49 | TCODLIB_API bool TCOD_text_update(TCOD_text_t txt, TCOD_key_t key); 50 | TCODLIB_API void TCOD_text_render(TCOD_text_t txt, TCOD_console_t con); 51 | TCODLIB_API const char * TCOD_text_get(TCOD_text_t txt); 52 | TCODLIB_API void TCOD_text_reset(TCOD_text_t txt); 53 | TCODLIB_API void TCOD_text_delete(TCOD_text_t txt); 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* TCOD_CONSOLE_SUPPORT */ 59 | 60 | #endif /* _TCOD_TEXT_H_ */ 61 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/include/txtfield.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | #include "console.hpp" 33 | #include "txtfield.h" 34 | 35 | #ifdef TCOD_CONSOLE_SUPPORT 36 | 37 | class TCODLIB_API TCODText { 38 | public : 39 | TCODText(int x, int y, int w, int h, int max_chars); 40 | TCODText(int w, int h, int max_chars); 41 | ~TCODText(); 42 | void setProperties(int cursor_char, int blink_interval, const char * prompt, int tab_size); 43 | void setColors(TCODColor fore, TCODColor back, float back_transparency); 44 | void setPos(int x, int y); 45 | bool update(TCOD_key_t key); 46 | void render(TCODConsole * con); 47 | const char *getText(); 48 | void reset(); 49 | protected : 50 | TCOD_text_t data; 51 | }; 52 | 53 | #endif /* TCOD_CONSOLE_SUPPORT */ 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/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 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/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 dependent functions. 32 | They have currently a single working implementation relying on SDL : sys_sdl_c.c 33 | As it is heavily system dependent, 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 dependent 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 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/src/bresenham.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | 29 | // ********** bresenham line drawing ********** 30 | void TCODLine::init(int xFrom, int yFrom, int xTo, int yTo) { 31 | TCOD_line_init(xFrom,yFrom,xTo,yTo); 32 | } 33 | 34 | bool TCODLine::step(int *xCur, int *yCur) { 35 | return TCOD_line_step(xCur,yCur) != 0; 36 | } 37 | 38 | static TCODLineListener *listener=NULL; 39 | 40 | // C to C++ bridge 41 | extern "C" bool internalListener(int x,int y) { 42 | return listener->putPoint(x,y) ? 1 : 0; 43 | } 44 | 45 | bool TCODLine::line(int xFrom, int yFrom, int xTo, int yTo, TCODLineListener *plistener) { 46 | listener=plistener; 47 | return TCOD_line(xFrom,yFrom,xTo,yTo,internalListener) != 0; 48 | } 49 | 50 | 51 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/src/fov.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | 29 | TCODMap::TCODMap(int width,int height) { 30 | data = TCOD_map_new(width,height); 31 | } 32 | 33 | void TCODMap::clear(bool transparent, bool walkable) { 34 | TCOD_map_clear(data,transparent,walkable); 35 | } 36 | 37 | void TCODMap::setProperties(int x, int y, bool isTransparent, bool isWalkable) { 38 | TCOD_map_set_properties(data,x,y,isTransparent,isWalkable); 39 | } 40 | 41 | void TCODMap::copy(const TCODMap *source) { 42 | TCOD_map_copy(source->data,data); 43 | } 44 | 45 | void TCODMap::computeFov(int x, int y, int maxRadius, bool light_walls, TCOD_fov_algorithm_t algo) { 46 | TCOD_map_compute_fov(data,x,y,maxRadius,light_walls, algo); 47 | } 48 | 49 | bool TCODMap::isInFov(int x, int y) const { 50 | return TCOD_map_is_in_fov(data,x,y) != 0; 51 | } 52 | 53 | void TCODMap::setInFov(int x,int y, bool fov) { 54 | TCOD_map_set_in_fov(data, x, y, fov); 55 | } 56 | 57 | bool TCODMap::isTransparent(int x, int y) const { 58 | return TCOD_map_is_transparent(data,x,y) != 0; 59 | } 60 | 61 | bool TCODMap::isWalkable(int x, int y) const { 62 | return TCOD_map_is_walkable(data,x,y) != 0; 63 | } 64 | 65 | int TCODMap::getWidth() const { 66 | return TCOD_map_get_width(data); 67 | } 68 | 69 | int TCODMap::getHeight() const { 70 | return TCOD_map_get_height(data); 71 | } 72 | 73 | int TCODMap::getNbCells() const { 74 | return TCOD_map_get_nb_cells(data); 75 | } 76 | 77 | TCODMap::~TCODMap() { 78 | TCOD_map_delete(data); 79 | } 80 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/src/mersenne.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | 29 | #include 30 | 31 | #include 32 | 33 | static TCODRandom *instance=(TCODRandom *)NULL; 34 | 35 | TCODRandom *TCODRandom::getInstance(void) { 36 | if (! instance ) { 37 | instance=new TCODRandom(TCOD_RNG_CMWC,true); 38 | } 39 | return instance; 40 | } 41 | 42 | TCODRandom::TCODRandom(TCOD_random_algo_t algo, bool allocate) { 43 | if ( allocate ) data = TCOD_random_new(algo); 44 | } 45 | 46 | TCODRandom::TCODRandom(uint32_t seed, TCOD_random_algo_t algo) { 47 | data=TCOD_random_new_from_seed(algo, seed); 48 | } 49 | 50 | TCODRandom::~TCODRandom() { 51 | TCOD_random_delete(data); 52 | } 53 | 54 | TCODRandom *TCODRandom::save() const { 55 | TCODRandom *ret=new TCODRandom(((mersenne_data_t *)data)->algo,false); 56 | ret->data=TCOD_random_save(data); 57 | return ret; 58 | } 59 | 60 | void TCODRandom::restore(const TCODRandom *backup) { 61 | TCOD_random_restore(data,backup->data); 62 | } 63 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/src/mouse.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | 29 | #ifdef TCOD_CONSOLE_SUPPORT 30 | 31 | void TCODMouse::showCursor(bool visible) { 32 | TCOD_mouse_show_cursor(visible); 33 | } 34 | 35 | bool TCODMouse::isCursorVisible() { 36 | return TCOD_mouse_is_cursor_visible() != 0; 37 | } 38 | 39 | void TCODMouse::move(int x, int y) { 40 | TCOD_mouse_move(x,y); 41 | } 42 | 43 | TCOD_mouse_t TCODMouse::getStatus() { 44 | return TCOD_mouse_get_status(); 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/src/namegen.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | #include 32 | 33 | void TCODNamegen::parse (const char * filename, TCODRandom * random) { 34 | TCOD_namegen_parse (filename, random ? random->data : NULL); 35 | } 36 | 37 | char * TCODNamegen::generate (char * name, bool allocate) { 38 | return TCOD_namegen_generate (name, allocate); 39 | } 40 | 41 | char * TCODNamegen::generateCustom (char * name, char * rule, bool allocate) { 42 | return TCOD_namegen_generate_custom (name, rule, allocate); 43 | } 44 | 45 | TCOD_list_t TCODNamegen::getSets (void) { 46 | return TCOD_namegen_get_sets (); 47 | } 48 | 49 | void TCODNamegen::destroy (void) { 50 | TCOD_namegen_destroy (); 51 | } 52 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/src/sys_sdl_img_bmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | #ifdef TCOD_SDL2 28 | 29 | #include 30 | 31 | #include 32 | 33 | #include 34 | 35 | bool TCOD_sys_check_bmp(const char *filename) { 36 | static uint8_t magic_number[]={0x42, 0x4d}; 37 | return TCOD_sys_check_magic_number(filename,sizeof(magic_number),magic_number); 38 | } 39 | 40 | SDL_Surface *TCOD_sys_read_bmp(const char *filename) { 41 | SDL_Surface *ret=SDL_LoadBMP(filename); 42 | if( !ret ) TCOD_fatal("SDL : %s",SDL_GetError()); 43 | /* convert low color images to 24 bits */ 44 | if ( ret->format->BytesPerPixel != 3 ) { 45 | uint32_t rmask,gmask,bmask; 46 | SDL_Surface * tmp; 47 | if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) { 48 | rmask=0xFF0000; 49 | gmask=0x00FF00; 50 | bmask=0x0000FF; 51 | } else { 52 | rmask=0x0000FF; 53 | gmask=0x00FF00; 54 | bmask=0xFF0000; 55 | } 56 | tmp=SDL_CreateRGBSurface(SDL_SWSURFACE,ret->w,ret->h,24, rmask, gmask, bmask, 0); 57 | SDL_BlitSurface(ret,NULL,tmp,NULL); 58 | SDL_FreeSurface(ret); 59 | ret=tmp; 60 | } 61 | 62 | return ret; 63 | } 64 | 65 | void TCOD_sys_write_bmp(const SDL_Surface *surf, const char *filename) { 66 | SDL_SaveBMP((SDL_Surface *)surf,filename); 67 | } 68 | 69 | #endif /* TCOD_SDL2 */ 70 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/src/tree_c.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 | 29 | #include 30 | 31 | TCOD_tree_t *TCOD_tree_new(void) { 32 | return (TCOD_tree_t *)calloc(1,sizeof(TCOD_tree_t)); 33 | } 34 | 35 | void TCOD_tree_add_son(TCOD_tree_t *node, TCOD_tree_t *son) { 36 | TCOD_tree_t *lastson = node->sons; 37 | son->father=node; 38 | while ( lastson && lastson->next ) lastson=lastson->next; 39 | if ( lastson ) { 40 | lastson->next=son; 41 | } else { 42 | node->sons=son; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/src/txtfield.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * libtcod 1.6.3 3 | * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew 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, MINGOS AND RMTEW ``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, MINGOS OR RMTEW 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 29 | 30 | #ifdef TCOD_CONSOLE_SUPPORT 31 | 32 | TCODText::TCODText(int x, int y, int w, int h, int max_chars){ 33 | data=TCOD_text_init(x,y,w,h,max_chars); 34 | } 35 | 36 | TCODText::TCODText(int w, int h, int max_chars){ 37 | data=TCOD_text_init2(w,h,max_chars); 38 | } 39 | 40 | TCODText::~TCODText(){ 41 | TCOD_text_delete(data); 42 | } 43 | 44 | void TCODText::setPos(int x, int y) { 45 | TCOD_text_set_pos(data,x,y); 46 | } 47 | 48 | void TCODText::setProperties(int cursor_char, int blink_interval, const char * prompt, int tab_size){ 49 | TCOD_text_set_properties(data,cursor_char,blink_interval,prompt,tab_size); 50 | } 51 | 52 | void TCODText::setColors(TCODColor fore, TCODColor back, float back_transparency){ 53 | TCOD_color_t foreground = {fore.r,fore.g,fore.b}; 54 | TCOD_color_t background = {back.r,back.g,back.b}; 55 | TCOD_text_set_colors(data,foreground,background,back_transparency); 56 | } 57 | 58 | bool TCODText::update(TCOD_key_t key){ 59 | return TCOD_text_update(data,key) != 0; 60 | } 61 | 62 | void TCODText::render(TCODConsole * con){ 63 | TCOD_text_render(data,con->data); 64 | } 65 | 66 | const char *TCODText::getText(){ 67 | return TCOD_text_get(data); 68 | } 69 | 70 | void TCODText::reset(){ 71 | TCOD_text_reset(data); 72 | } 73 | 74 | #endif /* TCOD_CONSOLE_SUPPORT */ 75 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/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 = (z_const 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 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/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 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/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 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/src/zlib/inftrees.h: -------------------------------------------------------------------------------- 1 | /* inftrees.h -- header to use inftrees.c 2 | * Copyright (C) 1995-2005, 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 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 0001eeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of the dynamic table. The maximum number of code structures is 39 | 1444, which is the sum of 852 for literal/length codes and 592 for distance 40 | codes. These values were found by exhaustive searches using the program 41 | examples/enough.c found in the zlib distribtution. The arguments to that 42 | program are the number of symbols, the initial root table size, and the 43 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 44 | returns returns 852, and "enough 30 6 15" for distance codes returns 592. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in inflate.c and infback.c. If the root table size is 47 | changed, then these maximum sizes would be need to be recalculated and 48 | updated. */ 49 | #define ENOUGH_LENS 852 50 | #define ENOUGH_DISTS 592 51 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 52 | 53 | /* Type of code to build for inflate_table() */ 54 | typedef enum { 55 | CODES, 56 | LENS, 57 | DISTS 58 | } codetype; 59 | 60 | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, 61 | unsigned codes, code FAR * FAR *table, 62 | unsigned FAR *bits, unsigned short FAR *work)); 63 | -------------------------------------------------------------------------------- /tcod_sys/libtcod/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 = (z_const 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 | -------------------------------------------------------------------------------- /terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomassedovic/tcod-rs/d4ad0749867acad6c1e510bf5eda802b074e153c/terminal.png --------------------------------------------------------------------------------