Skip to content

ack00gar/OFS

 
 

Repository files navigation

OpenFunscripter - FunGen Edition

FunGen Edition is a customized build of OpenFunscripter optimized to fully support macOS Apple Silicon with enhanced upcoming features.


💚 Support Development

Your donations help support the development of FunGen and contribute to potential future enhancements of OFS FunGen Edition.

ko-fi

About FunGen

FunGen is a Python-based tool that uses AI to generate Funscript files from VR and 2D POV videos. It enables fully automated funscript creation for individual scenes or entire folders of videos.

Join the Discord community for discussions and support: Discord Community


Features

  • Native Apple Silicon (ARM64) support - Runs natively on M1, M2, M3, M4, M5 Macs
  • FunGen Edition branding - Custom logo and About window
  • Debug features enabled - Includes "Reset layout" and other development tools
  • macOS integration - Native file explorer and URL opening
  • ARM64 optimizations - Uses ARM64-specific CPU instructions

Prerequisites

macOS

  • macOS 11.0 (Big Sur) or later
  • Xcode Command Line Tools: xcode-select --install
  • Homebrew: https://brew.sh
  • CMake: brew install cmake
  • pkg-config: brew install pkg-config
  • mpv (for video playback): brew install mpv

Windows

Linux

# Debian/Ubuntu
sudo apt-get install build-essential cmake git pkg-config libmpv-dev libgl1-mesa-dev

# Fedora
sudo dnf install gcc-c++ cmake git pkgconfig mpv-libs-devel mesa-libGL-devel

# Arch Linux
sudo pacman -S base-devel cmake git pkgconf mpv mesa

Platform Support

  • macOS (Apple Silicon & Intel) - Fully tested and supported
  • ⚠️ Windows - Should work, but untested in this fork
  • ⚠️ Linux - Should work, but untested in this fork

For Windows and Linux, follow the build instructions below. They should work as the codebase is cross-platform, but please report any issues you encounter.

Building from Source

1. Clone the Repository

git clone https://github.com/ack00gar/OFS.git
cd OFS
git submodule update --init --recursive

2. Build

macOS (Apple Silicon & Intel) - TESTED ✅

⚠️ IMPORTANT: Use the automated build script! It prevents common build issues like CMake policy errors and mpv architecture mismatches.

Automated Build Script (Strongly Recommended)

The build script automatically:

  • Detects your Mac architecture (ARM64 or Intel)
  • Checks for and installs ARM64 Homebrew (on Apple Silicon)
  • Validates mpv architecture and reinstalls if needed
  • Fixes CMake policy compatibility issues
  • Handles all dependencies and configuration
# Make the script executable (first time only)
chmod +x build-macos.sh

# Standard Release build (optimized, smaller binary)
./build-macos.sh

# Debug build (includes development features)
BUILD_TYPE=Debug ./build-macos.sh

# Universal Binary (Intel + ARM64, requires both architecture dependencies)
UNIVERSAL_BINARY=yes ./build-macos.sh

The binary will be at: bin/OpenFunscripter.app

Manual CMake Build (Advanced Users)

Note: Manual building may require additional flags for CMake policy compatibility and doesn't include automatic dependency validation. If you encounter errors, use the automated build script instead.

# Configure for ARM64 native build (Debug mode for full features)
cmake -B build \
  -DCMAKE_BUILD_TYPE=Debug \
  -DCMAKE_OSX_ARCHITECTURES=arm64 \
  -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0

# Build (use all CPU cores)
cmake --build build -j$(sysctl -n hw.ncpu)

# The app bundle will be at: bin/OpenFunscripter.app

If you encounter CMake policy errors with submodules, add this flag:

cmake -B build \
  -DCMAKE_BUILD_TYPE=Debug \
  -DCMAKE_OSX_ARCHITECTURES=arm64 \
  -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
  -DCMAKE_POLICY_VERSION_MINIMUM=3.5

For Universal Binary (Intel + ARM64):

cmake -B build \
  -DCMAKE_BUILD_TYPE=Debug \
  -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
  -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0

cmake --build build -j$(sysctl -n hw.ncpu)

Before building manually, ensure you have the correct mpv architecture:

# On Apple Silicon (M1, M2, M3, M4, M5), use ARM64 Homebrew
/opt/homebrew/bin/brew install mpv

# On Intel Macs, use standard Homebrew
/usr/local/bin/brew install mpv

Windows - UNTESTED ⚠️

# Configure
cmake -B build -DCMAKE_BUILD_TYPE=Debug

# Build
cmake --build build --config Debug -j%NUMBER_OF_PROCESSORS%

# The executable will be at: bin\OpenFunscripter.exe

Note: Windows build is untested in this fork. The build should work as the original OFS supports Windows, but please report any issues.

Linux - UNTESTED ⚠️

# Configure
cmake -B build -DCMAKE_BUILD_TYPE=Debug

# Build
cmake --build build -j$(nproc)

# The executable will be at: bin/OpenFunscripter

Note: Linux build is untested in this fork. The build should work as the original OFS supports Linux, but please report any issues.

3. Install (Optional)

macOS

# Copy to Applications folder
cp -R bin/OpenFunscripter.app /Applications/

Linux

# Copy to /usr/local/bin
sudo cp bin/OpenFunscripter /usr/local/bin/

Build Types

