+/** Initialize or update the light value tables using the specified \p gamma.
+ * If \p gamma == 1.0 then the light table is linear. Typically values for
+ * gamma range between 1.8 and 2.2.
+ *
+ * @note The value for gamma will be restricted to the range 1.1 <= gamma <= 3.0.
+ *
+ * @note This function is not, currently, a simple linear to gamma encoding
+ * because adjustments are made so that a gamma of 1.8 gives the same
+ * results as those hardcoded for use by the server.
+ */
+void set_light_table(float gamma)
+{
+ static const float brightness_step = 255.0f / (LIGHT_MAX + 1);