Oolite
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

Definition at line 42 of file OOSkyDrawable.m.

◆ SKY_ELEMENT_SCALE_FACTOR

#define SKY_ELEMENT_SCALE_FACTOR   (BILLBOARD_DEPTH / 500.0f)

Definition at line 41 of file OOSkyDrawable.m.

◆ 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

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()

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

Definition at line 715 of file OOSkyDrawable.m.

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

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

+ Here is the call graph for this function:

Variable Documentation

◆ sInited

BOOL sInited = NO
static

Definition at line 51 of file OOSkyDrawable.m.

◆ sMaxTexCoord

float sMaxTexCoord = 1.0f
static

Definition at line 50 of file OOSkyDrawable.m.

◆ sMinTexCoord

float sMinTexCoord = 0.0f
static

Definition at line 50 of file OOSkyDrawable.m.

◆ sNebulaTextures

OOProbabilisticTextureManager* sNebulaTextures
static

Definition at line 104 of file OOSkyDrawable.m.

◆ sStarTextures

OOProbabilisticTextureManager* sStarTextures
static

Definition at line 103 of file OOSkyDrawable.m.