Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
HeadUpDisplay.m File Reference
+ Include dependency graph for HeadUpDisplay.m:

Go to the source code of this file.

Classes

struct  CachedInfo
 
category  HeadUpDisplay(Private)
 

Macros

#define ONE_SIXTEENTH   0.0625
 
#define ONE_SIXTYFOURTH   0.015625
 
#define DEFAULT_OVERALL_ALPHA   0.75
 
#define GLYPH_SCALE_FACTOR   0.13
 
#define IDENTIFY_SCANNER_LOLLIPOPS   ( 0 && OOLITE_DEBUG)
 
#define NOT_DEFINED   INFINITY
 
#define WIDGET_INFO   0
 
#define WIDGET_CACHE   1
 
#define WIDGET_SELECTOR   2
 
#define WIDGET_SELECTOR_NAME   3
 
#define DO_SET_COLOR(t, d)
 
#define SET_COLOR(d)
 
#define SET_COLOR_LOW(d)
 
#define SET_COLOR_MEDIUM(d)
 
#define SET_COLOR_HIGH(d)
 
#define SET_COLOR_CRITICAL(d)
 
#define SET_COLOR_SURROUND(d)
 

Enumerations

enum  { kFontTextureOptions = kOOTextureMinFilterMipMap | kOOTextureMagFilterLinear | kOOTextureNoShrink | kOOTextureAlphaMask }
 

Functions

OOINLINE float useDefined (float val, float validVal)
 
static void DrawSpecialOval (GLfloat x, GLfloat y, GLfloat z, NSSize siz, GLfloat step, GLfloat *color4v)
 
static void SetGLColourFromInfo (NSDictionary *info, NSString *key, const GLfloat defaultColor[4], GLfloat alpha)
 
static void GetRGBAArrayFromInfo (NSDictionary *info, GLfloat ioColor[4])
 
static void hudDrawIndicatorAt (GLfloat x, GLfloat y, GLfloat z, NSSize siz, GLfloat amount)
 
static void hudDrawMarkerAt (GLfloat x, GLfloat y, GLfloat z, NSSize siz, GLfloat amount)
 
static void hudDrawBarAt (GLfloat x, GLfloat y, GLfloat z, NSSize siz, GLfloat amount)
 
static void hudDrawSurroundAt (GLfloat x, GLfloat y, GLfloat z, NSSize siz)
 
static void hudDrawStatusIconAt (int x, int y, int z, NSSize siz)
 
static void hudDrawReticleOnTarget (Entity *target, PlayerEntity *player1, GLfloat z1, GLfloat alpha, BOOL reticleTargetSensitive, NSMutableDictionary *propertiesReticleTargetSensitive, BOOL colourFromScannerColour, BOOL showText, NSDictionary *info, NSMutableArray *reticleColors)
 
static void hudDrawWaypoint (OOWaypointEntity *waypoint, PlayerEntity *player1, GLfloat z1, GLfloat alpha, BOOL selected, GLfloat scale)
 
static void hudRotateViewpointForVirtualDepth (PlayerEntity *player1, Vector p1)
 
static void drawScannerGrid (GLfloat x, GLfloat y, GLfloat z, NSSize siz, int v_dir, GLfloat thickness, GLfloat zoom, BOOL nonlinear, BOOL minimalistic)
 
static GLfloat nonlinearScannerFunc (GLfloat distance, GLfloat zoom, GLfloat scale)
 
static void GLDrawNonlinearCascadeWeapon (GLfloat x, GLfloat y, GLfloat z, NSSize siz, Vector centre, GLfloat radius, GLfloat zoom, GLfloat alpha)
 

Variables

static NSArray * sCurrentDrawItem
 
static OOTexturesFontTexture = nil
 
static OOEncodingConvertersEncodingCoverter = nil
 
static const GLfloat red_color [4] = {1.0, 0.0, 0.0, 1.0}
 
static const GLfloat redplus_color [4] = {1.0, 0.0, 0.5, 1.0}
 
static const GLfloat yellow_color [4] = {1.0, 1.0, 0.0, 1.0}
 
static const GLfloat green_color [4] = {0.0, 1.0, 0.0, 1.0}
 
static const GLfloat darkgreen_color [4] = {0.0, 0.75, 0.0, 1.0}
 
static const GLfloat blue_color [4] = {0.0, 0.0, 1.0, 1.0}
 
static const GLfloat black_color [4] = {0.0, 0.0, 0.0, 1.0}
 
