What could be the purpose of a header file with raw data?

We decided to check the code different from mine, Quake I was the choice. The first file that I click on is filled only with the source data, and the only comments are the GPL. I assume this is an array containing normal vectors? Regardless of its purpose, I am confused by what it does in the anorms.h header file . I wonder what could be the purpose of this?

Another source, the actual code, feels rather complicated for me. As an aspiring programmer, I probably just need to spend more time on it.

+3
c header-files opengl raw-data quake
Jul 21 '13 at 8:46
source share
1 answer

Guessing the look, this is really a regular array used somewhere in the game.

In the old days, almost all the contents of the game were hard-coded; now you can simply open the file and load the data, because hard drives (and more often SSDs) have become much faster.

Older games were also compiled as a regular C executable; in modern IDEs such as Visual Studio (or pretty much anything, really), you can easily compile arbitrary data into .exe as resources.

All that is said is just an obscene jerk, and I should not bother him.




Sample Usage:

struct Vec { float x,y,z }; Vec arr[] = { #include "anorms.h" }; 
+4
Jul 21 '13 at 8:59 on
source share
— -



All Articles