mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-07-14 19:25:51 +00:00
Fix magics (needs proper fix)
Implement windows profile directory retrieval
This commit is contained in:
parent
214841966b
commit
013046ad65
2
hecl/extern/Athena
vendored
2
hecl/extern/Athena
vendored
@ -1 +1 @@
|
|||||||
Subproject commit ab86e2195fceab0fcfddfe2795922609c87ff714
|
Subproject commit 64f34cc9030145dc8ddeadc80d90f42ed3162675
|
@ -1,5 +1,8 @@
|
|||||||
#include "HECL/Runtime.hpp"
|
#include "HECL/Runtime.hpp"
|
||||||
#include <LogVisor/LogVisor.hpp>
|
#include <LogVisor/LogVisor.hpp>
|
||||||
|
#if _WIN32
|
||||||
|
#include <ShlObj.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace HECL
|
namespace HECL
|
||||||
{
|
{
|
||||||
@ -11,6 +14,19 @@ FileStoreManager::FileStoreManager(const SystemString& domain)
|
|||||||
: m_domain(domain)
|
: m_domain(domain)
|
||||||
{
|
{
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
|
WCHAR home[MAX_PATH];
|
||||||
|
if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, home)))
|
||||||
|
Log.report(LogVisor::FatalError, _S("unable to locate profile for file store"));
|
||||||
|
|
||||||
|
SystemString path(home);
|
||||||
|
|
||||||
|
path += _S("/.heclrun");
|
||||||
|
|
||||||
|
HECL::MakeDir(path.c_str());
|
||||||
|
path += _S('/') + domain;
|
||||||
|
|
||||||
|
HECL::MakeDir(path.c_str());
|
||||||
|
m_storeRoot = path;
|
||||||
#elif __APPLE__
|
#elif __APPLE__
|
||||||
#else
|
#else
|
||||||
const char* home = getenv("HOME");
|
const char* home = getenv("HOME");
|
||||||
|
@ -10,8 +10,8 @@ namespace HECL
|
|||||||
namespace Runtime
|
namespace Runtime
|
||||||
{
|
{
|
||||||
static LogVisor::LogModule Log("ShaderCacheManager");
|
static LogVisor::LogModule Log("ShaderCacheManager");
|
||||||
static uint64_t IDX_MAGIC = SBIG(0xDEADFEEDC001D00D);
|
static uint64_t IDX_MAGIC = SBig(0xDEADFEEDC001D00D);
|
||||||
static uint64_t DAT_MAGIC = SBIG(0xC001D00DDEADBABE);
|
static uint64_t DAT_MAGIC = SBig(0xC001D00DDEADBABE);
|
||||||
static uint64_t ZERO64 = 0;
|
static uint64_t ZERO64 = 0;
|
||||||
|
|
||||||
static uint64_t timeHash()
|
static uint64_t timeHash()
|
||||||
@ -49,7 +49,13 @@ void ShaderCacheManager::BootstrapIndex()
|
|||||||
fwrite(&ZERO64, 1, 8, idxFp);
|
fwrite(&ZERO64, 1, 8, idxFp);
|
||||||
fclose(idxFp);
|
fclose(idxFp);
|
||||||
|
|
||||||
FILE* datFp = HECL::Fopen(idxFilename.c_str(), _S("wb"));
|
#if _WIN32
|
||||||
|
SystemString datFilename = m_datFr.wfilename();
|
||||||
|
#else
|
||||||
|
SystemString datFilename = m_datFr.filename();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
FILE* datFp = HECL::Fopen(datFilename.c_str(), _S("wb"));
|
||||||
if (!datFp)
|
if (!datFp)
|
||||||
Log.report(LogVisor::FatalError, _S("unable to write shader cache data at %s"),
|
Log.report(LogVisor::FatalError, _S("unable to write shader cache data at %s"),
|
||||||
idxFilename.c_str());
|
idxFilename.c_str());
|
||||||
|
@ -31,6 +31,7 @@ struct HECLApplicationCallback : boo::IApplicationCallback
|
|||||||
|
|
||||||
m_mainWindow = app->newWindow(_S("HECL Test"));
|
m_mainWindow = app->newWindow(_S("HECL Test"));
|
||||||
m_mainWindow->setCallback(&m_windowCb);
|
m_mainWindow->setCallback(&m_windowCb);
|
||||||
|
m_mainWindow->showWindow();
|
||||||
boo::IGraphicsCommandQueue* gfxQ = m_mainWindow->getCommandQueue();
|
boo::IGraphicsCommandQueue* gfxQ = m_mainWindow->getCommandQueue();
|
||||||
boo::IGraphicsDataFactory* gfxF = m_mainWindow->getLoadContextDataFactory();
|
boo::IGraphicsDataFactory* gfxF = m_mainWindow->getLoadContextDataFactory();
|
||||||
boo::SWindowRect mainWindowRect = m_mainWindow->getWindowFrame();
|
boo::SWindowRect mainWindowRect = m_mainWindow->getWindowFrame();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user