/
textures.cpp
745 lines (650 loc) · 21.6 KB
/
textures.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
/** @file textures.cpp Texture Resource Collection.
*
* @authors Copyright © 2010-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/
#include "de_base.h"
#include "de_console.h"
#ifdef __CLIENT__
# include "gl/gl_texmanager.h"
#endif
#include "resource/compositetexture.h"
#include "TextureManifest"
#include <de/Error>
#include <de/Log>
#include <de/PathTree>
#include <de/mathutil.h> // for M_NumDigits
#include <QList>
#include <QtAlgorithms>
#include "resource/textures.h"
D_CMD(ListTextures);
D_CMD(InspectTexture);
#if _DEBUG
D_CMD(PrintTextureStats);
#endif
namespace de {
static Uri emptyUri;
Texture *Textures::ResourceClass::interpret(TextureManifest &manifest, void *userData)
{
LOG_AS("Textures::ResourceClass::interpret");
Texture *tex = new Texture(manifest);
tex->setFlags(manifest.flags());
tex->setDimensions(manifest.logicalDimensions());
tex->setOrigin(manifest.origin());
tex->setUserDataPointer(userData);
return tex;
}
DENG2_PIMPL(Textures)
{
/// System subspace schemes containing the textures.
Textures::Schemes schemes;
QList<Textures::Scheme *> schemeCreationOrder;
Instance(Public *i) : Base(i)
{}
~Instance()
{
clearManifests();
}
void clearManifests()
{
qDeleteAll(schemes);
schemes.clear();
schemeCreationOrder.clear();
}
};
void Textures::consoleRegister()
{
C_CMD("inspecttexture", "ss", InspectTexture)
C_CMD("inspecttexture", "s", InspectTexture)
C_CMD("listtextures", "ss", ListTextures)
C_CMD("listtextures", "s", ListTextures)
C_CMD("listtextures", "", ListTextures)
#if _DEBUG
C_CMD("texturestats", NULL, PrintTextureStats)
#endif
}
Textures::Textures() : d(new Instance(this))
{}
Textures::~Textures()
{
clearAllSchemes();
delete d;
}
Textures::Scheme &Textures::scheme(String name) const
{
LOG_AS("Textures::scheme");
if(!name.isEmpty())
{
Schemes::iterator found = d->schemes.find(name.toLower());
if(found != d->schemes.end()) return **found;
}
/// @throw UnknownSchemeError An unknown scheme was referenced.
throw Textures::UnknownSchemeError("Textures::scheme", "No scheme found matching '" + name + "'");
}
Textures::Scheme& Textures::createScheme(String name)
{
DENG_ASSERT(name.length() >= Scheme::min_name_length);
// Ensure this is a unique name.
if(knownScheme(name)) return scheme(name);
// Create a new scheme.
Scheme *newScheme = new Scheme(name);
d->schemes.insert(name.toLower(), newScheme);
d->schemeCreationOrder.push_back(newScheme);
return *newScheme;
}
bool Textures::knownScheme(String name) const
{
if(!name.isEmpty())
{
Schemes::iterator found = d->schemes.find(name.toLower());
if(found != d->schemes.end()) return true;
}
return false;
}
Textures::Schemes const& Textures::allSchemes() const
{
return d->schemes;
}
bool Textures::validateUri(Uri const &uri, UriValidationFlags flags, bool quiet) const
{
LOG_AS("Textures::validateUri");
bool const isUrn = !uri.scheme().compareWithoutCase("urn");
if(uri.isEmpty())
{
if(!quiet) LOG_MSG("Empty path in texture %s \"%s\".") << uri << (isUrn? "URN" : "URI");
return false;
}
// If this is a URN we extract the scheme from the path.
String schemeString;
if(isUrn)
{
if(flags.testFlag(NotUrn))
{
if(!quiet) LOG_MSG("Texture URN \"%s\" supplied, URI required.") << uri;
return false;
}
String const &pathStr = uri.path().toStringRef();
int const uIdPos = pathStr.indexOf(':');
if(uIdPos > 0)
{
schemeString = pathStr.left(uIdPos);
}
}
else
{
schemeString = uri.scheme();
}
if(schemeString.isEmpty())
{
if(!flags.testFlag(AnyScheme))
{
if(!quiet) LOG_MSG("Missing scheme in texture %s \"%s\".") << uri << (isUrn? "URN" : "URI");
return false;
}
}
else if(!knownScheme(schemeString))
{
if(!quiet) LOG_MSG("Unknown scheme in texture %s \"%s\".") << uri << (isUrn? "URN" : "URI");
return false;
}
return true;
}
Textures::Manifest &Textures::find(Uri const &uri) const
{
LOG_AS("Textures::find");
if(!validateUri(uri, AnyScheme, true /*quiet please*/))
/// @throw NotFoundError Failed to locate a matching manifest.
throw NotFoundError("Textures::find", "URI \"" + uri.asText() + "\" failed validation");
// Perform the search.
// Is this a URN? (of the form "urn:schemename:uniqueid")
if(!uri.scheme().compareWithoutCase("urn"))
{
String const &pathStr = uri.path().toStringRef();
int uIdPos = pathStr.indexOf(':');
if(uIdPos > 0)
{
String schemeName = pathStr.left(uIdPos);
int uniqueId = pathStr.mid(uIdPos + 1 /*skip delimiter*/).toInt();
try
{
return scheme(schemeName).findByUniqueId(uniqueId);
}
catch(Scheme::NotFoundError const &)
{} // Ignore, we'll throw our own...
}
}
else
{
// No, this is a URI.
String const &path = uri.path();
// Does the user want a manifest in a specific scheme?
if(!uri.scheme().isEmpty())
{
try
{
return scheme(uri.scheme()).find(path);
}
catch(Scheme::NotFoundError const &)
{} // Ignore, we'll throw our own...
}
else
{
// No, check each scheme in priority order.
foreach(Scheme *scheme, d->schemeCreationOrder)
{
try
{
return scheme->find(path);
}
catch(Scheme::NotFoundError const &)
{} // Ignore this error.
}
}
}
/// @throw NotFoundError Failed to locate a matching manifest.
throw NotFoundError("Textures::find", "Failed to locate a manifest matching \"" + uri.asText() + "\"");
}
bool Textures::has(Uri const &path) const
{
try
{
find(path);
return true;
}
catch(NotFoundError const &)
{} // Ignore this error.
return false;
}
TextureManifest *Textures::declare(Uri const &uri, de::Texture::Flags flags,
Vector2i const &dimensions, Vector2i const &origin, int uniqueId, de::Uri const *resourceUri)
{
LOG_AS("Textures::declare");
if(uri.isEmpty()) return 0;
// We require a properly formed uri (but not a urn - this is a path).
if(!validateUri(uri, NotUrn, (verbose >= 1)))
{
LOG_WARNING("Failed declaring texture \"%s\" (invalid URI), ignoring.") << uri;
return 0;
}
// Have we already created a manifest for this?
TextureManifest *manifest = 0;
try
{
manifest = &find(uri);
}
catch(NotFoundError const &)
{
manifest = &scheme(uri.scheme()).insertManifest(uri.path());
}
catch(...)
{
throw Error("Textures::declare", "Unexpected error declaring texture \"" + uri + "\"");
}
/*
* (Re)configure the manifest.
*/
bool mustRelease = false;
manifest->flags() = flags;
manifest->setOrigin(origin);
if(manifest->setLogicalDimensions(dimensions))
{
mustRelease = true;
}
// We don't care whether these identfiers are truely unique. Our only
// responsibility is to release textures when they change.
if(manifest->setUniqueId(uniqueId))
{
mustRelease = true;
}
if(resourceUri && manifest->setResourceUri(*resourceUri))
{
// The mapped resource is being replaced, so release any existing Texture.
/// @todo Only release if this Texture is bound to only this binding.
mustRelease = true;
}
if(mustRelease && manifest->hasTexture())
{
#ifdef __CLIENT__
/// @todo Update any Materials (and thus Surfaces) which reference this.
GL_ReleaseGLTexturesByTexture(manifest->texture());
#endif
}
return manifest;
}
static int iterateTextures(TextureScheme const &scheme,
int (*callback)(Texture &tex, void *parameters), void *parameters)
{
PathTreeIterator<TextureScheme::Index> iter(scheme.index().leafNodes());
while(iter.hasNext())
{
TextureManifest &manifest = iter.next();
if(!manifest.hasTexture()) continue;
if(int result = callback(manifest.texture(), parameters))
return result;
}
return 0; // Continue iteration.
}
int Textures::iterate(String nameOfScheme,
int (*callback)(Texture &tex, void *parameters), void *parameters) const
{
if(!callback) return 0;
// Limit iteration to a specific scheme?
if(!nameOfScheme.isEmpty())
{
return iterateTextures(scheme(nameOfScheme), callback, parameters);
}
foreach(Scheme *scheme, d->schemes)
{
if(int result = iterateTextures(*scheme, callback, parameters))
return result;
}
return 0;
}
static int iterateManifests(TextureScheme const &scheme,
int (*callback)(TextureManifest &manifest, void *parameters), void *parameters)
{
PathTreeIterator<TextureScheme::Index> iter(scheme.index().leafNodes());
while(iter.hasNext())
{
if(int result = callback(iter.next(), parameters))
return result;
}
return 0; // Continue iteration.
}
int Textures::iterateDeclared(String nameOfScheme,
int (*callback)(TextureManifest &manifest, void *parameters), void *parameters) const
{
if(!callback) return 0;
// Limit iteration to a specific scheme?
if(!nameOfScheme.isEmpty())
{
return iterateManifests(scheme(nameOfScheme), callback, parameters);
}
foreach(Scheme *scheme, d->schemes)
{
if(int result = iterateManifests(*scheme, callback, parameters))
return result;
}
return 0;
}
#ifdef __CLIENT__
static void printVariantInfo(TextureVariant &variant)
{
float s, t;
variant.coords(&s, &t);
Con_Printf(" Source:%s GLName:%u Masked:%s Prepared:%s Uploaded:%s\n Coords:(s:%g t:%g)\n",
TexSource_Name(variant.source()),
variant.glName(),
variant.isMasked() ? "yes":"no",
variant.isPrepared()? "yes":"no",
variant.isUploaded()? "yes":"no", s, t);
Con_Printf(" Specification: ");
GL_PrintTextureVariantSpecification(variant.spec());
}
#endif
static void printTextureInfo(Texture &tex)
{
Uri uri = tex.manifest().composeUri();
QByteArray path = uri.asText().toUtf8();
#ifdef __CLIENT__
Con_Printf("Texture \"%s\" [%p] x%u origin:%s\n",
path.constData(), (void *)&tex, tex.variantCount(),
tex.flags().testFlag(Texture::Custom)? "addon" : "game");
#else
Con_Printf("Texture \"%s\" [%p] origin:%s\n",
path.constData(), (void *)&tex,
tex.flags().testFlag(Texture::Custom)? "addon" : "game");
#endif
if(tex.width() == 0 && tex.height() == 0)
Con_Printf("Dimensions: unknown (not yet loaded)\n");
else
Con_Printf("Dimensions: %d x %d\n", tex.width(), tex.height());
#ifdef __CLIENT__
uint variantIdx = 0;
foreach(TextureVariant *variant, tex.variants())
{
Con_Printf("Variant #%i:\n", variantIdx);
printVariantInfo(*variant);
++variantIdx;
}
#endif
}
static void printManifestInfo(TextureManifest &manifest,
de::Uri::ComposeAsTextFlags uriCompositionFlags = de::Uri::DefaultComposeAsTextFlags)
{
String sourceDescription = !manifest.hasTexture()? "unknown" : manifest.texture().flags().testFlag(Texture::Custom)? "addon" : "game";
String info = String("%1 %2")
.arg(manifest.composeUri().compose(uriCompositionFlags | de::Uri::DecodePath),
( uriCompositionFlags.testFlag(de::Uri::OmitScheme)? -14 : -22 ) )
.arg(sourceDescription, -7);
#ifdef __CLIENT__
info += String("x%1").arg(!manifest.hasTexture()? 0 : manifest.texture().variantCount());
#endif
info += " " + (manifest.resourceUri().isEmpty()? "N/A" : manifest.resourceUri().asText());
info += "\n";
Con_FPrintf(!manifest.hasTexture()? CPF_LIGHT : CPF_WHITE, info.toUtf8().constData());
}
static bool pathBeginsWithComparator(TextureManifest const &manifest, void *parameters)
{
Path const *path = reinterpret_cast<Path*>(parameters);
/// @todo Use PathTree::Node::compare()
return manifest.path().toStringRef().beginsWith(*path, Qt::CaseInsensitive);
}
/**
* @todo This logic should be implemented in de::PathTree -ds
*/
static int collectManifestsInScheme(TextureScheme const &scheme,
bool (*predicate)(TextureManifest const &manifest, void *parameters), void *parameters,
QList<TextureManifest *> *storage = 0)
{
int count = 0;
PathTreeIterator<TextureScheme::Index> iter(scheme.index().leafNodes());
while(iter.hasNext())
{
TextureManifest &manifest = iter.next();
if(predicate(manifest, parameters))
{
count += 1;
if(storage) // Store mode?
{
storage->push_back(&manifest);
}
}
}
return count;
}
static QList<TextureManifest *> collectManifests(TextureScheme *scheme,
Path const &path, QList<TextureManifest *> *storage = 0)
{
int count = 0;
if(!path.isEmpty())
{
if(scheme)
{
// Consider materials in the specified scheme only.
count += collectManifestsInScheme(*scheme, pathBeginsWithComparator, (void*)&path, storage);
}
else
{
// Consider materials in any scheme.
foreach(TextureScheme *scheme, App_Textures().allSchemes())
{
count += collectManifestsInScheme(*scheme, pathBeginsWithComparator, (void*)&path, storage);
}
}
}
if(storage)
{
return *storage;
}
QList<TextureManifest *> result;
if(count == 0) return result;
#ifdef DENG2_QT_4_7_OR_NEWER
result.reserve(count);
#endif
return collectManifests(scheme, path, &result);
}
/**
* Decode and then lexicographically compare the two manifest
* paths, returning @c true if @a is less than @a b.
*/
static bool compareTextureManifestPathsAssending(TextureManifest const *a,
TextureManifest const *b)
{
String pathA = QString(QByteArray::fromPercentEncoding(a->path().toUtf8()));
String pathB = QString(QByteArray::fromPercentEncoding(b->path().toUtf8()));
return pathA.compareWithoutCase(pathB) < 0;
}
/**
* @param scheme Texture subspace scheme being printed. Can be @c NULL in
* which case textures are printed from all schemes.
* @param like Texture path search term.
* @param composeUriFlags Flags governing how URIs should be composed.
*/
static int printTextures2(TextureScheme *scheme, Path const &like,
Uri::ComposeAsTextFlags composeUriFlags)
{
QList<TextureManifest *> found = collectManifests(scheme, like);
if(found.isEmpty()) return 0;
bool const printSchemeName = !(composeUriFlags & Uri::OmitScheme);
// Print a heading.
String heading = "Known textures";
if(!printSchemeName && scheme)
heading += " in scheme '" + scheme->name() + "'";
if(!like.isEmpty())
heading += " like \"" + like + "\"";
heading += ":";
Con_FPrintf(CPF_YELLOW, "%s\n", heading.toUtf8().constData());
// Print the result index key.
int numFoundDigits = de::max(3/*idx*/, M_NumDigits(found.count()));
#ifdef __CLIENT__
Con_Printf(" %*s: %-*s origin n# uri\n", numFoundDigits, "idx",
printSchemeName? 22 : 14, printSchemeName? "scheme:path" : "path");
#else
Con_Printf(" %*s: %-*s origin uri\n", numFoundDigits, "idx",
printSchemeName? 22 : 14, printSchemeName? "scheme:path" : "path");
#endif
Con_PrintRuler();
// Sort and print the index.
qSort(found.begin(), found.end(), compareTextureManifestPathsAssending);
int idx = 0;
foreach(TextureManifest *manifest, found)
{
Con_Printf(" %*i: ", numFoundDigits, idx++);
printManifestInfo(*manifest, composeUriFlags);
}
return found.count();
}
static void printTextures(de::Uri const &search,
de::Uri::ComposeAsTextFlags flags = de::Uri::DefaultComposeAsTextFlags)
{
Textures &textures = App_Textures();
int printTotal = 0;
// Collate and print results from all schemes?
if(search.scheme().isEmpty() && !search.path().isEmpty())
{
printTotal = printTextures2(0/*any scheme*/, search.path(), flags & ~de::Uri::OmitScheme);
Con_PrintRuler();
}
// Print results within only the one scheme?
else if(textures.knownScheme(search.scheme()))
{
printTotal = printTextures2(&textures.scheme(search.scheme()), search.path(), flags | de::Uri::OmitScheme);
Con_PrintRuler();
}
else
{
// Collect and sort results in each scheme separately.
foreach(TextureScheme *scheme, textures.allSchemes())
{
int numPrinted = printTextures2(scheme, search.path(), flags | de::Uri::OmitScheme);
if(numPrinted)
{
Con_PrintRuler();
printTotal += numPrinted;
}
}
}
Con_Printf("Found %i %s.\n", printTotal, printTotal == 1? "Texture" : "Textures");
}
} // namespace de
/**
* @param argv The arguments to be composed. All are assumed to be in non-encoded
* representation.
*
* Supported forms (where <> denote keyword component names):
* - [0: "<scheme>:<path>"]
* - [0: "<scheme>"] (if @a matchSchemeOnly)
* - [0: "<path>"]
* - [0: "<scheme>", 1: "<path>"]
* @param argc The number of elements in @a argv.
* @param matchSchemeOnly @c true= check if the sole argument matches a known scheme.
*/
static de::Uri composeSearchUri(char **argv, int argc, bool matchSchemeOnly = true)
{
if(argv)
{
// [0: <scheme>:<path>] or [0: <scheme>] or [0: <path>].
if(argc == 1)
{
// Try to extract the scheme and encode the rest of the path.
de::String rawUri = de::String(argv[0]);
int pos = rawUri.indexOf(':');
if(pos >= 0)
{
de::String scheme = rawUri.left(pos);
rawUri.remove(0, pos + 1);
return de::Uri(scheme, QString(QByteArray(rawUri.toUtf8()).toPercentEncoding()));
}
// Just a scheme name?
if(matchSchemeOnly && App_Textures().knownScheme(rawUri))
{
return de::Uri().setScheme(rawUri);
}
// Just a path.
return de::Uri(de::Path(QString(QByteArray(rawUri.toUtf8()).toPercentEncoding())));
}
// [0: <scheme>, 1: <path>]
if(argc == 2)
{
// Assign the scheme and encode the path.
return de::Uri(argv[0], QString(QByteArray(argv[1]).toPercentEncoding()));
}
}
return de::Uri();
}
D_CMD(ListTextures)
{
DENG2_UNUSED(src);
de::Textures &textures = App_Textures();
de::Uri search = composeSearchUri(&argv[1], argc - 1);
if(!search.scheme().isEmpty() && !textures.knownScheme(search.scheme()))
{
Con_Printf("Unknown scheme '%s'.\n", search.schemeCStr());
return false;
}
de::printTextures(search);
return true;
}
D_CMD(InspectTexture)
{
DENG2_UNUSED(src);
de::Textures &textures = App_Textures();
de::Uri search = composeSearchUri(&argv[1], argc - 1, false /*don't match schemes*/);
if(!search.scheme().isEmpty() && !textures.knownScheme(search.scheme()))
{
Con_Printf("Unknown scheme '%s'.\n", search.schemeCStr());
return false;
}
try
{
de::TextureManifest &manifest = textures.find(search);
if(manifest.hasTexture())
{
de::printTextureInfo(manifest.texture());
}
else
{
de::printManifestInfo(manifest);
}
return true;
}
catch(de::Textures::NotFoundError const &er)
{
QString msg = er.asText() + ".";
Con_Printf("%s\n", msg.toUtf8().constData());
}
return false;
}
#if _DEBUG
D_CMD(PrintTextureStats)
{
DENG2_UNUSED(src); DENG2_UNUSED(argc); DENG2_UNUSED(argv);
de::Textures &textures = App_Textures();
Con_FPrintf(CPF_YELLOW, "Texture Statistics:\n");
de::Textures::Schemes const &schemes = textures.allSchemes();
DENG2_FOR_EACH_CONST(de::Textures::Schemes, i, schemes)
{
de::Textures::Scheme &scheme = **i;
de::Textures::Scheme::Index const &index = scheme.index();
uint const count = index.count();
Con_Printf("Scheme: %s (%u %s)\n", scheme.name().toUtf8().constData(), count, count == 1? "texture" : "textures");
index.debugPrintHashDistribution();
index.debugPrint();
}
return true;
}
#endif