mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
@@ -45,10 +45,8 @@ void ZipContainer::close() noexcept {
|
||||
zip_close(zip_);
|
||||
zip_ = nullptr;
|
||||
}
|
||||
if (sourceData_ != nullptr) {
|
||||
delete sourceData_;
|
||||
sourceData_ = nullptr;
|
||||
}
|
||||
delete sourceData_;
|
||||
sourceData_ = nullptr;
|
||||
}
|
||||
|
||||
ZipContainer::operator zip_t *() const noexcept {
|
||||
|
||||
@@ -178,4 +178,3 @@ void System_RunCallbackInWndProc(void (*callback)(void *, void *), void *userdat
|
||||
void System_MoveToTrash(const Path &path) {
|
||||
g_requestManager.MakeSystemRequest(SystemRequestType::MOVE_TO_TRASH, NO_REQUESTER_TOKEN, nullptr, nullptr, path.ToString(), "", 0);
|
||||
}
|
||||
|
||||
|
||||
+5
-4
@@ -487,7 +487,8 @@ void DetectZipFileContents(zip_t *z, ZipFileInfo *info) {
|
||||
zip_stat_index(z, i, 0, &stat);
|
||||
totalFileSize += stat.size;
|
||||
|
||||
std::string zippedName = fn;
|
||||
std::string fileName(fn);
|
||||
std::string zippedName = fileName; // actually, lowercase-name
|
||||
std::transform(zippedName.begin(), zippedName.end(), zippedName.begin(),
|
||||
[](unsigned char c) { return asciitolower(c); }); // Not using std::tolower to avoid Turkish I->ı conversion.
|
||||
// Ignore macos metadata stuff
|
||||
@@ -518,7 +519,7 @@ void DetectZipFileContents(zip_t *z, ZipFileInfo *info) {
|
||||
INFO_LOG(Log::HLE, "More than one ISO file found in zip. Ignoring additional ones.");
|
||||
} else {
|
||||
info->isoFileIndex = i;
|
||||
info->contentName = zippedName;
|
||||
info->contentName = fn;
|
||||
}
|
||||
}
|
||||
} else if (zippedName.find("textures.ini") != std::string::npos) {
|
||||
@@ -531,7 +532,7 @@ void DetectZipFileContents(zip_t *z, ZipFileInfo *info) {
|
||||
} else if (endsWith(zippedName, ".ppdmp")) {
|
||||
isFrameDump = true;
|
||||
info->isoFileIndex = i;
|
||||
info->contentName = zippedName;
|
||||
info->contentName = fn;
|
||||
} else if (endsWith(zippedName, ".ppst")) {
|
||||
int slashLocation = (int)zippedName.find_last_of('/');
|
||||
if (stripChars == 0 || slashLocation < stripChars + 1) {
|
||||
@@ -564,7 +565,7 @@ void DetectZipFileContents(zip_t *z, ZipFileInfo *info) {
|
||||
} else if (endsWith(zippedName, "/plugin.ini") && slashCount == 1) {
|
||||
hasPluginIni = true;
|
||||
ZipExtractFileToMemory(z, i, &info->iniContents);
|
||||
info->contentName = zippedName.substr(0, zippedName.find_last_of('/'));
|
||||
info->contentName = fileName.substr(0, fileName.find_last_of('/'));
|
||||
} else if (endsWith(zippedName, ".prx") && slashCount == 1) {
|
||||
hasPRX = true;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
#include "Common/Data/Encoding/Utf8.h"
|
||||
#include "Common/Data/Format/IniFile.h"
|
||||
#include "Common/Log.h"
|
||||
#include "Common/System/System.h"
|
||||
#include "Common/System/Request.h"
|
||||
#include "Common/System/OSD.h"
|
||||
#include "Common/File/FileUtil.h"
|
||||
#include "Common/StringUtils.h"
|
||||
@@ -333,9 +335,16 @@ void GameManager::InstallZipContents(ZipFileTask task) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Need to close before trying to delete.
|
||||
z.close();
|
||||
|
||||
// Common functionality.
|
||||
if (task.deleteAfter && success) {
|
||||
File::Delete(task.fileName);
|
||||
if (System_GetPropertyBool(SYSPROP_HAS_TRASH_BIN)) {
|
||||
System_MoveToTrash(task.fileName);
|
||||
} else {
|
||||
File::Delete(task.fileName);
|
||||
}
|
||||
}
|
||||
g_OSD.RemoveProgressBar("install", success, 0.5f);
|
||||
installProgress_ = 1.0f;
|
||||
|
||||
@@ -1905,7 +1905,7 @@ void GestureMappingScreen::CreateGestureTab(UI::LinearLayout *vert, int zoneInde
|
||||
vert->Add(new PopupSliderChoiceFloat(&zone.fSwipeSmoothing, 0.0f, 0.95f, 0.3f, co->T("Swipe smoothing"), 0.05f, screenManager(), "x"))->SetEnabledPtr(&zone.bGestureControlEnabled);
|
||||
|
||||
vert->Add(new ItemHeader(co->T("Double tap")));
|
||||
vert->Add(new PopupMultiChoice(&zone.iDoubleTapGesture, mc->T("Double tap button"), gestureButton, 0, ARRAY_SIZE(gestureButton), I18NCat::MAPPABLECONTROLS, screenManager()))->SetEnabledPtr(&zone.bGestureControlEnabled);
|
||||
vert->Add(new PopupMultiChoice(&zone.iDoubleTapGesture, mc->T("Double tap button"), gestureButton, 0, ARRAY_SIZE(gestureButton), I18NCat::MAPPABLECONTROLS, screenManager()));
|
||||
|
||||
vert->Add(new ItemHeader(co->T("Analog Stick")));
|
||||
vert->Add(new CheckBox(&zone.bAnalogGesture, co->T("Enable analog stick gesture")));
|
||||
|
||||
+9
-4
@@ -1098,7 +1098,7 @@ GamepadEmuView::GamepadEmuView(const TouchControlConfig &config, float xres, flo
|
||||
|
||||
// Add the two gesture zones.
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (g_Config.gestureControls[i].bGestureControlEnabled) {
|
||||
if (g_Config.gestureControls[i].bGestureControlEnabled || g_Config.gestureControls[i].bAnalogGesture) {
|
||||
// We have them both cover the whole surface, then limit in the touch handler.
|
||||
// This is because there's no easy way to do "half the screen" in AnchorLayout.
|
||||
// We can do more complex layout combinations, but meh.
|
||||
@@ -1236,6 +1236,14 @@ void GestureGamepad::Update() {
|
||||
const float th = 1.0f;
|
||||
float dx = deltaX_ * g_display.dpi_scale_x * GetZone().fSwipeSensitivity;
|
||||
float dy = deltaY_ * g_display.dpi_scale_y * GetZone().fSwipeSensitivity;
|
||||
const float smoothing = GetZone().fSwipeSmoothing;
|
||||
deltaX_ *= smoothing;
|
||||
deltaY_ *= smoothing;
|
||||
|
||||
if (!GetZone().bGestureControlEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetZone().iSwipeRight != 0) {
|
||||
if (dx > th) {
|
||||
controlMapper_->PSPKey(DEVICE_ID_TOUCH, GestureKey::keyList[GetZone().iSwipeRight - 1], KeyInputFlags::DOWN);
|
||||
@@ -1272,7 +1280,4 @@ void GestureGamepad::Update() {
|
||||
swipeDownReleased_ = true;
|
||||
}
|
||||
}
|
||||
const float smoothing = GetZone().fSwipeSmoothing;
|
||||
deltaX_ *= smoothing;
|
||||
deltaY_ *= smoothing;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
plugins {
|
||||
id("com.android.application") version "9.0.1" apply false
|
||||
id("com.android.application") version "9.1.0" apply false
|
||||
id("com.google.protobuf") version "0.9.6" apply false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user