2002-06-24 22:20:51 +00:00
|
|
|
#pragma once
|
2002-01-20 09:13:43 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
2002-06-24 22:20:51 +00:00
|
|
|
Class: Background
|
2002-01-20 09:13:43 +00:00
|
|
|
|
2002-06-24 22:20:51 +00:00
|
|
|
Desc: Background behind notes while playing.
|
2002-01-20 09:13:43 +00:00
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-06-24 22:20:51 +00:00
|
|
|
Ben Nordstrom
|
|
|
|
|
Chris Danford
|
2002-01-20 09:13:43 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "Sprite.h"
|
2002-07-11 19:02:26 +00:00
|
|
|
#include "Quad.h"
|
2002-01-20 09:13:43 +00:00
|
|
|
#include "ActorFrame.h"
|
|
|
|
|
#include "Song.h"
|
2002-09-29 05:06:18 +00:00
|
|
|
#include "BGAnimation.h"
|
2002-06-24 22:20:51 +00:00
|
|
|
|
2002-01-20 09:13:43 +00:00
|
|
|
|
2002-08-23 20:18:29 +00:00
|
|
|
struct BGSegment // like a BGChange, but holds index of a background instead of name
|
2002-07-11 19:02:26 +00:00
|
|
|
{
|
2002-08-23 20:18:29 +00:00
|
|
|
BGSegment() {};
|
|
|
|
|
BGSegment( float b, int i ) { m_fStartBeat = b; m_iBGIndex = i; };
|
2002-07-11 19:02:26 +00:00
|
|
|
float m_fStartBeat;
|
2002-08-23 20:18:29 +00:00
|
|
|
int m_iBGIndex;
|
2002-07-11 19:02:26 +00:00
|
|
|
};
|
|
|
|
|
|
2002-01-20 09:13:43 +00:00
|
|
|
|
|
|
|
|
class Background : public ActorFrame
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
Background();
|
2002-07-11 19:02:26 +00:00
|
|
|
~Background();
|
|
|
|
|
|
2002-09-24 02:55:32 +00:00
|
|
|
virtual void LoadFromAniDir( CString sAniDir );
|
2002-08-22 09:31:32 +00:00
|
|
|
virtual void LoadFromSong( Song *pSong );
|
2002-09-24 02:55:32 +00:00
|
|
|
virtual void Unload();
|
2002-01-20 09:13:43 +00:00
|
|
|
|
|
|
|
|
virtual void Update( float fDeltaTime );
|
2002-05-19 01:59:48 +00:00
|
|
|
virtual void DrawPrimitives();
|
2002-01-20 09:13:43 +00:00
|
|
|
|
2002-07-11 19:02:26 +00:00
|
|
|
void FadeIn();
|
|
|
|
|
void FadeOut();
|
2002-01-20 23:29:03 +00:00
|
|
|
|
2002-07-11 19:02:26 +00:00
|
|
|
virtual void TurnDangerOn() { m_bInDanger = true; };
|
|
|
|
|
virtual void TurnDangerOff() { m_bInDanger = false; };
|
2002-01-20 09:13:43 +00:00
|
|
|
|
2002-07-11 19:02:26 +00:00
|
|
|
virtual bool IsInDanger() { return m_bInDanger; };
|
2002-01-24 08:01:24 +00:00
|
|
|
|
2002-01-20 09:13:43 +00:00
|
|
|
protected:
|
2002-06-24 22:20:51 +00:00
|
|
|
bool DangerVisible();
|
|
|
|
|
|
2002-10-06 20:17:38 +00:00
|
|
|
enum BackgroundMode { MODE_STATIC_BG, MODE_ANIMATIONS, MODE_MOVIE_VIS, MODE_RANDOMMOVIES };
|
2002-09-04 08:09:57 +00:00
|
|
|
BackgroundMode m_BackgroundMode;
|
2002-08-18 16:19:26 +00:00
|
|
|
|
2002-09-29 05:06:18 +00:00
|
|
|
BGAnimation m_BGADanger;
|
2002-07-11 19:02:26 +00:00
|
|
|
|
2002-08-18 16:19:26 +00:00
|
|
|
// used in all BackgroundModes except OFF
|
2002-09-29 05:06:18 +00:00
|
|
|
CArray<BGAnimation*,BGAnimation*> m_BGAnimations;
|
2002-08-23 20:18:29 +00:00
|
|
|
CArray<BGSegment,BGSegment&> m_aBGSegments;
|
|
|
|
|
int m_iCurBGSegment; // this increases as we move into new segments
|
2002-09-29 05:06:18 +00:00
|
|
|
BGAnimation* GetCurBGA() { int index = m_aBGSegments[m_iCurBGSegment].m_iBGIndex; return m_BGAnimations[index]; };
|
2002-07-11 19:02:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
Quad m_quadBGBrightness;
|
2002-08-18 16:19:26 +00:00
|
|
|
Quad m_quadBorder[4]; // l, t, r, b - cover up the edge of animations that might hang outside of the background rectangle
|
2002-07-11 19:02:26 +00:00
|
|
|
|
|
|
|
|
bool m_bInDanger;
|
2002-01-20 09:13:43 +00:00
|
|
|
};
|
|
|
|
|
|