diff --git a/stepmania/src/LRCFile.cpp b/stepmania/src/LRCFile.cpp deleted file mode 100644 index 02831ec77f..0000000000 --- a/stepmania/src/LRCFile.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "global.h" -/* ------------------------------------------------------------------------------ - Class: LRCFile - - Desc: See header. - - Copyright (c) 2001-2003 by the person(s) listed below. All rights reserved. - Chris Danford - Glenn Maynard - Kevin Slaughter ------------------------------------------------------------------------------ -*/ - -#include "LRCFile.h" -#include "RageLog.h" -#include -#if defined(WIN32) -#include -#endif -#include -#include "RageUtil.h" -#include "Regex.h" - -void LRCFile::AddParam( const CString &buf ) -{ - values.back().params.push_back(buf); -} - -void LRCFile::AddValue() /* (no extra charge) */ -{ - values.push_back(value_t()); -} - -void LRCFile::ReadBuf( char *buf, int len ) -{ - stringstream input(CString(buf, len)); - string line; - - while(getline(input, line)) - { - if(!line.compare(0, 2, "//")) - continue; - - /* "[data1] data2". Ignore whitespace at the beginning of the line. */ - static Regex x("^ *\\[([^]]+)\\] *(.*)$"); - - vector matches; - if(!x.Compare(line, matches)) - continue; - - StripCrnl(matches[1]); - - AddValue(); - AddParam(matches[0]); - AddParam(matches[1]); - } -} - -// returns true if successful, false otherwise -bool LRCFile::ReadFile( CString sNewPath ) -{ - int fd; - - /* Open a file */ - if( (fd = open(sNewPath, O_RDONLY, 0)) == -1 ) - return false; - - int iBufferSize = GetFileSizeInBytes(sNewPath) + 1000; // +1000 because sometimes the bytes read is > filelength. Why? - - // allocate a string to hold the file - char* szFileString = new char[iBufferSize]; - - int iBytesRead = read( fd, szFileString, iBufferSize ); - close( fd ); - - ASSERT( iBufferSize > iBytesRead ); - szFileString[iBytesRead] = '\0'; - - ReadBuf(szFileString, iBytesRead); - - delete [] szFileString; - - return true; -} - -CString LRCFile::GetParam(unsigned val, unsigned par) const -{ - if(val >= GetNumValues()) return ""; - if(par >= GetNumParams(val)) return ""; - - return values[val].params[par]; -} diff --git a/stepmania/src/LRCFile.h b/stepmania/src/LRCFile.h deleted file mode 100644 index c54dda819c..0000000000 --- a/stepmania/src/LRCFile.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef LRCFILE_H -#define LRCFILE_H -/* ------------------------------------------------------------------------------ - Class: LRCFile - - Desc: Wrapper for reading an LRC Lyrics file. - - Copyright (c) 2001-2003 by the person(s) listed below. All rights reserved. - Chris Danford - Glenn Maynard - Kevin Slaughter ------------------------------------------------------------------------------ -*/ - - -class LRCFile -{ -public: - /* #param:param:param:param; <- one whole value */ - struct value_t - { - vector params; - - CString operator[](unsigned i) const { if(i >= params.size()) return ""; return params[i]; } - }; - - virtual ~LRCFile() { } - - //returns true if successful, false otherwise - bool ReadFile( CString sFilePath ); - - unsigned GetNumValues() const { return values.size(); } - unsigned GetNumParams(unsigned val) const { if(val >= GetNumValues()) return 0; return values[val].params.size(); } - const value_t &GetValue(unsigned val) const { ASSERT(val < GetNumValues()); return values[val]; } - CString GetParam(unsigned val, unsigned par) const; - -private: - void ReadBuf( char *buf, int len ); - void AddParam( const CString &buf ); - void AddValue(); - - vector values; -}; - -#endif diff --git a/stepmania/src/Makefile.am b/stepmania/src/Makefile.am index d7540200d0..07078fed46 100644 --- a/stepmania/src/Makefile.am +++ b/stepmania/src/Makefile.am @@ -50,7 +50,7 @@ SongOptions.cpp SongOptions.h StageStats.cpp StageStats.h StyleDef.cpp StyleDef. TitleSubstitution.cpp TitleSubstitution.h Inventory.cpp Inventory.h PlayerNumber.cpp PlayerNumber.h \ LyricsLoader.cpp LyricsLoader.h -FileTypes = IniFile.cpp IniFile.h MsdFile.cpp MsdFile.h LRCFile.cpp LRCFile.h +FileTypes = IniFile.cpp IniFile.h MsdFile.cpp MsdFile.h StepMania = global.h ScreenDimensions.h StdString.h StepMania.cpp StepMania.h diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 7684df21db..68812a4991 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -567,14 +567,6 @@ SOURCE=.\IniFile.h # End Source File # Begin Source File -SOURCE=.\LRCFile.cpp -# End Source File -# Begin Source File - -SOURCE=.\LRCFile.h -# End Source File -# Begin Source File - SOURCE=.\MsdFile.cpp # End Source File # Begin Source File diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 3c08b6d18e..3d0e518f2d 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -708,12 +708,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ - - - -