xboxscene.org forums

OG Xbox Forums => Software Forums => Development => Topic started by: BenJeremy on February 11, 2003, 01:19:00 PM

Title: Help Needed With Embedded Xbe Pictures.
Post by: BenJeremy on February 11, 2003, 01:19:00 PM
QUOTE (Troll123 @ Feb 11 2003, 05:04 PM)
Can anyone paste some sample code or help me with this question:

I would like to know how to read the game thumbnail that nexgen + the xbox dashboard uses for the games to incorporate into another program. We would like to have My Apps be able to auto-generate a thumbnail based on the embedded picture in the XBE. Please PM me or reply to this thread.

Well, I have some of the code you need in MXM.

Have a look at the source, if you have it... in the utils.cpp file.

The next version of MXM will support TitleImage.xbx files when screenshots are not available.
Title: Help Needed With Embedded Xbe Pictures.
Post by: BenJeremy on February 11, 2003, 02:30:00 PM
QUOTE (DevSpook @ Feb 11 2003, 05:47 PM)
The routines in BenJeremys source are a great starting point.

One tip with regards to performance, use one function to read both title & id, it will shave some time of your init-routine. Especially if you have a lot of icons to load.

When you get to the next step, alpha-blending the icon against a spheremask, remember to use two sets of texture coordinates for the face(s) you are mapping the texture to. That one stumped me for a while. smile.gif

As for loading the image once you have the game id, use something like this:

CStdString sImagefile;
sImagefile.Format("e:udata%Stitleimage.xbx", wcID);  // Note: ID already converted to wchar

if (FileExists(sImagefile.c_str())) {
     if( !FAILED( m_xprResource2.Create( m_pd3dDevice, sImagefile.c_str(), 1, NULL ) ) ) {
        m_pIconTexture = m_xprResource2.GetTexture( (DWORD) 0 );
   }
}


FileExists is another nice function courtesy of BenJeremy. biggrin.gif

Yeah yeah... steal all my code  mad.gif


jester.gif

I thought about combining the fetch of the ID and title... but at the time, for whatever reason, I didn't (poor excuse, but I'm designing on the fly, heh heh)
Title: Help Needed With Embedded Xbe Pictures.
Post by: Troll123 on February 11, 2003, 03:04:00 PM
Nm:) I found the source. Thanks a ton!