This commit is contained in:
Glenn Maynard
2003-01-03 05:26:15 +00:00
parent 6b447ce67e
commit 71d48b3d62
3 changed files with 12 additions and 9 deletions
+9 -8
View File
@@ -13,14 +13,15 @@
#include "RageUtil.h"
unsigned long randseed = time(NULL);
#include <numeric>
#include <time.h>
#include <math.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fstream>
unsigned long randseed = time(NULL);
int power_of_two(int input)
{
int value = 1;
@@ -30,7 +31,7 @@ int power_of_two(int input)
return value;
}
bool IsAnInt( const char *s )
bool IsAnInt( const CString &s )
{
if( s[0] == '\0' )
return false;
@@ -145,8 +146,8 @@ void split( const CString &Source, const CString &Deliminator, CStringArray& Add
int pos = Source.Find(Deliminator, startpos);
if ( pos == -1 ) pos=Source.GetLength();
CString AddCString = Source.Mid(startpos, pos-startpos);
if( AddCString.IsEmpty() && bIgnoreEmpty )
CString AddCString = Source.substr(startpos, pos-startpos);
if( AddCString.empty() && bIgnoreEmpty )
; // do nothing
else
AddIt.push_back(AddCString);
@@ -174,7 +175,7 @@ void splitpath( bool UsingDirsOnly, const CString &Path, CString& Drive, CString
else if (nSecond > nFirst)
Drive = Path.Left(nSecond);
}
else if (Path.Mid(1,1) == ":" ) // drive letter
else if (Path[1] == ':' ) // drive letter
{
nSecond = 2;
Drive = Path.Left(2);
@@ -199,7 +200,7 @@ void splitpath( bool UsingDirsOnly, const CString &Path, CString& Drive, CString
}
else {
Dir = Path.Mid(nSecond + 1, (nDirEnd - nSecond) - 1);
Dir = Path.substr(nSecond + 1, (nDirEnd - nSecond) - 1);
int nFileEnd = Path.ReverseFind('.');
if (nFileEnd != -1) {
@@ -209,7 +210,7 @@ void splitpath( bool UsingDirsOnly, const CString &Path, CString& Drive, CString
Ext = "";
}
else {
FName = Path.Mid(nDirEnd + 1, (nFileEnd - nDirEnd) - 1);
FName = Path.substr(nDirEnd + 1, (nFileEnd - nDirEnd) - 1);
Ext = Path.Right((Path.GetLength() - nFileEnd) - 1);
}
}
+1 -1
View File
@@ -113,7 +113,7 @@ inline float froundf( const float f, const float fRoundInterval )
}
int power_of_two(int input);
bool IsAnInt( const char *s );
bool IsAnInt( const CString &s );
float TimeToSeconds( CString sHMS );
CString SecondsToTime( float fSecs );
+2
View File
@@ -72,6 +72,8 @@
HWND g_hWndMain = NULL;
#endif
#include <time.h>
// command line arguments
CString g_sSongPath = "";
CString g_sServerIP = "";