static const GLfloat lightgray_color [4] = {0.25, 0.25, 0.25, 1.0}
 
static float sGlyphWidths [256]
 
static float sF6KernGovt
 
static float sF6KernTL
 
static BOOL _compassUpdated
 
static NSString *const kDefaultMissileIconKey = @"oolite-default-missile-icon"
 
static NSString *const kDefaultMineIconKey = @"oolite-default-mine-icon"
 
static const GLfloat kOutlineWidth = 0.5f
 

Macro Definition Documentation

◆ DEFAULT_OVERALL_ALPHA

#define DEFAULT_OVERALL_ALPHA   0.75

Definition at line 55 of file HeadUpDisplay.m.

◆ DO_SET_COLOR

#define DO_SET_COLOR ( t,
d )
Value:
SetGLColourFromInfo(info,t,d,alpha)
static void SetGLColourFromInfo(NSDictionary *info, NSString *key, const GLfloat defaultColor[4], GLfloat alpha)

Definition at line 67 of file HeadUpDisplay.m.

◆ GLYPH_SCALE_FACTOR

#define GLYPH_SCALE_FACTOR   0.13

◆ IDENTIFY_SCANNER_LOLLIPOPS

#define IDENTIFY_SCANNER_LOLLIPOPS   ( 0 && OOLITE_DEBUG)

Definition at line 57 of file HeadUpDisplay.m.

◆ NOT_DEFINED

#define NOT_DEFINED   INFINITY

Definition at line 60 of file HeadUpDisplay.m.

Referenced by useDefined().

◆ ONE_SIXTEENTH

#define ONE_SIXTEENTH   0.0625

Definition at line 53 of file HeadUpDisplay.m.

Referenced by HeadUpDisplay::drawCharacterQuad.

◆ ONE_SIXTYFOURTH

#define ONE_SIXTYFOURTH   0.015625

Definition at line 54 of file HeadUpDisplay.m.

◆ SET_COLOR

#define SET_COLOR ( d)
Value:
#define COLOR_KEY
#define DO_SET_COLOR(t, d)

Definition at line 68 of file HeadUpDisplay.m.

◆ SET_COLOR_CRITICAL

#define SET_COLOR_CRITICAL ( d)
Value:

Definition at line 72 of file HeadUpDisplay.m.

◆ SET_COLOR_HIGH

#define SET_COLOR_HIGH ( d)
Value:

Definition at line 71 of file HeadUpDisplay.m.

◆ SET_COLOR_LOW

#define SET_COLOR_LOW ( d)
Value:
#define COLOR_KEY_LOW

Definition at line 69 of file HeadUpDisplay.m.

◆ SET_COLOR_MEDIUM

#define SET_COLOR_MEDIUM ( d)
Value:

Definition at line 70 of file HeadUpDisplay.m.

◆ SET_COLOR_SURROUND

#define SET_COLOR_SURROUND ( d)
Value:

Definition at line 73 of file HeadUpDisplay.m.

◆ WIDGET_CACHE

#define WIDGET_CACHE   1

Definition at line 62 of file HeadUpDisplay.m.

◆ WIDGET_INFO

#define WIDGET_INFO   0

Definition at line 61 of file HeadUpDisplay.m.

◆ WIDGET_SELECTOR

#define WIDGET_SELECTOR   2

Definition at line 63 of file HeadUpDisplay.m.

◆ WIDGET_SELECTOR_NAME

#define WIDGET_SELECTOR_NAME   3

Definition at line 64 of file HeadUpDisplay.m.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kFontTextureOptions 

Definition at line 112 of file HeadUpDisplay.m.

113{
115};
@ kFontTextureOptions
@ kOOTextureNoShrink
Definition OOTexture.h:53
@ kOOTextureMinFilterMipMap
Definition OOTexture.h:48
@ kOOTextureAlphaMask
Definition OOTexture.h:60
@ kOOTextureMagFilterLinear
Definition OOTexture.h:51

Function Documentation

◆ drawScannerGrid()

static void drawScannerGrid ( GLfloat x,
GLfloat y,
GLfloat z,
NSSize siz,
int v_dir,
GLfloat thickness,
GLfloat zoom,
BOOL nonlinear,
BOOL minimalistic )
static

◆ DrawSpecialOval()

static void DrawSpecialOval ( GLfloat x,
GLfloat y,
GLfloat z,
NSSize siz,
GLfloat step,
GLfloat * color4v )
static

