Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS native bar button items #16922

Merged
merged 9 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1271,8 +1271,9 @@ elseif(TARGET SDL2::SDL2)
endif()
set(nativeExtraLibs ${nativeExtraLibs} SDL2::SDL2)
if(APPLE)
set(nativeExtra ${nativeExtra} SDL/SDLMain.h SDL/SDLMain.mm SDL/SDLCocoaMetalLayer.h SDL/SDLCocoaMetalLayer.mm UI/DarwinFileSystemServices.mm UI/DarwinFileSystemServices.h Common/Battery/AppleBatteryClient.m)
set(nativeExtra ${nativeExtra} SDL/SDLMain.h SDL/SDLMain.mm SDL/SDLCocoaMetalLayer.h SDL/SDLCocoaMetalLayer.mm SDL/CocoaBarItems.mm SDL/CocoaBarItems.h UI/DarwinFileSystemServices.mm UI/DarwinFileSystemServices.h Common/Battery/AppleBatteryClient.m)
set_source_files_properties(UI/DarwinFileSystemServices.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
set_source_files_properties(SDL/CocoaBarItems.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
set_source_files_properties(Common/Battery/AppleBatteryClient.m PROPERTIES COMPILE_FLAGS -fobjc-arc)
set(nativeExtraLibs ${nativeExtraLibs} ${COCOA_LIBRARY} ${QUARTZ_CORE_LIBRARY} ${IOKIT_LIBRARY})
elseif(USING_EGL)
Expand Down
9 changes: 9 additions & 0 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,15 @@ void Config::SetAppendedConfigIni(const Path &path) {
appendedConfigFileName_ = path;
}

void Config::UpdateAfterSettingAutoFrameSkip() {
if (bAutoFrameSkip && iFrameSkip == 0) {
iFrameSkip = 1;
}

if (bAutoFrameSkip && bSkipBufferEffects) {
bSkipBufferEffects = false;
}
}

void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
if (!bUpdatedInstanceCounter) {
Expand Down
3 changes: 1 addition & 2 deletions Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,8 @@ struct Config {
const std::map<std::string, std::pair<std::string, int>> &GetLangValuesMapping();
bool LoadAppendedConfig();
void SetAppendedConfigIni(const Path &path);

void UpdateAfterSettingAutoFrameSkip();
void NotifyUpdatedCpuCore();

protected:
void LoadStandardControllerIni();
void LoadLangValuesMapping();
Expand Down
18 changes: 18 additions & 0 deletions SDL/CocoaBarItems.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// CocoaBarItems.h
// PPSSPP
//
// Created by Serena on 06/02/2023.
//

#pragma once

#ifdef __cplusplus
extern "C" {
#endif

void initBarItemsForApp();

#ifdef __cplusplus
}
#endif
Loading