Commit 90041eb4 by beoran

Eruta Blessed Savior. New repository with less cruft, hopefully, but stil a lot of image files...

parents

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# backups
*~
# Cmake generated
CMakeFiles
Testing
CMakeCache.txt
CTestTestfile.cmake
Makefile
*.ninja
.ninja_log
# Testing
test_graph.png
# binaries
bin
# build dir CONTENTS
build
# autogenerated docs
doc/nd
doc/nd_project
cmake_minimum_required(VERSION 2.8)
# Set policy: link_directories is relative to source dir
cmake_policy(SET CMP0015 NEW)
# Set the project name.
project(ERUTA C)
# Play with PCC
# SET(CMAKE_C_COMPILER /usr/local/bin/pcc)
# Play with UCC
# SET(CMAKE_C_COMPILER /usr/local/lib/ucc/ucc)
# tell CMake to search first in the cmake subdirectory for FIND_PACKAGE() or INCLUDE()
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
if(CMAKE_COMPILER_IS_GNUCC)
set(COMPILER_GCC 1)
set(CMAKE_C_FLAGS "-W -Wall -wunused -Wno-unused -Wno-unknown-pragmas -g -std=c99 -ffast-math -fsanitize=address -fstrict-aliasing -Wstrict-aliasing=2")
# set(CMAKE_LD_FLAGS "-pg")
# always use gnu99, debugging, all warnings except unused and unknown pragmas.
# when compiling with gnu compiler.
# Warn about alisasing because otherwise aliasing problems it may not be detected.
endif(CMAKE_COMPILER_IS_GNUCC)
# or for PCC
# set(CMAKE_C_FLAGS "-fpic -fPIC")
set(CMAKE_C_FLAGS "-W -Wall -Wno-unused -Wno-unknown-pragmas -g -std=c99 -ffast-math -fstrict-aliasing -Wstrict-aliasing=2")
find_package(Mruby REQUIRED)
# Finds Allegro using pkgconfig, so it must be configured correctly
find_package(Allegro5 REQUIRED)
find_package(PNG REQUIRED)
find_package(JPEG REQUIRED)
# Set include and lib dirs.
include_directories(${ALLEGRO_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${JPEG_INCLUDE_DIR} ${MRUBY_INCLUDE_DIR})
set(ERUTA_LIBS ${LIBS} ${OBJC_LIBRARIES} ${ALLEGRO_LIBRARIES} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${MRUBY_LIBRARIES})
include_directories("include")
# add_subdirectory("src")
include(ErutaFiles)
set_source_files_properties(${ERUTA_SRC_FILES} PROPERTIES LANGUAGE C)
# set_source_files_properties(${ERUTA_OBJC_SRC_FILES} PROPERTIES LANGUAGE C)
# src/BNObject.m
# set_source_files_properties(BNObject.m PROPERTIES LANGUAGE C)
# eruta exe in the bin subdir (first one should work, but doesnt, hmmm...)
set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
add_library(ERUTA_OBJECTS OBJECT ${ERUTA_SRC_FILES})
add_executable(eruta $<TARGET_OBJECTS:ERUTA_OBJECTS> src/main.c)
target_link_libraries(eruta ${ERUTA_LIBS})
enable_testing()
# Let ctest run valgrind
# test exe in the test subdir (first one should work, but doesnt, hmmm...)
set(CMAKE_CTEST_OPTIONS --output-on-failure)
set(CTEST_OUTPUT_ON_FAILURE TRUE)
set(CTEST_MEMORYCHECK_COMMAND:FILEPATH "/usr/bin/valgrind")
add_subdirectory("test")
The Sleepycat License
Eruta is copyright (c)
2007-2016 Beoran (beoran@rubyforge.org),
2012 Alexbond45 ,
2012 LunarKnite .
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Redistributions in any form must be accompanied by information on how to
obtain complete source code for the Eruta software and any accompanying
software that uses the Eruta software. The source code must either be
included in the distribution or be available for no more than the cost of
distribution plus a nominal fee, and must be freely redistributable under
reasonable conditions. For an executable file, complete source code means
the source code for all modules it contains. It does not include source code
for modules or files that typically accompany the major components of the
operating system on which the executable file runs.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This diff is collapsed. Click to expand it.
# All source files except main.c to enable testing
# by using cmake's fake library feature. Don't forget to add new source
# files here manually.
set(BF_SRC_FILES
src/bf/BFObject.c
src/bf/BFClass.c
src/bf/BFArray.c
src/bf/BFMap.c
src/bf/BFInteger.c
src/bf/BFDouble.c
src/bf/BFString.c
src/bf/BFValue.c
)
set(ERUTA_SRC_FILES
src/alps.c
src/area.c
src/bad.c
src/bevec.c
src/brex.c
src/bump.c
src/bumpshape.c
src/bxml.c
src/bxmlparser.c
src/camera.c
src/callrb.c
src/draw.c
src/dynar.c
src/effect.c
src/event.c
src/every.c
src/flags.c
src/fifi.c
src/glh.c
src/hatab.c
src/ifa.c
src/inli.c
src/intgrid.c
src/laytext.c
src/mem.c
src/mobile.c
src/mode.c
src/monolog.c
src/obj.c
src/pique.c
src/pointergrid.c
src/react.c
src/rebl.c
src/rebox.c
src/resor.c
src/rh.c
src/scegra.c
src/ses.c
src/silut.c
src/sound.c
src/sprite.c
src/spritelist.c
src/spritestate.c
src/spritelayout.c
src/state.c
src/store.c
src/str.c
src/thing.c
src/tile.c
src/tileio.c
src/tilemap.c
src/tilepane.c
src/tarray.c
src/tmatrix.c
src/toruby.c
src/tr_audio.c
src/tr_path.c
src/tr_store.c
src/tr_graph.c
src/tr_sprite.c
src/tr_thing.c
src/ui.c
src/utf8.c
src/widget.c
src/xresor.c
src/zori.c
)
find_package(PkgConfig)
# Find main allegro and assume the rest is there too
pkg_check_modules(Allegro5_PKGCONF allegro-5)
# Perhaps use this later?
# pkg_search_module(ALLEGRO5 REQUIRED allegro-5 allegro-5.0)
# MESSAGE("lib: ${Allegro5_PKGCONF_LIBRARY_DIRS}")
# MESSAGE("include: ${Allegro5_PKGCONF_INCLUDE_DIRS}")
# Include dir
find_path(Allegro5_INCLUDE_DIR
NAMES allegro5/allegro5.h
PATHS ${Allegro5_PKGCONF_INCLUDE_DIRS}
)
# message("include dir: ${Allegro5_INCLUDE_DIR}")
# Names of all libraries in Allegro, without versions
set(ALLEGRO5_ALL_LIBRARIES
allegro allegro_image allegro_font
allegro_primitives allegro_ttf allegro_audio
allegro_dialog allegro_memfile allegro_acodec
allegro_color allegro_main allegro_physfs
)
# set(ALLEGRO5_LIBRARIES "")
# Find all libraries to link
foreach(ALLEGRO5_ONE_LIBRARY ${ALLEGRO5_ALL_LIBRARIES})
# message("${ALLEGRO5_ONE_LIBRARY}")
find_library("${ALLEGRO5_ONE_LIBRARY}_AID" "${ALLEGRO5_ONE_LIBRARY}"
${Allegro5_PKGCONF_LIBRARY_DIRS}
)
set(Allegro5_LIBRARIES
"${Allegro5_LIBRARIES}" "${${ALLEGRO5_ONE_LIBRARY}_AID}")
# MESSAGE("${Allegro5_LIBRARIES}")
endforeach(ALLEGRO5_ONE_LIBRARY)
# Remove first empty erroneous "library"
list(REMOVE_AT Allegro5_LIBRARIES 0)
# MESSAGE("${Allegro5_LIBRARIES}")
# message("${ALLEGRO5_LIBRARIES}")
# allegro_image allegro_font allegro_primitives
# allegro_ttf allegro_audio allegro_dialog allegro_acodec
# allegro_color allegro_main allegro_physfs
# Set the include dir variables and the libraries and let libfind_process do the rest.
set(ALLEGRO_INCLUDE_DIR "${Allegro5_INCLUDE_DIR}")
set(ALLEGRO_LIBRARIES "${Allegro5_LIBRARIES}")
# libfind_process(Allegro5)
# MESSAGE("all libs: ${ALLEGRO_LIBRARIES}")
# MESSAGE("all include: ${ALLEGRO_INCLUDE_DIR}")
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Allegro5 DEFAULT_MSG ALLEGRO_LIBRARIES ALLEGRO_INCLUDE_DIR)
MARK_AS_ADVANCED(ALLEGRO_INCLUDE_DIR ALLEGRO_LIBRARIES)
# MESSAGE("${ALLEGRO_LIBRARIES}")
find_package(PkgConfig)
# Find main allegro and assume the rest is there too
pkg_check_modules(Allegro50_PKGCONF allegro-5.0)
# MESSAGE("lib: ${Allegro50_PKGCONF_LIBRARY_DIRS}")
# MESSAGE("include: ${Allegro50_PKGCONF_INCLUDE_DIRS}")
# Include dir
find_path(Allegro50_INCLUDE_DIR
NAMES allegro5/allegro5.h
PATHS ${Allegro50_PKGCONF_INCLUDE_DIRS}
)
# message("include dir: ${Allegro50_INCLUDE_DIR}")
# Names of all libraries in Allegro, without versions
set(ALLEGRO50_ALL_LIBRARIES
allegro allegro_image allegro_font
allegro_primitives allegro_ttf allegro_audio
allegro_dialog allegro_memfile allegro_acodec
allegro_color allegro_main allegro_physfs
)
# set(ALLEGRO50_LIBRARIES "")
# Find all libraries to link
foreach(ALLEGRO50_ONE_LIBRARY ${ALLEGRO50_ALL_LIBRARIES})
# message("${ALLEGRO50_ONE_LIBRARY}")
find_library("${ALLEGRO50_ONE_LIBRARY}_AID" "${ALLEGRO50_ONE_LIBRARY}"
${Allegro50_PKGCONF_LIBRARY_DIRS}
)
set(Allegro50_LIBRARIES
"${Allegro50_LIBRARIES}" "${${ALLEGRO50_ONE_LIBRARY}_AID}")
# MESSAGE("${Allegro50_LIBRARIES}")
endforeach(ALLEGRO50_ONE_LIBRARY)
# Remove first empty erroneous "library"
list(REMOVE_AT Allegro50_LIBRARIES 0)
# MESSAGE("${Allegro50_LIBRARIES}")
# message("${ALLEGRO50_LIBRARIES}")
# allegro_image allegro_font allegro_primitives
# allegro_ttf allegro_audio allegro_dialog allegro_acodec
# allegro_color allegro_main allegro_physfs
# Set the include dir variables and the libraries and let libfind_process do the rest.
set(ALLEGRO_INCLUDE_DIR "${Allegro50_INCLUDE_DIR}")
set(ALLEGRO_LIBRARIES "${Allegro50_LIBRARIES}")
# libfind_process(Allegro50)
# MESSAGE("all libs: ${ALLEGRO_LIBRARIES}")
# MESSAGE("all include: ${ALLEGRO_INCLUDE_DIR}")
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Allegro50 DEFAULT_MSG ALLEGRO_LIBRARIES ALLEGRO_INCLUDE_DIR)
MARK_AS_ADVANCED(ALLEGRO_INCLUDE_DIR ALLEGRO_LIBRARIES)
# MESSAGE("${ALLEGRO_LIBRARIES}")
find_package(PkgConfig)
# Find main allegro and assume the rest is there too
pkg_check_modules(Allegro51_PKGCONF allegro-5.1)
# MESSAGE("lib: ${Allegro51_PKGCONF_LIBRARY_DIRS}")
# MESSAGE("include: ${Allegro51_PKGCONF_INCLUDE_DIRS}")
# Include dir
find_path(Allegro51_INCLUDE_DIR
NAMES allegro5/allegro5.h
PATHS ${Allegro51_PKGCONF_INCLUDE_DIRS}
)
# message("include dir: ${Allegro51_INCLUDE_DIR}")
# Names of all libraries in Allegro, without versions
set(ALLEGRO51_ALL_LIBRARIES
allegro allegro_image allegro_font
allegro_primitives allegro_ttf allegro_audio
allegro_dialog allegro_memfile allegro_acodec
allegro_color allegro_main allegro_physfs
)
# set(ALLEGRO51_LIBRARIES "")
# Find all libraries to link
foreach(ALLEGRO51_ONE_LIBRARY ${ALLEGRO51_ALL_LIBRARIES})
# message("${ALLEGRO51_ONE_LIBRARY}")
find_library("${ALLEGRO51_ONE_LIBRARY}_AID" "${ALLEGRO51_ONE_LIBRARY}"
${Allegro51_PKGCONF_LIBRARY_DIRS}
)
set(Allegro51_LIBRARIES
"${Allegro51_LIBRARIES}" "${${ALLEGRO51_ONE_LIBRARY}_AID}")
# MESSAGE("${Allegro51_LIBRARIES}")
endforeach(ALLEGRO51_ONE_LIBRARY)
# Remove first empty erroneous "library"
list(REMOVE_AT Allegro51_LIBRARIES 0)
# MESSAGE("${Allegro51_LIBRARIES}")
# message("${ALLEGRO51_LIBRARIES}")
# allegro_image allegro_font allegro_primitives
# allegro_ttf allegro_audio allegro_dialog allegro_acodec
# allegro_color allegro_main allegro_physfs
# Set the include dir variables and the libraries and let libfind_process do the rest.
set(ALLEGRO_INCLUDE_DIR "${Allegro51_INCLUDE_DIR}")
set(ALLEGRO_LIBRARIES "${Allegro51_LIBRARIES}")
# libfind_process(Allegro51)
# MESSAGE("all libs: ${ALLEGRO_LIBRARIES}")
# MESSAGE("all include: ${ALLEGRO_INCLUDE_DIR}")
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Allegro51 DEFAULT_MSG ALLEGRO_LIBRARIES ALLEGRO_INCLUDE_DIR)
MARK_AS_ADVANCED(ALLEGRO_INCLUDE_DIR ALLEGRO_LIBRARIES)
# MESSAGE("${ALLEGRO_LIBRARIES}")
# Locate Chipmunk physics library
# This module defines
# CHIPMUNK_FOUND, if false, do not try to link to Lua
# CHIPMUNK_LIBRARIES
# CHIPMNK_INCLUDE_DIR, where to find chipmunk.h
#
# Note that the expected include convention is
# #include <chipmunk.h>
# and not
# #include <chipmunk/chipmunk.h>
# This is because, the chipmunk location is not standardized and may exist
# in locations other than chipmunk/
#=============================================================================
# Copyright 2012, Beoran beoran@rubyforge.org.
#
# License: you just do whatever you want with this file.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
#=============================================================================
FIND_PATH(CHIPMUNK_INCLUDE_DIR chipmunk.h
HINTS
$ENV{CHIPMUNK_DIR}
PATH_SUFFIXES include/chipmunk include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts