From d5d98500be9ff7c63bd233c4c968f9b61bc54b9d 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 --- cogl/cogl-material.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogl/cogl-material.c b/cogl/cogl-material.c index a19b6e6e1..a73831e45 100644 --- a/cogl/cogl-material.c +++ b/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; }