Files
dl/project/dl_test/head.cpp
T
2026-09-16 15:55:49 +08:00

118 lines
2.0 KiB
C++

#include "head.h"
#include "ui_main.h"
#include "game_sudo.h"
#include "game_match.h"
void Test()
{
}
Tool::Manager* g_Tool;
void Init()
{
g_particle->SetReadOverwirte(true);
g_particle->LoadPath("particle/");
g_Tool = Tool::Manager::Create();
g_Tool->SetVisible(false);
g_Tool->SetSwitchAll(true);
g_ui->SetStandardSize({ 800, 600 });
g_ui->RegisterAll("ui/");
g_scene->Add("main", new UIMain);
//g_scene->Add("game", new GameSudo);
//g_scene->Add("game_match", new GameMatch);
//g_scene->SetCurrent("game_match");
UI::ResExplorer* win = UI::ResExplorer::Create();
win->ExFastSet();
g_ui->AddWindow("res_exp", win);
}
void Run()
{
g_Tool->Update();
auto win = g_ui->GetWindow("res_exp");
if (g_input->KeyDown(KeyCode::F10))
{
g_ui->ShowWindow(win, UI::WindowShowMode::TOGGLE);
}
if (win->IsClickClose())
{
g_ui->ShowWindow(win, UI::WindowShowMode::HIDE);
}
g_Tool->Render();
}
void Release()
{
delete g_Tool;
}
int Main()
{
Position* p_crash = nullptr;
//log_info("{}", to_string(*p_crash));
g_log->SetLogFile("log/");
//Engine::GetParamRef()._test = true;
Engine::Init();
Position p0;
Position p1{};
log_info("{}", to_string(p0));
log_info("{}", to_string(p1));
p0.x = 100;
p0.y = 200;
log_info("{}", to_string(p0));
Size s0;
s0.w = 800;
s0.h = 600;
log_info("{}", to_string(s0));
Quad q0{};
q0.x[0] = 1;
q0.y[0] = 2;
log_info("{}", to_string(q0));
{
FileIni ini;
ini.Open("ClientSetup.ini");
FileIniSection sec = ini.GetSection("Setup");
std::string v = sec.Get("HomePage");
}
Test();
g_mod->LoadModAll("mod/");
g_factory->SetPath("image/", "model/", "binary/", "temp/");
//g_factory->SetReleaseMode();
g_audio->Init("sound/config.json");
g_time->SetFPS(0);
g_system->SetFuncInit(Init);
g_system->SetFuncRun(Run);
#if DL_PLATFORM == DL_PLATFORM_ANDROID
//g_system->SetWindowDirection(WindowDirection::RIGHT);
#endif
ParamWindow p;
p._size = { 800, 600 };// { 1920, 1080 };
p._fullScreenMode = FullScreenMode::WINDOW;
g_system->Start(p);
Release();
Engine::Release();
return 0;
}