Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OOTexture.h File Reference
import <Foundation/Foundation.h>
import "OOOpenGL.h"
import "OOPixMap.h"
import "OOWeakReference.h"
+ Include dependency graph for OOTexture.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OOTexture
 
category  NSDictionary(OOTextureConveniences)
 
category  NSArray(OOTextureConveniences)
 

Macros

#define kOOTextureDefaultAnisotropy   0.5
 
#define kOOTextureDefaultLODBias   -0.25
 

Typedefs

typedef uint32_t OOTextureFlags
 
typedef OOPixMapFormat OOTextureDataFormat
 

Enumerations

enum  {
  kOOTextureMinFilterDefault = 0x000000UL , kOOTextureMinFilterNearest = 0x000001UL , kOOTextureMinFilterLinear = 0x000002UL , kOOTextureMinFilterMipMap = 0x000003UL ,
  kOOTextureMagFilterNearest = 0x000000UL , kOOTextureMagFilterLinear = 0x000004UL , kOOTextureNoShrink = 0x000010UL , kOOTextureExtraShrink = 0x000020UL ,
  kOOTextureRepeatS = 0x000040UL , kOOTextureRepeatT = 0x000080UL , kOOTextureAllowRectTexture = 0x000100UL , kOOTextureNoFNFMessage = 0x000200UL ,
  kOOTextureNeverScale = 0x000400UL , kOOTextureAlphaMask = 0x000800UL , kOOTextureAllowCubeMap = 0x001000UL , kOOTextureSRGBA = 0x002000UL ,
  kOOTextureExtractChannelMask = 0x700000UL , kOOTextureExtractChannelNone = 0x000000UL , kOOTextureExtractChannelR = 0x100000UL , kOOTextureExtractChannelG = 0x300000UL ,
  kOOTextureExtractChannelB = 0x500000UL , kOOTextureExtractChannelA = 0x700000UL , kOOTextureMinFilterMask = 0x000003UL , kOOTextureMagFilterMask = 0x000004UL ,
  kOOTextureFlagsMask = ~(kOOTextureMinFilterMask | kOOTextureMagFilterMask) , kOOTextureDefaultOptions = kOOTextureMinFilterDefault | kOOTextureMagFilterLinear , kOOTextureDefinedFlags , kOOTextureFlagsAllowedForRectangleTexture ,
  kOOTextureFlagsAllowedForCubeMap
}
 
enum  { kOOTextureDataInvalid = kOOPixMapInvalidFormat , kOOTextureDataRGBA = kOOPixMapRGBA , kOOTextureDataGrayscale = kOOPixMapGrayscale , kOOTextureDataGrayscaleAlpha = kOOPixMapGrayscaleAlpha }
 

Functions

NSDictionary * OOTextureSpecFromObject (id object, NSString *defaultName)
 
uint8_t OOTextureComponentsForFormat (OOTextureDataFormat format)
 
BOOL OOCubeMapsAvailable (void)
 
BOOL OOInterpretTextureSpecifier (id specifier, NSString **outName, OOTextureFlags *outOptions, float *outAnisotropy, float *outLODBias, BOOL ignoreExtract)
 
NSDictionary * OOMakeTextureSpecifier (NSString *name, OOTextureFlags options, float anisotropy, float lodBias, BOOL internal)
 
OOTextureFlags OOApplyTextureOptionDefaults (OOTextureFlags options)
 

Variables

NSString *const kOOTextureSpecifierNameKey
 
NSString *const kOOTextureSpecifierSwizzleKey
 
NSString *const kOOTextureSpecifierMinFilterKey
 
NSString *const kOOTextureSpecifierMagFilterKey
 
NSString *const kOOTextureSpecifierNoShrinkKey
 
NSString *const kOOTextureSpecifierExtraShrinkKey
 
NSString *const kOOTextureSpecifierRepeatSKey
 
NSString *const kOOTextureSpecifierRepeatTKey
 
NSString *const kOOTextureSpecifierCubeMapKey
 
NSString *const kOOTextureSpecifierAnisotropyKey
 
NSString *const kOOTextureSpecifierLODBiasKey
 
