Skip to content

Commit

Permalink
kill everything related to cabinet lights
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 5, 2017
1 parent 313e011 commit 23ee2c2
Show file tree
Hide file tree
Showing 36 changed files with 2 additions and 2,445 deletions.
27 changes: 0 additions & 27 deletions src/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "ThemeManager.h"
#include "LuaReference.h"
#include "MessageManager.h"
#include "LightsManager.h" // for NUM_CabinetLight
#include "ActorUtil.h"
#include "Preference.h"
#include <typeinfo>
Expand Down Expand Up @@ -41,8 +40,6 @@ vector<float> Actor::g_vfCurrentBGMBeatPlayerNoOffset(NUM_PlayerNumber, 0);

Actor *Actor::Copy() const { return new Actor(*this); }

static float g_fCabinetLights[NUM_CabinetLight];

static const char *HorizAlignNames[] = {
"Left",
"Center",
Expand Down Expand Up @@ -77,12 +74,6 @@ void Actor::SetPlayerBGMBeat( PlayerNumber pn, float fBeat, float fBeatNoOffset
g_vfCurrentBGMBeatPlayerNoOffset[pn] = fBeatNoOffset;
}

void Actor::SetBGMLight( int iLightNumber, float fCabinetLights )
{
ASSERT( iLightNumber < NUM_CabinetLight );
g_fCabinetLights[iLightNumber] = fCabinetLights;
}

void Actor::InitState()
{
this->StopTweening();
Expand Down Expand Up @@ -876,12 +867,6 @@ void Actor::UpdateInternal(float delta_time)
m_fEffectDelta, m_fSecsIntoEffect);
break;
default:
if(m_EffectClock >= CLOCK_LIGHT_1 && m_EffectClock <= CLOCK_LIGHT_LAST)
{
generic_global_timer_update(
g_fCabinetLights[m_EffectClock - CLOCK_LIGHT_1],
m_fEffectDelta, m_fSecsIntoEffect);
}
break;
}

Expand Down Expand Up @@ -1041,18 +1026,6 @@ void Actor::SetEffectClockString( const RString &s )
else if(s.EqualsNoCase("bgm")) this->SetEffectClock( CLOCK_BGM_BEAT ); // compat, deprecated
else if(s.EqualsNoCase("musicnooffset"))this->SetEffectClock( CLOCK_BGM_TIME_NO_OFFSET );
else if(s.EqualsNoCase("beatnooffset")) this->SetEffectClock( CLOCK_BGM_BEAT_NO_OFFSET );
else
{
CabinetLight cl = StringToCabinetLight( s );
if( cl == CabinetLight_Invalid )
{
LuaHelpers::ReportScriptErrorFmt("String '%s' is not an effect clock string or the name of a cabinet light.", s.c_str());
}
else
{
this->SetEffectClock(static_cast<EffectClock>(cl + CLOCK_LIGHT_1));
}
}
}

void Actor::StretchTo( const RectF &r )
Expand Down
1 change: 0 additions & 1 deletion src/GameConstantsAndTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ enum StepsType
StepsType_techno_double8,
StepsType_popn_five,
StepsType_popn_nine,
StepsType_lights_cabinet,
StepsType_kickbox_human,
StepsType_kickbox_quadarm,
StepsType_kickbox_insect,
Expand Down
3 changes: 0 additions & 3 deletions src/GameLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "InputFilter.h"
#include "InputMapper.h"
#include "RageFileManager.h"
#include "LightsManager.h"
#include "NetworkSyncManager.h"
#include "RageTimer.h"
#include "RageInput.h"
Expand Down Expand Up @@ -310,8 +309,6 @@ void GameLoop::RunGameLoop()
SCREENMAN->SystemMessage( sMessage );
}

LIGHTSMAN->Update( fDeltaTime );

