Command: Replace binary_length field with auxiliary data

Use for CMD_ADD_PLAN_LINE
This commit is contained in:
Jonathan G Rennison
2022-12-07 20:37:23 +00:00
parent b0329ec77a
commit f32733ef22
23 changed files with 166 additions and 147 deletions

View File

@@ -47,3 +47,19 @@ void PlanLine::UpdateVisualExtents()
this->viewport_extents = { (int)(min_x * TILE_SIZE * 2 * ZOOM_LVL_BASE), (int)(min_y * TILE_SIZE * ZOOM_LVL_BASE),
(int)((max_x + 1) * TILE_SIZE * 2 * ZOOM_LVL_BASE), (int)((max_y + 1) * TILE_SIZE * ZOOM_LVL_BASE) };
}
bool Plan::ValidateNewLine()
{
extern bool AddPlanLine(PlanID plan, TileVector tiles);
bool ret = false;
if (this->temp_line->tiles.size() > 1) {
this->temp_line->MarkDirty();
this->last_tile = this->temp_line->tiles.back();
this->SetVisibility(true, false);
TileVector tiles = std::move(this->temp_line->tiles);
this->temp_line->Clear();
ret = AddPlanLine(this->index, std::move(tiles));
}
return ret;
}