_BaseFormat to be consistant with gl_renderbuffer.
for ( height = i = 0 ; i < numLevels ; i++ ) {
t->image[i].image = tObj->Image[0][t->base.firstLevel + i];
t->image[i].offset = height * pitch;
- t->image[i].internalFormat = baseImage->Format;
+ t->image[i].internalFormat = baseImage->_BaseFormat;
height += t->image[i].image->Height;
}
* texture environment state has changed.
*/
- imesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format;
+ imesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
}
else {
imesa->CurrentTexObj[unit] = 0;
}
else
total_height += t->image[0][i].image->Height;
- t->image[0][i].internalFormat = baseImage->Format;
+ t->image[0][i].internalFormat = baseImage->_BaseFormat;
}
t->Pitch = pitch;
* missed (need to update last stage flag?). Call
* i830UpdateTexEnv always.
*/
- if (tObj->Image[0][tObj->BaseLevel]->Format !=
+ if (tObj->Image[0][tObj->BaseLevel]->_BaseFormat !=
imesa->TexEnvImageFmt[unit]) {
- imesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format;
+ imesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
}
i830UpdateTexEnv( ctx, unit );
imesa->TexEnabledMask |= I830_TEX_UNIT_ENABLED(unit);
t->intel.image[face][i].offset =
y * pitch + x * t->intel.texelBytes;
- t->intel.image[face][i].internalFormat = baseImage->Format;
+ t->intel.image[face][i].internalFormat = baseImage->_BaseFormat;
d >>= 1;
x += step_offsets[face][0] * d;
break;
t->intel.image[0][i].offset = total_height * pitch;
- t->intel.image[0][i].internalFormat = baseImage->Format;
+ t->intel.image[0][i].internalFormat = baseImage->_BaseFormat;
if (t->intel.image[0][i].image->IsCompressed)
{
if (t->intel.image[0][i].image->Height > 4)
struct gl_texture_unit *texUnit = &p->ctx->Texture.Unit[unit];
GLenum envMode = texUnit->EnvMode;
struct gl_texture_object *tObj = texUnit->_Current;
- GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
+ GLenum format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
GLuint saturate = unit < p->last_tex_stage ? A0_DEST_SATURATE : 0;
switch(envMode) {
t->intel.image[face][i].offset =
y * pitch + x * t->intel.texelBytes;
- t->intel.image[face][i].internalFormat = baseImage->Format;
+ t->intel.image[face][i].internalFormat = baseImage->_BaseFormat;
d >>= 1;
x += step_offsets[face][0] * d;
t->intel.image[0][i].image = tObj->Image[0][firstLevel + i];
if (t->intel.image[0][i].image) {
t->intel.image[0][i].offset = total_height * pitch;
- t->intel.image[0][i].internalFormat = baseImage->Format;
+ t->intel.image[0][i].internalFormat = baseImage->_BaseFormat;
}
total_height += MAX2(2, virtual_height);
break;
t->intel.image[0][i].offset = total_height * pitch;
- t->intel.image[0][i].internalFormat = baseImage->Format;
+ t->intel.image[0][i].internalFormat = baseImage->_BaseFormat;
if (t->intel.image[0][i].image->IsCompressed)
{
if (t->intel.image[0][i].image->Height > 4)
t->intel.image[face][i].offset =
y * pitch + x * t->intel.texelBytes;
- t->intel.image[face][i].internalFormat = baseImage->Format;
+ t->intel.image[face][i].internalFormat = baseImage->_BaseFormat;
d >>= 1;
t->intel.image[0][i].offset = total_height * pitch;
- t->intel.image[0][i].internalFormat = baseImage->Format;
+ t->intel.image[0][i].internalFormat = baseImage->_BaseFormat;
break;
t->intel.image[0][i].offset = offset;
- t->intel.image[0][i].internalFormat = baseImage->Format;
+ t->intel.image[0][i].internalFormat = baseImage->_BaseFormat;
if (t->intel.image[0][i].image->IsCompressed)
sz = MAX2(1, t->intel.image[0][i].image->Height/4) * pitch;
image->Width, image->Height, image->Depth, offset,
row_len, t->Pitch, t->depth_pitch);
- switch(image->IntFormat)
- {
+ switch (image->InternalFormat) {
case GL_COMPRESSED_RGB_FXT1_3DFX:
case GL_COMPRESSED_RGBA_FXT1_3DFX:
case GL_RGB_S3TC:
}
break;
default:
- fprintf(stderr,"Internal Compressed format not supported %d\n", image->IntFormat);
+ fprintf(stderr,"Internal Compressed format not supported %d\n", image->InternalFormat);
break;
- }
+ }
}
else {
GLuint row_len = image->Width * image->TexFormat->TexelBytes;
t->setup.tex_cntl &= ~R128_MIP_MAP_DISABLE;
#else
- if ( ( baseImage->Format == GL_RGBA ) ||
- ( baseImage->Format == GL_ALPHA ) ||
- ( baseImage->Format == GL_LUMINANCE_ALPHA ) ) {
+ if ( ( baseImage->_BaseFormat == GL_RGBA ) ||
+ ( baseImage->_BaseFormat == GL_ALPHA ) ||
+ ( baseImage->_BaseFormat == GL_LUMINANCE_ALPHA ) ) {
t->hasAlpha = 1;
} else {
t->hasAlpha = 0;
GLint source = mmesa->tmu_source[unit];
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
const struct gl_texture_object *tObj = texUnit->_Current;
- const GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
+ const GLenum format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
GLuint s = mmesa->setup.scale_3d_cntl;
if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
struct gl_texture_object *tObj = ctx->Texture.Unit[0]._Current;
mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
- GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
+ GLenum format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
if (tObj != ctx->Texture.Unit[0].Current2D &&
tObj != ctx->Texture.Unit[0].CurrentRect)
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
const struct gl_texture_object *tObj = texUnit->_Current;
GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit);
- GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
+ GLenum format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
*reg = 0;
const struct gl_texture_object *tObj = texUnit->_Current;
GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit);
mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
- GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
+ GLenum format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
if (tObj != ctx->Texture.Unit[source].Current2D &&
tObj != ctx->Texture.Unit[source].CurrentRect)
GLint source = rmesa->tmu_source[unit];
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
const struct gl_texture_object *tObj = texUnit->_Current;
- const GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
+ const GLenum format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
GLuint combine;
if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
if(0)
fprintf(stderr, "w=%d h=%d d=%d tb=%d intFormat=%d\n", texImage->Width, texImage->Height,
texImage->Depth, texImage->TexFormat->TexelBytes,
- texImage->IntFormat);
+ texImage->InternalFormat);
/* Align to 32-byte offset. It is faster to do this unconditionally
* (no branch penalty).
}
#endif
- format = tObj->Image[0][tObj->BaseLevel]->Format;
+ format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
if (rmesa->state.texture.unit[unit].format != format ||
rmesa->state.texture.unit[unit].envMode != texUnit->EnvMode) {
//rmesa->state.texture.unit[unit].format = format;
rmesa->NewGLState |= _NEW_TEXTURE_MATRIX;
}
- format = tObj->Image[0][tObj->BaseLevel]->Format;
+ format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
if ( rmesa->state.texture.unit[unit].format != format ||
rmesa->state.texture.unit[unit].envMode != texUnit->EnvMode ) {
rmesa->state.texture.unit[unit].format = format;
default:
fprintf(stderr, "Not supported texture format %s\n",
- _mesa_lookup_enum_by_nr(image->Format));
+ _mesa_lookup_enum_by_nr(image->_BaseFormat));
}
DEBUG_TEX(("words = %i\n\n", words));
for ( height = i = 0 ; i < numLevels ; i++ ) {
t->image[i].image = tObj->Image[0][firstLevel + i];
t->image[i].offset = height * pitch;
- t->image[i].internalFormat = baseImage->Format;
+ t->image[i].internalFormat = baseImage->_BaseFormat;
height += t->image[i].image->Height;
t->TextureBaseAddr[i] = (t->BufAddr + t->image[i].offset +
_TEXALIGN) & (GLuint)(~_TEXALIGN);
s3vContextPtr vmesa = S3V_CONTEXT(ctx);
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
const struct gl_texture_object *tObj = texUnit->_Current;
- const GLuint format = tObj->Image[0][tObj->BaseLevel]->Format;
+ const GLuint format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
/*
s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData;
GLuint tc;
/* Update texture environment if texture object image format or
* texture environment state has changed.
*/
- if (tObj->Image[0][tObj->BaseLevel]->Format !=
+ if (tObj->Image[0][tObj->BaseLevel]->_BaseFormat !=
vmesa->TexEnvImageFmt[unit]) {
- vmesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format;
+ vmesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
s3vUpdateTexEnv( ctx, unit );
}
#if 1
0, /* IntensityBits */
0, /* IndexBits */
0, /* DepthBits */
+ 0, /* StencilBits */
2, /* TexelBytes */
_savage_texstore_a1114444, /* StoreTexImageFunc */
NULL, NULL, NULL, NULL, NULL, NULL /* FetchTexel* filled in by
0, /* IntensityBits */
0, /* IndexBits */
0, /* DepthBits */
+ 0, /* StencilBits */
4, /* TexelBytes */
_savage_texstore_a1118888, /* StoreTexImageFunc */
NULL, NULL, NULL, NULL, NULL, NULL /* FetchTexel* filled in by
driUpdateTextureLRU( &t->base );
- format = tObj->Image[0][tObj->BaseLevel]->Format;
+ format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
switch (ctx->Texture.Unit[0].EnvMode) {
case GL_REPLACE:
driUpdateTextureLRU( &t->base );
- format = tObj->Image[0][tObj->BaseLevel]->Format;
+ format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
switch (ctx->Texture.Unit[1].EnvMode) {
case GL_REPLACE:
driUpdateTextureLRU( &t->base );
- format = tObj->Image[0][tObj->BaseLevel]->Format;
+ format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
/* FIXME: copied from utah-glx, probably needs some tuning */
switch (ctx->Texture.Unit[0].EnvMode) {
int size, texel_size;
if (t->format == 0) {
- t->format = image->Format;
+ t->format = image->_BaseFormat;
switch (t->format)
{
case GL_RGBA:
sis_fatal_error("Bad texture format.\n");
}
}
- assert(t->format == image->Format);
+ assert(t->format == image->_BaseFormat);
texel_size = image->TexFormat->TexelBytes;
size = image->Width * image->Height * texel_size + TEXTURE_HW_PLUS;
srcRowStride, /* dstRowStride */
0, /* dstImageStride */
srcWidth, srcHeight, 1,
- texImage->Format, _t, srcImage, &ctx->DefaultPacking);
+ texImage->_BaseFormat, _t, srcImage, &ctx->DefaultPacking);
}
if (srcHeight == 1) {
if (bpt) {
src = _s;
dst = _d;
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
+ texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat, dstImage,
0, 0, 0, /* dstX/Y/Zoffset */
dstWidth * bpt,
return GL_FALSE;
}
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
+ texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat, tempImage,
0, 0, 0, /* dstX/Y/Zoffset */
width * texelBytes, /* dstRowStride */
width, height, /* src */
newWidth, newHeight, /* dst */
rawImage /*src*/, tempImage /*dst*/ );
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
+ texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat, texImage->Data,
xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */
dstRowStride,
case GL_RGBA4_S3TC:
internalFormat = GL_COMPRESSED_RGBA_FXT1_3DFX;
}
- texImage->IntFormat = internalFormat;
+ texImage->InternalFormat = internalFormat;
}
#endif
#if FX_TC_NAPALM
texNapalm = GL_COMPRESSED_RGBA_FXT1_3DFX;
}
if (texNapalm) {
- texImage->IntFormat = internalFormat = texNapalm;
+ texImage->InternalFormat = internalFormat = texNapalm;
texImage->IsCompressed = GL_TRUE;
}
}
else {
/* no rescaling needed */
/* unpack image, apply transfer ops and store in texImage->Data */
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
+ texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat, texImage->Data,
0, 0, 0, /* dstX/Y/Zoffset */
dstRowStride,
assert(mml);
assert(texImage->Data); /* must have an existing texture image! */
- assert(texImage->Format);
+ assert(texImage->_BaseFormat);
texelBytes = texImage->TexFormat->TexelBytes;
if (texImage->IsCompressed) {
- dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat, mml->width);
+ dstRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, mml->width);
} else {
dstRowStride = mml->width * texelBytes;
}
}
else {
/* no rescaling needed */
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
+ texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat, texImage->Data,
xoffset, yoffset, 0,
dstRowStride,
mml = TDFX_TEXIMAGE_DATA(texImage);
assert(mml);
- srcRowStride = _mesa_compressed_row_stride(texImage->IntFormat, width);
+ srcRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, width);
- destRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ destRowStride = _mesa_compressed_row_stride(texImage->InternalFormat,
mml->width);
dest = _mesa_compressed_image_address(xoffset, yoffset, 0,
- texImage->IntFormat,
+ texImage->InternalFormat,
mml->width,
(GLubyte*) texImage->Data);
* see fxDDCompressedTexImage2D for caveats
*/
if (mml->wScale != 1 || mml->hScale != 1) {
- srcRowStride = _mesa_compressed_row_stride(texImage->IntFormat, texImage->Width);
+ srcRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, texImage->Width);
- destRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ destRowStride = _mesa_compressed_row_stride(texImage->InternalFormat,
mml->width);
_mesa_upscale_teximage2d(srcRowStride, texImage->Height / 4,
destRowStride, mml->height / 4,
tObj->Image[0][level]->Height = height;
tObj->Image[0][level]->Border = border;
#if 0
- tObj->Image[0][level]->IntFormat = internalFormat;
+ tObj->Image[0][level]->InternalFormat = internalFormat;
#endif
if (level == 0) {
/* don't use mipmap levels > 0 */
/* Check if we really need to update the texenv state */
envMode = ctx->Texture.Unit[unit].EnvMode;
- baseFormat = tObj->Image[0][tObj->BaseLevel]->Format;
+ baseFormat = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
if (TDFX_IS_NAPALM(fxMesa)) {
/* see if we really need to update the unit */
baseImage0->Format != fxMesa->TexState.TexFormat[1] ||
(fxMesa->Fallback & TDFX_FALLBACK_TEXTURE_ENV)*/) {
hw1 = SetupTexEnvNapalm(ctx, GL_TRUE, &ctx->Texture.Unit[0],
- baseImage0->Format, &fxMesa->TexCombineExt[1]);
+ baseImage0->_BaseFormat, &fxMesa->TexCombineExt[1]);
#if 0/*JJJ*/
fxMesa->TexState.EnvMode[1] = envMode0;
- fxMesa->TexState.TexFormat[1] = baseImage0->Format;
+ fxMesa->TexState.TexFormat[1] = baseImage0->_BaseFormat;
fxMesa->TexState.Enabled[0] = ctx->Texture.Unit[0]._ReallyEnabled;
#endif
}
if (1/*fxMesa->TexState.Enabled[1] != ctx->Texture.Unit[1]._ReallyEnabled ||
envMode1 != fxMesa->TexState.EnvMode[0] ||
envMode1 == GL_COMBINE_EXT ||
- baseImage1->Format != fxMesa->TexState.TexFormat[0] ||
+ baseImage1->_BaseFormat != fxMesa->TexState.TexFormat[0] ||
(fxMesa->Fallback & TDFX_FALLBACK_TEXTURE_ENV)*/) {
hw2 = SetupTexEnvNapalm(ctx, GL_FALSE, &ctx->Texture.Unit[1],
- baseImage1->Format, &fxMesa->TexCombineExt[0]);
+ baseImage1->_BaseFormat, &fxMesa->TexCombineExt[0]);
#if 0/*JJJ*/
fxMesa->TexState.EnvMode[0] = envMode1;
- fxMesa->TexState.TexFormat[0] = baseImage1->Format;
+ fxMesa->TexState.TexFormat[0] = baseImage1->_BaseFormat;
fxMesa->TexState.Enabled[1] = ctx->Texture.Unit[1]._ReallyEnabled;
#endif
}
envMode0 == GL_COMBINE_EXT ||
envMode1 != fxMesa->TexState.EnvMode[unit1] ||
envMode1 == GL_COMBINE_EXT ||
- baseImage0->Format != fxMesa->TexState.TexFormat[unit0] ||
- baseImage1->Format != fxMesa->TexState.TexFormat[unit1] ||
+ baseImage0->_BaseFormat != fxMesa->TexState.TexFormat[unit0] ||
+ baseImage1->_BaseFormat != fxMesa->TexState.TexFormat[unit1] ||
(fxMesa->Fallback & TDFX_FALLBACK_TEXTURE_ENV)*/) {
if (!SetupDoubleTexEnvVoodoo3(ctx, unit0,
- ctx->Texture.Unit[0].EnvMode, baseImage0->Format,
- ctx->Texture.Unit[1].EnvMode, baseImage1->Format)) {
+ ctx->Texture.Unit[0].EnvMode, baseImage0->_BaseFormat,
+ ctx->Texture.Unit[1].EnvMode, baseImage1->_BaseFormat)) {
FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_ENV, GL_TRUE);
}
#if 0/*JJJ*/
fxMesa->TexState.EnvMode[unit0] = envMode0;
- fxMesa->TexState.TexFormat[unit0] = baseImage0->Format;
+ fxMesa->TexState.TexFormat[unit0] = baseImage0->_BaseFormat;
fxMesa->TexState.EnvMode[unit1] = envMode1;
- fxMesa->TexState.TexFormat[unit1] = baseImage1->Format;
+ fxMesa->TexState.TexFormat[unit1] = baseImage1->_BaseFormat;
fxMesa->TexState.Enabled[0] = ctx->Texture.Unit[0]._ReallyEnabled;
fxMesa->TexState.Enabled[1] = ctx->Texture.Unit[1]._ReallyEnabled;
#endif
GLint dstRowStride, dstImageStride = 0;
GLboolean success;
if (texImage->IsCompressed) {
- dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,width);
+ dstRowStride = _mesa_compressed_row_stride(texImage->InternalFormat,width);
}
else {
dstRowStride = postConvWidth * texImage->TexFormat->TexelBytes;
}
ASSERT(texImage->TexFormat->StoreImage);
- success = texImage->TexFormat->StoreImage(ctx, dims, texImage->Format,
+ success = texImage->TexFormat->StoreImage(ctx, dims,
+ texImage->_BaseFormat,
texImage->TexFormat,
texImage->Data,
0, 0, 0, /* dstX/Y/Zoffset */
srcRowStride, /* dstRowStride */
0, /* dstImageStride */
srcWidth, srcHeight, 1,
- texImage->Format, _t, srcImage, &ctx->DefaultPacking);
+ texImage->_BaseFormat, _t,
+ srcImage, &ctx->DefaultPacking);
}
if (srcHeight == 1) {
if (bpt) {
src = _s;
dst = _d;
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
+ texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat, dstImage,
0, 0, 0, /* dstX/Y/Zoffset */
dstWidth * bpt,
return GL_FALSE;
}
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
+ texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat, tempImage,
0, 0, 0, /* dstX/Y/Zoffset */
width * texelBytes, /* dstRowStride */
width, height, /* src */
newWidth, newHeight, /* dst */
rawImage /*src*/, tempImage /*dst*/ );
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
+ texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat, texImage->Data,
xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */
dstRowStride,
if (TDFX_DEBUG & VERBOSE_TEXTURE) {
fprintf(stderr, "fxDDTexImage2D: id=%d int 0x%x format 0x%x type 0x%x %dx%d\n",
- texObj->Name, texImage->IntFormat, format, type,
+ texObj->Name, texImage->InternalFormat, format, type,
texImage->Width, texImage->Height);
}
case GL_RGBA4_S3TC:
internalFormat = GL_COMPRESSED_RGBA_FXT1_3DFX;
}
- texImage->IntFormat = internalFormat;
+ texImage->InternalFormat = internalFormat;
}
#endif
#if FX_TC_NAPALM
texNapalm = GL_COMPRESSED_RGBA_FXT1_3DFX;
}
if (texNapalm) {
- texImage->IntFormat = internalFormat = texNapalm;
+ texImage->InternalFormat = internalFormat = texNapalm;
texImage->IsCompressed = GL_TRUE;
}
}
else {
/* no rescaling needed */
/* unpack image, apply transfer ops and store in texImage->Data */
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
+ texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat, texImage->Data,
0, 0, 0, /* dstX/Y/Zoffset */
dstRowStride,
assert(mml);
assert(texImage->Data); /* must have an existing texture image! */
- assert(texImage->Format);
+ assert(texImage->_BaseFormat);
texelBytes = texImage->TexFormat->TexelBytes;
if (texImage->IsCompressed) {
- dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat, mml->width);
+ dstRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, mml->width);
} else {
dstRowStride = mml->width * texelBytes;
}
}
else {
/* no rescaling needed */
- texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
+ texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat, (GLubyte *) texImage->Data,
xoffset, yoffset, 0, /* dstX/Y/Zoffset */
dstRowStride,
mml = FX_MIPMAP_DATA(texImage);
assert(mml);
- srcRowStride = _mesa_compressed_row_stride(texImage->IntFormat, width);
+ srcRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, width);
- destRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ destRowStride = _mesa_compressed_row_stride(texImage->InternalFormat,
mml->width);
dest = _mesa_compressed_image_address(xoffset, yoffset, 0,
- texImage->IntFormat,
+ texImage->InternalFormat,
mml->width,
(GLubyte*) texImage->Data);
* see fxDDCompressedTexImage2D for caveats
*/
if (mml->wScale != 1 || mml->hScale != 1) {
- srcRowStride = _mesa_compressed_row_stride(texImage->IntFormat, texImage->Width);
+ srcRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, texImage->Width);
- destRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ destRowStride = _mesa_compressed_row_stride(texImage->InternalFormat,
mml->width);
_mesa_upscale_teximage2d(srcRowStride, texImage->Height / 4,
destRowStride, mml->height / 4,
}
if (att->Type == GL_TEXTURE) {
- w = att->Texture->Image[att->CubeMapFace][att->TextureLevel]->Width;
- h = att->Texture->Image[att->CubeMapFace][att->TextureLevel]->Height;
- f = att->Texture->Image[att->CubeMapFace][att->TextureLevel]->Format;
+ const struct gl_texture_image *texImg
+ = att->Texture->Image[att->CubeMapFace][att->TextureLevel];
+ w = texImg->Width;
+ h = texImg->Height;
+ f = texImg->_BaseFormat;
numImages++;
if (f != GL_RGB && f != GL_RGBA && f != GL_DEPTH_COMPONENT) {
/* XXX need GL_DEPTH_STENCIL_EXT test? */
*/
struct gl_texture_image
{
- GLenum Format; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
+ GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
* GL_LUMINANCE, GL_LUMINANCE_ALPHA,
* GL_INTENSITY, GL_COLOR_INDEX,
* GL_DEPTH_COMPONENT or GL_DEPTH_STENCIL_EXT
* only. Used for choosing TexEnv arithmetic.
*/
- GLint IntFormat; /**< Internal format as given by the user */
+ GLint InternalFormat; /**< Internal format as given by the user */
GLuint Border; /**< 0 or 1 */
GLuint Width; /**< = 2^WidthLog2 + 2*Border */
GLuint Height; /**< = 2^HeightLog2 + 2*Border */
clear_teximage_fields(struct gl_texture_image *img)
{
ASSERT(img);
- img->Format = 0;
- img->IntFormat = 0;
+ img->_BaseFormat = 0;
+ img->InternalFormat = 0;
img->Border = 0;
img->Width = 0;
img->Height = 0;
GLint border, GLenum internalFormat)
{
ASSERT(img);
- img->Format = _mesa_base_tex_format( ctx, internalFormat );
- ASSERT(img->Format > 0);
- img->IntFormat = internalFormat;
+ img->_BaseFormat = _mesa_base_tex_format( ctx, internalFormat );
+ ASSERT(img->_BaseFormat > 0);
+ img->InternalFormat = internalFormat;
img->Border = border;
img->Width = width;
img->Height = height;
}
}
- if (teximage->IntFormat == GL_YCBCR_MESA) {
+ if (teximage->InternalFormat == GL_YCBCR_MESA) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTexSubImage2D");
return GL_TRUE;
}
- if (teximage->Format == GL_DEPTH_COMPONENT) {
+ if (teximage->_BaseFormat == GL_DEPTH_COMPONENT) {
if (!ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyTexSubImage%D(no depth buffer)",
return GL_TRUE;
}
}
- else if (teximage->Format == GL_DEPTH_STENCIL_EXT) {
+ else if (teximage->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
if (!ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer ||
!ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer) {
_mesa_error(ctx, GL_INVALID_OPERATION,
texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
assert(texImage);
- if ((GLint) format != texImage->IntFormat) {
+ if ((GLint) format != texImage->InternalFormat) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCompressedTexSubImage1D(format)");
return;
texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
assert(texImage);
- if ((GLint) format != texImage->IntFormat) {
+ if ((GLint) format != texImage->InternalFormat) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCompressedTexSubImage2D(format)");
return;
texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
assert(texImage);
- if ((GLint) format != texImage->IntFormat) {
+ if ((GLint) format != texImage->InternalFormat) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCompressedTexSubImage3D(format)");
return;
t->Complete = GL_FALSE;
return;
}
- if (t->Image[0][i]->Format == GL_DEPTH_COMPONENT) {
+ if (t->Image[0][i]->_BaseFormat == GL_DEPTH_COMPONENT) {
t->Complete = GL_FALSE;
incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
return;
return;
}
/* Don't support GL_DEPTH_COMPONENT for cube maps */
- if (t->Image[face][i]->Format == GL_DEPTH_COMPONENT) {
+ if (t->Image[face][i]->_BaseFormat == GL_DEPTH_COMPONENT) {
t->Complete = GL_FALSE;
incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
return;
trb->Base.Width = trb->TexImage->Width;
trb->Base.Height = trb->TexImage->Height;
- trb->Base.InternalFormat = trb->TexImage->IntFormat; /* XXX fix? */
+ trb->Base.InternalFormat = trb->TexImage->InternalFormat; /* XXX fix? */
trb->Base._BaseFormat = trb->TexImage->TexFormat->BaseFormat;
#if 0
/* fix/avoid this assertion someday */
*params = img->Depth;
return;
case GL_TEXTURE_INTERNAL_FORMAT:
- *params = img->IntFormat;
+ *params = img->InternalFormat;
return;
case GL_TEXTURE_BORDER:
*params = img->Border;
return;
case GL_TEXTURE_RED_SIZE:
- if (img->Format == GL_RGB || img->Format == GL_RGBA)
+ if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA)
*params = img->TexFormat->RedBits;
else
*params = 0;
return;
case GL_TEXTURE_GREEN_SIZE:
- if (img->Format == GL_RGB || img->Format == GL_RGBA)
+ if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA)
*params = img->TexFormat->GreenBits;
else
*params = 0;
return;
case GL_TEXTURE_BLUE_SIZE:
- if (img->Format == GL_RGB || img->Format == GL_RGBA)
+ if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA)
*params = img->TexFormat->BlueBits;
else
*params = 0;
return;
case GL_TEXTURE_ALPHA_SIZE:
- if (img->Format == GL_ALPHA || img->Format == GL_LUMINANCE_ALPHA ||
- img->Format == GL_RGBA)
+ if (img->_BaseFormat == GL_ALPHA ||
+ img->_BaseFormat == GL_LUMINANCE_ALPHA ||
+ img->_BaseFormat == GL_RGBA)
*params = img->TexFormat->AlphaBits;
else
*params = 0;
return;
case GL_TEXTURE_INTENSITY_SIZE:
- if (img->Format != GL_INTENSITY)
+ if (img->_BaseFormat != GL_INTENSITY)
*params = 0;
else if (img->TexFormat->IntensityBits > 0)
*params = img->TexFormat->IntensityBits;
*params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits);
return;
case GL_TEXTURE_LUMINANCE_SIZE:
- if (img->Format != GL_LUMINANCE &&
- img->Format != GL_LUMINANCE_ALPHA)
+ if (img->_BaseFormat != GL_LUMINANCE &&
+ img->_BaseFormat != GL_LUMINANCE_ALPHA)
*params = 0;
else if (img->TexFormat->LuminanceBits > 0)
*params = img->TexFormat->LuminanceBits;
*params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits);
return;
case GL_TEXTURE_INDEX_SIZE_EXT:
- if (img->Format == GL_COLOR_INDEX)
+ if (img->_BaseFormat == GL_COLOR_INDEX)
*params = img->TexFormat->IndexBits;
else
*params = 0;
texUnit->_CurrentCombine = & texUnit->Combine;
}
else {
- GLenum format = texUnit->_Current->Image[0][0]->Format;
+ GLenum format = texUnit->_Current->Image[0][0]->_BaseFormat;
if (format == GL_COLOR_INDEX) {
format = GL_RGBA; /* a bit of a hack */
}
const GLint dstRowStride = 0, dstImageStride = 0;
GLboolean success;
ASSERT(texImage->TexFormat->StoreImage);
- success = texImage->TexFormat->StoreImage(ctx, 1, texImage->Format,
+ success = texImage->TexFormat->StoreImage(ctx, 1, texImage->_BaseFormat,
texImage->TexFormat,
texImage->Data,
0, 0, 0, /* dstX/Y/Zoffset */
GLint dstRowStride, dstImageStride = 0;
GLboolean success;
if (texImage->IsCompressed) {
- dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,width);
+ dstRowStride
+ = _mesa_compressed_row_stride(texImage->InternalFormat,width);
}
else {
dstRowStride = postConvWidth * texImage->TexFormat->TexelBytes;
}
ASSERT(texImage->TexFormat->StoreImage);
- success = texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
+ success = texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat,
texImage->Data,
0, 0, 0, /* dstX/Y/Zoffset */
GLint dstRowStride, dstImageStride;
GLboolean success;
if (texImage->IsCompressed) {
- dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,width);
+ dstRowStride
+ = _mesa_compressed_row_stride(texImage->InternalFormat,width);
dstImageStride = 0;
}
else {
dstImageStride = dstRowStride * height;
}
ASSERT(texImage->TexFormat->StoreImage);
- success = texImage->TexFormat->StoreImage(ctx, 3, texImage->Format,
+ success = texImage->TexFormat->StoreImage(ctx, 3, texImage->_BaseFormat,
texImage->TexFormat,
texImage->Data,
0, 0, 0, /* dstX/Y/Zoffset */
const GLint dstRowStride = 0, dstImageStride = 0;
GLboolean success;
ASSERT(texImage->TexFormat->StoreImage);
- success = texImage->TexFormat->StoreImage(ctx, 1, texImage->Format,
+ success = texImage->TexFormat->StoreImage(ctx, 1, texImage->_BaseFormat,
texImage->TexFormat,
texImage->Data,
xoffset, 0, 0, /* offsets */
GLint dstRowStride = 0, dstImageStride = 0;
GLboolean success;
if (texImage->IsCompressed) {
- dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ dstRowStride = _mesa_compressed_row_stride(texImage->InternalFormat,
texImage->Width);
}
else {
dstRowStride = texImage->Width * texImage->TexFormat->TexelBytes;
}
ASSERT(texImage->TexFormat->StoreImage);
- success = texImage->TexFormat->StoreImage(ctx, 2, texImage->Format,
+ success = texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat,
texImage->TexFormat,
texImage->Data,
xoffset, yoffset, 0,
GLint dstRowStride, dstImageStride;
GLboolean success;
if (texImage->IsCompressed) {
- dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ dstRowStride = _mesa_compressed_row_stride(texImage->InternalFormat,
texImage->Width);
dstImageStride = 0; /* XXX fix */
}
dstImageStride = dstRowStride * texImage->Height;
}
ASSERT(texImage->TexFormat->StoreImage);
- success = texImage->TexFormat->StoreImage(ctx, 3, texImage->Format,
+ success = texImage->TexFormat->StoreImage(ctx, 3, texImage->_BaseFormat,
texImage->TexFormat,
texImage->Data,
xoffset, yoffset, zoffset,
if (!data)
return;
- srcRowStride = _mesa_compressed_row_stride(texImage->IntFormat, width);
+ srcRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, width);
src = (const GLubyte *) data;
- destRowStride = _mesa_compressed_row_stride(texImage->IntFormat,
+ destRowStride = _mesa_compressed_row_stride(texImage->InternalFormat,
texImage->Width);
dest = _mesa_compressed_image_address(xoffset, yoffset, 0,
- texImage->IntFormat,
+ texImage->InternalFormat,
texImage->Width,
(GLubyte*) texImage->Data);
assert(texObj->Target == GL_TEXTURE_2D);
- if (srcImage->Format == GL_RGB) {
+ if (srcImage->_BaseFormat == GL_RGB) {
convertFormat = &_mesa_texformat_rgb;
components = 3;
}
- else if (srcImage->Format == GL_RGBA) {
+ else if (srcImage->_BaseFormat == GL_RGBA) {
convertFormat = &_mesa_texformat_rgba;
components = 4;
}
else {
- _mesa_problem(ctx, "bad srcImage->Format in _mesa_generate_mipmaps");
+ _mesa_problem(ctx, "bad srcImage->_BaseFormat in _mesa_generate_mipmaps");
return;
}
/* allocate storage for uncompressed GL_RGB or GL_RGBA images */
- size = _mesa_bytes_per_pixel(srcImage->Format, CHAN_TYPE)
+ size = _mesa_bytes_per_pixel(srcImage->_BaseFormat, CHAN_TYPE)
* srcImage->Width * srcImage->Height * srcImage->Depth + 20;
/* 20 extra bytes, just be safe when calling last FetchTexel */
srcData = (GLubyte *) _mesa_malloc(size);
/* initialize new image */
_mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight,
- dstDepth, border, srcImage->IntFormat);
+ dstDepth, border, srcImage->InternalFormat);
dstImage->DriverData = NULL;
dstImage->TexFormat = srcImage->TexFormat;
dstImage->FetchTexelc = srcImage->FetchTexelc;
GLubyte *temp;
/* compress image from dstData into dstImage->Data */
const GLenum srcFormat = convertFormat->BaseFormat;
- GLint dstRowStride = _mesa_compressed_row_stride(srcImage->IntFormat,
- dstWidth);
+ GLint dstRowStride
+ = _mesa_compressed_row_stride(srcImage->InternalFormat, dstWidth);
ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA);
- dstImage->TexFormat->StoreImage(ctx, 2, dstImage->Format,
+ dstImage->TexFormat->StoreImage(ctx, 2, dstImage->_BaseFormat,
dstImage->TexFormat,
dstImage->Data,
0, 0, 0, /* dstX/Y/Zoffset */
baseLevel = texUnit->_Current->BaseLevel;
ASSERT(texUnit->_Current->Image[0][baseLevel]);
- format = texUnit->_Current->Image[0][baseLevel]->Format;
+ format = texUnit->_Current->Image[0][baseLevel]->_BaseFormat;
if (format == GL_COLOR_INDEX || format == GL_YCBCR_MESA) {
format = GL_RGBA; /* a bit of a hack */
ASSERT(tObj->WrapS == GL_REPEAT);
ASSERT(tObj->WrapT == GL_REPEAT);
ASSERT(img->Border == 0);
- ASSERT(img->Format != GL_COLOR_INDEX);
+ ASSERT(img->_BaseFormat != GL_COLOR_INDEX);
ASSERT(img->_IsPowerOfTwo);
COMPUTE_LINEAR_REPEAT_TEXEL_LOCATION(texcoord[0], u, width, i0, i1);
ASSERT(tObj->WrapS==GL_REPEAT);
ASSERT(tObj->WrapT==GL_REPEAT);
ASSERT(img->Border==0);
- ASSERT(img->Format==GL_RGB);
+ ASSERT(img->_BaseFormat==GL_RGB);
ASSERT(img->_IsPowerOfTwo);
for (k=0; k<n; k++) {
ASSERT(tObj->WrapS==GL_REPEAT);
ASSERT(tObj->WrapT==GL_REPEAT);
ASSERT(img->Border==0);
- ASSERT(img->Format==GL_RGBA);
+ ASSERT(img->_BaseFormat==GL_RGBA);
ASSERT(img->_IsPowerOfTwo);
for (i = 0; i < n; i++) {
const GLboolean repeatNoBorderPOT = (tObj->WrapS == GL_REPEAT)
&& (tObj->WrapT == GL_REPEAT)
&& (tImg->Border == 0 && (tImg->Width == tImg->RowStride))
- && (tImg->Format != GL_COLOR_INDEX)
+ && (tImg->_BaseFormat != GL_COLOR_INDEX)
&& tImg->_IsPowerOfTwo;
ASSERT(lambda != NULL);
ASSERT(tObj->WrapT == GL_CLAMP ||
tObj->WrapT == GL_CLAMP_TO_EDGE ||
tObj->WrapT == GL_CLAMP_TO_BORDER);
- ASSERT(img->Format != GL_COLOR_INDEX);
+ ASSERT(img->_BaseFormat != GL_COLOR_INDEX);
/* XXX move Wrap mode tests outside of loops for common cases */
for (i = 0; i < n; i++) {
ASSERT(tObj->WrapT == GL_CLAMP ||
tObj->WrapT == GL_CLAMP_TO_EDGE ||
tObj->WrapT == GL_CLAMP_TO_BORDER);
- ASSERT(img->Format != GL_COLOR_INDEX);
+ ASSERT(img->_BaseFormat != GL_COLOR_INDEX);
/* XXX lots of opportunity for optimization in this loop */
for (i = 0; i < n; i++) {
(void) lambda;
- ASSERT(tObj->Image[0][tObj->BaseLevel]->Format == GL_DEPTH_COMPONENT ||
- tObj->Image[0][tObj->BaseLevel]->Format == GL_DEPTH_STENCIL_EXT);
+ ASSERT(tObj->Image[0][tObj->BaseLevel]->_BaseFormat == GL_DEPTH_COMPONENT ||
+ tObj->Image[0][tObj->BaseLevel]->_BaseFormat == GL_DEPTH_STENCIL_EXT);
ASSERT(tObj->Target == GL_TEXTURE_1D ||
tObj->Target == GL_TEXTURE_2D ||
* GL_TEXTURE_COMPARE_SGIX == GL_TRUE but the current texture object
* isn't a depth texture.
*/
- if (texImage->Format != GL_DEPTH_COMPONENT) {
+ if (texImage->_BaseFormat != GL_DEPTH_COMPONENT) {
_mesa_problem(ctx,"GL_TEXTURE_COMPARE_SGIX enabled with non-depth texture");
return;
}
}
else {
const GLboolean needLambda = (GLboolean) (t->MinFilter != t->MagFilter);
- const GLenum format = t->Image[0][t->BaseLevel]->Format;
+ const GLenum format = t->Image[0][t->BaseLevel]->_BaseFormat;
switch (t->Target) {
case GL_TEXTURE_1D:
ASSERT(ctx->Driver.TexImage1D);
- if (texImage->Format == GL_DEPTH_COMPONENT) {
+ if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) {
/* read depth image from framebuffer */
GLfloat *image = read_depth_image(ctx, x, y, width, 1);
if (!image) {
&ctx->DefaultPacking, texObj, texImage);
_mesa_free(image);
}
- else if (texImage->Format == GL_DEPTH_STENCIL_EXT) {
+ else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
/* read depth/stencil image from framebuffer */
GLuint *image = read_depth_stencil_image(ctx, x, y, width, 1);
if (!image) {
ASSERT(ctx->Driver.TexImage2D);
- if (texImage->Format == GL_DEPTH_COMPONENT) {
+ if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) {
/* read depth image from framebuffer */
GLfloat *image = read_depth_image(ctx, x, y, width, height);
if (!image) {
&ctx->DefaultPacking, texObj, texImage);
_mesa_free(image);
}
- else if (texImage->Format == GL_DEPTH_STENCIL_EXT) {
+ else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
/* read depth/stencil image from framebuffer */
GLuint *image = read_depth_stencil_image(ctx, x, y, width, height);
if (!image) {
ASSERT(ctx->Driver.TexImage3D);
- if (texImage->Format == GL_DEPTH_COMPONENT) {
+ if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) {
/* read depth image from framebuffer */
GLfloat *image = read_depth_image(ctx, x, y, width, height);
if (!image) {
&ctx->DefaultPacking, texObj, texImage);
_mesa_free(image);
}
- else if (texImage->Format == GL_DEPTH_STENCIL_EXT) {
+ else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
/* read depth/stencil image from framebuffer */
GLuint *image = read_depth_stencil_image(ctx, x, y, width, height);
if (!image) {
info.twidth_log2 = obj->Image[0][b]->WidthLog2; \
info.smask = obj->Image[0][b]->Width - 1; \
info.tmask = obj->Image[0][b]->Height - 1; \
- info.format = obj->Image[0][b]->Format; \
+ info.format = obj->Image[0][b]->_BaseFormat; \
info.filter = obj->MinFilter; \
info.envmode = unit->EnvMode; \
span.arrayMask |= SPAN_RGBA; \
info.twidth_log2 = obj->Image[0][b]->WidthLog2; \
info.smask = obj->Image[0][b]->Width - 1; \
info.tmask = obj->Image[0][b]->Height - 1; \
- info.format = obj->Image[0][b]->Format; \
+ info.format = obj->Image[0][b]->_BaseFormat; \
info.filter = obj->MinFilter; \
info.envmode = unit->EnvMode; \
\