Open source remastering of the Freespace 2 engine
starfield.h File Reference
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
#include "graphics/2d.h"
#include "model/model.h"

Go to the source code of this file.


struct  starfield_list_entry
struct  background_t


#define BACKGROUND_MODEL_FILENAME   "spherec.pof"
#define stars_get_num_bitmaps()   stars_get_num_entries(false, false)
#define stars_get_num_suns()   stars_get_num_entries(true, false)
#define stars_mark_sun_unused(x)   stars_mark_instance_unused((x),true)
#define stars_mark_bitmap_unused(x)   stars_mark_instance_unused((x),false)
#define stars_get_sun_name(x)   stars_get_name_from_instance((x),true)
#define stars_get_bitmap_name(x)   stars_get_name_from_instance((x),false)


typedef struct starfield_list_entry starfield_list_entry
typedef struct background_t background_t


void stars_swap_backgrounds (int idx1, int idx2)
void stars_pack_backgrounds ()
bool stars_background_empty ()
int stars_add_sun_entry (starfield_list_entry *sun_ptr)
int stars_add_bitmap_entry (starfield_list_entry *bitmap)
int stars_get_num_entries (bool is_a_sun, bool bitmap_count)
void stars_mark_instance_unused (int index, bool is_a_sun)
const char * stars_get_name_from_instance (int index, bool is_a_sun)
void stars_init ()
void stars_close ()
void stars_pre_level_init (bool clear_backgrounds=true)
void stars_post_level_init ()
void stars_draw_background ()
void stars_draw (int show_stars, int show_suns, int show_nebulas, int show_subspace, int env)
void stars_draw_sun_glow (int sun_n)
void stars_camera_cut ()
void stars_set_background_model (char *model_name, char *texture_name, int flags=DEFAULT_NMODEL_FLAGS)
void stars_set_background_orientation (matrix *orient=NULL)
int stars_find_bitmap (char *name)
int stars_find_sun (char *name)
void stars_get_sun_pos (int sun_n, vec3d *pos)
void stars_preload_sun_bitmap (char *fname)
void stars_preload_background_bitmap (char *fname)
void stars_set_nebula (bool activate)
const char * stars_get_name_FRED (int index, bool is_a_sun)
void stars_delete_entry_FRED (int index, bool is_a_sun)
void stars_modify_entry_FRED (int index, const char *name, starfield_list_entry *sbi_new, bool is_a_sun)
void stars_load_first_valid_background ()
int stars_get_first_valid_background ()
void stars_load_background (int background_idx)


int Num_backgrounds
int Cur_background
background_t Backgrounds [MAX_BACKGROUNDS]
int Nmodel_flags
bool Dynamic_environment
bool Motion_debris_override
const int MAX_STARS
int Num_stars

Macro Definition Documentation

#define BACKGROUND_MODEL_FILENAME   "spherec.pof"

Definition at line 26 of file starfield.h.


Definition at line 20 of file starfield.h.


Definition at line 23 of file starfield.h.


Definition at line 43 of file starfield.h.


Definition at line 22 of file starfield.h.

#define stars_get_bitmap_name (   x)    stars_get_name_from_instance((x),false)

Definition at line 81 of file starfield.h.

#define stars_get_num_bitmaps ( )    stars_get_num_entries(false, false)

Definition at line 68 of file starfield.h.

#define stars_get_num_suns ( )    stars_get_num_entries(true, false)

Definition at line 69 of file starfield.h.

#define stars_get_sun_name (   x)    stars_get_name_from_instance((x),true)

Definition at line 80 of file starfield.h.

#define stars_mark_bitmap_unused (   x)    stars_mark_instance_unused((x),false)

Definition at line 75 of file starfield.h.

#define stars_mark_sun_unused (   x)    stars_mark_instance_unused((x),true)

Definition at line 74 of file starfield.h.

Typedef Documentation

typedef struct background_t background_t

Function Documentation

int stars_add_bitmap_entry ( starfield_list_entry bitmap)

Definition at line 2347 of file starfield.cpp.

int stars_add_sun_entry ( starfield_list_entry sun_ptr)

Definition at line 2256 of file starfield.cpp.

bool stars_background_empty ( )
void stars_camera_cut ( )

Definition at line 1005 of file starfield.cpp.

void stars_close ( )

Definition at line 706 of file starfield.cpp.

void stars_delete_entry_FRED ( int  index,
bool  is_a_sun 

Definition at line 2616 of file starfield.cpp.

void stars_draw ( int  show_stars,
int  show_suns,
int  show_nebulas,
int  show_subspace,
int  env 

Definition at line 1813 of file starfield.cpp.

void stars_draw_background ( )

Definition at line 2153 of file starfield.cpp.

void stars_draw_sun_glow ( int  sun_n)

Definition at line 1154 of file starfield.cpp.

int stars_find_bitmap ( char *  name)

Definition at line 2217 of file starfield.cpp.

int stars_find_sun ( char *  name)

Definition at line 2236 of file starfield.cpp.

int stars_get_first_valid_background ( )

Definition at line 2643 of file starfield.cpp.

const char* stars_get_name_FRED ( int  index,
bool  is_a_sun 

Definition at line 2543 of file starfield.cpp.

const char* stars_get_name_from_instance ( int  index,
bool  is_a_sun 

Definition at line 2495 of file starfield.cpp.

int stars_get_num_entries ( bool  is_a_sun,
bool  bitmap_count 

Definition at line 2407 of file starfield.cpp.

void stars_get_sun_pos ( int  sun_n,
vec3d pos 

Definition at line 1016 of file starfield.cpp.

void stars_init ( )

Definition at line 693 of file starfield.cpp.

void stars_load_background ( int  background_idx)

Definition at line 2690 of file starfield.cpp.

void stars_load_first_valid_background ( )

Definition at line 2636 of file starfield.cpp.

void stars_mark_instance_unused ( int  index,
bool  is_a_sun 

Definition at line 2472 of file starfield.cpp.

void stars_modify_entry_FRED ( int  index,
const char *  name,
starfield_list_entry sbi_new,
bool  is_a_sun 

Definition at line 2563 of file starfield.cpp.

void stars_pack_backgrounds ( )

Definition at line 2750 of file starfield.cpp.

void stars_post_level_init ( )

Definition at line 782 of file starfield.cpp.

void stars_pre_level_init ( bool  clear_backgrounds = true)

Definition at line 714 of file starfield.cpp.

void stars_preload_background_bitmap ( char *  fname)

Definition at line 1889 of file starfield.cpp.

void stars_preload_sun_bitmap ( char *  fname)

Definition at line 1873 of file starfield.cpp.

void stars_set_background_model ( char *  model_name,
char *  texture_name,

Definition at line 2172 of file starfield.cpp.

void stars_set_background_orientation ( matrix orient = NULL)

Definition at line 2207 of file starfield.cpp.

void stars_set_nebula ( bool  activate)

Definition at line 2514 of file starfield.cpp.

void stars_swap_backgrounds ( int  idx1,
int  idx2 

Definition at line 2735 of file starfield.cpp.

Variable Documentation

Definition at line 125 of file starfield.cpp.

int Cur_background

Definition at line 124 of file starfield.cpp.

bool Dynamic_environment

Definition at line 175 of file starfield.cpp.

const int MAX_STARS

Definition at line 47 of file starfield.cpp.

bool Motion_debris_override

Definition at line 176 of file starfield.cpp.

int Nmodel_flags

Definition at line 169 of file starfield.cpp.

int Num_backgrounds

Definition at line 123 of file starfield.cpp.

int Num_stars

Definition at line 58 of file starfield.cpp.