mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:18:24 +02:00
Merge pull request #692 from birarda/master
Cleaner buffer flush for QDebug message handler
This commit is contained in:
commit
f6619c6d05
5 changed files with 14 additions and 6 deletions
|
@ -165,9 +165,7 @@ void GLCanvas::wheelEvent(QWheelEvent* event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void messageHandler(QtMsgType type, const char* message) {
|
void messageHandler(QtMsgType type, const char* message) {
|
||||||
printf("%s", message);
|
fprintf(stdout, "%s", message);
|
||||||
fflush(stdout);
|
|
||||||
|
|
||||||
LogDisplay::instance.addMessage(message);
|
LogDisplay::instance.addMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -188,6 +188,10 @@ bool cmdOptionExists(int argc, const char * argv[],const char* option) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sharedMessageHandler(QtMsgType type, const char* message) {
|
||||||
|
fprintf(stdout, "%s", message);
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Function: createVoxelEditMessage()
|
// Function: createVoxelEditMessage()
|
||||||
// Description: creates an "insert" or "remove" voxel message for a voxel code
|
// Description: creates an "insert" or "remove" voxel message for a voxel code
|
||||||
|
|
|
@ -9,9 +9,11 @@
|
||||||
#ifndef __hifi__SharedUtil__
|
#ifndef __hifi__SharedUtil__
|
||||||
#define __hifi__SharedUtil__
|
#define __hifi__SharedUtil__
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <math.h>
|
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "Systime.h"
|
#include "Systime.h"
|
||||||
|
@ -66,6 +68,8 @@ void loadRandomIdentifier(unsigned char* identifierBuffer, int numBytes);
|
||||||
const char* getCmdOption(int argc, const char * argv[],const char* option);
|
const char* getCmdOption(int argc, const char * argv[],const char* option);
|
||||||
bool cmdOptionExists(int argc, const char * argv[],const char* option);
|
bool cmdOptionExists(int argc, const char * argv[],const char* option);
|
||||||
|
|
||||||
|
void sharedMessageHandler(QtMsgType type, const char* message);
|
||||||
|
|
||||||
struct VoxelDetail {
|
struct VoxelDetail {
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
|
|
|
@ -14,7 +14,7 @@ include_glm(${TARGET_NAME} ${ROOT_DIR})
|
||||||
|
|
||||||
include(${MACRO_DIR}/SetupHifiProject.cmake)
|
include(${MACRO_DIR}/SetupHifiProject.cmake)
|
||||||
|
|
||||||
setup_hifi_project(${TARGET_NAME} FALSE)
|
setup_hifi_project(${TARGET_NAME} TRUE)
|
||||||
|
|
||||||
# link in the shared library
|
# link in the shared library
|
||||||
include(${MACRO_DIR}/LinkHifiLibrary.cmake)
|
include(${MACRO_DIR}/LinkHifiLibrary.cmake)
|
||||||
|
|
|
@ -378,6 +378,8 @@ int main(int argc, const char * argv[]) {
|
||||||
|
|
||||||
pthread_mutex_init(&::treeLock, NULL);
|
pthread_mutex_init(&::treeLock, NULL);
|
||||||
|
|
||||||
|
qInstallMsgHandler(sharedMessageHandler);
|
||||||
|
|
||||||
NodeList* nodeList = NodeList::createInstance(NODE_TYPE_VOXEL_SERVER, VOXEL_LISTEN_PORT);
|
NodeList* nodeList = NodeList::createInstance(NODE_TYPE_VOXEL_SERVER, VOXEL_LISTEN_PORT);
|
||||||
setvbuf(stdout, NULL, _IOLBF, 0);
|
setvbuf(stdout, NULL, _IOLBF, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue