Graf Zahl wrote:Out of curiosity, would it later be possible to set up the PHP stuff as part of the build process or would this require too much of a setup to get running?
I think it is pretty easy to do so. All I'm really doing is running "php r_draw_span32.php > r_draw_span32.h" to get the header file. You could probably get cmake to do that automatically by adding some .php to .h rule. The only catch is that you'd need to have php.exe installed to build it then.
Graf Zahl wrote:Also nice to see that the SSE2 intrinsics aren't that bad. Why didn't this work out the first time - before you went LLVM?
I never attempted this approach until now. Originally I wrote the drawers by hand using zdoom-style copy and paste. When that got out of hand I tried to use templates. The LLVM approach was the next thing I tried. It wasn't until then I realized that getting a better preprocessor might be a better solution - it guarantees that things are inline, yet it allows me to use PHP to control which snippets are included or duplicated. The php files are still pretty dense stuff to read, but at least there's no code duplication.
Ideally a perfect C++ compiler would be able to do this with inline functions, constants and templates. I just don't really trust them enough be willing to bet the house on it. Take the hilariously sad constexpr in C++11 as an example. No C++ compiler is required to do anything with that keyword at compile time.
Graf Zahl wrote:Regarding the sprite lighting, the reason why the sprites are lit as one object is mostly that sprites have no fixed place in 3D space so doing real positioned lighting may look weird. I'll have to do it for models anyway sometime and then I might just try it on sprites as well.
That's what the software version is doing too. It just happened to have a bug that made it look sorta fancy at times the way it bugged.