NSString *const kOOTextureSpecifierModulateColorKey
 
NSString *const kOOTextureSpecifierIlluminationModeKey
 
NSString *const kOOTextureSpecifierSelfColorKey
 
NSString *const kOOTextureSpecifierScaleFactorKey
 
NSString *const kOOTextureSpecifierBindingKey
 

Macro Definition Documentation

◆ kOOTextureDefaultAnisotropy

#define kOOTextureDefaultAnisotropy   0.5

Definition at line 101 of file OOTexture.h.

Referenced by OOInterpretTextureSpecifier(), and OOMakeTextureSpecifier().

◆ kOOTextureDefaultLODBias

#define kOOTextureDefaultLODBias   -0.25

Definition at line 102 of file OOTexture.h.

Referenced by OOInterpretTextureSpecifier(), and OOMakeTextureSpecifier().

Typedef Documentation

◆ OOTextureDataFormat

Definition at line 113 of file OOTexture.h.

◆ OOTextureFlags

typedef uint32_t OOTextureFlags

Definition at line 98 of file OOTexture.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kOOTextureMinFilterDefault 
kOOTextureMinFilterNearest 
kOOTextureMinFilterLinear 
kOOTextureMinFilterMipMap 
kOOTextureMagFilterNearest 
kOOTextureMagFilterLinear 
kOOTextureNoShrink 
kOOTextureExtraShrink 
kOOTextureRepeatS 
kOOTextureRepeatT 
kOOTextureAllowRectTexture 
kOOTextureNoFNFMessage 
kOOTextureNeverScale 
kOOTextureAlphaMask 
kOOTextureAllowCubeMap 
kOOTextureSRGBA 
kOOTextureExtractChannelMask 
kOOTextureExtractChannelNone 
kOOTextureExtractChannelR 
kOOTextureExtractChannelG 
kOOTextureExtractChannelB 
kOOTextureExtractChannelA 
kOOTextureMinFilterMask 
kOOTextureMagFilterMask 
kOOTextureFlagsMask 
kOOTextureDefaultOptions 
kOOTextureDefinedFlags 
kOOTextureFlagsAllowedForRectangleTexture 
kOOTextureFlagsAllowedForCubeMap 

Definition at line 43 of file OOTexture.h.

