mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add minimap feature
This commit is contained in:
parent
3376d2e114
commit
ffd16e3fec
23 changed files with 883 additions and 30 deletions
|
@ -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++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue