Make changes for Emscripten

This commit is contained in:
Varun Patil 2020-05-04 13:13:57 +05:30
parent 776564d583
commit 8c5db3a401
33 changed files with 5082 additions and 3720 deletions

View file

@ -388,29 +388,16 @@ struct WindowPrivate
void ensureBaseTexReady()
{
/* Make sure texture is big enough */
int newW = baseTex.width;
int newH = baseTex.height;
bool resizeNeeded = false;
/* Make sure texture is properly sized */
int newW = findNextPow2(size.x);
int newH = findNextPow2(size.y);
if (size.x > baseTex.width)
if (newW != baseTex.width || newH != baseTex.height)
{
newW = findNextPow2(size.x);
resizeNeeded = true;
shState->texPool().release(baseTex);
baseTex = shState->texPool().request(newW, newH);
baseTexDirty = true;
}
if (size.y > baseTex.height)
{
newH = findNextPow2(size.y);
resizeNeeded = true;
}
if (!resizeNeeded)
return;
shState->texPool().release(baseTex);
baseTex = shState->texPool().request(newW, newH);
baseTexDirty = true;
}
void redrawBaseTex()