mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-26 05:51:36 +00:00
0bd4b8d288
new function WriteTGAfile. Also, put in the tga header structure. NOTE: this is currently broken for non gcc ocmilers. you will get a #error message. include/quakefs.h source/quakefs.c: new function COM_WriteBuffers. Like COM_WriteFile, but scatter/gather style. source/gl_screen.c source/screen.c: misc cleanups. differences are getting fewer. should be mostly mergable soon (minus truly sw/gl specific code).
57 lines
1.7 KiB
C
57 lines
1.7 KiB
C
/*
|
|
tga.h
|
|
|
|
targa image hangling
|
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; either version 2
|
|
of the License, or (at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to:
|
|
|
|
Free Software Foundation, Inc.
|
|
59 Temple Place - Suite 330
|
|
Boston, MA 02111-1307, USA
|
|
|
|
$Id$
|
|
*/
|
|
|
|
#ifndef __tga_h
|
|
#define __tga_h
|
|
|
|
#include "gcc_attr.h"
|
|
#include "qtypes.h"
|
|
|
|
#ifndef __GNUC__
|
|
#error do some data packing magic here (#pragma pack?)
|
|
#endif
|
|
|
|
typedef struct _TargaHeader {
|
|
unsigned char id_length __attribute__((packed));
|
|
unsigned char colormap_type __attribute__((packed));
|
|
unsigned char image_type __attribute__((packed));
|
|
unsigned short colormap_index __attribute__((packed));
|
|
unsigned short colormap_length __attribute__((packed));
|
|
unsigned char colormap_size __attribute__((packed));
|
|
unsigned short x_origin __attribute__((packed));
|
|
unsigned short y_origin __attribute__((packed));
|
|
unsigned short width __attribute__((packed));
|
|
unsigned short height __attribute__((packed));
|
|
unsigned char pixel_size __attribute__((packed));
|
|
unsigned char attributes __attribute__((packed));
|
|
} TargaHeader;
|
|
|
|
byte *LoadTGA (QFile *fin);
|
|
void WriteTGAfile (const char *tganame, byte *data, int width, int height);
|
|
|
|
#endif // __tga_h
|