Merge remote-tracking branch 'upstream/master' into particles

This commit is contained in:
Jeffrey Ventrella 2013-07-31 15:12:54 -07:00
commit 6c1cc911d5
17 changed files with 73 additions and 49 deletions

1
.gitignore vendored
View file

@ -4,6 +4,7 @@ CMakeFiles/
CMakeScripts/
cmake_install.cmake
build/
Makefile
# Xcode
*.xcodeproj

View file

@ -2,6 +2,13 @@ cmake_minimum_required(VERSION 2.8)
project(hifi)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} $ENV{QT_CMAKE_PREFIX_PATH})
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
add_subdirectory(animation-server)
add_subdirectory(avatar-mixer)
add_subdirectory(audio-mixer)

View file

@ -3,13 +3,13 @@ MACRO(SETUP_HIFI_LIBRARY TARGET)
# grab the implemenation and header files
file(GLOB LIB_SRCS src/*.h src/*.cpp)
set(LIB_SRCS ${LIB_SRCS} ${WRAPPED_SRCS})
# create a library and set the property so it can be referenced later
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}")
find_package(Qt5Core REQUIRED)
qt5_use_modules(${TARGET} Core)
target_link_libraries(${TARGET} ${QT_LIBRARIES})
ENDMACRO(SETUP_HIFI_LIBRARY _target)

View file

@ -8,9 +8,8 @@ MACRO(SETUP_HIFI_PROJECT TARGET INCLUDE_QT)
add_executable(${TARGET} ${TARGET_SRCS})
IF (${INCLUDE_QT})
find_package(Qt4 REQUIRED QtCore)
include(${QT_USE_FILE})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${QT_QTGUI_INCLUDE_DIR}")
find_package(Qt5Core REQUIRED)
qt5_use_modules(${TARGET} Core)
ENDIF()
target_link_libraries(${TARGET} ${QT_LIBRARIES})

View file

@ -67,21 +67,21 @@ if (APPLE)
endif (APPLE)
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork QtOpenGL QtWebKit QtSvg)
include(${QT_USE_FILE})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${QT_QTGUI_INCLUDE_DIR}")
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(Qt5Svg REQUIRED)
set(QUAZIP_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/quazip)
add_subdirectory(external/fervor/)
include_directories(external/fervor/)
# run qt moc on qt-enabled headers
qt4_wrap_cpp(INTERFACE_SRCS src/Application.h src/Webcam.h src/avatar/AvatarVoxelSystem.h
src/avatar/Face.h src/ui/BandwidthDialog.h src/ui/VoxelStatsDialog.h)
# create the executable, make it a bundle on OS X
add_executable(${TARGET_NAME} MACOSX_BUNDLE ${INTERFACE_SRCS})
qt5_use_modules(${TARGET_NAME} Core Gui Network OpenGL Svg)
# link in the hifi shared library
include(${MACRO_DIR}/LinkHifiLibrary.cmake)
@ -130,8 +130,7 @@ include_directories(
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${OPENCV_INCLUDE_DIRS}")
target_link_libraries(
${TARGET_NAME}
${QT_LIBRARIES}
${TARGET_NAME}
${LIBVPX_LIBRARIES}
${MOTIONDRIVER_LIBRARIES}
${OPENCV_LIBRARIES}

View file

@ -1,21 +1,26 @@
cmake_minimum_required(VERSION 2.8)
project(Fervor)
find_package(Qt4 REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5WebKit REQUIRED)
find_package(Qt5Widgets REQUIRED)
add_definitions(-DFV_GUI)
file(GLOB FERVOR_SOURCES *.cpp)
file(GLOB FERVOR_HEADERS *.h)
file(GLOB FERVOR_UI *.ui)
qt5_wrap_ui(FERVOR_WRAPPED_UI ${FERVOR_UI})
LIST(GET FERVOR_HEADERS 1 FIRST_HEADER)
GET_FILENAME_COMPONENT(HEADER_PATH ${FIRST_HEADER} PATH)
list(REMOVE_ITEM FERVOR_HEADERS ${HEADER_PATH}/fvversioncomparator.h)
file(GLOB FERVOR_UI *.ui)
qt4_wrap_ui(FERVOR_WRAPPED_UI ${FERVOR_UI})
qt4_wrap_cpp(FERVOR_MOC_SOURCES ${FERVOR_HEADERS})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/")
find_package(Quazip REQUIRED)
@ -25,4 +30,6 @@ include_directories(
)
add_library(fervor ${FERVOR_SOURCES} ${FERVOR_HEADERS} ${FERVOR_MOC_SOURCES} ${FERVOR_WRAPPED_UI})
target_link_libraries(fervor ${QUAZIP_LIBRARIES})
target_link_libraries(fervor ${QUAZIP_LIBRARIES})
qt5_use_modules(fervor Core Network Widgets WebKit)

View file

@ -1,7 +1,7 @@
#ifndef FVPLATFORM_H
#define FVPLATFORM_H
#include <QObject>
#include <QtCore/QObject>
class FvPlatform : public QObject
{

View file

@ -164,9 +164,9 @@ void GLCanvas::wheelEvent(QWheelEvent* event) {
Application::getInstance()->wheelEvent(event);
}
void messageHandler(QtMsgType type, const char* message) {
fprintf(stdout, "%s", message);
LogDisplay::instance.addMessage(message);
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) {
fprintf(stdout, "%s", message.toLocal8Bit().constData());
LogDisplay::instance.addMessage(message.toLocal8Bit().constData());
}
Application::Application(int& argc, char** argv, timeval &startup_time) :
@ -222,7 +222,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
_applicationStartupTime = startup_time;
_window->setWindowTitle("Interface");
qInstallMsgHandler(messageHandler);
qInstallMessageHandler(messageHandler);
unsigned int listenPort = 0; // bind to an ephemeral port by default
const char** constArgv = const_cast<const char**>(argv);
@ -1221,7 +1221,7 @@ void Application::editPreferences() {
if (domainServerHostname->text().size() > 0) {
// the user input a new hostname, use that
newHostname = domainServerHostname->text().toAscii();
newHostname = domainServerHostname->text().toLocal8Bit();
} else {
// the user left the field blank, use the default hostname
newHostname = QByteArray(DEFAULT_DOMAIN_HOSTNAME);
@ -1517,12 +1517,12 @@ bool Application::sendVoxelsOperation(VoxelNode* node, void* extraData) {
}
void Application::exportVoxels() {
QString desktopLocation = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
QString suggestedName = desktopLocation.append("/voxels.svo");
QString fileNameString = QFileDialog::getSaveFileName(_glWidget, tr("Export Voxels"), suggestedName,
tr("Sparse Voxel Octree Files (*.svo)"));
QByteArray fileNameAscii = fileNameString.toAscii();
QByteArray fileNameAscii = fileNameString.toLocal8Bit();
const char* fileName = fileNameAscii.data();
VoxelNode* selectedNode = _voxels.getVoxelAt(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s);
if (selectedNode) {
@ -1537,11 +1537,11 @@ void Application::exportVoxels() {
const char* IMPORT_FILE_TYPES = "Sparse Voxel Octree Files, Square PNG, Schematic Files (*.svo *.png *.schematic)";
void Application::importVoxelsToClipboard() {
QString desktopLocation = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
QString fileNameString = QFileDialog::getOpenFileName(_glWidget, tr("Import Voxels to Clipboard"), desktopLocation,
tr(IMPORT_FILE_TYPES));
QByteArray fileNameAscii = fileNameString.toAscii();
QByteArray fileNameAscii = fileNameString.toLocal8Bit();
const char* fileName = fileNameAscii.data();
_clipboardTree.eraseAllVoxels();
@ -1571,11 +1571,11 @@ void Application::importVoxelsToClipboard() {
}
void Application::importVoxels() {
QString desktopLocation = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
QString fileNameString = QFileDialog::getOpenFileName(_glWidget, tr("Import Voxels"), desktopLocation,
tr(IMPORT_FILE_TYPES));
QByteArray fileNameAscii = fileNameString.toAscii();
QByteArray fileNameAscii = fileNameString.toLocal8Bit();
const char* fileName = fileNameAscii.data();
VoxelTree importVoxels;
@ -1989,8 +1989,11 @@ const float MAX_VOXEL_EDIT_DISTANCE = 20.0f;
const float HEAD_SPHERE_RADIUS = 0.07;
static uint16_t DEFAULT_NODE_ID_REF = 1;
bool Application::isLookingAtOtherAvatar(glm::vec3& mouseRayOrigin, glm::vec3& mouseRayDirection,
glm::vec3& eyePosition, uint16_t& nodeID) {
glm::vec3& eyePosition, uint16_t& nodeID = DEFAULT_NODE_ID_REF) {
NodeList* nodeList = NodeList::getInstance();
for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) {
@ -2047,8 +2050,8 @@ void Application::update(float deltaTime) {
// Set where I am looking based on my mouse ray (so that other people can see)
glm::vec3 eyePosition;
uint16_t ignored;
_isLookingAtOtherAvatar = isLookingAtOtherAvatar(mouseRayOrigin, mouseRayDirection, eyePosition, ignored);
_isLookingAtOtherAvatar = isLookingAtOtherAvatar(mouseRayOrigin, mouseRayDirection, eyePosition);
if (_isLookingAtOtherAvatar) {
// If the mouse is over another avatar's head...
glm::vec3 myLookAtFromMouse(eyePosition);
@ -2314,8 +2317,8 @@ void Application::updateAvatar(float deltaTime) {
_viewFrustum.computePickRay(MIDPOINT_OF_SCREEN, MIDPOINT_OF_SCREEN, screenCenterRayOrigin, screenCenterRayDirection);
glm::vec3 eyePosition;
uint16_t ignored;
_isLookingAtOtherAvatar = isLookingAtOtherAvatar(screenCenterRayOrigin, screenCenterRayDirection, eyePosition, ignored);
_isLookingAtOtherAvatar = isLookingAtOtherAvatar(screenCenterRayOrigin, screenCenterRayDirection, eyePosition);
if (_isLookingAtOtherAvatar) {
glm::vec3 myLookAtFromMouse(eyePosition);
_myAvatar.getHead().setLookAtPosition(myLookAtFromMouse);
@ -3628,7 +3631,7 @@ void Application::saveSettings(QSettings* settings) {
}
void Application::importSettings() {
QString locationDir(QDesktopServices::displayName(QDesktopServices::DesktopLocation));
QString locationDir(QStandardPaths::displayName(QStandardPaths::DesktopLocation));
QString fileName = QFileDialog::getOpenFileName(_window,
tr("Open .ini config file"),
locationDir,
@ -3640,7 +3643,7 @@ void Application::importSettings() {
}
void Application::exportSettings() {
QString locationDir(QDesktopServices::displayName(QDesktopServices::DesktopLocation));
QString locationDir(QStandardPaths::displayName(QStandardPaths::DesktopLocation));
QString fileName = QFileDialog::getSaveFileName(_window,
tr("Save .ini config file"),
locationDir,

View file

@ -121,7 +121,7 @@ void AvatarVoxelSystem::setVoxelURL(const QUrl& url) {
// handle "file://" urls...
if (url.isLocalFile()) {
QString pathString = url.path();
QByteArray pathAsAscii = pathString.toAscii();
QByteArray pathAsAscii = pathString.toLocal8Bit();
const char* path = pathAsAscii.data();
readFromSVOFile(path);
return;
@ -255,7 +255,7 @@ void AvatarVoxelSystem::handleVoxelDownloadProgress(qint64 bytesReceived, qint64
}
void AvatarVoxelSystem::handleVoxelReplyError() {
qDebug("%s\n", _voxelReply->errorString().toAscii().constData());
qDebug("%s\n", _voxelReply->errorString().toLocal8Bit().constData());
_voxelReply->disconnect(this);
_voxelReply->deleteLater();

View file

@ -66,7 +66,7 @@ bool ChatEntry::keyPressEvent(QKeyEvent* event) {
return true;
}
if (_contents.size() < MAX_CONTENT_LENGTH) {
_contents.insert(_cursorPos, 1, text.at(0).toAscii());
_contents.insert(_cursorPos, 1, text.at(0).toLatin1());
_cursorPos++;
}
return true;

View file

@ -81,12 +81,12 @@ def hifiJob(String targetName, Boolean deploy) {
static Closure cmakeBuild(srcDir, instCommand) {
return { project ->
project / 'builders' / 'hudson.plugins.cmake.CmakeBuilder' {
sourceDir srcDir
sourceDir '.'
buildDir 'build'
installDir ''
buildType 'RelWithDebInfo'
generator 'Unix Makefiles'
makeCommand 'make'
makeCommand "make ${srcDir}"
installCommand instCommand
preloadScript ''
cmakeArgs ''

View file

@ -8,9 +8,13 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../../cm
set(TARGET_NAME avatars)
find_package(Qt5Core)
include(${MACRO_DIR}/SetupHifiLibrary.cmake)
setup_hifi_library(${TARGET_NAME})
qt5_use_modules(${TARGET_NAME} Core)
include(${MACRO_DIR}/IncludeGLM.cmake)
include_glm(${TARGET_NAME} ${ROOT_DIR})

View file

@ -6,9 +6,13 @@ set(MACRO_DIR ${ROOT_DIR}/cmake/macros)
set(TARGET_NAME shared)
project(${TARGET_NAME})
find_package(Qt5Core REQUIRED)
include(${MACRO_DIR}/SetupHifiLibrary.cmake)
setup_hifi_library(${TARGET_NAME})
qt5_use_modules(${TARGET_NAME} Core)
set(EXTERNAL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external)
if (WIN32)

View file

@ -512,7 +512,7 @@ void NodeList::loadData(QSettings *settings) {
if (domainServerHostname.size() > 0) {
memset(_domainHostname, 0, MAX_HOSTNAME_BYTES);
memcpy(_domainHostname, domainServerHostname.toAscii().constData(), domainServerHostname.size());
memcpy(_domainHostname, domainServerHostname.toLocal8Bit().constData(), domainServerHostname.size());
}
settings->endGroup();

View file

@ -188,8 +188,8 @@ bool cmdOptionExists(int argc, const char * argv[],const char* option) {
return false;
}
void sharedMessageHandler(QtMsgType type, const char* message) {
fprintf(stdout, "%s", message);
void sharedMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) {
fprintf(stdout, "%s", message.toLocal8Bit().constData());
}
//////////////////////////////////////////////////////////////////////////////////////////

View file

@ -68,7 +68,7 @@ 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);
void sharedMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message);
struct VoxelDetail {
float x;

View file

@ -429,7 +429,7 @@ void attachVoxelNodeDataToNode(Node* newNode) {
int main(int argc, const char * argv[]) {
pthread_mutex_init(&::treeLock, NULL);
qInstallMsgHandler(sharedMessageHandler);
qInstallMessageHandler(sharedMessageHandler);
NodeList* nodeList = NodeList::createInstance(NODE_TYPE_VOXEL_SERVER, VOXEL_LISTEN_PORT);
setvbuf(stdout, NULL, _IOLBF, 0);