mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
Texture on demand
This commit is contained in:
parent
56bff0a009
commit
20e73fc5ac
@ -444,11 +444,21 @@ void Overlay::clearCache() {
|
||||
|
||||
qhTextures.clear();
|
||||
qhWidths.clear();
|
||||
qsForce.clear();
|
||||
qsQueried.clear();
|
||||
}
|
||||
|
||||
void Overlay::setTexts(const QList<TextLine> &lines) {
|
||||
QSet<unsigned int> query;
|
||||
|
||||
foreach(const TextLine &e, lines) {
|
||||
ClientUser *cp = ClientUser::get(e.uiSession);
|
||||
if (g.s.bOverlayUserTextures && cp && ! cp->qbaTextureHash.isEmpty()) {
|
||||
if (cp->qbaTexture.isEmpty() && ! qsQueried.contains(cp->uiSession))
|
||||
query.insert(cp->uiSession);
|
||||
else if (! cp->qbaTexture.isEmpty() && qsQueried.contains(cp->uiSession))
|
||||
qsQueried.remove(cp->uiSession);
|
||||
}
|
||||
if ((! e.qsText.isEmpty()) && (! qhTextures.contains(e.qsText)) && !(g.s.bOverlayUserTextures && cp && cp->iTextureWidth)) {
|
||||
unsigned char *td = new unsigned char[TEXTURE_SIZE];
|
||||
memset(td, 0, TEXTURE_SIZE);
|
||||
@ -476,6 +486,15 @@ void Overlay::setTexts(const QList<TextLine> &lines) {
|
||||
}
|
||||
}
|
||||
|
||||
if (! query.isEmpty()) {
|
||||
MumbleProto::RequestBlob mprb;
|
||||
foreach(unsigned int session, query) {
|
||||
qsQueried.insert(session);
|
||||
mprb.add_session_texture(session);
|
||||
}
|
||||
g.sh->sendMessage(mprb);
|
||||
}
|
||||
|
||||
if (! sm.sm || ! sm.tryLock())
|
||||
return;
|
||||
|
||||
|
||||
@ -113,6 +113,7 @@ class Overlay : public QObject {
|
||||
QHash<QString, unsigned char *> qhTextures;
|
||||
QHash<QString, short> qhWidths;
|
||||
QSet<unsigned int> qsForce;
|
||||
QSet<unsigned int> qsQueried;
|
||||
QLibrary *qlOverlay;
|
||||
QTimer *qtTimer;
|
||||
QFont qfFont;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user