Merge branch 'master' of github.com:highfidelity/hifi into fix-include-race

This commit is contained in:
Seth Alves 2016-11-14 10:00:46 -08:00
commit 43b73f0380
42 changed files with 123 additions and 123 deletions

View file

@ -16,6 +16,7 @@ if (HIFI_MEMORY_DEBUGGING)
if (UNIX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -U_FORTIFY_SOURCE -fno-stack-protector -fno-omit-frame-pointer")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libasan -static-libstdc++ -fsanitize=address")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libasan -static-libstdc++ -fsanitize=address")
endif (UNIX)
endif ()
endmacro(SETUP_MEMORY_DEBUGGER)

View file

@ -18,7 +18,7 @@ class Basic2DWindowOpenGLDisplayPlugin : public OpenGLDisplayPlugin {
Q_OBJECT
using Parent = OpenGLDisplayPlugin;
public:
virtual const QString& getName() const override { return NAME; }
virtual const QString getName() const override { return NAME; }
virtual float getTargetFrameRate() const override { return _framerateTarget ? (float) _framerateTarget : TARGET_FRAMERATE_Basic2DWindowOpenGL; }

View file

@ -12,7 +12,7 @@
class NullDisplayPlugin : public DisplayPlugin {
public:
~NullDisplayPlugin() final {}
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
grouping getGrouping() const override { return DEVELOPER; }
glm::uvec2 getRecommendedRenderSize() const override;

View file

@ -758,7 +758,6 @@ void OpenGLDisplayPlugin::render(std::function<void(gpu::Batch& batch)> f) {
OpenGLDisplayPlugin::~OpenGLDisplayPlugin() {
qDebug() << "Destroying OpenGLDisplayPlugin";
}
void OpenGLDisplayPlugin::updateCompositeFramebuffer() {

View file

@ -13,7 +13,7 @@ class DebugHmdDisplayPlugin : public HmdDisplayPlugin {
using Parent = HmdDisplayPlugin;
public:
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
grouping getGrouping() const override { return DEVELOPER; }
bool isSupported() const override;

View file

@ -13,7 +13,7 @@ class InterleavedStereoDisplayPlugin : public StereoDisplayPlugin {
Q_OBJECT
using Parent = StereoDisplayPlugin;
public:
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
grouping getGrouping() const override { return ADVANCED; }
glm::uvec2 getRecommendedRenderSize() const override;

View file

@ -15,7 +15,7 @@ class SideBySideStereoDisplayPlugin : public StereoDisplayPlugin {
Q_OBJECT
using Parent = StereoDisplayPlugin;
public:
virtual const QString& getName() const override { return NAME; }
virtual const QString getName() const override { return NAME; }
virtual grouping getGrouping() const override { return ADVANCED; }
virtual glm::uvec2 getRecommendedRenderSize() const override;

View file

@ -285,10 +285,10 @@ GL45Texture::GL45Texture(const std::weak_ptr<GLBackend>& backend, const Texture&
}
GL45Texture::~GL45Texture() {
// External textures cycle very quickly, so don't spam the log with messages about them.
if (!_gpuObject.getUsage().isExternal()) {
qCDebug(gpugl45logging) << "Destroying texture " << _id << " from source " << _source.c_str();
}
// // External textures cycle very quickly, so don't spam the log with messages about them.
// if (!_gpuObject.getUsage().isExternal()) {
// qCDebug(gpugl45logging) << "Destroying texture " << _id << " from source " << _source.c_str();
// }
// Remove this texture from the candidate list of derezzable textures
if (_transferrable) {

View file

@ -18,7 +18,7 @@
#include <PathUtils.h>
#include <NumericalConstants.h>
const QString KeyboardMouseDevice::NAME = "Keyboard/Mouse";
const char* KeyboardMouseDevice::NAME = "Keyboard/Mouse";
bool KeyboardMouseDevice::_enableTouch = true;
void KeyboardMouseDevice::pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) {

View file

@ -52,21 +52,21 @@ public:
MOUSE_AXIS_WHEEL_X_POS,
MOUSE_AXIS_WHEEL_X_NEG,
};
enum TouchAxisChannel {
TOUCH_AXIS_X_POS = MOUSE_AXIS_WHEEL_X_NEG + 1,
TOUCH_AXIS_X_NEG,
TOUCH_AXIS_Y_POS,
TOUCH_AXIS_Y_NEG,
};
enum TouchButtonChannel {
TOUCH_BUTTON_PRESS = TOUCH_AXIS_Y_NEG + 1,
};
// Plugin functions
bool isSupported() const override { return true; }
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
bool isHandController() const override { return false; }
@ -88,8 +88,8 @@ public:
void wheelEvent(QWheelEvent* event);
static void enableTouch(bool enableTouch) { _enableTouch = enableTouch; }
static const QString NAME;
static const char* NAME;
protected:

View file

@ -21,7 +21,7 @@
#include <PathUtils.h>
#include <NumericalConstants.h>
const QString TouchscreenDevice::NAME = "Touchscreen";
const char* TouchscreenDevice::NAME = "Touchscreen";
bool TouchscreenDevice::isSupported() const {
for (auto touchDevice : QTouchDevice::devices()) {

View file

@ -22,7 +22,7 @@ class QGestureEvent;
class TouchscreenDevice : public InputPlugin {
Q_OBJECT
public:
enum TouchAxisChannel {
TOUCH_AXIS_X_POS = 0,
TOUCH_AXIS_X_NEG,
@ -37,7 +37,7 @@ public:
// Plugin functions
virtual bool isSupported() const override;
virtual const QString& getName() const override { return NAME; }
virtual const QString getName() const override { return NAME; }
bool isHandController() const override { return false; }
@ -48,8 +48,8 @@ public:
void touchEndEvent(const QTouchEvent* event);
void touchUpdateEvent(const QTouchEvent* event);
void touchGestureEvent(const QGestureEvent* event);
static const QString NAME;
static const char* NAME;
protected:

View file

@ -7,7 +7,7 @@
//
#include "Plugin.h"
QString Plugin::UNKNOWN_PLUGIN_ID("unknown");
const char* Plugin::UNKNOWN_PLUGIN_ID { "unknown" };
void Plugin::setContainer(PluginContainer* container) {
_container = container;

View file

@ -18,7 +18,7 @@ class Plugin : public QObject {
Q_OBJECT
public:
/// \return human-readable name
virtual const QString& getName() const = 0;
virtual const QString getName() const = 0;
typedef enum { STANDARD, ADVANCED, DEVELOPER } grouping;
@ -26,10 +26,10 @@ public:
virtual grouping getGrouping() const { return STANDARD; }
/// \return string ID (not necessarily human-readable)
virtual const QString& getID() const { assert(false); return UNKNOWN_PLUGIN_ID; }
virtual const QString getID() const { assert(false); return UNKNOWN_PLUGIN_ID; }
virtual bool isSupported() const;
void setContainer(PluginContainer* container);
/// Called when plugin is initially loaded, typically at application start
@ -74,6 +74,6 @@ signals:
protected:
bool _active { false };
PluginContainer* _container { nullptr };
static QString UNKNOWN_PLUGIN_ID;
static const char* UNKNOWN_PLUGIN_ID;
};

View file

@ -121,7 +121,7 @@ AnimDebugDraw::AnimDebugDraw() :
// HACK: add red, green and blue axis at (1,1,1)
_animDebugDrawData->_vertexBuffer->resize(sizeof(AnimDebugDrawData::Vertex) * 6);
static std::vector<AnimDebugDrawData::Vertex> vertices({
AnimDebugDrawData::Vertex { glm::vec3(1.0, 1.0f, 1.0f), toRGBA(255, 0, 0, 255) },
AnimDebugDrawData::Vertex { glm::vec3(2.0, 1.0f, 1.0f), toRGBA(255, 0, 0, 255) },
@ -162,9 +162,10 @@ static const uint32_t blue = toRGBA(0, 0, 255, 255);
const int NUM_CIRCLE_SLICES = 24;
static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius, AnimDebugDrawData::Vertex*& v) {
static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius, glm::vec4& vecColor, AnimDebugDrawData::Vertex*& v) {
const float XYZ_AXIS_LENGTH = radius * 4.0f;
const uint32_t color = toRGBA(vecColor);
AnimPose finalPose = rootPose * pose;
glm::vec3 base = rootPose * pose.trans;
@ -192,10 +193,10 @@ static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius
// x-ring
for (int i = 0; i < NUM_CIRCLE_SLICES; i++) {
v->pos = xRing[i];
v->rgba = red;
v->rgba = color;
v++;
v->pos = xRing[i + 1];
v->rgba = red;
v->rgba = color;
v++;
}
@ -210,10 +211,10 @@ static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius
// y-ring
for (int i = 0; i < NUM_CIRCLE_SLICES; i++) {
v->pos = yRing[i];
v->rgba = green;
v->rgba = color;
v++;
v->pos = yRing[i + 1];
v->rgba = green;
v->rgba = color;
v++;
}
@ -228,10 +229,10 @@ static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius
// z-ring
for (int i = 0; i < NUM_CIRCLE_SLICES; i++) {
v->pos = zRing[i];
v->rgba = blue;
v->rgba = color;
v++;
v->pos = zRing[i + 1];
v->rgba = blue;
v->rgba = color;
v++;
}
}
@ -367,7 +368,7 @@ void AnimDebugDraw::update() {
const float radius = BONE_RADIUS / (absPoses[i].scale.x * rootPose.scale.x);
// draw bone
addBone(rootPose, absPoses[i], radius, v);
addBone(rootPose, absPoses[i], radius, color, v);
// draw link to parent
auto parentIndex = skeleton->getParentIndex(i);
@ -382,20 +383,18 @@ void AnimDebugDraw::update() {
for (auto& iter : markerMap) {
glm::quat rot = std::get<0>(iter.second);
glm::vec3 pos = std::get<1>(iter.second);
glm::vec4 color = std::get<2>(iter.second); // TODO: currently ignored.
Q_UNUSED(color);
glm::vec4 color = std::get<2>(iter.second);
const float radius = POSE_RADIUS;
addBone(AnimPose::identity, AnimPose(glm::vec3(1), rot, pos), radius, v);
addBone(AnimPose::identity, AnimPose(glm::vec3(1), rot, pos), radius, color, v);
}
AnimPose myAvatarPose(glm::vec3(1), DebugDraw::getInstance().getMyAvatarRot(), DebugDraw::getInstance().getMyAvatarPos());
for (auto& iter : myAvatarMarkerMap) {
glm::quat rot = std::get<0>(iter.second);
glm::vec3 pos = std::get<1>(iter.second);
glm::vec4 color = std::get<2>(iter.second); // TODO: currently ignored.
Q_UNUSED(color);
glm::vec4 color = std::get<2>(iter.second);
const float radius = POSE_RADIUS;
addBone(myAvatarPose, AnimPose(glm::vec3(1), rot, pos), radius, v);
addBone(myAvatarPose, AnimPose(glm::vec3(1), rot, pos), radius, color, v);
}
// draw rays from shared DebugDraw singleton

View file

@ -1172,7 +1172,8 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac
// Guard against meaningless query and fragment parts.
// Do NOT use PreferLocalFile as its behavior is unpredictable (e.g., on defaultScriptsLocation())
const auto strippingFlags = QUrl::RemoveFilename | QUrl::RemoveQuery | QUrl::RemoveFragment;
for (QString file : includeFiles) {
for (QString includeFile : includeFiles) {
QString file = ResourceManager::normalizeURL(includeFile);
QUrl thisURL;
bool isStandardLibrary = false;
if (file.startsWith("/~/")) {

View file

@ -23,12 +23,12 @@ namespace hifi {
using Builder = std::function<Pointer()>;
using BuilderMap = std::map<Key, Builder>;
void registerBuilder(const Key& name, Builder builder) {
void registerBuilder(const Key name, Builder builder) {
// FIXME don't allow name collisions
_builders[name] = builder;
}
Pointer create(const Key& name) const {
Pointer create(const Key name) const {
const auto& entryIt = _builders.find(name);
if (entryIt != _builders.end()) {
return (*entryIt).second();
@ -39,7 +39,7 @@ namespace hifi {
template <typename Impl>
class Registrar {
public:
Registrar(const Key& name, SimpleFactory& factory) {
Registrar(const Key name, SimpleFactory& factory) {
factory.registerBuilder(name, [] { return std::make_shared<Impl>(); });
}
};

View file

@ -18,7 +18,7 @@
#include "HiFiCodec.h"
const QString HiFiCodec::NAME = "hifiAC";
const char* HiFiCodec::NAME { "hifiAC" };
void HiFiCodec::init() {
}

View file

@ -16,11 +16,11 @@
class HiFiCodec : public CodecPlugin {
Q_OBJECT
public:
// Plugin functions
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
void init() override;
void deinit() override;
@ -36,7 +36,7 @@ public:
virtual void releaseDecoder(Decoder* decoder) override;
private:
static const QString NAME;
static const char* NAME;
};
#endif // hifi_HiFiCodec_h

View file

@ -27,8 +27,8 @@ Q_LOGGING_CATEGORY(inputplugins, "hifi.inputplugins")
#include <NeuronDataReader.h>
const QString NeuronPlugin::NAME = "Neuron";
const QString NeuronPlugin::NEURON_ID_STRING = "Perception Neuron";
const char* NeuronPlugin::NAME = "Neuron";
const char* NeuronPlugin::NEURON_ID_STRING = "Perception Neuron";
// indices of joints of the Neuron standard skeleton.
// This is 'almost' the same as the High Fidelity standard skeleton.

View file

@ -29,8 +29,8 @@ public:
// Plugin functions
virtual bool isSupported() const override;
virtual const QString& getName() const override { return NAME; }
const QString& getID() const override { return NEURON_ID_STRING; }
virtual const QString getName() const override { return NAME; }
const QString getID() const override { return NEURON_ID_STRING; }
virtual bool activate() override;
virtual void deactivate() override;
@ -65,8 +65,8 @@ protected:
std::shared_ptr<InputDevice> _inputDevice { std::make_shared<InputDevice>() };
static const QString NAME;
static const QString NEURON_ID_STRING;
static const char* NAME;
static const char* NEURON_ID_STRING;
std::string _serverAddress;
int _serverPort;

View file

@ -29,7 +29,7 @@ class Joystick : public QObject, public controller::InputDevice {
public:
using Pointer = std::shared_ptr<Joystick>;
const QString& getName() const { return _name; }
const QString getName() const { return _name; }
SDL_GameController* getGameController() { return _sdlGameController; }

View file

@ -41,7 +41,7 @@ static_assert(
"SDL2 equvalence: Enums and values from StandardControls.h are assumed to match enums from SDL_gamecontroller.h");
const QString SDL2Manager::NAME = "SDL2";
const char* SDL2Manager::NAME = "SDL2";
SDL_JoystickID SDL2Manager::getInstanceId(SDL_GameController* controller) {
SDL_Joystick* joystick = SDL_GameControllerGetJoystick(controller);

View file

@ -20,11 +20,11 @@
class SDL2Manager : public InputPlugin {
Q_OBJECT
public:
// Plugin functions
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
QStringList getSubdeviceNames() override;
bool isHandController() const override { return false; }
@ -39,14 +39,14 @@ public:
void pluginFocusOutEvent() override;
void pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override;
signals:
void joystickAdded(Joystick* joystick);
void joystickRemoved(Joystick* joystick);
private:
SDL_JoystickID getInstanceId(SDL_GameController* controller);
int axisInvalid() const { return SDL_CONTROLLER_AXIS_INVALID; }
int axisLeftX() const { return SDL_CONTROLLER_AXIS_LEFTX; }
int axisLeftY() const { return SDL_CONTROLLER_AXIS_LEFTY; }
@ -55,7 +55,7 @@ private:
int axisTriggerLeft() const { return SDL_CONTROLLER_AXIS_TRIGGERLEFT; }
int axisTriggerRight() const { return SDL_CONTROLLER_AXIS_TRIGGERRIGHT; }
int axisMax() const { return SDL_CONTROLLER_AXIS_MAX; }
int buttonInvalid() const { return SDL_CONTROLLER_BUTTON_INVALID; }
int buttonFaceBottom() const { return SDL_CONTROLLER_BUTTON_A; }
int buttonFaceRight() const { return SDL_CONTROLLER_BUTTON_B; }
@ -73,13 +73,13 @@ private:
int buttonDpadLeft() const { return SDL_CONTROLLER_BUTTON_DPAD_LEFT; }
int buttonDpadRight() const { return SDL_CONTROLLER_BUTTON_DPAD_RIGHT; }
int buttonMax() const { return SDL_CONTROLLER_BUTTON_MAX; }
int buttonPressed() const { return SDL_PRESSED; }
int buttonRelease() const { return SDL_RELEASED; }
QMap<SDL_JoystickID, Joystick::Pointer> _openJoysticks;
bool _isInitialized { false } ;
static const QString NAME;
static const char* NAME;
QStringList _subdeviceNames;
};

View file

@ -55,15 +55,15 @@ bool SixenseManager::_sixenseLoaded = false;
const QString SixenseManager::NAME = "Sixense";
const QString SixenseManager::HYDRA_ID_STRING = "Razer Hydra";
const char* SixenseManager::NAME { "Sixense" };
const char* SixenseManager::HYDRA_ID_STRING { "Razer Hydra" };
const QString MENU_PARENT = "Developer";
const QString MENU_NAME = "Sixense";
const QString MENU_PATH = MENU_PARENT + ">" + MENU_NAME;
const QString TOGGLE_SMOOTH = "Smooth Sixense Movement";
const QString SHOW_DEBUG_RAW = "Debug Draw Raw Data";
const QString SHOW_DEBUG_CALIBRATED = "Debug Draw Calibrated Data";
const char* MENU_PARENT { "Developer" };
const char* MENU_NAME { "Sixense" };
const char* MENU_PATH { "Developer" ">" "Sixense" };
const char* TOGGLE_SMOOTH { "Smooth Sixense Movement" };
const char* SHOW_DEBUG_RAW { "Debug Draw Raw Data" };
const char* SHOW_DEBUG_CALIBRATED { "Debug Draw Calibrated Data" };
bool SixenseManager::isSupported() const {
#if defined(HAVE_SIXENSE) && !defined(Q_OS_OSX)

View file

@ -28,8 +28,8 @@ class SixenseManager : public InputPlugin {
public:
// Plugin functions
virtual bool isSupported() const override;
virtual const QString& getName() const override { return NAME; }
virtual const QString& getID() const override { return HYDRA_ID_STRING; }
virtual const QString getName() const override { return NAME; }
virtual const QString getID() const override { return HYDRA_ID_STRING; }
// Sixense always seems to initialize even if the hydras are not present. Is there
// a way we can properly detect whether the hydras are present?
@ -92,8 +92,8 @@ private:
std::shared_ptr<InputDevice> _inputDevice { std::make_shared<InputDevice>() };
static const QString NAME;
static const QString HYDRA_ID_STRING;
static const char* NAME;
static const char* HYDRA_ID_STRING;
static bool _sixenseLoaded;
};

View file

@ -76,8 +76,8 @@ class SpacemouseManager : public InputPlugin, public QAbstractNativeEventFilter
Q_OBJECT
public:
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString& getID() const override { return NAME; }
const QString getName() const override { return NAME; }
const QString getID() const override { return NAME; }
bool activate() override;
void deactivate() override;
@ -127,7 +127,7 @@ private:
// use to calculate distance traveled since last event
DWORD fLast3dmouseInputTime;
static const QString NAME;
static const char* NAME;
friend class SpacemouseDevice;
};

View file

@ -25,11 +25,11 @@
Q_DECLARE_LOGGING_CATEGORY(oculus)
static const QString MENU_PARENT = "Avatar";
static const QString MENU_NAME = "Oculus Touch Controllers";
static const QString MENU_PATH = MENU_PARENT + ">" + MENU_NAME;
static const char* MENU_PARENT = "Avatar";
static const char* MENU_NAME = "Oculus Touch Controllers";
static const char* MENU_PATH = "Avatar" ">" "Oculus Touch Controllers";
const QString OculusControllerManager::NAME = "Oculus";
const char* OculusControllerManager::NAME = "Oculus";
bool OculusControllerManager::isSupported() const {
return oculusAvailable();

View file

@ -24,7 +24,7 @@ class OculusControllerManager : public InputPlugin {
public:
// Plugin functions
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
bool isHandController() const override { return _touch != nullptr; }
QStringList getSubdeviceNames() override;
@ -95,7 +95,7 @@ private:
ovrInputState _inputState {};
RemoteDevice::Pointer _remote;
TouchDevice::Pointer _touch;
static const QString NAME;
static const char* NAME;
};
#endif // hifi__OculusControllerManager

View file

@ -8,7 +8,7 @@
#include "OculusDebugDisplayPlugin.h"
#include <QtCore/QProcessEnvironment>
const QString OculusDebugDisplayPlugin::NAME("Oculus Rift (Simulator)");
const char* OculusDebugDisplayPlugin::NAME { "Oculus Rift (Simulator)" };
static const QString DEBUG_FLAG("HIFI_DEBUG_OCULUS");
static bool enableDebugOculus = true || QProcessEnvironment::systemEnvironment().contains("HIFI_DEBUG_OCULUS");

View file

@ -11,7 +11,7 @@
class OculusDebugDisplayPlugin : public OculusBaseDisplayPlugin {
public:
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
grouping getGrouping() const override { return DEVELOPER; }
bool isSupported() const override;
@ -20,6 +20,6 @@ protected:
bool isHmdMounted() const override { return true; }
private:
static const QString NAME;
static const char* NAME;
};

View file

@ -19,7 +19,7 @@
#include "OculusHelpers.h"
const QString OculusDisplayPlugin::NAME("Oculus Rift");
const char* OculusDisplayPlugin::NAME { "Oculus Rift" };
static ovrPerfHudMode currentDebugMode = ovrPerfHud_Off;
bool OculusDisplayPlugin::internalActivate() {

View file

@ -13,7 +13,7 @@ class OculusDisplayPlugin : public OculusBaseDisplayPlugin {
using Parent = OculusBaseDisplayPlugin;
public:
~OculusDisplayPlugin();
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
void init() override;
@ -29,7 +29,7 @@ protected:
void cycleDebugOutput() override;
private:
static const QString NAME;
static const char* NAME;
ovrTextureSwapChain _textureSwapChain;
gpu::FramebufferPointer _outputFramebuffer;
bool _customized { false };

View file

@ -30,7 +30,7 @@
#include "OculusHelpers.h"
const QString OculusLegacyDisplayPlugin::NAME("Oculus Rift");
const char* OculusLegacyDisplayPlugin::NAME { "Oculus Rift" };
OculusLegacyDisplayPlugin::OculusLegacyDisplayPlugin() {
}

View file

@ -21,7 +21,7 @@ class OculusLegacyDisplayPlugin : public HmdDisplayPlugin {
public:
OculusLegacyDisplayPlugin();
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
void init() override;
@ -41,9 +41,9 @@ protected:
void uncustomizeContext() override;
void hmdPresent() override;
bool isHmdMounted() const override { return true; }
private:
static const QString NAME;
static const char* NAME;
GLWindow* _hmdWindow{ nullptr };
ovrHmd _hmd;

View file

@ -33,9 +33,9 @@
Q_DECLARE_LOGGING_CATEGORY(displayplugins)
const QString OpenVrDisplayPlugin::NAME("OpenVR (Vive)");
const QString StandingHMDSensorMode = "Standing HMD Sensor Mode"; // this probably shouldn't be hardcoded here
const QString OpenVrThreadedSubmit = "OpenVR Threaded Submit"; // this probably shouldn't be hardcoded here
const char* OpenVrDisplayPlugin::NAME { "OpenVR (Vive)" };
const char* StandingHMDSensorMode { "Standing HMD Sensor Mode" }; // this probably shouldn't be hardcoded here
const char* OpenVrThreadedSubmit { "OpenVR Threaded Submit" }; // this probably shouldn't be hardcoded here
PoseData _nextRenderPoseData;
PoseData _nextSimPoseData;

View file

@ -36,7 +36,7 @@ class OpenVrDisplayPlugin : public HmdDisplayPlugin {
using Parent = HmdDisplayPlugin;
public:
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
void init() override;
@ -72,7 +72,7 @@ private:
vr::IVRSystem* _system { nullptr };
std::atomic<vr::EDeviceActivityLevel> _hmdActivityLevel { vr::k_EDeviceActivityLevel_Unknown };
std::atomic<uint32_t> _keyboardSupressionCount{ 0 };
static const QString NAME;
static const char* NAME;
vr::HmdMatrix34_t _lastGoodHMDPose;
mat4 _sensorResetMat;

View file

@ -37,12 +37,12 @@ void releaseOpenVrSystem();
static const char* CONTROLLER_MODEL_STRING = "vr_controller_05_wireless_b";
static const QString MENU_PARENT = "Avatar";
static const QString MENU_NAME = "Vive Controllers";
static const QString MENU_PATH = MENU_PARENT + ">" + MENU_NAME;
static const QString RENDER_CONTROLLERS = "Render Hand Controllers";
static const char* MENU_PARENT = "Avatar";
static const char* MENU_NAME = "Vive Controllers";
static const char* MENU_PATH = "Avatar" ">" "Vive Controllers";
static const char* RENDER_CONTROLLERS = "Render Hand Controllers";
const QString ViveControllerManager::NAME = "OpenVR";
const char* ViveControllerManager::NAME { "OpenVR" };
bool ViveControllerManager::isSupported() const {
return openVrSupported();

View file

@ -33,7 +33,7 @@ class ViveControllerManager : public InputPlugin {
public:
// Plugin functions
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
bool isHandController() const override { return true; }
@ -125,7 +125,7 @@ private:
vr::IVRSystem* _system { nullptr };
std::shared_ptr<InputDevice> _inputDevice { std::make_shared<InputDevice>(_system) };
static const QString NAME;
static const char* NAME;
};
#endif // hifi__ViveControllerManager

View file

@ -15,7 +15,7 @@
#include "PCMCodecManager.h"
const QString PCMCodec::NAME = "pcm";
const char* PCMCodec::NAME { "pcm" };
void PCMCodec::init() {
}
@ -55,7 +55,7 @@ void PCMCodec::releaseDecoder(Decoder* decoder) {
// do nothing
}
const QString zLibCodec::NAME = "zlib";
const char* zLibCodec::NAME { "zlib" };
void zLibCodec::init() {
}

View file

@ -16,11 +16,11 @@
class PCMCodec : public CodecPlugin, public Encoder, public Decoder {
Q_OBJECT
public:
// Plugin functions
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
void init() override;
void deinit() override;
@ -45,7 +45,7 @@ public:
virtual void trackLostFrames(int numFrames) override { }
private:
static const QString NAME;
static const char* NAME;
};
class zLibCodec : public CodecPlugin, public Encoder, public Decoder {
@ -54,7 +54,7 @@ class zLibCodec : public CodecPlugin, public Encoder, public Decoder {
public:
// Plugin functions
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
void init() override;
void deinit() override;
@ -80,7 +80,7 @@ public:
virtual void trackLostFrames(int numFrames) override { }
private:
static const QString NAME;
static const char* NAME;
};
#endif // hifi__PCMCodecManager_h

View file

@ -137,10 +137,10 @@ function updateOverlays() {
isFacingAvatar: true,
drawInFront: true
});
modOverlays[avatarID]=[newKickOverlay];
if (Users.canKick) {
if (Users.canKick) {
var newMuteOverlay = Overlays.addOverlay("image3d", {
url: muteOverlayURL(),
position: muteOverlayPosition,
@ -166,11 +166,11 @@ AvatarList.avatarRemovedEvent.connect(function(avatarID){
if (isShowingOverlays) {
// we are currently showing overlays and an avatar just went away
// first remove the rendered overlay
for (var overlay in modOverlays[avatarID]) {
Overlays.deleteOverlay(overlay);
// first remove the rendered overlays
for (var j = 0; j < modOverlays[avatarID].length; ++j) {
Overlays.deleteOverlay(modOverlays[avatarID][j]);
}
// delete the saved ID of the overlay from our mod overlays object
delete modOverlays[avatarID];
}
@ -193,7 +193,7 @@ function handleSelectedOverlay(clickedOverlay) {
Users.ignore(avatarID);
}
// cleanup of the overlay is handled by the connection to avatarRemovedEvent
} else if (muteOverlay && clickedOverlay.overlayID == muteOverlay) {
Users.mute(avatarID);
}