17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-19 02:39:19 +02:00

fix(sonar): addressing last reliability/security issues

This commit is contained in:
jerrrrycho
2026-10-06 14:21:55 +02:00
parent c6b76a0b72
commit e570874f63
5 changed files with 14 additions and 10 deletions

View File

@@ -550,12 +550,12 @@ bool TSegment::RenderLoft( gfx::vertex_array &Output, glm::dvec3 const &Origin,
void TSegment::render_lines(std::vector<gfx::basic_vertex> &out, float quality) const
{
float step = 1.0f / iSegCount / quality;
float x;
int const stepcount = static_cast<int>(iSegCount * quality);
glm::vec3 previous = FastGetPoint(0.0);
for (x = step; x <= 1.0f; x += step) {
for (int i = 1; i <= stepcount; ++i) {
float const x = std::min(1.0f, i * step);
out.push_back(gfx::basic_vertex(previous, glm::vec3(0.0f), glm::vec2(0.0f)));
previous = glm::vec3(FastGetPoint(x));
@@ -571,13 +571,13 @@ void TSegment::render_lines(std::vector<gfx::basic_vertex> &out, float quality)
glm::vec3 TSegment::get_nearest_point(const glm::dvec3 &point, float quality) const
{
float step = 1.0f / iSegCount / quality;
float x;
int const stepcount = static_cast<int>(iSegCount * quality);
glm::vec3 nearest;
float min = std::numeric_limits<float>::max();
for (x = step; x <= 1.0f; x += step) {
for (int i = 1; i <= stepcount; ++i) {
float const x = std::min(1.0f, i * step);
glm::vec3 p1 = FastGetPoint(x);
glm::vec3 p2 = FastGetPoint(glm::min(1.0f, x + step));