44{
45 kOOTextureMinFilterDefault = 0x000000UL,
46 kOOTextureMinFilterNearest = 0x000001UL,
47 kOOTextureMinFilterLinear = 0x000002UL,
48 kOOTextureMinFilterMipMap = 0x000003UL,
49
50 kOOTextureMagFilterNearest = 0x000000UL,
51 kOOTextureMagFilterLinear = 0x000004UL,
52
53 kOOTextureNoShrink = 0x000010UL,
54 kOOTextureExtraShrink = 0x000020UL,
55 kOOTextureRepeatS = 0x000040UL,
56 kOOTextureRepeatT = 0x000080UL,
57 kOOTextureAllowRectTexture = 0x000100UL, // Indicates that GL_TEXTURE_RECTANGLE_EXT may be used instead of GL_TEXTURE_2D. See -texCoordsScale for a discussion of rectangle textures.
58 kOOTextureNoFNFMessage = 0x000200UL, // Don't log file not found error
59 kOOTextureNeverScale = 0x000400UL, // Don't rescale texture, even if rect textures are not available. This *must not* be used for regular textures, but may be passed to OOTextureLoader when being used for other purposes.
60 kOOTextureAlphaMask = 0x000800UL, // Single-channel texture should be GL_ALPHA, not GL_LUMINANCE. No effect for multi-channel textures.
61 kOOTextureAllowCubeMap = 0x001000UL,
62
63 kOOTextureSRGBA = 0x002000UL,
64
67 kOOTextureExtractChannelR = 0x100000UL, // 001
68 kOOTextureExtractChannelG = 0x300000UL, // 011
69 kOOTextureExtractChannelB = 0x500000UL, // 101
70 kOOTextureExtractChannelA = 0x700000UL, // 111
71
72 kOOTextureMinFilterMask = 0x000003UL,
73 kOOTextureMagFilterMask = 0x000004UL,
75
77
90
95};
@ kOOTextureRepeatS
Definition OOTexture.h:55
@ kOOTextureAllowRectTexture
Definition OOTexture.h:57
@ kOOTextureExtractChannelA
Definition OOTexture.h:70
@ kOOTextureExtractChannelB
Definition OOTexture.h:69
@ kOOTextureFlagsAllowedForCubeMap
Definition OOTexture.h:93
@ kOOTextureNoFNFMessage
Definition OOTexture.h:58
@ kOOTextureNoShrink
Definition OOTexture.h:53
@ kOOTextureMinFilterDefault
Definition OOTexture.h:45
@ kOOTextureExtractChannelNone
Definition OOTexture.h:66
@ kOOTextureMagFilterMask
Definition OOTexture.h:73
@ kOOTextureExtractChannelMask
Definition OOTexture.h:65
@ kOOTextureDefinedFlags
Definition OOTexture.h:78
@ kOOTextureMinFilterLinear
Definition OOTexture.h:47
@ kOOTextureAllowCubeMap
Definition OOTexture.h:61
@ kOOTextureMinFilterMask
Definition OOTexture.h:72
@ kOOTextureSRGBA
Definition OOTexture.h:63
@ kOOTextureRepeatT
Definition OOTexture.h:56
@ kOOTextureDefaultOptions
Definition OOTexture.h:76
@ kOOTextureMinFilterMipMap
Definition OOTexture.h:48
@ kOOTextureNeverScale
Definition OOTexture.h:59
@ kOOTextureAlphaMask
Definition OOTexture.h:60
@ kOOTextureMagFilterNearest
Definition OOTexture.h:50
@ kOOTextureExtraShrink
Definition OOTexture.h:54
@ kOOTextureExtractChannelG
Definition OOTexture.h:68
@ kOOTextureFlagsMask
Definition OOTexture.h:74
@ kOOTextureFlagsAllowedForRectangleTexture
Definition OOTexture.h:91
@ kOOTextureExtractChannelR
Definition OOTexture.h:67
@ kOOTextureMagFilterLinear
Definition OOTexture.h:51
@ kOOTextureMinFilterNearest
Definition OOTexture.h:46

◆ anonymous enum

anonymous enum
Enumerator
kOOTextureDataInvalid 
kOOTextureDataRGBA 
kOOTextureDataGrayscale 
kOOTextureDataGrayscaleAlpha 

Definition at line 105 of file OOTexture.h.

106{
108
110 kOOTextureDataGrayscale = kOOPixMapGrayscale, // GL_LUMINANCE (or GL_ALPHA with kOOTextureAlphaMask)
112};
@ kOOPixMapInvalidFormat
Definition OOPixMap.h:40
@ kOOPixMapGrayscale
Definition OOPixMap.h:41
@ kOOPixMapRGBA
Definition OOPixMap.h:43
@ kOOPixMapGrayscaleAlpha
Definition OOPixMap.h:42
@ kOOTextureDataGrayscaleAlpha
Definition OOTexture.h:111
@ kOOTextureDataGrayscale
Definition OOTexture.h:110
@ kOOTextureDataInvalid
Definition OOTexture.h:107
@ kOOTextureDataRGBA
Definition OOTexture.h:109

Function Documentation

◆ OOApplyTextureOptionDefaults()

OOTextureFlags OOApplyTextureOptionDefaults ( OOTextureFlags options)

Definition at line 855 of file OOTexture.m.

856{
857 // Set default flags if needed
859 {
860 if ([UNIVERSE reducedDetail])
861 {
862 options |= kOOTextureMinFilterLinear;
863 }
864 else
865 {
866 options |= kOOTextureMinFilterMipMap;
867 }
868 }
869
871 {
872 /* In the unlikely case of an OpenGL system without GL_SGIS_texture_lod,
873 disable mip-mapping completely. Strictly this is only needed for
874 non-square textures, but extra logic for such a rare case isn't
875 worth it.
876 */
878 {
880 }
881 }
882
883 if (options & kOOTextureAllowRectTexture)
884 {
885 // Apply rectangle texture restrictions (regardless of whether rectangle textures are available, for consistency)
888 {
889 options = (kOOTextureMinFilterMask & ~kOOTextureMinFilterMask) | kOOTextureMinFilterLinear;
890 }
891
892#if GL_EXT_texture_rectangle
894 {
895 options &= ~kOOTextureAllowRectTexture;
896 }
897#else
898 options &= ~kOOTextureAllowRectTexture;
899#endif
900 }
901
902 options &= kOOTextureDefinedFlags;
903
904 return options;
905}
OOTextureInfo gOOTextureInfo
Definition OOTexture.m:101
#define UNIVERSE
Definition Universe.h:833
unsigned textureMaxLevelAvailable
unsigned rectangleTextureAvailable

