Files
metin2-client/extension/src/platform/pending/UserInterface/PythonBackground.cpp
T

209 lines
4.5 KiB
C++

// Stand-in for the 40250 logic unit UserInterface/PythonBackground.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/PythonBackground.h"
#include "EterLib/StateManager.h"
#include "../../PlatformStub.h"
auto CPythonBackground::Destroy() -> void
{
CMapManager::Destroy();
m_bVisibleGuildArea = FALSE;
}
auto CPythonBackground::Create() -> void
{
CMapManager::Create();
}
auto CPythonBackground::GlobalPositionToLocalPosition(LONG &x, LONG &y) -> void
{
x -= m_dwBaseX;
y -= m_dwBaseY;
}
auto CPythonBackground::LocalPositionToGlobalPosition(LONG &x, LONG &y) -> void
{
x += m_dwBaseX;
y += m_dwBaseY;
}
auto CPythonBackground::RefreshShadowLevel() -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::Update(float, float, float) -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::ClearGuildArea() -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::RegisterGuildArea(int, int, int, int) -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::CreateTargetEffect(DWORD, DWORD) -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::CreateTargetEffect(DWORD, long, long) -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::DeleteTargetEffect(DWORD) -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::Warp(DWORD x, DWORD y) -> void
{
if (m_kVct_kMapInfo.empty())
Initialize();
auto found = std::find_if(m_kVct_kMapInfo.begin(), m_kVct_kMapInfo.end(),
[x, y](const TMapInfo &info) {
return x >= info.m_dwBaseX && x < info.m_dwEndX &&
y >= info.m_dwBaseY && y < info.m_dwEndY;
});
if (found == m_kVct_kMapInfo.end()) {
TraceError("NOT_FOUND_GLOBAL_POSITION(%u, %u)", x, y);
return;
}
if (!LoadMap(found->m_strName, float(x - found->m_dwBaseX),
float(y - found->m_dwBaseY), 0.0f)) {
TraceError("CPythonBackground::Warp map load failed: %s", found->m_strName.c_str());
return;
}
m_dwBaseX = found->m_dwBaseX;
m_dwBaseY = found->m_dwBaseY;
m_strMapName = found->m_strName;
}
auto CPythonBackground::GetWarpMapName() -> const char *
{
return m_strMapName.c_str();
}
CPythonBackground::CPythonBackground()
{
m_eViewDistanceNum=0;
m_dwBaseX=0;
m_dwBaseY=0;
m_bVisibleGuildArea=FALSE;
m_iXMasTreeGrade=0;
}
CPythonBackground::~CPythonBackground()
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::CheckAdvancing(CInstanceBase *) -> bool
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<bool>();
}
auto CPythonBackground::GetPickingPointWithRayOnlyTerrain(const CRay &, D3DXVECTOR3 *) -> bool
{
MT_PLATFORM_STUB();
return mt_platform_stub_return<bool>();
}
// 40250 PythonBackground.cpp:173 (CPythonApplication::RenderGame's SetPerspective); m_pkMap stays null
// until the map is ported, so this is the 50000 far clip.
float CPythonBackground::GetFarClip()
{
if (!m_pkMap)
return 50000.0f;
if (m_ViewDistanceSet[m_eViewDistanceNum].m_fFarClip==0.0f)
{
TraceError("CPythonBackground::GetFarClip m_eViewDistanceNum=%d", m_eViewDistanceNum);
m_ViewDistanceSet[m_eViewDistanceNum].m_fFarClip=25600.0f;
}
return m_ViewDistanceSet[m_eViewDistanceNum].m_fFarClip;
}
auto CPythonBackground::Render() -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::RenderAfterLensFlare() -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::RenderBeforeLensFlare() -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::RenderCharacterShadowToTexture() -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::RenderCloud() -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::RenderEffect() -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::RenderPCBlocker() -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::RenderSky() -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::RenderSnow() -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::RenderWater() -> void
{
MT_PLATFORM_STUB();
}
auto CPythonBackground::SetBackgroundDirLight() -> void
{
if (!IsMapReady() || !mc_pcurEnvironmentData)
return;
STATEMANAGER.SetLight(0, &mc_pcurEnvironmentData->DirLights[ENV_DIRLIGHT_BACKGROUND]);
}
auto CPythonBackground::SetCharacterDirLight() -> void
{
if (!IsMapReady() || !mc_pcurEnvironmentData)
return;
STATEMANAGER.SetLight(0, &mc_pcurEnvironmentData->DirLights[ENV_DIRLIGHT_CHARACTER]);
}
void CPythonBackground::Initialize()
{
std::string atlas(LocaleService_GetLocalePath());
atlas += "/AtlasInfo.txt";
SetAtlasInfoFileName(atlas.c_str());
CMapManager::Initialize();
}