Closed ASackofPotatoes closed 2 months ago
Update:
Turns out that the FileToString function that reads the shaders was duplicating the last few lines of those two shaders and so the computer was rightfully causing a syntax error when it found extra characters.
Where did the duplicate lines come from? Why did it only affect those shaders? You're asking too many questions and my head hurts.
The fix is to add the following line after the call to read() in /Kit/Source/iokit.c
:
(*result_string)[ret] = '\0';
And here it is, soaring in all it's fully rendered glory:
Thanks Eric for such a sweet tool by the way! I'm just getting into it to do some ADCS simulations for my university CubeSat team and it's very cool so far.
All the best, Tom
Hi Tom,
Thanks for the bug fix.
When a plain text file starts acting squirrelly, one thing I check is line endings. CRLF issues don't bite as hard as they once did, but I could see how some creeping in might throw a string length off. Your adding a null at the end is a sensible safeguard. (FWIW, in my copy, all the line endings are LF. I don't see anything obviously out of sorts.)
Regards, -Eric
Hello, I'm trying to install 42 for the first time and am encountering the following output when running 42:
The Cam, Map, and UnitSphere windows all open and Cam displays the model of the spacecraft without issue. Lighting on the spacecraft's faces seems to be working, but the background and other objects do not display.
I've spent some time poking around the shaders it said had syntax errors:
But I can't determine any actual flaws for the life of me. For both files, the line number it provides is at the end of the file and does not contain the text it says is causing the syntax error. I'm suspecting that the culprit isn't the shaders at all, since they haven't been changed since I cloned the repo; instead maybe it's something to do with my install of freeglut/glew or some Windows dark magic adding bytes to the end of the file as it's loaded?
Other details:
I'm going to keep troubleshooting this, but if anyone has any ideas or has seen this before please let me know!
Many thanks! -Tom