◆ GetRGBAArrayFromInfo()

static void GetRGBAArrayFromInfo ( NSDictionary * info,
GLfloat ioColor[4] )
static

Definition at line 4495 of file HeadUpDisplay.m.

4496{
4497 id colorDesc = nil;
4498 OOColor *color = nil;
4499
4500 // First, look for general colour specifier.
4501 colorDesc = [info objectForKey:RGB_COLOR_KEY];
4502 if (colorDesc != nil && ![info objectForKey:ALPHA_KEY])
4503 {
4504 color = [OOColor colorWithDescription:colorDesc];
4505 if (color != nil)
4506 {
4507 [color getRed:&ioColor[0] green:&ioColor[1] blue:&ioColor[2] alpha:&ioColor[3]];
4508 return;
4509 }
4510 }
4511
4512 // Failing that, look for rgb_color and alpha.
4513 colorDesc = [info oo_arrayForKey:RGB_COLOR_KEY];
4514 if (colorDesc != nil && [colorDesc count] == 3)
4515 {
4516 ioColor[0] = [colorDesc oo_nonNegativeFloatAtIndex:0];
4517 ioColor[1] = [colorDesc oo_nonNegativeFloatAtIndex:1];
4518 ioColor[2] = [colorDesc oo_nonNegativeFloatAtIndex:2];
4519 }
4520 ioColor[3] = [info oo_nonNegativeFloatForKey:ALPHA_KEY defaultValue:ioColor[3]];
4521}
#define ALPHA_KEY
unsigned count
return nil
OOColor * colorWithDescription:(id description)
Definition OOColor.m:127
void getRed:green:blue:alpha:(float *red,[green] float *green,[blue] float *blue,[alpha] float *alpha)
Definition OOColor.m:368

References ALPHA_KEY, OOColor::colorWithDescription:, count, OOColor::getRed:green:blue:alpha:, and nil.

+ Here is the call graph for this function:

◆ GLDrawNonlinearCascadeWeapon()

static void GLDrawNonlinearCascadeWeapon ( GLfloat x,
GLfloat y,
GLfloat z,
NSSize siz,
Vector centre,
GLfloat radius,
GLfloat zoom,
GLfloat alpha )
static

◆ hudDrawBarAt()

static void hudDrawBarAt ( GLfloat x,
GLfloat y,
GLfloat z,
NSSize siz,
GLfloat amount )
static

◆ hudDrawIndicatorAt()

static void hudDrawIndicatorAt ( GLfloat x,
GLfloat y,
GLfloat z,
NSSize siz,
GLfloat amount )
static

◆ hudDrawMarkerAt()

static void hudDrawMarkerAt ( GLfloat x,
GLfloat y,
GLfloat z,
NSSize siz,
GLfloat amount )
static

◆ hudDrawReticleOnTarget()

static void hudDrawReticleOnTarget ( Entity * target,
PlayerEntity * player1,
GLfloat z1,
GLfloat alpha,
BOOL reticleTargetSensitive,
NSMutableDictionary * propertiesReticleTargetSensitive,
BOOL colourFromScannerColour,
BOOL showText,
NSDictionary * info,
NSMutableArray * reticleColors )
static

◆ hudDrawStatusIconAt()

static void hudDrawStatusIconAt ( int x,
int y,
int z,
NSSize siz )
static

◆ hudDrawSurroundAt()

static void hudDrawSurroundAt ( GLfloat x,
GLfloat y,
GLfloat z,
NSSize siz )
static

◆ hudDrawWaypoint()

static void hudDrawWaypoint ( OOWaypointEntity * waypoint,
PlayerEntity * player1,
GLfloat z1,
GLfloat alpha,
BOOL selected,
GLfloat scale )
static

◆ hudRotateViewpointForVirtualDepth()

static void hudRotateViewpointForVirtualDepth ( PlayerEntity * player1,
Vector p1 )
static

Referenced by HeadUpDisplay::hudDrawReticleOnTarget, and HeadUpDisplay::hudDrawWaypoint.

+ Here is the caller graph for this function:

◆ nonlinearScannerFunc()

static GLfloat nonlinearScannerFunc ( GLfloat distance,
GLfloat zoom,
GLfloat scale )
static

Referenced by HeadUpDisplay::drawScannerGrid.

+ Here is the caller graph for this function:

◆ SetGLColourFromInfo()

