Skip to content

Commit

Permalink
"Release 1.36 - October 17th - New File System"
Browse files Browse the repository at this point in the history
  • Loading branch information
JenkinsConffx committed Oct 18, 2019
1 parent 71e2e31 commit 2ea4757
Show file tree
Hide file tree
Showing 4,298 changed files with 22,889 additions and 1,503,967 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
26 changes: 20 additions & 6 deletions Common_3/OS/Android/AndroidBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#ifdef __ANDROID__

#include <ctime>
#include <unistd.h>
#include <android/configuration.h>
#include <android/looper.h>
#include <android/native_activity.h>
Expand All @@ -35,8 +36,6 @@
#include "../Interfaces/ITime.h"
#include "../Interfaces/IThread.h"

#include "AndroidFileSystem.cpp"

#include "../Interfaces/IMemory.h"

static WindowsDesc gWindow;
Expand Down Expand Up @@ -266,8 +265,22 @@ void handle_cmd(android_app* app, int32_t cmd)
}
}

// Forward declare the function used by the Android FileSystem to access the ANativeActivity.
void AndroidFS_SetNativeActivity(ANativeActivity* nativeActivity);

int AndroidMain(void* param, IApp* app)
{
extern bool MemAllocInit();
extern void MemAllocExit();

if (!MemAllocInit())
return EXIT_FAILURE;

if (!fsInitAPI())
return EXIT_FAILURE;

Log::Init();

struct android_app* android_app = (struct android_app*)param;

// Set the callback to process system events
Expand All @@ -282,10 +295,7 @@ int AndroidMain(void* param, IApp* app)
const uint32_t testingDesiredFrameCount = 120;
#endif

// Set asset manager.
_mgr = (android_app->activity->assetManager);

FileSystem::SetCurrentDir(FileSystem::GetProgramDir());
AndroidFS_SetNativeActivity(android_activity);

IApp::Settings* pSettings = &pApp->mSettings;
Timer deltaTimer;
Expand Down Expand Up @@ -347,6 +357,10 @@ int AndroidMain(void* param, IApp* app)
windowReady = false;
pApp->Exit();

Log::Exit();
fsDeinitAPI();
MemAllocExit();

return 0;
}
/************************************************************************/
Expand Down
Loading

0 comments on commit 2ea4757

Please sign in to comment.