#!/bin/bash
# 战场探索系统启动脚本
# 清理snap环境变量，避免库冲突

# 清理可能导致冲突的snap环境变量
unset GTK_PATH
unset LOCPATH
unset GIO_MODULE_DIR
unset GSETTINGS_SCHEMA_DIR

# 设置Qt环境变量以解决GPU上下文问题
export QT_QUICK_BACKEND=software
export QT_OPENGL=software
export LIBGL_ALWAYS_SOFTWARE=1
export QTWEBENGINE_DISABLE_GPU_THREAD=1
export QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu --disable-software-rasterizer --disable-gpu-sandbox"

# 启动程序
exec ./BattlefieldExplorationSystem "$@"
