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" #include "RageUtil.h"
unsigned long randseed = time(NULL);
#include <numeric> #include <numeric>
#include <time.h>
#include <math.h> #include <math.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <fstream> #include <fstream>
unsigned long randseed = time(NULL);
int power_of_two(int input) int power_of_two(int input)
{ {
int value = 1; int value = 1;
@@ -30,7 +31,7 @@ int power_of_two(int input)
return value; return value;
} }
bool IsAnInt( const char *s ) bool IsAnInt( const CString &s )
{ {
if( s[0] == '\0' ) if( s[0] == '\0' )
return false; return false;
@@ -145,8 +146,8 @@ void split( const CString &Source, const CString &Deliminator, CStringArray& Add
int pos = Source.Find(Deliminator, startpos); int pos = Source.Find(Deliminator, startpos);
if ( pos == -1 ) pos=Source.GetLength(); if ( pos == -1 ) pos=Source.GetLength();
CString AddCString = Source.Mid(startpos, pos-startpos); CString AddCString = Source.substr(startpos, pos-startpos);
if( AddCString.IsEmpty() && bIgnoreEmpty ) if( AddCString.empty() && bIgnoreEmpty )
; // do nothing ; // do nothing
else else
AddIt.push_back(AddCString); AddIt.push_back(AddCString);
@@ -174,7 +175,7 @@ void splitpath( bool UsingDirsOnly, const CString &Path, CString& Drive, CString
else if (nSecond > nFirst) else if (nSecond > nFirst)
Drive = Path.Left(nSecond); Drive = Path.Left(nSecond);
} }
else if (Path.Mid(1,1) == ":" ) // drive letter else if (Path[1] == ':' ) // drive letter
{ {
nSecond = 2; nSecond = 2;
Drive = Path.Left(2); Drive = Path.Left(2);
@@ -199,7 +200,7 @@ void splitpath( bool UsingDirsOnly, const CString &Path, CString& Drive, CString
} }
else { else {
Dir = Path.Mid(nSecond + 1, (nDirEnd - nSecond) - 1); Dir = Path.substr(nSecond + 1, (nDirEnd - nSecond) - 1);
int nFileEnd = Path.ReverseFind('.'); int nFileEnd = Path.ReverseFind('.');
if (nFileEnd != -1) { if (nFileEnd != -1) {
@@ -209,7 +210,7 @@ void splitpath( bool UsingDirsOnly, const CString &Path, CString& Drive, CString
Ext = ""; Ext = "";
} }
else { else {
FName = Path.Mid(nDirEnd + 1, (nFileEnd - nDirEnd) - 1); FName = Path.substr(nDirEnd + 1, (nFileEnd - nDirEnd) - 1);
Ext = Path.Right((Path.GetLength() - nFileEnd) - 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); int power_of_two(int input);
bool IsAnInt( const char *s ); bool IsAnInt( const CString &s );
float TimeToSeconds( CString sHMS ); float TimeToSeconds( CString sHMS );
CString SecondsToTime( float fSecs ); CString SecondsToTime( float fSecs );
+2
View File
@@ -72,6 +72,8 @@
HWND g_hWndMain = NULL; HWND g_hWndMain = NULL;
#endif #endif
#include <time.h>
// command line arguments // command line arguments
CString g_sSongPath = ""; CString g_sSongPath = "";
CString g_sServerIP = ""; CString g_sServerIP = "";