Nice post Kynox; I was trying to think of where I might have seen that before, but is that Directly from the WoWSharp code or WoWBot code?
I think I might indulge myself a little into a read.
EDIT: Found the snippet under WoW!Radar of WoW!Sharp, thanks for the post @ Reading over it all now.
#2:
Looking over WoW!Radar's code, this might be something to indulge in for loading textures. SFmpqapi & BLP2API were used, read over the following code >>
All it's basically doing is calling it's two openers on the MPQ and texture, It loads the texture under the "minimap.filename" then pulls the BLP to a DXT1 if that doesn't pass, it resolves to loading it as a BLP to a TGA; Then drops the SFmpq files and mpq.
This is where I would suggest reading over the code and getting an understanding for it. If you don't have it download it @ http://www.wowsharp.net
Code:
private void GetMinimapTexture( clsMinimap minimap)
{
int hMPQ = 0;
int hFile = 0;
int FileSize = 0;
int FileRead = 0;
//WoW.LogLine( "Opening {0}", WoW.GamePath + "\\Data\\texture.MPQ");
if( SFmpq.SFileOpenArchive( WoW.GamePath + "\\Data\\texture.MPQ", 0, 0, ref hMPQ) != 1)
{
WoW.LogLine( "Error opening {0}", WoW.GamePath + "\\Data\\texture.MPQ");
return;
}
//WoW.LogLine( "Opening texture.MPQ|textures\\Minimap\\{0}", minimap.filename);
if( SFmpq.SFileOpenFileEx( hMPQ, "textures\\Minimap\\" + minimap.filename, 0, ref hFile) != 1)
{
WoW.LogLine( "Error opening texture.MPQ|textures\\Minimap\\{0}", minimap.filename);
SFmpq.SFileCloseFile( hMPQ);
return;
}
FileSize = SFmpq.SFileGetFileSize( hFile, ref FileSize);
byte [] buffer = new byte[ FileSize];
//WoW.LogLine( "Reading texture.MPQ|textures\\Minimap\\{0}", minimap.filename);
if( SFmpq.SFileReadFile( hFile, buffer, (uint) FileSize, ref FileRead, IntPtr.Zero) == 1)
{
//WoW.LogLine( "Parsing texture.MPQ|textures\\Minimap\\{0}", minimap.filename);
minimap.dxt1 = true;
MemoryStream ms = BLP2Parse.BLPtoDXT1( buffer);
if( ms != null && ms.Length > 0x70)
{
ms.Seek( 0, SeekOrigin.Begin);
try
{
minimap.texture = TextureLoader.FromStream( device, ms);
if( minimap.texture == null)
minimap.dxt1 = false;
}
catch
{
minimap.dxt1 = false;
}
}
if( !minimap.dxt1)
{
ms = BLP2Parse.BLPtoTGA( buffer);
ms.Seek( 0, SeekOrigin.Begin);
try
{
minimap.texture = TextureLoader.FromStream( device, ms);
}
catch
{
WoW.LogLine( "Error loading texture.MPQ|textures\\Minimap\\{0}", minimap.filename);
}
}
}
else
{
WoW.LogLine( "Error reading texture.MPQ|textures\\Minimap\\{0}", minimap.filename);
}
SFmpq.SFileCloseFile( hFile);
SFmpq.SFileCloseArchive( hMPQ);
return;
}
#3 - You can get SFmpq api @ http://shadowflare.samods.org/cgi-bi...i?SFmpqapi.zip
SFmpq includes a VB Module, so it seems you may be able just to stay in VB if you wanted to.
BLP2API though was a snippet in WoW!Sharp, but if you downloaded it you could look over it. Alternatively, you could convert all the minimap textures and load them as TGA. But this being an extreme and tedious thing to do is not recommended to do. The are so many tiles that it would be a long process and you would easily require people to download 100mb+ to have minimaps.
Or you could probably ask run32.dll about his stuff, But I believe he has something like WoW!Radar, and is using C#.
Good luck in your endeavors!