From 9d1d4b5ef1374ad415f3aab1b2d0c66b55cdcf7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 4 Jun 2013 13:00:16 +0200 Subject: [PATCH] Properly number shader sources. Previously the sources were numbered 1, 3, 5 etc., which is wrong. --- src/Shader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shader.cpp b/src/Shader.cpp index e51959491..bdcb748fd 100644 --- a/src/Shader.cpp +++ b/src/Shader.cpp @@ -103,7 +103,7 @@ Shader& Shader::addSource(std::string source) { if(!source.empty()) { /* Fix line numbers, so line 41 of third added file is marked as 3(41). Source 0 is the #version string added in constructor. */ - sources.push_back("#line 1 " + std::to_string(sources.size()) + '\n'); + sources.push_back("#line 1 " + std::to_string((sources.size()+1)/2) + '\n'); sources.push_back(std::move(source)); }