mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Fix audio driver starting in debug mode, add -diagnostics mode
This commit is contained in:
@@ -93,8 +93,15 @@ namespace PortabilityLayer
|
||||
fclose(m_file);
|
||||
m_file = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void CFileStream::Flush()
|
||||
{
|
||||
if (m_file)
|
||||
fflush(m_file);
|
||||
}
|
||||
|
||||
|
||||
UFilePos_t CFileStream::Size() const
|
||||
{
|
||||
if (!m_file || !m_seekable)
|
||||
|
@@ -27,7 +27,8 @@ namespace PortabilityLayer
|
||||
bool Truncate(UFilePos_t loc) override;
|
||||
UFilePos_t Size() const override;
|
||||
UFilePos_t Tell() const override;
|
||||
void Close() override;
|
||||
void Close() override;
|
||||
void Flush() override;
|
||||
|
||||
private:
|
||||
CFileStream(const CFileStream &other) GP_DELETED;
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#endif
|
||||
|
||||
struct IGpAudioDriver;
|
||||
struct IGpLogDriver;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
@@ -41,6 +42,7 @@ public:
|
||||
virtual void PL_HostAudioDriver_SetInstance(IGpAudioDriver *instance) = 0;
|
||||
virtual void PL_HostFileSystem_SetInstance(PortabilityLayer::HostFileSystem *instance) = 0;
|
||||
virtual void PL_HostDisplayDriver_SetInstance(IGpDisplayDriver *instance) = 0;
|
||||
virtual void PL_HostLogDriver_SetInstance(IGpLogDriver *instance) = 0;
|
||||
virtual void PL_HostSystemServices_SetInstance(PortabilityLayer::HostSystemServices *instance) = 0;
|
||||
virtual void PL_HostFontHandler_SetInstance(PortabilityLayer::HostFontHandler *instance) = 0;
|
||||
virtual void PL_HostVOSEventQueue_SetInstance(PortabilityLayer::HostVOSEventQueue *instance) = 0;
|
||||
|
16
PortabilityLayer/HostLogDriver.cpp
Normal file
16
PortabilityLayer/HostLogDriver.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "HostLogDriver.h"
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
void HostLogDriver::SetInstance(IGpLogDriver *instance)
|
||||
{
|
||||
ms_instance = instance;
|
||||
}
|
||||
|
||||
IGpLogDriver *HostLogDriver::GetInstance()
|
||||
{
|
||||
return ms_instance;
|
||||
}
|
||||
|
||||
IGpLogDriver *HostLogDriver::ms_instance;
|
||||
}
|
16
PortabilityLayer/HostLogDriver.h
Normal file
16
PortabilityLayer/HostLogDriver.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
struct IGpLogDriver;
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class HostLogDriver
|
||||
{
|
||||
public:
|
||||
static void SetInstance(IGpLogDriver *instance);
|
||||
static IGpLogDriver *GetInstance();
|
||||
|
||||
private:
|
||||
static IGpLogDriver *ms_instance;
|
||||
};
|
||||
}
|
@@ -23,6 +23,7 @@ namespace PortabilityLayer
|
||||
virtual UFilePos_t Size() const = 0;
|
||||
virtual UFilePos_t Tell() const = 0;
|
||||
virtual void Close() = 0;
|
||||
virtual void Flush() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -107,4 +107,8 @@ namespace PortabilityLayer
|
||||
void MemReaderStream::Close()
|
||||
{
|
||||
}
|
||||
|
||||
void MemReaderStream::Flush()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ namespace PortabilityLayer
|
||||
UFilePos_t Size() const override;
|
||||
UFilePos_t Tell() const override;
|
||||
void Close() override;
|
||||
void Flush() override;
|
||||
|
||||
private:
|
||||
MemReaderStream() GP_DELETED;
|
||||
|
@@ -176,6 +176,7 @@
|
||||
<ClInclude Include="HostFontHandler.h" />
|
||||
<ClInclude Include="HostFontRenderedGlyph.h" />
|
||||
<ClInclude Include="HostInputDriver.h" />
|
||||
<ClInclude Include="HostLogDriver.h" />
|
||||
<ClInclude Include="HostMutex.h" />
|
||||
<ClInclude Include="HostSuspendCallArgument.h" />
|
||||
<ClInclude Include="HostSuspendCallID.h" />
|
||||
@@ -321,6 +322,7 @@
|
||||
<ClCompile Include="HostDisplayDriver.cpp" />
|
||||
<ClCompile Include="HostFileSystem.cpp" />
|
||||
<ClCompile Include="HostFontHandler.cpp" />
|
||||
<ClCompile Include="HostLogDriver.cpp" />
|
||||
<ClCompile Include="HostSuspendHook.cpp" />
|
||||
<ClCompile Include="HostSystemServices.cpp" />
|
||||
<ClCompile Include="HostVOSEventQueue.cpp" />
|
||||
|
@@ -483,6 +483,9 @@
|
||||
<ClInclude Include="ResolveCachingColor.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HostLogDriver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CFileStream.cpp">
|
||||
@@ -758,5 +761,8 @@
|
||||
<ClCompile Include="ResolveCachingColor.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="HostLogDriver.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -16,6 +16,7 @@ namespace PortabilityLayer
|
||||
kFonts,
|
||||
kCursors,
|
||||
kHighScores,
|
||||
kLogs,
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user