Choose the appropriate build type based on your needs:

  • Debug (Recommended for development)

    • Includes debug symbols and development features
    • "Reset layout" option in View menu
    • Larger file size (~24MB on macOS)
    • No optimizations (slower performance)
    • Use: -DCMAKE_BUILD_TYPE=Debug
  • Release (Production)

    • Fully optimized for performance
    • Smallest file size (~5.5MB on macOS)
    • No debug features
    • Use: -DCMAKE_BUILD_TYPE=Release
  • RelWithDebInfo (Balanced)

    • Optimized with debug symbols
    • Medium file size (~6MB on macOS)
    • Use: -DCMAKE_BUILD_TYPE=RelWithDebInfo

SDL2 Compilation Fix (macOS ARM64)

This build includes a fix for SDL2 compilation on macOS ARM64. The fix prevents C99 declaration errors in HIDAPI by modifying lib/SDL2/CMakeLists.txt:535-543:

# Skip -Werror flag on Apple to avoid HIDAPI compilation issues
if(HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT AND NOT APPLE)
  list(APPEND EXTRA_CFLAGS "-Werror=declaration-after-statement")
endif()

Dependencies

macOS

mpv is required for video playback. Install via Homebrew:

brew install mpv

Building from Source

All dependencies are included as git submodules except:

  • mpv/ffmpeg - Required for video playback (Homebrew on macOS, apt/dnf/pacman on Linux)
  • OpenGL - System provided

Included Submodules:

  • SDL2 (windowing, input, events)
  • ImGui (UI framework)
  • Lua 5.4 (scripting)
  • glad2 (OpenGL loader)
  • glm (math library)
  • json (nlohmann/json)
  • sol2 (Lua bindings)
  • bitsery (serialization)
  • tracy (profiling, optional)

macOS Installation & Code Signing

⚠️ Important: App is Not Code Signed

This app is not code signed with an Apple Developer certificate. macOS will show a security warning on first launch.

How to Open the App

Method 1: Right-Click Open (Recommended)

  1. Download and extract OpenFunscripter.app
  2. Right-click (or Control-click) the app
  3. Select "Open" from the menu
  4. Click "Open" in the security dialog
  5. The app will now run normally

Method 2: Remove Quarantine Flag (Terminal)

xattr -cr /Applications/OpenFunscripter.app

Note: You only need to do this once. After the first launch, the app will open normally.

Troubleshooting

macOS: Architecture Mismatch (mpv loading fails)

Symptom: App runs but shows error: Failed to load mpv library or incompatible architecture (have 'x86_64', need 'arm64')

Cause: You have Intel (x86_64) mpv installed on an Apple Silicon Mac, or vice versa.

Solution:

The build-macos.sh script automatically detects and fixes this issue. If you encounter this error:

# For Apple Silicon Macs - Install ARM64 mpv
/opt/homebrew/bin/brew install mpv

# For Intel Macs - Install x86_64 mpv
/usr/local/bin/brew install mpv

Alternatively, rebuild as Universal Binary to support both architectures:

UNIVERSAL_BINARY=yes ./build-macos.sh

macOS: Missing video playback

If video playback doesn't work, install mpv via Homebrew:

brew install mpv

Linux: Missing libmpv.so

Install mpv development libraries:

# Debian/Ubuntu
sudo apt-get install libmpv-dev

# Fedora
sudo dnf install mpv-libs-devel

# Arch
sudo pacman -S mpv

Windows: libmpv-2.dll

The Windows build automatically downloads the latest mpv build during compilation from zhongfly/mpv-winbuild (updated daily).

If automatic download fails:

  1. Download the latest mpv-dev-x86_64-*.7z (standard build, NOT the v3 variant) from GitHub Releases
  2. Extract libmpv-2.dll from the archive
  3. Place it in your build/ directory before compiling

Note: Use the standard mpv-dev-x86_64-*.7z build for maximum compatibility. The v3 variant (mpv-dev-x86_64-v3-*.7z) requires newer CPUs with AVX2 support and may not work on older systems.

The build system fetches the latest version automatically via GitHub API.

Project Structure

OFS-FunGen/
├── bin/                      # Build output
├── build/                    # CMake build directory
├── data/                     # Assets (icons, logos)
│   ├── fungen_logo.png
│   ├── icon.icns
│   ├── logo16.png
│   └── logo64.png
├── lib/                      # Third-party libraries (submodules)
├── src/                      # Source code
├── OFS-lib/                  # Core library
├── localization/             # Translation files
├── CMakeLists.txt
└── README.md

FunGen Edition Changes

This edition includes the following customizations:

  1. Branding

    • "FunGen Edition" in window title
    • Custom FunGen logo in About window
    • macOS-specific build info (on macOS only)
  2. macOS Integration

    • Native ARM64 support for Apple Silicon
    • Force software decoding on M1/M2 for compatibility
    • Multi-location libmpv loading (Homebrew Intel/ARM paths)
    • Native file explorer via open command
  3. Build System

    • SDL2 compilation fix for macOS ARM64
    • Universal binary support
    • Debug build recommended for full feature set

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -m "Add my feature"
  4. Push to the branch: git push origin feature/my-feature
  5. Open a Pull Request

License

This project inherits the license from the original OpenFunscripter project.

Credits

About

OFS - FunGen edition

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages

  • C 53.6%
  • C++ 44.8%
  • CMake 0.7%
  • Lua 0.3%
  • Shell 0.3%
  • GLSL 0.2%
  • Other 0.1%