Compare commits

..
Author SHA1 Message Date
asarium fa6a19bcd8 Enable qtFRED deploy builds 2018-04-15 22:53:36 +02:00
asarium 6fb9373d41 Fix Windows deployment issue
The CMake code did not specify that qwindows.cll also needed to be
distributed with the application which caused errors for users who had
not installed Qt on their system.

This should make qtFRED redistributable without needing a QT
installation.
2018-04-15 22:53:35 +02:00
asarium 1385312ee8 Try to close the window on Esc key presses
This will allow the user to cancel the operation or save their changes
instead of discarding them without question.
2018-04-14 11:51:06 +02:00
asarium f402b71fbc Fix Clang warnings 2018-04-14 11:51:06 +02:00
asarium 53723757a8 Port event handling part of Event editor code 2018-04-14 11:51:06 +02:00
asarium c09658ffb5 Replace interface functions with qt signals 2018-04-14 11:51:06 +02:00
asarium 4622c31d55 Port message handling code of event editor dialog 2018-04-14 11:51:06 +02:00
Fabian Woltermann a3d2320f0a Merge pull request #1681 from asarium/build/clang-tidy
Add clang-tidy to Travis CI configuration
2018-04-14 11:48:30 +02:00
asarium 9d352ddc5f Fix .clang-tidy format 2018-04-13 16:26:57 +02:00
MageKing17 299e584284 Merge pull request #1684 from asarium/fix/1683
Set team_glow_enabled uniform to proper value
2018-04-13 07:13:48 -07:00
asarium 4f22b12ec6 Mark all external libraries as system includes 2018-04-13 15:40:11 +02:00
asarium 57985b5f1a Enable misc-new-delete-overloads 2018-04-13 12:10:24 +02:00
asarium 513115ceeb Enable misc-noexcept-move-constructor check 2018-04-13 12:10:24 +02:00
asarium 95acebfce8 Add misc-multiple-statement-macro check 2018-04-13 12:10:24 +02:00
asarium ca5605cfb4 Add misc-move-forwarding-reference check 2018-04-13 12:10:24 +02:00
asarium ea4e5f222d Make .clang-tidy easier to read 2018-04-13 12:10:22 +02:00
asarium 538afc73a2 Keep building on Travis CI until more errors have occured
This will make it easier to find warnings and clang-tidy notifications
since ninja won't stop after the first warning or error was reported.
2018-04-13 12:10:03 +02:00
asarium 16560326e7 Add more clang-tidy checks 2018-04-13 12:10:01 +02:00
asarium 68372b18a2 Enable performance clang-tidy warnings 2018-04-13 12:08:56 +02:00
asarium c6abe74f06 Replace noexcept with compatibility macro 2018-04-13 12:08:07 +02:00
asarium f1c79c2ca7 Fix override warnings produced by clang-tidy 2018-04-13 12:08:06 +02:00
asarium 7944eda1cb Add Clang-tidy support 2018-04-13 11:40:38 +02:00
asarium 1571caa95e Set team_glow_enabled uniform to proper value
This was missed when converting the model uniforms to a uniform buffer
and caused some issues with team colors. This sets that uniform to the
value it had before the uniform buffer changes.

