mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Move IOStream to GpCommon
This commit is contained in:
@@ -1,149 +1,149 @@
|
||||
#include "GpFileStream_Win32.h"
|
||||
|
||||
GpFileStream_Win32::GpFileStream_Win32(HANDLE handle, bool readable, bool writeable, bool seekable)
|
||||
: m_handle(handle)
|
||||
, m_readable(readable)
|
||||
, m_writeable(writeable)
|
||||
, m_seekable(seekable)
|
||||
{
|
||||
}
|
||||
|
||||
size_t GpFileStream_Win32::Read(void *bytesOut, size_t size)
|
||||
{
|
||||
if (!m_readable)
|
||||
return 0;
|
||||
|
||||
size_t totalRead = 0;
|
||||
while (size)
|
||||
{
|
||||
const DWORD chunkSizeToRead = (size > MAXDWORD) ? MAXDWORD : size;
|
||||
DWORD numRead = 0;
|
||||
|
||||
BOOL readSucceeded = ReadFile(m_handle, bytesOut, chunkSizeToRead, &numRead, nullptr);
|
||||
if (!readSucceeded)
|
||||
return totalRead;
|
||||
|
||||
totalRead += static_cast<size_t>(numRead);
|
||||
size -= static_cast<size_t>(numRead);
|
||||
bytesOut = static_cast<void*>(static_cast<uint8_t*>(bytesOut) + numRead);
|
||||
|
||||
if (numRead != chunkSizeToRead)
|
||||
return totalRead;
|
||||
}
|
||||
|
||||
return totalRead;
|
||||
}
|
||||
|
||||
size_t GpFileStream_Win32::Write(const void *bytes, size_t size)
|
||||
{
|
||||
if (!m_writeable)
|
||||
return 0;
|
||||
|
||||
size_t totalWritten = 0;
|
||||
while (size)
|
||||
{
|
||||
const DWORD chunkSizeToWrite = (size > MAXDWORD) ? MAXDWORD : size;
|
||||
DWORD numWritten = 0;
|
||||
|
||||
BOOL writeSucceeded = WriteFile(m_handle, bytes, chunkSizeToWrite, &numWritten, nullptr);
|
||||
#include "GpFileStream_Win32.h"
|
||||
|
||||
GpFileStream_Win32::GpFileStream_Win32(HANDLE handle, bool readable, bool writeable, bool seekable)
|
||||
: m_handle(handle)
|
||||
, m_readable(readable)
|
||||
, m_writeable(writeable)
|
||||
, m_seekable(seekable)
|
||||
{
|
||||
}
|
||||
|
||||
size_t GpFileStream_Win32::Read(void *bytesOut, size_t size)
|
||||
{
|
||||
if (!m_readable)
|
||||
return 0;
|
||||
|
||||
size_t totalRead = 0;
|
||||
while (size)
|
||||
{
|
||||
const DWORD chunkSizeToRead = (size > MAXDWORD) ? MAXDWORD : size;
|
||||
DWORD numRead = 0;
|
||||
|
||||
BOOL readSucceeded = ReadFile(m_handle, bytesOut, chunkSizeToRead, &numRead, nullptr);
|
||||
if (!readSucceeded)
|
||||
return totalRead;
|
||||
|
||||
totalRead += static_cast<size_t>(numRead);
|
||||
size -= static_cast<size_t>(numRead);
|
||||
bytesOut = static_cast<void*>(static_cast<uint8_t*>(bytesOut) + numRead);
|
||||
|
||||
if (numRead != chunkSizeToRead)
|
||||
return totalRead;
|
||||
}
|
||||
|
||||
return totalRead;
|
||||
}
|
||||
|
||||
size_t GpFileStream_Win32::Write(const void *bytes, size_t size)
|
||||
{
|
||||
if (!m_writeable)
|
||||
return 0;
|
||||
|
||||
size_t totalWritten = 0;
|
||||
while (size)
|
||||
{
|
||||
const DWORD chunkSizeToWrite = (size > MAXDWORD) ? MAXDWORD : size;
|
||||
DWORD numWritten = 0;
|
||||
|
||||
BOOL writeSucceeded = WriteFile(m_handle, bytes, chunkSizeToWrite, &numWritten, nullptr);
|
||||
if (!writeSucceeded)
|
||||
{
|
||||
DWORD lastError = GetLastError();
|
||||
DWORD lastError = GetLastError();
|
||||
return totalWritten;
|
||||
}
|
||||
|
||||
totalWritten += static_cast<size_t>(numWritten);
|
||||
size -= static_cast<size_t>(numWritten);
|
||||
bytes = static_cast<const void*>(static_cast<const uint8_t*>(bytes) + numWritten);
|
||||
|
||||
if (numWritten != chunkSizeToWrite)
|
||||
return totalWritten;
|
||||
}
|
||||
|
||||
return totalWritten;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::IsSeekable() const
|
||||
{
|
||||
return m_seekable;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::IsReadOnly() const
|
||||
{
|
||||
return !m_writeable;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::IsWriteOnly() const
|
||||
{
|
||||
return !m_readable;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::SeekStart(PortabilityLayer::UFilePos_t loc)
|
||||
{
|
||||
LARGE_INTEGER li;
|
||||
li.QuadPart = static_cast<LONGLONG>(loc);
|
||||
return SetFilePointerEx(m_handle, li, nullptr, FILE_BEGIN) != 0;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::SeekCurrent(PortabilityLayer::FilePos_t loc)
|
||||
{
|
||||
LARGE_INTEGER li;
|
||||
li.QuadPart = static_cast<LONGLONG>(loc);
|
||||
return SetFilePointerEx(m_handle, li, nullptr, FILE_CURRENT) != 0;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::SeekEnd(PortabilityLayer::UFilePos_t loc)
|
||||
{
|
||||
LARGE_INTEGER li;
|
||||
li.QuadPart = -static_cast<LONGLONG>(loc);
|
||||
return SetFilePointerEx(m_handle, li, nullptr, FILE_END) != 0;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::Truncate(PortabilityLayer::UFilePos_t loc)
|
||||
{
|
||||
if (!m_writeable)
|
||||
return false;
|
||||
|
||||
PortabilityLayer::UFilePos_t oldPos = Tell();
|
||||
if (!SeekStart(loc))
|
||||
return false;
|
||||
|
||||
if (!SetEndOfFile(m_handle))
|
||||
return false;
|
||||
|
||||
if (!SeekStart(oldPos))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
PortabilityLayer::UFilePos_t GpFileStream_Win32::Size() const
|
||||
{
|
||||
LARGE_INTEGER fsize;
|
||||
if (!GetFileSizeEx(m_handle, &fsize))
|
||||
return 0;
|
||||
|
||||
return static_cast<PortabilityLayer::UFilePos_t>(fsize.QuadPart);
|
||||
}
|
||||
|
||||
PortabilityLayer::UFilePos_t GpFileStream_Win32::Tell() const
|
||||
{
|
||||
LARGE_INTEGER zero;
|
||||
zero.QuadPart = 0;
|
||||
|
||||
LARGE_INTEGER fpos;
|
||||
if (!SetFilePointerEx(m_handle, zero, &fpos, FILE_CURRENT))
|
||||
return 0;
|
||||
|
||||
return static_cast<PortabilityLayer::UFilePos_t>(fpos.QuadPart);
|
||||
}
|
||||
|
||||
void GpFileStream_Win32::Close()
|
||||
{
|
||||
CloseHandle(m_handle);
|
||||
}
|
||||
}
|
||||
|
||||
totalWritten += static_cast<size_t>(numWritten);
|
||||
size -= static_cast<size_t>(numWritten);
|
||||
bytes = static_cast<const void*>(static_cast<const uint8_t*>(bytes) + numWritten);
|
||||
|
||||
if (numWritten != chunkSizeToWrite)
|
||||
return totalWritten;
|
||||
}
|
||||
|
||||
return totalWritten;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::IsSeekable() const
|
||||
{
|
||||
return m_seekable;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::IsReadOnly() const
|
||||
{
|
||||
return !m_writeable;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::IsWriteOnly() const
|
||||
{
|
||||
return !m_readable;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::SeekStart(GpUFilePos_t loc)
|
||||
{
|
||||
LARGE_INTEGER li;
|
||||
li.QuadPart = static_cast<LONGLONG>(loc);
|
||||
return SetFilePointerEx(m_handle, li, nullptr, FILE_BEGIN) != 0;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::SeekCurrent(GpFilePos_t loc)
|
||||
{
|
||||
LARGE_INTEGER li;
|
||||
li.QuadPart = static_cast<LONGLONG>(loc);
|
||||
return SetFilePointerEx(m_handle, li, nullptr, FILE_CURRENT) != 0;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::SeekEnd(GpUFilePos_t loc)
|
||||
{
|
||||
LARGE_INTEGER li;
|
||||
li.QuadPart = -static_cast<LONGLONG>(loc);
|
||||
return SetFilePointerEx(m_handle, li, nullptr, FILE_END) != 0;
|
||||
}
|
||||
|
||||
bool GpFileStream_Win32::Truncate(GpUFilePos_t loc)
|
||||
{
|
||||
if (!m_writeable)
|
||||
return false;
|
||||
|
||||
GpUFilePos_t oldPos = Tell();
|
||||
if (!SeekStart(loc))
|
||||
return false;
|
||||
|
||||
if (!SetEndOfFile(m_handle))
|
||||
return false;
|
||||
|
||||
if (!SeekStart(oldPos))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
GpUFilePos_t GpFileStream_Win32::Size() const
|
||||
{
|
||||
LARGE_INTEGER fsize;
|
||||
if (!GetFileSizeEx(m_handle, &fsize))
|
||||
return 0;
|
||||
|
||||
return static_cast<GpUFilePos_t>(fsize.QuadPart);
|
||||
}
|
||||
|
||||
GpUFilePos_t GpFileStream_Win32::Tell() const
|
||||
{
|
||||
LARGE_INTEGER zero;
|
||||
zero.QuadPart = 0;
|
||||
|
||||
LARGE_INTEGER fpos;
|
||||
if (!SetFilePointerEx(m_handle, zero, &fpos, FILE_CURRENT))
|
||||
return 0;
|
||||
|
||||
return static_cast<GpUFilePos_t>(fpos.QuadPart);
|
||||
}
|
||||
|
||||
void GpFileStream_Win32::Close()
|
||||
{
|
||||
CloseHandle(m_handle);
|
||||
}
|
||||
|
||||
void GpFileStream_Win32::Flush()
|
||||
{
|
||||
FlushFileBuffers(m_handle);
|
||||
FlushFileBuffers(m_handle);
|
||||
}
|
||||
|
@@ -1,31 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include "GpCoreDefs.h"
|
||||
#include "GpWindows.h"
|
||||
#include "IOStream.h"
|
||||
|
||||
class GpFileStream_Win32 final : public PortabilityLayer::IOStream
|
||||
{
|
||||
public:
|
||||
explicit GpFileStream_Win32(HANDLE handle, bool readable, bool writeable, bool seekable);
|
||||
|
||||
size_t Read(void *bytesOut, size_t size) override;
|
||||
size_t Write(const void *bytes, size_t size) override;
|
||||
bool IsSeekable() const override;
|
||||
bool IsReadOnly() const override;
|
||||
bool IsWriteOnly() const override;
|
||||
bool SeekStart(PortabilityLayer::UFilePos_t loc) override;
|
||||
bool SeekCurrent(PortabilityLayer::FilePos_t loc) override;
|
||||
bool SeekEnd(PortabilityLayer::UFilePos_t loc) override;
|
||||
bool Truncate(PortabilityLayer::UFilePos_t loc) override;
|
||||
PortabilityLayer::UFilePos_t Size() const override;
|
||||
PortabilityLayer::UFilePos_t Tell() const override;
|
||||
#pragma once
|
||||
|
||||
#include "GpCoreDefs.h"
|
||||
#include "GpWindows.h"
|
||||
#include "GpIOStream.h"
|
||||
|
||||
class GpFileStream_Win32 final : public GpIOStream
|
||||
{
|
||||
public:
|
||||
explicit GpFileStream_Win32(HANDLE handle, bool readable, bool writeable, bool seekable);
|
||||
|
||||
size_t Read(void *bytesOut, size_t size) override;
|
||||
size_t Write(const void *bytes, size_t size) override;
|
||||
bool IsSeekable() const override;
|
||||
bool IsReadOnly() const override;
|
||||
bool IsWriteOnly() const override;
|
||||
bool SeekStart(GpUFilePos_t loc) override;
|
||||
bool SeekCurrent(GpFilePos_t loc) override;
|
||||
bool SeekEnd(GpUFilePos_t loc) override;
|
||||
bool Truncate(GpUFilePos_t loc) override;
|
||||
GpUFilePos_t Size() const override;
|
||||
GpUFilePos_t Tell() const override;
|
||||
void Close() override;
|
||||
void Flush() override;
|
||||
|
||||
private:
|
||||
HANDLE m_handle;
|
||||
bool m_readable;
|
||||
bool m_writeable;
|
||||
bool m_seekable;
|
||||
};
|
||||
void Flush() override;
|
||||
|
||||
private:
|
||||
HANDLE m_handle;
|
||||
bool m_readable;
|
||||
bool m_writeable;
|
||||
bool m_seekable;
|
||||
};
|
||||
|
@@ -210,7 +210,7 @@ bool GpFileSystem_Win32::FileLocked(PortabilityLayer::VirtualDirectory_t virtual
|
||||
return (attribs & FILE_ATTRIBUTE_READONLY) != 0;
|
||||
}
|
||||
|
||||
PortabilityLayer::IOStream *GpFileSystem_Win32::OpenFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool writeAccess, GpFileCreationDisposition_t createDisposition)
|
||||
GpIOStream *GpFileSystem_Win32::OpenFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool writeAccess, GpFileCreationDisposition_t createDisposition)
|
||||
{
|
||||
wchar_t winPath[MAX_PATH + 1];
|
||||
|
||||
|
@@ -14,7 +14,7 @@ public:
|
||||
|
||||
bool FileExists(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path) override;
|
||||
bool FileLocked(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool *exists) override;
|
||||
PortabilityLayer::IOStream *OpenFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool writeAccess, GpFileCreationDisposition_t createDisposition) override;
|
||||
GpIOStream *OpenFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool writeAccess, GpFileCreationDisposition_t createDisposition) override;
|
||||
bool DeleteFile(PortabilityLayer::VirtualDirectory_t virtualDirectory, const char *path, bool &existed) override;
|
||||
PortabilityLayer::HostDirectoryCursor *ScanDirectory(PortabilityLayer::VirtualDirectory_t virtualDirectory) override;
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "GpFileSystem_Win32.h"
|
||||
|
||||
#include "GpApplicationName.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
|
||||
GpLogDriver_Win32::GpLogDriver_Win32()
|
||||
: m_stream(nullptr)
|
||||
|
@@ -1,11 +1,8 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "IGpLogDriver.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
}
|
||||
class GpIOStream;
|
||||
|
||||
class GpLogDriver_Win32 : public IGpLogDriver
|
||||
{
|
||||
@@ -22,7 +19,7 @@ public:
|
||||
private:
|
||||
void InitInternal();
|
||||
|
||||
PortabilityLayer::IOStream *m_stream;
|
||||
GpIOStream *m_stream;
|
||||
bool m_isInitialized;
|
||||
|
||||
static GpLogDriver_Win32 ms_instance;
|
||||
|
@@ -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();
|
||||
|
6
GpCommon/GpFilePos.h
Normal file
6
GpCommon/GpFilePos.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int64_t GpFilePos_t;
|
||||
typedef uint64_t GpUFilePos_t;
|
21
GpCommon/GpIOStream.h
Normal file
21
GpCommon/GpIOStream.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "GpFilePos.h"
|
||||
|
||||
class GpIOStream
|
||||
{
|
||||
public:
|
||||
virtual size_t Read(void *bytesOut, size_t size) = 0;
|
||||
virtual size_t Write(const void *bytes, size_t size) = 0;
|
||||
virtual bool IsSeekable() const = 0;
|
||||
virtual bool IsReadOnly() const = 0;
|
||||
virtual bool IsWriteOnly() const = 0;
|
||||
virtual bool SeekStart(GpUFilePos_t loc) = 0;
|
||||
virtual bool SeekCurrent(GpFilePos_t loc) = 0;
|
||||
virtual bool SeekEnd(GpUFilePos_t loc) = 0;
|
||||
virtual bool Truncate(GpUFilePos_t loc) = 0;
|
||||
virtual GpUFilePos_t Size() const = 0;
|
||||
virtual GpUFilePos_t Tell() const = 0;
|
||||
virtual void Close() = 0;
|
||||
virtual void Flush() = 0;
|
||||
};
|
@@ -2,7 +2,7 @@
|
||||
#include "GpFontHandlerProperties.h"
|
||||
|
||||
#include "CoreDefs.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "HostFont.h"
|
||||
#include "HostFontRenderedGlyph.h"
|
||||
#include "RenderedGlyphMetrics.h"
|
||||
@@ -42,17 +42,17 @@ public:
|
||||
GpFontRenderedGlyph_FreeType2 *Render(uint32_t unicodeCodePoint, unsigned int size, bool aa) override;
|
||||
bool GetLineSpacing(unsigned int size, int32_t &outSpacing) override;
|
||||
|
||||
static GpFont_FreeType2 *Create(const FT_StreamRec_ &streamRec, PortabilityLayer::IOStream *stream);
|
||||
static GpFont_FreeType2 *Create(const FT_StreamRec_ &streamRec, GpIOStream *stream);
|
||||
|
||||
bool FTLoad(const FT_Library &library);
|
||||
|
||||
private:
|
||||
explicit GpFont_FreeType2(const FT_StreamRec_ &streamRec, PortabilityLayer::IOStream *stream);
|
||||
explicit GpFont_FreeType2(const FT_StreamRec_ &streamRec, GpIOStream *stream);
|
||||
~GpFont_FreeType2();
|
||||
|
||||
FT_StreamRec_ m_ftStream;
|
||||
FT_Face m_face;
|
||||
PortabilityLayer::IOStream *m_stream;
|
||||
GpIOStream *m_stream;
|
||||
unsigned int m_currentSize;
|
||||
};
|
||||
|
||||
@@ -247,7 +247,7 @@ bool GpFont_FreeType2::GetLineSpacing(unsigned int size, int32_t &outSpacing)
|
||||
}
|
||||
|
||||
|
||||
GpFont_FreeType2 *GpFont_FreeType2::Create(const FT_StreamRec_ &streamRec, PortabilityLayer::IOStream *stream)
|
||||
GpFont_FreeType2 *GpFont_FreeType2::Create(const FT_StreamRec_ &streamRec, GpIOStream *stream)
|
||||
{
|
||||
void *storage = malloc(sizeof(GpFont_FreeType2));
|
||||
if (!storage)
|
||||
@@ -270,7 +270,7 @@ bool GpFont_FreeType2::FTLoad(const FT_Library &library)
|
||||
return true;
|
||||
}
|
||||
|
||||
GpFont_FreeType2::GpFont_FreeType2(const FT_StreamRec_ &streamRec, PortabilityLayer::IOStream *stream)
|
||||
GpFont_FreeType2::GpFont_FreeType2(const FT_StreamRec_ &streamRec, GpIOStream *stream)
|
||||
: m_face(nullptr)
|
||||
, m_ftStream(streamRec)
|
||||
, m_stream(stream)
|
||||
@@ -303,7 +303,7 @@ GpFontHandler_FreeType2 *GpFontHandler_FreeType2::Create()
|
||||
return fh;
|
||||
}
|
||||
|
||||
PortabilityLayer::HostFont *GpFontHandler_FreeType2::LoadFont(PortabilityLayer::IOStream *stream)
|
||||
PortabilityLayer::HostFont *GpFontHandler_FreeType2::LoadFont(GpIOStream *stream)
|
||||
{
|
||||
FT_StreamRec_ ftStream;
|
||||
memset(&ftStream, 0, sizeof(ftStream));
|
||||
@@ -372,11 +372,11 @@ void *GpFontHandler_FreeType2::FTReallocThunk(FT_Memory memory, long curSize, lo
|
||||
|
||||
unsigned long GpFontHandler_FreeType2::FTStreamIo(FT_Stream stream, unsigned long offset, unsigned char* buffer, unsigned long count)
|
||||
{
|
||||
PortabilityLayer::IOStream *ioStream = static_cast<PortabilityLayer::IOStream*>(stream->descriptor.pointer);
|
||||
GpIOStream *ioStream = static_cast<GpIOStream*>(stream->descriptor.pointer);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
if (!ioStream->SeekStart(static_cast<PortabilityLayer::UFilePos_t>(offset)))
|
||||
if (!ioStream->SeekStart(static_cast<GpUFilePos_t>(offset)))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
@@ -6,16 +6,17 @@
|
||||
#include FT_SYSTEM_H
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
class HostFont;
|
||||
}
|
||||
|
||||
class GpFontHandler_FreeType2 final : public PortabilityLayer::HostFontHandler
|
||||
{
|
||||
public:
|
||||
PortabilityLayer::HostFont *LoadFont(PortabilityLayer::IOStream *stream) override;
|
||||
PortabilityLayer::HostFont *LoadFont(GpIOStream *stream) override;
|
||||
void Shutdown() override;
|
||||
|
||||
bool KeepStreamOpen() const override;
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "BytePack.h"
|
||||
#include "CFileStream.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
|
||||
#include "MacBinary2.h"
|
||||
#include "MacFileMem.h"
|
||||
@@ -142,7 +142,7 @@ int main(int argc, const char **argv)
|
||||
{
|
||||
printf("%i defs parsed...\n", defsParsed);
|
||||
defsParsed++;
|
||||
UFilePos_t defStartOffset = fs.Tell();
|
||||
GpUFilePos_t defStartOffset = fs.Tell();
|
||||
|
||||
char nextChar = 0;
|
||||
if (!FindNextNonWhitespace(fs, nextChar))
|
||||
|
@@ -60,21 +60,25 @@
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
|
@@ -1018,7 +1018,7 @@ public:
|
||||
m_outputIndexStart = firstRow * m_width + firstCol;
|
||||
}
|
||||
|
||||
bool EmitQTContent(IOStream *stream, uint32_t dataSize, bool isCompressed) override
|
||||
bool EmitQTContent(GpIOStream *stream, uint32_t dataSize, bool isCompressed) override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "BinHex4.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <vector>
|
||||
@@ -59,7 +59,7 @@ namespace
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
MacFileMem *BinHex4::LoadHQX(IOStream *stream)
|
||||
MacFileMem *BinHex4::LoadHQX(GpIOStream *stream)
|
||||
{
|
||||
const uint8_t errCodeChar = 64;
|
||||
|
||||
@@ -112,10 +112,10 @@ namespace PortabilityLayer
|
||||
|
||||
if (stream->IsSeekable())
|
||||
{
|
||||
UFilePos_t filePos = stream->Tell();
|
||||
GpUFilePos_t filePos = stream->Tell();
|
||||
if (stream->SeekEnd(0))
|
||||
{
|
||||
UFilePos_t endPos = stream->Tell();
|
||||
GpUFilePos_t endPos = stream->Tell();
|
||||
if (!stream->SeekStart(filePos))
|
||||
return nullptr;
|
||||
|
||||
|
@@ -1,16 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __PL_BINHEX4_H__
|
||||
#define __PL_BINHEX4_H__
|
||||
#define __PL_BINHEX4_H__
|
||||
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
class MacFileMem;
|
||||
|
||||
namespace BinHex4
|
||||
{
|
||||
MacFileMem *LoadHQX(IOStream *stream);
|
||||
MacFileMem *LoadHQX(GpIOStream *stream);
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -49,7 +49,7 @@ namespace PortabilityLayer
|
||||
return m_writeOnly;
|
||||
}
|
||||
|
||||
bool CFileStream::SeekStart(UFilePos_t loc)
|
||||
bool CFileStream::SeekStart(GpUFilePos_t loc)
|
||||
{
|
||||
if (!m_file)
|
||||
return false;
|
||||
@@ -57,7 +57,7 @@ namespace PortabilityLayer
|
||||
return fseek(m_file, static_cast<long>(loc), SEEK_SET) == 0;
|
||||
}
|
||||
|
||||
bool CFileStream::SeekCurrent(FilePos_t loc)
|
||||
bool CFileStream::SeekCurrent(GpFilePos_t loc)
|
||||
{
|
||||
if (!m_file)
|
||||
return false;
|
||||
@@ -65,7 +65,7 @@ namespace PortabilityLayer
|
||||
return fseek(m_file, static_cast<long>(loc), SEEK_CUR) == 0;;
|
||||
}
|
||||
|
||||
bool CFileStream::SeekEnd(UFilePos_t loc)
|
||||
bool CFileStream::SeekEnd(GpUFilePos_t loc)
|
||||
{
|
||||
if (!m_file)
|
||||
return false;
|
||||
@@ -73,17 +73,17 @@ namespace PortabilityLayer
|
||||
return fseek(m_file, static_cast<long>(loc), SEEK_END) == 0;
|
||||
}
|
||||
|
||||
bool CFileStream::Truncate(UFilePos_t loc)
|
||||
bool CFileStream::Truncate(GpUFilePos_t loc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
UFilePos_t CFileStream::Tell() const
|
||||
GpUFilePos_t CFileStream::Tell() const
|
||||
{
|
||||
if (!m_file)
|
||||
return 0;
|
||||
|
||||
return static_cast<UFilePos_t>(ftell(m_file));
|
||||
return static_cast<GpUFilePos_t>(ftell(m_file));
|
||||
}
|
||||
|
||||
void CFileStream::Close()
|
||||
@@ -102,14 +102,14 @@ namespace PortabilityLayer
|
||||
}
|
||||
|
||||
|
||||
UFilePos_t CFileStream::Size() const
|
||||
GpUFilePos_t CFileStream::Size() const
|
||||
{
|
||||
if (!m_file || !m_seekable)
|
||||
return 0;
|
||||
|
||||
long oldPos = ftell(m_file);
|
||||
fseek(m_file, 0, SEEK_END);
|
||||
const UFilePos_t endPos = static_cast<UFilePos_t>(ftell(m_file));
|
||||
const GpUFilePos_t endPos = static_cast<GpUFilePos_t>(ftell(m_file));
|
||||
fseek(m_file, oldPos, SEEK_SET);
|
||||
|
||||
return endPos;
|
||||
|
@@ -6,11 +6,11 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "CoreDefs.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class CFileStream final : public IOStream
|
||||
class CFileStream final : public GpIOStream
|
||||
{
|
||||
public:
|
||||
explicit CFileStream(FILE *f);
|
||||
@@ -21,12 +21,12 @@ namespace PortabilityLayer
|
||||
bool IsSeekable() const override;
|
||||
bool IsReadOnly() const override;
|
||||
bool IsWriteOnly() const override;
|
||||
bool SeekStart(UFilePos_t loc) override;
|
||||
bool SeekCurrent(FilePos_t loc) override;
|
||||
bool SeekEnd(UFilePos_t loc) override;
|
||||
bool Truncate(UFilePos_t loc) override;
|
||||
UFilePos_t Size() const override;
|
||||
UFilePos_t Tell() const override;
|
||||
bool SeekStart(GpUFilePos_t loc) override;
|
||||
bool SeekCurrent(GpFilePos_t loc) override;
|
||||
bool SeekEnd(GpUFilePos_t loc) override;
|
||||
bool Truncate(GpUFilePos_t loc) override;
|
||||
GpUFilePos_t Size() const override;
|
||||
GpUFilePos_t Tell() const override;
|
||||
void Close() override;
|
||||
void Flush() override;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "DeflateCodec.h"
|
||||
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "MemoryManager.h"
|
||||
|
||||
#include "zlib.h"
|
||||
@@ -20,7 +20,7 @@ namespace
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
bool DeflateCodec::DecompressStream(IOStream *stream, size_t inSize, void *outBuffer, size_t outSize)
|
||||
bool DeflateCodec::DecompressStream(GpIOStream *stream, size_t inSize, void *outBuffer, size_t outSize)
|
||||
{
|
||||
z_stream zstream;
|
||||
zstream.zalloc = ZlibAllocShim;
|
||||
|
@@ -2,13 +2,13 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
|
||||
class DeflateCodec
|
||||
{
|
||||
public:
|
||||
static bool DecompressStream(IOStream *stream, size_t inSize, void *outBuffer, size_t outSize);
|
||||
static bool DecompressStream(GpIOStream *stream, size_t inSize, void *outBuffer, size_t outSize);
|
||||
};
|
||||
}
|
||||
|
@@ -26,12 +26,12 @@ namespace PortabilityLayer
|
||||
PLError_t CreateFile(VirtualDirectory_t dirID, const PLPasStr &filename, const MacFileProperties &mfp) override;
|
||||
PLError_t CreateFileAtCurrentTime(VirtualDirectory_t dirID, const PLPasStr &filename, const ResTypeID &fileCreator, const ResTypeID &fileType) override;
|
||||
|
||||
PLError_t OpenFileData(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, IOStream *&outRefNum) override;
|
||||
PLError_t OpenFileResources(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, IOStream *&outRefNum) override;
|
||||
PLError_t OpenFileData(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, GpIOStream *&outRefNum) override;
|
||||
PLError_t OpenFileResources(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, GpIOStream *&outRefNum) override;
|
||||
bool ReadFileProperties(VirtualDirectory_t dirID, const PLPasStr &filename, MacFileProperties &properties) override;
|
||||
|
||||
PLError_t RawOpenFileData(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, bool ignoreMeta, GpFileCreationDisposition_t creationDisposition, IOStream *&outStream) override;
|
||||
PLError_t RawOpenFileResources(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, bool ignoreMeta, GpFileCreationDisposition_t creationDisposition, IOStream *&outStream) override;
|
||||
PLError_t RawOpenFileData(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, bool ignoreMeta, GpFileCreationDisposition_t creationDisposition, GpIOStream *&outStream) override;
|
||||
PLError_t RawOpenFileResources(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, bool ignoreMeta, GpFileCreationDisposition_t creationDisposition, GpIOStream *&outStream) override;
|
||||
|
||||
bool PromptSaveFile(VirtualDirectory_t dirID, char *path, size_t &outPathLength, size_t pathCapacity, const PLPasStr &initialFileName) override;
|
||||
bool PromptOpenFile(VirtualDirectory_t dirID, char *path, size_t &outPathLength, size_t pathCapacity) override;
|
||||
@@ -41,8 +41,8 @@ namespace PortabilityLayer
|
||||
private:
|
||||
typedef char ExtendedFileName_t[64 + 4];
|
||||
|
||||
PLError_t OpenFileFork(VirtualDirectory_t dirID, const PLPasStr &filename, const char *ext, EFilePermission permission, IOStream *&outRefNum);
|
||||
PLError_t RawOpenFileFork(VirtualDirectory_t dirID, const PLPasStr &filename, const char *ext, EFilePermission permission, bool ignoreMeta, GpFileCreationDisposition_t createDisposition, IOStream *&outStream);
|
||||
PLError_t OpenFileFork(VirtualDirectory_t dirID, const PLPasStr &filename, const char *ext, EFilePermission permission, GpIOStream *&outRefNum);
|
||||
PLError_t RawOpenFileFork(VirtualDirectory_t dirID, const PLPasStr &filename, const char *ext, EFilePermission permission, bool ignoreMeta, GpFileCreationDisposition_t createDisposition, GpIOStream *&outStream);
|
||||
|
||||
static bool ConstructFilename(ExtendedFileName_t& extFN, const PLPasStr &fn, const char *extension);
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace PortabilityLayer
|
||||
if (!ConstructFilename(extFN, filename, ".gpf"))
|
||||
return PLErrors::kBadFileName;
|
||||
|
||||
IOStream *stream = nullptr;
|
||||
GpIOStream *stream = nullptr;
|
||||
PLError_t err = RawOpenFileFork(dirID, filename, ".gpf", EFilePermission_Write, true, GpFileCreationDispositions::kCreateOrOverwrite, stream);
|
||||
if (err)
|
||||
return err;
|
||||
@@ -137,19 +137,19 @@ namespace PortabilityLayer
|
||||
return CreateFile(dirID, filename, mfp);
|
||||
}
|
||||
|
||||
PLError_t FileManagerImpl::OpenFileData(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission permission, IOStream *&outStream)
|
||||
PLError_t FileManagerImpl::OpenFileData(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission permission, GpIOStream *&outStream)
|
||||
{
|
||||
return OpenFileFork(dirID, filename, ".gpd", permission, outStream);
|
||||
}
|
||||
|
||||
PLError_t FileManagerImpl::OpenFileResources(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission permission, IOStream *&outStream)
|
||||
PLError_t FileManagerImpl::OpenFileResources(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission permission, GpIOStream *&outStream)
|
||||
{
|
||||
return OpenFileFork(dirID, filename, ".gpa", permission, outStream);
|
||||
}
|
||||
|
||||
bool FileManagerImpl::ReadFileProperties(VirtualDirectory_t dirID, const PLPasStr &filename, MacFileProperties &properties)
|
||||
{
|
||||
IOStream *stream = nullptr;
|
||||
GpIOStream *stream = nullptr;
|
||||
PLError_t err = RawOpenFileFork(dirID, filename, ".gpf", EFilePermission_Read, true, GpFileCreationDispositions::kOpenExisting, stream);
|
||||
if (err)
|
||||
return false;
|
||||
@@ -164,12 +164,12 @@ namespace PortabilityLayer
|
||||
return readOk;
|
||||
}
|
||||
|
||||
PLError_t FileManagerImpl::RawOpenFileData(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission permission, bool ignoreMeta, GpFileCreationDisposition_t createDisposition, IOStream *&outStream)
|
||||
PLError_t FileManagerImpl::RawOpenFileData(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission permission, bool ignoreMeta, GpFileCreationDisposition_t createDisposition, GpIOStream *&outStream)
|
||||
{
|
||||
return RawOpenFileFork(dirID, filename, ".gpd", permission, ignoreMeta, createDisposition, outStream);
|
||||
}
|
||||
|
||||
PLError_t FileManagerImpl::RawOpenFileResources(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission permission, bool ignoreMeta, GpFileCreationDisposition_t createDisposition, IOStream *&outStream)
|
||||
PLError_t FileManagerImpl::RawOpenFileResources(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission permission, bool ignoreMeta, GpFileCreationDisposition_t createDisposition, GpIOStream *&outStream)
|
||||
{
|
||||
return RawOpenFileFork(dirID, filename, ".gpa", permission, ignoreMeta, createDisposition, outStream);
|
||||
}
|
||||
@@ -193,11 +193,11 @@ namespace PortabilityLayer
|
||||
return &ms_instance;
|
||||
}
|
||||
|
||||
PLError_t FileManagerImpl::OpenFileFork(VirtualDirectory_t dirID, const PLPasStr &filename, const char *extension, EFilePermission permission, IOStream *&outStream)
|
||||
PLError_t FileManagerImpl::OpenFileFork(VirtualDirectory_t dirID, const PLPasStr &filename, const char *extension, EFilePermission permission, GpIOStream *&outStream)
|
||||
{
|
||||
bool isWriteAccess = (permission == EFilePermission_Any || permission == EFilePermission_ReadWrite || permission == EFilePermission_Write);
|
||||
GpFileCreationDisposition_t createDisposition = isWriteAccess ? GpFileCreationDispositions::kCreateOrOpen : GpFileCreationDispositions::kOpenExisting;
|
||||
IOStream *stream = nullptr;
|
||||
GpIOStream *stream = nullptr;
|
||||
PLError_t openError = RawOpenFileFork(dirID, filename, extension, permission, false, createDisposition, stream);
|
||||
if (openError != PLErrors::kNone)
|
||||
return openError;
|
||||
@@ -207,7 +207,7 @@ namespace PortabilityLayer
|
||||
return PLErrors::kNone;
|
||||
}
|
||||
|
||||
PLError_t FileManagerImpl::RawOpenFileFork(VirtualDirectory_t dirID, const PLPasStr &filename, const char *ext, EFilePermission permission, bool ignoreMeta, GpFileCreationDisposition_t createDisposition, IOStream *&outStream)
|
||||
PLError_t FileManagerImpl::RawOpenFileFork(VirtualDirectory_t dirID, const PLPasStr &filename, const char *ext, EFilePermission permission, bool ignoreMeta, GpFileCreationDisposition_t createDisposition, GpIOStream *&outStream)
|
||||
{
|
||||
ExtendedFileName_t gpfExtFN;
|
||||
ExtendedFileName_t extFN;
|
||||
@@ -227,7 +227,7 @@ namespace PortabilityLayer
|
||||
if (!ConstructFilename(extFN, filename, ext))
|
||||
return PLErrors::kBadFileName;
|
||||
|
||||
IOStream *fstream = nullptr;
|
||||
GpIOStream *fstream = nullptr;
|
||||
switch (permission)
|
||||
{
|
||||
case EFilePermission_Any:
|
||||
|
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "FilePermission.h"
|
||||
#include "CoreDefs.h"
|
||||
#include "FilePos.h"
|
||||
#include "GpFileCreationDisposition.h"
|
||||
#include "PLErrorCodes.h"
|
||||
#include "VirtualDirectory.h"
|
||||
@@ -11,9 +10,10 @@
|
||||
|
||||
class PLPasStr;
|
||||
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
class ResTypeID;
|
||||
struct MacFileProperties;
|
||||
|
||||
@@ -28,12 +28,12 @@ namespace PortabilityLayer
|
||||
virtual PLError_t CreateFileAtCurrentTime(VirtualDirectory_t dirID, const PLPasStr &filename, const ResTypeID &fileCreator, const ResTypeID &fileType) = 0;
|
||||
|
||||
// OpenFileData + OpenFileResources require that the file already exists (i.e. has a .gpf), but the fork may not
|
||||
virtual PLError_t OpenFileData(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, IOStream *&outStream) = 0;
|
||||
virtual PLError_t OpenFileResources(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, IOStream *&outStream) = 0;
|
||||
virtual PLError_t OpenFileData(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, GpIOStream *&outStream) = 0;
|
||||
virtual PLError_t OpenFileResources(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, GpIOStream *&outStream) = 0;
|
||||
virtual bool ReadFileProperties(VirtualDirectory_t dirID, const PLPasStr &filename, MacFileProperties &properties) = 0;
|
||||
|
||||
virtual PLError_t RawOpenFileData(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, bool ignoreMeta, GpFileCreationDisposition_t createDisposition, IOStream *&outStream) = 0;
|
||||
virtual PLError_t RawOpenFileResources(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, bool ignoreMeta, GpFileCreationDisposition_t createDisposition, IOStream *&outStream) = 0;
|
||||
virtual PLError_t RawOpenFileData(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, bool ignoreMeta, GpFileCreationDisposition_t createDisposition, GpIOStream *&outStream) = 0;
|
||||
virtual PLError_t RawOpenFileResources(VirtualDirectory_t dirID, const PLPasStr &filename, EFilePermission filePermission, bool ignoreMeta, GpFileCreationDisposition_t createDisposition, GpIOStream *&outStream) = 0;
|
||||
|
||||
virtual bool PromptSaveFile(VirtualDirectory_t dirID, char *path, size_t &outPathLength, size_t pathCapacity, const PLPasStr &initialFileName) = 0;
|
||||
virtual bool PromptOpenFile(VirtualDirectory_t dirID, char *path, size_t &outPathLength, size_t pathCapacity) = 0;
|
||||
|
@@ -1,9 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
typedef int64_t FilePos_t;
|
||||
typedef uint64_t UFilePos_t;
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
#include "FontFamily.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "HostFileSystem.h"
|
||||
#include "HostFontHandler.h"
|
||||
#include "HostFont.h"
|
||||
@@ -11,7 +11,7 @@ namespace PortabilityLayer
|
||||
{
|
||||
void FontFamily::AddFont(int flags, const char *path, FontHacks fontHacks)
|
||||
{
|
||||
PortabilityLayer::IOStream *sysFontStream = PortabilityLayer::HostFileSystem::GetInstance()->OpenFile(PortabilityLayer::VirtualDirectories::kFonts, path, false, GpFileCreationDispositions::kOpenExisting);
|
||||
GpIOStream *sysFontStream = PortabilityLayer::HostFileSystem::GetInstance()->OpenFile(PortabilityLayer::VirtualDirectories::kFonts, path, false, GpFileCreationDispositions::kOpenExisting);
|
||||
if (!sysFontStream)
|
||||
return;
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#include "HostFileSystem.h"
|
||||
#include "HostFont.h"
|
||||
#include "HostFontHandler.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "RenderedFont.h"
|
||||
|
||||
#include <string.h>
|
||||
|
@@ -5,9 +5,10 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
class HostDirectoryCursor;
|
||||
|
||||
class HostFileSystem
|
||||
@@ -15,7 +16,7 @@ namespace PortabilityLayer
|
||||
public:
|
||||
virtual bool FileExists(VirtualDirectory_t virtualDirectory, const char *path) = 0;
|
||||
virtual bool FileLocked(VirtualDirectory_t virtualDirectory, const char *path, bool *exists) = 0;
|
||||
virtual IOStream *OpenFile(VirtualDirectory_t virtualDirectory, const char *path, bool writeAccess, GpFileCreationDisposition_t createDisposition) = 0;
|
||||
virtual GpIOStream *OpenFile(VirtualDirectory_t virtualDirectory, const char *path, bool writeAccess, GpFileCreationDisposition_t createDisposition) = 0;
|
||||
virtual bool DeleteFile(VirtualDirectory_t virtualDirectory, const char *path, bool &existed) = 0;
|
||||
virtual HostDirectoryCursor *ScanDirectory(VirtualDirectory_t virtualDirectory) = 0;
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
class HostFont;
|
||||
|
||||
class HostFontHandler
|
||||
@@ -11,7 +11,7 @@ namespace PortabilityLayer
|
||||
public:
|
||||
virtual void Shutdown() = 0;
|
||||
|
||||
virtual HostFont *LoadFont(IOStream *stream) = 0;
|
||||
virtual HostFont *LoadFont(GpIOStream *stream) = 0;
|
||||
virtual bool KeepStreamOpen() const = 0;
|
||||
|
||||
static void SetInstance(HostFontHandler *instance);
|
||||
|
@@ -1,30 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __PL_IOTREAM_H__
|
||||
#define __PL_IOTREAM_H__
|
||||
|
||||
#include "DataTypes.h"
|
||||
#include "FilePos.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream
|
||||
{
|
||||
public:
|
||||
virtual size_t Read(void *bytesOut, size_t size) = 0;
|
||||
virtual size_t Write(const void *bytes, size_t size) = 0;
|
||||
virtual bool IsSeekable() const = 0;
|
||||
virtual bool IsReadOnly() const = 0;
|
||||
virtual bool IsWriteOnly() const = 0;
|
||||
virtual bool SeekStart(UFilePos_t loc) = 0;
|
||||
virtual bool SeekCurrent(FilePos_t loc) = 0;
|
||||
virtual bool SeekEnd(UFilePos_t loc) = 0;
|
||||
virtual bool Truncate(UFilePos_t loc) = 0;
|
||||
virtual UFilePos_t Size() const = 0;
|
||||
virtual UFilePos_t Tell() const = 0;
|
||||
virtual void Close() = 0;
|
||||
virtual void Flush() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
@@ -3,7 +3,7 @@
|
||||
#include "BytePack.h"
|
||||
#include "ByteUnpack.h"
|
||||
#include "DataTypes.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "MacFileMem.h"
|
||||
#include "XModemCRC.h"
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
void MacBinary2::WriteBin(const MacFileMem *file, IOStream *stream)
|
||||
void MacBinary2::WriteBin(const MacFileMem *file, GpIOStream *stream)
|
||||
{
|
||||
const MacFileInfo &fileInfo = file->FileInfo();
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace PortabilityLayer
|
||||
stream->Write(padding, resourceForkPadding);
|
||||
}
|
||||
|
||||
MacFileMem *MacBinary2::ReadBin(IOStream *stream)
|
||||
MacFileMem *MacBinary2::ReadBin(GpIOStream *stream)
|
||||
{
|
||||
MacFileInfo fileInfo;
|
||||
|
||||
|
@@ -1,17 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __PL_MACBINARY2_H__
|
||||
#define __PL_MACBINARY2_H__
|
||||
#define __PL_MACBINARY2_H__
|
||||
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
class MacFileMem;
|
||||
|
||||
namespace MacBinary2
|
||||
{
|
||||
void WriteBin(const MacFileMem *file, IOStream *stream);
|
||||
MacFileMem *ReadBin(IOStream *stream);
|
||||
void WriteBin(const MacFileMem *file, GpIOStream *stream);
|
||||
MacFileMem *ReadBin(GpIOStream *stream);
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -48,7 +48,7 @@ namespace PortabilityLayer
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MemReaderStream::SeekStart(UFilePos_t loc)
|
||||
bool MemReaderStream::SeekStart(GpUFilePos_t loc)
|
||||
{
|
||||
if (loc > m_size)
|
||||
m_loc = m_size;
|
||||
@@ -58,28 +58,28 @@ namespace PortabilityLayer
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MemReaderStream::SeekCurrent(FilePos_t loc)
|
||||
bool MemReaderStream::SeekCurrent(GpFilePos_t loc)
|
||||
{
|
||||
if (loc < 0)
|
||||
{
|
||||
if (static_cast<FilePos_t>(m_loc) + loc < 0)
|
||||
if (static_cast<GpFilePos_t>(m_loc) + loc < 0)
|
||||
m_loc = 0;
|
||||
else
|
||||
m_loc = static_cast<size_t>(static_cast<FilePos_t>(m_loc) + loc);
|
||||
m_loc = static_cast<size_t>(static_cast<GpFilePos_t>(m_loc) + loc);
|
||||
}
|
||||
else
|
||||
{
|
||||
const size_t available = m_size - m_loc;
|
||||
if (static_cast<UFilePos_t>(loc) > available)
|
||||
if (static_cast<GpUFilePos_t>(loc) > available)
|
||||
m_loc = m_size;
|
||||
else
|
||||
m_loc = static_cast<size_t>(static_cast<FilePos_t>(m_loc) + loc);
|
||||
m_loc = static_cast<size_t>(static_cast<GpFilePos_t>(m_loc) + loc);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MemReaderStream::SeekEnd(UFilePos_t loc)
|
||||
bool MemReaderStream::SeekEnd(GpUFilePos_t loc)
|
||||
{
|
||||
if (m_size < loc)
|
||||
m_loc = 0;
|
||||
@@ -89,19 +89,19 @@ namespace PortabilityLayer
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MemReaderStream::Truncate(UFilePos_t loc)
|
||||
bool MemReaderStream::Truncate(GpUFilePos_t loc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
UFilePos_t MemReaderStream::Size() const
|
||||
GpUFilePos_t MemReaderStream::Size() const
|
||||
{
|
||||
return m_size;
|
||||
}
|
||||
|
||||
UFilePos_t MemReaderStream::Tell() const
|
||||
GpUFilePos_t MemReaderStream::Tell() const
|
||||
{
|
||||
return static_cast<UFilePos_t>(m_loc);
|
||||
return static_cast<GpUFilePos_t>(m_loc);
|
||||
}
|
||||
|
||||
void MemReaderStream::Close()
|
||||
|
@@ -3,11 +3,11 @@
|
||||
#define __PL_MEM_READER_STREAM_H__
|
||||
|
||||
#include "CoreDefs.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class MemReaderStream final : public IOStream
|
||||
class MemReaderStream final : public GpIOStream
|
||||
{
|
||||
public:
|
||||
MemReaderStream(const void *memStream, size_t size);
|
||||
@@ -17,12 +17,12 @@ namespace PortabilityLayer
|
||||
bool IsSeekable() const override;
|
||||
bool IsReadOnly() const override;
|
||||
bool IsWriteOnly() const override;
|
||||
bool SeekStart(UFilePos_t loc) override;
|
||||
bool SeekCurrent(FilePos_t loc) override;
|
||||
bool SeekEnd(UFilePos_t loc) override;
|
||||
bool Truncate(UFilePos_t loc) override;
|
||||
UFilePos_t Size() const override;
|
||||
UFilePos_t Tell() const override;
|
||||
bool SeekStart(GpUFilePos_t loc) override;
|
||||
bool SeekCurrent(GpFilePos_t loc) override;
|
||||
bool SeekEnd(GpUFilePos_t loc) override;
|
||||
bool Truncate(GpUFilePos_t loc) override;
|
||||
GpUFilePos_t Size() const override;
|
||||
GpUFilePos_t Tell() const override;
|
||||
void Close() override;
|
||||
void Flush() override;
|
||||
|
||||
|
@@ -430,7 +430,7 @@ DirectoryFileListEntry *GetDirectoryFiles(PortabilityLayer::VirtualDirectory_t d
|
||||
if (!strcmp(&filename[fnLen - 4], ".gpf"))
|
||||
{
|
||||
const size_t dotPos = fnLen - 4;
|
||||
PortabilityLayer::IOStream *stream = fs->OpenFile(dirID, filename, false, GpFileCreationDispositions::kOpenExisting);
|
||||
GpIOStream *stream = fs->OpenFile(dirID, filename, false, GpFileCreationDispositions::kOpenExisting);
|
||||
if (!stream)
|
||||
continue;
|
||||
|
||||
|
@@ -16,6 +16,7 @@
|
||||
template<class T>
|
||||
class ArrayView;
|
||||
struct IGpCursor;
|
||||
class GpIOStream;
|
||||
struct GpVOSEvent;
|
||||
struct GpMouseInputEvent;
|
||||
struct TimeTaggedVOSEvent;
|
||||
@@ -24,7 +25,6 @@ struct TimeTaggedVOSEvent;
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
struct MMHandleBlock;
|
||||
class IOStream;
|
||||
class Widget;
|
||||
struct Vec2i;
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#include "GPArchive.h"
|
||||
#include "HostFileSystem.h"
|
||||
#include "HostMemoryBuffer.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "MacBinary2.h"
|
||||
#include "MacFileMem.h"
|
||||
#include "MemReaderStream.h"
|
||||
@@ -169,7 +169,7 @@ namespace PortabilityLayer
|
||||
|
||||
ResourceArchive *ResourceManagerImpl::LoadResFile(VirtualDirectory_t virtualDir, const PLPasStr &filename) const
|
||||
{
|
||||
IOStream *fStream = nullptr;
|
||||
GpIOStream *fStream = nullptr;
|
||||
if (FileManager::GetInstance()->RawOpenFileResources(virtualDir, filename, EFilePermission_Read, true, GpFileCreationDispositions::kOpenExisting, fStream) != PLErrors::kNone)
|
||||
return nullptr;
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace PortabilityLayer
|
||||
|
||||
PLError_t ResourceManagerImpl::CreateBlankResFile(VirtualDirectory_t virtualDir, const PLPasStr &filename)
|
||||
{
|
||||
PortabilityLayer::IOStream *stream = nullptr;
|
||||
GpIOStream *stream = nullptr;
|
||||
PLError_t error = FileManager::GetInstance()->RawOpenFileResources(virtualDir, filename, EFilePermission_Write, true, GpFileCreationDispositions::kCreateOrOverwrite, stream);
|
||||
if (error)
|
||||
return error;
|
||||
@@ -245,7 +245,7 @@ namespace PortabilityLayer
|
||||
{
|
||||
}
|
||||
|
||||
ResourceArchive *ResourceArchive::Create(ZipFileProxy *zipFileProxy, IOStream *stream)
|
||||
ResourceArchive *ResourceArchive::Create(ZipFileProxy *zipFileProxy, GpIOStream *stream)
|
||||
{
|
||||
PortabilityLayer::MemoryManager *mm = PortabilityLayer::MemoryManager::GetInstance();
|
||||
|
||||
@@ -485,7 +485,7 @@ namespace PortabilityLayer
|
||||
return THandle<void>(handle);
|
||||
}
|
||||
|
||||
ResourceArchive::ResourceArchive(ZipFileProxy *zipFileProxy, IOStream *stream, ResourceArchiveRef *resourceHandles)
|
||||
ResourceArchive::ResourceArchive(ZipFileProxy *zipFileProxy, GpIOStream *stream, ResourceArchiveRef *resourceHandles)
|
||||
: m_zipFileProxy(zipFileProxy)
|
||||
, m_stream(stream)
|
||||
, m_resourceHandles(resourceHandles)
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#include "QDPictHeader.h"
|
||||
#include "QDPictOpcodes.h"
|
||||
#include "QDPictEmitScanlineParameters.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "RGBAColor.h"
|
||||
#include "Vec2i.h"
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace PortabilityLayer
|
||||
{
|
||||
}
|
||||
|
||||
bool QDPictDecoder::DecodePict(IOStream *stream, QDPictEmitContext *emitContext)
|
||||
bool QDPictDecoder::DecodePict(GpIOStream *stream, QDPictEmitContext *emitContext)
|
||||
{
|
||||
QDPictHeader header;
|
||||
QDPictDecodeState decodeState;
|
||||
@@ -288,7 +288,7 @@ namespace PortabilityLayer
|
||||
}
|
||||
}
|
||||
|
||||
int QDPictDecoder::ProcessRasterOp(IOStream *stream, int pictVersion, bool isPackedFlag, bool hasRegion, bool isDirect, const Rect &constraintRect, const Point &origin, QDPictEmitContext *context)
|
||||
int QDPictDecoder::ProcessRasterOp(GpIOStream *stream, int pictVersion, bool isPackedFlag, bool hasRegion, bool isDirect, const Rect &constraintRect, const Point &origin, QDPictEmitContext *context)
|
||||
{
|
||||
uint16_t rowSizeBytes = 0;
|
||||
|
||||
|
@@ -1,27 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct Rect;
|
||||
struct Point;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
class QDPictEmitContext;
|
||||
|
||||
class QDPictDecoder
|
||||
{
|
||||
public:
|
||||
QDPictDecoder();
|
||||
|
||||
bool DecodePict(IOStream *stream, QDPictEmitContext *emitContext);
|
||||
|
||||
private:
|
||||
int ProcessRasterOp(IOStream *stream, int pictVersion, bool isPackedFlag, bool hasRegion, bool isDirect, const Rect &drawArea, const Point &origin, QDPictEmitContext *context);
|
||||
struct Point;
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class QDPictEmitContext;
|
||||
|
||||
class QDPictDecoder
|
||||
{
|
||||
public:
|
||||
QDPictDecoder();
|
||||
|
||||
bool DecodePict(GpIOStream *stream, QDPictEmitContext *emitContext);
|
||||
|
||||
private:
|
||||
int ProcessRasterOp(GpIOStream *stream, int pictVersion, bool isPackedFlag, bool hasRegion, bool isDirect, const Rect &drawArea, const Point &origin, QDPictEmitContext *context);
|
||||
static bool UnpackBits8(uint8_t *dest, size_t destSize, const uint8_t *src, size_t srcSize);
|
||||
static bool UnpackBits16(uint8_t *dest, size_t destSize, const uint8_t *src, size_t srcSize);
|
||||
|
||||
IOStream *m_stream;
|
||||
};
|
||||
}
|
||||
static bool UnpackBits16(uint8_t *dest, size_t destSize, const uint8_t *src, size_t srcSize);
|
||||
|
||||
GpIOStream *m_stream;
|
||||
};
|
||||
}
|
||||
|
@@ -2,13 +2,13 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct Rect;
|
||||
struct Rect;
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
struct RGBAColor;
|
||||
struct QDPictEmitScanlineParameters;
|
||||
class IOStream;
|
||||
struct QDPictEmitScanlineParameters;
|
||||
|
||||
enum QDPictBlitSourceType
|
||||
{
|
||||
@@ -44,7 +44,7 @@ namespace PortabilityLayer
|
||||
virtual Rect ConstrainRegion(const Rect &rect) const = 0;
|
||||
virtual void Start(QDPictBlitSourceType sourceType, const QDPictEmitScanlineParameters ¶ms) = 0;
|
||||
virtual void BlitScanlineAndAdvance(const void *) = 0;
|
||||
virtual bool EmitQTContent(IOStream *stream, uint32_t dataSize, bool isCompressed) = 0;
|
||||
virtual bool EmitQTContent(GpIOStream *stream, uint32_t dataSize, bool isCompressed) = 0;
|
||||
virtual bool AllocTempBuffers(uint8_t *&buffer1, size_t buffer1Size, uint8_t *&buffer2, size_t buffer2Size) = 0;
|
||||
|
||||
virtual void ReportError(int errorType, int errorSubtype) { }
|
||||
|
@@ -1,77 +1,77 @@
|
||||
#include "QDPictHeader.h"
|
||||
#include "IOStream.h"
|
||||
#include "SharedTypes.h"
|
||||
#include "CoreDefs.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
QDPictHeader::QDPictHeader()
|
||||
: m_pictVersion(0)
|
||||
{
|
||||
}
|
||||
|
||||
bool QDPictHeader::Load(IOStream *stream)
|
||||
#include "QDPictHeader.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "SharedTypes.h"
|
||||
#include "CoreDefs.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
QDPictHeader::QDPictHeader()
|
||||
: m_pictVersion(0)
|
||||
{
|
||||
}
|
||||
|
||||
bool QDPictHeader::Load(GpIOStream *stream)
|
||||
{
|
||||
struct PictHeader
|
||||
{
|
||||
{
|
||||
uint8_t m_size[2];
|
||||
|
||||
BERect m_rect;
|
||||
BERect m_rect;
|
||||
};
|
||||
|
||||
GP_STATIC_ASSERT(sizeof(PictHeader) == 10);
|
||||
|
||||
PictHeader pictHeader;
|
||||
if (stream->Read(&pictHeader, sizeof(PictHeader)) != sizeof(PictHeader))
|
||||
return false;
|
||||
|
||||
m_frame = pictHeader.m_rect.ToRect();
|
||||
if (!m_frame.IsValid())
|
||||
return false;
|
||||
|
||||
uint8_t versionTag1[2];
|
||||
if (stream->Read(versionTag1, 2) != 2)
|
||||
return false;
|
||||
|
||||
if (versionTag1[0] == 0x11 && versionTag1[1] == 0x01)
|
||||
{
|
||||
m_pictVersion = 1;
|
||||
}
|
||||
else if (versionTag1[0] == 0x00 && versionTag1[1] == 0x11)
|
||||
{
|
||||
m_pictVersion = 2;
|
||||
|
||||
uint8_t v2Header[28];
|
||||
if (stream->Read(v2Header, 28) != 28)
|
||||
return false;
|
||||
|
||||
if (v2Header[0] != 0x02 || v2Header[1] != 0xff || v2Header[2] != 0x0c || v2Header[3] != 0x00)
|
||||
return false;
|
||||
|
||||
BEInt16_t v2Version;
|
||||
memcpy(&v2Version, v2Header + 4, 2);
|
||||
|
||||
// In version 2 header, v2Version == -1
|
||||
// Followed by fixed-point bounding rectangle (16 bytes) and 4 reserved
|
||||
// In ext. version 2 header, v2Version == -2
|
||||
// Followed by 2-byte reserved, horizontal DPI (fixed point, 4 bytes), vertical DPI (fixed point, 4 bytes) optimal source rect (8 bytes), and 2 reserved
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int QDPictHeader::GetVersion() const
|
||||
{
|
||||
return m_pictVersion;
|
||||
}
|
||||
|
||||
const Rect &QDPictHeader::GetFrame() const
|
||||
{
|
||||
return m_frame;
|
||||
}
|
||||
|
||||
GP_STATIC_ASSERT(sizeof(PictHeader) == 10);
|
||||
|
||||
PictHeader pictHeader;
|
||||
if (stream->Read(&pictHeader, sizeof(PictHeader)) != sizeof(PictHeader))
|
||||
return false;
|
||||
|
||||
m_frame = pictHeader.m_rect.ToRect();
|
||||
if (!m_frame.IsValid())
|
||||
return false;
|
||||
|
||||
uint8_t versionTag1[2];
|
||||
if (stream->Read(versionTag1, 2) != 2)
|
||||
return false;
|
||||
|
||||
if (versionTag1[0] == 0x11 && versionTag1[1] == 0x01)
|
||||
{
|
||||
m_pictVersion = 1;
|
||||
}
|
||||
else if (versionTag1[0] == 0x00 && versionTag1[1] == 0x11)
|
||||
{
|
||||
m_pictVersion = 2;
|
||||
|
||||
uint8_t v2Header[28];
|
||||
if (stream->Read(v2Header, 28) != 28)
|
||||
return false;
|
||||
|
||||
if (v2Header[0] != 0x02 || v2Header[1] != 0xff || v2Header[2] != 0x0c || v2Header[3] != 0x00)
|
||||
return false;
|
||||
|
||||
BEInt16_t v2Version;
|
||||
memcpy(&v2Version, v2Header + 4, 2);
|
||||
|
||||
// In version 2 header, v2Version == -1
|
||||
// Followed by fixed-point bounding rectangle (16 bytes) and 4 reserved
|
||||
// In ext. version 2 header, v2Version == -2
|
||||
// Followed by 2-byte reserved, horizontal DPI (fixed point, 4 bytes), vertical DPI (fixed point, 4 bytes) optimal source rect (8 bytes), and 2 reserved
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int QDPictHeader::GetVersion() const
|
||||
{
|
||||
return m_pictVersion;
|
||||
}
|
||||
|
||||
const Rect &QDPictHeader::GetFrame() const
|
||||
{
|
||||
return m_frame;
|
||||
}
|
||||
}
|
||||
|
@@ -1,17 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include "SharedTypes.h"
|
||||
#include "SharedTypes.h"
|
||||
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
|
||||
class QDPictHeader
|
||||
{
|
||||
public:
|
||||
QDPictHeader();
|
||||
bool Load(IOStream *stream);
|
||||
bool Load(GpIOStream *stream);
|
||||
|
||||
int GetVersion() const;
|
||||
const Rect &GetFrame() const;
|
||||
|
@@ -38,7 +38,7 @@ namespace PortabilityLayer
|
||||
delete[] m_compiledTypeListBlob;
|
||||
}
|
||||
|
||||
bool ResourceFile::Load(IOStream *stream)
|
||||
bool ResourceFile::Load(GpIOStream *stream)
|
||||
{
|
||||
struct ResourceHeader
|
||||
{
|
||||
@@ -48,7 +48,7 @@ namespace PortabilityLayer
|
||||
uint32_t m_resMapSize;
|
||||
};
|
||||
|
||||
const UFilePos_t streamSize = stream->Size();
|
||||
const GpUFilePos_t streamSize = stream->Size();
|
||||
if (streamSize > UINT32_MAX)
|
||||
return false;
|
||||
|
||||
|
@@ -4,9 +4,10 @@
|
||||
#include "ResTypeID.h"
|
||||
#include <stdint.h>
|
||||
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
class MacFileMem;
|
||||
struct MMHandleBlock;
|
||||
struct ResourceCompiledRef;
|
||||
@@ -16,7 +17,7 @@ namespace PortabilityLayer
|
||||
class ResourceFile final
|
||||
{
|
||||
public:
|
||||
bool Load(IOStream *stream);
|
||||
bool Load(GpIOStream *stream);
|
||||
|
||||
void GetAllResourceTypeLists(ResourceCompiledTypeList *&outTypeLists, size_t &outCount) const;
|
||||
|
||||
|
@@ -6,9 +6,10 @@
|
||||
|
||||
class PLPasStr;
|
||||
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
struct MMHandleBlock;
|
||||
struct ResourceCompiledRef;
|
||||
class ResourceFile;
|
||||
@@ -27,7 +28,7 @@ namespace PortabilityLayer
|
||||
class ResourceArchive final
|
||||
{
|
||||
public:
|
||||
static ResourceArchive *Create(ZipFileProxy *zipFileProxy, IOStream *stream);
|
||||
static ResourceArchive *Create(ZipFileProxy *zipFileProxy, GpIOStream *stream);
|
||||
void Destroy();
|
||||
|
||||
THandle<void> LoadResource(const ResTypeID &resTypeID, int id);
|
||||
@@ -37,7 +38,7 @@ namespace PortabilityLayer
|
||||
bool FindFirstResourceOfType(const ResTypeID &resTypeID, int16_t &outID) const;
|
||||
|
||||
private:
|
||||
ResourceArchive(ZipFileProxy *zipFileProxy, IOStream *stream, ResourceArchiveRef *resourceHandles);
|
||||
ResourceArchive(ZipFileProxy *zipFileProxy, GpIOStream *stream, ResourceArchiveRef *resourceHandles);
|
||||
~ResourceArchive();
|
||||
|
||||
bool IndexResource(const ResTypeID &resTypeID, int id, size_t &outIndex, int &outValidationRule) const;
|
||||
@@ -45,7 +46,7 @@ namespace PortabilityLayer
|
||||
THandle<void> GetResource(const ResTypeID &resTypeID, int id, bool load);
|
||||
|
||||
ZipFileProxy *m_zipFileProxy;
|
||||
IOStream *m_stream;
|
||||
GpIOStream *m_stream;
|
||||
ResourceArchiveRef *m_resourceHandles;
|
||||
};
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "WindowDef.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "CoreDefs.h"
|
||||
#include "PLPasStr.h"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
bool WindowDef::Deserialize(IOStream *stream)
|
||||
bool WindowDef::Deserialize(GpIOStream *stream)
|
||||
{
|
||||
struct WindowDefPart1
|
||||
{
|
||||
|
@@ -4,11 +4,10 @@
|
||||
#include "PascalStr.h"
|
||||
|
||||
class PLPasStr;
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
|
||||
namespace WindowStyleFlags
|
||||
{
|
||||
enum WindowStyleFlag
|
||||
@@ -31,7 +30,7 @@ namespace PortabilityLayer
|
||||
uint16_t m_positionSpec;
|
||||
uint8_t m_title[256];
|
||||
|
||||
bool Deserialize(IOStream *stream);
|
||||
bool Deserialize(GpIOStream *stream);
|
||||
|
||||
static WindowDef Create(const Rect &initialRect, uint16_t styleFlags, bool isVisible, uint32_t refConstant, uint16_t positionSpec, const PLPasStr &title);
|
||||
};
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "ZipFileProxy.h"
|
||||
|
||||
#include "BinarySearch.h"
|
||||
#include "IOStream.h"
|
||||
#include "GpIOStream.h"
|
||||
#include "MemoryManager.h"
|
||||
#include "ZipFile.h"
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace PortabilityLayer
|
||||
outName = GetZipItemName(itemPtr);
|
||||
}
|
||||
|
||||
ZipFileProxy *ZipFileProxy::Create(IOStream *stream)
|
||||
ZipFileProxy *ZipFileProxy::Create(GpIOStream *stream)
|
||||
{
|
||||
MemoryManager *mm = MemoryManager::GetInstance();
|
||||
|
||||
@@ -380,7 +380,7 @@ namespace PortabilityLayer
|
||||
return new (storage) ZipFileProxy(stream, centralDirImage, centralDirFiles, numFiles);
|
||||
}
|
||||
|
||||
ZipFileProxy::ZipFileProxy(IOStream *stream, void *centralDirImage, UnalignedPtr<ZipCentralDirectoryFileHeader> *sortedFiles, size_t numFiles)
|
||||
ZipFileProxy::ZipFileProxy(GpIOStream *stream, void *centralDirImage, UnalignedPtr<ZipCentralDirectoryFileHeader> *sortedFiles, size_t numFiles)
|
||||
: m_stream(stream)
|
||||
, m_centralDirImage(centralDirImage)
|
||||
, m_sortedFiles(sortedFiles)
|
||||
|
@@ -2,9 +2,10 @@
|
||||
|
||||
#include "PLUnalignedPtr.h"
|
||||
|
||||
class GpIOStream;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
struct ZipCentralDirectoryFileHeader;
|
||||
|
||||
class ZipFileProxy
|
||||
@@ -23,13 +24,13 @@ namespace PortabilityLayer
|
||||
void GetFileName(size_t index, const char *&outName, size_t &outLength) const;
|
||||
|
||||
|
||||
static ZipFileProxy *Create(IOStream *stream);
|
||||
static ZipFileProxy *Create(GpIOStream *stream);
|
||||
|
||||
private:
|
||||
ZipFileProxy(IOStream *stream, void *centralDirImage, UnalignedPtr<ZipCentralDirectoryFileHeader> *sortedFiles, size_t numFiles);
|
||||
ZipFileProxy(GpIOStream *stream, void *centralDirImage, UnalignedPtr<ZipCentralDirectoryFileHeader> *sortedFiles, size_t numFiles);
|
||||
~ZipFileProxy();
|
||||
|
||||
IOStream *m_stream;
|
||||
GpIOStream *m_stream;
|
||||
void *m_centralDirImage;
|
||||
UnalignedPtr<ZipCentralDirectoryFileHeader> *m_sortedFiles;
|
||||
size_t m_numFiles;
|
||||
|
@@ -60,21 +60,25 @@
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
|
@@ -18,7 +18,7 @@ uint8_t *ReadEntireFile(const char *path, uint32_t &szOut)
|
||||
|
||||
PortabilityLayer::CFileStream stream(f, true, false, true);
|
||||
|
||||
PortabilityLayer::UFilePos_t sz = stream.Size();
|
||||
GpUFilePos_t sz = stream.Size();
|
||||
uint8_t *buffer = new uint8_t[sz];
|
||||
stream.Read(buffer, sz);
|
||||
|
||||
|
@@ -60,21 +60,25 @@
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
|
@@ -346,7 +346,7 @@ public:
|
||||
Rect ConstrainRegion(const Rect &rect) const override;
|
||||
void Start(PortabilityLayer::QDPictBlitSourceType sourceType, const PortabilityLayer::QDPictEmitScanlineParameters ¶ms) override;
|
||||
void BlitScanlineAndAdvance(const void *) override;
|
||||
bool EmitQTContent(PortabilityLayer::IOStream *stream, uint32_t dataSize, bool isCompressed) override;
|
||||
bool EmitQTContent(GpIOStream *stream, uint32_t dataSize, bool isCompressed) override;
|
||||
bool AllocTempBuffers(uint8_t *&buffer1, size_t buffer1Size, uint8_t *&buffer2, size_t buffer2Size) override;
|
||||
|
||||
void ReportError(int errorCode, int subCode) override
|
||||
@@ -492,7 +492,7 @@ void BMPDumperContext::BlitScanlineAndAdvance(const void *scanlineData)
|
||||
}
|
||||
}
|
||||
|
||||
bool BMPDumperContext::EmitQTContent(PortabilityLayer::IOStream *stream, uint32_t dataSize, bool isCompressed)
|
||||
bool BMPDumperContext::EmitQTContent(GpIOStream *stream, uint32_t dataSize, bool isCompressed)
|
||||
{
|
||||
// Only one known house ("Magic" seems to use uncompressed, which is partly documented here:
|
||||
// https://github.com/gco/xee/blob/master/XeePhotoshopPICTLoader.m
|
||||
|
@@ -60,21 +60,25 @@
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
|
@@ -60,21 +60,25 @@
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
|
Reference in New Issue
Block a user