Skip to content

Commit

Permalink
* Consolidate tr_image_*.h headers into tr_local.h to more closely fo…
Browse files Browse the repository at this point in the history
…llow the

  Q3 coding style
* Prefix image loaders with R_ now they're non-static
  • Loading branch information
timangus committed Feb 14, 2008
1 parent 84f3247 commit a5b51a9
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 23 deletions.
19 changes: 6 additions & 13 deletions code/renderer/tr_image.c
Expand Up @@ -22,13 +22,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// tr_image.c
#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 unsigned char s_gammatable[256];

Expand Down Expand Up @@ -801,12 +794,12 @@ typedef struct
// when there are multiple images of different formats available
static imageExtToLoaderMap_t imageLoaders[ ] =
{
{ "tga", LoadTGA },
{ "jpg", LoadJPG },
{ "jpeg", LoadJPG },
{ "png", LoadPNG },
{ "pcx", LoadPCX },
{ "bmp", LoadBMP }
{ "tga", R_LoadTGA },
{ "jpg", R_LoadJPG },
{ "jpeg", R_LoadJPG },
{ "png", R_LoadPNG },
{ "pcx", R_LoadPCX },
{ "bmp", R_LoadBMP }
};

static int numImageLoaders = sizeof( imageLoaders ) /
Expand Down
2 changes: 1 addition & 1 deletion code/renderer/tr_image_bmp.c
Expand Up @@ -42,7 +42,7 @@ typedef struct
unsigned char palette[256][4];
} 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;
unsigned numPixels;
Expand Down
1 change: 0 additions & 1 deletion code/renderer/tr_image_bmp.h

This file was deleted.

2 changes: 1 addition & 1 deletion code/renderer/tr_image_jpg.c
Expand Up @@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define JPEG_INTERNALS
#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
* working space (which is allocated as needed by the JPEG library).
*/
Expand Down
1 change: 0 additions & 1 deletion code/renderer/tr_image_jpg.h

This file was deleted.

2 changes: 1 addition & 1 deletion code/renderer/tr_image_pcx.c
Expand Up @@ -48,7 +48,7 @@ typedef struct {
unsigned char data[];
} 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 *end;
Expand Down
1 change: 0 additions & 1 deletion code/renderer/tr_image_pcx.h

This file was deleted.

2 changes: 1 addition & 1 deletion code/renderer/tr_image_png.c
Expand Up @@ -1889,7 +1889,7 @@ static qboolean DecodeImageInterlaced(struct PNG_Chunk_IHDR *IHDR,
* 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;
byte *OutBuffer;
Expand Down
1 change: 0 additions & 1 deletion code/renderer/tr_image_png.h

This file was deleted.

2 changes: 1 addition & 1 deletion code/renderer/tr_image_tga.c
Expand Up @@ -38,7 +38,7 @@ typedef struct _TargaHeader {
unsigned char pixel_size, attributes;
} 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;
byte *pixbuf;
Expand Down
1 change: 0 additions & 1 deletion code/renderer/tr_image_tga.h

This file was deleted.

14 changes: 14 additions & 0 deletions code/renderer/tr_local.h
Expand Up @@ -1481,6 +1481,20 @@ void R_MDRAddAnimSurfaces( trRefEntity_t *ent );
void RB_MDRSurfaceAnim( md4Surface_t *surface );
#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 );

/*
=============================================================
=============================================================
Expand Down

0 comments on commit a5b51a9

Please sign in to comment.