OpenBVE icon indicating copy to clipboard operation
OpenBVE copied to clipboard

New: Support URL based textures

Open leezer3 opened this issue 3 years ago • 0 comments

Changes:

This PR implements texture loading in the CSV / B3D plugin from an arbitrary online URL, e.g.

[MeshBuilder]
Vertex -0.5, -0.1, 0
Vertex -0.5, 0.1, 0
Vertex 0.5, 0.1, 0
Vertex 0.5, -0.1, 0
Face 0, 1, 2, 3

[Texture]
URL https://openbve-project.net/images/index-screenshots.jpg
Coordinates 0, 0, 1
Coordinates 1, 0, 0
Coordinates 2, 1, 0
Coordinates 3, 1, 1

n.b Minimum size of texture must be 100 bytes (to guard against 404 text etc.)

TODO:

  • ~~May want a try / catch block around the whole webrequest thing.~~
  • What to do with a 404? Fallback texture?

leezer3 avatar Jul 15 '21 09:07 leezer3