mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 02:40:17 +02:00
- attempt to better handler tomreyn's fuzzer.
This commit is contained in:
@@ -35,7 +35,7 @@ ModelRendererGl::ModelRendererGl(){
|
|||||||
|
|
||||||
void ModelRendererGl::begin(bool renderNormals, bool renderTextures, bool renderColors, MeshCallback *meshCallback) {
|
void ModelRendererGl::begin(bool renderNormals, bool renderTextures, bool renderColors, MeshCallback *meshCallback) {
|
||||||
//assertions
|
//assertions
|
||||||
assert(!rendering);
|
assert(rendering == false);
|
||||||
assertGl();
|
assertGl();
|
||||||
|
|
||||||
this->renderTextures= renderTextures;
|
this->renderTextures= renderTextures;
|
||||||
@@ -151,12 +151,16 @@ void ModelRendererGl::renderMesh(const Mesh *mesh){
|
|||||||
if(texture != NULL && renderTextures) {
|
if(texture != NULL && renderTextures) {
|
||||||
if(lastTexture != texture->getHandle()){
|
if(lastTexture != texture->getHandle()){
|
||||||
//assert(glIsTexture(texture->getHandle()));
|
//assert(glIsTexture(texture->getHandle()));
|
||||||
if(glIsTexture(texture->getHandle()) == false) {
|
//throw runtime_error("glIsTexture(texture->getHandle()) == false for texture: " + texture->getPath());
|
||||||
throw runtime_error("glIsTexture(texture->getHandle()) == false for texture: " + texture->getPath());
|
if(glIsTexture(texture->getHandle()) == true) {
|
||||||
}
|
|
||||||
glBindTexture(GL_TEXTURE_2D, texture->getHandle());
|
glBindTexture(GL_TEXTURE_2D, texture->getHandle());
|
||||||
lastTexture= texture->getHandle();
|
lastTexture= texture->getHandle();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
lastTexture= 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
Reference in New Issue
Block a user