mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:17:43 +02:00
Merge pull request #5141 from sethalves/overloaded-virtual
use -Woverloaded-virtual with g++. quiet compiler warnings
This commit is contained in:
commit
d88d9b2b88
5 changed files with 24 additions and 16 deletions
|
@ -49,7 +49,7 @@ if (WIN32)
|
||||||
else ()
|
else ()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fno-strict-aliasing -Wno-unused-parameter")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fno-strict-aliasing -Wno-unused-parameter")
|
||||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb -Woverloaded-virtual")
|
||||||
endif ()
|
endif ()
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
|
|
||||||
|
|
|
@ -141,11 +141,7 @@ void RenderablePolyVoxEntityItem::setVoxelVolumeSize(glm::vec3 voxelVolumeSize)
|
||||||
decompressVolumeData();
|
decompressVolumeData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderablePolyVoxEntityItem::setVoxelSurfaceStyle(PolyVoxSurfaceStyle voxelSurfaceStyle) {
|
void RenderablePolyVoxEntityItem::updateVoxelSurfaceStyle(PolyVoxSurfaceStyle voxelSurfaceStyle) {
|
||||||
if (voxelSurfaceStyle == _voxelSurfaceStyle) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if we are switching to or from "edged" we need to force a resize of _volData.
|
// if we are switching to or from "edged" we need to force a resize of _volData.
|
||||||
if (voxelSurfaceStyle == SURFACE_EDGED_CUBIC ||
|
if (voxelSurfaceStyle == SURFACE_EDGED_CUBIC ||
|
||||||
_voxelSurfaceStyle == SURFACE_EDGED_CUBIC) {
|
_voxelSurfaceStyle == SURFACE_EDGED_CUBIC) {
|
||||||
|
@ -153,10 +149,10 @@ void RenderablePolyVoxEntityItem::setVoxelSurfaceStyle(PolyVoxSurfaceStyle voxel
|
||||||
delete _volData;
|
delete _volData;
|
||||||
}
|
}
|
||||||
_volData = nullptr;
|
_volData = nullptr;
|
||||||
PolyVoxEntityItem::setVoxelSurfaceStyle(voxelSurfaceStyle);
|
_voxelSurfaceStyle = voxelSurfaceStyle;
|
||||||
setVoxelVolumeSize(_voxelVolumeSize);
|
setVoxelVolumeSize(_voxelVolumeSize);
|
||||||
} else {
|
} else {
|
||||||
PolyVoxEntityItem::setVoxelSurfaceStyle(voxelSurfaceStyle);
|
_voxelSurfaceStyle = voxelSurfaceStyle;
|
||||||
}
|
}
|
||||||
_needsModelReload = true;
|
_needsModelReload = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,17 +36,15 @@ public:
|
||||||
|
|
||||||
virtual uint8_t getVoxel(int x, int y, int z);
|
virtual uint8_t getVoxel(int x, int y, int z);
|
||||||
virtual void setVoxel(int x, int y, int z, uint8_t toValue);
|
virtual void setVoxel(int x, int y, int z, uint8_t toValue);
|
||||||
|
|
||||||
void updateOnCount(int x, int y, int z, uint8_t new_value);
|
void updateOnCount(int x, int y, int z, uint8_t new_value);
|
||||||
|
|
||||||
void render(RenderArgs* args);
|
void render(RenderArgs* args);
|
||||||
virtual bool supportsDetailedRayIntersection() const { return true; }
|
virtual bool supportsDetailedRayIntersection() const { return true; }
|
||||||
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
bool& keepSearching, OctreeElement*& element, float& distance, BoxFace& face,
|
bool& keepSearching, OctreeElement*& element, float& distance, BoxFace& face,
|
||||||
void** intersectedObject, bool precisionPicking) const;
|
void** intersectedObject, bool precisionPicking) const;
|
||||||
|
|
||||||
virtual void setVoxelSurfaceStyle(PolyVoxSurfaceStyle voxelSurfaceStyle);
|
|
||||||
|
|
||||||
void getModel();
|
void getModel();
|
||||||
|
|
||||||
virtual void setVoxelData(QByteArray voxelData);
|
virtual void setVoxelData(QByteArray voxelData);
|
||||||
|
@ -74,6 +72,9 @@ public:
|
||||||
|
|
||||||
SIMPLE_RENDERABLE();
|
SIMPLE_RENDERABLE();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void updateVoxelSurfaceStyle(PolyVoxSurfaceStyle voxelSurfaceStyle);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The PolyVoxEntityItem class has _voxelData which contains dimensions and compressed voxel data. The dimensions
|
// The PolyVoxEntityItem class has _voxelData which contains dimensions and compressed voxel data. The dimensions
|
||||||
// may not match _voxelVolumeSize.
|
// may not match _voxelVolumeSize.
|
||||||
|
@ -82,6 +83,7 @@ private:
|
||||||
void compressVolumeData();
|
void compressVolumeData();
|
||||||
void decompressVolumeData();
|
void decompressVolumeData();
|
||||||
|
|
||||||
|
|
||||||
PolyVox::SimpleVolume<uint8_t>* _volData = nullptr;
|
PolyVox::SimpleVolume<uint8_t>* _volData = nullptr;
|
||||||
model::Geometry _modelGeometry;
|
model::Geometry _modelGeometry;
|
||||||
bool _needsModelReload = true;
|
bool _needsModelReload = true;
|
||||||
|
|
|
@ -168,3 +168,10 @@ void PolyVoxEntityItem::debugDump() const {
|
||||||
qCDebug(entities) << " dimensions:" << debugTreeVector(getDimensions());
|
qCDebug(entities) << " dimensions:" << debugTreeVector(getDimensions());
|
||||||
qCDebug(entities) << " getLastEdited:" << debugTime(getLastEdited(), now);
|
qCDebug(entities) << " getLastEdited:" << debugTime(getLastEdited(), now);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PolyVoxEntityItem::setVoxelSurfaceStyle(PolyVoxSurfaceStyle voxelSurfaceStyle) {
|
||||||
|
if (voxelSurfaceStyle == _voxelSurfaceStyle) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
updateVoxelSurfaceStyle(voxelSurfaceStyle);
|
||||||
|
}
|
||||||
|
|
|
@ -61,10 +61,9 @@ class PolyVoxEntityItem : public EntityItem {
|
||||||
SURFACE_EDGED_CUBIC
|
SURFACE_EDGED_CUBIC
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void setVoxelSurfaceStyle(PolyVoxSurfaceStyle voxelSurfaceStyle) { _voxelSurfaceStyle = voxelSurfaceStyle; }
|
void setVoxelSurfaceStyle(PolyVoxSurfaceStyle voxelSurfaceStyle);
|
||||||
virtual void setVoxelSurfaceStyle(uint16_t voxelSurfaceStyle) {
|
// this other version of setVoxelSurfaceStyle is needed for SET_ENTITY_PROPERTY_FROM_PROPERTIES
|
||||||
setVoxelSurfaceStyle((PolyVoxSurfaceStyle) voxelSurfaceStyle);
|
void setVoxelSurfaceStyle(uint16_t voxelSurfaceStyle) { setVoxelSurfaceStyle((PolyVoxSurfaceStyle) voxelSurfaceStyle); }
|
||||||
}
|
|
||||||
virtual PolyVoxSurfaceStyle getVoxelSurfaceStyle() const { return _voxelSurfaceStyle; }
|
virtual PolyVoxSurfaceStyle getVoxelSurfaceStyle() const { return _voxelSurfaceStyle; }
|
||||||
|
|
||||||
static const glm::vec3 DEFAULT_VOXEL_VOLUME_SIZE;
|
static const glm::vec3 DEFAULT_VOXEL_VOLUME_SIZE;
|
||||||
|
@ -89,6 +88,10 @@ class PolyVoxEntityItem : public EntityItem {
|
||||||
static QByteArray makeEmptyVoxelData(quint16 voxelXSize = 16, quint16 voxelYSize = 16, quint16 voxelZSize = 16);
|
static QByteArray makeEmptyVoxelData(quint16 voxelXSize = 16, quint16 voxelYSize = 16, quint16 voxelZSize = 16);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void updateVoxelSurfaceStyle(PolyVoxSurfaceStyle voxelSurfaceStyle) {
|
||||||
|
_voxelSurfaceStyle = voxelSurfaceStyle;
|
||||||
|
}
|
||||||
|
|
||||||
glm::vec3 _voxelVolumeSize; // this is always 3 bytes
|
glm::vec3 _voxelVolumeSize; // this is always 3 bytes
|
||||||
QByteArray _voxelData;
|
QByteArray _voxelData;
|
||||||
PolyVoxSurfaceStyle _voxelSurfaceStyle;
|
PolyVoxSurfaceStyle _voxelSurfaceStyle;
|
||||||
|
|
Loading…
Reference in a new issue