This fixes #1683.
2018-04-13 10:36:32 +02:00
m!m 9f97ea909a Merge pull request #1669 from jg18/qtfred2_/fictionViewerDialog
Add fiction viewer dialog to qtFRED
2018-04-13 09:57:01 +02:00
MageKing17 7469558e97 Merge pull request #1676 from asarium/fix/jsonOutputEfxSupport
Write EFX support information to JSON output
2018-04-12 17:10:38 -07:00
jg18 6747c630af Finish up qtFRED fiction viewer dialog 2018-04-11 21:45:38 -07:00
jg18 d80d8dd08e Use SignalBlockers with fiction viewer dialog 2018-04-09 23:51:19 -07:00
jg18 5ebf806c72 fix CI error about unused variable 2018-04-09 23:51:19 -07:00
jg18 6d2d092cc6 wrapup fiction viewer dialog corrections 2018-04-09 23:51:18 -07:00
jg18 cafee9c66a Add qtFRED notice about multiple fiction viewer stages 2018-04-09 23:51:18 -07:00
jg18 8fc281c7be Fix bugs in qtFRED fiction viewer dialog 2018-04-09 23:51:02 -07:00
jg18 8cae09bfe8 Add fiction viewer dialog to qtFRED (WIP) 2018-04-09 23:43:10 -07:00
jg18 5c5e48847e Add qtFRED keyboard shortcut for fiction viewer dialog 2018-04-09 23:42:47 -07:00
Joshua Glatt ae17e3f4b7 Merge pull request #1679 from asarium/qtfred2_/initSystem
Copy original FRED initialization code
2018-04-09 08:08:27 -07:00
m!m ebfc904e52 Merge pull request #1678 from jg18/qtfred2_/guisGalore
Add GUIs for background, shield system, and voice acting editors to qtFRED
2018-04-09 09:47:24 +02:00
asarium f3a3ed982f Copy original FRED initialization code
This copies the original FRED code for initializing the individual game
systems to qtFRED. This should fix the various issues caused by missing
game system initialization calls.
2018-04-09 09:45:41 +02:00
jg18 fabf05454b Make corrections to background editor UI and add dialog shortcut 2018-04-08 21:12:35 -07:00
m!m d309644e53 Merge pull request #1677 from jg18/qtfred2_/blockUiUpdate
Add SignalBlockers to qtFRED
2018-04-08 10:56:37 +02:00
jg18 63b21893df add stub dialog implementations and more corrections 2018-04-07 23:58:43 -07:00
jg18 81f4c03364 corrections to new GUIs 2018-04-07 23:01:04 -07:00
jg18 3668ce67d5 Add SignalBlockers to qtFRED 2018-04-07 19:52:23 -07:00
asarium 28ddf7d8d2 Write EFX support information to JSON output
The initial JSON flags output lacked this information but it is needed
for proper support by the launcher. This adds a new entry in the JSON
structure without changing anything else so it does not require a new
output version.
2018-04-06 13:48:49 +02:00
jg18 b2d427fb00 Add .ui files for background, shield system, and voice acting editor dialogs 2018-04-01 15:31:46 -07:00
194 changed files with 4928 additions and 1830 deletions

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
---
Checks: "-*,\
modernize-use-override,\
performance-*,\
-performance-type-promotion-in-math-fn,\
misc-assert-side-effect,\
misc-bool-pointer-implicit-conversion,\
misc-definitions-in-headers,\
misc-fold-init-type,\
misc-forward-declaration-namespace,\
misc-inaccurate-erase,\
misc-inefficient-algorithm,\
misc-macro-repeated-side-effects,\
misc-misplaced-const,\
misc-move-forwarding-reference,\
misc-multiple-statement-macro,\
misc-new-delete-overloads,\
misc-noexcept-move-constructor,\
"
WarningsAsErrors: ''
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
CheckOptions:
- key: 'misc-assert-side-effect.AssertMacros'
value: 'assert,Assert,Assertion'
...
+12 -8
View File
@@ -3,7 +3,7 @@ sudo: required
dist: trusty
cache:
directories:
- $HOME/cmake
- $HOME/cmake-3.6
- $HOME/.ccache
addons:
apt:
@@ -86,15 +86,17 @@ matrix:
- g++-7
- *global_deps
- os: linux
env: CONFIGURATION="Debug" CC=clang-3.6 CXX=clang++-3.6
env: CONFIGURATION="Debug" CC=clang-4.0 CXX=clang++-4.0 CMAKE_OPTIONS="-DENABLE_CLANG_TIDY=ON -DCLANG_TIDY_EXE=/usr/bin/clang-tidy-4.0"
addons:
apt:
sources:
- llvm-toolchain-precise
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- sourceline: 'ppa:beineri/opt-qt571-trusty'
packages:
- *global_deps
- clang-3.6
- clang-4.0
- clang-tidy-4.0
- libc++-dev
- os: osx
env: CONFIGURATION="Debug"
@@ -120,15 +122,17 @@ matrix:
- g++-7
- *global_deps
- os: linux
env: CONFIGURATION="Release" CC=clang-3.6 CXX=clang++-3.6
env: CONFIGURATION="Release" CC=clang-4.0 CXX=clang++-4.0 CMAKE_OPTIONS="-DENABLE_CLANG_TIDY=ON -DCLANG_TIDY_EXE=/usr/bin/clang-tidy-4.0"
addons:
apt:
sources:
- llvm-toolchain-precise
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- sourceline: 'ppa:beineri/opt-qt571-trusty'
packages:
- *global_deps
- clang-3.6
- clang-4.0
- clang-tidy-4.0
- libc++-dev
- os: osx
env: CONFIGURATION="Release"
@@ -143,7 +147,7 @@ before_install:
- "./ci/travis/before_install.sh"
install:
- "./ci/travis/install.sh"
- export PATH=$HOME/cmake/bin:$PATH
- export PATH=$HOME/cmake-3.6/bin:$PATH
before_script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then QT_ENV_SCRIPT=$(find /opt -name 'qt*-env.sh'); source $QT_ENV_SCRIPT; fi
- "./ci/travis/before_script.sh"
+4 -2
View File
@@ -142,6 +142,8 @@ if(FSO_BUILD_APPIMAGE)
include(appimage)
endif()
include(clang-tidy)
# This includes source code for some tools, either used in the build or also for something else
ADD_SUBDIRECTORY(tools)
@@ -168,7 +170,7 @@ if ("${CMAKE_VERSION}" VERSION_GREATER "3.5")
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Freespace2)
endif()
IF(MSVC_USE_RUNTIME_DLL)
IF(MSVC_USE_RUNTIME_DLL OR FSO_BUILD_QTFRED)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${BINARY_DESTINATION}")
IF(FSO_BUILD_FRED2)
@@ -176,7 +178,7 @@ IF(MSVC_USE_RUNTIME_DLL)
ENDIF(FSO_BUILD_FRED2)
INCLUDE(InstallRequiredSystemLibraries)
ENDIF(MSVC_USE_RUNTIME_DLL)
ENDIF()
include(package)
+1
View File
@@ -132,6 +132,7 @@ if ($DeployBuild) {
}
cmake -DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER/../install" -DFSO_USE_SPEECH="ON" `
-DFSO_BUILD_QTFRED=ON -DQT5_INSTALL_ROOT="$($buildConfig.QtDir)" `
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$($buildConfig.SimdType)" `
-G "$($buildConfig.Generator)" -T "$($buildConfig.Toolset)" ..
+2 -2
View File
@@ -20,7 +20,7 @@ if [ "$TRAVIS_OS_NAME" = "linux" ]; then
export CXXFLAGS
export CFLAGS
CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON"
CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON $CMAKE_OPTIONS"
if [ "$BUILD_DEPLOYMENT" = true ]; then
for config in $BUILD_CONFIGS
do
@@ -38,6 +38,6 @@ elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
if [ "$BUILD_DEPLOYMENT" = true ]; then
cmake -G "Xcode" -DFSO_FATAL_WARNINGS=ON -DFSO_INSTALL_DEBUG_FILES=ON -DCMAKE_INSTALL_PREFIX="/tmp/release" ..
else
cmake -G "Xcode" ..
cmake -G "Xcode" $CMAKE_OPTIONS ..
fi
fi
+5 -7
View File
@@ -4,16 +4,14 @@ set -ex
FILENAME=
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
if [ ! -d "$HOME/cmake/bin" ]; then
if [ ! -d "$HOME/cmake-3.6/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-3.6/
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
wget -O /tmp/cmake.tar.gz --no-check-certificate https://cmake.org/files/v3.6/cmake-3.6.0-Linux-x86_64.tar.gz
tar -xzf /tmp/cmake.tar.gz -C $HOME/cmake-3.6/ --strip-components=1
fi
export PATH=$HOME/cmake/bin:$PATH
export PATH=$HOME/cmake-3.6/bin:$PATH
cd $HOME
+1 -1
View File
@@ -5,7 +5,7 @@ set -e
cd build
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
ninja all
ninja -k 20 all
valgrind --leak-check=full --error-exitcode=1 --gen-suppressions=all \
--suppressions="$TRAVIS_BUILD_DIR/ci/travis/valgrind.supp" ./bin/unittests --gtest_shuffle
+37
View File
@@ -0,0 +1,37 @@
option(ENABLE_CLANG_TIDY "Enable source code checking using clang-tidy" OFF)
find_program(
CLANG_TIDY_EXE
NAMES "clang-tidy"
DOC "Path to clang-tidy executable"
)
function(enable_clang_tidy target)
# Not enabled in this configuration
endfunction()
if(NOT ENABLE_CLANG_TIDY)
return()
endif()
if(NOT EXISTS "${CLANG_TIDY_EXE}")
message(SEND_ERROR "clang-tidy: Could not find clang-tidy executable (value of variable is \"${CLANG_TIDY_EXE}\".")
return()
endif()
if(CMAKE_VERSION VERSION_LESS "3.6.0")
message(SEND_ERROR "Clang-tidy support requires CMake 3.6")
return()
endif()
message(STATUS "clang-tidy: Using \"${CLANG_TIDY_EXE}\"")
function(enable_clang_tidy target)
SET(TIDY_OPTIONS "${CLANG_TIDY_EXE}")
if(FSO_FATAL_WARNINGS)
set(TIDY_OPTIONS "${TIDY_OPTIONS};-warnings-as-errors=*")
endif()
set_target_properties(${target} PROPERTIES CXX_CLANG_TIDY "${TIDY_OPTIONS}")
endfunction()
+1 -1
View File
@@ -10,7 +10,7 @@ FUNCTION(ADD_IMPORTED_LIB NAME INCLUDES LIBS)
target_link_libraries(${NAME} INTERFACE "${LIBS}")
target_include_directories(${NAME} INTERFACE "${INCLUDES}")
target_include_directories(${NAME} SYSTEM INTERFACE "${INCLUDES}")
ENDFUNCTION(ADD_IMPORTED_LIB)
MACRO(PKG_CONFIG_LIB_RESOLVE NAME OUTVAR)
+2
View File
@@ -37,6 +37,8 @@ TARGET_LINK_LIBRARIES(code PUBLIC compiler)
target_link_libraries(code PUBLIC md5)
enable_clang_tidy(code)
IF (FSO_USE_SPEECH)
find_package(Speech REQUIRED)
target_link_libraries(code PUBLIC speech)
+8 -11
View File
@@ -13,7 +13,7 @@
#define __CFILE_H__
#include <time.h>
#include <ctime>
#include "globalincs/pstypes.h"
#include <stdexcept>
@@ -198,9 +198,9 @@ int cfwrite_compressed(void *param_buf, int param_elsize, int param_nelem, CFILE
int cfseek(CFILE *fp, int offset, int where);
// Returns current position of file.
int cftell(CFILE *fp);
// cfputc() writes a character to a file
int cftell(CFILE *fp);
// cfputc() writes a character to a file
int cfputc(int c, CFILE *cfile);
// cfputs() writes a string to a file
@@ -365,16 +365,13 @@ namespace cfile
{
}
cfile_error(const std::string &excuse) : m_excuse(excuse)
explicit cfile_error(const std::string &excuse) : m_excuse(excuse)
{
}
~cfile_error() throw()
{
}
~cfile_error() SCP_NOEXCEPT override {}
virtual const char *what() const throw()
{
const char *what() const SCP_NOEXCEPT override {
return m_excuse.c_str();
}
@@ -385,7 +382,7 @@ namespace cfile
class max_read_length : public cfile_error
{
public:
max_read_length(const std::string &excuse) : cfile_error(excuse)
explicit max_read_length(const std::string &excuse) : cfile_error(excuse)
{
}
+11 -10
View File
@@ -219,7 +219,6 @@ Flag exe_params[] =
{ "-set_cpu_affinity", "Sets processor affinity to config value", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
{ "-nograb", "Disables mouse grabbing", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nograb", },
{ "-noshadercache", "Disables the shader cache", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noshadercache", },
{ "-no_bindless_tex", "Disable bindless texturing", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_bindless_tex", },
#ifdef WIN32
{ "-fix_registry", "Use a different registry path", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
#endif
@@ -450,7 +449,6 @@ cmdline_parm no_geo_sdr_effects("-no_geo_effects", NULL, AT_NONE);
cmdline_parm set_cpu_affinity("-set_cpu_affinity", NULL, AT_NONE);
cmdline_parm nograb_arg("-nograb", NULL, AT_NONE);
cmdline_parm noshadercache_arg("-noshadercache", NULL, AT_NONE);
cmdline_parm no_bindless_tex_arg("-no_bindless_tex", NULL, AT_NONE);
#ifdef WIN32
cmdline_parm fix_registry("-fix_registry", NULL, AT_NONE);
#endif
@@ -469,7 +467,6 @@ bool Cmdline_no_geo_sdr_effects = false;
bool Cmdline_set_cpu_affinity = false;
bool Cmdline_nograb = false;
bool Cmdline_noshadercache = false;
bool Cmdline_no_bindless_textures = false;
#ifdef WIN32
bool Cmdline_alternate_registry_path = false;
#endif
@@ -1170,7 +1167,7 @@ bool cmdline_parm::has_param() {
#ifdef SCP_UNIX
// Return a vector with all filesystem names of "parent/dir" relative to parent.
// dir must not contain a slash.
static SCP_vector<SCP_string> unix_get_single_dir_names(SCP_string parent, SCP_string dir)
static SCP_vector<SCP_string> unix_get_single_dir_names(const SCP_string& parent, const SCP_string& dir)
{
SCP_vector<SCP_string> ret;
@@ -1193,7 +1190,7 @@ static SCP_vector<SCP_string> unix_get_single_dir_names(SCP_string parent, SCP_s
// Return a vector with all filesystem names of "parent/dir" relative to parent.
// Recurses to deal with slashes in dir.
static SCP_vector<SCP_string> unix_get_dir_names(SCP_string parent, SCP_string dir)
static SCP_vector<SCP_string> unix_get_dir_names(const SCP_string& parent, const SCP_string& dir)
{
size_t slash = dir.find_first_of("/\\");
@@ -1394,6 +1391,15 @@ static json_t* json_get_v1() {
json_object_set_new(openal_obj, "capture_devices", capture_array);
}
{
auto efx_support_obj = json_object();
for (auto& pair : openal_info.efx_support) {
json_object_set_new(efx_support_obj, pair.first.c_str(), json_boolean(pair.second));
}
json_object_set_new(openal_obj, "efx_support", efx_support_obj);
}
json_object_set_new(root, "openal", openal_obj);
}
@@ -1940,11 +1946,6 @@ bool SetCmdlineParams()
Cmdline_noshadercache = true;
}
if (no_bindless_tex_arg.found())
{
Cmdline_no_bindless_textures = true;
}
if (portable_mode.found())
{
Cmdline_portable_mode = true;
-1
View File
@@ -135,7 +135,6 @@ extern bool Cmdline_no_geo_sdr_effects;
extern bool Cmdline_set_cpu_affinity;
extern bool Cmdline_nograb;
extern bool Cmdline_noshadercache;
extern bool Cmdline_no_bindless_textures;
#ifdef WIN32
extern bool Cmdline_alternate_registry_path;
#endif
+3 -3
View File
@@ -25,11 +25,11 @@ class AudioDecoder: public FFMPEGStreamDecoder<AudioFrame> {
public:
explicit AudioDecoder(DecoderStatus* status);
virtual ~AudioDecoder();
~AudioDecoder() override;
virtual void decodePacket(AVPacket* packet) SCP_OVERRIDE;
void decodePacket(AVPacket* packet) override;
virtual void finishDecoding() SCP_OVERRIDE;
void finishDecoding() override;
};
}
}
+7 -7
View File
@@ -17,19 +17,19 @@ class FFMPEGDecoder: public Decoder {
public:
FFMPEGDecoder();
virtual ~FFMPEGDecoder();
~FFMPEGDecoder() override;
bool initialize(const SCP_string& fileName) SCP_OVERRIDE;
bool initialize(const SCP_string& fileName) override;
MovieProperties getProperties() SCP_OVERRIDE;
MovieProperties getProperties() override;
void startDecoding() SCP_OVERRIDE;
void startDecoding() override;
bool hasAudio() SCP_OVERRIDE;
bool hasAudio() override;
bool hasSubtitles() SCP_OVERRIDE;
bool hasSubtitles() override;
void close() SCP_OVERRIDE;
void close() override;
};
}
}
+3 -3
View File
@@ -10,11 +10,11 @@ class SubtitleDecoder: public FFMPEGStreamDecoder<SubtitleFrame> {
public:
explicit SubtitleDecoder(DecoderStatus* status);
virtual ~SubtitleDecoder();
~SubtitleDecoder() override;
virtual void decodePacket(AVPacket* packet) SCP_OVERRIDE;
void decodePacket(AVPacket* packet) override;
virtual void finishDecoding() SCP_OVERRIDE;
void finishDecoding() override;
void pushSubtitleFrame(AVPacket* subtitle, AVSubtitle* pSubtitle);
};
+2 -2
View File
@@ -22,14 +22,14 @@ class FFMPEGVideoFrame: public VideoFrame {
FFMPEGVideoFrame() : frame(nullptr) {
}
virtual ~FFMPEGVideoFrame() {
~FFMPEGVideoFrame() override {
if (frame != nullptr) {
av_freep(&frame->data[0]);
av_frame_free(&frame);
}
}
virtual DataPointers getDataPointers() {
DataPointers getDataPointers() override {
DataPointers ptrs;
ptrs.y = frame->data[0];
ptrs.u = frame->data[1];
+3 -3
View File
@@ -15,11 +15,11 @@ class VideoDecoder: public FFMPEGStreamDecoder<VideoFrame> {
public:
explicit VideoDecoder(DecoderStatus* status);
virtual ~VideoDecoder();
~VideoDecoder() override;
virtual void decodePacket(AVPacket* packet) SCP_OVERRIDE;
void decodePacket(AVPacket* packet) override;
virtual void finishDecoding() SCP_OVERRIDE;
void finishDecoding() override;
};
}
}
+2 -2
View File
@@ -48,10 +48,10 @@ class DecalDefinition {
DecalDefinition& operator=(const DecalDefinition&) = delete;
// Move constructor and operator
DecalDefinition(DecalDefinition&& other) {
DecalDefinition(DecalDefinition&& other) SCP_NOEXCEPT {
*this = std::move(other); // Use operator implementation
}
DecalDefinition& operator=(DecalDefinition&& other) {
DecalDefinition& operator=(DecalDefinition&& other) SCP_NOEXCEPT {
std::swap(_name, other._name);
std::swap(_diffuseFilename, other._diffuseFilename);
+27 -105
View File
@@ -1,8 +1,4 @@
#ifdef FEATURE_BINDLESS_TEXTURES
#extension GL_ARB_bindless_texture : require
#endif
#include "shadows.sdr"
#include "lighting.sdr"
#include "gamma.sdr"
@@ -23,96 +19,6 @@ struct model_light {
vec3 direction;
};
#ifdef FEATURE_BINDLESS_TEXTURES
layout (std140) uniform modelData {
mat4 modelViewMatrix;
mat4 modelMatrix;
mat4 viewMatrix;
mat4 projMatrix;
mat4 textureMatrix;
mat4 shadow_mv_matrix;
mat4 shadow_proj_matrix[4];
mat4 envMatrix;
vec4 color;
model_light lights[MAX_LIGHTS];
float extrudeWidth;
float fogStart;
float fogScale;
int buffer_matrix_offset;
vec4 clip_equation;
float thruster_scale;
bool use_clip_plane;
int n_lights;
float defaultGloss;
vec3 ambientFactor;
int desaturate;
vec3 diffuseFactor;
int blend_alpha;
vec3 emissionFactor;
bool overrideDiffuse;
vec3 diffuseClr;
bool overrideGlow;
vec3 glowClr;
bool overrideSpec;
vec3 specClr;
bool alphaGloss;
bool gammaSpec;
bool envGloss;
bool alpha_spec;
int effect_num;
vec4 fogColor;
vec3 base_color;
float anim_timer;
vec3 stripe_color;
float vpwidth;
float vpheight;
bool team_glow_enabled;
float znear;
float zfar;
float veryneardist;
float neardist;
float middist;
float fardist;
vec2 normalAlphaMinMax;
int sBasemapIndex;
int sGlowmapIndex;
int sSpecmapIndex;
int sNormalmapIndex;
int sAmbientmapIndex;
int sMiscmapIndex;
sampler2DArray sBasemap;
sampler2DArray sGlowmap;
sampler2DArray sSpecmap;
samplerCube sEnvmap;
sampler2DArray sNormalmap;
sampler2DArray sAmbientmap;
sampler2DArray sMiscmap;
sampler2DArray sHeightmap;
};
#else
layout (std140) uniform modelData {
mat4 modelViewMatrix;
mat4 modelMatrix;
@@ -189,17 +95,6 @@ layout (std140) uniform modelData {
int sAmbientmapIndex;
int sMiscmapIndex;
};
uniform sampler2DArray sBasemap;
uniform sampler2DArray sGlowmap;
uniform sampler2DArray sSpecmap;
uniform samplerCube sEnvmap;
uniform sampler2DArray sNormalmap;
uniform sampler2DArray sAmbientmap;
uniform sampler2DArray sMiscmap;
#endif
uniform sampler2D sFramebuffer;
uniform sampler2DArray shadow_map;
in VertexOutput {
#ifdef FLAG_ENV_MAP
@@ -225,9 +120,36 @@ in VertexOutput {
#endif
} vertIn;
#ifdef FLAG_DIFFUSE_MAP
uniform sampler2DArray sBasemap;
#endif
#ifdef FLAG_GLOW_MAP
uniform sampler2DArray sGlowmap;
#endif
#ifdef FLAG_SPEC_MAP
uniform sampler2DArray sSpecmap;
#endif
#ifdef FLAG_ENV_MAP
uniform samplerCube sEnvmap;
#endif
#ifdef FLAG_NORMAL_MAP
uniform sampler2DArray sNormalmap;
#endif
#ifdef FLAG_AMBIENT_MAP
uniform sampler2DArray sAmbientmap;
#endif
#ifdef FLAG_ANIMATED
uniform sampler2D sFramebuffer;
#endif
#ifdef FLAG_TEAMCOLOR
vec2 teamMask = vec2(0.0, 0.0);
#endif
#ifdef FLAG_MISC_MAP
uniform sampler2DArray sMiscmap;
#endif
#ifdef FLAG_SHADOWS
uniform sampler2DArray shadow_map;
#endif
out vec4 fragOut0;
out vec4 fragOut1;
-95
View File
@@ -1,9 +1,5 @@
#extension GL_ARB_gpu_shader5: enable
#ifdef FEATURE_BINDLESS_TEXTURES
#extension GL_ARB_bindless_texture : require
#endif
layout (triangles) in;
layout (triangle_strip, max_vertices = 3) out;
#ifdef GL_ARB_gpu_shader5
@@ -23,96 +19,6 @@ struct model_light {
vec3 direction;
};
#ifdef FEATURE_BINDLESS_TEXTURES
layout (std140) uniform modelData {
mat4 modelViewMatrix;
mat4 modelMatrix;
mat4 viewMatrix;
mat4 projMatrix;
mat4 textureMatrix;
mat4 shadow_mv_matrix;
mat4 shadow_proj_matrix[4];
mat4 envMatrix;
vec4 color;
model_light lights[MAX_LIGHTS];
float extrudeWidth;
float fogStart;
float fogScale;
int buffer_matrix_offset;
vec4 clip_equation;
float thruster_scale;
bool use_clip_plane;
int n_lights;
float defaultGloss;
vec3 ambientFactor;
int desaturate;
vec3 diffuseFactor;
int blend_alpha;
vec3 emissionFactor;
bool overrideDiffuse;
vec3 diffuseClr;
bool overrideGlow;
vec3 glowClr;
bool overrideSpec;
vec3 specClr;
bool alphaGloss;
bool gammaSpec;
bool envGloss;
bool alpha_spec;
int effect_num;
vec4 fogColor;
vec3 base_color;
float anim_timer;
vec3 stripe_color;
float vpwidth;
float vpheight;
bool team_glow_enabled;
float znear;
float zfar;
float veryneardist;
float neardist;
float middist;
float fardist;
vec2 normalAlphaMinMax;
int sBasemapIndex;
int sGlowmapIndex;
int sSpecmapIndex;
int sNormalmapIndex;
int sAmbientmapIndex;
int sMiscmapIndex;
sampler2DArray sBasemap;
sampler2DArray sGlowmap;
sampler2DArray sSpecmap;
samplerCube sEnvmap;
sampler2DArray sNormalmap;
sampler2DArray sAmbientmap;
sampler2DArray sMiscmap;
sampler2DArray sHeightmap;
};
#else
layout (std140) uniform modelData {
mat4 modelViewMatrix;
mat4 modelMatrix;
@@ -189,7 +95,6 @@ layout (std140) uniform modelData {
int sAmbientmapIndex;
int sMiscmapIndex;
};
#endif
in VertexOutput {
#ifdef FLAG_ENV_MAP
+2 -94
View File
@@ -1,7 +1,4 @@
#extension GL_ARB_gpu_shader5: enable
#ifdef FEATURE_BINDLESS_TEXTURES
#extension GL_ARB_bindless_texture : require
#endif
#include "shadows.sdr"
@@ -25,96 +22,6 @@ struct model_light {
vec3 direction;
};
#ifdef FEATURE_BINDLESS_TEXTURES
layout (std140) uniform modelData {
mat4 modelViewMatrix;
mat4 modelMatrix;
mat4 viewMatrix;
mat4 projMatrix;
mat4 textureMatrix;
mat4 shadow_mv_matrix;
mat4 shadow_proj_matrix[4];
mat4 envMatrix;
vec4 color;
model_light lights[MAX_LIGHTS];
float extrudeWidth;
float fogStart;
float fogScale;
int buffer_matrix_offset;
vec4 clip_equation;
float thruster_scale;
bool use_clip_plane;
int n_lights;
float defaultGloss;
vec3 ambientFactor;
int desaturate;
vec3 diffuseFactor;
int blend_alpha;
vec3 emissionFactor;
bool overrideDiffuse;
vec3 diffuseClr;
bool overrideGlow;
vec3 glowClr;
bool overrideSpec;
vec3 specClr;
bool alphaGloss;
bool gammaSpec;
bool envGloss;
bool alpha_spec;
int effect_num;
vec4 fogColor;
vec3 base_color;
float anim_timer;
vec3 stripe_color;
float vpwidth;
float vpheight;
bool team_glow_enabled;
float znear;
float zfar;
float veryneardist;
float neardist;
float middist;
float fardist;
vec2 normalAlphaMinMax;
int sBasemapIndex;
int sGlowmapIndex;
int sSpecmapIndex;
int sNormalmapIndex;
int sAmbientmapIndex;
int sMiscmapIndex;
sampler2DArray sBasemap;
sampler2DArray sGlowmap;
sampler2DArray sSpecmap;
samplerCube sEnvmap;
sampler2DArray sNormalmap;
sampler2DArray sAmbientmap;
sampler2DArray sMiscmap;
sampler2DArray sHeightmap;
};
#else
layout (std140) uniform modelData {
mat4 modelViewMatrix;
mat4 modelMatrix;
@@ -191,9 +98,10 @@ layout (std140) uniform modelData {
int sAmbientmapIndex;
int sMiscmapIndex;
};
#endif
#ifdef FLAG_TRANSFORM
uniform samplerBuffer transform_tex;
#endif
out VertexOutput {
#ifdef FLAG_ENV_MAP
+1 -1
View File
@@ -16,7 +16,7 @@ struct def_file
const size_t size;
};
#include "def_files/generated_def_files-generic.h"
#include "def_files/generated_def_files-generic.inc"
default_file defaults_get_file(const char *filename)
{
+2 -1
View File
@@ -4,6 +4,7 @@
*/
#include "globalincs/pstypes.h"
#include "def_files/def_files.h"
#include <iterator>
@@ -20,7 +21,7 @@ struct def_file
def_file Default_files[] =
{
#include "def_files/generated_def_files-win32.h"
#include "def_files/generated_def_files-win32.inc"
};
default_file defaults_get_file(const char *filename)
+2 -2
View File
@@ -29,7 +29,7 @@ IF(MSVC)
file(WRITE "${GENERATED_SOURCE_DIR}/code/default_files.rc" "${RES_CONTENT}")
configure_file("def_files/generated_def_files-win32.h.in" "${GENERATED_SOURCE_DIR}/code/def_files/generated_def_files-win32.h")
configure_file("def_files/generated_def_files-win32.inc.in" "${GENERATED_SOURCE_DIR}/code/def_files/generated_def_files-win32.inc")
target_sources(code INTERFACE "${GENERATED_SOURCE_DIR}/code/default_files.rc")
else()
@@ -76,7 +76,7 @@ else()
LIST(APPEND DEF_OUT_FILES ${ALL_OUTPUTS})
ENDFOREACH(file)
configure_file("def_files/generated_def_files-generic.h.in" "${GENERATED_SOURCE_DIR}/code/def_files/generated_def_files-generic.h")
configure_file("def_files/generated_def_files-generic.inc.in" "${GENERATED_SOURCE_DIR}/code/def_files/generated_def_files-generic.inc")
target_sources(code PRIVATE ${DEF_OUT_FILES})
SOURCE_GROUP("Generated Files\\Default Files" FILES ${DEF_OUT_FILES})
+3 -3
View File
@@ -19,10 +19,10 @@
#include "globalincs/toolchain.h"
#include "utils/strings.h"
#include <stdio.h> // For NULL, etc
#include <stdlib.h>
#include <cstdio> // For NULL, etc
#include <cstdlib>
#include <memory.h>
#include <string.h>
#include <cstring>
#include <algorithm>
#include <cstdint>
+8 -2
View File
@@ -61,8 +61,6 @@
#define SIZE_T_ARG "%zu"
#define PTRDIFF_T_ARG "%zd"
#define NOEXCEPT noexcept
#define likely(x) __builtin_expect((long) !!(x), 1L)
#define unlikely(x) __builtin_expect((long) !!(x), 0L)
@@ -75,3 +73,11 @@
#else
#define FALLTHROUGH
#endif
#ifndef CLANG_ANALYZER_NORETURN
#if __has_feature(attribute_analyzer_noreturn)
#define CLANG_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
#else
#define CLANG_ANALYZER_NORETURN
#endif
#endif
+5
View File
@@ -58,3 +58,8 @@
* Some compilers issue a warning if a fallthrough is detected. This define can be used to suppress that warning.
*/
#define FALLTHROUGH
/**
* @brief Specifies that an analyzer should consider this function as no-return
*/
#define CLANG_ANALYZER_NORETURN
+2 -2
View File
@@ -60,8 +60,6 @@
#define SIZE_T_ARG "%zu"
#define PTRDIFF_T_ARG "%zd"
#define NOEXCEPT noexcept
#define likely(x) __builtin_expect((long) !!(x), 1L)
#define unlikely(x) __builtin_expect((long) !!(x), 0L)
@@ -72,3 +70,5 @@
#else
#define FALLTHROUGH
#endif
#define CLANG_ANALYZER_NORETURN
+2 -2
View File
@@ -55,8 +55,6 @@
#define SIZE_T_ARG "%zu"
#define PTRDIFF_T_ARG "%zd"
#define NOEXCEPT noexcept
#define likely(x) __builtin_expect((long) !!(x), 1L)
#define unlikely(x) __builtin_expect((long) !!(x), 0L)
@@ -69,3 +67,5 @@
#else
#define FALLTHROUGH
#endif
#define CLANG_ANALYZER_NORETURN
+2 -7
View File
@@ -74,16 +74,11 @@
#define PTRDIFF_T_ARG "%Iu"
#define SIZE_T_ARG "%Id"
/* The 'noexcept' keyword is not defined in versions before VS 2015. */
#if _MSC_VER < 1900
# define NOEXCEPT
#else
# define NOEXCEPT noexcept
#endif
#define likely(x)
#define unlikely(x)
#define USED_VARIABLE
#define FALLTHROUGH
#define CLANG_ANALYZER_NORETURN
-3
View File
@@ -1125,9 +1125,6 @@ bool gr_init(std::unique_ptr<os::GraphicsOperations>&& graphicsOps, int d_mode,
gpu_heap_init();
mprintf(("Checking graphics capabilities:\n"));
mprintf((" Bindless texturing: %s\n", gr_is_capable(CAPABILITY_BINDLESS_TEXTURING) ? "Enabled" : "Disabled"));
bool missing_installation = false;
if (!running_unittests && Web_cursor == nullptr) {
if (Is_standalone) {
+1 -8
View File
@@ -286,7 +286,6 @@ typedef enum gr_capability {
CAPABILITY_POINT_PARTICLES,
CAPABILITY_TIMESTAMP_QUERY,
CAPABILITY_SEPARATE_BLEND_FUNCTIONS,
CAPABILITY_BINDLESS_TEXTURING, //!< This is the ability to encode textures in uniform buffers
} gr_capability;
enum class gr_property {
@@ -758,7 +757,7 @@ typedef struct screen {
void (*gf_sphere)(material *material_def, float rad);
int (*gf_maybe_create_shader)(shader_type type, unsigned int flags);
void (*gf_recompile_all_shaders)(std::function<void(size_t, size_t)>progress_callback);
void (*gf_recompile_all_shaders)(const std::function<void(size_t, size_t)>& progress_callback);
void (*gf_clear_states)();
@@ -804,8 +803,6 @@ typedef struct screen {
void (*gf_sync_delete)(gr_sync sync);
void (*gf_set_viewport)(int x, int y, int width, int height);
uint64_t (*gf_get_texture_handle)(int bitmap_handle, int bitmap_type);
} screen;
// handy macro
@@ -1111,10 +1108,6 @@ inline void gr_sync_delete(gr_sync sync) {
(*gr_screen.gf_sync_delete)(sync);
}
inline uint64_t gr_get_texture_handle(int bitmap, int bitmap_type) {
return (*gr_screen.gf_get_texture_handle)(bitmap, bitmap_type);
}
// color functions
void gr_get_color( int *r, int *g, int b );
void gr_init_color(color *c, int r, int g, int b);
-6
View File
@@ -385,10 +385,6 @@ void gr_stub_delete_query_object(int obj)
{
}
uint64_t gr_stub_get_texture_handle(int bitmap_handle, int bitmap_type) {
return 0;
}
bool gr_stub_init()
{
if (gr_screen.res != GR_640) {
@@ -536,7 +532,5 @@ bool gr_stub_init()
gr_screen.gf_bind_uniform_buffer = [](uniform_block_type, size_t, size_t, int) {};
gr_screen.gf_get_texture_handle = gr_stub_get_texture_handle;
return true;
}
+1 -1
View File
@@ -254,7 +254,7 @@ public:
void set_batching(bool enabled);
bool is_batched() const;
virtual uint get_shader_flags() const override;
uint get_shader_flags() const override;
void set_fog(int r, int g, int b, float near, float far);
void set_fog();
+2 -2
View File
@@ -157,11 +157,11 @@ opengl::ShaderProgram::~ShaderProgram() {
}
}
opengl::ShaderProgram::ShaderProgram(ShaderProgram&& other): _program_id(0), Uniforms(this) {
opengl::ShaderProgram::ShaderProgram(ShaderProgram&& other) SCP_NOEXCEPT : _program_id(0), Uniforms(this) {
*this = std::move(other);
}
opengl::ShaderProgram& opengl::ShaderProgram::operator=(ShaderProgram&& other) {
opengl::ShaderProgram& opengl::ShaderProgram::operator=(ShaderProgram&& other) SCP_NOEXCEPT {
std::swap(_program_id, other._program_id);
std::swap(Uniforms, other.Uniforms);
+2 -2
View File
@@ -91,8 +91,8 @@ class ShaderProgram {
ShaderProgram(const ShaderProgram&) SCP_DELETED_FUNCTION;
ShaderProgram& operator=(const ShaderProgram&) SCP_DELETED_FUNCTION;
ShaderProgram(ShaderProgram&& other);
ShaderProgram& operator=(ShaderProgram&& other);
ShaderProgram(ShaderProgram&& other) SCP_NOEXCEPT;
ShaderProgram& operator=(ShaderProgram&& other) SCP_NOEXCEPT;
void use();
-4
View File
@@ -1194,8 +1194,6 @@ void opengl_setup_function_pointers()
gr_screen.gf_set_viewport = gr_opengl_set_viewport;
gr_screen.gf_get_texture_handle = gr_opengl_get_texture_handle;
// NOTE: All function pointers here should have a Cmdline_nohtl check at the top
// if they shouldn't be run in non-HTL mode, Don't keep separate entries.
// *****************************************************************************
@@ -1583,8 +1581,6 @@ bool gr_opengl_is_capable(gr_capability capability)
return GLAD_GL_ARB_timer_query != 0; // Timestamp queries are available from 3.3 onwards
case CAPABILITY_SEPARATE_BLEND_FUNCTIONS:
return GLAD_GL_ARB_draw_buffers_blend != 0; // We need an OpenGL extension for this
case CAPABILITY_BINDLESS_TEXTURING:
return GLAD_GL_ARB_bindless_texture != 0 && !Cmdline_no_bindless_textures;
}
return false;
+4 -20
View File
@@ -240,24 +240,15 @@ static opengl_shader_variant_t GL_shader_variants[] = {
static const int GL_num_shader_variants = sizeof(GL_shader_variants) / sizeof(opengl_shader_variant_t);
struct opengl_shader_feature {
const char* shader_define;
std::function<bool()> feature_test;
};
static SCP_vector<opengl_shader_feature> GL_shader_features = {
{ "FEATURE_BINDLESS_TEXTURES", []() { return gr_opengl_is_capable(CAPABILITY_BINDLESS_TEXTURING); } },
};
opengl_shader_t *Current_shader = NULL;
opengl_shader_t::opengl_shader_t() : shader(SDR_TYPE_NONE), flags(0), flags2(0)
{
}
opengl_shader_t::opengl_shader_t(opengl_shader_t&& other) {
opengl_shader_t::opengl_shader_t(opengl_shader_t&& other) SCP_NOEXCEPT {
*this = std::move(other);
}
opengl_shader_t& opengl_shader_t::operator=(opengl_shader_t&& other) {
opengl_shader_t& opengl_shader_t::operator=(opengl_shader_t&& other) SCP_NOEXCEPT {
// VS2013 doesn't support implicit move constructors so we need to explicitly declare it
shader = other.shader;
flags = other.flags;
@@ -371,13 +362,6 @@ static SCP_string opengl_shader_get_header(shader_type type_id, int flags, shade
sflags << "#define " << variant.flag_text << "\n";
}
}
// Check the global shader features
for (auto& feature : GL_shader_features) {
if (feature.feature_test()) {
sflags << "#define " << feature.shader_define << "\n";
}
}
}
return sflags.str();
@@ -538,7 +522,7 @@ static bool do_shader_caching() {
return true;
}
static bool load_cached_shader_binary(opengl::ShaderProgram* program, SCP_string hash) {
static bool load_cached_shader_binary(opengl::ShaderProgram* program, const SCP_string& hash) {
if (!do_shader_caching()) {
return false;
}
@@ -840,7 +824,7 @@ int opengl_compile_shader(shader_type sdr, uint flags)
return sdr_index;
}
void gr_opengl_recompile_all_shaders(std::function<void(size_t, size_t)>progress_callback)
void gr_opengl_recompile_all_shaders(const std::function<void(size_t, size_t)>& progress_callback)
{
for (auto sdr = GL_shader.begin(); sdr != GL_shader.end(); ++sdr)
{
+3 -3
View File
@@ -132,8 +132,8 @@ typedef struct opengl_shader_t {
opengl_shader_t();
opengl_shader_t(opengl_shader_t&& other);
opengl_shader_t& operator=(opengl_shader_t&& other);
opengl_shader_t(opengl_shader_t&& other) SCP_NOEXCEPT;
opengl_shader_t& operator=(opengl_shader_t&& other) SCP_NOEXCEPT;
opengl_shader_t(const opengl_shader_t&) = delete;
opengl_shader_t& operator=(const opengl_shader_t&) = delete;
@@ -144,7 +144,7 @@ extern SCP_vector<opengl_shader_t> GL_shader;
extern opengl_shader_t *Current_shader;
int gr_opengl_maybe_create_shader(shader_type shader_t, unsigned int flags);
void gr_opengl_recompile_all_shaders(std::function<void(size_t, size_t)> progress_callback = nullptr);
void gr_opengl_recompile_all_shaders(const std::function<void(size_t, size_t)>& progress_callback = nullptr);
void opengl_delete_shader(int sdr_handle);
void opengl_shader_set_current(opengl_shader_t *shader_obj = NULL);
void opengl_shader_set_current(int handle);
-33
View File
@@ -1903,39 +1903,6 @@ void gr_opengl_bm_generate_mip_maps(int slot)
glGenerateMipmap(ts->texture_target);
}
uint64_t gr_opengl_get_texture_handle(int bitmap, int bitmap_type) {
Assertion(gr_opengl_is_capable(CAPABILITY_BINDLESS_TEXTURING),
"Bindless texturing is not supported! Support must be checked before calling gr_get_texture_handle().");
int n = bm_get_cache_slot (bitmap, 1);
tcache_slot_opengl *t = &Textures[n];
if (t->texture_handle != 0) {
// We already have a texture handle for this texture
return t->texture_handle;
}
if (!bm_is_render_target(bitmap) && t->bitmap_handle < 0)
{
GL_state.Texture.SetActiveUnit(0);
auto ret_val = opengl_create_texture( bitmap, bitmap_type, t );
if (!ret_val) {
return 0;
}
}
// everything went ok
if (t->texture_id) {
t->texture_handle = glGetTextureHandleARB(t->texture_id);
// Always make the handles resident. Could be replaced by more sophisticated handling later
glMakeTextureHandleResidentARB(t->texture_handle);
}
return t->texture_handle;
}
//
// End of GL_EXT_framebuffer_object stuff
-4
View File
@@ -18,7 +18,6 @@
typedef struct tcache_slot_opengl {
GLuint texture_id;
GLuint64 texture_handle; // Handle for bindless texturing
GLenum texture_target;
GLenum wrap_mode;
float u_scale, v_scale;
@@ -40,7 +39,6 @@ typedef struct tcache_slot_opengl {
void reset()
{
texture_id = 0;
texture_handle = 0;
texture_target = GL_TEXTURE_2D;
wrap_mode = GL_REPEAT;
u_scale = 1.0f;
@@ -95,6 +93,4 @@ GLuint opengl_get_rtt_framebuffer();
void gr_opengl_bm_generate_mip_maps(int slot);
void gr_opengl_get_texture_scale(int bitmap_handle, float *u_scale, float *v_scale);
uint64_t gr_opengl_get_texture_handle(int bitmap, int bitmap_type);
#endif //_GROPENGLTEXTURE_H
+57 -64
View File
@@ -773,80 +773,73 @@ void opengl_tnl_set_model_material(model_material *material_info)
}
uint32_t array_index;
if (!gr_opengl_is_capable(CAPABILITY_BINDLESS_TEXTURING)) {
// If we don't have bindless texturing support then we have to pass the texture the old-fashioned way
if ( Current_shader->flags & SDR_FLAG_MODEL_DIFFUSE_MAP ) {
Current_shader->program->Uniforms.setUniformi("sBasemap", render_pass);
if ( Current_shader->flags & SDR_FLAG_MODEL_DIFFUSE_MAP ) {
Current_shader->program->Uniforms.setUniformi("sBasemap", render_pass);
gr_opengl_tcache_set(material_info->get_texture_map(TM_BASE_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
gr_opengl_tcache_set(material_info->get_texture_map(TM_BASE_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
++render_pass;
}
++render_pass;
if ( Current_shader->flags & SDR_FLAG_MODEL_GLOW_MAP ) {
Current_shader->program->Uniforms.setUniformi("sGlowmap", render_pass);
gr_opengl_tcache_set(material_info->get_texture_map(TM_GLOW_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
++render_pass;
}
if ( Current_shader->flags & SDR_FLAG_MODEL_SPEC_MAP ) {
Current_shader->program->Uniforms.setUniformi("sSpecmap", render_pass);
if ( material_info->get_texture_map(TM_SPEC_GLOSS_TYPE) > 0 ) {
gr_opengl_tcache_set(material_info->get_texture_map(TM_SPEC_GLOSS_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
} else {
gr_opengl_tcache_set(material_info->get_texture_map(TM_SPECULAR_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
}
++render_pass;
if ( Current_shader->flags & SDR_FLAG_MODEL_GLOW_MAP ) {
Current_shader->program->Uniforms.setUniformi("sGlowmap", render_pass);
if ( Current_shader->flags & SDR_FLAG_MODEL_ENV_MAP ) {
Current_shader->program->Uniforms.setUniformi("sEnvmap", render_pass);
gr_opengl_tcache_set(material_info->get_texture_map(TM_GLOW_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
++render_pass;
}
if ( Current_shader->flags & SDR_FLAG_MODEL_SPEC_MAP ) {
Current_shader->program->Uniforms.setUniformi("sSpecmap", render_pass);
if ( material_info->get_texture_map(TM_SPEC_GLOSS_TYPE) > 0 ) {
gr_opengl_tcache_set(material_info->get_texture_map(TM_SPEC_GLOSS_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
} else {
gr_opengl_tcache_set(material_info->get_texture_map(TM_SPECULAR_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
}
++render_pass;
if ( Current_shader->flags & SDR_FLAG_MODEL_ENV_MAP ) {
Current_shader->program->Uniforms.setUniformi("sEnvmap", render_pass);
gr_opengl_tcache_set(ENVMAP, TCACHE_TYPE_CUBEMAP, &u_scale, &v_scale, &array_index, render_pass);
Assertion(array_index == 0, "Cube map arrays are not supported yet!");
++render_pass;
}
}
if ( Current_shader->flags & SDR_FLAG_MODEL_NORMAL_MAP ) {
Current_shader->program->Uniforms.setUniformi("sNormalmap", render_pass);
gr_opengl_tcache_set(material_info->get_texture_map(TM_NORMAL_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
++render_pass;
}
if ( Current_shader->flags & SDR_FLAG_MODEL_HEIGHT_MAP ) {
Current_shader->program->Uniforms.setUniformi("sHeightmap", render_pass);
gr_opengl_tcache_set(material_info->get_texture_map(TM_HEIGHT_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
++render_pass;
}
if ( Current_shader->flags & SDR_FLAG_MODEL_AMBIENT_MAP ) {
Current_shader->program->Uniforms.setUniformi("sAmbientmap", render_pass);
gr_opengl_tcache_set(material_info->get_texture_map(TM_AMBIENT_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
++render_pass;
}
if ( Current_shader->flags & SDR_FLAG_MODEL_MISC_MAP ) {
Current_shader->program->Uniforms.setUniformi("sMiscmap", render_pass);
gr_opengl_tcache_set(material_info->get_texture_map(TM_MISC_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
gr_opengl_tcache_set(ENVMAP, TCACHE_TYPE_CUBEMAP, &u_scale, &v_scale, &array_index, render_pass);
Assertion(array_index == 0, "Cube map arrays are not supported yet!");
++render_pass;
}
}
// The rest of the textures are mostly static so bindless texturing doesn't matter too much here (and it would be
// hard to expose the handles to the outside without some serious refactoring)
if ( Current_shader->flags & SDR_FLAG_MODEL_NORMAL_MAP ) {
Current_shader->program->Uniforms.setUniformi("sNormalmap", render_pass);
gr_opengl_tcache_set(material_info->get_texture_map(TM_NORMAL_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
++render_pass;
}
if ( Current_shader->flags & SDR_FLAG_MODEL_HEIGHT_MAP ) {
Current_shader->program->Uniforms.setUniformi("sHeightmap", render_pass);
gr_opengl_tcache_set(material_info->get_texture_map(TM_HEIGHT_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
++render_pass;
}
if ( Current_shader->flags & SDR_FLAG_MODEL_AMBIENT_MAP ) {
Current_shader->program->Uniforms.setUniformi("sAmbientmap", render_pass);
gr_opengl_tcache_set(material_info->get_texture_map(TM_AMBIENT_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
++render_pass;
}
if ( Current_shader->flags & SDR_FLAG_MODEL_MISC_MAP ) {
Current_shader->program->Uniforms.setUniformi("sMiscmap", render_pass);
gr_opengl_tcache_set(material_info->get_texture_map(TM_MISC_TYPE), TCACHE_TYPE_NORMAL, &u_scale, &v_scale, &array_index, render_pass);
++render_pass;
}
if ( Current_shader->flags & SDR_FLAG_MODEL_SHADOWS ) {
Current_shader->program->Uniforms.setUniformi("shadow_map", render_pass);
+2 -2
View File
@@ -35,10 +35,10 @@ class NanoVGRenderer {
Image(const Image&) = delete;
Image& operator=(const Image&) = delete;
Image(Image&& other) {
Image(Image&& other) SCP_NOEXCEPT {
*this = std::move(other);
}
Image& operator=(Image&& other) {
Image& operator=(Image&& other) SCP_NOEXCEPT {
std::swap(bitmap, other.bitmap);
std::swap(data, other.data);
std::swap(type, other.type);
+3 -3
View File
@@ -21,12 +21,12 @@ namespace font {
TrueTypeFontData() : size(0) { }
TrueTypeFontData(TrueTypeFontData &&other) {
TrueTypeFontData(TrueTypeFontData &&other) SCP_NOEXCEPT {
std::swap(data, other.data);
size = other.size;
}
TrueTypeFontData &operator=(TrueTypeFontData &&other) {
TrueTypeFontData &operator=(TrueTypeFontData &&other) SCP_NOEXCEPT {
std::swap(data, other.data);
size = other.size;
@@ -203,4 +203,4 @@ namespace font {
static FSFont *currentFont;
};
}
}
+5 -5
View File
@@ -20,7 +20,7 @@ namespace font
public:
NVGFont();
virtual ~NVGFont();
~NVGFont() override;
int getHandle() const { return m_handle; }
float getSize() const { return m_size; }
@@ -34,12 +34,12 @@ namespace font
void setTabWidth(float tabWidth);
void setSpecialCharacterFont(font* fontData);
virtual FontType getType() const SCP_OVERRIDE { return NVG_FONT; };
FontType getType() const override { return NVG_FONT; };
virtual float getTextHeight() const SCP_OVERRIDE;
float getTextHeight() const override;
virtual void getStringSize(const char *text, size_t textLen, int resize_mode,
float *width, float *height) const SCP_OVERRIDE;
void getStringSize(const char *text, size_t textLen, int resize_mode,
float *width, float *height) const override;
void computeFontMetrics() override;
+6 -6
View File
@@ -25,12 +25,12 @@ namespace font
*
* @param [in] fnt A pointer to the font data. Has to be non-null
*/
VFNTFont(font *fnt);
explicit VFNTFont(font *fnt);
/**
* @brief Destroys the allocated font pointer
*/
~VFNTFont();
~VFNTFont() override;
/**
* @brief Gets the font data struct.
@@ -44,7 +44,7 @@ namespace font
*
* @return The type.
*/
virtual FontType getType() const SCP_OVERRIDE;
FontType getType() const override;
/**
* @brief Gets the height of this font
@@ -53,7 +53,7 @@ namespace font
*
* @return The height.
*/
virtual float getTextHeight() const SCP_OVERRIDE;
float getTextHeight() const override;
/**
* @brief Gets the size of the specified string in pixels.
@@ -64,7 +64,7 @@ namespace font
* @param [out] width If non-null, the width.
* @param [out] height If non-null, the height.
*/
virtual void getStringSize(const char *text, size_t textLen,
int resize_mode, float *width, float *height) const SCP_OVERRIDE;
void
getStringSize(const char* text, size_t textLen, int resize_mode, float* width, float* height) const override;
};
}
+6 -51
View File
@@ -72,7 +72,7 @@ void convert_model_material(model_uniform_data* data_out,
}
if (shader_flags & SDR_FLAG_MODEL_LIGHT) {
int num_lights = MIN(Num_active_gr_lights, (int) graphics::MAX_UNIFORM_LIGHTS);
int num_lights = MIN(Num_active_gr_lights, (int)graphics::MAX_UNIFORM_LIGHTS);
data_out->n_lights = num_lights;
std::copy(std::begin(gr_light_uniforms), std::end(gr_light_uniforms), std::begin(data_out->lights));
@@ -187,15 +187,15 @@ void convert_model_material(model_uniform_data* data_out,
}
}
if (shader_flags & SDR_FLAG_MODEL_NORMAL_MAP) {
if ( shader_flags & SDR_FLAG_MODEL_NORMAL_MAP ) {
data_out->sNormalmapIndex = bm_get_array_index(material.get_texture_map(TM_NORMAL_TYPE));
}
if (shader_flags & SDR_FLAG_MODEL_AMBIENT_MAP) {
if ( shader_flags & SDR_FLAG_MODEL_AMBIENT_MAP ) {
data_out->sAmbientmapIndex = bm_get_array_index(material.get_texture_map(TM_AMBIENT_TYPE));
}
if (shader_flags & SDR_FLAG_MODEL_MISC_MAP) {
if ( shader_flags & SDR_FLAG_MODEL_MISC_MAP ) {
data_out->sMiscmapIndex = bm_get_array_index(material.get_texture_map(TM_MISC_TYPE));
}
@@ -240,6 +240,8 @@ void convert_model_material(model_uniform_data* data_out,
data_out->stripe_color = stripe_color;
data_out->base_color = base_color;
data_out->team_glow_enabled = bm_has_alpha_channel(material.get_texture_map(TM_MISC_TYPE)) ? 1 : 0;
}
if (shader_flags & SDR_FLAG_MODEL_THRUSTER) {
@@ -270,52 +272,5 @@ void convert_model_material(model_uniform_data* data_out,
}
}
void convert_bindless_model_material(model_uniform_data_bindless* data_out,
const model_material& material,
const matrix4& model_transform,
const vec3d& scale,
size_t transform_buffer_offset) {
// Convert the normal data with the existing function
convert_model_material(&data_out->model_data, material, model_transform, scale, transform_buffer_offset);
auto shader_flags = material.get_shader_flags();
if ( shader_flags & SDR_FLAG_MODEL_DIFFUSE_MAP ) {
data_out->sBasemap = gr_get_texture_handle(material.get_texture_map(TM_BASE_TYPE), TCACHE_TYPE_NORMAL);
}
if ( shader_flags & SDR_FLAG_MODEL_GLOW_MAP ) {
data_out->sGlowmap = gr_get_texture_handle(material.get_texture_map(TM_GLOW_TYPE), TCACHE_TYPE_NORMAL);
}
if ( shader_flags & SDR_FLAG_MODEL_SPEC_MAP ) {
if ( material.get_texture_map(TM_SPEC_GLOSS_TYPE) > 0 ) {
data_out->sSpecmap = gr_get_texture_handle(material.get_texture_map(TM_SPEC_GLOSS_TYPE), TCACHE_TYPE_NORMAL);
} else {
data_out->sSpecmap = gr_get_texture_handle(material.get_texture_map(TM_SPECULAR_TYPE), TCACHE_TYPE_NORMAL);
}
if ( shader_flags & SDR_FLAG_MODEL_ENV_MAP ) {
data_out->sEnvmap = gr_get_texture_handle(ENVMAP, TCACHE_TYPE_CUBEMAP);
}
}
if ( shader_flags & SDR_FLAG_MODEL_NORMAL_MAP ) {
data_out->sNormalmap = gr_get_texture_handle(material.get_texture_map(TM_NORMAL_TYPE), TCACHE_TYPE_NORMAL);
}
if ( shader_flags & SDR_FLAG_MODEL_HEIGHT_MAP ) {
data_out->sHeightmap = gr_get_texture_handle(material.get_texture_map(TM_HEIGHT_TYPE), TCACHE_TYPE_NORMAL);
}
if ( shader_flags & SDR_FLAG_MODEL_AMBIENT_MAP ) {
data_out->sAmbientmap = gr_get_texture_handle(material.get_texture_map(TM_AMBIENT_TYPE), TCACHE_TYPE_NORMAL);
}
if ( shader_flags & SDR_FLAG_MODEL_MISC_MAP ) {
data_out->sMiscmap = gr_get_texture_handle(material.get_texture_map(TM_MISC_TYPE), TCACHE_TYPE_NORMAL);
}
}
}
}
-6
View File
@@ -18,11 +18,5 @@ void convert_model_material(model_uniform_data* data_out,
const vec3d& scale,
size_t transform_buffer_offset);
void convert_bindless_model_material(model_uniform_data_bindless* data_out,
const model_material& material,
const matrix4& model_transform,
const vec3d& scale,
size_t transform_buffer_offset);
}
}
+2 -2
View File
@@ -57,10 +57,10 @@ bool UniformBuffer::isInUse() {
// Fence still exists and has not been signaled yet. The buffer is still in use
return true;
}
UniformBuffer::UniformBuffer(UniformBuffer&& other) : _aligner(0, 0) {
UniformBuffer::UniformBuffer(UniformBuffer&& other) SCP_NOEXCEPT : _aligner(0, 0) {
*this = std::move(other);
}
UniformBuffer& UniformBuffer::operator=(UniformBuffer&& other) {
UniformBuffer& UniformBuffer::operator=(UniformBuffer&& other) SCP_NOEXCEPT {
std::swap(_buffer_obj, other._buffer_obj);
std::swap(_aligner, other._aligner);
std::swap(_sync_obj, other._sync_obj);
+2 -2
View File
@@ -27,8 +27,8 @@ class UniformBuffer {
UniformBuffer(const UniformBuffer&) = delete;
UniformBuffer& operator=(const UniformBuffer&) = delete;
UniformBuffer(UniformBuffer&& other);
UniformBuffer& operator=(UniformBuffer&& other);
UniformBuffer(UniformBuffer&& other) SCP_NOEXCEPT;
UniformBuffer& operator=(UniformBuffer&& other) SCP_NOEXCEPT;
inline UniformAligner& aligner() {
return _aligner;
+1 -5
View File
@@ -10,11 +10,7 @@ size_t getElementSize(uniform_block_type type) {
case uniform_block_type::Lights:
return sizeof(graphics::deferred_light_data);
case uniform_block_type::ModelData:
if (gr_is_capable(CAPABILITY_BINDLESS_TEXTURING)) {
return sizeof(graphics::model_uniform_data_bindless);
} else {
return sizeof(graphics::model_uniform_data);
}
return sizeof(graphics::model_uniform_data);
case uniform_block_type::NanoVGData:
return sizeof(graphics::nanovg_draw_data);
case uniform_block_type::DecalInfo:
-16
View File
@@ -143,22 +143,6 @@ struct model_uniform_data {
int sMiscmapIndex;
};
struct model_uniform_data_bindless {
model_uniform_data model_data;
uint64_t sBasemap;
uint64_t sGlowmap;
uint64_t sSpecmap;
uint64_t sEnvmap;
uint64_t sNormalmap;
uint64_t sAmbientmap;
uint64_t sMiscmap;
uint64_t sHeightmap;
};
enum class NanoVGShaderType: int32_t {
FillGradient = 0, FillImage = 1, Simple = 2, Image = 3
};
+22 -22
View File
@@ -337,8 +337,8 @@ public:
void initBitmaps(const char *fname);
void initTextOffsets(int x, int y);
void initValueOffsets(int x, int y);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
};
class HudGaugeTextWarnings: public HudGauge // HUD_TEXT_FLASH
@@ -347,8 +347,8 @@ class HudGaugeTextWarnings: public HudGauge // HUD_TEXT_FLASH
bool flash_flags;
public:
HudGaugeTextWarnings();
void render(float frametime);
void initialize();
void render(float frametime) override;
void initialize() override;
int maybeTextFlash();
};
@@ -363,8 +363,8 @@ public:
void initBitmaps(const char *fname);
void initTextOffsets(int x, int y);
void initTextValueOffsets(int x, int y);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
};
class HudGaugeLag: public HudGauge
@@ -376,8 +376,8 @@ class HudGaugeLag: public HudGauge
public:
HudGaugeLag();
void initBitmaps(const char *fname);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
void startFlashLag(int duration = 1400);
bool maybeFlashLag(bool flash_fast = false);
@@ -407,14 +407,14 @@ public:
void initRedAlertTextOffsetY(int y);
void initRedAlertValueOffsetY(int y);
virtual void render(float frametime);
void render(float frametime) override;
void startFlashNotify(int duration = 1400);
bool maybeFlashNotify(bool flash_fast = false);
void renderObjective();
void renderRedAlert();
void renderSubspace();
void pageIn();
void initialize();
void pageIn() override;
void initialize() override;
};
class HudGaugeDamage: public HudGauge
@@ -467,9 +467,9 @@ public:
void initSubsysIntegValueOffsetX(int x);
void initBottomBgOffset(int offset);
void initLineHeight(int h);
void render(float frametime);
void pageIn();
void initialize();
void render(float frametime) override;
void pageIn() override;
void initialize() override;
};
class HudGaugeSupport: public HudGauge
@@ -488,8 +488,8 @@ public:
void initTextValueOffsetY(int y);
void initTextDockOffsetX(int x);
void initTextDockValueOffsetX(int x);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
};
class HudGaugeMultiMsg: public HudGauge
@@ -497,8 +497,8 @@ class HudGaugeMultiMsg: public HudGauge
protected:
public:
HudGaugeMultiMsg();
bool canRender();
void render(float frametime);
bool canRender() override;
void render(float frametime) override;
};
class HudGaugeVoiceStatus: public HudGauge
@@ -506,7 +506,7 @@ class HudGaugeVoiceStatus: public HudGauge
protected:
public:
HudGaugeVoiceStatus();
void render(float frametime);
void render(float frametime) override;
};
class HudGaugePing: public HudGauge
@@ -514,14 +514,14 @@ class HudGaugePing: public HudGauge
protected:
public:
HudGaugePing();
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeSupernova: public HudGauge
{
public:
HudGaugeSupernova();
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeFlightPath: public HudGauge
@@ -533,7 +533,7 @@ public:
HudGaugeFlightPath();
void initBitmap(const char *fname);
void initHalfSize(int w, int h);
void render(float frametime);
void render(float frametime) override;
};
HudGauge* hud_get_gauge(const char* name);
+1 -1
View File
@@ -45,7 +45,7 @@ public:
void initMinTargetBoxSizes(int w, int h);
void initMinSubTargetBoxSizes(int w, int h);
void initBitmaps(char *fname);
void render(float frametime) SCP_OVERRIDE;
void render(float frametime) override;
void renderObjectBrackets(object *targetp, color *clr, int w_correction, int h_correction, int flags);
void renderNavBrackets(vec3d* nav_pos, vertex* nav_point, color* clr, char* string);
void renderBoundingBrackets(int x1, int y1, int x2, int y2, int w_correction, int h_correction, float distance, int target_objnum, int flags);
+2 -2
View File
@@ -68,8 +68,8 @@ public:
void initShipNameMaxWidth(int w);
void initRightAlignNames(bool align);
int setGaugeColorEscort(int index, int team);
virtual void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
void renderIcon(int x, int y, int index);
void renderIconDogfight(int x, int y, int index);
};
+7 -7
View File
@@ -81,30 +81,30 @@ public:
void initLetter(char _letter); // obligatory PC Load Letter joke. (Swifty)
void initBarHeight(int _ets_bar_h);
void initBitmaps(char *fname);
virtual void blitGauge(int index);
virtual void render(float frametime);
void pageIn();
void blitGauge(int index);
void render(float frametime) override;
void pageIn() override;
};
class HudGaugeEtsWeapons: public HudGaugeEts
{
public:
HudGaugeEtsWeapons();
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeEtsShields: public HudGaugeEts
{
public:
HudGaugeEtsShields();
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeEtsEngines: public HudGaugeEts
{
public:
HudGaugeEtsEngines();
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeEtsRetail: public HudGaugeEts
@@ -114,7 +114,7 @@ protected:
int Gauge_positions[num_retail_ets_gauges];
public:
HudGaugeEtsRetail();
void render(float frametime);
void render(float frametime) override;
void initLetters(char *_letters);
void initGaugePositions(int *_gauge_positions);
};
+3 -3
View File
@@ -55,11 +55,11 @@ public:
void initTargetBoxSize(int w, int h);
void initLoopLockedAnim(bool loop);
void render(float frametime);
void render(float frametime) override;
void renderLockTriangles(int center_x, int center_y, float frametime);
void renderLockTrianglesOld(int center_x, int center_y, int radius);
void pageIn();
void initialize();
void pageIn() override;
void initialize() override;
};
#endif
+10 -10
View File
@@ -113,10 +113,10 @@ public:
void processMessageBuffer();
void addPending(const char *text, int source, int x = 0);
void scrollMessages();
void preprocess();
void render(float frametime);
void initialize();
void pageIn();
void preprocess() override;
void render(float frametime) override;
void initialize() override;
void pageIn() override;
};
class HudGaugeTalkingHead: public HudGauge // HUD_TALKING_HEAD
@@ -136,10 +136,10 @@ public:
void initHeaderOffsets(int x, int y);
void initAnimOffsets(int x, int y);
void initAnimSizes(int w, int h);
void pageIn();
void render(float frametime);
void initialize();
bool canRender();
void pageIn() override;
void render(float frametime) override;
void initialize() override;
bool canRender() override;
anim_instance* createAnim(int anim_start_frame, anim* anim_data);
};
@@ -149,8 +149,8 @@ class HudGaugeFixedMessages: public HudGauge
public:
HudGaugeFixedMessages();
void initCenterText(bool center);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
};
#endif
+9 -9
View File
@@ -44,9 +44,9 @@ protected:
int firepoint_scale_y;
public:
HudGaugeReticle();
void render(float frametime);
void render(float frametime) override;
void initBitmaps(char *fname);
void pageIn();
void pageIn() override;
void initFirepointDisplay(bool firepoint, int scaleX, int scaleY, int size);
void getFirepointStatus();
};
@@ -101,14 +101,14 @@ public:
void showBackground(bool show);
void initBitmaps(char *fname);
void render(float frametime);
void render(float frametime) override;
void renderThrottleSpeed(float current_speed, int y_end);
void renderThrottleLine(int y);
void renderThrottleForeground(int y_end);
void renderThrottleBackground(int y_end);
void renderMatchSpeedIcon(int x, int y);
void pageIn();
void pageIn() override;
};
class HudGaugeThreatIndicator: public HudGauge
@@ -132,9 +132,9 @@ public:
void initBitmaps(char *fname_arc, char *fname_laser, char *fname_lock);
void initLaserWarnOffsets(int x, int y);
void initLockWarnOffsets(int x, int y);
void render(float frametime);
void initialize();
void pageIn();
void render(float frametime) override;
void initialize() override;
void pageIn() override;
void renderLaserThreat();
void renderLockThreat();
};
@@ -159,8 +159,8 @@ public:
char *fname_secondary_link_1,
char *fname_secondary_link_2,
char *fname_secondary_link_3);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
};
void hud_init_reticle();
+5 -5
View File
@@ -57,7 +57,7 @@ protected:
public:
HudGaugeShield();
HudGaugeShield(int _gauge_object, int _gauge_config);
virtual void render(float frametime);
void render(float frametime) override;
void showShields(object *objp, int mode);
int maybeFlashShield(int target_index, int shield_offset);
void renderShieldIcon(coord2d coords[6]);
@@ -68,7 +68,7 @@ class HudGaugeShieldPlayer: public HudGaugeShield
protected:
public:
HudGaugeShieldPlayer();
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeShieldTarget: public HudGaugeShield
@@ -76,7 +76,7 @@ class HudGaugeShieldTarget: public HudGaugeShield
protected:
public:
HudGaugeShieldTarget();
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeShieldMini: public HudGauge
@@ -96,7 +96,7 @@ public:
int maybeFlashShield(int target_index, int shield_offset);
void showMiniShields(object *objp);
void showIntegrity(float p_target_integrity);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
};
#endif /* __FREESPACE_HUDSHIELDBOX_H__ */
+4 -4
View File
@@ -196,10 +196,10 @@ public:
void initPgUpOffsets(int x, int y);
void initPgDnOffsets(int x, int y);
void render(float frametime);
bool canRender();
void pageIn();
void initialize();
void render(float frametime) override;
bool canRender() override;
void pageIn() override;
void initialize() override;
void startFlashPageScroll(int duration = 1400);
bool maybeFlashPageScroll(bool flash_fast = false);
};
+31 -31
View File
@@ -198,8 +198,8 @@ public:
void initBitmaps(char *fname);
void initOnColor(int r, int g, int b, int a);
void initOffColor(int r, int g, int b, int a);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
};
class HudGaugeAutoSpeed: public HudGauge
@@ -221,8 +221,8 @@ public:
void initBitmaps(char *fname);
void initOnColor(int r, int g, int b, int a);
void initOffColor(int r, int g, int b, int a);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
};
class HudGaugeCmeasures: public HudGauge
@@ -237,8 +237,8 @@ public:
void initBitmaps(char *fname);
void initCountTextOffsets(int x, int y);
void initCountValueOffsets(int x, int y);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
};
class HudGaugeAfterburner: public HudGauge
@@ -251,8 +251,8 @@ public:
HudGaugeAfterburner();
void initEnergyHeight(int h);
void initBitmaps(char *fname);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
};
class HudGaugeWeaponEnergy: public HudGauge
@@ -282,8 +282,8 @@ public:
void initShowBallistics(bool show_ballistics);
void initAlignments(int text_align, int armed_align);
void initArmedOffsets(int x, int y, int h, bool show);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
};
class HudGaugeWeapons: public HudGauge
@@ -342,8 +342,8 @@ public:
void initSecondaryHeights(int top_h, int text_h);
void initLinkIcon();
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
void maybeFlashWeapon(int index);
};
@@ -383,8 +383,8 @@ public:
void initEntryHeight(int h);
void initLinkIcon();
virtual void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
void maybeFlashWeapon(int index);
};
@@ -400,7 +400,7 @@ public:
void initPrimaryNameOffsetX(int x);
void initPrimaryAmmoOffsetX(int x);
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeSecondaryWeapons: public HudGaugeWeaponList
@@ -419,7 +419,7 @@ public:
void initSecondaryLinkedOffsetX(int x);
void initSecondaryUnlinkedOffsetX(int x);
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeHardpoints: public HudGauge
@@ -439,7 +439,7 @@ public:
void initDrawOptions(bool primary_models, bool secondary_models);
HudGaugeHardpoints();
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeWarheadCount: public HudGauge
@@ -462,8 +462,8 @@ public:
void initMaxSymbols(int count);
void initMaxColumns(int count);
void initTextAlign(int align);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
};
class HudGaugeOrientationTee: public HudGauge
@@ -473,9 +473,9 @@ protected:
public:
HudGaugeOrientationTee();
void initRadius(int length);
void render(float frametime);
void render(float frametime) override;
void renderOrientation(object *from_objp, object *to_objp, matrix *from_orientp);
void pageIn();
void pageIn() override;
};
class HudGaugeReticleTriangle: public HudGauge
@@ -490,7 +490,7 @@ public:
void initRadius(int length);
void initTriBase(float length);
void initTriHeight(float h);
virtual void render(float frametime);
void render(float frametime) override;
void renderTriangle(vec3d *hostile_pos, int aspect_flag, int show_interior, int split_tri);
void renderTriangleMissileTail(float ang, float xpos, float ypos, float cur_dist, int draw_solid, int draw_inside);
};
@@ -500,7 +500,7 @@ class HudGaugeHostileTriangle: public HudGaugeReticleTriangle
protected:
public:
HudGaugeHostileTriangle();
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeTargetTriangle: public HudGaugeReticleTriangle
@@ -508,7 +508,7 @@ class HudGaugeTargetTriangle: public HudGaugeReticleTriangle
protected:
public:
HudGaugeTargetTriangle();
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeMissileTriangles: public HudGaugeReticleTriangle
@@ -516,7 +516,7 @@ class HudGaugeMissileTriangles: public HudGaugeReticleTriangle
protected:
public:
HudGaugeMissileTriangles();
void render(float frametime);
void render(float frametime) override;
};
class HudGaugeOffscreen: public HudGauge
@@ -532,10 +532,10 @@ public:
void initMaxFrontSeperation(float length);
void initTriBase(float length);
void initTriHeight(float length);
void render(float frametime);
void render(float frametime) override;
void calculatePosition(vertex* target_point, vec3d *tpos, vec2d *outcoords, int *dir, float *half_triangle_sep);
void renderOffscreenIndicator(vec2d *coords, int dir, float distance, float half_triangle_sep, bool draw_solid = true);
void pageIn();
void pageIn() override;
};
class HudGaugeLeadIndicator: public HudGauge
@@ -547,12 +547,12 @@ public:
HudGaugeLeadIndicator();
void initHalfSize(float w, float h);
void initBitmaps(char *fname);
void render(float frametime);
void render(float frametime) override;
void renderIndicator(int frame_offset, object *targetp, vec3d *lead_target_pos);
void renderLeadCurrentTarget();
void renderLeadQuick(vec3d *target_pos, object *targetp);
int pickFrame(float prange, float srange, float dist_to_target);
void pageIn();
void pageIn() override;
};
class HudGaugeLeadSight: public HudGauge
@@ -563,9 +563,9 @@ protected:
public:
HudGaugeLeadSight();
void initBitmaps(char *fname);
void render(float frametime);
void render(float frametime) override;
void renderSight(int indicator_frame, vec3d *target_pos, vec3d *lead_target_pos);
void pageIn();
void pageIn() override;
};
#endif
+6 -6
View File
@@ -107,9 +107,9 @@ public:
void initDisabledStatusOffsets(int x, int y, bool activate);
void initDesaturate(bool desaturate);
void initialize();
void pageIn();
void render(float frametime);
void initialize() override;
void pageIn() override;
void render(float frametime) override;
void renderTargetShip(object *target_objp);
void renderTargetWeapon(object *target_objp);
void renderTargetDebris(object *target_objp);
@@ -149,13 +149,13 @@ public:
void initOrderOffsets(int x, int y);
void initOrderMaxWidth(int width);
void updateFrame();
void render(float frametime);
void initialize();
void render(float frametime) override;
void initialize() override;
void initDockFlashTimer();
void startFlashDock(int duration=TBOX_FLASH_DURATION);
int maybeFlashDock(int flash_fast=0);
void endFlashDock();
void pageIn();
void pageIn() override;
};
void hud_targetbox_init();
+3 -3
View File
@@ -74,9 +74,9 @@ public:
void initWingmate5Offsets(int x, int y);
void initWingmate6Offsets(int x, int y);
void initGrowMode(int mode);
void pageIn();
void initialize();
void render(float frametime);
void pageIn() override;
void initialize() override;
void render(float frametime) override;
void renderBackground(int num_wings_to_draw);
void renderDots(int wing_index, int screen_index, int num_wings_to_draw);
void initFlash();
+2 -2
View File
@@ -66,12 +66,12 @@ namespace io
namespace mouse
{
Cursor::Cursor(Cursor&& other)
Cursor::Cursor(Cursor&& other) SCP_NOEXCEPT
{
*this = std::move(other);
}
Cursor& Cursor::operator=(Cursor&& other)
Cursor& Cursor::operator=(Cursor&& other) SCP_NOEXCEPT
{
std::swap(this->mAnimationFrames, other.mAnimationFrames);
+2 -2
View File
@@ -43,14 +43,14 @@ namespace io
*
* Transfers SDL resources to this newly constructed object
*/
Cursor(Cursor&& other);
Cursor(Cursor&& other) SCP_NOEXCEPT;
/**
* @brief Move operator
*
* Transfers SDL resources to this object
*/
Cursor& operator=(Cursor&& other);
Cursor& operator=(Cursor&& other) SCP_NOEXCEPT;
/**
* @brief Cursor destructor
+2 -2
View File
@@ -326,7 +326,7 @@ namespace joystick
fillValues();
}
Joystick::Joystick(Joystick &&other) :
Joystick::Joystick(Joystick &&other) SCP_NOEXCEPT :
_joystick(nullptr)
{
*this = std::move(other);
@@ -341,7 +341,7 @@ namespace joystick
}
}
Joystick &Joystick::operator=(Joystick &&other)
Joystick &Joystick::operator=(Joystick &&other) SCP_NOEXCEPT
{
std::swap(_device_id, other._device_id);
std::swap(_joystick, other._joystick);
+2 -2
View File
@@ -67,7 +67,7 @@ namespace io
*
* @param other A rvalue reference
*/
Joystick(Joystick &&other);
Joystick(Joystick &&other) SCP_NOEXCEPT;
/**
* @brief Frees the owned SDL handle
@@ -79,7 +79,7 @@ namespace io
*
* @param other A rvalue reference to the other object
*/
Joystick &operator=(Joystick &&other);
Joystick &operator=(Joystick &&other) SCP_NOEXCEPT;
/**
* @brief Determines if this joystick is still connected to the computer
+2 -2
View File
@@ -58,7 +58,7 @@ CJumpNode::CJumpNode(vec3d *position) : m_radius(0.0f), m_modelnum(-1), m_objnum
m_objnum = obj_create(OBJ_JUMP_NODE, -1, -1, NULL, &m_pos, m_radius, default_flags);
}
CJumpNode::CJumpNode(CJumpNode&& other)
CJumpNode::CJumpNode(CJumpNode&& other) SCP_NOEXCEPT
: m_radius(other.m_radius), m_modelnum(other.m_modelnum), m_objnum(other.m_objnum), m_flags(other.m_flags)
{
other.m_radius = 0.0f;
@@ -72,7 +72,7 @@ CJumpNode::CJumpNode(CJumpNode&& other)
strcpy_s(m_name, other.m_name);
}
CJumpNode& CJumpNode::operator=(CJumpNode&& other)
CJumpNode& CJumpNode::operator=(CJumpNode&& other) SCP_NOEXCEPT
{
if (this != &other)
{
+2 -2
View File
@@ -47,9 +47,9 @@ public:
//Constructors
CJumpNode();
CJumpNode(vec3d *position);
CJumpNode(CJumpNode&& other);
CJumpNode(CJumpNode&& other) SCP_NOEXCEPT;
CJumpNode& operator=(CJumpNode&&);
CJumpNode& operator=(CJumpNode&&) SCP_NOEXCEPT;
//Destructor
~CJumpNode();
+5 -5
View File
@@ -1611,16 +1611,16 @@ SCP_string get_directory_or_vp(char* path)
found = result.find(".vp");
}
auto directory_name_pos = result.rfind(DIR_SEPARATOR_STR, found - strlen(DIR_SEPARATOR_STR) - 1);
auto directory_name_pos = result.rfind(DIR_SEPARATOR_CHAR, found - strlen(DIR_SEPARATOR_STR) - 1);
result = result.substr(directory_name_pos, found - directory_name_pos);
found = result.find(DIR_SEPARATOR_STR);
found = result.find(DIR_SEPARATOR_CHAR);
//Strip directory separators
while (found != std::string::npos)
{
result.erase(found, strlen(DIR_SEPARATOR_STR));
found = result.find(DIR_SEPARATOR_STR);
found = result.find(DIR_SEPARATOR_CHAR);
}
return result;
@@ -1834,7 +1834,7 @@ void labviewer_make_background_window(Button* caller)
SCP_map<SCP_string, SCP_vector<SCP_string>> directories;
char fullpath[MAX_PATH_LEN];
for (auto filename : missions)
for (const auto& filename : missions)
{
cf_find_file_location((filename + ".fs2").c_str(), CF_TYPE_MISSIONS, sizeof(fullpath) - 1, fullpath, NULL, NULL);
auto location = get_directory_or_vp(fullpath);
@@ -1854,7 +1854,7 @@ void labviewer_make_background_window(Button* caller)
auto directoryItem = Mission_directories[i];
directoryItem = missiontree->AddItem(NULL, directory.first);
for (auto Lab_mission : directory.second)
for (const auto& Lab_mission : directory.second)
{
missiontree->AddItem(directoryItem, Lab_mission, 0, true, labviewer_change_background);
}
+39 -39
View File
@@ -282,7 +282,7 @@ public:
//CONSTRUCTION/DESTRUCTION
//Derive your class's constructer from the GUIObject one
GUIObject(const SCP_string &in_Name="", int x_coord = 0, int y_coord = 0, int x_width = -1, int y_height = -1, int in_style = 0);
~GUIObject();
~GUIObject() override;
void Delete();
//CHILD FUNCTIONS
@@ -315,7 +315,7 @@ private:
SCP_vector<GUIObject*> DeletionCache;
public:
GUIScreen(const SCP_string &in_Name="");
~GUIScreen();
~GUIScreen() override;
ObjectClassInfoEntry *GetObjectClassInfo(GUIObject *cgp);
@@ -427,13 +427,13 @@ class Window : public GUIObject
shader WindowShade;
protected:
void DoDraw(float frametime);
void DoMove(int dx, int dy);
int DoRefreshSize();
int DoMouseOver(float frametime);
int DoMouseDown(float frametime);
int DoMouseUp(float frametime);
int DoMouseOut(float frametime);
void DoDraw(float frametime) override;
void DoMove(int dx, int dy) override;
int DoRefreshSize() override;
int DoMouseOver(float frametime) override;
int DoMouseDown(float frametime) override;
int DoMouseUp(float frametime) override;
int DoMouseOut(float frametime) override;
bool HasChildren(){return NOT_EMPTY(&Children);}
public:
@@ -462,11 +462,11 @@ class Button : public GUIObject
bool IsDown; //Does it look pressed?
protected:
void DoDraw(float frametime);
int DoRefreshSize();
int DoMouseDown(float frametime);
int DoMouseUp(float frametime);
int DoMouseOut(float frametime);
void DoDraw(float frametime) override;
int DoRefreshSize() override;
int DoMouseDown(float frametime) override;
int DoMouseUp(float frametime) override;
int DoMouseOut(float frametime) override;
public:
Button(const SCP_string &in_caption, int x_coord, int y_coord, void (*in_function)(Button *caller) = NULL, int x_width = -1, int y_height = -1, int in_style = 0);
@@ -511,7 +511,7 @@ public:
void ClearAllItems();
TreeItem();
~TreeItem();
~TreeItem() override;
};
class Tree : public GUIObject
@@ -528,12 +528,12 @@ class Tree : public GUIObject
void CalcItemsSize(TreeItem *items, int *DrawData);
void DrawItems(TreeItem *items);
protected:
void DoDraw(float frametime);
void DoMove(int dx, int dy);
int DoRefreshSize();
int DoMouseOver(float frametime);
int DoMouseDown(float frametime);
int DoMouseUp(float frametime);
void DoDraw(float frametime) override;
void DoMove(int dx, int dy) override;
int DoRefreshSize() override;
int DoMouseOver(float frametime) override;
int DoMouseDown(float frametime) override;
int DoMouseUp(float frametime) override;
public:
Tree(const SCP_string &in_name, int x_coord, int y_coord, void* in_associateditem = NULL, int x_width = -1, int y_width = -1, int in_style = 0);
@@ -590,10 +590,10 @@ class Text : public GUIObject
union{int SaveMin;float flSaveMin;uint uSaveMin;};
protected:
void DoDraw(float frametime);
int DoRefreshSize();
int DoMouseDown(float frametime);
int DoKeyPress(float frametime);
void DoDraw(float frametime) override;
int DoRefreshSize() override;
int DoMouseDown(float frametime) override;
int DoKeyPress(float frametime) override;
public:
Text(const SCP_string &in_name, const SCP_string &in_content, int x_coord, int y_coord, int x_width = -1, int y_width = -1, int in_style = 0);
@@ -636,13 +636,13 @@ class Checkbox : public GUIObject
int HighlightStatus;
protected:
void DoDraw(float frametime);
void DoMove(int dx, int dy);
int DoRefreshSize();
int DoMouseOver(float frametime);
int DoMouseDown(float frametime);
int DoMouseUp(float frametime);
int DoMouseOut(float frametime);
void DoDraw(float frametime) override;
void DoMove(int dx, int dy) override;
int DoRefreshSize() override;
int DoMouseOver(float frametime) override;
int DoMouseDown(float frametime) override;
int DoMouseUp(float frametime) override;
int DoMouseOut(float frametime) override;
public:
Checkbox(const SCP_string &in_label, int x_coord, int y_coord, void (*in_function)(Checkbox *caller) = NULL, int x_width = -1, int y_height = DEFAULT_BUTTON_HEIGHT, int in_style = 0);
@@ -719,8 +719,8 @@ class ImageAnim : public GUIObject
int PlayType;
int ImageFlags;
protected:
void DoDraw(float frametime);
int DoRefreshSize();
void DoDraw(float frametime) override;
int DoRefreshSize() override;
public:
ImageAnim(const SCP_string &in_name, const SCP_string &in_imagename, int x_coord, int y_coord, int x_width = -1, int y_width = -1, int in_style = 0);
@@ -754,11 +754,11 @@ class Slider : public GUIObject
float GetSliderPos(int x);
void UpdateSlider(int x);
protected:
void DoDraw(float frametime);
void DoMove(int dx, int dy);
int DoRefreshSize();
int DoMouseDown(float frametime);
int DoMouseUp(float frametime);
void DoDraw(float frametime) override;
void DoMove(int dx, int dy) override;
int DoRefreshSize() override;
int DoMouseDown(float frametime) override;
int DoMouseUp(float frametime) override;
public:
Slider(const SCP_string &in_label, float min, float max, int x_coord, int y_coord, void(*in_function)(Slider *caller) = NULL, int x_width = -1, int y_height = DEFAULT_BUTTON_HEIGHT, int in_style = 0);
+2 -2
View File
@@ -13,8 +13,8 @@ void initialize();
class FFmpegException: public std::runtime_error {
public:
FFmpegException(const std::string& msg) : std::runtime_error(msg) {}
~FFmpegException() throw() {}
explicit FFmpegException(const std::string& msg) : std::runtime_error(msg) {}
~FFmpegException() SCP_NOEXCEPT override {}
};
}
+1
View File
@@ -67,6 +67,7 @@ FFmpegContext::~FFmpegContext() {
av_free(m_ctx->pb->buffer);
}
av_free(m_ctx->pb);
m_ctx->pb = nullptr;
}
avformat_close_input(&m_ctx);
+2
View File
@@ -18,6 +18,8 @@
#include "globalincs/pstypes.h"
#include <cfloat>
extern float frand();
extern int rand_chance(float frametime, float chance = 1.0f);
float frand_range(float min, float max);
+6 -6
View File
@@ -49,9 +49,9 @@ public:
void initTextStartOffsets(int x, int y);
void initTextHeight(int h);
void initMaxLineWidth(int w);
void render(float frametime);
void pageIn();
bool canRender();
void render(float frametime) override;
void pageIn() override;
bool canRender() override;
};
class HudGaugeTrainingMessages: public HudGauge
@@ -59,9 +59,9 @@ class HudGaugeTrainingMessages: public HudGauge
protected:
public:
HudGaugeTrainingMessages();
void render(float frametime);
void pageIn();
bool canRender();
void render(float frametime) override;
void pageIn() override;
bool canRender() override;
};
#endif /* __MISSIONTRAINING_H__ */
+7 -19
View File
@@ -543,7 +543,7 @@ void model_draw_list::render_buffer(queued_buffer_draw &render_elements)
gr_bind_uniform_buffer(uniform_block_type::ModelData,
render_elements.uniform_buffer_offset,
render_elements.uniform_data_size,
sizeof(graphics::model_uniform_data),
_dataBuffer->bufferHandle());
gr_render_model(&render_elements.render_material, render_elements.vert_src, render_elements.buffer, render_elements.texi);
@@ -797,7 +797,6 @@ void model_draw_list::build_uniform_buffer() {
TRACE_SCOPE(tracing::BuildModelUniforms);
_dataBuffer = gr_get_uniform_buffer(uniform_block_type::ModelData);
auto bindless_textures = gr_is_capable(CAPABILITY_BINDLESS_TEXTURING);
for (auto render_index : Render_keys) {
auto& queued_draw = Render_elements[render_index];
@@ -811,23 +810,12 @@ void model_draw_list::build_uniform_buffer() {
Scene_light_handler.resetLightState();
}
if (bindless_textures) {
auto element = _dataBuffer->aligner().addTypedElement<graphics::model_uniform_data_bindless>();
graphics::uniforms::convert_bindless_model_material(element,
queued_draw.render_material,
queued_draw.transform,
queued_draw.scale,
queued_draw.transform_buffer_offset);
queued_draw.uniform_data_size = sizeof(graphics::model_uniform_data_bindless);
} else {
auto element = _dataBuffer->aligner().addTypedElement<graphics::model_uniform_data>();
graphics::uniforms::convert_model_material(element,
queued_draw.render_material,
queued_draw.transform,
queued_draw.scale,
queued_draw.transform_buffer_offset);
queued_draw.uniform_data_size = sizeof(graphics::model_uniform_data);
}
auto element = _dataBuffer->aligner().addTypedElement<graphics::model_uniform_data>();
graphics::uniforms::convert_model_material(element,
queued_draw.render_material,
queued_draw.transform,
queued_draw.scale,
queued_draw.transform_buffer_offset);
queued_draw.uniform_buffer_offset = _dataBuffer->aligner().getCurrentOffset();
}
-1
View File
@@ -183,7 +183,6 @@ struct queued_buffer_draw
{
size_t transform_buffer_offset = 0;
size_t uniform_buffer_offset = 0;
size_t uniform_data_size = 0;
model_material render_material;
+6 -7
View File
@@ -228,8 +228,7 @@ public:
passwd.assign(newPasswd);
}
virtual void execute()
{
void execute() override {
if (hasName) {
strcpy_s(Netgame.name, name.c_str());
strcpy_s(Multi_options_g.std_pname, name.c_str());
@@ -258,7 +257,7 @@ public:
: mPlayerId(playerId) {
}
virtual void execute() {
void execute() override {
size_t foundPlayerIndex = MAX_PLAYERS;
for (size_t idx = 0; idx < MAX_PLAYERS; idx++) {
if (MULTI_CONNECTED(Net_players[idx])) {
@@ -278,14 +277,14 @@ private:
class ShutdownServerCommand: public WebapiCommand {
public:
virtual void execute() {
void execute() override {
gameseq_post_event(GS_EVENT_QUIT_GAME);
}
};
class UpdateMissionsCommand: public WebapiCommand {
public:
virtual void execute() {
void execute() override {
if (MULTI_IS_TRACKER_GAME) {
// delete mvalid.cfg if it exists
cf_delete(MULTI_VALID_MISSION_FILE, CF_TYPE_DATA);
@@ -298,14 +297,14 @@ public:
class ResetGameCommand: public WebapiCommand {
public:
virtual void execute() {
void execute() override {
multi_quit_game(PROMPT_NONE);
}
};
class ResetFs2NetCommand: public WebapiCommand {
public:
virtual void execute() {
void execute() override {
fs2netd_reset_connection();
}
};
+1 -1
View File
@@ -232,7 +232,7 @@ void obj_render(object* obj);
void obj_queue_render(object* obj, model_draw_list* scene);
//Sorts and renders all the ojbects
void obj_render_all(std::function<void(object*)> render_function, bool* render_viewer_last );
void obj_render_all(const std::function<void(object*)>& render_function, bool* render_viewer_last );
//move all objects for the current frame
void obj_move_all(float frametime); // moves all objects
+1 -1
View File
@@ -169,7 +169,7 @@ inline bool obj_render_is_model(object *obj)
}
// Sorts all the objects by Z and renders them
void obj_render_all(std::function<void(object*)> render_function, bool *draw_viewer_last )
void obj_render_all(const std::function<void(object*)>& render_function, bool *draw_viewer_last )
{
object *objp;
int i;
+6 -4
View File
@@ -51,8 +51,9 @@ namespace os
* @param linenum The source code line number where this function was called
* @param format An optional message to display in addition to the specified text
*/
void AssertMessage(const char* text, const char* filename, int linenum,
SCP_FORMAT_STRING const char* format = nullptr, ...) SCP_FORMAT_STRING_ARGS(4, 5);
void AssertMessage(const char* text, const char* filename, int linenum, SCP_FORMAT_STRING
const char* format = nullptr, ...)
SCP_FORMAT_STRING_ARGS(4, 5) CLANG_ANALYZER_NORETURN;
/**
* @brief Shows a lua error.
@@ -72,7 +73,8 @@ namespace os
* @param line The source code line number where this function was called
* @param format The error message to display (a format string)
*/
void Error(const char* filename, int line, SCP_FORMAT_STRING const char* format, ...) SCP_FORMAT_STRING_ARGS(3, 4);
void Error(const char* filename, int line, SCP_FORMAT_STRING const char* format, ...)
SCP_FORMAT_STRING_ARGS(3, 4) CLANG_ANALYZER_NORETURN;
/**
* @brief Shows an error dialog.
@@ -80,7 +82,7 @@ namespace os
*
* @param text The text to display
*/
void Error(const char* text);
void Error(const char* text) CLANG_ANALYZER_NORETURN;;
/**
* @brief Shows a warning dialog.
+2 -2
View File
@@ -351,8 +351,8 @@ namespace parse
class ParseException : public std::runtime_error
{
public:
ParseException(const std::string& msg) : std::runtime_error(msg) {}
~ParseException() throw() {}
explicit ParseException(const std::string& msg) : std::runtime_error(msg) {}
~ParseException() SCP_NOEXCEPT override {}
};
}
+1 -1
View File
@@ -123,7 +123,7 @@ void SourceOrigin::moveToObject(object* objp, vec3d* offset) {
m_offset = *offset;
}
void SourceOrigin::moveToParticle(WeakParticlePtr weakParticlePtr) {
void SourceOrigin::moveToParticle(const WeakParticlePtr& weakParticlePtr) {
m_originType = SourceOriginType::PARTICLE;
m_origin.m_particle = weakParticlePtr;
}
+1 -1
View File
@@ -121,7 +121,7 @@ class SourceOrigin {
* @brief Moves the source to the specified particle
* @param weakParticlePtr The hosting particle
*/
void moveToParticle(WeakParticlePtr weakParticlePtr);
void moveToParticle(const WeakParticlePtr& weakParticlePtr);
friend class ParticleSource;
};
+4 -3
View File
@@ -12,13 +12,14 @@ namespace particle
m_sources.push_back(source);
}
ParticleSourceWrapper::ParticleSourceWrapper(ParticleSourceWrapper&& other)
ParticleSourceWrapper::ParticleSourceWrapper(ParticleSourceWrapper&& other) SCP_NOEXCEPT
{
*this = std::move(other);
}
ParticleSourceWrapper::~ParticleSourceWrapper()
{
// Prevent empty wrapper from causing issues
if (!m_sources.empty())
{
@@ -27,7 +28,7 @@ namespace particle
}
}
ParticleSourceWrapper& ParticleSourceWrapper::operator=(ParticleSourceWrapper&& other)
ParticleSourceWrapper& ParticleSourceWrapper::operator=(ParticleSourceWrapper&& other) SCP_NOEXCEPT
{
std::swap(other.m_sources, m_sources);
return *this;
@@ -59,7 +60,7 @@ namespace particle
}
}
void ParticleSourceWrapper::moveToParticle(WeakParticlePtr ptr)
void ParticleSourceWrapper::moveToParticle(const WeakParticlePtr& ptr)
{
for (auto& source : m_sources)
{
+3 -3
View File
@@ -40,15 +40,15 @@ namespace particle
~ParticleSourceWrapper();
ParticleSourceWrapper(ParticleSourceWrapper&& other);
ParticleSourceWrapper(ParticleSourceWrapper&& other) SCP_NOEXCEPT;
ParticleSourceWrapper& operator=(ParticleSourceWrapper&& other);
ParticleSourceWrapper& operator=(ParticleSourceWrapper&& other) SCP_NOEXCEPT;
void finish();
void setCreationTimestamp(int timestamp);
void moveToParticle(WeakParticlePtr ptr);
void moveToParticle(const WeakParticlePtr& ptr);
void moveToObject(object* obj, vec3d* localPos);
+3 -3
View File
@@ -23,11 +23,11 @@ class BeamPiercingEffect: public ParticleEffect {
public:
BeamPiercingEffect() : ParticleEffect("") {}
virtual bool processSource(const ParticleSource* source) override;
bool processSource(const ParticleSource* source) override;
virtual void parseValues(bool nocreate) override;
void parseValues(bool nocreate) override;
virtual void pageIn() override;
void pageIn() override;
void setValues(int bitmapIndex, float radius, float velocity, float back_velocity, float variance);
};
+4 -4
View File
@@ -19,13 +19,13 @@ class CompositeEffect: public ParticleEffect {
public:
explicit CompositeEffect(const SCP_string& name);
virtual bool processSource(const ParticleSource* source) override;
bool processSource(const ParticleSource* source) override;
virtual void parseValues(bool nocreate) override;
void parseValues(bool nocreate) override;
virtual void pageIn() override;
void pageIn() override;
virtual EffectType getType() const override { return EffectType::Composite; }
EffectType getType() const override { return EffectType::Composite; }
const SCP_vector<ParticleEffectPtr>& getEffects() const { return m_childEffects; }
+4 -4
View File
@@ -84,7 +84,7 @@ class GenericShapeEffect : public ParticleEffect {
explicit GenericShapeEffect(const SCP_string& name) : ParticleEffect(name) {
}
virtual bool processSource(const ParticleSource* source) override {
bool processSource(const ParticleSource* source) override {
if (!m_timing.continueProcessing(source)) {
return false;
}
@@ -127,7 +127,7 @@ class GenericShapeEffect : public ParticleEffect {
return true;
}
virtual void parseValues(bool nocreate) override {
void parseValues(bool nocreate) override {
m_particleProperties.parse(nocreate);
m_shape.parse(nocreate);
@@ -172,9 +172,9 @@ class GenericShapeEffect : public ParticleEffect {
m_timing.applyToSource(&source);
}
virtual EffectType getType() const override { return m_shape.getType(); }
EffectType getType() const override { return m_shape.getType(); }
virtual void pageIn() override {
void pageIn() override {
m_particleProperties.pageIn();
}
@@ -19,11 +19,11 @@ class ParticleEmitterEffect: public ParticleEffect {
public:
ParticleEmitterEffect();
virtual bool processSource(const ParticleSource* source) override;
bool processSource(const ParticleSource* source) override;
virtual void parseValues(bool nocreate) override;
void parseValues(bool nocreate) override;
virtual void pageIn() override;
void pageIn() override;
void setValues(const particle_emitter& emitter, int bitmap, float range);
};
+5 -5
View File
@@ -22,15 +22,15 @@ class SingleParticleEffect: public ParticleEffect {
public:
explicit SingleParticleEffect(const SCP_string& name);
virtual bool processSource(const ParticleSource* source) SCP_OVERRIDE;
bool processSource(const ParticleSource* source) override;
virtual void parseValues(bool nocreate) SCP_OVERRIDE;
void parseValues(bool nocreate) override;
virtual void pageIn() SCP_OVERRIDE;
void pageIn() override;
virtual void initializeSource(ParticleSource& source) SCP_OVERRIDE;
void initializeSource(ParticleSource& source) override;
virtual EffectType getType() const SCP_OVERRIDE { return EffectType::Single; }
EffectType getType() const override { return EffectType::Single; }
util::ParticleProperties& getProperties() { return m_particleProperties; }
+2 -2
View File
@@ -41,12 +41,12 @@ class BinaryFileHandler: public FileHandler {
void endSectionWrite() override;
void startArrayWrite(const char* name, size_t size, bool short_length = false) override;
void startArrayWrite(const char* name, size_t size, bool short_length) override;
void endArrayWrite() override;
virtual void flush() override;
void flush() override;
};
}
+1 -1
View File
@@ -210,7 +210,7 @@ void pilotfile::update_stats_backout(scoring_struct *stats, bool training)
}
if (j >= 0) {
p_stats->medals_earned[j].val = MAX(0,p_stats->medals_earned[j].val--);
p_stats->medals_earned[j].val = std::max(0,p_stats->medals_earned[j].val--);
} else {
Assertion(true, "Medal '%s' not found, should have been added by pilotfile::update_stats.", Medals[stats->m_medal_earned].name);
}
+3 -3
View File
@@ -92,9 +92,9 @@ private:
class ApngException : public std::runtime_error
{
public:
ApngException(const std::string& msg) : std::runtime_error(msg) {}
~ApngException() throw() {}
public:
explicit ApngException(const std::string& msg) : std::runtime_error(msg) {}
~ApngException() SCP_NOEXCEPT override {}
};
}
+2 -2
View File
@@ -59,8 +59,8 @@ public:
void drawContactCircle( int x, int y, int rad );
void drawContactImage( int x, int y, int rad, int idx, int clr_idx, int size );
void drawCrosshairs(int x, int y);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
void plotBlip(blip *b, int *x, int *y);
void plotObject( object *objp );
};
+4 -4
View File
@@ -86,12 +86,12 @@ public:
void drawOutlinesHtl();
void setupViewHtl();
int calcAlpha(vec3d* pt);
void render(float frametime);
void pageIn();
void render(float frametime) override;
void pageIn() override;
void plotBlip(blip* b, vec3d *pos, float *alpha);
virtual void onFrame(float frametime);
virtual void initialize();
void onFrame(float frametime) override;
void initialize() override;
// Sound specific functions
void doLoopSnd();
Loaded 100 of 194 files, more files were not shown because too many files have changed in this diff. Show more