// Render
SCREENMAN->Draw();
}
Expand Down
92 changes: 0 additions & 92 deletions src/GameManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "NoteSkinManager.h"
#include "RageInputDevice.h"
#include "ThemeManager.h"
#include "LightsManager.h" // for NUM_CabinetLight
#include "Game.h"
#include "Style.h"
#include "Foreach.h"
Expand Down Expand Up @@ -91,8 +90,6 @@ static const StepsTypeInfo g_StepsTypeInfos[] = {
// pop'n music
{ "pnm-five", 5, true, StepsTypeCategory_Single }, // called "pnm" for backward compat
{ "pnm-nine", 9, true, StepsTypeCategory_Single }, // called "pnm" for backward compat
// cabinet lights and other fine StepsTypes that don't exist lol
{ "lights-cabinet", NUM_CabinetLight, false, StepsTypeCategory_Single }, // XXX disable lights autogen for now
// kickbox mania
{ "kickbox-human", 4, true, StepsTypeCategory_Single },
{ "kickbox-quadarm", 4, true, StepsTypeCategory_Single },
Expand Down Expand Up @@ -2740,94 +2737,6 @@ static const AutoMappings g_AutoKeyMappings_Lights = AutoMappings (
AutoMappingEntry( 0, KEY_Ci, LIGHTS_BUTTON_BASS_RIGHT, false )
);

static const Style g_Style_Lights_Cabinet =
{ // STYLE_LIGHTS_CABINET
true, // m_bUsedForGameplay
true, // m_bUsedForEdit
false, // m_bUsedForDemonstration
false, // m_bUsedForHowToPlay
"cabinet", // m_szName
StepsType_lights_cabinet, // m_StepsType
StyleType_OnePlayerOneSide, // m_StyleType
NUM_CabinetLight, // m_iColsPerPlayer
{ // m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER];
{ // PLAYER_1
{ TRACK_1, -DANCE_COL_SPACING*3.5f, NULL },
{ TRACK_2, -DANCE_COL_SPACING*2.5f, NULL },
{ TRACK_3, -DANCE_COL_SPACING*1.5f, NULL },
{ TRACK_4, -DANCE_COL_SPACING*0.5f, NULL },
{ TRACK_5, +DANCE_COL_SPACING*0.5f, NULL },
{ TRACK_6, +DANCE_COL_SPACING*1.5f, NULL },
{ TRACK_7, +DANCE_COL_SPACING*2.5f, NULL },
{ TRACK_8, +DANCE_COL_SPACING*3.5f, NULL },
},
{ // PLAYER_2
{ TRACK_1, -DANCE_COL_SPACING*3.5f, NULL },
{ TRACK_2, -DANCE_COL_SPACING*2.5f, NULL },
{ TRACK_3, -DANCE_COL_SPACING*1.5f, NULL },
{ TRACK_4, -DANCE_COL_SPACING*0.5f, NULL },
{ TRACK_5, +DANCE_COL_SPACING*0.5f, NULL },
{ TRACK_6, +DANCE_COL_SPACING*1.5f, NULL },
{ TRACK_7, +DANCE_COL_SPACING*2.5f, NULL },
{ TRACK_8, +DANCE_COL_SPACING*3.5f, NULL },
},
},
{ // m_iInputColumn[NUM_GameController][NUM_GameButton]
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, Style::END_MAPPING },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, Style::END_MAPPING },
},
{ // m_iColumnDrawOrder[MAX_COLS_PER_PLAYER];
0,1,2,3,4,5,6,7
},
false, // m_bCanUseBeginnerHelper
false, // m_bLockDifficulties
};

static const Style *g_apGame_Lights_Styles[] =
{
&g_Style_Lights_Cabinet,
NULL
};

static const Game g_Game_Lights =
{
"lights", // m_szName
g_apGame_Lights_Styles, // m_apStyles
false, // m_bCountNotesSeparately
false, // m_bTickHolds
false, // m_PlayersHaveSeparateStyles
{ // m_InputScheme
"lights", // m_szName
NUM_LIGHTS_BUTTONS, // m_iButtonsPerController
{ // m_szButtonNames
{ "MarqueeUpLeft", GAME_BUTTON_LEFT },
{ "MarqueeUpRight", GAME_BUTTON_RIGHT },
{ "MarqueeLrLeft", GAME_BUTTON_UP },
{ "MarqueeLrRight", GAME_BUTTON_DOWN },
{ "ButtonsLeft", GameButton_Invalid },
{ "ButtonsRight", GameButton_Invalid },
{ "BassLeft", GameButton_Invalid },
{ "BassRight", GameButton_Invalid },
},
&g_AutoKeyMappings_Lights
},
{
{ GameButtonType_Step },
{ GameButtonType_Step },
{ GameButtonType_Step },
{ GameButtonType_Step },
{ GameButtonType_Step },
{ GameButtonType_Step },
{ GameButtonType_Step },
{ GameButtonType_Step },
},
TNS_W1, // m_mapW1To
TNS_W2, // m_mapW2To
TNS_W3, // m_mapW3To
TNS_W4, // m_mapW4To
TNS_W5, // m_mapW5To
};

/** Kickbox mania **********************************************************/
static const AutoMappings g_AutoKeyMappings_Kickbox = AutoMappings (
"", "", "",
Expand Down Expand Up @@ -3227,7 +3136,6 @@ static const Game *g_Games[] =
&g_Game_Maniax,
&g_Game_Techno,
&g_Game_Popn,
&g_Game_Lights,
&g_Game_Kickbox,
};

