mirror of
https://github.com/spiffcode/hostile-takeover.git
synced 2026-04-17 20:51:26 -06:00
Implement Android HostHelper code for SdlPackFileReader
Needed for changes SdlPackFileReader changes in commit 61e081be5690202cae1e03d6e6cc89a3e94257b7
This commit is contained in:
parent
6b9241fbc5
commit
84b4e0f6ba
@ -239,6 +239,33 @@ void HostHelpers::GetSurfaceProperties(SurfaceProperties *pprops)
|
||||
pprops->density = density;
|
||||
}
|
||||
|
||||
bool HostHelpers::DirExists(char *psz)
|
||||
{
|
||||
AAssetDir *assetDir = AAssetManager_openDir(gassetmgr, psz);
|
||||
bool exists = AAssetDir_getNextFileName(assetDir) != NULL;
|
||||
AAssetDir_close(assetDir);
|
||||
return exists;
|
||||
}
|
||||
|
||||
bool HostHelpers::EnumFiles(Enum *penm, int key, char *pszFn, int cbFn)
|
||||
{
|
||||
if (penm->m_pvNext == (void *)kEnmFirst) {
|
||||
AAssetDir *assetDir = AAssetManager_openDir(gassetmgr, gpakr.BottomDir());
|
||||
penm->m_pvNext = (void *)assetDir;
|
||||
penm->m_dwUser = 0;
|
||||
}
|
||||
|
||||
AAssetDir *assetDir = (AAssetDir *)penm->m_pvNext;
|
||||
const char *ent = AAssetDir_getNextFileName(assetDir);
|
||||
if (ent != NULL) {
|
||||
strncpyz(pszFn, ent, cbFn);
|
||||
penm->m_dwUser++;
|
||||
return true;
|
||||
}
|
||||
AAssetDir_close(assetDir);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
void HostHelpers::FrameStart()
|
||||
{
|
||||
|
||||
@ -52,6 +52,8 @@ public:
|
||||
static void GameThreadStart(void *pv);
|
||||
static void DisplayInitComplete();
|
||||
static const char *GetPlatformString();
|
||||
static bool DirExists(char *psz);
|
||||
static bool EnumFiles(Enum *penm, int key, char *pszFn, int cbFn);
|
||||
|
||||
// TODO(darrinm): unused?
|
||||
static int main(int argc, char **argv);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user