| 557 | // ============================================================================ |
| 558 | |
| 559 | CachedTexture::CachedTexture(TextureCache &cache, const QString &path, |
| 560 | bool mipmap, bool compress) |
| 561 | // ---------------------------------------------------------------------------- |
| 562 | // Allocate GL texture ID to image |
| 563 | // ---------------------------------------------------------------------------- |
| 564 | : path(path), width(0), height(0), mipmap(mipmap), |
| 565 | compress(compress), isDefaultTexture(false), |
| 566 | networked(path.contains("://")), |
| 567 | cache(cache), GLsize(0), |
| 568 | memLRU(this), GLmemLRU(this), saveCompressed(cache.saveCompressed), |
| 569 | networkReply(NULL), inLoad(false) |
| 570 | { |
| 571 | GL.GenTextures(1, &id); |
| 572 | if (networked) |
| 573 | { |
| 574 | connect(&cache.network, SIGNAL(finished(QNetworkReply*)), |
| 575 | this, SLOT(checkReply(QNetworkReply*))); |
| 576 | } |
| 577 | else |
| 578 | { |
| 579 | connect(&cache.fileMonitor, SIGNAL(created(QString,QString)), |
| 580 | this, SLOT(onFileCreated(QString,QString))); |
| 581 | connect(&cache.fileMonitor, SIGNAL(changed(QString,QString)), |
| 582 | this, SLOT(onFileChanged(QString,QString))); |
| 583 | connect(&cache.fileMonitor, SIGNAL(deleted(QString,QString)), |
| 584 | this, SLOT(onFileDeleted(QString))); |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | |
| 589 | CachedTexture::~CachedTexture() |
nothing calls this directly
no test coverage detected