- Missed some castings.

This commit is contained in:
drfrag 2019-04-26 01:15:11 +02:00
parent 8fecfb8f85
commit 15bcc4c6a1

View file

@ -66,11 +66,11 @@ bool gl_GetLight(int group, Plane & p, FDynamicLight * light, bool checkside, FD
DVector3 pos = light->PosRelative(group); DVector3 pos = light->PosRelative(group);
float radius = (light->GetRadius()); float radius = (light->GetRadius());
float dist = fabsf(p.DistToPoint(pos.X, pos.Z, pos.Y)); auto dist = fabs(p.DistToPoint((float)pos.X, (float)pos.Z, (float)pos.Y));
if (radius <= 0.f) return false; if (radius <= 0.f) return false;
if (dist > radius) return false; if (dist > radius) return false;
if (checkside && gl_lights_checkside && p.PointOnSide(pos.X, pos.Z, pos.Y)) if (checkside && gl_lights_checkside && p.PointOnSide((float)pos.X, (float)pos.Z, (float)pos.Y))
{ {
return false; return false;
} }
@ -143,9 +143,9 @@ void gl_AddLightToList(int group, FDynamicLight * light, FDynLightData &ldata)
} }
float *data = &ldata.arrays[i][ldata.arrays[i].Reserve(16)]; float *data = &ldata.arrays[i][ldata.arrays[i].Reserve(16)];
data[0] = pos.X; data[0] = float(pos.X);
data[1] = pos.Z; data[1] = float(pos.Z);
data[2] = pos.Y; data[2] = float(pos.Y);
data[3] = radius; data[3] = radius;
data[4] = r; data[4] = r;
data[5] = g; data[5] = g;