switch calls to printLog to QDebug

This commit is contained in:
Stephen Birarda 2013-07-16 11:07:22 -07:00
parent d38955aa63
commit afe49bc756
54 changed files with 420 additions and 455 deletions

View file

@ -14,7 +14,7 @@ include_glm(${TARGET_NAME} ${ROOT_DIR})
include(${MACRO_DIR}/SetupHifiProject.cmake)
setup_hifi_project(${TARGET_NAME})
setup_hifi_project(${TARGET_NAME} TRUE)
# link in the shared library
include(${MACRO_DIR}/LinkHifiLibrary.cmake)

View file

@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake
set(TARGET_NAME audio-mixer)
include(${MACRO_DIR}/SetupHifiProject.cmake)
setup_hifi_project(${TARGET_NAME})
setup_hifi_project(${TARGET_NAME} TRUE)
# set up the external glm library
include(${MACRO_DIR}/IncludeGLM.cmake)

View file

@ -10,7 +10,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake
# setup the project
include(${MACRO_DIR}/SetupHifiProject.cmake)
setup_hifi_project(${TARGET_NAME})
setup_hifi_project(${TARGET_NAME} TRUE)
# include glm
include(${MACRO_DIR}/IncludeGLM.cmake)

View file

@ -1,9 +1,15 @@
MACRO(SETUP_HIFI_LIBRARY TARGET)
project(${TARGET_NAME})
project(${TARGET})
# grab the implemenation and header files
file(GLOB LIB_SRCS src/*.h src/*.cpp)
# create a library and set the property so it can be referenced later
add_library(${TARGET_NAME} ${LIB_SRCS})
add_library(${TARGET} ${LIB_SRCS})
find_package(Qt4 REQUIRED QtCore)
include(${QT_USE_FILE})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${QT_QTGUI_INCLUDE_DIR}")
target_link_libraries(${TARGET} ${QT_LIBRARIES})
ENDMACRO(SETUP_HIFI_LIBRARY _target)

View file

@ -1,4 +1,4 @@
MACRO(SETUP_HIFI_PROJECT TARGET)
MACRO(SETUP_HIFI_PROJECT TARGET INCLUDE_QT)
project(${TARGET})
# grab the implemenation and header files
@ -6,4 +6,12 @@ MACRO(SETUP_HIFI_PROJECT TARGET)
# add the executable
add_executable(${TARGET} ${TARGET_SRCS})
ENDMACRO(SETUP_HIFI_PROJECT _target)
IF (${INCLUDE_QT})
find_package(Qt4 REQUIRED QtCore)
include(${QT_USE_FILE})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${QT_QTGUI_INCLUDE_DIR}")
ENDIF()
target_link_libraries(${TARGET} ${QT_LIBRARIES})
ENDMACRO(SETUP_HIFI_PROJECT _target _include_qt)

View file

@ -6,7 +6,7 @@ set(MACRO_DIR ${ROOT_DIR}/cmake/macros)
set(TARGET_NAME domain-server)
include(${MACRO_DIR}/SetupHifiProject.cmake)
setup_hifi_project(${TARGET_NAME})
setup_hifi_project(${TARGET_NAME} TRUE)
# link the shared hifi library
include(${MACRO_DIR}/LinkHifiLibrary.cmake)

View file

@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake
set(TARGET_NAME eve)
include(${MACRO_DIR}/SetupHifiProject.cmake)
setup_hifi_project(${TARGET_NAME})
setup_hifi_project(${TARGET_NAME} TRUE)
include(${MACRO_DIR}/IncludeGLM.cmake)
include_glm(${TARGET_NAME} ${ROOT_DIR})

View file

@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake
set(TARGET_NAME injector)
include(${MACRO_DIR}/SetupHifiProject.cmake)
setup_hifi_project(${TARGET_NAME})
setup_hifi_project(${TARGET_NAME} TRUE)
# set up the external glm library
include(${MACRO_DIR}/IncludeGLM.cmake)

View file

@ -210,7 +210,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
{
_applicationStartupTime = startup_time;
_window->setWindowTitle("Interface");
printLog("Interface Startup:\n");
qDebug("Interface Startup:\n");
unsigned int listenPort = 0; // bind to an ephemeral port by default
const char** constArgv = const_cast<const char**>(argv);
@ -233,7 +233,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
// Handle Local Domain testing with the --local command line
if (cmdOptionExists(argc, constArgv, "--local")) {
printLog("Local Domain MODE!\n");
qDebug("Local Domain MODE!\n");
NodeList::getInstance()->setDomainIPToLocalhost();
}
@ -297,7 +297,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
}
void Application::initializeGL() {
printLog( "Created Display Window.\n" );
qDebug( "Created Display Window.\n" );
// initialize glut for shape drawing; Qt apparently initializes it on OS X
#ifndef __APPLE__
@ -312,10 +312,10 @@ void Application::initializeGL() {
_viewFrustumOffsetCamera.setFarClip(500.0 * TREE_SCALE);
initDisplay();
printLog( "Initialized Display.\n" );
qDebug( "Initialized Display.\n" );
init();
printLog( "Init() complete.\n" );
qDebug( "Init() complete.\n" );
// Check to see if the user passed in a command line option for randomizing colors
bool wantColorRandomizer = !arguments().contains("--NoColorRandomizer");
@ -324,13 +324,13 @@ void Application::initializeGL() {
// Voxel File. If so, load it now.
if (!_voxelsFilename.isEmpty()) {
_voxels.loadVoxelsFile(_voxelsFilename.constData(), wantColorRandomizer);
printLog("Local Voxel File loaded.\n");
qDebug("Local Voxel File loaded.\n");
}
// create thread for receipt of data via UDP
if (_enableNetworkThread) {
pthread_create(&_networkReceiveThread, NULL, networkReceive, NULL);
printLog("Network receive thread created.\n");
qDebug("Network receive thread created.\n");
}
// call terminate before exiting
@ -352,7 +352,7 @@ void Application::initializeGL() {
_justStarted = false;
char title[50];
sprintf(title, "Interface: %4.2f seconds\n", startupTime);
printLog("%s", title);
qDebug("%s", title);
_window->setWindowTitle(title);
const char LOGSTASH_INTERFACE_START_TIME_KEY[] = "interface-start-time";
@ -1446,7 +1446,7 @@ void Application::importVoxels() {
if (fileNameString.endsWith(".png", Qt::CaseInsensitive)) {
QImage pngImage = QImage(fileName);
if (pngImage.height() != pngImage.width()) {
printLog("ERROR: Bad PNG size: height != width.\n");
qDebug("ERROR: Bad PNG size: height != width.\n");
return;
}
@ -1758,7 +1758,7 @@ void Application::init() {
_audio.setJitterBufferSamples(_audioJitterBufferSamples);
}
printLog("Loaded settings.\n");
qDebug("Loaded settings.\n");
sendAvatarVoxelURLMessage(_myAvatar.getVoxels()->getVoxelURL());
@ -2771,7 +2771,7 @@ glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) {
// render the coverage map on screen
void Application::renderCoverageMapV2() {
//printLog("renderCoverageMap()\n");
//qDebug("renderCoverageMap()\n");
glDisable(GL_LIGHTING);
glLineWidth(2.0);
@ -2816,7 +2816,7 @@ void Application::renderCoverageMapsV2Recursively(CoverageMapV2* map) {
// render the coverage map on screen
void Application::renderCoverageMap() {
//printLog("renderCoverageMap()\n");
//qDebug("renderCoverageMap()\n");
glDisable(GL_LIGHTING);
glLineWidth(2.0);
@ -3147,7 +3147,7 @@ void Application::eyedropperVoxelUnderCursor() {
}
void Application::goHome() {
printLog("Going Home!\n");
qDebug("Going Home!\n");
_myAvatar.setPosition(START_LOCATION);
}

View file

@ -21,27 +21,28 @@
#include <NodeList.h>
#include "BandwidthMeter.h"
#include "ui/BandwidthDialog.h"
#ifndef _WIN32
#include "Audio.h"
#endif
#include "Avatar.h"
#include "BandwidthMeter.h"
#include "Camera.h"
#include "Environment.h"
#include "HandControl.h"
#include "PacketHeaders.h"
#include "ParticleSystem.h"
#include "renderer/GeometryCache.h"
#include "SerialInterface.h"
#include "Stars.h"
#include "Swatch.h"
#include "ToolsPalette.h"
#include "ui/ChatEntry.h"
#include "ui/BandwidthDialog.h"
#include "ViewFrustum.h"
#include "VoxelSystem.h"
#include "PacketHeaders.h"
#include "Webcam.h"
#include "renderer/GeometryCache.h"
#include "ui/ChatEntry.h"
#include "ToolsPalette.h"
#include "Swatch.h"
#include "ParticleSystem.h"
class QAction;
class QActionGroup;

View file

@ -7,24 +7,25 @@
//
#ifndef _WIN32
#include <iostream>
#include <cstring>
#include <fstream>
#include <iostream>
#include <pthread.h>
#include <sys/stat.h>
#include <cstring>
#include <StdDev.h>
#include <UDPSocket.h>
#include <SharedUtil.h>
#include <PacketHeaders.h>
#include <AngleUtil.h>
#include <NodeList.h>
#include <NodeTypes.h>
#include <AngleUtil.h>
#include <PacketHeaders.h>
#include <SharedUtil.h>
#include <StdDev.h>
#include <UDPSocket.h>
#include "Application.h"
#include "Audio.h"
#include "Util.h"
#include "Log.h"
// Uncomment the following definition to test audio device latency by copying output to input
//#define TEST_AUDIO_LOOPBACK
@ -151,7 +152,7 @@ inline void Audio::performIO(int16_t* inputLeft, int16_t* outputLeft, int16_t* o
// If not enough audio has arrived to start playback, keep waiting
//
#ifdef SHOW_AUDIO_DEBUG
printLog("%i,%i,%i,%i\n",
qDebug("%i,%i,%i,%i\n",
_packetsReceivedThisPlayback,
ringBuffer->diffLastWriteNextOutput(),
PACKET_LENGTH_SAMPLES,
@ -168,7 +169,7 @@ inline void Audio::performIO(int16_t* inputLeft, int16_t* outputLeft, int16_t* o
_packetsReceivedThisPlayback = 0;
_wasStarved = 10; // Frames for which to render the indication that the system was starved.
#ifdef SHOW_AUDIO_DEBUG
printLog("Starved, remaining samples = %d\n",
qDebug("Starved, remaining samples = %d\n",
ringBuffer->diffLastWriteNextOutput());
#endif
@ -179,7 +180,7 @@ inline void Audio::performIO(int16_t* inputLeft, int16_t* outputLeft, int16_t* o
if (!ringBuffer->isStarted()) {
ringBuffer->setStarted(true);
#ifdef SHOW_AUDIO_DEBUG
printLog("starting playback %0.1f msecs delayed, jitter = %d, pkts recvd: %d \n",
qDebug("starting playback %0.1f msecs delayed, jitter = %d, pkts recvd: %d \n",
(usecTimestampNow() - usecTimestamp(&_firstPacketReceivedTime))/1000.0,
_jitterBufferSamples,
_packetsReceivedThisPlayback);
@ -299,8 +300,8 @@ int Audio::audioCallback (const void* inputBuffer,
static void outputPortAudioError(PaError error) {
if (error != paNoError) {
printLog("-- portaudio termination error --\n");
printLog("PortAudio error (%d): %s\n", error, Pa_GetErrorText(error));
qDebug("-- portaudio termination error --\n");
qDebug("PortAudio error (%d): %s\n", error, Pa_GetErrorText(error));
}
}
@ -349,7 +350,7 @@ Audio::Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples) :
outputParameters.device = Pa_GetDefaultOutputDevice();
if (inputParameters.device == -1 || outputParameters.device == -1) {
printLog("Audio: Missing device.\n");
qDebug("Audio: Missing device.\n");
outputPortAudioError(Pa_Terminate());
return;
}
@ -384,12 +385,12 @@ Audio::Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples) :
outputPortAudioError(Pa_StartStream(_stream));
// Uncomment these lines to see the system-reported latency
//printLog("Default low input, output latency (secs): %0.4f, %0.4f\n",
//qDebug("Default low input, output latency (secs): %0.4f, %0.4f\n",
// Pa_GetDeviceInfo(Pa_GetDefaultInputDevice())->defaultLowInputLatency,
// Pa_GetDeviceInfo(Pa_GetDefaultOutputDevice())->defaultLowOutputLatency);
const PaStreamInfo* streamInfo = Pa_GetStreamInfo(_stream);
printLog("Started audio with reported latency msecs In/Out: %.0f, %.0f\n", streamInfo->inputLatency * 1000.f,
qDebug("Started audio with reported latency msecs In/Out: %.0f, %.0f\n", streamInfo->inputLatency * 1000.f,
streamInfo->outputLatency * 1000.f);
gettimeofday(&_lastReceiveTime, NULL);
@ -650,7 +651,7 @@ inline void Audio::eventuallySendRecvPing(int16_t* inputLeft, int16_t* outputLef
// As of the next frame, we'll be recoding PING_FRAMES_TO_RECORD from
// the mic (pointless to start now as we can't record unsent audio).
_isSendingEchoPing = false;
printLog("Send audio ping\n");
qDebug("Send audio ping\n");
} else if (_pingFramesToRecord > 0) {
@ -664,7 +665,7 @@ inline void Audio::eventuallySendRecvPing(int16_t* inputLeft, int16_t* outputLef
if (_pingFramesToRecord == 0) {
_pingAnalysisPending = true;
printLog("Received ping echo\n");
qDebug("Received ping echo\n");
}
}
}
@ -688,25 +689,25 @@ inline void Audio::analyzePing() {
// Determine extrema
int botAt = findExtremum(_echoSamplesLeft, PING_SAMPLES_TO_ANALYZE, -1);
if (botAt == -1) {
printLog("Audio Ping: Minimum not found.\n");
qDebug("Audio Ping: Minimum not found.\n");
return;
}
int topAt = findExtremum(_echoSamplesLeft, PING_SAMPLES_TO_ANALYZE, 1);
if (topAt == -1) {
printLog("Audio Ping: Maximum not found.\n");
qDebug("Audio Ping: Maximum not found.\n");
return;
}
// Determine peak amplitude - warn if low
int ampli = (_echoSamplesLeft[topAt] - _echoSamplesLeft[botAt]) / 2;
if (ampli < PING_MIN_AMPLI) {
printLog("Audio Ping unreliable - low amplitude %d.\n", ampli);
qDebug("Audio Ping unreliable - low amplitude %d.\n", ampli);
}
// Determine period - warn if doesn't look like our signal
int halfPeriod = abs(topAt - botAt);
if (abs(halfPeriod-PING_HALF_PERIOD) > PING_MAX_PERIOD_DIFFERENCE) {
printLog("Audio Ping unreliable - peak distance %d vs. %d\n", halfPeriod, PING_HALF_PERIOD);
qDebug("Audio Ping unreliable - peak distance %d vs. %d\n", halfPeriod, PING_HALF_PERIOD);
}
// Ping is sent:
@ -747,7 +748,7 @@ inline void Audio::analyzePing() {
int delay = (botAt + topAt) / 2 + PING_PERIOD;
printLog("\n| Audio Ping results:\n+----- ---- --- - - - - -\n\n"
qDebug("\n| Audio Ping results:\n+----- ---- --- - - - - -\n\n"
"Delay = %d samples (%d ms)\nPeak amplitude = %d\n\n",
delay, (delay * 1000) / int(SAMPLE_RATE), ampli);
}

View file

@ -14,7 +14,6 @@
#include <StdDev.h>
#include "Oscilloscope.h"
#include "Avatar.h"
static const int NUM_AUDIO_CHANNELS = 2;

View file

@ -5,24 +5,25 @@
// Created by Philip Rosedale on 9/11/12.
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
#include <vector>
#include <glm/glm.hpp>
#include <glm/gtx/quaternion.hpp>
#include <glm/gtx/vector_angle.hpp>
#include <vector>
#include <NodeList.h>
#include <NodeTypes.h>
#include <OculusManager.h>
#include <PacketHeaders.h>
#include <SharedUtil.h>
#include "world.h"
#include "Application.h"
#include "Avatar.h"
#include "Hand.h"
#include "Head.h"
#include "Log.h"
#include "Physics.h"
#include "world.h"
#include "ui/TextRenderer.h"
#include <NodeList.h>
#include <NodeTypes.h>
#include <PacketHeaders.h>
#include <OculusManager.h>
using namespace std;

View file

@ -10,18 +10,21 @@
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <AvatarData.h>
#include <QSettings>
#include "world.h"
#include <AvatarData.h>
#include "AvatarTouch.h"
#include "AvatarVoxelSystem.h"
#include "InterfaceConfig.h"
#include "SerialInterface.h"
#include "Balls.h"
#include "Hand.h"
#include "Head.h"
#include "InterfaceConfig.h"
#include "Skeleton.h"
#include "SerialInterface.h"
#include "Transmitter.h"
#include "world.h"
const float BODY_BALL_RADIUS_PELVIS = 0.07;
const float BODY_BALL_RADIUS_TORSO = 0.065;

View file

@ -93,7 +93,7 @@ const Mode MODES[] = {
void AvatarVoxelSystem::cycleMode() {
_mode = (_mode + 1) % (sizeof(MODES) / sizeof(MODES[0]));
printLog("Voxeltar bind mode %d.\n", _mode);
qDebug("Voxeltar bind mode %d.\n", _mode);
// rebind
QUrl url = _voxelURL;
@ -255,7 +255,7 @@ void AvatarVoxelSystem::handleVoxelDownloadProgress(qint64 bytesReceived, qint64
}
void AvatarVoxelSystem::handleVoxelReplyError() {
printLog("%s\n", _voxelReply->errorString().toAscii().constData());
qDebug("%s\n", _voxelReply->errorString().toAscii().constData());
_voxelReply->disconnect(this);
_voxelReply->deleteLater();

View file

@ -9,7 +9,6 @@
#include "BandwidthMeter.h"
#include "InterfaceConfig.h"
#include "Log.h"
#include "Util.h"
namespace { // .cpp-local

View file

@ -5,9 +5,10 @@
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
#include <glm/gtx/quaternion.hpp>
#include <SharedUtil.h>
#include <VoxelConstants.h>
#include "Log.h"
#include "Camera.h"
#include "Util.h"

View file

@ -26,9 +26,7 @@ LogDisplay LogDisplay::instance;
// State management
//
LogDisplay::LogDisplay() :
LogDisplay::LogDisplay() :
_textRenderer(SANS_FONT_FAMILY, -1, -1, false, TextRenderer::SHADOW_EFFECT),
_stream(DEFAULT_STREAM),
_chars(0l),
@ -53,8 +51,6 @@ LogDisplay::LogDisplay() :
memset(_lines, 0, LINE_BUFFER_SIZE * sizeof(char*));
setCharacterSize(DEFAULT_CHAR_WIDTH, DEFAULT_CHAR_HEIGHT);
printLog = & printLogHandler;
}
@ -92,31 +88,6 @@ void LogDisplay::setCharacterSize(unsigned width, unsigned height) {
// Logging
//
int LogDisplay::printLogHandler(char const* fmt, ...) {
va_list args;
int n;
char buf[MAX_MESSAGE_LENGTH];
va_start(args,fmt);
// print to buffer
n = vsnprintf(buf, MAX_MESSAGE_LENGTH, fmt, args);
if (n > 0) {
// all fine? log the message
instance.addMessage(buf);
} else {
// error? -> mutter on stream or stderr
fprintf(instance._stream != 0l ? instance._stream : stderr,
"Log: Failed to log message with format string = \"%s\".\n", fmt);
}
va_end(args);
return n;
}
inline void LogDisplay::addMessage(char const* ptr) {
pthread_mutex_lock(& _mutex);

View file

@ -12,7 +12,6 @@
#include <stdarg.h>
#include <pthread.h>
#include "Log.h"
#include "ui/TextRenderer.h"
class LogDisplay {
@ -21,6 +20,9 @@ public:
static LogDisplay instance;
void render(unsigned screenWidth, unsigned screenHeight);
// log formatted message
inline void addMessage(char const*);
// settings
@ -50,12 +52,6 @@ private:
LogDisplay(LogDisplay const&); // = delete;
LogDisplay& operator=(LogDisplay const&); // = delete;
// format and log message - entrypoint used to replace global 'printLog'
static int printLogHandler(char const* fmt, ...);
// log formatted message (called by printLogHandler)
inline void addMessage(char const*);
TextRenderer _textRenderer;
FILE* _stream; // FILE as secondary destination for log messages
char* _chars; // character buffer base address

View file

@ -36,6 +36,28 @@ const int LONG_TERM_RATE_SAMPLES = 1000;
const bool USING_INVENSENSE_MPU9150 = 1;
SerialInterface::SerialInterface() :
_active(false),
_gravity(0, 0, 0),
_averageRotationRates(0, 0, 0),
_averageAcceleration(0, 0, 0),
_estimatedRotation(0, 0, 0),
_estimatedPosition(0, 0, 0),
_estimatedVelocity(0, 0, 0),
_lastAcceleration(0, 0, 0),
_lastRotationRates(0, 0, 0),
_compassMinima(-211, -132, -186),
_compassMaxima(89, 95, 98),
_angularVelocityToLinearAccel(0.003f, -0.001f, -0.006f,
-0.005f, -0.001f, -0.006f,
0.010f, 0.004f, 0.007f),
_angularAccelToLinearAccel(0.0f, 0.0f, 0.002f,
0.0f, 0.0f, 0.001f,
-0.002f, -0.002f, 0.0f)
{
}
void SerialInterface::pair() {
#ifndef _WIN32
@ -75,10 +97,10 @@ void SerialInterface::initializePort(char* portname) {
#ifndef _WIN32
_serialDescriptor = open(portname, O_RDWR | O_NOCTTY | O_NDELAY);
printLog("Opening SerialUSB %s: ", portname);
qDebug("Opening SerialUSB %s: ", portname);
if (_serialDescriptor == -1) {
printLog("Failed.\n");
qDebug("Failed.\n");
return;
}
@ -112,7 +134,7 @@ void SerialInterface::initializePort(char* portname) {
mpu_set_sensors(INV_XYZ_GYRO | INV_XYZ_ACCEL | INV_XYZ_COMPASS);
}
printLog("Connected.\n");
qDebug("Connected.\n");
resetSerial();
_active = true;
@ -351,7 +373,7 @@ void SerialInterface::readData(float deltaTime) {
gettimeofday(&now, NULL);
if (diffclock(&lastGoodRead, &now) > NO_READ_MAXIMUM_MSECS) {
printLog("No data - Shutting down SerialInterface.\n");
qDebug("No data - Shutting down SerialInterface.\n");
resetSerial();
}
} else {

View file

@ -1,17 +1,14 @@
//
// SerialInterface.h
//
// hifi
//
// Created by Stephen Birarda on 2/15/13.
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
//
#ifndef __interface__SerialInterface__
#define __interface__SerialInterface__
#include <glm/glm.hpp>
#include "Util.h"
#include "world.h"
#include "InterfaceConfig.h"
#include "Log.h"
// These includes are for serial port reading/writing
#ifndef _WIN32
#include <unistd.h>
@ -20,30 +17,16 @@
#include <dirent.h>
#endif
#include <glm/glm.hpp>
#include "InterfaceConfig.h"
#include "Util.h"
extern const bool USING_INVENSENSE_MPU9150;
class SerialInterface {
public:
SerialInterface() : _active(false),
_gravity(0, 0, 0),
_averageRotationRates(0, 0, 0),
_averageAcceleration(0, 0, 0),
_estimatedRotation(0, 0, 0),
_estimatedPosition(0, 0, 0),
_estimatedVelocity(0, 0, 0),
_lastAcceleration(0, 0, 0),
_lastRotationRates(0, 0, 0),
_compassMinima(-211, -132, -186),
_compassMaxima(89, 95, 98),
_angularVelocityToLinearAccel(
0.003f, -0.001f, -0.006f,
-0.005f, -0.001f, -0.006f,
0.010f, 0.004f, 0.007f),
_angularAccelToLinearAccel(
0.0f, 0.0f, 0.002f,
0.0f, 0.0f, 0.001f,
-0.002f, -0.002f, 0.0f)
{}
SerialInterface();
void pair();
void readData(float deltaTime);

View file

@ -13,11 +13,9 @@
#include <PacketHeaders.h>
#include "InterfaceConfig.h"
#include "Log.h"
#include "Transmitter.h"
#include "Util.h"
const float DELTA_TIME = 1.f / 60.f;
const float DECAY_RATE = 0.15f;
@ -40,7 +38,7 @@ void Transmitter::checkForLostTransmitter() {
int msecsSinceLast = diffclock(_lastReceivedPacket, &now);
if (msecsSinceLast > TIME_TO_ASSUME_LOST_MSECS) {
resetLevels();
printLog("Transmitter signal lost.\n");
qDebug("Transmitter signal lost.\n");
}
}
}
@ -95,12 +93,12 @@ void Transmitter::processIncomingData(unsigned char* packetData, int numBytes) {
_estimatedRotation.y *= (1.f - DECAY_RATE * DELTA_TIME);
if (!_isConnected) {
printLog("Transmitter Connected.\n");
qDebug("Transmitter Connected.\n");
_isConnected = true;
_estimatedRotation *= 0.0;
}
} else {
printLog("Transmitter packet read error, %d bytes.\n", numBytes);
qDebug("Transmitter packet read error, %d bytes.\n", numBytes);
}
}

View file

@ -6,7 +6,6 @@
// Copyright (c) 2012 High Fidelity, Inc. All rights reserved.
//
#include "InterfaceConfig.h"
#include <iostream>
#include <cstring>
#include <time.h>
@ -15,16 +14,16 @@
#include <glm/glm.hpp>
#include <glm/gtc/noise.hpp>
#include <glm/gtx/quaternion.hpp>
#include <AvatarData.h>
#include <SharedUtil.h>
#include "Log.h"
#include "InterfaceConfig.h"
#include "ui/TextRenderer.h"
#include "world.h"
#include "Util.h"
#include "VoxelConstants.h"
#include "world.h"
#include "Util.h"
using namespace std;
@ -452,7 +451,7 @@ void renderOrientationDirections(glm::vec3 position, const glm::quat& orientatio
bool closeEnoughForGovernmentWork(float a, float b) {
float distance = std::abs(a-b);
//printLog("closeEnoughForGovernmentWork() a=%1.10f b=%1.10f distance=%1.10f\n",a,b,distance);
//qDebug("closeEnoughForGovernmentWork() a=%1.10f b=%1.10f distance=%1.10f\n",a,b,distance);
return (distance < 0.00001f);
}
@ -470,7 +469,7 @@ void runTimingTests() {
gettimeofday(&endTime, NULL);
}
elapsedMsecs = diffclock(&startTime, &endTime);
printLog("gettimeofday() usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
qDebug("gettimeofday() usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
// Random number generation
gettimeofday(&startTime, NULL);
@ -479,7 +478,7 @@ void runTimingTests() {
}
gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime);
printLog("rand() stored in array usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
qDebug("rand() stored in array usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
// Random number generation using randFloat()
gettimeofday(&startTime, NULL);
@ -488,7 +487,7 @@ void runTimingTests() {
}
gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime);
printLog("randFloat() stored in array usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
qDebug("randFloat() stored in array usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
// PowF function
fTest = 1145323.2342f;
@ -498,7 +497,7 @@ void runTimingTests() {
}
gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime);
printLog("powf(f, 0.5) usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
qDebug("powf(f, 0.5) usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
// Vector Math
float distance;
@ -511,7 +510,7 @@ void runTimingTests() {
}
gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime);
printLog("vector math usecs: %f [%f msecs total for %d tests]\n",
qDebug("vector math usecs: %f [%f msecs total for %d tests]\n",
1000.0f * elapsedMsecs / (float) numTests, elapsedMsecs, numTests);
// Vec3 test
@ -525,7 +524,7 @@ void runTimingTests() {
}
gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime);
printLog("vec3 assign and dot() usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
qDebug("vec3 assign and dot() usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
}

View file

@ -5,28 +5,31 @@
// Created by Philip on 12/31/12.
// Copyright (c) 2012 High Fidelity, Inc. All rights reserved.
//
#ifdef _WIN32
#define _timeval_
#define _USE_MATH_DEFINES
#endif
#include <cstring>
#include <cmath>
#include <iostream> // to load voxels from file
#include <fstream> // to load voxels from file
#include <pthread.h>
#include <glm/gtc/random.hpp>
#include <SharedUtil.h>
#include <OctalCode.h>
#include <PacketHeaders.h>
#include <PerfStat.h>
#include <OctalCode.h>
#include <pthread.h>
#include <SharedUtil.h>
#include "Application.h"
#include "Log.h"
#include "VoxelConstants.h"
#include "CoverageMap.h"
#include "CoverageMapV2.h"
#include "InterfaceConfig.h"
#include "renderer/ProgramObject.h"
#include "VoxelConstants.h"
#include "VoxelSystem.h"
float identityVertices[] = { 0,0,0, 1,0,0, 1,1,0, 0,1,0, 0,0,1, 1,0,1, 1,1,1, 0,1,1,
@ -141,16 +144,16 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) {
int commandLength = strlen(command); // commands are null terminated strings
int totalLength = 1+commandLength+1;
printLog("got Z message len(%d)= %s\n", numBytes, command);
qDebug("got Z message len(%d)= %s\n", numBytes, command);
while (totalLength <= numBytes) {
if (0==strcmp(command,(char*)"erase all")) {
printLog("got Z message == erase all\n");
qDebug("got Z message == erase all\n");
_tree->eraseAllVoxels();
_voxelsInReadArrays = _voxelsInWriteArrays = 0; // better way to do this??
}
if (0==strcmp(command,(char*)"add scene")) {
printLog("got Z message == add scene - NOT SUPPORTED ON INTERFACE\n");
qDebug("got Z message == add scene - NOT SUPPORTED ON INTERFACE\n");
}
totalLength += commandLength+1;
}
@ -705,7 +708,7 @@ bool VoxelSystem::randomColorOperation(VoxelNode* node, void* extraData) {
void VoxelSystem::randomizeVoxelColors() {
_nodeCount = 0;
_tree->recurseTreeWithOperation(randomColorOperation);
printLog("setting randomized true color for %d nodes\n", _nodeCount);
qDebug("setting randomized true color for %d nodes\n", _nodeCount);
setupNewVoxelsForDrawing();
}
@ -719,7 +722,7 @@ bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, void* extraData)
void VoxelSystem::falseColorizeRandom() {
_nodeCount = 0;
_tree->recurseTreeWithOperation(falseColorizeRandomOperation);
printLog("setting randomized false color for %d nodes\n", _nodeCount);
qDebug("setting randomized false color for %d nodes\n", _nodeCount);
setupNewVoxelsForDrawing();
}
@ -733,7 +736,7 @@ void VoxelSystem::trueColorize() {
PerformanceWarning warn(true, "trueColorize()",true);
_nodeCount = 0;
_tree->recurseTreeWithOperation(trueColorizeOperation);
printLog("setting true color for %d nodes\n", _nodeCount);
qDebug("setting true color for %d nodes\n", _nodeCount);
setupNewVoxelsForDrawing();
}
@ -753,7 +756,7 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, void* extraData)
void VoxelSystem::falseColorizeInView(ViewFrustum* viewFrustum) {
_nodeCount = 0;
_tree->recurseTreeWithOperation(falseColorizeInViewOperation,(void*)viewFrustum);
printLog("setting in view false color for %d nodes\n", _nodeCount);
qDebug("setting in view false color for %d nodes\n", _nodeCount);
setupNewVoxelsForDrawing();
}
@ -803,10 +806,10 @@ void VoxelSystem::falseColorizeDistanceFromView(ViewFrustum* viewFrustum) {
_maxDistance = 0.0;
_minDistance = FLT_MAX;
_tree->recurseTreeWithOperation(getDistanceFromViewRangeOperation,(void*)viewFrustum);
printLog("determining distance range for %d nodes\n", _nodeCount);
qDebug("determining distance range for %d nodes\n", _nodeCount);
_nodeCount = 0;
_tree->recurseTreeWithOperation(falseColorizeDistanceFromViewOperation,(void*)viewFrustum);
printLog("setting in distance false color for %d nodes\n", _nodeCount);
qDebug("setting in distance false color for %d nodes\n", _nodeCount);
setupNewVoxelsForDrawing();
}
@ -918,7 +921,7 @@ void VoxelSystem::removeOutOfView() {
}
bool showRemoveDebugDetails = false;
if (showRemoveDebugDetails) {
printLog("removeOutOfView() scanned=%ld removed=%ld inside=%ld intersect=%ld outside=%ld _removedVoxels.count()=%d \n",
qDebug("removeOutOfView() scanned=%ld removed=%ld inside=%ld intersect=%ld outside=%ld _removedVoxels.count()=%d \n",
args.nodesScanned, args.nodesRemoved, args.nodesInside,
args.nodesIntersect, args.nodesOutside, _removedVoxels.count()
);
@ -984,7 +987,7 @@ bool VoxelSystem::falseColorizeRandomEveryOtherOperation(VoxelNode* node, void*
void VoxelSystem::falseColorizeRandomEveryOther() {
falseColorizeRandomEveryOtherArgs args;
_tree->recurseTreeWithOperation(falseColorizeRandomEveryOtherOperation,&args);
printLog("randomized false color for every other node: total %ld, colorable %ld, colored %ld\n",
qDebug("randomized false color for every other node: total %ld, colorable %ld, colored %ld\n",
args.totalNodes, args.colorableNodes, args.coloredNodes);
setupNewVoxelsForDrawing();
}
@ -1045,7 +1048,7 @@ bool VoxelSystem::collectStatsForTreesAndVBOsOperation(VoxelNode* node, void* ex
unsigned long nodeIndex = node->getBufferIndex();
if (args->hasIndexFound[nodeIndex]) {
args->duplicateVBOIndex++;
printLog("duplicateVBO found... index=%ld, isDirty=%s, shouldRender=%s \n", nodeIndex,
qDebug("duplicateVBO found... index=%ld, isDirty=%s, shouldRender=%s \n", nodeIndex,
debug::valueOf(node->isDirty()), debug::valueOf(node->getShouldRender()));
} else {
args->hasIndexFound[nodeIndex] = true;
@ -1080,13 +1083,13 @@ void VoxelSystem::collectStatsForTreesAndVBOs() {
args.expectedMax = _voxelsInWriteArrays;
_tree->recurseTreeWithOperation(collectStatsForTreesAndVBOsOperation,&args);
printLog("Local Voxel Tree Statistics:\n total nodes %ld \n leaves %ld \n dirty %ld \n colored %ld \n shouldRender %ld \n",
qDebug("Local Voxel Tree Statistics:\n total nodes %ld \n leaves %ld \n dirty %ld \n colored %ld \n shouldRender %ld \n",
args.totalNodes, args.leafNodes, args.dirtyNodes, args.coloredNodes, args.shouldRenderNodes);
printLog(" _voxelsDirty=%s \n _voxelsInWriteArrays=%ld \n minDirty=%ld \n maxDirty=%ld \n", debug::valueOf(_voxelsDirty),
qDebug(" _voxelsDirty=%s \n _voxelsInWriteArrays=%ld \n minDirty=%ld \n maxDirty=%ld \n", debug::valueOf(_voxelsDirty),
_voxelsInWriteArrays, minDirty, maxDirty);
printLog(" inVBO %ld \n nodesInVBOOverExpectedMax %ld \n duplicateVBOIndex %ld \n nodesInVBONotShouldRender %ld \n",
qDebug(" inVBO %ld \n nodesInVBOOverExpectedMax %ld \n duplicateVBOIndex %ld \n nodesInVBONotShouldRender %ld \n",
args.nodesInVBO, args.nodesInVBOOverExpectedMax, args.duplicateVBOIndex, args.nodesInVBONotShouldRender);
glBufferIndex minInVBO = GLBUFFER_INDEX_UNKNOWN;
@ -1099,7 +1102,7 @@ void VoxelSystem::collectStatsForTreesAndVBOs() {
}
}
printLog(" minInVBO=%ld \n maxInVBO=%ld \n _voxelsInWriteArrays=%ld \n _voxelsInReadArrays=%ld \n",
qDebug(" minInVBO=%ld \n maxInVBO=%ld \n _voxelsInWriteArrays=%ld \n _voxelsInReadArrays=%ld \n",
minInVBO, maxInVBO, _voxelsInWriteArrays, _voxelsInReadArrays);
}
@ -1124,7 +1127,7 @@ void VoxelSystem::createVoxel(float x, float y, float z, float s,
unsigned char red, unsigned char green, unsigned char blue, bool destructive) {
pthread_mutex_lock(&_treeLock);
//printLog("VoxelSystem::createVoxel(%f,%f,%f,%f)\n",x,y,z,s);
//qDebug("VoxelSystem::createVoxel(%f,%f,%f,%f)\n",x,y,z,s);
_tree->createVoxel(x, y, z, s, red, green, blue, destructive);
setupNewVoxelsForDrawing();
@ -1250,9 +1253,9 @@ bool VoxelSystem::falseColorizeOccludedOperation(VoxelNode* node, void* extraDat
args->occludedVoxels++;
} else if (result == STORED) {
args->notOccludedVoxels++;
//printLog("***** falseColorizeOccludedOperation() NODE is STORED *****\n");
//qDebug("***** falseColorizeOccludedOperation() NODE is STORED *****\n");
} else if (result == DOESNT_FIT) {
//printLog("***** falseColorizeOccludedOperation() NODE DOESNT_FIT???? *****\n");
//qDebug("***** falseColorizeOccludedOperation() NODE DOESNT_FIT???? *****\n");
}
}
return true; // keep going!
@ -1285,7 +1288,7 @@ void VoxelSystem::falseColorizeOccluded() {
_tree->recurseTreeWithOperationDistanceSorted(falseColorizeOccludedOperation, position, (void*)&args);
printLog("falseColorizeOccluded()\n position=(%f,%f)\n total=%ld\n colored=%ld\n occluded=%ld\n notOccluded=%ld\n outOfView=%ld\n subtreeVoxelsSkipped=%ld\n stagedForDeletion=%ld\n nonLeaves=%ld\n nonLeavesOutOfView=%ld\n nonLeavesOccluded=%ld\n pointInside_calls=%ld\n occludes_calls=%ld\n intersects_calls=%ld\n",
qDebug("falseColorizeOccluded()\n position=(%f,%f)\n total=%ld\n colored=%ld\n occluded=%ld\n notOccluded=%ld\n outOfView=%ld\n subtreeVoxelsSkipped=%ld\n stagedForDeletion=%ld\n nonLeaves=%ld\n nonLeavesOutOfView=%ld\n nonLeavesOccluded=%ld\n pointInside_calls=%ld\n occludes_calls=%ld\n intersects_calls=%ld\n",
position.x, position.y,
args.totalVoxels, args.coloredVoxels, args.occludedVoxels,
args.notOccludedVoxels, args.outOfView, args.subtreeVoxelsSkipped,
@ -1371,9 +1374,9 @@ bool VoxelSystem::falseColorizeOccludedV2Operation(VoxelNode* node, void* extraD
args->occludedVoxels++;
} else if (result == V2_STORED) {
args->notOccludedVoxels++;
//printLog("***** falseColorizeOccludedOperation() NODE is STORED *****\n");
//qDebug("***** falseColorizeOccludedOperation() NODE is STORED *****\n");
} else if (result == V2_DOESNT_FIT) {
//printLog("***** falseColorizeOccludedOperation() NODE DOESNT_FIT???? *****\n");
//qDebug("***** falseColorizeOccludedOperation() NODE DOESNT_FIT???? *****\n");
}
delete voxelPolygon; // V2 maps don't store polygons, so we're always in charge of freeing
}
@ -1410,7 +1413,7 @@ void VoxelSystem::falseColorizeOccludedV2() {
_tree->recurseTreeWithOperationDistanceSorted(falseColorizeOccludedV2Operation, position, (void*)&args);
printLog("falseColorizeOccludedV2()\n position=(%f,%f)\n total=%ld\n colored=%ld\n occluded=%ld\n notOccluded=%ld\n outOfView=%ld\n subtreeVoxelsSkipped=%ld\n stagedForDeletion=%ld\n nonLeaves=%ld\n nonLeavesOutOfView=%ld\n nonLeavesOccluded=%ld\n pointInside_calls=%ld\n occludes_calls=%ld\n intersects_calls=%ld\n",
qDebug("falseColorizeOccludedV2()\n position=(%f,%f)\n total=%ld\n colored=%ld\n occluded=%ld\n notOccluded=%ld\n outOfView=%ld\n subtreeVoxelsSkipped=%ld\n stagedForDeletion=%ld\n nonLeaves=%ld\n nonLeavesOutOfView=%ld\n nonLeavesOccluded=%ld\n pointInside_calls=%ld\n occludes_calls=%ld\n intersects_calls=%ld\n",
position.x, position.y,
args.totalVoxels, args.coloredVoxels, args.occludedVoxels,
args.notOccludedVoxels, args.outOfView, args.subtreeVoxelsSkipped,

View file

@ -8,7 +8,6 @@
#include <QTimer>
#include <QtDebug>
#include <Log.h>
#include <SharedUtil.h>
#ifdef __APPLE__
@ -157,7 +156,7 @@ void Webcam::setFrame(const Mat& frame, int format, const Mat& depth, const Rota
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, _frameWidth = image.width, _frameHeight = image.height, 0, format,
GL_UNSIGNED_BYTE, image.imageData);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
printLog("Capturing video at %dx%d.\n", _frameWidth, _frameHeight);
qDebug("Capturing video at %dx%d.\n", _frameWidth, _frameHeight);
} else {
glBindTexture(GL_TEXTURE_2D, _frameTextureID);
@ -173,7 +172,7 @@ void Webcam::setFrame(const Mat& frame, int format, const Mat& depth, const Rota
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, _depthWidth = depthImage.width, _depthHeight = depthImage.height, 0,
GL_LUMINANCE, GL_UNSIGNED_BYTE, depthImage.imageData);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
printLog("Capturing depth at %dx%d.\n", _depthWidth, _depthHeight);
qDebug("Capturing depth at %dx%d.\n", _depthWidth, _depthHeight);
} else {
glBindTexture(GL_TEXTURE_2D, _depthTextureID);
@ -331,26 +330,26 @@ static glm::quat xnToGLM(const XnMatrix3X3& matrix) {
}
static void XN_CALLBACK_TYPE newUser(UserGenerator& generator, XnUserID id, void* cookie) {
printLog("Found user %d.\n", id);
qDebug("Found user %d.\n", id);
generator.GetSkeletonCap().RequestCalibration(id, false);
}
static void XN_CALLBACK_TYPE lostUser(UserGenerator& generator, XnUserID id, void* cookie) {
printLog("Lost user %d.\n", id);
qDebug("Lost user %d.\n", id);
}
static void XN_CALLBACK_TYPE calibrationStarted(SkeletonCapability& capability, XnUserID id, void* cookie) {
printLog("Calibration started for user %d.\n", id);
qDebug("Calibration started for user %d.\n", id);
}
static void XN_CALLBACK_TYPE calibrationCompleted(SkeletonCapability& capability,
XnUserID id, XnCalibrationStatus status, void* cookie) {
if (status == XN_CALIBRATION_STATUS_OK) {
printLog("Calibration completed for user %d.\n", id);
qDebug("Calibration completed for user %d.\n", id);
capability.StartTracking(id);
} else {
printLog("Calibration failed to user %d.\n", id);
qDebug("Calibration failed to user %d.\n", id);
capability.RequestCalibration(id, true);
}
}
@ -439,7 +438,7 @@ void FrameGrabber::grabFrame() {
// make sure it's in the format we expect
if (image->nChannels != 3 || image->depth != IPL_DEPTH_8U || image->dataOrder != IPL_DATA_ORDER_PIXEL ||
image->origin != 0) {
printLog("Invalid webcam image format.\n");
qDebug("Invalid webcam image format.\n");
return;
}
frame = image;
@ -486,7 +485,7 @@ bool FrameGrabber::init() {
// load our face cascade
switchToResourcesParentIfRequired();
if (_faceCascade.empty() && !_faceCascade.load("resources/haarcascades/haarcascade_frontalface_alt.xml")) {
printLog("Failed to load Haar cascade for face tracking.\n");
qDebug("Failed to load Haar cascade for face tracking.\n");
return false;
}
@ -514,7 +513,7 @@ bool FrameGrabber::init() {
// next, an ordinary webcam
if ((_capture = cvCaptureFromCAM(-1)) == 0) {
printLog("Failed to open webcam.\n");
qDebug("Failed to open webcam.\n");
return false;
}
const int IDEAL_FRAME_WIDTH = 320;

View file

@ -16,15 +16,16 @@
//
#include "Application.h"
#include "Log.h"
#include <QDebug>
int main(int argc, const char * argv[]) {
timeval startup_time;
gettimeofday(&startup_time, NULL);
Application app(argc, const_cast<char**>(argv), startup_time);
printLog( "Created QT Application.\n" );
qDebug( "Created QT Application.\n" );
int exitCode = app.exec();
printLog("Normal exit.\n");
qDebug("Normal exit.\n");
return exitCode;
}

View file

@ -39,7 +39,6 @@
#include "InterfaceConfig.h"
#include "renderer/ProgramObject.h"
#include "Log.h"
#include <cstddef>
#include <cfloat>

View file

@ -38,12 +38,12 @@ namespace starfield {
if (! UrlReader::readUrl(url, *this, cacheFile))
{
printLog("%s:%d: %s\n",
qDebug("%s:%d: %s\n",
_urlStr, _lineNo, getError());
return false;
}
printLog("Loaded %u stars.\n", _recordsRead);
qDebug("Loaded %u stars.\n", _recordsRead);
return true;
}
@ -63,7 +63,7 @@ namespace starfield {
_vertices->clear();
_vertices->reserve(_limit);
// printLog("Stars.cpp: loader begin %s\n", url);
// qDebug("Stars.cpp: loader begin %s\n", url);
}
size_t transfer(char* input, size_t bytes) {
@ -103,7 +103,7 @@ namespace starfield {
} else {
printLog("Stars.cpp:%d: Bad input from %s\n",
qDebug("Stars.cpp:%d: Bad input from %s\n",
_lineNo, _urlStr);
}
@ -128,7 +128,7 @@ namespace starfield {
// remember the brightness at its top
if (_recordsRead == _limit) {
// printLog("Stars.cpp: vertex limit reached -> heap mode\n");
// qDebug("Stars.cpp: vertex limit reached -> heap mode\n");
make_heap(
_vertices->begin(), _vertices->end(),

View file

@ -7,8 +7,6 @@
#include <QPalette>
#include <QColor>
#include "Log.h"
BandwidthDialog::BandwidthDialog(QWidget* parent, BandwidthMeter* model) :
QDialog(parent, Qt::Window | Qt::WindowCloseButtonHint | Qt::WindowStaysOnTopHint),
_model(model) {

View file

@ -1,15 +0,0 @@
//
// Log.cpp
// hifi
//
// Created by Tobias Schwinger on 4/17/13.
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
//
#include "Log.h"
#include <cstdio>
using namespace std;
int (* printLog)(char const*, ...) = & printf;

View file

@ -1,21 +0,0 @@
//
// Log.h
// hifi
//
// Created by Tobias Schwinger on 4/17/13.
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
//
#ifndef __hifi__shared_Log__
#define __hifi__shared_Log__
//
// Pointer to log function
//
// An application may reset this variable to receive the log messages
// issued using 'printLog'. It defaults to a pointer to 'printf'.
//
extern int (* printLog)(char const*, ...);
#endif /* defined(__hifi__shared_Log__) */

View file

@ -6,15 +6,9 @@
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
//
#include "stdio.h"
#include <pthread.h>
#include "Node.h"
#include "NodeTypes.h"
#include <cstring>
#include "Log.h"
#include "UDPSocket.h"
#include "SharedUtil.h"
#include <pthread.h>
#include <stdio.h>
#ifdef _WIN32
#include "Syssocket.h"
@ -22,6 +16,13 @@
#include <arpa/inet.h>
#endif
#include "Node.h"
#include "NodeTypes.h"
#include "SharedUtil.h"
#include "UDPSocket.h"
#include <QDebug>
int unpackNodeId(unsigned char* packedData, uint16_t* nodeId) {
memcpy(nodeId, packedData, sizeof(uint16_t));
return sizeof(uint16_t);
@ -140,18 +141,14 @@ float Node::getAverageKilobitsPerSecond() {
}
}
void Node::printLog(Node const& node) {
QDebug operator<<(QDebug debug, const Node &node) {
char publicAddressBuffer[16] = {'\0'};
unsigned short publicAddressPort = loadBufferWithSocketInfo(publicAddressBuffer, node._publicSocket);
unsigned short publicAddressPort = loadBufferWithSocketInfo(publicAddressBuffer, node.getPublicSocket());
//char localAddressBuffer[16] = {'\0'};
//unsigned short localAddressPort = loadBufferWithSocketInfo(localAddressBuffer, node.localSocket);
::printLog("# %d %s (%c) @ %s:%d\n",
node._nodeID,
node.getTypeName(),
node._type,
publicAddressBuffer,
publicAddressPort);
debug << "#" << node.getNodeID() << node.getTypeName() << node.getType();
debug.nospace() << publicAddressBuffer << ":" << publicAddressPort;
return debug.space();
}

View file

@ -9,8 +9,8 @@
#ifndef __hifi__Node__
#define __hifi__Node__
#include <stdint.h>
#include <ostream>
#include <stdint.h>
#ifdef _WIN32
#include "Syssocket.h"
@ -18,8 +18,10 @@
#include <sys/socket.h>
#endif
#include "SimpleMovingAverage.h"
#include <QDebug>
#include "NodeData.h"
#include "SimpleMovingAverage.h"
class Node {
public:
@ -89,8 +91,9 @@ private:
pthread_mutex_t _mutex;
};
int unpackNodeId(unsigned char *packedData, uint16_t *nodeId);
int packNodeId(unsigned char *packStore, uint16_t nodeId);
QDebug operator<<(QDebug debug, const Node &message);
#endif /* defined(__hifi__Node__) */

View file

@ -11,11 +11,12 @@
#include <cstdlib>
#include <cstdio>
#include <QDebug>
#include "NodeList.h"
#include "NodeTypes.h"
#include "PacketHeaders.h"
#include "SharedUtil.h"
#include "Log.h"
#ifdef _WIN32
#include "Syssocket.h"
@ -42,7 +43,7 @@ NodeList* NodeList::createInstance(char ownerType, unsigned int socketListenPort
if (!_sharedInstance) {
_sharedInstance = new NodeList(ownerType, socketListenPort);
} else {
printLog("NodeList createInstance called with existing instance.\n");
qDebug("NodeList createInstance called with existing instance.\n");
}
return _sharedInstance;
@ -50,7 +51,7 @@ NodeList* NodeList::createInstance(char ownerType, unsigned int socketListenPort
NodeList* NodeList::getInstance() {
if (!_sharedInstance) {
printLog("NodeList getInstance called before call to createInstance. Returning NULL pointer.\n");
qDebug("NodeList getInstance called before call to createInstance. Returning NULL pointer.\n");
}
return _sharedInstance;
@ -274,12 +275,12 @@ void NodeList::sendDomainServerCheckIn() {
sockaddr_in tempAddress;
memcpy(&tempAddress.sin_addr, pHostInfo->h_addr_list[0], pHostInfo->h_length);
strcpy(_domainIP, inet_ntoa(tempAddress.sin_addr));
printLog("Domain Server: %s \n", _domainHostname);
qDebug("Domain Server: %s \n", _domainHostname);
} else {
printLog("Failed domain server lookup\n");
qDebug("Failed domain server lookup\n");
}
} else if (!printedDomainServerIP) {
printLog("Domain Server IP: %s\n", _domainIP);
qDebug("Domain Server IP: %s\n", _domainIP);
printedDomainServerIP = true;
}
@ -418,8 +419,7 @@ void NodeList::addNodeToList(Node* newNode) {
++_numNodes;
printLog("Added ");
Node::printLog(*newNode);
qDebug() << "Added " << *newNode;
}
unsigned NodeList::broadcastToNodes(unsigned char *broadcastData, size_t dataBytes, const char* nodeTypes, int numNodeTypes) {
@ -474,8 +474,7 @@ void *removeSilentNodes(void *args) {
if ((checkTimeUSecs - node->getLastHeardMicrostamp()) > NODE_SILENCE_THRESHOLD_USECS
&& node->getType() != NODE_TYPE_VOXEL_SERVER) {
printLog("Killed ");
Node::printLog(*node);
qDebug() << "Killed" << *node;
node->setAlive(false);
}

View file

@ -6,12 +6,14 @@
// Copyright (c) 2013 HighFidelity, Inc. All rights reserved.
//
#include <cmath>
#include <algorithm> // std:min
#include <cmath>
#include <cstring>
#include <QDebug>
#include "SharedUtil.h"
#include "OctalCode.h"
#include "Log.h"
int numberOfThreeBitSectionsInCode(unsigned char * octalCode) {
if (*octalCode == 255) {
@ -23,12 +25,12 @@ int numberOfThreeBitSectionsInCode(unsigned char * octalCode) {
void printOctalCode(unsigned char * octalCode) {
if (!octalCode) {
printLog("NULL\n");
qDebug("NULL\n");
} else {
for (int i = 0; i < bytesRequiredForCodeLength(*octalCode); i++) {
outputBits(octalCode[i],false);
}
printLog("\n");
qDebug("\n");
}
}

View file

@ -8,8 +8,9 @@
#include <stdio.h>
#include <QDebug>
#include "PacketHeaders.h"
#include "Log.h"
PACKET_VERSION versionForPacketType(PACKET_TYPE type) {
switch (type) {
@ -28,7 +29,7 @@ bool packetVersionMatch(unsigned char* packetHeader) {
if (packetHeader[1] == versionForPacketType(packetHeader[0])) {
return true;
} else {
printLog("There is a packet version mismatch for packet with header %c\n", packetHeader[0]);
qDebug("There is a packet version mismatch for packet with header %c\n", packetHeader[0]);
return false;
}
}

View file

@ -10,12 +10,13 @@
//
//
#include "PerfStat.h"
#include <cstdio>
#include <string>
#include <map>
#include <string>
#include "Log.h"
#include <QDebug>
#include "PerfStat.h"
// Static class members initialization here!
std::map<std::string,PerfStatHistory,std::less<std::string> > PerfStat::groupHistoryMap;
@ -58,11 +59,11 @@ PerfStat::~PerfStat() {
}
if (wantDebugOut) {
printLog("PerfStats: %s elapsed:%f average:%lf count:%ld total:%lf ut:%d us:%d ue:%d t:%ld s:%ld e:%ld\n",
this->group.c_str(),elapsed,average,count,totalTime,
(end.tv_usec-start.tv_usec),start.tv_usec,end.tv_usec,
(end.tv_sec-start.tv_sec),start.tv_sec,end.tv_sec
);
qDebug("PerfStats: %s elapsed:%f average:%lf count:%ld total:%lf ut:%d us:%d ue:%d t:%ld s:%ld e:%ld\n",
this->group.c_str(),elapsed,average,count,totalTime,
(end.tv_usec-start.tv_usec),start.tv_usec,end.tv_usec,
(end.tv_sec-start.tv_sec),start.tv_sec,end.tv_sec
);
}
};
@ -110,12 +111,12 @@ PerformanceWarning::~PerformanceWarning() {
if ((_alwaysDisplay || _renderWarningsOn) && elapsedmsec > 1) {
if (elapsedmsec > 1000) {
double elapsedsec = (end - _start) / 1000000.0;
printLog("%s%s took %lf seconds\n", (_alwaysDisplay ? "" : "WARNING!"), _message, elapsedsec);
qDebug("%s%s took %lf seconds\n", (_alwaysDisplay ? "" : "WARNING!"), _message, elapsedsec);
} else {
printLog("%s%s took %lf milliseconds\n", (_alwaysDisplay ? "" : "WARNING!"), _message, elapsedmsec);
qDebug("%s%s took %lf milliseconds\n", (_alwaysDisplay ? "" : "WARNING!"), _message, elapsedmsec);
}
} else if (_alwaysDisplay) {
printLog("%s took %lf milliseconds\n", _message, elapsedmsec);
qDebug("%s took %lf milliseconds\n", _message, elapsedmsec);
}
};

View file

@ -20,7 +20,8 @@
#include <CoreFoundation/CoreFoundation.h>
#endif
#include "Log.h"
#include <QDebug>
#include "OctalCode.h"
#include "PacketHeaders.h"
#include "SharedUtil.h"
@ -64,24 +65,24 @@ void outputBufferBits(unsigned char* buffer, int length, bool withNewLine) {
outputBits(buffer[i], false);
}
if (withNewLine) {
printLog("\n");
qDebug("\n");
}
}
void outputBits(unsigned char byte, bool withNewLine) {
if (isalnum(byte)) {
printLog("[ %d (%c): ", byte, byte);
qDebug("[ %d (%c): ", byte, byte);
} else {
printLog("[ %d (0x%x): ", byte, byte);
qDebug("[ %d (0x%x): ", byte, byte);
}
for (int i = 0; i < 8; i++) {
printLog("%d", byte >> (7 - i) & 1);
qDebug("%d", byte >> (7 - i) & 1);
}
printLog(" ] ");
qDebug(" ] ");
if (withNewLine) {
printLog("\n");
qDebug("\n");
}
}
@ -385,14 +386,14 @@ void printVoxelCode(unsigned char* voxelCode) {
unsigned int voxelSizeInOctets = (voxelSizeInBits/3);
unsigned int voxelBufferSize = voxelSizeInBytes+1+3; // 1 for size, 3 for color
printLog("octets=%d\n",octets);
printLog("voxelSizeInBits=%d\n",voxelSizeInBits);
printLog("voxelSizeInBytes=%d\n",voxelSizeInBytes);
printLog("voxelSizeInOctets=%d\n",voxelSizeInOctets);
printLog("voxelBufferSize=%d\n",voxelBufferSize);
qDebug("octets=%d\n",octets);
qDebug("voxelSizeInBits=%d\n",voxelSizeInBits);
qDebug("voxelSizeInBytes=%d\n",voxelSizeInBytes);
qDebug("voxelSizeInOctets=%d\n",voxelSizeInOctets);
qDebug("voxelBufferSize=%d\n",voxelBufferSize);
for(int i=0;i<voxelBufferSize;i++) {
printLog("i=%d ",i);
qDebug("i=%d ",i);
outputBits(voxelCode[i]);
}
}

View file

@ -6,10 +6,9 @@
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
//
#include "UDPSocket.h"
#include <fcntl.h>
#include <cstdio>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#ifdef _WIN32
@ -21,7 +20,9 @@
#include <unistd.h>
#endif
#include "Log.h"
#include <QDebug>
#include "UDPSocket.h"
sockaddr_in destSockaddr, senderAddress;
@ -123,7 +124,7 @@ UDPSocket::UDPSocket(int listeningPort) : listeningPort(listeningPort), blocking
handle = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (handle <= 0) {
printLog("Failed to create socket.\n");
qDebug("Failed to create socket.\n");
return;
}
@ -136,7 +137,7 @@ UDPSocket::UDPSocket(int listeningPort) : listeningPort(listeningPort), blocking
bind_address.sin_port = htons((uint16_t) listeningPort);
if (bind(handle, (const sockaddr*) &bind_address, sizeof(sockaddr_in)) < 0) {
printLog("Failed to bind socket to port %d.\n", listeningPort);
qDebug("Failed to bind socket to port %d.\n", listeningPort);
return;
}
@ -153,7 +154,7 @@ UDPSocket::UDPSocket(int listeningPort) : listeningPort(listeningPort), blocking
tv.tv_usec = 500000;
setsockopt(handle, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof tv);
printLog("Created UDP socket listening on port %d.\n", listeningPort);
qDebug("Created UDP socket listening on port %d.\n", listeningPort);
}
UDPSocket::~UDPSocket() {
@ -233,7 +234,7 @@ int UDPSocket::send(sockaddr* destAddress, const void* data, size_t byteLength)
0, (sockaddr *) destAddress, sizeof(sockaddr_in));
if (sent_bytes != byteLength) {
printLog("Failed to send packet: %s\n", strerror(errno));
qDebug("Failed to send packet: %s\n", strerror(errno));
return false;
}

View file

@ -6,20 +6,17 @@
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
//
#include "UrlReader.h"
#include <new>
#include <sys/types.h>
#include <sys/stat.h>
#include "Log.h"
#ifndef _WIN32
// (Windows port is incomplete and the build files do not support CURL, yet)
#include <curl/curl.h>
#include "UrlReader.h"
//
// ATTENTION: A certain part of the implementation lives in inlined code

View file

@ -6,10 +6,13 @@
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
//
#include "CoverageMap.h"
#include <SharedUtil.h>
#include <cstring>
#include "Log.h"
#include <QDebug>
#include <SharedUtil.h>
#include "CoverageMap.h"
int CoverageMap::_mapCount = 0;
int CoverageMap::_checkMapRootCalls = 0;
@ -60,7 +63,7 @@ CoverageMap::CoverageMap(BoundingBox boundingBox, bool isRoot, bool managePolygo
{
_mapCount++;
init();
//printLog("CoverageMap created... _mapCount=%d\n",_mapCount);
//qDebug("CoverageMap created... _mapCount=%d\n",_mapCount);
};
CoverageMap::~CoverageMap() {
@ -68,19 +71,19 @@ CoverageMap::~CoverageMap() {
};
void CoverageMap::printStats() {
printLog("CoverageMap::printStats()...\n");
printLog("MINIMUM_POLYGON_AREA_TO_STORE=%f\n",MINIMUM_POLYGON_AREA_TO_STORE);
printLog("_mapCount=%d\n",_mapCount);
printLog("_checkMapRootCalls=%d\n",_checkMapRootCalls);
printLog("_notAllInView=%d\n",_notAllInView);
printLog("_maxPolygonsUsed=%d\n",CoverageRegion::_maxPolygonsUsed);
printLog("_totalPolygons=%d\n",CoverageRegion::_totalPolygons);
printLog("_occlusionTests=%d\n",CoverageRegion::_occlusionTests);
printLog("_regionSkips=%d\n",CoverageRegion::_regionSkips);
printLog("_tooSmallSkips=%d\n",CoverageRegion::_tooSmallSkips);
printLog("_regionFullSkips=%d\n",CoverageRegion::_regionFullSkips);
printLog("_outOfOrderPolygon=%d\n",CoverageRegion::_outOfOrderPolygon);
printLog("_clippedPolygons=%d\n",CoverageRegion::_clippedPolygons);
qDebug("CoverageMap::printStats()...\n");
qDebug("MINIMUM_POLYGON_AREA_TO_STORE=%f\n",MINIMUM_POLYGON_AREA_TO_STORE);
qDebug("_mapCount=%d\n",_mapCount);
qDebug("_checkMapRootCalls=%d\n",_checkMapRootCalls);
qDebug("_notAllInView=%d\n",_notAllInView);
qDebug("_maxPolygonsUsed=%d\n",CoverageRegion::_maxPolygonsUsed);
qDebug("_totalPolygons=%d\n",CoverageRegion::_totalPolygons);
qDebug("_occlusionTests=%d\n",CoverageRegion::_occlusionTests);
qDebug("_regionSkips=%d\n",CoverageRegion::_regionSkips);
qDebug("_tooSmallSkips=%d\n",CoverageRegion::_tooSmallSkips);
qDebug("_regionFullSkips=%d\n",CoverageRegion::_regionFullSkips);
qDebug("_outOfOrderPolygon=%d\n",CoverageRegion::_outOfOrderPolygon);
qDebug("_clippedPolygons=%d\n",CoverageRegion::_clippedPolygons);
}
void CoverageMap::erase() {
@ -99,7 +102,7 @@ void CoverageMap::erase() {
}
if (_isRoot && wantDebugging) {
printLog("CoverageMap last to be deleted...\n");
qDebug("CoverageMap last to be deleted...\n");
printStats();
CoverageRegion::_maxPolygonsUsed = 0;
@ -184,7 +187,7 @@ CoverageMapStorageResult CoverageMap::checkMap(VoxelProjectedPolygon* polygon, b
if (_isRoot) {
_checkMapRootCalls++;
//printLog("CoverageMap::checkMap()... storeIt=%s\n", debug::valueOf(storeIt));
//qDebug("CoverageMap::checkMap()... storeIt=%s\n", debug::valueOf(storeIt));
//polygon->printDebugDetails();
}
@ -193,7 +196,7 @@ CoverageMapStorageResult CoverageMap::checkMap(VoxelProjectedPolygon* polygon, b
// not in view, then we just discard it with a DOESNT_FIT, this saves us time checking values later.
if (!polygon->getAllInView()) {
_notAllInView++;
//printLog("CoverageMap2::checkMap()... V2_OCCLUDED\n");
//qDebug("CoverageMap2::checkMap()... V2_OCCLUDED\n");
return DOESNT_FIT;
}
@ -240,9 +243,9 @@ CoverageMapStorageResult CoverageMap::checkMap(VoxelProjectedPolygon* polygon, b
/*
if (result == STORED)
printLog("CoverageMap2::checkMap()... STORED\n");
qDebug("CoverageMap2::checkMap()... STORED\n");
else
printLog("CoverageMap2::checkMap()... OCCLUDED\n");
qDebug("CoverageMap2::checkMap()... OCCLUDED\n");
*/
return result;
@ -265,16 +268,16 @@ CoverageMapStorageResult CoverageMap::checkMap(VoxelProjectedPolygon* polygon, b
/*
switch (result) {
case STORED:
printLog("checkMap() = STORED\n");
qDebug("checkMap() = STORED\n");
break;
case NOT_STORED:
printLog("checkMap() = NOT_STORED\n");
qDebug("checkMap() = NOT_STORED\n");
break;
case OCCLUDED:
printLog("checkMap() = OCCLUDED\n");
qDebug("checkMap() = OCCLUDED\n");
break;
default:
printLog("checkMap() = ????? \n");
qDebug("checkMap() = ????? \n");
break;
}
*/
@ -287,27 +290,27 @@ CoverageMapStorageResult CoverageMap::checkMap(VoxelProjectedPolygon* polygon, b
// any of our child bounding boxes, so we should add it here.
if (storeIt) {
if (polygon->getBoundingBox().area() > CoverageMap::MINIMUM_POLYGON_AREA_TO_STORE) {
//printLog("storing polygon of area: %f\n",polygon->getBoundingBox().area());
//qDebug("storing polygon of area: %f\n",polygon->getBoundingBox().area());
if (storeIn->getPolygonCount() < MAX_POLYGONS_PER_REGION) {
storeIn->storeInArray(polygon);
//printLog("CoverageMap2::checkMap()... STORED\n");
//qDebug("CoverageMap2::checkMap()... STORED\n");
return STORED;
} else {
CoverageRegion::_regionFullSkips++;
//printLog("CoverageMap2::checkMap()... NOT_STORED\n");
//qDebug("CoverageMap2::checkMap()... NOT_STORED\n");
return NOT_STORED;
}
} else {
CoverageRegion::_tooSmallSkips++;
//printLog("CoverageMap2::checkMap()... NOT_STORED\n");
//qDebug("CoverageMap2::checkMap()... NOT_STORED\n");
return NOT_STORED;
}
} else {
//printLog("CoverageMap2::checkMap()... NOT_STORED\n");
//qDebug("CoverageMap2::checkMap()... NOT_STORED\n");
return NOT_STORED;
}
}
//printLog("CoverageMap2::checkMap()... DOESNT_FIT\n");
//qDebug("CoverageMap2::checkMap()... DOESNT_FIT\n");
return DOESNT_FIT;
}
@ -338,11 +341,11 @@ void CoverageRegion::erase() {
/**
if (_polygonCount) {
printLog("CoverageRegion::erase()...\n");
printLog("_polygonCount=%d\n",_polygonCount);
qDebug("CoverageRegion::erase()...\n");
qDebug("_polygonCount=%d\n",_polygonCount);
_myBoundingBox.printDebugDetails(getRegionName());
//for (int i = 0; i < _polygonCount; i++) {
// printLog("_polygons[%d]=",i);
// qDebug("_polygons[%d]=",i);
// _polygons[i]->getBoundingBox().printDebugDetails();
//}
}
@ -390,7 +393,7 @@ void CoverageRegion::growPolygonArray() {
_polygonDistances = newDistances;
_polygonSizes = newSizes;
_polygonArraySize = _polygonArraySize + DEFAULT_GROW_SIZE;
//printLog("CoverageMap::growPolygonArray() _polygonArraySize=%d...\n",_polygonArraySize);
//qDebug("CoverageMap::growPolygonArray() _polygonArraySize=%d...\n",_polygonArraySize);
}
const char* CoverageRegion::getRegionName() const {
@ -435,7 +438,7 @@ bool CoverageRegion::mergeItemsInArray(VoxelProjectedPolygon* seed, bool seedInA
_totalPolygons--;
}
//printLog("_polygonCount=%d\n",_polygonCount);
//qDebug("_polygonCount=%d\n",_polygonCount);
// clean up
if (_managePolygons) {
@ -483,7 +486,7 @@ void CoverageRegion::storeInArray(VoxelProjectedPolygon* polygon) {
// insertion point in this array, and shift the array accordingly
float area = polygon->getBoundingBox().area();
float reverseArea = 4.0f - area;
//printLog("store by size area=%f reverse area=%f\n", area, reverseArea);
//qDebug("store by size area=%f reverse area=%f\n", area, reverseArea);
_polygonCount = insertIntoSortedArrays((void*)polygon, reverseArea, IGNORED,
(void**)_polygons, _polygonSizes, IGNORED,
_polygonCount, _polygonArraySize);
@ -497,10 +500,10 @@ void CoverageRegion::storeInArray(VoxelProjectedPolygon* polygon) {
// Debugging and Optimization Tuning code.
if (_polygonCount > _maxPolygonsUsed) {
_maxPolygonsUsed = _polygonCount;
//printLog("CoverageRegion new _maxPolygonsUsed reached=%d region=%s\n",_maxPolygonsUsed, getRegionName());
//qDebug("CoverageRegion new _maxPolygonsUsed reached=%d region=%s\n",_maxPolygonsUsed, getRegionName());
//_myBoundingBox.printDebugDetails("map._myBoundingBox");
} else {
//printLog("CoverageRegion::storeInArray() _polygonCount=%d region=%s\n",_polygonCount, getRegionName());
//qDebug("CoverageRegion::storeInArray() _polygonCount=%d region=%s\n",_polygonCount, getRegionName());
}
}

View file

@ -7,11 +7,13 @@
//
#include <algorithm>
#include <cstring>
#include <QDebug>
#include <SharedUtil.h>
#include "CoverageMapV2.h"
#include <SharedUtil.h>
#include <cstring>
#include "Log.h"
int CoverageMapV2::_mapCount = 0;
int CoverageMapV2::_checkMapRootCalls = 0;
@ -59,7 +61,7 @@ CoverageMapV2::CoverageMapV2(BoundingBox boundingBox, bool isRoot, bool isCovere
{
_mapCount++;
init();
//printLog("CoverageMapV2 created... _mapCount=%d\n",_mapCount);
//qDebug("CoverageMapV2 created... _mapCount=%d\n",_mapCount);
};
CoverageMapV2::~CoverageMapV2() {
@ -76,11 +78,11 @@ void CoverageMapV2::erase() {
}
if (_isRoot && wantDebugging) {
printLog("CoverageMapV2 last to be deleted...\n");
printLog("MINIMUM_POLYGON_AREA_TO_STORE=%f\n",MINIMUM_POLYGON_AREA_TO_STORE);
printLog("_mapCount=%d\n",_mapCount);
printLog("_checkMapRootCalls=%d\n",_checkMapRootCalls);
printLog("_notAllInView=%d\n",_notAllInView);
qDebug("CoverageMapV2 last to be deleted...\n");
qDebug("MINIMUM_POLYGON_AREA_TO_STORE=%f\n",MINIMUM_POLYGON_AREA_TO_STORE);
qDebug("_mapCount=%d\n",_mapCount);
qDebug("_checkMapRootCalls=%d\n",_checkMapRootCalls);
qDebug("_notAllInView=%d\n",_notAllInView);
_mapCount = 0;
_checkMapRootCalls = 0;
_notAllInView = 0;

View file

@ -7,7 +7,8 @@
#include <cstring>
#include <Log.h>
#include <QDebug>
#include <SharedUtil.h>
#include "GeometryUtil.h"

View file

@ -12,8 +12,6 @@
#include <stdio.h>
#include "Log.h"
// These are some useful utilities that vec3 is missing
void printVec3(const char* name, const glm::vec3& v) {
printf("%s x=%f y=%f z=%f\n", name, v.x, v.y, v.z);

View file

@ -6,14 +6,13 @@
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
//
#include "Tags.h"
#include <Log.h>
#include <zlib.h>
#include <zconf.h>
#include <iostream>
#include <zconf.h>
#include <zlib.h>
#include "Tags.h"
Tag::Tag(int tagId, std::stringstream &ss) : _tagId(tagId) {
int size = ss.get() << 8 | ss.get();

View file

@ -3,24 +3,23 @@
// hifi
//
// Created by Brad Hefta-Gaub on 04/11/13.
// Copyright (c) 2013 HighFidelity, Inc. All rights reserved.
//
// Simple view frustum class.
//
//
#include <algorithm>
#include <glm/gtx/transform.hpp>
#include "SharedUtil.h"
#include "Log.h"
#include <QDebug>
#include "CoverageMap.h"
#include "GeometryUtil.h"
#include "SharedUtil.h"
#include "ViewFrustum.h"
#include "VoxelConstants.h"
using namespace std;
ViewFrustum::ViewFrustum() :
@ -323,40 +322,40 @@ bool ViewFrustum::matches(const ViewFrustum& compareTo, bool debug) const {
testMatches(compareTo._eyeOffsetOrientation, _eyeOffsetOrientation);
if (!result && debug) {
printLog("ViewFrustum::matches()... result=%s\n", debug::valueOf(result));
printLog("%s -- compareTo._position=%f,%f,%f _position=%f,%f,%f\n",
qDebug("ViewFrustum::matches()... result=%s\n", debug::valueOf(result));
qDebug("%s -- compareTo._position=%f,%f,%f _position=%f,%f,%f\n",
(testMatches(compareTo._position,_position) ? "MATCHES " : "NO MATCH"),
compareTo._position.x, compareTo._position.y, compareTo._position.z,
_position.x, _position.y, _position.z );
printLog("%s -- compareTo._direction=%f,%f,%f _direction=%f,%f,%f\n",
qDebug("%s -- compareTo._direction=%f,%f,%f _direction=%f,%f,%f\n",
(testMatches(compareTo._direction, _direction) ? "MATCHES " : "NO MATCH"),
compareTo._direction.x, compareTo._direction.y, compareTo._direction.z,
_direction.x, _direction.y, _direction.z );
printLog("%s -- compareTo._up=%f,%f,%f _up=%f,%f,%f\n",
qDebug("%s -- compareTo._up=%f,%f,%f _up=%f,%f,%f\n",
(testMatches(compareTo._up, _up) ? "MATCHES " : "NO MATCH"),
compareTo._up.x, compareTo._up.y, compareTo._up.z,
_up.x, _up.y, _up.z );
printLog("%s -- compareTo._right=%f,%f,%f _right=%f,%f,%f\n",
qDebug("%s -- compareTo._right=%f,%f,%f _right=%f,%f,%f\n",
(testMatches(compareTo._right, _right) ? "MATCHES " : "NO MATCH"),
compareTo._right.x, compareTo._right.y, compareTo._right.z,
_right.x, _right.y, _right.z );
printLog("%s -- compareTo._fieldOfView=%f _fieldOfView=%f\n",
qDebug("%s -- compareTo._fieldOfView=%f _fieldOfView=%f\n",
(testMatches(compareTo._fieldOfView, _fieldOfView) ? "MATCHES " : "NO MATCH"),
compareTo._fieldOfView, _fieldOfView);
printLog("%s -- compareTo._aspectRatio=%f _aspectRatio=%f\n",
qDebug("%s -- compareTo._aspectRatio=%f _aspectRatio=%f\n",
(testMatches(compareTo._aspectRatio, _aspectRatio) ? "MATCHES " : "NO MATCH"),
compareTo._aspectRatio, _aspectRatio);
printLog("%s -- compareTo._nearClip=%f _nearClip=%f\n",
qDebug("%s -- compareTo._nearClip=%f _nearClip=%f\n",
(testMatches(compareTo._nearClip, _nearClip) ? "MATCHES " : "NO MATCH"),
compareTo._nearClip, _nearClip);
printLog("%s -- compareTo._farClip=%f _farClip=%f\n",
qDebug("%s -- compareTo._farClip=%f _farClip=%f\n",
(testMatches(compareTo._farClip, _farClip) ? "MATCHES " : "NO MATCH"),
compareTo._farClip, _farClip);
printLog("%s -- compareTo._eyeOffsetPosition=%f,%f,%f _eyeOffsetPosition=%f,%f,%f\n",
qDebug("%s -- compareTo._eyeOffsetPosition=%f,%f,%f _eyeOffsetPosition=%f,%f,%f\n",
(testMatches(compareTo._eyeOffsetPosition, _eyeOffsetPosition) ? "MATCHES " : "NO MATCH"),
compareTo._eyeOffsetPosition.x, compareTo._eyeOffsetPosition.y, compareTo._eyeOffsetPosition.z,
_eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z);
printLog("%s -- compareTo._eyeOffsetOrientation=%f,%f,%f,%f _eyeOffsetOrientation=%f,%f,%f,%f\n",
qDebug("%s -- compareTo._eyeOffsetOrientation=%f,%f,%f,%f _eyeOffsetOrientation=%f,%f,%f,%f\n",
(testMatches(compareTo._eyeOffsetOrientation, _eyeOffsetOrientation) ? "MATCHES " : "NO MATCH"),
compareTo._eyeOffsetOrientation.x, compareTo._eyeOffsetOrientation.y,
compareTo._eyeOffsetOrientation.z, compareTo._eyeOffsetOrientation.w,
@ -419,17 +418,17 @@ void ViewFrustum::computeOffAxisFrustum(float& left, float& right, float& bottom
}
void ViewFrustum::printDebugDetails() const {
printLog("ViewFrustum::printDebugDetails()... \n");
printLog("_position=%f,%f,%f\n", _position.x, _position.y, _position.z );
printLog("_direction=%f,%f,%f\n", _direction.x, _direction.y, _direction.z );
printLog("_up=%f,%f,%f\n", _up.x, _up.y, _up.z );
printLog("_right=%f,%f,%f\n", _right.x, _right.y, _right.z );
printLog("_fieldOfView=%f\n", _fieldOfView);
printLog("_aspectRatio=%f\n", _aspectRatio);
printLog("_nearClip=%f\n", _nearClip);
printLog("_farClip=%f\n", _farClip);
printLog("_eyeOffsetPosition=%f,%f,%f\n", _eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z );
printLog("_eyeOffsetOrientation=%f,%f,%f,%f\n", _eyeOffsetOrientation.x, _eyeOffsetOrientation.y, _eyeOffsetOrientation.z,
qDebug("ViewFrustum::printDebugDetails()... \n");
qDebug("_position=%f,%f,%f\n", _position.x, _position.y, _position.z );
qDebug("_direction=%f,%f,%f\n", _direction.x, _direction.y, _direction.z );
qDebug("_up=%f,%f,%f\n", _up.x, _up.y, _up.z );
qDebug("_right=%f,%f,%f\n", _right.x, _right.y, _right.z );
qDebug("_fieldOfView=%f\n", _fieldOfView);
qDebug("_aspectRatio=%f\n", _aspectRatio);
qDebug("_nearClip=%f\n", _nearClip);
qDebug("_farClip=%f\n", _farClip);
qDebug("_eyeOffsetPosition=%f,%f,%f\n", _eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z );
qDebug("_eyeOffsetOrientation=%f,%f,%f,%f\n", _eyeOffsetOrientation.x, _eyeOffsetOrientation.y, _eyeOffsetOrientation.z,
_eyeOffsetOrientation.w );
}

View file

@ -3,18 +3,20 @@
// hifi
//
// Created by Brad Hefta-Gaub on 04/11/13.
// Copyright (c) 2013 HighFidelity, Inc. All rights reserved.
//
// Simple view frustum class.
//
//
#ifndef __hifi__ViewFrustum__
#define __hifi__ViewFrustum__
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include "Plane.h"
#include "AABox.h"
#include "Plane.h"
#include "VoxelProjectedPolygon.h"
const float DEFAULT_KEYHOLE_RADIUS = 3.0f;
@ -135,7 +137,7 @@ private:
glm::vec3 _nearBottomLeft;
glm::vec3 _nearBottomRight;
enum { TOP_PLANE = 0, BOTTOM_PLANE, LEFT_PLANE, RIGHT_PLANE, NEAR_PLANE, FAR_PLANE };
Plane _planes[6]; // How will this be used?
::Plane _planes[6]; // How will this be used?
const char* debugPlaneName (int plane) const;

View file

@ -3,19 +3,21 @@
// hifi
//
// Created by Stephen Birarda on 3/13/13.
//
// Copyright (c) 2013 HighFidelity, Inc. All rights reserved.
//
#include <stdio.h>
#include <cmath>
#include <cstring>
#include <stdio.h>
#include <QDebug>
#include "AABox.h"
#include "OctalCode.h"
#include "SharedUtil.h"
#include "Log.h"
#include "VoxelConstants.h"
#include "VoxelNode.h"
#include "VoxelTree.h"
#include "VoxelConstants.h"
#include "OctalCode.h"
#include "AABox.h"
VoxelNode::VoxelNode() {
unsigned char* rootCode = new unsigned char[1];
@ -257,7 +259,7 @@ bool VoxelNode::collapseIdenticalLeaves() {
// if no child, child isn't a leaf, or child doesn't have a color
if (!_children[i] || _children[i]->isStagedForDeletion() || !_children[i]->isLeaf() || !_children[i]->isColored()) {
allChildrenMatch=false;
//printLog("SADNESS child missing or not colored! i=%d\n",i);
//qDebug("SADNESS child missing or not colored! i=%d\n",i);
break;
} else {
if (i==0) {
@ -274,7 +276,7 @@ bool VoxelNode::collapseIdenticalLeaves() {
if (allChildrenMatch) {
//printLog("allChildrenMatch: pruning tree\n");
//qDebug("allChildrenMatch: pruning tree\n");
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
delete _children[i]; // delete all the child nodes
_children[i]=NULL; // set it to NULL
@ -308,13 +310,13 @@ void VoxelNode::printDebugDetails(const char* label) const {
}
}
printLog("%s - Voxel at corner=(%f,%f,%f) size=%f\n isLeaf=%s isColored=%s (%d,%d,%d,%d) isDirty=%s shouldRender=%s\n children=", label,
qDebug("%s - Voxel at corner=(%f,%f,%f) size=%f\n isLeaf=%s isColored=%s (%d,%d,%d,%d) isDirty=%s shouldRender=%s\n children=", label,
_box.getCorner().x, _box.getCorner().y, _box.getCorner().z, _box.getSize().x,
debug::valueOf(isLeaf()), debug::valueOf(isColored()), getColor()[0], getColor()[1], getColor()[2], getColor()[3],
debug::valueOf(isDirty()), debug::valueOf(getShouldRender()));
outputBits(childBits, false);
printLog("\n octalCode=");
qDebug("\n octalCode=");
printOctalCode(_octalCode);
}

View file

@ -6,10 +6,13 @@
//
#include <algorithm>
#include "VoxelProjectedPolygon.h"
#include <QDebug>
#include "GeometryUtil.h"
#include "Log.h"
#include "SharedUtil.h"
#include "VoxelProjectedPolygon.h"
glm::vec2 BoundingBox::getVertex(int vertexNumber) const {
switch (vertexNumber) {
@ -88,11 +91,11 @@ void BoundingBox::explandToInclude(const BoundingBox& box) {
void BoundingBox::printDebugDetails(const char* label) const {
if (label) {
printLog(label);
qDebug() << label;
} else {
printLog("BoundingBox");
qDebug("BoundingBox");
}
printLog("\n _set=%s\n corner=%f,%f size=%f,%f\n bounds=[(%f,%f) to (%f,%f)]\n",
qDebug("\n _set=%s\n corner=%f,%f size=%f,%f\n bounds=[(%f,%f) to (%f,%f)]\n",
debug::valueOf(_set), corner.x, corner.y, size.x, size.y, corner.x, corner.y, corner.x+size.x, corner.y+size.y);
}

View file

@ -9,26 +9,28 @@
#ifdef _WIN32
#define _USE_MATH_DEFINES
#endif
#include <cstring>
#include <cstdio>
#include <cmath>
#include "SharedUtil.h"
#include "Log.h"
#include "PacketHeaders.h"
#include "OctalCode.h"
#include "GeometryUtil.h"
#include "VoxelTree.h"
#include "VoxelNodeBag.h"
#include "ViewFrustum.h"
#include <fstream> // to load voxels from file
#include "VoxelConstants.h"
#include "CoverageMap.h"
#include "SquarePixelMap.h"
#include "Tags.h"
#include <glm/gtc/noise.hpp>
#include <QDebug>
#include "CoverageMap.h"
#include "GeometryUtil.h"
#include "OctalCode.h"
#include "PacketHeaders.h"
#include "SharedUtil.h"
#include "SquarePixelMap.h"
#include "Tags.h"
#include "ViewFrustum.h"
#include "VoxelConstants.h"
#include "VoxelNodeBag.h"
#include "VoxelTree.h"
float boundaryDistanceForRenderLevel(unsigned int renderLevel) {
const float voxelSizeScale = 50000.0f;
return voxelSizeScale / powf(2, renderLevel);
@ -155,7 +157,7 @@ void VoxelTree::recurseNodeWithOperationDistanceSorted(VoxelNode* node, RecurseV
if (childNode) {
// chance to optimize, doesn't need to be actual distance!! Could be distance squared
float distanceSquared = childNode->distanceSquareToPoint(point);
//printLog("recurseNodeWithOperationDistanceSorted() CHECKING child[%d] point=%f,%f center=%f,%f distance=%f...\n", i, point.x, point.y, center.x, center.y, distance);
//qDebug("recurseNodeWithOperationDistanceSorted() CHECKING child[%d] point=%f,%f center=%f,%f distance=%f...\n", i, point.x, point.y, center.x, center.y, distance);
//childNode->printDebugDetails("");
currentCount = insertIntoSortedArrays((void*)childNode, distanceSquared, i,
(void**)&sortedChildren, (float*)&distancesToChildren,
@ -166,7 +168,7 @@ void VoxelTree::recurseNodeWithOperationDistanceSorted(VoxelNode* node, RecurseV
for (int i = 0; i < currentCount; i++) {
VoxelNode* childNode = sortedChildren[i];
if (childNode) {
//printLog("recurseNodeWithOperationDistanceSorted() PROCESSING child[%d] distance=%f...\n", i, distancesToChildren[i]);
//qDebug("recurseNodeWithOperationDistanceSorted() PROCESSING child[%d] distance=%f...\n", i, distancesToChildren[i]);
//childNode->printDebugDetails("");
recurseNodeWithOperationDistanceSorted(childNode, operation, point, extraData);
}
@ -458,7 +460,7 @@ void VoxelTree::deleteVoxelCodeFromTreeRecursion(VoxelNode* node, void* extraDat
// isn't a colored leaf, and the child branch doesn't exist, so there's nothing to do below and
// we can safely return, ending the recursion and unwinding
if (!childNode) {
//printLog("new___deleteVoxelCodeFromTree() child branch doesn't exist, but parent is not a leaf, just unwind\n");
//qDebug("new___deleteVoxelCodeFromTree() child branch doesn't exist, but parent is not a leaf, just unwind\n");
return;
}
@ -546,7 +548,7 @@ void VoxelTree::readCodeColorBufferToTreeRecursion(VoxelNode* node, void* extraD
}
} else {
if (!node->isLeaf()) {
printLog("WARNING! operation would require deleting children, add Voxel ignored!\n ");
qDebug("WARNING! operation would require deleting children, add Voxel ignored!\n ");
}
}
@ -619,13 +621,13 @@ void VoxelTree::printTreeForDebugging(VoxelNode *startNode) {
}
}
printLog("color mask: ");
qDebug("color mask: ");
outputBits(colorMask);
// output the colors we have
for (int j = 0; j < NUMBER_OF_CHILDREN; j++) {
if (startNode->getChildAtIndex(j) && startNode->getChildAtIndex(j)->isColored()) {
printLog("color %d : ",j);
qDebug("color %d : ",j);
for (int c = 0; c < 3; c++) {
outputBits(startNode->getChildAtIndex(j)->getTrueColor()[c],false);
}
@ -641,7 +643,7 @@ void VoxelTree::printTreeForDebugging(VoxelNode *startNode) {
}
}
printLog("child mask: ");
qDebug("child mask: ");
outputBits(childMask);
if (childMask > 0) {
@ -686,7 +688,7 @@ void VoxelTree::loadVoxelsFile(const char* fileName, bool wantColorRandomizer) {
int totalBytesRead = 0;
if(file.is_open()) {
printLog("loading file...\n");
qDebug("loading file...\n");
bool bail = false;
while (!file.eof() && !bail) {
file.get(octets);
@ -711,14 +713,14 @@ void VoxelTree::loadVoxelsFile(const char* fileName, bool wantColorRandomizer) {
file.get(colorRead);
blue = (unsigned char)colorRead;
printLog("voxel color from file red:%d, green:%d, blue:%d \n",red,green,blue);
qDebug("voxel color from file red:%d, green:%d, blue:%d \n",red,green,blue);
vCount++;
int colorRandomizer = wantColorRandomizer ? randIntInRange (-5, 5) : 0;
voxelData[lengthInBytes+1] = std::max(0,std::min(255,red + colorRandomizer));
voxelData[lengthInBytes+2] = std::max(0,std::min(255,green + colorRandomizer));
voxelData[lengthInBytes+3] = std::max(0,std::min(255,blue + colorRandomizer));
printLog("voxel color after rand red:%d, green:%d, blue:%d\n",
qDebug("voxel color after rand red:%d, green:%d, blue:%d\n",
voxelData[lengthInBytes+1], voxelData[lengthInBytes+2], voxelData[lengthInBytes+3]);
//printVoxelCode(voxelData);
@ -819,7 +821,7 @@ void VoxelTree::createSphere(float radius, float xc, float yc, float zc, float v
if (debug) {
int percentComplete = 100 * (thisRadius/radius);
printLog("percentComplete=%d\n",percentComplete);
qDebug("percentComplete=%d\n",percentComplete);
}
for (float theta=0.0; theta <= 2 * M_PI; theta += angleDelta) {
@ -835,7 +837,7 @@ void VoxelTree::createSphere(float radius, float xc, float yc, float zc, float v
// 2) In all modes, we will use our "outer" color to draw the voxels. Otherwise we will use the average color
if (lastLayer) {
if (false && debug) {
printLog("adding candy shell: theta=%f phi=%f thisRadius=%f radius=%f\n",
qDebug("adding candy shell: theta=%f phi=%f thisRadius=%f radius=%f\n",
theta, phi, thisRadius,radius);
}
switch (mode) {
@ -859,7 +861,7 @@ void VoxelTree::createSphere(float radius, float xc, float yc, float zc, float v
green = (unsigned char)std::min(255, std::max(0, (int)(g1 + ((g2 - g1) * gradient))));
blue = (unsigned char)std::min(255, std::max(0, (int)(b1 + ((b2 - b1) * gradient))));
if (debug) {
printLog("perlin=%f gradient=%f color=(%d,%d,%d)\n",perlin, gradient, red, green, blue);
qDebug("perlin=%f gradient=%f color=(%d,%d,%d)\n",perlin, gradient, red, green, blue);
}
} break;
}
@ -1176,7 +1178,7 @@ int VoxelTree::encodeTreeBitstreamRecursion(VoxelNode* node, unsigned char* outp
if (childNode) {
// chance to optimize, doesn't need to be actual distance!! Could be distance squared
//float distanceSquared = childNode->distanceSquareToPoint(point);
//printLog("recurseNodeWithOperationDistanceSorted() CHECKING child[%d] point=%f,%f center=%f,%f distance=%f...\n", i, point.x, point.y, center.x, center.y, distance);
//qDebug("recurseNodeWithOperationDistanceSorted() CHECKING child[%d] point=%f,%f center=%f,%f distance=%f...\n", i, point.x, point.y, center.x, center.y, distance);
//childNode->printDebugDetails("");
float distance = params.viewFrustum ? childNode->distanceToCamera(*params.viewFrustum) : 0;
@ -1432,7 +1434,7 @@ int VoxelTree::encodeTreeBitstreamRecursion(VoxelNode* node, unsigned char* outp
bool VoxelTree::readFromSVOFile(const char* fileName) {
std::ifstream file(fileName, std::ios::in|std::ios::binary|std::ios::ate);
if(file.is_open()) {
printLog("loading file %s...\n", fileName);
qDebug("loading file %s...\n", fileName);
// get file length....
unsigned long fileLength = file.tellg();
@ -1460,14 +1462,14 @@ bool VoxelTree::readFromSchematicFile(const char *fileName) {
std::stringstream ss;
int err = retrieveData(fileName, ss);
if (err && ss.get() != TAG_Compound) {
printLog("[ERROR] Invalid schematic file.\n");
qDebug("[ERROR] Invalid schematic file.\n");
return false;
}
ss.get();
TagCompound schematics(ss);
if (!schematics.getBlocksId() || !schematics.getBlocksData()) {
printLog("[ERROR] Invalid schematic file.\n");
qDebug("[ERROR] Invalid schematic file.\n");
return false;
}
@ -1530,7 +1532,7 @@ bool VoxelTree::readFromSchematicFile(const char *fileName) {
}
}
printLog("Created %d voxels from minecraft import.\n", count);
qDebug("Created %d voxels from minecraft import.\n", count);
return true;
}
@ -1540,7 +1542,7 @@ void VoxelTree::writeToSVOFile(const char* fileName, VoxelNode* node) const {
std::ofstream file(fileName, std::ios::out|std::ios::binary);
if(file.is_open()) {
printLog("saving to file %s...\n", fileName);
qDebug("saving to file %s...\n", fileName);
VoxelNodeBag nodeBag;
// If we were given a specific node, start from there, otherwise start from root

View file

@ -6,7 +6,7 @@ set(MACRO_DIR ${ROOT_DIR}/cmake/macros)
set(TARGET_NAME pairing-server)
include(${MACRO_DIR}/SetupHifiProject.cmake)
setup_hifi_project(${TARGET_NAME})
setup_hifi_project(${TARGET_NAME} TRUE)
# link the shared hifi library
include(${MACRO_DIR}/LinkHifiLibrary.cmake)

View file

@ -7,7 +7,7 @@ set(TARGET_NAME space-server)
include(${MACRO_DIR}/SetupHifiProject.cmake)
setup_hifi_project(${TARGET_NAME})
setup_hifi_project(${TARGET_NAME} TRUE)
include(${MACRO_DIR}/LinkHifiLibrary.cmake)
link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR})

View file

@ -14,7 +14,7 @@ include_glm(${TARGET_NAME} ${ROOT_DIR})
include(${MACRO_DIR}/SetupHifiProject.cmake)
setup_hifi_project(${TARGET_NAME})
setup_hifi_project(${TARGET_NAME} FALSE)
# link in the shared library
include(${MACRO_DIR}/LinkHifiLibrary.cmake)

View file

@ -14,7 +14,7 @@ include_glm(${TARGET_NAME} ${ROOT_DIR})
include(${MACRO_DIR}/SetupHifiProject.cmake)
setup_hifi_project(${TARGET_NAME})
setup_hifi_project(${TARGET_NAME} TRUE)
# link in the shared library
include(${MACRO_DIR}/LinkHifiLibrary.cmake)