Add NoteFieldPositioning. This handles translating from the origin
of a note field to the position of each track. (No new functionality yet.)
This commit is contained in:
@@ -48,7 +48,7 @@ NotesWriterDWI.cpp NotesWriterDWI.h NotesWriterSM.cpp NotesWriterSM.h NoteTypes.
|
||||
PlayerOptions.cpp PlayerOptions.h RandomSample.cpp RandomSample.h Song.cpp song.h SongCacheIndex.cpp SongCacheIndex.h \
|
||||
SongOptions.cpp SongOptions.h StageStats.cpp StageStats.h StyleDef.cpp StyleDef.h StyleInput.h \
|
||||
TitleSubstitution.cpp TitleSubstitution.h Inventory.cpp Inventory.h PlayerNumber.cpp PlayerNumber.h \
|
||||
LyricsLoader.cpp LyricsLoader.h
|
||||
LyricsLoader.cpp LyricsLoader.h NoteFieldPositioning.cpp NoteFieldPositioning.h
|
||||
|
||||
FileTypes = IniFile.cpp IniFile.h MsdFile.cpp MsdFile.h
|
||||
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
#include "global.h"
|
||||
#include "NoteFieldPositioning.h"
|
||||
#include "Actor.h"
|
||||
#include "RageDisplay.h"
|
||||
#include "RageUtil.h"
|
||||
#include "RageMath.h"
|
||||
#include "RageLog.h"
|
||||
|
||||
|
||||
NoteFieldPositioning::NoteFieldPositioning()
|
||||
{
|
||||
/* Note: while Actor class is usually the base class of something that
|
||||
* renders something to screen, all Actor itself does is store location and
|
||||
* effect state and handle tweening between them. These actors do this
|
||||
* without actually rendering anything; we only use them for their render
|
||||
* state. */
|
||||
for( int t=0; t<MAX_NOTE_TRACKS; t++ )
|
||||
{
|
||||
m_Position[t] = new Actor;
|
||||
m_bPerspective[t] = false;
|
||||
m_PerspPosition[t] = new Actor;
|
||||
}
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
NoteFieldPositioning::~NoteFieldPositioning()
|
||||
{
|
||||
for( int t=0; t<MAX_NOTE_TRACKS; t++ )
|
||||
{
|
||||
delete m_Position[t];
|
||||
delete m_PerspPosition[t];
|
||||
}
|
||||
}
|
||||
|
||||
void NoteFieldPositioning::Init()
|
||||
{
|
||||
for( int t=0; t<MAX_NOTE_TRACKS; t++ )
|
||||
{
|
||||
m_Position[t]->Reset();
|
||||
}
|
||||
}
|
||||
/*
|
||||
void NoteFieldPositioning::LoadFromFile(CString fn)
|
||||
{
|
||||
Init();
|
||||
|
||||
}
|
||||
*/
|
||||
void NoteFieldPositioning::LoadFromStyleDef(const StyleDef *s, PlayerNumber pn)
|
||||
{
|
||||
Init();
|
||||
|
||||
for( int t=0; t<MAX_NOTE_TRACKS; t++ )
|
||||
{
|
||||
/* Set up the normal position of each track. */
|
||||
const float fPixelXOffsetFromCenter = s->m_ColumnInfo[pn][t].fXOffset;
|
||||
m_Position[t]->SetX(fPixelXOffsetFromCenter);
|
||||
}
|
||||
}
|
||||
|
||||
void NoteFieldPositioning::Update(float fDeltaTime)
|
||||
{
|
||||
for( int t=0; t<MAX_NOTE_TRACKS; t++ )
|
||||
{
|
||||
m_Position[t]->Update(fDeltaTime);
|
||||
m_PerspPosition[t]->Update(fDeltaTime);
|
||||
}
|
||||
}
|
||||
|
||||
void NoteFieldPositioning::BeginDrawTrack(int tn)
|
||||
{
|
||||
m_Position[tn]->BeginDraw();
|
||||
|
||||
if(m_bPerspective[tn])
|
||||
{
|
||||
DISPLAY->EnterPerspective(45);
|
||||
}
|
||||
|
||||
// m_PerspPosition[tn]->BeginDraw();
|
||||
}
|
||||
|
||||
void NoteFieldPositioning::EndDrawTrack(int tn)
|
||||
{
|
||||
m_PerspPosition[tn]->EndDraw();
|
||||
|
||||
if(m_bPerspective[tn])
|
||||
{
|
||||
DISPLAY->ExitPerspective();
|
||||
}
|
||||
|
||||
// m_Position[tn]->EndDraw();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#ifndef NOTEFIELD_POSITIONING_H
|
||||
#define NOTEFIELD_POSITIONING_H
|
||||
|
||||
#include "NoteTypes.h"
|
||||
#include "PlayerNumber.h"
|
||||
#include "StyleDef.h"
|
||||
#include "PlayerNumber.h"
|
||||
|
||||
class Actor;
|
||||
|
||||
class NoteFieldPositioning
|
||||
{
|
||||
Actor *m_Position[MAX_NOTE_TRACKS];
|
||||
bool m_bPerspective[MAX_NOTE_TRACKS];
|
||||
// float
|
||||
Actor *m_PerspPosition[MAX_NOTE_TRACKS];
|
||||
|
||||
public:
|
||||
NoteFieldPositioning();
|
||||
~NoteFieldPositioning();
|
||||
void Init();
|
||||
void Update(float fDeltaTime);
|
||||
|
||||
void LoadFromFile(CString fn);
|
||||
void LoadFromStyleDef(const StyleDef *s, PlayerNumber pn);
|
||||
|
||||
void BeginDrawTrack(int tn);
|
||||
void EndDrawTrack(int tn);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -553,6 +553,14 @@ SOURCE=.\TitleSubstitution.cpp
|
||||
|
||||
SOURCE=.\TitleSubstitution.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NoteFieldPositioning.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NoteFieldPositioning.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "File Types"
|
||||
|
||||
|
||||
@@ -590,6 +590,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
<File
|
||||
RelativePath="NoteDataWithScoring.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="NoteFieldPositioning.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="NoteFieldPositioning.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="NoteTypes.cpp">
|
||||
</File>
|
||||
|
||||
Reference in New Issue
Block a user