Further android build fixes

This commit is contained in:
Jupeyy 2022-01-20 10:49:31 +01:00
parent 4bcddc8dae
commit 55a1406641
7 changed files with 27 additions and 5 deletions

View file

@ -158,8 +158,8 @@ copy_dummy_files scripts/android/files/proguard-rules.pro proguard-rules.pro
copy_dummy_files scripts/android/files/settings.gradle settings.gradle
copy_dummy_files scripts/android/files/AndroidManifest.xml src/main/AndroidManifest.xml
copy_dummy_files_rec scripts/android/files/res src/main
copy_dummy_files other/icons/DDNet_512x512x32.png src/main/res/mipmap/ic_launcher.png
copy_dummy_files other/icons/DDNet_512x512x32.png src/main/res/mipmap/ic_launcher_round.png
copy_dummy_files other/icons/DDNet_256x256x32.png src/main/res/mipmap/ic_launcher.png
copy_dummy_files other/icons/DDNet_256x256x32.png src/main/res/mipmap/ic_launcher_round.png
function copy_libs() {
mkdir -p "lib/$2"

View file

@ -19,7 +19,7 @@ function compile_source() {
-DBUILD_SHARED_LIBS=OFF \
-DHIDAPI_SKIP_LIBUSB=TRUE \
-DCURL_USE_OPENSSL=ON \
-DHIDAPI=OFF \
-DSDL_HIDAPI=OFF \
-DOP_DISABLE_HTTP=ON \
-DOP_DISABLE_EXAMPLES=ON \
-DOP_DISABLE_DOCS=ON \

View file

@ -1238,4 +1238,13 @@ void CGraphicsBackend_SDL_OpenGL::NotifyWindow()
#endif
}
void CGraphicsBackend_SDL_OpenGL::WindowDestroyNtf(uint32_t WindowID)
{
}
void CGraphicsBackend_SDL_OpenGL::WindowCreateNtf(uint32_t WindowID)
{
m_pWindow = SDL_GetWindowFromID(WindowID);
}
IGraphicsBackend *CreateGraphicsBackend() { return new CGraphicsBackend_SDL_OpenGL; }

View file

@ -264,6 +264,9 @@ public:
virtual void GetViewportSize(int &w, int &h);
virtual void NotifyWindow();
virtual void WindowDestroyNtf(uint32_t WindowID);
virtual void WindowCreateNtf(uint32_t WindowID);
virtual void GetDriverVersion(EGraphicsDriverAgeType DriverAgeType, int &Major, int &Minor, int &Patch);
virtual bool IsConfigModernAPI() { return IsModernAPI(m_BackendType); }
virtual bool IsNewOpenGL() { return m_UseNewOpenGL; }

View file

@ -4339,14 +4339,17 @@ void CClient::HandleMapPath(const char *pPath)
#if defined(CONF_PLATFORM_MACOS)
extern "C" int TWMain(int argc, const char **argv) // ignore_convention
#elif defined(CONF_PLATFORM_ANDROID)
extern "C" __attribute__((visibility("default"))) int SDL_main(int argc, const char *argv[]);
extern "C" __attribute__((visibility("default"))) int SDL_main(int argc, char *argv[]);
extern "C" void InitAndroid();
int SDL_main(int argc, const char *argv[])
int SDL_main(int argc, char *argv2[])
#else
int main(int argc, const char **argv) // ignore_convention
#endif
{
#if defined(CONF_PLATFORM_ANDROID)
const char **argv = const_cast<const char **>(argv2);
#endif
cmdline_fix(&argc, &argv);
bool Silent = false;
bool RandInitFailed = false;

View file

@ -2420,6 +2420,8 @@ int CGraphics_Threaded::GetWindowScreen()
void CGraphics_Threaded::WindowDestroyNtf(uint32_t WindowID)
{
m_pBackend->WindowDestroyNtf(WindowID);
CCommandBuffer::SCommand_WindowDestroyNtf Cmd;
Cmd.m_WindowID = WindowID;
@ -2432,6 +2434,8 @@ void CGraphics_Threaded::WindowDestroyNtf(uint32_t WindowID)
void CGraphics_Threaded::WindowCreateNtf(uint32_t WindowID)
{
m_pBackend->WindowCreateNtf(WindowID);
CCommandBuffer::SCommand_WindowCreateNtf Cmd;
Cmd.m_WindowID = WindowID;

View file

@ -681,6 +681,9 @@ public:
virtual void GetViewportSize(int &w, int &h) = 0;
virtual void NotifyWindow() = 0;
virtual void WindowDestroyNtf(uint32_t WindowID) = 0;
virtual void WindowCreateNtf(uint32_t WindowID) = 0;
virtual void RunBuffer(CCommandBuffer *pBuffer) = 0;
virtual bool IsIdle() const = 0;
virtual void WaitForIdle() = 0;