static void SetGLColourFromInfo ( NSDictionary * info,
NSString * key,
const GLfloat defaultColor[4],
GLfloat alpha )
static

Definition at line 4475 of file HeadUpDisplay.m.

4476{
4477 id colorDesc = nil;
4478 OOColor *color = nil;
4479 colorDesc = [info objectForKey:key];
4480 if (colorDesc != nil)
4481 {
4482 color = [OOColor colorWithDescription:colorDesc];
4483 if (color != nil)
4484 {
4485 GLfloat ioColor[4];
4486 [color getRed:&ioColor[0] green:&ioColor[1] blue:&ioColor[2] alpha:&ioColor[3]];
4487 GLColorWithOverallAlpha(ioColor,alpha);
4488 return;
4489 }
4490 }
4491 GLColorWithOverallAlpha(defaultColor,alpha);
4492}

References OOColor::colorWithDescription:, OOColor::getRed:green:blue:alpha:, and nil.

+ Here is the call graph for this function:

◆ useDefined()

OOINLINE float useDefined ( float val,
float validVal )

Definition at line 83 of file HeadUpDisplay.m.

84{
85 return (val == NOT_DEFINED) ? validVal : val;
86}
#define NOT_DEFINED

References NOT_DEFINED.

Variable Documentation

◆ _compassUpdated

BOOL _compassUpdated
static

Definition at line 204 of file HeadUpDisplay.m.

◆ black_color

const GLfloat black_color[4] = {0.0, 0.0, 0.0, 1.0}
static

Definition at line 198 of file HeadUpDisplay.m.

198{0.0, 0.0, 0.0, 1.0};

◆ blue_color

const GLfloat blue_color[4] = {0.0, 0.0, 1.0, 1.0}
static

Definition at line 197 of file HeadUpDisplay.m.

197{0.0, 0.0, 1.0, 1.0};

Referenced by HeadUpDisplay::hudDrawWaypoint.

◆ darkgreen_color

const GLfloat darkgreen_color[4] = {0.0, 0.75, 0.0, 1.0}
static

Definition at line 196 of file HeadUpDisplay.m.

196{0.0, 0.75, 0.0, 1.0};

◆ green_color

const GLfloat green_color[4] = {0.0, 1.0, 0.0, 1.0}
static

Definition at line 195 of file HeadUpDisplay.m.

195{0.0, 1.0, 0.0, 1.0};

Referenced by HeadUpDisplay::hudDrawReticleOnTarget.

◆ kDefaultMineIconKey

NSString* const kDefaultMineIconKey = @"oolite-default-mine-icon"
static

Definition at line 2537 of file HeadUpDisplay.m.

Referenced by HeadUpDisplay(Private)::drawASCTarget:.

◆ kDefaultMissileIconKey

NSString* const kDefaultMissileIconKey = @"oolite-default-missile-icon"
static

Definition at line 2536 of file HeadUpDisplay.m.

Referenced by HeadUpDisplay(Private)::drawASCTarget:.

◆ kOutlineWidth

const GLfloat kOutlineWidth = 0.5f
static

Definition at line 2538 of file HeadUpDisplay.m.

◆ lightgray_color

const GLfloat lightgray_color[4] = {0.25, 0.25, 0.25, 1.0}
static

Definition at line 199 of file HeadUpDisplay.m.

199{0.25, 0.25, 0.25, 1.0};

◆ red_color

const GLfloat red_color[4] = {1.0, 0.0, 0.0, 1.0}
static

Definition at line 192 of file HeadUpDisplay.m.

192{1.0, 0.0, 0.0, 1.0};

◆ redplus_color

const GLfloat redplus_color[4] = {1.0, 0.0, 0.5, 1.0}
static

Definition at line 193 of file HeadUpDisplay.m.

193{1.0, 0.0, 0.5, 1.0};

◆ sCurrentDrawItem

NSArray* sCurrentDrawItem
static

Definition at line 81 of file HeadUpDisplay.m.

◆ sEncodingCoverter

OOEncodingConverter* sEncodingCoverter = nil
static

◆ sF6KernGovt

float sF6KernGovt
static

◆ sF6KernTL

float sF6KernTL
static

◆ sFontTexture

OOTexture* sFontTexture = nil
static

◆ sGlyphWidths

◆ yellow_color

const GLfloat yellow_color[4] = {1.0, 1.0, 0.0, 1.0}
static

Definition at line 194 of file HeadUpDisplay.m.

194{1.0, 1.0, 0.0, 1.0};