aboutsummaryrefslogtreecommitdiff
path: root/Src/Winamp/plush/LIGHT.C
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Winamp/plush/LIGHT.C
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Winamp/plush/LIGHT.C')
-rw-r--r--Src/Winamp/plush/LIGHT.C46
1 files changed, 46 insertions, 0 deletions
diff --git a/Src/Winamp/plush/LIGHT.C b/Src/Winamp/plush/LIGHT.C
new file mode 100644
index 00000000..69f3b79a
--- /dev/null
+++ b/Src/Winamp/plush/LIGHT.C
@@ -0,0 +1,46 @@
+/******************************************************************************
+Plush Version 1.2
+light.c
+Light Control
+Copyright (c) 1996-2000, Justin Frankel
+******************************************************************************/
+
+#include "plush.h"
+
+pl_Light *plLightSet(pl_Light *light, pl_uChar mode, pl_Float x, pl_Float y,
+ pl_Float z, pl_Float intensity, pl_Float halfDist) {
+ pl_Float m[16], m2[16];
+ light->Type = mode;
+ light->Intensity = intensity;
+ light->HalfDistSquared = halfDist*halfDist;
+ switch (mode) {
+ case PL_LIGHT_VECTOR:
+ plMatrixRotate(m,1,x);
+ plMatrixRotate(m2,2,y);
+ plMatrixMultiply(m,m2);
+ plMatrixRotate(m2,3,z);
+ plMatrixMultiply(m,m2);
+ plMatrixApply(m,0.0,0.0,-1.0,&light->Xp, &light->Yp, &light->Zp);
+ break;
+ case PL_LIGHT_POINT_ANGLE:
+ case PL_LIGHT_POINT_DISTANCE:
+ case PL_LIGHT_POINT:
+ light->Xp = x;
+ light->Yp = y;
+ light->Zp = z;
+ break;
+ }
+ return light;
+}
+
+pl_Light *plLightCreate() {
+ pl_Light *l;
+ l = malloc(sizeof(pl_Light));
+ if (!l) return 0;
+ memset(l,0,sizeof(pl_Light));
+ return (l);
+}
+
+void plLightDelete(pl_Light *l) {
+ if (l) free(l);
+}