mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-30 07:41:16 +00:00
* Consolidate tr_image_*.h headers into tr_local.h to more closely follow the
Q3 coding style * Prefix image loaders with R_ now they're non-static
This commit is contained in:
parent
84f32478b9
commit
a5b51a95d7
12 changed files with 25 additions and 23 deletions
|
@ -22,13 +22,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
// tr_image.c
|
// tr_image.c
|
||||||
#include "tr_local.h"
|
#include "tr_local.h"
|
||||||
|
|
||||||
|
|
||||||
#include "tr_image_bmp.h"
|
|
||||||
#include "tr_image_jpg.h"
|
|
||||||
#include "tr_image_pcx.h"
|
|
||||||
#include "tr_image_png.h"
|
|
||||||
#include "tr_image_tga.h"
|
|
||||||
|
|
||||||
static byte s_intensitytable[256];
|
static byte s_intensitytable[256];
|
||||||
static unsigned char s_gammatable[256];
|
static unsigned char s_gammatable[256];
|
||||||
|
|
||||||
|
@ -801,12 +794,12 @@ typedef struct
|
||||||
// when there are multiple images of different formats available
|
// when there are multiple images of different formats available
|
||||||
static imageExtToLoaderMap_t imageLoaders[ ] =
|
static imageExtToLoaderMap_t imageLoaders[ ] =
|
||||||
{
|
{
|
||||||
{ "tga", LoadTGA },
|
{ "tga", R_LoadTGA },
|
||||||
{ "jpg", LoadJPG },
|
{ "jpg", R_LoadJPG },
|
||||||
{ "jpeg", LoadJPG },
|
{ "jpeg", R_LoadJPG },
|
||||||
{ "png", LoadPNG },
|
{ "png", R_LoadPNG },
|
||||||
{ "pcx", LoadPCX },
|
{ "pcx", R_LoadPCX },
|
||||||
{ "bmp", LoadBMP }
|
{ "bmp", R_LoadBMP }
|
||||||
};
|
};
|
||||||
|
|
||||||
static int numImageLoaders = sizeof( imageLoaders ) /
|
static int numImageLoaders = sizeof( imageLoaders ) /
|
||||||
|
|
|
@ -42,7 +42,7 @@ typedef struct
|
||||||
unsigned char palette[256][4];
|
unsigned char palette[256][4];
|
||||||
} BMPHeader_t;
|
} BMPHeader_t;
|
||||||
|
|
||||||
void LoadBMP( const char *name, byte **pic, int *width, int *height )
|
void R_LoadBMP( const char *name, byte **pic, int *width, int *height )
|
||||||
{
|
{
|
||||||
int columns, rows;
|
int columns, rows;
|
||||||
unsigned numPixels;
|
unsigned numPixels;
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
void LoadBMP( const char *name, byte **pic, int *width, int *height );
|
|
|
@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#define JPEG_INTERNALS
|
#define JPEG_INTERNALS
|
||||||
#include "../jpeg-6/jpeglib.h"
|
#include "../jpeg-6/jpeglib.h"
|
||||||
|
|
||||||
void LoadJPG( const char *filename, unsigned char **pic, int *width, int *height ) {
|
void R_LoadJPG( const char *filename, unsigned char **pic, int *width, int *height ) {
|
||||||
/* This struct contains the JPEG decompression parameters and pointers to
|
/* This struct contains the JPEG decompression parameters and pointers to
|
||||||
* working space (which is allocated as needed by the JPEG library).
|
* working space (which is allocated as needed by the JPEG library).
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
void LoadJPG( const char *name, byte **pic, int *width, int *height );
|
|
|
@ -48,7 +48,7 @@ typedef struct {
|
||||||
unsigned char data[];
|
unsigned char data[];
|
||||||
} pcx_t;
|
} pcx_t;
|
||||||
|
|
||||||
void LoadPCX ( const char *filename, byte **pic, int *width, int *height)
|
void R_LoadPCX ( const char *filename, byte **pic, int *width, int *height)
|
||||||
{
|
{
|
||||||
byte *raw;
|
byte *raw;
|
||||||
byte *end;
|
byte *end;
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
void LoadPCX( const char *name, byte **pic, int *width, int *height );
|
|
|
@ -1889,7 +1889,7 @@ static qboolean DecodeImageInterlaced(struct PNG_Chunk_IHDR *IHDR,
|
||||||
* The PNG loader
|
* The PNG loader
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void LoadPNG(const char *name, byte **pic, int *width, int *height)
|
void R_LoadPNG(const char *name, byte **pic, int *width, int *height)
|
||||||
{
|
{
|
||||||
struct BufferedFile *ThePNG;
|
struct BufferedFile *ThePNG;
|
||||||
byte *OutBuffer;
|
byte *OutBuffer;
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
void LoadPNG( const char *name, byte **pic, int *width, int *height );
|
|
|
@ -38,7 +38,7 @@ typedef struct _TargaHeader {
|
||||||
unsigned char pixel_size, attributes;
|
unsigned char pixel_size, attributes;
|
||||||
} TargaHeader;
|
} TargaHeader;
|
||||||
|
|
||||||
void LoadTGA ( const char *name, byte **pic, int *width, int *height)
|
void R_LoadTGA ( const char *name, byte **pic, int *width, int *height)
|
||||||
{
|
{
|
||||||
unsigned columns, rows, numPixels;
|
unsigned columns, rows, numPixels;
|
||||||
byte *pixbuf;
|
byte *pixbuf;
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
void LoadTGA( const char *name, byte **pic, int *width, int *height );
|
|
|
@ -1481,6 +1481,20 @@ void R_MDRAddAnimSurfaces( trRefEntity_t *ent );
|
||||||
void RB_MDRSurfaceAnim( md4Surface_t *surface );
|
void RB_MDRSurfaceAnim( md4Surface_t *surface );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
=============================================================
|
||||||
|
|
||||||
|
IMAGE LOADERS
|
||||||
|
|
||||||
|
=============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
void R_LoadBMP( const char *name, byte **pic, int *width, int *height );
|
||||||
|
void R_LoadJPG( const char *name, byte **pic, int *width, int *height );
|
||||||
|
void R_LoadPCX( const char *name, byte **pic, int *width, int *height );
|
||||||
|
void R_LoadPNG( const char *name, byte **pic, int *width, int *height );
|
||||||
|
void R_LoadTGA( const char *name, byte **pic, int *width, int *height );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============================================================
|
=============================================================
|
||||||
=============================================================
|
=============================================================
|
||||||
|
|
Loading…
Reference in a new issue