References gOOTextureInfo, kOOTextureAllowRectTexture, kOOTextureDefinedFlags, kOOTextureFlagsAllowedForRectangleTexture, kOOTextureMinFilterDefault, kOOTextureMinFilterLinear, kOOTextureMinFilterMask, kOOTextureMinFilterMipMap, OOTextureInfo::rectangleTextureAvailable, OOTextureInfo::textureMaxLevelAvailable, and UNIVERSE.

Referenced by OOPixMapTextureLoader::dealloc, OODefaultShaderSynthesizer::KeyFromTextureParameters, and OOGenerateTextureCacheKey().

+ Here is the caller graph for this function:

◆ OOCubeMapsAvailable()

BOOL OOCubeMapsAvailable ( void )

Definition at line 688 of file OOTexture.m.

689{
691}
unsigned cubeMapAvailable

References OOTextureInfo::cubeMapAvailable, and gOOTextureInfo.

◆ OOInterpretTextureSpecifier()

BOOL OOInterpretTextureSpecifier ( id specifier,
NSString ** outName,
OOTextureFlags * outOptions,
float * outAnisotropy,
float * outLODBias,
BOOL ignoreExtract )

Definition at line 694 of file OOTexture.m.

695{
696 NSString *name = nil;
698 float anisotropy = kOOTextureDefaultAnisotropy;
699 float lodBias = kOOTextureDefaultLODBias;
700
701 if ([specifier isKindOfClass:[NSString class]])
702 {
703 name = specifier;
704 }
705 else if ([specifier isKindOfClass:[NSDictionary class]])
706 {
707 name = [specifier oo_stringForKey:kOOTextureSpecifierNameKey];
708 if (name == nil)
709 {
710 OOLog(@"texture.load.noName", @"Invalid texture configuration dictionary (must specify name):\n%@", specifier);
711 return NO;
712 }
713
714 int quickFlags = [specifier oo_intForKey:kOOTextureSpecifierFlagValueInternalKey defaultValue:-1];
715 if (quickFlags != -1)
716 {
717 options = quickFlags;
718 }
719 else
720 {
721 NSString *filterString = [specifier oo_stringForKey:kOOTextureSpecifierMinFilterKey defaultValue:@"default"];
722 if ([filterString isEqualToString:@"nearest"]) options |= kOOTextureMinFilterNearest;
723 else if ([filterString isEqualToString:@"linear"]) options |= kOOTextureMinFilterLinear;
724 else if ([filterString isEqualToString:@"mipmap"]) options |= kOOTextureMinFilterMipMap;
725 else options |= kOOTextureMinFilterDefault; // Covers "default"
726
727 filterString = [specifier oo_stringForKey:kOOTextureSpecifierMagFilterKey defaultValue:@"default"];
728 if ([filterString isEqualToString:@"nearest"]) options |= kOOTextureMagFilterNearest;
729 else options |= kOOTextureMagFilterLinear; // Covers "default" and "linear"
730
731 if ([specifier oo_boolForKey:kOOTextureSpecifierNoShrinkKey defaultValue:NO]) options |= kOOTextureNoShrink;
732 if ([specifier oo_boolForKey:kOOTextureSpecifierExtraShrinkKey defaultValue:NO]) options |= kOOTextureExtraShrink;
733 if ([specifier oo_boolForKey:kOOTextureSpecifierRepeatSKey defaultValue:NO]) options |= kOOTextureRepeatS;
734 if ([specifier oo_boolForKey:kOOTextureSpecifierRepeatTKey defaultValue:NO]) options |= kOOTextureRepeatT;
735 if ([specifier oo_boolForKey:kOOTextureSpecifierCubeMapKey defaultValue:NO]) options |= kOOTextureAllowCubeMap;
736
737 if (!ignoreExtract)
738 {
739 NSString *extractChannel = [specifier oo_stringForKey:@"extract_channel"];
740 if (extractChannel != nil)
741 {
742 if ([extractChannel isEqualToString:@"r"]) options |= kOOTextureExtractChannelR;
743 else if ([extractChannel isEqualToString:@"g"]) options |= kOOTextureExtractChannelG;
744 else if ([extractChannel isEqualToString:@"b"]) options |= kOOTextureExtractChannelB;
745 else if ([extractChannel isEqualToString:@"a"]) options |= kOOTextureExtractChannelA;
746 else
747 {
748 OOLogWARN(@"texture.load.extractChannel.invalid", @"Unknown value \"%@\" for extract_channel in specifier \"%@\" (should be \"r\", \"g\", \"b\" or \"a\").", extractChannel,specifier);
749 }
750 }
751 }
752 }
753 anisotropy = [specifier oo_floatForKey:@"anisotropy" defaultValue:kOOTextureDefaultAnisotropy];
754 lodBias = [specifier oo_floatForKey:@"texture_LOD_bias" defaultValue:kOOTextureDefaultLODBias];
755 }
756 else
757 {
758 // Bad type
759 if (specifier != nil) OOLog(kOOLogParameterError, @"%s: expected string or dictionary, got %@.", __PRETTY_FUNCTION__, [specifier class]);
760 return NO;
761 }
762
763 if ([name length] == 0) return NO;
764
765 if (outName != NULL) *outName = name;
766 if (outOptions != NULL) *outOptions = options;
767 if (outAnisotropy != NULL) *outAnisotropy = anisotropy;
768 if (outLODBias != NULL) *outLODBias = lodBias;
769
770 return YES;
771}
#define OOLogWARN(class, format,...)
Definition OOLogging.h:113
#define OOLog(class, format,...)
Definition OOLogging.h:88
NSString *const kOOLogParameterError
Definition OOLogging.m:647
return nil
#define kOOTextureDefaultAnisotropy
Definition OOTexture.h:101
uint32_t OOTextureFlags
Definition OOTexture.h:98
#define kOOTextureDefaultLODBias
Definition OOTexture.h:102
NSString *const kOOTextureSpecifierNoShrinkKey
Definition OOTexture.m:49
NSString *const kOOTextureSpecifierNameKey
Definition OOTexture.m:45
NSString *const kOOTextureSpecifierRepeatTKey
Definition OOTexture.m:52
NSString *const kOOTextureSpecifierMinFilterKey
Definition OOTexture.m:47
NSString *const kOOTextureSpecifierMagFilterKey
Definition OOTexture.m:48
static NSString *const kOOTextureSpecifierFlagValueInternalKey
Definition OOTexture.m:64
NSString *const kOOTextureSpecifierRepeatSKey
Definition OOTexture.m:51
NSString *const kOOTextureSpecifierCubeMapKey
Definition OOTexture.m:53
NSString *const kOOTextureSpecifierExtraShrinkKey
Definition OOTexture.m:50

