cleanup unused vars

This commit is contained in:
Bill Currie 2003-03-20 23:02:53 +00:00
parent b2bc3f13ea
commit 32257923a5

View file

@ -293,8 +293,8 @@ decode_truecolor_32_rle (TargaHeader *targa, tex_t *tex, byte *dataByte)
struct tex_s * struct tex_s *
LoadTGA (QFile *fin) LoadTGA (QFile *fin)
{ {
byte *dataByte, *pixcol, *pixrow; byte *dataByte;
int column, row, columns, rows, numPixels, span, targa_mark; int numPixels, targa_mark;
TargaHeader *targa; TargaHeader *targa;
tex_t *tex; tex_t *tex;
@ -317,32 +317,27 @@ LoadTGA (QFile *fin)
Sys_Error ("Texture_LoadTGA: Only 32 or 24 bit images supported " Sys_Error ("Texture_LoadTGA: Only 32 or 24 bit images supported "
"(no colormaps)"); "(no colormaps)");
columns = targa->width; numPixels = targa->width * targa->height;
rows = targa->height;
numPixels = columns * rows; tex = Hunk_TempAlloc (field_offset (tex_t, data[numPixels * 4]));
tex->width = targa->width;
tex->height = targa->height;
tex->palette = 0;
switch (targa->pixel_size) { switch (targa->pixel_size) {
case 24: case 24:
tex = Hunk_TempAlloc (field_offset (tex_t, data[numPixels * 4]));
tex->format = tex_rgb; tex->format = tex_rgb;
break; break;
default: default:
case 32: case 32:
tex = Hunk_TempAlloc (field_offset (tex_t, data[numPixels * 4]));
tex->format = tex_rgba; tex->format = tex_rgba;
break; break;
} }
tex->width = columns;
tex->height = rows;
tex->palette = 0;
// skip TARGA image comment // skip TARGA image comment
dataByte = (byte *) (targa + 1); dataByte = (byte *) (targa + 1);
dataByte += targa->id_length; dataByte += targa->id_length;
span = columns * 4; // tex->format
if (targa->image_type == 2) { // Uncompressed image if (targa->image_type == 2) { // Uncompressed image
switch (targa->pixel_size) { switch (targa->pixel_size) {
case 24: case 24: