Changeset View
Changeset View
Standalone View
Standalone View
source/tools/atlas/GameInterface/Misc.cpp
Show All 29 Lines | |||||
{ | { | ||||
switch (type) | switch (type) | ||||
{ | { | ||||
case 0: | case 0: | ||||
return CVector3D(type0.x, type0.y, type0.z); | return CVector3D(type0.x, type0.y, type0.z); | ||||
break; | break; | ||||
case 1: | case 1: | ||||
return g_Game->GetView()->GetCamera()->GetWorldCoordinates(type1.x, type1.y, floating); | return CGame::GetGame()->GetView()->GetCamera()->GetWorldCoordinates(type1.x, type1.y, floating); | ||||
break; | break; | ||||
case 2: | case 2: | ||||
debug_warn(L"Invalid Position acquisition (unchanged without previous)"); | debug_warn(L"Invalid Position acquisition (unchanged without previous)"); | ||||
return CVector3D(0.f, 0.f, 0.f); | return CVector3D(0.f, 0.f, 0.f); | ||||
break; | break; | ||||
default: | default: | ||||
debug_warn(L"Invalid Position type"); | debug_warn(L"Invalid Position type"); | ||||
return CVector3D(0.f, 0.f, 0.f); | return CVector3D(0.f, 0.f, 0.f); | ||||
} | } | ||||
} | } | ||||
CVector3D AtlasMessage::Position::GetWorldSpace(float h, bool floating) const | CVector3D AtlasMessage::Position::GetWorldSpace(float h, bool floating) const | ||||
{ | { | ||||
switch (type) | switch (type) | ||||
{ | { | ||||
case 1: | case 1: | ||||
return g_Game->GetView()->GetCamera()->GetWorldCoordinates(type1.x, type1.y, h); | return CGame::GetGame()->GetView()->GetCamera()->GetWorldCoordinates(type1.x, type1.y, h); | ||||
default: | default: | ||||
return GetWorldSpace(floating); | return GetWorldSpace(floating); | ||||
} | } | ||||
} | } | ||||
CVector3D AtlasMessage::Position::GetWorldSpace(const CVector3D& prev, bool floating) const | CVector3D AtlasMessage::Position::GetWorldSpace(const CVector3D& prev, bool floating) const | ||||
{ | { | ||||
switch (type) | switch (type) | ||||
{ | { | ||||
case 2: | case 2: | ||||
return prev; | return prev; | ||||
default: | default: | ||||
return GetWorldSpace(floating); | return GetWorldSpace(floating); | ||||
} | } | ||||
} | } | ||||
void AtlasMessage::Position::GetScreenSpace(float& x, float& y) const | void AtlasMessage::Position::GetScreenSpace(float& x, float& y) const | ||||
{ | { | ||||
switch (type) | switch (type) | ||||
{ | { | ||||
case 0: | case 0: | ||||
g_Game->GetView()->GetCamera()->GetScreenCoordinates(CVector3D(type0.x, type0.y, type0.x), x, y); | CGame::GetGame()->GetView()->GetCamera()->GetScreenCoordinates(CVector3D(type0.x, type0.y, type0.x), x, y); | ||||
break; | break; | ||||
case 1: | case 1: | ||||
x = type1.x; | x = type1.x; | ||||
y = type1.y; | y = type1.y; | ||||
break; | break; | ||||
default: | default: | ||||
debug_warn(L"Invalid Position type"); | debug_warn(L"Invalid Position type"); | ||||
x = y = 0.f; | x = y = 0.f; | ||||
} | } | ||||
} | } |
Wildfire Games · Phabricator