shithub: libgraphics

Download patch

ref: 5ddb9dfd5dcb7a15b03a5f338aeed5dd8953d902
parent: 56e8e3de24e7fea36f165b653a8efc8c38145d4c
author: rodri <rgl@antares-labs.eu>
date: Sat Aug 17 08:43:58 EDT 2024

correct the light types constants.

--- a/graphics.h
+++ b/graphics.h
@@ -17,9 +17,9 @@
 	PTriangle,
 
 	/* light types */
-	LIGHT_POINT = 0,
-	LIGHT_DIRECTIONAL,
-	LIGHT_SPOT,
+	LightPoint = 0,
+	LightDirectional,
+	LightSpot,
 
 	/* texture formats */
 	RAWTexture = 0,	/* unmanaged */
--- a/shadeop.c
+++ b/shadeop.c
@@ -38,7 +38,7 @@
 	double cθs, cθu, cθp, t;
 
 	/* see “Spotlights”, Real-Time Rendering 4th ed. § 5.2.2 */
-	if(l->type == LIGHT_SPOT){
+	if(l->type == LightSpot){
 		cθs = dotvec3(mulpt3(dir, -1), l->dir);
 		cθu = cos(l->θu);
 		cθp = cos(l->θp);