/[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 08:37:47	55
+++ trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h	2010/08/12 18:49:34	57
@@ -431,7 +431,7 @@
 					{
 						gr2lib::core::coretypes::implementation::MIPLevel^ mip = gcnew gr2lib::core::coretypes::implementation::MIPLevel();
 						mip->Stride = toolinfo[i]->Images[j].MIPLevels[k].Stride;
-						mip->Pixels = gcnew List<gr2lib::core::coretypes::implementation::Pixel^>();	
+						mip->Pixels = gcnew gr2lib::core::coretypes::implementation::Pixel();	
 
 						unsigned char* bytes = (unsigned char*)malloc(toolinfo[i]->Images[j].MIPLevels[k].PixelByteCount);	
 						for(int l =0;l<toolinfo[i]->Images[j].MIPLevels[k].PixelByteCount;l++)
@@ -443,10 +443,13 @@
 						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->UInt8 = bytes[l];
+							
+							pix->PixelBytes->Add(bytes[l]);
 							pix->NativeTexture = t;
 							pix->NativeTexturePointer = *new IntPtr(toolinfo[i]);
-							mip->Pixels->Add(pix);
+							pix->ImageIndex = j;
+							pix->MipIndex = k;
+							mip->Pixels = pix;
 						}
 
 						img->MIPLevels->Add(mip);
@@ -545,13 +548,13 @@
 				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;
-					_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Pixels->Count;
+					_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Pixels->PixelBytes->Count;
 					_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelBytes = (unsigned char*)malloc(_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount);
 
 
 					for (int l=0;l<_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelByteCount;l++)
 					{
-						_grn_file->GrannyFileInfo->Textures[i]->Images[j].MIPLevels[k].PixelBytes[l] = GR2LibPropertyWrapper->Textures[i]->Images[j]->MIPLevels[k]->Pixels[l]->UInt8;
+						_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?

 

  ViewVC Help
Powered by ViewVC 1.1.22