diff options
author | RealBadAngel <maciej.kasatkin@o2.pl> | 2015-06-22 04:34:56 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-06-27 03:42:01 +0200 |
commit | ffd16e3feca90c356c55898de2b9f3f5c6bc5c98 (patch) | |
tree | 8fb350ba1d2afaa39b9d333290e16a68168a4ddd /src/nodedef.cpp | |
parent | 3376d2e114767eef06b87645edefcd2d42696919 (diff) | |
download | minetest-ffd16e3feca90c356c55898de2b9f3f5c6bc5c98.tar.gz minetest-ffd16e3feca90c356c55898de2b9f3f5c6bc5c98.tar.bz2 minetest-ffd16e3feca90c356c55898de2b9f3f5c6bc5c98.zip |
Add minimap feature
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r-- | src/nodedef.cpp | 7 |
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++) { |