Changeset 489
- Timestamp:
- 12/06/07 16:10:12 (1 year ago)
- Files:
-
- trunk/libx42.net/VertexData.h (modified) (1 diff)
- trunk/x42view.net/Gui/ModelWindow.Preview.Shaded.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libx42.net/VertexData.h
r462 r489 137 137 [::System::Runtime::InteropServices::FieldOffset( 12 )] 138 138 float NormalFactor; 139 [::System::Runtime::InteropServices::FieldOffset( 24)]139 [::System::Runtime::InteropServices::FieldOffset( 16 )] 140 140 Math::Vector3 Binormal; 141 141 trunk/x42view.net/Gui/ModelWindow.Preview.Shaded.cs
r487 r489 102 102 { 103 103 string path = GetTextureFileName( baseTextureName ); 104 if( path == null ) 105 return; 106 107 try 108 { 109 ImageInformation info = new ImageInformation(); 110 111 diffuse = TextureLoader.FromFile( device, path, 0, 0, 0, Usage.None, 112 Format.Unknown, Pool.Managed, Filter.Triangle, Filter.Triangle, 0, ref info ); 113 114 switch( info.Format ) 104 if( path != null ) 105 { 106 try 115 107 { 116 case Format.A8R8G8B8: 117 case Format.A8B8G8R8: 118 alphaTest = Compare.Greater; 119 alphaRef = 127; 120 cullMode = Cull.None; 121 break; 108 ImageInformation info = new ImageInformation(); 109 110 diffuse = TextureLoader.FromFile( device, path, 0, 0, 0, Usage.None, 111 Format.Unknown, Pool.Managed, Filter.Triangle, Filter.Triangle, 0, ref info ); 112 113 switch( info.Format ) 114 { 115 case Format.A8R8G8B8: 116 case Format.A8B8G8R8: 117 alphaTest = Compare.Greater; 118 alphaRef = 127; 119 cullMode = Cull.None; 120 break; 121 } 122 122 } 123 }124 catch( IOException )125 {126 return;123 catch( IOException ) 124 { 125 return; 126 } 127 127 } 128 128 129 129 string normPath = GetTextureFileName( Path.ChangeExtension( baseTextureName, null ) + "_n.tga" ); 130 if( normPath == null )131 return;132 133 try134 {135 normal = TextureLoader.FromFile( device, normPath, 0, 0, 0, Usage.None,136 Format.A8B8G8R8, Pool.Managed, Filter.Triangle, Filter.None, 0 ); 137 138 Helpers.GenerateNormalMapMips( normal );139 }140 catch( IOException )141 {130 if( normPath != null ) 131 { 132 try 133 { 134 normal = TextureLoader.FromFile( device, normPath, 0, 0, 0, Usage.None, 135 Format.A8B8G8R8, Pool.Managed, Filter.Triangle, Filter.None, 0 ); 136 137 Helpers.GenerateNormalMapMips( normal ); 138 } 139 catch( IOException ) 140 { 141 } 142 142 } 143 143 }
