mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-17 18:36:43 +02:00
This commit is contained in:
@@ -686,7 +686,7 @@ struct WaterCache {
|
|||||||
int w, h;
|
int w, h;
|
||||||
getTargetSize(w, h);
|
getTargetSize(w, h);
|
||||||
// get refraction texture
|
// get refraction texture
|
||||||
if (!refract || w != refract->width || h != refract->height) {
|
if (!refract || w != refract->origWidth || h != refract->origHeight) {
|
||||||
delete refract;
|
delete refract;
|
||||||
refract = new Texture(w, h, Texture::RGBA, false);
|
refract = new Texture(w, h, Texture::RGBA, false);
|
||||||
Core::setTarget(refract, CLEAR_ALL);
|
Core::setTarget(refract, CLEAR_ALL);
|
||||||
|
15
src/mesh.h
15
src/mesh.h
@@ -102,7 +102,15 @@ struct Mesh {
|
|||||||
if (Core::support.VAO)
|
if (Core::support.VAO)
|
||||||
glBindVertexArray(Core::active.VAO = 0);
|
glBindVertexArray(Core::active.VAO = 0);
|
||||||
|
|
||||||
if (vertices || indices) {
|
#ifdef DYNGEOM_NO_VBO
|
||||||
|
if (!vertices && !indices) {
|
||||||
|
ID[0] = ID[1] = 0;
|
||||||
|
iBuffer = new Index[iCount];
|
||||||
|
vBuffer = new VertexGPU[vCount];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
glGenBuffers(2, ID);
|
glGenBuffers(2, ID);
|
||||||
bind(true);
|
bind(true);
|
||||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, iCount * sizeof(Index), indices, GL_STATIC_DRAW);
|
glBufferData(GL_ELEMENT_ARRAY_BUFFER, iCount * sizeof(Index), indices, GL_STATIC_DRAW);
|
||||||
@@ -114,11 +122,6 @@ struct Mesh {
|
|||||||
}
|
}
|
||||||
iBuffer = NULL;
|
iBuffer = NULL;
|
||||||
vBuffer = NULL;
|
vBuffer = NULL;
|
||||||
} else {
|
|
||||||
ID[0] = ID[1] = 0;
|
|
||||||
iBuffer = new Index[iCount];
|
|
||||||
vBuffer = new VertexGPU[vCount];
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -92,12 +92,15 @@ struct Texture {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
origWidth = width;
|
||||||
|
origHeight = height;
|
||||||
|
|
||||||
if (!Core::support.texNPOT) {
|
if (!Core::support.texNPOT) {
|
||||||
width = nextPow2(width);
|
width = nextPow2(width);
|
||||||
height = nextPow2(height);
|
height = nextPow2(height);
|
||||||
}
|
}
|
||||||
this->width = origWidth = width;
|
this->width = width;
|
||||||
this->height = origHeight = height;
|
this->height = height;
|
||||||
|
|
||||||
bool filter = (opt & NEAREST) == 0;
|
bool filter = (opt & NEAREST) == 0;
|
||||||
bool cube = (opt & CUBEMAP) != 0;
|
bool cube = (opt & CUBEMAP) != 0;
|
||||||
|
Reference in New Issue
Block a user