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
174 changed files with 4510 additions and 878 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 -2
View File
@@ -1167,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;
@@ -1190,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("/\\");
@@ -1391,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);
}
+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);
+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
+1 -1
View File
@@ -757,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)();
+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 -4
View File
@@ -245,10 +245,10 @@ 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;
@@ -522,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;
}
@@ -824,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);
+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;
};
}
+2
View File
@@ -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) {
+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;
+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__ */
+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();
+2 -2
View File
@@ -62,8 +62,8 @@ public:
void setupView();
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 *scaled_pos);
};
+3 -3
View File
@@ -131,9 +131,9 @@ public:
void initInfinityIcon();
void drawRange();
virtual void render(float frametime);
virtual void initialize();
virtual void pageIn();
void render(float frametime) override;
void initialize() override;
void pageIn() override;
};
#endif //_FS2OPEN_RADARSETUP_H
+2 -2
View File
@@ -14,10 +14,10 @@ namespace args {
class ArgumentException: public LuaException {
public:
ArgumentException(const std::string& message = "Argument Error!") throw() : LuaException(message) {
ArgumentException(const std::string& message = "Argument Error!") SCP_NOEXCEPT : LuaException(message) {
}
virtual ~ArgumentException() throw() {
~ArgumentException() SCP_NOEXCEPT override {
}
};
+1 -1
View File
@@ -71,7 +71,7 @@ LuaValueList LuaFunction::operator()(const LuaValueList& args) {
return this->call(args);
}
void LuaFunction::setReference(LuaReference ref) {
void LuaFunction::setReference(const LuaReference& ref) {
ref->pushValue();
lua_State* L = ref->getState();
+2 -2
View File
@@ -64,7 +64,7 @@ class LuaFunction: public LuaValue {
/**
* @brief Frees the reference to the function if it exists.
*/
virtual ~LuaFunction();
~LuaFunction() override;
/**
* @brief Sets the function environment.
@@ -91,7 +91,7 @@ class LuaFunction: public LuaValue {
* @param ref The new reference
* @return void
*/
void setReference(LuaReference ref) override;
void setReference(const LuaReference& ref) override;
/**
* @brief Calls the function.
+4 -4
View File
@@ -12,7 +12,7 @@ LuaReference UniqueLuaReference::create(lua_State* state, int position) {
lua_pushvalue(state, position);
LuaReference ref(new UniqueLuaReference(state, luaL_ref(state, LUA_REGISTRYINDEX)));
LuaReference ref = std::make_shared<UniqueLuaReference>(state, luaL_ref(state, LUA_REGISTRYINDEX));
return ref;
}
@@ -35,10 +35,10 @@ UniqueLuaReference::UniqueLuaReference(lua_State* state, int reference) : _luaSt
UniqueLuaReference::UniqueLuaReference() : _luaState(nullptr), _reference(LUA_NOREF) {
}
UniqueLuaReference::UniqueLuaReference(UniqueLuaReference&& other) : _luaState(nullptr), _reference(LUA_NOREF) {
UniqueLuaReference::UniqueLuaReference(UniqueLuaReference&& other) SCP_NOEXCEPT : _luaState(nullptr), _reference(LUA_NOREF) {
*this = std::move(other);
}
UniqueLuaReference& UniqueLuaReference::operator=(UniqueLuaReference&& other) {
UniqueLuaReference& UniqueLuaReference::operator=(UniqueLuaReference&& other) SCP_NOEXCEPT {
std::swap(_luaState, other._luaState);
std::swap(_reference, other._reference);
return *this;
@@ -79,4 +79,4 @@ void UniqueLuaReference::pushValue() const {
lua_rawgeti(_luaState, LUA_REGISTRYINDEX, this->getReference());
}
}
}
}
+11 -7
View File
@@ -4,6 +4,8 @@
#include "LuaHeaders.h"
#include <scp_compiler_detection.h>
#include <memory>
namespace luacpp {
@@ -24,6 +26,10 @@ typedef std::shared_ptr<UniqueLuaReference> LuaReference;
*/
class UniqueLuaReference {
private:
lua_State* _luaState;
int _reference;
public:
/**
* @brief Initializes a lua reference.
*
@@ -31,13 +37,11 @@ class UniqueLuaReference {
*
* @param state The lua_State where the reference points to a value.
* @param reference The reference value, should be >= 0.
*
* @warning Do not call this directly. Use UniqueLuaReference::create instead.
*/
UniqueLuaReference(lua_State* state, int reference);
lua_State* _luaState;
int _reference;
public:
/**
* @brief Creates a lua-reference.
*
@@ -72,8 +76,8 @@ class UniqueLuaReference {
UniqueLuaReference(const UniqueLuaReference&) = delete;
UniqueLuaReference& operator=(const UniqueLuaReference&) = delete;
UniqueLuaReference(UniqueLuaReference&& other);
UniqueLuaReference& operator=(UniqueLuaReference&& other);
UniqueLuaReference(UniqueLuaReference&& other) SCP_NOEXCEPT;
UniqueLuaReference& operator=(UniqueLuaReference&& other) SCP_NOEXCEPT;
lua_State* getState() { return _luaState; }
@@ -102,4 +106,4 @@ class UniqueLuaReference {
};
}
#endif // LUA_REFERENCE_H
#endif // LUA_REFERENCE_H
+1 -1
View File
@@ -38,7 +38,7 @@ bool LuaTable::setMetatable(const LuaTable& table) {
return true;
}
void LuaTable::setReference(luacpp::LuaReference ref) {
void LuaTable::setReference(const LuaReference& ref) {
ref->pushValue();
lua_State* L = ref->getState();
+2 -2
View File
@@ -108,7 +108,7 @@ class LuaTable: public LuaValue {
/**
* Dereferences the stored reference to the table if it exists.
*/
virtual ~LuaTable();
~LuaTable() override;
/**
* @brief Sets the metatable.
@@ -127,7 +127,7 @@ class LuaTable: public LuaValue {
* @param ref The new reference
* @return void
*/
void setReference(LuaReference ref) override;
void setReference(const LuaReference& ref) override;
/**
* @brief Adds a value to this lua table.
+1 -1
View File
@@ -56,7 +56,7 @@ LuaValue::LuaValue(const LuaValue& other) : _luaState(other._luaState) {
LuaValue::~LuaValue() {
}
void LuaValue::setReference(LuaReference ref) {
void LuaValue::setReference(const LuaReference& ref) {
this->_reference = ref;
if (isValid()) {
+1 -1
View File
@@ -93,7 +93,7 @@ class LuaValue {
*
* @param ref The new lua reference.
*/
virtual void setReference(LuaReference ref);
virtual void setReference(const LuaReference& ref);
/**
* @brief Gets the LuaReference.
+2 -2
View File
@@ -1406,7 +1406,7 @@ void ship_info::free_strings()
CHECK_THEN_FREE(missile_banks);
}
ship_info &ship_info::operator= (ship_info&& other) NOEXCEPT
ship_info &ship_info::operator= (ship_info&& other) SCP_NOEXCEPT
{
if (this != &other) {
move(std::move(other));
@@ -1414,7 +1414,7 @@ ship_info &ship_info::operator= (ship_info&& other) NOEXCEPT
return *this;
}
ship_info::ship_info(ship_info&& other) NOEXCEPT
ship_info::ship_info(ship_info&& other) SCP_NOEXCEPT
{
// MageKing17 - Initialize these pointers to NULL because otherwise move() will leave them uninitialized.
type_str = NULL;
+2 -2
View File
@@ -1218,9 +1218,9 @@ public:
~ship_info();
void clone(const ship_info& other);
ship_info(ship_info&& other) NOEXCEPT;
ship_info(ship_info&& other) SCP_NOEXCEPT;
ship_info &operator=(ship_info&& other) NOEXCEPT;
ship_info &operator=(ship_info&& other) SCP_NOEXCEPT;
void free_strings();
+26 -26
View File
@@ -169,7 +169,7 @@ protected:
public:
WarpEffect();
WarpEffect(object *n_objp, int n_direction);
virtual ~WarpEffect() {}
virtual ~WarpEffect() = default;
void clear();
bool isValid();
@@ -215,13 +215,13 @@ private:
public:
WE_Default(object *n_objp, int n_direction);
int warpStart();
int warpFrame(float frametime);
int warpShipClip(model_render_params *render_info);
int warpShipRender();
int warpStart() override;
int warpFrame(float frametime) override;
int warpShipClip(model_render_params *render_info) override;
int warpShipRender() override;
int getWarpPosition(vec3d *output);
int getWarpOrientation(matrix *output);
int getWarpPosition(vec3d *output) override;
int getWarpOrientation(matrix *output) override;
};
//********************-----CLASS: WE_BSG-----********************//
@@ -267,18 +267,18 @@ private:
public:
WE_BSG(object *n_objp, int n_direction);
~WE_BSG();
~WE_BSG() override;
virtual void pageIn();
void pageIn() override;
virtual int warpStart();
virtual int warpFrame(float frametime);
virtual int warpShipClip(model_render_params *render_info);
virtual int warpShipRender();
virtual int warpEnd();
int warpStart() override;
int warpFrame(float frametime) override;
int warpShipClip(model_render_params *render_info) override;
int warpShipRender() override;
int warpEnd() override;
virtual int getWarpPosition(vec3d *output);
virtual int getWarpOrientation(matrix *output);
int getWarpPosition(vec3d *output) override;
int getWarpOrientation(matrix *output) override;
};
//********************-----CLASS: WE_Homeworld-----********************//
@@ -318,16 +318,16 @@ private:
float z_offset_max;
public:
WE_Homeworld(object *n_objp, int n_direction);
virtual ~WE_Homeworld();
~WE_Homeworld() override;
virtual int warpStart();
virtual int warpFrame(float frametime);
virtual int warpShipClip(model_render_params *render_info);
virtual int warpShipRender();
virtual int warpEnd();
int warpStart() override;
int warpFrame(float frametime) override;
int warpShipClip(model_render_params *render_info) override;
int warpShipRender() override;
int warpEnd() override;
int getWarpPosition(vec3d *output);
int getWarpOrientation(matrix *output);
int getWarpPosition(vec3d *output) override;
int getWarpOrientation(matrix *output) override;
};
//********************-----CLASS: WE_Hyperspace----********************//
@@ -348,8 +348,8 @@ private:
public:
WE_Hyperspace(object *n_objp, int n_direction);
virtual int warpStart();
virtual int warpFrame(float frametime);
int warpStart() override;
int warpFrame(float frametime) override;
};
+20 -2
View File
@@ -398,13 +398,30 @@ static void get_version_info(OpenALInformation* info) {
alcCloseDevice(device);
}
void enumerate_playback_devices(OpenALInformation* info) {
static bool device_supports_efx(const char* device_name) {
ALCdevice *device = alcOpenDevice(device_name);
if (device == NULL) {
return false;
}
bool result = false;
if ( alcIsExtensionPresent(device, (const ALchar*)"ALC_EXT_EFX") == AL_TRUE ) {
result = true;
}
alcCloseDevice(device);
return result;
}
static void enumerate_playback_devices(OpenALInformation* info) {
info->playback_devices.clear();
info->default_playback_device.clear();
auto default_device = alcGetString( NULL, ALC_DEFAULT_DEVICE_SPECIFIER );
if (default_device != nullptr) {
info->default_playback_device = default_device;
info->efx_support.push_back(std::make_pair(SCP_string(default_device), device_supports_efx(default_device)));
}
if ( alcIsExtensionPresent(NULL, (const ALCchar*)"ALC_ENUMERATION_EXT") == AL_TRUE ) {
@@ -422,6 +439,7 @@ void enumerate_playback_devices(OpenALInformation* info) {
if ( (str_list != NULL) && ((ext_length = strlen(str_list)) > 0) ) {
while (ext_length) {
info->playback_devices.push_back( SCP_string(str_list) );
info->efx_support.push_back(std::make_pair(SCP_string(str_list), device_supports_efx(str_list)));
str_list += (ext_length + 1);
ext_length = strlen(str_list);
@@ -434,7 +452,7 @@ void enumerate_playback_devices(OpenALInformation* info) {
}
}
void enumerate_capture_devices(OpenALInformation* info) {
static void enumerate_capture_devices(OpenALInformation* info) {
info->capture_devices.clear();
info->default_capture_device.clear();
Loaded 100 of 174 files, more files were not shown because too many files have changed in this diff. Show more