From: TimePath Date: Thu, 18 Feb 2016 09:40:39 +0000 (+1100) Subject: Cmake cleanup X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=957318566ec475996035d79ce4b27f35d7302d8d;p=xonotic%2Fnetradiant.git Cmake cleanup --- diff --git a/.cproject b/.cproject deleted file mode 100644 index 4a2a3989..00000000 --- a/.cproject +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.gitignore b/.gitignore index 25031518..89a03841 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.[oda] +build/ .settings games install -games diff --git a/.project b/.project deleted file mode 100644 index daa477fe..00000000 --- a/.project +++ /dev/null @@ -1,27 +0,0 @@ - - - NetRadiant - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bf7ef2f..edd4f254 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,15 @@ cmake_minimum_required(VERSION 2.8 FATAL_ERROR) project(NetRadiant C CXX) +# Enable Debug by default, can be changed with -DCMAKE_BUILD_TYPE=Release +if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Debug) +endif () + +#----------------------------------------------------------------------- +# Version +#----------------------------------------------------------------------- + #CMake 3.0+ would allow this in project() set(NetRadiant_VERSION_MAJOR 1) set(NetRadiant_VERSION_MINOR 5) @@ -10,29 +19,27 @@ set(NetRadiant_VERSION ${NetRadiant_VERSION_MAJOR}.${NetRadiant_VERSION_MINOR}.$ set(Q3MAP_VERSION 2.5.17n) set(Q3MAP_STREAM_VERSION 1) -set(RADIANT_VERSION_STRING "${NetRadiant_VERSION}n${GIT_VERSION}") -execute_process(COMMAND git rev-parse --short HEAD - OUTPUT_VARIABLE GIT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - -if(GIT_VERSION) +find_package(Git REQUIRED) +execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE +) +set(RADIANT_VERSION_STRING "${NetRadiant_VERSION}n") +if (GIT_VERSION) set(RADIANT_VERSION_STRING "${RADIANT_VERSION_STRING}-git-${GIT_VERSION}") set(Q3MAP_VERSION "${Q3MAP_VERSION}-git-${GIT_VERSION}") - add_custom_target(version_git ALL - COMMAND [ "`git rev-parse --short HEAD`" != "${GIT_VERSION}" ] && ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR} - VERBATIM - ) -endif() +endif () -if(CMAKE_EXECUTABLE_SUFFIX) - set(RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX}) -else() - execute_process(COMMAND uname -m - OUTPUT_VARIABLE RADIANT_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE) -endif() +configure_file("${CMAKE_SOURCE_DIR}/include/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp") set(RADIANT_ABOUTMSG "Custom build" CACHE STRING "About message") message(STATUS "Building ${PROJECT_NAME} ${RADIANT_VERSION_STRING} ${RADIANT_ABOUTMSG}") +#----------------------------------------------------------------------- +# Language standard +#----------------------------------------------------------------------- set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -40,28 +47,24 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX) include(CheckCXXCompilerFlag) check_cxx_compiler_flag(--std=c++${CMAKE_CXX_STANDARD} STD_CXX) - if(STD_CXX) + if (STD_CXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++${CMAKE_CXX_STANDARD}") - else() + else () message(SEND_ERROR "Requires C++${CMAKE_CXX_STANDARD} or better") - endif() -else() + endif () +else () message(WARNING "Unrecognized compiler: ${CMAKE_CXX_COMPILER_ID}, make sure it supports C++${CMAKE_CXX_STANDARD}") -endif() - -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) +endif () -# Enable Debug by default, can be changed with -D CMAKE_BUILD_TYPE=Release -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Debug) -endif() -if(CMAKE_BUILD_TYPE MATCHES Debug) - add_definitions(-D_DEBUG=1) -endif() +#----------------------------------------------------------------------- +# Defs +#----------------------------------------------------------------------- -find_package(OpenGL REQUIRED) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") -add_definitions(-DRADIANT_EXECUTABLE="${RADIANT_EXECUTABLE}") +if (CMAKE_BUILD_TYPE MATCHES Debug) + add_definitions(-D_DEBUG=1) +endif () add_definitions( -DGTK_DISABLE_SINGLE_INCLUDES @@ -70,137 +73,135 @@ add_definitions( -DGTK_DISABLE_DEPRECATED ) -if(NOT WIN32) +if (NOT WIN32) add_definitions( - -DPOSIX=1 - -DXWINDOWS=1 + -DPOSIX=1 + -DXWINDOWS=1 ) find_package(X11 REQUIRED) include_directories(${X11_INCLUDE_DIR}) -else() +else () add_definitions( - -D_WIN32 + -D_WIN32 ) -endif() +endif () -configure_file("${CMAKE_SOURCE_DIR}/include/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp") -set(INCLUDELIST - include/aboutmsg.h - include/cullable.cpp - include/cullable.h - include/editable.cpp - include/editable.h - include/iarchive.cpp - include/iarchive.h - include/ibrush.cpp - include/ibrush.h - include/icamera.cpp - include/icamera.h - include/idatastream.cpp - include/idatastream.h - include/ieclass.cpp - include/ieclass.h - include/ientity.cpp - include/ientity.h - include/ifilesystem.cpp - include/ifilesystem.h - include/ifiletypes.cpp - include/ifiletypes.h - include/ifilter.cpp - include/ifilter.h - include/igl.cpp - include/igl.h - include/iglrender.cpp - include/iglrender.h - include/igtkgl.cpp - include/igtkgl.h - include/iimage.cpp - include/iimage.h - include/imap.cpp - include/imap.h - include/imodel.cpp - include/imodel.h - include/ipatch.cpp - include/ipatch.h - include/iplugin.cpp - include/iplugin.h - include/ireference.cpp - include/ireference.h - include/irender.cpp - include/irender.h - include/iscenegraph.cpp - include/iscenegraph.h - include/iscriplib.cpp - include/iscriplib.h - include/iselection.cpp - include/iselection.h - include/ishaders.cpp - include/ishaders.h - include/itexdef.cpp - include/itexdef.h - include/itextstream.cpp - include/itextstream.h - include/itextures.cpp - include/itextures.h - include/itoolbar.cpp - include/itoolbar.h - include/iundo.cpp - include/iundo.h - include/mapfile.cpp - include/mapfile.h - include/modelskin.cpp - include/modelskin.h - include/moduleobserver.cpp - include/moduleobserver.h - include/modulesystem.cpp - include/modulesystem.h - include/nameable.cpp - include/nameable.h - include/namespace.cpp - include/namespace.h - include/preferencesystem.cpp - include/preferencesystem.h - include/qerplugin.cpp - include/qerplugin.h - include/renderable.cpp - include/renderable.h - include/selectable.cpp - include/selectable.h - include/stream_version.h - include/version.h - include/warnings.h - include/windowobserver.cpp - include/windowobserver.h -) +#----------------------------------------------------------------------- +# Libraries +#----------------------------------------------------------------------- add_subdirectory(libs) +set(INCLUDELIST + include/aboutmsg.h + include/cullable.h + include/editable.h + include/iarchive.h + include/ibrush.h + include/icamera.h + include/idatastream.h + include/ieclass.h + include/ientity.h + include/ifilesystem.h + include/ifiletypes.h + include/ifilter.h + include/igl.h + include/iglrender.h + include/igtkgl.h + include/iimage.h + include/imap.h + include/imodel.h + include/ipatch.h + include/iplugin.h + include/ireference.h + include/irender.h + include/iscenegraph.h + include/iscriplib.h + include/iselection.h + include/ishaders.h + include/itexdef.h + include/itextstream.h + include/itextures.h + include/itoolbar.h + include/iundo.h + include/mapfile.h + include/modelskin.h + include/moduleobserver.h + include/modulesystem.h + include/nameable.h + include/namespace.h + include/preferencesystem.cpp + include/preferencesystem.h + include/qerplugin.h + include/renderable.h + include/selectable.h + include/stream_version.h + include/version.h + include/warnings.h + include/windowobserver.h + ) +add_library(includes ${INCLUDELIST}) + +#----------------------------------------------------------------------- +# Plugins +#----------------------------------------------------------------------- + add_subdirectory(contrib) + +#----------------------------------------------------------------------- +# Modules +#----------------------------------------------------------------------- + add_subdirectory(plugins) +#----------------------------------------------------------------------- +# Radiant +#----------------------------------------------------------------------- + add_subdirectory(radiant build) +if (CMAKE_EXECUTABLE_SUFFIX) + set(RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX}) +else () + execute_process( + COMMAND uname -m + OUTPUT_VARIABLE RADIANT_EXECUTABLE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) +endif () +set_target_properties(radiant PROPERTIES + COMPILE_DEFINITIONS RADIANT_EXECUTABLE="${RADIANT_EXECUTABLE}" + ) + +#----------------------------------------------------------------------- +# Tools +#----------------------------------------------------------------------- + add_subdirectory(tools) -if(NOT (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)) +if (NOT (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)) # Copy data files from sources to the build directory message(STATUS "Copying data files") file(GLOB DATA_FILES "${CMAKE_SOURCE_DIR}/setup/data/tools/*") file(COPY ${DATA_FILES} DESTINATION "${CMAKE_BINARY_DIR}") file(GLOB DATA_FILES "${CMAKE_SOURCE_DIR}/docs/*") file(COPY ${DATA_FILES} DESTINATION "${CMAKE_BINARY_DIR}/docs") -endif() +endif () + +#----------------------------------------------------------------------- +# Game packs +#----------------------------------------------------------------------- option(DOWNLOAD_GAMEPACKS "Download game packs" ON) add_custom_target(game_packs - COMMAND ${CMAKE_COMMAND} -E make_directory games - COMMAND DOWNLOAD_GAMEPACKS=yes SOURCE_DIR="${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/install-gamepacks.sh" "${CMAKE_BINARY_DIR}" - COMMENT "Downloading game packs" -) + COMMAND ${CMAKE_COMMAND} -E make_directory games + COMMAND DOWNLOAD_GAMEPACKS=yes SOURCE_DIR="${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/install-gamepacks.sh" "${CMAKE_BINARY_DIR}" + COMMENT "Downloading game packs" + ) add_custom_command(OUTPUT games - COMMAND make game_packs - DEPENDS download-gamepacks.sh install-gamepacks.sh install-gamepack.sh -) -if(DOWNLOAD_GAMEPACKS) + COMMAND make game_packs + DEPENDS download-gamepacks.sh install-gamepacks.sh install-gamepack.sh + ) +if (DOWNLOAD_GAMEPACKS) add_custom_target(game_packs_all ALL DEPENDS games) -endif() +endif () diff --git a/DoxyConfig b/DoxyConfig deleted file mode 100644 index b9c0619d..00000000 --- a/DoxyConfig +++ /dev/null @@ -1,47 +0,0 @@ -# Included Doxygen Config file -#--------------------------------------------------------------------------- -# Project name & version number -#--------------------------------------------------------------------------- -PROJECT_NAME = -PROJECT_NUMBER = - -#--------------------------------------------------------------------------- -# Where to put the output -# Note: The images dir should be next to the created html dir within the -# output dir. -# eg; -# [Current Dir] -# L__[OUTPUT_DIRECTORY] -# L__[html] -# L__[images] -#--------------------------------------------------------------------------- -OUTPUT_DIRECTORY = ../GtkRadiant-doxygen - -#--------------------------------------------------------------------------- -# Where to read the sources -# you can add more than one source... -# INPUT = radiant/ \ -# tools/quake3/q3map \ -# tools/quake3/q3data -# -# Recursive is set on, so setting it to ./ (current dir) would read source -# files recursively from the current dir down. (which would take a while) -# -# eg: To document just include, if the current directory is ../GtkRadiant/ -# then... -#--------------------------------------------------------------------------- -INPUT = radiant/ - -#--------------------------------------------------------------------------- -# Misc settings -# TAB_SIZE - sets the indenting for the inline source and the source -# browser -# INCLUDE_PATH - will include documentation for included files from other -# packages. You can specify more than one path the same as -# shown in the INPUT example Leave it blank if you don't want -# this. -# PERL_PATH - path to the perl executable -# -#--------------------------------------------------------------------------- -PERL_PATH = /usr/bin/perl - diff --git a/Makefile b/Makefile deleted file mode 100644 index 879e8d64..00000000 --- a/Makefile +++ /dev/null @@ -1,1092 +0,0 @@ -MAKEFILE_CONF ?= Makefile.conf --include $(MAKEFILE_CONF) - -## CONFIGURATION SETTINGS -# user customizable stuf -# you may override this in Makefile.conf or the environment -BUILD ?= debug -# or: release, or: extradebug, or: profile -OS ?= $(shell uname) -# or: Linux, Win32, Darwin -LDFLAGS ?= -CFLAGS ?= -CXXFLAGS ?= -CPPFLAGS ?= -LIBS ?= -RADIANT_ABOUTMSG ?= Custom build - -# warning: this directory may NOT contain any files other than the ones written by this Makefile! -# NEVER SET THIS TO A SYSTEM WIDE "bin" DIRECTORY! -INSTALLDIR ?= install - -CC ?= gcc -CXX ?= g++ -RANLIB ?= ranlib -AR ?= ar -LDD ?= ldd # nothing on Win32 -OTOOL ?= # only used on OS X -WINDRES ?= windres # only used on Win32 - -PKGCONFIG ?= pkg-config -PKG_CONFIG_PATH ?= - -SH ?= $(SHELL) -ECHO ?= echo -ECHO_NOLF ?= echo -n -CAT ?= cat -MKDIR ?= mkdir -p -CP ?= cp -CP_R ?= $(CP) -r -LN ?= ln -LN_SNF ?= $(LN) -snf -RM ?= rm -RM_R ?= $(RM) -r -TEE_STDERR ?= | tee /dev/stderr -TR ?= tr -FIND ?= find -DIFF ?= diff -SED ?= sed -GIT ?= git -SVN ?= svn -WGET ?= wget -MV ?= mv -UNZIPPER ?= unzip - -FD_TO_DEVNULL ?= >/dev/null -STDOUT_TO_DEVNULL ?= 1$(FD_TO_DEVNULL) -STDERR_TO_DEVNULL ?= 2$(FD_TO_DEVNULL) -STDERR_TO_STDOUT ?= 2>&1 -TO_DEVNULL ?= $(STDOUT_TO_DEVNULL) $(STDERR_TO_STDOUT) - -CPPFLAGS_GLIB ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) glib-2.0 --cflags $(STDERR_TO_DEVNULL)) -LIBS_GLIB ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) glib-2.0 --libs-only-L $(STDERR_TO_DEVNULL)) \ - $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) glib-2.0 --libs-only-l $(STDERR_TO_DEVNULL)) -CPPFLAGS_XML ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libxml-2.0 --cflags $(STDERR_TO_DEVNULL)) -LIBS_XML ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libxml-2.0 --libs-only-L $(STDERR_TO_DEVNULL)) \ - $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libxml-2.0 --libs-only-l $(STDERR_TO_DEVNULL)) -CPPFLAGS_PNG ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libpng --cflags $(STDERR_TO_DEVNULL)) -LIBS_PNG ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libpng --libs-only-L $(STDERR_TO_DEVNULL)) \ - $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libpng --libs-only-l $(STDERR_TO_DEVNULL)) -CPPFLAGS_GTK ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --cflags $(STDERR_TO_DEVNULL)) -LIBS_GTK ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --libs-only-L $(STDERR_TO_DEVNULL)) \ - $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --libs-only-l $(STDERR_TO_DEVNULL)) -CPPFLAGS_PANGOFT2 ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) pangoft2 --cflags $(STDERR_TO_DEVNULL)) -LIBS_PANGOFT2 ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) pangoft2 --libs-only-L $(STDERR_TO_DEVNULL)) \ - $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) pangoft2 --libs-only-l $(STDERR_TO_DEVNULL)) -CPPFLAGS_GTKGLEXT ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtkglext-1.0 --cflags $(STDERR_TO_DEVNULL)) -LIBS_GTKGLEXT ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtkglext-1.0 --libs-only-L $(STDERR_TO_DEVNULL)) \ - $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtkglext-1.0 --libs-only-l $(STDERR_TO_DEVNULL)) -CPPFLAGS_GL ?= -LIBS_GL ?= -lGL # -lopengl32 on Win32 -CPPFLAGS_DL ?= -LIBS_DL ?= -ldl # nothing on Win32 -CPPFLAGS_ZLIB ?= -LIBS_ZLIB ?= -lz -CPPFLAGS_JPEG ?= -LIBS_JPEG ?= -ljpeg -DEPEND_ON_MAKEFILE ?= yes -DOWNLOAD_GAMEPACKS ?= yes -# set to no to disable gamepack, set to all to even download undistributable gamepacks - -# Support CHECK_DEPENDENCIES with DOWNLOAD_GAMEPACKS semantics -ifneq ($(CHECK_DEPENDENCIES),) -DEPENDENCIES_CHECK = $(patsubst yes,quiet,$(patsubst no,off,$(CHECK_DEPENDENCIES))) -else -DEPENDENCIES_CHECK ?= quiet -# or: off, verbose -endif - -# these are used on Win32 only -GTKDIR ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --variable=prefix $(STDERR_TO_DEVNULL)) -WHICHDLL ?= which -DLLINSTALL ?= install-dlls.sh - -# alias mingw32 OSes -ifeq ($(OS),MINGW32_NT-6.0) - OS = Win32 -endif -ifeq ($(OS),Windows_NT) - OS = Win32 -endif - -CFLAGS_COMMON = -MMD -W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter -fno-strict-aliasing -CPPFLAGS_COMMON = -LDFLAGS_COMMON = -LIBS_COMMON = -CXXFLAGS_COMMON = -Wno-non-virtual-dtor -Wreorder -fno-exceptions -fno-rtti -std=c++11 - -ifeq ($(BUILD),debug) -ifeq ($(findstring $(CFLAGS),-g),) - CFLAGS_COMMON += -g - # only add -g if no -g flag is in $(CFLAGS) -endif -ifeq ($(findstring $(CFLAGS),-O0),) - CFLAGS_COMMON += -O0 - # only add -O if no -O flag is in $(CFLAGS) -endif - CPPFLAGS_COMMON += - LDFLAGS_COMMON += -else - -ifeq ($(BUILD),extradebug) -ifeq ($(findstring $(CFLAGS),-g),) - CFLAGS_COMMON += -g3 - # only add -g3 if no -g flag is in $(CFLAGS) -endif - CPPFLAGS_COMMON += -D_DEBUG - LDFLAGS_COMMON += -else - -ifeq ($(BUILD),profile) -ifeq ($(findstring $(CFLAGS),-g),) - CFLAGS_COMMON += -g - # only add -g if no -g flag is in $(CFLAGS) -endif -ifeq ($(findstring $(CFLAGS),-O0),) - CFLAGS_COMMON += -O0 - # only add -O if no -O flag is in $(CFLAGS) -endif - CFLAGS_COMMON += -pg - CPPFLAGS_COMMON += - LDFLAGS_COMMON += -pg -else - -ifeq ($(BUILD),release) -ifeq ($(findstring $(CFLAGS),-O),) - CFLAGS_COMMON += -O3 - # only add -O3 if no -O flag is in $(CFLAGS) -endif - CPPFLAGS_COMMON += - LDFLAGS_COMMON += -s -else - -ifeq ($(BUILD),native) -ifeq ($(findstring $(CFLAGS),-O),) - CFLAGS_COMMON += -O3 - # only add -O3 if no -O flag is in $(CFLAGS) -endif - CFLAGS_COMMON += -march=native -mcpu=native - CPPFLAGS_COMMON += - LDFLAGS_COMMON += -s -else - -$(error Unsupported build type: $(BUILD)) -endif -endif -endif -endif -endif - -INSTALLDIR_BASE := $(INSTALLDIR) - -MAKE_EXE_SYMLINK = false - -ifeq ($(OS),Linux) - CPPFLAGS_COMMON += -DPOSIX -DXWINDOWS - CFLAGS_COMMON += -fPIC - LDFLAGS_DLL = -fPIC -ldl - LIBS_COMMON = -lpthread - EXE ?= $(shell uname -m) - MAKE_EXE_SYMLINK = true - A = a - DLL = so - MWINDOWS = -else - -ifeq ($(OS),Win32) - CPPFLAGS_COMMON += -DWIN32 -D_WIN32 -D_inline=inline - CFLAGS_COMMON += -mms-bitfields - LDFLAGS_DLL = -Wl,--add-stdcall-alias - LIBS_COMMON = -lws2_32 -luser32 -lgdi32 -lole32 - EXE ?= exe - A = a - DLL = dll - MWINDOWS = -mwindows - - # workaround: we have no "ldd" for Win32, so... - LDD = - # workaround: OpenGL library for Win32 is called opengl32.dll - LIBS_GL = -lopengl32 - # workaround: no -ldl on Win32 - LIBS_DL = -else - -ifeq ($(OS),Darwin) - CPPFLAGS_COMMON += -DPOSIX -DXWINDOWS - CFLAGS_COMMON += -fPIC - CXXFLAGS_COMMON += -fno-exceptions -fno-rtti - MACLIBDIR ?= /opt/local/lib - CPPFLAGS_COMMON += -I$(MACLIBDIR)/../include -I/usr/X11R6/include - LDFLAGS_COMMON += -L$(MACLIBDIR) -L/usr/X11R6/lib - LDFLAGS_DLL += -dynamiclib -ldl - EXE ?= $(shell uname -m) - MAKE_EXE_SYMLINK = true - A = a - DLL = dylib - MWINDOWS = - # workaround for weird prints - ECHO_NOLF = /bin/echo -n - - # workaround: http://developer.apple.com/qa/qa2007/qa1567.html - LIBS_GL += -lX11 -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib - LIBS_GTKGLEXT += -lX11 -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib - # workaround: we have no "ldd" for OS X, so... - LDD = - OTOOL = otool -else - -$(error Unsupported build OS: $(OS)) -endif -endif -endif - -# VERSION! -RADIANT_VERSION_NUMBER = 1.5.0 -RADIANT_VERSION = $(RADIANT_VERSION_NUMBER)n -RADIANT_MAJOR_VERSION = 5 -RADIANT_MINOR_VERSION = 0 -Q3MAP_VERSION = 2.5.17n - -# Executable extension -RADIANT_EXECUTABLE := $(EXE) - -GIT_VERSION := $(shell $(GIT) rev-parse --short HEAD $(STDERR_TO_DEVNULL)) -ifneq ($(GIT_VERSION),) - RADIANT_VERSION := $(RADIANT_VERSION)-git-$(GIT_VERSION) - Q3MAP_VERSION := $(Q3MAP_VERSION)-git-$(GIT_VERSION) -endif - -CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_MAJOR_VERSION="\"$(RADIANT_MAJOR_VERSION)\"" -DRADIANT_MINOR_VERSION="\"$(RADIANT_MINOR_VERSION)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" -DQ3MAP_VERSION="\"$(Q3MAP_VERSION)\"" -DRADIANT_EXECUTABLE="\"$(RADIANT_EXECUTABLE)\"" - -.PHONY: all -all: \ - dependencies-check \ - binaries \ - install-data \ - install-dll \ - -.PHONY: dependencies-check -ifeq ($(findstring $(DEPENDENCIES_CHECK),off),off) -dependencies-check: - @$(ECHO) dependencies checking disabled, good luck... -else -dependencies-check: - @$(ECHO) - @if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; exec 3>&2; else exec 3$(FD_TO_DEVNULL); fi; \ - failed=0; \ - checkbinary() \ - { \ - $(ECHO_NOLF) "Checking for $$2 ($$1)... "; \ - $$2 --help >&3 $(STDERR_TO_STDOUT); \ - if [ $$? != 127 ]; then \ - $(ECHO) "found."; \ - else \ - $(ECHO) "not found, please install it or set PATH right!"; \ - $(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \ - $(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \ - failed=1; \ - fi; \ - }; \ - $(ECHO) checking that the build tools exist; \ - checkbinary "bash (or another shell)" "$(SH)"; \ - checkbinary coreutils "$(ECHO)"; \ - checkbinary coreutils "$(ECHO_NOLF)"; \ - checkbinary coreutils "$(CAT)"; \ - checkbinary coreutils "$(MKDIR)"; \ - checkbinary coreutils "$(CP)"; \ - checkbinary coreutils "$(CP_R)"; \ - checkbinary coreutils "$(RM)"; \ - checkbinary coreutils "$(RM_R)"; \ - checkbinary coreutils "$(MV)"; \ - checkbinary coreutils "$(ECHO) test $(TEE_STDERR)"; \ - checkbinary sed "$(SED)"; \ - checkbinary findutils "$(FIND)"; \ - checkbinary diff "$(DIFF)"; \ - checkbinary gcc "$(CC)"; \ - checkbinary g++ "$(CXX)"; \ - checkbinary binutils "$(RANLIB)"; \ - checkbinary binutils "$(AR)"; \ - checkbinary pkg-config "$(PKGCONFIG)"; \ - checkbinary unzip "$(UNZIPPER)"; \ - checkbinary git-core "$(GIT)"; \ - checkbinary subversion "$(SVN)"; \ - checkbinary wget "$(WGET)"; \ - [ "$(OS)" = "Win32" ] && checkbinary mingw32 "$(WINDRES)"; \ - [ -n "$(LDD)" ] && checkbinary libc6 "$(LDD)"; \ - [ -n "$(OTOOL)" ] && checkbinary xcode "$(OTOOL)"; \ - [ "$$failed" = "0" ] && $(ECHO) All required tools have been found! - @$(ECHO) - @if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; exec 3>&2; else exec 3$(FD_TO_DEVNULL); fi; \ - failed=0; \ - checkheader() \ - { \ - $(ECHO_NOLF) "Checking for $$2 ($$1)... "; \ - if \ - $(CXX) conftest.cpp $(CFLAGS) $(CXXFLAGS) $(CFLAGS_COMMON) $(CXXFLAGS_COMMON) $(CPPFLAGS) $(CPPFLAGS_COMMON) $$4 -DCONFTEST_HEADER="<$$2>" -DCONFTEST_SYMBOL="$$3" $(TARGET_ARCH) $(LDFLAGS) -c -o conftest.o >&3 $(STDERR_TO_STDOUT); \ - then \ - if \ - $(CXX) conftest.o $(LDFLAGS) $(LDFLAGS_COMMON) $$5 $(LIBS_COMMON) $(LIBS) -o conftest >&3 $(STDERR_TO_STDOUT); \ - then \ - $(RM) conftest conftest.o conftest.d; \ - $(ECHO) "found and links."; \ - else \ - $(RM) conftest.o conftest.d; \ - $(ECHO) "found but does not link, please install it or set PKG_CONFIG_PATH right!"; \ - $(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \ - $(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \ - failed=1; \ - fi; \ - else \ - $(RM) conftest conftest.o conftest.d; \ - $(ECHO) "not found, please install it or set PKG_CONFIG_PATH right!"; \ - $(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \ - $(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \ - failed=1; \ - fi; \ - }; \ - $(ECHO) checking that the dependencies exist; \ - checkheader libjpeg8-dev jpeglib.h jpeg_set_defaults "$(CPPFLAGS_JPEG)" "$(LIBS_JPEG)"; \ - checkheader libglib2.0-dev glib.h g_path_is_absolute "$(CPPFLAGS_GLIB)" "$(LIBS_GLIB)"; \ - checkheader libxml2-dev libxml/xpath.h xmlXPathInit "$(CPPFLAGS_XML)" "$(LIBS_XML)"; \ - checkheader libpng12-dev png.h png_create_read_struct "$(CPPFLAGS_PNG)" "$(LIBS_PNG)"; \ - checkheader "mesa-common-dev (or another OpenGL library)" GL/gl.h glClear "$(CPPFLAGS_GL)" "$(LIBS_GL)"; \ - checkheader libgtk2.0-dev gtk/gtkdialog.h gtk_dialog_run "$(CPPFLAGS_GTK)" "$(LIBS_GTK)"; \ - checkheader libpango1.0-dev pango/pangoft2.h pango_ft2_font_map_new "$(CPPFLAGS_PANGOFT2)" "$(LIBS_PANGOFT2)"; \ - checkheader libgtkglext1-dev gtk/gtkglwidget.h gtk_widget_get_gl_context "$(CPPFLAGS_GTKGLEXT)" "$(LIBS_GTKGLEXT)"; \ - [ "$(OS)" != "Win32" ] && checkheader libc6-dev dlfcn.h dlopen "$(CPPFLAGS_DL)" "$(LIBS_DL)"; \ - checkheader zlib1g-dev zlib.h zlibVersion "$(CPPFLAGS_ZLIB)" "$(LIBS_ZLIB)"; \ - [ "$$failed" = "0" ] && $(ECHO) All required libraries have been found! - @$(ECHO) -endif - -.PHONY: binaries -binaries: \ - binaries-tools \ - binaries-radiant \ - -.PHONY: binaries-radiant-all -binaries-radiant: \ - binaries-radiant-modules \ - binaries-radiant-plugins \ - binaries-radiant-core \ - -.PHONY: binaries-radiant-modules -binaries-radiant-modules: \ - $(INSTALLDIR)/modules/archivepak.$(DLL) \ - $(INSTALLDIR)/modules/archivewad.$(DLL) \ - $(INSTALLDIR)/modules/archivezip.$(DLL) \ - $(INSTALLDIR)/modules/entity.$(DLL) \ - $(INSTALLDIR)/modules/image.$(DLL) \ - $(INSTALLDIR)/modules/imagehl.$(DLL) \ - $(INSTALLDIR)/modules/imagepng.$(DLL) \ - $(INSTALLDIR)/modules/imageq2.$(DLL) \ - $(INSTALLDIR)/modules/mapq3.$(DLL) \ - $(INSTALLDIR)/modules/mapxml.$(DLL) \ - $(INSTALLDIR)/modules/md3model.$(DLL) \ - $(INSTALLDIR)/modules/model.$(DLL) \ - $(INSTALLDIR)/modules/shaders.$(DLL) \ - $(INSTALLDIR)/modules/vfspk3.$(DLL) \ - -.PHONY: binaries-radiant-plugins -binaries-radiant-plugins: \ - $(INSTALLDIR)/plugins/bobtoolz.$(DLL) \ - $(INSTALLDIR)/plugins/brushexport.$(DLL) \ - $(INSTALLDIR)/plugins/prtview.$(DLL) \ - $(INSTALLDIR)/plugins/shaderplug.$(DLL) \ - $(INSTALLDIR)/plugins/sunplug.$(DLL) \ - $(INSTALLDIR)/plugins/ufoaiplug.$(DLL) \ - -.PHONY: binaries-radiant -binaries-radiant-core: \ - $(INSTALLDIR)/radiant.$(EXE) \ - $(INSTALLDIR)/radiant \ - -.PHONY: binaries-tools -binaries-tools: \ - binaries-tools-quake2 \ - binaries-tools-quake3 \ - -.PHONY: binaries-tools-quake2 -binaries-tools-quake2: \ - binaries-q2map \ - binaries-qdata3 \ - binaries-h2data \ - -.PHONY: binaries-q2map -binaries-q2map: \ - $(INSTALLDIR)/q2map.$(EXE) \ - $(INSTALLDIR)/q2map \ - -.PHONY: binaries-qdata3 -binaries-qdata3: \ - $(INSTALLDIR)/qdata3.$(EXE) \ - $(INSTALLDIR)/qdata3 \ - -.PHONY: binaries-h2data -binaries-h2data: \ - $(INSTALLDIR)/heretic2/h2data.$(EXE) \ - $(INSTALLDIR)/heretic2/h2data \ - -.PHONY: binaries-tools-quake3 -binaries-tools-quake3: \ - binaries-q3data \ - binaries-q3map2 \ - -.PHONY: binaries-q3data -binaries-q3data: \ - $(INSTALLDIR)/q3data.$(EXE) \ - $(INSTALLDIR)/q3data \ - -.PHONY: binaries-q3map2 -binaries-q3map2: \ - $(INSTALLDIR)/q3map2.$(EXE) \ - $(INSTALLDIR)/q3map2 \ - - -.PHONY: clean -clean: - $(RM_R) $(INSTALLDIR_BASE)/ - $(FIND) . \( -name \*.o -o -name \*.d -o -name \*.$(DLL) -o -name \*.$(A) -o -name \*.$(EXE) \) -exec $(RM) {} \; - $(RM) icons/*.rc - -%.$(EXE): - file=$@; $(MKDIR) $${file%/*} - $(CXX) $^ $(LDFLAGS) $(LDFLAGS_COMMON) $(LDFLAGS_EXTRA) $(LIBS_EXTRA) $(LIBS_COMMON) $(LIBS) -o $@ - [ -z "$(LDD)" ] || [ -z "`$(LDD) -r $@ $(STDERR_TO_STDOUT) $(STDOUT_TO_DEVNULL) $(TEE_STDERR)`" ] || { $(RM) $@; exit 1; } - -$(INSTALLDIR)/%: $(INSTALLDIR)/%.$(EXE) - if $(MAKE_EXE_SYMLINK); then o=$<; $(LN_SNF) $${o##*/} $@; else true; fi - -%.$(A): - $(AR) rc $@ $^ - $(RANLIB) $@ - -%.$(DLL): - file=$@; $(MKDIR) $${file%/*} - $(CXX) $^ $(LDFLAGS) $(LDFLAGS_COMMON) $(LDFLAGS_EXTRA) $(LDFLAGS_DLL) $(LIBS_EXTRA) $(LIBS_COMMON) $(LIBS) -shared -o $@ - [ -z "$(LDD)" ] || [ -z "`$(LDD) -r $@ $(STDERR_TO_STDOUT) $(STDOUT_TO_DEVNULL) $(TEE_STDERR)`" ] || { $(RM) $@; exit 1; } - -%.rc: %.ico - $(ECHO) '1 ICON "$<"' > $@ - -ifeq ($(OS),Win32) -%.o: %.rc - $(WINDRES) $< $@ -endif - -%.o: %.cpp $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),) | dependencies-check - $(CXX) $< $(CFLAGS) $(CXXFLAGS) $(CFLAGS_COMMON) $(CXXFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ - -%.o: %.c $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),) | dependencies-check - $(CC) $< $(CFLAGS) $(CFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ - - -$(INSTALLDIR)/q3map2.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG) $(LIBS_JPEG) $(LIBS_ZLIB) -$(INSTALLDIR)/q3map2.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_PNG) $(CPPFLAGS_JPEG) -Itools/quake3/common -Ilibs -Iinclude -$(INSTALLDIR)/q3map2.$(EXE): \ - tools/quake3/common/cmdlib.o \ - tools/quake3/common/imagelib.o \ - tools/quake3/common/inout.o \ - tools/quake3/common/jpeg.o \ - tools/quake3/common/md4.o \ - tools/quake3/common/mutex.o \ - tools/quake3/common/polylib.o \ - tools/quake3/common/scriplib.o \ - tools/quake3/common/threads.o \ - tools/quake3/common/unzip.o \ - tools/quake3/common/vfs.o \ - tools/quake3/q3map2/brush.o \ - tools/quake3/q3map2/brush_primit.o \ - tools/quake3/q3map2/bspfile_abstract.o \ - tools/quake3/q3map2/bspfile_ibsp.o \ - tools/quake3/q3map2/bspfile_rbsp.o \ - tools/quake3/q3map2/bsp.o \ - tools/quake3/q3map2/convert_ase.o \ - tools/quake3/q3map2/convert_obj.o \ - tools/quake3/q3map2/convert_map.o \ - tools/quake3/q3map2/decals.o \ - tools/quake3/q3map2/facebsp.o \ - tools/quake3/q3map2/fog.o \ - tools/quake3/q3map2/image.o \ - tools/quake3/q3map2/leakfile.o \ - tools/quake3/q3map2/light_bounce.o \ - tools/quake3/q3map2/lightmaps_ydnar.o \ - tools/quake3/q3map2/light.o \ - tools/quake3/q3map2/light_trace.o \ - tools/quake3/q3map2/light_ydnar.o \ - tools/quake3/q3map2/main.o \ - tools/quake3/q3map2/map.o \ - tools/quake3/q3map2/mesh.o \ - tools/quake3/q3map2/model.o \ - tools/quake3/q3map2/patch.o \ - tools/quake3/q3map2/path_init.o \ - tools/quake3/q3map2/portals.o \ - tools/quake3/q3map2/prtfile.o \ - tools/quake3/q3map2/shaders.o \ - tools/quake3/q3map2/surface_extra.o \ - tools/quake3/q3map2/surface_foliage.o \ - tools/quake3/q3map2/surface_fur.o \ - tools/quake3/q3map2/surface_meta.o \ - tools/quake3/q3map2/surface.o \ - tools/quake3/q3map2/tjunction.o \ - tools/quake3/q3map2/tree.o \ - tools/quake3/q3map2/visflow.o \ - tools/quake3/q3map2/vis.o \ - tools/quake3/q3map2/writebsp.o \ - libddslib.$(A) \ - libetclib.$(A) \ - libfilematch.$(A) \ - libl_net.$(A) \ - libmathlib.$(A) \ - libpicomodel.$(A) \ - $(if $(findstring $(OS),Win32),icons/q3map2.o,) \ - -libmathlib.$(A): CPPFLAGS_EXTRA := -Ilibs -libmathlib.$(A): \ - libs/mathlib/bbox.o \ - libs/mathlib/line.o \ - libs/mathlib/m4x4.o \ - libs/mathlib/mathlib.o \ - libs/mathlib/ray.o \ - -libl_net.$(A): CPPFLAGS_EXTRA := -Ilibs -libl_net.$(A): \ - libs/l_net/l_net.o \ - $(if $(findstring $(OS),Win32),libs/l_net/l_net_wins.o,libs/l_net/l_net_berkley.o) \ - -libpicomodel.$(A): CPPFLAGS_EXTRA := -Ilibs -libpicomodel.$(A): \ - libs/picomodel/lwo/clip.o \ - libs/picomodel/lwo/envelope.o \ - libs/picomodel/lwo/list.o \ - libs/picomodel/lwo/lwio.o \ - libs/picomodel/lwo/lwo2.o \ - libs/picomodel/lwo/lwob.o \ - libs/picomodel/lwo/pntspols.o \ - libs/picomodel/lwo/surface.o \ - libs/picomodel/lwo/vecmath.o \ - libs/picomodel/lwo/vmap.o \ - libs/picomodel/picointernal.o \ - libs/picomodel/picomodel.o \ - libs/picomodel/picomodules.o \ - libs/picomodel/pm_3ds.o \ - libs/picomodel/pm_ase.o \ - libs/picomodel/pm_fm.o \ - libs/picomodel/pm_lwo.o \ - libs/picomodel/pm_md2.o \ - libs/picomodel/pm_md3.o \ - libs/picomodel/pm_mdc.o \ - libs/picomodel/pm_ms3d.o \ - libs/picomodel/pm_obj.o \ - libs/picomodel/pm_terrain.o \ - -libddslib.$(A): CPPFLAGS_EXTRA := -Ilibs -libddslib.$(A): \ - libs/ddslib/ddslib.o \ - -libetclib.$(A): CPPFLAGS_EXTRA := -Ilibs -libetclib.$(A): \ - libs/etclib.o \ - -$(INSTALLDIR)/q3data.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_ZLIB) -$(INSTALLDIR)/q3data.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_ZLIB) -Itools/quake3/common -Ilibs -Iinclude -$(INSTALLDIR)/q3data.$(EXE): \ - tools/quake3/common/aselib.o \ - tools/quake3/common/bspfile.o \ - tools/quake3/common/cmdlib.o \ - tools/quake3/common/imagelib.o \ - tools/quake3/common/inout.o \ - tools/quake3/common/md4.o \ - tools/quake3/common/scriplib.o \ - tools/quake3/common/trilib.o \ - tools/quake3/common/unzip.o \ - tools/quake3/common/vfs.o \ - tools/quake3/q3data/3dslib.o \ - tools/quake3/q3data/compress.o \ - tools/quake3/q3data/images.o \ - tools/quake3/q3data/md3lib.o \ - tools/quake3/q3data/models.o \ - tools/quake3/q3data/p3dlib.o \ - tools/quake3/q3data/polyset.o \ - tools/quake3/q3data/q3data.o \ - tools/quake3/q3data/stripper.o \ - tools/quake3/q3data/video.o \ - libfilematch.$(A) \ - libetclib.$(A) \ - libl_net.$(A) \ - libmathlib.$(A) \ - $(if $(findstring $(OS),Win32),icons/q3data.o,) \ - -$(INSTALLDIR)/radiant.$(EXE): LDFLAGS_EXTRA := $(MWINDOWS) -$(INSTALLDIR)/radiant.$(EXE): LIBS_EXTRA := $(LIBS_GL) $(LIBS_DL) $(LIBS_XML) $(LIBS_GLIB) $(LIBS_GTK) $(LIBS_GTKGLEXT) $(LIBS_ZLIB) $(LIBS_PANGOFT2) -$(INSTALLDIR)/radiant.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_GL) $(CPPFLAGS_DL) $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) $(CPPFLAGS_PANGOFT2) -Ilibs -Iinclude -$(INSTALLDIR)/radiant.$(EXE): \ - radiant/autosave.o \ - radiant/brushmanip.o \ - radiant/brushmodule.o \ - radiant/brushnode.o \ - radiant/brush.o \ - radiant/brush_primit.o \ - radiant/brushtokens.o \ - radiant/brushxml.o \ - radiant/build.o \ - radiant/camwindow.o \ - radiant/clippertool.o \ - radiant/commands.o \ - radiant/console.o \ - radiant/csg.o \ - radiant/dialog.o \ - radiant/eclass_def.o \ - radiant/eclass_doom3.o \ - radiant/eclass_fgd.o \ - radiant/eclass.o \ - radiant/eclass_xml.o \ - radiant/entityinspector.o \ - radiant/entitylist.o \ - radiant/entity.o \ - radiant/environment.o \ - radiant/error.o \ - radiant/feedback.o \ - radiant/filetypes.o \ - radiant/filters.o \ - radiant/findtexturedialog.o \ - radiant/glwidget.o \ - radiant/grid.o \ - radiant/groupdialog.o \ - radiant/gtkdlgs.o \ - radiant/gtkmisc.o \ - radiant/help.o \ - radiant/image.o \ - radiant/mainframe.o \ - radiant/main.o \ - radiant/map.o \ - radiant/multimon.o \ - radiant/mru.o \ - radiant/nullmodel.o \ - radiant/parse.o \ - radiant/patchdialog.o \ - radiant/patchmanip.o \ - radiant/patchmodule.o \ - radiant/patch.o \ - radiant/pluginapi.o \ - radiant/pluginmanager.o \ - radiant/pluginmenu.o \ - radiant/plugin.o \ - radiant/plugintoolbar.o \ - radiant/points.o \ - radiant/preferencedictionary.o \ - radiant/preferences.o \ - radiant/qe3.o \ - radiant/qgl.o \ - radiant/referencecache.o \ - radiant/renderer.o \ - radiant/renderstate.o \ - radiant/scenegraph.o \ - radiant/selection.o \ - radiant/select.o \ - radiant/server.o \ - radiant/shaders.o \ - radiant/sockets.o \ - radiant/stacktrace.o \ - radiant/surfacedialog.o \ - radiant/texmanip.o \ - radiant/textures.o \ - radiant/texwindow.o \ - radiant/timer.o \ - radiant/treemodel.o \ - radiant/undo.o \ - radiant/url.o \ - radiant/view.o \ - radiant/watchbsp.o \ - radiant/winding.o \ - radiant/windowobservers.o \ - radiant/xmlstuff.o \ - radiant/xywindow.o \ - libcmdlib.$(A) \ - libgtkutil.$(A) \ - libl_net.$(A) \ - libmathlib.$(A) \ - libprofile.$(A) \ - libxmllib.$(A) \ - $(if $(findstring $(OS),Win32),icons/radiant.o,) \ - -libfilematch.$(A): CPPFLAGS_EXTRA := -Ilibs -libfilematch.$(A): \ - libs/filematch.o \ - -libcmdlib.$(A): CPPFLAGS_EXTRA := -Ilibs -libcmdlib.$(A): \ - libs/cmdlib/cmdlib.o \ - -libprofile.$(A): CPPFLAGS_EXTRA := -Ilibs -Iinclude -libprofile.$(A): \ - libs/profile/file.o \ - libs/profile/profile.o \ - -libgtkutil.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) $(CPPFLAGS_PANGOFT2) -Ilibs -Iinclude -libgtkutil.$(A): \ - libs/gtkutil/accelerator.o \ - libs/gtkutil/button.o \ - libs/gtkutil/clipboard.o \ - libs/gtkutil/closure.o \ - libs/gtkutil/container.o \ - libs/gtkutil/cursor.o \ - libs/gtkutil/dialog.o \ - libs/gtkutil/entry.o \ - libs/gtkutil/filechooser.o \ - libs/gtkutil/frame.o \ - libs/gtkutil/glfont.o \ - libs/gtkutil/glwidget.o \ - libs/gtkutil/idledraw.o \ - libs/gtkutil/image.o \ - libs/gtkutil/menu.o \ - libs/gtkutil/messagebox.o \ - libs/gtkutil/nonmodal.o \ - libs/gtkutil/paned.o \ - libs/gtkutil/pointer.o \ - libs/gtkutil/toolbar.o \ - libs/gtkutil/widget.o \ - libs/gtkutil/window.o \ - libs/gtkutil/xorrectangle.o \ - -libxmllib.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Ilibs -Iinclude -libxmllib.$(A): \ - libs/xml/ixml.o \ - libs/xml/xmlelement.o \ - libs/xml/xmlparser.o \ - libs/xml/xmltextags.o \ - libs/xml/xmlwriter.o \ - -$(INSTALLDIR)/modules/archivezip.$(DLL): LIBS_EXTRA := $(LIBS_ZLIB) -$(INSTALLDIR)/modules/archivezip.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_ZLIB) -Ilibs -Iinclude -$(INSTALLDIR)/modules/archivezip.$(DLL): \ - plugins/archivezip/archive.o \ - plugins/archivezip/pkzip.o \ - plugins/archivezip/plugin.o \ - plugins/archivezip/zlibstream.o \ - -$(INSTALLDIR)/modules/archivewad.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude -$(INSTALLDIR)/modules/archivewad.$(DLL): \ - plugins/archivewad/archive.o \ - plugins/archivewad/plugin.o \ - plugins/archivewad/wad.o \ - -$(INSTALLDIR)/modules/archivepak.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude -$(INSTALLDIR)/modules/archivepak.$(DLL): \ - plugins/archivepak/archive.o \ - plugins/archivepak/pak.o \ - plugins/archivepak/plugin.o \ - -$(INSTALLDIR)/modules/entity.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude -$(INSTALLDIR)/modules/entity.$(DLL): \ - plugins/entity/angle.o \ - plugins/entity/angles.o \ - plugins/entity/colour.o \ - plugins/entity/doom3group.o \ - plugins/entity/eclassmodel.o \ - plugins/entity/entity.o \ - plugins/entity/filters.o \ - plugins/entity/generic.o \ - plugins/entity/group.o \ - plugins/entity/light.o \ - plugins/entity/miscmodel.o \ - plugins/entity/model.o \ - plugins/entity/modelskinkey.o \ - plugins/entity/namedentity.o \ - plugins/entity/origin.o \ - plugins/entity/plugin.o \ - plugins/entity/rotation.o \ - plugins/entity/scale.o \ - plugins/entity/skincache.o \ - plugins/entity/targetable.o \ - -$(INSTALLDIR)/modules/image.$(DLL): LIBS_EXTRA := $(LIBS_JPEG) -$(INSTALLDIR)/modules/image.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_JPEG) -Ilibs -Iinclude -$(INSTALLDIR)/modules/image.$(DLL): \ - plugins/image/bmp.o \ - plugins/image/dds.o \ - plugins/image/image.o \ - plugins/image/jpeg.o \ - plugins/image/ktx.o \ - plugins/image/pcx.o \ - plugins/image/tga.o \ - libddslib.$(A) \ - libetclib.$(A) \ - -$(INSTALLDIR)/modules/imageq2.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude -$(INSTALLDIR)/modules/imageq2.$(DLL): \ - plugins/imageq2/imageq2.o \ - plugins/imageq2/wal32.o \ - plugins/imageq2/wal.o \ - -$(INSTALLDIR)/modules/imagehl.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude -$(INSTALLDIR)/modules/imagehl.$(DLL): \ - plugins/imagehl/hlw.o \ - plugins/imagehl/imagehl.o \ - plugins/imagehl/mip.o \ - plugins/imagehl/sprite.o \ - -$(INSTALLDIR)/modules/imagepng.$(DLL): LIBS_EXTRA := $(LIBS_PNG) -$(INSTALLDIR)/modules/imagepng.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_PNG) -Ilibs -Iinclude -$(INSTALLDIR)/modules/imagepng.$(DLL): \ - plugins/imagepng/plugin.o \ - -$(INSTALLDIR)/modules/mapq3.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude -$(INSTALLDIR)/modules/mapq3.$(DLL): \ - plugins/mapq3/parse.o \ - plugins/mapq3/plugin.o \ - plugins/mapq3/write.o \ - -$(INSTALLDIR)/modules/mapxml.$(DLL): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) -$(INSTALLDIR)/modules/mapxml.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Ilibs -Iinclude -$(INSTALLDIR)/modules/mapxml.$(DLL): \ - plugins/mapxml/plugin.o \ - plugins/mapxml/xmlparse.o \ - plugins/mapxml/xmlwrite.o \ - -$(INSTALLDIR)/modules/md3model.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude -$(INSTALLDIR)/modules/md3model.$(DLL): \ - plugins/md3model/md2.o \ - plugins/md3model/md3.o \ - plugins/md3model/md5.o \ - plugins/md3model/mdc.o \ - plugins/md3model/mdlimage.o \ - plugins/md3model/mdl.o \ - plugins/md3model/plugin.o \ - -$(INSTALLDIR)/modules/model.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude -$(INSTALLDIR)/modules/model.$(DLL): \ - plugins/model/model.o \ - plugins/model/plugin.o \ - libpicomodel.$(A) \ - -$(INSTALLDIR)/modules/shaders.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) -$(INSTALLDIR)/modules/shaders.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude -$(INSTALLDIR)/modules/shaders.$(DLL): \ - plugins/shaders/plugin.o \ - plugins/shaders/shaders.o \ - -$(INSTALLDIR)/modules/vfspk3.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) -$(INSTALLDIR)/modules/vfspk3.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude -$(INSTALLDIR)/modules/vfspk3.$(DLL): \ - plugins/vfspk3/archive.o \ - plugins/vfspk3/vfs.o \ - plugins/vfspk3/vfspk3.o \ - libfilematch.$(A) \ - -$(INSTALLDIR)/plugins/bobtoolz.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK) -$(INSTALLDIR)/plugins/bobtoolz.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude -$(INSTALLDIR)/plugins/bobtoolz.$(DLL): \ - contrib/bobtoolz/bobToolz-GTK.o \ - contrib/bobtoolz/bsploader.o \ - contrib/bobtoolz/cportals.o \ - contrib/bobtoolz/DBobView.o \ - contrib/bobtoolz/DBrush.o \ - contrib/bobtoolz/DEntity.o \ - contrib/bobtoolz/DEPair.o \ - contrib/bobtoolz/dialogs/dialogs-gtk.o \ - contrib/bobtoolz/DMap.o \ - contrib/bobtoolz/DPatch.o \ - contrib/bobtoolz/DPlane.o \ - contrib/bobtoolz/DPoint.o \ - contrib/bobtoolz/DShape.o \ - contrib/bobtoolz/DTrainDrawer.o \ - contrib/bobtoolz/DTreePlanter.o \ - contrib/bobtoolz/DVisDrawer.o \ - contrib/bobtoolz/DWinding.o \ - contrib/bobtoolz/funchandlers-GTK.o \ - contrib/bobtoolz/lists.o \ - contrib/bobtoolz/misc.o \ - contrib/bobtoolz/ScriptParser.o \ - contrib/bobtoolz/shapes.o \ - contrib/bobtoolz/visfind.o \ - libcmdlib.$(A) \ - libmathlib.$(A) \ - libprofile.$(A) \ - -$(INSTALLDIR)/plugins/brushexport.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK) -$(INSTALLDIR)/plugins/brushexport.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude -$(INSTALLDIR)/plugins/brushexport.$(DLL): \ - contrib/brushexport/callbacks.o \ - contrib/brushexport/export.o \ - contrib/brushexport/interface.o \ - contrib/brushexport/plugin.o \ - contrib/brushexport/support.o \ - -$(INSTALLDIR)/plugins/prtview.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK) -$(INSTALLDIR)/plugins/prtview.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude -$(INSTALLDIR)/plugins/prtview.$(DLL): \ - contrib/prtview/AboutDialog.o \ - contrib/prtview/ConfigDialog.o \ - contrib/prtview/LoadPortalFileDialog.o \ - contrib/prtview/portals.o \ - contrib/prtview/prtview.o \ - libprofile.$(A) \ - -$(INSTALLDIR)/plugins/shaderplug.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK) $(LIBS_XML) -$(INSTALLDIR)/plugins/shaderplug.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_XML) -Ilibs -Iinclude -$(INSTALLDIR)/plugins/shaderplug.$(DLL): \ - contrib/shaderplug/shaderplug.o \ - libxmllib.$(A) \ - -$(INSTALLDIR)/plugins/sunplug.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK) -$(INSTALLDIR)/plugins/sunplug.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude -$(INSTALLDIR)/plugins/sunplug.$(DLL): \ - contrib/sunplug/sunplug.o \ - -$(INSTALLDIR)/qdata3.$(EXE): LIBS_EXTRA := $(LIBS_XML) -$(INSTALLDIR)/qdata3.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) -Itools/quake2/common -Ilibs -Iinclude -$(INSTALLDIR)/qdata3.$(EXE): \ - tools/quake2/common/bspfile.o \ - tools/quake2/common/cmdlib.o \ - tools/quake2/common/inout.o \ - tools/quake2/common/l3dslib.o \ - tools/quake2/common/lbmlib.o \ - tools/quake2/common/mathlib.o \ - tools/quake2/common/md4.o \ - tools/quake2/common/path_init.o \ - tools/quake2/common/polylib.o \ - tools/quake2/common/scriplib.o \ - tools/quake2/common/threads.o \ - tools/quake2/common/trilib.o \ - tools/quake2/qdata/images.o \ - tools/quake2/qdata/models.o \ - tools/quake2/qdata/qdata.o \ - tools/quake2/qdata/sprites.o \ - tools/quake2/qdata/tables.o \ - tools/quake2/qdata/video.o \ - libl_net.$(A) \ - $(if $(findstring $(OS),Win32),icons/qdata3.o,) \ - -$(INSTALLDIR)/q2map.$(EXE): LIBS_EXTRA := $(LIBS_XML) -$(INSTALLDIR)/q2map.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) -Itools/quake2/common -Ilibs -Iinclude -$(INSTALLDIR)/q2map.$(EXE): \ - tools/quake2/common/bspfile.o \ - tools/quake2/common/cmdlib.o \ - tools/quake2/common/inout.o \ - tools/quake2/common/l3dslib.o \ - tools/quake2/common/lbmlib.o \ - tools/quake2/common/mathlib.o \ - tools/quake2/common/md4.o \ - tools/quake2/common/path_init.o \ - tools/quake2/common/polylib.o \ - tools/quake2/common/scriplib.o \ - tools/quake2/common/threads.o \ - tools/quake2/common/trilib.o \ - tools/quake2/q2map/brushbsp.o \ - tools/quake2/q2map/csg.o \ - tools/quake2/q2map/faces.o \ - tools/quake2/q2map/flow.o \ - tools/quake2/q2map/glfile.o \ - tools/quake2/q2map/leakfile.o \ - tools/quake2/q2map/lightmap.o \ - tools/quake2/q2map/main.o \ - tools/quake2/q2map/map.o \ - tools/quake2/q2map/nodraw.o \ - tools/quake2/q2map/patches.o \ - tools/quake2/q2map/portals.o \ - tools/quake2/q2map/prtfile.o \ - tools/quake2/q2map/qbsp.o \ - tools/quake2/q2map/qrad.o \ - tools/quake2/q2map/qvis.o \ - tools/quake2/q2map/textures.o \ - tools/quake2/q2map/trace.o \ - tools/quake2/q2map/tree.o \ - tools/quake2/q2map/writebsp.o \ - libl_net.$(A) \ - $(if $(findstring $(OS),Win32),icons/q2map.o,) \ - -$(INSTALLDIR)/plugins/ufoaiplug.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK) -$(INSTALLDIR)/plugins/ufoaiplug.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude -$(INSTALLDIR)/plugins/ufoaiplug.$(DLL): \ - contrib/ufoaiplug/ufoai_filters.o \ - contrib/ufoaiplug/ufoai_gtk.o \ - contrib/ufoaiplug/ufoai_level.o \ - contrib/ufoaiplug/ufoai.o \ - -$(INSTALLDIR)/plugins/bkgrnd2d.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK) -$(INSTALLDIR)/plugins/bkgrnd2d.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude -$(INSTALLDIR)/plugins/bkgrnd2d.$(DLL): \ - contrib/bkgrnd2d/bkgrnd2d.o \ - contrib/bkgrnd2d/dialog.o \ - contrib/bkgrnd2d/plugin.o \ - -$(INSTALLDIR)/heretic2/h2data.$(EXE): LIBS_EXTRA := $(LIBS_XML) -$(INSTALLDIR)/heretic2/h2data.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) -Itools/quake2/qdata_heretic2/common -Itools/quake2/qdata_heretic2/qcommon -Itools/quake2/qdata_heretic2 -Itools/quake2/common -Ilibs -Iinclude -$(INSTALLDIR)/heretic2/h2data.$(EXE): \ - tools/quake2/qdata_heretic2/common/bspfile.o \ - tools/quake2/qdata_heretic2/common/cmdlib.o \ - tools/quake2/qdata_heretic2/common/inout.o \ - tools/quake2/qdata_heretic2/common/l3dslib.o \ - tools/quake2/qdata_heretic2/common/lbmlib.o \ - tools/quake2/qdata_heretic2/common/mathlib.o \ - tools/quake2/qdata_heretic2/common/md4.o \ - tools/quake2/qdata_heretic2/common/path_init.o \ - tools/quake2/qdata_heretic2/common/qfiles.o \ - tools/quake2/qdata_heretic2/common/scriplib.o \ - tools/quake2/qdata_heretic2/common/threads.o \ - tools/quake2/qdata_heretic2/common/token.o \ - tools/quake2/qdata_heretic2/common/trilib.o \ - tools/quake2/qdata_heretic2/qcommon/reference.o \ - tools/quake2/qdata_heretic2/qcommon/resourcemanager.o \ - tools/quake2/qdata_heretic2/qcommon/skeletons.o \ - tools/quake2/qdata_heretic2/animcomp.o \ - tools/quake2/qdata_heretic2/book.o \ - tools/quake2/qdata_heretic2/fmodels.o \ - tools/quake2/qdata_heretic2/images.o \ - tools/quake2/qdata_heretic2/jointed.o \ - tools/quake2/qdata_heretic2/models.o \ - tools/quake2/qdata_heretic2/pics.o \ - tools/quake2/qdata_heretic2/qdata.o \ - tools/quake2/qdata_heretic2/qd_skeletons.o \ - tools/quake2/qdata_heretic2/sprites.o \ - tools/quake2/qdata_heretic2/svdcmp.o \ - tools/quake2/qdata_heretic2/tables.o \ - tools/quake2/qdata_heretic2/tmix.o \ - tools/quake2/qdata_heretic2/video.o \ - libl_net.$(A) \ - $(if $(findstring $(OS),Win32),icons/h2data.o,) \ - -.PHONY: install-data -install-data: binaries - $(MKDIR) $(INSTALLDIR)/games - $(FIND) $(INSTALLDIR_BASE)/ -name .svn -exec $(RM_R) {} \; -prune - DOWNLOAD_GAMEPACKS="$(DOWNLOAD_GAMEPACKS)" GIT="$(GIT)" SVN="$(SVN)" WGET="$(WGET)" RM_R="$(RM_R)" MV="$(MV)" UNZIPPER="$(UNZIPPER)" ECHO="$(ECHO)" SH="$(SH)" CP="$(CP)" CP_R="$(CP_R)" $(SH) install-gamepacks.sh "$(INSTALLDIR)" - $(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR - $(ECHO) $(RADIANT_MAJOR_VERSION) > $(INSTALLDIR)/RADIANT_MAJOR - $(CP_R) setup/data/tools/* $(INSTALLDIR)/ - $(MKDIR) $(INSTALLDIR)/docs - $(CP_R) docs/* $(INSTALLDIR)/docs/ - $(FIND) $(INSTALLDIR_BASE)/ -name .svn -exec $(RM_R) {} \; -prune - -.PHONY: install-dll -ifeq ($(OS),Win32) -install-dll: binaries - MKDIR="$(MKDIR)" CP="$(CP)" CAT="$(CAT)" GTKDIR="$(GTKDIR)" WHICHDLL="$(WHICHDLL)" INSTALLDIR="$(INSTALLDIR)" $(SH) $(DLLINSTALL) -else -install-dll: binaries - @$(ECHO) No DLL inclusion implemented for this target. -endif - -# release building... NOT for general users -# these may use tools not in the list that is checked by the build system -release-src: BUILD_DATE := $(shell date +%Y%m%d) -release-src: INSTALLDIR := netradiant-$(RADIANT_VERSION_NUMBER)-$(BUILD_DATE) -release-src: - $(GIT) archive --format=tar --prefix=$(INSTALLDIR)/ HEAD | bzip2 > ../$(INSTALLDIR).tar.bz2 - -release-win32: BUILD_DATE := $(shell date +%Y%m%d) -release-win32: INSTALLDIR := netradiant-$(RADIANT_VERSION_NUMBER)-$(BUILD_DATE) -release-win32: - $(MAKE) all INSTALLDIR=$(INSTALLDIR) MAKEFILE_CONF=cross-Makefile.conf RADIANT_ABOUTMSG="Official release build" BUILD=release - 7za a -sfx../../../../../../../../../../$(HOME)/7z.sfx ../$(INSTALLDIR)-win32-7z.exe $(INSTALLDIR)/ - chmod 644 ../$(INSTALLDIR)-win32-7z.exe # 7zip is evil - $(MAKE) clean INSTALLDIR=$(INSTALLDIR) MAKEFILE_CONF=cross-Makefile.conf RADIANT_ABOUTMSG="Official release build" BUILD=release - -release-all: - $(GIT) clean -xdf - $(MAKE) release-src - $(MAKE) release-win32 - -# load dependency files --include $(shell find . -name \*.d) diff --git a/Makefile.conf b/Makefile.conf deleted file mode 100644 index 95d54970..00000000 --- a/Makefile.conf +++ /dev/null @@ -1,17 +0,0 @@ -# empty Makefile.conf template - -## OS X: -# BUILD=debug -# RADIANT_ABOUTMSG=Custom build -# EXE=ub - -## Fink -## (-arch ppc can combined with -arch 386, I read somewhere. However does work fine like this on OSX 10.6) -# LDFLAGS=-arch i386 -# CFLAGS=-arch i386 -# TARGET_ARCH=-arch i386 -# MACLIBDIR=/sw/lib - -## On some versions of OSX you may get compile errors regarding glTexImage1D, uncomment this to fix it -#MACVERSION ?= 16 -#CPPFLAGS_COMMON += -DMACVERSION="$(MACVERSION)" diff --git a/conftest.cpp b/conftest.cpp deleted file mode 100644 index 10b7a620..00000000 --- a/conftest.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include /* jpeglib.h needs it */ -#include CONFTEST_HEADER -int main(){ - (void) CONFTEST_SYMBOL; - return 0; -} diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index d6baa6ec..7ef65337 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -1,12 +1,6 @@ include_directories("${CMAKE_SOURCE_DIR}/libs") include_directories("${CMAKE_SOURCE_DIR}/include") -find_package(GTK2 REQUIRED) -include_directories(${GTK2_INCLUDE_DIRS} ${GTK2_GDK_INCLUDE_DIR} ${GTK2_GLIB_INCLUDE_DIR}) - -find_package(LibXml2 REQUIRED) -include_directories(${LIBXML2_INCLUDE_DIR}) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") add_custom_target(plugins) diff --git a/contrib/bobtoolz/CMakeLists.txt b/contrib/bobtoolz/CMakeLists.txt index 36cc2bf5..b47fdd87 100644 --- a/contrib/bobtoolz/CMakeLists.txt +++ b/contrib/bobtoolz/CMakeLists.txt @@ -1,80 +1,47 @@ radiant_plugin(bobtoolz -# dialogs/AboutDialog.cpp -# dialogs/AboutDialog.h -# dialogs/AutoCaulkDialog.cpp -# dialogs/AutoCaulkDialog.h -# dialogs/AutoCaulkStartDialog.cpp -# dialogs/AutoCaulkStartDialog.h -# dialogs/BrushCheckDialog.h -# dialogs/DoorDialog.cpp -# dialogs/DoorDialog.h -# dialogs/IntersectDialog.cpp -# dialogs/IntersectDialog.h -# dialogs/IntersectInfoDialog.cpp -# dialogs/IntersectInfoDialog.h -# dialogs/PolygonDialog.cpp -# dialogs/PolygonDialog.h -# dialogs/StairDialog.cpp -# dialogs/StairDialog.h -# dialogs/TextureResetDialog.cpp -# dialogs/TextureResetDialog.h -# dialogs/brushcheckdialog.cpp - dialogs/dialogs-gtk.cpp - dialogs/dialogs-gtk.h -# dialogs/pathplotterdialog.cpp -# dialogs/pathplotterdialog.h - CPortals.h - DBobView.cpp - DBobView.h - DBrush.cpp - DBrush.h - DEPair.cpp - DEPair.h - DEntity.cpp - DEntity.h - DMap.cpp - DMap.h - DPatch.cpp - DPatch.h - DPlane.cpp - DPlane.h - DPoint.cpp - DPoint.h - DShape.cpp - DShape.h - DTrainDrawer.cpp - DTrainDrawer.h - DTreePlanter.cpp - DTreePlanter.h - DVisDrawer.cpp - DVisDrawer.h - DWinding.cpp - DWinding.h - ScriptParser.cpp - ScriptParser.h -# StdAfx.cpp -# StdAfx.h - bobToolz-GTK.cpp - bobToolz.h - bsploader.cpp - bsploader.h - cportals.cpp -# ctfToolz-GTK.cpp -# ctfresource_gtk.h - funchandlers-GTK.cpp -# funchandlers-ctf-GTK.cpp -# funchandlers.cpp - funchandlers.h - lists.cpp - lists.h - misc.cpp - misc.h -# resource-gtk.h -# resource.h - shapes.cpp - shapes.h - visfind.cpp - visfind.h -) + # dialogs/AboutDialog.cpp dialogs/AboutDialog.h + # dialogs/AutoCaulkDialog.cpp dialogs/AutoCaulkDialog.h + # dialogs/AutoCaulkStartDialog.cpp dialogs/AutoCaulkStartDialog.h + # dialogs/BrushCheckDialog.cpp dialogs/BrushCheckDialog.h + dialogs/dialogs-gtk.cpp dialogs/dialogs-gtk.h + # dialogs/DoorDialog.cpp dialogs/DoorDialog.h + # dialogs/IntersectDialog.cpp dialogs/IntersectDialog.h + # dialogs/IntersectInfoDialog.cpp dialogs/IntersectInfoDialog.h + # dialogs/pathplotterdialog.cpp dialogs/pathplotterdialog.h + # dialogs/PolygonDialog.cpp dialogs/PolygonDialog.h + # dialogs/StairDialog.cpp dialogs/StairDialog.h + # dialogs/TextureResetDialog.cpp dialogs/TextureResetDialog.h + CPortals.cpp CPortals.h + DBobView.cpp DBobView.h + DBrush.cpp DBrush.h + DEPair.cpp DEPair.h + DEntity.cpp DEntity.h + DMap.cpp DMap.h + DPatch.cpp DPatch.h + DPlane.cpp DPlane.h + DPoint.cpp DPoint.h + DShape.cpp DShape.h + DTrainDrawer.cpp DTrainDrawer.h + DTreePlanter.cpp DTreePlanter.h + DVisDrawer.cpp DVisDrawer.h + DWinding.cpp DWinding.h + ScriptParser.cpp ScriptParser.h + bobToolz-GTK.cpp bobToolz.h + bsploader.cpp bsploader.h + # ctfToolz-GTK.cpp + # ctfresource_gtk.h + funchandlers-GTK.cpp + # funchandlers-ctf-GTK.cpp + # funchandlers.cpp funchandlers.h + lists.cpp lists.h + misc.cpp misc.h + # resource.h + # resource-gtk.h + shapes.cpp shapes.h + visfind.cpp visfind.h + ) -target_link_libraries(bobtoolz cmdlib mathlib profile ${GLIB_LIBRARIES} ${GTK2_LIBRARIES}) +find_package(GTK2 REQUIRED) +target_include_directories(bobtoolz PRIVATE ${GTK2_INCLUDE_DIRS}) + +target_link_libraries(bobtoolz mathlib) diff --git a/contrib/bobtoolz/CPortals.cpp b/contrib/bobtoolz/CPortals.cpp new file mode 100644 index 00000000..073c979d --- /dev/null +++ b/contrib/bobtoolz/CPortals.cpp @@ -0,0 +1,327 @@ +/* + BobToolz plugin for GtkRadiant + Copyright (C) 2001 Gordon Biggans + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "CPortals.h" + +#include +#include + +#include "misc.h" + +#define LINE_BUF 1000 +#define MSG_PREFIX "bobToolz plugin: " + +// these classes are far less of a mess than my code was, +// thanq to G.DeWan 4 the prtview source on which it was based + +CBspPortal::CBspPortal(){ + memset( this, 0, sizeof( CBspPortal ) ); +} + +CBspPortal::~CBspPortal(){ + delete[] point; +} + +void ClampFloat( float* p ){ + double i; + double frac = modf( *p, &i ); + + if ( !frac ) { + return; + } + + if ( fabs( *p - ceil( *p ) ) < MAX_ROUND_ERROR ) { + *p = static_cast( ceil( *p ) ); + } + + if ( fabs( *p - floor( *p ) ) < MAX_ROUND_ERROR ) { + *p = static_cast( floor( *p ) ); + } +} + +bool CBspPortal::Build( char *def, unsigned int pointCnt, bool bInverse ){ + char *c = def; + unsigned int n; + + point_count = pointCnt; + + if ( point_count < 3 ) { + return false; + } + + point = new CBspPoint[point_count]; + + for ( n = 0; n < point_count; n++ ) + { + for (; *c != 0 && *c != '('; c++ ) ; + + if ( *c == 0 ) { + return false; + } + + c++; + + int x; + if ( bInverse ) { + x = point_count - n - 1; + } + else{ + x = n; + } + + sscanf( c, "%f %f %f", &point[x].p[0], &point[x].p[1], &point[x].p[2] ); + + ClampFloat( &point[x].p[0] ); + ClampFloat( &point[x].p[1] ); + ClampFloat( &point[x].p[2] ); + } + + return true; +} + +CPortals::CPortals(){ + memset( this, 0, sizeof( CPortals ) ); +} + +CPortals::~CPortals(){ + Purge(); +} + +void CPortals::Purge(){ + if ( node ) { + delete[] node; + } + node = NULL; + node_count = 0; +} + +void CPortals::Load(){ + char buf[LINE_BUF + 1]; + + memset( buf, 0, LINE_BUF + 1 ); + + Purge(); + + globalOutputStream() << MSG_PREFIX "Loading portal file " << fn << ".\n"; + + FILE *in; + + in = fopen( fn, "rt" ); + + if ( in == NULL ) { + globalOutputStream() << " ERROR - could not open file.\n"; + + return; + } + + if ( !fgets( buf, LINE_BUF, in ) ) { + fclose( in ); + + globalOutputStream() << " ERROR - File ended prematurely.\n"; + + return; + } + + if ( strncmp( "PRT1", buf, 4 ) != 0 ) { + fclose( in ); + + globalOutputStream() << " ERROR - File header indicates wrong file type (should be \"PRT1\").\n"; + + return; + } + + if ( !fgets( buf, LINE_BUF, in ) ) { + fclose( in ); + + globalOutputStream() << " ERROR - File ended prematurely.\n"; + + return; + } + + sscanf( buf, "%u", &node_count ); + + if ( node_count > 0xFFFF ) { + fclose( in ); + + node_count = 0; + + globalOutputStream() << " ERROR - Extreme number of nodes, aborting.\n"; + + return; + } + + if ( !fgets( buf, LINE_BUF, in ) ) { + fclose( in ); + + node_count = 0; + + globalOutputStream() << " ERROR - File ended prematurely.\n"; + + return; + } + + unsigned int p_count; + sscanf( buf, "%u", &p_count ); + + if ( !fgets( buf, LINE_BUF, in ) ) { + fclose( in ); + + node_count = 0; + + globalOutputStream() << " ERROR - File ended prematurely.\n"; + + return; + } + + unsigned int p_count2; + sscanf( buf, "%u", &p_count2 ); + + node = new CBspNode[node_count]; + + unsigned int i; + for ( i = 0; i < p_count; i++ ) + { + if ( !fgets( buf, LINE_BUF, in ) ) { + fclose( in ); + + node_count = 0; + + globalOutputStream() << " ERROR - File ended prematurely.\n"; + + return; + } + + unsigned int dummy, node1, node2; + sscanf( buf, "%u %u %u", &dummy, &node1, &node2 ); + + node[node1].portal_count++; + node[node2].portal_count++; + } + + for ( i = 0; i < p_count2; i++ ) + { + if ( !fgets( buf, LINE_BUF, in ) ) { + fclose( in ); + + node_count = 0; + + globalOutputStream() << " ERROR - File ended prematurely.\n"; + + return; + } + + unsigned int dummy, node1; + sscanf( buf, "%u %u", &dummy, &node1 ); + + node[node1].portal_count++; + } + + for ( i = 0; i < node_count; i++ ) + node[i].portal = new CBspPortal[node[i].portal_count]; + + fclose( in ); + + in = fopen( fn, "rt" ); + + fgets( buf, LINE_BUF, in ); + fgets( buf, LINE_BUF, in ); + fgets( buf, LINE_BUF, in ); + fgets( buf, LINE_BUF, in ); + + unsigned int n; + for ( n = 0; n < p_count; n++ ) + { + if ( !fgets( buf, LINE_BUF, in ) ) { + fclose( in ); + + Purge(); + + globalOutputStream() << " ERROR - Could not find information for portal number " << n + 1 << " of " << p_count << ".\n"; + + return; + } + + unsigned int pCount, node1, node2; + sscanf( buf, "%u %u %u", &pCount, &node1, &node2 ); + + if ( !node[node1].AddPortal( buf, pCount, false ) ) { + fclose( in ); + + Purge(); + + globalOutputStream() << " ERROR - Information for portal number " << n + 1 << " of " << p_count << " is not formatted correctly.\n"; + + return; + } + + if ( !node[node2].AddPortal( buf, pCount, true ) ) { + fclose( in ); + + Purge(); + + globalOutputStream() << " ERROR - Information for portal number " << n + 1 << " of " << p_count << " is not formatted correctly.\n"; + + return; + } + } + + for ( n = 0; n < p_count2; n++ ) + { + if ( !fgets( buf, LINE_BUF, in ) ) { + fclose( in ); + + Purge(); + + globalOutputStream() << " ERROR - Could not find information for portal number " << n + 1 << " of " << p_count << ".\n"; + + return; + } + + unsigned int pCount, node1; + sscanf( buf, "%u %u", &pCount, &node1 ); + + if ( !node[node1].AddPortal( buf, pCount, false ) ) { + fclose( in ); + + Purge(); + + globalOutputStream() << " ERROR - Information for portal number " << n + 1 << " of " << p_count << " is not formatted correctly.\n"; + + return; + } + } + + fclose( in ); +} + +CBspNode::CBspNode(){ + portal = NULL; + portal_count = 0; + portal_next = 0; +} + +CBspNode::~CBspNode(){ + if ( portal != NULL ) { + delete[] portal; + } +} + +bool CBspNode::AddPortal( char *def, unsigned int pointCnt, bool bInverse ){ + return portal[portal_next++].Build( def, pointCnt, bInverse ); +} diff --git a/contrib/bobtoolz/DBobView.h b/contrib/bobtoolz/DBobView.h index 05c8ad29..23b5cb14 100644 --- a/contrib/bobtoolz/DBobView.h +++ b/contrib/bobtoolz/DBobView.h @@ -27,7 +27,7 @@ #include "ientity.h" #include "irender.h" #include "renderable.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" class DListener; class Shader; diff --git a/contrib/bobtoolz/DBrush.h b/contrib/bobtoolz/DBrush.h index b5e343eb..defad750 100644 --- a/contrib/bobtoolz/DBrush.h +++ b/contrib/bobtoolz/DBrush.h @@ -30,7 +30,7 @@ #include #include -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "str.h" class DPlane; diff --git a/contrib/bobtoolz/DEntity.h b/contrib/bobtoolz/DEntity.h index 415442a2..45c90f7c 100644 --- a/contrib/bobtoolz/DEntity.h +++ b/contrib/bobtoolz/DEntity.h @@ -30,7 +30,7 @@ #include #include "str.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" class DEPair; class DBrush; diff --git a/contrib/bobtoolz/DPlane.h b/contrib/bobtoolz/DPlane.h index 69ce0eb3..c22aff31 100644 --- a/contrib/bobtoolz/DPlane.h +++ b/contrib/bobtoolz/DPlane.h @@ -27,7 +27,7 @@ #include #include "ibrush.h" #include "string/string.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" class Brush; class DPoint; diff --git a/contrib/bobtoolz/DPoint.h b/contrib/bobtoolz/DPoint.h index f7b68396..d55352a2 100644 --- a/contrib/bobtoolz/DPoint.h +++ b/contrib/bobtoolz/DPoint.h @@ -28,7 +28,7 @@ #pragma once #endif // _MSC_VER > 1000 -#include "mathlib.h" +#include "mathlib/mathlib.h" class DPoint { diff --git a/contrib/bobtoolz/DShape.h b/contrib/bobtoolz/DShape.h index 16f6ba68..c9d5f962 100644 --- a/contrib/bobtoolz/DShape.h +++ b/contrib/bobtoolz/DShape.h @@ -29,7 +29,7 @@ #endif // _MSC_VER > 1000 #include -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "DMap.h" class DBrush; class DEntity; diff --git a/contrib/bobtoolz/DTrainDrawer.h b/contrib/bobtoolz/DTrainDrawer.h index 2b79f674..2f56972a 100644 --- a/contrib/bobtoolz/DTrainDrawer.h +++ b/contrib/bobtoolz/DTrainDrawer.h @@ -30,7 +30,7 @@ #endif // _MSC_VER > 1000 #include -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "irender.h" #include "renderable.h" diff --git a/contrib/bobtoolz/DTreePlanter.h b/contrib/bobtoolz/DTreePlanter.h index 9f8cbdd9..3355a5c4 100644 --- a/contrib/bobtoolz/DTreePlanter.h +++ b/contrib/bobtoolz/DTreePlanter.h @@ -27,7 +27,7 @@ #include "DEntity.h" #include "ScriptParser.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "misc.h" #define MAX_QPATH 64 diff --git a/contrib/bobtoolz/DWinding.h b/contrib/bobtoolz/DWinding.h index 94a28096..02b1ba21 100644 --- a/contrib/bobtoolz/DWinding.h +++ b/contrib/bobtoolz/DWinding.h @@ -28,7 +28,7 @@ #pragma once #endif // _MSC_VER > 1000 -#include "mathlib.h" +#include "mathlib/mathlib.h" class DPlane; diff --git a/contrib/bobtoolz/StdAfx.cpp b/contrib/bobtoolz/StdAfx.cpp deleted file mode 100644 index 5c7495fa..00000000 --- a/contrib/bobtoolz/StdAfx.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* - BobToolz plugin for GtkRadiant - Copyright (C) 2001 Gordon Biggans - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -// stdafx.cpp : source file that includes just the standard includes -// plugin.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "StdAfx.h" diff --git a/contrib/bobtoolz/StdAfx.h b/contrib/bobtoolz/StdAfx.h deleted file mode 100644 index cfce5a4e..00000000 --- a/contrib/bobtoolz/StdAfx.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - BobToolz plugin for GtkRadiant - Copyright (C) 2001 Gordon Biggans - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __STDAFX_BOBTOOLZ__ -#define __STDAFX_BOBTOOLZ__ - - - -#endif diff --git a/contrib/bobtoolz/bobToolz-GTK.cpp b/contrib/bobtoolz/bobToolz-GTK.cpp index a0a63878..227ae6ff 100644 --- a/contrib/bobtoolz/bobToolz-GTK.cpp +++ b/contrib/bobtoolz/bobToolz-GTK.cpp @@ -21,7 +21,7 @@ #include "str.h" #include "qerplugin.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "string/string.h" #include "itoolbar.h" @@ -32,7 +32,7 @@ #include "DTreePlanter.h" #include "dialogs/dialogs-gtk.h" -#include "../../libs/cmdlib.h" +#include "cmdlib/cmdlib.h" void BobToolz_construct(){ } diff --git a/contrib/bobtoolz/bsploader.cpp b/contrib/bobtoolz/bsploader.cpp index 6c8b09e9..fe4f8f66 100644 --- a/contrib/bobtoolz/bsploader.cpp +++ b/contrib/bobtoolz/bsploader.cpp @@ -1,6 +1,6 @@ #include "bsploader.h" #include "dialogs/dialogs-gtk.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" int numnodes; int numplanes; diff --git a/contrib/bobtoolz/bsploader.h b/contrib/bobtoolz/bsploader.h index 7bee8fd0..8362414c 100644 --- a/contrib/bobtoolz/bsploader.h +++ b/contrib/bobtoolz/bsploader.h @@ -1,5 +1,5 @@ -#include "mathlib.h" +#include "mathlib/mathlib.h" #define LUMP_ENTITIES 0 #define LUMP_SHADERS 1 diff --git a/contrib/bobtoolz/cportals.cpp b/contrib/bobtoolz/cportals.cpp deleted file mode 100644 index 073c979d..00000000 --- a/contrib/bobtoolz/cportals.cpp +++ /dev/null @@ -1,327 +0,0 @@ -/* - BobToolz plugin for GtkRadiant - Copyright (C) 2001 Gordon Biggans - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "CPortals.h" - -#include -#include - -#include "misc.h" - -#define LINE_BUF 1000 -#define MSG_PREFIX "bobToolz plugin: " - -// these classes are far less of a mess than my code was, -// thanq to G.DeWan 4 the prtview source on which it was based - -CBspPortal::CBspPortal(){ - memset( this, 0, sizeof( CBspPortal ) ); -} - -CBspPortal::~CBspPortal(){ - delete[] point; -} - -void ClampFloat( float* p ){ - double i; - double frac = modf( *p, &i ); - - if ( !frac ) { - return; - } - - if ( fabs( *p - ceil( *p ) ) < MAX_ROUND_ERROR ) { - *p = static_cast( ceil( *p ) ); - } - - if ( fabs( *p - floor( *p ) ) < MAX_ROUND_ERROR ) { - *p = static_cast( floor( *p ) ); - } -} - -bool CBspPortal::Build( char *def, unsigned int pointCnt, bool bInverse ){ - char *c = def; - unsigned int n; - - point_count = pointCnt; - - if ( point_count < 3 ) { - return false; - } - - point = new CBspPoint[point_count]; - - for ( n = 0; n < point_count; n++ ) - { - for (; *c != 0 && *c != '('; c++ ) ; - - if ( *c == 0 ) { - return false; - } - - c++; - - int x; - if ( bInverse ) { - x = point_count - n - 1; - } - else{ - x = n; - } - - sscanf( c, "%f %f %f", &point[x].p[0], &point[x].p[1], &point[x].p[2] ); - - ClampFloat( &point[x].p[0] ); - ClampFloat( &point[x].p[1] ); - ClampFloat( &point[x].p[2] ); - } - - return true; -} - -CPortals::CPortals(){ - memset( this, 0, sizeof( CPortals ) ); -} - -CPortals::~CPortals(){ - Purge(); -} - -void CPortals::Purge(){ - if ( node ) { - delete[] node; - } - node = NULL; - node_count = 0; -} - -void CPortals::Load(){ - char buf[LINE_BUF + 1]; - - memset( buf, 0, LINE_BUF + 1 ); - - Purge(); - - globalOutputStream() << MSG_PREFIX "Loading portal file " << fn << ".\n"; - - FILE *in; - - in = fopen( fn, "rt" ); - - if ( in == NULL ) { - globalOutputStream() << " ERROR - could not open file.\n"; - - return; - } - - if ( !fgets( buf, LINE_BUF, in ) ) { - fclose( in ); - - globalOutputStream() << " ERROR - File ended prematurely.\n"; - - return; - } - - if ( strncmp( "PRT1", buf, 4 ) != 0 ) { - fclose( in ); - - globalOutputStream() << " ERROR - File header indicates wrong file type (should be \"PRT1\").\n"; - - return; - } - - if ( !fgets( buf, LINE_BUF, in ) ) { - fclose( in ); - - globalOutputStream() << " ERROR - File ended prematurely.\n"; - - return; - } - - sscanf( buf, "%u", &node_count ); - - if ( node_count > 0xFFFF ) { - fclose( in ); - - node_count = 0; - - globalOutputStream() << " ERROR - Extreme number of nodes, aborting.\n"; - - return; - } - - if ( !fgets( buf, LINE_BUF, in ) ) { - fclose( in ); - - node_count = 0; - - globalOutputStream() << " ERROR - File ended prematurely.\n"; - - return; - } - - unsigned int p_count; - sscanf( buf, "%u", &p_count ); - - if ( !fgets( buf, LINE_BUF, in ) ) { - fclose( in ); - - node_count = 0; - - globalOutputStream() << " ERROR - File ended prematurely.\n"; - - return; - } - - unsigned int p_count2; - sscanf( buf, "%u", &p_count2 ); - - node = new CBspNode[node_count]; - - unsigned int i; - for ( i = 0; i < p_count; i++ ) - { - if ( !fgets( buf, LINE_BUF, in ) ) { - fclose( in ); - - node_count = 0; - - globalOutputStream() << " ERROR - File ended prematurely.\n"; - - return; - } - - unsigned int dummy, node1, node2; - sscanf( buf, "%u %u %u", &dummy, &node1, &node2 ); - - node[node1].portal_count++; - node[node2].portal_count++; - } - - for ( i = 0; i < p_count2; i++ ) - { - if ( !fgets( buf, LINE_BUF, in ) ) { - fclose( in ); - - node_count = 0; - - globalOutputStream() << " ERROR - File ended prematurely.\n"; - - return; - } - - unsigned int dummy, node1; - sscanf( buf, "%u %u", &dummy, &node1 ); - - node[node1].portal_count++; - } - - for ( i = 0; i < node_count; i++ ) - node[i].portal = new CBspPortal[node[i].portal_count]; - - fclose( in ); - - in = fopen( fn, "rt" ); - - fgets( buf, LINE_BUF, in ); - fgets( buf, LINE_BUF, in ); - fgets( buf, LINE_BUF, in ); - fgets( buf, LINE_BUF, in ); - - unsigned int n; - for ( n = 0; n < p_count; n++ ) - { - if ( !fgets( buf, LINE_BUF, in ) ) { - fclose( in ); - - Purge(); - - globalOutputStream() << " ERROR - Could not find information for portal number " << n + 1 << " of " << p_count << ".\n"; - - return; - } - - unsigned int pCount, node1, node2; - sscanf( buf, "%u %u %u", &pCount, &node1, &node2 ); - - if ( !node[node1].AddPortal( buf, pCount, false ) ) { - fclose( in ); - - Purge(); - - globalOutputStream() << " ERROR - Information for portal number " << n + 1 << " of " << p_count << " is not formatted correctly.\n"; - - return; - } - - if ( !node[node2].AddPortal( buf, pCount, true ) ) { - fclose( in ); - - Purge(); - - globalOutputStream() << " ERROR - Information for portal number " << n + 1 << " of " << p_count << " is not formatted correctly.\n"; - - return; - } - } - - for ( n = 0; n < p_count2; n++ ) - { - if ( !fgets( buf, LINE_BUF, in ) ) { - fclose( in ); - - Purge(); - - globalOutputStream() << " ERROR - Could not find information for portal number " << n + 1 << " of " << p_count << ".\n"; - - return; - } - - unsigned int pCount, node1; - sscanf( buf, "%u %u", &pCount, &node1 ); - - if ( !node[node1].AddPortal( buf, pCount, false ) ) { - fclose( in ); - - Purge(); - - globalOutputStream() << " ERROR - Information for portal number " << n + 1 << " of " << p_count << " is not formatted correctly.\n"; - - return; - } - } - - fclose( in ); -} - -CBspNode::CBspNode(){ - portal = NULL; - portal_count = 0; - portal_next = 0; -} - -CBspNode::~CBspNode(){ - if ( portal != NULL ) { - delete[] portal; - } -} - -bool CBspNode::AddPortal( char *def, unsigned int pointCnt, bool bInverse ){ - return portal[portal_next++].Build( def, pointCnt, bInverse ); -} diff --git a/contrib/bobtoolz/dialogs/BrushCheckDialog.cpp b/contrib/bobtoolz/dialogs/BrushCheckDialog.cpp new file mode 100644 index 00000000..3b3ac607 --- /dev/null +++ b/contrib/bobtoolz/dialogs/BrushCheckDialog.cpp @@ -0,0 +1,59 @@ +/* + BobToolz plugin for GtkRadiant + Copyright (C) 2001 Gordon Biggans + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +// BrushCheckDialog.cpp : implementation file +// + +#include "../StdAfx.h" +#include "../bobtoolz.h" +#include "BrushCheckDialog.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CBrushCheckDialog dialog + + +CBrushCheckDialog::CBrushCheckDialog( CWnd* pParent /*=NULL*/ ) + : CDialog( CBrushCheckDialog::IDD, pParent ){ + //{{AFX_DATA_INIT(CBrushCheckDialog) + //}}AFX_DATA_INIT +} + + +void CBrushCheckDialog::DoDataExchange( CDataExchange* pDX ){ + CDialog::DoDataExchange( pDX ); + //{{AFX_DATA_MAP(CBrushCheckDialog) + DDX_Control( pDX, IDC_PROGRESS1, m_prog1 ); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP( CBrushCheckDialog, CDialog ) +//{{AFX_MSG_MAP(CBrushCheckDialog) +// NOTE: the ClassWizard will add message map macros here +//}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CBrushCheckDialog message handlers diff --git a/contrib/bobtoolz/dialogs/brushcheckdialog.cpp b/contrib/bobtoolz/dialogs/brushcheckdialog.cpp deleted file mode 100644 index 3b3ac607..00000000 --- a/contrib/bobtoolz/dialogs/brushcheckdialog.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - BobToolz plugin for GtkRadiant - Copyright (C) 2001 Gordon Biggans - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -// BrushCheckDialog.cpp : implementation file -// - -#include "../StdAfx.h" -#include "../bobtoolz.h" -#include "BrushCheckDialog.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CBrushCheckDialog dialog - - -CBrushCheckDialog::CBrushCheckDialog( CWnd* pParent /*=NULL*/ ) - : CDialog( CBrushCheckDialog::IDD, pParent ){ - //{{AFX_DATA_INIT(CBrushCheckDialog) - //}}AFX_DATA_INIT -} - - -void CBrushCheckDialog::DoDataExchange( CDataExchange* pDX ){ - CDialog::DoDataExchange( pDX ); - //{{AFX_DATA_MAP(CBrushCheckDialog) - DDX_Control( pDX, IDC_PROGRESS1, m_prog1 ); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP( CBrushCheckDialog, CDialog ) -//{{AFX_MSG_MAP(CBrushCheckDialog) -// NOTE: the ClassWizard will add message map macros here -//}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CBrushCheckDialog message handlers diff --git a/contrib/bobtoolz/funchandlers-ctf-GTK.cpp b/contrib/bobtoolz/funchandlers-ctf-GTK.cpp index 637cf5a2..1f068fbc 100644 --- a/contrib/bobtoolz/funchandlers-ctf-GTK.cpp +++ b/contrib/bobtoolz/funchandlers-ctf-GTK.cpp @@ -17,8 +17,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "StdAfx.h" - #include "dialogs/dialogs-gtk.h" #include "DEntity.h" @@ -29,8 +27,8 @@ #include "funchandlers.h" // for ctf texture changer -list clrList_Blue; -list clrList_Red; +std::list clrList_Blue; +std::list clrList_Red; BOOL clrLst1Loaded = FALSE; BOOL clrLst2Loaded = FALSE; diff --git a/contrib/bobtoolz/funchandlers.cpp b/contrib/bobtoolz/funchandlers.cpp index 2a404211..61207bb7 100644 --- a/contrib/bobtoolz/funchandlers.cpp +++ b/contrib/bobtoolz/funchandlers.cpp @@ -17,20 +17,18 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "StdAfx.h" - #include "funchandlers.h" -#include "IntersectDialog.h" -#include "PolygonDialog.h" -#include "StairDialog.h" -#include "DoorDialog.h" -#include "IntersectInfoDialog.h" -#include "BrushCheckDialog.h" -#include "AutoCaulkDialog.h" -#include "AutoCaulkStartDialog.h" -#include "TextureResetDialog.h" -#include "pathplotterdialog.h" +#include "dialogs/IntersectDialog.h" +#include "dialogs/PolygonDialog.h" +#include "dialogs/StairDialog.h" +#include "dialogs/DoorDialog.h" +#include "dialogs/IntersectInfoDialog.h" +#include "dialogs/BrushCheckDialog.h" +#include "dialogs/AutoCaulkDialog.h" +#include "dialogs/AutoCaulkStartDialog.h" +#include "dialogs/TextureResetDialog.h" +#include "dialogs/pathplotterdialog.h" #include "DEntity.h" #include "shapes.h" diff --git a/contrib/bobtoolz/misc.h b/contrib/bobtoolz/misc.h index 02ca174b..e3211848 100644 --- a/contrib/bobtoolz/misc.h +++ b/contrib/bobtoolz/misc.h @@ -20,7 +20,7 @@ #if !defined( INCLUDED_MISC_H ) #define INCLUDED_MISC_H -#include "mathlib.h" +#include "mathlib/mathlib.h" #include #include "str.h" #include "iscenegraph.h" diff --git a/contrib/bobtoolz/shapes.h b/contrib/bobtoolz/shapes.h index c35809e7..6e07cebf 100644 --- a/contrib/bobtoolz/shapes.h +++ b/contrib/bobtoolz/shapes.h @@ -31,7 +31,7 @@ namespace scene class Node; } -#include "mathlib.h" +#include "mathlib/mathlib.h" // generic (detail added 12/01/01, for AC+) void AddFaceWithTexture( scene::Node& brush, vec3_t va, vec3_t vb, vec3_t vc, const char* texture, bool detail ); diff --git a/contrib/bobtoolz/visfind.h b/contrib/bobtoolz/visfind.h index 54b3660d..ba181eb0 100644 --- a/contrib/bobtoolz/visfind.h +++ b/contrib/bobtoolz/visfind.h @@ -1,6 +1,6 @@ #include -#include "mathlib.h" +#include "mathlib/mathlib.h" class DWinding; diff --git a/contrib/brushexport/CMakeLists.txt b/contrib/brushexport/CMakeLists.txt index fe428c27..19c60d82 100644 --- a/contrib/brushexport/CMakeLists.txt +++ b/contrib/brushexport/CMakeLists.txt @@ -1,14 +1,10 @@ - radiant_plugin(brushexport - callbacks.cpp - callbacks.h - export.cpp - export.h - interface.cpp - plugin.cpp - plugin.h - support.cpp - support.h -) + callbacks.cpp callbacks.h + export.cpp export.h + interface.cpp + plugin.cpp plugin.h + support.cpp support.h + ) -target_link_libraries(brushexport ${GTK2_LIBRARIES}) +find_package(GTK2 REQUIRED) +target_include_directories(brushexport PRIVATE ${GTK2_INCLUDE_DIRS}) diff --git a/contrib/camera/camera.h b/contrib/camera/camera.h index 896ca1be..1d5d6553 100644 --- a/contrib/camera/camera.h +++ b/contrib/camera/camera.h @@ -29,7 +29,7 @@ typedef unsigned char byte; -#include "mathlib.h" +#include "mathlib/mathlib.h" #include #include "qertypes.h" #include diff --git a/contrib/gtkgensurf/gensurf.h b/contrib/gtkgensurf/gensurf.h index 99e4a46b..bfc72701 100644 --- a/contrib/gtkgensurf/gensurf.h +++ b/contrib/gtkgensurf/gensurf.h @@ -24,7 +24,7 @@ #include "qertypes.h" #include -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "iscenegraph.h" #define USE_QERTABLE_DEFINE #include "qerplugin.h" diff --git a/contrib/hydratoolz/plugin.h b/contrib/hydratoolz/plugin.h index 7ea69b9c..8550fdb0 100644 --- a/contrib/hydratoolz/plugin.h +++ b/contrib/hydratoolz/plugin.h @@ -22,7 +22,7 @@ #ifndef _PLUGIN_H_ #define _PLUGIN_H_ -#include "mathlib.h" +#include "mathlib/mathlib.h" #include #include "qertypes.h" #include diff --git a/contrib/prtview/CMakeLists.txt b/contrib/prtview/CMakeLists.txt index 3de63046..344051f5 100644 --- a/contrib/prtview/CMakeLists.txt +++ b/contrib/prtview/CMakeLists.txt @@ -1,15 +1,10 @@ - radiant_plugin(prtview - AboutDialog.cpp - AboutDialog.h - ConfigDialog.cpp - ConfigDialog.h - LoadPortalFileDialog.cpp - LoadPortalFileDialog.h - portals.cpp - portals.h - prtview.cpp - prtview.h -) + AboutDialog.cpp AboutDialog.h + ConfigDialog.cpp ConfigDialog.h + LoadPortalFileDialog.cpp LoadPortalFileDialog.h + portals.cpp portals.h + prtview.cpp prtview.h + ) -target_link_libraries(prtview profile ${GTK2_LIBRARIES}) +find_package(GTK2 REQUIRED) +target_include_directories(prtview PRIVATE ${GTK2_INCLUDE_DIRS}) diff --git a/contrib/shaderplug/CMakeLists.txt b/contrib/shaderplug/CMakeLists.txt index df2c6297..7fca280f 100644 --- a/contrib/shaderplug/CMakeLists.txt +++ b/contrib/shaderplug/CMakeLists.txt @@ -1,7 +1,9 @@ - radiant_plugin(shaderplug - shaderplug.cpp - shaderplug.h -) + shaderplug.cpp shaderplug.h + ) + +find_package(LibXml2 REQUIRED) +target_include_directories(shaderplug PRIVATE ${LIBXML2_INCLUDE_DIR}) -target_link_libraries(shaderplug xmllib ${GTK2_LIBRARIES}) +find_package(GTK2 REQUIRED) +target_include_directories(shaderplug PRIVATE ${GTK2_INCLUDE_DIRS}) diff --git a/contrib/sunplug/CMakeLists.txt b/contrib/sunplug/CMakeLists.txt index 97735735..3a2b36f0 100644 --- a/contrib/sunplug/CMakeLists.txt +++ b/contrib/sunplug/CMakeLists.txt @@ -1,6 +1,6 @@ radiant_plugin(sunplug - sunplug.cpp - sunplug.h -) + sunplug.cpp sunplug.h + ) -target_link_libraries(sunplug ${GTK2_LIBRARIES}) +find_package(GTK2 REQUIRED) +target_include_directories(sunplug PRIVATE ${GTK2_INCLUDE_DIRS}) diff --git a/contrib/ufoaiplug/CMakeLists.txt b/contrib/ufoaiplug/CMakeLists.txt index f8a1569e..a72db29e 100644 --- a/contrib/ufoaiplug/CMakeLists.txt +++ b/contrib/ufoaiplug/CMakeLists.txt @@ -1,13 +1,9 @@ - radiant_plugin(ufoaiplug - ufoai.cpp - ufoai.h - ufoai_filters.cpp - ufoai_filters.h - ufoai_gtk.cpp - ufoai_gtk.h - ufoai_level.cpp - ufoai_level.h -) + ufoai.cpp ufoai.h + ufoai_filters.cpp ufoai_filters.h + ufoai_gtk.cpp ufoai_gtk.h + ufoai_level.cpp ufoai_level.h + ) -target_link_libraries(ufoaiplug ${GTK2_LIBRARIES}) +find_package(GTK2 REQUIRED) +target_include_directories(ufoaiplug PRIVATE ${GTK2_INCLUDE_DIRS}) diff --git a/cross-Makefile.conf b/cross-Makefile.conf deleted file mode 100644 index caba2e6f..00000000 --- a/cross-Makefile.conf +++ /dev/null @@ -1,10 +0,0 @@ -# Usage: -# copy this file to Makefile.conf -# edit the paths in here - -# how to call the mingw tools -MINGW_EXEC_PREFIX = i486-mingw32- - -# use mingw32 -include mingw-Makefile.inc -include mingw-radiantdeps-Makefile.inc diff --git a/generic_cpp.py b/generic_cpp.py deleted file mode 100644 index 62d51ed9..00000000 --- a/generic_cpp.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 2001-2006 William Joseph. -# For a list of contributors, see the accompanying CONTRIBUTORS file. -# -# This file is part of GtkRadiant. -# -# GtkRadiant is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GtkRadiant is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GtkRadiant; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -import os -import sys - -def svnAddText(filename): - os.system("svn add " + filename); - os.system("svn ps svn:eol-style native " + filename); - -def createCPPTemplate(filename, name): - file = open(filename, "wt") - file.write("\n") - file.write("#include \"" + name + ".h\"\n") - file.write("\n") - file.close() - -if __name__ == "__main__": - name = sys.argv[1] - location = sys.argv[2] - filename = os.path.join(location, name + ".cpp") - createCPPTemplate(filename, name) - svnAddText(filename) diff --git a/generic_h.py b/generic_h.py deleted file mode 100644 index 9f8b7e98..00000000 --- a/generic_h.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2001-2006 William Joseph. -# For a list of contributors, see the accompanying CONTRIBUTORS file. -# -# This file is part of GtkRadiant. -# -# GtkRadiant is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GtkRadiant is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GtkRadiant; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -import os -import sys - -def svnAddText(filename): - os.system("svn add " + filename); - os.system("svn ps svn:eol-style native " + filename); - -def createHeaderTemplate(filename, name): - file = open(filename, "wt") - file.write("\n") - file.write("#if !defined(_INCLUDED_" + name.upper() + "_H_)\n") - file.write("#define _INCLUDED_" + name.upper() + "_H_\n") - file.write("\n") - file.write("#endif\n") - -if __name__ == "__main__": - name = sys.argv[1] - location = sys.argv[2] - filename = os.path.join(location, name + ".h") - createHeaderTemplate(filename, name) - svnAddText(filename) diff --git a/generic_module.py b/generic_module.py deleted file mode 100644 index e055e8fa..00000000 --- a/generic_module.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2001-2006 William Joseph. -# For a list of contributors, see the accompanying CONTRIBUTORS file. -# -# This file is part of GtkRadiant. -# -# GtkRadiant is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GtkRadiant is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GtkRadiant; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -import os -import sys - -def svnAddText(filename): - os.system("svn add " + filename); - os.system("svn ps svn:eol-style native " + filename); - -def createHeaderTemplate(filename, name): - file = open(filename, "wt") - file.write("\n") - file.write("#if !defined(INCLUDED_" + name.upper() + "_H)\n") - file.write("#define INCLUDED_" + name.upper() + "_H\n") - file.write("\n") - file.write("#endif\n") - -def createCPPTemplate(filename, name): - file = open(filename, "wt") - file.write("\n") - file.write("#include \"" + name + ".h\"\n") - file.write("\n") - file.close() - -if __name__ == "__main__": - if not len(sys.argv) == 2: - print "usage: " + sys.argv[0] + " " - - path = sys.argv[1] - name = os.path.split(path)[1]; - - h = os.path.normpath(path + ".h") - print "writing " + h; - createHeaderTemplate(h, name) - svnAddText(h) - - cpp = os.path.normpath(path + ".cpp") - print "writing " + cpp; - createCPPTemplate(cpp, name) - svnAddText(cpp) - diff --git a/include/cullable.cpp b/include/cullable.cpp deleted file mode 100644 index 395d3e1c..00000000 --- a/include/cullable.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "cullable.h" diff --git a/include/editable.cpp b/include/editable.cpp deleted file mode 100644 index 63314dc1..00000000 --- a/include/editable.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "editable.h" diff --git a/include/iarchive.cpp b/include/iarchive.cpp deleted file mode 100644 index 1cf00055..00000000 --- a/include/iarchive.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "iarchive.h" diff --git a/include/ibrush.cpp b/include/ibrush.cpp deleted file mode 100644 index f075783b..00000000 --- a/include/ibrush.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ibrush.h" diff --git a/include/icamera.cpp b/include/icamera.cpp deleted file mode 100644 index bad7cacf..00000000 --- a/include/icamera.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "icamera.h" diff --git a/include/idatastream.cpp b/include/idatastream.cpp deleted file mode 100644 index e6ef881e..00000000 --- a/include/idatastream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "idatastream.h" diff --git a/include/ieclass.cpp b/include/ieclass.cpp deleted file mode 100644 index 5fd59c3a..00000000 --- a/include/ieclass.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ieclass.h" diff --git a/include/ientity.cpp b/include/ientity.cpp deleted file mode 100644 index 88dd59eb..00000000 --- a/include/ientity.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ientity.h" diff --git a/include/ifilesystem.cpp b/include/ifilesystem.cpp deleted file mode 100644 index 154f9065..00000000 --- a/include/ifilesystem.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ifilesystem.h" diff --git a/include/ifiletypes.cpp b/include/ifiletypes.cpp deleted file mode 100644 index b4e55668..00000000 --- a/include/ifiletypes.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ifiletypes.h" diff --git a/include/ifilter.cpp b/include/ifilter.cpp deleted file mode 100644 index a5e732f4..00000000 --- a/include/ifilter.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ifilter.h" diff --git a/include/igl.cpp b/include/igl.cpp deleted file mode 100644 index 41781a49..00000000 --- a/include/igl.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "igl.h" diff --git a/include/iglrender.cpp b/include/iglrender.cpp deleted file mode 100644 index 6a9d9a74..00000000 --- a/include/iglrender.cpp +++ /dev/null @@ -1,2 +0,0 @@ - -#include "iglrender.h" diff --git a/include/igtkgl.cpp b/include/igtkgl.cpp deleted file mode 100644 index d0084a85..00000000 --- a/include/igtkgl.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "igtkgl.h" diff --git a/include/iimage.cpp b/include/iimage.cpp deleted file mode 100644 index f438be78..00000000 --- a/include/iimage.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "iimage.h" diff --git a/include/imap.cpp b/include/imap.cpp deleted file mode 100644 index a91f14da..00000000 --- a/include/imap.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "imap.h" diff --git a/include/imodel.cpp b/include/imodel.cpp deleted file mode 100644 index 0b932e25..00000000 --- a/include/imodel.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "imodel.h" diff --git a/include/ipatch.cpp b/include/ipatch.cpp deleted file mode 100644 index e29029c3..00000000 --- a/include/ipatch.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ipatch.h" diff --git a/include/iplugin.cpp b/include/iplugin.cpp deleted file mode 100644 index 2a7dab9b..00000000 --- a/include/iplugin.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "iplugin.h" diff --git a/include/ireference.cpp b/include/ireference.cpp deleted file mode 100644 index d2f56c49..00000000 --- a/include/ireference.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ireference.h" diff --git a/include/irender.cpp b/include/irender.cpp deleted file mode 100644 index 9726b6d8..00000000 --- a/include/irender.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "irender.h" diff --git a/include/iscenegraph.cpp b/include/iscenegraph.cpp deleted file mode 100644 index 48cbcf23..00000000 --- a/include/iscenegraph.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "iscenegraph.h" diff --git a/include/iscriplib.cpp b/include/iscriplib.cpp deleted file mode 100644 index 3c4ba180..00000000 --- a/include/iscriplib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "iscriplib.h" diff --git a/include/iselection.cpp b/include/iselection.cpp deleted file mode 100644 index c0686cf2..00000000 --- a/include/iselection.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "iselection.h" diff --git a/include/ishaders.cpp b/include/ishaders.cpp deleted file mode 100644 index 4a7affdd..00000000 --- a/include/ishaders.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ishaders.h" diff --git a/include/itexdef.cpp b/include/itexdef.cpp deleted file mode 100644 index 462a7a2f..00000000 --- a/include/itexdef.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "itexdef.h" diff --git a/include/itextstream.cpp b/include/itextstream.cpp deleted file mode 100644 index 3ce3df75..00000000 --- a/include/itextstream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "itextstream.h" diff --git a/include/itextures.cpp b/include/itextures.cpp deleted file mode 100644 index ae75c635..00000000 --- a/include/itextures.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "itextures.h" diff --git a/include/itoolbar.cpp b/include/itoolbar.cpp deleted file mode 100644 index 146f7551..00000000 --- a/include/itoolbar.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "itoolbar.h" diff --git a/include/iundo.cpp b/include/iundo.cpp deleted file mode 100644 index 8dfd9e2d..00000000 --- a/include/iundo.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "iundo.h" diff --git a/include/mapfile.cpp b/include/mapfile.cpp deleted file mode 100644 index 5a6332ee..00000000 --- a/include/mapfile.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "mapfile.h" diff --git a/include/modelskin.cpp b/include/modelskin.cpp deleted file mode 100644 index fcdda390..00000000 --- a/include/modelskin.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "modelskin.h" diff --git a/include/moduleobserver.cpp b/include/moduleobserver.cpp deleted file mode 100644 index f9d40b12..00000000 --- a/include/moduleobserver.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "moduleobserver.h" diff --git a/include/modulesystem.cpp b/include/modulesystem.cpp deleted file mode 100644 index 907e8f7c..00000000 --- a/include/modulesystem.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "modulesystem.h" diff --git a/include/modulesystem.h b/include/modulesystem.h index 8b1913fb..37899392 100644 --- a/include/modulesystem.h +++ b/include/modulesystem.h @@ -173,10 +173,12 @@ bool initialised() const { } void initialise( const char* name ){ - m_module = globalModuleServer().findModule( typename Type::Name(), typename Type::Version(), name ); - if ( m_module == 0 ) { + const char *type = typename Type::Name(); + int version = typename Type::Version(); + m_module = globalModuleServer().findModule( type, version, name ); + if ( !m_module ) { globalModuleServer().setError( true ); - globalErrorStream() << "SingletonModuleRef::initialise: type=" << makeQuoted( typename Type::Name() ) << " version=" << makeQuoted( typename Type::Version() ) << " name=" << makeQuoted( name ) << " - not found\n"; + globalErrorStream() << "SingletonModuleRef::initialise: type=" << makeQuoted( type ) << " version=" << makeQuoted( version ) << " name=" << makeQuoted( name ) << " - not found\n"; } } diff --git a/include/nameable.cpp b/include/nameable.cpp deleted file mode 100644 index 8722c471..00000000 --- a/include/nameable.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "nameable.h" diff --git a/include/namespace.cpp b/include/namespace.cpp deleted file mode 100644 index f9b22f5b..00000000 --- a/include/namespace.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "namespace.h" diff --git a/include/qerplugin.cpp b/include/qerplugin.cpp deleted file mode 100644 index 54760013..00000000 --- a/include/qerplugin.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "qerplugin.h" diff --git a/include/renderable.cpp b/include/renderable.cpp deleted file mode 100644 index dfc186fd..00000000 --- a/include/renderable.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "renderable.h" diff --git a/include/selectable.cpp b/include/selectable.cpp deleted file mode 100644 index 38a2d1ab..00000000 --- a/include/selectable.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "selectable.h" diff --git a/include/windowobserver.cpp b/include/windowobserver.cpp deleted file mode 100644 index 16b4a006..00000000 --- a/include/windowobserver.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "windowobserver.h" diff --git a/install-dlls-fedora.sh b/install-dlls-fedora.sh deleted file mode 100755 index 5f882294..00000000 --- a/install-dlls-fedora.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -set -x - -DLL_PATH=/usr/i686-w64-mingw32/sys-root/mingw/bin - -cd install - -STARTDIR=`pwd` - -COPYDEPS() -{ - FILE=$1 - if [ -e "$FILE" ] ;then - DEPS=`objdump -p "$FILE" 2>/dev/null |grep -i "DLL Name"|sort |uniq|cut -d\ -f3 |egrep -vi '(GDI32.dll|KERNEL32.dll|USER32.dll|msvcrt.dll|MSIMG32.DLL|ole32.dll|OPENGL32.DLL|SHELL32.DLL|WS2_32.dll)' || true` - - for DEP in $DEPS; do - basename -a "$STARTDIR"/*.dll | grep -v "*.dll"|sort > "$STARTDIR"/.HAVES - if ! cat "$STARTDIR"/.HAVES | grep "$DEP" >/dev/null ;then - cp -v "$DLL_PATH"/"$DEP" "$STARTDIR" 2>/dev/null - COPYDEPS "$DLL_PATH"/"$DEP" - fi - rm -f "$STARTDIR"/.HAVES - done - fi -} - -for i in *.exe;do - COPYDEPS "$i"; -done - diff --git a/install-dlls.sh b/install-dlls.sh deleted file mode 100755 index 60ca8db4..00000000 --- a/install-dlls.sh +++ /dev/null @@ -1,196 +0,0 @@ -#!/bin/sh - -set -ex - -: ${WHICHDLL:=which} -: ${GTKDIR:=/gtk} -: ${CP:=cp} -: ${CAT:=cat} -: ${MKDIR:=mkdir -p} -: ${INSTALLDIR:=.} - -for DLL in \ - freetype6.dll \ - intl.dll \ - libatk-1.0-0.dll \ - libcairo-2.dll \ - libexpat-1.dll \ - libfontconfig-1.dll \ - libgdkglext-win32-1.0-0.dll \ - libgdk_pixbuf-2.0-0.dll \ - libgdk-win32-2.0-0.dll \ - libgio-2.0-0.dll \ - libglib-2.0-0.dll \ - libgmodule-2.0-0.dll \ - libgobject-2.0-0.dll \ - libgthread-2.0-0.dll \ - libgtkglext-win32-1.0-0.dll \ - libgtk-win32-2.0-0.dll \ - libjpeg-8.dll \ - libpango-1.0-0.dll \ - libpangocairo-1.0-0.dll \ - libpangoft2-1.0-0.dll \ - libpangowin32-1.0-0.dll \ - libpng14-14.dll \ - libxml2-2.dll \ - zlib1.dll \ - libgcc_s_sjlj-1.dll \ - libstdc++-6.dll \ -; do - $CP "`$WHICHDLL $DLL`" $INSTALLDIR/ -done - -$MKDIR $INSTALLDIR/etc/fonts -$CAT > $INSTALLDIR/etc/fonts/fonts.conf < - - - - - - - - - WINDOWSFONTDIR - - ~/.fonts - - - - - mono - - - monospace - - - - - - - sans serif - - - sans-serif - - - - - - - sans - - - sans-serif - - - - - conf.d - - - - WINDOWSTEMPDIR_FONTCONFIG_CACHE - ~/.fontconfig - - - - - 0x0020 - 0x00A0 - 0x00AD - 0x034F - 0x0600 - 0x0601 - 0x0602 - 0x0603 - 0x06DD - 0x070F - 0x115F - 0x1160 - 0x1680 - 0x17B4 - 0x17B5 - 0x180E - 0x2000 - 0x2001 - 0x2002 - 0x2003 - 0x2004 - 0x2005 - 0x2006 - 0x2007 - 0x2008 - 0x2009 - 0x200A - 0x200B - 0x200C - 0x200D - 0x200E - 0x200F - 0x2028 - 0x2029 - 0x202A - 0x202B - 0x202C - 0x202D - 0x202E - 0x202F - 0x205F - 0x2060 - 0x2061 - 0x2062 - 0x2063 - 0x206A - 0x206B - 0x206C - 0x206D - 0x206E - 0x206F - 0x2800 - 0x3000 - 0x3164 - 0xFEFF - 0xFFA0 - 0xFFF9 - 0xFFFA - 0xFFFB - - - - 30 - - - - -EOF diff --git a/install-dylibs.sh b/install-dylibs.sh deleted file mode 100755 index 6b9e5303..00000000 --- a/install-dylibs.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -set -ex - -: ${OTOOL:=otool} -: ${CP:=cp} -: ${INSTALLDIR:=.} -: ${EXE:=ppc} -: ${MACLIBDIR:=/sw/lib} -: ${CAT:=cat} - - -finkgetdeps() -{ - otool -L "$1" | grep "$MACLIBDIR" | while read -r LIB STUFF; do - [ -z "${LIB##*:}" ] && continue # first line - [ -f "$INSTALLDIR/${LIB##*/}" ] && continue - cp -vL "$LIB" "$INSTALLDIR" - finkgetdeps "$LIB" - done -} - - -finkgetdeps "$INSTALLDIR/radiant.$EXE" -echo Warning: this only works if only ONE version of gtk-2.0 and pango is installed - -getlib() -{ - LAST= - for LIB in "$@"; do - [ -f "$LIB" ] || continue - LAST=$LIB - done - cp -L "$LAST" "$INSTALLDIR" - finkgetdeps "$LAST" -} - -getlib "$MACLIBDIR"/gtk-2.0/*/loaders/libpixbufloader-bmp.so "$MACLIBDIR"/gdk-pixbuf-2.0/*/loaders/libpixbufloader-bmp.so -getlib "$MACLIBDIR"/pango/*/modules/pango-basic-fc.so -getlib "$MACLIBDIR"/pango/*/modules/pango-basic-x.so - -#cp -L "$MACLIBDIR"/../etc/fonts/fonts.conf "$INSTALLDIR" -#cp -L "$MACLIBDIR"/../etc/fonts/fonts.dtd "$INSTALLDIR" -#cp -L "$MACLIBDIR"/../etc/gtk-2.0/gdk-pixbuf.loaders "$INSTALLDIR" -#cp -L "$MACLIBDIR"/../etc/pango/pangorc "$INSTALLDIR" - -$CAT > "$INSTALLDIR/../netradiant.sh" < - - -// TTimo started adding portability code: -// return true if spawning was successful, false otherwise -// on win32 we have a bCreateConsole flag to create a new console or run inside the current one -//boolean Q_Exec(const char* pCmd, boolean bCreateConsole); -// execute a system command: -// cmd: the command to run -// cmdline: the command line -// NOTE TTimo following are win32 specific: -// execdir: the directory to execute in -// bCreateConsole: spawn a new console or not -// return values; -// if the spawn was fine -// TODO TTimo add functionality to track the process until it dies - -bool Q_Exec( const char *cmd, char *cmdline, const char *execdir, bool bCreateConsole, bool waitfor ); - -// some easy portability crap - - -#define access_owner_read 0400 -#define access_owner_write 0200 -#define access_owner_execute 0100 -#define access_owner_rw_ 0600 -#define access_owner_r_x 0500 -#define access_owner__wx 0300 -#define access_owner_rwx 0700 - -#define access_group_read 0040 -#define access_group_write 0020 -#define access_group_execute 0010 -#define access_group_rw_ 0060 -#define access_group_r_x 0050 -#define access_group__wx 0030 -#define access_group_rwx 0070 - -#define access_others_read 0004 -#define access_others_write 0002 -#define access_others_execute 0001 -#define access_others_rw_ 0006 -#define access_others_r_x 0005 -#define access_others__wx 0003 -#define access_others_rwx 0007 - - -#define access_rwxrwxr_x ( access_owner_rwx | access_group_rwx | access_others_r_x ) -#define access_rwxrwxrwx ( access_owner_rwx | access_group_rwx | access_others_rwx ) - -// Q_mkdir -// returns true if succeeded in creating directory -#ifdef WIN32 -#include -inline bool Q_mkdir( const char* name ){ - return _mkdir( name ) != -1; -} -#else -#include -inline bool Q_mkdir( const char* name ){ - return mkdir( name, access_rwxrwxr_x ) != -1; -} -#endif - - -inline double Sys_DoubleTime( void ){ - return clock() / 1000.0; -} - - - -#endif diff --git a/libs/cmdlib/.cvswrappers b/libs/cmdlib/.cvswrappers deleted file mode 100644 index ed97d402..00000000 --- a/libs/cmdlib/.cvswrappers +++ /dev/null @@ -1,3 +0,0 @@ -*.dsp -m 'COPY' -k 'b' -*.dsw -m 'COPY' -k 'b' -*.scc -m 'COPY' -k 'b' diff --git a/libs/cmdlib/CMakeLists.txt b/libs/cmdlib/CMakeLists.txt index 4c2be642..e84dc6b2 100644 --- a/libs/cmdlib/CMakeLists.txt +++ b/libs/cmdlib/CMakeLists.txt @@ -1,3 +1,3 @@ add_library(cmdlib - cmdlib.cpp -) + cmdlib.cpp cmdlib.h + ) diff --git a/libs/cmdlib/cmdlib.cpp b/libs/cmdlib/cmdlib.cpp index 6a40ed9d..69507ecc 100644 --- a/libs/cmdlib/cmdlib.cpp +++ b/libs/cmdlib/cmdlib.cpp @@ -23,7 +23,7 @@ // start of shared cmdlib stuff // -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include #include diff --git a/libs/cmdlib/cmdlib.h b/libs/cmdlib/cmdlib.h new file mode 100644 index 00000000..843dee76 --- /dev/null +++ b/libs/cmdlib/cmdlib.h @@ -0,0 +1,100 @@ +/* + Copyright (C) 1999-2006 Id Software, Inc. and contributors. + For a list of contributors, see the accompanying CONTRIBUTORS file. + + This file is part of GtkRadiant. + + GtkRadiant is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + GtkRadiant is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GtkRadiant; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +// +// start of shared cmdlib stuff +// + +#ifndef __CMDLIB__ +#define __CMDLIB__ + +#include + + +// TTimo started adding portability code: +// return true if spawning was successful, false otherwise +// on win32 we have a bCreateConsole flag to create a new console or run inside the current one +//boolean Q_Exec(const char* pCmd, boolean bCreateConsole); +// execute a system command: +// cmd: the command to run +// cmdline: the command line +// NOTE TTimo following are win32 specific: +// execdir: the directory to execute in +// bCreateConsole: spawn a new console or not +// return values; +// if the spawn was fine +// TODO TTimo add functionality to track the process until it dies + +bool Q_Exec( const char *cmd, char *cmdline, const char *execdir, bool bCreateConsole, bool waitfor ); + +// some easy portability crap + + +#define access_owner_read 0400 +#define access_owner_write 0200 +#define access_owner_execute 0100 +#define access_owner_rw_ 0600 +#define access_owner_r_x 0500 +#define access_owner__wx 0300 +#define access_owner_rwx 0700 + +#define access_group_read 0040 +#define access_group_write 0020 +#define access_group_execute 0010 +#define access_group_rw_ 0060 +#define access_group_r_x 0050 +#define access_group__wx 0030 +#define access_group_rwx 0070 + +#define access_others_read 0004 +#define access_others_write 0002 +#define access_others_execute 0001 +#define access_others_rw_ 0006 +#define access_others_r_x 0005 +#define access_others__wx 0003 +#define access_others_rwx 0007 + + +#define access_rwxrwxr_x ( access_owner_rwx | access_group_rwx | access_others_r_x ) +#define access_rwxrwxrwx ( access_owner_rwx | access_group_rwx | access_others_rwx ) + +// Q_mkdir +// returns true if succeeded in creating directory +#ifdef WIN32 +#include +inline bool Q_mkdir( const char* name ){ + return _mkdir( name ) != -1; +} +#else +#include +inline bool Q_mkdir( const char* name ){ + return mkdir( name, access_rwxrwxr_x ) != -1; +} +#endif + + +inline double Sys_DoubleTime( void ){ + return clock() / 1000.0; +} + + + +#endif diff --git a/libs/container/CMakeLists.txt b/libs/container/CMakeLists.txt index 2e1984c2..00bfbb4a 100644 --- a/libs/container/CMakeLists.txt +++ b/libs/container/CMakeLists.txt @@ -1,14 +1,8 @@ add_library(container - array.cpp - array.h - cache.cpp - cache.h - container.cpp - container.h - hashfunc.cpp - hashfunc.h - hashtable.cpp - hashtable.h - stack.cpp - stack.h -) + array.cpp array.h + cache.h + container.h + hashfunc.h + hashtable.cpp hashtable.h + stack.h + ) diff --git a/libs/container/cache.cpp b/libs/container/cache.cpp deleted file mode 100644 index 5cbdb00b..00000000 --- a/libs/container/cache.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "cache.h" diff --git a/libs/container/container.cpp b/libs/container/container.cpp deleted file mode 100644 index 8790307e..00000000 --- a/libs/container/container.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "container.h" diff --git a/libs/container/hashfunc.cpp b/libs/container/hashfunc.cpp deleted file mode 100644 index 4c3d2e07..00000000 --- a/libs/container/hashfunc.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "hashfunc.h" diff --git a/libs/container/stack.cpp b/libs/container/stack.cpp deleted file mode 100644 index 81d79b27..00000000 --- a/libs/container/stack.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "stack.h" diff --git a/libs/convert.cpp b/libs/convert.cpp deleted file mode 100644 index c87038f5..00000000 --- a/libs/convert.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "convert.h" diff --git a/libs/ddslib.h b/libs/ddslib.h deleted file mode 100644 index 4961f6ef..00000000 --- a/libs/ddslib.h +++ /dev/null @@ -1,250 +0,0 @@ -/* ----------------------------------------------------------------------------- - - DDS Library - - Based on code from Nvidia's DDS example: - http://www.nvidia.com/object/dxtc_decompression_code.html - - Copyright (c) 2003 Randy Reddig - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this list - of conditions and the following disclaimer. - - 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. - - Neither the names of the copyright holders nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 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. - - ----------------------------------------------------------------------------- */ - - - -/* marker */ -#ifndef DDSLIB_H -#define DDSLIB_H - - - -/* dependencies */ -#include -#include - - - -/* c++ marker */ -#ifdef __cplusplus -extern "C" -{ -#endif - - - -/* dds definition */ -typedef enum -{ - DDS_PF_ARGB8888, - DDS_PF_DXT1, - DDS_PF_DXT2, - DDS_PF_DXT3, - DDS_PF_DXT4, - DDS_PF_DXT5, - DDS_PF_UNKNOWN -} -ddsPF_t; - - -/* 16bpp stuff */ -#define DDS_LOW_5 0x001F; -#define DDS_MID_6 0x07E0; -#define DDS_HIGH_5 0xF800; -#define DDS_MID_555 0x03E0; -#define DDS_HI_555 0x7C00; - - -/* structures */ -typedef struct ddsColorKey_s -{ - unsigned int colorSpaceLowValue; - unsigned int colorSpaceHighValue; -} -ddsColorKey_t; - - -typedef struct ddsCaps_s -{ - unsigned int caps1; - unsigned int caps2; - unsigned int caps3; - unsigned int caps4; -} -ddsCaps_t; - - -typedef struct ddsMultiSampleCaps_s -{ - unsigned short flipMSTypes; - unsigned short bltMSTypes; -} -ddsMultiSampleCaps_t; - - -typedef struct ddsPixelFormat_s -{ - unsigned int size; - unsigned int flags; - unsigned int fourCC; - union - { - unsigned int rgbBitCount; - unsigned int yuvBitCount; - unsigned int zBufferBitDepth; - unsigned int alphaBitDepth; - unsigned int luminanceBitCount; - unsigned int bumpBitCount; - unsigned int privateFormatBitCount; - }; - union - { - unsigned int rBitMask; - unsigned int yBitMask; - unsigned int stencilBitDepth; - unsigned int luminanceBitMask; - unsigned int bumpDuBitMask; - unsigned int operations; - }; - union - { - unsigned int gBitMask; - unsigned int uBitMask; - unsigned int zBitMask; - unsigned int bumpDvBitMask; - ddsMultiSampleCaps_t multiSampleCaps; - }; - union - { - unsigned int bBitMask; - unsigned int vBitMask; - unsigned int stencilBitMask; - unsigned int bumpLuminanceBitMask; - }; - union - { - unsigned int rgbAlphaBitMask; - unsigned int yuvAlphaBitMask; - unsigned int luminanceAlphaBitMask; - unsigned int rgbZBitMask; - unsigned int yuvZBitMask; - }; -} -ddsPixelFormat_t; - - -typedef struct ddsBuffer_s -{ - /* magic: 'dds ' */ - char magic[ 4 ]; - - /* directdraw surface */ - unsigned int size; - unsigned int flags; - unsigned int height; - unsigned int width; - union - { - int pitch; - unsigned int linearSize; - }; - unsigned int backBufferCount; - union - { - unsigned int mipMapCount; - unsigned int refreshRate; - unsigned int srcVBHandle; - }; - unsigned int alphaBitDepth; - unsigned int reserved; - void *surface; - union - { - ddsColorKey_t ckDestOverlay; - unsigned int emptyFaceColor; - }; - ddsColorKey_t ckDestBlt; - ddsColorKey_t ckSrcOverlay; - ddsColorKey_t ckSrcBlt; - union - { - ddsPixelFormat_t pixelFormat; - unsigned int fvf; - }; - ddsCaps_t ddsCaps; - unsigned int textureStage; - - /* data (Varying size) */ - unsigned char data[ 4 ]; -} -ddsBuffer_t; - - -typedef struct ddsColorBlock_s -{ - unsigned short colors[ 2 ]; - unsigned char row[ 4 ]; -} -ddsColorBlock_t; - - -typedef struct ddsAlphaBlockExplicit_s -{ - unsigned short row[ 4 ]; -} -ddsAlphaBlockExplicit_t; - - -typedef struct ddsAlphaBlock3BitLinear_s -{ - unsigned char alpha0; - unsigned char alpha1; - unsigned char stuff[ 6 ]; -} -ddsAlphaBlock3BitLinear_t; - - -typedef struct ddsColor_s -{ - unsigned char r, g, b, a; -} -ddsColor_t; - - - -/* public functions */ -int DDSGetInfo( ddsBuffer_t *dds, int *width, int *height, ddsPF_t *pf ); -int DDSDecompress( ddsBuffer_t *dds, unsigned char *pixels ); - - - -/* end marker */ -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/ddslib/CMakeLists.txt b/libs/ddslib/CMakeLists.txt index e195c84b..7cb810f4 100644 --- a/libs/ddslib/CMakeLists.txt +++ b/libs/ddslib/CMakeLists.txt @@ -1,3 +1,3 @@ add_library(ddslib - ddslib.c -) + ddslib.c ddslib.h + ) diff --git a/libs/ddslib/ddslib.h b/libs/ddslib/ddslib.h new file mode 100644 index 00000000..4961f6ef --- /dev/null +++ b/libs/ddslib/ddslib.h @@ -0,0 +1,250 @@ +/* ----------------------------------------------------------------------------- + + DDS Library + + Based on code from Nvidia's DDS example: + http://www.nvidia.com/object/dxtc_decompression_code.html + + Copyright (c) 2003 Randy Reddig + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list + of conditions and the following disclaimer. + + 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. + + Neither the names of the copyright holders nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 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. + + ----------------------------------------------------------------------------- */ + + + +/* marker */ +#ifndef DDSLIB_H +#define DDSLIB_H + + + +/* dependencies */ +#include +#include + + + +/* c++ marker */ +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/* dds definition */ +typedef enum +{ + DDS_PF_ARGB8888, + DDS_PF_DXT1, + DDS_PF_DXT2, + DDS_PF_DXT3, + DDS_PF_DXT4, + DDS_PF_DXT5, + DDS_PF_UNKNOWN +} +ddsPF_t; + + +/* 16bpp stuff */ +#define DDS_LOW_5 0x001F; +#define DDS_MID_6 0x07E0; +#define DDS_HIGH_5 0xF800; +#define DDS_MID_555 0x03E0; +#define DDS_HI_555 0x7C00; + + +/* structures */ +typedef struct ddsColorKey_s +{ + unsigned int colorSpaceLowValue; + unsigned int colorSpaceHighValue; +} +ddsColorKey_t; + + +typedef struct ddsCaps_s +{ + unsigned int caps1; + unsigned int caps2; + unsigned int caps3; + unsigned int caps4; +} +ddsCaps_t; + + +typedef struct ddsMultiSampleCaps_s +{ + unsigned short flipMSTypes; + unsigned short bltMSTypes; +} +ddsMultiSampleCaps_t; + + +typedef struct ddsPixelFormat_s +{ + unsigned int size; + unsigned int flags; + unsigned int fourCC; + union + { + unsigned int rgbBitCount; + unsigned int yuvBitCount; + unsigned int zBufferBitDepth; + unsigned int alphaBitDepth; + unsigned int luminanceBitCount; + unsigned int bumpBitCount; + unsigned int privateFormatBitCount; + }; + union + { + unsigned int rBitMask; + unsigned int yBitMask; + unsigned int stencilBitDepth; + unsigned int luminanceBitMask; + unsigned int bumpDuBitMask; + unsigned int operations; + }; + union + { + unsigned int gBitMask; + unsigned int uBitMask; + unsigned int zBitMask; + unsigned int bumpDvBitMask; + ddsMultiSampleCaps_t multiSampleCaps; + }; + union + { + unsigned int bBitMask; + unsigned int vBitMask; + unsigned int stencilBitMask; + unsigned int bumpLuminanceBitMask; + }; + union + { + unsigned int rgbAlphaBitMask; + unsigned int yuvAlphaBitMask; + unsigned int luminanceAlphaBitMask; + unsigned int rgbZBitMask; + unsigned int yuvZBitMask; + }; +} +ddsPixelFormat_t; + + +typedef struct ddsBuffer_s +{ + /* magic: 'dds ' */ + char magic[ 4 ]; + + /* directdraw surface */ + unsigned int size; + unsigned int flags; + unsigned int height; + unsigned int width; + union + { + int pitch; + unsigned int linearSize; + }; + unsigned int backBufferCount; + union + { + unsigned int mipMapCount; + unsigned int refreshRate; + unsigned int srcVBHandle; + }; + unsigned int alphaBitDepth; + unsigned int reserved; + void *surface; + union + { + ddsColorKey_t ckDestOverlay; + unsigned int emptyFaceColor; + }; + ddsColorKey_t ckDestBlt; + ddsColorKey_t ckSrcOverlay; + ddsColorKey_t ckSrcBlt; + union + { + ddsPixelFormat_t pixelFormat; + unsigned int fvf; + }; + ddsCaps_t ddsCaps; + unsigned int textureStage; + + /* data (Varying size) */ + unsigned char data[ 4 ]; +} +ddsBuffer_t; + + +typedef struct ddsColorBlock_s +{ + unsigned short colors[ 2 ]; + unsigned char row[ 4 ]; +} +ddsColorBlock_t; + + +typedef struct ddsAlphaBlockExplicit_s +{ + unsigned short row[ 4 ]; +} +ddsAlphaBlockExplicit_t; + + +typedef struct ddsAlphaBlock3BitLinear_s +{ + unsigned char alpha0; + unsigned char alpha1; + unsigned char stuff[ 6 ]; +} +ddsAlphaBlock3BitLinear_t; + + +typedef struct ddsColor_s +{ + unsigned char r, g, b, a; +} +ddsColor_t; + + + +/* public functions */ +int DDSGetInfo( ddsBuffer_t *dds, int *width, int *height, ddsPF_t *pf ); +int DDSDecompress( ddsBuffer_t *dds, unsigned char *pixels ); + + + +/* end marker */ +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libs/debugging/CMakeLists.txt b/libs/debugging/CMakeLists.txt index f178adbb..e5880de3 100644 --- a/libs/debugging/CMakeLists.txt +++ b/libs/debugging/CMakeLists.txt @@ -1,4 +1,3 @@ add_library(debugging - debugging.cpp - debugging.h -) + debugging.cpp debugging.h + ) diff --git a/libs/dragplanes.cpp b/libs/dragplanes.cpp deleted file mode 100644 index 89da6662..00000000 --- a/libs/dragplanes.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "dragplanes.h" diff --git a/libs/eclasslib.cpp b/libs/eclasslib.cpp deleted file mode 100644 index 04d0d690..00000000 --- a/libs/eclasslib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "eclasslib.h" diff --git a/libs/entitylib.cpp b/libs/entitylib.cpp deleted file mode 100644 index 48f3138e..00000000 --- a/libs/entitylib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "entitylib.h" diff --git a/libs/entityxml.cpp b/libs/entityxml.cpp deleted file mode 100644 index 13b74088..00000000 --- a/libs/entityxml.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "entityxml.h" diff --git a/libs/etclib.c b/libs/etclib.c deleted file mode 100644 index 09a149e6..00000000 --- a/libs/etclib.c +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2009 Google Inc. -// -// Based on the code from Android ETC1Util. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "etclib.h" - -static void ETC_DecodeETC1SubBlock( byte *out, qboolean outRGBA, int r, int g, int b, int tableIndex, unsigned int low, qboolean second, qboolean flipped ){ - int baseX = 0, baseY = 0; - const int modifierTable[] = { - 2, 8, -2, -8, - 5, 17, -5, -17, - 9, 29, -9, -29, - 13, 42, -13, -42, - 18, 60, -18, -60, - 24, 80, -24, -80, - 33, 106, -33, -106, - 47, 183, -47, -183 - }; - const int *table = modifierTable + tableIndex * 4; - int i; - - if ( second ) { - if ( flipped ) { - baseY = 2; - } - else { - baseX = 2; - } - } - - for ( i = 0; i < 8; i++ ) - { - int x, y, k, delta; - int qr, qg, qb; - byte *q; - - if ( flipped ) { - x = baseX + ( i >> 1 ); - y = baseY + ( i & 1 ); - } - else { - x = baseX + ( i >> 2 ); - y = baseY + ( i & 3 ); - } - k = y + ( x * 4 ); - delta = table[( ( low >> k ) & 1 ) | ( ( low >> ( k + 15 ) ) & 2 )]; - - qr = r + delta; - qg = g + delta; - qb = b + delta; - if ( outRGBA ) { - q = out + 4 * ( x + 4 * y ); - } - else { - q = out + 3 * ( x + 4 * y ); - } - *( q++ ) = ( ( qr > 0 ) ? ( ( qr < 255 ) ? qr : 255 ) : 0 ); - *( q++ ) = ( ( qg > 0 ) ? ( ( qg < 255 ) ? qg : 255 ) : 0 ); - *( q++ ) = ( ( qb > 0 ) ? ( ( qb < 255 ) ? qb : 255 ) : 0 ); - if ( outRGBA ) { - *( q++ ) = 255; - } - } -} - -void ETC_DecodeETC1Block( const byte* in, byte* out, qboolean outRGBA ){ - unsigned int high = ( in[0] << 24 ) | ( in[1] << 16 ) | ( in[2] << 8 ) | in[3]; - unsigned int low = ( in[4] << 24 ) | ( in[5] << 16 ) | ( in[6] << 8 ) | in[7]; - int r1, r2, g1, g2, b1, b2; - qboolean flipped = ( ( high & 1 ) != 0 ); - - if ( high & 2 ) { - int rBase, gBase, bBase; - const int lookup[] = { 0, 1, 2, 3, -4, -3, -2, -1 }; - - rBase = ( high >> 27 ) & 31; - r1 = ( rBase << 3 ) | ( rBase >> 2 ); - rBase = ( rBase + ( lookup[( high >> 24 ) & 7] ) ) & 31; - r2 = ( rBase << 3 ) | ( rBase >> 2 ); - - gBase = ( high >> 19 ) & 31; - g1 = ( gBase << 3 ) | ( gBase >> 2 ); - gBase = ( gBase + ( lookup[( high >> 16 ) & 7] ) ) & 31; - g2 = ( gBase << 3 ) | ( gBase >> 2 ); - - bBase = ( high >> 11 ) & 31; - b1 = ( bBase << 3 ) | ( bBase >> 2 ); - bBase = ( bBase + ( lookup[( high >> 8 ) & 7] ) ) & 31; - b2 = ( bBase << 3 ) | ( bBase >> 2 ); - } - else { - r1 = ( ( high >> 24 ) & 0xf0 ) | ( ( high >> 28 ) & 0xf ); - r2 = ( ( high >> 20 ) & 0xf0 ) | ( ( high >> 24 ) & 0xf ); - g1 = ( ( high >> 16 ) & 0xf0 ) | ( ( high >> 20 ) & 0xf ); - g2 = ( ( high >> 12 ) & 0xf0 ) | ( ( high >> 16 ) & 0xf ); - b1 = ( ( high >> 8 ) & 0xf0 ) | ( ( high >> 12 ) & 0xf ); - b2 = ( ( high >> 4 ) & 0xf0 ) | ( ( high >> 8 ) & 0xf ); - } - - ETC_DecodeETC1SubBlock( out, outRGBA, r1, g1, b1, ( high >> 5 ) & 7, low, qfalse, flipped ); - ETC_DecodeETC1SubBlock( out, outRGBA, r2, g2, b2, ( high >> 2 ) & 7, low, qtrue, flipped ); -} diff --git a/libs/etclib.h b/libs/etclib.h deleted file mode 100644 index 7d240741..00000000 --- a/libs/etclib.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2009 Google Inc. -// -// Based on the code from Android ETC1Util. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef INCLUDED_ETCLIB_H -#define INCLUDED_ETCLIB_H - -#include "bytebool.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -void ETC_DecodeETC1Block( const byte* in, byte* out, qboolean outRGBA ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/etclib/CMakeLists.txt b/libs/etclib/CMakeLists.txt new file mode 100644 index 00000000..fb1f4fec --- /dev/null +++ b/libs/etclib/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(etclib + etclib.c etclib.h + ) diff --git a/libs/etclib/etclib.c b/libs/etclib/etclib.c new file mode 100644 index 00000000..09a149e6 --- /dev/null +++ b/libs/etclib/etclib.c @@ -0,0 +1,114 @@ +// Copyright 2009 Google Inc. +// +// Based on the code from Android ETC1Util. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "etclib.h" + +static void ETC_DecodeETC1SubBlock( byte *out, qboolean outRGBA, int r, int g, int b, int tableIndex, unsigned int low, qboolean second, qboolean flipped ){ + int baseX = 0, baseY = 0; + const int modifierTable[] = { + 2, 8, -2, -8, + 5, 17, -5, -17, + 9, 29, -9, -29, + 13, 42, -13, -42, + 18, 60, -18, -60, + 24, 80, -24, -80, + 33, 106, -33, -106, + 47, 183, -47, -183 + }; + const int *table = modifierTable + tableIndex * 4; + int i; + + if ( second ) { + if ( flipped ) { + baseY = 2; + } + else { + baseX = 2; + } + } + + for ( i = 0; i < 8; i++ ) + { + int x, y, k, delta; + int qr, qg, qb; + byte *q; + + if ( flipped ) { + x = baseX + ( i >> 1 ); + y = baseY + ( i & 1 ); + } + else { + x = baseX + ( i >> 2 ); + y = baseY + ( i & 3 ); + } + k = y + ( x * 4 ); + delta = table[( ( low >> k ) & 1 ) | ( ( low >> ( k + 15 ) ) & 2 )]; + + qr = r + delta; + qg = g + delta; + qb = b + delta; + if ( outRGBA ) { + q = out + 4 * ( x + 4 * y ); + } + else { + q = out + 3 * ( x + 4 * y ); + } + *( q++ ) = ( ( qr > 0 ) ? ( ( qr < 255 ) ? qr : 255 ) : 0 ); + *( q++ ) = ( ( qg > 0 ) ? ( ( qg < 255 ) ? qg : 255 ) : 0 ); + *( q++ ) = ( ( qb > 0 ) ? ( ( qb < 255 ) ? qb : 255 ) : 0 ); + if ( outRGBA ) { + *( q++ ) = 255; + } + } +} + +void ETC_DecodeETC1Block( const byte* in, byte* out, qboolean outRGBA ){ + unsigned int high = ( in[0] << 24 ) | ( in[1] << 16 ) | ( in[2] << 8 ) | in[3]; + unsigned int low = ( in[4] << 24 ) | ( in[5] << 16 ) | ( in[6] << 8 ) | in[7]; + int r1, r2, g1, g2, b1, b2; + qboolean flipped = ( ( high & 1 ) != 0 ); + + if ( high & 2 ) { + int rBase, gBase, bBase; + const int lookup[] = { 0, 1, 2, 3, -4, -3, -2, -1 }; + + rBase = ( high >> 27 ) & 31; + r1 = ( rBase << 3 ) | ( rBase >> 2 ); + rBase = ( rBase + ( lookup[( high >> 24 ) & 7] ) ) & 31; + r2 = ( rBase << 3 ) | ( rBase >> 2 ); + + gBase = ( high >> 19 ) & 31; + g1 = ( gBase << 3 ) | ( gBase >> 2 ); + gBase = ( gBase + ( lookup[( high >> 16 ) & 7] ) ) & 31; + g2 = ( gBase << 3 ) | ( gBase >> 2 ); + + bBase = ( high >> 11 ) & 31; + b1 = ( bBase << 3 ) | ( bBase >> 2 ); + bBase = ( bBase + ( lookup[( high >> 8 ) & 7] ) ) & 31; + b2 = ( bBase << 3 ) | ( bBase >> 2 ); + } + else { + r1 = ( ( high >> 24 ) & 0xf0 ) | ( ( high >> 28 ) & 0xf ); + r2 = ( ( high >> 20 ) & 0xf0 ) | ( ( high >> 24 ) & 0xf ); + g1 = ( ( high >> 16 ) & 0xf0 ) | ( ( high >> 20 ) & 0xf ); + g2 = ( ( high >> 12 ) & 0xf0 ) | ( ( high >> 16 ) & 0xf ); + b1 = ( ( high >> 8 ) & 0xf0 ) | ( ( high >> 12 ) & 0xf ); + b2 = ( ( high >> 4 ) & 0xf0 ) | ( ( high >> 8 ) & 0xf ); + } + + ETC_DecodeETC1SubBlock( out, outRGBA, r1, g1, b1, ( high >> 5 ) & 7, low, qfalse, flipped ); + ETC_DecodeETC1SubBlock( out, outRGBA, r2, g2, b2, ( high >> 2 ) & 7, low, qtrue, flipped ); +} diff --git a/libs/etclib/etclib.h b/libs/etclib/etclib.h new file mode 100644 index 00000000..7d240741 --- /dev/null +++ b/libs/etclib/etclib.h @@ -0,0 +1,33 @@ +// Copyright 2009 Google Inc. +// +// Based on the code from Android ETC1Util. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef INCLUDED_ETCLIB_H +#define INCLUDED_ETCLIB_H + +#include "bytebool.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +void ETC_DecodeETC1Block( const byte* in, byte* out, qboolean outRGBA ); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libs/filematch.c b/libs/filematch.c deleted file mode 100644 index 5b01db73..00000000 --- a/libs/filematch.c +++ /dev/null @@ -1,74 +0,0 @@ -#include -#include "filematch.h" - -// LordHavoc: some portable directory listing code I wrote for lmp2pcx, now used in darkplaces to load id1/*.pak and such... - -int matchpattern( const char *in, const char *pattern, int caseinsensitive ){ - return matchpattern_with_separator( in, pattern, caseinsensitive, "/\\:", 0 ); -} - -// wildcard_least_one: if true * matches 1 or more characters -// if false * matches 0 or more characters -int matchpattern_with_separator( const char *in, const char *pattern, int caseinsensitive, const char *separators, int wildcard_least_one ){ - int c1, c2; - while ( *pattern ) - { - switch ( *pattern ) - { - case 0: - return 1; // end of pattern - case '?': // match any single character - if ( *in == 0 || strchr( separators, *in ) ) { - return 0; // no match - } - in++; - pattern++; - break; - case '*': // match anything until following string - if ( wildcard_least_one ) { - if ( *in == 0 || strchr( separators, *in ) ) { - return 0; // no match - } - in++; - } - pattern++; - while ( *in ) - { - if ( strchr( separators, *in ) ) { - break; - } - // see if pattern matches at this offset - if ( matchpattern_with_separator( in, pattern, caseinsensitive, separators, wildcard_least_one ) ) { - return 1; - } - // nope, advance to next offset - in++; - } - break; - default: - if ( *in != *pattern ) { - if ( !caseinsensitive ) { - return 0; // no match - } - c1 = *in; - if ( c1 >= 'A' && c1 <= 'Z' ) { - c1 += 'a' - 'A'; - } - c2 = *pattern; - if ( c2 >= 'A' && c2 <= 'Z' ) { - c2 += 'a' - 'A'; - } - if ( c1 != c2 ) { - return 0; // no match - } - } - in++; - pattern++; - break; - } - } - if ( *in ) { - return 0; // reached end of pattern but not end of input - } - return 1; // success -} diff --git a/libs/filematch.h b/libs/filematch.h deleted file mode 100644 index cdb340a8..00000000 --- a/libs/filematch.h +++ /dev/null @@ -1,16 +0,0 @@ -#if !defined( INCLUDED_FILEMATCH_H ) -#define INCLUDED_FILEMATCH_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -int matchpattern( const char *in, const char *pattern, int caseinsensitive ); -int matchpattern_with_separator( const char *in, const char *pattern, int caseinsensitive, const char *separators, int wildcard_least_one ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/filematch/CMakeLists.txt b/libs/filematch/CMakeLists.txt new file mode 100644 index 00000000..76c73398 --- /dev/null +++ b/libs/filematch/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(filematch + filematch.c filematch.h + ) diff --git a/libs/filematch/filematch.c b/libs/filematch/filematch.c new file mode 100644 index 00000000..5b01db73 --- /dev/null +++ b/libs/filematch/filematch.c @@ -0,0 +1,74 @@ +#include +#include "filematch.h" + +// LordHavoc: some portable directory listing code I wrote for lmp2pcx, now used in darkplaces to load id1/*.pak and such... + +int matchpattern( const char *in, const char *pattern, int caseinsensitive ){ + return matchpattern_with_separator( in, pattern, caseinsensitive, "/\\:", 0 ); +} + +// wildcard_least_one: if true * matches 1 or more characters +// if false * matches 0 or more characters +int matchpattern_with_separator( const char *in, const char *pattern, int caseinsensitive, const char *separators, int wildcard_least_one ){ + int c1, c2; + while ( *pattern ) + { + switch ( *pattern ) + { + case 0: + return 1; // end of pattern + case '?': // match any single character + if ( *in == 0 || strchr( separators, *in ) ) { + return 0; // no match + } + in++; + pattern++; + break; + case '*': // match anything until following string + if ( wildcard_least_one ) { + if ( *in == 0 || strchr( separators, *in ) ) { + return 0; // no match + } + in++; + } + pattern++; + while ( *in ) + { + if ( strchr( separators, *in ) ) { + break; + } + // see if pattern matches at this offset + if ( matchpattern_with_separator( in, pattern, caseinsensitive, separators, wildcard_least_one ) ) { + return 1; + } + // nope, advance to next offset + in++; + } + break; + default: + if ( *in != *pattern ) { + if ( !caseinsensitive ) { + return 0; // no match + } + c1 = *in; + if ( c1 >= 'A' && c1 <= 'Z' ) { + c1 += 'a' - 'A'; + } + c2 = *pattern; + if ( c2 >= 'A' && c2 <= 'Z' ) { + c2 += 'a' - 'A'; + } + if ( c1 != c2 ) { + return 0; // no match + } + } + in++; + pattern++; + break; + } + } + if ( *in ) { + return 0; // reached end of pattern but not end of input + } + return 1; // success +} diff --git a/libs/filematch/filematch.h b/libs/filematch/filematch.h new file mode 100644 index 00000000..cdb340a8 --- /dev/null +++ b/libs/filematch/filematch.h @@ -0,0 +1,16 @@ +#if !defined( INCLUDED_FILEMATCH_H ) +#define INCLUDED_FILEMATCH_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +int matchpattern( const char *in, const char *pattern, int caseinsensitive ); +int matchpattern_with_separator( const char *in, const char *pattern, int caseinsensitive, const char *separators, int wildcard_least_one ); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libs/fs_filesystem.cpp b/libs/fs_filesystem.cpp deleted file mode 100644 index 9b781a3d..00000000 --- a/libs/fs_filesystem.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "fs_filesystem.h" diff --git a/libs/fs_path.cpp b/libs/fs_path.cpp deleted file mode 100644 index f38bf1c5..00000000 --- a/libs/fs_path.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "fs_path.h" diff --git a/libs/generic/CMakeLists.txt b/libs/generic/CMakeLists.txt index 2cae298f..b872d874 100644 --- a/libs/generic/CMakeLists.txt +++ b/libs/generic/CMakeLists.txt @@ -1,26 +1,14 @@ add_library(generic - arrayrange.cpp - arrayrange.h - bitfield.cpp - bitfield.h - callback.cpp - callback.h - callbackfwd.cpp - callbackfwd.h - constant.cpp - constant.h - enumeration.cpp - enumeration.h - functional.cpp - functional.h - object.cpp - object.h - reference.cpp - reference.h - referencecounted.cpp - referencecounted.h - static.cpp - static.h - vector.cpp - vector.h -) + arrayrange.h + bitfield.h + callback.cpp callback.h + callbackfwd.h + constant.cpp constant.h + enumeration.h + functional.h + object.cpp object.h + reference.h + referencecounted.h + static.cpp static.h + vector.h + ) diff --git a/libs/generic/arrayrange.cpp b/libs/generic/arrayrange.cpp deleted file mode 100644 index 0ee018b2..00000000 --- a/libs/generic/arrayrange.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "arrayrange.h" diff --git a/libs/generic/bitfield.cpp b/libs/generic/bitfield.cpp deleted file mode 100644 index 7e46a347..00000000 --- a/libs/generic/bitfield.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "bitfield.h" diff --git a/libs/generic/callbackfwd.cpp b/libs/generic/callbackfwd.cpp deleted file mode 100644 index af157742..00000000 --- a/libs/generic/callbackfwd.cpp +++ /dev/null @@ -1,2 +0,0 @@ - -#include "callbackfwd.h" diff --git a/libs/generic/enumeration.cpp b/libs/generic/enumeration.cpp deleted file mode 100644 index c6071cd4..00000000 --- a/libs/generic/enumeration.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "enumeration.h" diff --git a/libs/generic/functional.cpp b/libs/generic/functional.cpp deleted file mode 100644 index e6cc8572..00000000 --- a/libs/generic/functional.cpp +++ /dev/null @@ -1,2 +0,0 @@ - -#include "functional.h" diff --git a/libs/generic/reference.cpp b/libs/generic/reference.cpp deleted file mode 100644 index fd64f288..00000000 --- a/libs/generic/reference.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "reference.h" diff --git a/libs/generic/referencecounted.cpp b/libs/generic/referencecounted.cpp deleted file mode 100644 index 0c531bd7..00000000 --- a/libs/generic/referencecounted.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "referencecounted.h" diff --git a/libs/generic/vector.cpp b/libs/generic/vector.cpp deleted file mode 100644 index fbafd538..00000000 --- a/libs/generic/vector.cpp +++ /dev/null @@ -1,2 +0,0 @@ - -#include "vector.h" diff --git a/libs/gtkutil/CMakeLists.txt b/libs/gtkutil/CMakeLists.txt index 14cf6e04..4032653d 100644 --- a/libs/gtkutil/CMakeLists.txt +++ b/libs/gtkutil/CMakeLists.txt @@ -1,49 +1,31 @@ add_library(gtkutil - accelerator.cpp - accelerator.h - button.cpp - button.h - clipboard.cpp - clipboard.h - closure.cpp - closure.h - container.cpp - container.h - cursor.cpp - cursor.h - dialog.cpp - dialog.h - entry.cpp - entry.h - filechooser.cpp - filechooser.h - frame.cpp - frame.h - glfont.cpp - glfont.h - glwidget.cpp - glwidget.h - idledraw.cpp - idledraw.h - image.cpp - image.h - menu.cpp - menu.h - messagebox.cpp - messagebox.h - nonmodal.cpp - nonmodal.h - paned.cpp - paned.h - pointer.cpp - pointer.h - toolbar.cpp - toolbar.h - widget.cpp - widget.h - window.cpp - window.h - xorrectangle.cpp - xorrectangle.h -) -target_link_libraries(gtkutil ${GTK2_PANGOFT2_LIBRARY}) + accelerator.cpp accelerator.h + button.cpp button.h + clipboard.cpp clipboard.h + closure.h + container.h + cursor.cpp cursor.h + dialog.cpp dialog.h + entry.h + filechooser.cpp filechooser.h + frame.cpp frame.h + glfont.cpp glfont.h + glwidget.cpp glwidget.h + idledraw.h + image.cpp image.h + menu.cpp menu.h + messagebox.cpp messagebox.h + nonmodal.h + paned.cpp paned.h + pointer.h + toolbar.cpp toolbar.h + widget.h + window.cpp window.h + xorrectangle.h + ) + +find_package(GTK2 REQUIRED) +target_include_directories(gtkutil PRIVATE ${GTK2_INCLUDE_DIRS} ${GTK2_GDK_INCLUDE_DIR} ${GTK2_GLIB_INCLUDE_DIR}) + +find_package(GtkGLExt REQUIRED) +target_include_directories(gtkutil PRIVATE ${GTKGL_INCLUDE_DIRS}) diff --git a/libs/gtkutil/closure.cpp b/libs/gtkutil/closure.cpp deleted file mode 100644 index 09e2fab7..00000000 --- a/libs/gtkutil/closure.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "closure.h" diff --git a/libs/gtkutil/container.cpp b/libs/gtkutil/container.cpp deleted file mode 100644 index 8790307e..00000000 --- a/libs/gtkutil/container.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "container.h" diff --git a/libs/gtkutil/entry.cpp b/libs/gtkutil/entry.cpp deleted file mode 100644 index 2640da0f..00000000 --- a/libs/gtkutil/entry.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "entry.h" diff --git a/libs/gtkutil/idledraw.cpp b/libs/gtkutil/idledraw.cpp deleted file mode 100644 index b50d41f2..00000000 --- a/libs/gtkutil/idledraw.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "idledraw.h" diff --git a/libs/gtkutil/nonmodal.cpp b/libs/gtkutil/nonmodal.cpp deleted file mode 100644 index edca0b73..00000000 --- a/libs/gtkutil/nonmodal.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "nonmodal.h" diff --git a/libs/gtkutil/pointer.cpp b/libs/gtkutil/pointer.cpp deleted file mode 100644 index 503845a4..00000000 --- a/libs/gtkutil/pointer.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "pointer.h" diff --git a/libs/gtkutil/widget.cpp b/libs/gtkutil/widget.cpp deleted file mode 100644 index e212fdf6..00000000 --- a/libs/gtkutil/widget.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "widget.h" diff --git a/libs/gtkutil/xorrectangle.cpp b/libs/gtkutil/xorrectangle.cpp deleted file mode 100644 index e4f46c6b..00000000 --- a/libs/gtkutil/xorrectangle.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "xorrectangle.h" diff --git a/libs/imagelib.cpp b/libs/imagelib.cpp deleted file mode 100644 index 08e2d27e..00000000 --- a/libs/imagelib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "imagelib.h" diff --git a/libs/instancelib.cpp b/libs/instancelib.cpp deleted file mode 100644 index 52dfc8d4..00000000 --- a/libs/instancelib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "instancelib.h" diff --git a/libs/l_net/CMakeLists.txt b/libs/l_net/CMakeLists.txt index 2d8169e0..f71111a8 100644 --- a/libs/l_net/CMakeLists.txt +++ b/libs/l_net/CMakeLists.txt @@ -1,13 +1,14 @@ set(L_NETLIST - l_net.c - l_net.h -) -if(WIN32) - set(L_NETLIST ${L_NETLIST} l_net_wins.c l_net_wins.h) -else() - set(L_NETLIST ${L_NETLIST} l_net_berkley.c) -endif() + l_net.c l_net.h + ) +if (WIN32) + list(APPEND L_NETLIST l_net_wins.c l_net_wins.h) +else () + list(APPEND L_NETLIST l_net_berkley.c) +endif () + add_library(l_net ${L_NETLIST}) -if(WIN32) + +if (WIN32) target_link_libraries(l_net ws2_32) -endif() +endif () diff --git a/libs/maplib.cpp b/libs/maplib.cpp deleted file mode 100644 index 7487a68a..00000000 --- a/libs/maplib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "maplib.h" diff --git a/libs/math/CMakeLists.txt b/libs/math/CMakeLists.txt index 4fed0ef8..1520e48b 100644 --- a/libs/math/CMakeLists.txt +++ b/libs/math/CMakeLists.txt @@ -1,22 +1,13 @@ add_library(math - aabb.cpp - aabb.h - curve.cpp - curve.h - expression.cpp - expression.h - frustum.cpp - frustum.h - line.cpp - line.h - matrix.cpp - matrix.h - pi.cpp - pi.h - plane.cpp - plane.h - quaternion.cpp - quaternion.h - vector.cpp - vector.h -) + aabb.h + curve.h +# expression.cpp expression.h + frustum.h + line.h + matrix.h + pi.h + plane.h + quaternion.h + vector.h + ) +set_target_properties(math PROPERTIES LINKER_LANGUAGE CXX) diff --git a/libs/math/aabb.cpp b/libs/math/aabb.cpp deleted file mode 100644 index ad4ae00c..00000000 --- a/libs/math/aabb.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "aabb.h" diff --git a/libs/math/curve.cpp b/libs/math/curve.cpp deleted file mode 100644 index e38d2a11..00000000 --- a/libs/math/curve.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "curve.h" diff --git a/libs/math/frustum.cpp b/libs/math/frustum.cpp deleted file mode 100644 index b977549d..00000000 --- a/libs/math/frustum.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "frustum.h" diff --git a/libs/math/line.cpp b/libs/math/line.cpp deleted file mode 100644 index 0f4eb811..00000000 --- a/libs/math/line.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "line.h" diff --git a/libs/math/matrix.cpp b/libs/math/matrix.cpp deleted file mode 100644 index 6ed9a7e7..00000000 --- a/libs/math/matrix.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "matrix.h" diff --git a/libs/math/pi.cpp b/libs/math/pi.cpp deleted file mode 100644 index dd546531..00000000 --- a/libs/math/pi.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "pi.h" diff --git a/libs/math/plane.cpp b/libs/math/plane.cpp deleted file mode 100644 index 7b90b5ec..00000000 --- a/libs/math/plane.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "plane.h" diff --git a/libs/math/quaternion.cpp b/libs/math/quaternion.cpp deleted file mode 100644 index 5cef646e..00000000 --- a/libs/math/quaternion.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "quaternion.h" diff --git a/libs/math/vector.cpp b/libs/math/vector.cpp deleted file mode 100644 index 4893324e..00000000 --- a/libs/math/vector.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "vector.h" diff --git a/libs/mathlib.h b/libs/mathlib.h deleted file mode 100644 index 64f3f6e4..00000000 --- a/libs/mathlib.h +++ /dev/null @@ -1,483 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __MATHLIB__ -#define __MATHLIB__ - -// mathlib.h -#include -#include - -#ifdef __cplusplus - -// start declarations of functions defined in C library. -extern "C" -{ - -#endif - -#include "bytebool.h" - -typedef float vec_t; -typedef vec_t vec3_t[3]; -typedef vec_t vec5_t[5]; -typedef vec_t vec4_t[4]; - -// Smallest positive value for vec_t such that 1.0 + VEC_SMALLEST_EPSILON_AROUND_ONE != 1.0. -// In the case of 32 bit floats (which is almost certainly the case), it's 0.00000011921. -// Don't forget that your epsilons should depend on the possible range of values, -// because for example adding VEC_SMALLEST_EPSILON_AROUND_ONE to 1024.0 will have no effect. -#define VEC_SMALLEST_EPSILON_AROUND_ONE FLT_EPSILON - -#define SIDE_FRONT 0 -#define SIDE_ON 2 -#define SIDE_BACK 1 -#define SIDE_CROSS -2 - -// plane types are used to speed some tests -// 0-2 are axial planes -#define PLANE_X 0 -#define PLANE_Y 1 -#define PLANE_Z 2 -#define PLANE_NON_AXIAL 3 - -#define Q_PI 3.14159265358979323846f - -extern const vec3_t vec3_origin; - -extern const vec3_t g_vec3_axis_x; -extern const vec3_t g_vec3_axis_y; -extern const vec3_t g_vec3_axis_z; - -#define EQUAL_EPSILON 0.001 - -#define DotProduct( x,y ) ( ( x )[0] * ( y )[0] + ( x )[1] * ( y )[1] + ( x )[2] * ( y )[2] ) -#define VectorSubtract( a,b,c ) ( ( c )[0] = ( a )[0] - ( b )[0],( c )[1] = ( a )[1] - ( b )[1],( c )[2] = ( a )[2] - ( b )[2] ) -#define VectorAdd( a,b,c ) ( ( c )[0] = ( a )[0] + ( b )[0],( c )[1] = ( a )[1] + ( b )[1],( c )[2] = ( a )[2] + ( b )[2] ) -#define VectorIncrement( a,b ) ( ( b )[0] += ( a )[0],( b )[1] += ( a )[1],( b )[2] += ( a )[2] ) -#define VectorCopy( a,b ) ( ( b )[0] = ( a )[0],( b )[1] = ( a )[1],( b )[2] = ( a )[2] ) -#define VectorSet( v, a, b, c ) ( ( v )[0] = ( a ),( v )[1] = ( b ),( v )[2] = ( c ) ) -#define VectorScale( a,b,c ) ( ( c )[0] = ( b ) * ( a )[0],( c )[1] = ( b ) * ( a )[1],( c )[2] = ( b ) * ( a )[2] ) -#define VectorMid( a,b,c ) ( ( c )[0] = ( ( a )[0] + ( b )[0] ) * 0.5f,( c )[1] = ( ( a )[1] + ( b )[1] ) * 0.5f,( c )[2] = ( ( a )[2] + ( b )[2] ) * 0.5f ) -#define VectorNegate( a,b ) ( ( b )[0] = -( a )[0],( b )[1] = -( a )[1],( b )[2] = -( a )[2] ) -#define CrossProduct( a,b,c ) ( ( c )[0] = ( a )[1] * ( b )[2] - ( a )[2] * ( b )[1],( c )[1] = ( a )[2] * ( b )[0] - ( a )[0] * ( b )[2],( c )[2] = ( a )[0] * ( b )[1] - ( a )[1] * ( b )[0] ) -#define VectorClear( x ) ( ( x )[0] = ( x )[1] = ( x )[2] = 0 ) - -#define FLOAT_SNAP( f,snap ) ( (float)( floor( ( f ) / ( snap ) + 0.5 ) * ( snap ) ) ) -#define FLOAT_TO_INTEGER( f ) ( (float)( floor( ( f ) + 0.5 ) ) ) - -#define RGBTOGRAY( x ) ( (float)( ( x )[0] ) * 0.2989f + (float)( ( x )[1] ) * 0.5870f + (float)( ( x )[2] ) * 0.1140f ) - -#define Q_rint( in ) ( (vec_t)floor( in + 0.5 ) ) - -qboolean VectorCompare( const vec3_t v1, const vec3_t v2 ); - -qboolean VectorIsOnAxis( vec3_t v ); -qboolean VectorIsOnAxialPlane( vec3_t v ); - -vec_t VectorLength( const vec3_t v ); - -void VectorMA( const vec3_t va, vec_t scale, const vec3_t vb, vec3_t vc ); - -void _CrossProduct( vec3_t v1, vec3_t v2, vec3_t cross ); -// I need this define in order to test some of the regression tests from time to time. -// This define affect the precision of VectorNormalize() function only. -#define MATHLIB_VECTOR_NORMALIZE_PRECISION_FIX 1 -vec_t VectorNormalize( const vec3_t in, vec3_t out ); -vec_t ColorNormalize( const vec3_t in, vec3_t out ); -void VectorInverse( vec3_t v ); -void VectorPolar( vec3_t v, float radius, float theta, float phi ); - -// default snapping, to 1 -void VectorSnap( vec3_t v ); - -// integer snapping -void VectorISnap( vec3_t point, int snap ); - -// Gef: added snap to float for sub-integer grid sizes -// TTimo: we still use the int version of VectorSnap when possible -// to avoid potential rounding issues -// TTimo: renaming to VectorFSnap for C implementation -void VectorFSnap( vec3_t point, float snap ); - -// NOTE: added these from Ritual's Q3Radiant -void ClearBounds( vec3_t mins, vec3_t maxs ); -void AddPointToBounds( vec3_t v, vec3_t mins, vec3_t maxs ); - - -#define PITCH 0 // up / down -#define YAW 1 // left / right -#define ROLL 2 // fall over - -void AngleVectors( vec3_t angles, vec3_t forward, vec3_t right, vec3_t up ); -void VectorToAngles( vec3_t vec, vec3_t angles ); - -#define ZERO_EPSILON 1.0E-6 -#define RAD2DEGMULT 57.29577951308232f -#define DEG2RADMULT 0.01745329251994329f -#define RAD2DEG( a ) ( ( a ) * RAD2DEGMULT ) -#define DEG2RAD( a ) ( ( a ) * DEG2RADMULT ) - -void VectorRotate( vec3_t vIn, vec3_t vRotation, vec3_t out ); -void VectorRotateOrigin( vec3_t vIn, vec3_t vRotation, vec3_t vOrigin, vec3_t out ); - -// some function merged from tools mathlib code - -qboolean PlaneFromPoints( vec4_t plane, const vec3_t a, const vec3_t b, const vec3_t c ); -void NormalToLatLong( const vec3_t normal, byte bytes[2] ); -int PlaneTypeForNormal( vec3_t normal ); -void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees ); - - -/*! - \todo - FIXME test calls such as intersect tests should be named test_ - */ - -typedef vec_t m3x3_t[9]; -/*!NOTE - m4x4 looks like this.. - - x y z - x axis ( 0 1 2) - y axis ( 4 5 6) - z axis ( 8 9 10) - translation (12 13 14) - scale ( 0 5 10) - */ -typedef vec_t m4x4_t[16]; - -#define M4X4_INDEX( m,row,col ) ( m[( col << 2 ) + row] ) - -typedef enum { eXYZ, eYZX, eZXY, eXZY, eYXZ, eZYX } eulerOrder_t; - -#define CLIP_PASS 0x00 // 000000 -#define CLIP_LT_X 0x01 // 000001 -#define CLIP_GT_X 0x02 // 000010 -#define CLIP_LT_Y 0x04 // 000100 -#define CLIP_GT_Y 0x08 // 001000 -#define CLIP_LT_Z 0x10 // 010000 -#define CLIP_GT_Z 0x20 // 100000 -#define CLIP_FAIL 0x3F // 111111 -typedef unsigned char clipmask_t; - -extern const m4x4_t g_m4x4_identity; - -#define M4X4_COPY( dst,src ) ( \ - ( dst )[0] = ( src )[0], \ - ( dst )[1] = ( src )[1], \ - ( dst )[2] = ( src )[2], \ - ( dst )[3] = ( src )[3], \ - ( dst )[4] = ( src )[4], \ - ( dst )[5] = ( src )[5], \ - ( dst )[6] = ( src )[6], \ - ( dst )[7] = ( src )[7], \ - ( dst )[8] = ( src )[8], \ - ( dst )[9] = ( src )[9], \ - ( dst )[10] = ( src )[10], \ - ( dst )[11] = ( src )[11], \ - ( dst )[12] = ( src )[12], \ - ( dst )[13] = ( src )[13], \ - ( dst )[14] = ( src )[14], \ - ( dst )[15] = ( src )[15] ) - -typedef enum -{ - eRightHanded = 0, - eLeftHanded = 1, -} -m4x4Handedness_t; - -m4x4Handedness_t m4x4_handedness( const m4x4_t matrix ); - -/*! assign other m4x4 to this m4x4 */ -void m4x4_assign( m4x4_t matrix, const m4x4_t other ); - -// constructors -/*! create m4x4 as identity matrix */ -void m4x4_identity( m4x4_t matrix ); -/*! create m4x4 as a translation matrix, for a translation vec3 */ -void m4x4_translation_for_vec3( m4x4_t matrix, const vec3_t translation ); -/*! create m4x4 as a rotation matrix, for an euler angles (degrees) vec3 */ -void m4x4_rotation_for_vec3( m4x4_t matrix, const vec3_t euler, eulerOrder_t order ); -/*! create m4x4 as a scaling matrix, for a scale vec3 */ -void m4x4_scale_for_vec3( m4x4_t matrix, const vec3_t scale ); -/*! create m4x4 as a rotation matrix, for a quaternion vec4 */ -void m4x4_rotation_for_quat( m4x4_t matrix, const vec4_t rotation ); -/*! create m4x4 as a rotation matrix, for an axis vec3 and an angle (radians) */ -void m4x4_rotation_for_axisangle( m4x4_t matrix, const vec3_t axis, double angle ); -/*! generate a perspective matrix by specifying the view frustum */ -void m4x4_frustum( m4x4_t matrix, vec_t left, vec_t right, vec_t bottom, vec_t top, vec_t nearval, vec_t farval ); - -// a valid m4x4 to access is always first argument -/*! extract translation vec3 from matrix */ -void m4x4_get_translation_vec3( const m4x4_t matrix, vec3_t translation ); -/*! extract euler rotation angles from a rotation-only matrix */ -void m4x4_get_rotation_vec3( const m4x4_t matrix, vec3_t euler, eulerOrder_t order ); -/*! extract scale vec3 from matrix */ -void m4x4_get_scale_vec3( const m4x4_t matrix, vec3_t scale ); -/*! extract translation/euler/scale from an orthogonal matrix. NOTE: requires right-handed axis-base */ -void m4x4_get_transform_vec3( const m4x4_t matrix, vec3_t translation, vec3_t euler, eulerOrder_t order, vec3_t scale ); - -// a valid m4x4 to be modified is always first argument -/*! translate m4x4 by a translation vec3 */ -void m4x4_translate_by_vec3( m4x4_t matrix, const vec3_t translation ); -/*! rotate m4x4 by a euler (degrees) vec3 */ -void m4x4_rotate_by_vec3( m4x4_t matrix, const vec3_t euler, eulerOrder_t order ); -/*! scale m4x4 by a scaling vec3 */ -void m4x4_scale_by_vec3( m4x4_t matrix, const vec3_t scale ); -/*! rotate m4x4 by a quaternion vec4 */ -void m4x4_rotate_by_quat( m4x4_t matrix, const vec4_t rotation ); -/*! rotate m4x4 by an axis vec3 and an angle (radians) */ -void m4x4_rotate_by_axisangle( m4x4_t matrix, const vec3_t axis, double angle ); -/*! transform m4x4 by translation/eulerZYX/scaling vec3 (transform = scale * eulerZ * eulerY * eulerX * translation) */ -void m4x4_transform_by_vec3( m4x4_t matrix, const vec3_t translation, const vec3_t euler, eulerOrder_t order, const vec3_t scale ); -/*! rotate m4x4 around a pivot point by eulerZYX vec3 */ -void m4x4_pivoted_rotate_by_vec3( m4x4_t matrix, const vec3_t euler, eulerOrder_t order, const vec3_t pivotpoint ); -/*! scale m4x4 around a pivot point by scaling vec3 */ -void m4x4_pivoted_scale_by_vec3( m4x4_t matrix, const vec3_t scale, const vec3_t pivotpoint ); -/*! transform m4x4 around a pivot point by translation/eulerZYX/scaling vec3 */ -void m4x4_pivoted_transform_by_vec3( m4x4_t matrix, const vec3_t translation, const vec3_t euler, eulerOrder_t order, const vec3_t scale, const vec3_t pivotpoint ); -/*! transform m4x4 around a pivot point by translation/rotation/scaling vec3 */ -void m4x4_pivoted_transform_by_rotation( m4x4_t matrix, const vec3_t translation, const m4x4_t rotation, const vec3_t scale, const vec3_t pivotpoint ); -/*! rotate m4x4 around a pivot point by quaternion vec4 */ -void m4x4_pivoted_rotate_by_quat( m4x4_t matrix, const vec4_t quat, const vec3_t pivotpoint ); -/*! rotate m4x4 around a pivot point by axis vec3 and angle (radians) */ -void m4x4_pivoted_rotate_by_axisangle( m4x4_t matrix, const vec3_t axis, double angle, const vec3_t pivotpoint ); - -/*! postmultiply m4x4 by another m4x4 */ -void m4x4_multiply_by_m4x4( m4x4_t matrix, const m4x4_t matrix_src ); -/*! premultiply m4x4 by another m4x4 */ -void m4x4_premultiply_by_m4x4( m4x4_t matrix, const m4x4_t matrix_src ); -/*! postmultiply orthogonal m4x4 by another orthogonal m4x4 */ -void m4x4_orthogonal_multiply_by_m4x4( m4x4_t matrix, const m4x4_t matrix_src ); -/*! premultiply orthogonal m4x4 by another orthogonal m4x4 */ -void m4x4_orthogonal_premultiply_by_m4x4( m4x4_t matrix, const m4x4_t matrix_src ); - -/*! multiply a point (x,y,z,1) by matrix */ -void m4x4_transform_point( const m4x4_t matrix, vec3_t point ); -/*! multiply a normal (x,y,z,0) by matrix */ -void m4x4_transform_normal( const m4x4_t matrix, vec3_t normal ); -/*! multiply a vec4 (x,y,z,w) by matrix */ -void m4x4_transform_vec4( const m4x4_t matrix, vec4_t vector ); - -/*! multiply a point (x,y,z,1) by matrix */ -void m4x4_transform_point( const m4x4_t matrix, vec3_t point ); -/*! multiply a normal (x,y,z,0) by matrix */ -void m4x4_transform_normal( const m4x4_t matrix, vec3_t normal ); - -/*! transpose a m4x4 */ -void m4x4_transpose( m4x4_t matrix ); -/*! invert an orthogonal 4x3 subset of a 4x4 matrix */ -int m4x4_orthogonal_invert( m4x4_t matrix ); -/*! m4_det */ -float m4_det( m4x4_t mr ); -/*! invert any m4x4 using Kramer's rule.. return 1 if matrix is singular, else return 0 */ -int m4x4_invert( m4x4_t matrix ); - -/*! clip a point (x,y,z,1) by canonical matrix */ -clipmask_t m4x4_clip_point( const m4x4_t matrix, const vec3_t point, vec4_t clipped ); -/*! device-space polygon for clipped triangle */ -unsigned int m4x4_clip_triangle( const m4x4_t matrix, const vec3_t p0, const vec3_t p1, const vec3_t p2, vec4_t clipped[9] ); -/*! device-space line for clipped line */ -unsigned int m4x4_clip_line( const m4x4_t matrix, const vec3_t p0, const vec3_t p1, vec4_t clipped[2] ); - - -//! quaternion identity -void quat_identity( vec4_t quat ); -//! quaternion from two unit vectors -void quat_for_unit_vectors( vec4_t quat, const vec3_t from, const vec3_t to ); -//! quaternion from axis and angle (radians) -void quat_for_axisangle( vec4_t quat, const vec3_t axis, double angle ); -//! concatenates two rotations.. equivalent to m4x4_multiply_by_m4x4 .. postmultiply.. the right-hand side is the first rotation performed -void quat_multiply_by_quat( vec4_t quat, const vec4_t other ); -//! negate a quaternion -void quat_conjugate( vec4_t quat ); -//! normalise a quaternion -void quat_normalise( vec4_t quat ); - - - -/*! - \todo object/ray intersection functions should maybe return a point rather than a distance? - */ - -/*! - aabb_t - "axis-aligned" bounding box... - origin: centre of bounding box... - extents: +/- extents of box from origin... - */ -typedef struct aabb_s -{ - vec3_t origin; - vec3_t extents; -} aabb_t; - -extern const aabb_t g_aabb_null; - -/*! - bbox_t - oriented bounding box... - aabb: axis-aligned bounding box... - axes: orientation axes... - */ -typedef struct bbox_s -{ - aabb_t aabb; - vec3_t axes[3]; - vec_t radius; -} bbox_t; - -/*! - ray_t - origin point and direction unit-vector - */ -typedef struct ray_s -{ - vec3_t origin; - vec3_t direction; -} ray_t; - -/*! - line_t - centre point and displacement of end point from centre - */ -typedef struct line_s -{ - vec3_t origin; - vec3_t extents; -} line_t; - - -/*! Generate line from start/end points. */ -void line_construct_for_vec3( line_t* line, const vec3_t start, const vec3_t end ); -/*! Return 2 if line is behind plane, else return 1 if line intersects plane, else return 0. */ -int line_test_plane( const line_t* line, const vec4_t plane ); - -/*! Generate AABB from min/max. */ -void aabb_construct_for_vec3( aabb_t* aabb, const vec3_t min, const vec3_t max ); -/*! Initialise AABB to negative size. */ -void aabb_clear( aabb_t* aabb ); - -/*! Extend AABB to include point. */ -void aabb_extend_by_point( aabb_t* aabb, const vec3_t point ); -/*! Extend AABB to include aabb_src. */ -void aabb_extend_by_aabb( aabb_t* aabb, const aabb_t* aabb_src ); -/*! Extend AABB by +/- extension vector. */ -void aabb_extend_by_vec3( aabb_t* aabb, vec3_t extension ); - -/*! Return 2 if point is inside, else 1 if point is on surface, else 0. */ -int aabb_test_point( const aabb_t* aabb, const vec3_t point ); -/*! Return 2 if aabb_src intersects, else 1 if aabb_src touches exactly, else 0. */ -int aabb_test_aabb( const aabb_t* aabb, const aabb_t* aabb_src ); -/*! Return 2 if aabb is behind plane, else 1 if aabb intersects plane, else 0. */ -int aabb_test_plane( const aabb_t* aabb, const float* plane ); -/*! Return 1 if aabb intersects ray, else 0... dist = closest intersection. */ -int aabb_intersect_ray( const aabb_t* aabb, const ray_t* ray, vec3_t intersection ); -/*! Return 1 if aabb intersects ray, else 0. Faster, but does not provide point of intersection */ -int aabb_test_ray( const aabb_t* aabb, const ray_t* ray ); - -/*! Return 2 if oriented aabb is behind plane, else 1 if aabb intersects plane, else 0. */ -int aabb_oriented_intersect_plane( const aabb_t* aabb, const m4x4_t transform, const vec_t* plane ); - -/*! Calculate the corners of the aabb. */ -void aabb_corners( const aabb_t * aabb, vec3_t corners[8] ); - -/*! (deprecated) Generate AABB from oriented bounding box. */ -void aabb_for_bbox( aabb_t* aabb, const bbox_t* bbox ); -/*! (deprecated) Generate AABB from 2-dimensions of min/max, specified by axis. */ -void aabb_for_area( aabb_t* aabb, vec3_t area_tl, vec3_t area_br, int axis ); -/*! Generate AABB to contain src* transform. NOTE: transform must be orthogonal */ -void aabb_for_transformed_aabb( aabb_t* dst, const aabb_t* src, const m4x4_t transform ); - -/*! Update bounding-sphere radius. */ -void bbox_update_radius( bbox_t* bbox ); -/*! Generate oriented bounding box from AABB and transformation matrix. */ -/*!\todo Remove need to specify eulerZYX/scale. */ -void bbox_for_oriented_aabb( bbox_t* bbox, const aabb_t* aabb, - const m4x4_t matrix, const vec3_t eulerZYX, const vec3_t scale ); -/*! Return 2 if bbox is behind plane, else return 1 if bbox intersects plane, else return 0. */ -int bbox_intersect_plane( const bbox_t* bbox, const vec_t* plane ); - - -/*! Generate a ray from an origin point and a direction unit-vector */ -void ray_construct_for_vec3( ray_t* ray, const vec3_t origin, const vec3_t direction ); - -/*! Transform a ray */ -void ray_transform( ray_t* ray, const m4x4_t matrix ); - -/*! distance from ray origin in ray direction to point. FLT_MAX if no intersection. */ -vec_t ray_intersect_point( const ray_t* ray, const vec3_t point, vec_t epsilon, vec_t divergence ); -/*! distance from ray origin in ray direction to triangle. FLT_MAX if no intersection. */ -vec_t ray_intersect_triangle( const ray_t* ray, qboolean bCullBack, const vec3_t vert0, const vec3_t vert1, const vec3_t vert2 ); -/*! distance from ray origin in ray direction to plane. */ -vec_t ray_intersect_plane( const ray_t* ray, const vec3_t normal, vec_t dist ); - - -int plane_intersect_planes( const vec4_t plane1, const vec4_t plane2, const vec4_t plane3, vec3_t intersection ); - - - -//////////////////////////////////////////////////////////////////////////////// -// Below is double-precision math stuff. This was initially needed by the new -// "base winding" code in q3map2 brush processing in order to fix the famous -// "disappearing triangles" issue. These definitions can be used wherever extra -// precision is needed. -//////////////////////////////////////////////////////////////////////////////// - -typedef double vec_accu_t; -typedef vec_accu_t vec3_accu_t[3]; - -// Smallest positive value for vec_accu_t such that 1.0 + VEC_ACCU_SMALLEST_EPSILON_AROUND_ONE != 1.0. -// In the case of 64 bit doubles (which is almost certainly the case), it's 0.00000000000000022204. -// Don't forget that your epsilons should depend on the possible range of values, -// because for example adding VEC_ACCU_SMALLEST_EPSILON_AROUND_ONE to 1024.0 will have no effect. -#define VEC_ACCU_SMALLEST_EPSILON_AROUND_ONE DBL_EPSILON - -vec_accu_t VectorLengthAccu( const vec3_accu_t v ); - -// I have a feeling it may be safer to break these #define functions out into actual functions -// in order to avoid accidental loss of precision. For example, say you call -// VectorScaleAccu(vec3_t, vec_t, vec3_accu_t). The scale would take place in 32 bit land -// and the result would be cast to 64 bit, which would cause total loss of precision when -// scaling by a large factor. -//#define DotProductAccu(x, y) ((x)[0] * (y)[0] + (x)[1] * (y)[1] + (x)[2] * (y)[2]) -//#define VectorSubtractAccu(a, b, c) ((c)[0] = (a)[0] - (b)[0], (c)[1] = (a)[1] - (b)[1], (c)[2] = (a)[2] - (b)[2]) -//#define VectorAddAccu(a, b, c) ((c)[0] = (a)[0] + (b)[0], (c)[1] = (a)[1] + (b)[1], (c)[2] = (a)[2] + (b)[2]) -//#define VectorCopyAccu(a, b) ((b)[0] = (a)[0], (b)[1] = (a)[1], (b)[2] = (a)[2]) -//#define VectorScaleAccu(a, b, c) ((c)[0] = (b) * (a)[0], (c)[1] = (b) * (a)[1], (c)[2] = (b) * (a)[2]) -//#define CrossProductAccu(a, b, c) ((c)[0] = (a)[1] * (b)[2] - (a)[2] * (b)[1], (c)[1] = (a)[2] * (b)[0] - (a)[0] * (b)[2], (c)[2] = (a)[0] * (b)[1] - (a)[1] * (b)[0]) -//#define Q_rintAccu(in) ((vec_accu_t) floor(in + 0.5)) - -vec_accu_t DotProductAccu( const vec3_accu_t a, const vec3_accu_t b ); -void VectorSubtractAccu( const vec3_accu_t a, const vec3_accu_t b, vec3_accu_t out ); -void VectorAddAccu( const vec3_accu_t a, const vec3_accu_t b, vec3_accu_t out ); -void VectorCopyAccu( const vec3_accu_t in, vec3_accu_t out ); -void VectorScaleAccu( const vec3_accu_t in, vec_accu_t scaleFactor, vec3_accu_t out ); -void CrossProductAccu( const vec3_accu_t a, const vec3_accu_t b, vec3_accu_t out ); -vec_accu_t Q_rintAccu( vec_accu_t val ); - -void VectorCopyAccuToRegular( const vec3_accu_t in, vec3_t out ); -void VectorCopyRegularToAccu( const vec3_t in, vec3_accu_t out ); -vec_accu_t VectorNormalizeAccu( const vec3_accu_t in, vec3_accu_t out ); - -#ifdef __cplusplus -} -#endif - -#endif /* __MATHLIB__ */ diff --git a/libs/mathlib/CMakeLists.txt b/libs/mathlib/CMakeLists.txt index ca8387d2..641838f7 100644 --- a/libs/mathlib/CMakeLists.txt +++ b/libs/mathlib/CMakeLists.txt @@ -1,7 +1,7 @@ add_library(mathlib - bbox.c - line.c - m4x4.c - mathlib.c - ray.c -) + bbox.c + line.c + m4x4.c + mathlib.c mathlib.h + ray.c + ) diff --git a/libs/mathlib/bbox.c b/libs/mathlib/bbox.c index fc9c1e33..1e2e3450 100644 --- a/libs/mathlib/bbox.c +++ b/libs/mathlib/bbox.c @@ -21,7 +21,7 @@ #include -#include "mathlib.h" +#include "mathlib/mathlib.h" const aabb_t g_aabb_null = { { 0, 0, 0, }, diff --git a/libs/mathlib/line.c b/libs/mathlib/line.c index a50337fb..171132ba 100644 --- a/libs/mathlib/line.c +++ b/libs/mathlib/line.c @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "mathlib.h" +#include "mathlib/mathlib.h" void line_construct_for_vec3( line_t *line, const vec3_t start, const vec3_t end ){ VectorMid( start, end, line->origin ); diff --git a/libs/mathlib/m4x4.c b/libs/mathlib/m4x4.c index cb1ad87e..fd85b4ce 100644 --- a/libs/mathlib/m4x4.c +++ b/libs/mathlib/m4x4.c @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "mathlib.h" +#include "mathlib/mathlib.h" const m4x4_t g_m4x4_identity = { 1, 0, 0, 0, diff --git a/libs/mathlib/mathlib.c b/libs/mathlib/mathlib.c index ce6cfdc2..0fc4767f 100644 --- a/libs/mathlib/mathlib.c +++ b/libs/mathlib/mathlib.c @@ -20,7 +20,7 @@ */ // mathlib.c -- math primitives -#include "mathlib.h" +#include "mathlib/mathlib.h" // we use memcpy and memset #include diff --git a/libs/mathlib/mathlib.h b/libs/mathlib/mathlib.h new file mode 100644 index 00000000..64f3f6e4 --- /dev/null +++ b/libs/mathlib/mathlib.h @@ -0,0 +1,483 @@ +/* + Copyright (C) 1999-2006 Id Software, Inc. and contributors. + For a list of contributors, see the accompanying CONTRIBUTORS file. + + This file is part of GtkRadiant. + + GtkRadiant is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + GtkRadiant is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GtkRadiant; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __MATHLIB__ +#define __MATHLIB__ + +// mathlib.h +#include +#include + +#ifdef __cplusplus + +// start declarations of functions defined in C library. +extern "C" +{ + +#endif + +#include "bytebool.h" + +typedef float vec_t; +typedef vec_t vec3_t[3]; +typedef vec_t vec5_t[5]; +typedef vec_t vec4_t[4]; + +// Smallest positive value for vec_t such that 1.0 + VEC_SMALLEST_EPSILON_AROUND_ONE != 1.0. +// In the case of 32 bit floats (which is almost certainly the case), it's 0.00000011921. +// Don't forget that your epsilons should depend on the possible range of values, +// because for example adding VEC_SMALLEST_EPSILON_AROUND_ONE to 1024.0 will have no effect. +#define VEC_SMALLEST_EPSILON_AROUND_ONE FLT_EPSILON + +#define SIDE_FRONT 0 +#define SIDE_ON 2 +#define SIDE_BACK 1 +#define SIDE_CROSS -2 + +// plane types are used to speed some tests +// 0-2 are axial planes +#define PLANE_X 0 +#define PLANE_Y 1 +#define PLANE_Z 2 +#define PLANE_NON_AXIAL 3 + +#define Q_PI 3.14159265358979323846f + +extern const vec3_t vec3_origin; + +extern const vec3_t g_vec3_axis_x; +extern const vec3_t g_vec3_axis_y; +extern const vec3_t g_vec3_axis_z; + +#define EQUAL_EPSILON 0.001 + +#define DotProduct( x,y ) ( ( x )[0] * ( y )[0] + ( x )[1] * ( y )[1] + ( x )[2] * ( y )[2] ) +#define VectorSubtract( a,b,c ) ( ( c )[0] = ( a )[0] - ( b )[0],( c )[1] = ( a )[1] - ( b )[1],( c )[2] = ( a )[2] - ( b )[2] ) +#define VectorAdd( a,b,c ) ( ( c )[0] = ( a )[0] + ( b )[0],( c )[1] = ( a )[1] + ( b )[1],( c )[2] = ( a )[2] + ( b )[2] ) +#define VectorIncrement( a,b ) ( ( b )[0] += ( a )[0],( b )[1] += ( a )[1],( b )[2] += ( a )[2] ) +#define VectorCopy( a,b ) ( ( b )[0] = ( a )[0],( b )[1] = ( a )[1],( b )[2] = ( a )[2] ) +#define VectorSet( v, a, b, c ) ( ( v )[0] = ( a ),( v )[1] = ( b ),( v )[2] = ( c ) ) +#define VectorScale( a,b,c ) ( ( c )[0] = ( b ) * ( a )[0],( c )[1] = ( b ) * ( a )[1],( c )[2] = ( b ) * ( a )[2] ) +#define VectorMid( a,b,c ) ( ( c )[0] = ( ( a )[0] + ( b )[0] ) * 0.5f,( c )[1] = ( ( a )[1] + ( b )[1] ) * 0.5f,( c )[2] = ( ( a )[2] + ( b )[2] ) * 0.5f ) +#define VectorNegate( a,b ) ( ( b )[0] = -( a )[0],( b )[1] = -( a )[1],( b )[2] = -( a )[2] ) +#define CrossProduct( a,b,c ) ( ( c )[0] = ( a )[1] * ( b )[2] - ( a )[2] * ( b )[1],( c )[1] = ( a )[2] * ( b )[0] - ( a )[0] * ( b )[2],( c )[2] = ( a )[0] * ( b )[1] - ( a )[1] * ( b )[0] ) +#define VectorClear( x ) ( ( x )[0] = ( x )[1] = ( x )[2] = 0 ) + +#define FLOAT_SNAP( f,snap ) ( (float)( floor( ( f ) / ( snap ) + 0.5 ) * ( snap ) ) ) +#define FLOAT_TO_INTEGER( f ) ( (float)( floor( ( f ) + 0.5 ) ) ) + +#define RGBTOGRAY( x ) ( (float)( ( x )[0] ) * 0.2989f + (float)( ( x )[1] ) * 0.5870f + (float)( ( x )[2] ) * 0.1140f ) + +#define Q_rint( in ) ( (vec_t)floor( in + 0.5 ) ) + +qboolean VectorCompare( const vec3_t v1, const vec3_t v2 ); + +qboolean VectorIsOnAxis( vec3_t v ); +qboolean VectorIsOnAxialPlane( vec3_t v ); + +vec_t VectorLength( const vec3_t v ); + +void VectorMA( const vec3_t va, vec_t scale, const vec3_t vb, vec3_t vc ); + +void _CrossProduct( vec3_t v1, vec3_t v2, vec3_t cross ); +// I need this define in order to test some of the regression tests from time to time. +// This define affect the precision of VectorNormalize() function only. +#define MATHLIB_VECTOR_NORMALIZE_PRECISION_FIX 1 +vec_t VectorNormalize( const vec3_t in, vec3_t out ); +vec_t ColorNormalize( const vec3_t in, vec3_t out ); +void VectorInverse( vec3_t v ); +void VectorPolar( vec3_t v, float radius, float theta, float phi ); + +// default snapping, to 1 +void VectorSnap( vec3_t v ); + +// integer snapping +void VectorISnap( vec3_t point, int snap ); + +// Gef: added snap to float for sub-integer grid sizes +// TTimo: we still use the int version of VectorSnap when possible +// to avoid potential rounding issues +// TTimo: renaming to VectorFSnap for C implementation +void VectorFSnap( vec3_t point, float snap ); + +// NOTE: added these from Ritual's Q3Radiant +void ClearBounds( vec3_t mins, vec3_t maxs ); +void AddPointToBounds( vec3_t v, vec3_t mins, vec3_t maxs ); + + +#define PITCH 0 // up / down +#define YAW 1 // left / right +#define ROLL 2 // fall over + +void AngleVectors( vec3_t angles, vec3_t forward, vec3_t right, vec3_t up ); +void VectorToAngles( vec3_t vec, vec3_t angles ); + +#define ZERO_EPSILON 1.0E-6 +#define RAD2DEGMULT 57.29577951308232f +#define DEG2RADMULT 0.01745329251994329f +#define RAD2DEG( a ) ( ( a ) * RAD2DEGMULT ) +#define DEG2RAD( a ) ( ( a ) * DEG2RADMULT ) + +void VectorRotate( vec3_t vIn, vec3_t vRotation, vec3_t out ); +void VectorRotateOrigin( vec3_t vIn, vec3_t vRotation, vec3_t vOrigin, vec3_t out ); + +// some function merged from tools mathlib code + +qboolean PlaneFromPoints( vec4_t plane, const vec3_t a, const vec3_t b, const vec3_t c ); +void NormalToLatLong( const vec3_t normal, byte bytes[2] ); +int PlaneTypeForNormal( vec3_t normal ); +void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees ); + + +/*! + \todo + FIXME test calls such as intersect tests should be named test_ + */ + +typedef vec_t m3x3_t[9]; +/*!NOTE + m4x4 looks like this.. + + x y z + x axis ( 0 1 2) + y axis ( 4 5 6) + z axis ( 8 9 10) + translation (12 13 14) + scale ( 0 5 10) + */ +typedef vec_t m4x4_t[16]; + +#define M4X4_INDEX( m,row,col ) ( m[( col << 2 ) + row] ) + +typedef enum { eXYZ, eYZX, eZXY, eXZY, eYXZ, eZYX } eulerOrder_t; + +#define CLIP_PASS 0x00 // 000000 +#define CLIP_LT_X 0x01 // 000001 +#define CLIP_GT_X 0x02 // 000010 +#define CLIP_LT_Y 0x04 // 000100 +#define CLIP_GT_Y 0x08 // 001000 +#define CLIP_LT_Z 0x10 // 010000 +#define CLIP_GT_Z 0x20 // 100000 +#define CLIP_FAIL 0x3F // 111111 +typedef unsigned char clipmask_t; + +extern const m4x4_t g_m4x4_identity; + +#define M4X4_COPY( dst,src ) ( \ + ( dst )[0] = ( src )[0], \ + ( dst )[1] = ( src )[1], \ + ( dst )[2] = ( src )[2], \ + ( dst )[3] = ( src )[3], \ + ( dst )[4] = ( src )[4], \ + ( dst )[5] = ( src )[5], \ + ( dst )[6] = ( src )[6], \ + ( dst )[7] = ( src )[7], \ + ( dst )[8] = ( src )[8], \ + ( dst )[9] = ( src )[9], \ + ( dst )[10] = ( src )[10], \ + ( dst )[11] = ( src )[11], \ + ( dst )[12] = ( src )[12], \ + ( dst )[13] = ( src )[13], \ + ( dst )[14] = ( src )[14], \ + ( dst )[15] = ( src )[15] ) + +typedef enum +{ + eRightHanded = 0, + eLeftHanded = 1, +} +m4x4Handedness_t; + +m4x4Handedness_t m4x4_handedness( const m4x4_t matrix ); + +/*! assign other m4x4 to this m4x4 */ +void m4x4_assign( m4x4_t matrix, const m4x4_t other ); + +// constructors +/*! create m4x4 as identity matrix */ +void m4x4_identity( m4x4_t matrix ); +/*! create m4x4 as a translation matrix, for a translation vec3 */ +void m4x4_translation_for_vec3( m4x4_t matrix, const vec3_t translation ); +/*! create m4x4 as a rotation matrix, for an euler angles (degrees) vec3 */ +void m4x4_rotation_for_vec3( m4x4_t matrix, const vec3_t euler, eulerOrder_t order ); +/*! create m4x4 as a scaling matrix, for a scale vec3 */ +void m4x4_scale_for_vec3( m4x4_t matrix, const vec3_t scale ); +/*! create m4x4 as a rotation matrix, for a quaternion vec4 */ +void m4x4_rotation_for_quat( m4x4_t matrix, const vec4_t rotation ); +/*! create m4x4 as a rotation matrix, for an axis vec3 and an angle (radians) */ +void m4x4_rotation_for_axisangle( m4x4_t matrix, const vec3_t axis, double angle ); +/*! generate a perspective matrix by specifying the view frustum */ +void m4x4_frustum( m4x4_t matrix, vec_t left, vec_t right, vec_t bottom, vec_t top, vec_t nearval, vec_t farval ); + +// a valid m4x4 to access is always first argument +/*! extract translation vec3 from matrix */ +void m4x4_get_translation_vec3( const m4x4_t matrix, vec3_t translation ); +/*! extract euler rotation angles from a rotation-only matrix */ +void m4x4_get_rotation_vec3( const m4x4_t matrix, vec3_t euler, eulerOrder_t order ); +/*! extract scale vec3 from matrix */ +void m4x4_get_scale_vec3( const m4x4_t matrix, vec3_t scale ); +/*! extract translation/euler/scale from an orthogonal matrix. NOTE: requires right-handed axis-base */ +void m4x4_get_transform_vec3( const m4x4_t matrix, vec3_t translation, vec3_t euler, eulerOrder_t order, vec3_t scale ); + +// a valid m4x4 to be modified is always first argument +/*! translate m4x4 by a translation vec3 */ +void m4x4_translate_by_vec3( m4x4_t matrix, const vec3_t translation ); +/*! rotate m4x4 by a euler (degrees) vec3 */ +void m4x4_rotate_by_vec3( m4x4_t matrix, const vec3_t euler, eulerOrder_t order ); +/*! scale m4x4 by a scaling vec3 */ +void m4x4_scale_by_vec3( m4x4_t matrix, const vec3_t scale ); +/*! rotate m4x4 by a quaternion vec4 */ +void m4x4_rotate_by_quat( m4x4_t matrix, const vec4_t rotation ); +/*! rotate m4x4 by an axis vec3 and an angle (radians) */ +void m4x4_rotate_by_axisangle( m4x4_t matrix, const vec3_t axis, double angle ); +/*! transform m4x4 by translation/eulerZYX/scaling vec3 (transform = scale * eulerZ * eulerY * eulerX * translation) */ +void m4x4_transform_by_vec3( m4x4_t matrix, const vec3_t translation, const vec3_t euler, eulerOrder_t order, const vec3_t scale ); +/*! rotate m4x4 around a pivot point by eulerZYX vec3 */ +void m4x4_pivoted_rotate_by_vec3( m4x4_t matrix, const vec3_t euler, eulerOrder_t order, const vec3_t pivotpoint ); +/*! scale m4x4 around a pivot point by scaling vec3 */ +void m4x4_pivoted_scale_by_vec3( m4x4_t matrix, const vec3_t scale, const vec3_t pivotpoint ); +/*! transform m4x4 around a pivot point by translation/eulerZYX/scaling vec3 */ +void m4x4_pivoted_transform_by_vec3( m4x4_t matrix, const vec3_t translation, const vec3_t euler, eulerOrder_t order, const vec3_t scale, const vec3_t pivotpoint ); +/*! transform m4x4 around a pivot point by translation/rotation/scaling vec3 */ +void m4x4_pivoted_transform_by_rotation( m4x4_t matrix, const vec3_t translation, const m4x4_t rotation, const vec3_t scale, const vec3_t pivotpoint ); +/*! rotate m4x4 around a pivot point by quaternion vec4 */ +void m4x4_pivoted_rotate_by_quat( m4x4_t matrix, const vec4_t quat, const vec3_t pivotpoint ); +/*! rotate m4x4 around a pivot point by axis vec3 and angle (radians) */ +void m4x4_pivoted_rotate_by_axisangle( m4x4_t matrix, const vec3_t axis, double angle, const vec3_t pivotpoint ); + +/*! postmultiply m4x4 by another m4x4 */ +void m4x4_multiply_by_m4x4( m4x4_t matrix, const m4x4_t matrix_src ); +/*! premultiply m4x4 by another m4x4 */ +void m4x4_premultiply_by_m4x4( m4x4_t matrix, const m4x4_t matrix_src ); +/*! postmultiply orthogonal m4x4 by another orthogonal m4x4 */ +void m4x4_orthogonal_multiply_by_m4x4( m4x4_t matrix, const m4x4_t matrix_src ); +/*! premultiply orthogonal m4x4 by another orthogonal m4x4 */ +void m4x4_orthogonal_premultiply_by_m4x4( m4x4_t matrix, const m4x4_t matrix_src ); + +/*! multiply a point (x,y,z,1) by matrix */ +void m4x4_transform_point( const m4x4_t matrix, vec3_t point ); +/*! multiply a normal (x,y,z,0) by matrix */ +void m4x4_transform_normal( const m4x4_t matrix, vec3_t normal ); +/*! multiply a vec4 (x,y,z,w) by matrix */ +void m4x4_transform_vec4( const m4x4_t matrix, vec4_t vector ); + +/*! multiply a point (x,y,z,1) by matrix */ +void m4x4_transform_point( const m4x4_t matrix, vec3_t point ); +/*! multiply a normal (x,y,z,0) by matrix */ +void m4x4_transform_normal( const m4x4_t matrix, vec3_t normal ); + +/*! transpose a m4x4 */ +void m4x4_transpose( m4x4_t matrix ); +/*! invert an orthogonal 4x3 subset of a 4x4 matrix */ +int m4x4_orthogonal_invert( m4x4_t matrix ); +/*! m4_det */ +float m4_det( m4x4_t mr ); +/*! invert any m4x4 using Kramer's rule.. return 1 if matrix is singular, else return 0 */ +int m4x4_invert( m4x4_t matrix ); + +/*! clip a point (x,y,z,1) by canonical matrix */ +clipmask_t m4x4_clip_point( const m4x4_t matrix, const vec3_t point, vec4_t clipped ); +/*! device-space polygon for clipped triangle */ +unsigned int m4x4_clip_triangle( const m4x4_t matrix, const vec3_t p0, const vec3_t p1, const vec3_t p2, vec4_t clipped[9] ); +/*! device-space line for clipped line */ +unsigned int m4x4_clip_line( const m4x4_t matrix, const vec3_t p0, const vec3_t p1, vec4_t clipped[2] ); + + +//! quaternion identity +void quat_identity( vec4_t quat ); +//! quaternion from two unit vectors +void quat_for_unit_vectors( vec4_t quat, const vec3_t from, const vec3_t to ); +//! quaternion from axis and angle (radians) +void quat_for_axisangle( vec4_t quat, const vec3_t axis, double angle ); +//! concatenates two rotations.. equivalent to m4x4_multiply_by_m4x4 .. postmultiply.. the right-hand side is the first rotation performed +void quat_multiply_by_quat( vec4_t quat, const vec4_t other ); +//! negate a quaternion +void quat_conjugate( vec4_t quat ); +//! normalise a quaternion +void quat_normalise( vec4_t quat ); + + + +/*! + \todo object/ray intersection functions should maybe return a point rather than a distance? + */ + +/*! + aabb_t - "axis-aligned" bounding box... + origin: centre of bounding box... + extents: +/- extents of box from origin... + */ +typedef struct aabb_s +{ + vec3_t origin; + vec3_t extents; +} aabb_t; + +extern const aabb_t g_aabb_null; + +/*! + bbox_t - oriented bounding box... + aabb: axis-aligned bounding box... + axes: orientation axes... + */ +typedef struct bbox_s +{ + aabb_t aabb; + vec3_t axes[3]; + vec_t radius; +} bbox_t; + +/*! + ray_t - origin point and direction unit-vector + */ +typedef struct ray_s +{ + vec3_t origin; + vec3_t direction; +} ray_t; + +/*! + line_t - centre point and displacement of end point from centre + */ +typedef struct line_s +{ + vec3_t origin; + vec3_t extents; +} line_t; + + +/*! Generate line from start/end points. */ +void line_construct_for_vec3( line_t* line, const vec3_t start, const vec3_t end ); +/*! Return 2 if line is behind plane, else return 1 if line intersects plane, else return 0. */ +int line_test_plane( const line_t* line, const vec4_t plane ); + +/*! Generate AABB from min/max. */ +void aabb_construct_for_vec3( aabb_t* aabb, const vec3_t min, const vec3_t max ); +/*! Initialise AABB to negative size. */ +void aabb_clear( aabb_t* aabb ); + +/*! Extend AABB to include point. */ +void aabb_extend_by_point( aabb_t* aabb, const vec3_t point ); +/*! Extend AABB to include aabb_src. */ +void aabb_extend_by_aabb( aabb_t* aabb, const aabb_t* aabb_src ); +/*! Extend AABB by +/- extension vector. */ +void aabb_extend_by_vec3( aabb_t* aabb, vec3_t extension ); + +/*! Return 2 if point is inside, else 1 if point is on surface, else 0. */ +int aabb_test_point( const aabb_t* aabb, const vec3_t point ); +/*! Return 2 if aabb_src intersects, else 1 if aabb_src touches exactly, else 0. */ +int aabb_test_aabb( const aabb_t* aabb, const aabb_t* aabb_src ); +/*! Return 2 if aabb is behind plane, else 1 if aabb intersects plane, else 0. */ +int aabb_test_plane( const aabb_t* aabb, const float* plane ); +/*! Return 1 if aabb intersects ray, else 0... dist = closest intersection. */ +int aabb_intersect_ray( const aabb_t* aabb, const ray_t* ray, vec3_t intersection ); +/*! Return 1 if aabb intersects ray, else 0. Faster, but does not provide point of intersection */ +int aabb_test_ray( const aabb_t* aabb, const ray_t* ray ); + +/*! Return 2 if oriented aabb is behind plane, else 1 if aabb intersects plane, else 0. */ +int aabb_oriented_intersect_plane( const aabb_t* aabb, const m4x4_t transform, const vec_t* plane ); + +/*! Calculate the corners of the aabb. */ +void aabb_corners( const aabb_t * aabb, vec3_t corners[8] ); + +/*! (deprecated) Generate AABB from oriented bounding box. */ +void aabb_for_bbox( aabb_t* aabb, const bbox_t* bbox ); +/*! (deprecated) Generate AABB from 2-dimensions of min/max, specified by axis. */ +void aabb_for_area( aabb_t* aabb, vec3_t area_tl, vec3_t area_br, int axis ); +/*! Generate AABB to contain src* transform. NOTE: transform must be orthogonal */ +void aabb_for_transformed_aabb( aabb_t* dst, const aabb_t* src, const m4x4_t transform ); + +/*! Update bounding-sphere radius. */ +void bbox_update_radius( bbox_t* bbox ); +/*! Generate oriented bounding box from AABB and transformation matrix. */ +/*!\todo Remove need to specify eulerZYX/scale. */ +void bbox_for_oriented_aabb( bbox_t* bbox, const aabb_t* aabb, + const m4x4_t matrix, const vec3_t eulerZYX, const vec3_t scale ); +/*! Return 2 if bbox is behind plane, else return 1 if bbox intersects plane, else return 0. */ +int bbox_intersect_plane( const bbox_t* bbox, const vec_t* plane ); + + +/*! Generate a ray from an origin point and a direction unit-vector */ +void ray_construct_for_vec3( ray_t* ray, const vec3_t origin, const vec3_t direction ); + +/*! Transform a ray */ +void ray_transform( ray_t* ray, const m4x4_t matrix ); + +/*! distance from ray origin in ray direction to point. FLT_MAX if no intersection. */ +vec_t ray_intersect_point( const ray_t* ray, const vec3_t point, vec_t epsilon, vec_t divergence ); +/*! distance from ray origin in ray direction to triangle. FLT_MAX if no intersection. */ +vec_t ray_intersect_triangle( const ray_t* ray, qboolean bCullBack, const vec3_t vert0, const vec3_t vert1, const vec3_t vert2 ); +/*! distance from ray origin in ray direction to plane. */ +vec_t ray_intersect_plane( const ray_t* ray, const vec3_t normal, vec_t dist ); + + +int plane_intersect_planes( const vec4_t plane1, const vec4_t plane2, const vec4_t plane3, vec3_t intersection ); + + + +//////////////////////////////////////////////////////////////////////////////// +// Below is double-precision math stuff. This was initially needed by the new +// "base winding" code in q3map2 brush processing in order to fix the famous +// "disappearing triangles" issue. These definitions can be used wherever extra +// precision is needed. +//////////////////////////////////////////////////////////////////////////////// + +typedef double vec_accu_t; +typedef vec_accu_t vec3_accu_t[3]; + +// Smallest positive value for vec_accu_t such that 1.0 + VEC_ACCU_SMALLEST_EPSILON_AROUND_ONE != 1.0. +// In the case of 64 bit doubles (which is almost certainly the case), it's 0.00000000000000022204. +// Don't forget that your epsilons should depend on the possible range of values, +// because for example adding VEC_ACCU_SMALLEST_EPSILON_AROUND_ONE to 1024.0 will have no effect. +#define VEC_ACCU_SMALLEST_EPSILON_AROUND_ONE DBL_EPSILON + +vec_accu_t VectorLengthAccu( const vec3_accu_t v ); + +// I have a feeling it may be safer to break these #define functions out into actual functions +// in order to avoid accidental loss of precision. For example, say you call +// VectorScaleAccu(vec3_t, vec_t, vec3_accu_t). The scale would take place in 32 bit land +// and the result would be cast to 64 bit, which would cause total loss of precision when +// scaling by a large factor. +//#define DotProductAccu(x, y) ((x)[0] * (y)[0] + (x)[1] * (y)[1] + (x)[2] * (y)[2]) +//#define VectorSubtractAccu(a, b, c) ((c)[0] = (a)[0] - (b)[0], (c)[1] = (a)[1] - (b)[1], (c)[2] = (a)[2] - (b)[2]) +//#define VectorAddAccu(a, b, c) ((c)[0] = (a)[0] + (b)[0], (c)[1] = (a)[1] + (b)[1], (c)[2] = (a)[2] + (b)[2]) +//#define VectorCopyAccu(a, b) ((b)[0] = (a)[0], (b)[1] = (a)[1], (b)[2] = (a)[2]) +//#define VectorScaleAccu(a, b, c) ((c)[0] = (b) * (a)[0], (c)[1] = (b) * (a)[1], (c)[2] = (b) * (a)[2]) +//#define CrossProductAccu(a, b, c) ((c)[0] = (a)[1] * (b)[2] - (a)[2] * (b)[1], (c)[1] = (a)[2] * (b)[0] - (a)[0] * (b)[2], (c)[2] = (a)[0] * (b)[1] - (a)[1] * (b)[0]) +//#define Q_rintAccu(in) ((vec_accu_t) floor(in + 0.5)) + +vec_accu_t DotProductAccu( const vec3_accu_t a, const vec3_accu_t b ); +void VectorSubtractAccu( const vec3_accu_t a, const vec3_accu_t b, vec3_accu_t out ); +void VectorAddAccu( const vec3_accu_t a, const vec3_accu_t b, vec3_accu_t out ); +void VectorCopyAccu( const vec3_accu_t in, vec3_accu_t out ); +void VectorScaleAccu( const vec3_accu_t in, vec_accu_t scaleFactor, vec3_accu_t out ); +void CrossProductAccu( const vec3_accu_t a, const vec3_accu_t b, vec3_accu_t out ); +vec_accu_t Q_rintAccu( vec_accu_t val ); + +void VectorCopyAccuToRegular( const vec3_accu_t in, vec3_t out ); +void VectorCopyRegularToAccu( const vec3_t in, vec3_accu_t out ); +vec_accu_t VectorNormalizeAccu( const vec3_accu_t in, vec3_accu_t out ); + +#ifdef __cplusplus +} +#endif + +#endif /* __MATHLIB__ */ diff --git a/libs/mathlib/ray.c b/libs/mathlib/ray.c index f08a8842..09e23fa5 100644 --- a/libs/mathlib/ray.c +++ b/libs/mathlib/ray.c @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "mathlib.h" +#include "mathlib/mathlib.h" #include vec3_t identity = { 0,0,0 }; diff --git a/libs/md5lib.h b/libs/md5lib.h deleted file mode 100644 index db9fd333..00000000 --- a/libs/md5lib.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - L. Peter Deutsch - ghost@aladdin.com - - */ -/* $Id: md5lib.h,v 1.1.2.1 2003/07/19 23:25:50 spog Exp $ */ -/* - Independent implementation of MD5 (RFC 1321). - - This code implements the MD5 Algorithm defined in RFC 1321, whose - text is available at - http://www.ietf.org/rfc/rfc1321.txt - The code is derived from the text of the RFC, including the test suite - (section A.5) but excluding the rest of Appendix A. It does not include - any code or documentation that is identified in the RFC as being - copyrighted. - - The original and principal author of md5.h is L. Peter Deutsch - . Other authors are noted in the change history - that follows (in reverse chronological order): - - 2002-04-13 lpd Removed support for non-ANSI compilers; removed - references to Ghostscript; clarified derivation from RFC 1321; - now handles byte order either statically or dynamically. - 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. - 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); - added conditionalization for C++ compilation from Martin - Purschke . - 1999-05-03 lpd Original version. - */ - -#ifndef md5_INCLUDED -# define md5_INCLUDED - -/* - * This package supports both compile-time and run-time determination of CPU - * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be - * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is - * defined as non-zero, the code will be compiled to run only on big-endian - * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to - * run on either big- or little-endian CPUs, but will run slightly less - * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined. - */ - -typedef unsigned char md5_byte_t; /* 8-bit byte */ -typedef unsigned int md5_word_t; /* 32-bit word */ - -/* Define the state of the MD5 Algorithm. */ -typedef struct md5_state_s { - md5_word_t count[2]; /* message length in bits, lsw first */ - md5_word_t abcd[4]; /* digest buffer */ - md5_byte_t buf[64]; /* accumulate block */ -} md5_state_t; - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Initialize the algorithm. */ -void md5_init( md5_state_t *pms ); - -/* Append a string to the message. */ -void md5_append( md5_state_t *pms, const md5_byte_t *data, int nbytes ); - -/* Finish the message and return the digest. */ -void md5_finish( md5_state_t * pms, md5_byte_t digest[16] ); - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif /* md5_INCLUDED */ diff --git a/libs/md5lib/CMakeLists.txt b/libs/md5lib/CMakeLists.txt index b8948dc6..5fbb0c8a 100644 --- a/libs/md5lib/CMakeLists.txt +++ b/libs/md5lib/CMakeLists.txt @@ -1,3 +1,3 @@ add_library(md5lib - md5lib.c -) + md5lib.c md5lib.h + ) diff --git a/libs/md5lib/md5lib.h b/libs/md5lib/md5lib.h new file mode 100644 index 00000000..db9fd333 --- /dev/null +++ b/libs/md5lib/md5lib.h @@ -0,0 +1,91 @@ +/* + Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved. + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + L. Peter Deutsch + ghost@aladdin.com + + */ +/* $Id: md5lib.h,v 1.1.2.1 2003/07/19 23:25:50 spog Exp $ */ +/* + Independent implementation of MD5 (RFC 1321). + + This code implements the MD5 Algorithm defined in RFC 1321, whose + text is available at + http://www.ietf.org/rfc/rfc1321.txt + The code is derived from the text of the RFC, including the test suite + (section A.5) but excluding the rest of Appendix A. It does not include + any code or documentation that is identified in the RFC as being + copyrighted. + + The original and principal author of md5.h is L. Peter Deutsch + . Other authors are noted in the change history + that follows (in reverse chronological order): + + 2002-04-13 lpd Removed support for non-ANSI compilers; removed + references to Ghostscript; clarified derivation from RFC 1321; + now handles byte order either statically or dynamically. + 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. + 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); + added conditionalization for C++ compilation from Martin + Purschke . + 1999-05-03 lpd Original version. + */ + +#ifndef md5_INCLUDED +# define md5_INCLUDED + +/* + * This package supports both compile-time and run-time determination of CPU + * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be + * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is + * defined as non-zero, the code will be compiled to run only on big-endian + * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to + * run on either big- or little-endian CPUs, but will run slightly less + * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined. + */ + +typedef unsigned char md5_byte_t; /* 8-bit byte */ +typedef unsigned int md5_word_t; /* 32-bit word */ + +/* Define the state of the MD5 Algorithm. */ +typedef struct md5_state_s { + md5_word_t count[2]; /* message length in bits, lsw first */ + md5_word_t abcd[4]; /* digest buffer */ + md5_byte_t buf[64]; /* accumulate block */ +} md5_state_t; + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* Initialize the algorithm. */ +void md5_init( md5_state_t *pms ); + +/* Append a string to the message. */ +void md5_append( md5_state_t *pms, const md5_byte_t *data, int nbytes ); + +/* Finish the message and return the digest. */ +void md5_finish( md5_state_t * pms, md5_byte_t digest[16] ); + +#ifdef __cplusplus +} /* end extern "C" */ +#endif + +#endif /* md5_INCLUDED */ diff --git a/libs/memory/CMakeLists.txt b/libs/memory/CMakeLists.txt index 22b0fa6b..1c345734 100644 --- a/libs/memory/CMakeLists.txt +++ b/libs/memory/CMakeLists.txt @@ -1,4 +1,3 @@ add_library(memory - allocator.cpp - allocator.h -) + allocator.cpp allocator.h + ) diff --git a/libs/moduleobservers.cpp b/libs/moduleobservers.cpp deleted file mode 100644 index 56150f91..00000000 --- a/libs/moduleobservers.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "moduleobservers.h" diff --git a/libs/modulesystem/CMakeLists.txt b/libs/modulesystem/CMakeLists.txt index 57722a48..d27aa633 100644 --- a/libs/modulesystem/CMakeLists.txt +++ b/libs/modulesystem/CMakeLists.txt @@ -1,8 +1,5 @@ add_library(modulesystem - moduleregistry.cpp - moduleregistry.h - modulesmap.cpp - modulesmap.h - singletonmodule.cpp - singletonmodule.h -) + moduleregistry.h + modulesmap.h + singletonmodule.cpp singletonmodule.h + ) diff --git a/libs/modulesystem/moduleregistry.cpp b/libs/modulesystem/moduleregistry.cpp deleted file mode 100644 index 1e5bba6d..00000000 --- a/libs/modulesystem/moduleregistry.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "moduleregistry.h" diff --git a/libs/modulesystem/moduleregistry.h b/libs/modulesystem/moduleregistry.h index abea5a05..45cfa5f0 100644 --- a/libs/modulesystem/moduleregistry.h +++ b/libs/modulesystem/moduleregistry.h @@ -31,23 +31,23 @@ public: virtual void selfRegister() = 0; }; -class ModuleRegistryList -{ -typedef std::list RegisterableModules; -RegisterableModules m_modules; +class ModuleRegistryList { + std::list m_modules; public: -void addModule( ModuleRegisterable& module ){ - m_modules.push_back( &module ); -} -void registerModules() const { - for ( RegisterableModules::const_iterator i = m_modules.begin(); i != m_modules.end(); ++i ) + void addModule(ModuleRegisterable &module) { - ( *i )->selfRegister(); + m_modules.push_back(&module); + } + + void registerModules() const + { + for (auto it : m_modules) { + it->selfRegister(); + } } -} }; -typedef SmartStatic StaticModuleRegistryList; +using StaticModuleRegistryList = SmartStatic; class StaticRegisterModule : public StaticModuleRegistryList diff --git a/libs/modulesystem/modulesmap.cpp b/libs/modulesystem/modulesmap.cpp deleted file mode 100644 index a80f2135..00000000 --- a/libs/modulesystem/modulesmap.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "modulesmap.h" diff --git a/libs/modulesystem/singletonmodule.h b/libs/modulesystem/singletonmodule.h index 6dd9c52a..35707d36 100644 --- a/libs/modulesystem/singletonmodule.h +++ b/libs/modulesystem/singletonmodule.h @@ -86,9 +86,13 @@ explicit SingletonModule( const APIConstructor& constructor ) ASSERT_MESSAGE( m_refcount == 0, "module still referenced at shutdown" ); } -void selfRegister(){ - globalModuleServer().registerModule( typename Type::Name(), typename Type::Version(), APIConstructor::getName(), *this ); -} + void selfRegister() + { + const char *type = typename Type::Name(); + int version = typename Type::Version(); + const char *name = APIConstructor::getName(); + globalModuleServer().registerModule(type, version, name, *this); + } Dependencies& getDependencies(){ return *m_dependencies; diff --git a/libs/os/CMakeLists.txt b/libs/os/CMakeLists.txt index 27463419..5978d980 100644 --- a/libs/os/CMakeLists.txt +++ b/libs/os/CMakeLists.txt @@ -1,8 +1,10 @@ add_library(os - dir.cpp - dir.h - file.cpp - file.h - path.cpp - path.h -) + dir.h + file.h + path.h + ) +set_target_properties(os PROPERTIES LINKER_LANGUAGE CXX) + +find_package(GLIB REQUIRED) +target_include_directories(os PRIVATE ${GLIB_INCLUDE_DIRS}) + diff --git a/libs/os/dir.cpp b/libs/os/dir.cpp deleted file mode 100644 index 8ab81296..00000000 --- a/libs/os/dir.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "dir.h" diff --git a/libs/os/file.cpp b/libs/os/file.cpp deleted file mode 100644 index 1855b5d1..00000000 --- a/libs/os/file.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "file.h" diff --git a/libs/os/path.cpp b/libs/os/path.cpp deleted file mode 100644 index b62c219e..00000000 --- a/libs/os/path.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "path.h" diff --git a/libs/picomodel.h b/libs/picomodel.h deleted file mode 100644 index 370afef9..00000000 --- a/libs/picomodel.h +++ /dev/null @@ -1,351 +0,0 @@ -/* ----------------------------------------------------------------------------- - - PicoModel Library - - Copyright (c) 2002, Randy Reddig & seaw0lf - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this list - of conditions and the following disclaimer. - - 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. - - Neither the names of the copyright holders nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 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. - - ----------------------------------------------------------------------------- */ - - - -/* marker */ -#ifndef PICOMODEL_H -#define PICOMODEL_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include - - - -/* version */ -#define PICOMODEL_VERSION "0.8.20" - - -/* constants */ -#define PICO_GROW_SHADERS 16 -#define PICO_GROW_SURFACES 16 -#define PICO_GROW_VERTEXES 1024 -#define PICO_GROW_INDEXES 1024 -#define PICO_GROW_ARRAYS 8 -#define PICO_GROW_FACES 256 -#define PICO_MAX_SPECIAL 8 -#define PICO_MAX_DEFAULT_EXTS 4 /* max default extensions per module */ - - -/* types */ -typedef unsigned char picoByte_t; -typedef float picoVec_t; -typedef float picoVec2_t[ 2 ]; -typedef float picoVec3_t[ 3 ]; -typedef float picoVec4_t[ 4 ]; -typedef picoByte_t picoColor_t[ 4 ]; -typedef int picoIndex_t; - -typedef enum -{ - PICO_BAD, - PICO_TRIANGLES, - PICO_PATCH -} -picoSurfaceType_t; - -typedef enum -{ - PICO_NORMAL, - PICO_VERBOSE, - PICO_WARNING, - PICO_ERROR, - PICO_FATAL -} -picoPrintLevel_t; - -typedef struct picoSurface_s picoSurface_t; -typedef struct picoShader_s picoShader_t; -typedef struct picoModel_s picoModel_t; -typedef struct picoModule_s picoModule_t; - -struct picoSurface_s -{ - void *data; - - picoModel_t *model; /* owner model */ - - picoSurfaceType_t type; - char *name; /* sea: surface name */ - picoShader_t *shader; /* ydnar: changed to ptr */ - - int numVertexes, maxVertexes; - picoVec3_t *xyz; - picoVec3_t *normal; - picoIndex_t *smoothingGroup; - - int numSTArrays, maxSTArrays; - picoVec2_t **st; - - int numColorArrays, maxColorArrays; - picoColor_t **color; - - int numIndexes, maxIndexes; - picoIndex_t *index; - - int numFaceNormals, maxFaceNormals; - picoVec3_t *faceNormal; - - int special[ PICO_MAX_SPECIAL ]; -}; - - -/* seaw0lf */ -struct picoShader_s -{ - picoModel_t *model; /* owner model */ - - char *name; /* shader name */ - char *mapName; /* shader file name (name of diffuse texturemap) */ - picoColor_t ambientColor; /* ambient color of mesh (rgba) */ - picoColor_t diffuseColor; /* diffuse color of mesh (rgba) */ - picoColor_t specularColor; /* specular color of mesh (rgba) */ - float transparency; /* transparency (0..1; 1 = 100% transparent) */ - float shininess; /* shininess (0..128; 128 = 100% shiny) */ -}; - -struct picoModel_s -{ - void *data; - char *name; /* model name */ - char *fileName; /* sea: model file name */ - int frameNum; /* sea: renamed to frameNum */ - int numFrames; /* sea: number of frames */ - picoVec3_t mins; - picoVec3_t maxs; - - int numShaders, maxShaders; - picoShader_t **shader; - - int numSurfaces, maxSurfaces; - picoSurface_t **surface; - - const picoModule_t *module; /* sea */ -}; - - -/* seaw0lf */ -/* return codes used by the validation callbacks; pmv is short */ -/* for 'pico module validation'. everything >PICO_PMV_OK means */ -/* that there was an error. */ -enum -{ - PICO_PMV_OK, /* file valid */ - PICO_PMV_ERROR, /* file not valid */ - PICO_PMV_ERROR_IDENT, /* unknown file magic (aka ident) */ - PICO_PMV_ERROR_VERSION, /* unsupported file version */ - PICO_PMV_ERROR_SIZE, /* file size error */ - PICO_PMV_ERROR_MEMORY, /* out of memory error */ -}; - -/* convenience (makes it easy to add new params to the callbacks) */ -#define PM_PARAMS_CANLOAD \ - const char *fileName, const void *buffer, int bufSize - -#define PM_PARAMS_LOAD \ - const char *fileName, int frameNum, const void *buffer, int bufSize - -#define PM_PARAMS_CANSAVE \ - void - -#define PM_PARAMS_SAVE \ - const char *fileName, picoModel_t * model - -/* pico file format module structure */ -struct picoModule_s -{ - char *version; /* internal module version (e.g. '1.5-b2') */ - - char *displayName; /* string used to display in guis, etc. */ - char *authorName; /* author name (eg. 'My Real Name') */ - char *copyright; /* copyright year and holder (eg. '2002 My Company') */ - - char *defaultExts[ PICO_MAX_DEFAULT_EXTS ]; /* default file extensions used by this file type */ - int ( *canload )( PM_PARAMS_CANLOAD ); /* checks whether module can load given file (returns PMVR_*) */ - picoModel_t *( *load )( PM_PARAMS_LOAD ); /* parses model file data */ - int ( *cansave )( PM_PARAMS_CANSAVE ); /* checks whether module can save (returns 1 or 0 and might spit out a message) */ - int ( *save )( PM_PARAMS_SAVE ); /* saves a pico model in module's native model format */ -}; - - - -/* general functions */ -int PicoInit( void ); -void PicoShutdown( void ); -int PicoError( void ); - -void PicoSetMallocFunc( void *( *func )( size_t ) ); -void PicoSetFreeFunc( void ( *func )( void* ) ); -void PicoSetLoadFileFunc( void ( *func )( const char*, unsigned char**, int* ) ); -void PicoSetFreeFileFunc( void ( *func )( void* ) ); -void PicoSetPrintFunc( void ( *func )( int, const char* ) ); - -const picoModule_t **PicoModuleList( int *numModules ); - -picoModel_t *PicoLoadModel( const char *name, int frameNum ); - -typedef size_t ( *PicoInputStreamReadFunc )( void* inputStream, unsigned char* buffer, size_t length ); -picoModel_t* PicoModuleLoadModelStream( const picoModule_t* module, void* inputStream, PicoInputStreamReadFunc inputStreamRead, size_t streamLength, int frameNum, const char *fileName ); - -/* model functions */ -picoModel_t *PicoNewModel( void ); -void PicoFreeModel( picoModel_t *model ); -int PicoAdjustModel( picoModel_t *model, int numShaders, int numSurfaces ); - - -/* shader functions */ -picoShader_t *PicoNewShader( picoModel_t *model ); -void PicoFreeShader( picoShader_t *shader ); -picoShader_t *PicoFindShader( picoModel_t *model, char *name, int caseSensitive ); - - -/* surface functions */ -picoSurface_t *PicoNewSurface( picoModel_t *model ); -void PicoFreeSurface( picoSurface_t *surface ); -picoSurface_t *PicoFindSurface( picoModel_t *model, char *name, int caseSensitive ); -int PicoAdjustSurface( picoSurface_t *surface, int numVertexes, int numSTArrays, int numColorArrays, int numIndexes, int numFaceNormals ); - - -/* setter functions */ -void PicoSetModelName( picoModel_t *model, const char *name ); -void PicoSetModelFileName( picoModel_t *model, const char *fileName ); -void PicoSetModelFrameNum( picoModel_t *model, int frameNum ); -void PicoSetModelNumFrames( picoModel_t *model, int numFrames ); -void PicoSetModelData( picoModel_t *model, void *data ); - -void PicoSetShaderName( picoShader_t *shader, char *name ); -void PicoSetShaderMapName( picoShader_t *shader, char *mapName ); -void PicoSetShaderAmbientColor( picoShader_t *shader, picoColor_t color ); -void PicoSetShaderDiffuseColor( picoShader_t *shader, picoColor_t color ); -void PicoSetShaderSpecularColor( picoShader_t *shader, picoColor_t color ); -void PicoSetShaderTransparency( picoShader_t *shader, float value ); -void PicoSetShaderShininess( picoShader_t *shader, float value ); - -void PicoSetSurfaceData( picoSurface_t *surface, void *data ); -void PicoSetSurfaceType( picoSurface_t *surface, picoSurfaceType_t type ); -void PicoSetSurfaceName( picoSurface_t *surface, const char *name ); -void PicoSetSurfaceShader( picoSurface_t *surface, picoShader_t *shader ); -void PicoSetSurfaceXYZ( picoSurface_t *surface, int num, picoVec3_t xyz ); -void PicoSetSurfaceNormal( picoSurface_t *surface, int num, picoVec3_t normal ); -void PicoSetSurfaceST( picoSurface_t *surface, int array, int num, picoVec2_t st ); -void PicoSetSurfaceColor( picoSurface_t *surface, int array, int num, picoColor_t color ); -void PicoSetSurfaceIndex( picoSurface_t *surface, int num, picoIndex_t index ); -void PicoSetSurfaceIndexes( picoSurface_t *surface, int num, picoIndex_t *index, int count ); -void PicoSetFaceNormal( picoSurface_t *surface, int num, picoVec3_t normal ); -void PicoSetSurfaceSpecial( picoSurface_t *surface, int num, int special ); -void PicoSetSurfaceSmoothingGroup( picoSurface_t *surface, int num, picoIndex_t smoothingGroup ); - - -/* getter functions */ -char *PicoGetModelName( picoModel_t *model ); -char *PicoGetModelFileName( picoModel_t *model ); -int PicoGetModelFrameNum( picoModel_t *model ); -int PicoGetModelNumFrames( picoModel_t *model ); -void *PicoGetModelData( picoModel_t *model ); -int PicoGetModelNumShaders( picoModel_t *model ); -picoShader_t *PicoGetModelShader( picoModel_t *model, int num ); /* sea */ -int PicoGetModelNumSurfaces( picoModel_t *model ); -picoSurface_t *PicoGetModelSurface( picoModel_t *model, int num ); -int PicoGetModelTotalVertexes( picoModel_t *model ); -int PicoGetModelTotalIndexes( picoModel_t *model ); - -char *PicoGetShaderName( picoShader_t *shader ); -char *PicoGetShaderMapName( picoShader_t *shader ); -picoByte_t *PicoGetShaderAmbientColor( picoShader_t *shader ); -picoByte_t *PicoGetShaderDiffuseColor( picoShader_t *shader ); -picoByte_t *PicoGetShaderSpecularColor( picoShader_t *shader ); -float PicoGetShaderTransparency( picoShader_t *shader ); -float PicoGetShaderShininess( picoShader_t *shader ); - -void *PicoGetSurfaceData( picoSurface_t *surface ); -char *PicoGetSurfaceName( picoSurface_t *surface ); /* sea */ -picoSurfaceType_t PicoGetSurfaceType( picoSurface_t *surface ); -char *PicoGetSurfaceName( picoSurface_t *surface ); -picoShader_t *PicoGetSurfaceShader( picoSurface_t *surface ); /* sea */ - -int PicoGetSurfaceNumVertexes( picoSurface_t *surface ); -picoVec_t *PicoGetSurfaceXYZ( picoSurface_t *surface, int num ); -picoVec_t *PicoGetSurfaceNormal( picoSurface_t *surface, int num ); -picoVec_t *PicoGetSurfaceST( picoSurface_t *surface, int array, int num ); -picoByte_t *PicoGetSurfaceColor( picoSurface_t *surface, int array, int num ); -int PicoGetSurfaceNumIndexes( picoSurface_t *surface ); -picoIndex_t PicoGetSurfaceIndex( picoSurface_t *surface, int num ); -picoIndex_t *PicoGetSurfaceIndexes( picoSurface_t *surface, int num ); -picoVec_t *PicoGetFaceNormal( picoSurface_t *surface, int num ); -int PicoGetSurfaceSpecial( picoSurface_t *surface, int num ); - - -/* hashtable related functions */ -typedef struct picoVertexCombinationData_s -{ - picoVec3_t xyz, normal; - picoVec2_t st; - picoColor_t color; -} picoVertexCombinationData_t; - -typedef struct picoVertexCombinationHash_s -{ - picoVertexCombinationData_t vcd; - picoIndex_t index; - - void *data; - - struct picoVertexCombinationHash_s *next; -} picoVertexCombinationHash_t; - -int PicoGetHashTableSize( void ); -unsigned int PicoVertexCoordGenerateHash( picoVec3_t xyz ); -picoVertexCombinationHash_t **PicoNewVertexCombinationHashTable( void ); -void PicoFreeVertexCombinationHashTable( picoVertexCombinationHash_t **hashTable ); -picoVertexCombinationHash_t *PicoFindVertexCombinationInHashTable( picoVertexCombinationHash_t **hashTable, picoVec3_t xyz, picoVec3_t normal, picoVec3_t st, picoColor_t color ); -picoVertexCombinationHash_t *PicoAddVertexCombinationToHashTable( picoVertexCombinationHash_t **hashTable, picoVec3_t xyz, picoVec3_t normal, picoVec3_t st, picoColor_t color, picoIndex_t index ); - -/* specialized functions */ -int PicoFindSurfaceVertexNum( picoSurface_t *surface, picoVec3_t xyz, picoVec3_t normal, int numSTs, picoVec2_t *st, int numColors, picoColor_t *color, picoIndex_t smoothingGroup ); -void PicoFixSurfaceNormals( picoSurface_t *surface ); -int PicoRemapModel( picoModel_t *model, char *remapFile ); - - -void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** normals, int numSTs, picoVec2_t **st, int numColors, picoColor_t **colors, picoShader_t* shader, const char *name, picoIndex_t* smoothingGroup ); - -/* end marker */ -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/picomodel/CMakeLists.txt b/libs/picomodel/CMakeLists.txt index 52764e11..051a6bfd 100644 --- a/libs/picomodel/CMakeLists.txt +++ b/libs/picomodel/CMakeLists.txt @@ -1,28 +1,26 @@ add_library(picomodel - lwo/clip.c - lwo/envelope.c - lwo/list.c - lwo/lwio.c - lwo/lwo2.c - lwo/lwo2.h - lwo/lwob.c - lwo/pntspols.c - lwo/surface.c - lwo/vecmath.c - lwo/vmap.c - picointernal.c - picointernal.h - picomodel.c - picomodules.c - pm_3ds.c - pm_ase.c - pm_fm.c - pm_fm.h - pm_lwo.c - pm_md2.c - pm_md3.c - pm_mdc.c - pm_ms3d.c - pm_obj.c - pm_terrain.c -) + lwo/clip.c + lwo/envelope.c + lwo/list.c + lwo/lwio.c + lwo/lwo2.c lwo/lwo2.h + lwo/lwob.c + lwo/pntspols.c + lwo/surface.c + lwo/vecmath.c + lwo/vmap.c + + picointernal.c picointernal.h + picomodel.c picomodel.h + picomodules.c + pm_3ds.c + pm_ase.c + pm_fm.c pm_fm.h + pm_lwo.c + pm_md2.c + pm_md3.c + pm_mdc.c + pm_ms3d.c + pm_obj.c + pm_terrain.c + ) diff --git a/libs/picomodel/picomodel.h b/libs/picomodel/picomodel.h new file mode 100644 index 00000000..370afef9 --- /dev/null +++ b/libs/picomodel/picomodel.h @@ -0,0 +1,351 @@ +/* ----------------------------------------------------------------------------- + + PicoModel Library + + Copyright (c) 2002, Randy Reddig & seaw0lf + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list + of conditions and the following disclaimer. + + 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. + + Neither the names of the copyright holders nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 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. + + ----------------------------------------------------------------------------- */ + + + +/* marker */ +#ifndef PICOMODEL_H +#define PICOMODEL_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include + + + +/* version */ +#define PICOMODEL_VERSION "0.8.20" + + +/* constants */ +#define PICO_GROW_SHADERS 16 +#define PICO_GROW_SURFACES 16 +#define PICO_GROW_VERTEXES 1024 +#define PICO_GROW_INDEXES 1024 +#define PICO_GROW_ARRAYS 8 +#define PICO_GROW_FACES 256 +#define PICO_MAX_SPECIAL 8 +#define PICO_MAX_DEFAULT_EXTS 4 /* max default extensions per module */ + + +/* types */ +typedef unsigned char picoByte_t; +typedef float picoVec_t; +typedef float picoVec2_t[ 2 ]; +typedef float picoVec3_t[ 3 ]; +typedef float picoVec4_t[ 4 ]; +typedef picoByte_t picoColor_t[ 4 ]; +typedef int picoIndex_t; + +typedef enum +{ + PICO_BAD, + PICO_TRIANGLES, + PICO_PATCH +} +picoSurfaceType_t; + +typedef enum +{ + PICO_NORMAL, + PICO_VERBOSE, + PICO_WARNING, + PICO_ERROR, + PICO_FATAL +} +picoPrintLevel_t; + +typedef struct picoSurface_s picoSurface_t; +typedef struct picoShader_s picoShader_t; +typedef struct picoModel_s picoModel_t; +typedef struct picoModule_s picoModule_t; + +struct picoSurface_s +{ + void *data; + + picoModel_t *model; /* owner model */ + + picoSurfaceType_t type; + char *name; /* sea: surface name */ + picoShader_t *shader; /* ydnar: changed to ptr */ + + int numVertexes, maxVertexes; + picoVec3_t *xyz; + picoVec3_t *normal; + picoIndex_t *smoothingGroup; + + int numSTArrays, maxSTArrays; + picoVec2_t **st; + + int numColorArrays, maxColorArrays; + picoColor_t **color; + + int numIndexes, maxIndexes; + picoIndex_t *index; + + int numFaceNormals, maxFaceNormals; + picoVec3_t *faceNormal; + + int special[ PICO_MAX_SPECIAL ]; +}; + + +/* seaw0lf */ +struct picoShader_s +{ + picoModel_t *model; /* owner model */ + + char *name; /* shader name */ + char *mapName; /* shader file name (name of diffuse texturemap) */ + picoColor_t ambientColor; /* ambient color of mesh (rgba) */ + picoColor_t diffuseColor; /* diffuse color of mesh (rgba) */ + picoColor_t specularColor; /* specular color of mesh (rgba) */ + float transparency; /* transparency (0..1; 1 = 100% transparent) */ + float shininess; /* shininess (0..128; 128 = 100% shiny) */ +}; + +struct picoModel_s +{ + void *data; + char *name; /* model name */ + char *fileName; /* sea: model file name */ + int frameNum; /* sea: renamed to frameNum */ + int numFrames; /* sea: number of frames */ + picoVec3_t mins; + picoVec3_t maxs; + + int numShaders, maxShaders; + picoShader_t **shader; + + int numSurfaces, maxSurfaces; + picoSurface_t **surface; + + const picoModule_t *module; /* sea */ +}; + + +/* seaw0lf */ +/* return codes used by the validation callbacks; pmv is short */ +/* for 'pico module validation'. everything >PICO_PMV_OK means */ +/* that there was an error. */ +enum +{ + PICO_PMV_OK, /* file valid */ + PICO_PMV_ERROR, /* file not valid */ + PICO_PMV_ERROR_IDENT, /* unknown file magic (aka ident) */ + PICO_PMV_ERROR_VERSION, /* unsupported file version */ + PICO_PMV_ERROR_SIZE, /* file size error */ + PICO_PMV_ERROR_MEMORY, /* out of memory error */ +}; + +/* convenience (makes it easy to add new params to the callbacks) */ +#define PM_PARAMS_CANLOAD \ + const char *fileName, const void *buffer, int bufSize + +#define PM_PARAMS_LOAD \ + const char *fileName, int frameNum, const void *buffer, int bufSize + +#define PM_PARAMS_CANSAVE \ + void + +#define PM_PARAMS_SAVE \ + const char *fileName, picoModel_t * model + +/* pico file format module structure */ +struct picoModule_s +{ + char *version; /* internal module version (e.g. '1.5-b2') */ + + char *displayName; /* string used to display in guis, etc. */ + char *authorName; /* author name (eg. 'My Real Name') */ + char *copyright; /* copyright year and holder (eg. '2002 My Company') */ + + char *defaultExts[ PICO_MAX_DEFAULT_EXTS ]; /* default file extensions used by this file type */ + int ( *canload )( PM_PARAMS_CANLOAD ); /* checks whether module can load given file (returns PMVR_*) */ + picoModel_t *( *load )( PM_PARAMS_LOAD ); /* parses model file data */ + int ( *cansave )( PM_PARAMS_CANSAVE ); /* checks whether module can save (returns 1 or 0 and might spit out a message) */ + int ( *save )( PM_PARAMS_SAVE ); /* saves a pico model in module's native model format */ +}; + + + +/* general functions */ +int PicoInit( void ); +void PicoShutdown( void ); +int PicoError( void ); + +void PicoSetMallocFunc( void *( *func )( size_t ) ); +void PicoSetFreeFunc( void ( *func )( void* ) ); +void PicoSetLoadFileFunc( void ( *func )( const char*, unsigned char**, int* ) ); +void PicoSetFreeFileFunc( void ( *func )( void* ) ); +void PicoSetPrintFunc( void ( *func )( int, const char* ) ); + +const picoModule_t **PicoModuleList( int *numModules ); + +picoModel_t *PicoLoadModel( const char *name, int frameNum ); + +typedef size_t ( *PicoInputStreamReadFunc )( void* inputStream, unsigned char* buffer, size_t length ); +picoModel_t* PicoModuleLoadModelStream( const picoModule_t* module, void* inputStream, PicoInputStreamReadFunc inputStreamRead, size_t streamLength, int frameNum, const char *fileName ); + +/* model functions */ +picoModel_t *PicoNewModel( void ); +void PicoFreeModel( picoModel_t *model ); +int PicoAdjustModel( picoModel_t *model, int numShaders, int numSurfaces ); + + +/* shader functions */ +picoShader_t *PicoNewShader( picoModel_t *model ); +void PicoFreeShader( picoShader_t *shader ); +picoShader_t *PicoFindShader( picoModel_t *model, char *name, int caseSensitive ); + + +/* surface functions */ +picoSurface_t *PicoNewSurface( picoModel_t *model ); +void PicoFreeSurface( picoSurface_t *surface ); +picoSurface_t *PicoFindSurface( picoModel_t *model, char *name, int caseSensitive ); +int PicoAdjustSurface( picoSurface_t *surface, int numVertexes, int numSTArrays, int numColorArrays, int numIndexes, int numFaceNormals ); + + +/* setter functions */ +void PicoSetModelName( picoModel_t *model, const char *name ); +void PicoSetModelFileName( picoModel_t *model, const char *fileName ); +void PicoSetModelFrameNum( picoModel_t *model, int frameNum ); +void PicoSetModelNumFrames( picoModel_t *model, int numFrames ); +void PicoSetModelData( picoModel_t *model, void *data ); + +void PicoSetShaderName( picoShader_t *shader, char *name ); +void PicoSetShaderMapName( picoShader_t *shader, char *mapName ); +void PicoSetShaderAmbientColor( picoShader_t *shader, picoColor_t color ); +void PicoSetShaderDiffuseColor( picoShader_t *shader, picoColor_t color ); +void PicoSetShaderSpecularColor( picoShader_t *shader, picoColor_t color ); +void PicoSetShaderTransparency( picoShader_t *shader, float value ); +void PicoSetShaderShininess( picoShader_t *shader, float value ); + +void PicoSetSurfaceData( picoSurface_t *surface, void *data ); +void PicoSetSurfaceType( picoSurface_t *surface, picoSurfaceType_t type ); +void PicoSetSurfaceName( picoSurface_t *surface, const char *name ); +void PicoSetSurfaceShader( picoSurface_t *surface, picoShader_t *shader ); +void PicoSetSurfaceXYZ( picoSurface_t *surface, int num, picoVec3_t xyz ); +void PicoSetSurfaceNormal( picoSurface_t *surface, int num, picoVec3_t normal ); +void PicoSetSurfaceST( picoSurface_t *surface, int array, int num, picoVec2_t st ); +void PicoSetSurfaceColor( picoSurface_t *surface, int array, int num, picoColor_t color ); +void PicoSetSurfaceIndex( picoSurface_t *surface, int num, picoIndex_t index ); +void PicoSetSurfaceIndexes( picoSurface_t *surface, int num, picoIndex_t *index, int count ); +void PicoSetFaceNormal( picoSurface_t *surface, int num, picoVec3_t normal ); +void PicoSetSurfaceSpecial( picoSurface_t *surface, int num, int special ); +void PicoSetSurfaceSmoothingGroup( picoSurface_t *surface, int num, picoIndex_t smoothingGroup ); + + +/* getter functions */ +char *PicoGetModelName( picoModel_t *model ); +char *PicoGetModelFileName( picoModel_t *model ); +int PicoGetModelFrameNum( picoModel_t *model ); +int PicoGetModelNumFrames( picoModel_t *model ); +void *PicoGetModelData( picoModel_t *model ); +int PicoGetModelNumShaders( picoModel_t *model ); +picoShader_t *PicoGetModelShader( picoModel_t *model, int num ); /* sea */ +int PicoGetModelNumSurfaces( picoModel_t *model ); +picoSurface_t *PicoGetModelSurface( picoModel_t *model, int num ); +int PicoGetModelTotalVertexes( picoModel_t *model ); +int PicoGetModelTotalIndexes( picoModel_t *model ); + +char *PicoGetShaderName( picoShader_t *shader ); +char *PicoGetShaderMapName( picoShader_t *shader ); +picoByte_t *PicoGetShaderAmbientColor( picoShader_t *shader ); +picoByte_t *PicoGetShaderDiffuseColor( picoShader_t *shader ); +picoByte_t *PicoGetShaderSpecularColor( picoShader_t *shader ); +float PicoGetShaderTransparency( picoShader_t *shader ); +float PicoGetShaderShininess( picoShader_t *shader ); + +void *PicoGetSurfaceData( picoSurface_t *surface ); +char *PicoGetSurfaceName( picoSurface_t *surface ); /* sea */ +picoSurfaceType_t PicoGetSurfaceType( picoSurface_t *surface ); +char *PicoGetSurfaceName( picoSurface_t *surface ); +picoShader_t *PicoGetSurfaceShader( picoSurface_t *surface ); /* sea */ + +int PicoGetSurfaceNumVertexes( picoSurface_t *surface ); +picoVec_t *PicoGetSurfaceXYZ( picoSurface_t *surface, int num ); +picoVec_t *PicoGetSurfaceNormal( picoSurface_t *surface, int num ); +picoVec_t *PicoGetSurfaceST( picoSurface_t *surface, int array, int num ); +picoByte_t *PicoGetSurfaceColor( picoSurface_t *surface, int array, int num ); +int PicoGetSurfaceNumIndexes( picoSurface_t *surface ); +picoIndex_t PicoGetSurfaceIndex( picoSurface_t *surface, int num ); +picoIndex_t *PicoGetSurfaceIndexes( picoSurface_t *surface, int num ); +picoVec_t *PicoGetFaceNormal( picoSurface_t *surface, int num ); +int PicoGetSurfaceSpecial( picoSurface_t *surface, int num ); + + +/* hashtable related functions */ +typedef struct picoVertexCombinationData_s +{ + picoVec3_t xyz, normal; + picoVec2_t st; + picoColor_t color; +} picoVertexCombinationData_t; + +typedef struct picoVertexCombinationHash_s +{ + picoVertexCombinationData_t vcd; + picoIndex_t index; + + void *data; + + struct picoVertexCombinationHash_s *next; +} picoVertexCombinationHash_t; + +int PicoGetHashTableSize( void ); +unsigned int PicoVertexCoordGenerateHash( picoVec3_t xyz ); +picoVertexCombinationHash_t **PicoNewVertexCombinationHashTable( void ); +void PicoFreeVertexCombinationHashTable( picoVertexCombinationHash_t **hashTable ); +picoVertexCombinationHash_t *PicoFindVertexCombinationInHashTable( picoVertexCombinationHash_t **hashTable, picoVec3_t xyz, picoVec3_t normal, picoVec3_t st, picoColor_t color ); +picoVertexCombinationHash_t *PicoAddVertexCombinationToHashTable( picoVertexCombinationHash_t **hashTable, picoVec3_t xyz, picoVec3_t normal, picoVec3_t st, picoColor_t color, picoIndex_t index ); + +/* specialized functions */ +int PicoFindSurfaceVertexNum( picoSurface_t *surface, picoVec3_t xyz, picoVec3_t normal, int numSTs, picoVec2_t *st, int numColors, picoColor_t *color, picoIndex_t smoothingGroup ); +void PicoFixSurfaceNormals( picoSurface_t *surface ); +int PicoRemapModel( picoModel_t *model, char *remapFile ); + + +void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** normals, int numSTs, picoVec2_t **st, int numColors, picoColor_t **colors, picoShader_t* shader, const char *name, picoIndex_t* smoothingGroup ); + +/* end marker */ +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libs/pivot.cpp b/libs/pivot.cpp deleted file mode 100644 index adc9ef21..00000000 --- a/libs/pivot.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "pivot.h" diff --git a/libs/profile/CMakeLists.txt b/libs/profile/CMakeLists.txt index 799c568a..e3822f42 100644 --- a/libs/profile/CMakeLists.txt +++ b/libs/profile/CMakeLists.txt @@ -1,6 +1,4 @@ add_library(profile - file.cpp - file.h - profile.cpp - profile.h -) + file.cpp file.h + profile.cpp profile.h + ) diff --git a/libs/render.cpp b/libs/render.cpp deleted file mode 100644 index be1c49a6..00000000 --- a/libs/render.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "render.h" diff --git a/libs/scenelib.cpp b/libs/scenelib.cpp deleted file mode 100644 index a1754d08..00000000 --- a/libs/scenelib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "scenelib.h" diff --git a/libs/script/CMakeLists.txt b/libs/script/CMakeLists.txt index e6dde8b2..b3fd7140 100644 --- a/libs/script/CMakeLists.txt +++ b/libs/script/CMakeLists.txt @@ -1,6 +1,5 @@ add_library(script - scripttokeniser.cpp - scripttokeniser.h - scripttokenwriter.cpp - scripttokenwriter.h -) + scripttokeniser.h + scripttokenwriter.h + ) +set_target_properties(script PROPERTIES LINKER_LANGUAGE CXX) diff --git a/libs/script/scripttokeniser.cpp b/libs/script/scripttokeniser.cpp deleted file mode 100644 index 1b4ee4cb..00000000 --- a/libs/script/scripttokeniser.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "scripttokeniser.h" diff --git a/libs/script/scripttokenwriter.cpp b/libs/script/scripttokenwriter.cpp deleted file mode 100644 index 753aab7a..00000000 --- a/libs/script/scripttokenwriter.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "scripttokenwriter.h" diff --git a/libs/selectionlib.cpp b/libs/selectionlib.cpp deleted file mode 100644 index cc85fe65..00000000 --- a/libs/selectionlib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "selectionlib.h" diff --git a/libs/shaderlib.cpp b/libs/shaderlib.cpp deleted file mode 100644 index 454bd4f0..00000000 --- a/libs/shaderlib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "shaderlib.h" diff --git a/libs/signal/CMakeLists.txt b/libs/signal/CMakeLists.txt index 26d0ecb7..499a4838 100644 --- a/libs/signal/CMakeLists.txt +++ b/libs/signal/CMakeLists.txt @@ -1,8 +1,5 @@ add_library(signal - isignal.cpp - isignal.h - signal.cpp - signal.h - signalfwd.cpp - signalfwd.h -) + isignal.h + signal.cpp signal.h + signalfwd.h + ) diff --git a/libs/signal/isignal.cpp b/libs/signal/isignal.cpp deleted file mode 100644 index 5eafd5e2..00000000 --- a/libs/signal/isignal.cpp +++ /dev/null @@ -1,2 +0,0 @@ - -#include "isignal.h" diff --git a/libs/signal/signalfwd.cpp b/libs/signal/signalfwd.cpp deleted file mode 100644 index fedf5157..00000000 --- a/libs/signal/signalfwd.cpp +++ /dev/null @@ -1,2 +0,0 @@ - -#include "signalfwd.h" diff --git a/libs/splines/CMakeLists.txt b/libs/splines/CMakeLists.txt index 9b942704..3a6b603d 100644 --- a/libs/splines/CMakeLists.txt +++ b/libs/splines/CMakeLists.txt @@ -1,18 +1,11 @@ add_library(splines - math_angles.cpp - math_angles.h - math_matrix.cpp - math_matrix.h - math_quaternion.cpp - math_quaternion.h - math_vector.cpp - math_vector.h - q_parse.cpp - q_shared.cpp - q_shared.h - splines.cpp - splines.h - util_list.h - util_str.cpp - util_str.h -) + math_angles.cpp math_angles.h + math_matrix.cpp math_matrix.h + math_quaternion.cpp math_quaternion.h + math_vector.cpp math_vector.h + q_parse.cpp + q_shared.cpp q_shared.h + splines.cpp splines.h + util_list.h + util_str.cpp util_str.h + ) diff --git a/libs/str.cpp b/libs/str.cpp deleted file mode 100644 index c63ef945..00000000 --- a/libs/str.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (c) 2001, Loki software, inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this list - of conditions and the following disclaimer. - - 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. - - Neither the name of Loki software nor the names of its contributors may be used - to endorse or promote products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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. - */ - -#include "str.h" diff --git a/libs/stream/CMakeLists.txt b/libs/stream/CMakeLists.txt index daf02495..a37c4591 100644 --- a/libs/stream/CMakeLists.txt +++ b/libs/stream/CMakeLists.txt @@ -1,12 +1,8 @@ add_library(stream - filestream.cpp - filestream.h - memstream.cpp - memstream.h - stringstream.cpp - stringstream.h - textfilestream.cpp - textfilestream.h - textstream.cpp - textstream.h -) + filestream.h + memstream.h + stringstream.h + textfilestream.h + textstream.h + ) +set_target_properties(stream PROPERTIES LINKER_LANGUAGE CXX) diff --git a/libs/stream/filestream.cpp b/libs/stream/filestream.cpp deleted file mode 100644 index 33f12062..00000000 --- a/libs/stream/filestream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "filestream.h" diff --git a/libs/stream/memstream.cpp b/libs/stream/memstream.cpp deleted file mode 100644 index c7c8d1b6..00000000 --- a/libs/stream/memstream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "memstream.h" diff --git a/libs/stream/stringstream.cpp b/libs/stream/stringstream.cpp deleted file mode 100644 index 8e9da6e8..00000000 --- a/libs/stream/stringstream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "stringstream.h" diff --git a/libs/stream/textfilestream.cpp b/libs/stream/textfilestream.cpp deleted file mode 100644 index e1024e47..00000000 --- a/libs/stream/textfilestream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "textfilestream.h" diff --git a/libs/stream/textstream.cpp b/libs/stream/textstream.cpp deleted file mode 100644 index cfbdedd8..00000000 --- a/libs/stream/textstream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "textstream.h" diff --git a/libs/string/CMakeLists.txt b/libs/string/CMakeLists.txt index ca497230..e958f294 100644 --- a/libs/string/CMakeLists.txt +++ b/libs/string/CMakeLists.txt @@ -1,5 +1,4 @@ add_library(string - pooledstring.cpp - pooledstring.h - string.h -) + pooledstring.cpp pooledstring.h + string.h + ) diff --git a/libs/stringio.cpp b/libs/stringio.cpp deleted file mode 100644 index a6e741f0..00000000 --- a/libs/stringio.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "stringio.h" diff --git a/libs/texturelib.cpp b/libs/texturelib.cpp deleted file mode 100644 index 00bde65a..00000000 --- a/libs/texturelib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "texturelib.h" diff --git a/libs/transformlib.cpp b/libs/transformlib.cpp deleted file mode 100644 index ec82140c..00000000 --- a/libs/transformlib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "transformlib.h" diff --git a/libs/traverselib.cpp b/libs/traverselib.cpp deleted file mode 100644 index 57e1dfbe..00000000 --- a/libs/traverselib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "traverselib.h" diff --git a/libs/typesystem.cpp b/libs/typesystem.cpp deleted file mode 100644 index 755f05e0..00000000 --- a/libs/typesystem.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "typesystem.h" diff --git a/libs/uilib/CMakeLists.txt b/libs/uilib/CMakeLists.txt index 4eccdd3d..4950c1e2 100644 --- a/libs/uilib/CMakeLists.txt +++ b/libs/uilib/CMakeLists.txt @@ -1,4 +1,6 @@ add_library(uilib - uilib.cpp - uilib.h -) + uilib.cpp uilib.h + ) + +find_package(GTK2 REQUIRED) +target_include_directories(uilib PRIVATE ${GTK2_INCLUDE_DIRS}) diff --git a/libs/undolib.cpp b/libs/undolib.cpp deleted file mode 100644 index 8ebe6aa3..00000000 --- a/libs/undolib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "undolib.h" diff --git a/libs/uniquenames.cpp b/libs/uniquenames.cpp deleted file mode 100644 index 0515b68c..00000000 --- a/libs/uniquenames.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "uniquenames.h" diff --git a/libs/versionlib.cpp b/libs/versionlib.cpp deleted file mode 100644 index 74799acf..00000000 --- a/libs/versionlib.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "versionlib.h" diff --git a/libs/xml/CMakeLists.txt b/libs/xml/CMakeLists.txt index 7c01ac15..4fb6606a 100644 --- a/libs/xml/CMakeLists.txt +++ b/libs/xml/CMakeLists.txt @@ -1,16 +1,14 @@ -find_package(LibXml2 REQUIRED) -include_directories(${LIBXML2_INCLUDE_DIR}) - add_library(xmllib - ixml.cpp - ixml.h - xmlelement.cpp - xmlelement.h - xmlparser.cpp - xmlparser.h - xmltextags.cpp - xmltextags.h - xmlwriter.cpp - xmlwriter.h -) + ixml.h + xmlelement.h + xmlparser.h + xmltextags.cpp xmltextags.h + xmlwriter.h + ) + +find_package(GLIB REQUIRED) +target_include_directories(xmllib PUBLIC ${GLIB_INCLUDE_DIRS}) + +find_package(LibXml2 REQUIRED) +target_include_directories(xmllib PUBLIC ${LIBXML2_INCLUDE_DIR}) target_link_libraries(xmllib ${LIBXML2_LIBRARIES}) diff --git a/libs/xml/ixml.cpp b/libs/xml/ixml.cpp deleted file mode 100644 index d4caeb55..00000000 --- a/libs/xml/ixml.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "ixml.h" diff --git a/libs/xml/xmlelement.cpp b/libs/xml/xmlelement.cpp deleted file mode 100644 index 2ba39437..00000000 --- a/libs/xml/xmlelement.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "xmlelement.h" diff --git a/libs/xml/xmlelement.h b/libs/xml/xmlelement.h index 58f60aa7..6983beb8 100644 --- a/libs/xml/xmlelement.h +++ b/libs/xml/xmlelement.h @@ -22,7 +22,7 @@ #if !defined( INCLUDED_XML_XMLELEMENT_H ) #define INCLUDED_XML_XMLELEMENT_H -#include "xml/ixml.h" +#include "ixml.h" #include "string/string.h" #include diff --git a/libs/xml/xmlparser.cpp b/libs/xml/xmlparser.cpp deleted file mode 100644 index 8ef5d0b4..00000000 --- a/libs/xml/xmlparser.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "xmlparser.h" diff --git a/libs/xml/xmlwriter.cpp b/libs/xml/xmlwriter.cpp deleted file mode 100644 index 87668972..00000000 --- a/libs/xml/xmlwriter.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "xmlwriter.h" diff --git a/mingw-Makefile.conf b/mingw-Makefile.conf deleted file mode 100644 index a1281826..00000000 --- a/mingw-Makefile.conf +++ /dev/null @@ -1,18 +0,0 @@ -# Usage: -# copy this file to Makefile.conf -# edit the paths in here - -# how to get pkg-config -PKGCONFIG ?= $(RADIANT_DEPENDENCIES_PREFIX)/gtk/bin/pkg-config.exe - -# extra utils -GIT ?= $(RADIANT_DEPENDENCIES_PREFIX)/util/bin/git -SVN ?= $(RADIANT_DEPENDENCIES_PREFIX)/util/bin/svn - -# these two need the "start" workaround, or they seem to crash (TODO figure out why) -WGET ?= start $(RADIANT_DEPENDENCIES_PREFIX)/util/bin/wget -UNZIPPER ?= start $(RADIANT_DEPENDENCIES_PREFIX)/util/bin/unzip - -# use mingw32 -include mingw-Makefile.inc -include mingw-radiantdeps-Makefile.inc diff --git a/mingw-Makefile.inc b/mingw-Makefile.inc deleted file mode 100644 index d72cfe2b..00000000 --- a/mingw-Makefile.inc +++ /dev/null @@ -1,15 +0,0 @@ -# how to call the mingw tools -MINGW_EXEC_PREFIX ?= - -# set the environment for make -OS = Win32 - -#CPPFLAGS_XML = -#LIBS_XML = -lxml2 - -CC = $(MINGW_EXEC_PREFIX)gcc -CXX = $(MINGW_EXEC_PREFIX)g++ -LDD = -RANLIB = $(MINGW_EXEC_PREFIX)ranlib -AR = $(MINGW_EXEC_PREFIX)ar -WINDRES = $(MINGW_EXEC_PREFIX)windres diff --git a/mingw-fedora-Makefile.conf b/mingw-fedora-Makefile.conf deleted file mode 100644 index d957d4d5..00000000 --- a/mingw-fedora-Makefile.conf +++ /dev/null @@ -1,17 +0,0 @@ -# Usage: -# copy this file to Makefile.conf -# edit the paths in here - -# how to call the mingw tools -MINGW_TARGET_ARCH=i686 -#MINGW_TARGET_ARCH=x86_64 -MINGW_EXEC_PREFIX = $(MINGW_TARGET_ARCH)-w64-mingw32- - -# use custom pkg-config -PKGCONFIG = $(MINGW_EXEC_PREFIX)pkg-config - -# use custom dll install script -DLLINSTALL = install-dlls-fedora.sh - -# use mingw32 -include mingw-Makefile.inc diff --git a/mingw-radiantdeps-Makefile.inc b/mingw-radiantdeps-Makefile.inc deleted file mode 100644 index 82e750ee..00000000 --- a/mingw-radiantdeps-Makefile.inc +++ /dev/null @@ -1,15 +0,0 @@ -# where the dependencies package is extracted -RADIANT_DEPENDENCIES_PREFIX = $(HOME)/netradiant-dependencies-mingw32/ - -# run the prefix fixing tool -IGNORETHIS := $(shell cd $(RADIANT_DEPENDENCIES_PREFIX) && ./fixprefix.sh) - -# set the environment for make -CFLAGS += -CXXFLAGS += -CPPFLAGS += -I$(RADIANT_DEPENDENCIES_PREFIX)/radiantdeps/include -LDFLAGS += -L$(RADIANT_DEPENDENCIES_PREFIX)/radiantdeps/lib -CPPFLAGS += -I$(RADIANT_DEPENDENCIES_PREFIX)/gtk/include -LDFLAGS += -L$(RADIANT_DEPENDENCIES_PREFIX)/gtk/lib -PKG_CONFIG_PATH := $(RADIANT_DEPENDENCIES_PREFIX)/gtk/lib/pkgconfig:$(RADIANT_DEPENDENCIES_PREFIX)/radiantdeps/lib/pkgconfig:$(PKG_CONFIG_PATH) -WHICHDLL = $(RADIANT_DEPENDENCIES_PREFIX)/whichdll.sh diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 69311961..b5f2a7af 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -1,12 +1,6 @@ include_directories("${CMAKE_SOURCE_DIR}/libs") include_directories("${CMAKE_SOURCE_DIR}/include") -find_package(GTK2 REQUIRED) -include_directories(${GTK2_INCLUDE_DIRS} ${GTK2_GDK_INCLUDE_DIR} ${GTK2_GLIB_INCLUDE_DIR}) - -find_package(LibXml2 REQUIRED) -include_directories(${LIBXML2_INCLUDE_DIR}) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules") add_custom_target(modules) diff --git a/plugins/archivepak/CMakeLists.txt b/plugins/archivepak/CMakeLists.txt index bc11e423..817cc030 100644 --- a/plugins/archivepak/CMakeLists.txt +++ b/plugins/archivepak/CMakeLists.txt @@ -1,8 +1,5 @@ radiant_plugin(archivepak - archive.cpp - archive.h - pak.cpp - pak.h - plugin.cpp - plugin.h -) + archive.cpp archive.h + pak.h + plugin.cpp + ) diff --git a/plugins/archivepak/archive.cpp b/plugins/archivepak/archive.cpp index 46215ef6..ac0419de 100644 --- a/plugins/archivepak/archive.cpp +++ b/plugins/archivepak/archive.cpp @@ -22,7 +22,7 @@ #include "archive.h" #include "idatastream.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "bytestreamutils.h" #include #include "stream/filestream.h" @@ -31,9 +31,6 @@ #include "archivelib.h" - -#include "plugin.h" - #include #include "string/string.h" #include "fs_filesystem.h" diff --git a/plugins/archivepak/pak.cpp b/plugins/archivepak/pak.cpp deleted file mode 100644 index f0b9c483..00000000 --- a/plugins/archivepak/pak.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "pak.h" diff --git a/plugins/archivepak/plugin.cpp b/plugins/archivepak/plugin.cpp index e334248e..489af0b3 100644 --- a/plugins/archivepak/plugin.cpp +++ b/plugins/archivepak/plugin.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "plugin.h" - #include "iarchive.h" #include "debugging/debugging.h" diff --git a/plugins/archivepak/plugin.h b/plugins/archivepak/plugin.h deleted file mode 100644 index 443a80e6..00000000 --- a/plugins/archivepak/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_PLUGIN_H ) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/archivewad/CMakeLists.txt b/plugins/archivewad/CMakeLists.txt index 8f561e30..acafeee1 100644 --- a/plugins/archivewad/CMakeLists.txt +++ b/plugins/archivewad/CMakeLists.txt @@ -1,9 +1,5 @@ - radiant_plugin(archivewad - archive.cpp - archive.h - plugin.cpp - plugin.h - wad.cpp - wad.h -) + archive.cpp archive.h + plugin.cpp + wad.h + ) diff --git a/plugins/archivewad/archive.cpp b/plugins/archivewad/archive.cpp index b9490bf9..633c0f56 100644 --- a/plugins/archivewad/archive.cpp +++ b/plugins/archivewad/archive.cpp @@ -22,7 +22,7 @@ #include "archive.h" #include "idatastream.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "bytestreamutils.h" #include #include "stream/filestream.h" @@ -31,8 +31,6 @@ #include "archivelib.h" -#include "plugin.h" - #include #include "string/string.h" diff --git a/plugins/archivewad/plugin.cpp b/plugins/archivewad/plugin.cpp index 2ade32ab..95813572 100644 --- a/plugins/archivewad/plugin.cpp +++ b/plugins/archivewad/plugin.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "plugin.h" - #include "iarchive.h" #include "debugging/debugging.h" diff --git a/plugins/archivewad/plugin.h b/plugins/archivewad/plugin.h deleted file mode 100644 index 443a80e6..00000000 --- a/plugins/archivewad/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_PLUGIN_H ) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/archivewad/wad.cpp b/plugins/archivewad/wad.cpp deleted file mode 100644 index 778d0c66..00000000 --- a/plugins/archivewad/wad.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "wad.h" diff --git a/plugins/archivezip/CMakeLists.txt b/plugins/archivezip/CMakeLists.txt index bb4357b6..026b1aa7 100644 --- a/plugins/archivezip/CMakeLists.txt +++ b/plugins/archivezip/CMakeLists.txt @@ -1,16 +1,9 @@ - radiant_plugin(archivezip - archive.cpp - archive.h - pkzip.cpp - pkzip.h - plugin.cpp - plugin.h - zlibstream.cpp - zlibstream.h -) + archive.cpp archive.h + pkzip.h + plugin.cpp + zlibstream.h + ) find_package(ZLIB REQUIRED) -include_directories(${ZLIB_INCLUDE_DIRS}) - -target_link_libraries(archivezip ${ZLIB_LIBRARIES}) +target_include_directories(archivezip PRIVATE ${ZLIB_INCLUDE_DIRS}) diff --git a/plugins/archivezip/archive.cpp b/plugins/archivezip/archive.cpp index 2c29a139..84bd2ffd 100644 --- a/plugins/archivezip/archive.cpp +++ b/plugins/archivezip/archive.cpp @@ -20,7 +20,7 @@ */ #include "idatastream.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "bytestreamutils.h" #include "modulesystem.h" diff --git a/plugins/archivezip/pkzip.cpp b/plugins/archivezip/pkzip.cpp deleted file mode 100644 index 80c73d4f..00000000 --- a/plugins/archivezip/pkzip.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "pkzip.h" diff --git a/plugins/archivezip/plugin.cpp b/plugins/archivezip/plugin.cpp index 8375eafa..d863e279 100644 --- a/plugins/archivezip/plugin.cpp +++ b/plugins/archivezip/plugin.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "plugin.h" - #include "iarchive.h" #include "debugging/debugging.h" diff --git a/plugins/archivezip/plugin.h b/plugins/archivezip/plugin.h deleted file mode 100644 index 443a80e6..00000000 --- a/plugins/archivezip/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_PLUGIN_H ) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/archivezip/zlibstream.cpp b/plugins/archivezip/zlibstream.cpp deleted file mode 100644 index c47fa2a3..00000000 --- a/plugins/archivezip/zlibstream.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "zlibstream.h" diff --git a/plugins/config.mk b/plugins/config.mk deleted file mode 100644 index 8b97a39c..00000000 --- a/plugins/config.mk +++ /dev/null @@ -1,32 +0,0 @@ -# Common configuration options for all plugins - -CC=gcc -CXX=g++ -CFLAGS+=`gtk-config --cflags` -Wall -g -I../../include -CPPFLAGS+=`gtk-config --cflags` -Wall -g -I../../include -LDFLAGS+=`gtk-config --libs` -shared -OUTDIR=$(RADIANT_DATA)plugins -OBJS := $(patsubst %.cpp,%.o,$(filter %.cpp,$(SRC))) -OBJS += $(patsubst %.c,%.o,$(filter %.c,$(SRC))) - -all: $(OUTPUT) - -$(OUTPUT): $(OBJS) - $(CXX) -o $(OUTPUT) $(OBJS) $(LDFLAGS) - @if [ -d $(OUTDIR) ]; then cp $(OUTPUT) $(OUTDIR); fi - -## Other targets -.PHONY: clean - -clean: - rm -f *.o *.d $(OUTPUT) core - -## Dependencies --include $(OBJS:.o=.d) - -%.d: %.cpp - @echo -n "$(@) " > $@ - @if { !(eval $(CXX) -MM $(CPPFLAGS) -w $<) >> $@; }; then \ - rm -f $@; exit 1; \ - fi - @[ -s $@ ] || rm -f $@ diff --git a/plugins/entity/CMakeLists.txt b/plugins/entity/CMakeLists.txt index 669b8fb8..8799a3ec 100644 --- a/plugins/entity/CMakeLists.txt +++ b/plugins/entity/CMakeLists.txt @@ -1,49 +1,25 @@ - radiant_plugin(entity - angle.cpp - angle.h - angles.cpp - angles.h - colour.cpp - colour.h - curve.cpp - curve.h - doom3group.cpp - doom3group.h - eclassmodel.cpp - eclassmodel.h - entity.cpp - entity.h - filters.cpp - filters.h - generic.cpp - generic.h - group.cpp - group.h - keyobservers.cpp - keyobservers.h - light.cpp - light.h - miscmodel.cpp - miscmodel.h - model.cpp - model.h - modelskinkey.cpp - modelskinkey.h - namedentity.cpp - namedentity.h - namekeys.cpp - namekeys.h - origin.cpp - origin.h - plugin.cpp - plugin.h - rotation.cpp - rotation.h - scale.cpp - scale.h - skincache.cpp - skincache.h - targetable.cpp - targetable.h -) + angle.h + angles.h + colour.h + curve.h + doom3group.cpp doom3group.h + eclassmodel.cpp eclassmodel.h + entity.cpp entity.h + filters.cpp filters.h + generic.cpp generic.h + group.cpp group.h + keyobservers.h + light.cpp light.h + miscmodel.cpp miscmodel.h + model.h + modelskinkey.h + namedentity.h + namekeys.h + origin.h + plugin.cpp + rotation.h + scale.h + skincache.cpp skincache.h + targetable.cpp targetable.h + ) diff --git a/plugins/entity/angle.cpp b/plugins/entity/angle.cpp deleted file mode 100644 index 7dcbd36a..00000000 --- a/plugins/entity/angle.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "angle.h" diff --git a/plugins/entity/angles.cpp b/plugins/entity/angles.cpp deleted file mode 100644 index c1149166..00000000 --- a/plugins/entity/angles.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "angles.h" diff --git a/plugins/entity/colour.cpp b/plugins/entity/colour.cpp deleted file mode 100644 index 8c959888..00000000 --- a/plugins/entity/colour.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "colour.h" diff --git a/plugins/entity/curve.cpp b/plugins/entity/curve.cpp deleted file mode 100644 index e38d2a11..00000000 --- a/plugins/entity/curve.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "curve.h" diff --git a/plugins/entity/keyobservers.cpp b/plugins/entity/keyobservers.cpp deleted file mode 100644 index 210b1385..00000000 --- a/plugins/entity/keyobservers.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "keyobservers.h" diff --git a/plugins/entity/model.cpp b/plugins/entity/model.cpp deleted file mode 100644 index 74717a5f..00000000 --- a/plugins/entity/model.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "model.h" diff --git a/plugins/entity/modelskinkey.cpp b/plugins/entity/modelskinkey.cpp deleted file mode 100644 index 4567578f..00000000 --- a/plugins/entity/modelskinkey.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "modelskinkey.h" diff --git a/plugins/entity/namedentity.cpp b/plugins/entity/namedentity.cpp deleted file mode 100644 index 5edbf1c1..00000000 --- a/plugins/entity/namedentity.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "namedentity.h" diff --git a/plugins/entity/namekeys.cpp b/plugins/entity/namekeys.cpp deleted file mode 100644 index 7351c57b..00000000 --- a/plugins/entity/namekeys.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "namekeys.h" diff --git a/plugins/entity/origin.cpp b/plugins/entity/origin.cpp deleted file mode 100644 index c0c9b112..00000000 --- a/plugins/entity/origin.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "origin.h" diff --git a/plugins/entity/plugin.cpp b/plugins/entity/plugin.cpp index e8131e0b..58b6fb37 100644 --- a/plugins/entity/plugin.cpp +++ b/plugins/entity/plugin.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "plugin.h" - #include "debugging/debugging.h" #include "iscenegraph.h" diff --git a/plugins/entity/plugin.h b/plugins/entity/plugin.h deleted file mode 100644 index 443a80e6..00000000 --- a/plugins/entity/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_PLUGIN_H ) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/entity/rotation.cpp b/plugins/entity/rotation.cpp deleted file mode 100644 index 30d5b949..00000000 --- a/plugins/entity/rotation.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "rotation.h" diff --git a/plugins/entity/scale.cpp b/plugins/entity/scale.cpp deleted file mode 100644 index 3d5b989e..00000000 --- a/plugins/entity/scale.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "scale.h" diff --git a/plugins/image/CMakeLists.txt b/plugins/image/CMakeLists.txt index 4954696f..b5114d9f 100644 --- a/plugins/image/CMakeLists.txt +++ b/plugins/image/CMakeLists.txt @@ -1,21 +1,13 @@ - radiant_plugin(image - bmp.cpp - bmp.h - dds.cpp - dds.h - image.h - jpeg.cpp - jpeg.h - pcx.cpp - pcx.h - tga.cpp - tga.h - image.cpp - ktx.cpp - ktx.h -) + bmp.cpp bmp.h + dds.cpp dds.h + image.cpp + jpeg.cpp jpeg.h + ktx.cpp ktx.h + pcx.cpp pcx.h + tga.cpp tga.h + ) find_package(JPEG REQUIRED) -include_directories(${JPEG_INCLUDE_DIR}) +target_include_directories(image PRIVATE ${JPEG_INCLUDE_DIR}) target_link_libraries(image ddslib etclib ${JPEG_LIBRARIES}) diff --git a/plugins/image/dds.cpp b/plugins/image/dds.cpp index 2a6f0666..c52a9389 100644 --- a/plugins/image/dds.cpp +++ b/plugins/image/dds.cpp @@ -27,7 +27,7 @@ #include "iarchive.h" #include "idatastream.h" -#include "ddslib.h" +#include "ddslib/ddslib.h" #include "imagelib.h" Image* LoadDDSBuff( const byte* buffer ){ diff --git a/plugins/image/image.cpp b/plugins/image/image.cpp index 4f3e07a8..7d767f22 100644 --- a/plugins/image/image.cpp +++ b/plugins/image/image.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "image.h" - #include "ifilesystem.h" #include "iimage.h" diff --git a/plugins/image/image.h b/plugins/image/image.h deleted file mode 100644 index c61bcc20..00000000 --- a/plugins/image/image.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_IMAGE_H ) -#define INCLUDED_IMAGE_H - -#endif diff --git a/plugins/image/ktx.cpp b/plugins/image/ktx.cpp index 6837a2d8..9396add6 100644 --- a/plugins/image/ktx.cpp +++ b/plugins/image/ktx.cpp @@ -24,7 +24,7 @@ #include #include "bytestreamutils.h" -#include "etclib.h" +#include "etclib/etclib.h" #include "ifilesystem.h" #include "imagelib.h" diff --git a/plugins/imagehl/CMakeLists.txt b/plugins/imagehl/CMakeLists.txt index 0e7deb61..2e36ca19 100644 --- a/plugins/imagehl/CMakeLists.txt +++ b/plugins/imagehl/CMakeLists.txt @@ -1,10 +1,6 @@ radiant_plugin(imagehl - hlw.cpp - hlw.h - imagehl.cpp - imagehl.h - mip.cpp - mip.h - sprite.cpp - sprite.h -) + hlw.cpp hlw.h + imagehl.cpp + mip.cpp mip.h + sprite.cpp sprite.h + ) diff --git a/plugins/imagehl/imagehl.cpp b/plugins/imagehl/imagehl.cpp index 479a0d99..dfdf98b9 100644 --- a/plugins/imagehl/imagehl.cpp +++ b/plugins/imagehl/imagehl.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "imagehl.h" - #include "debugging/debugging.h" #include "ifilesystem.h" #include "iimage.h" diff --git a/plugins/imagehl/imagehl.h b/plugins/imagehl/imagehl.h deleted file mode 100644 index 6d0b7765..00000000 --- a/plugins/imagehl/imagehl.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_IMAGEHL_H ) -#define INCLUDED_IMAGEHL_H - -#endif diff --git a/plugins/imagepng/CMakeLists.txt b/plugins/imagepng/CMakeLists.txt index 786427a2..45da9433 100644 --- a/plugins/imagepng/CMakeLists.txt +++ b/plugins/imagepng/CMakeLists.txt @@ -1,9 +1,6 @@ radiant_plugin(imagepng - plugin.cpp - plugin.h -) + plugin.cpp + ) find_package(PNG REQUIRED) -include_directories(${PNG_INCLUDE_DIR}) - -target_link_libraries(imagepng ${PNG_LIBRARIES}) +target_include_directories(imagepng PRIVATE ${PNG_INCLUDE_DIR}) diff --git a/plugins/imagepng/plugin.cpp b/plugins/imagepng/plugin.cpp index 80233844..c33be6f8 100644 --- a/plugins/imagepng/plugin.cpp +++ b/plugins/imagepng/plugin.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "plugin.h" - #include "debugging/debugging.h" #include "ifilesystem.h" diff --git a/plugins/imagepng/plugin.h b/plugins/imagepng/plugin.h deleted file mode 100644 index 271a2ad2..00000000 --- a/plugins/imagepng/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_PLUGIN_H ) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/imageq2/CMakeLists.txt b/plugins/imageq2/CMakeLists.txt index 61cae0dd..942c7e09 100644 --- a/plugins/imageq2/CMakeLists.txt +++ b/plugins/imageq2/CMakeLists.txt @@ -1,9 +1,5 @@ - radiant_plugin(imageq2 - imageq2.cpp - imageq2.h - wal.cpp - wal.h - wal32.cpp - wal32.h -) + imageq2.cpp + wal.cpp wal.h + wal32.cpp wal32.h + ) diff --git a/plugins/imageq2/imageq2.cpp b/plugins/imageq2/imageq2.cpp index 62101667..9ea5c635 100644 --- a/plugins/imageq2/imageq2.cpp +++ b/plugins/imageq2/imageq2.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "imageq2.h" - #include "debugging/debugging.h" #include "ifilesystem.h" #include "iimage.h" diff --git a/plugins/imageq2/imageq2.h b/plugins/imageq2/imageq2.h deleted file mode 100644 index 38374374..00000000 --- a/plugins/imageq2/imageq2.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_IMAGEQ2_H ) -#define INCLUDED_IMAGEQ2_H - -#endif diff --git a/plugins/mapq3/CMakeLists.txt b/plugins/mapq3/CMakeLists.txt index 67521743..9b1136ea 100644 --- a/plugins/mapq3/CMakeLists.txt +++ b/plugins/mapq3/CMakeLists.txt @@ -1,8 +1,5 @@ radiant_plugin(mapq3 - parse.cpp - parse.h - plugin.cpp - plugin.h - write.cpp - write.h -) + parse.cpp parse.h + plugin.cpp + write.cpp write.h + ) diff --git a/plugins/mapq3/plugin.cpp b/plugins/mapq3/plugin.cpp index 87c08507..799c0788 100644 --- a/plugins/mapq3/plugin.cpp +++ b/plugins/mapq3/plugin.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "plugin.h" - #include "iscriplib.h" #include "ibrush.h" #include "ipatch.h" diff --git a/plugins/mapq3/plugin.h b/plugins/mapq3/plugin.h deleted file mode 100644 index 443a80e6..00000000 --- a/plugins/mapq3/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_PLUGIN_H ) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/mapxml/CMakeLists.txt b/plugins/mapxml/CMakeLists.txt index c57840c9..800e31fc 100644 --- a/plugins/mapxml/CMakeLists.txt +++ b/plugins/mapxml/CMakeLists.txt @@ -1,14 +1,7 @@ - radiant_plugin(mapxml - plugin.cpp - plugin.h - xmlparse.cpp - xmlparse.h - xmlwrite.cpp - xmlwrite.h -) - -find_package(LibXml2 REQUIRED) -include_directories(${LIBXML2_INCLUDE_DIR}) + plugin.cpp + xmlparse.cpp xmlparse.h + xmlwrite.cpp xmlwrite.h + ) -target_link_libraries(mapxml ${LIBXML2_LIBRARIES}) +target_link_libraries(mapxml xmllib) diff --git a/plugins/mapxml/plugin.cpp b/plugins/mapxml/plugin.cpp index ff776381..b144a415 100644 --- a/plugins/mapxml/plugin.cpp +++ b/plugins/mapxml/plugin.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "plugin.h" - #include "ibrush.h" #include "ipatch.h" #include "ifiletypes.h" diff --git a/plugins/mapxml/plugin.h b/plugins/mapxml/plugin.h deleted file mode 100644 index 443a80e6..00000000 --- a/plugins/mapxml/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_PLUGIN_H ) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/md3model/CMakeLists.txt b/plugins/md3model/CMakeLists.txt index 580c7419..1966759d 100644 --- a/plugins/md3model/CMakeLists.txt +++ b/plugins/md3model/CMakeLists.txt @@ -1,26 +1,14 @@ - radiant_plugin(md3model - ident.h - md2.cpp - md2.h - md3.cpp - md3.h - md3normals.cpp - md3normals.h - md5.cpp - md5.h - mdc.cpp - mdc.h - mdl.cpp - mdl.h - mdlformat.cpp - mdlformat.h - mdlimage.cpp - mdlimage.h - mdlnormals.cpp - mdlnormals.h - model.cpp - model.h - plugin.cpp - plugin.h -) + ident.h + md2.cpp md2.h + md3.cpp md3.h + md3normals.h + md5.cpp md5.h + mdc.cpp mdc.h + mdl.cpp mdl.h + mdlformat.h + mdlimage.cpp mdlimage.h + mdlnormals.h + model.h + plugin.cpp + ) diff --git a/plugins/md3model/md3normals.cpp b/plugins/md3model/md3normals.cpp deleted file mode 100644 index 94de3eaa..00000000 --- a/plugins/md3model/md3normals.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "md3normals.h" diff --git a/plugins/md3model/mdlformat.cpp b/plugins/md3model/mdlformat.cpp deleted file mode 100644 index 36a64b1d..00000000 --- a/plugins/md3model/mdlformat.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "mdlformat.h" diff --git a/plugins/md3model/mdlnormals.cpp b/plugins/md3model/mdlnormals.cpp deleted file mode 100644 index cea533d9..00000000 --- a/plugins/md3model/mdlnormals.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "mdlnormals.h" diff --git a/plugins/md3model/model.cpp b/plugins/md3model/model.cpp deleted file mode 100644 index 74717a5f..00000000 --- a/plugins/md3model/model.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "model.h" diff --git a/plugins/md3model/plugin.cpp b/plugins/md3model/plugin.cpp index 95fb5477..58c97677 100644 --- a/plugins/md3model/plugin.cpp +++ b/plugins/md3model/plugin.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "plugin.h" - #include "iscenegraph.h" #include "irender.h" #include "iselection.h" diff --git a/plugins/md3model/plugin.h b/plugins/md3model/plugin.h deleted file mode 100644 index 443a80e6..00000000 --- a/plugins/md3model/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_PLUGIN_H ) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/model/CMakeLists.txt b/plugins/model/CMakeLists.txt index c40b7249..bf55e1ff 100644 --- a/plugins/model/CMakeLists.txt +++ b/plugins/model/CMakeLists.txt @@ -1,9 +1,6 @@ - radiant_plugin(model - model.cpp - model.h - plugin.cpp - plugin.h -) + model.cpp model.h + plugin.cpp + ) target_link_libraries(model picomodel) diff --git a/plugins/model/model.cpp b/plugins/model/model.cpp index ee5f674b..b1524776 100644 --- a/plugins/model/model.cpp +++ b/plugins/model/model.cpp @@ -21,7 +21,7 @@ #include "model.h" -#include "picomodel.h" +#include "picomodel/picomodel.h" #include "iarchive.h" #include "idatastream.h" diff --git a/plugins/model/plugin.cpp b/plugins/model/plugin.cpp index 122cfa62..ef83d2a3 100644 --- a/plugins/model/plugin.cpp +++ b/plugins/model/plugin.cpp @@ -19,10 +19,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "plugin.h" - #include -#include "picomodel.h" +#include "picomodel/picomodel.h" typedef unsigned char byte; #include #include diff --git a/plugins/model/plugin.h b/plugins/model/plugin.h deleted file mode 100644 index 443a80e6..00000000 --- a/plugins/model/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_PLUGIN_H ) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/sample/CMakeLists.txt b/plugins/sample/CMakeLists.txt index e20f3ab2..b8b90b7c 100644 --- a/plugins/sample/CMakeLists.txt +++ b/plugins/sample/CMakeLists.txt @@ -1,5 +1,3 @@ - radiant_plugin(sample - sample.cpp - sample.h -) + sample.cpp + ) diff --git a/plugins/sample/sample.cpp b/plugins/sample/sample.cpp index df3ba904..1ef3db36 100644 --- a/plugins/sample/sample.cpp +++ b/plugins/sample/sample.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "sample.h" - #include "debugging/debugging.h" #include "iplugin.h" diff --git a/plugins/sample/sample.h b/plugins/sample/sample.h deleted file mode 100644 index c6bfe6ce..00000000 --- a/plugins/sample/sample.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_SAMPLE_H ) -#define INCLUDED_SAMPLE_H - -#endif diff --git a/plugins/shaders/CMakeLists.txt b/plugins/shaders/CMakeLists.txt index 1d1cbf14..9c4b38cc 100644 --- a/plugins/shaders/CMakeLists.txt +++ b/plugins/shaders/CMakeLists.txt @@ -1,12 +1,7 @@ - radiant_plugin(shaders - plugin.cpp - plugin.h - shaders.cpp - shaders.h -) + plugin.cpp + shaders.cpp shaders.h + ) find_package(GLIB REQUIRED) -include_directories(${GLIB_INCLUDE_DIRS}) - -target_link_libraries(shaders ${GLIB_LIBRARIES}) +target_include_directories(shaders PRIVATE ${GLIB_INCLUDE_DIRS}) diff --git a/plugins/shaders/plugin.cpp b/plugins/shaders/plugin.cpp index ee021936..4576a641 100644 --- a/plugins/shaders/plugin.cpp +++ b/plugins/shaders/plugin.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "plugin.h" - #include "ishaders.h" #include "ifilesystem.h" #include "itextures.h" diff --git a/plugins/shaders/plugin.h b/plugins/shaders/plugin.h deleted file mode 100644 index 443a80e6..00000000 --- a/plugins/shaders/plugin.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_PLUGIN_H ) -#define INCLUDED_PLUGIN_H - -#endif diff --git a/plugins/shaders/shaders.cpp b/plugins/shaders/shaders.cpp index 5532e224..06b808c2 100644 --- a/plugins/shaders/shaders.cpp +++ b/plugins/shaders/shaders.cpp @@ -64,7 +64,7 @@ #include "stringio.h" #include "shaderlib.h" #include "texturelib.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "moduleobservers.h" #include "archivelib.h" #include "imagelib.h" diff --git a/plugins/spritemodel/CMakeLists.txt b/plugins/spritemodel/CMakeLists.txt index 8ec0cb2e..da82c267 100644 --- a/plugins/spritemodel/CMakeLists.txt +++ b/plugins/spritemodel/CMakeLists.txt @@ -1,7 +1,4 @@ - radiant_plugin(spritemodel - plugin.cpp - plugin.h - spritemodel.cpp - spritemodel.h -) + plugin.cpp plugin.h + spritemodel.cpp spritemodel.h + ) diff --git a/plugins/spritemodel/plugin.h b/plugins/spritemodel/plugin.h index aa459c55..0d9697e0 100644 --- a/plugins/spritemodel/plugin.h +++ b/plugins/spritemodel/plugin.h @@ -29,7 +29,7 @@ #ifndef _PLUGIN_H_ #define _PLUGIN_H_ -#include "mathlib.h" +#include "mathlib/mathlib.h" #include #include "qertypes.h" #include diff --git a/plugins/textool/CMakeLists.txt b/plugins/textool/CMakeLists.txt index 113e4740..a5d5bab6 100644 --- a/plugins/textool/CMakeLists.txt +++ b/plugins/textool/CMakeLists.txt @@ -1,11 +1,7 @@ - radiant_plugin(textool - 2DView.cpp - 2DView.h - ControlPointsManager.cpp - ControlPointsManager.h - StdAfx.cpp - StdAfx.h - TexTool.cpp - resource.h -) + 2DView.cpp 2DView.h + ControlPointsManager.cpp ControlPointsManager.h + resource.h + StdAfx.h + TexTool.cpp + ) diff --git a/plugins/textool/StdAfx.cpp b/plugins/textool/StdAfx.cpp deleted file mode 100644 index 7fc09059..00000000 --- a/plugins/textool/StdAfx.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -// stdafx.cpp : source file that includes just the standard includes -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/plugins/textool/StdAfx.h b/plugins/textool/StdAfx.h index 12d58782..a5b0e264 100644 --- a/plugins/textool/StdAfx.h +++ b/plugins/textool/StdAfx.h @@ -87,7 +87,7 @@ extern "C" void Sys_Printf( char *text, ... ); #include "synapse.h" #include "iplugin.h" #include "qerplugin.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "igl.h" #include "iselectedface.h" #include "isurfaceplugin.h" diff --git a/plugins/vfspk3/CMakeLists.txt b/plugins/vfspk3/CMakeLists.txt index e1f3daa2..5591c598 100644 --- a/plugins/vfspk3/CMakeLists.txt +++ b/plugins/vfspk3/CMakeLists.txt @@ -1,14 +1,10 @@ - radiant_plugin(vfspk3 - archive.cpp - archive.h - vfs.cpp - vfs.h - vfspk3.cpp - vfspk3.h -) + archive.cpp archive.h + vfs.cpp vfs.h + vfspk3.cpp + ) find_package(GLIB REQUIRED) -include_directories(${GLIB_INCLUDE_DIRS}) +target_include_directories(vfspk3 PRIVATE ${GLIB_INCLUDE_DIRS}) -target_link_libraries(vfspk3 filematch ${GLIB_LIBRARIES}) +target_link_libraries(vfspk3 filematch) diff --git a/plugins/vfspk3/archive.cpp b/plugins/vfspk3/archive.cpp index 7b52e123..ef5e20ae 100644 --- a/plugins/vfspk3/archive.cpp +++ b/plugins/vfspk3/archive.cpp @@ -37,8 +37,6 @@ #include "archivelib.h" #include "fs_path.h" -#include "vfspk3.h" - class DirectoryArchive : public Archive { diff --git a/plugins/vfspk3/vfs.cpp b/plugins/vfspk3/vfs.cpp index b952f8ff..e5afd9ef 100644 --- a/plugins/vfspk3/vfs.cpp +++ b/plugins/vfspk3/vfs.cpp @@ -58,7 +58,7 @@ ArchiveModules& FileSystemQ3API_getArchiveModules(); #include "stream/stringstream.h" #include "os/path.h" #include "moduleobservers.h" -#include "filematch.h" +#include "filematch/filematch.h" #define VFS_MAXDIRS 64 diff --git a/plugins/vfspk3/vfspk3.cpp b/plugins/vfspk3/vfspk3.cpp index 478ce8f1..55b273ec 100644 --- a/plugins/vfspk3/vfspk3.cpp +++ b/plugins/vfspk3/vfspk3.cpp @@ -19,8 +19,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "vfspk3.h" - #include "qerplugin.h" #include "iarchive.h" #include "ifilesystem.h" diff --git a/plugins/vfspk3/vfspk3.h b/plugins/vfspk3/vfspk3.h deleted file mode 100644 index f5fb5c0b..00000000 --- a/plugins/vfspk3/vfspk3.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2001-2006, William Joseph. - All Rights Reserved. - - This file is part of GtkRadiant. - - GtkRadiant is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - GtkRadiant is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#if !defined( INCLUDED_VFSPK3_H ) -#define INCLUDED_VFSPK3_H - -#endif diff --git a/radiant/CMakeLists.txt b/radiant/CMakeLists.txt index 9879a55e..452407e1 100644 --- a/radiant/CMakeLists.txt +++ b/radiant/CMakeLists.txt @@ -1,4 +1,3 @@ - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") find_package(LibXml2 REQUIRED) @@ -7,6 +6,8 @@ include_directories(${LIBXML2_INCLUDE_DIR}) find_package(GTK2 REQUIRED) include_directories(${GTK2_INCLUDE_DIRS} ${GTK2_GDK_INCLUDE_DIR} ${GTK2_GLIB_INCLUDE_DIR}) +find_package(OpenGL REQUIRED) + find_package(GtkGLExt REQUIRED) include_directories(${GTKGL_INCLUDE_DIRS}) @@ -186,16 +187,20 @@ add_executable(radiant WIN32 radiant.rc ${RADIANTLIST}) target_link_libraries(radiant ${CMAKE_DL_LIBS} ${LIBXML2_LIBRARIES} - ${GTK2_LIBRARIES} ${OPENGL_gl_LIBRARY} + ${GTK2_LIBRARIES} + ${GTKGL_LIBRARIES} + includes cmdlib container ddslib debugging + etclib + filematch + generic gtkutil - ${GTKGL_LIBRARIES} l_net -# math + math mathlib md5lib memory @@ -211,6 +216,3 @@ target_link_libraries(radiant uilib xmllib ) -if(NOT WIN32) - target_link_libraries(radiant ${X11_LIBRARIES}) -endif() diff --git a/radiant/autosave.cpp b/radiant/autosave.cpp index b9f9b824..038e84a4 100644 --- a/radiant/autosave.cpp +++ b/radiant/autosave.cpp @@ -24,7 +24,7 @@ #include "os/file.h" #include "os/path.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "stream/stringstream.h" #include "gtkutil/messagebox.h" #include "scenelib.h" diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 243404f3..18c74e5d 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -42,7 +42,7 @@ #include "container/array.h" #include "scenelib.h" #include "render.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "math/frustum.h" #include "gtkutil/widget.h" diff --git a/radiant/commands.cpp b/radiant/commands.cpp index d904368e..f95f714c 100644 --- a/radiant/commands.cpp +++ b/radiant/commands.cpp @@ -78,7 +78,7 @@ void GlobalCommands_insert( const char* name, const Callback& callback, const Ac const Command& GlobalCommands_find( const char* command ){ Commands::iterator i = g_commands.find( command ); ASSERT_MESSAGE( i != g_commands.end(), "failed to lookup command " << makeQuoted( command ) ); - return ( *i ).second; + return i->second; } typedef std::map Toggles; diff --git a/radiant/eclass.cpp b/radiant/eclass.cpp index 741cdcf8..e02e1b01 100644 --- a/radiant/eclass.cpp +++ b/radiant/eclass.cpp @@ -34,7 +34,7 @@ #include "stream/stringstream.h" #include "moduleobservers.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "preferences.h" #include "mainframe.h" diff --git a/radiant/environment.cpp b/radiant/environment.cpp index d6703e81..c0a47ede 100644 --- a/radiant/environment.cpp +++ b/radiant/environment.cpp @@ -27,7 +27,7 @@ #include "debugging/debugging.h" #include "os/path.h" #include "os/file.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" int g_argc; const char ** g_argv; diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 3bb123f4..be8a56d5 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -66,7 +66,7 @@ #include "mainframe.h" #include "preferences.h" #include "url.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" diff --git a/radiant/main.cpp b/radiant/main.cpp index 4fe858bc..d7e2d467 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -72,7 +72,7 @@ #include "uilib/uilib.h" #include -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "os/file.h" #include "os/path.h" #include "stream/stringstream.h" diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 953cf7cb..9b7ac01f 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -43,7 +43,7 @@ #include -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "stream/stringstream.h" #include "signal/isignal.h" #include "os/path.h" diff --git a/radiant/map.cpp b/radiant/map.cpp index 1c21fce2..0698efc5 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -52,7 +52,7 @@ MapModules& ReferenceAPI_getMapModules(); #include "traverselib.h" #include "maplib.h" #include "eclasslib.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "stream/textfilestream.h" #include "os/path.h" #include "uniquenames.h" diff --git a/radiant/plugin.cpp b/radiant/plugin.cpp index a43572aa..88e14ba0 100644 --- a/radiant/plugin.cpp +++ b/radiant/plugin.cpp @@ -298,7 +298,8 @@ Radiant* g_Radiant; bool Radiant_Construct( ModuleServer& server ){ GlobalModuleServer::instance().set( server ); - StaticModuleRegistryList().instance().registerModules(); + auto modules = StaticModuleRegistryList().instance(); + modules.registerModules(); g_RadiantDependencies = new RadiantDependencies(); diff --git a/radiant/points.cpp b/radiant/points.cpp index 342c5be0..698adaaa 100644 --- a/radiant/points.cpp +++ b/radiant/points.cpp @@ -37,7 +37,7 @@ #include "stream/stringstream.h" #include "os/path.h" #include "os/file.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "map.h" #include "qe3.h" diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 50eefa61..efb97643 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -41,7 +41,7 @@ #include "os/dir.h" #include "gtkutil/filechooser.h" #include "gtkutil/messagebox.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "error.h" #include "console.h" diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index f458a079..02386ca4 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -45,7 +45,7 @@ #include #include "stream/textfilestream.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "stream/stringstream.h" #include "os/path.h" #include "scenelib.h" diff --git a/radiant/server.cpp b/radiant/server.cpp index 714521c7..c9f0e7c6 100644 --- a/radiant/server.cpp +++ b/radiant/server.cpp @@ -24,7 +24,6 @@ #include "debugging/debugging.h" #include -#include #include "os/path.h" #include "modulesystem.h" @@ -70,11 +69,11 @@ void registerModule( const char* type, int version, const char* name, Module& mo } Module* findModule( const char* type, int version, const char* name ) const { - Modules_::const_iterator i = m_modules.find( ModuleKey( ModuleType( type, version ), name ) ); + auto i = m_modules.find( ModuleKey( ModuleType( type, version ), name ) ); if ( i != m_modules.end() ) { - return ( *i ).second; + return i->second; } - return 0; + return nullptr; } void foreachModule( const char* type, int version, const Visitor& visitor ){ @@ -143,73 +142,82 @@ FunctionPointer findSymbol( const char* symbol ){ #include -class DynamicLibrary -{ -void* m_library; +class DynamicLibrary { + void *m_library; public: -typedef int ( *FunctionPointer )(); + using FunctionPointer = int (*)(); -DynamicLibrary( const char* filename ){ - m_library = dlopen(filename, RTLD_LOCAL - | RTLD_NOW - #ifndef __APPLE__ - | RTLD_DEEPBIND - #endif - ); - if ( !m_library ) + DynamicLibrary(const char *filename) { - globalErrorStream() << "LoadLibrary failed: '" << filename << "'\n"; - if ( const char* error = dlerror() ) + m_library = dlopen(filename, RTLD_LOCAL + | RTLD_NOW + #ifndef __APPLE__ + | RTLD_DEEPBIND +#endif + ); + auto error = dlerror(); + if (!m_library || error) { + globalErrorStream() << "LoadLibrary failed: '" << filename << "'\n"; globalErrorStream() << "GetLastError: " << error; + } } -} -~DynamicLibrary(){ - if ( !failed() ) { - dlclose( m_library ); + + ~DynamicLibrary() + { + if (!failed()) { + dlclose(m_library); + } } -} -bool failed(){ - return m_library == 0; -} -FunctionPointer findSymbol( const char* symbol ){ - FunctionPointer p = (FunctionPointer)dlsym( m_library, symbol ); - if ( p == 0 ) { - const char* error = reinterpret_cast( dlerror() ); - if ( error != 0 ) { + + bool failed() + { + return m_library == nullptr; + } + + FunctionPointer findSymbol(const char *symbol) + { + if (auto p = reinterpret_cast(dlsym(m_library, symbol))) { + return p; + } + if (auto error = reinterpret_cast(dlerror())) { globalErrorStream() << error; } + return nullptr; } - return p; -} }; #else #error "unsupported platform" #endif -class DynamicLibraryModule -{ -typedef void ( RADIANT_DLLIMPORT * RegisterModulesFunc )( ModuleServer& server ); -DynamicLibrary m_library; -RegisterModulesFunc m_registerModule; +class DynamicLibraryModule { + typedef void ( RADIANT_DLLIMPORT *RegisterModulesFunc )(ModuleServer &server); + + DynamicLibrary m_library; + RegisterModulesFunc m_registerModule; public: -DynamicLibraryModule( const char* filename ) - : m_library( filename ), m_registerModule( 0 ){ - if ( !m_library.failed() ) { - m_registerModule = reinterpret_cast( m_library.findSymbol( "Radiant_RegisterModules" ) ); + DynamicLibraryModule(const char *filename) + : m_library(filename), m_registerModule(nullptr) + { + if (!m_library.failed()) { + m_registerModule = reinterpret_cast( m_library.findSymbol("Radiant_RegisterModules")); #if 0 - if ( !m_registerModule ) { - m_registerModule = reinterpret_cast( m_library.findSymbol( "Radiant_RegisterModules@4" ) ); - } + if ( !m_registerModule ) { + m_registerModule = reinterpret_cast( m_library.findSymbol( "Radiant_RegisterModules@4" ) ); + } #endif + } + } + + bool failed() + { + return m_registerModule == nullptr; + } + + void registerModules(ModuleServer &server) + { + m_registerModule(server); } -} -bool failed(){ - return m_registerModule == 0; -} -void registerModules( ModuleServer& server ){ - m_registerModule( server ); -} }; diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 686de494..2739f866 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -53,7 +53,7 @@ #include "stream/memstream.h" #include "stream/textfilestream.h" #include "stream/stringstream.h" -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "texmanip.h" #include "textures.h" #include "convert.h" diff --git a/radiant/watchbsp.cpp b/radiant/watchbsp.cpp index f48274a5..b66a33a8 100644 --- a/radiant/watchbsp.cpp +++ b/radiant/watchbsp.cpp @@ -38,7 +38,7 @@ #include #include -#include "cmdlib.h" +#include "cmdlib/cmdlib.h" #include "convert.h" #include "string/string.h" #include "stream/stringstream.h" diff --git a/tools/quake3/common/aselib.h b/tools/quake3/common/aselib.h index 2f5f015a..819b175f 100644 --- a/tools/quake3/common/aselib.h +++ b/tools/quake3/common/aselib.h @@ -21,7 +21,7 @@ #include "../common/cmdlib.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "polyset.h" void ASE_Load( const char *filename, qboolean verbose, qboolean meshanims ); diff --git a/tools/quake3/common/bspfile.c b/tools/quake3/common/bspfile.c index 9214550a..9aa198e2 100644 --- a/tools/quake3/common/bspfile.c +++ b/tools/quake3/common/bspfile.c @@ -21,7 +21,7 @@ #include "cmdlib.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "inout.h" #include "bspfile.h" #include "scriplib.h" diff --git a/tools/quake3/common/cmdlib.c b/tools/quake3/common/cmdlib.c index 103047c0..86fefd16 100644 --- a/tools/quake3/common/cmdlib.c +++ b/tools/quake3/common/cmdlib.c @@ -29,7 +29,7 @@ // replaced qprintf with Sys_Printf #include "cmdlib.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "inout.h" #include #include diff --git a/tools/quake3/common/imagelib.c b/tools/quake3/common/imagelib.c index 3a590292..24c3c9e1 100644 --- a/tools/quake3/common/imagelib.c +++ b/tools/quake3/common/imagelib.c @@ -23,7 +23,7 @@ #include "inout.h" #include "cmdlib.h" -#include "etclib.h" +#include "etclib/etclib.h" #include "imagelib.h" #include "vfs.h" diff --git a/tools/quake3/common/inout.c b/tools/quake3/common/inout.c index 6f1c9957..167841d4 100644 --- a/tools/quake3/common/inout.c +++ b/tools/quake3/common/inout.c @@ -27,7 +27,7 @@ // #include "cmdlib.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "polylib.h" #include "inout.h" #include diff --git a/tools/quake3/common/inout.h b/tools/quake3/common/inout.h index 4efe0dac..f1994a62 100644 --- a/tools/quake3/common/inout.h +++ b/tools/quake3/common/inout.h @@ -24,7 +24,7 @@ // inout is the only stuff relying on xml, include the headers there #include "libxml/tree.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" // some useful xml routines xmlNodePtr xml_NodeForVec( vec3_t v ); diff --git a/tools/quake3/common/polylib.c b/tools/quake3/common/polylib.c index c7b85dd3..e6ef26fe 100644 --- a/tools/quake3/common/polylib.c +++ b/tools/quake3/common/polylib.c @@ -21,7 +21,7 @@ #include "cmdlib.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "inout.h" #include "polylib.h" #include "qfiles.h" diff --git a/tools/quake3/common/scriplib.c b/tools/quake3/common/scriplib.c index a33657c7..d479f579 100644 --- a/tools/quake3/common/scriplib.c +++ b/tools/quake3/common/scriplib.c @@ -22,7 +22,7 @@ // scriplib.c #include "cmdlib.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "inout.h" #include "scriplib.h" #include "vfs.h" diff --git a/tools/quake3/common/scriplib.h b/tools/quake3/common/scriplib.h index 330e2f65..f1f1afa8 100644 --- a/tools/quake3/common/scriplib.h +++ b/tools/quake3/common/scriplib.h @@ -25,7 +25,7 @@ #include "../common/cmdlib.h" #endif #ifndef __MATHLIB__ -#include "mathlib.h" +#include "mathlib/mathlib.h" #endif #define MAXTOKEN 1024 diff --git a/tools/quake3/common/threads.c b/tools/quake3/common/threads.c index 04946dd2..c040dfbe 100644 --- a/tools/quake3/common/threads.c +++ b/tools/quake3/common/threads.c @@ -27,7 +27,7 @@ #endif #include "cmdlib.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "inout.h" #include "qthreads.h" diff --git a/tools/quake3/common/trilib.c b/tools/quake3/common/trilib.c index 8b063b0f..b2395ed2 100644 --- a/tools/quake3/common/trilib.c +++ b/tools/quake3/common/trilib.c @@ -25,7 +25,7 @@ #include #include "cmdlib.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "polyset.h" #include "trilib.h" diff --git a/tools/quake3/common/vfs.c b/tools/quake3/common/vfs.c index ada7ee71..01bc4a25 100644 --- a/tools/quake3/common/vfs.c +++ b/tools/quake3/common/vfs.c @@ -46,8 +46,8 @@ #include #include "cmdlib.h" -#include "filematch.h" -#include "mathlib.h" +#include "filematch/filematch.h" +#include "mathlib/mathlib.h" #include "inout.h" #include "vfs.h" #include "unzip.h" diff --git a/tools/quake3/q3data/md3lib.h b/tools/quake3/q3data/md3lib.h index 5158b539..316f017c 100644 --- a/tools/quake3/q3data/md3lib.h +++ b/tools/quake3/q3data/md3lib.h @@ -21,7 +21,7 @@ #include #include "../common/cmdlib.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "../common/qfiles.h" void MD3_Dump( const char *filename ); diff --git a/tools/quake3/q3data/q3data.h b/tools/quake3/q3data/q3data.h index d852369a..220c0ff2 100644 --- a/tools/quake3/q3data/q3data.h +++ b/tools/quake3/q3data/q3data.h @@ -30,7 +30,7 @@ #include "../common/cmdlib.h" #include "scriplib.h" -#include "mathlib.h" +#include "mathlib/mathlib.h" #include "polyset.h" #include "trilib.h" #include "imagelib.h" diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 533524ec..315ab0c0 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -65,11 +65,11 @@ /* general */ #include "cmdlib.h" -#include "mathlib.h" -#include "md5lib.h" -#include "ddslib.h" +#include "mathlib/mathlib.h" +#include "md5lib/md5lib.h" +#include "ddslib/ddslib.h" -#include "picomodel.h" +#include "picomodel/picomodel.h" #include "scriplib.h" #include "polylib.h"