References kOOLogParameterError, kOOTextureAllowCubeMap, kOOTextureDefaultAnisotropy, kOOTextureDefaultLODBias, kOOTextureDefaultOptions, kOOTextureExtractChannelA, kOOTextureExtractChannelB, kOOTextureExtractChannelG, kOOTextureExtractChannelR, kOOTextureExtraShrink, kOOTextureMagFilterLinear, kOOTextureMagFilterNearest, kOOTextureMinFilterDefault, kOOTextureMinFilterLinear, kOOTextureMinFilterMipMap, kOOTextureMinFilterNearest, kOOTextureNoShrink, kOOTextureRepeatS, kOOTextureRepeatT, kOOTextureSpecifierCubeMapKey, kOOTextureSpecifierExtraShrinkKey, kOOTextureSpecifierNoShrinkKey, kOOTextureSpecifierRepeatSKey, kOOTextureSpecifierRepeatTKey, nil, OOLog, and OOLogWARN.

Referenced by OOTexture(OOPrivate)::addToCaches, and OODefaultShaderSynthesizer::assignIDForTexture:.

+ Here is the caller graph for this function:

◆ OOMakeTextureSpecifier()

NSDictionary * OOMakeTextureSpecifier ( NSString * name,
OOTextureFlags options,
float anisotropy,
float lodBias,
BOOL internal )

