/*
 * Bg.h - Background stuffage
 * By: Odis
 */
#ifndef INC_BG
#define INC_BG

#define MAX_STARS 100

typedef struct bg_data BG;
typedef struct starry_data STARRY_DATA;

struct bg_data
{
  BMP *bitmap;
  COLORREF color;
  int width;
  int height;
  int type;
  
  /* stretching */
  bool stretch;
  bool simmune; /* immune to stretching? */

  union
  {
    STARRY_DATA *starry;
  } dynamic;
};

struct starry_data
{
  int stars;
  int delay;
  POINT pstars[MAX_STARS];
  COLORREF star_colors[MAX_STARS];
};

typedef enum
{
 IMAGE, COLOR, STARRY
} bg_types;

/* functions */
void bg_clean( BG *bg );
BG *bg_from_bitmap( BMP *bmp );
BG *bg_from_init( int width, int height, COLORREF color );
void init_starry( BG *bg, int stars, int delay );

#endif