port: P3-e PythonMiniMap + miniMap module (1:1 40250)
Copy PythonMiniMap.cpp/PythonMiniMapModule.cpp and PRTerrainLib/StdAfx.cpp verbatim, drop the pending stand-in and the miniMap module stub, register initMiniMap() after initnet(). PR_FLOAT_TO_INTASM uses lrintf off MSVC; D3DXColorModulate added. CMapOutdoor is not ported, so the pending CMapManager::IsMapOutdoor() returns false (DIVERGENT) and the minimap's terrain and atlas paths stay on 40250's no-outdoor-map branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
070a27b2cb
commit
7358bf444a
@@ -104,21 +104,6 @@ void AddStubConstants_messenger(PyObject* poModule)
|
||||
(void) poModule;
|
||||
}
|
||||
|
||||
// 40250 UserInterface/PythonMiniMapModule.cpp
|
||||
void AddStubConstants_miniMap(PyObject* poModule)
|
||||
{
|
||||
(void) poModule;
|
||||
PyModule_AddIntConstant(poModule, "TYPE_OPC", CPythonMiniMap::TYPE_OPC);
|
||||
PyModule_AddIntConstant(poModule, "TYPE_OPCPVP", CPythonMiniMap::TYPE_OPCPVP);
|
||||
PyModule_AddIntConstant(poModule, "TYPE_OPCPVPSELF", CPythonMiniMap::TYPE_OPCPVPSELF);
|
||||
PyModule_AddIntConstant(poModule, "TYPE_NPC", CPythonMiniMap::TYPE_NPC);
|
||||
PyModule_AddIntConstant(poModule, "TYPE_MONSTER", CPythonMiniMap::TYPE_MONSTER);
|
||||
PyModule_AddIntConstant(poModule, "TYPE_WARP", CPythonMiniMap::TYPE_WARP);
|
||||
PyModule_AddIntConstant(poModule, "TYPE_WAYPOINT", CPythonMiniMap::TYPE_WAYPOINT);
|
||||
PyModule_AddIntConstant(poModule, "TYPE_PARTY", CPythonMiniMap::TYPE_PARTY);
|
||||
PyModule_AddIntConstant(poModule, "TYPE_EMPIRE", CPythonMiniMap::TYPE_EMPIRE);
|
||||
}
|
||||
|
||||
// 40250 UserInterface/PythonProfilerModule.cpp
|
||||
void AddStubConstants_profiler(PyObject* poModule)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,6 @@ void AddStubConstants_eventMgr(PyObject* poModule);
|
||||
void AddStubConstants_guild(PyObject* poModule);
|
||||
void AddStubConstants_ime(PyObject* poModule);
|
||||
void AddStubConstants_messenger(PyObject* poModule);
|
||||
void AddStubConstants_miniMap(PyObject* poModule);
|
||||
void AddStubConstants_profiler(PyObject* poModule);
|
||||
void AddStubConstants_quest(PyObject* poModule);
|
||||
void AddStubConstants_safebox(PyObject* poModule);
|
||||
@@ -341,64 +340,6 @@ PyMethodDef methods_messenger[] = {
|
||||
{ "SetMessengerHandler", stub_messenger_SetMessengerHandler, METH_VARARGS },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
// 40250 UserInterface/PythonMiniMapModule.cpp: miniMap export names.
|
||||
PyObject* stub_miniMap_SetScale(PyObject*, PyObject*) { return stub_call_named("miniMap.SetScale", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_ScaleUp(PyObject*, PyObject*) { return stub_call_named("miniMap.ScaleUp", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_ScaleDown(PyObject*, PyObject*) { return stub_call_named("miniMap.ScaleDown", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_SetMiniMapSize(PyObject*, PyObject*) { return stub_call_named("miniMap.SetMiniMapSize", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_SetCenterPosition(PyObject*, PyObject*) { return stub_call_named("miniMap.SetCenterPosition", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_Destroy(PyObject*, PyObject*) { return stub_call_named("miniMap.Destroy", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_Create(PyObject*, PyObject*) { return stub_call_named("miniMap.Create", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_Update(PyObject*, PyObject*) { return stub_call_named("miniMap.Update", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_Render(PyObject*, PyObject*) { return stub_call_named("miniMap.Render", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_Show(PyObject*, PyObject*) { return stub_call_named("miniMap.Show", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_Hide(PyObject*, PyObject*) { return stub_call_named("miniMap.Hide", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_isShow(PyObject*, PyObject*) { return stub_call_named("miniMap.isShow", Py_BuildValue("b", 0)); }
|
||||
PyObject* stub_miniMap_GetInfo(PyObject*, PyObject*) { return stub_call_named("miniMap.GetInfo", Py_BuildValue("isiil", 0, "", 0, 0, 0L)); }
|
||||
PyObject* stub_miniMap_LoadAtlas(PyObject*, PyObject*) { return stub_call_named("miniMap.LoadAtlas", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_UpdateAtlas(PyObject*, PyObject*) { return stub_call_named("miniMap.UpdateAtlas", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_RenderAtlas(PyObject*, PyObject*) { return stub_call_named("miniMap.RenderAtlas", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_ShowAtlas(PyObject*, PyObject*) { return stub_call_named("miniMap.ShowAtlas", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_HideAtlas(PyObject*, PyObject*) { return stub_call_named("miniMap.HideAtlas", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_isShowAtlas(PyObject*, PyObject*) { return stub_call_named("miniMap.isShowAtlas", Py_BuildValue("b", 0)); }
|
||||
PyObject* stub_miniMap_IsAtlas(PyObject*, PyObject*) { return stub_call_named("miniMap.IsAtlas", Py_BuildValue("b", 0)); }
|
||||
PyObject* stub_miniMap_GetAtlasInfo(PyObject*, PyObject*) { return stub_call_named("miniMap.GetAtlasInfo", Py_BuildValue("isiili", 0, "", 0, 0, 0L, 0)); }
|
||||
PyObject* stub_miniMap_GetAtlasSize(PyObject*, PyObject*) { return stub_call_named("miniMap.GetAtlasSize", Py_BuildValue("bii", 0, 0, 0)); }
|
||||
PyObject* stub_miniMap_AddWayPoint(PyObject*, PyObject*) { return stub_call_named("miniMap.AddWayPoint", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_RemoveWayPoint(PyObject*, PyObject*) { return stub_call_named("miniMap.RemoveWayPoint", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_RegisterAtlasWindow(PyObject*, PyObject*) { return stub_call_named("miniMap.RegisterAtlasWindow", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_UnregisterAtlasWindow(PyObject*, PyObject*) { return stub_call_named("miniMap.UnregisterAtlasWindow", Py_BuildNone()); }
|
||||
PyObject* stub_miniMap_GetGuildAreaID(PyObject*, PyObject*) { return stub_call_named("miniMap.GetGuildAreaID", Py_BuildValue("i", 0)); }
|
||||
PyMethodDef methods_miniMap[] = {
|
||||
{ "SetScale", stub_miniMap_SetScale, METH_VARARGS },
|
||||
{ "ScaleUp", stub_miniMap_ScaleUp, METH_VARARGS },
|
||||
{ "ScaleDown", stub_miniMap_ScaleDown, METH_VARARGS },
|
||||
{ "SetMiniMapSize", stub_miniMap_SetMiniMapSize, METH_VARARGS },
|
||||
{ "SetCenterPosition", stub_miniMap_SetCenterPosition, METH_VARARGS },
|
||||
{ "Destroy", stub_miniMap_Destroy, METH_VARARGS },
|
||||
{ "Create", stub_miniMap_Create, METH_VARARGS },
|
||||
{ "Update", stub_miniMap_Update, METH_VARARGS },
|
||||
{ "Render", stub_miniMap_Render, METH_VARARGS },
|
||||
{ "Show", stub_miniMap_Show, METH_VARARGS },
|
||||
{ "Hide", stub_miniMap_Hide, METH_VARARGS },
|
||||
{ "isShow", stub_miniMap_isShow, METH_VARARGS },
|
||||
{ "GetInfo", stub_miniMap_GetInfo, METH_VARARGS },
|
||||
{ "LoadAtlas", stub_miniMap_LoadAtlas, METH_VARARGS },
|
||||
{ "UpdateAtlas", stub_miniMap_UpdateAtlas, METH_VARARGS },
|
||||
{ "RenderAtlas", stub_miniMap_RenderAtlas, METH_VARARGS },
|
||||
{ "ShowAtlas", stub_miniMap_ShowAtlas, METH_VARARGS },
|
||||
{ "HideAtlas", stub_miniMap_HideAtlas, METH_VARARGS },
|
||||
{ "isShowAtlas", stub_miniMap_isShowAtlas, METH_VARARGS },
|
||||
{ "IsAtlas", stub_miniMap_IsAtlas, METH_VARARGS },
|
||||
{ "GetAtlasInfo", stub_miniMap_GetAtlasInfo, METH_VARARGS },
|
||||
{ "GetAtlasSize", stub_miniMap_GetAtlasSize, METH_VARARGS },
|
||||
{ "AddWayPoint", stub_miniMap_AddWayPoint, METH_VARARGS },
|
||||
{ "RemoveWayPoint", stub_miniMap_RemoveWayPoint, METH_VARARGS },
|
||||
{ "RegisterAtlasWindow", stub_miniMap_RegisterAtlasWindow, METH_VARARGS },
|
||||
{ "UnregisterAtlasWindow", stub_miniMap_UnregisterAtlasWindow, METH_VARARGS },
|
||||
{ "GetGuildAreaID", stub_miniMap_GetGuildAreaID, METH_VARARGS },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
// 40250 UserInterface/PythonProfilerModule.cpp: profiler export names.
|
||||
PyObject* stub_profiler_Push(PyObject*, PyObject*) { return stub_call_named("profiler.Push", Py_BuildNone()); }
|
||||
PyObject* stub_profiler_Pop(PyObject*, PyObject*) { return stub_call_named("profiler.Pop", Py_BuildNone()); }
|
||||
@@ -731,11 +672,6 @@ void init_2v0_gameplay_stubs() {
|
||||
PyModule_AddIntConstant(module, "__port_stub__", 1);
|
||||
AddStubConstants_messenger(module);
|
||||
}
|
||||
{
|
||||
PyObject* module = Py_InitModule("miniMap", methods_miniMap);
|
||||
PyModule_AddIntConstant(module, "__port_stub__", 1);
|
||||
AddStubConstants_miniMap(module);
|
||||
}
|
||||
{
|
||||
PyObject* module = Py_InitModule("profiler", methods_profiler);
|
||||
PyModule_AddIntConstant(module, "__port_stub__", 1);
|
||||
|
||||
@@ -353,6 +353,7 @@ bool run_main_script_body(const char* lpCmdLine, std::string* error)
|
||||
initChat();
|
||||
initTextTail();
|
||||
initnet();
|
||||
initMiniMap();
|
||||
initeffect();
|
||||
initfly();
|
||||
initServerStateChecker();
|
||||
|
||||
@@ -343,3 +343,20 @@ bool CMapManager::IsMapReady()
|
||||
auto found = s_native_maps.find(this);
|
||||
return found != s_native_maps.end() && found->second.ready;
|
||||
}
|
||||
|
||||
// 40250 MapManager.cpp: true when the current map is a CMapOutdoor. PORT: CMapOutdoor is not ported (the Godot
|
||||
// terrain adapter draws the map), so there is no outdoor map object to hand out; false keeps the 40250 callers
|
||||
// (CPythonMiniMap::Update/Render/LoadAtlas) on their "no outdoor map" path instead of reaching into one.
|
||||
auto CMapManager::IsMapOutdoor() -> bool
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
return false;
|
||||
}
|
||||
|
||||
auto CMapManager::GetMapOutdoorRef() -> CMapOutdoor &
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
// Never constructed (CMapOutdoor's constructor is not ported either); unreachable while IsMapOutdoor() is false.
|
||||
alignas(CMapOutdoor) static unsigned char storage[sizeof(CMapOutdoor)];
|
||||
return *reinterpret_cast<CMapOutdoor *>(storage);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// Stand-in for the 40250 logic unit GameLib/MapOutdoor.cpp, not ported yet: the members the ported units
|
||||
// reference, as platform_stub.py stubs. Only reached behind CMapManager::IsMapOutdoor(), which is false until
|
||||
// CMapOutdoor is ported. Delete this file in the commit that ports the unit into port/ (docs/PORT-PLAN.md).
|
||||
#include "GameLib/StdAfx.h"
|
||||
#include "GameLib/MapOutdoor.h"
|
||||
|
||||
#include "../../PlatformStub.h"
|
||||
|
||||
auto CMapOutdoor::GetTerrainPointer(BYTE, CTerrain **) -> BOOL
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
auto CMapOutdoor::GetBaseXY(DWORD *, DWORD *) -> void
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
// Stand-in for the 40250 logic unit UserInterface/PythonMiniMap.cpp, not ported yet: the members the ported units
|
||||
// reference, as platform_stub.py stubs. Delete this file in the commit that ports the unit into port/
|
||||
// (docs/PORT-PLAN.md).
|
||||
#include "UserInterface/StdAfx.h"
|
||||
#include "UserInterface/PythonMiniMap.h"
|
||||
|
||||
#include "../../PlatformStub.h"
|
||||
|
||||
CPythonMiniMap::CPythonMiniMap()
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
CPythonMiniMap::~CPythonMiniMap()
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
auto CPythonMiniMap::AddObserver(DWORD, float, float) -> void
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
auto CPythonMiniMap::MoveObserver(DWORD, float, float) -> void
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
auto CPythonMiniMap::RemoveObserver(DWORD) -> void
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
auto CPythonMiniMap::ClearAtlasMarkInfo() -> void
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
auto CPythonMiniMap::RegisterAtlasMark(BYTE, const char *, long, long) -> void
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
auto CPythonMiniMap::ClearGuildArea() -> void
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
auto CPythonMiniMap::RegisterGuildArea(DWORD, DWORD, long, long, long, long) -> void
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
auto CPythonMiniMap::CreateTarget(int, const char *) -> void
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
auto CPythonMiniMap::CreateTarget(int, const char *, DWORD) -> void
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
auto CPythonMiniMap::UpdateTarget(int, int, int) -> void
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
auto CPythonMiniMap::DeleteTarget(int) -> void
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
}
|
||||
|
||||
auto CPythonMiniMap::GetGuildAreaID(DWORD, DWORD) -> DWORD
|
||||
{
|
||||
MT_PLATFORM_STUB();
|
||||
return mt_platform_stub_return<DWORD>();
|
||||
}
|
||||
Reference in New Issue
Block a user