MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / DecodeVersion

Function DecodeVersion

src/video/opengl.cpp:517–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515}
516
517static std::tuple<uint8_t, uint8_t> DecodeVersion(std::string_view ver)
518{
519 StringConsumer consumer{ver};
520 int major = consumer.ReadIntegerBase<uint8_t>(10);
521 if (consumer.ReadIf(".")) return {major, consumer.ReadIntegerBase<uint8_t>(10)};
522 return {major, 0};
523}
524
525/**
526 * Check for the needed OpenGL functionality and allocate all resources.

Callers 2

InitMethod · 0.85
InitShadersMethod · 0.85

Calls 1

ReadIfMethod · 0.80

Tested by

no test coverage detected