more windows build hackery

This commit is contained in:
Brad Hefta-Gaub 2014-01-10 20:36:37 -08:00
parent 44893b0a8c
commit b0f8e21d06
4 changed files with 66 additions and 31 deletions

View file

@ -10,7 +10,20 @@
#define __hifi__AvatarData__
#include <string>
/* VS2010 defines stdint.h, but not inttypes.h */
#if defined(_MSC_VER)
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#define PRId64 "I64d"
#else
#include <inttypes.h>
#endif
#include <vector>
#include <glm/glm.hpp>
@ -50,7 +63,7 @@ class JointData;
class AvatarData : public NodeData {
Q_OBJECT
Q_PROPERTY(glm::vec3 position READ getPosition WRITE setPosition)
Q_PROPERTY(glm::vec3 handPosition READ getHandPosition WRITE setHandPosition)
Q_PROPERTY(float bodyYaw READ getBodyYaw WRITE setBodyYaw)
@ -60,19 +73,19 @@ class AvatarData : public NodeData {
public:
AvatarData(Node* owningNode = NULL);
~AvatarData();
const glm::vec3& getPosition() const { return _position; }
void setPosition(const glm::vec3 position) { _position = position; }
const glm::vec3& getHandPosition() const { return _handPosition; }
void setHandPosition(const glm::vec3 handPosition) { _handPosition = handPosition; }
int getBroadcastData(unsigned char* destinationBuffer);
int parseData(unsigned char* sourceBuffer, int numBytes);
QUuid& getUUID() { return _uuid; }
void setUUID(const QUuid& uuid) { _uuid = uuid; }
// Body Rotation
float getBodyYaw() const { return _bodyYaw; }
void setBodyYaw(float bodyYaw) { _bodyYaw = bodyYaw; }
@ -80,19 +93,19 @@ public:
void setBodyPitch(float bodyPitch) { _bodyPitch = bodyPitch; }
float getBodyRoll() const { return _bodyRoll; }
void setBodyRoll(float bodyRoll) { _bodyRoll = bodyRoll; }
// Scale
float getNewScale() const { return _newScale; }
void setNewScale(float);
// Hand State
void setHandState(char s) { _handState = s; }
char getHandState() const { return _handState; }
// key state
void setKeyState(KeyState s) { _keyState = s; }
KeyState keyState() const { return _keyState; }
// chat message
void setChatMessage(const std::string& msg) { _chatMessage = msg; }
void setChatMessage(const QString& string) { _chatMessage = string.toLocal8Bit().constData(); }
@ -102,7 +115,7 @@ public:
bool isChatCirclingEnabled() const { return _isChatCirclingEnabled; }
const QUuid& getLeaderUUID() const { return _leaderUUID; }
const HeadData* getHeadData() const { return _headData; }
const HandData* getHandData() const { return _handData; }
@ -119,13 +132,13 @@ public:
/// \return whether or not the sphere penetrated
virtual bool findSpherePenetration(const glm::vec3& penetratorCenter, float penetratorRadius,
glm::vec3& penetration, int skeletonSkipIndex = -1) const { return false; }
protected:
QUuid _uuid;
glm::vec3 _position;
glm::vec3 _handPosition;
// Body rotation
float _bodyYaw;
float _bodyPitch;
@ -139,20 +152,20 @@ protected:
// Hand state (are we grabbing something or not)
char _handState;
// key state
KeyState _keyState;
// chat message
std::string _chatMessage;
bool _isChatCirclingEnabled;
std::vector<JointData> _joints;
HeadData* _headData;
HandData* _handData;
private:
// privatize the copy constructor and assignment operator so they cannot be called
AvatarData(const AvatarData&);
@ -161,7 +174,7 @@ private:
class JointData {
public:
int jointID;
glm::quat rotation;
};

View file

@ -10,7 +10,23 @@
#define __hifi__OctreeQuery__
#include <string>
/* VS2010 defines stdint.h, but not inttypes.h */
#if defined(_MSC_VER)
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#define PRId64 "I64d"
#else
#include <inttypes.h>
#endif
#include <vector>
#include <glm/glm.hpp>
@ -33,17 +49,17 @@ const int WANT_COMPRESSION = 4; // 5th bit
class OctreeQuery : public NodeData {
Q_OBJECT
public:
OctreeQuery(Node* owningNode = NULL);
virtual ~OctreeQuery();
int getBroadcastData(unsigned char* destinationBuffer);
int parseData(unsigned char* sourceBuffer, int numBytes);
QUuid& getUUID() { return _uuid; }
void setUUID(const QUuid& uuid) { _uuid = uuid; }
// getters for camera details
const glm::vec3& getCameraPosition() const { return _cameraPosition; }
const glm::quat& getCameraOrientation() const { return _cameraOrientation; }
@ -55,7 +71,7 @@ public:
glm::vec3 calculateCameraDirection() const;
// setters for camera details
// setters for camera details
void setCameraPosition(const glm::vec3& position) { _cameraPosition = position; }
void setCameraOrientation(const glm::quat& orientation) { _cameraOrientation = orientation; }
void setCameraFov(float fov) { _cameraFov = fov; }
@ -63,7 +79,7 @@ public:
void setCameraNearClip(float nearClip) { _cameraNearClip = nearClip; }
void setCameraFarClip(float farClip) { _cameraFarClip = farClip; }
void setCameraEyeOffsetPosition(const glm::vec3& eyeOffsetPosition) { _cameraEyeOffsetPosition = eyeOffsetPosition; }
// related to Octree Sending strategies
bool getWantColor() const { return _wantColor; }
bool getWantDelta() const { return _wantDelta; }
@ -73,7 +89,7 @@ public:
int getMaxOctreePacketsPerSecond() const { return _maxOctreePPS; }
float getOctreeSizeScale() const { return _octreeElementSizeScale; }
int getBoundaryLevelAdjust() const { return _boundaryLevelAdjust; }
public slots:
void setWantLowResMoving(bool wantLowResMoving) { _wantLowResMoving = wantLowResMoving; }
void setWantColor(bool wantColor) { _wantColor = wantColor; }
@ -83,10 +99,10 @@ public slots:
void setMaxOctreePacketsPerSecond(int maxOctreePPS) { _maxOctreePPS = maxOctreePPS; }
void setOctreeSizeScale(float octreeSizeScale) { _octreeElementSizeScale = octreeSizeScale; }
void setBoundaryLevelAdjust(int boundaryLevelAdjust) { _boundaryLevelAdjust = boundaryLevelAdjust; }
protected:
QUuid _uuid;
// camera details for the avatar
glm::vec3 _cameraPosition;
glm::quat _cameraOrientation;
@ -95,7 +111,7 @@ protected:
float _cameraNearClip;
float _cameraFarClip;
glm::vec3 _cameraEyeOffsetPosition;
// octree server sending items
bool _wantColor;
bool _wantDelta;
@ -105,7 +121,7 @@ protected:
int _maxOctreePPS;
float _octreeElementSizeScale; /// used for LOD calculations
int _boundaryLevelAdjust; /// used for LOD calculations
private:
// privatize the copy constructor and assignment operator so they cannot be called
OctreeQuery(const OctreeQuery&);

View file

@ -533,9 +533,13 @@ void NodeList::sendDomainServerCheckIn() {
const int IP_ADDRESS_BYTES = 4;
// check in packet has header, optional UUID, node type, port, IP, node types of interest, null termination
#ifdef _WIN32
const int numPacketBytes = MAX_PACKET_SIZE;
#else
int numPacketBytes = sizeof(PACKET_TYPE) + sizeof(PACKET_VERSION) + sizeof(NODE_TYPE) +
NUM_BYTES_RFC4122_UUID + (2 * (sizeof(uint16_t) + IP_ADDRESS_BYTES)) +
numBytesNodesOfInterest + sizeof(unsigned char);
#endif
unsigned char checkInPacket[numPacketBytes];
unsigned char* packetPosition = checkInPacket;

View file

@ -9,6 +9,8 @@
#ifndef __hifi__Tags__
#define __hifi__Tags__
#include <stdint.h>
#include <cstdlib>
#include <cstring>