mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:44:01 +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) {
|
||||
printf("%s", message);
|
||||
fflush(stdout);
|
||||
|
||||
fprintf(stdout, "%s", message);
|
||||
LogDisplay::instance.addMessage(message);
|
||||
}
|
||||
|
||||
|
|
|
@ -188,6 +188,10 @@ bool cmdOptionExists(int argc, const char * argv[],const char* option) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void sharedMessageHandler(QtMsgType type, const char* message) {
|
||||
fprintf(stdout, "%s", message);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function: createVoxelEditMessage()
|
||||
// Description: creates an "insert" or "remove" voxel message for a voxel code
|
||||
|
|
|
@ -9,9 +9,11 @@
|
|||
#ifndef __hifi__SharedUtil__
|
||||
#define __hifi__SharedUtil__
|
||||
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#ifdef _WIN32
|
||||
#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);
|
||||
bool cmdOptionExists(int argc, const char * argv[],const char* option);
|
||||
|
||||
void sharedMessageHandler(QtMsgType type, const char* message);
|
||||
|
||||
struct VoxelDetail {
|
||||
float x;
|
||||
float y;
|
||||
|
|
|
@ -14,7 +14,7 @@ include_glm(${TARGET_NAME} ${ROOT_DIR})
|
|||
|
||||
include(${MACRO_DIR}/SetupHifiProject.cmake)
|
||||
|
||||
setup_hifi_project(${TARGET_NAME} FALSE)
|
||||
setup_hifi_project(${TARGET_NAME} TRUE)
|
||||
|
||||
# link in the shared library
|
||||
include(${MACRO_DIR}/LinkHifiLibrary.cmake)
|
||||
|
|
|
@ -377,7 +377,9 @@ void attachVoxelNodeDataToNode(Node* newNode) {
|
|||
int main(int argc, const char * argv[]) {
|
||||
|
||||
pthread_mutex_init(&::treeLock, NULL);
|
||||
|
||||
|
||||
qInstallMsgHandler(sharedMessageHandler);
|
||||
|
||||
NodeList* nodeList = NodeList::createInstance(NODE_TYPE_VOXEL_SERVER, VOXEL_LISTEN_PORT);
|
||||
setvbuf(stdout, NULL, _IOLBF, 0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue