mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 20:19:38 +00:00
Move IOStream to GpCommon
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
#include "FontManager.h"
|
||||
#include "HostSystemServices.h"
|
||||
#include "House.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "MainWindow.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "PLTimeTaggedVOSEvent.h"
|
||||
@@ -29,11 +29,6 @@
|
||||
#include "Utilities.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
}
|
||||
|
||||
#define kHighScoresPictID 1994
|
||||
#define kHighScoresMaskID 1998
|
||||
#define kHighNameDialogID 1020
|
||||
@@ -51,7 +46,7 @@ void GetHighScoreName (short);
|
||||
void UpdateBannerDialog (Dialog *);
|
||||
int16_t BannerFilter(Dialog *dialog, const TimeTaggedVOSEvent *evt);
|
||||
void GetHighScoreBanner (void);
|
||||
Boolean OpenHighScoresFile (const VFileSpec &spec, PortabilityLayer::IOStream *&outStream);
|
||||
Boolean OpenHighScoresFile (const VFileSpec &spec, GpIOStream *&outStream);
|
||||
|
||||
|
||||
Str31 highBanner;
|
||||
@@ -672,7 +667,7 @@ void GetHighScoreBanner (void)
|
||||
|
||||
//-------------------------------------------------------------- OpenHighScoresFile
|
||||
|
||||
Boolean OpenHighScoresFile (const VFileSpec &scoreSpec, PortabilityLayer::IOStream *&scoresStream)
|
||||
Boolean OpenHighScoresFile (const VFileSpec &scoreSpec, GpIOStream *&scoresStream)
|
||||
{
|
||||
PLError_t theErr;
|
||||
|
||||
@@ -704,7 +699,7 @@ Boolean WriteScoresToDisk (void)
|
||||
PLError_t theErr;
|
||||
short volRefNum;
|
||||
char wasState;
|
||||
PortabilityLayer::IOStream *scoresStream = nil;
|
||||
GpIOStream *scoresStream = nil;
|
||||
|
||||
scoreSpec = MakeVFileSpec(PortabilityLayer::VirtualDirectories::kHighScores, thisHouseName);
|
||||
if (!OpenHighScoresFile(scoreSpec, scoresStream))
|
||||
@@ -749,11 +744,11 @@ Boolean WriteScoresToDisk (void)
|
||||
Boolean ReadScoresFromDisk (void)
|
||||
{
|
||||
scoresType *theScores;
|
||||
PortabilityLayer::UFilePos_t byteCount;
|
||||
GpUFilePos_t byteCount;
|
||||
PLError_t theErr;
|
||||
short volRefNum;
|
||||
char wasState;
|
||||
PortabilityLayer::IOStream *scoresStream = nil;
|
||||
GpIOStream *scoresStream = nil;
|
||||
|
||||
VFileSpec scoreSpec = MakeVFileSpec(PortabilityLayer::VirtualDirectories::kHighScores, thisHouseName);
|
||||
if (!OpenHighScoresFile(scoreSpec, scoresStream))
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "HostFileSystem.h"
|
||||
#include "HostSystemServices.h"
|
||||
#include "House.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "ObjectEdit.h"
|
||||
#include "ResourceManager.h"
|
||||
|
||||
@@ -38,7 +38,7 @@ AnimationPlayer theMovie;
|
||||
Rect movieRect;
|
||||
PortabilityLayer::ResourceArchive *houseResFork;
|
||||
short wasHouseVersion;
|
||||
PortabilityLayer::IOStream *houseStream;
|
||||
GpIOStream *houseStream;
|
||||
Boolean houseOpen, fileDirty, gameDirty;
|
||||
Boolean changeLockStateOfHouse, saveHouseLocked, houseIsReadOnly;
|
||||
Boolean hasMovie, tvInRoom;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "Environ.h"
|
||||
#include "HostDisplayDriver.h"
|
||||
#include "IGpDisplayDriver.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "House.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
@@ -35,7 +35,7 @@ extern Str15 leftName, rightName, batteryName, bandName;
|
||||
extern Str15 highName;
|
||||
//extern long encryptedNumber;
|
||||
extern short maxFiles, numNeighbors, willMaxFiles;
|
||||
extern PortabilityLayer::IOStream *houseStream;
|
||||
extern GpIOStream *houseStream;
|
||||
extern short isEditH, isEditV, isMapH, isMapV;
|
||||
extern short isToolsH, isToolsV, isCoordH, isCoordV;
|
||||
extern short isLinkH, isLinkV, toolMode, mapLeftRoom, mapTopRoom;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "IGpDisplayDriver.h"
|
||||
#include "IGpInputDriver.h"
|
||||
#include "IGpPrefsHandler.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "MemoryManager.h"
|
||||
#include "HostAudioDriver.h"
|
||||
#include "HostDisplayDriver.h"
|
||||
@@ -59,7 +59,7 @@ Boolean CanUseFindFolder (void)
|
||||
Boolean WritePrefs (const prefsInfo *thePrefs, short versionNow, THandle<modulePrefsListEntry> modulePrefs)
|
||||
{
|
||||
PLError_t theErr;
|
||||
PortabilityLayer::IOStream *fileStream;
|
||||
GpIOStream *fileStream;
|
||||
long byteCount;
|
||||
Str255 fileName;
|
||||
|
||||
@@ -188,8 +188,8 @@ static void DestroyModulePrefs(THandle<modulePrefsListEntry> *theModulePrefs)
|
||||
|
||||
PLError_t ReadPrefs (prefsInfo *thePrefs, short versionNeed, Boolean *isOldVersion, THandle<modulePrefsListEntry> *theModulePrefs)
|
||||
{
|
||||
PLError_t theErr;
|
||||
PortabilityLayer::IOStream *fileStream;
|
||||
PLError_t theErr;
|
||||
GpIOStream *fileStream;
|
||||
long byteCount;
|
||||
VFileSpec theSpecs;
|
||||
Str255 fileName;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "Externs.h"
|
||||
#include "FileManager.h"
|
||||
#include "House.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "InputManager.h"
|
||||
#include "MacFileInfo.h"
|
||||
#include "MemoryManager.h"
|
||||
@@ -49,7 +49,7 @@ void SaveGame2 (void)
|
||||
gamePtr savedGame;
|
||||
short r, i, numRooms;
|
||||
char wasState;
|
||||
PortabilityLayer::IOStream *gameStream = nullptr;
|
||||
GpIOStream *gameStream = nullptr;
|
||||
|
||||
PortabilityLayer::MemoryManager *mm = PortabilityLayer::MemoryManager::GetInstance();
|
||||
PortabilityLayer::FileManager *fm = PortabilityLayer::FileManager::GetInstance();
|
||||
@@ -206,13 +206,13 @@ Boolean OpenSavedGame (void)
|
||||
if (memcmp(props.m_fileType, "gliG", 4))
|
||||
return false;
|
||||
|
||||
PortabilityLayer::IOStream *gameStream = nullptr;
|
||||
GpIOStream *gameStream = nullptr;
|
||||
PLError_t theErr = fm->OpenFileData(spec.m_dir, spec.m_name, PortabilityLayer::EFilePermission_Read, gameStream);
|
||||
|
||||
if (!CheckFileError(theErr, PSTR("Saved Game")))
|
||||
return(false);
|
||||
|
||||
const PortabilityLayer::UFilePos_t fileSizeFP = gameStream->Size();
|
||||
const GpUFilePos_t fileSizeFP = gameStream->Size();
|
||||
if (fileSizeFP > SIZE_MAX)
|
||||
{
|
||||
gameStream->Close();
|
||||
|
||||
Reference in New Issue
Block a user