/[Sims3RigEditor]/trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h
ViewVC logotype

Diff of /trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h

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

--- trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h	2010/08/12 18:49:34	57
+++ trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h	2010/08/12 19:05:05	58
@@ -440,19 +440,17 @@
 						}
 						bytes = (unsigned char*)toolinfo[i]->Images[j].MIPLevels[k].PixelBytes;
 
+						mip->Pixels->NativeTexture = t;
+							mip->Pixels->NativeTexturePointer = *new IntPtr(toolinfo[i]);
+							mip->Pixels->ImageIndex = j;
+							mip->Pixels->MipIndex = k;
+
 						for(int l =0;l<toolinfo[i]->Images[j].MIPLevels[k].PixelByteCount;l++)
-						{
-							gr2lib::core::coretypes::implementation::Pixel^ pix = gcnew gr2lib::core::coretypes::implementation::Pixel();
-							
-							pix->PixelBytes->Add(bytes[l]);
-							pix->NativeTexture = t;
-							pix->NativeTexturePointer = *new IntPtr(toolinfo[i]);
-							pix->ImageIndex = j;
-							pix->MipIndex = k;
-							mip->Pixels = pix;
+						{							
+							mip->Pixels->PixelBytes->Add(bytes[l]);
 						}
-
 						img->MIPLevels->Add(mip);
+						
 					}
 
 					t->Images->Add(img);
@@ -538,13 +536,10 @@
 
 			_grn_file->GrannyFileInfo->Textures[i]->ImageCount = GR2LibPropertyWrapper->Textures[i]->Images->Count;
 			_grn_file->GrannyFileInfo->Textures[i]->Images = (granny_texture_image*)malloc(_grn_file->GrannyFileInfo->Textures[i]->ImageCount);
-			//for(int k=0;k<_grn_file->GrannyFileInfo->Textures[i]->ImageCount;k++) { _grn_file->GrannyFileInfo->Textures[i]->Images[k] = *(new granny_texture_image()); }
-
 			for(int j=0;j<_grn_file->GrannyFileInfo->Textures[i]->ImageCount;j++)
 			{
 				_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels->Count;
 				_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels = (granny_texture_mip_level*)malloc(_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount);
-				//for(int k=0;k<_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount;k++) { _grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k] = *(new granny_texture_mip_level()); }
 				for(int k=0;k<_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevelCount;k++) 
 				{
 					_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].Stride =  GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Stride;
@@ -556,33 +551,9 @@
 					{
 						_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelBytes[l] = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Pixels->PixelBytes[l];
 					}
-
-					//// try to compress texture?
-					//if (_grn_file->GrannyFileInfo->Textures[i]->Encoding == granny_texture_encoding::GrannyBinkTextureEncoding)
-					//{
-					//	granny_texture* src = _grn_file->GrannyFileInfo->Textures[i];
-					//	//granny_texture* dest = new granny_texture();
-					//	unsigned char* dest;
-					//	GrannyBinkCompressTexture(
-					//		_grn_file->GrannyFileInfo->Textures[i]->Width,
-					//		_grn_file->GrannyFileInfo->Textures[i]->Height,
-					//		_grn_file->GrannyFileInfo->Textures[i]->Width * _grn_file->GrannyFileInfo->Textures[i]->Layout.BytesPerPixel,
-					//		src->Images[j].MIPLevels[k].PixelBytes,
-					//		granny_bink_texture_flags::GrannyBinkEncodeAlpha,
-					//		granny_compression_type::GrannyNoCompression,
-					//		&dest);
-					//}
-
 				}
 			}
-			//granny_pixel_layout _layout;
-			//GrannyGetRecommendedPixelLayout(_grn_file->GrannyFileInfo->Textures[i],&_layout);					
-			//_grn_file->GrannyFileInfo->Textures[i]->Layout = _layout;
 			_grn_file->GrannyFileInfo->Textures[i]->ExtendedData = *(new granny_variant());
-
-
-
-
 		}
 
 	}

 

  ViewVC Help
Powered by ViewVC 1.1.22