mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:23:54 +00:00
Fix race conditions in terrain loader caused by static variables
This commit is contained in:
parent
d1e86d22ca
commit
d3e1dbe920
1 changed files with 3 additions and 3 deletions
|
@ -51,7 +51,7 @@ namespace ESM
|
||||||
esm.writeHNT("VCLR", mColours, 3*LAND_NUM_VERTS);
|
esm.writeHNT("VCLR", mColours, 3*LAND_NUM_VERTS);
|
||||||
}
|
}
|
||||||
if (mDataTypes & Land::DATA_VTEX) {
|
if (mDataTypes & Land::DATA_VTEX) {
|
||||||
static uint16_t vtex[LAND_NUM_TEXTURES];
|
uint16_t vtex[LAND_NUM_TEXTURES];
|
||||||
transposeTextureData(mTextures, vtex);
|
transposeTextureData(mTextures, vtex);
|
||||||
esm.writeHNT("VTEX", vtex, sizeof(vtex));
|
esm.writeHNT("VTEX", vtex, sizeof(vtex));
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ namespace ESM
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reader.isNextSub("VHGT")) {
|
if (reader.isNextSub("VHGT")) {
|
||||||
static VHGT vhgt;
|
VHGT vhgt;
|
||||||
if (condLoad(reader, flags, DATA_VHGT, &vhgt, sizeof(vhgt))) {
|
if (condLoad(reader, flags, DATA_VHGT, &vhgt, sizeof(vhgt))) {
|
||||||
float rowOffset = vhgt.mHeightOffset;
|
float rowOffset = vhgt.mHeightOffset;
|
||||||
for (int y = 0; y < LAND_SIZE; y++) {
|
for (int y = 0; y < LAND_SIZE; y++) {
|
||||||
|
@ -227,7 +227,7 @@ namespace ESM
|
||||||
if (reader.isNextSub("VCLR"))
|
if (reader.isNextSub("VCLR"))
|
||||||
condLoad(reader, flags, DATA_VCLR, mLandData->mColours, 3 * LAND_NUM_VERTS);
|
condLoad(reader, flags, DATA_VCLR, mLandData->mColours, 3 * LAND_NUM_VERTS);
|
||||||
if (reader.isNextSub("VTEX")) {
|
if (reader.isNextSub("VTEX")) {
|
||||||
static uint16_t vtex[LAND_NUM_TEXTURES];
|
uint16_t vtex[LAND_NUM_TEXTURES];
|
||||||
if (condLoad(reader, flags, DATA_VTEX, vtex, sizeof(vtex))) {
|
if (condLoad(reader, flags, DATA_VTEX, vtex, sizeof(vtex))) {
|
||||||
LandData::transposeTextureData(vtex, mLandData->mTextures);
|
LandData::transposeTextureData(vtex, mLandData->mTextures);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue