├── .appveyor.yml
├── .gitignore
├── .gitmodules
├── Android.mk
├── CMakeLists.txt
├── CMakeSettings.json
├── Doxyfile
├── LICENSE.md
├── README.md
├── cmake
├── CMakeLists_SDL2_devel.txt
├── Copyright.txt
├── FindSDL2.cmake
└── LibFindMacros.cmake
├── default.nix
├── demo
├── res
│ ├── backgrounds
│ │ ├── city-bg0-with-planets.png
│ │ ├── city-bg0.png
│ │ ├── city-bg1.png
│ │ └── city-bg2.png
│ ├── maps
│ │ ├── city.json
│ │ └── city.tmx
│ ├── sprites
│ │ ├── player.png
│ │ ├── vehicle-misc1.png
│ │ ├── vehicle-misc2.png
│ │ ├── vehicle-police.png
│ │ └── vehicle-truck.png
│ └── tilesets
│ │ ├── city.png
│ │ └── city.tsx
├── src
│ └── main.c
└── work
│ ├── .gitignore
│ ├── city.pyxel
│ ├── demo.tiled-project
│ ├── objecttypes.xml
│ ├── player.pyxel
│ ├── vehicle-misc1.pyxel
│ ├── vehicle-misc2.pyxel
│ ├── vehicle-police.pyxel
│ └── vehicle-truck.pyxel
├── doc
├── .gitignore
├── customdoxygen.css
├── doxy-boot.js
├── footer.html
├── header.html
└── logo.png
├── examples
└── minimal_application.c
├── external
├── .gitignore
└── Android.mk
├── media
├── demo-01-tn.png
├── demo-01.png
├── demo-02-tn.png
└── demo-02.png
└── src
├── Android.mk
├── esz.c
├── esz.h
├── esz_compat.c
├── esz_compat.h
├── esz_hash.c
├── esz_hash.h
├── esz_init.c
├── esz_init.h
├── esz_macros.h
├── esz_render.c
├── esz_render.h
├── esz_types.h
├── esz_utils.c
└── esz_utils.h
/.appveyor.yml:
--------------------------------------------------------------------------------
1 | image: ubuntu
2 |
3 | before_build:
4 | - sudo apt-get update
5 | - sudo apt-get install -y libsdl2-dev libxml2-dev
6 | - git submodule update --init --recursive
7 |
8 | build_script:
9 | - mkdir -p build
10 | - cd build
11 | - cmake -DUSE_LIBTMX=ON ..
12 | - make
13 | - cmake -DUSE_LIBTMX=OFF ..
14 | - make
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | eszFW-cppcheck-build-dir
3 | out
4 | project
5 | .vs
6 | *.a
7 | *.cppcheck
8 | *.dll
9 | *.exe
10 | *.ilk
11 | *.lib
12 | *.o
13 | *.pdb
14 | *.so
15 | *.zip
16 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "external/tmx"]
2 | path = external/tmx
3 | url = https://github.com/baylej/tmx.git
4 | [submodule "external/cwalk"]
5 | path = external/cwalk
6 | url = https://github.com/likle/cwalk.git
7 | [submodule "external/stb"]
8 | path = external/stb
9 | url = https://github.com/nothings/stb.git
10 | [submodule "external/cute_headers"]
11 | path = external/cute_headers
12 | url = https://github.com/RandyGaul/cute_headers.git
13 | [submodule "external/lua"]
14 | path = external/lua
15 | url = https://github.com/lua/lua.git
16 | [submodule "external/log.c"]
17 | path = external/log.c
18 | url = https://github.com/rxi/log.c.git
19 | [submodule "external/picolog"]
20 | path = external/picolog
21 | url = https://github.com/picojs/picolog.git
22 | [submodule "external/buffer"]
23 | path = external/buffer
24 | url = https://github.com/clibs/buffer.git
25 |
--------------------------------------------------------------------------------
/Android.mk:
--------------------------------------------------------------------------------
1 | include $(call all-subdir-makefiles)
2 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.10)
2 | project(eszFW C)
3 |
4 | set(CMAKE_C_STANDARD 11)
5 |
6 | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)
7 |
8 | if(WIN32)
9 | set(SDL2_PLATFORM "x64")
10 | set(SDL2_VERSION "2.0.12")
11 | set(SDL2_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external/SDL2-${SDL2_VERSION})
12 | set(SDL2_DEVEL_PKG SDL2-devel-${SDL2_VERSION}-VC.zip)
13 |
14 | if(CMAKE_SIZEOF_VOID_P EQUAL 4)
15 | set(SDL2_PLATFORM "x86")
16 | endif()
17 |
18 | include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
19 |
20 | ExternalProject_Add(SDL2_devel
21 | URL https://www.libsdl.org/release/${SDL2_DEVEL_PKG}
22 | URL_HASH SHA1=6839b6ec345ef754a6585ab24f04e125e88c3392
23 | DOWNLOAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external
24 | DOWNLOAD_NO_PROGRESS true
25 | TLS_VERIFY true
26 | SOURCE_DIR ${SDL2_PATH}/
27 | BUILD_BYPRODUCTS ${SDL2_PATH}/lib/${SDL2_PLATFORM}/SDL2.lib
28 |
29 | BUILD_COMMAND cmake -E echo "Skipping build step."
30 |
31 | INSTALL_COMMAND cmake -E copy
32 | ${SDL2_PATH}/lib/${SDL2_PLATFORM}/SDL2.dll ${CMAKE_CURRENT_SOURCE_DIR}/demo
33 |
34 | PATCH_COMMAND ${CMAKE_COMMAND} -E copy
35 | "${CMAKE_CURRENT_SOURCE_DIR}/cmake/CMakeLists_SDL2_devel.txt" ${SDL2_PATH}/CMakeLists.txt)
36 |
37 | set(SDL2_INCLUDE_DIR ${SDL2_PATH}/include)
38 | set(SDL2_LIBRARY ${SDL2_PATH}/lib/${SDL2_PLATFORM}/SDL2.lib)
39 |
40 | endif(WIN32)
41 |
42 | find_package(SDL2 REQUIRED)
43 | if(USE_LIBTMX)
44 | find_package(LibXml2 REQUIRED)
45 | endif(USE_LIBTMX)
46 |
47 | set(CUTE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/cute_headers)
48 | set(CWALK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/cwalk/include)
49 | set(LIBTMX_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/tmx/src)
50 | set(LUA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/lua)
51 | set(PICOLOG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/picolog)
52 | set(STB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/stb)
53 |
54 | include_directories(
55 | PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
56 | SYSTEM ${CWALK_INCLUDE_DIR}
57 | SYSTEM ${LUA_INCLUDE_DIR}
58 | SYSTEM ${PICOLOG_INCLUDE_DIR}
59 | SYSTEM ${SDL2_INCLUDE_DIRS}
60 | SYSTEM ${STB_INCLUDE_DIR})
61 |
62 | set(eszFW_sources
63 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz.c
64 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz.h
65 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz_compat.c
66 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz_compat.h
67 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz_hash.c
68 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz_hash.h
69 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz_init.c
70 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz_init.h
71 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz_render.c
72 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz_render.h
73 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz_types.h
74 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz_utils.c
75 | ${CMAKE_CURRENT_SOURCE_DIR}/src/esz_utils.h)
76 |
77 | set(demo_sources
78 | ${CMAKE_CURRENT_SOURCE_DIR}/demo/src/main.c)
79 |
80 | add_library(
81 | ${PROJECT_NAME}
82 | STATIC
83 | ${eszFW_sources})
84 |
85 | target_include_directories(
86 | ${PROJECT_NAME}
87 | PUBLIC
88 | ${CMAKE_CURRENT_SOURCE_DIR}/src
89 | ${CUTE_INCLUDE_DIR}
90 | ${LIBTMX_INCLUDE_DIR}
91 | ${PICOLOG_INCLUDE_DIR})
92 |
93 | add_executable(
94 | demo
95 | ${demo_sources})
96 |
97 | set_target_properties(
98 | demo
99 | PROPERTIES
100 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/demo
101 | RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/demo
102 | RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/demo)
103 |
104 | if(WIN32)
105 | set_target_properties(
106 | demo
107 | PROPERTIES
108 | ADDITIONAL_CLEAN_FILES
109 | ${CMAKE_CURRENT_SOURCE_DIR}/demo/SDL2.dll)
110 | endif(WIN32)
111 |
112 | add_library(
113 | cwalk
114 | STATIC
115 | ${CMAKE_CURRENT_SOURCE_DIR}/external/cwalk/src/cwalk.c)
116 |
117 | add_library(
118 | picolog
119 | STATIC
120 | ${CMAKE_CURRENT_SOURCE_DIR}/external/picolog/picolog.c)
121 |
122 | add_library(
123 | lua
124 | STATIC
125 | ${LUA_INCLUDE_DIR}/onelua.c)
126 |
127 | option(ENABLE_DIAGNOSTICS "Enable all diagnostics" OFF)
128 | option(USE_LIBTMX "Use libTMX instead of cute_tiled" OFF)
129 |
130 | target_link_libraries(
131 | ${PROJECT_NAME}
132 | ${SDL2_LIBRARIES}
133 | cwalk
134 | picolog)
135 |
136 | target_link_libraries(
137 | demo
138 | ${SDL2_LIBRARIES}
139 | ${PROJECT_NAME})
140 |
141 | add_definitions(-D_CRT_SECURE_NO_WARNINGS)
142 |
143 | if(USE_LIBTMX)
144 | add_definitions(-DUSE_LIBTMX)
145 | add_subdirectory(external/tmx)
146 | set_property(TARGET tmx PROPERTY POSITION_INDEPENDENT_CODE ON)
147 | target_link_libraries(
148 | ${PROJECT_NAME}
149 | ${LIBXML2_LIBRARIES}
150 | tmx)
151 | endif(USE_LIBTMX)
152 |
153 | if(UNIX)
154 | target_link_libraries(${PROJECT_NAME} m)
155 | endif(UNIX)
156 |
157 | if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
158 | set(COMPILE_OPTIONS
159 | -Wall
160 | -Wextra
161 | -Wpedantic)
162 |
163 | elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
164 | set(COMPILE_OPTIONS
165 | -Wall
166 | -Wextra
167 | -Wpedantic)
168 |
169 | elseif (CMAKE_C_COMPILER_ID STREQUAL "MSVC")
170 | set(COMPILE_OPTIONS
171 | /W4)
172 | endif()
173 |
174 | if (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND ENABLE_DIAGNOSTICS)
175 | message("Enabling all diagnostics")
176 | set(COMPILE_OPTIONS
177 | -Weverything)
178 | add_compile_options(-Weverything)
179 | endif()
180 |
--------------------------------------------------------------------------------
/CMakeSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": "x64-Debug",
5 | "generator": "Visual Studio 16 2019 Win64",
6 | "configurationType": "Debug",
7 | "buildRoot": "${projectDir}\\out\\build\\${name}",
8 | "installRoot": "${projectDir}\\out\\install\\${name}",
9 | "cmakeCommandArgs": "-DUSE_LIBTMX=OFF",
10 | "buildCommandArgs": "",
11 | "ctestCommandArgs": "",
12 | "inheritEnvironments": [ "msvc_x64_x64" ],
13 | "variables": [
14 | {
15 | "name": "SDL2_INCLUDE_DIR",
16 | "value": "${projectDir}\\external\\SDL2-2.0.12\\include",
17 | "type": "PATH"
18 | },
19 | {
20 | "name": "SDL2_LIBRARY",
21 | "value": "${projectDir}\\external\\SDL2-2.0.12\\lib\\x64\\SDL2.lib",
22 | "type": "FILEPATH"
23 | }
24 | ]
25 | },
26 | {
27 | "name": "x64-Release",
28 | "generator": "Visual Studio 16 2019 Win64",
29 | "configurationType": "Release",
30 | "buildRoot": "${projectDir}\\out\\build\\${name}",
31 | "installRoot": "${projectDir}\\out\\install\\${name}",
32 | "cmakeCommandArgs": "-DUSE_LIBTMX=OFF",
33 | "buildCommandArgs": "",
34 | "ctestCommandArgs": "",
35 | "inheritEnvironments": [ "msvc_x64_x64" ],
36 | "variables": [
37 | {
38 | "name": "SDL2_INCLUDE_DIR",
39 | "value": "${projectDir}\\external\\SDL2-2.0.12\\include",
40 | "type": "PATH"
41 | },
42 | {
43 | "name": "SDL2_LIBRARY",
44 | "value": "${projectDir}\\external\\SDL2-2.0.12\\lib\\x64\\SDL2.lib",
45 | "type": "FILEPATH"
46 | }
47 | ]
48 | }
49 | ]
50 | }
51 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright 2020 Michael Fitzmayer
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a
4 | copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included
12 | in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # eszFW
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | ## About
22 |
23 | eszFW is a cross-platform game engine written in C. It's aimed at
24 | platformer games. This project is the logical continuation of my older
25 | projects [Rainbow Joe](https://github.com/mupfelofen-de/rainbow-joe) and
26 | [Boondock Sam](https://github.com/mupfelofen-de/boondock-sam).
27 |
28 | ## Features
29 |
30 | - It runs on all platforms [supported by
31 | SDL2](https://wiki.libsdl.org/Installation#Supported_platforms).
32 |
33 | - Fully reentrant engine core.
34 |
35 | - The dependencies can be limited to SDL2.
36 |
37 | - It uses the [Tiled Map Editor](https://www.mapeditor.org/) as its main
38 | tool to develop games.
39 |
40 | ## Documentation
41 |
42 | The documentation can be generated using Doxygen:
43 | ```bash
44 | doxygen
45 | ```
46 |
47 | A automatically generated version of the documentation can be found
48 | here: [eszfw.de](https://eszfw.de)
49 |
50 | ## Code style
51 |
52 | You are invited to contribute to this project. But to ensure a uniform
53 | formatting of the source code, you will find some rules here:
54 |
55 | - Follow the C11 standard.
56 | - Do not use tabs and use a consistent 4 space indentation style.
57 | - Use lower snake_case for both function and variable names.
58 | - Try to use a consistent style. Use the existing code as a guideline.
59 |
60 | ### Status
61 |
62 | This project currently undergoes a complete overhaul.
63 |
64 | If you wanna see a previous version in action, take a look at the [demo
65 | application](demo/).
66 |
67 | [](https://raw.githubusercontent.com/mupfelofen-de/eszFW/master/media/demo-01.png?raw=true "demo 1")
68 | [](https://raw.githubusercontent.com/mupfelofen-de/eszFW/master/media/demo-02.png?raw=true "demo 2")
69 |
70 | An Android version is available on Google Play:
71 |
72 | [](https://play.google.com/store/apps/details?id=de.mupfelofen.TauCeti)
73 |
74 | ## C is dead, long live C
75 |
76 | Even though hardly any games are written in C nowadays, there are a few
77 | noteworthy titles that meet this criterion e.g. Doom, Quake, Quake II,
78 | and Neverwinter Nights.
79 |
80 | This project should show that it is still possible and that C (and
81 | procedural programming in general) is often underestimated.
82 |
83 | With that in mind: C is dead, long live C!
84 |
85 | ### Trivia
86 |
87 | The abbreviation esz is a tribute to my best friend [Ertugrul
88 | Söylemez](https://github.com/esoeylemez), who suddenly passed away on
89 | May 12th, 2018. We all miss you deeply.
90 |
91 | ## Dependencies
92 |
93 | The program has been successfully compiled and tested with the following libraries:
94 | ```text
95 | SDL2 2.0.12
96 | libxml2 2.9.10 (optional)
97 | zlib 1.2.11 (optional)
98 | ```
99 |
100 | ## Compiling
101 |
102 | First clone the repository including the submodules:
103 | ```bash
104 | git clone --recurse-submodules -j2 https://github.com/mupfelofen-de/eszFW.git
105 | ```
106 |
107 | ### Windows
108 |
109 | The easiest way to get eszFW up and running is Visual Studio 2019 with
110 | [C++ CMake tools for
111 | Windows](https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=vs-2019#installation)
112 | installed. Just open the project inside the IDE and everything else is
113 | set up automatically.
114 |
115 | Alternatively just use [MSYS2](https://www.msys2.org/) with CMake and a
116 | compiler of your choice.
117 |
118 | ### Linux
119 |
120 | To compile _eszFW_ and the included demo application, simply use CMake e.g.:
121 | ```bash
122 | mkdir build
123 | cd build
124 | cmake ..
125 | make
126 | ```
127 |
128 | If you wanna compile eszFW with _libTMX_ instead of _cute_tiled_, just enable the
129 | respective CMake option:
130 | ```bash
131 | cmake -DUSE_LIBTMX=ON ..
132 | ```
133 |
134 | ## Licence and Credits
135 |
136 | ### Engine
137 |
138 | [cute_tiled](https://github.com/RandyGaul/cute_headers) by Randy Gaul is
139 | licensed under the zlib licence.
140 |
141 | [TMX C Loader](https://github.com/baylej/tmx/) by Bayle Jonathan is
142 | licensed under a BSD 2-Clause "Simplified" Licence.
143 |
144 | This project and all further listed libraries are licensed under the
145 | "The MIT License". See the file [LICENSE.md](LICENSE.md) for details.
146 |
147 | [cwalk](https://github.com/likle/cwalk) by Leonard Iklé.
148 |
149 | [picolog](https://github.com/picojs/picolog) by James McLean.
150 |
151 | ### Demo application
152 |
153 | [Warped City](https://ansimuz.itch.io/warped-city) by Luis Zuno.
154 | Dedicated to [public
155 | domain](https://creativecommons.org/publicdomain/zero/1.0/).
156 |
157 | Every other work that is not explicitly mentioned here is also under
158 | [public domain](https://creativecommons.org/publicdomain/zero/1.0/).
159 |
--------------------------------------------------------------------------------
/cmake/CMakeLists_SDL2_devel.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.10)
2 | project(SDL2_devel C)
3 |
--------------------------------------------------------------------------------
/cmake/Copyright.txt:
--------------------------------------------------------------------------------
1 | CMake - Cross Platform Makefile Generator
2 | Copyright 2000-2020 Kitware, Inc. and Contributors
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions
7 | are met:
8 |
9 | * Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 |
12 | * Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | * Neither the name of Kitware, Inc. nor the names of Contributors
17 | may be used to endorse or promote products derived from this
18 | software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
32 | ------------------------------------------------------------------------------
33 |
34 | The following individuals and institutions are among the Contributors:
35 |
36 | * Aaron C. Meadows
37 | * Adriaan de Groot
38 | * Aleksey Avdeev
39 | * Alexander Neundorf
40 | * Alexander Smorkalov
41 | * Alexey Sokolov
42 | * Alex Merry
43 | * Alex Turbov
44 | * Andreas Pakulat
45 | * Andreas Schneider
46 | * André Rigland Brodtkorb
47 | * Axel Huebl, Helmholtz-Zentrum Dresden - Rossendorf
48 | * Benjamin Eikel
49 | * Bjoern Ricks
50 | * Brad Hards
51 | * Christopher Harvey
52 | * Christoph Grüninger
53 | * Clement Creusot
54 | * Daniel Blezek
55 | * Daniel Pfeifer
56 | * Enrico Scholz
57 | * Eran Ifrah
58 | * Esben Mose Hansen, Ange Optimization ApS
59 | * Geoffrey Viola
60 | * Google Inc
61 | * Gregor Jasny
62 | * Helio Chissini de Castro
63 | * Ilya Lavrenov
64 | * Insight Software Consortium
65 | * Jan Woetzel
66 | * Julien Schueller
67 | * Kelly Thompson
68 | * Laurent Montel
69 | * Konstantin Podsvirov
70 | * Mario Bensi
71 | * Martin Gräßlin
72 | * Mathieu Malaterre
73 | * Matthaeus G. Chajdas
74 | * Matthias Kretz
75 | * Matthias Maennich
76 | * Michael Hirsch, Ph.D.
77 | * Michael Stürmer
78 | * Miguel A. Figueroa-Villanueva
79 | * Mike Jackson
80 | * Mike McQuaid
81 | * Nicolas Bock
82 | * Nicolas Despres
83 | * Nikita Krupen'ko
84 | * NVIDIA Corporation
85 | * OpenGamma Ltd.
86 | * Patrick Stotko
87 | * Per Øyvind Karlsen
88 | * Peter Collingbourne
89 | * Petr Gotthard
90 | * Philip Lowman
91 | * Philippe Proulx
92 | * Raffi Enficiaud, Max Planck Society
93 | * Raumfeld
94 | * Roger Leigh
95 | * Rolf Eike Beer
96 | * Roman Donchenko
97 | * Roman Kharitonov
98 | * Ruslan Baratov
99 | * Sebastian Holtermann
100 | * Stephen Kelly
101 | * Sylvain Joubert
102 | * The Qt Company Ltd.
103 | * Thomas Sondergaard
104 | * Tobias Hunger
105 | * Todd Gamblin
106 | * Tristan Carel
107 | * University of Dundee
108 | * Vadim Zhukov
109 | * Will Dicharry
110 |
111 | See version control history for details of individual contributions.
112 |
113 | The above copyright and license notice applies to distributions of
114 | CMake in source and binary form. Third-party software packages supplied
115 | with CMake under compatible licenses provide their own copyright notices
116 | documented in corresponding subdirectories or source files.
117 |
118 | ------------------------------------------------------------------------------
119 |
120 | CMake was initially developed by Kitware with the following sponsorship:
121 |
122 | * National Library of Medicine at the National Institutes of Health
123 | as part of the Insight Segmentation and Registration Toolkit (ITK).
124 |
125 | * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
126 | Visualization Initiative.
127 |
128 | * National Alliance for Medical Image Computing (NAMIC) is funded by the
129 | National Institutes of Health through the NIH Roadmap for Medical Research,
130 | Grant U54 EB005149.
131 |
132 | * Kitware, Inc.
133 |
--------------------------------------------------------------------------------
/cmake/FindSDL2.cmake:
--------------------------------------------------------------------------------
1 | # Locate SDL2 library
2 | # This module defines
3 | # SDL2_LIBRARY, the SDL2 library, with no other libraries
4 | # SDL2_LIBRARIES, the SDL library and required components with compiler flags
5 | # SDL2_FOUND, if false, do not try to link to SDL2
6 | # SDL2_INCLUDE_DIR, where to find SDL.h
7 | # SDL2_VERSION, the version of the found library
8 | #
9 | # This module accepts the following env variables
10 | # SDL2DIR - Can be set to ./configure --prefix=$SDL2DIR used in building SDL2. l.e.galup 9-20-02
11 | # This module responds to the the flag:
12 | # SDL2_BUILDING_LIBRARY
13 | # If this is defined, then no SDL2_main will be linked in because
14 | # only applications need main().
15 | # Otherwise, it is assumed you are building an application and this
16 | # module will attempt to locate and set the the proper link flags
17 | # as part of the returned SDL2_LIBRARIES variable.
18 | #
19 | # Don't forget to include SDL2main.h and SDL2main.m your project for the
20 | # OS X framework based version. (Other versions link to -lSDL2main which
21 | # this module will try to find on your behalf.) Also for OS X, this
22 | # module will automatically add the -framework Cocoa on your behalf.
23 | #
24 | #
25 | # Modified by Eric Wing.
26 | # Added code to assist with automated building by using environmental variables
27 | # and providing a more controlled/consistent search behavior.
28 | # Added new modifications to recognize OS X frameworks and
29 | # additional Unix paths (FreeBSD, etc).
30 | # Also corrected the header search path to follow "proper" SDL2 guidelines.
31 | # Added a search for SDL2main which is needed by some platforms.
32 | # Added a search for threads which is needed by some platforms.
33 | # Added needed compile switches for MinGW.
34 | #
35 | # On OSX, this will prefer the Framework version (if found) over others.
36 | # People will have to manually change the cache values of
37 | # SDL2_LIBRARY to override this selection or set the CMake environment
38 | # CMAKE_INCLUDE_PATH to modify the search paths.
39 | #
40 | # Note that the header path has changed from SDL2/SDL.h to just SDL.h
41 | # This needed to change because "proper" SDL2 convention
42 | # is #include "SDL.h", not . This is done for portability
43 | # reasons because not all systems place things in SDL2/ (see FreeBSD).
44 | #
45 | # Ported by Johnny Patterson. This is a literal port for SDL2 of the FindSDL.cmake
46 | # module with the minor edit of changing "SDL" to "SDL2" where necessary. This
47 | # was not created for redistribution, and exists temporarily pending official
48 | # SDL2 CMake modules.
49 |
50 | #=============================================================================
51 | # Copyright 2003-2009 Kitware, Inc.
52 | #
53 | # Distributed under the OSI-approved BSD License (the "License");
54 | # see accompanying file Copyright.txt for details.
55 | #
56 | # This software is distributed WITHOUT ANY WARRANTY; without even the
57 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
58 | # See the License for more information.
59 | #=============================================================================
60 | # (To distribute this file outside of CMake, substitute the full
61 | # License text for the above reference.)
62 |
63 |
64 | if (CMAKE_SIZEOF_VOID_P EQUAL 8)
65 | set(_sdl_lib_suffix lib/x64)
66 | else()
67 | set(_sdl_lib_suffix lib/x86)
68 | endif()
69 |
70 | include(LibFindMacros)
71 |
72 | libfind_pkg_detect(SDL2 sdl2
73 | FIND_PATH SDL.h
74 | HINTS $ENV{SDL2DIR}
75 | PATH_SUFFIXES include SDL2
76 | FIND_LIBRARY SDL2
77 | HINTS $ENV{SDL2DIR}
78 | PATH_SUFFIXES ${_sdl_lib_suffix}
79 | )
80 | libfind_version_n_header(SDL2 NAMES SDL_version.h DEFINES SDL_MAJOR_VERSION SDL_MINOR_VERSION SDL_PATCHLEVEL)
81 |
82 | IF(NOT SDL2_BUILDING_LIBRARY AND NOT APPLE)
83 | # Non-OS X framework versions expect you to also dynamically link to
84 | # SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
85 | # seem to provide SDL2main for compatibility even though they don't
86 | # necessarily need it.
87 | libfind_pkg_detect(SDL2MAIN sdl2
88 | FIND_LIBRARY SDL2main
89 | HINTS $ENV{SDL2DIR}
90 | PATH_SUFFIXES ${_sdl_lib_suffix}
91 | )
92 | set(SDL2MAIN_FIND_QUIETLY TRUE)
93 | libfind_process(SDL2MAIN)
94 | list(APPEND SDL2_PROCESS_LIBS SDL2MAIN_LIBRARY)
95 | ENDIF()
96 |
97 |
98 | set(SDL2_TARGET_SPECIFIC)
99 |
100 | if (APPLE)
101 | # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
102 | list(APPEND SDL2_TARGET_SPECIFIC "-framework Cocoa")
103 | else()
104 | # SDL2 may require threads on your system.
105 | # The Apple build may not need an explicit flag because one of the
106 | # frameworks may already provide it.
107 | # But for non-OSX systems, I will use the CMake Threads package.
108 | libfind_package(SDL2 Threads)
109 | list(APPEND SDL2_TARGET_SPECIFIC ${CMAKE_THREAD_LIBS_INIT})
110 | endif()
111 |
112 | # MinGW needs an additional library, mwindows
113 | # It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows
114 | # (Actually on second look, I think it only needs one of the m* libraries.)
115 | if(MINGW)
116 | list(APPEND SDL2_TARGET_SPECIFIC mingw32)
117 | endif()
118 |
119 | if(WIN32)
120 | list(APPEND SDL2_TARGET_SPECIFIC winmm imm32 version msimg32)
121 | endif()
122 |
123 | set(SDL2_PROCESS_LIBS SDL2_TARGET_SPECIFIC)
124 |
125 | libfind_process(SDL2)
126 |
127 | if (SDL2_STATIC AND UNIX AND NOT APPLE)
128 | execute_process(COMMAND sdl2-config --static-libs OUTPUT_VARIABLE SDL2_STATIC_FLAGS)
129 | string(REGEX REPLACE "(\r?\n)+$" "" SDL2_STATIC_FLAGS "${SDL2_STATIC_FLAGS}")
130 | set(SDL2_LIBRARIES ${SDL2_STATIC_FLAGS})
131 | endif()
132 |
--------------------------------------------------------------------------------
/cmake/LibFindMacros.cmake:
--------------------------------------------------------------------------------
1 | # Version 2.2
2 | # Public Domain, originally written by Lasse Kärkkäinen
3 | # Maintained at https://github.com/Tronic/cmake-modules
4 | # Please send your improvements as pull requests on Github.
5 |
6 | include(CMakeParseArguments)
7 |
8 | # Find another package and make it a dependency of the current package.
9 | # This also automatically forwards the "REQUIRED" argument.
10 | # Usage: libfind_package( [extra args to find_package])
11 | macro (libfind_package PREFIX PKG)
12 | set(${PREFIX}_args ${PKG} ${ARGN})
13 | if (${PREFIX}_FIND_REQUIRED)
14 | set(${PREFIX}_args ${${PREFIX}_args} REQUIRED)
15 | endif()
16 | find_package(${${PREFIX}_args})
17 | set(${PREFIX}_DEPENDENCIES ${${PREFIX}_DEPENDENCIES};${PKG})
18 | unset(${PREFIX}_args)
19 | endmacro()
20 |
21 | # A simple wrapper to make pkg-config searches a bit easier.
22 | # Works the same as CMake's internal pkg_check_modules but is always quiet.
23 | macro (libfind_pkg_check_modules)
24 | find_package(PkgConfig QUIET)
25 | if (PKG_CONFIG_FOUND)
26 | pkg_check_modules(${ARGN} QUIET)
27 | endif()
28 | endmacro()
29 |
30 | # Avoid useless copy&pasta by doing what most simple libraries do anyway:
31 | # pkg-config, find headers, find library.
32 | # Usage: libfind_pkg_detect( FIND_PATH [other args] FIND_LIBRARY [other args])
33 | # E.g. libfind_pkg_detect(SDL2 sdl2 FIND_PATH SDL.h PATH_SUFFIXES SDL2 FIND_LIBRARY SDL2)
34 | function (libfind_pkg_detect PREFIX)
35 | # Parse arguments
36 | set(argname pkgargs)
37 | foreach (i ${ARGN})
38 | if ("${i}" STREQUAL "FIND_PATH")
39 | set(argname pathargs)
40 | elseif ("${i}" STREQUAL "FIND_LIBRARY")
41 | set(argname libraryargs)
42 | else()
43 | set(${argname} ${${argname}} ${i})
44 | endif()
45 | endforeach()
46 | if (NOT pkgargs)
47 | message(FATAL_ERROR "libfind_pkg_detect requires at least a pkg_config package name to be passed.")
48 | endif()
49 | # Find library
50 | libfind_pkg_check_modules(${PREFIX}_PKGCONF ${pkgargs})
51 | if (pathargs)
52 | find_path(${PREFIX}_INCLUDE_DIR NAMES ${pathargs} HINTS ${${PREFIX}_PKGCONF_INCLUDE_DIRS})
53 | endif()
54 | if (libraryargs)
55 | find_library(${PREFIX}_LIBRARY NAMES ${libraryargs} HINTS ${${PREFIX}_PKGCONF_LIBRARY_DIRS})
56 | endif()
57 | endfunction()
58 |
59 | # libfind_header_path( [PATHS [ ...]] NAMES [name ...] VAR [QUIET])
60 | # Get fullpath of the first found header looking inside _INCLUDE_DIR or in the given PATHS
61 | # Usage: libfind_header_path(Foobar NAMES foobar/version.h VAR filepath)
62 | function (libfind_header_path PREFIX)
63 | set(options QUIET)
64 | set(one_value_keywords VAR PATH)
65 | set(multi_value_keywords NAMES PATHS)
66 | CMAKE_PARSE_ARGUMENTS(OPT "${options}" "${one_value_keywords}" "${multi_value_keywords}" ${ARGN})
67 | if (NOT OPT_VAR OR NOT OPT_NAMES)
68 | message(FATAL_ERROR "Arguments VAR, NAMES are required!")
69 | endif()
70 | if (OPT_UNPARSED_ARGUMENTS)
71 | message(FATAL_ERROR "Calling function with unused arguments '${OPT_UNPARSED_ARGUMENTS}'!")
72 | endif()
73 | if (OPT_QUIET OR ${PREFIX}_FIND_QUIETLY)
74 | set(quiet TRUE)
75 | endif()
76 | set(paths ${OPT_PATHS} ${PREFIX}_INCLUDE_DIR)
77 |
78 | foreach(name ${OPT_NAMES})
79 | foreach(path ${paths})
80 | set(filepath "${${path}}/${name}")
81 | # check for existance
82 | if (EXISTS ${filepath})
83 | set(${OPT_VAR} ${filepath} PARENT_SCOPE) # export path
84 | return()
85 | endif()
86 | endforeach()
87 | endforeach()
88 |
89 | # report error if not found
90 | set(${OPT_VAR} NOTFOUND PARENT_SCOPE)
91 | if (NOT quiet)
92 | message(AUTHOR_WARNING "Unable to find '${OPT_NAMES}'")
93 | endif()
94 | endfunction()
95 |
96 | # libfind_version_n_header(
97 | # NAMES [ ...]
98 | # DEFINES [ ...] | CONSTANTS [ ...]
99 | # [PATHS [ ...]]
100 | # [QUIET]
101 | # )
102 | # Collect all defines|constants from a header inside _INCLUDE_DIR or in the given PATHS
103 | # output stored to _VERSION.
104 | # This function does nothing if the version variable is already defined.
105 | # Usage: libfind_version_n_header(Foobar NAMES foobar/version.h DEFINES FOOBAR_VERSION_MAJOR FOOBAR_VERSION_MINOR)
106 | function (libfind_version_n_header PREFIX)
107 | # Skip processing if we already have a version
108 | if (${PREFIX}_VERSION)
109 | return()
110 | endif()
111 |
112 | set(options QUIET)
113 | set(one_value_keywords )
114 | set(multi_value_keywords NAMES PATHS DEFINES CONSTANTS)
115 | CMAKE_PARSE_ARGUMENTS(OPT "${options}" "${one_value_keywords}" "${multi_value_keywords}" ${ARGN})
116 | if (NOT OPT_NAMES OR (NOT OPT_DEFINES AND NOT OPT_CONSTANTS))
117 | message(FATAL_ERROR "Arguments NAMES, DEFINES|CONSTANTS are required!")
118 | endif()
119 | if (OPT_DEFINES AND OPT_CONSTANTS)
120 | message(FATAL_ERROR "Either DEFINES or CONSTANTS must be set!")
121 | endif()
122 | if (OPT_UNPARSED_ARGUMENTS)
123 | message(FATAL_ERROR "Calling function with unused arguments '${OPT_UNPARSED_ARGUMENTS}'!")
124 | endif()
125 | if (OPT_QUIET OR ${PREFIX}_FIND_QUIETLY)
126 | set(quiet TRUE)
127 | set(force_quiet "QUIET") # to propagate argument QUIET
128 | endif()
129 |
130 | # Read the header
131 | libfind_header_path(${PREFIX} NAMES ${OPT_NAMES} PATHS ${OPT_PATHS} VAR filename ${force_quiet})
132 | if (NOT filename)
133 | return()
134 | endif()
135 | file(READ "${filename}" header)
136 | # Parse for version number
137 | unset(version_parts)
138 | foreach(define_name ${OPT_DEFINES})
139 | string(REGEX MATCH "# *define +${define_name} +((\"([^\n]*)\")|([^ \n]*))" match "${header}")
140 | # No regex match?
141 | if (NOT match OR match STREQUAL header)
142 | if (NOT quiet)
143 | message(AUTHOR_WARNING "Unable to find \#define ${define_name} \"\" from ${filename}")
144 | endif()
145 | return()
146 | else()
147 | list(APPEND version_parts "${CMAKE_MATCH_3}${CMAKE_MATCH_4}")
148 | endif()
149 | endforeach()
150 | foreach(constant_name ${OPT_CONSTANTS})
151 | string(REGEX MATCH "${constant_name} *= *((\"([^\;]*)\")|([^ \;]*))" match "${header}")
152 | # No regex match?
153 | if (NOT match OR match STREQUAL header)
154 | if (NOT quiet)
155 | message(AUTHOR_WARNING "Unable to find ${constant_name} = \"\" from ${filename}")
156 | endif()
157 | return()
158 | else()
159 | list(APPEND version_parts "${CMAKE_MATCH_3}${CMAKE_MATCH_4}")
160 | endif()
161 | endforeach()
162 |
163 | # Export the version string
164 | string(REPLACE ";" "." version "${version_parts}")
165 | set(${PREFIX}_VERSION "${version}" PARENT_SCOPE)
166 | endfunction()
167 |
168 | # libfind_version_header( [PATHS [ ...]] [QUIET])
169 | # Extracts a version #define from a version.h file, output stored to _VERSION.
170 | # This function does nothing if the version variable is already defined.
171 | # Usage: libfind_version_header(Foobar foobar/version.h FOOBAR_VERSION_STR)
172 | function (libfind_version_header PREFIX VERSION_H DEFINE_NAME)
173 | # Skip processing if we already have a version
174 | if (${PREFIX}_VERSION)
175 | return()
176 | endif()
177 |
178 | set(options QUIET)
179 | set(one_value_keywords )
180 | set(multi_value_keywords PATHS)
181 | CMAKE_PARSE_ARGUMENTS(OPT "${options}" "${one_value_keywords}" "${multi_value_keywords}" ${ARGN})
182 | if (OPT_UNPARSED_ARGUMENTS)
183 | message(FATAL_ERROR "Calling function with unused arguments '${OPT_UNPARSED_ARGUMENTS}'!")
184 | endif()
185 | if (OPT_QUIET OR ${PREFIX}_FIND_QUIETLY)
186 | set(force_quiet "QUIET") # to propagate argument QUIET
187 | endif()
188 |
189 | libfind_version_n_header(${PREFIX} NAMES ${VERSION_H} PATHS ${OPT_PATHS} DEFINES ${DEFINE_NAME} ${force_quiet})
190 | set(${PREFIX}_VERSION "${${PREFIX}_VERSION}" PARENT_SCOPE)
191 | endfunction()
192 |
193 | # Do the final processing once the paths have been detected.
194 | # If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
195 | # all the variables, each of which contain one include directory.
196 | # Ditto for ${PREFIX}_PROCESS_LIBS and library files.
197 | # Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
198 | # Also handles errors in case library detection was required, etc.
199 | function (libfind_process PREFIX)
200 | # Skip processing if already processed during this configuration run
201 | if (${PREFIX}_FOUND)
202 | return()
203 | endif()
204 |
205 | set(found TRUE) # Start with the assumption that the package was found
206 |
207 | # Did we find any files? Did we miss includes? These are for formatting better error messages.
208 | set(some_files FALSE)
209 | set(missing_headers FALSE)
210 |
211 | # Shorthands for some variables that we need often
212 | set(quiet ${${PREFIX}_FIND_QUIETLY})
213 | set(required ${${PREFIX}_FIND_REQUIRED})
214 | set(exactver ${${PREFIX}_FIND_VERSION_EXACT})
215 | set(findver "${${PREFIX}_FIND_VERSION}")
216 | set(version "${${PREFIX}_VERSION}")
217 |
218 | # Lists of config option names (all, includes, libs)
219 | unset(configopts)
220 | set(includeopts ${${PREFIX}_PROCESS_INCLUDES})
221 | set(libraryopts ${${PREFIX}_PROCESS_LIBS})
222 |
223 | # Process deps to add to
224 | foreach (i ${PREFIX} ${${PREFIX}_DEPENDENCIES})
225 | if (DEFINED ${i}_INCLUDE_OPTS OR DEFINED ${i}_LIBRARY_OPTS)
226 | # The package seems to export option lists that we can use, woohoo!
227 | list(APPEND includeopts ${${i}_INCLUDE_OPTS})
228 | list(APPEND libraryopts ${${i}_LIBRARY_OPTS})
229 | else()
230 | # If plural forms don't exist or they equal singular forms
231 | if ((NOT DEFINED ${i}_INCLUDE_DIRS AND NOT DEFINED ${i}_LIBRARIES) OR
232 | ({i}_INCLUDE_DIR STREQUAL ${i}_INCLUDE_DIRS AND ${i}_LIBRARY STREQUAL ${i}_LIBRARIES))
233 | # Singular forms can be used
234 | if (DEFINED ${i}_INCLUDE_DIR)
235 | list(APPEND includeopts ${i}_INCLUDE_DIR)
236 | endif()
237 | if (DEFINED ${i}_LIBRARY)
238 | list(APPEND libraryopts ${i}_LIBRARY)
239 | endif()
240 | else()
241 | # Oh no, we don't know the option names
242 | message(FATAL_ERROR "We couldn't determine config variable names for ${i} includes and libs. Aieeh!")
243 | endif()
244 | endif()
245 | endforeach()
246 |
247 | if (includeopts)
248 | list(REMOVE_DUPLICATES includeopts)
249 | endif()
250 |
251 | if (libraryopts)
252 | list(REMOVE_DUPLICATES libraryopts)
253 | endif()
254 |
255 | string(REGEX REPLACE ".*[ ;]([^ ;]*(_INCLUDE_DIRS|_LIBRARIES))" "\\1" tmp "${includeopts} ${libraryopts}")
256 | if (NOT tmp STREQUAL "${includeopts} ${libraryopts}")
257 | message(AUTHOR_WARNING "Plural form ${tmp} found in config options of ${PREFIX}. This works as before but is now deprecated. Please only use singular forms INCLUDE_DIR and LIBRARY, and update your find scripts for LibFindMacros > 2.0 automatic dependency system (most often you can simply remove the PROCESS variables entirely).")
258 | endif()
259 |
260 | # Include/library names separated by spaces (notice: not CMake lists)
261 | unset(includes)
262 | unset(libs)
263 |
264 | # Process all includes and set found false if any are missing
265 | foreach (i ${includeopts})
266 | list(APPEND configopts ${i})
267 | if (NOT "${${i}}" STREQUAL "${i}-NOTFOUND")
268 | list(APPEND includes "${${i}}")
269 | else()
270 | set(found FALSE)
271 | set(missing_headers TRUE)
272 | endif()
273 | endforeach()
274 |
275 | # Process all libraries and set found false if any are missing
276 | foreach (i ${libraryopts})
277 | list(APPEND configopts ${i})
278 | if (NOT "${${i}}" STREQUAL "${i}-NOTFOUND")
279 | list(APPEND libs "${${i}}")
280 | else()
281 | set (found FALSE)
282 | endif()
283 | endforeach()
284 |
285 | # Version checks
286 | if (found AND findver)
287 | if (NOT version)
288 | message(WARNING "The find module for ${PREFIX} does not provide version information, so we'll just assume that it is OK. Please fix the module or remove package version requirements to get rid of this warning.")
289 | elseif (version VERSION_LESS findver OR (exactver AND NOT version VERSION_EQUAL findver))
290 | set(found FALSE)
291 | set(version_unsuitable TRUE)
292 | endif()
293 | endif()
294 |
295 | # If all-OK, hide all config options, export variables, print status and exit
296 | if (found)
297 | foreach (i ${configopts})
298 | mark_as_advanced(${i})
299 | endforeach()
300 | set (${PREFIX}_INCLUDE_OPTS ${includeopts} PARENT_SCOPE)
301 | set (${PREFIX}_LIBRARY_OPTS ${libraryopts} PARENT_SCOPE)
302 | set (${PREFIX}_INCLUDE_DIRS ${includes} PARENT_SCOPE)
303 | set (${PREFIX}_LIBRARIES ${libs} PARENT_SCOPE)
304 | set (${PREFIX}_FOUND TRUE PARENT_SCOPE)
305 | if (NOT quiet)
306 | message(STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
307 | if (LIBFIND_DEBUG)
308 | message(STATUS " ${PREFIX}_DEPENDENCIES=${${PREFIX}_DEPENDENCIES}")
309 | message(STATUS " ${PREFIX}_INCLUDE_OPTS=${includeopts}")
310 | message(STATUS " ${PREFIX}_INCLUDE_DIRS=${includes}")
311 | message(STATUS " ${PREFIX}_LIBRARY_OPTS=${libraryopts}")
312 | message(STATUS " ${PREFIX}_LIBRARIES=${libs}")
313 | endif()
314 | endif()
315 | return()
316 | endif()
317 |
318 | # Format messages for debug info and the type of error
319 | set(vars "Relevant CMake configuration variables:\n")
320 | foreach (i ${configopts})
321 | mark_as_advanced(CLEAR ${i})
322 | set(val ${${i}})
323 | if ("${val}" STREQUAL "${i}-NOTFOUND")
324 | set (val "")
325 | elseif (val AND NOT EXISTS "${val}")
326 | set (val "${val} (does not exist)")
327 | else()
328 | set(some_files TRUE)
329 | endif()
330 | set(vars "${vars} ${i}=${val}\n")
331 | endforeach()
332 | set(vars "${vars}You may use CMake GUI, cmake -D or ccmake to modify the values. Delete CMakeCache.txt to discard all values and force full re-detection if necessary.\n")
333 | if (version_unsuitable)
334 | set(msg "${PREFIX} ${${PREFIX}_VERSION} was found but")
335 | if (exactver)
336 | set(msg "${msg} only version ${findver} is acceptable.")
337 | else()
338 | set(msg "${msg} version ${findver} is the minimum requirement.")
339 | endif()
340 | else()
341 | if (missing_headers)
342 | set(msg "We could not find development headers for ${PREFIX}. Do you have the necessary dev package installed?")
343 | elseif (some_files)
344 | set(msg "We only found some files of ${PREFIX}, not all of them. Perhaps your installation is incomplete or maybe we just didn't look in the right place?")
345 | if(findver)
346 | set(msg "${msg} This could also be caused by incompatible version (if it helps, at least ${PREFIX} ${findver} should work).")
347 | endif()
348 | else()
349 | set(msg "We were unable to find package ${PREFIX}.")
350 | endif()
351 | endif()
352 |
353 | # Fatal error out if REQUIRED
354 | if (required)
355 | set(msg "REQUIRED PACKAGE NOT FOUND\n${msg} This package is REQUIRED and you need to install it or adjust CMake configuration in order to continue building ${CMAKE_PROJECT_NAME}.")
356 | message(FATAL_ERROR "${msg}\n${vars}")
357 | endif()
358 | # Otherwise just print a nasty warning
359 | if (NOT quiet)
360 | message(WARNING "WARNING: MISSING PACKAGE\n${msg} This package is NOT REQUIRED and you may ignore this warning but by doing so you may miss some functionality of ${CMAKE_PROJECT_NAME}. \n${vars}")
361 | endif()
362 | endfunction()
363 |
364 |
--------------------------------------------------------------------------------
/default.nix:
--------------------------------------------------------------------------------
1 | {
2 | nixpkgs ? ,
3 | pkgs ? import nixpkgs {}
4 | }:
5 |
6 | with pkgs;
7 |
8 | let
9 | extraIncludes = ps: builtins.concatStringsSep " " (
10 | builtins.map (p: "-I${stdenv.lib.getDev p}/include/SDL2") ps
11 | );
12 | in stdenv.mkDerivation {
13 | name = "eszfw";
14 | src = ./.;
15 |
16 | nativeBuildInputs = [ cmake pkgconfig ];
17 | buildInputs = [ libxml2 SDL2 SDL2_image SDL2_mixer SDL2_ttf ];
18 |
19 | NIX_CFLAGS_COMPILE = extraIncludes [ SDL2_ttf SDL2_mixer ];
20 |
21 | installPhase = ''
22 | mkdir -p $out/bin
23 | cp libeszFW.so $out/lib/libeszFW.so
24 | '';
25 | }
26 |
--------------------------------------------------------------------------------
/demo/res/backgrounds/city-bg0-with-planets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/res/backgrounds/city-bg0-with-planets.png
--------------------------------------------------------------------------------
/demo/res/backgrounds/city-bg0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/res/backgrounds/city-bg0.png
--------------------------------------------------------------------------------
/demo/res/backgrounds/city-bg1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/res/backgrounds/city-bg1.png
--------------------------------------------------------------------------------
/demo/res/backgrounds/city-bg2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/res/backgrounds/city-bg2.png
--------------------------------------------------------------------------------
/demo/res/maps/city.tmx:
--------------------------------------------------------------------------------
1 |
2 |
220 |
--------------------------------------------------------------------------------
/demo/res/sprites/player.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/res/sprites/player.png
--------------------------------------------------------------------------------
/demo/res/sprites/vehicle-misc1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/res/sprites/vehicle-misc1.png
--------------------------------------------------------------------------------
/demo/res/sprites/vehicle-misc2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/res/sprites/vehicle-misc2.png
--------------------------------------------------------------------------------
/demo/res/sprites/vehicle-police.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/res/sprites/vehicle-police.png
--------------------------------------------------------------------------------
/demo/res/sprites/vehicle-truck.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/res/sprites/vehicle-truck.png
--------------------------------------------------------------------------------
/demo/res/tilesets/city.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/res/tilesets/city.png
--------------------------------------------------------------------------------
/demo/res/tilesets/city.tsx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
--------------------------------------------------------------------------------
/demo/src/main.c:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: Beerware
2 | /**
3 | * @file main.c
4 | * @author Michael Fitzmayer
5 | * @copyright "THE BEER-WARE LICENCE" (Revision 42)
6 | */
7 |
8 | #define SDL_MAIN_HANDLED
9 |
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 |
16 | static void key_down_callback(esz_window_t* window, esz_core_t* core);
17 |
18 | #ifdef USE_LIBTMX
19 | #define MAP_FILE "res/maps/city.tmx"
20 | #else // (cute_tiled.h)
21 | #define MAP_FILE "res/maps/city.json"
22 | #endif
23 |
24 | int main()
25 | {
26 | const uint8_t* keystate = esz_get_keyboard_state();
27 | esz_status status;
28 | esz_window_t* window = NULL;
29 | esz_window_config_t config = { 640, 360, 384, 216, false, false };
30 | esz_core_t* core = NULL;
31 |
32 | status = esz_create_window("Tau Ceti", &config, &window);
33 | if (ESZ_OK != status)
34 | {
35 | goto quit;
36 | }
37 |
38 | status = esz_init_core(&core);
39 | if (ESZ_OK != status)
40 | {
41 | goto quit;
42 | }
43 |
44 | esz_load_map(MAP_FILE, window, core);
45 | esz_register_event_callback(EVENT_KEYDOWN, &key_down_callback, core);
46 |
47 | while (esz_is_core_active(core))
48 | {
49 | esz_update_core(window, core);
50 |
51 | status = esz_show_scene(window, core);
52 | if (ESZ_ERROR_CRITICAL == status)
53 | {
54 | break;
55 | }
56 | }
57 |
58 | quit:
59 | esz_unload_map(window, core);
60 | esz_destroy_core(core);
61 | esz_destroy_window(window);
62 |
63 | if (ESZ_OK != status)
64 | {
65 | return EXIT_FAILURE;
66 | }
67 |
68 | return EXIT_SUCCESS;
69 | }
70 |
71 | static void key_down_callback(esz_window_t* window, esz_core_t* core)
72 | {
73 | switch (esz_get_keycode(core))
74 | {
75 | case SDLK_F5:
76 | {
77 | if (esz_is_map_loaded(core))
78 | {
79 | esz_unload_map(window, core);
80 | }
81 | else
82 | {
83 | esz_load_map(MAP_FILE, window, core);
84 | }
85 | break;
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/demo/work/.gitignore:
--------------------------------------------------------------------------------
1 | *.tiled-session
2 |
--------------------------------------------------------------------------------
/demo/work/city.pyxel:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/work/city.pyxel
--------------------------------------------------------------------------------
/demo/work/demo.tiled-project:
--------------------------------------------------------------------------------
1 | {
2 | "automappingRulesFile": "",
3 | "commands": [
4 | ],
5 | "extensionsPath": "extensions",
6 | "folders": [
7 | "../../../TauCeti-dev/res"
8 | ],
9 | "objectTypesFile": "objecttypes.xml"
10 | }
11 |
--------------------------------------------------------------------------------
/demo/work/objecttypes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/demo/work/player.pyxel:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/work/player.pyxel
--------------------------------------------------------------------------------
/demo/work/vehicle-misc1.pyxel:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/work/vehicle-misc1.pyxel
--------------------------------------------------------------------------------
/demo/work/vehicle-misc2.pyxel:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/work/vehicle-misc2.pyxel
--------------------------------------------------------------------------------
/demo/work/vehicle-police.pyxel:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/work/vehicle-police.pyxel
--------------------------------------------------------------------------------
/demo/work/vehicle-truck.pyxel:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mupfdev/eszFW/31c04ccf1c109c39cbed761f1af0618187966878/demo/work/vehicle-truck.pyxel
--------------------------------------------------------------------------------
/doc/.gitignore:
--------------------------------------------------------------------------------
1 | html
2 | !Doxyfile
3 | !.style.css
4 | !.gitignore
5 |
--------------------------------------------------------------------------------
/doc/customdoxygen.css:
--------------------------------------------------------------------------------
1 | h1, .h1, h2, .h2, h3, .h3{
2 | font-weight: 200 !important;
3 | }
4 |
5 | #navrow1, #navrow2, #navrow3, #navrow4, #navrow5{
6 | border-bottom: 1px solid #EEEEEE;
7 | }
8 |
9 | .adjust-right {
10 | margin-left: 30px !important;
11 | font-size: 1.15em !important;
12 | }
13 | .navbar {
14 | border: 0px solid #222 !important;
15 | }
16 | .navbar-header {
17 | margin: 2em 1em;
18 | padding-left: 2em;
19 | }
20 | table {
21 | white-space:pre-wrap !important;
22 | }
23 | /*
24 | ===========================
25 | */
26 |
27 |
28 | /* Sticky footer styles
29 | -------------------------------------------------- */
30 | html,
31 | body {
32 | height: 100%;
33 | /* The html and body elements cannot have any padding or margin. */
34 | }
35 |
36 | /* Wrapper for page content to push down footer */
37 | #wrap {
38 | min-height: 100%;
39 | height: auto;
40 | /* Negative indent footer by its height */
41 | margin: 0 auto -60px;
42 | /* Pad bottom by footer height */
43 | padding: 0 0 60px;
44 | }
45 |
46 | /* Set the fixed height of the footer here */
47 | #footer {
48 | font-size: 0.9em;
49 | padding: 8px 0px;
50 | background-color: #f5f5f5;
51 | }
52 |
53 | .footer-row {
54 | line-height: 44px;
55 | }
56 |
57 | #footer > .container {
58 | padding-left: 15px;
59 | padding-right: 15px;
60 | }
61 |
62 | .footer-follow-icon {
63 | margin-left: 3px;
64 | text-decoration: none !important;
65 | }
66 |
67 | .footer-follow-icon img {
68 | width: 20px;
69 | }
70 |
71 | .footer-link {
72 | padding-top: 5px;
73 | display: inline-block;
74 | color: #999999;
75 | text-decoration: none;
76 | }
77 |
78 | .footer-copyright {
79 | text-align: center;
80 | }
81 |
82 |
83 | @media (min-width: 992px) {
84 | .footer-row {
85 | text-align: left;
86 | }
87 |
88 | .footer-icons {
89 | text-align: right;
90 | }
91 | }
92 | @media (max-width: 991px) {
93 | .footer-row {
94 | text-align: center;
95 | }
96 |
97 | .footer-icons {
98 | text-align: center;
99 | }
100 | }
101 |
102 | /* DOXYGEN Code Styles
103 | ----------------------------------- */
104 |
105 |
106 | a.qindex {
107 | font-weight: bold;
108 | }
109 |
110 | a.qindexHL {
111 | font-weight: bold;
112 | background-color: #9CAFD4;
113 | color: #ffffff;
114 | border: 1px double #869DCA;
115 | }
116 |
117 | .contents a.qindexHL:visited {
118 | color: #ffffff;
119 | }
120 |
121 | a.code, a.code:visited, a.line, a.line:visited {
122 | color: #4665A2;
123 | }
124 |
125 | a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited {
126 | color: #4665A2;
127 | }
128 |
129 | /* @end */
130 |
131 | dl.el {
132 | margin-left: -1cm;
133 | }
134 |
135 | pre.fragment {
136 | border: 1px solid #C4CFE5;
137 | background-color: #FBFCFD;
138 | padding: 4px 6px;
139 | margin: 4px 8px 4px 2px;
140 | overflow: auto;
141 | word-wrap: break-word;
142 | font-size: 9pt;
143 | line-height: 125%;
144 | font-family: monospace, fixed;
145 | font-size: 105%;
146 | }
147 |
148 | div.fragment {
149 | padding: 4px 6px;
150 | margin: 4px 8px 4px 2px;
151 | border: 1px solid #C4CFE5;
152 | }
153 |
154 | div.line {
155 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
156 | font-size: 12px;
157 | min-height: 13px;
158 | line-height: 1.0;
159 | text-wrap: unrestricted;
160 | white-space: -moz-pre-wrap; /* Moz */
161 | white-space: -pre-wrap; /* Opera 4-6 */
162 | white-space: -o-pre-wrap; /* Opera 7 */
163 | white-space: pre-wrap; /* CSS3 */
164 | word-wrap: normal; /* IE 5.5+ */
165 | text-indent: -53px;
166 | padding-left: 53px;
167 | padding-bottom: 0px;
168 | margin: 0px;
169 | -webkit-transition-property: background-color, box-shadow;
170 | -webkit-transition-duration: 0.5s;
171 | -moz-transition-property: background-color, box-shadow;
172 | -moz-transition-duration: 0.5s;
173 | -ms-transition-property: background-color, box-shadow;
174 | -ms-transition-duration: 0.5s;
175 | -o-transition-property: background-color, box-shadow;
176 | -o-transition-duration: 0.5s;
177 | transition-property: background-color, box-shadow;
178 | transition-duration: 0.5s;
179 | }
180 | div.line:hover{
181 | background-color: #FBFF00;
182 | }
183 |
184 | div.line.glow {
185 | background-color: cyan;
186 | box-shadow: 0 0 10px cyan;
187 | }
188 |
189 |
190 | span.lineno {
191 | padding-right: 4px;
192 | text-align: right;
193 | color:rgba(0,0,0,0.3);
194 | border-right: 1px solid #EEE;
195 | border-left: 1px solid #EEE;
196 | background-color: #FFF;
197 | white-space: pre;
198 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace ;
199 | }
200 | span.lineno a {
201 | background-color: #FAFAFA;
202 | cursor:pointer;
203 | }
204 |
205 | span.lineno a:hover {
206 | background-color: #EFE200;
207 | color: #1e1e1e;
208 | }
209 |
210 | div.groupHeader {
211 | margin-left: 16px;
212 | margin-top: 12px;
213 | font-weight: bold;
214 | }
215 |
216 | div.groupText {
217 | margin-left: 16px;
218 | font-style: italic;
219 | }
220 |
221 | /* @group Code Colorization */
222 |
223 | span.keyword {
224 | color: #008000
225 | }
226 |
227 | span.keywordtype {
228 | color: #604020
229 | }
230 |
231 | span.keywordflow {
232 | color: #e08000
233 | }
234 |
235 | span.comment {
236 | color: #800000
237 | }
238 |
239 | span.preprocessor {
240 | color: #806020
241 | }
242 |
243 | span.stringliteral {
244 | color: #002080
245 | }
246 |
247 | span.charliteral {
248 | color: #008080
249 | }
250 |
251 | span.vhdldigit {
252 | color: #ff00ff
253 | }
254 |
255 | span.vhdlchar {
256 | color: #000000
257 | }
258 |
259 | span.vhdlkeyword {
260 | color: #700070
261 | }
262 |
263 | span.vhdllogic {
264 | color: #ff0000
265 | }
266 |
267 | blockquote {
268 | background-color: #F7F8FB;
269 | border-left: 2px solid #9CAFD4;
270 | margin: 0 24px 0 4px;
271 | padding: 0 12px 0 16px;
272 | }
273 |
274 | /*---------------- Search Box */
275 |
276 | #search-box {
277 | margin: 10px 0px;
278 | }
279 | #search-box .close {
280 | display: none;
281 | position: absolute;
282 | right: 0px;
283 | padding: 6px 12px;
284 | z-index: 5;
285 | }
286 |
287 | /*---------------- Search results window */
288 |
289 | #search-results-window {
290 | display: none;
291 | }
292 |
293 | iframe#MSearchResults {
294 | width: 100%;
295 | height: 15em;
296 | }
297 |
298 | .SRChildren {
299 | padding-left: 3ex; padding-bottom: .5em
300 | }
301 | .SRPage .SRChildren {
302 | display: none;
303 | }
304 | a.SRScope {
305 | display: block;
306 | }
307 | a.SRSymbol:focus, a.SRSymbol:active,
308 | a.SRScope:focus, a.SRScope:active {
309 | text-decoration: underline;
310 | }
311 | span.SRScope {
312 | padding-left: 4px;
313 | }
314 | .SRResult {
315 | display: none;
316 | }
317 |
318 | /* class and file list */
319 | .directory .icona,
320 | .directory .arrow {
321 | height: auto;
322 | }
323 | .directory .icona .icon {
324 | height: 16px;
325 | }
326 | .directory .icondoc {
327 | background-position: 0px 0px;
328 | height: 20px;
329 | }
330 | .directory .iconfopen {
331 | background-position: 0px 0px;
332 | }
333 | .directory td.entry {
334 | padding: 7px 8px 6px 8px;
335 | }
336 |
337 | .table > tbody > tr > td.memSeparator {
338 | line-height: 0;
339 | .table-hover;
340 |
341 | }
342 |
343 | .memItemLeft, .memTemplItemLeft {
344 | white-space: normal;
345 | }
346 |
347 | /* enumerations */
348 | .panel-body thead > tr {
349 | background-color: #e0e0e0;
350 | }
351 |
352 | /* todo lists */
353 | .todoname,
354 | .todoname a {
355 | font-weight: bold;
356 | }
357 |
358 | /* Class title */
359 | .summary {
360 | margin-top: 25px;
361 | }
362 | .page-header {
363 | margin: 20px 0px !important;
364 | }
365 | .page-header .title {
366 | display: inline-block;
367 | }
368 | .page-header .pull-right {
369 | margin-top: 0.3em;
370 | margin-left: 0.5em;
371 | }
372 | .page-header .label {
373 | font-size: 50%;
374 | }
375 |
376 | img.inline {
377 | max-width: 75%;
378 | }
379 |
--------------------------------------------------------------------------------
/doc/doxy-boot.js:
--------------------------------------------------------------------------------
1 | $( document ).ready(function() {
2 |
3 | $("div.headertitle").addClass("page-header");
4 | $("div.title").addClass("h1");
5 |
6 | $('li > a[href="index.html"] > span').before(" ");
7 | $('li > a[href="modules.html"] > span').before(" ");
8 | $('li > a[href="namespaces.html"] > span').before(" ");
9 | $('li > a[href="annotated.html"] > span').before(" ");
10 | $('li > a[href="classes.html"] > span').before(" ");
11 | $('li > a[href="inherits.html"] > span').before(" ");
12 | $('li > a[href="functions.html"] > span').before(" ");
13 | $('li > a[href="functions_func.html"] > span').before(" ");
14 | $('li > a[href="functions_vars.html"] > span').before(" ");
15 | $('li > a[href="functions_enum.html"] > span').before(" ");
16 | $('li > a[href="functions_eval.html"] > span').before(" ");
17 | $('img[src="ftv2ns.png"]').replaceWith('N ');
18 | $('img[src="ftv2cl.png"]').replaceWith('C ');
19 |
20 | $("ul.tablist").addClass("nav nav-pills nav-justified");
21 | $("ul.tablist").css("margin-top", "0.5em");
22 | $("ul.tablist").css("margin-bottom", "0.5em");
23 | $("li.current").addClass("active");
24 | $("iframe").attr("scrolling", "yes");
25 |
26 | $("#nav-path > ul").addClass("breadcrumb");
27 |
28 | $("table.params").addClass("table");
29 | $("div.ingroups").wrapInner("");
30 | $("div.levels").css("margin", "0.5em");
31 | $("div.levels > span").addClass("btn btn-default btn-xs");
32 | $("div.levels > span").css("margin-right", "0.25em");
33 |
34 | $("table.directory").addClass("table table-striped");
35 | $("div.summary > a").addClass("btn btn-default btn-xs");
36 | $("table.fieldtable").addClass("table");
37 | $(".fragment").addClass("well");
38 | $(".memitem").addClass("panel panel-default");
39 | $(".memproto").addClass("panel-heading");
40 | $(".memdoc").addClass("panel-body");
41 | $("span.mlabel").addClass("label label-info");
42 |
43 | $("table.memberdecls").addClass("table");
44 | $("[class^=memitem]").addClass("active");
45 |
46 | $("div.ah").addClass("btn btn-default");
47 | $("span.mlabels").addClass("pull-right");
48 | $("table.mlabels").css("width", "100%")
49 | $("td.mlabels-right").addClass("pull-right");
50 |
51 | $("div.ttc").addClass("panel panel-primary");
52 | $("div.ttname").addClass("panel-heading");
53 | $("div.ttname a").css("color", 'white');
54 | $("div.ttdef,div.ttdoc,div.ttdeci").addClass("panel-body");
55 |
56 | $('div.fragment.well div.line:first').css('margin-top', '2px');
57 | $('div.fragment.well div.line:last').css('margin-bottom', '2px');
58 |
59 | $('table.doxtable').removeClass('doxtable').addClass('table table-striped table-bordered').each(function(){
60 | $(this).prepend('');
61 | $(this).find('tbody > tr:first').prependTo($(this).find('thead'));
62 |
63 | $(this).find('td > span.success').parent().addClass('success');
64 | $(this).find('td > span.warning').parent().addClass('warning');
65 | $(this).find('td > span.danger').parent().addClass('danger');
66 | });
67 |
68 |
69 |
70 | if($('div.fragment.well div.ttc').length > 0)
71 | {
72 | $('div.fragment.well div.line:first').parent().removeClass('fragment well');
73 | }
74 |
75 | $('table.memberdecls').find('.memItemRight').each(function(){
76 | $(this).contents().appendTo($(this).siblings('.memItemLeft'));
77 | $(this).siblings('.memItemLeft').attr('align', 'left');
78 | });
79 |
80 | $('table.memberdecls').find('.memTemplItemRight').each(function(){
81 | $(this).contents().appendTo($(this).siblings('.memTemplItemLeft'));
82 | $(this).siblings('.memTemplItemLeft').attr('align', 'left');
83 | });
84 |
85 | function getOriginalWidthOfImg(img_element) {
86 | var t = new Image();
87 | t.src = (img_element.getAttribute ? img_element.getAttribute("src") : false) || img_element.src;
88 | return t.width;
89 | }
90 |
91 | $('div.dyncontent').find('img').each(function(){
92 | if(getOriginalWidthOfImg($(this)[0]) > $('#content>div.container').width())
93 | $(this).css('width', '100%');
94 | });
95 |
96 |
97 | /* responsive search box */
98 | $('#MSearchBox').parent().remove();
99 |
100 | var nav_container = $('');
101 | $('#navrow1').parent().prepend(nav_container);
102 |
103 | var left_nav = $('');
104 | for (i = 0; i < 6; i++) {
105 | var navrow = $('#navrow' + i + ' > ul.tablist').detach();
106 | left_nav.append(navrow);
107 | $('#navrow' + i).remove();
108 | }
109 | var right_nav = $('').append('\
110 | ');
121 | $(nav_container).append(left_nav);
122 | $(nav_container).append(right_nav);
123 |
124 | $('#MSearchSelectWindow .SelectionMark').remove();
125 | var search_selectors = $('#MSearchSelectWindow .SelectItem');
126 | for (var i = 0; i < search_selectors.length; i += 1) {
127 | var element_a = $('').text($(search_selectors[i]).text());
128 |
129 | element_a.click(function(){
130 | $('#search-box .dropdown-menu li').removeClass('active');
131 | $(this).parent().addClass('active');
132 | searchBox.OnSelectItem($('#search-box li a').index(this));
133 | searchBox.Search();
134 | return false;
135 | });
136 |
137 | var element = $('').append(element_a);
138 | $('#search-box .dropdown-menu').append(element);
139 | }
140 | $('#MSearchSelectWindow').remove();
141 |
142 | $('#search-box .close').click(function (){
143 | searchBox.CloseResultsWindow();
144 | });
145 |
146 | $('body').append('');
147 | $('body').append('');
148 | $('body').append('');
149 |
150 | searchBox.searchLabel = '';
151 | searchBox.DOMSearchField = function() {
152 | return document.getElementById("search-field");
153 | }
154 | searchBox.DOMSearchClose = function(){
155 | return document.getElementById("search-close");
156 | }
157 |
158 |
159 | /* search results */
160 | var results_iframe = $('#MSearchResults').detach();
161 | $('#MSearchResultsWindow')
162 | .attr('id', 'search-results-window')
163 | .addClass('panel panel-default')
164 | .append(
165 | '\
166 |
Search Results
\
167 | \
168 | '
169 | );
170 | $('#search-results-window .panel-body').append(results_iframe);
171 |
172 | searchBox.DOMPopupSearchResultsWindow = function() {
173 | return document.getElementById("search-results-window");
174 | }
175 |
176 | function update_search_results_window() {
177 | $('#search-results-window').removeClass('panel-default panel-success panel-warning panel-danger')
178 | var status = $('#MSearchResults').contents().find('.SRStatus:visible');
179 | if (status.length > 0) {
180 | switch(status.attr('id')) {
181 | case 'Loading':
182 | case 'Searching':
183 | $('#search-results-window').addClass('panel-warning');
184 | break;
185 | case 'NoMatches':
186 | $('#search-results-window').addClass('panel-danger');
187 | break;
188 | default:
189 | $('#search-results-window').addClass('panel-default');
190 | }
191 | } else {
192 | $('#search-results-window').addClass('panel-success');
193 | }
194 | }
195 | $('#MSearchResults').load(function() {
196 | $('#MSearchResults').contents().find('link[href="search.css"]').attr('href','../doxygen.css');
197 | $('#MSearchResults').contents().find('head').append(
198 | '');
199 |
200 | update_search_results_window();
201 |
202 | // detect status changes (only for search with external search backend)
203 | var observer = new MutationObserver(function(mutations) {
204 | update_search_results_window();
205 | });
206 | var config = { attributes: true};
207 |
208 | var targets = $('#MSearchResults').contents().find('.SRStatus');
209 | for (i = 0; i < targets.length; i++) {
210 | observer.observe(targets[i], config);
211 | }
212 | });
213 |
214 |
215 | /* enumerations */
216 | $('table.fieldtable').removeClass('fieldtable').addClass('table table-striped table-bordered').each(function(){
217 | $(this).prepend('');
218 | $(this).find('tbody > tr:first').prependTo($(this).find('thead'));
219 |
220 | $(this).find('td > span.success').parent().addClass('success');
221 | $(this).find('td > span.warning').parent().addClass('warning');
222 | $(this).find('td > span.danger').parent().addClass('danger');
223 | });
224 |
225 | /* todo list */
226 | var todoelements = $('.contents > .textblock > dl.reflist > dt, .contents > .textblock > dl.reflist > dd');
227 | for (var i = 0; i < todoelements.length; i += 2) {
228 | $('.contents > .textblock').append(
229 | ''
230 | + "
" + $(todoelements[i]).html() + "
"
231 | + "
" + $(todoelements[i+1]).html() + "
"
232 | + '
');
233 | }
234 | $('.contents > .textblock > dl').remove();
235 |
236 |
237 | $(".memitem").removeClass('memitem');
238 | $(".memproto").removeClass('memproto');
239 | $(".memdoc").removeClass('memdoc');
240 | $("span.mlabel").removeClass('mlabel');
241 | $("table.memberdecls").removeClass('memberdecls');
242 | $("[class^=memitem]").removeClass('memitem');
243 | $("span.mlabels").removeClass('mlabels');
244 | $("table.mlabels").removeClass('mlabels');
245 | $("td.mlabels-right").removeClass('mlabels-right');
246 | $(".navpath").removeClass('navpath');
247 | $("li.navelem").removeClass('navelem');
248 | $("a.el").removeClass('el');
249 | $("div.ah").removeClass('ah');
250 | $("div.header").removeClass("header");
251 |
252 | $('.mdescLeft').each(function(){
253 | if($(this).html()==" ") {
254 | $(this).siblings('.mdescRight').attr('colspan', 2);
255 | $(this).remove();
256 | }
257 | });
258 | $('td.memItemLeft').each(function(){
259 | if($(this).siblings('.memItemRight').html()=="") {
260 | $(this).attr('colspan', 2);
261 | $(this).siblings('.memItemRight').remove();
262 | }
263 | });
264 | $('td.memTemplItemLeft').each(function(){
265 | if($(this).siblings('.memTemplItemRight').html()=="") {
266 | $(this).attr('colspan', 2);
267 | $(this).siblings('.memTemplItemRight').remove();
268 | }
269 | });
270 | searchBox.CloseResultsWindow();
271 | });
272 |
--------------------------------------------------------------------------------
/doc/footer.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
24 |
25 |