XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Mon Nov 20, 2017 3:13 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Warframe Online .png textures
PostPosted: Tue Feb 28, 2017 2:34 pm 
Offline
beginner
User avatar

Joined: Sun Jun 20, 2010 5:10 pm
Posts: 33
Location: The Netherlands
Has thanked: 0 time
Have thanks: 5 times

This is what I use:

Code:
int convertWarframe(char* pngFileWF)
{   
   FILE* fIn = NULL;
   FILE* fOut = NULL;
   char* pixels0;
   char* pixels1;
   char* pixOut;

   fIn = fopen( pngFileWF, "rb" );

   strcat( pngFileWF, "_reversed.png" );
   fOut = fopen( pngFileWF, "wb+" );

   fseek( fIn, 0, SEEK_END );
   int fSz = ftell( fIn );
   fseek( fIn, 0, SEEK_SET );

   pixels0 = (char*)malloc( WFBLOCKSZ );
   pixels1 = (char*)malloc( WFBLOCKSZ );
   pixOut = (char*)malloc( fSz );

   for( int i = 0; i < fSz / (2 * WFBLOCKSZ); i++ )
   {
      fread( pixels0, WFBLOCKSZ, 1, fIn );
      fread( pixels1, WFBLOCKSZ, 1, fIn );

      for( int j = 0; j < WFBLOCKSZ / WriteBlockSz; j++ )
      {
         memcpy( pixOut + 2 * i * WFBLOCKSZ + ( 2 * j + 0) * WriteBlockSz, &pixels0[ j * WriteBlockSz ], WriteBlockSz );
         memcpy( pixOut + 2 * i * WFBLOCKSZ + ( 2 * j + 1) * WriteBlockSz, &pixels1[ j * WriteBlockSz ], WriteBlockSz );
      }
   }

   fwrite( pixOut, fSz, 1, fOut );

   fclose( fIn );
   fclose( fOut );

   free(pixels0);
   free(pixels1);
   free(pixOut);

   return 0;
}


It's quite some time ago that I've used this, but I think this is only for the body of the DDS file.
Depending on the size of the output I think I manually added an appropriate DDS header.

You can make the ads go away by registering




_________________
http://tatooinebase.star-fleet.org


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group