diff mde/setup/Screen.d @ 91:4d5d53e4f881

Shared alignment for dynamic content lists - finally implemented! Lots of smaller changes too. Some debugging improvements. When multiple .mtt files are read for merging, files with invalid headers are ignored and no error is thrown so long as at least one file os valid.
author Diggory Hardy <diggory.hardy@gmail.com>
date Thu, 16 Oct 2008 17:43:48 +0100
parents 79d816b3e2d2
children 9520cc0448e5
line wrap: on
line diff
--- a/mde/setup/Screen.d	Wed Oct 01 23:37:51 2008 +0100
+++ b/mde/setup/Screen.d	Thu Oct 16 17:43:48 2008 +0100
@@ -180,8 +180,13 @@
     void draw (TimeSpan) {
         glClear(GL_COLOR_BUFFER_BIT);
         
-        foreach (IDrawable d; drawables)
-            d.draw;
+        foreach (d; drawables) {
+            try {
+                d.draw;
+            } catch (Exception e) {
+                logger.error ("Drawable failed to draw: "~e.msg);
+            }
+        }
         
         debug (drawGlyphCache) FontStyle.drawTexture;
         
@@ -199,8 +204,13 @@
     /** Set a new window size. Returns true on failure due to the different ways this must be
      * handled. */
     private bool setWindow (int w, int h) {
-        foreach (d; drawables)  // Tell all drawables the new window size.
-            d.sizeEvent (w,h);
+        foreach (d; drawables) {        // Tell all drawables the new window size.
+            try {
+                d.sizeEvent (w,h);
+            } catch (Exception e) {
+                logger.error ("Drawable failed while setting size: "~e.msg);
+            }
+        }
         
         //debug logger.trace ("Setting video mode {}x{}, 32-bit, flags: {}", w,h,flags);
         if (SDL_SetVideoMode (w, h, 32, flags) is null) {