mirror of
https://github.com/scummvm/scummvm.git
synced 2026-05-21 05:40:43 +00:00
DLC: Remove Playstore code
This commit is contained in:
committed by
Eugene Sandulenko
parent
f03d59620b
commit
a26d00a2b7
@@ -1,55 +0,0 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
|
||||
#include "backends/dlc/android/playstore.h"
|
||||
|
||||
namespace DLC {
|
||||
namespace PlayStore {
|
||||
|
||||
PlayStore::PlayStore() {
|
||||
_playStoreObject = JNI::getPlayStoreDLCManager();
|
||||
}
|
||||
|
||||
void PlayStore::init() {
|
||||
|
||||
}
|
||||
|
||||
void PlayStore::requestInfo() {
|
||||
JNIEnv *env = JNI::getEnv();
|
||||
jclass playStoreClass = env->GetObjectClass(_playStoreObject);
|
||||
|
||||
jmethodID getPackLocationMethod = env->GetMethodID(playStoreClass, "getPackLocation", "(Ljava/lang/String;)Lcom/google/android/play/core/assetpacks/AssetPackLocation;");
|
||||
|
||||
jstring packName = env->NewStringUTF("beneath_a_steel_sky");
|
||||
jobject packLocationObject = env->CallObjectMethod(_playStoreObject, getPackLocationMethod, packName);
|
||||
|
||||
env->DeleteLocalRef(packName);
|
||||
env->DeleteLocalRef(packLocationObject);
|
||||
|
||||
// TODO: return a string/struct for the location and add a function parameter i.e. packName
|
||||
}
|
||||
|
||||
} // End of namespace PlayStore
|
||||
} // End of namespace DLC
|
||||
|
||||
#endif
|
||||
@@ -1,60 +0,0 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
|
||||
#ifndef BACKENDS_DLC_PLAYSTORE_PLAYSTORE_H
|
||||
#define BACKENDS_DLC_PLAYSTORE_PLAYSTORE_H
|
||||
|
||||
#include "backends/dlc/store.h"
|
||||
#include "backends/platform/android/jni-android.h"
|
||||
|
||||
namespace DLC {
|
||||
namespace PlayStore {
|
||||
|
||||
class PlayStore: public DLC::Store {
|
||||
|
||||
public:
|
||||
PlayStore();
|
||||
virtual ~PlayStore() {}
|
||||
|
||||
virtual void init() override;
|
||||
|
||||
virtual void requestInfo() override;
|
||||
|
||||
virtual void getDownloadState() override {}
|
||||
|
||||
virtual void requestDownload() override {}
|
||||
|
||||
virtual void getBytesDownloaded() override {}
|
||||
|
||||
virtual void cancelDownload() override {}
|
||||
|
||||
private:
|
||||
jobject _playStoreObject;
|
||||
|
||||
};
|
||||
|
||||
} // End of namespace PlayStore
|
||||
} // End of namespace DLC
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -43,18 +43,6 @@ public:
|
||||
ScummVMCloud() {}
|
||||
virtual ~ScummVMCloud() {}
|
||||
|
||||
virtual void init() override {}
|
||||
|
||||
virtual void requestInfo() override {}
|
||||
|
||||
virtual void getDownloadState() override {}
|
||||
|
||||
virtual void requestDownload() override {}
|
||||
|
||||
virtual void getBytesDownloaded() override {}
|
||||
|
||||
virtual void cancelDownload() override {}
|
||||
|
||||
virtual void getAllDLCs() override;
|
||||
|
||||
virtual void startDownloadAsync(const Common::String &id, const Common::String &url) override;
|
||||
|
||||
@@ -35,18 +35,6 @@ public:
|
||||
Store() {}
|
||||
virtual ~Store() {}
|
||||
|
||||
virtual void init() = 0;
|
||||
|
||||
virtual void requestInfo() = 0;
|
||||
|
||||
virtual void getDownloadState() = 0;
|
||||
|
||||
virtual void requestDownload() = 0;
|
||||
|
||||
virtual void getBytesDownloaded() = 0;
|
||||
|
||||
virtual void cancelDownload() = 0;
|
||||
|
||||
virtual void getAllDLCs() = 0;
|
||||
|
||||
virtual void startDownloadAsync(const Common::String &id, const Common::String &url) = 0;
|
||||
|
||||
@@ -77,10 +77,6 @@ endif
|
||||
ifdef USE_DLC
|
||||
MODULE_OBJS += \
|
||||
dlc/dlcmanager.o
|
||||
ifeq ($(BACKEND),android)
|
||||
MODULE_OBJS += \
|
||||
dlc/android/playstore.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef USE_LIBCURL
|
||||
|
||||
@@ -76,8 +76,6 @@
|
||||
#include "backends/keymapper/keymapper-defaults.h"
|
||||
#include "backends/keymapper/standard-actions.h"
|
||||
|
||||
#include "backends/dlc/android/playstore.h"
|
||||
|
||||
#include "common/util.h"
|
||||
#include "common/textconsole.h"
|
||||
#include "common/rect.h"
|
||||
@@ -223,10 +221,6 @@ OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) :
|
||||
fsFactory.initSAF();
|
||||
}
|
||||
_fsFactory = &fsFactory;
|
||||
|
||||
#if defined(USE_DLC)
|
||||
_dlcStore = new DLC::PlayStore::PlayStore();
|
||||
#endif
|
||||
}
|
||||
|
||||
OSystem_Android::~OSystem_Android() {
|
||||
@@ -261,9 +255,6 @@ OSystem_Android::~OSystem_Android() {
|
||||
|
||||
delete _logger;
|
||||
_logger = nullptr;
|
||||
|
||||
delete _dlcStore;
|
||||
_dlcStore = nullptr;
|
||||
}
|
||||
|
||||
void *OSystem_Android::timerThreadFunc(void *arg) {
|
||||
@@ -646,9 +637,6 @@ bool OSystem_Android::hasFeature(Feature f) {
|
||||
f == kFeatureTouchscreen) {
|
||||
return true;
|
||||
}
|
||||
#if defined(USE_DLC)
|
||||
if (f == kFeatureDLC) return true;
|
||||
#endif
|
||||
/* Even if we are using the 2D graphics manager,
|
||||
* we are at one initGraphics3d call of supporting GLES2 */
|
||||
if (f == kFeatureOpenGLForGame) return true;
|
||||
|
||||
@@ -107,8 +107,6 @@ jmethodID JNI::_MID_getNewSAFTree = 0;
|
||||
jmethodID JNI::_MID_getSAFTrees = 0;
|
||||
jmethodID JNI::_MID_findSAFTree = 0;
|
||||
|
||||
jmethodID JNI::_MID_getPlayStoreDLCManager = 0;
|
||||
|
||||
jmethodID JNI::_MID_EGL10_eglSwapBuffers = 0;
|
||||
|
||||
jmethodID JNI::_MID_AudioTrack_flush = 0;
|
||||
@@ -802,8 +800,6 @@ void JNI::create(JNIEnv *env, jobject self, jobject asset_manager,
|
||||
FIND_METHOD(, getSAFTrees, "()[Lorg/scummvm/scummvm/SAFFSTree;");
|
||||
FIND_METHOD(, findSAFTree, "(Ljava/lang/String;)Lorg/scummvm/scummvm/SAFFSTree;");
|
||||
|
||||
FIND_METHOD(, getPlayStoreDLCManager, "()Lcom/google/android/play/core/assetpacks/AssetPackManager;");
|
||||
|
||||
_jobj_egl = env->NewGlobalRef(egl);
|
||||
_jobj_egl_display = env->NewGlobalRef(egl_display);
|
||||
_egl_version = 0;
|
||||
@@ -1153,21 +1149,4 @@ jobject JNI::findSAFTree(const Common::String &name) {
|
||||
return tree;
|
||||
}
|
||||
|
||||
jobject JNI::getPlayStoreDLCManager() {
|
||||
JNIEnv *env = JNI::getEnv();
|
||||
|
||||
jobject store = env->CallObjectMethod(_jobj, _MID_getPlayStoreDLCManager);
|
||||
|
||||
if (env->ExceptionCheck()) {
|
||||
LOGE("getPlayStoreDLCManager: error");
|
||||
|
||||
env->ExceptionDescribe();
|
||||
env->ExceptionClear();
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return store;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -119,7 +119,6 @@ public:
|
||||
static jobject getNewSAFTree(bool folder, bool writable, const Common::String &initURI, const Common::String &prompt);
|
||||
static Common::Array<jobject> getSAFTrees();
|
||||
static jobject findSAFTree(const Common::String &name);
|
||||
static jobject getPlayStoreDLCManager();
|
||||
|
||||
private:
|
||||
static pthread_key_t _env_tls;
|
||||
@@ -165,8 +164,6 @@ private:
|
||||
static jmethodID _MID_getSAFTrees;
|
||||
static jmethodID _MID_findSAFTree;
|
||||
|
||||
static jmethodID _MID_getPlayStoreDLCManager;
|
||||
|
||||
static jmethodID _MID_EGL10_eglSwapBuffers;
|
||||
|
||||
static jmethodID _MID_AudioTrack_flush;
|
||||
|
||||
@@ -12,8 +12,6 @@ import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.SurfaceHolder;
|
||||
|
||||
import com.google.android.play.core.assetpacks.AssetPackManager;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Scanner;
|
||||
@@ -92,7 +90,6 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
|
||||
abstract protected SAFFSTree getNewSAFTree(boolean folder, boolean write, String initialURI, String prompt);
|
||||
abstract protected SAFFSTree[] getSAFTrees();
|
||||
abstract protected SAFFSTree findSAFTree(String name);
|
||||
abstract protected AssetPackManager getPlayStoreDLCManager();
|
||||
|
||||
public ScummVM(AssetManager asset_manager, SurfaceHolder holder, final MyScummVMDestroyedCallback scummVMDestroyedCallback) {
|
||||
_asset_manager = asset_manager;
|
||||
|
||||
@@ -48,9 +48,6 @@ import android.widget.Toast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.google.android.play.core.assetpacks.AssetPackManager;
|
||||
import com.google.android.play.core.assetpacks.AssetPackManagerFactory;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -880,11 +877,6 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
|
||||
protected SAFFSTree findSAFTree(String name) {
|
||||
return SAFFSTree.findTree(ScummVMActivity.this, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AssetPackManager getPlayStoreDLCManager() {
|
||||
return AssetPackManagerFactory.getInstance(getApplicationContext());
|
||||
}
|
||||
}
|
||||
|
||||
private MyScummVM _scummvm;
|
||||
|
||||
@@ -108,5 +108,4 @@ android {
|
||||
dependencies {
|
||||
implementation "androidx.annotation:annotation:1.5.0"
|
||||
implementation "androidx.appcompat:appcompat:1.6.1"
|
||||
implementation "com.google.android.play:asset-delivery:2.1.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user