Definition at line 774 of file OOTexture.m.

775{
776 NSMutableDictionary *result = [NSMutableDictionary dictionary];
777
778 [result setObject:name forKey:kOOTextureSpecifierNameKey];
779
780 if (anisotropy != kOOTextureDefaultAnisotropy) [result oo_setFloat:anisotropy forKey:kOOTextureSpecifierAnisotropyKey];
781 if (lodBias != kOOTextureDefaultLODBias) [result oo_setFloat:lodBias forKey:kOOTextureSpecifierLODBiasKey];
782
783 if (internal)
784 {
785 [result oo_setUnsignedInteger:options forKey:kOOTextureSpecifierFlagValueInternalKey];
786 }
787 else
788 {
789 NSString *value = nil;
790 switch (options & kOOTextureMinFilterMask)
791 {
793 break;
794
796 value = @"nearest";
797 break;
798
800 value = @"linear";
801 break;
802
804 value = @"mipmap";
805 break;
806 }
807 if (value != nil) [result setObject:value forKey:kOOTextureSpecifierNoShrinkKey];
808
809 value = nil;
810 switch (options & kOOTextureMagFilterMask)
811 {
813 value = @"nearest";
814 break;
815
817 break;
818 }
819 if (value != nil) [result setObject:value forKey:kOOTextureSpecifierMagFilterKey];
820
821 value = nil;
822 switch (options & kOOTextureExtractChannelMask)
823 {
825 break;
826
828 value = @"r";
829 break;
830
832 value = @"g";
833 break;
834
836 value = @"b";
837 break;
838
840 value = @"a";
841 break;
842 }
843 if (value != nil) [result setObject:value forKey:kOOTextureSpecifierSwizzleKey];
844
845 if (options & kOOTextureNoShrink) [result oo_setBool:YES forKey:kOOTextureSpecifierNoShrinkKey];
846 if (options & kOOTextureRepeatS) [result oo_setBool:YES forKey:kOOTextureSpecifierRepeatSKey];
847 if (options & kOOTextureRepeatT) [result oo_setBool:YES forKey:kOOTextureSpecifierRepeatTKey];
848 if (options & kOOTextureAllowCubeMap) [result oo_setBool:YES forKey:kOOTextureSpecifierCubeMapKey];
849 }
850
851 return result;
852}
NSString *const kOOTextureSpecifierAnisotropyKey
Definition OOTexture.m:54
NSString *const kOOTextureSpecifierSwizzleKey
Definition OOTexture.m:46
NSString *const kOOTextureSpecifierLODBiasKey
Definition OOTexture.m:55

References kOOTextureAllowCubeMap, kOOTextureDefaultAnisotropy, kOOTextureDefaultLODBias, kOOTextureExtractChannelA, kOOTextureExtractChannelB, kOOTextureExtractChannelG, kOOTextureExtractChannelMask, kOOTextureExtractChannelNone, kOOTextureExtractChannelR, kOOTextureMagFilterLinear, kOOTextureMagFilterMask, kOOTextureMagFilterNearest, kOOTextureMinFilterDefault, kOOTextureMinFilterLinear, kOOTextureMinFilterMask, kOOTextureMinFilterMipMap, kOOTextureMinFilterNearest, kOOTextureNoShrink, kOOTextureRepeatS, kOOTextureRepeatT, and nil.

◆ OOTextureComponentsForFormat()

uint8_t OOTextureComponentsForFormat ( OOTextureDataFormat format)

Definition at line 667 of file OOTexture.m.

668{
669 switch (format)
670 {
672 return 4;
673
675 return 1;
676
678 return 2;
679
681 break;
682 }
683
684 return 0;
685}

