mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-09-29 02:18:09 +03:00
Merge upstream changes: Merge FILEIO changes
FILEIO has been updated to resolve relative paths inside FILEIO::Fopen(), which has been already done in System3-sdl2. FILEIO::Fgets() now uses a length param. Callsites for these functions are also updated to reduce the diff from upstream.
This commit is contained in:
@@ -944,12 +944,11 @@ void NACT_Sys2::cmd_l()
|
||||
|
||||
if(1 <= index && index <= 26) {
|
||||
// ASLEEP_A.DAT - ASLEEP_Z.DAT
|
||||
char path[_MAX_PATH];
|
||||
strcpy_s(path, _MAX_PATH, "ASLEEP_A.DAT");
|
||||
path[7] = 'A' + index - 1;
|
||||
char file_name[_MAX_PATH];
|
||||
sprintf_s(file_name, _MAX_PATH, "ASLEEP_%c.DAT", 'A' + index - 1);
|
||||
|
||||
FILEIO* fio = new FILEIO();
|
||||
if(fio->Fopen(path, FILEIO_READ_BINARY)) {
|
||||
if(fio->Fopen(file_name, FILEIO_READ_BINARY)) {
|
||||
fio->Fseek(112, FILEIO_SEEK_SET);
|
||||
|
||||
int next_page = fio->Fgetw() - 1;
|
||||
@@ -1120,12 +1119,11 @@ void NACT_Sys2::cmd_q()
|
||||
|
||||
if(1 <= index && index <= 26) {
|
||||
// ASLEEP_A.DAT - ASLEEP_Z.DAT
|
||||
char path[_MAX_PATH];
|
||||
strcpy_s(path, _MAX_PATH, "ASLEEP_A.DAT");
|
||||
path[7] = 'A' + index - 1;
|
||||
char file_name[_MAX_PATH];
|
||||
sprintf_s(file_name, _MAX_PATH, "ASLEEP_%c.DAT", 'A' + index - 1);
|
||||
|
||||
FILEIO* fio = new FILEIO();
|
||||
if(fio->Fopen(path, FILEIO_WRITE_BINARY)) {
|
||||
if(fio->Fopen(file_name, FILEIO_WRITE_BINARY)) {
|
||||
uint8 buffer[9510];
|
||||
int p = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user