mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 21:18:58 +02:00
more warnings fixes
This commit is contained in:
parent
e99ad75a28
commit
52842cb287
5 changed files with 15 additions and 16 deletions
|
@ -270,7 +270,7 @@ static NetworkMesh* buildNetworkMesh(const FBXMesh& mesh, const QUrl& textureBas
|
||||||
NetworkMesh* networkMesh = new NetworkMesh();
|
NetworkMesh* networkMesh = new NetworkMesh();
|
||||||
|
|
||||||
int totalIndices = 0;
|
int totalIndices = 0;
|
||||||
bool checkForTexcoordLightmap = false;
|
//bool checkForTexcoordLightmap = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -393,8 +393,7 @@ static NetworkMaterial* buildNetworkMaterial(const FBXMaterial& material, const
|
||||||
auto textureCache = DependencyManager::get<TextureCache>();
|
auto textureCache = DependencyManager::get<TextureCache>();
|
||||||
NetworkMaterial* networkMaterial = new NetworkMaterial();
|
NetworkMaterial* networkMaterial = new NetworkMaterial();
|
||||||
|
|
||||||
int totalIndices = 0;
|
//bool checkForTexcoordLightmap = false;
|
||||||
bool checkForTexcoordLightmap = false;
|
|
||||||
|
|
||||||
networkMaterial->_material = material._material;
|
networkMaterial->_material = material._material;
|
||||||
|
|
||||||
|
@ -430,7 +429,7 @@ static NetworkMaterial* buildNetworkMaterial(const FBXMaterial& material, const
|
||||||
networkMaterial->emissiveTexture = textureCache->getTexture(textureBaseUrl.resolved(QUrl(material.emissiveTexture.filename)), EMISSIVE_TEXTURE, material.emissiveTexture.content);
|
networkMaterial->emissiveTexture = textureCache->getTexture(textureBaseUrl.resolved(QUrl(material.emissiveTexture.filename)), EMISSIVE_TEXTURE, material.emissiveTexture.content);
|
||||||
networkMaterial->emissiveTextureName = material.emissiveTexture.name;
|
networkMaterial->emissiveTextureName = material.emissiveTexture.name;
|
||||||
|
|
||||||
checkForTexcoordLightmap = true;
|
//checkForTexcoordLightmap = true;
|
||||||
|
|
||||||
auto lightmapMap = model::TextureMapPointer(new model::TextureMap());
|
auto lightmapMap = model::TextureMapPointer(new model::TextureMap());
|
||||||
lightmapMap->setTextureSource(networkMaterial->emissiveTexture->_textureSource);
|
lightmapMap->setTextureSource(networkMaterial->emissiveTexture->_textureSource);
|
||||||
|
@ -491,8 +490,8 @@ void NetworkGeometry::modelParseError(int error, QString str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const NetworkMaterial* NetworkGeometry::getShapeMaterial(unsigned int shapeID) {
|
const NetworkMaterial* NetworkGeometry::getShapeMaterial(int shapeID) {
|
||||||
if ((shapeID >= 0) && (shapeID < _shapes.size())) {
|
if ((shapeID >= 0) && (shapeID < (int)_shapes.size())) {
|
||||||
int materialID = _shapes[shapeID]->_materialID;
|
int materialID = _shapes[shapeID]->_materialID;
|
||||||
if ((materialID >= 0) && ((unsigned int)materialID < _materials.size())) {
|
if ((materialID >= 0) && ((unsigned int)materialID < _materials.size())) {
|
||||||
return _materials[materialID].get();
|
return _materials[materialID].get();
|
||||||
|
|
|
@ -88,7 +88,7 @@ public:
|
||||||
|
|
||||||
// This would be the final verison
|
// This would be the final verison
|
||||||
// model::MaterialPointer getShapeMaterial(int shapeID);
|
// model::MaterialPointer getShapeMaterial(int shapeID);
|
||||||
const NetworkMaterial* getShapeMaterial(unsigned int shapeID);
|
const NetworkMaterial* getShapeMaterial(int shapeID);
|
||||||
|
|
||||||
|
|
||||||
void setTextureWithNameToURL(const QString& name, const QUrl& url);
|
void setTextureWithNameToURL(const QString& name, const QUrl& url);
|
||||||
|
|
|
@ -59,7 +59,7 @@ gpu::Texture* TextureUsage::create2DTextureFromImage(const QImage& srcImage, con
|
||||||
|
|
||||||
int opaquePixels = 0;
|
int opaquePixels = 0;
|
||||||
int translucentPixels = 0;
|
int translucentPixels = 0;
|
||||||
bool isTransparent = false;
|
//bool isTransparent = false;
|
||||||
int redTotal = 0, greenTotal = 0, blueTotal = 0, alphaTotal = 0;
|
int redTotal = 0, greenTotal = 0, blueTotal = 0, alphaTotal = 0;
|
||||||
const int EIGHT_BIT_MAXIMUM = 255;
|
const int EIGHT_BIT_MAXIMUM = 255;
|
||||||
QColor averageColor(EIGHT_BIT_MAXIMUM, EIGHT_BIT_MAXIMUM, EIGHT_BIT_MAXIMUM);
|
QColor averageColor(EIGHT_BIT_MAXIMUM, EIGHT_BIT_MAXIMUM, EIGHT_BIT_MAXIMUM);
|
||||||
|
@ -112,7 +112,7 @@ gpu::Texture* TextureUsage::create2DTextureFromImage(const QImage& srcImage, con
|
||||||
averageColor = QColor(redTotal / imageArea,
|
averageColor = QColor(redTotal / imageArea,
|
||||||
greenTotal / imageArea, blueTotal / imageArea, alphaTotal / imageArea);
|
greenTotal / imageArea, blueTotal / imageArea, alphaTotal / imageArea);
|
||||||
|
|
||||||
isTransparent = (translucentPixels >= imageArea / 2);
|
//isTransparent = (translucentPixels >= imageArea / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::Texture* theTexture = nullptr;
|
gpu::Texture* theTexture = nullptr;
|
||||||
|
@ -269,7 +269,7 @@ gpu::Texture* TextureUsage::createCubeTextureFromImage(const QImage& srcImage, c
|
||||||
|
|
||||||
int opaquePixels = 0;
|
int opaquePixels = 0;
|
||||||
int translucentPixels = 0;
|
int translucentPixels = 0;
|
||||||
bool isTransparent = false;
|
//bool isTransparent = false;
|
||||||
int redTotal = 0, greenTotal = 0, blueTotal = 0, alphaTotal = 0;
|
int redTotal = 0, greenTotal = 0, blueTotal = 0, alphaTotal = 0;
|
||||||
const int EIGHT_BIT_MAXIMUM = 255;
|
const int EIGHT_BIT_MAXIMUM = 255;
|
||||||
QColor averageColor(EIGHT_BIT_MAXIMUM, EIGHT_BIT_MAXIMUM, EIGHT_BIT_MAXIMUM);
|
QColor averageColor(EIGHT_BIT_MAXIMUM, EIGHT_BIT_MAXIMUM, EIGHT_BIT_MAXIMUM);
|
||||||
|
@ -322,7 +322,7 @@ gpu::Texture* TextureUsage::createCubeTextureFromImage(const QImage& srcImage, c
|
||||||
averageColor = QColor(redTotal / imageArea,
|
averageColor = QColor(redTotal / imageArea,
|
||||||
greenTotal / imageArea, blueTotal / imageArea, alphaTotal / imageArea);
|
greenTotal / imageArea, blueTotal / imageArea, alphaTotal / imageArea);
|
||||||
|
|
||||||
isTransparent = (translucentPixels >= imageArea / 2);
|
//isTransparent = (translucentPixels >= imageArea / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::Texture* theTexture = nullptr;
|
gpu::Texture* theTexture = nullptr;
|
||||||
|
|
|
@ -1727,9 +1727,9 @@ void Model::segregateMeshGroups() {
|
||||||
// Run through all of the meshes, and place them into their segregated, but unsorted buckets
|
// Run through all of the meshes, and place them into their segregated, but unsorted buckets
|
||||||
int shapeID = 0;
|
int shapeID = 0;
|
||||||
for (int i = 0; i < (int)networkMeshes.size(); i++) {
|
for (int i = 0; i < (int)networkMeshes.size(); i++) {
|
||||||
const NetworkMesh& networkMesh = *(networkMeshes.at(i).get());
|
//const NetworkMesh& networkMesh = *(networkMeshes.at(i).get());
|
||||||
const FBXMesh& mesh = geometry.meshes.at(i);
|
const FBXMesh& mesh = geometry.meshes.at(i);
|
||||||
const MeshState& state = _meshStates.at(i);
|
//const MeshState& state = _meshStates.at(i);
|
||||||
|
|
||||||
// Create the render payloads
|
// Create the render payloads
|
||||||
int totalParts = mesh.parts.size();
|
int totalParts = mesh.parts.size();
|
||||||
|
|
|
@ -190,7 +190,7 @@ public:
|
||||||
glm::vec3 unitscale { 1.0f };
|
glm::vec3 unitscale { 1.0f };
|
||||||
glm::vec3 up { 0.0f, 1.0f, 0.0f };
|
glm::vec3 up { 0.0f, 1.0f, 0.0f };
|
||||||
|
|
||||||
glm::vec3 camera_position { 1.5f * sinf(t), 0.0f, 1.5f * cos(t) };
|
glm::vec3 camera_position { 1.5f * sinf(t), 0.0f, 1.5f * cosf(t) };
|
||||||
|
|
||||||
static const vec3 camera_focus(0);
|
static const vec3 camera_focus(0);
|
||||||
static const vec3 camera_up(0, 1, 0);
|
static const vec3 camera_up(0, 1, 0);
|
||||||
|
@ -249,9 +249,9 @@ public:
|
||||||
|
|
||||||
static auto startUsecs = usecTimestampNow();
|
static auto startUsecs = usecTimestampNow();
|
||||||
float seconds = getSeconds(startUsecs);
|
float seconds = getSeconds(startUsecs);
|
||||||
seconds /= 4.0;
|
seconds /= 4.0f;
|
||||||
int shapeIndex = ((int)seconds) % 4;
|
int shapeIndex = ((int)seconds) % 4;
|
||||||
bool wire = seconds - floor(seconds) > 0.5f;
|
bool wire = seconds - (float)floor(seconds) > 0.5f;
|
||||||
batch.setModelTransform(Transform());
|
batch.setModelTransform(Transform());
|
||||||
batch._glColor4f(0.8f, 0.25f, 0.25f, 1.0f);
|
batch._glColor4f(0.8f, 0.25f, 0.25f, 1.0f);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue