/[gr2lib]/trunk/gr2lib_UnitTest/Program.cs
ViewVC logotype

Diff of /trunk/gr2lib_UnitTest/Program.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/gr2lib_UnitTest/Program.cs	2010/07/16 23:44:30	89
+++ trunk/gr2lib_UnitTest/Program.cs	2010/07/17 00:00:16	90
@@ -63,16 +63,23 @@
 
                 #region Read Granny2 Data
 
-                    grnfileinfo info = grnfileinfo.ReadFromFile(GrannyFilename);
+                grnfileinfo info = grnfileinfo.ReadFromFile(GrannyFilename);
 
-                    #region Read FromFileName
-                    Console.WriteLine();
+                #region Read FromFileName
+                Console.WriteLine();
+                if (info.HaveFromFileName)
+                {
                     Console.WriteLine("From File Name: " + info.FromFileName);
                     Console.WriteLine("ExtendedData: " + info.ExtendedData);
-                    #endregion
+                }
+                else { Console.WriteLine("From File Name: " + "No From File Name Available"); }
+
+                #endregion
 
-                    #region Read ArtToolInfo
-                    Console.WriteLine();
+                #region Read ArtToolInfo
+                Console.WriteLine();
+                if (info.HaveArtToolInfo)
+                {
                     Console.WriteLine("Art Tool Data:");
                     Console.WriteLine("\tTool Name: " + info.ArtToolInfo.FromArtToolName);
                     Console.WriteLine("\tTool Version: " + string.Format("{0}.{1}", info.ArtToolInfo.ArtToolMajorRevision, info.ArtToolInfo.ArtToolMinorRevision));
@@ -84,10 +91,14 @@
                     Console.WriteLine("\tTool Back: " + string.Format("[{0},{1},{2}]", info.ArtToolInfo.Back.x, info.ArtToolInfo.Back.y, info.ArtToolInfo.Back.z));
 
                     Console.WriteLine("\tTool ExtendedData: " + info.ArtToolInfo.ExtendedData);
-                    #endregion
+                }
+                else { Console.WriteLine("Art Tool Data: " + "No Art Tool Info Available"); }
+                #endregion
 
-                    #region Read ExporterInfo
-                    Console.WriteLine();
+                #region Read ExporterInfo
+                Console.WriteLine();
+                if (info.HaveExporterInfo)
+                {
                     Console.WriteLine("Exporter Info:");
                     Console.WriteLine("\tExporter Name: " + info.ExporterInfo.ExporterName);
 
@@ -99,10 +110,14 @@
                             info.ExporterInfo.ExporterBuildNumber));
 
                     Console.WriteLine("\tExporter ExtendedData: " + info.ExporterInfo.ExtendedData);
-                    #endregion
+                }
+                else { Console.WriteLine("Exporter Info: " + "No Exporter Info Available"); }
+                #endregion
 
-                    #region Read Textures
-                    Console.WriteLine();
+                #region Read Textures
+                Console.WriteLine();
+                if (info.HaveTextures)
+                {
                     Console.WriteLine("Texture List:");
                     foreach (Texture t in info.Textures)
                     {
@@ -134,10 +149,14 @@
                         Console.WriteLine("\tExtendedData: " + t.ExtendedData);
                         Console.WriteLine();
                     }
-                    #endregion
+                }
+                else { Console.WriteLine("Texture List: " + "No Textures Available"); }
+                #endregion
 
-                    #region Read Materials
-                    Console.WriteLine();
+                #region Read Materials
+                Console.WriteLine();
+                if (info.HaveMaterials)
+                {
                     Console.WriteLine("Material List:");
                     foreach (Material m in info.Materials)
                     {
@@ -180,11 +199,15 @@
                         Console.WriteLine("\t\tExtendedData: " + m.ExtendedData);
                         Console.WriteLine();
                     }
-                    #endregion
+                }
+                else { Console.WriteLine("Material List: " + "No Materials Available"); }
+                #endregion
 
 
-                    #region Read Skeletons
-                    Console.WriteLine();
+                #region Read Skeletons
+                Console.WriteLine();
+                if (info.HaveSkeletons)
+                {
                     Console.WriteLine("Skeleton List:");
                     foreach (Skeleton s in info.Skeletons)
                     {
@@ -198,17 +221,22 @@
                             Console.WriteLine("\t\tLod Error: " + b.LodError);
                             Console.WriteLine("\t\tTransform: " + b.Transform.ToString());
                             if (b.HasLightInfo) { Console.WriteLine("\t\tLightInfo ExtendedData: " + b.LightInfo.ExtendedData); }
+                            else { Console.WriteLine("\t\tLightInfo ExtendedData: " + "No LightInfo"); }
                             if (b.HasCameraInfo) { Console.WriteLine("\t\tCameraInfo ExtendedData: " + b.CameraInfo.ExtendedData); }
+                            else { Console.WriteLine("\t\tCameraInfo ExtendedData: " + "No CameraInfo"); }
                             Console.WriteLine();
                         }
                         Console.WriteLine("\t\tExtendedData: " + s.ExtendedData);
                         Console.WriteLine();
                     }
-                    #endregion
+
                 }
+                else { Console.WriteLine("Skeleton List: " + "No Skeletons Available"); }            
+                #endregion
+            }
                 #endregion
 
-           
+
             catch (granny2apiloadexception ex)
             {
                 Console.WriteLine(ex.Message);

 

  ViewVC Help
Powered by ViewVC 1.1.22