From 3c2bb33cbd129a474bd59cf9efa8275617eb06fa Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 27 Apr 2010 16:35:35 +0100 Subject: [PATCH] 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 --- clutter/cogl/cogl/cogl-material.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/cogl/cogl/cogl-material.c b/clutter/cogl/cogl/cogl-material.c index a19b6e6e1..a73831e45 100644 --- a/clutter/cogl/cogl/cogl-material.c +++ b/clutter/cogl/cogl/cogl-material.c @@ -831,11 +831,11 @@ 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)) { - g_warning ("Your hardware does not have enough texture samplers" + g_warning ("Your hardware does not have enough texture samplers " "to handle this many texture layers"); material->flags |= COGL_MATERIAL_FLAG_SHOWN_SAMPLER_WARNING; }