Oolite
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 923 of file OOTexture.m.

444{
445#ifndef OOTEXTURE_NO_CACHE
446 NSString *cacheKey = [self cacheKey];
447 if (cacheKey == nil) return;
448
449 // Add self to in-use textures cache, wrapped in an NSValue so the texture isn't retained by the cache.
450 if (EXPECT_NOT(sLiveTextureCache == nil)) sLiveTextureCache = [[NSMutableDictionary alloc] init];
451
452 SET_TRACE_CONTEXT(@"in-use textures cache - SHOULD NOT RETAIN");
453 [sLiveTextureCache setObject:[NSValue valueWithPointer:self] forKey:cacheKey];
455
456 // Add self to recent textures cache.
458 {
459 sRecentTextures = [[OOCache alloc] init];
460 [sRecentTextures setName:@"recent textures"];
461 [sRecentTextures setAutoPrune:YES];
462 [sRecentTextures setPruneThreshold:kRecentTexturesCount];
463 }
464
465 SET_TRACE_CONTEXT(@"adding to recent textures cache");
466 [sRecentTextures setObject:self forKey:cacheKey];
468#endif
469}
#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 923 of file OOTexture.m.

595 :(NSString *)context
596{
597 if (_trace)
598 {
599 if (context) OOLog(@"texture.allocTrace.autoreleased", @"Texture %p autoreleased - %@.", self, context);
600 else OOLog(@"texture.allocTrace.autoreleased", @"Texture %p autoreleased.", self);
601 }
602
603 return [super autorelease];
604}
#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 923 of file OOTexture.m.

438{
440}
#define OOLogGenericSubclassResponsibility()
Definition OOLogging.h:129

◆ releaseInContext:

- (void) releaseInContext: (NSString *)  context

Extends class OOTexture.

Definition at line 923 of file OOTexture.m.

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

◆ retainInContext:

- (id) retainInContext: (NSString *)  context

Extends class OOTexture.

Definition at line 923 of file OOTexture.m.

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

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