mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-12 17:28:22 +03:00
NACT: Refactor data structure for menu
This commit is contained in:
+7
-12
@@ -77,20 +77,15 @@ std::unique_ptr<FILEIO> FILEIO::open(const char *file_name, int mode)
|
||||
return fp ? std::unique_ptr<FILEIO>(new FILEIO(fp, mode)) : nullptr;
|
||||
}
|
||||
|
||||
void FILEIO::ag00_gets(char *dest, int length)
|
||||
std::string FILEIO::gets()
|
||||
{
|
||||
int p = 0;
|
||||
|
||||
for(;;) {
|
||||
std::string s;
|
||||
for (;;) {
|
||||
int c = getc();
|
||||
if(c == 0x0d || c == EOF) {
|
||||
if (c == '\r' || c == EOF)
|
||||
break;
|
||||
}
|
||||
if(c != 0x0a) {
|
||||
if(p < length + 1) {
|
||||
dest[p++] = c;
|
||||
}
|
||||
}
|
||||
if(c != '\n')
|
||||
s.push_back(c);
|
||||
}
|
||||
dest[p] = '\0';
|
||||
return s;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user