aboutsummaryrefslogtreecommitdiff
path: root/src/Files.cpp
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2021-06-21 18:11:55 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2021-06-21 21:31:11 +0700
commit325dca9f212f9fd44cd10a8180529970c7a08c72 (patch)
treee1cfaec078dfa49f4d51d05eef8a5b0967843a41 /src/Files.cpp
parent10f5376de856ecead4e8bbf66f19157f36f7a382 (diff)
downloadblackshades-325dca9f212f9fd44cd10a8180529970c7a08c72.tar.gz
Remove trailing whitespaces and duplicated blank lines1.2.0
Diffstat (limited to 'src/Files.cpp')
-rw-r--r--src/Files.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/Files.cpp b/src/Files.cpp
index dd55c52..542595b 100644
--- a/src/Files.cpp
+++ b/src/Files.cpp
@@ -23,22 +23,21 @@ short Files::OpenNewFile( SFReply *psfReply,
{
sFile = 0;
OSErr osErr;
-
+
SetVol( nil, psfReply->vRefNum );
osErr = Create( psfReply->fName, psfReply->vRefNum, osTypeCreator, osTypeType );
-
+
if ( osErr == dupFNErr )
{
FSDelete( psfReply->fName, psfReply->vRefNum );
Create( psfReply->fName, psfReply->vRefNum, osTypeCreator, osTypeType );
}
-
+
FSOpen( psfReply->fName, psfReply->vRefNum, &sFile );
return( sFile );
}
-
short Files::PromptForSaveAS( short sPromptID,
short sNameID,
Str255 str255NamePrompt,
@@ -50,7 +49,7 @@ short Files::PromptForSaveAS( short sPromptID,
Str255 str255Name;
sFile = 0;
Point ptOrigin = { 0, 0 };
-
+
GetIndString( str255Prompt, FILE_STRINGS, sPromptID );
if ( !str255NamePrompt )
@@ -58,9 +57,9 @@ short Files::PromptForSaveAS( short sPromptID,
else
memcpy( str255Name, str255NamePrompt, *str255NamePrompt + 1 );
-
+
SFPutFile( ptOrigin, str255Prompt, str255Name, nil, psfReply );
-
+
if ( psfReply->good )
{
sFile = OpenNewFile( psfReply, osTypeCreator, osTypeType );
@@ -88,7 +87,7 @@ short Files::OpenFileDialog()
SFReply sfReply;
SFTypeList sfTypeList = { 'DMAP', '\p', '\p', '\p' };
SFGetFile( ptOrigin, "\p", nil, 1, sfTypeList, nil, &sfReply );
-
+
if ( sfReply.good )
{
PtoCstr( sfReply.fName );
@@ -101,7 +100,7 @@ short Files::OpenFileDialog()
SetVol( nil, sSavedGameVolume );
CtoPstr( szSavedGameName );
-
+
FSOpen( (Pstr) szSavedGameName, sSavedGameVolume,&sFile );
PtoCstr( (Pstr) szSavedGameName );
@@ -117,7 +116,7 @@ void Files::StartSave()
sFile = 0;
long lSize;
long lLongSize = sizeof( long );
-
+
CtoPstr( szSavedGameName );
sFile = PromptForSaveAS( SAVE_GAME_STRING, 0, (Pstr)szSavedGameName,'DAVD', 'DMAP', &sfReply );
@@ -139,7 +138,7 @@ void Files::StartSave()
sFile = OpenNewFile( &sfReply, 'GLF2', 'SKLT' );
}
-
+
}
void Files::EndSave()
@@ -148,7 +147,7 @@ void Files::EndSave()
SFReply sfReply;
long lSize;
long lLongSize = sizeof( long );
-
+
if ( sFile )
FSClose( sFile );
@@ -159,15 +158,14 @@ void Files::StartLoad()
Boolean bLoaded = false;
long lSize;
long lLongSize = sizeof( long );
-
+
int x,y,kl;
sFile=OpenFileDialog();
-
+
}
void Files::EndLoad()
{
-
if (sFile)
FSClose( sFile );
} \ No newline at end of file