mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add UpdateThread and use it for minimap and mesh threads
This commit is contained in:
parent
4e28c8d3c8
commit
29dda9f356
5 changed files with 114 additions and 98 deletions
20
src/client.h
20
src/client.h
|
@ -113,23 +113,27 @@ struct MeshUpdateResult
|
|||
}
|
||||
};
|
||||
|
||||
class MeshUpdateThread : public JThread
|
||||
class MeshUpdateThread : public UpdateThread
|
||||
{
|
||||
private:
|
||||
MeshUpdateQueue m_queue_in;
|
||||
|
||||
protected:
|
||||
const char *getName()
|
||||
{ return "MeshUpdateThread"; }
|
||||
virtual void doUpdate();
|
||||
|
||||
public:
|
||||
|
||||
MeshUpdateThread(IGameDef *gamedef):
|
||||
m_gamedef(gamedef)
|
||||
MeshUpdateThread()
|
||||
{
|
||||
}
|
||||
|
||||
void * Thread();
|
||||
|
||||
MeshUpdateQueue m_queue_in;
|
||||
void enqueueUpdate(v3s16 p, MeshMakeData *data,
|
||||
bool ack_block_to_server, bool urgent);
|
||||
|
||||
MutexedQueue<MeshUpdateResult> m_queue_out;
|
||||
|
||||
IGameDef *m_gamedef;
|
||||
|
||||
v3s16 m_camera_offset;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue