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 Support #270

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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 mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"geode": "4.0.1",
"gd": {
"win": "2.2074",
"android": "2.2074"
"android": "2.2074",
"mac": "2.2074"
},
"version": "v2.1.3",
"id": "zilko.xdbot",
Expand Down
10 changes: 5 additions & 5 deletions src/keybinds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ namespace keybinds {

#endif

#ifdef GEODE_IS_WINDOWS


using namespace keybinds;

void onKeybind(bool down, ActionID id) {
#ifdef GEODE_IS_WINDOWS

auto& g = Global::get();

Expand Down Expand Up @@ -130,14 +132,11 @@ void onKeybind(bool down, ActionID id) {
}
}

#endif

}

$execute{

#ifdef GEODE_IS_WINDOWS

BindManager * bm = BindManager::get();

bm->registerBindable({
Expand Down Expand Up @@ -226,5 +225,6 @@ void onKeybind(bool down, ActionID id) {
}, InvokeBindFilter(nullptr, (""_spr) + keybindIDs[i]));
}

#endif
}

#endif
2 changes: 1 addition & 1 deletion src/practice_fixes/play_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class $modify(GJBaseGameLayer) {
};

class $modify(CheckpointObject) {
#ifdef GEODE_IS_WINDOWS
#ifndef GEODE_IS_ANDROID
bool init() {
bool ret = CheckpointObject::init();
CheckpointObject* cp = this;
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void Renderer::start() {
if (extraArgs.empty()) extraArgs = "-pix_fmt yuv420p";
if (videoArgs.empty()) videoArgs = "colorspace=all=bt709:iall=bt470bg:fast=1";

std::string command = std::format(
std::string command = fmt::format(
"\"{}\" -y -f rawvideo -pix_fmt rgb24 -s {}x{} -r {} -i - {}{}{} -vf \"vflip,{}\" -an \"{}\" ",
ffmpegPath,
std::to_string(width),
Expand Down Expand Up @@ -272,7 +272,7 @@ void Renderer::start() {
// std::string tempPathAudio = tempPath;

if (audioMode == AudioMode::Record) {
command = std::format("\"{}\" -i \"{}\" -acodec pcm_s16le -ar 44100 -ac 2 \"{}\"",
command = fmt::format("\"{}\" -i \"{}\" -acodec pcm_s16le -ar 44100 -ac 2 \"{}\"",
ffmpegPath,
"fmodoutput.wav",
tempPathAudio
Expand All @@ -295,7 +295,7 @@ void Renderer::start() {

if (!extraAudioArgs.empty()) extraAudioArgs += " ";

command = std::format(
command = fmt::format(
"\"{}\" -y -ss {} -i \"{}\" -i \"{}\" -t {} -c:v copy {} -filter:a \"[1:a]adelay=0|0{}{}\" \"{}\"",
ffmpegPath,
offset,
Expand Down
4 changes: 2 additions & 2 deletions src/ui/button_edit_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ void ButtonEditLayer::updateSelectedLabels() {

oss << std::fixed << std::setprecision(1) << scale;

scaleLbl->setString(std::format("Scale ({})", oss.str()).c_str());
scaleLbl->setString(fmt::format("Scale ({})", oss.str()).c_str());

std::ostringstream oss2;
oss2 << std::fixed << std::setprecision(1) << opacity;

opacityLbl->setString(std::format("Opacity ({})", oss2.str()).c_str());
opacityLbl->setString(fmt::format("Opacity ({})", oss2.str()).c_str());
}

void ButtonEditLayer::updateSelected(std::string selected) {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/macro_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ void MacroEditLayer::flashSelected() {
CCSequence* colorSeq = CCSequence::create(tintTo, tintFrom, nullptr);
CCSequence* opacitySeq = CCSequence::create(fadeTo, fadeFrom, nullptr);

CCSpawn* spawn = CCSpawn::create(colorSeq, opacitySeq, nullptr);
CCSpawn* spawn = CCSpawn::createWithTwoActions(colorSeq, opacitySeq);

selectedBg->runAction(spawn);

Expand Down
4 changes: 2 additions & 2 deletions src/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ std::string Utils::narrow(const wchar_t* str) {
return "";
}

#ifdef GEODE_IS_ANDROID
#ifndef GEODE_IS_WINDOWS
std::string result;
size_t len = wcslen(str);

Expand Down Expand Up @@ -44,7 +44,7 @@ std::string Utils::narrow(const wchar_t* str) {
}

std::wstring Utils::widen(const char* str) {
#ifdef GEODE_IS_ANDROID
#ifndef GEODE_IS_WINDOWS

std::wstring result;
result.reserve(strlen(str));
Expand Down