ScummVM API documentation
Ultima::Ultima1::Data::SpaceStarfield Struct Reference

#include <space_map.h>

Public Member Functions

void reset ()
 
void reseed (uint32 seed)
 
void advance ()
 

Static Public Member Functions

static bool withinView (int x, int y)
 

Public Attributes

int16 _centerX = 0x9f
 
int16 _centerY = 0x4f
 
int16 _panX = 0
 
int16 _panY = 0
 
int16 _starX [SPACE_STAR_COUNT] = {}
 
int16 _starY [SPACE_STAR_COUNT] = {}
 
int16 _prevX [SPACE_STAR_COUNT] = {}
 
int16 _prevY [SPACE_STAR_COUNT] = {}
 
bool _visible [SPACE_STAR_COUNT] = {}
 

Detailed Description

The panning warp starfield drawn in the first-person cockpit view - SPACE.EXE's setupStars / advanceStarfield. Purely visual (not saved)

Member Function Documentation

◆ reset()

void Ultima::Ultima1::Data::SpaceStarfield::reset ( )

Fresh random stars, centre and pan back to their defaults (setupStars)

◆ reseed()

void Ultima::Ultima1::Data::SpaceStarfield::reseed ( uint32  seed)

Replaces every star with new ones rolled from a seed. The same seed always gives the same stars, and the same ones replacing them as they leave the view, so a run of advance() calls can be replayed exactly

◆ advance()

void Ultima::Ultima1::Data::SpaceStarfield::advance ( )

One frame: every star drifts further from the centre (respawning at an edge once it leaves the viewport), then the centre pans by the current pan velocity, which is zeroed on hitting a viewport edge (advanceStarfield, normal-cruise path)

◆ withinView()

static bool Ultima::Ultima1::Data::SpaceStarfield::withinView ( int  x,
int  y 
)
inlinestatic

True if a screen point is inside the cockpit viewport (starWithinView)


The documentation for this struct was generated from the following file: