MCPcopy Create free account
hub / github.com/GrapheneCt/NetStream / Add

Method Add

NetStream/source/tex_pool.cpp:45–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45bool TexPool::Add(Plugin *plugin, IDParam const& id, bool allowReplace)
46{
47 if (!m_alive)
48 {
49 return false;
50 }
51
52 if (!allowReplace)
53 {
54 if (Exist(id))
55 {
56 return false;
57 }
58 }
59
60 intrusive_ptr<graph::Surface> tex = plugin->GetTexture(id);
61 if (tex.get())
62 {
63 m_storMtx->Lock();
64 RemoveForReplace(id);
65 m_stor[id.GetIDHash()] = tex;
66 m_storMtx->Unlock();
67 return true;
68 }
69
70 Remove(id);
71
72 return false;
73}
74
75bool TexPool::Add(IDParam const& id, uint8_t *buffer, size_t bufferSize, bool allowReplace)
76{

Callers

nothing calls this directly

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected