mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 05:17:08 +02:00
Make ResourceCache::prefetch private and comment
This commit is contained in:
parent
713fc44ec5
commit
cba5bff89e
2 changed files with 12 additions and 6 deletions
|
@ -100,9 +100,6 @@ class TextureCache : public ResourceCache, public Dependency {
|
||||||
using Type = NetworkTexture::Type;
|
using Type = NetworkTexture::Type;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Overload ResourceCache::prefetch to allow specifying texture type for loads
|
|
||||||
Q_INVOKABLE ScriptableResource* prefetch(const QUrl& url, int type);
|
|
||||||
|
|
||||||
/// Returns the ID of the permutation/normal texture used for Perlin noise shader programs. This texture
|
/// Returns the ID of the permutation/normal texture used for Perlin noise shader programs. This texture
|
||||||
/// has two lines: the first, a set of random numbers in [0, 255] to be used as permutation offsets, and
|
/// has two lines: the first, a set of random numbers in [0, 255] to be used as permutation offsets, and
|
||||||
/// the second, a set of random unit vectors to be used as noise gradients.
|
/// the second, a set of random unit vectors to be used as noise gradients.
|
||||||
|
@ -131,6 +128,8 @@ public:
|
||||||
const QByteArray& content = QByteArray());
|
const QByteArray& content = QByteArray());
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// Overload ResourceCache::prefetch to allow specifying texture type for loads
|
||||||
|
Q_INVOKABLE ScriptableResource* prefetch(const QUrl& url, int type);
|
||||||
|
|
||||||
virtual QSharedPointer<Resource> createResource(const QUrl& url,
|
virtual QSharedPointer<Resource> createResource(const QUrl& url,
|
||||||
const QSharedPointer<Resource>& fallback, bool delayLoad, const void* extra);
|
const QSharedPointer<Resource>& fallback, bool delayLoad, const void* extra);
|
||||||
|
|
|
@ -141,9 +141,6 @@ public:
|
||||||
|
|
||||||
Q_INVOKABLE QVariantList getResourceList();
|
Q_INVOKABLE QVariantList getResourceList();
|
||||||
|
|
||||||
// This must be exposed as a ptr so the ScriptEngine may take ownership
|
|
||||||
Q_INVOKABLE ScriptableResource* prefetch(const QUrl& url) { return prefetch(url, nullptr); }
|
|
||||||
|
|
||||||
static void setRequestLimit(int limit);
|
static void setRequestLimit(int limit);
|
||||||
static int getRequestLimit() { return _requestLimit; }
|
static int getRequestLimit() { return _requestLimit; }
|
||||||
|
|
||||||
|
@ -175,6 +172,16 @@ private slots:
|
||||||
void clearATPAssets();
|
void clearATPAssets();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// Prefetches a resource to be held by the QScriptEngine.
|
||||||
|
// Pointers created through this method should be owned by the caller,
|
||||||
|
// which should be a QScriptEngine with ScriptableResource registered, so that
|
||||||
|
// the QScriptEngine will delete the pointer when it is garbage collected.
|
||||||
|
Q_INVOKABLE ScriptableResource* prefetch(const QUrl& url) { return prefetch(url, nullptr); }
|
||||||
|
|
||||||
|
|
||||||
|
// Prefetches a resource to be held by the QScriptEngine.
|
||||||
|
// Left as a protected member so subclasses can overload prefetch
|
||||||
|
// and delegate to it (see TextureCache::prefetch(const QUrl&, int).
|
||||||
ScriptableResource* prefetch(const QUrl& url, void* extra);
|
ScriptableResource* prefetch(const QUrl& url, void* extra);
|
||||||
|
|
||||||
/// Loads a resource from the specified URL.
|
/// Loads a resource from the specified URL.
|
||||||
|
|
Loading…
Reference in a new issue