mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 22:56:30 -10:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
262de3f621 | ||
|
|
13d081d6c6 |
No files matched your search
@@ -268,8 +268,16 @@ xcuserdata
|
||||
|
||||
*.xccheckout
|
||||
|
||||
####
|
||||
# Visual Studio Code
|
||||
.vscode
|
||||
|
||||
####
|
||||
# Documentation
|
||||
#
|
||||
documentation/doxygen/*
|
||||
!documentation/doxygen/.gitkeep
|
||||
|
||||
|
||||
.idea/*
|
||||
projects/*
|
||||
@@ -0,0 +1,6 @@
|
||||
[submodule "cmake/external/cotire"]
|
||||
path = cmake/external/cotire
|
||||
url = https://github.com/sakra/cotire.git
|
||||
[submodule "cmake/external/rpavlik-cmake-modules"]
|
||||
path = cmake/external/rpavlik-cmake-modules
|
||||
url = https://github.com/asarium/cmake-modules.git
|
||||
+39
-14
@@ -1,21 +1,23 @@
|
||||
language: cpp
|
||||
sudo: true
|
||||
language: generic
|
||||
sudo: required
|
||||
dist: trusty
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/cmake
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- ninja-build
|
||||
- libopenal-dev
|
||||
- libogg-dev
|
||||
- libvorbis-dev
|
||||
- build-essential
|
||||
- automake
|
||||
- autoconf
|
||||
- libtheora-dev
|
||||
- libreadline6-dev
|
||||
- libpng12-dev
|
||||
- libjpeg62-dev
|
||||
- liblua5.1-0-dev
|
||||
- libjansson-dev
|
||||
- libtool
|
||||
- libsdl2-dev
|
||||
coverity_scan:
|
||||
project:
|
||||
name: "scp-fs2open/fs2open.github.com"
|
||||
@@ -25,6 +27,25 @@ addons:
|
||||
build_command: "make -j2"
|
||||
# must match TRAVIS_BRANCH check below
|
||||
branch_pattern: coverity_scan
|
||||
deploy:
|
||||
- provider: releases
|
||||
api_key:
|
||||
secure: "bBWEBF+r4p7kea+Lj/vHD0CCW4AsxqlLri8gT3HbsdPuKwdSNU4QLLFk9yAXmmBF2T/fe45Zk+WQrdQJjSydkpG06M7sFD22RKOYv3cLF0Bq0nEG4CpuXoGqo77oFGkA5hdU6D8W2nQTMhPuiqlvhgt3zeD/6fiyfdAztbtKNRs="
|
||||
skip_cleanup: true
|
||||
file_glob: true
|
||||
file: "/tmp/builds/*"
|
||||
on:
|
||||
condition: '"$RELEASE_BUILD" == true'
|
||||
tags: true
|
||||
|
||||
- provider: bintray
|
||||
user: asarium
|
||||
key:
|
||||
secure: "JyJIsJFxCvNjmdyG9eDIvkzXFqsJQVzXKp5BeJcn5WSdMA2Vs7dCvarJXomdwe3F3RCrdmrFYCaimiCDD6LqImrcDLzxlevzGlNUv381iFna612SJj672d8iQCgtMibIJ3HzYmgZlsaJ9YcaOuccRyQIV/TNUcwgzbsW27CPEcM="
|
||||
file: ci/bintray.json
|
||||
on:
|
||||
condition: '"$NIGHTLY_BUILD" == true'
|
||||
tags: true
|
||||
env:
|
||||
global:
|
||||
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
|
||||
@@ -38,20 +59,20 @@ matrix:
|
||||
env: CONFIGURATION="Debug"
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: CONFIGURATION="Debug"
|
||||
env: CONFIGURATION="Debug" CC=clang CXX=clang++
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: CONFIGURATION="Debug" MACOSX_ARCH=x86_64
|
||||
env: CONFIGURATION="Debug"
|
||||
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: CONFIGURATION="Release"
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: CONFIGURATION="Release"
|
||||
env: CONFIGURATION="Release" CC=clang CXX=clang++
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: CONFIGURATION="Release" MACOSX_ARCH=x86_64
|
||||
env: CONFIGURATION="Release"
|
||||
before_install:
|
||||
# ugly hack; if running a coverity scan abort all except the 1st build
|
||||
# see note re gcc compiler above needing to be 1st
|
||||
@@ -59,10 +80,14 @@ before_install:
|
||||
# unfortunately COVERITY_SCAN_BRANCH isn't defined until later in the
|
||||
# build process
|
||||
- if ([[ "${TRAVIS_JOB_NUMBER##*.}" != "1" ]] && [[ "${TRAVIS_BRANCH}" == "coverity_scan" ]]); then false ; fi
|
||||
- ./ci/travis/before_install.sh
|
||||
- source "./ci/travis/check_release.sh"
|
||||
- "./ci/travis/before_install.sh"
|
||||
install:
|
||||
- ./ci/travis/install.sh
|
||||
- "./ci/travis/install.sh"
|
||||
- export PATH=$HOME/cmake/bin:$PATH
|
||||
before_script:
|
||||
- ./ci/travis/before_script.sh
|
||||
- "./ci/travis/before_script.sh"
|
||||
script:
|
||||
- ./ci/travis/script.sh
|
||||
- if [ "$BUILD_DEPLOYMENT" = true ] ; then ./ci/travis/release.sh ; else ./ci/travis/script.sh ; fi
|
||||
before_deploy:
|
||||
- "./ci/travis/before_deploy.sh"
|
||||
+162
@@ -0,0 +1,162 @@
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.4)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
include(cmake/util.cmake)
|
||||
|
||||
# Set a few policies
|
||||
set_policy(CMP0051 OLD)
|
||||
set_policy(CMP0053 NEW)
|
||||
set_policy(CMP0054 NEW)
|
||||
|
||||
SET(FSO_PROJECT_DESCRIPTION "Open source project based on the original FreeSpace 2 source code.")
|
||||
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Executable output path")
|
||||
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Library output path")
|
||||
|
||||
# CMAKE_INSTALL_PREFIX is defined but also overwritten by the PROJECT command so we need to set it later
|
||||
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
SET(RESET_INSTALL_PREFIX TRUE)
|
||||
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
|
||||
# Reset this variable
|
||||
SET(TARGET_COPY_FILES "" CACHE INTERNAL "" FORCE)
|
||||
SET(TARGET_COPY_DIRS "" CACHE INTERNAL "" FORCE)
|
||||
|
||||
# Override standard CMake configurations
|
||||
set(CMAKE_CONFIGURATION_TYPES Debug Release FastDebug CACHE STRING "Available configurations" FORCE)
|
||||
|
||||
PROJECT(FS2_Open)
|
||||
|
||||
IF(CMAKE_CROSSCOMPILING)
|
||||
SET(IMPORT_EXE_DIR "IMPORT_EXE_DIR-NOTFOUND" CACHE FILEPATH "Required for a cross compiling build, point to binary directory of a cmake build for the real OS")
|
||||
INCLUDE(${IMPORT_EXE_DIR}/ImportExecutables.cmake)
|
||||
ENDIF(CMAKE_CROSSCOMPILING)
|
||||
|
||||
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/finder")
|
||||
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/rpavlik-cmake-modules")
|
||||
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/cotire/CMake")
|
||||
|
||||
IF(RESET_INSTALL_PREFIX)
|
||||
IF(NOT $ENV{FS2PATH} STREQUAL "")
|
||||
IF(NOT IS_DIRECTORY $ENV{FS2PATH})
|
||||
MESSAGE(WARNING "The path '$ENV{FS2PATH}' of the environment variable FS2PATH does not point to a directory! Install prefix wasn't set.")
|
||||
ELSE(NOT IS_DIRECTORY $ENV{FS2PATH})
|
||||
SET(CMAKE_INSTALL_PREFIX "$ENV{FS2PATH}" CACHE FILEPATH "Install path" FORCE)
|
||||
FILE(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX} CMAKE_INSTALL_PREFIX)
|
||||
ENDIF(NOT IS_DIRECTORY $ENV{FS2PATH})
|
||||
ELSE(NOT $ENV{FS2PATH} STREQUAL "")
|
||||
MESSAGE(STATUS "NO FS2PATH environment variable found, you can define this to point to your freespace install but it is not required.")
|
||||
ENDIF(NOT $ENV{FS2PATH} STREQUAL "")
|
||||
ENDIF(RESET_INSTALL_PREFIX)
|
||||
|
||||
### Define options and editable variables in the section below:
|
||||
# This is only needed for single configuration generators so don't annoy others
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Default build configuration used." FORCE)
|
||||
message(WARNING "CMAKE_BUILD_TYPE was not specified, defaulting to Release configuration.")
|
||||
endif(NOT CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
|
||||
|
||||
IF (WIN32)
|
||||
OPTION(FSO_USE_SPEECH "Use Windows specific text-to-speach libraries" ON)
|
||||
|
||||
OPTION(FSO_USE_VOICEREC "Enable voice recognition support" ON)
|
||||
|
||||
OPTION(FSO_BUILD_FRED2 "Build FRED2 binary" OFF)
|
||||
ENDIF(WIN32)
|
||||
|
||||
OPTION(FSO_BUILD_TOOLS "Build tools related to FSO" OFF)
|
||||
|
||||
OPTION(FSO_DEVELOPMENT_MODE "Generate binaries in development mode, only use if you know what you're doing!" OFF)
|
||||
|
||||
OPTION(FSO_BUILD_WXFRED2 "Build wxFRED2 binary" OFF)
|
||||
|
||||
IF(WIN32 OR APPLE)
|
||||
# On windows and mac the default should be to always build the included libraries
|
||||
SET(FSO_BUILD_INCLUDED_LIBS_DEFAULT ON)
|
||||
ELSE()
|
||||
SET(FSO_BUILD_INCLUDED_LIBS_DEFAULT OFF)
|
||||
ENDIF()
|
||||
|
||||
OPTION(FSO_BUILD_INCLUDED_LIBS "Build and use the included libraries istead of using the system headers and libraries" ${FSO_BUILD_INCLUDED_LIBS_DEFAULT})
|
||||
|
||||
OPTION(FSO_USE_LUAJIT "Use LuaJIT for Lua scripting, needs a working internet connection!" OFF)
|
||||
|
||||
OPTION(FSO_USE_OPENALSOFT "Download and build OpenAL Soft instead of using the system libraries" OFF)
|
||||
|
||||
OPTION(FSO_FATAL_WARNINGS "Determines if warnings in the build are considered fatal errors, primarily used for CI" OFF)
|
||||
|
||||
SET(FSO_FREESPACE_PATH "${CMAKE_INSTALL_PREFIX}" CACHE FILEPATH "The path of the FreeSpace directory you want to use. Please note that you will have to change CMAKE_INSTALL_PREFIX if you change this at some point.")
|
||||
|
||||
SET(FSO_RUN_ARGUMENTS "" CACHE STRING "Additional arguments passed to a generated executable when run with the generated build files.")
|
||||
|
||||
option(FSO_INSTALL_DEBUG_FILES "Install some debug files (currently only PDB files on windows)" OFF)
|
||||
|
||||
OPTION(COTIRE_ENABLE "Enable cotire, this speeds up builds but may cause issues while developing (default = OFF)" OFF)
|
||||
|
||||
MARK_AS_ADVANCED(FORCE FSO_CMAKE_DEBUG)
|
||||
MARK_AS_ADVANCED(FORCE FSO_BUILD_INCLUDED_LIBS)
|
||||
MARK_AS_ADVANCED(FORCE FSO_USE_OPENALSOFT)
|
||||
MARK_AS_ADVANCED(FORCE FSO_USE_LUAJIT)
|
||||
MARK_AS_ADVANCED(FORCE FSO_DEVELOPMENT_MODE)
|
||||
MARK_AS_ADVANCED(FORCE FSO_FATAL_WARNINGS)
|
||||
MARK_AS_ADVANCED(FORCE COTIRE_ENABLE)
|
||||
mark_as_advanced(FORCE FSO_INSTALL_DEBUG_FILES)
|
||||
|
||||
IF(COTIRE_ENABLE)
|
||||
# Include cotire file from https://github.com/sakra/cotire/
|
||||
include(cotire)
|
||||
ENDIF(COTIRE_ENABLE)
|
||||
|
||||
INCLUDE(globals)
|
||||
INCLUDE(toolchain)
|
||||
INCLUDE(platforms)
|
||||
include(version)
|
||||
|
||||
INCLUDE(headers)
|
||||
|
||||
SET(GENERATED_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated_source)
|
||||
|
||||
include(generateHeaders)
|
||||
|
||||
# This includes source code for some tools, either used in the build or also for something else
|
||||
ADD_SUBDIRECTORY(tools)
|
||||
|
||||
ADD_SUBDIRECTORY(lib)
|
||||
|
||||
ADD_SUBDIRECTORY(code)
|
||||
|
||||
ADD_SUBDIRECTORY(freespace2)
|
||||
|
||||
IF(FSO_BUILD_FRED2)
|
||||
ADD_SUBDIRECTORY(fred2)
|
||||
ENDIF(FSO_BUILD_FRED2)
|
||||
|
||||
IF(FSO_BUILD_WXFRED2)
|
||||
ADD_SUBDIRECTORY(wxfred2)
|
||||
ENDIF(FSO_BUILD_WXFRED2)
|
||||
|
||||
IF(MSVC_USE_RUNTIME_DLL)
|
||||
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${BINARY_DESTINATION}")
|
||||
|
||||
IF(FSO_BUILD_FRED2)
|
||||
SET(CMAKE_INSTALL_MFC_LIBRARIES ON)
|
||||
ENDIF(FSO_BUILD_FRED2)
|
||||
|
||||
INCLUDE(InstallRequiredSystemLibraries)
|
||||
ENDIF(MSVC_USE_RUNTIME_DLL)
|
||||
|
||||
include(package)
|
||||
|
||||
include(doxygen)
|
||||
|
||||
# Print used options to log
|
||||
IF (WIN32)
|
||||
message(STATUS "Building FRED2: ${FSO_BUILD_FRED2}")
|
||||
message(STATUS "Using text to speech: ${FSO_USE_SPEECH}")
|
||||
message(STATUS "Using voice recogition: ${FSO_USE_VOICEREC}")
|
||||
ENDIF(WIN32)
|
||||
message(STATUS "Building FSO tools: ${FSO_BUILD_TOOLS}")
|
||||
message(STATUS "Building wxFRED: ${FSO_BUILD_WXFRED2}")
|
||||
message(STATUS "Fatal warnings: ${FSO_FATAL_WARNINGS}")
|
||||
-64
@@ -1,64 +0,0 @@
|
||||
# Makefile.am for fs2_open (top level)
|
||||
#
|
||||
# This file uses GNU Automake to generate makefiles
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = mongoose code
|
||||
|
||||
|
||||
EXTRA_DIST = \
|
||||
FS2OpenSCPReadMe.doc \
|
||||
projects/Xcode/English.lproj/InfoPlist.strings \
|
||||
projects/Xcode/FS2_Open.icns \
|
||||
projects/Xcode/FS2_Open.xcodeproj/project.pbxproj \
|
||||
projects/Xcode/Frameworks.tgz \
|
||||
projects/Xcode/Info-debug.plist \
|
||||
projects/Xcode/Info.plist \
|
||||
projects/Xcode/README.Xcode \
|
||||
projects/Xcode/SDLMain.h \
|
||||
projects/Xcode/SDLMain.m
|
||||
|
||||
|
||||
# D_ variants are defaults and should always be used
|
||||
AM_CXXFLAGS = -I./code @D_CFLAGS@
|
||||
AM_LDFLAGS = @D_LDFLAGS@
|
||||
|
||||
EXTRA_PROGRAMS = cfilearchiver cfileextractor
|
||||
|
||||
###############################################################################
|
||||
##
|
||||
## Begin utilitites
|
||||
##
|
||||
|
||||
CPPSOURCES=$(wildcard code/*/*.cpp code/*/*.h)
|
||||
|
||||
# cfilearchiver -- to create VPs
|
||||
cfilearchiver_SOURCES = \
|
||||
code/cfilearchiver/cfilearchiver.cpp
|
||||
|
||||
# cfileextractor -- to extract files from VPs
|
||||
cfileextractor_SOURCES = \
|
||||
code/cfileextractor/cfileextractor.cpp
|
||||
|
||||
# catch all to build utilitites
|
||||
tools: cfilearchiver cfileextractor
|
||||
|
||||
# cleaning
|
||||
clean-tools:
|
||||
-test -z "$(EXTRA_PROGRAMS)" || rm -f $(EXTRA_PROGRAMS)
|
||||
|
||||
## cppcheck : check for many code issues
|
||||
cppcheck: ${CPPSOURCES}
|
||||
cppcheck ${CPPSOURCES} --enable=all --platform=unix64 \
|
||||
--std=c99 --inline-suppr --quiet
|
||||
|
||||
##
|
||||
## End utilitites
|
||||
##
|
||||
###############################################################################
|
||||
|
||||
|
||||
# make sure we get this stuff cleaned up
|
||||
clean-generic: clean-tools
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
The "projects" directory contains ready projects for:
|
||||
Microsoft Visual C++ 6
|
||||
Microsoft Visual C++ 2005
|
||||
Microsoft Visual C++ 2008
|
||||
Micrsofot Visual C++ 2010
|
||||
Apple Xcode
|
||||
Code::Blocks
|
||||
|
||||
|
||||
See the ChangeLog to see what's new.
|
||||
See the INSTALL file for instructions on how to build fs2_open.
|
||||
@@ -1,19 +0,0 @@
|
||||
[](https://scan.coverity.com/projects/870)
|
||||
[](https://travis-ci.org/scp-fs2open/fs2open.github.com)
|
||||
|
||||
Welcome to Freespace Open!
|
||||
|
||||
In 2002 Volition released the source code for Freespace2. In the years since dedicated individuals have added countless new features to create a flexible and powerful space combat simulation engine. More info can be found on our [wiki](http://www.hard-light.net/wiki/index.php/Source_Code_Project)
|
||||
|
||||
People interested in contributing are encouraged to read [this thread](http://www.hard-light.net/forums/index.php?topic=82688.0)
|
||||
|
||||
The "projects" directory contains ready projects for:
|
||||
* Microsoft Visual C++ 6, 2005, 2008, 2010, 2011, 2013, 2015
|
||||
* Apple Xcode
|
||||
* Code::Blocks
|
||||
* Eclipse
|
||||
|
||||
|
||||
Review the commit logs to see what's new.
|
||||
|
||||
See the INSTALL file for instructions on how to build fs2_open, or open the relevant MSVC project
|
||||
@@ -0,0 +1,35 @@
|
||||
FreeSpace2 *S*ource *C*ode *P*roject
|
||||
==
|
||||
Building
|
||||
--
|
||||
For building you will need [CMake](http://www.cmake.org/cmake/resources/software.html). Only version 2.8.12 has been tested extensively but older version may still work. Once you have installed CMake you should create a build directory where the project/make files should be created, **do not create them inside the source tree!**<br>
|
||||
<br>
|
||||
On Windows you can use the `cmake-gui` executable to get a nice GUI, on Unix just use `cmake`. Use the newly created directory as build directory (change to this directory on Unix) and run cmake. On Windows this can be done by clicking the `Configure` button. Choose your compiler version and hit `Generate` when configuring is done. <br>
|
||||
Depending on the makefile generator used build the `all` or `ALL_BUILD` target to compile the project.<br>
|
||||
|
||||
### Available variables to control the build
|
||||
* `FSO_BUILD_WXFRED2`: Build the wxfred2 project, requires wxWidgets
|
||||
* `FSO_FREESPACE_PATH`: Sets the path of your FreeSpace install, can be used to automatically run the generated executables with the correct working directory, this is an optional variable. By default this will use the value of the `FS2PATH` environment variable.
|
||||
* `FSO_BUILD_TOOLS`: Build some tools related to FSO
|
||||
|
||||
#### Windows only variables
|
||||
* `FSO_BUILD_FRED2`: Build FRED2, requires a Visual Studio version that ships with MFC
|
||||
* `FSO_USE_SPEECH`: Build a binary with text-to-speech support
|
||||
* `FSO_USE_VOICEREC`: Build a binary with voice recognition support
|
||||
|
||||
#### Advanced variables
|
||||
You should only use these variables if you know what you're doing
|
||||
* `FSO_CMAKE_DEBUG`: Print CMake debugging informations
|
||||
* `FSO_BUILD_INCLUDED_LIBS`: Build libraries from the included source
|
||||
* `FSO_USE_OPENALSOFT`: Use [OpenALSoft](http://kcat.strangesoft.net/openal.html) for OpenAL support
|
||||
* `FSO_USE_LUAJIT`: Use [luajit](http://luajit.org/) as a replacement for lua
|
||||
* `FSO_DEVELOPMENT_MODE`: Toggles some development behavior, only use if you really need it.
|
||||
* `FSO_RUN_ARGUMENTS`: If you run an executable from within the project, these arguments will also be passed to the executable
|
||||
* `FSO_BUILD_POSTFIX`: Sets a postfix to be added to the executable name, may be useful for release candidates.
|
||||
|
||||
#### Visual Studio specific variables
|
||||
* `MSVC_USE_RUNTIME_DLL`: Use the DLL version of the runtime, experimental and not well tested.
|
||||
* `MSVC_SIMD_INSTRUCTIONS`: The instruction set the executables will be optimized for.
|
||||
|
||||
### Generating an installation package
|
||||
CMake can automaticall generate installation packages of the project. To do this you will just need to run the `package` target of the build system and the package will be placed inside your build directory. On Windows you will have to install [NSIS](http://nsis.sourceforge.net/Main_Page) to use this.
|
||||
+36
-12
@@ -1,16 +1,40 @@
|
||||
version: 1.0.0.{build}
|
||||
shallow_clone: true
|
||||
configuration:
|
||||
- Debug
|
||||
- Release
|
||||
clone_depth: 10
|
||||
environment:
|
||||
matrix:
|
||||
- VisualStudioVersion: 10.0
|
||||
PlatformToolset: v100
|
||||
ProjectPath: projects/MSVC_2010/Freespace2.vcxproj
|
||||
- VisualStudioVersion: 12.0
|
||||
PlatformToolset: v120
|
||||
ProjectPath: projects/MSVC_2013/Freespace2.vcxproj
|
||||
- VisualStudioVersion: 14.0
|
||||
PlatformToolset: v140
|
||||
ProjectPath: projects/MSVC_2015/Freespace2.vcxproj
|
||||
- VS_VERSION: 10
|
||||
CMAKE_GENERATOR: Visual Studio 10 2010
|
||||
PlatformToolset: v100
|
||||
- VS_VERSION: 14
|
||||
CMAKE_GENERATOR: Visual Studio 14 2015
|
||||
PlatformToolset: v140_xp
|
||||
before_build:
|
||||
- git submodule update --init --recursive
|
||||
- ps: . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/check_release.ps1
|
||||
- ps: . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/before_build.ps1
|
||||
build_script:
|
||||
- msbuild "%ProjectPath%" /p:Configuration="Debug SSE2" /m /p:PlatformToolset="%PlatformToolset%" /verbosity:minimal
|
||||
test: off
|
||||
- ps: . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/build.ps1
|
||||
|
||||
|
||||
deploy:
|
||||
- provider: GitHub
|
||||
auth_token:
|
||||
secure: RWe6hwCcgBdklaYvjB62kzhKn7yDBJdqoDDKYViShaEV9HkJ75HbawsBcGBimRUu
|
||||
on:
|
||||
ReleaseBuild: true # deploy on release push only
|
||||
|
||||
- provider: BinTray
|
||||
username: asarium
|
||||
api_key:
|
||||
secure: 2lHma1ZreuB4CCE5hSdp+gqFjCMzUDj3tVJhP+D6EyF5wIVMLlwXFrISwnYu1kJi
|
||||
subject: scp-fs2open
|
||||
repo: FSO
|
||||
package: nightly
|
||||
version: $(VersionName)
|
||||
publish: true
|
||||
override: true
|
||||
on:
|
||||
NightlyBuild: true # deploy on nightly push only
|
||||
-139
@@ -1,139 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
srcdir=`dirname $0`
|
||||
PKG_NAME="fs2_open"
|
||||
|
||||
# check the version of a package
|
||||
check_version() {
|
||||
COMMAND=$1
|
||||
MAJOR=$2
|
||||
MINOR=$3
|
||||
MICRO=$4
|
||||
|
||||
($COMMAND --version) </dev/null >/dev/null 2>&1 || return 1
|
||||
|
||||
ver=`$COMMAND --version|head -n 1|sed 's/^.*) //'|sed 's/ (.*)//'`
|
||||
major=`echo $ver | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
|
||||
minor=`echo $ver | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
|
||||
micro=`echo $ver | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
|
||||
test -z "$major" && major=0
|
||||
test -z "$minor" && minor=0
|
||||
test -z "$micro" && micro=0
|
||||
|
||||
fail=0
|
||||
if [ ! "$major" -gt "$MAJOR" ]; then
|
||||
if [ "$major" -lt "$MAJOR" ]; then
|
||||
fail=1
|
||||
elif [ ! "$minor" -gt "$MINOR" ]; then
|
||||
if [ "$minor" -lt "$MINOR" ]; then
|
||||
fail=1
|
||||
elif [ "$micro" -lt "$MICRO" ]; then
|
||||
fail=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
return "$fail"
|
||||
}
|
||||
|
||||
AUTOMAKE=
|
||||
ACLOCAL=
|
||||
DIE=0
|
||||
|
||||
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "**Error**: You must have \`autoconf' installed to."
|
||||
echo "Download the appropriate package for your distribution,"
|
||||
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
||||
DIE=1
|
||||
}
|
||||
|
||||
for AM in automake-1.11 automake-1.10 automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake; do
|
||||
(check_version "$AM" 1 6 1) && {
|
||||
AUTOMAKE="$AM"
|
||||
break
|
||||
}
|
||||
done
|
||||
|
||||
if [ -z "$AUTOMAKE" ]; then
|
||||
echo
|
||||
echo "**Error**: You must have \`automake' version 1.6.1 or greater"
|
||||
echo "installed to compile $PKG_NAME. Download the appropriate package"
|
||||
echo "for your distribution, or get the source tarball at"
|
||||
echo "ftp://ftp.gnu.org/pub/gnu/"
|
||||
DIE=1
|
||||
fi
|
||||
|
||||
# if no automake, don't bother testing for aclocal
|
||||
test -z "$AUTOMAKE" || {
|
||||
for ACL in aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal-1.8 aclocal-1.7 aclocal-1.6 aclocal; do
|
||||
(check_version "$ACL" 1 6 1) && {
|
||||
ACLOCAL="$ACL"
|
||||
break
|
||||
}
|
||||
done
|
||||
|
||||
if [ -z "$ACLOCAL" ]; then
|
||||
echo
|
||||
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
|
||||
echo "installed seems to be outdated. Get a recent package from"
|
||||
echo "ftp://ftp.gnu.org/pub/gnu/"
|
||||
DIE=1
|
||||
fi
|
||||
}
|
||||
|
||||
if test "$DIE" -eq 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$*"; then
|
||||
echo "**Warning**: I am going to run \`configure' with no arguments."
|
||||
echo "If you wish to pass any to it, please specify them on the"
|
||||
echo \`$0\'" command line."
|
||||
echo
|
||||
fi
|
||||
|
||||
case $CC in
|
||||
xlc )
|
||||
am_opt=--include-deps;;
|
||||
esac
|
||||
|
||||
for coin in `find $srcdir -name configure.ac -print`
|
||||
do
|
||||
dr=`dirname $coin`
|
||||
if test -f $dr/NO-AUTO-GEN; then
|
||||
echo skipping $dr -- flagged as no auto-gen
|
||||
else
|
||||
echo processing $dr
|
||||
macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
|
||||
( cd $dr
|
||||
aclocalinclude="$ACLOCAL_FLAGS"
|
||||
for k in $macrodirs; do
|
||||
if test -d $k; then
|
||||
aclocalinclude="$aclocalinclude -I $k"
|
||||
##else
|
||||
## echo "**Warning**: No such directory \`$k'. Ignored."
|
||||
fi
|
||||
done
|
||||
echo "Running autoreconf..."
|
||||
autoreconf --install
|
||||
)
|
||||
# DIE if the subshell failed
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
|
||||
|
||||
# to not run configure, call autogen.sh as,
|
||||
# NOCONFIGURE=1 ./autogen.sh
|
||||
if test x$NOCONFIGURE = x; then
|
||||
echo Running $srcdir/configure $conf_flags "$@" ...
|
||||
$srcdir/configure $conf_flags "$@" \
|
||||
&& echo Now type \`make\' to compile $PKG_NAME.
|
||||
else
|
||||
echo Skipping configure process.
|
||||
fi
|
||||
@@ -0,0 +1,11 @@
|
||||
New-Item build -type directory
|
||||
Set-Location -Path build
|
||||
|
||||
$AdditionalFeatures="ON"
|
||||
if ($Env:VS_VERSION -eq "10") {
|
||||
$AdditionalFeatures="OFF"
|
||||
}
|
||||
|
||||
cmake -DFSO_BUILD_FRED2="${AdditionalFeatures}" -DFSO_USE_SPEECH="${AdditionalFeatures}" `
|
||||
-DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER/../install" `
|
||||
-DFSO_USE_VOICEREC="${AdditionalFeatures}" -DMSVC_SIMD_INSTRUCTIONS=SSE2 -G "$Env:CMAKE_GENERATOR" -T "$Env:PlatformToolset" ..
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
write "$env:DeployBuild"
|
||||
write "$env:DeployConfig"
|
||||
|
||||
if ([System.Convert]::ToBoolean($env:DeployBuild)) {
|
||||
# Release build
|
||||
if (![System.Convert]::ToBoolean($env:DeployConfig)) {
|
||||
exit 0 # End the build
|
||||
}
|
||||
|
||||
$Configs = @("Release", "FastDebug")
|
||||
foreach ($config in $Configs) {
|
||||
cmake --build . --config "$config" --target INSTALL -- /verbosity:minimal
|
||||
if (! ($?)) {
|
||||
Add-AppveyorMessage "A release build failed!"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
7z a "$($env:PackageName)-builds-Win32.zip" "$env:APPVEYOR_BUILD_FOLDER/../install/*"
|
||||
Push-AppveyorArtifact "$($env:PackageName)-builds-Win32.zip"
|
||||
} else {
|
||||
cmake --build . --config "$Env:CONFIGURATION" -- /verbosity:minimal
|
||||
|
||||
if (! ($?)) {
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
# Default values
|
||||
Set-AppveyorBuildVariable 'ReleaseBuild' 'false'
|
||||
Set-AppveyorBuildVariable 'NightlyBuild' 'false'
|
||||
Set-AppveyorBuildVariable 'DeployBuild' 'false'
|
||||
Set-AppveyorBuildVariable 'PackagePrefix' ''
|
||||
Set-AppveyorBuildVariable 'VersionName' ''
|
||||
|
||||
if ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^release_(.*)")) {
|
||||
# Tag matches
|
||||
Set-AppveyorBuildVariable 'ReleaseBuild' 'true'
|
||||
Set-AppveyorBuildVariable 'PackageName' "fs2_open_$($matches[1])"
|
||||
}
|
||||
|
||||
if ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^nightly_(.*)")) {
|
||||
# Tag matches
|
||||
Set-AppveyorBuildVariable 'NightlyBuild' 'true'
|
||||
Set-AppveyorBuildVariable 'PackageName' "nightly_$($matches[1])"
|
||||
Set-AppveyorBuildVariable 'VersionName' "$($matches[1])"
|
||||
}
|
||||
|
||||
if (($Env:Configuration -eq "Release") -And ($Env:VS_VERSION -eq "14")) {
|
||||
Set-AppveyorBuildVariable 'DeployConfig' 'true'
|
||||
} else {
|
||||
Set-AppveyorBuildVariable 'DeployConfig' 'false'
|
||||
}
|
||||
|
||||
if ([System.Convert]::ToBoolean($env:ReleaseBuild) -Or [System.Convert]::ToBoolean($env:NightlyBuild)) {
|
||||
Set-AppveyorBuildVariable 'DeployBuild' 'true'
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"package": {
|
||||
"subject": "scp-fs2open",
|
||||
"repo": "FSO",
|
||||
"name": "nightly"
|
||||
},
|
||||
|
||||
"version": {
|
||||
"name": "$VERSION_NAME"
|
||||
},
|
||||
|
||||
"files": [
|
||||
{
|
||||
"includePattern": "/tmp/builds/(.*)",
|
||||
"uploadPattern": "$1"
|
||||
}
|
||||
],
|
||||
"publish": true
|
||||
}
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
|
||||
if [ "$NIGHTLY_BUILD" = true ]; then
|
||||
echo "Generating bintray config..."
|
||||
sed -e "s/\$VERSION_NAME/$VERSION_NAME/" ci/bintray.template.json > ci/bintray.json
|
||||
fi
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -e
|
||||
set -ex
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
sudo add-apt-repository --yes ppa:zoogie/sdl2-snapshots
|
||||
sudo apt-get update -qq
|
||||
# Nothing to do here
|
||||
:
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
# Nothing to do here
|
||||
:
|
||||
|
||||
+17
-13
@@ -1,20 +1,24 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -e
|
||||
set -ex
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
# Due to a bug in gcc the array bounds check isn't working correctly
|
||||
# This can be removed when gcc is updated
|
||||
AUTOGEN_CONFIG="--enable-fatal-warnings --enable-generic-architecture"
|
||||
CXXFLAGS="-Wno-array-bounds -Wno-unknown-pragmas"
|
||||
|
||||
if [ "$CONFIGURATION" = "Debug" ]; then
|
||||
AUTOGEN_CONFIG="$AUTOGEN_CONFIG --enable-debug"
|
||||
export CXXFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
|
||||
CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON"
|
||||
if [ "$BUILD_DEPLOYMENT" = true ]; then
|
||||
for config in $BUILD_CONFIGS
|
||||
do
|
||||
mkdir -p $config
|
||||
cd $config
|
||||
eval $CMAKE -DFSO_INSTALL_DEBUG_FILES=ON -DCMAKE_BUILD_TYPE=$config -DCMAKE_INSTALL_PREFIX="/tmp/release" ../..
|
||||
cd ..
|
||||
done
|
||||
else
|
||||
eval $CMAKE -DCMAKE_BUILD_TYPE=$CONFIGURATION ..
|
||||
fi
|
||||
|
||||
export CXXFLAGS
|
||||
./autogen.sh $AUTOGEN_CONFIG
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
cd projects/Xcode
|
||||
tar -xvzf Frameworks.tgz
|
||||
cmake -G "Xcode" -DFSO_FATAL_WARNINGS=ON -DFSO_INSTALL_DEBUG_FILES=ON -DCMAKE_INSTALL_PREFIX="/tmp/release" ..
|
||||
fi
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
RELEASE_BUILD=false
|
||||
NIGHTLY_BUILD=false
|
||||
BUILD_DEPLOYMENT=false
|
||||
BUILD_CONFIGS="Release FastDebug"
|
||||
VERSION_NAME=""
|
||||
PACKAGE_NAME=""
|
||||
|
||||
RELEASE_PATTERN="^release_(.*)$"
|
||||
NIGHTLY_PATTERN="^nightly_(.*)$"
|
||||
|
||||
if [[ "$TRAVIS_TAG" =~ $RELEASE_PATTERN ]]; then
|
||||
echo "This is a release tag!";
|
||||
RELEASE_BUILD=true;
|
||||
PACKAGE_NAME="fs2_open_${BASH_REMATCH[1]}";
|
||||
fi
|
||||
if [[ "$TRAVIS_TAG" =~ $NIGHTLY_PATTERN ]]; then
|
||||
echo "This is a nightly tag!";
|
||||
NIGHTLY_BUILD=true;
|
||||
VERSION_NAME="${BASH_REMATCH[1]}"
|
||||
PACKAGE_NAME="nightly_${BASH_REMATCH[1]}";
|
||||
fi
|
||||
|
||||
if ([ "$RELEASE_BUILD" = true ] || [ "$NIGHTLY_BUILD" = true ]); then
|
||||
BUILD_DEPLOYMENT=true;
|
||||
fi
|
||||
|
||||
if [ "$BUILD_DEPLOYMENT" = true ]; then
|
||||
if ([ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CC" = "clang" ]); then
|
||||
echo "Skipping non-release compiler";
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
if ([[ "$CONFIGURATION" == "Debug" ]]); then
|
||||
echo "Skipping non-release configuration";
|
||||
exit 0;
|
||||
fi
|
||||
fi
|
||||
|
||||
export RELEASE_BUILD
|
||||
export NIGHTLY_BUILD
|
||||
export BUILD_DEPLOYMENT
|
||||
export BUILD_CONFIGS
|
||||
export VERSION_NAME
|
||||
export PACKAGE_NAME
|
||||
+18
-3
@@ -1,9 +1,24 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -e
|
||||
set -ex
|
||||
|
||||
FILENAME=
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
sudo apt-get install libsdl2-dev
|
||||
if [ ! -d "$HOME/cmake/bin" ]; then
|
||||
# If the cache does not currently contain CMake then download and install it
|
||||
FILENAME=cmake-3.4.3-Linux-x86_64
|
||||
|
||||
mkdir -p $HOME/cmake/
|
||||
|
||||
wget -O /tmp/cmake.tar.gz --no-check-certificate https://www.cmake.org/files/v3.4/$FILENAME.tar.gz
|
||||
tar -xzf /tmp/cmake.tar.gz -C $HOME/cmake/ --strip-components=1
|
||||
fi
|
||||
export PATH=$HOME/cmake/bin:$PATH
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
gem install xcpretty thefox-pastebin
|
||||
gem install xcpretty xcpretty-travis-formatter thefox-pastebin
|
||||
|
||||
brew update
|
||||
brew outdated cmake || brew upgrade cmake
|
||||
fi
|
||||
|
||||
cmake --version
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
mkdir -p /tmp/builds
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
cd build
|
||||
for config in $BUILD_CONFIGS
|
||||
do
|
||||
cd "$config"
|
||||
ninja install
|
||||
cd ..
|
||||
done
|
||||
|
||||
ls -al /tmp/release
|
||||
(cd /tmp/release && tar -cvzf /tmp/builds/$PACKAGE_NAME-builds-Linux.tar.gz *)
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
cd build
|
||||
|
||||
for config in $BUILD_CONFIGS
|
||||
do
|
||||
cmake --build . --config "$config" --target install | tee build.log \
|
||||
| xcpretty -f `xcpretty-travis-formatter`
|
||||
XCODE_RET=${PIPESTATUS[0]}
|
||||
if [ "$XCODE_RET" -ne "0" ]; then
|
||||
pastebin -e 1d -f build.log
|
||||
exit $XCODE_RET
|
||||
fi
|
||||
done
|
||||
|
||||
ls -al /tmp/release
|
||||
|
||||
(cd /tmp/release && tar -cvzf /tmp/builds/$PACKAGE_NAME-builds-MacOSX.tar.gz *)
|
||||
fi
|
||||
+7
-7
@@ -2,15 +2,15 @@
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
make -j 4
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
cd projects/Xcode
|
||||
cd build
|
||||
|
||||
xcodebuild -project FS2_Open.xcodeproj -configuration "$CONFIGURATION" clean build | tee release.log | xcpretty
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
ninja
|
||||
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
cmake --build . --config "$CONFIGURATION" | tee build.log | xcpretty -f `xcpretty-travis-formatter`
|
||||
XCODE_RET=${PIPESTATUS[0]}
|
||||
if [ "$XCODE_RET" -ne "0" ]; then
|
||||
pastebin -e 1d -f release.log
|
||||
pastebin -e 1d -f build.log
|
||||
exit $XCODE_RET
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
include(WriteCompilerDetectionHeader)
|
||||
|
||||
set(REQUIRED_CXX_FEATURES cxx_rvalue_references cxx_nullptr)
|
||||
|
||||
get_property(CMAKE_CXX_KNOWN_FEATURES GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
|
||||
|
||||
write_compiler_detection_header(
|
||||
FILE "${GENERATED_SOURCE_DIR}/scp_compiler_detection.h"
|
||||
PREFIX SCP
|
||||
COMPILERS AppleClang Clang GNU MSVC
|
||||
FEATURES ${CMAKE_CXX_KNOWN_FEATURES}
|
||||
VERSION 3.2
|
||||
)
|
||||
@@ -0,0 +1,52 @@
|
||||
// Code snippet from http://stackoverflow.com/a/7495023
|
||||
#ifdef _WIN32
|
||||
#include <intrin.h>
|
||||
// Windows
|
||||
#define cpuid __cpuid
|
||||
|
||||
#else
|
||||
|
||||
// GCC Inline Assembly
|
||||
void cpuid(int CPUInfo[4],int InfoType){
|
||||
__asm__ __volatile__ (
|
||||
"cpuid":
|
||||
"=a" (CPUInfo[0]),
|
||||
"=b" (CPUInfo[1]),
|
||||
"=c" (CPUInfo[2]),
|
||||
"=d" (CPUInfo[3]) :
|
||||
"a" (InfoType)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
int SSE = false;
|
||||
int SSE2 = false;
|
||||
int AVX = false;
|
||||
|
||||
int info[4];
|
||||
cpuid(info, 0);
|
||||
int nIds = info[0];
|
||||
|
||||
// Detect Instruction Set
|
||||
if (nIds >= 1){
|
||||
cpuid(info,0x00000001);
|
||||
SSE = (info[3] & ((int)1 << 25)) != 0;
|
||||
SSE2 = (info[3] & ((int)1 << 26)) != 0;
|
||||
|
||||
AVX = (info[2] & ((int)1 << 28)) != 0;
|
||||
}
|
||||
|
||||
if(AVX)
|
||||
std::cout << "AVX";
|
||||
else if(SSE2)
|
||||
std::cout << "SSE2";
|
||||
else if(SSE)
|
||||
std::cout << "SSE";
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
# ------------------------- Begin Generic CMake Variable Logging ------------------
|
||||
|
||||
# /* C++ comment style not allowed */
|
||||
|
||||
|
||||
# if you are building in-source, this is the same as CMAKE_SOURCE_DIR, otherwise
|
||||
# this is the top level directory of your build tree
|
||||
MESSAGE( STATUS "CMAKE_BINARY_DIR: " ${CMAKE_BINARY_DIR} )
|
||||
|
||||
# if you are building in-source, this is the same as CMAKE_CURRENT_SOURCE_DIR, otherwise this
|
||||
# is the directory where the compiled or generated files from the current CMakeLists.txt will go to
|
||||
MESSAGE( STATUS "CMAKE_CURRENT_BINARY_DIR: " ${CMAKE_CURRENT_BINARY_DIR} )
|
||||
|
||||
# this is the directory, from which cmake was started, i.e. the top level source directory
|
||||
MESSAGE( STATUS "CMAKE_SOURCE_DIR: " ${CMAKE_SOURCE_DIR} )
|
||||
|
||||
# this is the directory where the currently processed CMakeLists.txt is located in
|
||||
MESSAGE( STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
|
||||
# contains the full path to the top level directory of your build tree
|
||||
MESSAGE( STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR} )
|
||||
|
||||
MESSAGE( STATUS "CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
|
||||
|
||||
# contains the full path to the root of your project source directory,
|
||||
# i.e. to the nearest directory where CMakeLists.txt contains the PROJECT() command
|
||||
MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
|
||||
|
||||
# set this variable to specify a common place where CMake should put all executable files
|
||||
# (instead of CMAKE_CURRENT_BINARY_DIR)
|
||||
MESSAGE( STATUS "EXECUTABLE_OUTPUT_PATH: " ${EXECUTABLE_OUTPUT_PATH} )
|
||||
|
||||
# set this variable to specify a common place where CMake should put all libraries
|
||||
# (instead of CMAKE_CURRENT_BINARY_DIR)
|
||||
MESSAGE( STATUS "LIBRARY_OUTPUT_PATH: " ${LIBRARY_OUTPUT_PATH} )
|
||||
|
||||
# tell CMake to search first in directories listed in CMAKE_MODULE_PATH
|
||||
# when you use FIND_PACKAGE() or INCLUDE()
|
||||
MESSAGE( STATUS "CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH} )
|
||||
|
||||
# this is the complete path of the cmake which runs currently (e.g. /usr/local/bin/cmake)
|
||||
MESSAGE( STATUS "CMAKE_COMMAND: " ${CMAKE_COMMAND} )
|
||||
|
||||
# this is the CMake installation directory
|
||||
MESSAGE( STATUS "CMAKE_ROOT: " ${CMAKE_ROOT} )
|
||||
|
||||
# this is the filename including the complete path of the file where this variable is used.
|
||||
MESSAGE( STATUS "CMAKE_CURRENT_LIST_FILE: " ${CMAKE_CURRENT_LIST_FILE} )
|
||||
|
||||
# this is linenumber where the variable is used
|
||||
MESSAGE( STATUS "CMAKE_CURRENT_LIST_LINE: " ${CMAKE_CURRENT_LIST_LINE} )
|
||||
|
||||
# this is used when searching for include files e.g. using the FIND_PATH() command.
|
||||
MESSAGE( STATUS "CMAKE_INCLUDE_PATH: " ${CMAKE_INCLUDE_PATH} )
|
||||
|
||||
# this is used when searching for libraries e.g. using the FIND_LIBRARY() command.
|
||||
MESSAGE( STATUS "CMAKE_LIBRARY_PATH: " ${CMAKE_LIBRARY_PATH} )
|
||||
|
||||
# the complete system name, e.g. "Linux-2.4.22", "FreeBSD-5.4-RELEASE" or "Windows 5.1"
|
||||
MESSAGE( STATUS "CMAKE_SYSTEM: " ${CMAKE_SYSTEM} )
|
||||
|
||||
# the short system name, e.g. "Linux", "FreeBSD" or "Windows"
|
||||
MESSAGE( STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME} )
|
||||
|
||||
# only the version part of CMAKE_SYSTEM
|
||||
MESSAGE( STATUS "CMAKE_SYSTEM_VERSION: " ${CMAKE_SYSTEM_VERSION} )
|
||||
|
||||
# the processor name (e.g. "Intel(R) Pentium(R) M processor 2.00GHz")
|
||||
MESSAGE( STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR} )
|
||||
|
||||
# is TRUE on all UNIX-like OS's, including Apple OS X and CygWin
|
||||
MESSAGE( STATUS "UNIX: " ${UNIX} )
|
||||
|
||||
# is TRUE on Windows, including CygWin
|
||||
MESSAGE( STATUS "WIN32: " ${WIN32} )
|
||||
|
||||
# is TRUE on Apple OS X
|
||||
MESSAGE( STATUS "APPLE: " ${APPLE} )
|
||||
|
||||
# is TRUE when using the MinGW compiler in Windows
|
||||
MESSAGE( STATUS "MINGW: " ${MINGW} )
|
||||
|
||||
# is TRUE on Windows when using the CygWin version of cmake
|
||||
MESSAGE( STATUS "CYGWIN: " ${CYGWIN} )
|
||||
|
||||
# is TRUE on Windows when using a Borland compiler
|
||||
MESSAGE( STATUS "BORLAND: " ${BORLAND} )
|
||||
|
||||
# Microsoft compiler
|
||||
MESSAGE( STATUS "MSVC: " ${MSVC} )
|
||||
MESSAGE( STATUS "MSVC_IDE: " ${MSVC_IDE} )
|
||||
MESSAGE( STATUS "MSVC60: " ${MSVC60} )
|
||||
MESSAGE( STATUS "MSVC70: " ${MSVC70} )
|
||||
MESSAGE( STATUS "MSVC71: " ${MSVC71} )
|
||||
MESSAGE( STATUS "MSVC80: " ${MSVC80} )
|
||||
MESSAGE( STATUS "CMAKE_COMPILER_2005: " ${CMAKE_COMPILER_2005} )
|
||||
|
||||
|
||||
# set this to true if you don't want to rebuild the object files if the rules have changed,
|
||||
# but not the actual source files or headers (e.g. if you changed the some compiler switches)
|
||||
MESSAGE( STATUS "CMAKE_SKIP_RULE_DEPENDENCY: " ${CMAKE_SKIP_RULE_DEPENDENCY} )
|
||||
|
||||
# since CMake 2.1 the install rule depends on all, i.e. everything will be built before installing.
|
||||
# If you don't like this, set this one to true.
|
||||
MESSAGE( STATUS "CMAKE_SKIP_INSTALL_ALL_DEPENDENCY: " ${CMAKE_SKIP_INSTALL_ALL_DEPENDENCY} )
|
||||
|
||||
# If set, runtime paths are not added when using shared libraries. Default it is set to OFF
|
||||
MESSAGE( STATUS "CMAKE_SKIP_RPATH: " ${CMAKE_SKIP_RPATH} )
|
||||
|
||||
# set this to true if you are using makefiles and want to see the full compile and link
|
||||
# commands instead of only the shortened ones
|
||||
MESSAGE( STATUS "CMAKE_VERBOSE_MAKEFILE: " ${CMAKE_VERBOSE_MAKEFILE} )
|
||||
|
||||
# this will cause CMake to not put in the rules that re-run CMake. This might be useful if
|
||||
# you want to use the generated build files on another machine.
|
||||
MESSAGE( STATUS "CMAKE_SUPPRESS_REGENERATION: " ${CMAKE_SUPPRESS_REGENERATION} )
|
||||
|
||||
|
||||
# A simple way to get switches to the compiler is to use ADD_DEFINITIONS().
|
||||
# But there are also two variables exactly for this purpose:
|
||||
|
||||
# the compiler flags for compiling C sources
|
||||
MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
|
||||
|
||||
# the compiler flags for compiling C++ sources
|
||||
MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
|
||||
|
||||
|
||||
# Choose the type of build. Example: SET(CMAKE_BUILD_TYPE Debug)
|
||||
MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
|
||||
|
||||
# if this is set to ON, then all libraries are built as shared libraries by default.
|
||||
MESSAGE( STATUS "BUILD_SHARED_LIBS: " ${BUILD_SHARED_LIBS} )
|
||||
|
||||
# the compiler used for C files
|
||||
MESSAGE( STATUS "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} )
|
||||
|
||||
# the compiler used for C++ files
|
||||
MESSAGE( STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER} )
|
||||
|
||||
# if the compiler is a variant of gcc, this should be set to 1
|
||||
MESSAGE( STATUS "CMAKE_COMPILER_IS_GNUCC: " ${CMAKE_COMPILER_IS_GNUCC} )
|
||||
|
||||
# if the compiler is a variant of g++, this should be set to 1
|
||||
MESSAGE( STATUS "CMAKE_COMPILER_IS_GNUCXX : " ${CMAKE_COMPILER_IS_GNUCXX} )
|
||||
|
||||
# the tools for creating libraries
|
||||
MESSAGE( STATUS "CMAKE_AR: " ${CMAKE_AR} )
|
||||
MESSAGE( STATUS "CMAKE_RANLIB: " ${CMAKE_RANLIB} )
|
||||
|
||||
#
|
||||
#MESSAGE( STATUS ": " ${} )
|
||||
|
||||
# ------------------------- End of Generic CMake Variable Logging ------------------
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
# add a target to generate API documentation with Doxygen
|
||||
find_package(Doxygen)
|
||||
if(DOXYGEN_FOUND)
|
||||
SET(OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/documentation/doxygen")
|
||||
FILE(MAKE_DIRECTORY "${OUTPUT_DIR}")
|
||||
|
||||
FILE(TO_NATIVE_PATH ${OUTPUT_DIR} OUTPUT_DIR)
|
||||
SET(OUTPUT_DIR \"${OUTPUT_DIR}\")
|
||||
|
||||
SET(INPUTS "${CMAKE_CURRENT_SOURCE_DIR}/code" "${CMAKE_CURRENT_SOURCE_DIR}/freespace2" "${CMAKE_CURRENT_SOURCE_DIR}/fred2" "${CMAKE_CURRENT_SOURCE_DIR}/wxfred2")
|
||||
|
||||
SET(INPUT_DIRS)
|
||||
FOREACH(DIR IN LISTS INPUTS)
|
||||
FILE(TO_NATIVE_PATH ${DIR} native_dir)
|
||||
|
||||
LIST(APPEND INPUT_DIRS \"${native_dir}\")
|
||||
ENDFOREACH(DIR)
|
||||
STRING(REPLACE ";" " " INPUT_DIRS "${INPUT_DIRS}")
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/fs2open.Doxyfile.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/fs2open.Doxyfile
|
||||
@ONLY)
|
||||
|
||||
add_custom_target(doxygen
|
||||
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/fs2open.Doxyfile
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating API documentation with Doxygen" VERBATIM
|
||||
)
|
||||
|
||||
set_target_properties(doxygen
|
||||
PROPERTIES
|
||||
FOLDER "Documentation"
|
||||
EXCLUDE_FROM_ALL ON
|
||||
EXCLUDE_FROM_DEFAULT_BUILD ON
|
||||
)
|
||||
endif(DOXYGEN_FOUND)
|
||||
+1
Submodule cmake/external/cotire added at 40a46bf2fb.
+1
Submodule cmake/external/rpavlik-cmake-modules added at 7cef9577d6.
@@ -0,0 +1,34 @@
|
||||
|
||||
add_library(speech INTERFACE)
|
||||
|
||||
if (WIN32)
|
||||
find_package(WindowsSDK REQUIRED)
|
||||
|
||||
foreach(dir ${WINDOWSSDK_DIRS})
|
||||
get_windowssdk_library_dirs("${dir}" LIB_DIRS)
|
||||
|
||||
find_library(SPEECH_LIBRARY
|
||||
NAMES sapi
|
||||
PATHS ${LIB_DIRS}
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
if (SPEECH_LIBRARY)
|
||||
set(SDK_DIR "${dir}")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (NOT SPEECH_LIBRARY)
|
||||
message(SEND_ERROR "Text to speech library could not be found! Either install it or disable the speech option.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_windowssdk_include_dirs("${SDK_DIR}" INCLUDE_DIRS)
|
||||
|
||||
target_link_libraries(speech INTERFACE ${SPEECH_LIBRARY})
|
||||
target_include_directories(speech INTERFACE ${INCLUDE_DIRS})
|
||||
else()
|
||||
message(SEND_ERROR "Text to Speech is not supported on this platform!")
|
||||
endif()
|
||||
|
||||
target_compile_definitions(speech INTERFACE -DFS2_SPEECH)
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
include(platformChecks)
|
||||
include(Cxx11)
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_LIST_DIR}/project.h.in ${GENERATED_SOURCE_DIR}/project.h)
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
SET(BINARY_DESTINATION ".")
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
SET(CODE_HEADERS ${CMAKE_SOURCE_DIR}/code)
|
||||
|
||||
SET(FREESPACE_HEADERS ${CMAKE_SOURCE_DIR}/freespace2)
|
||||
|
||||
SET(FRED_HEADERS ${CMAKE_SOURCE_DIR}/fred2)
|
||||
|
||||
SET(WXFRED_HEADERS ${CMAKE_SOURCE_DIR}/wxfred2)
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${FSO_VERSION_MAJOR})
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR ${FSO_VERSION_MINOR})
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH ${FSO_VERSION_BUILD})
|
||||
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${FSO_PROJECT_DESCRIPTION})
|
||||
|
||||
IF(WIN32)
|
||||
SET(CPACK_NSIS_MUI_ICON ${FSO_INSTALLER_ICON})
|
||||
|
||||
set(CPACK_NSIS_MENU_LINKS "http://www.hard-light.net/" "FreeSpace Community")
|
||||
ENDIF(WIN32)
|
||||
|
||||
include(CPack)
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
MESSAGE(STATUS "Doing Mac OSX specific things...")
|
||||
SET(EXE_GUI_TYPE MACOSX_BUNDLE)
|
||||
|
||||
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
|
||||
|
||||
if (NOT COCOA_LIBRARY)
|
||||
message(FATAL_ERROR "Couldn't find Cocoa!")
|
||||
endif()
|
||||
|
||||
target_link_libraries(platform INTERFACE ${COCOA_LIBRARY})
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
target_compile_definitions(platform INTERFACE SCP_BSD)
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
target_compile_definitions(platform INTERFACE SCP_SOLARIS)
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
INCLUDE(util)
|
||||
|
||||
MESSAGE(STATUS "Configuring UNIX specific things and stuff...")
|
||||
|
||||
target_compile_definitions(platform INTERFACE SCP_UNIX USE_OPENAL)
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
MESSAGE(STATUS "Configuring Windows specific things and stuff...")
|
||||
|
||||
target_link_libraries(platform INTERFACE comctl32.lib
|
||||
msacm32.lib
|
||||
odbc32.lib
|
||||
odbccp32.lib
|
||||
vfw32.lib
|
||||
winmm.lib
|
||||
wsock32.lib)
|
||||
|
||||
target_compile_definitions(platform INTERFACE WIN32 USE_OPENAL _WINDOWS)
|
||||
|
||||
# Specify minimum Windows version for the headers (currently this is XP)
|
||||
target_compile_definitions(platform INTERFACE NTDDI_VERSION=0x05010000 _WIN32_WINNT=0x0501)
|
||||
|
||||
SET(EXE_GUI_TYPE WIN32)
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
include(CheckFunctionExists)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckIncludeFileCXX)
|
||||
include(CheckLibraryExists)
|
||||
include(CheckPrototypeDefinition)
|
||||
include(CheckStructHasMember)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckTypeSize)
|
||||
|
||||
set(PLATFORM_CHECK_HEADER "${GENERATED_SOURCE_DIR}/platformChecks.h")
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_LIST_DIR}/platformChecks.h.in "${PLATFORM_CHECK_HEADER}")
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
#ifndef __PLATFORM_CHECKS_H__
|
||||
#define __PLATFORM_CHECKS_H__
|
||||
#pragma once
|
||||
|
||||
#endif // __PLATFORM_CHECKS_H__
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
add_library(platform INTERFACE)
|
||||
|
||||
IF(FSO_CMAKE_DEBUG)
|
||||
INCLUDE(debug-vars)
|
||||
ENDIF(FSO_CMAKE_DEBUG)
|
||||
|
||||
IF(WIN32)
|
||||
INCLUDE(platform-win32)
|
||||
ELSEIF(UNIX)
|
||||
INCLUDE(platform-unix)
|
||||
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
INCLUDE(platform-freebsd)
|
||||
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
|
||||
INCLUDE(platform-solaris)
|
||||
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
include(platform-darwin)
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
ELSE(WIN32)
|
||||
MESSAGE(STATUS "This platform is not supported, good luck!")
|
||||
ENDIF(WIN32)
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
#ifndef __PROJECT_H
|
||||
#define __PROJECT_H
|
||||
|
||||
#define FS_VERSION_MAJOR @FSO_VERSION_MAJOR@
|
||||
#define FS_VERSION_MINOR @FSO_VERSION_MINOR@
|
||||
#define FS_VERSION_BUILD @FSO_VERSION_BUILD@
|
||||
#define FS_VERSION_REVIS @FSO_VERSION_REVISION@
|
||||
#define FS_VERSION_REVIS_STR "@FSO_VERSION_REVISION_STR@"
|
||||
|
||||
#define FS_VERSION_HAS_REVIS @FSO_VERSION_HAS_REVISION@
|
||||
|
||||
#define FS_VERSION_FULL "@FSO_FULL_VERSION_STRING@"
|
||||
#define FS_PRODUCT_VERSION "@FSO_PRODUCT_VERSION_STRING@"
|
||||
|
||||
#endif // __PROJECT_H
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
MESSAGE(STATUS "Doing configuration specific to Apple Clang...")
|
||||
|
||||
# TODO: Actually add Mac specific flags here...
|
||||
|
||||
# Suppress specific warning
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -funroll-loops -fsigned-char -Wno-unknown-pragmas")
|
||||
|
||||
# Omit "conversion from string literal to 'char *' is deprecated" warnings.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-char-subscripts")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Wno-unused-variable")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wextra -Wshadow -Wno-unused-parameter")
|
||||
@@ -0,0 +1,54 @@
|
||||
# Clang
|
||||
include(EnableExtraCompilerWarnings)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
MESSAGE(STATUS "Doing configuration specific to clang...")
|
||||
|
||||
unset(CMAKE_CXX_FLAGS)
|
||||
message(STATUS "$ENV{CXXFLAGS}")
|
||||
if(DEFINED ENV{CXXFLAGS})
|
||||
message(STATUS "$ENV{CXXFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS $ENV{CXXFLAGS})
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "-march=native -pipe")
|
||||
endif(NOT CMAKE_CXX_FLAGS)
|
||||
|
||||
globally_enable_extra_compiler_warnings()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funroll-loops -fsigned-char -Wno-unknown-pragmas")
|
||||
|
||||
# Omit "argument unused during compilation" when clang is used with ccache.
|
||||
if(${CMAKE_CXX_COMPILER} MATCHES "ccache")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments")
|
||||
endif()
|
||||
# Omit "conversion from string literal to 'char *' is deprecated" warnings.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-char-subscripts")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
|
||||
|
||||
check_cxx_compiler_flag(-Wshift-negative-value SUPPORTS_SHIFT_NEGATIVE_VALUE)
|
||||
if(SUPPORTS_SHIFT_NEGATIVE_VALUE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-shift-negative-value")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wno-unused-variable")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wshadow")
|
||||
|
||||
if (FSO_FATAL_WARNINGS)
|
||||
# Make warnings fatal if the right variable is set
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g -rdynamic")
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
include(EnableExtraCompilerWarnings)
|
||||
|
||||
MESSAGE(STATUS "Doing configuration specific to gcc...")
|
||||
|
||||
unset(CMAKE_CXX_FLAGS)
|
||||
if(DEFINED ENV{CXXFLAGS})
|
||||
set(CMAKE_CXX_FLAGS $ENV{CXXFLAGS})
|
||||
message("${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "-march=native -pipe")
|
||||
endif(NOT CMAKE_CXX_FLAGS)
|
||||
|
||||
globally_enable_extra_compiler_warnings()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funroll-loops -fsigned-char -Wno-unknown-pragmas")
|
||||
|
||||
# Omit "deprecated conversion from string constant to 'char*'" warnings.
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-char-subscripts")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wno-unused-variable -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body -Wno-clobbered")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wshadow")
|
||||
|
||||
if (FSO_FATAL_WARNINGS)
|
||||
# Make warnings fatal if the right variable is set
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g -rdynamic")
|
||||
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,-zignore")
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
|
||||
@@ -0,0 +1,105 @@
|
||||
|
||||
include(EnableExtraCompilerWarnings)
|
||||
include(CheckCXXCompilerFlag)
|
||||
include(util)
|
||||
|
||||
MESSAGE(STATUS "Doing configuration specific to visual studio...")
|
||||
|
||||
set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS Debug)
|
||||
|
||||
option(MSVC_USE_RUNTIME_DLL "Use the dynamically linked version of the runtime" OFF)
|
||||
MARK_AS_ADVANCED(FORCE MSVC_USE_RUNTIME_DLL)
|
||||
|
||||
# Base
|
||||
set(CMAKE_C_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo")
|
||||
set(CMAKE_CXX_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "/MANIFEST /DYNAMICBASE:NO /SAFESEH:NO /ERRORREPORT:PROMPT /NOLOGO")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "")
|
||||
|
||||
# Release
|
||||
set(CMAKE_C_FLAGS_RELEASE "/GL /W2 /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/GL /W2 /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/OPT:REF /LTCG /INCREMENTAL:NO")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG")
|
||||
|
||||
globally_enable_extra_compiler_warnings()
|
||||
|
||||
CHECK_CXX_COMPILER_FLAG("/Zo" MSVC_COMPILER_SUPPORTS_ARCH_ZO)
|
||||
|
||||
if (MSVC_COMPILER_SUPPORTS_ARCH_ZO)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zo")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zo")
|
||||
endif()
|
||||
|
||||
IF(MSVC_USE_RUNTIME_DLL)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
|
||||
ELSE(MSVC_USE_RUNTIME_DLL)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
|
||||
ENDIF(MSVC_USE_RUNTIME_DLL)
|
||||
|
||||
# Debug
|
||||
set(CMAKE_C_FLAGS_DEBUG "/W4 /Gy /Zi /Od /RTC1 /Gd /Oy-")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "/W4 /Gy /Zi /Od /RTC1 /Gd /Oy-")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG /INCREMENTAL:NO /MAPINFO:EXPORTS /NODEFAULTLIB:libcmt.lib")
|
||||
|
||||
IF(MSVC_USE_RUNTIME_DLL)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
|
||||
ELSE(MSVC_USE_RUNTIME_DLL)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
|
||||
ENDIF(MSVC_USE_RUNTIME_DLL)
|
||||
|
||||
INCLUDE(MSVCMultipleProcessCompile)
|
||||
|
||||
# Visual Studio supports compiling for multiple vector instruction sets
|
||||
SET(POSSIBLE_INSTUCTION_SETS "" SSE SSE2 AVX)
|
||||
|
||||
if (NOT DEFINED MSVC_SIMD_INSTRUCTIONS)
|
||||
detect_simd_instructions(MSVC_DETECTED_SIMD_INSTRUCTIONS)
|
||||
|
||||
SET(MSVC_SIMD_INSTRUCTIONS "${MSVC_DETECTED_SIMD_INSTRUCTIONS}" CACHE FILEPATH "The SIMD instructions which will be used, possible values are ${POSSIBLE_INSTUCTION_SETS}")
|
||||
MARK_AS_ADVANCED(FORCE MSVC_SIMD_INSTRUCTIONS)
|
||||
endif()
|
||||
set(FSO_INSTRUCTION_SET ${MSVC_SIMD_INSTRUCTIONS})
|
||||
|
||||
LIST(FIND POSSIBLE_INSTUCTION_SETS "${MSVC_SIMD_INSTRUCTIONS}" SET_INDEX)
|
||||
|
||||
if (SET_INDEX LESS 0)
|
||||
MESSAGE(STATUS "An invalid instruction set was specified, defaulting to no special compiler options.")
|
||||
else()
|
||||
IF (NOT SET_INDEX EQUAL 0)
|
||||
SET(FOUND)
|
||||
|
||||
FOREACH(list_index RANGE ${SET_INDEX} 1)
|
||||
list(GET POSSIBLE_INSTUCTION_SETS ${list_index} _simd_set)
|
||||
CHECK_CXX_COMPILER_FLAG("/arch:${_simd_set}" COMPILER_SUPPORTS_ARCH_${_simd_set})
|
||||
|
||||
IF(COMPILER_SUPPORTS_ARCH_${_simd_set})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:${_simd_set}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:${_simd_set}")
|
||||
|
||||
SET(FOUND TRUE)
|
||||
BREAK()
|
||||
ENDIF()
|
||||
ENDFOREACH(list_index)
|
||||
|
||||
IF(NOT FOUND)
|
||||
# Don't set anything, it will likely not work
|
||||
MESSAGE(STATUS "Your compiler does not support any optimization flags, defaulting to none")
|
||||
ENDIF(NOT FOUND)
|
||||
ELSE()
|
||||
CHECK_CXX_COMPILER_FLAG("/arch:IA32" COMPILER_SUPPORTS_ARCH_IA32)
|
||||
|
||||
IF(COMPILER_SUPPORTS_ARCH_IA32)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:IA32")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:IA32")
|
||||
ENDIF(COMPILER_SUPPORTS_ARCH_IA32)
|
||||
ENDIF()
|
||||
endif()
|
||||
|
||||
target_compile_definitions(compiler INTERFACE _CRT_SECURE_NO_DEPRECATE
|
||||
_CRT_SECURE_NO_WARNINGS _SECURE_SCL=0 NOMINMAX)
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
# File to execute compiler specific commands
|
||||
|
||||
add_library(compiler INTERFACE)
|
||||
|
||||
target_compile_definitions(compiler INTERFACE "$<$<CONFIG:Release>:NDEBUG>;$<$<CONFIG:Debug>:_DEBUG>;$<$<CONFIG:FastDebug>:_DEBUG>")
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
include(toolchain-gcc)
|
||||
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
include(toolchain-msvc)
|
||||
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
include(toolchain-clang)
|
||||
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
|
||||
include(toolchain-apple-clang)
|
||||
ELSE("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
MESSAGE(STATUS "No special handling for this compiler present, good luck!")
|
||||
ENDIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
|
||||
# Copy release settings to FastDebug
|
||||
set(CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_RELEASE}")
|
||||
set(CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_FASTDEBUG "${CMAKE_EXE_LINKER_RELEASE}")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_FASTDEBUG "${CMAKE_STATIC_LINKER_FLAGS_RELEASE}")
|
||||
|
||||
if (MSVC)
|
||||
# Adjust runtime library
|
||||
string(REPLACE "/MD" "/MDd" CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_FASTDEBUG}")
|
||||
string(REPLACE "/MT" "/MTd" CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_FASTDEBUG}")
|
||||
|
||||
string(REPLACE "/MD" "/MDd" CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_FASTDEBUG}")
|
||||
string(REPLACE "/MT" "/MTd" CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_FASTDEBUG}")
|
||||
endif()
|
||||
@@ -0,0 +1,130 @@
|
||||
|
||||
FUNCTION(MAKE_CACHE_INTERNAL VARIABLE)
|
||||
SET(${VARIABLE} ${${VARIABLE}} CACHE INTERNAL "Internal cache variable")
|
||||
ENDFUNCTION(MAKE_CACHE_INTERNAL)
|
||||
|
||||
FUNCTION(ADD_IMPORTED_LIB NAME INCLUDES LIBS)
|
||||
ADD_LIBRARY(${NAME} INTERFACE)
|
||||
|
||||
target_link_libraries(${NAME} INTERFACE "${LIBS}")
|
||||
|
||||
target_include_directories(${NAME} INTERFACE "${INCLUDES}")
|
||||
ENDFUNCTION(ADD_IMPORTED_LIB)
|
||||
|
||||
MACRO(PKG_CONFIG_LIB_RESOLVE NAME OUTVAR)
|
||||
SET(${OUTVAR} "")
|
||||
foreach(lib ${${NAME}_LIBRARIES})
|
||||
find_library(${lib}_LIBRARY
|
||||
NAMES ${lib}
|
||||
HINTS ${${NAME}_LIBDIR} ${${NAME}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
if (NOT ${${lib}_LIBRARY} MATCHES ".*NOTFOUND.*")
|
||||
SET(${OUTVAR} ${${OUTVAR}} ${${lib}_LIBRARY})
|
||||
endif (NOT ${${lib}_LIBRARY} MATCHES ".*NOTFOUND.*")
|
||||
endforeach(lib)
|
||||
ENDMACRO(PKG_CONFIG_LIB_RESOLVE)
|
||||
|
||||
# Copy from http://cmake.3232098.n2.nabble.com/RFC-cmake-analog-to-AC-SEARCH-LIBS-td7585423.html
|
||||
INCLUDE (CheckFunctionExists)
|
||||
INCLUDE (CheckLibraryExists)
|
||||
|
||||
MACRO (CMAKE_SEARCH_LIBS v_func v_lib func)
|
||||
CHECK_FUNCTION_EXISTS (${func} ${v_func})
|
||||
IF (NOT ${v_func})
|
||||
FOREACH (lib ${ARGN})
|
||||
CHECK_LIBRARY_EXISTS (${lib} ${func} "" "HAVE_${func}_IN_${lib}")
|
||||
IF (${HAVE_${func}_IN_${lib}})
|
||||
SET (${v_func} TRUE)
|
||||
SET (${v_lib} "${lib}" CACHE INTERNAL "Library providing ${func}")
|
||||
BREAK()
|
||||
ENDIF (${HAVE_${func}_IN_${lib}})
|
||||
ENDFOREACH (lib)
|
||||
ENDIF (NOT ${v_func})
|
||||
ENDMACRO (CMAKE_SEARCH_LIBS)
|
||||
# End copy
|
||||
|
||||
FUNCTION(EP_CHECK_FILE_EXISTS FILE OUTVAR TARGET NAME COMMAND WORKING_DIR)
|
||||
string (REPLACE ";" " " COMMAND_STR "${COMMAND}")
|
||||
IF(WIN32)
|
||||
# Do something special for windows...
|
||||
SET(COMMAND "cmd /C \"${COMMAND_STR}\"")
|
||||
ELSE(WIN32)
|
||||
SET(COMMAND "${COMMAND_STR}")
|
||||
ENDIF(WIN32)
|
||||
|
||||
FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${NAME}" "
|
||||
IF(EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}\")
|
||||
MESSAGE(\"'${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}' already exists, nothing to be done.\")
|
||||
ELSE(EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}\")
|
||||
execute_process(COMMAND ${COMMAND} WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${WORKING_DIR}\")
|
||||
ENDIF(EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}\")
|
||||
")
|
||||
|
||||
SET(${OUTVAR} "${CMAKE_COMMAND}" -P ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${NAME} PARENT_SCOPE)
|
||||
ENDFUNCTION(EP_CHECK_FILE_EXISTS)
|
||||
|
||||
MACRO(COPY_FILES_TO_TARGET _target)
|
||||
FOREACH(file IN LISTS TARGET_COPY_FILES)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET ${_target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${file}" "$<TARGET_FILE_DIR:${_target}>"
|
||||
COMMENT "copying '${file}'..."
|
||||
)
|
||||
ENDFOREACH(file)
|
||||
ENDMACRO(COPY_FILES_TO_TARGET)
|
||||
|
||||
macro(set_policy policy value)
|
||||
if (POLICY ${policy})
|
||||
cmake_policy(SET ${policy} ${value})
|
||||
endif ()
|
||||
endmacro(set_policy)
|
||||
|
||||
macro(set_if_not_defined VAR VALUE)
|
||||
if (NOT DEFINED ${VAR})
|
||||
set(${VAR} ${VALUE})
|
||||
endif()
|
||||
endmacro(set_if_not_defined)
|
||||
|
||||
macro(configure_cotire target)
|
||||
IF(COTIRE_ENABLE)
|
||||
# Disable unity build as it doesn't work well for us
|
||||
set_target_properties(${target} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
|
||||
|
||||
# add ignored paths for the precompiled header here
|
||||
set_target_properties(code PROPERTIES COTIRE_PREFIX_HEADER_IGNORE_PATH
|
||||
"${CMAKE_SOURCE_DIR};${CMAKE_BINARY_DIR}")
|
||||
|
||||
IF(DEFINED CMAKE_CONFIGURATION_TYPES)
|
||||
cotire(${target} CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES})
|
||||
ELSE(DEFINED CMAKE_CONFIGURATION_TYPES)
|
||||
cotire(${target})
|
||||
ENDIF(DEFINED CMAKE_CONFIGURATION_TYPES)
|
||||
ENDIF(COTIRE_ENABLE)
|
||||
endmacro(configure_cotire)
|
||||
|
||||
macro(add_target_copy_files)
|
||||
INSTALL(FILES ${ARGN}
|
||||
DESTINATION ${BINARY_DESTINATION}
|
||||
)
|
||||
|
||||
SET(TARGET_COPY_FILES ${TARGET_COPY_FILES} ${ARGN} CACHE INTERNAL "" FORCE)
|
||||
endmacro(add_target_copy_files)
|
||||
|
||||
function(detect_simd_instructions _out_var)
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
set(${_out_var} "" PARENT_SCOPE)
|
||||
else()
|
||||
message(STATUS "Detecting SIMD features of current CPU...")
|
||||
TRY_RUN(RUN_RESULT COMPILE_RESULT "${CMAKE_BINARY_DIR}/temp" "${CMAKE_SOURCE_DIR}/cmake/cpufeatures.cpp"
|
||||
RUN_OUTPUT_VARIABLE FEATURE_OUTPUT)
|
||||
|
||||
IF(COMPILE_RESULT)
|
||||
MESSAGE(STATUS "Detected compatibility for the ${FEATURE_OUTPUT} feature set.")
|
||||
SET(${_out_var} ${FEATURE_OUTPUT} PARENT_SCOPE)
|
||||
ELSE(COMPILE_RESULT)
|
||||
MESSAGE("Compilation of CPU feature detector failed, please set the instruction set manually.")
|
||||
set(${_out_var} "" PARENT_SCOPE)
|
||||
ENDIF(COMPILE_RESULT)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -0,0 +1,52 @@
|
||||
|
||||
include(util)
|
||||
|
||||
if (EXISTS "${PROJECT_SOURCE_DIR}/version_override.cmake")
|
||||
# This allows to override the values by using a special file
|
||||
include("${PROJECT_SOURCE_DIR}/version_override.cmake")
|
||||
endif()
|
||||
|
||||
set_if_not_defined(FSO_VERSION_MAJOR 3)
|
||||
set_if_not_defined(FSO_VERSION_MINOR 7)
|
||||
set_if_not_defined(FSO_VERSION_BUILD 5)
|
||||
|
||||
# A numeric revision e.g. the CI build number
|
||||
set_if_not_defined(FSO_VERSION_REVISION 0)
|
||||
|
||||
# A generic revision string, can be anything
|
||||
set_if_not_defined(FSO_VERSION_REVISION_STR "${FSO_VERSION_REVISION}")
|
||||
|
||||
if("${FSO_VERSION_REVISION}" STREQUAL "0")
|
||||
set(FSO_VERSION_HAS_REVISION 0)
|
||||
else()
|
||||
set(FSO_VERSION_HAS_REVISION 1)
|
||||
endif()
|
||||
|
||||
set(FSO_FULL_VERSION_STRING "${FSO_VERSION_MAJOR}.${FSO_VERSION_MINOR}.${FSO_VERSION_BUILD}")
|
||||
set(FSO_PRODUCT_VERSION_STRING "${FSO_FULL_VERSION_STRING}")
|
||||
|
||||
if (NOT "${FSO_VERSION_REVISION}" STREQUAL "0")
|
||||
set(FSO_FULL_VERSION_STRING "${FSO_FULL_VERSION_STRING}.${FSO_VERSION_REVISION_STR}")
|
||||
endif()
|
||||
|
||||
IF("${FSO_VERSION_REVISION}" STREQUAL "0")
|
||||
SET(FSO_BINARY_SUFFIX "${FSO_VERSION_MAJOR}_${FSO_VERSION_MINOR}_${FSO_VERSION_BUILD}")
|
||||
ELSE()
|
||||
SET(FSO_BINARY_SUFFIX "${FSO_VERSION_MAJOR}_${FSO_VERSION_MINOR}_${FSO_VERSION_BUILD}_${FSO_VERSION_REVISION_STR}")
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# This is a 64-bit builds
|
||||
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_x64")
|
||||
ENDIF()
|
||||
|
||||
IF (NOT "${FSO_INSTRUCTION_SET}" STREQUAL "")
|
||||
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_${FSO_INSTRUCTION_SET}")
|
||||
ENDIF()
|
||||
|
||||
IF (NOT "${FSO_BUILD_POSTFIX}" STREQUAL "")
|
||||
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_${FSO_BUILD_POSTFIX}")
|
||||
ENDIF()
|
||||
|
||||
set(CONFIG_POSTFIX "$<$<CONFIG:Release>:>$<$<CONFIG:Debug>:-DEBUG>$<$<CONFIG:FastDebug>:-FASTDBG>")
|
||||
set(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}${CONFIG_POSTFIX}")
|
||||
@@ -0,0 +1,56 @@
|
||||
|
||||
INCLUDE(source_groups.cmake)
|
||||
|
||||
INCLUDE(voice_rec.cmake)
|
||||
|
||||
ADD_LIBRARY(code STATIC ${file_root} ${VOICE_REC_FILES})
|
||||
|
||||
target_compile_features(code PUBLIC ${REQUIRED_CXX_FEATURES})
|
||||
|
||||
INCLUDE(default_files.cmake)
|
||||
|
||||
if (MSVC)
|
||||
target_compile_definitions(code PUBLIC "PDB_DEBUGGING=1")
|
||||
endif(MSVC)
|
||||
|
||||
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${CODE_HEADERS})
|
||||
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${FREESPACE_HEADERS})
|
||||
|
||||
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${GENERATED_SOURCE_DIR})
|
||||
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${GENERATED_SOURCE_DIR}/code)
|
||||
|
||||
target_link_libraries(code PUBLIC OpenGL)
|
||||
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC ${OPENAL_LIBS})
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC ${LUA_LIBS})
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC ${PNG_LIBS})
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC ${JPEG_LIBS})
|
||||
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC oggvorbis)
|
||||
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC ${SDL_LIBS})
|
||||
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC platform)
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC compiler)
|
||||
|
||||
IF (FSO_USE_SPEECH)
|
||||
find_package(Speech REQUIRED)
|
||||
target_link_libraries(code PUBLIC speech)
|
||||
ENDIF(FSO_USE_SPEECH)
|
||||
|
||||
# Headers for standalone "gui" on UNIX
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC jansson)
|
||||
TARGET_LINK_LIBRARIES(code PUBLIC ${MONGOOSE_LIBS})
|
||||
ENDIF(UNIX)
|
||||
|
||||
IF(FSO_BUILD_TOOLS)
|
||||
ADD_SUBDIRECTORY(cfilearchiver)
|
||||
|
||||
ADD_SUBDIRECTORY(cfileextractor)
|
||||
ENDIF(FSO_BUILD_TOOLS)
|
||||
|
||||
include(util)
|
||||
configure_cotire(code)
|
||||
|
||||
include(../cmake/Cxx11.cmake)
|
||||
@@ -1,915 +0,0 @@
|
||||
## code/Makefile.am for fs2_open
|
||||
##
|
||||
## $Id: Makefile.am,v 1.31.2.10 2007-11-22 04:52:12 taylor Exp $
|
||||
|
||||
|
||||
EXTRA_DIST = \
|
||||
freespace2/app_icon.ico \
|
||||
freespace2/freespace.rc \
|
||||
freespace2/freespaceresource.h \
|
||||
freespace2/goal_com.bmp \
|
||||
freespace2/goal_fail.bmp \
|
||||
freespace2/goal_inc.bmp \
|
||||
freespace2/goal_none.bmp \
|
||||
freespace2/goal_ord.bmp \
|
||||
fred2/addvariabledlg.cpp \
|
||||
fred2/addvariabledlg.h \
|
||||
fred2/adjustgriddlg.cpp \
|
||||
fred2/adjustgriddlg.h \
|
||||
fred2/asteroideditordlg.cpp \
|
||||
fred2/asteroideditordlg.h \
|
||||
fred2/bgbitmapdlg.cpp \
|
||||
fred2/bgbitmapdlg.h \
|
||||
fred2/briefingeditordlg.cpp \
|
||||
fred2/briefingeditordlg.h \
|
||||
fred2/campaigneditordlg.cpp \
|
||||
fred2/campaigneditordlg.h \
|
||||
fred2/campaignfilelistbox.cpp \
|
||||
fred2/campaignfilelistbox.h \
|
||||
fred2/campaigntreeview.cpp \
|
||||
fred2/campaigntreeview.h \
|
||||
fred2/campaigntreewnd.cpp \
|
||||
fred2/campaigntreewnd.h \
|
||||
fred2/cmdbrief.cpp \
|
||||
fred2/cmdbrief.h \
|
||||
fred2/createwingdlg.cpp \
|
||||
fred2/createwingdlg.h \
|
||||
fred2/customwingnames.cpp \
|
||||
fred2/customwingnames.h \
|
||||
fred2/debriefingeditordlg.cpp \
|
||||
fred2/debriefingeditordlg.h \
|
||||
fred2/dialog1.cpp \
|
||||
fred2/dialog1.h \
|
||||
fred2/dumpstats.cpp \
|
||||
fred2/dumpstats.h \
|
||||
fred2/editor.h \
|
||||
fred2/eventeditor.cpp \
|
||||
fred2/eventeditor.h \
|
||||
fred2/folderdlg.cpp \
|
||||
fred2/folderdlg.h \
|
||||
fred2/fred.cpp \
|
||||
fred2/fred.h \
|
||||
fred2/fred.rc \
|
||||
fred2/freddoc.cpp \
|
||||
fred2/freddoc.h \
|
||||
fred2/fredrender.cpp \
|
||||
fred2/fredrender.h \
|
||||
fred2/fredstubs.cpp \
|
||||
fred2/fredview.cpp \
|
||||
fred2/fredview.h \
|
||||
fred2/grid.cpp \
|
||||
fred2/grid.h \
|
||||
fred2/ignoreordersdlg.cpp \
|
||||
fred2/ignoreordersdlg.h \
|
||||
fred2/initialships.cpp \
|
||||
fred2/initialships.h \
|
||||
fred2/initialstatus.cpp \
|
||||
fred2/initialstatus.h \
|
||||
fred2/mainfrm.cpp \
|
||||
fred2/mainfrm.h \
|
||||
fred2/makehelp.bat \
|
||||
fred2/management.cpp \
|
||||
fred2/management.h \
|
||||
fred2/messageeditordlg.cpp \
|
||||
fred2/messageeditordlg.h \
|
||||
fred2/missiongoalsdlg.cpp \
|
||||
fred2/missiongoalsdlg.h \
|
||||
fred2/missionnotesdlg.cpp \
|
||||
fred2/missionnotesdlg.h \
|
||||
fred2/missionsave.cpp \
|
||||
fred2/missionsave.h \
|
||||
fred2/modifyvariabledlg.cpp \
|
||||
fred2/modifyvariabledlg.h \
|
||||
fred2/operatorargtypeselect.cpp \
|
||||
fred2/operatorargtypeselect.h \
|
||||
fred2/orienteditor.cpp \
|
||||
fred2/orienteditor.h \
|
||||
fred2/playerstarteditor.cpp \
|
||||
fred2/playerstarteditor.h \
|
||||
fred2/prefsdlg.cpp \
|
||||
fred2/prefsdlg.h \
|
||||
fred2/reinforcementeditordlg.cpp \
|
||||
fred2/reinforcementeditordlg.h \
|
||||
fred2/resource.h \
|
||||
fred2/resource.hm \
|
||||
fred2/setglobalshipflags.cpp \
|
||||
fred2/setglobalshipflags.h \
|
||||
fred2/sexp_tree.cpp \
|
||||
fred2/sexp_tree.h \
|
||||
fred2/shieldsysdlg.cpp \
|
||||
fred2/shieldsysdlg.h \
|
||||
fred2/ship_select.cpp \
|
||||
fred2/ship_select.h \
|
||||
fred2/shipchecklistbox.cpp \
|
||||
fred2/shipchecklistbox.h \
|
||||
fred2/shipclasseditordlg.cpp \
|
||||
fred2/shipclasseditordlg.h \
|
||||
fred2/shipeditordlg.cpp \
|
||||
fred2/shipeditordlg.h \
|
||||
fred2/shipflagsdlg.cpp \
|
||||
fred2/shipflagsdlg.h \
|
||||
fred2/shipgoalsdlg.cpp \
|
||||
fred2/shipgoalsdlg.h \
|
||||
fred2/shipspecialdamage.cpp \
|
||||
fred2/shipspecialdamage.h \
|
||||
fred2/shipspecialhitpoints.cpp \
|
||||
fred2/shipspecialhitpoints.h \
|
||||
fred2/shiptexturesdlg.cpp \
|
||||
fred2/shiptexturesdlg.h \
|
||||
fred2/starfieldeditor.cpp \
|
||||
fred2/starfieldeditor.h \
|
||||
fred2/stdafx.cpp \
|
||||
fred2/stdafx.h \
|
||||
fred2/textviewdlg.cpp \
|
||||
fred2/textviewdlg.h \
|
||||
fred2/voiceactingmanager.cpp \
|
||||
fred2/voiceactingmanager.h \
|
||||
fred2/waypointpathdlg.cpp \
|
||||
fred2/waypointpathdlg.h \
|
||||
fred2/weaponeditordlg.cpp \
|
||||
fred2/weaponeditordlg.h \
|
||||
fred2/wing.cpp \
|
||||
fred2/wing.h \
|
||||
fred2/wing_editor.cpp \
|
||||
fred2/wing_editor.h \
|
||||
fred2/hlp/afxcore.rtf \
|
||||
fred2/hlp/afxhelp.hm \
|
||||
fred2/hlp/afxprint.rtf \
|
||||
fred2/hlp/appexit.bmp \
|
||||
fred2/hlp/bullet.bmp \
|
||||
fred2/hlp/curarw2.bmp \
|
||||
fred2/hlp/curarw4.bmp \
|
||||
fred2/hlp/curhelp.bmp \
|
||||
fred2/hlp/editcopy.bmp \
|
||||
fred2/hlp/editcut.bmp \
|
||||
fred2/hlp/editpast.bmp \
|
||||
fred2/hlp/editundo.bmp \
|
||||
fred2/hlp/filenew.bmp \
|
||||
fred2/hlp/fileopen.bmp \
|
||||
fred2/hlp/fileprnt.bmp \
|
||||
fred2/hlp/filesave.bmp \
|
||||
fred2/hlp/fred.hm \
|
||||
fred2/hlp/fred.hpj \
|
||||
fred2/hlp/help.log \
|
||||
fred2/hlp/hlpsbar.bmp \
|
||||
fred2/hlp/hlptbar.bmp \
|
||||
fred2/hlp/recfirst.bmp \
|
||||
fred2/hlp/reclast.bmp \
|
||||
fred2/hlp/recnext.bmp \
|
||||
fred2/hlp/recprev.bmp \
|
||||
fred2/hlp/scmax.bmp \
|
||||
fred2/hlp/scmenu.bmp \
|
||||
fred2/hlp/scmin.bmp \
|
||||
fred2/res/bitmap1.bmp \
|
||||
fred2/res/black_do.bmp \
|
||||
fred2/res/bmp00001.bmp \
|
||||
fred2/res/chained.bmp \
|
||||
fred2/res/chained_directive.bmp \
|
||||
fred2/res/cursor1.cur \
|
||||
fred2/res/cursor2.cur \
|
||||
fred2/res/data.bmp \
|
||||
fred2/res/fred.ico \
|
||||
fred2/res/fred.rc2 \
|
||||
fred2/res/freddoc.ico \
|
||||
fred2/res/green_do.bmp \
|
||||
fred2/res/root.bmp \
|
||||
fred2/res/root_directive.bmp \
|
||||
fred2/res/toolbar.bmp \
|
||||
fred2/res/toolbar1.bmp \
|
||||
fred2/res/variable.bmp \
|
||||
sound/phrases.xml \
|
||||
sound/gc.exe \
|
||||
wxfred2/res/fred.ico \
|
||||
wxfred2/wxfred.xrc
|
||||
|
||||
|
||||
# D_ variants are defaults and should always be used
|
||||
# FS2_ variants are for game building and wxFRED
|
||||
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@ -I./$(VPATH)/../mongoose
|
||||
AM_LDFLAGS = @D_LDFLAGS@ @FS2_LDFLAGS@
|
||||
|
||||
if BUILD_WXFRED
|
||||
LIBCODE=
|
||||
else
|
||||
LIBCODE=libcode.a
|
||||
endif
|
||||
noinst_LIBRARIES = $(LIBCODE)
|
||||
bin_PROGRAMS = @FS2_BINARY@
|
||||
|
||||
EXTRA_PROGRAMS = fs2_open_@PACKAGE_VERSION@ \
|
||||
fs2_open_@PACKAGE_VERSION@_DEBUG \
|
||||
wxFRED2_@PACKAGE_VERSION@ \
|
||||
wxFRED2_@PACKAGE_VERSION@_DEBUG
|
||||
|
||||
###############################################################################
|
||||
##
|
||||
## Begin CORE library
|
||||
##
|
||||
|
||||
FS2_SOURCES = \
|
||||
ai/ai.cpp \
|
||||
ai/ai.h \
|
||||
ai/aibig.cpp \
|
||||
ai/aibig.h \
|
||||
ai/aicode.cpp \
|
||||
ai/aigoals.cpp \
|
||||
ai/aigoals.h \
|
||||
ai/aiinternal.h \
|
||||
ai/aiturret.cpp \
|
||||
ai/ai_profiles.cpp \
|
||||
ai/ai_profiles.h \
|
||||
anim/animplay.cpp \
|
||||
anim/animplay.h \
|
||||
anim/packunpack.cpp \
|
||||
anim/packunpack.h \
|
||||
asteroid/asteroid.cpp \
|
||||
asteroid/asteroid.h \
|
||||
autopilot/autopilot.cpp \
|
||||
autopilot/autopilot.h \
|
||||
bmpman/bm_internal.h \
|
||||
bmpman/bmpman.cpp \
|
||||
bmpman/bmpman.h \
|
||||
camera/camera.cpp \
|
||||
camera/camera.h \
|
||||
cfile/cfile.cpp \
|
||||
cfile/cfile.h \
|
||||
cfile/cfilearchive.cpp \
|
||||
cfile/cfilearchive.h \
|
||||
cfile/cfilelist.cpp \
|
||||
cfile/cfilesystem.cpp \
|
||||
cfile/cfilesystem.h \
|
||||
cmdline/cmdline.cpp \
|
||||
cmdline/cmdline.h \
|
||||
cmeasure/cmeasure.cpp \
|
||||
cmeasure/cmeasure.h \
|
||||
controlconfig/controlsconfig.cpp \
|
||||
controlconfig/controlsconfig.h \
|
||||
controlconfig/controlsconfigcommon.cpp \
|
||||
cutscene/cutscenes.cpp \
|
||||
cutscene/cutscenes.h \
|
||||
cutscene/decoder16.cpp \
|
||||
cutscene/decoder8.cpp \
|
||||
cutscene/movie.cpp \
|
||||
cutscene/movie.h \
|
||||
cutscene/mve_audio.cpp \
|
||||
cutscene/mvelib.cpp \
|
||||
cutscene/mvelib.h \
|
||||
cutscene/mveplayer.cpp \
|
||||
cutscene/oggplayer.cpp \
|
||||
cutscene/oggplayer.h \
|
||||
ddsutils/ddsutils.cpp \
|
||||
ddsutils/ddsutils.h \
|
||||
debris/debris.cpp \
|
||||
debris/debris.h \
|
||||
debugconsole/console.cpp \
|
||||
debugconsole/console.h \
|
||||
debugconsole/consolecmds.cpp \
|
||||
debugconsole/consoleparse.cpp \
|
||||
debugconsole/consoleparse.h \
|
||||
exceptionhandler/exceptionhandler.cpp \
|
||||
exceptionhandler/exceptionhandler.h \
|
||||
external_dll/externalcode.h \
|
||||
external_dll/trackirglobal.cpp \
|
||||
external_dll/trackirglobal.h \
|
||||
fireball/fireballs.cpp \
|
||||
fireball/fireballs.h \
|
||||
fireball/warpineffect.cpp \
|
||||
fs2netd/fs2netd_client.cpp \
|
||||
fs2netd/fs2netd_client.h \
|
||||
fs2netd/tcp_client.cpp \
|
||||
fs2netd/tcp_client.h \
|
||||
fs2netd/tcp_socket.cpp \
|
||||
fs2netd/tcp_socket.h \
|
||||
fs2netd/protocol.h \
|
||||
gamehelp/contexthelp.cpp \
|
||||
gamehelp/contexthelp.h \
|
||||
gamehelp/gameplayhelp.cpp \
|
||||
gamehelp/gameplayhelp.h \
|
||||
gamesequence/gamesequence.cpp \
|
||||
gamesequence/gamesequence.h \
|
||||
gamesnd/eventmusic.cpp \
|
||||
gamesnd/eventmusic.h \
|
||||
gamesnd/gamesnd.cpp \
|
||||
gamesnd/gamesnd.h \
|
||||
globalincs/alphacolors.cpp \
|
||||
globalincs/alphacolors.h \
|
||||
globalincs/def_files.cpp \
|
||||
globalincs/def_files.h \
|
||||
globalincs/fsmemory.cpp \
|
||||
globalincs/fsmemory.h \
|
||||
globalincs/globals.h \
|
||||
globalincs/linklist.h \
|
||||
globalincs/profiling.cpp \
|
||||
globalincs/pstypes.h \
|
||||
globalincs/safe_strings.cpp \
|
||||
globalincs/safe_strings.h \
|
||||
globalincs/safe_strings_test.cpp \
|
||||
globalincs/systemvars.cpp \
|
||||
globalincs/systemvars.h \
|
||||
globalincs/version.cpp \
|
||||
globalincs/version.h \
|
||||
graphics/2d.cpp \
|
||||
graphics/2d.h \
|
||||
graphics/font.cpp \
|
||||
graphics/font.h \
|
||||
graphics/generic.cpp \
|
||||
graphics/generic.h \
|
||||
graphics/grbatch.cpp \
|
||||
graphics/grbatch.h \
|
||||
graphics/grinternal.h \
|
||||
graphics/gropengl.cpp \
|
||||
graphics/gropengl.h \
|
||||
graphics/gropenglbmpman.cpp \
|
||||
graphics/gropenglbmpman.h \
|
||||
graphics/gropengldraw.cpp \
|
||||
graphics/gropengldraw.h \
|
||||
graphics/gropenglextension.cpp \
|
||||
graphics/gropenglextension.h \
|
||||
graphics/gropengllight.cpp \
|
||||
graphics/gropengllight.h \
|
||||
graphics/gropenglpostprocessing.cpp \
|
||||
graphics/gropenglpostprocessing.h \
|
||||
graphics/gropenglshader.cpp \
|
||||
graphics/gropenglshader.h \
|
||||
graphics/gropenglstate.cpp \
|
||||
graphics/gropenglstate.h \
|
||||
graphics/gropengltexture.cpp \
|
||||
graphics/gropengltexture.h \
|
||||
graphics/gropengltnl.cpp \
|
||||
graphics/gropengltnl.h \
|
||||
graphics/grstub.cpp \
|
||||
graphics/grstub.h \
|
||||
graphics/line.h \
|
||||
graphics/shadows.cpp \
|
||||
graphics/tmapper.h \
|
||||
hud/hud.cpp \
|
||||
hud/hud.h \
|
||||
hud/hudartillery.cpp \
|
||||
hud/hudartillery.h \
|
||||
hud/hudbrackets.cpp \
|
||||
hud/hudbrackets.h \
|
||||
hud/hudconfig.cpp \
|
||||
hud/hudconfig.h \
|
||||
hud/hudescort.cpp \
|
||||
hud/hudescort.h \
|
||||
hud/hudets.cpp \
|
||||
hud/hudets.h \
|
||||
hud/hudgauges.h \
|
||||
hud/hudlock.cpp \
|
||||
hud/hudlock.h \
|
||||
hud/hudmessage.cpp \
|
||||
hud/hudmessage.h \
|
||||
hud/hudnavigation.cpp \
|
||||
hud/hudnavigation.h \
|
||||
hud/hudobserver.cpp \
|
||||
hud/hudobserver.h \
|
||||
hud/hudparse.cpp \
|
||||
hud/hudparse.h \
|
||||
hud/hudreticle.cpp \
|
||||
hud/hudreticle.h \
|
||||
hud/hudshield.cpp \
|
||||
hud/hudshield.h \
|
||||
hud/hudsquadmsg.cpp \
|
||||
hud/hudsquadmsg.h \
|
||||
hud/hudtarget.cpp \
|
||||
hud/hudtarget.h \
|
||||
hud/hudtargetbox.cpp \
|
||||
hud/hudtargetbox.h \
|
||||
hud/hudwingmanstatus.cpp \
|
||||
hud/hudwingmanstatus.h \
|
||||
iff_defs/iff_defs.cpp \
|
||||
iff_defs/iff_defs.h \
|
||||
inetfile/cftp.cpp \
|
||||
inetfile/cftp.h \
|
||||
inetfile/chttpget.cpp \
|
||||
inetfile/chttpget.h \
|
||||
inetfile/inetgetfile.cpp \
|
||||
inetfile/inetgetfile.h \
|
||||
io/cursor.cpp \
|
||||
io/cursor.h \
|
||||
io/key.cpp \
|
||||
io/key.h \
|
||||
io/keycontrol.cpp \
|
||||
io/keycontrol.h \
|
||||
io/mouse.cpp \
|
||||
io/mouse.h \
|
||||
io/timer.cpp \
|
||||
io/timer.h \
|
||||
jpgutils/jpgutils.cpp \
|
||||
jpgutils/jpgutils.h \
|
||||
jumpnode/jumpnode.cpp \
|
||||
jumpnode/jumpnode.h \
|
||||
lab/lab.cpp \
|
||||
lab/lab.h \
|
||||
lab/wmcgui.cpp \
|
||||
lab/wmcgui.h \
|
||||
lighting/lighting.cpp \
|
||||
lighting/lighting.h \
|
||||
localization/fhash.cpp \
|
||||
localization/fhash.h \
|
||||
localization/localize.cpp \
|
||||
localization/localize.h \
|
||||
math/fix.cpp \
|
||||
math/fix.h \
|
||||
math/floating.cpp \
|
||||
math/floating.h \
|
||||
math/fvi.cpp \
|
||||
math/fvi.h \
|
||||
math/spline.cpp \
|
||||
math/spline.h \
|
||||
math/staticrand.cpp \
|
||||
math/staticrand.h \
|
||||
math/vecmat.cpp \
|
||||
math/vecmat.h \
|
||||
menuui/barracks.cpp \
|
||||
menuui/barracks.h \
|
||||
menuui/credits.cpp \
|
||||
menuui/credits.h \
|
||||
menuui/fishtank.cpp \
|
||||
menuui/fishtank.h \
|
||||
menuui/mainhallmenu.cpp \
|
||||
menuui/mainhallmenu.h \
|
||||
menuui/mainhalltemp.cpp \
|
||||
menuui/mainhalltemp.h \
|
||||
menuui/optionsmenu.cpp \
|
||||
menuui/optionsmenu.h \
|
||||
menuui/optionsmenumulti.cpp \
|
||||
menuui/optionsmenumulti.h \
|
||||
menuui/playermenu.cpp \
|
||||
menuui/playermenu.h \
|
||||
menuui/readyroom.cpp \
|
||||
menuui/readyroom.h \
|
||||
menuui/snazzyui.cpp \
|
||||
menuui/snazzyui.h \
|
||||
menuui/techmenu.cpp \
|
||||
menuui/techmenu.h \
|
||||
menuui/trainingmenu.cpp \
|
||||
menuui/trainingmenu.h \
|
||||
mission/missionbriefcommon.cpp \
|
||||
mission/missionbriefcommon.h \
|
||||
mission/missioncampaign.cpp \
|
||||
mission/missioncampaign.h \
|
||||
mission/missiongoals.cpp \
|
||||
mission/missiongoals.h \
|
||||
mission/missiongrid.cpp \
|
||||
mission/missiongrid.h \
|
||||
mission/missionhotkey.cpp \
|
||||
mission/missionhotkey.h \
|
||||
mission/missionload.cpp \
|
||||
mission/missionload.h \
|
||||
mission/missionlog.cpp \
|
||||
mission/missionlog.h \
|
||||
mission/missionmessage.cpp \
|
||||
mission/missionmessage.h \
|
||||
mission/missionparse.cpp \
|
||||
mission/missionparse.h \
|
||||
mission/missiontraining.cpp \
|
||||
mission/missiontraining.h \
|
||||
missionui/chatbox.cpp \
|
||||
missionui/chatbox.h \
|
||||
missionui/fictionviewer.cpp \
|
||||
missionui/fictionviewer.h \
|
||||
missionui/missionbrief.cpp \
|
||||
missionui/missionbrief.h \
|
||||
missionui/missioncmdbrief.cpp \
|
||||
missionui/missioncmdbrief.h \
|
||||
missionui/missiondebrief.cpp \
|
||||
missionui/missiondebrief.h \
|
||||
missionui/missionloopbrief.cpp \
|
||||
missionui/missionloopbrief.h \
|
||||
missionui/missionpause.cpp \
|
||||
missionui/missionpause.h \
|
||||
missionui/missionscreencommon.cpp \
|
||||
missionui/missionscreencommon.h \
|
||||
missionui/missionshipchoice.cpp \
|
||||
missionui/missionshipchoice.h \
|
||||
missionui/missionweaponchoice.cpp \
|
||||
missionui/missionweaponchoice.h \
|
||||
missionui/redalert.cpp \
|
||||
missionui/redalert.h \
|
||||
mod_table/mod_table.cpp \
|
||||
mod_table/mod_table.h \
|
||||
model/model.h \
|
||||
model/modelanim.cpp \
|
||||
model/modelanim.h \
|
||||
model/modelcollide.cpp \
|
||||
model/modelinterp.cpp \
|
||||
model/modelsinc.h \
|
||||
model/modeloctant.cpp \
|
||||
model/modelread.cpp \
|
||||
model/modelrender.cpp \
|
||||
nebula/neb.cpp \
|
||||
nebula/neb.h \
|
||||
nebula/neblightning.cpp \
|
||||
nebula/neblightning.h \
|
||||
network/chat_api.cpp \
|
||||
network/chat_api.h \
|
||||
network/multi.cpp \
|
||||
network/multi.h \
|
||||
network/multilag.cpp \
|
||||
network/multilag.h \
|
||||
network/multimsgs.cpp \
|
||||
network/multimsgs.h \
|
||||
network/multiteamselect.cpp \
|
||||
network/multiteamselect.h \
|
||||
network/multiui.cpp \
|
||||
network/multiui.h \
|
||||
network/multiutil.cpp \
|
||||
network/multiutil.h \
|
||||
network/multi_campaign.cpp \
|
||||
network/multi_campaign.h \
|
||||
network/multi_data.cpp \
|
||||
network/multi_data.h \
|
||||
network/multi_dogfight.cpp \
|
||||
network/multi_dogfight.h \
|
||||
network/multi_endgame.cpp \
|
||||
network/multi_endgame.h \
|
||||
network/multi_ingame.cpp \
|
||||
network/multi_ingame.h \
|
||||
network/multi_kick.cpp \
|
||||
network/multi_kick.h \
|
||||
network/multi_log.cpp \
|
||||
network/multi_log.h \
|
||||
network/multi_obj.cpp \
|
||||
network/multi_obj.h \
|
||||
network/multi_observer.cpp \
|
||||
network/multi_observer.h \
|
||||
network/multi_options.cpp \
|
||||
network/multi_options.h \
|
||||
network/multi_pause.cpp \
|
||||
network/multi_pause.h \
|
||||
network/multi_pinfo.cpp \
|
||||
network/multi_pinfo.h \
|
||||
network/multi_ping.cpp \
|
||||
network/multi_ping.h \
|
||||
network/multi_pmsg.cpp \
|
||||
network/multi_pmsg.h \
|
||||
network/multi_pxo.cpp \
|
||||
network/multi_pxo.h \
|
||||
network/multi_rate.cpp \
|
||||
network/multi_rate.h \
|
||||
network/multi_respawn.cpp \
|
||||
network/multi_respawn.h \
|
||||
network/multi_sexp.cpp \
|
||||
network/multi_sexp.h \
|
||||
network/multi_team.cpp \
|
||||
network/multi_team.h \
|
||||
network/multi_update.h \
|
||||
network/multi_voice.cpp \
|
||||
network/multi_voice.h \
|
||||
network/multi_xfer.cpp \
|
||||
network/multi_xfer.h \
|
||||
network/psnet2.cpp \
|
||||
network/psnet2.h \
|
||||
network/stand_gui.cpp \
|
||||
network/stand_gui-unix.cpp \
|
||||
network/stand_gui.h \
|
||||
object/collidedebrisship.cpp \
|
||||
object/collidedebrisweapon.cpp \
|
||||
object/collideshipship.cpp \
|
||||
object/collideshipweapon.cpp \
|
||||
object/collideweaponweapon.cpp \
|
||||
object/deadobjectdock.cpp \
|
||||
object/deadobjectdock.h \
|
||||
object/objcollide.cpp \
|
||||
object/objcollide.h \
|
||||
object/objectdock.cpp \
|
||||
object/objectdock.h \
|
||||
object/object.cpp \
|
||||
object/object.h \
|
||||
object/objectshield.cpp \
|
||||
object/objectshield.h \
|
||||
object/objectsnd.cpp \
|
||||
object/objectsnd.h \
|
||||
object/objectsort.cpp \
|
||||
object/parseobjectdock.cpp \
|
||||
object/parseobjectdock.h \
|
||||
object/waypoint.cpp \
|
||||
object/waypoint.h \
|
||||
observer/observer.cpp \
|
||||
observer/observer.h \
|
||||
osapi/dialogs.cpp \
|
||||
osapi/dialogs.h \
|
||||
osapi/osapi.cpp \
|
||||
osapi/osapi.h \
|
||||
osapi/osregistry.cpp \
|
||||
osapi/osregistry.h \
|
||||
osapi/outwnd.cpp \
|
||||
osapi/outwnd.h \
|
||||
palman/palman.cpp \
|
||||
palman/palman.h \
|
||||
parse/encrypt.cpp \
|
||||
parse/encrypt.h \
|
||||
parse/generic_log.cpp \
|
||||
parse/generic_log.h \
|
||||
parse/lua.cpp \
|
||||
parse/lua.h \
|
||||
parse/parselo.cpp \
|
||||
parse/parselo.h \
|
||||
parse/scripting.cpp \
|
||||
parse/scripting.h \
|
||||
parse/sexp.cpp \
|
||||
parse/sexp.h \
|
||||
particle/particle.cpp \
|
||||
particle/particle.h \
|
||||
pcxutils/pcxutils.cpp \
|
||||
pcxutils/pcxutils.h \
|
||||
pilotfile/pilotfile.cpp \
|
||||
pilotfile/pilotfile.h \
|
||||
pilotfile/pilotfile_convert.cpp \
|
||||
pilotfile/pilotfile_convert.h \
|
||||
pilotfile/plr.cpp \
|
||||
pilotfile/csg.cpp \
|
||||
pilotfile/plr_convert.cpp \
|
||||
pilotfile/csg_convert.cpp \
|
||||
pngutils/pngutils.cpp \
|
||||
pngutils/pngutils.h \
|
||||
physics/physics.cpp \
|
||||
physics/physics.h \
|
||||
playerman/managepilot.cpp \
|
||||
playerman/managepilot.h \
|
||||
playerman/player.h \
|
||||
playerman/playercontrol.cpp \
|
||||
popup/popup.cpp \
|
||||
popup/popup.h \
|
||||
popup/popupdead.cpp \
|
||||
popup/popupdead.h \
|
||||
radar/radar.cpp \
|
||||
radar/radar.h \
|
||||
radar/radardradis.cpp \
|
||||
radar/radardradis.h \
|
||||
radar/radarorb.cpp \
|
||||
radar/radarorb.h \
|
||||
radar/radarsetup.cpp \
|
||||
radar/radarsetup.h \
|
||||
render/3d.h \
|
||||
render/3dclipper.cpp \
|
||||
render/3ddraw.cpp \
|
||||
render/3dinternal.h \
|
||||
render/3dlaser.cpp \
|
||||
render/3dmath.cpp \
|
||||
render/3dsetup.cpp \
|
||||
ship/afterburner.cpp \
|
||||
ship/afterburner.h \
|
||||
ship/awacs.cpp \
|
||||
ship/awacs.h \
|
||||
ship/shield.cpp \
|
||||
ship/ship.cpp \
|
||||
ship/ship.h \
|
||||
ship/shipcontrails.cpp \
|
||||
ship/shipcontrails.h \
|
||||
ship/shipfx.cpp \
|
||||
ship/shipfx.h \
|
||||
ship/shiphit.cpp \
|
||||
ship/shiphit.h \
|
||||
ship/subsysdamage.h \
|
||||
sound/audiostr.cpp \
|
||||
sound/audiostr.h \
|
||||
sound/acm.cpp \
|
||||
sound/acm.h \
|
||||
sound/ds.cpp \
|
||||
sound/ds.h \
|
||||
sound/ds3d.cpp \
|
||||
sound/ds3d.h \
|
||||
sound/dscap.cpp \
|
||||
sound/dscap.h \
|
||||
sound/fsspeech.cpp \
|
||||
sound/fsspeech.h \
|
||||
sound/openal.cpp \
|
||||
sound/openal.h \
|
||||
sound/rtvoice.cpp \
|
||||
sound/rtvoice.h \
|
||||
sound/sound.cpp \
|
||||
sound/sound.h \
|
||||
sound/speech.cpp \
|
||||
sound/speech.h \
|
||||
sound/voicerec.cpp \
|
||||
sound/voicerec.h \
|
||||
sound/ogg/ogg.cpp \
|
||||
sound/ogg/ogg.h \
|
||||
species_defs/species_defs.cpp \
|
||||
species_defs/species_defs.h \
|
||||
starfield/nebula.cpp \
|
||||
starfield/nebula.h \
|
||||
starfield/starfield.cpp \
|
||||
starfield/starfield.h \
|
||||
starfield/supernova.cpp \
|
||||
starfield/supernova.h \
|
||||
stats/medals.cpp \
|
||||
stats/medals.h \
|
||||
stats/scoring.cpp \
|
||||
stats/scoring.h \
|
||||
stats/stats.cpp \
|
||||
stats/stats.h \
|
||||
tgautils/tgautils.cpp \
|
||||
tgautils/tgautils.h \
|
||||
ui/button.cpp \
|
||||
ui/checkbox.cpp \
|
||||
ui/gadget.cpp \
|
||||
ui/icon.cpp \
|
||||
ui/inputbox.cpp \
|
||||
ui/keytrap.cpp \
|
||||
ui/listbox.cpp \
|
||||
ui/radio.cpp \
|
||||
ui/scroll.cpp \
|
||||
ui/slider.cpp \
|
||||
ui/slider2.cpp \
|
||||
ui/ui.h \
|
||||
ui/uidefs.h \
|
||||
ui/uidraw.cpp \
|
||||
ui/uimouse.cpp \
|
||||
ui/window.cpp \
|
||||
weapon/beam.cpp \
|
||||
weapon/beam.h \
|
||||
weapon/corkscrew.cpp \
|
||||
weapon/corkscrew.h \
|
||||
weapon/emp.cpp \
|
||||
weapon/emp.h \
|
||||
weapon/flak.cpp \
|
||||
weapon/flak.h \
|
||||
weapon/muzzleflash.cpp \
|
||||
weapon/muzzleflash.h \
|
||||
weapon/shockwave.cpp \
|
||||
weapon/shockwave.h \
|
||||
weapon/swarm.cpp \
|
||||
weapon/swarm.h \
|
||||
weapon/trails.cpp \
|
||||
weapon/trails.h \
|
||||
weapon/weapons.cpp \
|
||||
weapon/weapon.h
|
||||
|
||||
## conditional includes follow:
|
||||
|
||||
## joystic support sources
|
||||
if FS2_OS_WIN32
|
||||
JOY_SOURCES = \
|
||||
io/joy.cpp \
|
||||
io/joy.h \
|
||||
io/joy_ff.cpp \
|
||||
io/joy_ff.h \
|
||||
io/sw_error.hpp \
|
||||
io/sw_force.h \
|
||||
io/sw_guid.hpp \
|
||||
io/swff_lib.cpp
|
||||
endif
|
||||
|
||||
if FS2_OS_UNIX
|
||||
JOY_SOURCES = \
|
||||
io/joy.h \
|
||||
io/joy_ff.h \
|
||||
io/joy_ff-sdl.cpp \
|
||||
io/joy-sdl.cpp
|
||||
endif
|
||||
|
||||
## Win32-specific sources
|
||||
if FS2_OS_WIN32
|
||||
WIN32_SOURCES = \
|
||||
directx/vasync.h \
|
||||
directx/vd3dtypes.h \
|
||||
directx/vddraw.h \
|
||||
directx/vdinput.h \
|
||||
directx/vdplay.h \
|
||||
directx/vdplobby.h \
|
||||
directx/vdsetup.h \
|
||||
directx/vdvp.h \
|
||||
globalincs/windebug.cpp \
|
||||
graphics/gl/GLAUX.H \
|
||||
graphics/gl/GLU.H \
|
||||
graphics/gl/Gl.h \
|
||||
graphics/gl/Glext.h \
|
||||
graphics/gl/wglext.h \
|
||||
osapi/monopub.h
|
||||
endif
|
||||
|
||||
## Unix-specific sources
|
||||
if FS2_OS_UNIX
|
||||
UNIX_SOURCES = \
|
||||
windows_stub/stubs.cpp \
|
||||
windows_stub/config.h
|
||||
endif
|
||||
|
||||
|
||||
## libcode.a
|
||||
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${WIN32_SOURCES} \
|
||||
${UNIX_SOURCES}
|
||||
|
||||
##
|
||||
## End CODE library
|
||||
##
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
##
|
||||
## Begin MAIN fs2 binary
|
||||
##
|
||||
|
||||
FS2OPEN_SOURCES = \
|
||||
freespace2/freespace.cpp \
|
||||
freespace2/freespace.h \
|
||||
freespace2/levelpaging.cpp \
|
||||
freespace2/levelpaging.h
|
||||
|
||||
fs2_open_@PACKAGE_VERSION@_DEBUG_SOURCES = \
|
||||
${FS2OPEN_SOURCES}
|
||||
|
||||
fs2_open_@PACKAGE_VERSION@_SOURCES = \
|
||||
${FS2OPEN_SOURCES}
|
||||
|
||||
fs2_open_@PACKAGE_VERSION@_DEBUG_LDADD = libcode.a ../mongoose/libmongoose.a
|
||||
fs2_open_@PACKAGE_VERSION@_LDADD = libcode.a ../mongoose/libmongoose.a
|
||||
|
||||
##
|
||||
## End MAIN binary
|
||||
##
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
##
|
||||
## Begin wxFRED2 binary
|
||||
##
|
||||
|
||||
wxFRED_SOURCES = \
|
||||
wxfred2/res/select.png.h \
|
||||
wxfred2/res/constz.png.h \
|
||||
wxfred2/res/constx.png.h \
|
||||
wxfred2/res/selectrot.png.h \
|
||||
wxfred2/res/constyz.png.h \
|
||||
wxfred2/res/constxy.png.h \
|
||||
wxfred2/res/wingform.png.h \
|
||||
wxfred2/res/zoomsel.png.h \
|
||||
wxfred2/res/constxz.png.h \
|
||||
wxfred2/res/consty.png.h \
|
||||
wxfred2/res/wingdisband.png.h \
|
||||
wxfred2/res/showdist.png.h \
|
||||
wxfred2/res/orbitsel.png.h \
|
||||
wxfred2/res/zoomext.png.h \
|
||||
wxfred2/res/rotlocal.png.h \
|
||||
wxfred2/res/selectmove.png.h \
|
||||
wxfred2/res/selectlock.png.h \
|
||||
wxfred2/res/selectlist.png.h \
|
||||
wxfred2/base/wxfred_base.h \
|
||||
wxfred2/base/wxfred_base.cpp \
|
||||
wxfred2/editors/dlgobjecteditor.h \
|
||||
wxfred2/editors/dlgobjecteditor.cpp \
|
||||
wxfred2/editors/dlgvoiceactingmanager.h \
|
||||
wxfred2/editors/frmdebriefingeditor.h \
|
||||
wxfred2/editors/dlgbackgroundeditor.cpp \
|
||||
wxfred2/editors/dlgmissionobjectiveseditor.cpp \
|
||||
wxfred2/editors/frmbriefingeditor.cpp \
|
||||
wxfred2/editors/frmteamloadouteditor.h \
|
||||
wxfred2/editors/dlgmissionobjectiveseditor.h \
|
||||
wxfred2/editors/dlgmissionspecseditor.h \
|
||||
wxfred2/editors/frmdebriefingeditor.cpp \
|
||||
wxfred2/editors/dlgfictionviewer.cpp \
|
||||
wxfred2/editors/dlgvoiceactingmanager.cpp \
|
||||
wxfred2/editors/dlgsoundenvironment.cpp \
|
||||
wxfred2/editors/frmcommandbriefingeditor.cpp \
|
||||
wxfred2/editors/frmbriefingeditor.h \
|
||||
wxfred2/editors/dlgshieldsystemeditor.h \
|
||||
wxfred2/editors/dlgreinforcementseditor.h \
|
||||
wxfred2/editors/dlgeventseditor.h \
|
||||
wxfred2/editors/frmteamloadouteditor.cpp \
|
||||
wxfred2/editors/frmcommandbriefingeditor.h \
|
||||
wxfred2/editors/frmwaypointeditor.h \
|
||||
wxfred2/editors/dlgasteroidfieldeditor.h \
|
||||
wxfred2/editors/dlgsetglobalshipflagseditor.cpp \
|
||||
wxfred2/editors/dlgshieldsystemeditor.cpp \
|
||||
wxfred2/editors/frmshipseditor.h \
|
||||
wxfred2/editors/dlgfictionviewer.h \
|
||||
wxfred2/editors/dlgreinforcementspicker.cpp \
|
||||
wxfred2/editors/frmcampaigneditor.cpp \
|
||||
wxfred2/editors/dlgasteroidfieldeditor.cpp \
|
||||
wxfred2/editors/dlgreinforcementspicker.h \
|
||||
wxfred2/editors/dlgreinforcementseditor.cpp \
|
||||
wxfred2/editors/frmcampaigneditor.h \
|
||||
wxfred2/editors/dlgbackgroundeditor.h \
|
||||
wxfred2/editors/frmshipseditor.cpp \
|
||||
wxfred2/editors/dlgeventseditor.cpp \
|
||||
wxfred2/editors/dlgsetglobalshipflagseditor.h \
|
||||
wxfred2/editors/frmwingeditor.h \
|
||||
wxfred2/editors/frmwingeditor.cpp \
|
||||
wxfred2/editors/frmwaypointeditor.cpp \
|
||||
wxfred2/editors/dlgsoundenvironment.h \
|
||||
wxfred2/editors/dlgmissionspecseditor.cpp \
|
||||
wxfred2/glcviewport.h \
|
||||
wxfred2/misc/dlgmissionstats.h \
|
||||
wxfred2/misc/dlgmissionstats.cpp \
|
||||
wxfred2/wxfred2.cpp \
|
||||
wxfred2/wxfred2.h \
|
||||
wxfred2/help/dlgsexphelp.h \
|
||||
wxfred2/help/dlgsexphelp.cpp \
|
||||
wxfred2/help/dlgaboutbox.h \
|
||||
wxfred2/help/dlgaboutbox.cpp \
|
||||
wxfred2/frmfred2.h \
|
||||
wxfred2/frmfred2.cpp
|
||||
|
||||
wxFRED2_@PACKAGE_VERSION@_DEBUG_SOURCES = \
|
||||
${wxFRED_SOURCES}
|
||||
|
||||
wxFRED2_@PACKAGE_VERSION@_SOURCES = \
|
||||
${wxFRED_SOURCES}
|
||||
|
||||
##
|
||||
## End wxFRED2 binary
|
||||
##
|
||||
###############################################################################
|
||||
@@ -7,8 +7,10 @@
|
||||
|
||||
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "def_files/def_files.h"
|
||||
#include "ai/ai_profiles.h"
|
||||
#include "globalincs/def_files.h"
|
||||
#include "def_files/def_files.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "localization/localize.h"
|
||||
#include "parse/parselo.h"
|
||||
@@ -78,7 +80,7 @@ void parse_ai_profiles_tbl(const char *filename)
|
||||
try
|
||||
{
|
||||
if (filename == NULL)
|
||||
read_file_text_from_array(defaults_get_file("ai_profiles.tbl"));
|
||||
read_file_text_from_default(defaults_get_file("ai_profiles.tbl"));
|
||||
else
|
||||
read_file_text(filename, CF_TYPE_TABLES);
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "ai/aibig.h"
|
||||
#include "ai/aigoals.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "freespace.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "iff_defs/iff_defs.h"
|
||||
#include "io/timer.h"
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
#include "autopilot/autopilot.h"
|
||||
#include "cmeasure/cmeasure.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "freespace.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "globalincs/linklist.h"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "ai/aiinternal.h"
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "freespace.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "asteroid/asteroid.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "freespace.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "globalincs/compatibility.h"
|
||||
#include "globalincs/linklist.h"
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
#include "autopilot/autopilot.h"
|
||||
#include "camera/camera.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "freespace.h"
|
||||
#include "gamesnd/eventmusic.h"
|
||||
#include "globalincs/def_files.h"
|
||||
#include "def_files/def_files.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "iff_defs/iff_defs.h"
|
||||
#include "io/timer.h"
|
||||
@@ -1276,7 +1276,7 @@ void parse_autopilot_table(char *filename)
|
||||
try
|
||||
{
|
||||
if (filename == NULL)
|
||||
read_file_text_from_array(defaults_get_file("autopilot.tbl"));
|
||||
read_file_text_from_default(defaults_get_file("autopilot.tbl"));
|
||||
else
|
||||
read_file_text(filename, CF_TYPE_TABLES);
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
add_executable(cfilearchiver EXCLUDE_FROM_ALL cfilearchiver.cpp)
|
||||
|
||||
ADD_DEFINITIONS(-DNO_SAFE_STRINGS)
|
||||
include_directories(${CODE_HEADERS})
|
||||
|
||||
set_target_properties(cfilearchiver
|
||||
PROPERTIES
|
||||
FOLDER "FSOTools"
|
||||
)
|
||||
|
||||
IF(MSVC)
|
||||
set_target_properties(cfilearchiver PROPERTIES
|
||||
COMPILE_DEFINITIONS_DEBUG "_DEBUG;PDB_DEBUGGING=1"
|
||||
)
|
||||
ENDIF(MSVC)
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
add_executable(cfileextractor EXCLUDE_FROM_ALL cfileextractor.cpp)
|
||||
|
||||
ADD_DEFINITIONS(-DNO_SAFE_STRINGS)
|
||||
include_directories(${CODE_HEADERS})
|
||||
|
||||
set_target_properties(cfileextractor
|
||||
PROPERTIES
|
||||
FOLDER "FSOTools"
|
||||
)
|
||||
|
||||
IF(MSVC)
|
||||
set_target_properties(cfileextractor PROPERTIES
|
||||
COMPILE_DEFINITIONS_DEBUG "_DEBUG;PDB_DEBUGGING=1"
|
||||
)
|
||||
ENDIF(MSVC)
|
||||
@@ -772,7 +772,7 @@ void os_validate_parms(int argc, char *argv[])
|
||||
if (parm_found == 0) {
|
||||
// if we got a -help, --help, -h, or -? then show the help text, otherwise show unknown option
|
||||
if (!stricmp(token, "-help") || !stricmp(token, "--help") || !stricmp(token, "-h") || !stricmp(token, "-?")) {
|
||||
if (FS_VERSION_REVIS == 0) {
|
||||
if (FS_VERSION_HAS_REVIS == 0) {
|
||||
printf("FreeSpace 2 Open, version %i.%i.%i\n", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "debugconsole/console.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "freespace.h"
|
||||
#include "gamehelp/contexthelp.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
|
||||
#include "cfile/cfile.h"
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "globalincs/def_files.h"
|
||||
#include "def_files/def_files.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "io/joy.h"
|
||||
#include "io/key.h"
|
||||
#include "localization/localize.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "def_files/def_files.h"
|
||||
|
||||
// z64: These enumerations MUST equal to those in controlsconfig.cpp...
|
||||
// z64: Really need a better way than this.
|
||||
@@ -810,7 +811,7 @@ void control_config_common_load_overrides()
|
||||
if (cf_exists_full("controlconfigdefaults.tbl", CF_TYPE_TABLES)) {
|
||||
read_file_text("controlconfigdefaults.tbl", CF_TYPE_TABLES);
|
||||
} else {
|
||||
read_file_text_from_array(defaults_get_file("controlconfigdefaults.tbl"));
|
||||
read_file_text_from_default(defaults_get_file("controlconfigdefaults.tbl"));
|
||||
}
|
||||
|
||||
reset_parse();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
#include "cutscene/cutscenes.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "freespace.h"
|
||||
#include "gamesequence/gamesequence.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "cutscene/oggplayer.h"
|
||||
#include "globalincs/def_files.h"
|
||||
#include "def_files/def_files.h"
|
||||
#include "def_files/def_files.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "graphics/gropengl.h"
|
||||
@@ -649,7 +650,6 @@ static void convert_YUV_to_RGB(yuv_buffer *yuv)
|
||||
}
|
||||
}
|
||||
|
||||
extern int Mouse_hidden;
|
||||
static void OGG_video_draw(theora_state *tstate)
|
||||
{
|
||||
yuv_buffer yuv;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "debris/debris.h"
|
||||
#include "fireball/fireballs.h"
|
||||
#include "freespace2/freespace.h"
|
||||
#include "freespace.h"
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "io/timer.h"
|
||||
|
||||
@@ -0,0 +1,356 @@
|
||||
|
||||
;; AI Profiles table. Incorporates stuff from the old difficulty.tbl
|
||||
;; plus additional flags previously covered under the blanket New AI
|
||||
;; flag.
|
||||
;;
|
||||
;; This is what the retail table would look like, but you don't have to
|
||||
;; specify it as it's stored internally by the game. This leaves you
|
||||
;; with four other slots to specify four other profiles. Every setting
|
||||
;; is optional, so if you don't specify something it will inherit from
|
||||
;; the FS2 retail setting. If you don't specify a default profile, it
|
||||
;; will set the default to retail as well.
|
||||
;;
|
||||
|
||||
#AI Profiles
|
||||
|
||||
$Default Profile: FS2 RETAIL
|
||||
|
||||
|
||||
$Profile Name: FS2 RETAIL
|
||||
|
||||
|
||||
;; Difficulty-related values; much of this was originally in
|
||||
;; difficulty.tbl. Each option specifies a list corresponding to the
|
||||
;; five skill values (Very Easy, Easy, Medium, Hard, Insane).
|
||||
|
||||
|
||||
;; speed of afterburner recharge
|
||||
$Player Afterburner Recharge Scale: 5, 3, 2, 1.5, 1
|
||||
|
||||
;; maximum damage inflicted by friendly beam fire
|
||||
$Max Beam Friendly Fire Damage: 0, 5, 10, 20, 30
|
||||
|
||||
;; factor applied to player countermeasure lifetime
|
||||
$Player Countermeasure Life Scale: 3, 2, 1.5, 1.25, 1
|
||||
|
||||
;; chance a countermeasure will be fired by an AI-controlled ship
|
||||
;; (this is scaled by ai_class)
|
||||
$AI Countermeasure Firing Chance: 0.2, 0.3, 0.5, 0.9, 1.1
|
||||
|
||||
;; seconds to add to the time it takes for an enemy to come in range of
|
||||
;; (i.e. target) a friendly ship
|
||||
$AI In Range Time: 2, 1.4, 0.75, 0, -1
|
||||
|
||||
;; AI ships will link ballistic primaries if ammo levels are greater
|
||||
;; than these percents
|
||||
$AI Always Links Ammo Weapons: 95, 80, 60, 40, 20
|
||||
$AI Maybe Links Ammo Weapons: 90, 60, 40, 20, 10
|
||||
|
||||
;; Multiplier that modifies the length and frequency of bursts used
|
||||
;; by the AI for ballistic primary weapons
|
||||
$Primary Ammo Burst Multiplier: 0, 0, 0, 0, 0
|
||||
|
||||
;; AI ships will link laser primaries if energy levels are greater
|
||||
;; than these percents
|
||||
$AI Always Links Energy Weapons: 100, 80, 60, 40, 20
|
||||
$AI Maybe Links Energy Weapons: 90, 60, 40, 20, 10
|
||||
|
||||
;; maximum number of missiles allowed to be homing in on a player at a
|
||||
;; given time (single-player only; no restriction in multiplayer)
|
||||
$Max Missiles Locked on Player: 2, 3, 4, 7, 99
|
||||
|
||||
;; maximum number of ships allowed to be attacking the player at a
|
||||
;; given time (single-player only; no restriction in multiplayer)
|
||||
$Max Player Attackers: 2, 3, 4, 5, 99
|
||||
|
||||
;; maximum number of active (i.e. 'thrown') asteroids that can be
|
||||
;; heading toward a friendly ship at any given time
|
||||
$Max Incoming Asteroids: 3, 4, 5, 7, 10
|
||||
|
||||
;; factor applied to damage suffered by the player
|
||||
$Player Damage Factor: 0.25, 0.5, 0.65, 0.85, 1
|
||||
|
||||
;; factor applied to subsystem damage suffered by the player
|
||||
;; (in addition to Player Damage Factor)
|
||||
$Player Subsys Damage Factor: 0.2, 0.4, 0.6, 0.8, 1
|
||||
|
||||
;; measure of time (in F1_0 units) after which the AI will recalculate
|
||||
;; the position of its target
|
||||
$Predict Position Delay: 2, 1.5, 1.333, 0.5, 0
|
||||
|
||||
;; seconds between each instance of an AI ship managing its shields
|
||||
$AI Shield Manage Delay: 5, 4, 2.5, 1.2, 0.1
|
||||
|
||||
;; factor applied to 'fire wait' for friendly ships
|
||||
$Friendly AI Fire Delay Scale: 2, 1.4, 1.25, 1.1, 1
|
||||
|
||||
;; factor applied to 'fire wait' for hostile ships
|
||||
$Hostile AI Fire Delay Scale: 4, 2.5, 1.75, 1.25, 1
|
||||
|
||||
;; factor applied to 'fire wait' for secondaries of friendly ships
|
||||
$Friendly AI Secondary Fire Delay Scale: 0.4, 0.6, 0.8, 1.0, 1.2
|
||||
|
||||
;; factor applied to 'fire wait' for secondaries of hostile ships
|
||||
$Hostile AI Secondary Fire Delay Scale: 1.4, 1.2, 1.0, 0.8, 0.6
|
||||
|
||||
;; factor applied to time it takes for enemy ships to turn
|
||||
$AI Turn Time Scale: 3, 2.2, 1.6, 1.3, 1
|
||||
|
||||
;; Percentage of the time where AI ships will use the glide attack
|
||||
;; when it is an option.
|
||||
$Glide Attack Percent: 0, 0, 0, 0, 0
|
||||
|
||||
;; Percentage of the time where AI ships will use circle strafe
|
||||
;; when it is an option.
|
||||
$Circle Strafe Percent: 0, 0, 0, 0, 0
|
||||
|
||||
;; Percentage of the time where AI ships will use glide to strafe
|
||||
;; capital ships when it is an option.
|
||||
$Glide Strafe Percent: 0, 0, 0, 0, 0
|
||||
|
||||
;; Percentage of the time where AI ships will randomly sidethrust in a
|
||||
;; dogfight.
|
||||
$Random Sidethrust Percent: 0, 0, 0, 0, 0
|
||||
|
||||
;; The amount of time required for the AI to detect
|
||||
;; (and try to break) dogfight stalemate.
|
||||
$Stalemate Time Threshold: 0, 0, 0, 0, 0
|
||||
|
||||
;; The maximum distance the AI and target must be within
|
||||
;; for a dogfight stalemate
|
||||
$Stalemate Distance Threshold: 0, 0, 0, 0, 0
|
||||
|
||||
;; Sets the factor applied to the speed at which the player's shields
|
||||
;; recharge
|
||||
$Player Shield Recharge Scale: 4, 2, 1.5, 1.25, 1
|
||||
|
||||
;; factor applied to the speed at which the player's weapons recharge
|
||||
$Player Weapon Recharge Scale: 10, 4, 2.5, 2, 1.5
|
||||
|
||||
;; maximum number of turrets on one ship allowed to be attacking a
|
||||
;; target at a given time
|
||||
$Max Turret Target Ownage: 3, 4, 7, 12, 19
|
||||
|
||||
;; maximum number of turrets on one ship allowed to be attacking the
|
||||
;; player at a given time
|
||||
$Max Turret Player Ownage: 3, 4, 7, 12, 19
|
||||
|
||||
;; the minimum percentage of the total assessed damage a player
|
||||
;; must inflict in order to be awarded a kill
|
||||
$Percentage Required For Kill Scale: 0.30, 0.30, 0.30, 0.30, 0.30
|
||||
|
||||
;; the minimum percentage of the total assessed damage a player
|
||||
;; must inflict in order to be awarded an assist
|
||||
$Percentage Required For Assist Scale: 0.15, 0.15, 0.15, 0.15, 0.15
|
||||
|
||||
;; in TvT and Coop missions all teammates will be granted this
|
||||
;; percentage of the capships score when someone scores a kill
|
||||
$Percentage Awarded For Capship Assist: 0.1, 0.2, 0.35, 0.5, 0.6
|
||||
|
||||
;; the amount to subtract from the player's score if they are
|
||||
;; repaired by a support ship
|
||||
$Repair Penalty: 10, 20, 35, 50, 60
|
||||
|
||||
;; time delay after bombs have been fired before they can collide
|
||||
;; with other weapons (ie. be shot down)
|
||||
$Delay Before Allowing Bombs to Be Shot Down: 1.5, 1.5, 1.5, 1.5, 1.5
|
||||
|
||||
;; Chance AI has to fire missiles at player is (value + 1) / 7 in every
|
||||
;; 10 second interval
|
||||
$Chance AI Has to Fire Missiles at Player: 0, 1, 2, 3, 4
|
||||
|
||||
;; The maximum amount of delay allowed before the AI will update its
|
||||
;; aim. Applies for small ships vs small ships
|
||||
$Max Aim Update Delay: 0, 0, 0, 0, 0
|
||||
|
||||
;; The maximum amount of delay allowed before turret AI will update its
|
||||
;; aim. Applies for turrets vs small ships
|
||||
$Turret Max Aim Update Delay: 0, 0, 0, 0, 0
|
||||
|
||||
;; Size of the player autoaim cone for each difficulty level
|
||||
;; Only affects the player. If the ship has autoaim, the wider FOV value
|
||||
;; will be used. Uses convergence.
|
||||
$Player Autoaim FOV: 0, 0, 0, 0, 0
|
||||
|
||||
;; The multiplier that affects at what range LOD switching will occur.
|
||||
;; NOTE THAT THIS IS NOT BY DIFFICULTY LEVEL (it's by model detail level
|
||||
;; in the Options menu)
|
||||
$Detail Distance Multiplier: 0.125, 0.25, 1.0, 4.0, 8.0
|
||||
|
||||
;; General AI-related flags. These were previously all lumped together
|
||||
;; under the New AI mission flag.
|
||||
|
||||
|
||||
;; if set, big ships can attack a beam turret that's firing on them
|
||||
;; from a ship that they don't currently have targeted.
|
||||
$big ships can attack beam turrets on untargeted ships: NO
|
||||
|
||||
;; if set, enables the new primary weapon selection method
|
||||
$smart primary weapon selection: NO
|
||||
|
||||
;; if set, enables the new secondary weapon selection method (including
|
||||
;; proper use of bomber+ missiles)
|
||||
$smart secondary weapon selection: NO
|
||||
|
||||
;; if set, shields will devote all their charging energy to the weakest
|
||||
;; quadrant(s) and not waste energy on fully-charged quadrants
|
||||
;; (previously was -smart_shields on the command line)
|
||||
$smart shield management: NO
|
||||
|
||||
;; if set, the AI will properly use brief pulses of afterburner power
|
||||
;; instead of afterburning until fuel is exhausted
|
||||
$smart afterburner management: NO
|
||||
|
||||
;; if set, allows an AI ship to switch to rapid fire for dumbfire
|
||||
;; missiles
|
||||
$allow rapid secondary dumbfire: NO
|
||||
|
||||
;; if set, causes huge turret weapons (including anti-capship beams) to
|
||||
;; not target bombs
|
||||
$huge turret weapons ignore bombs: NO
|
||||
|
||||
;; if set, removes the random turret fire delay (from .1 to .9 seconds)
|
||||
;; inserted in addition to AI Fire Delay Scale
|
||||
$don't insert random turret fire delay: NO
|
||||
|
||||
;; if set, triggers a hack to improves the accuracy of non-homing swarm
|
||||
;; missiles by firing them along the turret's last fire direction
|
||||
;; rather than the direction it currently faces
|
||||
$hack improve non-homing swarm turret fire accuracy: NO
|
||||
|
||||
;; if set, shockwaves will cause damage to small ship subsystems
|
||||
;; (like in FS1)
|
||||
$shockwaves damage small ship subsystems: NO
|
||||
|
||||
;; if set, ships will not be able to engage their jump drive if their
|
||||
;; navigation subsystem is damaged or destroyed
|
||||
$navigation subsystem governs warpout capability: NO
|
||||
|
||||
;; if set, will not use a minimum speed limit for docked ships
|
||||
;; (like in FS1)
|
||||
$ignore lower bound for minimum speed of docked ship: NO
|
||||
|
||||
;; if set, will remove the increased delay when weapons are linked
|
||||
$disable linked fire penalty: NO
|
||||
|
||||
;; if set, will not scale weapon damage according to capital/supercap
|
||||
;; (like in FS1)
|
||||
$disable weapon damage scaling: NO
|
||||
|
||||
;; if set, will add the weapon velocity to the firing ship's velocity
|
||||
$use additive weapon velocity: NO
|
||||
|
||||
;; if set, will dampening closer to real newtonian physics
|
||||
$use newtonian dampening: NO
|
||||
|
||||
;; if set, beam damage is counted when calculating kills and assists
|
||||
$include beams for kills and assists: NO
|
||||
|
||||
;; if set, kills gain score based on the percentage damage the killer
|
||||
;; inflicted on the dead ship
|
||||
$score kills based on damage caused: NO
|
||||
|
||||
;; if set, kills gain score based on the percentage damage the player
|
||||
;; gaining the assist inflicted on the dead ship
|
||||
$score assists based on damage caused: NO
|
||||
|
||||
;; if set, players (rather than just their team) can gain score from
|
||||
;; events in multiplayer
|
||||
$allow event and goal scoring in multiplayer: NO
|
||||
|
||||
;; if set, the AI will properly link primaries according to
|
||||
;; specified percentages of energy levels, instead of retail behavior
|
||||
;; where it mistakenly linked according to absolute energy levels
|
||||
$fix linked primary weapon decision bug: NO
|
||||
|
||||
;; if set, prevents turrets from targeting bombs beyond maximum
|
||||
;; range of the weapons of the turret
|
||||
$prevent turrets targeting too distant bombs: NO
|
||||
|
||||
;; if set, prevents turrets from trying to target subsystems beyond
|
||||
;; their fov limits, also keeps the turret subsystem targeting
|
||||
;; preference order intact regardless of the angle to the target
|
||||
$smart subsystem targeting for turrets: NO
|
||||
|
||||
;; if set, heat-seeking missiles will not home in on stealth ships
|
||||
;; (this mirrors the established behavior where heat-seeking missiles
|
||||
;; do not home in on ships that are hidden from sensors)
|
||||
$fix heat seekers homing on stealth ships bug: NO
|
||||
|
||||
;; allow a player to commit into a multiplayer game without primaries
|
||||
$multi allow empty primaries: NO
|
||||
|
||||
;; allow a player to commit into a multiplayer game without secondaries
|
||||
$multi allow empty secondaries: NO
|
||||
|
||||
;; if set, allows turrets target other weapons than bombs assuming
|
||||
;; it is within allowed target priorities
|
||||
$allow turrets target weapons freely: NO
|
||||
|
||||
;; if set forces turrets to use only the set turret fov limits and
|
||||
;; ignore hard coded limits (with 'fire_down_normals' flag)
|
||||
$use only single fov for turrets: NO
|
||||
|
||||
;; allow AI ships to dodge weapons vertically as well as horizontally
|
||||
$allow vertical dodge: NO
|
||||
|
||||
;; If set makes beam turrets use same FOV rules as other weapons do.
|
||||
;; Prevents beam from a turret from following the target beyond the
|
||||
;; turret's FOV.
|
||||
$force beam turrets to use normal fov: NO
|
||||
|
||||
;; Fixes a bug where AI class is not properly set if set in the mission
|
||||
;; This should be YES if you want anything in AI.tbl to mean anything
|
||||
$fix AI class bug: NO
|
||||
|
||||
;; TBD
|
||||
$turrets ignore targets radius in range checks: NO
|
||||
|
||||
;; If set, the AI will NOT make extra effort to avoid ramming the player
|
||||
;; during dogfights. This results in more aggressive AI.
|
||||
$no extra collision avoidance vs player: NO
|
||||
|
||||
;; If set, the game will not check if the dying ship is a player's
|
||||
;; wingman, or if the maximum number of screams have been played, or
|
||||
;; even if the dying ship is on the player's team before making it give
|
||||
;; a death scream
|
||||
$perform fewer checks for death screams: NO
|
||||
|
||||
;; TBD
|
||||
$advanced turret fov edge checks: NO
|
||||
|
||||
;; TBD
|
||||
$require turrets to have target in fov: NO
|
||||
|
||||
;; If set, allows shield management for all ships
|
||||
;; (including capships).
|
||||
$all ships manage shields: NO
|
||||
|
||||
;; If set, ai aims using ship center instead of first gunpoint
|
||||
$ai aims from ship center: NO
|
||||
|
||||
;; If set, allows AI fighters to link their weapons at the beginning of
|
||||
;; a mission instead of imposing a delay of 30s to 120s
|
||||
$allow primary link at mission start: NO
|
||||
|
||||
;; If set, prevents beams from instantly killing all weapons from first
|
||||
;; hit, instead allows weapon hitpoints to be used instead
|
||||
$allow beams to damage bombs: NO
|
||||
|
||||
;; TBD
|
||||
$disable weapon damage scaling for player: NO
|
||||
|
||||
;; TBD
|
||||
$countermeasures affect aspect seekers: NO
|
||||
|
||||
;; TBD
|
||||
$ai path mode: normal
|
||||
|
||||
;; TBD
|
||||
$no warp camera: NO
|
||||
|
||||
;; If set, this flag overrides the retail behavior whereby a ship
|
||||
;; assigned to guard a ship in a wing will instead guard the entire wing
|
||||
$ai guards specific ship in wing: NO
|
||||
|
||||
#End
|
||||
@@ -0,0 +1,30 @@
|
||||
#Autopilot
|
||||
|
||||
$Link Distance: 1000
|
||||
|
||||
$No Nav Selected:
|
||||
+Msg: Cannot engage autopilot, no navpoint selected.
|
||||
+Snd File: none
|
||||
$Gliding:
|
||||
+Msg: Cannot engage autopilot while gliding.
|
||||
+Snd File: none
|
||||
$Too Close:
|
||||
+Msg: Cannot engage autopilot: waypoint too close.
|
||||
+Snd File: none
|
||||
$Hostiles:
|
||||
+Msg: Cannot engage autopilot: hostile craft near.
|
||||
+Snd File: none
|
||||
$Linked:
|
||||
+Msg: Autopilot Linked
|
||||
+Snd File: none
|
||||
$Hazard:
|
||||
+Msg: Cannot engage autopilot: Hazard Near
|
||||
+Snd File: none
|
||||
$Support Present:
|
||||
+Msg: Cannot engage autopilot: Support Ship Present
|
||||
+Snd File: none
|
||||
$Support Working:
|
||||
+Msg: Cannot engage autopilot: Support Ship is rearming or repairing a ship
|
||||
+Snd File: none
|
||||
|
||||
#END
|
||||
@@ -0,0 +1,19 @@
|
||||
uniform sampler2D bloomed;
|
||||
uniform float bloom_intensity;
|
||||
uniform int levels;
|
||||
void main() { // Global constant
|
||||
vec4 color_out = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
// Bloom
|
||||
if (bloom_intensity > 0.0) {
|
||||
vec3 bloom = vec3(0.0, 0.0, 0.0);
|
||||
float factor = 0.0;
|
||||
for (int mipmap = 0; mipmap < levels; ++mipmap) {
|
||||
float scale = 1.0/exp2(float(mipmap));
|
||||
factor += scale;
|
||||
bloom += texture2DLod(bloomed, gl_TexCoord[0].xy, float(mipmap)).rgb * scale;
|
||||
}
|
||||
bloom /= factor;
|
||||
color_out.rgb += bloom * bloom_intensity;
|
||||
}
|
||||
gl_FragColor = color_out;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
uniform float texSize;
|
||||
uniform float tapSize;
|
||||
uniform int level;
|
||||
uniform sampler2D tex;
|
||||
// Gaussian Blur
|
||||
// 2 passes required
|
||||
void main()
|
||||
{
|
||||
// Echelon9 - Due to Apple not implementing array constructors in OS X's
|
||||
// GLSL implementation we need to setup the arrays this way as a workaround
|
||||
float BlurWeights[6];
|
||||
BlurWeights[5] = 0.0402;
|
||||
BlurWeights[4] = 0.0623;
|
||||
BlurWeights[3] = 0.0877;
|
||||
BlurWeights[2] = 0.1120;
|
||||
BlurWeights[1] = 0.1297;
|
||||
BlurWeights[0] = 0.1362;
|
||||
vec4 sum = texture2DLod(tex, gl_TexCoord[0].xy, float(level)) * BlurWeights[0];
|
||||
#ifdef PASS_0
|
||||
for (int i = 1; i < 6; i++) {
|
||||
sum += texture2DLod(tex, vec2(clamp(gl_TexCoord[0].x - float(i) * (texSize) * tapSize, 0.0, 1.0), gl_TexCoord[0].y), float(level)) * BlurWeights[i];
|
||||
sum += texture2DLod(tex, vec2(clamp(gl_TexCoord[0].x + float(i) * (texSize) * tapSize, 0.0, 1.0), gl_TexCoord[0].y), float(level)) * BlurWeights[i];
|
||||
}
|
||||
#endif
|
||||
#ifdef PASS_1
|
||||
for (int i = 1; i < 6; i++) {
|
||||
sum += texture2DLod(tex, vec2(gl_TexCoord[0].x, clamp(gl_TexCoord[0].y - float(i) * (texSize) * tapSize, 0.0, 1.0)), float(level)) * BlurWeights[i];
|
||||
sum += texture2DLod(tex, vec2(gl_TexCoord[0].x, clamp(gl_TexCoord[0].y + float(i) * (texSize) * tapSize, 0.0, 1.0)), float(level)) * BlurWeights[i];
|
||||
}
|
||||
#endif
|
||||
gl_FragColor = vec4(sum.rgb, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
uniform sampler2D tex;
|
||||
const float Luminance = 0.08;
|
||||
const float fMiddleGray = 0.2;
|
||||
const float fWhiteCutoff = 0.4;
|
||||
const float threshold = 1.0;
|
||||
// High-pass filter
|
||||
float luminance(vec3 color)
|
||||
{
|
||||
return dot(color, vec3(0.299, 0.587, 0.114));
|
||||
}
|
||||
void main() {
|
||||
vec4 ColorOut = texture2D(tex, gl_TexCoord[0].xy);
|
||||
//ColorOut *= fMiddleGray / (Luminance + 0.001);
|
||||
//ColorOut *= (1.0 + (ColorOut / (fWhiteCutoff * fWhiteCutoff)));
|
||||
//ColorOut -= 6.0;
|
||||
//ColorOut /= (10.0 + ColorOut);
|
||||
gl_FragColor.rgb = max(vec3(0.0, 0.0, 0.0), ColorOut.rgb - vec3(1.0, 1.0, 1.0));
|
||||
gl_FragColor.a = 1.0;
|
||||
//float luminance = luminance(ColorOut.rgb);
|
||||
//gl_FragColor.rgb = luminance > threshold ? ColorOut.rgb : vec3(0.0);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
#ControlConfigOverride
|
||||
#End
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* create based on the source.
|
||||
*/
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "def_files/def_files.h"
|
||||
|
||||
#include <iterator>
|
||||
|
||||
struct def_file
|
||||
{
|
||||
const char* filename;
|
||||
const void* contents;
|
||||
const size_t size;
|
||||
};
|
||||
|
||||
#include "def_files/generated_def_files-generic.h"
|
||||
|
||||
default_file defaults_get_file(const char *filename)
|
||||
{
|
||||
default_file def;
|
||||
|
||||
auto endIter = std::end(Default_files);
|
||||
for (auto iter = std::begin(Default_files); iter != endIter; ++iter)
|
||||
{
|
||||
if (!stricmp(iter->filename, filename))
|
||||
{
|
||||
def.data = iter->contents;
|
||||
def.size = iter->size;
|
||||
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
||||
//WMC - This is really bad, because it means we have a default table missing.
|
||||
Error(LOCATION, "Default table '%s' missing from executable - contact a coder.", filename);
|
||||
return def;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* create based on the source.
|
||||
*/
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "def_files/def_files.h"
|
||||
|
||||
#include <iterator>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
|
||||
struct def_file
|
||||
{
|
||||
const char* filename;
|
||||
const TCHAR* resource_name;
|
||||
};
|
||||
|
||||
def_file Default_files[] =
|
||||
{
|
||||
#include "def_files/generated_def_files-win32.h"
|
||||
};
|
||||
|
||||
default_file defaults_get_file(const char *filename)
|
||||
{
|
||||
default_file def;
|
||||
|
||||
auto endIter = std::end(Default_files);
|
||||
for (auto iter = std::begin(Default_files); iter != endIter; ++iter)
|
||||
{
|
||||
if (!stricmp(iter->filename, filename))
|
||||
{
|
||||
HRSRC resource = FindResource(nullptr, iter->resource_name, RT_RCDATA);
|
||||
|
||||
if (resource == nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
HGLOBAL resHandle = LoadResource(nullptr, resource);
|
||||
|
||||
if (resHandle == nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
def.data = LockResource(resHandle);
|
||||
def.size = SizeofResource(nullptr, resource);
|
||||
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
||||
//WMC - This is really bad, because it means we have a default table missing.
|
||||
Error(LOCATION, "Default table '%s' missing from executable - contact a coder.", filename);
|
||||
|
||||
def.data = nullptr;
|
||||
def.data = 0;
|
||||
return def;
|
||||
}
|
||||
@@ -11,10 +11,18 @@
|
||||
#ifndef __DEF_FILES_H_
|
||||
#define __DEF_FILES_H_
|
||||
|
||||
//Used to retrieve pointer to file data from def_files.cpp
|
||||
const char *defaults_get_file(const char *filename);
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
//WMC -
|
||||
struct default_file
|
||||
{
|
||||
const void* data;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
//Used to retrieve pointer to file data from def_files.cpp
|
||||
default_file defaults_get_file(const char *filename);
|
||||
|
||||
//WMC -
|
||||
//There are three parts to adding a file
|
||||
//:PART 1: Add variable declaration for new file
|
||||
//:PART 2: Add filename of default file to Default_files[] array, along with content variable
|
||||
@@ -0,0 +1,7 @@
|
||||
void main()
|
||||
{
|
||||
gl_FragData[0] = vec4(0.0, 0.0, 0.0, 1.0); // color
|
||||
gl_FragData[1] = vec4(0.0, 0.0, -1000000.0, 1.0); // position
|
||||
gl_FragData[2] = vec4(0.0, 0.0, 0.0, 1.0); // normal
|
||||
gl_FragData[3] = vec4(0.0, 0.0, 0.0, 0.0); // specular
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_Position = gl_Vertex;
|
||||
gl_FrontColor = vec4(1.0);
|
||||
gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
uniform sampler2D ColorBuffer;
|
||||
uniform sampler2D NormalBuffer;
|
||||
uniform sampler2D PositionBuffer;
|
||||
uniform sampler2D SpecBuffer;
|
||||
uniform float specFactor;
|
||||
uniform float invScreenWidth;
|
||||
uniform float invScreenHeight;
|
||||
uniform int lightType;
|
||||
varying vec3 lightPosition;
|
||||
uniform float lightRadius;
|
||||
varying vec3 beamVec;
|
||||
uniform vec3 diffuseLightColor;
|
||||
uniform vec3 specLightColor;
|
||||
uniform float coneAngle;
|
||||
uniform float coneInnerAngle;
|
||||
uniform bool dualCone;
|
||||
uniform vec3 coneDir;
|
||||
|
||||
#define SPEC_INTENSITY_POINT 5.3 // Point light
|
||||
#define SPEC_INTENSITY_DIRECTIONAL 3.0 // Directional light
|
||||
#define SPECULAR_FACTOR 1.75
|
||||
#define SPECULAR_ALPHA 0.1
|
||||
#define SPEC_FACTOR_NO_SPEC_MAP 0.6
|
||||
#define ENV_ALPHA_FACTOR 0.3
|
||||
#define GLOW_MAP_INTENSITY 1.5
|
||||
#define AMBIENT_LIGHT_BOOST 1.0
|
||||
vec3 FresnelSchlick(vec3 specColor, vec3 light, vec3 halfVec)
|
||||
{
|
||||
return specColor + (vec3(1.0) - specColor) * pow(1.0 - clamp(dot(light, halfVec), 0.0, 1.0), 5.0);
|
||||
}
|
||||
vec3 SpecularBlinnPhong(vec3 specColor, vec3 light, vec3 normal, vec3 halfVec, float specPower, float dotNL)
|
||||
{
|
||||
return FresnelSchlick(max(specColor, vec3(0.04)), light, halfVec) * ((specPower + 2) / 8 ) * pow(clamp(dot(normal, halfVec), 0.0, 1.0), specPower) * dotNL;
|
||||
}
|
||||
vec4 SpecularLegacy(vec4 specColor, vec3 normal, vec3 halfVec, float specPower)
|
||||
{
|
||||
return specColor * pow(clamp(dot(normal, halfVec), 0.0, 1.0), specPower);
|
||||
}
|
||||
void main()
|
||||
{
|
||||
vec2 screenPos = gl_FragCoord.xy * vec2(invScreenWidth, invScreenHeight);
|
||||
vec3 position = texture2D(PositionBuffer, screenPos).xyz;
|
||||
|
||||
if(abs(dot(position, position)) < 0.1)
|
||||
discard;
|
||||
vec3 lightDir = lightPosition - position.xyz;
|
||||
float dist = length(lightDir);
|
||||
float attenuation = (1.0 - dist/lightRadius);
|
||||
if(lightType == 2)
|
||||
{
|
||||
float coneDot = dot(normalize(-lightDir), coneDir);
|
||||
if(dualCone) {
|
||||
if(abs(coneDot) < coneAngle)
|
||||
discard;
|
||||
else
|
||||
attenuation *= smoothstep(coneAngle, coneInnerAngle, abs(coneDot));
|
||||
} else {
|
||||
if(coneDot < coneAngle)
|
||||
discard;
|
||||
else
|
||||
attenuation *= smoothstep(coneAngle, coneInnerAngle, coneDot);
|
||||
}
|
||||
}
|
||||
if(dist > lightRadius && lightType != 1)
|
||||
discard;
|
||||
vec3 color = texture2D(ColorBuffer, screenPos).rgb;
|
||||
vec4 normal = texture2D(NormalBuffer, screenPos);
|
||||
vec4 specColor = texture2D(SpecBuffer, screenPos);
|
||||
float gloss = specColor.a;
|
||||
vec3 eyeDir = normalize(-position);
|
||||
|
||||
if(lightType == 1)
|
||||
{
|
||||
float beamLength = length(beamVec);
|
||||
vec3 beamDir = beamVec / beamLength;
|
||||
// Get nearest point on line
|
||||
float neardist = clamp(dot(lightDir, beamDir), 0.0, beamLength);
|
||||
// Move back from the endpoint of the beam along the beam by the distance we calculated
|
||||
vec3 nearest = lightPosition - beamDir * neardist;
|
||||
lightDir = nearest - position.xyz;
|
||||
dist = length(lightDir);
|
||||
if(dist > lightRadius)
|
||||
discard;
|
||||
}
|
||||
lightDir /= dist;
|
||||
vec3 halfVec = normalize(lightDir + eyeDir);
|
||||
float NdotHV = clamp(dot(normal.xyz, halfVec), 0.0, 1.0);
|
||||
float NdotL = clamp(dot(normal.xyz, lightDir), 0.0, 1.0);
|
||||
gl_FragData[0].rgb = color * (diffuseLightColor * NdotL * attenuation);
|
||||
gl_FragData[0].rgb += SpecularBlinnPhong(specLightColor, lightDir, normal.xyz, halfVec, exp2(10.0 * gloss + 1.0), NdotL).rgb * specColor.rgb * attenuation;
|
||||
gl_FragData[0].a = 1.0;
|
||||
gl_FragData[0] = max(gl_FragData[0], vec4(0.0));
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
uniform vec3 scale;
|
||||
uniform int lightType;
|
||||
|
||||
varying vec3 lightPosition;
|
||||
varying vec3 beamVec;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * vec4(gl_Vertex.xyz * scale,1.0);
|
||||
lightPosition = gl_ModelViewMatrix[3].xyz;
|
||||
if(lightType == 1)
|
||||
beamVec = vec3(gl_ModelViewMatrix * vec4(0.0, 0.0, -scale.z, 0.0));
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
uniform sampler2D baseMap;
|
||||
uniform sampler2D depthMap;
|
||||
uniform float window_width;
|
||||
uniform float window_height;
|
||||
uniform sampler2D distMap;
|
||||
uniform sampler2D frameBuffer;
|
||||
varying float offset_out;
|
||||
void main()
|
||||
{
|
||||
vec2 depthCoord = vec2(gl_FragCoord.x / window_width, gl_FragCoord.y / window_height);
|
||||
vec4 fragmentColor = texture2D(baseMap, gl_TexCoord[0].xy)*gl_Color.a;
|
||||
vec2 distortion = texture2D(distMap, gl_TexCoord[0].xy+vec2(0.0, offset_out)).rg;
|
||||
float alpha = clamp(dot(fragmentColor.rgb,vec3(0.3333))*10.0,0.0,1.0);
|
||||
distortion = ((distortion - 0.5) * 0.01) * alpha;
|
||||
gl_FragColor = texture2D(frameBuffer,depthCoord+distortion);
|
||||
gl_FragColor.a = alpha;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
attribute float radius;
|
||||
varying float offset_out;
|
||||
uniform float use_offset;
|
||||
void main()
|
||||
{
|
||||
gl_Position = ftransform();
|
||||
offset_out = radius * use_offset;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_FrontColor = gl_Color;
|
||||
gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
#ifdef __GLSL_CG_DATA_TYPES
|
||||
// Check necessary for ATI specific behavior
|
||||
gl_ClipVertex = (gl_ModelViewMatrix * gl_Vertex);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
uniform sampler2D baseMap;
|
||||
uniform int textured;
|
||||
void main()
|
||||
{
|
||||
vec4 fragmentColor = mix(gl_Color, texture2D(baseMap, gl_TexCoord[0].xy)*gl_Color.a, (float)textured);
|
||||
gl_FragColor = fragmentColor;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
uniform sampler2D baseMap;
|
||||
uniform sampler2D depthMap;
|
||||
uniform float window_width;
|
||||
uniform float window_height;
|
||||
uniform float nearZ;
|
||||
uniform float farZ;
|
||||
uniform int linear_depth;
|
||||
uniform int srgb;uniform int blend_alpha;
|
||||
varying float radius_p;
|
||||
varying vec4 position_p;
|
||||
#define SRGB_GAMMA 2.2
|
||||
void main()
|
||||
{
|
||||
vec4 fragmentColor = texture2D(baseMap, gl_TexCoord[0].xy);
|
||||
fragmentColor.rgb = mix(fragmentColor.rgb, pow(fragmentColor.rgb, vec3(SRGB_GAMMA)), float(srgb));
|
||||
fragmentColor *= mix(gl_Color, vec4(pow(gl_Color.rgb, vec3(SRGB_GAMMA)), gl_Color.a), float(srgb));
|
||||
vec2 offset = vec2(radius_p * abs(0.5 - gl_TexCoord[0].x) * 2.0, radius_p * abs(0.5 - gl_TexCoord[0].y) * 2.0);
|
||||
float offset_len = length(offset);
|
||||
if ( offset_len > radius_p ) {
|
||||
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
return;
|
||||
}
|
||||
vec2 depthCoord = vec2(gl_FragCoord.x / window_width, gl_FragCoord.y / window_height );
|
||||
vec4 sceneDepth = texture2D(depthMap, depthCoord);
|
||||
float sceneDepthLinear;
|
||||
float fragDepthLinear;
|
||||
if ( linear_depth == 1 ) {
|
||||
sceneDepthLinear = -sceneDepth.z;
|
||||
fragDepthLinear = -position_p.z;
|
||||
} else {
|
||||
sceneDepthLinear = ( 2.0 * farZ * nearZ ) / ( farZ + nearZ - sceneDepth.x * (farZ-nearZ) );
|
||||
fragDepthLinear = ( 2.0 * farZ * nearZ ) / ( farZ + nearZ - gl_FragCoord.z * (farZ-nearZ) );
|
||||
}
|
||||
// assume UV of 0.5, 0.5 is the centroid of this sphere volume
|
||||
float depthOffset = sqrt(pow(radius_p, 2.0) - pow(offset_len, 2.0));
|
||||
float frontDepth = fragDepthLinear - depthOffset;
|
||||
float backDepth = fragDepthLinear + depthOffset;
|
||||
float intensity = smoothstep(max(nearZ, frontDepth), backDepth, sceneDepthLinear);
|
||||
fragmentColor.rgb *= (srgb == 1) ? 1.5 : 1.0;
|
||||
fragmentColor = (blend_alpha == 1) ? vec4(fragmentColor.rgb, fragmentColor.a * intensity) : vec4(fragmentColor.rgb * intensity, fragmentColor.a);
|
||||
gl_FragColor = max(fragmentColor, vec4(0.0));
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
#extension GL_EXT_geometry_shader4 : enable
|
||||
varying in vec3 up_g[];
|
||||
varying in float radius_g[];
|
||||
varying out float radius_p;
|
||||
varying out vec4 position_p;
|
||||
void main(void)
|
||||
{
|
||||
vec3 forward_vec = vec3(0.0, 0.0, 1.0);
|
||||
vec3 up_vec = normalize(up_g[0]);
|
||||
vec3 right_vec = cross(forward_vec, up_vec);
|
||||
vec4 pos = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
right_vec = normalize(right_vec);
|
||||
pos = (gl_PositionIn[0] - vec4(radius_g[0] * up_vec, 0.0) - vec4(radius_g[0] * right_vec, 0.0));
|
||||
gl_Position = gl_ProjectionMatrix * pos;
|
||||
position_p = pos;
|
||||
gl_TexCoord[0] = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
radius_p = radius_g[0];
|
||||
gl_FrontColor = gl_FrontColorIn[0];
|
||||
gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
EmitVertex();
|
||||
pos = (gl_PositionIn[0] - vec4(radius_g[0] * up_vec, 0.0) + vec4(radius_g[0] * right_vec, 0.0));
|
||||
gl_Position = gl_ProjectionMatrix * pos;
|
||||
position_p = pos;
|
||||
gl_TexCoord[0] = vec4(0.0, 1.0, 0.0, 0.0);
|
||||
radius_p = radius_g[0];
|
||||
gl_FrontColor = gl_FrontColorIn[0];
|
||||
gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
EmitVertex();
|
||||
pos = (gl_PositionIn[0] + vec4(radius_g[0] * up_vec, 0.0) - vec4(radius_g[0] * right_vec, 0.0));
|
||||
gl_Position = gl_ProjectionMatrix * pos;
|
||||
position_p = pos;
|
||||
gl_TexCoord[0] = vec4(1.0, 0.0, 0.0, 0.0);
|
||||
radius_p = radius_g[0];
|
||||
gl_FrontColor = gl_FrontColorIn[0];
|
||||
gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
EmitVertex();
|
||||
pos = (gl_PositionIn[0] + vec4(radius_g[0] * up_vec, 0.0) + vec4(radius_g[0] * right_vec, 0.0));
|
||||
gl_Position = gl_ProjectionMatrix * pos;
|
||||
position_p = pos;
|
||||
gl_TexCoord[0] = vec4(1.0, 1.0, 0.0, 0.0);
|
||||
radius_p = radius_g[0];
|
||||
gl_FrontColor = gl_FrontColorIn[0];
|
||||
gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
EmitVertex();
|
||||
EndPrimitive();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
attribute float radius;
|
||||
#ifdef FLAG_EFFECT_GEOMETRY
|
||||
attribute vec3 uvec;
|
||||
varying vec3 up_g;
|
||||
varying float radius_g;
|
||||
#else
|
||||
varying float radius_p;
|
||||
varying vec4 position_p;
|
||||
#endif
|
||||
#ifdef FLAG_EFFECT_DISTORTION
|
||||
varying float offset_out;
|
||||
uniform float use_offset;
|
||||
#endif
|
||||
void main()
|
||||
{
|
||||
#ifdef FLAG_EFFECT_GEOMETRY
|
||||
radius_g = radius;
|
||||
up_g = uvec;
|
||||
gl_Position = gl_ModelViewMatrix * gl_Vertex;
|
||||
#else
|
||||
radius_p = radius;
|
||||
gl_Position = ftransform();
|
||||
position_p = gl_ModelViewMatrix * gl_Vertex;
|
||||
#endif
|
||||
#ifdef FLAG_EFFECT_DISTORTION
|
||||
offset_out = radius * use_offset;
|
||||
#endif
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_FrontColor = gl_Color;
|
||||
gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
#ifdef __GLSL_CG_DATA_TYPES
|
||||
// Check necessary for ATI specific behavior
|
||||
gl_ClipVertex = (gl_ModelViewMatrix * gl_Vertex);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#Fonts
|
||||
|
||||
$Font: font01.vf
|
||||
$Font: font02.vf
|
||||
$Font: font03.vf
|
||||
|
||||
#End
|
||||
@@ -0,0 +1,510 @@
|
||||
#extension GL_EXT_gpu_shader4 : enable
|
||||
#define FXAA_EARLY_EXIT 1
|
||||
#define FXAA_DISCARD 1
|
||||
#ifndef FXAA_FAST_PIXEL_OFFSET
|
||||
#ifdef GL_EXT_gpu_shader4
|
||||
#define FXAA_FAST_PIXEL_OFFSET 1
|
||||
#endif
|
||||
#ifdef GL_NV_gpu_shader5
|
||||
#extension GL_NV_gpu_shader5 : enable
|
||||
#define FXAA_FAST_PIXEL_OFFSET 1
|
||||
#endif
|
||||
#ifdef GL_ARB_gpu_shader5
|
||||
#extension GL_ARB_gpu_shader5 : enable
|
||||
#define FXAA_FAST_PIXEL_OFFSET 1
|
||||
#endif
|
||||
#ifndef FXAA_FAST_PIXEL_OFFSET
|
||||
#define FXAA_FAST_PIXEL_OFFSET 0
|
||||
#endif
|
||||
#endif
|
||||
#ifndef FXAA_GATHER4_ALPHA
|
||||
#ifdef GL_ARB_gpu_shader5
|
||||
#extension GL_ARB_gpu_shader5 : enable
|
||||
#define FXAA_GATHER4_ALPHA 1
|
||||
#endif
|
||||
#ifdef GL_NV_gpu_shader5
|
||||
#extension GL_NV_gpu_shader5 : enable
|
||||
#define FXAA_GATHER4_ALPHA 1
|
||||
#endif
|
||||
#ifndef FXAA_GATHER4_ALPHA
|
||||
#define FXAA_GATHER4_ALPHA 0
|
||||
#endif
|
||||
#endif
|
||||
#if (FXAA_QUALITY_PRESET == 10)
|
||||
#define FXAA_QUALITY_PS 3
|
||||
#define FXAA_QUALITY_P0 1.5
|
||||
#define FXAA_QUALITY_P1 3.0
|
||||
#define FXAA_QUALITY_P2 12.0
|
||||
#endif
|
||||
#if (FXAA_QUALITY_PRESET == 11)
|
||||
#define FXAA_QUALITY_PS 4
|
||||
#define FXAA_QUALITY_P0 1.0
|
||||
#define FXAA_QUALITY_P1 1.5
|
||||
#define FXAA_QUALITY_P2 3.0
|
||||
#define FXAA_QUALITY_P3 12.0
|
||||
#endif
|
||||
#if (FXAA_QUALITY_PRESET == 12)
|
||||
#define FXAA_QUALITY_PS 5
|
||||
#define FXAA_QUALITY_P0 1.0
|
||||
#define FXAA_QUALITY_P1 1.5
|
||||
#define FXAA_QUALITY_P2 2.0
|
||||
#define FXAA_QUALITY_P3 4.0
|
||||
#define FXAA_QUALITY_P4 12.0
|
||||
#endif
|
||||
#if (FXAA_QUALITY_PRESET == 13)
|
||||
#define FXAA_QUALITY_PS 6
|
||||
#define FXAA_QUALITY_P0 1.0
|
||||
#define FXAA_QUALITY_P1 1.5
|
||||
#define FXAA_QUALITY_P2 2.0
|
||||
#define FXAA_QUALITY_P3 2.0
|
||||
#define FXAA_QUALITY_P4 4.0
|
||||
#define FXAA_QUALITY_P5 12.0
|
||||
#endif
|
||||
#if (FXAA_QUALITY_PRESET == 14)
|
||||
#define FXAA_QUALITY_PS 7
|
||||
#define FXAA_QUALITY_P0 1.0
|
||||
#define FXAA_QUALITY_P1 1.5
|
||||
#define FXAA_QUALITY_P2 2.0
|
||||
#define FXAA_QUALITY_P3 2.0
|
||||
#define FXAA_QUALITY_P4 2.0
|
||||
#define FXAA_QUALITY_P5 4.0
|
||||
#define FXAA_QUALITY_P6 12.0
|
||||
#endif
|
||||
#if (FXAA_QUALITY_PRESET == 25)
|
||||
#define FXAA_QUALITY_PS 8
|
||||
#define FXAA_QUALITY_P0 1.0
|
||||
#define FXAA_QUALITY_P1 1.5
|
||||
#define FXAA_QUALITY_P2 2.0
|
||||
#define FXAA_QUALITY_P3 2.0
|
||||
#define FXAA_QUALITY_P4 2.0
|
||||
#define FXAA_QUALITY_P5 2.0
|
||||
#define FXAA_QUALITY_P6 4.0
|
||||
#define FXAA_QUALITY_P7 8.0
|
||||
#endif
|
||||
#if (FXAA_QUALITY_PRESET == 26)
|
||||
#define FXAA_QUALITY_PS 9
|
||||
#define FXAA_QUALITY_P0 1.0
|
||||
#define FXAA_QUALITY_P1 1.5
|
||||
#define FXAA_QUALITY_P2 2.0
|
||||
#define FXAA_QUALITY_P3 2.0
|
||||
#define FXAA_QUALITY_P4 2.0
|
||||
#define FXAA_QUALITY_P5 2.0
|
||||
#define FXAA_QUALITY_P6 2.0
|
||||
#define FXAA_QUALITY_P7 4.0
|
||||
#define FXAA_QUALITY_P8 8.0
|
||||
#endif
|
||||
#if (FXAA_QUALITY_PRESET == 27)
|
||||
#define FXAA_QUALITY_PS 10
|
||||
#define FXAA_QUALITY_P0 1.0
|
||||
#define FXAA_QUALITY_P1 1.5
|
||||
#define FXAA_QUALITY_P2 2.0
|
||||
#define FXAA_QUALITY_P3 2.0
|
||||
#define FXAA_QUALITY_P4 2.0
|
||||
#define FXAA_QUALITY_P5 2.0
|
||||
#define FXAA_QUALITY_P6 2.0
|
||||
#define FXAA_QUALITY_P7 2.0
|
||||
#define FXAA_QUALITY_P8 4.0
|
||||
#define FXAA_QUALITY_P9 8.0
|
||||
#endif
|
||||
#if (FXAA_QUALITY_PRESET == 28)
|
||||
#define FXAA_QUALITY_PS 11
|
||||
#define FXAA_QUALITY_P0 1.0
|
||||
#define FXAA_QUALITY_P1 1.5
|
||||
#define FXAA_QUALITY_P2 2.0
|
||||
#define FXAA_QUALITY_P3 2.0
|
||||
#define FXAA_QUALITY_P4 2.0
|
||||
#define FXAA_QUALITY_P5 2.0
|
||||
#define FXAA_QUALITY_P6 2.0
|
||||
#define FXAA_QUALITY_P7 2.0
|
||||
#define FXAA_QUALITY_P8 2.0
|
||||
#define FXAA_QUALITY_P9 4.0
|
||||
#define FXAA_QUALITY_P10 8.0
|
||||
#endif
|
||||
#if (FXAA_QUALITY_PRESET == 39)
|
||||
#define FXAA_QUALITY_PS 12
|
||||
#define FXAA_QUALITY_P0 1.0
|
||||
#define FXAA_QUALITY_P1 1.0
|
||||
#define FXAA_QUALITY_P2 1.0
|
||||
#define FXAA_QUALITY_P3 1.0
|
||||
#define FXAA_QUALITY_P4 1.0
|
||||
#define FXAA_QUALITY_P5 1.5
|
||||
#define FXAA_QUALITY_P6 2.0
|
||||
#define FXAA_QUALITY_P7 2.0
|
||||
#define FXAA_QUALITY_P8 2.0
|
||||
#define FXAA_QUALITY_P9 2.0
|
||||
#define FXAA_QUALITY_P10 4.0
|
||||
#define FXAA_QUALITY_P11 8.0
|
||||
#endif
|
||||
#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)
|
||||
#define FxaaBool bool
|
||||
#define FxaaDiscard discard
|
||||
#define FxaaFloat float
|
||||
#define FxaaFloat2 vec2
|
||||
#define FxaaFloat3 vec3
|
||||
#define FxaaFloat4 vec4
|
||||
#define FxaaHalf float
|
||||
#define FxaaHalf2 vec2
|
||||
#define FxaaHalf3 vec3
|
||||
#define FxaaHalf4 vec4
|
||||
#define FxaaInt2 ivec2
|
||||
#define FxaaSat(x) clamp(x, 0.0, 1.0)
|
||||
#define FxaaTex sampler2D
|
||||
#else
|
||||
#define FxaaBool bool
|
||||
#define FxaaDiscard clip(-1)
|
||||
#define FxaaFloat float
|
||||
#define FxaaFloat2 float2
|
||||
#define FxaaFloat3 float3
|
||||
#define FxaaFloat4 float4
|
||||
#define FxaaHalf half
|
||||
#define FxaaHalf2 half2
|
||||
#define FxaaHalf3 half3
|
||||
#define FxaaHalf4 half4
|
||||
#define FxaaSat(x) saturate(x)
|
||||
#endif
|
||||
#if (FXAA_GLSL_120 == 1)
|
||||
#define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
|
||||
#if (FXAA_FAST_PIXEL_OFFSET == 1)
|
||||
#define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)
|
||||
#else
|
||||
#define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
|
||||
#endif
|
||||
#if (FXAA_GATHER4_ALPHA == 1)
|
||||
#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
|
||||
#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
|
||||
#define FxaaTexGreen4(t, p) textureGather(t, p, 1)
|
||||
#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
|
||||
#endif
|
||||
#endif
|
||||
#if (FXAA_GLSL_130 == 1)
|
||||
#define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
|
||||
#define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)
|
||||
#if (FXAA_GATHER4_ALPHA == 1)
|
||||
#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
|
||||
#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
|
||||
#define FxaaTexGreen4(t, p) textureGather(t, p, 1)
|
||||
#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
|
||||
#endif
|
||||
#endif
|
||||
FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
|
||||
FxaaFloat4 FxaaPixelShader(
|
||||
FxaaFloat2 pos,
|
||||
FxaaTex tex,
|
||||
FxaaFloat2 fxaaQualityRcpFrame,
|
||||
FxaaFloat fxaaQualitySubpix,
|
||||
FxaaFloat fxaaQualityEdgeThreshold,
|
||||
FxaaFloat fxaaQualityEdgeThresholdMin
|
||||
) {
|
||||
FxaaFloat2 posM;
|
||||
posM.x = pos.x;
|
||||
posM.y = pos.y;
|
||||
#if (FXAA_GATHER4_ALPHA == 1)
|
||||
#if (FXAA_DISCARD == 0)
|
||||
FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
|
||||
#define lumaM rgbyM.y
|
||||
#endif
|
||||
FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);
|
||||
FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));
|
||||
#if (FXAA_DISCARD == 1)
|
||||
#define lumaM luma4A.w
|
||||
#endif
|
||||
#define lumaE luma4A.z
|
||||
#define lumaS luma4A.x
|
||||
#define lumaSE luma4A.y
|
||||
#define lumaNW luma4B.w
|
||||
#define lumaN luma4B.z
|
||||
#define lumaW luma4B.x
|
||||
#else
|
||||
FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
|
||||
#define lumaM rgbyM.w
|
||||
FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
|
||||
FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
|
||||
FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
|
||||
FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
|
||||
#endif
|
||||
FxaaFloat maxSM = max(lumaS, lumaM);
|
||||
FxaaFloat minSM = min(lumaS, lumaM);
|
||||
FxaaFloat maxESM = max(lumaE, maxSM);
|
||||
FxaaFloat minESM = min(lumaE, minSM);
|
||||
FxaaFloat maxWN = max(lumaN, lumaW);
|
||||
FxaaFloat minWN = min(lumaN, lumaW);
|
||||
FxaaFloat rangeMax = max(maxWN, maxESM);
|
||||
FxaaFloat rangeMin = min(minWN, minESM);
|
||||
FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
|
||||
FxaaFloat range = rangeMax - rangeMin;
|
||||
FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
|
||||
FxaaBool earlyExit = range < rangeMaxClamped;
|
||||
if (earlyExit)
|
||||
#if (FXAA_DISCARD == 1)
|
||||
FxaaDiscard;
|
||||
#else
|
||||
return rgbyM;
|
||||
#endif
|
||||
#if (FXAA_GATHER4_ALPHA == 0)
|
||||
FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
|
||||
FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
|
||||
FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
|
||||
FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
|
||||
#else
|
||||
FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));
|
||||
FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
|
||||
#endif
|
||||
FxaaFloat lumaNS = lumaN + lumaS;
|
||||
FxaaFloat lumaWE = lumaW + lumaE;
|
||||
FxaaFloat subpixRcpRange = 1.0/range;
|
||||
FxaaFloat subpixNSWE = lumaNS + lumaWE;
|
||||
FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
|
||||
FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
|
||||
FxaaFloat lumaNESE = lumaNE + lumaSE;
|
||||
FxaaFloat lumaNWNE = lumaNW + lumaNE;
|
||||
FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
|
||||
FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
|
||||
FxaaFloat lumaNWSW = lumaNW + lumaSW;
|
||||
FxaaFloat lumaSWSE = lumaSW + lumaSE;
|
||||
FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
|
||||
FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
|
||||
FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
|
||||
FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
|
||||
FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
|
||||
FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
|
||||
FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
|
||||
FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
|
||||
FxaaBool horzSpan = edgeHorz >= edgeVert;
|
||||
FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
|
||||
if (!horzSpan) lumaN = lumaW;
|
||||
if (!horzSpan) lumaS = lumaE;
|
||||
if (horzSpan) lengthSign = fxaaQualityRcpFrame.y;
|
||||
FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
|
||||
FxaaFloat gradientN = lumaN - lumaM;
|
||||
FxaaFloat gradientS = lumaS - lumaM;
|
||||
FxaaFloat lumaNN = lumaN + lumaM;
|
||||
FxaaFloat lumaSS = lumaS + lumaM;
|
||||
FxaaBool pairN = abs(gradientN) >= abs(gradientS);
|
||||
FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
|
||||
if (pairN) lengthSign = -lengthSign;
|
||||
FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
|
||||
FxaaFloat2 posB;
|
||||
posB.x = posM.x;
|
||||
posB.y = posM.y;
|
||||
FxaaFloat2 offNP;
|
||||
offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
|
||||
offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
|
||||
if (!horzSpan) posB.x += lengthSign * 0.5;
|
||||
if (horzSpan) posB.y += lengthSign * 0.5;
|
||||
FxaaFloat2 posN;
|
||||
posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;
|
||||
posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;
|
||||
FxaaFloat2 posP;
|
||||
posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;
|
||||
posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;
|
||||
FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
|
||||
FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
|
||||
FxaaFloat subpixE = subpixC * subpixC;
|
||||
FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
|
||||
if (!pairN) lumaNN = lumaSS;
|
||||
FxaaFloat gradientScaled = gradient * 1.0/4.0;
|
||||
FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
|
||||
FxaaFloat subpixF = subpixD * subpixE;
|
||||
FxaaBool lumaMLTZero = lumaMM < 0.0;
|
||||
lumaEndN -= lumaNN * 0.5;
|
||||
lumaEndP -= lumaNN * 0.5;
|
||||
FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
|
||||
FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;
|
||||
if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;
|
||||
FxaaBool doneNP = (!doneN) || (!doneP);
|
||||
if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;
|
||||
if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;
|
||||
if (doneNP) {
|
||||
if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
||||
if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;
|
||||
if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;
|
||||
if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;
|
||||
#if (FXAA_QUALITY_PS > 3)
|
||||
if (doneNP) {
|
||||
if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
||||
if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;
|
||||
if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;
|
||||
if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;
|
||||
#if (FXAA_QUALITY_PS > 4)
|
||||
if (doneNP) {
|
||||
if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
||||
if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;
|
||||
if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;
|
||||
if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;
|
||||
#if (FXAA_QUALITY_PS > 5)
|
||||
if (doneNP) {
|
||||
if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
||||
if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;
|
||||
if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;
|
||||
if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;
|
||||
#if (FXAA_QUALITY_PS > 6)
|
||||
if (doneNP) {
|
||||
if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
||||
if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;
|
||||
if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;
|
||||
if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;
|
||||
#if (FXAA_QUALITY_PS > 7)
|
||||
if (doneNP) {
|
||||
if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
||||
if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;
|
||||
if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;
|
||||
if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;
|
||||
#if (FXAA_QUALITY_PS > 8)
|
||||
if (doneNP) {
|
||||
if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
||||
if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;
|
||||
if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;
|
||||
if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;
|
||||
#if (FXAA_QUALITY_PS > 9)
|
||||
if (doneNP) {
|
||||
if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
||||
if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;
|
||||
if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;
|
||||
if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;
|
||||
#if (FXAA_QUALITY_PS > 10)
|
||||
if (doneNP) {
|
||||
if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
||||
if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;
|
||||
if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;
|
||||
if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;
|
||||
#if (FXAA_QUALITY_PS > 11)
|
||||
if (doneNP) {
|
||||
if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
||||
if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;
|
||||
if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;
|
||||
if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;
|
||||
#if (FXAA_QUALITY_PS > 12)
|
||||
if (doneNP) {
|
||||
if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
||||
if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
||||
doneN = abs(lumaEndN) >= gradientScaled;
|
||||
doneP = abs(lumaEndP) >= gradientScaled;
|
||||
if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;
|
||||
if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;
|
||||
if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
FxaaFloat dstN = posM.x - posN.x;
|
||||
FxaaFloat dstP = posP.x - posM.x;
|
||||
if (!horzSpan) dstN = posM.y - posN.y;
|
||||
if (!horzSpan) dstP = posP.y - posM.y;
|
||||
FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
|
||||
FxaaFloat spanLength = (dstP + dstN);
|
||||
FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
|
||||
FxaaFloat spanLengthRcp = 1.0/spanLength;
|
||||
FxaaBool directionN = dstN < dstP;
|
||||
FxaaFloat dst = min(dstN, dstP);
|
||||
FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
|
||||
FxaaFloat subpixG = subpixF * subpixF;
|
||||
FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
|
||||
FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
|
||||
FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
|
||||
FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
|
||||
if (!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
|
||||
if (horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
|
||||
#if (FXAA_DISCARD == 1)
|
||||
return FxaaTexTop(tex, posM);
|
||||
#else
|
||||
return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
|
||||
#endif
|
||||
}
|
||||
uniform sampler2D tex0;
|
||||
varying vec2 v_rcpFrame;
|
||||
noperspective varying vec2 v_pos;
|
||||
void main() {
|
||||
gl_FragColor = FxaaPixelShader(v_pos, tex0, v_rcpFrame, FXAA_QUALITY_SUBPIX, FXAA_QUALITY_EDGE_THRESHOLD, FXAA_QUALITY_EDGE_THRESHOLD_MIN);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#extension GL_EXT_gpu_shader4 : enable
|
||||
uniform float rt_w;
|
||||
uniform float rt_h;
|
||||
varying vec2 v_rcpFrame;
|
||||
noperspective varying vec2 v_pos;
|
||||
void main() {
|
||||
gl_Position = gl_Vertex;
|
||||
v_rcpFrame = vec2(1.0/rt_w, 1.0/rt_h);
|
||||
v_pos = gl_Vertex.xy*0.5 + 0.5;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
uniform sampler2D tex;
|
||||
void main() {
|
||||
vec4 color = texture2D(tex, gl_TexCoord[0].xy);
|
||||
gl_FragColor = vec4(color.rgb, dot(color.rgb, vec3(0.299, 0.587, 0.114)) );
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
;; Mod.tbl should be used for settings which affect the entire mod and
|
||||
;; only very rarely need to be changed (if ever).
|
||||
|
||||
#CAMPAIGN SETTINGS
|
||||
|
||||
;; Sets default campaign file the game will look for with new pilots
|
||||
$Default Campaign File Name: FreeSpace2
|
||||
|
||||
|
||||
#HUD SETTINGS
|
||||
|
||||
;; Sets the delay before a directive will appear on the screen (ms)
|
||||
$Directive Wait Time: 3000
|
||||
|
||||
;; If set, shows the HUD during in-game cutscenes
|
||||
$Cutscene camera displays HUD: NO
|
||||
|
||||
;; If set, uses the colors of the ANI instead of the colors of the HUD
|
||||
$Full color head animations: NO
|
||||
|
||||
|
||||
#SEXP SETTINGS
|
||||
|
||||
;; When set, this makes the argument SEXPs loop through all the SEXPs
|
||||
;; before it moves on to the next argument. Default behaviour is the
|
||||
;; exact opposite, each SEXP is called for all arguments.
|
||||
$Loop SEXPs Then Arguments: NO
|
||||
|
||||
;; When set, this makes the event chaining behavior act as people
|
||||
;; expected it to be in Mantis #82.
|
||||
$Use Alternate Chaining Behavior: NO
|
||||
|
||||
|
||||
#GRAPHICS SETTINGS
|
||||
|
||||
;; When set, this enables the loading of external shader files
|
||||
$Enable external shaders: NO
|
||||
|
||||
|
||||
#OTHER SETTINGS
|
||||
|
||||
;; If not set, a hit to a turret's barrels will not count as a hit to
|
||||
;; the turret unless it is also within the turret base's radius.
|
||||
$Fixed Turret Collisions: NO
|
||||
|
||||
;; If not set, hits will damage nearest subsystem first, rather than the
|
||||
;; impacted physical subsystem first.
|
||||
$Damage Impacted Subsystem First: NO
|
||||
|
||||
;; used when no ani is specified or ship_select_3d is active
|
||||
$Default ship select effect: FS2
|
||||
|
||||
;; used when no ani is specified or weapon_select_3d is active
|
||||
$Default weapon select effect: FS2
|
||||
|
||||
;; Enable weapons to inherit their parent object's collision group setting
|
||||
$Weapons inherit parent collision group: NO
|
||||
|
||||
#END
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
@INCLUDE_LIST@
|
||||
|
||||
def_file Default_files[] =
|
||||
{
|
||||
@ARRAY_ELEMENTS@
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
@ARRAY_ELEMENTS@
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
#IFFs
|
||||
|
||||
;; Every iff_defs.tbl must contain a Traitor entry. Traitors attack
|
||||
;; one another (required by the dogfighting code) but it is up to you
|
||||
;; to decide who attacks the traitor or whom else the traitor attacks.
|
||||
$Traitor IFF: Traitor
|
||||
|
||||
;------------------------
|
||||
; Friendly
|
||||
;------------------------
|
||||
$IFF Name: Friendly
|
||||
$Color: ( 0, 255, 0 )
|
||||
$Attacks: ( "Hostile" "Neutral" "Traitor" )
|
||||
$Flags: ( "support allowed" )
|
||||
$Default Ship Flags: ( "cargo-known" )
|
||||
|
||||
;------------------------
|
||||
; Hostile
|
||||
;------------------------
|
||||
$IFF Name: Hostile
|
||||
$Color: ( 255, 0, 0 )
|
||||
$Attacks: ( "Friendly" "Neutral" "Traitor" )
|
||||
+Sees Friendly As: ( 255, 0, 0 )
|
||||
+Sees Hostile As: ( 0, 255, 0 )
|
||||
|
||||
;------------------------
|
||||
; Neutral
|
||||
;------------------------
|
||||
$IFF Name: Neutral
|
||||
$Color: ( 255, 0, 0 )
|
||||
$Attacks: ( "Friendly" "Traitor" )
|
||||
+Sees Friendly As: ( 255, 0, 0 )
|
||||
+Sees Hostile As: ( 0, 255, 0 )
|
||||
+Sees Neutral As: ( 0, 255, 0 )
|
||||
|
||||
;------------------------
|
||||
; Unknown
|
||||
;------------------------
|
||||
$IFF Name: Unknown
|
||||
$Color: ( 255, 0, 255 )
|
||||
$Attacks: ( "Hostile" )
|
||||
+Sees Neutral As: ( 0, 255, 0 )
|
||||
+Sees Traitor As: ( 0, 255, 0 )
|
||||
$Flags: ( "exempt from all teams at war" )
|
||||
|
||||
;------------------------
|
||||
; Traitor
|
||||
;------------------------
|
||||
$IFF Name: Traitor
|
||||
$Color: ( 255, 0, 0 )
|
||||
$Attacks: ( "Friendly" "Hostile" "Neutral" "Traitor" )
|
||||
+Sees Friendly As: ( 255, 0, 0 )
|
||||
|
||||
#End
|
||||
@@ -0,0 +1,30 @@
|
||||
uniform sampler2D scene;
|
||||
uniform sampler2D cockpit;
|
||||
uniform vec2 sun_pos;
|
||||
uniform float density;
|
||||
uniform float weight;
|
||||
uniform float falloff;
|
||||
uniform float intensity;
|
||||
uniform float cp_intensity;
|
||||
void main()
|
||||
{
|
||||
vec2 step = vec2( gl_TexCoord[0].st - sun_pos.xy );
|
||||
vec2 pos = gl_TexCoord[0].st;
|
||||
step *= 1.0 / float(SAMPLE_NUM) * density;
|
||||
float decay = 1.0;
|
||||
vec4 sum = vec4(0.0);
|
||||
vec4 mask = texture2D(cockpit, gl_TexCoord[0].st);
|
||||
if (mask.r < 1.0) {
|
||||
gl_FragColor = vec4(cp_intensity);
|
||||
return;
|
||||
}
|
||||
for(int i=0; i < SAMPLE_NUM ; i++) {
|
||||
pos.st -= step;
|
||||
vec4 tex_sample = texture2D(scene, pos);
|
||||
if (tex_sample.r == 1.0)
|
||||
sum += decay * weight;
|
||||
decay *= falloff;
|
||||
}
|
||||
gl_FragColor = sum * intensity;
|
||||
gl_FragColor.a = 1.0;
|
||||
}
|
||||
@@ -0,0 +1,467 @@
|
||||
#extension GL_EXT_texture_array : enable
|
||||
#ifdef FLAG_LIGHT
|
||||
uniform int n_lights;
|
||||
uniform float light_factor;
|
||||
uniform float defaultGloss;
|
||||
#endif
|
||||
#ifdef FLAG_DIFFUSE_MAP
|
||||
uniform sampler2D sBasemap;
|
||||
uniform int desaturate;
|
||||
uniform vec3 desaturate_clr;
|
||||
uniform int blend_alpha;
|
||||
uniform bool overrideDiffuse;
|
||||
uniform vec3 diffuseClr;
|
||||
#endif
|
||||
#ifdef FLAG_GLOW_MAP
|
||||
uniform sampler2D sGlowmap;
|
||||
uniform bool overrideGlow;
|
||||
uniform vec3 glowClr;
|
||||
#endif
|
||||
#ifdef FLAG_SPEC_MAP
|
||||
uniform sampler2D sSpecmap;
|
||||
uniform bool overrideSpec;
|
||||
uniform vec3 specClr;
|
||||
uniform bool alphaGloss;
|
||||
uniform bool gammaSpec;
|
||||
#endif
|
||||
#ifdef FLAG_ENV_MAP
|
||||
uniform samplerCube sEnvmap;
|
||||
uniform bool envGloss;
|
||||
varying vec3 envReflect;
|
||||
#endif
|
||||
#ifdef FLAG_NORMAL_MAP
|
||||
uniform sampler2D sNormalmap;
|
||||
varying mat3 tbnMatrix;
|
||||
#endif
|
||||
#ifdef FLAG_AMBIENT_MAP
|
||||
uniform sampler2D sAmbientmap;
|
||||
#endif
|
||||
#ifdef FLAG_FOG
|
||||
varying float fogDist;
|
||||
#endif
|
||||
#ifdef FLAG_ANIMATED
|
||||
uniform sampler2D sFramebuffer;
|
||||
uniform int effect_num;
|
||||
uniform float anim_timer;
|
||||
uniform float vpwidth;
|
||||
uniform float vpheight;
|
||||
#endif
|
||||
#ifdef FLAG_TRANSFORM
|
||||
varying float not_visible;
|
||||
#endif
|
||||
#ifdef FLAG_TEAMCOLOR
|
||||
uniform vec3 base_color;
|
||||
uniform vec3 stripe_color;
|
||||
uniform bool team_glow_enabled;
|
||||
vec2 teamMask = vec2(0.0, 0.0);
|
||||
#endif
|
||||
#ifdef FLAG_MISC_MAP
|
||||
uniform sampler2D sMiscmap;
|
||||
#endif
|
||||
#ifdef FLAG_SHADOWS
|
||||
varying vec4 shadow_vec[4];
|
||||
varying vec4 pos_shadow;
|
||||
//uniform sampler2DArrayShadow shadow_map;
|
||||
uniform sampler2DArray shadow_map;
|
||||
//uniform sampler2D shadow_map;
|
||||
uniform float znear;
|
||||
uniform float zfar;
|
||||
uniform float veryneardist;
|
||||
uniform float neardist;
|
||||
uniform float middist;
|
||||
uniform float fardist;
|
||||
#endif
|
||||
#ifdef FLAG_CLIP
|
||||
uniform int use_clip_plane;
|
||||
varying float clip_distance;
|
||||
#endif
|
||||
varying vec4 position;
|
||||
varying vec3 lNormal;
|
||||
|
||||
#if __VERSION__ == 120
|
||||
#define MAX_LIGHTS 2
|
||||
#else
|
||||
#define MAX_LIGHTS 8
|
||||
#endif
|
||||
#define SPEC_INTENSITY_POINT 5.3 // Point light
|
||||
#define SPEC_INTENSITY_DIRECTIONAL 3.0 // Directional light
|
||||
#define SPECULAR_FACTOR 1.75
|
||||
#define SPECULAR_ALPHA 0.1
|
||||
#define SPEC_FACTOR_NO_SPEC_MAP 0.6
|
||||
#define ENV_ALPHA_FACTOR 0.3
|
||||
#define GLOW_MAP_INTENSITY 1.5
|
||||
#define AMBIENT_LIGHT_BOOST 1.0
|
||||
#define VARIANCE_SHADOW_SCALE 1000000.0
|
||||
#define VARIANCE_SHADOW_SCALE_INV 1.0/VARIANCE_SHADOW_SCALE
|
||||
#define SRGB_GAMMA 2.2
|
||||
|
||||
#ifdef FLAG_SHADOWS
|
||||
vec2 sampleShadowMap(vec2 uv, vec2 offset_uv, int cascade, float shadowMapSizeInv)
|
||||
{
|
||||
return texture2DArray(shadow_map, vec3(uv + offset_uv * shadowMapSizeInv, float(cascade))).xy;
|
||||
}
|
||||
|
||||
float computeShadowFactor(vec2 moments, float bias)
|
||||
{
|
||||
float shadow = 1.0;
|
||||
if((moments.x - bias) > pos_shadow.z)
|
||||
{
|
||||
// variance shadow mapping using Chebychev's Formula
|
||||
float variance = moments.y * VARIANCE_SHADOW_SCALE - moments.x * moments.x;
|
||||
float mD = moments.x - bias - pos_shadow.z;
|
||||
shadow = variance / (variance + mD * mD);
|
||||
shadow = clamp(shadow, 0.0, 1.0);
|
||||
}
|
||||
return shadow;
|
||||
}
|
||||
|
||||
float sampleNoPCF(int cascade)
|
||||
{
|
||||
return computeShadowFactor(sampleShadowMap(shadow_vec[cascade].xy, vec2(0.0, 0.0), cascade, 1.0/1024.0), 0.05);
|
||||
}
|
||||
|
||||
float samplePoissonPCF(int cascade)
|
||||
{
|
||||
if(cascade > 3 || cascade < 0) return 1.0;
|
||||
vec2 poissonDisc[16];
|
||||
poissonDisc[0] = vec2(-0.76275, -0.3432573);
|
||||
poissonDisc[1] = vec2(-0.5226235, -0.8277544);
|
||||
poissonDisc[2] = vec2(-0.3780261, 0.01528688);
|
||||
poissonDisc[3] = vec2(-0.7742821, 0.4245702);
|
||||
poissonDisc[4] = vec2(0.04196143, -0.02622231);
|
||||
poissonDisc[5] = vec2(-0.2974772, -0.4722782);
|
||||
poissonDisc[6] = vec2(-0.516093, 0.71495);
|
||||
poissonDisc[7] = vec2(-0.3257416, 0.3910343);
|
||||
poissonDisc[8] = vec2(0.2705966, 0.6670476);
|
||||
poissonDisc[9] = vec2(0.4918377, 0.1853267);
|
||||
poissonDisc[10] = vec2(0.4428544, -0.6251478);
|
||||
poissonDisc[11] = vec2(-0.09204347, 0.9267113);
|
||||
poissonDisc[12] = vec2(0.391505, -0.2558275);
|
||||
poissonDisc[13] = vec2(0.05605913, -0.7570801);
|
||||
poissonDisc[14] = vec2(0.81772, -0.02475523);
|
||||
poissonDisc[15] = vec2(0.6890262, 0.5191521);
|
||||
float maxUVOffset[4];
|
||||
maxUVOffset[0] = 1.0/300.0;
|
||||
maxUVOffset[1] = 1.0/250.0;
|
||||
maxUVOffset[2] = 1.0/200.0;
|
||||
maxUVOffset[3] = 1.0/200.0;
|
||||
vec2 sum = sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[0], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[1], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[2], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[3], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[4], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[5], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[6], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[7], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[8], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[9], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[10], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[11], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[12], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[13], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[14], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
sum += sampleShadowMap(shadow_vec[cascade].xy, poissonDisc[15], cascade, maxUVOffset[cascade])*(1.0/16.0);
|
||||
return computeShadowFactor(sum, 0.1);
|
||||
}
|
||||
float getShadowValue()
|
||||
{
|
||||
// Valathil's Shadows
|
||||
float depth = -position.z;
|
||||
int cascade = 4;
|
||||
cascade -= int(step(depth, fardist));
|
||||
cascade -= int(step(depth, middist));
|
||||
cascade -= int(step(depth, neardist));
|
||||
cascade -= int(step(depth, veryneardist));
|
||||
float cascade_start_dist[5];
|
||||
cascade_start_dist[0] = 0.0;
|
||||
cascade_start_dist[1] = veryneardist;
|
||||
cascade_start_dist[2] = neardist;
|
||||
cascade_start_dist[3] = middist;
|
||||
cascade_start_dist[4] = fardist;
|
||||
if(cascade > 3 || cascade < 0) return 1.0;
|
||||
float dist_threshold = (cascade_start_dist[cascade+1] - cascade_start_dist[cascade])*0.2;
|
||||
if(cascade_start_dist[cascade+1] - dist_threshold > depth)
|
||||
return samplePoissonPCF(cascade);
|
||||
return mix(samplePoissonPCF(cascade), samplePoissonPCF(cascade+1), smoothstep(cascade_start_dist[cascade+1] - dist_threshold, cascade_start_dist[cascade+1], depth));
|
||||
}
|
||||
#endif
|
||||
#ifdef FLAG_LIGHT
|
||||
vec3 FresnelSchlick(vec3 specColor, vec3 light, vec3 halfVec)
|
||||
{
|
||||
return specColor + (vec3(1.0) - specColor) * pow(1.0 - clamp(dot(light, halfVec), 0.0, 1.0), 5.0);
|
||||
}
|
||||
vec3 FresnelLazarovEnv(vec3 specColor, vec3 view, vec3 normal, float gloss)
|
||||
{
|
||||
// Fresnel for environment lighting
|
||||
// Equation referenced from Dimitar Lazarov's presentation titled Physically Based Rendering in Call of Duty: Black Ops
|
||||
return specColor + (vec3(1.0) - specColor) * pow(1.0 - clamp(dot(view, normal), 0.0, 1.0), 5.0) / (4.0 - 3.0 * gloss);
|
||||
}
|
||||
vec3 SpecularBlinnPhong(vec3 specColor, vec3 light, vec3 normal, vec3 halfVec, float specPower, float dotNL)
|
||||
{
|
||||
return FresnelSchlick(max(specColor, vec3(0.04)), light, halfVec) * ((specPower + 2.0) / 8.0 ) * pow(clamp(dot(normal, halfVec), 0.0, 1.0), specPower) * dotNL;
|
||||
}
|
||||
vec4 SpecularLegacy(vec4 specColor, vec3 normal, vec3 halfVec, float specPower)
|
||||
{
|
||||
return specColor * pow(clamp(dot(normal, halfVec), 0.0, 1.0), specPower);
|
||||
}
|
||||
void GetLightInfo(int i, out vec3 lightDir, out float attenuation, out float specIntensity)
|
||||
{
|
||||
lightDir = normalize(gl_LightSource[i].position.xyz);
|
||||
attenuation = 1.0;
|
||||
specIntensity = SPEC_INTENSITY_DIRECTIONAL;
|
||||
#if __VERSION__ > 120
|
||||
if (gl_LightSource[i].position.w == 1.0) {
|
||||
#else
|
||||
if (gl_LightSource[i].position.w == 1.0 && i != 0) {
|
||||
#endif
|
||||
// Positional light source
|
||||
float dist = distance(gl_LightSource[i].position.xyz, position.xyz);
|
||||
lightDir = (gl_LightSource[i].position.xyz - position.xyz);
|
||||
#if __VERSION__ > 120
|
||||
if (gl_LightSource[i].spotCutoff < 91.0) { // Tube light
|
||||
float beamlength = length(gl_LightSource[i].spotDirection);
|
||||
vec3 beamDir = normalize(gl_LightSource[i].spotDirection);
|
||||
// Get nearest point on line
|
||||
float neardist = dot(position.xyz - gl_LightSource[i].position.xyz , beamDir);
|
||||
// Move back from the endpoint of the beam along the beam by the distance we calculated
|
||||
vec3 nearest = gl_LightSource[i].position.xyz - beamDir * abs(neardist);
|
||||
lightDir = nearest - position.xyz;
|
||||
dist = length(lightDir);
|
||||
}
|
||||
#endif
|
||||
lightDir = normalize(lightDir);
|
||||
attenuation = 1.0 / (gl_LightSource[i].constantAttenuation + (gl_LightSource[i].linearAttenuation * dist) + (gl_LightSource[i].quadraticAttenuation * dist * dist));
|
||||
specIntensity = SPEC_INTENSITY_POINT;
|
||||
}
|
||||
}
|
||||
vec3 CalculateLighting(vec3 normal, vec3 diffuseMaterial, vec3 specularMaterial, float gloss, float shadow, float ambientFactor)
|
||||
{
|
||||
vec3 eyeDir = vec3(normalize(-position).xyz);
|
||||
vec3 lightAmbient = vec3(gl_FrontMaterial.emission + (gl_LightModel.ambient * gl_FrontMaterial.ambient)) * ambientFactor;
|
||||
vec3 lightAmbientDiffuse = vec3(0.0, 0.0, 0.0);
|
||||
vec3 lightDiffuse = vec3(0.0, 0.0, 0.0);
|
||||
vec3 lightSpecular = vec3(0.0, 0.0, 0.0);
|
||||
#pragma optionNV unroll all
|
||||
for (int i = 0; i < MAX_LIGHTS; ++i) {
|
||||
#if __VERSION__ > 120
|
||||
if (i > n_lights)
|
||||
break;
|
||||
#endif
|
||||
if(i > 0)
|
||||
shadow = 1.0;
|
||||
vec3 lightDir;
|
||||
float attenuation;
|
||||
float specIntensity;
|
||||
// gather light params
|
||||
GetLightInfo(i, lightDir, attenuation, specIntensity);
|
||||
vec3 halfVec = normalize(lightDir + eyeDir);
|
||||
float NdotL = max(dot(normal, lightDir), 0.0);
|
||||
// Ambient, Diffuse, and Specular
|
||||
lightAmbient += (gl_FrontLightProduct[i].ambient.rgb * attenuation);
|
||||
lightDiffuse += (gl_FrontLightProduct[i].diffuse.rgb * light_factor * NdotL * attenuation) * shadow;
|
||||
lightSpecular += gl_FrontLightProduct[i].specular.rgb * SpecularBlinnPhong(specularMaterial, lightDir, normal, halfVec, exp2(10.0 * gloss + 1.0), NdotL) * attenuation * shadow;
|
||||
}
|
||||
lightAmbientDiffuse = lightAmbient + lightDiffuse;
|
||||
vec3 finalColor = diffuseMaterial;
|
||||
finalColor *= lightAmbientDiffuse.rgb;
|
||||
finalColor += lightSpecular;
|
||||
return finalColor;
|
||||
}
|
||||
#endif
|
||||
void main()
|
||||
{
|
||||
#ifdef FLAG_TRANSFORM
|
||||
if(not_visible >= 0.9) { discard; }
|
||||
#endif
|
||||
#ifdef FLAG_SHADOW_MAP
|
||||
#ifdef FLAG_CLIP
|
||||
if(use_clip_plane == 1) { if(clip_distance <= 0.0) { discard; } }
|
||||
#endif
|
||||
// need depth and depth squared for variance shadow maps
|
||||
gl_FragData[0] = vec4(position.z, position.z * position.z * VARIANCE_SHADOW_SCALE_INV, 0.0, 1.0);
|
||||
return;
|
||||
#endif
|
||||
vec3 eyeDir = vec3(normalize(-position).xyz);
|
||||
vec3 lightAmbientDiffuse = vec3(0.0, 0.0, 0.0);
|
||||
vec3 lightDiffuse = vec3(0.0, 0.0, 0.0);
|
||||
vec3 lightAmbient = vec3(0.0, 0.0, 0.0);
|
||||
vec4 lightSpecular = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
vec2 texCoord = gl_TexCoord[0].xy;
|
||||
vec4 baseColor = gl_Color;
|
||||
#ifdef FLAG_HDR
|
||||
baseColor.rgb = pow(baseColor.rgb, vec3(SRGB_GAMMA));
|
||||
#endif
|
||||
vec4 posData = vec4(position.xyz,1.0);
|
||||
vec4 normData = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
vec4 specData = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
float glossData = 0.6;
|
||||
#ifdef FLAG_LIGHT
|
||||
glossData = defaultGloss;
|
||||
#endif
|
||||
vec2 aoFactors = vec2(1.0, 1.0);
|
||||
#ifdef FLAG_AMBIENT_MAP
|
||||
// red channel is ambient occlusion factor which only affects ambient lighting.
|
||||
// green is cavity occlusion factor which only affects diffuse and specular lighting.
|
||||
aoFactors = texture2D(sAmbientmap, texCoord).xy;
|
||||
#endif
|
||||
vec3 unitNormal = normalize(lNormal);
|
||||
vec3 normal = unitNormal;
|
||||
#ifdef FLAG_NORMAL_MAP
|
||||
// Normal map - convert from DXT5nm
|
||||
vec2 normalSample;
|
||||
normal.rg = normalSample = (texture2D(sNormalmap, texCoord).ag * 2.0) - 1.0;
|
||||
normal.b = sqrt(1.0 - dot(normal.rg, normal.rg));
|
||||
normal = tbnMatrix * normal;
|
||||
float norm = length(normal);
|
||||
// prevent breaking of normal maps
|
||||
if (norm > 0.0)
|
||||
normal /= norm;
|
||||
else
|
||||
normal = unitNormal;
|
||||
#endif
|
||||
normData = vec4(normal, 1.0);
|
||||
|
||||
#ifdef FLAG_ANIMATED
|
||||
vec2 distort = vec2(cos(position.x*position.w*0.005+anim_timer*20.0)*sin(position.y*position.w*0.005),sin(position.x*position.w*0.005+anim_timer*20.0)*cos(position.y*position.w*0.005))*0.03;
|
||||
#endif
|
||||
|
||||
#ifdef FLAG_DIFFUSE_MAP
|
||||
vec2 diffuseTexCoord = texCoord;
|
||||
#ifdef FLAG_ANIMATED
|
||||
if (effect_num == 2) {
|
||||
diffuseTexCoord = texCoord + distort*(1.0-anim_timer);
|
||||
}
|
||||
#endif
|
||||
baseColor = texture2D(sBasemap, diffuseTexCoord);
|
||||
if ( blend_alpha == 0 && baseColor.a < 0.95 ) discard; // if alpha blending is not on, discard transparent pixels
|
||||
// premultiply alpha if blend_alpha is 1. assume that our blend function is srcColor + (1-Alpha)*destColor.
|
||||
// if blend_alpha is 2, assume blend func is additive and don't modify color
|
||||
if(blend_alpha == 1) baseColor.rgb = baseColor.rgb * baseColor.a;
|
||||
if(overrideDiffuse) baseColor.rgb = diffuseClr;
|
||||
#ifdef FLAG_HDR
|
||||
baseColor.rgb = pow(baseColor.rgb, vec3(SRGB_GAMMA));
|
||||
#endif
|
||||
baseColor.rgb *= aoFactors.y;
|
||||
#endif
|
||||
|
||||
specData = vec4(baseColor.rgb * SPEC_FACTOR_NO_SPEC_MAP, glossData);
|
||||
#ifdef FLAG_SPEC_MAP
|
||||
vec4 specColour = texture2D(sSpecmap, texCoord);
|
||||
if(alphaGloss) glossData = specColour.a;
|
||||
if(overrideSpec) specColour.rgb = specClr;
|
||||
#ifdef FLAG_HDR
|
||||
if(gammaSpec) specColour.rgb = pow(specColour.rgb, vec3(SRGB_GAMMA));
|
||||
#endif
|
||||
specColour.rgb *= aoFactors.y;
|
||||
specColour.rgb = max(specColour.rgb, vec3(0.04)); // hardcoded minimum specular value. read John Hable's blog post titled 'Everything Is Shiny'.
|
||||
specData = vec4(specColour.rgb, glossData);
|
||||
#endif
|
||||
|
||||
#ifdef FLAG_MISC_MAP
|
||||
#ifdef FLAG_TEAMCOLOR
|
||||
vec4 teamMask = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
teamMask = texture2D(sMiscmap, texCoord);
|
||||
vec3 base = base_color - vec3(0.5);
|
||||
vec3 stripe = stripe_color - vec3(0.5);
|
||||
baseColor.rgb += (base * teamMask.x) + (stripe * teamMask.y);
|
||||
baseColor.rgb = max(baseColor.rgb, vec3(0.0));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
float shadow = 1.0;
|
||||
#ifdef FLAG_SHADOWS
|
||||
shadow = getShadowValue();
|
||||
#endif
|
||||
|
||||
#ifdef FLAG_LIGHT
|
||||
baseColor.rgb = CalculateLighting(normal, baseColor.rgb, specData.rgb, glossData, shadow, aoFactors.x);
|
||||
#else
|
||||
baseColor.rgb *= max(gl_Color.rgb * AMBIENT_LIGHT_BOOST, gl_LightModel.ambient.rgb - 0.425);
|
||||
baseColor.rgb += gl_SecondaryColor.rgb * specData.rgb;
|
||||
#endif
|
||||
|
||||
#ifdef FLAG_ENV_MAP
|
||||
vec3 envReflectNM = normalize(envReflect);
|
||||
#ifdef FLAG_NORMAL_MAP
|
||||
envReflectNM += vec3(normalSample, 0.0);
|
||||
envReflectNM = normalize(envReflectNM);
|
||||
#endif
|
||||
float mip = (envGloss) ? (1.0 - glossData) * 7.0 : 0.0;
|
||||
vec4 envColour = textureCubeLod(sEnvmap, envReflectNM, mip);
|
||||
#ifdef FLAG_HDR
|
||||
envColour.rgb = pow(envColour.rgb, vec3(SRGB_GAMMA));
|
||||
#endif
|
||||
envColour.rgb *= (envGloss) ? 1.0 : specColour.a;
|
||||
baseColor.rgb += envColour.rgb * FresnelLazarovEnv(specColour.rgb, eyeDir, normal, glossData);
|
||||
#endif
|
||||
|
||||
#ifdef FLAG_GLOW_MAP
|
||||
vec3 glowColor = texture2D(sGlowmap, texCoord).rgb;
|
||||
if(overrideGlow) glowColor = glowClr;
|
||||
#ifdef FLAG_HDR
|
||||
glowColor = pow(glowColor, vec3(SRGB_GAMMA)) * 3.0f;
|
||||
#endif
|
||||
#ifdef FLAG_MISC_MAP
|
||||
#ifdef FLAG_TEAMCOLOR
|
||||
float glowColorLuminance = dot(glowColor, vec3(0.299, 0.587, 0.114));
|
||||
glowColor = team_glow_enabled ? mix((base * teamMask.b) + (stripe * teamMask.a), glowColor, clamp(glowColorLuminance - teamMask.b - teamMask.a, 0.0, 1.0)) : glowColor;
|
||||
#endif
|
||||
#endif
|
||||
baseColor.rgb += glowColor * GLOW_MAP_INTENSITY;
|
||||
#endif
|
||||
|
||||
#ifdef FLAG_FOG
|
||||
vec3 fogColor = gl_Fog.color.rgb;
|
||||
#ifdef FLAG_HDR
|
||||
fogColor = pow(fogColor, vec3(SRGB_GAMMA));
|
||||
#endif
|
||||
#ifdef FLAG_DIFFUSE_MAP
|
||||
if(blend_alpha == 1) fogColor *= baseColor.a;
|
||||
#endif
|
||||
baseColor.rgb = mix(baseColor.rgb, fogColor, fogDist);
|
||||
specData.rgb *= fogDist;
|
||||
#endif
|
||||
|
||||
#ifdef FLAG_DIFFUSE_MAP
|
||||
if(desaturate == 1) {
|
||||
baseColor.rgb = desaturate_clr * dot(vec3(1.0), baseColor.rgb) * 0.3333333;
|
||||
}
|
||||
#endif
|
||||
#ifdef FLAG_ANIMATED
|
||||
if (effect_num == 0) {
|
||||
float shinefactor = 1.0/(1.0 + pow(abs((fract(abs(texCoord.x))-anim_timer) * 1000.0), 2.0)) * 1000.0;
|
||||
baseColor.rgb = baseColor.rgb + vec3(shinefactor);
|
||||
baseColor.a = baseColor.a * clamp(shinefactor * (fract(abs(texCoord.x))-anim_timer) * -10000.0,0.0,1.0);
|
||||
}
|
||||
if (effect_num == 1) {
|
||||
float shinefactor = 1.0/(1.0 + pow(abs(position.y-anim_timer), 2.0));
|
||||
baseColor.rgb = baseColor.rgb + vec3(shinefactor);
|
||||
#ifdef FLAG_LIGHT
|
||||
baseColor.a = baseColor.a;
|
||||
#else
|
||||
// ATI Wireframe fix *grumble*
|
||||
baseColor.a = clamp((position.y-anim_timer) * 10000.0,0.0,1.0);
|
||||
#endif
|
||||
}
|
||||
if (effect_num == 2) {
|
||||
vec2 screenPos = gl_FragCoord.xy * vec2(vpwidth,vpheight);
|
||||
baseColor.a = baseColor.a;
|
||||
float cloak_interp = (sin(position.x*position.w*0.005+anim_timer*20.0)*sin(position.y*position.w*0.005)*0.5)-0.5;
|
||||
#ifdef FLAG_LIGHT
|
||||
baseColor.rgb = mix(texture2D(sFramebuffer, screenPos + distort*anim_timer + anim_timer*0.1*normal.xy).rgb,baseColor.rgb,clamp(cloak_interp+anim_timer*2.0,0.0,1.0));
|
||||
#else
|
||||
baseColor.rgb = mix(texture2D(sFramebuffer, screenPos + distort*anim_timer + anim_timer*0.1*lNormal.xy).rgb,baseColor.rgb,clamp(cloak_interp+anim_timer*2.0,0.0,1.0));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#ifdef FLAG_CLIP
|
||||
// for some odd reason if we try to discard the pixel early for plane clipping, it screws up glow maps so let's just do it down here.
|
||||
if(use_clip_plane == 1) { if(clip_distance <= 0.0) { discard; } }
|
||||
#endif
|
||||
gl_FragData[0] = baseColor;
|
||||
#ifdef FLAG_DEFERRED
|
||||
gl_FragData[1] = posData;
|
||||
gl_FragData[2] = normData;
|
||||
gl_FragData[3] = specData;
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#extension GL_EXT_geometry_shader4 : enable
|
||||
uniform mat4 shadow_proj_matrix[4];
|
||||
varying in float Instance[3];
|
||||
varying out vec4 position;
|
||||
#ifdef FLAG_TRANSFORM
|
||||
varying in float not_visible_g[];
|
||||
varying out float not_visible;
|
||||
#endif
|
||||
#ifdef FLAG_CLIP
|
||||
varying in float clip_distance_g[];
|
||||
varying out float clip_distance;
|
||||
#endif
|
||||
void main(void)
|
||||
{
|
||||
int instanceID = int(Instance[0]);
|
||||
for(int vert = 0; vert < gl_VerticesIn; vert++)
|
||||
{
|
||||
gl_Position = shadow_proj_matrix[instanceID] * gl_PositionIn[vert];
|
||||
if(gl_Position.z < -1.0)
|
||||
gl_Position.z = -1.0;
|
||||
position = gl_PositionIn[vert];
|
||||
gl_ClipVertex = gl_ClipVertexIn[vert];
|
||||
gl_Layer = instanceID;
|
||||
#ifdef FLAG_TRANSFORM
|
||||
not_visible = not_visible_g[0];
|
||||
#endif
|
||||
#ifdef FLAG_CLIP
|
||||
clip_distance = clip_distance_g[0];
|
||||
#endif
|
||||
EmitVertex();
|
||||
}
|
||||
EndPrimitive();
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
#ifdef APPLE
|
||||
#extension GL_ARB_draw_instanced : enable
|
||||
#else
|
||||
#ifdef __GLSL_CG_DATA_TYPES
|
||||
#extension GL_EXT_draw_instanced : enable
|
||||
#else
|
||||
#extension GL_ARB_draw_instanced : enable
|
||||
#endif
|
||||
#endif
|
||||
#ifdef FLAG_ENV_MAP
|
||||
uniform mat4 envMatrix;
|
||||
varying vec3 envReflect;
|
||||
#endif
|
||||
#ifdef FLAG_NORMAL_MAP
|
||||
varying mat3 tbnMatrix;
|
||||
#endif
|
||||
#ifdef FLAG_FOG
|
||||
varying float fogDist;
|
||||
#endif
|
||||
#ifdef FLAG_TRANSFORM
|
||||
#extension GL_ARB_texture_buffer_object : enable
|
||||
attribute float model_id;
|
||||
uniform samplerBuffer transform_tex;
|
||||
uniform int buffer_matrix_offset;
|
||||
#ifdef FLAG_SHADOW_MAP
|
||||
varying float not_visible_g;
|
||||
#else
|
||||
varying float not_visible;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef FLAG_SHADOW_MAP
|
||||
varying float Instance;
|
||||
uniform mat4 shadow_proj_matrix[4];
|
||||
#endif
|
||||
#ifdef FLAG_SHADOWS
|
||||
uniform mat4 shadow_mv_matrix;
|
||||
uniform mat4 shadow_proj_matrix[4];
|
||||
uniform mat4 model_matrix;
|
||||
varying vec4 shadow_vec[4];
|
||||
varying vec4 pos_shadow;
|
||||
#endif
|
||||
#ifdef FLAG_THRUSTER
|
||||
uniform float thruster_scale;
|
||||
#endif
|
||||
#ifdef FLAG_CLIP
|
||||
uniform int use_clip_plane;
|
||||
uniform vec3 clip_normal;
|
||||
uniform vec3 clip_position;
|
||||
//uniform vec4 clip_plane;
|
||||
uniform mat4 world_matrix;
|
||||
#ifdef FLAG_SHADOW_MAP
|
||||
varying float clip_distance_g;
|
||||
#else
|
||||
varying float clip_distance;
|
||||
#endif
|
||||
#endif
|
||||
varying vec4 position;
|
||||
varying vec3 lNormal;
|
||||
#ifdef FLAG_TRANSFORM
|
||||
#define TEXELS_PER_MATRIX 4
|
||||
void getModelTransform(inout mat4 transform, inout float invisible, int id, int matrix_offset)
|
||||
{
|
||||
transform[0] = texelFetch(transform_tex, (matrix_offset + id) * TEXELS_PER_MATRIX);
|
||||
transform[1] = texelFetch(transform_tex, (matrix_offset + id) * TEXELS_PER_MATRIX + 1);
|
||||
transform[2] = texelFetch(transform_tex, (matrix_offset + id) * TEXELS_PER_MATRIX + 2);
|
||||
transform[3] = texelFetch(transform_tex, (matrix_offset + id) * TEXELS_PER_MATRIX + 3);
|
||||
invisible = transform[3].w;
|
||||
transform[3].w = 1.0;
|
||||
}
|
||||
#endif
|
||||
#ifdef FLAG_SHADOWS
|
||||
vec4 transformToShadowMap(int i, vec4 pos)
|
||||
{
|
||||
vec4 shadow_proj;
|
||||
shadow_proj = shadow_proj_matrix[i] * pos;
|
||||
shadow_proj += 1.0;
|
||||
shadow_proj *= 0.5;
|
||||
shadow_proj.w = shadow_proj.z;
|
||||
shadow_proj.z = float(i);
|
||||
return shadow_proj;
|
||||
}
|
||||
#endif
|
||||
void main()
|
||||
{
|
||||
mat4 orient = mat4(1.0);
|
||||
mat4 scale = mat4(1.0);
|
||||
#ifdef FLAG_TRANSFORM
|
||||
float invisible; getModelTransform(orient, invisible, int(model_id), buffer_matrix_offset);
|
||||
#ifdef FLAG_SHADOW_MAP
|
||||
not_visible_g = invisible;
|
||||
#else
|
||||
not_visible = invisible;
|
||||
#endif
|
||||
#endif
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
vec4 vertex = gl_Vertex;
|
||||
#ifdef FLAG_THRUSTER
|
||||
if(vertex.z < -1.5) {
|
||||
vertex.z *= thruster_scale;
|
||||
}
|
||||
#endif
|
||||
position = gl_ModelViewMatrix * orient * vertex;
|
||||
#ifdef FLAG_SHADOW_MAP
|
||||
gl_Position = position;
|
||||
#ifdef APPLE
|
||||
Instance = float(gl_InstanceIDARB);
|
||||
#else
|
||||
Instance = float(gl_InstanceID);
|
||||
#endif
|
||||
#else
|
||||
gl_Position = gl_ProjectionMatrix * position;
|
||||
#endif
|
||||
gl_FrontColor = gl_Color;
|
||||
gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
// Transform the normal into eye space and normalize the result.
|
||||
vec3 normal = normalize(gl_NormalMatrix * mat3(orient) * gl_Normal);
|
||||
lNormal = normal;
|
||||
#ifdef FLAG_SHADOWS
|
||||
pos_shadow = shadow_mv_matrix * model_matrix * orient * gl_Vertex;
|
||||
shadow_vec[0] = transformToShadowMap(0, pos_shadow);
|
||||
shadow_vec[1] = transformToShadowMap(1, pos_shadow);
|
||||
shadow_vec[2] = transformToShadowMap(2, pos_shadow);
|
||||
shadow_vec[3] = transformToShadowMap(3, pos_shadow);
|
||||
#endif
|
||||
#ifdef FLAG_NORMAL_MAP
|
||||
// Setup stuff for normal maps
|
||||
vec3 t = normalize(gl_NormalMatrix * mat3(orient) * gl_MultiTexCoord1.xyz);
|
||||
vec3 b = cross(normal, t) * gl_MultiTexCoord1.w;
|
||||
tbnMatrix = mat3(t, b, normal);
|
||||
#endif
|
||||
#ifdef FLAG_ENV_MAP
|
||||
// Environment mapping reflection vector.
|
||||
envReflect = reflect(normalize(position.xyz), normal);
|
||||
envReflect = vec3(envMatrix * vec4(envReflect, 0.0));
|
||||
#endif
|
||||
#ifdef FLAG_FOG
|
||||
fogDist = clamp((gl_Position.z - gl_Fog.start) * 0.75 * gl_Fog.scale, 0.0, 1.0);
|
||||
#endif
|
||||
#ifdef FLAG_CLIP
|
||||
float clip_dist = 0.0;
|
||||
if(use_clip_plane == 1) clip_dist = dot(normalize((world_matrix*orient*vertex).xyz - clip_position), clip_normal);
|
||||
#ifdef FLAG_SHADOW_MAP
|
||||
clip_distance_g = clip_dist;
|
||||
#else
|
||||
clip_distance = clip_dist;
|
||||
#endif
|
||||
#endif
|
||||
gl_ClipVertex = (gl_ModelViewMatrix * orient * vertex);
|
||||
}
|
||||
@@ -0,0 +1,462 @@
|
||||
|
||||
#Ship types
|
||||
$Name: Navbuoy
|
||||
$Max Debris Speed: 200
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 10.0
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 500.0
|
||||
$AI:
|
||||
+Actively Pursues: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Turrets attack this: YES
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Sentry Gun
|
||||
$Counts for Alone: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Max Debris Speed: 200
|
||||
$FF Multiplier: 0.10
|
||||
$EMP Multiplier: 10.0
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 500.0
|
||||
$AI:
|
||||
+Accept Player Orders: NO
|
||||
+Auto attacks: YES
|
||||
+Actively Pursues: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Escape Pod
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Warp Pushable: YES
|
||||
$Turrets prioritize ship target: YES
|
||||
$Max Debris Speed: 200
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 10.0
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 600.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "attack wing" "dock" "waypoints" "waypoints once" "depart" "undock" "stay still" "play dead" "stay near ship" )
|
||||
+Actively Pursues: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Turrets attack this: YES
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Cargo
|
||||
$Scannable: YES
|
||||
$Max Debris Speed: 200
|
||||
$FF Multiplier: 0.10
|
||||
$EMP Multiplier: 10.0
|
||||
$Beams Easily Hit: YES
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 500.0
|
||||
$AI:
|
||||
+Passive docks: ( "cargo" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Support
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Warp Pushable: YES
|
||||
$Turrets prioritize ship target: YES
|
||||
$Max Debris Speed: 200
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 3.5
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 500.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "dock" "undock" "waypoints" "waypoints once" "stay near ship" "keep safe dist" "stay still" "play dead" )
|
||||
+Accept Player Orders: YES
|
||||
+Player orders: ( "rearm me" "abort rearm" "depart" )
|
||||
+Auto attacks: YES
|
||||
+Actively Pursues: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Active docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
;;WMC - Stealth ships always have another type, so this isn't used
|
||||
$Name: Stealth
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Max Debris Speed: 200
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 4.0
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 500.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "waypoints" "waypoints once" "depart" "attack subsys" "attack wing" "guard ship" "disable ship" "disarm ship" "attack any" "ignore ship" "ignore ship (new)" "guard wing" "evade ship" "stay still" "play dead" "stay near ship" "keep safe dist" )
|
||||
+Accept Player Orders: YES
|
||||
+Player Orders: ( "attack ship" "disable ship" "disarm ship" "guard ship" "ignore ship" "ignore ship (new)" "form on wing" "cover me" "attack any" "depart" "disable subsys" )
|
||||
+Auto attacks: YES
|
||||
+Actively Pursues: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Fighter
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Warp Pushable: YES
|
||||
$Turrets prioritize ship target: YES
|
||||
$Max Debris Speed: 200
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 4.0
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 500.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "waypoints" "waypoints once" "depart" "attack subsys" "attack wing" "guard ship" "disable ship" "disarm ship" "attack any" "ignore ship" "ignore ship (new)" "guard wing" "evade ship" "stay still" "play dead" "stay near ship" "keep safe dist" "form on wing")
|
||||
+Accept Player Orders: YES
|
||||
+Player Orders: ( "attack ship" "disable ship" "disarm ship" "guard ship" "ignore ship" "ignore ship (new)" "form on wing" "cover me" "attack any" "depart" "disable subsys" )
|
||||
+Auto attacks: YES
|
||||
+Actively Pursues: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Can Form Wing: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Bomber
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Warp Pushable: YES
|
||||
$Turrets prioritize ship target: YES
|
||||
$Max Debris Speed: 200
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 4.0
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 500.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "waypoints" "waypoints once" "depart" "attack subsys" "attack wing" "guard ship" "disable ship" "disarm ship" "attack any" "ignore ship" "ignore ship (new)" "guard wing" "evade ship" "stay still" "play dead" "stay near ship" "keep safe dist" "form on wing" )
|
||||
+Accept Player Orders: YES
|
||||
+Player Orders: ( "attack ship" "disable ship" "disarm ship" "guard ship" "ignore ship" "ignore ship (new)" "form on wing" "cover me" "attack any" "depart" "disable subsys" )
|
||||
+Auto attacks: YES
|
||||
+Actively Pursues: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Can Form Wing: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
;;WMC - This fighter/bomber type doesn't seem to be used anywhere, because no ship is set as both fighter and bomber
|
||||
$Name: Fighter/bomber
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Warp Pushable: YES
|
||||
$Max Debris Speed: 200
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 4.0
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 500.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "waypoints" "waypoints once" "depart" "attack subsys" "attack wing" "guard ship" "disable ship" "disarm ship" "attack any" "ignore ship" "ignore ship (new)" "guard wing" "evade ship" "stay still" "play dead" "stay near ship" "keep safe dist" "form on wing" )
|
||||
+Accept Player Orders: YES
|
||||
+Player Orders: ( "attack ship" "disable ship" "disarm ship" "guard ship" "ignore ship" "ignore ship (new)" "form on wing" "cover me" "attack any" "depart" "disable subsys" )
|
||||
+Auto attacks: YES
|
||||
+Actively Pursues: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Can Form Wing: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Transport
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Max Debris Speed: 150
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 2.0
|
||||
$Beams Easily Hit: YES
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 500.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "attack wing" "dock" "waypoints" "waypoints once" "depart" "undock" "stay still" "play dead" "stay near ship" )
|
||||
+Accept Player Orders: YES
|
||||
+Player Orders: ( "attack ship" "dock" "depart" )
|
||||
+Auto attacks: YES
|
||||
+Attempt Broadside: YES
|
||||
+Actively Pursues: ( "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Can Form Wing: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Freighter
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Scannable: YES
|
||||
$Max Debris Speed: 150
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 1.75
|
||||
$Beams Easily Hit: YES
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 600.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "attack wing" "dock" "waypoints" "waypoints once" "depart" "undock" "stay still" "play dead" "stay near ship" )
|
||||
+Accept Player Orders: YES
|
||||
+Player Orders: ( "attack ship" "dock" "depart" )
|
||||
+Auto attacks: YES
|
||||
+Attempt Broadside: YES
|
||||
+Actively Pursues: ( "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Can Form Wing: YES
|
||||
+Active docks: ( "cargo" )
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: AWACS
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Max Debris Speed: 150
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 0.8
|
||||
$Beams Easily Hit: YES
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 600.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "attack wing" "dock" "waypoints" "waypoints once" "depart" "undock" "stay still" "play dead" "stay near ship" )
|
||||
+Accept Player Orders: YES
|
||||
+Player Orders: ( "attack ship" "depart" )
|
||||
+Auto attacks: YES
|
||||
+Attempt Broadside: YES
|
||||
+Actively Pursues: ( "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Can Form Wing: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Gas Miner
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Max Debris Speed: 150
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 1.0
|
||||
$Beams Easily Hit: YES
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 600.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "attack wing" "dock" "waypoints" "waypoints once" "depart" "undock" "stay still" "play dead" "stay near ship" )
|
||||
+Accept Player Orders: YES
|
||||
+Player Orders: ( "attack ship" "depart" )
|
||||
+Auto attacks: YES
|
||||
+Attempt Broadside: YES
|
||||
+Actively Pursues: ( "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Can Form Wing: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Cruiser
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Max Debris Speed: 150
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 0.9
|
||||
$Beams Easily Hit: YES
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 600.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "attack wing" "dock" "waypoints" "waypoints once" "depart" "undock" "stay still" "play dead" "stay near ship" )
|
||||
+Accept Player Orders: YES
|
||||
+Player Orders: ( "attack ship" "depart" )
|
||||
+Auto attacks: YES
|
||||
+Attempt Broadside: YES
|
||||
+Actively Pursues: ( "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Can Form Wing: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Corvette
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Max Debris Speed: 150
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 0.3333
|
||||
$Beams Easily Hit: YES
|
||||
$Protected on cripple: YES
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 600.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "attack wing" "dock" "waypoints" "waypoints once" "depart" "undock" "stay still" "play dead" "stay near ship" )
|
||||
+Accept Player Orders: YES
|
||||
+Player Orders: ( "attack ship" "depart" )
|
||||
+Auto attacks: YES
|
||||
+Attempt Broadside: YES
|
||||
+Actively Pursues: ( "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Can Form Wing: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Capital
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Warp Pushes: YES
|
||||
$Max Debris Speed: 100
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 0.2
|
||||
$Beams Easily Hit: YES
|
||||
$Protected on cripple: NO
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 750.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "attack wing" "waypoints" "waypoints once" "depart" "stay still" "play dead" "stay near ship" )
|
||||
+Accept Player Orders: YES
|
||||
+Player Orders: ( "depart" )
|
||||
+Auto attacks: YES
|
||||
+Attempt Broadside: YES
|
||||
+Actively Pursues: ( "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Can Form Wing: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Super Cap
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Warp Pushes: YES
|
||||
$Max Debris Speed: 100
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 0.075
|
||||
$Beams Easily Hit: YES
|
||||
$Protected on cripple: NO
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 1000.0
|
||||
$AI:
|
||||
+Valid goals: ( "fly to ship" "attack ship" "attack wing" "waypoints" "waypoints once" "depart" "stay still" "play dead" "stay near ship" )
|
||||
+Auto attacks: YES
|
||||
+Attempt Broadside: YES
|
||||
+Actively Pursues: ( "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Can Form Wing: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Drydock
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Max Debris Speed: 100
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 0.5
|
||||
$Beams Easily Hit: YES
|
||||
$Protected on cripple: NO
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 750.0
|
||||
$AI:
|
||||
+Accept Player Orders: YES
|
||||
+Auto attacks: YES
|
||||
+Attempt Broadside: YES
|
||||
+Actively Pursues: ( "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
$Name: Knossos Device
|
||||
$Counts for Alone: YES
|
||||
$Praise Destruction: YES
|
||||
$On Hotkey List: YES
|
||||
$Target as Threat: YES
|
||||
$Show Attack Direction: YES
|
||||
$Max Debris Speed: 100
|
||||
$FF Multiplier: 1.0
|
||||
$EMP Multiplier: 0.10
|
||||
$Protected on cripple: NO
|
||||
$Fog:
|
||||
+Start dist: 10.0
|
||||
+Compl dist: 1000.0
|
||||
$AI:
|
||||
+Auto attacks: YES
|
||||
+Attempt Broadside: YES
|
||||
+Actively Pursues: ( "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
+Guards attack this: YES
|
||||
+Turrets attack this: YES
|
||||
+Passive docks: ( "support" )
|
||||
+Ignored on cripple by: ( "navbuoy" "sentry gun" "escape pod" "cargo" "support" "stealth" "fighter" "bomber" "fighter/bomber" "transport" "freighter" "awacs" "gas miner" "cruiser" "corvette" "capital" "super cap" "drydock" "knossos device" )
|
||||
$Vaporize Percent Chance: 0.0
|
||||
#End
|
||||
@@ -0,0 +1,14 @@
|
||||
uniform sampler2D baseMap;
|
||||
uniform int alphaTexture;
|
||||
uniform int noTexturing;
|
||||
uniform int srgb;
|
||||
uniform float intensity;
|
||||
#define SRGB_GAMMA 2.2
|
||||
void main()
|
||||
{
|
||||
vec4 baseColor = texture2D(baseMap, gl_TexCoord[0].xy);
|
||||
baseColor.rgb = (srgb == 1) ? pow(baseColor.rgb, vec3(SRGB_GAMMA)) : baseColor.rgb;
|
||||
vec4 blendColor = (srgb == 1) ? vec4(pow(gl_Color.rgb, vec3(SRGB_GAMMA)), gl_Color.a) : gl_Color ;
|
||||
baseColor *= blendColor;
|
||||
gl_FragColor = mix(mix(baseColor, vec4(blendColor.rgb, baseColor.a), float(alphaTexture)), blendColor, float(noTexturing)) * intensity;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
|
||||
gl_FrontColor = gl_Color;
|
||||
gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
uniform sampler2D tex;
|
||||
uniform float timer;
|
||||
uniform sampler2D bloomed;
|
||||
uniform float bloom_intensity;
|
||||
uniform int levels;
|
||||
#ifdef FLAG_DISTORT_NOISE
|
||||
uniform float noise_amount;
|
||||
#endif
|
||||
#ifdef FLAG_SATURATION
|
||||
uniform float saturation;
|
||||
#endif
|
||||
#ifdef FLAG_BRIGHTNESS
|
||||
uniform float brightness;
|
||||
#endif
|
||||
#ifdef FLAG_CONTRAST
|
||||
uniform float contrast;
|
||||
#endif
|
||||
#ifdef FLAG_GRAIN
|
||||
uniform float film_grain;
|
||||
#endif
|
||||
#ifdef FLAG_STRIPES
|
||||
uniform float tv_stripes;
|
||||
#endif
|
||||
#ifdef FLAG_CUTOFF
|
||||
uniform float cutoff;
|
||||
#endif
|
||||
#ifdef FLAG_DITH
|
||||
uniform float dither;
|
||||
#endif
|
||||
uniform sampler2D blurred_tex;
|
||||
uniform sampler2D depth_tex;
|
||||
void main()
|
||||
{
|
||||
#ifdef FLAG_DISTORT_NOISE
|
||||
// Distort noise
|
||||
float distort_factor = timer * sin(gl_TexCoord[0].x * gl_TexCoord[0].y * 100.0 + timer);
|
||||
distort_factor = mod(distort_factor, 8.0) * mod(distort_factor, 4.0);
|
||||
vec2 distort;
|
||||
distort = vec2(mod(distort_factor, noise_amount), mod(distort_factor, noise_amount + 0.002));
|
||||
#else
|
||||
vec2 distort = vec2(0, 0);
|
||||
#endif
|
||||
// Global constant
|
||||
vec4 color_in = texture2D(tex, gl_TexCoord[0].xy + distort);
|
||||
vec4 color_out;
|
||||
// Bloom
|
||||
if (bloom_intensity > 0.0) {
|
||||
vec3 bloom = vec3(0.0, 0.0, 0.0);
|
||||
float factor = 0.0;
|
||||
for (int mipmap = 0; mipmap < levels; ++mipmap) {
|
||||
float scale = 1.0/exp2(float(mipmap));
|
||||
factor += scale;
|
||||
bloom += texture2DLod(bloomed, gl_TexCoord[0].xy + distort, float(mipmap)).rgb * scale;
|
||||
}
|
||||
bloom /= factor;
|
||||
color_in.rgb += bloom;
|
||||
}
|
||||
#ifdef FLAG_SATURATION
|
||||
// Saturation
|
||||
vec4 color_grayscale = color_in;
|
||||
color_grayscale.rgb = vec3(dot(color_in.rgb, vec3(0.299, 0.587, 0.184)));
|
||||
color_out = mix(color_in, color_grayscale, 1.0 - saturation);
|
||||
#else
|
||||
color_out = color_in;
|
||||
#endif
|
||||
#ifdef FLAG_BRIGHTNESS
|
||||
// Brightness
|
||||
vec3 Afactor = vec3(brightness);
|
||||
color_out.rgb = color_out.rgb * Afactor;
|
||||
#endif
|
||||
#ifdef FLAG_CONTRAST
|
||||
// Contrast
|
||||
vec3 Bfactor = vec3(0.5 - 0.5 * contrast);
|
||||
color_out.rgb = color_out.rgb + Bfactor;
|
||||
#endif
|
||||
#ifdef FLAG_GRAIN
|
||||
// Film Grain
|
||||
float x = gl_TexCoord[0].x * gl_TexCoord[0].y * timer * 1000.0;
|
||||
x = mod(x, 13.0) * mod(x, 123.0);
|
||||
float dx = mod(x, 0.01);
|
||||
vec3 result = color_out.rgb + color_out.rgb * clamp(0.1 + dx * 100.0, 0.0, 1.0);
|
||||
color_out.rgb = mix(color_out.rgb, result, film_grain);
|
||||
#endif
|
||||
#ifdef FLAG_STRIPES
|
||||
// TV-Stripes (Old School)
|
||||
vec2 sc;
|
||||
sc.x = sin(gl_TexCoord[0].y * 2048.0);
|
||||
sc.y = cos(gl_TexCoord[0].y * 2048.0);
|
||||
vec3 stripes = color_out.rgb + color_out.rgb * vec3(sc.x, sc.y, sc.x) * 0.8;
|
||||
color_out.rgb = mix(color_out.rgb, stripes, tv_stripes);
|
||||
#endif
|
||||
#ifdef FLAG_CUTOFF
|
||||
// Experimental cutoff shader
|
||||
if (cutoff > 0.0) {
|
||||
vec4 color_greyscale;
|
||||
color_greyscale.rgb = vec3(dot(color_in.rgb, vec3(0.299, 0.587, 0.184)));
|
||||
vec4 normalized_col;
|
||||
float col_length = (length(color_out.rgb));
|
||||
if (col_length > 1.0) {
|
||||
normalized_col = ((color_out)/col_length);
|
||||
} else {
|
||||
normalized_col = color_out;
|
||||
}
|
||||
vec3 unit_grey = vec3(0.5773);
|
||||
float sat = dot(normalized_col.rgb, unit_grey);
|
||||
color_out = mix(color_greyscale, color_out, sat * cutoff);
|
||||
}
|
||||
#endif
|
||||
#ifdef FLAG_DITH
|
||||
// Dithering
|
||||
float downsampling_factor = 4;
|
||||
float bias = 0.5;
|
||||
color_out.rgb = floor(color_out.rgb * downsampling_factor + bias) / downsampling_factor;
|
||||
#endif
|
||||
color_out.a = 1.0;
|
||||
gl_FragColor = color_out;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_Position = gl_Vertex;
|
||||
gl_FrontColor = gl_Color;
|
||||
gl_FrontSecondaryColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
// Check necessary for ATI specific behavior
|
||||
#ifdef __GLSL_CG_DATA_TYPES
|
||||
gl_ClipVertex = (gl_ModelViewMatrix * gl_Vertex);
|
||||
#endif
|
||||
}
|
||||
Loaded 100 of 993 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user