Oolite 1.91.0.7658-250404-b1488af
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
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

◆ 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

◆ SET_COLOR_CRITICAL

#define SET_COLOR_CRITICAL ( d)

◆ SET_COLOR_HIGH

◆ SET_COLOR_LOW

◆ SET_COLOR_MEDIUM

◆ SET_COLOR_SURROUND

◆ 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.

Referenced by HeadUpDisplay(Private)::drawHUDItem:.

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

References x, and y.

Referenced by HeadUpDisplay(Private)::drawScanner:.

+ Here is the caller graph for this function:

◆ DrawSpecialOval()

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

References x, and y.

Referenced by HeadUpDisplay(Private)::drawScanner:.

+ Here is the caller graph for this function:

◆ 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.

Referenced by HeadUpDisplay(Private)::drawASCTarget:, HeadUpDisplay(Private)::drawClock:, HeadUpDisplay(Private)::drawCompass:, HeadUpDisplay(Private)::drawFPSInfoCounter:, HeadUpDisplay::drawPrimedEquipment:, HeadUpDisplay(Private)::drawScanner:, HeadUpDisplay(Private)::drawScannerZoomIndicator:, and HeadUpDisplay(Private)::drawWeaponsOfflineText:.

+ Here is the call graph for this function:
+ Here is the caller 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

References x, and y.

Referenced by HeadUpDisplay(Private)::drawScanner:.

+ Here is the caller graph for this function:

◆ 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

References x, and y.

Referenced by HeadUpDisplay(Private)::drawCustomIndicator:, HeadUpDisplay(Private)::drawPitchBar:, HeadUpDisplay(Private)::drawRollBar:, and HeadUpDisplay(Private)::drawYawBar:.

+ Here is the caller graph for this function:

◆ hudDrawMarkerAt()

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

References x, and y.

Referenced by HeadUpDisplay(Private)::drawFuelBar:.

+ Here is the caller graph for this function:

◆ 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

Referenced by HeadUpDisplay(Private)::drawSecondaryTargetReticle:, and HeadUpDisplay(Private)::drawTargetReticle:.

+ Here is the caller graph for this function:

◆ hudDrawStatusIconAt()

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

References x, and y.

Referenced by HeadUpDisplay(Private)::drawCustomLight:, and HeadUpDisplay(Private)::drawStatusLight:.

+ Here is the caller graph for this function:

◆ hudDrawSurroundAt()

◆ hudDrawWaypoint()

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

Referenced by HeadUpDisplay(Private)::drawWaypoints:.

+ Here is the caller graph for this function:

◆ 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(Private)::drawScanner:, HeadUpDisplay::drawScannerGrid, and HeadUpDisplay::nonlinearScannerScale:Zoom:Scale:.

+ 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, and OOINLINE.

Referenced by HeadUpDisplay(Private)::drawAegis:, HeadUpDisplay(Private)::drawAftShieldBar:, HeadUpDisplay(Private)::drawAltitudeBar:, HeadUpDisplay(Private)::drawASCTarget:, HeadUpDisplay(Private)::drawCabinTempBar:, HeadUpDisplay(Private)::drawClock:, HeadUpDisplay(Private)::drawCompass:, HeadUpDisplay(Private)::drawCustomBar:, HeadUpDisplay(Private)::drawCustomImage:, HeadUpDisplay(Private)::drawCustomIndicator:, HeadUpDisplay(Private)::drawCustomLight:, HeadUpDisplay(Private)::drawCustomText:, HeadUpDisplay(Private)::drawEnergyGauge:, HeadUpDisplay(Private)::drawForwardShieldBar:, HeadUpDisplay(Private)::drawFPSInfoCounter:, HeadUpDisplay(Private)::drawFuelBar:, HeadUpDisplay(Private)::drawLegend:, HeadUpDisplay(Private)::drawMissileDisplay:, HeadUpDisplay(Private)::drawMultiFunctionDisplay:withText:asIndex:, HeadUpDisplay(Private)::drawPitchBar:, HeadUpDisplay::drawPrimedEquipment:, HeadUpDisplay(Private)::drawRollBar:, HeadUpDisplay(Private)::drawScanner:, HeadUpDisplay(Private)::drawScannerZoomIndicator:, HeadUpDisplay(Private)::drawScoopStatus:, HeadUpDisplay(Private)::drawSpeedBar:, HeadUpDisplay(Private)::drawStatusLight:, HeadUpDisplay(Private)::drawStickSensitivityIndicator:, HeadUpDisplay(Private)::drawSurroundInternal:color:, HeadUpDisplay(Private)::drawWeaponsOfflineText:, HeadUpDisplay(Private)::drawWeaponTempBar:, HeadUpDisplay(Private)::drawWitchspaceDestination:, and HeadUpDisplay(Private)::drawYawBar:.

+ Here is the caller graph for this function:

Variable Documentation

◆ _compassUpdated

BOOL _compassUpdated
static

◆ black_color

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

◆ blue_color

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

◆ 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};

Referenced by HeadUpDisplay(Private)::drawScoopStatus:.

◆ green_color

◆ kDefaultMineIconKey

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

Definition at line 2537 of file HeadUpDisplay.m.

Referenced by HeadUpDisplay::IconForMissileRole.

◆ kDefaultMissileIconKey

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

◆ 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

◆ red_color

◆ 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};

Referenced by HeadUpDisplay(Private)::drawAltitudeBar:, and HeadUpDisplay(Private)::drawCabinTempBar:.

◆ sCurrentDrawItem

◆ sEncodingCoverter

◆ sF6KernGovt

float sF6KernGovt
static

◆ sF6KernTL

float sF6KernTL
static

◆ sFontTexture

◆ sGlyphWidths

◆ yellow_color