aboutsummaryrefslogtreecommitdiff
path: root/src/nodedef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r--src/nodedef.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index 6c2e96c4f..ba1ca2c65 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -202,6 +202,7 @@ void ContentFeatures::reset()
#ifndef SERVER
for(u32 i = 0; i < 24; i++)
mesh_ptr[i] = NULL;
+ minimap_color = video::SColor(0, 0, 0, 0);
#endif
visual_scale = 1.0;
for(u32 i = 0; i < 6; i++)
@@ -766,7 +767,6 @@ void CNodeDefManager::applyTextureOverrides(const std::string &override_filepath
}
}
-
void CNodeDefManager::updateTextures(IGameDef *gamedef,
void (*progress_callback)(void *progress_args, u32 progress, u32 max_progress),
void *progress_callback_args)
@@ -774,7 +774,6 @@ void CNodeDefManager::updateTextures(IGameDef *gamedef,
#ifndef SERVER
infostream << "CNodeDefManager::updateTextures(): Updating "
"textures in node definitions" << std::endl;
-
ITextureSource *tsrc = gamedef->tsrc();
IShaderSource *shdsrc = gamedef->getShaderSource();
scene::ISceneManager* smgr = gamedef->getSceneManager();
@@ -797,6 +796,10 @@ void CNodeDefManager::updateTextures(IGameDef *gamedef,
for (u32 i = 0; i < size; i++) {
ContentFeatures *f = &m_content_features[i];
+ // minimap pixel color - the average color of a texture
+ if (f->tiledef[0].name != "")
+ f->minimap_color = tsrc->getTextureAverageColor(f->tiledef[0].name);
+
// Figure out the actual tiles to use
TileDef tiledef[6];
for (u32 j = 0; j < 6; j++) {