use meters in config

This commit is contained in:
2026-06-05 19:54:39 +02:00
parent 4e3e3ac715
commit 7669245229
37 changed files with 265 additions and 231 deletions

View File

@@ -47,8 +47,8 @@ QPointF BeltSystem::slotWorldPos(QPoint tile, Rotation dir, double progress)
// Construction / placement
// ---------------------------------------------------------------------------
BeltSystem::BeltSystem(double beltSpeedTilesPerSecond)
: m_progressPerTick(beltSpeedTilesPerSecond * kTickDurationSeconds)
BeltSystem::BeltSystem(double beltSpeed_tps)
: m_progressPerTick_tpt(beltSpeed_tps * kTickDurationSeconds)
{
}
@@ -414,7 +414,7 @@ void BeltSystem::advanceProgress()
for (std::size_t i = 0; i < bt.itemSlots.size(); ++i)
{
bt.itemSlots[i].progress += m_progressPerTick;
bt.itemSlots[i].progress += m_progressPerTick_tpt;
// Absolute cap: slot i cannot exceed 1.0 - i * 0.25.
const double absoluteCap = 1.0 - i * 0.25;
@@ -442,7 +442,7 @@ void BeltSystem::advanceProgress()
for (std::size_t i = 0; i < st.back.size(); ++i)
{
st.back[i].progress += m_progressPerTick;
st.back[i].progress += m_progressPerTick_tpt;
const double absoluteCap = 0.5 - i * 0.25;
if (st.back[i].progress > absoluteCap)
{
@@ -465,7 +465,7 @@ void BeltSystem::advanceProgress()
if (st.frontA)
{
st.frontA->progress += m_progressPerTick;
st.frontA->progress += m_progressPerTick_tpt;
if (st.frontA->progress > 1.0)
{
st.frontA->progress = 1.0;
@@ -474,7 +474,7 @@ void BeltSystem::advanceProgress()
if (st.frontB)
{
st.frontB->progress += m_progressPerTick;
st.frontB->progress += m_progressPerTick_tpt;
if (st.frontB->progress > 1.0)
{
st.frontB->progress = 1.0;
@@ -492,7 +492,7 @@ void BeltSystem::advanceTunnelProgress()
for (std::size_t i = 0; i < te.itemSlots.size(); ++i)
{
te.itemSlots[i].progress += m_progressPerTick;
te.itemSlots[i].progress += m_progressPerTick_tpt;
const double absoluteCap = 1.0 - i * 0.25;
if (te.itemSlots[i].progress > absoluteCap)
@@ -518,7 +518,7 @@ void BeltSystem::advanceTunnelProgress()
for (std::size_t i = 0; i < tx.itemSlots.size(); ++i)
{
tx.itemSlots[i].progress += m_progressPerTick;
tx.itemSlots[i].progress += m_progressPerTick_tpt;
const double absoluteCap = 1.0 - i * 0.25;
if (tx.itemSlots[i].progress > absoluteCap)
@@ -542,7 +542,7 @@ void BeltSystem::advanceTunnelProgress()
for (std::size_t i = 0; i < link.items.size(); ++i)
{
TunnelTransitItem& ti = link.items[i];
ti.progress += m_progressPerTick;
ti.progress += m_progressPerTick_tpt;
if (ti.progress > link.length)
{
ti.progress = link.length;