Skip to content

Commit

Permalink
WIP on cmake: 887524a sokol: Add proper thread checks
Browse files Browse the repository at this point in the history
  • Loading branch information
IonAgorria committed Feb 12, 2024
2 parents 887524a + c7a368a commit 57ccc57
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Source/UserInterface/Installer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,19 @@ void terBuildingInstaller::SetBuildPosition(const Vect3f& position,float angle,

void terBuildingInstaller::InitTexture()
{
RELEASE(pTexture);

int dx = 1 << (BitSR(BaseBuffSX) + 1);
int dy = 1 << (BitSR(BaseBuffSY) + 1);
dx = dy = max(dx,dy);
pTexture = terVisGeneric->CreateTexture(dx,dy,true);
if (!pTexture) return;

int Pitch;
int dx = 1 << (BitSR(BaseBuffSX) + 1);
int dy = 1 << (BitSR(BaseBuffSY) + 1);
dx = dy = max(dx,dy);

//Not big enough, allocate new texture
if (!pTexture || pTexture->GetWidth() < dx || pTexture->GetHeight() < dy) {
RELEASE(pTexture);
pTexture = terVisGeneric->CreateTexture(1024,1024,true);
if (!pTexture) return;
}

int Pitch;
uint8_t* buf = pTexture->LockTexture(Pitch);
if (buf) {
for (int y = 0; y < dy; y++) {
Expand Down

0 comments on commit 57ccc57

Please sign in to comment.