2002-11-16 08:07:38 +00:00
|
|
|
#ifndef BACKGROUND_H
|
|
|
|
|
#define BACKGROUND_H
|
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"
|
2002-09-29 05:06:18 +00:00
|
|
|
#include "BGAnimation.h"
|
2003-03-17 03:43:45 +00:00
|
|
|
#include "song.h"
|
2003-06-27 08:06:22 +00:00
|
|
|
class DancingCharacters;
|
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:
|
2003-03-16 00:05:23 +00:00
|
|
|
bool IsDangerVisible();
|
2003-09-23 19:26:36 +00:00
|
|
|
void UpdateCurBGChange();
|
2002-08-18 16:19:26 +00:00
|
|
|
|
2003-06-27 08:06:22 +00:00
|
|
|
DancingCharacters* m_pDancingCharacters;
|
2003-05-05 04:43:11 +00:00
|
|
|
|
2002-09-29 05:06:18 +00:00
|
|
|
BGAnimation m_BGADanger;
|
2002-07-11 19:02:26 +00:00
|
|
|
|
2003-03-16 00:05:23 +00:00
|
|
|
BGAnimation* CreateSongBGA(const Song *pSong, CString sBGName) const;
|
|
|
|
|
BGAnimation* CreateRandomBGA() const;
|
|
|
|
|
|
|
|
|
|
map<CString,BGAnimation*> m_BGAnimations;
|
|
|
|
|
vector<BackgroundChange> m_aBGChanges;
|
2003-04-14 04:10:01 +00:00
|
|
|
int m_iCurBGChangeIndex;
|
2003-04-13 00:44:50 +00:00
|
|
|
BGAnimation* m_pCurrentBGA;
|
2002-10-10 04:11:30 +00:00
|
|
|
BGAnimation* m_pFadingBGA;
|
|
|
|
|
float m_fSecsLeftInFade;
|
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
|
|
|
};
|
|
|
|
|
|
2002-11-16 08:07:38 +00:00
|
|
|
|
|
|
|
|
#endif
|