Oolite 1.91.0.7668-250429-8542c40
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
OOTexture(OOPrivate) Category Reference

Instance Methods

(void) - addToCaches
 
(void) - forceRebind
 
(id) - retainInContext:
 
(void) - releaseInContext:
 
(id) - autoreleaseInContext:
 

Class Methods

(OOTexture *) + existingTextureForKey:
 
(void) + checkExtensions
 

Detailed Description

Definition at line 104 of file OOTexture.m.

Method Documentation

◆ addToCaches

- (void) addToCaches

Extends class OOTexture.

Definition at line 444 of file OOTexture.m.

445{
446#ifndef OOTEXTURE_NO_CACHE
447 NSString *cacheKey = [self cacheKey];
448 if (cacheKey == nil) return;
449
450 // Add self to in-use textures cache, wrapped in an NSValue so the texture isn't retained by the cache.
451 if (EXPECT_NOT(sLiveTextureCache == nil)) sLiveTextureCache = [[NSMutableDictionary alloc] init];
452
453 SET_TRACE_CONTEXT(@"in-use textures cache - SHOULD NOT RETAIN");
454 [sLiveTextureCache setObject:[NSValue valueWithPointer:self] forKey:cacheKey];
456
457 // Add self to recent textures cache.
459 {
460 sRecentTextures = [[OOCache alloc] init];
461 [sRecentTextures setName:@"recent textures"];
463 [sRecentTextures setPruneThreshold:kRecentTexturesCount];
464 }
465
466 SET_TRACE_CONTEXT(@"adding to recent textures cache");
467 [sRecentTextures setObject:self forKey:cacheKey];
469#endif
470}
#define EXPECT_NOT(x)
return nil
#define CLEAR_TRACE_CONTEXT()
Definition OOTexture.m:129
#define SET_TRACE_CONTEXT(str)
Definition OOTexture.m:125
static OOCache * sRecentTextures
Definition OOTexture.m:97
static NSMutableDictionary * sLiveTextureCache
Definition OOTexture.m:95
void setPruneThreshold:(unsigned threshold)
Definition OOCache.m:272
void setName:(NSString *name)
Definition OOCache.m:348
void setAutoPrune:(BOOL flag)
Definition OOCache.m:289
void setObject:forKey:(id value,[forKey] id key)
Definition OOCache.m:248

References addToCaches, OOTexture::cacheKey, CLEAR_TRACE_CONTEXT, EXPECT_NOT, nil, SET_TRACE_CONTEXT, OOCache::setAutoPrune:, OOCache::setName:, OOCache::setObject:forKey:, OOCache::setPruneThreshold:, sLiveTextureCache, and sRecentTextures.

Referenced by addToCaches.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ autoreleaseInContext:

- (id) autoreleaseInContext: (NSString *) context

Extends class OOTexture.

Definition at line 596 of file OOTexture.m.

596 :(NSString *)context
597{
598 if (_trace)
599 {
600 if (context) OOLog(@"texture.allocTrace.autoreleased", @"Texture %p autoreleased - %@.", self, context);
601 else OOLog(@"texture.allocTrace.autoreleased", @"Texture %p autoreleased.", self);
602 }
603
604 return [super autorelease];
605}
#define OOLog(class, format,...)
Definition OOLogging.h:88

References OOLog.

Referenced by OOTexture::autorelease.

+ Here is the caller graph for this function:

◆ checkExtensions

+ (void) checkExtensions

Extends class OOTexture.

References checkExtensions.

Referenced by checkExtensions.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ existingTextureForKey:

+ (OOTexture *) existingTextureForKey: (NSString *) key

Extends class OOTexture.

References forceRebind.

+ Here is the call graph for this function:

◆ forceRebind

- (void) forceRebind

Extends class OOTexture.

Definition at line 438 of file OOTexture.m.

439{
441}
#define OOLogGenericSubclassResponsibility()
Definition OOLogging.h:129

References forceRebind, and OOLogGenericSubclassResponsibility.

Referenced by existingTextureForKey:, and forceRebind.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ releaseInContext:

- (void) releaseInContext: (NSString *) context

Extends class OOTexture.

Definition at line 584 of file OOTexture.m.

584 :(NSString *)context
585{
586 if (_trace)
587 {
588 if (context) OOLog(@"texture.allocTrace.release", @"Texture %p released (retain count -> %lu) - %@.", self, [self retainCount] - 1, context);
589 else OOLog(@"texture.allocTrace.release", @"Texture %p released (retain count -> %lu).", self, [self retainCount] - 1);
590 }
591
592 [super release];
593}

References OOLog.

Referenced by OOTexture::release.

+ Here is the caller graph for this function:

◆ retainInContext:

- (id) retainInContext: (NSString *) context

Extends class OOTexture.

Definition at line 572 of file OOTexture.m.

572 :(NSString *)context
573{
574 if (_trace)
575 {
576 if (context) OOLog(@"texture.allocTrace.retain", @"Texture %p retained (retain count -> %lu) - %@.", self, [self retainCount] + 1, context);
577 else OOLog(@"texture.allocTrace.retain", @"Texture %p retained (retain count -> %lu).", self, [self retainCount] + 1);
578 }
579
580 return [super retain];
581}

References OOLog.

Referenced by OOTexture::retain.

+ Here is the caller graph for this function:

The documentation for this category was generated from the following file: