summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2007-07-17 03:41:28 +0000
committerpixel <pixel>2007-07-17 03:41:28 +0000
commit361ffb7254647b9bfaf8f247945e226e451c513e (patch)
treeb3a589ee7de689573f3c0c59046ba69c3ae214ba
parentf23d2c9f6e14e26abbea0efdb3b545e985871d6a (diff)
Adding width and height pointers.
-rw-r--r--include/dds.h2
-rw-r--r--lib/dds.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/include/dds.h b/include/dds.h
index d16d3ac..417c755 100644
--- a/include/dds.h
+++ b/include/dds.h
@@ -8,7 +8,7 @@ extern "C" {
int ddsInit();
// returns the OpenGL-generated texture index.
-int loadCompressedTexture( const char *fname );
+int loadCompressedTexture( const char *fname, int * width, int * height );
#ifdef __cplusplus
}
diff --git a/lib/dds.c b/lib/dds.c
index 019ae36..4939e1b 100644
--- a/lib/dds.c
+++ b/lib/dds.c
@@ -232,7 +232,7 @@ static DDS_IMAGE_DATA* loadDDSTextureFile( const char *filename )
return pDDSImageData;
}
-int loadCompressedTexture( const char *fname )
+int loadCompressedTexture( const char *fname, int * pwidth, int * pheight )
{
int g_compressedTextureID;
DDS_IMAGE_DATA *pDDSImageData = loadDDSTextureFile( fname );
@@ -243,6 +243,11 @@ int loadCompressedTexture( const char *fname )
int nWidth = pDDSImageData->width;
int nNumMipMaps = pDDSImageData->numMipMaps;
+ if (pwidth)
+ *pwidth = nWidth;
+ if (pheight)
+ *pheight = nHeight;
+
int nBlockSize;
if( pDDSImageData->format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT )