From e0c12c9547e3481761848ef2e6347612aa8c1558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 10 Oct 2024 10:46:52 +0200 Subject: [PATCH] More lint warning fixes --- Common/GPU/D3D11/thin3d_d3d11.cpp | 2 +- Common/GPU/OpenGL/GLQueueRunner.h | 2 +- Common/GPU/OpenGL/thin3d_gl.cpp | 6 +++--- Common/GPU/Vulkan/VulkanDebug.cpp | 2 +- Common/GPU/Vulkan/VulkanImage.cpp | 16 ++++++++++++---- Common/GPU/Vulkan/VulkanLoader.cpp | 6 +++++- Common/GPU/Vulkan/VulkanRenderManager.h | 2 +- Common/GPU/Vulkan/thin3d_vulkan.cpp | 22 +++++++++------------- Common/Net/HTTPClient.cpp | 4 ++-- Common/Net/HTTPNaettRequest.cpp | 4 ++-- Common/Render/Text/draw_text_android.cpp | 6 +++--- Common/UI/Screen.cpp | 4 +++- Common/UI/UI.h | 1 - Common/UI/ViewGroup.h | 2 +- UI/GameInfoCache.h | 1 - UI/MiscScreens.cpp | 2 -- UI/OnScreenDisplay.cpp | 2 -- UI/ReportScreen.cpp | 4 ++-- UI/RetroAchievementScreens.cpp | 6 +++--- UI/TiltAnalogSettingsScreen.cpp | 2 +- UI/TouchControlLayoutScreen.cpp | 7 +++---- android/jni/OpenSLContext.cpp | 2 +- 22 files changed, 54 insertions(+), 51 deletions(-) diff --git a/Common/GPU/D3D11/thin3d_d3d11.cpp b/Common/GPU/D3D11/thin3d_d3d11.cpp index c3c7c29a87..99a9cf1354 100644 --- a/Common/GPU/D3D11/thin3d_d3d11.cpp +++ b/Common/GPU/D3D11/thin3d_d3d11.cpp @@ -351,7 +351,7 @@ D3D11DrawContext::D3D11DrawContext(ID3D11Device *device, ID3D11DeviceContext *de const size_t UP_MAX_BYTES = 65536 * 24; - upBuffer_ = CreateBuffer(UP_MAX_BYTES, BufferUsageFlag::DYNAMIC | BufferUsageFlag::VERTEXDATA); + upBuffer_ = D3D11DrawContext::CreateBuffer(UP_MAX_BYTES, BufferUsageFlag::DYNAMIC | BufferUsageFlag::VERTEXDATA); IDXGIDevice1 *dxgiDevice1 = nullptr; hr = device_->QueryInterface(__uuidof(IDXGIDevice), reinterpret_cast(&dxgiDevice1)); diff --git a/Common/GPU/OpenGL/GLQueueRunner.h b/Common/GPU/OpenGL/GLQueueRunner.h index d7832a9b52..a0a058c335 100644 --- a/Common/GPU/OpenGL/GLQueueRunner.h +++ b/Common/GPU/OpenGL/GLQueueRunner.h @@ -385,7 +385,7 @@ private: void PerformReadback(const GLRStep &pass); void PerformReadbackImage(const GLRStep &pass); - void fbo_ext_create(const GLRInitStep &step); + void fbo_ext_create(const GLRInitStep &step); // Unused on some platforms void fbo_bind_fb_target(bool read, GLuint name); GLenum fbo_get_fb_target(bool read, GLuint **cached); void fbo_unbind(); diff --git a/Common/GPU/OpenGL/thin3d_gl.cpp b/Common/GPU/OpenGL/thin3d_gl.cpp index 423187a9e9..60098e9bc9 100644 --- a/Common/GPU/OpenGL/thin3d_gl.cpp +++ b/Common/GPU/OpenGL/thin3d_gl.cpp @@ -245,7 +245,7 @@ private: }; bool OpenGLShaderModule::Compile(GLRenderManager *render, ShaderLanguage language, const uint8_t *data, size_t dataSize) { - source_ = std::string((const char *)data); + source_ = std::string((const char *)data, dataSize); // Add the prelude on automatically. if (glstage_ == GL_FRAGMENT_SHADER || glstage_ == GL_VERTEX_SHADER) { if (source_.find("#version") == source_.npos) { @@ -646,7 +646,7 @@ OpenGLContext::OpenGLContext(bool canChangeSwapInterval) : renderManager_(frameT // Note: this is for Intel drivers with GL3+. // Also on Intel, see https://github.com/hrydgard/ppsspp/issues/10117 // TODO: Remove entirely sometime reasonably far in driver years after 2015. - const std::string ver = GetInfoString(Draw::InfoField::APIVERSION); + const std::string ver = OpenGLContext::GetInfoString(Draw::InfoField::APIVERSION); int versions[4]{}; if (sscanf(ver.c_str(), "Build %d.%d.%d.%d", &versions[0], &versions[1], &versions[2], &versions[3]) == 4) { if (HasIntelDualSrcBug(versions)) { @@ -962,7 +962,7 @@ void OpenGLTexture::SetImageData(int x, int y, int z, int width, int height, int depth_ = depth; } - if (stride == 0) + if (!stride) stride = width; size_t alignment = DataFormatSizeInBytes(format_); diff --git a/Common/GPU/Vulkan/VulkanDebug.cpp b/Common/GPU/Vulkan/VulkanDebug.cpp index bae1ad0540..64b77416d3 100644 --- a/Common/GPU/Vulkan/VulkanDebug.cpp +++ b/Common/GPU/Vulkan/VulkanDebug.cpp @@ -42,7 +42,6 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanDebugUtilsCallback( VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, void *pUserData) { - const VulkanLogOptions *options = (const VulkanLogOptions *)pUserData; std::ostringstream message; const char *pMessage = pCallbackData->pMessage; @@ -149,6 +148,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanDebugUtilsCallback( std::string msg = message.str(); #ifdef _WIN32 + const VulkanLogOptions *options = (const VulkanLogOptions *)pUserData; OutputDebugStringA(msg.c_str()); if (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) { if (options->breakOnError && System_GetPropertyBool(SYSPROP_DEBUGGER_PRESENT)) { diff --git a/Common/GPU/Vulkan/VulkanImage.cpp b/Common/GPU/Vulkan/VulkanImage.cpp index 6b5e724aa6..b44300f53a 100644 --- a/Common/GPU/Vulkan/VulkanImage.cpp +++ b/Common/GPU/Vulkan/VulkanImage.cpp @@ -51,10 +51,10 @@ bool VulkanTexture::CreateDirect(int w, int h, int depth, int numMips, VkFormat Wipe(); - width_ = w; - height_ = h; - depth_ = depth; - numMips_ = numMips; + width_ = (int16_t)w; + height_ = (int16_t)h; + depth_ = (int16_t)depth; + numMips_ = (int16_t)numMips; format_ = format; VkImageAspectFlags aspect = IsDepthStencilFormat(format) ? VK_IMAGE_ASPECT_DEPTH_BIT : VK_IMAGE_ASPECT_COLOR_BIT; @@ -86,6 +86,14 @@ bool VulkanTexture::CreateDirect(int w, int h, int depth, int numMips, VkFormat allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY; VmaAllocationInfo allocInfo{}; VkResult res = vmaCreateImage(vulkan_->Allocator(), &image_create_info, &allocCreateInfo, &image_, &allocation_, &allocInfo); + if (res != VK_SUCCESS) { + ERROR_LOG(Log::G3D, "vmaCreateImage failed: %s. Destroying image.", VulkanResultToString(res)); + _dbg_assert_msg_(res == VK_ERROR_OUT_OF_HOST_MEMORY || res == VK_ERROR_OUT_OF_DEVICE_MEMORY || res == VK_ERROR_TOO_MANY_OBJECTS, "%d", (int)res); + view_ = VK_NULL_HANDLE; + image_ = VK_NULL_HANDLE; + allocation_ = VK_NULL_HANDLE; + return false; + } // Apply the tag vulkan_->SetDebugName(image_, VK_OBJECT_TYPE_IMAGE, tag_); diff --git a/Common/GPU/Vulkan/VulkanLoader.cpp b/Common/GPU/Vulkan/VulkanLoader.cpp index 8ec624d5e1..05a09af73e 100644 --- a/Common/GPU/Vulkan/VulkanLoader.cpp +++ b/Common/GPU/Vulkan/VulkanLoader.cpp @@ -373,6 +373,7 @@ static VulkanLibraryHandle VulkanLoadLibrary(std::string *errorString) { (std::string(fileRedirectDir.c_str()) + "/").c_str(), nullptr); if (!lib) { ERROR_LOG(Log::G3D, "Failed to load custom driver with AdrenoTools ('%s')", g_Config.sCustomDriver.c_str()); + *errorString = "Failed to load custom driver"; } else { INFO_LOG(Log::G3D, "Vulkan library loaded with AdrenoTools ('%s')", g_Config.sCustomDriver.c_str()); } @@ -388,6 +389,9 @@ static VulkanLibraryHandle VulkanLoadLibrary(std::string *errorString) { break; } } + if (!lib) { + *errorString = "No vulkan library found"; + } } return lib; #endif @@ -481,7 +485,7 @@ bool VulkanMayBeAvailable() { #elif defined(VK_USE_PLATFORM_METAL_EXT) const char * const platformSurfaceExtension = VK_EXT_METAL_SURFACE_EXTENSION_NAME; #else - const char *platformSurfaceExtension = 0; + const char *platformSurfaceExtension = nullptr; #endif if (!localEnumerateInstanceExtensionProperties || !localCreateInstance || !localEnumerate || !localDestroyInstance || !localGetPhysicalDeviceProperties) { diff --git a/Common/GPU/Vulkan/VulkanRenderManager.h b/Common/GPU/Vulkan/VulkanRenderManager.h index ed65c0c4b4..4bdab86ba2 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.h +++ b/Common/GPU/Vulkan/VulkanRenderManager.h @@ -390,7 +390,7 @@ public: data.blendColor.color = color; } - void PushConstants(VkPipelineLayout pipelineLayout, VkShaderStageFlags stages, int offset, int size, void *constants) { + void PushConstants(VkShaderStageFlags stages, int offset, int size, void *constants) { _dbg_assert_(curRenderStep_ && curRenderStep_->stepType == VKRStepType::RENDER); _dbg_assert_(size + offset < 40); VkRenderData &data = curRenderStep_->commands.push_uninitialized(); diff --git a/Common/GPU/Vulkan/thin3d_vulkan.cpp b/Common/GPU/Vulkan/thin3d_vulkan.cpp index 4e991a201c..617ffb0476 100644 --- a/Common/GPU/Vulkan/thin3d_vulkan.cpp +++ b/Common/GPU/Vulkan/thin3d_vulkan.cpp @@ -148,7 +148,7 @@ public: class VKRasterState : public RasterState { public: - VKRasterState(VulkanContext *vulkan, const RasterStateDesc &desc) { + VKRasterState(const RasterStateDesc &desc) { cullFace = desc.cull; frontFace = desc.frontFace; } @@ -187,7 +187,7 @@ public: VKShaderModule(ShaderStage stage, const std::string &tag) : stage_(stage), tag_(tag) { vkstage_ = StageToVulkan(stage); } - bool Compile(VulkanContext *vulkan, ShaderLanguage language, const uint8_t *data, size_t size); + bool Compile(VulkanContext *vulkan, const uint8_t *data, size_t size); const std::string &GetSource() const { return source_; } ~VKShaderModule() { if (module_) { @@ -214,7 +214,7 @@ private: std::string tag_; }; -bool VKShaderModule::Compile(VulkanContext *vulkan, ShaderLanguage language, const uint8_t *data, size_t size) { +bool VKShaderModule::Compile(VulkanContext *vulkan, const uint8_t *data, size_t size) { // We'll need this to free it later. vulkan_ = vulkan; source_ = (const char *)data; @@ -327,7 +327,7 @@ struct DescriptorSetKey { class VKTexture : public Texture { public: - VKTexture(VulkanContext *vulkan, VkCommandBuffer cmd, VulkanPushPool *pushBuffer, const TextureDesc &desc) + VKTexture(VulkanContext *vulkan, const TextureDesc &desc) : vulkan_(vulkan), mipLevels_(desc.mipLevels) { format_ = desc.format; } @@ -757,7 +757,7 @@ SamplerState *VKContext::CreateSamplerState(const SamplerStateDesc &desc) { } RasterState *VKContext::CreateRasterState(const RasterStateDesc &desc) { - return new VKRasterState(vulkan_, desc); + return new VKRasterState(desc); } void VKContext::BindSamplerStates(int start, int count, SamplerState **state) { @@ -877,8 +877,6 @@ VKContext::VKContext(VulkanContext *vulkan, bool useRenderThread) : vulkan_(vulkan), renderManager_(vulkan, useRenderThread, frameTimeHistory_) { shaderLanguageDesc_.Init(GLSL_VULKAN); - VkFormat depthStencilFormat = vulkan->GetDeviceInfo().preferredDepthStencilFormat; - INFO_LOG(Log::G3D, "Determining Vulkan device caps"); caps_.setMaxFrameLatencySupported = true; @@ -1160,7 +1158,6 @@ void VKContext::BindDescriptors(VkBuffer buf, PackedDescriptor descriptors[4]) { descriptors[0].buffer.offset = 0; // dynamic descriptors[0].buffer.range = curPipeline_->GetUBOSize(); - int numDescs = 1; for (int i = 0; i < MAX_BOUND_TEXTURES; ++i) { VkImageView view; VkSampler sampler; @@ -1252,7 +1249,6 @@ Pipeline *VKContext::CreateGraphicsPipeline(const PipelineDesc &desc, const char gDesc.pipelineLayout = pipelineLayout_; - VkPipelineRasterizationStateCreateInfo rs{ VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO }; raster->ToVulkan(&gDesc.rs); if (renderManager_.GetVulkanContext()->GetDeviceFeatures().enabled.provokingVertex.provokingVertexLast) { @@ -1328,7 +1324,7 @@ Texture *VKContext::CreateTexture(const TextureDesc &desc) { ERROR_LOG(Log::G3D, "Can't create textures before the first frame has started."); return nullptr; } - VKTexture *tex = new VKTexture(vulkan_, initCmd, push_, desc); + VKTexture *tex = new VKTexture(vulkan_, desc); if (tex->Create(initCmd, &renderManager_.PostInitBarrier(), push_, desc)) { return tex; } else { @@ -1396,7 +1392,7 @@ BlendState *VKContext::CreateBlendState(const BlendStateDesc &desc) { // to avoid synchronization issues. class VKBuffer : public Buffer { public: - VKBuffer(size_t size, uint32_t flags) : dataSize_(size) { + VKBuffer(size_t size) : dataSize_(size) { data_ = new uint8_t[size]; } ~VKBuffer() { @@ -1411,7 +1407,7 @@ public: }; Buffer *VKContext::CreateBuffer(size_t size, uint32_t usageFlags) { - return new VKBuffer(size, usageFlags); + return new VKBuffer(size); } void VKContext::UpdateBuffer(Buffer *buffer, const uint8_t *data, size_t offset, size_t size, UpdateBufferFlags flags) { @@ -1451,7 +1447,7 @@ void VKContext::BindNativeTexture(int sampler, void *nativeTexture) { ShaderModule *VKContext::CreateShaderModule(ShaderStage stage, ShaderLanguage language, const uint8_t *data, size_t size, const char *tag) { VKShaderModule *shader = new VKShaderModule(stage, tag); - if (shader->Compile(vulkan_, language, data, size)) { + if (shader->Compile(vulkan_, data, size)) { return shader; } else { ERROR_LOG(Log::G3D, "Failed to compile shader %s:\n%s", tag, (const char *)LineNumberString((const char *)data).c_str()); diff --git a/Common/Net/HTTPClient.cpp b/Common/Net/HTTPClient.cpp index 13be8e4998..6ef86c78aa 100644 --- a/Common/Net/HTTPClient.cpp +++ b/Common/Net/HTTPClient.cpp @@ -512,13 +512,13 @@ HTTPRequest::HTTPRequest(RequestMethod method, const std::string &url, const std } HTTPRequest::~HTTPRequest() { - g_OSD.RemoveProgressBar(url_, Failed() ? false : true, 0.5f); + g_OSD.RemoveProgressBar(url_, !failed_, 0.5f); _assert_msg_(joined_, "Download destructed without join"); } void HTTPRequest::Start() { - thread_ = std::thread(std::bind(&HTTPRequest::Do, this)); + thread_ = std::thread([this] { Do(); }); } void HTTPRequest::Join() { diff --git a/Common/Net/HTTPNaettRequest.cpp b/Common/Net/HTTPNaettRequest.cpp index 6c39f0a4df..9c14c6a49b 100644 --- a/Common/Net/HTTPNaettRequest.cpp +++ b/Common/Net/HTTPNaettRequest.cpp @@ -17,7 +17,7 @@ HTTPSRequest::HTTPSRequest(RequestMethod method, const std::string &url, const s } HTTPSRequest::~HTTPSRequest() { - Join(); + HTTPSRequest::Join(); } void HTTPSRequest::Start() { @@ -53,7 +53,7 @@ void HTTPSRequest::Join() { if (!res_ || !req_) return; // No pending operation. // Tear down. - if (completed_ && res_) { + if (completed_) { _dbg_assert_(req_); naettClose(res_); naettFree(req_); diff --git a/Common/Render/Text/draw_text_android.cpp b/Common/Render/Text/draw_text_android.cpp index df8da6a8b8..2236cd1cbc 100644 --- a/Common/Render/Text/draw_text_android.cpp +++ b/Common/Render/Text/draw_text_android.cpp @@ -37,7 +37,7 @@ TextDrawerAndroid::~TextDrawerAndroid() { // At worst we leak one ref... // env_->DeleteGlobalRef(cls_textRenderer); ClearCache(); - ClearFonts(); + fontMap_.clear(); // size is precomputed using dpiScale_. } bool TextDrawerAndroid::IsReady() const { @@ -58,8 +58,8 @@ uint32_t TextDrawerAndroid::SetFont(const char *fontName, int size, int flags) { } // Just chose a factor that looks good, don't know what unit size is in anyway. - AndroidFontEntry entry; - entry.size = (float)(size * 1.4f) / dpiScale_; + AndroidFontEntry entry{}; + entry.size = ((float)size * 1.4f) / dpiScale_; fontMap_[fontHash] = entry; fontHash_ = fontHash; return fontHash; diff --git a/Common/UI/Screen.cpp b/Common/UI/Screen.cpp index 7f88d7648e..8e1c02752e 100644 --- a/Common/UI/Screen.cpp +++ b/Common/UI/Screen.cpp @@ -61,7 +61,9 @@ void ScreenManager::switchScreen(Screen *screen) { WARN_LOG(Log::System, "Switching to a zero screen, this can't be good"); } if (stack_.empty() || screen != stack_.back().screen) { - screen->setScreenManager(this); + if (screen) { + screen->setScreenManager(this); + } nextStack_.push_back({ screen, 0 }); } } diff --git a/Common/UI/UI.h b/Common/UI/UI.h index f73ab0a7a6..39d6855f5d 100644 --- a/Common/UI/UI.h +++ b/Common/UI/UI.h @@ -53,7 +53,6 @@ class StringVectorListAdapter : public UIListAdapter { public: StringVectorListAdapter(const std::vector *items) : items_(items) {} size_t getCount() const override { return items_->size(); } - void drawItem(int item, int x, int y, int w, int h, bool active) const override; private: const std::vector *items_; diff --git a/Common/UI/ViewGroup.h b/Common/UI/ViewGroup.h index da2e4e5fd0..01e253ac3c 100644 --- a/Common/UI/ViewGroup.h +++ b/Common/UI/ViewGroup.h @@ -69,7 +69,7 @@ public: virtual void SetBG(const Drawable &bg) { bg_ = bg; } - virtual void Clear(); + void Clear(); void PersistData(PersistStatus status, std::string anonId, PersistMap &storage) override; View *GetViewByIndex(int index) { return views_[index]; } int GetNumSubviews() const { return (int)views_.size(); } diff --git a/UI/GameInfoCache.h b/UI/GameInfoCache.h index ea50e3fd68..8b9c82a184 100644 --- a/UI/GameInfoCache.h +++ b/UI/GameInfoCache.h @@ -211,7 +211,6 @@ public: void FlushBGs(); // Gets rid of all BG textures. Also gets rid of bg sounds. void CancelAll(); - void WaitUntilDone(std::shared_ptr &info); private: void Init(); diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index b5af66d36d..0d0341c273 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -520,8 +520,6 @@ void PromptScreen::CreateViews() { // Scrolling action menu to the right. using namespace UI; - Margins actionMenuMargins(0, 100, 15, 0); - root_ = new AnchorLayout(); root_->Add(new TextView(message_, ALIGN_LEFT | FLAG_WRAP_TEXT, false, new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, 15, 15, 330, 10)))->SetClip(false); diff --git a/UI/OnScreenDisplay.cpp b/UI/OnScreenDisplay.cpp index c02e5bcbe0..db3c731108 100644 --- a/UI/OnScreenDisplay.cpp +++ b/UI/OnScreenDisplay.cpp @@ -187,8 +187,6 @@ static void MeasureOSDProgressBar(const UIContext &dc, const OnScreenDisplay::En } static void RenderOSDProgressBar(UIContext &dc, const OnScreenDisplay::Entry &entry, Bounds bounds, int align, float alpha) { - uint32_t foreGround = whiteAlpha(alpha); - dc.DrawRectDropShadow(bounds, 12.0f, 0.7f * alpha); uint32_t backgroundColor = colorAlpha(0x806050, alpha); diff --git a/UI/ReportScreen.cpp b/UI/ReportScreen.cpp index 8458507c99..6d65a67003 100644 --- a/UI/ReportScreen.cpp +++ b/UI/ReportScreen.cpp @@ -77,7 +77,7 @@ RatingChoice::RatingChoice(std::string_view captionKey, int *value, LayoutParams Add(group_); group_->SetSpacing(0.0f); - SetupChoices(); + RatingChoice::SetupChoices(); } void RatingChoice::Update() { @@ -147,7 +147,7 @@ protected: CompatRatingChoice::CompatRatingChoice(const char *captionKey, int *value, LayoutParams *layoutParams) : RatingChoice(captionKey, value, layoutParams) { - SetupChoices(); + CompatRatingChoice::SetupChoices(); } void CompatRatingChoice::SetupChoices() { diff --git a/UI/RetroAchievementScreens.cpp b/UI/RetroAchievementScreens.cpp index d7022ef567..bf5002b87e 100644 --- a/UI/RetroAchievementScreens.cpp +++ b/UI/RetroAchievementScreens.cpp @@ -14,7 +14,7 @@ #include "UI/OnScreenDisplay.h" static inline std::string_view DeNull(const char *ptr) { - return ptr ? std::string_view(ptr) : ""; + return std::string_view(ptr ? ptr : ""); } // Compound view, creating a FileChooserChoice inside. @@ -221,9 +221,9 @@ void RetroAchievementsLeaderboardScreen::CreateTabs() { const rc_client_leaderboard_entry_t &entry = entryList_->entries[i]; char buffer[512]; - rc_client_leaderboard_entry_get_user_image_url(&entryList_->entries[i], buffer, sizeof(buffer)); + rc_client_leaderboard_entry_get_user_image_url(&entry, buffer, sizeof(buffer)); // Can also show entry.submitted, which is a time_t. And maybe highlight recent ones? - layout->Add(new LeaderboardEntryView(&entryList_->entries[i], is_self)); + layout->Add(new LeaderboardEntryView(&entry, is_self)); } } } diff --git a/UI/TiltAnalogSettingsScreen.cpp b/UI/TiltAnalogSettingsScreen.cpp index 991bb95686..5b317a6c8c 100644 --- a/UI/TiltAnalogSettingsScreen.cpp +++ b/UI/TiltAnalogSettingsScreen.cpp @@ -65,7 +65,7 @@ void TiltAnalogSettingsScreen::CreateViews() { switch (g_Config.iTiltInputType) { case TILT_DPAD: { - PSPDpad *pad = rightSide->Add(new PSPDpad(ImageID("I_DIR_LINE"), "D-pad", ImageID("I_DIR_LINE"), ImageID("I_ARROW"), 1.5f, 1.3f, new AnchorLayoutParams(NONE, NONE, NONE, NONE, true))); + rightSide->Add(new PSPDpad(ImageID("I_DIR_LINE"), "D-pad", ImageID("I_DIR_LINE"), ImageID("I_ARROW"), 1.5f, 1.3f, new AnchorLayoutParams(NONE, NONE, NONE, NONE, true))); break; } case TILT_ACTION_BUTTON: diff --git a/UI/TouchControlLayoutScreen.cpp b/UI/TouchControlLayoutScreen.cpp index 47190891d6..16329dbd9b 100644 --- a/UI/TouchControlLayoutScreen.cpp +++ b/UI/TouchControlLayoutScreen.cpp @@ -286,7 +286,6 @@ public: void Draw(UIContext &dc) override { float opacity = GamepadGetOpacity(); uint32_t colorBg = colorAlpha(GetButtonColor(), opacity); - uint32_t downBg = colorAlpha(0x00FFFFFF, opacity * 0.5f); const ImageID stickImage = g_Config.iTouchButtonStyle ? ImageID("I_STICK_LINE") : ImageID("I_STICK"); const ImageID stickBg = g_Config.iTouchButtonStyle ? ImageID("I_STICK_BG_LINE") : ImageID("I_STICK_BG"); @@ -379,7 +378,6 @@ bool ControlLayoutView::Touch(const TouchInput &touch) { if ((touch.flags & TOUCH_MOVE) && pickedControl_ != nullptr) { if (mode_ == 0) { - const Bounds &controlBounds = pickedControl_->GetBounds(); // Allow placing the control halfway outside the play area. Bounds validRange = this->GetBounds(); @@ -387,7 +385,9 @@ bool ControlLayoutView::Touch(const TouchInput &touch) { validRange.x = 0.0f; validRange.y = 0.0f; - // This make cure the controll is all inside the screen (commended out only half) + // TODO: Worth keeping? + // This make sure the control is all inside the screen (commented out only half) + // const Bounds &controlBounds = pickedControl_->GetBounds(); //validRange.x += controlBounds.w * 0.5f; //validRange.w -= controlBounds.w; //validRange.y += controlBounds.h * 0.5f; @@ -478,7 +478,6 @@ void ControlLayoutView::CreateViews() { ImageID shoulderImage = g_Config.iTouchButtonStyle ? ImageID("I_SHOULDER_LINE") : ImageID("I_SHOULDER"); ImageID stickImage = g_Config.iTouchButtonStyle ? ImageID("I_STICK_LINE") : ImageID("I_STICK"); ImageID stickBg = g_Config.iTouchButtonStyle ? ImageID("I_STICK_BG_LINE") : ImageID("I_STICK_BG"); - ImageID roundImage = g_Config.iTouchButtonStyle ? ImageID("I_ROUND_LINE") : ImageID("I_ROUND"); auto addDragDropButton = [&](ConfigTouchPos &pos, const char *key, ImageID bgImg, ImageID img) { DragDropButton *b = nullptr; diff --git a/android/jni/OpenSLContext.cpp b/android/jni/OpenSLContext.cpp index 32d951b854..f90796974f 100644 --- a/android/jni/OpenSLContext.cpp +++ b/android/jni/OpenSLContext.cpp @@ -291,7 +291,7 @@ OpenSLContext::~OpenSLContext() { (*outputMixObject)->Destroy(outputMixObject); outputMixObject = nullptr; } - AudioRecord_Stop(); + OpenSLContext::AudioRecord_Stop(); INFO_LOG(Log::Audio, "OpenSL: Shutdown - deleting engine object");