Files
itgmania212121/stepmania/src/Background.h
T

74 lines
1.8 KiB
C++
Raw Normal View History

2002-06-24 22:20:51 +00:00
#pragma once
/*
-----------------------------------------------------------------------------
2002-06-24 22:20:51 +00:00
Class: Background
2002-06-24 22:20:51 +00:00
Desc: Background behind notes while playing.
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
-----------------------------------------------------------------------------
*/
#include "Sprite.h"
2002-07-11 19:02:26 +00:00
#include "Quad.h"
#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
struct BGSegment // like a BGChange, but holds index of a background instead of name
2002-07-11 19:02:26 +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;
int m_iBGIndex;
2002-07-11 19:02:26 +00:00
};
class Background : public ActorFrame
{
public:
Background();
2002-07-11 19:02:26 +00:00
~Background();
virtual void LoadFromAniDir( CString sAniDir );
2002-08-22 09:31:32 +00:00
virtual void LoadFromSong( Song *pSong );
virtual void Unload();
virtual void Update( float fDeltaTime );
2002-05-19 01:59:48 +00:00
virtual void DrawPrimitives();
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-07-11 19:02:26 +00:00
virtual bool IsInDanger() { return m_bInDanger; };
protected:
2002-06-24 22:20:51 +00:00
bool DangerVisible();
enum BackgroundMode { MODE_STATIC_BG, MODE_ANIMATIONS, MODE_MOVIE_VIS, MODE_RANDOMMOVIES };
BackgroundMode m_BackgroundMode;
2002-09-29 05:06:18 +00:00
BGAnimation m_BGADanger;
2002-07-11 19:02:26 +00:00
// used in all BackgroundModes except OFF
2002-09-29 05:06:18 +00:00
CArray<BGAnimation*,BGAnimation*> m_BGAnimations;
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;
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;
};