Re: Entity 2.1.19
Posted: Tue Apr 02, 2013 7:11 am
Sorry to tweak your strings, but someone had to do it!
Archive of Halo 2 modding
https://www.remnantmods.com/forums/
https://www.remnantmods.com/forums/viewtopic.php?f=10&t=1325
Sorry, but I laughed pretty hard when I read this. So how far did you get?Click16 wrote:Fuck fuck fuck! I started modeling a BSP in 3ds! FUCK I FOGOT IT WAS APRIL FIRST >_<
xxpenguinxx wrote:This april fools shit is getting really old.
Agreed, let's put a stop to this childish (at least) 600+ year old tradition.wikipedia wrote:The earliest recorded association between April 1 and foolishness is an ambiguous reference in Chaucer's Canterbury Tales (1392).
No I just programmed a converter to convert A8R8G8B8 dds textures to each of the types. Only thing I didn't work in is the bumpmap converterxxpenguinxx wrote:I think Entity 1.6 UE can, or at least it can inject bumpmaps.
Have you tried injecting them?
From what I remember (many moons ago now) I had all formats supported. All formats could be converted to/from except no conversion to DXT I believe (and I think I had all the bugs worked out finally?). If over-writing with the same format I am sure that was no issue. Maybe I'll fire it up and check (been a looong time since I ran Entity).Click16 wrote:I have a question. Does this version of Entity support writing over certain bitmap types such as AY8, A8Y8, G8B8, etc?
Code: Select all
public enum H2DDSFormats
{
A8 = DDSFileFormats.Alpha_8_bit, // ._8bpp_8_A_alpha,
Y8 = DDSFileFormats.Alpha_8_bit, // ._8bpp_8_A_alpha,
P8 = DDSFileFormats.Alpha_8_bit, // ._8bpp_8_A_alpha,
AY8 = DDSFileFormats.A1R5G5B5_16_bit, // ._16bpp_1555_ARGB_Unsigned,
A8Y8 = DDSFileFormats.AlphaLuminance_16_bit, // ._16bpp_88_AL_AlphaLuminance,
R5G6B5 = DDSFileFormats.R5G6B5_16_bit, // _16bpp_565_RGB_Unsigned,
A1R5G5B5 = DDSFileFormats.A1R5G5B5_16_bit, // ._16bpp_1555_ARGB_Unsigned,
A4R4G4B4 = DDSFileFormats.A4R4G4B4_16_bit, // ._16bpp_444_ARGB_Unsigned,
X8R8G8B8 = DDSFileFormats.X8R8G8B8_32_bit, // ._32bpp_8888_XRGB_Unsigned,
A8R8G8B8 = DDSFileFormats.A8R8G8B8_32_bit, // ._32bpp_8888_ARGB_Unsigned,
DXT1 = DDSFileFormats.DXT1, // ._4bpp_DXT1_ARGB_1BitAlpha,
DXT3 = DDSFileFormats.DXT3, // _8bpp_DXT3_ARGB_ExplicitAlpha,
DXT5 = DDSFileFormats.DXT5, // _8bpp_DXT5_ARGB_InterpolatedAlpha,
Lightmap = DDSFileFormats.BITM_FORMAT_LIGHTMAP,
G8B8 = DDSFileFormats.AlphaLuminance_16_bit // _16bpp_88_AL_AlphaLuminance
}
Code: Select all
string[] formatDescriptions = new[]
{
"DXT1 ARGB 4 bpp | 1 bit alpha",
"DXT3 ARGB 8 bpp | explicit alpha",
"DXT5 ARGB 8 bpp | interpolated alpha",
"8 A 8 bpp | alpha",
"8.8 AL 16 bpp | alpha/luminance",
"4.4.4.4 RGB 16 bpp | unsigned",
"1.5.5.5 ARGB 16 bpp | unsigned",
"5.6.5 RGB 16 bpp | unsigned",
"4.4 ARGB 16 bpp | unsigned",
"X.8.8.8 XRGB 32 bpp | unsigned",
"8.8.8.8 ARGB 32 bpp | unsigned",
" | lightmap"
};
switch (info.formatname)
{
case ParsedBitmap.BitmapFormat.BITM_FORMAT_DXT1:
ddsff.Format = DDSFileFormats.DXT1;
temp += formatDescriptions[0];
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_DXT2AND3:
ddsff.Format = DDSFileFormats.DXT3;
temp += formatDescriptions[1];
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_DXT4AND5:
ddsff.Format = DDSFileFormats.DXT5;
temp += formatDescriptions[2];
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A8:
case ParsedBitmap.BitmapFormat.BITM_FORMAT_P8:
case ParsedBitmap.BitmapFormat.BITM_FORMAT_Y8:
ddsff.Format = DDSFileFormats.Alpha_8_bit;
temp += formatDescriptions[3];
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_G8B8:
ddsff.Format = DDSFileFormats.AlphaLuminance_16_bit;
temp += formatDescriptions[4];
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A4R4G4B4:
ddsff.Format = DDSFileFormats.A4R4G4B4_16_bit;
temp += formatDescriptions[5];
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A1R5G5B5:
ddsff.Format = DDSFileFormats.A1R5G5B5_16_bit;
temp += formatDescriptions[6];
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_R5G6B5:
ddsff.Format = DDSFileFormats.R5G6B5_16_bit;
temp += formatDescriptions[7];
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A8Y8:
ddsff.Format = DDSFileFormats.AlphaLuminance_16_bit;
temp += formatDescriptions[8];
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_AY8:
ddsff.Format = DDSFileFormats.AlphaLuminance_16_bit;
temp += formatDescriptions[8];
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_X8R8G8B8:
ddsff.Format = DDSFileFormats.X8R8G8B8_32_bit;
temp += formatDescriptions[9];
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A8R8G8B8:
ddsff.Format = DDSFileFormats.A8R8G8B8_32_bit;
temp += formatDescriptions[10];
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_LIGHTMAP:
ddsff.Format = DDSFileFormats.BITM_FORMAT_LIGHTMAP;
temp += formatDescriptions[11];
break;
}
Code: Select all
// For RGB formats dwFlags should include DDPF_ALPHAPIXELS if it contains an alpha channel.
// For A8R8G8B8, this value would be 0xff000000.
switch (b2.formatname)
{
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A1R5G5B5:
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A4R4G4B4:
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A8R8G8B8:
case ParsedBitmap.BitmapFormat.BITM_FORMAT_G8B8:
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A8Y8:
Flags = Flags + (int)DDSEnum.DDPF_ALPHAPIXELS;
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A8:
case ParsedBitmap.BitmapFormat.BITM_FORMAT_P8:
case ParsedBitmap.BitmapFormat.BITM_FORMAT_Y8:
Flags = Flags + (int)DDSEnum.DDPF_ALPHA;
Flags = Flags - (int)DDSEnum.DDPF_RGB; // These formats are ALPHA ONLY, no RGB
break;
}
// For RGB formats, this contains the masks for the red, green, and blue channels. For A8R8G8B8, these
// values would be 0x00ff0000, 0x0000ff00, and 0x000000ff respectively.
switch (b2.formatname)
{
case ParsedBitmap.BitmapFormat.BITM_FORMAT_G8B8:
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A8Y8:
RGBAlphaBitMask = 0xFF00;
RBitMask = 0x00FF;
GBitMask = 0x0000;
BBitMask = 0x0000;
Flags -= (int)DDSEnum.DDPF_RGB; // This format doesn't use RGB
Flags += (int)DDSEnum.DDSD_MIPMAPCOUNT; // Mipmap Count
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_AY8:
RGBAlphaBitMask = 0x0000;
RBitMask = 0x000F;
GBitMask = 0x00F0;
BBitMask = 0x0000;
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A8:
case ParsedBitmap.BitmapFormat.BITM_FORMAT_P8:
case ParsedBitmap.BitmapFormat.BITM_FORMAT_Y8:
RGBAlphaBitMask = 0x00FF;
RBitMask = 0x0000;
GBitMask = 0x0000;
BBitMask = 0x0000;
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_R5G6B5:
RGBAlphaBitMask = 0x0000;
RBitMask = 0xF800;
GBitMask = 0x07E0;
BBitMask = 0x001F;
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A1R5G5B5:
RGBAlphaBitMask = 0x8000;
RBitMask = 0x7C00;
GBitMask = 0x03E0;
BBitMask = 0x001F;
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A4R4G4B4:
RGBAlphaBitMask = 0xF000;
RBitMask = 0x0F00;
GBitMask = 0x00F0;
BBitMask = 0x000F;
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_X8R8G8B8:
RGBAlphaBitMask = 0x00000000;
RBitMask = 0x00FF0000;
GBitMask = 0x0000FF00;
BBitMask = 0x000000FF;
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_A8R8G8B8:
RGBAlphaBitMask = 0xFF000000;
RBitMask = 0x00FF0000;
GBitMask = 0x0000FF00;
BBitMask = 0x000000FF;
break;
case ParsedBitmap.BitmapFormat.BITM_FORMAT_LIGHTMAP:
RGBAlphaBitMask = 0x00000000;
RBitMask = 0x000000FF;
GBitMask = 0x000000FF;
BBitMask = 0x000000FF;
Flags -= (int)DDSEnum.DDPF_RGB; // This format doesn't use RGB
Flags += (int)DDSEnum.DDSD_MIPMAPCOUNT; // Mipmap Count
break;
default:
RGBAlphaBitMask = 0x0;
RBitMask = 0;
GBitMask = 0;
BBitMask = 0;
break;
}
}
^This. There must be another way though...JacksonCougar wrote:First a method, then your soul.