mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-26 05:40:49 +00:00
a few more f* -> gz* conversions. I don't have GL at work :)
This commit is contained in:
parent
083021da12
commit
73c6ffdde3
3 changed files with 22 additions and 22 deletions
|
@ -376,7 +376,7 @@ void VID_SetPalette (unsigned char *palette)
|
||||||
int k;
|
int k;
|
||||||
unsigned short i;
|
unsigned short i;
|
||||||
unsigned *table;
|
unsigned *table;
|
||||||
FILE *f;
|
gzFile *f;
|
||||||
char s[255];
|
char s[255];
|
||||||
float dist, bestdist;
|
float dist, bestdist;
|
||||||
static qboolean palflag = false;
|
static qboolean palflag = false;
|
||||||
|
@ -410,8 +410,8 @@ void VID_SetPalette (unsigned char *palette)
|
||||||
|
|
||||||
COM_FOpenFile("glquake/15to8.pal", &f);
|
COM_FOpenFile("glquake/15to8.pal", &f);
|
||||||
if (f) {
|
if (f) {
|
||||||
fread(d_15to8table, 1<<15, 1, f);
|
gzread(f, d_15to8table, 1<<15);
|
||||||
fclose(f);
|
gzclose(f);
|
||||||
} else {
|
} else {
|
||||||
for (i=0; i < (1<<15); i++) {
|
for (i=0; i < (1<<15); i++) {
|
||||||
/* Maps
|
/* Maps
|
||||||
|
|
|
@ -131,7 +131,7 @@ void VID_SetPalette (unsigned char *palette)
|
||||||
unsigned short i;
|
unsigned short i;
|
||||||
unsigned *table;
|
unsigned *table;
|
||||||
//#ifdef QUAKEWORLD
|
//#ifdef QUAKEWORLD
|
||||||
FILE *f;
|
gzFile *f;
|
||||||
char s[255];
|
char s[255];
|
||||||
//#endif
|
//#endif
|
||||||
float dist, bestdist;
|
float dist, bestdist;
|
||||||
|
@ -169,8 +169,8 @@ void VID_SetPalette (unsigned char *palette)
|
||||||
|
|
||||||
COM_FOpenFile("glquake/15to8.pal", &f);
|
COM_FOpenFile("glquake/15to8.pal", &f);
|
||||||
if (f) {
|
if (f) {
|
||||||
fread(d_15to8table, 1<<15, 1, f);
|
gzread(f, d_15to8table, 1<<15);
|
||||||
fclose(f);
|
gzclose(f);
|
||||||
} else
|
} else
|
||||||
//#endif // QUAKEWORLD
|
//#endif // QUAKEWORLD
|
||||||
{
|
{
|
||||||
|
|
|
@ -430,25 +430,25 @@ TargaHeader targa_header;
|
||||||
byte *targa_rgba;
|
byte *targa_rgba;
|
||||||
|
|
||||||
int
|
int
|
||||||
fgetLittleShort ( FILE *f ) {
|
gzgetLittleShort ( gzFile *f ) {
|
||||||
|
|
||||||
byte b1, b2;
|
byte b1, b2;
|
||||||
|
|
||||||
b1 = fgetc(f);
|
b1 = gzgetc(f);
|
||||||
b2 = fgetc(f);
|
b2 = gzgetc(f);
|
||||||
|
|
||||||
return (short)(b1 + b2*256);
|
return (short)(b1 + b2*256);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
fgetLittleLong (FILE *f) {
|
gzgetLittleLong (gzFile *f) {
|
||||||
|
|
||||||
byte b1, b2, b3, b4;
|
byte b1, b2, b3, b4;
|
||||||
|
|
||||||
b1 = fgetc(f);
|
b1 = gzgetc(f);
|
||||||
b2 = fgetc(f);
|
b2 = gzgetc(f);
|
||||||
b3 = fgetc(f);
|
b3 = gzgetc(f);
|
||||||
b4 = fgetc(f);
|
b4 = gzgetc(f);
|
||||||
|
|
||||||
return b1 + (b2<<8) + (b3<<16) + (b4<<24);
|
return b1 + (b2<<8) + (b3<<16) + (b4<<24);
|
||||||
}
|
}
|
||||||
|
@ -457,15 +457,15 @@ fgetLittleLong (FILE *f) {
|
||||||
LoadTGA
|
LoadTGA
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
LoadTGA (FILE *fin) {
|
LoadTGA (gzFile *fin) {
|
||||||
|
|
||||||
int columns, rows, numPixels;
|
int columns, rows, numPixels;
|
||||||
byte *pixbuf;
|
byte *pixbuf;
|
||||||
int row, column;
|
int row, column;
|
||||||
|
|
||||||
targa_header.id_length = fgetc(fin);
|
targa_header.id_length = gzgetc(fin);
|
||||||
targa_header.colormap_type = fgetc(fin);
|
targa_header.colormap_type = gzgetc(fin);
|
||||||
targa_header.image_type = fgetc(fin);
|
targa_header.image_type = gzgetc(fin);
|
||||||
|
|
||||||
targa_header.colormap_index = fgetLittleShort(fin);
|
targa_header.colormap_index = fgetLittleShort(fin);
|
||||||
targa_header.colormap_length = fgetLittleShort(fin);
|
targa_header.colormap_length = fgetLittleShort(fin);
|
||||||
|
@ -474,8 +474,8 @@ LoadTGA (FILE *fin) {
|
||||||
targa_header.y_origin = fgetLittleShort(fin);
|
targa_header.y_origin = fgetLittleShort(fin);
|
||||||
targa_header.width = fgetLittleShort(fin);
|
targa_header.width = fgetLittleShort(fin);
|
||||||
targa_header.height = fgetLittleShort(fin);
|
targa_header.height = fgetLittleShort(fin);
|
||||||
targa_header.pixel_size = fgetc(fin);
|
targa_header.pixel_size = gzgetc(fin);
|
||||||
targa_header.attributes = fgetc(fin);
|
targa_header.attributes = gzgetc(fin);
|
||||||
|
|
||||||
if (targa_header.image_type!=2 && targa_header.image_type!=10)
|
if (targa_header.image_type!=2 && targa_header.image_type!=10)
|
||||||
Sys_Error ("LoadTGA: Only type 2 and 10 targa RGB images supported\n");
|
Sys_Error ("LoadTGA: Only type 2 and 10 targa RGB images supported\n");
|
||||||
|
@ -492,7 +492,7 @@ LoadTGA (FILE *fin) {
|
||||||
targa_rgba = malloc (numPixels*4);
|
targa_rgba = malloc (numPixels*4);
|
||||||
|
|
||||||
if (targa_header.id_length != 0)
|
if (targa_header.id_length != 0)
|
||||||
fseek(fin, targa_header.id_length, SEEK_CUR); // skip TARGA image comment
|
gzseek(fin, targa_header.id_length, SEEK_CUR); // skip TARGA image comment
|
||||||
|
|
||||||
if (targa_header.image_type==2) { // Uncompressed, RGB images
|
if (targa_header.image_type==2) { // Uncompressed, RGB images
|
||||||
for(row=rows-1; row>=0; row--) {
|
for(row=rows-1; row>=0; row--) {
|
||||||
|
@ -613,7 +613,7 @@ void
|
||||||
R_LoadSkys ( void ) {
|
R_LoadSkys ( void ) {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
FILE *f;
|
gzFile *f;
|
||||||
char name[64];
|
char name[64];
|
||||||
|
|
||||||
for (i=0 ; i<6 ; i++) {
|
for (i=0 ; i<6 ; i++) {
|
||||||
|
|
Loading…
Reference in a new issue