References kOOTextureDataGrayscale, kOOTextureDataGrayscaleAlpha, kOOTextureDataInvalid, and kOOTextureDataRGBA.

◆ OOTextureSpecFromObject()

NSDictionary * OOTextureSpecFromObject ( id object,
NSString * defaultName )

Definition at line 647 of file OOTexture.m.

648{
649 if (object == nil) object = defaultName;
650 if ([object isKindOfClass:[NSString class]])
651 {
652 if ([object isEqualToString:@""]) return nil;
653 return [NSDictionary dictionaryWithObject:object forKey:@"name"];
654 }
655 if (![object isKindOfClass:[NSDictionary class]]) return nil;
656
657 // If we're here, it's a dictionary.
658 if (defaultName == nil || [object oo_stringForKey:@"name"] != nil) return object;
659
660 // If we get here, there's no "name" key and there is a default, so we fill it in:
661 NSMutableDictionary *mutableResult = [NSMutableDictionary dictionaryWithDictionary:object];
662 [mutableResult setObject:[[defaultName copy] autorelease] forKey:@"name"];
663 return mutableResult;
664}

References nil.

Variable Documentation

◆ kOOTextureSpecifierAnisotropyKey

NSString* const kOOTextureSpecifierAnisotropyKey
extern

Definition at line 54 of file OOTexture.m.

◆ kOOTextureSpecifierBindingKey

NSString* const kOOTextureSpecifierBindingKey
extern

Definition at line 61 of file OOTexture.m.

◆ kOOTextureSpecifierCubeMapKey

NSString* const kOOTextureSpecifierCubeMapKey
extern

Definition at line 53 of file OOTexture.m.

Referenced by OOInterpretTextureSpecifier().

◆ kOOTextureSpecifierExtraShrinkKey

NSString* const kOOTextureSpecifierExtraShrinkKey
extern

Definition at line 50 of file OOTexture.m.

Referenced by OOInterpretTextureSpecifier().

◆ kOOTextureSpecifierIlluminationModeKey

NSString* const kOOTextureSpecifierIlluminationModeKey
extern

Definition at line 58 of file OOTexture.m.

◆ kOOTextureSpecifierLODBiasKey

NSString* const kOOTextureSpecifierLODBiasKey
extern

Definition at line 55 of file OOTexture.m.

◆ kOOTextureSpecifierMagFilterKey

NSString* const kOOTextureSpecifierMagFilterKey
extern

Definition at line 48 of file OOTexture.m.

◆ kOOTextureSpecifierMinFilterKey

NSString* const kOOTextureSpecifierMinFilterKey
extern

Definition at line 47 of file OOTexture.m.

◆ kOOTextureSpecifierModulateColorKey

NSString* const kOOTextureSpecifierModulateColorKey
extern

Definition at line 57 of file OOTexture.m.

◆ kOOTextureSpecifierNameKey

NSString* const kOOTextureSpecifierNameKey
extern

Definition at line 45 of file OOTexture.m.

◆ kOOTextureSpecifierNoShrinkKey

NSString* const kOOTextureSpecifierNoShrinkKey
extern

Definition at line 49 of file OOTexture.m.

Referenced by OOInterpretTextureSpecifier().

◆ kOOTextureSpecifierRepeatSKey

NSString* const kOOTextureSpecifierRepeatSKey
extern

Definition at line 51 of file OOTexture.m.

Referenced by OOInterpretTextureSpecifier().

◆ kOOTextureSpecifierRepeatTKey

NSString* const kOOTextureSpecifierRepeatTKey
extern

Definition at line 52 of file OOTexture.m.

Referenced by OOInterpretTextureSpecifier().

◆ kOOTextureSpecifierScaleFactorKey

NSString* const kOOTextureSpecifierScaleFactorKey
extern

Definition at line 60 of file OOTexture.m.

◆ kOOTextureSpecifierSelfColorKey

NSString* const kOOTextureSpecifierSelfColorKey
extern

Definition at line 59 of file OOTexture.m.

◆ kOOTextureSpecifierSwizzleKey

NSString* const kOOTextureSpecifierSwizzleKey
extern

Definition at line 46 of file OOTexture.m.