From 1abf916090aa4ce443869cc68546b40c9991636d Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 19 Dec 2001 05:04:20 +0000 Subject: [PATCH] kljhfdkjhfjkhdfkjf --- stepmania/src/HoldGhostArrow.cpp | 61 ++++++++++++++++++++++++++++++++ stepmania/src/HoldGhostArrow.h | 36 +++++++++++++++++++ stepmania/src/Sprite.cpp | 6 +++- stepmania/src/StepMania.h | 24 +++++++++++++ 4 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 stepmania/src/HoldGhostArrow.cpp create mode 100644 stepmania/src/HoldGhostArrow.h create mode 100644 stepmania/src/StepMania.h diff --git a/stepmania/src/HoldGhostArrow.cpp b/stepmania/src/HoldGhostArrow.cpp new file mode 100644 index 0000000000..659a30bb9e --- /dev/null +++ b/stepmania/src/HoldGhostArrow.cpp @@ -0,0 +1,61 @@ +#include "stdafx.h" +// +// HoldGhostArrow.cpp: implementation of the GhostArrow class. +// +////////////////////////////////////////////////////////////////////// + +#include "HoldGhostArrow.h" + + +const CString HOLD_GHOST_ARROW_SPRITE = "Sprites\\Hold Ghost Arrow.sprite"; +const float HOLD_GHOST_ARROW_TWEEN_TIME = 0.5f; + + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +HoldGhostArrow::HoldGhostArrow() +{ + m_bWasSteppedOnLastFrame = false; + m_fHeatLevel = 0; + + LoadFromSpriteFile( HOLD_GHOST_ARROW_SPRITE ); + SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); + SetZoom( 1.1f ); +} + +void HoldGhostArrow::Update( float fDeltaTime ) +{ + Sprite::Update( fDeltaTime ); + + if( m_bWasSteppedOnLastFrame ) + { + m_fHeatLevel += fDeltaTime * 4; + if( m_fHeatLevel >= 1 ) + m_fHeatLevel = 1; + } + else + { + m_fHeatLevel -= fDeltaTime * 4; + if( m_fHeatLevel < 0 ) + m_fHeatLevel = 0; + } + + int iStateNum = min( m_fHeatLevel * GetNumStates(), GetNumStates()-1 ); + SetState( iStateNum ); + + SetDiffuseColor( D3DXCOLOR(1,1,1,m_fHeatLevel*3) ); + + m_bWasSteppedOnLastFrame = false; // reset for next frame +} + +void HoldGhostArrow::SetBeat( const float fSongBeat ) +{ + //SetState( fmod(fSongBeat,1)<0.25 ? 1 : 0 ); +} + +void HoldGhostArrow::Step() +{ + m_bWasSteppedOnLastFrame = true; +} diff --git a/stepmania/src/HoldGhostArrow.h b/stepmania/src/HoldGhostArrow.h new file mode 100644 index 0000000000..0b8548a613 --- /dev/null +++ b/stepmania/src/HoldGhostArrow.h @@ -0,0 +1,36 @@ +/* +----------------------------------------------------------------------------- + File: HoldGhostArrow.h + + Desc: Class used to represent a color arrow on the screen. + + Copyright (c) 2001 Ben Norstrom. All rights reserved. +----------------------------------------------------------------------------- +*/ + + +class HoldGhostArrow; + +#ifndef _HoldGhostArrow_H_ +#define _HoldGhostArrow_H_ + + +#include "Sprite.h" +#include "Steps.h" + + +class HoldGhostArrow : public Sprite +{ +public: + HoldGhostArrow(); + + void Update( float fDeltaTime ); + + void SetBeat( const float fSongBeat ); + void Step(); + + bool m_bWasSteppedOnLastFrame; + float m_fHeatLevel; // effects brightness of electricity - between 0 and 1 +}; + +#endif diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index bb4363cef9..04ad5ad9b8 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -12,6 +12,7 @@ #include "Sprite.h" #include "RageTextureManager.h" +#include "GameInfo.h" #include "IniFile.h" #include #include @@ -43,7 +44,10 @@ void Sprite::Init() m_fVibrationDistance = 5.0f ; m_bVisibleThisFrame = FALSE; - m_bHasShadow = true; + if( GAMEINFO ) + m_bHasShadow = GAMEINFO->m_GameOptions.m_bShadows; + else + m_bHasShadow = true; } Sprite::~Sprite() diff --git a/stepmania/src/StepMania.h b/stepmania/src/StepMania.h new file mode 100644 index 0000000000..8411dbc57f --- /dev/null +++ b/stepmania/src/StepMania.h @@ -0,0 +1,24 @@ +/* +----------------------------------------------------------------------------- + File: StepMania.h + + Desc: + + Copyright (c) 2001 Chris Danford. All rights reserved. +----------------------------------------------------------------------------- +*/ + +#ifndef _STEPMANIA_H_ +#define _STEPMANIA_H_ + + +void Update(); // Update the game logic +void Render(); // Render a frame +void ShowFrame(); // Display the contents of the back buffer to the screen +void SetFullscreen( BOOL bFullscreen ); // Switch between fullscreen and windowed modes. + + + + + +#endif \ No newline at end of file