Expand Down
45 changes: 0 additions & 45 deletions src/GameSoundManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "NoteData.h"
#include "Song.h"
#include "Steps.h"
#include "LightsManager.h"
#include "SongUtil.h"
#include "LuaManager.h"

Expand Down Expand Up @@ -54,7 +53,6 @@ struct MusicPlaying
bool m_bApplyMusicRate;
// The timing data that we're currently using.
TimingData m_Timing;
NoteData m_Lights;

/* If m_bTimingDelayed is true, this will be the timing data for the
* song that's starting. We'll copy it to m_Timing once sound is heard. */
Expand Down Expand Up @@ -89,7 +87,6 @@ struct MusicToPlay
RString m_sFile, m_sTimingFile;
bool HasTiming;
TimingData m_TimingData;
NoteData m_LightsData;
bool bForceLoop;
float fStartSecond, fLengthSeconds, fFadeInLengthSeconds, fFadeOutLengthSeconds;
bool bAlignBeat, bApplyMusicRate;
Expand Down Expand Up @@ -137,7 +134,6 @@ static void StartMusic( MusicToPlay &ToPlay )
}

NewMusic->m_Timing = g_Playing->m_Timing;
NewMusic->m_Lights = g_Playing->m_Lights;

/* See if we can find timing data, if it's not already loaded. */
if( !ToPlay.HasTiming && IsAFile(ToPlay.m_sTimingFile) )
Expand All @@ -151,27 +147,18 @@ static void StartMusic( MusicToPlay &ToPlay )
{
ToPlay.HasTiming = true;
ToPlay.m_TimingData = song.m_SongTiming;
// get cabinet lights if any
Steps *pStepsCabinetLights = SongUtil::GetOneSteps( &song, StepsType_lights_cabinet );
if( pStepsCabinetLights )
pStepsCabinetLights->GetNoteData( ToPlay.m_LightsData , false);
}
else if(GetExtension(ToPlay.m_sTimingFile) == ".sm" &&
loaderSM.LoadFromSimfile(ToPlay.m_sTimingFile, song) )
{
ToPlay.HasTiming = true;
ToPlay.m_TimingData = song.m_SongTiming;
// get cabinet lights if any
Steps *pStepsCabinetLights = SongUtil::GetOneSteps( &song, StepsType_lights_cabinet );
if( pStepsCabinetLights )
pStepsCabinetLights->GetNoteData( ToPlay.m_LightsData , false);
}
}

if( ToPlay.HasTiming )
{
NewMusic->m_NewTiming = ToPlay.m_TimingData;
NewMusic->m_Lights = ToPlay.m_LightsData;
}

if( ToPlay.bAlignBeat && ToPlay.HasTiming && ToPlay.bForceLoop && ToPlay.fLengthSeconds != -1 )
Expand Down Expand Up @@ -627,38 +614,6 @@ void GameSoundManager::Update( float fDeltaTime )

iBeatLastCrossed = iBeatNow;
}

// Update lights
NoteData &lights = g_Playing->m_Lights;
if( lights.GetNumTracks() > 0 ) // lights data was loaded
{
const float fSongBeat = GAMESTATE->m_Position.m_fLightSongBeat;
const int iSongRow = BeatToNoteRow( fSongBeat );

static int iRowLastCrossed = 0;

FOREACH_CabinetLight( cl )
{
// Are we "holding" the light?
if( lights.IsHoldNoteAtRow( cl, iSongRow ) )
{
LIGHTSMAN->BlinkCabinetLight( cl );
continue;
}

// Otherwise, for each index we crossed since the last update:
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( lights, cl, r, iRowLastCrossed+1, iSongRow+1 )
{
if( lights.GetTapNote( cl, r ).type != TapNoteType_Empty )
{
LIGHTSMAN->BlinkCabinetLight( cl );
break;
}
}
}

iRowLastCrossed = iSongRow;
}
}


Expand Down
3 changes: 0 additions & 3 deletions src/GameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "GameManager.h"
#include "GamePreferences.h"
#include "HighScore.h"
#include "LightsManager.h"
#include "LuaReference.h"
#include "MessageManager.h"
#include "MemoryCardManager.h"
Expand Down Expand Up @@ -341,8 +340,6 @@ void GameState::Reset()

m_bTemporaryEventMode = false;

LIGHTSMAN->SetLightsMode( LIGHTSMODE_ATTRACT );

m_stEdit.Set( StepsType_Invalid );
m_pEditSourceSteps.Set( NULL );
m_stEditSource.Set( StepsType_Invalid );
Expand Down
Loading

0 comments on commit 23ee2c2

Please sign in to comment.