Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
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 924 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"];
462 [sRecentTextures setAutoPrune:YES];
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

References OOGenerateTextureCacheKey(), and OOInterpretTextureSpecifier().

+ Here is the call graph for this function:

◆ autoreleaseInContext:

- (id) autoreleaseInContext: (NSString *) context

Extends class OOTexture.

Definition at line 924 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

◆ checkExtensions

+ (void) checkExtensions

Extends class OOTexture.

◆ existingTextureForKey:

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

Extends class OOTexture.

◆ forceRebind

- (void) forceRebind

Extends class OOTexture.

Definition at line 924 of file OOTexture.m.

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

◆ releaseInContext:

- (void) releaseInContext: (NSString *) context

Extends class OOTexture.

Definition at line 924 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}

◆ retainInContext:

- (id) retainInContext: (NSString *) context

Extends class OOTexture.

Definition at line 924 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}

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