#!/bin/bash
# Pokeemerald PC Port - Build Script
# Run this on Debian/Ubuntu to compile the native PC port

set -e

echo "=== Install Dependencies ==="
sudo apt-get install -y cmake build-essential libsdl2-dev git

echo "=== Clone Game Source ==="
if [ ! -d "pokeemerald-multiplayer" ]; then
    git clone https://gitea.lucysucks.de/hermes/pokeemerald-multiplayer.git
fi
cd pokeemerald-multiplayer

echo "=== Build ==="
cmake -B build -DPOKEEMERALD_USE_SDL2=ON
cmake --build build -j$(nproc)

echo "=== Done ==="
echo "Run: ./build/pokeemerald_pc"
echo "Headless: ./build/pokeemerald_pc --headless"
echo "Debug: POKEEMERALD_VIDEO_DEBUG=1 ./build/pokeemerald_pc"
