Oolite 1.91.0.7604-240417-a536cbe
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions | Variables
OOSkyDrawable.m File Reference
import "OOSkyDrawable.h"
import "ResourceManager.h"
import "OOTexture.h"
import "GameController.h"
import "OOColor.h"
import "OOProbabilisticTextureManager.h"
import "OOGraphicsResetManager.h"
import "Universe.h"
import "OOMacroOpenGL.h"
import "NSObjectOOExtensions.h"
import "OOCollectionExtractors.h"
+ 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 718 of file OOSkyDrawable.m.

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