[gnome-nibbles] Remove hardcoded array lengths from pixmap loading code



commit d824e8911492fa5d8c3a9d0d36ffddd329922374
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Mon Mar 7 21:33:23 2016 -0600

    Remove hardcoded array lengths from pixmap loading code

 src/nibbles-view.vala |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/nibbles-view.vala b/src/nibbles-view.vala
index 5c6a5dd..13af160 100644
--- a/src/nibbles-view.vala
+++ b/src/nibbles-view.vala
@@ -471,19 +471,19 @@ public class NibblesView : GtkClutter.Embed
             "snake-magenta.svg"
         };
 
-        for (int i = 0; i < 6; i++)
+        for (int i = 0; i < bonus_files.length; i++)
         {
             boni_pixmaps[i] = load_pixmap_file (bonus_files[i],
                                                 2 * game.tile_size, 2 * game.tile_size);
         }
 
-        for (int i = 0; i < 11; i++)
+        for (int i = 0; i < small_files.length; i++)
         {
             wall_pixmaps[i] = load_pixmap_file (small_files[i],
                                                 2 * game.tile_size, 2 * game.tile_size);
         }
 
-        for (int i = 0; i < 6; i++)
+        for (int i = 0; i < worm_files.length; i++)
         {
             worm_pixmaps[i] = load_pixmap_file (worm_files[i],
                                                 game.tile_size, game.tile_size);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]