Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

REspawn

Member Since 15 Aug 2003
Offline Last Active Feb 17 2013 08:12 AM
-----

Posts I've Made

In Topic: Best way to convert or load custom texture format

06 February 2013 - 07:21 AM

Stand alone conversion tool seems like the best and most fun way to do this. I'll update this thread when I put the code up somewhere.

Thanks for all the help.


In Topic: Best way to convert or load custom texture format

05 February 2013 - 06:22 PM

Thanks for the replies. Yep, this is just for a tool / my own education, so I don't mind the extra processing step.

 

@MJP - Yea that's what I thought too, but the channels are switched. So I'll need to switch them.

 

So from doing some reading and testing, looks like the best option is read the data from the file into a buffer, create my texture, lock the rect and then switch the channels as needed. I can't seem to find anything here or on Google that suggests a better way. 

It produces the correct texture data and it's not too slow. Is there a better way?

 

Thanks,

Dave


In Topic: Best way to convert or load custom texture format

05 February 2013 - 06:06 AM

Thanks for the replies.

 

When I say non standard I mean that it's not in the D3DFORMAT enum, so I can create a texture in that format and then memcpy the data in.

 

So for example one of the formats the game stores it's files in is ABGR8888. In the D3DFORMAT enum there is D3DFMT_A8R8G8B8. 

So would the best way to read this texture in be to create a D3DFMT_A8R8G8B8 texture, lock the texture and manually copy in each pixel of data? Or is there a better / faster way to go from one format to another?

 

Hope that makes it easier to understand my question. 

 

Thanks,

Dave


PARTNERS