fix normals
This commit is contained in:
@@ -122,7 +122,6 @@ void MapTile::finishLoading()
|
||||
std::vector<ENTRY_MDDF> lModelInstances;
|
||||
std::vector<ENTRY_MODF> lWMOInstances;
|
||||
|
||||
std::vector<std::string> mTextureFilenames;
|
||||
std::vector<std::string> mModelFilenames;
|
||||
std::vector<std::string> mWMOFilenames;
|
||||
|
||||
@@ -373,6 +372,8 @@ void MapTile::finishLoading()
|
||||
auto& chunk = mChunks[x][z];
|
||||
_renderer.initChunkData(chunk.get());
|
||||
}
|
||||
// can be cleared after texture sets are loaded in chunks.
|
||||
mTextureFilenames.clear();
|
||||
|
||||
theFile.close();
|
||||
|
||||
@@ -1408,13 +1409,13 @@ void MapTile::setHeightmapImage(QImage const& baseimage, float min_height, float
|
||||
for (int l = 0; l < 16; ++l)
|
||||
{
|
||||
MapChunk* chunk = getChunk(k, l);
|
||||
chunk->recalcNorms();
|
||||
// chunk->recalcNorms();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MapTile::setAlphaImage(QImage const& baseimage, unsigned layer)
|
||||
void MapTile::setAlphaImage(QImage const& baseimage, unsigned layer, bool cleanup)
|
||||
{
|
||||
auto image = baseimage.convertToFormat(QImage::Format_RGBA8888);
|
||||
|
||||
@@ -1443,6 +1444,8 @@ void MapTile::setAlphaImage(QImage const& baseimage, unsigned layer)
|
||||
chunk->texture_set->markDirty();
|
||||
chunk->texture_set->apply_alpha_changes();
|
||||
|
||||
if (cleanup)
|
||||
chunk->texture_set->eraseUnusedTextures();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public:
|
||||
QImage getNormalmapImage();
|
||||
void setHeightmapImage(QImage const& baseimage, float min_height, float max_height, int mode, bool tiledEdges);
|
||||
void setWatermapImage(QImage const& baseimage, float multiplier, int mode, bool tiledEdges);
|
||||
void setAlphaImage(QImage const& image, unsigned layer);
|
||||
void setAlphaImage(QImage const& image, unsigned layer, bool cleanup);
|
||||
void setVertexColorImage(QImage const& image, int mode, bool tiledEdges);
|
||||
void registerChunkUpdate(unsigned flags) { _chunk_update_flags |= flags; };
|
||||
void endChunkUpdates() { _chunk_update_flags = 0; };
|
||||
@@ -196,7 +196,7 @@ private:
|
||||
bool mBigAlpha;
|
||||
|
||||
// Data to be loaded and later unloaded.
|
||||
// std::vector<std::string> mTextureFilenames;
|
||||
std::vector<std::string> mTextureFilenames;
|
||||
// std::vector<std::string> mModelFilenames;
|
||||
// std::vector<std::string> mWMOFilenames;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user