mirror of https://github.com/AxioDL/metaforce.git
Fix magics (needs proper fix)
Implement windows profile directory retrieval
This commit is contained in:
parent
214841966b
commit
013046ad65
|
@ -1 +1 @@
|
|||
Subproject commit ab86e2195fceab0fcfddfe2795922609c87ff714
|
||||
Subproject commit 64f34cc9030145dc8ddeadc80d90f42ed3162675
|
|
@ -1,5 +1,8 @@
|
|||
#include "HECL/Runtime.hpp"
|
||||
#include <LogVisor/LogVisor.hpp>
|
||||
#if _WIN32
|
||||
#include <ShlObj.h>
|
||||
#endif
|
||||
|
||||
namespace HECL
|
||||
{
|
||||
|
@ -11,6 +14,19 @@ FileStoreManager::FileStoreManager(const SystemString& domain)
|
|||
: m_domain(domain)
|
||||
{
|
||||
#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__
|
||||
#else
|
||||
const char* home = getenv("HOME");
|
||||
|
|
|
@ -10,8 +10,8 @@ namespace HECL
|
|||
namespace Runtime
|
||||
{
|
||||
static LogVisor::LogModule Log("ShaderCacheManager");
|
||||
static uint64_t IDX_MAGIC = SBIG(0xDEADFEEDC001D00D);
|
||||
static uint64_t DAT_MAGIC = SBIG(0xC001D00DDEADBABE);
|
||||
static uint64_t IDX_MAGIC = SBig(0xDEADFEEDC001D00D);
|
||||
static uint64_t DAT_MAGIC = SBig(0xC001D00DDEADBABE);
|
||||
static uint64_t ZERO64 = 0;
|
||||
|
||||
static uint64_t timeHash()
|
||||
|
@ -49,7 +49,13 @@ void ShaderCacheManager::BootstrapIndex()
|
|||
fwrite(&ZERO64, 1, 8, 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)
|
||||
Log.report(LogVisor::FatalError, _S("unable to write shader cache data at %s"),
|
||||
idxFilename.c_str());
|
||||
|
|
|
@ -31,6 +31,7 @@ struct HECLApplicationCallback : boo::IApplicationCallback
|
|||
|
||||
m_mainWindow = app->newWindow(_S("HECL Test"));
|
||||
m_mainWindow->setCallback(&m_windowCb);
|
||||
m_mainWindow->showWindow();
|
||||
boo::IGraphicsCommandQueue* gfxQ = m_mainWindow->getCommandQueue();
|
||||
boo::IGraphicsDataFactory* gfxF = m_mainWindow->getLoadContextDataFactory();
|
||||
boo::SWindowRect mainWindowRect = m_mainWindow->getWindowFrame();
|
||||
|
|
Loading…
Reference in New Issue