195 lines
4.5 KiB
C
195 lines
4.5 KiB
C
|
|
//#pragma once
|
|||
|
|
////<2F><>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>Map
|
|||
|
|
//extern std::map<uint64_t, ActorPtr>ActorPtrMapObject;
|
|||
|
|
//
|
|||
|
|
//std::string UTF8toString(const std::string& strSrc)
|
|||
|
|
//{
|
|||
|
|
// int nwLen = MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, NULL, 0);
|
|||
|
|
//
|
|||
|
|
// wchar_t* pwBuf = new wchar_t[nwLen + 1];//һ<><D2BB>Ҫ<EFBFBD><D2AA>1<EFBFBD><31><EFBFBD><EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>β<EFBFBD><CEB2>
|
|||
|
|
// memset(pwBuf, 0, nwLen * 2 + 2);
|
|||
|
|
//
|
|||
|
|
// MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), strSrc.length(), pwBuf, nwLen);
|
|||
|
|
//
|
|||
|
|
// int nLen = WideCharToMultiByte(CP_ACP, 0, pwBuf, -1, NULL, NULL, NULL, NULL);
|
|||
|
|
//
|
|||
|
|
// char* pBuf = new char[nLen + 1];
|
|||
|
|
// memset(pBuf, 0, nLen + 1);
|
|||
|
|
//
|
|||
|
|
// WideCharToMultiByte(CP_ACP, 0, pwBuf, nwLen, pBuf, nLen, NULL, NULL);
|
|||
|
|
//
|
|||
|
|
// std::string retStr = pBuf;
|
|||
|
|
//
|
|||
|
|
// delete[]pBuf;
|
|||
|
|
// delete[]pwBuf;
|
|||
|
|
//
|
|||
|
|
// pBuf = NULL;
|
|||
|
|
// pwBuf = NULL;
|
|||
|
|
//
|
|||
|
|
// return retStr;
|
|||
|
|
//
|
|||
|
|
//}
|
|||
|
|
//
|
|||
|
|
//std::string string_To_UTF8(const std::string& strSrc)
|
|||
|
|
//{
|
|||
|
|
// int nwLen = ::MultiByteToWideChar(CP_ACP, 0, strSrc.c_str(), -1, NULL, 0);
|
|||
|
|
//
|
|||
|
|
// wchar_t* pwBuf = new wchar_t[nwLen + 1];//һ<><D2BB>Ҫ<EFBFBD><D2AA>1<EFBFBD><31><EFBFBD><EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>β<EFBFBD><CEB2>
|
|||
|
|
// ZeroMemory(pwBuf, nwLen * 2 + 2);
|
|||
|
|
//
|
|||
|
|
// ::MultiByteToWideChar(CP_ACP, 0, strSrc.c_str(), strSrc.length(), pwBuf, nwLen);
|
|||
|
|
//
|
|||
|
|
// int nLen = ::WideCharToMultiByte(CP_UTF8, 0, pwBuf, -1, NULL, NULL, NULL, NULL);
|
|||
|
|
//
|
|||
|
|
// char* pBuf = new char[nLen + 1];
|
|||
|
|
// ZeroMemory(pBuf, nLen + 1);
|
|||
|
|
//
|
|||
|
|
// ::WideCharToMultiByte(CP_UTF8, 0, pwBuf, nwLen, pBuf, nLen, NULL, NULL);
|
|||
|
|
//
|
|||
|
|
// std::string retStr(pBuf);
|
|||
|
|
//
|
|||
|
|
// delete[]pwBuf;
|
|||
|
|
// delete[]pBuf;
|
|||
|
|
//
|
|||
|
|
// pwBuf = NULL;
|
|||
|
|
// pBuf = NULL;
|
|||
|
|
//
|
|||
|
|
// return retStr;
|
|||
|
|
//}
|
|||
|
|
//
|
|||
|
|
//void ControlPanel(const SQChar* Name)
|
|||
|
|
//{
|
|||
|
|
// ImGui::Begin(u8"<22><><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD>", 0, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove);
|
|||
|
|
//
|
|||
|
|
// sq_pushroottable(v);
|
|||
|
|
// sq_pushstring(v, Name, -1);
|
|||
|
|
// sq_get(v, -2);
|
|||
|
|
// sq_pushroottable(v);
|
|||
|
|
// sq_pushstring(v, _SST("Lenheart"), -1);
|
|||
|
|
// sq_call(v, 2, 0, 1);
|
|||
|
|
// sq_pop(v, 2);
|
|||
|
|
//
|
|||
|
|
//
|
|||
|
|
// ImGui::End();
|
|||
|
|
//}
|
|||
|
|
//
|
|||
|
|
//
|
|||
|
|
//
|
|||
|
|
////<2F><><EFBFBD><EFBFBD>Imguiͼ<69><CDBC>
|
|||
|
|
//static SQInteger Create_ImguiLayer(HSQUIRRELVM v)
|
|||
|
|
//{
|
|||
|
|
// SQInteger Top = sq_gettop(v);
|
|||
|
|
// if (Top <= 0)
|
|||
|
|
// {
|
|||
|
|
// sq_throwerror(v, _SST("Incorrect function argument"));
|
|||
|
|
// return 0;
|
|||
|
|
// }
|
|||
|
|
//
|
|||
|
|
// const SQChar* ImguiName;
|
|||
|
|
// sq_getstring(v, 2, &ImguiName);
|
|||
|
|
//
|
|||
|
|
//
|
|||
|
|
// auto f1 = std::bind(&ControlPanel, ImguiName);
|
|||
|
|
//
|
|||
|
|
// // <20><><EFBFBD><EFBFBD> ImGui ͼ<><CDBC>
|
|||
|
|
// ImGuiLayerPtr layer = new ImGuiLayer((char*)ImguiName, f1);
|
|||
|
|
//
|
|||
|
|
// //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΨһID
|
|||
|
|
// uint64_t UUID = layer->GetObjectID();
|
|||
|
|
//
|
|||
|
|
// //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Map<61><70><EFBFBD><EFBFBD>
|
|||
|
|
// ActorPtrMapObject[UUID] = layer;
|
|||
|
|
//
|
|||
|
|
// sq_pushinteger(v, UUID);
|
|||
|
|
//
|
|||
|
|
// return 1;
|
|||
|
|
//}
|
|||
|
|
//
|
|||
|
|
//
|
|||
|
|
////<2F><><EFBFBD><EFBFBD>Imgui<75><69><EFBFBD><EFBFBD>
|
|||
|
|
//static SQInteger Imgui_Text(HSQUIRRELVM v)
|
|||
|
|
//{
|
|||
|
|
// SQInteger Top = sq_gettop(v);
|
|||
|
|
// if (Top <= 0)
|
|||
|
|
// {
|
|||
|
|
// sq_throwerror(v, _SST("Incorrect function argument"));
|
|||
|
|
// return 0;
|
|||
|
|
// }
|
|||
|
|
//
|
|||
|
|
// const SQChar* ImguiName;
|
|||
|
|
// sq_getstring(v, 2, &ImguiName);
|
|||
|
|
//
|
|||
|
|
// ImGui::Text((char*)ImguiName);
|
|||
|
|
//
|
|||
|
|
// return 0;
|
|||
|
|
//}
|
|||
|
|
//
|
|||
|
|
////<2F><><EFBFBD>ô<EFBFBD><C3B4>ڴ<EFBFBD>С
|
|||
|
|
//static SQInteger Imgui_SetWindowSize(HSQUIRRELVM v)
|
|||
|
|
//{
|
|||
|
|
// SQInteger Top = sq_gettop(v);
|
|||
|
|
// if (Top <= 0)
|
|||
|
|
// {
|
|||
|
|
// sq_throwerror(v, _SST("Incorrect function argument"));
|
|||
|
|
// return 0;
|
|||
|
|
// }
|
|||
|
|
//
|
|||
|
|
// SQInteger X;
|
|||
|
|
// SQInteger Y;
|
|||
|
|
// sq_getinteger(v, 2, &X);
|
|||
|
|
// sq_getinteger(v, 3, &Y);
|
|||
|
|
//
|
|||
|
|
// ImGui::SetWindowSize(ImVec2(X, Y));
|
|||
|
|
// return 0;
|
|||
|
|
//}
|
|||
|
|
//
|
|||
|
|
////<2F><><EFBFBD>ô<EFBFBD><C3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
//static SQInteger Imgui_SetWindowPos(HSQUIRRELVM v)
|
|||
|
|
//{
|
|||
|
|
// SQInteger Top = sq_gettop(v);
|
|||
|
|
// if (Top <= 0)
|
|||
|
|
// {
|
|||
|
|
// sq_throwerror(v, _SST("Incorrect function argument"));
|
|||
|
|
// return 0;
|
|||
|
|
// }
|
|||
|
|
//
|
|||
|
|
// SQInteger X;
|
|||
|
|
// SQInteger Y;
|
|||
|
|
// sq_getinteger(v, 2, &X);
|
|||
|
|
// sq_getinteger(v, 3, &Y);
|
|||
|
|
//
|
|||
|
|
// ImGui::SetWindowPos(ImVec2(X, Y));
|
|||
|
|
// return 0;
|
|||
|
|
//}
|
|||
|
|
//
|
|||
|
|
//
|
|||
|
|
////<2F><><EFBFBD><EFBFBD>Imgui<75><69><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
//static SQInteger Imgui_InputText(HSQUIRRELVM v)
|
|||
|
|
//{
|
|||
|
|
// SQInteger Top = sq_gettop(v);
|
|||
|
|
// if (Top <= 0)
|
|||
|
|
// {
|
|||
|
|
// sq_throwerror(v, _SST("Incorrect function argument"));
|
|||
|
|
// return 0;
|
|||
|
|
// }
|
|||
|
|
//
|
|||
|
|
// const SQChar* InPutName;
|
|||
|
|
// sq_getstring(v, 2, &InPutName);
|
|||
|
|
//
|
|||
|
|
// ImGui::PushStyleColor(ImGuiCol_FrameBg, IM_COL32(0, 0, 0, 255));
|
|||
|
|
// static char buf[25] = u8"";
|
|||
|
|
// ImGui::InputText("##", buf, IM_ARRAYSIZE(buf));
|
|||
|
|
// ImGui::PopStyleColor();
|
|||
|
|
//
|
|||
|
|
//
|
|||
|
|
//
|
|||
|
|
// sq_pushroottable(v);
|
|||
|
|
// sq_pushstring(v, InPutName, -1);
|
|||
|
|
// sq_get(v, -2);
|
|||
|
|
// sq_pushroottable(v);
|
|||
|
|
// sq_pushstring(v, _SST(buf), -1);
|
|||
|
|
// sq_call(v, 2, 0, 1);
|
|||
|
|
// sq_pop(v, 2);
|
|||
|
|
// return 0;
|
|||
|
|
//}
|