mirror of
https://github.com/minetest/minetest.git
synced 2024-12-24 15:12:23 +01:00
Bugfix: minimap was updated only with loading new blocks, allow forced updates with changing player pos
This commit is contained in:
parent
b160f8dfe7
commit
0a90fedabc
@ -120,6 +120,10 @@ void MinimapUpdateThread::enqueue_Block(v3s16 pos, MinimapMapblock *data)
|
|||||||
m_queue_sem.Post();
|
m_queue_sem.Post();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MinimapUpdateThread::forceUpdate()
|
||||||
|
{
|
||||||
|
m_queue_sem.Post();
|
||||||
|
}
|
||||||
|
|
||||||
void *MinimapUpdateThread::Thread()
|
void *MinimapUpdateThread::Thread()
|
||||||
{
|
{
|
||||||
@ -323,12 +327,17 @@ void Mapper::setMinimapMode(MinimapMode mode)
|
|||||||
data->scan_height = modeDefs[(int)mode * 3 + 1];
|
data->scan_height = modeDefs[(int)mode * 3 + 1];
|
||||||
data->map_size = modeDefs[(int)mode * 3 + 2];
|
data->map_size = modeDefs[(int)mode * 3 + 2];
|
||||||
data->mode = mode;
|
data->mode = mode;
|
||||||
|
m_minimap_update_thread->forceUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mapper::setPos(v3s16 pos)
|
void Mapper::setPos(v3s16 pos)
|
||||||
{
|
{
|
||||||
JMutexAutoLock lock(m_mutex);
|
JMutexAutoLock lock(m_mutex);
|
||||||
data->pos = pos;
|
if (pos != data->old_pos) {
|
||||||
|
data->old_pos = data->pos;
|
||||||
|
data->pos = pos;
|
||||||
|
m_minimap_update_thread->forceUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
video::ITexture *Mapper::getMinimapTexture()
|
video::ITexture *Mapper::getMinimapTexture()
|
||||||
|
@ -131,7 +131,7 @@ public:
|
|||||||
video::SColor getColorFromId(u16 id);
|
video::SColor getColorFromId(u16 id);
|
||||||
|
|
||||||
void enqueue_Block(v3s16 pos, MinimapMapblock *data);
|
void enqueue_Block(v3s16 pos, MinimapMapblock *data);
|
||||||
|
void forceUpdate();
|
||||||
IrrlichtDevice *device;
|
IrrlichtDevice *device;
|
||||||
Client *client;
|
Client *client;
|
||||||
video::IVideoDriver *driver;
|
video::IVideoDriver *driver;
|
||||||
|
Loading…
Reference in New Issue
Block a user