Oolite 1.91.0.7745-260117-205bce7
Loading...
Searching...
No Matches
OOSkyDrawable.m File Reference
Include dependency graph for OOSkyDrawable.m:

Go to the source code of this file.

Classes

struct  OOSkyQuadDesc
class  OOSkyQuadSet
category  OOSkyDrawable(OOPrivate)

Macros

#define SKY_ELEMENT_SCALE_FACTOR   (BILLBOARD_DEPTH / 500.0f)
#define NEBULA_SHUFFLE_FACTOR   0.005f
#define DEBUG_COLORS   0
#define SKYCOLOR_TONEMAP_COMPONENT(skyColorComponent)

Typedefs

typedef struct OOSkyQuadDesc OOSkyQuadDesc

Enumerations

enum  { kSkyQuadSetPositionEntriesPerVertex = 3 , kSkyQuadSetTexCoordEntriesPerVertex = 2 , kSkyQuadSetColorEntriesPerVertex = 4 }

Functions

static OOColorSaturatedColorInRange (OOColor *color1, OOColor *color2, BOOL hueFix)

Variables

static float sMinTexCoord = 0.0f
static float sMaxTexCoord = 1.0f
static BOOL sInited = NO
static OOProbabilisticTextureManagersStarTextures
static OOProbabilisticTextureManagersNebulaTextures

Macro Definition Documentation

◆ DEBUG_COLORS

#define DEBUG_COLORS   0

Definition at line 43 of file OOSkyDrawable.m.

◆ NEBULA_SHUFFLE_FACTOR

#define NEBULA_SHUFFLE_FACTOR   0.005f

◆ SKY_ELEMENT_SCALE_FACTOR

◆ SKYCOLOR_TONEMAP_COMPONENT

#define SKYCOLOR_TONEMAP_COMPONENT ( skyColorComponent)
Value:
do { \
x = MAX(0.0, skyColorComponent - 0.004); \
*col++ = (x * (6.2 * x + 0.5)) / (x * (6.2 * x + 1.7) + 0.06); \
} while (0)
#define MAX(A, B)
Definition OOMaths.h:114
float x

Referenced by OOSkyQuadSet::initWithQuadsWithTexture:inArray:count:.

Typedef Documentation

◆ OOSkyQuadDesc

typedef struct OOSkyQuadDesc OOSkyQuadDesc

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kSkyQuadSetPositionEntriesPerVertex 
kSkyQuadSetTexCoordEntriesPerVertex 
kSkyQuadSetColorEntriesPerVertex 

Definition at line 65 of file OOSkyDrawable.m.

66{
70};
@ kSkyQuadSetTexCoordEntriesPerVertex
@ kSkyQuadSetPositionEntriesPerVertex
@ kSkyQuadSetColorEntriesPerVertex

Function Documentation

◆ SaturatedColorInRange()

OOColor * SaturatedColorInRange ( OOColor * color1,
OOColor * color2,
BOOL hueFix )
static

Definition at line 717 of file OOSkyDrawable.m.

718{
719 OOColor *color = nil;
720 float hue, saturation, brightness, alpha;
721
722 color = [color1 blendedColorWithFraction:randf() ofColor:color2];
723 [color getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha];
724
725 saturation = 0.5 * saturation + 0.5; // move saturation up a notch!
726
727 /* NOTE: this changes the hue, because getHue:... produces hue values
728 in [0, 360], but colorWithCalibratedHue:... takes hue values in
729 [0, 1].
730 */
731 if (hueFix)
732 {
733 /* now nebula colours can be independently set, correct the
734 * range so they behave expectedly if they have actually been
735 * set in planetinfo */
736 hue /= 360.0;
737 }
738 /* else keep it how it was before so the nebula hues are clearer */
739
740 return [OOColor colorWithHue:hue saturation:saturation brightness:brightness alpha:alpha];
741}
return nil
float randf(void)

References OOColor::blendedColorWithFraction:ofColor:, OOColor::colorWithHue:saturation:brightness:alpha:, OOColor::getHue:saturation:brightness:alpha:, and nil.

Referenced by OOSkyDrawable(OOPrivate)::setUpNebulaeWithColor1:color2:clusterFactor:nebulaHueFix:alpha:scale:.

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

Variable Documentation

◆ sInited

BOOL sInited = NO
static

Definition at line 51 of file OOSkyDrawable.m.

◆ sMaxTexCoord

◆ sMinTexCoord

◆ sNebulaTextures

OOProbabilisticTextureManager* sNebulaTextures
static

Definition at line 104 of file OOSkyDrawable.m.

Referenced by OOSkyDrawable(OOPrivate)::loadNebulaTextures.

◆ sStarTextures

OOProbabilisticTextureManager* sStarTextures
static

Definition at line 103 of file OOSkyDrawable.m.

Referenced by OOSkyDrawable(OOPrivate)::loadStarTextures.