cogl-material: Fix the warning for when too many layers are used

The warning displayed when too many layers are used had an off-by-one
error so that it would display even if exactly the maximum number is
used. There was also a missing space at the end of the line in the
message which looked wrong when displayed on the terminal.

http://bugzilla.openedhand.com/show_bug.cgi?id=2064
This commit is contained in:
Neil Roberts 2010-04-27 16:35:35 +01:00
parent edf2bf3d8a
commit d5d98500be

View File

@ -831,7 +831,7 @@ cogl_material_set_layer (CoglHandle material_handle,
_cogl_material_pre_change_notify (material, FALSE, NULL);
material->n_layers = g_list_length (material->layers);
if (material->n_layers >= _cogl_get_max_texture_image_units ())
if (material->n_layers > _cogl_get_max_texture_image_units ())
{
if (!(material->flags & COGL_MATERIAL_FLAG_SHOWN_SAMPLER_WARNING))
{