public static byte[] AdjustOutput(byte[] buff, out int offset)
{
offset = 0;
GfxType gfxtype = GetGfxType(buff, out offset);
if (buff.Length < 4)
return buff;
switch(gfxtype)
{
case GfxType.TGA:
offset = 3; // start of file follows "GEO" magic header
break;
case GfxType.DDS:
//replace "GEO " magic value with "DDS "
buff[0] = (byte)'D';
buff[1] = (byte)'D';
buff[2] = (byte)'S';
break;
}
return buff;
}
/*
* translate source buffer from GFX format to TGA or DDS as needed
*/
public static byte[] GetImageData(byte[] source)
{
byte[] output = new byte[0]; // in case things don't go well
int offset = 0;
source = AdjustOutput(source, out offset);
if (offset != 0)
output = new byte[source.Length - 4];
else
output = new byte[source.Length];
for (int i = 0; i < output.Length; i++)
output[i] = source[i + offset];
return output;
}
/*
* translate the buffer from TGA or DDS format to GFX format
*/
public static byte[] GetGfxData(byte[] source)
{
byte[] output = new byte[0]; // in case things don't go well
int offset = 0;
if (source[0] != 'D' && source[1] != 'D' && source[2] != 'S')
offset = 4;
output = new byte[source.Length + offset];
source.CopyTo(output, offset);
output[0] = (byte)'G';
output[1] = (byte)'E';
output[2] = (byte)'O';
if (offset == 4)
output[3] = (byte)0x00;
else
output[3] = (byte)' ';
return output;
}
/*
* Figure out the type of image in a .gfx file
* handles only .tgs and .dds type images
*/
public static GfxType GetGfxType(byte[] buff, out int offset)
{
offset = 0;
// if file content is nothing but a "GEO" header, nothing to do.
if (buff.Length < 4)
return GfxType.UNKNOWN; // unknown .gfx Type
if (buff[0] == 'G' && buff[1] == 'E' && buff[2] == 'O')
{
if (buff[3] == 0x00)
{
// this is a .tga (Targa) file
offset = 3; // start of file follows "GEO" magic header
return GfxType.TGA;
}
if (buff[3] == ' ' && buff[4] == 124)
{
return GfxType.DDS;
}
}
return GfxType.UNKNOWN;
}
public static void WriteFile(string target, byte[] buffer, int offset)
{
string dirs = Path.GetDirectoryName(target);
BinaryWriter bw = null;
try
{
Directory.CreateDirectory(dirs);
FileStream fs = new FileStream(target, FileMode.Create);
bw = new BinaryWriter(fs);
bw.Write(buffer, offset, (buffer.Length - offset));
bw.Flush();
}
catch (IOException e)
{ }
finally
{
if (bw != null)
bw.Close();
}
}
Quote:
Originally Posted by anoofy
why u don't share it ? aren't u Rohan God ?
i don't think u both want money too
Look up there ^
I don't need your money. I have plenty of my own.
What I won't tell you guys is how to pack it back into the gel/gem archives. I will let you jokers figure that out for yourselves.
public static byte[] AdjustOutput(byte[] buff, out int offset)
{
offset = 0;
GfxType gfxtype = GetGfxType(buff, out offset);
if (buff.Length < 4)
return buff;
switch(gfxtype)
{
case GfxType.TGA:
offset = 3; // start of file follows "GEO" magic header
break;
case GfxType.DDS:
//replace "GEO " magic value with "DDS "
buff[0] = (byte)'D';
buff[1] = (byte)'D';
buff[2] = (byte)'S';
break;
}
return buff;
}
/*
* translate source buffer from GFX format to TGA or DDS as needed
*/
public static byte[] GetImageData(byte[] source)
{
byte[] output = new byte[0]; // in case things don't go well
int offset = 0;
source = AdjustOutput(source, out offset);
if (offset != 0)
output = new byte[source.Length - 4];
else
output = new byte[source.Length];
for (int i = 0; i < output.Length; i++)
output[i] = source[i + offset];
return output;
}
/*
* translate the buffer from TGA or DDS format to GFX format
*/
public static byte[] GetGfxData(byte[] source)
{
byte[] output = new byte[0]; // in case things don't go well
int offset = 0;
if (source[0] != 'D' && source[1] != 'D' && source[2] != 'S')
offset = 4;
output = new byte[source.Length + offset];
source.CopyTo(output, offset);
output[0] = (byte)'G';
output[1] = (byte)'E';
output[2] = (byte)'O';
if (offset == 4)
output[3] = (byte)0x00;
else
output[3] = (byte)' ';
return output;
}
/*
* Figure out the type of image in a .gfx file
* handles only .tgs and .dds type images
*/
public static GfxType GetGfxType(byte[] buff, out int offset)
{
offset = 0;
// if file content is nothing but a "GEO" header, nothing to do.
if (buff.Length < 4)
return GfxType.UNKNOWN; // unknown .gfx Type
if (buff[0] == 'G' && buff[1] == 'E' && buff[2] == 'O')
{
if (buff[3] == 0x00)
{
// this is a .tga (Targa) file
offset = 3; // start of file follows "GEO" magic header
return GfxType.TGA;
}
if (buff[3] == ' ' && buff[4] == 124)
{
return GfxType.DDS;
}
}
return GfxType.UNKNOWN;
}
public static void WriteFile(string target, byte[] buffer, int offset)
{
string dirs = Path.GetDirectoryName(target);
BinaryWriter bw = null;
try
{
Directory.CreateDirectory(dirs);
FileStream fs = new FileStream(target, FileMode.Create);
bw = new BinaryWriter(fs);
bw.Write(buffer, offset, (buffer.Length - offset));
bw.Flush();
}
catch (IOException e)
{ }
finally
{
if (bw != null)
bw.Close();
}
}
Look up there ^
I don't need your money. I have plenty of my own.
What I won't tell you guys is how to pack it back into the gel/gem archives. I will let you jokers figure that out for yourselves.
i'm only 1 guy why GUYS ? and i'm not asking u to tell me how to unpack it lol idc for this shit
i'm only 1 guy why GUYS ? and i'm not asking u to tell me how to unpack it lol idc for this ****
Don't flatter yourself by assuming you are the only person that I posted that for. You are not the only person reading this forum. Or did you think you are?
It is there for others asking for this info as well. As Rito said, others looking for that info can search for and find it here.
Quote:
Originally Posted by anoofy
why u don't share it ? aren't u Rohan *** ?
i don't think u both want money too
See? You did ask for it. And look! I didn't ask a penny for it.
Don't flatter yourself by assuming you are the only person that I posted that for. You are not the only person reading this forum. Or did you think you are?
It is there for others asking for this info as well. As Rito said, others looking for that info can search for and find it here.
See? You did ask for it. And look! I didn't ask a penny for it.
i don't need it i said why u don't share it because u blaming someone for nothing and u didn't even share anything that's why i said why u don't share it lol
(* removed pointless text *)
So you don't need it and you have problems expressing what you mean. I get it. I am telling you AGAIN that I really don't care if you need it or not. It is not posted here just for you. It is here for the benefit of anybody that needs it. Free Of Charge.
Seafight bitmaps 05/27/2016 - Seafight - 1 Replies Hello, I m looking for seafight bitmaps of NPCs, monsters, glitters ect.
Do you know where to find it? Or can you send me some?
[ASK] Sunburst bitmaps? 09/16/2015 - Seafight - 2 Replies I am looking for sunburst bitmaps. I have some but my bot doesn't click them perfectly. How can I get the bitmaps?
Frage zu Bitmaps 02/10/2013 - Seafight - 4 Replies Guten Tag liebe pvper´s,
Ich habe ein Frage die hauptsächlich an die Script Schreiber gerichtet ist.
Da es um Seafight Symbol geht stelle ich dir Frage hier.
Ist es möglich einen Bitmap Code wie z.B:
repared := BitmapFromString(13, 9, 'beNqNkDEOgEAIBCm33JKWkm' +
'9YWl7pN/x/4nI2ajzPZEJBhoVAI554r7AL6iw30GGaB8JJoE ak7kP' +
'kO0vhpybOTMw09kDxR1PgZGkio06z9sbWo5oFLVxLB9paP5G T cmBx' +
[Scar Divi] Bitmaps 09/14/2012 - Coding Tutorials - 2 Replies Moin, in diesem Tutorial möchte ich euch erklären was Bitmaps sind und wie ihr in der Scriptsprache Scar Divi damit arbeiten könnt....
Was sind Bitmaps ?
Eine Bitmap (Pixelgrafik) ist eine Form der Beschreibung eines Bildes. Bitmaps bestehen aus einer rasterförmigen Anordnung von so genannten Pixeln (Bildpunkten), denen jeweils eine Farbe zugeordnet ist.
Wie erstelle ich eine Bitmap ?
Zunächst benötigt ihr hier ein Programm mit dem ihr das Bild im Windows Bitmap (BMP) Format...
Screenshot folder in data folder 04/18/2008 - Dekaron - 6 Replies So was going to mix with data.pak and i saw i had Screenshot folder with SS in it. Game Gaurd having funn?