mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:28:02 +02:00
more unix warnings fixes
This commit is contained in:
parent
1f77505871
commit
0200ac9da8
2 changed files with 7 additions and 11 deletions
|
@ -243,7 +243,7 @@ VoxelSystem::~VoxelSystem() {
|
||||||
|
|
||||||
// This is called by the main application thread on both the initialization of the application and when
|
// This is called by the main application thread on both the initialization of the application and when
|
||||||
// the preferences dialog box is called/saved
|
// the preferences dialog box is called/saved
|
||||||
void VoxelSystem::setMaxVoxels(int maxVoxels) {
|
void VoxelSystem::setMaxVoxels(unsigned long maxVoxels) {
|
||||||
if (maxVoxels == _maxVoxels) {
|
if (maxVoxels == _maxVoxels) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -550,7 +550,7 @@ int VoxelSystem::parseData(const QByteArray& packet) {
|
||||||
int flightTime = arrivedAt - sentAt;
|
int flightTime = arrivedAt - sentAt;
|
||||||
|
|
||||||
OCTREE_PACKET_INTERNAL_SECTION_SIZE sectionLength = 0;
|
OCTREE_PACKET_INTERNAL_SECTION_SIZE sectionLength = 0;
|
||||||
int dataBytes = packet.size() - (numBytesPacketHeader + OCTREE_PACKET_EXTRA_HEADERS_SIZE);
|
size_t dataBytes = packet.size() - (numBytesPacketHeader + OCTREE_PACKET_EXTRA_HEADERS_SIZE);
|
||||||
|
|
||||||
int subsection = 1;
|
int subsection = 1;
|
||||||
while (dataBytes > 0) {
|
while (dataBytes > 0) {
|
||||||
|
@ -576,7 +576,7 @@ int VoxelSystem::parseData(const QByteArray& packet) {
|
||||||
packetData.loadFinalizedContent(dataAt, sectionLength);
|
packetData.loadFinalizedContent(dataAt, sectionLength);
|
||||||
if (Application::getInstance()->getLogger()->extraDebugging()) {
|
if (Application::getInstance()->getLogger()->extraDebugging()) {
|
||||||
qDebug("VoxelSystem::parseData() ... Got Packet Section"
|
qDebug("VoxelSystem::parseData() ... Got Packet Section"
|
||||||
" color:%s compressed:%s sequence: %u flight:%d usec size:%d data:%d"
|
" color:%s compressed:%s sequence: %u flight:%d usec size:%d data:%lu"
|
||||||
" subsection:%d sectionLength:%d uncompressed:%d",
|
" subsection:%d sectionLength:%d uncompressed:%d",
|
||||||
debug::valueOf(packetIsColored), debug::valueOf(packetIsCompressed),
|
debug::valueOf(packetIsColored), debug::valueOf(packetIsCompressed),
|
||||||
sequence, flightTime, packet.size(), dataBytes, subsection, sectionLength,
|
sequence, flightTime, packet.size(), dataBytes, subsection, sectionLength,
|
||||||
|
@ -919,13 +919,11 @@ void VoxelSystem::copyWrittenDataSegmentToReadArrays(glBufferIndex segmentStart,
|
||||||
// Depending on if we're using per vertex normals, we will need more or less vertex points per voxel
|
// Depending on if we're using per vertex normals, we will need more or less vertex points per voxel
|
||||||
int vertexPointsPerVoxel = GLOBAL_NORMALS_VERTEX_POINTS_PER_VOXEL;
|
int vertexPointsPerVoxel = GLOBAL_NORMALS_VERTEX_POINTS_PER_VOXEL;
|
||||||
|
|
||||||
GLintptr segmentStartAt = segmentStart * vertexPointsPerVoxel * sizeof(GLfloat);
|
|
||||||
GLsizeiptr segmentSizeBytes = segmentLength * vertexPointsPerVoxel * sizeof(GLfloat);
|
GLsizeiptr segmentSizeBytes = segmentLength * vertexPointsPerVoxel * sizeof(GLfloat);
|
||||||
GLfloat* readVerticesAt = _readVerticesArray + (segmentStart * vertexPointsPerVoxel);
|
GLfloat* readVerticesAt = _readVerticesArray + (segmentStart * vertexPointsPerVoxel);
|
||||||
GLfloat* writeVerticesAt = _writeVerticesArray + (segmentStart * vertexPointsPerVoxel);
|
GLfloat* writeVerticesAt = _writeVerticesArray + (segmentStart * vertexPointsPerVoxel);
|
||||||
memcpy(readVerticesAt, writeVerticesAt, segmentSizeBytes);
|
memcpy(readVerticesAt, writeVerticesAt, segmentSizeBytes);
|
||||||
|
|
||||||
segmentStartAt = segmentStart * vertexPointsPerVoxel * sizeof(GLubyte);
|
|
||||||
segmentSizeBytes = segmentLength * vertexPointsPerVoxel * sizeof(GLubyte);
|
segmentSizeBytes = segmentLength * vertexPointsPerVoxel * sizeof(GLubyte);
|
||||||
GLubyte* readColorsAt = _readColorsArray + (segmentStart * vertexPointsPerVoxel);
|
GLubyte* readColorsAt = _readColorsArray + (segmentStart * vertexPointsPerVoxel);
|
||||||
GLubyte* writeColorsAt = _writeColorsArray + (segmentStart * vertexPointsPerVoxel);
|
GLubyte* writeColorsAt = _writeColorsArray + (segmentStart * vertexPointsPerVoxel);
|
||||||
|
@ -1958,10 +1956,8 @@ bool VoxelSystem::showAllSubTreeOperation(OctreeElement* element, void* extraDat
|
||||||
// If we've culled at least once, then we will use the status of this voxel in the last culled frustum to determine
|
// If we've culled at least once, then we will use the status of this voxel in the last culled frustum to determine
|
||||||
// how to proceed. If we've never culled, then we just consider all these voxels to be UNKNOWN so that we will not
|
// how to proceed. If we've never culled, then we just consider all these voxels to be UNKNOWN so that we will not
|
||||||
// consider that case.
|
// consider that case.
|
||||||
ViewFrustum::location inLastCulledFrustum;
|
|
||||||
|
|
||||||
if (args->culledOnce && args->wantDeltaFrustums) {
|
if (args->culledOnce && args->wantDeltaFrustums) {
|
||||||
inLastCulledFrustum = voxel->inFrustum(args->lastViewFrustum);
|
ViewFrustum::location inLastCulledFrustum = voxel->inFrustum(args->lastViewFrustum);
|
||||||
|
|
||||||
// if this node is fully inside our last culled view frustum, then we don't need to recurse further
|
// if this node is fully inside our last culled view frustum, then we don't need to recurse further
|
||||||
if (inLastCulledFrustum == ViewFrustum::INSIDE) {
|
if (inLastCulledFrustum == ViewFrustum::INSIDE) {
|
||||||
|
@ -2001,7 +1997,7 @@ bool VoxelSystem::hideOutOfViewOperation(OctreeElement* element, void* extraData
|
||||||
// If we've culled at least once, then we will use the status of this voxel in the last culled frustum to determine
|
// If we've culled at least once, then we will use the status of this voxel in the last culled frustum to determine
|
||||||
// how to proceed. If we've never culled, then we just consider all these voxels to be UNKNOWN so that we will not
|
// how to proceed. If we've never culled, then we just consider all these voxels to be UNKNOWN so that we will not
|
||||||
// consider that case.
|
// consider that case.
|
||||||
ViewFrustum::location inLastCulledFrustum;
|
ViewFrustum::location inLastCulledFrustum = ViewFrustum::OUTSIDE; // assume outside, but should get reset to actual value
|
||||||
|
|
||||||
if (args->culledOnce && args->wantDeltaFrustums) {
|
if (args->culledOnce && args->wantDeltaFrustums) {
|
||||||
inLastCulledFrustum = voxel->inFrustum(args->lastViewFrustum);
|
inLastCulledFrustum = voxel->inFrustum(args->lastViewFrustum);
|
||||||
|
|
|
@ -67,7 +67,7 @@ public:
|
||||||
|
|
||||||
ViewFrustum* getLastCulledViewFrustum() { return &_lastCulledViewFrustum; }
|
ViewFrustum* getLastCulledViewFrustum() { return &_lastCulledViewFrustum; }
|
||||||
|
|
||||||
void setMaxVoxels(int maxVoxels);
|
void setMaxVoxels(unsigned long maxVoxels);
|
||||||
long int getMaxVoxels() const { return _maxVoxels; }
|
long int getMaxVoxels() const { return _maxVoxels; }
|
||||||
unsigned long getVoxelMemoryUsageRAM() const { return _memoryUsageRAM; }
|
unsigned long getVoxelMemoryUsageRAM() const { return _memoryUsageRAM; }
|
||||||
unsigned long getVoxelMemoryUsageVBO() const { return _memoryUsageVBO; }
|
unsigned long getVoxelMemoryUsageVBO() const { return _memoryUsageVBO; }
|
||||||
|
@ -263,7 +263,7 @@ private:
|
||||||
bool _usePrimitiveRenderer; ///< Flag primitive renderer for use
|
bool _usePrimitiveRenderer; ///< Flag primitive renderer for use
|
||||||
PrimitiveRenderer* _renderer; ///< Voxel renderer
|
PrimitiveRenderer* _renderer; ///< Voxel renderer
|
||||||
|
|
||||||
static const int _sNumOctantsPerHemiVoxel = 4;
|
static const unsigned int _sNumOctantsPerHemiVoxel = 4;
|
||||||
static int _sCorrectedChildIndex[8];
|
static int _sCorrectedChildIndex[8];
|
||||||
static unsigned short _sSwizzledOcclusionBits[64]; ///< Swizzle value of bit pairs of the value of index
|
static unsigned short _sSwizzledOcclusionBits[64]; ///< Swizzle value of bit pairs of the value of index
|
||||||
static unsigned char _sOctantIndexToBitMask[8]; ///< Map octant index to partition mask
|
static unsigned char _sOctantIndexToBitMask[8]; ///< Map octant index to partition mask
|
||||||
|
|
Loading…
Reference in a new issue