just some cleanup.
This commit is contained in:
+1
-2
@@ -50,14 +50,13 @@ struct DateTime
|
||||
|
||||
static DateTime GetNowDateTime();
|
||||
static DateTime GetNowDate(); // GetNowDateTime() with time chopped off
|
||||
|
||||
|
||||
void StripTime();
|
||||
|
||||
RString GetString() const;
|
||||
bool FromString( const RString sDateTime );
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
+75
-80
@@ -18,7 +18,7 @@ typedef multimap<RString, RString> NameToData_t;
|
||||
typedef map<int, float> MeasureToTimeSig_t;
|
||||
|
||||
/* BMS encoding: tap-hold
|
||||
* 4&8panel: Player1 Player2
|
||||
* 4&8panel: Player1 Player2
|
||||
* Left 11-51 21-61
|
||||
* Down 13-53 23-63
|
||||
* Up 15-55 25-65
|
||||
@@ -153,7 +153,7 @@ static StepsType DetermineStepsType( int iPlayer, const NoteData &nd, const RStr
|
||||
if( nd.GetTapNote(t, r).type != TapNote::empty )
|
||||
{
|
||||
bTrackHasNote[t] = true;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ static StepsType DetermineStepsType( int iPlayer, const NoteData &nd, const RStr
|
||||
|
||||
switch( iPlayer )
|
||||
{
|
||||
case 1: // "1 player"
|
||||
case 1: // "1 player"
|
||||
/* Track counts:
|
||||
* 4 - dance 4-panel
|
||||
* 5 - pop 5-key
|
||||
@@ -212,13 +212,13 @@ static bool GetTagFromMap( const NameToData_t &mapNameToData, const RString &sNa
|
||||
it = mapNameToData.find( sName );
|
||||
if( it == mapNameToData.end() )
|
||||
return false;
|
||||
|
||||
|
||||
sOut = it->second;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Finds the longest common match for the given tag in all files. If the given tag
|
||||
/* Finds the longest common match for the given tag in all files. If the given tag
|
||||
* was found in at least one file, returns true; otherwise returns false. */
|
||||
static bool GetCommonTagFromMapList( const vector<NameToData_t> &aBMSData, const RString &sName, RString &sOut )
|
||||
{
|
||||
@@ -228,7 +228,7 @@ static bool GetCommonTagFromMapList( const vector<NameToData_t> &aBMSData, const
|
||||
RString sTag;
|
||||
if( !GetTagFromMap( aBMSData[i], sName, sTag ) )
|
||||
continue;
|
||||
|
||||
|
||||
if( !bFoundOne )
|
||||
{
|
||||
bFoundOne = true;
|
||||
@@ -239,7 +239,7 @@ static bool GetCommonTagFromMapList( const vector<NameToData_t> &aBMSData, const
|
||||
sOut = FindLargestInitialSubstring( sOut, sTag );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return bFoundOne;
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ static void SearchForDifficulty( RString sTag, Steps *pOut )
|
||||
{
|
||||
sTag.MakeLower();
|
||||
|
||||
/* Only match "Light" in parentheses. */
|
||||
// Only match "Light" in parentheses.
|
||||
if( sTag.find( "(light" ) != sTag.npos )
|
||||
{
|
||||
pOut->SetDifficulty( Difficulty_Easy );
|
||||
@@ -332,16 +332,14 @@ enum
|
||||
BMS_TRACK_STOP = 9
|
||||
};
|
||||
|
||||
/*
|
||||
* Time signatures are often abused to tweak sync. Real time signatures should
|
||||
* cause us to adjust the row offsets so one beat remains one beat. Fake time signatures,
|
||||
* like 1.001 or 0.999, should be removed and converted to BPM changes. This is much
|
||||
/* Time signatures are often abused to tweak sync. Real time signatures should
|
||||
* cause us to adjust the row offsets so one beat remains one beat. Fake time signatures,
|
||||
* like 1.001 or 0.999, should be removed and converted to BPM changes. This is much
|
||||
* more accurate, and prevents the whole song from being shifted off of the beat, causing
|
||||
* BeatToNoteType to be wrong.
|
||||
*
|
||||
* Evaluate each time signature, and guess which time signatures should be converted
|
||||
* to BPM changes. This isn't perfect, but errors aren't fatal.
|
||||
*/
|
||||
* to BPM changes. This isn't perfect, but errors aren't fatal. */
|
||||
static void SetTimeSigAdjustments( const MeasureToTimeSig_t &sigs, Song &out, MeasureToTimeSig_t &sigAdjustmentsOut )
|
||||
{
|
||||
return;
|
||||
@@ -353,7 +351,6 @@ static void SetTimeSigAdjustments( const MeasureToTimeSig_t &sigs, Song &out, Me
|
||||
{
|
||||
int iMeasure = it->first;
|
||||
float fFactor = it->second;
|
||||
|
||||
#if 1
|
||||
static const float ValidFactors[] =
|
||||
{
|
||||
@@ -365,34 +362,34 @@ static void SetTimeSigAdjustments( const MeasureToTimeSig_t &sigs, Song &out, Me
|
||||
1.5f, /* 6/4 */
|
||||
1.75f /* 7/4 */
|
||||
};
|
||||
|
||||
|
||||
bool bValidTimeSignature = false;
|
||||
for( unsigned i = 0; i < ARRAYLEN(ValidFactors); ++i )
|
||||
if( fabsf(fFactor-ValidFactors[i]) < 0.001 )
|
||||
bValidTimeSignature = true;
|
||||
|
||||
|
||||
if( bValidTimeSignature )
|
||||
continue;
|
||||
#else
|
||||
/* Alternate approach that I tried first: see if the ratio is sane. However,
|
||||
* some songs have values like "1.4", which comes out to 7/4 and is not a valid
|
||||
* time signature. */
|
||||
/* Convert the factor to a ratio, and reduce it. */
|
||||
// Convert the factor to a ratio, and reduce it.
|
||||
int iNum = lrintf( fFactor * 1000 ), iDen = 1000;
|
||||
int iDiv = gcd( iNum, iDen );
|
||||
iNum /= iDiv;
|
||||
iDen /= iDiv;
|
||||
|
||||
/* Real time signatures usually come down to 1/2, 3/4, 7/8, etc. Bogus
|
||||
/* Real time signatures usually come down to 1/2, 3/4, 7/8, etc. Bogus
|
||||
* signatures that are only there to adjust sync usually look like 99/100. */
|
||||
if( iNum <= 8 && iDen <= 8 )
|
||||
continue;
|
||||
#endif
|
||||
|
||||
/* This time signature is bogus. Convert it to a BPM adjustment for this
|
||||
|
||||
/* This time signature is bogus. Convert it to a BPM adjustment for this
|
||||
* measure. */
|
||||
LOG->Trace("Converted time signature %f in measure %i to a BPM segment.", fFactor, iMeasure );
|
||||
|
||||
|
||||
/* Note that this GetMeasureStartRow will automatically include any adjustments
|
||||
* that we've made previously in this loop; as long as we make the timing
|
||||
* adjustment and the BPM adjustment together, everything remains consistent.
|
||||
@@ -413,7 +410,7 @@ static void ReadTimeSigs( const NameToData_t &mapNameToData, MeasureToTimeSig_t
|
||||
const RString &sName = it->first;
|
||||
if( sName.size() != 6 || sName[0] != '#' || !IsAnInt(sName.substr(1, 5)) )
|
||||
continue;
|
||||
|
||||
|
||||
// this is step or offset data. Looks like "#00705"
|
||||
const RString &sData = it->second;
|
||||
int iMeasureNo = atoi( sName.substr(1, 3).c_str() );
|
||||
@@ -444,7 +441,7 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
|
||||
NoteData ndNotes;
|
||||
ndNotes.SetNumTracks( NUM_BMS_TRACKS );
|
||||
|
||||
/* Read time signatures. Note that these can differ across files in the same
|
||||
/* Read time signatures. Note that these can differ across files in the same
|
||||
* song. */
|
||||
MeasureToTimeSig_t mapMeasureToTimeSig;
|
||||
ReadTimeSigs( mapNameToData, mapMeasureToTimeSig );
|
||||
@@ -512,7 +509,7 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
|
||||
// shift the auto keysound as far right as possible
|
||||
int iLastEmptyTrack = -1;
|
||||
if( ndNotes.GetTapLastEmptyTrack(row, iLastEmptyTrack) &&
|
||||
iLastEmptyTrack >= BMS_AUTO_KEYSOUND_1 )
|
||||
iLastEmptyTrack >= BMS_AUTO_KEYSOUND_1 )
|
||||
{
|
||||
tn.type = TapNote::autoKeysound;
|
||||
bmsTrack = (BmsTrack)iLastEmptyTrack;
|
||||
@@ -525,9 +522,8 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
|
||||
}
|
||||
/* This handles the hold notes in the RDM TYPE 1 style,
|
||||
* like how uBMplay handles it. Different BMS simulators
|
||||
* supports hold notes differently. see
|
||||
* http://nvyu.net/rdm/ex.php for more info.
|
||||
*/
|
||||
* support hold notes differently. see
|
||||
* http://nvyu.net/rdm/ex.php for more info. */
|
||||
else if( iHoldStarts[bmsTrack] != -1 )
|
||||
{
|
||||
// This is ending a hold.
|
||||
@@ -563,7 +559,7 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
|
||||
out.m_StepsType = DetermineStepsType( iPlayer, ndNotes, sPath );
|
||||
if( out.m_StepsType == StepsType_beat_single5 && GetTagFromMap( mapNameToData, "#title", sData ) )
|
||||
{
|
||||
/* Hack: guess at 6-panel. */
|
||||
// Hack: guess at 6-panel.
|
||||
|
||||
// extract the Steps description (looks like 'Music <BASIC>')
|
||||
const size_t iOpenBracket = sData.find_first_of( "<(" );
|
||||
@@ -573,7 +569,7 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo
|
||||
if( sData.find('6', iOpenBracket) < iCloseBracket )
|
||||
out.m_StepsType = StepsType_dance_solo;
|
||||
}
|
||||
|
||||
|
||||
if( out.m_StepsType == StepsType_Invalid )
|
||||
{
|
||||
LOG->UserLog( "Song file", sPath, "has an unknown steps type" );
|
||||
@@ -731,7 +727,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
|
||||
if( GetTagFromMap(mapNameToData, "#bpm", sData) )
|
||||
{
|
||||
const float fBPM = StringToFloat( sData );
|
||||
|
||||
|
||||
if( PREFSMAN->m_bQuirksMode )
|
||||
{
|
||||
BPMSegment newSeg( 0, fBPM );
|
||||
@@ -771,7 +767,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
|
||||
|
||||
/* Due to bugs in some programs, many BMS files have a "WAV" extension
|
||||
* on files in the BMS for files that actually have some other extension.
|
||||
* Do a search. Don't do a wildcard search; if sData is "song.wav",
|
||||
* Do a search. Don't do a wildcard search; if sData is "song.wav",
|
||||
* we might also have "song.png", which we shouldn't match. */
|
||||
if( !IsAFile(out.GetSongDir()+sData) )
|
||||
{
|
||||
@@ -795,7 +791,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
|
||||
LOG->Trace( "Inserting keysound index %u '%s'", unsigned(out.m_vsKeysoundFile.size()-1), sWavID.c_str() );
|
||||
}
|
||||
|
||||
/* Time signature tags affect all other global timing tags, so read them first. */
|
||||
// Time signature tags affect all other global timing tags, so read them first.
|
||||
MeasureToTimeSig_t mapMeasureToTimeSig;
|
||||
ReadTimeSigs( mapNameToData, mapMeasureToTimeSig );
|
||||
|
||||
@@ -838,7 +834,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
|
||||
fBeat, iVal );
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case BMS_TRACK_BPM_REF:
|
||||
{
|
||||
RString sTagToLookFor = ssprintf( "#bpm%s", sPair.c_str() );
|
||||
@@ -900,64 +896,64 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch( iBMSTrackNo )
|
||||
{
|
||||
case BMS_TRACK_BPM_REF:
|
||||
{
|
||||
// XXX: offset
|
||||
int iBPMNo;
|
||||
sscanf( sData, "%x", &iBPMNo ); // data is in hexadecimal
|
||||
|
||||
RString sBPM;
|
||||
RString sTagToLookFor = ssprintf( "#bpm%02x", iBPMNo );
|
||||
if( GetTagFromMap( mapNameToData, sTagToLookFor, sBPM ) )
|
||||
case BMS_TRACK_BPM_REF:
|
||||
{
|
||||
float fBPM = StringToFloat( sBPM );
|
||||
// XXX: offset
|
||||
int iBPMNo;
|
||||
sscanf( sData, "%x", &iBPMNo ); // data is in hexadecimal
|
||||
|
||||
if( PREFSMAN->m_bQuirksMode )
|
||||
RString sBPM;
|
||||
RString sTagToLookFor = ssprintf( "#bpm%02x", iBPMNo );
|
||||
if( GetTagFromMap( mapNameToData, sTagToLookFor, sBPM ) )
|
||||
{
|
||||
BPMSegment newSeg( iStepIndex, fBPM );
|
||||
out.AddBPMSegment( newSeg );
|
||||
if( fBPM > 0.0f )
|
||||
LOG->Trace( "Inserting new positive BPM change at beat %f, BPM %f", NoteRowToBeat(newSeg.m_iStartRow), newSeg.GetBPM() );
|
||||
else
|
||||
LOG->Trace( "Inserting new negative BPM change at beat %f, BPM %f", NoteRowToBeat(newSeg.m_iStartRow), newSeg.GetBPM() );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( fBPM > 0.0f )
|
||||
float fBPM = StringToFloat( sBPM );
|
||||
|
||||
if( PREFSMAN->m_bQuirksMode )
|
||||
{
|
||||
BPMSegment newSeg( iStepIndex, fBPM );
|
||||
out.AddBPMSegment( newSeg );
|
||||
LOG->Trace( "Inserting new BPM change at beat %f, BPM %f", NoteRowToBeat(newSeg.m_iStartRow), newSeg.GetBPM() );
|
||||
|
||||
if( fBPM > 0.0f )
|
||||
LOG->Trace( "Inserting new positive BPM change at beat %f, BPM %f", NoteRowToBeat(newSeg.m_iStartRow), newSeg.GetBPM() );
|
||||
else
|
||||
LOG->Trace( "Inserting new negative BPM change at beat %f, BPM %f", NoteRowToBeat(newSeg.m_iStartRow), newSeg.GetBPM() );
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG->UserLog( "Song file", out.GetSongDir(), "has an invalid BPM change at beat %f, BPM %f.",
|
||||
NoteRowToBeat(iStepIndex), fBPM );
|
||||
if( fBPM > 0.0f )
|
||||
{
|
||||
BPMSegment newSeg( iStepIndex, fBPM );
|
||||
out.AddBPMSegment( newSeg );
|
||||
LOG->Trace( "Inserting new BPM change at beat %f, BPM %f", NoteRowToBeat(newSeg.m_iStartRow), newSeg.GetBPM() );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG->UserLog( "Song file", out.GetSongDir(), "has an invalid BPM change at beat %f, BPM %f.",
|
||||
NoteRowToBeat(iStepIndex), fBPM );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG->UserLog( "Song file", out.GetSongDir(), "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() );
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG->UserLog( "Song file", out.GetSongDir(), "has tag \"%s\" which cannot be found.", sTagToLookFor.c_str() );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Now that we're done reading BPMs, factor out weird time signatures. */
|
||||
// Now that we're done reading BPMs, factor out weird time signatures.
|
||||
SetTimeSigAdjustments( mapMeasureToTimeSig, out, sigAdjustmentsOut );
|
||||
}
|
||||
|
||||
static void SlideDuplicateDifficulties( Song &p )
|
||||
{
|
||||
/* BMS files have to guess the Difficulty from the meter; this is inaccurate,
|
||||
* and often leads to duplicates. Slide duplicate difficulties upwards. We
|
||||
* and often leads to duplicates. Slide duplicate difficulties upwards. We
|
||||
* only do this with BMS files, since a very common bug was having *all*
|
||||
* difficulties slid upwards due to (for example) having two beginner steps.
|
||||
* We do a second pass in Song::TidyUpData to eliminate any remaining duplicates
|
||||
@@ -968,15 +964,15 @@ static void SlideDuplicateDifficulties( Song &p )
|
||||
{
|
||||
if( dc == Difficulty_Edit )
|
||||
continue;
|
||||
|
||||
|
||||
vector<Steps*> vSteps;
|
||||
SongUtil::GetSteps( &p, vSteps, st, dc );
|
||||
|
||||
|
||||
StepsUtil::SortNotesArrayByDifficulty( vSteps );
|
||||
for( unsigned k=1; k<vSteps.size(); k++ )
|
||||
{
|
||||
Steps* pSteps = vSteps[k];
|
||||
|
||||
|
||||
Difficulty dc2 = min( (Difficulty)(dc+1), Difficulty_Challenge );
|
||||
pSteps->SetDifficulty( dc2 );
|
||||
}
|
||||
@@ -1003,7 +999,7 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
|
||||
* called to begin with. */
|
||||
ASSERT( arrayBMSFileNames.size() );
|
||||
|
||||
/* Read all BMS files. */
|
||||
// Read all BMS files.
|
||||
vector<NameToData_t> aBMSData;
|
||||
for( unsigned i=0; i<arrayBMSFileNames.size(); i++ )
|
||||
{
|
||||
@@ -1021,11 +1017,11 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
|
||||
LOG->UserLog( "Song", sDir, "has BMS files with inconsistent titles." );
|
||||
}
|
||||
|
||||
/* Create a Steps for each. */
|
||||
// Create a Steps for each.
|
||||
vector<Steps*> apSteps;
|
||||
for( unsigned i=0; i<arrayBMSFileNames.size(); i++ )
|
||||
apSteps.push_back( new Steps );
|
||||
|
||||
|
||||
// Now, with our fancy little substring, trim the titles and
|
||||
// figure out where each goes.
|
||||
for( unsigned i=0; i<aBMSData.size(); i++ )
|
||||
@@ -1073,7 +1069,7 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
|
||||
// As said before, all bets are off.
|
||||
// From here on in, it's nothing but guesswork.
|
||||
|
||||
/* Try to figure out the difficulty of each file. */
|
||||
// Try to figure out the difficulty of each file.
|
||||
for( unsigned i=0; i<arrayBMSFileNames.size(); i++ )
|
||||
{
|
||||
// XXX: Is this really effective if Common Substring parsing failed?
|
||||
@@ -1085,7 +1081,7 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
|
||||
}
|
||||
}
|
||||
|
||||
/* Prefer to read global tags from a Difficulty_Medium file. These tend to
|
||||
/* Prefer to read global tags from a Difficulty_Medium file. These tend to
|
||||
* have the least cruft in the #TITLE tag, so it's more likely to get a clean
|
||||
* title. */
|
||||
int iMainDataIndex = 0;
|
||||
@@ -1096,7 +1092,7 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
|
||||
MeasureToTimeSig_t sigAdjustments;
|
||||
map<RString,int> idToKeysoundIndex;
|
||||
ReadGlobalTags( aBMSData[iMainDataIndex], out, sigAdjustments, idToKeysoundIndex );
|
||||
|
||||
|
||||
// Override what that global tag said about the title if we have a good substring.
|
||||
// Prevents clobbering and catches "MySong (7keys)" / "MySong (Another) (7keys)"
|
||||
// Also catches "MySong (7keys)" / "MySong (14keys)"
|
||||
@@ -1121,7 +1117,6 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
|
||||
ConvertString( out.m_sArtist, "utf-8,japanese" );
|
||||
ConvertString( out.m_sGenre, "utf-8,japanese" );
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -204,7 +204,7 @@ protected:
|
||||
ThemeMetric<bool> COMBO_UNDER_FIELD;
|
||||
ThemeMetric<int> DRAW_DISTANCE_AFTER_TARGET_PIXELS;
|
||||
ThemeMetric<int> DRAW_DISTANCE_BEFORE_TARGET_PIXELS;
|
||||
|
||||
|
||||
#define NUM_REVERSE 2
|
||||
#define NUM_CENTERED 2
|
||||
TweenState m_tsJudgment[NUM_REVERSE][NUM_CENTERED];
|
||||
|
||||
@@ -4,21 +4,19 @@
|
||||
#include "Foreach.h"
|
||||
#include "RageLog.h"
|
||||
|
||||
/*
|
||||
* Implement threaded read-ahead buffering.
|
||||
/* Implement threaded read-ahead buffering.
|
||||
*
|
||||
* If a buffer is low on data, keep filling until it has a g_iMinFillFrames.
|
||||
* Once beyond that, fill at a rate relative to realtime.
|
||||
*
|
||||
* This allows a stream to have a large buffer, for higher reliability, without
|
||||
* causing major CPU bursts when the stream starts or underruns. Filling 32k
|
||||
* takes more CPU than filling 4k frames, and may cause a skip.
|
||||
*/
|
||||
* causing major CPU bursts when the stream starts or underruns. Filling 32k
|
||||
* takes more CPU than filling 4k frames, and may cause a skip. */
|
||||
|
||||
/* The amount of data to read at once: */
|
||||
// The amount of data to read at once:
|
||||
static const unsigned g_iReadBlockSizeFrames = 1024;
|
||||
|
||||
/* The maximum number of frames to buffer: */
|
||||
// The maximum number of frames to buffer:
|
||||
static const int g_iStreamingBufferFrames = 1024*32;
|
||||
|
||||
/* When a sound has fewer than g_iMinFillFrames buffered, buffer at maximum speed.
|
||||
@@ -200,20 +198,20 @@ void RageSoundReader_ThreadedBuffer::BufferingThread()
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Fill some data. */
|
||||
// Fill some data.
|
||||
m_bFilling = true;
|
||||
|
||||
|
||||
int iFramesToFill = g_iReadBlockSizeFrames;
|
||||
if( GetFilledFrames() < g_iMinFillFrames )
|
||||
iFramesToFill = max( iFramesToFill, g_iMinFillFrames - GetFilledFrames() );
|
||||
|
||||
int iRet = FillFrames( iFramesToFill );
|
||||
|
||||
/* Release m_bFilling, and signal the event to wake anyone waiting for it. */
|
||||
// Release m_bFilling, and signal the event to wake anyone waiting for it.
|
||||
m_bFilling = false;
|
||||
m_Event.Broadcast();
|
||||
|
||||
/* On error or end of file, stop buffering the sound. */
|
||||
// On error or end of file, stop buffering the sound.
|
||||
if( iRet < 0 )
|
||||
{
|
||||
m_bEnabled = false;
|
||||
@@ -253,7 +251,7 @@ int RageSoundReader_ThreadedBuffer::FillFrames( int iFrames )
|
||||
|
||||
if( iRet == 0 )
|
||||
break;
|
||||
/* On error or end of file, stop buffering the sound. */
|
||||
// On error or end of file, stop buffering the sound.
|
||||
if( iRet < 0 )
|
||||
return iRet;
|
||||
|
||||
@@ -277,7 +275,7 @@ int RageSoundReader_ThreadedBuffer::FillBlock()
|
||||
m_Event.Unlock();
|
||||
|
||||
{
|
||||
/* We own m_pSource, even after unlocking, because m_bFilling is true. */
|
||||
// We own m_pSource, even after unlocking, because m_bFilling is true.
|
||||
unsigned iBufSize;
|
||||
float *pBuf = m_DataBuffer.get_write_pointer( &iBufSize );
|
||||
ASSERT( (iBufSize % iSamplesPerFrame) == 0 );
|
||||
@@ -288,7 +286,7 @@ int RageSoundReader_ThreadedBuffer::FillBlock()
|
||||
|
||||
if( iGotFrames > 0 )
|
||||
{
|
||||
/* Add the data to the buffer. */
|
||||
// Add the data to the buffer.
|
||||
m_DataBuffer.advance_write_pointer( iGotFrames * iSamplesPerFrame );
|
||||
if( iNextSourceFrame != m_StreamPosition.back().iPositionOfFirstFrame + m_StreamPosition.back().iFramesBuffered ||
|
||||
fRate != m_StreamPosition.back().fRate )
|
||||
@@ -315,7 +313,7 @@ int RageSoundReader_ThreadedBuffer::Read( float *pBuffer, int iFrames )
|
||||
|
||||
{
|
||||
/* Delete any empty mappings from the beginning, but don't empty the list,
|
||||
* so we always have the current position and rate. If we delete an item,
|
||||
* so we always have the current position and rate. If we delete an item,
|
||||
* the rate or position has probably changed, so return. */
|
||||
list<Mapping>::iterator it = m_StreamPosition.begin();
|
||||
++it;
|
||||
@@ -344,7 +342,7 @@ int RageSoundReader_ThreadedBuffer::Read( float *pBuffer, int iFrames )
|
||||
else
|
||||
iRet = WOULD_BLOCK;
|
||||
m_Event.Unlock();
|
||||
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ private:
|
||||
int m_iColNo;
|
||||
|
||||
AutoActor m_pReceptor;
|
||||
|
||||
|
||||
bool m_bIsPressed;
|
||||
bool m_bWasPressed; // set in Update
|
||||
bool m_bWasReverse;
|
||||
|
||||
@@ -10,8 +10,7 @@ static ThemeMetric<float> THEME_SCREEN_HEIGHT("Common","ScreenHeight");
|
||||
|
||||
/* The theme's logical resolution specifies the minimum screen width and
|
||||
* the minimum screen height with a 4:3 aspect ratio. Scale just one
|
||||
* of the dimensions up to meet the requested aspect ratio.
|
||||
*/
|
||||
* of the dimensions up to meet the requested aspect ratio. */
|
||||
|
||||
/* The theme resolution isn't necessarily 4:3; a natively widescreen
|
||||
* theme would have eg. 16:9 or 16:10.
|
||||
@@ -25,9 +24,10 @@ float ScreenDimensions::GetThemeAspectRatio()
|
||||
return THEME_NATIVE_ASPECT;
|
||||
}
|
||||
|
||||
// ceilf was originally lrintf. However, lrintf causes odd resolutions like
|
||||
// 639x480 (4:3) and 853x480 (16:9). ceilf gives the correct values of 640x480
|
||||
// and 854x480 respectively. -aj
|
||||
/* ceilf was originally lrintf. However, lrintf causes odd resolutions like
|
||||
* 639x480 (4:3) and 853x480 (16:9). ceilf gives the correct values of 640x480
|
||||
* and 854x480 (should really be 852 so that SCREEN_CENTER_X == 426 and not 427)
|
||||
* respectively. -aj */
|
||||
float ScreenDimensions::GetScreenWidth()
|
||||
{
|
||||
float fAspect = PREFSMAN->m_fDisplayAspectRatio;
|
||||
@@ -50,7 +50,7 @@ float ScreenDimensions::GetScreenHeight()
|
||||
|
||||
void ScreenDimensions::ReloadScreenDimensions()
|
||||
{
|
||||
/* Important: explicitly refresh cached metrics that we use. */
|
||||
// Important: explicitly refresh cached metrics that we use.
|
||||
THEME_SCREEN_WIDTH.Read();
|
||||
THEME_SCREEN_HEIGHT.Read();
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "OptionRowHandler.h"
|
||||
#include "LocalizedString.h"
|
||||
|
||||
static LocalizedString NEW_PROFILE_DEFAULT_NAME( "ScreenOptionsManageProfiles", "NewProfileDefaultName" );
|
||||
static LocalizedString NEW_PROFILE_DEFAULT_NAME( "ScreenOptionsManageProfiles", "NewProfileDefaultName" );
|
||||
|
||||
#define SHOW_CREATE_NEW (!PROFILEMAN->FixedProfiles())
|
||||
|
||||
@@ -139,7 +139,7 @@ void ScreenOptionsManageProfiles::BeginScreen()
|
||||
RString sEditLocalProfileID = GAMESTATE->m_sEditLocalProfileID;
|
||||
|
||||
ScreenOptions::BeginScreen();
|
||||
|
||||
|
||||
// select the last chosen profile
|
||||
if( !sEditLocalProfileID.empty() )
|
||||
{
|
||||
@@ -323,7 +323,7 @@ void ScreenOptionsManageProfiles::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
ScreenOptions::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
|
||||
void ScreenOptionsManageProfiles::AfterChangeRow( PlayerNumber pn )
|
||||
{
|
||||
GAMESTATE->m_sEditLocalProfileID.Set( GetLocalProfileIDWithFocus() );
|
||||
@@ -411,7 +411,7 @@ int ScreenOptionsManageProfiles::GetLocalProfileIndexWithFocus() const
|
||||
return -1;
|
||||
else if( row.GetRowType() == OptionRow::RowType_Exit )
|
||||
return -1;
|
||||
|
||||
|
||||
// a profile
|
||||
int iIndex = iCurRow + (SHOW_CREATE_NEW ? -1 : 0);
|
||||
return iIndex;
|
||||
|
||||
+10
-14
@@ -91,15 +91,13 @@ static Preference<bool> g_bAllowMultipleInstances( "AllowMultipleInstances", fal
|
||||
|
||||
void StepMania::GetPreferredVideoModeParams( VideoModeParams ¶msOut )
|
||||
{
|
||||
/*
|
||||
* We can't rely on there being full-screen video modes that give us square
|
||||
/* We can't rely on there being full-screen video modes that give us square
|
||||
* pixels at non-4:3 aspects. The lowest non-4:3 resolution my new laptop
|
||||
* with Radeon supports is 1280x720. In most cases, we'll using a 4:3
|
||||
* resolution when full-screen let the monitor stretch to the correct aspect.
|
||||
* When windowed (no monitor stretching), we will tweak the width so that
|
||||
* we get square pixels.
|
||||
* -Chris
|
||||
*/
|
||||
* -Chris */
|
||||
int iWidth = PREFSMAN->m_iDisplayWidth;
|
||||
if( PREFSMAN->m_bWindowed )
|
||||
{
|
||||
@@ -128,12 +126,12 @@ void StepMania::GetPreferredVideoModeParams( VideoModeParams ¶msOut )
|
||||
);
|
||||
}
|
||||
|
||||
static LocalizedString COLOR ("StepMania","color");
|
||||
static LocalizedString TEXTURE ("StepMania","texture");
|
||||
static LocalizedString COLOR ("StepMania","color");
|
||||
static LocalizedString TEXTURE ("StepMania","texture");
|
||||
static LocalizedString WINDOWED ("StepMania","Windowed");
|
||||
static LocalizedString FULLSCREEN ("StepMania","Fullscreen");
|
||||
static LocalizedString ANNOUNCER_ ("StepMania","Announcer");
|
||||
static LocalizedString VSYNC ("StepMania","Vsync");
|
||||
static LocalizedString FULLSCREEN ("StepMania","Fullscreen");
|
||||
static LocalizedString ANNOUNCER_ ("StepMania","Announcer");
|
||||
static LocalizedString VSYNC ("StepMania","Vsync");
|
||||
static LocalizedString NO_VSYNC ("StepMania","NoVsync");
|
||||
static LocalizedString SMOOTH_LINES ("StepMania","SmoothLines");
|
||||
static LocalizedString NO_SMOOTH_LINES ("StepMania","NoSmoothLines");
|
||||
@@ -159,14 +157,12 @@ static void StoreActualGraphicOptions()
|
||||
{
|
||||
/* Store the settings that RageDisplay was actually able to use so that
|
||||
* we don't go through the process of auto-detecting a usable video mode
|
||||
* every time.
|
||||
*/
|
||||
* every time. */
|
||||
const VideoModeParams ¶ms = DISPLAY->GetActualVideoModeParams();
|
||||
PREFSMAN->m_bWindowed .Set( params.windowed );
|
||||
PREFSMAN->m_bWindowed.Set( params.windowed );
|
||||
|
||||
/* If we're windowed, we may have tweaked the width based on the aspect ratio.
|
||||
* Don't save this new value over the preferred value.
|
||||
*/
|
||||
* Don't save this new value over the preferred value. */
|
||||
if( !PREFSMAN->m_bWindowed )
|
||||
{
|
||||
PREFSMAN->m_iDisplayWidth .Set( params.width );
|
||||
|
||||
Reference in New Issue
Block a user