#include #include "StartScene.h" #include "data.h" #include "storage.h" #include "audio_manager.h" using namespace extra2d; // ============================================================================ // 程序入口 // ============================================================================ int main(int argc, char **argv) { Logger::init(); Logger::setLevel(LogLevel::Debug); E2D_LOG_INFO("========================"); E2D_LOG_INFO("Extra2D push_box"); E2D_LOG_INFO("========================"); auto &app = Application::instance(); AppConfig config; config.title = "Extra2D - push_box"; config.width = 1280; config.height = 720; config.vsync = true; config.fpsLimit = 60; if (!app.init(config)) { E2D_LOG_ERROR("应用初始化失败!"); return -1; } // 初始化存储系统 // 在 Windows 上使用当前工作目录,在 Switch 上使用 sdmc:/ #ifdef __SWITCH__ pushbox::initStorage("sdmc:/"); #else pushbox::initStorage("."); #endif pushbox::g_CurrentLevel = pushbox::loadCurrentLevel(1); if (pushbox::g_CurrentLevel > MAX_LEVEL) { pushbox::g_CurrentLevel = 1; } pushbox::g_SoundOpen = pushbox::loadSoundOpen(true); // 初始化全局音频管理器 pushbox::AudioManager::instance().init(); // 进入开始场景(主界面) app.enterScene(makePtr()); E2D_LOG_INFO("开始主循环..."); app.run(); E2D_LOG_INFO("应用结束"); return 0; }