diff --git a/src/common/rendering/hwrenderer/data/hw_levelmesh.h b/src/common/rendering/hwrenderer/data/hw_levelmesh.h index f8836df0da..3cbcaa4ac6 100644 --- a/src/common/rendering/hwrenderer/data/hw_levelmesh.h +++ b/src/common/rendering/hwrenderer/data/hw_levelmesh.h @@ -187,7 +187,7 @@ public: std::unique_ptr Collision; virtual LevelMeshSurface* GetSurface(int index) { return nullptr; } - virtual unsigned GetSurfaceIndex(const LevelMeshSurface* surface) const { return unsigned(-1); } + virtual unsigned int GetSurfaceIndex(const LevelMeshSurface* surface) const { return 0xffffffff; } virtual int GetSurfaceCount() { return 0; } virtual void UpdateLightLists() { } diff --git a/src/rendering/hwrenderer/doom_levelmesh.cpp b/src/rendering/hwrenderer/doom_levelmesh.cpp index 41a8ebb0cf..7644a150ef 100644 --- a/src/rendering/hwrenderer/doom_levelmesh.cpp +++ b/src/rendering/hwrenderer/doom_levelmesh.cpp @@ -283,7 +283,7 @@ void DoomLevelMesh::CreateLightList() meshlight.Origin = { (float)pos.X, (float)pos.Y, (float)pos.Z }; meshlight.RelativeOrigin = meshlight.Origin; meshlight.Radius = (float)light->GetRadius(); - meshlight.Intensity = light->target->Alpha; + meshlight.Intensity = (float)light->target->Alpha; if (light->IsSpot()) { meshlight.InnerAngleCos = (float)light->pSpotInnerAngle->Cos(); @@ -320,7 +320,7 @@ void DoomLevelMesh::CreateLightList() std::set touchedPortals; touchedPortals.insert(Portals[0]); - for (int i = 0, count = Lights.size(); i < count; ++i) // The array expands as the lights are duplicated/propagated + for (int i = 0, count = (int)Lights.size(); i < count; ++i) // The array expands as the lights are duplicated/propagated { PropagateLight(Lights[i].get(), touchedPortals, 0); } diff --git a/src/rendering/hwrenderer/doom_levelmesh.h b/src/rendering/hwrenderer/doom_levelmesh.h index cf2314ffc3..bfca86fdda 100644 --- a/src/rendering/hwrenderer/doom_levelmesh.h +++ b/src/rendering/hwrenderer/doom_levelmesh.h @@ -40,7 +40,7 @@ public: void UpdateLightLists() override; LevelMeshSurface* GetSurface(int index) override { return &Surfaces[index]; } - unsigned GetSurfaceIndex(const LevelMeshSurface* surface) const { return std::distance(reinterpret_cast(&Surfaces[0]), reinterpret_cast(surface)); } + unsigned int GetSurfaceIndex(const LevelMeshSurface* surface) const override { return (unsigned int)(ptrdiff_t)(static_cast(surface) - Surfaces.Data()); } int GetSurfaceCount() override { return Surfaces.Size(); }